efficient-storefront-blocks 0.122.0 → 0.123.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 +32 -0
- package/dist/chunks/{EditorPreviewCheckout-HGXPPOPY.js → EditorPreviewCheckout-GKVO7FIF.js} +1 -1
- package/dist/chunks/SiteEditorProvider-INLF7RK2.js +1 -0
- package/dist/chunks/chunk-3UESM7IL.js +1 -0
- package/dist/chunks/{chunk-7OV26TMN.js → chunk-A4GCH4L7.js} +1 -1
- package/dist/chunks/{chunk-PNXEY4EH.js → chunk-ABH43N7O.js} +1 -1
- package/dist/chunks/chunk-HG7XPHVS.js +34 -0
- package/dist/chunks/chunk-HG7XPHVS.js.LEGAL.txt +31 -0
- package/dist/chunks/chunk-JRGIFGZA.js +1 -0
- package/dist/chunks/chunk-MFXGST7A.js +342 -0
- package/dist/chunks/{fitment-data-QP4XEFXC.js → fitment-data-6YOZL3W4.js} +1 -1
- package/dist/chunks/section-css-style-TIXCQNGX.js +1 -0
- package/dist/editor/components/CategorySource.d.ts +5 -2
- package/dist/editor/components/CategorySource.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/AlloyWheelsListing/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/index.d.ts +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +2 -0
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/index.js +33 -65
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/BoxHeaderBar.js +1 -1
- package/dist/render/components/FinishSwatches.js +2 -2
- package/dist/render/components/FooterLogo.js +1 -1
- package/dist/render/components/FooterMenu.js +1 -1
- package/dist/render/components/FooterSection.js +1 -1
- package/dist/render/components/FooterSocial.js +1 -1
- package/dist/render/components/GridCardTemplate.js +1 -1
- package/dist/render/components/HeaderNavItem.js +1 -1
- package/dist/render/components/LegalLine.js +1 -1
- package/dist/render/components/MenuLinkBlock.js +1 -1
- package/dist/render/components/ProductGridSection.js +1 -1
- package/dist/render/components/SectionGroupBody.js +1 -1
- package/dist/render/components/card-pieces/CardBuyButton.js +1 -1
- package/dist/render/components/card-pieces/CardEyebrow.js +1 -1
- package/dist/render/components/card-pieces/CardName.js +1 -1
- package/dist/render/components/card-pieces/CardPicture.js +1 -1
- package/dist/render/components/card-pieces/CardPrice.js +1 -1
- package/dist/render/components/card-pieces/CardProductBadge.js +1 -1
- package/dist/render/components/card-pieces/CardProductPicture.js +1 -1
- package/dist/render/components/card-pieces/CardSizes.js +1 -1
- package/dist/render/components/card-pieces/CardSpecs.js +1 -1
- package/dist/render/components/card-pieces/CardSurfaceFrame.js +1 -1
- package/dist/render/components/card-pieces/card-row.js +1 -1
- package/dist/render/components/wheels-plp/AlloyWheelsListing.d.ts +3 -1
- package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
- package/dist/render/lib/block-parts.d.ts +5 -0
- package/dist/render/lib/block-parts.js +1 -0
- package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/meta.d.ts +3 -3
- package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/FilterBlock/meta.d.ts +4 -4
- package/dist/render/lib/document/blocks/commerce/FilterChipsBlock/meta.d.ts +1 -1
- package/dist/render/lib/document/blocks/service/ContactRouting/meta.d.ts +3 -3
- package/dist/words.d.ts +4 -0
- package/dist/words.js +2 -2
- package/package.json +3 -3
- package/dist/chunks/SiteEditorProvider-R3ZNQPAI.js +0 -1
- package/dist/chunks/chunk-NYZMVYQ4.js +0 -1
- package/dist/chunks/chunk-TAV4GVJC.js +0 -342
- /package/dist/chunks/{chunk-TAV4GVJC.js.LEGAL.txt → chunk-MFXGST7A.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-IJC4EEZC.js → chunk-PGKDGGEE.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as x}from"react/jsx-runtime";import{parseOption as _}from"efficient-web-builder/format/lib/parse-option";import{useEffect as v,useState as E}from"react";import{useRootIsDark as y}from"efficient-shell/theme";import{usePathname as T}from"next/navigation";import{useHeaderBar as D}from"./useHeaderBar.js";import{headerSolidBackground as I,isProductPage as P,resolveHeaderHeightPx as R}from"../lib/content/header-bar.js";import{headerThemeWrap as S}from"../lib/content/header-theme.js";import{HEADER_SET_HEIGHT_VAR as A}from"efficient-web-builder/render/lib/document/header-clearance";import{HEADER_INK_OVERRIDE_ATTR as B,resolveHeaderInkMode as j}from"efficient-web-builder/render/lib/document/header-ink";import{centredCap as w,SITE_WIDTH_CAP as M}from"efficient-web-builder/format/lib/content/page-width";import{HideTaker as O}from"efficient-web-builder/render/components/ViewHideRoot";import{blockParts as C}from"../lib/block-parts.js";const N=C("SiteHeader"),W=["none","always","on_scroll_up"],K=r=>_(W,"always",r);function V({sticky:r,topTextColor:c,heightPx:m,theme:u,bandCapped:f=!1,children:p}){const t=K(r),a=R(m),{headerRef:o,scrolled:n,navHidden:h}=D({stickyMode:t,heightPx:a}),s=j(c),g=s==="auto"?null:{[B]:s},e=S(u),d=P(T()),[b,H]=E(null);v(()=>H(o.current?.ownerDocument??null),[o]);const k=!y({doc:b,whenUnset:!0}),l=n||d,i=I(k,d);return x(O,{as:"header",ref:o,"data-scrolled":n||void 0,"data-box-header":"",...g,className:["sf-site-header",...e?[e.className]:[],"flex flex-col justify-center",t==="none"?"absolute":"fixed","inset-x-0 top-0 z-50",l?"border-b border-line backdrop-blur-md":"border-b border-transparent","transition-[background,border-color,transform] duration-300 ease-out"].join(" "),style:{...e?e.style:null,minHeight:`var(${A}, ${a}px)`,...f?w(M):null,...h?{transform:"translateY(-100%)"}:null,...l?{background:i,color:"var(--fg)","--sf-header-ground":i}:{color:"var(--sf-header-overlay-fg)","--sf-header-ground":"var(--sf-header-overlay-ground)"}},...N("header"),children:p})}export{V as default,K as resolveStickyMode};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as
|
|
2
|
-
${e.src}`)})}),
|
|
1
|
+
"use client";import{jsx as t,jsxs as h}from"react/jsx-runtime";import{blockParts as x}from"../lib/block-parts.js";const c=x("ProductCard");function b({finishes:u,availability:f,selectedIdx:a,hoverIdx:s,activeFinish:o,onSelect:g,onHover:r,showLabel:m=!0,className:p}){return h("div",{className:["mt-4",p].filter(Boolean).join(" "),children:[t("div",{className:"flex flex-wrap items-center gap-2",onMouseLeave:()=>r(null),onClick:e=>e.preventDefault(),...c("swatches"),children:u.map((e,n)=>{if(!f[n])return null;const i=n===a,d=s===n&&s!==a;return t("button",{type:"button",title:e.name,"aria-label":e.name,"aria-pressed":i,onMouseEnter:()=>r(n),onFocus:()=>r(n),onBlur:()=>r(null),onClick:l=>{l.preventDefault(),l.stopPropagation(),g(n)},className:["h-4 w-4 shrink-0 rounded-full transition-all",i?"ring-2 ring-accent ring-offset-2 ring-offset-surface":d?"ring-1 ring-fg ring-offset-2 ring-offset-surface":"ring-1 ring-fg/30 ring-offset-1 ring-offset-surface"].join(" "),style:{background:e.color,border:"1px solid var(--swatch-border)"},...c("swatch")},`${e.name}
|
|
2
|
+
${e.src}`)})}),m&&o&&t("div",{className:"mt-2 truncate font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:o.name})]})}export{b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as w}from"react/jsx-runtime";import A from"next/link";import I,{FOOTER_LOGO_PX as j,WORDMARK_FIT_FLOOR_PX as v}from"efficient-web-builder/render/components/Logo";import{useSiteLogo as F}from"efficient-web-builder/render/components/SiteLogoContext";import{renderGold as G}from"efficient-web-builder/render/components/goldPhrases";import{BLOCK_ALIGN_BOX_WORD as o,BLOCK_ALIGN_TEXT as f}from"efficient-web-builder/format/lib/content/block-align";import{BOX_ALIGN_CLASS as t}from"efficient-web-builder/format/lib/content/box-layout";import{say as P}from"efficient-web-builder/format/lib/editor-words";import{HideTaker as S}from"efficient-web-builder/render/components/ViewHideRoot";import{blockParts as T}from"../lib/block-parts.js";const i=T("FooterLogo"),d={left:`${t[o.left]} text-left`,center:`${t[o.center]} ${f.center}`,right:`${t[o.right]} ${f.right}`};function $({tagline:l,widthPct:x=100,align:n="left",reverse:p=!0,color:g=null,padTop:a=0,padRight:s=0,padBottom:m=0,padLeft:c=0,editing:L=!1}){const{src:O,reversedSrc:_,inkIsDark:h,wordmark:k,siteName:r}=F(),u=Math.round(j*(x/100)),N={...a?{paddingTop:a}:{},...s?{paddingRight:s}:{},...m?{paddingBottom:m}:{},...c?{paddingLeft:c}:{}};return w(S,{as:"div",className:["flex min-w-0 flex-col",Object.hasOwn(d,n)?d[n]:"","[container-type:inline-size]"].filter(Boolean).join(" "),style:N,...i("logo-block"),children:[e(A,{href:"/","aria-label":r?`${r} home`:"Home",className:"inline-flex max-w-full overflow-x-clip",...i("logo-link"),children:e(I,{variant:"footer",sizePx:u,src:O,reverse:p,color:g,reversedSrc:_,inkIsDark:h,wordmark:k,siteName:r,fitWordmarkToContainer:!0,fitFloorPx:v})}),l?e("p",{className:"mt-4 max-w-[280px] text-[13px] leading-[1.5] text-fg-dim",...i("tagline"),children:G(l)}):L?e("p",{className:"mt-4 max-w-[280px] text-[13px] italic leading-[1.5] text-fg-dim/60",children:P("Add a short brand tagline →")}):null]})}export{$ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as D,jsxs as d}from"react/jsx-runtime";import{createContext as he,useCallback as fe,useContext as we,useEffect as K,useRef as H,useState as k}from"react";import{createPortal as ge}from"react-dom";import{CloseIcon as xe,MenuIcon as Ne}from"efficient-shell/icons/efficient-glyphs";import be from"./PopupFrame.js";import{POPUP_LOOK_DEFAULTS as X}from"efficient-web-builder/format/lib/popup/look";import{REPEAT_ATTRIBUTE as Ee,REPEAT_INDEX_ATTRIBUTE as Ce}from"efficient-easel/draw";import{MenuPlaceContext as Te}from"./MenuLinkBlock.js";import{CardRowContext as ye,CardTemplateRows as _e}from"efficient-web-builder/render/components/CardRowContext";import{renderChrome as F}from"efficient-web-builder/render/components/goldPhrases";import{UTIL_WORDS as Z}from"./HeaderTools.js";import{usePhoneMenuTools as ve}from"efficient-web-builder/render/components/PhoneMenuTools";import{useSearch as Me}from"./SearchContext.js";import{useModalDismiss as Le}from"./useModalDismiss.js";import{PhoneSheet as Oe}from"./PhoneSheet.js";import{usePreviewMenus as Re}from"./PreviewMenusContext.js";import{FOOTER_MENU_PLACEHOLDER_COUNT as Ae,FOOTER_MENU_PLACEHOLDER_HEADING as Se,FOOTER_MENU_PLACEHOLDER_HINT as ke}from"../lib/content/menu-placeholder.js";import{say as O}from"efficient-web-builder/format/lib/editor-words";import{isMenuOrphaned as Pe}from"../lib/menu-source.js";import{legacyBlockAlignOf as Ie}from"efficient-web-builder/format/lib/content/block-align";import{MENU_PANEL_TINT_OPACITY_DEFAULT as Ue,MENU_PANEL_WIDTH_DEFAULT as De,MENU_STYLE_BUTTON as J,MENU_STYLE_TABS as He,menuLinkInRange as Fe,menuShowClasses as ee,resolveMenuLinkRange as $e}from"../lib/content/menu-row.js";import{MENU_ENTRY_SIZE_CLASS as ne}from"../lib/content/menu-entry-type.js";import{TAB_CELLS as te,currentLinkIndex as Be,marksCurrentLink as re}from"../lib/content/tab-strip.js";import{useAddressQuery as Qe}from"./wheels-plp/usePlpFiltersInUrl.js";import{useCurrentPagePath as We}from"efficient-web-builder/render/lib/site-runtime";import{HideTaker as _}from"efficient-web-builder/render/components/ViewHideRoot";const Ye=`flex list-none flex-col gap-3 ${ne}`,z="mb-4 font-mono text-[13px] uppercase tracking-[0.2em] text-fg-dim",$="text-[12px] italic text-fg-dim/70",le=(n,t)=>n&&t>0?"border-t border-line pt-3":"",je=n=>({label:n.label??"",url:n.href??"",served:n}),ae=n=>n.served?{...n.served,label:n.label??"",href:n.url??""}:{label:n.label??"",href:n.url??""},qe=Array.from({length:Ae},()=>({label:"",href:""}));function P({owner:n,items:t,place:i,wrap:p,markCurrent:b=!1}){const E=t?t.map(ae):qe,s=We(),f=we(se),T=t&&b?Be(t.map(g=>g.url??""),s,f):-1,w=T<0?null:{index:T,href:t[T].url??""};return e(Te.Provider,{value:t?w?{...i,current:w}:i:{...i,placeholder:!0},children:e(_e,{ownerId:n.id,ownerType:n.type,Template:n.template,rows:E,items:t??void 0,fallback:null,wrapCopy:p,children:g=>g})})}const B=n=>(n.template?.blockCount??0)>0,ze="Nothing to show yet: this menu's entries come from its Menu content.",oe="This menu draws no links: its card template is empty. Undo the delete, or delete this Menu and add it again.";function ie({owner:n,items:t,label:i,editing:p,linkAlign:b,linkRange:E,markCurrent:s,menuStyle:f,menuStylePhone:T,panelLook:w}){const g=Ie(b),v=$e(E),R=!!v&&t!==null&&v.to!==void 0&&v.to<t.length,[u,A]=k(!1),M=H(null),x=ve(),{open:Q}=Me(),S=i||"Menu",m=fe(()=>A(!1),[]),r=f===J||T===J,c=ee(f,T),[I,W]=k("sheet"),y=H(null),h=H(null),[N,U]=k(void 0),[L,ce]=k(null),G=()=>{if(!u&&r){const o=M.current?.ownerDocument.defaultView;W(o?.matchMedia("(min-width: 720px)").matches?"side":"sheet");const l=y.current?.querySelector("span");if(l&&o){const a=o.getComputedStyle(l);U({fontFamily:a.fontFamily,fontSize:a.fontSize,letterSpacing:a.letterSpacing,textTransform:a.textTransform});const C=(y.current?.querySelector("svg")??y.current)?.getBoundingClientRect();ce(C?{left:C.left,top:C.top,height:C.height}:null)}}A(o=>!o)};K(()=>{if(!u||!r)return;const l=M.current?.ownerDocument.defaultView?.matchMedia("(min-width: 720px)");if(!l)return;const a=()=>A(!1);return l.addEventListener("change",a),()=>l.removeEventListener("change",a)},[u,r]);const Y=H(null);Le({active:u&&!(u&&r&&I==="side"),onDismiss:m,scopeRef:M,focusRef:Y,trapRef:Y});const ue=e(P,{owner:n,items:t,place:{place:"row"},markCurrent:s,wrap:(o,l)=>{const a=t!==null&&v&&!Fe(v,l.index+1)?{"data-menu-out":""}:null;return e("li",{className:"",...a,children:o})}}),j=(o,l,a)=>p?{[Ee]:`${o}:${a<0?"panel":"dropdown"}`,[Ce]:`${a+1}.${l.index}`}:null,me=e(P,{owner:n,items:t,place:{place:"panel",onNavigate:m},markCurrent:s,wrap:(o,l)=>d(D,{children:[e("li",{className:"flex min-h-14 items-center border-b border-line",...j(n.id,l,-1),children:o}),t===null?null:(l.item?.dropdown_items??[]).map((a,C)=>e(ye.Provider,{value:{...l,row:ae(a),item:a},children:e("li",{className:"flex min-h-12 items-center border-b border-line pl-5 text-[14px]",...j(n.id,l,C),children:o})},C))]})}),de=x&&(x.search||x.region||x.account||x.theme)?x:null;if(!p&&t!==null&&!B(n)&&!de)return null;const V=e(Oe,{role:"dialog",panelRef:Y,name:S,entries:me,tools:x,withAccount:!r,editing:p,onClose:m,onSearch:Q,phoneOnly:!r,marker:r?"sheet":void 0,listStyle:r&&L?{paddingLeft:L.left,paddingRight:L.left}:void 0});let q=null;if(r){const o=M.current?.ownerDocument,l={...X,placement:"left",height:"full",closeButton:"none",width:typeof w?.width=="number"?w.width:De,tintColor:typeof w?.tintColor=="string"?w.tintColor:X.tintColor,tintOpacity:typeof w?.tintOpacity=="number"?w.tintOpacity:Ue},a=e(be,{look:l,drawer:{closeRef:h},open:!0,onClose:m,label:S,children:d("div",{"data-menu-panel":"side",className:"flex h-full flex-col overflow-y-auto text-fg",children:[e("div",{className:"flex min-h-[var(--sf-header-h,88px)] shrink-0 items-center px-8",style:L?{paddingLeft:L.left}:void 0,children:d("button",{ref:h,type:"button",onClick:m,className:"inline-flex h-11 items-center gap-2",style:N,children:[e(xe,{size:20,"aria-hidden":"true"}),e("span",{className:"whitespace-nowrap",children:Z.close})]})}),e("ul",{className:"m-0 flex list-none flex-col px-8 pb-8",style:L?{paddingLeft:L.left}:void 0,children:e(P,{owner:n,items:t,place:{place:"panel",onNavigate:m},markCurrent:s,wrap:(C,pe)=>e("li",{className:"flex min-h-12 items-center",...j(n.id,pe,-1),children:C})})})]})});q=d(D,{children:[d("button",{ref:y,type:"button",className:`mono-eyebrow-ctl ${c.button} h-11 min-w-11 items-center gap-2 opacity-80 transition-opacity hover:opacity-100 max-view-tablet:-mx-3 max-view-tablet:min-w-0 max-view-tablet:px-3`,"aria-expanded":u,"aria-label":u?"Close the menu":"Open the menu",onClick:G,children:[e(Ne,{size:20,"aria-hidden":"true"}),e("span",{className:"whitespace-nowrap max-view-tablet:hidden",children:Z.menu})]}),u&&o?ge(I==="side"?a:V,o.body):null]})}else c.drawsButton&&(q=d(D,{children:[e("button",{type:"button",className:`${c.buttonHead} h-11 w-11 items-center justify-center${c.buttonTail}`,"aria-expanded":u,"aria-label":u?"Close the menu":"Open the menu",onClick:G,children:e("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",children:u?e("path",{d:"M6 6l12 12M18 6L6 18"}):e("path",{d:"M4 7h16M4 12h16M4 17h16"})})}),u?V:null]}));return d(_,{as:"nav",ref:M,"aria-label":S,"data-menu-row":"",...r?{"data-menu-show":"button"}:null,...!r&&g?{"data-menu-align":g}:null,...!r&&R?{"data-menu-part":"lead"}:null,className:"min-w-0",children:[e("ul",{className:`m-0 ${c.listHead} list-none flex-wrap items-center gap-x-8 gap-y-2 p-0 font-mono ${ne} uppercase tracking-[0.18em]${c.listTail}`,children:ue}),q]})}function Ge({owner:n,items:t,label:i,editing:p,markCurrent:b,strip:E=""}){return!p&&(t===null||t.length===0||!B(n))?null:e(_,{as:"nav","aria-label":i||"Menu","data-menu-tabs":"",className:E?`min-w-0 ${E}`:"min-w-0",children:e("ul",{className:te.list,children:e(P,{owner:n,items:t,place:{place:"tab"},markCurrent:b,wrap:(s,f)=>e("li",{className:te.item(f.index===0,p),children:s})})})})}const se=he("");function Ve(n){const t=!n.editing&&re(n.layout,n.currentPage),i=Qe(n.pageQuery??"",t);return e(se.Provider,{value:i,children:e(Ke,{...n})})}function Ke({owner:n,menu:t,served:i,heading:p,accordionMobile:b=!1,showDividers:E=!1,editing:s=!1,layout:f="column",linkAlign:T,linkRange:w,menuStyle:g,currentPage:v,menuStylePhone:R,menuPanelWidth:u,menuPanelTintColor:A,menuPanelTintOpacity:M}){const x=re(f,v),{live:Q,ready:S}=Re(),m=!i&&Pe({id:t?.id,handle:t?.handle,editing:s,ready:S,live:Q}),r=i?i.map(je):m?[]:t?.items??[],c=p||(i?"":t?.name)||"",[I,W]=k(!1);if(K(()=>{if(!b)return;const h=window.matchMedia("(max-width: 800px)"),N=()=>W(h.matches);return N(),h.addEventListener("change",N),()=>h.removeEventListener("change",N)},[b]),i&&r.length===0)return s?e(_,{as:"p",className:$,children:O(ze)}):null;if(f==="row"&&s&&!m&&r.length>0&&!B(n))return e(_,{as:"p",className:$,children:O(oe)});if(f==="row"&&g===He){const{strip:h}=ee(g,R),N=e(Ge,{owner:n,items:m?null:r,label:c,editing:s,markCurrent:x,strip:h});return h?d(D,{children:[N,e(ie,{owner:n,items:m?null:r,label:c,editing:s,markCurrent:x,menuStyle:g,menuStylePhone:R})]}):N}if(f==="row")return e(ie,{owner:n,items:m?null:r,label:c,editing:s,linkAlign:T,linkRange:w,markCurrent:x,menuStyle:g,menuStylePhone:R,panelLook:{width:u,tintColor:A,tintOpacity:M}});const y=h=>e("ul",{className:Ye,children:e(P,{owner:n,items:h,place:{place:"column"},wrap:(N,U)=>e("li",{className:h?le(E,U.index):`text-fg ${le(E,U.index)}`,children:N})})});return m?d(_,{as:"div",className:"min-w-0",children:[e("h4",{className:z,children:p?F(p):O(Se)}),y(null),e("p",{className:`mt-3 ${$}`,children:O(ke)})]}):r.length===0||!B(n)?d(_,{as:"div",className:"min-w-0",children:[c?e("h4",{className:z,children:F(c)}):null,s?e("p",{className:$,children:r.length===0?O("This menu has no links yet — add them in {place}.",{place:O("Storefront → Menus")}):O(oe)}):null]}):b&&I?d(_,{as:"details",className:"min-w-0 border-b border-line",children:[d("summary",{className:"flex cursor-pointer list-none items-center justify-between py-3 font-mono text-[13px] uppercase tracking-[0.2em] text-fg-dim",children:[F(c),e("span",{"aria-hidden":!0,children:"+"})]}),e("div",{className:"pb-3",children:y(r)})]}):d(_,{as:"div",className:"min-w-0",children:[c?e("h4",{className:z,children:F(c)}):null,y(r)]})}export{Ve as default};
|
|
1
|
+
"use client";import{jsx as e,Fragment as H,jsxs as p}from"react/jsx-runtime";import{createContext as fe,useCallback as we,useContext as be,useEffect as X,useRef as F,useState as P}from"react";import{createPortal as ge}from"react-dom";import{CloseIcon as xe,MenuIcon as Ne}from"efficient-shell/icons/efficient-glyphs";import Ee from"./PopupFrame.js";import{POPUP_LOOK_DEFAULTS as Z}from"efficient-web-builder/format/lib/popup/look";import{REPEAT_ATTRIBUTE as Ce,REPEAT_INDEX_ATTRIBUTE as Te}from"efficient-easel/draw";import{MenuPlaceContext as _e}from"./MenuLinkBlock.js";import{CardRowContext as ye,CardTemplateRows as Me}from"efficient-web-builder/render/components/CardRowContext";import{renderChrome as $}from"efficient-web-builder/render/components/goldPhrases";import{UTIL_WORDS as J}from"./HeaderTools.js";import{usePhoneMenuTools as ke}from"efficient-web-builder/render/components/PhoneMenuTools";import{useSearch as ve}from"./SearchContext.js";import{useModalDismiss as Le}from"./useModalDismiss.js";import{PhoneSheet as Oe}from"./PhoneSheet.js";import{usePreviewMenus as Re}from"./PreviewMenusContext.js";import{FOOTER_MENU_PLACEHOLDER_COUNT as Ae,FOOTER_MENU_PLACEHOLDER_HEADING as Se,FOOTER_MENU_PLACEHOLDER_HINT as Pe}from"../lib/content/menu-placeholder.js";import{say as O}from"efficient-web-builder/format/lib/editor-words";import{isMenuOrphaned as Ie}from"../lib/menu-source.js";import{legacyBlockAlignOf as Ue}from"efficient-web-builder/format/lib/content/block-align";import{MENU_PANEL_TINT_OPACITY_DEFAULT as De,MENU_PANEL_WIDTH_DEFAULT as He,MENU_STYLE_BUTTON as ee,MENU_STYLE_TABS as Fe,menuLinkInRange as $e,menuShowClasses as ne,resolveMenuLinkRange as Be}from"../lib/content/menu-row.js";import{MENU_ENTRY_SIZE_CLASS as te}from"../lib/content/menu-entry-type.js";import{TAB_CELLS as le,currentLinkIndex as Ye,marksCurrentLink as re}from"../lib/content/tab-strip.js";import{useAddressQuery as Qe}from"./wheels-plp/usePlpFiltersInUrl.js";import{useCurrentPagePath as We}from"efficient-web-builder/render/lib/site-runtime";import{HideTaker as M}from"efficient-web-builder/render/components/ViewHideRoot";import{blockParts as je}from"../lib/block-parts.js";import{MENU_BLOCK_TYPE as qe}from"../lib/document/document-nodes.js";const r=je(qe),ze=`flex list-none flex-col gap-3 ${te}`,G="mb-4 font-mono text-[13px] uppercase tracking-[0.2em] text-fg-dim",B="text-[12px] italic text-fg-dim/70",ae=(n,t)=>n&&t>0?"border-t border-line pt-3":"",Ge=n=>({label:n.label??"",url:n.href??"",served:n}),oe=n=>n.served?{...n.served,label:n.label??"",href:n.url??""}:{label:n.label??"",href:n.url??""},Ve=Array.from({length:Ae},()=>({label:"",href:""}));function I({owner:n,items:t,place:s,wrap:h,markCurrent:E=!1}){const C=t?t.map(oe):Ve,c=We(),w=be(ce),_=t&&E?Ye(t.map(g=>g.url??""),c,w):-1,b=_<0?null:{index:_,href:t[_].url??""};return e(_e.Provider,{value:t?b?{...s,current:b}:s:{...s,placeholder:!0},children:e(Me,{ownerId:n.id,ownerType:n.type,Template:n.template,rows:C,items:t??void 0,fallback:null,wrapCopy:h,children:g=>g})})}const Y=n=>(n.template?.blockCount??0)>0,Ke="Nothing to show yet: this menu's entries come from its Menu content.",ie="This menu draws no links: its card template is empty. Undo the delete, or delete this Menu and add it again.";function se({owner:n,items:t,label:s,editing:h,linkAlign:E,linkRange:C,markCurrent:c,menuStyle:w,menuStylePhone:_,panelLook:b}){const g=Ue(E),k=Be(C),R=!!k&&t!==null&&k.to!==void 0&&k.to<t.length,[u,A]=P(!1),v=F(null),x=ke(),{open:Q}=ve(),S=s||"Menu",d=we(()=>A(!1),[]),l=w===ee||_===ee,m=ne(w,_),[U,W]=P("sheet"),y=F(null),f=F(null),[N,D]=P(void 0),[L,me]=P(null),V=()=>{if(!u&&l){const i=v.current?.ownerDocument.defaultView;W(i?.matchMedia("(min-width: 720px)").matches?"side":"sheet");const a=y.current?.querySelector("span");if(a&&i){const o=i.getComputedStyle(a);D({fontFamily:o.fontFamily,fontSize:o.fontSize,letterSpacing:o.letterSpacing,textTransform:o.textTransform});const T=(y.current?.querySelector("svg")??y.current)?.getBoundingClientRect();me(T?{left:T.left,top:T.top,height:T.height}:null)}}A(i=>!i)};X(()=>{if(!u||!l)return;const a=v.current?.ownerDocument.defaultView?.matchMedia("(min-width: 720px)");if(!a)return;const o=()=>A(!1);return a.addEventListener("change",o),()=>a.removeEventListener("change",o)},[u,l]);const j=F(null);Le({active:u&&!(u&&l&&U==="side"),onDismiss:d,scopeRef:v,focusRef:j,trapRef:j});const ue=e(I,{owner:n,items:t,place:{place:"row"},markCurrent:c,wrap:(i,a)=>{const o=t!==null&&k&&!$e(k,a.index+1)?{"data-menu-out":""}:null;return e("li",{className:"",...o,...r("menu-item"),children:i})}}),q=(i,a,o)=>h?{[Ce]:`${i}:${o<0?"panel":"dropdown"}`,[Te]:`${o+1}.${a.index}`}:null,de=e(I,{owner:n,items:t,place:{place:"panel",onNavigate:d},markCurrent:c,wrap:(i,a)=>p(H,{children:[e("li",{className:"flex min-h-14 items-center border-b border-line",...q(n.id,a,-1),...r("menu-item"),children:i}),t===null?null:(a.item?.dropdown_items??[]).map((o,T)=>e(ye.Provider,{value:{...a,row:oe(o),item:o},children:e("li",{className:"flex min-h-12 items-center border-b border-line pl-5 text-[14px]",...q(n.id,a,T),...r("menu-item"),children:i})},T))]})}),pe=x&&(x.search||x.region||x.account||x.theme)?x:null;if(!h&&t!==null&&!Y(n)&&!pe)return null;const K=e(Oe,{role:"dialog",panelRef:j,name:S,entries:de,tools:x,withAccount:!l,editing:h,onClose:d,onSearch:Q,phoneOnly:!l,marker:l?"sheet":void 0,listStyle:l&&L?{paddingLeft:L.left,paddingRight:L.left}:void 0});let z=null;if(l){const i=v.current?.ownerDocument,a={...Z,placement:"left",height:"full",closeButton:"none",width:typeof b?.width=="number"?b.width:He,tintColor:typeof b?.tintColor=="string"?b.tintColor:Z.tintColor,tintOpacity:typeof b?.tintOpacity=="number"?b.tintOpacity:De},o=e(Ee,{look:a,drawer:{closeRef:f},open:!0,onClose:d,label:S,children:p("div",{"data-menu-panel":"side",className:"flex h-full flex-col overflow-y-auto text-fg",children:[e("div",{className:"flex min-h-[var(--sf-header-h,88px)] shrink-0 items-center px-8",style:L?{paddingLeft:L.left}:void 0,children:p("button",{ref:f,type:"button",onClick:d,className:"inline-flex h-11 items-center gap-2",style:N,children:[e(xe,{size:20,"aria-hidden":"true"}),e("span",{className:"whitespace-nowrap",children:J.close})]})}),e("ul",{className:"m-0 flex list-none flex-col px-8 pb-8",style:L?{paddingLeft:L.left}:void 0,...r("menu"),children:e(I,{owner:n,items:t,place:{place:"panel",onNavigate:d},markCurrent:c,wrap:(T,he)=>e("li",{className:"flex min-h-12 items-center",...q(n.id,he,-1),...r("menu-item"),children:T})})})]})});z=p(H,{children:[p("button",{ref:y,type:"button",className:`mono-eyebrow-ctl ${m.button} h-11 min-w-11 items-center gap-2 opacity-80 transition-opacity hover:opacity-100 max-view-tablet:-mx-3 max-view-tablet:min-w-0 max-view-tablet:px-3`,"aria-expanded":u,"aria-label":u?"Close the menu":"Open the menu",onClick:V,...r("menu-button"),children:[e(Ne,{size:20,"aria-hidden":"true"}),e("span",{className:"whitespace-nowrap max-view-tablet:hidden",children:J.menu})]}),u&&i?ge(U==="side"?o:K,i.body):null]})}else m.drawsButton&&(z=p(H,{children:[e("button",{type:"button",className:`${m.buttonHead} h-11 w-11 items-center justify-center${m.buttonTail}`,"aria-expanded":u,"aria-label":u?"Close the menu":"Open the menu",onClick:V,...r("menu-button"),children:e("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",children:u?e("path",{d:"M6 6l12 12M18 6L6 18"}):e("path",{d:"M4 7h16M4 12h16M4 17h16"})})}),u?K:null]}));return p(M,{as:"nav",ref:v,"aria-label":S,"data-menu-row":"",...l?{"data-menu-show":"button"}:null,...!l&&g?{"data-menu-align":g}:null,...!l&&R?{"data-menu-part":"lead"}:null,className:"min-w-0",...r("menu-block"),children:[e("ul",{className:`m-0 ${m.listHead} list-none flex-wrap items-center gap-x-8 gap-y-2 p-0 font-mono ${te} uppercase tracking-[0.18em]${m.listTail}`,...r("menu"),children:ue}),z]})}function Xe({owner:n,items:t,label:s,editing:h,markCurrent:E,strip:C=""}){return!h&&(t===null||t.length===0||!Y(n))?null:e(M,{as:"nav","aria-label":s||"Menu","data-menu-tabs":"",className:C?`min-w-0 ${C}`:"min-w-0",...r("menu-block"),children:e("ul",{className:le.list,...r("menu"),children:e(I,{owner:n,items:t,place:{place:"tab"},markCurrent:E,wrap:(c,w)=>e("li",{className:le.item(w.index===0,h),...r("menu-item"),children:c})})})})}const ce=fe("");function Ze(n){const t=!n.editing&&re(n.layout,n.currentPage),s=Qe(n.pageQuery??"",t);return e(ce.Provider,{value:s,children:e(Je,{...n})})}function Je({owner:n,menu:t,served:s,heading:h,accordionMobile:E=!1,showDividers:C=!1,editing:c=!1,layout:w="column",linkAlign:_,linkRange:b,menuStyle:g,currentPage:k,menuStylePhone:R,menuPanelWidth:u,menuPanelTintColor:A,menuPanelTintOpacity:v}){const x=re(w,k),{live:Q,ready:S}=Re(),d=!s&&Ie({id:t?.id,handle:t?.handle,editing:c,ready:S,live:Q}),l=s?s.map(Ge):d?[]:t?.items??[],m=h||(s?"":t?.name)||"",[U,W]=P(!1);if(X(()=>{if(!E)return;const f=window.matchMedia("(max-width: 800px)"),N=()=>W(f.matches);return N(),f.addEventListener("change",N),()=>f.removeEventListener("change",N)},[E]),s&&l.length===0)return c?e(M,{as:"p",className:B,children:O(Ke)}):null;if(w==="row"&&c&&!d&&l.length>0&&!Y(n))return e(M,{as:"p",className:B,children:O(ie)});if(w==="row"&&g===Fe){const{strip:f}=ne(g,R),N=e(Xe,{owner:n,items:d?null:l,label:m,editing:c,markCurrent:x,strip:f});return f?p(H,{children:[N,e(se,{owner:n,items:d?null:l,label:m,editing:c,markCurrent:x,menuStyle:g,menuStylePhone:R})]}):N}if(w==="row")return e(se,{owner:n,items:d?null:l,label:m,editing:c,linkAlign:_,linkRange:b,markCurrent:x,menuStyle:g,menuStylePhone:R,panelLook:{width:u,tintColor:A,tintOpacity:v}});const y=f=>e("ul",{className:ze,...r("menu"),children:e(I,{owner:n,items:f,place:{place:"column"},wrap:(N,D)=>e("li",{className:f?ae(C,D.index):`text-fg ${ae(C,D.index)}`,...r("menu-item"),children:N})})});return d?p(M,{as:"div",className:"min-w-0",...r("menu-block"),children:[e("h4",{className:G,...r("heading"),children:h?$(h):O(Se)}),y(null),e("p",{className:`mt-3 ${B}`,children:O(Pe)})]}):l.length===0||!Y(n)?p(M,{as:"div",className:"min-w-0",...r("menu-block"),children:[m?e("h4",{className:G,...r("heading"),children:$(m)}):null,c?e("p",{className:B,children:l.length===0?O("This menu has no links yet — add them in {place}.",{place:O("Storefront → Menus")}):O(ie)}):null]}):E&&U?p(M,{as:"details",className:"min-w-0 border-b border-line",...r("menu-block"),children:[p("summary",{className:"flex cursor-pointer list-none items-center justify-between py-3 font-mono text-[13px] uppercase tracking-[0.2em] text-fg-dim",children:[$(m),e("span",{"aria-hidden":!0,children:"+"})]}),e("div",{className:"pb-3",children:y(l)})]}):p(M,{as:"div",className:"min-w-0",...r("menu-block"),children:[m?e("h4",{className:G,...r("heading"),children:$(m)}):null,y(l)]})}export{Ze as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as m,jsxs as I}from"react/jsx-runtime";import{useContext as N,useEffect as U,useRef as q,useState as C}from"react";import{PublishedFooterContext as K}from"efficient-web-builder/render/components/PublishedFooterContext";import{usePreviewDevice as J}from"efficient-easel/screen/components/PreviewDeviceContext";import Q from"./LegalLine.js";import{LOGO_FILL_DEFAULT as V,LOGO_ROW_FILL_DEFAULT as X,normalizeFooterColumns as Y}from"efficient-web-builder/format/lib/content/footer";import{viewTierForWidth as Z}from"efficient-easel/screen/lib/content/view-tiers";import{chromeWidthStyle as ee,resolveChromeWidth as te}from"efficient-web-builder/format/lib/content/page-width";import{HideTaker as oe}from"efficient-web-builder/render/components/ViewHideRoot";const n={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6"},S={1:"view-tablet:grid-cols-1",2:"view-tablet:grid-cols-2",3:"view-tablet:grid-cols-3",4:"view-tablet:grid-cols-4",5:"view-tablet:grid-cols-5",6:"view-tablet:grid-cols-6"},_={1:"view-desktop:grid-cols-1",2:"view-desktop:grid-cols-2",3:"view-desktop:grid-cols-3",4:"view-desktop:grid-cols-4",5:"view-desktop:grid-cols-5",6:"view-desktop:grid-cols-6"};function
|
|
1
|
+
"use client";import{jsx as m,jsxs as I}from"react/jsx-runtime";import{useContext as N,useEffect as U,useRef as q,useState as C}from"react";import{PublishedFooterContext as K}from"efficient-web-builder/render/components/PublishedFooterContext";import{usePreviewDevice as J}from"efficient-easel/screen/components/PreviewDeviceContext";import Q from"./LegalLine.js";import{LOGO_FILL_DEFAULT as V,LOGO_ROW_FILL_DEFAULT as X,normalizeFooterColumns as Y}from"efficient-web-builder/format/lib/content/footer";import{viewTierForWidth as Z}from"efficient-easel/screen/lib/content/view-tiers";import{chromeWidthStyle as ee,resolveChromeWidth as te}from"efficient-web-builder/format/lib/content/page-width";import{HideTaker as oe}from"efficient-web-builder/render/components/ViewHideRoot";import{blockParts as se}from"../lib/block-parts.js";const re=se("FooterSection"),n={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6"},S={1:"view-tablet:grid-cols-1",2:"view-tablet:grid-cols-2",3:"view-tablet:grid-cols-3",4:"view-tablet:grid-cols-4",5:"view-tablet:grid-cols-5",6:"view-tablet:grid-cols-6"},_={1:"view-desktop:grid-cols-1",2:"view-desktop:grid-cols-2",3:"view-desktop:grid-cols-3",4:"view-desktop:grid-cols-4",5:"view-desktop:grid-cols-5",6:"view-desktop:grid-cols-6"};function ie({blocks:E,editing:e=!1,width:R,columns:j,logoFill:D,logoRowFill:y}){const d=N(K),{desktop:o,tablet:s,mobile:r}=Y(j),{desktop:u,tablet:f,mobile:p}={...V,...D},{desktop:b,tablet:g,mobile:w}={...X,...y},i=J(),v=i==="desktop"?o:i==="tablet"?s:r,M=e?Object.hasOwn(n,v)?n[v]:void 0:`${Object.hasOwn(n,r)?n[r]:void 0} ${Object.hasOwn(S,s)?S[s]:void 0} ${Object.hasOwn(_,o)?_[o]:void 0}`,h=q(null),[W,$]=C(1),[A,P]=C(!1);if(U(()=>{if(!e&&!d)return;const l=h.current;if(!l)return;const k=()=>{const t=l.querySelector(".footer-block-grid");if(!t)return;const c=e?i:Z(window.innerWidth),T=c==="desktop"?b:c==="tablet"?g:w;P(T);const G=c==="desktop"?u:c==="tablet"?f:p,F=getComputedStyle(t).gridTemplateColumns.split(" ").filter(Boolean).length-1,H=Math.max(t.childElementCount-1,0);$(!T&&G&&F>=1?Math.max(Math.ceil(H/F),1):1)};let a;const O=()=>{clearTimeout(a),a=setTimeout(k,0)},B=[0,80,250,600].map(t=>setTimeout(k,t)),x=new MutationObserver(O);x.observe(l,{childList:!0,subtree:!0});const L=new ResizeObserver(O);return L.observe(l),()=>{clearTimeout(a),B.forEach(clearTimeout),x.disconnect(),L.disconnect()}},[o,s,r,e,d,i,u,f,p,b,g,w]),!e&&!d)return null;const z=ee(te(R))??void 0;return m(oe,{as:"footer",ref:h,className:`${e?"sf-theme-surfaces text-fg ":""}border-t border-line bg-bg px-[var(--sf-site-gutter,40px)] pb-10 pt-20 max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:pt-14`,style:{"--footer-logo-rows":W,"--footer-logo-col":A?"1 / -1":"1"},...re("footer-block"),children:I("div",{style:z,children:[m(E,{className:`footer-block-grid mb-[60px] grid items-start gap-x-10 gap-y-12 ${M}`,minEmptyHeight:160}),m(Q,{})]})})}export{ie as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import{useSiteSocialLinks as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import{useSiteSocialLinks as b}from"./SiteRecordContext.js";import{SOCIAL_GAP_DEFAULT as k,SOCIAL_GAP_MAX as _,SOCIAL_GAP_MIN as h}from"../lib/sections/footer-social-gap.js";import{DEFAULT_SOCIAL_ICON_STYLE as A,SocialMark as S}from"efficient-web-builder/render/components/socialIcons";import{normalizeSocialLinks as L,socialLinksToDraw as w}from"efficient-web-builder/format/lib/content/social-links";import{say as v}from"efficient-web-builder/format/lib/editor-words";import{BLOCK_ALIGN_JUSTIFY as O,legacyBlockAlignOf as g}from"efficient-web-builder/format/lib/content/block-align";import{HideTaker as n}from"efficient-web-builder/render/components/ViewHideRoot";import{blockParts as I}from"../lib/block-parts.js";const i=I("FooterSocial"),o={small:16,medium:20,large:24};function C({iconStyle:c=A,iconSize:a="medium",align:m,gap:r=k,editing:d=!1}){const f=b(),l=w(L(f));if(l.length===0)return d?e(n,{as:"div","data-social-placeholder":"",className:"rounded border border-dashed border-line px-3 py-2 text-[13px] text-fg-dim",children:v("Add your social links")}):null;const t=(Object.hasOwn(o,a)?o[a]:void 0)??o.medium,p={gap:Math.min(_,Math.max(h,Number.isFinite(r)?r:0)),"--social-mark":`${t}px`};return e(n,{as:"ul","data-social-block":"","aria-label":"Social media",className:`flex list-none flex-wrap p-0 [margin:calc((44px-var(--social-mark))/-2)] max-view-wide:[margin:calc((40px-var(--social-mark))/-2)] ${O[g(m)??"left"]}`,style:p,...i("social-block"),children:l.map(({platform:s,href:u,label:x})=>e("li",{...i("social-item"),children:e("a",{href:u,target:"_blank",rel:"noopener noreferrer","aria-label":`${x} (opens in a new tab)`,className:"grid h-11 w-11 place-items-center rounded text-fg transition-colors hover:text-accent focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-4px] focus-visible:outline-current motion-reduce:transition-none max-view-wide:h-10 max-view-wide:w-10",...i("social-link"),children:e(S,{platform:s,iconStyle:c,size:t})})},s))})}export{o as SOCIAL_ICON_PX,C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,Fragment as S,jsxs as E}from"react/jsx-runtime";import{createContext as A,useContext as O,useMemo as g}from"react";import{CardRowContext as G,CardTemplateRows as p,useCardRow as L}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as
|
|
1
|
+
"use client";import{jsx as t,Fragment as S,jsxs as E}from"react/jsx-runtime";import{createContext as A,useContext as O,useMemo as g}from"react";import{CardRowContext as G,CardTemplateRows as p,useCardRow as L}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as k}from"efficient-web-builder/render/components/SiteGutterFrame";import{SECTION_FILL_PASS_CLASS as D}from"efficient-web-builder/format/lib/content/section-min-height";import{cardHoverOf as N}from"efficient-web-builder/format/lib/animation/hover";import{pickHoverMedia as F}from"efficient-web-builder/format/lib/content/hover-media";import U from"efficient-web-builder/render/components/HoverMediaLayer";import{NO_FIELD_ANSWERS as x}from"../lib/content/field-usage.js";import{CARD_IMAGE_SIZES as $}from"../lib/sections/card-image-sizes.js";import{productTone as j,productToneVaried as W,randomCardColour as b}from"../lib/sections/card-tone.js";import{CardLookContext as C}from"./card-pieces/card-row.js";import{CardBuyDialog as B}from"./card-pieces/CardBuyButton.js";import H from"./card-pieces/CardSurfaceFrame.js";import{BundleCardStateProvider as M,TyreCardStateProvider as z,useProductCardState as v,useWheelCardState as R,WheelCardStateProvider as V,tyreCardProduct as q}from"./card-pieces/ProductCardState.js";import{tyrePagePath as Y}from"../lib/tyres/tyre-page-path.js";import{say as K}from"efficient-web-builder/format/lib/editor-words";import{CARD_INDEX_OPTIONS as X,cardIndexCss as J}from"efficient-web-builder/format/lib/sections/product-card-style";import{SHARED_ROWS_LIST_CLASS as Q}from"efficient-web-builder/render/lib/content/box-shared-columns";import{GAP_ZONE_CLASS as Z}from"efficient-web-builder/format/lib/content/container-gap";import{CARD_ROWS_GRID_CLASS as ee,cardRowsGap as re,cardRowsGridStyle as oe}from"./WheelCardFrame.js";import{blockParts as te}from"../lib/block-parts.js";const ne=te("ProductCard");function Me(e){return X.map(({value:r})=>r==="off"?"":J(e,r).replace(".sf-card-index::before",`.sf-card-index[data-format="${r}"]::before`)).join("")}function ze(e){return e.className.includes(Z)?{className:`${e.className} ${ee} ${Q}`,style:{...e.style,...oe(re(e))}}:e}const ae={sale:!1,axleSets:!0,setTotal:!1,wasFollowsSize:!1,quoteSets:!0,showSingle:!1,armOnContact:!1},Ve={sale:!0,axleSets:!1,setTotal:!0,wasFollowsSize:!0,quoteSets:!1,showSingle:!0,armOnContact:!0},se={kindLabel:null,brand:!1,process:!0,tyreBrand:!0},de=[],T={ownerId:"",ownerType:"ProductGrid",Template:void 0,hover:N({},"ProductGrid"),imageSizes:$,fieldUsage:x,tyreFieldUsage:x,reserveEyebrow:!1,editing:!1,eyebrow:se,fit:null,colours:de,rules:ae},_=A(T);function u(){return O(_)}function qe({value:e,children:r}){const o=g(()=>({...T,...ie(e)}),[e]);return t(_.Provider,{value:o,children:r})}const ie=e=>Object.fromEntries(Object.entries(e).filter(([,r])=>r!==void 0));function w(e,r){const o=e.designCode??e.slug??"";return{name:e.name??"",eyebrow:e.process??"",note:"",href:e.slug?`/wheels/${e.slug}`:"",colour:j(r),colourVaried:W(r,o),colourRandom:b(o)}}function le(e){const r=e.designCode||e.slug||"";return{name:e.name??"",eyebrow:e.brand??"",note:"",href:Y(e.slug)??"",colour:"",colourVaried:"",colourRandom:b(r)}}const I=e=>`/bundles/${e.slug}`;function ce(e){return{name:e.name,eyebrow:"",note:e.subtitle??"",href:I(e),colour:"",colourVaried:"",colourRandom:""}}const ue="sf-card sf-card-fill group relative flex flex-col bg-[var(--card-bg)] transition-colors duration-200 hover:bg-[var(--card-bg-hover)] [.sf-card-rows>&]:mb-[var(--sf-card-row-gap)]",me="sf-card group relative flex flex-col border border-line bg-bg transition-colors hover:border-accent",fe="col-span-2 max-view-wide:col-span-1 @max-[720px]:col-span-1 [&:has([data-set-picture=one])]:col-span-1",pe=`relative flex-1 ${D}`;function y({copy:e,href:r,label:o,wide:n=!1,kit:a=!1,probes:s,arm:m,layer:l}){const{editing:i}=u();return t(H,{surface:a?me:ue,span:n?fe:void 0,href:r,label:o,linked:!i,probes:s,arm:m,layer:l,children:t("div",{className:pe,...ne("card-content"),children:t(k,{children:e})})})}const Ce="var(--card-bg)";function we(e,r=Ce){const{hover:o}=u(),n=v();if(o.kind!=="nextImage"||o.media?.cover!==e||n.kind!=="wheel")return null;const a=F(n.wheel,o.media,n.sel.finish?.name);return a?t(U,{media:a,name:n.wheel.name,cover:e,ground:r}):null}function ye({children:e}){const r=L(),{wheel:o,sel:n}=R(),a=n.finish?.color,s=g(()=>r?{...r,row:w(o,a)}:null,[r,o,a]);return s?t(G.Provider,{value:s,children:e}):t(S,{children:e})}function he({copy:e}){const{wheel:r,sel:o,isSet:n}=R(),{rules:a}=u(),s=we("card");return E(S,{children:[t(y,{copy:t(ye,{children:e}),href:r.slug?`/wheels/${r.slug}`:"",label:r.name,wide:n,probes:o.probes,arm:a.armOnContact?o.arm:void 0,layer:s}),t(B,{})]})}function P(e,r,o,n){const a=r.item;return t(V,{wheel:a,colours:o.colours,defaultFinish:n?.[r.index],editing:o.editing,children:t(C.Provider,{value:"catalog",children:t(he,{copy:e})})})}function Ye({wheels:e,finishes:r,children:o}){const n=u(),{ownerId:a,ownerType:s,Template:m,editing:l}=n;return t(p,{ownerId:a,ownerType:s,Template:m,rows:e.map(i=>w(i)),items:e,fallback:l?t(h,{}):null,wrapCopy:(i,d)=>P(i,d,n,r),children:o})}function Ke({items:e,tyreOf:r,tyreFit:o}){const n=u(),{ownerId:a,ownerType:s,Template:m,editing:l}=n,i=e.map(d=>r(d));return t(p,{ownerId:a,ownerType:s,Template:m,rows:e.map((d,f)=>{const c=i[f];return c?le(c):w(d)}),items:e,fallback:l?t(h,{}):null,wrapCopy:(d,f)=>{const c=i[f.index];return c?ge(d,q(c,o?.(c)??null),l):P(d,f,n)},children:d=>d})}function Se({copy:e}){const r=v();if(r.kind!=="tyre")throw new Error("A tyre card surface was drawn outside its tyre state.");return t(y,{copy:e,href:r.pagePath??"",label:r.tyre.name,arm:r.arm})}function ge(e,r,o){return t(z,{tyre:r,editing:o,children:t(C.Provider,{value:"catalog",children:t(Se,{copy:e})})})}function xe(e,r){const o=r.item;return t(M,{bundle:o,children:t(C.Provider,{value:"catalog",children:t(y,{copy:e,href:I(o),label:o.name,kit:!0})})})}function Xe({bundles:e,children:r}){const{ownerId:o,ownerType:n,Template:a,editing:s}=u();return t(p,{ownerId:o,ownerType:n,Template:a,rows:e.map(ce),items:e,fallback:s?t(h,{}):null,wrapCopy:xe,children:r})}function h(){return t("div",{"data-grid-card-empty":"",className:"p-4 text-center font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.2em] text-fg-dim",children:K("The card is empty. Add parts to its card template in Layers.")})}export{ae as GRID_CARD_RULES,Xe as GridBundleCards,qe as GridCardProvider,Ye as GridCards,Ke as GridMixedCards,Ve as LISTING_CARD_RULES,ce as bundleCardRow,I as bundlePagePath,ze as cardRowsGrid,Me as gridIndexCss,w as productCardRow,le as tyreCardRow,we as useCardHoverLayer,u as useGridCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as s,jsxs as
|
|
1
|
+
"use client";import{jsx as s,jsxs as g}from"react/jsx-runtime";import d from"next/link";import{useEffect as I,useId as j,useRef as x,useState as P}from"react";import{isLabelOnlyMenuUrl as w,isMenuPanel as A}from"../lib/menu-link.js";import{useTakeViewHide as D,withViewHide as y}from"efficient-web-builder/render/components/ViewHideRoot";import{DesktopDropdownPanel as M,PhoneDropdownPanel as O}from"./HeaderDropdownPanel.js";import{blockParts as R}from"../lib/block-parts.js";import{MENU_BLOCK_TYPE as B}from"../lib/document/document-nodes.js";const h=R(B)("menu-link"),H=120;function K({item:n,mobile:a=!1,onNavigate:T,dropdownAlign:N="start"}){const[t,c]=P(!1),[k,C]=P(!1),i=()=>{c(!1),C(!1)},f=j(),u=x(null),$=x(null),L=n.dropdownItems.length>0,b=L&&A(n.dropdownItems,n.dropdownAside),p=x(null),m=()=>{p.current!==null&&(clearTimeout(p.current),p.current=null)};I(()=>m,[]);const v=!w(n.href),o=D();I(()=>{if(!t)return;const e=u.current?.ownerDocument??document,r=_=>{u.current?.contains(_.target)||i()};return e.addEventListener("pointerdown",r),()=>e.removeEventListener("pointerdown",r)},[t]);const l=()=>{i(),T?.()};if(!L)return v?o.scope(s(d,{href:n.href,onClick:l,className:y(a?"flex min-h-11 items-center font-display text-3xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent":"whitespace-nowrap opacity-80 transition-opacity hover:opacity-100 focus-visible:rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",o.className),...o.attrs,children:n.label})):o.scope(s("span",{className:y(a?"flex min-h-11 items-center font-display text-3xl":"whitespace-nowrap opacity-80",o.className),...o.attrs,children:n.label}));const E=s("button",{ref:$,type:"button","aria-label":`${t&&(a||k)?"Close":"Open"} ${n.plainLabel} menu`,"aria-expanded":t,"aria-controls":f,onClick:()=>{a?c(e=>!e):t&&k?i():(m(),c(!0),C(!0))},className:a?"flex h-11 w-11 shrink-0 items-center justify-center rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent":"flex h-8 w-8 shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",children:s("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",className:`transition-transform ${t?"rotate-180":""}`,children:s("path",{d:"m3 5 4 4 4-4"})})});return a?o.scope(g("div",{ref:u,className:o.className||void 0,...o.attrs,children:[g("div",{className:"flex min-h-11 items-center justify-between gap-3",children:[v?s(d,{href:n.href,onClick:l,className:"min-w-0 flex-1 font-display text-3xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",...h,children:n.label}):s("span",{className:"min-w-0 flex-1 font-display text-3xl",...h,children:n.label}),E]}),t&&b?s(O,{id:f,items:n.dropdownItems,aside:n.dropdownAside,onNavigate:l}):t?s("div",{id:f,className:"mt-3 flex flex-col border-l border-line pl-5",children:n.dropdownItems.map((e,r)=>w(e.href)?s("span",{className:"flex min-h-11 items-center text-base opacity-80",children:e.label},`${e.href}-${r}`):s(d,{href:e.href,onClick:l,className:"flex min-h-11 items-center text-base opacity-80 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",children:e.label},`${e.href}-${r}`))}):null]})):o.scope(g("div",{ref:u,className:y("relative flex items-center whitespace-nowrap",o.className),...o.attrs,onMouseEnter:()=>{m(),c(!0)},onMouseLeave:()=>{m(),b?p.current=setTimeout(i,H):i()},onBlurCapture:e=>{e.currentTarget.contains(e.relatedTarget)||i()},onKeyDown:e=>{e.key==="Escape"&&(i(),$.current?.focus())},children:[v?s(d,{href:n.href,onClick:l,onFocus:()=>c(!0),className:"opacity-80 transition-opacity hover:opacity-100 focus-visible:rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",...h,children:n.label}):s("span",{className:"opacity-80",...h,children:n.label}),E,t&&b?s(M,{id:f,items:n.dropdownItems,aside:n.dropdownAside,onNavigate:l,anchor:u}):t?s("div",{id:f,className:`absolute top-full z-[60] w-72 pt-3 text-fg ${N==="end"?"right-0":N==="center"?"left-1/2 -translate-x-1/2":"left-0"}`,children:s("div",{className:"overflow-hidden rounded-lg border border-line bg-bg p-2 shadow-xl",children:n.dropdownItems.map((e,r)=>w(e.href)?s("span",{className:"flex min-h-11 items-center rounded-md px-4 py-2 text-sm opacity-80",children:e.label},`${e.href}-${r}`):s(d,{href:e.href,onClick:l,className:"flex min-h-11 items-center rounded-md px-4 py-2 text-sm opacity-80 transition-[background,opacity] hover:bg-[var(--card-bg)] hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",children:e.label},`${e.href}-${r}`))})}):null]}))}export{K as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,Fragment as
|
|
1
|
+
"use client";import{jsx as r,Fragment as m,jsxs as a}from"react/jsx-runtime";import{readHidable as u}from"efficient-easel/screen/lib/document/hidable";import{useSiteCopyright as h}from"./SiteRecordContext.js";import{useCookieSettingsLink as d}from"./ConsentContext.js";import{LEGAL_WORDS as o,useSiteLegal as b}from"./SiteLegalContext.js";import{CONSENT_TEXT_BUTTON as y}from"./ConsentBanner.js";import{HideTaker as x}from"efficient-web-builder/render/components/ViewHideRoot";import{blockParts as k}from"../lib/block-parts.js";const g="transition-colors hover:text-fg hover:underline hover:underline-offset-4";function v(e,i){if(!e)return[{key:"privacy",label:o.privacy},{key:"terms",label:o.terms},{key:"cookies",label:o.cookieSettings},{key:"sitemap",label:o.sitemap}];const t=[];return e.privacyHref&&t.push({key:"privacy",label:o.privacy,href:e.privacyHref}),e.termsHref&&t.push({key:"terms",label:o.terms,href:e.termsHref}),i&&(i.required||e.cookieSettings)&&t.push({key:"cookies",label:i.label,onClick:i.open}),e.sitemapHref&&t.push({key:"sitemap",label:o.sitemap,href:e.sitemapHref}),t}function s({item:e,first:i=!1}){if(!e)return null;const t=e.href?r("a",{className:g,href:e.href,children:e.label}):e.onClick?r("button",{type:"button",className:`${y} text-left`,onClick:e.onClick,children:e.label}):r("span",{children:e.label});return a(m,{children:[!i&&r("span",{"aria-hidden":!0,children:"·"}),t]})}const c=k("FooterSection");function L({copyright:e}={}){const i=h(),t=u(e),l=t.hidden?null:t.text.trim()||i,p=b(),f=d(),n=v(p,f);return a(x,{as:"div",className:"flex flex-wrap justify-between gap-x-6 gap-y-3 border-t border-line pt-6 font-mono text-[13px] uppercase tracking-[0.15em] text-fg-dim max-view-tablet:flex-col max-view-tablet:gap-3",...c("legal-line"),children:[l!==null&&r("span",{...c("copyright"),children:l}),n.length>0&&a("span",{className:"flex flex-wrap items-center gap-3 view-tablet:ml-auto",children:[r(s,{item:n[0],first:!0}),r(s,{item:n[1]}),r(s,{item:n[2]}),r(s,{item:n[3]})]})]})}export{L as default,v as legalItems};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as l,jsxs as f}from"react/jsx-runtime";import{createContext as h,useContext as k,useEffect as w,useRef as L}from"react";import N from"next/link";import x from"./HeaderNavItem.js";import C from"./MenuPlaceholderLabel.js";import{useCardRow as _}from"efficient-web-builder/render/components/CardRowContext";import{renderGold as i}from"efficient-web-builder/render/components/goldPhrases";import{scrollBehavior as g}from"efficient-web-builder/render/components/useReducedMotion";import{useTakeViewHide as T,withViewHide as u}from"efficient-web-builder/render/components/ViewHideRoot";import{isLabelOnlyMenuUrl as E,menuDropdownAside as M,menuLinkKind as R}from"../lib/menu-link.js";import{CURRENT_LINE as p,TAB_CELLS as d,showCurrentTab as v}from"../lib/content/tab-strip.js";import{blockParts as y}from"../lib/block-parts.js";import{MENU_BLOCK_TYPE as I}from"../lib/document/document-nodes.js";const m=y(I)("menu-link"),P=h(null),b="opacity-80 transition-opacity hover:opacity-100";function s({item:r,label:t,link:n,onNavigate:a,current:c=!1,children:o}){const e=T();return E(r.url)?e.scope(l("span",{className:u(t,e.className),...e.attrs,...m,children:i(r.label)})):e.scope(R(r.url)==="off-site"?f("a",{href:r.url,target:"_blank",rel:"noopener noreferrer",className:u(n,e.className),onClick:a,...e.attrs,...m,children:[i(r.label),o]}):f(N,{href:r.url,className:u(n,e.className),onClick:a,"aria-current":c?"page":void 0,...e.attrs,...m,children:[i(r.label),o]}))}function j(){const r=L(null);return w(()=>{v(r.current?.closest("[data-menu-tabs] > ul")??null,g())},[]),l("span",{ref:r,className:d.underline})}function A(){const r=_(),t=k(P);if(!r||!t)return null;if(t.placeholder)return l(C,{});const n={label:r.row.label??"",url:r.row.href??""},a=!!t.current&&t.current.index===r.index&&t.current.href===n.url;if(t.place==="tab"){const e=d.tab(a);return l(s,{item:n,label:e,link:e,current:a,children:a?l(j,{}):null})}if(t.place==="column")return l(s,{item:n,label:"text-fg",link:"text-fg transition-colors hover:text-accent",current:a});if(t.place==="panel")return l(s,{item:n,label:"",link:` ${b}`,onNavigate:t.onNavigate,current:a});const c=r.item,o=c?.dropdown_items??[];return o.length?l(x,{item:{href:n.url,label:i(n.label),plainLabel:n.label,dropdownItems:o.map(e=>({href:e.url,label:i(e.label),plainLabel:e.label,description:e.description,image:e.image,badge:e.badge})),dropdownAside:M(c?.dropdown_aside)}}):a?l(s,{item:n,label:"",link:p.rowLink,current:!0,children:l("span",{"aria-hidden":"true",className:p.row})}):l(s,{item:n,label:"",link:` ${b}`})}export{P as MenuPlaceContext,A as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as x,Fragment as mt}from"react/jsx-runtime";import{useScopeClass as dt}from"../lib/use-scope-class.js";import{useEffect as A,useMemo as p,useState as pe}from"react";import{cardHoverOf as ct}from"efficient-web-builder/format/lib/animation/hover";import{containerGapProps as pt}from"efficient-web-builder/format/lib/content/container-gap";import ut from"next/link";import{cardRowsGrid as gt,GridCardProvider as ft,GridMixedCards as ht,gridIndexCss as xt}from"./GridCardTemplate.js";import{gridClassImageSizes as wt}from"../lib/sections/card-image-sizes.js";import{fillRowCss as ue}from"../lib/sections/fill-row.js";import{hiddenCardsRule as ge,noHoleBands as fe,noHoleCss as he,ONE_WHEEL_MARK as vt,oneWheelScope as xe,pairScope as yt,showsASetCard as we}from"../lib/sections/grid-no-hole.js";import{setIsWide as bt,summarySetBuild as Ct}from"../lib/wheels/set-mode.js";import{answersForKind as ve,NO_FIELD_ANSWERS as ye}from"../lib/content/field-usage.js";import{wheelCardEyebrowShows as St}from"./ProductCardEyebrow.js";import Mt from"./NoCurrencyNote.js";import{SITE_WIDTH_CAP as Pt,centredCap as Et}from"efficient-web-builder/format/lib/content/page-width";import{ProductCatalogProvider as Nt,SectionWheelsProvider as Tt}from"./ProductRef.js";import{useCurrency as _t}from"./CurrencyContext.js";import{FRAME_ROOM_PRODUCT_GRID as Ot,FRAME_ROOM_PRODUCT_GRID_PHONE as $t,framedBandPad as Rt,PRODUCT_GRID_ROOM as zt,withBandClasses as It}from"../lib/sections/band-padding.js";import{COLLECTION_ATTR as Lt,useCatalogFilter as At}from"./catalog/CatalogFilterContext.js";import{useShopperMember as Bt}from"./catalog/ShopperScope.js";import{useBrowserLayoutEffect as Gt}from"efficient-shell/hooks";import Ht from"./wheels-plp/PlpPagination.js";import{CATALOG_TEXT_SIZE as Ft}from"../lib/sections/catalog-text-size.js";import{applyShopperFilters as Dt,hasActivePlpFilters as Ut,plpPricedAmounts as kt}from"../lib/wheels/plp-filters.js";import Wt from"./catalog/ClearAllButton.js";import{GRID_TOP_UP_SPARE as jt,gridPagingOf as Kt,gridShownOf as Xt}from"../lib/sections/product-grid-pages.js";import Zt from"./SectionBand.js";import{useInsideBox as qt,useInsideSiteGutter as Vt}from"efficient-web-builder/render/components/SiteGutterFrame";import{productGridColumnsClass as Yt}from"../lib/sections/product-grid-columns.js";import{renderGold as te,renderHeadline as Jt}from"efficient-web-builder/render/components/goldPhrases";import{applyCatalogFilters as Qt}from"../lib/wheels/catalog-filters.js";import{normalizeCatalogRows as er}from"../lib/wheels/wheel-summary-casing.js";import{itemKind as B,plpKindNoun as be}from"../lib/catalog/plp-item.js";import{filterBarCategoryOf as tr,gridKindsOf as Ce,gridRowsOf as rr}from"../lib/wheels/grid-source.js";import{useUnifiedProductCatalog as nr}from"./useProductCatalog.js";import{STICKY_UNDERHEADER_CLASS as ir}from"efficient-web-builder/render/lib/document/header-clearance";import{finishFamiliesOf as sr}from"../lib/wheels/finish-defaults.js";import{lugCountsOf as or}from"../lib/wheels/lug-count.js";import{diametersOf as ar}from"../lib/wheels/size-range.js";import{say as lr}from"efficient-web-builder/format/lib/editor-words";import{DEFAULT_TITLE_SIZE as mr}from"../lib/sections/product-grid-title.js";const dr=ct({},"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)]"},Se=[{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 cr(M){return(Se.find(w=>w.value===M)??Se.find(w=>w.value===mr)).cls}function pr({num:M,catalog:w,catalogTotal:Me,firstCountInChips:Pe=!1,kinds:T,title:G,titleSize:Ee,pads:Ne,noTop:re=!1,description:_,link:P,products:Te,wheels:_e,source:c,columns:Oe,columnsPhone:$e,columnsTablet:Re,limit:ze,moreProducts:Ie,perPage:Le,editing:E,contentCapped:Ae=!1,hover:Be,fieldUsage:v,ownerId:Ge="",template:He,gap:Fe,gapPhone:De}){const H=p(()=>v?ve(v,"alloy-wheel"):void 0,[v]),Ue=p(()=>v?ve(v,"tyre"):void 0,[v]),e=dt("pg"),{paged:y,per:b,limit:a,cap:u}=Kt({moreProducts:Ie,perPage:Le,limit:ze}),m=Yt(Oe,$e,Re),ne=Ae,ke=Vt(),We=qt(),je=ke||We,F=nr(E===!0&&!!c),s=p(()=>c?er(rr(c,T,F??w??[])):null,[w,F,c,T]),D=Bt("grid",s),l=s?D.scope:null,g=tr(c),C=g!==null&&!l,{filters:O,reportCount:U,reportLugs:k,reportSizes:W,reportFinishes:j,reportCategories:K,reportPrices:X,vehicle:ie}=At(),{currency:f}=_t(),Z=C&&!!O.process&&O.process!==g,q=l?.state,r=p(()=>s?q?Dt(s,q,f):C?Qt(s,O,f,ie.fit):s:null,[s,q,C,O,f,ie.fit]),[Ke,Xe]=pe(1),V=y&&r?Math.max(1,Math.ceil(r.length/b)):1,S=Math.min(V,Math.max(1,l?l.state.page:Ke)),{reportShown:Y}=D,se=l!==null;Gt(()=>{if(!se||!r)return Y(null);Y(Xt(r.length,{paged:y,per:b,cap:u},S))},[se,r,Y,y,S,b,u]);const Ze=n=>l?l.update({page:n}):Xe(n),o=p(()=>r&&(y?r.slice((S-1)*b,S*b):u?r.slice(0,Math.ceil(a)+jt):r),[y,u,a,r,S,b]);A(()=>(K(e,g===null?[]:[g]),()=>K(e,[])),[g,K,e]),A(()=>{if(C)return U(e,Z?0:r?.length??0),()=>U(e,0)},[C,Z,r,U,e]);const N=p(()=>({lugs:or(s??[]),sizes:ar(s??[]),finishes:sr(s??[]),prices:kt((s??[]).filter(n=>B(n)!=="tyre"),f)}),[s,f]);A(()=>(k(e,N.lugs),W(e,N.sizes),j(e,N.finishes),X(e,N.prices),()=>{k(e,[]),W(e,[]),j(e,[]),X(e,[])}),[N,k,W,j,X,e]);const J=pt("ProductGrid",Fe,"both",De),qe=`${e} grid${J.className} bg-[var(--catalog-grid-bg)] ${m}`,oe=gt(J),Ve=`${e} grid${oe.className} bg-[var(--catalog-grid-bg)] ${m}`,Ye=oe.style,Je=p(()=>{const n=(r??[]).filter(d=>B(d)!=="tyre");if(n.length===0)return!1;const h=n.some(d=>!!d.process);return n.some(d=>!!d.setWords)||St({kind:!1,brand:!1,process:h},H??[])},[r,H]),Qe=o?o.length>0?t("div",{className:Ve,style:Ye,children:t(ht,{items:o,tyreOf:n=>B(n)==="tyre"?n:null})}):l&&Ut(l.state)?x("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 ${be(Ce(c,T)).many} match those filters`}),t(Wt,{onClick:l.clear})]}):E?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:lr("No products in “{name}” yet",{name:c?.name??""})})}):null:t(Te,{className:qe,style:J.style,minEmptyHeight:320}),et=l?l.countInChips:Pe,$=r&&!et?r===s&&!F?Me??r.length:r.length:null,ae=be(Ce(c,T)),tt=M||G||_||P?x("div",{className:`${ir} 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 ${ne||je?"":"-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:[x("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:[M&&t("span",{className:`font-mono ${i.labelLarge} leading-none uppercase tracking-[0.22em] text-fg-dim`,children:te(M)}),G&&t("h2",{className:`${cr(Ee)} leading-none text-fg max-view-wide:leading-[1] [&>span]:block`,children:Jt(G,!1)})]}),(_||P||$!==null)&&x("div",{className:"flex items-center gap-5 max-view-wide:gap-3 view-wide:grow view-wide:justify-end",children:[_&&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:te(_)}),P&&x(ut,{href:P.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:[te(P.text),t("span",{"aria-hidden":!0,children:"→"})]}),$!==null&&x("span",{className:`whitespace-nowrap font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:[$," ",$===1?ae.one:ae.many]})]})]}):null,R=Rt(Ne,zt,{noTop:re}),{paddingTop:rt,...nt}=R.style,z=re?0:rt,it={...z===void 0?{}:{"--pg-pt":typeof z=="number"?`${z}px`:z},...nt},I=p(()=>{if(!o)return null;const n=o.map(h=>B(h)!=="tyre"&&bt(Ct(h))?2:1);return we(n,a)?fe(m,n,a):null},[o,m,a]),[st,ot]=pe("");A(()=>{if(o)return;const n=document.querySelector(`.${e}`);if(!n)return;const h=()=>{const d=[...n.children].map(ce=>ce.classList.contains("col-span-2")&&!ce.querySelector(vt)?2:1);ot(we(d,a)?he(e,fe(m,d,a,!1),d.length):"")};h();const ee=new MutationObserver(h);return ee.observe(n,{childList:!0}),()=>ee.disconnect()},[o,e,m,a]);const at=I?I[0].tracks:o?u?Math.min(o.length,a):o.length:void 0,L=I?he(yt(e),I,o.length)+(u?ge(xe(e),a+1):"")+ue(xe(e),m,{limit:a,cards:o.length}):st,le=L?"":ue(e,m,{limit:a,cards:o?.length}),me=xt(e),de=x(mt,{children:[u&&!L&&t("style",{children:ge(e,a+1)}),L&&t("style",{children:L}),le&&t("style",{children:le}),me&&t("style",{children:me}),tt,Qe,y&&V>1&&t(Ht,{textSize:Ft.labelSmall,page:S,pageCount:V,onPage:Ze}),t(Mt,{editing:E})]});if(Z)return null;const Q=t(Zt,{rootRef:D.ref,attrs:C&&g!==null?{...R.attrs,[Lt]:g}:R.attrs,className:It(`relative z-[2] bg-bg px-[var(--sf-site-gutter,40px)] ${Ot} max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] ${$t}`,R),column:null,inAnyBox:!0,style:it,defaults:{"--pg-pt":"120px"},children:ne?t("div",{style:Et(Pt),children:de}):de}),lt=s?Q:E?t(Nt,{currency:f,children:Q}):t(Tt,{wheels:_e,currency:f,children:Q});return t(ft,{value:{ownerId:Ge,Template:He,hover:Be??dr,imageSizes:wt(m,at),fieldUsage:H??ye,tyreFieldUsage:Ue??ye,reserveEyebrow:Je,editing:E===!0},children:lt})}export{Se as TITLE_SIZES,pr as default};
|
|
1
|
+
"use client";import{jsx as t,jsxs as w,Fragment as dt}from"react/jsx-runtime";import{useScopeClass as ct}from"../lib/use-scope-class.js";import{useEffect as B,useMemo as g,useState as ge}from"react";import{cardHoverOf as pt}from"efficient-web-builder/format/lib/animation/hover";import{containerGapProps as gt}from"efficient-web-builder/format/lib/content/container-gap";import ut from"next/link";import{cardRowsGrid as ft,GridCardProvider as ht,GridMixedCards as xt,gridIndexCss as wt}from"./GridCardTemplate.js";import{gridClassImageSizes as vt}from"../lib/sections/card-image-sizes.js";import{fillRowCss as ue}from"../lib/sections/fill-row.js";import{hiddenCardsRule as fe,noHoleBands as he,noHoleCss as xe,ONE_WHEEL_MARK as yt,oneWheelScope as we,pairScope as bt,showsASetCard as ve}from"../lib/sections/grid-no-hole.js";import{setIsWide as Ct,summarySetBuild as St}from"../lib/wheels/set-mode.js";import{answersForKind as ye,NO_FIELD_ANSWERS as be}from"../lib/content/field-usage.js";import{wheelCardEyebrowShows as Mt}from"./ProductCardEyebrow.js";import Pt from"./NoCurrencyNote.js";import{SITE_WIDTH_CAP as Tt,centredCap as _t}from"efficient-web-builder/format/lib/content/page-width";import{ProductCatalogProvider as Et,SectionWheelsProvider as Nt}from"./ProductRef.js";import{useCurrency as Ot}from"./CurrencyContext.js";import{FRAME_ROOM_PRODUCT_GRID as Rt,FRAME_ROOM_PRODUCT_GRID_PHONE as $t,framedBandPad as It,PRODUCT_GRID_ROOM as zt,withBandClasses as Lt}from"../lib/sections/band-padding.js";import{COLLECTION_ATTR as At,useCatalogFilter as Bt}from"./catalog/CatalogFilterContext.js";import{useShopperMember as Gt}from"./catalog/ShopperScope.js";import{useBrowserLayoutEffect as Ht}from"efficient-shell/hooks";import Dt from"./wheels-plp/PlpPagination.js";import{CATALOG_TEXT_SIZE as Ft}from"../lib/sections/catalog-text-size.js";import{applyShopperFilters as kt,hasActivePlpFilters as Ut,plpPricedAmounts as Wt}from"../lib/wheels/plp-filters.js";import jt from"./catalog/ClearAllButton.js";import{GRID_TOP_UP_SPARE as Kt,gridPagingOf as Xt,gridShownOf as Zt}from"../lib/sections/product-grid-pages.js";import qt from"./SectionBand.js";import{useInsideBox as Yt,useInsideSiteGutter as Vt}from"efficient-web-builder/render/components/SiteGutterFrame";import{productGridColumnsClass as Jt}from"../lib/sections/product-grid-columns.js";import{renderGold as re,renderHeadline as Qt}from"efficient-web-builder/render/components/goldPhrases";import{applyCatalogFilters as er}from"../lib/wheels/catalog-filters.js";import{normalizeCatalogRows as tr}from"../lib/wheels/wheel-summary-casing.js";import{itemKind as G,plpKindNoun as Ce}from"../lib/catalog/plp-item.js";import{filterBarCategoryOf as rr,gridKindsOf as Se,gridRowsOf as nr}from"../lib/wheels/grid-source.js";import{useUnifiedProductCatalog as ir}from"./useProductCatalog.js";import{STICKY_UNDERHEADER_CLASS as sr}from"efficient-web-builder/render/lib/document/header-clearance";import{finishFamiliesOf as or}from"../lib/wheels/finish-defaults.js";import{lugCountsOf as ar}from"../lib/wheels/lug-count.js";import{diametersOf as lr}from"../lib/wheels/size-range.js";import{say as mr}from"efficient-web-builder/format/lib/editor-words";import{DEFAULT_TITLE_SIZE as dr}from"../lib/sections/product-grid-title.js";import{blockParts as cr}from"../lib/block-parts.js";import{PRODUCT_GRID_TYPE as pr}from"../lib/document/document-nodes.js";const m=cr(pr),gr=pt({},"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)]"},Me=[{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 ur(P){return(Me.find(v=>v.value===P)??Me.find(v=>v.value===dr)).cls}function fr({num:P,catalog:v,catalogTotal:Pe,firstCountInChips:Te=!1,kinds:N,title:H,titleSize:_e,pads:Ee,noTop:ne=!1,description:O,link:T,products:Ne,wheels:Oe,source:p,columns:Re,columnsPhone:$e,columnsTablet:Ie,limit:ze,moreProducts:Le,perPage:Ae,editing:_,contentCapped:Be=!1,hover:Ge,fieldUsage:y,ownerId:He="",template:De,gap:Fe,gapPhone:ke}){const D=g(()=>y?ye(y,"alloy-wheel"):void 0,[y]),Ue=g(()=>y?ye(y,"tyre"):void 0,[y]),e=ct("pg"),{paged:b,per:C,limit:a,cap:u}=Xt({moreProducts:Le,perPage:Ae,limit:ze}),d=Jt(Re,$e,Ie),ie=Be,We=Vt(),je=Yt(),Ke=We||je,F=ir(_===!0&&!!p),s=g(()=>p?tr(nr(p,N,F??v??[])):null,[v,F,p,N]),k=Gt("grid",s),l=s?k.scope:null,f=rr(p),S=f!==null&&!l,{filters:R,reportCount:U,reportLugs:W,reportSizes:j,reportFinishes:K,reportCategories:X,reportPrices:Z,vehicle:se}=Bt(),{currency:h}=Ot(),q=S&&!!R.process&&R.process!==f,Y=l?.state,r=g(()=>s?Y?kt(s,Y,h):S?er(s,R,h,se.fit):s:null,[s,Y,S,R,h,se.fit]),[Xe,Ze]=ge(1),V=b&&r?Math.max(1,Math.ceil(r.length/C)):1,M=Math.min(V,Math.max(1,l?l.state.page:Xe)),{reportShown:J}=k,oe=l!==null;Ht(()=>{if(!oe||!r)return J(null);J(Zt(r.length,{paged:b,per:C,cap:u},M))},[oe,r,J,b,M,C,u]);const qe=n=>l?l.update({page:n}):Ze(n),o=g(()=>r&&(b?r.slice((M-1)*C,M*C):u?r.slice(0,Math.ceil(a)+Kt):r),[b,u,a,r,M,C]);B(()=>(X(e,f===null?[]:[f]),()=>X(e,[])),[f,X,e]),B(()=>{if(S)return U(e,q?0:r?.length??0),()=>U(e,0)},[S,q,r,U,e]);const E=g(()=>({lugs:ar(s??[]),sizes:lr(s??[]),finishes:or(s??[]),prices:Wt((s??[]).filter(n=>G(n)!=="tyre"),h)}),[s,h]);B(()=>(W(e,E.lugs),j(e,E.sizes),K(e,E.finishes),Z(e,E.prices),()=>{W(e,[]),j(e,[]),K(e,[]),Z(e,[])}),[E,W,j,K,Z,e]);const Q=gt("ProductGrid",Fe,"both",ke),Ye=`${e} grid${Q.className} bg-[var(--catalog-grid-bg)] ${d}`,ae=ft(Q),Ve=`${e} grid${ae.className} bg-[var(--catalog-grid-bg)] ${d}`,Je=ae.style,Qe=g(()=>{const n=(r??[]).filter(c=>G(c)!=="tyre");if(n.length===0)return!1;const x=n.some(c=>!!c.process);return n.some(c=>!!c.setWords)||Mt({kind:!1,brand:!1,process:x},D??[])},[r,D]),et=o?o.length>0?t("div",{className:Ve,style:Je,...m("grid"),children:t(xt,{items:o,tyreOf:n=>G(n)==="tyre"?n:null})}):l&&Ut(l.state)?w("div",{className:"flex min-h-[320px] flex-col items-center justify-center gap-4 bg-surface-2 p-4 text-center",...m("grid-empty"),children:[t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:`No ${Ce(Se(p,N)).many} match those filters`}),t(jt,{onClick:l.clear})]}):_?t("div",{className:"flex min-h-[320px] items-center justify-center rounded bg-surface-2 p-4 text-center",...m("grid-empty"),children:t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:mr("No products in “{name}” yet",{name:p?.name??""})})}):null:t(Ne,{className:Ye,style:Q.style,minEmptyHeight:320}),tt=l?l.countInChips:Te,$=r&&!tt?r===s&&!F?Pe??r.length:r.length:null,le=Ce(Se(p,N)),rt=P||H||O||T?w("div",{className:`${sr} 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 ${ie||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))]"}`,...m("grid-head"),children:[w("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:[P&&t("span",{className:`font-mono ${i.labelLarge} leading-none uppercase tracking-[0.22em] text-fg-dim`,...m("grid-number"),children:re(P)}),H&&t("h2",{className:`${ur(_e)} leading-none text-fg max-view-wide:leading-[1] [&>span]:block`,...m("heading"),children:Qt(H,!1)})]}),(O||T||$!==null)&&w("div",{className:"flex items-center gap-5 max-view-wide:gap-3 view-wide:grow view-wide:justify-end",children:[O&&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`,...m("description"),children:re(O)}),T&&w(ut,{href:T.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`,...m("view-all"),children:[re(T.text),t("span",{"aria-hidden":!0,children:"→"})]}),$!==null&&w("span",{className:`whitespace-nowrap font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,...m("count"),children:[$," ",$===1?le.one:le.many]})]})]}):null,I=It(Ee,zt,{noTop:ne}),{paddingTop:nt,...it}=I.style,z=ne?0:nt,st={...z===void 0?{}:{"--pg-pt":typeof z=="number"?`${z}px`:z},...it},L=g(()=>{if(!o)return null;const n=o.map(x=>G(x)!=="tyre"&&Ct(St(x))?2:1);return ve(n,a)?he(d,n,a):null},[o,d,a]),[ot,at]=ge("");B(()=>{if(o)return;const n=document.querySelector(`.${e}`);if(!n)return;const x=()=>{const c=[...n.children].map(pe=>pe.classList.contains("col-span-2")&&!pe.querySelector(yt)?2:1);at(ve(c,a)?xe(e,he(d,c,a,!1),c.length):"")};x();const te=new MutationObserver(x);return te.observe(n,{childList:!0}),()=>te.disconnect()},[o,e,d,a]);const lt=L?L[0].tracks:o?u?Math.min(o.length,a):o.length:void 0,A=L?xe(bt(e),L,o.length)+(u?fe(we(e),a+1):"")+ue(we(e),d,{limit:a,cards:o.length}):ot,me=A?"":ue(e,d,{limit:a,cards:o?.length}),de=wt(e),ce=w(dt,{children:[u&&!A&&t("style",{children:fe(e,a+1)}),A&&t("style",{children:A}),me&&t("style",{children:me}),de&&t("style",{children:de}),rt,et,b&&V>1&&t(Dt,{textSize:Ft.labelSmall,page:M,pageCount:V,onPage:qe}),t(Pt,{editing:_})]});if(q)return null;const ee=t(qt,{rootRef:k.ref,attrs:{...S&&f!==null?{...I.attrs,[At]:f}:I.attrs,...m("product-grid-block")},className:Lt(`relative z-[2] bg-bg px-[var(--sf-site-gutter,40px)] ${Rt} max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] ${$t}`,I),column:null,inAnyBox:!0,style:st,defaults:{"--pg-pt":"120px"},children:ie?t("div",{style:_t(Tt),children:ce}):ce}),mt=s?ee:_?t(Et,{currency:h,children:ee}):t(Nt,{wheels:Oe,currency:h,children:ee});return t(ht,{value:{ownerId:He,Template:De,hover:Ge??gr,imageSizes:vt(d,lt),fieldUsage:D??be,tyreFieldUsage:Ue??be,reserveEyebrow:Qe,editing:_===!0},children:mt})}export{Me as TITLE_SIZES,fr as default};
|
|
@@ -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 p}from"efficient-web-builder/render/components/PhoneMenuTools";import{SectionGroupWidthsProvider as v}from"efficient-web-builder/render/components/SiteGutterFrame";import{chromeOwnWidth as T}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 S,resolveNavTextCase as y}from"../lib/content/header-bar.js";import{HideTaker as P}from"efficient-web-builder/render/components/ViewHideRoot";import{textKindVars as _}from"../lib/content/text-kind-vars.js";import{blockParts as i}from"../lib/block-parts.js";const k=i("SiteHeader")("header-content"),w=i("SiteFooter")("footer"),E={font:"--sf-header-tool-font",size:"--sf-header-tool-size"};function O(o){const e=_(o,E);return Object.keys(e).length?e:null}function R({place:o,sections:e,editing:c=!1,widths:u,navTextCase:f,menuRow:m,toolTextStyle:l}){const h=o==="footer"?"footer":"div",t=T(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"?O(l):null,g=r===null&&a===null&&s===null?void 0:{...a,...r===null?null:{"--sf-site-width":r},...s},d=n(P,{as:h,"data-section-group":o,...o==="header"?{"data-header-nav-case":y(f),"data-header-menu-row":S(m)??"top",...s?{"data-header-tool-style":String(l)}:null}:null,className:c&&o==="footer"?"sf-theme-surfaces bg-bg text-fg":void 0,style:g,...o==="header"?k:w,children:n(v,{value:{background:t.background,content:t.content==="content"?"content":null},children:n(e,{minEmptyHeight:120})})});return o==="header"?n(p,{children:d}):d}export{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as n,jsxs as b}from"react/jsx-runtime";import $ from"next/link";import{useEffect as h}from"react";import{useCart as C}from"../CartContext.js";import g from"../QuoteLink.js";import{NO_HIDE as w,useTakeViewHide as L,withViewHide as S}from"efficient-web-builder/render/components/ViewHideRoot";import{useSiteTakesOrders as _}from"../SiteRecordContext.js";import H from"../wheels-plp/PlpNotifyMeDialog.js";import{DEFAULT_PURCHASE_STATE as E}from"../../lib/catalog/purchase.js";import{ADD_TO_BASKET_ATTR as k}from"../../lib/commerce.js";import{STOCK_WORDS as P}from"../../lib/content/stock-words.js";import{tyreCartLine as z}from"../../lib/tyres/tyre-purchase.js";import{UNPRICED_LABEL as W,priceIn as I,resolveWheelPrice as V}from"../../lib/wheels/price-display.js";import{isOneWheelDesign as j,setLabel as q}from"../../lib/wheels/variants.js";import{splitWheelName as U}from"../../lib/wheels/wheel-name.js";import{CARD_TEXT_SIZE as y,CardButtonRow as O}from"./card-row.js";import{TYRE_BUY_CHIPS_CLASS as F,TyreSizeChips as Y}from"./CardSizes.js";import{useHeroStateOrNull as G,useProductCardStateOrNull as K,useWheelCardState as M}from"./ProductCardState.js";import{blockParts as Q}from"../../lib/block-parts.js";const l=Q("ProductCard"),D="mt-3 flex flex-col gap-2",f=`cursor-pointer bg-btn px-4 py-3 font-mono ${y.labelSmall} font-bold uppercase tracking-[0.24em] text-btn-ink transition-colors hover:bg-fg`,X=`border border-btn px-4 py-3 text-center font-mono ${y.labelSmall} font-bold uppercase tracking-[0.24em] text-btn transition-colors hover:bg-btn hover:text-btn-ink`,Z="View sizes & fitment",J="mt-3 block font-mono text-[length:var(--size-label,11px)] font-bold uppercase tracking-[0.18em] text-accent underline-offset-4 group-hover:underline";function tt({wheel:t,sel:e,price:o,editing:r}){const{addAndOpen:i,warmCatalog:s}=C();h(()=>{r||s(void 0,t.slug)},[r,s,t.slug]);const{arm:c}=e;h(()=>{c()},[c]);function d(){const a=e.selectedVariant;!a||!e.canAdd||o.priced&&(r||i({id:`${t.slug}|${a.finishName}|${a.size}|quick`,slug:t.slug,name:U(t.name),process:t.process,positionNo:"01",config:[{label:a.size},{label:a.finishName,gold:!0},{label:q(a)}],finishName:a.finishName,size:a.size,components:a.components,qty:1}))}return n("button",{type:"button",onClick:d,[k]:"",disabled:!e.canAdd,className:e.canAdd?f:`${f} opacity-80`,...l("button"),children:"Add to basket"})}function et(t,e,o){return j(t)?e.outOfStock?"notify":e.unsellable||!o||e.detailState==="ready"&&!e.canAdd?"choose":"add":"choose"}function rt({state:t,buy:e,page:o}){const{wheel:r,sel:i,price:s,editing:c,setNotifyOpen:d}=t,a=_(),u=et(r,i,s.priced),p=e?u==="notify"?n("button",{type:"button",onClick:()=>d(!0),className:f,...l("button"),children:"Notify me when back"}):u==="add"?a?n(tt,{wheel:r,sel:i,price:s,editing:c}):n(g,{className:f,attrs:l("button")}):null:null,m=!o||p?null:b("span",{"aria-hidden":!0,className:J,...l("page-label"),children:[Z," →"]});return n(O,{children:p||m?b("div",{className:D,children:[p,m]}):null})}function ot({state:t}){const{tyre:e,currency:o,pagePath:r,detail:i,variant:s,canAdd:c,detailReady:d,unsellable:a,editing:u}=t,{addAndOpen:p,warmCatalog:m}=C(),A=_();h(()=>{!u&&A&&m("tyre")},[u,A,m]);const x=V(I(e.prices,o),null).priced;function B(){!i||!s||!c||u||p(z(i,s,E.choice,E.qty))}return b(O,{children:[n("div",{className:F,children:n(Y,{state:t})}),b("div",{className:D,children:[!a&&x&&!A&&n(g,{className:f,attrs:l("button")}),!a&&x&&A&&n("button",{type:"button",onClick:B,[k]:"",disabled:d&&!c,className:c||!d?`${f}${c?"":" opacity-80"}`:`cursor-not-allowed border border-dashed border-accent/50 px-4 py-3 font-mono ${y.labelSmall} font-bold uppercase tracking-[0.24em] text-accent/70`,...l("button"),children:d&&!c?"Select a size":"Add to basket"}),r&&n($,{href:r,className:X,...l("button"),children:"Open product page"})]})]})}const N="px-6 py-4",T="font-mono text-[length:var(--size-label,14px)] font-bold uppercase tracking-[0.32em]",nt=`w-full ${N} ${T}`,at=`w-full cursor-not-allowed border-2 border-dashed border-fg-dim/20 ${N} ${T} text-fg-dim/40`,it=`w-full cursor-pointer bg-btn ${N} text-center ${T} text-btn-ink transition-colors hover:bg-fg`;function R(t,e){return!e||t.isSet&&!t.priced?"quote":t.priced?t.outOfStock?"outOfStock":"add":"unpriced"}function v({buy:t,takesOrders:e,add:o,take:r=w}){const i=R(t,e);return i==="quote"?n(g,{className:S(it,r.className)??"",attrs:r.attrs}):i!=="add"?n("button",{type:"button",disabled:!0,"aria-disabled":!0,className:S(at,r.className),...r.attrs,children:i==="outOfStock"?P.outOfStock:W}):b("button",{type:"button",[k]:"",onClick:()=>{const s=t.lineToAdd();s&&o(s)},"aria-disabled":!t.canAdd,className:S([`${nt} transition-colors`,t.canAdd?"cursor-pointer bg-btn text-btn-ink hover:bg-fg hover:text-bg":"cursor-pointer border-2 border-dashed border-accent/50 text-accent/80 hover:border-accent hover:text-accent"].join(" "),r.className),style:t.canAdd?void 0:{background:"color-mix(in oklab, var(--accent) 6%, transparent)"},...r.attrs,children:["Add to Cart",t.totalLabel!=null?` · ${t.totalLabel}`:""]})}const st=()=>{};function ct({buy:t,take:e}){const{addAndOpen:o}=C();return n(v,{buy:t,takesOrders:!0,add:r=>o(r),take:e})}function dt({buy:t}){const e=_(),o=L();return o.scope(R(t,e)==="add"?n(ct,{buy:t,take:o}):n(v,{buy:t,takesOrders:e,add:st,take:o}))}function lt({buy:t=!0,page:e=!0}){const o=G(),r=K();if(o)return o.buy?n(dt,{buy:o.buy}):null;if(!r)throw new Error("A product card piece was drawn outside a product card (no ProductCardState).");return r.kind==="bundle"?n(O,{}):r.kind==="tyre"?n(ot,{state:r}):n(rt,{state:r,buy:t,page:e})}function Rt(){const{wheel:t,sel:e,editing:o,notifyOpen:r,setNotifyOpen:i}=M();return r?n(H,{wheelName:t.name,productSlug:t.slug,finishName:e.confirmedFinishName,variants:e.outOfStockVariants,initialSize:e.selectedVariant?.size,onClose:()=>i(!1),editing:o}):null}export{Z as CARD_PAGE_WORDS,Rt as CardBuyDialog,v as HeroBuyButton,lt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as r}from"react/jsx-runtime";import{HideTaker as n}from"efficient-web-builder/render/components/ViewHideRoot";import{CARD_TEXT_SIZE as s,CardRow as l,useCatalogCard as d}from"./card-row.js";import{RegionBridge as m,RegionWords as u,regionAttr as p}from"./card-text-region.js";import{blockParts as f}from"../../lib/block-parts.js";const b=f("ProductCard");function g({children:o,reserve:i=!1,region:e}){const t=d(),a=`font-mono ${s.label} uppercase text-accent ${t?"tracking-[0.3em]":"tracking-[0.25em]"}`,c=o?r(n,{...p(e,"eyebrow"),className:a,...b("eyebrow"),children:r(u,{region:e,at:"eyebrow",children:o})}):t&&i?r(n,{"aria-hidden":!0,className:a,children:" "}):null;return r(m,{region:e,sectionType:"ProductEyebrow",children:r(l,{children:c})})}export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as t,jsxs as c}from"react/jsx-runtime";import{HideTaker as s}from"efficient-web-builder/render/components/ViewHideRoot";import{withRMark as u}from"efficient-web-builder/render/components/RMark";import{tyreModelLine as p}from"../../lib/tyres/tyre-brand-name.js";import{CARD_TEXT_SIZE as r,useCatalogCard as f}from"./card-row.js";import{useProductCardStateOrNull as h}from"./ProductCardState.js";import{RegionBridge as g,RegionWords as k,regionAttr as w}from"./card-text-region.js";import{blockParts as x}from"../../lib/block-parts.js";const m=x("ProductCard");function N(e){return e?.kind==="wheel"?e.wheel.name:e?.kind==="bundle"?e.bundle.name:e?.kind==="tyre"?p(e.tyre.brand??"",e.tyre.name):null}function y({children:e,region:a,fixedHeight:l=!0}){const o=f(),n=h(),d=n?.kind==="wheel"?u(n.wheel.name):N(n);e===void 0&&d===null&&process.env.NODE_ENV!=="production"&&console.warn("[CardName] no name given and no wheel card state: the name block is empty");const i=n?.kind==="tyre"?n.tyre.treadPattern?.trim():"";return c(g,{region:a,sectionType:"ProductName",children:[t(s,{...w(a,"name"),className:o&&!l?`font-heading3 ${r.headingSmall2} font-medium uppercase leading-none tracking-[-0.02em]`:o?`mt-2 h-[60px] overflow-hidden break-words [.sf-card-rows_&]:h-auto [.sf-card-rows_&]:max-h-[60px] font-heading3 ${r.headingSmall2} font-medium uppercase leading-none tracking-[-0.02em]`:`mt-2 font-heading3 ${r.headingSmall1} font-medium tracking-[-0.02em]`,...m("product-name"),children:t(k,{region:a,at:"name",children:e??d})}),i?t("div",{className:`sf-card-pattern mt-1 font-mono ${r.labelSmall} uppercase tracking-[0.18em] text-accent`,...m("pattern"),children:i}):null]})}export{N as cardNameWords,y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as b,Fragment as w,jsxs as o}from"react/jsx-runtime";import{CARD_IMAGE_BG_OFF as v,cardImageBackgroundPaints as C,THEME_CARD_IMAGE_BG as g}from"efficient-web-builder/format/lib/content/card-image-background";import{VIEW_LINE_PX as A}from"efficient-web-builder/format/lib/content/view-lines";import{useCatalogCard as E}from"./card-row.js";import{blockParts as h}from"../../lib/block-parts.js";const l=h("ProductCard"),j=e=>`calc((100% - ${typeof e=="number"?`${e}px`:e}) / 2)`,_=2,G=32,f=e=>_+2*G+(e?16:0),x=(e,s)=>s===void 0?`${f(e)}px`:`calc(${s} + ${f(e)-_}px)`,F=252,T=16,M=A["view-wide"];function X({image:e,imageSecond:s,plate:c,wide:a=!1,imageBackgroundFill:r=v,setGridGap:i}){const u=E(),t=C(r),n=t&&r===g,m=n?"bg-[var(--wheel-stage)] p-2":t?"p-2":"",p=t&&!n?{backgroundColor:r}:{},d=P=>b("figure",{className:"m-0 aspect-square [flex:0_0_auto] max-w-full w-[var(--sf-set-plate-w)] max-view-wide:w-full",style:{"--sf-set-plate-w":j(x(t,i))},...l("image-plate"),children:P});return u?o("div",{className:a?`relative mt-2 mb-5 flex items-center justify-center [&_img]:object-top max-view-wide:flex-col ${m}`:`relative mt-2 mb-5 flex aspect-square items-center justify-center overflow-hidden [&_img]:object-top ${m}`,style:a?{...p,borderRadius:10,columnGap:x(t,i),rowGap:T}:{...p,borderRadius:"var(--sf-card-image-radius, 10px)"},...l("image-frame"),children:[a?o(w,{children:[d(e),d(s??e)]}):e,c]}):o("div",{className:"relative mb-5 aspect-square overflow-hidden bg-bg p-8 [&_img]:object-top",style:{borderRadius:"var(--sf-card-image-radius, 10px)"},...l("image-frame"),children:[e,c]})}export{G as CARD_PAD_X_PX,_ as GRID_GAP_PX,F as SET_PLATE_PX,T as SET_STACK_GAP_PX,M as SET_STACK_MAX_PX,X as default,x as setBandGapCss,f as setBandGapPx,j as setPlateWidthCss};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as c,Fragment as
|
|
1
|
+
"use client";import{jsx as r,jsxs as c,Fragment as h}from"react/jsx-runtime";import{formatPrice as k}from"../../lib/commerce.js";import{say as L}from"efficient-web-builder/format/lib/editor-words";import{HideTaker as p}from"efficient-web-builder/render/components/ViewHideRoot";import{setLabel as S}from"../../lib/wheels/variants.js";import{wheelCardPriceLine as x}from"../../lib/wheels/set-mode.js";import{bundlePrice as w,EACH_UNIT as y,formatSelectionPrice as T,formatSelectionWasPrice as C,formatWheelPrice as g,formatWheelWasPrice as _,FROM_PREFIX as b,priceIn as E,resolveWheelPrice as P,SET_QUOTE_LABEL as R}from"../../lib/wheels/price-display.js";import{CARD_TEXT_SIZE as s,CardRow as v}from"./card-row.js";import{RegionBridge as W,RegionWords as z,regionAttr as B}from"./card-text-region.js";import{useHeroStateOrNull as $,useProductCardState as j}from"./ProductCardState.js";import{useTaxNote as N}from"./useTaxNote.js";import{blockParts as F}from"../../lib/block-parts.js";const f=F("ProductCard");function A(e,i){if(e.kind==="tyre"){const a=P(E(e.tyre.prices,e.currency),null);return{was:null,amount:g(a,e.currency,b),note:a.priced?y:null,priced:a.priced}}const{wheel:n,currency:t,price:o,sel:m,isSet:d}=e,l=P(n.prices[t],n.msrpPrices?.[t]),u=i.setTotal&&o.priced&&o.setTotal!=null&&m.selectedVariant?`${S(m.selectedVariant)} · ${k(o.setTotal,t)}`:null;return d&&i.quoteSets?{was:null,amount:l.priced?x(g(l,t,b),!0):R,note:u,priced:l.priced}:{was:i.wasFollowsSize?C(o,t):_(l,t),amount:x(T(o,t),o.priced),note:u,priced:o.priced}}function H({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",...B(i,"price"),children:r(z,{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(W,{region:i,sectionType:"ProductPrice",children:t})}function I({show:e=!0,region:i,...n}){const t=$();return t?r(H,{state:t,region:i}):r(M,{show:e,...n})}function O({state:e,show:i}){if(!i)return null;const n=w(e.bundle,e.currency);return c(h,{children:[n&&c(p,{className:`mt-1 font-mono ${s.labelLarge}`,...f("price"),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:L("Currently unavailable")})]})}function M({show:e=!0,...i}){const n=j(),t=N();if(n.kind==="bundle")return r(O,{state:n,show:e});const{was:o,amount:m,note:d,priced:l}=A(n,i),a=[d,l?t:null].filter(Boolean).join(" · ")||null;return c(h,{children:[r(v,{children:e?c("div",{className:`mt-2 font-mono ${s.labelLarge}`,...f("price"),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`,...f("price-note"),children:a}):null})]})}export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as A,jsxs as E}from"react/jsx-runtime";import{Fragment as
|
|
1
|
+
"use client";import{jsx as e,Fragment as A,jsxs as E}from"react/jsx-runtime";import{Fragment as C}from"react";import{CARD_TEXT_SIZE as x,useCatalogCard as B}from"./card-row.js";import{bundleSaving as D}from"../../lib/commerce.js";import{useProductCardState as v}from"./ProductCardState.js";import{blockParts as N}from"../../lib/block-parts.js";const s=N("ProductCard"),G=`border px-2 py-1 font-mono ${x.labelSmall} uppercase tracking-[0.3em]`,b="absolute right-[18px] top-[18px] z-10",R="absolute left-[18px] top-[18px] z-10",w="absolute left-0 top-4 z-10 pointer-events-none flex flex-col items-start gap-1",T="absolute left-0 top-[52px] z-10 pointer-events-none flex flex-col items-start gap-1",j=`bg-accent px-3 py-2 font-mono ${x.labelSmall} uppercase tracking-[0.24em] text-bg`;function c({tone:a,children:n}){return e("span",{className:[G,a==="solid"?"border-accent bg-accent text-bg":"border-accent text-accent"].join(" "),...s("badge"),children:n})}function k({show:a=!0,sale:n=!1,numbered:l=!1,axleSets:_=!1,edge:f=!1}){const o=v();if(!B()||o.kind==="tyre")return null;if(o.kind==="bundle"){const t=D(o.bundle,o.currency);return t&&f?e(S,{flags:[t]}):t?e("div",{className:`${b} pointer-events-none flex flex-col items-end gap-1`,...s("badges"),children:e(c,{tone:"solid",children:t})}):null}const{wheel:h,price:g,isSet:i}=o,d=i||_?o.setWords:null,r=a?h.badge:null,u=i?e(c,{tone:"solid",children:"Set"}):null,m=[l?u:null,n&&g.onSale?e(c,{tone:"solid",children:"Sale"}):null,d?e(c,{tone:"outline",children:d}):r?e(c,{tone:r==="new"?"solid":"outline",children:r==="new"?"New":"Bestseller"}):null].filter(Boolean);if(f){const t=[i?"Set":null,n&&g.onSale?"Sale":null,d??(r?r==="new"?"New":"Bestseller":null)].filter(p=>!!p);return t.length?e(S,{flags:t,numbered:l}):null}return E(A,{children:[u&&!l&&e("div",{className:`${R} pointer-events-none flex flex-col items-start gap-1`,...s("badges"),children:u}),m.length>0&&e("div",{className:`${b} pointer-events-none flex flex-col items-end gap-1`,...s("badges"),children:m.map((t,p)=>e(C,{children:t},p))})]})}function S({flags:a,numbered:n=!1}){return e("div",{className:n?T:w,...s("badges"),children:a.map(l=>e("span",{className:j,...s("badge"),children:l},l))})}export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as m,Fragment as y}from"react/jsx-runtime";import{parseOption as ae}from"efficient-web-builder/format/lib/parse-option";import $ from"next/image";import{useState as te}from"react";import{HideTaker as v}from"efficient-web-builder/render/components/ViewHideRoot";import{CARD_INDEX_BADGE_CLASS as B,CARD_INDEX_CLASS as E,parseCardIndexFormat as X}from"efficient-web-builder/format/lib/sections/product-card-style";import{CARD_IMAGE_BG_OFF as ne,cardImageBackgroundPaints as K,resolveCardImageBackground as le}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as _}from"efficient-web-builder/format/lib/content/card-image-shape";import{BOX_SWATCH_PROP as oe,boxSwatchFill as ie}from"efficient-web-builder/format/lib/content/box-background";import{useCardRow as se}from"efficient-web-builder/render/components/CardRowContext";import{pictureShadowFilter as ce}from"efficient-easel/screen/lib/document/shadow-values";import{sayCount as me}from"efficient-web-builder/format/lib/editor-words";import{parseSetPicture as de,setSecondSrc as fe}from"../../lib/wheels/set-mode.js";import{coverSrcForWheel as ue,parseCoverIndex as ge,resolvePaintedSrc as he}from"../../lib/wheels/cover-rendering.js";import pe from"../WheelPlaceholder.js";import be from"../BrandPlate.js";import Se from"../TyreImage.js";import{cardSpinOf as we}from"../card-spin.js";import{useCardHoverLayer as ke,useGridCard as I}from"../GridCardTemplate.js";import z from"./CardPicture.js";import j from"./CardProductBadge.js";import{useHeldCardPicture as Ce}from"./useHeldCardPicture.js";import{useProductCardState as Fe}from"./ProductCardState.js";import{blockParts as Pe}from"../../lib/block-parts.js";const i=Pe("ProductCard"),xe=["well","full"],ye="well",R=r=>ae(xe,ye,r);function ve({children:r}){return e("div",{className:"h-full w-full transition-transform duration-500 motion-safe:group-hover:scale-[1.03]",children:r})}function G({fill:r,badge:a,children:s}){const d=K(r);return m("div",{className:`sf-card-image relative aspect-[4/3] overflow-hidden${d?"":" bg-surface"}`,style:d?{backgroundColor:r}:void 0,...i("image-frame"),children:[s,a]})}function T(r,a){const s=se();return ie({[oe]:r},s?.row)??le(a,ne)}function _e(r){const a=Fe();return a.kind==="bundle"?e(Ne,{state:a,...r}):a.kind==="tyre"?e(Ae,{state:a,...r}):a.kind!=="wheel"?null:e($e,{state:a,...r})}function Ne({state:r,imageBackground:a,cardImage:s,showBadge:d,frame:S,swatch:u}){const{bundle:n}=r,{imageSizes:g}=I(),f=R(S)==="full",h=n.components.length,p=n.image?f?e($,{alt:n.name,src:n.image,fill:!0,sizes:g,className:"object-cover",draggable:!1,...i("image")}):e($,{alt:n.name,src:n.image,width:1e3,height:1e3,sizes:g,className:"block h-full w-full object-cover",draggable:!1,...i("image")}):e("div",{className:"flex h-full w-full items-center justify-center font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.3em] text-fg-dim",children:me("{n} piece","{n} pieces",h,{})}),l=e(ve,{children:p}),t=T(u,a),b=d!==!1?e(j,{edge:f}):null;return e(v,{style:_(s),...i("image-block"),children:f?e(G,{fill:t,badge:b,children:l}):m(y,{children:[b,e(z,{image:l,imageBackgroundFill:t})]})})}function Ae({state:r,imageBackground:a,cardImage:s,indexBadge:d,frame:S,swatch:u}){const{tyre:n}=r,{imageSizes:g}=I(),f=T(u,a),h=X(d),p=h!=="off"?e("span",{"aria-hidden":!0,"data-format":h,className:`${E} ${B}`,...i("card-number")}):null,l=e(Se,{image:n.image,className:"h-full w-full",sizes:g,showBackground:!1}),t=e(be,{brand:n.brand,logo:n.brandLogo});return e(v,{style:_(s),...i("image-block"),children:R(S)==="full"?m(G,{fill:f,badge:p,children:[l,t]}):m(y,{children:[p,e(z,{image:l,imageBackgroundFill:f,plate:t})]})})}function $e({state:r,imageBackground:a,cardImage:s,coverIndex:d,indexBadge:S,showBadge:u,frame:n,setPicture:g,swatch:f,shadow:h,shadowColor:p}){const{wheel:l,sel:t,isSet:b}=r,{hover:Z,imageSizes:D,fit:q,rules:k,setGridGap:J}=I(),C=we(Z),Q=ue(l,ge(d),t.finish?.name,t.shownSrc,q?.holes),[L,V]=te(()=>new Set),O=o=>{t.pictureFailed(o),V(w=>w.has(o)?w:new Set(w).add(o))},H=he({overrideSrc:Q,hookSrc:t.shownSrc,failed:L}),W=l.rendersHaveAlpha===!0?ce(h,p):null,Y=W?{...C.style,filter:W}:C.style,N=(o,w)=>e($,{alt:w,src:o,width:1e3,height:1e3,sizes:D,className:`block h-full w-full object-contain ${C.className}`,style:Y,draggable:!1,onError:()=>O(o),...i("image")},o),ee=t.finish?`${l.name} — ${t.finish.name}`:l.name,F=b&&de(g)==="pair",re=F?fe(l.finishes?.find(o=>o.name===t.finish?.name),H):null,c=Ce({src:H,second:re,alt:ee,sizes:D,failed:L,onFailed:O,near:t.nearScreen,holdEmpty:t.awaitingProbe}),M=m(y,{children:[c.src?N(c.src,c.alt):e(pe,{imageLabel:l.name,spin:C}),c.trial]}),A=X(S),P=A!=="off",x=T(f,a),U=ke("picture",K(x)?x:void 0);if(R(n)==="full"){const o=m(y,{children:[P?e("span",{"aria-hidden":!0,"data-format":A,className:`${E} ${B}`,...i("card-number")}):null,e(j,{show:u!==!1,numbered:P,sale:k.sale,axleSets:k.axleSets,edge:!0})]});return e(v,{style:_(s),"data-set-picture":b&&!F?"one":void 0,...i("image-block"),children:m(G,{fill:x,badge:o,children:[m("div",{className:"flex h-full w-full items-center justify-center",children:[M,c.second?N(c.second,`${c.alt} — right`):null]}),U]})})}return m(v,{style:_(s),"data-set-picture":b&&!F?"one":void 0,...i("image-block"),children:[P?e("span",{"aria-hidden":!0,"data-format":A,className:`${E} ${B}`,...i("card-number")}):null,e(j,{show:u!==!1,numbered:P,sale:k.sale,axleSets:k.axleSets}),e(z,{image:M,imageSecond:c.second?N(c.second,`${c.alt} — right`):void 0,wide:F,imageBackgroundFill:x,setGridGap:J,plate:U})]})}export{ye as DEFAULT_PICTURE_FRAME,xe as PICTURE_FRAMES,_e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as _,jsx as t}from"react/jsx-runtime";import{Fragment as N}from"react";import{CARD_TEXT_SIZE as
|
|
1
|
+
"use client";import{jsxs as _,jsx as t}from"react/jsx-runtime";import{Fragment as N}from"react";import{CARD_TEXT_SIZE as g,CardControlRow as P}from"./card-row.js";import{useProductCardState as b}from"./ProductCardState.js";import{blockParts as k}from"../../lib/block-parts.js";const S=k("ProductCard"),v="mt-3 @container",y="flex h-[26px] items-center overflow-hidden",u=`font-mono ${g.labelSmall} tracking-[0.08em]`,E=`shrink-0 border border-line px-2 py-0.5 ${u} text-fg-dim`,$=`shrink-0 border px-2 py-0.5 ${u} whitespace-nowrap`,R=`shrink-0 overflow-hidden ${u} whitespace-nowrap`,I="ml-1",H=4,L=18;function f(n,c,i){const a=n.slice(0,c),l=i-c,p=a.reduce((o,r)=>o+r.length,0)+(l>0?`+${l}`.length:0),d=a.length+(l>0?1:0),h=d-1;return`(${p} * (1ch + 0.08em) + ${d*L+h*H+1}px)`}const w=n=>`max(0px, calc((100cqw - ${n}) * 999))`,T=n=>`max(0px, calc((${n} - 100cqw) * 999))`,F=`${$} border-accent/60 text-accent`,D=n=>["cursor-pointer transition-colors",$,n?"border-accent bg-accent text-bg":"border-accent/60 text-accent hover:border-accent hover:bg-accent/10"].join(" "),j="data-card-size-part",Y="[.sf-card:has([data-card-size-part])_&]:hidden";function B({state:n,shown:c=2}){const{tyre:i,variants:a,detailReady:l,chosen:p,setSize:d}=n,h=l&&a.length>0,o=h?a.map(e=>e.size):i.sizes,r=o.slice(0,c);return _("div",{...S("sizes"),children:[i.fitSize&&_("p",{className:`font-mono ${g.labelSmall} font-medium uppercase tracking-[0.14em] text-green`,children:["Fits · ",i.fitSize]}),t("div",{className:v,children:_("div",{className:y,children:[r.map((e,m)=>{const s=h?t("button",{type:"button",title:e,"aria-label":e,"aria-pressed":p===e,onClick:()=>d(e),className:D(p===e),...S("size"),children:e}):t("span",{className:F,...S("size"),children:e});return m===0?t(N,{children:s},e):t("span",{className:R,style:{maxWidth:w(f(r,m+1,o.length))},children:t("span",{className:`inline-flex ${I}`,children:s})},e)}),r.map((e,m)=>{const s=m+1,A=o.length-s;if(A<=0)return null;const x=s>1?w(f(r,s,o.length)):null,C=s<r.length?T(f(r,s+1,o.length)):null,z=x&&C?`min(${x}, ${C})`:x??C??"none";return t("span",{className:R,style:{maxWidth:z},children:t("span",{className:`inline-flex ${I}`,children:_("span",{className:E,children:["+",A]})})},`more-${s}`)})]})})]})}function X({shown:n=2}){const c=b();return c.kind!=="tyre"?t(P,{}):t(P,{children:t("div",{[j]:"",children:t(B,{state:c,shown:n})})})}export{F as CARD_CHIP_CLASS,y as CARD_CHIP_LINE_CLASS,E as CARD_CHIP_MORE_CLASS,v as CARD_CHIP_ROW_CLASS,$ as CARD_CHIP_SHAPE_CLASS,j as SIZE_PART_ATTR,Y as TYRE_BUY_CHIPS_CLASS,B as TyreSizeChips,f as chipRowNeed,X as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as n,Fragment as l,jsxs as m}from"react/jsx-runtime";import{Fragment as u}from"react";import{HideTaker as f}from"efficient-web-builder/render/components/ViewHideRoot";import{applyCardAnswers as h,keepForCard as x}from"../../lib/content/field-usage.js";import{formatSizeRange as g}from"../../lib/wheels/size-range.js";import{wheelCardSpecFacts as C}from"../../lib/wheels/plp-fitment-match.js";import{CARD_TEXT_SIZE as p,useCatalogCard as S}from"./card-row.js";import{useProductCardState as _}from"./ProductCardState.js";import{blockParts as $}from"../../lib/block-parts.js";const w=$("ProductCard"),k="whitespace-nowrap",F=e=>typeof e=="string"?e:e.text,z=/^(.*\S) (\+\d+ more)$/;function L(e,r="·"){return e.map((o,a)=>{const t=F(o),i=typeof o!="string"&&o.accent,s=`${k}${i?" text-accent":""}`,d=a<e.length-1?`${t} ${r}`:t,c=z.exec(t);return m(u,{children:[c?m(l,{children:[n("span",{className:s,children:c[1]})," ",n("span",{className:s,children:a<e.length-1?`${c[2]} ${r}`:c[2]})]}):n("span",{className:s,children:d}),a<e.length-1?" ":null]},t)})}function j({children:e}){const r=S();return n(f,{className:r?`mt-2 h-[38px] overflow-hidden [.sf-card-rows_&]:h-auto [.sf-card-rows_&]:max-h-[76px] font-mono ${p.labelLarge} leading-[19px] tracking-[0.14em] text-fg-dim`:`mt-[4px] font-mono ${p.labelLarge} tracking-[0.1em] text-fg-dim`,...w("specs"),children:e})}function D({sizes:e=!1,car:r=null,separator:o,fieldUsage:a=[]}){const t=_();if(t.kind==="tyre")return n(l,{children:E(t.tyre,a)});if(t.kind!=="wheel")return null;const i=h(C(t.wheel,r,{sizes:e}),a).map(s=>s.text);return n(l,{children:L(i,o)})}function E(e,r){const o=x(r);return[e.sizes.length>0?`${e.sizes.length} ${e.sizes.length===1?"size":"sizes"}`:null,o("rim_diameter")?g(e.rimDiameters):null].filter(Boolean).join(" · ")}function N(e){return n(j,{children:n(D,{...e})})}export{k as CARD_SPEC_FIELD_CLASS,D as CardSpecFacts,j as CardSpecLine,L as cardSpecFields,N as default,E as tyreSpecLine};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as p,jsxs as d}from"react/jsx-runtime";import T from"next/link";import{HideTaker as S}from"efficient-web-builder/render/components/ViewHideRoot";import{PHOTO_HOST_ATTR as L}from"efficient-web-builder/format/lib/content/image-treatment";import{BOX_LINK_ATTR as N,BOX_LINK_CLASS as O,BOX_LINKED_CLASS as j}from"efficient-web-builder/format/lib/content/box-link";import{blockParts as x}from"../../lib/block-parts.js";const s=x("ProductCard");function B({surface:e,span:n,href:r,label:c,linked:i=!0,probes:l,arm:o,layer:t,children:m}){const a=i&&!!r,u=[e,a?j:"",n??""].filter(Boolean).join(" "),f=o?{onPointerEnter:o,onTouchStart:o,onFocusCapture:o}:{},_=t?{[L]:""}:{};return d(S,{as:"article",className:u,..._,...f,...s("card"),children:[l,a?p(T,{href:r,"aria-label":c,className:O,[N]:"",...s("card-link")}):null,m,t]})}export{B as default};
|