efficient-storefront-blocks 0.130.0 → 0.130.2
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 +28 -0
- package/dist/editor/lib/header-settings-source.d.ts +3 -1
- package/dist/editor/lib/header-settings-source.js +1 -1
- package/dist/index.js +25 -25
- package/dist/render/components/CompatibleTyres.js +1 -1
- package/dist/render/components/Header.d.ts +5 -1
- package/dist/render/components/Header.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicRelatedProducts.js +1 -1
- package/dist/render/lib/document/blocks/commerce/BundleOffer/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/CompatibleTyres/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/RelatedProducts/meta.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as h}from"react/jsx-runtime";import I from"./SectionBand.js";import{SPEC_TABLE_BAND as x}from"../lib/sections/spec-table-band.js";import{useScopeClass as L}from"../lib/use-scope-class.js";import O from"efficient-web-builder/render/components/SectionHeader";import z from"./SectionFootnote.js";import B from"./TyreCard.js";import D from"./ViewMoreLink.js";import{renderGold as T,renderHeadline as F}from"efficient-web-builder/render/components/goldPhrases";import{useCurrency as P}from"./CurrencyContext.js";import{tyrePagePath as R}from"../lib/tyres/tyre-page-path.js";import{TYRE_ILLUSTRATION_NOTE as H}from"../lib/wheels/tyre-render.js";import{cardImageShapeTokens as $}from"efficient-web-builder/format/lib/content/card-image-shape";import{DEFAULT_CARD_INDEX_FORMAT as U,cardIndexCss as Y}from"efficient-web-builder/format/lib/sections/product-card-style";import{say as G}from"efficient-web-builder/format/lib/editor-words";function b({frameClassName:i,omitHead:t,style:o,children:n}){return i!==void 0?e("section",{className:i,style:o,children:n}):e(I,{className:t?x.ownBox:x.inline,style:o,children:n})}const m={2:"grid grid-cols-2 gap-2 max-view-tablet:grid-cols-1",3:"grid grid-cols-3 gap-2 max-view-desktop:grid-cols-2 max-view-tablet:grid-cols-1",4:"grid grid-cols-4 gap-2 max-view-desktop:grid-cols-2 max-view-tablet:grid-cols-1"};function V({num:i,title:t,description:o,tyres:n,footnote:k,footnoteLinkText:w,footnoteLinkHref:y,viewMore:s,editing:N=!1,frameClassName:d,omitHead:a=!1,columns:f=3,cardImage:S,outline:_,indexBadge:C}){const{currency:v,formatPrice:E}=P(),l=n??[],p=L("ct"),u=C??U,c=Y(p,u),j=l.some(r=>!r.image),A=[k,j?H:null].filter(Boolean).join(" "),g=a?null:e(O,{num:i!=null?T(i):void 0,title:t!=null?F(t,!1):void 0,description:o!=null?T(o):void 0,accent:!0});return l.length===0?N?h(b,{frameClassName:d,omitHead:a,children:[g,e("p",{className:"border-t border-line py-6 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:G("No compatible tyres found for this wheel’s sizes yet — tyres appear automatically when a matching size is active and priced in the catalog.")})]}):null:h(b,{frameClassName:d,omitHead:a,style:$(S),children:[c&&e("style",{children:c}),g,e("div",{className:`${c?`${p} `:""}${(Object.hasOwn(m,f)?m[f]:void 0)??m[3]}`,children:l.map(r=>e(B,{outline:_,showIndex:u!=="off",size:r.size,specs:r.specs,prices:r.prices,image:r.image,inStock:r.inStock,href:R(r.slug),currency:v,formatPrice:E},r.sku))}),s&&e("div",{className:"mt-10 flex",children:e(D,{href:s.href,label:s.label})}),e(z,{text:A,linkText:w,linkHref:y})]})}export{V as default};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { type HeaderCall } from "./HeaderCallButton.js";
|
|
2
2
|
import { type HeaderSettings } from "../lib/api/index.js";
|
|
3
3
|
import type { PreviewHeaderSettings } from "efficient-web-builder/render/components/PreviewHeaderContext";
|
|
4
|
+
type HeaderBorder = {
|
|
5
|
+
borderThickness?: number | null;
|
|
6
|
+
};
|
|
4
7
|
export default function Header({ previewSettings, initialSettings, editorPreview, showThemeToggle, wordmark, hideLogo, hideMenu, siteName, commerceEnabled, }?: {
|
|
5
|
-
previewSettings?: PreviewHeaderSettings & HeaderCall;
|
|
8
|
+
previewSettings?: PreviewHeaderSettings & HeaderCall & HeaderBorder;
|
|
6
9
|
initialSettings?: HeaderSettings | null;
|
|
7
10
|
editorPreview?: boolean;
|
|
8
11
|
showThemeToggle?: boolean;
|
|
@@ -12,3 +15,4 @@ export default function Header({ previewSettings, initialSettings, editorPreview
|
|
|
12
15
|
siteName?: string;
|
|
13
16
|
commerceEnabled?: boolean;
|
|
14
17
|
}): import("react").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,Fragment as I,jsxs as l}from"react/jsx-runtime";import ne from"next/link";import{usePathname as Je}from"next/navigation";import{useCallback as qe,useEffect as oe,useRef as Qe,useState as v}from"react";import{rootIsDark as Ze,watchRootTheme as et}from"efficient-shell/format";import{useCart as tt}from"./CartContext.js";import{useSearch as nt}from"./SearchContext.js";import ot,{useCountrySelectShows as rt}from"./CountrySelect.js";import{resolveCountryShowAs as lt}from"../lib/content/country-show-as.js";import re from"./HeaderNavItem.js";import at from"efficient-web-builder/render/components/Logo";import{siteLengthCss as st}from"efficient-web-builder/format/lib/content/css-length";import it from"./MenuPlaceholderLabel.js";import{withRMark as le}from"efficient-web-builder/render/components/RMark";import{AccountButton as ct,CartButton as dt,SearchButton as mt}from"./HeaderTools.js";import ut from"./HeaderCallButton.js";import{useHeaderBar as ht}from"./useHeaderBar.js";import{useHeaderAtTopIsDark as ft}from"./useHeaderAtTopIsDark.js";import{useModalDismiss as pt}from"./useModalDismiss.js";import gt from"./ThemeToggle.js";import{products as bt}from"../lib/api/index.js";import{shouldFetchPublicHeaderSettings as xt}from"../lib/header-settings-fetch.js";import{menuDropdownAside as vt}from"../lib/menu-link.js";import{HEADER_MENU_PLACEHOLDER_COUNT as yt}from"../lib/content/menu-placeholder.js";import{DEFAULT_SWITCH_SHOWN as wt}from"efficient-web-builder/format/lib/theme";import{chromeWidthStyle as St,resolveChromeWidth as Nt}from"efficient-web-builder/format/lib/content/page-width";import{headerThemeWrap as kt}from"../lib/content/header-theme.js";import{headerSolidBackground as Pt,isProductPage as Et,resolveMenuRow as It,resolveNavTextCase as Tt,resolveUtilStyle as $t}from"../lib/content/header-bar.js";import{surfaceIsLight as Ct}from"../lib/logo/surface-is-light.js";import{HEADER_HEIGHT_PX as Lt,HEADER_MENU_GAP_PX as _t,HEADER_SET_HEIGHT_CSS as Ht}from"efficient-web-builder/render/lib/document/header-clearance";import{HEADER_INK_OVERRIDE_ATTR as Rt,resolveHeaderInkMode as At}from"efficient-web-builder/render/lib/document/header-ink";const ae={stacked:{grid:"hidden min-[1501px]:grid",flex:"hidden min-[1501px]:flex"},inline:{grid:"hidden view-tablet:grid",flex:"hidden view-tablet:flex"}},Dt=Array.from({length:yt},()=>({href:"#",label:r(it,{})}));function Ut({previewSettings:f,initialSettings:T,editorPreview:$,showThemeToggle:se,wordmark:ie,hideLogo:ce,hideMenu:de,siteName:C,commerceEnabled:p=!0}={}){const me=Je(),B=Et(me),[c,y]=v(!1),{open:ue,totals:he}=tt(),{open:fe}=nt(),[L,pe]=v(!1),[ge,be]=v(null),[xe,ve]=v(null),[t,ye]=v(T??null),n=f??(t?{logoUrl:t.logoUrl,reverseLogo:t.reverseLogo,logoReversed:t.logoReversed,logoInkIsDark:t.logoInkIsDark,logoPosition:t.logoPosition,logoSize:t.logoSize,logoSizePx:t.logoSizePx,logoSizeUnit:t.logoSizeUnit??null,menuItems:(t.menuItems??[]).map(e=>({label:e.label,url:e.url,dropdown_menu:null,dropdown_items:e.dropdownItems??[],dropdown_aside:e.dropdownAside??null})),menuSplit:t.menuSplit??3,menuPosition:t.menuPosition,menuRow:t.menuRow,menuGapPx:t.menuGapPx??null,menuGapUnit:t.menuGapUnit??null,searchEnabled:t.searchEnabled,searchPosition:t.searchPosition,searchRow:t.searchRow,countrySelectorEnabled:t.countrySelectorEnabled,countrySelectorShowAs:t.countrySelectorShowAs,countryUrls:t.countryUrls,accountEnabled:t.accountEnabled,cartEnabled:t.cartEnabled,utilStyle:t.utilStyle,navTextCase:t.navTextCase,lightReverseText:t.lightReverseText,topTextColor:t.topTextColor,transparentTop:t.transparentTop,surface:t.surface,theme:t.theme,width:t.width,heightPx:t.heightPx,sticky:t.sticky,callButton:t.callButton,callPhone:t.callPhone,callHref:t.callHref}:null),we=ce?null:n?.logoUrl??null,Se=n?.reverseLogo??!1,Ne=n?.logoReversed??null,ke=n?.logoInkIsDark??null,i=n?.logoPosition??"center",Pe=n?.logoSize??"medium",Ee=n?.logoSizePx??null,Ie=n?.logoSizeUnit??null,G=Math.min(Math.max(n?.menuSplit??3,1),4),Te=(n?.menuPosition??"left")==="center",$e=(n?.menuPosition??"left")==="beside",F=It(n?.menuRow)==="inline",_=n?.menuGapPx??null,Ce=_!=null?{gap:st(_,n?.menuGapUnit,"gap",_t)??`${_}px`}:void 0,w=F?ae.inline:ae.stacked,Le=n?.searchEnabled??!1,W=n?.searchPosition??"right",_e=n?.countrySelectorEnabled??!0,He=lt(n?.countrySelectorShowAs),H=n?.accountEnabled??!0,Re=n?.cartEnabled??!0,R=$t(n?.utilStyle)==="text",a=`mono-eyebrow${Tt(n?.navTextCase)==="capitalised"?" mono-eyebrow-plain":""}`,V=n?.countryUrls??{},Ae=Nt(n?.width),De=St(Ae)??void 0,Ue=n?.heightPx??Lt.default,K=n?.sticky??"always",A=At(n?.topTextColor),m=kt(n?.theme),S=Object.keys(V),X=rt(S.length?S:void 0),g=_e?r(ot,{countries:S.length?S:void 0,urls:f?void 0:V,showAs:He}):null,{headerRef:b,scrolled:Y,navHidden:je}=ht({stickyMode:K,heightPx:Ue}),ze=m?JSON.stringify(m.style):null;oe(()=>{const e=b.current?.ownerDocument??document,o=e.defaultView??window,E=te=>te?Ct(o.getComputedStyle(te).getPropertyValue("--bg")):null,O=()=>{pe(!Ze({doc:e,whenUnset:!0})),be(E(e.body)),ve(E(b.current))};O();const Ye=et(O,{doc:e}),ee=new MutationObserver(O);return e.body&&ee.observe(e.body,{attributes:!0,attributeFilter:["style"]}),()=>{Ye(),ee.disconnect()}},[b,ze]);const x=se??wt?r(gt,{}):null;oe(()=>{if(!xt({editorPreview:!!$,hasPreviewSettings:!!f,hasInitialSettings:!!T}))return;let e=!1;return bt.getHeaderSettings().then(o=>!e&&ye(o)).catch(o=>{console.warn("[header] settings fetch failed; using built-in defaults",o)}),()=>{e=!0}},[$,f,T]);const N=Y||B,J=Pt(L,B),q=ft(b,A),Me=N||!q,Oe=N?xe??L:(ge??L)&&!q,Be=A==="auto"?null:{[Rt]:A},Ge=qe(()=>y(!1),[]),D=Qe(null);pt({active:c,onDismiss:Ge,focusRef:D,trapRef:D});const d=(e,o,E="start")=>r(re,{item:e,dropdownAlign:E},o),Fe=!de&&(n?.menuItems?.length??0)>0,k=!!$||!!f,s=Fe?n.menuItems.map(e=>({href:e.url||"",label:le(e.label),plainLabel:e.label,dropdownItems:(e.dropdown_items??[]).map(o=>({href:o.url||"",label:le(o.label),plainLabel:o.label,description:o.description,image:o.image,badge:o.badge})),dropdownAside:vt(e.dropdown_aside)})):k?Dt.map(e=>({...e,plainLabel:"Menu item",dropdownItems:[]})):[],We=s.length>0||p&&H||!!g&&X||!!x,Ve=i==="center"?s.slice(0,G):i==="right"?s:[],Ke=i==="center"?s.slice(G):i==="left"?s:[],P=Le&&p?r(mt,{onClick:k?void 0:fe,asText:R}):null,U=p&&H?r(ct,{asText:R}):null,j=e=>p&&Re?r(dt,{onClick:ue,count:he.sets,asText:R,className:e}):null,Xe=n?.callPhone??"",Q=n?.callHref??"",z=e=>n?.callButton&&(Q||k)?r(ut,{href:k?"":Q,label:e?"Call":Xe||"Call"}):null,u=l(I,{children:[W==="left"?P:null,g,x,U,j(),W==="right"?P:null,z(!1)]}),M=(e,o=!1)=>r(ne,{href:"/","aria-label":C?`${C} home`:"Home",className:e,children:r(at,{variant:"header",scrolled:Me,src:we,reverse:Se,onLightSurface:Oe,reversedSrc:Ne,inkIsDark:ke,size:Pe,sizePx:Ee,sizeUnit:Ie,wordmark:ie,siteName:C,fitToContainer:o})}),h=M("inline-flex shrink-0 items-center justify-center"),Z="flex min-w-0 flex-1 items-center overflow-x-clip [container-type:inline-size]";return l(I,{children:[r("header",{ref:b,"data-scrolled":Y||void 0,...Be,className:["sf-site-header",...m?[m.className]:[],K==="none"?"absolute":"fixed","inset-x-0 top-0 z-50","flex items-center","px-[var(--sf-site-gutter,40px)] max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]",N?"border-b border-line backdrop-blur-md":"border-b border-transparent","transition-[background,border-color,transform] duration-300 ease-out"].join(" "),style:{...m?m.style:null,minHeight:Ht,...je?{transform:"translateY(-100%)"}:null,...N?{background:J,color:"var(--fg)","--sf-header-ground":J}:{color:"var(--sf-header-overlay-fg)","--sf-header-ground":"var(--sf-header-overlay-ground)"}},children:l("div",{className:"w-full",style:De,children:[Te?l("div",{"data-header-band":"",className:`${w.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[i==="right"?r("nav",{className:`${a} flex items-center gap-8`,children:u}):r("div",{className:"flex items-center",children:h}),r("nav",{className:`${a} flex items-center justify-center gap-8`,children:s.map((e,o)=>d(e,`${e.href}-${o}`,"center"))}),i==="right"?r("div",{className:"flex items-center justify-end",children:h}):r("nav",{className:`${a} flex items-center justify-end gap-8`,children:u})]}):i==="center"?l("div",{"data-header-band":"",className:`${w.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[r("nav",{className:`${a} flex items-center gap-8`,children:Ve.map((e,o)=>d(e,`${e.href}-${o}`))}),h,l("nav",{className:`${a} flex items-center justify-end gap-8`,children:[Ke.map((e,o)=>d(e,`${e.href}-${o}`,"end")),u]})]}):$e?l("div",{"data-header-band":"",className:`${w.flex} items-center justify-between gap-8`,children:[l("div",{className:"flex items-center gap-8",style:Ce,children:[h,r("nav",{className:`${a} flex items-center gap-8`,children:s.map((e,o)=>d(e,`${e.href}-${o}`))})]}),r("nav",{className:`${a} flex items-center justify-end gap-8`,children:u})]}):r("div",{"data-header-band":"",className:`${w.flex} items-center justify-between gap-8`,children:i==="right"?l(I,{children:[l("nav",{className:`${a} flex items-center gap-8`,children:[s.map((e,o)=>d(e,`${e.href}-${o}`)),u]}),h]}):l(I,{children:[h,l("nav",{className:`${a} flex items-center gap-8`,children:[s.map((e,o)=>d(e,`${e.href}-${o}`)),u]})]})}),!F&&l("div",{"data-header-band":"",className:"hidden view-tablet:max-[1501px]:flex flex-col gap-3",children:[l("div",{className:"flex items-center justify-between",children:[M(Z,!0),l("div",{className:`${a} flex shrink-0 items-center gap-5`,children:[P,g,x,U,j(),z(!1)]})]}),r("nav",{className:`${a} flex items-center gap-6 border-t border-line/60 pt-3`,children:s.map((e,o)=>d(e,`${e.href}-${o}`))})]}),l("div",{"data-header-phone":"",className:"hidden max-view-tablet:flex items-center justify-between",children:[M(Z,!0),l("div",{className:"flex shrink-0 items-center gap-4",children:[P,U,j(a),z(!0),We&&l("button",{type:"button","aria-label":c?"Close menu":"Open menu","aria-expanded":c,onClick:()=>y(e=>!e),className:"flex h-11 w-11 flex-col items-center justify-center gap-2",children:[r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"translate-y-[3px] rotate-45":""}`}),r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"opacity-0":""}`}),r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"-translate-y-[3px] -rotate-45":""}`})]})]})]})]})}),c&&l("div",{ref:D,role:"dialog","aria-modal":"true","aria-label":"Menu",tabIndex:-1,"data-header-phone-menu":"",className:"fixed inset-x-0 top-0 bottom-0 z-40 hidden flex-col gap-8 overflow-y-auto bg-bg px-6 pt-24 pb-10 max-view-tablet:flex",children:[s.map((e,o)=>r(re,{item:e,mobile:!0,onNavigate:()=>y(!1)},`${e.href}-${o}`)),l("div",{className:"mt-auto flex flex-col gap-4 border-t border-line pt-6",children:[p&&H&&l("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),r(ne,{href:"/account",onClick:()=>y(!1),className:"mono-eyebrow underline",children:"Your account"})]}),g&&X&&l("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),g]}),x&&l("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),x]})]})]})]})}export{Ut as default};
|
|
1
|
+
"use client";import{jsx as r,Fragment as E,jsxs as s}from"react/jsx-runtime";import oe from"next/link";import{usePathname as Qe}from"next/navigation";import{useCallback as Ze,useEffect as re,useRef as et,useState as v}from"react";import{rootIsDark as tt,watchRootTheme as nt}from"efficient-shell/format";import{useCart as ot}from"./CartContext.js";import{useSearch as rt}from"./SearchContext.js";import st,{useCountrySelectShows as lt}from"./CountrySelect.js";import{resolveCountryShowAs as at}from"../lib/content/country-show-as.js";import se from"./HeaderNavItem.js";import it from"efficient-web-builder/render/components/Logo";import{siteLengthCss as ct}from"efficient-web-builder/format/lib/content/css-length";import dt from"./MenuPlaceholderLabel.js";import{withRMark as le}from"efficient-web-builder/render/components/RMark";import{AccountButton as mt,CartButton as ut,SearchButton as ht}from"./HeaderTools.js";import ft from"./HeaderCallButton.js";import{useHeaderBar as pt}from"./useHeaderBar.js";import{useHeaderAtTopIsDark as gt}from"./useHeaderAtTopIsDark.js";import{useModalDismiss as bt}from"./useModalDismiss.js";import xt from"./ThemeToggle.js";import{products as vt}from"../lib/api/index.js";import{shouldFetchPublicHeaderSettings as yt}from"../lib/header-settings-fetch.js";import{menuDropdownAside as wt}from"../lib/menu-link.js";import{HEADER_MENU_PLACEHOLDER_COUNT as St}from"../lib/content/menu-placeholder.js";import{DEFAULT_SWITCH_SHOWN as kt}from"efficient-web-builder/format/lib/theme";import{chromeWidthStyle as Nt,resolveChromeWidth as Pt}from"efficient-web-builder/format/lib/content/page-width";import{headerThemeWrap as Tt}from"../lib/content/header-theme.js";import{headerSolidBackground as Et,isProductPage as It,resolveMenuRow as $t,resolveNavTextCase as Ct,resolveUtilStyle as Lt}from"../lib/content/header-bar.js";import{surfaceIsLight as _t}from"../lib/logo/surface-is-light.js";import{HEADER_HEIGHT_PX as Ht,HEADER_MENU_GAP_PX as Rt,HEADER_SET_HEIGHT_CSS as At}from"efficient-web-builder/render/lib/document/header-clearance";import{HEADER_INK_OVERRIDE_ATTR as Dt,resolveHeaderInkMode as Ut}from"efficient-web-builder/render/lib/document/header-ink";const ae={stacked:{grid:"hidden min-[1501px]:grid",flex:"hidden min-[1501px]:flex"},inline:{grid:"hidden view-tablet:grid",flex:"hidden view-tablet:flex"}},Mt=Array.from({length:St},()=>({href:"#",label:r(dt,{})}));function jt({previewSettings:f,initialSettings:I,editorPreview:$,showThemeToggle:ie,wordmark:ce,hideLogo:de,hideMenu:me,siteName:C,commerceEnabled:p=!0}={}){const ue=Qe(),B=It(ue),[c,y]=v(!1),{open:he,totals:fe}=ot(),{open:pe}=rt(),[L,ge]=v(!1),[be,xe]=v(null),[ve,ye]=v(null),[t,we]=v(I??null),n=f??(t?{logoUrl:t.logoUrl,reverseLogo:t.reverseLogo,logoReversed:t.logoReversed,logoInkIsDark:t.logoInkIsDark,logoPosition:t.logoPosition,logoSize:t.logoSize,logoSizePx:t.logoSizePx,logoSizeUnit:t.logoSizeUnit??null,menuItems:(t.menuItems??[]).map(e=>({label:e.label,url:e.url,dropdown_menu:null,dropdown_items:e.dropdownItems??[],dropdown_aside:e.dropdownAside??null})),menuSplit:t.menuSplit??3,menuPosition:t.menuPosition,menuRow:t.menuRow,menuGapPx:t.menuGapPx??null,menuGapUnit:t.menuGapUnit??null,searchEnabled:t.searchEnabled,searchPosition:t.searchPosition,searchRow:t.searchRow,countrySelectorEnabled:t.countrySelectorEnabled,countrySelectorShowAs:t.countrySelectorShowAs,countryUrls:t.countryUrls,accountEnabled:t.accountEnabled,cartEnabled:t.cartEnabled,utilStyle:t.utilStyle,navTextCase:t.navTextCase,lightReverseText:t.lightReverseText,topTextColor:t.topTextColor,transparentTop:t.transparentTop,surface:t.surface,theme:t.theme,width:t.width,heightPx:t.heightPx,borderThickness:t.borderThickness??null,sticky:t.sticky,callButton:t.callButton,callPhone:t.callPhone,callHref:t.callHref}:null),Se=de?null:n?.logoUrl??null,ke=n?.reverseLogo??!1,Ne=n?.logoReversed??null,Pe=n?.logoInkIsDark??null,i=n?.logoPosition??"center",Te=n?.logoSize??"medium",Ee=n?.logoSizePx??null,Ie=n?.logoSizeUnit??null,G=Math.min(Math.max(n?.menuSplit??3,1),4),$e=(n?.menuPosition??"left")==="center",Ce=(n?.menuPosition??"left")==="beside",F=$t(n?.menuRow)==="inline",_=n?.menuGapPx??null,Le=_!=null?{gap:ct(_,n?.menuGapUnit,"gap",Rt)??`${_}px`}:void 0,w=F?ae.inline:ae.stacked,_e=n?.searchEnabled??!1,W=n?.searchPosition??"right",He=n?.countrySelectorEnabled??!0,Re=at(n?.countrySelectorShowAs),H=n?.accountEnabled??!0,Ae=n?.cartEnabled??!0,R=Lt(n?.utilStyle)==="text",l=`mono-eyebrow${Ct(n?.navTextCase)==="capitalised"?" mono-eyebrow-plain":""}`,V=n?.countryUrls??{},De=Pt(n?.width),Ue=Nt(De)??void 0,Me=n?.heightPx??Ht.default,K=Math.round(n?.borderThickness??1),je=Number.isFinite(K)?Math.min(Math.max(K,0),20):1,X=n?.sticky??"always",A=Ut(n?.topTextColor),m=Tt(n?.theme),S=Object.keys(V),Y=lt(S.length?S:void 0),g=He?r(st,{countries:S.length?S:void 0,urls:f?void 0:V,showAs:Re}):null,{headerRef:b,scrolled:J,navHidden:ze}=pt({stickyMode:X,heightPx:Me}),Oe=m?JSON.stringify(m.style):null;re(()=>{const e=b.current?.ownerDocument??document,o=e.defaultView??window,T=ne=>ne?_t(o.getComputedStyle(ne).getPropertyValue("--bg")):null,O=()=>{ge(!tt({doc:e,whenUnset:!0})),xe(T(e.body)),ye(T(b.current))};O();const qe=nt(O,{doc:e}),te=new MutationObserver(O);return e.body&&te.observe(e.body,{attributes:!0,attributeFilter:["style"]}),()=>{qe(),te.disconnect()}},[b,Oe]);const x=ie??kt?r(xt,{}):null;re(()=>{if(!yt({editorPreview:!!$,hasPreviewSettings:!!f,hasInitialSettings:!!I}))return;let e=!1;return vt.getHeaderSettings().then(o=>!e&&we(o)).catch(o=>{console.warn("[header] settings fetch failed; using built-in defaults",o)}),()=>{e=!0}},[$,f,I]);const k=J||B,q=Et(L,B),Q=gt(b,A),Be=k||!Q,Ge=k?ve??L:(be??L)&&!Q,Fe=A==="auto"?null:{[Dt]:A},We=Ze(()=>y(!1),[]),D=et(null);bt({active:c,onDismiss:We,focusRef:D,trapRef:D});const d=(e,o,T="start")=>r(se,{item:e,dropdownAlign:T},o),Ve=!me&&(n?.menuItems?.length??0)>0,N=!!$||!!f,a=Ve?n.menuItems.map(e=>({href:e.url||"",label:le(e.label),plainLabel:e.label,dropdownItems:(e.dropdown_items??[]).map(o=>({href:o.url||"",label:le(o.label),plainLabel:o.label,description:o.description,image:o.image,badge:o.badge})),dropdownAside:wt(e.dropdown_aside)})):N?Mt.map(e=>({...e,plainLabel:"Menu item",dropdownItems:[]})):[],Ke=a.length>0||p&&H||!!g&&Y||!!x,Xe=i==="center"?a.slice(0,G):i==="right"?a:[],Ye=i==="center"?a.slice(G):i==="left"?a:[],P=_e&&p?r(ht,{onClick:N?void 0:pe,asText:R}):null,U=p&&H?r(mt,{asText:R}):null,M=e=>p&&Ae?r(ut,{onClick:he,count:fe.sets,asText:R,className:e}):null,Je=n?.callPhone??"",Z=n?.callHref??"",j=e=>n?.callButton&&(Z||N)?r(ft,{href:N?"":Z,label:e?"Call":Je||"Call"}):null,u=s(E,{children:[W==="left"?P:null,g,x,U,M(),W==="right"?P:null,j(!1)]}),z=(e,o=!1)=>r(oe,{href:"/","aria-label":C?`${C} home`:"Home",className:e,children:r(it,{variant:"header",scrolled:Be,src:Se,reverse:ke,onLightSurface:Ge,reversedSrc:Ne,inkIsDark:Pe,size:Te,sizePx:Ee,sizeUnit:Ie,wordmark:ce,siteName:C,fitToContainer:o})}),h=z("inline-flex shrink-0 items-center justify-center"),ee="flex min-w-0 flex-1 items-center overflow-x-clip [container-type:inline-size]";return s(E,{children:[r("header",{ref:b,"data-scrolled":J||void 0,...Fe,className:["sf-site-header",...m?[m.className]:[],X==="none"?"absolute":"fixed","inset-x-0 top-0 z-50","flex items-center","px-[var(--sf-site-gutter,40px)] max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]",k?"border-solid border-line backdrop-blur-md":"border-solid border-transparent","transition-[background,border-color,transform] duration-300 ease-out"].join(" "),style:{...m?m.style:null,minHeight:At,borderBottomWidth:`${je}px`,...ze?{transform:"translateY(-100%)"}:null,...k?{background:q,color:"var(--fg)","--sf-header-ground":q}:{color:"var(--sf-header-overlay-fg)","--sf-header-ground":"var(--sf-header-overlay-ground)"}},children:s("div",{className:"w-full",style:Ue,children:[$e?s("div",{"data-header-band":"",className:`${w.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[i==="right"?r("nav",{className:`${l} flex items-center gap-8`,children:u}):r("div",{className:"flex items-center",children:h}),r("nav",{className:`${l} flex items-center justify-center gap-8`,children:a.map((e,o)=>d(e,`${e.href}-${o}`,"center"))}),i==="right"?r("div",{className:"flex items-center justify-end",children:h}):r("nav",{className:`${l} flex items-center justify-end gap-8`,children:u})]}):i==="center"?s("div",{"data-header-band":"",className:`${w.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[r("nav",{className:`${l} flex items-center gap-8`,children:Xe.map((e,o)=>d(e,`${e.href}-${o}`))}),h,s("nav",{className:`${l} flex items-center justify-end gap-8`,children:[Ye.map((e,o)=>d(e,`${e.href}-${o}`,"end")),u]})]}):Ce?s("div",{"data-header-band":"",className:`${w.flex} items-center justify-between gap-8`,children:[s("div",{className:"flex items-center gap-8",style:Le,children:[h,r("nav",{className:`${l} flex items-center gap-8`,children:a.map((e,o)=>d(e,`${e.href}-${o}`))})]}),r("nav",{className:`${l} flex items-center justify-end gap-8`,children:u})]}):r("div",{"data-header-band":"",className:`${w.flex} items-center justify-between gap-8`,children:i==="right"?s(E,{children:[s("nav",{className:`${l} flex items-center gap-8`,children:[a.map((e,o)=>d(e,`${e.href}-${o}`)),u]}),h]}):s(E,{children:[h,s("nav",{className:`${l} flex items-center gap-8`,children:[a.map((e,o)=>d(e,`${e.href}-${o}`)),u]})]})}),!F&&s("div",{"data-header-band":"",className:"hidden view-tablet:max-[1501px]:flex flex-col gap-3",children:[s("div",{className:"flex items-center justify-between",children:[z(ee,!0),s("div",{className:`${l} flex shrink-0 items-center gap-5`,children:[P,g,x,U,M(),j(!1)]})]}),r("nav",{className:`${l} flex items-center gap-6 border-t border-line/60 pt-3`,children:a.map((e,o)=>d(e,`${e.href}-${o}`))})]}),s("div",{"data-header-phone":"",className:"hidden max-view-tablet:flex items-center justify-between",children:[z(ee,!0),s("div",{className:"flex shrink-0 items-center gap-4",children:[P,U,M(l),j(!0),Ke&&s("button",{type:"button","aria-label":c?"Close menu":"Open menu","aria-expanded":c,onClick:()=>y(e=>!e),className:"flex h-11 w-11 flex-col items-center justify-center gap-2",children:[r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"translate-y-[3px] rotate-45":""}`}),r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"opacity-0":""}`}),r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"-translate-y-[3px] -rotate-45":""}`})]})]})]})]})}),c&&s("div",{ref:D,role:"dialog","aria-modal":"true","aria-label":"Menu",tabIndex:-1,"data-header-phone-menu":"",className:"fixed inset-x-0 top-0 bottom-0 z-40 hidden flex-col gap-8 overflow-y-auto bg-bg px-6 pt-24 pb-10 max-view-tablet:flex",children:[a.map((e,o)=>r(se,{item:e,mobile:!0,onNavigate:()=>y(!1)},`${e.href}-${o}`)),s("div",{className:"mt-auto flex flex-col gap-4 border-t border-line pt-6",children:[p&&H&&s("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),r(oe,{href:"/account",onClick:()=>y(!1),className:"mono-eyebrow underline",children:"Your account"})]}),g&&Y&&s("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),g]}),x&&s("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),x]})]})]})]})}export{jt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as $}from"react/jsx-runtime";import
|
|
1
|
+
"use client";import{jsx as e,jsxs as $}from"react/jsx-runtime";import A from"../SectionBand.js";import{useScopeClass as q}from"../../lib/use-scope-class.js";import{useEffect as J,useState as Q}from"react";import{cardHoverOf as Y}from"efficient-web-builder/format/lib/animation/hover";const ee=Y({},"ProductGrid");import re from"../CompatibleTyres.js";import{cardRowsGrid as te,GridBundleCards as oe,GridCardProvider as ne,GridCards as le,gridIndexCss as se}from"../GridCardTemplate.js";import{productGridColumnsClass as ie}from"../../lib/sections/product-grid-columns.js";import{containerGapProps as H}from"efficient-web-builder/format/lib/content/container-gap";import{SPEC_TABLE_BAND as S}from"../../lib/sections/spec-table-band.js";import{cardImageShapeTokens as M}from"efficient-web-builder/format/lib/content/card-image-shape";import{NO_FIELD_ANSWERS as ae}from"../../lib/content/field-usage.js";import{gridClassImageSizes as de}from"../../lib/sections/card-image-sizes.js";import{fillRowCss as ce}from"../../lib/sections/fill-row.js";import pe from"efficient-web-builder/render/components/SectionHeader";import ue from"../ViewMoreLink.js";import{useSiteMenuLinks as me}from"../catalog/SiteMenuLinks.js";import{renderGold as O,renderHeadline as fe}from"efficient-web-builder/render/components/goldPhrases";import he from"./KindGate.js";import{loadProductCatalog as ge}from"../useProductCatalog.js";import{PLP_KINDS as be}from"../../lib/catalog/plp-item.js";import{relatedCardCount as we,relatedViewMore as ye}from"../../lib/catalog/related-cards.js";import{answersWithProducts as j,DEFAULT_RELATIONSHIP as xe,relationshipApplies as K,relationshipByKey as Ce}from"../../lib/catalog/relationships.js";import{useCurrentProduct as ke}from"../../lib/document/current-product.js";import{PLACEHOLDER_RELATED as W}from"../../lib/wheels/placeholder-wheel.js";import{say as v}from"efficient-web-builder/format/lib/editor-words";const z={label:"text-[length:var(--size-label,13px)]"},Ee=be;function Pe(o){return e(he,{kinds:Ee,type:"RelatedProducts",editing:o.editing,children:e(Se,{...o})})}function Se({num:o,title:r,description:s,columns:d=3,cardCount:N,relationship:L=xe,footnote:w,footnoteLinkText:y,footnoteLinkHref:G,editing:n=!1,omitHead:a=!1,hover:R,ownerId:T="",template:c,cardImage:i,outline:p,indexBadge:x,columnsPhone:m,columnsTablet:C,gap:k,gapPhone:E}){const f={columns:d,columnsPhone:m,columnsTablet:C,gap:k,gapPhone:E,hover:R,ownerId:T,template:c,editing:n,omitHead:a},l=ke(),U=me(),P=we(N),t=Ce(L),I=t?j(t):!1,[Z,D]=Q([]);if(J(()=>{if(l||!n||!I)return;let u=!1;return ge().then(b=>{const X=b.length>0?b:W;u||D(X)}).catch(()=>{u||D(W)}),()=>{u=!0}},[l,n,I]),!t)return null;const h=a?null:e(pe,{num:o?O(o):void 0,title:fe(r||t.heading,!1),description:s?O(s):void 0,accent:!0});if(!j(t)){if(l&&!K(t,l.product.kind))return n?e(V,{relationship:t,cardImage:i}):null;const u=l?t.resolve(l.product,l.relatedWheels):null,b=u?.kind==="bundle"?u.bundles.slice(0,P):[];return b.length===0?n?e(F,{header:h,omitHead:a,cardImage:i,words:v("Bundles containing this product appear here on a product page.")}):null:e(B,{header:h,cards:{bundles:b},...f})}const _=ye(t,U);if(!l)return n?e(B,{header:h,cards:{wheels:Z.slice(0,P)},viewMore:_,...f}):null;if(!K(t,l.product.kind))return n?e(V,{relationship:t,cardImage:i}):null;const g=t.resolve(l.product,l.relatedWheels);return g.kind==="tyre"?e(re,{omitHead:a,columns:d,cardImage:i,outline:p,indexBadge:x,num:o,title:r||t.heading,description:s,tyres:[...g.tyres].slice(0,P),footnote:w,footnoteLinkText:y,footnoteLinkHref:G,viewMore:_,editing:n}):g.kind!=="alloy-wheel"?null:g.wheels.length===0?n?e(F,{header:h,omitHead:a,cardImage:i,words:v("Related products appear here on a product page.")}):null:e(B,{header:h,cards:{wheels:[...g.wheels].slice(0,P)},viewMore:_,...f})}function V({relationship:o,cardImage:r}){return e(A,{className:"border-b border-line py-14 max-view-desktop:py-10",style:M(r),children:e("p",{className:`font-mono ${z.label} uppercase tracking-[0.18em] text-fg-dim`,children:v("“{relationship}” does not apply to this product. It is hidden on the live page.",{relationship:v(o.label)})})})}function F({header:o,omitHead:r,cardImage:s,words:d}){return $(A,{className:r?S.ownBox:S.inline,style:M(s),children:[o,e("p",{className:`border-t border-line py-6 font-mono ${z.label} uppercase tracking-[0.18em] text-fg-dim`,children:d})]})}function B({header:o,cards:r,viewMore:s,columns:d,columnsPhone:N,columnsTablet:L,gap:w,gapPhone:y,hover:G,ownerId:n,template:a,editing:R,omitHead:T}){const c=q("rp"),i="wheels"in r?r.wheels.length:r.bundles.length;if(i===0)return null;const p=ie(d,N,L),x="bundles"in r,m=x?H("ProductGrid",w,"both",y):te(H("ProductGrid",w,"both",y)),C=se(c),k=ce(c,p,{cards:i}),E=f=>e("div",{className:x?`${c} mt-10 grid${m.className} ${p}`:`${c} grid${m.className} bg-[var(--catalog-grid-bg)] ${p}`,style:m.style,children:f});return $(A,{className:T?S.ownBox:S.inline,children:[C&&e("style",{children:C}),k&&e("style",{children:k}),o,e(ne,{value:{ownerId:n,Template:a,hover:G??ee,imageSizes:de(p,i),fieldUsage:ae,reserveEyebrow:!1,editing:R},children:"wheels"in r?e(le,{wheels:r.wheels,children:E}):e(oe,{bundles:r.bundles,children:E})}),s?e("div",{className:"mt-10 flex",children:e(ue,{href:s.href,label:s.label})}):null]})}export{Se as RelatedProductsBody,Pe as default,Ee as supportedKinds};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ProductGridSlots as t}from"../ProductGrid/meta.js";import{
|
|
1
|
+
import{ProductGridSlots as t}from"../ProductGrid/meta.js";import{BAND_120_OWN as e}from"../../../../content/block-own-pads.js";const r={ownPad:e,label:"Bundle Products",fields:{template:t.template},defaultProps:{num:"",title:"",description:"",columns:3}};export{r as BundleOfferMeta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PH as o}from"efficient-web-builder/format/lib/document/blocks/placeholders";import{
|
|
1
|
+
import{PH as o}from"efficient-web-builder/format/lib/document/blocks/placeholders";import{BAND_120_OWN as t}from"../../../../content/block-own-pads.js";const i={num:o.sectionNumber,title:"Compatible *tyres.*",description:o.body,footnote:"Tyres shown are fitment-matched companions.",footnoteLinkText:"Enquire about tyres"},r={ownPad:t,label:"Compatible Tyres",defaultProps:{num:"",title:"",description:"",footnote:"",footnoteLinkText:"",footnoteLinkHref:""}};export{i as COMPATIBLETYRES_PH,r as CompatibleTyresMeta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{RELATED_CARDS_DEFAULT as t}from"../../../../catalog/related-cards.js";import{DEFAULT_RELATIONSHIP as o}from"../../../../catalog/relationships.js";import{ProductGridSlots as r}from"../ProductGrid/meta.js";import{
|
|
1
|
+
import{RELATED_CARDS_DEFAULT as t}from"../../../../catalog/related-cards.js";import{DEFAULT_RELATIONSHIP as o}from"../../../../catalog/relationships.js";import{ProductGridSlots as r}from"../ProductGrid/meta.js";import{BAND_120_OWN as e}from"../../../../content/block-own-pads.js";const a={ownPad:e,label:"Related Products",fields:{template:r.template},defaultProps:{num:"",title:"",description:"",cardCount:t,columns:3,relationship:o}};export{a as RelatedProductsMeta};
|