efficient-storefront-blocks 0.65.0 → 0.66.2
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 +59 -0
- package/README.md +0 -1
- package/dist/chunks/EditorPreviewCheckout-HAUEGHGC.js +4 -0
- 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-VEI75RPM.js +1 -0
- 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/consent.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 +2 -4
- 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/CartContext.d.ts +5 -0
- package/dist/render/components/CartContext.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.d.ts +2 -0
- package/dist/render/components/DetailRows.js +1 -1
- package/dist/render/components/Events.d.ts +11 -1
- package/dist/render/components/Events.js +1 -1
- package/dist/render/components/GalleryGrid.d.ts +4 -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/ProductGallery.js +1 -1
- package/dist/render/components/ProductGridSection.js +1 -1
- package/dist/render/components/checkout/CheckoutPageClient.js +3 -3
- package/dist/render/components/fitment/FitmentPickerGrid.js +1 -1
- package/dist/render/components/fitment/PickerField.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicDetailRows.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicGalleryGrid.d.ts +2 -0
- package/dist/render/components/pdp-dynamic/DynamicGalleryGrid.js +1 -1
- package/dist/render/components/pdp-dynamic/RecordPhotoGallery.d.ts +12 -0
- package/dist/render/components/pdp-dynamic/RecordPhotoGallery.js +1 -0
- package/dist/render/lib/api/types.d.ts +1 -0
- package/dist/render/lib/checkout/match-subdivision.d.ts +2 -0
- package/dist/render/lib/checkout/match-subdivision.js +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 +0 -1
- package/dist/render/lib/consent/rules.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/GalleryB/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/GalleryItem/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/Events/render.js +1 -1
- package/dist/render/lib/puck/blocks/text-part-shapes.json +6 -3
- package/dist/render/lib/puck/current-record.d.ts +1 -0
- package/dist/render/lib/puck/current-record.js +1 -1
- 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/sections/own-padding.d.ts +3 -0
- package/dist/render/lib/sections/own-padding.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 +3 -4
- package/dist/words.js +2 -2
- package/package.json +1 -1
- package/dist/chunks/EditorPreviewCheckout-4KZCYPQT.js +0 -4
- package/dist/chunks/chunk-GR7OHU32.js +0 -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
|
|
|
@@ -36,6 +36,10 @@ export interface AppliedCoupon {
|
|
|
36
36
|
message?: string;
|
|
37
37
|
effects?: CouponEffects;
|
|
38
38
|
}
|
|
39
|
+
export interface QuoteDestination {
|
|
40
|
+
country: string;
|
|
41
|
+
subdivision: string;
|
|
42
|
+
}
|
|
39
43
|
interface CartCtx {
|
|
40
44
|
isOpen: boolean;
|
|
41
45
|
preview: boolean;
|
|
@@ -59,6 +63,7 @@ interface CartCtx {
|
|
|
59
63
|
refuseCoupon: (message: string) => void;
|
|
60
64
|
couponBusy: boolean;
|
|
61
65
|
deliveryOptions: DeliveryOption[];
|
|
66
|
+
setQuoteDestination: (dest: QuoteDestination | null) => void;
|
|
62
67
|
shippingMethodId: string | null;
|
|
63
68
|
setShippingMethodId: (id: string) => void;
|
|
64
69
|
totals: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as We}from"react/jsx-runtime";import{createContext as ke,useCallback as i,useContext as Qe,useEffect as g,useMemo as pe,useRef as A,useState as d}from"react";import{products as E}from"../lib/api/index.js";import{couponDeferredToCheckout as ve}from"../lib/cart/coupon-preview.js";import{snapshotCartLines as He}from"../lib/cart/snapshot-lines.js";import{MAX_QTY_PER_LINE as he,orderLinesForSets as Ve,setPrice as je}from"../lib/commerce.js";import{UNPRICED_LABEL as Fe}from"../lib/wheels/price-display.js";import{isValidEmail as ze}from"../lib/email-shape.js";import{trackAddToCart as Je}from"../lib/google-tag.js";import{shippingStatus as Xe}from"../lib/cart/shipping-status.js";import{useCurrency as Ye}from"./CurrencyContext.js";const Ge=400,Ke=400,Ze=1500;function ye(c){return(c.components?.length??0)>0}function Ce(c,s){return{code:c,valid:s.valid,deferred:ve(s,s.askedAsShopper),message:s.message||void 0,effects:s.effects??void 0}}function ge(c,s){return je(c.components,s)}function L(c,s){const r=ge(c,s);return r===null?null:r*c.qty}function Ee(c){return c!=="tyre"}const Ne=ke(null);function lt({children:c,preview:s=!1}){const{currency:r,country:W,formatMoney:be}=Ye(),[k,D]=d(s),[a,M]=d([]),[Q,Te]=d([]),[v,Be]=d([]),[H,Me]=d(!1),[V,Ie]=d(!1),[xe,Oe]=d(!1),[Se,_e]=d(!1),[m,j]=d(null),[F,z]=d(void 0),[I,qe]=d(null),[u,y]=d(null),[J,x]=d(!1),[p,X]=d(null),O=A(void 0),N=i(()=>D(!0),[]),Y=i(()=>D(!1),[]),G=i(()=>D(e=>!e),[]);g(()=>{s||typeof window>"u"||new URLSearchParams(window.location.search).get("cart")==="open"&&N()},[N,s]);const K=i(e=>{qe(t=>t?.country===e?.country&&t?.subdivision===e?.subdivision?t:e)},[]),Z=i(e=>{_e(!0),Ee(e)&&Oe(!0)},[]),$=xe||a.some(e=>Ee(e.kind)),ee=Se||a.length>0;g(()=>{if(s||!$||H)return;let e=!0;return E.listWheels().then(t=>{e&&(Te(t),Me(!0))}),()=>{e=!1}},[s,$,H]),g(()=>{if(s||!ee||V)return;let e=!0;return E.listBundles().then(t=>{e&&(Be(t),Ie(!0))}),()=>{e=!1}},[s,ee,V]);const C=m?.deliveryOptions??[];g(()=>{m&&X(e=>e&&C.some(t=>t.id===e)?e:C[0]?.id??null)},[m]);const S=i(()=>a.filter(ye).flatMap(e=>Ve(e.components,e.qty)),[a]),te=i(async(e,t)=>{const o=e.trim().toUpperCase();if(!o)return;const n=S();if(n.length===0){y({code:o,valid:!1,message:"Add a wheel to the cart first."});return}x(!0),O.current=t;try{const l=await E.validateCoupon({code:o,items:n,currency:r,shippingMethodId:p??void 0,customerEmail:t});y(Ce(o,l))}catch{y({code:o,valid:!1,message:"Could not check that code. Please try again."})}finally{x(!1)}},[S,r,p]),ne=i(()=>{y(null),O.current=void 0},[]),oe=i(e=>{if(!u)return;const{code:t}=u;y(o=>o&&o.code===t?{code:t,valid:!1,refused:!0,message:e}:o)},[u]);g(()=>{if(!u||u.refused)return;const e=u.code,t=n=>n!==null&&n.code===e&&!n.refused,o=setTimeout(async()=>{const n=S();if(n.length===0){y(l=>t(l)?{code:e,valid:!1,message:"Add a wheel to the cart first."}:l);return}x(!0);try{const l=await E.validateCoupon({code:e,items:n,currency:r,shippingMethodId:p??void 0,customerEmail:O.current});y(B=>t(B)?Ce(e,l):B)}catch{}finally{x(!1)}},Ge);return()=>clearTimeout(o)},[a,r,p]);const P=u&&!u.refused?u.code:void 0;g(()=>{if(s)return;let e=!0;const t=setTimeout(async()=>{const o=S();if(o.length===0){j(null),z(void 0);return}try{const n=await E.quoteCart({items:o,currency:r,shippingMethodId:p??void 0,couponCode:P,customerEmail:O.current||void 0,country:I?.country||W||void 0,subdivision:I?.country&&I.subdivision||void 0});if(!e)return;j(n)}catch{if(!e)return}z(P)},Ke);return()=>{e=!1,clearTimeout(t)}},[a,r,p,P,W,I]);const _=i(e=>{M(t=>{const o=t.findIndex(n=>n.id===e.id);return o===-1?[...t,e]:t.map((n,l)=>l===o?{...n,qty:Math.min(he,n.qty+e.qty)}:n)}),Je(e,r)},[r]),se=i(e=>{M(t=>t.filter(o=>o.id!==e))},[]),re=i((e,t)=>{const o=Math.max(1,Math.min(he,t));M(n=>n.map(l=>l.id===e?{...l,qty:o}:l))},[]),ue=i(e=>{M(e)},[]),[T,Ae]=d(null),ie=A(null);ie.current=T;const h=A(null),U=A(""),ce=i((e,t)=>{const o=e.trim().toLowerCase();ze(o)&&Ae(n=>n&&n.email===o&&n.firstName===(t??"")?n:{email:o,firstName:t??""})},[]);g(()=>{if(s||!T)return;const e=He(a.filter(ye),n=>L(n,r)===null?Fe:be(L(n,r),r)),t={email:T.email,firstName:T.firstName,currency:r,items:e},o=JSON.stringify(t);if(o!==U.current)return h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{h.current=null,U.current=o,E.captureCart(t).catch(n=>{process.env.NODE_ENV!=="production"&&console.warn("abandoned-cart capture failed",n)})},Ze),()=>{h.current&&(clearTimeout(h.current),h.current=null)}},[a,T,r,s]);const ae=i(()=>{h.current&&(clearTimeout(h.current),h.current=null);const e=ie.current;e&&(U.current="",E.captureCart({email:e.email,firstName:e.firstName,currency:r,items:[]}).catch(t=>{process.env.NODE_ENV!=="production"&&console.warn("abandoned-cart clear failed",t)}))},[r]),le=pe(()=>{const e=a.reduce((f,b)=>{const q=L(b,r);return q===null?f:f+q},0),t=a.some(f=>ge(f,r)===null),o=a.reduce((f,b)=>f+b.qty,0),n=u?.valid?u.effects:void 0,l=n?Math.min(e,Number(n.discountAmount)):0,B=m?.bundleDiscount??0,Pe=m?.appliedBundles??[],w=!!n?.freeShipping,fe=C.find(f=>f.id===p),me=w?0:m?.shipping??fe?.amount??0,Ue=Xe({quoted:m!==null,optionCount:C.length,chosenAmount:fe?.amount,couponWaivesFreight:w}),R={};for(const f of n?.freeUnits??[])R[f.partNumber]=(R[f.partNumber]??0)+f.quantity;const we=m?.tax??null,Re=m?m.grandTotal:e-l-B+me;return{sets:o,units:a.reduce((f,b)=>f+(b.components??[]).reduce((q,Le)=>q+Le.wheels*b.qty,0),0),subtotal:e,hasUnpricedLine:t,discount:l,bundleDiscount:B,appliedBundles:Pe,shipping:me,freeShipping:w,shippingStatus:Ue,freeUnitsByPartNumber:R,tax:we,grand:Re,repricing:!!u?.refused&&m!==null&&F===u?.code,currency:r}},[a,r,u,C,p,m,F]),de=i(e=>{_(e),N()},[_,N]),De=pe(()=>({isOpen:k,preview:s,open:N,close:Y,toggle:G,items:a,catalog:Q,bundles:v,warmCatalog:Z,add:_,addAndOpen:de,remove:se,setQty:re,replaceItems:ue,identify:ce,clearCapturedCart:ae,coupon:u,applyCoupon:te,removeCoupon:ne,refuseCoupon:oe,couponBusy:J,deliveryOptions:C,setQuoteDestination:K,shippingMethodId:p,setShippingMethodId:X,totals:le}),[k,s,N,Y,G,a,Q,v,Z,_,de,se,re,ue,ce,ae,u,te,ne,oe,J,C,K,p,le]);return We(Ne.Provider,{value:De,children:c})}function dt(){const c=Qe(Ne);if(!c)throw new Error("useCart() must be called inside <CartProvider>. Mount the provider in app/layout.tsx.");return c}export{lt as CartProvider,ye as isOrderable,L as lineTotal,dt as useCart};
|
|
@@ -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 A}from"react/jsx-runtime";import T from"./SectionBand.js";import{useEffect as C,useState as M}from"react";import{OTHER_REASON_ID as y}from"efficient-web-builder/format/lib/content/contact";import{FormFieldInput as ee,FormHoneypot as ne,successMessageFor as te,useBoundForm as ae,useFormSubmission as re}from"./formSubmission.js";import le from"efficient-web-builder/render/components/SectionEyebrow";import oe,{FieldCaption as ie}from"./WebFormField.js";import{scrollBehavior as se}from"efficient-web-builder/render/components/useReducedMotion";import{renderChrome as L,renderGold as $,renderHeadline as ce,splitParagraphs as de}from"efficient-web-builder/render/components/goldPhrases";import{say as q}from"efficient-web-builder/format/lib/editor-words";import{phoneHref as me}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(f){if(f.href)return f.href;const o=(f.value??"").trim();if(o.includes("@"))return`mailto:${o}`;if(/^\+?[\d\s().-]{6,}$/.test(o))return me(o)}function pe(f){const o=[],d=new Map;for(const r of f){if(!r.groupId){o.push(r);continue}const m=r.value.trim().toLowerCase(),u=d.get(m);if(u)u.label=`${u.label} · ${r.label}`;else{const b={...r};d.set(m,b),o.push(b)}}return o}function fe(f,o,d){const r=m=>String(m??"").trim().toLowerCase();for(const m of f?.fields??[]){if(m.type!=="select"||!Array.isArray(m.options))continue;const u=m.options.map(String);if(!o.some(s=>u.some(p=>r(p)===r(s.title))))continue;const b=s=>r(s===y?d:o.find(p=>p.id===s)?.title);return{key:m.key,optionFor:s=>u.find(p=>r(p)===b(s)&&b(s)!==""),idFor:s=>{const p=o.find(S=>r(S.title)===r(s));return p?p.id:d&&r(s)===r(d)?y: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 xe({routingNumber:f,routingTagline:o,groups:d,formNumber:r,formHeading:m,metaLines:u,showOther:b=!0,otherLabel:s="Other",otherNoteTitle:p,otherNoteBody:S,buttonText:O,consent:R,channels:V,formSlug:_,form:D,editing:w,initialActiveId:v,onActiveChange:H,reasonExtras:G}){const k=[...d.map(e=>e.id),...b?[y]:[]],W=v&&k.includes(v)?v:k[0]??y,[g,j]=M(W);C(()=>{k.includes(g)||j(k[0]??y)},[k.join("|")]),C(()=>{v&&k.includes(v)&&j(v)},[v]);const h=ae(_,D),c=re({form:h,formSlug:_,editing:w}),x=fe(h,d,b?s:void 0),z=e=>{j(e),I(null);const a=x?.optionFor(e);x&&a!==void 0&&c.set(x.key,a),H?.(e)};C(()=>{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=h===void 0,E=!!h||!!w,[K,Q]=M(!1);C(()=>{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()},[]);const U=d.length>0||!!w;return l(A,{children:[U&&l(T,{className:"border-b border-line py-[60px]",style:K?void 0:{background:"var(--section-bg)"},children:[(f||o)&&l("div",{className:"mb-6 flex items-center gap-6 border-b border-line pb-6",children:[f&&n(le,{text:f}),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:d.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:se(),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)}),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:ce(m,!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))})]}),h?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:te(h,"Thanks — we've received your message.")}):l("form",{className:"grid grid-cols-2 gap-5 max-[700px]:grid-cols-1",onSubmit:c.handleSubmit,children:[h.fields.map(e=>n(oe,{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(ee,{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&&(j(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(ie,{required:!0,children:"Reason"}),l("div",{className:"mt-1 flex flex-wrap gap-2",children:[d.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(y),className:[`cursor-pointer border px-4 py-3 font-mono ${t.labelSmall} uppercase tracking-[0.2em] transition-colors`,g===y?"border-accent bg-accent text-bg":"border-line text-fg-dim hover:text-fg"].join(" "),children:L(s)})]})]}),G?.(g),g===y&&(p||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:[p&&n("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.24em] text-accent`,children:$(p)}),S&&de(S).map((e,a)=>n("p",{className:`font-display ${t.body} leading-[1.55] text-fg-dim`,children:$(e)},a))]}),n(ne,{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:[R&&n("span",{className:`max-w-[380px] font-mono ${t.labelSmall} uppercase leading-[1.6] tracking-[0.18em] text-fg-dim`,children:$(R)}),n("button",{type:w?"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),F=!!!e.groupId;return l("div",{onClick:F?()=>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",F?"cursor-pointer border-t-2 border-t-accent":"",i?"border-l-accent pl-6":F?"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&&!!h&&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}),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`,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:pe(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,xe as default,B as fieldClass,pe as mergeChannelsForPhone,fe 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 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
|
|
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 d}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:o,editing:v=!1}){const a=u==="narrow",y=typeof c=="number"?c:100,w=typeof o=="number"?o: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:d("Row {n}",{n:1})},{tag:d("Row {n}",{n:2})},{tag:d("Row {n}",{n:3})}]:[];return g.length===0?null:t(j,{className:"relative z-[2] border-b border-line bg-bg",style:{paddingTop:y,paddingBottom:w},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:[e.media?t("div",{className:"w-full",children:e.media}):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};
|
|
@@ -2,7 +2,15 @@ import { type EventPost } from "efficient-web-builder/render/components/PostCard
|
|
|
2
2
|
export type { EventPost };
|
|
3
3
|
export type EventCard = EventPost & {
|
|
4
4
|
href?: string;
|
|
5
|
+
facets?: CardFacets;
|
|
5
6
|
};
|
|
7
|
+
export type CardFacets = Readonly<Record<string, string | readonly string[]>>;
|
|
8
|
+
export declare function readFacets(value: unknown): CardFacets | undefined;
|
|
9
|
+
export declare function facetChoices(cards: readonly EventCard[]): {
|
|
10
|
+
label: string;
|
|
11
|
+
values: string[];
|
|
12
|
+
}[];
|
|
13
|
+
export declare function matchesFacets(card: EventCard, chosen: Readonly<Record<string, string>>): boolean;
|
|
6
14
|
export declare const EVENTS_LAYOUT_FEATURED = "featured";
|
|
7
15
|
export declare const EVENTS_LAYOUT_TABS = "tabs";
|
|
8
16
|
export declare const EVENTS_LAYOUT_PORTRAIT = "portrait";
|
|
@@ -57,6 +65,8 @@ export interface EventsProps {
|
|
|
57
65
|
cardImage?: number | null;
|
|
58
66
|
omitHead?: boolean;
|
|
59
67
|
nameFilter?: boolean;
|
|
68
|
+
padTop?: number;
|
|
69
|
+
padBottom?: number;
|
|
60
70
|
}
|
|
61
71
|
export declare function matchesName(title: string, typed: string): boolean;
|
|
62
|
-
export default function Events({ num, title, link, posts, columns, limit, showAll, editing, cardImage, gap: gapProp, layout, featuredWidth, listCover, featuredDarken, omitHead, sample, nameFilter, }: EventsProps): import("react").JSX.Element | null;
|
|
72
|
+
export default function Events({ num, title, link, posts, columns, limit, showAll, editing, cardImage, gap: gapProp, layout, featuredWidth, listCover, featuredDarken, omitHead, sample, nameFilter, padTop, padBottom, }: EventsProps): import("react").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n,jsxs as l}from"react/jsx-runtime";import{useId as xe,useState as K}from"react";import{containerGapProps as ge}from"efficient-web-builder/format/lib/content/container-gap";import ue from"efficient-web-builder/render/components/SectionHeader";import F from"efficient-web-builder/render/components/PostCard";import he from"efficient-web-builder/render/components/Placeholder";import{SiteLink as z}from"efficient-web-builder/render/lib/site-runtime";import{renderGold as x,renderHeadline as v}from"efficient-web-builder/render/components/goldPhrases";import{say as N}from"efficient-web-builder/format/lib/editor-words";import{cardImageShapeTokens as be}from"efficient-web-builder/format/lib/content/card-image-shape";import{SITE_COLUMN as G}from"efficient-web-builder/format/lib/content/page-width";import{fillRowCss as ve}from"../lib/sections/fill-row.js";import{headIsEmpty as Ne,ownPadding as Ee}from"../lib/sections/own-padding.js";function tt(t){if(!t||typeof t!="object"||Array.isArray(t))return;const a={};for(const[e,s]of Object.entries(t))if(e.trim()){if(typeof s=="string")s.trim()&&(a[e]=s.trim());else if(Array.isArray(s)){const o=s.filter(c=>typeof c=="string"&&!!c.trim()).map(c=>c.trim());o.length&&(a[e]=o)}}return Object.keys(a).length?a:void 0}function H(t,a){const e=t.facets?.[a];return e===void 0?[]:typeof e=="string"?[e]:e}const ye=new Intl.Collator("en",{numeric:!0,sensitivity:"base"});function Te(t){const a=[],e=new Map;for(const s of t)for(const o of Object.keys(s.facets??{})){e.has(o)||(a.push(o),e.set(o,new Set));for(const c of H(s,o))e.get(o).add(c)}return a.map(s=>({label:s,values:[...e.get(s)].sort(ye.compare)}))}function _e(t,a){return Object.entries(a).every(([e,s])=>s===""||H(t,e).includes(s))}const W=3,J="featured",X="tabs",q="portrait",u="spread",Q="count",nt=[{label:"Even grid",value:"even"},{label:"Featured first",value:J},{label:"Tabs",value:X},{label:"Photo cards",value:q},{label:"Staggered spread",value:u},{label:"Count",value:Q}],Ae=[q,u],at="even",k={min:2,max:11,step:1,fallback:7,unit:"of 12"},Le="bottom-left",Ce=55,Oe="bottom";function Se(t){const a=typeof t=="number"?t:Number.parseFloat(String(t??"")),e=Number.isFinite(a)?Math.min(k.max,Math.max(k.min,Math.round(a))):k.fallback;return`${e}fr ${12-e}fr`}const Z={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"},ee={2:"grid-cols-2",3:"grid-cols-3 max-[800px]:grid-cols-2",4:"grid-cols-4 max-[1100px]:grid-cols-3 max-[800px]:grid-cols-2"},$e="Find by name",we="Nobody by that name.",Fe="Nobody matches.",ze="Any";function ke(t,a){const e=o=>o.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLocaleLowerCase().trim(),s=e(a);return s===""||e(t).includes(s)}function te({typed:t,onType:a,wide:e=!1}){return l("label",{className:`flex max-w-[360px] flex-col gap-1.5${e?" w-full":""}`,children:[n("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:$e}),n("input",{type:"search",value:t,onChange:s=>a(s.target.value),autoComplete:"off",className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent"})]})}function Re({card:t,scaffold:a,lower:e=!1}){return l(z,{href:t.href||"#",className:`sf-card group relative isolate flex aspect-[3/4] overflow-hidden bg-surface${e?" min-[801px]:mt-16":""}`,"aria-disabled":a||void 0,tabIndex:a?-1:void 0,children:[n("div",{className:"absolute inset-0 transition-transform duration-700 group-hover:scale-[1.03] motion-reduce:transition-none motion-reduce:group-hover:scale-100",children:n(he,{label:`card-${t.slug}`,src:t.cover||void 0,sizes:"(max-width: 800px) 50vw, 25vw"})}),n("div",{"aria-hidden":!0,className:"absolute inset-0 z-0",style:{background:"linear-gradient(180deg, transparent 45%, color-mix(in srgb, var(--bg) 88%, transparent) 100%)"}}),t.meta&&n("span",{className:"absolute left-3 top-3 z-[1] rounded-[var(--sf-button-radius,999px)] bg-bg/85 px-2.5 py-1 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.16em] text-accent",children:x(t.meta)}),l("div",{className:"relative z-[1] mt-auto flex w-full flex-col gap-1 p-4 max-[800px]:p-3",children:[n("h3",{className:"font-heading3 text-[length:var(--size-headingSmall,24px)] leading-[1.1] tracking-[-0.01em] text-fg",children:v(t.title,!1)}),t.dateLabel&&n("p",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em] text-accent",children:x(t.dateLabel)}),t.excerpt&&n("p",{className:"line-clamp-2 text-[length:var(--size-body,14px)] leading-[1.45] text-fg-dim",children:x(t.excerpt)})]})]})}function Ie({cards:t,scaffold:a}){return n("nav",{"aria-label":"Days",className:"-mx-1 [scrollbar-width:none] max-[800px]:overflow-x-auto [&::-webkit-scrollbar]:hidden",children:n("ul",{className:"flex flex-wrap gap-2 px-1 pb-1 max-[800px]:min-w-max max-[800px]:flex-nowrap",children:t.map((e,s)=>{const o=!!e.meta;return n("li",{children:l(z,{href:e.href||"#","aria-current":o?"page":void 0,"aria-disabled":a||void 0,tabIndex:a?-1:void 0,className:`flex flex-col gap-0.5 rounded-[var(--sf-button-radius,999px)] border px-5 py-2.5 transition-colors ${o?"border-accent bg-accent text-accent-ink":"border-line text-fg hover:border-accent hover:text-accent"}`,children:[n("span",{className:"font-heading3 text-[length:var(--size-body,15px)] leading-[1.2]",children:v(e.title,!1)}),e.excerpt&&n("span",{className:`font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.14em] ${o?"opacity-80":"text-fg-dim"}`,children:x(e.excerpt)})]})},`${e.slug}-${s}`)})})})}function Ue({count:t,words:a,href:e}){const s=l("span",{className:"inline-flex items-baseline gap-3",children:[n("span",{className:"font-heading text-[length:var(--size-headingLarge,64px)] leading-none text-accent",children:t}),a!==void 0&&n("span",{className:"font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg",children:a})]});return e?n(z,{href:e,className:"inline-flex hover:opacity-85",children:s}):s}const Me="relative z-[2] bg-bg py-[120px] max-[800px]:py-[70px]",De="relative z-[2] bg-bg pt-0 pb-[120px] max-[800px]:pt-0 max-[800px]:pb-[70px]",Pe="relative z-[2] bg-bg py-[32px] max-[800px]:py-[24px]";function je({num:t,title:a,link:e,posts:s,columns:o,limit:c,showAll:E=!1,editing:y=!1,cardImage:ne,gap:ae,layout:f,featuredWidth:se,listCover:re=!0,featuredDarken:oe,omitHead:h=!1,sample:T,nameFilter:le=!1,padTop:ce,padBottom:ie}){const[_,R]=K(""),[I,de]=K({}),A=`ev-${xe().replace(/:/g,"")}`,U=s??[],M=E?U.length:typeof c=="number"&&c>0?c:W,L=U.slice(0,M),m=y&&L.length===0;if(L.length===0&&!y)return null;const D=E?W:M,i=m?T?.length?T.slice(0,E?T.length:D):Array.from({length:D},(r,d)=>({slug:`placeholder-${d}`,title:N("Blog post title"),excerpt:N("A short summary of the post appears here."),cover:"",meta:N("Journal"),dateLabel:N("Date")})):L,p=ge("Events",ae,"both"),C=f===J&&i.length>1,pe=Se(se),O=f===X,P=f===Q,j=Ae.includes(f??""),S=le&&!O&&!P&&!C,$=S?Te(i):[],b=S?i.filter(r=>ke(r.title,_)&&_e(r,I)):i,w=Ee(ce,ie),fe=!y&&Ne(t,a,e?.text),V=f===u?"grid-cols-3 max-[800px]:grid-cols-2":ee[Math.min(4,Math.max(2,o??3))]??ee[3],Y=Z[Math.min(4,Math.max(1,o??3))]??Z[3],B=O||C||f===u?"":ve(A,j?V:Y,{cards:b.length});return P?n("section",{className:Pe,style:Object.keys(w).length?w:void 0,children:n("div",{className:G,children:n(Ue,{count:i.length,words:h||a===void 0?void 0:v(a,!1),href:h?void 0:e?.href})})}):n("section",{className:h?De:Me,style:{...be(ne),...w},children:l("div",{className:G,children:[h||fe?null:n(ue,{num:t!==void 0?x(t):void 0,title:a!==void 0?v(a,!1):void 0,link:e?{text:x(e.text),href:e.href}:void 0}),S&&l("div",{className:"mb-6 flex flex-col gap-2",children:[$.length===0?n(te,{typed:_,onType:R}):l("div",{className:"flex flex-wrap items-end gap-3",children:[n(te,{typed:_,onType:R,wide:!0}),$.map(({label:r,values:d})=>l("label",{className:"flex min-w-[140px] flex-col gap-1.5 max-[800px]:flex-1",children:[n("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:r}),l("select",{value:I[r]??"",onChange:g=>de(me=>({...me,[r]:g.target.value})),className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent",children:[n("option",{value:"",children:ze}),d.map(g=>n("option",{value:g,children:g},g))]})]},r))]}),b.length===0&&n("p",{role:"status",className:"text-[length:var(--size-body,14px)] text-fg-dim",children:$.length===0?we:Fe})]}),B&&n("style",{children:B}),O?n(Ie,{cards:i,scaffold:m}):j?n("div",{className:`${A} sf-card-grid grid${p.className} ${V}`,style:p.style,children:b.map((r,d)=>n(Re,{card:r,scaffold:m,lower:f===u&&d%3===1},`${r.slug}-${d}`))}):C?l("div",{className:`sf-card-grid grid grid-cols-[var(--sf-events-split)] max-[800px]:grid-cols-1${p.className}`,style:{...p.style,"--sf-events-split":pe},children:[n(F,{post:i[0],href:i[0].href,scaffold:m,layout:"cover",darken:oe??Ce,darkenStyle:Oe,placement:Le},`${i[0].slug}-0`),n("div",{className:`grid auto-rows-min${p.className}`,style:p.style,children:i.slice(1).map((r,d)=>n(F,{post:r,href:r.href,scaffold:m,showCover:re},`${r.slug}-${d+1}`))})]}):n("div",{className:`${A} sf-card-grid grid${p.className} ${Y}`,style:p.style,children:b.map((r,d)=>n(F,{post:r,href:r.href,scaffold:m},`${r.slug}-${d}`))})]})})}export{k as EVENTS_FEATURED_WIDTH,nt as EVENTS_LAYOUTS,Q as EVENTS_LAYOUT_COUNT,at as EVENTS_LAYOUT_FALLBACK,J as EVENTS_LAYOUT_FEATURED,q as EVENTS_LAYOUT_PORTRAIT,u as EVENTS_LAYOUT_SPREAD,X as EVENTS_LAYOUT_TABS,Ae as EVENTS_PHOTO_LAYOUTS,je as default,Te as facetChoices,_e as matchesFacets,ke as matchesName,tt as readFacets};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { SlotComponent } from "efficient-easel/blocks";
|
|
2
2
|
export interface GalleryGridProps {
|
|
3
3
|
omitHead?: boolean;
|
|
4
|
+
padTop?: number;
|
|
5
|
+
padBottom?: number;
|
|
6
|
+
editing?: boolean;
|
|
4
7
|
items?: SlotComponent;
|
|
5
8
|
num?: string;
|
|
6
9
|
title?: string;
|
|
@@ -17,4 +20,4 @@ export interface GalleryGridProps {
|
|
|
17
20
|
layout?: string;
|
|
18
21
|
gap?: number | string;
|
|
19
22
|
}
|
|
20
|
-
export default function GalleryGrid({ items: Items, num, title, linkText, linkHref, galleryHref, submitHref, previewHover, display, displayPhone, styleOwner, layout, columns, columnsMobile, gap: gapProp, omitHead, }: GalleryGridProps): import("react").JSX.Element;
|
|
23
|
+
export default function GalleryGrid({ items: Items, num, title, linkText, linkHref, galleryHref, submitHref, previewHover, display, displayPhone, styleOwner, layout, columns, columnsMobile, gap: gapProp, omitHead, padTop, padBottom, editing, }: GalleryGridProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as I}from"react/jsx-runtime";import{usePathname as M}from"next/navigation";import{containerGapProps as R}from"efficient-web-builder/format/lib/content/container-gap";import j from"efficient-web-builder/render/components/Btn";import{GALLERY_GRID_ATTR as z,GalleryLinksContext as A}from"./GalleryItem.js";import{useSiteSells as $}from"./SiteRecordContext.js";import{SharedPartKinds as k}from"efficient-web-builder/render/components/PublishedPartStylesContext";import{renderHeadline as B}from"efficient-web-builder/render/components/goldPhrases";import O from"efficient-web-builder/render/components/SectionHeader";import{headIsEmpty as T,ownPadding as F}from"../lib/sections/own-padding.js";import{resolveGridColumns as K,resolveGridMobileColumns as D}from"efficient-web-builder/format/lib/content/grid-span";import{galleryLayoutClass as U,galleryLayoutCss as W,resolveGalleryLayout as X}from"efficient-web-builder/format/lib/content/gallery-layout";const Y="relative z-[2] bg-bg py-[120px] max-[800px]:py-[70px]",q="relative z-[2] bg-bg pt-0 pb-[120px] max-[800px]:pt-0 max-[800px]:pb-[70px]",H="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 J({items:i,num:o,title:a,linkText:n,linkHref:x,galleryHref:r="/gallery",submitHref:g="/contact",previewHover:f,display:y,displayPhone:h,styleOwner:u,layout:d,columns:t,columnsMobile:v,gap:N,omitHead:m=!1,padTop:G,padBottom:L,editing:S=!1}){const _=M(),b=$(),E=r!==_&&(b||r!=="/gallery"),p=X(d),l=p?d:null,w=!p&&t!=null&&t!=="",s=R("GalleryB",N,"both"),C=l?{className:`sf-card-grid sf-gallery-zone ${U(l)} grid${s.className}`,style:s.style}:w?{className:`sf-card-grid sf-grid-zone grid${s.className}`,style:{...s.style,"--sf-grid-cols":String(K(t)),"--sf-grid-cols-phone":String(D(v,t))}}:{className:`sf-card-grid grid grid-cols-4${s.className} max-[1500px]:grid-cols-3 max-[800px]:grid-cols-1`,style:s.style},c=n?{text:n,href:x||"#"}:void 0,P=a?B(a,!1):void 0;return e("section",{className:m?q:Y,style:F(G,L),children:I("div",{className:H,children:[m||!S&&T(o,a,c?.text)?null:e(O,{num:o,title:P,link:c}),l&&e("style",{dangerouslySetInnerHTML:{__html:W(l)}}),i&&e(A.Provider,{value:{galleryHref:r,submitHref:g,previewHover:f,display:y,displayPhone:h,styleOwner:u},children:e(k,{children:e("div",{[z]:"",style:{display:"contents"},children:e(i,{...C,minEmptyHeight:320})})})}),E&&e("div",{className:"mt-12 flex flex-col items-center gap-3",children:e(j,{href:r,variant:"ghost",children:"See Gallery"})})]})})}export{J 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 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};
|