@taprootio/espalier 3.0.1 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{ACCEPTED_COLOR_FORMS as I,apcaContrast as pe,deriveSemantic as me,parseCssColor as O,parseOklch as ge,serializeOklch as de}from"./color-engine.js";import{computeVariants as he,parseAnchorSource as ye,resolveAnchorColor as be,resolveMappingSource as $e}from"./variant-engine.js";import{auditDataPalette as xe,DATA_SERIES_KEYS as P,DEFAULT_DATA_PALETTE as F,DEFAULT_DATA_RAMP_STEPS as ke,MAX_DATA_RAMP_STEPS as W,MIN_DATA_RAMP_LIGHTNESS_STEP as Y,MIN_DATA_RAMP_STEPS as j}from"./data-colors.js";const A=/^[a-z][a-z0-9-]*$/;function X(e){return ye(e)}function Se(e,t){return be(e,t)}function Ae(e,t){const r=X(e);if(r){const s=Se(t,r);return s&&O(s)?s:null}return O(e)?e:null}const H=["canvas","ink","accent","action","structure"],Z={canvas:{color:[["background","surface"],["layer1","raised1"],["layer2","raised2"],["layer3","raised3"],["layer4","raised4"]]},ink:{color:[["text","text"],["inputSelection","text"]],heading:[["headings","muted"],["headingsHover","ink"]]},accent:{color:[["linkHoverBg","raised2"],["inputSelectionBg","raised2"],["inputCaret","ink"]],text:[["link","accent"],["linkHover","text"]]},action:{color:[["actionBackground","muted"]],ink:[["actionText","surface"]]},structure:{color:[["border","border"],["shadow","shadow"]]}},Re=new Set(["action.color"]),Oe={canvas:"background",ink:"text",accent:"link",action:"actionBackground",structure:"border"},Ce={"action.ink":{role:"canvas",slot:"color"}},ve=.45;function Q(e,t){const r=te.actionText,s=[...R].sort((p,y)=>e[p]-e[y]||R.indexOf(p)-R.indexOf(y)),a=t?s.filter(p=>t(p)>=r.targetLc):s,u=a.length>0?a:s;let l,m=1/0;for(const p of u){const y=Math.abs(e[p]-ve);y<m&&(m=y,l=p)}return l??"muted"}function Me(e,t){const r=t[e]>.5;let s=R[0];for(const a of R)(r?t[a]<t[s]:t[a]>t[s])&&(s=a);return s}function L(e,t){if(e===void 0)return;if(typeof e=="string")return t==="color"?e:void 0;const r=e[t];return typeof r=="string"?r:void 0}function ee(e,t,r,s={}){const a={},u={};for(const[l,m]of Object.entries(s.explicitMappings??{}))m!==void 0&&(u[l]=m.lightness);for(const l of H){const m=e[l];if(m!==void 0)for(const[p,y]of Object.entries(Z[l])){const b=Ce[`${l}.${p}`];let h=L(m,p),n=!1;if(h===void 0&&(b&&(h=L(e[b.role],b.slot),h??=r[Oe[b.role]]?.source,n=h!==void 0),h??=L(m,"color")),h!==void 0)for(const[o,c]of y){let i=c;if(Re.has(`${l}.${p}`))i=Q(t,s.actionSurfaceContrast?f=>s.actionSurfaceContrast(h,f):void 0);else if(n&&b){const f=te[o],d=(f&&u[f.bg])??Q(t,s.actionSurfaceContrast?k=>s.actionSurfaceContrast(L(m,"color"),k):void 0);i=Me(d,t)}a[o]={source:h,lightness:i}}}}return a}const te={text:{bg:"background",targetLc:75},dangerText:{bg:"background",targetLc:75},headings:{bg:"background",targetLc:60},headingsHover:{bg:"background",targetLc:60},link:{bg:"background",targetLc:75},linkHover:{bg:"background",targetLc:75},actionText:{bg:"actionBackground",targetLc:75},inputCaret:{bg:"layer2",targetLc:60},inputSelection:{bg:"inputSelectionBg",targetLc:60}},z=["background","layer1","layer2","layer3","layer4","actionBackground","actionText","border","shadow","text","dangerText","headings","headingsHover","link","linkHover","linkHoverBg","inputCaret","inputSelection","inputSelectionBg"],K=["primary","analogous-left","analogous-right","complementary","split-complementary-left","split-complementary-right","triadic-left","triadic-right","danger","success","warning"],Te=["analogous-left","analogous-right","complementary","split-complementary-left","split-complementary-right","triadic-left","triadic-right","danger","success","warning"],R=["surface","raised1","raised2","raised3","raised4","accent","muted","text","border","ink","shadow"],Ee={surface:.99,raised1:.97,raised2:.9,raised3:.8,raised4:.72,accent:.5,muted:.45,text:.35,border:.3,ink:.25,shadow:.2},Be={surface:.15,raised1:.2,raised2:.3,raised3:.4,raised4:.36,accent:.6,muted:.75,text:.85,border:.7,ink:.95,shadow:.6},U={background:{source:"primary",lightness:"surface"},layer1:{source:"primary",lightness:"raised1"},layer2:{source:"primary",lightness:"raised2"},layer3:{source:"primary",lightness:"raised3"},layer4:{source:"primary",lightness:"raised4"},actionBackground:{source:"primary",lightness:"raised3"},actionText:{source:"primary",lightness:"ink"},border:{source:"primary",lightness:"border"},shadow:{source:"primary",lightness:"shadow"},text:{source:"primary",lightness:"text"},dangerText:{source:"danger",lightness:"text"},headings:{source:"primary",lightness:"muted"},headingsHover:{source:"primary",lightness:"text"},link:{source:"complementary",lightness:"accent"},linkHover:{source:"complementary",lightness:"text"},linkHoverBg:{source:"triadic-left",lightness:"raised2"},inputCaret:{source:"triadic-right",lightness:"ink"},inputSelection:{source:"complementary",lightness:"text"},inputSelectionBg:{source:"triadic-left",lightness:"raised2"}},B=.4;function G(){const e={};for(const t of z)e[t]={min:0,max:B};return e}const ne={seedColor:"oklch(0.7 0.125 216)",fontBody:"",fontHeadings:"",fontBrand:"",fontMonospace:"",fontWeightBody:"normal",fontWeightHeadings:"bold",fontWeightBrand:"bold",fontWeightMonospace:"normal",stylesheets:[],rootFontSize:16,typeRatio:1.25,spaceRatio:1.618,borderRadius:.2,viewportMin:320,viewportMax:1200,angles:{analogous:30,complementary:180,splitComplementary:30,triadic:120},semanticHues:{danger:27,success:150,warning:90},variantChroma:{},chroma:G(),semanticMappings:{...U},anchors:{},roles:{},contexts:{},dataPalette:{...F},dataRamps:{}},oe={...ne,chroma:G(),semanticMappings:{...U},anchors:{},roles:{},contexts:{},dataPalette:{...F},dataRamps:{},lightness:{...Ee}},we={...ne,chroma:G(),semanticMappings:{...U},anchors:{},roles:{},contexts:{},dataPalette:{...F},dataRamps:{},lightness:{...Be}},D=new WeakMap;D.set(oe,new Set),D.set(we,new Set);const se=new Set(["__proto__","constructor","prototype"]);function g(e){return!se.has(e)}function _e(e,t){return se.has(e)?void 0:t}function Ve(e){return`--esp-color-${e.replace(/([A-Z])/g,"-$1").replace(/(\d)/g,"-$1").toLowerCase()}`}function Ie(e){try{const t=atob(e),r=JSON.parse(t,_e);return typeof r!="object"||r===null||Array.isArray(r)?null:r}catch{return null}}function V(e){return btoa(JSON.stringify(e))}function N(e){if(ge(e))return e;const t=O(e);return t?de(t):e}function re(e,t){const r={};for(const[s,a]of Object.entries(e))g(s)&&(r[s]=a);if(!t)return r;for(const[s,a]of Object.entries(t)){if(a===void 0||!g(s))continue;const u=r[s];if(u!==void 0&&typeof a=="object"&&a!==null){const l={};if(typeof u=="string")l.color=u;else for(const[m,p]of Object.entries(u))g(m)&&(l[m]=p);for(const[m,p]of Object.entries(a))p!==void 0&&g(m)&&(l[m]=p);r[s]=l;continue}r[s]=a}return r}function ae(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;const t=e,r={};for(const s of H){const a=t[s];a!==void 0&&(r[s]=a)}if(typeof t.lightness=="object"&&t.lightness!==null&&!Array.isArray(t.lightness)){const s={};for(const a of R){const u=t.lightness[a];u!==void 0&&(s[a]=u)}r.lightness=s}return r}function Pe(e,t){const r={};for(const[s,a]of Object.entries(e)){if(!g(s)||!A.test(s))continue;const u=ae(a);u&&(r[s]=u)}if(!t)return r;for(const[s,a]of Object.entries(t)){if(!g(s)||!A.test(s)||a===void 0)continue;const u=ae(a);if(!u)continue;const l=r[s];r[s]={...l??{},...u,...l?.lightness||u.lightness?{lightness:{...l?.lightness,...u.lightness}}:{}}}return r}function v(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function M(e){const t={};for(const[r,s]of Object.entries(e))s!==void 0&&g(r)&&(t[r]=s);return t}function ie(e){if(!v(e))return e;const t=M(e);return v(e.lightness)&&(t.lightness=M(e.lightness)),t}function He(e,t){const r={};for(const[s,a]of Object.entries(e))g(s)&&(r[s]=ie(a));if(!t)return r;for(const[s,a]of Object.entries(t)){if(!g(s)||a===void 0)continue;const u=r[s];if(!v(u)||!v(a)){r[s]=ie(a);continue}const l={...M(u),...M(a)};v(u.lightness)&&v(a.lightness)?l.lightness={...M(u.lightness),...M(a.lightness)}:v(a.lightness)&&(l.lightness=M(a.lightness)),r[s]=l}return r}function Le(e){const t={};for(const[r,s]of Object.entries(e)){if(!g(r))continue;if(typeof s=="string"){t[r]=N(s);continue}const a={};for(const[u,l]of Object.entries(s))g(u)&&(a[u]=typeof l=="string"?N(l):l);t[r]=a}return t}function w(e){return typeof e!="string"?"":e.startsWith("anchor:")?e:N(e)}function De(e){const t={};for(const r of P)t[r]=w(e[r]);return t}function ce(e,t){const r={};for(const[s,a]of Object.entries(e))g(s)&&A.test(s)&&a&&typeof a=="object"&&!Array.isArray(a)&&(r[s]={...a});if(!t)return r;for(const[s,a]of Object.entries(t)){if(!g(s)||!A.test(s)||!a||typeof a!="object"||Array.isArray(a))continue;const u=r[s],l=u!==void 0&&a.type!==void 0&&a.type!==u.type;r[s]={...l?{}:u??{},...a}}return r}function Ne(e){const t={};for(const[r,s]of Object.entries(e))if(g(r)){if(s.type==="sequential"&&typeof s.source=="string"){t[r]={...s,source:w(s.source)};continue}if(s.type==="diverging"&&typeof s.start=="string"&&typeof s.end=="string"){t[r]={...s,start:w(s.start),end:w(s.end),...typeof s.neutral=="string"?{neutral:w(s.neutral)}:{}};continue}t[r]={...s}}return t}function ue(e){const t=O(e.seedColor);if(!t)return;const r=he(t,e);return(s,a)=>{const u=$e(s,r,e.anchors)??r.primary,l=e.chroma.actionBackground,m=me(u,e.lightness[a],l.min,l.max),p={l:m.l>.5?0:1,c:0,h:0};return Math.abs(pe(p,m))}}function Fe(e){const t=D.get(e);if(t)return new Set(t);const r=new Set,s=ee(e.roles,e.lightness,e.semanticMappings,{actionSurfaceContrast:ue(e)});for(const[a,u]of Object.entries(s)){const l=e.semanticMappings[a];(l.source!==u.source||l.lightness!==u.lightness)&&r.add(a)}return r}function We(e,t){const r={...e.roles,...t.roles},s=Pe(e.contexts,t.contexts),a={...e.lightness,...t.lightness},u=Le(re(e.anchors,t.anchors)),l=typeof t.seedColor=="string"?N(t.seedColor):e.seedColor,m=t.semanticMappings,p={...e.angles,...t.angles},y={...e.semanticHues,...t.semanticHues},b={...e.variantChroma,...t.variantChroma},h=_(e.chroma,t.chroma),n=De(_(e.dataPalette,t.dataPalette)),o=Ne(ce(e.dataRamps,t.dataRamps)),c=Fe(e),i=new Set(c),f={};for(const x of c)f[x]=e.semanticMappings[x];for(const[x,T]of Object.entries(m??{}))T!==void 0&&(i.add(x),f[x]=T);const d=_(e.semanticMappings,m),k=ue({angles:p,anchors:u,chroma:h,lightness:a,seedColor:l,semanticHues:y,variantChroma:b}),S=ee(r,a,d,{explicitMappings:f,actionSurfaceContrast:k}),E={};for(const[x,T]of Object.entries(S))i.has(x)||(E[x]=T);const C=_(_(e.semanticMappings,E),m),$={...e,seedColor:l,fontBody:t.fontBody??e.fontBody,fontHeadings:t.fontHeadings??e.fontHeadings,fontBrand:t.fontBrand??e.fontBrand,fontMonospace:t.fontMonospace??e.fontMonospace,fontWeightBody:String(t.fontWeightBody??e.fontWeightBody),fontWeightHeadings:String(t.fontWeightHeadings??e.fontWeightHeadings),fontWeightBrand:String(t.fontWeightBrand??e.fontWeightBrand),fontWeightMonospace:String(t.fontWeightMonospace??e.fontWeightMonospace),stylesheets:t.stylesheets??[...e.stylesheets],rootFontSize:t.rootFontSize??e.rootFontSize,typeRatio:t.typeRatio??e.typeRatio,spaceRatio:t.spaceRatio??e.spaceRatio,borderRadius:t.borderRadius??e.borderRadius,viewportMin:t.viewportMin??e.viewportMin,viewportMax:t.viewportMax??e.viewportMax,angles:p,semanticHues:y,variantChroma:b,lightness:a,chroma:h,semanticMappings:C,anchors:u,roles:r,contexts:s,dataPalette:n,dataRamps:o};return t.pageBackgroundImage!==void 0&&($.pageBackgroundImage=t.pageBackgroundImage),t.pageBackgroundImageOpacity!==void 0&&($.pageBackgroundImageOpacity=t.pageBackgroundImageOpacity),t.boxBackgroundImage!==void 0&&($.boxBackgroundImage=t.boxBackgroundImage),t.boxBackgroundImageOpacity!==void 0&&($.boxBackgroundImageOpacity=t.boxBackgroundImageOpacity),t.vellumOpacity!==void 0&&($.vellumOpacity=t.vellumOpacity),t.vellumBackgroundImage!==void 0&&($.vellumBackgroundImage=t.vellumBackgroundImage),t.vellumBackgroundImageOpacity!==void 0&&($.vellumBackgroundImageOpacity=t.vellumBackgroundImageOpacity),D.set($,new Set(i)),$}function _(e,t){if(!t)return{...e};const r={...e};for(const s of Object.keys(t)){const a=t[s];a!==void 0&&(r[s]=a)}return r}function J(e){let t;try{t=atob(e)}catch{return{error:"Failed to decode Base64 string."}}let r;try{r=JSON.parse(t)}catch{return{error:"Decoded string is not valid JSON."}}return typeof r!="object"||r===null||Array.isArray(r)?{error:"Theme must be a JSON object."}:{value:r}}function Je(e){const t=J(e);return t.error!==void 0?{valid:!1,errors:[t.error],warnings:[]}:q(t.value)}function q(e){const t=[],r=[];"seedColor"in e&&(typeof e.seedColor!="string"?t.push("seedColor must be a string."):O(e.seedColor)||t.push(`seedColor is not a valid CSS color: "${e.seedColor}". Accepted forms: ${I}.`));for(const n of["fontBody","fontHeadings","fontBrand","fontMonospace"])n in e&&typeof e[n]!="string"&&t.push(`${n} must be a string.`);const s=["normal","bold","lighter","bolder"],a=["inherit","initial","unset","revert","revert-layer"];for(const n of["fontWeightBody","fontWeightHeadings","fontWeightBrand","fontWeightMonospace"])if(n in e){const o=e[n];if(typeof o=="number")(o<1||o>1e3)&&t.push(`${n} numeric value must be 1\u20131000 (got ${o}).`);else if(typeof o=="string"){const c=s.includes(o)||a.includes(o);if(/^\d+$/.test(o)){const f=Number(o);(f<1||f>1e3)&&t.push(`${n} numeric value must be 1\u20131000 (got "${o}").`)}else c||r.push(`${n} = "${o}" is not a standard font-weight value.`)}else t.push(`${n} must be a string or number.`)}"stylesheets"in e&&(Array.isArray(e.stylesheets)?e.stylesheets.some(n=>typeof n!="string")&&t.push("Every entry in stylesheets must be a string."):t.push("stylesheets must be an array of strings."));const u=[["rootFontSize",1,100],["borderRadius",0,10],["viewportMin",100,1e4],["viewportMax",200,1e4]];for(const[n,o,c]of u)if(n in e)if(typeof e[n]!="number"||!isFinite(e[n]))t.push(`${n} must be a finite number.`);else{const i=e[n];o!==void 0&&i<o&&t.push(`${n} must be \u2265 ${o} (got ${i}).`),c!==void 0&&i>c&&r.push(`${n} = ${i} is unusually high (max ${c}).`)}for(const n of["typeRatio","spaceRatio"])if(n in e)if(typeof e[n]!="number"||!isFinite(e[n]))t.push(`${n} must be a finite number.`);else{const o=e[n];o<=1&&t.push(`${n} must be > 1 (got ${o}).`);const c=n==="typeRatio"?1.3:2;o>c&&r.push(`${n} = ${o} is very high (max ${c}); scales may be extreme.`)}if("viewportMin"in e&&"viewportMax"in e){const n=e.viewportMin,o=e.viewportMax;typeof n=="number"&&typeof o=="number"&&n>=o&&t.push(`viewportMin (${n}) must be less than viewportMax (${o}).`)}if("angles"in e)if(typeof e.angles!="object"||e.angles===null)t.push("angles must be an object.");else{const n=e.angles;for(const o of["analogous","complementary","splitComplementary","triadic"])if(o in n)if(typeof n[o]!="number"||!isFinite(n[o]))t.push(`angles.${o} must be a finite number.`);else{const c=n[o];(c<0||c>360)&&r.push(`angles.${o} = ${c} is outside 0\u2013360.`)}}if("semanticHues"in e)if(typeof e.semanticHues!="object"||e.semanticHues===null)t.push("semanticHues must be an object.");else{const n=e.semanticHues;for(const o of["danger","success","warning"])if(o in n)if(typeof n[o]!="number"||!isFinite(n[o]))t.push(`semanticHues.${o} must be a finite number.`);else{const c=n[o];(c<0||c>360)&&r.push(`semanticHues.${o} = ${c} is outside 0\u2013360.`)}}if("variantChroma"in e)if(typeof e.variantChroma!="object"||e.variantChroma===null)t.push("variantChroma must be an object.");else{const n=e.variantChroma;for(const o of Te)if(o in n)if(typeof n[o]!="number"||!isFinite(n[o]))t.push(`variantChroma["${o}"] must be a finite number.`);else{const c=n[o];c<0&&t.push(`variantChroma["${o}"] must be \u2265 0 (got ${c}).`),c>B&&r.push(`variantChroma["${o}"] = ${c} exceeds ${B}.`)}}function l(n,o){if(typeof n!="object"||n===null||Array.isArray(n)){t.push(`${o} must be an object.`);return}const c=n;for(const i of R)if(i in c)if(typeof c[i]!="number"||!isFinite(c[i]))t.push(`${o}.${i} must be a finite number.`);else{const f=c[i];(f<0||f>1)&&t.push(`${o}.${i} must be 0\u20131 (got ${f}).`)}}if("lightness"in e&&l(e.lightness,"lightness"),"chroma"in e)if(typeof e.chroma!="object"||e.chroma===null)t.push("chroma must be an object.");else{const n=e.chroma;for(const o of z)if(o in n){const c=n[o];if(typeof c!="object"||c===null){t.push(`chroma.${o} must be { min, max }.`);continue}const i=c;(typeof i.min!="number"||i.min<0)&&t.push(`chroma.${o}.min must be \u2265 0.`),(typeof i.max!="number"||i.max<0||i.max>B)&&t.push(`chroma.${o}.max must be 0\u2013${B}.`),typeof i.min=="number"&&typeof i.max=="number"&&i.min>i.max&&t.push(`chroma.${o}.min (${i.min}) must be \u2264 max (${i.max}).`)}}if("anchors"in e)if(typeof e.anchors!="object"||e.anchors===null||Array.isArray(e.anchors))t.push("anchors must be an object of named colors.");else for(const[n,o]of Object.entries(e.anchors))if(g(n)?A.test(n)||t.push(`anchors: "${n}" is not a valid anchor name; use a lowercase slug (letters, digits, hyphens).`):t.push(`anchors: "${n}" is a reserved JavaScript property name and cannot be an anchor name; rename it.`),K.includes(n)&&t.push(`anchors: "${n}" collides with a reserved color source name.`),typeof o=="string")O(o)||t.push(`anchors.${n} is not a valid CSS color: "${o}". Accepted forms: ${I}.`);else if(typeof o=="object"&&o!==null&&!Array.isArray(o)){const c=o;typeof c.color!="string"&&t.push(`anchors.${n} must declare its base "color".`);for(const[i,f]of Object.entries(c))g(i)?i!=="color"&&!A.test(i)&&t.push(`anchors.${n}: "${i}" is not a valid slot name; use a lowercase slug.`):t.push(`anchors.${n}: "${i}" is a reserved JavaScript property name and cannot be a slot name; rename it.`),typeof f!="string"?t.push(`anchors.${n}.${i} must be a CSS color string.`):O(f)||t.push(`anchors.${n}.${i} is not a valid CSS color: "${f}". Accepted forms: ${I}.`)}else t.push(`anchors.${n} must be a color string or a { color, \u2026slots } object.`);const m=new Map;if("anchors"in e&&typeof e.anchors=="object"&&e.anchors!==null&&!Array.isArray(e.anchors))for(const[n,o]of Object.entries(e.anchors))m.set(n,o);function p(n,o){const c=X(n);if(!c){t.push(`${o} "${n}" is not valid anchor syntax; use anchor:<name> or anchor:<name>.<slot>.`);return}if(!m.has(c.name)){const i=[...m.keys()];t.push(`${o} references undeclared anchor "${c.name}". Declared anchors: ${i.length>0?i.join(", "):"(none)"}.`);return}if(c.slot!==void 0){const i=m.get(c.name);if(typeof(typeof i=="object"&&i!==null&&!Array.isArray(i)?i[c.slot]:void 0)!="string"){const d=typeof i=="object"&&i!==null?Object.keys(i).filter(k=>k!=="color"):[];t.push(`${o} references unknown slot "${c.slot}" on anchor "${c.name}". Declared slots: ${d.length>0?d.join(", "):"(none)"}.`)}}}function y(n,o){if(n.startsWith("anchor:")){p(n,o);return}K.includes(n)||t.push(`${o} must be one of: ${K.join(", ")}, or a declared anchor as anchor:<name> / anchor:<name>.<slot>.`)}function b(n,o){if(n.startsWith("anchor:")){p(n,o);return}O(n)||t.push(`${o} is not a valid CSS color: "${n}". Accepted forms: ${I}, or a declared anchor as anchor:<name> / anchor:<name>.<slot>.`)}if("dataPalette"in e)if(typeof e.dataPalette!="object"||e.dataPalette===null||Array.isArray(e.dataPalette))t.push("dataPalette must be an object with series1\u2013series8 color values.");else{const n=e.dataPalette;for(const[o,c]of Object.entries(n)){if(!P.includes(o)){t.push(`dataPalette.${o} is not a series slot; expected one of: ${P.join(", ")}.`);continue}typeof c!="string"?t.push(`dataPalette.${o} must be a CSS color or anchor reference string.`):b(c,`dataPalette.${o}`)}}if("dataRamps"in e)if(typeof e.dataRamps!="object"||e.dataRamps===null||Array.isArray(e.dataRamps))t.push("dataRamps must be an object of named ramp declarations.");else for(const[n,o]of Object.entries(e.dataRamps)){if(g(n)?A.test(n)||t.push(`dataRamps: "${n}" is not a valid ramp name; use a lowercase slug (letters, digits, hyphens).`):t.push(`dataRamps: "${n}" is a reserved JavaScript property name and cannot be a ramp name; rename it.`),typeof o!="object"||o===null||Array.isArray(o)){t.push(`dataRamps.${n} must be a sequential or diverging ramp object.`);continue}const c=o,i=c.steps??ke;if((typeof i!="number"||!Number.isInteger(i)||i<j||i>W)&&t.push(`dataRamps.${n}.steps must be an integer from ${j} through ${W}.`),c.type==="sequential"){typeof c.source!="string"?t.push(`dataRamps.${n}.source must be a CSS color or anchor reference string.`):b(c.source,`dataRamps.${n}.source`);const f=c.lightnessStart??.95,d=c.lightnessEnd??.25;for(const[k,S]of[["lightnessStart",f],["lightnessEnd",d]])(typeof S!="number"||!Number.isFinite(S)||S<0||S>1)&&t.push(`dataRamps.${n}.${k} must be a finite number from 0 through 1.`);typeof f=="number"&&typeof d=="number"&&f<=d?t.push(`dataRamps.${n}.lightnessStart must be greater than lightnessEnd.`):typeof f=="number"&&Number.isFinite(f)&&typeof d=="number"&&Number.isFinite(d)&&typeof i=="number"&&Number.isInteger(i)&&i>=j&&i<=W&&(f-d)/(i-1)<=Y&&t.push(`dataRamps.${n} lightness bounds must leave more than ${Y} lightness between serialized stops.`);continue}if(c.type==="diverging"){typeof i=="number"&&Number.isInteger(i)&&i%2===0&&t.push(`dataRamps.${n}.steps must be odd so the neutral is the exact midpoint.`);for(const f of["start","end"])typeof c[f]!="string"?t.push(`dataRamps.${n}.${f} must be a CSS color or anchor reference string.`):b(c[f],`dataRamps.${n}.${f}`);"neutral"in c&&(typeof c.neutral!="string"?t.push(`dataRamps.${n}.neutral must be a CSS color or anchor reference string.`):b(c.neutral,`dataRamps.${n}.neutral`));continue}t.push(`dataRamps.${n}.type must be "sequential" or "diverging".`)}if("dataPalette"in e&&t.length===0){const n=We(oe,e),o={};let c=!0;for(const i of P){const f=Ae(n.dataPalette[i],n.anchors);if(!f){c=!1;break}o[i]=f}if(c)for(const i of xe(o))r.push(`dataPalette.${i.series[0]} and dataPalette.${i.series[1]} are only ${i.distance.toFixed(4)} apart under ${i.simulation} simulation (minimum ${i.threshold.toFixed(4)}); also distinguish the series with labels, shapes, or patterns.`)}function h(n,o){if(typeof n!="object"||n===null||Array.isArray(n)){t.push(`${o} must be an object.`);return}const c=n;for(const[i,f]of Object.entries(c)){const d=`${o}.${i}`;if(!H.includes(i)){t.push(`${d} is not a role; expected one of: ${H.join(", ")}. (The status family is reserved and is not a role.)`);continue}const k=i,S=Z[k];if(typeof f=="string"){y(f,d);continue}if(typeof f!="object"||f===null||Array.isArray(f)){t.push(`${d} must be a color source or a { color, \u2026slots } object.`);continue}const E=f;typeof E.color!="string"&&t.push(`${d} must declare its base "color".`);for(const[C,$]of Object.entries(E)){if(!Object.prototype.hasOwnProperty.call(S,C)||!g(C)){const x=Object.keys(S).filter(T=>T!=="color");t.push(`${d}.${C} is not a slot of the ${k} role. Declared slots: ${x.length>0?x.join(", "):"(none)"}.`);continue}typeof $!="string"?t.push(`${d}.${C} must be a color source string.`):y($,`${d}.${C}`)}}}if("roles"in e&&h(e.roles,"roles"),"contexts"in e)if(typeof e.contexts!="object"||e.contexts===null||Array.isArray(e.contexts))t.push("contexts must be an object.");else for(const[n,o]of Object.entries(e.contexts)){if(!g(n)||!A.test(n)){t.push(`contexts.${n} must be a lowercase slug matching ${A.source}.`);continue}if(typeof o!="object"||o===null||Array.isArray(o)){h(o,`contexts.${n}`);continue}const c=o,i=Object.fromEntries(Object.entries(c).filter(([f])=>f!=="lightness"));h(i,`contexts.${n}`),"lightness"in c&&l(c.lightness,`contexts.${n}.lightness`)}if("semanticMappings"in e)if(typeof e.semanticMappings!="object"||e.semanticMappings===null)t.push("semanticMappings must be an object.");else{const n=e.semanticMappings;for(const o of z)if(o in n){const c=n[o];if(typeof c!="object"||c===null){t.push(`semanticMappings.${o} must be { source, lightness }.`);continue}const i=c;typeof i.source!="string"?t.push(`semanticMappings.${o}.source must be a string.`):y(i.source,`semanticMappings.${o}.source`),(typeof i.lightness!="string"||!R.includes(i.lightness))&&t.push(`semanticMappings.${o}.lightness must be one of: ${R.join(", ")}.`)}}for(const n of["pageBackgroundImage","boxBackgroundImage","vellumBackgroundImage"])n in e&&typeof e[n]!="string"&&t.push(`${n} must be a string.`);for(const n of["pageBackgroundImageOpacity","boxBackgroundImageOpacity","vellumOpacity","vellumBackgroundImageOpacity"])if(n in e)if(typeof e[n]!="number"||!isFinite(e[n]))t.push(`${n} must be a finite number.`);else{const o=e[n];(o<0||o>1)&&t.push(`${n} must be 0\u20131 (got ${o}).`)}return{valid:t.length===0,errors:t,warnings:r}}function qe(e,t){const r=J(e),s=J(t),a=r.error!==void 0?{valid:!1,errors:[r.error],warnings:[]}:q(r.value),u=s.error!==void 0?{valid:!1,errors:[s.error],warnings:[]}:q(s.value),l=[...a.errors.map(p=>`light: ${p}`),...u.errors.map(p=>`dark: ${p}`)],m=[...a.warnings.map(p=>`light: ${p}`),...u.warnings.map(p=>`dark: ${p}`)];if(a.valid&&u.valid){const p=new Set(Object.keys(r.value?.contexts??{})),y=new Set(Object.keys(s.value?.contexts??{})),b=[...y].filter(n=>!p.has(n)).sort(),h=[...p].filter(n=>!y.has(n)).sort();(b.length>0||h.length>0)&&l.push(`contexts must declare the same names in both schemes. Missing from light: ${b.join(", ")||"(none)"}. Missing from dark: ${h.join(", ")||"(none)"}.`)}return{valid:l.length===0,errors:l,warnings:m}}const je=["anchors","angles","contexts","dataPalette","dataRamps","roles","chroma","lightness","semanticHues","semanticMappings","variantChroma"];function ze(e,t){const r={};for(const[s,a]of Object.entries(e))g(s)&&(r[s]=a);for(const[s,a]of Object.entries(t))a!==void 0&&g(s)&&(r[s]=a);for(const s of je){const a=e[s],u=t[s];if(a&&typeof a=="object"&&!Array.isArray(a)&&u&&typeof u=="object"&&!Array.isArray(u)){if(s==="anchors"){r[s]=re(a,u);continue}if(s==="contexts"){r[s]=He(a,u);continue}if(s==="dataRamps"){r[s]=ce(a,u);continue}const l={};for(const[m,p]of Object.entries(a))g(m)&&(l[m]=p);for(const[m,p]of Object.entries(u))p!==void 0&&g(m)&&(l[m]=p);r[s]=l}}return r}function Ye(...e){let t={};for(const r of e){if(!r)continue;const s=Ie(r);s&&(t=ze(t,s))}return V(t)}function le(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r")}const fe={borderRadius:.1,fontBody:'"Noto Sans", sans-serif',fontWeightBody:"normal",fontHeadings:'"Inika", serif',fontWeightHeadings:"normal",fontBrand:'"Inika", serif',fontWeightBrand:"normal",fontMonospace:'"JetBrains Mono", monospace',fontWeightMonospace:"normal",seedColor:"oklch(.07 0.15 216)"};function Xe(e){return V({...fe,pageBackgroundImage:`url("${le(e)}")`,pageBackgroundImageOpacity:.5})}function Ze(e){return V({...fe,pageBackgroundImage:`url("${le(e)}")`,pageBackgroundImageOpacity:.55})}export{A as ANCHOR_SLUG_PATTERN,K as COLOR_SOURCES,Be as DEFAULT_DARK_LIGHTNESS,we as DEFAULT_DARK_THEME,Ee as DEFAULT_LIGHT_LIGHTNESS,oe as DEFAULT_LIGHT_THEME,U as DEFAULT_SEMANTIC_MAPPINGS,R as LIGHTNESS_KEYS,je as NESTED_THEME_KEYS,H as ROLE_NAMES,Ce as ROLE_PAIRED_INK,Z as ROLE_TOKEN_PLAN,z as SEMANTIC_COLOR_NAMES,te as TOKEN_PAIRINGS,Te as VARIANT_COLOR_SOURCES,Ze as buildTaprootDarkTheme,Xe as buildTaprootLightTheme,ee as compileRoles,V as encodeTheme,Ye as layerThemes,ze as mergePartials,We as mergeTheme,X as parseAnchorSource,Ie as parseTheme,Se as resolveAnchorColor,Ae as resolveDataColorSource,Ve as semanticToCSS,Je as validateTheme,qe as validateThemePair};
1
+ import{ACCEPTED_COLOR_FORMS as ee,apcaContrast as nt,clampChannel as le,deriveSemantic as we,gamutMapToSRGB as fe,linearRgbToOklab as ot,oklchToSRGB as st,parseCssColor as N,parseOklch as rt,serializeOklch as ae,srgbToLinearRGB as at}from"./color-engine.js";import{computeVariants as Ee,parseAnchorSource as it,resolveAnchorColor as ct,resolveMappingSource as _e}from"./variant-engine.js";import{auditColorDistances as Ie,auditDataPalette as ut,DATA_SERIES_KEYS as ie,DEFAULT_DATA_PALETTE as pe,DEFAULT_DATA_RAMP_STEPS as lt,MAX_DATA_RAMP_STEPS as me,MIN_DATA_RAMP_LIGHTNESS_STEP as Le,MIN_DATA_RAMP_STEPS as he}from"./data-colors.js";const z=/^[a-z][a-z0-9-]*$/;function de(e){return it(e)}function He(e,n){return ct(e,n)}function ft(e,n){const t=de(e);if(t){const o=He(n,t);return o&&N(o)?o:null}return N(e)?e:null}const Z=["canvas","ink","accent","action","structure"],Pe={canvas:{color:[["background","surface"],["layer1","raised1"],["layer2","raised2"],["layer3","raised3"],["layer4","raised4"]]},ink:{color:[["text","text"],["inputSelection","text"]],heading:[["headings","muted"],["headingsHover","ink"]]},accent:{color:[["linkHoverBg","raised2"],["inputSelectionBg","raised2"],["inputCaret","ink"]],text:[["link","accent"]],hover:[["linkHover","text"]]},action:{color:[["actionBackground","muted"]],ink:[["actionText","surface"]]},structure:{color:[["border","border"],["shadow","shadow"]]}},pt=new Set(["action.color"]),mt={canvas:"background",ink:"text",accent:"link",action:"actionBackground",structure:"border"},ht={"action.ink":{role:"canvas",slot:"color"}},dt=.45;function De(e,n){const t=Fe.actionText,o=[...j].sort((p,S)=>e[p]-e[S]||j.indexOf(p)-j.indexOf(S)),a=n?o.filter(p=>n(p)>=t.targetLc):o,u=a.length>0?a:o;let f,h=1/0;for(const p of u){const S=Math.abs(e[p]-dt);S<h&&(h=S,f=p)}return f??"muted"}function gt(e,n){const t=n[e]>.5;let o=j[0];for(const a of j)(t?n[a]<n[o]:n[a]>n[o])&&(o=a);return o}const yt={"accent.hover":"text"};function bt(e,n){const t=new Map;try{const o=se(n,e),a=(u,f,h,p)=>{const S=de(f),$=S?He(p,S):null,x=$===null?null:N($),C=t.get(u)??[];C.some(s=>s.source===f&&s.chroma===x?.c)||(C.push({source:f,where:h,chroma:x?.c}),t.set(u,C))};for(const[u,f]of Object.entries(o.semanticMappings))f.source.startsWith("anchor:")&&a(u,f.source,"the root table",o.anchors);for(const[u,f]of Object.entries(o.contexts)){const h={};for(const S of Z){const $=f[S];$!==void 0&&(h[S]=$)}const p=se(o,{lightness:f.lightness,roles:h});for(const[S,$]of Object.entries(p.semanticMappings))$.source.startsWith("anchor:")&&a(S,$.source,`contexts.${u}`,p.anchors)}}catch{return new Map}return t}function te(e,n){if(e===void 0)return;if(typeof e=="string")return n==="color"?e:void 0;const t=e[n];return typeof t=="string"?t:void 0}function Ne(e,n,t,o={}){const a={},u={};for(const[f,h]of Object.entries(o.explicitMappings??{}))h!==void 0&&(u[f]=h.lightness);for(const f of Z){const h=e[f];if(h!==void 0)for(const[p,S]of Object.entries(Pe[f])){const $=ht[`${f}.${p}`];let x=te(h,p),C=!1;if(x===void 0){$&&(x=te(e[$.role],$.slot),x??=t[mt[$.role]]?.source,C=x!==void 0);const s=yt[`${f}.${p}`];s!==void 0&&(x??=te(h,s)),x??=te(h,"color")}if(x!==void 0)for(const[s,r]of S){let i=r;if(pt.has(`${f}.${p}`))i=De(n,o.actionSurfaceContrast?c=>o.actionSurfaceContrast(x,c):void 0);else if(C&&$){const c=Fe[s],m=(c&&u[c.bg])??De(n,o.actionSurfaceContrast?y=>o.actionSurfaceContrast(te(h,"color"),y):void 0);i=gt(m,n)}a[s]={source:x,lightness:i}}}}return a}const Fe={text:{bg:"background",targetLc:75},dangerText:{bg:"background",targetLc:75},headings:{bg:"background",targetLc:60},headingsHover:{bg:"background",targetLc:60},link:{bg:"background",targetLc:75},linkHover:{bg:"background",targetLc:75},actionText:{bg:"actionBackground",targetLc:75},inputCaret:{bg:"layer2",targetLc:60},inputSelection:{bg:"inputSelectionBg",targetLc:60}},ge=["background","layer1","layer2","layer3","layer4","actionBackground","actionText","border","shadow","text","dangerText","headings","headingsHover","link","linkHover","linkHoverBg","inputCaret","inputSelection","inputSelectionBg"],ye=["primary","analogous-left","analogous-right","complementary","split-complementary-left","split-complementary-right","triadic-left","triadic-right","danger","success","warning","info"],Q=["danger","success","warning","info"],$t=["analogous-left","analogous-right","complementary","split-complementary-left","split-complementary-right","triadic-left","triadic-right","danger","success","warning","info"],j=["surface","raised1","raised2","raised3","raised4","accent","muted","text","border","ink","shadow"],St={surface:.99,raised1:.97,raised2:.9,raised3:.8,raised4:.72,accent:.5,muted:.45,text:.35,border:.3,ink:.25,shadow:.2},xt={surface:.15,raised1:.2,raised2:.3,raised3:.4,raised4:.36,accent:.6,muted:.75,text:.85,border:.7,ink:.95,shadow:.6},be={background:{source:"primary",lightness:"surface"},layer1:{source:"primary",lightness:"raised1"},layer2:{source:"primary",lightness:"raised2"},layer3:{source:"primary",lightness:"raised3"},layer4:{source:"primary",lightness:"raised4"},actionBackground:{source:"primary",lightness:"raised3"},actionText:{source:"primary",lightness:"ink"},border:{source:"primary",lightness:"border"},shadow:{source:"primary",lightness:"shadow"},text:{source:"primary",lightness:"text"},dangerText:{source:"danger",lightness:"text"},headings:{source:"primary",lightness:"muted"},headingsHover:{source:"primary",lightness:"text"},link:{source:"complementary",lightness:"accent"},linkHover:{source:"complementary",lightness:"text"},linkHoverBg:{source:"triadic-left",lightness:"raised2"},inputCaret:{source:"triadic-right",lightness:"ink"},inputSelection:{source:"complementary",lightness:"text"},inputSelectionBg:{source:"triadic-left",lightness:"raised2"}},G=.4;function $e(){const e={};for(const n of ge)e[n]={min:0,max:G};return e}const We={seedColor:"oklch(0.7 0.125 216)",fontBody:"",fontHeadings:"",fontBrand:"",fontMonospace:"",fontWeightBody:"normal",fontWeightHeadings:"bold",fontWeightBrand:"bold",fontWeightMonospace:"normal",stylesheets:[],rootFontSize:16,typeRatio:1.25,spaceRatio:1.618,borderRadius:.2,viewportMin:320,viewportMax:1200,angles:{analogous:30,complementary:180,splitComplementary:30,triadic:120},semanticHues:{danger:27,success:150,warning:90,info:244},variantChroma:{},intents:{},chroma:$e(),semanticMappings:{...be},anchors:{},roles:{},contexts:{},dataPalette:{...pe},dataRamps:{}},Se={...We,chroma:$e(),semanticMappings:{...be},anchors:{},roles:{},contexts:{},dataPalette:{...pe},dataRamps:{},lightness:{...St}},Ke={...We,chroma:$e(),semanticMappings:{...be},anchors:{},roles:{},contexts:{},dataPalette:{...pe},dataRamps:{},lightness:{...xt}},ce=new WeakMap;ce.set(Se,new Set),ce.set(Ke,new Set);const Ue=new Set(["__proto__","constructor","prototype"]);function A(e){return!Ue.has(e)}function kt(e,n){return Ue.has(e)?void 0:n}function Wt(e){return`--esp-color-${e.replace(/([A-Z])/g,"-$1").replace(/(\d)/g,"-$1").toLowerCase()}`}function At(e){try{const n=ze(e),t=JSON.parse(n,kt);return typeof t!="object"||t===null||Array.isArray(t)?null:t}catch{return null}}const xe="\xEF\xBB\xBF";function vt(e){if(/^[\u0000-\u007f]*$/.test(e))return btoa(e);const n=new TextEncoder().encode(e);let t=xe;for(const o of n)t+=String.fromCharCode(o);return btoa(t)}function ze(e){const n=atob(e);if(!n.startsWith(xe))return n;const t=Uint8Array.from(n.slice(xe.length),o=>o.charCodeAt(0));return new TextDecoder("utf-8",{fatal:!0}).decode(t)}function ke(e){return vt(JSON.stringify(e))}function Rt(e){const n={};for(const t of Q){const o=e[t];typeof o=="string"&&(n[t]=o.startsWith("anchor:")?o:ne(o))}return n}function ne(e){if(rt(e))return e;const n=N(e);return n?ae(n):e}function je(e,n){const t={};for(const[o,a]of Object.entries(e))A(o)&&(t[o]=a);if(!n)return t;for(const[o,a]of Object.entries(n)){if(a===void 0||!A(o))continue;const u=t[o];if(u!==void 0&&typeof a=="object"&&a!==null){const f={};if(typeof u=="string")f.color=u;else for(const[h,p]of Object.entries(u))A(h)&&(f[h]=p);for(const[h,p]of Object.entries(a))p!==void 0&&A(h)&&(f[h]=p);t[o]=f;continue}t[o]=a}return t}function Ge(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;const n=e,t={};for(const o of Z){const a=n[o];a!==void 0&&(t[o]=a)}if(typeof n.lightness=="object"&&n.lightness!==null&&!Array.isArray(n.lightness)){const o={};for(const a of j){const u=n.lightness[a];u!==void 0&&(o[a]=u)}t.lightness=o}return t}function Ot(e,n){const t={};for(const[o,a]of Object.entries(e)){if(!A(o)||!z.test(o))continue;const u=Ge(a);u&&(t[o]=u)}if(!n)return t;for(const[o,a]of Object.entries(n)){if(!A(o)||!z.test(o)||a===void 0)continue;const u=Ge(a);if(!u)continue;const f=t[o];t[o]={...f??{},...u,...f?.lightness||u.lightness?{lightness:{...f?.lightness,...u.lightness}}:{}}}return t}function V(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Y(e){const n={};for(const[t,o]of Object.entries(e))o!==void 0&&A(t)&&(n[t]=o);return n}function Je(e){if(!V(e))return e;const n=Y(e);return V(e.lightness)&&(n.lightness=Y(e.lightness)),n}function Ct(e,n){const t={};for(const[o,a]of Object.entries(e))A(o)&&(t[o]=Je(a));if(!n)return t;for(const[o,a]of Object.entries(n)){if(!A(o)||a===void 0)continue;const u=t[o];if(!V(u)||!V(a)){t[o]=Je(a);continue}const f={...Y(u),...Y(a)};V(u.lightness)&&V(a.lightness)?f.lightness={...Y(u.lightness),...Y(a.lightness)}:V(a.lightness)&&(f.lightness=Y(a.lightness)),t[o]=f}return t}function Mt(e){const n={};for(const[t,o]of Object.entries(e)){if(!A(t))continue;if(typeof o=="string"){n[t]=ne(o);continue}const a={};for(const[u,f]of Object.entries(o))A(u)&&(a[u]=typeof f=="string"?ne(f):f);n[t]=a}return n}function oe(e){return typeof e!="string"?"":e.startsWith("anchor:")?e:ne(e)}function Tt(e){const n={};for(const t of ie)n[t]=oe(e[t]);return n}function Ve(e,n){const t={};for(const[o,a]of Object.entries(e))A(o)&&z.test(o)&&a&&typeof a=="object"&&!Array.isArray(a)&&(t[o]={...a});if(!n)return t;for(const[o,a]of Object.entries(n)){if(!A(o)||!z.test(o)||!a||typeof a!="object"||Array.isArray(a))continue;const u=t[o],f=u!==void 0&&a.type!==void 0&&a.type!==u.type;t[o]={...f?{}:u??{},...a}}return t}function Bt(e){const n={};for(const[t,o]of Object.entries(e))if(A(t)){if(o.type==="sequential"&&typeof o.source=="string"){n[t]={...o,source:oe(o.source)};continue}if(o.type==="diverging"&&typeof o.start=="string"&&typeof o.end=="string"){n[t]={...o,start:oe(o.start),end:oe(o.end),...typeof o.neutral=="string"?{neutral:oe(o.neutral)}:{}};continue}n[t]={...o}}return n}function Ye(e){const n=N(e.seedColor);if(!n)return;const t=Ee(n,e);return(o,a)=>{const u=_e(o,t,e.anchors)??t.primary,f=e.chroma.actionBackground,h=we(u,e.lightness[a],f.min,f.max),p={l:h.l>.5?0:1,c:0,h:0};return Math.abs(nt(p,h))}}function wt(e){const n=ce.get(e);if(n)return new Set(n);const t=new Set,o=Ne(e.roles,e.lightness,e.semanticMappings,{actionSurfaceContrast:Ye(e)});for(const[a,u]of Object.entries(o)){const f=e.semanticMappings[a];(f.source!==u.source||f.lightness!==u.lightness)&&t.add(a)}return t}function se(e,n){const t={...e.roles,...n.roles},o=Ot(e.contexts,n.contexts),a={...e.lightness,...n.lightness},u=Mt(je(e.anchors,n.anchors)),f=typeof n.seedColor=="string"?ne(n.seedColor):e.seedColor,h=n.semanticMappings,p={...e.angles,...n.angles},S={...e.semanticHues,...n.semanticHues},$={...e.variantChroma,...n.variantChroma},x=Rt({...e.intents,...n.intents}),C=re(e.chroma,n.chroma),s=Tt(re(e.dataPalette,n.dataPalette)),r=Bt(Ve(e.dataRamps,n.dataRamps)),i=wt(e),c=new Set(i),m={};for(const g of i)m[g]=e.semanticMappings[g];for(const[g,b]of Object.entries(h??{}))b!==void 0&&(c.add(g),m[g]=b);const y=re(e.semanticMappings,h),I=Ye({angles:p,anchors:u,chroma:C,intents:x,lightness:a,seedColor:f,semanticHues:S,variantChroma:$}),D=Ne(t,a,y,{explicitMappings:m,actionSurfaceContrast:I}),W={};for(const[g,b]of Object.entries(D))c.has(g)||(W[g]=b);const l=re(re(e.semanticMappings,W),h),d={...e,seedColor:f,fontBody:n.fontBody??e.fontBody,fontHeadings:n.fontHeadings??e.fontHeadings,fontBrand:n.fontBrand??e.fontBrand,fontMonospace:n.fontMonospace??e.fontMonospace,fontWeightBody:String(n.fontWeightBody??e.fontWeightBody),fontWeightHeadings:String(n.fontWeightHeadings??e.fontWeightHeadings),fontWeightBrand:String(n.fontWeightBrand??e.fontWeightBrand),fontWeightMonospace:String(n.fontWeightMonospace??e.fontWeightMonospace),stylesheets:n.stylesheets??[...e.stylesheets],rootFontSize:n.rootFontSize??e.rootFontSize,typeRatio:n.typeRatio??e.typeRatio,spaceRatio:n.spaceRatio??e.spaceRatio,borderRadius:n.borderRadius??e.borderRadius,viewportMin:n.viewportMin??e.viewportMin,viewportMax:n.viewportMax??e.viewportMax,angles:p,semanticHues:S,variantChroma:$,intents:x,lightness:a,chroma:C,semanticMappings:l,anchors:u,roles:t,contexts:o,dataPalette:s,dataRamps:r};return n.pageBackgroundImage!==void 0&&(d.pageBackgroundImage=n.pageBackgroundImage),n.pageBackgroundImageOpacity!==void 0&&(d.pageBackgroundImageOpacity=n.pageBackgroundImageOpacity),n.boxBackgroundImage!==void 0&&(d.boxBackgroundImage=n.boxBackgroundImage),n.boxBackgroundImageOpacity!==void 0&&(d.boxBackgroundImageOpacity=n.boxBackgroundImageOpacity),n.vellumOpacity!==void 0&&(d.vellumOpacity=n.vellumOpacity),n.vellumBackgroundImage!==void 0&&(d.vellumBackgroundImage=n.vellumBackgroundImage),n.vellumBackgroundImageOpacity!==void 0&&(d.vellumBackgroundImageOpacity=n.vellumBackgroundImageOpacity),ce.set(d,new Set(c)),d}function re(e,n){if(!n)return{...e};const t={...e};for(const o of Object.keys(n)){const a=n[o];a!==void 0&&(t[o]=a)}return t}function Ae(e){let n;try{n=ze(e)}catch{return{error:"Failed to decode Base64 string."}}let t;try{t=JSON.parse(n)}catch{return{error:"Decoded string is not valid JSON."}}return typeof t!="object"||t===null||Array.isArray(t)?{error:"Theme must be a JSON object."}:{value:t}}function Kt(e){const n=Ae(e);return n.error!==void 0?{valid:!1,errors:[n.error],warnings:[]}:ve(n.value)}function ve(e,n=Se){const t=[],o=[];"seedColor"in e&&(typeof e.seedColor!="string"?t.push("seedColor must be a string."):N(e.seedColor)||t.push(`seedColor is not a valid CSS color: "${e.seedColor}". Accepted forms: ${ee}.`));for(const s of["fontBody","fontHeadings","fontBrand","fontMonospace"])s in e&&typeof e[s]!="string"&&t.push(`${s} must be a string.`);const a=["normal","bold","lighter","bolder"],u=["inherit","initial","unset","revert","revert-layer"];for(const s of["fontWeightBody","fontWeightHeadings","fontWeightBrand","fontWeightMonospace"])if(s in e){const r=e[s];if(typeof r=="number")(r<1||r>1e3)&&t.push(`${s} numeric value must be 1\u20131000 (got ${r}).`);else if(typeof r=="string"){const i=a.includes(r)||u.includes(r);if(/^\d+$/.test(r)){const m=Number(r);(m<1||m>1e3)&&t.push(`${s} numeric value must be 1\u20131000 (got "${r}").`)}else i||o.push(`${s} = "${r}" is not a standard font-weight value.`)}else t.push(`${s} must be a string or number.`)}"stylesheets"in e&&(Array.isArray(e.stylesheets)?e.stylesheets.some(s=>typeof s!="string")&&t.push("Every entry in stylesheets must be a string."):t.push("stylesheets must be an array of strings."));const f=[["rootFontSize",1,100],["borderRadius",0,10],["viewportMin",100,1e4],["viewportMax",200,1e4]];for(const[s,r,i]of f)if(s in e)if(typeof e[s]!="number"||!isFinite(e[s]))t.push(`${s} must be a finite number.`);else{const c=e[s];r!==void 0&&c<r&&t.push(`${s} must be \u2265 ${r} (got ${c}).`),i!==void 0&&c>i&&o.push(`${s} = ${c} is unusually high (max ${i}).`)}for(const s of["typeRatio","spaceRatio"])if(s in e)if(typeof e[s]!="number"||!isFinite(e[s]))t.push(`${s} must be a finite number.`);else{const r=e[s];r<=1&&t.push(`${s} must be > 1 (got ${r}).`);const i=s==="typeRatio"?1.3:2;r>i&&o.push(`${s} = ${r} is very high (max ${i}); scales may be extreme.`)}if("viewportMin"in e&&"viewportMax"in e){const s=e.viewportMin,r=e.viewportMax;typeof s=="number"&&typeof r=="number"&&s>=r&&t.push(`viewportMin (${s}) must be less than viewportMax (${r}).`)}if("angles"in e)if(typeof e.angles!="object"||e.angles===null)t.push("angles must be an object.");else{const s=e.angles;for(const r of["analogous","complementary","splitComplementary","triadic"])if(r in s)if(typeof s[r]!="number"||!isFinite(s[r]))t.push(`angles.${r} must be a finite number.`);else{const i=s[r];(i<0||i>360)&&o.push(`angles.${r} = ${i} is outside 0\u2013360.`)}}if("semanticHues"in e)if(typeof e.semanticHues!="object"||e.semanticHues===null)t.push("semanticHues must be an object.");else{const s=e.semanticHues;for(const r of["danger","success","warning","info"])if(r in s)if(typeof s[r]!="number"||!isFinite(s[r]))t.push(`semanticHues.${r} must be a finite number.`);else{const i=s[r];(i<0||i>360)&&o.push(`semanticHues.${r} = ${i} is outside 0\u2013360.`)}}if("variantChroma"in e)if(typeof e.variantChroma!="object"||e.variantChroma===null)t.push("variantChroma must be an object.");else{const s=e.variantChroma;for(const r of $t)if(r in s)if(typeof s[r]!="number"||!isFinite(s[r]))t.push(`variantChroma["${r}"] must be a finite number.`);else{const i=s[r];i<0&&t.push(`variantChroma["${r}"] must be \u2265 0 (got ${i}).`),i>G&&o.push(`variantChroma["${r}"] = ${i} exceeds ${G}.`)}}function h(s,r){if(typeof s!="object"||s===null||Array.isArray(s)){t.push(`${r} must be an object.`);return}const i=s;for(const c of j)if(c in i)if(typeof i[c]!="number"||!isFinite(i[c]))t.push(`${r}.${c} must be a finite number.`);else{const m=i[c];(m<0||m>1)&&t.push(`${r}.${c} must be 0\u20131 (got ${m}).`)}}if("lightness"in e&&h(e.lightness,"lightness"),"chroma"in e)if(typeof e.chroma!="object"||e.chroma===null)t.push("chroma must be an object.");else{const s=e.chroma,r=bt(e,n);for(const i of ge)if(i in s){const c=s[i];if(typeof c!="object"||c===null){t.push(`chroma.${i} must be { min, max }.`);continue}const m=c;for(const I of r.get(i)??[])I.chroma!==void 0&&typeof m.min=="number"&&typeof m.max=="number"&&(I.chroma<m.min-1e-9||I.chroma>m.max+1e-9)&&o.push(`chroma.${i} clamps the anchor-sourced token ${i} ("${I.source}", effective in ${I.where}) and moves it off its declared swatch. Remove the band if that is unintended \u2014 anchors otherwise keep their own chroma.`);const y=c;(typeof y.min!="number"||y.min<0)&&t.push(`chroma.${i}.min must be \u2265 0.`),(typeof y.max!="number"||y.max<0||y.max>G)&&t.push(`chroma.${i}.max must be 0\u2013${G}.`),typeof y.min=="number"&&typeof y.max=="number"&&y.min>y.max&&t.push(`chroma.${i}.min (${y.min}) must be \u2264 max (${y.max}).`)}}if("anchors"in e)if(typeof e.anchors!="object"||e.anchors===null||Array.isArray(e.anchors))t.push("anchors must be an object of named colors.");else for(const[s,r]of Object.entries(e.anchors))if(A(s)?z.test(s)||t.push(`anchors: "${s}" is not a valid anchor name; use a lowercase slug (letters, digits, hyphens).`):t.push(`anchors: "${s}" is a reserved JavaScript property name and cannot be an anchor name; rename it.`),ye.includes(s)&&t.push(`anchors: "${s}" collides with a reserved color source name.`),typeof r=="string")N(r)||t.push(`anchors.${s} is not a valid CSS color: "${r}". Accepted forms: ${ee}.`);else if(typeof r=="object"&&r!==null&&!Array.isArray(r)){const i=r;typeof i.color!="string"&&t.push(`anchors.${s} must declare its base "color".`);for(const[c,m]of Object.entries(i))A(c)?c!=="color"&&!z.test(c)&&t.push(`anchors.${s}: "${c}" is not a valid slot name; use a lowercase slug.`):t.push(`anchors.${s}: "${c}" is a reserved JavaScript property name and cannot be a slot name; rename it.`),typeof m!="string"?t.push(`anchors.${s}.${c} must be a CSS color string.`):N(m)||t.push(`anchors.${s}.${c} is not a valid CSS color: "${m}". Accepted forms: ${ee}.`)}else t.push(`anchors.${s} must be a color string or a { color, \u2026slots } object.`);const p=new Map;if("anchors"in e&&typeof e.anchors=="object"&&e.anchors!==null&&!Array.isArray(e.anchors))for(const[s,r]of Object.entries(e.anchors))p.set(s,r);function S(s,r){const i=de(s);if(!i){t.push(`${r} "${s}" is not valid anchor syntax; use anchor:<name> or anchor:<name>.<slot>.`);return}if(!p.has(i.name)){const c=[...p.keys()];t.push(`${r} references undeclared anchor "${i.name}". Declared anchors: ${c.length>0?c.join(", "):"(none)"}.`);return}if(i.slot!==void 0){const c=p.get(i.name);if(typeof(typeof c=="object"&&c!==null&&!Array.isArray(c)?c[i.slot]:void 0)!="string"){const y=typeof c=="object"&&c!==null?Object.keys(c).filter(I=>I!=="color"):[];t.push(`${r} references unknown slot "${i.slot}" on anchor "${i.name}". Declared slots: ${y.length>0?y.join(", "):"(none)"}.`)}}}function $(s,r){if(s.startsWith("anchor:")){S(s,r);return}ye.includes(s)||t.push(`${r} must be one of: ${ye.join(", ")}, or a declared anchor as anchor:<name> / anchor:<name>.<slot>.`)}if("intents"in e)if(typeof e.intents!="object"||e.intents===null||Array.isArray(e.intents))t.push("intents must be an object.");else for(const[s,r]of Object.entries(e.intents)){const i=`intents.${s}`;if(!Q.includes(s)){t.push(`${i} is not a status family; expected one of: ${Q.join(", ")}.`);continue}if(typeof r!="string"){t.push(`${i} must be a string (a CSS color or an anchor: reference).`);continue}if(r.startsWith("anchor:")){S(r,i);continue}N(r)||t.push(`${i} "${r}" is not a supported color form or anchor: reference. Accepted forms: ${ee}, or anchor:<name> / anchor:<name>.<slot>. An override retunes a family with a declared color; it never points one family at another \u2014 retune, never reassign.`)}function x(s,r){if(s.startsWith("anchor:")){S(s,r);return}N(s)||t.push(`${r} is not a valid CSS color: "${s}". Accepted forms: ${ee}, or a declared anchor as anchor:<name> / anchor:<name>.<slot>.`)}if("dataPalette"in e)if(typeof e.dataPalette!="object"||e.dataPalette===null||Array.isArray(e.dataPalette))t.push("dataPalette must be an object with series1\u2013series8 color values.");else{const s=e.dataPalette;for(const[r,i]of Object.entries(s)){if(!ie.includes(r)){t.push(`dataPalette.${r} is not a series slot; expected one of: ${ie.join(", ")}.`);continue}typeof i!="string"?t.push(`dataPalette.${r} must be a CSS color or anchor reference string.`):x(i,`dataPalette.${r}`)}}if("dataRamps"in e)if(typeof e.dataRamps!="object"||e.dataRamps===null||Array.isArray(e.dataRamps))t.push("dataRamps must be an object of named ramp declarations.");else for(const[s,r]of Object.entries(e.dataRamps)){if(A(s)?z.test(s)||t.push(`dataRamps: "${s}" is not a valid ramp name; use a lowercase slug (letters, digits, hyphens).`):t.push(`dataRamps: "${s}" is a reserved JavaScript property name and cannot be a ramp name; rename it.`),typeof r!="object"||r===null||Array.isArray(r)){t.push(`dataRamps.${s} must be a sequential or diverging ramp object.`);continue}const i=r,c=i.steps??lt;if((typeof c!="number"||!Number.isInteger(c)||c<he||c>me)&&t.push(`dataRamps.${s}.steps must be an integer from ${he} through ${me}.`),i.type==="sequential"){typeof i.source!="string"?t.push(`dataRamps.${s}.source must be a CSS color or anchor reference string.`):x(i.source,`dataRamps.${s}.source`);const m=i.lightnessStart??.95,y=i.lightnessEnd??.25;for(const[I,D]of[["lightnessStart",m],["lightnessEnd",y]])(typeof D!="number"||!Number.isFinite(D)||D<0||D>1)&&t.push(`dataRamps.${s}.${I} must be a finite number from 0 through 1.`);typeof m=="number"&&typeof y=="number"&&m<=y?t.push(`dataRamps.${s}.lightnessStart must be greater than lightnessEnd.`):typeof m=="number"&&Number.isFinite(m)&&typeof y=="number"&&Number.isFinite(y)&&typeof c=="number"&&Number.isInteger(c)&&c>=he&&c<=me&&(m-y)/(c-1)<=Le&&t.push(`dataRamps.${s} lightness bounds must leave more than ${Le} lightness between serialized stops.`);continue}if(i.type==="diverging"){typeof c=="number"&&Number.isInteger(c)&&c%2===0&&t.push(`dataRamps.${s}.steps must be odd so the neutral is the exact midpoint.`);for(const m of["start","end"])typeof i[m]!="string"?t.push(`dataRamps.${s}.${m} must be a CSS color or anchor reference string.`):x(i[m],`dataRamps.${s}.${m}`);"neutral"in i&&(typeof i.neutral!="string"?t.push(`dataRamps.${s}.neutral must be a CSS color or anchor reference string.`):x(i.neutral,`dataRamps.${s}.neutral`));continue}t.push(`dataRamps.${s}.type must be "sequential" or "diverging".`)}if("dataPalette"in e&&t.length===0){const s=se(Se,e),r={};let i=!0;for(const c of ie){const m=ft(s.dataPalette[c],s.anchors);if(!m){i=!1;break}r[c]=m}if(i)for(const c of ut(r))o.push(`dataPalette.${c.series[0]} and dataPalette.${c.series[1]} are only ${c.distance.toFixed(4)} apart under ${c.simulation} simulation (minimum ${c.threshold.toFixed(4)}); also distinguish the series with labels, shapes, or patterns.`)}function C(s,r){if(typeof s!="object"||s===null||Array.isArray(s)){t.push(`${r} must be an object.`);return}const i=s;for(const[c,m]of Object.entries(i)){const y=`${r}.${c}`;if(!Z.includes(c)){t.push(`${y} is not a role; expected one of: ${Z.join(", ")}. (The status family is reserved and is not a role.)`);continue}const I=c,D=Pe[I];if(typeof m=="string"){$(m,y);continue}if(typeof m!="object"||m===null||Array.isArray(m)){t.push(`${y} must be a color source or a { color, \u2026slots } object.`);continue}const W=m;typeof W.color!="string"&&t.push(`${y} must declare its base "color".`);for(const[l,d]of Object.entries(W)){if(!Object.prototype.hasOwnProperty.call(D,l)||!A(l)){const g=Object.keys(D).filter(b=>b!=="color");t.push(`${y}.${l} is not a slot of the ${I} role. Declared slots: ${g.length>0?g.join(", "):"(none)"}.`);continue}typeof d!="string"?t.push(`${y}.${l} must be a color source string.`):$(d,`${y}.${l}`)}}}if("roles"in e&&C(e.roles,"roles"),"contexts"in e)if(typeof e.contexts!="object"||e.contexts===null||Array.isArray(e.contexts))t.push("contexts must be an object.");else for(const[s,r]of Object.entries(e.contexts)){if(!A(s)||!z.test(s)){t.push(`contexts.${s} must be a lowercase slug matching ${z.source}.`);continue}if(typeof r!="object"||r===null||Array.isArray(r)){C(r,`contexts.${s}`);continue}const i=r,c=Object.fromEntries(Object.entries(i).filter(([m])=>m!=="lightness"));C(c,`contexts.${s}`),"lightness"in i&&h(i.lightness,`contexts.${s}.lightness`)}if("semanticMappings"in e)if(typeof e.semanticMappings!="object"||e.semanticMappings===null)t.push("semanticMappings must be an object.");else{const s=e.semanticMappings;for(const r of ge)if(r in s){const i=s[r];if(typeof i!="object"||i===null){t.push(`semanticMappings.${r} must be { source, lightness }.`);continue}const c=i;typeof c.source!="string"?t.push(`semanticMappings.${r}.source must be a string.`):$(c.source,`semanticMappings.${r}.source`),(typeof c.lightness!="string"||!j.includes(c.lightness))&&t.push(`semanticMappings.${r}.lightness must be one of: ${j.join(", ")}.`)}}for(const s of["pageBackgroundImage","boxBackgroundImage","vellumBackgroundImage"])s in e&&typeof e[s]!="string"&&t.push(`${s} must be a string.`);for(const s of["pageBackgroundImageOpacity","boxBackgroundImageOpacity","vellumOpacity","vellumBackgroundImageOpacity"])if(s in e)if(typeof e[s]!="number"||!isFinite(e[s]))t.push(`${s} must be a finite number.`);else{const r=e[s];(r<0||r>1)&&t.push(`${s} must be 0\u20131 (got ${r}).`)}return o.push(...Et(e,n)),{valid:t.length===0,errors:t,warnings:o}}const O=.045;function Et(e,n){try{return _t(e,n)}catch{return[]}}function _t(e,n){const t=se(n,e),o=Ze(t),a=[...o],u=new Set(o);for(const[f,h]of Object.entries(t.contexts)){const p={};for(const $ of Z){const x=h[$];x!==void 0&&(p[$]=x)}const S=se(t,{lightness:h.lightness,roles:p});for(const $ of Ze(S))u.has($)||a.push(`contexts.${f}: ${$}`)}return a}function It(e){const n=st(fe(e)),t=at(n);return ot({r:le(t.r),g:le(t.g),b:le(t.b)})}function q(e,n){return Math.hypot(e.L-n.L,e.a-n.a,e.b-n.b)}function J(e){return It(N(ae(fe(e))))}function qe(e){return(Math.floor(e*1e4)/1e4).toFixed(4)}const X=2,Xe=1e-4;function Ze(e){const n=N(e.seedColor);if(!n)return[];const t=Ee(n,e),o=e.semanticMappings.actionBackground,a=e.chroma.actionBackground,u=e.lightness[o.lightness],f=(l,d,g,b)=>fe(we(l,d,g,b)),h=Q.map(l=>({name:l,base:t[l]})),p=[];if(Q.includes(o.source))p.push(`actionBackground is sourced from the "${o.source}" status family: ordinary and ${o.source}-intent action surfaces render identically (their labels may still differ). Remap the action to a non-status source \u2014 retuning "${o.source}" via intents moves both colors together.`);else{const l=_e(o.source,t,e.anchors);l&&h.push({name:"action",base:l})}const S=Ie(h.map(({name:l,base:d})=>[l,ae(f(d,u,a.min,a.max))]),O,["normal"]);if(S.length===0)return p;const $=new Map,x=(l,d)=>{const g=`${l}:${d}`;let b=$.get(g);if(!b){b=[];for(let B=0;B<360;B+=X)b.push(J({l,c:d,h:B}));$.set(g,b)}return b},C=O-.002,s=(l,d,g,b)=>{const B=Math.hypot(l.a,l.b),M=Math.atan2(l.b,l.a)*180/Math.PI+180;let E=0;for(const T of g===b?[b]:[g,b]){if(T+B<O-1e-4)continue;let L=M,R=q(J({l:d,c:T,h:M}),l);if(R>=O)return R;const P=x(d,T);for(let v=0;v<P.length;v+=1){const k=q(P[v],l);if(k>=O)return k;k>R&&(R=k,L=v*X)}let H=L;for(let v=L-X;v<=L+X;v+=.1){const k=q(J({l:d,c:T,h:v}),l);if(k>=O)return k;k>R&&(R=k,H=v)}if(R>=C)for(let v=H-.1;v<=H+.1;v+=.001){const k=q(J({l:d,c:T,h:v}),l);if(k>=O)return k;k>R&&(R=k)}R>E&&(E=R)}return E},r=(l,d,g)=>{const b=d===g?[g]:[d,g];let B=0;for(const M of b)for(const E of b){if(M+E<O-1e-4)continue;const T=x(l,M),L=x(l,E);let R=0,P=0,H=-1;for(let _=0;_<T.length;_+=1)for(let F=0;F<L.length;F+=1){const K=q(T[_],L[F]);if(K>=O)return K;K>H&&(H=K,R=_*X,P=F*X)}const v=(_,F,K,Re)=>{const Oe=[];for(let U=F-K;U<=F+K;U+=Re)Oe.push({h:U,lab:J({l,c:E,h:U})});let ue=-1,Ce=_,Me=F;for(let U=_-K;U<=_+K;U+=Re){const tt=J({l,c:M,h:U});for(const Te of Oe){const Be=q(tt,Te.lab);Be>ue&&(ue=Be,Ce=U,Me=Te.h)}}return{distance:ue,hueA:Ce,hueB:Me}},k=v(R,P,X,.1);if(k.distance>=O)return k.distance;let w=Math.max(H,k.distance);if(w>=C){const _=v(k.hueA,k.hueB,.1,.001);if(_.distance>w&&(w=_.distance),w>=O)return w}w>B&&(B=w)}return B},i=l=>Q.includes(l),c=(l,d,g,b,B)=>{const M=J(f(l.base,g,b,B)),E=J(f(d.base,g,b,B));if(q(M,E)>=O)return{outcome:"direct"};const T=i(l.name)&&i(d.name),L=[l,d].filter(H=>i(H.name)),R=T?"one of them":`"${i(l.name)?l.name:d.name}"`;let P;for(const H of L){const v=s(H===l?E:M,g,b,B);if(v>=O)return{outcome:"retune",target:R};v>=O-Xe&&(P=P??R)}if(T){const H=r(g,b,B);if(H>=O)return{outcome:"retune",target:"both"};H>=O-Xe&&(P=P??"both")}return P!==void 0?{outcome:"near",target:P}:{outcome:"no"}},m=l=>l.outcome==="direct"?4:l.outcome==="retune"?l.target==="both"?2:3:l.outcome==="near"?1:0,y=l=>[...l].sort().join("|"),I=new Set(Ie(h.map(({name:l,base:d})=>[l,ae(f(d,u,0,G))]),O,["normal"]).map(l=>y(l.pair))),D=new Map(h.map(l=>[l.name,l])),W=new Map;for(const{pair:l,distance:d}of S){const g=D.get(l[0]),b=D.get(l[1]),B=i(g.name)&&i(b.name),M=c(g,b,u,a.min,a.max);if(M.outcome==="direct"||M.outcome==="retune"){const w=M.target??(B?"one of them":`"${i(g.name)?g.name:b.name}"`);I.has(y(l))?p.push(`Status colors "${l[0]}" and "${l[1]}" are hard to distinguish under normal vision (distance ${qe(d)} < ${O}); status meanings must stay distinguishable \u2014 retune ${w} via intents.`):p.push(`Status colors "${l[0]}" and "${l[1]}" are hard to distinguish as rendered (distance ${qe(d)} < ${O}); the actionBackground chroma band ({ min: ${a.min}, max: ${a.max} }) pushes them together \u2014 widen the band, or retune ${w} via intents.`);continue}const E=c(g,b,u,0,G);let T={outcome:"no"};for(let w=1;w<=19&&T.outcome!=="direct";w+=1){const _=w*.05;if(Math.abs(_-u)<.001)continue;const F=c(g,b,_,a.min,a.max);m(F)>m(T)&&(T=F)}let L={outcome:"no"};const R=E.outcome==="direct"||E.outcome==="retune",P=T.outcome==="direct"||T.outcome==="retune";if(!R&&!P)for(let w=1;w<=19&&L.outcome!=="direct";w+=1){const _=c(g,b,w*.05,0,G);m(_)>m(L)&&(L=_)}const H=Lt(E,T,L),v=`${M.outcome}|${H}`;let k=W.get(v);k||(k=[],W.set(v,k)),k.push(l)}for(const[l,d]of W){const g=l.indexOf("|"),b=l.slice(0,g),B=l.slice(g+1),M=d.map(([L,R])=>`"${L}"/"${R}"`),E=M.length>1?`${M.slice(0,-1).join(", ")} and ${M[M.length-1]}`:M[0],T=b==="near"?`Status colors ${E} may not separate by retuning as rendered: at the action stop's lightness (${u}) with the actionBackground chroma band ({ min: ${a.min}, max: ${a.max} }), the closest reachable retune found comes within the audit's search margin of the ${O} threshold`:`Status colors ${E} cannot be separated as rendered: at the action stop's lightness (${u}) with the actionBackground chroma band ({ min: ${a.min}, max: ${a.max} }), no intent retuning can pull ${d.length>1?"these pairs":"the pair"} ${O} apart`;p.push(T+B)}return p}function Lt(e,n,t){if(e.outcome==="direct"&&n.outcome==="direct")return" \u2014 widen the chroma band or move the action lightness stop.";if(e.outcome==="direct")return n.outcome==="no"?"; no other action lightness stop can help while the band holds \u2014 widen the chroma band.":" \u2014 widen the chroma band.";if(n.outcome==="direct")return e.outcome==="no"?"; no wider chroma band can help at this lightness \u2014 move the action lightness stop.":" \u2014 move the action lightness stop.";if(e.outcome==="retune"&&n.outcome==="retune")return` \u2014 widen the chroma band or move the action lightness stop, then retune ${e.target} via intents.`;if(e.outcome==="retune")return n.outcome==="no"?`; no other action lightness stop can help while the band holds \u2014 widen the chroma band, then retune ${e.target} via intents.`:` \u2014 widen the chroma band, then retune ${e.target} via intents.`;if(n.outcome==="retune")return e.outcome==="no"?`; no wider chroma band can help at this lightness \u2014 move the action lightness stop, then retune ${n.target} via intents.`:` \u2014 move the action lightness stop, then retune ${n.target} via intents.`;const o=e.outcome==="no"&&n.outcome==="no"?"; neither a wider chroma band alone nor another stop alone can help":"; neither a wider chroma band alone nor another stop alone provably helps";return t.outcome==="direct"?`${o} \u2014 change the band and the stop together.`:t.outcome==="retune"?`${o} \u2014 change the band and the stop together, then retune ${t.target} via intents.`:"; no explored band or stop change provably separates this pair."}function Ut(e,n){const t=Ae(e),o=Ae(n),a=t.error!==void 0?{valid:!1,errors:[t.error],warnings:[]}:ve(t.value),u=o.error!==void 0?{valid:!1,errors:[o.error],warnings:[]}:ve(o.value,Ke),f=[...a.errors.map(p=>`light: ${p}`),...u.errors.map(p=>`dark: ${p}`)],h=[...a.warnings.map(p=>`light: ${p}`),...u.warnings.map(p=>`dark: ${p}`)];if(a.valid&&u.valid){const p=new Set(Object.keys(t.value?.contexts??{})),S=new Set(Object.keys(o.value?.contexts??{})),$=[...S].filter(C=>!p.has(C)).sort(),x=[...p].filter(C=>!S.has(C)).sort();($.length>0||x.length>0)&&f.push(`contexts must declare the same names in both schemes. Missing from light: ${$.join(", ")||"(none)"}. Missing from dark: ${x.join(", ")||"(none)"}.`)}return{valid:f.length===0,errors:f,warnings:h}}const Ht=["anchors","angles","contexts","dataPalette","dataRamps","intents","roles","chroma","lightness","semanticHues","semanticMappings","variantChroma"];function Pt(e,n){const t={};for(const[o,a]of Object.entries(e))A(o)&&(t[o]=a);for(const[o,a]of Object.entries(n))a!==void 0&&A(o)&&(t[o]=a);for(const o of Ht){const a=e[o],u=n[o];if(a&&typeof a=="object"&&!Array.isArray(a)&&u&&typeof u=="object"&&!Array.isArray(u)){if(o==="anchors"){t[o]=je(a,u);continue}if(o==="contexts"){t[o]=Ct(a,u);continue}if(o==="dataRamps"){t[o]=Ve(a,u);continue}const f={};for(const[h,p]of Object.entries(a))A(h)&&(f[h]=p);for(const[h,p]of Object.entries(u))p!==void 0&&A(h)&&(f[h]=p);t[o]=f}}return t}function zt(...e){let n={};for(const t of e){if(!t)continue;const o=At(t);o&&(n=Pt(n,o))}return ke(n)}function Qe(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r")}const et={borderRadius:.1,fontBody:'"Noto Sans", sans-serif',fontWeightBody:"normal",fontHeadings:'"Inika", serif',fontWeightHeadings:"normal",fontBrand:'"Inika", serif',fontWeightBrand:"normal",fontMonospace:'"JetBrains Mono", monospace',fontWeightMonospace:"normal",seedColor:"oklch(.07 0.15 216)"};function jt(e){return ke({...et,pageBackgroundImage:`url("${Qe(e)}")`,pageBackgroundImageOpacity:.5})}function Gt(e){return ke({...et,pageBackgroundImage:`url("${Qe(e)}")`,pageBackgroundImageOpacity:.55})}export{z as ANCHOR_SLUG_PATTERN,ye as COLOR_SOURCES,xt as DEFAULT_DARK_LIGHTNESS,Ke as DEFAULT_DARK_THEME,St as DEFAULT_LIGHT_LIGHTNESS,Se as DEFAULT_LIGHT_THEME,be as DEFAULT_SEMANTIC_MAPPINGS,j as LIGHTNESS_KEYS,Ht as NESTED_THEME_KEYS,Z as ROLE_NAMES,ht as ROLE_PAIRED_INK,Pe as ROLE_TOKEN_PLAN,ge as SEMANTIC_COLOR_NAMES,Q as STATUS_COLOR_SOURCES,Fe as TOKEN_PAIRINGS,$t as VARIANT_COLOR_SOURCES,Gt as buildTaprootDarkTheme,jt as buildTaprootLightTheme,Ne as compileRoles,ke as encodeTheme,zt as layerThemes,Pt as mergePartials,se as mergeTheme,de as parseAnchorSource,At as parseTheme,He as resolveAnchorColor,ft as resolveDataColorSource,Wt as semanticToCSS,Kt as validateTheme,Ut as validateThemePair};
@@ -1 +1 @@
1
- import{parseCssColor as u,rotateHue as o}from"./color-engine.js";const m=/^anchor:([^.]+)(?:\.(.+))?$/;function s(t){const l=m.exec(t);return l?l[2]===void 0?{name:l[1]}:{name:l[1],slot:l[2]}:null}function h(t,l){const n=t[l.name];if(n===void 0)return null;if(typeof n=="string")return l.slot===void 0?n:null;const a=n[l.slot??"color"];return typeof a=="string"?a:null}function y(t,l,n){const a=s(t);if(!a)return l[t]??null;const c=h(n,a);return c===null?null:u(c)}const p=.6,g=.85;function S(t,l){const{angles:n,semanticHues:a,variantChroma:c}=l,r=e=>c[e]??t.c,i=Math.min(g,Math.max(p,t.l));return{primary:t,"analogous-left":{l:t.l,c:r("analogous-left"),h:o(t.h,-n.analogous)},"analogous-right":{l:t.l,c:r("analogous-right"),h:o(t.h,n.analogous)},complementary:{l:t.l,c:r("complementary"),h:o(t.h,n.complementary)},"split-complementary-left":{l:t.l,c:r("split-complementary-left"),h:o(t.h,n.complementary-n.splitComplementary)},"split-complementary-right":{l:t.l,c:r("split-complementary-right"),h:o(t.h,n.complementary+n.splitComplementary)},"triadic-left":{l:t.l,c:r("triadic-left"),h:o(t.h,n.triadic)},"triadic-right":{l:t.l,c:r("triadic-right"),h:o(t.h,-n.triadic)},danger:{l:i,c:r("danger"),h:o(a.danger,0)},success:{l:i,c:r("success"),h:o(a.success,0)},warning:{l:i,c:r("warning"),h:o(a.warning,0)}}}export{S as computeVariants,s as parseAnchorSource,h as resolveAnchorColor,y as resolveMappingSource};
1
+ import{gamutMapToSRGB as A,parseCssColor as g,rotateHue as o}from"./color-engine.js";const x=/^anchor:([^.]+)(?:\.(.+))?$/;function y(n){const r=x.exec(n);return r?r[2]===void 0?{name:r[1]}:{name:r[1],slot:r[2]}:null}function S(n,r){const a=n[r.name];if(a===void 0)return null;if(typeof a=="string")return r.slot===void 0?a:null;const t=a[r.slot??"color"];return typeof t=="string"?t:null}function w(n,r,a){const t=y(n);if(!t)return r[n]??null;const c=S(a,t);return c===null?null:g(c)}const M=.6,_=.85;function H(n,r){const{anchors:a,angles:t,intents:c,semanticHues:i,variantChroma:T}=r,l=u=>T[u]??n.c,e=Math.min(_,Math.max(M,n.l)),s=(u,C)=>{const m=c[u];if(typeof m=="string"){const h=y(m),p=h?S(a,h):m,f=p===null?null:g(p);if(f)return A(f)}return C()};return{primary:n,"analogous-left":{l:n.l,c:l("analogous-left"),h:o(n.h,-t.analogous)},"analogous-right":{l:n.l,c:l("analogous-right"),h:o(n.h,t.analogous)},complementary:{l:n.l,c:l("complementary"),h:o(n.h,t.complementary)},"split-complementary-left":{l:n.l,c:l("split-complementary-left"),h:o(n.h,t.complementary-t.splitComplementary)},"split-complementary-right":{l:n.l,c:l("split-complementary-right"),h:o(n.h,t.complementary+t.splitComplementary)},"triadic-left":{l:n.l,c:l("triadic-left"),h:o(n.h,t.triadic)},"triadic-right":{l:n.l,c:l("triadic-right"),h:o(n.h,-t.triadic)},danger:s("danger",()=>({l:e,c:l("danger"),h:o(i.danger,0)})),success:s("success",()=>({l:e,c:l("success"),h:o(i.success,0)})),warning:s("warning",()=>({l:e,c:l("warning"),h:o(i.warning,0)})),info:s("info",()=>({l:e,c:l("info"),h:o(i.info,0)}))}}export{H as computeVariants,y as parseAnchorSource,S as resolveAnchorColor,w as resolveMappingSource};
@@ -0,0 +1,62 @@
1
+ import { EspalierElementBase } from "../shared/esp-element-base.js";
2
+ declare const STACK_GAPS: readonly ["none", "tiny", "small", "normal", "medium", "big", "large", "huge"];
3
+ /** A named gap step accepted by `esp-stack` and `esp-row`. */
4
+ export type EspalierGap = (typeof STACK_GAPS)[number];
5
+ declare const STACK_ALIGNS: readonly ["start", "center", "end", "stretch"];
6
+ /** A cross-axis alignment accepted by `esp-stack` and `esp-row`. */
7
+ export type EspalierAlign = (typeof STACK_ALIGNS)[number];
8
+ export { STACK_GAPS, STACK_ALIGNS };
9
+ /**
10
+ * A vertical flow: children stack in a column with a themed gap —
11
+ * "column, gap X" without writing flexbox (ADR-010's micro half).
12
+ *
13
+ * ```html
14
+ * <esp-stack gap="medium">
15
+ * <h2>Title</h2>
16
+ * <p>Copy under it.</p>
17
+ * <esp-button label="Act"></esp-button>
18
+ * </esp-stack>
19
+ * ```
20
+ *
21
+ * The default cross-axis alignment is `stretch`, matching normal block
22
+ * flow: grids, form fields, and text fill the column — with one
23
+ * deliberate exception: slotted `esp-button` and `esp-button-group`
24
+ * keep their natural width, because a field should fill its column
25
+ * while the submit button under it should not. That is the pairing a
26
+ * plain flex column cannot express with any single `align-items`
27
+ * value. An explicit `align` — `align="stretch"` included, authored as
28
+ * an attribute or assigned to the property — governs every child
29
+ * uniformly; removing the attribute restores the default state, and
30
+ * `align-self` on any child overrides either way.
31
+ *
32
+ * @customElement esp-stack
33
+ * @slot - The stacked children.
34
+ * @csspart stack - The flex column.
35
+ * @cssprop --esp-stack-gap - Overrides the gap between children. Defaults to the `gap` attribute's step, `normal` when unset.
36
+ * @docPageTitle Stack
37
+ * @docUrl /components/stack
38
+ * @menuGroup Structure
39
+ * @menuIcon layout
40
+ */
41
+ export declare class EspalierStack extends EspalierElementBase {
42
+ /**
43
+ * Gap between children as a space-scale step name
44
+ * (`none`, `tiny`, `small`, `normal`, `medium`, `big`, `large`,
45
+ * `huge`).
46
+ * @default "normal"
47
+ */
48
+ gap: EspalierGap;
49
+ /**
50
+ * Cross-axis alignment of children: `start`, `center`, `end`, or
51
+ * `stretch`.
52
+ * @default "stretch"
53
+ */
54
+ align: EspalierAlign;
55
+ protected render(): import("lit-html").TemplateResult<1>;
56
+ static styles: import("lit").CSSResult[];
57
+ }
58
+ declare global {
59
+ interface HTMLElementTagNameMap {
60
+ "esp-stack": EspalierStack;
61
+ }
62
+ }
@@ -0,0 +1,56 @@
1
+ var o=function(l,t,a,r){var n=arguments.length,e=n<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,a):r,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")e=Reflect.decorate(l,t,a,r);else for(var p=l.length-1;p>=0;p--)(i=l[p])&&(e=(n<3?i(e):n>3?i(t,a,e):i(t,a))||e);return n>3&&e&&Object.defineProperty(t,a,e),e};import{css as u,html as h}from"lit";import{customElement as f,property as c}from"lit/decorators.js";import{EspalierElementBase as g}from"../shared/esp-element-base.js";const m=["none","tiny","small","normal","medium","big","large","huge"],d=["start","center","end","stretch"];let s=class extends g{constructor(){super(...arguments),this.gap="normal",this.align="stretch"}render(){return h`
2
+ <div class="esp-stack" part="stack">
3
+ <slot></slot>
4
+ </div>
5
+ `}};s.styles=[...g.styles,u`
6
+ :host {
7
+ display: block;
8
+ --_esp-stack-gap: var(--esp-size-normal);
9
+ --_esp-stack-align: stretch;
10
+ }
11
+
12
+ :host([gap="none"]) {
13
+ --_esp-stack-gap: 0px;
14
+ }
15
+ :host([gap="tiny"]) {
16
+ --_esp-stack-gap: var(--esp-size-tiny);
17
+ }
18
+ :host([gap="small"]) {
19
+ --_esp-stack-gap: var(--esp-size-small);
20
+ }
21
+ :host([gap="medium"]) {
22
+ --_esp-stack-gap: var(--esp-size-medium);
23
+ }
24
+ :host([gap="big"]) {
25
+ --_esp-stack-gap: var(--esp-size-big);
26
+ }
27
+ :host([gap="large"]) {
28
+ --_esp-stack-gap: var(--esp-size-large);
29
+ }
30
+ :host([gap="huge"]) {
31
+ --_esp-stack-gap: var(--esp-size-huge);
32
+ }
33
+
34
+ :host([align="start"]) {
35
+ --_esp-stack-align: flex-start;
36
+ }
37
+ :host([align="center"]) {
38
+ --_esp-stack-align: center;
39
+ }
40
+ :host([align="end"]) {
41
+ --_esp-stack-align: flex-end;
42
+ }
43
+
44
+ .esp-stack {
45
+ display: flex;
46
+ flex-direction: column;
47
+ gap: var(--esp-stack-gap, var(--_esp-stack-gap));
48
+ align-items: var(--_esp-stack-align);
49
+ }
50
+
51
+
52
+ :host(:not([align])) ::slotted(esp-button),
53
+ :host(:not([align])) ::slotted(esp-button-group) {
54
+ align-self: flex-start;
55
+ }
56
+ `],o([c({reflect:!0,useDefault:!0})],s.prototype,"gap",void 0),o([c({reflect:!0,useDefault:!0})],s.prototype,"align",void 0),s=o([f("esp-stack")],s);export{s as EspalierStack,d as STACK_ALIGNS,m as STACK_GAPS};
@@ -107,6 +107,12 @@
107
107
  "component": "esp-box",
108
108
  "description": "The opacity of the background layer."
109
109
  },
110
+ {
111
+ "name": "--esp-box-shadow",
112
+ "category": "component",
113
+ "component": "esp-box",
114
+ "description": "The box's drop shadow. Defaults to the theme's `--esp-shadow-1` elevation."
115
+ },
110
116
  {
111
117
  "name": "--esp-breadcrumb-color",
112
118
  "category": "component",
@@ -143,6 +149,11 @@
143
149
  "component": "esp-button",
144
150
  "description": "The padding inside the button label and icon areas."
145
151
  },
152
+ {
153
+ "name": "--esp-card-min",
154
+ "category": "root-theme",
155
+ "description": ""
156
+ },
146
157
  {
147
158
  "name": "--esp-checkbox-focus-shadow",
148
159
  "category": "component",
@@ -252,6 +263,11 @@
252
263
  "category": "root-theme",
253
264
  "description": ""
254
265
  },
266
+ {
267
+ "name": "--esp-color-info",
268
+ "category": "root-theme",
269
+ "description": ""
270
+ },
255
271
  {
256
272
  "name": "--esp-color-input-caret",
257
273
  "category": "root-theme",
@@ -1429,6 +1445,16 @@
1429
1445
  "component": "esp-lightbox",
1430
1446
  "description": "The opacity of the overlay background (falls through to --esp-vellum-opacity, default: 0.85)."
1431
1447
  },
1448
+ {
1449
+ "name": "--esp-measure",
1450
+ "category": "root-theme",
1451
+ "description": ""
1452
+ },
1453
+ {
1454
+ "name": "--esp-measure-wide",
1455
+ "category": "root-theme",
1456
+ "description": ""
1457
+ },
1432
1458
  {
1433
1459
  "name": "--esp-menu-background",
1434
1460
  "category": "component",
@@ -1695,7 +1721,7 @@
1695
1721
  "name": "--esp-page-main-max-width",
1696
1722
  "category": "component",
1697
1723
  "component": "esp-page",
1698
- "description": "Maximum width of the main content well. Defaults from `kind`: `1536px` (wide), `768px` (narrow), or unbounded (full). An explicit value overrides every kind default, including `full`. Surplus width beyond it becomes canvas gutters."
1724
+ "description": "Maximum width of the main content well. Defaults from `kind`: `1536px` (wide), `768px` (narrow), or unbounded (full). An explicit value overrides every kind default, including `full` — except `site`, whose main region is always unbounded because sections own their wells. Surplus width beyond it becomes canvas gutters."
1699
1725
  },
1700
1726
  {
1701
1727
  "name": "--esp-page-main-min-width",
@@ -1805,6 +1831,12 @@
1805
1831
  "component": "esp-page",
1806
1832
  "description": "The box shadow drawn on the left and right edges of the content surface. On by default; casts into the gutters and is clipped away when the surface fills the viewport, so it only shows above the cap. Set to `none` to remove it."
1807
1833
  },
1834
+ {
1835
+ "name": "--esp-page-well-max-width",
1836
+ "category": "component",
1837
+ "component": "esp-page",
1838
+ "description": "The shared content-column width in `kind=\"site\"`: the header and footer alignment contract and every `esp-section` well default to it. Defaults to `72rem`."
1839
+ },
1808
1840
  {
1809
1841
  "name": "--esp-progress-border-color",
1810
1842
  "category": "component",
@@ -1919,6 +1951,12 @@
1919
1951
  "component": "esp-repeater",
1920
1952
  "description": "Padding used by repeater state panels and the loading/error footer."
1921
1953
  },
1954
+ {
1955
+ "name": "--esp-row-gap",
1956
+ "category": "component",
1957
+ "component": "esp-row",
1958
+ "description": "Overrides the gap between children. Defaults to the `gap` attribute's step, `normal` when unset."
1959
+ },
1922
1960
  {
1923
1961
  "name": "--esp-scheme",
1924
1962
  "category": "root-theme",
@@ -2002,11 +2040,50 @@
2002
2040
  "component": "esp-search",
2003
2041
  "description": "Title color for result rows. Defaults to `var(--esp-color-headings)`."
2004
2042
  },
2043
+ {
2044
+ "name": "--esp-section-background",
2045
+ "category": "component",
2046
+ "component": "esp-section",
2047
+ "description": "The band's background. Defaults to the local `--esp-color-background`, which inside a `context` zone is the zone's canvas."
2048
+ },
2049
+ {
2050
+ "name": "--esp-section-max-width",
2051
+ "category": "component",
2052
+ "component": "esp-section",
2053
+ "description": "The content well's cap. Defaults to `var(--esp-page-well-max-width, 72rem)`; `none` lets content span the band."
2054
+ },
2055
+ {
2056
+ "name": "--esp-section-padding-block",
2057
+ "category": "component",
2058
+ "component": "esp-section",
2059
+ "description": "Vertical rhythm above and below the well. Defaults to `var(--esp-size-section)`."
2060
+ },
2061
+ {
2062
+ "name": "--esp-section-padding-inline",
2063
+ "category": "component",
2064
+ "component": "esp-section",
2065
+ "description": "Horizontal breathing room inside the band at narrow viewports. Defaults to `var(--esp-size-medium)`."
2066
+ },
2005
2067
  {
2006
2068
  "name": "--esp-seed-color",
2007
2069
  "category": "root-theme",
2008
2070
  "description": ""
2009
2071
  },
2072
+ {
2073
+ "name": "--esp-shadow-1",
2074
+ "category": "root-theme",
2075
+ "description": ""
2076
+ },
2077
+ {
2078
+ "name": "--esp-shadow-2",
2079
+ "category": "root-theme",
2080
+ "description": ""
2081
+ },
2082
+ {
2083
+ "name": "--esp-shadow-3",
2084
+ "category": "root-theme",
2085
+ "description": ""
2086
+ },
2010
2087
  {
2011
2088
  "name": "--esp-size-big",
2012
2089
  "category": "root-theme",
@@ -2090,6 +2167,11 @@
2090
2167
  "category": "root-theme",
2091
2168
  "description": ""
2092
2169
  },
2170
+ {
2171
+ "name": "--esp-size-section",
2172
+ "category": "root-theme",
2173
+ "description": ""
2174
+ },
2093
2175
  {
2094
2176
  "name": "--esp-size-small",
2095
2177
  "category": "root-theme",
@@ -2164,6 +2246,12 @@
2164
2246
  "component": "esp-slider",
2165
2247
  "description": "Height of the slider track. Defaults to `6px`."
2166
2248
  },
2249
+ {
2250
+ "name": "--esp-stack-gap",
2251
+ "category": "component",
2252
+ "component": "esp-stack",
2253
+ "description": "Overrides the gap between children. Defaults to the `gap` attribute's step, `normal` when unset."
2254
+ },
2167
2255
  {
2168
2256
  "name": "--esp-status-indicator-border-radius",
2169
2257
  "category": "component",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taprootio/espalier",
3
- "version": "3.0.1",
3
+ "version": "3.2.0",
4
4
  "packageManager": "bun@1.3.12",
5
5
  "description": "Espalier — a themeable, accessible, framework-agnostic, enterprise-grade design system built on web standards and love.",
6
6
  "customElements": "custom-elements.json",
@@ -122,6 +122,10 @@
122
122
  "types": "./dist/form-item/esp-form-item.d.ts",
123
123
  "import": "./dist/form-item/esp-form-item.js"
124
124
  },
125
+ "./flyout": {
126
+ "types": "./dist/flyout/esp-flyout.d.ts",
127
+ "import": "./dist/flyout/esp-flyout.js"
128
+ },
125
129
  "./grid": {
126
130
  "types": "./dist/grid/esp-grid.d.ts",
127
131
  "import": "./dist/grid/esp-grid.js"
@@ -178,6 +182,18 @@
178
182
  "types": "./dist/page/esp-page.d.ts",
179
183
  "import": "./dist/page/esp-page.js"
180
184
  },
185
+ "./section": {
186
+ "types": "./dist/section/esp-section.d.ts",
187
+ "import": "./dist/section/esp-section.js"
188
+ },
189
+ "./stack": {
190
+ "types": "./dist/stack/esp-stack.d.ts",
191
+ "import": "./dist/stack/esp-stack.js"
192
+ },
193
+ "./row": {
194
+ "types": "./dist/row/esp-row.d.ts",
195
+ "import": "./dist/row/esp-row.js"
196
+ },
181
197
  "./pickers/pick-one": {
182
198
  "types": "./dist/pickers/esp-pick-one.d.ts",
183
199
  "import": "./dist/pickers/esp-pick-one.js"
@@ -198,6 +214,10 @@
198
214
  "types": "./dist/popover/esp-popover.d.ts",
199
215
  "import": "./dist/popover/esp-popover.js"
200
216
  },
217
+ "./progress": {
218
+ "types": "./dist/progress/esp-progress.d.ts",
219
+ "import": "./dist/progress/esp-progress.js"
220
+ },
201
221
  "./radio-button": {
202
222
  "types": "./dist/radio-button/esp-radio-button.d.ts",
203
223
  "import": "./dist/radio-button/esp-radio-button.js"
@@ -242,6 +262,14 @@
242
262
  "types": "./dist/textarea/esp-textarea.d.ts",
243
263
  "import": "./dist/textarea/esp-textarea.js"
244
264
  },
265
+ "./toaster": {
266
+ "types": "./dist/toaster/esp-toaster.d.ts",
267
+ "import": "./dist/toaster/esp-toaster.js"
268
+ },
269
+ "./tooltip": {
270
+ "types": "./dist/tooltip/esp-tooltip.d.ts",
271
+ "import": "./dist/tooltip/esp-tooltip.js"
272
+ },
245
273
  "./tree": {
246
274
  "types": "./dist/tree/esp-tree.d.ts",
247
275
  "import": "./dist/tree/esp-tree.js"