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