efficient-web-builder 66.0.0 → 67.1.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 +28 -0
- package/dist/editor/components/MediaUploadField.js +1 -1
- package/dist/editor/components/PartSettingsPanel.js +1 -1
- package/dist/editor/components/PartTextBox.js +1 -1
- package/dist/editor/components/PreviewPartAnchors.js +1 -1
- package/dist/editor/components/SectionWidthRows.d.ts +3 -1
- package/dist/editor/components/SectionWidthRows.js +1 -1
- package/dist/editor/components/SiteTextStylesField.js +1 -1
- package/dist/editor/components/storefront-editor.css +47 -0
- package/dist/editor/lib/animation/hover-fields.d.ts +1 -1
- package/dist/editor/lib/animation/hover-fields.js +1 -1
- package/dist/editor/lib/document/block-offer.d.ts +2 -0
- package/dist/editor/lib/document/block-offer.js +1 -1
- package/dist/editor/lib/document/blocks/general/Divider/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/HeroGroup/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/ImageBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/IntroBleed/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/PostCard/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Split/fields.js +1 -1
- package/dist/editor/lib/document/blocks/hero-shared-fields.js +1 -1
- package/dist/editor/lib/document/box-fields.d.ts +1 -1
- package/dist/editor/lib/document/controls.d.ts +24 -14
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/passes/inspector.js +1 -1
- package/dist/editor/lib/document/section-own-width-fields.js +1 -1
- package/dist/format/lib/animation/views.js +1 -1
- package/dist/format/lib/content/borders.d.ts +12 -2
- package/dist/format/lib/content/borders.js +1 -1
- package/dist/format/lib/content/card-corners.d.ts +3 -1
- package/dist/format/lib/content/card-corners.js +1 -1
- package/dist/format/lib/content/css-length.d.ts +6 -0
- package/dist/format/lib/content/css-length.js +1 -1
- package/dist/format/lib/content/image-corners.d.ts +3 -1
- package/dist/format/lib/content/image-corners.js +1 -1
- package/dist/format/lib/content/section-corners.d.ts +3 -1
- package/dist/format/lib/content/section-corners.js +1 -1
- package/dist/format/lib/content/section-min-height.d.ts +11 -1
- package/dist/format/lib/content/section-min-height.js +1 -1
- package/dist/format/lib/content/section-sticky.d.ts +5 -0
- package/dist/format/lib/content/section-sticky.js +1 -1
- package/dist/format/lib/content/section-type-size.d.ts +12 -1
- package/dist/format/lib/content/section-type-size.js +1 -1
- package/dist/format/lib/content/section-width.d.ts +8 -0
- package/dist/format/lib/content/section-width.js +1 -1
- package/dist/format/lib/content/view-tier.d.ts +10 -0
- package/dist/format/lib/content/view-tier.js +1 -0
- package/dist/format/lib/document/blocks/general/Split/meta.d.ts +1 -0
- package/dist/format/lib/document/blocks/general/Split/meta.js +2 -2
- package/dist/format/lib/document/easel-row-words.d.ts +2 -0
- package/dist/format/lib/document/easel-row-words.js +1 -1
- package/dist/format/lib/document/passes/types.d.ts +3 -1
- package/dist/format/lib/document/section-catalog.d.ts +5 -0
- package/dist/format/lib/document/section-catalog.js +10 -2
- package/dist/format/lib/editor-words-catalogue.d.ts +3 -0
- package/dist/format/lib/editor-words-catalogue.js +3 -3
- package/dist/format/lib/fit-words.js +4 -2
- package/dist/format/lib/post-card-layout.d.ts +3 -0
- package/dist/format/lib/post-card-layout.js +1 -1
- package/dist/format/lib/sections/divider-style.d.ts +9 -0
- package/dist/format/lib/sections/divider-style.js +1 -1
- package/dist/format/lib/sections/hero-single-to-hero.js +1 -1
- package/dist/format/lib/sections/section-presets.js +1 -1
- package/dist/format/lib/source-rules/one-length-control.js +3 -3
- package/dist/format/lib/theme.d.ts +1 -1
- package/dist/format/lib/theme.js +4 -4
- package/dist/render/components/Divider.d.ts +3 -1
- package/dist/render/components/Divider.js +1 -1
- package/dist/render/components/Flex.d.ts +3 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/HeroGroup.d.ts +3 -1
- package/dist/render/components/HeroGroup.js +1 -1
- package/dist/render/components/ImageBlock.d.ts +2 -1
- package/dist/render/components/ImageBlock.js +1 -1
- package/dist/render/components/IntroBleed.d.ts +3 -2
- package/dist/render/components/IntroBleed.js +1 -1
- package/dist/render/components/PictureHoverMove.d.ts +18 -0
- package/dist/render/components/PictureHoverMove.js +1 -0
- package/dist/render/components/PictureWash.d.ts +2 -1
- package/dist/render/components/PictureWash.js +1 -1
- package/dist/render/components/ViewHideRoot.d.ts +6 -0
- package/dist/render/components/ViewHideRoot.js +1 -1
- package/dist/render/lib/content/block-size.d.ts +1 -1
- package/dist/render/lib/content/block-size.js +1 -1
- package/dist/render/lib/content/button-look.js +1 -1
- package/dist/render/lib/content/section-padding.js +1 -1
- package/dist/render/lib/document/blocks/general/Divider/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
- package/dist/render/lib/document/blocks/general/HeroGroup/render.js +1 -1
- package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/general/IntroBleed/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Split/render.js +1 -1
- 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-head.js +1 -1
- package/dist/render/lib/document/part-styles.d.ts +13 -0
- package/dist/render/lib/document/part-styles.js +2 -2
- package/dist/render/lib/document/passes/borders.js +1 -1
- package/dist/render/lib/document/passes/corners.js +1 -1
- package/dist/render/lib/document/passes/index.js +1 -1
- package/dist/render/lib/document/passes/section-height.d.ts +5 -1
- package/dist/render/lib/document/passes/section-height.js +1 -1
- package/dist/render/lib/document/passes/section-width.js +1 -1
- package/dist/render/lib/sections/section-to-box.js +1 -1
- package/dist/render/lib/text-styles/site-text-styles.js +2 -2
- package/package.json +7 -6
|
@@ -105,7 +105,7 @@ export declare const CORNER_RADIUS_MIN = 0;
|
|
|
105
105
|
export declare const CORNER_RADIUS_MAX = 40;
|
|
106
106
|
export declare const CORNER_STYLE_TO_PX: Record<CornerStyle, number | null>;
|
|
107
107
|
export declare function normalizeCornerRadius(v?: number | string | null): number | null;
|
|
108
|
-
export declare function cornerRadiusTokens(v?: number | string | null): Record<string, string>;
|
|
108
|
+
export declare function cornerRadiusTokens(v?: number | string | null, unit?: unknown): Record<string, string>;
|
|
109
109
|
export declare function siteButtonRadiusPx(v?: number | string | null): number;
|
|
110
110
|
export declare function siteCornerRadiusTokens(v?: number | string | null): Record<string, string>;
|
|
111
111
|
export declare const CARD_SHADOWS: readonly ["none", "soft", "lifted"];
|
package/dist/format/lib/theme.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import{contrastRatio as q,hexToRgb as d,parseHexColor as s,readableInk as
|
|
1
|
+
import{contrastRatio as q,hexToRgb as d,parseHexColor as s,readableInk as O,relativeLuminance as g}from"efficient-shell/format";import{DEFAULT_SHADOW_COLOR as J,pictureShadowColor as Q}from"efficient-easel/screen/lib/document/shadow-values";import{isLengthUnit as v}from"efficient-easel/screen/lib/content/length-units";import{cssLengthOf as ee}from"./content/css-length.js";const te="storefront-theme",Ke="sf:theme-mode",We="sf:theme-switch",je="hide",Ve="light",Ze=!1,H=7,L=18;function ne(e){return e>=H&&e<L}function qe(e){const{mode:t,override:n,switchShown:r,hour:o}=e;return r&&(n==="light"||n==="dark")?n:t==="auto"?ne(o)?"light":"dark":t==="light"?"light":"dark"}function Je(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(te)});
|
|
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 >= ${H} && h < ${L}) ? '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"},te=[{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"}],ne={selected:0,themes:te};function N(e){return!e||!Array.isArray(e.themes)||e.themes.length===0?{...ne}:{selected:Math.min(Math.max(0,e.selected??0),e.themes.length-1),themes:e.themes}}function _(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 re={light:"#ffffff",dark:"#0a0a0a"},je=["light","dark"];function Ze(e,t){const n=re[t],r=t==="light"?"#ffffff":"#000000";return{text:n,accent:n,background:e,surface:_(e,r,.1),line:_(e,r,.22),muted:_(n,e,.35),brandInk:t}}function f(e){const t=N(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 qe(e){return{fill:u(e).background,accent:e.accent}}const oe=.4,ce="#f5f1e8",L="#0a0a0a";function ie(e){const t=f(e).text,n=g(t);return n===null||n>=oe?t:null}const se=4.5,ae=3,Je={good:"Good","large-only":"Large text only",hard:"Hard to read"};function Qe(e){return e>=se?"good":e>=ae?"large-only":"hard"}const ue=["#000000","#ffffff"];function m(e){return w(e,ue)}function ve(e,t){const n=t!==void 0&&g(t)!==null?t:ce;return w(e,[L,n])===n&&n!==L}const le=[.25,.4,.55];function et(e){const t=d(e);return t===null?[]:le.map(n=>"#"+[t.r,t.g,t.b].map(r=>Math.round(r*(1-n)).toString(16).padStart(2,"0")).join(""))}function tt(e){const n={"--theme-fg":f(e).text},r=ie(e);return r!==null&&(n["--overlay-fg"]=r),n}const fe=82;function E(e){return`color-mix(in srgb, ${e} ${fe}%, #000)`}function nt(e){const t=f(e);return{"--theme-accent":t.accent,"--theme-accent-2":E(t.accent),"--theme-accent-ink":m(t.accent)}}function S(e){const t=e?.button;return t&&s(t)===t.toLowerCase()?t.toLowerCase():null}function rt(e){const t=f(e),n=S(t),r=k(t);if(n===null&&r===null)return{};const o={};return n!==null&&(o["--theme-btn"]=n,o["--theme-btn-2"]=E(n)),o["--theme-btn-ink"]=r??m(n),o}function k(e){const t=e?.buttonInk;return t&&s(t)===t.toLowerCase()?t.toLowerCase():null}function he(e,t){return k(e)??m(S(e)??t)}function ot(e){const t=f(e);return{fill:S(t)??t.accent.toLowerCase(),ink:he(t,t.accent)}}function ct(e){const t={};return N(e).themes.forEach((n,r)=>{const o=u(n);t[`--theme-preset-${r}-accent`]=o.accent,t[`--theme-preset-${r}-accent-2`]=E(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 A=e=>{const t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4},T=e=>255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055);function P([e,t,n]){const[r,o,c]=[A(e),A(t),A(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 de([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[T(4.0767416621*r-3.3077115913*o+.2309699292*c),T(-1.2684380046*r+2.6097574011*o-.3413193965*c),T(-.0041960863*r-.7034186147*o+1.707614701*c)]}const b=e=>{const t=d(e);return t===null?[0,0,0]:[t.r,t.g,t.b]},F=(e,t,n)=>[e[0]*n+t[0]*(1-n),e[1]*n+t[1]*(1-n),e[2]*n+t[2]*(1-n)],$=e=>`#${e.map(t=>Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")).join("")}`,U=e=>F(b(e.surface),b(e.line),.6);function it(e){return $(U(u(e)))}function G(e){const t=u(e);return $(de(F(P(U(t)),P(b(t.text)),.92)))}function st(e){return{...e,background:G(e)}}function Y(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 p=u(a);return s(p.background)!==c?!1:!r||s(p.text??"")===s(i.text??"")&&s(p.accent??"")===s(i.accent??"")})}function at(e,t){return Y(e,t,G,!1)}function ut(e,t){return Y(e,t,n=>s(n.surface??""),!0)}const ge=1;function me(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]??ge}function lt(e){return me(e?.themes,e?.selected)}const ft=["--theme-bg","--theme-surface","--theme-surface-2","--theme-line","--theme-muted"];function ht(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 xe=["heading","body","label"],dt={heading:"Headings",body:"Body",label:"Labels"};function gt(e){if(!e)return null;for(const t of xe)if(e.includes(`--size-${t}`))return t;return/--size-heading(Large|Medium|Small)/.test(e)?"heading":null}const z=["headingLarge","headingMedium","headingSmall","accent","body","label"],mt={headingLarge:"heading",headingMedium:"heading",headingSmall:"heading",accent:"heading",body:"body",label:"label"},xt={headingLarge:null,headingMedium:null,headingSmall:null,accent:null,body:null,label:null},pe=8,_e=200;function Ee(e){if(typeof e!="number"||!Number.isFinite(e))return null;const t=Math.round(e);return t>=pe&&t<=_e?t:null}function Se(e){const t={};for(const n of z)t[n]=Ee(e?.[n]);return t}function pt(e){const t=Se(e),n={};for(const r of z){const o=t[r];o!==null&&(n[`--size-${r}`]=`${o}px`)}return n}const Ae=["square","small","large"],Te="small";function be(e){return Ae.includes(e??"")?e:Te}function _t(e){return X(Ce[be(e)])}const I=0,Ie=40,Ce={square:0,small:null,large:16},B={"--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(Ie,Math.max(I,Math.round(t))):null}function X(e){const t=C(e);return t===null?{}:Object.fromEntries(Object.entries(B).map(([n,r])=>{const o=t*r/16;return[n,o===0?"0":`${o}rem`]}))}function Et(e){return(C(e)??I)*B["--sf-button-radius"]}function St(e){return X(C(e)??I)}const Re=["none","soft","lifted"],De="soft",K="none",Me=["tight","normal","roomy"],ye="normal",we="normal",Oe=["none","lift","highlight"],He="lift",Ne="highlight";import{DEFAULT_SHADOW_COLOR as kt}from"efficient-easel/screen/lib/document/shadow-values";function W(e){return Re.includes(e??"")?e:De}function Le(e){return Me.includes(e??"")?e:ye}function V(e){return Oe.includes(e??"")?e:He}function At(e){const t=W(e);return t===K?void 0:t}function Tt(e){const t=Le(e);return t===we?void 0:t}function bt(e){const t=V(e);return t===Ne?void 0:t}function It(e,t,n){const r=Q(t);return r===J?{}:W(e)!==K||V(n)==="lift"?{"--sf-shadow-color":r}:{}}const ke=["normal","tight","compressed"],j="normal";function Z(e){return ke.includes(e??"")?e:j}function Ct(e){const t=Z(e);return t===j?void 0:t}function Rt(e){switch(Z(e)){case"tight":return{lineHeight:.95,letterSpacing:-.01};case"compressed":return{lineHeight:.86,letterSpacing:-.01};default:return{}}}const Dt=["authored","sentence"],Mt={case:"authored",weight:null,weightStrong:null,italicStrong:null,maxPx:null,weight2:null,weight3:null,case2:"authored",case3:"authored"},R=100,D=900,Pe=24,Fe=200;function x(e,t,n){return typeof e!="number"||!Number.isFinite(e)?null:Math.round(Math.min(Math.max(e,t),n))}function M(e){const t=x(e?.weight,R,D),n=e?.case==="sentence"?"sentence":"authored",r=c=>c==null?t:x(c,R,D),o=c=>c==="sentence"?"sentence":c==="authored"?"authored":n;return{case:n,weight:t,weightStrong:x(e?.weightStrong,R,D),italicStrong:typeof e?.italicStrong=="boolean"?e.italicStrong:null,maxPx:x(e?.maxPx,Pe,Fe),weight2:r(e?.weight2),weight3:r(e?.weight3),case2:o(e?.case2),case3:o(e?.case3)}}function yt(e){const t=M(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 wt(e){return M({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 Ot(e){const t=M(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 y="siteTheme";function $e(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{[y]:{selected:n,themes:t.themes}}}function Ht(e){return $e(e?.[y])[y]}export{le as ACCENT_DARKEN_STEPS,je as BRAND_INKS,Me as CARD_GAPS,Re as CARD_SHADOWS,Ie as CORNER_RADIUS_MAX,I as CORNER_RADIUS_MIN,Ae as CORNER_STYLES,Ce as CORNER_STYLE_TO_PX,ye as DEFAULT_CARD_GAP,De as DEFAULT_CARD_SHADOW,Te as DEFAULT_CORNER_STYLE,j as DEFAULT_HEADING_COMPRESSION,Mt as DEFAULT_HEADING_TYPOGRAPHY,He as DEFAULT_HOVER_EFFECT,kt as DEFAULT_SHADOW_COLOR,xt as DEFAULT_SIZES,l as DEFAULT_SURFACES,Ke as DEFAULT_SWITCH_SHOWN,te as DEFAULT_THEMES,Xe as DEFAULT_THEME_MODE,ne as DEFAULT_THEME_VALUE,Je as GRADE_LABEL,Dt as HEADING_CASES,ke as HEADING_COMPRESSIONS,Fe as HEADING_MAX_PX_MAX,Pe as HEADING_MAX_PX_MIN,D as HEADING_WEIGHT_MAX,R as HEADING_WEIGHT_MIN,Oe as HOVER_EFFECTS,we as IDENTITY_CARD_GAP,K as IDENTITY_CARD_SHADOW,Ne as IDENTITY_HOVER_EFFECT,L as OVERLAY_INK_DARK,ce as OVERLAY_INK_LIGHT,se as READABILITY_AA,ae as READABILITY_AA_LARGE,mt as SCALE_OF_STEP,y as SITE_THEME_KEY,z as SIZE_STEPS,_e as TEXT_SIZE_MAX,pe as TEXT_SIZE_MIN,H as THEME_DAY_END_HOUR,O as THEME_DAY_START_HOUR,Ye as THEME_MODE_KEY,v as THEME_STORAGE_KEY,ft as THEME_SURFACE_KEYS,Be as THEME_SWITCH_HIDE,ze as THEME_SWITCH_KEY,xe as TYPE_GROUPS,dt as TYPE_GROUP_LABELS,m as accentInk,st as bandPresetFor,at as bandPresetIndex,Ze as brandTheme,Ve as buildThemeBootScript,Tt as cardGapAttr,At as cardShadowAttr,Rt as compressionMetrics,q as contrastRatio,X as cornerRadiusTokens,_t as cornerStyleTokens,lt as darkBandIndex,me as darkPresetIndex,et as darkerAccents,ve as fillIsDark,Qe as gradeContrast,Ct as headingCompressionAttr,wt as headingTypographyFromRow,yt as headingTypographyStyle,Ot as headingTypographyToRow,bt as hoverEffectAttr,ee as isDayHour,Le as normalizeCardGap,W as normalizeCardShadow,C as normalizeCornerRadius,be as normalizeCornerStyle,Z as normalizeHeadingCompression,M as normalizeHeadingTypography,V as normalizeHoverEffect,Ee as normalizeSize,Se as normalizeSizes,N as normalizeTheme,u as normalizeThemeColors,We as resolveTheme,he as resolvedButtonInk,G as sectionBandTone,f as selectedThemeColors,It as shadowColorTokens,ot as siteButtonPaint,Et as siteButtonRadiusPx,St as siteCornerRadiusTokens,$e as siteThemeMetadata,Ht as siteThemeOf,ut as surfacePresetIndex,it as surfaceTwoTone,nt as themeAccentStyle,S as themeButtonColour,k as themeButtonInk,rt as themeButtonStyle,tt as themeColorStyle,ie as themeLightInk,ct as themePresetAccentVars,ht as themeSurfaceStyle,qe as themeSwatchColors,gt as typeScaleGroupOfClassName,pt as typeSizesStyle};
|
|
18
|
+
`}const l={background:"#0a0a0a",surface:"#131313",line:"#2a2a2a",muted:"#9a9388"},re=[{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"}],oe={selected:0,themes:re};function N(e){return!e||!Array.isArray(e.themes)||e.themes.length===0?{...oe}:{selected:Math.min(Math.max(0,e.selected??0),e.themes.length-1),themes:e.themes}}function _(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 ce={light:"#ffffff",dark:"#0a0a0a"},Qe=["light","dark"];function ve(e,t){const n=ce[t],r=t==="light"?"#ffffff":"#000000";return{text:n,accent:n,background:e,surface:_(e,r,.1),line:_(e,r,.22),muted:_(n,e,.35),brandInk:t}}function f(e){const t=N(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 et(e){return{fill:u(e).background,accent:e.accent}}const ie=.4,se="#f5f1e8",k="#0a0a0a";function ae(e){const t=f(e).text,n=g(t);return n===null||n>=ie?t:null}const ue=4.5,le=3,tt={good:"Good","large-only":"Large text only",hard:"Hard to read"};function nt(e){return e>=ue?"good":e>=le?"large-only":"hard"}const fe=["#000000","#ffffff"];function m(e){return O(e,fe)}function rt(e,t){const n=t!==void 0&&g(t)!==null?t:se;return O(e,[k,n])===n&&n!==k}const he=[.25,.4,.55];function ot(e){const t=d(e);return t===null?[]:he.map(n=>"#"+[t.r,t.g,t.b].map(r=>Math.round(r*(1-n)).toString(16).padStart(2,"0")).join(""))}function ct(e){const n={"--theme-fg":f(e).text},r=ae(e);return r!==null&&(n["--overlay-fg"]=r),n}const de=82;function E(e){return`color-mix(in srgb, ${e} ${de}%, #000)`}function it(e){const t=f(e);return{"--theme-accent":t.accent,"--theme-accent-2":E(t.accent),"--theme-accent-ink":m(t.accent)}}function S(e){const t=e?.button;return t&&s(t)===t.toLowerCase()?t.toLowerCase():null}function st(e){const t=f(e),n=S(t),r=P(t);if(n===null&&r===null)return{};const o={};return n!==null&&(o["--theme-btn"]=n,o["--theme-btn-2"]=E(n)),o["--theme-btn-ink"]=r??m(n),o}function P(e){const t=e?.buttonInk;return t&&s(t)===t.toLowerCase()?t.toLowerCase():null}function ge(e,t){return P(e)??m(S(e)??t)}function at(e){const t=f(e);return{fill:S(t)??t.accent.toLowerCase(),ink:ge(t,t.accent)}}function ut(e){const t={};return N(e).themes.forEach((n,r)=>{const o=u(n);t[`--theme-preset-${r}-accent`]=o.accent,t[`--theme-preset-${r}-accent-2`]=E(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 A=e=>{const t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4},T=e=>255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055);function F([e,t,n]){const[r,o,c]=[A(e),A(t),A(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 me([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[T(4.0767416621*r-3.3077115913*o+.2309699292*c),T(-1.2684380046*r+2.6097574011*o-.3413193965*c),T(-.0041960863*r-.7034186147*o+1.707614701*c)]}const b=e=>{const t=d(e);return t===null?[0,0,0]:[t.r,t.g,t.b]},$=(e,t,n)=>[e[0]*n+t[0]*(1-n),e[1]*n+t[1]*(1-n),e[2]*n+t[2]*(1-n)],U=e=>`#${e.map(t=>Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")).join("")}`,G=e=>$(b(e.surface),b(e.line),.6);function lt(e){return U(G(u(e)))}function Y(e){const t=u(e);return U(me($(F(G(t)),F(b(t.text)),.92)))}function ft(e){return{...e,background:Y(e)}}function z(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 p=u(a);return s(p.background)!==c?!1:!r||s(p.text??"")===s(i.text??"")&&s(p.accent??"")===s(i.accent??"")})}function ht(e,t){return z(e,t,Y,!1)}function dt(e,t){return z(e,t,n=>s(n.surface??""),!0)}const xe=1;function pe(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]??xe}function gt(e){return pe(e?.themes,e?.selected)}const mt=["--theme-bg","--theme-surface","--theme-surface-2","--theme-line","--theme-muted"];function xt(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 _e=["heading","body","label"],pt={heading:"Headings",body:"Body",label:"Labels"};function _t(e){if(!e)return null;for(const t of _e)if(e.includes(`--size-${t}`))return t;return/--size-heading(Large|Medium|Small)/.test(e)?"heading":null}const B=["headingLarge","headingMedium","headingSmall","accent","body","label"],Et={headingLarge:"heading",headingMedium:"heading",headingSmall:"heading",accent:"heading",body:"body",label:"label"},St={headingLarge:null,headingMedium:null,headingSmall:null,accent:null,body:null,label:null},Ee=8,Se=200;function Ae(e){if(typeof e!="number"||!Number.isFinite(e))return null;const t=Math.round(e);return t>=Ee&&t<=Se?t:null}function Te(e){const t={};for(const n of B)t[n]=Ae(e?.[n]);return t}function At(e){const t=Te(e),n={};for(const r of B){const o=t[r];o!==null&&(n[`--size-${r}`]=`${o}px`)}return n}const be=["square","small","large"],Ie="small";function Ce(e){return be.includes(e??"")?e:Ie}function Tt(e){return X(Me[Ce(e)])}const I=0,Re=40,Me={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 R(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(Re,Math.max(I,Math.round(t))):null}function X(e,t){if(v(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":ee(i,t)]}))}const n=R(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 bt(e){return(R(e)??I)*C["--sf-button-radius"]}function It(e){return X(R(e)??I)}const De=["none","soft","lifted"],ye="soft",K="none",we=["tight","normal","roomy"],Oe="normal",He="normal",Le=["none","lift","highlight"],Ne="lift",ke="highlight";import{DEFAULT_SHADOW_COLOR as Ut}from"efficient-easel/screen/lib/document/shadow-values";function W(e){return De.includes(e??"")?e:ye}function Pe(e){return we.includes(e??"")?e:Oe}function j(e){return Le.includes(e??"")?e:Ne}function Ct(e){const t=W(e);return t===K?void 0:t}function Rt(e){const t=Pe(e);return t===He?void 0:t}function Mt(e){const t=j(e);return t===ke?void 0:t}function Dt(e,t,n){const r=Q(t);return r===J?{}:W(e)!==K||j(n)==="lift"?{"--sf-shadow-color":r}:{}}const Fe=["normal","tight","compressed"],V="normal";function Z(e){return Fe.includes(e??"")?e:V}function yt(e){const t=Z(e);return t===V?void 0:t}function wt(e){switch(Z(e)){case"tight":return{lineHeight:.95,letterSpacing:-.01};case"compressed":return{lineHeight:.86,letterSpacing:-.01};default:return{}}}const Ot=["authored","sentence"],Ht={case:"authored",weight:null,weightStrong:null,italicStrong:null,maxPx:null,weight2:null,weight3:null,case2:"authored",case3:"authored"},M=100,D=900,$e=24,Ue=200;function x(e,t,n){return typeof e!="number"||!Number.isFinite(e)?null:Math.round(Math.min(Math.max(e,t),n))}function y(e){const t=x(e?.weight,M,D),n=e?.case==="sentence"?"sentence":"authored",r=c=>c==null?t:x(c,M,D),o=c=>c==="sentence"?"sentence":c==="authored"?"authored":n;return{case:n,weight:t,weightStrong:x(e?.weightStrong,M,D),italicStrong:typeof e?.italicStrong=="boolean"?e.italicStrong:null,maxPx:x(e?.maxPx,$e,Ue),weight2:r(e?.weight2),weight3:r(e?.weight3),case2:o(e?.case2),case3:o(e?.case3)}}function Lt(e){const t=y(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 Nt(e){return y({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 kt(e){const t=y(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 Ge(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 Pt(e){return Ge(e?.[w])[w]}export{he as ACCENT_DARKEN_STEPS,Qe as BRAND_INKS,we as CARD_GAPS,De as CARD_SHADOWS,Re as CORNER_RADIUS_MAX,I as CORNER_RADIUS_MIN,be as CORNER_STYLES,Me as CORNER_STYLE_TO_PX,Oe as DEFAULT_CARD_GAP,ye as DEFAULT_CARD_SHADOW,Ie as DEFAULT_CORNER_STYLE,V as DEFAULT_HEADING_COMPRESSION,Ht as DEFAULT_HEADING_TYPOGRAPHY,Ne as DEFAULT_HOVER_EFFECT,Ut as DEFAULT_SHADOW_COLOR,St as DEFAULT_SIZES,l as DEFAULT_SURFACES,Ze as DEFAULT_SWITCH_SHOWN,re as DEFAULT_THEMES,Ve as DEFAULT_THEME_MODE,oe as DEFAULT_THEME_VALUE,tt as GRADE_LABEL,Ot as HEADING_CASES,Fe as HEADING_COMPRESSIONS,Ue as HEADING_MAX_PX_MAX,$e as HEADING_MAX_PX_MIN,D as HEADING_WEIGHT_MAX,M as HEADING_WEIGHT_MIN,Le as HOVER_EFFECTS,He as IDENTITY_CARD_GAP,K as IDENTITY_CARD_SHADOW,ke as IDENTITY_HOVER_EFFECT,k as OVERLAY_INK_DARK,se as OVERLAY_INK_LIGHT,ue as READABILITY_AA,le as READABILITY_AA_LARGE,Et as SCALE_OF_STEP,w as SITE_THEME_KEY,B as SIZE_STEPS,Se as TEXT_SIZE_MAX,Ee as TEXT_SIZE_MIN,L as THEME_DAY_END_HOUR,H as THEME_DAY_START_HOUR,Ke as THEME_MODE_KEY,te as THEME_STORAGE_KEY,mt as THEME_SURFACE_KEYS,je as THEME_SWITCH_HIDE,We as THEME_SWITCH_KEY,_e as TYPE_GROUPS,pt as TYPE_GROUP_LABELS,m as accentInk,ft as bandPresetFor,ht as bandPresetIndex,ve as brandTheme,Je as buildThemeBootScript,Rt as cardGapAttr,Ct as cardShadowAttr,wt as compressionMetrics,q as contrastRatio,X as cornerRadiusTokens,Tt as cornerStyleTokens,gt as darkBandIndex,pe as darkPresetIndex,ot as darkerAccents,rt as fillIsDark,nt as gradeContrast,yt as headingCompressionAttr,Nt as headingTypographyFromRow,Lt as headingTypographyStyle,kt as headingTypographyToRow,Mt as hoverEffectAttr,ne as isDayHour,Pe as normalizeCardGap,W as normalizeCardShadow,R as normalizeCornerRadius,Ce as normalizeCornerStyle,Z as normalizeHeadingCompression,y as normalizeHeadingTypography,j as normalizeHoverEffect,Ae as normalizeSize,Te as normalizeSizes,N as normalizeTheme,u as normalizeThemeColors,qe as resolveTheme,ge as resolvedButtonInk,Y as sectionBandTone,f as selectedThemeColors,Dt as shadowColorTokens,at as siteButtonPaint,bt as siteButtonRadiusPx,It as siteCornerRadiusTokens,Ge as siteThemeMetadata,Pt as siteThemeOf,dt as surfacePresetIndex,lt as surfaceTwoTone,it as themeAccentStyle,S as themeButtonColour,P as themeButtonInk,st as themeButtonStyle,ct as themeColorStyle,ae as themeLightInk,ut as themePresetAccentVars,xt as themeSurfaceStyle,et as themeSwatchColors,_t as typeScaleGroupOfClassName,At as typeSizesStyle};
|
|
@@ -5,8 +5,10 @@ interface DividerProps {
|
|
|
5
5
|
contained: boolean;
|
|
6
6
|
style?: DividerStyle;
|
|
7
7
|
thickness?: number;
|
|
8
|
+
thicknessUnit?: unknown;
|
|
8
9
|
lengthPct?: number;
|
|
10
|
+
lengthPctUnit?: unknown;
|
|
9
11
|
pad?: PadValues;
|
|
10
12
|
}
|
|
11
|
-
export default function Divider({ spacing, contained, style, thickness, lengthPct, pad, }: DividerProps): import("react").JSX.Element;
|
|
13
|
+
export default function Divider({ spacing, contained, style, thickness, thicknessUnit, lengthPct, lengthPctUnit, pad, }: DividerProps): import("react").JSX.Element;
|
|
12
14
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as u}from"react/jsx-runtime";import _ from"./BlockFrame.js";import{padDefaultIn as T,padSideValue as D,sectionPadAttrs as E}from"../lib/content/section-padding.js";import{finiteNumber as d}from"../../format/lib/finite-number.js";import{cssLengthOf as p,ownRowUnit as h}from"../../format/lib/content/css-length.js";import{DEFAULT_DIVIDER_STYLE as N,DIVIDER_LENGTH_ROW as P,DIVIDER_THICKNESS_ROW as g,DIVIDER_SPACE_PX as R,STRIPE_BAND_HEIGHT_PX as S,parseDividerSpacing as k,parseDividerStyle as x,stripeBackground as L}from"../../format/lib/sections/divider-style.js";const w=1,A=100;function B(o,t,r,n,s){const i={},e=h({thicknessUnit:t},g,"desktop");!s&&typeof o=="number"&&(e!=="px"||o!==w)&&(i.borderTopWidth=e==="px"?o:p(o,e));const m=h({lengthPctUnit:n},P,"desktop");return typeof r=="number"&&(m!=="%"||r<A)&&(i.width=p(r,m)),Object.keys(i).length?i:void 0}const H={sm:"my-6",md:"my-12",lg:"my-20"},I=(...o)=>o.some(t=>d(t)!==void 0);function V(o,t,r){const n=r||I(t.top,t.topTablet,t.topPhone),s=r||I(t.bottom,t.bottomTablet,t.bottomPhone),i=[t.left,t.right,t.leftTablet,t.rightTablet,t.leftPhone,t.rightPhone].some(c=>D(c)!==void 0);if(!n&&!s&&!i)return null;const e=R[o],m=E({...t,top:n?d(t.top)??T(e,t.unit,"desktop"):void 0,bottom:s?d(t.bottom)??T(e,t.unit,"desktop"):void 0,topTablet:n?t.topTablet:void 0,bottomTablet:s?t.bottomTablet:void 0,topPhone:n?t.topPhone:void 0,bottomPhone:s?t.bottomPhone:void 0}),l={...m?.style};return n||(l.marginTop=e),s||(l.marginBottom=e),{className:m?.className??"",style:l}}function C({spacing:o,contained:t,style:r=N,thickness:n,thicknessUnit:s,lengthPct:i,lengthPctUnit:e,pad:m={}}){const l=x(r),c=k(o),f=L(l),a=B(n,s,i,e,!!f),b=V(c,m,l==="none"),y=b?b.className:H[c];return u(_,{contained:t,className:y,style:b?.style,children:l==="none"?null:f?u("hr",{className:"border-x-0 border-y border-line",style:{height:S,backgroundImage:f,...a}}):u("hr",{className:"border-0 border-t border-line",style:a})})}export{C as default};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { SlotComponent } from "efficient-easel/blocks";
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
3
|
import { type Loop, type LoopDirection } from "../../format/lib/animation/index.js";
|
|
4
|
+
import { type BorderUnits } from "../../format/lib/content/borders.js";
|
|
4
5
|
import { type PadValues } from "../lib/content/section-padding.js";
|
|
5
6
|
import { type PictureHoverDrawn } from "../../format/lib/animation/hover.js";
|
|
6
7
|
type Direction = "row" | "column" | "tabs" | "accordion";
|
|
@@ -11,6 +12,7 @@ interface FlexProps {
|
|
|
11
12
|
border?: unknown;
|
|
12
13
|
borderTablet?: unknown;
|
|
13
14
|
borderPhone?: unknown;
|
|
15
|
+
borderUnits?: BorderUnits;
|
|
14
16
|
direction: Direction;
|
|
15
17
|
label?: string;
|
|
16
18
|
tabShape?: unknown;
|
|
@@ -89,5 +91,5 @@ interface FlexProps {
|
|
|
89
91
|
rowStyle?: unknown;
|
|
90
92
|
sideSpace?: unknown;
|
|
91
93
|
}
|
|
92
|
-
export default function Flex({ direction: storedDirection, label, tabShape, gap, gapPhone, gapTablet, justify, align, wrap, share: storedShare, sharePhone, shareTablet, wrapPhone, orderPhone: storedOrderPhone, phoneRow, columns, columnsTablet, separator, stackBelow, blockSpacing, bgImage: storedBgImage, bgImagePhone: storedBgImagePhone, rowImage: storedRowImage, pictureHover, darken, darkenStyle, darkenTablet, darkenPhone, darkenStyleTablet, darkenStylePhone, placement, padV2, border: storedBorder, borderTablet: storedBorderTablet, borderPhone: storedBorderPhone, pad, contained, fillHeight, shadow, shadowTablet, shadowPhone, justifyTablet, justifyPhone, alignTablet, alignPhone, wrapTablet, blockSpacingTablet, blockSpacingPhone, loop, scrollDirection, loopSeconds, loopDelay, editing, fillColor, fillColorTablet, fillColorPhone, swatch, line, upcoming, link, rowLink, highlight, boxShape, boxShapePhone, boxShapeTablet, angle, jumpHighlight, anchor, sharedSides: storedSharedSides, sharedRows: storedSharedRows, boxId, slotCount, mirrorCards, content: Content, rowTitle: RowTitle, startsOpen, rowStyle, sideSpace, }: FlexProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
|
|
94
|
+
export default function Flex({ direction: storedDirection, label, tabShape, gap, gapPhone, gapTablet, justify, align, wrap, share: storedShare, sharePhone, shareTablet, wrapPhone, orderPhone: storedOrderPhone, phoneRow, columns, columnsTablet, separator, stackBelow, blockSpacing, bgImage: storedBgImage, bgImagePhone: storedBgImagePhone, rowImage: storedRowImage, pictureHover, darken, darkenStyle, darkenTablet, darkenPhone, darkenStyleTablet, darkenStylePhone, placement, padV2, border: storedBorder, borderTablet: storedBorderTablet, borderPhone: storedBorderPhone, borderUnits, pad, contained, fillHeight, shadow, shadowTablet, shadowPhone, justifyTablet, justifyPhone, alignTablet, alignPhone, wrapTablet, blockSpacingTablet, blockSpacingPhone, loop, scrollDirection, loopSeconds, loopDelay, editing, fillColor, fillColorTablet, fillColorPhone, swatch, line, upcoming, link, rowLink, highlight, boxShape, boxShapePhone, boxShapeTablet, angle, jumpHighlight, anchor, sharedSides: storedSharedSides, sharedRows: storedSharedRows, boxId, slotCount, mirrorCards, content: Content, rowTitle: RowTitle, startsOpen, rowStyle, sideSpace, }: FlexProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
|
|
93
95
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as Z,jsx as e,jsxs as ue}from"react/jsx-runtime";import{useContext as jn,useId as Kn}from"react";import Un from"./BoxTabs.js";import{AccordionRowStyleContext as He,BoxTabPaneContext as Ve,useAccordionRowStyle as Jn,useBoxPaneKind as zn,useFirstCopyOpens as Yn,useIsTabPane as qn}from"./BoxTabPaneContext.js";import Qn,{ACCORDION_COUNTER_RESET as Zn}from"./BoxAccordionRow.js";import{ACCORDION_MARK_SHEET as et}from"./AccordionMark.js";import{accordionRowStyleOf as ot}from"../../format/lib/content/accordion-row-style.js";import{boxPhoneCell as st,boxPhoneOrder as nt}from"../../format/lib/content/box-phone-place.js";import{CellFillContext as rs,InBoxContext as ls,useCellOfStretchedRow as tt,useFillsCell as rt}from"./InBoxContext.js";import lt,{InsideSiteColumn as is,useInsideSiteGutter as it,useSectionRoot as ct}from"./SiteGutterFrame.js";import{BoxSurfaceProvider as at}from"./BoxSurfaceContext.js";import dt from"./PictureWash.js";import{BoxCellContext as cs,NoCellBound as ut}from"./BoxCellContext.js";import{boxCellFractions as mt}from"../lib/content/box-cell-bound.js";import{boundOf as ft}from"../../format/lib/content/cell-picture-sizes.js";import{useInSiteHeader as Ct}from"./PhoneMenuTools.js";import{useCardRow as bt}from"./CardRowContext.js";import{cardLineBetween as Ge,framesItsCards as ht}from"../../format/lib/content/card-place.js";import{rowLinkText as St}from"../../format/lib/content/card-template.js";import{HandedMirrorContext as wt,MirrorContext as pt,RowHandContext as as,boxPlace as xt,useHandedMirrorAbove as Pt,useHandedRows as _t,useMirroredCopy as $t,useUnderCardBox as Rt}from"./MirrorContext.js";import{boxChildrenHand as Ot,isMirroredCopy as yt,mirrorCardsActs as ds,mirrorCardsOf as At,mirroredBoxClass as Lt,MIRROR_ROW_CLASS as vt,ownsCard as kt}from"../../format/lib/content/mirror-cards.js";import{FRAME_BASE as Me,frameGutterOf as Nt}from"./BlockFrame.js";import{BOX_SIDE_SPACE_SITE as It,boxSideSpaceOf as gt}from"../../format/lib/content/box-side-space.js";import{containerGapProps as us}from"../../format/lib/content/container-gap.js";import{boxLayoutClasses as Bt,boxAlignViewClasses as Et,boxBlockSpacingClass as Tt,boxBlockSpacingViewClasses as Ft,boxJustifyViewClasses as Dt,boxWrapTabletClass as Ht,boxFitContentClass as Vt,boxAccordionColumnsClass as ms,boxRowColumnsClass as Gt,boxRowTabletColumnsClass as Mt,boxRowTabletShareClass as Wt,boxPhoneCellsShareLine as Xt,boxPhoneRowClasses as ee,boxPhoneRowFits as jt,boxShareClasses as M,boxShareVars as Kt,boxWrapClass as Ut,BOX_GAP_ONLY_CLASS as Jt}from"../../format/lib/content/box-layout.js";import{boxSeparatorClasses as zt,boxSeparatorSeamClass as Yt,boxSeparatorStyle as qt,isStripBox as Qt}from"../../format/lib/content/box-separator.js";import{DEFAULT_LOOP_DELAY as Zt,DEFAULT_LOOP_DIRECTION as er,DEFAULT_LOOP_SECONDS as or,isVerticalLoop as sr}from"../../format/lib/animation/index.js";import{LoopTrack as nr}from"../lib/animation/LoopTrack.js";import{BOX_CARD_PAD as R,BOX_OWNS_SIDES_CLASS as tr,boxDarkenStyle as rr,boxPaintOf as lr,boxFillViews as ir,boxPlacementClasses as cr,boxCardProps as ar,boxIsCard as fs,boxRowPicture as dr,boxSwatchFill as ur,boxWashViews as mr,CARD_SHADOW_CLASS as fr,isBackgroundBox as Cs}from"../../format/lib/content/box-background.js";import{BOX_ROW_IMAGE_PROP as h}from"../../format/lib/content/box-card-rule.js";import{boxShadowAttrs as Cr,boxShadowOnAnyView as br,boxShadowViewAttrs as hr}from"../../format/lib/content/box-shadow.js";import{boxRunsEdgeToEdge as Sr,drawsSiteGutter as wr}from"../../format/lib/content/site-gutter.js";import{boxShapeClass as pr,boxShapeClasses as xr}from"../../format/lib/content/box-shape.js";import{boxAngleStyle as Pr}from"../../format/lib/content/box-angle.js";import{BOX_JUMP_ATTR as _r,BOX_LINK_ATTR as bs,BOX_LINK_CLASS as hs,BOX_LINKED_CLASS as $r,boxJumpBlocksClass as Rr,boxJumpCss as Or,boxJumpSlug as yr,boxLinkOf as Ar,siteLinkDraws as Lr}from"../../format/lib/content/box-link.js";import{SiteLink as vr}from"../lib/site-runtime.js";import{sectionBorderStyle as Ss}from"../../format/lib/content/borders.js";import{finiteNumber as me}from"../../format/lib/finite-number.js";import{padDefaultIn as O,padSideValue as fe,sectionPadAttrs as kr}from"../lib/content/section-padding.js";import{SECTION_FILL_CLASS as Ce}from"../../format/lib/content/section-min-height.js";import{ON_MEDIA_INK_STYLE as Nr,rowFillInkStyle as Ir}from"../../format/lib/content/ink.js";import{useThemeLightInk as gr}from"./ThemeLightInkContext.js";import{sizedBackground as We}from"../../format/lib/sized-image.js";import{PHOTO_HOST_ATTR as Br,resolveImageTreatment as Er}from"../../format/lib/content/image-treatment.js";import{BOX_HIGHLIGHT_CLASS as Tr,BOX_HIGHLIGHT_OVER_ROW_INK_CLASS as Fr}from"../../format/lib/animation/hover.js";import{BoxRail as Dr,BoxRailStop as Hr,RAIL_STOPS_CLASS as Vr,useTimelineRail as Gr}from"./TimelineRail.js";import{SHARED_PLAIN_ATTR as Mr,sharedColumnsClasses as Wr,sharedColumnsCss as Xr,sharedRowsClasses as jr,sharedRowsCss as Kr}from"../lib/content/box-shared-columns.js";import Ur from"./PhotoHoverSheet.js";import{BOX_DESKTOP_LINE as Jr,stackGutterClass as zr,stackLineCss as Yr,stackOuterClass as qr,stackRowClass as Qr,storedStackLine as Xe}from"../lib/content/box-stack-line.js";const je={"--sf-site-gutter":"0px"},Zr={overflowX:"clip",overflowY:"visible"},el={stretchedRow:!1,fillingColumn:!1,columnsRow:!1},ws={desktop:!1,phone:!1},ps="bg-cover bg-center bg-[image:var(--sf-box-bg)] max-view-wide:bg-[image:var(--sf-box-bg-p)]",Ke=u=>u==null||u==="",Ue=u=>!Ke(u)&&Number(u)===0;function ol({children:u}){return e(Z,{children:u(Kn())})}function sl({direction:u,label:xs,tabShape:Ps,gap:Je,gapPhone:_s,gapTablet:be,justify:W,align:y,wrap:oe,share:$s,sharePhone:X,shareTablet:I,wrapPhone:Rs,orderPhone:Os,phoneRow:S,columns:m,columnsTablet:g,separator:f,stackBelow:se,blockSpacing:ze,bgImage:ys,bgImagePhone:As,rowImage:Ls,pictureHover:vs,darken:Ye,darkenStyle:qe,darkenTablet:ks,darkenPhone:Ns,darkenStyleTablet:Is,darkenStylePhone:gs,placement:Bs,padV2:Qe=!1,border:Es,borderTablet:Ts,borderPhone:Fs,pad:t={},contained:he=!0,fillHeight:A=!1,shadow:Se,shadowTablet:Ze,shadowPhone:eo,justifyTablet:oo,justifyPhone:Ds,alignTablet:Hs,alignPhone:Vs,wrapTablet:so,blockSpacingTablet:Gs,blockSpacingPhone:Ms,loop:C,scrollDirection:we=er,loopSeconds:Ws=or,loopDelay:Xs=Zt,editing:B=!1,fillColor:no,fillColorTablet:js,fillColorPhone:Ks,swatch:Us,line:w,upcoming:Js,link:zs,rowLink:to,highlight:Ys,boxShape:ro,boxShapePhone:qs,boxShapeTablet:Qs,angle:Zs,jumpHighlight:en,anchor:on,sharedSides:sn=ws,sharedRows:nn=!1,boxId:E,slotCount:tn,mirrorCards:lo,content:i,rowTitle:pe,startsOpen:rn,rowStyle:ln,sideSpace:cn}){const n=bt(),L=ar({[h]:Ls},n!==null)[h],io=fs({[h]:L}),c=io?ws:sn,an=io?!1:nn,co=dr({[h]:L},n?.row),p=co??ys,ao=co===null?As:void 0,uo=jn(cs),dn=Pt(),mo=Rt()&&!(dn&&n!==null),x=_t(),P=kt({inCopy:n!==null,nestedCopy:n?.nested===!0,underBox:mo}),fo=Ge(Es,n,P),Co=Ge(Ts,n,P),bo=Ge(Fs,n,P),ho=n===null&&!mo&&x?.ids&&E?x.ids.indexOf(E):-1,ne=ho>=0&&x&&E?xt(x,E,ho):-1,b=ne>=0?x?.hand??null:P&&x?.copies===!0?x.hand:null,o=b?.row?"row":u,d=b?.row?b.row.share:$s,un=b?.row?b.row.phoneReverse?[...i.blockIds??[]].reverse():void 0:Os,te=an&&!b?.row,T=B?"":to&&n?St(n.row,to)??"":Ar(zs),_=A?"":xr(ro,qs,Qs),mn=!A&&pr(ro)!=="",v=yr(en,on),xe=ur({swatch:Us},n?.row),re=xe??lr(no),F=xe?{className:"",style:{}}:ir(no,js,Ks),fn=gr(),So=Ir(xe,fn??void 0),wo=re||F.className?{...re?{backgroundColor:re}:{},...F.style,...So}:void 0,po=Gr(),j=w===!0&&o!=="tabs"&&o!=="accordion",r=fs({bgImage:p,[h]:L}),xo=Pr(Zs),Po=r?void 0:wo,le=r?null:Ys??null,Cn=xo||le?{...Po,...xo,...le}:Po,ie=Ct(),bn=ct(),hn=qn(),_o=zn(),Sn=Jn(),wn=Yn(),l=o==="accordion",$o=ot(ln),K=l&&$o==="numbered",Pe=rt(),pn=tt(),D=Qt(o,f),a=C==="scroll"&&o!=="tabs"&&!l,xn=$t(),ce=P||ne>=0&&b!==null,Ro=b?b.mirror:lo,Pn=ne>=0?ne:n?.index,_e=P&&ht(n?.ownerType),Oo=ds({direction:o,separator:f,loop:C,line:w,bgImage:p,[h]:L,columns:m,columnsTablet:g,share:d,wrap:oe},ce,c.desktop)&&yt(Ro,Pn),_n=ds({direction:o,separator:f,loop:C,line:w,bgImage:p,[h]:L,columns:m,columnsTablet:g,share:d,wrap:oe},ce,c.desktop)&&At(Ro)!==null,H=Gt({direction:o,separator:f,loop:C,line:w,columns:m}),k=Mt({direction:o,separator:f,loop:C,line:w,columnsTablet:g}),U=Wt({direction:o,separator:f,loop:C,line:w,columns:m,columnsTablet:g,share:d,shareTablet:I}),J=gt(cn)===It,$e=Nt(J),yo=j&&Xe(se)===Jr,V=o==="row"&&!r&&!D&&!a&&(!j||yo)&&k===""&&U===""?Xe(se):void 0,G=V??(o==="column"&&!r?Xe(se):void 0),$n=it(),ae=Wr(c,i.blockCount??0,V),Rn=(ae&&(!n||n.index===0)?Xr(c,i.blockCount??0,V):"")+(te&&(!n||n.index===0)?Kr(te,i.blockCount??0):""),Ao=jr(te,i.blockCount??0),Lo=k!==""?Number(g)>=2:U===""||M(I)!=="",vo=k!==""||U!=="",ko=o==="row"&&!D&&!a&&w!==!0,Re=ko&&!c.phone&&!c.desktop?st(nt(un,i.blockIds??[]),{editing:B}):void 0,No=Re!==void 0&&!B,On=H!==""?Number(m)>=2:M(d)!=="",Io=!r&&!l&&!_n&&!c.desktop&&!c.phone,de=Io&&!a?Dt(W,oo,Ds):"",Oe=r||ce?"":Lt(xn,o,a?void 0:W,y,de?oo:void 0),yn=/view-wide:max-view-desktop:justify-/.test(Oe)?de.split(" ").filter(s=>!s.startsWith("view-wide:max-view-desktop:justify-")).join(" "):de,An=Io&&o==="row"?Et(y,Hs,Vs):"",Ln=!a&&!l&&H===""&&k===""&&!c.desktop?Ht(oe,so):"",go=[l?"":M(d),o==="row"?Vt(d):"",H,k,U,Tt(l?"gap":ze),zt(o,f),l&&!K?"border-t border-line":"",yn,An,Ln,l?"":Ft(ze,Gs,Ms),l?ms(m,S,K):"",K?Zn:""].filter(Boolean).join(" "),vn=go?` ${go}`:"",Bo=["flex",o==="row"?D||a?"flex-row":`flex-row ${ee(S,X,Rs,so)}`:"flex-col",Ut(a||l?!1:oe),r?cr(Bs??"center",o):Bt(a||l?void 0:W,l?void 0:y)+(Oe?` ${Oe}`:"")].join(" ")+vn,z=A||r||_||Pe?` ${Ce}`:"",ye=mn?` ${_}`:_?`${z} ${_}`:z,Eo=pn&&o==="column"&&!r&&!a&&M(d)===""&&(typeof W=="string"&&W!=="start"||de!==""),To=z||(Eo?` ${Ce}`:""),Ae=T?` ${$r}`:"",Le=r||ie||Qe?"":" py-6",kn=V===void 0?"":` ${Qr(V)}`,Fo=G===void 0||J?"":` ${zr(G)}`,ve=G===void 0?"":` ${qr(G)}`,Nn=`${Me}${Le} ${$e}${ye}${Ae}${Fo}${ve}`,In=ie?`${ye}${Ae}${ve}`.trim():`w-full${Le}${ye}${Ae}${ve}`,Y=K&&ms(m,S)===""?us("Flex",0,"block"):us("Flex",Je,o==="row"?"inline":"block",_s,D||a?void 0:be),Do=Kt(d,I,o==="row"?i.blockCount??0:0),Ho=D?{...Y.style,...qt(o,f)}:Y.style,gn=Do?{...Ho,...Do}:Ho,ke=(s="")=>e(i,{className:`${Bo}${Oo?` ${vt}`:""}${Y.className}${To}${kn}${s?` ${s}`:""}${j?` ${Vr}`:""}${v?` ${Rr(v)}`:""}${ae}${Ao}`,style:gn,minEmptyHeight:120,...Re?{cell:Re}:null}),Vo=sr(we)?"":Yt(o,f),Go=a?e(nr,{direction:we,seconds:Ws,delay:Xs,editing:B,copy:s=>ke(s&&Vo?`${s} ${Vo}`:s)}):K?ue(Z,{children:[e("style",{children:et}),ke()]}):ke(),Ne=o==="tabs"?e(Un,{className:`${Bo}${Y.className}${Pe&&!A&&!r&&!_?"":z}`,style:Y.style,shape:Ps,children:Go}):Go,Ie=l?e(Ve.Provider,{value:"accordion",children:e(He.Provider,{value:$o,children:Ne})}):_o?e(Ve.Provider,{value:!1,children:e(He.Provider,{value:"plain",children:Ne})}):Ne,Mo=o==="row"&&!r&&(y===void 0||y==="stretch"),Bn={stretchedRow:Mo,fillingColumn:o==="column"&&(Pe||Eo),columnsRow:H!==""||k!==""||ae!==""||Ao!==""||o==="row"&&(Array.isArray(d)||Array.isArray(I))||No,...No?{phoneCells:!0}:null,...Mo&&ko&&(i.blockCount??0)>=2&&On?{picturesFillRow:!0}:null,...vo&&!Lo?{fillFrom:"desktop"}:null,...Xt(S,X)&&(!vo||Lo)?{phoneRowFills:!0}:null,...E?{id:E}:null},Wo=n===null?Ot({direction:o,loop:C,bgImage:p,[h]:L,columns:m,mirrorCards:lo},!1):null,Xo=Wo?e(as.Provider,{value:{hand:Wo,ids:i.blockIds??[],boxes:[]},children:Ie}):x?e(as.Provider,{value:null,children:Ie}):Ie,jo=e(ls.Provider,{value:Bn,children:e(rs.Provider,{value:!1,children:ce?e(pt.Provider,{value:Oo,children:e(wt.Provider,{value:!P,children:Xo})}):Xo})}),En=pe?.blockCount??0,Ko=_o==="accordion"&&!!pe&&(B||En>0)?e(Qn,{startsOpen:rn===!0||wn&&P&&n?.index===0,editing:B,numbered:Sn==="numbered",title:e(ls.Provider,{value:el,children:e(rs.Provider,{value:!1,children:e(Ve.Provider,{value:!1,children:e(He.Provider,{value:"plain",children:e(pe,{className:`min-w-0 flex-1 ${Jt}`,minEmptyHeight:24})})})})}),children:jo}):jo,ge=j?e(Dr,{row:o==="row",stops:i.blockCount??0,desktopLine:V!==void 0&&yo,children:Ko}):Ko,Tn=xs?.trim()||(hn?"":void 0),Fn={values:t,frame:Le?24:0},Dn=s=>po?e(Hr,{on:po,future:Js===!0,children:s}):s,Hn=s=>Lr(T)?e(vr,{href:T,newTab:"auto",className:hs,"aria-labelledby":s,[bs]:""}):e("a",{href:T,className:hs,"aria-labelledby":s,[bs]:""}),Uo=(v?Or(v):"")+Rn+(G===void 0||n&&n.index!==0?"":Yr(G,{gutter:!J})),Jo=Uo?e("style",{dangerouslySetInnerHTML:{__html:Uo}}):null,q=Sr({loop:C,direction:o,scrollDirection:we,bgImage:p,[h]:L}),Vn=c.desktop&&ae!==""&&!re&&!F.className&&!Ss(fo,bo,Co)&&!br(Se,Ze,eo)&&!T&&!_&&!A&&!v&&!wr(he&&!q,$n)&&Ue(Je)&&(Ke(be)||Ue(be))&&Qe&&Object.values(t).every(s=>Ke(s)||Ue(s)),Gn=s=>({...Vn?{[Mr]:""}:null,...r?null:{...Cr(Se),...hr(Se,Ze,eo)},...v?{[_r]:v}:null,...s?{id:s}:null}),zo=H!==""?Number(m):0,Mn=ee(S,X)===ee(void 0),Wn=(o==="column"||o==="row"&&!D&&!a&&(zo===1&&Mn||zo===0&&i.blockCount===1))&&!r&&!j&&!ie,Yo=r&&bn&&!ie,qo=(s,$)=>Dn(e(lt,{contained:he&&!q,style:q?je:void 0,framedClass:Nn,fillClass:In,columnClass:`${Me} ${$e}${To}${Fo}`,tabLabel:Tn,pad:r?void 0:Fn,border:Ss(fo,bo,Co),outerAttrs:Gn($),box:!0,edge:Wn,outerStyle:Cn,outerClass:r?void 0:[F.className,le?Tr:"",le&&So?Fr:""].filter(Boolean).join(" ")||void 0,bleed:Yo,siteSide:J,children:Jo||$?ue(Z,{children:[Jo,$?Hn($):null,q?e(is,{children:s}):s]}):q?e(is,{children:s}):s})),Be=s=>T?e(ol,{children:$=>qo(s,$)}):qo(s),Qo=s=>uo.bound?e(ut,{children:s}):s;if(!r){const s=y===void 0||y==="stretch",$=(M(d)!==""||H!==""||k!=="")&&!jt(S,X)&&!(U!==""&&M(I)==="")&&(s||ee(S)!==ee(void 0));if(!(o==="row"?$:o==="column"&&s))return Be(Qo(ge));const ts=mt({direction:o,separator:f,loop:C,line:w,share:d,shareTablet:I,sharePhone:X,phoneRow:S,columns:m,columnsTablet:g,stackBelow:se,shared:c.desktop||c.phone||te,count:tn}),Xn={hasWidth:!0,...ts?{bound:ft(ts,uo.bound)}:null};return Be(e(cs.Provider,{value:Xn,children:ge}))}const Ee=Cs(p),Q=Ee?rr(Ye,qe):null,Te=Ee?mr({darken:Ye,darkenStyle:qe,darkenTablet:ks,darkenStyleTablet:Is,darkenPhone:Ns,darkenStylePhone:gs}):{className:"",style:{}},Zo=[_e?"rounded-[inherit]":"",Te.className].filter(Boolean).join(" "),Fe=Cs(ao),es=Ee?Fe?{"--sf-box-bg":We(p??""),"--sf-box-bg-p":We(ao??"")}:{backgroundImage:We(p??""),backgroundSize:"cover",backgroundPosition:"center"}:{},os=Er(void 0,void 0,vs),N=os.className?os:null,De=kr({...t,top:me(t.top)??O(R.desktop,t.unit,"desktop"),bottom:me(t.bottom)??O(R.desktop,t.unit,"desktop"),topPhone:me(t.topPhone)??O(R.phone,t.unitPhone,"mobile"),bottomPhone:me(t.bottomPhone)??O(R.phone,t.unitPhone,"mobile"),left:fe(t.left)??O(R.side,t.unit,"desktop"),right:fe(t.right)??O(R.side,t.unit,"desktop"),leftPhone:fe(t.leftPhone)??O(R.sidePhone,t.unitPhone,"mobile"),rightPhone:fe(t.rightPhone)??O(R.sidePhone,t.unitPhone,"mobile"),sideSpace:J?"site":"box"}),ss=e("div",{className:`relative z-[1] ${tr} ${De?.className??""}${A||_?` ${Ce}`:""}`.trimEnd(),style:Q?{...De?.style,...je,...Nr}:{...De?.style,...je},children:Qo(ge)}),ns=Yo&&he?e("div",{className:`${Me} ${$e}${A||_?` ${Ce}`:""}`,children:ss}):ss;return Be(e(Z,{children:ue("div",{className:`relative isolate overflow-hidden ${fr}${z}${Fe&&!N?` ${ps}`:""}${F.className?` ${F.className}`:""}`,style:{..._e?Zr:{},...wo,...N?{}:es},...N?{[Br]:""}:{},children:[N&&ue(Z,{children:[e(Ur,{sheet:N.sheet}),e("div",{"aria-hidden":!0,className:`absolute inset-0${_e?" rounded-[inherit]":""}${Fe?` ${ps}`:""} ${N.className}`,style:{...es,...N.style??{}}})]}),e(dt,{wash:Q&&Te.className?{...Q,...Te.style}:Q,...Zo?{className:Zo}:{}}),Q?e(at,{children:ns}):ns]})}))}export{sl as default};
|
|
1
|
+
import{Fragment as ee,jsx as e,jsxs as be}from"react/jsx-runtime";import{useContext as zn,useId as Jn}from"react";import Yn from"./BoxTabs.js";import{AccordionRowStyleContext as Ge,BoxTabPaneContext as We,useAccordionRowStyle as Zn,useBoxPaneKind as qn,useFirstCopyOpens as Qn,useIsTabPane as et}from"./BoxTabPaneContext.js";import ot,{ACCORDION_COUNTER_RESET as st}from"./BoxAccordionRow.js";import{ACCORDION_MARK_SHEET as nt}from"./AccordionMark.js";import{accordionRowStyleOf as tt}from"../../format/lib/content/accordion-row-style.js";import{boxPhoneCell as rt,boxPhoneOrder as lt}from"../../format/lib/content/box-phone-place.js";import{CellFillContext as as,InBoxContext as ds,useCellOfStretchedRow as it,useFillsCell as ct}from"./InBoxContext.js";import at,{InsideSiteColumn as us,useInsideSiteGutter as dt,useSectionRoot as ut}from"./SiteGutterFrame.js";import{BoxSurfaceProvider as mt}from"./BoxSurfaceContext.js";import ft from"./PictureWash.js";import{BoxCellContext as ms,NoCellBound as ht}from"./BoxCellContext.js";import{boxCellFractions as Ct}from"../lib/content/box-cell-bound.js";import{boundOf as bt}from"../../format/lib/content/cell-picture-sizes.js";import{useInSiteHeader as St}from"./PhoneMenuTools.js";import{useCardRow as wt}from"./CardRowContext.js";import{cardLineBetween as Xe,framesItsCards as pt}from"../../format/lib/content/card-place.js";import{rowLinkText as xt}from"../../format/lib/content/card-template.js";import{HandedMirrorContext as Pt,MirrorContext as _t,RowHandContext as fs,boxPlace as $t,useHandedMirrorAbove as vt,useHandedRows as Rt,useMirroredCopy as Ot,useUnderCardBox as yt}from"./MirrorContext.js";import{boxChildrenHand as Lt,isMirroredCopy as At,mirrorCardsActs as hs,mirrorCardsOf as Nt,mirroredBoxClass as kt,MIRROR_ROW_CLASS as It,ownsCard as gt}from"../../format/lib/content/mirror-cards.js";import{FRAME_BASE as je,frameGutterOf as Bt}from"./BlockFrame.js";import{BOX_SIDE_SPACE_SITE as Et,boxSideSpaceOf as Tt}from"../../format/lib/content/box-side-space.js";import{containerGapProps as Cs}from"../../format/lib/content/container-gap.js";import{boxLayoutClasses as Ft,boxAlignViewClasses as Dt,boxBlockSpacingClass as Ht,boxBlockSpacingViewClasses as Mt,boxJustifyViewClasses as Vt,boxWrapTabletClass as Gt,boxFitContentClass as Wt,boxAccordionColumnsClass as bs,boxRowColumnsClass as Xt,boxRowTabletColumnsClass as jt,boxRowTabletShareClass as Kt,boxPhoneCellsShareLine as Ut,boxPhoneRowClasses as oe,boxPhoneRowFits as zt,boxShareClasses as W,boxShareVars as Jt,boxWrapClass as Yt,BOX_GAP_ONLY_CLASS as Zt}from"../../format/lib/content/box-layout.js";import{boxSeparatorClasses as qt,boxSeparatorSeamClass as Qt,boxSeparatorStyle as er,isStripBox as or}from"../../format/lib/content/box-separator.js";import{DEFAULT_LOOP_DELAY as sr,DEFAULT_LOOP_DIRECTION as nr,DEFAULT_LOOP_SECONDS as tr,isVerticalLoop as rr}from"../../format/lib/animation/index.js";import{LoopTrack as lr}from"../lib/animation/LoopTrack.js";import{BOX_CARD_PAD as R,BOX_OWNS_SIDES_CLASS as ir,boxDarkenStyle as cr,boxPaintOf as ar,boxFillViews as dr,boxPlacementClasses as ur,boxCardProps as mr,boxIsCard as Ss,boxRowPicture as fr,boxSwatchFill as hr,boxWashViews as Cr,CARD_SHADOW_CLASS as br,isBackgroundBox as ws}from"../../format/lib/content/box-background.js";import{BOX_ROW_IMAGE_PROP as S}from"../../format/lib/content/box-card-rule.js";import{boxShadowAttrs as Sr,boxShadowOnAnyView as wr,boxShadowViewAttrs as pr}from"../../format/lib/content/box-shadow.js";import{boxRunsEdgeToEdge as xr,drawsSiteGutter as Pr}from"../../format/lib/content/site-gutter.js";import{boxShapeClass as _r,boxShapeClasses as $r}from"../../format/lib/content/box-shape.js";import{boxAngleStyle as vr}from"../../format/lib/content/box-angle.js";import{BOX_JUMP_ATTR as Rr,BOX_LINK_ATTR as ps,BOX_LINK_CLASS as xs,BOX_LINKED_CLASS as Or,boxJumpBlocksClass as yr,boxJumpCss as Lr,boxJumpSlug as Ar,boxLinkOf as Nr,siteLinkDraws as kr}from"../../format/lib/content/box-link.js";import{SiteLink as Ir}from"../lib/site-runtime.js";import{sectionBorderStyle as Ps}from"../../format/lib/content/borders.js";import{finiteNumber as Se}from"../../format/lib/finite-number.js";import{padDefaultIn as O,padSideValue as we,sectionPadAttrs as gr}from"../lib/content/section-padding.js";import{SECTION_FILL_CLASS as pe}from"../../format/lib/content/section-min-height.js";import{ON_MEDIA_INK_STYLE as Br,rowFillInkStyle as Er}from"../../format/lib/content/ink.js";import{useThemeLightInk as Tr}from"./ThemeLightInkContext.js";import{sizedBackground as Ke}from"../../format/lib/sized-image.js";import{PHOTO_HOST_ATTR as Fr,resolveImageTreatment as Dr}from"../../format/lib/content/image-treatment.js";import{BOX_HIGHLIGHT_CLASS as Hr,BOX_HIGHLIGHT_OVER_ROW_INK_CLASS as Mr}from"../../format/lib/animation/hover.js";import{BoxRail as Vr,BoxRailStop as Gr,RAIL_STOPS_CLASS as Wr,useTimelineRail as Xr}from"./TimelineRail.js";import{SHARED_PLAIN_ATTR as jr,sharedColumnsClasses as Kr,sharedColumnsCss as Ur,sharedRowsClasses as zr,sharedRowsCss as Jr}from"../lib/content/box-shared-columns.js";import Yr from"./PhotoHoverSheet.js";import{PictureHoverMoveSheet as Zr,PictureHoverZoom as qr,pictureHoverMoveOf as Qr}from"./PictureHoverMove.js";import{BOX_DESKTOP_LINE as el,stackGutterClass as ol,stackLineCss as sl,stackOuterClass as nl,stackRowClass as tl,storedStackLine as Ue}from"../lib/content/box-stack-line.js";const ze={"--sf-site-gutter":"0px"},rl={overflowX:"clip",overflowY:"visible"},ll={stretchedRow:!1,fillingColumn:!1,columnsRow:!1},_s={desktop:!1,phone:!1},$s="bg-cover bg-center bg-[image:var(--sf-box-bg)] max-view-wide:bg-[image:var(--sf-box-bg-p)]",Je=u=>u==null||u==="",Ye=u=>!Je(u)&&Number(u)===0;function il({children:u}){return e(ee,{children:u(Jn())})}function cl({direction:u,label:vs,tabShape:Rs,gap:Ze,gapPhone:Os,gapTablet:xe,justify:X,align:y,wrap:se,share:ys,sharePhone:j,shareTablet:I,wrapPhone:Ls,orderPhone:As,phoneRow:w,columns:m,columnsTablet:g,separator:f,stackBelow:ne,blockSpacing:qe,bgImage:Ns,bgImagePhone:ks,rowImage:Is,pictureHover:Qe,darken:eo,darkenStyle:Pe,darkenTablet:gs,darkenPhone:Bs,darkenStyleTablet:Es,darkenStylePhone:Ts,placement:Fs,padV2:oo=!1,border:Ds,borderTablet:Hs,borderPhone:Ms,borderUnits:so,pad:t={},contained:_e=!0,fillHeight:L=!1,shadow:$e,shadowTablet:no,shadowPhone:to,justifyTablet:ro,justifyPhone:Vs,alignTablet:Gs,alignPhone:Ws,wrapTablet:lo,blockSpacingTablet:Xs,blockSpacingPhone:js,loop:h,scrollDirection:ve=nr,loopSeconds:Ks=tr,loopDelay:Us=sr,editing:B=!1,fillColor:io,fillColorTablet:zs,fillColorPhone:Js,swatch:Ys,line:p,upcoming:Zs,link:qs,rowLink:co,highlight:Qs,boxShape:ao,boxShapePhone:en,boxShapeTablet:on,angle:sn,jumpHighlight:nn,anchor:tn,sharedSides:rn=_s,sharedRows:ln=!1,boxId:E,slotCount:cn,mirrorCards:uo,content:i,rowTitle:Re,startsOpen:an,rowStyle:dn,sideSpace:un}){const n=wt(),A=mr({[S]:Is},n!==null)[S],mo=Ss({[S]:A}),c=mo?_s:rn,mn=mo?!1:ln,fo=fr({[S]:A},n?.row),x=fo??Ns,ho=fo===null?ks:void 0,Co=zn(ms),fn=vt(),bo=yt()&&!(fn&&n!==null),P=Rt(),_=gt({inCopy:n!==null,nestedCopy:n?.nested===!0,underBox:bo}),So=Xe(Ds,n,_),wo=Xe(Hs,n,_),po=Xe(Ms,n,_),xo=n===null&&!bo&&P?.ids&&E?P.ids.indexOf(E):-1,te=xo>=0&&P&&E?$t(P,E,xo):-1,C=te>=0?P?.hand??null:_&&P?.copies===!0?P.hand:null,o=C?.row?"row":u,d=C?.row?C.row.share:ys,hn=C?.row?C.row.phoneReverse?[...i.blockIds??[]].reverse():void 0:As,re=mn&&!C?.row,T=B?"":co&&n?xt(n.row,co)??"":Nr(qs),$=L?"":$r(ao,en,on),Cn=!L&&_r(ao)!=="",N=Ar(nn,tn),Oe=hr({swatch:Ys},n?.row),le=Oe??ar(io),F=Oe?{className:"",style:{}}:dr(io,zs,Js),bn=Tr(),Po=Er(Oe,bn??void 0),_o=le||F.className?{...le?{backgroundColor:le}:{},...F.style,...Po}:void 0,$o=Xr(),K=p===!0&&o!=="tabs"&&o!=="accordion",r=Ss({bgImage:x,[S]:A}),vo=vr(sn),Ro=r?void 0:_o,ie=r?null:Qs??null,Sn=vo||ie?{...Ro,...vo,...ie}:Ro,ce=St(),wn=ut(),pn=et(),Oo=qn(),xn=Zn(),Pn=Qn(),l=o==="accordion",yo=tt(dn),U=l&&yo==="numbered",ye=ct(),_n=it(),D=or(o,f),a=h==="scroll"&&o!=="tabs"&&!l,$n=Ot(),ae=_||te>=0&&C!==null,Lo=C?C.mirror:uo,vn=te>=0?te:n?.index,de=_&&pt(n?.ownerType),Ao=hs({direction:o,separator:f,loop:h,line:p,bgImage:x,[S]:A,columns:m,columnsTablet:g,share:d,wrap:se},ae,c.desktop)&&At(Lo,vn),Rn=hs({direction:o,separator:f,loop:h,line:p,bgImage:x,[S]:A,columns:m,columnsTablet:g,share:d,wrap:se},ae,c.desktop)&&Nt(Lo)!==null,H=Xt({direction:o,separator:f,loop:h,line:p,columns:m}),k=jt({direction:o,separator:f,loop:h,line:p,columnsTablet:g}),z=Kt({direction:o,separator:f,loop:h,line:p,columns:m,columnsTablet:g,share:d,shareTablet:I}),J=Tt(un)===Et,Le=Bt(J),No=K&&Ue(ne)===el,M=o==="row"&&!r&&!D&&!a&&(!K||No)&&k===""&&z===""?Ue(ne):void 0,V=M??(o==="column"&&!r?Ue(ne):void 0),On=dt(),ue=Kr(c,i.blockCount??0,M),yn=(ue&&(!n||n.index===0)?Ur(c,i.blockCount??0,M):"")+(re&&(!n||n.index===0)?Jr(re,i.blockCount??0):""),ko=zr(re,i.blockCount??0),Io=k!==""?Number(g)>=2:z===""||W(I)!=="",go=k!==""||z!=="",Bo=o==="row"&&!D&&!a&&p!==!0,Ae=Bo&&!c.phone&&!c.desktop?rt(lt(hn,i.blockIds??[]),{editing:B}):void 0,Eo=Ae!==void 0&&!B,Ln=H!==""?Number(m)>=2:W(d)!=="",To=!r&&!l&&!Rn&&!c.desktop&&!c.phone,me=To&&!a?Vt(X,ro,Vs):"",Ne=r||ae?"":kt($n,o,a?void 0:X,y,me?ro:void 0),An=/view-wide:max-view-desktop:justify-/.test(Ne)?me.split(" ").filter(s=>!s.startsWith("view-wide:max-view-desktop:justify-")).join(" "):me,Nn=To&&o==="row"?Dt(y,Gs,Ws):"",kn=!a&&!l&&H===""&&k===""&&!c.desktop?Gt(se,lo):"",Fo=[l?"":W(d),o==="row"?Wt(d):"",H,k,z,Ht(l?"gap":qe),qt(o,f),l&&!U?"border-t border-line":"",An,Nn,kn,l?"":Mt(qe,Xs,js),l?bs(m,w,U):"",U?st:""].filter(Boolean).join(" "),In=Fo?` ${Fo}`:"",Do=["flex",o==="row"?D||a?"flex-row":`flex-row ${oe(w,j,Ls,lo)}`:"flex-col",Yt(a||l?!1:se),r?ur(Fs??"center",o):Ft(a||l?void 0:X,l?void 0:y)+(Ne?` ${Ne}`:"")].join(" ")+In,Y=L||r||$||ye?` ${pe}`:"",ke=Cn?` ${$}`:$?`${Y} ${$}`:Y,Ho=_n&&o==="column"&&!r&&!a&&W(d)===""&&(typeof X=="string"&&X!=="start"||me!==""),Mo=Y||(Ho?` ${pe}`:""),Ie=T?` ${Or}`:"",ge=r||ce||oo?"":" py-6",gn=M===void 0?"":` ${tl(M)}`,Vo=V===void 0||J?"":` ${ol(V)}`,Be=V===void 0?"":` ${nl(V)}`,Bn=`${je}${ge} ${Le}${ke}${Ie}${Vo}${Be}`,En=ce?`${ke}${Ie}${Be}`.trim():`w-full${ge}${ke}${Ie}${Be}`,Z=U&&bs(m,w)===""?Cs("Flex",0,"block"):Cs("Flex",Ze,o==="row"?"inline":"block",Os,D||a?void 0:xe),Go=Jt(d,I,o==="row"?i.blockCount??0:0),Wo=D?{...Z.style,...er(o,f)}:Z.style,Tn=Go?{...Wo,...Go}:Wo,Ee=(s="")=>e(i,{className:`${Do}${Ao?` ${It}`:""}${Z.className}${Mo}${gn}${s?` ${s}`:""}${K?` ${Wr}`:""}${N?` ${yr(N)}`:""}${ue}${ko}`,style:Tn,minEmptyHeight:120,...Ae?{cell:Ae}:null}),Xo=rr(ve)?"":Qt(o,f),jo=a?e(lr,{direction:ve,seconds:Ks,delay:Us,editing:B,copy:s=>Ee(s&&Xo?`${s} ${Xo}`:s)}):U?be(ee,{children:[e("style",{children:nt}),Ee()]}):Ee(),Te=o==="tabs"?e(Yn,{className:`${Do}${Z.className}${ye&&!L&&!r&&!$?"":Y}`,style:Z.style,shape:Rs,children:jo}):jo,Fe=l?e(We.Provider,{value:"accordion",children:e(Ge.Provider,{value:yo,children:Te})}):Oo?e(We.Provider,{value:!1,children:e(Ge.Provider,{value:"plain",children:Te})}):Te,Ko=o==="row"&&!r&&(y===void 0||y==="stretch"),Fn={stretchedRow:Ko,fillingColumn:o==="column"&&(ye||Ho),columnsRow:H!==""||k!==""||ue!==""||ko!==""||o==="row"&&(Array.isArray(d)||Array.isArray(I))||Eo,...Eo?{phoneCells:!0}:null,...Ko&&Bo&&(i.blockCount??0)>=2&&Ln?{picturesFillRow:!0}:null,...go&&!Io?{fillFrom:"desktop"}:null,...Ut(w,j)&&(!go||Io)?{phoneRowFills:!0}:null,...E?{id:E}:null},Uo=n===null?Lt({direction:o,loop:h,bgImage:x,[S]:A,columns:m,mirrorCards:uo},!1):null,zo=Uo?e(fs.Provider,{value:{hand:Uo,ids:i.blockIds??[],boxes:[]},children:Fe}):P?e(fs.Provider,{value:null,children:Fe}):Fe,Jo=e(ds.Provider,{value:Fn,children:e(as.Provider,{value:!1,children:ae?e(_t.Provider,{value:Ao,children:e(Pt.Provider,{value:!_,children:zo})}):zo})}),Dn=Re?.blockCount??0,Yo=Oo==="accordion"&&!!Re&&(B||Dn>0)?e(ot,{startsOpen:an===!0||Pn&&_&&n?.index===0,editing:B,numbered:xn==="numbered",title:e(ds.Provider,{value:ll,children:e(as.Provider,{value:!1,children:e(We.Provider,{value:!1,children:e(Ge.Provider,{value:"plain",children:e(Re,{className:`min-w-0 flex-1 ${Zt}`,minEmptyHeight:24})})})})}),children:Jo}):Jo,De=K?e(Vr,{row:o==="row",stops:i.blockCount??0,desktopLine:M!==void 0&&No,children:Yo}):Yo,Hn=vs?.trim()||(pn?"":void 0),Mn={values:t,frame:ge?24:0},Vn=s=>$o?e(Gr,{on:$o,future:Zs===!0,children:s}):s,Gn=s=>kr(T)?e(Ir,{href:T,newTab:"auto",className:xs,"aria-labelledby":s,[ps]:""}):e("a",{href:T,className:xs,"aria-labelledby":s,[ps]:""}),Zo=(N?Lr(N):"")+yn+(V===void 0||n&&n.index!==0?"":sl(V,{gutter:!J})),qo=Zo?e("style",{dangerouslySetInnerHTML:{__html:Zo}}):null,q=xr({loop:h,direction:o,scrollDirection:ve,bgImage:x,[S]:A}),Wn=c.desktop&&ue!==""&&!le&&!F.className&&!Ps(So,po,wo,so)&&!wr($e,no,to)&&!T&&!$&&!L&&!N&&!Pr(_e&&!q,On)&&Ye(Ze)&&(Je(xe)||Ye(xe))&&oo&&Object.values(t).every(s=>Je(s)||Ye(s)),Xn=s=>({...Wn?{[jr]:""}:null,...r?null:{...Sr($e),...pr($e,no,to)},...N?{[Rr]:N}:null,...s?{id:s}:null}),Qo=H!==""?Number(m):0,jn=oe(w,j)===oe(void 0),Kn=(o==="column"||o==="row"&&!D&&!a&&(Qo===1&&jn||Qo===0&&i.blockCount===1))&&!r&&!K&&!ce,es=r&&wn&&!ce,os=(s,v)=>Vn(e(at,{contained:_e&&!q,style:q?ze:void 0,framedClass:Bn,fillClass:En,columnClass:`${je} ${Le}${Mo}${Vo}`,tabLabel:Hn,pad:r?void 0:Mn,border:Ps(So,po,wo,so),outerAttrs:Xn(v),box:!0,edge:Kn,outerStyle:Sn,outerClass:r?void 0:[F.className,ie?Hr:"",ie&&Po?Mr:""].filter(Boolean).join(" ")||void 0,bleed:es,siteSide:J,children:qo||v?be(ee,{children:[qo,v?Gn(v):null,q?e(us,{children:s}):s]}):q?e(us,{children:s}):s})),He=s=>T?e(il,{children:v=>os(s,v)}):os(s),ss=s=>Co.bound?e(ht,{children:s}):s;if(!r){const s=y===void 0||y==="stretch",v=(W(d)!==""||H!==""||k!=="")&&!zt(w,j)&&!(z!==""&&W(I)==="")&&(s||oe(w)!==oe(void 0));if(!(o==="row"?v:o==="column"&&s))return He(ss(De));const cs=Ct({direction:o,separator:f,loop:h,line:p,share:d,shareTablet:I,sharePhone:j,phoneRow:w,columns:m,columnsTablet:g,stackBelow:ne,shared:c.desktop||c.phone||re,count:cn}),Un={hasWidth:!0,...cs?{bound:bt(cs,Co.bound)}:null};return He(e(ms.Provider,{value:Un,children:De}))}const fe=ws(x),Q=fe?cr(eo,Pe):null,he=fe?Cr({darken:eo,darkenStyle:Pe,darkenTablet:gs,darkenStyleTablet:Es,darkenPhone:Bs,darkenStylePhone:Ts}):{className:"",style:{}},Me=ws(ho),ns=fe?Me?{"--sf-box-bg":Ke(x??""),"--sf-box-bg-p":Ke(ho??"")}:{backgroundImage:Ke(x??""),backgroundSize:"cover",backgroundPosition:"center"}:{},ts=Dr(void 0,void 0,Qe),G=ts.className?ts:null,b=fe?Qr(Qe,Pe):null,Ce=G!==null||!!b?.zoom,rs=Ce?e("div",{"aria-hidden":!0,className:`absolute inset-0${de?" rounded-[inherit]":""}${Me?` ${$s}`:""}${G?` ${G.className}`:""}`,style:{...ns,...G?.style??{}}}):null,Ve=gr({...t,top:Se(t.top)??O(R.desktop,t.unit,"desktop"),bottom:Se(t.bottom)??O(R.desktop,t.unit,"desktop"),topPhone:Se(t.topPhone)??O(R.phone,t.unitPhone,"mobile"),bottomPhone:Se(t.bottomPhone)??O(R.phone,t.unitPhone,"mobile"),left:we(t.left)??O(R.side,t.unit,"desktop"),right:we(t.right)??O(R.side,t.unit,"desktop"),leftPhone:we(t.leftPhone)??O(R.sidePhone,t.unitPhone,"mobile"),rightPhone:we(t.rightPhone)??O(R.sidePhone,t.unitPhone,"mobile"),sideSpace:J?"site":"box"}),ls=e("div",{className:`relative z-[1] ${ir} ${Ve?.className??""}${L||$?` ${pe}`:""}`.trimEnd(),style:Q?{...Ve?.style,...ze,...Br}:{...Ve?.style,...ze},children:ss(De)}),is=es&&_e?e("div",{className:`${je} ${Le}${L||$?` ${pe}`:""}`,children:ls}):ls;return He(e(ee,{children:be("div",{className:`relative isolate overflow-hidden ${br}${Y}${Me&&!Ce?` ${$s}`:""}${F.className?` ${F.className}`:""}${b?` ${b.className}`:""}`,style:{...de?rl:{},..._o,...Ce?{}:ns,...b?b.style:{}},...G?{[Fr]:""}:{},children:[e(Zr,{move:b}),Ce&&be(ee,{children:[e(Yr,{sheet:G?.sheet}),b?.zoom?e("div",{className:`absolute inset-0 overflow-hidden${de?" rounded-[inherit]":""}`,children:e(qr,{move:b,className:"absolute inset-0",children:rs})}):rs]}),e(ft,{wash:Q&&he.className?{...Q,...he.style}:Q,hover:b?.washHover,...de?{className:"rounded-[inherit]"}:{},...he.className?{restClassName:he.className}:{}}),Q?e(mt,{children:is}):is]})}))}export{cl as default};
|
|
@@ -6,6 +6,8 @@ export interface HeroGroupProps {
|
|
|
6
6
|
nudgeX?: number;
|
|
7
7
|
nudgeY?: number;
|
|
8
8
|
width?: number;
|
|
9
|
+
widthUnit?: unknown;
|
|
10
|
+
nudgeUnit?: unknown;
|
|
9
11
|
gap?: number | string;
|
|
10
12
|
gapPhone?: unknown;
|
|
11
13
|
gapTablet?: unknown;
|
|
@@ -17,4 +19,4 @@ export interface HeroGroupProps {
|
|
|
17
19
|
content?: SlotComponent;
|
|
18
20
|
dragRef?: ((element: Element | null) => void) | null;
|
|
19
21
|
}
|
|
20
|
-
export default function HeroGroup({ placement, nudgeX, nudgeY, width, gap, gapPhone, gapTablet, direction, justify, align, wrap, pad, content: Content, dragRef, }: HeroGroupProps): import("react").ReactNode;
|
|
22
|
+
export default function HeroGroup({ placement, nudgeX, nudgeY, width, widthUnit, nudgeUnit, gap, gapPhone, gapTablet, direction, justify, align, wrap, pad, content: Content, dragRef, }: HeroGroupProps): import("react").ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as g}from"react/jsx-runtime";import{useTakeViewHide as L,withViewHide as v}from"./ViewHideRoot.js";import{containerDirectionClass as D,resolveContainerDirection as V}from"../../format/lib/content/container-direction.js";import{containerGapProps as W}from"../../format/lib/content/container-gap.js";import{cssLengthOf as a,storedUnit as A}from"../../format/lib/content/css-length.js";import{finiteNumber as y}from"../../format/lib/finite-number.js";import{isLengthUnit as B}from"efficient-easel/screen/lib/content/length-units";import{boxLayoutClasses as E,boxWrapClass as F}from"../../format/lib/content/box-layout.js";import{sectionPadAttrs as M}from"../lib/content/section-padding.js";import{clampNudge as x,clampWidth as O,normalisePlacement as R,placementParts as S,placementRow as T}from"../../format/lib/hero-group-placement.js";function _({placement:N,nudgeX:m,nudgeY:l,width:o,widthUnit:b,nudgeUnit:t,gap:H,gapPhone:G,gapTablet:P,direction:c,justify:j,align:$,wrap:k,pad:w={},content:p,dragRef:C}){const i=L(),n=R(N),e=B(t)&&t!=="px"?t:null,f=e?y(m)??0:x(m),u=e?y(l)??0:x(l),h=W("HeroGroup",H,V("HeroGroup",c)==="column"?"block":"inline",G,P),r={"--sf-hg-row":T(n),justifySelf:S(n).column};if(typeof o=="number"&&Number.isFinite(o)){const d=A(b,"%");r["--sf-hg-w"]=d==="%"?`${O(o)}%`:a(Math.max(0,o),d)}(f!==0||u!==0)&&(r["--sf-hg-nudge"]=`${a(f,e)} ${a(u,e)}`);const s=M(w);return i.scope(g("div",{className:v(s?`sf-hero-group ${s.className}`:"sf-hero-group",i.className),"data-hg":n,...i.attrs,style:s?{...r,...s.style}:r,ref:C??void 0,children:p?g(p,{className:["sf-hero-group-blocks flex",D("HeroGroup",c),E(j,$),F(k)].filter(Boolean).join(" ")+h.className,style:h.style,minEmptyHeight:40}):null}))}export{_ as default};
|
|
@@ -28,8 +28,9 @@ interface ImageBlockProps {
|
|
|
28
28
|
focalTablet?: string;
|
|
29
29
|
corners?: number;
|
|
30
30
|
cornerSides?: string[] | null;
|
|
31
|
+
cornersUnit?: unknown;
|
|
31
32
|
pad?: PadValues;
|
|
32
33
|
ownSize?: boolean;
|
|
33
34
|
}
|
|
34
|
-
export default function ImageBlock({ src, alt, aspect: storedAspect, aspectPhone, contained, grayscale, pictureHover, hoverLayer, darken, darkenStyle, href, fit, focal, focalPhone, focalTablet, corners, cornerSides, pad, ownSize, editing, }: ImageBlockProps): import("react").JSX.Element | null;
|
|
35
|
+
export default function ImageBlock({ src, alt, aspect: storedAspect, aspectPhone, contained, grayscale, pictureHover, hoverLayer, darken, darkenStyle, href, fit, focal, focalPhone, focalTablet, corners, cornerSides, cornersUnit, pad, ownSize, editing, }: ImageBlockProps): import("react").JSX.Element | null;
|
|
35
36
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as
|
|
1
|
+
import{jsx as e,Fragment as se,jsxs as v}from"react/jsx-runtime";import{PagePicture as re}from"../lib/first-screen.js";import{SiteLink as le}from"../lib/site-runtime.js";import{siteLinkDraws as ie}from"../../format/lib/content/box-link.js";import me from"./BlockFrame.js";import{useCellPictureSizes as ae}from"./BoxCellContext.js";import{useBoxCell as ce,useFillsCell as ne}from"./InBoxContext.js";import{useInsideSiteGutter as fe,useSectionEdge as ue}from"./SiteGutterFrame.js";import{useSitePhotography as pe}from"./SitePhotographyContext.js";import{media as de}from"../lib/media.js";import{CONTENT_SIZES as R,sizedImage as ge}from"../../format/lib/sized-image.js";import{imageCornerStyle as he}from"../../format/lib/content/image-corners.js";import{FILL_ROW as Se,imageAspectClasses as ve,pictureLayerClass as we,imageFillFrom as Fe,imageAspectDrawn as Ne,imageAspectDrawsARatio as Ce,imageFocalPointActs as be,imageFocalPointActsIn as j,imageAspectPhoneOf as ye,imageFillRowClasses as xe,imageWidthFollowsBox as Ae}from"../../format/lib/content/image-aspect.js";import{drawsSiteGutter as Ie}from"../../format/lib/content/site-gutter.js";import{imageFitClass as $e,parseImageFit as ke}from"../../format/lib/content/image-fit.js";import{SECTION_FILL_CLASS as Pe}from"../../format/lib/content/section-min-height.js";import{PICTURE_WASH_CLASS as _e,resolveImageTreatment as Re}from"../../format/lib/content/image-treatment.js";import{boxDarkenStyle as je}from"../../format/lib/content/box-background.js";import{phoneFocus as Oe}from"../../format/lib/content/phone-focus.js";import{say as ze}from"../../format/lib/editor-words.js";import{sectionEdgeAttrs as Ee}from"../lib/content/section-edge.js";import He from"./PhotoHoverSheet.js";import Le from"./PictureWash.js";import Te from"./HoverMediaLayer.js";import{PictureHoverMoveSheet as De,PictureHoverZoom as Ge,pictureHoverMoveOf as We}from"./PictureHoverMove.js";import{PictureZoom as Be}from"./PictureZoom.js";const Me={picture:"var(--surface)",card:"var(--card-bg)"};function Ze({src:o,alt:O,aspect:z,aspectPhone:r,contained:w,grayscale:E,pictureHover:F,hoverLayer:s,darken:H,darkenStyle:N,href:L,fit:T,focal:C,focalPhone:D,focalTablet:G,corners:W,cornerSides:B,cornersUnit:M,pad:b,ownSize:Z=!1,editing:y=!1}){const c=Re(E,pe(),F),p=ce(),U=ne(),d=ue(),Y=ae(R),t=Ne(z,p?.picturesFillRow===!0),g=t===Se,x=Fe(p?.fillFrom,p?.phoneRowFills===!0,r),l=g?xe(x):null,A=ye(t,r),i=ke(T,"cover"),q=d||!Ae(t,A,i)?R:Y,I=he(W,B,M),J=be(i,t,r),h=Oe(j("mobile",i,t,r)?D:void 0,j("tablet",i,t,r)?G:void 0),$={...c.style??{},...C&&J?{objectPosition:C}:{},...h.style},n=o?ge(de(o)):null,m=We(F,N),K=je(H,N),Q=m?.washHover??null,k=m?.style??{},f=s&&o?e(Te,{media:s.media,name:s.name,cover:s.cover,ground:Me[s.cover]}):null,P=o&&n?e(re,{src:n.src,...n.srcSet?{srcSet:n.srcSet,sizes:q}:{},alt:O,className:`${l?`${l.img} `:""}h-full w-full ${Ce(t,r)?$e(i):""}${c.className?` ${c.className}`:""}${h.className?` ${h.className}`:""}`,...Object.keys($).length?{style:$}:{}}):null,S=P?v(se,{children:[e(He,{sheet:c.sheet}),e(De,{move:m}),e(Ge,{move:m,className:we(l),children:P}),e(Le,{wash:K,hover:Q,className:`pointer-events-none ${_e}`})]}):e("div",{className:"flex aspect-[16/9] items-center justify-center border border-dashed border-line font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg-dim",children:ze("Image — set a path")}),u=(L??"").trim(),V=u&&o?ie(u)?e(le,{href:u,className:"block h-full w-full",newTab:"auto",children:S}):e("a",{href:u,className:"block h-full w-full",children:S}):S,X=fe(),a=d&&!Z?Ee(d):null,_=b?{values:b,frame:g?0:24}:void 0,ee=_!==void 0&&Ie(a?!1:w,X),te=g?U||y||ee?Pe:"":"py-6",oe=o&&i==="contain"?"":"bg-surface ";return!o&&!y?null:v(me,{contained:a?!1:w,className:te,pad:_,...a?{fillWidth:a.className,style:a.style}:{},children:[e("figure",{...l?{className:l.figure}:{},children:v("div",{className:`relative w-full overflow-hidden ${oe}${ve(t,A,x)}${m?` ${m.className}`:""}`,...I||Object.keys(k).length?{style:{...I,...k}}:{},children:[e(Be,{fill:l,children:V}),f&&s?.cover==="picture"?f:null]})}),f&&s?.cover==="card"?f:null]})}export{Ze as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CSSProperties } from "react";
|
|
2
|
-
import { type TypeSizeValue } from "../../format/lib/content/section-type-size.js";
|
|
2
|
+
import { type IntroSizeUnits, type TypeSizeValue } from "../../format/lib/content/section-type-size.js";
|
|
3
3
|
import { type IntroBleedLayout } from "../../format/lib/sections/intro-bleed-layout.js";
|
|
4
4
|
interface Props {
|
|
5
5
|
eyebrow?: string;
|
|
@@ -22,10 +22,11 @@ interface Props {
|
|
|
22
22
|
titleSizeMobile?: TypeSizeValue;
|
|
23
23
|
bodySizeDesktop?: TypeSizeValue;
|
|
24
24
|
bodySizeMobile?: TypeSizeValue;
|
|
25
|
+
sizeUnits?: IntroSizeUnits;
|
|
25
26
|
buttonColor?: string;
|
|
26
27
|
buttonTextColor?: string;
|
|
27
28
|
uppercase?: boolean;
|
|
28
29
|
capStyle?: CSSProperties;
|
|
29
30
|
}
|
|
30
|
-
export default function IntroBleed({ eyebrow, title, body, cta, imageLabel, imageSrc, imageSrcMobile, layout, copyShareDesktop, copyShareMobile, heightDesktop, heightMobile, overlay, titleSizeDesktop, titleSizeMobile, bodySizeDesktop, bodySizeMobile, buttonColor, buttonTextColor, uppercase, capStyle, }: Props): import("react").JSX.Element;
|
|
31
|
+
export default function IntroBleed({ eyebrow, title, body, cta, imageLabel, imageSrc, imageSrcMobile, layout, copyShareDesktop, copyShareMobile, heightDesktop, heightMobile, overlay, titleSizeDesktop, titleSizeMobile, bodySizeDesktop, bodySizeMobile, sizeUnits, buttonColor, buttonTextColor, uppercase, capStyle, }: Props): import("react").JSX.Element;
|
|
31
32
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as V}from"react/jsx-runtime";import{HideTaker as u}from"./ViewHideRoot.js";import W from"./Btn.js";import N from"./Placeholder.js";import X from"./SectionEyebrow.js";import{renderGold as k,renderHeadline as Z,splitParagraphs as U}from"./goldPhrases.js";import{resolveTypeSize as n}from"../../format/lib/content/section-type-size.js";import{HEADER_HEIGHT_CSS as _}from"../lib/document/header-clearance.js";import{resolveSectionHeight as j}from"../../format/lib/content/section-height.js";import{INTRO_BLEED_COPY_SHARE as E,parseIntroBleedLayout as ee,resolveCopyShare as w,INTRO_EDGE_CLASS as te}from"../../format/lib/sections/intro-bleed-layout.js";import{ON_MEDIA_INK_STYLE as re}from"../../format/lib/content/ink.js";function oe({eyebrow:l,title:s,body:d,cta:a,imageLabel:c,imageSrc:m,imageSrcMobile:D,layout:I,copyShareDesktop:S,copyShareMobile:H,heightDesktop:T,heightMobile:M,overlay:p,titleSizeDesktop:B,titleSizeMobile:C,bodySizeDesktop:L,bodySizeMobile:A,sizeUnits:r,buttonColor:O,buttonTextColor:R,uppercase:$=!1,capStyle:h}){const o=ee(I)==="stacked",x=i=>o?`calc(${j(i)} - ${_})`:j(i),F=x(T),G=x(M),P=n(B,"clamp(48px,7vw,96px)","heading","headingLarge",r?.titleDesktop),Y=n(C,"clamp(36px,7vw,96px)","heading","headingLarge",r?.titleMobile),z=n(L,"17px","body","body",r?.bodyDesktop),K=n(A,"16px","body","body",r?.bodyMobile),q=p!=null?p/100:o?0:.6,v=O||"var(--btn)",J=R||"var(--btn-ink)",f={"--intro-h-d":F,"--intro-h-m":G,"--intro-title-d":P,"--intro-title-m":Y,"--intro-body-d":z,"--intro-body-m":K,...o?{"--intro-copy-d":w(S,E.desktop),"--intro-copy-m":w(H,E.mobile),marginTop:_}:{}},g=h?"px-[var(--sf-site-gutter,40px)] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]":`${te} px-[var(--intro-edge)]`,b=t(V,{children:[t("div",{className:"absolute inset-0",children:[e("div",{className:"absolute inset-0 hidden min-[960px]:block",children:e(N,{label:c,src:m})}),e("div",{className:"absolute inset-0 min-[960px]:hidden",children:e(N,{label:c,src:D||m})}),e("div",{className:"pointer-events-none absolute inset-0",style:{backgroundImage:"repeating-linear-gradient(45deg, transparent 0 80px, rgba(201,164,97,.04) 80px 81px)"}})]}),e("div",{className:"absolute inset-0",style:{background:`rgba(0,0,0,${q})`}})]}),y=t("div",{style:h,className:"flex flex-col gap-6",children:[l&&e(X,{text:l,size:14}),s&&e("h2",{className:["font-display font-medium leading-[0.95] tracking-[-0.03em]","text-[length:var(--intro-title-m)] min-[960px]:text-[length:var(--intro-title-d)]",$?"uppercase":""].join(" "),children:Z(s,!1)}),d&&U(d).map((i,Q)=>e("p",{className:"max-w-[560px] leading-[1.6] opacity-85 text-[length:var(--intro-body-m)] min-[960px]:text-[length:var(--intro-body-d)]",children:k(i)},Q)),a.text&&e("div",{className:"mt-2 self-start",children:e(W,{href:a.href,variant:"ghost",style:{background:v,color:J,borderColor:v},children:k(a.text)})})]});return o?t(u,{as:"section",style:f,className:["relative flex flex-col","h-[var(--intro-h-m)] min-[960px]:h-[var(--intro-h-d)] min-h-[420px]","overflow-hidden p-0"].join(" "),children:[e("div",{className:["relative z-[2] flex shrink-0 flex-col justify-center bg-bg py-10","min-h-[var(--intro-copy-m)] min-[960px]:min-h-[var(--intro-copy-d)]",g].join(" "),style:{color:"var(--fg)"},children:y}),e("div",{className:"relative min-h-0 flex-1 overflow-hidden",children:b})]}):t(u,{as:"section",style:f,className:["relative","h-[var(--intro-h-m)] min-[960px]:h-[var(--intro-h-d)] min-h-[420px]","overflow-hidden p-0","mx-auto w-full max-w-[var(--sf-bg-cap,none)]"].join(" "),children:[b,e("div",{className:["relative z-[2] flex h-full flex-col justify-center",g].join(" "),style:re,children:y})]})}export{oe as default};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from "react";
|
|
2
|
+
import type { PictureHoverDrawn } from "../../format/lib/animation/hover.js";
|
|
3
|
+
export interface PictureHoverMoveDrawn {
|
|
4
|
+
className: string;
|
|
5
|
+
style: Record<string, string>;
|
|
6
|
+
sheet?: string;
|
|
7
|
+
zoom: string | null;
|
|
8
|
+
washHover: CSSProperties | null;
|
|
9
|
+
}
|
|
10
|
+
export declare function pictureHoverMoveOf(pictureHover: PictureHoverDrawn | null | undefined, darkenStyle: unknown): PictureHoverMoveDrawn | null;
|
|
11
|
+
export declare function PictureHoverMoveSheet({ move }: {
|
|
12
|
+
move: PictureHoverMoveDrawn | null;
|
|
13
|
+
}): import("react").JSX.Element | null;
|
|
14
|
+
export declare function PictureHoverZoom({ move, className, children }: {
|
|
15
|
+
move: PictureHoverMoveDrawn | null;
|
|
16
|
+
className: string;
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as n,Fragment as s}from"react/jsx-runtime";import{boxDarkenStyle as m}from"../../format/lib/content/box-background.js";import{PICTURE_MOVE_SHEET as l,PICTURE_ZOOM_CLASS as a,PICTURE_ZOOM_VAR as u,resolvePictureMove as i}from"../../format/lib/content/image-treatment.js";import c from"./PhotoHoverSheet.js";function P(e,t){const o=i(e);if(!o)return null;const r=e?.zoom??null;return{className:o.className??"",style:{...o.style??{},...r?{[u]:r}:{}},...o.sheet?{sheet:o.sheet}:{},zoom:r,washHover:e?.darken?m(e.darken,t):null}}function x({move:e}){return e?n(c,{sheet:e.sheet,name:l}):null}function E({move:e,className:t,children:o}){return e?.zoom?n("div",{className:`${t} ${a}`,children:o}):n(s,{children:o})}export{x as PictureHoverMoveSheet,E as PictureHoverZoom,P as pictureHoverMoveOf};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CSSProperties } from "react";
|
|
2
|
-
export default function PictureWash({ wash, hover, className, }: {
|
|
2
|
+
export default function PictureWash({ wash, hover, className, restClassName, }: {
|
|
3
3
|
wash: CSSProperties | null;
|
|
4
4
|
hover?: CSSProperties | null;
|
|
5
5
|
className?: string;
|
|
6
|
+
restClassName?: string;
|
|
6
7
|
}): import("react").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t,Fragment as d,jsxs as u}from"react/jsx-runtime";import{PICTURE_WASH_HOVER_CLASS as l,PICTURE_WASH_REST_CLASS as _}from"../../format/lib/content/image-treatment.js";function $({wash:e,hover:r,className:s,restClassName:i}){const a=`absolute inset-0 z-0${s?` ${s}`:""}`,n=`${a}${i?` ${i}`:""}`;return r?u(d,{children:[e&&t("div",{className:`${n} ${_}`,style:e,"aria-hidden":!0}),t("div",{className:`${a} ${l}`,style:r,"aria-hidden":!0})]}):e?t("div",{className:n,style:e,"aria-hidden":!0}):null}export{$ as default};
|
|
@@ -14,6 +14,12 @@ export type ViewHideTake = {
|
|
|
14
14
|
readonly scope: (element: ReactNode) => ReactNode;
|
|
15
15
|
};
|
|
16
16
|
export declare const NO_HIDE: ViewHideTake;
|
|
17
|
+
type HeightFillClaim = {
|
|
18
|
+
readonly className: string;
|
|
19
|
+
readonly views: string;
|
|
20
|
+
};
|
|
21
|
+
export declare const HeightFillContext: import("react").Context<HeightFillClaim | null>;
|
|
22
|
+
export declare const heightFillClaim: (className: string, views: string) => HeightFillClaim | null;
|
|
17
23
|
export declare const viewHideClaim: (className: string, words: string, line?: {
|
|
18
24
|
readonly sectionClassName?: string;
|
|
19
25
|
readonly line?: ViewHideLineOf;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{createContext as
|
|
1
|
+
"use client";import{createContext as u,createElement as l,useContext as r}from"react";import{CellFillContext as w,InBoxContext as d}from"./InBoxContext.js";import{SECTION_HEIGHT_FILL_ATTR as C}from"../../format/lib/content/section-min-height.js";const a=u(null),m="data-sf-view-hide",N=e=>l(a.Provider,{value:null},e),f={className:"",attrs:{},scope:N},v=f,p=u(null),h=(e,s)=>e?{className:e,views:s}:null,H=e=>l(a.Provider,{value:null},l(p.Provider,{value:null},l(w.Provider,{value:!0},e))),_=(e,s,n={})=>e?{className:e,words:s,...n}:null,x=(e,s)=>e.sectionClassName===void 0?{className:e.className,words:e.words}:e.line==="edge"||e.line!=="section"&&s?{className:e.className,words:`${e.words} edge`}:{className:e.sectionClassName,words:e.words};function E(){const e=r(a),s=r(p),n=r(d)!==null;if(e===null&&s===null)return v;const t=e===null?null:x(e,n);return s===null?{className:t.className,attrs:{[m]:t.words},scope:N}:{className:t?`${t.className} ${s.className}`:s.className,attrs:{...t?{[m]:t.words}:{},[C]:s.views},scope:H}}function F(){const e=r(a),s=r(d)!==null;return e===null?"":x(e,s).className}const T=(e,s)=>s?e?`${e} ${s}`:s:e;function P(e){const s=E(),n=e.takes===!1?f:s,t={};let c=!1;for(const[o,i]of Object.entries(e))o==="as"||o==="takes"||o==="children"||(o==="className"?(t.className=T(i,n.className),c=!0):t[o]=i);return!c&&n.className&&(t.className=n.className),n.scope(l(e.as??"div",{...t,...n.attrs},e.children))}export{p as HeightFillContext,P as HideTaker,f as NO_HIDE,m as VIEW_HIDE_ATTR,a as ViewHideContext,h as heightFillClaim,F as usePeekViewHide,E as useTakeViewHide,_ as viewHideClaim,T as withViewHide};
|
|
@@ -21,7 +21,7 @@ export type BlockSizeLine = {
|
|
|
21
21
|
readonly atSectionLine?: boolean;
|
|
22
22
|
};
|
|
23
23
|
export declare function blockFillInCellClass(values: BlockSizeValues): string;
|
|
24
|
-
export declare function blockSizeOf(values: BlockSizeValues, { atSectionLine }?: BlockSizeLine): BlockSize | null;
|
|
24
|
+
export declare function blockSizeOf(values: BlockSizeValues, { atSectionLine: storedLine }?: BlockSizeLine): BlockSize | null;
|
|
25
25
|
export declare function blockSetsItsWidth(values: BlockSizeValues): boolean;
|
|
26
26
|
export declare function blockCanWidenPastCell(values: BlockSizeValues): boolean;
|
|
27
27
|
export declare function blockSizeValuesOf(props: Readonly<Record<string, unknown>>): BlockSizeValues;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BLOCK_FIXED_WIDTH as
|
|
1
|
+
import{BLOCK_FIXED_WIDTH as ee,BLOCK_SIZE_KEYS as te,parseBlockWidthFit as S,phoneKey as R,parseTextFit as L,tabletKey as z,viewKeyAt as M}from"efficient-easel/draw";import{sideLengthAt as ie}from"efficient-easel/screen/lib/content/length-units";import{TEXT_FIT_ATTR as m}from"../../../format/lib/fit-words.js";import{cssLengthOf as j}from"../../../format/lib/content/css-length.js";import{tierOfView as W}from"../../../format/lib/content/view-tier.js";const oe="sf-block-size",V=["width","minWidth","maxWidth"],Y=e=>`${e}Unit`,l=e=>typeof e=="number"&&Number.isFinite(e)&&e>=0?e:void 0,ne={desktop:{fill:"view-wide:w-full view-wide:[.flex-row>&]:grow",fixed:"view-wide:w-[min(var(--sf-bw),100%)] view-wide:basis-auto! view-wide:grow-0! view-wide:shrink-0"},phone:{fill:"max-view-wide:w-full",fixed:"max-view-wide:w-[min(var(--sf-bw-p),100%)] max-view-wide:basis-auto! max-view-wide:grow-0! max-view-wide:shrink-0"}},U={desktop:{fill:"view-desktop:w-full view-desktop:[.flex-row>&]:grow",fixed:"view-desktop:w-[min(var(--sf-bw),100%)] view-desktop:basis-auto! view-desktop:grow-0! view-desktop:shrink-0"},tablet:{fill:"view-wide:max-view-desktop:w-full view-wide:max-view-desktop:[.flex-row>&]:grow",fixed:"view-wide:max-view-desktop:w-[min(var(--sf-bw-t),100%)] view-wide:max-view-desktop:basis-auto! view-wide:max-view-desktop:grow-0! view-wide:max-view-desktop:shrink-0"},phone:{fill:"max-view-wide:w-full",fixed:"max-view-wide:w-[min(var(--sf-bw-p),100%)] max-view-wide:basis-auto! max-view-wide:grow-0! max-view-wide:shrink-0"}},se={desktop:U.desktop,tablet:{fill:"view-tablet:max-view-desktop:w-full view-wide:max-view-desktop:[.flex-row>&]:grow",fixed:"view-tablet:max-view-desktop:w-[min(var(--sf-bw-t),100%)] view-tablet:max-view-desktop:basis-auto! view-tablet:max-view-desktop:grow-0! view-tablet:max-view-desktop:shrink-0"},phone:{fill:"max-view-tablet:w-full",fixed:"max-view-tablet:w-[min(var(--sf-bw-p),100%)] max-view-tablet:basis-auto! max-view-tablet:grow-0! max-view-tablet:shrink-0"}},we={two:{desktop:"view-wide:[.flex-row>*>&]:grow"},three:{desktop:"view-desktop:[.flex-row>*>&]:grow",tablet:"view-wide:max-view-desktop:[.flex-row>*>&]:grow"}},de={desktop:"--sf-bw",tablet:"--sf-bw-t",phone:"--sf-bw-p"},ae={minWidth:{desktop:["--sf-bmin","view-wide:min-w-[var(--sf-bmin)]!"],phone:["--sf-bmin-p","max-view-wide:min-w-[var(--sf-bmin-p)]!"]},maxWidth:{desktop:["--sf-bmax","view-wide:max-w-[var(--sf-bmax)]"],phone:["--sf-bmax-p","max-view-wide:max-w-[var(--sf-bmax-p)]"]}},E={minWidth:{desktop:["--sf-bmin","view-desktop:min-w-[var(--sf-bmin)]!"],tablet:["--sf-bmin-t","view-wide:max-view-desktop:min-w-[var(--sf-bmin-t)]!"],phone:["--sf-bmin-p","max-view-wide:min-w-[var(--sf-bmin-p)]!"]},maxWidth:{desktop:["--sf-bmax","view-desktop:max-w-[var(--sf-bmax)]"],tablet:["--sf-bmax-t","view-wide:max-view-desktop:max-w-[var(--sf-bmax-t)]"],phone:["--sf-bmax-p","max-view-wide:max-w-[var(--sf-bmax-p)]"]}},pe={minWidth:{desktop:E.minWidth.desktop,tablet:["--sf-bmin-t","view-tablet:max-view-desktop:min-w-[var(--sf-bmin-t)]!"],phone:["--sf-bmin-p","max-view-tablet:min-w-[var(--sf-bmin-p)]!"]},maxWidth:{desktop:E.maxWidth.desktop,tablet:["--sf-bmax-t","view-tablet:max-view-desktop:max-w-[var(--sf-bmax-t)]"],phone:["--sf-bmax-p","max-view-tablet:max-w-[var(--sf-bmax-p)]"]}},fe=["widthFit",...V],X={desktop:"view-wide:whitespace-nowrap view-wide:[&_*]:whitespace-nowrap!",phone:"max-view-wide:whitespace-nowrap max-view-wide:[&_*]:whitespace-nowrap!"},N={desktop:"view-desktop:whitespace-nowrap view-desktop:[&_*]:whitespace-nowrap!",tablet:"view-wide:max-view-desktop:whitespace-nowrap view-wide:max-view-desktop:[&_*]:whitespace-nowrap!",phone:"max-view-wide:whitespace-nowrap max-view-wide:[&_*]:whitespace-nowrap!"},me={desktop:N.desktop,tablet:"view-tablet:max-view-desktop:whitespace-nowrap view-tablet:max-view-desktop:[&_*]:whitespace-nowrap!",phone:"max-view-tablet:whitespace-nowrap max-view-tablet:[&_*]:whitespace-nowrap!"},Z={desktop:"view-wide:min-w-0 view-wide:[&_*]:overflow-hidden view-wide:[&_*]:text-ellipsis",phone:"max-view-wide:min-w-0 max-view-wide:[&_*]:overflow-hidden max-view-wide:[&_*]:text-ellipsis"},le={desktop:"view-desktop:min-w-0 view-desktop:[&_*]:overflow-hidden view-desktop:[&_*]:text-ellipsis",tablet:"view-wide:max-view-desktop:min-w-0 view-wide:max-view-desktop:[&_*]:overflow-hidden view-wide:max-view-desktop:[&_*]:text-ellipsis",phone:Z.phone},$={desktop:"view-wide:max-w-full",phone:"max-view-wide:max-w-full"},G={desktop:"view-desktop:max-w-full",tablet:"view-wide:max-view-desktop:max-w-full",phone:$.phone};function be(e){const n=q(e);return n.sides.filter(o=>n.mode[o]==="fill").map(o=>we[n.three?"three":"two"][o]).filter(Boolean).join(" ")}function q(e){const n=fe.some(s=>{const a=e[s]?.tablet;return s==="widthFit"?S(a)!==void 0:l(a)!==void 0}),o=n?["desktop","tablet","phone"]:["desktop","phone"],p=(s,a)=>{const t=s(a?.desktop),f=n?s(a?.tablet)??t:t;return{desktop:t,tablet:f,phone:s(a?.phone)??f}};return{three:n,sides:o,perSide:p,lengthPerSide:s=>{const a=Y(s),t={};for(const d of o)t[M(s,W(d))]=l(e[s]?.[d]),t[M(a,W(d))]=e.units?.[s]?.[d];const f=d=>ie(t,{length:s},a,W(d),"length")??void 0;return{desktop:f("desktop"),tablet:f("tablet"),phone:f("phone")}},mode:p(S,e.widthFit)}}function ke(e,{atSectionLine:n=!1}={}){const o=["desktop","tablet","phone"].some(i=>L(e.textFit?.[i])==="ellipsis"),p=n&&!o,k=p?se:U,s=p?pe:E,a=p?me:N,t=[],f={},d={},{three:T,sides:F,lengthPerSide:O,mode:J}=q(e),K=O("width");for(const i of F){const w=J[i];!w||w==="fit"||(t.push(T?k[i][w]:ne[i][w]),w==="fixed"&&(f[de[i]]=j(K[i]?.value??ee.fallback,K[i]?.unit)))}for(const i of V.filter(w=>w!=="width")){const w=O(i);for(const r of F){const c=w[r];if(c===void 0)continue;const[h,b]=T?s[i][r]:ae[i][r];f[h]=j(c.value,c.unit),t.push(b)}}const v=L(e.textFit?.desktop),u=L(e.textFit?.phone),C=i=>{const w=l(e.minFont?.[i]);return w===void 0?void 0:e.units?.minFont?.[i]==="vw"?`${w}vw`:String(w)},g=C("desktop"),I=C("phone"),B=L(e.textFit?.tablet),x=B!==v||u!==void 0?B:void 0,D=C("tablet"),A=D!==g||I!==void 0?D:void 0,H=l(e.maxWidth?.desktop),P=l(e.maxWidth?.tablet)??H,y={desktop:H!==void 0,tablet:P!==void 0,phone:(l(e.maxWidth?.phone)??P)!==void 0},_=(i,w,r)=>{if(w!=="line"&&w!=="ellipsis")return;const c=i==="tablet"?void 0:i,h=(b,Q)=>r||!c?b[i]:Q[c];if(w==="line"){t.push(h(a,X));return}if(t.push(h(N,X)),t.push(h(le,Z)),T&&!r&&i==="desktop")for(const b of["desktop","tablet"])y[b]||t.push(G[b]);else y[i]||t.push(h(G,$))};return x?(_("desktop",v,!0),_("tablet",x,!0),_("phone",u??x,!0)):(_("desktop",v,!1),_("phone",u??v,!1)),v&&(d[m.fit]=v),x&&(d[m.fitTablet]=x),u&&(d[m.fitPhone]=u),g!==void 0&&(d[m.min]=g),A!==void 0&&(d[m.minTablet]=A),I!==void 0&&(d[m.minPhone]=I),!p&&(x||A!==void 0)&&(d[m.edge]=""),t.length===0&&Object.keys(d).length===0?null:{className:[oe,...t].join(" "),style:f,attrs:d}}function ue(e){if(l(e.maxWidth?.desktop)!==void 0)return!0;const n=S(e.widthFit?.desktop);return n==="fill"||n==="fixed"}function _e(e){return["desktop","tablet","phone"].some(o=>{const p=S(e.widthFit?.[o]);return p==="fixed"||p==="fill"||l(e.minWidth?.[o])!==void 0})}function Se(e){const n={};for(const o of te){const p=e[o],k=e[z(o)],s=e[R(o)];(p!==void 0||k!==void 0||s!==void 0)&&(n[o]={desktop:p,tablet:k,phone:s});const a=Y(o),t={desktop:e[a],tablet:e[z(a)],phone:e[R(a)]};(t.desktop!==void 0||t.tablet!==void 0||t.phone!==void 0)&&((n.units??={})[o]=t)}return n}export{V as BLOCK_LENGTH_KEYS,oe as BLOCK_SIZE_CLASS,m as TEXT_FIT_ATTR,_e as blockCanWidenPastCell,be as blockFillInCellClass,Y as blockLengthUnitKey,ue as blockSetsItsWidth,ke as blockSizeOf,Se as blockSizeValuesOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BUTTON_PAD_KEYS as
|
|
1
|
+
import{BUTTON_PAD_KEYS as d,buttonBorderOf as T,buttonFillOpacityOf as _,buttonPadSidesOf as h,viewKeyAt as O}from"efficient-easel/draw";import{BUTTON_PAD_UNIT_KEY as a,lengthOf as x}from"efficient-easel/screen/lib/content/length-units";import{finiteNumber as y}from"../../../format/lib/finite-number.js";import{nonEmptyString as c}from"../../../format/lib/non-empty-string.js";import{padSideAttrs as N}from"./section-padding.js";import{cornerSidesShorthand as g,normalizeCornerSides as U}from"../../../format/lib/content/section-corners.js";import{cssLengthOf as A,storedUnit as B}from"../../../format/lib/content/css-length.js";const C="px-6 py-4",I=4,u=o=>{const t=new RegExp(`\\bp${o}-(?:\\[(\\d+)px\\]|(\\d+))`).exec(C);if(!t)throw new Error(`BUTTON_PAD_CLASSES has no p${o}`);return t[1]!==void 0?Number(t[1]):Number(t[2])*I},w={top:u("y"),right:u("x"),bottom:u("y"),left:u("x")},f="var(--btn)";function E(o){const t=o.variant==="ghost",n=_(o.buttonFillOpacity),r=T(o.buttonBorder),e=c(o.buttonColor);return{fillOpacity:n??(t?0:100),border:{width:r?.width??1,color:r?.color??e??(t?"currentColor":f)},changed:n!==void 0||r!==void 0}}function F(o){const t=E(o);if(!t.changed)return null;const n=c(o.buttonColor)??f;return{background:t.fillOpacity===0?"transparent":t.fillOpacity===100?n:`color-mix(in srgb, ${n} ${t.fillOpacity}%, transparent)`,borderWidth:x(t.border.width,B(o.buttonBorderUnit)),borderStyle:"solid",borderColor:t.border.color}}const P="var(--sf-button-radius, 0)";function K(o){const t=y(o.buttonCorners),n=U(o.buttonCornerSides);if(t===void 0&&n===null)return null;const r=t===void 0?P:A(Math.max(0,t),o.buttonCornersUnit);return{borderRadius:n===null?r:g(r,n)}}function Y(o){const t=(i,l)=>o[O(i,l)],n=i=>h({top:t(d.top,i),right:t(d.right,i),bottom:t(d.bottom,i),left:t(d.left,i)})??{},r={desktop:t(a,"desktop"),tablet:t(a,"tablet"),phone:t(a,"mobile")},{classes:e,style:s}=N(n("desktop"),n("mobile"),n("tablet"),void 0,r);return Object.keys(s).length?{className:e.join(" "),style:s}:null}const p="upper";function v(o,t,n){const r=o&&typeof o=="object"?o:{},e=c(r.textStyle),s=e?c(t?.find(S=>S?.id===e)?.name):void 0,i=e?/^(heading|body)-(\d+)$/.exec(e):null,l=e?s||(i?n.styleName({kind:i[1],n:Number(i[2])}):e):n.noStyle,{cases:b}=n,m=c(r.case)??p;return`${l} · ${b[m]??b[p]}`}export{w as BUTTON_PAD_BUILT_IN,C as BUTTON_PAD_CLASSES,d as BUTTON_PAD_KEYS,p as BUTTON_WORDS_BUILT_IN_CASE,f as SITE_BUTTON_FILL,K as buttonCornersStyle,E as buttonLook,Y as buttonPadAttrs,F as buttonPaint,v as buttonWordsSummary};
|