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