efficient-storefront-blocks 0.125.14 → 0.125.16
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 +19 -0
- package/dist/editor/components/CountryShowAsTiles.d.ts +3 -2
- package/dist/editor/components/CountryShowAsTiles.js +1 -1
- package/dist/editor/components/HeaderSettingsPanel.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +1 -0
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/index.js +26 -26
- package/dist/render/app/globals.css +100 -0
- package/dist/render/components/Collections.js +1 -1
- package/dist/render/components/CountrySelect.js +1 -1
- package/dist/render/components/HeaderTools.d.ts +1 -0
- package/dist/render/components/HeaderTools.js +1 -1
- package/dist/render/lib/content/country-show-as.d.ts +6 -3
- package/dist/render/lib/content/country-show-as.js +1 -1
- package/dist/render/lib/sections/fill-row.d.ts +3 -1
- package/dist/render/lib/sections/fill-row.js +1 -1
- package/dist/render/lib/sections/grid-no-hole.d.ts +1 -0
- package/dist/render/lib/sections/grid-no-hole.js +1 -1
- package/dist/render/lib/sections/product-grid-columns.d.ts +6 -0
- package/dist/render/lib/sections/product-grid-columns.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/dist/words.d.ts +1 -0
- package/dist/words.js +1 -1
- package/package.json +1 -1
|
@@ -4380,3 +4380,103 @@ em.text-accent {
|
|
|
4380
4380
|
.sf-card-words-over [data-part="image-block"] [data-part="image-frame"] {
|
|
4381
4381
|
margin: 0;
|
|
4382
4382
|
}
|
|
4383
|
+
|
|
4384
|
+
/* A CARD GRID NEVER DRAWS A CARD UNDER ITS MINIMUM WIDTH (2026-11-24).
|
|
4385
|
+
A Product Grid set to 4 or 6 columns drew its cards at about 155 px when the
|
|
4386
|
+
grid itself was narrow (a half-width box, a narrow frame): its tracks were
|
|
4387
|
+
a fixed `repeat(N, 1fr)`. A normal shop drops columns at that width, and
|
|
4388
|
+
the cards wrap to the next row.
|
|
4389
|
+
The grid's set column count stays its MAXIMUM. `--sf-cols` is that count at
|
|
4390
|
+
this width, read from the grid's own `grid-cols-N` classes (and set lower
|
|
4391
|
+
by the fill-the-row and no-hole rules, lib/sections/fill-row). The tracks
|
|
4392
|
+
are `auto-fill`, and each track is at least the larger of:
|
|
4393
|
+
- the view's card minimum (`--sf-card-min-*`, the numbers of
|
|
4394
|
+
lib/sections/product-grid-columns `CARD_MIN_WIDTH_PX`), and
|
|
4395
|
+
- a little more than 1/(N+1) of the grid, so the grid never draws more
|
|
4396
|
+
than N columns.
|
|
4397
|
+
Where N cards of the minimum fit, the grid draws exactly N equal tracks,
|
|
4398
|
+
the same as `repeat(N, 1fr)`: no grid that fits moves. `min(100%, …)` keeps
|
|
4399
|
+
one card inside a grid narrower than the minimum. The minimums are numbers
|
|
4400
|
+
of px (the code's numbers), made a length where the track reads them.
|
|
4401
|
+
Unlayered, so it beats Tailwind's `grid-cols-N` in `@layer utilities`.
|
|
4402
|
+
scripts/browser-grid-card-min-width.tsx measures it at 375-1440. */
|
|
4403
|
+
:root {
|
|
4404
|
+
--sf-card-min-phone: 140;
|
|
4405
|
+
--sf-card-min-tablet: 200;
|
|
4406
|
+
--sf-card-min-desktop: 200;
|
|
4407
|
+
}
|
|
4408
|
+
.sf-card-tracks {
|
|
4409
|
+
--sf-card-min: var(--sf-card-min-desktop);
|
|
4410
|
+
grid-template-columns: repeat(
|
|
4411
|
+
auto-fill,
|
|
4412
|
+
minmax(min(100%, max(calc(var(--sf-card-min) * 1px), calc(100% / (var(--sf-cols) + 1) + 1px), var(--sf-card-skip))), 1fr)
|
|
4413
|
+
);
|
|
4414
|
+
}
|
|
4415
|
+
.sf-card-tracks.grid-cols-1 { --sf-cols: 1; }
|
|
4416
|
+
.sf-card-tracks.grid-cols-2 { --sf-cols: 2; }
|
|
4417
|
+
.sf-card-tracks.grid-cols-3 { --sf-cols: 3; }
|
|
4418
|
+
.sf-card-tracks.grid-cols-4 { --sf-cols: 4; }
|
|
4419
|
+
.sf-card-tracks.grid-cols-5 { --sf-cols: 5; }
|
|
4420
|
+
.sf-card-tracks.grid-cols-6 { --sf-cols: 6; }
|
|
4421
|
+
@media not all and (min-width: 1100px) {
|
|
4422
|
+
.sf-card-tracks { --sf-card-min: var(--sf-card-min-tablet); }
|
|
4423
|
+
.sf-card-tracks.max-view-desktop\:grid-cols-1 { --sf-cols: 1; }
|
|
4424
|
+
.sf-card-tracks.max-view-desktop\:grid-cols-2 { --sf-cols: 2; }
|
|
4425
|
+
.sf-card-tracks.max-view-desktop\:grid-cols-3 { --sf-cols: 3; }
|
|
4426
|
+
.sf-card-tracks.max-view-desktop\:grid-cols-4 { --sf-cols: 4; }
|
|
4427
|
+
.sf-card-tracks.max-view-desktop\:grid-cols-5 { --sf-cols: 5; }
|
|
4428
|
+
.sf-card-tracks.max-view-desktop\:grid-cols-6 { --sf-cols: 6; }
|
|
4429
|
+
}
|
|
4430
|
+
@media not all and (min-width: 800px) {
|
|
4431
|
+
.sf-card-tracks { --sf-card-min: var(--sf-card-min-phone); }
|
|
4432
|
+
.sf-card-tracks.max-view-wide\:grid-cols-1 { --sf-cols: 1; }
|
|
4433
|
+
.sf-card-tracks.max-view-wide\:grid-cols-2 { --sf-cols: 2; }
|
|
4434
|
+
.sf-card-tracks.max-view-wide\:grid-cols-3 { --sf-cols: 3; }
|
|
4435
|
+
}
|
|
4436
|
+
|
|
4437
|
+
/* NO CARD ALONE ON THE LAST ROW (2026-11-24, Lewis "two rows"). When the grid
|
|
4438
|
+
drops columns for the minimum above, it skips a count whose last row would
|
|
4439
|
+
be less than half full: 4 cards draw 4, then 2, then 1, never 3 + 1. The set
|
|
4440
|
+
column count is the merchant's and is never skipped; 1 and 2 columns always
|
|
4441
|
+
pass. One rule per card count (2-12) that has such a count; `--sf-card-skip`
|
|
4442
|
+
is a track minimum that rules out count k (`100% / k + 1px`), switched off
|
|
4443
|
+
(made negative) when the next count that passes, at most the set count,
|
|
4444
|
+
fits at the minimum, or when k is not below the set count. `--sf-card-gap`
|
|
4445
|
+
is the grid's column gap as the gap zone sets it (16 px, 12 on a phone, for
|
|
4446
|
+
a grid with no zone length: the Collections cards' `gap-4` / `gap-3`).
|
|
4447
|
+
A card the `limit` cap hides still counts here, as in lib/sections/fill-row.
|
|
4448
|
+
scripts/browser-grid-card-min-width.tsx measures it. */
|
|
4449
|
+
.sf-card-tracks {
|
|
4450
|
+
--sf-card-skip: 0px;
|
|
4451
|
+
--sf-card-gap: var(--sf-gap-len, 16px);
|
|
4452
|
+
}
|
|
4453
|
+
@media not all and (min-width: 1100px) {
|
|
4454
|
+
.sf-card-tracks { --sf-card-gap: var(--sf-gap-len-tablet, var(--sf-gap-len, 16px)); }
|
|
4455
|
+
}
|
|
4456
|
+
@media not all and (min-width: 800px) {
|
|
4457
|
+
.sf-card-tracks { --sf-card-gap: var(--sf-gap-len-phone, calc(var(--sf-gap-len, 24px) / 2)); }
|
|
4458
|
+
}
|
|
4459
|
+
.sf-card-tracks:has(> :nth-child(4)):not(:has(> :nth-child(5))) {
|
|
4460
|
+
--sf-card-skip: calc(100% / 3 + 1px - clamp(0px, (100% - (min(4, var(--sf-cols)) * var(--sf-card-min) * 1px + (min(4, var(--sf-cols)) - 1) * var(--sf-card-gap))) * 1000, 100000px) - clamp(0px, (3 + 1 - var(--sf-cols)) * 100000px, 100000px));
|
|
4461
|
+
}
|
|
4462
|
+
.sf-card-tracks:has(> :nth-child(5)):not(:has(> :nth-child(6))) {
|
|
4463
|
+
--sf-card-skip: calc(100% / 4 + 1px - clamp(0px, (100% - (min(5, var(--sf-cols)) * var(--sf-card-min) * 1px + (min(5, var(--sf-cols)) - 1) * var(--sf-card-gap))) * 1000, 100000px) - clamp(0px, (4 + 1 - var(--sf-cols)) * 100000px, 100000px));
|
|
4464
|
+
}
|
|
4465
|
+
.sf-card-tracks:has(> :nth-child(6)):not(:has(> :nth-child(7))) {
|
|
4466
|
+
--sf-card-skip: calc(100% / 5 + 1px - clamp(0px, (100% - (min(6, var(--sf-cols)) * var(--sf-card-min) * 1px + (min(6, var(--sf-cols)) - 1) * var(--sf-card-gap))) * 1000, 100000px) - clamp(0px, (5 + 1 - var(--sf-cols)) * 100000px, 100000px));
|
|
4467
|
+
}
|
|
4468
|
+
.sf-card-tracks:has(> :nth-child(7)):not(:has(> :nth-child(8))) {
|
|
4469
|
+
--sf-card-skip: max(calc(100% / 3 + 1px - clamp(0px, (100% - (min(4, var(--sf-cols)) * var(--sf-card-min) * 1px + (min(4, var(--sf-cols)) - 1) * var(--sf-card-gap))) * 1000, 100000px) - clamp(0px, (3 + 1 - var(--sf-cols)) * 100000px, 100000px)), calc(100% / 5 + 1px - clamp(0px, (100% - (min(6, var(--sf-cols)) * var(--sf-card-min) * 1px + (min(6, var(--sf-cols)) - 1) * var(--sf-card-gap))) * 1000, 100000px) - clamp(0px, (5 + 1 - var(--sf-cols)) * 100000px, 100000px)));
|
|
4470
|
+
}
|
|
4471
|
+
.sf-card-tracks:has(> :nth-child(9)):not(:has(> :nth-child(10))) {
|
|
4472
|
+
--sf-card-skip: calc(100% / 4 + 1px - clamp(0px, (100% - (min(5, var(--sf-cols)) * var(--sf-card-min) * 1px + (min(5, var(--sf-cols)) - 1) * var(--sf-card-gap))) * 1000, 100000px) - clamp(0px, (4 + 1 - var(--sf-cols)) * 100000px, 100000px));
|
|
4473
|
+
}
|
|
4474
|
+
.sf-card-tracks:has(> :nth-child(10)):not(:has(> :nth-child(11))) {
|
|
4475
|
+
--sf-card-skip: calc(100% / 3 + 1px - clamp(0px, (100% - (min(4, var(--sf-cols)) * var(--sf-card-min) * 1px + (min(4, var(--sf-cols)) - 1) * var(--sf-card-gap))) * 1000, 100000px) - clamp(0px, (3 + 1 - var(--sf-cols)) * 100000px, 100000px));
|
|
4476
|
+
}
|
|
4477
|
+
.sf-card-tracks:has(> :nth-child(11)):not(:has(> :nth-child(12))) {
|
|
4478
|
+
--sf-card-skip: calc(100% / 5 + 1px - clamp(0px, (100% - (min(6, var(--sf-cols)) * var(--sf-card-min) * 1px + (min(6, var(--sf-cols)) - 1) * var(--sf-card-gap))) * 1000, 100000px) - clamp(0px, (5 + 1 - var(--sf-cols)) * 100000px, 100000px));
|
|
4479
|
+
}
|
|
4480
|
+
.sf-card-tracks:has(> :nth-child(12)):not(:has(> :nth-child(13))) {
|
|
4481
|
+
--sf-card-skip: calc(100% / 5 + 1px - clamp(0px, (100% - (min(6, var(--sf-cols)) * var(--sf-card-min) * 1px + (min(6, var(--sf-cols)) - 1) * var(--sf-card-gap))) * 1000, 100000px) - clamp(0px, (5 + 1 - var(--sf-cols)) * 100000px, 100000px));
|
|
4482
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as u,jsx as e,jsxs as s}from"react/jsx-runtime";import{useScopeClass as
|
|
1
|
+
"use client";import{Fragment as u,jsx as e,jsxs as s}from"react/jsx-runtime";import{useScopeClass as w}from"../lib/use-scope-class.js";import S from"efficient-web-builder/render/components/SectionHeader";import{SectionTextParts as N}from"efficient-web-builder/render/lib/document/editing-bridges";import{CollectionCardStyleContext as A}from"./CollectionCard.js";import{CARD_TRACKS_CLASS as $,fillRowCss as P}from"../lib/sections/fill-row.js";import{renderHeadline as F}from"efficient-web-builder/render/components/goldPhrases";import{CONTENT_CAP_GUTTER as c}from"../lib/sections/content-cap-gutter.js";import{FRAME_ROOM_DESKTOP_BOTTOM as v,FRAME_ROOM_DESKTOP_Y as y,FRAME_ROOM_NO_TOP as H,FRAME_ROOM_NO_TOP_PHONE as j,FRAME_ROOM_PHONE_BOTTOM as B,FRAME_ROOM_PHONE_Y as I}from"../lib/sections/band-padding.js";import{withSideOnce as L}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as b}from"efficient-web-builder/render/components/SideSpaceOnce";import{withRootPad as D}from"efficient-web-builder/render/lib/content/section-own-pads";import{useSectionPad as K}from"./SectionPadScope.js";function k({editing:i,nodeId:o,children:r}){return!i||!o?e(u,{children:r}):e(N,{nodeId:o,sectionType:"Collections",children:r})}const U=`${c} ${y} max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] ${I}`,W=`${c} ${H} ${v} max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] ${j} ${B}`,X=`${c} max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]`,Y={2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5"};function G({eyebrow:i,heading:o,columns:r,showPrice:x,cardStyle:C,layout:M,limit:t,cards:l,template:d,omitHead:a=!1,nodeId:m,partStyles:R,editing:O=!1}={}){const g=b(),E=K(),n=w("cg"),h=typeof t=="number"&&t>0,T=M==="list"?"grid-cols-1":r===void 0?"grid-cols-3":Y[Math.min(5,Math.max(2,Math.round(r)))]??"grid-cols-3",p=`${n} grid ${$} ${T} gap-4 max-view-wide:grid-cols-1 max-view-wide:gap-3`,f=P(n,p,{limit:t}),_=Number(d?.blockCount??0)>0;return s("section",{...D(L(a?_?X:W:U,g),E),children:[a?null:e(S,{num:i!==void 0?i:"01 / Collections",accentNum:!0,title:o!==void 0?F(o,!1):s(u,{children:["Three ranges,",e("br",{}),"one standard."]}),link:{text:"View all",href:"/wheels"}}),l&&e(k,{editing:O,nodeId:m,children:s(A.Provider,{value:{showPrice:x,cardStyle:C,partStyles:R,editing:O,ownerId:m,Template:_?d:void 0},children:[h&&e("style",{children:`.${n} > *:nth-child(n+${t+1}){display:none}`}),f&&e("style",{children:f}),e(l,{className:p,minEmptyHeight:260})]})})]})}export{G as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as n,Fragment as
|
|
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};
|
|
@@ -8,6 +8,7 @@ export declare const UTIL_WORDS: {
|
|
|
8
8
|
readonly close: "Close";
|
|
9
9
|
};
|
|
10
10
|
export declare const UTIL_WORD_CLASS = "whitespace-nowrap";
|
|
11
|
+
export declare const TOOL_ICON_BUTTON_CLASS = "mono-eyebrow-ctl inline-flex items-center opacity-80 transition-opacity hover:opacity-100";
|
|
11
12
|
export declare function cartLabel(count: number): string;
|
|
12
13
|
export declare function CartButton({ onClick, count, asText, className, takesViewHide, }: {
|
|
13
14
|
onClick: () => void;
|
|
@@ -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
|
|
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,9 +1,12 @@
|
|
|
1
|
-
export type CountryShowAs = "name" | "code_currency" | "globe_code" | "currency" | "flag_code" | "flag";
|
|
2
|
-
|
|
1
|
+
export type CountryShowAs = "name" | "code_currency" | "globe_code" | "currency" | "flag_code" | "flag" | "globe";
|
|
2
|
+
type ShowAsChoice = {
|
|
3
3
|
value: CountryShowAs;
|
|
4
4
|
label: string;
|
|
5
|
-
}
|
|
5
|
+
};
|
|
6
|
+
export declare const COUNTRY_SHOW_AS: readonly ShowAsChoice[];
|
|
7
|
+
export declare const HEADER_ROW_SHOW_AS: readonly ShowAsChoice[];
|
|
6
8
|
export declare const COUNTRY_SHOW_AS_LABEL = "Show as";
|
|
7
9
|
export declare const COUNTRY_SHOW_AS_DEFAULT: CountryShowAs;
|
|
8
10
|
export declare function resolveCountryShowAs(v: unknown): CountryShowAs;
|
|
9
11
|
export declare const countryShowAsHasFlag: (v: CountryShowAs) => boolean;
|
|
12
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const l=[{value:"name",label:"Country name"},{value:"code_currency",label:"Code and currency"},{value:"globe_code",label:"Globe and code"},{value:"currency",label:"Currency"},{value:"flag_code",label:"Flag and code"},{value:"flag",label:"Flag"},{value:"globe",label:"Globe"}],n=l.filter(e=>e.value!=="globe"),r="Show as",a="name";function c(e){return l.some(o=>o.value===e)?e:a}const u=e=>e==="flag_code"||e==="flag";export{l as COUNTRY_SHOW_AS,a as COUNTRY_SHOW_AS_DEFAULT,r as COUNTRY_SHOW_AS_LABEL,n as HEADER_ROW_SHOW_AS,u as countryShowAsHasFlag,c as resolveCountryShowAs};
|
|
@@ -9,7 +9,9 @@ export interface GridColumns {
|
|
|
9
9
|
export declare function gridColumnsOf(gridClass: string): GridColumns;
|
|
10
10
|
export declare function fillRowColumns(columns: number, cards: number): number;
|
|
11
11
|
export declare function fillRow(grid: GridColumns, cards: number): GridColumns;
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const CARD_TRACKS_CLASS = "sf-card-tracks";
|
|
13
|
+
export declare const hasCardTracks: (gridClass: string) => boolean;
|
|
14
|
+
export declare const gridTracks: (n: number, cardTracks?: boolean) => string;
|
|
13
15
|
export interface FillRowCards {
|
|
14
16
|
limit?: number;
|
|
15
17
|
cards?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{breakpointOf as
|
|
1
|
+
import{breakpointOf as x}from"efficient-web-builder/format/lib/content/view-lines";function h(n){const o=/(?:^|\s)grid-cols-(\d+)(?=\s|$)/.exec(n);if(!o)throw new Error(`gridColumnsOf: no base grid-cols-N in "${n}"`);const e=[...n.matchAll(/(?:^|\s)(max-[\w[\]-]+):grid-cols-(\d+)(?=\s|$)/g)].flatMap(t=>{const s=x(t[1]);return s?.max?[{below:s.px,columns:Number(t[2])}]:[]}).sort((t,s)=>s.below-t.below);return{base:Number(o[1]),steps:e}}function f(n,o){return Math.max(1,Math.min(n,Math.floor(o)))}function M(n,o){return{base:f(n.base,o),steps:n.steps.map(e=>({below:e.below,columns:f(e.columns,o)}))}}const w="sf-card-tracks",$=n=>n.split(/\s+/).includes(w),p=(n,o=!1)=>o?`--sf-cols:${n}`:`grid-template-columns:repeat(${n},minmax(0,1fr))`;function C(n,o,{limit:e,cards:t}={}){const s=h(o),l=$(o),u=typeof e=="number"&&e>0?e:void 0,d=Math.max(s.base,...s.steps.map(r=>r.columns));if(t!==void 0&&Math.min(t,u??1/0)>=d)return"";const a=[];for(const r of b(s)){const c=u===void 0?r.columns:f(r.columns,u),m=[];c<r.columns&&m.push(`.${n}.${n}{${p(c,l)}}`);for(let i=c-1;i>=1;i--)m.push(`.${n}:not(:has(> :nth-child(${i+1}))){${p(i,l)}}`);a.push(g(r,m))}return a.join("")}function b({base:n,steps:o}){return[{min:o[0]?.below,max:void 0,columns:n},...o.map((e,t)=>({min:o[t+1]?.below,max:e.below,columns:e.columns}))]}function g(n,o){if(o.length===0)return"";const e=n.min!==void 0&&n.max!==void 0?`(${n.min}px <= width < ${n.max}px)`:n.max!==void 0?`(width < ${n.max}px)`:n.min!==void 0?`(width >= ${n.min}px)`:void 0;return e?`@media ${e}{${o.join("")}}`:o.join("")}export{w as CARD_TRACKS_CLASS,M as fillRow,f as fillRowColumns,C as fillRowCss,b as gridBands,h as gridColumnsOf,p as gridTracks,$ as hasCardTracks,g as inBand};
|
|
@@ -6,6 +6,7 @@ export interface NoHoleBand {
|
|
|
6
6
|
band: GridBand;
|
|
7
7
|
cards: number;
|
|
8
8
|
tracks: number;
|
|
9
|
+
cardTracks?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare function noHoleBands(gridClass: string, spans: readonly number[], limit: number | undefined, topUp?: boolean): NoHoleBand[];
|
|
11
12
|
export declare function showsASetCard(spans: readonly number[], limit: number | undefined): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{gridBands as l,gridColumnsOf as
|
|
1
|
+
import{gridBands as l,gridColumnsOf as d,gridTracks as p,hasCardTracks as x,inBand as m}from"./fill-row.js";import{VIEW_LINE_PX as w}from"efficient-web-builder/format/lib/content/view-lines";const k=w["view-wide"];function M(t,e){const n=[],s=(o,r,a)=>{for(let c=r;c<r+a;c++)if(n[o][c])return!1;return!0};for(const o of t){const r=Math.max(1,Math.min(e,o));for(let a=0;;a++){n[a]??=Array(e).fill(!1);let c=0;for(;c+r<=e&&!s(a,c,r);)c++;if(!(c+r>e)){for(let i=c;i<c+r;i++)n[a][i]=!0;break}}}return n.every(o=>o.every(Boolean))}const f=(t,e)=>t.reduce((n,s)=>n+Math.max(1,Math.min(e,s)),0),u=(t,e)=>M(t,Math.min(e,Math.max(1,f(t,e))));function $(t,e,n,s=!0){const o=Math.min(t.length,n&&n>0?n:t.length);if(o===0||u(t.slice(0,o),e))return o;if(s){for(let r=o+1;r<=t.length;r++)if(u(t.slice(0,r),e))return r}for(let r=o-1;r>=1;r--)if(u(t.slice(0,r),e))return r;return o}const E=(t,e)=>e.max!==void 0&&e.max<=k?t.map(()=>1):t;function C(t,e,n,s=!0){const o=x(t);return l(d(t)).map(r=>{const a=E(e,r),c=$(a,r.columns,n,s),i=f(a.slice(0,c),r.columns);return{band:r,cards:c,tracks:Math.min(r.columns,Math.max(1,i)),...o?{cardTracks:o}:{}}})}function I(t,e){return t.slice(0,e&&e>0?e:t.length).some(n=>n>1)}const h="[data-set-picture=one]",S=t=>`${t}:where(:not(:has(${h})))`,T=t=>`${t}:where(:has(${h}))`;function g(t,e){return`.${t} > *:nth-child(n+${e}){display:none!important}`}function W(t,e,n){const s=[`.${t}{grid-auto-flow:row dense}`];for(const{band:o,cards:r,tracks:a,cardTracks:c}of e){const i=[];r<n&&i.push(g(t,r+1)),a<o.columns&&i.push(`.${t}.${t}{${p(a,c)}}`),s.push(m(o,i))}return s.join("")}export{h as ONE_WHEEL_MARK,k as SET_CARD_SINGLE_BELOW,$ as cardsWithoutHole,g as hiddenCardsRule,C as noHoleBands,W as noHoleCss,T as oneWheelScope,M as packsFull,S as pairScope,I as showsASetCard};
|
|
@@ -11,6 +11,12 @@ export declare const PRODUCT_GRID_PHONE_COLUMNS: {
|
|
|
11
11
|
readonly min: 1;
|
|
12
12
|
readonly max: 3;
|
|
13
13
|
};
|
|
14
|
+
export declare const CARD_MIN_WIDTH_PX: {
|
|
15
|
+
readonly phone: 140;
|
|
16
|
+
readonly tablet: 200;
|
|
17
|
+
readonly desktop: 200;
|
|
18
|
+
};
|
|
19
|
+
export declare function cardMinWidthAt(viewportPx: number): number;
|
|
14
20
|
export declare function desktopColumns(columns: unknown): number;
|
|
15
21
|
export declare function builtInTabletColumns(columns: unknown): number;
|
|
16
22
|
export declare function productGridColumnsClass(columns: unknown, columnsPhone: unknown, columnsTablet?: unknown): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
import{CARD_TRACKS_CLASS as p}from"./fill-row.js";const C={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6"},f={1:"max-view-desktop:grid-cols-1",2:"max-view-desktop:grid-cols-2",3:"max-view-desktop:grid-cols-3",4:"max-view-desktop:grid-cols-4",5:"max-view-desktop:grid-cols-5",6:"max-view-desktop:grid-cols-6"},a={1:"max-view-wide:grid-cols-1",2:"max-view-wide:grid-cols-2",3:"max-view-wide:grid-cols-3"},s={min:1,max:6,fallback:4},u={min:1,max:6},x={min:1,max:3},d={phone:140,tablet:200,desktop:200};function T(t){return t<800?d.phone:t<1100?d.tablet:d.desktop}const c=(t,o,i)=>typeof t=="number"&&Number.isFinite(t)?Math.min(i,Math.max(o,Math.round(t))):void 0;function r(t){return c(t,s.min,s.max)??s.fallback}function _(t){const o=r(t);return o===6?3:o>=4?2:o}function k(t,o,i){const e=r(t),l=c(i,u.min,u.max)??_(e),m=c(o,x.min,x.max),n=[p,C[e]];return l!==e&&n.push(f[l]),m!==void 0?n.push(a[m]):e>1&&n.push(a[1]),n.join(" ")}function b(t){return t.template!==void 0||t.columnsTablet!==void 0||r(t.columns)!==3?t:{...t,columnsTablet:2}}export{d as CARD_MIN_WIDTH_PX,s as PRODUCT_GRID_COLUMNS,x as PRODUCT_GRID_PHONE_COLUMNS,u as PRODUCT_GRID_TABLET_COLUMNS,_ as builtInTabletColumns,T as cardMinWidthAt,r as desktopColumns,k as productGridColumnsClass,b as withRelatedTabletColumns};
|