Introduces: - src/api/fixtures/products.js + src/api/index.js — placeholder catalog (24 products across Kaiser-Natron / Holste / Gazelle / Grüne Tante / Linda) so search has real data. Same shape the backend will return. - Search.vue — Teleported dialog. Token-scored, diacritics-folded, ß→ss normalized so German terms still match when users type ASCII. Keyboard navigation (↑/↓/Enter/Esc), autofocus on open, scroll-lock. Full-screen on mobile, centered command-palette modal on md+. Tone prop defaults to 'brand' so the overlay reads as the site's primary affordance (green), with 'paper' and 'cream' variants available. - SearchSection.vue + ds-search route + sidebar entry. - DE + EN strings for the overlay and the showcase. Navbar wires the triggers: desktop search button sits left of the LanguageSwitcher in the right cluster; mobile gets a matching bottom- left floating button (cream surface, safe-area padded) that mirrors the existing bottom-right cart/menu cluster. The Search overlay is mounted inside Navbar with the default catalog, so every page that renders a Navbar gets search for free. Selected products bubble up as a @select event for navigation handling. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 line
1.3 KiB
JavaScript
1 line
1.3 KiB
JavaScript
import{$ as e,C as t,L as n,o as r,r as i,tt as a,u as o,x as s}from"./runtime-core.esm-bundler-CjdnoyKJ.js";import{t as c}from"./i18n-DUHlbRTU.js";var l=[`aria-label`,`aria-pressed`,`onClick`],u={__name:`LanguageSwitcher`,props:{floating:{type:Boolean,default:!1},tone:{type:String,default:`paper`,validator:e=>[`paper`,`cream`,`brand`].includes(e)}},setup(u){let d=u,{locale:f,setLocale:p,availableLocales:m}=c(),h={paper:{container:`border border-line bg-paper`,active:`bg-brand text-accent`,inactive:`text-muted hover:text-brand`},cream:{container:`border border-line-strong bg-paper`,active:`bg-brand text-accent`,inactive:`text-muted hover:text-brand`},brand:{container:`border border-cream-line bg-cream-wash`,active:`bg-accent text-brand`,inactive:`text-cream hover:text-accent`}},g=r(()=>h[d.tone]);return(r,c)=>(s(),o(`div`,{role:`group`,"aria-label":`Language`,class:e([`inline-flex items-center p-1 gap-0.5 rounded-pill font-sans`,g.value.container,u.floating?`fixed top-6 right-6 z-[60] shadow-sm`:``])},[(s(!0),o(i,null,t(n(m),t=>(s(),o(`button`,{key:t.code,type:`button`,"aria-label":t.name,"aria-pressed":n(f)===t.code,class:e([`px-2.5 py-1 text-[11px] font-bold tracking-eyebrow rounded-pill transition-colors duration-base`,n(f)===t.code?g.value.active:g.value.inactive]),onClick:e=>n(p)(t.code)},a(t.label),11,l))),128))],2))}};export{u as t}; |