efficient-storefront-blocks 0.125.10 → 0.125.11

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.
@@ -4339,3 +4339,43 @@ em.text-accent {
4339
4339
  color-mix(in oklab, var(--bg) 89%, var(--fg)) 100%
4340
4340
  );
4341
4341
  }
4342
+
4343
+ /* ─── "Words: Over the picture" (Product Grid; INOVIT /wheels design 2026-11-18) ───
4344
+ The card's words sit at the foot of the card, on the picture's ground,
4345
+ and the wheel sits in the space above them. A choice of the grid
4346
+ (GridCardTemplate `CARD_WORDS`); the default "Under the picture" never
4347
+ draws this class, so no card that exists moves.
4348
+ What a merchant already sets stays theirs: the card's shape is the card
4349
+ box's Shape row (10:13 on the new inovit.com), the words' distance from
4350
+ the card's edges is the card box's Padding row (24, 12 on a phone), and
4351
+ the space between the wheel and the words is its Gap row.
4352
+ The words never cover the wheel: the picture box takes the height the
4353
+ words leave, and the wheel is at most that tall. Long words make the wheel
4354
+ smaller; they never draw over it. The wheel's width is the one value
4355
+ below; a merchant cannot change it yet. It is not the design file's 77%:
4356
+ the design's wheel pictures carry an empty margin, and this site's wheel
4357
+ pictures fill their frame, so 64% draws the same wheel size on the card.
4358
+ The boxes are found by what they hold, not by their names: the picture box
4359
+ holds the Picture part (`data-part="image-block"`), and the words box is
4360
+ its sibling. */
4361
+ .sf-card-words-over {
4362
+ --sf-card-wheel-width: 90%;
4363
+ }
4364
+ .sf-card-words-over :has(> [data-part="box"] > * > [data-part="image-block"]) {
4365
+ justify-content: flex-end;
4366
+ }
4367
+ .sf-card-words-over [data-part="box"]:has(> * > [data-part="image-block"]) {
4368
+ flex: 1 1 0;
4369
+ min-height: 0;
4370
+ container-type: size;
4371
+ }
4372
+ .sf-card-words-over [data-part="box"]:has(> * > [data-part="image-block"]) > * {
4373
+ height: 100%;
4374
+ justify-content: flex-end;
4375
+ }
4376
+ .sf-card-words-over [data-part="image-block"] {
4377
+ width: min(var(--sf-card-wheel-width), 100cqh);
4378
+ }
4379
+ .sf-card-words-over [data-part="image-block"] [data-part="image-frame"] {
4380
+ margin: 0;
4381
+ }
@@ -46,6 +46,7 @@ export interface GridCardValues {
46
46
  setGridGap?: string;
47
47
  rules?: GridCardRules;
48
48
  ground?: CardGround;
49
+ words?: CardWords;
49
50
  }
50
51
  export declare const CARD_GROUNDS: readonly [{
51
52
  readonly label: "Flat";
@@ -56,6 +57,16 @@ export declare const CARD_GROUNDS: readonly [{
56
57
  }];
57
58
  export type CardGround = (typeof CARD_GROUNDS)[number]["value"];
58
59
  export declare const cardGroundOf: (v: unknown) => CardGround;
60
+ export declare const CARD_WORDS: readonly [{
61
+ readonly label: "Under the picture";
62
+ readonly value: "under";
63
+ }, {
64
+ readonly label: "Over the picture";
65
+ readonly value: "over";
66
+ }];
67
+ export type CardWords = (typeof CARD_WORDS)[number]["value"];
68
+ export declare const cardWordsOf: (v: unknown) => CardWords;
69
+ export declare const CARD_WORDS_OVER_CLASS = "sf-card-words-over";
59
70
  export type GridCardRead = Required<Omit<GridCardValues, "setGridGap">> & Pick<GridCardValues, "setGridGap">;
60
71
  export declare function useGridCard(): GridCardRead;
61
72
  export declare function GridCardProvider({ value, children }: {
@@ -1 +1 @@
1
- "use client";import{jsx as t,Fragment as g,jsxs as A}from"react/jsx-runtime";import{createContext as E,useContext as G,useMemo as h}from"react";import{parseOption as D}from"efficient-shell/format";import{CardRowContext as L,CardTemplateRows as p,useCardRow as N}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as k}from"efficient-web-builder/render/components/SiteGutterFrame";import{SECTION_FILL_PASS_CLASS as F}from"efficient-web-builder/format/lib/content/section-min-height";import{cardHoverOf as U}from"efficient-web-builder/format/lib/animation/hover";import{pickHoverMedia as $}from"efficient-web-builder/format/lib/content/hover-media";import j from"efficient-web-builder/render/components/HoverMediaLayer";import{NO_FIELD_ANSWERS as x}from"../lib/content/field-usage.js";import{CARD_IMAGE_SIZES as W}from"../lib/sections/card-image-sizes.js";import{productTone as B,productToneVaried as H,randomCardColour as b}from"../lib/sections/card-tone.js";import{CardLookContext as C}from"./card-pieces/card-row.js";import{CardBuyDialog as M}from"./card-pieces/CardBuyButton.js";import z from"./card-pieces/CardSurfaceFrame.js";import{BundleCardStateProvider as V,TyreCardStateProvider as q,useProductCardState as v,useWheelCardState as R,WheelCardStateProvider as Y,tyreCardProduct as K}from"./card-pieces/ProductCardState.js";import{tyrePagePath as X}from"../lib/tyres/tyre-page-path.js";import{say as J}from"efficient-web-builder/format/lib/editor-words";import{CARD_INDEX_OPTIONS as Q,cardIndexCss as Z}from"efficient-web-builder/format/lib/sections/product-card-style";import{SHARED_ROWS_LIST_CLASS as ee}from"efficient-web-builder/render/lib/content/box-shared-columns";import{GAP_ZONE_CLASS as re}from"efficient-web-builder/format/lib/content/container-gap";import{CARD_ROWS_GRID_CLASS as oe,cardRowsGap as te,cardRowsGridStyle as ne}from"./WheelCardFrame.js";import{blockParts as ae}from"../lib/block-parts.js";const se=ae("ProductCard");function qe(e){return Q.map(({value:r})=>r==="off"?"":Z(e,r).replace(".sf-card-index::before",`.sf-card-index[data-format="${r}"]::before`)).join("")}function Ye(e){return e.className.includes(re)?{className:`${e.className} ${oe} ${ee}`,style:{...e.style,...ne(te(e))}}:e}const de={sale:!1,axleSets:!0,setTotal:!1,wasFollowsSize:!1,quoteSets:!0,showSingle:!1,armOnContact:!1},Ke={sale:!0,axleSets:!1,setTotal:!0,wasFollowsSize:!0,quoteSets:!1,showSingle:!0,armOnContact:!0},le={kindLabel:null,brand:!1,process:!0,tyreBrand:!0},ie=[],ce=[{label:"Flat",value:"flat"},{label:"Soft grey",value:"soft"}],Xe=e=>D(ce.map(r=>r.value),"flat",e),T={ownerId:"",ownerType:"ProductGrid",Template:void 0,hover:U({},"ProductGrid"),imageSizes:W,fieldUsage:x,tyreFieldUsage:x,reserveEyebrow:!1,editing:!1,eyebrow:le,fit:null,colours:ie,rules:de,ground:"flat"},_=E(T);function u(){return G(_)}function Je({value:e,children:r}){const o=h(()=>({...T,...ue(e)}),[e]);return t(_.Provider,{value:o,children:r})}const ue=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:B(r),colourVaried:H(r,o),colourRandom:b(o)}}function me(e){const r=e.designCode||e.slug||"";return{name:e.name??"",eyebrow:e.brand??"",note:"",href:X(e.slug)??"",colour:"",colourVaried:"",colourRandom:b(r)}}const I=e=>`/bundles/${e.slug}`;function fe(e){return{name:e.name,eyebrow:"",note:e.subtitle??"",href:I(e),colour:"",colourVaried:"",colourRandom:""}}const P="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)]",pe="sf-card group relative flex flex-col border border-line bg-bg transition-colors hover:border-accent",Ce="col-span-2 max-view-wide:col-span-1 @max-[720px]:col-span-1 [&:has([data-set-picture=one])]:col-span-1",we=`relative flex-1 ${F}`;function y({copy:e,href:r,label:o,wide:n=!1,kit:a=!1,probes:s,arm:m,layer:i}){const{editing:l,ground:d}=u();return t(z,{surface:a?pe:d==="soft"?`${P} sf-card-ground-soft`:P,span:n?Ce:void 0,href:r,label:o,linked:!l,probes:s,arm:m,layer:i,children:t("div",{className:we,...se("card-content"),children:t(k,{children:e})})})}const ye="var(--card-bg)";function Se(e,r=ye){const{hover:o}=u(),n=v();if(o.kind!=="nextImage"||o.media?.cover!==e||n.kind!=="wheel")return null;const a=$(n.wheel,o.media,n.sel.finish?.name);return a?t(j,{media:a,name:n.wheel.name,cover:e,ground:r}):null}function ge({children:e}){const r=N(),{wheel:o,sel:n}=R(),a=n.finish?.color,s=h(()=>r?{...r,row:w(o,a)}:null,[r,o,a]);return s?t(L.Provider,{value:s,children:e}):t(g,{children:e})}function he({copy:e}){const{wheel:r,sel:o,isSet:n}=R(),{rules:a}=u(),s=Se("card");return A(g,{children:[t(y,{copy:t(ge,{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(M,{})]})}function O(e,r,o,n){const a=r.item;return t(Y,{wheel:a,colours:o.colours,defaultFinish:n?.[r.index],editing:o.editing,children:t(C.Provider,{value:"catalog",children:t(he,{copy:e})})})}function Qe({wheels:e,finishes:r,children:o}){const n=u(),{ownerId:a,ownerType:s,Template:m,editing:i}=n;return t(p,{ownerId:a,ownerType:s,Template:m,rows:e.map(l=>w(l)),items:e,fallback:i?t(S,{}):null,wrapCopy:(l,d)=>O(l,d,n,r),children:o})}function Ze({items:e,tyreOf:r,tyreFit:o}){const n=u(),{ownerId:a,ownerType:s,Template:m,editing:i}=n,l=e.map(d=>r(d));return t(p,{ownerId:a,ownerType:s,Template:m,rows:e.map((d,f)=>{const c=l[f];return c?me(c):w(d)}),items:e,fallback:i?t(S,{}):null,wrapCopy:(d,f)=>{const c=l[f.index];return c?be(d,K(c,o?.(c)??null),i):O(d,f,n)},children:d=>d})}function xe({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 be(e,r,o){return t(q,{tyre:r,editing:o,children:t(C.Provider,{value:"catalog",children:t(xe,{copy:e})})})}function ve(e,r){const o=r.item;return t(V,{bundle:o,children:t(C.Provider,{value:"catalog",children:t(y,{copy:e,href:I(o),label:o.name,kit:!0})})})}function er({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(fe),items:e,fallback:s?t(S,{}):null,wrapCopy:ve,children:r})}function S(){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:J("The card is empty. Add parts to its card template in Layers.")})}export{ce as CARD_GROUNDS,de as GRID_CARD_RULES,er as GridBundleCards,Je as GridCardProvider,Qe as GridCards,Ze as GridMixedCards,Ke as LISTING_CARD_RULES,fe as bundleCardRow,I as bundlePagePath,Xe as cardGroundOf,Ye as cardRowsGrid,qe as gridIndexCss,w as productCardRow,me as tyreCardRow,Se as useCardHoverLayer,u as useGridCard};
1
+ "use client";import{jsx as t,Fragment as h,jsxs as A}from"react/jsx-runtime";import{createContext as D,useContext as E,useMemo as x}from"react";import{parseOption as g}from"efficient-shell/format";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 N}from"efficient-web-builder/format/lib/content/section-min-height";import{cardHoverOf as F}from"efficient-web-builder/format/lib/animation/hover";import{pickHoverMedia as U}from"efficient-web-builder/format/lib/content/hover-media";import W from"efficient-web-builder/render/components/HoverMediaLayer";import{NO_FIELD_ANSWERS as v}from"../lib/content/field-usage.js";import{CARD_IMAGE_SIZES as j}from"../lib/sections/card-image-sizes.js";import{productTone as $,productToneVaried as B,randomCardColour as b}from"../lib/sections/card-tone.js";import{CardLookContext as C}from"./card-pieces/card-row.js";import{CardBuyDialog as H}from"./card-pieces/CardBuyButton.js";import M from"./card-pieces/CardSurfaceFrame.js";import{BundleCardStateProvider as V,TyreCardStateProvider as z,useProductCardState as R,useWheelCardState as _,WheelCardStateProvider as q,tyreCardProduct as Y}from"./card-pieces/ProductCardState.js";import{tyrePagePath as K}from"../lib/tyres/tyre-page-path.js";import{say as X}from"efficient-web-builder/format/lib/editor-words";import{CARD_INDEX_OPTIONS as J,cardIndexCss as Q}from"efficient-web-builder/format/lib/sections/product-card-style";import{SHARED_ROWS_LIST_CLASS as Z}from"efficient-web-builder/render/lib/content/box-shared-columns";import{GAP_ZONE_CLASS as ee}from"efficient-web-builder/format/lib/content/container-gap";import{CARD_ROWS_GRID_CLASS as re,cardRowsGap as oe,cardRowsGridStyle as te}from"./WheelCardFrame.js";import{blockParts as ne}from"../lib/block-parts.js";const ae=ne("ProductCard");function Ke(e){return J.map(({value:r})=>r==="off"?"":Q(e,r).replace(".sf-card-index::before",`.sf-card-index[data-format="${r}"]::before`)).join("")}function Xe(e){return e.className.includes(ee)?{className:`${e.className} ${re} ${Z}`,style:{...e.style,...te(oe(e))}}:e}const se={sale:!1,axleSets:!0,setTotal:!1,wasFollowsSize:!1,quoteSets:!0,showSingle:!1,armOnContact:!1},Je={sale:!0,axleSets:!1,setTotal:!0,wasFollowsSize:!0,quoteSets:!1,showSingle:!0,armOnContact:!0},de={kindLabel:null,brand:!1,process:!0,tyreBrand:!0},le=[],ie=[{label:"Flat",value:"flat"},{label:"Soft grey",value:"soft"}],Qe=e=>g(ie.map(r=>r.value),"flat",e),ce=[{label:"Under the picture",value:"under"},{label:"Over the picture",value:"over"}],Ze=e=>g(ce.map(r=>r.value),"under",e),ue="sf-card-words-over",T={ownerId:"",ownerType:"ProductGrid",Template:void 0,hover:F({},"ProductGrid"),imageSizes:j,fieldUsage:v,tyreFieldUsage:v,reserveEyebrow:!1,editing:!1,eyebrow:de,fit:null,colours:le,rules:se,ground:"flat",words:"under"},O=D(T);function m(){return E(O)}function er({value:e,children:r}){const o=x(()=>({...T,...me(e)}),[e]);return t(O.Provider,{value:o,children:r})}const me=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:$(r),colourVaried:B(r,o),colourRandom:b(o)}}function fe(e){const r=e.designCode||e.slug||"";return{name:e.name??"",eyebrow:e.brand??"",note:"",href:K(e.slug)??"",colour:"",colourVaried:"",colourRandom:b(r)}}const I=e=>`/bundles/${e.slug}`;function pe(e){return{name:e.name,eyebrow:"",note:e.subtitle??"",href:I(e),colour:"",colourVaried:"",colourRandom:""}}const Ce="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)]",we="sf-card group relative flex flex-col border border-line bg-bg transition-colors hover:border-accent",Se="col-span-2 max-view-wide:col-span-1 @max-[720px]:col-span-1 [&:has([data-set-picture=one])]:col-span-1",ye=`relative flex-1 ${N}`;function S({copy:e,href:r,label:o,wide:n=!1,kit:a=!1,probes:s,arm:f,layer:c}){const{editing:l,ground:d,words:u}=m(),i=[d==="soft"?"sf-card-ground-soft":"",u==="over"?ue:""].filter(Boolean);return t(M,{surface:a?we:[Ce,...i].join(" "),span:n?Se:void 0,href:r,label:o,linked:!l,probes:s,arm:f,layer:c,children:t("div",{className:ye,...ae("card-content"),children:t(k,{children:e})})})}const he="var(--card-bg)";function xe(e,r=he){const{hover:o}=m(),n=R();if(o.kind!=="nextImage"||o.media?.cover!==e||n.kind!=="wheel")return null;const a=U(n.wheel,o.media,n.sel.finish?.name);return a?t(W,{media:a,name:n.wheel.name,cover:e,ground:r}):null}function ge({children:e}){const r=L(),{wheel:o,sel:n}=_(),a=n.finish?.color,s=x(()=>r?{...r,row:w(o,a)}:null,[r,o,a]);return s?t(G.Provider,{value:s,children:e}):t(h,{children:e})}function ve({copy:e}){const{wheel:r,sel:o,isSet:n}=_(),{rules:a}=m(),s=xe("card");return A(h,{children:[t(S,{copy:t(ge,{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(H,{})]})}function P(e,r,o,n){const a=r.item;return t(q,{wheel:a,colours:o.colours,defaultFinish:n?.[r.index],editing:o.editing,children:t(C.Provider,{value:"catalog",children:t(ve,{copy:e})})})}function rr({wheels:e,finishes:r,children:o}){const n=m(),{ownerId:a,ownerType:s,Template:f,editing:c}=n;return t(p,{ownerId:a,ownerType:s,Template:f,rows:e.map(l=>w(l)),items:e,fallback:c?t(y,{}):null,wrapCopy:(l,d)=>P(l,d,n,r),children:o})}function or({items:e,tyreOf:r,tyreFit:o}){const n=m(),{ownerId:a,ownerType:s,Template:f,editing:c}=n,l=e.map(d=>r(d));return t(p,{ownerId:a,ownerType:s,Template:f,rows:e.map((d,u)=>{const i=l[u];return i?fe(i):w(d)}),items:e,fallback:c?t(y,{}):null,wrapCopy:(d,u)=>{const i=l[u.index];return i?Re(d,Y(i,o?.(i)??null),c):P(d,u,n)},children:d=>d})}function be({copy:e}){const r=R();if(r.kind!=="tyre")throw new Error("A tyre card surface was drawn outside its tyre state.");return t(S,{copy:e,href:r.pagePath??"",label:r.tyre.name,arm:r.arm})}function Re(e,r,o){return t(z,{tyre:r,editing:o,children:t(C.Provider,{value:"catalog",children:t(be,{copy:e})})})}function _e(e,r){const o=r.item;return t(V,{bundle:o,children:t(C.Provider,{value:"catalog",children:t(S,{copy:e,href:I(o),label:o.name,kit:!0})})})}function tr({bundles:e,children:r}){const{ownerId:o,ownerType:n,Template:a,editing:s}=m();return t(p,{ownerId:o,ownerType:n,Template:a,rows:e.map(pe),items:e,fallback:s?t(y,{}):null,wrapCopy:_e,children:r})}function y(){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:X("The card is empty. Add parts to its card template in Layers.")})}export{ie as CARD_GROUNDS,ce as CARD_WORDS,ue as CARD_WORDS_OVER_CLASS,se as GRID_CARD_RULES,tr as GridBundleCards,er as GridCardProvider,rr as GridCards,or as GridMixedCards,Je as LISTING_CARD_RULES,pe as bundleCardRow,I as bundlePagePath,Qe as cardGroundOf,Xe as cardRowsGrid,Ze as cardWordsOf,Ke as gridIndexCss,w as productCardRow,fe as tyreCardRow,xe as useCardHoverLayer,m as useGridCard};
@@ -1,6 +1,6 @@
1
1
  import { type CardHoverDrawn } from "efficient-web-builder/format/lib/animation/hover";
2
2
  import type { SlotComponent } from "efficient-easel/blocks";
3
- import { type CardGround } from "./GridCardTemplate.js";
3
+ import { type CardGround, type CardWords } from "./GridCardTemplate.js";
4
4
  import { type FieldUsageAnswer } from "../lib/content/field-usage.js";
5
5
  import type { CategorySourceValue } from "../lib/content/source-values.js";
6
6
  import { type MoreProducts } from "../lib/sections/product-grid-pages.js";
@@ -61,6 +61,7 @@ interface Props {
61
61
  template?: SlotComponent;
62
62
  fewCards?: FewCards;
63
63
  cardGround?: CardGround;
64
+ cardWords?: CardWords;
64
65
  }
65
66
  export declare const FEW_CARDS: readonly [{
66
67
  readonly label: "Fill the row";
@@ -70,5 +71,5 @@ export declare const FEW_CARDS: readonly [{
70
71
  readonly value: "keep";
71
72
  }];
72
73
  export type FewCards = (typeof FEW_CARDS)[number]["value"];
73
- export default function ProductGridSection({ num, catalog, catalogTotal, firstCountInChips, kinds, title, titleSize, pads, noTop, description, link, products: Products, wheels, source, columns, columnsPhone, columnsTablet, limit: limitProp, moreProducts, perPage, editing, contentCapped, hover, fieldUsage, ownerId, template, fewCards, cardGround, gap: gapProp, gapPhone, }: Props): import("react").JSX.Element | null;
74
+ export default function ProductGridSection({ num, catalog, catalogTotal, firstCountInChips, kinds, title, titleSize, pads, noTop, description, link, products: Products, wheels, source, columns, columnsPhone, columnsTablet, limit: limitProp, moreProducts, perPage, editing, contentCapped, hover, fieldUsage, ownerId, template, fewCards, cardGround, cardWords, gap: gapProp, gapPhone, }: Props): import("react").JSX.Element | null;
74
75
  export {};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as w,Fragment as ut}from"react/jsx-runtime";import{useScopeClass as ft}from"../lib/use-scope-class.js";import{useEffect as B,useMemo as g,useState as fe}from"react";import{cardHoverOf as ht}from"efficient-web-builder/format/lib/animation/hover";import{containerGapProps as xt}from"efficient-web-builder/format/lib/content/container-gap";import wt from"next/link";import{cardRowsGrid as vt,GridCardProvider as yt,GridMixedCards as bt,gridIndexCss as St}from"./GridCardTemplate.js";import{gridClassImageSizes as Ct}from"../lib/sections/card-image-sizes.js";import{fillRowCss as he}from"../lib/sections/fill-row.js";import{hiddenCardsRule as xe,noHoleBands as we,noHoleCss as ve,ONE_WHEEL_MARK as Mt,oneWheelScope as ye,pairScope as Pt,showsASetCard as be}from"../lib/sections/grid-no-hole.js";import{setIsWide as _t,summarySetBuild as Et}from"../lib/wheels/set-mode.js";import{answersForKind as Se,NO_FIELD_ANSWERS as Ce}from"../lib/content/field-usage.js";import{wheelCardEyebrowShows as Ot}from"./ProductCardEyebrow.js";import Tt from"./NoCurrencyNote.js";import{SITE_WIDTH_CAP as Nt,centredCap as Rt,withSideOnce as Me}from"efficient-web-builder/format/lib/content/page-width";import{ProductCatalogProvider as $t,SectionWheelsProvider as It}from"./ProductRef.js";import{useCurrency as zt}from"./CurrencyContext.js";import{FRAME_ROOM_PRODUCT_GRID as At,FRAME_ROOM_PRODUCT_GRID_PHONE as Lt,framedBandPad as Bt,PRODUCT_GRID_ROOM as Gt,withBandClasses as kt}from"../lib/sections/band-padding.js";import{COLLECTION_ATTR as Ft,useCatalogFilter as Ht}from"./catalog/CatalogFilterContext.js";import{useShopperMember as Dt}from"./catalog/ShopperScope.js";import{useBrowserLayoutEffect as Ut}from"efficient-shell/hooks";import Wt from"./wheels-plp/PlpPagination.js";import{CATALOG_TEXT_SIZE as jt}from"../lib/sections/catalog-text-size.js";import{applyShopperFilters as Kt,hasActivePlpFilters as Xt,plpPricedAmounts as Zt}from"../lib/wheels/plp-filters.js";import qt from"./catalog/ClearAllButton.js";import{GRID_TOP_UP_SPARE as Yt,gridPagingOf as Vt,gridShownOf as Jt}from"../lib/sections/product-grid-pages.js";import Qt from"./SectionBand.js";import{useInsideBox as er,useInsideSiteGutter as tr}from"efficient-web-builder/render/components/SiteGutterFrame";import{productGridColumnsClass as rr}from"../lib/sections/product-grid-columns.js";import{renderGold as re,renderHeadline as nr}from"efficient-web-builder/render/components/goldPhrases";import{applyCatalogFilters as ir}from"../lib/wheels/catalog-filters.js";import{normalizeCatalogRows as or}from"../lib/wheels/wheel-summary-casing.js";import{itemKind as G,plpKindNoun as Pe}from"../lib/catalog/plp-item.js";import{filterBarCategoryOf as sr,gridKindsOf as _e,gridRowsOf as ar}from"../lib/wheels/grid-source.js";import{useUnifiedProductCatalog as lr}from"./useProductCatalog.js";import{STICKY_UNDERHEADER_CLASS as dr}from"efficient-web-builder/render/lib/document/header-clearance";import{finishFamiliesOf as mr}from"../lib/wheels/finish-defaults.js";import{lugCountsOf as cr}from"../lib/wheels/lug-count.js";import{diametersOf as pr}from"../lib/wheels/size-range.js";import{say as gr}from"efficient-web-builder/format/lib/editor-words";import{DEFAULT_TITLE_SIZE as ur}from"../lib/sections/product-grid-title.js";import{blockParts as fr}from"../lib/block-parts.js";import{PRODUCT_GRID_TYPE as hr}from"../lib/document/document-nodes.js";import{useSideSpaceOnce as xr}from"efficient-web-builder/render/components/SideSpaceOnce";const d=fr(hr),wr=ht({},"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)]"},Ee=[{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 vr(P){return(Ee.find(v=>v.value===P)??Ee.find(v=>v.value===ur)).cls}const gn=[{label:"Fill the row",value:"fill"},{label:"Keep card width",value:"keep"}];function yr({num:P,catalog:v,catalogTotal:Oe,firstCountInChips:Te=!1,kinds:T,title:k,titleSize:Ne,pads:Re,noTop:ne=!1,description:N,link:_,products:$e,wheels:Ie,source:p,columns:ze,columnsPhone:Ae,columnsTablet:Le,limit:Be,moreProducts:Ge,perPage:ke,editing:E,contentCapped:Fe=!1,hover:He,fieldUsage:y,ownerId:De="",template:Ue,fewCards:ie="fill",cardGround:We="flat",gap:je,gapPhone:Ke}){const oe=xr(),F=g(()=>y?Se(y,"alloy-wheel"):void 0,[y]),Xe=g(()=>y?Se(y,"tyre"):void 0,[y]),e=ft("pg"),{paged:b,per:S,limit:a,cap:u}=Vt({moreProducts:Ge,perPage:ke,limit:Be}),m=rr(ze,Ae,Le),se=Fe,Ze=tr(),qe=er(),Ye=Ze||qe,H=lr(E===!0&&!!p),o=g(()=>p?or(ar(p,T,H??v??[])):null,[v,H,p,T]),D=Dt("grid",o),l=o?D.scope:null,f=sr(p),C=f!==null&&!l,{filters:R,reportCount:U,reportLugs:W,reportSizes:j,reportFinishes:K,reportCategories:X,reportPrices:Z,vehicle:ae}=Ht(),{currency:h}=zt(),q=C&&!!R.process&&R.process!==f,Y=l?.state,r=g(()=>o?Y?Kt(o,Y,h):C?ir(o,R,h,ae.fit):o:null,[o,Y,C,R,h,ae.fit]),[Ve,Je]=fe(1),V=b&&r?Math.max(1,Math.ceil(r.length/S)):1,M=Math.min(V,Math.max(1,l?l.state.page:Ve)),{reportShown:J}=D,le=l!==null;Ut(()=>{if(!le||!r)return J(null);J(Jt(r.length,{paged:b,per:S,cap:u},M))},[le,r,J,b,M,S,u]);const Qe=n=>l?l.update({page:n}):Je(n),s=g(()=>r&&(b?r.slice((M-1)*S,M*S):u?r.slice(0,Math.ceil(a)+Yt):r),[b,u,a,r,M,S]);B(()=>(X(e,f===null?[]:[f]),()=>X(e,[])),[f,X,e]),B(()=>{if(C)return U(e,q?0:r?.length??0),()=>U(e,0)},[C,q,r,U,e]);const O=g(()=>({lugs:cr(o??[]),sizes:pr(o??[]),finishes:mr(o??[]),prices:Zt((o??[]).filter(n=>G(n)!=="tyre"),h)}),[o,h]);B(()=>(W(e,O.lugs),j(e,O.sizes),K(e,O.finishes),Z(e,O.prices),()=>{W(e,[]),j(e,[]),K(e,[]),Z(e,[])}),[O,W,j,K,Z,e]);const Q=xt("ProductGrid",je,"both",Ke),et=`${e} grid${Q.className} bg-[var(--catalog-grid-bg)] ${m}`,de=vt(Q),tt=`${e} grid${de.className} bg-[var(--catalog-grid-bg)] ${m}`,rt=de.style,nt=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)||Ot({kind:!1,brand:!1,process:x},F??[])},[r,F]),it=s?s.length>0?t("div",{className:tt,style:rt,...d("grid"),children:t(bt,{items:s,tyreOf:n=>G(n)==="tyre"?n:null})}):l&&Xt(l.state)?w("div",{className:"flex min-h-[320px] flex-col items-center justify-center gap-4 bg-surface-2 p-4 text-center",...d("grid-empty"),children:[t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:`No ${Pe(_e(p,T)).many} match those filters`}),t(qt,{onClick:l.clear})]}):E?t("div",{className:"flex min-h-[320px] items-center justify-center rounded bg-surface-2 p-4 text-center",...d("grid-empty"),children:t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:gr("No products in “{name}” yet",{name:p?.name??""})})}):null:t($e,{className:et,style:Q.style,minEmptyHeight:320}),ot=l?l.countInChips:Te,$=r&&!ot?r===o&&!H?Oe??r.length:r.length:null,me=Pe(_e(p,T)),st=P||k||N||_?w("div",{className:Me(`${dr} 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 ${se||Ye?"":"-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))]"}`,oe),...d("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`,...d("grid-number"),children:re(P)}),k&&t("h2",{className:`${vr(Ne)} leading-none text-fg max-view-wide:leading-[1] [&>span]:block`,...d("heading"),children:nr(k,!1)})]}),(N||_||$!==null)&&w("div",{className:"flex items-center gap-5 max-view-wide:gap-3 view-wide:grow view-wide:justify-end",children:[N&&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`,...d("description"),children:re(N)}),_&&w(wt,{href:_.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`,...d("view-all"),children:[re(_.text),t("span",{"aria-hidden":!0,children:"→"})]}),$!==null&&w("span",{className:`whitespace-nowrap font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,...d("count"),children:[$," ",$===1?me.one:me.many]})]})]}):null,I=Bt(Re,Gt,{noTop:ne}),{paddingTop:at,...lt}=I.style,z=ne?0:at,dt={...z===void 0?{}:{"--pg-pt":typeof z=="number"?`${z}px`:z},...lt},A=g(()=>{if(!s)return null;const n=s.map(x=>G(x)!=="tyre"&&_t(Et(x))?2:1);return be(n,a)?we(m,n,a):null},[s,m,a]),[mt,ct]=fe("");B(()=>{if(s)return;const n=document.querySelector(`.${e}`);if(!n)return;const x=()=>{const c=[...n.children].map(ue=>ue.classList.contains("col-span-2")&&!ue.querySelector(Mt)?2:1);ct(be(c,a)?ve(e,we(m,c,a,!1),c.length):"")};x();const te=new MutationObserver(x);return te.observe(n,{childList:!0}),()=>te.disconnect()},[s,e,m,a]);const pt=A?A[0].tracks:s?u?Math.min(s.length,a):s.length:void 0,L=A?ve(Pt(e),A,s.length)+(u?xe(ye(e),a+1):"")+(ie==="keep"?"":he(ye(e),m,{limit:a,cards:s.length})):mt,ce=L||ie==="keep"?"":he(e,m,{limit:a,cards:s?.length}),pe=St(e),ge=w(ut,{children:[u&&!L&&t("style",{children:xe(e,a+1)}),L&&t("style",{children:L}),ce&&t("style",{children:ce}),pe&&t("style",{children:pe}),st,it,b&&V>1&&t(Wt,{textSize:jt.labelSmall,page:M,pageCount:V,onPage:Qe}),t(Tt,{editing:E})]});if(q)return null;const ee=t(Qt,{rootRef:D.ref,attrs:{...C&&f!==null?{...I.attrs,[Ft]:f}:I.attrs,...d("product-grid-block")},className:kt(Me(`relative z-[2] bg-bg px-[var(--sf-site-gutter,40px)] ${At} max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] ${Lt}`,oe),I),column:null,inAnyBox:!0,style:dt,defaults:{"--pg-pt":"120px"},children:se?t("div",{style:Rt(Nt),children:ge}):ge}),gt=o?ee:E?t($t,{currency:h,children:ee}):t(It,{wheels:Ie,currency:h,children:ee});return t(yt,{value:{ownerId:De,Template:Ue,hover:He??wr,imageSizes:Ct(m,pt),fieldUsage:F??Ce,tyreFieldUsage:Xe??Ce,reserveEyebrow:nt,editing:E===!0,ground:We},children:gt})}export{gn as FEW_CARDS,Ee as TITLE_SIZES,yr as default};
1
+ "use client";import{jsx as t,jsxs as w,Fragment as ft}from"react/jsx-runtime";import{useScopeClass as ht}from"../lib/use-scope-class.js";import{useEffect as B,useMemo as u,useState as fe}from"react";import{cardHoverOf as xt}from"efficient-web-builder/format/lib/animation/hover";import{containerGapProps as wt}from"efficient-web-builder/format/lib/content/container-gap";import vt from"next/link";import{cardRowsGrid as yt,GridCardProvider as bt,GridMixedCards as St,gridIndexCss as Ct}from"./GridCardTemplate.js";import{gridClassImageSizes as Mt}from"../lib/sections/card-image-sizes.js";import{fillRowCss as he}from"../lib/sections/fill-row.js";import{hiddenCardsRule as xe,noHoleBands as we,noHoleCss as ve,ONE_WHEEL_MARK as Pt,oneWheelScope as ye,pairScope as _t,showsASetCard as be}from"../lib/sections/grid-no-hole.js";import{setIsWide as Et,summarySetBuild as Ot}from"../lib/wheels/set-mode.js";import{answersForKind as Se,NO_FIELD_ANSWERS as Ce}from"../lib/content/field-usage.js";import{wheelCardEyebrowShows as Tt}from"./ProductCardEyebrow.js";import Nt from"./NoCurrencyNote.js";import{SITE_WIDTH_CAP as Rt,centredCap as $t,withSideOnce as Me}from"efficient-web-builder/format/lib/content/page-width";import{ProductCatalogProvider as It,SectionWheelsProvider as zt}from"./ProductRef.js";import{useCurrency as At}from"./CurrencyContext.js";import{FRAME_ROOM_PRODUCT_GRID as Lt,FRAME_ROOM_PRODUCT_GRID_PHONE as Bt,framedBandPad as Gt,PRODUCT_GRID_ROOM as kt,withBandClasses as Ft}from"../lib/sections/band-padding.js";import{COLLECTION_ATTR as Ht,useCatalogFilter as Dt}from"./catalog/CatalogFilterContext.js";import{useShopperMember as Ut}from"./catalog/ShopperScope.js";import{useBrowserLayoutEffect as Wt}from"efficient-shell/hooks";import jt from"./wheels-plp/PlpPagination.js";import{CATALOG_TEXT_SIZE as Kt}from"../lib/sections/catalog-text-size.js";import{applyShopperFilters as Xt,hasActivePlpFilters as Zt,plpPricedAmounts as qt}from"../lib/wheels/plp-filters.js";import Yt from"./catalog/ClearAllButton.js";import{GRID_TOP_UP_SPARE as Vt,gridPagingOf as Jt,gridShownOf as Qt}from"../lib/sections/product-grid-pages.js";import er from"./SectionBand.js";import{useInsideBox as tr,useInsideSiteGutter as rr}from"efficient-web-builder/render/components/SiteGutterFrame";import{productGridColumnsClass as nr}from"../lib/sections/product-grid-columns.js";import{renderGold as re,renderHeadline as ir}from"efficient-web-builder/render/components/goldPhrases";import{applyCatalogFilters as or}from"../lib/wheels/catalog-filters.js";import{normalizeCatalogRows as sr}from"../lib/wheels/wheel-summary-casing.js";import{itemKind as G,plpKindNoun as Pe}from"../lib/catalog/plp-item.js";import{filterBarCategoryOf as ar,gridKindsOf as _e,gridRowsOf as lr}from"../lib/wheels/grid-source.js";import{useUnifiedProductCatalog as dr}from"./useProductCatalog.js";import{STICKY_UNDERHEADER_CLASS as mr}from"efficient-web-builder/render/lib/document/header-clearance";import{finishFamiliesOf as cr}from"../lib/wheels/finish-defaults.js";import{lugCountsOf as pr}from"../lib/wheels/lug-count.js";import{diametersOf as ur}from"../lib/wheels/size-range.js";import{say as gr}from"efficient-web-builder/format/lib/editor-words";import{DEFAULT_TITLE_SIZE as fr}from"../lib/sections/product-grid-title.js";import{blockParts as hr}from"../lib/block-parts.js";import{PRODUCT_GRID_TYPE as xr}from"../lib/document/document-nodes.js";import{useSideSpaceOnce as wr}from"efficient-web-builder/render/components/SideSpaceOnce";const d=hr(xr),vr=xt({},"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)]"},Ee=[{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 yr(P){return(Ee.find(v=>v.value===P)??Ee.find(v=>v.value===fr)).cls}const gn=[{label:"Fill the row",value:"fill"},{label:"Keep card width",value:"keep"}];function br({num:P,catalog:v,catalogTotal:Oe,firstCountInChips:Te=!1,kinds:T,title:k,titleSize:Ne,pads:Re,noTop:ne=!1,description:N,link:_,products:$e,wheels:Ie,source:p,columns:ze,columnsPhone:Ae,columnsTablet:Le,limit:Be,moreProducts:Ge,perPage:ke,editing:E,contentCapped:Fe=!1,hover:He,fieldUsage:y,ownerId:De="",template:Ue,fewCards:ie="fill",cardGround:We="flat",cardWords:je="under",gap:Ke,gapPhone:Xe}){const oe=wr(),F=u(()=>y?Se(y,"alloy-wheel"):void 0,[y]),Ze=u(()=>y?Se(y,"tyre"):void 0,[y]),e=ht("pg"),{paged:b,per:S,limit:a,cap:g}=Jt({moreProducts:Ge,perPage:ke,limit:Be}),m=nr(ze,Ae,Le),se=Fe,qe=rr(),Ye=tr(),Ve=qe||Ye,H=dr(E===!0&&!!p),o=u(()=>p?sr(lr(p,T,H??v??[])):null,[v,H,p,T]),D=Ut("grid",o),l=o?D.scope:null,f=ar(p),C=f!==null&&!l,{filters:R,reportCount:U,reportLugs:W,reportSizes:j,reportFinishes:K,reportCategories:X,reportPrices:Z,vehicle:ae}=Dt(),{currency:h}=At(),q=C&&!!R.process&&R.process!==f,Y=l?.state,r=u(()=>o?Y?Xt(o,Y,h):C?or(o,R,h,ae.fit):o:null,[o,Y,C,R,h,ae.fit]),[Je,Qe]=fe(1),V=b&&r?Math.max(1,Math.ceil(r.length/S)):1,M=Math.min(V,Math.max(1,l?l.state.page:Je)),{reportShown:J}=D,le=l!==null;Wt(()=>{if(!le||!r)return J(null);J(Qt(r.length,{paged:b,per:S,cap:g},M))},[le,r,J,b,M,S,g]);const et=n=>l?l.update({page:n}):Qe(n),s=u(()=>r&&(b?r.slice((M-1)*S,M*S):g?r.slice(0,Math.ceil(a)+Vt):r),[b,g,a,r,M,S]);B(()=>(X(e,f===null?[]:[f]),()=>X(e,[])),[f,X,e]),B(()=>{if(C)return U(e,q?0:r?.length??0),()=>U(e,0)},[C,q,r,U,e]);const O=u(()=>({lugs:pr(o??[]),sizes:ur(o??[]),finishes:cr(o??[]),prices:qt((o??[]).filter(n=>G(n)!=="tyre"),h)}),[o,h]);B(()=>(W(e,O.lugs),j(e,O.sizes),K(e,O.finishes),Z(e,O.prices),()=>{W(e,[]),j(e,[]),K(e,[]),Z(e,[])}),[O,W,j,K,Z,e]);const Q=wt("ProductGrid",Ke,"both",Xe),tt=`${e} grid${Q.className} bg-[var(--catalog-grid-bg)] ${m}`,de=yt(Q),rt=`${e} grid${de.className} bg-[var(--catalog-grid-bg)] ${m}`,nt=de.style,it=u(()=>{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)||Tt({kind:!1,brand:!1,process:x},F??[])},[r,F]),ot=s?s.length>0?t("div",{className:rt,style:nt,...d("grid"),children:t(St,{items:s,tyreOf:n=>G(n)==="tyre"?n:null})}):l&&Zt(l.state)?w("div",{className:"flex min-h-[320px] flex-col items-center justify-center gap-4 bg-surface-2 p-4 text-center",...d("grid-empty"),children:[t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:`No ${Pe(_e(p,T)).many} match those filters`}),t(Yt,{onClick:l.clear})]}):E?t("div",{className:"flex min-h-[320px] items-center justify-center rounded bg-surface-2 p-4 text-center",...d("grid-empty"),children:t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:gr("No products in “{name}” yet",{name:p?.name??""})})}):null:t($e,{className:tt,style:Q.style,minEmptyHeight:320}),st=l?l.countInChips:Te,$=r&&!st?r===o&&!H?Oe??r.length:r.length:null,me=Pe(_e(p,T)),at=P||k||N||_?w("div",{className:Me(`${mr} 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 ${se||Ve?"":"-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))]"}`,oe),...d("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`,...d("grid-number"),children:re(P)}),k&&t("h2",{className:`${yr(Ne)} leading-none text-fg max-view-wide:leading-[1] [&>span]:block`,...d("heading"),children:ir(k,!1)})]}),(N||_||$!==null)&&w("div",{className:"flex items-center gap-5 max-view-wide:gap-3 view-wide:grow view-wide:justify-end",children:[N&&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`,...d("description"),children:re(N)}),_&&w(vt,{href:_.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`,...d("view-all"),children:[re(_.text),t("span",{"aria-hidden":!0,children:"→"})]}),$!==null&&w("span",{className:`whitespace-nowrap font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,...d("count"),children:[$," ",$===1?me.one:me.many]})]})]}):null,I=Gt(Re,kt,{noTop:ne}),{paddingTop:lt,...dt}=I.style,z=ne?0:lt,mt={...z===void 0?{}:{"--pg-pt":typeof z=="number"?`${z}px`:z},...dt},A=u(()=>{if(!s)return null;const n=s.map(x=>G(x)!=="tyre"&&Et(Ot(x))?2:1);return be(n,a)?we(m,n,a):null},[s,m,a]),[ct,pt]=fe("");B(()=>{if(s)return;const n=document.querySelector(`.${e}`);if(!n)return;const x=()=>{const c=[...n.children].map(ge=>ge.classList.contains("col-span-2")&&!ge.querySelector(Pt)?2:1);pt(be(c,a)?ve(e,we(m,c,a,!1),c.length):"")};x();const te=new MutationObserver(x);return te.observe(n,{childList:!0}),()=>te.disconnect()},[s,e,m,a]);const ut=A?A[0].tracks:s?g?Math.min(s.length,a):s.length:void 0,L=A?ve(_t(e),A,s.length)+(g?xe(ye(e),a+1):"")+(ie==="keep"?"":he(ye(e),m,{limit:a,cards:s.length})):ct,ce=L||ie==="keep"?"":he(e,m,{limit:a,cards:s?.length}),pe=Ct(e),ue=w(ft,{children:[g&&!L&&t("style",{children:xe(e,a+1)}),L&&t("style",{children:L}),ce&&t("style",{children:ce}),pe&&t("style",{children:pe}),at,ot,b&&V>1&&t(jt,{textSize:Kt.labelSmall,page:M,pageCount:V,onPage:et}),t(Nt,{editing:E})]});if(q)return null;const ee=t(er,{rootRef:D.ref,attrs:{...C&&f!==null?{...I.attrs,[Ht]:f}:I.attrs,...d("product-grid-block")},className:Ft(Me(`relative z-[2] bg-bg px-[var(--sf-site-gutter,40px)] ${Lt} max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] ${Bt}`,oe),I),column:null,inAnyBox:!0,style:mt,defaults:{"--pg-pt":"120px"},children:se?t("div",{style:$t(Rt),children:ue}):ue}),gt=o?ee:E?t(It,{currency:h,children:ee}):t(zt,{wheels:Ie,currency:h,children:ee});return t(bt,{value:{ownerId:De,Template:Ue,hover:He??vr,imageSizes:Mt(m,ut),fieldUsage:F??Ce,tyreFieldUsage:Ze??Ce,reserveEyebrow:it,editing:E===!0,ground:We,words:je},children:gt})}export{gn as FEW_CARDS,Ee as TITLE_SIZES,br as default};
@@ -1 +1 @@
1
- import{jsx as g}from"react/jsx-runtime";import{gridLimitOf as x}from"../../../../sections/product-grid-pages.js";import{FIRST_COUNT_IN_CHIPS_PROP as H}from"../../../../wheels/shopper-first-paint.js";import{phoneKey as d,tabletKey as P}from"efficient-easel/draw";import b from"../../../../../components/pdp-dynamic/DynamicRelatedProducts.js";import{DEFAULT_RELATIONSHIP as R}from"../../../../catalog/relationships.js";import{resolveWidth as _}from"efficient-web-builder/format/lib/content/section-width";import s,{FEW_CARDS as y}from"../../../../../components/ProductGridSection.js";import{cardGroundOf as G}from"../../../../../components/GridCardTemplate.js";import{relatedCardCount as O}from"../../../../catalog/related-cards.js";import{hidableText as S}from"efficient-easel/screen/lib/document/hidable";import{cardHoverOf as h}from"efficient-web-builder/format/lib/animation/hover";import{parseSectionHeadPlacement as w}from"efficient-web-builder/format/lib/sections/section-head-placement";import{PH as o}from"efficient-web-builder/format/lib/document/blocks/placeholders";import{phHide as t}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{PRODUCTGRID_PH as a}from"../placeholders.js";import{PRODUCT_GRID_TYPE as T}from"../../../document-nodes.js";import{parseMoreProducts as k}from"../../../../sections/product-grid-pages.js";import{ProductGridMeta as D}from"./meta.js";import{bandPadProps as v}from"../../../../sections/band-padding.js";const ee={...D,render:e=>{const l=typeof e.id=="string"?e.id:"",c=e.template;if(e.dynamic){const i=w(e.headPlacement)==="own-box",m=I=>i?void 0:I;return g(b,{num:m(t(e.num,a.num,e.editor)),title:m(t(e.title,o.sectionHeading,e.editor)),description:m(t(e.description,o.body,e.editor)),omitHead:i,columns:typeof e.columns=="number"?e.columns:3,columnsPhone:e[d("columns")],columnsTablet:e[P("columns")],gap:e.gap,gapPhone:e[d("gap")],cardCount:O(e.limit),relationship:typeof e.relationship=="string"?e.relationship:R,hover:h(e,T),ownerId:l,template:c,cardImage:e.cardImage,outline:e.outline,indexBadge:e.indexBadge,editing:e.editor?.isEditing})}const r=t(e.linkText,a.link,e.editor),u=e.source,C=_(e,"full"),f=w(e.headPlacement)==="own-box",n=i=>f?void 0:i;return g(s,{fewCards:y.find(i=>i.value===e.fewCards)?.value,cardGround:G(e.cardGround),gap:e.gap,gapPhone:e[d("gap")],contentCapped:C.mode==="page",num:n(t(e.num,a.num,e.editor)),title:n(t(e.title,o.sectionHeading,e.editor)),titleSize:e.titleSize,noTop:f,pads:v(e),description:n(t(e.description,o.body,e.editor)),link:n(r?{text:r,href:S(e.linkHref)||"#"}:void 0),products:e.products,wheels:e.wheels,source:u?.slug?u:void 0,catalog:e.catalog,catalogTotal:e.catalogTotal,firstCountInChips:e[H]===!0,kinds:e.kinds,fieldUsage:e.fieldUsage,columns:e.columns,columnsPhone:e[d("columns")],columnsTablet:e[P("columns")],limit:x({limit:e.limit,showAll:e.showAll}),moreProducts:k(e.moreProducts),perPage:e.perPage,editing:e.editor?.isEditing,hover:h(e,T),ownerId:l,template:c})}};export{ee as ProductGridRender};
1
+ import{jsx as g}from"react/jsx-runtime";import{gridLimitOf as x}from"../../../../sections/product-grid-pages.js";import{FIRST_COUNT_IN_CHIPS_PROP as s}from"../../../../wheels/shopper-first-paint.js";import{phoneKey as d,tabletKey as P}from"efficient-easel/draw";import H from"../../../../../components/pdp-dynamic/DynamicRelatedProducts.js";import{DEFAULT_RELATIONSHIP as b}from"../../../../catalog/relationships.js";import{resolveWidth as R}from"efficient-web-builder/format/lib/content/section-width";import _,{FEW_CARDS as y}from"../../../../../components/ProductGridSection.js";import{cardGroundOf as O,cardWordsOf as G}from"../../../../../components/GridCardTemplate.js";import{relatedCardCount as S}from"../../../../catalog/related-cards.js";import{hidableText as k}from"efficient-easel/screen/lib/document/hidable";import{cardHoverOf as h}from"efficient-web-builder/format/lib/animation/hover";import{parseSectionHeadPlacement as w}from"efficient-web-builder/format/lib/sections/section-head-placement";import{PH as o}from"efficient-web-builder/format/lib/document/blocks/placeholders";import{phHide as t}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{PRODUCTGRID_PH as a}from"../placeholders.js";import{PRODUCT_GRID_TYPE as T}from"../../../document-nodes.js";import{parseMoreProducts as D}from"../../../../sections/product-grid-pages.js";import{ProductGridMeta as v}from"./meta.js";import{bandPadProps as E}from"../../../../sections/band-padding.js";const te={...v,render:e=>{const l=typeof e.id=="string"?e.id:"",r=e.template;if(e.dynamic){const i=w(e.headPlacement)==="own-box",m=I=>i?void 0:I;return g(H,{num:m(t(e.num,a.num,e.editor)),title:m(t(e.title,o.sectionHeading,e.editor)),description:m(t(e.description,o.body,e.editor)),omitHead:i,columns:typeof e.columns=="number"?e.columns:3,columnsPhone:e[d("columns")],columnsTablet:e[P("columns")],gap:e.gap,gapPhone:e[d("gap")],cardCount:S(e.limit),relationship:typeof e.relationship=="string"?e.relationship:b,hover:h(e,T),ownerId:l,template:r,cardImage:e.cardImage,outline:e.outline,indexBadge:e.indexBadge,editing:e.editor?.isEditing})}const c=t(e.linkText,a.link,e.editor),u=e.source,C=R(e,"full"),f=w(e.headPlacement)==="own-box",n=i=>f?void 0:i;return g(_,{fewCards:y.find(i=>i.value===e.fewCards)?.value,cardGround:O(e.cardGround),cardWords:G(e.cardWords),gap:e.gap,gapPhone:e[d("gap")],contentCapped:C.mode==="page",num:n(t(e.num,a.num,e.editor)),title:n(t(e.title,o.sectionHeading,e.editor)),titleSize:e.titleSize,noTop:f,pads:E(e),description:n(t(e.description,o.body,e.editor)),link:n(c?{text:c,href:k(e.linkHref)||"#"}:void 0),products:e.products,wheels:e.wheels,source:u?.slug?u:void 0,catalog:e.catalog,catalogTotal:e.catalogTotal,firstCountInChips:e[s]===!0,kinds:e.kinds,fieldUsage:e.fieldUsage,columns:e.columns,columnsPhone:e[d("columns")],columnsTablet:e[P("columns")],limit:x({limit:e.limit,showAll:e.showAll}),moreProducts:D(e.moreProducts),perPage:e.perPage,editing:e.editor?.isEditing,hover:h(e,T),ownerId:l,template:r})}};export{te as ProductGridRender};