efficient-storefront-blocks 0.125.21 → 0.125.23
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 +11 -0
- package/dist/editor/lib/document/blocks/service/SiteHeader/fields.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +3 -0
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/index.js +26 -26
- package/dist/render/app/globals.css +76 -0
- package/dist/render/components/CountrySelect.js +1 -1
- package/dist/render/components/GridCardTemplate.d.ts +3 -0
- package/dist/render/components/GridCardTemplate.js +1 -1
- package/dist/render/components/HeaderTools.d.ts +7 -0
- package/dist/render/components/HeaderTools.js +1 -1
- package/dist/render/components/PhoneSheet.js +1 -1
- package/dist/render/components/SectionGroupBody.d.ts +3 -1
- package/dist/render/components/SectionGroupBody.js +1 -1
- package/dist/render/lib/content/header-bar.d.ts +30 -0
- package/dist/render/lib/content/header-bar.js +1 -1
- package/dist/render/lib/document/blocks/service/SiteHeader/render.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/dist/words.d.ts +3 -0
- package/dist/words.js +1 -1
- package/package.json +1 -1
|
@@ -4340,6 +4340,82 @@ em.text-accent {
|
|
|
4340
4340
|
);
|
|
4341
4341
|
}
|
|
4342
4342
|
|
|
4343
|
+
/* ─── "Card ground: Studio" (Product Grid; INOVIT home design 2026-11-18) ───
|
|
4344
|
+
The card's picture as the approved home design draws it: a 10:13 picture
|
|
4345
|
+
on a soft grey ellipse, the wheel a little below its middle, and a shadow
|
|
4346
|
+
on the floor under the wheel (not round it); the card itself has no
|
|
4347
|
+
surface, so its words stand on the page under the picture. A choice of
|
|
4348
|
+
the grid (GridCardTemplate `CARD_GROUNDS`); Flat (the default) and Soft
|
|
4349
|
+
grey never draw this class, so no card that exists moves.
|
|
4350
|
+
The ground is on the PICTURE's box (the box that holds the Picture part,
|
|
4351
|
+
found by what it holds, as "Words: Over the picture" finds it), and the
|
|
4352
|
+
wheel is placed in that box: the well between them steps aside
|
|
4353
|
+
(`position: static`), so a Show next image layer covers the whole picture.
|
|
4354
|
+
The numbers are the design file's own (mockups/inovit-home-top-2026-11-18,
|
|
4355
|
+
`.pph`, `.st`, `.s1`, `.s2`), written in the box's width (`cqw`): the
|
|
4356
|
+
wheel is 77% of the box wide, 11.5% in from the left and 22% of the box's
|
|
4357
|
+
height down. The two floor shadows sit at the wheel's foot; their blur is
|
|
4358
|
+
the design's px. The box's Padding row stays the merchant's: at 0 the
|
|
4359
|
+
picture is edge to edge, as designed.
|
|
4360
|
+
The greys are the ground with a little of the text mixed in (3.6%, 8.5%,
|
|
4361
|
+
11.5%: on a white page with near-black text, the design's #f6, #eb, #e4),
|
|
4362
|
+
and the shadows are the text colour, faded. They are mixed on the card,
|
|
4363
|
+
so a card in a themed section mixes that section's colours, and no colour
|
|
4364
|
+
is typed. The shadows sit under the box's children (`isolation` and
|
|
4365
|
+
z-index -1). */
|
|
4366
|
+
.sf-card-ground-studio,
|
|
4367
|
+
.sf-card-ground-studio:hover {
|
|
4368
|
+
background-color: transparent;
|
|
4369
|
+
}
|
|
4370
|
+
.sf-card-ground-studio [data-part="box"]:has(> * > [data-part="image-block"]) {
|
|
4371
|
+
position: relative;
|
|
4372
|
+
aspect-ratio: 10 / 13;
|
|
4373
|
+
container-type: inline-size;
|
|
4374
|
+
isolation: isolate;
|
|
4375
|
+
background-image: radial-gradient(
|
|
4376
|
+
ellipse at 50% 42%,
|
|
4377
|
+
color-mix(in oklab, var(--bg) 96.4%, var(--fg)) 0%,
|
|
4378
|
+
color-mix(in oklab, var(--bg) 91.5%, var(--fg)) 75%,
|
|
4379
|
+
color-mix(in oklab, var(--bg) 88.5%, var(--fg)) 100%
|
|
4380
|
+
);
|
|
4381
|
+
}
|
|
4382
|
+
.sf-card-ground-studio [data-part="box"]:has(> * > [data-part="image-block"]) [data-part="image-frame"] {
|
|
4383
|
+
position: static;
|
|
4384
|
+
margin: 0;
|
|
4385
|
+
}
|
|
4386
|
+
.sf-card-ground-studio [data-part="box"]:has(> * > [data-part="image-block"]) [data-part="image-frame"] > [data-part="image"] {
|
|
4387
|
+
position: absolute;
|
|
4388
|
+
left: 11.5cqw;
|
|
4389
|
+
top: 28.6cqw;
|
|
4390
|
+
width: 77cqw;
|
|
4391
|
+
height: 77cqw;
|
|
4392
|
+
}
|
|
4393
|
+
.sf-card-ground-studio [data-part="box"]:has(> * > [data-part="image-block"])::before,
|
|
4394
|
+
.sf-card-ground-studio [data-part="box"]:has(> * > [data-part="image-block"])::after {
|
|
4395
|
+
content: "";
|
|
4396
|
+
position: absolute;
|
|
4397
|
+
z-index: -1;
|
|
4398
|
+
pointer-events: none;
|
|
4399
|
+
}
|
|
4400
|
+
/* The wide, faint shadow (`.s2`): 142% of the wheel wide, 1:5. */
|
|
4401
|
+
.sf-card-ground-studio [data-part="box"]:has(> * > [data-part="image-block"])::before {
|
|
4402
|
+
left: -2.36cqw;
|
|
4403
|
+
top: 96.41cqw;
|
|
4404
|
+
width: 109.34cqw;
|
|
4405
|
+
height: 21.87cqw;
|
|
4406
|
+
background: radial-gradient(closest-side, color-mix(in srgb, var(--fg) 17%, transparent), transparent);
|
|
4407
|
+
filter: blur(16px);
|
|
4408
|
+
}
|
|
4409
|
+
/* The near, darker shadow (`.s1`): the wheel's width, 1:6. */
|
|
4410
|
+
.sf-card-ground-studio [data-part="box"]:has(> * > [data-part="image-block"])::after {
|
|
4411
|
+
left: 14.58cqw;
|
|
4412
|
+
top: 95.85cqw;
|
|
4413
|
+
width: 77cqw;
|
|
4414
|
+
height: 12.83cqw;
|
|
4415
|
+
background: radial-gradient(closest-side, color-mix(in srgb, var(--fg) 40%, transparent), transparent);
|
|
4416
|
+
filter: blur(9px);
|
|
4417
|
+
}
|
|
4418
|
+
|
|
4343
4419
|
/* ─── "Words: Over the picture" (Product Grid; INOVIT /wheels design 2026-11-18) ───
|
|
4344
4420
|
The card's words sit at the foot of the card, on the picture's ground,
|
|
4345
4421
|
and the wheel sits in the space above them. A choice of the grid
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as n,Fragment as p,jsxs as d}from"react/jsx-runtime";import{ThemedSelectList as
|
|
1
|
+
"use client";import{jsx as n,Fragment as p,jsxs as d}from"react/jsx-runtime";import{ThemedSelectList as _,useThemedSelect as k}from"./ThemedSelect.js";import{useCurrency as w}from"./CurrencyContext.js";import{countryName as O}from"../lib/countries.js";import{regionSwitchHref as v}from"../lib/menu-link.js";import{FlagAuIcon as T,FlagCaIcon as R,FlagEuIcon as A,FlagGbIcon as E,FlagNzIcon as G,FlagUsIcon as U,GlobeIcon as j}from"efficient-shell/icons/efficient";import{GlobeAltIcon as L}from"efficient-shell/icons/efficient-looks";import{TOOL_ICON_BUTTON_CLASS as z,useHeaderGlyph as H}from"./HeaderTools.js";import{COUNTRY_SHOW_AS_DEFAULT as B,countryShowAsHasFlag as W}from"../lib/content/country-show-as.js";const g={US:U,CA:R,AU:T,NZ:G,GB:E,EU:A};function F({code:r,width:e}){const c=Object.hasOwn(g,r)?g[r]:void 0;return c?n("span",{"aria-hidden":!0,className:"inline-flex shrink-0 border border-line",children:n(c,{size:e})}):null}function D(r,e){const c=n(F,{code:e.code,width:18});switch(r){case"code_currency":return e.currency?d(p,{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 d(p,{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 d(p,{children:[c,n("span",{children:e.code})]});case"flag":return Object.hasOwn(g,e.code)?c:n("span",{children:e.code});default:return n("span",{children:e.name})}}function I(r,e,c){const s=new Map(r.map(a=>[a.code,a]));return(e?.length?e:r.map(a=>a.code)).map(a=>{const i=s.get(a);return{code:a,name:i?.name||O(a),currency:i?.currency,url:i?.url||c?.[a]||""}})}const S=2;function X(r){const{countries:e}=w();return I(e,r).length>=S}function K({urls:r,countries:e,showAs:c=B}={}){const{country:s,setCountry:a,countries:i}=w(),l=I(i,e,r),m=l.find(t=>t.code===s)??l[0],h=H();function C(t){const x=r?v(l.find(f=>f.code===t)?.url,window.location.href):null;if(x){window.location.href=x;return}i.some(f=>f.code===t)&&a(t)}const N=W(c),y=l.map(t=>({value:t.code,label:t.name,meta:t.currency,...N?{lead:n(F,{code:t.code,width:21})}:{}})),o=k({items:y,value:s,onPick:C});if(!m||l.length<S)return null;const u=o.open,b=c==="globe";return d("div",{ref:o.wrapRef,className:"relative",children:[n("button",{ref:t=>{o.triggerRef.current=t},type:"button","aria-haspopup":"listbox","aria-expanded":u,"aria-controls":u?o.listId:void 0,"aria-activedescendant":o.activeId,"aria-label":`Region: ${m.name}. Click to change.`,onClick:o.toggle,onKeyDown:o.onTriggerKeyDown,suppressHydrationWarning:!0,...b?{className:z}:{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:b?n(L,{size:h.size,strokeWidth:String(h.stroke),"aria-hidden":"true"}):d(p,{children:[D(c,m),n("span",{"aria-hidden":!0,className:`text-[11px] opacity-70 transition-transform ${u?"rotate-180":""}`,children:"▾"})]})}),u&&n(_,{id:o.listId,tone:"region",ariaLabel:"Choose region",items:y,value:s,focusIdx:o.focusIdx,onFocus:o.setFocusIdx,onPick:o.pick,listRef:o.listRef})]})}export{K as default,X as useCountrySelectShows};
|
|
@@ -55,6 +55,9 @@ export declare const CARD_GROUNDS: readonly [{
|
|
|
55
55
|
}, {
|
|
56
56
|
readonly label: "Soft grey";
|
|
57
57
|
readonly value: "soft";
|
|
58
|
+
}, {
|
|
59
|
+
readonly label: "Studio";
|
|
60
|
+
readonly value: "studio";
|
|
58
61
|
}];
|
|
59
62
|
export type CardGround = (typeof CARD_GROUNDS)[number]["value"];
|
|
60
63
|
export declare const cardGroundOf: (v: unknown) => CardGround;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,Fragment as x,jsxs as
|
|
1
|
+
"use client";import{jsx as t,Fragment as x,jsxs as P}from"react/jsx-runtime";import{createContext as D,useContext as E,useMemo as y}from"react";import{parseOption as h}from"efficient-shell/format";import{CardRowContext as G,CardTemplateRows as p,useCardRow as L}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as k}from"efficient-web-builder/render/components/SiteGutterFrame";import{SECTION_FILL_PASS_CLASS as N}from"efficient-web-builder/format/lib/content/section-min-height";import{cardHoverOf as F}from"efficient-web-builder/format/lib/animation/hover";import{pickHoverMedia as U}from"efficient-web-builder/format/lib/content/hover-media";import W from"efficient-web-builder/render/components/HoverMediaLayer";import{NO_FIELD_ANSWERS as v}from"../lib/content/field-usage.js";import{CARD_IMAGE_SIZES as j}from"../lib/sections/card-image-sizes.js";import{productTone as $,productToneVaried as H,randomCardColour as R}from"../lib/sections/card-tone.js";import{CardLookContext as C}from"./card-pieces/card-row.js";import{CardBuyDialog as B}from"./card-pieces/CardBuyButton.js";import M from"./card-pieces/CardSurfaceFrame.js";import{BundleCardStateProvider as V,TyreCardStateProvider as z,useProductCardState as b,useWheelCardState as _,WheelCardStateProvider as q,tyreCardProduct as Y}from"./card-pieces/ProductCardState.js";import{tyrePagePath as K}from"../lib/tyres/tyre-page-path.js";import{say as X}from"efficient-web-builder/format/lib/editor-words";import{CARD_INDEX_OPTIONS as J,cardIndexCss as Q}from"efficient-web-builder/format/lib/sections/product-card-style";import{SHARED_ROWS_LIST_CLASS as Z}from"efficient-web-builder/render/lib/content/box-shared-columns";import{GAP_ZONE_CLASS as ee}from"efficient-web-builder/format/lib/content/container-gap";import{CARD_ROWS_GRID_CLASS as re,cardRowsGap as oe,cardRowsGridStyle as te}from"./WheelCardFrame.js";import{blockParts as ne}from"../lib/block-parts.js";const ae=ne("ProductCard");function Qe(e){return J.map(({value:r})=>r==="off"?"":Q(e,r).replace(".sf-card-index::before",`.sf-card-index[data-format="${r}"]::before`)).join("")}function Ze(e){return e.className.includes(ee)?{className:`${e.className} ${re} ${Z}`,style:{...e.style,...te(oe(e))}}:e}const se={sale:!1,axleSets:!0,setTotal:!1,wasFollowsSize:!1,quoteSets:!0,showSingle:!1,armOnContact:!1},er={sale:!0,axleSets:!1,setTotal:!0,wasFollowsSize:!0,quoteSets:!1,showSingle:!0,armOnContact:!0},de={kindLabel:null,brand:!1,process:!0,tyreBrand:!0},ie=[],le=[{label:"Flat",value:"flat"},{label:"Soft grey",value:"soft"},{label:"Studio",value:"studio"}],ce={flat:"",soft:"sf-card-ground-soft",studio:"sf-card-ground-studio"},rr=e=>h(le.map(r=>r.value),"flat",e),ue=[{label:"Under the picture",value:"under"},{label:"Over the picture",value:"over"}],or=e=>h(ue.map(r=>r.value),"under",e),me="sf-card-words-over",T={ownerId:"",ownerType:"ProductGrid",Template:void 0,hover:F({},"ProductGrid"),imageSizes:j,fieldUsage:v,tyreFieldUsage:v,reserveEyebrow:!1,editing:!1,eyebrow:de,fit:null,colours:ie,rules:se,ground:"flat",words:"under"},O=D(T);function m(){return E(O)}function tr({value:e,children:r}){const o=y(()=>({...T,...fe(e)}),[e]);return t(O.Provider,{value:o,children:r})}const fe=e=>Object.fromEntries(Object.entries(e).filter(([,r])=>r!==void 0));function w(e,r){const o=e.designCode??e.slug??"";return{name:e.name??"",eyebrow:e.process??"",note:"",href:e.slug?`/wheels/${e.slug}`:"",colour:$(r),colourVaried:H(r,o),colourRandom:R(o)}}function pe(e){const r=e.designCode||e.slug||"";return{name:e.name??"",eyebrow:e.brand??"",note:"",href:K(e.slug)??"",colour:"",colourVaried:"",colourRandom:R(r)}}const I=e=>`/bundles/${e.slug}`;function Ce(e){return{name:e.name,eyebrow:"",note:e.subtitle??"",href:I(e),colour:"",colourVaried:"",colourRandom:""}}const we="sf-card sf-card-fill group relative flex flex-col bg-[var(--card-bg)] transition-colors duration-200 hover:bg-[var(--card-bg-hover)] [.sf-card-rows>&]:mb-[var(--sf-card-row-gap)]",Se="sf-card group relative flex flex-col border border-line bg-bg transition-colors hover:border-accent",ge="col-span-2 max-view-wide:col-span-1 @max-[720px]:col-span-1 [&:has([data-set-picture=one])]:col-span-1",xe=`relative flex-1 ${N}`;function S({copy:e,href:r,label:o,wide:n=!1,kit:a=!1,probes:s,arm:f,layer:c}){const{editing:i,ground:d,words:u}=m(),l=[ce[d],u==="over"?me:""].filter(Boolean);return t(M,{surface:a?Se:[we,...l].join(" "),span:n?ge:void 0,href:r,label:o,linked:!i,probes:s,arm:f,layer:c,children:t("div",{className:xe,...ae("card-content"),children:t(k,{children:e})})})}const ye="var(--card-bg)";function he(e,r=ye){const o=ve();return!o||o.cover!==e||!o.media?null:t(W,{media:o.media,name:o.name,cover:e,ground:r})}function ve(){const{hover:e}=m(),r=b();if(e.kind!=="nextImage"||!e.media||r.kind!=="wheel")return null;const o=r.sel.finish?.name,n=Re(r.wheel,o);return{cover:e.media.cover,name:r.wheel.name,media:U(n,e.media,o)}}function Re(e,r){const o=e.finishes?.find(a=>a.name===r),n=o?.angles?.length?o.angles:r&&r===e.defaultFinish?e.defaultFinishRenderings??[]:[];return{...e,finishes:r?[{name:r,angles:n.slice(1)}]:[]}}function be({children:e}){const r=L(),{wheel:o,sel:n}=_(),a=n.finish?.color,s=y(()=>r?{...r,row:w(o,a)}:null,[r,o,a]);return s?t(G.Provider,{value:s,children:e}):t(x,{children:e})}function _e({copy:e}){const{wheel:r,sel:o,isSet:n}=_(),{rules:a}=m(),s=he("card");return P(x,{children:[t(S,{copy:t(be,{children:e}),href:r.slug?`/wheels/${r.slug}`:"",label:r.name,wide:n,probes:o.probes,arm:a.armOnContact?o.arm:void 0,layer:s}),t(B,{})]})}function A(e,r,o,n){const a=r.item;return t(q,{wheel:a,colours:o.colours,defaultFinish:n?.[r.index],editing:o.editing,children:t(C.Provider,{value:"catalog",children:t(_e,{copy:e})})})}function nr({wheels:e,finishes:r,children:o}){const n=m(),{ownerId:a,ownerType:s,Template:f,editing:c}=n;return t(p,{ownerId:a,ownerType:s,Template:f,rows:e.map(i=>w(i)),items:e,fallback:c?t(g,{}):null,wrapCopy:(i,d)=>A(i,d,n,r),children:o})}function ar({items:e,tyreOf:r,tyreFit:o}){const n=m(),{ownerId:a,ownerType:s,Template:f,editing:c}=n,i=e.map(d=>r(d));return t(p,{ownerId:a,ownerType:s,Template:f,rows:e.map((d,u)=>{const l=i[u];return l?pe(l):w(d)}),items:e,fallback:c?t(g,{}):null,wrapCopy:(d,u)=>{const l=i[u.index];return l?Oe(d,Y(l,o?.(l)??null),c):A(d,u,n)},children:d=>d})}function Te({copy:e}){const r=b();if(r.kind!=="tyre")throw new Error("A tyre card surface was drawn outside its tyre state.");return t(S,{copy:e,href:r.pagePath??"",label:r.tyre.name,arm:r.arm})}function Oe(e,r,o){return t(z,{tyre:r,editing:o,children:t(C.Provider,{value:"catalog",children:t(Te,{copy:e})})})}function Ie(e,r){const o=r.item;return t(V,{bundle:o,children:t(C.Provider,{value:"catalog",children:t(S,{copy:e,href:I(o),label:o.name,kit:!0})})})}function sr({bundles:e,children:r}){const{ownerId:o,ownerType:n,Template:a,editing:s}=m();return t(p,{ownerId:o,ownerType:n,Template:a,rows:e.map(Ce),items:e,fallback:s?t(g,{}):null,wrapCopy:Ie,children:r})}function g(){return t("div",{"data-grid-card-empty":"",className:"p-4 text-center font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.2em] text-fg-dim",children:X("The card is empty. Add parts to its card template in Layers.")})}export{le as CARD_GROUNDS,ue as CARD_WORDS,me as CARD_WORDS_OVER_CLASS,se as GRID_CARD_RULES,sr as GridBundleCards,tr as GridCardProvider,nr as GridCards,ar as GridMixedCards,er as LISTING_CARD_RULES,Ce as bundleCardRow,I as bundlePagePath,rr as cardGroundOf,Re as cardHoverRow,Ze as cardRowsGrid,or as cardWordsOf,Qe as gridIndexCss,w as productCardRow,pe as tyreCardRow,he as useCardHoverLayer,m as useGridCard};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SearchStyle } from "./HeaderToolBlocks.js";
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
|
+
import { type HeaderToolLook } from "../lib/content/header-bar.js";
|
|
3
4
|
export declare const UTIL_WORDS: {
|
|
4
5
|
readonly search: "Search";
|
|
5
6
|
readonly account: "Account";
|
|
@@ -10,6 +11,12 @@ export declare const UTIL_WORDS: {
|
|
|
10
11
|
export declare const UTIL_WORD_CLASS = "whitespace-nowrap";
|
|
11
12
|
export declare const TOOL_ICON_BUTTON_CLASS = "mono-eyebrow-ctl inline-flex items-center opacity-80 transition-opacity hover:opacity-100";
|
|
12
13
|
export declare function cartLabel(count: number): string;
|
|
14
|
+
export declare const HeaderToolLookContext: import("react").Context<HeaderToolLook>;
|
|
15
|
+
export declare function useHeaderGlyph(): {
|
|
16
|
+
size: number;
|
|
17
|
+
stroke: number;
|
|
18
|
+
};
|
|
19
|
+
export declare function CartGlyph(): import("react").JSX.Element;
|
|
13
20
|
export declare function CartButton({ onClick, count, asText, className, takesViewHide, }: {
|
|
14
21
|
onClick: () => void;
|
|
15
22
|
count: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as t,jsxs as c,Fragment as k}from"react/jsx-runtime";import S from"next/link";import{createContext as _,useContext as N,useEffect as $,useRef as C}from"react";import{CartAltIcon as L}from"efficient-shell/icons/efficient-looks";import{BagIcon as z}from"efficient-shell/icons/efficient";import{resolveHeaderToolLook as B}from"../lib/content/header-bar.js";import h from"efficient-easel/screen/components/UiIcon";import{prefersReducedMotion as O}from"efficient-web-builder/render/components/useReducedMotion";import{HideTaker as T,NO_HIDE as H,useTakeViewHide as I,withViewHide as j}from"efficient-web-builder/render/components/ViewHideRoot";const l={search:"Search",account:"Account",cart:"Bag",menu:"Menu",close:"Close"},u="whitespace-nowrap",A="mono-eyebrow-ctl inline-flex items-center opacity-80 transition-opacity hover:opacity-100";function W(r){return r>99?"99+":String(r)}function R({count:r,ref:e}){return t("span",{ref:e,"data-cart-badge":"","aria-hidden":"true",className:"pointer-events-none absolute -top-[7px] -right-[9px] inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-current px-1 text-[10px] leading-none font-semibold tabular-nums",style:{letterSpacing:0},children:t("span",{style:{color:"var(--sf-header-ground, var(--bg))"},children:W(r)})})}function G(r){return`Open cart, ${r} item${r===1?"":"s"}`}const v=_(B({}));function m(){return N(v).glyph}function U(){const{cart:r}=N(v),{size:e,stroke:o}=m();return t(r==="bag"?z:L,{size:e,strokeWidth:String(o),"aria-hidden":"true"})}function X({onClick:r,count:e,asText:o,className:n,takesViewHide:i=!1}){const a=C(null),s=C(e);return $(()=>{s.current!==e&&(s.current=e,!O()&&a.current?.animate([{transform:"scale(0.6)"},{transform:"scale(1)"}],{duration:180,easing:"ease-out"}))},[e]),t(T,{as:"button",takes:i,type:"button",onClick:r,"aria-label":G(e),className:`mono-eyebrow-ctl inline-flex items-center gap-2 opacity-80 transition-opacity hover:opacity-100 ${n??""}`,children:o?c("span",{className:u,children:[l.cart,e>0?` ${e}`:""]}):c("span",{className:"relative inline-flex",children:[t(U,{}),e>0?t(R,{count:e,ref:a}):null]})})}function Y({asText:r,className:e,takesViewHide:o=!1}){const n=I(),i=o?n:H,a=m();return i.scope(t(S,{href:"/account","aria-label":"Account",className:j(`${A} ${e??""}`,i.className),...i.attrs,children:r?t("span",{className:u,children:l.account}):c("svg",{width:a.size,height:a.size,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:a.stroke,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t("circle",{cx:"12",cy:"8",r:"3.4"}),t("path",{d:"M5 20a7 7 0 0 1 14 0"})]})}))}function Z({onClick:r,asText:e,withWord:o,phoneLook:n,className:i}){const a=m();let s=!1,d;if(n){const p=e?"text":o?"icon_text":"icon",f=(b,w)=>b&&w?"":b?"max-view-tablet:hidden":w?"view-tablet:hidden":null,x=f(p!=="text",n!=="text"),g=f(p!=="icon",n!=="icon"),y=p==="icon_text"||n==="icon_text";s=!0,d=c(k,{children:[x===null?null:t("span",{className:`inline-flex ${x}`,children:t(h,{name:"search",size:y?20:18,strokeWidth:y?1.5:1.6,rounded:!0})}),g===null?null:t("span",{className:`${u} ${g}`,children:l.search})]})}else o?(s=!0,d=c(k,{children:[t(h,{name:"search",size:20,strokeWidth:1.5,rounded:!0}),t("span",{className:`${u} max-view-tablet:hidden`,children:l.search})]})):d=e?t("span",{className:u,children:l.search}):t(h,{name:"search",size:a.size,strokeWidth:a.stroke,rounded:!0});return t("button",{type:"button",onClick:r,"aria-label":"Search",title:"Search (⌘K)",className:`mono-eyebrow-ctl inline-flex items-center ${s?"gap-2 ":""}opacity-80 transition-opacity hover:opacity-100 ${i??""}`,children:d})}export{Y as AccountButton,X as CartButton,U as CartGlyph,v as HeaderToolLookContext,Z as SearchButton,A as TOOL_ICON_BUTTON_CLASS,l as UTIL_WORDS,u as UTIL_WORD_CLASS,G as cartLabel,m as useHeaderGlyph};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as n}from"react/jsx-runtime";import
|
|
1
|
+
"use client";import{jsx as t,jsxs as n}from"react/jsx-runtime";import g from"next/link";import y from"efficient-easel/screen/components/UiIcon";import N from"./CountrySelect.js";import w from"./ThemeToggle.js";import{useCart as j}from"./CartContext.js";import{CartGlyph as v,cartLabel as C,useHeaderGlyph as T,UTIL_WORDS as f}from"./HeaderTools.js";import{UNDER_HEADER_SHEET_CLASS as _}from"../lib/content/header-bar.js";const h="flex h-12 items-center gap-3 border border-line bg-bg px-4 text-left text-[15px]";function I({role:l,panelRef:a,name:o,entries:c,tools:e,withAccount:s,editing:m,onClose:i,onSearch:p,phoneOnly:x=!1,marker:u,listStyle:b}){const d=T(),r=e&&(e.search||e.cart||e.region||s&&e.account||e.theme)?e:null;return n("div",{ref:a,role:l,"aria-modal":"true","aria-label":o,tabIndex:-1,...u?{"data-menu-panel":u}:null,className:`${_} z-[60] flex flex-col overflow-y-auto bg-bg text-fg${x?" view-tablet:hidden":""}`,children:[t("ul",{className:"m-0 flex list-none flex-col px-5 py-3 font-mono text-[16px] uppercase tracking-[0.18em]",style:b,children:c}),r?n("div",{className:"mt-auto flex flex-col gap-4 border-t border-line bg-surface p-5",children:[r.search?n("button",{type:"button",className:h,onClick:m?void 0:()=>{i(),p()},children:[t(y,{name:"search",size:d.size,strokeWidth:d.stroke,rounded:!0}),f.search]}):null,r.cart?t(k,{editing:m,onClose:i}):null,s&&r.account?n("div",{className:"flex items-center justify-between",children:[t("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),t(g,{href:"/account",onClick:i,className:"mono-eyebrow underline",children:"Your account"})]}):null,r.region?n("div",{className:"flex items-center justify-between",children:[t("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),t(N,{})]}):null,r.theme?n("div",{className:"flex items-center justify-between",children:[t("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),t(w,{})]}):null]}):null]})}function k({editing:l,onClose:a}){const{open:o,totals:c}=j(),e=c.sets;return n("button",{type:"button",className:h,"aria-label":C(e),onClick:l?void 0:()=>{a(),o()},children:[t(v,{}),f.cart,e>0?` ${e}`:""]})}export{I as PhoneSheet};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SlotComponent } from "efficient-easel/blocks";
|
|
2
|
-
export default function SectionGroupBody({ place, sections: Sections, editing, widths, navTextCase, menuRow, toolTextStyle, }: {
|
|
2
|
+
export default function SectionGroupBody({ place, sections: Sections, editing, widths, navTextCase, menuRow, toolTextStyle, iconSize, cartIcon, }: {
|
|
3
3
|
place: "header" | "footer";
|
|
4
4
|
sections: SlotComponent;
|
|
5
5
|
editing?: boolean;
|
|
@@ -7,4 +7,6 @@ export default function SectionGroupBody({ place, sections: Sections, editing, w
|
|
|
7
7
|
navTextCase?: unknown;
|
|
8
8
|
menuRow?: unknown;
|
|
9
9
|
toolTextStyle?: unknown;
|
|
10
|
+
iconSize?: unknown;
|
|
11
|
+
cartIcon?: unknown;
|
|
10
12
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as t}from"react/jsx-runtime";import{PhoneMenuToolsProvider as g}from"efficient-web-builder/render/components/PhoneMenuTools";import{AccountInPhoneMenuProvider as P}from"./PhoneMenuAccount.js";import{SectionGroupWidthsProvider as b}from"efficient-web-builder/render/components/SiteGutterFrame";import{chromeOwnWidth as x}from"efficient-web-builder/format/lib/content/section-width";import{centredCap as k,SITE_WIDTH_CAP as S}from"efficient-web-builder/format/lib/content/page-width";import{resolveHeaderToolLook as y,resolveMenuRow as H,resolveNavTextCase as _}from"../lib/content/header-bar.js";import{HeaderToolLookContext as w}from"./HeaderTools.js";import{HideTaker as A}from"efficient-web-builder/render/components/ViewHideRoot";import{textKindVars as E}from"../lib/content/text-kind-vars.js";import{blockParts as a}from"../lib/block-parts.js";const O=a("SiteHeader")("header-content"),R=a("SiteFooter")("footer"),M={font:"--sf-header-tool-font",size:"--sf-header-tool-size"};function C(o){const n=E(o,M);return Object.keys(n).length?n:null}function L({place:o,sections:n,editing:c=!1,widths:u,navTextCase:f,menuRow:m,toolTextStyle:s,iconSize:h,cartIcon:v}){const p=o==="footer"?"footer":"div",e=x(u),r=e.content==="full"?"100vw":e.contentMax===null?null:`${e.contentMax}px`,d=o==="footer"&&e.background==="content"?k(S):null,l=o==="header"?C(s):null,T=r===null&&d===null&&l===null?void 0:{...d,...r===null?null:{"--sf-site-width":r},...l},i=t(A,{as:p,"data-section-group":o,...o==="header"?{"data-header-nav-case":_(f),"data-header-menu-row":H(m)??"top",...l?{"data-header-tool-style":String(s)}:null}:null,className:c&&o==="footer"?"sf-theme-surfaces bg-bg text-fg":void 0,style:T,...o==="header"?O:R,children:t(b,{value:{background:e.background,content:e.content==="content"?"content":null},children:t(n,{minEmptyHeight:120})})});return o==="header"?t(g,{children:t(P,{children:t(w.Provider,{value:y({cartIcon:v,iconSize:h}),children:i})})}):i}export{L as default};
|
|
@@ -40,3 +40,33 @@ export declare const HEADER_LINK_OPACITY_MAX = 100;
|
|
|
40
40
|
export declare const HEADER_LINK_OPACITY_ATTR = "data-header-link-opacity";
|
|
41
41
|
export declare const HEADER_LINK_OPACITY_VAR = "--sf-header-link-opacity";
|
|
42
42
|
export declare function readHeaderLinkOpacity(v: unknown): number | undefined;
|
|
43
|
+
export declare const HEADER_ICON_SIZES: readonly [{
|
|
44
|
+
readonly label: "Medium";
|
|
45
|
+
readonly value: "medium";
|
|
46
|
+
}, {
|
|
47
|
+
readonly label: "Large";
|
|
48
|
+
readonly value: "large";
|
|
49
|
+
}];
|
|
50
|
+
type HeaderIconSize = (typeof HEADER_ICON_SIZES)[number]["value"];
|
|
51
|
+
export declare const HEADER_ICON_SIZE_FALLBACK: HeaderIconSize;
|
|
52
|
+
export declare const HEADER_CART_ICONS: readonly [{
|
|
53
|
+
readonly label: "Cart";
|
|
54
|
+
readonly value: "cart";
|
|
55
|
+
}, {
|
|
56
|
+
readonly label: "Bag";
|
|
57
|
+
readonly value: "bag";
|
|
58
|
+
}];
|
|
59
|
+
type HeaderCartIcon = (typeof HEADER_CART_ICONS)[number]["value"];
|
|
60
|
+
export declare const HEADER_CART_ICON_FALLBACK: HeaderCartIcon;
|
|
61
|
+
export interface HeaderToolLook {
|
|
62
|
+
cart: HeaderCartIcon;
|
|
63
|
+
glyph: {
|
|
64
|
+
size: number;
|
|
65
|
+
stroke: number;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export declare const resolveHeaderToolLook: (p: {
|
|
69
|
+
cartIcon?: unknown;
|
|
70
|
+
iconSize?: unknown;
|
|
71
|
+
}) => HeaderToolLook;
|
|
72
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{HEADER_HEIGHT_PX as
|
|
1
|
+
import{HEADER_HEIGHT_PX as r}from"efficient-web-builder/render/lib/document/header-clearance";import{parseOption as o}from"efficient-shell/format";function T(e){return typeof e=="number"&&Number.isInteger(e)&&e>=r.min&&e<=r.max?e:r.default}const L="fixed inset-x-0 bottom-0 top-[var(--sf-header-h,88px)]",d=e=>!!e&&e.startsWith("/wheels/")&&e!=="/wheels",I=(e,t)=>!e&&t?"var(--section-bg)":"var(--bg)",n=[{label:"Uppercase",value:"uppercase"},{label:"Capitalised",value:"capitalised"}],a="uppercase",C=e=>o(n,a,e),l=[{label:"Icon",value:"icon"},{label:"Text",value:"text"}],s="icon",m=e=>o(l,s,e),D=[{label:"Own row",value:"top"},{label:"Same row",value:"inline"}],S="top",b=e=>e==="inline"?"inline":e==="top"||e==="bottom"?"top":null,E="custom";function N(e,t){return e!==E||typeof t!="string"?null:t.trim()||null}const O=80,_=0,i=100,f="data-header-link-opacity",g="--sf-header-link-opacity";function h(e){if(!(typeof e!="number"||!Number.isFinite(e)))return Math.min(i,Math.max(_,Math.round(e)))}const p=[{label:"Medium",value:"medium"},{label:"Large",value:"large"}],c="medium",A={medium:{size:18,stroke:1.6},large:{size:20,stroke:1.4}},u=[{label:"Cart",value:"cart"},{label:"Bag",value:"bag"}],x="cart",v=e=>({cart:o(u,x,e.cartIcon),glyph:A[o(p,c,e.iconSize)]});export{u as HEADER_CART_ICONS,x as HEADER_CART_ICON_FALLBACK,p as HEADER_ICON_SIZES,c as HEADER_ICON_SIZE_FALLBACK,f as HEADER_LINK_OPACITY_ATTR,O as HEADER_LINK_OPACITY_DEFAULT,i as HEADER_LINK_OPACITY_MAX,_ as HEADER_LINK_OPACITY_MIN,g as HEADER_LINK_OPACITY_VAR,D as HEADER_MENU_ROWS,S as HEADER_MENU_ROW_FALLBACK,n as HEADER_NAV_TEXT_CASES,a as HEADER_NAV_TEXT_CASE_FALLBACK,E as HEADER_TOP_INK_CUSTOM,l as HEADER_UTIL_STYLES,s as HEADER_UTIL_STYLE_FALLBACK,L as UNDER_HEADER_SHEET_CLASS,I as headerSolidBackground,d as isProductPage,h as readHeaderLinkOpacity,N as readHeaderTopInk,T as resolveHeaderHeightPx,v as resolveHeaderToolLook,b as resolveMenuRow,C as resolveNavTextCase,m as resolveUtilStyle};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as i}from"react/jsx-runtime";import
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import f from"../../../../../components/BoxHeaderBar.js";import u from"../../../../../components/SectionGroupBody.js";import{headerBarFromProps as T}from"../../../published-header-bar.js";import{SiteHeaderMeta as g}from"./meta.js";const P={...g,render:({sections:n,navTextCase:a,toolTextStyle:p,iconSize:d,cartIcon:m,menuRow:s,sticky:c,topTextColor:x,topTextCustom:h,linkOpacity:l,heightPx:y,sectionAccent:C,editor:t,...o})=>{const r=i(u,{place:"header",sections:n,widths:o,navTextCase:a,menuRow:s,toolTextStyle:p,iconSize:d,cartIcon:m,editing:t?.isEditing});if(!t?.isEditing)return r;const e=T({sticky:c,topTextColor:x,topTextCustom:h,linkOpacity:l,heightPx:y,sectionAccent:C,...o});return i(f,{sticky:e.sticky,topTextColor:e.topTextColor,topTextCustom:e.topTextCustom,linkOpacity:e.linkOpacity,heightPx:e.heightPx,theme:e.theme,bandCapped:e.bandCapped,children:r})}};export{P as SiteHeaderRender};
|