efficient-web-builder 73.0.0 → 73.2.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 +48 -0
- 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/storefront-editor.css +5 -4
- package/dist/editor/components/useHostDocumentBridge.js +1 -1
- 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/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.d.ts +1 -0
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/field-groups.js +1 -1
- 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/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/part-names.d.ts +27 -0
- package/dist/format/lib/content/part-names.js +1 -0
- package/dist/format/lib/content/section-css.d.ts +3 -0
- package/dist/format/lib/content/section-css.js +1 -0
- 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/box-footer.js +1 -1
- 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/passes/types.d.ts +2 -0
- package/dist/format/lib/document/section-groups.js +1 -1
- package/dist/format/lib/editor-words-catalogue.d.ts +13 -0
- package/dist/format/lib/editor-words-catalogue.js +4 -4
- 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/hero-single-to-hero.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/source-rules/one-option-parser.d.ts +12 -0
- package/dist/format/lib/source-rules/one-option-parser.js +12 -0
- package/dist/format/lib/theme.d.ts +2 -1
- package/dist/format/lib/theme.js +4 -4
- package/dist/render/components/BlockFrame.d.ts +3 -1
- package/dist/render/components/BlockFrame.js +1 -1
- package/dist/render/components/BoxTabPaneContext.d.ts +2 -3
- package/dist/render/components/Btn.d.ts +3 -0
- package/dist/render/components/Btn.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/Flex.js +1 -1
- package/dist/render/components/Footprint.d.ts +6 -2
- package/dist/render/components/Footprint.js +1 -1
- package/dist/render/components/Grid.js +1 -1
- package/dist/render/components/Heading.d.ts +1 -1
- package/dist/render/components/Heading.js +1 -1
- package/dist/render/components/HeroArrows.d.ts +4 -1
- package/dist/render/components/HeroArrows.js +1 -1
- package/dist/render/components/HeroPictures.js +1 -1
- package/dist/render/components/HeroPoster.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/ImageBlock.js +1 -1
- package/dist/render/components/Logo.d.ts +3 -1
- package/dist/render/components/Logo.js +1 -1
- package/dist/render/components/LogoBlock.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.d.ts +3 -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-row-parts.js +1 -1
- 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 +7 -3
- package/dist/render/lib/document/custom-css.js +2 -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/index.js +1 -1
- package/dist/render/lib/document/passes/section-custom-css.d.ts +2 -0
- package/dist/render/lib/document/passes/section-custom-css.js +1 -0
- 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/document/section-css-style.d.ts +4 -0
- package/dist/render/lib/document/section-css-style.js +1 -0
- package/dist/routine-index.json +1 -0
- package/dist/value-index.json +1 -0
- package/package.json +7 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ENTRANCE_STORE_KEYS 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,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"../parse-option.js";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"}];function
|
|
1
|
+
import{parseOption as n}from"../parse-option.js";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};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as TS from "typescript";
|
|
2
|
+
import { type RuleReport, type SourceFile } from "./rule.js";
|
|
3
|
+
export type OneOptionParserOptions = {
|
|
4
|
+
readonly kept?: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
5
|
+
readonly minFiles: number;
|
|
6
|
+
};
|
|
7
|
+
export type OptionRead = {
|
|
8
|
+
readonly line: number;
|
|
9
|
+
readonly text: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function optionReads(ts: typeof TS, text: string, path?: string): OptionRead[];
|
|
12
|
+
export declare function oneOptionParser(ts: typeof TS, files: readonly SourceFile[], options: OneOptionParserOptions): RuleReport;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{ruleChecks as L}from"./rule.js";const b=/\.(?:[cm]?[jt]sx?)$/;function q(t,v){return/\.tsx$/.test(v)?t.ScriptKind.TSX:/\.[cm]?ts$/.test(v)?t.ScriptKind.TS:/\.jsx$/.test(v)?t.ScriptKind.JSX:t.ScriptKind.JS}function E(t,v,x="source.tsx"){const i=t.createSourceFile(x,v,t.ScriptTarget.Latest,!0,q(t,x)),y=i.parseDiagnostics??[];if(y.length>0){const n=i.getLineAndCharacterOfPosition(y[0].start).line+1;throw new Error(`cannot parse ${x}:${n}: ${t.flattenDiagnosticMessageText(y[0].messageText," ")}`)}const r=n=>{let e=n;for(;t.isParenthesizedExpression(e)||t.isAsExpression(e)||t.isSatisfiesExpression(e)||t.isTypeAssertionExpression(e)||t.isNonNullExpression(e);)e=e.expression;return e},g=n=>{const e=r(n);return t.isStringLiteral(e)||t.isNoSubstitutionTemplateLiteral(e)?e.text:void 0},d=(n,e)=>r(n).getText(i).replace(/\s+/g,"")===r(e).getText(i).replace(/\s+/g,""),k=n=>n===t.SyntaxKind.EqualsEqualsEqualsToken||n===t.SyntaxKind.EqualsEqualsToken,T=n=>n===t.SyntaxKind.ExclamationEqualsEqualsToken||n===t.SyntaxKind.ExclamationEqualsToken,u=(n,e)=>{const o=r(n);if(!(!t.isBinaryExpression(o)||!(e?k:T)(o.operatorToken.kind)))for(const[p,m]of[[o.right,o.left],[o.left,o.right]]){const c=g(p);if(c!==void 0&&g(m)===void 0)return{value:m,text:c}}},f=(n,e)=>g(n)===e.text||d(n,e.value),h=(n,e)=>{const o=r(n);if(!t.isCallExpression(o)||o.arguments.length!==1)return!1;const p=o.expression;return t.isPropertyAccessExpression(p)&&(p.name.text==="includes"||p.name.text==="has")&&d(e,o.arguments[0])},w=n=>{const e=r(n);return t.isBinaryExpression(e)&&e.operatorToken.kind===t.SyntaxKind.BarBarToken?[...w(e.left),...w(e.right)]:[e]},s=n=>{const e=r(n.condition),o=u(e,!0);if(o&&f(n.whenTrue,o))return!0;const p=u(e,!1);if(p&&f(n.whenFalse,p))return!0;if(t.isPrefixUnaryExpression(e)&&e.operator===t.SyntaxKind.ExclamationToken){const c=u(e.operand,!0);if(c&&f(n.whenFalse,c)||h(e.operand,n.whenFalse))return!0}if(h(e,n.whenTrue))return!0;const m=w(e);if(m.length>1){const c=m.map(S=>u(S,!0));if(c.every(S=>S!==void 0)&&c.every(S=>d(S.value,c[0].value))&&d(n.whenTrue,c[0].value))return!0}return!1},l=[],a=n=>{if(t.isConditionalExpression(n)&&s(n)){l.push({line:i.getLineAndCharacterOfPosition(n.getStart(i)).line+1,text:n.getText(i).replace(/\s+/g," ")});return}t.forEachChild(n,a)};return a(i),l}const A=[["A ===, the literal kept",'const a = (v: unknown) => v === "x" ? "x" : "y";'],["A ==",'const a = (v: unknown) => v == "x" ? "x" : "y";'],["A literal first",'const a = (v: unknown) => "x" === v ? "x" : "y";'],["A single quotes","const a = (v: unknown) => v === 'x' ? 'x' : 'y';"],["A a plain template","const a = (v: unknown) => v === `x` ? `x` : `y`;"],["A the tested value kept",'const a = (v: unknown) => v === "x" ? v : "y";'],["A a member",'const a = (p: { m?: string }) => p.m === "x" ? "x" : "y";'],["A optional chaining",'const a = (p?: { m?: string }) => p?.m === "x" ? p?.m : "y";'],["A as const answers",'const a = (v: unknown) => v === "x" ? ("x" as const) : ("y" as const);'],["A as and satisfies",'const a = (v: unknown) => (v as string) === "x" ? "x" satisfies string : "y";'],["A parentheses",'const a = (v: unknown) => (v === "x") ? (("x")) : "y";'],["A a <T> assertion",'const a = (v: unknown) => <string>v === "x" ? <"x">"x" : "y";',"file.ts"],["A a non-null side",'const a = (v?: string) => v! === "x" ? v! : "y";'],["A split over lines, a chain is one read",`const a = (v: unknown) =>
|
|
2
|
+
v === "x"
|
|
3
|
+
? "x"
|
|
4
|
+
: v === "z"
|
|
5
|
+
? "z"
|
|
6
|
+
: "y";`],["A inside JSX",'const A = (p: { m?: string }) => <i data-m={p.m === "x" ? "x" : "y"} />;'],["B !==",'const a = (v: unknown) => v !== "x" ? "y" : "x";'],["B != with the value kept",'const a = (v: unknown) => v != "x" ? "y" : v;'],["B !(v === x)",'const a = (v: unknown) => !(v === "x") ? "y" : "x";'],["C includes with as",'const L = ["a", "b"] as const; const a = (v: string) => L.includes(v as never) ? v : "a";'],["C a list cast",'const L = ["a", "b"] as const; const a = (v: string) => (L as readonly string[]).includes(v) ? (v as "a") : "a";'],["C a set",'const S = new Set(["a"]); const a = (v: string) => S.has(v) ? v : "a";'],["C optional chaining",'const L = ["a"]; const a = (v: string) => L?.includes(v) ? v : "a";'],["C negated",'const L = ["a"]; const a = (v: string) => !L.includes(v) ? "a" : v;'],["C split over lines",`const L = ["a"]; const a = (v: string) =>
|
|
7
|
+
L.includes(v)
|
|
8
|
+
? v
|
|
9
|
+
: "a";`],["D two options with ||",'const a = (v: unknown) => v === "a" || v === "b" ? v : undefined;'],["D three options, a member",'const a = (p: { s?: string }) => p.s === "a" || p.s === "b" || p.s === "c" ? p.s : "a";']],$=[["a mapping",'const a = (v: unknown) => v === "x" ? "y" : "z";'],["another value answered",'const a = (v: unknown, w: string) => v === "x" ? w : "z";'],["a list test answering another value",'const L = ["a"]; const a = (v: string, w: string) => L.includes(v) ? w : "a";'],["a boolean test",'const a = (v?: string) => (v ?? "left") === "center";'],["a conditional type",'type A<T> = T extends "x" ? "x" : never;'],["two literals compared",'const a = "x" === "x" ? "x" : "y";'],["|| over two values",'const a = (v: unknown, w: unknown) => v === "a" || w === "b" ? v : "c";'],["the job done right",'const a = (v: unknown) => parseOption(["x", "y"], "y", v);']];function K(t,v,x){const{check:i,report:y}=L("one option parser: a stored option is read with parseOption"),r=A.filter(([,s,l])=>E(t,s,l).length!==1).map(([s])=>s);i(`the scan finds each of the ${A.length} listed forms once`,r.length===0,r.join("; "));const g=$.filter(([,s])=>E(t,s).length!==0).map(([s])=>s);i(`…and none of the ${$.length} near misses`,g.length===0,g.join("; "));const d=E(t,A[13][1]);i("a read split over lines is reported at the line it starts",d[0]?.line===2,String(d[0]?.line));const k=v.filter(s=>b.test(s.path)&&!s.path.endsWith(".d.ts"));i(`read the source (${k.length} JS/TS files, at least ${x.minFiles})`,k.length>=x.minFiles);const T=x.kept??{},u=new Map,f=[],h=[];for(const s of k){let l;try{l=E(t,s.text,s.path)}catch(a){h.push(a.message);continue}for(const a of l){if(T[s.path]?.[a.text]!==void 0){const n=`${s.path} ${a.text}`;u.set(n,(u.get(n)??0)+1);continue}f.push(`${s.path}:${a.line} ${a.text}`)}}i("every file parses",h.length===0,h.join(`
|
|
10
|
+
`)),i("no stored option is read by a hand-written conditional (use parseOption)",f.length===0,f.join(`
|
|
11
|
+
`));const w=Object.entries(T).flatMap(([s,l])=>Object.keys(l).map(a=>[`${s} ${a}`,u.get(`${s} ${a}`)??0]).filter(([,a])=>a!==1).map(([a,n])=>`${a} (found ${n})`));return i("every kept entry is found exactly once in its file",w.length===0,w.join(`
|
|
12
|
+
`)),y()}export{K as oneOptionParser,E as optionReads};
|
|
@@ -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}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";import{parseOption as E}from"./parse-option.js";const ce="storefront-theme",qe="sf:theme-mode",Je="sf:theme-switch",Qe="hide",ve=["light","dark","auto"],et="light",tt=!1,N=7,k=18;function ie(e){return e>=N&&e<k}function nt(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 rt(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"},ot=["light","dark"];function ct(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 it(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,st={good:"Good","large-only":"Large text only",hard:"Hard to read"};function at(e){return e>=de?"good":e>=ge?"large-only":"hard"}const me=["#000000","#ffffff"];function m(e){return L(e,me)}function ut(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 lt(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 ft(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 ht(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 dt(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 gt(e){const t=f(e);return{fill:T(t)??t.accent.toLowerCase(),ink:_e(t,t.accent)}}function mt(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 pt(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 xt(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 _t(e,t){return X(e,t,B,!1)}function Et(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 St(e){return Ae(e?.themes,e?.selected)}const At=["--theme-bg","--theme-surface","--theme-surface-2","--theme-line","--theme-muted"];function Tt(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"],bt={heading:"Headings",body:"Body",label:"Labels"};function It(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"],Rt={headingLarge:"heading",headingMedium:"heading",headingSmall:"heading",accent:"heading",body:"body",label:"label"},Ct={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 Dt(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 Mt(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 Ot(e){return(D(e)??p)*C["--sf-button-radius"]}function yt(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 Xt}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 wt(e){const t=V(e);return t===j?void 0:t}function Ht(e){const t=Ge(e);return t===Pe?void 0:t}function Lt(e){const t=Z(e);return t===Ue?void 0:t}function Nt(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 kt(e){const t=J(e);return t===q?void 0:t}function Pt(e){switch(J(e)){case"tight":return{lineHeight:.95,letterSpacing:-.01};case"compressed":return{lineHeight:.86,letterSpacing:-.01};default:return{}}}const Q=["authored","sentence"],Ft={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 $t(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 Ut(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 Gt(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 Yt(e){return Xe(e?.[H])[H]}export{pe as ACCENT_DARKEN_STEPS,ot 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,Ft as DEFAULT_HEADING_TYPOGRAPHY,$e as DEFAULT_HOVER_EFFECT,Xt as DEFAULT_SHADOW_COLOR,Ct as DEFAULT_SIZES,l as DEFAULT_SURFACES,tt as DEFAULT_SWITCH_SHOWN,se as DEFAULT_THEMES,et as DEFAULT_THEME_MODE,ae as DEFAULT_THEME_VALUE,st 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,Rt 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,ve as THEME_MODES,qe as THEME_MODE_KEY,ce as THEME_STORAGE_KEY,At as THEME_SURFACE_KEYS,Qe as THEME_SWITCH_HIDE,Je as THEME_SWITCH_KEY,Te as TYPE_GROUPS,bt as TYPE_GROUP_LABELS,m as accentInk,xt as bandPresetFor,_t as bandPresetIndex,ct as brandTheme,rt as buildThemeBootScript,Ht as cardGapAttr,wt as cardShadowAttr,Pt as compressionMetrics,v as contrastRatio,M as cornerRadiusTokens,Mt as cornerStyleTokens,St as darkBandIndex,Ae as darkPresetIndex,lt as darkerAccents,ut as fillIsDark,at as gradeContrast,kt as headingCompressionAttr,Ut as headingTypographyFromRow,$t as headingTypographyStyle,Gt as headingTypographyToRow,Lt 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,nt as resolveTheme,_e as resolvedButtonInk,B as sectionBandTone,f as selectedThemeColors,Nt as shadowColorTokens,gt as siteButtonPaint,Ot as siteButtonRadiusPx,yt as siteCornerRadiusTokens,Xe as siteThemeMetadata,Yt as siteThemeOf,Et as surfacePresetIndex,pt as surfaceTwoTone,ht as themeAccentStyle,T as themeButtonColour,$ as themeButtonInk,dt as themeButtonStyle,ft as themeColorStyle,he as themeLightInk,mt as themePresetAccentVars,Tt as themeSurfaceStyle,it as themeSwatchColors,It as typeScaleGroupOfClassName,Dt as typeSizesStyle};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from "react";
|
|
2
2
|
import type { PadValues } from "../lib/content/section-padding.js";
|
|
3
|
+
import type { PartAttr } from "../../format/lib/content/part-names.js";
|
|
3
4
|
interface BlockFrameProps {
|
|
4
5
|
contained: boolean;
|
|
5
6
|
className?: string;
|
|
@@ -9,6 +10,7 @@ interface BlockFrameProps {
|
|
|
9
10
|
frame: number;
|
|
10
11
|
};
|
|
11
12
|
fillWidth?: string;
|
|
13
|
+
part?: PartAttr;
|
|
12
14
|
children: ReactNode;
|
|
13
15
|
}
|
|
14
16
|
export declare const FRAME_BASE = "mx-auto w-full max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)]";
|
|
@@ -19,5 +21,5 @@ export declare function frameGutterOf(site: boolean): string;
|
|
|
19
21
|
export declare const PRE_FRAME_BASE = "mx-auto w-full max-w-[1280px] px-[60px]";
|
|
20
22
|
export declare const PRE_FRAME_GUTTER = "max-[960px]:px-6";
|
|
21
23
|
export declare const PRE_FRAME = "mx-auto w-full max-w-[1280px] px-[60px] max-[960px]:px-6";
|
|
22
|
-
export default function BlockFrame({ contained, className, style, pad, fillWidth, children }: BlockFrameProps): import("react").JSX.Element;
|
|
24
|
+
export default function BlockFrame({ contained, className, style, pad, fillWidth, part, children }: BlockFrameProps): import("react").JSX.Element;
|
|
23
25
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import{siteSideRoom as r}from"../../format/lib/content/page-width.js";import E from"./SiteGutterFrame.js";const i="mx-auto w-full max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)]",e=r("box").frame,x=`${i} ${e}`,l=r("site").frame;function $(t){return t?l:e}const u="mx-auto w-full max-w-[1280px] px-[60px]",R="max-[960px]:px-6",d=`${u} ${R}`;function c({contained:t,className:o="",style:p,pad:s,fillWidth:a="w-full",part:m,children:f}){return n(E,{contained:t,framedClass:`${x} ${o}`,fillClass:`${a} ${o}`,columnClass:x,style:p,pad:s,part:m,children:f})}export{x as FRAME,i as FRAME_BASE,e as FRAME_GUTTER,l as FRAME_SITE_GUTTER,d as PRE_FRAME,u as PRE_FRAME_BASE,R as PRE_FRAME_GUTTER,c as default,$ as frameGutterOf};
|
|
@@ -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,4 +1,5 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, CSSProperties, ReactNode } from "react";
|
|
2
|
+
import type { PartAttr } from "../../format/lib/content/part-names.js";
|
|
2
3
|
type Variant = "primary" | "ghost";
|
|
3
4
|
interface CommonProps {
|
|
4
5
|
variant?: Variant;
|
|
@@ -7,6 +8,8 @@ interface CommonProps {
|
|
|
7
8
|
spread?: boolean;
|
|
8
9
|
className?: string;
|
|
9
10
|
style?: CSSProperties;
|
|
11
|
+
part?: PartAttr;
|
|
12
|
+
glyphPart?: PartAttr;
|
|
10
13
|
children: ReactNode;
|
|
11
14
|
}
|
|
12
15
|
interface LinkProps extends CommonProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r,Fragment as
|
|
1
|
+
import{jsx as r,Fragment as c,jsxs as p}from"react/jsx-runtime";import{SiteLink as N}from"../lib/site-runtime.js";import{BUTTON_PAD_CLASSES as v}from"../lib/content/button-look.js";const b=`sf-button group inline-flex items-center justify-center gap-2.5 border ${v} font-mono text-[length:var(--size-label,14px)] uppercase tracking-[0.2em] transition-colors`,h={primary:"border-btn bg-btn text-btn-ink hover:border-btn-2 hover:bg-btn-2",ghost:"border-current bg-transparent hover:bg-white/10"};function w(m){const{variant:u="primary",arrow:e,glyphBefore:f,spread:d,className:g,style:t,part:x,glyphPart:n,children:a,href:s,newTab:y,hrefRewrite:i,...j}=m,o=`${d?b.replace("justify-center","justify-between").replace("gap-2.5","gap-6"):b} ${h[u]??h.primary} ${g??""}`,l=f?p(c,{children:[e!==null&&r("span",{"aria-hidden":!0,className:"inline-flex",...n,children:e??"→"}),a]}):p(c,{children:[a,e!==null&&r("span",{"aria-hidden":!0,className:"transition-transform group-hover:translate-x-[3px]",...n,children:e??"→"})]});return s?r(N,{href:s,className:o,style:t,newTab:y?!0:"auto",...i?{hrefRewrite:i}:{},...x,children:l}):r("button",{type:"button",className:o,style:t,...j,children:l})}export{w 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 v}from"../../format/lib/content/button-arrow.js";import{buttonIconAtEnd 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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as A,jsx as e,jsxs as L}from"react/jsx-runtime";import{useContext as St,useId as wt,useState as pt}from"react";import xt from"./BoxTabs.js";import{AccordionRowStyleContext as oo,BoxTabPaneContext as so,useAccordionRowStyle as _t,useBoxPaneKind as vt,useFirstCopyOpens as Rt,useIsTabPane as Ot}from"./BoxTabPaneContext.js";import Pt,{ACCORDION_COUNTER_RESET as At}from"./BoxAccordionRow.js";import{ACCORDION_MARK_SHEET as Lt}from"./AccordionMark.js";import{EDGE_LINE_ATTRS as $t}from"../../format/lib/content/view-lines.js";import{accordionRowStyleOf as yt}from"../../format/lib/content/accordion-row-style.js";import{boxPhoneCell as Nt,boxPhoneOrder as Et}from"../../format/lib/content/box-phone-place.js";import{CellFillContext as ys,InBoxContext as Ns,useCellOfStretchedRow as kt,useFillsCell as It}from"./InBoxContext.js";import Bt,{InsideSiteColumn as Es,useInsideSiteGutter as gt,useSectionRoot as Tt}from"./SiteGutterFrame.js";import{BoxSurfaceProvider as Ft}from"./BoxSurfaceContext.js";import Ht from"./PictureWash.js";import{BoxCellContext as ks,NoCellBound as Dt}from"./BoxCellContext.js";import{boxCellFractions as Vt}from"../lib/content/box-cell-bound.js";import{boundOf as Mt}from"../../format/lib/content/cell-picture-sizes.js";import{useInSiteHeader as Wt}from"./PhoneMenuTools.js";import{useCardRow as Gt}from"./CardRowContext.js";import{cardLineBetween as no,framesItsCards as Xt}from"../../format/lib/content/card-place.js";import{rowLinkText as jt}from"../../format/lib/content/card-template.js";import{HandedMirrorContext as Kt,MirrorContext as Ut,RowHandContext as Is,boxPlace as zt,useHandedMirrorAbove as Yt,useHandedRows as Jt,useMirroredCopy as Zt,useUnderCardBox as qt}from"./MirrorContext.js";import{boxChildrenHand as Qt,isMirroredCopy as er,mirrorCardsActs as Bs,mirrorCardsOf as or,mirroredBoxClass as sr,MIRROR_ROW_CLASS as nr,ownsCard as tr}from"../../format/lib/content/mirror-cards.js";import{FRAME_BASE as to,frameGutterOf as rr}from"./BlockFrame.js";import{BOX_SIDE_SPACE_SITE as lr,boxSideSpaceOf as ir}from"../../format/lib/content/box-side-space.js";import{containerGapProps as gs}from"../../format/lib/content/container-gap.js";import{boxLayoutClasses as cr,boxAlignViewClasses as ar,boxBlockSpacingClass as dr,boxBlockSpacingViewClasses as ur,boxJustifyViewClasses as mr,boxWrapTabletClass as fr,boxFitContentClass as hr,boxAccordionColumnsClass as Ts,boxRowColumnsClass as Cr,boxRowTabletColumnsClass as br,boxRowTabletShareClass as Sr,boxPhoneCellsShareLine as wr,boxPhoneRowClasses as ce,boxPhoneRowFits as Fs,boxShareClasses as $,boxShareVars as pr,boxWrapClass as xr,BOX_GAP_ONLY_CLASS as _r}from"../../format/lib/content/box-layout.js";import{boxSeparatorClasses as vr,boxSeparatorSeamClass as Rr,boxSeparatorStyle as Or,isStripBox as Pr}from"../../format/lib/content/box-separator.js";import{DEFAULT_LOOP_DELAY as Ar,DEFAULT_LOOP_DIRECTION as Lr,DEFAULT_LOOP_SECONDS as $r,isVerticalLoop as yr}from"../../format/lib/animation/index.js";import{LoopTrack as Nr}from"../lib/animation/LoopTrack.js";import{BOX_CARD_PAD as y,BOX_OWNS_SIDES_CLASS as Er,boxDarkenStyle as Hs,boxPaintOf as kr,boxFillFadeStyle as Ir,boxFillViews as Br,boxPlacementClasses as gr,boxCardProps as Tr,boxIsCard as Ds,boxRowPicture as Fr,boxSwatchFill as Hr,boxWashViews as Dr,CARD_NO_LIFT_CLASS as Vr,CARD_SHADOW_CLASS as Mr,isBackgroundBox as _e}from"../../format/lib/content/box-background.js";import{BOX_ROW_IMAGE_PROP as x}from"../../format/lib/content/box-card-rule.js";import{boxShadowAttrs as Wr,boxShadowOnAnyView as Gr,boxShadowViewAttrs as Xr}from"../../format/lib/content/box-shadow.js";import{boxRunsEdgeToEdge as jr,drawsSiteGutter as Kr}from"../../format/lib/content/site-gutter.js";import{boxShapeClass as Ur,boxShapeClasses as zr,boxShapeStyle as Yr}from"../../format/lib/content/box-shape.js";import{boxAngleStyle as Jr}from"../../format/lib/content/box-angle.js";import{BOX_JUMP_ATTR as Zr,BOX_LINK_ATTR as Vs,BOX_LINK_CLASS as Ms,BOX_LINKED_CLASS as qr,boxJumpBlocksClass as Qr,boxJumpCss as el,boxJumpSlug as ol,boxLinkOf as sl,siteLinkDraws as nl}from"../../format/lib/content/box-link.js";import{SiteLink as tl}from"../lib/site-runtime.js";import{sectionBorderStyle as Ws}from"../../format/lib/content/borders.js";import{finiteNumber as ve}from"../../format/lib/finite-number.js";import{padDefaultIn as N,padSideValue as Re,sectionPadAttrs as rl}from"../lib/content/section-padding.js";import{SECTION_FILL_CLASS as Oe}from"../../format/lib/content/section-min-height.js";import{ON_MEDIA_INK_STYLE as ll,rowFillInkStyle as il}from"../../format/lib/content/ink.js";import{useThemeLightInk as cl}from"./ThemeLightInkContext.js";import{sizedBackground as ro}from"../../format/lib/sized-image.js";import{BOX_REVEAL_CLASS as al,BOX_REVEAL_CSS as dl,BOX_REVEAL_SHEET as ul,PHOTO_HOST_ATTR as ml,resolveImageTreatment as fl}from"../../format/lib/content/image-treatment.js";import hl,{HoverArrowsSlot as Cl,HoverMediaArrows as bl}from"./HoverMediaLayer.js";import{HOVER_ARROWS_HOST_ATTR as Sl,HOVER_ARROWS_HOST_CLASS as wl,HOVER_LAYER_GROUND as pl,cardRowHoverMedia as xl,hoverLayerName as _l}from"../../format/lib/content/hover-media.js";import{BOX_HIGHLIGHT_CLASS as vl,BOX_HIGHLIGHT_OVER_ROW_INK_CLASS as Rl,BOX_SHOW_ON_CARD_HOVER as Ol}from"../../format/lib/animation/hover.js";import{BoxRail as Pl,BoxRailStop as Al,RAIL_STOPS_CLASS as Ll,useTimelineRail as $l}from"./TimelineRail.js";import{SHARED_PLAIN_ATTR as yl,sharedColumnsClasses as Nl,sharedColumnsCss as El,sharedRowsClasses as kl,sharedRowsCss as Il}from"../lib/content/box-shared-columns.js";import Gs from"./PhotoHoverSheet.js";import{PICTURE_FRAME_ONLY as Bl,PictureHoverMoveSheet as gl,PictureHoverZoom as Tl,pictureHoverMoveOf as Fl}from"./PictureHoverMove.js";import{BOX_DESKTOP_LINE as Hl,stackGutterClass as Dl,stackLineCss as Vl,stackOuterClass as Ml,stackRowClass as Wl,storedStackLine as lo}from"../lib/content/box-stack-line.js";const io={"--sf-site-gutter":"0px"},Gl={overflowX:"clip",overflowY:"visible"},Xl={stretchedRow:!1,fillingColumn:!1,columnsRow:!1},Xs={desktop:!1,phone:!1},js="bg-cover bg-center bg-[image:var(--sf-box-bg)] max-view-wide:bg-[image:var(--sf-box-bg-p)]",co=u=>u==null||u==="",ao=u=>!co(u)&&Number(u)===0;function jl({children:u}){return e(A,{children:u(wt())})}function Kl({direction:u,label:Ks,tabShape:Us,gap:uo,gapPhone:zs,gapTablet:Pe,justify:z,align:E,wrap:ae,share:Ys,sharePhone:F,shareTablet:H,wrapPhone:Js,orderPhone:Zs,phoneRow:C,columns:m,columnsTablet:D,separator:f,stackBelow:de,blockSpacing:mo,bgImage:qs,bgImagePhone:Qs,rowImage:en,hoverShow:on,pictureHover:V,darken:Ae,darkenStyle:ue,darkenTablet:sn,darkenPhone:nn,darkenStyleTablet:tn,darkenStylePhone:rn,placement:ln,padV2:fo=!1,border:cn,borderTablet:an,borderPhone:dn,borderUnits:ho,pad:r={},contained:Le=!0,fillHeight:_=!1,shadow:$e,shadowTablet:Co,shadowPhone:bo,justifyTablet:So,justifyPhone:un,alignTablet:mn,alignPhone:fn,wrapTablet:wo,blockSpacingTablet:hn,blockSpacingPhone:Cn,loop:b,scrollDirection:ye=Lr,loopSeconds:bn=$r,loopDelay:Sn=Ar,editing:k=!1,fillColor:po,fillColorTablet:wn,fillColorPhone:pn,fillFade:xn,swatch:_n,line:v,upcoming:vn,link:Rn,rowLink:xo,highlight:On,boxShape:Ne,boxShapePhone:_o,boxShapeTablet:vo,angle:Pn,jumpHighlight:An,anchor:Ln,sharedSides:$n=Xs,sharedRows:yn=!1,boxId:M,slotCount:Nn,mirrorCards:Ro,content:c,rowTitle:Ee,startsOpen:En,rowStyle:kn,sideSpace:In}){const n=Gt(),I=Tr({[x]:en},n!==null)[x],Oo=Ds({[x]:I}),d=Oo?Xs:$n,Bn=Oo?!1:yn,Po=Fr({[x]:I},n?.row),S=Po??qs,ke=Po===null?Qs:void 0,Ao=St(ks),[Lo,gn]=pt(null),Tn=Yt(),$o=qt()&&!(Tn&&n!==null),R=Jt(),h=tr({inCopy:n!==null,nestedCopy:n?.nested===!0,underBox:$o}),Ie=on===Ol&&n!==null&&!h&&!(k&&n.previewHover===!0),yo=no(cn,n,h),No=no(an,n,h),Eo=no(dn,n,h),ko=n===null&&!$o&&R?.ids&&M?R.ids.indexOf(M):-1,me=ko>=0&&R&&M?zt(R,M,ko):-1,w=me>=0?R?.hand??null:h&&R?.copies===!0?R.hand:null,o=w?.row?"row":u,a=w?.row?w.row.share:Ys,Fn=w?.row?w.row.phoneReverse?[...c.blockIds??[]].reverse():void 0:Zs,fe=Bn&&!w?.row,W=k?"":xo&&n?jt(n.row,xo)??"":sl(Rn),O=_?"":zr(Ne,_o,vo),Hn=!_&&Ur(Ne)!=="",B=ol(An,Ln),Be=Hr({swatch:_n},n?.row),Y=Be??kr(po),g=Be?{className:"",style:{}}:Br(po,wn,pn),Dn=cl(),Io=il(Be,Dn??void 0),Vn=_e(S)||_e(ke),Mn=(Y||g.className)&&!Vn?Ir(xn):null,Bo=Y||g.className?{...Y?{backgroundColor:Y}:{},...g.style,...Mn,...Io}:void 0,go=$l(),J=v===!0&&o!=="tabs"&&o!=="accordion",t=Ds({bgImage:S,[x]:I}),To=Jr(Pn),Fo=t?void 0:Bo,he=t?null:On??null,Ho=_?null:Yr(Ne,_o,vo),Wn=To||he||Ho?{...Fo,...To,...he,...Ho}:Fo,Ce=Wt(),Gn=Tt(),Xn=Ot(),Do=vt(),Vo=_t(),jn=Rt(),l=o==="accordion",ge=yt(kn),Z=l&&ge==="numbered",Te=l&&ge==="chevron",Fe=It(),Mo=kt(),G=Pr(o,f),i=b==="scroll"&&o!=="tabs"&&!l,Kn=Zt(),be=h||me>=0&&w!==null,Wo=w?w.mirror:Ro,Un=me>=0?me:n?.index,q=h&&Xt(n?.ownerType),Go=Bs({direction:o,separator:f,loop:b,line:v,bgImage:S,[x]:I,columns:m,columnsTablet:D,share:a,wrap:ae},be,d.desktop)&&er(Wo,Un),zn=Bs({direction:o,separator:f,loop:b,line:v,bgImage:S,[x]:I,columns:m,columnsTablet:D,share:a,wrap:ae},be,d.desktop)&&or(Wo)!==null,X=Cr({direction:o,separator:f,loop:b,line:v,columns:m}),T=br({direction:o,separator:f,loop:b,line:v,columnsTablet:D}),Q=Sr({direction:o,separator:f,loop:b,line:v,columns:m,columnsTablet:D,share:a,shareTablet:H}),ee=ir(In)===lr,He=rr(ee),Xo=J&&lo(de)===Hl,j=o==="row"&&!t&&!G&&!i&&(!J||Xo)&&T===""&&Q===""?lo(de):void 0,K=j??(o==="column"&&!t?lo(de):void 0),Yn=gt(),Se=Nl(d,c.blockCount??0,j),Jn=(Se&&(!n||n.index===0)?El(d,c.blockCount??0,j):"")+(fe&&(!n||n.index===0)?Il(fe,c.blockCount??0):""),jo=kl(fe,c.blockCount??0),Ko=T!==""?Number(D)>=2:Q===""||$(H)!=="",Uo=T!==""||Q!=="",De=o==="row"&&!G&&!i&&v!==!0,Ve=De&&!d.phone&&!d.desktop?Nt(Et(Fn,c.blockIds??[]),{editing:k}):void 0,zo=Ve!==void 0&&!k,Zn=X!==""?Number(m)>=2:$(a)!=="",Yo=!t&&!l&&!zn&&!d.desktop&&!d.phone,we=Yo&&!i?mr(z,So,un):"",Me=t||be?"":sr(Kn,o,i?void 0:z,E,we?So:void 0),qn=/view-wide:max-view-desktop:justify-/.test(Me)?we.split(" ").filter(s=>!s.startsWith("view-wide:max-view-desktop:justify-")).join(" "):we,Qn=Yo&&o==="row"?ar(E,mn,fn):"",Jo=Mo&&o==="column"&&!t&&!i&&!l,We=typeof z=="string"&&z!=="start"||we!=="",Zo=Jo&&We&&$(a)!=="",qo=Jo&&!We&&$(a)!==""&&(c.blockCount??0)===1,et=!i&&!l&&X===""&&T===""&&!d.desktop?fr(ae,wo):"",Qo=[l||Zo?"":$(a),o==="row"?hr(a):"",X,T,Q,dr(l?"gap":mo),vr(o,f),l&&!Z&&!Te?"border-t border-line":"",qn,Qn,et,l?"":ur(mo,hn,Cn),l?Ts(m,C,Z||Te):"",Z?At:""].filter(Boolean).join(" "),ot=Qo?` ${Qo}`:"",es=["flex",o==="row"?G||i?"flex-row":`flex-row ${ce(C,F,Js,wo)}`:"flex-col",xr(i||l?!1:ae),t?gr(ln??"center",o):cr(i||l?void 0:z,l?void 0:E)+(Me?` ${Me}`:"")].join(" ")+ot,oe=_||t||O||Fe?` ${Oe}`:"",Ge=Hn?` ${O}`:O?`${oe} ${O}`:oe,os=Mo&&o==="column"&&!t&&!i&&$(a)===""&&We||Zo,ss=oe||(os||qo?` ${Oe}`:""),Xe=W?` ${qr}`:"",je=t||Ce||fo?"":" py-6",st=j===void 0?"":` ${Wl(j)}`,ns=K===void 0||ee?"":` ${Dl(K)}`,Ke=K===void 0?"":` ${Ml(K)}`,nt=`${to}${je} ${He}${Ge}${Xe}${ns}${Ke}`,tt=Ce?`${Ge}${Xe}${Ke}`.trim():`w-full${je}${Ge}${Xe}${Ke}`,se=(Z||Te)&&Ts(m,C)===""?gs("Flex",0,"block"):gs("Flex",uo,o==="row"?"inline":"block",zs,G||i?void 0:Pe),ts=pr(a,H,o==="row"?c.blockCount??0:0),rs=G?{...se.style,...Or(o,f)}:se.style,rt=ts?{...rs,...ts}:rs,Ue=(s="")=>e(c,{className:`${es}${Go?` ${nr}`:""}${se.className}${ss}${st}${s?` ${s}`:""}${J?` ${Ll}`:""}${B?` ${Qr(B)}`:""}${Se}${jo}`,style:rt,minEmptyHeight:120,...Ve?{cell:Ve}:null}),ls=yr(ye)?"":Rr(o,f),is=i?e(Nr,{direction:ye,seconds:bn,delay:Sn,editing:k,copy:s=>Ue(s&&ls?`${s} ${ls}`:s)}):Z?L(A,{children:[e("style",{children:Lt}),Ue()]}):Ue(),ze=o==="tabs"?e(xt,{className:`${es}${se.className}${Fe&&!_&&!t&&!O?"":oe}`,style:se.style,shape:Us,children:is}):is,Ye=l?e(so.Provider,{value:"accordion",children:e(oo.Provider,{value:ge,children:ze})}):Do?e(so.Provider,{value:!1,children:e(oo.Provider,{value:"plain",children:ze})}):ze,cs=o==="row"&&!t&&(E===void 0||E==="stretch"),lt={stretchedRow:cs,fillingColumn:o==="column"&&(Fe||os),columnsRow:X!==""||T!==""||Se!==""||jo!==""||o==="row"&&(Array.isArray(a)||Array.isArray(H))||zo,...zo?{phoneCells:!0}:null,...cs&&De&&(c.blockCount??0)>=2&&Zn||qo?{picturesFillRow:!0}:null,...Uo&&!Ko?{fillFrom:"desktop"}:null,...wr(C,F)&&(!Uo||Ko)?{phoneRowFills:!0}:null,...De&&Fs(C,F)?{phoneRowFits:!0}:null,...i?{loops:!0}:null,...M?{id:M}:null},as=n===null?Qt({direction:o,loop:b,bgImage:S,[x]:I,columns:m,mirrorCards:Ro},!1):null,ds=as?e(Is.Provider,{value:{hand:as,ids:c.blockIds??[],boxes:[]},children:Ye}):R?e(Is.Provider,{value:null,children:Ye}):Ye,us=e(Ns.Provider,{value:lt,children:e(ys.Provider,{value:!1,children:be?e(Ut.Provider,{value:Go,children:e(Kt.Provider,{value:!h,children:ds})}):ds})}),it=Ee?.blockCount??0,ms=Do==="accordion"&&!!Ee&&(k||it>0)?e(Pt,{startsOpen:En===!0||jn&&h&&n?.index===0,editing:k,numbered:Vo==="numbered",chevron:Vo==="chevron",title:e(Ns.Provider,{value:Xl,children:e(ys.Provider,{value:!1,children:e(so.Provider,{value:!1,children:e(oo.Provider,{value:"plain",children:e(Ee,{className:`min-w-0 flex-1 ${_r}`,minEmptyHeight:24})})})})}),children:us}):us,Je=J?e(Pl,{row:o==="row",stops:c.blockCount??0,desktopLine:j!==void 0&&Xo,children:ms}):ms,ct=Ks?.trim()||(Xn?"":void 0),at={values:r,frame:je?24:0},dt=s=>go?e(Al,{on:go,future:vn===!0,children:s}):s,ut=s=>nl(W)?e(tl,{href:W,newTab:"auto",className:Ms,"aria-labelledby":s,[Vs]:""}):e("a",{href:W,className:Ms,"aria-labelledby":s,[Vs]:""}),fs=(B?el(B):"")+Jn+(K===void 0||n&&n.index!==0?"":Vl(K,{gutter:!ee})),hs=fs?e("style",{dangerouslySetInnerHTML:{__html:fs}}):null,ne=jr({loop:b,direction:o,scrollDirection:ye,bgImage:S,[x]:I}),mt=d.desktop&&Se!==""&&!Y&&!g.className&&!Ws(yo,Eo,No,ho)&&!Gr($e,Co,bo)&&!W&&!O&&!_&&!B&&!Kr(Le&&!ne,Yn)&&ao(uo)&&(co(Pe)||ao(Pe))&&fo&&Object.values(r).every(s=>co(s)||ao(s)),ft=s=>({...$t,...mt?{[yl]:""}:null,...t?null:{...Wr($e),...Xr($e,Co,bo)},...B?{[Zr]:B}:null,...s?{id:s}:null}),Cs=X!==""?Number(m):0,ht=ce(C,F)===ce(void 0),Ct=(o==="column"||o==="row"&&!G&&!i&&(Cs===1&&ht||Cs===0&&c.blockCount===1))&&!t&&!J&&!Ce,bs=t&&Gn&&!Ce,pe=!t&&n!==null?Hs(Ae,ue):null,Ss=Ie||pe?L(A,{children:[Ie?e(Gs,{sheet:dl,name:ul}):null,pe?e("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 -z-10 rounded-[inherit]",style:pe}):null]}):null,ws=[Ie?al:"",pe?"relative isolate":""].filter(Boolean).join(" "),ps=s=>Ss?L(A,{children:[Ss,s]}):s,xs=(s,P)=>dt(e(Bt,{contained:Le&&!ne,style:ne?io:void 0,framedClass:nt,fillClass:tt,columnClass:`${to} ${He}${ss}${ns}`,tabLabel:ct,pad:t?void 0:at,border:Ws(yo,Eo,No,ho),outerAttrs:ft(P),box:!0,edge:Ct,outerStyle:Wn,outerClass:t?ws||void 0:[g.className,he?vl:"",he&&Io?Rl:"",ws].filter(Boolean).join(" ")||void 0,bleed:bs,siteSide:ee,children:hs||P?L(A,{children:[hs,P?ut(P):null,ne?e(Es,{children:s}):s]}):ne?e(Es,{children:s}):s})),Ze=s=>W?e(jl,{children:P=>xs(ps(s),P)}):xs(ps(s)),_s=s=>Ao.bound?e(Dt,{children:s}):s;if(!t){const s=E===void 0||E==="stretch",P=($(a)!==""||X!==""||T!=="")&&!Fs(C,F)&&!(Q!==""&&$(H)==="")&&(s||ce(C)!==ce(void 0));if(!(o==="row"?P:o==="column"&&s))return Ze(_s(Je));const $s=Vt({direction:o,separator:f,loop:b,line:v,share:a,shareTablet:H,sharePhone:F,phoneRow:C,columns:m,columnsTablet:D,stackBelow:de,shared:d.desktop||d.phone||fe,count:Nn}),bt={hasWidth:!0,...$s?{bound:Mt($s,Ao.bound)}:null};return Ze(e(ks.Provider,{value:bt,children:Je}))}const te=_e(S),re=te?Hs(Ae,ue):null,xe=te?Dr({darken:Ae,darkenStyle:ue,darkenTablet:sn,darkenStyleTablet:tn,darkenPhone:nn,darkenStylePhone:rn}):{className:"",style:{}},qe=_e(ke),vs=te?qe?{"--sf-box-bg":ro(S??""),"--sf-box-bg-p":ro(ke??"")}:{backgroundImage:ro(S??""),backgroundSize:"cover",backgroundPosition:"center"}:{},Rs=fl(void 0,void 0,V),U=Rs.className?Rs:null,le=te&&n&&V?.kind==="nextImage"&&V.media?xl(n,V.media):null,p=te?Fl(V,ue)??(le?Bl:null):null,Os=V?.media?.cover??"picture",Qe=le?e("div",{className:`absolute inset-0 isolate${q?" rounded-[inherit]":""}`,children:e(Cl.Provider,{value:gn,children:e(hl,{media:le,name:_l(n?.row),cover:Os,ground:pl[Os],arrowsAbove:!0})})}):null,ie=U!==null||!!p?.zoom,Ps=ie?e("div",{"aria-hidden":!0,className:`absolute inset-0${q?" rounded-[inherit]":""}${qe?` ${js}`:""}${U?` ${U.className}`:""}`,style:{...vs,...U?.style??{}}}):null,eo=rl({...r,top:ve(r.top)??N(y.desktop,r.unit,"desktop"),bottom:ve(r.bottom)??N(y.desktop,r.unit,"desktop"),topPhone:ve(r.topPhone)??N(y.phone,r.unitPhone,"mobile"),bottomPhone:ve(r.bottomPhone)??N(y.phone,r.unitPhone,"mobile"),left:Re(r.left)??N(y.side,r.unit,"desktop"),right:Re(r.right)??N(y.side,r.unit,"desktop"),leftPhone:Re(r.leftPhone)??N(y.sidePhone,r.unitPhone,"mobile"),rightPhone:Re(r.rightPhone)??N(y.sidePhone,r.unitPhone,"mobile"),sideSpace:ee?"site":"box"}),As=e("div",{className:`relative z-[1] ${Er} ${eo?.className??""}${_||O?` ${Oe}`:""}`.trimEnd(),style:re?{...eo?.style,...io,...ll}:{...eo?.style,...io},children:_s(Je)}),Ls=bs&&Le?e("div",{className:`${to} ${He}${_||O?` ${Oe}`:""}`,children:As}):As;return Ze(e(A,{children:L("div",{className:`relative isolate overflow-hidden ${Mr}${n!==null&&!h?` ${Vr}`:""}${oe}${qe&&!ie?` ${js}`:""}${g.className?` ${g.className}`:""}${p?` ${p.className}`:""}`,style:{...q?Gl:{},...Bo,...ie?{}:vs,...p?p.style:{}},...U||le?{[ml]:""}:{},children:[e(gl,{move:p}),ie&&L(A,{children:[e(Gs,{sheet:U?.sheet}),p?.zoom?e("div",{className:`absolute inset-0 overflow-hidden${q?" rounded-[inherit]":""}`,children:L(Tl,{move:p,className:"absolute inset-0",children:[Ps,Qe]})}):L(A,{children:[Ps,Qe]})]}),!ie&&Qe,e(Ht,{wash:re&&xe.className?{...re,...xe.style}:re,hover:p?.washHover,...q?{className:"rounded-[inherit]"}:{},...xe.className?{restClassName:xe.className}:{}}),re?e(Ft,{children:Ls}):Ls,le?e("div",{[Sl]:"",className:wl,children:Lo?e(bl,{state:Lo}):null}):null]})}))}export{Kl as default};
|
|
1
|
+
import{Fragment as A,jsx as e,jsxs as L}from"react/jsx-runtime";import{useContext as wt,useId as pt,useState as xt}from"react";import _t from"./BoxTabs.js";import{AccordionRowStyleContext as oo,BoxTabPaneContext as so,useAccordionRowStyle as vt,useBoxPaneKind as Rt,useFirstCopyOpens as Ot,useIsTabPane as Pt}from"./BoxTabPaneContext.js";import At,{ACCORDION_COUNTER_RESET as Lt}from"./BoxAccordionRow.js";import{ACCORDION_MARK_SHEET as $t}from"./AccordionMark.js";import{EDGE_LINE_ATTRS as yt}from"../../format/lib/content/view-lines.js";import{accordionRowStyleOf as Nt}from"../../format/lib/content/accordion-row-style.js";import{boxPhoneCell as Et,boxPhoneOrder as kt}from"../../format/lib/content/box-phone-place.js";import{CellFillContext as Ns,InBoxContext as Es,useCellOfStretchedRow as It,useFillsCell as Bt}from"./InBoxContext.js";import gt,{InsideSiteColumn as ks,useInsideSiteGutter as Tt,useSectionRoot as Ft}from"./SiteGutterFrame.js";import{BoxSurfaceProvider as Ht}from"./BoxSurfaceContext.js";import Dt from"./PictureWash.js";import{BoxCellContext as Is,NoCellBound as Vt}from"./BoxCellContext.js";import{boxCellFractions as Mt}from"../lib/content/box-cell-bound.js";import{boundOf as Wt}from"../../format/lib/content/cell-picture-sizes.js";import{useInSiteHeader as Gt}from"./PhoneMenuTools.js";import{useCardRow as Xt}from"./CardRowContext.js";import{cardLineBetween as no,framesItsCards as jt}from"../../format/lib/content/card-place.js";import{rowLinkText as Kt}from"../../format/lib/content/card-template.js";import{HandedMirrorContext as Ut,MirrorContext as zt,RowHandContext as Bs,boxPlace as Yt,useHandedMirrorAbove as Jt,useHandedRows as Zt,useMirroredCopy as qt,useUnderCardBox as Qt}from"./MirrorContext.js";import{boxChildrenHand as er,isMirroredCopy as or,mirrorCardsActs as gs,mirrorCardsOf as sr,mirroredBoxClass as nr,MIRROR_ROW_CLASS as tr,ownsCard as rr}from"../../format/lib/content/mirror-cards.js";import{FRAME_BASE as to,frameGutterOf as lr}from"./BlockFrame.js";import{BOX_SIDE_SPACE_SITE as ir,boxSideSpaceOf as cr}from"../../format/lib/content/box-side-space.js";import{containerGapProps as Ts}from"../../format/lib/content/container-gap.js";import{boxLayoutClasses as ar,boxAlignViewClasses as dr,boxBlockSpacingClass as ur,boxBlockSpacingViewClasses as mr,boxJustifyViewClasses as fr,boxWrapTabletClass as hr,boxFitContentClass as Cr,boxAccordionColumnsClass as Fs,boxRowColumnsClass as br,boxRowTabletColumnsClass as Sr,boxRowTabletShareClass as wr,boxPhoneCellsShareLine as pr,boxPhoneRowClasses as ce,boxPhoneRowFits as Hs,boxShareClasses as $,boxShareVars as xr,boxWrapClass as _r,BOX_GAP_ONLY_CLASS as vr}from"../../format/lib/content/box-layout.js";import{boxSeparatorClasses as Rr,boxSeparatorSeamClass as Or,boxSeparatorStyle as Pr,isStripBox as Ar}from"../../format/lib/content/box-separator.js";import{DEFAULT_LOOP_DELAY as Lr,DEFAULT_LOOP_DIRECTION as $r,DEFAULT_LOOP_SECONDS as yr,isVerticalLoop as Nr}from"../../format/lib/animation/index.js";import{LoopTrack as Er}from"../lib/animation/LoopTrack.js";import{BOX_CARD_PAD as y,BOX_OWNS_SIDES_CLASS as kr,boxDarkenStyle as Ds,boxPaintOf as Ir,boxFillFadeStyle as Br,boxFillViews as gr,boxPlacementClasses as Tr,boxCardProps as Fr,boxIsCard as Vs,boxRowPicture as Hr,boxSwatchFill as Dr,boxWashViews as Vr,CARD_NO_LIFT_CLASS as Mr,CARD_SHADOW_CLASS as Wr,isBackgroundBox as _e}from"../../format/lib/content/box-background.js";import{BOX_ROW_IMAGE_PROP as x}from"../../format/lib/content/box-card-rule.js";import{boxShadowAttrs as Gr,boxShadowOnAnyView as Xr,boxShadowViewAttrs as jr}from"../../format/lib/content/box-shadow.js";import{boxRunsEdgeToEdge as Kr,drawsSiteGutter as Ur}from"../../format/lib/content/site-gutter.js";import{boxShapeClass as zr,boxShapeClasses as Yr,boxShapeStyle as Jr}from"../../format/lib/content/box-shape.js";import{boxAngleStyle as Zr}from"../../format/lib/content/box-angle.js";import{BOX_JUMP_ATTR as qr,BOX_LINK_ATTR as Ms,BOX_LINK_CLASS as Ws,BOX_LINKED_CLASS as Qr,boxJumpBlocksClass as el,boxJumpCss as ol,boxJumpSlug as sl,boxLinkOf as nl,siteLinkDraws as tl}from"../../format/lib/content/box-link.js";import{SiteLink as rl}from"../lib/site-runtime.js";import{sectionBorderStyle as Gs}from"../../format/lib/content/borders.js";import{finiteNumber as ve}from"../../format/lib/finite-number.js";import{padDefaultIn as N,padSideValue as Re,sectionPadAttrs as ll}from"../lib/content/section-padding.js";import{SECTION_FILL_CLASS as Oe}from"../../format/lib/content/section-min-height.js";import{ON_MEDIA_INK_STYLE as il,rowFillInkStyle as cl}from"../../format/lib/content/ink.js";import{useThemeLightInk as al}from"./ThemeLightInkContext.js";import{sizedBackground as ro}from"../../format/lib/sized-image.js";import{BOX_REVEAL_CLASS as dl,BOX_REVEAL_CSS as ul,BOX_REVEAL_SHEET as ml,PHOTO_HOST_ATTR as fl,resolveImageTreatment as hl}from"../../format/lib/content/image-treatment.js";import Cl,{HoverArrowsSlot as bl,HoverMediaArrows as Sl}from"./HoverMediaLayer.js";import{HOVER_ARROWS_HOST_ATTR as wl,HOVER_ARROWS_HOST_CLASS as pl,HOVER_LAYER_GROUND as xl,cardRowHoverMedia as _l,hoverLayerName as vl}from"../../format/lib/content/hover-media.js";import{BOX_HIGHLIGHT_CLASS as Rl,BOX_HIGHLIGHT_OVER_ROW_INK_CLASS as Ol,BOX_SHOW_ON_CARD_HOVER as Pl}from"../../format/lib/animation/hover.js";import{BoxRail as Al,BoxRailStop as Ll,RAIL_STOPS_CLASS as $l,useTimelineRail as yl}from"./TimelineRail.js";import{SHARED_PLAIN_ATTR as Nl,sharedColumnsClasses as El,sharedColumnsCss as kl,sharedRowsClasses as Il,sharedRowsCss as Bl}from"../lib/content/box-shared-columns.js";import Xs from"./PhotoHoverSheet.js";import{PICTURE_FRAME_ONLY as gl,PictureHoverMoveSheet as Tl,PictureHoverZoom as Fl,pictureHoverMoveOf as Hl}from"./PictureHoverMove.js";import{BOX_DESKTOP_LINE as Dl,stackGutterClass as Vl,stackLineCss as Ml,stackOuterClass as Wl,stackRowClass as Gl,storedStackLine as lo}from"../lib/content/box-stack-line.js";import{partAttr as io}from"../../format/lib/content/part-names.js";const co={"--sf-site-gutter":"0px"},Xl={overflowX:"clip",overflowY:"visible"},jl={stretchedRow:!1,fillingColumn:!1,columnsRow:!1},js={desktop:!1,phone:!1},Ks="bg-cover bg-center bg-[image:var(--sf-box-bg)] max-view-wide:bg-[image:var(--sf-box-bg-p)]",ao=u=>u==null||u==="",uo=u=>!ao(u)&&Number(u)===0;function Kl({children:u}){return e(A,{children:u(pt())})}function Ul({direction:u,label:Us,tabShape:zs,gap:mo,gapPhone:Ys,gapTablet:Pe,justify:z,align:E,wrap:ae,share:Js,sharePhone:F,shareTablet:H,wrapPhone:Zs,orderPhone:qs,phoneRow:C,columns:m,columnsTablet:D,separator:f,stackBelow:de,blockSpacing:fo,bgImage:Qs,bgImagePhone:en,rowImage:on,hoverShow:sn,pictureHover:V,darken:Ae,darkenStyle:ue,darkenTablet:nn,darkenPhone:tn,darkenStyleTablet:rn,darkenStylePhone:ln,placement:cn,padV2:ho=!1,border:an,borderTablet:dn,borderPhone:un,borderUnits:Co,pad:r={},contained:Le=!0,fillHeight:_=!1,shadow:$e,shadowTablet:bo,shadowPhone:So,justifyTablet:wo,justifyPhone:mn,alignTablet:fn,alignPhone:hn,wrapTablet:po,blockSpacingTablet:Cn,blockSpacingPhone:bn,loop:b,scrollDirection:ye=$r,loopSeconds:Sn=yr,loopDelay:wn=Lr,editing:k=!1,fillColor:xo,fillColorTablet:pn,fillColorPhone:xn,fillFade:_n,swatch:vn,line:v,upcoming:Rn,link:On,rowLink:_o,highlight:Pn,boxShape:Ne,boxShapePhone:vo,boxShapeTablet:Ro,angle:An,jumpHighlight:Ln,anchor:$n,sharedSides:yn=js,sharedRows:Nn=!1,boxId:M,slotCount:En,mirrorCards:Oo,content:c,rowTitle:Ee,startsOpen:kn,rowStyle:In,sideSpace:Bn}){const n=Xt(),I=Fr({[x]:on},n!==null)[x],Po=Vs({[x]:I}),d=Po?js:yn,gn=Po?!1:Nn,Ao=Hr({[x]:I},n?.row),S=Ao??Qs,ke=Ao===null?en:void 0,Lo=wt(Is),[$o,Tn]=xt(null),Fn=Jt(),yo=Qt()&&!(Fn&&n!==null),R=Zt(),h=rr({inCopy:n!==null,nestedCopy:n?.nested===!0,underBox:yo}),Ie=sn===Pl&&n!==null&&!h&&!(k&&n.previewHover===!0),No=no(an,n,h),Eo=no(dn,n,h),ko=no(un,n,h),Io=n===null&&!yo&&R?.ids&&M?R.ids.indexOf(M):-1,me=Io>=0&&R&&M?Yt(R,M,Io):-1,w=me>=0?R?.hand??null:h&&R?.copies===!0?R.hand:null,o=w?.row?"row":u,a=w?.row?w.row.share:Js,Hn=w?.row?w.row.phoneReverse?[...c.blockIds??[]].reverse():void 0:qs,fe=gn&&!w?.row,W=k?"":_o&&n?Kt(n.row,_o)??"":nl(On),O=_?"":Yr(Ne,vo,Ro),Dn=!_&&zr(Ne)!=="",B=sl(Ln,$n),Be=Dr({swatch:vn},n?.row),Y=Be??Ir(xo),g=Be?{className:"",style:{}}:gr(xo,pn,xn),Vn=al(),Bo=cl(Be,Vn??void 0),Mn=_e(S)||_e(ke),Wn=(Y||g.className)&&!Mn?Br(_n):null,go=Y||g.className?{...Y?{backgroundColor:Y}:{},...g.style,...Wn,...Bo}:void 0,To=yl(),J=v===!0&&o!=="tabs"&&o!=="accordion",t=Vs({bgImage:S,[x]:I}),Fo=Zr(An),Ho=t?void 0:go,he=t?null:Pn??null,Do=_?null:Jr(Ne,vo,Ro),Gn=Fo||he||Do?{...Ho,...Fo,...he,...Do}:Ho,Ce=Gt(),Xn=Ft(),jn=Pt(),Vo=Rt(),Mo=vt(),Kn=Ot(),l=o==="accordion",ge=Nt(In),Z=l&&ge==="numbered",Te=l&&ge==="chevron",Fe=Bt(),Wo=It(),G=Ar(o,f),i=b==="scroll"&&o!=="tabs"&&!l,Un=qt(),be=h||me>=0&&w!==null,Go=w?w.mirror:Oo,zn=me>=0?me:n?.index,q=h&&jt(n?.ownerType),Xo=gs({direction:o,separator:f,loop:b,line:v,bgImage:S,[x]:I,columns:m,columnsTablet:D,share:a,wrap:ae},be,d.desktop)&&or(Go,zn),Yn=gs({direction:o,separator:f,loop:b,line:v,bgImage:S,[x]:I,columns:m,columnsTablet:D,share:a,wrap:ae},be,d.desktop)&&sr(Go)!==null,X=br({direction:o,separator:f,loop:b,line:v,columns:m}),T=Sr({direction:o,separator:f,loop:b,line:v,columnsTablet:D}),Q=wr({direction:o,separator:f,loop:b,line:v,columns:m,columnsTablet:D,share:a,shareTablet:H}),ee=cr(Bn)===ir,He=lr(ee),jo=J&&lo(de)===Dl,j=o==="row"&&!t&&!G&&!i&&(!J||jo)&&T===""&&Q===""?lo(de):void 0,K=j??(o==="column"&&!t?lo(de):void 0),Jn=Tt(),Se=El(d,c.blockCount??0,j),Zn=(Se&&(!n||n.index===0)?kl(d,c.blockCount??0,j):"")+(fe&&(!n||n.index===0)?Bl(fe,c.blockCount??0):""),Ko=Il(fe,c.blockCount??0),Uo=T!==""?Number(D)>=2:Q===""||$(H)!=="",zo=T!==""||Q!=="",De=o==="row"&&!G&&!i&&v!==!0,Ve=De&&!d.phone&&!d.desktop?Et(kt(Hn,c.blockIds??[]),{editing:k}):void 0,Yo=Ve!==void 0&&!k,qn=X!==""?Number(m)>=2:$(a)!=="",Jo=!t&&!l&&!Yn&&!d.desktop&&!d.phone,we=Jo&&!i?fr(z,wo,mn):"",Me=t||be?"":nr(Un,o,i?void 0:z,E,we?wo:void 0),Qn=/view-wide:max-view-desktop:justify-/.test(Me)?we.split(" ").filter(s=>!s.startsWith("view-wide:max-view-desktop:justify-")).join(" "):we,et=Jo&&o==="row"?dr(E,fn,hn):"",Zo=Wo&&o==="column"&&!t&&!i&&!l,We=typeof z=="string"&&z!=="start"||we!=="",qo=Zo&&We&&$(a)!=="",Qo=Zo&&!We&&$(a)!==""&&(c.blockCount??0)===1,ot=!i&&!l&&X===""&&T===""&&!d.desktop?hr(ae,po):"",es=[l||qo?"":$(a),o==="row"?Cr(a):"",X,T,Q,ur(l?"gap":fo),Rr(o,f),l&&!Z&&!Te?"border-t border-line":"",Qn,et,ot,l?"":mr(fo,Cn,bn),l?Fs(m,C,Z||Te):"",Z?Lt:""].filter(Boolean).join(" "),st=es?` ${es}`:"",os=["flex",o==="row"?G||i?"flex-row":`flex-row ${ce(C,F,Zs,po)}`:"flex-col",_r(i||l?!1:ae),t?Tr(cn??"center",o):ar(i||l?void 0:z,l?void 0:E)+(Me?` ${Me}`:"")].join(" ")+st,oe=_||t||O||Fe?` ${Oe}`:"",Ge=Dn?` ${O}`:O?`${oe} ${O}`:oe,ss=Wo&&o==="column"&&!t&&!i&&$(a)===""&&We||qo,ns=oe||(ss||Qo?` ${Oe}`:""),Xe=W?` ${Qr}`:"",je=t||Ce||ho?"":" py-6",nt=j===void 0?"":` ${Gl(j)}`,ts=K===void 0||ee?"":` ${Vl(K)}`,Ke=K===void 0?"":` ${Wl(K)}`,tt=`${to}${je} ${He}${Ge}${Xe}${ts}${Ke}`,rt=Ce?`${Ge}${Xe}${Ke}`.trim():`w-full${je}${Ge}${Xe}${Ke}`,se=(Z||Te)&&Fs(m,C)===""?Ts("Flex",0,"block"):Ts("Flex",mo,o==="row"?"inline":"block",Ys,G||i?void 0:Pe),rs=xr(a,H,o==="row"?c.blockCount??0:0),ls=G?{...se.style,...Pr(o,f)}:se.style,lt=rs?{...ls,...rs}:ls,Ue=(s="")=>e(c,{className:`${os}${Xo?` ${tr}`:""}${se.className}${ns}${nt}${s?` ${s}`:""}${J?` ${$l}`:""}${B?` ${el(B)}`:""}${Se}${Ko}`,style:lt,minEmptyHeight:120,...Ve?{cell:Ve}:null}),is=Nr(ye)?"":Or(o,f),cs=i?e(Er,{direction:ye,seconds:Sn,delay:wn,editing:k,copy:s=>Ue(s&&is?`${s} ${is}`:s)}):Z?L(A,{children:[e("style",{children:$t}),Ue()]}):Ue(),ze=o==="tabs"?e(_t,{className:`${os}${se.className}${Fe&&!_&&!t&&!O?"":oe}`,style:se.style,shape:zs,children:cs}):cs,Ye=l?e(so.Provider,{value:"accordion",children:e(oo.Provider,{value:ge,children:ze})}):Vo?e(so.Provider,{value:!1,children:e(oo.Provider,{value:"plain",children:ze})}):ze,as=o==="row"&&!t&&(E===void 0||E==="stretch"),it={stretchedRow:as,fillingColumn:o==="column"&&(Fe||ss),columnsRow:X!==""||T!==""||Se!==""||Ko!==""||o==="row"&&(Array.isArray(a)||Array.isArray(H))||Yo,...Yo?{phoneCells:!0}:null,...as&&De&&(c.blockCount??0)>=2&&qn||Qo?{picturesFillRow:!0}:null,...zo&&!Uo?{fillFrom:"desktop"}:null,...pr(C,F)&&(!zo||Uo)?{phoneRowFills:!0}:null,...De&&Hs(C,F)?{phoneRowFits:!0}:null,...i?{loops:!0}:null,...M?{id:M}:null},ds=n===null?er({direction:o,loop:b,bgImage:S,[x]:I,columns:m,mirrorCards:Oo},!1):null,us=ds?e(Bs.Provider,{value:{hand:ds,ids:c.blockIds??[],boxes:[]},children:Ye}):R?e(Bs.Provider,{value:null,children:Ye}):Ye,ms=e(Es.Provider,{value:it,children:e(Ns.Provider,{value:!1,children:be?e(zt.Provider,{value:Xo,children:e(Ut.Provider,{value:!h,children:us})}):us})}),ct=Ee?.blockCount??0,fs=Vo==="accordion"&&!!Ee&&(k||ct>0)?e(At,{startsOpen:kn===!0||Kn&&h&&n?.index===0,editing:k,numbered:Mo==="numbered",chevron:Mo==="chevron",title:e(Es.Provider,{value:jl,children:e(Ns.Provider,{value:!1,children:e(so.Provider,{value:!1,children:e(oo.Provider,{value:"plain",children:e(Ee,{className:`min-w-0 flex-1 ${vr}`,minEmptyHeight:24})})})})}),children:ms}):ms,Je=J?e(Al,{row:o==="row",stops:c.blockCount??0,desktopLine:j!==void 0&&jo,children:fs}):fs,at=Us?.trim()||(jn?"":void 0),dt={values:r,frame:je?24:0},ut=s=>To?e(Ll,{on:To,future:Rn===!0,children:s}):s,mt=s=>tl(W)?e(rl,{href:W,newTab:"auto",className:Ws,"aria-labelledby":s,[Ms]:""}):e("a",{href:W,className:Ws,"aria-labelledby":s,[Ms]:""}),hs=(B?ol(B):"")+Zn+(K===void 0||n&&n.index!==0?"":Ml(K,{gutter:!ee})),Cs=hs?e("style",{dangerouslySetInnerHTML:{__html:hs}}):null,ne=Kr({loop:b,direction:o,scrollDirection:ye,bgImage:S,[x]:I}),ft=d.desktop&&Se!==""&&!Y&&!g.className&&!Gs(No,ko,Eo,Co)&&!Xr($e,bo,So)&&!W&&!O&&!_&&!B&&!Ur(Le&&!ne,Jn)&&uo(mo)&&(ao(Pe)||uo(Pe))&&ho&&Object.values(r).every(s=>ao(s)||uo(s)),ht=s=>({...yt,...ft?{[Nl]:""}:null,...t?null:{...Gr($e),...jr($e,bo,So)},...B?{[qr]:B}:null,...s?{id:s}:null}),bs=X!==""?Number(m):0,Ct=ce(C,F)===ce(void 0),bt=(o==="column"||o==="row"&&!G&&!i&&(bs===1&&Ct||bs===0&&c.blockCount===1))&&!t&&!J&&!Ce,Ss=t&&Xn&&!Ce,pe=!t&&n!==null?Ds(Ae,ue):null,ws=Ie||pe?L(A,{children:[Ie?e(Xs,{sheet:ul,name:ml}):null,pe?e("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 -z-10 rounded-[inherit]",style:pe}):null]}):null,ps=[Ie?dl:"",pe?"relative isolate":""].filter(Boolean).join(" "),xs=s=>ws?L(A,{children:[ws,s]}):s,_s=(s,P)=>ut(e(gt,{contained:Le&&!ne,style:ne?co:void 0,framedClass:tt,fillClass:rt,columnClass:`${to} ${He}${ns}${ts}`,tabLabel:at,pad:t?void 0:dt,border:Gs(No,ko,Eo,Co),outerAttrs:ht(P),box:!0,edge:bt,outerStyle:Gn,outerClass:t?ps||void 0:[g.className,he?Rl:"",he&&Bo?Ol:"",ps].filter(Boolean).join(" ")||void 0,bleed:Ss,siteSide:ee,part:io("box"),children:Cs||P?L(A,{children:[Cs,P?mt(P):null,ne?e(ks,{children:s}):s]}):ne?e(ks,{children:s}):s})),Ze=s=>W?e(Kl,{children:P=>_s(xs(s),P)}):_s(xs(s)),vs=s=>Lo.bound?e(Vt,{children:s}):s;if(!t){const s=E===void 0||E==="stretch",P=($(a)!==""||X!==""||T!=="")&&!Hs(C,F)&&!(Q!==""&&$(H)==="")&&(s||ce(C)!==ce(void 0));if(!(o==="row"?P:o==="column"&&s))return Ze(vs(Je));const ys=Mt({direction:o,separator:f,loop:b,line:v,share:a,shareTablet:H,sharePhone:F,phoneRow:C,columns:m,columnsTablet:D,stackBelow:de,shared:d.desktop||d.phone||fe,count:En}),St={hasWidth:!0,...ys?{bound:Wt(ys,Lo.bound)}:null};return Ze(e(Is.Provider,{value:St,children:Je}))}const te=_e(S),re=te?Ds(Ae,ue):null,xe=te?Vr({darken:Ae,darkenStyle:ue,darkenTablet:nn,darkenStyleTablet:rn,darkenPhone:tn,darkenStylePhone:ln}):{className:"",style:{}},qe=_e(ke),Rs=te?qe?{"--sf-box-bg":ro(S??""),"--sf-box-bg-p":ro(ke??"")}:{backgroundImage:ro(S??""),backgroundSize:"cover",backgroundPosition:"center"}:{},Os=hl(void 0,void 0,V),U=Os.className?Os:null,le=te&&n&&V?.kind==="nextImage"&&V.media?_l(n,V.media):null,p=te?Hl(V,ue)??(le?gl:null):null,Ps=V?.media?.cover??"picture",Qe=le?e("div",{className:`absolute inset-0 isolate${q?" rounded-[inherit]":""}`,children:e(bl.Provider,{value:Tn,children:e(Cl,{media:le,name:vl(n?.row),cover:Ps,ground:xl[Ps],arrowsAbove:!0})})}):null,ie=U!==null||!!p?.zoom,As=ie?e("div",{"aria-hidden":!0,className:`absolute inset-0${q?" rounded-[inherit]":""}${qe?` ${Ks}`:""}${U?` ${U.className}`:""}`,style:{...Rs,...U?.style??{}}}):null,eo=ll({...r,top:ve(r.top)??N(y.desktop,r.unit,"desktop"),bottom:ve(r.bottom)??N(y.desktop,r.unit,"desktop"),topPhone:ve(r.topPhone)??N(y.phone,r.unitPhone,"mobile"),bottomPhone:ve(r.bottomPhone)??N(y.phone,r.unitPhone,"mobile"),left:Re(r.left)??N(y.side,r.unit,"desktop"),right:Re(r.right)??N(y.side,r.unit,"desktop"),leftPhone:Re(r.leftPhone)??N(y.sidePhone,r.unitPhone,"mobile"),rightPhone:Re(r.rightPhone)??N(y.sidePhone,r.unitPhone,"mobile"),sideSpace:ee?"site":"box"}),Ls=e("div",{className:`relative z-[1] ${kr} ${eo?.className??""}${_||O?` ${Oe}`:""}`.trimEnd(),style:re?{...eo?.style,...co,...il}:{...eo?.style,...co},...io("card-content"),children:vs(Je)}),$s=Ss&&Le?e("div",{className:`${to} ${He}${_||O?` ${Oe}`:""}`,children:Ls}):Ls;return Ze(e(A,{children:L("div",{className:`relative isolate overflow-hidden ${Wr}${n!==null&&!h?` ${Mr}`:""}${oe}${qe&&!ie?` ${Ks}`:""}${g.className?` ${g.className}`:""}${p?` ${p.className}`:""}`,style:{...q?Xl:{},...go,...ie?{}:Rs,...p?p.style:{}},...U||le?{[fl]:""}:{},...io("card"),children:[e(Tl,{move:p}),ie&&L(A,{children:[e(Xs,{sheet:U?.sheet}),p?.zoom?e("div",{className:`absolute inset-0 overflow-hidden${q?" rounded-[inherit]":""}`,children:L(Fl,{move:p,className:"absolute inset-0",children:[As,Qe]})}):L(A,{children:[As,Qe]})]}),!ie&&Qe,e(Dt,{wash:re&&xe.className?{...re,...xe.style}:re,hover:p?.washHover,...q?{className:"rounded-[inherit]"}:{},...xe.className?{restClassName:xe.className}:{}}),re?e(Ht,{children:$s}):$s,le?e("div",{[wl]:"",className:pl,children:$o?e(Sl,{state:$o}):null}):null]})}))}export{Ul 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};
|