efficient-storefront-blocks 0.94.0 → 0.95.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 +24 -0
- package/README.md +1 -0
- package/dist/chunks/{EditorPreviewCheckout-OPDSFBJH.js → EditorPreviewCheckout-3F3CP5MR.js} +1 -1
- package/dist/chunks/{SiteEditorProvider-ZP6NAWYT.js → SiteEditorProvider-HN7TFLUJ.js} +1 -1
- package/dist/chunks/chunk-7SMQDDLZ.js +1 -0
- package/dist/chunks/{chunk-ATCBSW73.js → chunk-CYLLSHDF.js} +1 -1
- package/dist/chunks/chunk-SUKEQRMP.js +389 -0
- package/dist/chunks/{chunk-CEFKTE5A.js → chunk-WLMM7L6N.js} +1 -1
- package/dist/chunks/{fitment-data-IPAMN5IH.js → fitment-data-Z62WUQGC.js} +1 -1
- package/dist/editor/lib/document/blocks/commerce/AlloyWheelsListing/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/AppointmentBooking/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/BookingBox/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/ContactRouting/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/index.d.ts +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +1 -1
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.js +33 -33
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/AppointmentBooking.d.ts +3 -1
- package/dist/render/components/AppointmentBooking.js +1 -1
- package/dist/render/components/ContactRouting.d.ts +9 -1
- package/dist/render/components/ContactRouting.js +1 -1
- package/dist/render/components/CountrySelect.js +1 -1
- package/dist/render/components/FooterMenu.js +1 -1
- package/dist/render/components/MenuLinkBlock.js +1 -1
- package/dist/render/components/SpecTable.js +1 -1
- package/dist/render/components/booking/BookingBox.d.ts +5 -1
- package/dist/render/components/booking/BookingBox.js +1 -1
- package/dist/render/components/booking/BookingFormState.d.ts +9 -0
- package/dist/render/components/booking/BookingFormState.js +1 -1
- package/dist/render/components/booking/BookingRegions.d.ts +9 -1
- package/dist/render/components/booking/BookingRegions.js +1 -1
- package/dist/render/components/card-ground-cell.d.ts +2 -0
- package/dist/render/components/card-ground-cell.js +1 -0
- package/dist/render/components/wheels-plp/AlloyWheelsListing.d.ts +2 -1
- package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
- package/dist/render/components/wheels-plp/PlpFacetRows.d.ts +14 -0
- package/dist/render/components/wheels-plp/PlpFacetRows.js +1 -0
- package/dist/render/components/wheels-plp/PlpSidebar.d.ts +7 -1
- package/dist/render/components/wheels-plp/PlpSidebar.js +1 -1
- package/dist/render/components/wheels-plp/PlpTypePicker.d.ts +8 -2
- package/dist/render/components/wheels-plp/PlpTypePicker.js +1 -1
- package/dist/render/lib/booking/appointment-time.d.ts +1 -0
- package/dist/render/lib/booking/appointment-time.js +1 -1
- package/dist/render/lib/content/booking-card-seed.d.ts +31 -0
- package/dist/render/lib/content/booking-card-seed.js +1 -0
- package/dist/render/lib/content/contact-card-seed.d.ts +11 -0
- package/dist/render/lib/content/contact-card-seed.js +1 -0
- package/dist/render/lib/content/copy-mark.d.ts +1 -0
- package/dist/render/lib/content/copy-mark.js +1 -0
- package/dist/render/lib/content/facet-row-seed.d.ts +139 -0
- package/dist/render/lib/content/facet-row-seed.js +1 -0
- package/dist/render/lib/content/tab-strip.d.ts +3 -2
- package/dist/render/lib/content/tab-strip.js +1 -1
- package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/meta.d.ts +4 -0
- package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/render.js +1 -1
- package/dist/render/lib/document/blocks/service/AppointmentBooking/meta.d.ts +8 -0
- package/dist/render/lib/document/blocks/service/AppointmentBooking/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/AppointmentBooking/render.js +1 -1
- package/dist/render/lib/document/blocks/service/BookingBox/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/BookingBox/render.js +1 -1
- package/dist/render/lib/document/blocks/service/ContactRouting/meta.d.ts +14 -0
- package/dist/render/lib/document/blocks/service/ContactRouting/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/ContactRouting/render.js +1 -1
- package/dist/render/lib/document/card-templates.js +1 -1
- package/dist/render/lib/document/storefront-root.js +1 -1
- package/dist/render/lib/menu-link.d.ts +1 -0
- package/dist/render/lib/menu-link.js +1 -1
- package/dist/render/lib/sections/filter-option-rows.d.ts +5 -4
- package/dist/render/lib/sections/filter-option-rows.js +1 -1
- package/dist/render/lib/wheels/plp-filters.d.ts +4 -0
- package/dist/render/lib/wheels/plp-filters.js +1 -1
- package/dist/words.d.ts +12 -1
- package/dist/words.js +4 -4
- package/package.json +2 -2
- package/dist/chunks/chunk-JKJ76CRT.js +0 -388
- package/dist/chunks/chunk-JTDOMQMQ.js +0 -1
- /package/dist/chunks/{chunk-LRLOANKA.js → chunk-GW5M2ATK.js} +0 -0
- /package/dist/chunks/{chunk-JKJ76CRT.js.LEGAL.txt → chunk-SUKEQRMP.js.LEGAL.txt} +0 -0
|
@@ -9,7 +9,9 @@ export interface AppointmentBookingProps {
|
|
|
9
9
|
boxes?: SlotComponent;
|
|
10
10
|
inBoxes?: boolean;
|
|
11
11
|
nodeId?: string;
|
|
12
|
+
serviceTemplate?: SlotComponent;
|
|
13
|
+
timeTemplate?: SlotComponent;
|
|
12
14
|
omitHead?: boolean;
|
|
13
15
|
}
|
|
14
16
|
export default function AppointmentBooking(props?: AppointmentBookingProps): import("react").JSX.Element;
|
|
15
|
-
export declare function AppointmentBookingBody({ eyebrow, heading, intro, buttonLabel, successMessage, boxes: Boxes, inBoxes, omitHead, }: AppointmentBookingProps): import("react").JSX.Element;
|
|
17
|
+
export declare function AppointmentBookingBody({ eyebrow, heading, intro, buttonLabel, successMessage, boxes: Boxes, inBoxes, omitHead, nodeId, serviceTemplate, timeTemplate, }: AppointmentBookingProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import{BookingFormProvider as
|
|
1
|
+
"use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import{BookingFormProvider as y,useBookingForm as A}from"./booking/BookingFormState.js";import{useBookingPreview as C}from"efficient-web-builder/render/lib/document/booking-preview";import{say as o}from"efficient-web-builder/format/lib/editor-words";import{BookingChoose as _,BookingConfirmed as D,BookingDetails as I,BookingHead as L}from"./booking/BookingRegions.js";import{HideTaker as u}from"efficient-web-builder/render/components/ViewHideRoot";import P from"./SectionBand.js";function j(t={}){const n=C();return e(y,{editing:t.editing,previewConfirmation:!!t.nodeId&&n===t.nodeId,children:e(z,{...t})})}const m="mx-auto max-w-[var(--sf-site-width,1600px)] px-[min(24px,var(--sf-site-gutter,40px))] py-16 view-wide:px-[var(--sf-site-gutter,40px)] view-wide:py-[88px]",c="grid gap-8 min-[960px]:grid-cols-[minmax(0,1fr)_minmax(360px,0.8fr)] min-[960px]:gap-12";function z({eyebrow:t,heading:n,intro:x,buttonLabel:v,successMessage:b,boxes:r,inBoxes:h=!1,omitHead:l=!1,nodeId:S="AppointmentBooking",serviceTemplate:k,timeTemplate:B}){const{fieldPrefix:T,editing:N,services:d,currency:E,serviceId:F,setServiceId:M,requiresPayment:R,date:$,earliestDate:q,setDate:G,setDateTouched:H,availability:O,loadingSlots:J,noSlotsMessage:K,selectedStart:Q,setSelectedStart:U,customerTimezone:V,name:W,setName:X,email:Y,setEmail:Z,phone:ee,setPhone:te,notes:ie,setNotes:oe,confirmation:p,submitting:ne,error:re,canSubmit:ae,handleSubmit:g,sample:w}=A(),a=w?e("p",{className:"mb-6 font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",role:"status",children:o("Example form — add an active service in {place}.",{place:o("Storefront → Booking Services")})}):null,s=d===void 0?e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading appointments…"}):d?.length===0?e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",role:"status",children:N?o("Add an active service in {place}.",{place:o("Storefront → Booking Services")}):"Appointments are not available right now."}):null;if(h&&r&&!l)return e(u,{as:"section",className:"relative z-[2] border-t border-line bg-surface",children:i("div",{className:m,children:[a,p?e(r,{className:`${c} items-start`}):i("form",{onSubmit:g,children:[e(r,{className:`${c} items-start`}),s]})]})});const f=p?e(D,{successMessage:b}):s||i("form",{onSubmit:g,className:c,children:[e(_,{owner:{id:S,type:"AppointmentBooking",serviceTemplate:k,timeTemplate:B}}),e(I,{buttonLabel:v})]});return l?i(P,{className:"relative z-[2] border-t border-line bg-surface",column:m,children:[a,f]}):e(u,{as:"section",className:"relative z-[2] border-t border-line bg-surface",children:i("div",{className:m,children:[a,e(L,{eyebrow:t,heading:n,intro:x}),f]})})}export{z as AppointmentBookingBody,j as default};
|
|
@@ -1,6 +1,7 @@
|
|
|
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
|
+
import type { SlotComponent } from "efficient-easel/blocks";
|
|
4
5
|
export declare const CHANNEL_HINTS: {
|
|
5
6
|
readonly label: "Label";
|
|
6
7
|
readonly value: "Value";
|
|
@@ -38,7 +39,14 @@ export interface ContactRoutingProps {
|
|
|
38
39
|
onActiveChange?: (id: string) => void;
|
|
39
40
|
reasonExtras?: (activeId: string) => ReactNode;
|
|
40
41
|
omitHead?: boolean;
|
|
42
|
+
templates?: ContactRoutingTemplates;
|
|
43
|
+
}
|
|
44
|
+
export interface ContactRoutingTemplates {
|
|
45
|
+
ownerId: string;
|
|
46
|
+
topic?: SlotComponent;
|
|
47
|
+
reason?: SlotComponent;
|
|
48
|
+
channel?: SlotComponent;
|
|
41
49
|
}
|
|
42
50
|
export declare const fieldClass: string;
|
|
43
|
-
export default function ContactRouting({ routingNumber, routingTagline, groups, formNumber, formHeading, metaLines, showOther, otherLabel, otherNoteTitle, otherNoteBody, buttonText, consent, channels, formSlug, form: injectedForm, editing, initialActiveId, onActiveChange, reasonExtras, omitHead, }: ContactRoutingProps): import("react").JSX.Element;
|
|
51
|
+
export default function ContactRouting({ routingNumber, routingTagline, groups, formNumber, formHeading, metaLines, showOther, otherLabel, otherNoteTitle, otherNoteBody, buttonText, consent, channels, formSlug, form: injectedForm, editing, initialActiveId, onActiveChange, reasonExtras, omitHead, templates, }: ContactRoutingProps): import("react").JSX.Element;
|
|
44
52
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as n,jsxs as s,Fragment as le}from"react/jsx-runtime";import se from"./SectionBand.js";import{HideTaker as ie,usePeekViewHide as ce,useTakeViewHide as de,withViewHide as pe}from"efficient-web-builder/render/components/ViewHideRoot";import{useEffect as H,useState as W}from"react";import{useRootIsDark as me}from"efficient-shell/theme";import{OTHER_REASON_ID as h}from"efficient-web-builder/format/lib/content/contact";import{FormFieldInput as fe,FormHoneypot as ue,successMessageFor as be,useBoundForm as xe,useFormSubmission as ge}from"./formSubmission.js";import he from"efficient-web-builder/render/components/SectionEyebrow";import{useSectionEdge as ve}from"efficient-web-builder/render/components/SiteGutterFrame";import{sectionEdgeBandAttrs as ye}from"efficient-web-builder/render/lib/content/section-edge";import ke,{FieldCaption as we}from"./WebFormField.js";import{scrollBehavior as Ne}from"efficient-web-builder/render/components/useReducedMotion";import{renderChrome as G,renderGold as $,renderHeadline as Se,splitParagraphs as $e}from"efficient-web-builder/render/components/goldPhrases";import{say as C}from"efficient-web-builder/format/lib/editor-words";import{phoneHref as Ce}from"efficient-web-builder/format/lib/links/phone-href";import{PART_ROW_ATTR as je,encodePartRow as Fe}from"efficient-web-builder/render/lib/document/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)]",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 Re(i,r){return i.map((o,a)=>r?{...o,at:a,label:o.label||C(M.label),value:o.value||C(M.value),sub:o.sub||C(M.sub)}:{...o,at:a}).filter(o=>!o.hidden)}function U(i,r){return r?{[je]:Fe("channels",i.at)}:{}}function Z(i){if(i.href)return i.href;const r=(i.value??"").trim();if(r.includes("@"))return`mailto:${r}`;if(/^\+?[\d\s().-]{6,}$/.test(r))return Ce(r)}function ze(i){const r=[],o=new Map;for(const a of i){if(!a.groupId){r.push(a);continue}const m=a.value.trim().toLowerCase(),b=o.get(m);if(b)b.label=`${b.label} · ${a.label}`;else{const x={...a};o.set(m,x),r.push(x)}}return r}function Ee(i,r,o){const a=m=>String(m??"").trim().toLowerCase();for(const m of i?.fields??[]){if(m.type!=="select"||!Array.isArray(m.options))continue;const b=m.options.map(String);if(!r.some(c=>b.some(f=>a(f)===a(c.title))))continue;const x=c=>a(c===h?o:r.find(f=>f.id===c)?.title);return{key:m.key,optionFor:c=>b.find(f=>a(f)===x(c)&&x(c)!==""),idFor:c=>{const f=r.find(S=>a(S.title)===a(c));return f?f.id:o&&a(c)===a(o)?h:void 0}}}return null}const J=`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 Ie({routingNumber:i,routingTagline:r,groups:o,formNumber:a,formHeading:m,metaLines:b,showOther:x=!0,otherLabel:c="Other",otherNoteTitle:f,otherNoteBody:S,buttonText:O,consent:P,channels:K,formSlug:V,form:Q,editing:v,initialActiveId:y,onActiveChange:L,reasonExtras:Y,omitHead:j=!1}){const w=[...o.map(e=>e.id),...x?[h]:[]],ee=y&&w.includes(y)?y:w[0]??h,[g,F]=W(ee);H(()=>{w.includes(g)||F(w[0]??h)},[w.join("|")]),H(()=>{y&&w.includes(y)&&F(y)},[y]);const k=xe(V,Q),d=ge({form:k,formSlug:V,editing:v}),u=Ee(k,o,x?c:void 0),E=e=>{F(e),I(null);const l=u?.optionFor(e);u&&l!==void 0&&d.set(u.key,l),L?.(e)};H(()=>{if(!u||d.valueOf(u.key))return;const e=u.optionFor(g);e!==void 0&&d.set(u.key,e)},[u?.key]);const[T,I]=W(null),N=Re(K??[],!!v),ne=e=>T!==null?!e.groupId&&e.value===T:e.groupId===g,te=k===void 0,_=!!k||!!v,ae=!me({whenUnset:!0}),q=ve(),R=j&&q?ye(q):null,A=R?`${R.className} `:"",B=o.length>0||!!v,X=n("div",{className:"sf-card grid grid-cols-4 gap-[2px] border border-line bg-line max-view-desktop:grid-cols-2 max-[700px]:grid-cols-1",children:o.map(e=>{const l=g===e.id;return s("button",{type:"button",onClick:()=>{E(e.id),typeof window<"u"&&window.matchMedia("(max-width: 1100px)").matches&&document.getElementById("contact-form")?.scrollIntoView({behavior:Ne(),block:"start"})},className:["flex min-h-[240px] cursor-pointer flex-col gap-4 px-8 py-10 text-left transition-colors",l?"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)})}),re=ce(),D=de();return s(le,{children:[B&&(j?n(ie,{as:"section",className:`${A}border-b border-line bg-surface pt-6 pb-[60px]`,style:R?.style,children:X}):s(se,{className:"border-b border-line py-[60px]",style:ae?void 0:{background:"var(--section-bg)"},children:[(i||r)&&s("div",{className:"mb-6 flex items-center gap-6 border-b border-line pb-6",children:[i&&n(he,{text:i}),r&&n("span",{className:`font-display ${t.bodySmall} uppercase tracking-[0.04em] text-fg-dim`,children:$(r)})]}),X]})),(_||N.length>0)&&D.scope(n("section",{id:"contact-form",className:pe(`${A}${j?"bg-bg ":""}scroll-mt-[80px] border-b border-line py-20 max-view-desktop:py-[60px]`,re),style:R?.style,...B?{}:D.attrs,children:s("div",{className:[j?"grid gap-20 max-view-desktop:grid-cols-1 max-view-desktop:gap-[60px]":"mx-auto grid max-w-[var(--sf-site-width,1600px)] gap-20 px-[var(--sf-site-gutter,40px)] max-view-desktop:grid-cols-1 max-view-desktop:gap-[60px] max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))]",_&&N.length>0?"grid-cols-[1.3fr_1fr]":"grid-cols-1"].join(" "),children:[_&&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:$(a)}),m&&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(m,!0)})]}),!!(b&&b.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:b.map((e,l)=>n("div",{children:e},l))})]}),k?d.done?n("div",{className:`border border-accent bg-accent/[0.08] p-8 font-display ${t.body} leading-[1.6] text-fg-dim`,children:be(k,"Thanks — we've received your message.")}):s("form",{className:"grid grid-cols-2 gap-5 max-[700px]:grid-cols-1",onSubmit:d.handleSubmit,children:[k.fields.map(e=>n(ke,{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(fe,{field:e,value:d.valueOf(e.key),onChange:l=>{d.set(e.key,l);const p=u&&e.key===u.key?u.idFor(l):void 0;p!==void 0&&(F(p),I(null),L?.(p))},className:e.type==="textarea"?`${J} min-h-[140px] resize-y leading-[1.5]`:e.type==="checkbox"?"size-4 self-start accent-accent":J})},e.key)),s("div",{className:"col-span-2 flex flex-col gap-2 max-[700px]:col-span-1",children:[n(we,{required:!0,children:"Reason"}),s("div",{className:"mt-1 flex flex-wrap gap-2",children:[o.map(e=>{const l=g===e.id;return n("button",{type:"button",onClick:()=>E(e.id),className:[`cursor-pointer border px-4 py-3 font-mono ${t.labelSmall} uppercase tracking-[0.2em] transition-colors`,l?"border-accent bg-accent text-bg":"border-line text-fg-dim hover:text-fg"].join(" "),children:e.title},e.id)}),x&&n("button",{type:"button",onClick:()=>E(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:G(c)})]})]}),Y?.(g),g===h&&(f||S)&&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:$(f)}),S&&$e(S).map((e,l)=>n("p",{className:`font-display ${t.body} leading-[1.55] text-fg-dim`,children:$(e)},l))]}),n(ue,{value:d.honeypot,onChange:d.setHoneypot}),d.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:d.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:[P&&n("span",{className:`max-w-[380px] font-mono ${t.labelSmall} uppercase leading-[1.6] tracking-[0.18em] text-fg-dim`,children:$(P)}),n("button",{type:v?"button":"submit",disabled:d.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:d.submitting?"Sending…":O?G(O):"Send Message →"})]})]}):n("p",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.22em] text-fg-dim`,children:te?C("Loading form…"):C("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-view-desktop:hidden",children:N.map((e,l)=>{const p=ne(e),z=!!!e.groupId;return s("div",{...U(e,v),onClick:z?()=>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",z?"cursor-pointer border-t-2 border-t-accent":"",p?"border-l-accent pl-6":z?"border-l-transparent hover:bg-accent/[0.04]":"border-l-transparent"].join(" "),style:p?{background:"color-mix(in oklab, var(--accent) 8%, transparent)"}:void 0,children:[n("span",{className:[`font-mono ${t.labelSmall} uppercase tracking-[0.3em] transition-colors`,p?"text-fg":"text-accent"].join(" "),children:e.label}),z?n("a",{href:e.href,onClick:oe=>oe.stopPropagation(),className:[`font-heading3 ${t.headingSmall1} font-medium leading-[1.2] tracking-[-0.02em] transition-colors hover:text-accent`,p?"text-accent":"text-fg"].join(" "),children:e.value}):n("a",{href:Z(e),className:[`font-heading3 ${t.headingSmall1} font-medium leading-[1.2] tracking-[-0.02em]`,p?"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}-${l}`)})}),N.length>0&&n("div",{"data-contact-phone-list":!0,className:"hidden flex-col gap-0 max-view-desktop:flex",children:ze(N).map((e,l)=>{const p=!!e.groupId;return s("div",{...U(e,v),className:["flex flex-col gap-3 border-b border-line px-5 py-5",p?"":"border-t-2 border-t-accent"].join(" "),children:[n("span",{className:[`font-mono ${t.labelSmall} uppercase tracking-[0.3em]`,p?"text-fg":"text-accent"].join(" "),children:e.label}),n("a",{href:Z(e),className:[`font-heading3 ${t.headingSmall1} font-medium leading-[1.2] tracking-[-0.02em] [overflow-wrap:anywhere]`,p?"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}-${l}`)})})]})}))]})}export{M as CHANNEL_HINTS,Z as channelHref,Ie as default,Re as drawnChannels,J as fieldClass,ze as mergeChannelsForPhone,Ee as topicFieldOf};
|
|
1
|
+
"use client";import{jsx as n,jsxs as m,Fragment as ce}from"react/jsx-runtime";import pe from"./SectionBand.js";import{HideTaker as me,usePeekViewHide as ue,useTakeViewHide as fe,withViewHide as be}from"efficient-web-builder/render/components/ViewHideRoot";import{useEffect as L,useState as J}from"react";import{useRootIsDark as xe}from"efficient-shell/theme";import{OTHER_REASON_ID as k}from"efficient-web-builder/format/lib/content/contact";import{FormFieldInput as he,FormHoneypot as ge,successMessageFor as ye,useBoundForm as ve,useFormSubmission as we}from"./formSubmission.js";import ke from"efficient-web-builder/render/components/SectionEyebrow";import{InsideSiteColumn as R,useSectionEdge as Ce}from"efficient-web-builder/render/components/SiteGutterFrame";import{sectionEdgeBandAttrs as Ne}from"efficient-web-builder/render/lib/content/section-edge";import Se,{FieldCaption as Te}from"./WebFormField.js";import{scrollBehavior as Ie}from"efficient-web-builder/render/components/useReducedMotion";import{renderChrome as $e,renderGold as S,renderHeadline as Fe,splitParagraphs as Re}from"efficient-web-builder/render/components/goldPhrases";import{say as T}from"efficient-web-builder/format/lib/editor-words";import{phoneHref as _e}from"efficient-web-builder/format/lib/links/phone-href";import{PART_ROW_ATTR as Oe,encodePartRow as Ee}from"efficient-web-builder/render/lib/document/text-parts";import{CardTemplateRows as _}from"efficient-web-builder/render/components/CardRowContext";import{cardRow as O}from"efficient-web-builder/format/lib/content/card-template";import{CONTACT_CHANNEL_SLOT as K,CONTACT_REASON_SLOT as Ae,CONTACT_TOPIC_SLOT as ze}from"../lib/content/contact-card-seed.js";import{groundCell as He}from"./card-ground-cell.js";const u={bodySmall:"text-[length:var(--size-body,14px)]",body:"text-[length:var(--size-body,15px)]",bodyLarge:"text-[length:var(--size-body,18px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]",labelXl:"text-[length:var(--size-label,14px)]"},j={label:"Label",value:"Value",sub:"Sub line"};function Le(l,o){return l.map((t,r)=>o?{...t,at:r,label:t.label||T(j.label),value:t.value||T(j.value),sub:t.sub||T(j.sub)}:{...t,at:r}).filter(t=>!t.hidden)}function Q(l,o){return o?{[Oe]:Ee("channels",l.at)}:{}}function Y(l){if(l.href)return l.href;const o=(l.value??"").trim();if(o.includes("@"))return`mailto:${o}`;if(/^\+?[\d\s().-]{6,}$/.test(o))return _e(o)}function je(l){const o=[],t=new Map;for(const r of l){if(!r.groupId){o.push(r);continue}const d=r.value.trim().toLowerCase(),f=t.get(d);if(f)f.label=`${f.label} · ${r.label}`;else{const h={...r};t.set(d,h),o.push(h)}}return o}function Me(l,o,t){const r=d=>String(d??"").trim().toLowerCase();for(const d of l?.fields??[]){if(d.type!=="select"||!Array.isArray(d.options))continue;const f=d.options.map(String);if(!o.some(s=>f.some(c=>r(c)===r(s.title))))continue;const h=s=>r(s===k?t:o.find(c=>c.id===s)?.title);return{key:d.key,optionFor:s=>f.find(c=>r(c)===h(s)&&h(s)!==""),idFor:s=>{const c=o.find(N=>r(N.title)===r(s));return c?c.id:t&&r(s)===r(t)?k:void 0}}}return null}const ee=`border-b border-line bg-transparent py-4 font-display ${u.bodyLarge} tracking-[0.01em] text-fg outline-none transition-colors focus:border-accent`;function Pe({routingNumber:l,routingTagline:o,groups:t,formNumber:r,formHeading:d,metaLines:f,showOther:h=!0,otherLabel:s="Other",otherNoteTitle:c,otherNoteBody:N,buttonText:M,consent:P,channels:ne,formSlug:V,form:te,editing:b,initialActiveId:y,onActiveChange:q,reasonExtras:re,omitHead:I=!1,templates:g}){const C=[...t.map(e=>e.id),...h?[k]:[]],oe=y&&C.includes(y)?y:C[0]??k,[v,$]=J(oe);L(()=>{C.includes(v)||$(C[0]??k)},[C.join("|")]),L(()=>{y&&C.includes(y)&&$(y)},[y]);const w=ve(V,te),i=we({form:w,formSlug:V,editing:b}),p=Me(w,t,h?s:void 0),B=e=>{$(e),E(null);const a=p?.optionFor(e);p&&a!==void 0&&i.set(p.key,a),q?.(e)};L(()=>{if(!p||i.valueOf(p.key))return;const e=p.optionFor(v);e!==void 0&&i.set(p.key,e)},[p?.key]);const[X,E]=J(null),x=Le(ne??[],!!b),ae=e=>X!==null?!e.groupId&&e.value===X:e.groupId===v,le=w===void 0,A=!!w||!!b,se=!xe({whenUnset:!0}),D=Ce(),F=I&&D?Ne(D):null,W=F?`${F.className} `:"",G=t.length>0||!!b,ie=e=>{B(e),typeof window<"u"&&window.matchMedia("(max-width: 1100px)").matches&&document.getElementById("contact-form")?.scrollIntoView({behavior:Ie(),block:"start"})},U=n("div",{className:"sf-card grid grid-cols-4 gap-[2px] border border-line bg-line max-view-desktop:grid-cols-2 max-[700px]:grid-cols-1",children:n(R,{children:n(_,{ownerId:g?.ownerId??"",ownerType:"ContactRouting",slot:ze,Template:g?.topic,rows:t.map(O),items:t,states:t.map(e=>({selected:v===e.id})),actions:b?void 0:t.map(e=>({press:()=>ie(e.id)})),fallback:null,wrapCopy:He,children:e=>e})})}),z=[...t.map(e=>({id:e.id,title:e.title})),...h?[{id:k,title:s}]:[]],de=ue(),Z=fe();return m(ce,{children:[G&&(I?n(me,{as:"section",className:`${W}border-b border-line bg-surface pt-6 pb-[60px]`,style:F?.style,children:U}):m(pe,{className:"border-b border-line py-[60px]",style:se?void 0:{background:"var(--section-bg)"},children:[(l||o)&&m("div",{className:"mb-6 flex items-center gap-6 border-b border-line pb-6",children:[l&&n(ke,{text:l}),o&&n("span",{className:`font-display ${u.bodySmall} uppercase tracking-[0.04em] text-fg-dim`,children:S(o)})]}),U]})),(A||x.length>0)&&Z.scope(n("section",{id:"contact-form",className:be(`${W}${I?"bg-bg ":""}scroll-mt-[80px] border-b border-line py-20 max-view-desktop:py-[60px]`,de),style:F?.style,...G?{}:Z.attrs,children:m("div",{className:[I?"grid gap-20 max-view-desktop:grid-cols-1 max-view-desktop:gap-[60px]":"mx-auto grid max-w-[var(--sf-site-width,1600px)] gap-20 px-[var(--sf-site-gutter,40px)] max-view-desktop:grid-cols-1 max-view-desktop:gap-[60px] max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))]",A&&x.length>0?"grid-cols-[1.3fr_1fr]":"grid-cols-1"].join(" "),children:[A&&m("div",{children:[m("div",{className:"mb-8 flex items-end justify-between gap-6 border-b border-line pb-6",children:[m("div",{children:[r&&n("div",{className:`pb-2 font-mono ${u.labelLarge} uppercase tracking-[0.3em] text-accent`,children:S(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:Fe(d,!0)})]}),!!(f&&f.length)&&n("div",{className:`text-right font-mono ${u.labelSmall} uppercase leading-[1.8] tracking-[0.22em] text-fg-dim max-[700px]:text-left`,children:f.map((e,a)=>n("div",{children:e},a))})]}),w?i.done?n("div",{className:`border border-accent bg-accent/[0.08] p-8 font-display ${u.body} leading-[1.6] text-fg-dim`,children:ye(w,"Thanks — we've received your message.")}):m("form",{className:"grid grid-cols-2 gap-5 max-[700px]:grid-cols-1",onSubmit:i.handleSubmit,children:[w.fields.map(e=>n(Se,{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(he,{field:e,value:i.valueOf(e.key),onChange:a=>{i.set(e.key,a);const H=p&&e.key===p.key?p.idFor(a):void 0;H!==void 0&&($(H),E(null),q?.(H))},className:e.type==="textarea"?`${ee} min-h-[140px] resize-y leading-[1.5]`:e.type==="checkbox"?"size-4 self-start accent-accent":ee})},e.key)),m("div",{className:"col-span-2 flex flex-col gap-2 max-[700px]:col-span-1",children:[n(Te,{required:!0,children:"Reason"}),n("div",{className:"mt-1 flex flex-wrap gap-2",children:n(R,{children:n(_,{ownerId:g?.ownerId??"",ownerType:"ContactRouting",slot:Ae,Template:g?.reason,rows:z.map(e=>O({title:e.title})),states:z.map(e=>({selected:v===e.id})),actions:b?void 0:z.map(e=>({press:()=>B(e.id)})),fallback:null,children:e=>e})})})]}),re?.(v),v===k&&(c||N)&&m("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:[c&&n("span",{className:`font-mono ${u.labelSmall} uppercase tracking-[0.24em] text-accent`,children:S(c)}),N&&Re(N).map((e,a)=>n("p",{className:`font-display ${u.body} leading-[1.55] text-fg-dim`,children:S(e)},a))]}),n(ge,{value:i.honeypot,onChange:i.setHoneypot}),i.error&&n("p",{role:"alert",className:`col-span-2 font-mono ${u.labelSmall} uppercase tracking-[0.18em] text-alert max-[700px]:col-span-1`,children:i.error}),m("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:[P&&n("span",{className:`max-w-[380px] font-mono ${u.labelSmall} uppercase leading-[1.6] tracking-[0.18em] text-fg-dim`,children:S(P)}),n("button",{type:b?"button":"submit",disabled:i.submitting,className:`cursor-pointer bg-btn px-8 py-5 font-mono ${u.labelXl} uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg disabled:cursor-wait disabled:opacity-60 max-[700px]:w-full`,children:i.submitting?"Sending…":M?$e(M):"Send Message →"})]})]}):n("p",{className:`font-mono ${u.labelSmall} uppercase tracking-[0.22em] text-fg-dim`,children:le?T("Loading form…"):T("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.")})]}),x.length>0&&n("aside",{className:"flex flex-col gap-0 max-view-desktop:hidden",children:n(R,{children:n(_,{ownerId:g?.ownerId??"",ownerType:"ContactRouting",slot:K,Template:g?.channel,rows:x.map(e=>O({label:e.label,value:e.value,sub:e.sub??"",href:Y(e)??""})),items:x,states:x.map(e=>({selected:ae(e)})),copyAttrs:({index:e})=>Q(x[e],b),actions:b?void 0:x.map(e=>e.groupId?{press:()=>{},disabled:!0}:{press:()=>E(e.value)}),fallback:null,children:e=>e})})}),x.length>0&&(()=>{const e=je(x);return n("div",{"data-contact-phone-list":!0,className:"hidden flex-col gap-0 max-view-desktop:flex",children:n(R,{children:n(_,{ownerId:g?.ownerId??"",ownerType:"ContactRouting",slot:K,Template:g?.channel,rows:e.map(a=>O({label:a.label,value:a.value,sub:a.sub??"",href:Y(a)??""})),items:e,copyAttrs:({index:a})=>Q(e[a],b),fallback:null,children:a=>a})})})})()]})}))]})}export{j as CHANNEL_HINTS,Y as channelHref,Pe as default,Le as drawnChannels,ee as fieldClass,je as mergeChannelsForPhone,Me as topicFieldOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as n,Fragment as
|
|
1
|
+
"use client";import{jsx as n,Fragment as f,jsxs as l}from"react/jsx-runtime";import{ThemedSelectList as I,useThemedSelect as S}from"./ThemedSelect.js";import{useCurrency as y}from"./CurrencyContext.js";import{countryName as k}from"../lib/countries.js";import{regionSwitchHref as v}from"../lib/menu-link.js";import{FlagAuIcon as N,FlagCaIcon as _,FlagEuIcon as R,FlagGbIcon as A,FlagNzIcon as U,FlagUsIcon as T,GlobeIcon as j}from"efficient-shell/icons/efficient";import{COUNTRY_SHOW_AS_DEFAULT as E,countryShowAsHasFlag as G}from"../lib/content/country-show-as.js";const x={US:T,CA:_,AU:N,NZ:U,GB:A,EU:R};function b({code:c,width:e}){const a=x[c];return a?n("span",{"aria-hidden":!0,className:"inline-flex shrink-0 border border-line",children:n(a,{size:e})}):null}function H(c,e){const a=n(b,{code:e.code,width:18});switch(c){case"code_currency":return e.currency?l(f,{children:[n("span",{children:e.code}),n("span",{"aria-hidden":!0,className:"opacity-50",children:"·"}),n("span",{children:e.currency})]}):n("span",{children:e.code});case"globe_code":return l(f,{children:[n(j,{size:14,className:"shrink-0"}),n("span",{children:e.code})]});case"currency":return n("span",{children:e.currency??e.code});case"flag_code":return l(f,{children:[a,n("span",{children:e.code})]});case"flag":return x[e.code]?a:n("span",{children:e.code});default:return n("span",{children:e.name})}}function w(c,e,a){const s=new Map(c.map(t=>[t.code,t]));return(e?.length?e:c.map(t=>t.code)).map(t=>{const i=s.get(t);return{code:t,name:i?.name||k(t),currency:i?.currency,url:i?.url||a?.[t]||""}})}function $(c){const{countries:e}=y();return w(e,c).length>0}function L({urls:c,countries:e,showAs:a=E}={}){const{country:s,setCountry:t,countries:i}=y(),d=w(i,e,c),p=d.find(o=>o.code===s)??d[0];function F(o){const h=c?v(d.find(m=>m.code===o)?.url,window.location.href):null;if(h){window.location.href=h;return}i.some(m=>m.code===o)&&t(o)}const C=G(a),g=d.map(o=>({value:o.code,label:o.name,meta:o.currency,...C?{lead:n(b,{code:o.code,width:21})}:{}})),r=S({items:g,value:s,onPick:F});if(!p)return null;const u=r.open;return l("div",{ref:r.wrapRef,className:"relative",children:[l("button",{ref:o=>{r.triggerRef.current=o},type:"button","aria-haspopup":"listbox","aria-expanded":u,"aria-controls":u?r.listId:void 0,"aria-activedescendant":r.activeId,"aria-label":`Region: ${p.name}. Click to change.`,onClick:r.toggle,onKeyDown:r.onTriggerKeyDown,suppressHydrationWarning:!0,className:"inline-flex items-center gap-2 whitespace-nowrap border border-fg-dim px-3 py-2 font-mono text-[13px] uppercase tracking-[0.18em] transition-colors hover:border-fg",style:{color:"color-mix(in oklab, currentColor 80%, transparent)"},children:[H(a,p),n("span",{"aria-hidden":!0,className:`text-[11px] opacity-70 transition-transform ${u?"rotate-180":""}`,children:"▾"})]}),u&&n(I,{id:r.listId,tone:"region",ariaLabel:"Choose region",items:g,value:s,focusIdx:r.focusIdx,onFocus:r.setFocusIdx,onPick:r.pick,listRef:r.listRef})]})}export{L as default,$ as useCountrySelectShows};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as F,jsxs as
|
|
1
|
+
"use client";import{jsx as e,Fragment as F,jsxs as i}from"react/jsx-runtime";import{useCallback as j,useEffect as B,useRef as Y,useState as O}from"react";import W from"next/link";import{REPEAT_ATTRIBUTE as G,REPEAT_INDEX_ATTRIBUTE as z}from"efficient-easel/draw";import q from"./CountrySelect.js";import{MenuPlaceContext as V}from"./MenuLinkBlock.js";import X from"./ThemeToggle.js";import{CardRowContext as Z,CardTemplateRows as J}from"efficient-web-builder/render/components/CardRowContext";import{renderChrome as v}from"efficient-web-builder/render/components/goldPhrases";import{UTIL_WORDS as K}from"./HeaderTools.js";import{usePhoneMenuTools as Q}from"efficient-web-builder/render/components/PhoneMenuTools";import{useSearch as ee}from"./SearchContext.js";import{useModalDismiss as ne}from"./useModalDismiss.js";import le from"efficient-easel/screen/components/UiIcon";import{usePreviewMenus as re}from"./PreviewMenusContext.js";import{FOOTER_MENU_PLACEHOLDER_COUNT as te,FOOTER_MENU_PLACEHOLDER_HEADING as ae,FOOTER_MENU_PLACEHOLDER_HINT as oe}from"../lib/content/menu-placeholder.js";import{say as T}from"efficient-web-builder/format/lib/editor-words";import{UNDER_HEADER_SHEET_CLASS as se}from"../lib/content/header-bar.js";import{isMenuOrphaned as ie}from"../lib/menu-source.js";import{legacyBlockAlignOf as ce}from"efficient-web-builder/format/lib/content/block-align";import{menuLinkInRange as me,resolveMenuLinkRange as ue}from"../lib/content/menu-row.js";import{MENU_ENTRY_SIZE_CLASS as P}from"../lib/content/menu-entry-type.js";import{TAB_CELLS as H,currentLinkIndex as de}from"../lib/content/tab-strip.js";import{useCurrentPagePath as pe}from"efficient-web-builder/render/lib/site-runtime";import{HideTaker as E}from"efficient-web-builder/render/components/ViewHideRoot";const qe="plain",he="tabs",fe=`flex list-none flex-col gap-3 ${P}`,y="mb-4 font-mono text-[13px] uppercase tracking-[0.2em] text-fg-dim",L="text-[12px] italic text-fg-dim/70",U=(n,l)=>n&&l>0?"border-t border-line pt-3":"",xe=n=>({label:n.label??"",url:n.href??"",served:n}),D=n=>n.served?{...n.served,label:n.label??"",href:n.url??""}:{label:n.label??"",href:n.url??""},be=Array.from({length:te},()=>({label:"",href:""}));function M({owner:n,items:l,place:a,wrap:c,markCurrent:h=!1}){const x=l?l.map(D):be,o=pe(),m=l&&h?de(l.map(g=>g.url??""),o):-1,u=m<0?null:{index:m,href:l[m].url??""};return e(V.Provider,{value:l?u?{...a,current:u}:a:{...a,placeholder:!0},children:e(J,{ownerId:n.id,ownerType:n.type,Template:n.template,rows:x,items:l??void 0,fallback:null,wrapCopy:c,children:g=>g})})}const R=n=>(n.template?.blockCount??0)>0,Ne="Nothing to show yet: this menu's entries come from its Menu content.",$="This menu draws no links: its card template is empty. Undo the delete, or delete this Menu and add it again.";function Ee({owner:n,items:l,label:a,editing:c,linkAlign:h,linkRange:x,markCurrent:o}){const m=ce(h),u=ue(x),g=!!u&&l!==null&&u.to!==void 0&&u.to<l.length,[w,C]=O(!1),_=Y(null),b=Q(),{open:S}=ee(),N=a||"Menu",s=j(()=>C(!1),[]);ne({active:w,onDismiss:s,scopeRef:_});const f=e(M,{owner:n,items:l,place:{place:"row"},markCurrent:o,wrap:(r,t)=>{const p=l!==null&&u&&!me(u,t.index+1)?{"data-menu-out":""}:null;return e("li",{className:"",...p,children:r})}}),k=(r,t,p)=>c?{[G]:`${r}:${p<0?"panel":"dropdown"}`,[z]:`${p+1}.${t.index}`}:null,A=e(M,{owner:n,items:l,place:{place:"panel",onNavigate:s},markCurrent:o,wrap:(r,t)=>i(F,{children:[e("li",{className:"flex min-h-14 items-center border-b border-line",...k(n.id,t,-1),children:r}),l===null?null:(t.item?.dropdown_items??[]).map((p,I)=>e(Z.Provider,{value:{...t,row:D(p),item:p},children:e("li",{className:"flex min-h-12 items-center border-b border-line pl-5 text-[14px]",...k(n.id,t,I),children:r})},I))]})}),d=b&&(b.search||b.region||b.account||b.theme)?b:null;return!c&&l!==null&&!R(n)&&!d?null:i(E,{as:"nav",ref:_,"aria-label":N,"data-menu-row":"",...m?{"data-menu-align":m}:null,...g?{"data-menu-part":"lead"}:null,className:"min-w-0",children:[e("ul",{className:`m-0 hidden list-none flex-wrap items-center gap-x-8 gap-y-2 p-0 font-mono ${P} uppercase tracking-[0.18em] view-tablet:flex`,children:f}),e("button",{type:"button",className:"flex h-11 w-11 items-center justify-center view-tablet:hidden","aria-expanded":w,"aria-label":w?"Close the menu":"Open the menu",onClick:()=>C(r=>!r),children:e("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",children:w?e("path",{d:"M6 6l12 12M18 6L6 18"}):e("path",{d:"M4 7h16M4 12h16M4 17h16"})})}),w?i("div",{role:"dialog","aria-label":N,className:`${se} z-[60] flex flex-col overflow-y-auto bg-bg text-fg view-tablet:hidden`,children:[e("ul",{className:"m-0 flex list-none flex-col px-5 py-3 font-mono text-[16px] uppercase tracking-[0.18em]",children:A}),d?i("div",{className:"mt-auto flex flex-col gap-4 border-t border-line bg-surface p-5",children:[d.search?i("button",{type:"button",className:"flex h-12 items-center gap-3 border border-line bg-bg px-4 text-left text-[15px]",onClick:c?void 0:()=>{s(),S()},children:[e(le,{name:"search",size:18,strokeWidth:1.6,rounded:!0}),K.search]}):null,d.account?i("div",{className:"flex items-center justify-between",children:[e("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),e(W,{href:"/account",onClick:s,className:"mono-eyebrow underline",children:"Your account"})]}):null,d.region?i("div",{className:"flex items-center justify-between",children:[e("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),e(q,{})]}):null,d.theme?i("div",{className:"flex items-center justify-between",children:[e("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),e(X,{})]}):null]}):null]}):null]})}function ge({owner:n,items:l,label:a,editing:c,markCurrent:h}){return!c&&(l===null||l.length===0||!R(n))?null:e(E,{as:"nav","aria-label":a||"Menu","data-menu-tabs":"",className:"min-w-0",children:e("ul",{className:H.list,children:e(M,{owner:n,items:l,place:{place:"tab"},markCurrent:h,wrap:(x,o)=>e("li",{className:H.item(o.index===0,c),children:x})})})})}function we({owner:n,menu:l,served:a,heading:c,accordionMobile:h=!1,showDividers:x=!1,editing:o=!1,layout:m="column",linkAlign:u,linkRange:g,menuStyle:w,currentPage:C}){const _=m==="row"&&C===!0,{live:b,ready:S}=re(),N=!a&&ie({id:l?.id,handle:l?.handle,editing:o,ready:S,live:b}),s=a?a.map(xe):N?[]:l?.items??[],f=c||(a?"":l?.name)||"",[k,A]=O(!1);if(B(()=>{if(!h)return;const r=window.matchMedia("(max-width: 800px)"),t=()=>A(r.matches);return t(),r.addEventListener("change",t),()=>r.removeEventListener("change",t)},[h]),a&&s.length===0)return o?e(E,{as:"p",className:L,children:T(Ne)}):null;if(m==="row"&&o&&!N&&s.length>0&&!R(n))return e(E,{as:"p",className:L,children:T($)});if(m==="row"&&w===he)return e(ge,{owner:n,items:N?null:s,label:f,editing:o,markCurrent:_});if(m==="row")return e(Ee,{owner:n,items:N?null:s,label:f,editing:o,linkAlign:u,linkRange:g,markCurrent:_});const d=r=>e("ul",{className:fe,children:e(M,{owner:n,items:r,place:{place:"column"},wrap:(t,p)=>e("li",{className:r?U(x,p.index):`text-fg ${U(x,p.index)}`,children:t})})});return N?i(E,{as:"div",className:"min-w-0",children:[e("h4",{className:y,children:c?v(c):T(ae)}),d(null),e("p",{className:`mt-3 ${L}`,children:T(oe)})]}):s.length===0||!R(n)?i(E,{as:"div",className:"min-w-0",children:[f?e("h4",{className:y,children:v(f)}):null,o?e("p",{className:L,children:s.length===0?T("This menu has no links yet — add them in {place}.",{place:T("Storefront → Menus")}):T($)}):null]}):h&&k?i(E,{as:"details",className:"min-w-0 border-b border-line",children:[i("summary",{className:"flex cursor-pointer list-none items-center justify-between py-3 font-mono text-[13px] uppercase tracking-[0.2em] text-fg-dim",children:[v(f),e("span",{"aria-hidden":!0,children:"+"})]}),e("div",{className:"pb-3",children:d(s)})]}):i(E,{as:"div",className:"min-w-0",children:[f?e("h4",{className:y,children:v(f)}):null,d(s)]})}export{qe as MENU_STYLE_PLAIN,he as MENU_STYLE_TABS,we as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as n,jsxs as
|
|
1
|
+
"use client";import{jsx as n,jsxs as f}from"react/jsx-runtime";import{createContext as d,useContext as h,useEffect as k,useRef as x}from"react";import L from"next/link";import w from"./HeaderNavItem.js";import N from"./MenuPlaceholderLabel.js";import{useCardRow as C}from"efficient-web-builder/render/components/CardRowContext";import{renderGold as i}from"efficient-web-builder/render/components/goldPhrases";import{scrollBehavior as _}from"efficient-web-builder/render/components/useReducedMotion";import{useTakeViewHide as g,withViewHide as u}from"efficient-web-builder/render/components/ViewHideRoot";import{isLabelOnlyMenuUrl as v,menuLinkKind as y}from"../lib/menu-link.js";import{CURRENT_LINE as m,TAB_CELLS as p,showCurrentTab as M}from"../lib/content/tab-strip.js";const R=d(null),b="opacity-80 transition-opacity hover:opacity-100";function s({item:e,label:l,link:r,onNavigate:t,current:c=!1,children:a}){const o=g();return v(e.url)?o.scope(n("span",{className:u(l,o.className),...o.attrs,children:i(e.label)})):o.scope(y(e.url)==="off-site"?f("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:u(r,o.className),onClick:t,...o.attrs,children:[i(e.label),a]}):f(L,{href:e.url,className:u(r,o.className),onClick:t,"aria-current":c?"page":void 0,...o.attrs,children:[i(e.label),a]}))}function T(){const e=x(null);return k(()=>{M(e.current?.closest("[data-menu-tabs] > ul")??null,_())},[]),n("span",{ref:e,className:p.underline})}function j(){const e=C(),l=h(R);if(!e||!l)return null;if(l.placeholder)return n(N,{});const r={label:e.row.label??"",url:e.row.href??""},t=!!l.current&&l.current.index===e.index&&l.current.href===r.url;if(l.place==="tab"){const a=p.tab(t);return n(s,{item:r,label:a,link:a,current:t,children:t?n(T,{}):null})}if(l.place==="column")return n(s,{item:r,label:"text-fg",link:"text-fg transition-colors hover:text-accent",current:t});if(l.place==="panel")return n(s,{item:r,label:"",link:` ${b}`,onNavigate:l.onNavigate,current:t});const c=e.item?.dropdown_items??[];return c.length?n(w,{item:{href:r.url,label:i(r.label),plainLabel:r.label,dropdownItems:c.map(a=>({href:a.url,label:i(a.label),plainLabel:a.label}))}}):t?n(s,{item:r,label:"",link:m.rowLink,current:!0,children:n("span",{"aria-hidden":"true",className:m.row})}):n(s,{item:r,label:"",link:` ${b}`})}export{R as MenuPlaceContext,j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as C,jsx as e,jsxs as
|
|
1
|
+
"use client";import{Fragment as C,jsx as e,jsxs as t}from"react/jsx-runtime";import I from"./SectionBand.js";import{SPEC_TABLE_BAND as y}from"../lib/sections/spec-table-band.js";import{useScopeClass as B}from"../lib/use-scope-class.js";import{useState as D}from"react";import R from"efficient-web-builder/render/components/SectionHeader";import{CardTemplateRows as j}from"efficient-web-builder/render/components/CardRowContext";import A from"./WheelSvg.js";import{renderGold as T,renderHeadline as V}from"efficient-web-builder/render/components/goldPhrases";import{inchLabel as $}from"../lib/wheels/spec-format.js";import W from"./DimensionArrowMarkers.js";import P from"./SpecTablePartBridge.js";import{SPEC_REGION_ATTR as M}from"efficient-web-builder/format/lib/sections/spec-table-regions";import{say as E}from"efficient-web-builder/format/lib/editor-words";import{applyShopMark as G}from"efficient-web-builder/format/lib/markup";import{useEnglish as H}from"./EnglishVariant.js";import{sizedImage as O}from"efficient-web-builder/format/lib/sized-image";import{COPY_MARK as L}from"../lib/content/copy-mark.js";const _={between:"[&>*+*]:border-t [&>*+*]:border-line",every:"[&>*]:border-t [&>*]:border-line"},F="(max-width: 1100px) 80vw, 290px",d={labelSmall:"text-[length:var(--size-label,11px)]",label:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,14px)]"};function r(i,a){return i?{[M]:a}:{}}function Y({editing:i,nodeId:a,children:s}){return!i||!a?e(C,{children:s}):e(P,{nodeId:a,children:s})}function z({row:i,topBorder:a,editing:s}){return t("div",{className:`flex items-baseline justify-between gap-6 py-4 font-mono ${d.labelLarge} tracking-[0.05em] ${a?"border-t border-line":""}`,children:[e("span",{...r(s,"rowLabel"),className:"uppercase text-fg-dim",children:i.label}),e("span",{...r(s,"rowValue"),className:`text-right ${i.accent?"text-accent":"text-fg"}`,children:i.value})]})}function Z({diagram:i,editing:a}){const[s,b]=D(!1),n=B("spec"),{wheelName:p,imageSrc:m,diameter:f,width:h,offset:v,holes:N,pcd:g,spokes:u,mesh:o,bore:c}=i,S=!!m&&!s;return t("div",{className:"sf-card bg-surface p-6 max-view-desktop:mt-8",children:[e("div",{...r(a,"diagramTitle"),className:`mb-3 font-mono ${d.label} uppercase tracking-[0.25em] text-fg-dim`,children:"Wheel Dimension Diagram"}),t("div",{className:"relative flex aspect-square items-center justify-center",children:[t("svg",{viewBox:"0 0 320 320",className:"absolute inset-0 h-full w-full text-fg-dim",fill:"none",stroke:"currentColor",children:[e("line",{x1:40,y1:20,x2:280,y2:20,strokeWidth:1,markerStart:`url(#${n}-L)`,markerEnd:`url(#${n}-R)`}),e("line",{x1:40,y1:15,x2:40,y2:25,strokeWidth:1}),e("line",{x1:280,y1:15,x2:280,y2:25,strokeWidth:1}),e(W,{id:n})]}),S?e("img",{...O(m,{fallbackWidth:960}),sizes:F,alt:`${p} — face`,onError:()=>b(!0),loading:"lazy",className:"relative z-[1] block h-[80%] w-[80%] object-contain"}):e(A,{spokes:u,mesh:o,className:"relative z-[1] block h-[72%] w-[72%] text-accent"}),t("span",{...r(a,"diagramCallout"),className:`absolute top-1.5 left-1/2 z-20 -translate-x-1/2 bg-surface px-2 font-mono ${d.label} tracking-[0.2em] text-accent`,children:["⌀ ",$(f)]}),t("span",{...r(a,"diagramCallout"),className:`absolute bottom-1.5 left-1/2 z-20 -translate-x-1/2 bg-surface px-2 font-mono ${d.label} tracking-[0.2em] text-fg`,children:["WIDTH ",$(h)]})]}),t("div",{className:`mt-4 grid grid-cols-5 gap-3 font-mono ${d.labelSmall} uppercase tracking-[0.2em] text-fg-dim max-[480px]:grid-cols-3`,children:[t("div",{children:[e("div",{...r(a,"diagramStatLabel"),className:"text-fg-dim/60",children:"Holes"}),e("div",{...r(a,"diagramStatValue"),className:"mt-1 text-fg",children:N})]}),t("div",{children:[e("div",{...r(a,"diagramStatLabel"),className:"text-fg-dim/60",children:"PCD"}),e("div",{...r(a,"diagramStatValue"),className:"mt-1 text-fg",children:g})]}),t("div",{children:[e("div",{...r(a,"diagramStatLabel"),className:"text-fg-dim/60",children:"Spokes"}),t("div",{...r(a,"diagramStatValue"),className:"mt-1 text-fg",children:[u,o?" + Mesh":""]})]}),t("div",{children:[e("div",{...r(a,"diagramStatLabel"),className:"text-fg-dim/60",children:"Bore"}),e("div",{...r(a,"diagramStatValue"),className:"mt-1 text-fg",children:c})]}),t("div",{children:[e("div",{...r(a,"diagramStatLabel"),className:"text-fg-dim/60",children:"ET"}),e("div",{...r(a,"diagramStatValue"),className:"mt-1 text-accent",children:v})]})]})]})}function q({num:i,title:a,description:s,rows:b,builtInLabels:n=!1,diagram:p,editing:m=!1,omitHead:f=!1,nodeId:h,capped:v=!0,template:N,footer:g}){const u=H(),o=(b??[]).filter(l=>(l?.label??"").trim()||(l?.value??"").trim()).map(l=>n&&l.label?{...l,label:u(l.label)}:l),c=o.length>0?o:m?[{label:E("Label"),value:E("Value")}]:[],S=c.map(l=>({label:l.label??"",value:l.accent&&l.value?G(l.value,0,l.value.length,"highlight").text:l.value??""})),k=l=>p?t("div",{className:"grid grid-cols-[1fr_400px] gap-12 max-view-desktop:grid-cols-1",children:[e("div",{className:l?`${_.between} ${L}`:void 0,children:l??c.map((w,x)=>e(z,{row:w,topBorder:x>0,editing:m},x))}),e(Z,{diagram:p,editing:m})]}):e("div",{className:`grid grid-cols-2 gap-x-16 max-[900px]:grid-cols-1${l?` ${_.every} ${L}`:""}`,children:l??c.map((w,x)=>e(z,{row:w,topBorder:!0,editing:m},x))});return e(I,{className:f?y.ownBox:y.inline,capped:v,children:t(Y,{editing:m,nodeId:h,children:[f?null:e(R,{num:i?T(i):void 0,title:a?V(a,!1):void 0,description:s?T(s):void 0,accent:!0}),e(j,{ownerId:h??"",ownerType:"SpecTable",Template:N,rows:S,fallback:k(),children:l=>k(l)}),g===void 0?null:e("div",{className:"mt-12 empty:hidden",children:g})]})})}export{q as default};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import type { SlotComponent } from "efficient-easel/blocks";
|
|
1
2
|
export declare const BOOKING_REGIONS: readonly ["head", "booking", "details", "confirm"];
|
|
2
3
|
export type BookingRegion = (typeof BOOKING_REGIONS)[number];
|
|
3
4
|
export declare const BOOKING_REGION_NAMES: Record<BookingRegion, string>;
|
|
4
5
|
export interface BookingBoxProps {
|
|
5
6
|
region?: string;
|
|
7
|
+
nodeId?: string;
|
|
8
|
+
serviceTemplate?: SlotComponent;
|
|
9
|
+
timeTemplate?: SlotComponent;
|
|
6
10
|
successMessage?: string;
|
|
7
11
|
styleStep?: unknown;
|
|
8
12
|
styleName?: unknown;
|
|
@@ -13,4 +17,4 @@ export interface BookingBoxProps {
|
|
|
13
17
|
intro?: string;
|
|
14
18
|
buttonLabel?: string;
|
|
15
19
|
}
|
|
16
|
-
export default function BookingBox({ region, eyebrow, heading, intro, buttonLabel, successMessage, ...kinds }: BookingBoxProps): import("react").JSX.Element | null;
|
|
20
|
+
export default function BookingBox({ region, nodeId, serviceTemplate, timeTemplate, eyebrow, heading, intro, buttonLabel, successMessage, ...kinds }: BookingBoxProps): import("react").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as o}from"react/jsx-runtime";import{BookingChoose as
|
|
1
|
+
"use client";import{jsx as o}from"react/jsx-runtime";import{BookingChoose as B,BookingConfirmed as g,BookingDetails as p,BookingHead as x}from"./BookingRegions.js";import{useBookingForm as h}from"./BookingFormState.js";import{HideTaker as t}from"efficient-web-builder/render/components/ViewHideRoot";import{bookingKindStyle as y}from"../../lib/booking/text-kinds.js";const C=["head","booking","details","confirm"],E={head:"Head",booking:"Booking",details:"Your details",confirm:"Confirmation"};function b({region:n,nodeId:s="BookingBox",serviceTemplate:l,timeTemplate:a,eyebrow:m,heading:f,intro:c,buttonLabel:u,successMessage:d,...k}){const{confirmation:i,services:r}=h(),e=y(k);return n==="head"?o(t,{className:"min-[960px]:col-span-2",style:e,children:o(x,{eyebrow:m,heading:f,intro:c})}):n==="confirm"?i?o(t,{className:"min-[960px]:col-span-2",style:e,children:o(g,{successMessage:d})}):null:i||!r||r.length===0?null:n==="booking"?o(B,{style:e,owner:{id:s,type:"BookingBox",serviceTemplate:l,timeTemplate:a}}):n==="details"?o(p,{buttonLabel:u,style:e}):null}export{C as BOOKING_REGIONS,E as BOOKING_REGION_NAMES,b as default};
|
|
@@ -39,6 +39,15 @@ export declare function useBookingForm(): BookingFormValue;
|
|
|
39
39
|
export declare const SAMPLE_SERVICES: BookingService[];
|
|
40
40
|
export declare const SAMPLE_CONFIRMATION: BookingConfirmation;
|
|
41
41
|
export declare function showsExample(editing: boolean, services: BookingService[] | undefined): boolean;
|
|
42
|
+
export declare function bookingReady(form: {
|
|
43
|
+
editing: boolean;
|
|
44
|
+
submitting: boolean;
|
|
45
|
+
hasService: boolean;
|
|
46
|
+
selectedStart: string;
|
|
47
|
+
name: string;
|
|
48
|
+
email: string;
|
|
49
|
+
requiresPayment: boolean;
|
|
50
|
+
}, now: number): boolean;
|
|
42
51
|
export declare function BookingFormProvider({ editing, previewConfirmation, children, }: {
|
|
43
52
|
editing?: boolean;
|
|
44
53
|
previewConfirmation?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as ae}from"react/jsx-runtime";import{createContext as oe,useContext as se,useEffect as b,useId as re,useMemo as le,useState as n}from"react";import{ApiError as F,bookings as h}from"../../lib/api/index.js";import{findFirstBookableDay as ce,isoDate as ue}from"../../lib/booking-dates.js";import{startHasPassed as me}from"../../lib/booking/appointment-time.js";import{uuid as N}from"../../lib/uuid.js";const Z=oe(null);function Te(){const e=se(Z);if(!e)throw new Error("useBookingForm must be used inside <BookingFormProvider>");return e}const T=[{id:"example-1",name:"Example service",durationMinutes:45,price:"80.00",description:"What this appointment includes, in a sentence."},{id:"example-2",name:"Second example",durationMinutes:30,price:"0",description:""}];function de(e){return{timezone:"UTC",slots:[`${e}T09:00:00.000Z`,`${e}T10:30:00.000Z`,`${e}T13:00:00.000Z`].map(s=>({start:s}))}}const fe={bookingNumber:"EXAMPLE-0000",service:"Example service",startAt:"2026-01-01T00:00:00.000Z",timezone:"UTC",customerTimezone:"",manageToken:"example"};function pe(e,s){return e&&s?.length===0}function ve(e,s){return!!(!e.editing&&!e.submitting&&e.hasService&&e.selectedStart&&!me(e.selectedStart,s)&&e.name.trim()&&e.email.trim()&&!e.requiresPayment)}function Ee({editing:e=!1,previewConfirmation:s=!1,children:z}){const $=re(),m=le(()=>ue(new Date),[]),[y,E]=n(),[L,U]=n(""),[o,P]=n(""),[r,k]=n(m),[W,j]=n(m),[d,q]=n(!1),[O,c]=n(null),[R,u]=n(),[S,f]=n(""),[g,_]=n(""),[x,K]=n(""),[A,H]=n(""),[C,V]=n(""),[X,Y]=n(()=>N()),[G,J]=n(null),[Q,p]=n(!1),[D,I]=n(!1),[ee,v]=n(null),[w,te]=n("");b(()=>{te(Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC")},[]),b(()=>{let i=!1;return h.listServices().then(t=>{i||(E(t.results),U(t.currency),P(ie=>ie||t.results[0]?.id||""))}).catch(()=>{i||E([])}),()=>{i=!0}},[]),b(()=>{if(d||!o)return;const i={aborted:!1};return f(""),u(void 0),v(null),c(null),p(!0),ce(o,m,{signal:i}).then(t=>{if(!i.aborted){if(t.outcome==="found"){k(t.date),j(t.date),u(t.availability);return}c(t.outcome==="noneInWindow"?`No times are available in the next ${t.days} days.`:"We couldn't load available times. Please try again.")}}).finally(()=>{i.aborted||p(!1)}),()=>{i.aborted=!0}},[d,o,m]),b(()=>{if(!d||!o||!r)return;let i=!1;return f(""),u(void 0),v(null),c(null),p(!0),h.getAvailability(o,r).then(t=>{i||(u(t),t.slots.length===0&&c("No times are available on this date."))}).catch(()=>{i||c("We couldn't load available times. Please try again.")}).finally(()=>{i||p(!1)}),()=>{i=!0}},[r,d,o]);const l=y?.find(i=>i.id===o),B=l?.depositAmountDue!=null,M=ve({editing:e,submitting:D,hasService:!!l,selectedStart:S,name:g,email:x,requiresPayment:B},Date.now());async function ne(i){if(i.preventDefault(),!(!M||!l)){I(!0),v(null);try{const t=await h.create({serviceId:l.id,start:S,customer:{name:g.trim(),email:x.trim(),phone:A.trim()},notes:C.trim(),idempotencyKey:X,customerTimezone:w});J(t),Y(N())}catch(t){v(t instanceof F&&t.status===409?"That time was just booked. Choose another available time.":"Your appointment wasn't submitted. Please check your details and try again."),t instanceof F&&t.status===409&&(f(""),h.getAvailability(l.id,r).then(u).catch(()=>{}))}finally{I(!1)}}}const a=pe(e,y);return ae(Z.Provider,{value:{fieldPrefix:$,editing:e,services:a?T:y,currency:a?"AUD":L,serviceId:a?T[0].id:o,setServiceId:P,service:a?T[0]:l,requiresPayment:a?!1:B,date:r,earliestDate:W,setDate:k,setDateTouched:q,availability:a?de(r):R,loadingSlots:a?!1:Q,noSlotsMessage:O,selectedStart:a?`${r}T09:00:00.000Z`:S,setSelectedStart:f,customerTimezone:w,name:g,setName:_,email:x,setEmail:K,phone:A,setPhone:H,notes:C,setNotes:V,confirmation:G??(s?fe:null),submitting:D,error:ee,canSubmit:a?!1:M,handleSubmit:ne,sample:!!a},children:z})}export{Z as BookingFormContext,Ee as BookingFormProvider,fe as SAMPLE_CONFIRMATION,T as SAMPLE_SERVICES,ve as bookingReady,pe as showsExample,Te as useBookingForm};
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
+
import type { SlotComponent } from "efficient-easel/blocks";
|
|
1
2
|
import type { CSSProperties } from "react";
|
|
2
3
|
export declare function BookingHead({ eyebrow, heading, intro, }: {
|
|
3
4
|
eyebrow?: string;
|
|
4
5
|
heading?: string;
|
|
5
6
|
intro?: string;
|
|
6
7
|
}): import("react").JSX.Element;
|
|
7
|
-
export
|
|
8
|
+
export interface BookingStepOwner {
|
|
9
|
+
id: string;
|
|
10
|
+
type: string;
|
|
11
|
+
serviceTemplate?: SlotComponent;
|
|
12
|
+
timeTemplate?: SlotComponent;
|
|
13
|
+
}
|
|
14
|
+
export declare function BookingChoose({ style, owner }: {
|
|
8
15
|
style?: CSSProperties;
|
|
16
|
+
owner: BookingStepOwner;
|
|
9
17
|
}): import("react").JSX.Element | null;
|
|
10
18
|
export declare function BookingDetails({ buttonLabel, style, }: {
|
|
11
19
|
buttonLabel?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as o}from"react/jsx-runtime";import{SAMPLE_CONFIRMATION as O,useBookingForm as C}from"./BookingFormState.js";import $ from"efficient-web-builder/render/components/Btn";import{HideTaker as F}from"efficient-web-builder/render/components/ViewHideRoot";import c from"../WebFormField.js";import{CardTemplateRows as I}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as S}from"efficient-web-builder/render/components/SiteGutterFrame";import{groundCell as A}from"../card-ground-cell.js";import{PART_ROW_ATTR as D,encodePartRow as j}from"efficient-web-builder/render/lib/document/text-parts";import{BOOKING_SERVICE_SLOT as E,BOOKING_TIME_SLOT as P}from"../../lib/content/booking-card-seed.js";import{formatAppointment as _,formatAppointmentTime as B,startHasPassed as H}from"../../lib/booking/appointment-time.js";import{formatMoneyInCurrency as K}from"../../lib/commerce.js";import{FREE_PRICE as W}from"../../lib/wheels/price-display.js";const p="w-full border-2 border-line bg-bg px-4 py-4 font-[family-name:var(--bk-value-font,var(--font-display))] text-[length:var(--bk-value-size,17px)] text-fg outline-none transition-colors placeholder:text-fg-dim hover:border-fg-dim focus:border-accent";function G(r,t){const n=Number(r);if(n===0)return W;try{return K(n,t)}catch{return`${t} ${r}`}}const R={selected:!0};function M(r,t){return({index:n})=>t?{[D]:j(r,n)}:{}}const u="font-[family-name:var(--bk-name-font,var(--font-mono))] text-[length:var(--bk-name-size,12px)]";function w({number:r,children:t}){return o("div",{className:"mb-4 flex items-center gap-3",children:[e("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full border border-line font-[family-name:var(--bk-step-font,var(--font-mono))] text-[length:var(--bk-step-size,11px)] font-semibold text-fg-dim",children:r}),e("h3",{className:"font-[family-name:var(--bk-step-font,var(--font-mono))] text-[length:var(--bk-step-size,12px)] font-semibold uppercase tracking-[0.2em] text-fg",children:t})]})}function oe({eyebrow:r,heading:t,intro:n}){return o("div",{className:"mb-10 max-w-[760px]",children:[(r??"").trim()&&e("p",{className:"mb-4 font-mono text-[12px] font-semibold uppercase tracking-[0.24em] text-accent",children:r}),(t??"").trim()&&e("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.98] tracking-[-0.025em] text-fg max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:t}),(n??"").trim()&&e("p",{className:"mt-5 max-w-[660px] font-display text-[17px] leading-[1.65] text-fg-dim",children:n})]})}function se({style:r,owner:t}){const{fieldPrefix:n,services:l,currency:h,serviceId:x,setServiceId:b,requiresPayment:v,date:k,earliestDate:y,setDate:N,setDateTouched:T,availability:i,loadingSlots:f,noSlotsMessage:g,selectedStart:s,setSelectedStart:q,customerTimezone:m,editing:d}=C();if(!l)return null;const L=Date.now(),z=(i?.slots??[]).map(a=>({start:a.start,time:B(a.start,m||i.timezone),businessTime:m&&m!==i.timezone?`${B(a.start,i.timezone)} business`:"",passed:!d&&H(a.start,L)}));return o(F,{className:"flex flex-col gap-10",style:r,children:[o("div",{children:[e(w,{number:"01",children:"Choose a service"}),e("div",{className:"grid gap-3 sm:grid-cols-2",children:e(I,{ownerId:t.id,ownerType:t.type,slot:E,Template:t.serviceTemplate,rows:l.map(a=>({name:a.name,meta:`${a.durationMinutes} min · ${G(a.price,h)}`,description:a.description??""})),states:l.map(a=>a.id===x?R:void 0),actions:d?void 0:l.map(a=>({press:()=>b(a.id),label:a.name})),copyAttrs:M(E,d),fallback:null,wrapCopy:A,children:a=>e(S,{children:a})})}),v&&e("p",{className:"mt-3 font-[family-name:var(--bk-note-font,var(--font-mono))] text-[length:var(--bk-note-size,11px)] uppercase tracking-[0.14em] text-alert",role:"alert",children:"This service requires an upfront payment and cannot be booked through this form yet."})]}),o("div",{children:[e(w,{number:"02",children:"Choose a date and time"}),e(c,{separate:!0,htmlFor:`${n}-date`,label:"Date",required:!0,labelFace:u,children:e("input",{id:`${n}-date`,type:"date",min:y,value:k,onChange:a=>{T(!0),N(a.target.value)},className:p,required:!0})}),e("div",{className:"mt-4 grid grid-cols-2 gap-2 sm:grid-cols-3 min-[1200px]:grid-cols-4",role:"group","aria-label":"Available appointment times",children:f?e("p",{className:"col-span-full py-3 font-[family-name:var(--bk-note-font,var(--font-mono))] text-[length:var(--bk-note-size,11px)] uppercase tracking-[0.18em] text-fg-dim",children:"Loading times…"}):i?.slots.length?e(I,{ownerId:t.id,ownerType:t.type,slot:P,Template:t.timeTemplate,rows:z.map(a=>({time:a.time,businessTime:a.businessTime})),states:z.map(a=>a.start===s&&!a.passed?R:void 0),actions:d?void 0:z.map(a=>({press:()=>q(a.start),label:a.time,disabled:a.passed})),copyAttrs:M(P,d),fallback:null,wrapCopy:A,children:a=>e(S,{children:a})}):g?e("p",{className:"col-span-full py-3 font-[family-name:var(--bk-note-font,var(--font-mono))] text-[length:var(--bk-note-size,11px)] uppercase tracking-[0.18em] text-fg-dim",role:"status",children:g}):null}),i?.timezone&&o("p",{className:"mt-3 font-[family-name:var(--bk-note-font,var(--font-mono))] text-[length:var(--bk-note-size,10px)] uppercase tracking-[0.16em] text-fg-dim",children:["Times shown in ",m||i.timezone,m&&m!==i.timezone?` · business timezone ${i.timezone}`:""]})]})]})}function le({buttonLabel:r,style:t}){const{fieldPrefix:n,editing:l,name:h,setName:x,email:b,setEmail:v,phone:k,setPhone:y,notes:N,setNotes:T,submitting:i,error:f,canSubmit:g}=C();return o(F,{className:"sf-card border border-line bg-bg p-5 min-[640px]:p-8",style:t,children:[e(w,{number:"03",children:"Your details"}),o("div",{className:"flex flex-col gap-4",children:[e(c,{separate:!0,htmlFor:`${n}-name`,label:"Name",required:!0,labelFace:u,children:e("input",{id:`${n}-name`,type:"text",autoComplete:"name",value:h,onChange:s=>x(s.target.value),className:p,required:!0})}),e(c,{separate:!0,htmlFor:`${n}-email`,label:"Email",required:!0,labelFace:u,children:e("input",{id:`${n}-email`,type:"email",inputMode:"email",autoComplete:"email",value:b,onChange:s=>v(s.target.value),className:p,required:!0})}),e(c,{separate:!0,htmlFor:`${n}-phone`,label:"Phone",labelFace:u,children:e("input",{id:`${n}-phone`,type:"tel",inputMode:"tel",autoComplete:"tel",value:k,onChange:s=>y(s.target.value),className:p})}),e(c,{separate:!0,htmlFor:`${n}-notes`,label:"What would you like to cover?",labelFace:u,children:e("textarea",{id:`${n}-notes`,rows:4,value:N,onChange:s=>T(s.target.value),className:`${p} resize-y`})})]}),f&&e("p",{className:"mt-4 font-[family-name:var(--bk-note-font,var(--font-mono))] text-[length:var(--bk-note-size,11px)] uppercase tracking-[0.16em] text-alert",role:"alert",children:f}),e($,{type:l?"button":"submit",disabled:!g,arrow:null,className:"mt-6 w-full disabled:cursor-not-allowed disabled:opacity-50",children:i?"Submitting…":(r??"").trim()||"Book appointment"})]})}function me({successMessage:r}){const{confirmation:t,customerTimezone:n}=C();return t?o("div",{className:"sf-card max-w-[760px] border border-line bg-bg p-6 min-[640px]:p-10",role:"status",children:[o("p",{className:"font-mono text-[12px] font-semibold uppercase tracking-[0.22em] text-accent",children:["Request received · ",t.bookingNumber]}),e("h3",{className:"mt-4 font-display text-[28px] font-medium uppercase text-fg",children:t.service}),e("p",{className:"mt-2 font-display text-[17px] text-fg-dim",children:_(t.startAt,t.customerTimezone||n||t.timezone)}),t.customerTimezone&&t.timezone!==t.customerTimezone&&o("p",{className:"mt-1 font-mono text-[10px] uppercase tracking-[0.16em] text-fg-dim",children:["Business time: ",_(t.startAt,t.timezone)]}),(r??"").trim()&&e("p",{className:"mt-5 max-w-[620px] font-serif text-[18px] italic leading-[1.6] text-fg-dim",children:r}),e($,{href:`/book/${encodeURIComponent(t.manageToken)}`,newTab:t!==O,variant:"ghost",className:"mt-8",children:"Manage booking"})]}):null}export{se as BookingChoose,me as BookingConfirmed,le as BookingDetails,oe as BookingHead};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as s}from"react/jsx-runtime";const d=r=>s("div",{className:"grid bg-bg",children:r});export{d as groundCell};
|
|
@@ -25,6 +25,7 @@ export interface AlloyWheelsListingProps {
|
|
|
25
25
|
editing?: boolean;
|
|
26
26
|
ownerId?: string;
|
|
27
27
|
template?: SlotComponent;
|
|
28
|
+
facetTemplate?: SlotComponent;
|
|
28
29
|
cardImage?: number | null;
|
|
29
30
|
hover?: CardHoverDrawn;
|
|
30
31
|
}
|
|
@@ -32,4 +33,4 @@ export declare const PLP_GATE_DEFAULTS: {
|
|
|
32
33
|
readonly heading: "Let's find wheels that fit your car.";
|
|
33
34
|
readonly intro: "Tell us what you drive and we'll show you every set that bolts straight on — bolt pattern, offset and hub bore checked for you.";
|
|
34
35
|
};
|
|
35
|
-
export default function AlloyWheelsListing({ heading, intro, askForCar, gateHeading, gateIntro, perPage, columns, defaultSort, hiddenFacets, fieldUsage, showPrice, showInStock, kinds, products, wheels, requestQuery, editing, ownerId, template, hover, titleLevel, }: AlloyWheelsListingProps): import("react").JSX.Element | null;
|
|
36
|
+
export default function AlloyWheelsListing({ heading, intro, askForCar, gateHeading, gateIntro, perPage, columns, defaultSort, hiddenFacets, fieldUsage, showPrice, showInStock, kinds, products, wheels, requestQuery, editing, ownerId, template, facetTemplate, hover, titleLevel, }: AlloyWheelsListingProps): import("react").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as p,Fragment as
|
|
1
|
+
"use client";import{jsx as r,jsxs as p,Fragment as We}from"react/jsx-runtime";import{useScopeClass as $e}from"../../lib/use-scope-class.js";import{useCallback as m,useEffect as He,useMemo as i,useRef as Ye,useState as qe}from"react";import{cardHoverOf as Je}from"efficient-web-builder/format/lib/animation/hover";import{SHARED_ROWS_LIST_CLASS as Qe}from"efficient-web-builder/render/lib/content/box-shared-columns";import{NO_FIELD_ANSWERS as Ue,answersForKind as re}from"../../lib/content/field-usage.js";import{useCurrency as Xe}from"../CurrencyContext.js";import Ze from"../NoCurrencyNote.js";import{usePreviewDevice as et}from"efficient-easel/screen/components/PreviewDeviceContext";import{renderGold as tt,renderHeadline as ot}from"efficient-web-builder/render/components/goldPhrases";import{useUnifiedProductCatalog as rt}from"../useProductCatalog.js";import{scrollBehavior as nt}from"efficient-web-builder/render/components/useReducedMotion";import{normalizePlpColumns as st,PLP_GRID_GAP_VAR as ne,plpGridVars as it}from"../../lib/wheels/plp-grid.js";import{plpCardImageSizes as lt}from"../../lib/sections/card-image-sizes.js";import{CARD_ROWS_GRID_CLASS as at,cardRowsGridStyle as ct}from"../WheelCardFrame.js";import{applyPlpFilters as pt,buildPlpFacets as mt,buildPlpTypeOptions as dt,buildTyreSizeBoxes as ut,EMPTY_PLP_FILTERS as se,hasActivePlpFilters as ht,paginatePlp as ft,pickTyreSize as gt,plpTyreSizeBoxesShown as yt,plpInStockCount as St,plpOpeningSort as xt,plpPriceBounds as wt,plpShownKinds as bt,plpSortKeysFor as vt,PLP_SORT_LABELS as Pt}from"../../lib/wheels/plp-filters.js";import{itemKind as z,itemSlug as kt,itemTyreSizes as Nt,plpBrandVaries as Ct,plpProcessVaries as Tt,plpItemsOfKinds as _t,plpKindNoun as ie,resolvePlpKinds as At}from"../../lib/catalog/plp-item.js";import{plpGateWords as zt,plpVehicleCopy as Lt}from"../../lib/catalog/plp-vehicle-copy.js";import{oemBadgeSize as Ot,oemTyreSizes as Rt}from"../../lib/tyres/tyre-vehicle-fitment.js";import{wheelsFittingVehicle as Ft}from"../../lib/wheels/plp-fitment-match.js";import Gt from"./PlpActiveChips.js";import{GridCardProvider as It,GridMixedCards as Vt,gridIndexCss as Et,LISTING_CARD_RULES as Kt}from"../GridCardTemplate.js";import{wheelCardEyebrowShows as jt}from"../ProductCardEyebrow.js";import Bt from"./PlpPagination.js";import Mt from"./PlpSidebar.js";import{PlpResultRange as Dt,PlpToolbar as Wt}from"./PlpToolbar.js";import $t from"../catalog/SortSelect.js";import Ht from"./PlpVehicleBar.js";import Yt from"./PlpVehicleGate.js";import{useVehicleCatalog as qt}from"./useVehicleCatalog.js";import{useVehicleFit as Jt}from"../fitment/useVehicleFit.js";import{usePlpFiltersInUrl as Qt}from"./usePlpFiltersInUrl.js";import{say as I}from"efficient-web-builder/format/lib/editor-words";const Fo={heading:"Let's find wheels that fit your car.",intro:"Tell us what you drive and we'll show you every set that bolts straight on — bolt pattern, offset and hub bore checked for you."};function Ut({level:v,className:P,children:k}){return r(v===2?"h2":"h1",{className:P,children:k})}const Xt=Je({},"AlloyWheelsListing");function Zt({heading:v="",intro:P="",askForCar:k=!0,gateHeading:V="",gateIntro:le="",perPage:E=24,columns:ae,defaultSort:ce="recommended",hiddenFacets:pe=[],fieldUsage:f=Ue,showPrice:K=!0,showInStock:me=!0,kinds:de,products:ue,wheels:he,requestQuery:fe,editing:d=!1,ownerId:j="",template:ge,facetTemplate:ye,hover:Se=Xt,titleLevel:xe}){const{currency:a}=Xe(),u=At(de),B=et(),M=st(ae),we=it(M,d?B:null),be=lt(M,d?B:null),D=$e("plp"),ve=Et(D),Pe=rt(),W=ue??he??Pe??[],$=i(()=>_t(W,u),[W,u.join(",")]),o=Jt({editing:d,enabled:k,autoApply:!0}),[ke,L]=qe(!1),Ne=xt(ce,u),g=o.applied?.vehicle??null,[e,x]=Qt({editing:d,openingSort:Ne,appliedVehicle:g,vehicleRestored:o.restored,requestQuery:fe}),c=bt(u,e.kind),s=m(t=>x(t),[x]),H=m((t,h)=>{const l=e[t],Me=l.map(String).includes(h)?l.filter(De=>String(De)!==h):[...l,t==="diameters"?Number(h):h];s({...e,[t]:Me,page:1})},[e,s]),Y=m(t=>s({...e,priceMax:t,page:1}),[e,s]),q=m(t=>s({...e,inStockOnly:t,page:1}),[e,s]),J=m(t=>s({...se,kind:t,inStockOnly:e.inStockOnly,priceMax:e.priceMax,sort:e.sort}),[e.inStockOnly,e.priceMax,e.sort,s]),Ce=m(t=>s({...e,sort:t,page:1}),[e,s]),Te=m(t=>{s({...e,page:t}),typeof window<"u"&&window.scrollTo({top:0,behavior:nt()})},[e,s]),Q=m(()=>s({...se,sort:e.sort}),[e.sort,s]),{clear:C}=o,U=m(()=>{C(),L(!0),x(t=>({...t,page:1}))},[C]),_e=m(()=>{C(),L(!1),x(t=>({...t,page:1}))},[C]),T=g?[g.make,g.model,g.year,g.modification].join("|"):"",_=Ye(null);He(()=>{if(o.restored){if(_.current===null){_.current=T;return}_.current!==T&&(_.current=T,x(t=>t.page===1?t:{...t,page:1}))}},[o.restored,T,x]);const A=qt({catalog:$,shownKinds:u,vehicle:g,editing:d}),n=i(()=>{if(!o.fit)return A;const t=A.filter(l=>z(l)==="alloy-wheel"),h=new Set(Ft(t,o.fit).map(l=>l.slug));return A.filter(l=>z(l)!=="alloy-wheel"||h.has(kt(l)))},[A,o.fit]),w=pe.join(","),Ae=i(()=>{const t=new Set(w?w.split(","):[]);return mt(n,e,a,c,f).filter(h=>!t.has(h.key))},[n,e,a,w,c.join(","),f]),y=i(()=>pt(n,e,a),[n,e,a]),ze=c.length>1,X=i(()=>re(f,"alloy-wheel"),[f]),Le=i(()=>re(f,"tyre"),[f]),O=i(()=>Ct(y),[y]),R=i(()=>Tt(y),[y]),F=ze?ie(["alloy-wheel"]).one:null,Oe=i(()=>({kindLabel:F,brand:O,process:R}),[F,O,R]),Re=jt({kind:!!F,brand:O,process:R},X),Fe=i(()=>K?wt(n,a):null,[n,a,K]),Ge=i(()=>St(n,e,a),[n,e,a]),Ie=i(()=>dt(n,u,e,a),[n,u.join(","),e,a]),Ve=m((t,h)=>{const l=gt(n.flatMap(Nt),e.tyreSizes[0]??"",t,h);s({...e,tyreSizes:l?[l]:[],page:1})},[n,e,s]),Ee=i(()=>{const t=new Set(w?w.split(","):[]);return!yt(n,c)||t.has("tyreSizes")?null:ut(n,e,a)},[n,e,a,w,c.join(","),f]),S=i(()=>ft(y,e.page,E),[y,e.page,E]),b=ie(c),G=Lt(c),Z=zt(V,le,c,u),ee=c.length===1&&c[0]==="tyre",te=o.applied?.stock??null,N=i(()=>Rt(te),[te]),Ke=i(()=>n.filter(t=>c.includes(z(t))).length,[n,c.join(",")]),oe=$.length===0,je=!oe&&n.length===0,Be=k&&!d&&!o.applied&&!ke;return u.length===0?null:p("section",{children:[k&&r(Ht,{cascade:o.cascade,appliedName:o.appliedName,fit:o.fit,fitSummary:ee&&N.length>0?`Takes ${N.join(" · ")}`:null,resolving:o.resolving,unresolved:ee?!!o.applied&&!o.resolving&&N.length===0:o.unresolved,matchCount:Ke,copy:G,onAmend:_e,onClear:U}),Be&&r(Yt,{cascade:o.cascade,heading:Z.heading,intro:Z.intro,ready:o.restored,copy:G,onSkip:()=>L(!0)}),p("div",{className:"px-5 py-10 md:px-[max(2.5rem,calc((100%_-_var(--sf-content-cap,100%))/2_+_2.5rem))]",children:[(v||P)&&p("header",{className:"mb-6",children:[v&&r(Ut,{level:xe,className:"font-display text-[clamp(28px,4vw,40px)] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] leading-[1.05] tracking-[-0.02em]",children:ot(v,!1)}),P&&r("p",{className:"mt-2 max-w-[60ch] text-[15px] text-fg-dim",children:tt(P)})]}),p("div",{className:"flex flex-col gap-8 lg:flex-row lg:items-start",children:[r(Mt,{facets:Ae,filters:e,typeOptions:Ie,sizeBoxes:Ee,sizeMatches:e.tyreSizes.length>0?y.length:null,noun:b,priceBounds:Fe,inStockCount:me?Ge:null,onToggle:H,onPickType:J,onPickSize:Ve,onPriceMax:Y,onInStockOnly:q,onClearAll:Q,owner:{id:j,facetTemplate:ye},editing:d}),p("div",{className:"min-w-0 flex-1",children:[r(Wt,{className:"mb-4",start:p(We,{children:[r(Dt,{total:S.total,range:{from:S.from,to:S.to},noun:b}),r(Gt,{filters:e,onToggle:H,onPriceMax:Y,onInStockOnly:q,onPickType:J})]}),end:r($t,{value:e.sort,keys:vt(u),labels:Pt,onChange:Ce})}),oe?r("div",{className:"border border-dashed border-line p-10",children:r("p",{className:"font-mono text-[12px] uppercase tracking-[0.16em] text-fg-dim",children:d?b.many==="wheels"?I("No wheels in this website's catalog yet — curate products to see them here."):b.many==="tyres"?I("No tyres in this website's catalog yet — curate products to see them here."):I("No products in this website's catalog yet — curate products to see them here."):"Our catalog is being updated. Please check back shortly."})}):je?p("div",{className:"border border-line p-10",children:[p("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No confirmed fit for your ",o.appliedName]}),r("p",{className:"mt-2 max-w-[52ch] text-[14px] text-fg-dim",children:G.nothingFits}),p("button",{type:"button",onClick:U,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:["Show all ",b.many]})]}):S.total===0?p("div",{className:"border border-line p-10",children:[p("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No ",b.many," match those filters"]}),r("p",{className:"mt-2 max-w-[46ch] text-[14px] text-fg-dim",children:"Try widening the price range or clearing a filter."}),ht(e)&&r("button",{type:"button",onClick:Q,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:"Clear all filters"})]}):p(It,{value:{ownerId:j,ownerType:"AlloyWheelsListing",Template:ge,hover:Se,imageSizes:be,fieldUsage:X,tyreFieldUsage:Le,reserveEyebrow:Re,editing:d,eyebrow:Oe,fit:o.fit,colours:e.finishes,setGridGap:`var(${ne})`,rules:Kt},children:[r("style",{children:ve}),r("div",{className:`plp-card-grid ${D} ${at} ${Qe}`,style:{...we,...ct(`var(${ne})`)},children:r(Vt,{items:S.items,tyreOf:t=>z(t)==="tyre"?t:null,tyreFit:t=>N.length>0?Ot(t.sizes,N):null})})]}),r(Bt,{page:S.page,pageCount:S.pageCount,onPage:Te}),r(Ze,{editing:d})]})]})]})]})}export{Fo as PLP_GATE_DEFAULTS,Zt as default};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SlotComponent } from "efficient-easel/blocks";
|
|
2
|
+
import { type FacetRow } from "../../lib/content/facet-row-seed.js";
|
|
3
|
+
import type { OptionCardRows } from "../../lib/sections/filter-option-rows.js";
|
|
4
|
+
export default function PlpFacetRows({ owner, rows, dead, label, className, editing, }: {
|
|
5
|
+
owner: {
|
|
6
|
+
id: string;
|
|
7
|
+
facetTemplate?: SlotComponent;
|
|
8
|
+
};
|
|
9
|
+
rows: OptionCardRows<FacetRow>;
|
|
10
|
+
dead: readonly boolean[];
|
|
11
|
+
label?: string;
|
|
12
|
+
className: string;
|
|
13
|
+
editing: boolean;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import{CardTemplateRows as n}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as c}from"efficient-web-builder/render/components/SiteGutterFrame";import{COPY_MARK as T}from"../../lib/content/copy-mark.js";import{FACET_TEMPLATE_SLOT as p,FACET_TICK as C,FACET_TICK_INK_CLASS as d,FACET_TICK_VAR as f}from"../../lib/content/facet-row-seed.js";const _={[f]:`url("${C}")`};function u({owner:i,rows:l,dead:a,label:o,className:s,editing:r}){return e("ul",{className:`flex flex-col ${s} ${T} ${d}`,style:_,"aria-label":o,children:e(c,{children:e(n,{ownerId:i.id,ownerType:"AlloyWheelsListing",slot:p,Template:i.facetTemplate,rows:l.items,states:l.states,actions:r?void 0:l.actions,fallback:null,wrapCopy:(t,m)=>e("li",{className:a[m.index]?"-mx-3 opacity-40":"-mx-3",children:t}),children:t=>t})})})}export{u as default};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { SlotComponent } from "efficient-easel/blocks";
|
|
1
2
|
import type { ProductKind } from "../../lib/api/index.js";
|
|
2
3
|
import type { TyreSizePart } from "../../lib/tyres/tyre-size.js";
|
|
3
4
|
import { type PlpFacetGroup, type PlpFacetKey, type PlpFilterState, type PlpTypeOption, type PlpTyreSizeBox } from "../../lib/wheels/plp-filters.js";
|
|
4
|
-
export default function PlpSidebar({ facets, filters, typeOptions, sizeBoxes, sizeMatches, noun, priceBounds, inStockCount, onToggle, onPickType, onPickSize, onPriceMax, onInStockOnly, onClearAll, }: {
|
|
5
|
+
export default function PlpSidebar({ facets, filters, typeOptions, sizeBoxes, sizeMatches, noun, priceBounds, inStockCount, onToggle, onPickType, onPickSize, onPriceMax, onInStockOnly, onClearAll, owner, editing, }: {
|
|
5
6
|
facets: PlpFacetGroup[];
|
|
6
7
|
filters: PlpFilterState;
|
|
7
8
|
typeOptions: PlpTypeOption[];
|
|
@@ -22,4 +23,9 @@ export default function PlpSidebar({ facets, filters, typeOptions, sizeBoxes, si
|
|
|
22
23
|
onPriceMax: (value: number | null) => void;
|
|
23
24
|
onInStockOnly: (value: boolean) => void;
|
|
24
25
|
onClearAll: () => void;
|
|
26
|
+
owner: {
|
|
27
|
+
id: string;
|
|
28
|
+
facetTemplate?: SlotComponent;
|
|
29
|
+
};
|
|
30
|
+
editing?: boolean;
|
|
25
31
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as a,jsxs as r}from"react/jsx-runtime";import z from"../catalog/ClearAllButton.js";import{useState as T}from"react";import{useCurrency as E}from"../CurrencyContext.js";import{useEnglish as F}from"../EnglishVariant.js";import{formatPrice as u}from"../../lib/commerce.js";import{facetRow as A}from"../../lib/content/facet-row-seed.js";import{optionCardRows as _}from"../../lib/sections/filter-option-rows.js";import{hasActivePlpFilters as L,isDeadPlpOption as g,PLP_FACET_LABELS as M}from"../../lib/wheels/plp-filters.js";import R from"./PlpFacetRows.js";import O from"./PlpInStockToggle.js";import D from"./PlpTypePicker.js";import I from"./PlpTyreSizeBoxes.js";function U({facets:o,filters:t,typeOptions:c,sizeBoxes:m,sizeMatches:k,noun:s,priceBounds:n,inStockCount:f,onToggle:N,onPickType:w,onPickSize:P,onPriceMax:S,onInStockOnly:C,onClearAll:$,owner:x,editing:h=!1}){const{currency:y}=E(),p=F(),[d,b]=T({});return r("aside",{className:"-mx-3 w-[calc(100%+1.5rem)] flex-none px-3 lg:sticky lg:[--sf-plp-rail-gap:16px] lg:[--sf-plp-rail-top:calc(var(--sf-header-h,88px)+var(--sf-plp-rail-gap))] lg:top-[var(--sf-plp-rail-top)] lg:max-h-[calc(100svh-var(--sf-plp-rail-top)-var(--sf-plp-rail-gap))] lg:w-[292px] lg:overflow-y-auto lg:overscroll-contain lg:pr-[22px]",children:[r("div",{className:"flex items-center justify-between pb-2",children:[a("h2",{className:"font-display text-[18px] font-medium uppercase tracking-[-0.01em]",children:"Filter"}),L(t)&&a(z,{onClick:$,size:"text-[11px]"})]}),c.length>0&&a("div",{className:"pb-1 pt-1",children:a(D,{options:c,noun:s.many,onPick:w,owner:x,editing:h})}),f!==null&&a("div",{className:"border-t border-line py-2",children:a(O,{checked:t.inStockOnly,count:f,noun:s.many,onChange:C})}),m&&a(v,{label:p(M.tyreSizes),open:!d.tyreSizes,onToggle:()=>b(e=>({...e,tyreSizes:!e.tyreSizes})),children:!d.tyreSizes&&a("div",{className:"pb-3",children:a(I,{boxes:m,composed:t.tyreSizes[0]??"",matches:k,noun:s.many,onPick:P})})}),o.map(e=>{if(e.options.length===0)return null;const i=!d[e.key],j=_(e.options,{item:l=>A(l,l.checked),selected:l=>l.checked,press:l=>()=>N(e.key,l.value),label:l=>`${p(e.label)}: ${l.label} (${l.count} ${s.many})`,disabled:g});return a(v,{label:p(e.label),open:i,onToggle:()=>b(l=>({...l,[e.key]:!l[e.key]})),children:i&&a(R,{owner:x,rows:j,dead:e.options.map(g),label:p(e.label),className:"pb-3",editing:h})},e.key)}),n&&r("div",{className:"border-t border-line py-3",children:[r("span",{className:"font-mono text-[11px] uppercase tracking-[0.2em]",children:["Price · per ",s.one]}),a("input",{type:"range",min:n.min,max:n.max,step:5,value:t.priceMax??n.max,onChange:e=>{const i=Number(e.target.value);S(i>=n.max?null:i)},className:"mt-2 w-full accent-[var(--accent)]","aria-label":`Maximum price per ${s.one}`}),r("div",{className:"mt-1.5 flex justify-between font-mono text-[11px] tabular-nums",children:[a("span",{className:"text-fg-dim",children:u(n.min,y)}),r("span",{children:["Up to ",u(t.priceMax??n.max,y)]})]})]})]})}function v({label:o,open:t,onToggle:c,children:m}){return r("div",{className:"border-t border-line",children:[r("button",{type:"button",onClick:c,"aria-expanded":t,"aria-label":`${t?"Collapse":"Expand"} ${o} filters`,className:"flex w-full cursor-pointer items-center justify-between py-3 text-left",children:[a("span",{className:"font-mono text-[11px] uppercase tracking-[0.2em]",children:o}),a("span",{"aria-hidden":"true",className:`font-mono text-[10px] text-fg-dim transition-transform ${t?"rotate-180":""}`,children:"▾"})]}),m]})}export{U as default};
|