@taprootio/espalier 7.1.1 → 7.3.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.
Files changed (102) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/custom-elements.json +11675 -20250
  3. package/dist/badge/esp-badge.d.ts +7 -0
  4. package/dist/badge/esp-badge.js +11 -5
  5. package/dist/breadcrumbs/breadcrumb-separators.d.ts +4 -0
  6. package/dist/breadcrumbs/breadcrumb-separators.js +1 -0
  7. package/dist/breadcrumbs/esp-breadcrumb.d.ts +13 -14
  8. package/dist/breadcrumbs/esp-breadcrumb.js +6 -7
  9. package/dist/breadcrumbs/esp-breadcrumbs.d.ts +16 -9
  10. package/dist/breadcrumbs/esp-breadcrumbs.js +9 -6
  11. package/dist/button/paint-registration.js +1 -0
  12. package/dist/cli/theme-check.js +2 -2
  13. package/dist/font-picker/esp-font-picker.d.ts +11 -14
  14. package/dist/font-picker/esp-font-picker.js +5 -5
  15. package/dist/footer/esp-footer-link-group.js +1 -1
  16. package/dist/footer/esp-footer.d.ts +5 -0
  17. package/dist/footer/esp-footer.js +10 -4
  18. package/dist/footer/paint-registration.js +1 -0
  19. package/dist/header/esp-header-button.js +5 -1
  20. package/dist/header/esp-header.js +12 -8
  21. package/dist/header/header-geometry-controller.js +1 -1
  22. package/dist/header/is-tall-header-paint.d.ts +7 -0
  23. package/dist/header/is-tall-header-paint.js +1 -0
  24. package/dist/header/paint-registration.js +1 -0
  25. package/dist/index.d.ts +4 -2
  26. package/dist/index.js +1 -1
  27. package/dist/menu/esp-menu-group.js +8 -8
  28. package/dist/menu/esp-menu-item.js +8 -8
  29. package/dist/menu/esp-menu.js +10 -6
  30. package/dist/menu/navigation-focus-outline.js +8 -0
  31. package/dist/menu/navigation-paint.js +1 -0
  32. package/dist/menu/paint-registration.js +1 -0
  33. package/dist/pickers/esp-picker-item.js +1 -1
  34. package/dist/root/esp-root.d.ts +8 -1
  35. package/dist/root/esp-root.js +47 -10
  36. package/dist/root/helpers/compute-semantic-properties.js +1 -1
  37. package/dist/root/helpers/compute-theme-properties.js +1 -1
  38. package/dist/root/helpers/data-companion-properties.js +1 -1
  39. package/dist/root/helpers/lightness-ramp-properties.js +1 -1
  40. package/dist/shared/blockquote-styles.d.ts +3 -0
  41. package/dist/shared/blockquote-styles.js +4 -4
  42. package/dist/shared/color-engine.js +1 -1
  43. package/dist/shared/component-property-compiler.js +1 -0
  44. package/dist/shared/component-property-diagnostics.js +1 -0
  45. package/dist/shared/component-property-normalizer.js +1 -0
  46. package/dist/shared/component-property-resets.js +1 -0
  47. package/dist/shared/composed-dom.js +1 -0
  48. package/dist/shared/configured-brand-color.js +1 -0
  49. package/dist/shared/configured-brand.js +5 -5
  50. package/dist/shared/css-named-colors.js +1 -0
  51. package/dist/shared/document-sprite.js +1 -1
  52. package/dist/shared/esp-element-base.d.ts +3 -0
  53. package/dist/shared/esp-element-base.js +3 -3
  54. package/dist/shared/font-helpers.d.ts +3 -3
  55. package/dist/shared/font-helpers.js +1 -1
  56. package/dist/shared/font-plan.d.ts +1 -1
  57. package/dist/shared/governing-root.d.ts +24 -0
  58. package/dist/shared/governing-root.js +1 -0
  59. package/dist/shared/intent-values.js +1 -1
  60. package/dist/shared/paint-catalog.d.ts +27 -0
  61. package/dist/shared/paint-catalog.js +1 -0
  62. package/dist/shared/paint-color.d.ts +25 -0
  63. package/dist/shared/paint-color.js +1 -0
  64. package/dist/shared/paint-fit.js +1 -0
  65. package/dist/shared/paint-identity.js +1 -0
  66. package/dist/shared/paint-types.d.ts +88 -0
  67. package/dist/shared/paint-types.js +0 -0
  68. package/dist/shared/public-token-catalog.generated.js +1 -0
  69. package/dist/shared/root-event-subscription.d.ts +11 -0
  70. package/dist/shared/scoped-style-declarations.js +1 -0
  71. package/dist/shared/semantic-color-names.d.ts +16 -0
  72. package/dist/shared/semantic-color-names.js +1 -0
  73. package/dist/shared/settable-component-properties.js +1 -0
  74. package/dist/shared/theme-core.d.ts +808 -0
  75. package/dist/shared/theme-core.js +1 -0
  76. package/dist/shared/theme-fit-report.d.ts +39 -5
  77. package/dist/shared/theme-fit-report.js +1 -1
  78. package/dist/shared/theme-mapping-grammar.d.ts +16 -0
  79. package/dist/shared/theme-mapping-grammar.js +1 -0
  80. package/dist/shared/theme-properties.d.ts +3 -1
  81. package/dist/shared/theme-properties.js +1 -1
  82. package/dist/shared/theme-validation.d.ts +52 -0
  83. package/dist/shared/theme-validation.js +1 -0
  84. package/dist/shared/theme.d.ts +6 -899
  85. package/dist/shared/theme.js +1 -1
  86. package/dist/shared/token-pairings.d.ts +25 -0
  87. package/dist/shared/token-pairings.js +1 -0
  88. package/dist/shared/wcag-contrast.d.ts +14 -0
  89. package/dist/shared/wcag-contrast.js +1 -0
  90. package/dist/testing/index.d.ts +7 -0
  91. package/dist/testing/index.js +1 -0
  92. package/dist/testing/observe-paint.d.ts +29 -0
  93. package/dist/testing/observe-paint.iife.js +3 -0
  94. package/dist/testing/observe-paint.js +3 -0
  95. package/dist/testing/paint-bands.js +1 -0
  96. package/dist/testing/paint-coverage.d.ts +14 -0
  97. package/dist/testing/paint-coverage.js +1 -0
  98. package/dist/testing/paint-dom.js +1 -0
  99. package/dist/testing/svg-paint.js +1 -0
  100. package/espalier.css-data.json +62 -2
  101. package/espalier.token-manifest.json +5724 -29
  102. package/package.json +10 -1
@@ -1,899 +1,6 @@
1
- /**
2
- * @module theme
3
- *
4
- * Data-layer for the Espalier theming system.
5
- *
6
- * Defines the {@link EspalierTheme} interface, default light and dark
7
- * themes, and utilities for encoding, decoding, merging, and
8
- * validating theme objects.
9
- *
10
- * A theme encapsulates **every** tuneable parameter of the design
11
- * system — from the OKLCH seed color to spacing ratios, lightness
12
- * curves, chroma clamps, and semantic color mappings. Two theme
13
- * objects (`light-theme` and `dark-theme`) are passed to `<esp-root>`
14
- * as Base64-encoded JSON attributes; the active `scheme` attribute
15
- * selects which one is applied.
16
- *
17
- * @example
18
- * ```ts
19
- * import {
20
- * DEFAULT_LIGHT_THEME,
21
- * mergeTheme,
22
- * parseTheme,
23
- * validateTheme,
24
- * } from './theme.js';
25
- *
26
- * const result = validateTheme(atob(JSON.stringify({ seedColor: 'oklch(0.6 0.2 30)' })));
27
- * if (result.valid) {
28
- * const partial = parseTheme(myBase64String)!;
29
- * const theme = mergeTheme(DEFAULT_LIGHT_THEME, partial);
30
- * }
31
- * ```
32
- */
33
- import { type DataPalette, type DataRamps, type PartialDataRamps } from "./data-colors.js";
34
- /** A key in the lightness ramp. Each maps to a perceptual role. */
35
- export type LightnessKey = "surface" | "raised1" | "raised2" | "raised3" | "raised4" | "accent" | "muted" | "text" | "border" | "ink" | "shadow";
36
- /** Lightness values (0–1) for every ramp position. */
37
- export type LightnessMap = Record<LightnessKey, number>;
38
- /** A named, opt-in lightness value outside the engine-owned ramp. */
39
- export type ToneReference = `tone:${string}`;
40
- /** A built-in ramp stop or an explicitly declared custom tone. */
41
- export type LightnessReference = LightnessKey | ToneReference;
42
- /** Named custom lightness values. They are inert until a mapping references one. */
43
- export type ThemeTones = Record<string, number>;
44
- /** Tone declarations while partial themes are being layered. */
45
- export type PartialThemeTones = Record<string, number | undefined>;
46
- /**
47
- * A geometric color-theory variant **or** a fixed status family.
48
- *
49
- * Geometric variants are derived by rotating the seed hue; the status
50
- * families (`danger`, `success`, `warning`, `info`) use fixed hue
51
- * angles from `semanticHues` — or a theme's `intents` override, which
52
- * retunes a family with a declared absolute color (ESP0172).
53
- */
54
- export type ColorSource = "primary" | "analogous-left" | "analogous-right" | "complementary" | "split-complementary-left" | "split-complementary-right" | "triadic-left" | "triadic-right" | "danger" | "success" | "warning" | "info";
55
- /**
56
- * Non-primary color sources — the eleven variants that can carry
57
- * independent chroma overrides.
58
- *
59
- * Primary is excluded because its chroma is always the seed
60
- * color's chroma.
61
- */
62
- export type VariantColorSource = Exclude<ColorSource, "primary">;
63
- /**
64
- * The fixed-meaning status families (ADR-004): the colors
65
- * `intent="danger|success|warning|info"` and the same-named mapping
66
- * sources resolve to. A theme may retune each with `intents`.
67
- */
68
- export type StatusColorSource = "danger" | "success" | "warning" | "info";
69
- /**
70
- * Status-family color overrides, by family (ESP0172). Values are an
71
- * `anchor:<name>[.<slot>]` reference or a supported color form
72
- * (`#rrggbb`, `#rgb`, `rgb()`, `hsl()`, `oklch()`); see
73
- * {@link EspalierTheme.intents}.
74
- */
75
- export type ThemeIntents = Partial<Record<StatusColorSource, string>>;
76
- /**
77
- * The object form of an anchor: a required base `color` plus named
78
- * sub-slots — per-family variants the way designers already specify
79
- * them (`rose.text` for the deepened rose that may carry copy).
80
- */
81
- export type ThemeAnchorSlots = {
82
- color: string;
83
- } & Record<string, string>;
84
- /**
85
- * A named brand color in a **resolved** theme.
86
- *
87
- * Either a color string, or the slot object — which always carries its
88
- * base `color`, because a partial that names only slots refines an
89
- * anchor rather than replacing it. Like `seedColor`, this type states
90
- * the contract `validateTheme` enforces: a theme assembled from an
91
- * unvalidated partial that never declared a base color reports an error
92
- * there, and degrades to the seed at runtime.
93
- *
94
- * Every value accepts any CSS color form (ESP0161) and is normalized to
95
- * OKLCH at the merge boundary.
96
- */
97
- export type ThemeAnchor = string | ThemeAnchorSlots;
98
- /**
99
- * A named brand color in a **partial** theme, where an object form may
100
- * name slots alone — `{ rose: { hover: "#88404c" } }` refines the rose
101
- * anchor a base theme already declared.
102
- */
103
- export type PartialThemeAnchor = string | Record<string, string>;
104
- /** Anchors as they appear in a partial theme. */
105
- export type PartialThemeAnchors = Record<string, PartialThemeAnchor>;
106
- /**
107
- * Named brand colors, keyed by slug.
108
- *
109
- * Anchors are free-standing color sources for semantic mappings —
110
- * `source: "anchor:<name>"` — so a multi-color brand is declared as the
111
- * swatches the designer handed over instead of being bent through hue
112
- * geometry and per-token chroma clamps. See ADR-015.
113
- */
114
- export type ThemeAnchors = Record<string, ThemeAnchor>;
115
- /**
116
- * A semantic mapping's color source: a geometric or status family from
117
- * {@link ColorSource}, or a declared anchor — `anchor:<name>` for its
118
- * base color, `anchor:<name>.<slot>` for a sub-slot.
119
- *
120
- * An anchor source contributes its own hue **and chroma**; lightness
121
- * comes from the mapping's built-in stop or custom tone, and APCA
122
- * enforcement applies unchanged. Anchors are absolute sources rather
123
- * than seed rotations — a brand color is a color, not a relationship
124
- * to the seed — so they hold steady while contexts rebind roles around
125
- * them and intents replace the filled-action source.
126
- */
127
- export type MappingSource = ColorSource | `anchor:${string}`;
128
- /** Anchor names and slot names share one slug grammar. */
129
- export declare const ANCHOR_SLUG_PATTERN: RegExp;
130
- /** A parsed `anchor:` mapping source. */
131
- export interface AnchorReference {
132
- name: string;
133
- slot?: string;
134
- }
135
- /**
136
- * Parse an `anchor:` mapping source into its reference, or return
137
- * `null` for anything that is not anchor syntax at all. (A reference
138
- * with an invalid or undeclared name parses fine here — declaration
139
- * checks belong to validateTheme and resolution.)
140
- */
141
- export declare function parseAnchorSource(source: string): AnchorReference | null;
142
- /**
143
- * Resolve an anchor reference to its declared color string.
144
- *
145
- * `anchor:<name>` on an object-form anchor resolves the `color` key; a
146
- * slot reference into a string-form anchor has nowhere to point and
147
- * resolves `null`, as do unknown names and slots.
148
- */
149
- export declare function resolveAnchorColor(anchors: ThemeAnchors, reference: AnchorReference): string | null;
150
- /**
151
- * Resolve a data color source to a concrete CSS color.
152
- *
153
- * Data palettes and ramps accept either a CSS color directly or the same
154
- * `anchor:<name>[.<slot>]` references as semantic mappings. The returned color
155
- * is parseable and opaque; invalid or unresolved sources return `null`.
156
- */
157
- export declare function resolveDataColorSource(source: string, anchors: ThemeAnchors): string | null;
158
- /** Every semantic color token the system computes. */
159
- export type SemanticColorName = "background" | "layer1" | "layer2" | "layer3" | "layer4" | "actionBackground" | "actionText" | "border" | "shadow" | "text" | "typeOverline" | "typeLabel" | "typeLead" | "typeCaption" | "dangerText" | "headings" | "headingsHover" | "link" | "linkHover" | "linkHoverBg" | "inputCaret" | "inputSelection" | "inputSelectionBg";
160
- /** Chroma range enforced on a semantic token before gamut mapping. */
161
- export interface ChromaRange {
162
- /** Minimum chroma (≥ 0). */
163
- min: number;
164
- /** Maximum chroma (≤ 0.4). */
165
- max: number;
166
- }
167
- /**
168
- * Describes how a single semantic color is derived:
169
- * which color source provides the hue + chroma, and which
170
- * lightness ramp position sets the perceived brightness.
171
- */
172
- export interface SemanticMapping {
173
- /**
174
- * The color source to sample: a geometric/status family, or a
175
- * declared anchor as `anchor:<name>` / `anchor:<name>.<slot>`.
176
- */
177
- source: MappingSource;
178
- /** A built-in ramp stop, or a named custom tone as `tone:<name>`. */
179
- lightness: LightnessReference;
180
- }
181
- /** Full mapping table — one entry per semantic color token. */
182
- export type SemanticMappings = Record<SemanticColorName, SemanticMapping>;
183
- /**
184
- * The designer-facing color roles.
185
- *
186
- * `semantic-groups.md` has always described these groups and then warned
187
- * that exposing the twenty-three raw tokens is "handing users the engine
188
- * room instead of the dashboard" — but the groups were documentation
189
- * only. Roles make them addressable: a sentence a designer would say
190
- * becomes a line of theme.
191
- *
192
- * - `canvas` — the page and its raised surfaces
193
- * - `ink` — body copy, with a `heading` slot for titles
194
- * - `accent` — decoration (rules, icons, hover washes), with a `text`
195
- * slot for the deepened variant that may carry copy
196
- * - `action` — filled action surfaces; its paired ink derives
197
- * automatically (see {@link ROLE_PAIRED_INK})
198
- * - `structure` — borders and shadows
199
- *
200
- * `status` is deliberately absent as a role: the four status families
201
- * (`danger`, `success`, `warning`, `info`) carry reserved *meanings*
202
- * that no role may reassign (ADR-004, as amended). Their *colors* are
203
- * a brand decision — retune a family with the theme's `intents` field
204
- * and every derived token follows.
205
- */
206
- export type RoleName = "canvas" | "ink" | "accent" | "action" | "structure";
207
- /**
208
- * A role binding: a color source, or an object with the base `color`
209
- * plus role-specific slots.
210
- *
211
- * Sources are the same vocabulary mappings use — a geometric family, a
212
- * status family, or an `anchor:<name>` reference (ADR-015).
213
- */
214
- export type RoleSlotName = {
215
- canvas: never;
216
- ink: "heading";
217
- accent: "text" | "hover";
218
- action: "ink";
219
- structure: never;
220
- };
221
- export type RoleBinding<R extends RoleName = RoleName> = MappingSource | ({
222
- color: MappingSource;
223
- } & Partial<Record<RoleSlotName[R], MappingSource>>);
224
- /**
225
- * The roles a theme declares. Every role is optional, and each one
226
- * admits only its own slots — `ink.heading`, `accent.text`,
227
- * `action.ink` — so the structural claims the roles layer makes are
228
- * checked by the type system, not only by validateTheme.
229
- */
230
- export type ThemeRoles = {
231
- [R in RoleName]?: RoleBinding<R>;
232
- };
233
- /**
234
- * One named zone-level rebinding of the designer-facing color roles.
235
- *
236
- * A context may also carry a partial lightness ramp. Color sources alone
237
- * cannot make a dark zone inside a light scheme because semantic derivation
238
- * deliberately takes lightness from the ramp rather than from an anchor.
239
- *
240
- * A context may also carry custom `tones` and token-level
241
- * `semanticMappings` (ESP0175, ESP0180). Root-level tones and explicit
242
- * mappings survive into every context by design, while a zone may add or
243
- * override a tone and pin a token locally. Each record layers by name.
244
- */
245
- export type ThemeContext = ThemeRoles & {
246
- lightness?: Partial<LightnessMap>;
247
- tones?: PartialThemeTones;
248
- semanticMappings?: Partial<SemanticMappings>;
249
- };
250
- /** Named role-rebinding zones available to `context` attributes. */
251
- export type ThemeContexts = Record<string, ThemeContext>;
252
- /** Context declarations while partial themes are being layered. */
253
- export type PartialThemeContexts = Record<string, ThemeContext | undefined>;
254
- /** Ordered role names, for validation and iteration. */
255
- export declare const ROLE_NAMES: readonly RoleName[];
256
- /**
257
- * Map role slots to semantic tokens and ramp stops.
258
- *
259
- * `dangerText` stays outside the roles layer because status meanings are reserved.
260
- * Accent body copy must use the legible `accent.text` slot. `accent.hover` can
261
- * select a different family; without it, hovered links follow `accent.text`.
262
- */
263
- export declare const ROLE_TOKEN_PLAN: Readonly<Record<RoleName, Readonly<Record<string, ReadonlyArray<[SemanticColorName, LightnessKey]>>>>>;
264
- /**
265
- * Role slots whose ink lightness is derived from the surface that role
266
- * actually painted, rather than taken from {@link ROLE_TOKEN_PLAN}.
267
- *
268
- * {@link resolvePairedInkStop} used to run only for a slot the theme
269
- * left *undeclared*, so naming `action.ink` took the plan's `surface`
270
- * stop verbatim. In a light ramp both rules answer `surface` and the
271
- * difference never showed. In a dark ramp the plan's stop is the
272
- * near-black page ground, which is the wrong side of a mid-dark action
273
- * surface: enforcement had to walk the label the whole way across the
274
- * ramp and stopped at the first value that cleared the target, emitting
275
- * a weaker ink than the ramp could give. ADR-016 is explicit that the
276
- * model's job is to hand enforcement the strongest available starting
277
- * point on the correct side, so the derivation now runs for a declared
278
- * slot too (ESP0223).
279
- *
280
- * The source still comes from the theme: naming `action.ink` chooses
281
- * the family, exactly as ADR-015 says an anchor supplies hue and chroma
282
- * while the ramp supplies lightness.
283
- *
284
- * Every entry here must also appear in {@link ROLE_PAIRED_INK}: the
285
- * compile branch is gated on `paired` first, and
286
- * {@link roleInkProvenance} walks the pairing table, so an entry in only
287
- * this set would be silently inert in both.
288
- */
289
- export declare const ROLE_DERIVED_INK: ReadonlySet<string>;
290
- /**
291
- * Ink slots that derive from another role when the theme does not
292
- * declare them.
293
- *
294
- * A role that paints a surface must also answer "what writes on it".
295
- * `action.ink` defaults to the canvas color: the ink paired with a
296
- * filled action is the page ground, and APCA enforcement against
297
- * `actionBackground` then guarantees it is legible — which is exactly
298
- * how "white on plum for reversed sections" becomes one theme line
299
- * instead of a hand-picked hex.
300
- */
301
- export declare const ROLE_PAIRED_INK: Readonly<Record<string, {
302
- role: RoleName;
303
- slot: string;
304
- }>>;
305
- interface CompileRoleOptions {
306
- /** Token mappings declared explicitly at this merge boundary. */
307
- explicitMappings?: Partial<SemanticMappings>;
308
- /** Custom tones available to explicit surface mappings. */
309
- tones?: ThemeTones;
310
- /** Exact maximum paired-ink contrast of an action surface candidate. */
311
- actionSurfaceContrast?: (source: MappingSource, stop: LightnessKey) => number;
312
- /** ΔE-OK between an action surface candidate and the theme's background. */
313
- actionSurfaceSeparation?: (source: MappingSource, stop: LightnessKey) => number;
314
- /** Which ink pole reads better on a finished action surface at a lightness. */
315
- actionSurfacePole?: (source: MappingSource, lightness: number) => "dark" | "light";
316
- }
317
- /**
318
- * Compile declared roles into semantic mappings.
319
- *
320
- * A theme with no roles produces no role overrides. Token-level
321
- * `semanticMappings` take precedence over the compiled result.
322
- */
323
- export declare function compileRoles(roles: ThemeRoles, lightness: LightnessMap, baseMappings: SemanticMappings, options?: CompileRoleOptions): Partial<SemanticMappings>;
324
- /**
325
- * Whether each role-paired ink token's *source* was named by the theme
326
- * or paired off another role (ESP0223).
327
- *
328
- * The distinction matters to anything judging how far a token landed
329
- * from the swatch it names. `action.ink` defaults to the canvas colour,
330
- * so an undeclared ink IS the page ground by contract — it is re-lit to
331
- * the opposite end of the ramp on purpose, and the large anchor ΔE that
332
- * follows describes the contract working, not a theme missing its
333
- * brand. A theme that names the slot has made a separate claim about
334
- * the label's family, and the same ΔE then describes a claim that did
335
- * not survive.
336
- *
337
- * A pure read of `roles`: the compile is not re-run, and a role the
338
- * theme never declared reports nothing rather than guessing.
339
- */
340
- export declare function roleInkProvenance(roles: ThemeRoles): Partial<Record<SemanticColorName, "declared" | "derived">>;
341
- /** The complete, resolved Espalier theme. */
342
- export interface EspalierTheme {
343
- /**
344
- * Seed color — drives the entire palette.
345
- *
346
- * A theme author may supply any common CSS color form (`#rrggbb`,
347
- * `#rgb`, `rgb()`, `hsl()`, or `oklch()`); non-OKLCH forms are
348
- * converted at the merge boundary, so a **resolved** theme always
349
- * carries an `oklch()` string here.
350
- */
351
- seedColor: string;
352
- /**
353
- * CSS `font-family` for body / UI text. Empty and omitted overrides resolve
354
- * to the built-in UI stack.
355
- *
356
- * @default "system-ui, sans-serif"
357
- */
358
- fontBody: string;
359
- /**
360
- * CSS `font-family` for headings. When empty, heading recipes fall back to
361
- * {@link fontBody} without changing this authored value.
362
- *
363
- * @default ""
364
- */
365
- fontHeadings: string;
366
- /**
367
- * CSS `font-family` for brand marks and product names. When empty, brand
368
- * recipes fall back through {@link fontHeadings} to {@link fontBody}.
369
- *
370
- * @default ""
371
- */
372
- fontBrand: string;
373
- /**
374
- * CSS `font-family` for navigation menu items and group labels. When empty,
375
- * menu recipes fall back to {@link fontBody} — never to headings — so a
376
- * theme that sets only a heading face keeps its navigation unchanged.
377
- *
378
- * @default ""
379
- */
380
- fontMenu: string;
381
- /**
382
- * CSS `font-family` for code / monospace text. Empty and omitted overrides
383
- * resolve to the built-in monospace family.
384
- *
385
- * @default "monospace"
386
- */
387
- fontMonospace: string;
388
- /**
389
- * CSS `font-weight` for body / UI text.
390
- *
391
- * Accepts any valid CSS font-weight value: numeric (`"400"`,
392
- * `"700"`, range 1–1000), keyword (`"normal"`, `"bold"`,
393
- * `"lighter"`, `"bolder"`), or CSS-wide keyword (`"inherit"`,
394
- * `"initial"`, `"unset"`, `"revert"`, `"revert-layer"`).
395
- *
396
- * Emitted as `--esp-font-weight-body`.
397
- *
398
- * @default "normal"
399
- */
400
- fontWeightBody: string;
401
- /**
402
- * CSS `font-weight` for headings.
403
- *
404
- * Accepts the same values as {@link fontWeightBody}.
405
- *
406
- * Emitted as `--esp-font-weight-headings`.
407
- *
408
- * @default "bold"
409
- */
410
- fontWeightHeadings: string;
411
- /**
412
- * CSS `font-weight` for brand marks and product names.
413
- *
414
- * Accepts the same values as {@link fontWeightBody}.
415
- *
416
- * Emitted as `--esp-font-weight-brand`.
417
- *
418
- * @default "bold"
419
- */
420
- fontWeightBrand: string;
421
- /**
422
- * CSS `font-weight` for horizontal navigation menu items.
423
- *
424
- * Accepts the same values as {@link fontWeightBody}.
425
- *
426
- * Emitted as `--esp-font-weight-menu`.
427
- *
428
- * @default "bold"
429
- */
430
- fontWeightMenu: string;
431
- /**
432
- * CSS `font-weight` for code / monospace text.
433
- *
434
- * Accepts the same values as {@link fontWeightBody}.
435
- *
436
- * Emitted as `--esp-font-weight-monospace`.
437
- *
438
- * @default "normal"
439
- */
440
- fontWeightMonospace: string;
441
- /** External stylesheets injected into `document.head`. */
442
- stylesheets: string[];
443
- /** Scale coefficient in px relative to a 16px baseline; does not set or measure HTML font-size. */
444
- rootFontSize: number;
445
- /** Modular ratio for the type scale (Major Third = 1.25). */
446
- typeRatio: number;
447
- /** Modular ratio for the spacing scale (Golden Ratio ≈ 1.618). */
448
- spaceRatio: number;
449
- /** Global border-radius in rem. */
450
- borderRadius: number;
451
- /** Minimum viewport width (px) for fluid interpolation. */
452
- viewportMin: number;
453
- /** Maximum viewport width (px) for fluid interpolation. */
454
- viewportMax: number;
455
- /** Hue-rotation angles for geometric color variants. */
456
- angles: {
457
- /** Analogous offset from seed (default 30). */
458
- analogous: number;
459
- /** Complementary offset from seed (default 180). */
460
- complementary: number;
461
- /**
462
- * Split-complementary offset **from the complement**.
463
- * The mirror is computed automatically (default 30).
464
- */
465
- splitComplementary: number;
466
- /** Triadic offset from seed (default 120). */
467
- triadic: number;
468
- };
469
- /** Fixed hue angles for the danger / success / warning / info families. */
470
- semanticHues: {
471
- /** Danger hue angle (default 27, red-orange). */
472
- danger: number;
473
- /** Success hue angle (default 150, green). */
474
- success: number;
475
- /** Warning hue angle (default 90, yellow-green). */
476
- warning: number;
477
- /** Info hue angle (default 244, blue). */
478
- info: number;
479
- };
480
- /**
481
- * Status-family color overrides, by family (ESP0172).
482
- *
483
- * Each entry retunes one of the fixed status families — the colors
484
- * `intent="danger|success|warning|info"` and the same-named mapping
485
- * sources resolve to — with a declared color: an
486
- * `anchor:<name>[.<slot>]` reference or a supported color form —
487
- * `#rrggbb`, `#rgb`, `rgb()`, `hsl()`, or `oklch()`. CSS keywords
488
- * such as `red` are not parsed.
489
- *
490
- * An override is **absolute**, like an anchor: it carries its own
491
- * lightness, chroma, and hue, and `semanticHues` / `variantChroma`
492
- * are ignored for that family. Overrides retune a family; they do
493
- * not reassign its meaning (ADR-004): give `danger` your brand's
494
- * red, but never point one family at another — a family name as a
495
- * value (`intents.success: "danger"`) is rejected by validation; a
496
- * color choice that creates a rendered collision is flagged by the
497
- * distance warning, while a merely unusual — but separated — color
498
- * passes silently. `validateTheme` warns when two
499
- * status families — or a family and the action color — become hard
500
- * to distinguish as rendered on controls, and its advice is
501
- * counterfactual-tested per pair: it recommends retuning, widening
502
- * the chroma band, or moving the lightness stop only when that
503
- * change can actually separate the pair, and says "then retune"
504
- * when a band or stop change merely makes a retune possible rather
505
- * than separating the pair on its own. The built-in warning is
506
- * normal-vision-only; status meanings need redundant cues (icons,
507
- * labels) regardless, though lightness and chroma separation chosen
508
- * here can still genuinely help color-vision-deficient users — see
509
- * ADR-004's amendment and the data-color guidance.
510
- *
511
- * @example
512
- * ```jsonc
513
- * "intents": { "info": "anchor:sky", "danger": "#700007" }
514
- * ```
515
- */
516
- intents: ThemeIntents;
517
- /**
518
- * Per-variant chroma overrides (OKLCH chroma, 0–0.4).
519
- *
520
- * Each entry sets the **base chroma** for the corresponding
521
- * color variant, overriding the seed color's chroma for that
522
- * variant only. Omitted entries inherit the seed color's
523
- * chroma at compute time.
524
- *
525
- * This is independent of the per-semantic-token `chroma` ranges
526
- * which clamp chroma *after* derivation. `variantChroma` controls
527
- * the input chroma of the variant itself, while `chroma` controls
528
- * the output range of each semantic token.
529
- *
530
- * @example
531
- * ```ts
532
- * // Make complementary colors more vivid, mute triadic colors
533
- * variantChroma: {
534
- * "complementary": 0.22,
535
- * "triadic-left": 0.06,
536
- * "triadic-right": 0.06,
537
- * }
538
- * ```
539
- */
540
- variantChroma: Partial<Record<VariantColorSource, number>>;
541
- /** Lightness values (0–1) for the eleven ramp positions. */
542
- lightness: LightnessMap;
543
- /**
544
- * Named custom lightness values for explicit semantic mappings.
545
- *
546
- * Refer to one as `tone:<name>` from `semanticMappings`. Tones do not
547
- * become built-in ramp stops, emit `--esp-l-*` properties, or participate
548
- * in automatic role and action-stop selection.
549
- */
550
- tones: ThemeTones;
551
- /** Per-semantic-token chroma min / max. */
552
- chroma: Record<SemanticColorName, ChromaRange>;
553
- /** Maps each semantic token to its color source + lightness. */
554
- semanticMappings: SemanticMappings;
555
- /**
556
- * Tokens in {@link semanticMappings} that were authored as explicit pins.
557
- *
558
- * A resolved theme also contains mappings generated by {@link roles}. This
559
- * compact marker preserves that distinction when a complete theme document
560
- * is serialized, then rehydrated through {@link mergeTheme}. Consumers
561
- * normally do not author this field; `mergeTheme` maintains it.
562
- */
563
- explicitMappingTokens?: SemanticColorName[];
564
- /**
565
- * Named brand colors available to semantic mappings as
566
- * `anchor:<name>` sources. Empty by default — a single-color brand
567
- * needs none; a multi-color brand declares its swatches here instead
568
- * of bending hue angles. See {@link ThemeAnchors} and ADR-015.
569
- */
570
- anchors: ThemeAnchors;
571
- /**
572
- * Designer-facing color roles, compiled into
573
- * {@link EspalierTheme.semanticMappings} at merge time. Empty by
574
- * default; token-level mappings layer over whatever roles produce.
575
- * See {@link ThemeRoles} and ADR-016.
576
- */
577
- roles: ThemeRoles;
578
- /**
579
- * Named zone-level role rebindings. A base-derived element selects one with
580
- * its `context` attribute; the selected context is resolved against this
581
- * scheme's complete theme and re-enforces every semantic ink pairing.
582
- */
583
- contexts: ThemeContexts;
584
- /**
585
- * Eight stable categorical data-series colors. Each value is a CSS color or
586
- * an `anchor:<name>[.<slot>]` reference. Emitted as
587
- * `--esp-color-series-1`–`--esp-color-series-8`.
588
- */
589
- dataPalette: DataPalette;
590
- /**
591
- * Named sequential and diverging data ramps. Empty by default; each
592
- * declaration emits `--esp-color-ramp-<name>-1…<steps>`.
593
- */
594
- dataRamps: DataRamps;
595
- /** Optional CSS `background-image` for the page surface. */
596
- pageBackgroundImage?: string;
597
- /** Opacity (0–1) for the page background image. */
598
- pageBackgroundImageOpacity?: number;
599
- /** Optional CSS `background-image` for `esp-box` surfaces. */
600
- boxBackgroundImage?: string;
601
- /** Opacity (0–1) for the box background image. */
602
- boxBackgroundImageOpacity?: number;
603
- /** Opacity (0–1) for the vellum (modal overlay) backdrop. */
604
- vellumOpacity?: number;
605
- /** Optional CSS `background-image` for vellum overlays. */
606
- vellumBackgroundImage?: string;
607
- /** Opacity (0–1) for the vellum background image layer. */
608
- vellumBackgroundImageOpacity?: number;
609
- }
610
- /**
611
- * Recursively-partial version of {@link EspalierTheme}.
612
- *
613
- * `anchors` is stated explicitly rather than derived: a partial may
614
- * carry slot-only anchor overrides, which the resolved
615
- * {@link ThemeAnchor} deliberately does not permit.
616
- */
617
- export type PartialTheme = Omit<DeepPartial<EspalierTheme>, "anchors" | "contexts" | "dataRamps" | "tones"> & {
618
- anchors?: PartialThemeAnchors;
619
- contexts?: PartialThemeContexts;
620
- dataRamps?: PartialDataRamps;
621
- tones?: PartialThemeTones;
622
- };
623
- /** Validation result returned by {@link validateTheme}. */
624
- export interface ThemeValidationResult {
625
- /** `true` when there are zero errors (warnings are allowed). */
626
- valid: boolean;
627
- /** Hard failures — the theme should not be applied. */
628
- errors: string[];
629
- /** Soft issues — the theme will work but values are unusual. */
630
- warnings: string[];
631
- }
632
- /**
633
- * Which semantic tokens are ink, what surface each sits on, and the
634
- * APCA contrast each must clear.
635
- *
636
- * This pairing lived as an identical hardcoded table inside both
637
- * `compute-theme-properties.ts` and `esp-element-base.ts` — invisible to
638
- * themes and duplicated in exactly the way this repository's adoption
639
- * rules exist to prevent. It belongs to the model: every serious system
640
- * makes the surface/ink pair the unit designers see (Material's
641
- * `on-primary`, shadcn's `-foreground`), and the roles layer derives an
642
- * action's ink from it rather than asking a designer to hand-pick a
643
- * legible color.
644
- *
645
- * Lc targets follow the APCA guidelines (ADR-002):
646
- * 90 → body text at any size
647
- * 75 → 16 px+ text (UI labels, links, body)
648
- * 60 → 24 px+ bold / 28 px+ normal (headings, carets, decorative)
649
- */
650
- type TokenPairing = Readonly<{
651
- bg: SemanticColorName;
652
- targetLc: number;
653
- }>;
654
- export declare const TOKEN_PAIRINGS: Readonly<Record<"actionText", TokenPairing> & Partial<Record<SemanticColorName, TokenPairing>>>;
655
- /** Ordered list of all semantic color token names. */
656
- export declare const SEMANTIC_COLOR_NAMES: readonly SemanticColorName[];
657
- /** `true` when `value` is one of the stable semantic color token names. */
658
- export declare function isSemanticColorName(value: unknown): value is SemanticColorName;
659
- /** Valid color-source identifiers for {@link SemanticMapping.source}. */
660
- export declare const COLOR_SOURCES: readonly ColorSource[];
661
- /** The four fixed status families, matching {@link StatusColorSource}. */
662
- export declare const STATUS_COLOR_SOURCES: readonly StatusColorSource[];
663
- /**
664
- * Non-primary color sources that support independent chroma overrides.
665
- *
666
- * Matches the eleven entries in {@link VariantColorSource}.
667
- */
668
- export declare const VARIANT_COLOR_SOURCES: readonly VariantColorSource[];
669
- /** Valid keys for the lightness ramp. */
670
- export declare const LIGHTNESS_KEYS: readonly LightnessKey[];
671
- /** Return the custom tone name carried by a valid `tone:<slug>` reference. */
672
- export declare function toneReferenceName(reference: unknown): string | null;
673
- /** True when a string names one of the eleven engine-owned ramp stops. */
674
- export declare function isLightnessKey(reference: unknown): reference is LightnessKey;
675
- /**
676
- * Resolve the lightness an explicit semantic mapping requested.
677
- *
678
- * Custom tones are a lookup namespace only: this function never adds them to
679
- * {@link LIGHTNESS_KEYS}, so automatic role and action-stop algorithms continue
680
- * to consider exactly the built-in eleven. An invalid runtime reference falls
681
- * back to `surface`; validation reports the authoring error before mounting.
682
- */
683
- export declare function resolveLightnessReference(lightness: LightnessMap, tones: ThemeTones | undefined, reference: LightnessReference): number;
684
- /**
685
- * Default lightness ramp for the **light** scheme.
686
- *
687
- * High values for surfaces → low values for text, following the
688
- * natural top-to-bottom contrast gradient of a printed page.
689
- */
690
- export declare const DEFAULT_LIGHT_LIGHTNESS: Readonly<LightnessMap>;
691
- /**
692
- * Default lightness ramp for the **dark** scheme.
693
- *
694
- * Inverted: low values for surfaces, high values for text.
695
- */
696
- export declare const DEFAULT_DARK_LIGHTNESS: Readonly<LightnessMap>;
697
- /**
698
- * Default semantic color mappings that match the existing CSS.
699
- *
700
- * Each entry tells the color engine which variant supplies the
701
- * hue and which lightness key sets the perceived brightness.
702
- *
703
- * `actionBackground` carries the **light** scheme's stop; the dark
704
- * theme overrides it through {@link buildDefaultSemanticMappings}. See
705
- * {@link DEFAULT_ACTION_BACKGROUND_STOP} for why that one mapping
706
- * cannot share a name across schemes.
707
- */
708
- export declare const DEFAULT_SEMANTIC_MAPPINGS: Readonly<SemanticMappings>;
709
- /** Built-in authored stack for body and UI text. */
710
- export declare const DEFAULT_BODY_FONT_FAMILY = "system-ui, sans-serif";
711
- /** Built-in authored family for code and monospace text. */
712
- export declare const DEFAULT_MONOSPACE_FONT_FAMILY = "monospace";
713
- /**
714
- * The built-in **light** theme.
715
- *
716
- * Identical to the dark theme in every field except `lightness`,
717
- * which uses a high-surface / low-text ramp suited for bright
718
- * backgrounds.
719
- */
720
- export declare const DEFAULT_LIGHT_THEME: Readonly<EspalierTheme>;
721
- /**
722
- * The built-in **dark** theme.
723
- *
724
- * Identical to the light theme in every field except `lightness`,
725
- * which uses a low-surface / high-text ramp suited for dark
726
- * backgrounds.
727
- */
728
- export declare const DEFAULT_DARK_THEME: Readonly<EspalierTheme>;
729
- /**
730
- * Recursively-partial utility type.
731
- *
732
- * Arrays are left as-is (a partial array is still an array),
733
- * while plain objects are made deeply optional.
734
- */
735
- type DeepPartial<T> = {
736
- [P in keyof T]?: T[P] extends (infer U)[] ? U[] : T[P] extends Record<string, unknown> ? DeepPartial<T[P]> : T[P];
737
- };
738
- /**
739
- * Convert a {@link SemanticColorName} (camelCase) to its CSS
740
- * custom-property name (kebab-case with `--esp-color-` prefix).
741
- *
742
- * ```
743
- * linkHoverBg → --esp-color-link-hover-bg
744
- * layer1 → --esp-color-layer-1
745
- * ```
746
- */
747
- export declare function semanticToCSS(name: SemanticColorName): string;
748
- /**
749
- * Decode a Base64-encoded JSON string into a {@link PartialTheme}.
750
- *
751
- * Returns `null` if decoding or JSON parsing fails — never throws.
752
- *
753
- * Unsafe property names (`__proto__`, `constructor`, `prototype`)
754
- * are stripped during parsing via a JSON reviver to prevent
755
- * prototype pollution from untrusted encoded themes.
756
- *
757
- * @param base64 A Base64-encoded JSON string.
758
- * @returns The decoded partial theme, or `null` on failure.
759
- */
760
- export declare function parseTheme(base64: string): PartialTheme | null;
761
- /**
762
- * Encode a {@link PartialTheme} as a Base64 JSON string.
763
- *
764
- * The inverse of {@link parseTheme}. Unicode-safe: theme strings (font
765
- * names, anchor slugs' display metadata) may carry any code point.
766
- *
767
- * @param partial The partial theme to encode.
768
- * @returns A Base64-encoded JSON string.
769
- */
770
- export declare function encodeTheme(partial: PartialTheme): string;
771
- /** True for an ordinary record whose entries can be merged by key. */
772
- export declare function isObjectRecord(value: unknown): value is Record<string, unknown>;
773
- /**
774
- * Recover explicit mapping provenance from a resolved theme.
775
- *
776
- * Themes produced in this process carry exact provenance in the WeakMap and
777
- * serialize it in `explicitMappingTokens`. The comparison fallback preserves
778
- * historical behavior for a legacy or manually reconstructed resolved theme
779
- * that carries neither form.
780
- *
781
- * Exported for the fit report (ESP0175), which marks explicit tokens so
782
- * a zone's surprising value traces to the mapping that pinned it.
783
- */
784
- export declare function explicitMappingTokens(theme: EspalierTheme): Set<SemanticColorName>;
785
- /**
786
- * Deep-merge a {@link PartialTheme} over a set of defaults.
787
- *
788
- * Primitive fields are replaced; nested objects (`angles`,
789
- * `semanticHues`, `lightness`, `tones`, `chroma`, `semanticMappings`, `contexts`)
790
- * are merged key-by-key. Arrays (`stylesheets`) are replaced
791
- * wholesale.
792
- *
793
- * @param defaults The fully-resolved base theme.
794
- * @param overrides User-supplied partial overrides.
795
- * @returns A new fully-resolved {@link EspalierTheme}.
796
- */
797
- export declare function mergeTheme(defaults: EspalierTheme, overrides: PartialTheme): EspalierTheme;
798
- /**
799
- * Compile a named context over a resolved theme — the exact theme a
800
- * `context="<name>"` zone renders (ESP0175).
801
- *
802
- * This is the same compilation `esp-element-base` performs for a zone
803
- * host, exported so a check script or the fit report can inspect a
804
- * context surface without a DOM: role rebindings, the partial lightness ramp,
805
- * and custom tones merge over the root theme, and any context-level
806
- * `semanticMappings` layer on top as explicit token pins. Returns `null` when
807
- * the theme does not define the context.
808
- *
809
- * @param theme A resolved theme (as `mergeTheme` returns).
810
- * @param name The context name a zone would set in its attribute.
811
- */
812
- export declare function resolveContextTheme(theme: EspalierTheme, name: string): EspalierTheme | null;
813
- /**
814
- * Validate a single encoded theme partial.
815
- *
816
- * Structural grammar aside, the advisory checks (the status-collision
817
- * warning and chroma-band provenance) resolve the partial against
818
- * {@link DEFAULT_LIGHT_THEME}. A partial written for the dark side of a
819
- * pair should be validated through {@link validateThemePair}, which
820
- * audits it against the dark defaults instead.
821
- */
822
- export declare function validateTheme(base64: string): ThemeValidationResult;
823
- /**
824
- * Validate the light and dark partials that form one scheme-paired theme.
825
- *
826
- * Each side runs the same validation as {@link validateTheme}, with one
827
- * scheme-aware difference: the dark partial's advisory checks resolve
828
- * against {@link DEFAULT_DARK_THEME}, so a collision that only appears
829
- * through the dark ramp is caught. Once both sides are structurally
830
- * valid, their context-name sets must match exactly so a stable
831
- * `context` attribute cannot silently change meaning when the scheme
832
- * changes.
833
- */
834
- export declare function validateThemePair(lightBase64: string, darkBase64: string): ThemeValidationResult;
835
- /**
836
- * Keys of {@link EspalierTheme} whose values are nested objects
837
- * and therefore need key-by-key merging instead of wholesale
838
- * replacement when combining two {@link PartialTheme} objects.
839
- */
840
- export declare const NESTED_THEME_KEYS: readonly ["anchors", "angles", "contexts", "dataPalette", "dataRamps", "intents", "roles", "chroma", "lightness", "tones", "semanticHues", "semanticMappings", "variantChroma"];
841
- /**
842
- * Deep-merge two {@link PartialTheme} objects.
843
- *
844
- * Top-level primitive fields are replaced by the override when the
845
- * override value is not `undefined`. Override keys that are
846
- * explicitly `undefined` are skipped so they don't erase
847
- * previously-layered values.
848
- *
849
- * Nested-object fields listed in {@link NESTED_THEME_KEYS} are
850
- * merged key-by-key (also skipping `undefined` inner values) so
851
- * that the override adds to (rather than replaces) the base.
852
- *
853
- * This differs from {@link mergeTheme}, which merges a
854
- * {@link PartialTheme} over a fully-resolved {@link EspalierTheme}.
855
- * `mergePartials` keeps the result partial — useful when layering
856
- * multiple partial overrides before resolving against defaults.
857
- *
858
- * @param base The base partial theme.
859
- * @param override Partial overrides to apply on top.
860
- * @returns A new {@link PartialTheme} with merged values.
861
- */
862
- export declare function mergePartials(base: PartialTheme, override: PartialTheme): PartialTheme;
863
- /**
864
- * Layer multiple encoded theme strings into a single encoded result.
865
- *
866
- * Each argument is a Base64-encoded JSON {@link PartialTheme} (as
867
- * produced by {@link encodeTheme}). They are parsed, merged left
868
- * to right via {@link mergePartials}, and re-encoded.
869
- *
870
- * Entries that are `null`, `undefined`, empty strings, or strings
871
- * that fail to decode/parse are silently skipped, making it safe
872
- * to pass optional or potentially-invalid theme overrides without
873
- * conditional logic.
874
- *
875
- * @param encodedThemes Variadic encoded theme strings.
876
- * @returns A single Base64-encoded merged theme.
877
- */
878
- export declare function layerThemes(...encodedThemes: Array<string | undefined | null>): string;
879
- /**
880
- * Build the Taproot **light** default theme as an encoded string.
881
- *
882
- * @param backgroundImageUrl URL of the page background image
883
- * (e.g. a manifest-hashed asset path or a static path).
884
- * Wrapped in `url("…")` automatically — the URL is escaped
885
- * so special characters cannot break the CSS context.
886
- * @returns A Base64-encoded {@link PartialTheme}.
887
- */
888
- export declare function buildTaprootLightTheme(backgroundImageUrl: string): string;
889
- /**
890
- * Build the Taproot **dark** default theme as an encoded string.
891
- *
892
- * @param backgroundImageUrl URL of the page background image
893
- * (e.g. a manifest-hashed asset path or a static path).
894
- * Wrapped in `url("…")` automatically — the URL is escaped
895
- * so special characters cannot break the CSS context.
896
- * @returns A Base64-encoded {@link PartialTheme}.
897
- */
898
- export declare function buildTaprootDarkTheme(backgroundImageUrl: string): string;
899
- export {};
1
+ /** Public compatibility entry for the theme data model, codec and validation. */
2
+ export { ANCHOR_SLUG_PATTERN, COLOR_SOURCES, DEFAULT_BODY_FONT_FAMILY, DEFAULT_DARK_LIGHTNESS, DEFAULT_DARK_THEME, DEFAULT_LIGHT_LIGHTNESS, DEFAULT_LIGHT_THEME, DEFAULT_MONOSPACE_FONT_FAMILY, DEFAULT_SEMANTIC_MAPPINGS, LIGHTNESS_KEYS, NESTED_THEME_KEYS, ROLE_DERIVED_INK, ROLE_DERIVED_SURFACE, ROLE_NAMES, ROLE_PAIRED_INK, ROLE_TOKEN_PLAN, SEMANTIC_COLOR_NAMES, STATUS_COLOR_SOURCES, TOKEN_PAIRINGS, VARIANT_COLOR_SOURCES, buildTaprootDarkTheme, buildTaprootLightTheme, compileRoles, encodeTheme, explicitMappingTokens, isLightnessKey, isObjectRecord, isSemanticColorName, layerThemes, mergePartials, mergeTheme, parseAnchorSource, parseTheme, resolveAnchorColor, resolveContextTheme, resolveDataColorSource, resolveLightnessReference, roleInkProvenance, semanticToCSS, toneReferenceName, } from "./theme-core.js";
3
+ export type { AnchorReference, ChromaRange, ColorSource, ComponentProperties, ComponentPropertyValue, EspalierTheme, LightnessKey, LightnessMap, LightnessReference, MappingSource, PartialTheme, PartialThemeAnchor, PartialThemeAnchors, PartialThemeContexts, PartialThemeTones, RoleBinding, RoleName, RoleSlotName, SemanticColorName, SemanticMapping, SemanticMappings, StatusColorSource, ThemeAnchor, ThemeAnchorSlots, ThemeAnchors, ThemeContext, ThemeContexts, ThemeIntents, ThemeRoles, ThemeTones, ToneReference, VariantColorSource, } from "./theme-core.js";
4
+ export { validateComponentProperties, validateTheme, validateThemePair, type ComponentPropertyFinding, type ThemeValidationResult, } from "./theme-validation.js";
5
+ export { isTallHeaderPaint } from "../header/is-tall-header-paint.js";
6
+ export { AA_LARGE_RATIO, AA_NON_TEXT_RATIO, AA_TEXT_RATIO, wcagRatio } from "./wcag-contrast.js";