added second product example
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
||||
import{A as e,S as t,W as n,c as r,ct as i,m as a,p as o,s,x as c,z as l}from"./runtime-core.esm-bundler-DgkFZzbt.js";import{t as u}from"./Icon-D1Ud4H_f.js";import{t as d}from"./i18n-BxXwPz8H.js";import{a as f,i as p,n as m,o as h,r as g,t as _}from"./api-4Jnm40kQ.js";import{t as v}from"./Button-CajVMpo0.js";import{t as y}from"./CartDrawer-CbYC7UR_.js";import{t as b}from"./SectionShell-CHsfR9Y3.js";var x={class:`eyebrow mb-5`},S={class:`rounded-md border border-line bg-paper p-6 flex flex-col sm:flex-row sm:items-center gap-4`},C={class:`text-[13px] text-muted`},w={class:`eyebrow mb-5`},T={class:`text-[15px] text-muted leading-relaxed mb-4 max-w-2xl`},E={class:`eyebrow mb-5`},D={__name:`CartDrawerSection`,setup(D){let{t:O}=d(),k=h(),A=l(!1);async function j(){await m(),await _(`kaiser-natron-pulver-250-g-grosspackung`,2),await _(`kaiser-natron-bad-500-g`,1),A.value=!0}async function M({productId:e,quantity:t}){await f(e,t)}async function N(e){await p(e)}return c(()=>{g()}),(c,l)=>(t(),r(b,{eyebrow:n(O)(`ds.eyebrow.components`),title:n(O)(`ds.cartDrawer.title`),description:n(O)(`ds.cartDrawer.description`)},{default:e(()=>[s(`section`,null,[s(`h2`,x,i(n(O)(`ds.heading.default`)),1),s(`div`,S,[a(v,{variant:`primary`,onClick:j},{before:e(()=>[a(u,{name:`cart`,size:18})]),default:e(()=>[o(` `+i(n(O)(`ds.cartDrawer.demoLabel`)),1)]),_:1}),s(`p`,C,i(n(O)(`ds.cartDrawer.demoHint`)),1)])]),s(`section`,null,[s(`h2`,w,i(n(O)(`ds.cartDrawer.integrationTitle`)),1),s(`p`,T,i(n(O)(`ds.cartDrawer.integrationBody`)),1),l[2]||=s(`div`,{class:`rounded-md border border-line bg-paper p-6 font-mono text-[12px] text-ink`},[s(`pre`,{class:`whitespace-pre-wrap`},`import {
|
||||
import{A as e,S as t,W as n,c as r,ct as i,m as a,p as o,s,x as c,z as l}from"./runtime-core.esm-bundler-DgkFZzbt.js";import{t as u}from"./Icon-D1Ud4H_f.js";import{t as d}from"./i18n-BxXwPz8H.js";import{a as f,i as p,n as m,o as h,r as g,t as _}from"./api-BC2UGBdg.js";import{t as v}from"./Button-CajVMpo0.js";import{t as y}from"./CartDrawer-BZqK1kPc.js";import{t as b}from"./SectionShell-CHsfR9Y3.js";var x={class:`eyebrow mb-5`},S={class:`rounded-md border border-line bg-paper p-6 flex flex-col sm:flex-row sm:items-center gap-4`},C={class:`text-[13px] text-muted`},w={class:`eyebrow mb-5`},T={class:`text-[15px] text-muted leading-relaxed mb-4 max-w-2xl`},E={class:`eyebrow mb-5`},D={__name:`CartDrawerSection`,setup(D){let{t:O}=d(),k=h(),A=l(!1);async function j(){await m(),await _(`kaiser-natron-pulver-250-g-grosspackung`,2),await _(`kaiser-natron-bad-500-g`,1),A.value=!0}async function M({productId:e,quantity:t}){await f(e,t)}async function N(e){await p(e)}return c(()=>{g()}),(c,l)=>(t(),r(b,{eyebrow:n(O)(`ds.eyebrow.components`),title:n(O)(`ds.cartDrawer.title`),description:n(O)(`ds.cartDrawer.description`)},{default:e(()=>[s(`section`,null,[s(`h2`,x,i(n(O)(`ds.heading.default`)),1),s(`div`,S,[a(v,{variant:`primary`,onClick:j},{before:e(()=>[a(u,{name:`cart`,size:18})]),default:e(()=>[o(` `+i(n(O)(`ds.cartDrawer.demoLabel`)),1)]),_:1}),s(`p`,C,i(n(O)(`ds.cartDrawer.demoHint`)),1)])]),s(`section`,null,[s(`h2`,w,i(n(O)(`ds.cartDrawer.integrationTitle`)),1),s(`p`,T,i(n(O)(`ds.cartDrawer.integrationBody`)),1),l[2]||=s(`div`,{class:`rounded-md border border-line bg-paper p-6 font-mono text-[12px] text-ink`},[s(`pre`,{class:`whitespace-pre-wrap`},`import {
|
||||
fetchCart,
|
||||
addToCart,
|
||||
updateCartItem,
|
||||
@@ -1 +1 @@
|
||||
import{A as e,S as t,W as n,ct as r,m as i,o as a,ot as o,p as s,r as c,s as l,u}from"./runtime-core.esm-bundler-DgkFZzbt.js";import{a as d}from"./vue-router-BUTR8NmK.js";import{t as f}from"./i18n-BxXwPz8H.js";import{t as p}from"./Navbar-DKyzh9Gc.js";import{t as m}from"./Hero-BlnQ4ovQ.js";var h={class:`italic font-light text-brand-soft`},g={class:`italic font-light text-brand-soft`},_=`/products/cutouts/kaiser-natron-pulver-250-g-gro%C3%9Fpackung-removebg-preview-2.png`,v=`/products/kaiser-natron-bad-500-g.jpg`,y={__name:`HeroPreview`,setup(y){let b=d(),{t:x}=f(),S=a(()=>[`split`,`centered`].includes(b.query.variant)?b.query.variant:`split`),C=a(()=>[`cream`,`paper`,`brand`].includes(b.query.tone)?b.query.tone:`cream`),w=a(()=>b.query.reverse===`1`),T=a(()=>C.value===`brand`?`brand`:C.value),E=a(()=>w.value?v:_),D=a(()=>w.value?`Kaiser-Natron Bad 500 g`:`Kaiser-Natron Pulver 250 g Großpackung`);return(a,d)=>(t(),u(`div`,{class:o([`min-h-screen`,C.value===`brand`?`bg-brand`:`bg-surface`])},[i(p,{variant:T.value,"cart-count":0},null,8,[`variant`]),i(m,{variant:S.value,tone:C.value,reverse:w.value,eyebrow:w.value?n(x)(`home.banner.eyebrow`):n(x)(`ds.hero.eyebrow`),subheadline:w.value?n(x)(`home.banner.sub`):n(x)(`ds.hero.sub`),image:E.value,"image-alt":D.value,badge:w.value?``:n(x)(`ds.badges.featured`),"cta-label":n(x)(`ds.buttons.addToCart`),"secondary-label":n(x)(`ds.buttons.learnMore`)},{headline:e(()=>[w.value?(t(),u(c,{key:0},[s(r(n(x)(`home.banner.headline.a`))+` `,1),l(`em`,h,r(n(x)(`home.banner.headline.em`)),1),s(` `+r(n(x)(`home.banner.headline.b`)),1)],64)):(t(),u(c,{key:1},[s(r(n(x)(`ds.hero.headline.a`))+` `,1),l(`em`,g,r(n(x)(`ds.hero.headline.em`)),1),s(` `+r(n(x)(`ds.hero.headline.b`)),1)],64))]),_:1},8,[`variant`,`tone`,`reverse`,`eyebrow`,`subheadline`,`image`,`image-alt`,`badge`,`cta-label`,`secondary-label`])],2))}};export{y as default};
|
||||
import{A as e,S as t,W as n,ct as r,m as i,o as a,ot as o,p as s,r as c,s as l,u}from"./runtime-core.esm-bundler-DgkFZzbt.js";import{a as d}from"./vue-router-BUTR8NmK.js";import{t as f}from"./i18n-BxXwPz8H.js";import{t as p}from"./Navbar-JEFiizrv.js";import{t as m}from"./Hero-BlnQ4ovQ.js";var h={class:`italic font-light text-brand-soft`},g={class:`italic font-light text-brand-soft`},_=`/products/cutouts/kaiser-natron-pulver-250-g-gro%C3%9Fpackung-removebg-preview-2.png`,v=`/products/kaiser-natron-bad-500-g.jpg`,y={__name:`HeroPreview`,setup(y){let b=d(),{t:x}=f(),S=a(()=>[`split`,`centered`].includes(b.query.variant)?b.query.variant:`split`),C=a(()=>[`cream`,`paper`,`brand`].includes(b.query.tone)?b.query.tone:`cream`),w=a(()=>b.query.reverse===`1`),T=a(()=>C.value===`brand`?`brand`:C.value),E=a(()=>w.value?v:_),D=a(()=>w.value?`Kaiser-Natron Bad 500 g`:`Kaiser-Natron Pulver 250 g Großpackung`);return(a,d)=>(t(),u(`div`,{class:o([`min-h-screen`,C.value===`brand`?`bg-brand`:`bg-surface`])},[i(p,{variant:T.value,"cart-count":0},null,8,[`variant`]),i(m,{variant:S.value,tone:C.value,reverse:w.value,eyebrow:w.value?n(x)(`home.banner.eyebrow`):n(x)(`ds.hero.eyebrow`),subheadline:w.value?n(x)(`home.banner.sub`):n(x)(`ds.hero.sub`),image:E.value,"image-alt":D.value,badge:w.value?``:n(x)(`ds.badges.featured`),"cta-label":n(x)(`ds.buttons.addToCart`),"secondary-label":n(x)(`ds.buttons.learnMore`)},{headline:e(()=>[w.value?(t(),u(c,{key:0},[s(r(n(x)(`home.banner.headline.a`))+` `,1),l(`em`,h,r(n(x)(`home.banner.headline.em`)),1),s(` `+r(n(x)(`home.banner.headline.b`)),1)],64)):(t(),u(c,{key:1},[s(r(n(x)(`ds.hero.headline.a`))+` `,1),l(`em`,g,r(n(x)(`ds.hero.headline.em`)),1),s(` `+r(n(x)(`ds.hero.headline.b`)),1)],64))]),_:1},8,[`variant`,`tone`,`reverse`,`eyebrow`,`subheadline`,`image`,`image-alt`,`badge`,`cta-label`,`secondary-label`])],2))}};export{y as default};
|
||||
@@ -1 +1 @@
|
||||
import{A as e,S as t,W as n,ct as r,m as i,p as a,r as o,s,u as c,x as l,z as u}from"./runtime-core.esm-bundler-DgkFZzbt.js";import{t as d}from"./i18n-BxXwPz8H.js";import{n as f}from"./products-C8C_GS-z.js";import{a as p,i as m,o as h,r as g,t as _}from"./api-4Jnm40kQ.js";import{t as v}from"./Navbar-DKyzh9Gc.js";import{t as y}from"./Hero-BlnQ4ovQ.js";import{t as b}from"./CartDrawer-CbYC7UR_.js";var x={class:`flex flex-col bg-brand md:h-svh md:overflow-hidden`},S={class:`md:flex-1 md:flex md:items-center`},C={class:`italic font-light text-accent-soft`},w={class:`italic font-light text-brand-soft`},T=`/products/cutouts/kaiser-natron-pulver-250-g-gro%C3%9Fpackung-removebg-preview-2.png`,E=`kaiser-natron-pulver-250-g-grosspackung`,D=`/products/cutouts/kaiser-natron-pulver-250-g-gro%C3%9Fpackung-removebg-preview%20%281%29.png`,O=`kaiser-natron-pulver-250-g-grosspackung`,k={__name:`HomePage`,setup(k){let{t:A}=d(),j=h(),M=u(!1);async function N(){await _(E,1),M.value=!0}async function P(){await _(O,1),M.value=!0}async function F({productId:e,quantity:t}){await p(e,t)}async function I(e){await m(e)}async function L(e){await _(e.id,1),M.value=!0}return l(()=>{g()}),(l,u)=>(t(),c(o,null,[s(`div`,x,[i(v,{variant:`brand`,layout:`standard`,"cart-count":n(j).count,products:n(f),onCart:u[0]||=e=>M.value=!0,onSearch:L},null,8,[`cart-count`,`products`]),s(`div`,S,[i(y,{class:`w-full`,variant:`split`,tone:`brand`,eyebrow:n(A)(`ds.hero.eyebrow`),subheadline:n(A)(`ds.hero.sub`),image:T,"image-alt":`Kaiser-Natron Pulver 250 g Großpackung`,"cta-label":n(A)(`ds.buttons.addToCart`),"secondary-label":n(A)(`ds.buttons.learnMore`),"secondary-href":`/anwendungen`,onCta:N},{headline:e(()=>[a(r(n(A)(`ds.hero.headline.a`))+` `,1),s(`em`,C,r(n(A)(`ds.hero.headline.em`)),1),a(` `+r(n(A)(`ds.hero.headline.b`)),1)]),_:1},8,[`eyebrow`,`subheadline`,`cta-label`,`secondary-label`])]),u[3]||=s(`svg`,{"aria-hidden":`true`,class:`block w-full h-12 md:h-16 shrink-0 -mb-px`,viewBox:`0 0 1440 64`,preserveAspectRatio:`none`},[s(`rect`,{width:`1440`,height:`64`,fill:`var(--color-cream)`}),s(`path`,{d:`M0,0 L0,40 C320,4 520,60 720,32 C920,4 1120,60 1440,24 L1440,0 Z`,fill:`var(--color-brand)`})],-1)]),i(y,{class:`-mt-px`,variant:`split`,tone:`cream`,reverse:``,eyebrow:n(A)(`home.banner.eyebrow`),subheadline:n(A)(`home.banner.sub`),image:D,"image-alt":`Kaiser-Natron Pulver 250 g Großpackung`,"cta-label":n(A)(`ds.buttons.addToCart`),"secondary-label":n(A)(`ds.buttons.learnMore`),"secondary-href":`/anwendungen`,onCta:P},{headline:e(()=>[a(r(n(A)(`home.banner.headline.a`))+` `,1),s(`em`,w,r(n(A)(`home.banner.headline.em`)),1),a(` `+r(n(A)(`home.banner.headline.b`)),1)]),_:1},8,[`eyebrow`,`subheadline`,`cta-label`,`secondary-label`]),u[4]||=s(`div`,{"aria-hidden":`true`,class:`md:hidden`,style:{height:`calc(100px + env(safe-area-inset-bottom))`}},null,-1),i(b,{modelValue:M.value,"onUpdate:modelValue":u[1]||=e=>M.value=e,items:n(j).items,subtotal:n(j).subtotal,count:n(j).count,onUpdateQuantity:F,onRemove:I,onCheckout:u[2]||=e=>M.value=!1},null,8,[`modelValue`,`items`,`subtotal`,`count`])],64))}};export{k as default};
|
||||
import{A as e,S as t,W as n,ct as r,m as i,p as a,r as o,s,u as c,x as l,z as u}from"./runtime-core.esm-bundler-DgkFZzbt.js";import{t as d}from"./i18n-BxXwPz8H.js";import{n as f}from"./products-EYsKyD6O.js";import{a as p,i as m,o as h,r as g,t as _}from"./api-BC2UGBdg.js";import{t as v}from"./Navbar-JEFiizrv.js";import{t as y}from"./Hero-BlnQ4ovQ.js";import{t as b}from"./CartDrawer-BZqK1kPc.js";var x={class:`flex flex-col bg-brand md:h-svh md:overflow-hidden`},S={class:`md:flex-1 md:flex md:items-center`},C={class:`italic font-light text-accent-soft`},w={class:`italic font-light text-brand-soft`},T=`/products/cutouts/kaiser-natron-pulver-250-g-gro%C3%9Fpackung-removebg-preview-2.png`,E=`kaiser-natron-pulver-250-g-grosspackung`,D=`/products/cutouts/kaiser-natron-pulver-250-g-gro%C3%9Fpackung-removebg-preview%20%281%29.png`,O=`kaiser-natron-pulver-250-g-grosspackung`,k={__name:`HomePage`,setup(k){let{t:A}=d(),j=h(),M=u(!1);async function N(){await _(E,1),M.value=!0}async function P(){await _(O,1),M.value=!0}async function F({productId:e,quantity:t}){await p(e,t)}async function I(e){await m(e)}async function L(e){await _(e.id,1),M.value=!0}return l(()=>{g()}),(l,u)=>(t(),c(o,null,[s(`div`,x,[i(v,{variant:`brand`,layout:`standard`,"cart-count":n(j).count,products:n(f),onCart:u[0]||=e=>M.value=!0,onSearch:L},null,8,[`cart-count`,`products`]),s(`div`,S,[i(y,{class:`w-full`,variant:`split`,tone:`brand`,eyebrow:n(A)(`ds.hero.eyebrow`),subheadline:n(A)(`ds.hero.sub`),image:T,"image-alt":`Kaiser-Natron Pulver 250 g Großpackung`,"cta-label":n(A)(`ds.buttons.addToCart`),"secondary-label":n(A)(`ds.buttons.learnMore`),"secondary-href":`/anwendungen`,onCta:N},{headline:e(()=>[a(r(n(A)(`ds.hero.headline.a`))+` `,1),s(`em`,C,r(n(A)(`ds.hero.headline.em`)),1),a(` `+r(n(A)(`ds.hero.headline.b`)),1)]),_:1},8,[`eyebrow`,`subheadline`,`cta-label`,`secondary-label`])]),u[3]||=s(`svg`,{"aria-hidden":`true`,class:`block w-full h-12 md:h-16 shrink-0 -mb-px`,viewBox:`0 0 1440 64`,preserveAspectRatio:`none`},[s(`rect`,{width:`1440`,height:`64`,fill:`var(--color-cream)`}),s(`path`,{d:`M0,0 L0,40 C320,4 520,60 720,32 C920,4 1120,60 1440,24 L1440,0 Z`,fill:`var(--color-brand)`})],-1)]),i(y,{class:`-mt-px`,variant:`split`,tone:`cream`,reverse:``,eyebrow:n(A)(`home.banner.eyebrow`),subheadline:n(A)(`home.banner.sub`),image:D,"image-alt":`Kaiser-Natron Pulver 250 g Großpackung`,"cta-label":n(A)(`ds.buttons.addToCart`),"secondary-label":n(A)(`ds.buttons.learnMore`),"secondary-href":`/anwendungen`,onCta:P},{headline:e(()=>[a(r(n(A)(`home.banner.headline.a`))+` `,1),s(`em`,w,r(n(A)(`home.banner.headline.em`)),1),a(` `+r(n(A)(`home.banner.headline.b`)),1)]),_:1},8,[`eyebrow`,`subheadline`,`cta-label`,`secondary-label`]),u[4]||=s(`div`,{"aria-hidden":`true`,class:`md:hidden`,style:{height:`calc(100px + env(safe-area-inset-bottom))`}},null,-1),i(b,{modelValue:M.value,"onUpdate:modelValue":u[1]||=e=>M.value=e,items:n(j).items,subtotal:n(j).subtotal,count:n(j).count,onUpdateQuantity:F,onRemove:I,onCheckout:u[2]||=e=>M.value=!1},null,8,[`modelValue`,`items`,`subtotal`,`count`])],64))}};export{k as default};
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{S as e,m as t,o as n,r,s as i,st as a,u as o,w as s}from"./runtime-core.esm-bundler-DgkFZzbt.js";import{a as c}from"./vue-router-BUTR8NmK.js";import{t as l}from"./Navbar-DKyzh9Gc.js";var u={class:`min-h-screen bg-surface`},d={class:`max-w-5xl mx-auto px-6 py-16 space-y-6`},f={__name:`NavbarPreview`,setup(f){let p=c(),m=n(()=>{let e=p.query.variant;return[`paper`,`cream`,`brand`].includes(e)?e:`paper`}),h=n(()=>p.query.layout===`floating`?`floating`:`standard`);return(n,c)=>(e(),o(`div`,u,[t(l,{variant:m.value,layout:h.value,"cart-count":2},null,8,[`variant`,`layout`]),i(`div`,d,[(e(),o(r,null,s([40,28,40,32,40,28,36,40],e=>i(`div`,{key:e,class:`rounded-md border border-line bg-paper`,style:a({height:e*4+`px`})},null,4)),64))])]))}};export{f as default};
|
||||
import{S as e,m as t,o as n,r,s as i,st as a,u as o,w as s}from"./runtime-core.esm-bundler-DgkFZzbt.js";import{a as c}from"./vue-router-BUTR8NmK.js";import{t as l}from"./Navbar-JEFiizrv.js";var u={class:`min-h-screen bg-surface`},d={class:`max-w-5xl mx-auto px-6 py-16 space-y-6`},f={__name:`NavbarPreview`,setup(f){let p=c(),m=n(()=>{let e=p.query.variant;return[`paper`,`cream`,`brand`].includes(e)?e:`paper`}),h=n(()=>p.query.layout===`floating`?`floating`:`standard`);return(n,c)=>(e(),o(`div`,u,[t(l,{variant:m.value,layout:h.value,"cart-count":2},null,8,[`variant`,`layout`]),i(`div`,d,[(e(),o(r,null,s([40,28,40,32,40,28,36,40],e=>i(`div`,{key:e,class:`rounded-md border border-line bg-paper`,style:a({height:e*4+`px`})},null,4)),64))])]))}};export{f as default};
|
||||
@@ -1,4 +1,4 @@
|
||||
import{A as e,S as t,W as n,c as r,ct as i,m as a,p as o,r as s,s as c,u as l,w as u,z as d}from"./runtime-core.esm-bundler-DgkFZzbt.js";import{t as f}from"./Icon-D1Ud4H_f.js";import{t as p}from"./i18n-BxXwPz8H.js";import{t as m}from"./Search-DA7amK-p.js";import{n as h,r as g}from"./products-C8C_GS-z.js";import{t as _}from"./Button-CajVMpo0.js";import{t as v}from"./SectionShell-CHsfR9Y3.js";var y={class:`eyebrow mb-5`},b={class:`rounded-md border border-line bg-paper p-6 flex flex-col sm:flex-row sm:items-center gap-4`},x={class:`text-[13px] text-muted`},S={class:`eyebrow mb-5`},C={class:`rounded-md border border-line bg-paper divide-y divide-line overflow-hidden`},w=[`src`,`alt`],T={class:`min-w-0 flex-1`},E={class:`text-[14px] font-semibold text-ink truncate`},D={class:`text-[12px] text-muted truncate`},O={class:`shrink-0 text-[13px] font-semibold text-brand`},k={class:`eyebrow mb-5`},A=`natron pulver`,j={__name:`SearchSection`,setup(j){let{t:M}=p(),N=d(!1),P=g(A,h,4);return(d,p)=>(t(),r(v,{eyebrow:n(M)(`ds.eyebrow.components`),title:n(M)(`ds.search.title`),description:n(M)(`ds.search.description`)},{default:e(()=>[c(`section`,null,[c(`h2`,y,i(n(M)(`ds.heading.default`)),1),c(`div`,b,[a(_,{variant:`primary`,onClick:p[0]||=e=>N.value=!0},{before:e(()=>[a(f,{name:`search`,size:18})]),default:e(()=>[o(` `+i(n(M)(`ds.search.demo.label`)),1)]),_:1}),c(`p`,x,i(n(M)(`ds.search.demo.hint`)),1)])]),c(`section`,null,[c(`h2`,S,i(n(M)(`ds.heading.variants`))+` — "`+i(A)+`"`,1),c(`ul`,C,[(t(!0),l(s,null,u(n(P),e=>(t(),l(`li`,{key:e.id,class:`flex items-center gap-4 px-4 py-3`},[c(`img`,{src:e.image,alt:e.title,loading:`lazy`,decoding:`async`,class:`shrink-0 w-12 h-12 rounded-sm object-cover bg-cream`},null,8,w),c(`div`,T,[c(`p`,E,i(e.title),1),c(`p`,D,i(e.size)+` · `+i(e.category),1)]),c(`span`,O,`€ `+i(e.price.toFixed(2).replace(`.`,`,`)),1)]))),128))])]),c(`section`,null,[c(`h2`,k,i(n(M)(`ds.heading.usage`)),1),p[2]||=c(`div`,{class:`rounded-md border border-line bg-paper p-6 font-mono text-[12px] text-ink`},[c(`pre`,{class:`whitespace-pre-wrap`},`import { products } from '@/api/products.js'
|
||||
import{A as e,S as t,W as n,c as r,ct as i,m as a,p as o,r as s,s as c,u as l,w as u,z as d}from"./runtime-core.esm-bundler-DgkFZzbt.js";import{t as f}from"./Icon-D1Ud4H_f.js";import{t as p}from"./i18n-BxXwPz8H.js";import{t as m}from"./Search-DA7amK-p.js";import{n as h,r as g}from"./products-EYsKyD6O.js";import{t as _}from"./Button-CajVMpo0.js";import{t as v}from"./SectionShell-CHsfR9Y3.js";var y={class:`eyebrow mb-5`},b={class:`rounded-md border border-line bg-paper p-6 flex flex-col sm:flex-row sm:items-center gap-4`},x={class:`text-[13px] text-muted`},S={class:`eyebrow mb-5`},C={class:`rounded-md border border-line bg-paper divide-y divide-line overflow-hidden`},w=[`src`,`alt`],T={class:`min-w-0 flex-1`},E={class:`text-[14px] font-semibold text-ink truncate`},D={class:`text-[12px] text-muted truncate`},O={class:`shrink-0 text-[13px] font-semibold text-brand`},k={class:`eyebrow mb-5`},A=`natron pulver`,j={__name:`SearchSection`,setup(j){let{t:M}=p(),N=d(!1),P=g(A,h,4);return(d,p)=>(t(),r(v,{eyebrow:n(M)(`ds.eyebrow.components`),title:n(M)(`ds.search.title`),description:n(M)(`ds.search.description`)},{default:e(()=>[c(`section`,null,[c(`h2`,y,i(n(M)(`ds.heading.default`)),1),c(`div`,b,[a(_,{variant:`primary`,onClick:p[0]||=e=>N.value=!0},{before:e(()=>[a(f,{name:`search`,size:18})]),default:e(()=>[o(` `+i(n(M)(`ds.search.demo.label`)),1)]),_:1}),c(`p`,x,i(n(M)(`ds.search.demo.hint`)),1)])]),c(`section`,null,[c(`h2`,S,i(n(M)(`ds.heading.variants`))+` — "`+i(A)+`"`,1),c(`ul`,C,[(t(!0),l(s,null,u(n(P),e=>(t(),l(`li`,{key:e.id,class:`flex items-center gap-4 px-4 py-3`},[c(`img`,{src:e.image,alt:e.title,loading:`lazy`,decoding:`async`,class:`shrink-0 w-12 h-12 rounded-sm object-cover bg-cream`},null,8,w),c(`div`,T,[c(`p`,E,i(e.title),1),c(`p`,D,i(e.size)+` · `+i(e.category),1)]),c(`span`,O,`€ `+i(e.price.toFixed(2).replace(`.`,`,`)),1)]))),128))])]),c(`section`,null,[c(`h2`,k,i(n(M)(`ds.heading.usage`)),1),p[2]||=c(`div`,{class:`rounded-md border border-line bg-paper p-6 font-mono text-[12px] text-ink`},[c(`pre`,{class:`whitespace-pre-wrap`},`import { products } from '@/api/products.js'
|
||||
import Search from '@/design-system/components/Search.vue'
|
||||
|
||||
const open = ref(false)
|
||||
@@ -1 +1 @@
|
||||
import{n as e}from"./pinia-BLnSyg0Y.js";import{n as t}from"./products-C8C_GS-z.js";var n=`kn-cart-v1`;function r(){if(typeof localStorage>`u`)return[];try{let e=localStorage.getItem(n);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>e&&typeof e.productId==`string`&&Number.isInteger(e.quantity)&&e.quantity>0):[]}catch{return[]}}function i(e){if(!(typeof localStorage>`u`))try{localStorage.setItem(n,JSON.stringify(e))}catch{}}function a(e){let n=t.find(t=>t.id===e.productId);return n?{productId:e.productId,quantity:e.quantity,unitPrice:n.price,lineTotal:+(n.price*e.quantity).toFixed(2),product:{id:n.id,title:n.title,brand:n.brand,size:n.size,image:n.image,href:n.href}}:null}var o=e(`cart`,{state:()=>({lines:r()}),getters:{items:e=>e.lines.map(a).filter(Boolean),count:e=>e.lines.reduce((e,t)=>e+t.quantity,0),subtotal(){return+this.items.reduce((e,t)=>e+t.lineTotal,0).toFixed(2)},isEmpty:e=>e.lines.length===0},actions:{add(e,t=1){let n=this.lines.find(t=>t.productId===e);n?n.quantity+=t:this.lines.push({productId:e,quantity:t}),i(this.lines)},update(e,t){if(Number.isInteger(t)){if(t<=0)this.lines=this.lines.filter(t=>t.productId!==e);else{let n=this.lines.find(t=>t.productId===e);n&&(n.quantity=t)}i(this.lines)}},remove(e){this.lines=this.lines.filter(t=>t.productId!==e),i(this.lines)},clear(){this.lines=[],i(this.lines)}}});function s(e){return{items:e.items,count:e.count,subtotal:e.subtotal,updatedAt:new Date().toISOString()}}async function c(){return s(o())}async function l(e,t=1){if(typeof e!=`string`||!e)throw Error(`cart.productIdRequired`);let n=Number.isInteger(t)?t:1;if(n<1)throw Error(`cart.quantityInvalid`);let r=o();return r.add(e,n),s(r)}async function u(e,t){let n=o();return n.update(e,Number.isInteger(t)?t:0),s(n)}async function d(e){let t=o();return t.remove(e),s(t)}async function f(){let e=o();return e.clear(),s(e)}export{u as a,d as i,f as n,o,c as r,l as t};
|
||||
import{n as e}from"./pinia-BLnSyg0Y.js";import{n as t}from"./products-EYsKyD6O.js";var n=`kn-cart-v1`;function r(){if(typeof localStorage>`u`)return[];try{let e=localStorage.getItem(n);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>e&&typeof e.productId==`string`&&Number.isInteger(e.quantity)&&e.quantity>0):[]}catch{return[]}}function i(e){if(!(typeof localStorage>`u`))try{localStorage.setItem(n,JSON.stringify(e))}catch{}}function a(e){let n=t.find(t=>t.id===e.productId);return n?{productId:e.productId,quantity:e.quantity,unitPrice:n.price,lineTotal:+(n.price*e.quantity).toFixed(2),product:{id:n.id,title:n.title,brand:n.brand,size:n.size,image:n.image,href:n.href}}:null}var o=e(`cart`,{state:()=>({lines:r()}),getters:{items:e=>e.lines.map(a).filter(Boolean),count:e=>e.lines.reduce((e,t)=>e+t.quantity,0),subtotal(){return+this.items.reduce((e,t)=>e+t.lineTotal,0).toFixed(2)},isEmpty:e=>e.lines.length===0},actions:{add(e,t=1){let n=this.lines.find(t=>t.productId===e);n?n.quantity+=t:this.lines.push({productId:e,quantity:t}),i(this.lines)},update(e,t){if(Number.isInteger(t)){if(t<=0)this.lines=this.lines.filter(t=>t.productId!==e);else{let n=this.lines.find(t=>t.productId===e);n&&(n.quantity=t)}i(this.lines)}},remove(e){this.lines=this.lines.filter(t=>t.productId!==e),i(this.lines)},clear(){this.lines=[],i(this.lines)}}});function s(e){return{items:e.items,count:e.count,subtotal:e.subtotal,updatedAt:new Date().toISOString()}}async function c(){return s(o())}async function l(e,t=1){if(typeof e!=`string`||!e)throw Error(`cart.productIdRequired`);let n=Number.isInteger(t)?t:1;if(n<1)throw Error(`cart.quantityInvalid`);let r=o();return r.add(e,n),s(r)}async function u(e,t){let n=o();return n.update(e,Number.isInteger(t)?t:0),s(n)}async function d(e){let t=o();return t.remove(e),s(t)}async function f(){let e=o();return e.clear(),s(e)}export{u as a,d as i,f as n,o,c as r,l as t};
|
||||
File diff suppressed because one or more lines are too long
1
dist/assets/products-C8C_GS-z.js
vendored
1
dist/assets/products-C8C_GS-z.js
vendored
File diff suppressed because one or more lines are too long
1
dist/assets/products-EYsKyD6O.js
vendored
Normal file
1
dist/assets/products-EYsKyD6O.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
dist/index.html
vendored
2
dist/index.html
vendored
@@ -12,7 +12,7 @@
|
||||
href="https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,200;0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,200;1,9..144,400;1,9..144,600&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<script type="module" crossorigin src="/assets/index-C8tH8Y0_.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-ftsiBOTx.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/_plugin-vue_export-helper-BOai-rQB.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/runtime-core.esm-bundler-DgkFZzbt.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/runtime-dom.esm-bundler-ouKdkQwB.js">
|
||||
|
||||
@@ -21,7 +21,7 @@ export const products = [
|
||||
size: '250 g Großpackung',
|
||||
category: 'Pulver',
|
||||
price: 4.49,
|
||||
image: '/products/kaiser-natron-pulver-250-g-gro%C3%9Fpackung.jpg',
|
||||
image: '/products/cutouts/kaiser-natron-pulver-250-g-gro%C3%9Fpackung-removebg-preview%20%281%29.png',
|
||||
href: '/shop/kaiser-natron-pulver-250-g-grosspackung',
|
||||
inStock: true,
|
||||
keywords: ['natron', 'backsoda', 'großpackung', 'bicarbonat', 'baking soda', 'vorrat'],
|
||||
|
||||
Reference in New Issue
Block a user