efficient-storefront-blocks 0.80.0 → 0.82.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/README.md +1 -1
- package/dist/chunks/{EditorPreviewCheckout-PSONSVRR.js → EditorPreviewCheckout-XM22X3CX.js} +4 -4
- package/dist/chunks/{SiteEditorProvider-PWHW2UA6.js → SiteEditorProvider-5YHSOW4Y.js} +1 -1
- package/dist/chunks/{chunk-MCCDGDRW.js → chunk-47L7KHRW.js} +1 -1
- package/dist/chunks/{chunk-3Q66B5NU.js → chunk-NSBGNY7R.js} +1 -1
- package/dist/chunks/chunk-VIPMT34C.js +320 -0
- package/dist/chunks/{fitment-data-Q2TJ6FBU.js → fitment-data-SZWTO4WT.js} +1 -1
- package/dist/editor/components/CategoryProductFields.d.ts +4 -1
- package/dist/editor/components/CategoryProductFields.js +1 -1
- package/dist/editor/components/EditReviewsLink.d.ts +4 -0
- package/dist/editor/components/EditReviewsLink.js +1 -0
- package/dist/editor/components/GalleryShowcaseSource.js +1 -1
- package/dist/editor/components/PreviewProductPicker.js +1 -1
- package/dist/editor/components/ProductHeroSource.js +1 -1
- package/dist/editor/components/ProductPicker.js +1 -1
- package/dist/editor/components/ReviewsProductSource.d.ts +26 -0
- package/dist/editor/components/ReviewsProductSource.js +1 -0
- package/dist/editor/components/SpecTableSource.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/DetailRows/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/GalleryB/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductGrid/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductHero/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/RelatedProducts/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/SpecTable/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/index.d.ts +1 -1
- package/dist/editor/lib/document/blocks/commerce/page-rules.d.ts +2 -0
- package/dist/editor/lib/document/blocks/commerce/page-rules.js +1 -1
- package/dist/editor/lib/document/blocks/service/ReviewForm/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/Reviews/fields.js +1 -1
- package/dist/editor/lib/document/config.d.ts +1 -0
- package/dist/editor/lib/document/config.js +1 -1
- package/dist/editor/lib/document/section-text-regions.d.ts +1 -0
- package/dist/editor/lib/document/section-text-regions.js +1 -0
- package/dist/editor/lib/storefront-editor-words.d.ts +4 -1
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/index.js +36 -28
- package/dist/render/app/globals.css +69 -20
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/AppointmentBooking.js +1 -1
- package/dist/render/components/ChatContext.js +1 -1
- package/dist/render/components/CheckoutCTA.js +1 -1
- package/dist/render/components/CollectionCard.js +1 -1
- package/dist/render/components/Collections.js +1 -1
- package/dist/render/components/CompatibleTyres.js +1 -1
- package/dist/render/components/ConsentBanner.js +1 -1
- package/dist/render/components/ContactCards.js +1 -1
- package/dist/render/components/ContactRouting.js +1 -1
- package/dist/render/components/DeliveryOptions.js +1 -1
- package/dist/render/components/DetailRows.js +1 -1
- package/dist/render/components/EuTyreLabels.d.ts +1 -1
- package/dist/render/components/EuTyreLabels.js +1 -1
- package/dist/render/components/Events.js +1 -1
- package/dist/render/components/FitmentTable.js +1 -1
- package/dist/render/components/FooterDivider.js +1 -1
- package/dist/render/components/FooterSection.js +1 -1
- package/dist/render/components/FooterSocial.js +1 -1
- package/dist/render/components/FormBlock.js +1 -1
- package/dist/render/components/GalleryCard.js +1 -1
- package/dist/render/components/GalleryGrid.js +1 -1
- package/dist/render/components/GalleryItem.js +1 -1
- package/dist/render/components/GalleryShowcase.js +1 -1
- package/dist/render/components/LinkedProductHero.d.ts +2 -1
- package/dist/render/components/MessagingCards.js +1 -1
- package/dist/render/components/ProductCard.js +1 -1
- package/dist/render/components/ProductCardChrome.d.ts +4 -3
- package/dist/render/components/ProductCardChrome.js +1 -1
- package/dist/render/components/ProductGallery.js +1 -1
- package/dist/render/components/ProductGridSection.d.ts +7 -6
- package/dist/render/components/ProductGridSection.js +1 -1
- package/dist/render/components/ProductHeroPanel.d.ts +7 -2
- package/dist/render/components/ProductHeroPanel.js +1 -1
- package/dist/render/components/ProductLightbox.js +1 -1
- package/dist/render/components/RateTable.js +1 -1
- package/dist/render/components/ReviewForm.js +1 -1
- package/dist/render/components/Reviews.js +1 -1
- package/dist/render/components/SectionBand.d.ts +5 -2
- package/dist/render/components/SectionBand.js +1 -1
- package/dist/render/components/SectionBandChoice.d.ts +5 -0
- package/dist/render/components/SectionBandChoice.js +1 -0
- package/dist/render/components/SpecTable.js +1 -1
- package/dist/render/components/SubmitBuild.js +1 -1
- package/dist/render/components/Subscribe.js +1 -1
- package/dist/render/components/ThemedSelect.d.ts +4 -2
- package/dist/render/components/ThemedSelect.js +1 -1
- package/dist/render/components/TyreVehicleFitment.d.ts +2 -2
- package/dist/render/components/TyreVehicleFitment.js +1 -1
- package/dist/render/components/WheelCardFrame.js +1 -1
- package/dist/render/components/WheelPlaceholder.d.ts +3 -1
- package/dist/render/components/WheelPlaceholder.js +1 -1
- package/dist/render/components/booking/BookingRegions.js +1 -1
- package/dist/render/components/buy-row.d.ts +1 -1
- package/dist/render/components/buy-row.js +1 -1
- package/dist/render/components/card-pieces/CardPicture.d.ts +1 -1
- package/dist/render/components/card-pieces/CardPicture.js +1 -1
- package/dist/render/components/card-spin.d.ts +7 -0
- package/dist/render/components/card-spin.js +1 -0
- package/dist/render/components/catalog/CatalogFilterBar.js +1 -1
- package/dist/render/components/catalog/CatalogVehiclePicker.js +1 -1
- package/dist/render/components/catalog/PriceRange.d.ts +6 -0
- package/dist/render/components/catalog/PriceRange.js +1 -0
- package/dist/render/components/catalog/SortSelect.d.ts +8 -0
- package/dist/render/components/catalog/SortSelect.js +1 -0
- package/dist/render/components/checkout/CheckoutPageClient.js +1 -1
- package/dist/render/components/checkout/checkout-parts.js +1 -1
- package/dist/render/components/fitment/FitmentFinder.js +1 -1
- package/dist/render/components/fitment/FitmentPickerGrid.js +1 -1
- package/dist/render/components/fitment/StockFitmentCard.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicBundleOffer.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicDetailRows.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicGalleryGrid.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicProductHero.d.ts +2 -1
- package/dist/render/components/pdp-dynamic/DynamicRelatedProducts.d.ts +3 -2
- package/dist/render/components/pdp-dynamic/DynamicRelatedProducts.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicTyreSizes.js +1 -1
- package/dist/render/components/pdp-dynamic/KindGate.js +1 -1
- package/dist/render/components/pdp-dynamic/RecordPhotoGallery.js +1 -1
- package/dist/render/components/wheels-plp/AlloyWheelsListing.d.ts +3 -2
- package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
- package/dist/render/components/wheels-plp/PlpCard.d.ts +3 -2
- package/dist/render/components/wheels-plp/PlpCard.js +1 -1
- package/dist/render/components/wheels-plp/PlpToolbar.d.ts +16 -0
- package/dist/render/components/wheels-plp/PlpToolbar.js +1 -0
- package/dist/render/lib/catalog/relationships.js +1 -1
- package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/DetailRows/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductGrid/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductGrid/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductHero/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/RelatedProducts/render.js +1 -1
- package/dist/render/lib/document/blocks/text-part-shapes.json +0 -14
- package/dist/render/lib/sections/catalog-text-size.d.ts +7 -0
- package/dist/render/lib/sections/catalog-text-size.js +1 -0
- package/dist/render/lib/sections/fill-row.js +1 -1
- package/dist/render/lib/sections/grid-no-hole.d.ts +1 -1
- package/dist/render/lib/sections/grid-no-hole.js +1 -1
- package/dist/render/lib/sections/product-hero-text-regions.d.ts +3 -0
- package/dist/render/lib/sections/product-hero-text-regions.js +1 -0
- package/dist/render/lib/sections/reviews.d.ts +7 -0
- package/dist/render/lib/sections/reviews.js +1 -1
- package/dist/render/lib/sections/section-band.d.ts +2 -0
- package/dist/render/lib/sections/section-band.js +1 -0
- package/dist/render/lib/wheels/catalog-default-layout.js +1 -1
- package/dist/render/lib/wheels/lug-count.d.ts +1 -0
- package/dist/render/lib/wheels/lug-count.js +1 -1
- package/dist/words.d.ts +17 -2
- package/dist/words.js +5 -5
- package/package.json +5 -4
- package/dist/chunks/chunk-6MHGEO3D.js +0 -320
- package/dist/editor/lib/document/blocks/service/placeholders.d.ts +0 -1
- package/dist/editor/lib/document/blocks/service/placeholders.js +0 -1
- /package/dist/chunks/{chunk-X5W6GJLI.js → chunk-T2R5CZ2F.js} +0 -0
- /package/dist/chunks/{chunk-6MHGEO3D.js.LEGAL.txt → chunk-VIPMT34C.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-JUGY3EKR.js → chunk-VVWX2P2N.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as a,jsxs as n,Fragment as b}from"react/jsx-runtime";import Q from"next/link";import{BUY_ROW_CLASS as ve}from"./buy-row.js";import{useEffect as X,useRef as ke,useState as ye}from"react";import{useCart as Ne}from"./CartContext.js";import Se from"./QuoteLink.js";import{useSiteTakesOrders as we}from"./SiteRecordContext.js";import Te from"./EmailCaptureForm.js";import{useEnglish as I}from"./EnglishVariant.js";import _e from"./QuantityStepper.js";import{MarkedLabel as $,heroView as Ee}from"./product-hero/hero-view.js";import Re from"./ProductGallery.js";import{useRootIsDark as Ae}from"efficient-shell/theme";import{useWishlist as Ce}from"./WishlistContext.js";import{useStockAlertSignup as Le}from"./useStockAlertSignup.js";import{SPARE_WORDS as Oe,productCartLine as ze}from"../lib/catalog/purchase.js";import{OPTION_ROW_ATTR as Ie}from"../lib/catalog/store-product.js";import{resolvingRowsAnswered as $e}from"../lib/catalog/product-options.js";import{STOCK_WORDS as je}from"../lib/content/stock-words.js";import{trackViewItem as Me}from"../lib/google-tag.js";import{DEFAULT_HERO_LAYOUT as De,DEFAULT_HERO_RATIO as Fe,DEFAULT_HERO_TEXT_ALIGN as Pe,parseHeroLayout as Ue,parseHeroRatio as Be,parseHeroTextAlign as He}from"../lib/sections/hero-arrangement.js";import{DEFAULT_HERO_GALLERY_MODE as Ve,DEFAULT_HERO_IMAGE_FIT as We}from"../lib/sections/hero-gallery.js";import{ADD_TO_BASKET_ATTR as Ge,MAX_SPARES as Ke,UNITS_PER_SET as qe,formatPrice as J}from"../lib/commerce.js";import{UNPRICED_LABEL as Ye,formatSelectionPrice as Qe,setPriceLabel as Xe}from"../lib/wheels/price-display.js";import{productIsDually as Je,productIsTwoObjects as Ze,setSuppressesRow as et}from"../lib/wheels/set-mode.js";import{CONTENT_CAP_GUTTER as Z}from"../lib/sections/content-cap-gutter.js";const tt=4e3;function at(t){return t?[t.year,t.make,t.model,t.modification].join("-"):""}const nt=.72;function rt(t){const r=t.trim().split(/\s+/).filter(Boolean);if(r.length===0)return;const d=r.map((s,c)=>s.length+(r.length>1&&c===r.length-1?1:0));return`calc(100cqi / ${(Math.max(...d)*nt).toFixed(2)})`}function lt({product:t,selection:r,onLightbox:d,editing:s=!1,pricePlacement:c="top",showVehicleFitment:l=!0,heroLayout:p=De,imageRatio:w=Fe,textAlign:te=Pe,showSpecTable:ae=!0,showPriceQuote:T=!0,galleryMode:ne=Ve,imageFit:re=We,trustBullets:le}){const ie=I(),v=Ue(p),j=He(te),y=Be(w),oe=v==="imageRight"?`${100-y}fr ${y}fr`:`${y}fr ${100-y}fr`,{picked:se,pick:M,qty:D,setQty:ce,choice:g,setChoice:N,angleIdx:de,setAngleIdx:me,showValidation:pe,setShowValidation:_,manualMode:F,vehicle:E,rows:P,facts:fe,part:x,outOfStock:U,offer:m,preOrder:R,canAddToCart:S,currency:k,price:u,set:B,msrpLabel:H}=r,o=Ee(t,r,s),A=Je(t),ue=Ze(t),C=l?o.vehicle:null,be=l?o.vehicleMemory:null,L=!Ae({whenUnset:!0}),{addAndOpen:ge,warmCatalog:V}=Ne(),h=we();X(()=>{!s&&h&&V(t.kind)},[s,h,t.kind,V]);const W=P.filter(e=>!R||e.values.length>0),G=W.filter(e=>e.role==="resolves"),O=W.filter(e=>e.role==="describes"&&!et(ue,e.key)),K=O.findIndex(e=>e.chosen===null),q=(!C||!o.vehicleAnswersSpecs||r.fitmentSet)&&$e(P,R)?K===-1?O:O.slice(0,K+1):[],he=[...G,...q],z=n("div",{className:"flex items-baseline gap-5 border-t border-line pt-[18px]",children:[H&&a("div",{className:"font-mono text-[length:var(--size-label,15px)] text-fg-dim line-through",children:H}),a("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",children:A?Xe(u,k):Qe(u,k)}),u.priced&&a("div",{className:"font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:o.unitLabel}),u.setTotal!=null&&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:[m.quantityLabel,": ",J(B,k)]})]}),Y=ke(null);return X(()=>{s||Y.current===t.slug||(Y.current=t.slug,Me({itemId:x?`${t.slug}|${x.id}`:t.slug,itemName:t.name,variant:o.metaValue,pricePerSet:u.setTotal??u.fromSetTotal??0,currency:k}))},[s,t.slug,t.name,o.metaValue,x,u,k]),n(b,{children:[a("nav",{className:`border-b border-line ${Z} pt-4 pb-4 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg-dim max-[720px]:px-[min(20px,var(--sf-site-gutter,40px))]`,style:L?void 0:{background:"var(--section-bg)"},children:t.crumbs.map((e,i)=>n("span",{children:[i>0&&n(b,{children:[a("span",{className:"mx-3 text-accent",children:"/"}),a("wbr",{})]}),e.href?a(Q,{href:e.href,className:"hover:text-fg",children:a($,{text:e.label})}):a("span",{className:"text-fg",children:a($,{text:e.label})})]},`${e.label}-${i}`))}),n("section",{"data-hero-layout":v,"data-hero-align":j,className:[`grid gap-10 ${Z} py-14 max-[720px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[720px]:py-8`,v==="stacked"?"grid-cols-1":"[grid-template-columns:var(--hero-cols)] max-[1100px]:[grid-template-columns:minmax(0,1fr)]"].join(" "),style:{...L?{}:{background:"var(--section-bg)"},...v==="stacked"?{}:{"--hero-cols":oe}},children:[a(Re,{product:t,view:o,angleIdx:de,onSelect:me,isLight:L,onLightbox:d,galleryMode:ne,imageFit:re,style:v==="imageRight"?{order:2}:void 0}),n("div",{className:["flex flex-col gap-7",j==="center"?"items-center text-center":""].filter(Boolean).join(" "),style:v==="imageRight"?{order:1}:void 0,children:[n("div",{className:"w-full [container-type:inline-size]",children:[n("div",{className:"mb-2.5 flex items-center gap-2.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.2em] text-accent",children:[a("span",{children:a($,{text:t.eyebrow})}),t.badge&&n(b,{children:[a("span",{children:"·"}),a("span",{children:t.badge})]})]}),a("h1",{className:"font-heading2 text-[length:min(min(var(--size-headingMedium,clamp(48px,5.5vw,84px)),var(--hero-name-fit,9999px)),var(--sf-heading-max,9999px))] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] leading-[0.92] tracking-[-0.035em]",style:{"--hero-name-fit":rt(o.heading)},children:(()=>{const e=o.heading.lastIndexOf(" ");if(e===-1)return o.heading;const i=o.heading.slice(0,e),f=o.heading.slice(e+1);return n(b,{children:[i," ",n("em",{className:"font-normal italic text-accent",children:[f,"."]})]})})()})]}),c!=="belowSpecs"&&T&&z,be,G.map(e=>a(ee,{row:e,onPick:M},e.key)),R&&o.preOrder?n(b,{children:[c==="belowSpecs"&&T&&z,o.preOrder]}):n(b,{children:[C,q.map(e=>a(ee,{row:e,onPick:M},e.key)),ae&&a(it,{facts:fe}),(m.packs.length>0||h&&(m.extra||m.spareCounts.length>0))&&n("div",{className:"border-b border-line pb-[26px]",children:[m.packs.length>0&&n(b,{children:[a("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:"How many"}),a("div",{className:"flex flex-wrap gap-1.5",children:m.packs.map(e=>n("button",{type:"button",onClick:()=>N(i=>({...i,unit:e.value})),"aria-pressed":g.unit===e.value,className:["relative cursor-pointer border-2 px-4 py-3 text-left font-mono uppercase transition-colors",g.unit===e.value?"border-accent text-fg outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 text-fg hover:border-accent"].join(" "),style:g.unit===e.value?{background:"color-mix(in oklab, var(--accent) 14%, transparent)"}:void 0,children:[g.unit===e.value&&a("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),a("span",{className:"block text-[length:var(--size-label,14px)] tracking-[0.18em]",children:e.label})]},e.value))})]}),h&&m.extra&&n("label",{className:`${m.packs.length>0?"mt-3.5 ":""}flex cursor-pointer items-center gap-3 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em] text-fg`,children:[a("input",{type:"checkbox",checked:g.spares>0,onChange:e=>N(i=>({...i,spares:e.target.checked?Ke:0})),className:"h-4 w-4 cursor-pointer accent-[var(--accent)]"}),m.extra.label]}),h&&m.spareCounts.length>0&&n(b,{children:[a("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:Oe.howMany}),a("div",{className:"flex flex-col gap-1.5 sm:flex-row sm:flex-wrap",children:m.spareCounts.map(e=>{const i=e.value-qe,f=g.spares===i;return n("button",{type:"button",onClick:()=>N(xe=>({...xe,spares:i})),"aria-pressed":f,className:["relative cursor-pointer border-2 px-4 py-3 text-left font-mono uppercase transition-colors",f?"border-accent text-fg outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 text-fg hover:border-accent"].join(" "),style:f?{background:"color-mix(in oklab, var(--accent) 14%, transparent)"}:void 0,children:[f&&a("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),n("span",{className:"block text-[length:var(--size-label,14px)] tracking-[0.18em]",children:[e.value," · ",e.label]})]},e.value)})})]}),h&&m.spareSide&&n(b,{children:[a("div",{className:"mb-3.5 mt-[26px] font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:m.spareSide.label}),a("div",{className:"flex flex-wrap gap-1.5",children:m.spareSide.options.map(e=>{const i=g.spareSide===e.value;return n("button",{type:"button",onClick:()=>N(f=>({...f,spareSide:e.value})),"aria-pressed":i,className:["relative cursor-pointer border-2 px-4 py-3 text-left font-mono uppercase transition-colors",i?"border-accent text-fg outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 text-fg hover:border-accent"].join(" "),style:i?{background:"color-mix(in oklab, var(--accent) 14%, transparent)"}:void 0,children:[i&&a("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),a("span",{className:"block text-[length:var(--size-label,14px)] tracking-[0.18em]",children:e.label})]},e.value)})})]})]}),c==="belowSpecs"&&T&&z,n("div",{className:ve,children:[h&&!(A&&!u.priced)&&a(_e,{value:D,onChange:ce,size:"large"}),!h||A&&!u.priced?a(Se,{className:"flex-1 cursor-pointer bg-btn px-6 py-4 text-center font-mono text-[length:var(--size-label,14px)] font-bold uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg"}):u.priced?U?a("button",{type:"button",disabled:!0,"aria-disabled":!0,className:"flex-1 cursor-not-allowed border-2 border-dashed border-fg-dim/20 px-6 py-4 font-mono text-[length:var(--size-label,14px)] font-bold uppercase tracking-[0.32em] text-fg-dim/40",children:je.outOfStock}):n("button",{type:"button",[Ge]:"",onClick:()=>{if(!S){_(!0),window.setTimeout(()=>_(!1),tt);return}if(_(!1),s)return;const e=ze(t,x,se,{choice:g,qty:D},{fitmentLabel:F?o.specCaption:E.appliedName?`For ${E.appliedName}`:"",fitmentKey:F?`manual|${o.specCaption}`:`vehicle|${at(E.applied?.vehicle)}`});e&&ge(e)},"aria-disabled":!S,className:["flex-1 px-6 py-4 font-mono text-[length:var(--size-label,14px)] font-bold uppercase tracking-[0.32em] transition-colors",S?"cursor-pointer bg-btn text-btn-ink hover:bg-fg hover:text-bg":"cursor-pointer border-2 border-dashed border-accent/50 text-accent/80 hover:border-accent hover:text-accent"].join(" "),style:S?void 0:{background:"color-mix(in oklab, var(--accent) 6%, transparent)"},children:["Add to Cart",u.setTotal!=null?` · ${J(B,k)}`:""]}):a("button",{type:"button",disabled:!0,"aria-disabled":!0,className:"flex-1 cursor-not-allowed border-2 border-dashed border-fg-dim/20 px-6 py-4 font-mono text-[length:var(--size-label,14px)] font-bold uppercase tracking-[0.32em] text-fg-dim/40",children:Ye}),a(ot,{slug:t.slug,name:t.name})]}),U&&x&&a(st,{partNumbers:x.components.map(e=>e.partNumber),productSlug:t.slug},x.id),pe&&(()=>{const e=he.filter(f=>f.chosen===null).map(f=>ie(f.prompt).replace(/^Select\s+/i,""));if(C&&o.vehicleAnswersSpecs&&!r.fitmentSet&&e.push("vehicle fitment"),e.length===0)return null;const i=e.length===1?e[0]:e.length===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e.at(-1)}`;return n("p",{role:"alert",className:"-mt-1 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em]",style:{color:"var(--alert)"},children:["Please select ",i," first."]})})()]}),le]})]})]})}function it({facts:t}){const r=I();return t.length===0?null:a("div",{className:"border-b border-line pb-[26px]",children:a("dl",{className:"flex flex-col gap-2",children:t.map(d=>n("div",{className:"flex flex-wrap items-baseline gap-x-2 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.22em]",children:[n("dt",{className:"text-fg-dim",children:[r(d.label)," ·"]}),a("dd",{className:"font-semibold text-fg",children:d.value.label})]},d.key))})})}function ee({row:t,onPick:r}){const d=I();if(t.values.length===0&&!t.empty)return null;const s=t.values.find(l=>l.value===t.chosen),c=s&&[s.label,s.note].filter(Boolean).join(" · ");return n("div",{className:"border-b border-line pb-[26px]",[Ie]:t.key,children:[n("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:[d(t.label)," · ",a("span",{className:"text-accent",children:c??d(t.prompt)})]}),t.values.length===0?n("p",{className:"font-mono text-[length:var(--size-body,12px)] leading-relaxed tracking-[0.1em] text-fg-dim",children:[t.empty.text," ",a(Q,{href:t.empty.href,className:"text-accent hover:underline",children:t.empty.linkText})]}):t.display==="swatch"?a("div",{className:"flex flex-wrap gap-2",children:t.values.map(l=>{const p=l.value===t.chosen;return n("button",{type:"button",onClick:()=>r(t.key,l.value),"aria-pressed":p,className:["relative flex max-w-full items-center gap-3 border-2 px-3 py-3 text-left transition-colors",p?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 hover:border-accent"].join(" "),style:p?{background:"color-mix(in oklab, var(--accent) 14%, transparent)"}:void 0,children:[p&&a("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),a("span",{className:"block h-5 w-5 shrink-0 rounded-full border border-fg-dim",style:{background:l.swatch}}),a("span",{className:"block min-w-0 break-words font-mono text-[length:var(--size-label,12px)] font-bold uppercase tracking-[0.18em] text-fg",children:l.label})]},l.value)})}):a("div",{className:"flex flex-wrap gap-1.5",children:t.values.map(l=>{const p=l.value===t.chosen;return n("button",{type:"button",onClick:()=>r(t.key,l.value),"aria-pressed":p,className:["relative cursor-pointer border-2 px-4 py-3 text-left font-mono uppercase transition-colors",p?"border-accent text-fg outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 text-fg hover:border-accent"].join(" "),style:p?{background:"color-mix(in oklab, var(--accent) 14%, transparent)"}:void 0,children:[p&&a("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),a("span",{className:"block text-[length:var(--size-label,14px)] tracking-[0.18em]",children:l.label}),l.note&&a("span",{className:"mt-1 block text-[length:var(--size-label,11px)] tracking-[0.12em] text-fg-dim",children:l.note})]},l.value)})})]})}function ot({slug:t,name:r}){const{has:d,toggle:s}=Ce(),c=d(t);return a("button",{type:"button",title:c?"Saved":"Save","aria-label":c?`Remove ${r} from wishlist`:`Save ${r} to wishlist`,"aria-pressed":c,onClick:()=>s(t),className:["h-12 w-12 cursor-pointer border-2 bg-transparent transition-colors",c?"border-accent text-accent":"border-fg-dim/50 text-fg hover:border-accent hover:text-accent"].join(" "),children:c?"♥":"♡"})}function st({partNumbers:t,productSlug:r}){const[d,s]=ye(""),{status:c,submit:l,reset:p}=Le();function w(){l({partNumbers:t,email:d,productSlug:r})}return c==="sent"?a("p",{className:"-mt-1 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-accent",children:"We'll email you when it's back."}):a(Te,{className:"-mt-1",email:d,onEmailChange:s,status:c,onResetVerdict:p,onSubmit:w,inputAriaLabel:"Email for the back-in-stock alert",submitLabel:"Notify me when back",buttonClassName:"cursor-pointer whitespace-nowrap border-2 border-btn px-4 font-mono text-[length:var(--size-label,11px)] font-bold uppercase tracking-[0.22em] text-btn transition-colors hover:bg-btn hover:text-btn-ink disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-btn",errorMessage:"Couldn't save that — please try again."})}export{lt as default};
|
|
1
|
+
"use client";import{Fragment as b,jsx as a,jsxs as n}from"react/jsx-runtime";import Q from"next/link";import{BUY_ROW_CLASS as Ne}from"./buy-row.js";import{useEffect as J,useRef as Se,useState as Te}from"react";import{useCart as we}from"./CartContext.js";import Re from"./QuoteLink.js";import{useSiteTakesOrders as _e}from"./SiteRecordContext.js";import Ee from"./EmailCaptureForm.js";import{useEnglish as I}from"./EnglishVariant.js";import Ae from"./QuantityStepper.js";import{MarkedLabel as $,heroView as Ce}from"./product-hero/hero-view.js";import Oe from"./ProductGallery.js";import{useRootIsDark as Le}from"efficient-shell/theme";import{useWishlist as ze}from"./WishlistContext.js";import{useStockAlertSignup as Ie}from"./useStockAlertSignup.js";import{SPARE_WORDS as $e,productCartLine as je}from"../lib/catalog/purchase.js";import{OPTION_ROW_ATTR as Me}from"../lib/catalog/store-product.js";import{resolvingRowsAnswered as De}from"../lib/catalog/product-options.js";import{STOCK_WORDS as Pe}from"../lib/content/stock-words.js";import{trackViewItem as Fe}from"../lib/google-tag.js";import{DEFAULT_HERO_LAYOUT as He,DEFAULT_HERO_RATIO as Ue,DEFAULT_HERO_TEXT_ALIGN as Be,parseHeroLayout as Ve,parseHeroRatio as Ge,parseHeroTextAlign as We}from"../lib/sections/hero-arrangement.js";import{DEFAULT_HERO_GALLERY_MODE as Ke,DEFAULT_HERO_IMAGE_FIT as qe}from"../lib/sections/hero-gallery.js";import{ADD_TO_BASKET_ATTR as Xe,MAX_SPARES as Ye,UNITS_PER_SET as Qe,formatPrice as Z}from"../lib/commerce.js";import{UNPRICED_LABEL as Je,formatSelectionPrice as Ze,setPriceLabel as et}from"../lib/wheels/price-display.js";import{productIsDually as tt,productIsTwoObjects as at,setSuppressesRow as nt}from"../lib/wheels/set-mode.js";import{CONTENT_CAP_GUTTER as ee}from"../lib/sections/content-cap-gutter.js";import rt from"efficient-web-builder/render/components/TextRegionRun";import{SectionTextParts as lt}from"efficient-web-builder/render/lib/document/editing-bridges";import{TEXT_REGION_ATTR as it}from"efficient-web-builder/format/lib/sections/text-regions";const ot=4e3;function st(e){return e?[e.year,e.make,e.model,e.modification].join("-"):""}const ct=.72;function dt(e){const r=e.trim().split(/\s+/).filter(Boolean);if(r.length===0)return;const s=r.map((l,d)=>l.length+(r.length>1&&d===r.length-1?1:0));return`calc(100cqi / ${(Math.max(...s)*ct).toFixed(2)})`}function mt(e,r){return e?{[it]:r}:{}}function pt({editing:e,nodeId:r,partStyles:s,children:l}){return!e||!r?a(b,{children:l}):a(lt,{nodeId:r,sectionType:"ProductHero",partStyles:s,children:l})}function ft({product:e,selection:r,onLightbox:s,editing:l=!1,pricePlacement:d="top",showVehicleFitment:i=!0,heroLayout:p=He,imageRatio:T=Ue,textAlign:ae=Be,showSpecTable:ne=!0,showPriceQuote:w=!0,galleryMode:re=Ke,imageFit:le=qe,trustBullets:ie,nodeId:oe,partStyles:j}){const se=I(),v=Ve(p),M=We(ae),y=Ge(T),ce=v==="imageRight"?`${100-y}fr ${y}fr`:`${y}fr ${100-y}fr`,{picked:de,pick:D,qty:P,setQty:me,choice:g,setChoice:N,angleIdx:pe,setAngleIdx:fe,showValidation:ue,setShowValidation:R,manualMode:F,vehicle:_,rows:H,facts:be,part:x,outOfStock:U,offer:m,preOrder:E,canAddToCart:S,currency:k,price:u,set:B,msrpLabel:V}=r,c=Ce(e,r,l),A=tt(e),ge=at(e),C=i?c.vehicle:null,he=i?c.vehicleMemory:null,O=!Le({whenUnset:!0}),{addAndOpen:xe,warmCatalog:G}=we(),h=_e();J(()=>{!l&&h&&G(e.kind)},[l,h,e.kind,G]);const W=H.filter(t=>!E||t.values.length>0),K=W.filter(t=>t.role==="resolves"),L=W.filter(t=>t.role==="describes"&&!nt(ge,t.key)),q=L.findIndex(t=>t.chosen===null),X=(!C||!c.vehicleAnswersSpecs||r.fitmentSet)&&De(H,E)?q===-1?L:L.slice(0,q+1):[],ve=[...K,...X],ke=mt(l,"price"),z=a(pt,{editing:l,nodeId:oe,partStyles:j,children:n("div",{className:"flex items-baseline gap-5 border-t border-line pt-[18px]",children:[V&&a("div",{className:"font-mono text-[length:var(--size-label,15px)] text-fg-dim line-through",children:V}),a("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",...ke,children:a(rt,{region:"price",partStyles:j,children:A?et(u,k):Ze(u,k)})}),u.priced&&a("div",{className:"font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:c.unitLabel}),u.setTotal!=null&&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:[m.quantityLabel,": ",Z(B,k)]})]})}),Y=Se(null);return J(()=>{l||Y.current===e.slug||(Y.current=e.slug,Fe({itemId:x?`${e.slug}|${x.id}`:e.slug,itemName:e.name,variant:c.metaValue,pricePerSet:u.setTotal??u.fromSetTotal??0,currency:k}))},[l,e.slug,e.name,c.metaValue,x,u,k]),n(b,{children:[a("nav",{className:`border-b border-line ${ee} pt-4 pb-4 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg-dim max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]`,style:O?void 0:{background:"var(--section-bg)"},children:e.crumbs.map((t,o)=>n("span",{children:[o>0&&n(b,{children:[a("span",{className:"mx-3 text-accent",children:"/"}),a("wbr",{})]}),t.href?a(Q,{href:t.href,className:"hover:text-fg",children:a($,{text:t.label})}):a("span",{className:"text-fg",children:a($,{text:t.label})})]},`${t.label}-${o}`))}),n("section",{"data-hero-layout":v,"data-hero-align":M,className:[`grid gap-10 ${ee} py-14 max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))] max-view-tablet:py-8`,v==="stacked"?"grid-cols-1":"[grid-template-columns:var(--hero-cols)] max-view-desktop:[grid-template-columns:minmax(0,1fr)]"].join(" "),style:{...O?{}:{background:"var(--section-bg)"},...v==="stacked"?{}:{"--hero-cols":ce}},children:[a(Oe,{product:e,view:c,angleIdx:pe,onSelect:fe,isLight:O,onLightbox:s,galleryMode:re,imageFit:le,style:v==="imageRight"?{order:2}:void 0}),n("div",{className:["flex flex-col gap-7",M==="center"?"items-center text-center":""].filter(Boolean).join(" "),style:v==="imageRight"?{order:1}:void 0,children:[n("div",{className:"w-full [container-type:inline-size]",children:[n("div",{className:"mb-2.5 flex items-center gap-2.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.2em] text-accent",children:[a("span",{children:a($,{text:e.eyebrow})}),e.badge&&n(b,{children:[a("span",{children:"·"}),a("span",{children:e.badge})]})]}),a("h1",{className:"font-heading2 text-[length:min(min(var(--size-headingMedium,clamp(48px,5.5vw,84px)),var(--hero-name-fit,9999px)),var(--sf-heading-max,9999px))] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] leading-[0.92] tracking-[-0.035em]",style:{"--hero-name-fit":dt(c.heading)},children:(()=>{const t=c.heading.lastIndexOf(" ");if(t===-1)return c.heading;const o=c.heading.slice(0,t),f=c.heading.slice(t+1);return n(b,{children:[o," ",n("em",{className:"font-normal italic text-accent",children:[f,"."]})]})})()})]}),d!=="belowSpecs"&&w&&z,he,K.map(t=>a(te,{row:t,onPick:D},t.key)),E&&c.preOrder?n(b,{children:[d==="belowSpecs"&&w&&z,c.preOrder]}):n(b,{children:[C,X.map(t=>a(te,{row:t,onPick:D},t.key)),ne&&a(ut,{facts:be}),(m.packs.length>0||h&&(m.extra||m.spareCounts.length>0))&&n("div",{className:"border-b border-line pb-[26px]",children:[m.packs.length>0&&n(b,{children:[a("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:"How many"}),a("div",{className:"flex flex-wrap gap-1.5",children:m.packs.map(t=>n("button",{type:"button",onClick:()=>N(o=>({...o,unit:t.value})),"aria-pressed":g.unit===t.value,className:["relative cursor-pointer border-2 px-4 py-3 text-left font-mono uppercase transition-colors",g.unit===t.value?"border-accent text-fg outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 text-fg hover:border-accent"].join(" "),style:g.unit===t.value?{background:"color-mix(in oklab, var(--accent) 14%, transparent)"}:void 0,children:[g.unit===t.value&&a("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),a("span",{className:"block text-[length:var(--size-label,14px)] tracking-[0.18em]",children:t.label})]},t.value))})]}),h&&m.extra&&n("label",{className:`${m.packs.length>0?"mt-3.5 ":""}flex cursor-pointer items-center gap-3 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em] text-fg`,children:[a("input",{type:"checkbox",checked:g.spares>0,onChange:t=>N(o=>({...o,spares:t.target.checked?Ye:0})),className:"h-4 w-4 cursor-pointer accent-[var(--accent)]"}),m.extra.label]}),h&&m.spareCounts.length>0&&n(b,{children:[a("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:$e.howMany}),a("div",{className:"flex flex-col gap-1.5 sm:flex-row sm:flex-wrap",children:m.spareCounts.map(t=>{const o=t.value-Qe,f=g.spares===o;return n("button",{type:"button",onClick:()=>N(ye=>({...ye,spares:o})),"aria-pressed":f,className:["relative cursor-pointer border-2 px-4 py-3 text-left font-mono uppercase transition-colors",f?"border-accent text-fg outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 text-fg hover:border-accent"].join(" "),style:f?{background:"color-mix(in oklab, var(--accent) 14%, transparent)"}:void 0,children:[f&&a("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),n("span",{className:"block text-[length:var(--size-label,14px)] tracking-[0.18em]",children:[t.value," · ",t.label]})]},t.value)})})]}),h&&m.spareSide&&n(b,{children:[a("div",{className:"mb-3.5 mt-[26px] font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:m.spareSide.label}),a("div",{className:"flex flex-wrap gap-1.5",children:m.spareSide.options.map(t=>{const o=g.spareSide===t.value;return n("button",{type:"button",onClick:()=>N(f=>({...f,spareSide:t.value})),"aria-pressed":o,className:["relative cursor-pointer border-2 px-4 py-3 text-left font-mono uppercase transition-colors",o?"border-accent text-fg outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 text-fg hover:border-accent"].join(" "),style:o?{background:"color-mix(in oklab, var(--accent) 14%, transparent)"}:void 0,children:[o&&a("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),a("span",{className:"block text-[length:var(--size-label,14px)] tracking-[0.18em]",children:t.label})]},t.value)})})]})]}),d==="belowSpecs"&&w&&z,n("div",{className:Ne,children:[h&&!(A&&!u.priced)&&a(Ae,{value:P,onChange:me,size:"large"}),!h||A&&!u.priced?a(Re,{className:"flex-1 cursor-pointer bg-btn px-6 py-4 text-center font-mono text-[length:var(--size-label,14px)] font-bold uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg"}):u.priced?U?a("button",{type:"button",disabled:!0,"aria-disabled":!0,className:"flex-1 cursor-not-allowed border-2 border-dashed border-fg-dim/20 px-6 py-4 font-mono text-[length:var(--size-label,14px)] font-bold uppercase tracking-[0.32em] text-fg-dim/40",children:Pe.outOfStock}):n("button",{type:"button",[Xe]:"",onClick:()=>{if(!S){R(!0),window.setTimeout(()=>R(!1),ot);return}if(R(!1),l)return;const t=je(e,x,de,{choice:g,qty:P},{fitmentLabel:F?c.specCaption:_.appliedName?`For ${_.appliedName}`:"",fitmentKey:F?`manual|${c.specCaption}`:`vehicle|${st(_.applied?.vehicle)}`});t&&xe(t)},"aria-disabled":!S,className:["flex-1 px-6 py-4 font-mono text-[length:var(--size-label,14px)] font-bold uppercase tracking-[0.32em] transition-colors",S?"cursor-pointer bg-btn text-btn-ink hover:bg-fg hover:text-bg":"cursor-pointer border-2 border-dashed border-accent/50 text-accent/80 hover:border-accent hover:text-accent"].join(" "),style:S?void 0:{background:"color-mix(in oklab, var(--accent) 6%, transparent)"},children:["Add to Cart",u.setTotal!=null?` · ${Z(B,k)}`:""]}):a("button",{type:"button",disabled:!0,"aria-disabled":!0,className:"flex-1 cursor-not-allowed border-2 border-dashed border-fg-dim/20 px-6 py-4 font-mono text-[length:var(--size-label,14px)] font-bold uppercase tracking-[0.32em] text-fg-dim/40",children:Je}),a(bt,{slug:e.slug,name:e.name})]}),U&&x&&a(gt,{partNumbers:x.components.map(t=>t.partNumber),productSlug:e.slug},x.id),ue&&(()=>{const t=ve.filter(f=>f.chosen===null).map(f=>se(f.prompt).replace(/^Select\s+/i,""));if(C&&c.vehicleAnswersSpecs&&!r.fitmentSet&&t.push("vehicle fitment"),t.length===0)return null;const o=t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t.at(-1)}`;return n("p",{role:"alert",className:"-mt-1 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em]",style:{color:"var(--alert)"},children:["Please select ",o," first."]})})()]}),ie]})]})]})}function ut({facts:e}){const r=I();return e.length===0?null:a("div",{className:"border-b border-line pb-[26px]",children:a("dl",{className:"flex flex-col gap-2",children:e.map(s=>n("div",{className:"flex flex-wrap items-baseline gap-x-2 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.22em]",children:[n("dt",{className:"text-fg-dim",children:[r(s.label)," ·"]}),a("dd",{className:"font-semibold text-fg",children:s.value.label})]},s.key))})})}function te({row:e,onPick:r}){const s=I();if(e.values.length===0&&!e.empty)return null;const l=e.values.find(i=>i.value===e.chosen),d=l&&[l.label,l.note].filter(Boolean).join(" · ");return n("div",{className:"border-b border-line pb-[26px]",[Me]:e.key,children:[n("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:[s(e.label)," · ",a("span",{className:"text-accent",children:d??s(e.prompt)})]}),e.values.length===0?n("p",{className:"font-mono text-[length:var(--size-body,12px)] leading-relaxed tracking-[0.1em] text-fg-dim",children:[e.empty.text," ",a(Q,{href:e.empty.href,className:"text-accent hover:underline",children:e.empty.linkText})]}):e.display==="swatch"?a("div",{className:"flex flex-wrap gap-2",children:e.values.map(i=>{const p=i.value===e.chosen;return n("button",{type:"button",onClick:()=>r(e.key,i.value),"aria-pressed":p,className:["relative flex max-w-full items-center gap-3 border-2 px-3 py-3 text-left transition-colors",p?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 hover:border-accent"].join(" "),style:p?{background:"color-mix(in oklab, var(--accent) 14%, transparent)"}:void 0,children:[p&&a("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),a("span",{className:"block h-5 w-5 shrink-0 rounded-full border border-fg-dim",style:{background:i.swatch}}),a("span",{className:"block min-w-0 break-words font-mono text-[length:var(--size-label,12px)] font-bold uppercase tracking-[0.18em] text-fg",children:i.label})]},i.value)})}):a("div",{className:"flex flex-wrap gap-1.5",children:e.values.map(i=>{const p=i.value===e.chosen;return n("button",{type:"button",onClick:()=>r(e.key,i.value),"aria-pressed":p,className:["relative cursor-pointer border-2 px-4 py-3 text-left font-mono uppercase transition-colors",p?"border-accent text-fg outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 text-fg hover:border-accent"].join(" "),style:p?{background:"color-mix(in oklab, var(--accent) 14%, transparent)"}:void 0,children:[p&&a("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),a("span",{className:"block text-[length:var(--size-label,14px)] tracking-[0.18em]",children:i.label}),i.note&&a("span",{className:"mt-1 block text-[length:var(--size-label,11px)] tracking-[0.12em] text-fg-dim",children:i.note})]},i.value)})})]})}function bt({slug:e,name:r}){const{has:s,toggle:l}=ze(),d=s(e);return a("button",{type:"button",title:d?"Saved":"Save","aria-label":d?`Remove ${r} from wishlist`:`Save ${r} to wishlist`,"aria-pressed":d,onClick:()=>l(e),className:["h-12 w-12 cursor-pointer border-2 bg-transparent transition-colors",d?"border-accent text-accent":"border-fg-dim/50 text-fg hover:border-accent hover:text-accent"].join(" "),children:d?"♥":"♡"})}function gt({partNumbers:e,productSlug:r}){const[s,l]=Te(""),{status:d,submit:i,reset:p}=Ie();function T(){i({partNumbers:e,email:s,productSlug:r})}return d==="sent"?a("p",{className:"-mt-1 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-accent",children:"We'll email you when it's back."}):a(Ee,{className:"-mt-1",email:s,onEmailChange:l,status:d,onResetVerdict:p,onSubmit:T,inputAriaLabel:"Email for the back-in-stock alert",submitLabel:"Notify me when back",buttonClassName:"cursor-pointer whitespace-nowrap border-2 border-btn px-4 font-mono text-[length:var(--size-label,11px)] font-bold uppercase tracking-[0.22em] text-btn transition-colors hover:bg-btn hover:text-btn-ink disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-btn",errorMessage:"Couldn't save that — please try again."})}export{ft as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as o,Fragment as s,jsxs as a}from"react/jsx-runtime";import r,{LightboxClose as l}from"./Lightbox.js";import{sizedImage as c}from"efficient-web-builder/format/lib/sized-image";const n="92vw";function m({item:t,onClose:e}){return o(r,{open:!!t,onClose:e,label:t?.alt??"",className:"flex cursor-zoom-out items-center justify-center p-6 max-view-tablet:p-3",children:t&&a(s,{children:[o("img",{...c(t.src,{fallbackWidth:1920}),sizes:n,alt:t.alt,className:"block max-h-[92vh] max-w-[92vw] cursor-zoom-out object-contain"}),o(l,{}),o("span",{className:"absolute bottom-5 left-5 font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:t.alt})]})})}export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import c from"efficient-web-builder/render/components/BlockFrame";import{renderGold as m,renderHeadline as o,splitParagraphs as d}from"efficient-web-builder/render/components/goldPhrases";import{RATE_TABLE_SCROLL_AFTER as p}from"../lib/sections/rate-table.js";const x="–";function h({title:a,description:r,groups:n,contained:s}){return n.length?e(c,{contained:s,className:"py-6",children:t("div",{className:"flex flex-col gap-10",children:[(a||r)&&t("div",{className:"flex max-w-[680px] flex-col gap-3",children:[a&&e("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium leading-[1.05] tracking-[-0.03em] max-
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import c from"efficient-web-builder/render/components/BlockFrame";import{renderGold as m,renderHeadline as o,splitParagraphs as d}from"efficient-web-builder/render/components/goldPhrases";import{RATE_TABLE_SCROLL_AFTER as p}from"../lib/sections/rate-table.js";const x="–";function h({title:a,description:r,groups:n,contained:s}){return n.length?e(c,{contained:s,className:"py-6",children:t("div",{className:"flex flex-col gap-10",children:[(a||r)&&t("div",{className:"flex max-w-[680px] flex-col gap-3",children:[a&&e("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium leading-[1.05] tracking-[-0.03em] max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:o(a,!1)}),r&&d(r).map((l,i)=>e("p",{className:"text-[15px] leading-[1.6] opacity-85",children:m(l)},i))]}),n.map((l,i)=>e(f,{group:l},`${l.name}-${i}`))]})}):null}function f({group:a}){const r=a.columns.length>p;return t("div",{className:"flex flex-col gap-3",children:[a.name&&e("h3",{className:"font-mono text-[12px] uppercase tracking-[0.18em]",children:m(a.name)}),e("div",{className:r?"overflow-x-auto":void 0,children:t("table",{className:r?"w-full min-w-[560px] border-collapse text-[15px] tabular-nums":"w-full border-collapse text-[15px] tabular-nums",children:[e("caption",{className:"sr-only",children:a.name}),e("thead",{children:t("tr",{className:"border-b border-line",children:[e("td",{className:"py-2"}),a.columns.map((n,s)=>e("th",{scope:"col",className:"py-2 pl-4 text-right align-bottom text-[12px] font-normal opacity-60",children:n},s))]})}),e("tbody",{children:a.rows.map((n,s)=>t("tr",{className:"border-b border-line last:border-b-0",children:[e("th",{scope:"row",className:"py-3 pr-2 text-left align-baseline font-normal",children:m(n.label)}),n.cells.map((l,i)=>e("td",{className:`whitespace-nowrap py-3 pl-4 text-right align-baseline${l.standard||!l.amount?" opacity-60":""}`,children:l.amount||x},i))]},s))})]})})]})}export{x as RATE_NONE,h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as _,jsxs as r}from"react/jsx-runtime";import{useState as a}from"react";import{products as k}from"../lib/api/index.js";import j from"efficient-web-builder/render/components/SectionEyebrow";import n,{FieldCaption as q}from"./WebFormField.js";import{renderHeadline as z}from"efficient-web-builder/render/components/goldPhrases";import{FIELD_INPUT_CLASS as l}from"../lib/field-input.js";const A="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",I="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] pt-0 pb-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]";function M({eyebrow:
|
|
1
|
+
"use client";import{jsx as e,Fragment as _,jsxs as r}from"react/jsx-runtime";import{useState as a}from"react";import{products as k}from"../lib/api/index.js";import j from"efficient-web-builder/render/components/SectionEyebrow";import n,{FieldCaption as q}from"./WebFormField.js";import{renderHeadline as z}from"efficient-web-builder/render/components/goldPhrases";import{FIELD_INPUT_CLASS as l}from"../lib/field-input.js";const A="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",I="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] pt-0 pb-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]";function M({eyebrow:u,title:p,designCode:x,omitHead:d=!1,editing:g=!1}={}){const[f,w]=a(""),[o,N]=a(""),[i,y]=a(0),[m,S]=a(""),[h,F]=a(""),[c,v]=a(!1),[R,C]=a(!1),[b,s]=a(null);async function E(t){if(t.preventDefault(),!(g||c)){if(i<1){s("Choose a star rating.");return}v(!0),s(null);try{await k.submitReview({authorName:f.trim(),...o.trim()?{email:o.trim()}:{},rating:i,...m.trim()?{title:m.trim()}:{},body:h.trim(),...x?.trim()?{designCode:x.trim()}:{}}),C(!0)}catch{s("Something went wrong — your review wasn't sent. Please try again.")}finally{v(!1)}}}return e("section",{className:"relative z-[2] border-t border-line bg-surface",children:r("div",{className:d?I:A,children:[d?null:r(_,{children:[(u??"").trim()&&e(j,{text:u??"",scaled:!1,className:"mb-4 block"}),(p??"").trim()&&e("h2",{className:"mb-12 font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.02em] text-fg max-view-wide:mb-8 max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:z(p??"",!1)})]}),R?e("p",{role:"status",className:"max-w-[560px] font-serif text-[19px] italic leading-[1.6] text-fg-dim",children:"Thanks — your review will appear once approved."}):r("form",{className:"flex max-w-[720px] flex-col gap-5",onSubmit:E,children:[r("div",{className:"grid grid-cols-2 gap-3 max-[640px]:grid-cols-1",children:[e(n,{label:"Name",required:!0,children:e("input",{type:"text",required:!0,value:f,onChange:t=>w(t.target.value),className:l})}),e(n,{label:"Email — never shown publicly",children:e("input",{type:"email",value:o,onChange:t=>N(t.target.value),className:l})})]}),r("div",{className:"flex flex-col gap-2",children:[e(q,{required:!0,children:"Rating"}),e("div",{role:"group","aria-label":"Rating",className:"flex gap-1",children:[1,2,3,4,5].map(t=>e("button",{type:"button","aria-pressed":i>=t,"aria-label":`${t} star${t===1?"":"s"}`,onClick:()=>{y(t),s(null)},className:["cursor-pointer text-[30px] leading-none transition-colors",i>=t?"text-accent":"text-fg-dim/30 hover:text-fg-dim"].join(" "),children:"★"},t))})]}),e(n,{label:"Review title (optional)",children:e("input",{type:"text",value:m,onChange:t=>S(t.target.value),className:l})}),e(n,{label:"Your review",required:!0,children:e("textarea",{required:!0,rows:5,value:h,onChange:t=>F(t.target.value),className:l+" resize-y"})}),b&&e("p",{role:"alert",className:"font-mono text-[12px] uppercase tracking-[0.18em] text-alert",children:b}),e("button",{type:g?"button":"submit",disabled:c,className:"cursor-pointer self-start bg-btn px-8 py-4 font-mono text-[14px] uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg hover:text-bg disabled:cursor-wait disabled:opacity-60",children:c?"Sending…":"Submit review →"})]})]})})}export{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as h,jsxs as i}from"react/jsx-runtime";import u from"efficient-web-builder/render/components/SectionEyebrow";import{renderHeadline as b,splitParagraphs as v}from"efficient-web-builder/render/components/goldPhrases";import N from"./RatingStars.js";const t={headingMediumUpTo800:"max-
|
|
1
|
+
import{jsx as e,Fragment as h,jsxs as i}from"react/jsx-runtime";import u from"efficient-web-builder/render/components/SectionEyebrow";import{renderHeadline as b,splitParagraphs as v}from"efficient-web-builder/render/components/goldPhrases";import N from"./RatingStars.js";import y from"./SectionBand.js";const t={headingMediumUpTo800:"max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",headingMedium:"text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))]",bodySmall:"text-[length:var(--size-body,15px)]",bodyLarge:"text-[length:var(--size-body,19px)]",label:"text-[length:var(--size-label,12px)]"},w="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",M="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] pt-0 pb-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]";function k({look:d,eyebrow:n,title:r,columns:p,rows:s=[],editing:o=!1,sample:x=!1,cards:g,omitHead:l=!1}){const c=Math.min(3,Math.max(1,p??3));return!o&&s.length===0?null:i(y,{className:"relative z-[2] border-t border-line bg-surface",column:l?M:w,children:[l?null:i(h,{children:[(n??"").trim()&&e(u,{text:n??"",look:d,className:"mb-4 block"}),(r??"").trim()&&e("h2",{className:`mb-12 font-heading2 ${t.headingMedium} font-medium uppercase leading-none tracking-[-0.02em] text-fg max-view-wide:mb-8 ${t.headingMediumUpTo800}`,children:b(r??"",!1)})]}),e("div",{className:"sf-card grid grid-cols-1 gap-px border border-line bg-line min-[700px]:[grid-template-columns:repeat(var(--rv-cols),minmax(0,1fr))]",style:{"--rv-cols":String(c)},children:g??s.map(a=>i("article",{className:["flex flex-col gap-4 bg-bg p-10 max-view-wide:p-8",x?"opacity-60":""].join(" "),children:[a.rating!==void 0&&e(N,{rating:a.rating}),(a.title??"").trim()&&e("h3",{className:`font-display ${t.bodyLarge} font-medium uppercase leading-[1.2] tracking-[-0.01em] text-fg`,children:a.title}),e("div",{className:`flex-1 font-serif ${t.bodySmall} leading-[1.65] text-fg-dim`,children:v(a.quote).map((f,m)=>e("p",{className:m?"mt-3":"",children:f},m))}),i("footer",{className:"flex items-baseline justify-between gap-4 border-t border-line pt-5",children:[e("span",{className:`font-mono ${t.label} uppercase tracking-[0.22em] text-fg`,children:a.name}),e("span",{className:`font-mono ${t.label} uppercase tracking-[0.18em] text-fg-dim`,children:a.meta??""})]})]},a.key))})]})}export{k as default};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from "react";
|
|
2
|
-
export
|
|
3
|
-
export default function SectionBand({ className, capped, style, id, children, }: {
|
|
2
|
+
export { BAND_CAP } from "../lib/sections/section-band.js";
|
|
3
|
+
export default function SectionBand({ className, capped, column, style, defaults, id, attrs, children, }: {
|
|
4
4
|
className: string;
|
|
5
5
|
capped?: boolean;
|
|
6
|
+
column?: string | null;
|
|
6
7
|
style?: CSSProperties;
|
|
8
|
+
defaults?: CSSProperties;
|
|
7
9
|
id?: string;
|
|
10
|
+
attrs?: Record<string, string>;
|
|
8
11
|
children?: ReactNode;
|
|
9
12
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{EDITORIAL_COLUMN as B}from"efficient-web-builder/format/lib/content/page-width";import{BAND_CAP as A,bandClassesInBox as d}from"../lib/sections/section-band.js";import C from"./SectionBandChoice.js";import{BAND_CAP as j}from"../lib/sections/section-band.js";function N({className:i,capped:p=!1,column:n=B,style:e,defaults:s,id:r,attrs:a,children:t}){const f=d(i),c=n===null?"":d(n),m=o("section",{...a,className:f||void 0,style:e,id:r,children:c?o("div",{className:c,children:t}):t}),l=s?{...s,...e}:e,x=o("section",{...a,className:p?`${A} ${i}`:i,style:l,id:r,children:n===null?t:o("div",{className:n,children:t})});return o(C,{inBox:m,atTop:x})}export{j as BAND_CAP,N as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{Fragment as r,jsx as n}from"react/jsx-runtime";import{useInsideSiteGutter as i}from"efficient-web-builder/render/components/SiteGutterFrame";function o({inBox:e,atTop:t}){return n(r,{children:i()?e:t})}export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as E,jsx as e,jsxs as l}from"react/jsx-runtime";import z from"./SectionBand.js";import{useScopeClass as I}from"../lib/use-scope-class.js";import{useState as C}from"react";import R from"efficient-web-builder/render/components/SectionHeader";import{CardTemplateRows as D}from"efficient-web-builder/render/components/CardRowContext";import j from"./WheelSvg.js";import{renderGold as w,renderHeadline as V}from"efficient-web-builder/render/components/goldPhrases";import{inchLabel as y}from"../lib/wheels/spec-format.js";import W from"./DimensionArrowMarkers.js";import B from"./SpecTablePartBridge.js";import{SPEC_REGION_ATTR as A}from"efficient-web-builder/format/lib/sections/spec-table-regions";import{say as _}from"efficient-web-builder/format/lib/editor-words";import{applyShopMark as M}from"efficient-web-builder/format/lib/markup";import{useEnglish as P}from"./EnglishVariant.js";import{sizedImage as G}from"efficient-web-builder/format/lib/sized-image";const $={between:"[&>*+*]:border-t [&>*+*]:border-line",every:"[&>*]:border-t [&>*]:border-line"},T="[&_sup.text-accent.tracking-normal]:static [&_sup.text-accent.tracking-normal]:align-baseline [&_sup.text-accent.tracking-normal]:[font-size:inherit] [&_sup.text-accent.tracking-normal]:text-current [&_sup.text-accent.tracking-normal]:tracking-[inherit]",H="(max-width: 1100px) 80vw, 290px",d={labelSmall:"text-[length:var(--size-label,11px)]",label:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,14px)]"};function r(i,a){return i?{[A]:a}:{}}function O({editing:i,nodeId:a,children:
|
|
1
|
+
"use client";import{Fragment as E,jsx as e,jsxs as l}from"react/jsx-runtime";import z from"./SectionBand.js";import{useScopeClass as I}from"../lib/use-scope-class.js";import{useState as C}from"react";import R from"efficient-web-builder/render/components/SectionHeader";import{CardTemplateRows as D}from"efficient-web-builder/render/components/CardRowContext";import j from"./WheelSvg.js";import{renderGold as w,renderHeadline as V}from"efficient-web-builder/render/components/goldPhrases";import{inchLabel as y}from"../lib/wheels/spec-format.js";import W from"./DimensionArrowMarkers.js";import B from"./SpecTablePartBridge.js";import{SPEC_REGION_ATTR as A}from"efficient-web-builder/format/lib/sections/spec-table-regions";import{say as _}from"efficient-web-builder/format/lib/editor-words";import{applyShopMark as M}from"efficient-web-builder/format/lib/markup";import{useEnglish as P}from"./EnglishVariant.js";import{sizedImage as G}from"efficient-web-builder/format/lib/sized-image";const $={between:"[&>*+*]:border-t [&>*+*]:border-line",every:"[&>*]:border-t [&>*]:border-line"},T="[&_sup.text-accent.tracking-normal]:static [&_sup.text-accent.tracking-normal]:align-baseline [&_sup.text-accent.tracking-normal]:[font-size:inherit] [&_sup.text-accent.tracking-normal]:text-current [&_sup.text-accent.tracking-normal]:tracking-[inherit]",H="(max-width: 1100px) 80vw, 290px",d={labelSmall:"text-[length:var(--size-label,11px)]",label:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,14px)]"};function r(i,a){return i?{[A]:a}:{}}function O({editing:i,nodeId:a,children:s}){return!i||!a?e(E,{children:s}):e(B,{nodeId:a,children:s})}function L({row:i,topBorder:a,editing:s}){return l("div",{className:`flex items-baseline justify-between gap-6 py-4 font-mono ${d.labelLarge} tracking-[0.05em] ${a?"border-t border-line":""}`,children:[e("span",{...r(s,"rowLabel"),className:"uppercase text-fg-dim",children:i.label}),e("span",{...r(s,"rowValue"),className:`text-right ${i.accent?"text-accent":"text-fg"}`,children:i.value})]})}function F({diagram:i,editing:a}){const[s,b]=C(!1),c=I("spec"),{wheelName:p,imageSrc:n,diameter:f,width:g,offset:h,holes:v,pcd:k,spokes:m,mesh:o,bore:S}=i,u=!!n&&!s;return l("div",{className:"sf-card bg-surface p-6 max-view-desktop:mt-8",children:[e("div",{...r(a,"diagramTitle"),className:`mb-3 font-mono ${d.label} uppercase tracking-[0.25em] text-fg-dim`,children:"Wheel Dimension Diagram"}),l("div",{className:"relative flex aspect-square items-center justify-center",children:[l("svg",{viewBox:"0 0 320 320",className:"absolute inset-0 h-full w-full text-fg-dim",fill:"none",stroke:"currentColor",children:[e("line",{x1:40,y1:20,x2:280,y2:20,strokeWidth:1,markerStart:`url(#${c}-L)`,markerEnd:`url(#${c}-R)`}),e("line",{x1:40,y1:15,x2:40,y2:25,strokeWidth:1}),e("line",{x1:280,y1:15,x2:280,y2:25,strokeWidth:1}),e(W,{id:c})]}),u?e("img",{...G(n,{fallbackWidth:960}),sizes:H,alt:`${p} — face`,onError:()=>b(!0),loading:"lazy",className:"relative z-[1] block h-[80%] w-[80%] object-contain"}):e(j,{spokes:m,mesh:o,className:"relative z-[1] block h-[72%] w-[72%] text-accent"}),l("span",{...r(a,"diagramCallout"),className:`absolute top-1.5 left-1/2 z-20 -translate-x-1/2 bg-surface px-2 font-mono ${d.label} tracking-[0.2em] text-accent`,children:["⌀ ",y(f)]}),l("span",{...r(a,"diagramCallout"),className:`absolute bottom-1.5 left-1/2 z-20 -translate-x-1/2 bg-surface px-2 font-mono ${d.label} tracking-[0.2em] text-fg`,children:["WIDTH ",y(g)]})]}),l("div",{className:`mt-4 grid grid-cols-5 gap-3 font-mono ${d.labelSmall} uppercase tracking-[0.2em] text-fg-dim max-[480px]:grid-cols-3`,children:[l("div",{children:[e("div",{...r(a,"diagramStatLabel"),className:"text-fg-dim/60",children:"Holes"}),e("div",{...r(a,"diagramStatValue"),className:"mt-1 text-fg",children:v})]}),l("div",{children:[e("div",{...r(a,"diagramStatLabel"),className:"text-fg-dim/60",children:"PCD"}),e("div",{...r(a,"diagramStatValue"),className:"mt-1 text-fg",children:k})]}),l("div",{children:[e("div",{...r(a,"diagramStatLabel"),className:"text-fg-dim/60",children:"Spokes"}),l("div",{...r(a,"diagramStatValue"),className:"mt-1 text-fg",children:[m,o?" + Mesh":""]})]}),l("div",{children:[e("div",{...r(a,"diagramStatLabel"),className:"text-fg-dim/60",children:"Bore"}),e("div",{...r(a,"diagramStatValue"),className:"mt-1 text-fg",children:S})]}),l("div",{children:[e("div",{...r(a,"diagramStatLabel"),className:"text-fg-dim/60",children:"ET"}),e("div",{...r(a,"diagramStatValue"),className:"mt-1 text-accent",children:h})]})]})]})}function Y({num:i,title:a,description:s,rows:b,builtInLabels:c=!1,diagram:p,editing:n=!1,omitHead:f=!1,nodeId:g,capped:h=!0,template:v}){const k=P(),m=(b??[]).filter(t=>(t?.label??"").trim()||(t?.value??"").trim()).map(t=>c&&t.label?{...t,label:k(t.label)}:t),o=m.length>0?m:n?[{label:_("Label"),value:_("Value")}]:[],S=o.map(t=>({label:t.label??"",value:t.accent&&t.value?M(t.value,0,t.value.length,"highlight").text:t.value??""})),u=t=>p?l("div",{className:"grid grid-cols-[1fr_400px] gap-12 max-view-desktop:grid-cols-1",children:[e("div",{className:t?`${$.between} ${T}`:void 0,children:t??o.map((N,x)=>e(L,{row:N,topBorder:x>0,editing:n},x))}),e(F,{diagram:p,editing:n})]}):e("div",{className:`grid grid-cols-2 gap-x-16 max-[900px]:grid-cols-1${t?` ${$.every} ${T}`:""}`,children:t??o.map((N,x)=>e(L,{row:N,topBorder:!0,editing:n},x))});return e(z,{className:f?"border-b border-line pt-0 pb-[120px] max-view-desktop:pt-0 max-view-desktop:pb-20":"border-b border-line py-[120px] max-view-desktop:py-20",capped:h,children:l(O,{editing:n,nodeId:g,children:[f?null:e(R,{num:i?w(i):void 0,title:a?V(a,!1):void 0,description:s?w(s):void 0,accent:!0}),e(D,{ownerId:g??"",ownerType:"SpecTable",Template:v,rows:S,fallback:u(),children:t=>u(t)})]})})}export{Y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as r,jsxs as h}from"react/jsx-runtime";import c from"./SectionBand.js";import{useBoundForm as F,useFormSubmission as S}from"./formSubmission.js";import{SubmitFormColumn as j,SubmitHead as B}from"./submit/SubmitRegions.js";import{SUBMIT_DEFAULTS as e}from"../lib/sections/submit-build-copy.js";function o(t,i){return t===void 0?i:t}function L({eyebrow:t,title:i,body:l,buttonText:b,consent:f,formSlug:m,form:w,editing:n=!1,boxes:p,inBoxes:g=!1}){const a=o(t,e.eyebrow),d=o(i,e.title),x=o(l,e.body),y=o(b,e.buttonText),v=o(f,e.consent),s=F(m,w),k=S({form:s,formSlug:m,editing:n}),T=s===void 0,u=!!s||n;return!u&&!a&&!d&&!x?null:g&&p?r(c,{className:"border-y border-line py-[120px] max-view-desktop:py-[60px]",children:r(p,{className:"grid grid-cols-2 items-start gap-[60px] max-view-desktop:grid-cols-1 max-view-desktop:gap-10"})}):h(c,{className:"border-y border-line py-[120px] max-view-desktop:py-[60px]",column:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-2 items-end gap-[60px] px-[var(--sf-site-gutter,40px)] max-view-desktop:grid-cols-1 max-view-desktop:gap-10 max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))]",children:[r(B,{eyebrow:a,title:d}),r(j,{body:x,buttonLabel:y,consent:v,form:s,submission:k,showForm:u,resolving:T,editing:n})]})}export{L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as
|
|
1
|
+
"use client";import{jsx as t,jsxs as i}from"react/jsx-runtime";import D from"./SectionBand.js";import{useState as G}from"react";import{SiteLink as U}from"efficient-web-builder/render/lib/site-runtime";import{NEWSLETTER_SOURCE as q}from"../lib/newsletter-signup.js";import A from"efficient-web-builder/render/components/EditorialSectionHead";import v from"efficient-web-builder/render/components/SectionEyebrow";import{renderChrome as B,renderGold as n,renderHeadline as y}from"efficient-web-builder/render/components/goldPhrases";import{useNewsletterSignup as F}from"./useNewsletterSignup.js";const r={issueSubline:"text-[length:var(--size-body,13px)]",issueTitle:"text-[length:var(--size-body,16px)]",intro:"text-[length:var(--size-body,19px)]",note:"text-[length:var(--size-label,12px)]",label:"text-[length:var(--size-label,13px)]",field:"text-[length:var(--size-label,14px)]"},H="That didn't go through — please try again.";function M({headNum:k,headTitle:s,headDesc:w,kicker:d,leadTitle:m,intro:c,emailPlaceholder:N,submitText:S,subscribedText:j,finePrint:p,issuesHeading:x,issues:E,archiveText:b,archiveHref:_,source:$=q.subscribeSection,editing:z=!1}){const[u,L]=G(""),{status:a,submit:T}=F({source:$,dryRun:z}),o=a==="sent",f=a==="sending",I=a==="error"||a==="invalid",g=(E??[]).filter(e=>(e?.n??"").trim()||(e?.title??"").trim()||(e?.date??"").trim()),l=g.length>0,C=o?j||"Subscribed ✓":f?"Sending…":S||"Subscribe →";function R(e){e.preventDefault(),!o&&T({email:u})}return i(D,{className:"border-b border-line py-[140px] max-view-desktop:py-20",children:[t(A,{num:k,title:s?y(s,!0):void 0,desc:w,accentTracking:"-0.025em"}),i("div",{className:l?"grid min-h-[460px] grid-cols-[1.1fr_1fr] border border-line max-view-desktop:grid-cols-1":"grid min-h-[460px] grid-cols-1 border border-line",children:[i("div",{className:l?"flex flex-col justify-center gap-6 border-r border-line px-14 py-16 max-view-desktop:border-r-0 max-view-desktop:border-b max-view-desktop:px-8 max-view-desktop:py-12":"flex flex-col justify-center gap-6 px-14 py-16 max-view-desktop:px-8 max-view-desktop:py-12",children:[d&&t(v,{text:d}),m&&t("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(40px,5vw,72px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.035em]",children:y(m,!0)}),c&&t("p",{className:`max-w-[480px] font-serif ${r.intro} italic leading-[1.5] text-fg-dim`,children:n(c,!0)}),i("form",{className:"mt-2 flex max-w-[520px]",onSubmit:R,children:[t("input",{type:"email",placeholder:N||"your@email.com",required:!0,value:u,onChange:e=>L(e.target.value),disabled:o,className:`flex-1 border border-r-0 border-line bg-bg px-5 py-5 font-mono ${r.field} uppercase tracking-[0.18em] text-fg placeholder:text-fg-dim outline-none focus:border-accent`}),t("button",{type:"submit",disabled:o||f,className:`border border-btn bg-btn px-8 py-5 font-mono ${r.label} uppercase tracking-[0.3em] text-btn-ink transition-colors hover:bg-fg hover:border-fg disabled:cursor-default disabled:opacity-90`,children:B(C)})]}),I&&t("p",{role:"alert",className:`max-w-[480px] font-mono ${r.note} uppercase leading-[1.7] tracking-[0.18em] text-alert`,children:H}),p&&t("p",{className:`max-w-[480px] font-mono ${r.note} uppercase leading-[1.7] tracking-[0.18em] text-fg-dim`,children:n(p)})]}),l&&i("div",{id:"sub-recent-issues",className:"grid grid-rows-[auto_1fr_auto] gap-6 bg-[var(--journal-panel-bg)] px-12 py-12 scroll-mt-[160px] max-view-desktop:px-8 max-view-desktop:py-10",children:[x&&t(v,{text:x,size:12}),t("div",{className:"flex flex-col",children:g.map((e,h)=>i("div",{className:["grid grid-cols-[60px_1fr_auto] items-start gap-5 border-b border-line py-5",h===0?"border-t border-line":""].join(" "),children:[t("span",{className:`font-mono ${r.label} tracking-[0.22em] text-accent`,children:e.n?n(e.n):""}),i("span",{className:`font-display ${r.issueTitle} font-medium leading-[1.3] tracking-[-0.01em]`,children:[e.title?n(e.title):"",e.small?.trim()&&t("small",{className:`mt-1 block font-serif ${r.issueSubline} font-normal italic text-fg-dim`,children:n(e.small,!0)})]}),t("span",{className:`whitespace-nowrap pt-1 text-right font-mono ${r.note} uppercase tracking-[0.22em] text-fg-dim`,children:e.date?n(e.date):""})]},h))}),b&&t(U,{href:_||"/journal",className:`flex items-center justify-end gap-3 font-mono ${r.note} uppercase tracking-[0.22em] text-accent hover:text-fg`,children:n(b)})]})]})]})}export{H as SIGNUP_FAILED,M as default};
|
|
@@ -28,7 +28,7 @@ export declare function useThemedSelect({ items, value, onPick, open: openProp,
|
|
|
28
28
|
activeId: string | undefined;
|
|
29
29
|
};
|
|
30
30
|
export type SelectTone = "select" | "cell" | "hairline" | "region";
|
|
31
|
-
export declare function ThemedSelectList({ id, tone, items, value, focusIdx, onFocus, onPick, listRef, ariaLabel, }: {
|
|
31
|
+
export declare function ThemedSelectList({ id, tone, items, value, focusIdx, onFocus, onPick, listRef, ariaLabel, align, }: {
|
|
32
32
|
id: string;
|
|
33
33
|
tone: SelectTone;
|
|
34
34
|
items: readonly SelectItem[];
|
|
@@ -38,6 +38,7 @@ export declare function ThemedSelectList({ id, tone, items, value, focusIdx, onF
|
|
|
38
38
|
onPick: (value: string) => void;
|
|
39
39
|
listRef?: RefObject<HTMLUListElement | null>;
|
|
40
40
|
ariaLabel?: string;
|
|
41
|
+
align?: "start" | "end";
|
|
41
42
|
}): import("react").JSX.Element;
|
|
42
43
|
interface ThemedSelectProps {
|
|
43
44
|
value?: string;
|
|
@@ -54,6 +55,7 @@ interface ThemedSelectProps {
|
|
|
54
55
|
name?: string;
|
|
55
56
|
id?: string;
|
|
56
57
|
"aria-label"?: string;
|
|
58
|
+
align?: "start" | "end";
|
|
57
59
|
}
|
|
58
|
-
export default function ThemedSelect({ value, onChange, disabled, children, className, style, name, id, "aria-label": ariaLabel, }: ThemedSelectProps): import("react").JSX.Element;
|
|
60
|
+
export default function ThemedSelect({ value, onChange, disabled, children, className, style, name, id, "aria-label": ariaLabel, align, }: ThemedSelectProps): import("react").JSX.Element;
|
|
59
61
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as v,Fragment as F,jsxs as M}from"react/jsx-runtime";import{Children as H,isValidElement as K,useEffect as _,useId as O,useLayoutEffect as $,useRef as y,useState as j}from"react";import{firstFocus as D,selectKey as B,TYPEAHEAD_RESET_MS as C}from"../lib/select-keys.js";import{placeMenu as A}from"efficient-shell/ui";const z={body:"text-[length:var(--size-body,14px)]",label:"text-[length:var(--size-label,13px)]"};function P({items:t,value:u,onPick:r,open:a,onOpen:m,onClose:o}){const[x,d]=j(!1),f=a!==void 0,l=f?a:x,[n,p]=j(0),e=y({text:"",timer:0}),h=y(null),w=y(null),s=y(null),T=O(),k=y(null),E=t.findIndex(i=>i.value===u),b=i=>{i!==l&&(f||d(i),i?m?.():o?.())},I=i=>{const g=t[i];!g||g.disabled||(r(g.value),b(!1),w.current?.focus())},S=i=>{const g={open:l,focus:l?n:D(t,E),typed:e.current.text},c=B(g,i,t);return!c.handled&&c.state.open===l?!1:(c.state.typed!==g.typed&&(e.current.text=c.state.typed,window.clearTimeout(e.current.timer),e.current.timer=window.setTimeout(()=>{e.current.text=""},C)),p(c.state.focus),c.commit!==void 0?I(c.commit):b(c.state.open),c.refocus&&w.current?.focus(),c.handled)},R=y(S);R.current=S;const L=y(()=>b(!1));L.current=()=>b(!1);const N=i=>{l||(k.current=i.nativeEvent,R.current(i.key)&&i.preventDefault())};return _(()=>{if(!l)return;const i=c=>{h.current?.contains(c.target)||L.current()},g=c=>{c!==k.current&&R.current(c.key)&&c.preventDefault()};return document.addEventListener("mousedown",i),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",g)}},[l]),_(()=>{l&&(e.current.text||p(D(t,E)))},[l]),$(()=>{if(!l||!s.current)return;s.current.children.item(n)?.scrollIntoView({block:"nearest"})},[n,l]),{open:l,toggle:()=>b(!l),close:()=>b(!1),focusIdx:n,setFocusIdx:p,pick:i=>I(t.findIndex(g=>g.value===i)),wrapRef:h,triggerRef:w,listRef:s,listId:T,onTriggerKeyDown:N,activeId:l?`${T}-${n}`:void 0}}const V={select:{list:"absolute left-0 top-full z-50 mt-1 max-h-[280px] w-max min-w-full overflow-y-auto border-2 border-accent bg-bg shadow-xl",item:(t,u,r)=>["px-3 py-3 font-mono text-[13px] font-semibold uppercase tracking-[0.1em] transition-colors whitespace-nowrap",r?"cursor-not-allowed opacity-40":"cursor-pointer",t&&!r?"bg-accent text-bg":"bg-bg text-fg"].join(" ")},cell:{list:"absolute left-0 top-full z-50 mt-1 max-h-[320px] w-max min-w-full overflow-y-auto border-2 border-accent bg-bg shadow-xl",item:t=>[`cursor-pointer whitespace-nowrap px-6 py-3 font-mono ${z.label} font-semibold uppercase tracking-[0.1em] transition-colors`,t?"bg-accent text-bg":"bg-bg text-fg"].join(" "),pickerMarker:!0},hairline:{list:"absolute left-0 top-full z-50 max-h-[320px] w-full overflow-y-auto border border-line bg-bg shadow-[0_6px_20px_rgba(0,0,0,0.10)]",item:(t,u)=>[`flex cursor-pointer items-center justify-between gap-4 border-b border-line px-4 py-3 text-left ${z.body} transition-colors last:border-b-0`,u?"border-fg font-medium text-fg":t?"border-fg text-fg":"text-fg-dim"].join(" "),pickerMarker:!0},region:{list:"absolute right-0 top-full z-[200] mt-2 flex min-w-[240px] flex-col border border-line bg-surface text-fg",item:(t,u,r,a)=>["flex w-full cursor-pointer items-center gap-3 px-4 py-3 text-left transition-colors","font-mono text-[13px] uppercase tracking-[0.18em]",t?"bg-surface-2 text-fg":"",a?"":"border-b border-line",u?"text-accent":""].join(" "),itemStyle:t=>t?void 0:{color:"color-mix(in oklab, currentColor 80%, transparent)"}}};function Y(t,u){$(()=>{const r=t.current,a=r?.ownerDocument.defaultView;if(!r||!a)return;const m=()=>{const o=r.style;o.top=o.bottom=o.marginTop=o.marginBottom=o.maxHeight=o.overflowY=o.translate="";const x=r.offsetParent??r.parentElement;if(!x)return;const d=x.getBoundingClientRect(),f=r.getBoundingClientRect(),l=Math.abs(f.right-d.right)<Math.abs(f.left-d.left)?"end":"start",n=A({trigger:{left:d.left,right:d.right,top:d.top,bottom:d.bottom},menu:{width:f.width,height:f.height},bounds:{left:0,top:0,right:a.innerWidth,bottom:a.innerHeight},align:l,side:"bottom"});if(n.side==="top"){o.top="auto",o.bottom="100%",o.marginTop="0px";const e=n.top+Math.min(f.height,n.maxHeight);o.marginBottom=`${Math.max(0,d.top-e)}px`}n.maxHeight<f.height&&(o.maxHeight=`${n.maxHeight}px`,o.overflowY="auto");const p=n.left-f.left;p&&(o.translate=`${p}px`)};return m(),a.addEventListener("resize",m),a.addEventListener("scroll",m,!0),()=>{a.removeEventListener("resize",m),a.removeEventListener("scroll",m,!0)}},[t,u])}function X(t){return t.split(" ").map(u=>u==="left-0"?"right-0":u).join(" ")}function W({id:t,tone:u,items:r,value:a,focusIdx:m,onFocus:o,onPick:x,listRef:d,ariaLabel:f,align:l="start"}){const n=V[u],p=y(null);return Y(p,r.length),v("ul",{ref:e=>{p.current=e,d&&(d.current=e)},id:t,role:"listbox","aria-label":f,...n.pickerMarker?{"data-picker-menu":""}:{},className:l==="end"?X(n.list):n.list,children:r.map((e,h)=>{const w=e.value===a;return v("li",{id:`${t}-${h}`,role:"option","aria-selected":w,"aria-disabled":e.disabled||void 0,onMouseEnter:()=>!e.disabled&&o(h),onMouseDown:s=>{s.preventDefault(),e.disabled||x(e.value)},className:n.item(h===m,w&&e.value!=="",!!e.disabled,h===r.length-1),style:n.itemStyle?.(w),children:e.meta===void 0?e.label:M(F,{children:[e.lead,v("span",{className:"flex-1 whitespace-nowrap",children:e.label}),v("span",{className:"ml-auto text-[12px] opacity-50",children:e.meta})]})},`${e.value}_${h}`)})})}function Z({value:t,onChange:u,disabled:r,children:a,className:m,style:o,name:x,id:d,"aria-label":f,align:l}){const n=H.toArray(a).flatMap(s=>{if(!K(s))return[];if(s.type!=="option")return[];const k=s.props,E=k.value!==void 0?String(k.value):"",b=k.children,I=typeof b=="string"||typeof b=="number"?String(b):E;return[{value:E,label:I,disabled:!!k.disabled}]}),p=t??"",e=P({items:n,value:p,onPick:s=>u?.({target:{value:s}})}),w=n.find(s=>s.value===p)?.label??n[0]?.label??"";return M("div",{ref:e.wrapRef,className:"relative",children:[x&&v("input",{type:"hidden",name:x,value:p}),v("button",{ref:s=>{e.triggerRef.current=s},type:"button",disabled:r,"aria-haspopup":"listbox","aria-expanded":e.open,"aria-controls":e.open?e.listId:void 0,"aria-activedescendant":e.activeId,"aria-label":f,id:d,onClick:()=>!r&&e.toggle(),onKeyDown:s=>!r&&e.onTriggerKeyDown(s),className:`block w-full ${m??""}`,style:o,children:v("span",{className:"block w-full truncate text-left",children:w})}),e.open&&v(W,{id:e.listId,tone:"select",items:n,value:p,focusIdx:e.focusIdx,onFocus:e.setFocusIdx,onPick:e.pick,listRef:e.listRef,align:l})]})}export{W as ThemedSelectList,Z as default,P as useThemedSelect};
|
|
@@ -2,8 +2,8 @@ import { type TyreFitAnswer } from "../lib/tyres/tyre-vehicle-fitment.js";
|
|
|
2
2
|
import type { TyreVariant } from "../lib/api/index.js";
|
|
3
3
|
export declare const TYRE_FITMENT_TITLE = "Will it fit *your car?*";
|
|
4
4
|
export declare const TYRE_FITMENT_DESCRIPTION = "Pick your vehicle and we\u2019ll tell you which of these sizes matches what it came on.";
|
|
5
|
-
export declare const BAND_INLINE = "border-b border-line py-[120px] max-
|
|
6
|
-
export declare const BAND_OWN_BOX = "border-b border-line pt-0 pb-[120px] max-
|
|
5
|
+
export declare const BAND_INLINE = "border-b border-line py-[120px] max-view-desktop:py-20";
|
|
6
|
+
export declare const BAND_OWN_BOX = "border-b border-line pt-0 pb-[120px] max-view-desktop:pt-0 max-view-desktop:pb-20";
|
|
7
7
|
export default function TyreVehicleFitment({ num, title, description, escapeText, escapeHref, omitHead, capped, slug, variants, onAnswer, }: {
|
|
8
8
|
num?: string;
|
|
9
9
|
title?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as t,jsxs as l}from"react/jsx-runtime";import y from"./SectionBand.js";import{useEffect as T,useRef as b}from"react";import N from"efficient-web-builder/render/components/SectionHeader";import v from"./TyreFitVerdicts.js";import{useTyreFitAnswer as _}from"./useTyreFitAnswer.js";import w from"./fitment/FitmentPickerGrid.js";import{useVehicleFit as E}from"./fitment/useVehicleFit.js";import{tyreFitQuery as F}from"../lib/tyres/tyre-vehicle-fitment.js";const k="Will it fit *your car?*",I="Pick your vehicle and we’ll tell you which of these sizes matches what it came on.",R="border-b border-line py-[120px] max-view-desktop:py-20",g="border-b border-line pt-0 pb-[120px] max-view-desktop:pt-0 max-view-desktop:pb-20";function j({num:a,title:p=k,description:m=I,escapeText:r,escapeHref:o,omitHead:i=!1,capped:u=!0,slug:d,variants:f,onAnswer:n}){const c=E({autoApply:!0}),{answer:e,loading:x,retry:h}=_(d,F(c.applied?.vehicle)),s=b(n);return s.current=n,T(()=>{s.current?.(e)},[e]),l(y,{className:i?g:R,capped:u,children:[i?null:t(N,{num:a,title:p,description:m,accent:!0}),t(w,{cascade:c.cascade}),r&&o?l("a",{href:o,className:"mt-6 inline-block font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-accent underline-offset-4 hover:underline",children:[r," →"]}):null,t(v,{variants:f,answer:e,loading:x,onRetry:h})]})}export{R as BAND_INLINE,g as BAND_OWN_BOX,I as TYRE_FITMENT_DESCRIPTION,k as TYRE_FITMENT_TITLE,j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,Fragment as p,jsxs as o}from"react/jsx-runtime";import{GAP_LENGTH_VAR as y,GAP_PHONE_LENGTH_VAR as j}from"efficient-web-builder/format/lib/content/container-gap";import g from"next/link";import{CardLookContext as k,CardRow as s}from"./card-pieces/card-row.js";import I from"./card-pieces/CardEyebrow.js";import O from"./card-pieces/CardName.js";import W from"./card-pieces/CardPicture.js";import{CardSpecLine as B}from"./card-pieces/CardSpecs.js";import{cardOutlineClass as H}from"efficient-web-builder/format/lib/sections/product-card-style";import{CARD_IMAGE_BG_OFF as K}from"efficient-web-builder/format/lib/content/card-image-background";const ar="sf-card-rows",or=a=>({rowGap:0,"--sf-card-row-gap":a}),sr=a=>j in a.style?"var(--sf-card-row-gap-auto)":`var(${y})`;import{CARD_PAD_X_PX as cr,GRID_GAP_PX as ir,SET_PLATE_PX as lr,SET_STACK_GAP_PX as dr,SET_STACK_MAX_PX as nr,setBandGapCss as fr,setBandGapPx as pr,setPlateWidthCss as mr}from"./card-pieces/CardPicture.js";import{CARD_SPEC_FIELD_CLASS as gr,cardSpecFields as wr}from"./card-pieces/CardSpecs.js";function M({variant:a="catalog",wide:m=!1,setGridGap:w,href:e,identityLink:C=!1,outline:
|
|
1
|
+
"use client";import{jsx as r,Fragment as p,jsxs as o}from"react/jsx-runtime";import{GAP_LENGTH_VAR as y,GAP_PHONE_LENGTH_VAR as j}from"efficient-web-builder/format/lib/content/container-gap";import g from"next/link";import{CardLookContext as k,CardRow as s}from"./card-pieces/card-row.js";import I from"./card-pieces/CardEyebrow.js";import O from"./card-pieces/CardName.js";import W from"./card-pieces/CardPicture.js";import{CardSpecLine as B}from"./card-pieces/CardSpecs.js";import{cardOutlineClass as H}from"efficient-web-builder/format/lib/sections/product-card-style";import{CARD_IMAGE_BG_OFF as K}from"efficient-web-builder/format/lib/content/card-image-background";const ar="sf-card-rows",or=a=>({rowGap:0,"--sf-card-row-gap":a}),sr=a=>j in a.style?"var(--sf-card-row-gap-auto)":`var(${y})`;import{CARD_PAD_X_PX as cr,GRID_GAP_PX as ir,SET_PLATE_PX as lr,SET_STACK_GAP_PX as dr,SET_STACK_MAX_PX as nr,setBandGapCss as fr,setBandGapPx as pr,setPlateWidthCss as mr}from"./card-pieces/CardPicture.js";import{CARD_SPEC_FIELD_CLASS as gr,cardSpecFields as wr}from"./card-pieces/CardSpecs.js";function M({variant:a="catalog",wide:m=!1,setGridGap:w,href:e,identityLink:C=!1,outline:u="none",imageBackgroundFill:x=K,containerProps:_,probes:t,indexBadge:c,badges:i,image:h,imageSecond:A,plate:G,eyebrow:v,reserveEyebrow:P=!1,name:S,spec:R,price:b,swatches:E,sizes:L,buy:D,wholeCardLink:F=!1}){const N=a==="catalog",T=r(W,{image:h,imageSecond:A,plate:G,wide:m,imageBackgroundFill:x,setGridGap:w}),l=[N?"sf-card sf-card-fill group relative flex min-h-[460px] flex-col bg-[var(--card-bg)] px-8 pt-8 pb-8 transition-colors duration-200 hover:bg-[var(--card-bg-hover)] [.sf-card-rows>&]:row-span-9 [.sf-card-rows>&]:mb-[var(--sf-card-row-gap)] [.sf-card-rows>&]:grid [.sf-card-rows>&]:grid-rows-subgrid [.sf-card-rows>&]:gap-y-0":"sf-card sf-card-fill group relative block bg-[var(--card-bg)] p-5 transition-colors duration-300 hover:bg-[var(--card-bg-hover)]",H(u),m?"col-span-2 max-view-wide:col-span-1 @max-[720px]:col-span-1":""].filter(Boolean).join(" "),d=o(p,{children:[T,r(I,{reserve:P,children:v}),r(O,{children:S})]}),n=o(p,{children:[r(B,{children:R}),b??o(p,{children:[r(s,{}),r(s,{})]}),E??r(s,{}),L??r(s,{}),D??r(s,{})]}),f=X=>r(k.Provider,{value:a,children:X});return f(e?C?o("article",{..._,className:l,children:[t,c,i,r(g,{href:e,className:`flex flex-col ${F?"after:absolute after:inset-0 after:content-['']":""} [.sf-card-rows>*>&]:row-span-3 [.sf-card-rows>*>&]:grid [.sf-card-rows>*>&]:grid-rows-subgrid [.sf-card-rows>*>&]:gap-y-0`,children:d}),n]}):o(g,{href:e,className:l,children:[t,c,i,d,n]}):o("article",{..._,className:l,children:[t,c,i,d,n]}))}export{cr as CARD_PAD_X_PX,ar as CARD_ROWS_GRID_CLASS,gr as CARD_SPEC_FIELD_CLASS,ir as GRID_GAP_PX,lr as SET_PLATE_PX,dr as SET_STACK_GAP_PX,nr as SET_STACK_MAX_PX,sr as cardRowsGap,or as cardRowsGridStyle,wr as cardSpecFields,M as default,fr as setBandGapCss,pr as setBandGapPx,mr as setPlateWidthCss};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { CardSpin } from "./card-spin.js";
|
|
1
2
|
interface Props {
|
|
2
3
|
imageLabel?: string;
|
|
3
4
|
src?: string;
|
|
4
5
|
alt?: string;
|
|
6
|
+
spin?: CardSpin;
|
|
5
7
|
}
|
|
6
|
-
export default function WheelPlaceholder({ src, alt }: Props): import("react").JSX.Element;
|
|
8
|
+
export default function WheelPlaceholder({ src, alt, spin }: Props): import("react").JSX.Element;
|
|
7
9
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as s}from"react/jsx-runtime";import{useState as c}from"react";import{sizedImage as n}from"efficient-web-builder/format/lib/sized-image";const d="(max-width: 640px) 100vw, (max-width: 1100px) 50vw, 33vw";function u({src:a,alt:r="",spin:t}){const[o,i]=c(!1),l=a||"";return e("div",{className:"relative aspect-square w-full overflow-hidden",children:s("div",{className:["absolute inset-0 flex items-center justify-center",t?.className].filter(Boolean).join(" "),style:t?.style,children:[e("div",{className:"absolute inset-0 z-[1] flex items-center justify-center",children:s("div",{className:"relative flex h-[70%] w-[70%] items-center justify-center rounded-full border-2",style:{borderColor:"var(--accent)"},children:[e("div",{className:"absolute inset-[10%] rounded-full border",style:{borderColor:"var(--accent)",opacity:.4}}),e("div",{className:"absolute left-1/2 top-1/2 h-[18%] w-[18%] -translate-x-1/2 -translate-y-1/2 rounded-full border-2",style:{borderColor:"var(--accent)"}}),e("div",{className:"absolute left-1/2 top-1/2 h-[6%] w-[6%] -translate-x-1/2 -translate-y-1/2 rounded-full",style:{background:"var(--accent)"}})]})}),l&&e("img",{...n(l,{fallbackWidth:960}),sizes:d,alt:r,className:"absolute inset-0 z-[2] h-full w-full object-contain",style:{display:o?"none":"block"},onError:()=>i(!0)})]})})}export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import{SAMPLE_CONFIRMATION as
|
|
1
|
+
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import{SAMPLE_CONFIRMATION as S,useBookingForm as z}from"./BookingFormState.js";import $ from"efficient-web-builder/render/components/Btn";import c from"../WebFormField.js";import{formatAppointment as w,formatAppointmentTime as T}from"../../lib/booking/appointment-time.js";import{formatMoneyInCurrency as B}from"../../lib/commerce.js";import{FREE_PRICE as A}from"../../lib/wheels/price-display.js";const d="w-full border-2 border-line bg-bg px-4 py-4 font-[family-name:var(--bk-value-font,var(--font-display))] text-[length:var(--bk-value-size,17px)] text-fg outline-none transition-colors placeholder:text-fg-dim hover:border-fg-dim focus:border-accent";function q(o,t){const a=Number(o);if(a===0)return A;try{return B(a,t)}catch{return`${t} ${o}`}}const p="font-[family-name:var(--bk-name-font,var(--font-mono))] text-[length:var(--bk-name-size,12px)]";function C({number:o,children:t}){return r("div",{className:"mb-4 flex items-center gap-3",children:[e("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full border border-line font-[family-name:var(--bk-step-font,var(--font-mono))] text-[length:var(--bk-step-size,11px)] font-semibold text-fg-dim",children:o}),e("h3",{className:"font-[family-name:var(--bk-step-font,var(--font-mono))] text-[length:var(--bk-step-size,12px)] font-semibold uppercase tracking-[0.2em] text-fg",children:t})]})}function j({eyebrow:o,heading:t,intro:a}){return r("div",{className:"mb-10 max-w-[760px]",children:[(o??"").trim()&&e("p",{className:"mb-4 font-mono text-[12px] font-semibold uppercase tracking-[0.24em] text-accent",children:o}),(t??"").trim()&&e("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.98] tracking-[-0.025em] text-fg max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:t}),(a??"").trim()&&e("p",{className:"mt-5 max-w-[660px] font-display text-[17px] leading-[1.65] text-fg-dim",children:a})]})}function R({style:o}={}){const{fieldPrefix:t,services:a,currency:u,serviceId:b,setServiceId:g,requiresPayment:x,date:h,earliestDate:v,setDate:k,setDateTouched:N,availability:i,loadingSlots:y,noSlotsMessage:s,selectedStart:f,setSelectedStart:l,customerTimezone:m}=z();return a?r("div",{className:"flex flex-col gap-10",style:o,children:[r("div",{children:[e(C,{number:"01",children:"Choose a service"}),e("div",{className:"grid gap-3 sm:grid-cols-2",children:a.map(n=>{const F=n.id===b;return r("button",{type:"button","aria-pressed":F,onClick:()=>g(n.id),className:`min-h-11 border p-4 text-left transition-colors ${F?"border-accent bg-accent/10":"border-line bg-bg hover:border-fg-dim"}`,children:[e("span",{className:"block font-[family-name:var(--bk-name-font,var(--font-display))] text-[length:var(--bk-name-size,18px)] font-medium text-fg",children:n.name}),r("span",{className:"mt-1 block font-[family-name:var(--bk-value-font,var(--font-mono))] text-[length:var(--bk-value-size,11px)] uppercase tracking-[0.14em] text-fg-dim",children:[n.durationMinutes," min · ",q(n.price,u)]}),n.description&&e("span",{className:"mt-3 block font-[family-name:var(--bk-note-font,var(--font-display))] text-[length:var(--bk-note-size,14px)] leading-[1.5] text-fg-dim",children:n.description})]},n.id)})}),x&&e("p",{className:"mt-3 font-[family-name:var(--bk-note-font,var(--font-mono))] text-[length:var(--bk-note-size,11px)] uppercase tracking-[0.14em] text-alert",role:"alert",children:"This service requires an upfront payment and cannot be booked through this form yet."})]}),r("div",{children:[e(C,{number:"02",children:"Choose a date and time"}),e(c,{separate:!0,htmlFor:`${t}-date`,label:"Date",required:!0,labelFace:p,children:e("input",{id:`${t}-date`,type:"date",min:v,value:h,onChange:n=>{N(!0),k(n.target.value)},className:d,required:!0})}),e("div",{className:"mt-4 grid grid-cols-2 gap-2 sm:grid-cols-3 min-[1200px]:grid-cols-4",role:"group","aria-label":"Available appointment times",children:y?e("p",{className:"col-span-full py-3 font-[family-name:var(--bk-note-font,var(--font-mono))] text-[length:var(--bk-note-size,11px)] uppercase tracking-[0.18em] text-fg-dim",children:"Loading times…"}):i?.slots.length?i.slots.map(n=>r("button",{type:"button","aria-pressed":f===n.start,onClick:()=>l(n.start),className:`min-h-11 border px-3 py-2 font-[family-name:var(--bk-value-font,var(--font-mono))] text-[length:var(--bk-value-size,12px)] font-semibold uppercase tracking-[0.12em] transition-colors ${f===n.start?"border-accent bg-accent text-bg":"border-line bg-bg text-fg hover:border-accent"}`,children:[e("span",{className:"block",children:T(n.start,m||i.timezone)}),m&&m!==i.timezone&&r("span",{className:"mt-0.5 block text-[9px] font-normal tracking-[0.08em] opacity-70",children:[T(n.start,i.timezone)," business"]})]},n.start)):s?e("p",{className:"col-span-full py-3 font-[family-name:var(--bk-note-font,var(--font-mono))] text-[length:var(--bk-note-size,11px)] uppercase tracking-[0.18em] text-fg-dim",role:"status",children:s}):null}),i?.timezone&&r("p",{className:"mt-3 font-[family-name:var(--bk-note-font,var(--font-mono))] text-[length:var(--bk-note-size,10px)] uppercase tracking-[0.16em] text-fg-dim",children:["Times shown in ",m||i.timezone,m&&m!==i.timezone?` · business timezone ${i.timezone}`:""]})]})]}):null}function O({buttonLabel:o,style:t}){const{fieldPrefix:a,editing:u,name:b,setName:g,email:x,setEmail:h,phone:v,setPhone:k,notes:N,setNotes:i,submitting:y,error:s,canSubmit:f}=z();return r("div",{className:"sf-card border border-line bg-bg p-5 min-[640px]:p-8",style:t,children:[e(C,{number:"03",children:"Your details"}),r("div",{className:"flex flex-col gap-4",children:[e(c,{separate:!0,htmlFor:`${a}-name`,label:"Name",required:!0,labelFace:p,children:e("input",{id:`${a}-name`,type:"text",autoComplete:"name",value:b,onChange:l=>g(l.target.value),className:d,required:!0})}),e(c,{separate:!0,htmlFor:`${a}-email`,label:"Email",required:!0,labelFace:p,children:e("input",{id:`${a}-email`,type:"email",inputMode:"email",autoComplete:"email",value:x,onChange:l=>h(l.target.value),className:d,required:!0})}),e(c,{separate:!0,htmlFor:`${a}-phone`,label:"Phone",labelFace:p,children:e("input",{id:`${a}-phone`,type:"tel",inputMode:"tel",autoComplete:"tel",value:v,onChange:l=>k(l.target.value),className:d})}),e(c,{separate:!0,htmlFor:`${a}-notes`,label:"What would you like to cover?",labelFace:p,children:e("textarea",{id:`${a}-notes`,rows:4,value:N,onChange:l=>i(l.target.value),className:`${d} resize-y`})})]}),s&&e("p",{className:"mt-4 font-[family-name:var(--bk-note-font,var(--font-mono))] text-[length:var(--bk-note-size,11px)] uppercase tracking-[0.16em] text-alert",role:"alert",children:s}),e($,{type:u?"button":"submit",disabled:!f,arrow:null,className:"mt-6 w-full disabled:cursor-not-allowed disabled:opacity-50",children:y?"Submitting…":(o??"").trim()||"Book appointment"})]})}function U({successMessage:o}){const{confirmation:t,customerTimezone:a}=z();return t?r("div",{className:"sf-card max-w-[760px] border border-line bg-bg p-6 min-[640px]:p-10",role:"status",children:[r("p",{className:"font-mono text-[12px] font-semibold uppercase tracking-[0.22em] text-accent",children:["Request received · ",t.bookingNumber]}),e("h3",{className:"mt-4 font-display text-[28px] font-medium uppercase text-fg",children:t.service}),e("p",{className:"mt-2 font-display text-[17px] text-fg-dim",children:w(t.startAt,t.customerTimezone||a||t.timezone)}),t.customerTimezone&&t.timezone!==t.customerTimezone&&r("p",{className:"mt-1 font-mono text-[10px] uppercase tracking-[0.16em] text-fg-dim",children:["Business time: ",w(t.startAt,t.timezone)]}),(o??"").trim()&&e("p",{className:"mt-5 max-w-[620px] font-serif text-[18px] italic leading-[1.6] text-fg-dim",children:o}),e($,{href:`/book/${encodeURIComponent(t.manageToken)}`,newTab:t!==S,variant:"ghost",className:"mt-8",children:"Manage booking"})]}):null}export{R as BookingChoose,U as BookingConfirmed,O as BookingDetails,j as BookingHead};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const BUY_ROW_CLASS = "flex items-stretch gap-4 max-
|
|
1
|
+
export declare const BUY_ROW_CLASS = "flex items-stretch gap-4 max-view-tablet:flex-wrap max-view-tablet:[&>.flex-1]:order-last max-view-tablet:[&>.flex-1]:basis-full";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e="flex items-stretch gap-4 max-view-tablet:flex-wrap max-view-tablet:[&>.flex-1]:order-last max-view-tablet:[&>.flex-1]:basis-full";export{e as BUY_ROW_CLASS};
|
|
@@ -6,7 +6,7 @@ export declare const setBandGapPx: (showImageBackground: boolean) => number;
|
|
|
6
6
|
export declare const setBandGapCss: (showImageBackground: boolean, gridGap?: string) => string;
|
|
7
7
|
export declare const SET_PLATE_PX = 252;
|
|
8
8
|
export declare const SET_STACK_GAP_PX = 16;
|
|
9
|
-
export declare const SET_STACK_MAX_PX
|
|
9
|
+
export declare const SET_STACK_MAX_PX: 800 | 720;
|
|
10
10
|
export interface CardPictureSettings {
|
|
11
11
|
image: ReactNode;
|
|
12
12
|
imageSecond?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as w,Fragment as P,jsxs as o}from"react/jsx-runtime";import{CARD_IMAGE_BG_OFF as b,cardImageBackgroundPaints as v,THEME_CARD_IMAGE_BG as C}from"efficient-web-builder/format/lib/content/card-image-background";import{VIEW_LINE_PX as A}from"efficient-web-builder/format/lib/content/view-lines";import{useCatalogCard as g}from"./card-row.js";const E=e=>`calc((100% - ${typeof e=="number"?`${e}px`:e}) / 2)`,_=2,h=32,d=e=>_+2*h+(e?16:0),x=(e,s)=>s===void 0?`${d(e)}px`:`calc(${s} + ${d(e)-_}px)`,$=252,j=16,I=A["view-wide"];function G({image:e,imageSecond:s,plate:l,wide:r=!1,imageBackgroundFill:a=b,setGridGap:c}){const f=g(),t=v(a),n=t&&a===C,i=n?"bg-[var(--wheel-stage)] p-2":t?"p-2":"",m=t&&!n?{backgroundColor:a}:{},p=u=>w("figure",{className:"m-0 aspect-square [flex:0_0_auto] max-w-full w-[var(--sf-set-plate-w)] max-view-wide:w-full",style:{"--sf-set-plate-w":E(x(t,c))},children:u});return f?o("div",{className:r?`relative mt-2 mb-5 flex items-center justify-center [&_img]:object-top max-view-wide:flex-col ${i}`:`relative mt-2 mb-5 flex aspect-square items-center justify-center overflow-hidden [&_img]:object-top ${i}`,style:r?{...m,borderRadius:10,columnGap:x(t,c),rowGap:j}:{...m,borderRadius:"var(--sf-card-image-radius, 10px)"},children:[r?o(P,{children:[p(e),p(s??e)]}):e,l]}):o("div",{className:"relative mb-5 aspect-square overflow-hidden bg-bg p-8 [&_img]:object-top",style:{borderRadius:"var(--sf-card-image-radius, 10px)"},children:[e,l]})}export{h as CARD_PAD_X_PX,_ as GRID_GAP_PX,$ as SET_PLATE_PX,j as SET_STACK_GAP_PX,I as SET_STACK_MAX_PX,G as default,x as setBandGapCss,d as setBandGapPx,E as setPlateWidthCss};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
2
|
+
import type { CardHoverDrawn } from "efficient-web-builder/format/lib/animation/hover";
|
|
3
|
+
export type CardSpin = {
|
|
4
|
+
className: string;
|
|
5
|
+
style: CSSProperties | undefined;
|
|
6
|
+
};
|
|
7
|
+
export declare function cardSpinOf(hover: CardHoverDrawn): CardSpin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MOTION_EASING as t}from"efficient-shell/format";const a={className:"",style:void 0};function r(n){return n.kind!=="rotate"||n.angle==null?a:{className:"transition-transform group-hover:rotate-[var(--card-spin)]",style:{"--card-spin":`${n.angle}deg`,transitionDuration:`${n.duration}s`,transitionDelay:`${n.delay}s`,transitionTimingFunction:t.media}}}export{r as cardSpinOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as i,Fragment as ue}from"react/jsx-runtime";import{useState as Q}from"react";import{withRMark as W}from"efficient-web-builder/render/components/RMark";import{FilterPill as A,OptButton as H,PanelTitle as z,PillButton as de}from"./FilterPill.js";import ee from"../ThemedSelect.js";import{useCatalogFilterLabels as he}from"./CatalogFilterLabels.js";import{CatalogVehicleNextRow as ge,CatalogVehicleFieldRow as fe,CatalogVehicleRow as le,CatalogVehicleSheet as be}from"./CatalogVehiclePicker.js";import{facetFieldKey as re,keepForFilter as xe,orderByAnswers as ve}from"../../lib/content/field-usage.js";import{PLP_ONE_VALUE_MAX as ie}from"../../lib/wheels/plp-filters.js";import{DEFAULT_FILTER_BAR_LAYOUT as Ce}from"../../lib/sections/catalog-filter-layout.js";import{SORT_LABELS as M}from"../../lib/wheels/catalog-filters.js";import{FINISH_FAMILY_SWATCHES as ae}from"../../lib/wheels/finish-defaults.js";import{VEHICLE_FIELD_ORDER as Ne}from"../../lib/wheels/vehicle-field-focus.js";import{CONTENT_CAP_GUTTER as ne}from"../../lib/sections/content-cap-gutter.js";const u={body:"text-[length:var(--size-body,14px)]",labelXs:"text-[length:var(--size-label,10px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]",labelXl:"text-[length:var(--size-label,14px)]"},q={size:re("diameters","alloy-wheel"),finish:re("finishes","alloy-wheel")};function te(o,t){return ve(o,s=>q[String(s.key)],t??[],"filterOrder")}function ye({processCount:o,sizeCount:t,lugCount:s,finishCount:d,optionsReported:f,fieldUsage:$}){const b=S=>!f||S>ie,k=xe($??[]);return{process:o>ie,size:k(q.size)&&b(t),lugs:b(s),finish:k(q.finish)&&b(d)}}function N(o,t){return o===t?null:t}function oe({href:o,label:t}){return e("a",{href:o,"data-results-link":!0,className:`inline-block self-start border-0 border-b border-line bg-transparent pb-2 font-mono ${u.labelLarge} uppercase tracking-[0.2em] text-fg transition-colors hover:text-fg-dim`,children:t})}function ke({filters:o,setProcess:t,setSize:s,setLugs:d,setFinish:f,setPriceMin:$,setPriceMax:b,setSort:k,clearAll:S,total:x,scrollProcess:G,show:h,picker:c,lugOptions:B=[],sizeOptions:j=[],finishOptions:Y,layout:pe=Ce,processOptions:I=[],resultsLink:v,optionsReported:me=!1,fieldUsage:P}){const[p,g]=Q(null),[K,V]=Q(null),m=he(),{process:L,size:F,lugs:_,finish:E,priceMin:X,priceMax:D,sort:Z}=o,U=Y?ae.filter(l=>Y.includes(l.f)):ae,R=ye({processCount:I.length,sizeCount:j.length,lugCount:B.length,finishCount:U.length,optionsReported:me,fieldUsage:P}),a={process:(h?.process??!0)&&R.process,size:(h?.size??!0)&&R.size,lugs:(h?.lugs??!0)&&R.lugs,finish:(h?.finish??!0)&&R.finish,price:h?.price??!0,vehicle:(h?.vehicle??!0)&&!!c,count:h?.count??!0,sort:h?.sort??!0},C={process:L?1:0,size:F?1:0,lugs:_?1:0,finish:E?1:0,price:X!=null||D!=null?1:0,vehicle:c?.appliedName?1:0},J=()=>{S(),c?.clear(),g(null),V(null)};if(pe==="columns"){const l=r=>V(K===r?null:r),n=[];a.vehicle&&c&&n.push(i(y,{name:"vehicle",label:m.vehicle,children:[Ne.map(r=>e(fe,{field:r,picker:c,open:K===r,onOpenRequest:l,onClose:()=>V(null)},r)),e(ge,{picker:c,onOpenRequest:l})]},"vehicle"));const w=[];return a.process&&w.push(e(y,{name:"process",label:m.process,rowsAreOptions:!0,children:I.map(r=>e(O,{active:L===r,onClick:()=>t(N(L,r)),children:W(r)},r))},"process")),a.size&&w.push(e(y,{name:"size",label:m.size,rowsAreOptions:!0,children:j.map(r=>i(O,{active:F===r,onClick:()=>s(N(F,r)),children:[r,'"']},r))},"size")),a.lugs&&w.push(e(y,{name:"lugs",label:m.lugs,rowsAreOptions:!0,children:B.map(r=>i(O,{active:_===r,onClick:()=>d(N(_,r)),children:[r,"-Lug"]},r))},"lugs")),a.finish&&w.push(e(y,{name:"finish",label:m.finish,rowsAreOptions:!0,children:U.map(r=>e(O,{active:E===r.f,onClick:()=>f(E===r.f?null:r.f),children:r.label},r.f))},"finish")),n.push(...te(w,P)),a.price&&n.push(i(y,{name:"price",label:m.price,children:[e(ce,{label:"Min",value:X,onChange:$,ariaLabel:"Minimum price per wheel"}),e(ce,{label:"Max",value:D,onChange:b,ariaLabel:"Maximum price per wheel"})]},"price")),i("div",{className:"@container",children:[i("div",{className:`border-t border-line ${ne} pb-12 pt-10 @max-[720px]:px-4 @max-[720px]:pb-10 @max-[720px]:pt-8`,children:[(a.count||a.sort)&&i("div",{className:"mb-10 flex flex-wrap items-center gap-x-6 gap-y-3 @max-[720px]:mb-8",children:[a.count&&i("span",{className:`font-mono ${u.labelLarge} uppercase tracking-[0.2em] text-fg-dim`,children:[x," ",x===1?"result":"results"]}),a.sort&&i("div",{className:"ml-auto flex items-center gap-5",children:[e("button",{type:"button",onClick:J,className:`font-mono ${u.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-fg`,children:"Clear All"}),e(ee,{"aria-label":"Sort results",value:Z,onChange:r=>k(r.target.value),className:`border-b border-line bg-transparent pb-2 font-mono ${u.labelLarge} uppercase tracking-[0.2em] text-fg`,children:Object.keys(M).map(r=>e("option",{value:r,children:M[r]},r))})]})]}),e("div",{"data-filter-columns":!0,className:`grid grid-cols-1 gap-x-[72px] gap-y-10 ${Le[n.length]??""}`,children:n}),v&&e("div",{className:"mt-10 flex",children:e(oe,{href:v.href,label:v.label})})]}),a.vehicle&&c&&e(le,{picker:c,total:x})]})}const T=[];return a.process&&T.push(i(A,{name:"process",label:G?i(ue,{children:[e("span",{className:"text-accent @min-[720px]:hidden",children:W(G)}),e("span",{className:"hidden @min-[720px]:inline",children:m.process})]}):m.process,badge:C.process,open:p==="process",onToggle:()=>g(p==="process"?null:"process"),children:[e(z,{children:"Series · single-select"}),e("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":"Process series",children:I.map(l=>{const n=L===l;return e(H,{active:n,role:"radio",ariaChecked:n,onClick:()=>t(N(L,l)),children:W(l)},l)})})]},"process")),a.size&&T.push(i(A,{name:"size",label:m.size,badge:C.size,open:p==="size",onToggle:()=>g(p==="size"?null:"size"),children:[e(z,{children:"Diameter · single-select"}),e("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":"Wheel diameter",children:j.map(l=>{const n=F===l;return i(H,{active:n,role:"radio",ariaChecked:n,onClick:()=>s(N(F,l)),children:[l,'"']},l)})})]},"size")),a.lugs&&T.push(i(A,{name:"lugs",label:m.lugs,badge:C.lugs,open:p==="lugs",onToggle:()=>g(p==="lugs"?null:"lugs"),children:[e(z,{children:"Lug count · single-select"}),e("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":"Lug count",children:B.map(l=>{const n=_===l;return i(H,{active:n,role:"radio",ariaChecked:n,onClick:()=>d(N(_,l)),children:[l,"-Lug"]},l)})})]},"lugs")),a.finish&&T.push(i(A,{name:"finish",label:m.finish,badge:C.finish,open:p==="finish",onToggle:()=>g(p==="finish"?null:"finish"),children:[e(z,{children:"Color family · single-select"}),e("div",{className:"flex flex-col gap-2",role:"radiogroup","aria-label":"Finish color family",children:U.map(l=>{const n=E===l.f;return i("button",{type:"button",role:"radio","aria-checked":n,onClick:()=>f(n?null:l.f),className:["flex items-center gap-3 border px-3 py-2 text-left transition-colors",n?"border-accent text-fg":"border-line hover:border-fg-dim"].join(" "),children:[e("span",{className:"block h-3.5 w-3.5 shrink-0 rounded-full border border-line",style:{background:l.hex}}),e("span",{className:`font-mono ${u.labelSmall} uppercase tracking-[0.18em]`,style:n?void 0:{color:"color-mix(in oklab, currentColor 80%, transparent)"},children:l.label}),n&&e("span",{"aria-hidden":!0,className:"ml-auto text-accent",children:"●"})]},l.f)})})]},"finish")),i("div",{className:"@container sticky top-[67px] z-40 border-b border-line backdrop-blur",style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[i("div",{className:`flex items-center gap-6 ${ne} py-4 @max-[720px]:flex-wrap @max-[720px]:items-stretch @max-[720px]:gap-2 @max-[720px]:px-4 @max-[720px]:py-3`,children:[i("div",{className:"flex flex-wrap items-center gap-1 @max-[720px]:basis-full @max-[720px]:gap-2",children:[a.count&&i("span",{className:`mr-3 border-r border-line pr-4 font-mono ${u.labelLarge} uppercase tracking-[0.2em] text-fg-dim @max-[720px]:hidden`,children:[x," ",x===1?"result":"results"]}),te(T,P),a.price&&i(A,{name:"price",label:m.price,badge:C.price,open:p==="price",onToggle:()=>g(p==="price"?null:"price"),children:[e(z,{children:"Price range (per wheel)"}),i("div",{className:"mt-1 flex items-center gap-2",children:[e("input",{type:"number",placeholder:"Min","aria-label":"Minimum price",value:X??"",onChange:l=>$(l.target.value?Number(l.target.value):null),className:`w-full bg-bg border border-line px-3 py-3 font-mono ${u.labelXl} text-fg`}),e("span",{className:`font-mono ${u.labelSmall} text-fg-dim`,children:"—"}),e("input",{type:"number",placeholder:"Max","aria-label":"Maximum price",value:D??"",onChange:l=>b(l.target.value?Number(l.target.value):null),className:`w-full bg-bg border border-line px-3 py-3 font-mono ${u.labelXl} text-fg`})]})]}),a.vehicle&&c&&e(de,{label:m.vehicle,badge:C.vehicle,open:p==="vehicle",onToggle:()=>g(p==="vehicle"?null:"vehicle")})]}),v&&e("div",{className:`flex items-center ${a.sort?"":"ml-auto"}`,children:e(oe,{href:v.href,label:v.label})}),a.sort&&i("div",{className:"ml-auto flex items-center gap-3",children:[e("button",{type:"button",onClick:J,className:`font-mono ${u.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-accent`,children:"Clear All"}),e(ee,{"aria-label":"Sort results",value:Z,onChange:l=>k(l.target.value),className:`border border-line bg-transparent px-4 py-3 font-mono ${u.labelLarge} uppercase tracking-[0.2em] text-fg`,children:Object.keys(M).map(l=>e("option",{value:l,children:M[l]},l))})]})]}),a.vehicle&&c&&p==="vehicle"&&e(be,{picker:c,onClose:()=>g(null)}),a.vehicle&&c&&e(le,{picker:c,total:x})]})}const Le={1:"@min-[720px]:grid-cols-1",2:"@min-[720px]:grid-cols-2",3:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-3",4:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-4",5:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-3 @min-[1400px]:grid-cols-5",6:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-3 @min-[1400px]:grid-cols-6"},se=`flex w-full items-center justify-between gap-4 border-b py-3 text-left ${u.body}`;function y({name:o,label:t,rowsAreOptions:s,children:d}){return i("div",{"data-filter-column":o,className:"flex flex-col gap-6",children:[e("div",{className:`font-mono ${u.labelXs} uppercase tracking-[0.34em] text-fg-dim`,children:t}),e("div",{role:s?"radiogroup":void 0,"aria-label":s?t:void 0,children:d})]})}function O({active:o,onClick:t,children:s}){return e("button",{type:"button",role:"radio","aria-checked":o,onClick:t,className:[se,"transition-colors",o?"border-fg text-fg":"border-line text-fg-dim hover:text-fg"].join(" "),children:e("span",{children:s})})}function ce({label:o,value:t,onChange:s,ariaLabel:d}){return i("label",{className:`${se} border-line`,children:[e("span",{className:"text-fg-dim",children:o}),e("input",{type:"number",inputMode:"numeric","aria-label":d,placeholder:"Any",value:t??"",onChange:f=>s(f.target.value?Number(f.target.value):null),className:"w-24 bg-transparent text-right text-fg outline-none placeholder:text-fg-dim"})]})}export{ke as default,ye as filterBarFacetsWithChoice};
|
|
1
|
+
"use client";import{jsx as e,jsxs as i,Fragment as he}from"react/jsx-runtime";import{useState as Q}from"react";import{withRMark as W}from"efficient-web-builder/render/components/RMark";import{FilterPill as L,OptButton as X,PanelTitle as R,PillButton as fe}from"./FilterPill.js";import{useCatalogFilterLabels as ge}from"./CatalogFilterLabels.js";import{CatalogVehicleNextRow as xe,CatalogVehicleFieldRow as be,CatalogVehicleRow as ee,CatalogVehicleSheet as ve}from"./CatalogVehiclePicker.js";import{facetFieldKey as le,keepForFilter as Ce,orderByAnswers as Ne}from"../../lib/content/field-usage.js";import{PLP_ONE_VALUE_MAX as re}from"../../lib/wheels/plp-filters.js";import{DEFAULT_FILTER_BAR_LAYOUT as ke}from"../../lib/sections/catalog-filter-layout.js";import{SORT_LABELS as G}from"../../lib/wheels/catalog-filters.js";import{FINISH_FAMILY_SWATCHES as ie}from"../../lib/wheels/finish-defaults.js";import{VEHICLE_FIELD_ORDER as ye}from"../../lib/wheels/vehicle-field-focus.js";import{CONTENT_CAP_GUTTER as ne}from"../../lib/sections/content-cap-gutter.js";import{CATALOG_TEXT_SIZE as _e}from"../../lib/sections/catalog-text-size.js";import{lugFilterLabel as ae}from"../../lib/wheels/lug-count.js";import Fe from"./PriceRange.js";import oe from"./SortSelect.js";const f=_e,te=Object.keys(G),H={size:le("diameters","alloy-wheel"),finish:le("finishes","alloy-wheel")};function ce(t,o){return Ne(t,c=>H[String(c.key)],o??[],"filterOrder")}function Te({processCount:t,sizeCount:o,lugCount:c,finishCount:d,optionsReported:g,fieldUsage:w}){const x=$=>!g||$>re,y=Ce(w??[]);return{process:t>re,size:y(H.size)&&x(o),lugs:x(c),finish:y(H.finish)&&x(d)}}function N(t,o){return t===o?null:o}function se({href:t,label:o}){return e("a",{href:t,"data-results-link":!0,className:`inline-block self-start border-0 border-b border-line bg-transparent pb-2 font-mono ${f.labelLarge} uppercase tracking-[0.2em] text-fg transition-colors hover:text-fg-dim`,children:o})}function Ae({filters:t,setProcess:o,setSize:c,setLugs:d,setFinish:g,setPriceMin:w,setPriceMax:x,setSort:y,clearAll:$,total:b,scrollProcess:Y,show:u,picker:s,lugOptions:B=[],sizeOptions:M=[],finishOptions:q,layout:de=ke,processOptions:I=[],resultsLink:v,optionsReported:ue=!1,fieldUsage:j}){const[m,h]=Q(null),[K,P]=Q(null),p=ge(),{process:_,size:F,lugs:T,finish:O,priceMin:V,priceMax:D,sort:Z}=t,U=q?ie.filter(r=>q.includes(r.f)):ie,S=Te({processCount:I.length,sizeCount:M.length,lugCount:B.length,finishCount:U.length,optionsReported:ue,fieldUsage:j}),n={process:(u?.process??!0)&&S.process,size:(u?.size??!0)&&S.size,lugs:(u?.lugs??!0)&&S.lugs,finish:(u?.finish??!0)&&S.finish,price:u?.price??!0,vehicle:(u?.vehicle??!0)&&!!s,count:u?.count??!0,sort:u?.sort??!0},C={process:_?1:0,size:F?1:0,lugs:T?1:0,finish:O?1:0,price:V!=null||D!=null?1:0,vehicle:s?.appliedName?1:0},J=()=>{$(),s?.clear(),h(null),P(null)};if(de==="columns"){const r=l=>P(K===l?null:l),a=[];n.vehicle&&s&&a.push(i(k,{name:"vehicle",label:p.vehicle,children:[ye.map(l=>e(be,{field:l,picker:s,open:K===l,onOpenRequest:r,onClose:()=>P(null)},l)),e(xe,{picker:s,onOpenRequest:r})]},"vehicle"));const E=[];return n.process&&E.push(e(k,{name:"process",label:p.process,rowsAreOptions:!0,children:I.map(l=>e(z,{active:_===l,onClick:()=>o(N(_,l)),children:W(l)},l))},"process")),n.size&&E.push(e(k,{name:"size",label:p.size,rowsAreOptions:!0,children:M.map(l=>i(z,{active:F===l,onClick:()=>c(N(F,l)),children:[l,'"']},l))},"size")),n.lugs&&E.push(e(k,{name:"lugs",label:p.lugs,rowsAreOptions:!0,children:B.map(l=>e(z,{active:T===l,onClick:()=>d(N(T,l)),children:ae(l)},l))},"lugs")),n.finish&&E.push(e(k,{name:"finish",label:p.finish,rowsAreOptions:!0,children:U.map(l=>e(z,{active:O===l.f,onClick:()=>g(O===l.f?null:l.f),children:l.label},l.f))},"finish")),a.push(...ce(E,j)),n.price&&a.push(i(k,{name:"price",label:p.price,children:[e(pe,{label:"Min",value:V,onChange:w,ariaLabel:"Minimum price per wheel"}),e(pe,{label:"Max",value:D,onChange:x,ariaLabel:"Maximum price per wheel"})]},"price")),i("div",{className:"@container",children:[i("div",{className:`border-t border-line ${ne} pb-12 pt-10 @max-[720px]:px-4 @max-[720px]:pb-10 @max-[720px]:pt-8`,children:[(n.count||n.sort)&&i("div",{className:"mb-10 flex flex-wrap items-center gap-x-6 gap-y-3 @max-[720px]:mb-8",children:[n.count&&i("span",{className:`font-mono ${f.labelLarge} uppercase tracking-[0.2em] text-fg-dim`,children:[b," ",b===1?"result":"results"]}),n.sort&&i("div",{className:"ml-auto flex items-center gap-5",children:[e("button",{type:"button",onClick:J,className:`font-mono ${f.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-fg`,children:"Clear All"}),e(oe,{look:"line",value:Z,keys:te,labels:G,onChange:y})]})]}),e("div",{"data-filter-columns":!0,className:`grid grid-cols-1 gap-x-[72px] gap-y-10 ${Ee[a.length]??""}`,children:a}),v&&e("div",{className:"mt-10 flex",children:e(se,{href:v.href,label:v.label})})]}),n.vehicle&&s&&e(ee,{picker:s,total:b})]})}const A=[];return n.process&&A.push(i(L,{name:"process",label:Y?i(he,{children:[e("span",{className:"text-accent @min-[720px]:hidden",children:W(Y)}),e("span",{className:"hidden @min-[720px]:inline",children:p.process})]}):p.process,badge:C.process,open:m==="process",onToggle:()=>h(m==="process"?null:"process"),children:[e(R,{children:"Series · single-select"}),e("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":"Process series",children:I.map(r=>{const a=_===r;return e(X,{active:a,role:"radio",ariaChecked:a,onClick:()=>o(N(_,r)),children:W(r)},r)})})]},"process")),n.size&&A.push(i(L,{name:"size",label:p.size,badge:C.size,open:m==="size",onToggle:()=>h(m==="size"?null:"size"),children:[e(R,{children:"Diameter · single-select"}),e("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":"Wheel diameter",children:M.map(r=>{const a=F===r;return i(X,{active:a,role:"radio",ariaChecked:a,onClick:()=>c(N(F,r)),children:[r,'"']},r)})})]},"size")),n.lugs&&A.push(i(L,{name:"lugs",label:p.lugs,badge:C.lugs,open:m==="lugs",onToggle:()=>h(m==="lugs"?null:"lugs"),children:[e(R,{children:"Lug count · single-select"}),e("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":"Lug count",children:B.map(r=>{const a=T===r;return e(X,{active:a,role:"radio",ariaChecked:a,onClick:()=>d(N(T,r)),children:ae(r)},r)})})]},"lugs")),n.finish&&A.push(i(L,{name:"finish",label:p.finish,badge:C.finish,open:m==="finish",onToggle:()=>h(m==="finish"?null:"finish"),children:[e(R,{children:"Color family · single-select"}),e("div",{className:"flex flex-col gap-2",role:"radiogroup","aria-label":"Finish color family",children:U.map(r=>{const a=O===r.f;return i("button",{type:"button",role:"radio","aria-checked":a,onClick:()=>g(a?null:r.f),className:["flex items-center gap-3 border px-3 py-2 text-left transition-colors",a?"border-accent text-fg":"border-line hover:border-fg-dim"].join(" "),children:[e("span",{className:"block h-3.5 w-3.5 shrink-0 rounded-full border border-line",style:{background:r.hex}}),e("span",{className:`font-mono ${f.labelSmall} uppercase tracking-[0.18em]`,style:a?void 0:{color:"color-mix(in oklab, currentColor 80%, transparent)"},children:r.label}),a&&e("span",{"aria-hidden":!0,className:"ml-auto text-accent",children:"●"})]},r.f)})})]},"finish")),i("div",{className:"@container sticky top-[67px] z-40 border-b border-line backdrop-blur",style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[i("div",{className:`flex items-center gap-6 ${ne} py-4 @max-[720px]:flex-wrap @max-[720px]:items-stretch @max-[720px]:gap-2 @max-[720px]:px-4 @max-[720px]:py-3`,children:[i("div",{className:"flex flex-wrap items-center gap-1 @max-[720px]:basis-full @max-[720px]:gap-2",children:[n.count&&i("span",{className:`mr-3 border-r border-line pr-4 font-mono ${f.labelLarge} uppercase tracking-[0.2em] text-fg-dim @max-[720px]:hidden`,children:[b," ",b===1?"result":"results"]}),ce(A,j),n.price&&i(L,{name:"price",label:p.price,badge:C.price,open:m==="price",onToggle:()=>h(m==="price"?null:"price"),children:[e(R,{children:"Price range (per wheel)"}),e(Fe,{min:V,max:D,onMin:w,onMax:x})]}),n.vehicle&&s&&e(fe,{label:p.vehicle,badge:C.vehicle,open:m==="vehicle",onToggle:()=>h(m==="vehicle"?null:"vehicle")})]}),v&&e("div",{className:`flex items-center ${n.sort?"":"ml-auto"}`,children:e(se,{href:v.href,label:v.label})}),n.sort&&i("div",{className:"ml-auto flex items-center gap-3",children:[e("button",{type:"button",onClick:J,className:`font-mono ${f.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-accent`,children:"Clear All"}),e(oe,{look:"box",value:Z,keys:te,labels:G,onChange:y})]})]}),n.vehicle&&s&&m==="vehicle"&&e(ve,{picker:s,onClose:()=>h(null)}),n.vehicle&&s&&e(ee,{picker:s,total:b})]})}const Ee={1:"@min-[720px]:grid-cols-1",2:"@min-[720px]:grid-cols-2",3:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-3",4:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-4",5:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-3 @min-[1400px]:grid-cols-5",6:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-3 @min-[1400px]:grid-cols-6"},me=`flex w-full items-center justify-between gap-4 border-b py-3 text-left ${f.body}`;function k({name:t,label:o,rowsAreOptions:c,children:d}){return i("div",{"data-filter-column":t,className:"flex flex-col gap-6",children:[e("div",{className:`font-mono ${f.labelXs} uppercase tracking-[0.34em] text-fg-dim`,children:o}),e("div",{role:c?"radiogroup":void 0,"aria-label":c?o:void 0,children:d})]})}function z({active:t,onClick:o,children:c}){return e("button",{type:"button",role:"radio","aria-checked":t,onClick:o,className:[me,"transition-colors",t?"border-fg text-fg":"border-line text-fg-dim hover:text-fg"].join(" "),children:e("span",{children:c})})}function pe({label:t,value:o,onChange:c,ariaLabel:d}){return i("label",{className:`${me} border-line`,children:[e("span",{className:"text-fg-dim",children:t}),e("input",{type:"number",inputMode:"numeric","aria-label":d,placeholder:"Any",value:o??"",onChange:g=>c(g.target.value?Number(g.target.value):null),className:"w-24 bg-transparent text-right text-fg outline-none placeholder:text-fg-dim"})]})}export{Ae as default,Te as filterBarFacetsWithChoice};
|