efficient-web-builder 58.0.0 → 59.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/editor/lib/document/ColourControl.js +1 -1
- package/dist/editor/lib/document/blocks/general/CardList/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Cards/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Chart/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Countdown/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Mockup/fields.js +2 -2
- package/dist/editor/lib/document/card-row-fields.d.ts +2 -1
- package/dist/editor/lib/document/card-row-fields.js +1 -1
- package/dist/editor/lib/document/controls.d.ts +12 -6
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/sections/text-layouts.js +1 -1
- package/dist/format/lib/content/box-background.d.ts +2 -2
- package/dist/format/lib/content/box-background.js +1 -1
- package/dist/format/lib/content/card-columns.d.ts +1 -0
- package/dist/format/lib/content/card-columns.js +1 -0
- package/dist/format/lib/content/card-place.js +1 -1
- package/dist/format/lib/content/card-state.d.ts +17 -0
- package/dist/format/lib/content/card-state.js +1 -1
- package/dist/format/lib/content/card-template.js +1 -1
- package/dist/format/lib/content/gallery-layout.d.ts +13 -1
- package/dist/format/lib/content/gallery-layout.js +1 -1
- package/dist/format/lib/content/page-background.js +1 -1
- package/dist/format/lib/content/section-background.js +1 -1
- package/dist/format/lib/document/blocks/general/Chart/meta.d.ts +1 -0
- package/dist/format/lib/document/blocks/general/Chart/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/Countdown/meta.d.ts +1 -0
- package/dist/format/lib/document/blocks/general/Countdown/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/Mockup/meta.d.ts +1 -0
- package/dist/format/lib/document/blocks/general/Mockup/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/text-part-shapes.json +10 -0
- package/dist/format/lib/document/card-row-keys.d.ts +14 -0
- package/dist/format/lib/document/card-row-keys.js +1 -0
- package/dist/format/lib/document/cards-template-on-read.d.ts +1 -1
- package/dist/format/lib/document/cards-template-on-read.js +1 -1
- package/dist/format/lib/document/neutralization-contracts.js +1 -1
- package/dist/format/lib/document/part-inks.d.ts +5 -2
- package/dist/format/lib/document/part-inks.js +1 -1
- package/dist/format/lib/document/theme-slots.d.ts +20 -0
- package/dist/format/lib/document/theme-slots.js +1 -0
- package/dist/format/lib/editor-words-catalogue.d.ts +3 -0
- package/dist/format/lib/editor-words-catalogue.js +1 -1
- package/dist/format/lib/theme.d.ts +1 -0
- package/dist/format/lib/theme.js +4 -4
- package/dist/render/components/Cards.d.ts +2 -1
- package/dist/render/components/Cards.js +1 -1
- package/dist/render/components/ChartSection.d.ts +2 -1
- package/dist/render/components/ChartSection.js +1 -1
- package/dist/render/components/Countdown.d.ts +2 -1
- package/dist/render/components/Countdown.js +1 -1
- package/dist/render/components/FeaturedCover.d.ts +2 -1
- package/dist/render/components/FeaturedCover.js +1 -1
- package/dist/render/components/KeyFeatures.js +1 -1
- package/dist/render/components/MockupSection.d.ts +2 -1
- package/dist/render/components/MockupSection.js +1 -1
- package/dist/render/lib/document/blocks/general/CardList/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Cards/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Chart/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Countdown/render.js +1 -1
- package/dist/render/lib/document/blocks/general/FeaturedCover/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Mockup/render.js +2 -2
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +3 -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-cards.d.ts +3 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-promo.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-promo.js +1 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-proof.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-proof.js +1 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-stats.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
- package/dist/render/lib/document/head-core-boxes.js +1 -1
- package/dist/render/lib/sections/section-to-box.js +1 -1
- package/package.json +3 -3
- package/dist/editor/lib/document/theme-swatches.d.ts +0 -3
- package/dist/editor/lib/document/theme-swatches.js +0 -1
package/dist/format/lib/theme.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import{contrastRatio as
|
|
1
|
+
import{contrastRatio as Z,hexToRgb as d,parseHexColor as s,readableInk as q,relativeLuminance as p}from"efficient-shell/format";const J="storefront-theme",$e="sf:theme-mode",Fe="sf:theme-switch",Ue="hide",Ge="light",Ye=!1,D=7,H=18;function Q(e){return e>=D&&e<H}function ze(e){const{mode:t,override:n,switchShown:r,hour:o}=e;return r&&(n==="light"||n==="dark")?n:t==="auto"?Q(o)?"light":"dark":t==="light"?"light":"dark"}function Be(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(J)});
|
|
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 >= ${D} && h < ${H}) ? '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 s={background:"#0a0a0a",surface:"#131313",line:"#2a2a2a",muted:"#9a9388"},J=[{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"}],Q={selected:0,themes:J};function H(e){return!e||!Array.isArray(e.themes)||e.themes.length===0?{...Q}:{selected:Math.min(Math.max(0,e.selected??0),e.themes.length-1),themes:e.themes}}function p(e,t,n){const r=h(e),o=h(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 v={light:"#ffffff",dark:"#0a0a0a"},ze=["light","dark"];function Be(e,t){const n=v[t],r=t==="light"?"#ffffff":"#000000";return{text:n,accent:n,background:e,surface:p(e,r,.1),line:p(e,r,.22),muted:p(n,e,.35),brandInk:t}}function u(e){const t=H(e);return t.themes[t.selected]}function l(e){return{text:e.text,accent:e.accent,background:e.background||s.background,surface:e.surface||s.surface,line:e.line||s.line,muted:e.muted||s.muted}}function Xe(e){return{fill:l(e).background,accent:e.accent}}const ee=.4,te=4.5,ne=3,We={good:"Good","large-only":"Large text only",hard:"Hard to read"};function Ke(e){return e>=te?"good":e>=ne?"large-only":"hard"}const re=["#000000","#ffffff"];function d(e){return V(e,re)}const oe=[.25,.4,.55];function je(e){const t=h(e);return t===null?[]:oe.map(n=>"#"+[t.r,t.g,t.b].map(r=>Math.round(r*(1-n)).toString(16).padStart(2,"0")).join(""))}function Ve(e){const t=u(e),n={"--theme-fg":t.text},r=x(t.text);return(r===null||r>=ee)&&(n["--overlay-fg"]=t.text),n}const ce=82;function _(e){return`color-mix(in srgb, ${e} ${ce}%, #000)`}function Ze(e){const t=u(e);return{"--theme-accent":t.accent,"--theme-accent-2":_(t.accent),"--theme-accent-ink":d(t.accent)}}function E(e){const t=e?.button;return t&&f(t)===t.toLowerCase()?t.toLowerCase():null}function qe(e){const t=u(e),n=E(t),r=N(t);if(n===null&&r===null)return{};const o={};return n!==null&&(o["--theme-btn"]=n,o["--theme-btn-2"]=_(n)),o["--theme-btn-ink"]=r??d(n),o}function N(e){const t=e?.buttonInk;return t&&f(t)===t.toLowerCase()?t.toLowerCase():null}function ie(e,t){return N(e)??d(E(e)??t)}function Je(e){const t=u(e);return{fill:E(t)??t.accent.toLowerCase(),ink:ie(t,t.accent)}}function Qe(e){const t={};return H(e).themes.forEach((n,r)=>{const o=l(n);t[`--theme-preset-${r}-accent`]=o.accent,t[`--theme-preset-${r}-accent-2`]=_(o.accent),t[`--theme-preset-${r}-accent-ink`]=d(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 S=e=>{const t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4},A=e=>255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055);function O([e,t,n]){const[r,o,c]=[S(e),S(t),S(n)],i=Math.cbrt(.4122214708*r+.5363325363*o+.0514459929*c),a=Math.cbrt(.2119034982*r+.6806995451*o+.1073969566*c),m=Math.cbrt(.0883024619*r+.2817188376*o+.6299787005*c);return[.2104542553*i+.793617785*a-.0040720468*m,1.9779984951*i-2.428592205*a+.4505937099*m,.0259040371*i+.7827717662*a-.808675766*m]}function se([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[A(4.0767416621*r-3.3077115913*o+.2309699292*c),A(-1.2684380046*r+2.6097574011*o-.3413193965*c),A(-.0041960863*r-.7034186147*o+1.707614701*c)]}const T=e=>{const t=h(e);return t===null?[0,0,0]:[t.r,t.g,t.b]},k=(e,t,n)=>[e[0]*n+t[0]*(1-n),e[1]*n+t[1]*(1-n),e[2]*n+t[2]*(1-n)],L=e=>`#${e.map(t=>Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")).join("")}`,P=e=>k(T(e.surface),T(e.line),.6);function ve(e){return L(P(l(e)))}function $(e){const t=l(e);return L(se(k(O(P(t)),O(T(t.text)),.92)))}function et(e){return{...e,background:$(e)}}function tt(e,t){const n=e[t];if(!n)return-1;const r=$(n);return e.findIndex((o,c)=>c!==t&&f(o.background??"")===r)}const ae=1;function ue(e,t){const n=(e??[]).flatMap((r,o)=>{const c=x(r.background??""),i=x(r.text??"");return c!==null&&i!==null&&c<i?[o]:[]});return n.find(r=>r!==t)??n[0]??ae}function nt(e){return ue(e?.themes,e?.selected)}const rt=["--theme-bg","--theme-surface","--theme-surface-2","--theme-line","--theme-muted"];function ot(e){const t=l(u(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!==s.surface||t.line!==s.line)&&(r["--theme-surface-2"]=n),r}const le=["heading","body","label"],ct={heading:"Headings",body:"Body",label:"Labels"};function it(e){if(!e)return null;for(const t of le)if(e.includes(`--size-${t}`))return t;return/--size-heading(Large|Medium|Small)/.test(e)?"heading":null}const F=["headingLarge","headingMedium","headingSmall","accent","body","label"],st={headingLarge:"heading",headingMedium:"heading",headingSmall:"heading",accent:"heading",body:"body",label:"label"},at={headingLarge:null,headingMedium:null,headingSmall:null,accent:null,body:null,label:null},he=8,fe=200;function de(e){if(typeof e!="number"||!Number.isFinite(e))return null;const t=Math.round(e);return t>=he&&t<=fe?t:null}function ge(e){const t={};for(const n of F)t[n]=de(e?.[n]);return t}function ut(e){const t=ge(e),n={};for(const r of F){const o=t[r];o!==null&&(n[`--size-${r}`]=`${o}px`)}return n}const me=["square","small","large"],xe="small";function pe(e){return me.includes(e??"")?e:xe}function lt(e){return G(Ee[pe(e)])}const b=0,_e=40,Ee={square:0,small:null,large:16},U={"--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(_e,Math.max(b,Math.round(t))):null}function G(e){const t=C(e);return t===null?{}:Object.fromEntries(Object.entries(U).map(([n,r])=>{const o=t*r/16;return[n,o===0?"0":`${o}rem`]}))}function ht(e){return(C(e)??b)*U["--sf-button-radius"]}function ft(e){return G(C(e)??b)}const Se=["none","soft","lifted"],Ae="soft",Y="none",Te=["tight","normal","roomy"],be="normal",Ce="normal",Ie=["none","lift","highlight"],we="lift",Me="highlight",z="#141416";function B(e){return Se.includes(e??"")?e:Ae}function ye(e){return Te.includes(e??"")?e:be}function X(e){return Ie.includes(e??"")?e:we}function Re(e){return e&&f(e)===e.toLowerCase()?e.toLowerCase():z}function dt(e){const t=B(e);return t===Y?void 0:t}function gt(e){const t=ye(e);return t===Ce?void 0:t}function mt(e){const t=X(e);return t===Me?void 0:t}function xt(e,t,n){const r=Re(t);return r===z?{}:B(e)!==Y||X(n)==="lift"?{"--sf-shadow-color":r}:{}}const De=["normal","tight","compressed"],W="normal";function K(e){return De.includes(e??"")?e:W}function pt(e){const t=K(e);return t===W?void 0:t}function _t(e){switch(K(e)){case"tight":return{lineHeight:.95,letterSpacing:-.01};case"compressed":return{lineHeight:.86,letterSpacing:-.01};default:return{}}}const Et=["authored","sentence"],St={case:"authored",weight:null,weightStrong:null,italicStrong:null,maxPx:null,weight2:null,weight3:null,case2:"authored",case3:"authored"},I=100,w=900,He=24,Ne=200;function g(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=g(e?.weight,I,w),n=e?.case==="sentence"?"sentence":"authored",r=c=>c==null?t:g(c,I,w),o=c=>c==="sentence"?"sentence":c==="authored"?"authored":n;return{case:n,weight:t,weightStrong:g(e?.weightStrong,I,w),italicStrong:typeof e?.italicStrong=="boolean"?e.italicStrong:null,maxPx:g(e?.maxPx,He,Ne),weight2:r(e?.weight2),weight3:r(e?.weight3),case2:o(e?.case2),case3:o(e?.case3)}}function At(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 Tt(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 bt(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 Oe(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 Ct(e){return Oe(e?.[y])[y]}export{oe as ACCENT_DARKEN_STEPS,ze as BRAND_INKS,Te as CARD_GAPS,Se as CARD_SHADOWS,_e as CORNER_RADIUS_MAX,b as CORNER_RADIUS_MIN,me as CORNER_STYLES,Ee as CORNER_STYLE_TO_PX,be as DEFAULT_CARD_GAP,Ae as DEFAULT_CARD_SHADOW,xe as DEFAULT_CORNER_STYLE,W as DEFAULT_HEADING_COMPRESSION,St as DEFAULT_HEADING_TYPOGRAPHY,we as DEFAULT_HOVER_EFFECT,z as DEFAULT_SHADOW_COLOR,at as DEFAULT_SIZES,s as DEFAULT_SURFACES,Ue as DEFAULT_SWITCH_SHOWN,J as DEFAULT_THEMES,Fe as DEFAULT_THEME_MODE,Q as DEFAULT_THEME_VALUE,We as GRADE_LABEL,Et as HEADING_CASES,De as HEADING_COMPRESSIONS,Ne as HEADING_MAX_PX_MAX,He as HEADING_MAX_PX_MIN,w as HEADING_WEIGHT_MAX,I as HEADING_WEIGHT_MIN,Ie as HOVER_EFFECTS,Ce as IDENTITY_CARD_GAP,Y as IDENTITY_CARD_SHADOW,Me as IDENTITY_HOVER_EFFECT,te as READABILITY_AA,ne as READABILITY_AA_LARGE,st as SCALE_OF_STEP,y as SITE_THEME_KEY,F as SIZE_STEPS,fe as TEXT_SIZE_MAX,he as TEXT_SIZE_MIN,D as THEME_DAY_END_HOUR,R as THEME_DAY_START_HOUR,Le as THEME_MODE_KEY,Z as THEME_STORAGE_KEY,rt as THEME_SURFACE_KEYS,$e as THEME_SWITCH_HIDE,Pe as THEME_SWITCH_KEY,le as TYPE_GROUPS,ct as TYPE_GROUP_LABELS,d as accentInk,et as bandPresetFor,tt as bandPresetIndex,Be as brandTheme,Ye as buildThemeBootScript,gt as cardGapAttr,dt as cardShadowAttr,_t as compressionMetrics,j as contrastRatio,G as cornerRadiusTokens,lt as cornerStyleTokens,nt as darkBandIndex,ue as darkPresetIndex,je as darkerAccents,Ke as gradeContrast,pt as headingCompressionAttr,Tt as headingTypographyFromRow,At as headingTypographyStyle,bt as headingTypographyToRow,mt as hoverEffectAttr,q as isDayHour,ye as normalizeCardGap,B as normalizeCardShadow,C as normalizeCornerRadius,pe as normalizeCornerStyle,K as normalizeHeadingCompression,M as normalizeHeadingTypography,X as normalizeHoverEffect,Re as normalizeShadowColor,de as normalizeSize,ge as normalizeSizes,H as normalizeTheme,l as normalizeThemeColors,Ge as resolveTheme,ie as resolvedButtonInk,$ as sectionBandTone,u as selectedThemeColors,xt as shadowColorTokens,Je as siteButtonPaint,ht as siteButtonRadiusPx,ft as siteCornerRadiusTokens,Oe as siteThemeMetadata,Ct as siteThemeOf,ve as surfaceTwoTone,Ze as themeAccentStyle,E as themeButtonColour,N as themeButtonInk,qe as themeButtonStyle,Ve as themeColorStyle,Qe as themePresetAccentVars,ot as themeSurfaceStyle,Xe as themeSwatchColors,it as typeScaleGroupOfClassName,ut as typeSizesStyle};
|
|
18
|
+
`}const l={background:"#0a0a0a",surface:"#131313",line:"#2a2a2a",muted:"#9a9388"},v=[{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"}],ee={selected:0,themes:v};function N(e){return!e||!Array.isArray(e.themes)||e.themes.length===0?{...ee}:{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 te={light:"#ffffff",dark:"#0a0a0a"},Xe=["light","dark"];function We(e,t){const n=te[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 h(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 Ke(e){return{fill:u(e).background,accent:e.accent}}const ne=.4,re=4.5,oe=3,je={good:"Good","large-only":"Large text only",hard:"Hard to read"};function Ve(e){return e>=re?"good":e>=oe?"large-only":"hard"}const ce=["#000000","#ffffff"];function g(e){return q(e,ce)}const ie=[.25,.4,.55];function Ze(e){const t=d(e);return t===null?[]:ie.map(n=>"#"+[t.r,t.g,t.b].map(r=>Math.round(r*(1-n)).toString(16).padStart(2,"0")).join(""))}function qe(e){const t=h(e),n={"--theme-fg":t.text},r=p(t.text);return(r===null||r>=ne)&&(n["--overlay-fg"]=t.text),n}const se=82;function E(e){return`color-mix(in srgb, ${e} ${se}%, #000)`}function Je(e){const t=h(e);return{"--theme-accent":t.accent,"--theme-accent-2":E(t.accent),"--theme-accent-ink":g(t.accent)}}function S(e){const t=e?.button;return t&&s(t)===t.toLowerCase()?t.toLowerCase():null}function Qe(e){const t=h(e),n=S(t),r=O(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??g(n),o}function O(e){const t=e?.buttonInk;return t&&s(t)===t.toLowerCase()?t.toLowerCase():null}function ae(e,t){return O(e)??g(S(e)??t)}function ve(e){const t=h(e);return{fill:S(t)??t.accent.toLowerCase(),ink:ae(t,t.accent)}}function et(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`]=g(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 k([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),f=Math.cbrt(.0883024619*r+.2817188376*o+.6299787005*c);return[.2104542553*i+.793617785*a-.0040720468*f,1.9779984951*i-2.428592205*a+.4505937099*f,.0259040371*i+.7827717662*a-.808675766*f]}function ue([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]},L=(e,t,n)=>[e[0]*n+t[0]*(1-n),e[1]*n+t[1]*(1-n),e[2]*n+t[2]*(1-n)],P=e=>`#${e.map(t=>Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")).join("")}`,$=e=>L(b(e.surface),b(e.line),.6);function tt(e){return P($(u(e)))}function F(e){const t=u(e);return P(ue(L(k($(t)),k(b(t.text)),.92)))}function nt(e){return{...e,background:F(e)}}function U(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,f)=>{if(f===t)return!1;const x=u(a);return s(x.background)!==c?!1:!r||s(x.text??"")===s(i.text??"")&&s(x.accent??"")===s(i.accent??"")})}function rt(e,t){return U(e,t,F,!1)}function ot(e,t){return U(e,t,n=>s(n.surface??""),!0)}const le=1;function fe(e,t){const n=(e??[]).flatMap((r,o)=>{const c=p(r.background??""),i=p(r.text??"");return c!==null&&i!==null&&c<i?[o]:[]});return n.find(r=>r!==t)??n[0]??le}function ct(e){return fe(e?.themes,e?.selected)}const it=["--theme-bg","--theme-surface","--theme-surface-2","--theme-line","--theme-muted"];function st(e){const t=u(h(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 he=["heading","body","label"],at={heading:"Headings",body:"Body",label:"Labels"};function ut(e){if(!e)return null;for(const t of he)if(e.includes(`--size-${t}`))return t;return/--size-heading(Large|Medium|Small)/.test(e)?"heading":null}const G=["headingLarge","headingMedium","headingSmall","accent","body","label"],lt={headingLarge:"heading",headingMedium:"heading",headingSmall:"heading",accent:"heading",body:"body",label:"label"},ft={headingLarge:null,headingMedium:null,headingSmall:null,accent:null,body:null,label:null},de=8,ge=200;function me(e){if(typeof e!="number"||!Number.isFinite(e))return null;const t=Math.round(e);return t>=de&&t<=ge?t:null}function xe(e){const t={};for(const n of G)t[n]=me(e?.[n]);return t}function ht(e){const t=xe(e),n={};for(const r of G){const o=t[r];o!==null&&(n[`--size-${r}`]=`${o}px`)}return n}const pe=["square","small","large"],_e="small";function Ee(e){return pe.includes(e??"")?e:_e}function dt(e){return z(Ae[Ee(e)])}const C=0,Se=40,Ae={square:0,small:null,large:16},Y={"--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 I(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(Se,Math.max(C,Math.round(t))):null}function z(e){const t=I(e);return t===null?{}:Object.fromEntries(Object.entries(Y).map(([n,r])=>{const o=t*r/16;return[n,o===0?"0":`${o}rem`]}))}function gt(e){return(I(e)??C)*Y["--sf-button-radius"]}function mt(e){return z(I(e)??C)}const Te=["none","soft","lifted"],be="soft",B="none",Ce=["tight","normal","roomy"],Ie="normal",we="normal",Me=["none","lift","highlight"],ye="lift",Re="highlight",X="#141416";function W(e){return Te.includes(e??"")?e:be}function De(e){return Ce.includes(e??"")?e:Ie}function K(e){return Me.includes(e??"")?e:ye}function He(e){return e&&s(e)===e.toLowerCase()?e.toLowerCase():X}function xt(e){const t=W(e);return t===B?void 0:t}function pt(e){const t=De(e);return t===we?void 0:t}function _t(e){const t=K(e);return t===Re?void 0:t}function Et(e,t,n){const r=He(t);return r===X?{}:W(e)!==B||K(n)==="lift"?{"--sf-shadow-color":r}:{}}const Ne=["normal","tight","compressed"],j="normal";function V(e){return Ne.includes(e??"")?e:j}function St(e){const t=V(e);return t===j?void 0:t}function At(e){switch(V(e)){case"tight":return{lineHeight:.95,letterSpacing:-.01};case"compressed":return{lineHeight:.86,letterSpacing:-.01};default:return{}}}const Tt=["authored","sentence"],bt={case:"authored",weight:null,weightStrong:null,italicStrong:null,maxPx:null,weight2:null,weight3:null,case2:"authored",case3:"authored"},w=100,M=900,Oe=24,ke=200;function m(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=m(e?.weight,w,M),n=e?.case==="sentence"?"sentence":"authored",r=c=>c==null?t:m(c,w,M),o=c=>c==="sentence"?"sentence":c==="authored"?"authored":n;return{case:n,weight:t,weightStrong:m(e?.weightStrong,w,M),italicStrong:typeof e?.italicStrong=="boolean"?e.italicStrong:null,maxPx:m(e?.maxPx,Oe,ke),weight2:r(e?.weight2),weight3:r(e?.weight3),case2:o(e?.case2),case3:o(e?.case3)}}function Ct(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 It(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 wt(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 R="siteTheme";function Le(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{[R]:{selected:n,themes:t.themes}}}function Mt(e){return Le(e?.[R])[R]}export{ie as ACCENT_DARKEN_STEPS,Xe as BRAND_INKS,Ce as CARD_GAPS,Te as CARD_SHADOWS,Se as CORNER_RADIUS_MAX,C as CORNER_RADIUS_MIN,pe as CORNER_STYLES,Ae as CORNER_STYLE_TO_PX,Ie as DEFAULT_CARD_GAP,be as DEFAULT_CARD_SHADOW,_e as DEFAULT_CORNER_STYLE,j as DEFAULT_HEADING_COMPRESSION,bt as DEFAULT_HEADING_TYPOGRAPHY,ye as DEFAULT_HOVER_EFFECT,X as DEFAULT_SHADOW_COLOR,ft as DEFAULT_SIZES,l as DEFAULT_SURFACES,Ye as DEFAULT_SWITCH_SHOWN,v as DEFAULT_THEMES,Ge as DEFAULT_THEME_MODE,ee as DEFAULT_THEME_VALUE,je as GRADE_LABEL,Tt as HEADING_CASES,Ne as HEADING_COMPRESSIONS,ke as HEADING_MAX_PX_MAX,Oe as HEADING_MAX_PX_MIN,M as HEADING_WEIGHT_MAX,w as HEADING_WEIGHT_MIN,Me as HOVER_EFFECTS,we as IDENTITY_CARD_GAP,B as IDENTITY_CARD_SHADOW,Re as IDENTITY_HOVER_EFFECT,re as READABILITY_AA,oe as READABILITY_AA_LARGE,lt as SCALE_OF_STEP,R as SITE_THEME_KEY,G as SIZE_STEPS,ge as TEXT_SIZE_MAX,de as TEXT_SIZE_MIN,H as THEME_DAY_END_HOUR,D as THEME_DAY_START_HOUR,$e as THEME_MODE_KEY,J as THEME_STORAGE_KEY,it as THEME_SURFACE_KEYS,Ue as THEME_SWITCH_HIDE,Fe as THEME_SWITCH_KEY,he as TYPE_GROUPS,at as TYPE_GROUP_LABELS,g as accentInk,nt as bandPresetFor,rt as bandPresetIndex,We as brandTheme,Be as buildThemeBootScript,pt as cardGapAttr,xt as cardShadowAttr,At as compressionMetrics,Z as contrastRatio,z as cornerRadiusTokens,dt as cornerStyleTokens,ct as darkBandIndex,fe as darkPresetIndex,Ze as darkerAccents,Ve as gradeContrast,St as headingCompressionAttr,It as headingTypographyFromRow,Ct as headingTypographyStyle,wt as headingTypographyToRow,_t as hoverEffectAttr,Q as isDayHour,De as normalizeCardGap,W as normalizeCardShadow,I as normalizeCornerRadius,Ee as normalizeCornerStyle,V as normalizeHeadingCompression,y as normalizeHeadingTypography,K as normalizeHoverEffect,He as normalizeShadowColor,me as normalizeSize,xe as normalizeSizes,N as normalizeTheme,u as normalizeThemeColors,ze as resolveTheme,ae as resolvedButtonInk,F as sectionBandTone,h as selectedThemeColors,Et as shadowColorTokens,ve as siteButtonPaint,gt as siteButtonRadiusPx,mt as siteCornerRadiusTokens,Le as siteThemeMetadata,Mt as siteThemeOf,ot as surfacePresetIndex,tt as surfaceTwoTone,Je as themeAccentStyle,S as themeButtonColour,O as themeButtonInk,Qe as themeButtonStyle,qe as themeColorStyle,et as themePresetAccentVars,st as themeSurfaceStyle,Ke as themeSwatchColors,ut as typeScaleGroupOfClassName,ht as typeSizesStyle};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import type { SectionEyebrowLook } from "../../format/lib/sections/section-eyebrow-look.js";
|
|
3
|
+
import { cardColumns } from "../../format/lib/content/card-columns.js";
|
|
3
4
|
export interface CardItem {
|
|
4
5
|
title?: string;
|
|
5
6
|
body?: string;
|
|
@@ -14,5 +15,5 @@ export interface CardsProps {
|
|
|
14
15
|
cards?: ReactNode;
|
|
15
16
|
}
|
|
16
17
|
export declare function cardGridCornerClasses(index: number, count: number, columns: number | undefined): string;
|
|
17
|
-
export
|
|
18
|
+
export { cardColumns };
|
|
18
19
|
export default function Cards({ look, eyebrow, title, columns, omitHead, editing, cards, }?: CardsProps): import("react").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as n,Fragment as u,jsxs as
|
|
1
|
+
import{jsx as n,Fragment as u,jsxs as d}from"react/jsx-runtime";import{HideTaker as b}from"./ViewHideRoot.js";import f from"./SectionEyebrow.js";import{InsideSiteColumn as c}from"./SiteGutterFrame.js";import{renderHeadline as g}from"./goldPhrases.js";import{cardColumns as m}from"../../format/lib/content/card-columns.js";const p={headingMediumUpTo800:"max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",headingMedium:"text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))]"},v="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[72px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",w="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] pt-0 pb-[72px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",M="sf-card grid grid-cols-1 gap-px border border-line bg-line view-tablet:[grid-template-columns:repeat(var(--cd-cols),minmax(0,1fr))]",t={phone:{tl:"max-view-tablet:[border-top-left-radius:inherit]",tr:"max-view-tablet:[border-top-right-radius:inherit]",bl:"max-view-tablet:[border-bottom-left-radius:inherit]",br:"max-view-tablet:[border-bottom-right-radius:inherit]"},wide:{tl:"view-tablet:[border-top-left-radius:inherit]",tr:"view-tablet:[border-top-right-radius:inherit]",bl:"view-tablet:[border-bottom-left-radius:inherit]",br:"view-tablet:[border-bottom-right-radius:inherit]"}};function I(r,i,o){const a=m(o),s=i-1,l=Math.floor(s/a)*a,e=[];return r===0&&e.push(t.phone.tl,t.phone.tr,t.wide.tl),r===s&&e.push(t.phone.bl,t.phone.br),r===a-1&&i>=a&&e.push(t.wide.tr),r===l&&e.push(t.wide.bl),r===s&&i%a===0&&e.push(t.wide.br),e.join(" ")}function E({look:r,eyebrow:i,title:o,columns:a,omitHead:s=!1,editing:l=!1,cards:e}={}){const h=m(a),x=!!(i??"").trim()||!!(o??"").trim();return!l&&!x&&!e?null:n(b,{as:"section",className:"relative z-[2] bg-surface",children:d("div",{className:s?w:v,children:[s?null:d(u,{children:[(i??"").trim()&&n(f,{text:i??"",look:r,className:"mb-4 block"}),(o??"").trim()&&n("h2",{className:`mb-9 font-heading2 ${p.headingMedium} font-medium uppercase leading-none tracking-[-0.02em] text-fg max-view-wide:mb-7 ${p.headingMediumUpTo800}`,children:g(o??"",!1)})]}),e?n("div",{className:M,style:{"--cd-cols":String(h),overflowY:"visible"},children:n(c,{children:e})}):null]})})}export{m as cardColumns,I as cardGridCornerClasses,E as default};
|
|
@@ -12,5 +12,6 @@ export interface ChartSectionProps {
|
|
|
12
12
|
valueSuffix?: string;
|
|
13
13
|
caption?: string;
|
|
14
14
|
editing?: boolean;
|
|
15
|
+
omitHead?: boolean;
|
|
15
16
|
}
|
|
16
|
-
export default function ChartSection({ eyebrow, title, body, chartStyle, items, valueSuffix, caption, editing, }?: ChartSectionProps): import("react").JSX.Element | null;
|
|
17
|
+
export default function ChartSection({ eyebrow, title, body, chartStyle, items, valueSuffix, caption, editing, omitHead, }?: ChartSectionProps): import("react").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,jsxs as x}from"react/jsx-runtime";import{HideTaker as $}from"./ViewHideRoot.js";import{renderGold as v,renderHeadline as k}from"./goldPhrases.js";const f={headingMediumUpTo800:"max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",headingMedium:"text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))]",bodySmall:"text-[length:var(--size-body,15px)]",bodyLarge:"text-[length:var(--size-body,16px)]",labelSmall:"text-[length:var(--size-label,10px)]",label:"text-[length:var(--size-label,11px)]",labelLarge:"text-[length:var(--size-label,12px)]"};function b(a){return Number.isInteger(a)?String(a):String(Math.round(a*10)/10)}const y=[100,70,46,30,19,12];function N(a){return`color-mix(in srgb, var(--accent) ${y[a%y.length]}%, var(--bg))`}function w({data:a,suffix:d}){const u=Math.max(...a.map(c=>c.value),0)||1;return e("div",{className:"flex w-full flex-col gap-6",children:a.map((c,t)=>x("div",{children:[x("div",{className:"mb-2 flex items-baseline justify-between gap-4",children:[e("span",{className:`font-mono ${f.label} uppercase tracking-[0.14em] text-fg/60`,children:v(c.label)}),x("span",{className:`font-display ${f.bodyLarge} font-medium text-fg`,children:[b(c.value),d]})]}),e("div",{className:"h-[10px] border border-line bg-bg",children:e("div",{className:"h-full bg-accent",style:{width:`${Math.max(c.value/u*100,c.value===0?0:2)}%`}})})]},t))})}function M({data:a,suffix:d}){const t={l:42,r:42,t:36,b:38},p=640-t.l-t.r,r=300-t.t-t.b,n=Math.max(...a.map(l=>l.value),0)||1,i=a.length>1?p/(a.length-1):0,s=a.map((l,o)=>({x:t.l+(a.length>1?o*i:p/2),y:t.t+r-l.value/n*r})),m=s.map((l,o)=>`${o===0?"M":"L"}${l.x},${l.y}`).join(" "),g=`${m} L${s[s.length-1].x},${t.t+r} L${s[0].x},${t.t+r} Z`;return x("svg",{viewBox:"0 0 640 300",className:"w-full",role:"img","aria-hidden":!0,children:[[.25,.5,.75,1].map(l=>e("line",{x1:t.l,x2:640-t.r,y1:t.t+r*(1-l),y2:t.t+r*(1-l),stroke:"var(--site-line)",strokeWidth:"1"},l)),e("line",{x1:t.l,x2:640-t.r,y1:t.t+r,y2:t.t+r,stroke:"var(--site-line)",strokeWidth:"1.5"}),e("path",{d:g,fill:"var(--accent)",opacity:"0.13"}),e("path",{d:m,fill:"none",stroke:"var(--accent)",strokeWidth:"2.5"}),s.map((l,o)=>x("g",{children:[e("circle",{cx:l.x,cy:l.y,r:"4",fill:"var(--accent)"}),x("text",{x:l.x,y:l.y-12,textAnchor:"middle",className:"font-display",fontSize:"14",fill:"var(--fg)",children:[b(a[o].value),d]}),e("text",{x:l.x,y:288,textAnchor:"middle",className:"font-mono",fontSize:"10",letterSpacing:"0.1em",fill:"var(--fg)",opacity:"0.55",children:a[o].label.toUpperCase()})]},o))]})}function S({data:a,suffix:d}){const u=a.reduce((n,i)=>n+i.value,0)||1,c=80,t=2*Math.PI*c;let p=0;const r=a.map((n,i)=>{const s=n.value/u,m={frac:s,dash:Math.max(s*t-3,0),off:p,ink:N(i)};return p+=s*t,m});return x("div",{className:"flex w-full flex-wrap items-center justify-center gap-10",children:[e("svg",{viewBox:"0 0 200 200",className:"w-[220px] max-w-full -rotate-90",role:"img","aria-hidden":!0,children:r.map((n,i)=>e("circle",{cx:"100",cy:"100",r:c,fill:"none",stroke:n.ink,strokeWidth:"34",strokeDasharray:`${n.dash} ${t-n.dash}`,strokeDashoffset:-n.off},i))}),e("ul",{className:"flex min-w-[200px] flex-1 flex-col gap-3",children:a.map((n,i)=>x("li",{className:"flex items-baseline gap-3",children:[e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] flex-shrink-0 rotate-45",style:{background:N(i)}}),e("span",{className:`flex-1 font-mono ${f.label} uppercase tracking-[0.12em] text-fg/60`,children:v(n.label)}),e("span",{className:`font-display ${f.bodySmall} font-medium text-fg`,children:d?`${b(n.value)}${d}`:`${Math.round(n.value/u*100)}%`})]},i))})]})}function z({eyebrow:a,title:d,body:u,chartStyle:c,items:t,valueSuffix:p,caption:r,editing:n=!1,omitHead:i=!1}={}){const s=(p??"").trim()===""?"":p??"",m=(t??[]).map(h=>({label:(h.label??"").trim(),value:parseFloat(h.value??"")})).filter(h=>n?!0:h.label&&Number.isFinite(h.value)).map(h=>({label:h.label||"—",value:Number.isFinite(h.value)?h.value:0})),g=!i&&(!!(a??"").trim()||!!(d??"").trim());if(!n&&!g&&m.length===0)return null;const l=c??"bars",o=m.length===0?null:l==="line"&&m.length>1?e(M,{data:m,suffix:s}):l==="donut"?e(S,{data:m,suffix:s}):e(w,{data:m,suffix:s});return i?o?e("div",{className:"w-full",children:o}):null:e($,{as:"section",className:"relative z-[2] border-y border-line bg-surface",children:x("div",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] items-center gap-14 px-[var(--sf-site-gutter,40px)] py-[76px] min-[960px]:[grid-template-columns:minmax(0,5fr)_minmax(0,7fr)] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",children:[x("div",{children:[(a??"").trim()&&e("span",{className:`inline-block bg-accent px-3.5 py-1.5 font-mono ${f.labelLarge} font-semibold uppercase tracking-[0.16em] text-bg`,children:v(a??"")}),(d??"").trim()&&e("h2",{className:`mt-5 font-heading2 ${f.headingMedium} font-medium uppercase leading-[1.04] tracking-[-0.02em] text-fg ${f.headingMediumUpTo800}`,children:k(d??"",!1)}),(u??"").trim()&&e("p",{className:`mt-5 max-w-[46ch] ${f.bodySmall} leading-relaxed text-fg/65`,children:u})]}),x("div",{children:[o,(r??"").trim()&&e("p",{className:`mt-4 font-mono ${f.labelSmall} uppercase tracking-[0.14em] text-fg/40`,children:r})]})]})})}export{z as default};
|
|
@@ -4,6 +4,7 @@ export interface CountdownProps {
|
|
|
4
4
|
endsAt?: string;
|
|
5
5
|
showUnits?: boolean;
|
|
6
6
|
editing?: boolean;
|
|
7
|
+
omitHead?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export declare function secondsLeft(endMs: number, nowMs: number): number;
|
|
9
|
-
export default function Countdown({ title, zeroText, endsAt, showUnits, editing, }?: CountdownProps): import("react").JSX.Element | null;
|
|
10
|
+
export default function Countdown({ title, zeroText, endsAt, showUnits, editing, omitHead, }?: CountdownProps): import("react").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as i,Fragment as y}from"react/jsx-runtime";import{HideTaker as M}from"./ViewHideRoot.js";import{useEffect as D,useState as u}from"react";import h from"./PartStyledKind.js";import{renderGold as I,renderHeadline as L}from"./goldPhrases.js";import{PART_KIND_ATTR as g}from"../lib/document/text-parts.js";import{TEXT_KIND_NAME as v,TEXT_KIND_VALUE as N}from"../../format/lib/sections/section-text-kinds.js";const m={headingSmall:"text-[length:min(var(--size-headingSmall,32px),var(--sf-heading-max,9999px))]",labelSmall:"text-[length:var(--size-label,11px)]",labelLarge:"text-[length:var(--size-label,12px)]"},$=24*3600*1e3,z=[{key:"hours",label:"Hours"},{key:"minutes",label:"Minutes"},{key:"seconds",label:"Seconds"}];function A(t,n){return Math.max(0,Math.ceil((t-n)/1e3))}function j(t){const n=Date.parse((t??"").trim());return Number.isFinite(n)?n:null}const H=t=>String(t).padStart(2,"0");function K({title:t,zeroText:n,endsAt:w,showUnits:b=!0,editing:o=!1,omitHead:S=!1}={}){const k=j(w),[T]=u(()=>Date.now()+$),r=k??(o?T:null),[_,d]=u(()=>Date.now());if(D(()=>{if(r===null)return;d(Date.now());const l=window.setInterval(()=>d(Date.now()),1e3);return()=>window.clearInterval(l)},[r]),r===null)return null;const a=A(r,_),s=[Math.floor(a/3600),Math.floor(a%3600/60),a%60],p=(t??"").trim(),c=(n??"").trim(),E=`${s[0]} hours, ${s[1]} minutes and ${s[2]} seconds left`,f=a===0?c&&e("p",{className:`font-heading3 ${m.headingSmall} font-medium leading-tight text-fg`,children:L(c,!1)}):i(y,{children:[e("span",{className:"sr-only",children:E}),e("div",{"aria-hidden":!0,className:"flex items-start gap-[clamp(8px,2vw,24px)]",children:z.map((l,x)=>i("div",{className:"contents",children:[x>0&&e("span",{className:"font-mono text-[length:clamp(32px,7vw,80px)] leading-none text-accent",children:":"}),i("div",{className:"flex min-w-0 flex-col items-center gap-2",children:[e(h,{kind:N,children:e("span",{"data-countdown-unit":l.key,...o?{[g]:N}:{},suppressHydrationWarning:!0,className:"font-mono text-[length:clamp(40px,8vw,96px)] font-medium leading-none tabular-nums text-fg",children:H(s[x])})}),b&&e(h,{kind:v,children:e("span",{...o?{[g]:v}:{},className:`font-mono ${m.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:l.label})})]})]},l.key))})]});return S?a===0&&!c?null:e("div",{className:"flex flex-col items-center text-center",role:"timer","aria-live":"off",children:f}):e(M,{as:"section",className:"relative z-[2] bg-bg",role:"timer","aria-live":"off",children:i("div",{className:"mx-auto flex max-w-[var(--sf-site-width,1600px)] flex-col items-center gap-4 px-[var(--sf-site-gutter,40px)] py-12 text-center max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",children:[p&&e("p",{className:`font-mono ${m.labelLarge} uppercase tracking-[0.2em] text-fg-dim`,children:I(p)}),f]})})}export{K as default,A as secondsLeft};
|
|
@@ -9,5 +9,6 @@ export interface FeaturedCoverProps {
|
|
|
9
9
|
dek?: string;
|
|
10
10
|
ctaText?: string;
|
|
11
11
|
ctaHref?: string;
|
|
12
|
+
omitHead?: boolean;
|
|
12
13
|
}
|
|
13
|
-
export default function FeaturedCover({ image, badge, imageDate, category, readLabel, date, title, dek, ctaText, ctaHref, }: FeaturedCoverProps): import("react").JSX.Element;
|
|
14
|
+
export default function FeaturedCover({ image, badge, imageDate, category, readLabel, date, title, dek, ctaText, ctaHref, omitHead, }: FeaturedCoverProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{EDITORIAL_COLUMN as
|
|
1
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{EDITORIAL_COLUMN as N}from"../../format/lib/content/page-width.js";import{HideTaker as k}from"./ViewHideRoot.js";import{Fragment as w}from"react";import{SiteLink as y}from"../lib/site-runtime.js";import{stripMarkup as z}from"../../format/lib/markup.js";import $ from"./Placeholder.js";import{renderGold as r,renderHeadline as S,splitParagraphs as j}from"./goldPhrases.js";import{scrim as h}from"../../format/lib/content/scrim.js";const l={body:"text-[length:var(--size-body,20px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"};function L({image:b,badge:i,imageDate:o,category:c,readLabel:p,date:m,title:t,dek:d,ctaText:f,ctaHref:u,omitHead:v=!1}){const x=[c?e("span",{className:"text-accent",children:r(c)}):null,p?e("span",{children:r(p)}):null,m?e("span",{children:r(m)}):null].filter(Boolean),g=a("article",{className:"sf-card relative grid grid-cols-[1.3fr_1fr] border border-line bg-[var(--card-bg)] max-view-desktop:grid-cols-1",children:[a("div",{className:"relative aspect-[5/4] overflow-hidden border-r border-line bg-surface-2 max-view-desktop:border-r-0 max-view-desktop:border-b",children:[e($,{label:"featured-cover",src:b||void 0,alt:z(t||"Cover"),sizes:"(max-width: 1100px) 100vw, 56vw"}),e("div",{className:"pointer-events-none absolute inset-0 z-[1]",style:{background:`linear-gradient(180deg, ${h(.45)} 0%, transparent 30%, transparent 70%, ${h(.55)} 100%)`}}),i&&e("span",{className:`absolute left-6 top-6 z-[2] bg-accent px-3 py-2 font-mono ${l.labelSmall} uppercase tracking-[0.3em] text-bg`,children:r(i)}),o&&e("span",{className:`absolute right-6 bottom-6 z-[2] font-mono ${l.labelSmall} uppercase tracking-[0.24em] text-overlay-fg`,children:r(o)})]}),a("div",{className:"flex flex-col justify-between gap-6 px-12 py-14 max-view-desktop:px-7 max-view-desktop:py-9",children:[x.length>0&&e("div",{className:`flex items-center gap-4 font-mono ${l.labelSmall} uppercase tracking-[0.28em] text-fg-dim`,children:x.map((s,n)=>a(w,{children:[n>0&&e("span",{className:"opacity-40",children:"·"}),s]},n))}),t&&e("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(34px,3.5vw,58px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.03em]",children:S(t,!0)}),d&&j(d).map((s,n)=>e("p",{className:`max-w-[520px] font-serif ${l.body} italic leading-[1.5] text-fg-dim`,children:r(s,!0)},n)),f&&e("div",{children:a(y,{href:u||"#",className:`group inline-flex items-center gap-3.5 py-3.5 font-mono ${l.labelLarge} uppercase tracking-[0.3em] text-accent`,children:[r(f)," ",e("span",{className:"transition-transform group-hover:translate-x-[6px]",children:"→"})]})})]})]});return v?g:e(k,{as:"section",className:"border-b border-line py-20 max-view-desktop:py-[60px]",children:e("div",{className:N,children:g})})}export{L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as o,Fragment as u}from"react/jsx-runtime";import{HideTaker as b}from"./ViewHideRoot.js";import{SiteLink as v}from"../lib/site-runtime.js";import{cardColumns as k}from"
|
|
1
|
+
import{jsx as e,jsxs as o,Fragment as u}from"react/jsx-runtime";import{HideTaker as b}from"./ViewHideRoot.js";import{SiteLink as v}from"../lib/site-runtime.js";import{cardColumns as k}from"../../format/lib/content/card-columns.js";import y from"./SectionEyebrow.js";import{renderGold as N,renderHeadline as w}from"./goldPhrases.js";import{say as M}from"../../format/lib/editor-words.js";const d={headingMediumUpTo800:"max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",headingMedium:"text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))]",body:"text-[length:var(--size-body,17px)]"};function T({look:x,eyebrow:i,title:t,items:f,columns:g,editing:s=!1}={}){const h=k(g),n=(f??[]).filter(r=>s||(r.label??"").trim()),c=!!(i??"").trim()||!!(t??"").trim();return!s&&!c&&n.length===0?null:e(b,{as:"section",className:"relative z-[2] border-y border-line bg-surface",children:o("div",{className:"mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[76px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",children:[c&&o("div",{className:"mb-11 flex flex-wrap items-baseline gap-5 max-view-wide:mb-8",children:[(i??"").trim()&&e(y,{text:i??"",look:x}),(t??"").trim()&&e("h2",{className:`font-heading2 ${d.headingMedium} font-medium uppercase leading-none tracking-[-0.02em] text-fg ${d.headingMediumUpTo800}`,children:w(t??"",!1)})]}),n.length>0&&e("div",{className:"sf-card grid grid-cols-1 gap-px border border-line bg-line min-[700px]:[grid-template-columns:repeat(var(--kf-cols),minmax(0,1fr))]",style:{"--kf-cols":String(h)},children:n.map((r,m)=>{const l=o(u,{children:[e("span",{"aria-hidden":!0,className:"h-[9px] w-[9px] flex-shrink-0 rotate-45 bg-accent"}),e("span",{className:`font-display ${d.body} font-medium uppercase tracking-[0.06em] text-fg transition-colors group-hover/kf:text-accent`,children:N((r.label??"").trim()||M("Feature"))})]}),a=(r.href??"").trim();if(a&&!s){const p="group/kf flex items-center gap-4 bg-bg px-7 py-[30px] transition-colors hover:bg-surface";return a.startsWith("/")?e(v,{href:a,className:p,children:l},m):e("a",{href:a,className:p,children:l},m)}return e("div",{className:"flex items-center gap-4 bg-bg px-7 py-[30px]",children:l},m)})})]})})}export{T as default};
|
|
@@ -55,5 +55,6 @@ export interface MockupSectionProps {
|
|
|
55
55
|
products?: MockupProduct[];
|
|
56
56
|
align?: "right" | "left";
|
|
57
57
|
editing?: boolean;
|
|
58
|
+
omitHead?: boolean;
|
|
58
59
|
}
|
|
59
|
-
export default function MockupSection({ eyebrow, title, body, variant, cardHeader, badge, cardTitle, cardSubtitle, pills, tiles, rows, button, footnote, col1Title, col1Cards, col2Title, col2Cards, col3Title, col3Cards, col4Title, col4Cards, barsHeading, bars, termLines, urlText, heroTitle, heroButton, products, align, editing, }?: MockupSectionProps): import("react").JSX.Element | null;
|
|
60
|
+
export default function MockupSection({ eyebrow, title, body, variant, cardHeader, badge, cardTitle, cardSubtitle, pills, tiles, rows, button, footnote, col1Title, col1Cards, col2Title, col2Cards, col3Title, col3Cards, col4Title, col4Cards, barsHeading, bars, termLines, urlText, heroTitle, heroButton, products, align, editing, omitHead, }?: MockupSectionProps): import("react").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r,Fragment as D}from"react/jsx-runtime";import{HideTaker as te}from"./ViewHideRoot.js";import{renderGold as re,renderHeadline as ne}from"./goldPhrases.js";const B={headingMediumUpTo800:"max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",headingMedium:"text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))]"},C="#ffffff",d="#16181d",o="#5b6470",u="#9aa3ae",p="#f4f6f8",m="#e3e7ec",g="#1f9d55";function se({rows:n}){return e("div",{className:"flex flex-col gap-3",children:n.map((a,c)=>{const t=a.state??"ok",s=t==="no";return r("div",{className:"flex items-center gap-3 rounded-lg border px-4 py-3",style:{background:s?"#fbfbfc":p,borderColor:m},children:[t==="no"?e("span",{"aria-hidden":!0,className:"text-[15px] font-bold",style:{color:u},children:"✕"}):e("span",{"aria-hidden":!0,className:"h-[11px] w-[11px] flex-shrink-0 rounded-full",style:{background:t==="warn"?"var(--accent)":g}}),e("span",{className:"text-[14px] font-semibold",style:{color:s?u:d},children:a.lead}),e("span",{className:"text-[13px]",style:{color:s?u:o},children:a.detail}),(a.status??"").trim()&&e("span",{className:"ml-auto whitespace-nowrap text-[12px] font-bold",style:{color:t==="ok"?g:t==="warn"?"var(--accent)":u},children:a.status})]},c)})})}const E=["#c7cdd5","var(--accent)","#c7cdd5",g];function ce({columns:n}){return e("div",{className:"grid gap-2 rounded-xl p-3",style:{background:p,gridTemplateColumns:`repeat(${n.length}, minmax(0, 1fr))`},children:n.map((a,c)=>r("div",{className:"flex flex-col gap-2",children:[r("div",{className:"flex items-baseline justify-between px-1",children:[e("span",{className:"font-mono text-[9px] font-semibold uppercase tracking-[0.14em]",style:{color:o},children:a.title}),e("span",{className:"font-mono text-[9px] font-bold",style:{color:"var(--accent)"},children:a.cards.length})]}),a.cards.map((t,s)=>r("div",{className:"rounded-md border px-2.5 py-2",style:{background:C,borderColor:c===n.length-1?"#bfe3ce":m},children:[e("span",{"aria-hidden":!0,className:"mb-1.5 block h-[8px] w-[8px] rounded-full",style:{background:E[c%E.length]}}),e("span",{className:"block text-[11px] font-semibold leading-snug",style:{color:d},children:t})]},s))]},c))})}function de({heading:n,bars:a}){const c=Math.max(...a.map(s=>s.value),0)||1,t=a.findIndex(s=>s.value===c);return r("div",{className:"border-t pt-4",style:{borderColor:m},children:[n.trim()&&e("div",{className:"mb-3 font-mono text-[10px] font-semibold uppercase tracking-[0.18em]",style:{color:o},children:n}),e("div",{className:"flex flex-col gap-2.5",children:a.map((s,i)=>r("div",{className:"flex items-center gap-3",children:[e("span",{className:"w-[84px] flex-shrink-0 text-[12px] font-bold",style:{color:d},children:s.label}),e("span",{className:"h-[12px] rounded-full",style:{width:`${Math.max(s.value/c*60,4)}%`,background:i===t?"var(--accent)":i%2?"#c7cdd5":"#9aa3ae"}}),r("span",{className:"text-[12px]",style:{color:o},children:[s.value,"%"]})]},i))})]})}function I({size:n}){const a=n/2;return r("svg",{width:n,height:n,viewBox:`0 0 ${n} ${n}`,"aria-hidden":!0,children:[e("circle",{cx:a,cy:a,r:a*.82,fill:"none",stroke:"#9aa3ae",strokeWidth:"2.5"}),e("circle",{cx:a,cy:a,r:a*.5,fill:"none",stroke:"var(--accent)",strokeWidth:"2"}),e("circle",{cx:a,cy:a,r:a*.14,fill:"var(--accent)"})]})}function ie({header:n,lines:a}){return r("div",{style:{background:"#0c0e11"},children:[r("div",{className:"relative flex items-center gap-2 px-4 py-3",style:{background:"#161a20"},children:[e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#e85d5d"}}),e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#efc65a"}}),e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#6fcf7e"}}),n.trim()&&e("span",{className:"absolute inset-x-0 text-center font-mono text-[11px]",style:{color:"rgba(244,246,242,0.45)"},children:n})]}),r("div",{className:"flex flex-col gap-1.5 px-5 py-5 font-mono text-[13px] leading-relaxed",children:[a.map((c,t)=>c.startsWith("$ ")?r("div",{children:[e("span",{style:{color:"var(--accent)"},children:"$ "}),e("span",{style:{color:"#f4f6f2"},children:c.slice(2)})]},t):c.startsWith("✓")?e("div",{style:{color:"#6fcf7e"},children:c},t):e("div",{style:{color:"rgba(244,246,242,0.55)"},children:c},t)),e("div",{"aria-hidden":!0,className:"mt-1 h-[15px] w-[8px]",style:{background:"var(--accent)"}})]})]})}function oe({urlText:n,heroTitle:a,heroButton:c,products:t}){return r("div",{children:[r("div",{className:"flex items-center gap-2 px-4 py-3",style:{background:p},children:[e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#e85d5d"}}),e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#efc65a"}}),e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#6fcf7e"}}),n.trim()&&e("span",{className:"mx-auto rounded border px-6 py-1 text-[11px]",style:{background:C,borderColor:m,color:o},children:n}),e("span",{className:"w-[54px]","aria-hidden":!0})]}),r("div",{className:"relative overflow-hidden px-5 py-6",style:{background:d},children:[e("div",{className:"absolute -right-4 top-1/2 -translate-y-1/2 opacity-90",children:e(I,{size:104})}),a.trim()&&e("div",{className:"max-w-[240px] text-[15px] font-bold uppercase leading-snug tracking-wide text-white",children:a}),c.trim()&&e("div",{className:"mt-3 inline-block rounded px-3.5 py-1.5 text-[11px] font-bold text-white",style:{background:"var(--accent)"},"aria-hidden":!0,children:c})]}),t.length>0&&e("div",{className:"grid grid-cols-3 gap-3 p-4",children:t.map((s,i)=>r("div",{className:"overflow-hidden rounded-lg border",style:{borderColor:m},children:[e("div",{className:"flex items-center justify-center py-3",style:{background:p},children:e(I,{size:56})}),r("div",{className:"flex flex-col gap-1 p-2.5",children:[e("span",{className:"text-[10.5px] font-bold leading-tight",style:{color:d},children:s.name}),e("span",{className:"text-[11px] font-bold",style:{color:"var(--accent)"},children:s.price}),e("span",{className:"mt-0.5 rounded px-2 py-1 text-center text-[9px] font-bold text-white",style:{background:d},"aria-hidden":!0,children:"Add to cart"})]})]},i))})]})}function me({eyebrow:n,title:a,body:c,variant:t="spec-card",cardHeader:s,badge:i,cardTitle:f,cardSubtitle:b,pills:F,tiles:W,rows:K,button:_,footnote:M,col1Title:G,col1Cards:L,col2Title:U,col2Cards:O,col3Title:P,col3Cards:z,col4Title:S,col4Cards:X,barsHeading:Z,bars:q,termLines:H,urlText:J,heroTitle:j,heroButton:Q,products:V,align:Y="right",editing:x=!1}={}){const y=(F??[]).filter(l=>x||(l.value??"").trim()),v=(W??[]).filter(l=>x||(l.label??"").trim()),N=(K??[]).filter(l=>x||(l.lead??"").trim()),k=[[G,L],[U,O],[P,z],[S,X]].map(([l,h])=>({title:(l??"").trim(),cards:(h??[]).map(le=>(le.text??"").trim()).filter(Boolean)})).filter(l=>l.title||l.cards.length>0),w=(q??[]).map(l=>({label:(l.label??"").trim(),value:parseFloat(l.value??"")})).filter(l=>l.label&&Number.isFinite(l.value)),A=(H??[]).map(l=>l.text??"").filter(l=>x||l.trim()),R=(V??[]).map(l=>({name:(l.name??"").trim(),price:(l.price??"").trim()})).filter(l=>l.name),ee=!!(n??"").trim()||!!(a??"").trim(),ae=!!(s??"").trim()||!!(f??"").trim()||y.length>0||v.length>0||N.length>0||k.length>0||w.length>0||R.length>0||A.length>0||!!(j??"").trim();if(!x&&!ee&&!ae)return null;const T=r("div",{className:`w-full overflow-hidden rounded-2xl shadow-[0_24px_60px_rgba(0,0,0,0.35)] ${t==="kanban"||t==="browser"||t==="terminal"?"max-w-[600px]":"max-w-[520px]"}`,style:{background:C},children:[t!=="terminal"&&(s??"").trim()&&r("div",{className:"flex items-center justify-between px-6 py-4",style:{background:d},children:[e("span",{className:"font-mono text-[12px] font-semibold uppercase tracking-[0.22em] text-white",children:s}),(i??"").trim()&&r("span",{className:"flex items-center gap-2 font-mono text-[11px] font-semibold uppercase tracking-[0.16em] text-white",children:[e("span",{"aria-hidden":!0,className:"h-[9px] w-[9px] rounded-full",style:{background:g}}),i]})]}),t==="terminal"?e(ie,{header:s??"",lines:A}):t==="browser"?e(oe,{urlText:J??"",heroTitle:j??"",heroButton:Q??"",products:R}):r("div",{className:"flex flex-col gap-5 p-6",children:[((f??"").trim()||(b??"").trim())&&r("div",{children:[(f??"").trim()&&e("div",{className:"text-[22px] font-bold leading-tight",style:{color:d},children:f}),(b??"").trim()&&e("div",{className:"mt-1 text-[14px]",style:{color:o},children:b})]}),t==="fitment"&&y.length>0&&e("div",{className:"flex flex-wrap gap-2.5",children:y.map((l,h)=>r("span",{className:"flex items-baseline gap-2 rounded border px-4 py-2",style:{background:p,borderColor:m},children:[e("span",{className:"text-[11px]",style:{color:o},children:l.label}),e("span",{className:"text-[13px] font-bold",style:{color:d},children:l.value})]},h))}),t!=="fitment"&&v.length>0&&e("div",{className:"grid grid-cols-2 gap-3",children:v.map((l,h)=>r("div",{className:"rounded-lg px-4 py-3",style:{background:p},children:[e("div",{className:"font-mono text-[10px] font-semibold uppercase tracking-[0.18em]",style:{color:o},children:l.label}),e("div",{className:"mt-1 text-[17px] font-bold",style:{color:d},children:l.value})]},h))}),N.length>0&&e(se,{rows:N}),(_??"").trim()&&e("div",{className:"self-start rounded-lg px-6 py-2.5 text-[14px] font-bold text-white",style:{background:"var(--accent)"},"aria-hidden":!0,children:_}),t==="kanban"&&k.length>0&&e(ce,{columns:k}),t==="claims"&&w.length>0&&e(de,{heading:Z??"",bars:w}),(M??"").trim()&&e("div",{className:"border-t pt-4",style:{borderColor:m},children:e("span",{className:"text-[15px] font-bold",style:{color:"var(--accent)"},children:M})})]})]}),$=r("div",{children:[(n??"").trim()&&e("span",{className:"inline-block bg-accent px-3.5 py-1.5 font-mono text-[12px] font-semibold uppercase tracking-[0.16em] text-bg",children:re(n??"")}),(a??"").trim()&&e("h2",{className:`mt-5 font-heading2 ${B.headingMedium} font-medium uppercase leading-[1.04] tracking-[-0.02em] text-fg ${B.headingMediumUpTo800}`,children:ne(a??"",!1)}),(c??"").trim()&&e("p",{className:"mt-5 max-w-[46ch] text-[15px] leading-relaxed text-fg/65",children:c})]});return e(te,{as:"section",className:"relative z-[2] border-y border-line bg-surface",children:e("div",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] items-center gap-14 px-[var(--sf-site-gutter,40px)] py-[76px] min-[960px]:grid-cols-2 max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",children:Y==="left"?r(D,{children:[e("div",{className:"flex justify-center min-[960px]:justify-start",children:T}),$]}):r(D,{children:[$,e("div",{className:"flex justify-center min-[960px]:justify-end",children:T})]})})})}export{me as default};
|
|
1
|
+
import{jsx as e,jsxs as r,Fragment as I}from"react/jsx-runtime";import{HideTaker as re}from"./ViewHideRoot.js";import{renderGold as ne,renderHeadline as se}from"./goldPhrases.js";const F={headingMediumUpTo800:"max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",headingMedium:"text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))]"},_="#ffffff",d="#16181d",o="#5b6470",u="#9aa3ae",x="#f4f6f8",m="#e3e7ec",g="#1f9d55";function ce({rows:n}){return e("div",{className:"flex flex-col gap-3",children:n.map((l,c)=>{const a=l.state??"ok",s=a==="no";return r("div",{className:"flex items-center gap-3 rounded-lg border px-4 py-3",style:{background:s?"#fbfbfc":x,borderColor:m},children:[a==="no"?e("span",{"aria-hidden":!0,className:"text-[15px] font-bold",style:{color:u},children:"✕"}):e("span",{"aria-hidden":!0,className:"h-[11px] w-[11px] flex-shrink-0 rounded-full",style:{background:a==="warn"?"var(--accent)":g}}),e("span",{className:"text-[14px] font-semibold",style:{color:s?u:d},children:l.lead}),e("span",{className:"text-[13px]",style:{color:s?u:o},children:l.detail}),(l.status??"").trim()&&e("span",{className:"ml-auto whitespace-nowrap text-[12px] font-bold",style:{color:a==="ok"?g:a==="warn"?"var(--accent)":u},children:l.status})]},c)})})}const W=["#c7cdd5","var(--accent)","#c7cdd5",g];function de({columns:n}){return e("div",{className:"grid gap-2 rounded-xl p-3",style:{background:x,gridTemplateColumns:`repeat(${n.length}, minmax(0, 1fr))`},children:n.map((l,c)=>r("div",{className:"flex flex-col gap-2",children:[r("div",{className:"flex items-baseline justify-between px-1",children:[e("span",{className:"font-mono text-[9px] font-semibold uppercase tracking-[0.14em]",style:{color:o},children:l.title}),e("span",{className:"font-mono text-[9px] font-bold",style:{color:"var(--accent)"},children:l.cards.length})]}),l.cards.map((a,s)=>r("div",{className:"rounded-md border px-2.5 py-2",style:{background:_,borderColor:c===n.length-1?"#bfe3ce":m},children:[e("span",{"aria-hidden":!0,className:"mb-1.5 block h-[8px] w-[8px] rounded-full",style:{background:W[c%W.length]}}),e("span",{className:"block text-[11px] font-semibold leading-snug",style:{color:d},children:a})]},s))]},c))})}function ie({heading:n,bars:l}){const c=Math.max(...l.map(s=>s.value),0)||1,a=l.findIndex(s=>s.value===c);return r("div",{className:"border-t pt-4",style:{borderColor:m},children:[n.trim()&&e("div",{className:"mb-3 font-mono text-[10px] font-semibold uppercase tracking-[0.18em]",style:{color:o},children:n}),e("div",{className:"flex flex-col gap-2.5",children:l.map((s,i)=>r("div",{className:"flex items-center gap-3",children:[e("span",{className:"w-[84px] flex-shrink-0 text-[12px] font-bold",style:{color:d},children:s.label}),e("span",{className:"h-[12px] rounded-full",style:{width:`${Math.max(s.value/c*60,4)}%`,background:i===a?"var(--accent)":i%2?"#c7cdd5":"#9aa3ae"}}),r("span",{className:"text-[12px]",style:{color:o},children:[s.value,"%"]})]},i))})]})}function K({size:n}){const l=n/2;return r("svg",{width:n,height:n,viewBox:`0 0 ${n} ${n}`,"aria-hidden":!0,children:[e("circle",{cx:l,cy:l,r:l*.82,fill:"none",stroke:"#9aa3ae",strokeWidth:"2.5"}),e("circle",{cx:l,cy:l,r:l*.5,fill:"none",stroke:"var(--accent)",strokeWidth:"2"}),e("circle",{cx:l,cy:l,r:l*.14,fill:"var(--accent)"})]})}function oe({header:n,lines:l}){return r("div",{style:{background:"#0c0e11"},children:[r("div",{className:"relative flex items-center gap-2 px-4 py-3",style:{background:"#161a20"},children:[e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#e85d5d"}}),e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#efc65a"}}),e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#6fcf7e"}}),n.trim()&&e("span",{className:"absolute inset-x-0 text-center font-mono text-[11px]",style:{color:"rgba(244,246,242,0.45)"},children:n})]}),r("div",{className:"flex flex-col gap-1.5 px-5 py-5 font-mono text-[13px] leading-relaxed",children:[l.map((c,a)=>c.startsWith("$ ")?r("div",{children:[e("span",{style:{color:"var(--accent)"},children:"$ "}),e("span",{style:{color:"#f4f6f2"},children:c.slice(2)})]},a):c.startsWith("✓")?e("div",{style:{color:"#6fcf7e"},children:c},a):e("div",{style:{color:"rgba(244,246,242,0.55)"},children:c},a)),e("div",{"aria-hidden":!0,className:"mt-1 h-[15px] w-[8px]",style:{background:"var(--accent)"}})]})]})}function me({urlText:n,heroTitle:l,heroButton:c,products:a}){return r("div",{children:[r("div",{className:"flex items-center gap-2 px-4 py-3",style:{background:x},children:[e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#e85d5d"}}),e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#efc65a"}}),e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#6fcf7e"}}),n.trim()&&e("span",{className:"mx-auto rounded border px-6 py-1 text-[11px]",style:{background:_,borderColor:m,color:o},children:n}),e("span",{className:"w-[54px]","aria-hidden":!0})]}),r("div",{className:"relative overflow-hidden px-5 py-6",style:{background:d},children:[e("div",{className:"absolute -right-4 top-1/2 -translate-y-1/2 opacity-90",children:e(K,{size:104})}),l.trim()&&e("div",{className:"max-w-[240px] text-[15px] font-bold uppercase leading-snug tracking-wide text-white",children:l}),c.trim()&&e("div",{className:"mt-3 inline-block rounded px-3.5 py-1.5 text-[11px] font-bold text-white",style:{background:"var(--accent)"},"aria-hidden":!0,children:c})]}),a.length>0&&e("div",{className:"grid grid-cols-3 gap-3 p-4",children:a.map((s,i)=>r("div",{className:"overflow-hidden rounded-lg border",style:{borderColor:m},children:[e("div",{className:"flex items-center justify-center py-3",style:{background:x},children:e(K,{size:56})}),r("div",{className:"flex flex-col gap-1 p-2.5",children:[e("span",{className:"text-[10.5px] font-bold leading-tight",style:{color:d},children:s.name}),e("span",{className:"text-[11px] font-bold",style:{color:"var(--accent)"},children:s.price}),e("span",{className:"mt-0.5 rounded px-2 py-1 text-center text-[9px] font-bold text-white",style:{background:d},"aria-hidden":!0,children:"Add to cart"})]})]},i))})]})}function pe({eyebrow:n,title:l,body:c,variant:a="spec-card",cardHeader:s,badge:i,cardTitle:f,cardSubtitle:b,pills:G,tiles:L,rows:U,button:j,footnote:M,col1Title:O,col1Cards:P,col2Title:z,col2Cards:S,col3Title:X,col3Cards:Z,col4Title:q,col4Cards:J,barsHeading:Q,bars:V,termLines:Y,urlText:H,heroTitle:A,heroButton:ee,products:le,align:R="right",editing:p=!1,omitHead:$=!1}={}){const y=(G??[]).filter(t=>p||(t.value??"").trim()),v=(L??[]).filter(t=>p||(t.label??"").trim()),N=(U??[]).filter(t=>p||(t.lead??"").trim()),k=[[O,P],[z,S],[X,Z],[q,J]].map(([t,h])=>({title:(t??"").trim(),cards:(h??[]).map(ae=>(ae.text??"").trim()).filter(Boolean)})).filter(t=>t.title||t.cards.length>0),w=(V??[]).map(t=>({label:(t.label??"").trim(),value:parseFloat(t.value??"")})).filter(t=>t.label&&Number.isFinite(t.value)),T=(Y??[]).map(t=>t.text??"").filter(t=>p||t.trim()),D=(le??[]).map(t=>({name:(t.name??"").trim(),price:(t.price??"").trim()})).filter(t=>t.name),te=!$&&(!!(n??"").trim()||!!(l??"").trim()),B=!!(s??"").trim()||!!(f??"").trim()||y.length>0||v.length>0||N.length>0||k.length>0||w.length>0||D.length>0||T.length>0||!!(A??"").trim();if(!p&&!te&&!B)return null;const C=r("div",{className:`w-full overflow-hidden rounded-2xl shadow-[0_24px_60px_rgba(0,0,0,0.35)] ${a==="kanban"||a==="browser"||a==="terminal"?"max-w-[600px]":"max-w-[520px]"}`,style:{background:_},children:[a!=="terminal"&&(s??"").trim()&&r("div",{className:"flex items-center justify-between px-6 py-4",style:{background:d},children:[e("span",{className:"font-mono text-[12px] font-semibold uppercase tracking-[0.22em] text-white",children:s}),(i??"").trim()&&r("span",{className:"flex items-center gap-2 font-mono text-[11px] font-semibold uppercase tracking-[0.16em] text-white",children:[e("span",{"aria-hidden":!0,className:"h-[9px] w-[9px] rounded-full",style:{background:g}}),i]})]}),a==="terminal"?e(oe,{header:s??"",lines:T}):a==="browser"?e(me,{urlText:H??"",heroTitle:A??"",heroButton:ee??"",products:D}):r("div",{className:"flex flex-col gap-5 p-6",children:[((f??"").trim()||(b??"").trim())&&r("div",{children:[(f??"").trim()&&e("div",{className:"text-[22px] font-bold leading-tight",style:{color:d},children:f}),(b??"").trim()&&e("div",{className:"mt-1 text-[14px]",style:{color:o},children:b})]}),a==="fitment"&&y.length>0&&e("div",{className:"flex flex-wrap gap-2.5",children:y.map((t,h)=>r("span",{className:"flex items-baseline gap-2 rounded border px-4 py-2",style:{background:x,borderColor:m},children:[e("span",{className:"text-[11px]",style:{color:o},children:t.label}),e("span",{className:"text-[13px] font-bold",style:{color:d},children:t.value})]},h))}),a!=="fitment"&&v.length>0&&e("div",{className:"grid grid-cols-2 gap-3",children:v.map((t,h)=>r("div",{className:"rounded-lg px-4 py-3",style:{background:x},children:[e("div",{className:"font-mono text-[10px] font-semibold uppercase tracking-[0.18em]",style:{color:o},children:t.label}),e("div",{className:"mt-1 text-[17px] font-bold",style:{color:d},children:t.value})]},h))}),N.length>0&&e(ce,{rows:N}),(j??"").trim()&&e("div",{className:"self-start rounded-lg px-6 py-2.5 text-[14px] font-bold text-white",style:{background:"var(--accent)"},"aria-hidden":!0,children:j}),a==="kanban"&&k.length>0&&e(de,{columns:k}),a==="claims"&&w.length>0&&e(ie,{heading:Q??"",bars:w}),(M??"").trim()&&e("div",{className:"border-t pt-4",style:{borderColor:m},children:e("span",{className:"text-[15px] font-bold",style:{color:"var(--accent)"},children:M})})]})]});if($)return p||B?e("div",{className:`flex justify-center ${R==="left"?"view-wide:justify-start":"view-wide:justify-end"}`,children:C}):null;const E=r("div",{children:[(n??"").trim()&&e("span",{className:"inline-block bg-accent px-3.5 py-1.5 font-mono text-[12px] font-semibold uppercase tracking-[0.16em] text-bg",children:ne(n??"")}),(l??"").trim()&&e("h2",{className:`mt-5 font-heading2 ${F.headingMedium} font-medium uppercase leading-[1.04] tracking-[-0.02em] text-fg ${F.headingMediumUpTo800}`,children:se(l??"",!1)}),(c??"").trim()&&e("p",{className:"mt-5 max-w-[46ch] text-[15px] leading-relaxed text-fg/65",children:c})]});return e(re,{as:"section",className:"relative z-[2] border-y border-line bg-surface",children:e("div",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] items-center gap-14 px-[var(--sf-site-gutter,40px)] py-[76px] min-[960px]:grid-cols-2 max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",children:R==="left"?r(I,{children:[e("div",{className:"flex justify-center min-[960px]:justify-start",children:C}),E]}):r(I,{children:[E,e("div",{className:"flex justify-center min-[960px]:justify-end",children:C})]})})})}export{pe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as u}from"react/jsx-runtime";import{HideTaker as h}from"../../../../../components/ViewHideRoot.js";import{CardTemplateRows as R,useCardRow as T}from"../../../../../components/CardRowContext.js";import{BOX_ITEMS_ATTR as S}from"../../../../../../format/lib/content/box-layout.js";import{cardItemAction as _,highlightOf as g,keyedRows as k,markedRows as A,rowHoldsContent as C}from"../../../../../../format/lib/content/card-state.js";import{CARD_LIST_ROWS as L,CARD_LIST_TYPE as x,cardListShows as I,cardRow as w}from"../../../../../../format/lib/content/card-template.js";import{declaredBlockSource as j,sourceChoices as E,sourcedRows as b}from"../../../../../../format/lib/content/block-sources.js";import{CardListMeta as B}from"../../../../../../format/lib/document/blocks/general/CardList/meta.js";function y(t){const s=t&&typeof t=="object"?t.state:void 0;return s&&typeof s=="object"?s:void 0}const M="[&>*]:flex [&>*]:flex-col [&>*>:only-child]:grow [&>*>:only-child]:flex [&>*>:only-child]:flex-col [&>*>*>:only-child]:grow [&>*>*>:only-child]:flex [&>*>*>:only-child]:flex-col [&>*>*>*>:only-child]:grow",p=[{}];function O(t,s){const d=j(t);let n,m=[];if(d){const e=b(t,s);n=[...e.rows],e.sample&&(m=E(d))}else{const e=t[L];n=Array.isArray(e)?e:[]}const l=k(n.map(w),m),r=n.map((e,i)=>({item:e,row:l[i]})).filter(({item:e})=>s||C(e)),a=A(r.map(e=>e.row),g(t));return{items:r.map(e=>e.item),rows:a.rows,states:r.map(({item:e},i)=>{const o={...y(e),...a.states[i]};return Object.keys(o).length?o:void 0})}}function D({id:t,own:s,Template:d,editing:n,dragRef:m}){const l=T();let r,a,e;if(l){const o=I(s,l.ownerType),c=o&&l.item&&typeof l.item=="object"?l.item[o]:void 0,f=Array.isArray(c)?c:[];r=f.length?f:n?p:f,a=r.map(w),e=r.map(y)}else{const o=O(s,n),c=!o.items.length&&n;r=c?p:o.items,a=c?p.map(w):o.rows,e=c?[]:o.states}if(!r.length)return null;const i=n?[]:r.map(_);return u(R,{ownerId:t,ownerType:x,Template:d,rows:a,items:r,states:e.some(Boolean)?e:void 0,actions:i.some(Boolean)?i:void 0,fallback:null,children:o=>u(h,{ref:m,className:l?"contents":`contents ${M}`,[S]:"",children:o})})}const $={...B,render:t=>u(D,{id:String(t.id??""),own:t,Template:t.template,editing:t.editor?.isEditing===!0,dragRef:t.editor?.dragRef??void 0})};export{$ as CardListRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as a,Fragment as u}from"react/jsx-runtime";import{SECTION_GRID_COLUMN_CLASS as x}from"../../../../../../format/lib/content/section-min-height.js";import F,{cardGridCornerClasses as H}from"../../../../../components/Cards.js";import{CardTemplateRows as I}from"../../../../../components/CardRowContext.js";import{cardRow as L}from"../../../../../../format/lib/content/card-template.js";import{highlightOf as T,keyedRows as b,markedRows as h,rowHoldsContent as y}from"../../../../../../format/lib/content/card-state.js";import D from"../../../../../components/KeyFeatures.js";import{hidableText as v}from"efficient-easel/draw";import{declaredBlockSource as g,sourceChoices as P,sourcedRows as w}from"../../../../../../format/lib/content/block-sources.js";import{KEY_FEATURES_PH as C,keyFeaturesScaffoldItems as K}from"../../../../../../format/lib/document/blocks/general/KeyFeatures/meta.js";import{parseSectionHeadPlacement as N}from"../../../../../../format/lib/sections/section-head-placement.js";import{parseSectionEyebrowLook as S}from"../../../../../../format/lib/sections/section-eyebrow-look.js";import{phRows as R,phHide as f}from"../../scaffold.js";import{say as m}from"../../../../../../format/lib/editor-words.js";import{SERVED_CARD_FIELDS as s}from"../../../../../../format/lib/document/blocks/general/Cards/card-seed.js";import{CardsMeta as O,CARDS_PH as E}from"../../../../../../format/lib/document/blocks/general/Cards/meta.js";const k=()=>[{title:m("Card title one"),body:m("A short line about this card.")},{title:m("Card title two"),body:m("A short line about this card.")},{title:m("Card title three"),body:m("A short line about this card.")}],_=()=>k().map(e=>({[s.title]:e.title??"",[s.body]:e.body??""}));function $(e){return g(e)?w(e,e.editor?.isEditing===!0,_()).rows.filter(t=>t[s.title]||t[s.body]).map(t=>({title:t[s.title]??"",body:t[s.body]??""})):null}function j(e){const t=e.editor?.isEditing===!0,o=g(e),i=T(e);if(o){const l=w(e,t,_());return h(b(l.rows,l.sample?P(o):[]).filter(y),i)}const d=R(e.items,k(),e.editor).map(L);return h(b(d).filter(l=>t||y(l)),i)}function B(e,t,o){const i=o?`relative grid ${x} bg-bg`:"relative bg-bg";return a("div",{className:t?`${i} ${t}`:i,children:e})}const oe={...O,render:e=>{const t=N(e.headPlacement)==="own-box",o=r=>t?void 0:r,i=(e.template?.blockCount??0)>0,d=$(e);if((!i||e.cardStyle==="label-only")&&d&&!d.length)return a(u,{});if(e.cardStyle==="label-only"){const r=d?d.map(n=>({label:n.title??"",href:void 0})):Array.isArray(e.items)?e.items.map(n=>({label:v(n.title)??"",href:typeof n.href=="string"?n.href:void 0})):[];return a(D,{look:S(e.eyebrowLook,"KeyFeatures"),eyebrow:o(f(e.eyebrow,C.eyebrow,e.editor)),title:o(f(e.title,C.title,e.editor)),items:d?r:R(r,K(),e.editor),columns:e.columns,editing:e.editor?.isEditing})}const l=r=>a(F,{look:S(e.eyebrowLook,"Cards"),eyebrow:o(f(e.eyebrow,E.eyebrow,e.editor)),title:o(f(e.title,E.title,e.editor)),columns:e.columns,omitHead:t,editing:e.editor?.isEditing,cards:r}),{rows:c,states:A}=i?j(e):{rows:[],states:[]};return i&&d&&!c.length?a(u,{}):a(I,{ownerId:String(e.id??""),ownerType:"Cards",Template:e.template,rows:c,states:A,fallback:l(),wrapCopy:(r,n)=>B(r,H(n.index,c.length,e.columns),n.state?.highlighted===!0),children:r=>c.length?l(r):l()})}};export{oe as CardsRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as u}from"react/jsx-runtime";import w from"../../../../../components/ChartSection.js";import{phRows as x,phHide as i,hidableRow as o}from"../../scaffold.js";import{say as r}from"../../../../../../format/lib/editor-words.js";import{parseSectionHeadPlacement as y}from"../../../../../../format/lib/sections/section-head-placement.js";import{ChartMeta as H,CHART_PH as n}from"../../../../../../format/lib/document/blocks/general/Chart/meta.js";const S=()=>[{label:r("Before"),value:"9"},{label:r("After"),value:"3"},{label:r("With us"),value:"1"}],B={...H,render:({eyebrow:l,title:m,body:s,items:f,caption:c,chartStyle:p,valueSuffix:d,headPlacement:h,editor:e})=>{const a=y(h)==="own-box",t=b=>a?void 0:b;return u(w,{eyebrow:t(i(l,n.eyebrow,e)),title:t(i(m,n.title,e)),body:t(o(s)),items:x(f,S(),e),chartStyle:p,valueSuffix:o(d),caption:t(o(c)),editing:e?.isEditing,omitHead:a})}};export{B as ChartRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as m}from"react/jsx-runtime";import s from"../../../../../components/Countdown.js";import{parseSectionHeadPlacement as a}from"../../../../../../format/lib/sections/section-head-placement.js";import{CountdownMeta as p}from"../../../../../../format/lib/document/blocks/general/Countdown/meta.js";const c={...p,render:({title:t,zeroText:n,endsAt:e,showUnits:r,headPlacement:i,editor:d})=>{const o=a(i)==="own-box";return m(s,{title:o?void 0:t,zeroText:n,endsAt:e,showUnits:r,editing:d?.isEditing,omitHead:o})}};export{c as CountdownRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as u}from"react/jsx-runtime";import H from"../../../../../components/FeaturedCover.js";import{hidableText as k}from"efficient-easel/draw";import{phHide as a}from"../../scaffold.js";import{parseSectionHeadPlacement as C}from"../../../../../../format/lib/sections/section-head-placement.js";import{FeaturedCoverMeta as F,FEATUREDCOVER_PH as t}from"../../../../../../format/lib/document/blocks/general/FeaturedCover/meta.js";const j={...F,render:({source:o,image:d,badge:i,imageDate:c,category:n,readLabel:g,date:l,title:p,dek:s,ctaText:f,ctaHref:x,headPlacement:b,editor:e})=>{const r=o,m=!!r?.slug;return u(H,{image:m?r.image:d,badge:a(i,t.badge,e),imageDate:m?r.date:a(c,t.imageDate,e),category:a(n,t.category,e),readLabel:a(g,t.readLabel,e),date:m?r.date:a(l,t.date,e),title:m?r.title:a(p,t.title,e),dek:m?r.dek:a(s,t.dek,e),ctaText:a(f,t.ctaText,e),ctaHref:m?r.href:k(x),omitHead:C(b)==="own-box"})}};export{j as FeaturedCoverRender};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
2
|
-
*the counter.*`,e),body:o(l),variant:
|
|
1
|
+
import{jsx as q}from"react/jsx-runtime";import z from"../../../../../components/MockupSection.js";import{phHide as i,hidableRow as o}from"../../scaffold.js";import{parseSectionHeadPlacement as A}from"../../../../../../format/lib/sections/section-head-placement.js";import{MockupMeta as D}from"../../../../../../format/lib/document/blocks/general/Mockup/meta.js";const O={...D,render:({eyebrow:n,title:c,body:l,variant:a,cardHeader:d,badge:s,cardTitle:m,cardSubtitle:p,pills:u,tiles:b,rows:f,button:T,footnote:h,col1Title:w,col1Cards:x,col2Title:g,col2Cards:H,col3Title:C,col3Cards:M,col4Title:S,col4Cards:k,barsHeading:j,bars:y,termLines:B,urlText:R,heroTitle:v,heroButton:E,products:I,align:L,headPlacement:P,editor:e})=>{const r=A(P)==="own-box",t=_=>r?void 0:_;return q(z,{eyebrow:t(i(n,"In the product",e)),title:t(i(c,`Seen from
|
|
2
|
+
*the counter.*`,e)),body:t(o(l)),variant:a,cardHeader:o(d),badge:o(s),cardTitle:o(m),cardSubtitle:o(p),pills:u,tiles:b,rows:f,button:o(T),footnote:o(h),col1Title:o(w),col1Cards:x,col2Title:o(g),col2Cards:H,col3Title:o(C),col3Cards:M,col4Title:o(S),col4Cards:k,barsHeading:o(j),bars:y,termLines:B,urlText:o(R),heroTitle:o(v),heroButton:o(E),products:I,align:L,editing:e?.isEditing,omitHead:r})}};export{O as MockupRender};
|
|
@@ -7,6 +7,7 @@ export declare const NUMBER_TEXT: Props;
|
|
|
7
7
|
export declare const BUTTON: Props;
|
|
8
8
|
export declare const SH_LINK: Props;
|
|
9
9
|
export declare const SECTION_BOX: Props;
|
|
10
|
+
export declare const FOLLOW_THE_BOX: Props;
|
|
10
11
|
export declare const SAME_KEYS: readonly BoxEntry[];
|
|
11
12
|
export declare const DROP_COMMON: Readonly<Record<string, string>>;
|
|
12
13
|
export declare const DROP_SIDE_PADDING: Readonly<Record<string, string>>;
|
|
@@ -33,7 +34,8 @@ export declare const leadText: (lead: string, rest: string, props: Props) => Par
|
|
|
33
34
|
export declare const leadLine: (lead: string, rest: string, run: Props, own?: Props) => PartRow;
|
|
34
35
|
export declare const bandPage: (stored: unknown, ctx: ConvertContext) => number;
|
|
35
36
|
export declare const sectionPage: (p: Props, ctx: ConvertContext) => import("../../../../../format/lib/theme.js").ThemeColors | undefined;
|
|
36
|
-
export declare const fillFrom: (colour: "surface" | "background") => (p: Props, ctx: ConvertContext) => Props;
|
|
37
|
+
export declare const fillFrom: (colour: "surface" | "background", overBand?: (p: Props, ctx: ConvertContext) => boolean) => (p: Props, ctx: ConvertContext) => Props;
|
|
38
|
+
export declare const onBandPreset: (p: Props, ctx: ConvertContext) => boolean;
|
|
37
39
|
export declare const ownFill: (painted: string | undefined, p: Props, ctx: ConvertContext) => Props;
|
|
38
40
|
export declare const fillNoBoxHolds: (painted: string | undefined) => string | undefined;
|
|
39
41
|
export declare const bandIndex: (p: Props, ctx: ConvertContext) => number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SECTION_WIDTH_KEYS as
|
|
1
|
+
import{SECTION_WIDTH_KEYS as D}from"../../../../../format/lib/content/section-width.js";import{phoneKey as W}from"efficient-easel/draw";import{BOX as L,INNER_BOX as v,LABEL_FACE as U,TEXT as I}from"../../../../../format/lib/document/seed-parts.js";import{ENTRANCE_KEYS as M}from"../../../animation/entrance.js";import{CARD_HOVER_KEYS as u}from"../../../../../format/lib/animation/hover.js";import{COUNT_KEY_PROP as w}from"../../../../../format/lib/content/block-sources.js";import{normalizeSiteGutter as y}from"../../../../../format/lib/content/page-width.js";import{resolveSectionPadding as F}from"../../../content/section-padding.js";import{ButtonBlockMeta as K}from"../../../../../format/lib/document/blocks/general/ButtonBlock/meta.js";import{SECTION_PAD_INNER_DEFAULTS as X}from"../../passes/section-padding.js";import{finiteNumber as p}from"../../../../../format/lib/finite-number.js";import{convertTheme as x,hasWords as G}from"../../../sections/section-to-box.js";import{THEME_SECTION_BG as Y}from"../../../../../format/lib/content/section-background.js";import{fillSlotOfInk as N}from"../../../../../format/lib/document/part-inks.js";import{parseHexColor as V}from"efficient-shell/format";import{convertLength as j,isLengthUnit as $}from"efficient-easel/screen/lib/content/length-units";import{bandPresetIndex as J,surfaceTwoTone as z}from"../../../../../format/lib/theme.js";import{VIEW_HIDE_KEYS as q}from"../../../../../format/lib/content/view-hide-class.js";const _=t=>$(t)?t:"px",d=(t,o,e,n)=>o===e?t:j(t,o,e,n,{min:0,max:200,step:4});import{BOX as zt,DIM as qt,INNER_BOX as Qt,TEXT as Zt}from"../../../../../format/lib/document/seed-parts.js";const Ot={textFit:"line",textFitPhone:"wrap"},Q={...I,[w]:""},{label:St,href:Ut,...Z}=K.defaultProps,It=Z,Nt={buttonFillOpacity:0,buttonBorder:{width:0},buttonPaddingTop:0,buttonPaddingRight:0,buttonPaddingBottom:0,buttonPaddingLeft:0},Ct={...L,sectionAccent:0},At={sectionAccent:-1},kt=["gridSpan","sectionHeightMode","sectionHeightValue","sectionHeightUnit","sectionHeightModeTablet","sectionHeightValueTablet","sectionHeightUnitTablet","sectionHeightModePhone","sectionHeightValuePhone","sectionHeightUnitPhone","sectionCorners","sectionCornerSides","sectionBorder","sectionBorderTablet","sectionBorderPhone","sectionAccent","stickTop","stickTopDistance","stickTopTablet","stickTopDistanceTablet","stickTopPhone","stickTopDistancePhone","anchor","sectionAnimation",...q,...Object.values(M).flatMap(t=>[t,W(t)]),"widthFit","widthFitTablet","widthFitPhone","width","widthTablet","widthPhone","minWidth","minWidthTablet","minWidthPhone","maxWidth","maxWidthTablet","maxWidthPhone",...Object.values(D)],c="a section width key, ignored since efficient-web-builder 45 (an old key; a section's own width has new keys, lib/content/section-width), so dropping it changes nothing",Ht={sectionSurface:"read by nothing in src/ (searched 2026-10-24): a retired theme key that draws nothing today, so dropping it changes nothing",widthMode:c,fullWidth:c,pageWidth:c,backgroundWidth:c,contentWidth:c,contentMax:c},Rt=Object.fromEntries(["sectionPaddingLeft","sectionPaddingRight","sectionPaddingLeftTablet","sectionPaddingRightTablet","sectionPaddingLeftPhone","sectionPaddingRightPhone"].map(t=>[t,"needs Box side padding outside its gutter: the old section added it outside its frame, a Box's side padding replaces the gutter. 0 live nodes store it (JJ's read-only export, 2026-10-24)"]));function tt(t,o){const e=p(t.sectionPaddingTop)??0,n=p(t.sectionPaddingBottom)??0,i=p(t.sectionPaddingTopTablet),s=p(t.sectionPaddingBottomTablet),l=_(t.sectionPaddingUnit),g=_(t.sectionPaddingUnitTablet),T=_(t.sectionPaddingUnitPhone),E=(h,a,b,m)=>{const r=p(h);if(r!==void 0)return r+d(m,"px",T,"mobile");const S=a===void 0?{n:b,unit:l}:{n:a,unit:g};return d(S.n,S.unit,T,"mobile")+d(m,"px",T,"mobile")},O=(h,a,b,m,r)=>a!==void 0?{[h]:a+d(r??m,"px",g,"tablet")}:r===void 0?{}:{[h]:d(b,l,g,"tablet")+d(r,"px",g,"tablet")};return{sectionPaddingTop:e+d(o.top,"px",l,"desktop"),sectionPaddingBottom:n+d(o.bottom,"px",l,"desktop"),...O("sectionPaddingTopTablet",i,e,o.top,o.topTablet),...O("sectionPaddingBottomTablet",s,n,o.bottom,o.bottomTablet),sectionPaddingTopPhone:E(t.sectionPaddingTopPhone,i,e,o.topPhone),sectionPaddingBottomPhone:E(t.sectionPaddingBottomPhone,s,n,o.bottomPhone)}}const Dt=t=>[...["sectionPaddingTop","sectionPaddingBottom","sectionPaddingTopTablet","sectionPaddingBottomTablet","sectionPaddingTopPhone","sectionPaddingBottomPhone"].map(o=>[o,o,(e,n)=>tt(n,typeof t=="function"?t(n):t)[o]]),["sectionPaddingUnit","sectionPaddingUnit"],["sectionPaddingUnitTablet","sectionPaddingUnitTablet"],["sectionPaddingUnitPhone","sectionPaddingUnitPhone"]];function P(t,o){const e=F(t,X[o]);return{sectionPaddingTop:e.top,sectionPaddingBottom:e.bottom}}const Wt=t=>[["padTop","sectionPaddingTop",(o,e)=>P(e,t).sectionPaddingTop],["padBottom","sectionPaddingBottom",(o,e)=>P(e,t).sectionPaddingBottom],["sectionPaddingTop","sectionPaddingTop",(o,e)=>P(e,t).sectionPaddingTop],["sectionPaddingBottom","sectionPaddingBottom",(o,e)=>P(e,t).sectionPaddingBottom]],ot={kind:"heading-case-upper",styles:["heading-1","heading-2","heading-3"]},Lt=t=>o=>G(o.props[t])?[ot]:[],vt=(t,o)=>({kind:"text",key:t,role:"eyebrow",props:I,...o?{style:o}:{}}),C=t=>t.background!=="transparent",et=(t,o)=>{const[e,n]=[t,o].map(i=>typeof i=="string"?i.trim():"");return e?n?`[${e} ]{color=text}${n}`:`[${e}]{color=text}`:n},A={align:"right",alignPhone:"left"},nt=(t,o,e)=>{const n=i=>et(i[t],i[o]);return{kind:"block",type:"Text",when:(i,s)=>s!==void 0&&n(s)!=="",box:[[t,"text",(i,s)=>n(s)],[o,"text",(i,s)=>n(s)]],props:e}},Mt=(t,o,e,n={})=>nt(t,o,{...Q,...A,...n,_partStyles:{text:{...U,color:"labels",...e,case:U.case,...A}}}),B=(t,o)=>typeof t=="number"&&Number.isInteger(t)&&t>=0?t:x(o)?.selected??0,k="var(--site-surface-2)",H=(t,o)=>x(o)?.themes[B(t.sectionAccent??0,o)],it=(t,o)=>(e,n)=>{if(!o?.(e,n))return{fillColor:t};const i=H(e,n)?.[t];return i?{fillColor:i}:{}},wt=(t,o)=>f(t,o)>=0,R=t=>t.startsWith("#")&&V(t)!==null,yt=(t,o,e)=>{const n=t?.trim();if(n&&R(n))return{fillColor:n};const i=N(n);if(i)return{fillColor:i};const s=n===k?H(o,e):void 0;return s?{fillColor:z(s)}:{}},Ft=t=>{const o=t?.trim();return!o||o==="transparent"||o===Y||N(o)||o===k||R(o)?void 0:"it paints a colour that no Box Fill can hold"},f=(t,o)=>{const e=x(o)?.themes;return e&&C(t)?J(e,B(t.sectionAccent,o)):-1},Kt=(t,o,e)=>{const n=f(o,e);return n>=0?n:t},Xt=(t,o)=>{const e=f(t,o);return e>=0?{sectionAccent:e}:{}},Gt=(t,o)=>C(t.props)&&f(t.props,o)<0?[{kind:"band-preset",page:B(t.props.sectionAccent,o)}]:[],Yt=t=>y(t.site?.siteGutter),st=Object.fromEntries(["Top","Right","Bottom","Left","TopPhone","RightPhone","BottomPhone","LeftPhone"].map(t=>[`sectionPadding${t}`,0])),Vt=t=>({top:0,right:0,bottom:0,left:0,...t}),jt=(t,o,e,n=[])=>({kind:"group",name:t,keepEmpty:!0,props:(i,s)=>({...v,...st,...it("surface")(i,s),...typeof e=="function"?e(i,s):e}),box:[[o,"bgImage"],u.kind,u.duration,u.delay],parts:n});export{Ot as AUTO_COLUMN,zt as BOX,It as BUTTON,qt as DIM,Ht as DROP_COMMON,Rt as DROP_SIDE_PADDING,At as FOLLOW_THE_BOX,ot as HEADING_CASE_UPPER,Qt as INNER_BOX,st as NO_PAD,Q as NUMBER_TEXT,A as RIGHT_WORDS,kt as SAME_KEYS,Ct as SECTION_BOX,Nt as SH_LINK,Zt as TEXT,Kt as bandAccent,f as bandIndex,B as bandPage,Xt as bandProps,Gt as bandWrites,it as fillFrom,Ft as fillNoBoxHolds,Lt as headingCaseOf,P as innerPad,Wt as innerPadKeys,Mt as leadLine,nt as leadText,Vt as lineSides,et as numberAndUnit,wt as onBandPreset,yt as ownFill,jt as pictureCell,H as sectionPage,Yt as siteGutterOf,vt as smallText,tt as wrapperPad,Dt as wrapperPadKeys};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{phoneKey as k,readHidable as _}from"efficient-easel/draw";import{cardColumns as U}from"../../../../components/Cards.js";import{resolveSectionBackground as z,THEME_SECTION_BG as J}from"../../../../../format/lib/content/section-background.js";import{CardsMeta as Q}from"../../../../../format/lib/document/blocks/general/Cards/meta.js";import{KeyFeaturesMeta as Z}from"../../../../../format/lib/document/blocks/general/KeyFeatures/meta.js";import{finiteNumber as C}from"../../../../../format/lib/finite-number.js";import{nonEmptyString as $}from"../../../../../format/lib/non-empty-string.js";import{parseSectionHeadPlacement as ee}from"../../../../../format/lib/sections/section-head-placement.js";import{hasWords as oe}from"../../../sections/section-to-box.js";import{BOX_TYPE as s,CONTAINER_BLOCKS_SLOT as i}from"../../../../../format/lib/document/container-blocks.js";import{labelTextSeed as te}from"../../../../../format/lib/document/text-seeds.js";import{CARDS_BODY_LOOK as ne,CARDS_CARD as re,CARDS_TITLE_LOOK as ae,rowFieldTextSeed as r}from"../../../../../format/lib/document/blocks/general/Cards/card-seed.js";import{BOX_HIDE_WHEN_ROW_EMPTY as se,CARD_LIST_TYPE as ie,CARD_TEMPLATE_SLOT as de,cardListProps as le}from"../../../../../format/lib/content/card-template.js";import{bandAccent as pe,bandProps as ce,bandWrites as he,BUTTON as me,DIM as h,DROP_COMMON as m,DROP_SIDE_PADDING as u,INNER_BOX as t,SAME_KEYS as g,SECTION_BOX as b,fillFrom as w,fillNoBoxHolds as ue,ownFill as ge,SH_LINK as be,TEXT as n,smallText as we,wrapperPad as y,wrapperPadKeys as f}from"./section-to-box-row-parts.js";import{headTree as T,token as p}from"./section-head-looks.js";import{boxPadding as ye,labelStyle as fe}from"../../../../../format/lib/document/seed-parts.js";import{SECTION_BG_BUILT_IN as Pe}from"../../../../../format/lib/document/blocks/general/section-bg-built-in.js";const d=(e,o,l,c)=>({sectionBorder:{top:e,right:o,bottom:l,left:c}}),E=e=>o=>U(C(o.columns)??C(e.columns)),R=e=>({kind:"group",name:"Grid",props:{...t,gap:0,...d(1,0,0,1)},parts:[e]}),L={...t,direction:"row",gap:0,share:"equal"},D="its head sits in a Box of its own above it (own-box): the row draws the head inline",N=e=>ee(e.headPlacement)==="own-box",B="inline is the head the row draws; an own-box node is skipped (`skip`)",Se=e=>({kind:"group",name:"Heading",props:e,parts:[we("eyebrow"),{kind:"text",key:"title",role:"heading",props:n,style:{textStyle:"heading-3",case:"upper"},was:{size:44}}]}),I={top:72,bottom:72,topPhone:72,bottomPhone:72},_e={...re,...d(0,1,1,0)},Oe={name:"Cards",boxProps:(e,o)=>({...b,direction:"column",gap:36,gapPhone:28,...w("surface")(e,o),...y(e,I)}),box:[...g,...f(I)],skip:e=>N(e)?D:typeof e.dataSource=="string"&&e.dataSource?"its cards come from a source: they are drawn from the card template on Cards":e.template!==void 0?"its cards are drawn from its own card template (an emptied one draws none): the shape the other rows land on":e.cardStyle==="label-only"?"Label only is Key Features' look: no live node holds it, so it has no row of its own yet":void 0,parts:[T("Cards"),R({kind:"list",key:"items",name:"Card",perRow:E(Q.defaultProps),rowName:"Row",rowProps:L,props:(e,o)=>({..._e,...w("background")(e,o)}),parts:[{kind:"text",key:"title",props:n,style:ae},{kind:"text",key:"body",props:h,style:ne}]})],drop:{...m,...u,columns:"the rows of N: one Row Box per `columns` cards, which the Box draws as N equal blocks",cardStyle:"the standard card is what the row draws; a Label only node is skipped (0 live nodes)",dataSource:"an empty source is typed cards, what the row draws; a sourced node is skipped (0 live nodes)",dataSourceOptions:"read only with a source; a sourced node is skipped (0 live nodes)",template:"an empty card template is typed cards, what the row draws; a node with a template is skipped",highlightedCard:"read only with a card template; a node with a template is skipped",highlightBadge:"read only with a card template; a node with a template is skipped",headPlacement:B,eyebrowLook:"needs the eyebrow's Filled look on a Text block: Plain is the eyebrow start look the row draws; 2 of 62 live nodes store it (the stored-node export, 2026-10-24)"}},A={top:76,bottom:76,topPhone:76,bottomPhone:76},xe={...t,direction:"row",align:"center",gap:16,sectionPaddingTop:32,sectionPaddingRight:28,sectionPaddingBottom:32,sectionPaddingLeft:28,...d(0,1,1,0)},F={textStyle:"body-1",color:"text"},H=(e,o)=>typeof o?.href=="string"&&o.href.trim()!=="",ke={name:"Key Features",boxProps:e=>({...b,direction:"column",gap:44,...d(1,0,1,0),...y(e,A)}),box:[...g,...f(A)],parts:[Se({...t,direction:"row",align:"end",gap:20,wrap:!0,share:"content"}),R({kind:"list",key:"items",name:"Feature",perRow:E(Z.defaultProps),rowName:"Row",rowProps:L,props:xe,parts:[{kind:"button",key:"label",href:"href",when:H,variant:"ghost",props:{...me,...be,icon:"none"},style:F},{kind:"text",key:"label",when:(e,o)=>!H(e,o),props:n,style:F,was:{size:17}}]})],drop:{...m,...u,columns:"the rows of N: one Row Box per `columns` cells, which the Box draws as N equal blocks",eyebrowLook:"needs the eyebrow's Filled look on a Text block: Filled is Key Features' own default (lib/sections/section-eyebrow-look), so 20 of 21 published nodes draw it with nothing stored; the row draws the Plain start look (the stored-node export, 2026-10-24)"}},v={top:120,bottom:120,topPhone:80,bottomPhone:80,topTablet:80,bottomTablet:80},P=e=>{const o=z(typeof e.background=="string"?e.background:void 0,Pe.Series);return o&&o!=="transparent"?o:void 0},O=e=>P(e)===J,Ce={...t,justify:"between",gap:16,gapPhone:16,sectionHeightMode:"fixed",sectionHeightValue:340,sectionHeightUnit:"px",sectionPaddingTop:36,sectionPaddingRight:28,sectionPaddingBottom:32,sectionPaddingLeft:28,sectionPaddingTopPhone:36,sectionPaddingRightPhone:28,sectionPaddingBottomPhone:32,sectionPaddingLeftPhone:28},K={...t,direction:"row",justify:"between",gap:12,share:"content",phoneRow:2,[k("share")]:"content"},Te=e=>{const o=P(e)?1:2;return{...t,direction:"row",columns:4,columnsTablet:2,gap:o,gapPhone:o}},x={...fe(12),letterSpacing:.22,lineHeight:1.5},W=e=>oe(e.viewLabel)&&!_(e.viewLabel).hidden,a=e=>_(e).text?.trim?.()??"",M=e=>Object.fromEntries(Object.entries(e).filter(([,o])=>$(o)!==void 0)),X=e=>e.map(([o,l,c])=>({key:o,label:l,...c?{multiline:!0}:{}})),Ee=X([["num","Number"],["since","Corner note"],["title","Card title"],["body","Card body",!0],["count","Count"],["countLabel","Count word"]]),Re=X([["label","Label"],["value","Value"],["body","Card body",!0]]),G=(e,o,l,c,V)=>({kind:"group",name:e,props:o,parts:[{kind:"core",as:ie,headless:!0,keep:[],derive:{reads:["cards"],props:S=>le(c(S),l)},slots:(S,q)=>({[de]:[V(S,q)]})}]}),Y=e=>Array.isArray(e.cards)?e.cards:[],Le={name:"Recurring Columns",boxProps:(e,o)=>({...b,direction:"column",gap:60,gapPhone:60,...d(0,0,1,0),...O(e)?ce(e,o):{},...ge(P(e),e,o),...y(e,v)}),box:[...g.filter(e=>e!=="sectionAccent"),["sectionAccent","sectionAccent",(e,o,l)=>O(o)?pe(e,o,l):e],...f(v)],skip:e=>ue(P(e))??(N(e)?D:void 0),site:(e,o)=>O(e.props)?he(e,o):[],parts:[T("Series"),G("Cards",Te,Ee,e=>Y(e).map(o=>M({num:a(o.num),since:a(o.since),title:a(o.title),body:a(o.desc),count:a(o.entries),countLabel:a(o.entriesLabel)})),(e,o)=>({type:s,props:{...Ce,...w("background")(e,o),name:"Card"},slots:{[i]:[{type:s,props:{...t,name:"Words",gap:16,gapPhone:16},slots:{[i]:[{type:s,props:{...K,name:"Top"},slots:{[i]:[r("num",n,p("label",13),!0),r("since",n,p("label",13),!0)]}},r("title",{...n,tag:"h3"},{textStyle:"heading-3",...p("headingSmall",28),weight:500,case:"upper",lineHeight:1.04,letterSpacing:-.02}),r("body",h,{textStyle:"body-5",fontRole:"heading",...p("body",14),lineHeight:1.6})]}},{type:s,props:{...K,name:"Footer",align:"center",gap:0,gapPhone:0,sectionPaddingTop:16,sectionPaddingTopPhone:16,...d(1,0,0,0),...W(e)?{}:{[se]:["count","countLabel"]}},slots:{[i]:[{type:s,props:{...t,name:"Count",direction:"row",align:"center",gap:12,gapPhone:12,share:"content",[k("share")]:"content"},slots:{[i]:[r("count",n,x),r("countLabel",h,x)]}},...W(e)?[{type:s,props:{...t,name:"View",maxWidthPhone:266},slots:{[i]:[{type:"Text",props:{...n,text:_(e.viewLabel).text,_partStyles:{text:{...te()._partStyles.text,...x}}}}]}}]:[]]}}]}}))],reads:{viewLabel:"a Text typed once in the card template: the far end of every card's footer",background:"the Box's theme (the band preset) or its Fill"},drop:{...m,...u,headPlacement:B}},j={top:60,bottom:60,topPhone:40,bottomPhone:40},De={...t,direction:"row",columns:3,gap:40,gapPhone:16},Ne={...t,gap:8,gapPhone:8,...ye(24),...d(1,1,1,1)},Be={name:"Document Detail Cards",boxProps:e=>({...b,direction:"column",gap:40,gapPhone:16,...d(0,0,1,0),...y(e,j)}),box:[...g,...f(j)],parts:[G("Cards",De,Re,e=>Y(e).map(o=>M({label:a(o.label),value:a(o.value),body:a(o.desc)})),(e,o)=>({type:s,props:{...Ne,...w("surface")(e,o),name:"Card"},slots:{[i]:[r("label",n,{...p("label",12),lineHeight:1.5},!0),{type:s,props:{...t,name:"Words",gap:14,gapPhone:14},slots:{[i]:[r("value",n,{textStyle:"heading-3",...p("headingSmall",20),weight:500,letterSpacing:-.015,lineHeight:1.5}),r("body",h,{textStyle:"body-5",fontRole:"accent",...p("body",14),italic:!0,lineHeight:1.5})]}}]}}))],drop:{...m,...u}},Qe={Cards:Oe,KeyFeatures:ke,Series:Le,DocMetaCards:Be};export{Qe as CARDS_SECTION_TO_BOX};
|
|
1
|
+
import{phoneKey as L,readHidable as O}from"efficient-easel/draw";import{isNodeList as z,newId as J}from"efficient-easel/data";import{say as m}from"../../../../../format/lib/editor-words.js";import{cardColumns as Q}from"../../../../../format/lib/content/card-columns.js";import{resolveSectionBackground as Z,THEME_SECTION_BG as $}from"../../../../../format/lib/content/section-background.js";import{CardsMeta as ee}from"../../../../../format/lib/document/blocks/general/Cards/meta.js";import{KeyFeaturesMeta as te}from"../../../../../format/lib/document/blocks/general/KeyFeatures/meta.js";import{finiteNumber as R}from"../../../../../format/lib/finite-number.js";import{nonEmptyString as oe}from"../../../../../format/lib/non-empty-string.js";import{parseSectionHeadPlacement as ne}from"../../../../../format/lib/sections/section-head-placement.js";import{hasWords as re}from"../../../sections/section-to-box.js";import{BOX_TYPE as i,CONTAINER_BLOCKS_SLOT as s}from"../../../../../format/lib/document/container-blocks.js";import{labelTextSeed as se}from"../../../../../format/lib/document/text-seeds.js";import{cardsCardSeed as ae,rowFieldTextSeed as d}from"../../../../../format/lib/document/blocks/general/Cards/card-seed.js";import{CARD_PLACE_PROP as ie}from"../../../../../format/lib/content/card-place.js";import{CARD_BADGE_FIELD as de}from"../../../../../format/lib/content/card-state.js";import{BOX_HIDE_WHEN_ROW_EMPTY as le,CARD_LIST_TYPE as ce,CARD_TEMPLATE_SLOT as pe,cardKeyOf as he,cardListProps as me,cardRow as ge}from"../../../../../format/lib/content/card-template.js";import{bandAccent as ue,bandProps as be,onBandPreset as ye,bandWrites as we,BUTTON as fe,DIM as x,DROP_COMMON as g,DROP_SIDE_PADDING as u,INNER_BOX as r,SAME_KEYS as b,SECTION_BOX as y,fillFrom as w,fillNoBoxHolds as Pe,ownFill as Se,SH_LINK as Ce,TEXT as l,smallText as _e,wrapperPad as f,wrapperPadKeys as P}from"./section-to-box-row-parts.js";import{headTree as A,token as p}from"./section-head-looks.js";import{boxPadding as Oe,labelStyle as xe}from"../../../../../format/lib/document/seed-parts.js";import{SECTION_BG_BUILT_IN as Ee}from"../../../../../format/lib/document/blocks/general/section-bg-built-in.js";const c=(e,t,o,n)=>({sectionBorder:{top:e,right:t,bottom:o,left:n}}),D=e=>t=>Q(R(t.columns)??R(e.columns)),ke=e=>({kind:"group",name:"Grid",props:{...r,gap:0,...c(1,0,0,1)},parts:[e]}),Te={...r,direction:"row",gap:0,share:"equal"},Le="its head sits in a Box of its own above it (own-box): the row draws the head inline",B=e=>ne(e.headPlacement)==="own-box",Re="inline is the head the row draws; an own-box node is skipped (`skip`)",Ae=e=>({kind:"group",name:"Heading",props:e,parts:[_e("eyebrow"),{kind:"text",key:"title",role:"heading",props:l,style:{textStyle:"heading-3",case:"upper"},was:{size:44}}]}),I={top:76,bottom:76,topPhone:76,bottomPhone:76},De={...r,direction:"row",align:"center",gap:16,sectionPaddingTop:32,sectionPaddingRight:28,sectionPaddingBottom:32,sectionPaddingLeft:28,...c(0,1,1,0)},N={textStyle:"body-1",color:"text"},F=(e,t)=>typeof t?.href=="string"&&t.href.trim()!=="",Be={name:"Key Features",boxProps:e=>({...y,direction:"column",gap:44,...c(1,0,1,0),...f(e,I)}),box:[...b,...P(I)],parts:[Ae({...r,direction:"row",align:"end",gap:20,wrap:!0,share:"content"}),ke({kind:"list",key:"items",name:"Feature",perRow:D(te.defaultProps),rowName:"Row",rowProps:Te,props:De,parts:[{kind:"button",key:"label",href:"href",when:F,variant:"ghost",props:{...fe,...Ce,icon:"none"},style:N},{kind:"text",key:"label",when:(e,t)=>!F(e,t),props:l,style:N,was:{size:17}}]})],drop:{...g,...u,columns:"the rows of N: one Row Box per `columns` cells, which the Box draws as N equal blocks",eyebrowLook:"needs the eyebrow's Filled look on a Text block: Filled is Key Features' own default (lib/sections/section-eyebrow-look), so 20 of 21 published nodes draw it with nothing stored; the row draws the Plain start look (the stored-node export, 2026-10-24)"}},H={top:120,bottom:120,topPhone:80,bottomPhone:80,topTablet:80,bottomTablet:80},S=e=>{const t=Z(typeof e.background=="string"?e.background:void 0,Ee.Series);return t&&t!=="transparent"?t:void 0},C=e=>S(e)===$,Ie={...r,justify:"between",gap:16,gapPhone:16,sectionHeightMode:"fixed",sectionHeightValue:340,sectionHeightUnit:"px",sectionPaddingTop:36,sectionPaddingRight:28,sectionPaddingBottom:32,sectionPaddingLeft:28,sectionPaddingTopPhone:36,sectionPaddingRightPhone:28,sectionPaddingBottomPhone:32,sectionPaddingLeftPhone:28},K={...r,direction:"row",justify:"between",gap:12,share:"content",phoneRow:2,[L("share")]:"content"},Ne=e=>{const t=S(e)?1:2;return{...r,direction:"row",columns:4,columnsTablet:2,gap:t,gapPhone:t}},E={...xe(12),letterSpacing:.22,lineHeight:1.5},W=e=>re(e.viewLabel)&&!O(e.viewLabel).hidden,a=e=>O(e).text?.trim?.()??"",v=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>oe(t)!==void 0)),k=e=>e.map(([t,o,n])=>({key:t,label:o,...n?{multiline:!0}:{}})),Fe=k([["num","Number"],["since","Corner note"],["title","Card title"],["body","Card body",!0],["count","Count"],["countLabel","Count word"]]),He=k([["label","Label"],["value","Value"],["body","Card body",!0]]),T=(e,t,o,n,h,{reads:Y=["cards"],keep:U=[]}={})=>({kind:"group",name:e,props:t,parts:[{kind:"core",as:ce,headless:!0,keep:U,derive:{reads:Y,props:_=>me(n(_),o)},slots:(_,q)=>({[pe]:[h(_,q)]})}]}),M=e=>Array.isArray(e.cards)?e.cards:[],G={top:72,bottom:72,topPhone:72,bottomPhone:72},X=(e,t)=>({...c(0,1,1,0),...w("background")(e,t)}),Ke=e=>{const t=D(ee.defaultProps)(e);return{...r,direction:"row",columns:t,columnsTablet:t,gap:0,gapPhone:0,...c(1,0,0,1),shadow:!0}},We=k([["title","Card title"],["body","Card body",!0]]),ve=e=>(Array.isArray(e.items)?e.items:[]).map((t,o)=>({key:typeof t?.key=="string"&&t.key?t.key:he(ge(t),o),title:a(t?.title),body:a(t?.body)})),j=e=>{const t={},o={};for(const[n,h]of Object.entries(e.props??{}))n!=="id"&&(z(h)?o[n]=h.map(j):t[n]=h);return{type:String(e.type),props:t,...Object.keys(o).length?{slots:o}:{}}},Me=e=>({...e,slots:{...e.slots,[s]:[...e.slots?.[s]??[],d(de,{...l,tag:"p",[ie]:"top-line"},{},!0)]}}),Ge=(e,t)=>{const o=Array.isArray(e.template)?e.template.map(j):[Me(ae())],[n]=o;return o.length===1&&n.type===i?{...n,props:{...X(e,t),...n.props}}:{type:i,props:{...r,...X(e,t),name:"Card"},slots:{[s]:o}}},Xe=e=>Array.isArray(e.template)&&e.template.length===0,je=["dataSource","dataSourceOptions","highlightedCard","highlightBadge"];function yt(){const e=o=>({key:J("card"),title:m(o),body:m("A short line about this card.")}),t=[e("Card title one"),e("Card title two"),e("Card title three")];return{eyebrow:m("Label"),title:m("Section *heading.*"),items:t}}const Ve={name:"Cards",boxProps:(e,t)=>({...y,direction:"column",gap:36,gapPhone:28,...w("surface")(e,t),...f(e,G)}),box:[...b,...P(G)],skip:e=>e.cardStyle==="label-only"?"Label only is Key Features' look: no live node holds it, so it has no row of its own yet":void 0,parts:[{...A("Cards"),when:e=>!B(e)},{...T("Cards",Ke,We,ve,Ge,{reads:["items"],keep:je}),when:e=>!Xe(e)}],drop:{...g,...u,columns:'Box "Cards": its Columns and tablet Columns',cardStyle:"the standard card is what the row draws; a Label only node is skipped (0 live nodes)",template:"the Card list's template (the card Box takes the old cell's ground and lines)",headPlacement:"an own-box node lands without its head; inline is the head the row draws",eyebrowLook:"needs the eyebrow's Filled look on a Text block: Plain is the eyebrow start look the row draws; 2 of 62 live nodes store it (the stored-node export, 2026-10-24)"}},Ye={name:"Recurring Columns",boxProps:(e,t)=>({...y,direction:"column",gap:60,gapPhone:60,...c(0,0,1,0),...C(e)?be(e,t):{},...Se(S(e),e,t),...f(e,H)}),box:[...b.filter(e=>e!=="sectionAccent"),["sectionAccent","sectionAccent",(e,t,o)=>C(t)?ue(e,t,o):e],...P(H)],skip:e=>Pe(S(e))??(B(e)?Le:void 0),site:(e,t)=>C(e.props)?we(e,t):[],parts:[A("Series"),T("Cards",Ne,Fe,e=>M(e).map(t=>v({num:a(t.num),since:a(t.since),title:a(t.title),body:a(t.desc),count:a(t.entries),countLabel:a(t.entriesLabel)})),(e,t)=>({type:i,props:{...Ie,...w("background",(o,n)=>C(o)&&ye(o,n))(e,t),name:"Card"},slots:{[s]:[{type:i,props:{...r,name:"Words",gap:16,gapPhone:16},slots:{[s]:[{type:i,props:{...K,name:"Top"},slots:{[s]:[d("num",l,p("label",13),!0),d("since",l,p("label",13),!0)]}},d("title",{...l,tag:"h3"},{textStyle:"heading-3",...p("headingSmall",28),weight:500,case:"upper",lineHeight:1.04,letterSpacing:-.02}),d("body",x,{textStyle:"body-5",fontRole:"heading",...p("body",14),lineHeight:1.6})]}},{type:i,props:{...K,name:"Footer",align:"center",gap:0,gapPhone:0,sectionPaddingTop:16,sectionPaddingTopPhone:16,...c(1,0,0,0),...W(e)?{}:{[le]:["count","countLabel"]}},slots:{[s]:[{type:i,props:{...r,name:"Count",direction:"row",align:"center",gap:12,gapPhone:12,share:"content",[L("share")]:"content"},slots:{[s]:[d("count",l,E),d("countLabel",x,E)]}},...W(e)?[{type:i,props:{...r,name:"View",maxWidthPhone:266},slots:{[s]:[{type:"Text",props:{...l,text:O(e.viewLabel).text,_partStyles:{text:{...se()._partStyles.text,...E}}}}]}}]:[]]}}]}}))],reads:{viewLabel:"a Text typed once in the card template: the far end of every card's footer",background:"the Box's theme (the band preset) or its Fill"},drop:{...g,...u,headPlacement:Re}},V={top:60,bottom:60,topPhone:40,bottomPhone:40},Ue={...r,direction:"row",columns:3,gap:40,gapPhone:16},qe={...r,gap:8,gapPhone:8,...Oe(24),...c(1,1,1,1)},ze={name:"Document Detail Cards",boxProps:e=>({...y,direction:"column",gap:40,gapPhone:16,...c(0,0,1,0),...f(e,V)}),box:[...b,...P(V)],parts:[T("Cards",Ue,He,e=>M(e).map(t=>v({label:a(t.label),value:a(t.value),body:a(t.desc)})),(e,t)=>({type:i,props:{...qe,...w("surface")(e,t),name:"Card"},slots:{[s]:[d("label",l,{...p("label",12),lineHeight:1.5},!0),{type:i,props:{...r,name:"Words",gap:14,gapPhone:14},slots:{[s]:[d("value",l,{textStyle:"heading-3",...p("headingSmall",20),weight:500,letterSpacing:-.015,lineHeight:1.5}),d("body",x,{textStyle:"body-5",fontRole:"accent",...p("body",14),italic:!0,lineHeight:1.5})]}}]}}))],drop:{...g,...u}},wt={Cards:Ve,KeyFeatures:Be,Series:Ye,DocMetaCards:ze};export{wt as CARDS_SECTION_TO_BOX,yt as cardsPressStarter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DROP_COMMON as t,DROP_SIDE_PADDING as e,FOLLOW_THE_BOX as r,SAME_KEYS as n,SECTION_BOX as p,TEXT as c,smallText as d,wrapperPad as O,wrapperPadKeys as a}from"./section-to-box-row-parts.js";import{labelLook as _}from"../../../../../format/lib/document/seed-parts.js";import{COUNTDOWN_OWN_BOX_WORDS as i}from"../../../../../format/lib/document/blocks/general/Countdown/meta.js";const s={top:48,bottom:48,topPhone:48,bottomPhone:48},b={...d("title",{..._(12),color:"muted"}),props:{...c,align:"center"}},P=()=>({name:"Countdown",boxProps:o=>({...p,direction:"column",align:"center",gap:16,gapPhone:16,...O(o,s)}),box:[...n,...a(s)],parts:[b,{kind:"core",keep:"rest",props:r}],pressKeepsEmpty:[...i],drop:{...t,...e}}),m={top:80,bottom:80,topTablet:60,bottomTablet:60,topPhone:60,bottomPhone:60},l=()=>({name:"Feature Banner",boxProps:o=>({...p,direction:"column",sectionBorder:{bottom:1},...O(o,m)}),box:[...n,...a(m)],parts:[{kind:"core",keep:"rest",props:r}],drop:{...t,...e}}),C={Countdown:P(),FeaturedCover:l()};export{C as PROMO_SECTION_TO_BOX};
|