@dloizides/design-tokens 1.18.0 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,357 +1,365 @@
1
- # Changelog
2
-
3
- ## 1.18.0
4
-
5
- - Dark error text for every preset that lacked one (FLIER-2 "Flier Studio follow-ups" AC-35): `dark.dangerText` on flier `#e8826f` (5.47:1 on `#2c2824`), aml `#f08a85`, erevna and katalogos `#f4978e`, digitalkin `#F2B8B5`; each reaches 4.5:1 on every dark surface (new fleet test). `DEFAULT_CSS_VAR_NAMES` maps `darkDangerText` to `--error`, so the dark block overrides the light-tuned `--error`. `semantic.error` is unchanged.
6
-
7
- ## 1.16.0
8
-
9
- - New `FLIER_TOKENS` preset (FLIER-1 "Flier Studio" D7 "App palette: P-A Ink"): light Ink palette, Night dark palette with `brandFill`/`onBrandFill`, a `focusRing` per mode (8.95:1 light, 10.81:1 dark), borders clearing 3:1, text and secondary text at AA on every surface. Registered in `PRESETS` as `flier`; its dark `semantic.error` joins the known unsplit-error gaps (2.24:1).
10
-
11
- ## 1.14.0
12
-
13
- - One fleet focus ring (FOCUS-RING-1 "One focus ring across the shared kit"): `FOCUS_RING` (2 px solid, 2 px offset), `resolveFocusRingColor` (the mode's `focusRing` token, else the first of primary / a lighter brand step / text reaching 3:1 on the ground), `focusRingOutline` and `isFocusVisible` (keyboard focus only). Consumed by ui-buttons, ui-forms and ui-payments.
14
-
15
- ## 1.13.1
16
-
17
- - `prepublishOnly` now runs `jest --coverage`, so the 100% coverage threshold blocks a publish (DT-COV-1 "design-tokens coverage threshold failing"). `contrast.ts` shorthand-hex expansion rewritten without unreachable fallbacks; output unchanged.
18
-
19
- ## 1.13.0
20
-
21
- - New overlay stacking scale `Z_INDEX` (`base` 0 < `sticky` 2 < `raised` 30 < `drawer` 50 < `palette` 60 < `dropdown` 1000 < `modal` 9999 < `popover` 10000 < `toast` 10100 < `blocking` 100000), plus `Z_INDEX_ORDER`, `RN_WEB_MODAL_Z_INDEX` and type `ZIndexLayer`. `modal` is react-native-web's fixed Modal layer; body-portalled menus use `popover` so they paint above an open Modal (UI-ZINDEX-SCALE-1 "Shared overlay z-index scale").
22
-
23
- ## 1.12.0
24
-
25
- - New `INTERVIEWPREP_TOKENS` preset + `INTERVIEWPREP_CSS_VAR_NAMES`, seeded from InterviewPrep theme.css (REDESIGN-IP-1 Q-TOKENS "New interviewprep preset").
26
- - `toCssVars` `lightSelector` option: dark-first output (dark in `:root`, light in the given selector). Light-first output is byte-identical.
27
- - `CssVarNames` gains per-mode names for the optional `ModeColors` fields (textTertiary, focusRing, brandFill, onBrandFill, successText, dangerText, dangerFill).
28
-
29
- ## 1.11.0
30
-
31
- **Optional mode extras, increased-contrast overrides, motion springs, and the D1 "Living Room" `nextgame` preset.**
32
-
33
- Additive types: no existing field changes and no emitter reads the new ones, so other presets
34
- and consumers are byte-identical.
35
-
36
- - `ModeColors` gains optional `textTertiary`, `focusRing`, `brandFill`, `onBrandFill`,
37
- `successText`, `dangerText`, `dangerFill`.
38
- - `DesignTokens.contrastMore?: ContrastMoreOverrides` — per-mode `Partial<ModeColors>` plus
39
- `focusRingWidth`, applied under `prefers-contrast: more`.
40
- - `Motion.springs?: MotionSprings` (`focus` / `settle` / `press`, each `{ stiffness, damping }`).
41
- `DEFAULT_MOTION` is unchanged.
42
- - New exported types: `MotionSpring`, `MotionSprings`, `ContrastMoreOverrides`.
43
- - `NEXTGAME_TOKENS` rebuilt for the dark console dashboard (sole consumer: nextgame-web):
44
- graphite dark grounds (`#0A0D12` / `#121720` / `#1A212C`), amber `#FFD37A` brand fill with
45
- `#1A1204` ink, white focus ring, dark-tuned success and danger text, contrast-more tiers,
46
- Barlow type, spec §6 durations (160/240/320ms) and easings, springs. The light-surface
47
- amber/teal/magenta triad is kept for OG images and email. `monoFamily` is dropped and
48
- `headingScale` is now 1.
49
-
50
- ## 1.10.0
51
-
52
- **New `nextgame` preset — the NextGame game-recommendation app.**
53
-
54
- Additive. No existing preset, emitter or exported type changes.
55
-
56
- - `NEXTGAME_TOKENS` + the `nextgame` slug in `PRESETS`.
57
- - Signal amber `#FF8C1A` / deep teal `#0E7C86` / arcade magenta `#F5008B` on warm grounds.
58
- The app renders PlayStation, Xbox and Nintendo cards side by side, so blue, green and red
59
- are all unavailable as a brand primary: a platform badge must never read as chrome. No hue
60
- in the triad sits within 60 degrees of a console brand colour.
61
- - Both borders are authored to clear WCAG 1.4.11 (3:1) in both modes rather than inheriting
62
- the older presets' registered gaps. It registers only the usual dark-mode
63
- `semantic.error` gap (2.77:1) — one hex cannot serve error-as-text in both modes.
64
-
65
- ## 1.7.0
66
-
67
- **New `Motion` token group (durations + easings) — additive, optional, non-breaking.**
68
-
69
- Adds the first motion tokens to the package. The kit was almost entirely static and every
70
- animating component (ui-feedback ToastHost/PageSkeleton, ui-layout Accordion) re-declared its own
71
- durations/curves inline. This introduces a single shared source that `@dloizides/ui-motion` reads
72
- to build its RN `Easing.bezier(...)` map, and that web/CSS consumers can read directly.
73
-
74
- Fully back-compat: `motion` is OPTIONAL on `DesignTokens`, no preset declares it, and no emitter
75
- reads it — existing consumers are byte-identical.
76
-
77
- ### New
78
-
79
- - `DEFAULT_MOTION` constant — the app-agnostic motion scale (motion is uniform across portals, so
80
- there is ONE default rather than one per preset):
81
- - `durations` (ms, numbers): `instant 0`, `fast 140`, `base 200`, `slow 300`. `instant` (0) is
82
- the reduced-motion collapse target.
83
- - `easings` (Material-like), each carrying BOTH a web `css` `cubic-bezier(...)` string AND the
84
- `bezier` `[x1,y1,x2,y2]` control points for RN `Easing.bezier(...)`, so web and native animate
85
- on the same curve: `standard [0.2,0,0,1]`, `decelerate [0,0,0,1]`, `accelerate [0.3,0,1,1]`.
86
- - Types: `Motion`, `MotionDurations`, `MotionEasing`, `MotionEasings`.
87
- - `DesignTokens.motion?` — optional field so a preset MAY override the default motion scale.
88
-
89
- ## 1.6.0
90
-
91
- **FINREG rebrand to the OFFICIAL brand palette + navy surface tokens — additive/retune, non-breaking to other apps.**
92
-
93
- The owner supplied FINREG's official, single-source-of-truth logo palette. The interim EDA hexes
94
- were slightly off it, so the three `FINREG_MODULE_COLORS.base` values are re-tuned to the official
95
- cyan/magenta/violet and each `onWhite` companion is RECOMPUTED (same derivation, same
96
- `contrast.ts` maths). Only FINREG-scoped tokens change; every per-app preset, emitter and type is
97
- byte-identical, so aml/erevna/katalogos/digitalkin consumers are untouched.
98
-
99
- ### Changed
100
-
101
- - `FINREG_MODULE_COLORS` re-tuned to the official palette:
102
- - Payments (cyan): `base #52E2F2` (1.55:1 on white, fill only) / `onWhite #0B8290` (4.56:1).
103
- - Accounting (magenta): `base #F266CD` (2.78:1) / `onWhite #DA12A5` (4.55:1).
104
- - CRM (violet): `base #7997F2` (2.79:1) / `onWhite #426CED` (4.57:1).
105
- - `onWhite` = lightest shade of the same hue that clears the 4.5:1 AA text floor on white,
106
- carried a hair past so rounding cannot drop it under. Both halves re-pinned in
107
- `finregModules.test.ts`.
108
-
109
- ### New
110
-
111
- - `FINREG_SURFACE_COLORS` — the official navy dark grounds: `surface #0C2240` (hero band / dark
112
- sections / logo field top) and `deepest #071526` (footer/closing band / darkest body ink / logo
113
- field bottom). Exported so consumers stop hardcoding the dark-band literals. Payments cyan reads
114
- as an AA-safe accent on both (10.25:1 / 11.81:1), pinned in the test.
115
- - `FinregSurfaceColors` type.
116
-
117
- ## 1.5.0
118
-
119
- **FINREG per-module brand colours (task R-01) — additive, non-breaking.**
120
-
121
- FINREG's interim EDA logo binds a colour to each of its three product modules, so colour is module
122
- identity, not one app's brand primary. Adds `FINREG_MODULE_COLORS` beside the per-app presets. No
123
- existing token, preset, emitter or type is touched, so every current consumer is byte-identical.
124
-
125
- ### New
126
-
127
- - `FINREG_MODULE_COLORS` — the three decided EDA module colours, each with an AA-safe on-white
128
- companion:
129
- - Payments (cyan): `base #4FD8F0` (1.69:1 on white, fill only) / `onWhite #0C7D91` (4.82:1).
130
- - Accounting (magenta): `base #E85FBF` (3.08:1) / `onWhite #D11E9B` (4.81:1).
131
- - CRM (violet): `base #7B8FF7` (2.95:1) / `onWhite #4763F4` (4.82:1).
132
- - `FinregModuleColor`, `FinregModuleColors` types.
133
-
134
- The `base` hexes are transcribed verbatim from the logo decision — this package did not choose
135
- them. The `onWhite` companions were DERIVED with the `contrast.ts` WCAG maths (lightest shade of
136
- the same hue that clears the 4.5:1 AA text floor on white, carried a little past the floor), and
137
- both halves are pinned by `finregModules.test.ts` so a drift below AA fails the build. This is the
138
- SOURCE of the hexes; a later rebrand wave adopts the token into the apps, which read it rather than
139
- re-declaring the literal (`no-raw-color-literal`).
140
-
141
- ## 1.4.0
142
-
143
- **The on-brand foreground is now DERIVED, not defaulted to white.**
144
-
145
- This package already shipped the WCAG maths (`contrast.ts`) and an optional `onBrand`
146
- slot — and a live AA failure shipped anyway: **white on `#38bdf8` at 2.14:1** on a
147
- production primary button. The slot was optional *with a white default*, so the safe
148
- path required opting in and the default was the failing one. An optional safety feature
149
- with an unsafe default is not a safety feature; it is a trap that reads as protection in
150
- review. The same pair was then hand-patched five separate times across the codebase, one
151
- of them inside a verification EMAIL where CSS cannot be patched after sending.
152
-
153
- ### New
154
-
155
- - `resolveOnBrand(background, explicit?)` — returns the higher-contrast of a light ink
156
- (`#ffffff`) and a dark ink (`#03121f`) for the given brand colour. An explicit value is
157
- honoured as given; a non-hex background (no fixed luminance) falls back to light ink as
158
- a documented last resort rather than as the unexamined default for everything.
159
- - `onBrandRatio(background, explicit?)` — the measured ratio, or `null` when unmeasurable.
160
- Returns the NUMBER, so a consumer can assert the pair instead of assuming it.
161
- - `canCarryAccessibleInk(background)` — false for a mid-luminance fill that fails against
162
- BOTH inks. Distinguishes "we picked the wrong ink" from "no ink works" — different bugs
163
- with different owners.
164
- - `ON_BRAND_LIGHT_INK`, `ON_BRAND_DARK_INK`.
165
-
166
- Exported from the package root so a consumer that accepts a brand colour at RUNTIME (a
167
- per-tenant branding endpoint) derives its foreground with the same maths that guards the
168
- shipped presets. The runtime path is how an AA failure re-enters a codebase whose static
169
- presets all pass.
170
-
171
- ### Changed (behaviour)
172
-
173
- All three emitters now derive the on-brand ink instead of skipping or whitening it:
174
-
175
- - `toUiTheme` — `palette.onBrand` was `tokens.onBrand ?? '#ffffff'`, now
176
- `resolveOnBrand(tokens.primary, tokens.onBrand)`.
177
- - `toCssVars` — `--on-brand` was emitted only when the preset declared `onBrand`. It is
178
- now always emitted (when the name map asks for it): a MISSING custom property sends the
179
- stylesheet to its own hardcoded fallback, which is how white-on-pale-brand shipped.
180
- - `toTailwindPreset` — `colors['on-brand']` is likewise always emitted, and its type
181
- changed from `string | undefined` to `string`.
182
-
183
- **No shipped preset's emitted value changes.** All four presets have a `primary` that
184
- white genuinely wins on (aml `#4f46e5` 6.29:1, erevna/katalogos `#005f73` 7.28:1,
185
- digitalkin `#007E4A` 5.14:1 explicit), so the derivation returns exactly what they emitted
186
- before. The change is visible only to a consumer with a PALE brand — which is the defect.
187
-
188
- `onBrand` remains OPTIONAL. Making it required would be a compile break for every consumer
189
- on a published, adopted interface, and it would push the decision back onto exactly the
190
- caller who already got it wrong five times. Derivation fixes the DEFAULT, which is where
191
- the defect actually lives.
192
-
193
- ### Guards
194
-
195
- - `presets.contrast.test.ts` now asserts every preset's `primary`/derived-ink pair clears
196
- 4.5:1, MEASURES any explicit `onBrand` rather than trusting it, and records on the
197
- record which brand fills can carry no accessible ink at all.
198
- - `toCssVars` / `toTailwindPreset` had **zero** `onBrand` coverage — they emitted it
199
- blind. Both now assert the derived value, including the pale-brand case.
200
- - 144 tests (was 140 + 4 new files/cases; `onBrand.test.ts` pins every ratio as a measured
201
- number so a change to the derivation cannot quietly re-tune what "accessible" means).
202
-
203
- ### Known finding (not fixed here)
204
-
205
- `accent: #008d5c` (erevna, katalogos) peaks at **4.47:1** against its best ink and can
206
- carry NO AA foreground. Nothing in the fleet paints text on an accent fill today — it is
207
- read as a text *colour*, never a text-bearing fill — so this is recorded and asserted as a
208
- known state rather than silently fixed by redesigning two live portals' brand green. It
209
- becomes a real failure the moment anything paints text on that fill.
210
-
211
- All notable changes to `@dloizides/design-tokens` are documented here.
212
-
213
- ## [1.3.0]
214
-
215
- ### Added
216
-
217
- - **`DIGITALKIN_TOKENS`** — the Digital Kin brand preset (green `#007E4A`, yellow `#FFAB00`,
218
- Geologica as the sole text family). Registered in `PRESETS` under `digitalkin` and
219
- re-exported from the package root.
220
-
221
- Purely additive: the other 20 exports are byte-identical to 1.2.0, and all four emitters
222
- produce identical output for `aml` / `erevna` / `katalogos`. `PRESETS` gains one key and
223
- loses none. Verified by diffing this build against the published 1.2.0 tarball.
224
-
225
- ### Notes
226
-
227
- - The Digital Kin accent (`#FFAB00`) is a HIGHLIGHT colour: white on it measures **1.90:1**,
228
- so it carries stars, focus rings and ornaments with dark ink on top (**9.81:1**) — never a
229
- white-on-yellow button. Both halves are asserted by `digitalkin.test.ts`.
230
- - DynaPuff is deliberately absent from the token set. It has **no Greek glyphs**, and browser
231
- font fallback is per-glyph, so a mixed Greek/Latin heading would render in two typefaces at
232
- once. It lives only inside the wordmark SVG as vector paths.
233
- - Unlike the other three presets, `digitalkin`'s **borders meet WCAG 1.4.11** (3.34:1 light,
234
- 3.40:1 dark) rather than inheriting the registered `*.border` gaps. Those gaps are frozen
235
- current values of live portals; this preset ships before it has pixels to regress, so it
236
- takes the compliant value.
237
- - One registered gap: **`digitalkin.dark.semantic.error`** (2.28:1). `semantic.error` is a
238
- single token rendered as text in both modes, and AA on white caps its luminance at 0.183
239
- while AA on the raised dark surface demands ≥0.267 — mutually exclusive. Fixing it needs a
240
- mode-aware split of `SemanticColors` affecting all four presets, not a colour nudge.
241
-
242
- ## [1.2.0]
243
-
244
- ### Added
245
-
246
- `DesignTokens` was a **lossy carrier**. Two RN-web apps (ichnos, kefi) discovered this
247
- independently and wrote the *same* private workaround: the shape had no slot for the muted
248
- inset surface, the on-brand foreground, or the three status background tints, so each app
249
- smuggled those five values into free slots of the broadcast theme via a hand-rolled overlay.
250
- Two independent uses of one workaround is the trigger to extract it. These are now
251
- first-class slots, and the overlay is a shipped emitter.
252
-
253
- - **`ModeColors.surfaceMuted?`** — the subtle inset surface (table header rows, chips, wells).
254
- Distinct from `surface` (cards) and `surfaceElevated` (modals): it recedes rather than lifts.
255
- - **`DesignTokens.onBrand?`** — the foreground for content sitting ON a `primary`-filled
256
- surface. It is a *contrast partner* of `primary`, not a mode colour, so it lives beside it.
257
- - **`SemanticColors.successBg?` / `warningBg?` / `errorBg?` / `infoBg?`** — the soft fill a
258
- status badge, banner or row-highlight paints behind text of the base colour. A tint is NOT
259
- derivable from its base (it is hand-picked for contrast), so it needs its own slot; without
260
- one a status surface could not be themed at all.
261
- - **`toUiTheme(tokens, mode?)`** — a fourth emitter: the shared RN UI kit's `UiTheme` (what
262
- `@dloizides/ui-feedback`'s `UiProvider` broadcasts). It is **lossless** — every token the
263
- shape can express lands in an addressable slot (`palette.onBrand`, `palette.surfaceMuted`,
264
- each status tint at the `100` step), so an app can round-trip its entire palette back out
265
- of the live provider instead of keeping a parallel static copy that can never follow a
266
- dark-mode toggle or a per-tenant brand. The theme type is declared **structurally** here,
267
- exactly as `RnThemeConfig` declares the `TenantThemeConfig` shape, so the package keeps its
268
- zero-dependency / zero-peer guarantee and takes no dependency on the kit it feeds.
269
- - **`UI_TINT_STEP` / `UI_MAIN_STEP` / `UI_DEEP_STEP`** — the step names, exported so a consumer
270
- addresses a scale by name rather than by a magic `'500'`.
271
- - CSS-variable names (`--on-brand`, `--surface-muted`, `--success-bg`, …) and Tailwind colour
272
- keys (`on-brand`, `surface-muted`, `success-bg`, …) for the new tokens.
273
-
274
- ### Fixed
275
-
276
- - **Scale collapse.** The naive `value => ({ '100': v, '500': v, '700': v })` projection that
277
- both apps used writes ONE value into every step, silently discarding the deeper brand step
278
- and every status tint — a theme built that way cannot reproduce the palette it came from.
279
- `toUiTheme` emits `secondary` as its own scale and each status tint at the `100` step, so
280
- the values survive. The package's own emitters (`toCssVars`, `toRnTheme`,
281
- `toTailwindPreset`) were checked and carry no equivalent collapse.
282
-
283
- ### Compatibility
284
-
285
- Entirely additive. Every new token is optional and every new emitted key appears **only** when
286
- a preset declares the token, so `AML_TOKENS`, `EREVNA_TOKENS` and `KATALOGOS_TOKENS` emit
287
- byte-identical CSS, RN-theme and Tailwind output — verified by the pre-existing emitter test
288
- suites passing unmodified.
289
-
290
- ## [1.1.0]
291
-
292
- ### Fixed
293
-
294
- - **WCAG AA contrast (UX-11)**: `light.textSecondary` in `EREVNA_TOKENS` and `KATALOGOS_TOKENS`
295
- was `#777777`, which measures **4.48:1 on `#ffffff` and 4.18:1 on the `#f7f7f7` card surface** —
296
- both under the AA 4.5:1 floor for normal text, and form-field labels render in this colour.
297
- Now `#717171` (**4.88:1** and **4.56:1** against those same two surfaces, verified against each
298
- preset's ACTUAL surfaces rather than assumed from another package's).
299
- `AML_TOKENS` was already compliant (`#4a5567`, worst case 6.97:1) and is unchanged.
300
-
301
- This is the same defect `@dloizides/theme-web@1.2.0` fixed in its `DEFAULT_THEME_CONFIG`, but
302
- that fix does NOT reach these presets — apps resolving colours through a preset bypass
303
- theme-web's defaults entirely. The bad value survived here independently.
304
-
305
- ### Added
306
-
307
- - **`src/contrast.ts`** — a correct WCAG 2.1 contrast implementation (sRGB gamma linearization +
308
- ITU-R BT.709 weighting; NOT a naive channel average, which mis-scores exactly the mid-greys that
309
- matter). Deliberately a COPY of theme-web's, not an import: this package ships **zero
310
- dependencies and zero peers** by design, and depending on a React theming package for pure
311
- arithmetic would invert the layering (theme-web already depends on this package).
312
- Exported (`contrastRatio`, `relativeLuminance`, `meetsContrast`, `isHexColor`, and the
313
- `AA_*_RATIO` thresholds) so consumers that let users override tokens at runtime can validate
314
- those overrides with the same maths that guards the shipped presets.
315
- - **`src/contrast.test.ts`** — pins the calculator against external reference pairs
316
- (`#767676`/white = 4.54:1, `#777777`/white = 4.48:1, black/white = 21:1, and `#808080`'s true
317
- luminance of 0.2159 vs a channel-average's 0.502) so the guard cannot silently be wrong.
318
- - **`src/presets/presets.contrast.test.ts`** — a permanent guard measuring every text-role colour
319
- in EVERY preset against every surface it renders on, in BOTH modes. Failures must be registered
320
- in `KNOWN_GAPS` with their exact measured ratio, and the registry is asserted to be exactly
321
- accurate — so a gap cannot be added silently, a stale entry fails once the colour is fixed, and
322
- a newly failing colour nobody registered fails the suite outright. Non-hex token values (AML's
323
- `rgba()` dark border, which has no fixed luminance) are excluded by an asserted explicit list
324
- rather than silently skipped.
325
-
326
- ### Notes
327
-
328
- - Only TEXT and essential-boundary roles are asserted. Decorative fills (`primary`/`secondary`/
329
- `accent`, and the `success`/`warning`/`info` semantic bases) carry no contrast requirement;
330
- asserting them would turn a compliance guard into a brand redesign.
331
- - 8 pre-existing gaps are registered, all one root cause: a single token serving both a text role
332
- and a fill/decorative role across both modes (`border`/`divider`, `semantic.error`). These need
333
- the roles split before any value can move — a design change, not a colour nudge. They mirror the
334
- gaps already registered in `@dloizides/theme-web`.
335
-
336
- ## [1.0.0]
337
-
338
- ### Added
339
-
340
- - Initial release (task #78) — the cross-stack design-token source.
341
- - **Token shape** (`DesignTokens`) whose core fields mirror `@dloizides/tenant-theme-web`'s
342
- `TenantThemeConfig` (`primary`/`secondary`/`accent`/`semantic`/`light`/`dark`/`typography`/
343
- `branding`), plus optional `radii`/`shadows`/`extensions` supersets for richer stacks.
344
- - **Three emitters from one source**: `toCssVars` (CSS custom properties for vanilla-JS),
345
- `toRnTheme` (a `TenantThemeConfig`-compatible object for RN-web), `toTailwindPreset` (a Tailwind
346
- preset for the DOM-React ThemeStudio).
347
- - **Per-app presets** seeded byte-for-byte from current values: `EREVNA_TOKENS`,
348
- `KATALOGOS_TOKENS` (from each RN app's `default` theme preset), and `AML_TOKENS` (from the AML
349
- console's `wwwroot/shared/ui.css` `:root`). Plus the `PRESETS` map.
350
- - **The cross-stack naming contract (#78b)**: `DEFAULT_CSS_VAR_NAMES` (canonical kebab names) and
351
- `AML_CSS_VAR_NAMES` (the AML console's existing `ui.css` variable names), documented in the
352
- README with the full name-mapping table and the open naming decisions.
353
- - Behaviour-preserving by design: runtime tests assert `toRnTheme(EREVNA_TOKENS)` deep-equals the
354
- app's current `DEFAULT_THEME_CONFIG` and `toCssVars(AML_TOKENS, AML_CSS_VAR_NAMES)` reproduces
355
- `ui.css`'s `:root` verbatim. Zero visual change on adoption.
356
- - Values only — no components (those live in `@dloizides/ui-layout`/`ui-forms`/`ui-feedback`/
357
- `ui-icons`/`ui-tables`). Zero runtime dependencies.
1
+ # Changelog
2
+
3
+ ## 1.20.0
4
+
5
+ - New `MOONCUBE_TOKENS` preset (MOONCUBE-SITE-1 "Moon Cube Technologies site: read and book"): paper `#FFFFFF` / cream `#F4EFE1` light roles, navy field `#0F1B2D` / raised `#18263B` / emph `#22324A` dark roles, bronze `#8A6012` primary, gold `#E8C36A` dark brand fill. `MOONCUBE_CSS_VAR_NAMES` gives light and dark roles distinct `--mc-*` names so paper and field bands share one page; `MOONCUBE_CSS_VARS` is the emitted `:root` CSS. Hairlines `#C3CCD8` / `#3A4A62` sit in `divider`; `border` uses `#4A5B73` / `#8C9AAE` to clear 3:1. Registered in `PRESETS` as `mooncube`; its dark `semantic.error` joins the known unsplit-error gaps (2.33:1).
6
+
7
+ ## 1.19.0
8
+
9
+ - New `JINX_TOKENS` preset (BEAD-1 "Bead pattern app: requirements gathering", palette B ColorChecker, round 3): light page `#FFFFFF`, plate `#C8C8C8` in `surfaceMuted`; dark page `#343434`, plate `#5A5A5A`. Registered in `PRESETS` as `jinx`. The palette defines no status or accent roles: `semantic` and `dark.dangerText` reuse existing fleet values and `accent` is the quiet-text grey `#555555`; its dark `semantic.error` joins the known unsplit-error gaps (1.91:1).
10
+
11
+ ## 1.18.0
12
+
13
+ - Dark error text for every preset that lacked one (FLIER-2 "Flier Studio follow-ups" AC-35): `dark.dangerText` on flier `#e8826f` (5.47:1 on `#2c2824`), aml `#f08a85`, erevna and katalogos `#f4978e`, digitalkin `#F2B8B5`; each reaches 4.5:1 on every dark surface (new fleet test). `DEFAULT_CSS_VAR_NAMES` maps `darkDangerText` to `--error`, so the dark block overrides the light-tuned `--error`. `semantic.error` is unchanged.
14
+
15
+ ## 1.16.0
16
+
17
+ - New `FLIER_TOKENS` preset (FLIER-1 "Flier Studio" D7 "App palette: P-A Ink"): light Ink palette, Night dark palette with `brandFill`/`onBrandFill`, a `focusRing` per mode (8.95:1 light, 10.81:1 dark), borders clearing 3:1, text and secondary text at AA on every surface. Registered in `PRESETS` as `flier`; its dark `semantic.error` joins the known unsplit-error gaps (2.24:1).
18
+
19
+ ## 1.14.0
20
+
21
+ - One fleet focus ring (FOCUS-RING-1 "One focus ring across the shared kit"): `FOCUS_RING` (2 px solid, 2 px offset), `resolveFocusRingColor` (the mode's `focusRing` token, else the first of primary / a lighter brand step / text reaching 3:1 on the ground), `focusRingOutline` and `isFocusVisible` (keyboard focus only). Consumed by ui-buttons, ui-forms and ui-payments.
22
+
23
+ ## 1.13.1
24
+
25
+ - `prepublishOnly` now runs `jest --coverage`, so the 100% coverage threshold blocks a publish (DT-COV-1 "design-tokens coverage threshold failing"). `contrast.ts` shorthand-hex expansion rewritten without unreachable fallbacks; output unchanged.
26
+
27
+ ## 1.13.0
28
+
29
+ - New overlay stacking scale `Z_INDEX` (`base` 0 < `sticky` 2 < `raised` 30 < `drawer` 50 < `palette` 60 < `dropdown` 1000 < `modal` 9999 < `popover` 10000 < `toast` 10100 < `blocking` 100000), plus `Z_INDEX_ORDER`, `RN_WEB_MODAL_Z_INDEX` and type `ZIndexLayer`. `modal` is react-native-web's fixed Modal layer; body-portalled menus use `popover` so they paint above an open Modal (UI-ZINDEX-SCALE-1 "Shared overlay z-index scale").
30
+
31
+ ## 1.12.0
32
+
33
+ - New `INTERVIEWPREP_TOKENS` preset + `INTERVIEWPREP_CSS_VAR_NAMES`, seeded from InterviewPrep theme.css (REDESIGN-IP-1 Q-TOKENS "New interviewprep preset").
34
+ - `toCssVars` `lightSelector` option: dark-first output (dark in `:root`, light in the given selector). Light-first output is byte-identical.
35
+ - `CssVarNames` gains per-mode names for the optional `ModeColors` fields (textTertiary, focusRing, brandFill, onBrandFill, successText, dangerText, dangerFill).
36
+
37
+ ## 1.11.0
38
+
39
+ **Optional mode extras, increased-contrast overrides, motion springs, and the D1 "Living Room" `nextgame` preset.**
40
+
41
+ Additive types: no existing field changes and no emitter reads the new ones, so other presets
42
+ and consumers are byte-identical.
43
+
44
+ - `ModeColors` gains optional `textTertiary`, `focusRing`, `brandFill`, `onBrandFill`,
45
+ `successText`, `dangerText`, `dangerFill`.
46
+ - `DesignTokens.contrastMore?: ContrastMoreOverrides` — per-mode `Partial<ModeColors>` plus
47
+ `focusRingWidth`, applied under `prefers-contrast: more`.
48
+ - `Motion.springs?: MotionSprings` (`focus` / `settle` / `press`, each `{ stiffness, damping }`).
49
+ `DEFAULT_MOTION` is unchanged.
50
+ - New exported types: `MotionSpring`, `MotionSprings`, `ContrastMoreOverrides`.
51
+ - `NEXTGAME_TOKENS` rebuilt for the dark console dashboard (sole consumer: nextgame-web):
52
+ graphite dark grounds (`#0A0D12` / `#121720` / `#1A212C`), amber `#FFD37A` brand fill with
53
+ `#1A1204` ink, white focus ring, dark-tuned success and danger text, contrast-more tiers,
54
+ Barlow type, spec §6 durations (160/240/320ms) and easings, springs. The light-surface
55
+ amber/teal/magenta triad is kept for OG images and email. `monoFamily` is dropped and
56
+ `headingScale` is now 1.
57
+
58
+ ## 1.10.0
59
+
60
+ **New `nextgame` preset — the NextGame game-recommendation app.**
61
+
62
+ Additive. No existing preset, emitter or exported type changes.
63
+
64
+ - `NEXTGAME_TOKENS` + the `nextgame` slug in `PRESETS`.
65
+ - Signal amber `#FF8C1A` / deep teal `#0E7C86` / arcade magenta `#F5008B` on warm grounds.
66
+ The app renders PlayStation, Xbox and Nintendo cards side by side, so blue, green and red
67
+ are all unavailable as a brand primary: a platform badge must never read as chrome. No hue
68
+ in the triad sits within 60 degrees of a console brand colour.
69
+ - Both borders are authored to clear WCAG 1.4.11 (3:1) in both modes rather than inheriting
70
+ the older presets' registered gaps. It registers only the usual dark-mode
71
+ `semantic.error` gap (2.77:1) — one hex cannot serve error-as-text in both modes.
72
+
73
+ ## 1.7.0
74
+
75
+ **New `Motion` token group (durations + easings) — additive, optional, non-breaking.**
76
+
77
+ Adds the first motion tokens to the package. The kit was almost entirely static and every
78
+ animating component (ui-feedback ToastHost/PageSkeleton, ui-layout Accordion) re-declared its own
79
+ durations/curves inline. This introduces a single shared source that `@dloizides/ui-motion` reads
80
+ to build its RN `Easing.bezier(...)` map, and that web/CSS consumers can read directly.
81
+
82
+ Fully back-compat: `motion` is OPTIONAL on `DesignTokens`, no preset declares it, and no emitter
83
+ reads it — existing consumers are byte-identical.
84
+
85
+ ### New
86
+
87
+ - `DEFAULT_MOTION` constant — the app-agnostic motion scale (motion is uniform across portals, so
88
+ there is ONE default rather than one per preset):
89
+ - `durations` (ms, numbers): `instant 0`, `fast 140`, `base 200`, `slow 300`. `instant` (0) is
90
+ the reduced-motion collapse target.
91
+ - `easings` (Material-like), each carrying BOTH a web `css` `cubic-bezier(...)` string AND the
92
+ `bezier` `[x1,y1,x2,y2]` control points for RN `Easing.bezier(...)`, so web and native animate
93
+ on the same curve: `standard [0.2,0,0,1]`, `decelerate [0,0,0,1]`, `accelerate [0.3,0,1,1]`.
94
+ - Types: `Motion`, `MotionDurations`, `MotionEasing`, `MotionEasings`.
95
+ - `DesignTokens.motion?` — optional field so a preset MAY override the default motion scale.
96
+
97
+ ## 1.6.0
98
+
99
+ **FINREG rebrand to the OFFICIAL brand palette + navy surface tokens — additive/retune, non-breaking to other apps.**
100
+
101
+ The owner supplied FINREG's official, single-source-of-truth logo palette. The interim EDA hexes
102
+ were slightly off it, so the three `FINREG_MODULE_COLORS.base` values are re-tuned to the official
103
+ cyan/magenta/violet and each `onWhite` companion is RECOMPUTED (same derivation, same
104
+ `contrast.ts` maths). Only FINREG-scoped tokens change; every per-app preset, emitter and type is
105
+ byte-identical, so aml/erevna/katalogos/digitalkin consumers are untouched.
106
+
107
+ ### Changed
108
+
109
+ - `FINREG_MODULE_COLORS` re-tuned to the official palette:
110
+ - Payments (cyan): `base #52E2F2` (1.55:1 on white, fill only) / `onWhite #0B8290` (4.56:1).
111
+ - Accounting (magenta): `base #F266CD` (2.78:1) / `onWhite #DA12A5` (4.55:1).
112
+ - CRM (violet): `base #7997F2` (2.79:1) / `onWhite #426CED` (4.57:1).
113
+ - `onWhite` = lightest shade of the same hue that clears the 4.5:1 AA text floor on white,
114
+ carried a hair past so rounding cannot drop it under. Both halves re-pinned in
115
+ `finregModules.test.ts`.
116
+
117
+ ### New
118
+
119
+ - `FINREG_SURFACE_COLORS` — the official navy dark grounds: `surface #0C2240` (hero band / dark
120
+ sections / logo field top) and `deepest #071526` (footer/closing band / darkest body ink / logo
121
+ field bottom). Exported so consumers stop hardcoding the dark-band literals. Payments cyan reads
122
+ as an AA-safe accent on both (10.25:1 / 11.81:1), pinned in the test.
123
+ - `FinregSurfaceColors` type.
124
+
125
+ ## 1.5.0
126
+
127
+ **FINREG per-module brand colours (task R-01) — additive, non-breaking.**
128
+
129
+ FINREG's interim EDA logo binds a colour to each of its three product modules, so colour is module
130
+ identity, not one app's brand primary. Adds `FINREG_MODULE_COLORS` beside the per-app presets. No
131
+ existing token, preset, emitter or type is touched, so every current consumer is byte-identical.
132
+
133
+ ### New
134
+
135
+ - `FINREG_MODULE_COLORS` — the three decided EDA module colours, each with an AA-safe on-white
136
+ companion:
137
+ - Payments (cyan): `base #4FD8F0` (1.69:1 on white, fill only) / `onWhite #0C7D91` (4.82:1).
138
+ - Accounting (magenta): `base #E85FBF` (3.08:1) / `onWhite #D11E9B` (4.81:1).
139
+ - CRM (violet): `base #7B8FF7` (2.95:1) / `onWhite #4763F4` (4.82:1).
140
+ - `FinregModuleColor`, `FinregModuleColors` types.
141
+
142
+ The `base` hexes are transcribed verbatim from the logo decision — this package did not choose
143
+ them. The `onWhite` companions were DERIVED with the `contrast.ts` WCAG maths (lightest shade of
144
+ the same hue that clears the 4.5:1 AA text floor on white, carried a little past the floor), and
145
+ both halves are pinned by `finregModules.test.ts` so a drift below AA fails the build. This is the
146
+ SOURCE of the hexes; a later rebrand wave adopts the token into the apps, which read it rather than
147
+ re-declaring the literal (`no-raw-color-literal`).
148
+
149
+ ## 1.4.0
150
+
151
+ **The on-brand foreground is now DERIVED, not defaulted to white.**
152
+
153
+ This package already shipped the WCAG maths (`contrast.ts`) and an optional `onBrand`
154
+ slot — and a live AA failure shipped anyway: **white on `#38bdf8` at 2.14:1** on a
155
+ production primary button. The slot was optional *with a white default*, so the safe
156
+ path required opting in and the default was the failing one. An optional safety feature
157
+ with an unsafe default is not a safety feature; it is a trap that reads as protection in
158
+ review. The same pair was then hand-patched five separate times across the codebase, one
159
+ of them inside a verification EMAIL where CSS cannot be patched after sending.
160
+
161
+ ### New
162
+
163
+ - `resolveOnBrand(background, explicit?)` — returns the higher-contrast of a light ink
164
+ (`#ffffff`) and a dark ink (`#03121f`) for the given brand colour. An explicit value is
165
+ honoured as given; a non-hex background (no fixed luminance) falls back to light ink as
166
+ a documented last resort rather than as the unexamined default for everything.
167
+ - `onBrandRatio(background, explicit?)` — the measured ratio, or `null` when unmeasurable.
168
+ Returns the NUMBER, so a consumer can assert the pair instead of assuming it.
169
+ - `canCarryAccessibleInk(background)` — false for a mid-luminance fill that fails against
170
+ BOTH inks. Distinguishes "we picked the wrong ink" from "no ink works" — different bugs
171
+ with different owners.
172
+ - `ON_BRAND_LIGHT_INK`, `ON_BRAND_DARK_INK`.
173
+
174
+ Exported from the package root so a consumer that accepts a brand colour at RUNTIME (a
175
+ per-tenant branding endpoint) derives its foreground with the same maths that guards the
176
+ shipped presets. The runtime path is how an AA failure re-enters a codebase whose static
177
+ presets all pass.
178
+
179
+ ### Changed (behaviour)
180
+
181
+ All three emitters now derive the on-brand ink instead of skipping or whitening it:
182
+
183
+ - `toUiTheme` — `palette.onBrand` was `tokens.onBrand ?? '#ffffff'`, now
184
+ `resolveOnBrand(tokens.primary, tokens.onBrand)`.
185
+ - `toCssVars` — `--on-brand` was emitted only when the preset declared `onBrand`. It is
186
+ now always emitted (when the name map asks for it): a MISSING custom property sends the
187
+ stylesheet to its own hardcoded fallback, which is how white-on-pale-brand shipped.
188
+ - `toTailwindPreset` — `colors['on-brand']` is likewise always emitted, and its type
189
+ changed from `string | undefined` to `string`.
190
+
191
+ **No shipped preset's emitted value changes.** All four presets have a `primary` that
192
+ white genuinely wins on (aml `#4f46e5` 6.29:1, erevna/katalogos `#005f73` 7.28:1,
193
+ digitalkin `#007E4A` 5.14:1 explicit), so the derivation returns exactly what they emitted
194
+ before. The change is visible only to a consumer with a PALE brand — which is the defect.
195
+
196
+ `onBrand` remains OPTIONAL. Making it required would be a compile break for every consumer
197
+ on a published, adopted interface, and it would push the decision back onto exactly the
198
+ caller who already got it wrong five times. Derivation fixes the DEFAULT, which is where
199
+ the defect actually lives.
200
+
201
+ ### Guards
202
+
203
+ - `presets.contrast.test.ts` now asserts every preset's `primary`/derived-ink pair clears
204
+ 4.5:1, MEASURES any explicit `onBrand` rather than trusting it, and records on the
205
+ record which brand fills can carry no accessible ink at all.
206
+ - `toCssVars` / `toTailwindPreset` had **zero** `onBrand` coverage — they emitted it
207
+ blind. Both now assert the derived value, including the pale-brand case.
208
+ - 144 tests (was 140 + 4 new files/cases; `onBrand.test.ts` pins every ratio as a measured
209
+ number so a change to the derivation cannot quietly re-tune what "accessible" means).
210
+
211
+ ### Known finding (not fixed here)
212
+
213
+ `accent: #008d5c` (erevna, katalogos) peaks at **4.47:1** against its best ink and can
214
+ carry NO AA foreground. Nothing in the fleet paints text on an accent fill today — it is
215
+ read as a text *colour*, never a text-bearing fill — so this is recorded and asserted as a
216
+ known state rather than silently fixed by redesigning two live portals' brand green. It
217
+ becomes a real failure the moment anything paints text on that fill.
218
+
219
+ All notable changes to `@dloizides/design-tokens` are documented here.
220
+
221
+ ## [1.3.0]
222
+
223
+ ### Added
224
+
225
+ - **`DIGITALKIN_TOKENS`** — the Digital Kin brand preset (green `#007E4A`, yellow `#FFAB00`,
226
+ Geologica as the sole text family). Registered in `PRESETS` under `digitalkin` and
227
+ re-exported from the package root.
228
+
229
+ Purely additive: the other 20 exports are byte-identical to 1.2.0, and all four emitters
230
+ produce identical output for `aml` / `erevna` / `katalogos`. `PRESETS` gains one key and
231
+ loses none. Verified by diffing this build against the published 1.2.0 tarball.
232
+
233
+ ### Notes
234
+
235
+ - The Digital Kin accent (`#FFAB00`) is a HIGHLIGHT colour: white on it measures **1.90:1**,
236
+ so it carries stars, focus rings and ornaments with dark ink on top (**9.81:1**) — never a
237
+ white-on-yellow button. Both halves are asserted by `digitalkin.test.ts`.
238
+ - DynaPuff is deliberately absent from the token set. It has **no Greek glyphs**, and browser
239
+ font fallback is per-glyph, so a mixed Greek/Latin heading would render in two typefaces at
240
+ once. It lives only inside the wordmark SVG as vector paths.
241
+ - Unlike the other three presets, `digitalkin`'s **borders meet WCAG 1.4.11** (3.34:1 light,
242
+ 3.40:1 dark) rather than inheriting the registered `*.border` gaps. Those gaps are frozen
243
+ current values of live portals; this preset ships before it has pixels to regress, so it
244
+ takes the compliant value.
245
+ - One registered gap: **`digitalkin.dark.semantic.error`** (2.28:1). `semantic.error` is a
246
+ single token rendered as text in both modes, and AA on white caps its luminance at 0.183
247
+ while AA on the raised dark surface demands ≥0.267 — mutually exclusive. Fixing it needs a
248
+ mode-aware split of `SemanticColors` affecting all four presets, not a colour nudge.
249
+
250
+ ## [1.2.0]
251
+
252
+ ### Added
253
+
254
+ `DesignTokens` was a **lossy carrier**. Two RN-web apps (ichnos, kefi) discovered this
255
+ independently and wrote the *same* private workaround: the shape had no slot for the muted
256
+ inset surface, the on-brand foreground, or the three status background tints, so each app
257
+ smuggled those five values into free slots of the broadcast theme via a hand-rolled overlay.
258
+ Two independent uses of one workaround is the trigger to extract it. These are now
259
+ first-class slots, and the overlay is a shipped emitter.
260
+
261
+ - **`ModeColors.surfaceMuted?`** — the subtle inset surface (table header rows, chips, wells).
262
+ Distinct from `surface` (cards) and `surfaceElevated` (modals): it recedes rather than lifts.
263
+ - **`DesignTokens.onBrand?`** — the foreground for content sitting ON a `primary`-filled
264
+ surface. It is a *contrast partner* of `primary`, not a mode colour, so it lives beside it.
265
+ - **`SemanticColors.successBg?` / `warningBg?` / `errorBg?` / `infoBg?`** — the soft fill a
266
+ status badge, banner or row-highlight paints behind text of the base colour. A tint is NOT
267
+ derivable from its base (it is hand-picked for contrast), so it needs its own slot; without
268
+ one a status surface could not be themed at all.
269
+ - **`toUiTheme(tokens, mode?)`** — a fourth emitter: the shared RN UI kit's `UiTheme` (what
270
+ `@dloizides/ui-feedback`'s `UiProvider` broadcasts). It is **lossless** — every token the
271
+ shape can express lands in an addressable slot (`palette.onBrand`, `palette.surfaceMuted`,
272
+ each status tint at the `100` step), so an app can round-trip its entire palette back out
273
+ of the live provider instead of keeping a parallel static copy that can never follow a
274
+ dark-mode toggle or a per-tenant brand. The theme type is declared **structurally** here,
275
+ exactly as `RnThemeConfig` declares the `TenantThemeConfig` shape, so the package keeps its
276
+ zero-dependency / zero-peer guarantee and takes no dependency on the kit it feeds.
277
+ - **`UI_TINT_STEP` / `UI_MAIN_STEP` / `UI_DEEP_STEP`** — the step names, exported so a consumer
278
+ addresses a scale by name rather than by a magic `'500'`.
279
+ - CSS-variable names (`--on-brand`, `--surface-muted`, `--success-bg`, …) and Tailwind colour
280
+ keys (`on-brand`, `surface-muted`, `success-bg`, …) for the new tokens.
281
+
282
+ ### Fixed
283
+
284
+ - **Scale collapse.** The naive `value => ({ '100': v, '500': v, '700': v })` projection that
285
+ both apps used writes ONE value into every step, silently discarding the deeper brand step
286
+ and every status tint — a theme built that way cannot reproduce the palette it came from.
287
+ `toUiTheme` emits `secondary` as its own scale and each status tint at the `100` step, so
288
+ the values survive. The package's own emitters (`toCssVars`, `toRnTheme`,
289
+ `toTailwindPreset`) were checked and carry no equivalent collapse.
290
+
291
+ ### Compatibility
292
+
293
+ Entirely additive. Every new token is optional and every new emitted key appears **only** when
294
+ a preset declares the token, so `AML_TOKENS`, `EREVNA_TOKENS` and `KATALOGOS_TOKENS` emit
295
+ byte-identical CSS, RN-theme and Tailwind output — verified by the pre-existing emitter test
296
+ suites passing unmodified.
297
+
298
+ ## [1.1.0]
299
+
300
+ ### Fixed
301
+
302
+ - **WCAG AA contrast (UX-11)**: `light.textSecondary` in `EREVNA_TOKENS` and `KATALOGOS_TOKENS`
303
+ was `#777777`, which measures **4.48:1 on `#ffffff` and 4.18:1 on the `#f7f7f7` card surface** —
304
+ both under the AA 4.5:1 floor for normal text, and form-field labels render in this colour.
305
+ Now `#717171` (**4.88:1** and **4.56:1** against those same two surfaces, verified against each
306
+ preset's ACTUAL surfaces rather than assumed from another package's).
307
+ `AML_TOKENS` was already compliant (`#4a5567`, worst case 6.97:1) and is unchanged.
308
+
309
+ This is the same defect `@dloizides/theme-web@1.2.0` fixed in its `DEFAULT_THEME_CONFIG`, but
310
+ that fix does NOT reach these presets — apps resolving colours through a preset bypass
311
+ theme-web's defaults entirely. The bad value survived here independently.
312
+
313
+ ### Added
314
+
315
+ - **`src/contrast.ts`** — a correct WCAG 2.1 contrast implementation (sRGB gamma linearization +
316
+ ITU-R BT.709 weighting; NOT a naive channel average, which mis-scores exactly the mid-greys that
317
+ matter). Deliberately a COPY of theme-web's, not an import: this package ships **zero
318
+ dependencies and zero peers** by design, and depending on a React theming package for pure
319
+ arithmetic would invert the layering (theme-web already depends on this package).
320
+ Exported (`contrastRatio`, `relativeLuminance`, `meetsContrast`, `isHexColor`, and the
321
+ `AA_*_RATIO` thresholds) so consumers that let users override tokens at runtime can validate
322
+ those overrides with the same maths that guards the shipped presets.
323
+ - **`src/contrast.test.ts`** — pins the calculator against external reference pairs
324
+ (`#767676`/white = 4.54:1, `#777777`/white = 4.48:1, black/white = 21:1, and `#808080`'s true
325
+ luminance of 0.2159 vs a channel-average's 0.502) so the guard cannot silently be wrong.
326
+ - **`src/presets/presets.contrast.test.ts`** — a permanent guard measuring every text-role colour
327
+ in EVERY preset against every surface it renders on, in BOTH modes. Failures must be registered
328
+ in `KNOWN_GAPS` with their exact measured ratio, and the registry is asserted to be exactly
329
+ accurate — so a gap cannot be added silently, a stale entry fails once the colour is fixed, and
330
+ a newly failing colour nobody registered fails the suite outright. Non-hex token values (AML's
331
+ `rgba()` dark border, which has no fixed luminance) are excluded by an asserted explicit list
332
+ rather than silently skipped.
333
+
334
+ ### Notes
335
+
336
+ - Only TEXT and essential-boundary roles are asserted. Decorative fills (`primary`/`secondary`/
337
+ `accent`, and the `success`/`warning`/`info` semantic bases) carry no contrast requirement;
338
+ asserting them would turn a compliance guard into a brand redesign.
339
+ - 8 pre-existing gaps are registered, all one root cause: a single token serving both a text role
340
+ and a fill/decorative role across both modes (`border`/`divider`, `semantic.error`). These need
341
+ the roles split before any value can move — a design change, not a colour nudge. They mirror the
342
+ gaps already registered in `@dloizides/theme-web`.
343
+
344
+ ## [1.0.0]
345
+
346
+ ### Added
347
+
348
+ - Initial release (task #78) — the cross-stack design-token source.
349
+ - **Token shape** (`DesignTokens`) whose core fields mirror `@dloizides/tenant-theme-web`'s
350
+ `TenantThemeConfig` (`primary`/`secondary`/`accent`/`semantic`/`light`/`dark`/`typography`/
351
+ `branding`), plus optional `radii`/`shadows`/`extensions` supersets for richer stacks.
352
+ - **Three emitters from one source**: `toCssVars` (CSS custom properties for vanilla-JS),
353
+ `toRnTheme` (a `TenantThemeConfig`-compatible object for RN-web), `toTailwindPreset` (a Tailwind
354
+ preset for the DOM-React ThemeStudio).
355
+ - **Per-app presets** seeded byte-for-byte from current values: `EREVNA_TOKENS`,
356
+ `KATALOGOS_TOKENS` (from each RN app's `default` theme preset), and `AML_TOKENS` (from the AML
357
+ console's `wwwroot/shared/ui.css` `:root`). Plus the `PRESETS` map.
358
+ - **The cross-stack naming contract (#78b)**: `DEFAULT_CSS_VAR_NAMES` (canonical kebab names) and
359
+ `AML_CSS_VAR_NAMES` (the AML console's existing `ui.css` variable names), documented in the
360
+ README with the full name-mapping table and the open naming decisions.
361
+ - Behaviour-preserving by design: runtime tests assert `toRnTheme(EREVNA_TOKENS)` deep-equals the
362
+ app's current `DEFAULT_THEME_CONFIG` and `toCssVars(AML_TOKENS, AML_CSS_VAR_NAMES)` reproduces
363
+ `ui.css`'s `:root` verbatim. Zero visual change on adoption.
364
+ - Values only — no components (those live in `@dloizides/ui-layout`/`ui-forms`/`ui-feedback`/
365
+ `ui-icons`/`ui-tables`). Zero runtime dependencies.