efficient-web-builder 73.1.0 → 74.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +60 -0
- package/dist/editor/components/CustomHtmlCodeWindow.d.ts +11 -0
- package/dist/editor/components/CustomHtmlCodeWindow.js +20 -0
- package/dist/editor/components/SectionThemePicker.d.ts +3 -2
- package/dist/editor/components/SectionThemePicker.js +1 -1
- package/dist/editor/components/SiteTextStylesField.d.ts +2 -1
- package/dist/editor/components/SiteTextStylesField.js +1 -1
- package/dist/editor/components/SlotChildRows.js +1 -1
- package/dist/editor/components/StandaloneSectionEditor.js +1 -1
- package/dist/editor/components/StorefrontEditor.js +1 -1
- package/dist/editor/components/TickerSettingsPanel.js +1 -1
- package/dist/editor/components/WebsiteSettingsPanel.d.ts +2 -0
- package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
- package/dist/editor/components/storefront-editor.css +111 -0
- package/dist/editor/components/useHostDocumentBridge.js +1 -1
- package/dist/editor/lib/document/blocks/general/CustomHTML/fields.d.ts +6 -0
- package/dist/editor/lib/document/blocks/general/CustomHTML/fields.js +1 -0
- package/dist/editor/lib/document/blocks/general/Footprint/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Hero/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/HeroSingle/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/index.js +1 -1
- package/dist/editor/lib/document/blocks/hero-shared-fields.d.ts +5 -0
- package/dist/editor/lib/document/blocks/hero-shared-fields.js +1 -1
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/custom-html-preview.d.ts +12 -0
- package/dist/editor/lib/document/custom-html-preview.js +1 -0
- package/dist/editor/lib/document/footer-blocks.js +1 -1
- package/dist/editor/lib/document/own-pad-fields.d.ts +5 -0
- package/dist/editor/lib/document/own-pad-fields.js +1 -0
- package/dist/editor/lib/document/passes/inspector.js +1 -1
- package/dist/editor/lib/editor-document-adapter.js +1 -1
- package/dist/format/lib/animation/hover.js +1 -1
- package/dist/format/lib/animation/loop.js +1 -1
- package/dist/format/lib/content/accordion-row-style.d.ts +3 -1
- package/dist/format/lib/content/accordion-row-style.js +1 -1
- package/dist/format/lib/content/box-layout.js +1 -1
- package/dist/format/lib/content/box-shape.d.ts +1 -1
- package/dist/format/lib/content/button-icon.d.ts +3 -1
- package/dist/format/lib/content/button-icon.js +1 -1
- package/dist/format/lib/content/card-place.d.ts +3 -1
- package/dist/format/lib/content/card-place.js +1 -1
- package/dist/format/lib/content/chat-launcher.js +1 -1
- package/dist/format/lib/content/container-direction.js +1 -1
- package/dist/format/lib/content/footprint.d.ts +22 -0
- package/dist/format/lib/content/footprint.js +1 -1
- package/dist/format/lib/content/image-fit.js +1 -1
- package/dist/format/lib/content/image-text-rows.d.ts +5 -2
- package/dist/format/lib/content/image-text-rows.js +1 -1
- package/dist/format/lib/content/list-number.js +1 -1
- package/dist/format/lib/content/list-position.js +1 -1
- package/dist/format/lib/content/text-tag.js +1 -1
- package/dist/format/lib/document/blocks/general/Footprint/card-seed.js +1 -1
- package/dist/format/lib/document/blocks/general/text-part-shapes.json +0 -6
- package/dist/format/lib/document/box-footer.js +1 -1
- package/dist/format/lib/document/custom-html-place.d.ts +19 -0
- package/dist/format/lib/document/custom-html-place.js +7 -0
- package/dist/format/lib/document/left-view.js +1 -1
- package/dist/format/lib/document/mockup-variant-fields.js +1 -1
- package/dist/format/lib/document/part-inks.d.ts +1 -0
- package/dist/format/lib/document/part-inks.js +1 -1
- package/dist/format/lib/document/passes/types.d.ts +1 -0
- package/dist/format/lib/document/section-groups.js +1 -1
- package/dist/format/lib/editor-words-catalogue.d.ts +28 -0
- package/dist/format/lib/editor-words-catalogue.js +5 -5
- package/dist/format/lib/hero-arrows.js +1 -1
- package/dist/format/lib/hero-group-placement.js +1 -1
- package/dist/format/lib/hero-media-layout.js +1 -1
- package/dist/format/lib/hero-phone-stack.d.ts +12 -0
- package/dist/format/lib/hero-phone-stack.js +1 -1
- package/dist/format/lib/hero-video.js +1 -1
- package/dist/format/lib/reel.js +1 -1
- package/dist/format/lib/sections/divider-style.js +1 -1
- package/dist/format/lib/sections/hero-overlay.js +1 -1
- package/dist/format/lib/sections/hero-single-to-hero.js +1 -1
- package/dist/format/lib/sections/intro-bleed-layout.js +1 -1
- package/dist/format/lib/sections/logo-look.js +1 -1
- package/dist/format/lib/sections/product-card-style.js +1 -1
- package/dist/format/lib/sections/section-eyebrow-look.js +1 -1
- package/dist/format/lib/sections/section-head-placement.d.ts +3 -1
- package/dist/format/lib/sections/section-head-placement.js +1 -1
- package/dist/format/lib/sections/section-head-style.js +1 -1
- package/dist/format/lib/sections/section-number-style.js +1 -1
- package/dist/format/lib/sections/ticker-style.js +1 -1
- package/dist/format/lib/text-style-face.d.ts +6 -0
- package/dist/format/lib/text-style-face.js +2 -1
- package/dist/format/lib/theme.d.ts +2 -1
- package/dist/format/lib/theme.js +4 -4
- package/dist/render/components/BoxTabPaneContext.d.ts +2 -3
- package/dist/render/components/BoxTabs.js +1 -1
- package/dist/render/components/ButtonBlock.d.ts +2 -0
- package/dist/render/components/ButtonBlock.js +1 -1
- package/dist/render/components/DealerFinder.d.ts +7 -1
- package/dist/render/components/DealerFinder.js +1 -1
- package/dist/render/components/Footprint.d.ts +6 -2
- package/dist/render/components/Footprint.js +1 -1
- package/dist/render/components/Heading.d.ts +1 -1
- package/dist/render/components/Heading.js +1 -1
- package/dist/render/components/HeroSection.d.ts +4 -1
- package/dist/render/components/HeroSection.js +1 -1
- package/dist/render/components/HeroSingle.d.ts +4 -1
- package/dist/render/components/HeroSingle.js +1 -1
- package/dist/render/components/HeroSlide.d.ts +3 -0
- package/dist/render/components/HeroSlide.js +1 -1
- package/dist/render/components/SideListLayout.d.ts +8 -2
- package/dist/render/components/SideListLayout.js +1 -1
- package/dist/render/components/SiteGutterFrame.js +1 -1
- package/dist/render/components/Text.d.ts +1 -1
- package/dist/render/components/Text.js +1 -1
- package/dist/render/lib/content/section-padding.d.ts +36 -2
- package/dist/render/lib/content/section-padding.js +1 -1
- package/dist/render/lib/document/blocks/general/ButtonBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/general/CustomHTML/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Footprint/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Hero/render.js +1 -1
- package/dist/render/lib/document/blocks/general/HeroSingle/render.js +1 -1
- package/dist/render/lib/document/blocks/general/LocationMap/render.js +1 -1
- package/dist/render/lib/document/blocks/general/LogoBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-head-looks.js +2 -2
- package/dist/render/lib/document/blocks/general/section-to-box-rows-editorial.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-logos.js +1 -1
- package/dist/render/lib/document/custom-css.d.ts +8 -2
- package/dist/render/lib/document/custom-css.js +3 -2
- package/dist/render/lib/document/header-clearance.js +1 -1
- package/dist/render/lib/document/header-ink.js +1 -1
- package/dist/render/lib/document/passes/section-padding.d.ts +4 -0
- package/dist/render/lib/document/passes/section-padding.js +1 -1
- package/dist/render/lib/document/sanitize.d.ts +4 -1
- package/dist/render/lib/document/sanitize.js +1 -1
- package/dist/render/lib/text-styles/site-text-styles.js +2 -2
- package/dist/routine-index.json +1 -0
- package/dist/value-index.json +1 -0
- package/package.json +29 -7
- package/dist/format/lib/document/blocks/general/CustomHTML/fields.d.ts +0 -2
- package/dist/format/lib/document/blocks/general/CustomHTML/fields.js +0 -1
- package/dist/format/lib/parse-option.d.ts +0 -3
- package/dist/format/lib/parse-option.js +0 -1
package/dist/format/lib/reel.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{HERO_GROUP_PLACEMENTS as
|
|
1
|
+
import{HERO_GROUP_PLACEMENTS as u}from"./hero-group-placement.js";import{heroOverlayRailClass as c}from"./hero-overlay-anchor.js";import{parseOption as o}from"efficient-shell/format";const i=u,p="top-right",E=["cards","dots","numbers","bar","squares","tabs","largeTabs"],d=["cards","dots","numbers","bar","squares"],a="cards",L={cards:"Cards",dots:"Dots",numbers:"Numbers",bar:"Bar",squares:"Squares",tabs:"Tabs",largeTabs:"Large tabs"},_=["tabs","largeTabs"],A=!0;function n(e){return o(E,a,e)}function g(e){return o(d,a,e)}function f(e){return o(i,p,e)}const l={cards:"flex-col gap-2.5",dots:"flex-row items-center gap-2",numbers:"flex-col gap-2",bar:"h-0.5 w-[34%] max-w-[420px] gap-px overflow-hidden rounded-full",squares:"flex-col gap-0",tabs:"flex-row items-stretch w-full overflow-x-auto",largeTabs:"items-stretch border-y border-line"};function h(e,r){return c(f(r),l[n(e)])}function P(e){return`flex ${l[n(e)]}`}function T(e){return e.shown!==!1&&(e.count??0)>1}function m(e){return{name:e.dataset.slideName||"",process:e.dataset.slideProcess||"",video:e.dataset.slideMedia==="video"}}function x(e,r){return e===r?!0:e.length!==r.length?!1:e.every((t,s)=>t.name===r[s].name&&t.process===r[s].process&&t.video===r[s].video)}function H(e,r){const t=Array.from(r,m);return x(e,t)?e:t}export{_ as BOX_TAB_SHAPES,d as HERO_REEL_SHAPES,i as REEL_PLACEMENTS,p as REEL_PLACEMENT_DEFAULT,E as REEL_SHAPES,a as REEL_SHAPE_DEFAULT,L as REEL_SHAPE_LABELS,A as REEL_SHOWN_DEFAULT,H as nextReel,g as normaliseHeroReelShape,f as normaliseReelPlacement,n as normaliseReelShape,h as reelRailClass,T as reelShown,P as reelSurfaceRailClass,x as sameReel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as t}from"
|
|
1
|
+
import{parseOption as t}from"efficient-shell/format";const i="line",o=[{label:"None",value:"none"},{label:"Line",value:"line"},{label:"Stripes · fine",value:"stripes-fine"},{label:"Stripes · medium",value:"stripes-medium"},{label:"Stripes · bold",value:"stripes-bold"}],p={"stripes-fine":{ink:4,period:12},"stripes-medium":{ink:8,period:18},"stripes-bold":{ink:14,period:28}},u=28,s="-45deg",l="color-mix(in oklab, var(--accent) 50%, var(--bg))";function a(e){return e!=="line"&&e!=="none"}const c={sm:24,md:48,lg:80},I="md",E=Object.keys(c);function D(e){return t(E,I,e)}function S(e){return t(o,i,e)}function _(e){if(!a(e))return null;const{ink:n,period:r}=p[e];return`repeating-linear-gradient(${s}, ${l} 0 ${n}px, transparent ${n}px ${r}px)`}const x={kind:"border",unitKey:"thicknessUnit"},R={kind:"size",base:"%",unitKey:"lengthPctUnit"};export{I as DEFAULT_DIVIDER_SPACING,i as DEFAULT_DIVIDER_STYLE,R as DIVIDER_LENGTH_ROW,c as DIVIDER_SPACE_PX,o as DIVIDER_STYLE_OPTIONS,x as DIVIDER_THICKNESS_ROW,s as STRIPE_ANGLE,u as STRIPE_BAND_HEIGHT_PX,p as STRIPE_GEOMETRY,l as STRIPE_INK,a as isStriped,D as parseDividerSpacing,S as parseDividerStyle,_ as stripeBackground};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hexToRgb as c}from"efficient-shell/format";import{
|
|
1
|
+
import{hexToRgb as c,parseOption as f}from"efficient-shell/format";import{DEFAULT_TINT as l}from"../content/tint.js";import{nonEmptyString as i}from"../non-empty-string.js";const p="bottom",S=l,m=[{label:"Bottom",value:"bottom",cell:"bottom"},{label:"Top",value:"top",cell:"top"},{label:"Left",value:"left",cell:"left"},{label:"Right",value:"right",cell:"right"}],T={bottom:180,top:0,left:270,right:90},b=[[.55,0],[.15,18],[null,35],[null,55],[.85,100]],g=[[null,33],[.6,67],[.94,100]];function L(o,n){const{r:t,g:r,b:e}=c(o)??c(l);return`rgba(${t},${r},${e},${n})`}function a(o){return f(m,p,o)}function _(o=l,n=p){const t=a(n),u=(t==="top"||t==="bottom"?b:g).map(([s,O])=>`${s===null?"transparent":L(o,s)} ${O}%`);return`linear-gradient(${T[t]}deg, ${u.join(", ")})`}function I(o,n){const t=i(o.overlayColor),r=i(o.overlayPosition),e=i(n)??l;return!t&&!r?{own:!1,color:e,position:null}:{own:!0,color:t??e,position:a(r)}}export{S as DEFAULT_OVERLAY_COLOR,p as DEFAULT_OVERLAY_POSITION,m as OVERLAY_POSITION_OPTIONS,_ as overlayGradient,a as parseOverlayPosition,I as slideOverlayState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SECTION_CSS_KEY as
|
|
1
|
+
import{SECTION_CSS_KEY as S}from"../content/section-css.js";import{ENTRANCE_STORE_KEYS as f,LEGACY_ENTRANCE_KEY as E}from"../animation/entrance-keys.js";import{SCROLL_STORE_KEYS as u}from"../animation/scroll.js";import{PICTURE_DOTS as T,viewFocusKeys as _}from"../content/picture-focus-rows.js";import{SECTION_PIN_KEYS as O}from"../content/section-sticky.js";import{SECTION_CORNERS_ROW as v}from"../content/section-corners.js";import{SECTION_BORDER_UNIT_KEYS as b}from"../content/borders.js";import{SECTION_WIDTH_KEYS as H}from"../content/section-width.js";import{DEFAULT_TINT as w}from"../content/tint.js";import{finiteNumber as g}from"../finite-number.js";import{nonEmptyString as d}from"../non-empty-string.js";import{DEFAULT_OVERLAY_POSITION as C}from"./hero-overlay.js";import{normaliseVideoSource as x}from"../hero-video.js";import{heroMediaType as I}from"../hero-media-layout.js";import{VIEW_HIDE_KEYS as k}from"../content/view-hide-class.js";import{ownEntry as N}from"../own-entry.js";import{seedNodeId as R}from"../document/seed-parts.js";const P=50,h=["phoneWordsTop","phoneWordsBottom","phoneBoxGap"],c=["mediaImage","mediaVideo","poster","tintColor","mediaLayout","mediaLayoutPhone","mediaImage2","tintColor2","tintOpacity2","videoSource","youtubeUrl","videoPlayback","_partMotion",...T.filter(s=>s.block==="HeroSingle").flatMap(s=>_(s.focus))],A=[S,"heightDesktop","heightMobile","heightFixed","heightFixedTablet","heightFixedMobile","sectionCorners",v.unitKey,"sectionCornerSides","sectionBorder","sectionBorderTablet","sectionBorderPhone",...b,"sectionAccent",...O,"anchor",...f,E,...u,...Object.values(H),...k],D=new Set(A),K="the Hero does not read this key as a section setting (only the section pass rows both heroes share carry), so it is not copied",L={eyebrow:"the single Hero stopped drawing its own copy on 2026-09-09 (owner: delete the old text); the words are blocks in its boxes, which the slide keeps",titleTop:"the single Hero stopped drawing its own copy on 2026-09-09 (owner: delete the old text); the words are blocks in its boxes, which the slide keeps",titleLevel:"it set the level of the copy the single Hero stopped drawing on 2026-09-09; a Text block in a box sets its own level",alignment:"its row was deleted on 2026-09-09 with the copy it placed; a box places itself on nine anchors, and the value was drawn by nothing"};function oe(s){const e=s.props,p=R(e,"HeroSingle"),i=[],n=[],t={id:`${p}~slide`},r={id:`${p}~hero`},a=I("HeroSingle",e.mediaType);t.mediaType=a,"mediaType"in e&&i.push({key:"mediaType",home:"HeroSlide.mediaType"}),a==="video"&&x(e.videoSource)==="upload"&&(t.videoSpeed=P);for(const o of c)o in e&&(t[o]=e[o],i.push({key:o,home:`HeroSlide.${o}`}));"tintOpacity"in e&&(t.overlay=e.tintOpacity,i.push({key:"tintOpacity",home:"HeroSlide.overlay (Image tint)"})),t.overlayColor=d(e.overlayColor)??w,t.overlayPosition=d(e.overlayPosition)??C,"overlayColor"in e&&i.push({key:"overlayColor",home:"HeroSlide.overlayColor"}),"overlayPosition"in e&&i.push({key:"overlayPosition",home:"HeroSlide.overlayPosition"}),Array.isArray(e.boxes)?(t.groups=e.boxes,i.push({key:"boxes",home:"HeroSlide.groups (the same HeroGroup boxes)"})):"boxes"in e&&i.push({key:"boxes",home:"HeroSlide.groups (none stored)"}),r.textureOpacity=g(e.overlay)??100,"overlay"in e&&i.push({key:"overlay",home:"Hero.textureOpacity (the ramp's opacity)"}),r.showTicker=!1;for(const o of h)o in e&&(r[o]=e[o],i.push({key:o,home:`Hero.${o}`}));const y=new Set(["id","mediaType","tintOpacity","overlay","overlayColor","overlayPosition","boxes",...c,...h]);for(const[o,m]of Object.entries(e)){if(y.has(o))continue;const l=N(L,o);if(l!==void 0){n.push({key:o,why:l});continue}if(!D.has(o)){n.push({key:o,why:K});continue}r[o]=m,i.push({key:o,home:`Hero.${o} (section pass)`})}return r.slides=[{type:"HeroSlide",props:t}],{node:{type:"Hero",props:r},carried:i,dropped:n}}export{A as HERO_SECTION_PASS_KEYS,oe as heroSingleToHero};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as t}from"
|
|
1
|
+
import{parseOption as t}from"efficient-shell/format";const n="[--intro-edge:60px] max-[960px]:[--intro-edge:24px]",r="overlay",p=[{label:"Copy over image",value:"overlay"},{label:"Copy above image",value:"stacked"}];function l(e){return t(p,r,e)}const x={desktop:40,mobile:45,min:20,max:80,step:5};function _(e,o){return`${typeof e=="number"?e:o}%`}export{r as DEFAULT_INTRO_BLEED_LAYOUT,x as INTRO_BLEED_COPY_SHARE,p as INTRO_BLEED_LAYOUT_OPTIONS,n as INTRO_EDGE_CLASS,l as parseIntroBleedLayout,_ as resolveCopyShare};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as l}from"
|
|
1
|
+
import{parseOption as l}from"efficient-shell/format";const e="plain",o=[{label:"Plain",value:"plain"},{label:"Cards",value:"cards"},{label:"Marks",value:"marks"},{label:"Chips",value:"chips"}],r=a=>l(o,e,a);export{e as DEFAULT_LOGO_LOOK,o as LOGO_LOOK_OPTIONS,r as parseLogoLook};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as o}from"
|
|
1
|
+
import{parseOption as o}from"efficient-shell/format";const a="off",l="none",i=[{label:"None",value:"off"},{label:"1, 2, 3",value:"plain"},{label:"01, 02, 03",value:"padded"},{label:"N°01, N°02",value:"numero"}],c=[{label:"None",value:"none"},{label:"Hairline",value:"hairline"}];function u(e){return o(i,a,e)}function x(e){return o(c,l,e)}const t="sf-card-index",n="sf-card-index",N="pointer-events-none absolute left-[18px] top-[18px] z-10 border border-line bg-bg/70 px-2 py-1 font-mono text-[length:var(--size-label,10px)] uppercase tracking-[0.16em] text-fg-dim",d={plain:`counter(${n})`,padded:`counter(${n}, decimal-leading-zero)`,numero:`"N°" counter(${n}, decimal-leading-zero)`};function f(e,r){return r==="off"?"":`.${e}{counter-reset:${n}}.${e} .${t}{counter-increment:${n}}.${e} .${t}::before{content:${d[r]}}`}function _(e){return e==="hairline"?"border border-line hover:border-accent":""}export{N as CARD_INDEX_BADGE_CLASS,t as CARD_INDEX_CLASS,i as CARD_INDEX_OPTIONS,c as CARD_OUTLINE_OPTIONS,a as DEFAULT_CARD_INDEX_FORMAT,l as DEFAULT_CARD_OUTLINE,f as cardIndexCss,_ as cardOutlineClass,u as parseCardIndexFormat,x as parseCardOutline};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as o}from"
|
|
1
|
+
import{parseOption as o}from"efficient-shell/format";import{ownEntry as t}from"../own-entry.js";const l="plain",r=[{label:"Plain",value:"plain"},{label:"Filled",value:"filled"},{label:"Line",value:"line"}],E="line",O={KeyFeatures:"filled"};function i(e){return t(O,e)??l}function L(e,n){return o(r,i(n),e)}function _(e){return o(r,E,e)}export{E as DEFAULT_EYEBROW_BLOCK_LOOK,l as DEFAULT_SECTION_EYEBROW_LOOK,O as SECTION_EYEBROW_DEFAULTS,r as SECTION_EYEBROW_LOOK_OPTIONS,i as eyebrowLookFor,_ as parseEyebrowBlockLook,L as parseSectionEyebrowLook};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { ShowWhenRule } from "efficient-shell/format";
|
|
2
2
|
import type { SectionHeadStyle } from "./section-head-style.js";
|
|
3
|
-
export type SectionHeadPlacement = "inline" | "own-box";
|
|
3
|
+
export type SectionHeadPlacement = "inline" | "own-box" | "list-column";
|
|
4
4
|
export declare const DEFAULT_SECTION_HEAD_PLACEMENT: SectionHeadPlacement;
|
|
5
5
|
export declare const SECTION_HEAD_PLACEMENT_OPTIONS: readonly {
|
|
6
6
|
label: string;
|
|
7
7
|
value: SectionHeadPlacement;
|
|
8
|
+
only?: readonly string[];
|
|
8
9
|
}[];
|
|
10
|
+
export declare const HEAD_IN_LIST_COLUMN: SectionHeadPlacement;
|
|
9
11
|
export interface SplittableSection {
|
|
10
12
|
num: string;
|
|
11
13
|
title: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as n}from"
|
|
1
|
+
import{parseOption as n}from"efficient-shell/format";import{withRowsShownWhen as o}from"../document/show-when-attach.js";import{nonEmptyString as d}from"../non-empty-string.js";import{hasOwnEntry as l}from"../own-entry.js";const a="inline",s=[{label:"In this section",value:"inline"},{label:"In its own box",value:"own-box"},{label:"In the list column",value:"list-column",only:["Footprint"]}],y="list-column";function S(e){return[e.num,e.title,e.description,e.linkProp].filter(t=>d(t)!==void 0)}const p={ProductGrid:{num:"num",title:"title",description:"description",headRows:["num","title","titleSize","description","linkText","linkHref"],renderer:"ProductGridSection",padKey:"padTop",linkProp:"link"},TyreSizes:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"DynamicTyreSizes"},FitmentFinder:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"FitmentFinder"},TyreFitment:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"DynamicTyreFitment"},BundleOffer:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"DynamicRelatedProducts"},CompatibleTyres:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"DynamicRelatedProducts"},RelatedProducts:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"DynamicRelatedProducts"},SpecTable:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"SpecTable"},FAQ:{num:"num",title:"title",linkProp:"link",headRows:["num","title","linkText","linkHref"],renderer:"FAQ"},GalleryB:{num:"num",title:"title",headRows:["num","title","linkText","linkHref"],renderer:"GalleryGrid"},FitmentTable:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"FitmentTable"},Events:{num:"num",title:"title",linkProp:"link",headRows:["num","title","linkText","linkHref"],renderer:"Events"},ProcessSteps:{num:"num",title:"title",description:"description",headRows:["num","title","description"],headStyle:"editorial",renderer:"ProcessSteps",padKey:"padTop"},LongRead:{num:"headNum",title:"headTitle",description:"headDesc",headRows:["headNum","headTitle","headDesc"],headStyle:"editorial",renderer:"LongRead"},Series:{num:"headNum",title:"headTitle",description:"headDesc",headRows:["headNum","headTitle","headDesc"],headStyle:"editorial",renderer:"Series"},Subscribe:{num:"headNum",title:"headTitle",description:"headDesc",headRows:["headNum","headTitle","headDesc"],headStyle:"editorial",renderer:"Subscribe"},TimelineTrack:{num:"eyebrow",title:"title",description:"intro",headRows:["eyebrow","title","intro"],headStyle:"editorial",renderer:"TimelineTrack",padKey:"padTop"},StatsParagraph:{num:"eyebrow",title:"title",description:"desc",headRows:["eyebrow","title","desc"],headStyle:"editorial",renderer:"StatsParagraph"},Footprint:{num:"sectionNumber",title:"heading",description:"tagline",headRows:["sectionNumber","heading","tagline"],headStyle:"editorial",renderer:"Footprint",padKey:"padTop"},Collections:{num:"eyebrow",title:"heading",headRows:["eyebrow","heading"],renderer:"Collections"},Cards:{num:"eyebrow",title:"title",headRows:["eyebrow","eyebrowLook","title"],headStyle:"simple",renderer:"Cards"},Testimonials:{num:"eyebrow",title:"title",headRows:["eyebrow","eyebrowLook","title"],headStyle:"simple",renderer:"Testimonials"},Reviews:{num:"eyebrow",title:"title",headRows:["eyebrow","eyebrowLook","title"],headStyle:"simple",renderer:"Reviews"},Prose:{num:"eyebrow",title:"title",headRows:["eyebrow","title"],headStyle:"essay",renderer:"Prose"},ReviewForm:{num:"eyebrow",title:"title",headRows:["eyebrow","title"],headStyle:"simple",renderer:"ReviewForm"},DeliveryOptions:{num:"eyebrow",title:"title",description:"body",headRows:["eyebrow","title","body"],headStyle:"natural",headRowGap:"gap-3",headDescriptionSize:"text-[15px]",renderer:"DeliveryOptions"}},T="SectionHeader";function R(e){return l(p,e)}function b(e){return n(s,a,e)}const m=new Set(["Flex"]);function P(e){return!!e?.type&&m.has(e.type)}const i={not:{field:"headPlacement",is:"own-box"}},E={not:i};function x(e,t,r){return o(e,r,i)}export{a as DEFAULT_SECTION_HEAD_PLACEMENT,y as HEAD_IN_LIST_COLUMN,i as HEAD_ROWS_SHOW_WHEN,E as OWN_BOX_ROWS_SHOW_WHEN,s as SECTION_HEAD_PLACEMENT_OPTIONS,T as SECTION_HEAD_TYPE,p as SPLITTABLE_SECTIONS,R as canSplitHead,x as headFieldsForPlacement,S as headRoleProps,P as parentCapsWidth,b as parseSectionHeadPlacement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as a}from"
|
|
1
|
+
import{parseOption as a}from"efficient-shell/format";import{shownForOption as c,withRowRules as _}from"../document/show-when-attach.js";const n="standard",s=[{label:"Standard",value:"standard"},{label:"Editorial",value:"editorial"},{label:"Simple",value:"simple"},{label:"Statement",value:"statement"},{label:"Natural",value:"natural"},{label:"Essay",value:"essay"}],o=["numStyle","logoSrc","logoAlt","linkText","linkHref","_gLogo"],r=[...o,"description"],p={standard:["eyebrowLook"],editorial:[...o,"eyebrowLook"],simple:r,statement:r,natural:o,essay:r},i=["gap-5","gap-3"],S=["text-[length:var(--size-body,16px)]","text-[15px]"];function D(e){return a(i,i[0],e)}function m(e){return a(S,S[0],e)}function A(e){return a(s,n,e)}function L(e){const l=s.map(t=>t.value),u=[...new Set(Object.values(p).flat())];return _(e,u.map(t=>[[t],c("headStyle",l,n,l.filter(E=>!p[E].includes(t)))]))}export{n as DEFAULT_SECTION_HEAD_STYLE,o as EDITORIAL_HEAD_UNUSED_FIELDS,p as HEAD_UNUSED_FIELDS,S as NATURAL_DESCRIPTION_SIZES,i as NATURAL_ROW_GAPS,s as SECTION_HEAD_STYLE_OPTIONS,r as SIMPLE_HEAD_UNUSED_FIELDS,m as parseNaturalDescriptionSize,D as parseNaturalRowGap,A as parseSectionHeadStyle,L as withHeadStyleRules};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as t}from"
|
|
1
|
+
import{parseOption as t}from"efficient-shell/format";const o="solid",r=[{label:"Solid",value:"solid"},{label:"Outlined",value:"outlined"}];function l(e){return t(r,o,e)}const i="sf-secnum-outline",s="font-display text-[length:var(--size-headingMedium,clamp(48px,6vw,96px))] font-medium leading-[0.8] tracking-[-0.02em]",p=`@supports (-webkit-text-stroke: 1px currentColor){.${i}{color:var(--site-surface-2);-webkit-text-stroke:1px var(--site-line)}}`;export{o as DEFAULT_SECTION_NUMBER_STYLE,i as OUTLINED_NUMBER_CLASS,p as OUTLINED_NUMBER_CSS,s as OUTLINED_NUMBER_LAYOUT,r as SECTION_NUMBER_STYLE_OPTIONS,l as parseSectionNumberStyle};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as t}from"
|
|
1
|
+
import{parseOption as t}from"efficient-shell/format";const l="small",n="dot",s=[{label:"Small",value:"small"},{label:"Display",value:"display"}],o=[{label:"Dot ●",value:"dot"},{label:"Cross ✕",value:"cross"},{label:"Slash /",value:"slash"},{label:"Triangle ▼",value:"triangle"},{label:"None",value:"none"}],x={dot:"●",cross:"✕",slash:"/",triangle:"▼",none:""},r={small:"font-mono text-[length:var(--size-label,14px)] uppercase tracking-[0.25em] max-view-wide:text-[length:var(--size-label,12px)]",display:"font-display font-medium text-[length:var(--size-headingMedium,44px)] uppercase leading-none tracking-[0.005em] max-view-wide:text-[length:var(--size-headingMedium,28px)]"},i={small:{dot:"",cross:"text-[0.77em]",slash:"text-[0.77em]",triangle:"",none:""},display:{dot:"text-[0.3em]",cross:"text-[0.64em]",slash:"text-[0.64em]",triangle:"text-[0.3em]",none:""}};function c(e){return t(s,l,e)}function m(e){return t(o,n,e)}function u(e){return r[e]}function d(e,a){return i[e][a]}export{n as DEFAULT_TICKER_SEPARATOR,l as DEFAULT_TICKER_SIZE,x as SEPARATOR_GLYPH,o as TICKER_SEPARATOR_OPTIONS,s as TICKER_SIZE_OPTIONS,m as parseTickerSeparator,c as parseTickerSize,d as separatorScaleClass,u as tickerTypeClass};
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
export declare function faceClassOf(style: {
|
|
2
2
|
id: string;
|
|
3
3
|
}): string;
|
|
4
|
+
export declare const FACE_SIZE: Readonly<Record<string, {
|
|
5
|
+
step: string;
|
|
6
|
+
fallbackPx: number;
|
|
7
|
+
weight?: string;
|
|
8
|
+
}>>;
|
|
9
|
+
export declare function faceClassBaseCss(scope: string, markup: string): string;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
function e
|
|
1
|
+
function g(e){switch(e.id){case"heading-1":return"font-display";case"heading-2":return"font-heading2";case"heading-3":return"font-heading3";case"body-1":return"font-body";case"body-5":return"font-mono";default:return`font-${e.id}`}}const t="var(--sf-heading-weight, 500)",l={"heading-1":{step:"headingLarge",fallbackPx:76,weight:t},"heading-2":{step:"headingMedium",fallbackPx:44,weight:`var(--sf-heading-2-weight, ${t})`},"heading-3":{step:"headingSmall",fallbackPx:30,weight:`var(--sf-heading-3-weight, ${t})`},"body-1":{step:"body",fallbackPx:16},"body-5":{step:"label",fallbackPx:12}};function b(e,d){const s=new Set;for(const a of d.matchAll(/\bclass="([^"]*)"/g))for(const n of a[1].split(/\s+/))n&&s.add(n);const i=[];for(const[a,{step:n,fallbackPx:r,weight:o}]of Object.entries(l)){const f=g({id:a});if(!s.has(f))continue;const c=`var(--size-${n}, ${r}px)`,h=o?[`font-size: min(${c}, var(--sf-heading-max, 9999px))`,`font-weight: ${o}`]:[`font-size: ${c}`];i.push(`:where(${e} .${f}) { ${h.join("; ")} }`)}return i.join(`
|
|
2
|
+
`)}export{l as FACE_SIZE,b as faceClassBaseCss,g as faceClassOf};
|
|
@@ -3,7 +3,8 @@ export declare const THEME_STORAGE_KEY = "storefront-theme";
|
|
|
3
3
|
export declare const THEME_MODE_KEY = "sf:theme-mode";
|
|
4
4
|
export declare const THEME_SWITCH_KEY = "sf:theme-switch";
|
|
5
5
|
export declare const THEME_SWITCH_HIDE = "hide";
|
|
6
|
-
export
|
|
6
|
+
export declare const THEME_MODES: readonly ["light", "dark", "auto"];
|
|
7
|
+
export type ThemeMode = (typeof THEME_MODES)[number];
|
|
7
8
|
export type Theme = "light" | "dark";
|
|
8
9
|
export declare const DEFAULT_THEME_MODE: ThemeMode;
|
|
9
10
|
export declare const DEFAULT_SWITCH_SHOWN = false;
|
package/dist/format/lib/theme.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import{contrastRatio as
|
|
1
|
+
import{contrastRatio as v,hexToRgb as d,parseHexColor as s,readableInk as L,relativeLuminance as g,parseOption as E}from"efficient-shell/format";import{DEFAULT_SHADOW_COLOR as ee,pictureShadowColor as te}from"efficient-easel/screen/lib/document/shadow-values";import{isLengthUnit as ne}from"efficient-easel/screen/lib/content/length-units";import{cssLengthOf as re,siteLengthHeld as oe}from"./content/css-length.js";const ce="storefront-theme",Ze="sf:theme-mode",qe="sf:theme-switch",Je="hide",Qe=["light","dark","auto"],ve="light",et=!1,N=7,k=18;function ie(e){return e>=N&&e<k}function tt(e){const{mode:t,override:n,switchShown:r,hour:o}=e;return r&&(n==="light"||n==="dark")?n:t==="auto"?ie(o)?"light":"dark":E(["light","dark"],"dark",t)}function nt(e){const{mode:t,switchShown:n}=e;return`
|
|
2
2
|
try {
|
|
3
3
|
var mode = ${JSON.stringify(t)};
|
|
4
4
|
var shown = ${n?"true":"false"};
|
|
5
|
-
var override = localStorage.getItem(${JSON.stringify(
|
|
5
|
+
var override = localStorage.getItem(${JSON.stringify(ce)});
|
|
6
6
|
var theme;
|
|
7
7
|
if (shown && (override === 'light' || override === 'dark')) {
|
|
8
8
|
theme = override;
|
|
9
9
|
} else if (mode === 'auto') {
|
|
10
10
|
var h = new Date().getHours();
|
|
11
|
-
theme = (h >= ${
|
|
11
|
+
theme = (h >= ${N} && h < ${k}) ? 'light' : 'dark';
|
|
12
12
|
} else {
|
|
13
13
|
theme = mode === 'light' ? 'light' : 'dark';
|
|
14
14
|
}
|
|
15
15
|
if (theme === 'light') document.documentElement.setAttribute('data-theme', 'light');
|
|
16
16
|
else document.documentElement.removeAttribute('data-theme');
|
|
17
17
|
} catch (e) {}
|
|
18
|
-
`}const l={background:"#0a0a0a",surface:"#131313",line:"#2a2a2a",muted:"#9a9388"},ce=[{text:"#2e2e2e",accent:"#2e2e2e",background:"#ffffff",surface:"#f7f7f7",line:"#e0e0e0",muted:"#5c5c5c"},{text:"#f7f7f7",accent:"#f7f7f7",background:"#0a0a0a",surface:"#1b1b1b",line:"#363636",muted:"#a3a3a3"},{text:"#ffffff",accent:"#ffffff",background:"#2e2e2e",surface:"#3d3d3d",line:"#545454",muted:"#b0b0b0"},{text:"#0a0a0a",accent:"#0a0a0a",background:"#f7f7f7",surface:"#ffffff",line:"#d9d9d9",muted:"#5c5c5c"}],ie={selected:0,themes:ce};function k(e){return!e||!Array.isArray(e.themes)||e.themes.length===0?{...ie}:{selected:Math.min(Math.max(0,e.selected??0),e.themes.length-1),themes:e.themes}}function E(e,t,n){const r=d(e),o=d(t);if(r===null||o===null)return e;const c=(i,a)=>Math.max(0,Math.min(255,Math.round(i+(a-i)*n))).toString(16).padStart(2,"0");return`#${c(r.r,o.r)}${c(r.g,o.g)}${c(r.b,o.b)}`}const se={light:"#ffffff",dark:"#0a0a0a"},et=["light","dark"];function tt(e,t){const n=se[t],r=t==="light"?"#ffffff":"#000000";return{text:n,accent:n,background:e,surface:E(e,r,.1),line:E(e,r,.22),muted:E(n,e,.35),brandInk:t}}function f(e){const t=k(e);return t.themes[t.selected]}function u(e){return{text:e.text,accent:e.accent,background:e.background||l.background,surface:e.surface||l.surface,line:e.line||l.line,muted:e.muted||l.muted}}function nt(e){return{fill:u(e).background,accent:e.accent}}const ae=.4,ue="#f5f1e8",P="#0a0a0a";function le(e){const t=f(e).text,n=g(t);return n===null||n>=ae?t:null}const fe=4.5,he=3,rt={good:"Good","large-only":"Large text only",hard:"Hard to read"};function ot(e){return e>=fe?"good":e>=he?"large-only":"hard"}const de=["#000000","#ffffff"];function m(e){return H(e,de)}function ct(e,t){const n=t!==void 0&&g(t)!==null?t:ue;return H(e,[P,n])===n&&n!==P}const ge=[.25,.4,.55];function it(e){const t=d(e);return t===null?[]:ge.map(n=>"#"+[t.r,t.g,t.b].map(r=>Math.round(r*(1-n)).toString(16).padStart(2,"0")).join(""))}function st(e){const n={"--theme-fg":f(e).text},r=le(e);return r!==null&&(n["--overlay-fg"]=r),n}const me=82;function S(e){return`color-mix(in srgb, ${e} ${me}%, #000)`}function at(e){const t=f(e);return{"--theme-accent":t.accent,"--theme-accent-2":S(t.accent),"--theme-accent-ink":m(t.accent)}}function A(e){const t=e?.button;return t&&s(t)===t.toLowerCase()?t.toLowerCase():null}function ut(e){const t=f(e),n=A(t),r=F(t);if(n===null&&r===null)return{};const o={};return n!==null&&(o["--theme-btn"]=n,o["--theme-btn-2"]=S(n)),o["--theme-btn-ink"]=r??m(n),o}function F(e){const t=e?.buttonInk;return t&&s(t)===t.toLowerCase()?t.toLowerCase():null}function xe(e,t){return F(e)??m(A(e)??t)}function lt(e){const t=f(e);return{fill:A(t)??t.accent.toLowerCase(),ink:xe(t,t.accent)}}function ft(e){const t={};return k(e).themes.forEach((n,r)=>{const o=u(n);t[`--theme-preset-${r}-accent`]=o.accent,t[`--theme-preset-${r}-accent-2`]=S(o.accent),t[`--theme-preset-${r}-accent-ink`]=m(o.accent),t[`--theme-preset-${r}-bg`]=o.background,t[`--theme-preset-${r}-fg`]=o.text,t[`--theme-preset-${r}-surface`]=o.surface,t[`--theme-preset-${r}-surface-2`]=`color-mix(in srgb, ${o.surface} 60%, ${o.line})`,t[`--theme-preset-${r}-line`]=o.line,t[`--theme-preset-${r}-muted`]=o.muted}),t}const T=e=>{const t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4},b=e=>255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055);function $([e,t,n]){const[r,o,c]=[T(e),T(t),T(n)],i=Math.cbrt(.4122214708*r+.5363325363*o+.0514459929*c),a=Math.cbrt(.2119034982*r+.6806995451*o+.1073969566*c),h=Math.cbrt(.0883024619*r+.2817188376*o+.6299787005*c);return[.2104542553*i+.793617785*a-.0040720468*h,1.9779984951*i-2.428592205*a+.4505937099*h,.0259040371*i+.7827717662*a-.808675766*h]}function pe([e,t,n]){const r=(e+.3963377774*t+.2158037573*n)**3,o=(e-.1055613458*t-.0638541728*n)**3,c=(e-.0894841775*t-1.291485548*n)**3;return[b(4.0767416621*r-3.3077115913*o+.2309699292*c),b(-1.2684380046*r+2.6097574011*o-.3413193965*c),b(-.0041960863*r-.7034186147*o+1.707614701*c)]}const I=e=>{const t=d(e);return t===null?[0,0,0]:[t.r,t.g,t.b]},U=(e,t,n)=>[e[0]*n+t[0]*(1-n),e[1]*n+t[1]*(1-n),e[2]*n+t[2]*(1-n)],G=e=>`#${e.map(t=>Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")).join("")}`,Y=e=>U(I(e.surface),I(e.line),.6);function ht(e){return G(Y(u(e)))}function z(e){const t=u(e);return G(pe(U($(Y(t)),$(I(t.text)),.92)))}function dt(e){return{...e,background:z(e)}}function B(e,t,n,r){const o=e[t];if(!o)return-1;const c=n(o);if(!c)return-1;const i=u(o);return e.findIndex((a,h)=>{if(h===t)return!1;const _=u(a);return s(_.background)!==c?!1:!r||s(_.text??"")===s(i.text??"")&&s(_.accent??"")===s(i.accent??"")})}function gt(e,t){return B(e,t,z,!1)}function mt(e,t){return B(e,t,n=>s(n.surface??""),!0)}const _e=1;function Ee(e,t){const n=(e??[]).flatMap((r,o)=>{const c=g(r.background??""),i=g(r.text??"");return c!==null&&i!==null&&c<i?[o]:[]});return n.find(r=>r!==t)??n[0]??_e}function xt(e){return Ee(e?.themes,e?.selected)}const pt=["--theme-bg","--theme-surface","--theme-surface-2","--theme-line","--theme-muted"];function _t(e){const t=u(f(e)),n=`color-mix(in srgb, ${t.surface} 60%, ${t.line})`,r={"--theme-bg":t.background,"--theme-surface":t.surface,"--theme-line":t.line,"--theme-muted":t.muted};return(t.surface!==l.surface||t.line!==l.line)&&(r["--theme-surface-2"]=n),r}const Se=["heading","body","label"],Et={heading:"Headings",body:"Body",label:"Labels"};function St(e){if(!e)return null;for(const t of Se)if(e.includes(`--size-${t}`))return t;return/--size-heading(Large|Medium|Small)/.test(e)?"heading":null}const X=["headingLarge","headingMedium","headingSmall","accent","body","label"],At={headingLarge:"heading",headingMedium:"heading",headingSmall:"heading",accent:"heading",body:"body",label:"label"},Tt={headingLarge:null,headingMedium:null,headingSmall:null,accent:null,body:null,label:null},Ae=8,Te=200;function be(e){if(typeof e!="number"||!Number.isFinite(e))return null;const t=Math.round(e);return t>=Ae&&t<=Te?t:null}function Ie(e){const t={};for(const n of X)t[n]=be(e?.[n]);return t}function bt(e){const t=Ie(e),n={};for(const r of X){const o=t[r];o!==null&&(n[`--size-${r}`]=`${o}px`)}return n}const Re=["square","small","large"],Ce="small";function De(e){return Re.includes(e??"")?e:Ce}function It(e){return D(ye[De(e)])}const x=0,K=40,Me={min:x,max:K,step:1},ye={square:0,small:null,large:16},R={"--sf-card-radius":1,"--sf-button-radius":.5,"--site-radius":.5,"--site-radius-xs":.25,"--site-radius-sm":.5,"--site-radius-md":.75,"--site-radius-lg":1,"--site-radius-xl":1.25,"--site-radius-2xl":1.5,"--site-radius-3xl":2,"--site-radius-4xl":2.5};function C(e){if(e==null||typeof e=="string"&&e.trim()==="")return null;const t=typeof e=="string"?Number(e):e;return Number.isFinite(t)?Math.min(K,Math.max(x,Math.round(t))):null}function D(e,t){if(ee(t)&&t!=="px"){if(typeof e!="number"||!Number.isFinite(e))return{};const r=Math.max(0,e);return Object.fromEntries(Object.entries(R).map(([o,c])=>{const i=Math.round(r*c*1e4)/1e4;return[o,i===0?"0":te(i,t)]}))}const n=C(e);return n===null?{}:Object.fromEntries(Object.entries(R).map(([r,o])=>{const c=n*o/16;return[r,c===0?"0":`${c}rem`]}))}function Rt(e){return(C(e)??x)*R["--sf-button-radius"]}function Ct(e,t){const n=ne(e,t,"radius",Me);return n!==null?D(n,t):D(C(e)??x)}const Oe=["none","soft","lifted"],we="soft",W="none",He=["tight","normal","roomy"],Le="normal",Ne="normal",ke=["none","lift","highlight"],Pe="lift",Fe="highlight";import{DEFAULT_SHADOW_COLOR as Yt}from"efficient-easel/screen/lib/document/shadow-values";function j(e){return Oe.includes(e??"")?e:we}function $e(e){return He.includes(e??"")?e:Le}function V(e){return ke.includes(e??"")?e:Pe}function Dt(e){const t=j(e);return t===W?void 0:t}function Mt(e){const t=$e(e);return t===Ne?void 0:t}function yt(e){const t=V(e);return t===Fe?void 0:t}function Ot(e,t,n){const r=v(t);return r===Q?{}:j(e)!==W||V(n)==="lift"?{"--sf-shadow-color":r}:{}}const Ue=["normal","tight","compressed"],Z="normal";function q(e){return Ue.includes(e??"")?e:Z}function wt(e){const t=q(e);return t===Z?void 0:t}function Ht(e){switch(q(e)){case"tight":return{lineHeight:.95,letterSpacing:-.01};case"compressed":return{lineHeight:.86,letterSpacing:-.01};default:return{}}}const Lt=["authored","sentence"],Nt={case:"authored",weight:null,weightStrong:null,italicStrong:null,maxPx:null,weight2:null,weight3:null,case2:"authored",case3:"authored"},M=100,y=900,Ge=24,Ye=200;function p(e,t,n){return typeof e!="number"||!Number.isFinite(e)?null:Math.round(Math.min(Math.max(e,t),n))}function O(e){const t=p(e?.weight,M,y),n=e?.case==="sentence"?"sentence":"authored",r=c=>c==null?t:p(c,M,y),o=c=>c==="sentence"?"sentence":c==="authored"?"authored":n;return{case:n,weight:t,weightStrong:p(e?.weightStrong,M,y),italicStrong:typeof e?.italicStrong=="boolean"?e.italicStrong:null,maxPx:p(e?.maxPx,Ge,Ye),weight2:r(e?.weight2),weight3:r(e?.weight3),case2:o(e?.case2),case3:o(e?.case3)}}function kt(e){const t=O(e),n={};return t.case==="sentence"&&(n["--sf-heading-case"]="none"),t.weight!==null&&(n["--sf-heading-weight"]=String(t.weight)),t.weightStrong!==null&&(n["--sf-heading-weight-strong"]=String(t.weightStrong)),t.maxPx!==null&&(n["--sf-heading-max"]=`${t.maxPx}px`),t.weight2!==null&&t.weight2!==t.weight&&(n["--sf-heading-2-weight"]=String(t.weight2)),t.weight3!==null&&t.weight3!==t.weight&&(n["--sf-heading-3-weight"]=String(t.weight3)),t.case2!==t.case&&(n["--sf-heading-2-case"]=t.case2==="sentence"?"none":"uppercase"),t.case3!==t.case&&(n["--sf-heading-3-case"]=t.case3==="sentence"?"none":"uppercase"),n}function Pt(e){return O({case:e?.heading_case??void 0,weight:e?.heading_weight,weightStrong:e?.heading_weight_strong,italicStrong:e?.accent_italic,maxPx:e?.heading_max_px,weight2:e?.heading_2_weight??void 0,weight3:e?.heading_3_weight??void 0,case2:e?.heading_2_case??void 0,case3:e?.heading_3_case??void 0})}function Ft(e){const t=O(e);return{heading_case:t.case,heading_weight:t.weight,heading_weight_strong:t.weightStrong,heading_max_px:t.maxPx,heading_2_weight:t.weight2,heading_3_weight:t.weight3,heading_2_case:t.case2,heading_3_case:t.case3}}const w="siteTheme";function ze(e){const t=e;if(!t||typeof t!="object"||!Array.isArray(t.themes)||!t.themes.every(r=>!!r&&typeof r=="object"))return{};const n=typeof t.selected=="number"&&Number.isInteger(t.selected)&&t.selected>=0?t.selected:0;return{[w]:{selected:n,themes:t.themes}}}function $t(e){return ze(e?.[w])[w]}export{ge as ACCENT_DARKEN_STEPS,et as BRAND_INKS,He as CARD_GAPS,Oe as CARD_SHADOWS,Me as CORNER_RADIUS_GRID,K as CORNER_RADIUS_MAX,x as CORNER_RADIUS_MIN,Re as CORNER_STYLES,ye as CORNER_STYLE_TO_PX,Le as DEFAULT_CARD_GAP,we as DEFAULT_CARD_SHADOW,Ce as DEFAULT_CORNER_STYLE,Z as DEFAULT_HEADING_COMPRESSION,Nt as DEFAULT_HEADING_TYPOGRAPHY,Pe as DEFAULT_HOVER_EFFECT,Yt as DEFAULT_SHADOW_COLOR,Tt as DEFAULT_SIZES,l as DEFAULT_SURFACES,Je as DEFAULT_SWITCH_SHOWN,ce as DEFAULT_THEMES,qe as DEFAULT_THEME_MODE,ie as DEFAULT_THEME_VALUE,rt as GRADE_LABEL,Lt as HEADING_CASES,Ue as HEADING_COMPRESSIONS,Ye as HEADING_MAX_PX_MAX,Ge as HEADING_MAX_PX_MIN,y as HEADING_WEIGHT_MAX,M as HEADING_WEIGHT_MIN,ke as HOVER_EFFECTS,Ne as IDENTITY_CARD_GAP,W as IDENTITY_CARD_SHADOW,Fe as IDENTITY_HOVER_EFFECT,P as OVERLAY_INK_DARK,ue as OVERLAY_INK_LIGHT,fe as READABILITY_AA,he as READABILITY_AA_LARGE,At as SCALE_OF_STEP,w as SITE_THEME_KEY,X as SIZE_STEPS,Te as TEXT_SIZE_MAX,Ae as TEXT_SIZE_MIN,N as THEME_DAY_END_HOUR,L as THEME_DAY_START_HOUR,je as THEME_MODE_KEY,re as THEME_STORAGE_KEY,pt as THEME_SURFACE_KEYS,Ze as THEME_SWITCH_HIDE,Ve as THEME_SWITCH_KEY,Se as TYPE_GROUPS,Et as TYPE_GROUP_LABELS,m as accentInk,dt as bandPresetFor,gt as bandPresetIndex,tt as brandTheme,ve as buildThemeBootScript,Mt as cardGapAttr,Dt as cardShadowAttr,Ht as compressionMetrics,J as contrastRatio,D as cornerRadiusTokens,It as cornerStyleTokens,xt as darkBandIndex,Ee as darkPresetIndex,it as darkerAccents,ct as fillIsDark,ot as gradeContrast,wt as headingCompressionAttr,Pt as headingTypographyFromRow,kt as headingTypographyStyle,Ft as headingTypographyToRow,yt as hoverEffectAttr,oe as isDayHour,$e as normalizeCardGap,j as normalizeCardShadow,C as normalizeCornerRadius,De as normalizeCornerStyle,q as normalizeHeadingCompression,O as normalizeHeadingTypography,V as normalizeHoverEffect,be as normalizeSize,Ie as normalizeSizes,k as normalizeTheme,u as normalizeThemeColors,Qe as resolveTheme,xe as resolvedButtonInk,z as sectionBandTone,f as selectedThemeColors,Ot as shadowColorTokens,lt as siteButtonPaint,Rt as siteButtonRadiusPx,Ct as siteCornerRadiusTokens,ze as siteThemeMetadata,$t as siteThemeOf,mt as surfacePresetIndex,ht as surfaceTwoTone,at as themeAccentStyle,A as themeButtonColour,F as themeButtonInk,ut as themeButtonStyle,st as themeColorStyle,le as themeLightInk,ft as themePresetAccentVars,_t as themeSurfaceStyle,nt as themeSwatchColors,St as typeScaleGroupOfClassName,bt as typeSizesStyle};
|
|
18
|
+
`}const l={background:"#0a0a0a",surface:"#131313",line:"#2a2a2a",muted:"#9a9388"},se=[{text:"#2e2e2e",accent:"#2e2e2e",background:"#ffffff",surface:"#f7f7f7",line:"#e0e0e0",muted:"#5c5c5c"},{text:"#f7f7f7",accent:"#f7f7f7",background:"#0a0a0a",surface:"#1b1b1b",line:"#363636",muted:"#a3a3a3"},{text:"#ffffff",accent:"#ffffff",background:"#2e2e2e",surface:"#3d3d3d",line:"#545454",muted:"#b0b0b0"},{text:"#0a0a0a",accent:"#0a0a0a",background:"#f7f7f7",surface:"#ffffff",line:"#d9d9d9",muted:"#5c5c5c"}],ae={selected:0,themes:se};function P(e){return!e||!Array.isArray(e.themes)||e.themes.length===0?{...ae}:{selected:Math.min(Math.max(0,e.selected??0),e.themes.length-1),themes:e.themes}}function S(e,t,n){const r=d(e),o=d(t);if(r===null||o===null)return e;const c=(i,a)=>Math.max(0,Math.min(255,Math.round(i+(a-i)*n))).toString(16).padStart(2,"0");return`#${c(r.r,o.r)}${c(r.g,o.g)}${c(r.b,o.b)}`}const ue={light:"#ffffff",dark:"#0a0a0a"},rt=["light","dark"];function ot(e,t){const n=ue[t],r=t==="light"?"#ffffff":"#000000";return{text:n,accent:n,background:e,surface:S(e,r,.1),line:S(e,r,.22),muted:S(n,e,.35),brandInk:t}}function f(e){const t=P(e);return t.themes[t.selected]}function u(e){return{text:e.text,accent:e.accent,background:e.background||l.background,surface:e.surface||l.surface,line:e.line||l.line,muted:e.muted||l.muted}}function ct(e){return{fill:u(e).background,accent:e.accent}}const le=.4,fe="#f5f1e8",F="#0a0a0a";function he(e){const t=f(e).text,n=g(t);return n===null||n>=le?t:null}const de=4.5,ge=3,it={good:"Good","large-only":"Large text only",hard:"Hard to read"};function st(e){return e>=de?"good":e>=ge?"large-only":"hard"}const me=["#000000","#ffffff"];function m(e){return L(e,me)}function at(e,t){const n=t!==void 0&&g(t)!==null?t:fe;return L(e,[F,n])===n&&n!==F}const pe=[.25,.4,.55];function ut(e){const t=d(e);return t===null?[]:pe.map(n=>"#"+[t.r,t.g,t.b].map(r=>Math.round(r*(1-n)).toString(16).padStart(2,"0")).join(""))}function lt(e){const n={"--theme-fg":f(e).text},r=he(e);return r!==null&&(n["--overlay-fg"]=r),n}const xe=82;function A(e){return`color-mix(in srgb, ${e} ${xe}%, #000)`}function ft(e){const t=f(e);return{"--theme-accent":t.accent,"--theme-accent-2":A(t.accent),"--theme-accent-ink":m(t.accent)}}function T(e){const t=e?.button;return t&&s(t)===t.toLowerCase()?t.toLowerCase():null}function ht(e){const t=f(e),n=T(t),r=$(t);if(n===null&&r===null)return{};const o={};return n!==null&&(o["--theme-btn"]=n,o["--theme-btn-2"]=A(n)),o["--theme-btn-ink"]=r??m(n),o}function $(e){const t=e?.buttonInk;return t&&s(t)===t.toLowerCase()?t.toLowerCase():null}function _e(e,t){return $(e)??m(T(e)??t)}function dt(e){const t=f(e);return{fill:T(t)??t.accent.toLowerCase(),ink:_e(t,t.accent)}}function gt(e){const t={};return P(e).themes.forEach((n,r)=>{const o=u(n);t[`--theme-preset-${r}-accent`]=o.accent,t[`--theme-preset-${r}-accent-2`]=A(o.accent),t[`--theme-preset-${r}-accent-ink`]=m(o.accent),t[`--theme-preset-${r}-bg`]=o.background,t[`--theme-preset-${r}-fg`]=o.text,t[`--theme-preset-${r}-surface`]=o.surface,t[`--theme-preset-${r}-surface-2`]=`color-mix(in srgb, ${o.surface} 60%, ${o.line})`,t[`--theme-preset-${r}-line`]=o.line,t[`--theme-preset-${r}-muted`]=o.muted}),t}const b=e=>{const t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4},I=e=>255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055);function U([e,t,n]){const[r,o,c]=[b(e),b(t),b(n)],i=Math.cbrt(.4122214708*r+.5363325363*o+.0514459929*c),a=Math.cbrt(.2119034982*r+.6806995451*o+.1073969566*c),h=Math.cbrt(.0883024619*r+.2817188376*o+.6299787005*c);return[.2104542553*i+.793617785*a-.0040720468*h,1.9779984951*i-2.428592205*a+.4505937099*h,.0259040371*i+.7827717662*a-.808675766*h]}function Ee([e,t,n]){const r=(e+.3963377774*t+.2158037573*n)**3,o=(e-.1055613458*t-.0638541728*n)**3,c=(e-.0894841775*t-1.291485548*n)**3;return[I(4.0767416621*r-3.3077115913*o+.2309699292*c),I(-1.2684380046*r+2.6097574011*o-.3413193965*c),I(-.0041960863*r-.7034186147*o+1.707614701*c)]}const R=e=>{const t=d(e);return t===null?[0,0,0]:[t.r,t.g,t.b]},G=(e,t,n)=>[e[0]*n+t[0]*(1-n),e[1]*n+t[1]*(1-n),e[2]*n+t[2]*(1-n)],Y=e=>`#${e.map(t=>Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")).join("")}`,z=e=>G(R(e.surface),R(e.line),.6);function mt(e){return Y(z(u(e)))}function B(e){const t=u(e);return Y(Ee(G(U(z(t)),U(R(t.text)),.92)))}function pt(e){return{...e,background:B(e)}}function X(e,t,n,r){const o=e[t];if(!o)return-1;const c=n(o);if(!c)return-1;const i=u(o);return e.findIndex((a,h)=>{if(h===t)return!1;const _=u(a);return s(_.background)!==c?!1:!r||s(_.text??"")===s(i.text??"")&&s(_.accent??"")===s(i.accent??"")})}function xt(e,t){return X(e,t,B,!1)}function _t(e,t){return X(e,t,n=>s(n.surface??""),!0)}const Se=1;function Ae(e,t){const n=(e??[]).flatMap((r,o)=>{const c=g(r.background??""),i=g(r.text??"");return c!==null&&i!==null&&c<i?[o]:[]});return n.find(r=>r!==t)??n[0]??Se}function Et(e){return Ae(e?.themes,e?.selected)}const St=["--theme-bg","--theme-surface","--theme-surface-2","--theme-line","--theme-muted"];function At(e){const t=u(f(e)),n=`color-mix(in srgb, ${t.surface} 60%, ${t.line})`,r={"--theme-bg":t.background,"--theme-surface":t.surface,"--theme-line":t.line,"--theme-muted":t.muted};return(t.surface!==l.surface||t.line!==l.line)&&(r["--theme-surface-2"]=n),r}const Te=["heading","body","label"],Tt={heading:"Headings",body:"Body",label:"Labels"};function bt(e){if(!e)return null;for(const t of Te)if(e.includes(`--size-${t}`))return t;return/--size-heading(Large|Medium|Small)/.test(e)?"heading":null}const K=["headingLarge","headingMedium","headingSmall","accent","body","label"],It={headingLarge:"heading",headingMedium:"heading",headingSmall:"heading",accent:"heading",body:"body",label:"label"},Rt={headingLarge:null,headingMedium:null,headingSmall:null,accent:null,body:null,label:null},be=8,Ie=200;function Re(e){if(typeof e!="number"||!Number.isFinite(e))return null;const t=Math.round(e);return t>=be&&t<=Ie?t:null}function Ce(e){const t={};for(const n of K)t[n]=Re(e?.[n]);return t}function Ct(e){const t=Ce(e),n={};for(const r of K){const o=t[r];o!==null&&(n[`--size-${r}`]=`${o}px`)}return n}const De=["square","small","large"],Me="small";function Oe(e){return De.includes(e??"")?e:Me}function Dt(e){return M(we[Oe(e)])}const p=0,W=40,ye={min:p,max:W,step:1},we={square:0,small:null,large:16},C={"--sf-card-radius":1,"--sf-button-radius":.5,"--site-radius":.5,"--site-radius-xs":.25,"--site-radius-sm":.5,"--site-radius-md":.75,"--site-radius-lg":1,"--site-radius-xl":1.25,"--site-radius-2xl":1.5,"--site-radius-3xl":2,"--site-radius-4xl":2.5};function D(e){if(e==null||typeof e=="string"&&e.trim()==="")return null;const t=typeof e=="string"?Number(e):e;return Number.isFinite(t)?Math.min(W,Math.max(p,Math.round(t))):null}function M(e,t){if(ne(t)&&t!=="px"){if(typeof e!="number"||!Number.isFinite(e))return{};const r=Math.max(0,e);return Object.fromEntries(Object.entries(C).map(([o,c])=>{const i=Math.round(r*c*1e4)/1e4;return[o,i===0?"0":re(i,t)]}))}const n=D(e);return n===null?{}:Object.fromEntries(Object.entries(C).map(([r,o])=>{const c=n*o/16;return[r,c===0?"0":`${c}rem`]}))}function Mt(e){return(D(e)??p)*C["--sf-button-radius"]}function Ot(e,t){const n=oe(e,t,"radius",ye);return n!==null?M(n,t):M(D(e)??p)}const He=["none","soft","lifted"],Le="soft",j="none",Ne=["tight","normal","roomy"],ke="normal",Pe="normal",Fe=["none","lift","highlight"],$e="lift",Ue="highlight";import{DEFAULT_SHADOW_COLOR as Bt}from"efficient-easel/screen/lib/document/shadow-values";function V(e){return He.includes(e??"")?e:Le}function Ge(e){return Ne.includes(e??"")?e:ke}function Z(e){return Fe.includes(e??"")?e:$e}function yt(e){const t=V(e);return t===j?void 0:t}function wt(e){const t=Ge(e);return t===Pe?void 0:t}function Ht(e){const t=Z(e);return t===Ue?void 0:t}function Lt(e,t,n){const r=te(t);return r===ee?{}:V(e)!==j||Z(n)==="lift"?{"--sf-shadow-color":r}:{}}const Ye=["normal","tight","compressed"],q="normal";function J(e){return Ye.includes(e??"")?e:q}function Nt(e){const t=J(e);return t===q?void 0:t}function kt(e){switch(J(e)){case"tight":return{lineHeight:.95,letterSpacing:-.01};case"compressed":return{lineHeight:.86,letterSpacing:-.01};default:return{}}}const Q=["authored","sentence"],Pt={case:"authored",weight:null,weightStrong:null,italicStrong:null,maxPx:null,weight2:null,weight3:null,case2:"authored",case3:"authored"},O=100,y=900,ze=24,Be=200;function x(e,t,n){return typeof e!="number"||!Number.isFinite(e)?null:Math.round(Math.min(Math.max(e,t),n))}function w(e){const t=x(e?.weight,O,y),n=E(Q,"authored",e?.case),r=c=>c==null?t:x(c,O,y),o=c=>E(Q,n,c);return{case:n,weight:t,weightStrong:x(e?.weightStrong,O,y),italicStrong:typeof e?.italicStrong=="boolean"?e.italicStrong:null,maxPx:x(e?.maxPx,ze,Be),weight2:r(e?.weight2),weight3:r(e?.weight3),case2:o(e?.case2),case3:o(e?.case3)}}function Ft(e){const t=w(e),n={};return t.case==="sentence"&&(n["--sf-heading-case"]="none"),t.weight!==null&&(n["--sf-heading-weight"]=String(t.weight)),t.weightStrong!==null&&(n["--sf-heading-weight-strong"]=String(t.weightStrong)),t.maxPx!==null&&(n["--sf-heading-max"]=`${t.maxPx}px`),t.weight2!==null&&t.weight2!==t.weight&&(n["--sf-heading-2-weight"]=String(t.weight2)),t.weight3!==null&&t.weight3!==t.weight&&(n["--sf-heading-3-weight"]=String(t.weight3)),t.case2!==t.case&&(n["--sf-heading-2-case"]=t.case2==="sentence"?"none":"uppercase"),t.case3!==t.case&&(n["--sf-heading-3-case"]=t.case3==="sentence"?"none":"uppercase"),n}function $t(e){return w({case:e?.heading_case??void 0,weight:e?.heading_weight,weightStrong:e?.heading_weight_strong,italicStrong:e?.accent_italic,maxPx:e?.heading_max_px,weight2:e?.heading_2_weight??void 0,weight3:e?.heading_3_weight??void 0,case2:e?.heading_2_case??void 0,case3:e?.heading_3_case??void 0})}function Ut(e){const t=w(e);return{heading_case:t.case,heading_weight:t.weight,heading_weight_strong:t.weightStrong,heading_max_px:t.maxPx,heading_2_weight:t.weight2,heading_3_weight:t.weight3,heading_2_case:t.case2,heading_3_case:t.case3}}const H="siteTheme";function Xe(e){const t=e;if(!t||typeof t!="object"||!Array.isArray(t.themes)||!t.themes.every(r=>!!r&&typeof r=="object"))return{};const n=typeof t.selected=="number"&&Number.isInteger(t.selected)&&t.selected>=0?t.selected:0;return{[H]:{selected:n,themes:t.themes}}}function Gt(e){return Xe(e?.[H])[H]}export{pe as ACCENT_DARKEN_STEPS,rt as BRAND_INKS,Ne as CARD_GAPS,He as CARD_SHADOWS,ye as CORNER_RADIUS_GRID,W as CORNER_RADIUS_MAX,p as CORNER_RADIUS_MIN,De as CORNER_STYLES,we as CORNER_STYLE_TO_PX,ke as DEFAULT_CARD_GAP,Le as DEFAULT_CARD_SHADOW,Me as DEFAULT_CORNER_STYLE,q as DEFAULT_HEADING_COMPRESSION,Pt as DEFAULT_HEADING_TYPOGRAPHY,$e as DEFAULT_HOVER_EFFECT,Bt as DEFAULT_SHADOW_COLOR,Rt as DEFAULT_SIZES,l as DEFAULT_SURFACES,et as DEFAULT_SWITCH_SHOWN,se as DEFAULT_THEMES,ve as DEFAULT_THEME_MODE,ae as DEFAULT_THEME_VALUE,it as GRADE_LABEL,Q as HEADING_CASES,Ye as HEADING_COMPRESSIONS,Be as HEADING_MAX_PX_MAX,ze as HEADING_MAX_PX_MIN,y as HEADING_WEIGHT_MAX,O as HEADING_WEIGHT_MIN,Fe as HOVER_EFFECTS,Pe as IDENTITY_CARD_GAP,j as IDENTITY_CARD_SHADOW,Ue as IDENTITY_HOVER_EFFECT,F as OVERLAY_INK_DARK,fe as OVERLAY_INK_LIGHT,de as READABILITY_AA,ge as READABILITY_AA_LARGE,It as SCALE_OF_STEP,H as SITE_THEME_KEY,K as SIZE_STEPS,Ie as TEXT_SIZE_MAX,be as TEXT_SIZE_MIN,k as THEME_DAY_END_HOUR,N as THEME_DAY_START_HOUR,Qe as THEME_MODES,Ze as THEME_MODE_KEY,ce as THEME_STORAGE_KEY,St as THEME_SURFACE_KEYS,Je as THEME_SWITCH_HIDE,qe as THEME_SWITCH_KEY,Te as TYPE_GROUPS,Tt as TYPE_GROUP_LABELS,m as accentInk,pt as bandPresetFor,xt as bandPresetIndex,ot as brandTheme,nt as buildThemeBootScript,wt as cardGapAttr,yt as cardShadowAttr,kt as compressionMetrics,v as contrastRatio,M as cornerRadiusTokens,Dt as cornerStyleTokens,Et as darkBandIndex,Ae as darkPresetIndex,ut as darkerAccents,at as fillIsDark,st as gradeContrast,Nt as headingCompressionAttr,$t as headingTypographyFromRow,Ft as headingTypographyStyle,Ut as headingTypographyToRow,Ht as hoverEffectAttr,ie as isDayHour,Ge as normalizeCardGap,V as normalizeCardShadow,D as normalizeCornerRadius,Oe as normalizeCornerStyle,J as normalizeHeadingCompression,w as normalizeHeadingTypography,Z as normalizeHoverEffect,Re as normalizeSize,Ce as normalizeSizes,P as normalizeTheme,u as normalizeThemeColors,tt as resolveTheme,_e as resolvedButtonInk,B as sectionBandTone,f as selectedThemeColors,Lt as shadowColorTokens,dt as siteButtonPaint,Mt as siteButtonRadiusPx,Ot as siteCornerRadiusTokens,Xe as siteThemeMetadata,Gt as siteThemeOf,_t as surfacePresetIndex,mt as surfaceTwoTone,ft as themeAccentStyle,T as themeButtonColour,$ as themeButtonInk,ht as themeButtonStyle,lt as themeColorStyle,he as themeLightInk,gt as themePresetAccentVars,At as themeSurfaceStyle,ct as themeSwatchColors,bt as typeScaleGroupOfClassName,Ct as typeSizesStyle};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { AccordionRowStyle } from "../../format/lib/content/accordion-row-style.js";
|
|
2
1
|
export type BoxPaneKind = false | "tabs" | "accordion";
|
|
3
2
|
export declare const BoxTabPaneContext: import("react").Context<BoxPaneKind>;
|
|
4
3
|
export declare const useBoxPaneKind: () => BoxPaneKind;
|
|
5
4
|
export declare const useIsTabPane: () => boolean;
|
|
6
|
-
export declare const AccordionRowStyleContext: import("react").Context<
|
|
7
|
-
export declare const useAccordionRowStyle: () =>
|
|
5
|
+
export declare const AccordionRowStyleContext: import("react").Context<"plain" | "numbered" | "chevron">;
|
|
6
|
+
export declare const useAccordionRowStyle: () => "plain" | "numbered" | "chevron";
|
|
8
7
|
export declare const FirstCopyOpensContext: import("react").Context<boolean>;
|
|
9
8
|
export declare const useFirstCopyOpens: () => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as o,Fragment as _,jsxs as j}from"react/jsx-runtime";import{useEffect as i,useRef as A,useState as l}from"react";import B from"./Reel.js";import{BOX_TAB_SHAPES as S}from"../../format/lib/reel.js";import{parseOption as E}from"
|
|
1
|
+
"use client";import{jsx as o,Fragment as _,jsxs as j}from"react/jsx-runtime";import{useEffect as i,useRef as A,useState as l}from"react";import B from"./Reel.js";import{BOX_TAB_SHAPES as S}from"../../format/lib/reel.js";import{parseOption as E}from"efficient-shell/format";import{BoxTabPaneContext as F}from"./BoxTabPaneContext.js";import{markedChildren as c}from"../../format/lib/marked-children.js";function L({children:u,className:b,style:d,shape:m}){const s=A(null),[a,f]=l([]),p=E(S,"tabs",m),[h,x]=l(0);i(()=>{const t=s.current;if(!t)return;const r=()=>{const g=c(t,"data-tab-label");f(g.map((v,T)=>v.dataset.tabLabel?.trim()||`Tab ${T+1}`))};r();const e=new MutationObserver(r);return e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tab-label"]}),()=>e.disconnect()},[]);const n=a.length?Math.min(h,a.length-1):0;return i(()=>{const t=s.current;t&&c(t,"data-tab-label").forEach((r,e)=>{r.hidden=a.length>1&&e!==n})},[a,n]),j(_,{children:[a.length>1&&o(B,{slides:a.map(t=>({name:t,process:""})),active:n,shape:p,tone:"surface",label:"Tabs",ref:t=>{t&&(t.onclick=r=>{const e=r.target?.closest?.("[data-idx]")?.getAttribute("data-idx");e!=null&&x(Number(e))})}}),o("div",{ref:s,"data-box-tabs":!0,className:b,style:d,children:o(F.Provider,{value:"tabs",children:u})})]})}export{L as default};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BorderValue } from "../../format/lib/content/borders.js";
|
|
2
|
+
import { type PadValues } from "../lib/content/section-padding.js";
|
|
2
3
|
import { type BlockAlign as Align } from "../../format/lib/content/block-align.js";
|
|
3
4
|
type Variant = "primary" | "ghost";
|
|
4
5
|
export declare const BUTTON_BLOCK_CLASS = "sf-button-block";
|
|
@@ -10,6 +11,7 @@ interface ButtonBlockProps {
|
|
|
10
11
|
alignTablet?: unknown;
|
|
11
12
|
alignPhone?: unknown;
|
|
12
13
|
contained: boolean;
|
|
14
|
+
blockPad?: PadValues;
|
|
13
15
|
arrow?: boolean;
|
|
14
16
|
icon?: string;
|
|
15
17
|
iconPosition?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{buttonArrowShown as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{buttonArrowShown as v}from"../../format/lib/content/button-arrow.js";import{buttonIconAtEnd as O,buttonIconSide as E,buttonWidthClass as F,storedButtonIcon as $}from"../../format/lib/content/button-icon.js";import{buttonCornersStyle as j,buttonPadAttrs as G,buttonPaint as U}from"../lib/content/button-look.js";import{ArrowLongRightIcon as D,ArrowRightIcon as K,ArrowUpRightIcon as V,BagIcon as W,CarIcon as Y,CartIcon as z,ChatIcon as H,ChevronLeftIcon as J,ChevronRightIcon as M,DownloadIcon as q,EmailIcon as Q,ExternalIcon as X,LocationIcon as Z,PackageIcon as oo,PhoneIcon as to,PlayIcon as no,ReceiptRefundIcon as ro,SearchIcon as eo,ShieldCheckIcon as ao,TagIcon as co,TruckIcon as io,WheelIcon as lo}from"efficient-shell/icons/efficient";import so from"./BlockFrame.js";import{BLOCK_PAD_FRAME as ho,ownPadOf as mo}from"../lib/content/section-padding.js";import uo from"./Btn.js";import{renderGold as fo}from"./goldPhrases.js";import{alignViewClasses as po,BLOCK_ALIGN_JUSTIFY as go}from"../../format/lib/content/block-align.js";import{useDrawsAtEdge as wo}from"./InBoxContext.js";import{partAttr as c}from"../../format/lib/content/part-names.js";const Io="sf-button-block",bo={"arrow-right":K,"arrow-long-right":D,"arrow-up-right":V,"chevron-right":M,external:X,cart:z,bag:W,tag:co,email:Q,location:Z,play:no,download:q,search:eo,car:Y,phone:to,wheel:lo,chat:H,"chevron-left":J,package:oo,truck:io,"shield-check":ao,"receipt-refund":ro},Co=o=>o?` ${o}`:"";function ko(o){const{label:b,href:i,variant:l,align:e,alignTablet:C,alignPhone:k,contained:P,arrow:B,icon:y,iconPosition:s,widthFit:h,widthFitPhone:A,widthFitTablet:L,buttonColor:t,buttonTextColor:d,hrefRewrite:m,blockPad:S}=o,u=wo(),n=$(y),f=n&&n!=="none"?bo[n]:void 0,T=n===void 0?v(B)?{}:{arrow:null}:f?{arrow:r(f,{size:16}),...E(s)==="before"?{glyphBefore:!0}:{}}:{arrow:null},p=G(o),g=[F(h,A,L,{atSectionLine:!u}),p?.className??""].filter(Boolean).join(" "),x=g?{className:g}:{},N=O(s,h)?{spread:!0}:{},a=U(o),R=a?a.background==="transparent"?"ghost":"primary":l,w={...a??(t?l==="ghost"?{borderColor:t}:{background:t,borderColor:t}:{}),...d?{color:d}:{},...p?.style??{},...j(o)??{}},_=Object.keys(w).length?{style:w}:{},I=mo(S,ho.text);return r(so,{contained:P,...I,className:`${Io} ${I.className}`,part:c("button-block"),children:r("div",{className:`flex${e?` ${go[e]}`:""}${Co(po("justify",e,C,k,{atSectionLine:!u}))}`,children:r(uo,{href:i||"#",variant:R,...x,...N,...T,..._,...i&&m?{hrefRewrite:m}:{},part:c("button"),glyphPart:c("button-icon"),children:fo(b)})})})}export{Io as BUTTON_BLOCK_CLASS,ko as default};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
1
2
|
import type { SlotComponent } from "efficient-easel/blocks";
|
|
2
3
|
import type { MapThemeMode } from "../../format/lib/map-styles.js";
|
|
3
4
|
import { type DealerListPosition } from "../lib/dealer-source.js";
|
|
4
|
-
|
|
5
|
+
import { type FootprintListColumns, type FootprintShows } from "../../format/lib/content/footprint.js";
|
|
6
|
+
export default function DealerFinder({ mapLabel, mapTheme, search, searchHint, noMatchText, listPosition, showDistance, shows, listColumns, fullHeight, sectionHead, editing, template, ownerId, }: {
|
|
5
7
|
mapLabel: string;
|
|
6
8
|
mapTheme: MapThemeMode;
|
|
7
9
|
search: boolean;
|
|
@@ -9,6 +11,10 @@ export default function DealerFinder({ mapLabel, mapTheme, search, searchHint, n
|
|
|
9
11
|
noMatchText: string;
|
|
10
12
|
listPosition: DealerListPosition;
|
|
11
13
|
showDistance: boolean;
|
|
14
|
+
shows?: FootprintShows;
|
|
15
|
+
listColumns?: FootprintListColumns;
|
|
16
|
+
fullHeight?: boolean;
|
|
17
|
+
sectionHead?: ReactNode;
|
|
12
18
|
editing?: boolean;
|
|
13
19
|
template?: SlotComponent;
|
|
14
20
|
ownerId?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as a,jsxs as c,Fragment as H}from"react/jsx-runtime";import{useEffect as J,useMemo as g,useRef as X,useState as o}from"react";import{CardTemplateRows as Z}from"./CardRowContext.js";import{DEALER_FIELDS as ee,dealerCardRow as te,dealerPins as ae,dealerPressLabel as re,useDealerSource as se}from"../lib/dealer-source.js";import{groupColsClass as le}from"../../format/lib/locations-grid.js";import{FOOTPRINT_LIST_COLUMNS_DEFAULT as R,FOOTPRINT_SHOWS_DEFAULT as ne,footprintListColsClass as oe,footprintListPosition as ie}from"../../format/lib/content/footprint.js";import{say as ce}from"../../format/lib/editor-words.js";import de from"./SiteMap.js";import ue,{SIDE_MAP_CLASS as pe,SIDE_ROW_REACH_CLASS as me,sideMapClass as fe}from"./SideListLayout.js";import{InsideSiteColumn as he}from"./SiteGutterFrame.js";const k={near:null,dealers:[]},ge=5;function be({mapLabel:D,mapTheme:F,search:M,searchHint:d,noMatchText:b,listPosition:A,showDistance:O,shows:u=ne,listColumns:x=R,fullHeight:S=!1,sectionHead:P,editing:j,template:W,ownerId:z=""}){const l=se(),[r,i]=o(k),[y,B]=o(""),[U,w]=o(!1),[_,p]=o(null),[q,V]=o(null),m=X(null);J(()=>{if(!l)return;let e=!0;return l({}).then(s=>e&&i(s)).catch(()=>e&&i(k)),()=>{e=!1}},[l]);const n=g(()=>ae(r.dealers),[r.dealers]),K=g(()=>new Set(n.map(e=>e.key)),[n]),Q=g(()=>r.near==="found"?n.slice(0,ge).map(e=>e.key):null,[r.near,n]),Y=e=>{p(e),K.has(e)&&V(s=>({key:e,n:(s?.n??0)+1}))},$=e=>{p(e),m.current?.querySelector(`[data-dealer="${CSS.escape(e)}"]`)?.scrollIntoView({block:"nearest"})};if(!l)return j?a("p",{"data-dealers-unavailable":!0,className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.24em] text-fg-dim",children:ce("Dealers are not available on this website")}):null;const G=e=>{e.preventDefault();const s=y.trim();w(!0),p(null),l(s?{near:s}:{}).then(i).catch(()=>i(t=>({...t,near:"try_again"}))).finally(()=>w(!1))},L=u!=="list",v=u!=="map",f=ie({shows:u,listPosition:A}),C=f!=="below",h=r.near==="not_found"||r.near==="try_again",T=M&&v?c("form",{role:"search",onSubmit:G,className:"mb-4 flex gap-2",children:[a("input",{type:"search",value:y,onChange:e=>B(e.target.value),placeholder:d,"aria-label":d,"aria-invalid":h||void 0,className:["min-w-0 flex-1 border bg-bg px-3 py-2 text-[length:var(--size-body,14px)] text-fg outline-none",h?"border-accent":"border-line focus:border-fg"].join(" ")}),a("button",{type:"submit","aria-label":d,disabled:U,className:"grid w-10 shrink-0 place-items-center bg-fg text-bg disabled:opacity-50",children:c("svg",{"aria-hidden":!0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a("circle",{cx:"11",cy:"11",r:"7"}),a("path",{d:"M20 20l-3.5-3.5"})]})})]}):null,E=h&&b?a("p",{role:"status",className:"mb-3 text-[length:var(--size-body,14px)] text-fg-dim",children:b}):null,N=(e,s=!1)=>a(he,{children:a(Z,{ownerId:z,ownerType:"Footprint",Template:W,rows:r.dealers.map(t=>te(t,O)),fields:ee,states:r.dealers.map(t=>_===t.id?{selected:!0}:void 0),actions:r.dealers.map(t=>({press:()=>Y(t.id),label:re(t)})),copyAttrs:t=>({"data-dealer":r.dealers[t.index]?.id??""}),wrapCopy:s?t=>a("div",{className:me,children:t}):void 0,fallback:null,children:t=>e(t)})}),I=L?a(de,{pins:n,mapTheme:F,selectedKey:_,focus:q,onSelect:$,ariaLabel:D,className:C?fe(S):pe,groupCrowded:!0,fitTo:Q}):null;return C?a(ue,{position:f,attrs:{"data-dealer-finder":f},fullHeight:S,head:c(H,{children:[P,T,E]}),listRef:m,list:N(e=>e,!0),rowsReachOut:!0,map:I}):c("div",{"data-dealer-finder":"below",children:[T,E,I,v&&r.dealers.length>0&&N(e=>a("div",{ref:m,className:[...L?["mt-12"]:[],"grid gap-[2px] bg-bg",...x===R?[le(e.length),e.length>2?"max-view-desktop:grid-cols-2 max-[700px]:grid-cols-1":"max-[700px]:grid-cols-1"]:[oe(x,e.length)]].join(" "),children:e}))]})}export{be as default};
|
|
@@ -2,7 +2,7 @@ import { type BandPad } from "../lib/content/section-padding.js";
|
|
|
2
2
|
import type { SlotComponent } from "efficient-easel/blocks";
|
|
3
3
|
import type { CardPressTitle } from "../lib/document/card-press-titles.js";
|
|
4
4
|
import type { MapThemeMode } from "../../format/lib/map-styles.js";
|
|
5
|
-
import { type FootprintOffice } from "../../format/lib/content/footprint.js";
|
|
5
|
+
import { type FootprintListColumns, type FootprintMapHeight, type FootprintOffice, type FootprintShows } from "../../format/lib/content/footprint.js";
|
|
6
6
|
import type { DealerListPosition } from "../lib/dealer-source.js";
|
|
7
7
|
export interface FootprintProps {
|
|
8
8
|
sectionNumber?: string;
|
|
@@ -21,8 +21,12 @@ export interface FootprintProps {
|
|
|
21
21
|
noMatchText?: string;
|
|
22
22
|
listPosition?: DealerListPosition;
|
|
23
23
|
showDistance?: boolean;
|
|
24
|
+
shows?: FootprintShows;
|
|
25
|
+
listColumns?: FootprintListColumns;
|
|
26
|
+
mapHeight?: FootprintMapHeight;
|
|
27
|
+
headInList?: boolean;
|
|
24
28
|
template?: SlotComponent;
|
|
25
29
|
ownerId?: string;
|
|
26
30
|
pressTitles?: readonly CardPressTitle[];
|
|
27
31
|
}
|
|
28
|
-
export default function Footprint({ sectionNumber, heading, tagline, offices, mapTheme, padTop, padBottom, bandPad, editing, omitHead, dealers, search, searchHint, noMatchText, listPosition, showDistance, template, ownerId, pressTitles, }: FootprintProps): import("react").JSX.Element | null;
|
|
32
|
+
export default function Footprint({ sectionNumber, heading, tagline, offices, mapTheme, padTop, padBottom, bandPad, editing, omitHead, dealers, search, searchHint, noMatchText, listPosition, showDistance, shows, listColumns, mapHeight, headInList, template, ownerId, pressTitles, }: FootprintProps): import("react").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as
|
|
1
|
+
"use client";import{jsx as t,jsxs as m,Fragment as le}from"react/jsx-runtime";import{bandPadAttrs as ne}from"../lib/content/section-padding.js";import{innerPaddingFallback as re}from"../lib/document/passes/section-padding.js";import{HideTaker as ae}from"./ViewHideRoot.js";import{isWebAddress as ie}from"../../format/lib/content/box-link.js";import{SiteLink as oe}from"../lib/site-runtime.js";import{useEffect as B,useMemo as se,useState as G}from"react";import{CardTemplateRows as K}from"./CardRowContext.js";import{FOOTPRINT_LIST_COLUMNS_DEFAULT as ce,FOOTPRINT_MAP_HEIGHT_FULL as me,FOOTPRINT_SHOWS_DEFAULT as de,footprintCardRow as z,footprintListColsClass as pe,footprintListPosition as fe,footprintPins as ue,footprintSearchText as be}from"../../format/lib/content/footprint.js";import{LIST_KEY_ATTR as he,LIST_ROW_ATTR as xe,LIST_TEXT_ATTR as ge}from"../../format/lib/content/list-query.js";import{bucketByGroup as ye}from"../../format/lib/locations-grid.js";import ve from"./EditorialSectionHead.js";import Te from"./SectionHeader.js";import{LocationGroupHeader as Se}from"./LocationGroupHeader.js";import{renderGold as we,renderHeadline as D}from"./goldPhrases.js";import Ne from"./PartStyledText.js";import{say as U}from"../../format/lib/editor-words.js";import ke from"./DealerFinder.js";import Le from"./ListSearchBox.js";import _e,{sideMapClass as $e}from"./SideListLayout.js";import Fe from"./SiteMap.js";import{InsideSiteColumn as W}from"./SiteGutterFrame.js";const r={bodySmall:"text-[length:var(--size-body,10px)]",bodyLarge:"text-[length:var(--size-body,18px)]",labelSmall:"text-[length:var(--size-label,11px)]",labelLarge:"text-[length:var(--size-label,12px)]"},q=`absolute bottom-5 left-6 font-mono ${r.labelSmall} uppercase tracking-[0.24em] text-accent hover:underline`;function He({sectionNumber:d="",heading:a="",tagline:b="",offices:n=[],mapTheme:h="auto",padTop:L,padBottom:_,bandPad:g,editing:p,omitHead:$=!1,dealers:f=!1,search:c=!1,searchHint:i="",noMatchText:S="",listPosition:u="below",showDistance:X=!0,shows:w=de,listColumns:O=ce,mapHeight:Y,headInList:Z=!1,template:F,ownerId:y="",pressTitles:J}){const N=f===!0,C=w!=="list",V=w!=="map",v=fe({shows:w,listPosition:u}),H=Y===me,M=Z&&v!=="below",E=g??ne({padTop:L,padBottom:_},re("Footprint")),[T,x]=G(null),ee=n.length===0&&!N&&!d&&!a&&!b;if(B(()=>{x(e=>e!==null&&e>=n.length?null:e)},[n]),ee&&!p)return null;const P=ye(n,e=>String(e.group??""),()=>""),te=(e,l)=>{const s=T===l,o=e.href&&e.linkLabel?{href:e.href,label:e.linkLabel}:null,k=m("button",{type:"button",onClick:()=>x(l),"aria-pressed":s,className:["flex flex-col gap-1.5 bg-bg px-6 py-5 text-left transition-colors outline outline-1 -outline-offset-1",s?"outline-accent":"outline-transparent hover:outline-line",o?"w-full pb-11":""].filter(Boolean).join(" "),children:[m("span",{className:`flex items-center gap-2.5 font-mono ${r.labelSmall} uppercase tracking-[0.28em]`,children:[e.hq&&t("span",{className:`border border-accent bg-accent px-1.5 py-0.5 ${r.bodySmall} text-bg`,children:"HQ"}),e.role&&t("span",{className:"text-accent",children:e.role})]}),e.city&&t("span",{className:`font-display ${r.bodyLarge} font-medium leading-[1.2] tracking-[-0.01em] text-fg`,children:t(Ne,{value:e.city,children:e.city})}),e.country&&t("span",{className:`font-mono ${r.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:e.country}),e.address&&t("span",{className:`font-mono ${r.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:we(e.address)})]},o?void 0:l);return o?m("div",{className:"relative flex",children:[k,ie(o.href)?t(oe,{newTab:"auto",href:o.href,className:q,children:`→ ${o.label}`}):t("a",{href:o.href,className:q,children:`→ ${o.label}`})]},l):k},A=P.flatMap(e=>e.items),R=e=>t("div",{className:C?"mt-12 flex flex-col gap-8":"flex flex-col gap-8",children:P.map((l,s)=>m("div",{children:[l.key&&t(Se,{groupKey:l.key,count:l.items.length}),t("div",{className:["grid gap-[2px] bg-bg",pe(O,l.items.length)].join(" "),children:e(l)})]},l.key?`g:${l.key}`:`ungrouped:${s}`))}),j=!$&&!!(d||a||b),I=M&&j?t(Te,{look:"natural",num:d||void 0,title:a?D(a):void 0,description:b||void 0,spaceBelow:"mb-8"}):null;return t(ae,{as:"section",className:"relative z-[2] bg-bg",children:m("div",{className:["mx-auto max-w-[var(--sf-site-width,1600px)] border-b border-line px-[var(--sf-site-gutter,40px)] max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]",E.className].filter(Boolean).join(" "),style:E.style,children:[j&&!M&&t(ve,{num:d,title:a?D(a):void 0,desc:b||void 0,spaceBelow:"mb-12"}),N?t(ke,{mapLabel:a.replace(/[=*]/g,"").replace(/\s+/g," ").trim(),mapTheme:h,search:c,searchHint:i,noMatchText:S,listPosition:u,showDistance:X,shows:w,listColumns:O,fullHeight:H,sectionHead:I,editing:p,template:F,ownerId:y}):v!=="below"?t(_e,{position:v,attrs:{"data-footprint-list":v},fullHeight:H,head:I||c?m(le,{children:[I,c?t("div",{className:"mb-4",children:t(Le,{hint:i,noMatchText:S,listKey:`${y}:offices`,editing:p})}):null]}):null,listAttrs:c?{[he]:`${y}:offices`}:void 0,list:t(W,{children:t(K,{ownerId:y,ownerType:"Footprint",Template:F,rows:n.map(z),states:n.map((e,l)=>T===l?{selected:!0}:void 0),actions:n.map((e,l)=>({press:()=>x(l)})),pressTitles:J,copyAttrs:e=>({[xe]:"",[ge]:be(n[e.index])}),fallback:null,children:e=>e})}),map:t(Q,{offices:n,mapLabel:a.replace(/[=*]/g,"").replace(/\s+/g," ").trim(),mapTheme:h,activeIndex:T,onSelect:x,editing:p,frame:`sf-card relative w-full overflow-hidden border border-line ${$e(H)}`})}):C?t(Q,{offices:n,mapLabel:a.replace(/[=*]/g,"").replace(/\s+/g," ").trim(),mapTheme:h,activeIndex:T,onSelect:x,editing:p}):null,!N&&V&&v==="below"&&n.length>0&&t(K,{ownerId:y,ownerType:"Footprint",Template:F,rows:A.map(({item:e})=>z(e)),states:A.map(({index:e})=>T===e?{selected:!0}:void 0),actions:A.map(({index:e})=>({press:()=>x(e)})),fallback:R(e=>e.items.map(({item:l,index:s})=>te(l,s))),children:e=>{const l=e;let s=0;return t(W,{children:R(o=>{const k=l.slice(s,s+o.items.length);return s+=o.items.length,k})})}}),!N&&n.length===0&&p&&t("p",{className:`mt-8 font-mono ${r.labelLarge} uppercase tracking-[0.24em] text-fg-dim`,children:U("Add an office in the inspector")})]})})}function Q({offices:d,mapLabel:a,mapTheme:b,activeIndex:n,onSelect:h,editing:L,frame:_}){const g=se(()=>ue(d),[d]),[p,$]=G(null),f=n===null?null:String(n),c=f!==null&&g.some(u=>u.key===f);if(B(()=>{f!==null&&c&&$(u=>({key:f,n:(u?.n??0)+1}))},[f,c]),g.length===0)return L?t("div",{className:"relative flex aspect-[16/9] w-full items-center justify-center overflow-hidden border border-line bg-bg px-6 text-center max-view-tablet:aspect-[4/5]",children:t("span",{className:`font-mono ${r.labelLarge} uppercase tracking-[0.24em] text-fg-dim`,children:U("Add office coordinates to plot the map")})}):null;const i=c&&n!==null?d[n]:null,S=i?m("div",{className:"flex items-start gap-3 border border-line bg-bg px-3.5 py-2.5 text-fg shadow-[0_8px_24px_rgba(0,0,0,.4)]",children:[m("div",{className:"min-w-0 flex-1",children:[m("div",{className:`flex items-center gap-2 font-mono ${r.labelSmall} uppercase tracking-[0.28em]`,children:[i.hq&&t("span",{className:`bg-accent px-1.5 py-px ${r.bodySmall} text-bg`,children:"HQ"}),i.role&&t("span",{className:"text-accent",children:i.role})]}),i.city&&t("div",{className:`mt-1.5 font-display ${r.bodyLarge} font-medium leading-[1.2] text-fg`,children:i.city}),i.country&&t("div",{className:`mt-1 font-mono ${r.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:i.country})]}),t("button",{type:"button",onClick:()=>h(null),"aria-label":"Close",className:"-mr-1 grid h-6 w-6 shrink-0 place-items-center text-fg-dim hover:text-fg",children:t("svg",{"aria-hidden":!0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:t("path",{d:"M2 2l8 8M10 2l-8 8"})})})]}):null;return t(Fe,{pins:g,mapTheme:b,ariaLabel:a||"Offices",className:_??"sf-card relative aspect-[16/9] w-full overflow-hidden border border-line max-view-tablet:aspect-[4/5]",selectedKey:c?f:null,focus:p,onSelect:u=>h(Number(u)),card:S})}export{He as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type PadValues } from "../lib/content/section-padding.js";
|
|
2
2
|
import type { CSSProperties } from "react";
|
|
3
3
|
export type HeadingLevel = "1" | "2" | "3" | "4" | "5" | "6";
|
|
4
4
|
type Level = HeadingLevel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as l}from"react/jsx-runtime";import{resolveTypeSize as
|
|
1
|
+
import{jsx as l}from"react/jsx-runtime";import{BLOCK_PAD_FRAME as p,ownPadOf as m}from"../lib/content/section-padding.js";import{resolveTypeSize as o}from"../../format/lib/content/section-type-size.js";import f from"./BlockFrame.js";import{partAttr as g}from"../../format/lib/content/part-names.js";import{renderHeadline as r}from"./goldPhrases.js";const x={1:{size:"clamp(48px,7vw,96px)",role:"heading",step:"headingLarge",leading:"leading-[0.95]"},2:{size:"64px",sizeMobile:"36px",role:"heading",step:"headingMedium",rank:2,leading:"leading-none"},3:{size:"40px",sizeMobile:"28px",role:"heading",step:"headingSmall",rank:3,leading:"leading-[1.05]"},4:{size:"28px",role:"heading",step:"headingSmall",rank:3,leading:"leading-[1.1]"},5:{size:"22px",role:"body",step:"body",leading:"leading-[1.2]"},6:{size:"18px",role:"body",step:"body",leading:"leading-[1.3]"}},c="font-display font-medium leading-[0.92] tracking-[-0.04em] text-[length:min(var(--size-headingLarge,clamp(64px,9vw,144px)),var(--sf-heading-max,9999px))] max-view-wide:text-[length:min(var(--size-headingMedium,clamp(48px,12vw,76px)),var(--sf-heading-max,9999px))] max-view-wide:leading-[0.95]";function z(a,n="font-display"){const e=x[a],s=o(void 0,e.size,e.role,e.step),i=e.sizeMobile?o(void 0,e.sizeMobile,e.role,e.step):void 0,d={"--heading-size":s,...i?{"--heading-size-m":i}:{}},t=e.rank===2?"[font-weight:var(--sf-heading-2-weight,var(--sf-heading-weight,500))]":e.rank===3?"[font-weight:var(--sf-heading-3-weight,var(--sf-heading-weight,500))]":"[font-weight:var(--sf-heading-weight,500)]",h=["text-[length:var(--heading-size)]",e.leading,i?"max-view-wide:text-[length:var(--heading-size-m)]":""].filter(Boolean).join(" ");return{className:`${n} ${t} tracking-[-0.03em] text-fg ${h} text-left`,style:d}}function w({level:a,text:n,contained:e,hero:s=!1,pad:i}){if(s)return l("h1",{className:c,children:r(n,!1)});const d=`h${a}`,t=z(a);return l(f,{contained:e,...m(i,p.heading),part:g("heading-block"),children:l(d,{className:t.className,style:t.style,...g("heading"),children:r(n,!1)})})}export{w as default,z as headingLook};
|
|
@@ -16,6 +16,9 @@ interface Props {
|
|
|
16
16
|
textureColor?: string;
|
|
17
17
|
phoneUpDown?: string;
|
|
18
18
|
phoneSideways?: string;
|
|
19
|
+
phoneWordsTop?: number;
|
|
20
|
+
phoneWordsBottom?: number;
|
|
21
|
+
phoneBoxGap?: number;
|
|
19
22
|
autoplay?: boolean;
|
|
20
23
|
autoplayInterval?: number;
|
|
21
24
|
showTicker?: boolean;
|
|
@@ -37,4 +40,4 @@ interface Props {
|
|
|
37
40
|
editing?: boolean;
|
|
38
41
|
partMotion?: Record<string, unknown>;
|
|
39
42
|
}
|
|
40
|
-
export default function HeroSection({ slides: Slides, strip: Strip, alignment, textureOpacity, showTexture, textureColor, phoneUpDown, phoneSideways, autoplay, autoplayInterval, showTicker, tickerItems, heightDesktop, heightTablet, heightMobile, heightFixed, heightFixedTablet, heightFixedMobile, showPicker, pickerShape, pickerPlacement, showArrows, arrowsShape, arrowsPlacement, editing, partMotion, }: Props): import("react").JSX.Element;
|
|
43
|
+
export default function HeroSection({ slides: Slides, strip: Strip, alignment, textureOpacity, showTexture, textureColor, phoneUpDown, phoneSideways, phoneWordsTop, phoneWordsBottom, phoneBoxGap, autoplay, autoplayInterval, showTicker, tickerItems, heightDesktop, heightTablet, heightMobile, heightFixed, heightFixedTablet, heightFixedMobile, showPicker, pickerShape, pickerPlacement, showArrows, arrowsShape, arrowsPlacement, editing, partMotion, }: Props): import("react").JSX.Element;
|