efficient-storefront-blocks 0.133.3 → 0.133.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/index.js +21 -21
- package/dist/render/app/globals.css +18 -0
- package/dist/render/components/CartDrawer.d.ts +1 -0
- package/dist/render/components/CartDrawer.js +1 -1
- package/dist/render/components/Header.js +1 -1
- package/dist/render/components/cart/drawer-parts.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/package.json +1 -1
|
@@ -1195,6 +1195,24 @@ body .sf-site-header[data-header-ink="dark"] {
|
|
|
1195
1195
|
letter-spacing: normal;
|
|
1196
1196
|
}
|
|
1197
1197
|
|
|
1198
|
+
/* Header → Letters: Capitalised reaches the cart drawer too (the drawer is
|
|
1199
|
+
a sibling of the bar, so the page is asked). Its capitals are drawn as
|
|
1200
|
+
typed, and the "N° 1 ·" line number goes: the process name stands alone.
|
|
1201
|
+
The drawer is found by its dialog name (components/CartDrawer
|
|
1202
|
+
`CART_DRAWER_LABEL`), so a site without Letters keeps today's markup. */
|
|
1203
|
+
:root:has([data-header-nav-case="capitalised"]) [role="dialog"][aria-label="Your cart"] .uppercase {
|
|
1204
|
+
text-transform: none;
|
|
1205
|
+
letter-spacing: normal;
|
|
1206
|
+
}
|
|
1207
|
+
:root:has([data-header-nav-case="capitalised"]) [role="dialog"][aria-label="Your cart"] [data-cart-line-no] {
|
|
1208
|
+
display: none;
|
|
1209
|
+
}
|
|
1210
|
+
/* Without their letter space the 9, 10 and 11 px capitals read too small, so
|
|
1211
|
+
they are drawn at the checkout's label size. */
|
|
1212
|
+
:root:has([data-header-nav-case="capitalised"]) [role="dialog"][aria-label="Your cart"] :is(.text-\[9px\], .text-\[10px\], .text-\[11px\]) {
|
|
1213
|
+
font-size: 12px;
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1198
1216
|
/* A Form's Label weight, Regular: its field labels at the regular weight
|
|
1199
1217
|
(components/FormBlock `data-form-label`). Unset is today's semibold. */
|
|
1200
1218
|
[data-form-label="regular"] .font-semibold {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type CartDrawerContent, type CartDrawerLook } from "efficient-web-builder/format/lib/content/cart-drawer";
|
|
2
|
+
export declare const CART_DRAWER_LABEL = "Your cart";
|
|
2
3
|
export default function CartDrawer({ content, look, }: {
|
|
3
4
|
content?: CartDrawerContent;
|
|
4
5
|
look?: CartDrawerLook;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as a}from"react/jsx-runtime";import{useEffect as m,useRef as u}from"react";import{useCart as C}from"./CartContext.js";import{isTyreLine as
|
|
1
|
+
"use client";import{jsx as r,jsxs as a}from"react/jsx-runtime";import{useEffect as m,useRef as u}from"react";import{useCart as C}from"./CartContext.js";import{isTyreLine as R}from"../lib/tyres/tyre-purchase.js";import{useTyreCatalog as d}from"./useTyreCatalog.js";import w from"./PopupFrame.js";import{CartActions as A,CartCouponRow as T,CartDrawerHeader as _,CartLines as x,CartStatusRail as L,CartTotals as D,CartTrustMarkers as E,CartUpsell as O}from"./cart/drawer-parts.js";import{CART_DRAWER_DEFAULTS as v,resolveCartDrawerLook as y}from"efficient-web-builder/format/lib/content/cart-drawer";const h=y(void 0),j="Your cart";function S({content:e=v,look:t=h}){const{isOpen:l,preview:n,close:i,items:c,setAutoOpen:o}=C(),s=u(null),p=d(c.filter(R).map(f=>f.slug));return m(()=>{o(t.autoOpen)},[t.autoOpen,o]),a(w,{look:t,drawer:{closeRef:s,lockScroll:!n},open:l,onClose:i,label:j,children:[r(_,{content:e,closeRef:s}),r(L,{content:e}),a("div",{className:"flex-1 overflow-y-auto [scrollbar-color:var(--site-line)_transparent] [scrollbar-width:thin]",children:[r(x,{content:e,tyres:p}),r(O,{}),r(T,{}),r(E,{content:e})]}),r(D,{}),r(A,{})]})}export{j as CART_DRAWER_LABEL,S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,Fragment as E,jsxs as s}from"react/jsx-runtime";import oe from"next/link";import{usePathname as Ze}from"next/navigation";import{useCallback as et,useEffect as re,useRef as tt,useState as v}from"react";import{rootIsDark as nt,watchRootTheme as ot}from"efficient-shell/format";import{useCart as rt}from"./CartContext.js";import{useSearch as st}from"./SearchContext.js";import lt,{useCountrySelectShows as at}from"./CountrySelect.js";import{resolveCountryShowAs as it}from"../lib/content/country-show-as.js";import se from"./HeaderNavItem.js";import ct from"efficient-web-builder/render/components/Logo";import{siteLengthCss as dt}from"efficient-web-builder/format/lib/content/css-length";import mt from"./MenuPlaceholderLabel.js";import{withRMark as le}from"efficient-web-builder/render/components/RMark";import{AccountButton as ut,CartButton as ht,SearchButton as ft}from"./HeaderTools.js";import pt from"./HeaderCallButton.js";import{useHeaderBar as gt}from"./useHeaderBar.js";import{useHeaderAtTopIsDark as bt}from"./useHeaderAtTopIsDark.js";import{usePageOwnsTop as xt}from"./usePageOwnsTop.js";import{useModalDismiss as vt}from"./useModalDismiss.js";import yt from"./ThemeToggle.js";import{products as wt}from"../lib/api/index.js";import{shouldFetchPublicHeaderSettings as St}from"../lib/header-settings-fetch.js";import{menuDropdownAside as kt}from"../lib/menu-link.js";import{HEADER_MENU_PLACEHOLDER_COUNT as Nt}from"../lib/content/menu-placeholder.js";import{DEFAULT_SWITCH_SHOWN as Pt}from"efficient-web-builder/format/lib/theme";import{chromeWidthStyle as Tt,resolveChromeWidth as Et}from"efficient-web-builder/format/lib/content/page-width";import{headerThemeWrap as It}from"../lib/content/header-theme.js";import{headerSolidBackground as $t,isProductPage as Ct,resolveMenuRow as Lt,resolveNavTextCase as _t,resolveUtilStyle as Ht}from"../lib/content/header-bar.js";import{surfaceIsLight as Rt}from"../lib/logo/surface-is-light.js";import{HEADER_HEIGHT_PX as At,HEADER_MENU_GAP_PX as Dt,HEADER_SET_HEIGHT_CSS as Ut}from"efficient-web-builder/render/lib/document/header-clearance";import{HEADER_INK_OVERRIDE_ATTR as Mt,resolveHeaderInkMode as jt}from"efficient-web-builder/render/lib/document/header-ink";const ae={stacked:{grid:"hidden min-[1501px]:grid",flex:"hidden min-[1501px]:flex"},inline:{grid:"hidden view-tablet:grid",flex:"hidden view-tablet:flex"}},Ot=Array.from({length:Nt},()=>({href:"#",label:r(mt,{})}));function zt({previewSettings:p,initialSettings:I,editorPreview:$,showThemeToggle:ie,wordmark:ce,hideLogo:de,hideMenu:me,siteName:C,commerceEnabled:g=!0}={}){const ue=Ze(),B=Ct(ue),[c,y]=v(!1),{open:he,totals:fe}=rt(),{open:pe}=st(),[L,ge]=v(!1),[be,xe]=v(null),[ve,ye]=v(null),[t,we]=v(I??null),n=p??(t?{logoUrl:t.logoUrl,reverseLogo:t.reverseLogo,logoReversed:t.logoReversed,logoInkIsDark:t.logoInkIsDark,logoPosition:t.logoPosition,logoSize:t.logoSize,logoSizePx:t.logoSizePx,logoSizeUnit:t.logoSizeUnit??null,menuItems:(t.menuItems??[]).map(e=>({label:e.label,url:e.url,dropdown_menu:null,dropdown_items:e.dropdownItems??[],dropdown_aside:e.dropdownAside??null})),menuSplit:t.menuSplit??3,menuPosition:t.menuPosition,menuRow:t.menuRow,menuGapPx:t.menuGapPx??null,menuGapUnit:t.menuGapUnit??null,searchEnabled:t.searchEnabled,searchPosition:t.searchPosition,searchRow:t.searchRow,countrySelectorEnabled:t.countrySelectorEnabled,countrySelectorShowAs:t.countrySelectorShowAs,countryUrls:t.countryUrls,accountEnabled:t.accountEnabled,cartEnabled:t.cartEnabled,utilStyle:t.utilStyle,navTextCase:t.navTextCase,lightReverseText:t.lightReverseText,topTextColor:t.topTextColor,transparentTop:t.transparentTop,surface:t.surface,theme:t.theme,width:t.width,heightPx:t.heightPx,borderThickness:t.borderThickness??null,sticky:t.sticky,callButton:t.callButton,callPhone:t.callPhone,callHref:t.callHref}:null),Se=de?null:n?.logoUrl??null,ke=n?.reverseLogo??!1,Ne=n?.logoReversed??null,Pe=n?.logoInkIsDark??null,i=n?.logoPosition??"center",Te=n?.logoSize??"medium",Ee=n?.logoSizePx??null,Ie=n?.logoSizeUnit??null,G=Math.min(Math.max(n?.menuSplit??3,1),4),$e=(n?.menuPosition??"left")==="center",Ce=(n?.menuPosition??"left")==="beside",F=Lt(n?.menuRow)==="inline",_=n?.menuGapPx??null,Le=_!=null?{gap:dt(_,n?.menuGapUnit,"gap",Dt)??`${_}px`}:void 0,w=F?ae.inline:ae.stacked,_e=n?.searchEnabled??!1,W=n?.searchPosition??"right",He=n?.countrySelectorEnabled??!0,Re=it(n?.countrySelectorShowAs),H=n?.accountEnabled??!0,Ae=n?.cartEnabled??!0,R=Ht(n?.utilStyle)==="text",l=`mono-eyebrow${_t(n?.navTextCase)==="capitalised"?" mono-eyebrow-plain":""}`,V=n?.countryUrls??{},De=Et(n?.width),Ue=Tt(De)??void 0,Me=n?.heightPx??At.default,K=Math.round(n?.borderThickness??1),je=Number.isFinite(K)?Math.min(Math.max(K,0),20):1,X=n?.sticky??"always",A=jt(n?.topTextColor),m=It(n?.theme),S=Object.keys(V),Y=at(S.length?S:void 0),b=He?r(lt,{countries:S.length?S:void 0,urls:p?void 0:V,showAs:Re}):null,{headerRef:u,scrolled:J,navHidden:Oe}=gt({stickyMode:X,heightPx:Me}),ze=m?JSON.stringify(m.style):null;re(()=>{const e=u.current?.ownerDocument??document,o=e.defaultView??window,T=ne=>ne?Rt(o.getComputedStyle(ne).getPropertyValue("--bg")):null,z=()=>{ge(!nt({doc:e,whenUnset:!0})),xe(T(e.body)),ye(T(u.current))};z();const Qe=ot(z,{doc:e}),te=new MutationObserver(z);return e.body&&te.observe(e.body,{attributes:!0,attributeFilter:["style"]}),()=>{Qe(),te.disconnect()}},[u,ze]);const x=ie??Pt?r(yt,{}):null;re(()=>{if(!St({editorPreview:!!$,hasPreviewSettings:!!p,hasInitialSettings:!!I}))return;let e=!1;return wt.getHeaderSettings().then(o=>!e&&we(o)).catch(o=>{console.warn("[header] settings fetch failed; using built-in defaults",o)}),()=>{e=!0}},[$,p,I]);const Be=xt(u),k=J||B||Be,q=$t(L,B),Q=bt(u,A),Ge=k||!Q,Fe=k?ve??L:(be??L)&&!Q,We=A==="auto"?null:{[Mt]:A},Ve=et(()=>y(!1),[]),D=tt(null);vt({active:c,onDismiss:Ve,focusRef:D,trapRef:D});const d=(e,o,T="start")=>r(se,{item:e,dropdownAlign:T},o),Ke=!me&&(n?.menuItems?.length??0)>0,N=!!$||!!p,a=Ke?n.menuItems.map(e=>({href:e.url||"",label:le(e.label),plainLabel:e.label,dropdownItems:(e.dropdown_items??[]).map(o=>({href:o.url||"",label:le(o.label),plainLabel:o.label,description:o.description,image:o.image,badge:o.badge})),dropdownAside:kt(e.dropdown_aside)})):N?Ot.map(e=>({...e,plainLabel:"Menu item",dropdownItems:[]})):[],Xe=a.length>0||g&&H||!!b&&Y||!!x,Ye=i==="center"?a.slice(0,G):i==="right"?a:[],Je=i==="center"?a.slice(G):i==="left"?a:[],P=_e&&g?r(ft,{onClick:N?void 0:pe,asText:R}):null,U=g&&H?r(ut,{asText:R}):null,M=e=>g&&Ae?r(ht,{onClick:he,count:fe.sets,asText:R,className:e}):null,qe=n?.callPhone??"",Z=n?.callHref??"",j=e=>n?.callButton&&(Z||N)?r(pt,{href:N?"":Z,label:e?"Call":qe||"Call"}):null,h=s(E,{children:[W==="left"?P:null,b,x,U,M(),W==="right"?P:null,j(!1)]}),O=(e,o=!1)=>r(oe,{href:"/","aria-label":C?`${C} home`:"Home",className:e,children:r(ct,{variant:"header",scrolled:Ge,src:Se,reverse:ke,onLightSurface:Fe,reversedSrc:Ne,inkIsDark:Pe,size:Te,sizePx:Ee,sizeUnit:Ie,wordmark:ce,siteName:C,fitToContainer:o})}),f=O("inline-flex shrink-0 items-center justify-center"),ee="flex min-w-0 flex-1 items-center overflow-x-clip [container-type:inline-size]";return s(E,{children:[r("header",{ref:u,"data-scrolled":J||void 0,...We,className:["sf-site-header",...m?[m.className]:[],X==="none"?"absolute":"fixed","inset-x-0 top-0 z-50","flex items-center","px-[var(--sf-site-gutter,40px)] max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]",k?"border-solid border-line backdrop-blur-md":"border-solid border-transparent","transition-[background,border-color,transform] duration-300 ease-out"].join(" "),style:{...m?m.style:null,minHeight:Ut,borderBottomWidth:`${je}px`,...Oe?{transform:"translateY(-100%)"}:null,...k?{background:q,color:"var(--fg)","--sf-header-ground":q}:{color:"var(--sf-header-overlay-fg)","--sf-header-ground":"var(--sf-header-overlay-ground)"}},children:s("div",{className:"w-full",style:Ue,children:[$e?s("div",{"data-header-band":"",className:`${w.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[i==="right"?r("nav",{className:`${l} flex items-center gap-8`,children:h}):r("div",{className:"flex items-center",children:f}),r("nav",{className:`${l} flex items-center justify-center gap-8`,children:a.map((e,o)=>d(e,`${e.href}-${o}`,"center"))}),i==="right"?r("div",{className:"flex items-center justify-end",children:f}):r("nav",{className:`${l} flex items-center justify-end gap-8`,children:h})]}):i==="center"?s("div",{"data-header-band":"",className:`${w.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[r("nav",{className:`${l} flex items-center gap-8`,children:Ye.map((e,o)=>d(e,`${e.href}-${o}`))}),f,s("nav",{className:`${l} flex items-center justify-end gap-8`,children:[Je.map((e,o)=>d(e,`${e.href}-${o}`,"end")),h]})]}):Ce?s("div",{"data-header-band":"",className:`${w.flex} items-center justify-between gap-8`,children:[s("div",{className:"flex items-center gap-8",style:Le,children:[f,r("nav",{className:`${l} flex items-center gap-8`,children:a.map((e,o)=>d(e,`${e.href}-${o}`))})]}),r("nav",{className:`${l} flex items-center justify-end gap-8`,children:h})]}):r("div",{"data-header-band":"",className:`${w.flex} items-center justify-between gap-8`,children:i==="right"?s(E,{children:[s("nav",{className:`${l} flex items-center gap-8`,children:[a.map((e,o)=>d(e,`${e.href}-${o}`)),h]}),f]}):s(E,{children:[f,s("nav",{className:`${l} flex items-center gap-8`,children:[a.map((e,o)=>d(e,`${e.href}-${o}`)),h]})]})}),!F&&s("div",{"data-header-band":"",className:"hidden view-tablet:max-[1501px]:flex flex-col gap-3",children:[s("div",{className:"flex items-center justify-between",children:[O(ee,!0),s("div",{className:`${l} flex shrink-0 items-center gap-5`,children:[P,b,x,U,M(),j(!1)]})]}),r("nav",{className:`${l} flex items-center gap-6 border-t border-line/60 pt-3`,children:a.map((e,o)=>d(e,`${e.href}-${o}`))})]}),s("div",{"data-header-phone":"",className:"hidden max-view-tablet:flex items-center justify-between",children:[O(ee,!0),s("div",{className:"flex shrink-0 items-center gap-4",children:[P,U,M(l),j(!0),Xe&&s("button",{type:"button","aria-label":c?"Close menu":"Open menu","aria-expanded":c,onClick:()=>y(e=>!e),className:"flex h-11 w-11 flex-col items-center justify-center gap-2",children:[r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"translate-y-[3px] rotate-45":""}`}),r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"opacity-0":""}`}),r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"-translate-y-[3px] -rotate-45":""}`})]})]})]})]})}),c&&s("div",{ref:D,role:"dialog","aria-modal":"true","aria-label":"Menu",tabIndex:-1,"data-header-phone-menu":"",className:"fixed inset-x-0 top-0 bottom-0 z-40 hidden flex-col gap-8 overflow-y-auto bg-bg px-6 pt-24 pb-10 max-view-tablet:flex",children:[a.map((e,o)=>r(se,{item:e,mobile:!0,onNavigate:()=>y(!1)},`${e.href}-${o}`)),s("div",{className:"mt-auto flex flex-col gap-4 border-t border-line pt-6",children:[g&&H&&s("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),r(oe,{href:"/account",onClick:()=>y(!1),className:"mono-eyebrow underline",children:"Your account"})]}),b&&Y&&s("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),b]}),x&&s("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),x]})]})]})]})}export{zt as default};
|
|
1
|
+
"use client";import{jsx as r,Fragment as E,jsxs as s}from"react/jsx-runtime";import re from"next/link";import{usePathname as et}from"next/navigation";import{useCallback as tt,useEffect as se,useRef as nt,useState as v}from"react";import{rootIsDark as ot,watchRootTheme as rt}from"efficient-shell/format";import{useCart as st}from"./CartContext.js";import{useSearch as at}from"./SearchContext.js";import lt,{useCountrySelectShows as it}from"./CountrySelect.js";import{resolveCountryShowAs as ct}from"../lib/content/country-show-as.js";import ae from"./HeaderNavItem.js";import dt from"efficient-web-builder/render/components/Logo";import{siteLengthCss as mt}from"efficient-web-builder/format/lib/content/css-length";import ut from"./MenuPlaceholderLabel.js";import{withRMark as le}from"efficient-web-builder/render/components/RMark";import{AccountButton as ht,CartButton as ft,SearchButton as pt}from"./HeaderTools.js";import gt from"./HeaderCallButton.js";import{useHeaderBar as bt}from"./useHeaderBar.js";import{useHeaderAtTopIsDark as xt}from"./useHeaderAtTopIsDark.js";import{usePageOwnsTop as vt}from"./usePageOwnsTop.js";import{useModalDismiss as yt}from"./useModalDismiss.js";import wt from"./ThemeToggle.js";import{products as St}from"../lib/api/index.js";import{shouldFetchPublicHeaderSettings as kt}from"../lib/header-settings-fetch.js";import{menuDropdownAside as Nt}from"../lib/menu-link.js";import{HEADER_MENU_PLACEHOLDER_COUNT as Pt}from"../lib/content/menu-placeholder.js";import{DEFAULT_SWITCH_SHOWN as Tt}from"efficient-web-builder/format/lib/theme";import{chromeWidthStyle as Et,resolveChromeWidth as It}from"efficient-web-builder/format/lib/content/page-width";import{headerThemeWrap as $t}from"../lib/content/header-theme.js";import{headerSolidBackground as Ct,isProductPage as Lt,resolveMenuRow as _t,resolveNavTextCase as Ht,resolveUtilStyle as Rt}from"../lib/content/header-bar.js";import{surfaceIsLight as At}from"../lib/logo/surface-is-light.js";import{HEADER_HEIGHT_PX as Dt,HEADER_MENU_GAP_PX as Ut,HEADER_SET_HEIGHT_CSS as Mt}from"efficient-web-builder/render/lib/document/header-clearance";import{HEADER_INK_OVERRIDE_ATTR as jt,resolveHeaderInkMode as Ot}from"efficient-web-builder/render/lib/document/header-ink";const ie={stacked:{grid:"hidden min-[1501px]:grid",flex:"hidden min-[1501px]:flex"},inline:{grid:"hidden view-tablet:grid",flex:"hidden view-tablet:flex"}},zt=Array.from({length:Pt},()=>({href:"#",label:r(ut,{})}));function Bt({previewSettings:p,initialSettings:I,editorPreview:$,showThemeToggle:ce,wordmark:de,hideLogo:me,hideMenu:ue,siteName:C,commerceEnabled:g=!0}={}){const he=et(),B=Lt(he),[c,y]=v(!1),{open:fe,totals:pe}=st(),{open:ge}=at(),[L,be]=v(!1),[xe,ve]=v(null),[ye,we]=v(null),[t,Se]=v(I??null),n=p??(t?{logoUrl:t.logoUrl,reverseLogo:t.reverseLogo,logoReversed:t.logoReversed,logoInkIsDark:t.logoInkIsDark,logoPosition:t.logoPosition,logoSize:t.logoSize,logoSizePx:t.logoSizePx,logoSizeUnit:t.logoSizeUnit??null,menuItems:(t.menuItems??[]).map(e=>({label:e.label,url:e.url,dropdown_menu:null,dropdown_items:e.dropdownItems??[],dropdown_aside:e.dropdownAside??null})),menuSplit:t.menuSplit??3,menuPosition:t.menuPosition,menuRow:t.menuRow,menuGapPx:t.menuGapPx??null,menuGapUnit:t.menuGapUnit??null,searchEnabled:t.searchEnabled,searchPosition:t.searchPosition,searchRow:t.searchRow,countrySelectorEnabled:t.countrySelectorEnabled,countrySelectorShowAs:t.countrySelectorShowAs,countryUrls:t.countryUrls,accountEnabled:t.accountEnabled,cartEnabled:t.cartEnabled,utilStyle:t.utilStyle,navTextCase:t.navTextCase,lightReverseText:t.lightReverseText,topTextColor:t.topTextColor,transparentTop:t.transparentTop,surface:t.surface,theme:t.theme,width:t.width,heightPx:t.heightPx,borderThickness:t.borderThickness??null,sticky:t.sticky,callButton:t.callButton,callPhone:t.callPhone,callHref:t.callHref}:null),ke=me?null:n?.logoUrl??null,Ne=n?.reverseLogo??!1,Pe=n?.logoReversed??null,Te=n?.logoInkIsDark??null,i=n?.logoPosition??"center",Ee=n?.logoSize??"medium",Ie=n?.logoSizePx??null,$e=n?.logoSizeUnit??null,G=Math.min(Math.max(n?.menuSplit??3,1),4),Ce=(n?.menuPosition??"left")==="center",Le=(n?.menuPosition??"left")==="beside",F=_t(n?.menuRow)==="inline",_=n?.menuGapPx??null,_e=_!=null?{gap:mt(_,n?.menuGapUnit,"gap",Ut)??`${_}px`}:void 0,w=F?ie.inline:ie.stacked,He=n?.searchEnabled??!1,W=n?.searchPosition??"right",Re=n?.countrySelectorEnabled??!0,Ae=ct(n?.countrySelectorShowAs),H=n?.accountEnabled??!0,De=n?.cartEnabled??!0,R=Rt(n?.utilStyle)==="text",V=Ht(n?.navTextCase)==="capitalised",a=`mono-eyebrow${V?" mono-eyebrow-plain":""}`,K=n?.countryUrls??{},Ue=It(n?.width),Me=Et(Ue)??void 0,je=n?.heightPx??Dt.default,X=Math.round(n?.borderThickness??1),Oe=Number.isFinite(X)?Math.min(Math.max(X,0),20):1,Y=n?.sticky??"always",A=Ot(n?.topTextColor),m=$t(n?.theme),S=Object.keys(K),J=it(S.length?S:void 0),b=Re?r(lt,{countries:S.length?S:void 0,urls:p?void 0:K,showAs:Ae}):null,{headerRef:u,scrolled:q,navHidden:ze}=bt({stickyMode:Y,heightPx:je}),Be=m?JSON.stringify(m.style):null;se(()=>{const e=u.current?.ownerDocument??document,o=e.defaultView??window,T=oe=>oe?At(o.getComputedStyle(oe).getPropertyValue("--bg")):null,z=()=>{be(!ot({doc:e,whenUnset:!0})),ve(T(e.body)),we(T(u.current))};z();const Ze=rt(z,{doc:e}),ne=new MutationObserver(z);return e.body&&ne.observe(e.body,{attributes:!0,attributeFilter:["style"]}),()=>{Ze(),ne.disconnect()}},[u,Be]);const x=ce??Tt?r(wt,{}):null;se(()=>{if(!kt({editorPreview:!!$,hasPreviewSettings:!!p,hasInitialSettings:!!I}))return;let e=!1;return St.getHeaderSettings().then(o=>!e&&Se(o)).catch(o=>{console.warn("[header] settings fetch failed; using built-in defaults",o)}),()=>{e=!0}},[$,p,I]);const Ge=vt(u),k=q||B||Ge,Q=Ct(L,B),Z=xt(u,A),Fe=k||!Z,We=k?ye??L:(xe??L)&&!Z,Ve=A==="auto"?null:{[jt]:A},Ke=tt(()=>y(!1),[]),D=nt(null);yt({active:c,onDismiss:Ke,focusRef:D,trapRef:D});const d=(e,o,T="start")=>r(ae,{item:e,dropdownAlign:T},o),Xe=!ue&&(n?.menuItems?.length??0)>0,N=!!$||!!p,l=Xe?n.menuItems.map(e=>({href:e.url||"",label:le(e.label),plainLabel:e.label,dropdownItems:(e.dropdown_items??[]).map(o=>({href:o.url||"",label:le(o.label),plainLabel:o.label,description:o.description,image:o.image,badge:o.badge})),dropdownAside:Nt(e.dropdown_aside)})):N?zt.map(e=>({...e,plainLabel:"Menu item",dropdownItems:[]})):[],Ye=l.length>0||g&&H||!!b&&J||!!x,Je=i==="center"?l.slice(0,G):i==="right"?l:[],qe=i==="center"?l.slice(G):i==="left"?l:[],P=He&&g?r(pt,{onClick:N?void 0:ge,asText:R}):null,U=g&&H?r(ht,{asText:R}):null,M=e=>g&&De?r(ft,{onClick:fe,count:pe.sets,asText:R,className:e}):null,Qe=n?.callPhone??"",ee=n?.callHref??"",j=e=>n?.callButton&&(ee||N)?r(gt,{href:N?"":ee,label:e?"Call":Qe||"Call"}):null,h=s(E,{children:[W==="left"?P:null,b,x,U,M(),W==="right"?P:null,j(!1)]}),O=(e,o=!1)=>r(re,{href:"/","aria-label":C?`${C} home`:"Home",className:e,children:r(dt,{variant:"header",scrolled:Fe,src:ke,reverse:Ne,onLightSurface:We,reversedSrc:Pe,inkIsDark:Te,size:Ee,sizePx:Ie,sizeUnit:$e,wordmark:de,siteName:C,fitToContainer:o})}),f=O("inline-flex shrink-0 items-center justify-center"),te="flex min-w-0 flex-1 items-center overflow-x-clip [container-type:inline-size]";return s(E,{children:[r("header",{ref:u,"data-scrolled":q||void 0,"data-header-nav-case":V?"capitalised":void 0,...Ve,className:["sf-site-header",...m?[m.className]:[],Y==="none"?"absolute":"fixed","inset-x-0 top-0 z-50","flex items-center","px-[var(--sf-site-gutter,40px)] max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]",k?"border-solid border-line backdrop-blur-md":"border-solid border-transparent","transition-[background,border-color,transform] duration-300 ease-out"].join(" "),style:{...m?m.style:null,minHeight:Mt,borderBottomWidth:`${Oe}px`,...ze?{transform:"translateY(-100%)"}:null,...k?{background:Q,color:"var(--fg)","--sf-header-ground":Q}:{color:"var(--sf-header-overlay-fg)","--sf-header-ground":"var(--sf-header-overlay-ground)"}},children:s("div",{className:"w-full",style:Me,children:[Ce?s("div",{"data-header-band":"",className:`${w.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[i==="right"?r("nav",{className:`${a} flex items-center gap-8`,children:h}):r("div",{className:"flex items-center",children:f}),r("nav",{className:`${a} flex items-center justify-center gap-8`,children:l.map((e,o)=>d(e,`${e.href}-${o}`,"center"))}),i==="right"?r("div",{className:"flex items-center justify-end",children:f}):r("nav",{className:`${a} flex items-center justify-end gap-8`,children:h})]}):i==="center"?s("div",{"data-header-band":"",className:`${w.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[r("nav",{className:`${a} flex items-center gap-8`,children:Je.map((e,o)=>d(e,`${e.href}-${o}`))}),f,s("nav",{className:`${a} flex items-center justify-end gap-8`,children:[qe.map((e,o)=>d(e,`${e.href}-${o}`,"end")),h]})]}):Le?s("div",{"data-header-band":"",className:`${w.flex} items-center justify-between gap-8`,children:[s("div",{className:"flex items-center gap-8",style:_e,children:[f,r("nav",{className:`${a} flex items-center gap-8`,children:l.map((e,o)=>d(e,`${e.href}-${o}`))})]}),r("nav",{className:`${a} flex items-center justify-end gap-8`,children:h})]}):r("div",{"data-header-band":"",className:`${w.flex} items-center justify-between gap-8`,children:i==="right"?s(E,{children:[s("nav",{className:`${a} flex items-center gap-8`,children:[l.map((e,o)=>d(e,`${e.href}-${o}`)),h]}),f]}):s(E,{children:[f,s("nav",{className:`${a} flex items-center gap-8`,children:[l.map((e,o)=>d(e,`${e.href}-${o}`)),h]})]})}),!F&&s("div",{"data-header-band":"",className:"hidden view-tablet:max-[1501px]:flex flex-col gap-3",children:[s("div",{className:"flex items-center justify-between",children:[O(te,!0),s("div",{className:`${a} flex shrink-0 items-center gap-5`,children:[P,b,x,U,M(),j(!1)]})]}),r("nav",{className:`${a} flex items-center gap-6 border-t border-line/60 pt-3`,children:l.map((e,o)=>d(e,`${e.href}-${o}`))})]}),s("div",{"data-header-phone":"",className:"hidden max-view-tablet:flex items-center justify-between",children:[O(te,!0),s("div",{className:"flex shrink-0 items-center gap-4",children:[P,U,M(a),j(!0),Ye&&s("button",{type:"button","aria-label":c?"Close menu":"Open menu","aria-expanded":c,onClick:()=>y(e=>!e),className:"flex h-11 w-11 flex-col items-center justify-center gap-2",children:[r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"translate-y-[3px] rotate-45":""}`}),r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"opacity-0":""}`}),r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"-translate-y-[3px] -rotate-45":""}`})]})]})]})]})}),c&&s("div",{ref:D,role:"dialog","aria-modal":"true","aria-label":"Menu",tabIndex:-1,"data-header-phone-menu":"",className:"fixed inset-x-0 top-0 bottom-0 z-40 hidden flex-col gap-8 overflow-y-auto bg-bg px-6 pt-24 pb-10 max-view-tablet:flex",children:[l.map((e,o)=>r(ae,{item:e,mobile:!0,onNavigate:()=>y(!1)},`${e.href}-${o}`)),s("div",{className:"mt-auto flex flex-col gap-4 border-t border-line pt-6",children:[g&&H&&s("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),r(re,{href:"/account",onClick:()=>y(!1),className:"mono-eyebrow underline",children:"Your account"})]}),b&&J&&s("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),b]}),x&&s("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),x]})]})]})]})}export{Bt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as a,Fragment as o}from"react/jsx-runtime";import u from"next/link";import{FIGURE_UPDATING as N,FREE_PRICE as b,UNPRICED_LABEL as k}from"../../lib/wheels/price-display.js";import w from"../CartLineThumbnail.js";import C from"../CouponField.js";import S from"../QuantityStepper.js";import j from"efficient-web-builder/render/components/RMark";import{lineTotal as v,useCart as d}from"../CartContext.js";import{COUPON_DEFERRED_TOTAL as T}from"../../lib/cart/coupon-preview.js";import{couponSaving as B,shippingWords as F,TAX_PENDING as $}from"../../lib/cart/shipping-status.js";import{useCurrency as g}from"../CurrencyContext.js";import{cartSubtitle as _}from"efficient-web-builder/format/lib/content/cart-drawer";function X({content:e,closeRef:r}){const{close:s,items:n}=d(),l=r;return a("header",{className:"flex flex-shrink-0 flex-col gap-4 border-b border-line px-8 pb-6 pt-8 max-[640px]:px-6 max-[640px]:pt-6 max-[640px]:pb-5",children:[a("div",{className:"flex items-center justify-between",children:[a("span",{className:"flex items-center gap-3 font-mono text-[10px] uppercase tracking-[0.3em] text-accent",children:[e.kickerBadge?t("span",{className:"border px-2 py-1 text-[10px]",style:{background:"color-mix(in oklab, var(--accent) 12%, transparent)",borderColor:"color-mix(in oklab, var(--accent) 50%, transparent)"},children:e.kickerBadge}):null,(e.kickerBadge?"· ":"")+e.kickerText]}),t("button",{ref:l,type:"button",onClick:s,"aria-label":"Close cart",className:"flex h-8 w-8 items-center justify-center border border-line text-[14px] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"✕"})]}),a("h1",{className:"font-display text-[38px] font-medium uppercase leading-[0.95] tracking-[-0.03em] max-[640px]:text-[30px]",children:[e.titleLead+" ",t("em",{className:"font-serif font-normal italic text-accent tracking-[-0.02em] normal-case",children:e.titleAccent})]}),t("p",{className:"font-serif text-[13px] italic leading-[1.5] text-fg-dim",children:_(e,n.length)})]})}function Y({content:e}){const{totals:r}=d(),{activeCountry:s}=g(),n=s?.name??e.shipsToFallback,l=1+(e.leadTimeValue?1:0)+(n?1:0);return t(o,{children:a("div",{className:`grid flex-shrink-0 ${R[l-1]} gap-px border-b border-line bg-line`,children:[t(h,{label:"Items",value:a(o,{children:[t("em",{className:"font-serif font-normal italic text-accent",children:r.sets})," set",r.sets===1?"":"s"," · ",r.units," item",r.units===1?"":"s"]})}),e.leadTimeValue?t(h,{label:"Lead time",value:e.leadTimeValue}):null,n?t(h,{label:"Ships to",value:n}):null]})})}function J({content:e,tyres:r}){const{items:s,remove:n,setQty:l}=d();return t(o,{children:s.length===0?t(A,{content:e}):s.map(c=>t(E,{line:c,tyre:r.get(c.slug),onRemove:()=>n(c.id),onQtyChange:m=>l(c.id,m)},c.id))})}function Z(){const{items:e,totals:r,bundles:s}=d(),{formatMoney:n}=g(),l=new Set(e.flatMap(i=>(i.components??[]).map(x=>x.partNumber))),c=new Set(r.appliedBundles.map(i=>i.slug)),m=s.filter(i=>!c.has(i.slug)).filter(i=>i.components.some(x=>l.has(x.partNumber))).slice(0,2);return t(o,{children:m.length>0&&a("section",{className:"border-b border-line px-8 py-6 max-[640px]:px-6",style:{background:"color-mix(in oklab, var(--site-surface) 60%, transparent)"},children:[a("div",{className:"mb-4 flex items-center justify-between font-mono text-[10px] uppercase tracking-[0.3em] text-accent",children:[t("span",{children:"You may also need"}),t("span",{className:"font-display text-[11px] normal-case tracking-[0.08em] text-fg-dim",children:"Buy together, save"})]}),t("div",{className:"grid grid-cols-2 gap-2 max-[640px]:grid-cols-1",children:m.map(i=>t(L,{href:`/bundles/${i.slug}`,title:i.name,sub:U(i,r.currency,n)},i.slug))})]})})}function ee(){return t(o,{children:t("section",{className:"border-b border-line px-8 py-6 max-[640px]:px-6",children:t(C,{})})})}function te({content:e}){return t(o,{children:e.promises.length>0&&t("div",{className:"flex flex-wrap justify-center gap-5 border-b border-line px-8 pt-6 pb-8 font-mono text-[9px] uppercase tracking-[0.24em] text-fg-dim max-[640px]:px-6",children:e.promises.map(r=>t(I,{children:r},r))})})}function re(){const{totals:e,coupon:r}=d(),{formatMoney:s}=g();return t(o,{children:a("div",{className:"flex flex-shrink-0 flex-col gap-2 border-t border-line px-8 pt-5 max-[640px]:px-6",children:[t(p,{label:`Subtotal · ${e.sets} set${e.sets===1?"":"s"}`,value:s(e.subtotal,e.currency)}),e.appliedBundles.map(n=>t(p,{label:`Bundle · ${n.name}${n.multiples>1?` ×${n.multiples}`:""}`,value:a("span",{style:{color:"var(--green)"},children:["− ",s(n.discount,e.currency)]})},n.slug)),(e.discount>0||e.deliverySaving>0)&&r?.valid&&t(p,{label:`Coupon · ${r.code}`,value:t("span",{style:{color:"var(--green)"},children:B(e,n=>s(n,e.currency))})}),r?.deferred&&t(p,{label:`Coupon · ${r.code}`,value:T}),r?.valid&&r.effects?.gift&&t(p,{label:`Free gift · ${r.effects.gift.partNumber}${r.effects.gift.quantity>1?` ×${r.effects.gift.quantity}`:""}`,value:t("span",{style:{color:"var(--green)"},children:b})}),t(p,{label:"Shipping",value:e.shippingStatus==="free"?t("span",{style:{color:"var(--green)"},children:b}):F(e.shippingStatus)??s(e.shipping,e.currency)}),e.tax&&(e.tax.charged?t(p,{label:e.tax.inclusive?`${e.tax.name} included · ${e.tax.rate}%`:e.tax.name,value:s(e.tax.amount,e.currency)}):e.tax.name?t(p,{label:e.tax.name,value:$}):null),a("div",{className:"mt-2 flex items-center justify-between border-t border-line pt-4 text-fg",children:[a("span",{className:"font-display text-[22px] font-medium tracking-[-0.02em] normal-case",children:["Total ",t("em",{className:"font-serif font-normal italic text-accent",children:"due"})]}),t("span",{className:"text-right font-display text-[30px] font-medium tracking-[-0.025em] text-fg",children:e.repricing?N:s(e.grand,e.currency)})]})]})})}function ae(){const{items:e,close:r}=d();return t(o,{children:a("div",{className:"flex flex-shrink-0 flex-col gap-3 px-8 pb-6 pt-4 max-[640px]:px-6",children:[a(u,{href:"/checkout",onClick:r,"aria-disabled":e.length===0,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[12px] uppercase tracking-[0.3em] transition-colors",e.length===0?"pointer-events-none cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:["Begin checkout",t("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]}),t("div",{className:"flex items-center justify-between px-1 py-2 font-mono text-[10px] uppercase tracking-[0.24em] text-fg-dim",children:t(u,{href:"/wheels",onClick:r,className:"text-fg transition-colors hover:text-accent",children:"← Keep browsing"})})]})})}const R=["grid-cols-1","grid-cols-2","grid-cols-3"];function h({label:e,value:r}){return a("div",{className:"flex flex-col gap-1 bg-bg px-4 py-4",children:[t("span",{className:"font-mono text-[9px] uppercase tracking-[0.26em] text-fg-dim",children:e}),t("span",{className:"font-display text-[14px] font-medium tracking-[-0.005em] text-fg",children:r})]})}function E({line:e,tyre:r,onRemove:s,onQtyChange:n}){const{catalog:l,totals:c}=d(),m=(e.components??[]).reduce((f,y)=>f+(c.freeUnitsByPartNumber[y.partNumber]??0),0),{currency:i,formatMoney:x}=g();return a(o,{children:[a("article",{className:"grid grid-cols-[96px_1fr] gap-5 border-b border-line px-8 py-6 transition-colors hover:bg-[color-mix(in_oklab,var(--site-surface)_60%,transparent)] max-[640px]:grid-cols-[78px_1fr] max-[640px]:px-6 max-[640px]:py-5",children:[t(w,{line:e,catalog:l,tyre:r}),a("div",{className:"flex min-w-0 flex-col gap-2",children:[a("div",{className:"flex items-start justify-between gap-3",children:[a("span",{className:"font-mono text-[9px] uppercase tracking-[0.26em] text-accent",children:["N° ",e.positionNo," · ",e.process==="FusionForge®"?a(o,{children:["FusionForge",t(j,{})]}):e.process]}),t("span",{className:"whitespace-nowrap font-display text-[16px] font-medium tracking-[-0.015em] text-fg",children:v(e,i)===null?k:x(v(e,i),i)})]}),a("h3",{className:"mt-0.5 font-display text-[22px] font-medium uppercase leading-none tracking-[-0.02em]",children:[e.name.lead,t("em",{className:"font-serif font-normal italic text-accent tracking-[-0.01em] normal-case",children:e.name.accent})]}),e.config.length>0&&a("div",{className:"mt-1 flex flex-wrap gap-2",children:[e.config.map(f=>t("span",{className:["border px-2 py-1 font-mono text-[9px] uppercase tracking-[0.18em]",f.gold?"border-[color-mix(in_oklab,var(--accent)_45%,var(--site-line))] text-accent":"border-line text-fg-dim"].join(" "),children:f.label},f.label)),m>0&&a("span",{className:"border border-accent bg-accent px-2 py-1 font-mono text-[9px] uppercase tracking-[0.18em] text-bg",children:[m,"× free"]})]}),a("div",{className:"mt-3 flex items-center justify-between gap-3",children:[t(S,{value:e.qty,onChange:n,size:"small"}),a("div",{className:"flex gap-4 font-mono text-[10px] uppercase tracking-[0.22em]",children:[t(u,{href:e.href??`/wheels/${e.slug}`,className:"text-fg-dim transition-colors hover:text-accent",children:e.href?"View product":"Edit finish"}),t("button",{type:"button",onClick:s,className:"text-fg-dim transition-colors hover:text-alert",children:"Remove"})]})]})]})]}),e.verifiedFor&&a("div",{className:"mx-8 -mt-px flex items-start gap-3 border-t-0 px-4 py-4 font-display text-[13px] leading-[1.45] text-fg max-[640px]:mx-6",style:{background:"color-mix(in oklab, var(--accent) 8%, transparent)",border:"1px solid color-mix(in oklab, var(--accent) 35%, var(--site-line))",borderTop:"0"},children:[t("span",{className:"flex-shrink-0 pt-px font-mono text-[10px] uppercase tracking-[0.24em] text-accent",children:"Fits"}),a("span",{children:["Verified for your ",t("strong",{className:"font-medium text-accent",children:e.verifiedFor}),". Final torque values shipped with the wheels."]})]})]})}function L({title:e,sub:r,href:s}){return a(u,{href:s,className:"flex items-center justify-between border border-line bg-bg px-4 py-3 text-left transition-colors hover:border-accent",children:[a("span",{className:"flex min-w-0 flex-col gap-1",children:[t("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap font-display text-[13px] font-medium tracking-[-0.005em] text-fg",children:e}),t("span",{className:"font-mono text-[9px] uppercase tracking-[0.22em] text-fg-dim",children:r})]}),t("span",{className:"ml-2 flex h-6 w-6 flex-shrink-0 items-center justify-center font-mono text-[13px] text-accent",style:{borderColor:"color-mix(in oklab, var(--accent) 45%, var(--site-line))",borderWidth:1,borderStyle:"solid"},children:"+"})]})}function U(e,r,s){const n=e.savings[r];if(n===void 0)return"Buy together";const l=s(n,r);return e.savingIsFrom?`Save from ${l}`:`Save ${l}`}function I({children:e}){return t("span",{className:"inline-flex items-center gap-2 before:text-[6px] before:text-accent before:content-['●']",children:e})}function p({label:e,value:r}){return a("div",{className:"flex items-center justify-between font-mono text-[11px] uppercase tracking-[0.18em] text-fg-dim",children:[t("span",{children:e}),t("strong",{className:"font-display text-[14px] font-normal tracking-[-0.005em] normal-case text-fg",children:r})]})}function A({content:e}){return a("div",{className:"flex flex-col items-center justify-center gap-3 px-8 py-20 text-center",children:[t("span",{className:"font-mono text-[10px] uppercase tracking-[0.3em] text-accent",children:e.emptyKicker}),t("p",{className:"font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:e.emptyBody}),a(u,{href:"/wheels",className:"mt-3 inline-flex items-center gap-3 border border-line px-5 py-3 font-mono text-[11px] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:["Browse the catalog ",t("span",{className:"text-accent",children:"→"})]})]})}export{ae as CartActions,ee as CartCouponRow,X as CartDrawerHeader,E as CartLineRow,J as CartLines,Y as CartStatusRail,re as CartTotals,te as CartTrustMarkers,Z as CartUpsell};
|
|
1
|
+
"use client";import{jsx as t,jsxs as a,Fragment as c}from"react/jsx-runtime";import u from"next/link";import{FIGURE_UPDATING as N,FREE_PRICE as b,UNPRICED_LABEL as k}from"../../lib/wheels/price-display.js";import w from"../CartLineThumbnail.js";import C from"../CouponField.js";import S from"../QuantityStepper.js";import j from"efficient-web-builder/render/components/RMark";import{lineTotal as v,useCart as d}from"../CartContext.js";import{COUPON_DEFERRED_TOTAL as T}from"../../lib/cart/coupon-preview.js";import{couponSaving as B,shippingWords as F,TAX_PENDING as $}from"../../lib/cart/shipping-status.js";import{useCurrency as g}from"../CurrencyContext.js";import{cartSubtitle as _}from"efficient-web-builder/format/lib/content/cart-drawer";function X({content:e,closeRef:r}){const{close:s,items:n}=d(),l=r;return a("header",{className:"flex flex-shrink-0 flex-col gap-4 border-b border-line px-8 pb-6 pt-8 max-[640px]:px-6 max-[640px]:pt-6 max-[640px]:pb-5",children:[a("div",{className:"flex items-center justify-between",children:[a("span",{className:"flex items-center gap-3 font-mono text-[10px] uppercase tracking-[0.3em] text-accent",children:[e.kickerBadge?t("span",{className:"border px-2 py-1 text-[10px]",style:{background:"color-mix(in oklab, var(--accent) 12%, transparent)",borderColor:"color-mix(in oklab, var(--accent) 50%, transparent)"},children:e.kickerBadge}):null,(e.kickerBadge?"· ":"")+e.kickerText]}),t("button",{ref:l,type:"button",onClick:s,"aria-label":"Close cart",className:"flex h-8 w-8 items-center justify-center border border-line text-[14px] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"✕"})]}),a("h1",{className:"font-display text-[38px] font-medium uppercase leading-[0.95] tracking-[-0.03em] max-[640px]:text-[30px]",children:[e.titleLead+" ",t("em",{className:"font-serif font-normal italic text-accent tracking-[-0.02em] normal-case",children:e.titleAccent})]}),t("p",{className:"font-serif text-[13px] italic leading-[1.5] text-fg-dim",children:_(e,n.length)})]})}function Y({content:e}){const{totals:r}=d(),{activeCountry:s}=g(),n=s?.name??e.shipsToFallback,l=1+(e.leadTimeValue?1:0)+(n?1:0);return t(c,{children:a("div",{className:`grid flex-shrink-0 ${R[l-1]} gap-px border-b border-line bg-line`,children:[t(h,{label:"Items",value:a(c,{children:[t("em",{className:"font-serif font-normal italic text-accent",children:r.sets})," set",r.sets===1?"":"s"," · ",r.units," item",r.units===1?"":"s"]})}),e.leadTimeValue?t(h,{label:"Lead time",value:e.leadTimeValue}):null,n?t(h,{label:"Ships to",value:n}):null]})})}function J({content:e,tyres:r}){const{items:s,remove:n,setQty:l}=d();return t(c,{children:s.length===0?t(A,{content:e}):s.map(o=>t(E,{line:o,tyre:r.get(o.slug),onRemove:()=>n(o.id),onQtyChange:m=>l(o.id,m)},o.id))})}function Z(){const{items:e,totals:r,bundles:s}=d(),{formatMoney:n}=g(),l=new Set(e.flatMap(i=>(i.components??[]).map(x=>x.partNumber))),o=new Set(r.appliedBundles.map(i=>i.slug)),m=s.filter(i=>!o.has(i.slug)).filter(i=>i.components.some(x=>l.has(x.partNumber))).slice(0,2);return t(c,{children:m.length>0&&a("section",{className:"border-b border-line px-8 py-6 max-[640px]:px-6",style:{background:"color-mix(in oklab, var(--site-surface) 60%, transparent)"},children:[a("div",{className:"mb-4 flex items-center justify-between font-mono text-[10px] uppercase tracking-[0.3em] text-accent",children:[t("span",{children:"You may also need"}),t("span",{className:"font-display text-[11px] normal-case tracking-[0.08em] text-fg-dim",children:"Buy together, save"})]}),t("div",{className:"grid grid-cols-2 gap-2 max-[640px]:grid-cols-1",children:m.map(i=>t(L,{href:`/bundles/${i.slug}`,title:i.name,sub:U(i,r.currency,n)},i.slug))})]})})}function ee(){return t(c,{children:t("section",{className:"border-b border-line px-8 py-6 max-[640px]:px-6",children:t(C,{})})})}function te({content:e}){return t(c,{children:e.promises.length>0&&t("div",{className:"flex flex-wrap justify-center gap-5 border-b border-line px-8 pt-6 pb-8 font-mono text-[9px] uppercase tracking-[0.24em] text-fg-dim max-[640px]:px-6",children:e.promises.map(r=>t(I,{children:r},r))})})}function re(){const{totals:e,coupon:r}=d(),{formatMoney:s}=g();return t(c,{children:a("div",{className:"flex flex-shrink-0 flex-col gap-2 border-t border-line px-8 pt-5 max-[640px]:px-6",children:[t(p,{label:`Subtotal · ${e.sets} set${e.sets===1?"":"s"}`,value:s(e.subtotal,e.currency)}),e.appliedBundles.map(n=>t(p,{label:`Bundle · ${n.name}${n.multiples>1?` ×${n.multiples}`:""}`,value:a("span",{style:{color:"var(--green)"},children:["− ",s(n.discount,e.currency)]})},n.slug)),(e.discount>0||e.deliverySaving>0)&&r?.valid&&t(p,{label:`Coupon · ${r.code}`,value:t("span",{style:{color:"var(--green)"},children:B(e,n=>s(n,e.currency))})}),r?.deferred&&t(p,{label:`Coupon · ${r.code}`,value:T}),r?.valid&&r.effects?.gift&&t(p,{label:`Free gift · ${r.effects.gift.partNumber}${r.effects.gift.quantity>1?` ×${r.effects.gift.quantity}`:""}`,value:t("span",{style:{color:"var(--green)"},children:b})}),t(p,{label:"Shipping",value:e.shippingStatus==="free"?t("span",{style:{color:"var(--green)"},children:b}):F(e.shippingStatus)??s(e.shipping,e.currency)}),e.tax&&(e.tax.charged?t(p,{label:e.tax.inclusive?`${e.tax.name} included · ${e.tax.rate}%`:e.tax.name,value:s(e.tax.amount,e.currency)}):e.tax.name?t(p,{label:e.tax.name,value:$}):null),a("div",{className:"mt-2 flex items-center justify-between border-t border-line pt-4 text-fg",children:[a("span",{className:"font-display text-[22px] font-medium tracking-[-0.02em] normal-case",children:["Total ",t("em",{className:"font-serif font-normal italic text-accent",children:"due"})]}),t("span",{className:"text-right font-display text-[30px] font-medium tracking-[-0.025em] text-fg",children:e.repricing?N:s(e.grand,e.currency)})]})]})})}function ae(){const{items:e,close:r}=d();return t(c,{children:a("div",{className:"flex flex-shrink-0 flex-col gap-3 px-8 pb-6 pt-4 max-[640px]:px-6",children:[a(u,{href:"/checkout",onClick:r,"aria-disabled":e.length===0,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[12px] uppercase tracking-[0.3em] transition-colors",e.length===0?"pointer-events-none cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:["Begin checkout",t("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]}),t("div",{className:"flex items-center justify-between px-1 py-2 font-mono text-[10px] uppercase tracking-[0.24em] text-fg-dim",children:t(u,{href:"/wheels",onClick:r,className:"text-fg transition-colors hover:text-accent",children:"← Keep browsing"})})]})})}const R=["grid-cols-1","grid-cols-2","grid-cols-3"];function h({label:e,value:r}){return a("div",{className:"flex flex-col gap-1 bg-bg px-4 py-4",children:[t("span",{className:"font-mono text-[9px] uppercase tracking-[0.26em] text-fg-dim",children:e}),t("span",{className:"font-display text-[14px] font-medium tracking-[-0.005em] text-fg",children:r})]})}function E({line:e,tyre:r,onRemove:s,onQtyChange:n}){const{catalog:l,totals:o}=d(),m=(e.components??[]).reduce((f,y)=>f+(o.freeUnitsByPartNumber[y.partNumber]??0),0),{currency:i,formatMoney:x}=g();return a(c,{children:[a("article",{className:"grid grid-cols-[96px_1fr] gap-5 border-b border-line px-8 py-6 transition-colors hover:bg-[color-mix(in_oklab,var(--site-surface)_60%,transparent)] max-[640px]:grid-cols-[78px_1fr] max-[640px]:px-6 max-[640px]:py-5",children:[t(w,{line:e,catalog:l,tyre:r}),a("div",{className:"flex min-w-0 flex-col gap-2",children:[a("div",{className:"flex items-start justify-between gap-3",children:[a("span",{className:"font-mono text-[9px] uppercase tracking-[0.26em] text-accent",children:[a("span",{"data-cart-line-no":"",children:["N° ",e.positionNo," · "]}),e.process==="FusionForge®"?a(c,{children:["FusionForge",t(j,{})]}):e.process]}),t("span",{className:"whitespace-nowrap font-display text-[16px] font-medium tracking-[-0.015em] text-fg",children:v(e,i)===null?k:x(v(e,i),i)})]}),a("h3",{className:"mt-0.5 font-display text-[22px] font-medium uppercase leading-none tracking-[-0.02em]",children:[e.name.lead,t("em",{className:"font-serif font-normal italic text-accent tracking-[-0.01em] normal-case",children:e.name.accent})]}),e.config.length>0&&a("div",{className:"mt-1 flex flex-wrap gap-2",children:[e.config.map(f=>t("span",{className:["border px-2 py-1 font-mono text-[9px] uppercase tracking-[0.18em]",f.gold?"border-[color-mix(in_oklab,var(--accent)_45%,var(--site-line))] text-accent":"border-line text-fg-dim"].join(" "),children:f.label},f.label)),m>0&&a("span",{className:"border border-accent bg-accent px-2 py-1 font-mono text-[9px] uppercase tracking-[0.18em] text-bg",children:[m,"× free"]})]}),a("div",{className:"mt-3 flex items-center justify-between gap-3",children:[t(S,{value:e.qty,onChange:n,size:"small"}),a("div",{className:"flex gap-4 font-mono text-[10px] uppercase tracking-[0.22em]",children:[t(u,{href:e.href??`/wheels/${e.slug}`,className:"text-fg-dim transition-colors hover:text-accent",children:e.href?"View product":"Edit finish"}),t("button",{type:"button",onClick:s,className:"text-fg-dim transition-colors hover:text-alert",children:"Remove"})]})]})]})]}),e.verifiedFor&&a("div",{className:"mx-8 -mt-px flex items-start gap-3 border-t-0 px-4 py-4 font-display text-[13px] leading-[1.45] text-fg max-[640px]:mx-6",style:{background:"color-mix(in oklab, var(--accent) 8%, transparent)",border:"1px solid color-mix(in oklab, var(--accent) 35%, var(--site-line))",borderTop:"0"},children:[t("span",{className:"flex-shrink-0 pt-px font-mono text-[10px] uppercase tracking-[0.24em] text-accent",children:"Fits"}),a("span",{children:["Verified for your ",t("strong",{className:"font-medium text-accent",children:e.verifiedFor}),". Final torque values shipped with the wheels."]})]})]})}function L({title:e,sub:r,href:s}){return a(u,{href:s,className:"flex items-center justify-between border border-line bg-bg px-4 py-3 text-left transition-colors hover:border-accent",children:[a("span",{className:"flex min-w-0 flex-col gap-1",children:[t("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap font-display text-[13px] font-medium tracking-[-0.005em] text-fg",children:e}),t("span",{className:"font-mono text-[9px] uppercase tracking-[0.22em] text-fg-dim",children:r})]}),t("span",{className:"ml-2 flex h-6 w-6 flex-shrink-0 items-center justify-center font-mono text-[13px] text-accent",style:{borderColor:"color-mix(in oklab, var(--accent) 45%, var(--site-line))",borderWidth:1,borderStyle:"solid"},children:"+"})]})}function U(e,r,s){const n=e.savings[r];if(n===void 0)return"Buy together";const l=s(n,r);return e.savingIsFrom?`Save from ${l}`:`Save ${l}`}function I({children:e}){return t("span",{className:"inline-flex items-center gap-2 before:text-[6px] before:text-accent before:content-['●']",children:e})}function p({label:e,value:r}){return a("div",{className:"flex items-center justify-between font-mono text-[11px] uppercase tracking-[0.18em] text-fg-dim",children:[t("span",{children:e}),t("strong",{className:"font-display text-[14px] font-normal tracking-[-0.005em] normal-case text-fg",children:r})]})}function A({content:e}){return a("div",{className:"flex flex-col items-center justify-center gap-3 px-8 py-20 text-center",children:[t("span",{className:"font-mono text-[10px] uppercase tracking-[0.3em] text-accent",children:e.emptyKicker}),t("p",{className:"font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:e.emptyBody}),a(u,{href:"/wheels",className:"mt-3 inline-flex items-center gap-3 border border-line px-5 py-3 font-mono text-[11px] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:["Browse the catalog ",t("span",{className:"text-accent",children:"→"})]})]})}export{ae as CartActions,ee as CartCouponRow,X as CartDrawerHeader,E as CartLineRow,J as CartLines,Y as CartStatusRail,re as CartTotals,te as CartTrustMarkers,Z as CartUpsell};
|