efficient-storefront-blocks 0.125.21 → 0.125.22

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.
@@ -1 +1 @@
1
- "use client";import{jsx as n,Fragment as p,jsxs as d}from"react/jsx-runtime";import{ThemedSelectList as N,useThemedSelect as _}from"./ThemedSelect.js";import{useCurrency as x}from"./CurrencyContext.js";import{countryName as O}from"../lib/countries.js";import{regionSwitchHref as k}from"../lib/menu-link.js";import{FlagAuIcon as v,FlagCaIcon as T,FlagEuIcon as R,FlagGbIcon as A,FlagNzIcon as E,FlagUsIcon as U,GlobeIcon as j}from"efficient-shell/icons/efficient";import{GlobeAltIcon as G}from"efficient-shell/icons/efficient-looks";import{TOOL_ICON_BUTTON_CLASS as L}from"./HeaderTools.js";import{COUNTRY_SHOW_AS_DEFAULT as z,countryShowAsHasFlag as B}from"../lib/content/country-show-as.js";const g={US:U,CA:T,AU:v,NZ:E,GB:A,EU:R};function w({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 H(r,e){const c=n(w,{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 F(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 I=2;function Q(r){const{countries:e}=x();return F(e,r).length>=I}function W({urls:r,countries:e,showAs:c=z}={}){const{country:s,setCountry:a,countries:i}=x(),l=F(i,e,r),m=l.find(t=>t.code===s)??l[0];function C(t){const b=r?k(l.find(f=>f.code===t)?.url,window.location.href):null;if(b){window.location.href=b;return}i.some(f=>f.code===t)&&a(t)}const S=B(c),h=l.map(t=>({value:t.code,label:t.name,meta:t.currency,...S?{lead:n(w,{code:t.code,width:21})}:{}})),o=_({items:h,value:s,onPick:C});if(!m||l.length<I)return null;const u=o.open,y=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,...y?{className:L}:{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:y?n(G,{size:18,strokeWidth:"1.6","aria-hidden":"true"}):d(p,{children:[H(c,m),n("span",{"aria-hidden":!0,className:`text-[11px] opacity-70 transition-transform ${u?"rotate-180":""}`,children:"▾"})]})}),u&&n(N,{id:o.listId,tone:"region",ariaLabel:"Choose region",items:h,value:s,focusIdx:o.focusIdx,onFocus:o.setFocusIdx,onPick:o.pick,listRef:o.listRef})]})}export{W as default,Q as useCountrySelectShows};
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};
@@ -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 e,jsxs as o,Fragment as y}from"react/jsx-runtime";import N from"next/link";import{useEffect as _,useRef as w}from"react";import{CartAltIcon as k}from"efficient-shell/icons/efficient-looks";import h from"efficient-easel/screen/components/UiIcon";import{prefersReducedMotion as v}from"efficient-web-builder/render/components/useReducedMotion";import{HideTaker as $,NO_HIDE as S,useTakeViewHide as C,withViewHide as O}from"efficient-web-builder/render/components/ViewHideRoot";const l={search:"Search",account:"Account",cart:"Bag",menu:"Menu",close:"Close"},d="whitespace-nowrap",B="mono-eyebrow-ctl inline-flex items-center opacity-80 transition-opacity hover:opacity-100";function L(n){return n>99?"99+":String(n)}function j({count:n,ref:t}){return e("span",{ref:t,"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:e("span",{style:{color:"var(--sf-header-ground, var(--bg))"},children:L(n)})})}function A(n){return`Open cart, ${n} item${n===1?"":"s"}`}function M({onClick:n,count:t,asText:s,className:r,takesViewHide:a=!1}){const c=w(null),i=w(t);return _(()=>{i.current!==t&&(i.current=t,!v()&&c.current?.animate([{transform:"scale(0.6)"},{transform:"scale(1)"}],{duration:180,easing:"ease-out"}))},[t]),e($,{as:"button",takes:a,type:"button",onClick:n,"aria-label":A(t),className:`mono-eyebrow-ctl inline-flex items-center gap-2 opacity-80 transition-opacity hover:opacity-100 ${r??""}`,children:s?o("span",{className:d,children:[l.cart,t>0?` ${t}`:""]}):o("span",{className:"relative inline-flex",children:[e(k,{size:18,strokeWidth:"1.6","aria-hidden":"true"}),t>0?e(j,{count:t,ref:c}):null]})})}function D({asText:n,className:t,takesViewHide:s=!1}){const r=C(),a=s?r:S;return a.scope(e(N,{href:"/account","aria-label":"Account",className:O(`${B} ${t??""}`,a.className),...a.attrs,children:n?e("span",{className:d,children:l.account}):o("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e("circle",{cx:"12",cy:"8",r:"3.4"}),e("path",{d:"M5 20a7 7 0 0 1 14 0"})]})}))}function E({onClick:n,asText:t,withWord:s,phoneLook:r,className:a}){let c=!1,i;if(r){const u=t?"text":s?"icon_text":"icon",p=(b,g)=>b&&g?"":b?"max-view-tablet:hidden":g?"view-tablet:hidden":null,m=p(u!=="text",r!=="text"),f=p(u!=="icon",r!=="icon"),x=u==="icon_text"||r==="icon_text";c=!0,i=o(y,{children:[m===null?null:e("span",{className:`inline-flex ${m}`,children:e(h,{name:"search",size:x?20:18,strokeWidth:x?1.5:1.6,rounded:!0})}),f===null?null:e("span",{className:`${d} ${f}`,children:l.search})]})}else s?(c=!0,i=o(y,{children:[e(h,{name:"search",size:20,strokeWidth:1.5,rounded:!0}),e("span",{className:`${d} max-view-tablet:hidden`,children:l.search})]})):i=t?e("span",{className:d,children:l.search}):e(h,{name:"search",size:18,strokeWidth:1.6,rounded:!0});return e("button",{type:"button",onClick:n,"aria-label":"Search",title:"Search (⌘K)",className:`mono-eyebrow-ctl inline-flex items-center ${c?"gap-2 ":""}opacity-80 transition-opacity hover:opacity-100 ${a??""}`,children:i})}export{D as AccountButton,M as CartButton,E as SearchButton,B as TOOL_ICON_BUTTON_CLASS,l as UTIL_WORDS,d as UTIL_WORD_CLASS,A as cartLabel};
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 b from"next/link";import g from"efficient-easel/screen/components/UiIcon";import N from"./CountrySelect.js";import y from"./ThemeToggle.js";import{CartAltIcon as w}from"efficient-shell/icons/efficient-looks";import{useCart as j}from"./CartContext.js";import{cartLabel as v,UTIL_WORDS as u}from"./HeaderTools.js";import{UNDER_HEADER_SHEET_CLASS as C}from"../lib/content/header-bar.js";const f="flex h-12 items-center gap-3 border border-line bg-bg px-4 text-left text-[15px]";function z({role:l,panelRef:a,name:o,entries:c,tools:e,withAccount:s,editing:m,onClose:i,onSearch:h,phoneOnly:p=!1,marker:d,listStyle:x}){const 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,...d?{"data-menu-panel":d}:null,className:`${C} z-[60] flex flex-col overflow-y-auto bg-bg text-fg${p?" 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:x,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:f,onClick:m?void 0:()=>{i(),h()},children:[t(g,{name:"search",size:18,strokeWidth:1.6,rounded:!0}),u.search]}):null,r.cart?t(T,{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(b,{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(y,{})]}):null]}):null]})}function T({editing:l,onClose:a}){const{open:o,totals:c}=j(),e=c.sets;return n("button",{type:"button",className:f,"aria-label":v(e),onClick:l?void 0:()=>{a(),o()},children:[t(w,{size:18,strokeWidth:"1.6","aria-hidden":"true"}),u.cart,e>0?` ${e}`:""]})}export{z as PhoneSheet};
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 e}from"react/jsx-runtime";import{PhoneMenuToolsProvider as g}from"efficient-web-builder/render/components/PhoneMenuTools";import{AccountInPhoneMenuProvider as v}from"./PhoneMenuAccount.js";import{SectionGroupWidthsProvider as T}from"efficient-web-builder/render/components/SiteGutterFrame";import{chromeOwnWidth as b}from"efficient-web-builder/format/lib/content/section-width";import{centredCap as P,SITE_WIDTH_CAP as x}from"efficient-web-builder/format/lib/content/page-width";import{resolveMenuRow as S,resolveNavTextCase as y}from"../lib/content/header-bar.js";import{HideTaker as _}from"efficient-web-builder/render/components/ViewHideRoot";import{textKindVars as k}from"../lib/content/text-kind-vars.js";import{blockParts as a}from"../lib/block-parts.js";const w=a("SiteHeader")("header-content"),A=a("SiteFooter")("footer"),E={font:"--sf-header-tool-font",size:"--sf-header-tool-size"};function O(o){const n=k(o,E);return Object.keys(n).length?n:null}function R({place:o,sections:n,editing:c=!1,widths:u,navTextCase:f,menuRow:m,toolTextStyle:l}){const h=o==="footer"?"footer":"div",t=b(u),r=t.content==="full"?"100vw":t.contentMax===null?null:`${t.contentMax}px`,d=o==="footer"&&t.background==="content"?P(x):null,s=o==="header"?O(l):null,p=r===null&&d===null&&s===null?void 0:{...d,...r===null?null:{"--sf-site-width":r},...s},i=e(_,{as:h,"data-section-group":o,...o==="header"?{"data-header-nav-case":y(f),"data-header-menu-row":S(m)??"top",...s?{"data-header-tool-style":String(l)}:null}:null,className:c&&o==="footer"?"sf-theme-surfaces bg-bg text-fg":void 0,style:p,...o==="header"?w:A,children:e(T,{value:{background:t.background,content:t.content==="content"?"content":null},children:e(n,{minEmptyHeight:120})})});return o==="header"?e(g,{children:e(v,{children:i})}):i}export{R as default};
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 o}from"efficient-web-builder/render/lib/document/header-clearance";import{parseOption as r}from"efficient-shell/format";function A(e){return typeof e=="number"&&Number.isInteger(e)&&e>=o.min&&e<=o.max?e:o.default}const x="fixed inset-x-0 bottom-0 top-[var(--sf-header-h,88px)]",u=e=>!!e&&e.startsWith("/wheels/")&&e!=="/wheels",T=(e,t)=>!e&&t?"var(--section-bg)":"var(--bg)",n=[{label:"Uppercase",value:"uppercase"},{label:"Capitalised",value:"capitalised"}],a="uppercase",H=e=>r(n,a,e),p=[{label:"Icon",value:"icon"},{label:"Text",value:"text"}],i="icon",d=e=>r(p,i,e),R=[{label:"Own row",value:"top"},{label:"Same row",value:"inline"}],I="top",L=e=>e==="inline"?"inline":e==="top"||e==="bottom"?"top":null,s="custom";function D(e,t){return e!==s||typeof t!="string"?null:t.trim()||null}const f=80,E=0,l=100,m="data-header-link-opacity",N="--sf-header-link-opacity";function b(e){if(!(typeof e!="number"||!Number.isFinite(e)))return Math.min(l,Math.max(E,Math.round(e)))}export{m as HEADER_LINK_OPACITY_ATTR,f as HEADER_LINK_OPACITY_DEFAULT,l as HEADER_LINK_OPACITY_MAX,E as HEADER_LINK_OPACITY_MIN,N as HEADER_LINK_OPACITY_VAR,R as HEADER_MENU_ROWS,I as HEADER_MENU_ROW_FALLBACK,n as HEADER_NAV_TEXT_CASES,a as HEADER_NAV_TEXT_CASE_FALLBACK,s as HEADER_TOP_INK_CUSTOM,p as HEADER_UTIL_STYLES,i as HEADER_UTIL_STYLE_FALLBACK,x as UNDER_HEADER_SHEET_CLASS,T as headerSolidBackground,u as isProductPage,b as readHeaderLinkOpacity,D as readHeaderTopInk,A as resolveHeaderHeightPx,L as resolveMenuRow,H as resolveNavTextCase,d as resolveUtilStyle};
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 y from"../../../../../components/BoxHeaderBar.js";import C from"../../../../../components/SectionGroupBody.js";import{headerBarFromProps as f}from"../../../published-header-bar.js";import{SiteHeaderMeta as u}from"./meta.js";const S={...u,render:({sections:a,navTextCase:n,toolTextStyle:p,menuRow:d,sticky:m,topTextColor:s,topTextCustom:x,linkOpacity:c,heightPx:h,sectionAccent:l,editor:t,...o})=>{const r=i(C,{place:"header",sections:a,widths:o,navTextCase:n,menuRow:d,toolTextStyle:p,editing:t?.isEditing});if(!t?.isEditing)return r;const e=f({sticky:m,topTextColor:s,topTextCustom:x,linkOpacity:c,heightPx:h,sectionAccent:l,...o});return i(y,{sticky:e.sticky,topTextColor:e.topTextColor,topTextCustom:e.topTextCustom,linkOpacity:e.linkOpacity,heightPx:e.heightPx,theme:e.theme,bandCapped:e.bandCapped,children:r})}};export{S as SiteHeaderRender};
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};