@dloizides/design-tokens 1.12.0 → 1.13.1

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