{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"trip-itinerary","type":"registry:component","title":"Trip Itinerary","description":"Arrange travel stops by date and time without map or calendar sync.","author":"Notion Arena","categories":["planning"],"tags":["widget","free","travel","itinerary","trip planner","schedule","offline"],"meta":{"kind":"widget","tier":"free","version":"1.0.0","updatedAt":"2026-10-11","notionPlan":"Free","emoji":"🧭","delivery":["embed","html-block","download"],"capabilities":{"interactive":true,"offlineSafe":true,"persistsLocally":true,"writesToNotion":false,"needsNetwork":false},"embedUrl":"https://notionarena.vercel.app/embed/trip-itinerary","fileUrl":"https://notionarena.vercel.app/widgets/trip-itinerary.html","downloadUrl":"https://notionarena.vercel.app/api/widget/trip-itinerary","height":360,"minHeight":260,"maxHeight":520,"params":[{"key":"label","label":"Trip title","type":"text","default":"Trip itinerary"},{"key":"accent","label":"Accent","type":"color","default":"#2383e2"},{"key":"theme","label":"Theme","type":"select","default":"auto","options":[{"value":"auto","label":"Match Notion"},{"value":"light","label":"Light"},{"value":"dark","label":"Dark"}]}]},"files":[{"path":"widgets/trip-itinerary.html","type":"registry:file","target":"notion/widgets/trip-itinerary.html","content":"<!doctype html>\n<html lang=\"en\" data-theme=\"auto\">\n<head>\n<meta charset=\"utf-8\" /><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />\n<title>Trip Itinerary</title>\n<style>\n:root{--bg:#fff;--fg:#37352f;--muted:#787774;--surface:#f7f7f5;--border:#e9e9e7;--accent:#2383e2;--accent-ink:#fff;--accent-text:var(--accent)--danger:#c24136;--font:ui-sans-serif,-apple-system,BlinkMacSystemFont,\"Segoe UI\",Helvetica,Arial,sans-serif}\nhtml[data-theme=\"dark\"]{--bg:#191919;--fg:#e6e6e4;--muted:#9b9a97;--surface:#252525;--border:#343434;--danger:#ff7369}\n@media(prefers-color-scheme:dark){html[data-theme=\"auto\"]{--bg:#191919;--fg:#e6e6e4;--muted:#9b9a97;--surface:#252525;--border:#343434;--danger:#ff7369}}\n*{box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}html,body{margin:0;height:100%}body{background:var(--bg);color:var(--fg);font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,\"Segoe UI\",Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;overflow:hidden}\n.wrap{height:100%;min-height:260px;display:flex;flex-direction:column;gap:8px;padding:13px;overflow:auto}.head{display:flex;align-items:center;justify-content:space-between;gap:8px}.kicker{font-size:9px;text-transform:uppercase;letter-spacing:.1em;color:var(--muted);font-weight:650}.title{font-size:13.5px;font-weight:650;margin-top:2px}.form{display:grid;grid-template-columns:minmax(0,1fr) 105px 78px auto;gap:5px}.form input{min-width:0;height:29px;border:1px solid var(--border);border-radius:7px;background:var(--surface);color:var(--fg);padding:4px 6px;font:inherit;font-size:9.5px}.form .activity{grid-column:1/3}.form input:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.form button{height:29px;border:1px solid var(--accent);border-radius:7px;background:var(--accent);color:var(--accent-ink);font:inherit;font-size:9.5px;padding:4px 7px;cursor:pointer}.list{display:flex;min-height:60px;flex:1;flex-direction:column;gap:4px;overflow:auto}.entry{display:grid;grid-template-columns:46px minmax(0,1fr) 26px;gap:2px 7px;padding:6px 7px;border:1px solid var(--border);border-radius:7px;background:var(--surface)}.time{grid-row:1/3;font-size:9px;font-variant-numeric:tabular-nums;color:var(--accent-text);font-weight:650}.activityText{min-width:0;overflow-wrap:anywhere;font-size:10px;font-weight:600}.place{min-width:0;overflow-wrap:anywhere;font-size:9px;color:var(--muted)}.remove{grid-column:3;grid-row:1/3;width:25px;height:25px;border:1px solid var(--border);border-radius:6px;background:var(--bg);color:var(--muted);cursor:pointer}.remove:hover{border-color:var(--danger);color:var(--danger)}.clear{min-height:25px;border:1px solid var(--border);border-radius:6px;background:var(--surface);color:var(--muted);font:inherit;font-size:9px;padding:3px 7px;cursor:pointer}.clear:hover{border-color:var(--danger);color:var(--danger)}.foot{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:9px;color:var(--muted)}.empty{text-align:center;padding:12px;color:var(--muted);font-size:10px}\n@media(max-width:360px){.wrap{padding:10px}.form{grid-template-columns:minmax(0,1fr) 85px 72px auto;gap:3px}.form input{font-size:8.5px}.entry{gap:2px 5px}}\n@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}\n</style>\n</head>\n<body><main class=\"wrap\">\n  <header class=\"head\"><div><div class=\"kicker\">Offline travel plan</div><div class=\"title\" id=\"title\">Trip itinerary</div></div><div class=\"foot\" id=\"count\">0 stops</div></header>\n  <form class=\"form\" id=\"form\"><label class=\"sr-only\" for=\"activity\">Activity</label><input class=\"activity\" id=\"activity\" maxlength=\"80\" placeholder=\"Activity or event\" required /><label class=\"sr-only\" for=\"place\">Place</label><input id=\"place\" maxlength=\"80\" placeholder=\"Place, optional\" /><label class=\"sr-only\" for=\"date\">Date</label><input id=\"date\" type=\"date\" required /><label class=\"sr-only\" for=\"time\">Time</label><input id=\"time\" type=\"time\" /><button type=\"submit\">Add</button></form>\n  <section class=\"list\" id=\"list\" aria-label=\"Trip stops\"></section>\n  <div class=\"foot\"><span id=\"status\" aria-live=\"polite\">Itinerary is saved only in this browser.</span><button class=\"clear\" id=\"clear\" type=\"button\">Clear</button></div>\n</main>\n<script>\n(function(){\n  var cfgEl=document.getElementById('bk-config'),base={};try{base=cfgEl?JSON.parse(cfgEl.textContent||'{}'):{};}catch(e){}\n  var q=new URLSearchParams(location.search),c={};for(var k in base)c[k]=base[k];q.forEach(function(v,k){c[k]=v;});\n  function safeColor(v,d){return /^#[0-9a-f]{6}$/i.test(String(v||''))?String(v):d;}\n  function rgb(hex){var s=String(hex).slice(1);return [0,2,4].map(function(i){return parseInt(s.slice(i,i+2),16);});}\n  function luminance(values){return values.map(function(v){v/=255;return v<=.04045?v/12.92:Math.pow((v+.055)/1.055,2.4);}).reduce(function(a,v,i){return a+v*[.2126,.7152,.0722][i];},0);}\n  function contrast(a,b){var x=luminance(a),y=luminance(b);return (Math.max(x,y)+.05)/(Math.min(x,y)+.05);}\n  function accentInk(hex){var c=rgb(hex);return contrast(c,[255,255,255])>=contrast(c,[0,0,0])?'#fff':'#000';}\n  function accentText(hex){var dark=theme==='dark'||(theme==='auto'&&window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches),bg=rgb(dark?'#252525':'#f7f7f5'),base=rgb(hex),target=dark?[255,255,255]:[0,0,0];if(contrast(base,bg)>=4.5)return hex;for(var t=.02;t<=1;t+=.02){var mix=base.map(function(v,i){return Math.round(v+(target[i]-v)*t);});if(contrast(mix,bg)>=4.5)return '#'+mix.map(function(v){return v.toString(16).padStart(2,'0');}).join('');}return dark?'#fff':'#191919';}\n  function setAccentText(){document.documentElement.style.setProperty('--accent-text',accentText(ACCENT));}\n  var theme=['auto','light','dark'].indexOf(String(c.theme||'auto'))>-1?String(c.theme||'auto'):'auto',ACCENT=safeColor(c.accent,'#2383e2'),LABEL=String(c.label||'Trip itinerary').slice(0,48);\n  document.documentElement.setAttribute('data-theme',theme);document.documentElement.style.setProperty('--accent',ACCENT);document.documentElement.style.setProperty('--accent-ink',accentInk(ACCENT));setAccentText();if(theme==='auto'&&window.matchMedia){var scheme=window.matchMedia('(prefers-color-scheme: dark)');if(scheme.addEventListener)scheme.addEventListener('change',setAccentText);else if(scheme.addListener)scheme.addListener(setAccentText);}document.getElementById('title').textContent=LABEL;document.title=LABEL;\n  function hash(s){var h=5381;for(var i=0;i<s.length;i++)h=((h<<5)-h+s.charCodeAt(i))|0;return 't'+(h>>>0).toString(36);}\n  var id=hash(LABEL),KEY='notion-arena.trip-itinerary.v1',store={trips:{}},entries=[];\n  try{var saved=JSON.parse(localStorage.getItem(KEY)||'{}');if(saved&&saved.trips)store=saved;if(store.trips&&Array.isArray(store.trips[id]))entries=store.trips[id].filter(function(x){return x&&typeof x.title==='string';}).slice(0,40).map(function(x){return{title:String(x.title).slice(0,80),place:String(x.place||'').slice(0,80),date:/^\\d{4}-\\d{2}-\\d{2}$/.test(String(x.date||''))?x.date:'',time:/^\\d{2}:\\d{2}$/.test(String(x.time||''))?x.time:''};});}catch(e){}\n  function save(){if(!store.trips)store.trips={};store.trips[id]=entries;var keys=Object.keys(store.trips);while(keys.length>8){var old=keys.shift();if(old===id){keys.push(old);continue;}delete store.trips[old];}try{localStorage.setItem(KEY,JSON.stringify(store));}catch(e){}}\n  function render(){var list=document.getElementById('list');while(list.firstChild)list.removeChild(list.firstChild);entries.sort(function(a,b){return(a.date+' '+(a.time||'99:99')).localeCompare(b.date+' '+(b.time||'99:99'));});entries.forEach(function(entry,index){var row=document.createElement('div'),time=document.createElement('div'),title=document.createElement('div'),place=document.createElement('div'),remove=document.createElement('button');row.className='entry';time.className='time';time.textContent=(entry.date?new Date(entry.date+'T00:00:00').toLocaleDateString(undefined,{month:'short',day:'numeric'}):'Date?')+(entry.time?' · '+entry.time:'');title.className='activityText';title.textContent=entry.title;place.className='place';place.textContent=entry.place||' ';remove.className='remove';remove.type='button';remove.textContent='×';remove.setAttribute('aria-label','Remove '+entry.title);remove.addEventListener('click',function(){entries.splice(index,1);save();render();});row.appendChild(time);row.appendChild(title);row.appendChild(place);row.appendChild(remove);list.appendChild(row);});document.getElementById('count').textContent=entries.length+' stops';document.getElementById('status').textContent='Private to this browser. No map or calendar sync.';if(!entries.length){var empty=document.createElement('div');empty.className='empty';empty.textContent='No itinerary stops yet. Add one above.';list.appendChild(empty);}}\n  document.getElementById('form').addEventListener('submit',function(e){e.preventDefault();var title=document.getElementById('activity').value.trim(),date=document.getElementById('date').value;if(!title||!date)return;if(entries.length>=40){document.getElementById('status').textContent='Stop limit reached.';return;}entries.push({title:title.slice(0,80),place:document.getElementById('place').value.trim().slice(0,80),date:date,time:document.getElementById('time').value});document.getElementById('activity').value='';document.getElementById('place').value='';document.getElementById('date').value='';document.getElementById('time').value='';save();render();});\n  document.getElementById('clear').addEventListener('click',function(){entries=[];save();render();});render();save();\n})();\n</script>\n</body>\n</html>\n"}]}