efficient-storefront-blocks 0.98.0 → 0.99.1
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 +46 -0
- package/dist/chunks/EditorPreviewCheckout-EBG3NMJI.js +4 -0
- package/dist/chunks/{SiteEditorProvider-LW5QSBKM.js → SiteEditorProvider-YAIB64UV.js} +1 -1
- package/dist/chunks/chunk-5VSNQZU6.js +1 -0
- package/dist/chunks/chunk-DOJJTEJV.js +1 -0
- package/dist/chunks/{chunk-4QN263UJ.js → chunk-KRMWJLBM.js} +2 -2
- package/dist/chunks/{fitment-data-BRGBDG7Y.js → fitment-data-PXY35OVC.js} +1 -1
- package/dist/contract.js +1 -1
- package/dist/editor/components/GalleryShowcaseSource.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/SearchBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/BookingBox/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/DealerFinder/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/service/DealerFinder/fields.js +1 -0
- package/dist/editor/lib/document/blocks/service/SiteHeader/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/SubmitBox/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/index.d.ts +1 -1
- package/dist/editor/lib/document/blocks/service/index.js +1 -1
- package/dist/editor/lib/document/config.js +1 -1
- package/dist/editor/lib/document/popup-look-fields.d.ts +1 -0
- package/dist/editor/lib/document/popup-look-fields.js +1 -1
- package/dist/editor/lib/document/text-kind-style-rows.d.ts +5 -0
- package/dist/editor/lib/document/text-kind-style-rows.js +1 -0
- package/dist/editor/lib/storefront-editor-words.d.ts +4 -2
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/index.js +31 -31
- package/dist/links.js +1 -1
- package/dist/render/app/globals.css +136 -12
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/CatalogFilterBarSection.js +1 -1
- package/dist/render/components/ChatWidget.js +1 -1
- package/dist/render/components/CouponField.d.ts +2 -1
- package/dist/render/components/CouponField.js +1 -1
- package/dist/render/components/CurrencyContext.d.ts +3 -0
- package/dist/render/components/CurrencyContext.js +1 -1
- package/dist/render/components/DealerFinderSection.d.ts +18 -0
- package/dist/render/components/DealerFinderSection.js +1 -0
- package/dist/render/components/FooterMenu.d.ts +5 -3
- package/dist/render/components/FooterMenu.js +1 -1
- package/dist/render/components/FormBlock.d.ts +4 -1
- package/dist/render/components/FormBlock.js +1 -1
- package/dist/render/components/Header.js +1 -1
- package/dist/render/components/HeaderToolBlocks.d.ts +4 -2
- package/dist/render/components/HeaderToolBlocks.js +1 -1
- package/dist/render/components/HeaderTools.d.ts +7 -2
- package/dist/render/components/HeaderTools.js +1 -1
- package/dist/render/components/PhoneSheet.d.ts +16 -0
- package/dist/render/components/PhoneSheet.js +1 -0
- package/dist/render/components/PreOrderPanel.js +1 -1
- package/dist/render/components/ProductGridSection.js +1 -1
- package/dist/render/components/ProductRef.js +1 -1
- package/dist/render/components/SectionGroupBody.d.ts +2 -1
- package/dist/render/components/SectionGroupBody.js +1 -1
- package/dist/render/components/Subscribe.d.ts +1 -0
- package/dist/render/components/Subscribe.js +1 -1
- package/dist/render/components/card-pieces/CardPrice.js +1 -1
- package/dist/render/components/card-pieces/useTaxNote.d.ts +1 -0
- package/dist/render/components/card-pieces/useTaxNote.js +1 -0
- package/dist/render/components/catalog/CatalogFilterBar.d.ts +5 -1
- package/dist/render/components/catalog/CatalogFilterBar.js +1 -1
- package/dist/render/components/catalog/CatalogFilterContext.d.ts +2 -0
- package/dist/render/components/catalog/CatalogFilterContext.js +1 -1
- package/dist/render/components/catalog/FilterPill.js +1 -1
- package/dist/render/components/catalog/PriceRange.d.ts +6 -1
- package/dist/render/components/catalog/PriceRange.js +1 -1
- package/dist/render/components/catalog/ShopperFilters.js +1 -1
- package/dist/render/components/checkout/checkout-parts.js +1 -1
- package/dist/render/components/checkout/checkout-state.d.ts +2 -0
- package/dist/render/components/checkout/checkout-state.js +3 -3
- package/dist/render/components/fitment/PickerField.js +1 -1
- package/dist/render/components/formSubmission.d.ts +4 -2
- package/dist/render/components/formSubmission.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicSpecTable.d.ts +0 -3
- package/dist/render/components/pdp-dynamic/DynamicSpecTable.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicWheelDiagram.js +1 -1
- package/dist/render/components/submit/SubmitRegions.js +1 -1
- package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
- package/dist/render/components/wheels-plp/PlpActiveChips.d.ts +2 -1
- package/dist/render/components/wheels-plp/PlpActiveChips.js +1 -1
- package/dist/render/components/wheels-plp/PlpSidebar.d.ts +15 -7
- package/dist/render/components/wheels-plp/PlpSidebar.js +1 -1
- package/dist/render/components/wheels-plp/useVehicleCatalog.d.ts +6 -1
- package/dist/render/components/wheels-plp/useVehicleCatalog.js +1 -1
- package/dist/render/lib/api/index.d.ts +4 -1
- package/dist/render/lib/api/index.js +1 -1
- package/dist/render/lib/api/types.d.ts +1 -0
- package/dist/render/lib/booking/text-kinds.js +1 -1
- package/dist/render/lib/catalog/tax-note.d.ts +4 -0
- package/dist/render/lib/catalog/tax-note.js +1 -0
- package/dist/render/lib/content/article-page-seed.js +1 -1
- package/dist/render/lib/content/menu-row.d.ts +16 -0
- package/dist/render/lib/content/menu-row.js +1 -1
- package/dist/render/lib/content/text-kind-vars.d.ts +4 -0
- package/dist/render/lib/content/text-kind-vars.js +1 -0
- package/dist/render/lib/document/blocks/commerce/SearchBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/service/DealerFinder/meta.d.ts +2 -0
- package/dist/render/lib/document/blocks/service/DealerFinder/meta.js +1 -0
- package/dist/render/lib/document/blocks/service/DealerFinder/render.d.ts +4 -0
- package/dist/render/lib/document/blocks/service/DealerFinder/render.js +1 -0
- package/dist/render/lib/document/blocks/service/SiteHeader/render.js +1 -1
- package/dist/render/lib/document/blocks/service/metas.d.ts +1 -0
- package/dist/render/lib/document/blocks/service/metas.js +1 -1
- package/dist/render/lib/document/blocks/service/renders.d.ts +1 -0
- package/dist/render/lib/document/blocks/service/renders.js +1 -1
- package/dist/render/lib/document/blocks/text-part-shapes.json +10 -0
- package/dist/render/lib/document/footer-page-blocks.js +1 -1
- package/dist/render/lib/document/lazy-draws.js +1 -1
- package/dist/render/lib/document/section-to-box-rows-service.js +1 -1
- package/dist/render/lib/popup/text-kind-style.js +1 -1
- package/dist/render/lib/sections/dealer-finder.d.ts +41 -0
- package/dist/render/lib/sections/dealer-finder.js +1 -0
- package/dist/render/lib/submit/text-kinds.js +1 -1
- package/dist/render/lib/wheels/catalog-filters-to-listing.d.ts +1 -1
- package/dist/render/lib/wheels/catalog-filters-to-listing.js +1 -1
- package/dist/render/lib/wheels/plp-filters.d.ts +5 -0
- package/dist/render/lib/wheels/plp-filters.js +1 -1
- package/dist/render/lib/wheels/wheel-sheet.d.ts +3 -0
- package/dist/render/lib/wheels/wheel-sheet.js +1 -0
- package/dist/words.d.ts +4 -2
- package/dist/words.js +1 -1
- package/package.json +2 -2
- package/dist/chunks/EditorPreviewCheckout-2FW4VEOK.js +0 -4
- package/dist/chunks/chunk-PWSMCGXO.js +0 -1
- package/dist/chunks/chunk-SEIKSSUW.js +0 -1
- /package/dist/chunks/{chunk-XEZ7BYVZ.js → chunk-B2IYTOE3.js} +0 -0
- /package/dist/chunks/{chunk-4QN263UJ.js.LEGAL.txt → chunk-KRMWJLBM.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-GOHV3G3C.js → chunk-QP2F42DV.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,Fragment as T,jsxs as l}from"react/jsx-runtime";import oe from"next/link";import{usePathname as Je}from"next/navigation";import{useCallback as Qe,useEffect as B,useState as p}from"react";import{rootIsDark as Ze,watchRootTheme as et}from"efficient-shell/format";import{useCart as tt}from"./CartContext.js";import{useSearch as nt}from"./SearchContext.js";import ot,{useCountrySelectShows as rt}from"./CountrySelect.js";import{resolveCountryShowAs as lt}from"../lib/content/country-show-as.js";import re from"./HeaderNavItem.js";import at from"efficient-web-builder/render/components/Logo";import{siteLengthCss as st}from"efficient-web-builder/format/lib/content/css-length";import it from"./MenuPlaceholderLabel.js";import{withRMark as le}from"efficient-web-builder/render/components/RMark";import{AccountButton as ct,CartButton as dt,SearchButton as mt}from"./HeaderTools.js";import ut from"./HeaderCallButton.js";import{useHeaderBar as ht}from"./useHeaderBar.js";import{useModalDismiss as ft}from"./useModalDismiss.js";import pt from"./ThemeToggle.js";import{products as gt}from"../lib/api/index.js";import{shouldFetchPublicHeaderSettings as bt}from"../lib/header-settings-fetch.js";import{HEADER_MENU_PLACEHOLDER_COUNT as xt}from"../lib/content/menu-placeholder.js";import{DEFAULT_SWITCH_SHOWN as yt}from"efficient-web-builder/format/lib/theme";import{chromeWidthStyle as vt,resolveChromeWidth as wt}from"efficient-web-builder/format/lib/content/page-width";import{headerThemeWrap as St}from"../lib/content/header-theme.js";import{headerSolidBackground as kt,isProductPage as Nt}from"../lib/content/header-bar.js";import{surfaceIsLight as Pt}from"../lib/logo/surface-is-light.js";import{HEADER_HEIGHT_PX as Et,HEADER_MENU_GAP_PX as It,HEADER_SET_HEIGHT_CSS as Tt}from"efficient-web-builder/render/lib/document/header-clearance";import{HEADER_INK_ATTR as $t,HEADER_INK_OVERRIDE_ATTR as Lt,resolveHeaderInkMode as Ct}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"}},_t=Array.from({length:xt},()=>({href:"#",label:r(it,{})}));function Ht({previewSettings:g,initialSettings:$,editorPreview:L,showThemeToggle:se,wordmark:ie,hideLogo:ce,hideMenu:de,siteName:C,commerceEnabled:b=!0}={}){const M=Je(),[me,ue]=p(!1);B(()=>{const e=y.current?.ownerDocument??document,o=()=>ue(e.querySelector(`[${$t}="light"]`)!=null);o();const f=requestAnimationFrame(o);return()=>cancelAnimationFrame(f)},[M]);const G=Nt(M),[c,w]=p(!1),{open:he,totals:fe}=tt(),{open:pe}=nt(),[_,ge]=p(!1),[be,xe]=p(null),[ye,ve]=p(null),[t,we]=p($??null),n=g??(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??[]})),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,sticky:t.sticky,callButton:t.callButton,callPhone:t.callPhone,callHref:t.callHref}:null),Se=ce?null:n?.logoUrl??null,ke=n?.reverseLogo??!1,Ne=n?.logoReversed??null,Pe=n?.logoInkIsDark??null,i=n?.logoPosition??"center",Ee=n?.logoSize??"medium",Ie=n?.logoSizePx??null,Te=n?.logoSizeUnit??null,F=Math.min(Math.max(n?.menuSplit??3,1),4),$e=(n?.menuPosition??"left")==="center",Le=(n?.menuPosition??"left")==="beside",W=(n?.menuRow??"top")==="inline",H=n?.menuGapPx??null,Ce=H!=null?{gap:st(H,n?.menuGapUnit,"gap",It)??`${H}px`}:void 0,S=W?ae.inline:ae.stacked,_e=n?.searchEnabled??!1,K=n?.searchPosition??"right",He=n?.countrySelectorEnabled??!0,Ae=lt(n?.countrySelectorShowAs),A=n?.accountEnabled??!0,De=n?.cartEnabled??!0,D=(n?.utilStyle??"icon")==="text",a=`mono-eyebrow${(n?.navTextCase??"uppercase")==="capitalised"?" mono-eyebrow-plain":""}`,V=n?.countryUrls??{},Re=wt(n?.width),Ue=vt(Re)??void 0,je=n?.heightPx??Et.default,q=n?.sticky??"always",k=Ct(n?.topTextColor),m=St(n?.theme),N=Object.keys(V),X=rt(N.length?N:void 0),x=He?r(ot,{countries:N.length?N:void 0,urls:g?void 0:V,showAs:Ae}):null,{headerRef:y,scrolled:Y,navHidden:ze}=ht({stickyMode:q,heightPx:je}),Oe=m?JSON.stringify(m.style):null;B(()=>{const e=y.current?.ownerDocument??document,o=e.defaultView??window,f=ne=>ne?Pt(o.getComputedStyle(ne).getPropertyValue("--bg")):null,O=()=>{ge(!Ze({doc:e,whenUnset:!0})),xe(f(e.body)),ve(f(y.current))};O();const Ye=et(O,{doc:e}),te=new MutationObserver(O);return e.body&&te.observe(e.body,{attributes:!0,attributeFilter:["style"]}),()=>{Ye(),te.disconnect()}},[y,Oe]);const v=se??yt?r(pt,{}):null;B(()=>{if(!bt({editorPreview:!!L,hasPreviewSettings:!!g,hasInitialSettings:!!$}))return;let e=!1;return gt.getHeaderSettings().then(o=>!e&&we(o)).catch(o=>{console.warn("[header] settings fetch failed; using built-in defaults",o)}),()=>{e=!0}},[L,g,$]);const P=Y||G,J=kt(_,G),Q=k==="auto"?me:k==="light",Be=P||!Q,Me=P?ye??_:(be??_)&&!Q,Ge=k==="auto"?null:{[Lt]:k},Fe=Qe(()=>w(!1),[]);ft({active:c,onDismiss:Fe});const d=(e,o,f="start")=>r(re,{item:e,dropdownAlign:f},o),We=!de&&(n?.menuItems?.length??0)>0,E=!!L||!!g,s=We?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}))})):E?_t.map(e=>({...e,plainLabel:"Menu item",dropdownItems:[]})):[],Ke=s.length>0||b&&A||!!x&&X||!!v,Ve=i==="center"?s.slice(0,F):i==="right"?s:[],qe=i==="center"?s.slice(F):i==="left"?s:[],I=_e&&b?r(mt,{onClick:E?void 0:pe,asText:D}):null,R=b&&A?r(ct,{asText:D}):null,U=e=>b&&De?r(dt,{onClick:he,count:fe.sets,asText:D,className:e}):null,Xe=n?.callPhone??"",Z=n?.callHref??"",j=e=>n?.callButton&&(Z||E)?r(ut,{href:E?"":Z,label:e?"Call":Xe||"Call"}):null,u=l(T,{children:[K==="left"?I:null,x,v,R,U(),K==="right"?I:null,j(!1)]}),z=(e,o=!1)=>r(oe,{href:"/","aria-label":C?`${C} home`:"Home",className:e,children:r(at,{variant:"header",scrolled:Be,src:Se,reverse:ke,onLightSurface:Me,reversedSrc:Ne,inkIsDark:Pe,size:Ee,sizePx:Ie,sizeUnit:Te,wordmark:ie,siteName:C,fitToContainer:o})}),h=z("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 l(T,{children:[r("header",{ref:y,"data-scrolled":Y||void 0,...Ge,className:["sf-site-header",...m?[m.className]:[],q==="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))]",P?"border-b border-line backdrop-blur-md":"border-b border-transparent","transition-[background,border-color,transform] duration-300 ease-out"].join(" "),style:{...m?m.style:null,minHeight:Tt,...ze?{transform:"translateY(-100%)"}:null,...P?{background:J,color:"var(--fg)","--sf-header-ground":J}:{color:"var(--sf-header-overlay-fg)","--sf-header-ground":"var(--sf-header-overlay-ground)"}},children:l("div",{className:"w-full",style:Ue,children:[$e?l("div",{"data-header-band":"",className:`${S.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[i==="right"?r("nav",{className:`${a} flex items-center gap-8`,children:u}):r("div",{className:"flex items-center",children:h}),r("nav",{className:`${a} flex items-center justify-center gap-8`,children:s.map((e,o)=>d(e,`${e.href}-${o}`,"center"))}),i==="right"?r("div",{className:"flex items-center justify-end",children:h}):r("nav",{className:`${a} flex items-center justify-end gap-8`,children:u})]}):i==="center"?l("div",{"data-header-band":"",className:`${S.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[r("nav",{className:`${a} flex items-center gap-8`,children:Ve.map((e,o)=>d(e,`${e.href}-${o}`))}),h,l("nav",{className:`${a} flex items-center justify-end gap-8`,children:[qe.map((e,o)=>d(e,`${e.href}-${o}`,"end")),u]})]}):Le?l("div",{"data-header-band":"",className:`${S.flex} items-center justify-between gap-8`,children:[l("div",{className:"flex items-center gap-8",style:Ce,children:[h,r("nav",{className:`${a} flex items-center gap-8`,children:s.map((e,o)=>d(e,`${e.href}-${o}`))})]}),r("nav",{className:`${a} flex items-center justify-end gap-8`,children:u})]}):r("div",{"data-header-band":"",className:`${S.flex} items-center justify-between gap-8`,children:i==="right"?l(T,{children:[l("nav",{className:`${a} flex items-center gap-8`,children:[s.map((e,o)=>d(e,`${e.href}-${o}`)),u]}),h]}):l(T,{children:[h,l("nav",{className:`${a} flex items-center gap-8`,children:[s.map((e,o)=>d(e,`${e.href}-${o}`)),u]})]})}),!W&&l("div",{"data-header-band":"",className:"hidden view-tablet:max-[1501px]:flex flex-col gap-3",children:[l("div",{className:"flex items-center justify-between",children:[z(ee,!0),l("div",{className:`${a} flex shrink-0 items-center gap-5`,children:[I,x,v,R,U(),j(!1)]})]}),r("nav",{className:`${a} flex items-center gap-6 border-t border-line/60 pt-3`,children:s.map((e,o)=>d(e,`${e.href}-${o}`))})]}),l("div",{"data-header-phone":"",className:"hidden max-view-tablet:flex items-center justify-between",children:[z(ee,!0),l("div",{className:"flex shrink-0 items-center gap-4",children:[I,R,U(a),j(!0),Ke&&l("button",{type:"button","aria-label":c?"Close menu":"Open menu","aria-expanded":c,onClick:()=>w(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&&l("div",{"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:[s.map((e,o)=>r(re,{item:e,mobile:!0,onNavigate:()=>w(!1)},`${e.href}-${o}`)),l("div",{className:"mt-auto flex flex-col gap-4 border-t border-line pt-6",children:[b&&A&&l("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),r(oe,{href:"/account",onClick:()=>w(!1),className:"mono-eyebrow underline",children:"Your account"})]}),x&&X&&l("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),x]}),v&&l("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),v]})]})]})]})}export{Ht as default};
|
|
1
|
+
"use client";import{jsx as r,Fragment as T,jsxs as l}from"react/jsx-runtime";import re from"next/link";import{usePathname as Qe}from"next/navigation";import{useCallback as Ze,useEffect as B,useRef as et,useState as p}from"react";import{rootIsDark as tt,watchRootTheme as nt}from"efficient-shell/format";import{useCart as ot}from"./CartContext.js";import{useSearch as rt}from"./SearchContext.js";import lt,{useCountrySelectShows as at}from"./CountrySelect.js";import{resolveCountryShowAs as st}from"../lib/content/country-show-as.js";import le from"./HeaderNavItem.js";import it from"efficient-web-builder/render/components/Logo";import{siteLengthCss as ct}from"efficient-web-builder/format/lib/content/css-length";import dt from"./MenuPlaceholderLabel.js";import{withRMark as ae}from"efficient-web-builder/render/components/RMark";import{AccountButton as mt,CartButton as ut,SearchButton as ht}from"./HeaderTools.js";import ft from"./HeaderCallButton.js";import{useHeaderBar as pt}from"./useHeaderBar.js";import{useModalDismiss as gt}from"./useModalDismiss.js";import bt from"./ThemeToggle.js";import{products as xt}from"../lib/api/index.js";import{shouldFetchPublicHeaderSettings as yt}from"../lib/header-settings-fetch.js";import{HEADER_MENU_PLACEHOLDER_COUNT as vt}from"../lib/content/menu-placeholder.js";import{DEFAULT_SWITCH_SHOWN as wt}from"efficient-web-builder/format/lib/theme";import{chromeWidthStyle as St,resolveChromeWidth as kt}from"efficient-web-builder/format/lib/content/page-width";import{headerThemeWrap as Nt}from"../lib/content/header-theme.js";import{headerSolidBackground as Pt,isProductPage as Et}from"../lib/content/header-bar.js";import{surfaceIsLight as It}from"../lib/logo/surface-is-light.js";import{HEADER_HEIGHT_PX as Tt,HEADER_MENU_GAP_PX as $t,HEADER_SET_HEIGHT_CSS as Lt}from"efficient-web-builder/render/lib/document/header-clearance";import{HEADER_INK_ATTR as Ct,HEADER_INK_OVERRIDE_ATTR as _t,resolveHeaderInkMode as Rt}from"efficient-web-builder/render/lib/document/header-ink";const se={stacked:{grid:"hidden min-[1501px]:grid",flex:"hidden min-[1501px]:flex"},inline:{grid:"hidden view-tablet:grid",flex:"hidden view-tablet:flex"}},Ht=Array.from({length:vt},()=>({href:"#",label:r(dt,{})}));function At({previewSettings:g,initialSettings:$,editorPreview:L,showThemeToggle:ie,wordmark:ce,hideLogo:de,hideMenu:me,siteName:C,commerceEnabled:b=!0}={}){const G=Qe(),[ue,he]=p(!1);B(()=>{const e=y.current?.ownerDocument??document,o=()=>he(e.querySelector(`[${Ct}="light"]`)!=null);o();const f=requestAnimationFrame(o);return()=>cancelAnimationFrame(f)},[G]);const F=Et(G),[c,w]=p(!1),{open:fe,totals:pe}=ot(),{open:ge}=rt(),[_,be]=p(!1),[xe,ye]=p(null),[ve,we]=p(null),[t,Se]=p($??null),n=g??(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??[]})),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,sticky:t.sticky,callButton:t.callButton,callPhone:t.callPhone,callHref:t.callHref}:null),ke=de?null:n?.logoUrl??null,Ne=n?.reverseLogo??!1,Pe=n?.logoReversed??null,Ee=n?.logoInkIsDark??null,i=n?.logoPosition??"center",Ie=n?.logoSize??"medium",Te=n?.logoSizePx??null,$e=n?.logoSizeUnit??null,W=Math.min(Math.max(n?.menuSplit??3,1),4),Le=(n?.menuPosition??"left")==="center",Ce=(n?.menuPosition??"left")==="beside",K=(n?.menuRow??"top")==="inline",R=n?.menuGapPx??null,_e=R!=null?{gap:ct(R,n?.menuGapUnit,"gap",$t)??`${R}px`}:void 0,S=K?se.inline:se.stacked,Re=n?.searchEnabled??!1,V=n?.searchPosition??"right",He=n?.countrySelectorEnabled??!0,Ae=st(n?.countrySelectorShowAs),H=n?.accountEnabled??!0,De=n?.cartEnabled??!0,A=(n?.utilStyle??"icon")==="text",a=`mono-eyebrow${(n?.navTextCase??"uppercase")==="capitalised"?" mono-eyebrow-plain":""}`,q=n?.countryUrls??{},Ue=kt(n?.width),je=St(Ue)??void 0,ze=n?.heightPx??Tt.default,X=n?.sticky??"always",k=Rt(n?.topTextColor),m=Nt(n?.theme),N=Object.keys(q),Y=at(N.length?N:void 0),x=He?r(lt,{countries:N.length?N:void 0,urls:g?void 0:q,showAs:Ae}):null,{headerRef:y,scrolled:J,navHidden:Oe}=pt({stickyMode:X,heightPx:ze}),Me=m?JSON.stringify(m.style):null;B(()=>{const e=y.current?.ownerDocument??document,o=e.defaultView??window,f=oe=>oe?It(o.getComputedStyle(oe).getPropertyValue("--bg")):null,M=()=>{be(!tt({doc:e,whenUnset:!0})),ye(f(e.body)),we(f(y.current))};M();const Je=nt(M,{doc:e}),ne=new MutationObserver(M);return e.body&&ne.observe(e.body,{attributes:!0,attributeFilter:["style"]}),()=>{Je(),ne.disconnect()}},[y,Me]);const v=ie??wt?r(bt,{}):null;B(()=>{if(!yt({editorPreview:!!L,hasPreviewSettings:!!g,hasInitialSettings:!!$}))return;let e=!1;return xt.getHeaderSettings().then(o=>!e&&Se(o)).catch(o=>{console.warn("[header] settings fetch failed; using built-in defaults",o)}),()=>{e=!0}},[L,g,$]);const P=J||F,Q=Pt(_,F),Z=k==="auto"?ue:k==="light",Be=P||!Z,Ge=P?ve??_:(xe??_)&&!Z,Fe=k==="auto"?null:{[_t]:k},We=Ze(()=>w(!1),[]),D=et(null);gt({active:c,onDismiss:We,focusRef:D,trapRef:D});const d=(e,o,f="start")=>r(le,{item:e,dropdownAlign:f},o),Ke=!me&&(n?.menuItems?.length??0)>0,E=!!L||!!g,s=Ke?n.menuItems.map(e=>({href:e.url||"",label:ae(e.label),plainLabel:e.label,dropdownItems:(e.dropdown_items??[]).map(o=>({href:o.url||"",label:ae(o.label),plainLabel:o.label}))})):E?Ht.map(e=>({...e,plainLabel:"Menu item",dropdownItems:[]})):[],Ve=s.length>0||b&&H||!!x&&Y||!!v,qe=i==="center"?s.slice(0,W):i==="right"?s:[],Xe=i==="center"?s.slice(W):i==="left"?s:[],I=Re&&b?r(ht,{onClick:E?void 0:ge,asText:A}):null,U=b&&H?r(mt,{asText:A}):null,j=e=>b&&De?r(ut,{onClick:fe,count:pe.sets,asText:A,className:e}):null,Ye=n?.callPhone??"",ee=n?.callHref??"",z=e=>n?.callButton&&(ee||E)?r(ft,{href:E?"":ee,label:e?"Call":Ye||"Call"}):null,u=l(T,{children:[V==="left"?I:null,x,v,U,j(),V==="right"?I:null,z(!1)]}),O=(e,o=!1)=>r(re,{href:"/","aria-label":C?`${C} home`:"Home",className:e,children:r(it,{variant:"header",scrolled:Be,src:ke,reverse:Ne,onLightSurface:Ge,reversedSrc:Pe,inkIsDark:Ee,size:Ie,sizePx:Te,sizeUnit:$e,wordmark:ce,siteName:C,fitToContainer:o})}),h=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 l(T,{children:[r("header",{ref:y,"data-scrolled":J||void 0,...Fe,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))]",P?"border-b border-line backdrop-blur-md":"border-b border-transparent","transition-[background,border-color,transform] duration-300 ease-out"].join(" "),style:{...m?m.style:null,minHeight:Lt,...Oe?{transform:"translateY(-100%)"}:null,...P?{background:Q,color:"var(--fg)","--sf-header-ground":Q}:{color:"var(--sf-header-overlay-fg)","--sf-header-ground":"var(--sf-header-overlay-ground)"}},children:l("div",{className:"w-full",style:je,children:[Le?l("div",{"data-header-band":"",className:`${S.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[i==="right"?r("nav",{className:`${a} flex items-center gap-8`,children:u}):r("div",{className:"flex items-center",children:h}),r("nav",{className:`${a} flex items-center justify-center gap-8`,children:s.map((e,o)=>d(e,`${e.href}-${o}`,"center"))}),i==="right"?r("div",{className:"flex items-center justify-end",children:h}):r("nav",{className:`${a} flex items-center justify-end gap-8`,children:u})]}):i==="center"?l("div",{"data-header-band":"",className:`${S.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[r("nav",{className:`${a} flex items-center gap-8`,children:qe.map((e,o)=>d(e,`${e.href}-${o}`))}),h,l("nav",{className:`${a} flex items-center justify-end gap-8`,children:[Xe.map((e,o)=>d(e,`${e.href}-${o}`,"end")),u]})]}):Ce?l("div",{"data-header-band":"",className:`${S.flex} items-center justify-between gap-8`,children:[l("div",{className:"flex items-center gap-8",style:_e,children:[h,r("nav",{className:`${a} flex items-center gap-8`,children:s.map((e,o)=>d(e,`${e.href}-${o}`))})]}),r("nav",{className:`${a} flex items-center justify-end gap-8`,children:u})]}):r("div",{"data-header-band":"",className:`${S.flex} items-center justify-between gap-8`,children:i==="right"?l(T,{children:[l("nav",{className:`${a} flex items-center gap-8`,children:[s.map((e,o)=>d(e,`${e.href}-${o}`)),u]}),h]}):l(T,{children:[h,l("nav",{className:`${a} flex items-center gap-8`,children:[s.map((e,o)=>d(e,`${e.href}-${o}`)),u]})]})}),!K&&l("div",{"data-header-band":"",className:"hidden view-tablet:max-[1501px]:flex flex-col gap-3",children:[l("div",{className:"flex items-center justify-between",children:[O(te,!0),l("div",{className:`${a} flex shrink-0 items-center gap-5`,children:[I,x,v,U,j(),z(!1)]})]}),r("nav",{className:`${a} flex items-center gap-6 border-t border-line/60 pt-3`,children:s.map((e,o)=>d(e,`${e.href}-${o}`))})]}),l("div",{"data-header-phone":"",className:"hidden max-view-tablet:flex items-center justify-between",children:[O(te,!0),l("div",{className:"flex shrink-0 items-center gap-4",children:[I,U,j(a),z(!0),Ve&&l("button",{type:"button","aria-label":c?"Close menu":"Open menu","aria-expanded":c,onClick:()=>w(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&&l("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:[s.map((e,o)=>r(le,{item:e,mobile:!0,onNavigate:()=>w(!1)},`${e.href}-${o}`)),l("div",{className:"mt-auto flex flex-col gap-4 border-t border-line pt-6",children:[b&&H&&l("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),r(re,{href:"/account",onClick:()=>w(!1),className:"mono-eyebrow underline",children:"Your account"})]}),x&&Y&&l("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),x]}),v&&l("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),v]})]})]})]})}export{At as default};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { CountryShowAs } from "../lib/content/country-show-as.js";
|
|
2
2
|
export type ToolStyle = "icon" | "text";
|
|
3
|
-
export
|
|
4
|
-
|
|
3
|
+
export type SearchStyle = ToolStyle | "icon_text";
|
|
4
|
+
export declare function SearchTool({ style, stylePhone, editing }: {
|
|
5
|
+
style?: SearchStyle;
|
|
6
|
+
stylePhone?: SearchStyle;
|
|
5
7
|
editing?: boolean;
|
|
6
8
|
}): import("react").JSX.Element | null;
|
|
7
9
|
export declare function CartTool({ style, editing }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as o}from"react/jsx-runtime";import{useCart as
|
|
1
|
+
"use client";import{jsx as o}from"react/jsx-runtime";import{useCart as m}from"./CartContext.js";import f,{useCountrySelectShows as h}from"./CountrySelect.js";import{AccountButton as p,CartButton as x,SearchButton as a}from"./HeaderTools.js";import d from"./ThemeToggle.js";import{useOfferToPhoneMenu as s}from"efficient-web-builder/render/components/PhoneMenuTools";import{useSearch as T}from"./SearchContext.js";import{useSiteSells as l,useSiteThemeSwitchShown as S}from"./SiteRecordContext.js";import{HideTaker as c}from"efficient-web-builder/render/components/ViewHideRoot";function j({style:t="icon",stylePhone:e,editing:n=!1}){const{open:r}=T(),u=l(),i=e==="icon"||e==="text"||e==="icon_text"?e:void 0;return s(u&&!i?"search":null),u?i?o(c,{as:"span",className:"contents",children:o(a,{onClick:n?void 0:r,asText:t==="text",withWord:t==="icon_text",phoneLook:i})}):o(c,{as:"span","data-phone-menu-tool":"search",className:"contents",children:o(a,{onClick:n?void 0:r,asText:t==="text",withWord:t==="icon_text"})}):null}function L({style:t="icon",editing:e=!1}){const{open:n,totals:r}=m();return l()?o(x,{onClick:e?()=>{}:n,count:r.sets,asText:t==="text",takesViewHide:!0}):null}function V({style:t="icon"}){const e=l();return s(e?"account":null),e?o(p,{asText:t==="text",takesViewHide:!0}):null}function W(){const t=S();return s(t?"theme":null),t?o(c,{as:"span","data-phone-menu-tool":"theme",className:"contents",children:o(d,{})}):null}function M({showAs:t}){const e=h();return s(e?"region":null),e?o(c,{as:"span","data-phone-menu-tool":"region",className:"contents",children:o(f,{showAs:t})}):null}export{V as AccountTool,L as CartTool,M as CountrySwitchTool,j as SearchTool,W as ThemeSwitchTool};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
1
2
|
export declare const UTIL_WORDS: {
|
|
2
3
|
readonly search: "Search";
|
|
3
4
|
readonly account: "Account";
|
|
4
5
|
readonly cart: "Bag";
|
|
6
|
+
readonly menu: "Menu";
|
|
7
|
+
readonly close: "Close";
|
|
5
8
|
};
|
|
6
9
|
export declare const UTIL_WORD_CLASS = "whitespace-nowrap";
|
|
7
10
|
export declare function CartButton({ onClick, count, asText, className, takesViewHide, }: {
|
|
@@ -15,9 +18,11 @@ export declare function AccountButton({ asText, className, takesViewHide, }: {
|
|
|
15
18
|
asText?: boolean;
|
|
16
19
|
className?: string;
|
|
17
20
|
takesViewHide?: boolean;
|
|
18
|
-
}):
|
|
19
|
-
export declare function SearchButton({ onClick, asText, className, }: {
|
|
21
|
+
}): ReactNode;
|
|
22
|
+
export declare function SearchButton({ onClick, asText, withWord, phoneLook, className, }: {
|
|
20
23
|
onClick?: () => void;
|
|
21
24
|
asText?: boolean;
|
|
25
|
+
withWord?: boolean;
|
|
26
|
+
phoneLook?: "icon" | "text" | "icon_text";
|
|
22
27
|
className?: string;
|
|
23
28
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as
|
|
1
|
+
"use client";import{jsx as t,jsxs as c,Fragment as w}from"react/jsx-runtime";import k from"next/link";import{useEffect as v,useRef as y}from"react";import{CART_GLYPH as N}from"efficient-web-builder/render/components/cartGlyph";import h from"efficient-easel/screen/components/UiIcon";import{prefersReducedMotion as _}from"efficient-web-builder/render/components/useReducedMotion";import{HideTaker as $,NO_HIDE as C,useTakeViewHide as S,withViewHide as j}from"efficient-web-builder/render/components/ViewHideRoot";const l={search:"Search",account:"Account",cart:"Bag",menu:"Menu",close:"Close"},d="whitespace-nowrap";function B(n){return n>99?"99+":String(n)}function L({count:n,ref:e}){return t("span",{ref:e,"data-cart-badge":"","aria-hidden":"true",className:"pointer-events-none absolute -top-[7px] -right-[9px] inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-current px-1 text-[10px] leading-none font-semibold tabular-nums",style:{letterSpacing:0},children:t("span",{style:{color:"var(--sf-header-ground, var(--bg))"},children:B(n)})})}function z({onClick:n,count:e,asText:s,className:r,takesViewHide:a=!1}){const o=y(null),i=y(e);return v(()=>{i.current!==e&&(i.current=e,!_()&&o.current?.animate([{transform:"scale(0.6)"},{transform:"scale(1)"}],{duration:180,easing:"ease-out"}))},[e]),t($,{as:"button",takes:a,type:"button",onClick:n,"aria-label":`Open cart, ${e} item${e===1?"":"s"}`,className:`mono-eyebrow-ctl inline-flex items-center gap-2 opacity-80 transition-opacity hover:opacity-100 ${r??""}`,children:s?c("span",{className:d,children:[l.cart,e>0?` ${e}`:""]}):c("span",{className:"relative inline-flex",children:[t("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:N}),e>0?t(L,{count:e,ref:o}):null]})})}function M({asText:n,className:e,takesViewHide:s=!1}){const r=S(),a=s?r:C;return a.scope(t(k,{href:"/account","aria-label":"Account",className:j(`mono-eyebrow-ctl inline-flex items-center opacity-80 transition-opacity hover:opacity-100 ${e??""}`,a.className),...a.attrs,children:n?t("span",{className:d,children:l.account}):c("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t("circle",{cx:"12",cy:"8",r:"3.4"}),t("path",{d:"M5 20a7 7 0 0 1 14 0"})]})}))}function U({onClick:n,asText:e,withWord:s,phoneLook:r,className:a}){let o=!1,i;if(r){const u=e?"text":s?"icon_text":"icon",m=(g,b)=>g&&b?"":g?"max-view-tablet:hidden":b?"view-tablet:hidden":null,p=m(u!=="text",r!=="text"),f=m(u!=="icon",r!=="icon"),x=u==="icon_text"||r==="icon_text";o=!0,i=c(w,{children:[p===null?null:t("span",{className:`inline-flex ${p}`,children:t(h,{name:"search",size:x?20:18,strokeWidth:x?1.5:1.6,rounded:!0})}),f===null?null:t("span",{className:`${d} ${f}`,children:l.search})]})}else s?(o=!0,i=c(w,{children:[t(h,{name:"search",size:20,strokeWidth:1.5,rounded:!0}),t("span",{className:`${d} max-view-tablet:hidden`,children:l.search})]})):i=e?t("span",{className:d,children:l.search}):t(h,{name:"search",size:18,strokeWidth:1.6,rounded:!0});return t("button",{type:"button",onClick:n,"aria-label":"Search",title:"Search (⌘K)",className:`mono-eyebrow-ctl inline-flex items-center ${o?"gap-2 ":""}opacity-80 transition-opacity hover:opacity-100 ${a??""}`,children:i})}export{M as AccountButton,z as CartButton,U as SearchButton,l as UTIL_WORDS,d as UTIL_WORD_CLASS};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode, RefObject } from "react";
|
|
2
|
+
import type { PhoneMenuTools } from "efficient-web-builder/render/components/PhoneMenuTools";
|
|
3
|
+
export declare function PhoneSheet({ role, panelRef, name, entries, tools, withAccount, editing, onClose, onSearch, phoneOnly, marker, listStyle, }: {
|
|
4
|
+
role: "dialog";
|
|
5
|
+
panelRef: RefObject<HTMLDivElement | null>;
|
|
6
|
+
name: string;
|
|
7
|
+
entries: ReactNode;
|
|
8
|
+
tools: PhoneMenuTools | null;
|
|
9
|
+
withAccount: boolean;
|
|
10
|
+
editing: boolean;
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
onSearch: () => void;
|
|
13
|
+
phoneOnly?: boolean;
|
|
14
|
+
marker?: string;
|
|
15
|
+
listStyle?: CSSProperties;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import h from"next/link";import p from"efficient-easel/screen/components/UiIcon";import b from"./CountrySelect.js";import g from"./ThemeToggle.js";import{UTIL_WORDS as y}from"./HeaderTools.js";import{UNDER_HEADER_SHEET_CLASS as N}from"../lib/content/header-bar.js";function k({role:o,panelRef:c,name:s,entries:m,tools:n,withAccount:r,editing:d,onClose:a,onSearch:f,phoneOnly:u=!1,marker:i,listStyle:x}){const l=n&&(n.search||n.region||r&&n.account||n.theme)?n:null;return t("div",{ref:c,role:o,"aria-modal":"true","aria-label":s,tabIndex:-1,...i?{"data-menu-panel":i}:null,className:`${N} z-[60] flex flex-col overflow-y-auto bg-bg text-fg${u?" view-tablet:hidden":""}`,children:[e("ul",{className:"m-0 flex list-none flex-col px-5 py-3 font-mono text-[16px] uppercase tracking-[0.18em]",style:x,children:m}),l?t("div",{className:"mt-auto flex flex-col gap-4 border-t border-line bg-surface p-5",children:[l.search?t("button",{type:"button",className:"flex h-12 items-center gap-3 border border-line bg-bg px-4 text-left text-[15px]",onClick:d?void 0:()=>{a(),f()},children:[e(p,{name:"search",size:18,strokeWidth:1.6,rounded:!0}),y.search]}):null,r&&l.account?t("div",{className:"flex items-center justify-between",children:[e("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),e(h,{href:"/account",onClick:a,className:"mono-eyebrow underline",children:"Your account"})]}):null,l.region?t("div",{className:"flex items-center justify-between",children:[e("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),e(b,{})]}):null,l.theme?t("div",{className:"flex items-center justify-between",children:[e("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),e(g,{})]}):null]}):null]})}export{k as PhoneSheet};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as u}from"react";import v from"./EmailCaptureForm.js";import{usePreOrderIntent as k}from"./usePreOrderIntent.js";import{sizePairLabel as c}from"../lib/wheels/plp-filters.js";function y({wheel:
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as u}from"react";import v from"./EmailCaptureForm.js";import{usePreOrderIntent as k}from"./usePreOrderIntent.js";import{sizePairLabel as c}from"../lib/wheels/plp-filters.js";function y({wheel:n,editing:b=!1}){const r=n.sizePairs??[],[o,x]=u(r.length>0?0:-1),[l,f]=u(""),{status:s,submit:g,reset:d}=k(),i=o>=0?r[o]??null:null;function h(){g({productSlug:n.slug,size:i,email:l,dryRun:b})}return t("div",{className:"flex flex-col gap-5 border-t border-line pt-5",children:[t("div",{className:"border-2 border-accent/40 px-4 py-4 font-mono text-[12px] leading-relaxed tracking-[0.08em] text-fg",style:{background:"color-mix(in oklab, var(--accent) 6%, transparent)"},children:[e("span",{className:"font-bold uppercase tracking-[0.2em] text-accent",children:"Pre-order"})," ","— this design isn't available to add to cart right now. Leave your email to pre-order it. No payment is taken now."]}),r.length>0&&t("div",{children:[t("div",{className:"mb-4 font-mono text-[13px] font-semibold uppercase tracking-[0.22em] text-fg",children:["Size ·"," ",e("span",{className:"text-accent",children:i?c(i):"Select a size"})]}),e("div",{className:"flex flex-wrap gap-2",children:r.map((p,m)=>{const a=m===o;return t("button",{type:"button","aria-pressed":a,onClick:()=>{x(m),s==="sent"&&d()},className:["relative cursor-pointer border-2 px-4 py-3 text-left font-mono uppercase transition-colors",a?"border-accent text-fg outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 text-fg hover:border-accent"].join(" "),style:a?{background:"color-mix(in oklab, var(--accent) 14%, transparent)"}:void 0,children:[a&&e("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),e("span",{className:"block text-[14px] tracking-[0.18em]",children:c(p)})]},c(p))})})]}),s==="sent"?t("p",{className:"font-mono text-[12px] uppercase tracking-[0.18em] text-accent",children:["Thanks — we've registered your pre-order for the ",n.name,"."]}):e(v,{email:l,onEmailChange:f,status:s,onResetVerdict:d,onSubmit:h,inputAriaLabel:"Email to pre-order this design",submitLabel:"Pre-order",buttonClassName:"cursor-pointer whitespace-nowrap border-2 border-btn bg-btn px-6 font-mono text-[12px] font-bold uppercase tracking-[0.22em] text-btn-ink transition-colors hover:bg-fg hover:border-fg disabled:cursor-not-allowed disabled:opacity-50",errorMessage:"Couldn't register that — please try again."})]})}export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as f,Fragment as nt}from"react/jsx-runtime";import{useScopeClass as it}from"../lib/use-scope-class.js";import{useEffect as O,useMemo as p,useState as me}from"react";import{cardHoverOf as st}from"efficient-web-builder/format/lib/animation/hover";import{containerGapProps as ot}from"efficient-web-builder/format/lib/content/container-gap";import at from"next/link";import{cardRowsGrid as lt,GridCardProvider as mt,GridMixedCards as dt,gridIndexCss as ct}from"./GridCardTemplate.js";import{gridClassImageSizes as pt}from"../lib/sections/card-image-sizes.js";import{fillRowCss as de}from"../lib/sections/fill-row.js";import{hiddenCardsRule as ce,noHoleBands as pe,noHoleCss as ge,ONE_WHEEL_MARK as gt,oneWheelScope as ue,pairScope as ut,showsASetCard as fe}from"../lib/sections/grid-no-hole.js";import{setIsWide as ft,summarySetBuild as ht}from"../lib/wheels/set-mode.js";import{answersForKind as he,NO_FIELD_ANSWERS as xe}from"../lib/content/field-usage.js";import{wheelCardEyebrowShows as xt}from"./ProductCardEyebrow.js";import wt from"./NoCurrencyNote.js";import{SITE_WIDTH_CAP as vt,centredCap as yt}from"efficient-web-builder/format/lib/content/page-width";import{ProductCatalogProvider as bt,SectionWheelsProvider as St}from"./ProductRef.js";import{useCurrency as Ct}from"./CurrencyContext.js";import{COLLECTION_ATTR as Mt,useCatalogFilter as Nt}from"./catalog/CatalogFilterContext.js";import{useIsoLayoutEffect as Et,useShopperMember as $t}from"./catalog/ShopperScope.js";import Tt from"./wheels-plp/PlpPagination.js";import{CATALOG_TEXT_SIZE as zt}from"../lib/sections/catalog-text-size.js";import{applyShopperFilters as Pt,hasActivePlpFilters as Lt}from"../lib/wheels/plp-filters.js";import It from"./catalog/ClearAllButton.js";import{gridPagingOf as _t,gridShownOf as Ot}from"../lib/sections/product-grid-pages.js";import At from"./SectionBand.js";import{useInsideBox as Ht,useInsideSiteGutter as Bt}from"efficient-web-builder/render/components/SiteGutterFrame";import{productGridColumnsClass as Rt}from"../lib/sections/product-grid-columns.js";import{renderGold as Y,renderHeadline as Ft}from"efficient-web-builder/render/components/goldPhrases";import{applyCatalogFilters as Gt}from"../lib/wheels/catalog-filters.js";import{normalizeCatalogRows as kt}from"../lib/wheels/wheel-summary-casing.js";import{itemKind as J,plpKindNoun as we}from"../lib/catalog/plp-item.js";import{filterBarCategoryOf as Wt,gridKindsOf as ve,gridRowsOf as jt}from"../lib/wheels/grid-source.js";import{useUnifiedProductCatalog as Ut}from"./useProductCatalog.js";import{STICKY_UNDERHEADER_CLASS as Kt}from"efficient-web-builder/render/lib/document/header-clearance";import{finishFamiliesOf as Xt}from"../lib/wheels/finish-defaults.js";import{lugCountsOf as Dt}from"../lib/wheels/lug-count.js";import{diametersOf as Zt}from"../lib/wheels/size-range.js";import{say as qt}from"efficient-web-builder/format/lib/editor-words";import{DEFAULT_TITLE_SIZE as Vt}from"../lib/sections/product-grid-title.js";const Yt=st({},"ProductGrid"),i={headingMediumUpTo800Xs:"max-view-wide:text-[length:var(--size-headingMedium,28px)]",headingMediumUpTo800Small:"max-view-wide:text-[length:var(--size-headingMedium,32px)]",headingMediumUpTo800Large:"max-view-wide:text-[length:var(--size-headingMedium,36px)]",headingMediumUpTo800Xl:"max-view-wide:text-[length:var(--size-headingMedium,40px)]",body:"text-[length:var(--size-body,13px)]",headingMedium1:"text-[length:var(--size-headingMedium,40px)]",headingMedium2:"text-[length:var(--size-headingMedium,48px)]",headingMedium3:"text-[length:var(--size-headingMedium,56px)]",headingMedium4:"text-[length:var(--size-headingMedium,64px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"},ye=[{value:"para",label:"Paragraph size — 13px",cls:`font-mono font-normal uppercase tracking-[0.22em] ${i.labelLarge}`},{value:"sm",label:"Small — 40px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium1} ${i.headingMediumUpTo800Xs}`},{value:"md",label:"Medium — 48px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium2} ${i.headingMediumUpTo800Small}`},{value:"lg",label:"Large — 56px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium3} ${i.headingMediumUpTo800Large}`},{value:"xl",label:"Extra large — 64px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium4} ${i.headingMediumUpTo800Xl}`}];function Jt(S){return(ye.find(h=>h.value===S)??ye.find(h=>h.value===Vt)).cls}function Qt({num:S,catalog:h,catalogTotal:be,firstCountInChips:Se=!1,kinds:$,title:A,titleSize:Ce,padTop:Q,description:T,link:C,products:Me,wheels:Ne,source:c,columns:Ee,columnsPhone:$e,columnsTablet:Te,limit:ze,moreProducts:Pe,perPage:Le,editing:M,contentCapped:Ie=!1,hover:_e,fieldUsage:x,ownerId:Oe="",template:Ae,gap:He,gapPhone:Be}){const H=p(()=>x?he(x,"alloy-wheel"):void 0,[x]),Re=p(()=>x?he(x,"tyre"):void 0,[x]),e=it("pg"),{paged:w,per:v,limit:l,cap:N}=_t({moreProducts:Pe,perPage:Le,limit:ze}),m=Rt(Ee,$e,Te),ee=Ie,Fe=Bt(),Ge=Ht(),ke=Fe||Ge,B=Ut(M===!0&&!!c),o=p(()=>c?kt(jt(c,$,B??h??[])):null,[h,B,c,$]),R=$t("grid",o),a=o?R.scope:null,g=Wt(c),y=g!==null&&!a,{filters:z,reportCount:F,reportLugs:G,reportSizes:k,reportFinishes:W,reportCategories:j,vehicle:te}=Nt(),{currency:E}=Ct(),U=y&&!!z.process&&z.process!==g,K=a?.state,r=p(()=>o?K?Pt(o,K,E):y?Gt(o,z,E,te.fit):o:null,[o,K,y,z,E,te.fit]),[We,je]=me(1),X=w&&r?Math.max(1,Math.ceil(r.length/v)):1,b=Math.min(X,Math.max(1,a?a.state.page:We)),{reportShown:D}=R,re=a!==null;Et(()=>{if(!re||!r)return D(null);D(Ot(r.length,{paged:w,per:v,cap:N},b))},[re,r,D,w,b,v,N]);const Ue=n=>a?a.update({page:n}):je(n),s=p(()=>w&&r?r.slice((b-1)*v,b*v):r,[w,r,b,v]);O(()=>(j(e,g===null?[]:[g]),()=>j(e,[])),[g,j,e]),O(()=>{if(y)return F(e,U?0:r?.length??0),()=>F(e,0)},[y,U,r,F,e]);const P=p(()=>({lugs:Dt(o??[]),sizes:Zt(o??[]),finishes:Xt(o??[])}),[o]);O(()=>(G(e,P.lugs),k(e,P.sizes),W(e,P.finishes),()=>{G(e,[]),k(e,[]),W(e,[])}),[P,G,k,W,e]);const Z=ot("ProductGrid",He,"both",Be),Ke=`${e} grid${Z.className} bg-[var(--catalog-grid-bg)] ${m}`,ne=lt(Z),Xe=`${e} grid${ne.className} bg-[var(--catalog-grid-bg)] ${m}`,De=ne.style,Ze=p(()=>{const n=(r??[]).filter(d=>J(d)!=="tyre");if(n.length===0)return!1;const u=n.some(d=>!!d.process);return n.some(d=>!!d.setWords)||xt({kind:!1,brand:!1,process:u},H??[])},[r,H]),qe=s?s.length>0?t("div",{className:Xe,style:De,children:t(dt,{items:s,tyreOf:n=>J(n)==="tyre"?n:null})}):a&&Lt(a.state)?f("div",{className:"flex min-h-[320px] flex-col items-center justify-center gap-4 bg-surface-2 p-4 text-center",children:[t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:`No ${we(ve(c,$)).many} match those filters`}),t(It,{onClick:a.clear})]}):M?t("div",{className:"flex min-h-[320px] items-center justify-center rounded bg-surface-2 p-4 text-center",children:t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:qt("No products in “{name}” yet",{name:c?.name??""})})}):null:t(Me,{className:Ke,style:Z.style,minEmptyHeight:320}),Ve=a?a.countInChips:Se,L=r&&!Ve?r===o&&!B?be??r.length:r.length:null,ie=we(ve(c,$)),Ye=S||A||T||C?f("div",{className:`${Kt} sticky top-[var(--sf-header-h,88px)] z-30 mb-5 flex items-center justify-between gap-4 max-view-wide:flex-wrap max-view-wide:gap-y-2 border-b border-line bg-bg/95 py-3 backdrop-blur-md ${ee||ke?"":"-mx-[var(--sf-site-gutter,40px)] px-[var(--sf-site-gutter,40px)] max-view-wide:-mx-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]"}`,children:[f("div",{className:"flex min-w-0 items-end gap-6 max-view-wide:flex-col max-view-wide:items-stretch max-view-wide:gap-3",children:[S&&t("span",{className:`font-mono ${i.labelLarge} leading-none uppercase tracking-[0.22em] text-fg-dim`,children:Y(S)}),A&&t("h2",{className:`${Jt(Ce)} leading-none text-fg max-view-wide:leading-[1] [&>span]:block`,children:Ft(A,!1)})]}),(T||C||L!==null)&&f("div",{className:"flex items-center gap-5 max-view-wide:gap-3 view-wide:grow view-wide:justify-end",children:[T&&t("span",{className:`max-w-[340px] truncate font-display ${i.body} leading-[1.4] text-fg-dim max-view-wide:hidden view-wide:w-0 view-wide:grow view-wide:text-right`,children:Y(T)}),C&&f(at,{href:C.href,className:`inline-flex items-center gap-2 whitespace-nowrap font-mono ${i.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-fg`,children:[Y(C.text),t("span",{"aria-hidden":!0,children:"→"})]}),L!==null&&f("span",{className:`whitespace-nowrap font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:[L," ",L===1?ie.one:ie.many]})]})]}):null,Je=typeof Q=="number"?{"--pg-pt":`${Q}px`}:{},I=p(()=>{if(!s)return null;const n=s.map(u=>J(u)!=="tyre"&&ft(ht(u))?2:1);return fe(n,l)?pe(m,n,l):null},[s,m,l]),[Qe,et]=me("");O(()=>{if(s)return;const n=document.querySelector(`.${e}`);if(!n)return;const u=()=>{const d=[...n.children].map(le=>le.classList.contains("col-span-2")&&!le.querySelector(gt)?2:1);et(fe(d,l)?ge(e,pe(m,d,l,!1),d.length):"")};u();const V=new MutationObserver(u);return V.observe(n,{childList:!0}),()=>V.disconnect()},[s,e,m,l]);const tt=I?I[0].tracks:s?N?Math.min(s.length,l):s.length:void 0,_=I?ge(ut(e),I,s.length)+(N?ce(ue(e),l+1):"")+de(ue(e),m,{limit:l,cards:s.length}):Qe,se=_?"":de(e,m,{limit:l,cards:s?.length}),oe=ct(e),ae=f(nt,{children:[N&&!_&&t("style",{children:ce(e,l+1)}),_&&t("style",{children:_}),se&&t("style",{children:se}),oe&&t("style",{children:oe}),Ye,qe,w&&X>1&&t(Tt,{textSize:zt.labelSmall,page:b,pageCount:X,onPage:Ue}),t(wt,{editing:M})]});if(U)return null;const q=t(At,{rootRef:R.ref,attrs:y&&g!==null?{[Mt]:g}:void 0,className:"relative z-[2] bg-bg px-[var(--sf-site-gutter,40px)] pt-[var(--pg-pt)] pb-[120px] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:pt-[70px] max-view-wide:pb-[70px]",column:null,inAnyBox:!0,style:Je,defaults:{"--pg-pt":"120px"},children:ee?t("div",{style:yt(vt),children:ae}):ae}),rt=o?q:M?t(bt,{currency:E,children:q}):t(St,{wheels:Ne,currency:E,children:q});return t(mt,{value:{ownerId:Oe,Template:Ae,hover:_e??Yt,imageSizes:pt(m,tt),fieldUsage:H??xe,tyreFieldUsage:Re??xe,reserveEyebrow:Ze,editing:M===!0},children:rt})}export{ye as TITLE_SIZES,Qt as default};
|
|
1
|
+
"use client";import{jsx as t,jsxs as h,Fragment as it}from"react/jsx-runtime";import{useScopeClass as st}from"../lib/use-scope-class.js";import{useEffect as O,useMemo as p,useState as de}from"react";import{cardHoverOf as ot}from"efficient-web-builder/format/lib/animation/hover";import{containerGapProps as at}from"efficient-web-builder/format/lib/content/container-gap";import lt from"next/link";import{cardRowsGrid as mt,GridCardProvider as dt,GridMixedCards as ct,gridIndexCss as pt}from"./GridCardTemplate.js";import{gridClassImageSizes as ut}from"../lib/sections/card-image-sizes.js";import{fillRowCss as ce}from"../lib/sections/fill-row.js";import{hiddenCardsRule as pe,noHoleBands as ue,noHoleCss as ge,ONE_WHEEL_MARK as gt,oneWheelScope as fe,pairScope as ft,showsASetCard as he}from"../lib/sections/grid-no-hole.js";import{setIsWide as ht,summarySetBuild as xt}from"../lib/wheels/set-mode.js";import{answersForKind as xe,NO_FIELD_ANSWERS as we}from"../lib/content/field-usage.js";import{wheelCardEyebrowShows as wt}from"./ProductCardEyebrow.js";import vt from"./NoCurrencyNote.js";import{SITE_WIDTH_CAP as yt,centredCap as bt}from"efficient-web-builder/format/lib/content/page-width";import{ProductCatalogProvider as St,SectionWheelsProvider as Ct}from"./ProductRef.js";import{useCurrency as Mt}from"./CurrencyContext.js";import{COLLECTION_ATTR as Nt,useCatalogFilter as Et}from"./catalog/CatalogFilterContext.js";import{useIsoLayoutEffect as $t,useShopperMember as Tt}from"./catalog/ShopperScope.js";import Pt from"./wheels-plp/PlpPagination.js";import{CATALOG_TEXT_SIZE as zt}from"../lib/sections/catalog-text-size.js";import{applyShopperFilters as Lt,hasActivePlpFilters as It,plpPricedAmounts as _t}from"../lib/wheels/plp-filters.js";import Ot from"./catalog/ClearAllButton.js";import{gridPagingOf as At,gridShownOf as Ht}from"../lib/sections/product-grid-pages.js";import Bt from"./SectionBand.js";import{useInsideBox as Rt,useInsideSiteGutter as Ft}from"efficient-web-builder/render/components/SiteGutterFrame";import{productGridColumnsClass as Gt}from"../lib/sections/product-grid-columns.js";import{renderGold as Q,renderHeadline as kt}from"efficient-web-builder/render/components/goldPhrases";import{applyCatalogFilters as Wt}from"../lib/wheels/catalog-filters.js";import{normalizeCatalogRows as jt}from"../lib/wheels/wheel-summary-casing.js";import{itemKind as A,plpKindNoun as ve}from"../lib/catalog/plp-item.js";import{filterBarCategoryOf as Ut,gridKindsOf as ye,gridRowsOf as Kt}from"../lib/wheels/grid-source.js";import{useUnifiedProductCatalog as Xt}from"./useProductCatalog.js";import{STICKY_UNDERHEADER_CLASS as Dt}from"efficient-web-builder/render/lib/document/header-clearance";import{finishFamiliesOf as Zt}from"../lib/wheels/finish-defaults.js";import{lugCountsOf as qt}from"../lib/wheels/lug-count.js";import{diametersOf as Vt}from"../lib/wheels/size-range.js";import{say as Yt}from"efficient-web-builder/format/lib/editor-words";import{DEFAULT_TITLE_SIZE as Jt}from"../lib/sections/product-grid-title.js";const Qt=ot({},"ProductGrid"),i={headingMediumUpTo800Xs:"max-view-wide:text-[length:var(--size-headingMedium,28px)]",headingMediumUpTo800Small:"max-view-wide:text-[length:var(--size-headingMedium,32px)]",headingMediumUpTo800Large:"max-view-wide:text-[length:var(--size-headingMedium,36px)]",headingMediumUpTo800Xl:"max-view-wide:text-[length:var(--size-headingMedium,40px)]",body:"text-[length:var(--size-body,13px)]",headingMedium1:"text-[length:var(--size-headingMedium,40px)]",headingMedium2:"text-[length:var(--size-headingMedium,48px)]",headingMedium3:"text-[length:var(--size-headingMedium,56px)]",headingMedium4:"text-[length:var(--size-headingMedium,64px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"},be=[{value:"para",label:"Paragraph size — 13px",cls:`font-mono font-normal uppercase tracking-[0.22em] ${i.labelLarge}`},{value:"sm",label:"Small — 40px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium1} ${i.headingMediumUpTo800Xs}`},{value:"md",label:"Medium — 48px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium2} ${i.headingMediumUpTo800Small}`},{value:"lg",label:"Large — 56px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium3} ${i.headingMediumUpTo800Large}`},{value:"xl",label:"Extra large — 64px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium4} ${i.headingMediumUpTo800Xl}`}];function er(C){return(be.find(x=>x.value===C)??be.find(x=>x.value===Jt)).cls}function tr({num:C,catalog:x,catalogTotal:Se,firstCountInChips:Ce=!1,kinds:T,title:H,titleSize:Me,padTop:ee,description:P,link:M,products:Ne,wheels:Ee,source:c,columns:$e,columnsPhone:Te,columnsTablet:Pe,limit:ze,moreProducts:Le,perPage:Ie,editing:N,contentCapped:_e=!1,hover:Oe,fieldUsage:w,ownerId:Ae="",template:He,gap:Be,gapPhone:Re}){const B=p(()=>w?xe(w,"alloy-wheel"):void 0,[w]),Fe=p(()=>w?xe(w,"tyre"):void 0,[w]),e=st("pg"),{paged:v,per:y,limit:l,cap:E}=At({moreProducts:Le,perPage:Ie,limit:ze}),m=Gt($e,Te,Pe),te=_e,Ge=Ft(),ke=Rt(),We=Ge||ke,R=Xt(N===!0&&!!c),s=p(()=>c?jt(Kt(c,T,R??x??[])):null,[x,R,c,T]),F=Tt("grid",s),a=s?F.scope:null,u=Ut(c),b=u!==null&&!a,{filters:z,reportCount:G,reportLugs:k,reportSizes:W,reportFinishes:j,reportCategories:U,reportPrices:K,vehicle:re}=Et(),{currency:g}=Mt(),X=b&&!!z.process&&z.process!==u,D=a?.state,n=p(()=>s?D?Lt(s,D,g):b?Wt(s,z,g,re.fit):s:null,[s,D,b,z,g,re.fit]),[je,Ue]=de(1),Z=v&&n?Math.max(1,Math.ceil(n.length/y)):1,S=Math.min(Z,Math.max(1,a?a.state.page:je)),{reportShown:q}=F,ne=a!==null;$t(()=>{if(!ne||!n)return q(null);q(Ht(n.length,{paged:v,per:y,cap:E},S))},[ne,n,q,v,S,y,E]);const Ke=r=>a?a.update({page:r}):Ue(r),o=p(()=>v&&n?n.slice((S-1)*y,S*y):n,[v,n,S,y]);O(()=>(U(e,u===null?[]:[u]),()=>U(e,[])),[u,U,e]),O(()=>{if(b)return G(e,X?0:n?.length??0),()=>G(e,0)},[b,X,n,G,e]);const $=p(()=>({lugs:qt(s??[]),sizes:Vt(s??[]),finishes:Zt(s??[]),prices:_t((s??[]).filter(r=>A(r)!=="tyre"),g)}),[s,g]);O(()=>(k(e,$.lugs),W(e,$.sizes),j(e,$.finishes),K(e,$.prices),()=>{k(e,[]),W(e,[]),j(e,[]),K(e,[])}),[$,k,W,j,K,e]);const V=at("ProductGrid",Be,"both",Re),Xe=`${e} grid${V.className} bg-[var(--catalog-grid-bg)] ${m}`,ie=mt(V),De=`${e} grid${ie.className} bg-[var(--catalog-grid-bg)] ${m}`,Ze=ie.style,qe=p(()=>{const r=(n??[]).filter(d=>A(d)!=="tyre");if(r.length===0)return!1;const f=r.some(d=>!!d.process);return r.some(d=>!!d.setWords)||wt({kind:!1,brand:!1,process:f},B??[])},[n,B]),Ve=o?o.length>0?t("div",{className:De,style:Ze,children:t(ct,{items:o,tyreOf:r=>A(r)==="tyre"?r:null})}):a&&It(a.state)?h("div",{className:"flex min-h-[320px] flex-col items-center justify-center gap-4 bg-surface-2 p-4 text-center",children:[t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:`No ${ve(ye(c,T)).many} match those filters`}),t(Ot,{onClick:a.clear})]}):N?t("div",{className:"flex min-h-[320px] items-center justify-center rounded bg-surface-2 p-4 text-center",children:t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:Yt("No products in “{name}” yet",{name:c?.name??""})})}):null:t(Ne,{className:Xe,style:V.style,minEmptyHeight:320}),Ye=a?a.countInChips:Ce,L=n&&!Ye?n===s&&!R?Se??n.length:n.length:null,se=ve(ye(c,T)),Je=C||H||P||M?h("div",{className:`${Dt} sticky top-[var(--sf-header-h,88px)] z-30 mb-5 flex items-center justify-between gap-4 max-view-wide:flex-wrap max-view-wide:gap-y-2 border-b border-line bg-bg/95 py-3 backdrop-blur-md ${te||We?"":"-mx-[var(--sf-site-gutter,40px)] px-[var(--sf-site-gutter,40px)] max-view-wide:-mx-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]"}`,children:[h("div",{className:"flex min-w-0 items-end gap-6 max-view-wide:flex-col max-view-wide:items-stretch max-view-wide:gap-3",children:[C&&t("span",{className:`font-mono ${i.labelLarge} leading-none uppercase tracking-[0.22em] text-fg-dim`,children:Q(C)}),H&&t("h2",{className:`${er(Me)} leading-none text-fg max-view-wide:leading-[1] [&>span]:block`,children:kt(H,!1)})]}),(P||M||L!==null)&&h("div",{className:"flex items-center gap-5 max-view-wide:gap-3 view-wide:grow view-wide:justify-end",children:[P&&t("span",{className:`max-w-[340px] truncate font-display ${i.body} leading-[1.4] text-fg-dim max-view-wide:hidden view-wide:w-0 view-wide:grow view-wide:text-right`,children:Q(P)}),M&&h(lt,{href:M.href,className:`inline-flex items-center gap-2 whitespace-nowrap font-mono ${i.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-fg`,children:[Q(M.text),t("span",{"aria-hidden":!0,children:"→"})]}),L!==null&&h("span",{className:`whitespace-nowrap font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:[L," ",L===1?se.one:se.many]})]})]}):null,Qe=typeof ee=="number"?{"--pg-pt":`${ee}px`}:{},I=p(()=>{if(!o)return null;const r=o.map(f=>A(f)!=="tyre"&&ht(xt(f))?2:1);return he(r,l)?ue(m,r,l):null},[o,m,l]),[et,tt]=de("");O(()=>{if(o)return;const r=document.querySelector(`.${e}`);if(!r)return;const f=()=>{const d=[...r.children].map(me=>me.classList.contains("col-span-2")&&!me.querySelector(gt)?2:1);tt(he(d,l)?ge(e,ue(m,d,l,!1),d.length):"")};f();const J=new MutationObserver(f);return J.observe(r,{childList:!0}),()=>J.disconnect()},[o,e,m,l]);const rt=I?I[0].tracks:o?E?Math.min(o.length,l):o.length:void 0,_=I?ge(ft(e),I,o.length)+(E?pe(fe(e),l+1):"")+ce(fe(e),m,{limit:l,cards:o.length}):et,oe=_?"":ce(e,m,{limit:l,cards:o?.length}),ae=pt(e),le=h(it,{children:[E&&!_&&t("style",{children:pe(e,l+1)}),_&&t("style",{children:_}),oe&&t("style",{children:oe}),ae&&t("style",{children:ae}),Je,Ve,v&&Z>1&&t(Pt,{textSize:zt.labelSmall,page:S,pageCount:Z,onPage:Ke}),t(vt,{editing:N})]});if(X)return null;const Y=t(Bt,{rootRef:F.ref,attrs:b&&u!==null?{[Nt]:u}:void 0,className:"relative z-[2] bg-bg px-[var(--sf-site-gutter,40px)] pt-[var(--pg-pt)] pb-[120px] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:pt-[70px] max-view-wide:pb-[70px]",column:null,inAnyBox:!0,style:Qe,defaults:{"--pg-pt":"120px"},children:te?t("div",{style:bt(yt),children:le}):le}),nt=s?Y:N?t(St,{currency:g,children:Y}):t(Ct,{wheels:Ee,currency:g,children:Y});return t(dt,{value:{ownerId:Ae,Template:He,hover:Oe??Qt,imageSizes:ut(m,rt),fieldUsage:B??we,tyreFieldUsage:Fe??we,reserveEyebrow:qe,editing:N===!0},children:nt})}export{be as TITLE_SIZES,tr as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as c}from"react/jsx-runtime";import{createContext as B,useContext as k,useEffect as g,useId as z,useMemo as x,useState as h}from"react";import{GridCards as F}from"./GridCardTemplate.js";import{useCatalogFilter as S}from"./catalog/CatalogFilterContext.js";import{loadProductCatalog as j}from"./useProductCatalog.js";import{itemKind as C}from"../lib/catalog/plp-item.js";import{plpPricedAmounts as L}from"../lib/wheels/plp-filters.js";import{applyCatalogFilters as N}from"../lib/wheels/catalog-filters.js";import{finishFamiliesOf as O}from"../lib/wheels/finish-defaults.js";import{lugCountsOf as A}from"../lib/wheels/lug-count.js";import{diametersOf as M}from"../lib/wheels/size-range.js";import{say as P}from"efficient-web-builder/format/lib/editor-words";import{HideTaker as y}from"efficient-web-builder/render/components/ViewHideRoot";const v=B({wheels:[],loading:!1,live:!1,obeysBar:!1,currency:""});function W(e,r,t,n,a){return C(e)==="tyre"?!0:N([b(e,r)],{...t,process:null},n,a).length>0}function b(e,r){const t=r?e.finishes?.find(n=>n.name===r):void 0;return t?{...e,finishes:[t]}:e}function $(e,r){return e.find(t=>t.designCode===r)??e.find(t=>t.slug===r)}function Y({wheels:e,currency:r="",children:t}){return c(v.Provider,{value:{wheels:e??[],loading:!1,live:!0,obeysBar:!0,currency:r},children:t})}function Z({currency:e="",children:r}){const[t,n]=h([]),[a,i]=h(!0);return g(()=>{let o=!1;return j().then(l=>{o||(n(l),i(!1))}).catch(()=>{o||i(!1)}),()=>{o=!0}},[]),c(v.Provider,{value:{wheels:t,loading:a,live:!1,obeysBar:!0,currency:e},children:r})}function q({code:e,finish:r,wheel:t}){const{wheels:n,loading:a,live:i,obeysBar:o,currency:l}=k(v),u=t??(e?$(n,e):void 0),d=E(o?u:void 0,r,l);if(u){const s=c(F,{wheels:[u],finishes:[r],children:m=>m},`${u.slug}:${r??""}`);return d?s:i?null:c(y,{as:"div","data-bar-hidden":"",className:"opacity-40",children:s})}return i?null:c(y,{as:"div",className:"sf-card flex aspect-square w-full items-center justify-center bg-surface-2 p-4 text-center",children:c("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.2em] text-fg-dim",children:a?P("Loading…"):e||P("Set a design code")})})}function E(e,r,t){const{filters:n,vehicle:a,reportCount:i,reportSizes:o,reportLugs:l,reportFinishes:u,reportPrices:d}=S(),s=z(),m=x(()=>!e||W(e,r,n,t,a.fit),[e,r,n,t,a.fit]);g(()=>{if(e)return i(s,m?1:0),()=>i(s,0)},[e,m,i,s]);const f=x(()=>{if(!e||C(e)==="tyre")return null;const p=b(e,r);return{sizes:M([p]),lugs:A([p]),finishes:O([p]),prices:L([p],t)}},[e,r,t]);return g(()=>{if(f)return o(s,f.sizes),l(s,f.lugs),u(s,f.finishes),d(s,f.prices),()=>{o(s,[]),l(s,[]),u(s,[]),d(s,[])}},[f,o,l,u,d,s]),m}export{Z as ProductCatalogProvider,Y as SectionWheelsProvider,q as default,W as handPickedMatchesBar,$ as wheelForCode};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { SlotComponent } from "efficient-easel/blocks";
|
|
2
|
-
export default function SectionGroupBody({ place, sections: Sections, editing, widths, navTextCase, menuRow, }: {
|
|
2
|
+
export default function SectionGroupBody({ place, sections: Sections, editing, widths, navTextCase, menuRow, toolTextStyle, }: {
|
|
3
3
|
place: "header" | "footer";
|
|
4
4
|
sections: SlotComponent;
|
|
5
5
|
editing?: boolean;
|
|
6
6
|
widths: Readonly<Record<string, unknown>>;
|
|
7
7
|
navTextCase?: unknown;
|
|
8
8
|
menuRow?: unknown;
|
|
9
|
+
toolTextStyle?: unknown;
|
|
9
10
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as n}from"react/jsx-runtime";import{PhoneMenuToolsProvider as
|
|
1
|
+
"use client";import{jsx as n}from"react/jsx-runtime";import{PhoneMenuToolsProvider as g}from"efficient-web-builder/render/components/PhoneMenuTools";import{SectionGroupWidthsProvider as p}from"efficient-web-builder/render/components/SiteGutterFrame";import{chromeOwnWidth as v}from"efficient-web-builder/format/lib/content/section-width";import{centredCap as b,SITE_WIDTH_CAP as x}from"efficient-web-builder/format/lib/content/page-width";import{resolveMenuRow as y,resolveNavTextCase as T}from"../lib/content/header-bar.js";import{HideTaker as w}from"efficient-web-builder/render/components/ViewHideRoot";import{textKindVars as S}from"../lib/content/text-kind-vars.js";const k={font:"--sf-header-tool-font",size:"--sf-header-tool-size"};function _(o){const e=S(o,k);return Object.keys(e).length?e:null}function M({place:o,sections:e,editing:i=!1,widths:u,navTextCase:c,menuRow:f,toolTextStyle:l}){const m=o==="footer"?"footer":"div",t=v(u),r=t.content==="full"?"100vw":t.contentMax===null?null:`${t.contentMax}px`,a=o==="footer"&&t.background==="content"?b(x):null,s=o==="header"?_(l):null,h=r===null&&a===null&&s===null?void 0:{...a,...r===null?null:{"--sf-site-width":r},...s},d=n(w,{as:m,"data-section-group":o,...o==="header"?{"data-header-nav-case":T(c),"data-header-menu-row":y(f)??"top",...s?{"data-header-tool-style":String(l)}:null}:null,className:i&&o==="footer"?"sf-theme-surfaces bg-bg text-fg":void 0,style:h,children:n(p,{value:{background:t.background,content:t.content==="content"?"content":null},children:n(e,{minEmptyHeight:120})})});return o==="header"?n(g,{children:d}):d}export{M as default};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type NewsletterSource } from "../lib/newsletter-signup.js";
|
|
2
2
|
export declare const SIGNUP_FAILED = "That didn't go through \u2014 please try again.";
|
|
3
|
+
export declare const SIGNUP_CHECK_EMAIL = "Please check your email address.";
|
|
3
4
|
export interface JournalIssueRow {
|
|
4
5
|
n?: string;
|
|
5
6
|
title?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as i}from"react/jsx-runtime";import
|
|
1
|
+
"use client";import{jsx as t,jsxs as i}from"react/jsx-runtime";import R from"./SectionBand.js";import{useState as U}from"react";import{SiteLink as A}from"efficient-web-builder/render/lib/site-runtime";import{NEWSLETTER_SOURCE as D}from"../lib/newsletter-signup.js";import H from"efficient-web-builder/render/components/EditorialSectionHead";import v from"efficient-web-builder/render/components/SectionEyebrow";import{renderChrome as M,renderGold as a,renderHeadline as y}from"efficient-web-builder/render/components/goldPhrases";import{useNewsletterSignup as P}from"./useNewsletterSignup.js";const r={issueSubline:"text-[length:var(--size-body,13px)]",issueTitle:"text-[length:var(--size-body,16px)]",intro:"text-[length:var(--size-body,19px)]",note:"text-[length:var(--size-label,12px)]",label:"text-[length:var(--size-label,13px)]",field:"text-[length:var(--size-label,14px)]"},q="That didn't go through — please try again.",B="Please check your email address.";function F({headNum:k,headTitle:s,headDesc:N,kicker:d,leadTitle:m,intro:c,emailPlaceholder:w,submitText:S,subscribedText:E,finePrint:p,issuesHeading:x,issues:_,archiveText:b,archiveHref:j,source:$=D.subscribeSection,editing:z=!1}){const[u,I]=U(""),{status:n,submit:L}=P({source:$,dryRun:z}),o=n==="sent",f=n==="sending",C=n==="error"||n==="invalid",g=(_??[]).filter(e=>(e?.n??"").trim()||(e?.title??"").trim()||(e?.date??"").trim()),l=g.length>0,T=o?E||"Subscribed ✓":f?"Sending…":S||"Subscribe →";function G(e){e.preventDefault(),!o&&L({email:u})}return i(R,{className:"border-b border-line py-[140px] max-view-desktop:py-20",children:[t(H,{num:k,title:s?y(s,!0):void 0,desc:N,accentTracking:"-0.025em"}),i("div",{className:l?"grid min-h-[460px] grid-cols-[1.1fr_1fr] border border-line max-view-desktop:grid-cols-1":"grid min-h-[460px] grid-cols-1 border border-line",children:[i("div",{className:l?"flex flex-col justify-center gap-6 border-r border-line px-14 py-16 max-view-desktop:border-r-0 max-view-desktop:border-b max-view-desktop:px-8 max-view-desktop:py-12":"flex flex-col justify-center gap-6 px-14 py-16 max-view-desktop:px-8 max-view-desktop:py-12",children:[d&&t(v,{text:d}),m&&t("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(40px,5vw,72px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.035em]",children:y(m,!0)}),c&&t("p",{className:`max-w-[480px] font-serif ${r.intro} italic leading-[1.5] text-fg-dim`,children:a(c,!0)}),i("form",{className:"mt-2 flex max-w-[520px]",onSubmit:G,children:[t("input",{type:"email",placeholder:w||"your@email.com","aria-label":"Email address",required:!0,value:u,onChange:e=>I(e.target.value),disabled:o,className:`flex-1 border border-r-0 border-line bg-bg px-5 py-5 font-mono ${r.field} uppercase tracking-[0.18em] text-fg placeholder:text-fg-dim outline-none focus:border-accent`}),t("button",{type:"submit",disabled:o||f,className:`border border-btn bg-btn px-8 py-5 font-mono ${r.label} uppercase tracking-[0.3em] text-btn-ink transition-colors hover:bg-fg hover:border-fg disabled:cursor-default disabled:opacity-90`,children:M(T)})]}),C&&t("p",{role:"alert",className:`max-w-[480px] font-mono ${r.note} uppercase leading-[1.7] tracking-[0.18em] text-alert`,children:n==="invalid"?B:q}),p&&t("p",{className:`max-w-[480px] font-mono ${r.note} uppercase leading-[1.7] tracking-[0.18em] text-fg-dim`,children:a(p)})]}),l&&i("div",{id:"sub-recent-issues",className:"grid grid-rows-[auto_1fr_auto] gap-6 bg-[var(--journal-panel-bg)] px-12 py-12 scroll-mt-[160px] max-view-desktop:px-8 max-view-desktop:py-10",children:[x&&t(v,{text:x,size:12}),t("div",{className:"flex flex-col",children:g.map((e,h)=>i("div",{className:["grid grid-cols-[60px_1fr_auto] items-start gap-5 border-b border-line py-5",h===0?"border-t border-line":""].join(" "),children:[t("span",{className:`font-mono ${r.label} tracking-[0.22em] text-accent`,children:e.n?a(e.n):""}),i("span",{className:`font-display ${r.issueTitle} font-medium leading-[1.3] tracking-[-0.01em]`,children:[e.title?a(e.title):"",e.small?.trim()&&t("small",{className:`mt-1 block font-serif ${r.issueSubline} font-normal italic text-fg-dim`,children:a(e.small,!0)})]}),t("span",{className:`whitespace-nowrap pt-1 text-right font-mono ${r.note} uppercase tracking-[0.22em] text-fg-dim`,children:e.date?a(e.date):""})]},h))}),b&&t(A,{href:j||"/journal",className:`flex items-center justify-end gap-3 font-mono ${r.note} uppercase tracking-[0.22em] text-accent hover:text-fg`,children:a(b)})]})]})]})}export{B as SIGNUP_CHECK_EMAIL,q as SIGNUP_FAILED,F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as
|
|
1
|
+
"use client";import{jsx as r,jsxs as c,Fragment as f}from"react/jsx-runtime";import{formatPrice as P}from"../../lib/commerce.js";import{say as k}from"efficient-web-builder/format/lib/editor-words";import{HideTaker as p}from"efficient-web-builder/render/components/ViewHideRoot";import{setLabel as L}from"../../lib/wheels/variants.js";import{wheelCardPriceLine as h}from"../../lib/wheels/set-mode.js";import{bundlePrice as S,EACH_UNIT as w,formatSelectionPrice as y,formatSelectionWasPrice as T,formatWheelPrice as x,formatWheelWasPrice as _,FROM_PREFIX as g,priceIn as C,resolveWheelPrice as b,SET_QUOTE_LABEL as E}from"../../lib/wheels/price-display.js";import{CARD_TEXT_SIZE as s,CardRow as v}from"./card-row.js";import{RegionBridge as R,RegionWords as W,regionAttr as z}from"./card-text-region.js";import{useHeroStateOrNull as B,useProductCardState as $}from"./ProductCardState.js";import{useTaxNote as N}from"./useTaxNote.js";function j(e,i){if(e.kind==="tyre"){const a=b(C(e.tyre.prices,e.currency),null);return{was:null,amount:x(a,e.currency,g),note:a.priced?w:null,priced:a.priced}}const{wheel:n,currency:t,price:o,sel:m,isSet:d}=e,l=b(n.prices[t],n.msrpPrices?.[t]),u=i.setTotal&&o.priced&&o.setTotal!=null&&m.selectedVariant?`${L(m.selectedVariant)} · ${P(o.setTotal,t)}`:null;return d&&i.quoteSets?{was:null,amount:l.priced?h(x(l,t,g),!0):E,note:u,priced:l.priced}:{was:i.wasFollowsSize?T(o,t):_(l,t),amount:h(y(o,t),o.priced),note:u,priced:o.priced}}function F({state:e,region:i}){const n=N(),t=c(p,{className:"flex items-baseline gap-5 border-t border-line pt-[18px]",children:[e.msrpLabel&&r("div",{className:"font-mono text-[length:var(--size-label,15px)] text-fg-dim line-through",children:e.msrpLabel}),r("div",{className:"font-heading2 text-[length:min(var(--size-headingMedium,36px),var(--sf-heading-max,9999px))] font-bold leading-none tracking-[-0.01em] text-fg",...z(i,"price"),children:r(W,{region:i,at:"price",children:e.amount})}),e.unitLabel&&r("div",{className:"font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:e.unitLabel}),e.unitLabel&&n&&r("div",{className:"font-mono text-[length:var(--size-label,13px)] text-fg-dim","data-tax-note":"",children:n}),e.packBadge&&r("div",{className:"ml-auto border border-accent px-3 py-2 font-mono text-[length:var(--size-label,13px)] font-bold uppercase tracking-[0.18em] text-accent",style:{background:"color-mix(in oklab, var(--accent) 14%, transparent)"},children:e.packBadge})]});return r(R,{region:i,sectionType:"ProductPrice",children:t})}function A({show:e=!0,region:i,...n}){const t=B();return t?r(F,{state:t,region:i}):r(I,{show:e,...n})}function H({state:e,show:i}){if(!i)return null;const n=S(e.bundle,e.currency);return c(f,{children:[n&&c(p,{className:`mt-1 font-mono ${s.labelLarge}`,children:[r("span",{className:"mr-2 text-fg-dim line-through",children:n.was}),n.amount]}),!e.bundle.inStock&&r(p,{className:`mt-1 font-mono ${s.labelSmall} uppercase tracking-[0.24em] text-fg-dim`,children:k("Currently unavailable")})]})}function I({show:e=!0,...i}){const n=$(),t=N();if(n.kind==="bundle")return r(H,{state:n,show:e});const{was:o,amount:m,note:d,priced:l}=j(n,i),a=[d,l?t:null].filter(Boolean).join(" · ")||null;return c(f,{children:[r(v,{children:e?c("div",{className:`mt-2 font-mono ${s.labelLarge}`,children:[o&&r("span",{className:"mr-2 text-fg-dim line-through",children:o}),m]}):null}),r(v,{children:e&&a?r("div",{className:`mt-[2px] font-mono ${s.labelSmall} tracking-[0.08em] text-fg-dim`,children:a}):null})]})}export{A as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useTaxNote(): string | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useCurrency as t}from"../CurrencyContext.js";import{taxNote as e}from"../../lib/catalog/tax-note.js";function u(){return e(t({optional:!0})?.activeCountry)}export{u as useTaxNote};
|
|
@@ -27,6 +27,10 @@ export interface CatalogFilterBarProps {
|
|
|
27
27
|
lugOptions?: readonly number[];
|
|
28
28
|
sizeOptions?: readonly number[];
|
|
29
29
|
finishOptions?: readonly string[];
|
|
30
|
+
priceBounds?: {
|
|
31
|
+
min: number;
|
|
32
|
+
max: number;
|
|
33
|
+
} | null;
|
|
30
34
|
scrollProcess: string | null;
|
|
31
35
|
show?: FilterBarVisibility;
|
|
32
36
|
picker?: CatalogVehicleControl;
|
|
@@ -52,4 +56,4 @@ export declare function filterBarFacetsWithChoice({ processCount, sizeCount, lug
|
|
|
52
56
|
lugs: boolean;
|
|
53
57
|
finish: boolean;
|
|
54
58
|
};
|
|
55
|
-
export default function CatalogFilterBar({ filters, setProcess, setSize, setLugs, setFinish, setPriceMin, setPriceMax, setSort, clearAll, total, scrollProcess, show, picker, lugOptions, sizeOptions, finishOptions, layout, processOptions, resultsLink, optionsReported, fieldUsage, }: CatalogFilterBarProps): import("react").JSX.Element;
|
|
59
|
+
export default function CatalogFilterBar({ filters, setProcess, setSize, setLugs, setFinish, setPriceMin, setPriceMax, setSort, clearAll, total, scrollProcess, show, picker, lugOptions, sizeOptions, finishOptions, priceBounds, layout, processOptions, resultsLink, optionsReported, fieldUsage, }: CatalogFilterBarProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as i,Fragment as he}from"react/jsx-runtime";import{useState as Q}from"react";import{withRMark as X}from"efficient-web-builder/render/components/RMark";import{FilterPill as L,OptButton as G,PanelTitle as R,PillButton as fe}from"./FilterPill.js";import{useCatalogFilterLabels as ge}from"./CatalogFilterLabels.js";import{CatalogVehicleNextRow as xe,CatalogVehicleFieldRow as be,CatalogVehicleRow as ee,CatalogVehicleSheet as ve}from"./CatalogVehiclePicker.js";import{facetFieldKey as le,keepForFilter as Ce,orderByAnswers as Ne}from"../../lib/content/field-usage.js";import{PLP_ONE_VALUE_MAX as re}from"../../lib/wheels/plp-filters.js";import{DEFAULT_FILTER_BAR_LAYOUT as ke}from"../../lib/sections/catalog-filter-layout.js";import{SORT_LABELS as H}from"../../lib/wheels/catalog-filters.js";import{FINISH_FAMILY_SWATCHES as ie}from"../../lib/wheels/finish-defaults.js";import{VEHICLE_FIELD_ORDER as ye}from"../../lib/wheels/vehicle-field-focus.js";import{CONTENT_CAP_GUTTER as ne}from"../../lib/sections/content-cap-gutter.js";import{CATALOG_TEXT_SIZE as _e}from"../../lib/sections/catalog-text-size.js";import{lugFilterLabel as ae}from"../../lib/wheels/lug-count.js";import Fe from"./PriceRange.js";import oe from"./SortSelect.js";const f=_e,te=Object.keys(H),z={size:le("diameters","alloy-wheel"),finish:le("finishes","alloy-wheel")};function se(t,o){return Ne(t,s=>Object.hasOwn(z,String(s.key))?z[String(s.key)]:void 0,o??[],"filterOrder")}function Te({processCount:t,sizeCount:o,lugCount:s,finishCount:d,optionsReported:g,fieldUsage:w}){const x=B=>!g||B>re,y=Ce(w??[]);return{process:t>re,size:y(z.size)&&x(o),lugs:x(s),finish:y(z.finish)&&x(d)}}function N(t,o){return t===o?null:o}function ce({href:t,label:o}){return e("a",{href:t,"data-results-link":!0,className:`inline-block self-start border-0 border-b border-line bg-transparent pb-2 font-mono ${f.labelLarge} uppercase tracking-[0.2em] text-fg transition-colors hover:text-fg-dim`,children:o})}function Ae({filters:t,setProcess:o,setSize:s,setLugs:d,setFinish:g,setPriceMin:w,setPriceMax:x,setSort:y,clearAll:B,total:b,scrollProcess:Y,show:u,picker:c,lugOptions:M=[],sizeOptions:I=[],finishOptions:q,layout:de=ke,processOptions:j=[],resultsLink:v,optionsReported:ue=!1,fieldUsage:P}){const[m,h]=Q(null),[K,V]=Q(null),p=ge(),{process:_,size:F,lugs:T,finish:O,priceMin:D,priceMax:U,sort:Z}=t,W=q?ie.filter(r=>q.includes(r.f)):ie,S=Te({processCount:j.length,sizeCount:I.length,lugCount:M.length,finishCount:W.length,optionsReported:ue,fieldUsage:P}),n={process:(u?.process??!0)&&S.process,size:(u?.size??!0)&&S.size,lugs:(u?.lugs??!0)&&S.lugs,finish:(u?.finish??!0)&&S.finish,price:u?.price??!0,vehicle:(u?.vehicle??!0)&&!!c,count:u?.count??!0,sort:u?.sort??!0},C={process:_?1:0,size:F?1:0,lugs:T?1:0,finish:O?1:0,price:D!=null||U!=null?1:0,vehicle:c?.appliedName?1:0},J=()=>{B(),c?.clear(),h(null),V(null)};if(de==="columns"){const r=l=>V(K===l?null:l),a=[];n.vehicle&&c&&a.push(i(k,{name:"vehicle",label:p.vehicle,children:[ye.map(l=>e(be,{field:l,picker:c,open:K===l,onOpenRequest:r,onClose:()=>V(null)},l)),e(xe,{picker:c,onOpenRequest:r})]},"vehicle"));const E=[];return n.process&&E.push(e(k,{name:"process",label:p.process,rowsAreOptions:!0,children:j.map(l=>e($,{active:_===l,onClick:()=>o(N(_,l)),children:X(l)},l))},"process")),n.size&&E.push(e(k,{name:"size",label:p.size,rowsAreOptions:!0,children:I.map(l=>i($,{active:F===l,onClick:()=>s(N(F,l)),children:[l,'"']},l))},"size")),n.lugs&&E.push(e(k,{name:"lugs",label:p.lugs,rowsAreOptions:!0,children:M.map(l=>e($,{active:T===l,onClick:()=>d(N(T,l)),children:ae(l)},l))},"lugs")),n.finish&&E.push(e(k,{name:"finish",label:p.finish,rowsAreOptions:!0,children:W.map(l=>e($,{active:O===l.f,onClick:()=>g(O===l.f?null:l.f),children:l.label},l.f))},"finish")),a.push(...se(E,P)),n.price&&a.push(i(k,{name:"price",label:p.price,children:[e(pe,{label:"Min",value:D,onChange:w,ariaLabel:"Minimum price per wheel"}),e(pe,{label:"Max",value:U,onChange:x,ariaLabel:"Maximum price per wheel"})]},"price")),i("div",{className:"@container",children:[i("div",{className:`border-t border-line ${ne} pb-12 pt-10 @max-[720px]:px-4 @max-[720px]:pb-10 @max-[720px]:pt-8`,children:[(n.count||n.sort)&&i("div",{className:"mb-10 flex flex-wrap items-center gap-x-6 gap-y-3 @max-[720px]:mb-8",children:[n.count&&i("span",{className:`font-mono ${f.labelLarge} uppercase tracking-[0.2em] text-fg-dim`,children:[b," ",b===1?"result":"results"]}),n.sort&&i("div",{className:"ml-auto flex items-center gap-5",children:[e("button",{type:"button",onClick:J,className:`font-mono ${f.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-fg`,children:"Clear All"}),e(oe,{look:"line",value:Z,keys:te,labels:H,onChange:y})]})]}),e("div",{"data-filter-columns":!0,className:`grid grid-cols-1 gap-x-[72px] gap-y-10 ${Ee[a.length]??""}`,children:a}),v&&e("div",{className:"mt-10 flex",children:e(ce,{href:v.href,label:v.label})})]}),n.vehicle&&c&&e(ee,{picker:c,total:b})]})}const A=[];return n.process&&A.push(i(L,{name:"process",label:Y?i(he,{children:[e("span",{className:"text-accent @min-[720px]:hidden",children:X(Y)}),e("span",{className:"hidden @min-[720px]:inline",children:p.process})]}):p.process,badge:C.process,open:m==="process",onToggle:()=>h(m==="process"?null:"process"),children:[e(R,{children:"Series · single-select"}),e("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":"Process series",children:j.map(r=>{const a=_===r;return e(G,{active:a,role:"radio",ariaChecked:a,onClick:()=>o(N(_,r)),children:X(r)},r)})})]},"process")),n.size&&A.push(i(L,{name:"size",label:p.size,badge:C.size,open:m==="size",onToggle:()=>h(m==="size"?null:"size"),children:[e(R,{children:"Diameter · single-select"}),e("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":"Wheel diameter",children:I.map(r=>{const a=F===r;return i(G,{active:a,role:"radio",ariaChecked:a,onClick:()=>s(N(F,r)),children:[r,'"']},r)})})]},"size")),n.lugs&&A.push(i(L,{name:"lugs",label:p.lugs,badge:C.lugs,open:m==="lugs",onToggle:()=>h(m==="lugs"?null:"lugs"),children:[e(R,{children:"Lug count · single-select"}),e("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":"Lug count",children:M.map(r=>{const a=T===r;return e(G,{active:a,role:"radio",ariaChecked:a,onClick:()=>d(N(T,r)),children:ae(r)},r)})})]},"lugs")),n.finish&&A.push(i(L,{name:"finish",label:p.finish,badge:C.finish,open:m==="finish",onToggle:()=>h(m==="finish"?null:"finish"),children:[e(R,{children:"Color family · single-select"}),e("div",{className:"flex flex-col gap-2",role:"radiogroup","aria-label":"Finish color family",children:W.map(r=>{const a=O===r.f;return i("button",{type:"button",role:"radio","aria-checked":a,onClick:()=>g(a?null:r.f),className:["flex items-center gap-3 border px-3 py-2 text-left transition-colors",a?"border-accent text-fg":"border-line hover:border-fg-dim"].join(" "),children:[e("span",{className:"block h-3.5 w-3.5 shrink-0 rounded-full border border-line",style:{background:r.hex}}),e("span",{className:`font-mono ${f.labelSmall} uppercase tracking-[0.18em]`,style:a?void 0:{color:"color-mix(in oklab, currentColor 80%, transparent)"},children:r.label}),a&&e("span",{"aria-hidden":!0,className:"ml-auto text-accent",children:"●"})]},r.f)})})]},"finish")),i("div",{className:"@container sticky top-[67px] z-40 border-b border-line backdrop-blur",style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[i("div",{className:`flex items-center gap-6 ${ne} py-4 @max-[720px]:flex-wrap @max-[720px]:items-stretch @max-[720px]:gap-2 @max-[720px]:px-4 @max-[720px]:py-3`,children:[i("div",{className:"flex flex-wrap items-center gap-1 @max-[720px]:basis-full @max-[720px]:gap-2",children:[n.count&&i("span",{className:`mr-3 border-r border-line pr-4 font-mono ${f.labelLarge} uppercase tracking-[0.2em] text-fg-dim @max-[720px]:hidden`,children:[b," ",b===1?"result":"results"]}),se(A,P),n.price&&i(L,{name:"price",label:p.price,badge:C.price,open:m==="price",onToggle:()=>h(m==="price"?null:"price"),children:[e(R,{children:"Price range (per wheel)"}),e(Fe,{min:D,max:U,onMin:w,onMax:x})]}),n.vehicle&&c&&e(fe,{label:p.vehicle,badge:C.vehicle,open:m==="vehicle",onToggle:()=>h(m==="vehicle"?null:"vehicle")})]}),v&&e("div",{className:`flex items-center ${n.sort?"":"ml-auto"}`,children:e(ce,{href:v.href,label:v.label})}),n.sort&&i("div",{className:"ml-auto flex items-center gap-3",children:[e("button",{type:"button",onClick:J,className:`font-mono ${f.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-accent`,children:"Clear All"}),e(oe,{look:"box",value:Z,keys:te,labels:H,onChange:y})]})]}),n.vehicle&&c&&m==="vehicle"&&e(ve,{picker:c,onClose:()=>h(null)}),n.vehicle&&c&&e(ee,{picker:c,total:b})]})}const Ee={1:"@min-[720px]:grid-cols-1",2:"@min-[720px]:grid-cols-2",3:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-3",4:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-4",5:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-3 @min-[1400px]:grid-cols-5",6:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-3 @min-[1400px]:grid-cols-6"},me=`flex w-full items-center justify-between gap-4 border-b py-3 text-left ${f.body}`;function k({name:t,label:o,rowsAreOptions:s,children:d}){return i("div",{"data-filter-column":t,className:"flex flex-col gap-6",children:[e("div",{className:`font-mono ${f.labelXs} uppercase tracking-[0.34em] text-fg-dim`,children:o}),e("div",{role:s?"radiogroup":void 0,"aria-label":s?o:void 0,children:d})]})}function $({active:t,onClick:o,children:s}){return e("button",{type:"button",role:"radio","aria-checked":t,onClick:o,className:[me,"transition-colors",t?"border-fg text-fg":"border-line text-fg-dim hover:text-fg"].join(" "),children:e("span",{children:s})})}function pe({label:t,value:o,onChange:s,ariaLabel:d}){return i("label",{className:`${me} border-line`,children:[e("span",{className:"text-fg-dim",children:t}),e("input",{type:"number",inputMode:"numeric","aria-label":d,placeholder:"Any",value:o??"",onChange:g=>s(g.target.value?Number(g.target.value):null),className:"w-24 bg-transparent text-right text-fg outline-none placeholder:text-fg-dim"})]})}export{Ae as default,Te as filterBarFacetsWithChoice};
|
|
1
|
+
"use client";import{jsx as e,jsxs as n,Fragment as he}from"react/jsx-runtime";import{useState as ee}from"react";import{withRMark as X}from"efficient-web-builder/render/components/RMark";import{FilterPill as R,OptButton as G,PanelTitle as L,PillButton as fe}from"./FilterPill.js";import{useCatalogFilterLabels as ge}from"./CatalogFilterLabels.js";import{CatalogVehicleNextRow as xe,CatalogVehicleFieldRow as be,CatalogVehicleRow as le,CatalogVehicleSheet as ve}from"./CatalogVehiclePicker.js";import{facetFieldKey as ie,keepForFilter as Ce,orderByAnswers as Ne}from"../../lib/content/field-usage.js";import{PLP_ONE_VALUE_MAX as re}from"../../lib/wheels/plp-filters.js";import{DEFAULT_FILTER_BAR_LAYOUT as ke}from"../../lib/sections/catalog-filter-layout.js";import{SORT_LABELS as H}from"../../lib/wheels/catalog-filters.js";import{FINISH_FAMILY_SWATCHES as ne}from"../../lib/wheels/finish-defaults.js";import{VEHICLE_FIELD_ORDER as ye}from"../../lib/wheels/vehicle-field-focus.js";import{CONTENT_CAP_GUTTER as ae}from"../../lib/sections/content-cap-gutter.js";import{CATALOG_TEXT_SIZE as _e}from"../../lib/sections/catalog-text-size.js";import{lugFilterLabel as oe}from"../../lib/wheels/lug-count.js";import se from"./PriceRange.js";import ce from"./SortSelect.js";const h=_e,te=Object.keys(H),z={size:ie("diameters","alloy-wheel"),finish:ie("finishes","alloy-wheel")};function pe(s,o){return Ne(s,d=>Object.hasOwn(z,String(d.key))?z[String(d.key)]:void 0,o??[],"filterOrder")}function Fe({processCount:s,sizeCount:o,lugCount:d,finishCount:f,optionsReported:g,fieldUsage:O}){const x=B=>!g||B>re,y=Ce(O??[]);return{process:s>re,size:y(z.size)&&x(o),lugs:x(d),finish:y(z.finish)&&x(f)}}function N(s,o){return s===o?null:o}function de({href:s,label:o}){return e("a",{href:s,"data-results-link":!0,className:`inline-block self-start border-0 border-b border-line bg-transparent pb-2 font-mono ${h.labelLarge} uppercase tracking-[0.2em] text-fg transition-colors hover:text-fg-dim`,children:o})}function Te({filters:s,setProcess:o,setSize:d,setLugs:f,setFinish:g,setPriceMin:O,setPriceMax:x,setSort:y,clearAll:B,total:b,scrollProcess:Y,show:m,picker:c,lugOptions:I=[],sizeOptions:j=[],finishOptions:q,priceBounds:K=null,layout:me=ke,processOptions:M=[],resultsLink:v,optionsReported:ue=!1,fieldUsage:P}){const[t,u]=ee(null),[Z,V]=ee(null),p=ge(),{process:_,size:F,lugs:T,finish:w,priceMin:D,priceMax:U,sort:J}=s,W=q?ne.filter(i=>q.includes(i.f)):ne,S=Fe({processCount:M.length,sizeCount:j.length,lugCount:I.length,finishCount:W.length,optionsReported:ue,fieldUsage:P}),r={process:(m?.process??!0)&&S.process,size:(m?.size??!0)&&S.size,lugs:(m?.lugs??!0)&&S.lugs,finish:(m?.finish??!0)&&S.finish,price:m?.price??!0,vehicle:(m?.vehicle??!0)&&!!c,count:m?.count??!0,sort:m?.sort??!0},C={process:_?1:0,size:F?1:0,lugs:T?1:0,finish:w?1:0,price:D!=null||U!=null?1:0,vehicle:c?.appliedName?1:0},Q=()=>{B(),c?.clear(),u(null),V(null)};if(me==="columns"){const i=l=>V(Z===l?null:l),a=[];r.vehicle&&c&&a.push(n(k,{name:"vehicle",label:p.vehicle,children:[ye.map(l=>e(be,{field:l,picker:c,open:Z===l,onOpenRequest:i,onClose:()=>V(null)},l)),e(xe,{picker:c,onOpenRequest:i})]},"vehicle"));const E=[];return r.process&&E.push(e(k,{name:"process",label:p.process,rowsAreOptions:!0,children:M.map(l=>e($,{active:_===l,onClick:()=>o(N(_,l)),children:X(l)},l))},"process")),r.size&&E.push(e(k,{name:"size",label:p.size,rowsAreOptions:!0,children:j.map(l=>n($,{active:F===l,onClick:()=>d(N(F,l)),children:[l,'"']},l))},"size")),r.lugs&&E.push(e(k,{name:"lugs",label:p.lugs,rowsAreOptions:!0,children:I.map(l=>e($,{active:T===l,onClick:()=>f(N(T,l)),children:oe(l)},l))},"lugs")),r.finish&&E.push(e(k,{name:"finish",label:p.finish,rowsAreOptions:!0,children:W.map(l=>e($,{active:w===l.f,onClick:()=>g(w===l.f?null:l.f),children:l.label},l.f))},"finish")),a.push(...pe(E,P)),r.price&&a.push(e(k,{name:"price",label:p.price,tight:!0,children:e(se,{bounds:K,boxes:"line",min:D,max:U,onMin:O,onMax:x})},"price")),n("div",{className:"@container",children:[n("div",{className:`border-t border-line ${ae} pb-12 pt-10 @max-[720px]:px-4 @max-[720px]:pb-10 @max-[720px]:pt-8`,children:[(r.count||r.sort)&&n("div",{className:"mb-10 flex flex-wrap items-center gap-x-6 gap-y-3 @max-[720px]:mb-8",children:[r.count&&n("span",{className:`font-mono ${h.labelLarge} uppercase tracking-[0.2em] text-fg-dim`,children:[b," ",b===1?"result":"results"]}),r.sort&&n("div",{className:"ml-auto flex items-center gap-5",children:[e("button",{type:"button",onClick:Q,className:`font-mono ${h.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-fg`,children:"Clear All"}),e(ce,{look:"line",value:J,keys:te,labels:H,onChange:y})]})]}),e("div",{"data-filter-columns":!0,className:`grid grid-cols-1 gap-x-[72px] gap-y-10 ${Ae[a.length]??""}`,children:a}),v&&e("div",{className:"mt-10 flex",children:e(de,{href:v.href,label:v.label})})]}),r.vehicle&&c&&e(le,{picker:c,total:b})]})}const A=[];return r.process&&A.push(n(R,{name:"process",label:Y?n(he,{children:[e("span",{className:"text-accent @min-[720px]:hidden",children:X(Y)}),e("span",{className:"hidden @min-[720px]:inline",children:p.process})]}):p.process,badge:C.process,open:t==="process",onToggle:()=>u(t==="process"?null:"process"),children:[e(L,{children:"Series · single-select"}),e("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":"Process series",children:M.map(i=>{const a=_===i;return e(G,{active:a,role:"radio",ariaChecked:a,onClick:()=>o(N(_,i)),children:X(i)},i)})})]},"process")),r.size&&A.push(n(R,{name:"size",label:p.size,badge:C.size,open:t==="size",onToggle:()=>u(t==="size"?null:"size"),children:[e(L,{children:"Diameter · single-select"}),e("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":"Wheel diameter",children:j.map(i=>{const a=F===i;return n(G,{active:a,role:"radio",ariaChecked:a,onClick:()=>d(N(F,i)),children:[i,'"']},i)})})]},"size")),r.lugs&&A.push(n(R,{name:"lugs",label:p.lugs,badge:C.lugs,open:t==="lugs",onToggle:()=>u(t==="lugs"?null:"lugs"),children:[e(L,{children:"Lug count · single-select"}),e("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":"Lug count",children:I.map(i=>{const a=T===i;return e(G,{active:a,role:"radio",ariaChecked:a,onClick:()=>f(N(T,i)),children:oe(i)},i)})})]},"lugs")),r.finish&&A.push(n(R,{name:"finish",label:p.finish,badge:C.finish,open:t==="finish",onToggle:()=>u(t==="finish"?null:"finish"),children:[e(L,{children:"Color family · single-select"}),e("div",{className:"flex flex-col gap-2",role:"radiogroup","aria-label":"Finish color family",children:W.map(i=>{const a=w===i.f;return n("button",{type:"button",role:"radio","aria-checked":a,onClick:()=>g(a?null:i.f),className:["flex items-center gap-3 border px-3 py-2 text-left transition-colors",a?"border-accent text-fg":"border-line hover:border-fg-dim"].join(" "),children:[e("span",{className:"block h-3.5 w-3.5 shrink-0 rounded-full border border-line",style:{background:i.hex}}),e("span",{className:`font-mono ${h.labelSmall} uppercase tracking-[0.18em]`,style:a?void 0:{color:"color-mix(in oklab, currentColor 80%, transparent)"},children:i.label}),a&&e("span",{"aria-hidden":!0,className:"ml-auto text-accent",children:"●"})]},i.f)})})]},"finish")),n("div",{className:"@container sticky top-[67px] z-40 border-b border-line backdrop-blur",style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[n("div",{className:`flex items-center gap-6 ${ae} py-4 @max-[720px]:flex-wrap @max-[720px]:items-stretch @max-[720px]:gap-2 @max-[720px]:px-4 @max-[720px]:py-3`,children:[n("div",{className:"relative flex flex-wrap items-center gap-1 @max-[720px]:basis-full @max-[720px]:gap-2",children:[r.count&&n("span",{className:`mr-3 border-r border-line pr-4 font-mono ${h.labelLarge} uppercase tracking-[0.2em] text-fg-dim @max-[720px]:hidden`,children:[b," ",b===1?"result":"results"]}),pe(A,P),r.price&&n(R,{name:"price",label:p.price,badge:C.price,open:t==="price",onToggle:()=>u(t==="price"?null:"price"),children:[e(L,{children:"Price range (per wheel)"}),e(se,{bounds:K,min:D,max:U,onMin:O,onMax:x})]}),r.vehicle&&c&&e(fe,{label:p.vehicle,badge:C.vehicle,open:t==="vehicle",onToggle:()=>u(t==="vehicle"?null:"vehicle")})]}),v&&e("div",{className:`flex items-center ${r.sort?"":"ml-auto"}`,children:e(de,{href:v.href,label:v.label})}),r.sort&&n("div",{className:"ml-auto flex items-center gap-3",children:[e("button",{type:"button",onClick:Q,className:`font-mono ${h.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-accent`,children:"Clear All"}),e(ce,{look:"box",value:J,keys:te,labels:H,onChange:y})]})]}),r.vehicle&&c&&t==="vehicle"&&e(ve,{picker:c,onClose:()=>u(null)}),r.vehicle&&c&&e(le,{picker:c,total:b})]})}const Ae={1:"@min-[720px]:grid-cols-1",2:"@min-[720px]:grid-cols-2",3:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-3",4:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-4",5:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-3 @min-[1400px]:grid-cols-5",6:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-3 @min-[1400px]:grid-cols-6"},Ee=`flex w-full items-center justify-between gap-4 border-b py-3 text-left ${h.body}`;function k({name:s,label:o,rowsAreOptions:d,tight:f,children:g}){return n("div",{"data-filter-column":s,className:`flex flex-col ${f?"gap-3":"gap-6"}`,children:[e("div",{className:`font-mono ${h.labelXs} uppercase tracking-[0.34em] text-fg-dim`,children:o}),e("div",{role:d?"radiogroup":void 0,"aria-label":d?o:void 0,children:g})]})}function $({active:s,onClick:o,children:d}){return e("button",{type:"button",role:"radio","aria-checked":s,onClick:o,className:[Ee,"transition-colors",s?"border-fg text-fg":"border-line text-fg-dim hover:text-fg"].join(" "),children:e("span",{children:d})})}export{Te as default,Fe as filterBarFacetsWithChoice};
|
|
@@ -29,6 +29,8 @@ interface CatalogFilterContextValue {
|
|
|
29
29
|
finishOptions: string[];
|
|
30
30
|
reportCategories: (id: string, names: readonly string[]) => void;
|
|
31
31
|
categoryOptions: string[];
|
|
32
|
+
reportPrices: (id: string, prices: readonly number[]) => void;
|
|
33
|
+
priceOptions: number[];
|
|
32
34
|
optionsReported: boolean;
|
|
33
35
|
scrollProcess: string | null;
|
|
34
36
|
vehicle: CatalogVehicleState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as $}from"react/jsx-runtime";import{createContext as re,useCallback as n,useContext as ne,useEffect as ie,useMemo as ce,useRef as J,useState as u}from"react";import{EMPTY_FILTERS as P}from"../../lib/wheels/catalog-filters.js";import{compareFinishFamily as le}from"../../lib/wheels/finish-defaults.js";import{ShopperScopeProvider as pe}from"./ShopperScope.js";const K={fit:null,name:"",resolving:!1,unresolved:!1};function ue(r,o){return r.fit===o.fit&&r.name===o.name&&r.resolving===o.resolving&&r.unresolved===o.unresolved}const s=()=>{},Q=re({filters:P,setProcess:s,setSize:s,setLugs:s,setFinish:s,setPriceMin:s,setPriceMax:s,setSort:s,clearAll:s,reportCount:s,total:0,reportLugs:s,lugOptions:[],reportSizes:s,sizeOptions:[],reportFinishes:s,finishOptions:[],reportCategories:s,categoryOptions:[],reportPrices:s,priceOptions:[],optionsReported:!1,scrollProcess:null,vehicle:K,publishVehicle:s}),W="data-catalog-collection",F=(r,o)=>r-o,ae=()=>0;function X(r,o){return r.length===o.length&&r.every((a,p)=>a===o[p])}function h(r){const o=J(new Map),[a,p]=u([]),i=n((f,d)=>{const g=o.current.get(f);if(g&&X(g,d))return;o.current.set(f,d);const m=new Set;for(const c of o.current.values())for(const R of c)m.add(R);const v=[...m].sort(r);p(c=>X(c,v)?c:v)},[r]);return[a,i]}function he({children:r,address:o=null,editing:a=!1}){const[p,i]=u(P),f=n(t=>i(e=>({...e,process:t})),[]),d=n(t=>i(e=>({...e,size:t})),[]),g=n(t=>i(e=>({...e,lugs:t})),[]),m=n(t=>i(e=>({...e,finish:t})),[]),v=n(t=>i(e=>({...e,priceMin:t})),[]),c=n(t=>i(e=>({...e,priceMax:t})),[]),R=n(t=>i(e=>({...e,sort:t})),[]),L=n(()=>i(t=>({...P,sort:t.sort})),[]),[x,Z]=u(K),w=n(t=>{Z(e=>ue(e,t)?e:t)},[]),S=J(new Map),[z,ee]=u(0),M=n((t,e)=>{if(S.current.get(t)===e)return;S.current.set(t,e);let l=0;for(const O of S.current.values())l+=O;ee(l)},[]),[T,_]=h(F),[A,G]=h(F),[I,y]=h(le),[N,V]=h(ae),[U,Y]=h(F),[b,C]=u(!1),j=n((t,e)=>{C(!0),_(t,e)},[_]),k=n((t,e)=>{C(!0),G(t,e)},[G]),q=n((t,e)=>{C(!0),y(t,e)},[y]),[D,te]=u(null);ie(()=>{let e=0;const E=()=>{e=0;let O=null;const se=document.querySelectorAll(`[${W}]`);for(const B of se){const H=B.getBoundingClientRect();if(H.top<=140&&H.bottom>140){O=B.getAttribute(W)??null;break}}te(O)},l=()=>{e||(e=requestAnimationFrame(E))};return E(),window.addEventListener("scroll",l,{passive:!0}),window.addEventListener("resize",l),()=>{window.removeEventListener("scroll",l),window.removeEventListener("resize",l),e&&cancelAnimationFrame(e)}},[]);const oe=ce(()=>({filters:p,setProcess:f,setSize:d,setLugs:g,setFinish:m,setPriceMin:v,setPriceMax:c,setSort:R,clearAll:L,reportCount:M,total:z,reportLugs:j,lugOptions:T,reportSizes:k,sizeOptions:A,reportFinishes:q,finishOptions:I,reportCategories:V,categoryOptions:N,reportPrices:Y,priceOptions:U,optionsReported:b,scrollProcess:D,vehicle:x,publishVehicle:w}),[p,f,d,g,m,v,c,R,L,M,z,j,T,k,A,q,I,V,N,Y,U,b,D,x,w]);return $(Q.Provider,{value:oe,children:$(pe,{address:o,editing:a,children:r})})}function Re(){return ne(Q)}export{W as COLLECTION_ATTR,he as CatalogFilterProvider,K as NO_VEHICLE,Re as useCatalogFilter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as i,jsxs as
|
|
1
|
+
"use client";import{jsx as i,jsxs as h}from"react/jsx-runtime";import{useEffect as v,useId as k,useRef as f,useState as y}from"react";import{CATALOG_TEXT_SIZE as d}from"../../lib/sections/catalog-text-size.js";import{useIsoLayoutEffect as _}from"./ShopperScope.js";function C({labelSize:n=d.labelLarge,label:c,badge:o,open:e,onToggle:r,controls:m,buttonRef:p}){const a=o>0;return h("button",{ref:p,type:"button","aria-haspopup":"dialog","aria-expanded":e,"aria-controls":m,onClick:r,className:[`inline-flex items-center gap-2 whitespace-nowrap border px-4 py-3 font-mono ${n} uppercase tracking-[0.2em] transition-colors`,a?"border-accent text-accent":"border-line hover:border-fg-dim"].join(" "),style:a?void 0:{color:"color-mix(in oklab, currentColor 80%, transparent)"},children:[c,o>0&&i("span",{className:`px-2 ${d.badge} tracking-[0.1em] text-bg`,style:{background:"var(--accent)"},children:o}),i("span",{className:`${d.badge} opacity-65 transition-transform ${e?"rotate-180":""}`,children:"▾"})]})}function R({labelSize:n,label:c,badge:o,open:e,onToggle:r,children:m}){const p=k(),a=f(null),x=f(null),b=f(null),[E,g]=y(!1);return _(()=>{if(!e){g(!1);return}const t=b.current,s=a.current,l=t?.ownerDocument.defaultView;if(!t||!s||!l||l.getComputedStyle(s).position==="static")return;const u=t.ownerDocument.documentElement.clientWidth,w=t.getBoundingClientRect();w.width>0&&w.right>u-L&&g(!0)},[e]),v(()=>{if(!e)return;const t=a.current?.ownerDocument??document,s=u=>{u.key==="Escape"&&(r(),x.current?.focus())},l=u=>{a.current?.contains(u.target)||r()};return t.addEventListener("keydown",s),t.addEventListener("pointerdown",l),()=>{t.removeEventListener("keydown",s),t.removeEventListener("pointerdown",l)}},[e,r]),h("div",{ref:a,className:e?"relative @max-[720px]:static":"relative",children:[i(C,{labelSize:n,label:c,badge:o,open:e,onToggle:r,controls:e?p:void 0,buttonRef:x}),e&&i("div",{ref:b,id:p,className:`absolute ${E?"right-0":"left-0"} top-[calc(100%+6px)] z-[60] min-w-[280px] max-w-[calc(100vw-32px)] border border-line bg-surface p-5 shadow-[0_24px_60px_rgba(0,0,0,0.4)] @max-[720px]:inset-x-0 @max-[720px]:top-auto @max-[720px]:mt-2 @max-[720px]:min-w-0`,onClick:t=>t.stopPropagation(),children:m})]})}const L=16;function S({children:n}){return i("div",{className:`mb-3 font-mono ${d.labelSmall} uppercase tracking-[0.32em] text-fg-dim`,children:n})}function I({active:n,onClick:c,children:o,role:e,ariaChecked:r}){return i("button",{type:"button",role:e,"aria-checked":e==="radio"?r:void 0,onClick:c,className:[`border px-3 py-2 font-mono ${d.labelLarge} uppercase tracking-[0.18em] transition-colors`,n?"border-accent bg-accent text-bg":"border-line hover:border-fg-dim"].join(" "),style:n?void 0:{color:"color-mix(in oklab, currentColor 75%, transparent)"},children:o})}export{R as FilterPill,I as OptButton,S as PanelTitle,C as PillButton};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
export default function PriceRange({ min, max, onMin, onMax, }: {
|
|
1
|
+
export default function PriceRange({ min, max, onMin, onMax, bounds, boxes, }: {
|
|
2
2
|
min: number | null | undefined;
|
|
3
3
|
max: number | null | undefined;
|
|
4
4
|
onMin: (value: number | null) => void;
|
|
5
5
|
onMax: (value: number | null) => void;
|
|
6
|
+
bounds?: {
|
|
7
|
+
min: number;
|
|
8
|
+
max: number;
|
|
9
|
+
} | null;
|
|
10
|
+
boxes?: "framed" | "line";
|
|
6
11
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as n,jsxs as g}from"react/jsx-runtime";import{useState as C}from"react";import{useCurrency as T}from"../CurrencyContext.js";import{CATALOG_TEXT_SIZE as v}from"../../lib/sections/catalog-text-size.js";function S({min:l,max:a,onMin:e,onMax:u,bounds:i=null,boxes:p="framed"}){const f=T({optional:!0}),s=f?.currencies.find(m=>m.code===f.currency)?.symbol??"",r=p==="line"?"flex w-full items-center gap-1 border-b border-line py-3 pr-3":"flex w-full items-center gap-1 bg-bg border border-line px-3 py-3",o=`w-full min-w-0 bg-transparent font-mono ${v.labelXl} text-fg outline-none`;return g("div",{children:[i?n($,{min:l,max:a,bounds:i,onMin:e,onMax:u}):p==="line"&&n("div",{"aria-hidden":"true",className:"h-4"}),g("div",{className:`${i||p==="line"?"mt-3 ":""}flex items-center gap-2`,children:[g("label",{className:r,children:[s&&n("span",{"aria-hidden":"true",className:`font-mono ${v.labelXl} text-fg-dim`,children:s}),n("input",{type:"number",placeholder:i?String(i.min):"Min","aria-label":"Minimum price value",value:l??"",onChange:m=>e(M(m.target.value)),onBlur:()=>{l!=null&&a!=null&&l>a&&e(a)},className:o})]}),n("span",{className:`font-mono ${v.labelSmall} text-fg-dim`,children:"—"}),g("label",{className:r,children:[s&&n("span",{"aria-hidden":"true",className:`font-mono ${v.labelXl} text-fg-dim`,children:s}),n("input",{type:"number",placeholder:i?String(i.max):"Max","aria-label":"Maximum price value",value:a??"",onChange:m=>u(M(m.target.value)),onBlur:()=>{l!=null&&a!=null&&a<l&&u(l)},className:o})]})]})]})}function M(l){const a=Number(l);return l!==""&&Number.isFinite(a)&&a>=0?a:null}const c=5;function $({min:l,max:a,bounds:e,onMin:u,onMax:i}){const p=t=>Math.min(e.max,Math.max(e.min,t)),f=e.min+Math.floor((e.max-e.min)/c)*c,s=t=>Math.min(f,e.min+Math.round((p(t)-e.min)/c)*c),r=s(l??e.min),o=Math.max(r,s(a??e.max)),[m,d]=C(null),N=e.max-e.min,x=t=>N>0?(t-e.min)/N:0,w=t=>`calc(8px + (100% - 16px) * ${x(t)})`,y=m?m==="min":x(r)>.5,b={"--price-thumb":"var(--accent)","--price-thumb-ring":"var(--bg)"};return g("div",{className:"relative h-4",children:[n("div",{className:"absolute inset-x-0 top-1/2 h-1 -translate-y-1/2",style:{background:"var(--site-line)"}}),n("div",{className:"absolute top-1/2 h-1 -translate-y-1/2",style:{left:w(r),width:`calc((100% - 16px) * ${x(o)-x(r)})`,background:"var(--accent)"}}),n("input",{type:"range","aria-label":"Minimum price",min:e.min,max:e.max,step:c,value:r,onChange:t=>{const h=Math.min(Number(t.target.value),o);d("min"),u(h<e.min+c?null:h)},className:"price-range-thumbs absolute inset-0 h-4 w-full",style:{...b,zIndex:y?2:1}}),n("input",{type:"range","aria-label":"Maximum price",min:e.min,max:e.max,step:c,value:o,onChange:t=>{const h=Math.max(Number(t.target.value),r);d("max"),i(h>e.max-c?null:h)},className:"price-range-thumbs absolute inset-0 h-4 w-full",style:{...b,zIndex:y?1:2}})]})}export{S as default};
|