efficient-storefront-blocks 0.125.17 → 0.125.18

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.
@@ -4480,3 +4480,19 @@ em.text-accent {
4480
4480
  .sf-card-tracks:has(> :nth-child(12)):not(:has(> :nth-child(13))) {
4481
4481
  --sf-card-skip: calc(100% / 5 + 1px - clamp(0px, (100% - (min(6, var(--sf-cols)) * var(--sf-card-min) * 1px + (min(6, var(--sf-cols)) - 1) * var(--sf-card-gap))) * 1000, 100000px) - clamp(0px, (5 + 1 - var(--sf-cols)) * 100000px, 100000px));
4482
4482
  }
4483
+
4484
+ /* CARD HOVER ZOOM (2026-11-24, owner review of the new inovit.com home). A
4485
+ section at Show next image whose card has no next picture zooms the wheel a
4486
+ little instead (components/GridCardTemplate `useCardHoverZooms`). `scale`,
4487
+ not `transform`: no layout move, and the card's own lift (`transform` on
4488
+ .sf-card) is left alone. Only on a pointer that hovers; reduced motion
4489
+ keeps the wheel still. scripts/test-card-hover-next-rendering.tsx. */
4490
+ .sf-card-hover-zoom img {
4491
+ transition: scale calc(var(--motion-base) * 2) ease; /* 320 ms: about 300, from the shell token */
4492
+ }
4493
+ @media (hover: hover) and (prefers-reduced-motion: no-preference) {
4494
+ .sf-card:hover .sf-card-hover-zoom img,
4495
+ .sf-card:focus-within .sf-card-hover-zoom img {
4496
+ scale: 1.04;
4497
+ }
4498
+ }
@@ -1,6 +1,7 @@
1
1
  import { type CSSProperties, type ReactNode } from "react";
2
2
  import type { SlotComponent } from "efficient-easel/blocks";
3
3
  import { type CardHoverDrawn, type HoverMediaCover } from "efficient-web-builder/format/lib/animation/hover";
4
+ import { type HoverMediaRow } from "efficient-web-builder/format/lib/content/hover-media";
4
5
  import type { SourceRow } from "efficient-web-builder/format/lib/content/block-sources";
5
6
  import type { Bundle, TyreProductSummary, WheelSummary } from "../lib/api/index.js";
6
7
  import type { VehicleFitment } from "../lib/wheels/plp-fitment-match.js";
@@ -78,6 +79,9 @@ export declare function tyreCardRow(tyre: TyreProductSummary): SourceRow;
78
79
  export declare const bundlePagePath: (bundle: Bundle) => string;
79
80
  export declare function bundleCardRow(bundle: Bundle): SourceRow;
80
81
  export declare function useCardHoverLayer(cover: HoverMediaCover, ground?: string): ReactNode;
82
+ export declare function cardHoverRow(wheel: WheelSummary, finish: string | undefined): HoverMediaRow;
83
+ export declare const CARD_HOVER_ZOOM_CLASS = "sf-card-hover-zoom";
84
+ export declare function useCardHoverZooms(): boolean;
81
85
  export declare function GridCards({ wheels, finishes, children, }: {
82
86
  wheels: readonly WheelSummary[];
83
87
  finishes?: readonly (string | undefined)[];
@@ -1 +1 @@
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
+ "use client";import{jsx as t,Fragment as x,jsxs as D}from"react/jsx-runtime";import{createContext as E,useContext as G,useMemo as h}from"react";import{parseOption as v}from"efficient-shell/format";import{CardRowContext as k,CardTemplateRows as p,useCardRow as L}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as F}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 U}from"efficient-web-builder/format/lib/animation/hover";import{pickHoverMedia as W}from"efficient-web-builder/format/lib/content/hover-media";import H from"efficient-web-builder/render/components/HoverMediaLayer";import{NO_FIELD_ANSWERS as y}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 R}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 V from"./card-pieces/CardSurfaceFrame.js";import{BundleCardStateProvider as z,TyreCardStateProvider as q,useProductCardState as b,useWheelCardState as _,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 Je(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 Qe(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},Ze={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"}],er=e=>v(ce.map(r=>r.value),"flat",e),ue=[{label:"Under the picture",value:"under"},{label:"Over the picture",value:"over"}],rr=e=>v(ue.map(r=>r.value),"under",e),me="sf-card-words-over",O={ownerId:"",ownerType:"ProductGrid",Template:void 0,hover:U({},"ProductGrid"),imageSizes:j,fieldUsage:y,tyreFieldUsage:y,reserveEyebrow:!1,editing:!1,eyebrow:le,fit:null,colours:ie,rules:de,ground:"flat",words:"under"},T=E(O);function m(){return G(T)}function or({value:e,children:r}){const o=h(()=>({...O,...fe(e)}),[e]);return t(T.Provider,{value:o,children:r})}const fe=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:R(o)}}function pe(e){const r=e.designCode||e.slug||"";return{name:e.name??"",eyebrow:e.brand??"",note:"",href:X(e.slug)??"",colour:"",colourVaried:"",colourRandom:R(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 we="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)]",Se="sf-card group relative flex flex-col border border-line bg-bg transition-colors hover:border-accent",ge="col-span-2 max-view-wide:col-span-1 @max-[720px]:col-span-1 [&:has([data-set-picture=one])]:col-span-1",xe=`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"?me:""].filter(Boolean);return t(V,{surface:a?Se:[we,...i].join(" "),span:n?ge:void 0,href:r,label:o,linked:!l,probes:s,arm:f,layer:c,children:t("div",{className:xe,...se("card-content"),children:t(F,{children:e})})})}const he="var(--card-bg)";function ve(e,r=he){const o=A();return!o||o.cover!==e||!o.media?null:t(H,{media:o.media,name:o.name,cover:e,ground:r})}function A(){const{hover:e}=m(),r=b();if(e.kind!=="nextImage"||!e.media||r.kind!=="wheel")return null;const o=r.sel.finish?.name,n=ye(r.wheel,o);return{cover:e.media.cover,name:r.wheel.name,media:W(n,e.media,o)}}function ye(e,r){const o=e.finishes?.find(a=>a.name===r),n=o?.angles?.length?o.angles:r&&r===e.defaultFinish?e.defaultFinishRenderings??[]:[];return{...e,finishes:r?[{name:r,angles:n.slice(1)}]:[]}}const tr="sf-card-hover-zoom";function nr(){const e=A();return e!==null&&e.media===null}function Re({children:e}){const r=L(),{wheel:o,sel:n}=_(),a=n.finish?.color,s=h(()=>r?{...r,row:w(o,a)}:null,[r,o,a]);return s?t(k.Provider,{value:s,children:e}):t(x,{children:e})}function be({copy:e}){const{wheel:r,sel:o,isSet:n}=_(),{rules:a}=m(),s=ve("card");return D(x,{children:[t(S,{copy:t(Re,{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 P(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(be,{copy:e})})})}function ar({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(g,{}):null,wrapCopy:(l,d)=>P(l,d,n,r),children:o})}function sr({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?pe(i):w(d)}),items:e,fallback:c?t(g,{}):null,wrapCopy:(d,u)=>{const i=l[u.index];return i?Oe(d,K(i,o?.(i)??null),c):P(d,u,n)},children:d=>d})}function _e({copy:e}){const r=b();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 Oe(e,r,o){return t(q,{tyre:r,editing:o,children:t(C.Provider,{value:"catalog",children:t(_e,{copy:e})})})}function Te(e,r){const o=r.item;return t(z,{bundle:o,children:t(C.Provider,{value:"catalog",children:t(S,{copy:e,href:I(o),label:o.name,kit:!0})})})}function dr({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(Ce),items:e,fallback:s?t(g,{}):null,wrapCopy:Te,children:r})}function g(){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,tr as CARD_HOVER_ZOOM_CLASS,ue as CARD_WORDS,me as CARD_WORDS_OVER_CLASS,de as GRID_CARD_RULES,dr as GridBundleCards,or as GridCardProvider,ar as GridCards,sr as GridMixedCards,Ze as LISTING_CARD_RULES,Ce as bundleCardRow,I as bundlePagePath,er as cardGroundOf,ye as cardHoverRow,Qe as cardRowsGrid,rr as cardWordsOf,Je as gridIndexCss,w as productCardRow,pe as tyreCardRow,ve as useCardHoverLayer,nr as useCardHoverZooms,m as useGridCard};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as d,Fragment as v}from"react/jsx-runtime";import{parseOption as Z}from"efficient-shell/format";import I from"next/image";import{useState as ne}from"react";import{HideTaker as _}from"efficient-web-builder/render/components/ViewHideRoot";import{CARD_INDEX_BADGE_CLASS as z,CARD_INDEX_CLASS as O,parseCardIndexFormat as q}from"efficient-web-builder/format/lib/sections/product-card-style";import{CARD_IMAGE_BG_OFF as oe,cardImageBackgroundPaints as J,resolveCardImageBackground as se}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as A}from"efficient-web-builder/format/lib/content/card-image-shape";import{BOX_SWATCH_PROP as ie,boxSwatchFill as ce}from"efficient-web-builder/format/lib/content/box-background";import{useCardRow as de}from"efficient-web-builder/render/components/CardRowContext";import{pictureShadowFilter as me}from"efficient-easel/screen/lib/document/shadow-values";import{sayCount as ue}from"efficient-web-builder/format/lib/editor-words";import{parseSetPicture as fe,setSecondSrc as ge}from"../../lib/wheels/set-mode.js";import{coverSrcForWheel as pe,parseCoverIndex as he,resolvePaintedSrc as be}from"../../lib/wheels/cover-rendering.js";import Se from"../WheelPlaceholder.js";import we from"../BrandPlate.js";import ke from"../TyreImage.js";import{cardSpinOf as ye}from"../card-spin.js";import{useCardHoverLayer as Ce,useGridCard as j}from"../GridCardTemplate.js";import R from"./CardPicture.js";import D from"./CardProductBadge.js";import{useHeldCardPicture as Fe}from"./useHeldCardPicture.js";import{useProductCardState as xe}from"./ProductCardState.js";import{blockParts as Pe}from"../../lib/block-parts.js";const n=Pe("ProductCard"),ve=[{label:"Auto",value:"auto"},{label:"Always",value:"always"}],_e=a=>Z(ve.map(r=>r.value),"auto",a),Ae=["well","full"],Ne="well",G=a=>Z(Ae,Ne,a);function Be({children:a}){return e("div",{className:"h-full w-full transition-transform duration-500 motion-safe:group-hover:scale-[1.03]",children:a})}function T({fill:a,badge:r,children:o}){const m=J(a);return d("div",{className:`sf-card-image relative aspect-[4/3] overflow-hidden${m?"":" bg-surface"}`,style:m?{backgroundColor:a}:void 0,...n("image-frame"),children:[o,r]})}function H(a,r){const o=de();return ce({[ie]:a},o?.row)??se(r,oe)}function $e(a){const r=xe();return r.kind==="bundle"?e(Ee,{state:r,...a}):r.kind==="tyre"?e(Ie,{state:r,...a}):r.kind!=="wheel"?null:e(ze,{state:r,...a})}function Ee({state:a,imageBackground:r,cardImage:o,showBadge:m,frame:w,swatch:p}){const{bundle:t}=a,{imageSizes:h}=j(),u=G(w)==="full",b=t.components.length,S=t.image?u?e(I,{alt:t.name,src:t.image,fill:!0,sizes:h,className:"object-cover",draggable:!1,...n("image")}):e(I,{alt:t.name,src:t.image,width:1e3,height:1e3,sizes:h,className:"block h-full w-full object-cover",draggable:!1,...n("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:ue("{n} piece","{n} pieces",b,{})}),f=e(Be,{children:S}),g=H(p,r),i=m!==!1?e(D,{edge:u}):null;return e(_,{style:A(o),...n("image-block"),children:u?e(T,{fill:g,badge:i,children:f}):d(v,{children:[i,e(R,{image:f,imageBackgroundFill:g})]})})}function Ie({state:a,imageBackground:r,cardImage:o,indexBadge:m,frame:w,swatch:p}){const{tyre:t}=a,{imageSizes:h}=j(),u=H(p,r),b=q(m),S=b!=="off"?e("span",{"aria-hidden":!0,"data-format":b,className:`${O} ${z}`,...n("card-number")}):null,f=e(ke,{image:t.image,className:"h-full w-full",sizes:h,showBackground:!1}),g=e(we,{brand:t.brand,logo:t.brandLogo});return e(_,{style:A(o),...n("image-block"),children:G(w)==="full"?d(T,{fill:u,badge:S,children:[f,g]}):d(v,{children:[S,e(R,{image:f,imageBackgroundFill:u,plate:g})]})})}function ze({state:a,imageBackground:r,cardImage:o,coverIndex:m,indexBadge:w,showBadge:p,setFlags:t,frame:h,setPicture:u,swatch:b,shadow:S,shadowColor:f,shadowOn:g}){const{wheel:i,sel:c,isSet:N}=a,{hover:Q,imageSizes:L,fit:V,rules:y,setGridGap:Y}=j(),C=ye(Q),ee=pe(i,he(m),c.finish?.name,c.shownSrc,V?.holes),[W,ae]=ne(()=>new Set),M=l=>{c.pictureFailed(l),ae(k=>k.has(l)?k:new Set(k).add(l))},U=be({overrideSrc:ee,hookSrc:c.shownSrc,failed:W}),B=i.rendersHaveAlpha===!0||_e(g)==="always"?me(S,f):null,re=B?{...C.style,filter:B}:C.style,$=(l,k)=>e(I,{alt:k,src:l,width:1e3,height:1e3,sizes:L,className:`block h-full w-full object-contain ${C.className}`,style:re,draggable:!1,onError:()=>M(l),...n("image")},l),te=c.finish?`${i.name} — ${c.finish.name}`:i.name,F=N&&fe(u)==="pair",le=F?ge(i.finishes?.find(l=>l.name===c.finish?.name),U):null,s=Fe({src:U,second:le,alt:te,sizes:L,failed:W,onFailed:M,near:c.nearScreen,holdEmpty:c.awaitingProbe}),X=d(v,{children:[s.src?$(s.src,s.alt):e(Se,{imageLabel:i.name,spin:C}),s.trial]}),E=q(w),x=E!=="off",P=H(b,r),K=Ce("picture",J(P)?P:void 0);if(G(h)==="full"){const l=d(v,{children:[x?e("span",{"aria-hidden":!0,"data-format":E,className:`${O} ${z}`,...n("card-number")}):null,e(D,{show:p!==!1,numbered:x,sale:y.sale,axleSets:y.axleSets,setFlags:t!==!1,edge:!0})]});return e(_,{style:A(o),"data-set-picture":N&&!F?"one":void 0,...n("image-block"),children:d(T,{fill:P,badge:l,children:[d("div",{className:"flex h-full w-full items-center justify-center",children:[X,s.second?$(s.second,`${s.alt} — right`):null]}),K]})})}return d(_,{style:A(o),"data-set-picture":N&&!F?"one":void 0,...n("image-block"),children:[x?e("span",{"aria-hidden":!0,"data-format":E,className:`${O} ${z}`,...n("card-number")}):null,e(D,{show:p!==!1,numbered:x,sale:y.sale,axleSets:y.axleSets,setFlags:t!==!1}),e(R,{image:X,imageSecond:s.second?$(s.second,`${s.alt} — right`):void 0,wide:F,imageBackgroundFill:P,setGridGap:Y,plate:K,shadowed:!!B})]})}export{Ne as DEFAULT_PICTURE_FRAME,Ae as PICTURE_FRAMES,ve as SHADOW_ON,$e as default,_e as shadowOnOf};
1
+ "use client";import{jsx as e,jsxs as d,Fragment as v}from"react/jsx-runtime";import{parseOption as V}from"efficient-shell/format";import $ from"next/image";import{useState as ne}from"react";import{HideTaker as _}from"efficient-web-builder/render/components/ViewHideRoot";import{CARD_INDEX_BADGE_CLASS as z,CARD_INDEX_CLASS as I,parseCardIndexFormat as q}from"efficient-web-builder/format/lib/sections/product-card-style";import{CARD_IMAGE_BG_OFF as se,cardImageBackgroundPaints as J,resolveCardImageBackground as ie}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as A}from"efficient-web-builder/format/lib/content/card-image-shape";import{BOX_SWATCH_PROP as ce,boxSwatchFill as de}from"efficient-web-builder/format/lib/content/box-background";import{useCardRow as me}from"efficient-web-builder/render/components/CardRowContext";import{pictureShadowFilter as ue}from"efficient-easel/screen/lib/document/shadow-values";import{sayCount as fe}from"efficient-web-builder/format/lib/editor-words";import{parseSetPicture as ge,setSecondSrc as pe}from"../../lib/wheels/set-mode.js";import{coverSrcForWheel as he,parseCoverIndex as be,resolvePaintedSrc as Se}from"../../lib/wheels/cover-rendering.js";import we from"../WheelPlaceholder.js";import Ce from"../BrandPlate.js";import ke from"../TyreImage.js";import{cardSpinOf as ye}from"../card-spin.js";import{CARD_HOVER_ZOOM_CLASS as Fe,useCardHoverLayer as xe,useCardHoverZooms as Pe,useGridCard as R}from"../GridCardTemplate.js";import j from"./CardPicture.js";import D from"./CardProductBadge.js";import{useHeldCardPicture as ve}from"./useHeldCardPicture.js";import{useProductCardState as _e}from"./ProductCardState.js";import{blockParts as Ae}from"../../lib/block-parts.js";const o=Ae("ProductCard"),Ne=[{label:"Auto",value:"auto"},{label:"Always",value:"always"}],Oe=a=>V(Ne.map(r=>r.value),"auto",a),Be=["well","full"],Ee="well",G=a=>V(Be,Ee,a);function $e({children:a}){return e("div",{className:"h-full w-full transition-transform duration-500 motion-safe:group-hover:scale-[1.03]",children:a})}function H({fill:a,badge:r,children:n}){const m=J(a);return d("div",{className:`sf-card-image relative aspect-[4/3] overflow-hidden${m?"":" bg-surface"}`,style:m?{backgroundColor:a}:void 0,...o("image-frame"),children:[n,r]})}function T(a,r){const n=me();return de({[ce]:a},n?.row)??ie(r,se)}function ze(a){const r=_e();return r.kind==="bundle"?e(Ie,{state:r,...a}):r.kind==="tyre"?e(Re,{state:r,...a}):r.kind!=="wheel"?null:e(je,{state:r,...a})}function Ie({state:a,imageBackground:r,cardImage:n,showBadge:m,frame:w,swatch:p}){const{bundle:t}=a,{imageSizes:h}=R(),u=G(w)==="full",b=t.components.length,S=t.image?u?e($,{alt:t.name,src:t.image,fill:!0,sizes:h,className:"object-cover",draggable:!1,...o("image")}):e($,{alt:t.name,src:t.image,width:1e3,height:1e3,sizes:h,className:"block h-full w-full object-cover",draggable:!1,...o("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:fe("{n} piece","{n} pieces",b,{})}),f=e($e,{children:S}),g=T(p,r),i=m!==!1?e(D,{edge:u}):null;return e(_,{style:A(n),...o("image-block"),children:u?e(H,{fill:g,badge:i,children:f}):d(v,{children:[i,e(j,{image:f,imageBackgroundFill:g})]})})}function Re({state:a,imageBackground:r,cardImage:n,indexBadge:m,frame:w,swatch:p}){const{tyre:t}=a,{imageSizes:h}=R(),u=T(p,r),b=q(m),S=b!=="off"?e("span",{"aria-hidden":!0,"data-format":b,className:`${I} ${z}`,...o("card-number")}):null,f=e(ke,{image:t.image,className:"h-full w-full",sizes:h,showBackground:!1}),g=e(Ce,{brand:t.brand,logo:t.brandLogo});return e(_,{style:A(n),...o("image-block"),children:G(w)==="full"?d(H,{fill:u,badge:S,children:[f,g]}):d(v,{children:[S,e(j,{image:f,imageBackgroundFill:u,plate:g})]})})}function je({state:a,imageBackground:r,cardImage:n,coverIndex:m,indexBadge:w,showBadge:p,setFlags:t,frame:h,setPicture:u,swatch:b,shadow:S,shadowColor:f,shadowOn:g}){const{wheel:i,sel:c,isSet:N}=a,{hover:Q,imageSizes:L,fit:Y,rules:k,setGridGap:ee}=R(),y=ye(Q),ae=he(i,be(m),c.finish?.name,c.shownSrc,Y?.holes),[W,re]=ne(()=>new Set),M=l=>{c.pictureFailed(l),re(C=>C.has(l)?C:new Set(C).add(l))},U=Se({overrideSrc:ae,hookSrc:c.shownSrc,failed:W}),O=i.rendersHaveAlpha===!0||Oe(g)==="always"?ue(S,f):null,te=O?{...y.style,filter:O}:y.style,B=(l,C)=>e($,{alt:C,src:l,width:1e3,height:1e3,sizes:L,className:`block h-full w-full object-contain ${y.className}`,style:te,draggable:!1,onError:()=>M(l),...o("image")},l),le=c.finish?`${i.name} — ${c.finish.name}`:i.name,F=N&&ge(u)==="pair",oe=F?pe(i.finishes?.find(l=>l.name===c.finish?.name),U):null,s=ve({src:U,second:oe,alt:le,sizes:L,failed:W,onFailed:M,near:c.nearScreen,holdEmpty:c.awaitingProbe}),X=d(v,{children:[s.src?B(s.src,s.alt):e(we,{imageLabel:i.name,spin:y}),s.trial]}),E=q(w),x=E!=="off",P=T(b,r),Z=xe("picture",J(P)?P:void 0),K=Pe()?Fe:void 0;if(G(h)==="full"){const l=d(v,{children:[x?e("span",{"aria-hidden":!0,"data-format":E,className:`${I} ${z}`,...o("card-number")}):null,e(D,{show:p!==!1,numbered:x,sale:k.sale,axleSets:k.axleSets,setFlags:t!==!1,edge:!0})]});return e(_,{className:K,style:A(n),"data-set-picture":N&&!F?"one":void 0,...o("image-block"),children:d(H,{fill:P,badge:l,children:[d("div",{className:"flex h-full w-full items-center justify-center",children:[X,s.second?B(s.second,`${s.alt} — right`):null]}),Z]})})}return d(_,{className:K,style:A(n),"data-set-picture":N&&!F?"one":void 0,...o("image-block"),children:[x?e("span",{"aria-hidden":!0,"data-format":E,className:`${I} ${z}`,...o("card-number")}):null,e(D,{show:p!==!1,numbered:x,sale:k.sale,axleSets:k.axleSets,setFlags:t!==!1}),e(j,{image:X,imageSecond:s.second?B(s.second,`${s.alt} — right`):void 0,wide:F,imageBackgroundFill:P,setGridGap:ee,plate:Z,shadowed:!!O})]})}export{Ee as DEFAULT_PICTURE_FRAME,Be as PICTURE_FRAMES,Ne as SHADOW_ON,ze as default,Oe as shadowOnOf};