efficient-storefront-blocks 0.125.9 → 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.
Files changed (32) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/editor/lib/document/blocks/commerce/ProductGrid/fields.js +1 -1
  3. package/dist/editor/lib/document/blocks/commerce/ProductPicture/fields.js +1 -1
  4. package/dist/editor/lib/document/blocks/commerce/ProductPrice/fields.js +1 -1
  5. package/dist/editor/lib/document/blocks/commerce/ProductSpecs/fields.js +1 -1
  6. package/dist/editor/lib/storefront-editor-words.d.ts +12 -0
  7. package/dist/editor/lib/storefront-editor-words.js +1 -1
  8. package/dist/index.js +28 -28
  9. package/dist/render/app/globals.css +58 -0
  10. package/dist/render/components/GridCardTemplate.d.ts +21 -0
  11. package/dist/render/components/GridCardTemplate.js +1 -1
  12. package/dist/render/components/ProductGridSection.d.ts +13 -1
  13. package/dist/render/components/ProductGridSection.js +1 -1
  14. package/dist/render/components/card-pieces/CardPrice.d.ts +4 -0
  15. package/dist/render/components/card-pieces/CardPrice.js +1 -1
  16. package/dist/render/components/card-pieces/CardProductBadge.d.ts +2 -1
  17. package/dist/render/components/card-pieces/CardProductBadge.js +1 -1
  18. package/dist/render/components/card-pieces/CardProductPicture.d.ts +1 -0
  19. package/dist/render/components/card-pieces/CardProductPicture.js +1 -1
  20. package/dist/render/components/card-pieces/CardSpecs.d.ts +12 -2
  21. package/dist/render/components/card-pieces/CardSpecs.js +1 -1
  22. package/dist/render/lib/document/blocks/commerce/ProductGrid/render.js +1 -1
  23. package/dist/render/lib/document/blocks/commerce/ProductPicture/render.js +1 -1
  24. package/dist/render/lib/document/blocks/commerce/ProductPrice/render.js +1 -1
  25. package/dist/render/lib/document/blocks/commerce/ProductSpecs/render.js +1 -1
  26. package/dist/render/lib/wheels/size-range.d.ts +1 -0
  27. package/dist/render/lib/wheels/size-range.js +1 -1
  28. package/dist/routine-index.json +1 -1
  29. package/dist/value-index.json +1 -1
  30. package/dist/words.d.ts +12 -0
  31. package/dist/words.js +1 -1
  32. package/package.json +1 -1
@@ -4321,3 +4321,61 @@ em.text-accent {
4321
4321
  outline: 2px solid var(--price-thumb);
4322
4322
  outline-offset: 2px;
4323
4323
  }
4324
+
4325
+ /* ─── "Card ground: Soft grey" (Product Grid; INOVIT design 2026-11-13) ───
4326
+ The card surface's radial grey ground, three stops from its middle to its
4327
+ edge. A choice of the grid (GridCardTemplate `CARD_GROUNDS`); the default
4328
+ "Flat" never draws this class, so no card that exists moves. The hover's
4329
+ `--card-bg-hover` colour stays under the ground.
4330
+ The three stops are the ground with a little of the text mixed in (4%,
4331
+ 8%, 11%: on a white page with near-black text, the design's soft greys).
4332
+ They are mixed on the card itself, so a card in a themed section mixes
4333
+ that section's colours, and no colour is typed. */
4334
+ .sf-card-ground-soft {
4335
+ background-image: radial-gradient(
4336
+ closest-corner circle,
4337
+ color-mix(in oklab, var(--bg) 96%, var(--fg)) 0%,
4338
+ color-mix(in oklab, var(--bg) 92%, var(--fg)) 60%,
4339
+ color-mix(in oklab, var(--bg) 89%, var(--fg)) 100%
4340
+ );
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
+ }
@@ -45,7 +45,28 @@ export interface GridCardValues {
45
45
  colours?: readonly string[];
46
46
  setGridGap?: string;
47
47
  rules?: GridCardRules;
48
+ ground?: CardGround;
49
+ words?: CardWords;
48
50
  }
51
+ export declare const CARD_GROUNDS: readonly [{
52
+ readonly label: "Flat";
53
+ readonly value: "flat";
54
+ }, {
55
+ readonly label: "Soft grey";
56
+ readonly value: "soft";
57
+ }];
58
+ export type CardGround = (typeof CARD_GROUNDS)[number]["value"];
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";
49
70
  export type GridCardRead = Required<Omit<GridCardValues, "setGridGap">> & Pick<GridCardValues, "setGridGap">;
50
71
  export declare function useGridCard(): GridCardRead;
51
72
  export declare function GridCardProvider({ value, children }: {
@@ -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 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
+ "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,5 +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, type CardWords } from "./GridCardTemplate.js";
3
4
  import { type FieldUsageAnswer } from "../lib/content/field-usage.js";
4
5
  import type { CategorySourceValue } from "../lib/content/source-values.js";
5
6
  import { type MoreProducts } from "../lib/sections/product-grid-pages.js";
@@ -58,6 +59,17 @@ interface Props {
58
59
  fieldUsage?: readonly FieldUsageAnswer[];
59
60
  ownerId?: string;
60
61
  template?: SlotComponent;
62
+ fewCards?: FewCards;
63
+ cardGround?: CardGround;
64
+ cardWords?: CardWords;
61
65
  }
62
- 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, gap: gapProp, gapPhone, }: Props): import("react").JSX.Element | null;
66
+ export declare const FEW_CARDS: readonly [{
67
+ readonly label: "Fill the row";
68
+ readonly value: "fill";
69
+ }, {
70
+ readonly label: "Keep card width";
71
+ readonly value: "keep";
72
+ }];
73
+ export type FewCards = (typeof FEW_CARDS)[number]["value"];
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;
63
75
  export {};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as w,Fragment as pt}from"react/jsx-runtime";import{useScopeClass as gt}from"../lib/use-scope-class.js";import{useEffect as B,useMemo as g,useState as ue}from"react";import{cardHoverOf as ut}from"efficient-web-builder/format/lib/animation/hover";import{containerGapProps as ft}from"efficient-web-builder/format/lib/content/container-gap";import ht from"next/link";import{cardRowsGrid as xt,GridCardProvider as wt,GridMixedCards as vt,gridIndexCss as yt}from"./GridCardTemplate.js";import{gridClassImageSizes as bt}from"../lib/sections/card-image-sizes.js";import{fillRowCss as fe}from"../lib/sections/fill-row.js";import{hiddenCardsRule as he,noHoleBands as xe,noHoleCss as we,ONE_WHEEL_MARK as Ct,oneWheelScope as ve,pairScope as St,showsASetCard as ye}from"../lib/sections/grid-no-hole.js";import{setIsWide as Mt,summarySetBuild as Pt}from"../lib/wheels/set-mode.js";import{answersForKind as be,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 _t,centredCap as Et,withSideOnce as Se}from"efficient-web-builder/format/lib/content/page-width";import{ProductCatalogProvider as Nt,SectionWheelsProvider as Rt}from"./ProductRef.js";import{useCurrency as $t}from"./CurrencyContext.js";import{FRAME_ROOM_PRODUCT_GRID as It,FRAME_ROOM_PRODUCT_GRID_PHONE as zt,framedBandPad as Lt,PRODUCT_GRID_ROOM as At,withBandClasses as Bt}from"../lib/sections/band-padding.js";import{COLLECTION_ATTR as Gt,useCatalogFilter as Ht}from"./catalog/CatalogFilterContext.js";import{useShopperMember as Dt}from"./catalog/ShopperScope.js";import{useBrowserLayoutEffect as Ft}from"efficient-shell/hooks";import kt from"./wheels-plp/PlpPagination.js";import{CATALOG_TEXT_SIZE as Ut}from"../lib/sections/catalog-text-size.js";import{applyShopperFilters as Wt,hasActivePlpFilters as jt,plpPricedAmounts as Kt}from"../lib/wheels/plp-filters.js";import Xt from"./catalog/ClearAllButton.js";import{GRID_TOP_UP_SPARE as Zt,gridPagingOf as qt,gridShownOf as Yt}from"../lib/sections/product-grid-pages.js";import Vt from"./SectionBand.js";import{useInsideBox as Jt,useInsideSiteGutter as Qt}from"efficient-web-builder/render/components/SiteGutterFrame";import{productGridColumnsClass as er}from"../lib/sections/product-grid-columns.js";import{renderGold as re,renderHeadline as tr}from"efficient-web-builder/render/components/goldPhrases";import{applyCatalogFilters as rr}from"../lib/wheels/catalog-filters.js";import{normalizeCatalogRows as nr}from"../lib/wheels/wheel-summary-casing.js";import{itemKind as G,plpKindNoun as Me}from"../lib/catalog/plp-item.js";import{filterBarCategoryOf as ir,gridKindsOf as Pe,gridRowsOf as sr}from"../lib/wheels/grid-source.js";import{useUnifiedProductCatalog as or}from"./useProductCatalog.js";import{STICKY_UNDERHEADER_CLASS as ar}from"efficient-web-builder/render/lib/document/header-clearance";import{finishFamiliesOf as lr}from"../lib/wheels/finish-defaults.js";import{lugCountsOf as dr}from"../lib/wheels/lug-count.js";import{diametersOf as mr}from"../lib/wheels/size-range.js";import{say as cr}from"efficient-web-builder/format/lib/editor-words";import{DEFAULT_TITLE_SIZE as pr}from"../lib/sections/product-grid-title.js";import{blockParts as gr}from"../lib/block-parts.js";import{PRODUCT_GRID_TYPE as ur}from"../lib/document/document-nodes.js";import{useSideSpaceOnce as fr}from"efficient-web-builder/render/components/SideSpaceOnce";const d=gr(ur),hr=ut({},"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)]"},Oe=[{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 xr(P){return(Oe.find(v=>v.value===P)??Oe.find(v=>v.value===pr)).cls}function wr({num:P,catalog:v,catalogTotal:Te,firstCountInChips:_e=!1,kinds:E,title:H,titleSize:Ee,pads:Ne,noTop:ne=!1,description:N,link:O,products:Re,wheels:$e,source:p,columns:Ie,columnsPhone:ze,columnsTablet:Le,limit:Ae,moreProducts:Be,perPage:Ge,editing:T,contentCapped:He=!1,hover:De,fieldUsage:y,ownerId:Fe="",template:ke,gap:Ue,gapPhone:We}){const ie=fr(),D=g(()=>y?be(y,"alloy-wheel"):void 0,[y]),je=g(()=>y?be(y,"tyre"):void 0,[y]),e=gt("pg"),{paged:b,per:C,limit:a,cap:u}=qt({moreProducts:Be,perPage:Ge,limit:Ae}),m=er(Ie,ze,Le),se=He,Ke=Qt(),Xe=Jt(),Ze=Ke||Xe,F=or(T===!0&&!!p),s=g(()=>p?nr(sr(p,E,F??v??[])):null,[v,F,p,E]),k=Dt("grid",s),l=s?k.scope:null,f=ir(p),S=f!==null&&!l,{filters:R,reportCount:U,reportLugs:W,reportSizes:j,reportFinishes:K,reportCategories:X,reportPrices:Z,vehicle:oe}=Ht(),{currency:h}=$t(),q=S&&!!R.process&&R.process!==f,Y=l?.state,r=g(()=>s?Y?Wt(s,Y,h):S?rr(s,R,h,oe.fit):s:null,[s,Y,S,R,h,oe.fit]),[qe,Ye]=ue(1),V=b&&r?Math.max(1,Math.ceil(r.length/C)):1,M=Math.min(V,Math.max(1,l?l.state.page:qe)),{reportShown:J}=k,ae=l!==null;Ft(()=>{if(!ae||!r)return J(null);J(Yt(r.length,{paged:b,per:C,cap:u},M))},[ae,r,J,b,M,C,u]);const Ve=n=>l?l.update({page:n}):Ye(n),o=g(()=>r&&(b?r.slice((M-1)*C,M*C):u?r.slice(0,Math.ceil(a)+Zt):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 _=g(()=>({lugs:dr(s??[]),sizes:mr(s??[]),finishes:lr(s??[]),prices:Kt((s??[]).filter(n=>G(n)!=="tyre"),h)}),[s,h]);B(()=>(W(e,_.lugs),j(e,_.sizes),K(e,_.finishes),Z(e,_.prices),()=>{W(e,[]),j(e,[]),K(e,[]),Z(e,[])}),[_,W,j,K,Z,e]);const Q=ft("ProductGrid",Ue,"both",We),Je=`${e} grid${Q.className} bg-[var(--catalog-grid-bg)] ${m}`,le=xt(Q),Qe=`${e} grid${le.className} bg-[var(--catalog-grid-bg)] ${m}`,et=le.style,tt=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},D??[])},[r,D]),rt=o?o.length>0?t("div",{className:Qe,style:et,...d("grid"),children:t(vt,{items:o,tyreOf:n=>G(n)==="tyre"?n:null})}):l&&jt(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 ${Me(Pe(p,E)).many} match those filters`}),t(Xt,{onClick:l.clear})]}):T?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:cr("No products in “{name}” yet",{name:p?.name??""})})}):null:t(Re,{className:Je,style:Q.style,minEmptyHeight:320}),nt=l?l.countInChips:_e,$=r&&!nt?r===s&&!F?Te??r.length:r.length:null,de=Me(Pe(p,E)),it=P||H||N||O?w("div",{className:Se(`${ar} 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||Ze?"":"-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))]"}`,ie),...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)}),H&&t("h2",{className:`${xr(Ee)} leading-none text-fg max-view-wide:leading-[1] [&>span]:block`,...d("heading"),children:tr(H,!1)})]}),(N||O||$!==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)}),O&&w(ht,{href:O.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(O.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?de.one:de.many]})]})]}):null,I=Lt(Ne,At,{noTop:ne}),{paddingTop:st,...ot}=I.style,z=ne?0:st,at={...z===void 0?{}:{"--pg-pt":typeof z=="number"?`${z}px`:z},...ot},L=g(()=>{if(!o)return null;const n=o.map(x=>G(x)!=="tyre"&&Mt(Pt(x))?2:1);return ye(n,a)?xe(m,n,a):null},[o,m,a]),[lt,dt]=ue("");B(()=>{if(o)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(Ct)?2:1);dt(ye(c,a)?we(e,xe(m,c,a,!1),c.length):"")};x();const te=new MutationObserver(x);return te.observe(n,{childList:!0}),()=>te.disconnect()},[o,e,m,a]);const mt=L?L[0].tracks:o?u?Math.min(o.length,a):o.length:void 0,A=L?we(St(e),L,o.length)+(u?he(ve(e),a+1):"")+fe(ve(e),m,{limit:a,cards:o.length}):lt,me=A?"":fe(e,m,{limit:a,cards:o?.length}),ce=yt(e),pe=w(pt,{children:[u&&!A&&t("style",{children:he(e,a+1)}),A&&t("style",{children:A}),me&&t("style",{children:me}),ce&&t("style",{children:ce}),it,rt,b&&V>1&&t(kt,{textSize:Ut.labelSmall,page:M,pageCount:V,onPage:Ve}),t(Tt,{editing:T})]});if(q)return null;const ee=t(Vt,{rootRef:k.ref,attrs:{...S&&f!==null?{...I.attrs,[Gt]:f}:I.attrs,...d("product-grid-block")},className:Bt(Se(`relative z-[2] bg-bg px-[var(--sf-site-gutter,40px)] ${It} max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] ${zt}`,ie),I),column:null,inAnyBox:!0,style:at,defaults:{"--pg-pt":"120px"},children:se?t("div",{style:Et(_t),children:pe}):pe}),ct=s?ee:T?t(Nt,{currency:h,children:ee}):t(Rt,{wheels:$e,currency:h,children:ee});return t(wt,{value:{ownerId:Fe,Template:ke,hover:De??hr,imageSizes:bt(m,mt),fieldUsage:D??Ce,tyreFieldUsage:je??Ce,reserveEyebrow:tt,editing:T===!0},children:ct})}export{Oe as TITLE_SIZES,wr 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};
@@ -4,7 +4,11 @@ export interface CardPriceSettings {
4
4
  quoteSets?: boolean;
5
5
  setTotal?: boolean;
6
6
  wasFollowsSize?: boolean;
7
+ priceWord?: PriceWord;
7
8
  }
9
+ export declare const PRICE_WORDS: readonly ["from", "From"];
10
+ export type PriceWord = (typeof PRICE_WORDS)[number];
11
+ export declare function withPriceWord(amount: string, word: PriceWord | undefined): string;
8
12
  export type CardPriceRegion = CardTextRegion;
9
13
  export default function CardPrice({ show, region, ...settings }: CardPriceSettings & {
10
14
  region?: CardPriceRegion;
@@ -1 +1 @@
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
+ "use client";import{jsx as n,jsxs as a,Fragment as g}from"react/jsx-runtime";import{formatPrice as S}from"../../lib/commerce.js";import{say as w}from"efficient-web-builder/format/lib/editor-words";import{HideTaker as f}from"efficient-web-builder/render/components/ViewHideRoot";import{setLabel as L}from"../../lib/wheels/variants.js";import{wheelCardPriceLine as b}from"../../lib/wheels/set-mode.js";import{bundlePrice as T,EACH_UNIT as R,formatSelectionPrice as _,formatSelectionWasPrice as y,formatWheelPrice as P,formatWheelWasPrice as W,FROM_PREFIX as d,FROM_PREFIX_START as C,priceIn as E,resolveWheelPrice as v,SET_QUOTE_LABEL as F}from"../../lib/wheels/price-display.js";import{CARD_TEXT_SIZE as u,CardRow as N}from"./card-row.js";import{RegionBridge as z,RegionWords as B,regionAttr as I}from"./card-text-region.js";import{useHeroStateOrNull as O,useProductCardState as $}from"./ProductCardState.js";import{useTaxNote as k}from"./useTaxNote.js";import{blockParts as j}from"../../lib/block-parts.js";const h=j("ProductCard"),oe=["from","From"];function A(e,r){return r==="From"&&e.startsWith(d)?C+e.slice(d.length):e}function H(e,r){if(e.kind==="tyre"){const m=v(E(e.tyre.prices,e.currency),null);return{was:null,amount:P(m,e.currency,d),note:m.priced?R:null,priced:m.priced}}const{wheel:t,currency:o,price:i,sel:l,isSet:p}=e,c=v(t.prices[o],t.msrpPrices?.[o]),s=r.setTotal&&i.priced&&i.setTotal!=null&&l.selectedVariant?`${L(l.selectedVariant)} · ${S(i.setTotal,o)}`:null;return p&&r.quoteSets?{was:null,amount:c.priced?b(P(c,o,d),!0):F,note:s,priced:c.priced}:{was:r.wasFollowsSize?y(i,o):W(c,o),amount:b(_(i,o),i.priced),note:s,priced:i.priced}}function M({state:e,region:r}){const t=k(),o=a(f,{className:"flex items-baseline gap-5 border-t border-line pt-[18px]",children:[e.msrpLabel&&n("div",{className:"font-mono text-[length:var(--size-label,15px)] text-fg-dim line-through",children:e.msrpLabel}),n("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",...I(r,"price"),children:n(B,{region:r,at:"price",children:e.amount})}),e.unitLabel&&n("div",{className:"font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:e.unitLabel}),e.unitLabel&&t&&n("div",{className:"font-mono text-[length:var(--size-label,13px)] text-fg-dim","data-tax-note":"",children:t}),e.packBadge&&n("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 n(z,{region:r,sectionType:"ProductPrice",children:o})}function X({show:e=!0,region:r,...t}){const o=O();return o?n(M,{state:o,region:r}):n(U,{show:e,...t})}function D({state:e,show:r}){if(!r)return null;const t=T(e.bundle,e.currency);return a(g,{children:[t&&a(f,{className:`mt-1 font-mono ${u.labelLarge}`,...h("price"),children:[n("span",{className:"mr-2 text-fg-dim line-through",children:t.was}),t.amount]}),!e.bundle.inStock&&n(f,{className:`mt-1 font-mono ${u.labelSmall} uppercase tracking-[0.24em] text-fg-dim`,children:w("Currently unavailable")})]})}function U({show:e=!0,...r}){const t=$(),o=k();if(t.kind==="bundle")return n(D,{state:t,show:e});const i=H(t,r),{was:l,note:p,priced:c}=i,s=A(i.amount,r.priceWord),x=[p,c?o:null].filter(Boolean).join(" · ")||null;return a(g,{children:[n(N,{children:e?a("div",{className:`mt-2 font-mono ${u.labelLarge}`,...h("price"),children:[l&&n("span",{className:"mr-2 text-fg-dim line-through",children:l}),s]}):null}),n(N,{children:e&&x?n("div",{className:`mt-[2px] font-mono ${u.labelSmall} tracking-[0.08em] text-fg-dim`,...h("price-note"),children:x}):null})]})}export{oe as PRICE_WORDS,X as default,A as withPriceWord};
@@ -4,5 +4,6 @@ export interface CardProductBadgeSettings {
4
4
  numbered?: boolean;
5
5
  axleSets?: boolean;
6
6
  edge?: boolean;
7
+ setFlags?: boolean;
7
8
  }
8
- export default function CardProductBadge({ show, sale, numbered, axleSets, edge, }: CardProductBadgeSettings): import("react").JSX.Element | null;
9
+ export default function CardProductBadge({ show, sale, numbered, axleSets, edge, setFlags, }: CardProductBadgeSettings): import("react").JSX.Element | null;
@@ -1 +1 @@
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
+ "use client";import{jsx as e,Fragment as E,jsxs as C}from"react/jsx-runtime";import{Fragment as B}from"react";import{CARD_TEXT_SIZE as b,useCatalogCard as D}from"./card-row.js";import{bundleSaving as v}from"../../lib/commerce.js";import{useProductCardState as N}from"./ProductCardState.js";import{blockParts as G}from"../../lib/block-parts.js";const s=G("ProductCard"),R=`border px-2 py-1 font-mono ${b.labelSmall} uppercase tracking-[0.3em]`,S="absolute right-[18px] top-[18px] z-10",w="absolute left-[18px] top-[18px] z-10",T="absolute left-0 top-4 z-10 pointer-events-none flex flex-col items-start gap-1",j="absolute left-0 top-[52px] z-10 pointer-events-none flex flex-col items-start gap-1",k=`bg-accent px-3 py-2 font-mono ${b.labelSmall} uppercase tracking-[0.24em] text-bg`;function c({tone:a,children:l}){return e("span",{className:[R,a==="solid"?"border-accent bg-accent text-bg":"border-accent text-accent"].join(" "),...s("badge"),children:l})}function L({show:a=!0,sale:l=!1,numbered:o=!1,axleSets:h=!1,edge:f=!1,setFlags:g=!0}){const n=N();if(!D()||n.kind==="tyre")return null;if(n.kind==="bundle"){const t=v(n.bundle,n.currency);return t&&f?e(_,{flags:[t]}):t?e("div",{className:`${S} pointer-events-none flex flex-col items-end gap-1`,...s("badges"),children:e(c,{tone:"solid",children:t})}):null}const{wheel:A,price:m}=n,i=g&&n.isSet,d=g&&(i||h)?n.setWords:null,r=a?A.badge:null,u=i?e(c,{tone:"solid",children:"Set"}):null,x=[o?u:null,l&&m.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,l&&m.onSale?"Sale":null,d??(r?r==="new"?"New":"Bestseller":null)].filter(p=>!!p);return t.length?e(_,{flags:t,numbered:o}):null}return C(E,{children:[u&&!o&&e("div",{className:`${w} pointer-events-none flex flex-col items-start gap-1`,...s("badges"),children:u}),x.length>0&&e("div",{className:`${S} pointer-events-none flex flex-col items-end gap-1`,...s("badges"),children:x.map((t,p)=>e(B,{children:t},p))})]})}function _({flags:a,numbered:l=!1}){return e("div",{className:l?j:T,...s("badges"),children:a.map(o=>e("span",{className:k,...s("badge"),children:o},o))})}export{L as default};
@@ -4,6 +4,7 @@ export interface CardProductPictureSettings {
4
4
  coverIndex?: unknown;
5
5
  indexBadge?: unknown;
6
6
  showBadge?: unknown;
7
+ setFlags?: unknown;
7
8
  frame?: unknown;
8
9
  setPicture?: unknown;
9
10
  swatch?: unknown;
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as m,Fragment as y}from"react/jsx-runtime";import{parseOption as ae}from"efficient-shell/format";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
+ "use client";import{jsx as e,jsxs as m,Fragment as y}from"react/jsx-runtime";import{parseOption as te}from"efficient-shell/format";import B from"next/image";import{useState as ne}from"react";import{HideTaker as v}from"efficient-web-builder/render/components/ViewHideRoot";import{CARD_INDEX_BADGE_CLASS as E,CARD_INDEX_CLASS as I,parseCardIndexFormat as K}from"efficient-web-builder/format/lib/sections/product-card-style";import{CARD_IMAGE_BG_OFF as le,cardImageBackgroundPaints as Z,resolveCardImageBackground as oe}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 ie,boxSwatchFill as se}from"efficient-web-builder/format/lib/content/box-background";import{useCardRow as ce}from"efficient-web-builder/render/components/CardRowContext";import{pictureShadowFilter as me}from"efficient-easel/screen/lib/document/shadow-values";import{sayCount as de}from"efficient-web-builder/format/lib/editor-words";import{parseSetPicture as fe,setSecondSrc as ue}from"../../lib/wheels/set-mode.js";import{coverSrcForWheel as ge,parseCoverIndex as he,resolvePaintedSrc as pe}from"../../lib/wheels/cover-rendering.js";import be from"../WheelPlaceholder.js";import Se from"../BrandPlate.js";import we from"../TyreImage.js";import{cardSpinOf as ke}from"../card-spin.js";import{useCardHoverLayer as Ce,useGridCard as z}from"../GridCardTemplate.js";import j from"./CardPicture.js";import R from"./CardProductBadge.js";import{useHeldCardPicture as Fe}from"./useHeldCardPicture.js";import{useProductCardState as Pe}from"./ProductCardState.js";import{blockParts as xe}from"../../lib/block-parts.js";const i=xe("ProductCard"),ye=["well","full"],ve="well",G=r=>te(ye,ve,r);function _e({children:r}){return e("div",{className:"h-full w-full transition-transform duration-500 motion-safe:group-hover:scale-[1.03]",children:r})}function T({fill:r,badge:a,children:s}){const d=Z(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 D(r,a){const s=ce();return se({[ie]:r},s?.row)??oe(a,le)}function Ne(r){const a=Pe();return a.kind==="bundle"?e(Ae,{state:a,...r}):a.kind==="tyre"?e($e,{state:a,...r}):a.kind!=="wheel"?null:e(Be,{state:a,...r})}function Ae({state:r,imageBackground:a,cardImage:s,showBadge:d,frame:S,swatch:g}){const{bundle:t}=r,{imageSizes:h}=z(),f=G(S)==="full",p=t.components.length,b=t.image?f?e(B,{alt:t.name,src:t.image,fill:!0,sizes:h,className:"object-cover",draggable:!1,...i("image")}):e(B,{alt:t.name,src:t.image,width:1e3,height:1e3,sizes:h,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:de("{n} piece","{n} pieces",p,{})}),u=e(_e,{children:b}),n=D(g,a),l=d!==!1?e(R,{edge:f}):null;return e(v,{style:_(s),...i("image-block"),children:f?e(T,{fill:n,badge:l,children:u}):m(y,{children:[l,e(j,{image:u,imageBackgroundFill:n})]})})}function $e({state:r,imageBackground:a,cardImage:s,indexBadge:d,frame:S,swatch:g}){const{tyre:t}=r,{imageSizes:h}=z(),f=D(g,a),p=K(d),b=p!=="off"?e("span",{"aria-hidden":!0,"data-format":p,className:`${I} ${E}`,...i("card-number")}):null,u=e(we,{image:t.image,className:"h-full w-full",sizes:h,showBackground:!1}),n=e(Se,{brand:t.brand,logo:t.brandLogo});return e(v,{style:_(s),...i("image-block"),children:G(S)==="full"?m(T,{fill:f,badge:b,children:[u,n]}):m(y,{children:[b,e(j,{image:u,imageBackgroundFill:f,plate:n})]})})}function Be({state:r,imageBackground:a,cardImage:s,coverIndex:d,indexBadge:S,showBadge:g,setFlags:t,frame:h,setPicture:f,swatch:p,shadow:b,shadowColor:u}){const{wheel:n,sel:l,isSet:N}=r,{hover:q,imageSizes:L,fit:J,rules:k,setGridGap:Q}=z(),C=ke(q),V=ge(n,he(d),l.finish?.name,l.shownSrc,J?.holes),[O,Y]=ne(()=>new Set),H=o=>{l.pictureFailed(o),Y(w=>w.has(o)?w:new Set(w).add(o))},W=pe({overrideSrc:V,hookSrc:l.shownSrc,failed:O}),M=n.rendersHaveAlpha===!0?me(b,u):null,ee=M?{...C.style,filter:M}:C.style,A=(o,w)=>e(B,{alt:w,src:o,width:1e3,height:1e3,sizes:L,className:`block h-full w-full object-contain ${C.className}`,style:ee,draggable:!1,onError:()=>H(o),...i("image")},o),re=l.finish?`${n.name} — ${l.finish.name}`:n.name,F=N&&fe(f)==="pair",ae=F?ue(n.finishes?.find(o=>o.name===l.finish?.name),W):null,c=Fe({src:W,second:ae,alt:re,sizes:L,failed:O,onFailed:H,near:l.nearScreen,holdEmpty:l.awaitingProbe}),U=m(y,{children:[c.src?A(c.src,c.alt):e(be,{imageLabel:n.name,spin:C}),c.trial]}),$=K(S),P=$!=="off",x=D(p,a),X=Ce("picture",Z(x)?x:void 0);if(G(h)==="full"){const o=m(y,{children:[P?e("span",{"aria-hidden":!0,"data-format":$,className:`${I} ${E}`,...i("card-number")}):null,e(R,{show:g!==!1,numbered:P,sale:k.sale,axleSets:k.axleSets,setFlags:t!==!1,edge:!0})]});return e(v,{style:_(s),"data-set-picture":N&&!F?"one":void 0,...i("image-block"),children:m(T,{fill:x,badge:o,children:[m("div",{className:"flex h-full w-full items-center justify-center",children:[U,c.second?A(c.second,`${c.alt} — right`):null]}),X]})})}return m(v,{style:_(s),"data-set-picture":N&&!F?"one":void 0,...i("image-block"),children:[P?e("span",{"aria-hidden":!0,"data-format":$,className:`${I} ${E}`,...i("card-number")}):null,e(R,{show:g!==!1,numbered:P,sale:k.sale,axleSets:k.axleSets,setFlags:t!==!1}),e(j,{image:U,imageSecond:c.second?A(c.second,`${c.alt} — right`):void 0,wide:F,imageBackgroundFill:x,setGridGap:Q,plate:X})]})}export{ve as DEFAULT_PICTURE_FRAME,ye as PICTURE_FRAMES,Ne as default};
@@ -8,15 +8,25 @@ export type CardSpecField = string | {
8
8
  readonly accent: boolean;
9
9
  };
10
10
  export declare function cardSpecFields(fields: readonly CardSpecField[], separator?: string): ReactNode;
11
- export declare function CardSpecLine({ children }: {
11
+ export declare function CardSpecLine({ children, oneLine }: {
12
12
  children?: ReactNode;
13
+ oneLine?: boolean;
13
14
  }): import("react").JSX.Element;
15
+ export declare const SPEC_SHOWS: readonly [{
16
+ readonly label: "All facts";
17
+ readonly value: "all";
18
+ }, {
19
+ readonly label: "Sizes only";
20
+ readonly value: "sizes";
21
+ }];
22
+ export type SpecShow = (typeof SPEC_SHOWS)[number]["value"];
14
23
  export interface CardSpecsSettings {
15
24
  sizes?: boolean;
25
+ show?: SpecShow;
16
26
  car?: VehicleFitment | null;
17
27
  separator?: string;
18
28
  fieldUsage?: readonly FieldUsageAnswer[];
19
29
  }
20
- export declare function CardSpecFacts({ sizes, car, separator, fieldUsage }: CardSpecsSettings): import("react").JSX.Element | null;
30
+ export declare function CardSpecFacts({ sizes, show, car, separator, fieldUsage }: CardSpecsSettings): import("react").JSX.Element | null;
21
31
  export declare function tyreSpecLine(tyre: Pick<TyreCardProduct, "sizes" | "rimDiameters">, fieldUsage: readonly FieldUsageAnswer[]): string;
22
32
  export default function CardSpecs(settings: CardSpecsSettings): import("react").JSX.Element;
@@ -1 +1 @@
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
+ "use client";import{jsx as r,Fragment as m,jsxs as d}from"react/jsx-runtime";import{Fragment as u}from"react";import{HideTaker as h}from"efficient-web-builder/render/components/ViewHideRoot";import{applyCardAnswers as x,keepForCard as g}from"../../lib/content/field-usage.js";import{formatSizeRange as S,sizesOnlyLabel as C}from"../../lib/wheels/size-range.js";import{wheelCardSpecFacts as w}from"../../lib/wheels/plp-fitment-match.js";import{CARD_TEXT_SIZE as p,useCatalogCard as _}from"./card-row.js";import{useProductCardState as $}from"./ProductCardState.js";import{blockParts as z}from"../../lib/block-parts.js";const k=z("ProductCard"),F="whitespace-nowrap",L=e=>typeof e=="string"?e:e.text,b=/^(.*\S) (\+\d+ more)$/;function f(e,s="·"){return e.map((t,c)=>{const o=L(t),n=typeof t!="string"&&t.accent,i=`${F}${n?" text-accent":""}`,l=c<e.length-1?`${o} ${s}`:o,a=b.exec(o);return d(u,{children:[a?d(m,{children:[r("span",{className:i,children:a[1]})," ",r("span",{className:i,children:c<e.length-1?`${a[2]} ${s}`:a[2]})]}):r("span",{className:i,children:l}),c<e.length-1?" ":null]},o)})}function E({children:e,oneLine:s=!1}){const t=_();return r(h,{className:s?`mt-2 overflow-hidden whitespace-nowrap font-mono ${p.labelLarge} leading-[19px] tracking-normal text-fg-dim`:t?`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`,...k("specs"),children:e})}const I=[{label:"All facts",value:"all"},{label:"Sizes only",value:"sizes"}];function j({sizes:e=!1,show:s="all",car:t=null,separator:c,fieldUsage:o=[]}){const n=$();if(n.kind==="tyre")return r(m,{children:y(n.tyre,o)});if(n.kind!=="wheel")return null;if(s==="sizes"){const l=C(n.wheel.sizes),a=l?[l]:[];return n.setWords&&a.push({text:n.setWords,accent:!0}),r(m,{children:f(a,c)})}const i=x(w(n.wheel,t,{sizes:e}),o).map(l=>l.text);return r(m,{children:f(i,c)})}function y(e,s){const t=g(s);return[e.sizes.length>0?`${e.sizes.length} ${e.sizes.length===1?"size":"sizes"}`:null,t("rim_diameter")?S(e.rimDiameters):null].filter(Boolean).join(" · ")}function A(e){return r(E,{children:r(j,{...e})})}export{F as CARD_SPEC_FIELD_CLASS,j as CardSpecFacts,E as CardSpecLine,I as SPEC_SHOWS,f as cardSpecFields,A as default,y as tyreSpecLine};
@@ -1 +1 @@
1
- import{jsx as g}from"react/jsx-runtime";import{gridLimitOf as H}from"../../../../sections/product-grid-pages.js";import{FIRST_COUNT_IN_CHIPS_PROP as b}from"../../../../wheels/shopper-first-paint.js";import{phoneKey as o,tabletKey as P}from"efficient-easel/draw";import C from"../../../../../components/pdp-dynamic/DynamicRelatedProducts.js";import{DEFAULT_RELATIONSHIP as s}from"../../../../catalog/relationships.js";import{resolveWidth as y}from"efficient-web-builder/format/lib/content/section-width";import R from"../../../../../components/ProductGridSection.js";import{relatedCardCount as _}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 T}from"efficient-web-builder/format/lib/sections/section-head-placement";import{PH as d}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 I}from"../../../document-nodes.js";import{parseMoreProducts as O}from"../../../../sections/product-grid-pages.js";import{ProductGridMeta as S}from"./meta.js";import{bandPadProps as D}from"../../../../sections/band-padding.js";const Z={...S,render:e=>{const l=typeof e.id=="string"?e.id:"",c=e.template;if(e.dynamic){const n=T(e.headPlacement)==="own-box",m=x=>n?void 0:x;return g(C,{num:m(t(e.num,a.num,e.editor)),title:m(t(e.title,d.sectionHeading,e.editor)),description:m(t(e.description,d.body,e.editor)),omitHead:n,columns:typeof e.columns=="number"?e.columns:3,columnsPhone:e[o("columns")],columnsTablet:e[P("columns")],gap:e.gap,gapPhone:e[o("gap")],cardCount:_(e.limit),relationship:typeof e.relationship=="string"?e.relationship:s,hover:h(e,I),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,w=y(e,"full"),f=T(e.headPlacement)==="own-box",i=n=>f?void 0:n;return g(R,{gap:e.gap,gapPhone:e[o("gap")],contentCapped:w.mode==="page",num:i(t(e.num,a.num,e.editor)),title:i(t(e.title,d.sectionHeading,e.editor)),titleSize:e.titleSize,noTop:f,pads:D(e),description:i(t(e.description,d.body,e.editor)),link:i(r?{text:r,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[b]===!0,kinds:e.kinds,fieldUsage:e.fieldUsage,columns:e.columns,columnsPhone:e[o("columns")],columnsTablet:e[P("columns")],limit:H({limit:e.limit,showAll:e.showAll}),moreProducts:O(e.moreProducts),perPage:e.perPage,editing:e.editor?.isEditing,hover:h(e,I),ownerId:l,template:c})}};export{Z 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};
@@ -1 +1 @@
1
- import{jsx as a}from"react/jsx-runtime";import r from"../../../../../components/card-pieces/CardProductPicture.js";import t from"../../../../../components/card-pieces/HostPart.js";import{ProductPictureMeta as d}from"./meta.js";const n={...d,render:e=>a(t,{label:d.label??"",editing:!!e.editor?.isEditing,children:a(r,{imageBackground:e.imageBackground,cardImage:e.cardImage,coverIndex:e.coverIndex,indexBadge:e.indexBadge,showBadge:e.showBadge,frame:e.frame,setPicture:e.setPicture,swatch:e.swatch,shadow:e.shadow,shadowColor:e.shadowColor})})};export{n as ProductPictureRender};
1
+ import{jsx as a}from"react/jsx-runtime";import t from"../../../../../components/card-pieces/CardProductPicture.js";import r from"../../../../../components/card-pieces/HostPart.js";import{ProductPictureMeta as d}from"./meta.js";const m={...d,render:e=>a(r,{label:d.label??"",editing:!!e.editor?.isEditing,children:a(t,{imageBackground:e.imageBackground,cardImage:e.cardImage,coverIndex:e.coverIndex,indexBadge:e.indexBadge,showBadge:e.showBadge,setFlags:e.setFlags,frame:e.frame,setPicture:e.setPicture,swatch:e.swatch,shadow:e.shadow,shadowColor:e.shadowColor})})};export{m as ProductPictureRender};
@@ -1 +1 @@
1
- import{jsx as t,Fragment as n}from"react/jsx-runtime";import d from"../../../../../components/card-pieces/CardPrice.js";import{useGridCard as o}from"../../../../../components/GridCardTemplate.js";import a from"../../../../../components/card-pieces/HostPart.js";import{readPartStyles as s}from"efficient-web-builder/render/lib/document/part-styles";import{HideTaker as l}from"efficient-web-builder/render/components/ViewHideRoot";import{ProductPriceMeta as i}from"./meta.js";function m({children:e}){return o().ownerId?t(l,{children:e}):t(n,{children:e})}function c({region:e}){const{rules:r}=o();return t(d,{quoteSets:r.quoteSets,setTotal:r.setTotal,wasFollowsSize:r.wasFollowsSize,region:e})}const F={...i,render:e=>{const r=!!e.editor?.isEditing;return t(a,{label:i.label??"",editing:r,onHero:!0,children:t(m,{children:t(c,{region:{nodeId:typeof e.id=="string"?e.id:void 0,partStyles:s(e),editing:r}})})})}};export{F as ProductPriceRender};
1
+ import{jsx as r,Fragment as d}from"react/jsx-runtime";import a,{PRICE_WORDS as l}from"../../../../../components/card-pieces/CardPrice.js";import{useGridCard as i}from"../../../../../components/GridCardTemplate.js";import s from"../../../../../components/card-pieces/HostPart.js";import{readPartStyles as c}from"efficient-web-builder/render/lib/document/part-styles";import{HideTaker as m}from"efficient-web-builder/render/components/ViewHideRoot";import{ProductPriceMeta as n}from"./meta.js";function u({children:e}){return i().ownerId?r(m,{children:e}):r(d,{children:e})}function f({region:e,priceWord:o}){const{rules:t}=i();return r(a,{quoteSets:t.quoteSets,setTotal:t.setTotal,wasFollowsSize:t.wasFollowsSize,priceWord:o,region:e})}const W={...n,render:e=>{const o=!!e.editor?.isEditing;return r(s,{label:n.label??"",editing:o,onHero:!0,children:r(u,{children:r(f,{priceWord:l.find(t=>t===e.priceWord),region:{nodeId:typeof e.id=="string"?e.id:void 0,partStyles:c(e),editing:o}})})})}};export{W as ProductPriceRender};
@@ -1 +1 @@
1
- "use client";import{jsx as r}from"react/jsx-runtime";import c from"../../../../../components/card-pieces/HostPart.js";import{CardSpecFacts as a,CardSpecLine as n}from"../../../../../components/card-pieces/CardSpecs.js";import{useGridCard as m}from"../../../../../components/GridCardTemplate.js";import{useProductCardState as l}from"../../../../../components/card-pieces/ProductCardState.js";import{ProductSpecsMeta as t}from"./meta.js";function f({sizes:e}){const{fieldUsage:i,tyreFieldUsage:o,fit:s}=m(),d=l().kind==="tyre";return r(n,{children:r(a,{sizes:e,fieldUsage:d?o:i,car:s})})}const x={...t,render:e=>r(c,{label:t.label??"",editing:!!e.editor?.isEditing,children:r(f,{sizes:e.sizes===!0})})};export{x as ProductSpecsRender};
1
+ "use client";import{jsx as t}from"react/jsx-runtime";import n from"../../../../../components/card-pieces/HostPart.js";import{CardSpecFacts as c,CardSpecLine as l,SPEC_SHOWS as m}from"../../../../../components/card-pieces/CardSpecs.js";import{useGridCard as f}from"../../../../../components/GridCardTemplate.js";import{useProductCardState as u}from"../../../../../components/card-pieces/ProductCardState.js";import{ProductSpecsMeta as s}from"./meta.js";function S({sizes:e,show:r}){const{fieldUsage:o,tyreFieldUsage:a,fit:d}=f(),i=u().kind==="tyre";return t(l,{oneLine:r==="sizes"&&!i,children:t(c,{sizes:e,show:i?"all":r,fieldUsage:i?a:o,car:d})})}const x={...s,render:e=>t(n,{label:s.label??"",editing:!!e.editor?.isEditing,children:t(S,{sizes:e.sizes===!0,show:m.find(r=>r.value===e.show)?.value??"all"})})};export{x as ProductSpecsRender};
@@ -3,6 +3,7 @@ export declare function sizeRange(sizes: number[]): {
3
3
  max: number;
4
4
  } | null;
5
5
  export declare function formatSizeRange(sizes: number[]): string | null;
6
+ export declare function sizesOnlyLabel(sizes: readonly number[]): string | null;
6
7
  interface HasSizes {
7
8
  sizes?: readonly number[] | null;
8
9
  }
@@ -1 +1 @@
1
- import{inchRangeLabel as o}from"./spec-format.js";function i(n){return n.length===0?null:{min:Math.min(...n),max:Math.max(...n)}}function f(n){const t=i(n);return t?o(t.min,t.max):null}function m(n){const t=new Set;for(const r of n)for(const e of r.sizes??[])typeof e=="number"&&t.add(e);return[...t].sort((r,e)=>r-e)}export{m as diametersOf,f as formatSizeRange,i as sizeRange};
1
+ import{inchRangeLabel as o}from"./spec-format.js";function i(t){return t.length===0?null:{min:Math.min(...t),max:Math.max(...t)}}function f(t){const n=i(t);return n?o(n.min,n.max):null}function l(t){const n=[...new Set(t)].sort((e,r)=>e-r);return n.length===0?null:n.length<=2?n.map(e=>o(e,e)).join(" · "):`${o(n[0],n[0])} – ${o(n[n.length-1],n[n.length-1])}`}function u(t){const n=new Set;for(const e of t)for(const r of e.sizes??[])typeof r=="number"&&n.add(r);return[...n].sort((e,r)=>e-r)}export{u as diametersOf,f as formatSizeRange,i as sizeRange,l as sizesOnlyLabel};