efficient-storefront-blocks 0.64.0 → 0.66.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 +51 -0
- package/README.md +0 -1
- package/dist/chunks/{EditorPreviewCheckout-WYXRKJ6R.js → EditorPreviewCheckout-EXU5CRJ2.js} +1 -1
- package/dist/chunks/{SiteEditorProvider-ZYGNRWSB.js → SiteEditorProvider-KOPR3UDU.js} +1 -1
- package/dist/chunks/{chunk-I7BIOONR.js → chunk-S66TL4Z3.js} +1 -1
- package/dist/chunks/{chunk-YAO6XQYA.js → chunk-TAGGXC3A.js} +1 -1
- package/dist/chunks/{chunk-FTBCGDXD.js → chunk-VWO54PMT.js} +1 -1
- package/dist/chunks/{chunk-OU2WWXMT.js → chunk-Z7PJKX2P.js} +1 -1
- package/dist/chunks/{fitment-data-IKFCBT6E.js → fitment-data-UQDOQP66.js} +1 -1
- package/dist/editor/components/CollectionPicker.js +1 -1
- package/dist/editor/components/EditProductLink.js +1 -1
- package/dist/editor/components/FormPicker.js +1 -1
- package/dist/editor/components/GalleryProductBinding.d.ts +1 -1
- package/dist/editor/components/GalleryProductBinding.js +1 -1
- package/dist/editor/components/GalleryShowcaseSource.d.ts +1 -1
- package/dist/editor/components/GalleryShowcaseSource.js +1 -1
- package/dist/editor/components/HeaderSettingsPanel.js +1 -1
- package/dist/editor/components/MenuLinkRangeField.js +1 -1
- package/dist/editor/components/PerViewStepperField.js +1 -1
- package/dist/editor/lib/puck/blocks/service/ContactRouting/fields.js +1 -1
- package/dist/editor/lib/puck/config.d.ts +0 -4
- package/dist/editor/lib/puck/config.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +5 -5
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/index.d.ts +0 -17
- package/dist/index.js +43 -43
- package/dist/render/app/globals.css +18 -4
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/ConsentPanel.js +1 -1
- package/dist/render/components/ContactRouting.d.ts +11 -1
- package/dist/render/components/ContactRouting.js +1 -1
- package/dist/render/components/DetailRows.js +1 -1
- package/dist/render/components/GalleryGrid.js +1 -1
- package/dist/render/components/GalleryItem.d.ts +1 -0
- package/dist/render/components/GalleryItem.js +1 -1
- package/dist/render/components/Header.js +1 -1
- package/dist/render/components/HeaderToolBlocks.d.ts +1 -1
- package/dist/render/components/HeaderToolBlocks.js +1 -1
- package/dist/render/components/ProductGallery.js +1 -1
- package/dist/render/components/ProductGridSection.js +1 -1
- package/dist/render/components/fitment/FitmentPickerGrid.js +1 -1
- package/dist/render/components/fitment/PickerField.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicGalleryGrid.js +1 -1
- package/dist/render/lib/api/types.d.ts +1 -0
- package/dist/render/lib/consent/choice.d.ts +0 -2
- package/dist/render/lib/consent/choice.js +1 -1
- package/dist/render/lib/consent/rules.d.ts +4 -3
- package/dist/render/lib/consent/rules.js +1 -1
- package/dist/render/lib/content/english-variant.js +1 -1
- package/dist/render/lib/content/source-values.d.ts +4 -0
- package/dist/render/lib/content/source-values.js +1 -0
- package/dist/render/lib/content/stock-words.d.ts +0 -4
- package/dist/render/lib/content/stock-words.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/GalleryItem/render.js +1 -1
- package/dist/render/lib/puck/blocks/text-part-shapes.json +6 -3
- package/dist/render/lib/sections/fill-row.d.ts +8 -0
- package/dist/render/lib/sections/fill-row.js +1 -1
- package/dist/render/lib/sections/grid-no-hole.d.ts +12 -0
- package/dist/render/lib/sections/grid-no-hole.js +1 -0
- package/dist/render/lib/wheels/catalog-filters-to-listing.d.ts +0 -1
- package/dist/render/lib/wheels/catalog-filters-to-listing.js +1 -1
- package/dist/render/lib/wheels/catalog-filters.d.ts +0 -1
- package/dist/render/lib/wheels/catalog-filters.js +1 -1
- package/dist/words.d.ts +6 -5
- package/dist/words.js +2 -2
- package/package.json +1 -1
- /package/dist/chunks/{chunk-B44XQA2J.js → chunk-IHYVLVY3.js} +0 -0
- /package/dist/chunks/{chunk-YAO6XQYA.js.LEGAL.txt → chunk-TAGGXC3A.js.LEGAL.txt} +0 -0
|
@@ -2833,11 +2833,25 @@ em.text-accent {
|
|
|
2833
2833
|
min-width: 0;
|
|
2834
2834
|
}
|
|
2835
2835
|
|
|
2836
|
-
/* The tile fills the cell it was given
|
|
2837
|
-
|
|
2838
|
-
nth-child rules rely on.
|
|
2836
|
+
/* The tile fills the cell it was given. The cell is the grid's child: the tile
|
|
2837
|
+
itself on the published page, the editor's item on the canvas — the same
|
|
2838
|
+
"both are the grid item" fact the nth-child rules rely on.
|
|
2839
|
+
|
|
2840
|
+
⚠️ THE TILE IS NAMED BY ITS ROLE, NOT BY HOW DEEP IT SITS (GG 2026-10-26,
|
|
2841
|
+
Lewis 2026-10-25: hartesmetal.com Home's "Vehicle gallery" drew its heading
|
|
2842
|
+
and an empty grid in the editor). This read `.sf-gallery-zone > * > *`, which
|
|
2843
|
+
on the canvas is the builder's part host (`[data-sf-part-host]`,
|
|
2844
|
+
`display: contents`), not the tile: the item and the part host stand between
|
|
2845
|
+
the grid and the tile, so the tile was a third level, had no height, and its
|
|
2846
|
+
absolutely placed photo drew 0 high. `[data-gallery-tile]` (GalleryItem's
|
|
2847
|
+
GALLERY_TILE_ATTR) is the tile on both surfaces, whatever wraps it, and
|
|
2848
|
+
`[data-gallery-tile] > *` is the tile's own box: the card, or, with the
|
|
2849
|
+
words below the photo, the box that holds the photo and the words. On the
|
|
2850
|
+
page those are the elements `> * > *` reached, so the page draws the same.
|
|
2851
|
+
scripts/test-gallery-wall-tile-on-canvas.tsx draws both. */
|
|
2839
2852
|
.sf-gallery-zone > *,
|
|
2840
|
-
.sf-gallery-zone
|
|
2853
|
+
.sf-gallery-zone [data-gallery-tile],
|
|
2854
|
+
.sf-gallery-zone [data-gallery-tile] > * {
|
|
2841
2855
|
height: 100%;
|
|
2842
2856
|
}
|
|
2843
2857
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import{useEffect as
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import{useEffect as O,useRef as S,useState as k}from"react";import j from"./SiteSwitch.js";import{CONSENT_CHOICE_BUTTON as v,ConsentEyebrow as T}from"./ConsentBanner.js";import{useModalDismiss as _}from"./useModalDismiss.js";import{useEnglish as R}from"./EnglishVariant.js";import{useSiteSells as P}from"./SiteRecordContext.js";import{CONSENT_BUTTONS as c,GPC_HONOURED as C,PANEL_ROWS as r}from"../lib/consent/rules.js";const U="flex items-center justify-center gap-5 border border-btn bg-btn px-6 py-4 font-mono text-[14px] uppercase tracking-[0.3em] text-btn-ink transition-colors hover:border-fg hover:bg-fg",B="text-fg underline decoration-line underline-offset-4";function m({name:n,body:o,checked:i,onChange:t,locked:l=!1}){return a("div",{className:"flex items-start justify-between gap-6 border-t border-line py-5",children:[a("div",{className:"min-w-0",children:[e("div",{className:"font-display text-[17px] text-fg",children:n}),e("p",{className:"mt-1 font-body text-[14px] leading-[1.5] text-fg-dim",children:o})]}),e(j,{checked:i,onChange:s=>t?.(s),ariaLabel:n,disabled:l,className:"flex flex-none cursor-pointer items-center gap-3 pt-1",children:l&&e("span",{className:"order-first font-mono text-[11px] uppercase tracking-[0.18em] text-fg-dim",children:c.alwaysOn})})]})}function K({rule:n,analytics:o,ads:i,gpc:t,privacyHref:l,open:s=!0,onSave:d,onClose:x,inline:p=!1}){const[f,b]=k(o),[u,y]=k(i&&!t),h=P(),w=R(),N=S(null);if(O(()=>{s&&(b(o),y(i&&!t))},[s,o,i,t]),_({active:!p&&s,onDismiss:x,focusRef:N}),!s)return null;const g=a("div",{ref:N,tabIndex:-1,onClick:E=>E.stopPropagation(),className:"relative w-[min(640px,100%)] overflow-auto border border-line bg-bg p-10 outline-none [border-radius:var(--sf-section-radius,0px)] max-[880px]:max-h-[88dvh] max-[880px]:w-full max-[880px]:border-x-0 max-[880px]:border-b-0 max-[880px]:px-5 max-[880px]:pb-8 max-[880px]:pt-7 max-[880px]:[border-radius:0]",children:[e(T,{text:n.panelEyebrow}),a("h2",{id:"consent-panel-title",className:"mt-4 font-display text-[36px] leading-[1.05] tracking-[-0.01em] text-fg max-[880px]:text-[28px]",children:["Your privacy ",e("span",{className:"font-serif font-light italic text-accent",children:"choices."})]}),t&&a("div",{className:"mt-5 border border-line bg-surface px-4 py-3 font-body text-[14px] leading-[1.5] text-fg",children:[e("span",{className:"font-mono text-[12px] uppercase tracking-[0.18em] text-accent",children:w(C.title)}),e("br",{}),C.body]}),a("div",{className:"mt-6",children:[e(m,{name:r.necessary.name,body:h?r.necessary.body:r.necessary.bodyNoSale,checked:!0,locked:!0}),e(m,{name:r.analytics.name,body:r.analytics.body,checked:f,onChange:b}),e(m,{name:n.adsRowName,body:h?r.ads.body:r.ads.bodyNoSale,checked:u,onChange:y,locked:t})]}),a("div",{className:"mt-2 grid grid-cols-3 gap-3 border-t border-line pt-6 max-[880px]:grid-cols-1",children:[e("button",{type:"button",className:U,onClick:()=>d({analytics:f,ads:u&&!t}),children:c.save}),e("button",{type:"button",className:v,onClick:()=>d({analytics:!1,ads:!1}),children:c.reject}),e("button",{type:"button",className:v,onClick:()=>d({analytics:!0,ads:!t}),children:c.accept})]}),l&&a("p",{className:"mt-5 font-body text-[13px] text-fg-dim",children:["More in our"," ",e("a",{className:B,href:l,children:c.privacyPolicy}),"."]})]});return p?e("div",{className:"flex w-full justify-center p-6",children:g}):e("div",{role:"dialog","aria-modal":"true","aria-labelledby":"consent-panel-title",onClick:x,className:"fixed inset-0 z-[95] flex items-center justify-center p-6 backdrop-blur-[8px] max-[880px]:items-end max-[880px]:p-0",style:{background:"color-mix(in oklab, var(--bg) 78%, transparent)"},children:g})}export{K as ConsentPanelView};
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import type { Form } from "../lib/api/index.js";
|
|
3
3
|
import { type ContactChannel, type RoutingGroup } from "efficient-web-builder/format/lib/content/contact";
|
|
4
|
+
export declare const CHANNEL_HINTS: {
|
|
5
|
+
readonly label: "Label";
|
|
6
|
+
readonly value: "Value";
|
|
7
|
+
readonly sub: "Sub line";
|
|
8
|
+
};
|
|
9
|
+
type DrawnChannel = ContactChannel & {
|
|
10
|
+
at: number;
|
|
11
|
+
};
|
|
12
|
+
export declare function drawnChannels(channels: ContactChannel[], editing: boolean): DrawnChannel[];
|
|
4
13
|
export declare function channelHref(c: ContactChannel): string | undefined;
|
|
5
|
-
export declare function mergeChannelsForPhone(channels:
|
|
14
|
+
export declare function mergeChannelsForPhone<C extends ContactChannel>(channels: C[]): C[];
|
|
6
15
|
export declare function topicFieldOf(form: Pick<Form, "fields"> | null | undefined, groups: Pick<RoutingGroup, "id" | "title">[], otherLabel?: string): {
|
|
7
16
|
key: string;
|
|
8
17
|
optionFor: (id: string) => string | undefined;
|
|
@@ -31,3 +40,4 @@ export interface ContactRoutingProps {
|
|
|
31
40
|
}
|
|
32
41
|
export declare const fieldClass: string;
|
|
33
42
|
export default function ContactRouting({ routingNumber, routingTagline, groups, formNumber, formHeading, metaLines, showOther, otherLabel, otherNoteTitle, otherNoteBody, buttonText, consent, channels, formSlug, form: injectedForm, editing, initialActiveId, onActiveChange, reasonExtras, }: ContactRoutingProps): import("react").JSX.Element;
|
|
43
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as n,jsxs as l,Fragment as Y}from"react/jsx-runtime";import A from"./SectionBand.js";import{useEffect as F,useState as M}from"react";import{OTHER_REASON_ID as h}from"efficient-web-builder/format/lib/content/contact";import{FormFieldInput as T,FormHoneypot as ee,successMessageFor as ne,useBoundForm as te,useFormSubmission as ae}from"./formSubmission.js";import re from"efficient-web-builder/render/components/SectionEyebrow";import le,{FieldCaption as oe}from"./WebFormField.js";import{scrollBehavior as ie}from"efficient-web-builder/render/components/useReducedMotion";import{renderChrome as L,renderGold as $,renderHeadline as se,splitParagraphs as ce}from"efficient-web-builder/render/components/goldPhrases";import{say as q}from"efficient-web-builder/format/lib/editor-words";import{phoneHref as de}from"efficient-web-builder/format/lib/links/phone-href";const t={bodySmall:"text-[length:var(--size-body,14px)]",body:"text-[length:var(--size-body,15px)]",bodyLarge:"text-[length:var(--size-body,18px)]",headingSmall1:"text-[length:var(--size-headingSmall,24px)]",headingSmall2:"text-[length:var(--size-headingSmall,26px)]",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)]"};function P(p){if(p.href)return p.href;const o=(p.value??"").trim();if(o.includes("@"))return`mailto:${o}`;if(/^\+?[\d\s().-]{6,}$/.test(o))return de(o)}function me(p){const o=[],f=new Map;for(const r of p){if(!r.groupId){o.push(r);continue}const d=r.value.trim().toLowerCase(),u=f.get(d);if(u)u.label=`${u.label} · ${r.label}`;else{const b={...r};f.set(d,b),o.push(b)}}return o}function pe(p,o,f){const r=d=>String(d??"").trim().toLowerCase();for(const d of p?.fields??[]){if(d.type!=="select"||!Array.isArray(d.options))continue;const u=d.options.map(String);if(!o.some(s=>u.some(m=>r(m)===r(s.title))))continue;const b=s=>r(s===h?f:o.find(m=>m.id===s)?.title);return{key:d.key,optionFor:s=>u.find(m=>r(m)===b(s)&&b(s)!==""),idFor:s=>{const m=o.find(S=>r(S.title)===r(s));return m?m.id:f&&r(s)===r(f)?h:void 0}}}return null}const B=`border-b border-line bg-transparent py-4 font-display ${t.bodyLarge} tracking-[0.01em] text-fg outline-none transition-colors focus:border-accent`;function fe({routingNumber:p,routingTagline:o,groups:f,formNumber:r,formHeading:d,metaLines:u,showOther:b=!0,otherLabel:s="Other",otherNoteTitle:m,otherNoteBody:S,buttonText:O,consent:_,channels:V,formSlug:R,form:D,editing:C,initialActiveId:y,onActiveChange:H,reasonExtras:G}){const k=[...f.map(e=>e.id),...b?[h]:[]],W=y&&k.includes(y)?y:k[0]??h,[g,w]=M(W);F(()=>{k.includes(g)||w(k[0]??h)},[k.join("|")]),F(()=>{y&&k.includes(y)&&w(y)},[y]);const v=te(R,D),c=ae({form:v,formSlug:R,editing:C}),x=pe(v,f,b?s:void 0),z=e=>{w(e),I(null);const a=x?.optionFor(e);x&&a!==void 0&&c.set(x.key,a),H?.(e)};F(()=>{if(!x||c.valueOf(x.key))return;const e=x.optionFor(g);e!==void 0&&c.set(x.key,e)},[x?.key]);const[X,I]=M(null),N=(V??[]).filter(e=>!e.hidden),Z=e=>X!==null?!e.groupId&&e.value===X:e.groupId===g,J=v===void 0,E=!!v||!!C,[K,Q]=M(!1);return F(()=>{const e=()=>Q(document.documentElement.getAttribute("data-theme")==="light");e();const a=new MutationObserver(e);return a.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>a.disconnect()},[]),l(Y,{children:[l(A,{className:"border-b border-line py-[60px]",style:K?void 0:{background:"var(--section-bg)"},children:[(p||o)&&l("div",{className:"mb-6 flex items-center gap-6 border-b border-line pb-6",children:[p&&n(re,{text:p}),o&&n("span",{className:`font-display ${t.bodySmall} uppercase tracking-[0.04em] text-fg-dim`,children:$(o)})]}),n("div",{className:"sf-card grid grid-cols-4 gap-[2px] border border-line bg-line max-[1100px]:grid-cols-2 max-[700px]:grid-cols-1",children:f.map(e=>{const a=g===e.id;return l("button",{type:"button",onClick:()=>{z(e.id),typeof window<"u"&&window.matchMedia("(max-width: 1100px)").matches&&document.getElementById("contact-form")?.scrollIntoView({behavior:ie(),block:"start"})},className:["flex min-h-[240px] cursor-pointer flex-col gap-4 px-8 py-10 text-left transition-colors",a?"bg-surface outline outline-2 -outline-offset-2 outline-accent":"bg-bg hover:bg-surface"].join(" "),children:[e.eyebrow&&n("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.24em] text-accent`,children:e.eyebrow}),n("h3",{className:`whitespace-pre-line font-heading3 ${t.headingSmall2} font-medium uppercase leading-[1.05] tracking-[-0.02em]`,children:e.title}),e.copy&&n("p",{className:`mt-auto font-display ${t.bodySmall} leading-[1.5] text-fg-dim`,children:e.copy}),e.response&&l("div",{className:`mt-2 flex justify-between border-t border-line pt-4 font-mono ${t.labelSmall} uppercase tracking-[0.22em] text-fg-dim`,children:[n("span",{children:"Response"}),n("strong",{className:"font-normal text-fg",children:e.response})]})]},e.id)})})]}),(E||N.length>0)&&n("section",{id:"contact-form",className:"scroll-mt-[80px] border-b border-line py-20 max-[1100px]:py-[60px]",children:l("div",{className:["mx-auto grid max-w-[var(--sf-site-width,1600px)] gap-20 px-[var(--sf-site-gutter,40px)] max-[1100px]:grid-cols-1 max-[1100px]:gap-[60px] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",E&&N.length>0?"grid-cols-[1.3fr_1fr]":"grid-cols-1"].join(" "),children:[E&&l("div",{children:[l("div",{className:"mb-8 flex items-end justify-between gap-6 border-b border-line pb-6",children:[l("div",{children:[r&&n("div",{className:`pb-2 font-mono ${t.labelLarge} uppercase tracking-[0.3em] text-accent`,children:$(r)}),d&&n("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(36px,4vw,56px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.03em]",children:se(d,!0)})]}),!!(u&&u.length)&&n("div",{className:`text-right font-mono ${t.labelSmall} uppercase leading-[1.8] tracking-[0.22em] text-fg-dim max-[700px]:text-left`,children:u.map((e,a)=>n("div",{children:e},a))})]}),v?c.done?n("div",{className:`border border-accent bg-accent/[0.08] p-8 font-display ${t.body} leading-[1.6] text-fg-dim`,children:ne(v,"Thanks — we've received your message.")}):l("form",{className:"grid grid-cols-2 gap-5 max-[700px]:grid-cols-1",onSubmit:c.handleSubmit,children:[v.fields.map(e=>n(le,{label:e.label,required:e.required,className:e.type==="textarea"||e.type==="checkbox"?"col-span-2 max-[700px]:col-span-1":void 0,children:n(T,{field:e,value:c.valueOf(e.key),onChange:a=>{c.set(e.key,a);const i=x&&e.key===x.key?x.idFor(a):void 0;i!==void 0&&(w(i),I(null),H?.(i))},className:e.type==="textarea"?`${B} min-h-[140px] resize-y leading-[1.5]`:e.type==="checkbox"?"size-4 self-start accent-accent":B})},e.key)),l("div",{className:"col-span-2 flex flex-col gap-2 max-[700px]:col-span-1",children:[n(oe,{required:!0,children:"Reason"}),l("div",{className:"mt-1 flex flex-wrap gap-2",children:[f.map(e=>{const a=g===e.id;return n("button",{type:"button",onClick:()=>z(e.id),className:[`cursor-pointer border px-4 py-3 font-mono ${t.labelSmall} uppercase tracking-[0.2em] transition-colors`,a?"border-accent bg-accent text-bg":"border-line text-fg-dim hover:text-fg"].join(" "),children:e.title},e.id)}),b&&n("button",{type:"button",onClick:()=>z(h),className:[`cursor-pointer border px-4 py-3 font-mono ${t.labelSmall} uppercase tracking-[0.2em] transition-colors`,g===h?"border-accent bg-accent text-bg":"border-line text-fg-dim hover:text-fg"].join(" "),children:L(s)})]})]}),G?.(g),g===h&&(m||S)&&l("div",{className:"sf-card col-span-2 flex flex-col gap-2 border border-line bg-bg/40 p-5 max-[700px]:col-span-1",children:[m&&n("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.24em] text-accent`,children:$(m)}),S&&ce(S).map((e,a)=>n("p",{className:`font-display ${t.body} leading-[1.55] text-fg-dim`,children:$(e)},a))]}),n(ee,{value:c.honeypot,onChange:c.setHoneypot}),c.error&&n("p",{role:"alert",className:`col-span-2 font-mono ${t.labelSmall} uppercase tracking-[0.18em] text-alert max-[700px]:col-span-1`,children:c.error}),l("div",{className:"col-span-2 mt-5 flex flex-wrap items-center justify-between gap-6 border-t border-line pt-6 max-[700px]:col-span-1 max-[700px]:flex-col max-[700px]:items-stretch",children:[_&&n("span",{className:`max-w-[380px] font-mono ${t.labelSmall} uppercase leading-[1.6] tracking-[0.18em] text-fg-dim`,children:$(_)}),n("button",{type:C?"button":"submit",disabled:c.submitting,className:`cursor-pointer bg-btn px-8 py-5 font-mono ${t.labelXl} uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg disabled:cursor-wait disabled:opacity-60 max-[700px]:w-full`,children:c.submitting?"Sending…":O?L(O):"Send Message →"})]})]}):n("p",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.22em] text-fg-dim`,children:J?q("Loading form…"):q("Choose a form in the inspector, under Message form — until then this column is hidden on the live page and no message can be sent.")})]}),N.length>0&&n("aside",{className:"flex flex-col gap-0 max-[1100px]:hidden",children:N.map((e,a)=>{const i=Z(e),j=!!!e.groupId;return l("div",{onClick:j?()=>I(e.value):void 0,className:["relative flex flex-col gap-3 border-b border-line border-l-2 px-5 py-8 transition-all",j?"cursor-pointer border-t-2 border-t-accent":"",i?"border-l-accent pl-6":j?"border-l-transparent hover:bg-accent/[0.04]":"border-l-transparent"].join(" "),style:i?{background:"color-mix(in oklab, var(--accent) 8%, transparent)"}:void 0,children:[i&&l("span",{className:"absolute right-[18px] top-6 flex flex-col items-end gap-0.5 text-right",children:[n("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.24em] text-accent`,children:"→ Message routes here"}),n("span",{className:`font-mono ${t.labelXs} uppercase tracking-[0.18em] text-fg-dim`,children:"Other inboxes filter as spam"})]}),n("span",{className:[`font-mono ${t.labelSmall} uppercase tracking-[0.3em] transition-colors`,i?"text-fg":"text-accent"].join(" "),children:e.label}),j?n("a",{href:e.href,onClick:U=>U.stopPropagation(),className:[`font-heading3 ${t.headingSmall1} font-medium leading-[1.2] tracking-[-0.02em] transition-colors hover:text-accent`,i?"text-accent":"text-fg"].join(" "),children:e.value}):n("a",{href:P(e),className:[`font-heading3 ${t.headingSmall1} font-medium leading-[1.2] tracking-[-0.02em]`,i?"text-accent":"text-fg"].join(" "),children:e.value}),e.sub&&n("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:e.sub})]},`${e.value}-${a}`)})}),N.length>0&&n("div",{"data-contact-phone-list":!0,className:"hidden flex-col gap-0 max-[1100px]:flex",children:me(N).map((e,a)=>{const i=!!e.groupId;return l("div",{className:["flex flex-col gap-3 border-b border-line px-5 py-5",i?"":"border-t-2 border-t-accent"].join(" "),children:[n("span",{className:[`font-mono ${t.labelSmall} uppercase tracking-[0.3em]`,i?"text-fg":"text-accent"].join(" "),children:e.label}),n("a",{href:P(e),className:[`font-heading3 ${t.headingSmall1} font-medium leading-[1.2] tracking-[-0.02em] [overflow-wrap:anywhere]`,i?"text-accent":"text-fg"].join(" "),children:e.value}),e.sub&&n("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:e.sub})]},`${e.value}-${a}`)})})]})})]})}export{P as channelHref,fe as default,B as fieldClass,me as mergeChannelsForPhone,pe as topicFieldOf};
|
|
1
|
+
"use client";import{jsx as n,jsxs as s,Fragment as ee}from"react/jsx-runtime";import ne from"./SectionBand.js";import{useEffect as z,useState as _}from"react";import{OTHER_REASON_ID as v}from"efficient-web-builder/format/lib/content/contact";import{FormFieldInput as te,FormHoneypot as ae,successMessageFor as le,useBoundForm as re,useFormSubmission as oe}from"./formSubmission.js";import se from"efficient-web-builder/render/components/SectionEyebrow";import ie,{FieldCaption as ce}from"./WebFormField.js";import{scrollBehavior as de}from"efficient-web-builder/render/components/useReducedMotion";import{renderChrome as q,renderGold as w,renderHeadline as me,splitParagraphs as pe}from"efficient-web-builder/render/components/goldPhrases";import{say as j}from"efficient-web-builder/format/lib/editor-words";import{phoneHref as fe}from"efficient-web-builder/format/lib/links/phone-href";import{PART_ROW_ATTR as ue,encodePartRow as xe}from"efficient-web-builder/render/lib/puck/text-parts";const t={bodySmall:"text-[length:var(--size-body,14px)]",body:"text-[length:var(--size-body,15px)]",bodyLarge:"text-[length:var(--size-body,18px)]",headingSmall1:"text-[length:var(--size-headingSmall,24px)]",headingSmall2:"text-[length:var(--size-headingSmall,26px)]",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)]"},M={label:"Label",value:"Value",sub:"Sub line"};function be(i,l){return i.map((r,a)=>l?{...r,at:a,label:r.label||j(M.label),value:r.value||j(M.value),sub:r.sub||j(M.sub)}:{...r,at:a}).filter(r=>!r.hidden)}function A(i,l){return l?{[ue]:xe("channels",i.at)}:{}}function T(i){if(i.href)return i.href;const l=(i.value??"").trim();if(l.includes("@"))return`mailto:${l}`;if(/^\+?[\d\s().-]{6,}$/.test(l))return fe(l)}function ge(i){const l=[],r=new Map;for(const a of i){if(!a.groupId){l.push(a);continue}const p=a.value.trim().toLowerCase(),x=r.get(p);if(x)x.label=`${x.label} · ${a.label}`;else{const b={...a};r.set(p,b),l.push(b)}}return l}function he(i,l,r){const a=p=>String(p??"").trim().toLowerCase();for(const p of i?.fields??[]){if(p.type!=="select"||!Array.isArray(p.options))continue;const x=p.options.map(String);if(!l.some(d=>x.some(f=>a(f)===a(d.title))))continue;const b=d=>a(d===v?r:l.find(f=>f.id===d)?.title);return{key:p.key,optionFor:d=>x.find(f=>a(f)===b(d)&&b(d)!==""),idFor:d=>{const f=l.find($=>a($.title)===a(d));return f?f.id:r&&a(d)===a(r)?v:void 0}}}return null}const V=`border-b border-line bg-transparent py-4 font-display ${t.bodyLarge} tracking-[0.01em] text-fg outline-none transition-colors focus:border-accent`;function ve({routingNumber:i,routingTagline:l,groups:r,formNumber:a,formHeading:p,metaLines:x,showOther:b=!0,otherLabel:d="Other",otherNoteTitle:f,otherNoteBody:$,buttonText:O,consent:H,channels:B,formSlug:L,form:W,editing:y,initialActiveId:k,onActiveChange:P,reasonExtras:D}){const N=[...r.map(e=>e.id),...b?[v]:[]],G=k&&N.includes(k)?k:N[0]??v,[g,C]=_(G);z(()=>{N.includes(g)||C(N[0]??v)},[N.join("|")]),z(()=>{k&&N.includes(k)&&C(k)},[k]);const h=re(L,W),m=oe({form:h,formSlug:L,editing:y}),u=he(h,r,b?d:void 0),I=e=>{C(e),R(null);const o=u?.optionFor(e);u&&o!==void 0&&m.set(u.key,o),P?.(e)};z(()=>{if(!u||m.valueOf(u.key))return;const e=u.optionFor(g);e!==void 0&&m.set(u.key,e)},[u?.key]);const[X,R]=_(null),S=be(B??[],!!y),Z=e=>X!==null?!e.groupId&&e.value===X:e.groupId===g,J=h===void 0,E=!!h||!!y,[K,Q]=_(!1);z(()=>{const e=()=>Q(document.documentElement.getAttribute("data-theme")==="light");e();const o=new MutationObserver(e);return o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>o.disconnect()},[]);const U=r.length>0||!!y;return s(ee,{children:[U&&s(ne,{className:"border-b border-line py-[60px]",style:K?void 0:{background:"var(--section-bg)"},children:[(i||l)&&s("div",{className:"mb-6 flex items-center gap-6 border-b border-line pb-6",children:[i&&n(se,{text:i}),l&&n("span",{className:`font-display ${t.bodySmall} uppercase tracking-[0.04em] text-fg-dim`,children:w(l)})]}),n("div",{className:"sf-card grid grid-cols-4 gap-[2px] border border-line bg-line max-[1100px]:grid-cols-2 max-[700px]:grid-cols-1",children:r.map(e=>{const o=g===e.id;return s("button",{type:"button",onClick:()=>{I(e.id),typeof window<"u"&&window.matchMedia("(max-width: 1100px)").matches&&document.getElementById("contact-form")?.scrollIntoView({behavior:de(),block:"start"})},className:["flex min-h-[240px] cursor-pointer flex-col gap-4 px-8 py-10 text-left transition-colors",o?"bg-surface outline outline-2 -outline-offset-2 outline-accent":"bg-bg hover:bg-surface"].join(" "),children:[e.eyebrow&&n("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.24em] text-accent`,children:e.eyebrow}),n("h3",{className:`whitespace-pre-line font-heading3 ${t.headingSmall2} font-medium uppercase leading-[1.05] tracking-[-0.02em]`,children:e.title}),e.copy&&n("p",{className:`mt-auto font-display ${t.bodySmall} leading-[1.5] text-fg-dim`,children:e.copy}),e.response&&s("div",{className:`mt-2 flex justify-between border-t border-line pt-4 font-mono ${t.labelSmall} uppercase tracking-[0.22em] text-fg-dim`,children:[n("span",{children:"Response"}),n("strong",{className:"font-normal text-fg",children:e.response})]})]},e.id)})})]}),(E||S.length>0)&&n("section",{id:"contact-form",className:"scroll-mt-[80px] border-b border-line py-20 max-[1100px]:py-[60px]",children:s("div",{className:["mx-auto grid max-w-[var(--sf-site-width,1600px)] gap-20 px-[var(--sf-site-gutter,40px)] max-[1100px]:grid-cols-1 max-[1100px]:gap-[60px] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",E&&S.length>0?"grid-cols-[1.3fr_1fr]":"grid-cols-1"].join(" "),children:[E&&s("div",{children:[s("div",{className:"mb-8 flex items-end justify-between gap-6 border-b border-line pb-6",children:[s("div",{children:[a&&n("div",{className:`pb-2 font-mono ${t.labelLarge} uppercase tracking-[0.3em] text-accent`,children:w(a)}),p&&n("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(36px,4vw,56px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.03em]",children:me(p,!0)})]}),!!(x&&x.length)&&n("div",{className:`text-right font-mono ${t.labelSmall} uppercase leading-[1.8] tracking-[0.22em] text-fg-dim max-[700px]:text-left`,children:x.map((e,o)=>n("div",{children:e},o))})]}),h?m.done?n("div",{className:`border border-accent bg-accent/[0.08] p-8 font-display ${t.body} leading-[1.6] text-fg-dim`,children:le(h,"Thanks — we've received your message.")}):s("form",{className:"grid grid-cols-2 gap-5 max-[700px]:grid-cols-1",onSubmit:m.handleSubmit,children:[h.fields.map(e=>n(ie,{label:e.label,required:e.required,className:e.type==="textarea"||e.type==="checkbox"?"col-span-2 max-[700px]:col-span-1":void 0,children:n(te,{field:e,value:m.valueOf(e.key),onChange:o=>{m.set(e.key,o);const c=u&&e.key===u.key?u.idFor(o):void 0;c!==void 0&&(C(c),R(null),P?.(c))},className:e.type==="textarea"?`${V} min-h-[140px] resize-y leading-[1.5]`:e.type==="checkbox"?"size-4 self-start accent-accent":V})},e.key)),s("div",{className:"col-span-2 flex flex-col gap-2 max-[700px]:col-span-1",children:[n(ce,{required:!0,children:"Reason"}),s("div",{className:"mt-1 flex flex-wrap gap-2",children:[r.map(e=>{const o=g===e.id;return n("button",{type:"button",onClick:()=>I(e.id),className:[`cursor-pointer border px-4 py-3 font-mono ${t.labelSmall} uppercase tracking-[0.2em] transition-colors`,o?"border-accent bg-accent text-bg":"border-line text-fg-dim hover:text-fg"].join(" "),children:e.title},e.id)}),b&&n("button",{type:"button",onClick:()=>I(v),className:[`cursor-pointer border px-4 py-3 font-mono ${t.labelSmall} uppercase tracking-[0.2em] transition-colors`,g===v?"border-accent bg-accent text-bg":"border-line text-fg-dim hover:text-fg"].join(" "),children:q(d)})]})]}),D?.(g),g===v&&(f||$)&&s("div",{className:"sf-card col-span-2 flex flex-col gap-2 border border-line bg-bg/40 p-5 max-[700px]:col-span-1",children:[f&&n("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.24em] text-accent`,children:w(f)}),$&&pe($).map((e,o)=>n("p",{className:`font-display ${t.body} leading-[1.55] text-fg-dim`,children:w(e)},o))]}),n(ae,{value:m.honeypot,onChange:m.setHoneypot}),m.error&&n("p",{role:"alert",className:`col-span-2 font-mono ${t.labelSmall} uppercase tracking-[0.18em] text-alert max-[700px]:col-span-1`,children:m.error}),s("div",{className:"col-span-2 mt-5 flex flex-wrap items-center justify-between gap-6 border-t border-line pt-6 max-[700px]:col-span-1 max-[700px]:flex-col max-[700px]:items-stretch",children:[H&&n("span",{className:`max-w-[380px] font-mono ${t.labelSmall} uppercase leading-[1.6] tracking-[0.18em] text-fg-dim`,children:w(H)}),n("button",{type:y?"button":"submit",disabled:m.submitting,className:`cursor-pointer bg-btn px-8 py-5 font-mono ${t.labelXl} uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg disabled:cursor-wait disabled:opacity-60 max-[700px]:w-full`,children:m.submitting?"Sending…":O?q(O):"Send Message →"})]})]}):n("p",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.22em] text-fg-dim`,children:J?j("Loading form…"):j("Choose a form in the inspector, under Message form — until then this column is hidden on the live page and no message can be sent.")})]}),S.length>0&&n("aside",{className:"flex flex-col gap-0 max-[1100px]:hidden",children:S.map((e,o)=>{const c=Z(e),F=!!!e.groupId;return s("div",{...A(e,y),onClick:F?()=>R(e.value):void 0,className:["relative flex flex-col gap-3 border-b border-line border-l-2 px-5 py-8 transition-all",F?"cursor-pointer border-t-2 border-t-accent":"",c?"border-l-accent pl-6":F?"border-l-transparent hover:bg-accent/[0.04]":"border-l-transparent"].join(" "),style:c?{background:"color-mix(in oklab, var(--accent) 8%, transparent)"}:void 0,children:[c&&!!h&&s("span",{className:"absolute right-[18px] top-6 flex flex-col items-end gap-0.5 text-right",children:[n("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.24em] text-accent`,children:"→ Message routes here"}),n("span",{className:`font-mono ${t.labelXs} uppercase tracking-[0.18em] text-fg-dim`,children:"Other inboxes filter as spam"})]}),n("span",{className:[`font-mono ${t.labelSmall} uppercase tracking-[0.3em] transition-colors`,c?"text-fg":"text-accent"].join(" "),children:e.label}),F?n("a",{href:e.href,onClick:Y=>Y.stopPropagation(),className:[`font-heading3 ${t.headingSmall1} font-medium leading-[1.2] tracking-[-0.02em] transition-colors hover:text-accent`,c?"text-accent":"text-fg"].join(" "),children:e.value}):n("a",{href:T(e),className:[`font-heading3 ${t.headingSmall1} font-medium leading-[1.2] tracking-[-0.02em]`,c?"text-accent":"text-fg"].join(" "),children:e.value}),e.sub&&n("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:e.sub})]},`${e.value}-${o}`)})}),S.length>0&&n("div",{"data-contact-phone-list":!0,className:"hidden flex-col gap-0 max-[1100px]:flex",children:ge(S).map((e,o)=>{const c=!!e.groupId;return s("div",{...A(e,y),className:["flex flex-col gap-3 border-b border-line px-5 py-5",c?"":"border-t-2 border-t-accent"].join(" "),children:[n("span",{className:[`font-mono ${t.labelSmall} uppercase tracking-[0.3em]`,c?"text-fg":"text-accent"].join(" "),children:e.label}),n("a",{href:T(e),className:[`font-heading3 ${t.headingSmall1} font-medium leading-[1.2] tracking-[-0.02em] [overflow-wrap:anywhere]`,c?"text-accent":"text-fg"].join(" "),children:e.value}),e.sub&&n("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:e.sub})]},`${e.value}-${o}`)})})]})})]})}export{M as CHANNEL_HINTS,T as channelHref,ve as default,be as drawnChannels,V as fieldClass,ge as mergeChannelsForPhone,he as topicFieldOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as
|
|
1
|
+
import{jsx as t,jsxs as n}from"react/jsx-runtime";import j from"./SectionBand.js";import k from"efficient-web-builder/render/components/Placeholder";import{withRMark as s}from"efficient-web-builder/render/components/RMark";import{renderGold as f}from"efficient-web-builder/render/components/goldPhrases";import{say as o}from"efficient-web-builder/format/lib/editor-words";import{stripMarkup as z}from"efficient-web-builder/format/lib/markup";const m={body:"text-[length:var(--size-body,15px)]",labelSmall:"text-[length:var(--size-label,11px)]",label:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"};function $({rows:h,startLeft:b=!1,layout:u="even",padTop:c,padBottom:d,editing:v=!1}){const a=u==="narrow",w=typeof c=="number"?c:100,y=typeof d=="number"?d:100,p=(h??[]).filter(e=>(e?.eyebrow??"").trim()||(e?.title??"").trim()||(e?.copy??"").trim()||(e?.tag??"").trim()||(e?.image??"").trim()),g=p.length>0?p:v?[{tag:o("Row {n}",{n:1})},{tag:o("Row {n}",{n:2})},{tag:o("Row {n}",{n:3})}]:[];return g.length===0?null:t(j,{className:"relative z-[2] border-b border-line bg-bg",style:{paddingTop:w,paddingBottom:y},children:g.map((e,l)=>{const r=l%2===1!==b;return n("div",{className:["grid items-center py-[60px]",a?"grid-cols-[1fr_460px] gap-[72px]":"grid-cols-2 gap-12","max-[1100px]:grid-cols-1",r?"[direction:rtl] max-[1100px]:[direction:ltr]":"",l>0?"border-t border-line":""].join(" "),children:[n("div",{className:["[direction:ltr] flex flex-col gap-4",a?"max-w-[560px]":"",a&&!r?"ml-auto max-[1100px]:ml-0":""].join(" "),children:[e.eyebrow?.trim()&&t("div",{className:`font-mono ${m.labelLarge} uppercase tracking-[0.2em] text-accent`,children:s(e.eyebrow)}),e.title?.trim()&&t("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(28px,3vw,42px)),var(--sf-heading-max,9999px))] [font-weight:var(--sf-heading-weight,500)] [&_em]:[font-weight:var(--sf-heading-weight-strong,inherit)] leading-[1.1] tracking-[-0.02em]",children:f(e.title,!0)}),e.copy?.trim()&&t("p",{className:`${m.body} leading-[1.6] text-fg-dim`,children:f(e.copy,!1)}),(()=>{const x=(e.specs??[]).filter(i=>(i?.label??"").trim()||(i?.value??"").trim());return x.length===0?null:t("dl",{className:`mt-2 border-t border-line pt-3 font-mono ${m.label} uppercase tracking-[0.1em] leading-[2.1]`,children:x.map((i,N)=>n("div",{className:"flex items-baseline justify-between gap-6",children:[t("dt",{className:"text-fg-dim",children:s(i.label??"")}),t("dd",{className:"text-fg",children:s(i.value??"")})]},N))})})()]}),n("div",{className:["[direction:ltr] flex flex-col gap-3",a?r?"items-end":"items-start":"",a?"max-[1100px]:items-start":""].join(" "),children:[t("div",{className:["relative overflow-hidden max-w-full",a?e.imageShape==="wide"?"w-[460px] aspect-[16/9]":"w-[360px] aspect-square":"aspect-square"].join(" "),children:t(k,{label:e.tag?.trim()||e.title?.trim()||`row-${l+1}`,src:e.image||void 0,alt:z(e.title?.trim()||e.tag?.trim()||""),showBackground:!e.image,objectFit:"contain",sizes:a?"(max-width: 1100px) 100vw, 460px":"(max-width: 1100px) 100vw, 50vw"})}),e.tag?.trim()&&t("span",{className:`font-mono ${m.labelSmall} uppercase tracking-[0.2em] text-fg-dim ${r?"text-left":"text-right"}`,children:s(e.tag)})]})]},l)})})}export{$ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as E}from"react/jsx-runtime";import{usePathname as w}from"next/navigation";import{containerGapProps as M}from"efficient-web-builder/format/lib/content/container-gap";import P from"efficient-web-builder/render/components/Btn";import{GALLERY_GRID_ATTR as R,GalleryLinksContext as j}from"./GalleryItem.js";import{useSiteSells as z}from"./SiteRecordContext.js";import{SharedPartKinds as A}from"efficient-web-builder/render/components/PublishedPartStylesContext";import{renderHeadline as I}from"efficient-web-builder/render/components/goldPhrases";import $ from"efficient-web-builder/render/components/SectionHeader";import{resolveGridColumns as k,resolveGridMobileColumns as B}from"efficient-web-builder/format/lib/content/grid-span";import{galleryLayoutClass as O,galleryLayoutCss as T,resolveGalleryLayout as F}from"efficient-web-builder/format/lib/content/gallery-layout";const K="relative z-[2] bg-bg py-[120px] max-[800px]:py-[70px]",D="relative z-[2] bg-bg pt-0 pb-[120px] max-[800px]:pt-0 max-[800px]:pb-[70px]",U="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] max-[800px]:px-[min(20px,var(--sf-site-gutter,40px))]";function W({items:i,num:d,title:a,linkText:o,linkHref:p,galleryHref:r="/gallery",submitHref:x="/contact",previewHover:g,display:f,displayPhone:y,styleOwner:h,layout:n,columns:t,columnsMobile:u,gap:v,omitHead:m=!1}){const N=w(),G=z(),L=r!==N&&(G||r!=="/gallery"),c=F(n),l=c?n:null,S=!c&&t!=null&&t!=="",s=M("GalleryB",v,"both"),_=l?{className:`sf-card-grid sf-gallery-zone ${O(l)} grid${s.className}`,style:s.style}:S?{className:`sf-card-grid sf-grid-zone grid${s.className}`,style:{...s.style,"--sf-grid-cols":String(k(t)),"--sf-grid-cols-phone":String(B(u,t))}}:{className:`sf-card-grid grid grid-cols-4${s.className} max-[1500px]:grid-cols-3 max-[800px]:grid-cols-1`,style:s.style},b=o?{text:o,href:p||"#"}:void 0,C=a?I(a,!1):void 0;return e("section",{className:m?D:K,children:E("div",{className:U,children:[m?null:e($,{num:d,title:C,link:b}),l&&e("style",{dangerouslySetInnerHTML:{__html:T(l)}}),i&&e(j.Provider,{value:{galleryHref:r,submitHref:x,previewHover:g,display:f,displayPhone:y,styleOwner:h},children:e(A,{children:e("div",{[R]:"",style:{display:"contents"},children:e(i,{..._,minEmptyHeight:320})})})}),L&&e("div",{className:"mt-12 flex flex-col items-center gap-3",children:e(P,{href:r,variant:"ghost",children:"See Gallery"})})]})})}export{W as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as r,jsxs as o,Fragment as x}from"react/jsx-runtime";import{createContext as G,useCallback as M,useContext as Y,useEffect as W,useRef as B,useState as L}from"react";import S from"next/link";import D from"./GalleryCard.js";import F,{LightboxClose as V}from"./Lightbox.js";import{useSiteSells as q}from"./SiteRecordContext.js";import{renderGold as d,renderHeadline as O}from"efficient-web-builder/render/components/goldPhrases";import{sizedImage as U}from"efficient-web-builder/format/lib/sized-image";const Z="(max-width: 1100px) 100vw, min(59vw, 1050px)",J=G({}),he=[{id:"tag",label:"Tag"},{id:"eyebrow",label:"Eyebrow"},{id:"title",label:"Title"},{id:"meta",label:"Meta"},{id:"number",label:"Card number"}],K="data-gallery-grid",C="data-gallery-tile";function Q(e,n){const[l,s]=L(null);return W(()=>{const c=e.current,a=c?.closest(`[${K}]`);if(!c||!a)return;const u=()=>{const v=Array.from(a.querySelectorAll(`[${C}]`)),y=v.indexOf(c),m=y>=0?{index:y+1,total:v.length}:null;s(h=>h?.index===m?.index&&h?.total===m?.total?h:m)};if(u(),!n)return;const b=new MutationObserver(u);return b.observe(a,{childList:!0,subtree:!0}),()=>b.disconnect()},[e,n]),l}const fe={process:"Category",eyebrow:"Subtitle",name:"Item name",meta:"Detail"},X=()=>({image:"",href:"#",process:"",eyebrow:"",name:"",meta:""}),ge=Array.from({length:6},X);function ee(e,n){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||n}function te(e){const n=(e.photos??[]).map(a=>a?.src).filter(a=>!!a),l=e.image||n[0]||"",s=[l,...n].filter(a=>!!a),c=ee(e.name,"gallery-item");return{car:e.eyebrow??"",wheel:e.name??"",process:e.process??"",finish:e.meta??"",imageLabel:`${c}.jpg`,detailLabel:`${c}-detail.jpg`,imageSrc:l||void 0,detailSrc:n[0]||l||void 0,photos:s,href:e.href}}function re({editing:e=!1,previewHover:n,ratio:l,captionPlace:s,...c}){const{galleryHref:a="/gallery",submitHref:u="/contact",previewHover:b,display:v,displayPhone:y,styleOwner:m,photosOnly:h=!1}=Y(J),t=te(c),f=q()&&!h,z=!f&&!ne(t),i=t.photos??(t.imageSrc?[t.imageSrc]:[]),P=B(null),_=M(p=>{P.current=p},[]),j=Q(P,e),H=e&&(!!n||!!b),[I,g]=L(!1),[w,N]=L(0),E=()=>N(p=>(p-1+i.length)%i.length),T=()=>N(p=>(p+1)%i.length),k=i[w]??t.imageSrc??"",$=r(D,{build:t,forceHover:H,index:j?.index,total:j?.total,ratio:l,captionPlace:s,display:v,displayPhone:y,styleOwner:m,editing:e});return o(x,{children:[e?r("div",{ref:_,[C]:"",className:"block w-full text-left",children:$}):r("button",{ref:_,[C]:"",type:"button","aria-label":f?`Open ${t.car||"build"} on ${t.wheel||"wheel"}`:R(t),onClick:()=>{N(0),g(!0)},className:"block w-full cursor-pointer text-left focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2",children:$}),r(F,{open:I,onClose:()=>g(!1),label:f?`${t.car} on ${t.wheel}`:R(t),onPrev:i.length>1?E:void 0,onNext:i.length>1?T:void 0,className:"flex items-center justify-center p-6 backdrop-blur-[8px] max-[700px]:p-3",style:{background:"color-mix(in oklab, var(--bg) 78%, transparent)"},children:o("div",{onClick:p=>p.stopPropagation(),className:`relative grid w-[min(1800px,100%)] max-h-[calc(100vh-48px)] ${z?"grid-cols-1":"grid-cols-[1.4fr_1fr]"} overflow-hidden border border-line bg-bg max-[1100px]:grid-cols-1 max-[1100px]:overflow-auto`,style:{boxShadow:"0 60px 120px -20px color-mix(in srgb, var(--sf-shadow-color, #141416) 70%, transparent)"},children:[r(V,{label:"Close popup",className:"absolute right-[24px] top-[24px] z-[5] flex h-[56px] w-[56px] items-center justify-center border border-line font-mono text-[length:var(--size-label,21px)] text-fg-dim transition-colors hover:border-accent hover:text-fg",style:{background:"color-mix(in oklab, var(--bg) 70%, transparent)"},children:"✕"}),o("div",{className:"relative flex min-h-[690px] items-center justify-center overflow-hidden bg-surface-2 max-[1100px]:min-h-[450px]",children:[k&&r("img",{...U(k,{fallbackWidth:1280}),sizes:Z,alt:`${(f?t.car:t.wheel||t.car)||"Photo"} — ${w+1} of ${i.length}`,className:"block h-full max-h-[88vh] w-full object-cover"},k),i.length>1&&o(x,{children:[r("button",{type:"button","aria-label":"Previous photo",onClick:E,className:"absolute left-4 top-1/2 flex h-16 w-16 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,24px)] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"◁"}),r("button",{type:"button","aria-label":"Next photo",onClick:T,className:"absolute right-4 top-1/2 flex h-16 w-16 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,24px)] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"▷"}),o("span",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 border border-fg-dim/30 bg-overlay-scrim/50 px-4 py-1.5 font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.22em] text-fg-dim backdrop-blur-[4px]",children:[w+1," / ",i.length]})]})]}),f?o("div",{className:"flex flex-col gap-[30px] px-[60px] py-[72px] max-[1100px]:px-9 max-[1100px]:py-[54px]",children:[t.process&&r("span",{className:"font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.3em] text-accent",children:d(t.process)}),t.wheel&&r("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(42px,4.5vw,60px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.025em]",children:O(t.wheel,!1)}),t.car&&o("div",{className:"font-heading3 text-[length:var(--size-headingSmall,27px)] leading-[1.4] text-fg",children:["on ",r("em",{className:"font-serif font-normal italic text-accent tracking-[-0.01em]",children:d(t.car,!0)})]}),o("dl",{className:"mt-3 grid grid-cols-[auto_1fr] gap-x-7 gap-y-[18px] border-y border-line py-[30px] font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.22em]",children:[t.wheel&&o(x,{children:[r("dt",{className:"text-fg-dim",children:"Wheel"}),r("dd",{className:"text-fg",children:d(t.wheel)})]}),t.process&&o(x,{children:[r("dt",{className:"text-fg-dim",children:"Process"}),r("dd",{className:"text-fg",children:d(t.process)})]}),t.finish&&o(x,{children:[r("dt",{className:"text-fg-dim",children:"Finish"}),r("dd",{className:"text-fg",children:d(t.finish)})]}),t.car&&o(x,{children:[r("dt",{className:"text-fg-dim",children:"Vehicle"}),r("dd",{className:"text-fg",children:d(t.car)})]})]}),o("div",{className:"mt-auto flex flex-col gap-3.5 pt-6",children:[o(S,{href:t.href||"/wheels",onClick:()=>g(!1),className:"group flex items-center justify-between gap-6 border border-btn bg-btn px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-btn-ink transition-colors hover:border-fg hover:bg-fg",children:[r("span",{children:"View product"}),r("span",{className:"transition-transform group-hover:translate-x-[6px]",children:"→"})]}),o(S,{href:a,onClick:()=>g(!1),className:"flex items-center justify-between gap-6 border border-line px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[r("span",{children:"See more builds"}),r("span",{children:"→"})]}),o(S,{href:u,onClick:()=>g(!1),className:"flex items-center justify-between gap-6 border border-line px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[r("span",{children:"Submit your build"}),r("span",{children:"→"})]})]})]}):!z&&r(oe,{build:t})]})})]})}function A(e){return[e.process,e.car,e.finish].filter((n,l,s)=>!!n&&n!==e.wheel&&s.indexOf(n)===l)}function ne(e){return!!e.wheel||A(e).length>0}function R(e){const n=e.wheel||e.car;return n?`Open photo of ${n}`:"Open photo"}function oe({build:e}){const n=e.wheel,l=A(e);return o("div",{className:"flex flex-col gap-[24px] px-[60px] py-[72px] max-[1100px]:px-9 max-[1100px]:py-[54px]",children:[n&&r("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(42px,4.5vw,60px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.025em]",children:O(n,!1)}),l.map(s=>r("p",{className:"text-[length:var(--size-body,18px)] leading-[1.5] text-fg",children:d(s)},s))]})}export{K as GALLERY_GRID_ATTR,fe as GALLERY_ITEM_HINTS,ge as GALLERY_ITEM_SEEDS,C as GALLERY_TILE_ATTR,he as GALLERY_TILE_PARTS,J as GalleryLinksContext,re as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as o,Fragment as I,jsxs as s}from"react/jsx-runtime";import te from"next/link";import{usePathname as Ke}from"next/navigation";import{useCallback as Ve,useEffect as O,useState as p}from"react";import{useCart as qe}from"./CartContext.js";import{useSearch as Ye}from"./SearchContext.js";import Je,{useCountrySelectShows as Xe}from"./CountrySelect.js";import{resolveCountryShowAs as Qe}from"../lib/content/country-show-as.js";import ne from"./HeaderNavItem.js";import Ze from"efficient-web-builder/render/components/Logo";import et from"./MenuPlaceholderLabel.js";import{withRMark as re}from"efficient-web-builder/render/components/RMark";import{AccountButton as tt,CartButton as nt,SearchButton as rt}from"./HeaderTools.js";import{useHeaderBar as ot}from"./useHeaderBar.js";import{useModalDismiss as st}from"./useModalDismiss.js";import at from"./ThemeToggle.js";import{products as lt}from"../lib/api/index.js";import{shouldFetchPublicHeaderSettings as it}from"../lib/header-settings-fetch.js";import{HEADER_MENU_PLACEHOLDER_COUNT as ct}from"../lib/content/menu-placeholder.js";import{DEFAULT_SWITCH_SHOWN as dt}from"efficient-web-builder/format/lib/theme";import{chromeWidthStyle as mt,resolveChromeWidth as ut}from"efficient-web-builder/format/lib/content/page-width";import{headerThemeWrap as ht}from"../lib/content/header-theme.js";import{headerSolidBackground as ft,isProductPage as pt}from"../lib/content/header-bar.js";import{surfaceIsLight as gt}from"../lib/logo/surface-is-light.js";import{HEADER_HEIGHT_PX as bt,HEADER_SET_HEIGHT_CSS as xt}from"efficient-web-builder/render/lib/puck/header-clearance";import{HEADER_INK_ATTR as vt,HEADER_INK_OVERRIDE_ATTR as yt,resolveHeaderInkMode as wt}from"efficient-web-builder/render/lib/puck/header-ink";const oe={stacked:{grid:"hidden min-[1501px]:grid",flex:"hidden min-[1501px]:flex"},inline:{grid:"hidden view-tablet:grid",flex:"hidden view-tablet:flex"}},St=Array.from({length:ct},()=>({href:"#",label:o(et,{})}));function kt({previewSettings:g,initialSettings:$,editorPreview:T,showThemeToggle:se,wordmark:ae,hideLogo:le,hideMenu:ie,siteName:L,commerceEnabled:y=!0}={}){const M=Ke(),[ce,de]=p(!1);O(()=>{const e=x.current?.ownerDocument??document,t=()=>de(e.querySelector(`[${vt}="light"]`)!=null);t();const f=requestAnimationFrame(t);return()=>cancelAnimationFrame(f)},[M]);const z=pt(M),[c,w]=p(!1),{open:me,totals:ue}=qe(),{open:he}=Ye(),[C,fe]=p(!1),[pe,ge]=p(null),[be,xe]=p(null),[n,ve]=p($??null),r=g??(n?{logoUrl:n.logoUrl,reverseLogo:n.reverseLogo,logoReversed:n.logoReversed,logoInkIsDark:n.logoInkIsDark,logoPosition:n.logoPosition,logoSize:n.logoSize,logoSizePx:n.logoSizePx,menuItems:(n.menuItems??[]).map(e=>({label:e.label,url:e.url,dropdown_menu:null,dropdown_items:e.dropdownItems??[]})),menuSplit:n.menuSplit??3,menuPosition:n.menuPosition,menuRow:n.menuRow,menuGapPx:n.menuGapPx??null,searchEnabled:n.searchEnabled,searchPosition:n.searchPosition,searchRow:n.searchRow,countrySelectorEnabled:n.countrySelectorEnabled,countrySelectorShowAs:n.countrySelectorShowAs,countryUrls:n.countryUrls,accountEnabled:n.accountEnabled,cartEnabled:n.cartEnabled,utilStyle:n.utilStyle,navTextCase:n.navTextCase,lightReverseText:n.lightReverseText,topTextColor:n.topTextColor,transparentTop:n.transparentTop,surface:n.surface,theme:n.theme,width:n.width,heightPx:n.heightPx,sticky:n.sticky}:null),ye=le?null:r?.logoUrl??null,we=r?.reverseLogo??!1,Se=r?.logoReversed??null,ke=r?.logoInkIsDark??null,i=r?.logoPosition??"center",Ne=r?.logoSize??"medium",Ee=r?.logoSizePx??null,B=Math.min(Math.max(r?.menuSplit??3,1),4),Pe=(r?.menuPosition??"left")==="center",Ie=(r?.menuPosition??"left")==="beside",U=(r?.menuRow??"top")==="inline",F=r?.menuGapPx??null,$e=F!=null?{gap:`${F}px`}:void 0,S=U?oe.inline:oe.stacked,Te=r?.searchEnabled??!1,G=r?.searchPosition??"right",Le=r?.countrySelectorEnabled??!0,Ce=Qe(r?.countrySelectorShowAs),_=r?.accountEnabled??!0,_e=r?.cartEnabled??!0,A=(r?.utilStyle??"icon")==="text",a=`mono-eyebrow${(r?.navTextCase??"uppercase")==="capitalised"?" mono-eyebrow-plain":""}`,W=r?.countryUrls??{},Ae=ut(r?.width),De=mt(Ae)??void 0,Re=r?.heightPx??bt.default,K=r?.sticky??"always",k=wt(r?.topTextColor),m=ht(r?.theme),N=Object.keys(W),V=Xe(N.length?N:void 0),b=Le?o(Je,{countries:N.length?N:void 0,urls:g?void 0:W,showAs:Ce}):null,{headerRef:x,scrolled:q,navHidden:He}=ot({stickyMode:K,heightPx:Re}),je=m?JSON.stringify(m.style):null;O(()=>{const e=x.current?.ownerDocument??document,t=e.defaultView??window,f=ee=>ee?gt(t.getComputedStyle(ee).getPropertyValue("--bg")):null,Z=()=>{fe(e.documentElement.getAttribute("data-theme")==="light"),ge(f(e.body)),xe(f(x.current))};Z();const j=new MutationObserver(Z);return j.observe(e.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),e.body&&j.observe(e.body,{attributes:!0,attributeFilter:["style"]}),()=>j.disconnect()},[x,je]);const v=se??dt?o(at,{}):null;O(()=>{if(!it({editorPreview:!!T,hasPreviewSettings:!!g,hasInitialSettings:!!$}))return;let e=!1;return lt.getHeaderSettings().then(t=>!e&&ve(t)).catch(t=>{console.warn("[header] settings fetch failed; using built-in defaults",t)}),()=>{e=!0}},[T,g,$]);const E=q||z,Y=ft(C,z),J=k==="auto"?ce:k==="light",Oe=E||!J,Me=E?be??C:(pe??C)&&!J,ze=k==="auto"?null:{[yt]:k},Be=Ve(()=>w(!1),[]);st({active:c,onDismiss:Be});const d=(e,t,f="start")=>o(ne,{item:e,dropdownAlign:f},t),Ue=!ie&&(r?.menuItems?.length??0)>0,X=!!T||!!g,l=Ue?r.menuItems.map(e=>({href:e.url||"",label:re(e.label),plainLabel:e.label,dropdownItems:(e.dropdown_items??[]).map(t=>({href:t.url||"",label:re(t.label),plainLabel:t.label}))})):X?St.map(e=>({...e,plainLabel:"Menu item",dropdownItems:[]})):[],Fe=l.length>0||y&&_||!!b&&V||!!v,Ge=i==="center"?l.slice(0,B):i==="right"?l:[],We=i==="center"?l.slice(B):i==="left"?l:[],P=Te?o(rt,{onClick:X?void 0:he,asText:A}):null,D=y&&_?o(tt,{asText:A}):null,R=e=>y&&_e?o(nt,{onClick:me,count:ue.sets,asText:A,className:e}):null,u=s(I,{children:[G==="left"?P:null,b,v,D,R(),G==="right"?P:null]}),H=(e,t=!1)=>o(te,{href:"/","aria-label":L?`${L} home`:"Home",className:e,children:o(Ze,{variant:"header",scrolled:Oe,src:ye,reverse:we,onLightSurface:Me,reversedSrc:Se,inkIsDark:ke,size:Ne,sizePx:Ee,wordmark:ae,siteName:L,fitToContainer:t})}),h=H("inline-flex shrink-0 items-center justify-center"),Q="flex min-w-0 flex-1 items-center overflow-x-clip [container-type:inline-size]";return s(I,{children:[o("header",{ref:x,"data-scrolled":q||void 0,...ze,className:["sf-site-header",...m?[m.className]:[],K==="none"?"absolute":"fixed","inset-x-0 top-0 z-50","flex items-center","px-[var(--sf-site-gutter,40px)] max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]",E?"border-b border-line backdrop-blur-md":"border-b border-transparent","transition-[background,border-color,transform] duration-300 ease-out"].join(" "),style:{...m?m.style:null,minHeight:xt,...He?{transform:"translateY(-100%)"}:null,...E?{background:Y,color:"var(--fg)","--sf-header-ground":Y}:{color:"var(--sf-header-overlay-fg)","--sf-header-ground":"var(--sf-header-overlay-ground)"}},children:s("div",{className:"w-full",style:De,children:[Pe?s("div",{"data-header-band":"",className:`${S.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[i==="right"?o("nav",{className:`${a} flex items-center gap-8`,children:u}):o("div",{className:"flex items-center",children:h}),o("nav",{className:`${a} flex items-center justify-center gap-8`,children:l.map((e,t)=>d(e,`${e.href}-${t}`,"center"))}),i==="right"?o("div",{className:"flex items-center justify-end",children:h}):o("nav",{className:`${a} flex items-center justify-end gap-8`,children:u})]}):i==="center"?s("div",{"data-header-band":"",className:`${S.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[o("nav",{className:`${a} flex items-center gap-8`,children:Ge.map((e,t)=>d(e,`${e.href}-${t}`))}),h,s("nav",{className:`${a} flex items-center justify-end gap-8`,children:[We.map((e,t)=>d(e,`${e.href}-${t}`,"end")),u]})]}):Ie?s("div",{"data-header-band":"",className:`${S.flex} items-center justify-between gap-8`,children:[s("div",{className:"flex items-center gap-8",style:$e,children:[h,o("nav",{className:`${a} flex items-center gap-8`,children:l.map((e,t)=>d(e,`${e.href}-${t}`))})]}),o("nav",{className:`${a} flex items-center justify-end gap-8`,children:u})]}):o("div",{"data-header-band":"",className:`${S.flex} items-center justify-between gap-8`,children:i==="right"?s(I,{children:[s("nav",{className:`${a} flex items-center gap-8`,children:[l.map((e,t)=>d(e,`${e.href}-${t}`)),u]}),h]}):s(I,{children:[h,s("nav",{className:`${a} flex items-center gap-8`,children:[l.map((e,t)=>d(e,`${e.href}-${t}`)),u]})]})}),!U&&s("div",{"data-header-band":"",className:"hidden view-tablet:max-[1501px]:flex flex-col gap-3",children:[s("div",{className:"flex items-center justify-between",children:[H(Q,!0),s("div",{className:`${a} flex shrink-0 items-center gap-5`,children:[P,b,v,D,R()]})]}),o("nav",{className:`${a} flex items-center gap-6 border-t border-line/60 pt-3`,children:l.map((e,t)=>d(e,`${e.href}-${t}`))})]}),s("div",{"data-header-phone":"",className:"hidden max-view-tablet:flex items-center justify-between",children:[H(Q,!0),s("div",{className:"flex shrink-0 items-center gap-4",children:[P,D,R(a),Fe&&s("button",{type:"button","aria-label":c?"Close menu":"Open menu","aria-expanded":c,onClick:()=>w(e=>!e),className:"flex h-11 w-11 flex-col items-center justify-center gap-2",children:[o("span",{className:`block h-px w-5 bg-current transition-transform ${c?"translate-y-[3px] rotate-45":""}`}),o("span",{className:`block h-px w-5 bg-current transition-transform ${c?"opacity-0":""}`}),o("span",{className:`block h-px w-5 bg-current transition-transform ${c?"-translate-y-[3px] -rotate-45":""}`})]})]})]})]})}),c&&s("div",{"data-header-phone-menu":"",className:"fixed inset-x-0 top-0 bottom-0 z-40 hidden flex-col gap-8 overflow-y-auto bg-bg px-6 pt-24 pb-10 max-view-tablet:flex",children:[l.map((e,t)=>o(ne,{item:e,mobile:!0,onNavigate:()=>w(!1)},`${e.href}-${t}`)),s("div",{className:"mt-auto flex flex-col gap-4 border-t border-line pt-6",children:[y&&_&&s("div",{className:"flex items-center justify-between",children:[o("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),o(te,{href:"/account",onClick:()=>w(!1),className:"mono-eyebrow underline",children:"Your account"})]}),b&&V&&s("div",{className:"flex items-center justify-between",children:[o("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),b]}),v&&s("div",{className:"flex items-center justify-between",children:[o("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),v]})]})]})]})}export{kt as default};
|
|
1
|
+
"use client";import{jsx as o,Fragment as I,jsxs as s}from"react/jsx-runtime";import te from"next/link";import{usePathname as Ke}from"next/navigation";import{useCallback as Ve,useEffect as O,useState as p}from"react";import{useCart as qe}from"./CartContext.js";import{useSearch as Ye}from"./SearchContext.js";import Je,{useCountrySelectShows as Xe}from"./CountrySelect.js";import{resolveCountryShowAs as Qe}from"../lib/content/country-show-as.js";import ne from"./HeaderNavItem.js";import Ze from"efficient-web-builder/render/components/Logo";import et from"./MenuPlaceholderLabel.js";import{withRMark as re}from"efficient-web-builder/render/components/RMark";import{AccountButton as tt,CartButton as nt,SearchButton as rt}from"./HeaderTools.js";import{useHeaderBar as ot}from"./useHeaderBar.js";import{useModalDismiss as st}from"./useModalDismiss.js";import at from"./ThemeToggle.js";import{products as lt}from"../lib/api/index.js";import{shouldFetchPublicHeaderSettings as it}from"../lib/header-settings-fetch.js";import{HEADER_MENU_PLACEHOLDER_COUNT as ct}from"../lib/content/menu-placeholder.js";import{DEFAULT_SWITCH_SHOWN as dt}from"efficient-web-builder/format/lib/theme";import{chromeWidthStyle as mt,resolveChromeWidth as ut}from"efficient-web-builder/format/lib/content/page-width";import{headerThemeWrap as ht}from"../lib/content/header-theme.js";import{headerSolidBackground as ft,isProductPage as pt}from"../lib/content/header-bar.js";import{surfaceIsLight as gt}from"../lib/logo/surface-is-light.js";import{HEADER_HEIGHT_PX as bt,HEADER_SET_HEIGHT_CSS as xt}from"efficient-web-builder/render/lib/puck/header-clearance";import{HEADER_INK_ATTR as vt,HEADER_INK_OVERRIDE_ATTR as yt,resolveHeaderInkMode as wt}from"efficient-web-builder/render/lib/puck/header-ink";const oe={stacked:{grid:"hidden min-[1501px]:grid",flex:"hidden min-[1501px]:flex"},inline:{grid:"hidden view-tablet:grid",flex:"hidden view-tablet:flex"}},St=Array.from({length:ct},()=>({href:"#",label:o(et,{})}));function kt({previewSettings:g,initialSettings:$,editorPreview:T,showThemeToggle:se,wordmark:ae,hideLogo:le,hideMenu:ie,siteName:L,commerceEnabled:b=!0}={}){const M=Ke(),[ce,de]=p(!1);O(()=>{const e=v.current?.ownerDocument??document,t=()=>de(e.querySelector(`[${vt}="light"]`)!=null);t();const f=requestAnimationFrame(t);return()=>cancelAnimationFrame(f)},[M]);const z=pt(M),[c,w]=p(!1),{open:me,totals:ue}=qe(),{open:he}=Ye(),[C,fe]=p(!1),[pe,ge]=p(null),[be,xe]=p(null),[n,ve]=p($??null),r=g??(n?{logoUrl:n.logoUrl,reverseLogo:n.reverseLogo,logoReversed:n.logoReversed,logoInkIsDark:n.logoInkIsDark,logoPosition:n.logoPosition,logoSize:n.logoSize,logoSizePx:n.logoSizePx,menuItems:(n.menuItems??[]).map(e=>({label:e.label,url:e.url,dropdown_menu:null,dropdown_items:e.dropdownItems??[]})),menuSplit:n.menuSplit??3,menuPosition:n.menuPosition,menuRow:n.menuRow,menuGapPx:n.menuGapPx??null,searchEnabled:n.searchEnabled,searchPosition:n.searchPosition,searchRow:n.searchRow,countrySelectorEnabled:n.countrySelectorEnabled,countrySelectorShowAs:n.countrySelectorShowAs,countryUrls:n.countryUrls,accountEnabled:n.accountEnabled,cartEnabled:n.cartEnabled,utilStyle:n.utilStyle,navTextCase:n.navTextCase,lightReverseText:n.lightReverseText,topTextColor:n.topTextColor,transparentTop:n.transparentTop,surface:n.surface,theme:n.theme,width:n.width,heightPx:n.heightPx,sticky:n.sticky}:null),ye=le?null:r?.logoUrl??null,we=r?.reverseLogo??!1,Se=r?.logoReversed??null,ke=r?.logoInkIsDark??null,i=r?.logoPosition??"center",Ne=r?.logoSize??"medium",Pe=r?.logoSizePx??null,B=Math.min(Math.max(r?.menuSplit??3,1),4),Ee=(r?.menuPosition??"left")==="center",Ie=(r?.menuPosition??"left")==="beside",U=(r?.menuRow??"top")==="inline",F=r?.menuGapPx??null,$e=F!=null?{gap:`${F}px`}:void 0,S=U?oe.inline:oe.stacked,Te=r?.searchEnabled??!1,G=r?.searchPosition??"right",Le=r?.countrySelectorEnabled??!0,Ce=Qe(r?.countrySelectorShowAs),_=r?.accountEnabled??!0,_e=r?.cartEnabled??!0,A=(r?.utilStyle??"icon")==="text",a=`mono-eyebrow${(r?.navTextCase??"uppercase")==="capitalised"?" mono-eyebrow-plain":""}`,W=r?.countryUrls??{},Ae=ut(r?.width),De=mt(Ae)??void 0,Re=r?.heightPx??bt.default,K=r?.sticky??"always",k=wt(r?.topTextColor),m=ht(r?.theme),N=Object.keys(W),V=Xe(N.length?N:void 0),x=Le?o(Je,{countries:N.length?N:void 0,urls:g?void 0:W,showAs:Ce}):null,{headerRef:v,scrolled:q,navHidden:He}=ot({stickyMode:K,heightPx:Re}),je=m?JSON.stringify(m.style):null;O(()=>{const e=v.current?.ownerDocument??document,t=e.defaultView??window,f=ee=>ee?gt(t.getComputedStyle(ee).getPropertyValue("--bg")):null,Z=()=>{fe(e.documentElement.getAttribute("data-theme")==="light"),ge(f(e.body)),xe(f(v.current))};Z();const j=new MutationObserver(Z);return j.observe(e.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),e.body&&j.observe(e.body,{attributes:!0,attributeFilter:["style"]}),()=>j.disconnect()},[v,je]);const y=se??dt?o(at,{}):null;O(()=>{if(!it({editorPreview:!!T,hasPreviewSettings:!!g,hasInitialSettings:!!$}))return;let e=!1;return lt.getHeaderSettings().then(t=>!e&&ve(t)).catch(t=>{console.warn("[header] settings fetch failed; using built-in defaults",t)}),()=>{e=!0}},[T,g,$]);const P=q||z,Y=ft(C,z),J=k==="auto"?ce:k==="light",Oe=P||!J,Me=P?be??C:(pe??C)&&!J,ze=k==="auto"?null:{[yt]:k},Be=Ve(()=>w(!1),[]);st({active:c,onDismiss:Be});const d=(e,t,f="start")=>o(ne,{item:e,dropdownAlign:f},t),Ue=!ie&&(r?.menuItems?.length??0)>0,X=!!T||!!g,l=Ue?r.menuItems.map(e=>({href:e.url||"",label:re(e.label),plainLabel:e.label,dropdownItems:(e.dropdown_items??[]).map(t=>({href:t.url||"",label:re(t.label),plainLabel:t.label}))})):X?St.map(e=>({...e,plainLabel:"Menu item",dropdownItems:[]})):[],Fe=l.length>0||b&&_||!!x&&V||!!y,Ge=i==="center"?l.slice(0,B):i==="right"?l:[],We=i==="center"?l.slice(B):i==="left"?l:[],E=Te&&b?o(rt,{onClick:X?void 0:he,asText:A}):null,D=b&&_?o(tt,{asText:A}):null,R=e=>b&&_e?o(nt,{onClick:me,count:ue.sets,asText:A,className:e}):null,u=s(I,{children:[G==="left"?E:null,x,y,D,R(),G==="right"?E:null]}),H=(e,t=!1)=>o(te,{href:"/","aria-label":L?`${L} home`:"Home",className:e,children:o(Ze,{variant:"header",scrolled:Oe,src:ye,reverse:we,onLightSurface:Me,reversedSrc:Se,inkIsDark:ke,size:Ne,sizePx:Pe,wordmark:ae,siteName:L,fitToContainer:t})}),h=H("inline-flex shrink-0 items-center justify-center"),Q="flex min-w-0 flex-1 items-center overflow-x-clip [container-type:inline-size]";return s(I,{children:[o("header",{ref:v,"data-scrolled":q||void 0,...ze,className:["sf-site-header",...m?[m.className]:[],K==="none"?"absolute":"fixed","inset-x-0 top-0 z-50","flex items-center","px-[var(--sf-site-gutter,40px)] max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]",P?"border-b border-line backdrop-blur-md":"border-b border-transparent","transition-[background,border-color,transform] duration-300 ease-out"].join(" "),style:{...m?m.style:null,minHeight:xt,...He?{transform:"translateY(-100%)"}:null,...P?{background:Y,color:"var(--fg)","--sf-header-ground":Y}:{color:"var(--sf-header-overlay-fg)","--sf-header-ground":"var(--sf-header-overlay-ground)"}},children:s("div",{className:"w-full",style:De,children:[Ee?s("div",{"data-header-band":"",className:`${S.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[i==="right"?o("nav",{className:`${a} flex items-center gap-8`,children:u}):o("div",{className:"flex items-center",children:h}),o("nav",{className:`${a} flex items-center justify-center gap-8`,children:l.map((e,t)=>d(e,`${e.href}-${t}`,"center"))}),i==="right"?o("div",{className:"flex items-center justify-end",children:h}):o("nav",{className:`${a} flex items-center justify-end gap-8`,children:u})]}):i==="center"?s("div",{"data-header-band":"",className:`${S.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[o("nav",{className:`${a} flex items-center gap-8`,children:Ge.map((e,t)=>d(e,`${e.href}-${t}`))}),h,s("nav",{className:`${a} flex items-center justify-end gap-8`,children:[We.map((e,t)=>d(e,`${e.href}-${t}`,"end")),u]})]}):Ie?s("div",{"data-header-band":"",className:`${S.flex} items-center justify-between gap-8`,children:[s("div",{className:"flex items-center gap-8",style:$e,children:[h,o("nav",{className:`${a} flex items-center gap-8`,children:l.map((e,t)=>d(e,`${e.href}-${t}`))})]}),o("nav",{className:`${a} flex items-center justify-end gap-8`,children:u})]}):o("div",{"data-header-band":"",className:`${S.flex} items-center justify-between gap-8`,children:i==="right"?s(I,{children:[s("nav",{className:`${a} flex items-center gap-8`,children:[l.map((e,t)=>d(e,`${e.href}-${t}`)),u]}),h]}):s(I,{children:[h,s("nav",{className:`${a} flex items-center gap-8`,children:[l.map((e,t)=>d(e,`${e.href}-${t}`)),u]})]})}),!U&&s("div",{"data-header-band":"",className:"hidden view-tablet:max-[1501px]:flex flex-col gap-3",children:[s("div",{className:"flex items-center justify-between",children:[H(Q,!0),s("div",{className:`${a} flex shrink-0 items-center gap-5`,children:[E,x,y,D,R()]})]}),o("nav",{className:`${a} flex items-center gap-6 border-t border-line/60 pt-3`,children:l.map((e,t)=>d(e,`${e.href}-${t}`))})]}),s("div",{"data-header-phone":"",className:"hidden max-view-tablet:flex items-center justify-between",children:[H(Q,!0),s("div",{className:"flex shrink-0 items-center gap-4",children:[E,D,R(a),Fe&&s("button",{type:"button","aria-label":c?"Close menu":"Open menu","aria-expanded":c,onClick:()=>w(e=>!e),className:"flex h-11 w-11 flex-col items-center justify-center gap-2",children:[o("span",{className:`block h-px w-5 bg-current transition-transform ${c?"translate-y-[3px] rotate-45":""}`}),o("span",{className:`block h-px w-5 bg-current transition-transform ${c?"opacity-0":""}`}),o("span",{className:`block h-px w-5 bg-current transition-transform ${c?"-translate-y-[3px] -rotate-45":""}`})]})]})]})]})}),c&&s("div",{"data-header-phone-menu":"",className:"fixed inset-x-0 top-0 bottom-0 z-40 hidden flex-col gap-8 overflow-y-auto bg-bg px-6 pt-24 pb-10 max-view-tablet:flex",children:[l.map((e,t)=>o(ne,{item:e,mobile:!0,onNavigate:()=>w(!1)},`${e.href}-${t}`)),s("div",{className:"mt-auto flex flex-col gap-4 border-t border-line pt-6",children:[b&&_&&s("div",{className:"flex items-center justify-between",children:[o("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),o(te,{href:"/account",onClick:()=>w(!1),className:"mono-eyebrow underline",children:"Your account"})]}),x&&V&&s("div",{className:"flex items-center justify-between",children:[o("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),x]}),y&&s("div",{className:"flex items-center justify-between",children:[o("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),y]})]})]})]})}export{kt as default};
|
|
@@ -3,7 +3,7 @@ export type ToolStyle = "icon" | "text";
|
|
|
3
3
|
export declare function SearchTool({ style, editing }: {
|
|
4
4
|
style?: ToolStyle;
|
|
5
5
|
editing?: boolean;
|
|
6
|
-
}): import("react").JSX.Element;
|
|
6
|
+
}): import("react").JSX.Element | null;
|
|
7
7
|
export declare function CartTool({ style, editing }: {
|
|
8
8
|
style?: ToolStyle;
|
|
9
9
|
editing?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as t}from"react/jsx-runtime";import{useCart as u}from"./CartContext.js";import c,{useCountrySelectShows as i}from"./CountrySelect.js";import{AccountButton as a,CartButton as m,SearchButton as h}from"./HeaderTools.js";import f from"./ThemeToggle.js";import{useOfferToPhoneMenu as s}from"efficient-web-builder/render/components/PhoneMenuTools";import{useSearch as p}from"./SearchContext.js";import{useSiteSells as l,useSiteThemeSwitchShown as d}from"./SiteRecordContext.js";import{say as x}from"efficient-web-builder/format/lib/editor-words";function j({style:e="icon",editing:o=!1}){const{open:n}=p(),r=l();return s(r?"search":null),r?t("span",{"data-phone-menu-tool":"search",className:"contents",children:t(h,{onClick:o?void 0:n,asText:e==="text"})}):null}function k({style:e="icon",editing:o=!1}){const{open:n,totals:r}=u();return l()?t(m,{onClick:o?()=>{}:n,count:r.sets,asText:e==="text"}):null}function v({style:e="icon"}){const o=l();return s(o?"account":null),o?t(a,{asText:e==="text"}):null}function M(){const e=d();return s(e?"theme":null),e?t("span",{"data-phone-menu-tool":"theme",className:"contents",children:t(f,{})}):null}function O({editing:e=!1,showAs:o}){const n=i();return s(n?"region":null),n?t("span",{"data-phone-menu-tool":"region",className:"contents",children:t(c,{showAs:o})}):e?t("div",{"data-country-placeholder":"",className:"rounded border border-dashed border-line px-3 py-2 text-[13px] text-fg-dim",children:x("No regions yet")}):null}export{v as AccountTool,k as CartTool,O as CountrySwitchTool,j as SearchTool,M as ThemeSwitchTool};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as r,Fragment as b}from"react/jsx-runtime";import{photoLabel as
|
|
1
|
+
"use client";import{jsx as t,jsxs as r,Fragment as b}from"react/jsx-runtime";import{photoLabel as g}from"./product-hero/hero-view.js";import{stageControls as H,useHeldStagePhoto as L}from"./product-hero/stage-photo.js";import{DEFAULT_HERO_GALLERY_MODE as M,DEFAULT_HERO_IMAGE_FIT as S,parseHeroGalleryMode as $,parseHeroImageFit as F,resolveHeroImageFit as k}from"../lib/sections/hero-gallery.js";import{productHasComposedRender as z}from"../lib/wheels/set-mode.js";function A({product:a,view:e,angleIdx:s,onSelect:c,isLight:m,onLightbox:p,galleryMode:i=M,imageFit:x=S,style:n}){const o=$(i),d=k(F(x),z(a));return r("div",{"data-hero-gallery":o,"data-hero-fit":d,className:o==="tiled"?"flex items-start gap-3 max-[720px]:gap-2":void 0,style:n,children:[t("div",{className:o==="tiled"?"min-w-0 flex-1":void 0,children:t(R,{name:a.name,view:e,angleIdx:s,onSelect:c,isLight:m,onLightbox:p,fit:d})}),o!=="main"&&t(T,{name:a.name,view:e,angleIdx:s,onSelect:c,isLight:m,tiled:o==="tiled"})]})}function y(a){return a.photos.length>0?a.photos.length:a.thumbFallbackCells}const E=6;function R({name:a,view:e,angleIdx:s,onSelect:c,isLight:m,onLightbox:p,fit:i}){const x=e.photos[Math.min(s,e.photos.length-1)],n=L(e.photos,x),o=y(e),d=o>=2,N=String(o).padStart(2,"0"),f=Math.min(s,Math.max(e.photos.length-1,0)),_=d||e.captions[f]?g(e,f):"",u=[a,e.metaValue,_].filter(Boolean).join(" — "),h="max-[720px]:static",j=["relative flex aspect-square items-center justify-center overflow-hidden max-[720px]:col-span-2",m?"bg-bg":""].join(" ");return r("div",{className:"relative max-[720px]:grid max-[720px]:grid-cols-[minmax(0,1fr)_auto] max-[720px]:items-start max-[720px]:gap-x-3 max-[720px]:gap-y-2",style:{color:e.tint},children:[r("div",{className:`absolute left-0 top-0 z-10 flex items-center gap-3 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.2em] text-fg ${h} max-[720px]:min-w-0 max-[720px]:flex-wrap max-[720px]:gap-x-2 max-[720px]:gap-y-1`,children:[d&&r(b,{children:[r("span",{className:"text-accent",children:[String(s+1).padStart(2,"0")," / ",N]}),t("span",{className:"text-fg-dim",children:"·"})]}),t("span",{children:a}),e.metaValue&&r(b,{children:[t("span",{className:"text-fg-dim",children:"·"}),t("span",{className:"text-accent",children:e.metaValue})]})]}),d&&t("div",{className:`absolute right-5 top-5 z-10 flex gap-1 ${h}`,children:H(s,o,c).map(l=>t("button",{type:"button","aria-label":l.label,title:l.label,onClick:l.onClick,className:"flex h-7 w-7 items-center justify-center border border-fg-dim/60 text-fg transition-colors hover:border-accent hover:text-accent",children:l.glyph},l.label))}),r("div",{className:j,children:[["top-3 left-3","top-3 right-3","bottom-3 left-3","bottom-3 right-3"].map((l,C)=>t("span",{className:`absolute ${l} h-3 w-3 border border-fg-dim/40`,style:{borderTop:l.includes("top")?"1px solid var(--site-line)":"none",borderBottom:l.includes("bottom")?"1px solid var(--site-line)":"none",borderLeft:l.includes("left")?"1px solid var(--site-line)":"none",borderRight:l.includes("right")?"1px solid var(--site-line)":"none"}},C)),e.stageImage({photo:n,alt:u,label:`Open ${[a,e.metaValue].filter(Boolean).join(" ")} at full resolution`,onZoom:()=>p(n,u),fit:i})]}),r("div",{className:`absolute bottom-0 left-0 right-0 z-10 flex items-end justify-between gap-3 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim ${h} max-[720px]:col-span-2 max-[720px]:flex-wrap`,children:[r("span",{className:"flex min-w-0 flex-col gap-1",children:[e.specCaption&&t("span",{children:e.specCaption}),e.referenceNote&&t("span",{"data-hero-reference-note":!0,children:e.referenceNote}),e.galleryHint&&t("span",{"data-hero-gallery-hint":!0,children:e.galleryHint})]}),t("span",{children:e.originCaption})]})]})}function T({name:a,view:e,angleIdx:s,onSelect:c,isLight:m,tiled:p=!1}){const i=y(e);return i<2?null:t("div",{className:p?"order-[-1] flex w-16 flex-col gap-2 max-[720px]:w-12 max-[720px]:gap-1":"mt-2 grid grid-cols-4 gap-2 max-[720px]:gap-1",style:!p&&i>4?{gridTemplateColumns:`repeat(${Math.min(i,E)}, minmax(0, 1fr))`}:void 0,children:Array.from({length:i}).map((x,n)=>{const o=e.photos[n];return r("button",{type:"button",onClick:()=>c(n),"aria-label":`View ${g(e,n)}`,className:["relative flex aspect-square items-center justify-center overflow-hidden transition-colors",m?"bg-bg":"",n===s?"border border-accent":"border border-transparent hover:border-fg-dim"].join(" "),style:{color:e.tint},children:[t("span",{className:"absolute top-1.5 left-2 z-10 font-mono text-[length:var(--size-label,8px)] uppercase tracking-[0.18em] text-fg-dim",children:String(n+1).padStart(2,"0")}),e.thumbImage({photo:o,alt:`${a} — ${g(e,n)}`})]},n)})})}export{A as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as x,Fragment as He}from"react/jsx-runtime";import{GRID_CARD_SHOW as k}from"../lib/sections/card-show-defaults.js";import{useEffect as B,useId as Oe,useMemo as d,useState as ke}from"react";import{CARD_IMAGE_BG_OFF as Be,resolveCardImageBackground as De}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as Ge}from"efficient-web-builder/format/lib/content/card-image-shape";import{containerGapProps as Ue,GAP_LENGTH_VAR as je,GAP_ZONE_CLASS as We}from"efficient-web-builder/format/lib/content/container-gap";import Ke from"next/link";import Xe from"./ProductCard.js";import{CARD_ROWS_GRID_CLASS as Ze,cardRowsGridStyle as Ve}from"./WheelCardFrame.js";import{ProductCardChromeProvider as qe}from"./ProductCardChrome.js";import{gridClassImageSizes as Ye}from"../lib/sections/card-image-sizes.js";import{fillRowCss as Je}from"../lib/sections/fill-row.js";import{noHoleBands as ee,noHoleCss as re,showsASetCard as te}from"../lib/sections/grid-no-hole.js";import{setIsWide as Qe,summarySetBuild as er}from"../lib/wheels/set-mode.js";import{answersForKind as se}from"../lib/content/field-usage.js";import{wheelCardEyebrowShows as rr}from"./ProductCardEyebrow.js";import tr from"./NoCurrencyNote.js";import{DEFAULT_CARD_OUTLINE as sr,cardIndexCss as nr,parseCardIndexFormat as or}from"efficient-web-builder/format/lib/sections/product-card-style";import{DEFAULT_COVER_INDEX as ar}from"../lib/wheels/cover-rendering.js";import{SITE_WIDTH_CAP as ir,centredCap as lr}from"efficient-web-builder/format/lib/content/page-width";import{ProductCatalogProvider as mr,SectionWheelsProvider as dr}from"./ProductRef.js";import{useCurrency as pr}from"./CurrencyContext.js";import{COLLECTION_ATTR as cr,useCatalogFilter as gr}from"./catalog/CatalogFilterContext.js";import{renderGold as D,renderHeadline as ur}from"efficient-web-builder/render/components/goldPhrases";import{applyCatalogFilters as xr}from"../lib/wheels/catalog-filters.js";import{normalizeCatalogRows as hr}from"../lib/wheels/wheel-summary-casing.js";import fr from"./TyreSummaryCard.js";import{itemKind as G,plpItemsOfKinds as yr,plpKindNoun as Cr,resolvePlpKinds as ne}from"../lib/catalog/plp-item.js";import{rowsForGridSource as vr}from"../lib/wheels/grid-source.js";import{useUnifiedProductCatalog as br}from"./useProductCatalog.js";import{STICKY_UNDERHEADER_CLASS as wr}from"efficient-web-builder/render/lib/puck/header-clearance";import{finishFamiliesOf as Sr}from"../lib/wheels/finish-defaults.js";import{lugCountsOf as $r}from"../lib/wheels/lug-count.js";import{diametersOf as Mr}from"../lib/wheels/size-range.js";import{say as Nr}from"efficient-web-builder/format/lib/editor-words";import{DEFAULT_TITLE_SIZE as _r}from"../lib/sections/product-grid-title.js";const n={headingMediumUpTo800Xs:"max-[800px]:text-[length:var(--size-headingMedium,28px)]",headingMediumUpTo800Small:"max-[800px]:text-[length:var(--size-headingMedium,32px)]",headingMediumUpTo800Large:"max-[800px]:text-[length:var(--size-headingMedium,36px)]",headingMediumUpTo800Xl:"max-[800px]:text-[length:var(--size-headingMedium,40px)]",body:"text-[length:var(--size-body,13px)]",headingMedium1:"text-[length:var(--size-headingMedium,40px)]",headingMedium2:"text-[length:var(--size-headingMedium,48px)]",headingMedium3:"text-[length:var(--size-headingMedium,56px)]",headingMedium4:"text-[length:var(--size-headingMedium,64px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"},oe={1:"grid-cols-1",2:"grid-cols-2 max-[800px]:grid-cols-1",3:"grid-cols-3 max-[800px]:grid-cols-1",4:"grid-cols-4 max-[1100px]:grid-cols-2 max-[800px]:grid-cols-1",5:"grid-cols-5 max-[1100px]:grid-cols-2 max-[800px]:grid-cols-1",6:"grid-cols-6 max-[1100px]:grid-cols-3 max-[800px]:grid-cols-1"},ae=[{value:"para",label:"Paragraph size — 13px",cls:`font-mono font-normal uppercase tracking-[0.22em] ${n.labelLarge}`},{value:"sm",label:"Small — 40px",cls:`font-heading2 font-medium tracking-[-0.03em] ${n.headingMedium1} ${n.headingMediumUpTo800Xs}`},{value:"md",label:"Medium — 48px",cls:`font-heading2 font-medium tracking-[-0.03em] ${n.headingMedium2} ${n.headingMediumUpTo800Small}`},{value:"lg",label:"Large — 56px",cls:`font-heading2 font-medium tracking-[-0.03em] ${n.headingMedium3} ${n.headingMediumUpTo800Large}`},{value:"xl",label:"Extra large — 64px",cls:`font-heading2 font-medium tracking-[-0.03em] ${n.headingMedium4} ${n.headingMediumUpTo800Xl}`}];function Er(h){return(ae.find(p=>p.value===h)??ae.find(p=>p.value===_r)).cls}function Tr({num:h,catalog:p,kinds:N,title:_,titleSize:ie,padTop:U,description:v,link:f,products:le,wheels:me,source:c,columns:de,limit:o,editing:y,contentCapped:pe=!1,imageBackground:ce,spinOnHover:ge,coverIndex:ue,indexBadge:xe,outline:he,showBadge:fe,fieldUsage:g,showCardPrice:ye,showCardFinishes:Ce,showCardSizes:ve,showCardBuy:be,showCardPage:we,cardImage:Se,gap:$e}){const E=d(()=>g?se(g,"alloy-wheel"):void 0,[g]),Me=d(()=>g?se(g,"tyre"):void 0,[g]),t=`pg-${Oe().replace(/:/g,"")}`,m=oe[Math.min(6,Math.max(1,de??4))]??oe[4],j=typeof o=="number"&&o>0,W=pe,K=br(y===!0&&!!c),i=d(()=>c?hr(vr(c,yr(K??p??[],ne(N)))):null,[p,K,c,N]),T=c?.process,u=!!T,{filters:b,reportCount:L,reportLugs:z,reportSizes:I,reportFinishes:P,vehicle:X}=gr(),{currency:A}=pr(),F=u&&!!b.process&&b.process!==T,r=d(()=>i?u?xr(i,b,A,X.fit):i:null,[i,u,b,A,X.fit]);B(()=>{if(u)return L(t,F?0:r?.length??0),()=>L(t,0)},[u,F,r,L,t]);const Ne=d(()=>{const s=(r??[]).filter(l=>G(l)!=="tyre");if(s.length===0)return!1;const a=s.some(l=>!!l.process);return s.some(l=>!!l.setWords)||rr({kind:!1,brand:!1,process:a},E??[])},[r,E]),w=d(()=>({lugs:$r(i??[]),sizes:Mr(i??[]),finishes:Sr(i??[])}),[i]);B(()=>(z(t,w.lugs),I(t,w.sizes),P(t,w.finishes),()=>{z(t,[]),I(t,[]),P(t,[])}),[w,z,I,P,t]);const C=Ue("ProductGrid",$e,"both"),Z=C.className.includes(We),R=`${t} grid${C.className} bg-[var(--catalog-grid-bg)] ${m}`,_e=Z?`${R} ${Ze}`:R,Ee=Z?{...C.style,...Ve(`var(${je})`)}:C.style,Te=r?r.length>0?e("div",{className:_e,style:Ee,children:r.map((s,a)=>G(s)==="tyre"?e(fr,{item:s,currency:A,editing:y,fieldUsage:Me},`tyre:${s.slug}-${a}`):e(Xe,{wheel:s,variant:"catalog"},`${s.slug}-${a}`))}):y?e("div",{className:"flex min-h-[320px] items-center justify-center rounded bg-surface-2 p-4 text-center",children:e("span",{className:`font-mono ${n.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:Nr("No products in “{name}” yet",{name:c?.name??""})})}):null:e(le,{className:R,style:C.style,minEmptyHeight:320}),S=r?r.length:null,V=Cr(ne(N)),Le=h||_||v||f?x("div",{className:`${wr} sticky top-[var(--sf-header-h,88px)] z-30 mb-5 flex items-center justify-between gap-4 max-[800px]:flex-wrap max-[800px]:gap-y-2 border-b border-line bg-bg/95 py-3 backdrop-blur-md ${W?"":"-mx-[var(--sf-site-gutter,40px)] px-[var(--sf-site-gutter,40px)] max-[800px]:-mx-[min(20px,var(--sf-site-gutter,40px))] max-[800px]:px-[min(20px,var(--sf-site-gutter,40px))]"}`,children:[x("div",{className:"flex min-w-0 items-end gap-6 max-[800px]:flex-col max-[800px]:items-stretch max-[800px]:gap-3",children:[h&&e("span",{className:`font-mono ${n.labelLarge} leading-none uppercase tracking-[0.22em] text-fg-dim`,children:D(h)}),_&&e("h2",{className:`${Er(ie)} leading-none text-fg max-[800px]:leading-[1] [&>span]:block`,children:ur(_,!1)})]}),(v||f||S!==null)&&x("div",{className:"flex items-center gap-5 max-[800px]:gap-3 min-[800px]:grow min-[800px]:justify-end",children:[v&&e("span",{className:`max-w-[340px] truncate font-display ${n.body} leading-[1.4] text-fg-dim max-[800px]:hidden min-[800px]:w-0 min-[800px]:grow min-[800px]:text-right`,children:D(v)}),f&&x(Ke,{href:f.href,className:`inline-flex items-center gap-2 whitespace-nowrap font-mono ${n.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-fg`,children:[D(f.text),e("span",{"aria-hidden":!0,children:"→"})]}),S!==null&&x("span",{className:`whitespace-nowrap font-mono ${n.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:[S," ",S===1?V.one:V.many]})]})]}):null,ze=typeof U=="number"?U:120,q=or(xe),$=d(()=>{if(!r)return null;const s=r.map(a=>G(a)!=="tyre"&&Qe(er(a))?2:1);return te(s,o)?ee(m,s,o):null},[r,m,o]),[Ie,Pe]=ke("");B(()=>{if(r)return;const s=document.querySelector(`.${t}`);if(!s)return;const a=()=>{const l=[...s.children].map(Re=>Re.classList.contains("col-span-2")?2:1);Pe(te(l,o)?re(t,ee(m,l,o,!1),l.length):"")};a();const O=new MutationObserver(a);return O.observe(s,{childList:!0}),()=>O.disconnect()},[r,t,m,o]);const Ae=$?$[0].tracks:r?j?Math.min(r.length,o):r.length:void 0,M=$?re(t,$,r.length):Ie,Y=M?"":Je(t,m,{limit:o,cards:r?.length}),J=nr(t,q),Q=x(He,{children:[j&&!M&&e("style",{children:`.${t} > *:nth-child(n+${o+1}){display:none}`}),M&&e("style",{children:M}),Y&&e("style",{children:Y}),J&&e("style",{children:J}),Le,Te,e(tr,{editing:y})]});if(F)return null;const H=e("section",{...u?{[cr]:T}:{},className:"relative z-[2] bg-bg px-[var(--sf-site-gutter,40px)] pt-[var(--pg-pt)] pb-[120px] max-[800px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[800px]:pt-[70px] max-[800px]:pb-[70px]",style:{"--pg-pt":`${ze}px`,...Ge(Se)},children:W?e("div",{style:lr(ir),children:Q}):Q}),Fe=i?H:y?e(mr,{children:H}):e(dr,{wheels:me,children:H});return e(qe,{imageSizes:Ye(m,Ae),imageBackgroundFill:De(ce,Be),spinOnHover:ge??!0,coverIndex:ue??ar,indexBadge:q,outline:he??sr,showBadge:fe??!0,fieldUsage:E,reserveEyebrow:Ne,showCardPrice:ye??!0,showCardFinishes:Ce??!0,showCardSizes:ve??k.showCardSizes,showCardBuy:be??k.showCardBuy,showCardPage:we??k.showCardPage,children:Fe})}export{ae as TITLE_SIZES,Tr as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as r,jsxs as t}from"react/jsx-runtime";import{PickerField as a}from"./PickerField.js";import{vehicleLevelStates as m}from"./vehicle-level-state.js";import{VEHICLE_FIELD_LABEL as n}from"../../lib/wheels/vehicle-field-focus.js";function p({cascade:e,compact:i=!1,editing:d=!1}){const{vehicle:o}=e,l=m(e),s=t("div",{className:["grid gap-[2px] border border-line bg-line",i?"grid-cols-1 @min-[20rem]:grid-cols-2 @min-[39rem]:grid-cols-4":"grid-cols-4 max-[1100px]:grid-cols-2 max-[700px]:grid-cols-1"].join(" "),children:[r(a,{label:n.make,placeholder:l.make.placeholder,disabled:l.make.disabled,value:o.make,options:e.makeOptions,onChange:e.setMake,compact:i,editing:d}),r(a,{label:n.model,placeholder:l.model.placeholder,disabled:l.model.disabled,value:o.model,options:e.modelOptions,onChange:e.setModel,compact:i,editing:d}),r(a,{label:n.year,placeholder:l.year.placeholder,disabled:l.year.disabled,value:o.year!==null?String(o.year):"",options:e.yearOptions,onChange:e.setYear,compact:i,editing:d}),r(a,{label:n.trim,placeholder:l.trim.placeholder,disabled:l.trim.disabled,value:o.modification,options:e.modOptions,onChange:e.setModification,compact:i,editing:d})]});return i?r("div",{className:"@container",children:s}):s}export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as a,jsxs as
|
|
1
|
+
"use client";import{jsx as a,jsxs as f}from"react/jsx-runtime";import g from"efficient-web-builder/render/components/PartStyledKind";import{ThemedSelectList as y,useThemedSelect as I}from"../ThemedSelect.js";import{PART_KIND_ATTR as u}from"efficient-web-builder/render/lib/puck/text-parts";import{TEXT_KIND_BODY as b,TEXT_KIND_NAME as h}from"efficient-web-builder/format/lib/sections/section-text-kinds";const n={body:"text-[length:var(--size-body,15px)]",headingSmall:"text-[length:var(--size-headingSmall,24px)]",labelXs:"text-[length:var(--size-label,10px)]",labelSmall:"text-[length:var(--size-label,11px)]",labelLarge:"text-[length:var(--size-label,12px)]",labelXl:"text-[length:var(--size-label,14px)]"};function T(o,l){return[{value:"",label:l??"—"},...o.map(i=>({value:i.value,label:i.label}))]}function z({label:o,value:l,options:i,onChange:v,placeholder:p,disabled:t,compact:s=!1,editing:d=!1}){const m=(i.find(r=>r.value===l)?.label??l)||p||"—",x=T(i,p),e=I({items:x,value:l,onPick:v}),c=e.open;return f("div",{ref:e.wrapRef,className:"relative min-w-0",children:[f("div",{ref:r=>{e.triggerRef.current=r},role:"button",tabIndex:t?-1:0,"aria-haspopup":"listbox","aria-expanded":c,"aria-controls":c?e.listId:void 0,"aria-activedescendant":e.activeId,"aria-label":o,"aria-disabled":t||void 0,onClick:()=>!t&&e.toggle(),onKeyDown:r=>!t&&e.onTriggerKeyDown(r),className:["relative flex h-full flex-col bg-bg transition-colors",s?"gap-1 px-3 py-3":"min-h-[160px] gap-4 px-6 py-8",t?"opacity-50":"cursor-pointer hover:bg-surface"].join(" "),children:[a("span",{...d?{[u]:h}:{},className:["font-mono uppercase text-accent",s?`${n.labelXs} tracking-[0.2em]`:`${n.labelLarge} tracking-[0.3em]`].join(" "),children:a(g,{kind:h,children:o})}),a("span",{title:m,className:["truncate font-display font-medium tracking-[-0.02em]",s?`${n.body} leading-[1.2]`:`mt-auto ${n.headingSmall} leading-[1.1]`,l?"text-fg":"text-fg-dim"].join(" "),...d?{[u]:b}:{},children:a(g,{kind:b,children:m})}),a("span",{className:["pointer-events-none absolute font-mono text-accent",s?`right-3 top-3 ${n.labelSmall}`:`right-[22px] top-[22px] ${n.labelXl}`].join(" "),children:"▾"})]}),c&&!t&&a(y,{id:e.listId,tone:"cell",items:x,value:l,focusIdx:e.focusIdx,onFocus:e.setFocusIdx,onPick:e.pick,listRef:e.listRef})]})}export{z as PickerField,T as pickerItems};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as
|
|
1
|
+
"use client";import{jsx as t,jsxs as G}from"react/jsx-runtime";import A from"efficient-web-builder/render/components/Btn";import k,{GALLERY_GRID_ATTR as L,GalleryLinksContext as M}from"../GalleryItem.js";import{SharedPartKinds as T}from"efficient-web-builder/render/components/PublishedPartStylesContext";import{renderHeadline as C}from"efficient-web-builder/render/components/goldPhrases";import H from"efficient-web-builder/render/components/SectionHeader";import I from"./KindGate.js";import{PLP_KINDS as B}from"../../lib/catalog/plp-item.js";import{useCurrentProduct as j}from"../../lib/puck/current-product.js";import{SAMPLE_PICTURE_COUNT as D,SAMPLE_RECORD as F,recordPictures as K,useCurrentRecord as U,useDrawsOtherRecord as Z}from"../../lib/puck/current-record.js";import{mediaGroupVehicle as $}from"../../lib/content/source-values.js";import{useSampleProduct as z}from"./useSampleProduct.js";import{say as _}from"efficient-web-builder/format/lib/editor-words";const V=B,P=["photos","lifestyle","accessories","others"];function W(e,a){if(!e)return[];if(a==="all")return P.flatMap(s=>e[s]??[]);const i=P.includes(a)?a:null;return i?e[i]??[]:[]}const R="relative z-[2] bg-bg py-[120px] max-[800px]:py-[70px]",E="relative z-[2] bg-bg pt-0 pb-[120px] max-[800px]:pt-0 max-[800px]:pb-[70px]",O="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] max-[800px]:px-[min(20px,var(--sf-site-gutter,40px))]";function X(e){return Z(!!e.editing)?t(Y,{...e}):t(I,{kinds:V,type:"GalleryB",editing:e.editing,children:t(q,{...e})})}function Y(e){const{editing:a=!1}=e,i=U(),s=i?K(i,{firstField:!0}).map(n=>({images:[n.url],eyebrow:n.alt&&n.alt!==i.title?n.alt:void 0})):a?Array.from({length:D},()=>({images:[""]})):[];return t(S,{...e,tiles:s,owner:{name:(i??F).title},photosOnly:!0,emptyHint:_("This record’s pictures appear here on its page. A record with no pictures draws nothing.")})}function q({omitHead:e=!1,num:a,title:i,linkText:s,linkHref:n,galleryHref:p="/gallery",submitHref:y="/contact",zone:v="all",photoDisplay:f="covers",previewHover:b,display:N,displayPhone:u,styleOwner:h,editing:c=!1}){const g=j(),x=z(c&&!g),o=g?.product??x,d=W(o?.mediaGroups,v).map(r=>({images:(r.items??[]).filter(m=>m.kind==="image").map(m=>m.url),vehicle:$(r),finish:r.finish})).filter(r=>r.images.length>0),l=(f==="auto"?d.length>=4?"covers":"all":f)==="all"?d.flatMap(r=>r.images.map(m=>({images:[m],vehicle:r.vehicle,finish:r.finish}))):d;return t(S,{omitHead:e,num:a,title:i,linkText:s,linkHref:n,galleryHref:p,submitHref:y,previewHover:b,display:N,displayPhone:u,styleOwner:h,editing:c,tiles:o?l.map(r=>({images:r.images,eyebrow:r.vehicle||void 0,meta:r.finish})):[],owner:{name:o?.name??"",href:o?.href,process:o?.eyebrow},emptyHint:_("This product’s photos appear here on a product page. Add media groups in the product’s Media tab.")})}function S({omitHead:e=!1,num:a,title:i,linkText:s,linkHref:n,galleryHref:p="/gallery",submitHref:y="/contact",previewHover:v,display:f,displayPhone:b,styleOwner:N,editing:u=!1,tiles:h,owner:c,emptyHint:g,photosOnly:x=!1}){const o=s?{text:s,href:n||"#"}:void 0,d=i?C(i,!1):void 0,w=e?null:t(H,{num:a,title:d,link:o});return h.length===0?u?t("section",{className:e?E:R,children:G("div",{className:O,children:[w,t("p",{className:"mt-8 border-t border-line py-6 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:g})]})}):null:t("section",{className:e?E:R,children:G("div",{className:O,children:[w,t(M.Provider,{value:{galleryHref:p,submitHref:y,previewHover:v,display:f,displayPhone:b,styleOwner:N,photosOnly:x},children:t(T,{children:t("div",{[L]:"",className:"grid grid-cols-4 gap-2 max-[1500px]:grid-cols-3 max-[800px]:grid-cols-1 max-[800px]:gap-1",children:h.map((l,r)=>t(k,{image:l.images[0],photos:l.images.slice(1).map(m=>({src:m})),href:c.href,process:c.process,eyebrow:l.eyebrow,name:c.name,meta:l.meta,editing:u},`${l.eyebrow}-${r}`))})})}),!x&&t("div",{className:"mt-12 flex flex-col items-center gap-3",children:t(A,{href:p,variant:"ghost",children:"See Gallery"})})]})})}export{X as default,V as supportedKinds};
|
|
@@ -28,8 +28,6 @@ export declare function resolveConsent({ asked, region, stored, gpc, }: {
|
|
|
28
28
|
stored: StoredChoice | null;
|
|
29
29
|
gpc: boolean;
|
|
30
30
|
}): ConsentState;
|
|
31
|
-
export declare function getConsent(): ConsentState;
|
|
32
31
|
export declare function setConsent(next: ConsentState): void;
|
|
33
|
-
export declare function subscribeConsent(listener: () => void): () => void;
|
|
34
32
|
export declare function adConsentForOrder(state?: ConsentState): "granted" | "denied" | undefined;
|
|
35
33
|
export declare function googleConsentMode(state: ConsentState): Record<"ad_storage" | "ad_user_data" | "ad_personalization" | "analytics_storage", "granted" | "denied">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{safeLocalStorage as
|
|
1
|
+
import{safeLocalStorage as s}from"efficient-web-builder/format/lib/safe-storage";import{CONSENT_RULES as c,CONSENT_RULES_VERSION as i}from"./rules.js";const l="sf:consent",d={asked:!1,region:"other",model:"opt-in",analytics:!0,ads:!0,chosen:!0,gpc:!1};function y(){const e=s.getItem(l);if(!e)return null;try{const t=JSON.parse(e);return t.v!==i||typeof t.analytics!="boolean"||typeof t.ads!="boolean"?null:{v:t.v,analytics:t.analytics,ads:t.ads,t:typeof t.t=="number"?t.t:0}}catch{return null}}function p(e,t=Date.now()){s.setItem(l,JSON.stringify({v:i,analytics:e.analytics,ads:e.ads,t}))}function S(){return typeof navigator>"u"?!1:navigator.globalPrivacyControl===!0}function _({asked:e,region:t,stored:o,gpc:a}){if(!e)return{...d,region:t,gpc:a};const r=c[t].model;return o?{asked:e,region:t,model:r,analytics:o.analytics,ads:o.ads&&!a,chosen:!0,gpc:a}:r==="opt-out"?{asked:e,region:t,model:r,analytics:!0,ads:!a,chosen:!1,gpc:a}:{asked:e,region:t,model:r,analytics:!1,ads:!1,chosen:!1,gpc:a}}let n=d;function g(e){e.asked===n.asked&&e.region===n.region&&e.analytics===n.analytics&&e.ads===n.ads&&e.chosen===n.chosen&&e.gpc===n.gpc||(n=e)}function m(e=n){if(e.asked)return e.ads?"granted":"denied"}function C(e){const t=e.ads?"granted":"denied";return{ad_storage:t,ad_user_data:t,ad_personalization:t,analytics_storage:e.analytics?"granted":"denied"}}export{l as CONSENT_STORAGE_KEY,d as NOT_ASKED,m as adConsentForOrder,S as browserSendsGpc,C as googleConsentMode,y as readStoredChoice,_ as resolveConsent,g as setConsent,p as writeStoredChoice};
|
|
@@ -33,7 +33,8 @@ export declare function bannerWords(rule: ConsentRule, brand: string, tags: Cons
|
|
|
33
33
|
export declare const PANEL_ROWS: {
|
|
34
34
|
readonly necessary: {
|
|
35
35
|
readonly name: "Necessary";
|
|
36
|
-
readonly body: "Cart, checkout, your country and currency, sign-in, and this choice. The
|
|
36
|
+
readonly body: "Cart, checkout, your country and currency, sign-in, and this choice. The site cannot work without them.";
|
|
37
|
+
readonly bodyNoSale: "What the site needs to work, such as remembering this choice. The site cannot work without them.";
|
|
37
38
|
};
|
|
38
39
|
readonly analytics: {
|
|
39
40
|
readonly name: "Analytics";
|
|
@@ -41,11 +42,11 @@ export declare const PANEL_ROWS: {
|
|
|
41
42
|
};
|
|
42
43
|
readonly ads: {
|
|
43
44
|
readonly body: "Google Ads and Meta (Facebook, Instagram) tags, and the order details we send to them to measure our ads.";
|
|
45
|
+
readonly bodyNoSale: "Google Ads and Meta (Facebook, Instagram) tags, which measure our ads.";
|
|
44
46
|
};
|
|
45
47
|
};
|
|
46
|
-
export declare const PANEL_HEADING = "Your privacy choices.";
|
|
47
48
|
export declare const GPC_HONOURED: {
|
|
48
|
-
readonly title: "Opt-out request
|
|
49
|
+
readonly title: "Opt-out request honoured";
|
|
49
50
|
readonly body: "Your browser sent a Global Privacy Control signal. We have turned off sale and sharing of your information for ads.";
|
|
50
51
|
};
|
|
51
52
|
export declare const CONSENT_BUTTONS: {
|