@dloizides/design-tokens 1.3.0 → 1.5.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 +243 -149
- package/README.md +21 -0
- package/dist/index.d.mts +142 -31
- package/dist/index.d.ts +142 -31
- package/dist/index.js +121 -67
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +116 -68
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -86,6 +86,98 @@ var AML_CSS_VAR_NAMES = {
|
|
|
86
86
|
badInk: "--bad-ink"
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
+
// src/contrast.ts
|
|
90
|
+
var AA_NORMAL_TEXT_RATIO = 4.5;
|
|
91
|
+
var AA_LARGE_TEXT_RATIO = 3;
|
|
92
|
+
var AA_NON_TEXT_RATIO = 3;
|
|
93
|
+
var SRGB_CHANNEL_MAX = 255;
|
|
94
|
+
var GAMMA_LINEAR_THRESHOLD = 0.03928;
|
|
95
|
+
var GAMMA_LINEAR_DIVISOR = 12.92;
|
|
96
|
+
var GAMMA_OFFSET = 0.055;
|
|
97
|
+
var GAMMA_DIVISOR = 1.055;
|
|
98
|
+
var GAMMA_EXPONENT = 2.4;
|
|
99
|
+
var LUMA_COEFFICIENT_RED = 0.2126;
|
|
100
|
+
var LUMA_COEFFICIENT_GREEN = 0.7152;
|
|
101
|
+
var LUMA_COEFFICIENT_BLUE = 0.0722;
|
|
102
|
+
var CONTRAST_FLARE = 0.05;
|
|
103
|
+
var HEX_RADIX = 16;
|
|
104
|
+
var HEX_PAIR_LENGTH = 2;
|
|
105
|
+
var HEX_SHORTHAND_LENGTH = 3;
|
|
106
|
+
var HEX_FULL_LENGTH = 6;
|
|
107
|
+
var CHANNEL_OFFSET_RED = 0;
|
|
108
|
+
var CHANNEL_OFFSET_GREEN = 2;
|
|
109
|
+
var CHANNEL_OFFSET_BLUE = 4;
|
|
110
|
+
function normalizeHexDigits(hex) {
|
|
111
|
+
const clean = hex.trim().replace("#", "").toLowerCase();
|
|
112
|
+
if (clean.length === HEX_SHORTHAND_LENGTH) {
|
|
113
|
+
return `${clean[0] ?? ""}${clean[0] ?? ""}${clean[1] ?? ""}${clean[1] ?? ""}${clean[2] ?? ""}${clean[2] ?? ""}`;
|
|
114
|
+
}
|
|
115
|
+
return clean;
|
|
116
|
+
}
|
|
117
|
+
function parseChannel(digits, offset) {
|
|
118
|
+
const pair = digits.slice(offset, offset + HEX_PAIR_LENGTH);
|
|
119
|
+
return parseInt(pair, HEX_RADIX) / SRGB_CHANNEL_MAX;
|
|
120
|
+
}
|
|
121
|
+
function linearizeChannel(channel) {
|
|
122
|
+
if (channel <= GAMMA_LINEAR_THRESHOLD) {
|
|
123
|
+
return channel / GAMMA_LINEAR_DIVISOR;
|
|
124
|
+
}
|
|
125
|
+
return Math.pow((channel + GAMMA_OFFSET) / GAMMA_DIVISOR, GAMMA_EXPONENT);
|
|
126
|
+
}
|
|
127
|
+
function isHexColor(value) {
|
|
128
|
+
const digits = normalizeHexDigits(value);
|
|
129
|
+
return digits.length === HEX_FULL_LENGTH && /^[0-9a-f]{6}$/.test(digits);
|
|
130
|
+
}
|
|
131
|
+
function relativeLuminance(hex) {
|
|
132
|
+
if (!isHexColor(hex)) {
|
|
133
|
+
throw new Error(`relativeLuminance: not a hex colour: ${hex}`);
|
|
134
|
+
}
|
|
135
|
+
const digits = normalizeHexDigits(hex);
|
|
136
|
+
const red = linearizeChannel(parseChannel(digits, CHANNEL_OFFSET_RED));
|
|
137
|
+
const green = linearizeChannel(parseChannel(digits, CHANNEL_OFFSET_GREEN));
|
|
138
|
+
const blue = linearizeChannel(parseChannel(digits, CHANNEL_OFFSET_BLUE));
|
|
139
|
+
return LUMA_COEFFICIENT_RED * red + LUMA_COEFFICIENT_GREEN * green + LUMA_COEFFICIENT_BLUE * blue;
|
|
140
|
+
}
|
|
141
|
+
function contrastRatio(foreground, background) {
|
|
142
|
+
const first = relativeLuminance(foreground);
|
|
143
|
+
const second = relativeLuminance(background);
|
|
144
|
+
const lighter = Math.max(first, second);
|
|
145
|
+
const darker = Math.min(first, second);
|
|
146
|
+
return (lighter + CONTRAST_FLARE) / (darker + CONTRAST_FLARE);
|
|
147
|
+
}
|
|
148
|
+
function meetsContrast(foreground, background, requiredRatio) {
|
|
149
|
+
return contrastRatio(foreground, background) >= requiredRatio;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// src/onBrand.ts
|
|
153
|
+
var ON_BRAND_LIGHT_INK = "#ffffff";
|
|
154
|
+
var ON_BRAND_DARK_INK = "#03121f";
|
|
155
|
+
function resolveOnBrand(background, explicit) {
|
|
156
|
+
if (explicit !== void 0) {
|
|
157
|
+
return explicit;
|
|
158
|
+
}
|
|
159
|
+
if (!isHexColor(background)) {
|
|
160
|
+
return ON_BRAND_LIGHT_INK;
|
|
161
|
+
}
|
|
162
|
+
const lightRatio = contrastRatio(ON_BRAND_LIGHT_INK, background);
|
|
163
|
+
const darkRatio = contrastRatio(ON_BRAND_DARK_INK, background);
|
|
164
|
+
return darkRatio > lightRatio ? ON_BRAND_DARK_INK : ON_BRAND_LIGHT_INK;
|
|
165
|
+
}
|
|
166
|
+
function onBrandRatio(background, explicit) {
|
|
167
|
+
if (!isHexColor(background)) {
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
const foreground = resolveOnBrand(background, explicit);
|
|
171
|
+
if (!isHexColor(foreground)) {
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
return contrastRatio(foreground, background);
|
|
175
|
+
}
|
|
176
|
+
function canCarryAccessibleInk(background) {
|
|
177
|
+
const ratio = onBrandRatio(background);
|
|
178
|
+
return ratio !== null && ratio >= AA_NORMAL_TEXT_RATIO;
|
|
179
|
+
}
|
|
180
|
+
|
|
89
181
|
// src/emit/toCssVars.ts
|
|
90
182
|
var INDENT = " ";
|
|
91
183
|
var DEFAULT_DARK_SELECTOR = ':root[data-theme="dark"]';
|
|
@@ -109,7 +201,10 @@ function toCssVars(tokens, names, options) {
|
|
|
109
201
|
declaration(names.primary, tokens.primary),
|
|
110
202
|
declaration(names.secondary, tokens.secondary),
|
|
111
203
|
declaration(names.accent, tokens.accent),
|
|
112
|
-
|
|
204
|
+
// Always emitted (when the name map asks for it), never skipped: a missing
|
|
205
|
+
// `--on-brand` sends the stylesheet to its own hardcoded fallback, which is
|
|
206
|
+
// how white-on-pale-brand reached production in the first place.
|
|
207
|
+
declaration(names.onBrand, resolveOnBrand(tokens.primary, tokens.onBrand)),
|
|
113
208
|
declaration(names.success, tokens.semantic.success),
|
|
114
209
|
declaration(names.warning, tokens.semantic.warning),
|
|
115
210
|
declaration(names.error, tokens.semantic.error),
|
|
@@ -205,9 +300,6 @@ function toRnTheme(tokens) {
|
|
|
205
300
|
// src/emit/toTailwindPreset.ts
|
|
206
301
|
function addOptionalColors(colors, tokens) {
|
|
207
302
|
const { semantic } = tokens;
|
|
208
|
-
if (tokens.onBrand !== void 0) {
|
|
209
|
-
colors["on-brand"] = tokens.onBrand;
|
|
210
|
-
}
|
|
211
303
|
if (semantic.successBg !== void 0) {
|
|
212
304
|
colors["success-bg"] = semantic.successBg;
|
|
213
305
|
}
|
|
@@ -232,6 +324,7 @@ function toTailwindPreset(tokens) {
|
|
|
232
324
|
primary: tokens.primary,
|
|
233
325
|
secondary: tokens.secondary,
|
|
234
326
|
accent: tokens.accent,
|
|
327
|
+
"on-brand": resolveOnBrand(tokens.primary, tokens.onBrand),
|
|
235
328
|
success: tokens.semantic.success,
|
|
236
329
|
warning: tokens.semantic.warning,
|
|
237
330
|
error: tokens.semantic.error,
|
|
@@ -285,7 +378,6 @@ function toTailwindPreset(tokens) {
|
|
|
285
378
|
var UI_TINT_STEP = "100";
|
|
286
379
|
var UI_MAIN_STEP = "500";
|
|
287
380
|
var UI_DEEP_STEP = "700";
|
|
288
|
-
var DEFAULT_ON_BRAND = "#ffffff";
|
|
289
381
|
var ON_BRAND_SCALE = "onBrand";
|
|
290
382
|
var SURFACE_MUTED_SCALE = "surfaceMuted";
|
|
291
383
|
function flat(value) {
|
|
@@ -310,7 +402,7 @@ function toUiTheme(tokens, mode = "light") {
|
|
|
310
402
|
primary: flat(tokens.primary),
|
|
311
403
|
secondary: flat(tokens.secondary),
|
|
312
404
|
accent: flat(tokens.accent),
|
|
313
|
-
[ON_BRAND_SCALE]: flat(tokens.onBrand
|
|
405
|
+
[ON_BRAND_SCALE]: flat(resolveOnBrand(tokens.primary, tokens.onBrand)),
|
|
314
406
|
[SURFACE_MUTED_SCALE]: flat(modeColors.surfaceMuted ?? modeColors.surface)
|
|
315
407
|
},
|
|
316
408
|
semantic: {
|
|
@@ -550,69 +642,25 @@ var PRESETS = {
|
|
|
550
642
|
digitalkin: DIGITALKIN_TOKENS
|
|
551
643
|
};
|
|
552
644
|
|
|
553
|
-
// src/
|
|
554
|
-
var
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
var HEX_SHORTHAND_LENGTH = 3;
|
|
570
|
-
var HEX_FULL_LENGTH = 6;
|
|
571
|
-
var CHANNEL_OFFSET_RED = 0;
|
|
572
|
-
var CHANNEL_OFFSET_GREEN = 2;
|
|
573
|
-
var CHANNEL_OFFSET_BLUE = 4;
|
|
574
|
-
function normalizeHexDigits(hex) {
|
|
575
|
-
const clean = hex.trim().replace("#", "").toLowerCase();
|
|
576
|
-
if (clean.length === HEX_SHORTHAND_LENGTH) {
|
|
577
|
-
return `${clean[0] ?? ""}${clean[0] ?? ""}${clean[1] ?? ""}${clean[1] ?? ""}${clean[2] ?? ""}${clean[2] ?? ""}`;
|
|
578
|
-
}
|
|
579
|
-
return clean;
|
|
580
|
-
}
|
|
581
|
-
function parseChannel(digits, offset) {
|
|
582
|
-
const pair = digits.slice(offset, offset + HEX_PAIR_LENGTH);
|
|
583
|
-
return parseInt(pair, HEX_RADIX) / SRGB_CHANNEL_MAX;
|
|
584
|
-
}
|
|
585
|
-
function linearizeChannel(channel) {
|
|
586
|
-
if (channel <= GAMMA_LINEAR_THRESHOLD) {
|
|
587
|
-
return channel / GAMMA_LINEAR_DIVISOR;
|
|
588
|
-
}
|
|
589
|
-
return Math.pow((channel + GAMMA_OFFSET) / GAMMA_DIVISOR, GAMMA_EXPONENT);
|
|
590
|
-
}
|
|
591
|
-
function isHexColor(value) {
|
|
592
|
-
const digits = normalizeHexDigits(value);
|
|
593
|
-
return digits.length === HEX_FULL_LENGTH && /^[0-9a-f]{6}$/.test(digits);
|
|
594
|
-
}
|
|
595
|
-
function relativeLuminance(hex) {
|
|
596
|
-
if (!isHexColor(hex)) {
|
|
597
|
-
throw new Error(`relativeLuminance: not a hex colour: ${hex}`);
|
|
645
|
+
// src/finregModules.ts
|
|
646
|
+
var FINREG_MODULE_COLORS = {
|
|
647
|
+
payments: {
|
|
648
|
+
// cyan — 1.69:1 on white (fill only); onWhite 4.82:1
|
|
649
|
+
base: "#4FD8F0",
|
|
650
|
+
onWhite: "#0C7D91"
|
|
651
|
+
},
|
|
652
|
+
accounting: {
|
|
653
|
+
// magenta — 3.08:1 on white (fill only); onWhite 4.81:1
|
|
654
|
+
base: "#E85FBF",
|
|
655
|
+
onWhite: "#D11E9B"
|
|
656
|
+
},
|
|
657
|
+
crm: {
|
|
658
|
+
// violet — 2.95:1 on white (fill only); onWhite 4.82:1
|
|
659
|
+
base: "#7B8FF7",
|
|
660
|
+
onWhite: "#4763F4"
|
|
598
661
|
}
|
|
599
|
-
|
|
600
|
-
const red = linearizeChannel(parseChannel(digits, CHANNEL_OFFSET_RED));
|
|
601
|
-
const green = linearizeChannel(parseChannel(digits, CHANNEL_OFFSET_GREEN));
|
|
602
|
-
const blue = linearizeChannel(parseChannel(digits, CHANNEL_OFFSET_BLUE));
|
|
603
|
-
return LUMA_COEFFICIENT_RED * red + LUMA_COEFFICIENT_GREEN * green + LUMA_COEFFICIENT_BLUE * blue;
|
|
604
|
-
}
|
|
605
|
-
function contrastRatio(foreground, background) {
|
|
606
|
-
const first = relativeLuminance(foreground);
|
|
607
|
-
const second = relativeLuminance(background);
|
|
608
|
-
const lighter = Math.max(first, second);
|
|
609
|
-
const darker = Math.min(first, second);
|
|
610
|
-
return (lighter + CONTRAST_FLARE) / (darker + CONTRAST_FLARE);
|
|
611
|
-
}
|
|
612
|
-
function meetsContrast(foreground, background, requiredRatio) {
|
|
613
|
-
return contrastRatio(foreground, background) >= requiredRatio;
|
|
614
|
-
}
|
|
662
|
+
};
|
|
615
663
|
|
|
616
|
-
export { AA_LARGE_TEXT_RATIO, AA_NON_TEXT_RATIO, AA_NORMAL_TEXT_RATIO, AML_CSS_VAR_NAMES, AML_TOKENS, DEFAULT_CSS_VAR_NAMES, DIGITALKIN_TOKENS, EREVNA_TOKENS, KATALOGOS_TOKENS, PRESETS, UI_DEEP_STEP, UI_MAIN_STEP, UI_TINT_STEP, contrastRatio, isHexColor, meetsContrast, relativeLuminance, toCssVars, toRnTheme, toTailwindPreset, toUiTheme };
|
|
664
|
+
export { AA_LARGE_TEXT_RATIO, AA_NON_TEXT_RATIO, AA_NORMAL_TEXT_RATIO, AML_CSS_VAR_NAMES, AML_TOKENS, DEFAULT_CSS_VAR_NAMES, DIGITALKIN_TOKENS, EREVNA_TOKENS, FINREG_MODULE_COLORS, KATALOGOS_TOKENS, ON_BRAND_DARK_INK, ON_BRAND_LIGHT_INK, PRESETS, UI_DEEP_STEP, UI_MAIN_STEP, UI_TINT_STEP, canCarryAccessibleInk, contrastRatio, isHexColor, meetsContrast, onBrandRatio, relativeLuminance, resolveOnBrand, toCssVars, toRnTheme, toTailwindPreset, toUiTheme };
|
|
617
665
|
//# sourceMappingURL=index.mjs.map
|
|
618
666
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/varNames.ts","../src/emit/toCssVars.ts","../src/emit/toRnTheme.ts","../src/emit/toTailwindPreset.ts","../src/emit/toUiTheme.ts","../src/presets/aml.ts","../src/presets/digitalkin.ts","../src/presets/erevna.ts","../src/presets/katalogos.ts","../src/presets/index.ts","../src/contrast.ts"],"names":[],"mappings":";AAuGO,IAAM,qBAAA,GAAqC;AAAA,EAChD,OAAA,EAAS,WAAA;AAAA,EACT,SAAA,EAAW,aAAA;AAAA,EACX,MAAA,EAAQ,UAAA;AAAA,EACR,OAAA,EAAS,YAAA;AAAA,EACT,OAAA,EAAS,WAAA;AAAA,EACT,OAAA,EAAS,WAAA;AAAA,EACT,KAAA,EAAO,SAAA;AAAA,EACP,IAAA,EAAM,QAAA;AAAA,EACN,SAAA,EAAW,cAAA;AAAA,EACX,SAAA,EAAW,cAAA;AAAA,EACX,OAAA,EAAS,YAAA;AAAA,EACT,MAAA,EAAQ,WAAA;AAAA,EACR,eAAA,EAAiB,cAAA;AAAA,EACjB,YAAA,EAAc,WAAA;AAAA,EACd,oBAAA,EAAsB,oBAAA;AAAA,EACtB,iBAAA,EAAmB,iBAAA;AAAA,EACnB,SAAA,EAAW,QAAA;AAAA,EACX,kBAAA,EAAoB,kBAAA;AAAA,EACpB,WAAA,EAAa,UAAA;AAAA,EACb,YAAA,EAAc,WAAA;AAAA,EACd,cAAA,EAAgB,cAAA;AAAA,EAChB,WAAA,EAAa,WAAA;AAAA,EACb,mBAAA,EAAqB,oBAAA;AAAA,EACrB,gBAAA,EAAkB,iBAAA;AAAA,EAClB,QAAA,EAAU,QAAA;AAAA,EACV,iBAAA,EAAmB,kBAAA;AAAA,EACnB,UAAA,EAAY,UAAA;AAAA,EACZ,WAAA,EAAa,WAAA;AAAA,EACb,QAAA,EAAU,aAAA;AAAA,EACV,QAAA,EAAU,aAAA;AAAA,EACV,QAAA,EAAU,UAAA;AAAA,EACV,QAAA,EAAU,aAAA;AAAA,EACV,UAAA,EAAY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AAA,GAAS,cAAA,CAAA;AAChD;AAGO,SAAS,aAAA,CACd,UAAA,EACA,UAAA,EACA,aAAA,EACS;AACT,EAAA,OAAO,aAAA,CAAc,UAAA,EAAY,UAAU,CAAA,IAAK,aAAA;AAClD","file":"index.mjs","sourcesContent":["/**\n * CSS custom-property NAME MAPS — the cross-stack naming contract.\n *\n * `toCssVars(tokens, names)` reads a {@link DesignTokens} and a {@link CssVarNames}\n * map that says which CSS variable each token field is emitted as. A field whose\n * name is `undefined` in the map is skipped, which lets a stack emit only the\n * variables it actually consumes.\n *\n * Two maps ship:\n * - {@link DEFAULT_CSS_VAR_NAMES} — canonical kebab names (`--primary`, `--bg`, …).\n * The dark-mode fields have names, so a dark-mode block is emitted.\n * - {@link AML_CSS_VAR_NAMES} — the vanilla-JS AML console's existing variable\n * names (`--brand`, `--shell`, `--ok`, `--r`, …), so `wwwroot/shared/ui.css`\n * keeps working byte-for-byte. Core fields that AML expresses via an extension\n * variable are mapped to `undefined` (skipped) to avoid emitting duplicates,\n * and the dark-mode fields are `undefined` (AML has no light/dark toggle — its\n * dark app-shell is captured in the `shell*` extension inside `:root`).\n */\n\n/** Maps each {@link DesignTokens} field to the CSS variable it is emitted as (or `undefined` to skip). */\nexport interface CssVarNames {\n // brand\n primary?: string;\n secondary?: string;\n accent?: string;\n onBrand?: string;\n // semantic\n success?: string;\n warning?: string;\n error?: string;\n info?: string;\n // semantic background tints\n successBg?: string;\n warningBg?: string;\n errorBg?: string;\n infoBg?: string;\n // light-mode colours (emitted in :root)\n lightBackground?: string;\n lightSurface?: string;\n lightSurfaceElevated?: string;\n lightSurfaceMuted?: string;\n lightText?: string;\n lightTextSecondary?: string;\n lightBorder?: string;\n lightDivider?: string;\n // dark-mode colours (emitted in the dark selector block; omit all to skip the block)\n darkBackground?: string;\n darkSurface?: string;\n darkSurfaceElevated?: string;\n darkSurfaceMuted?: string;\n darkText?: string;\n darkTextSecondary?: string;\n darkBorder?: string;\n darkDivider?: string;\n // radii\n radiusXs?: string;\n radiusSm?: string;\n radiusMd?: string;\n radiusLg?: string;\n radiusPill?: string;\n // shadows\n shadowSm?: string;\n shadowMd?: string;\n shadowPop?: string;\n // fonts\n fontFamily?: string;\n monoFamily?: string;\n // extensions — shell\n shellBackground?: string;\n shellBackgroundAlt?: string;\n shellLine?: string;\n shellOn?: string;\n shellOnDim?: string;\n // extensions — brand extras\n brandPress?: string;\n brandSoft?: string;\n brandRing?: string;\n // extensions — ink scale\n inkBase?: string;\n inkSoft?: string;\n inkFaint?: string;\n inkOverlay?: string;\n // extensions — workspace extras\n surfaceAlt?: string;\n lineStrong?: string;\n // extensions — verdict palette\n ok?: string;\n okSoft?: string;\n okInk?: string;\n warn?: string;\n warnSoft?: string;\n warnInk?: string;\n bad?: string;\n badSoft?: string;\n badSoft2?: string;\n badInk?: string;\n}\n\n/**\n * Canonical kebab-case variable names. A stack with no existing CSS-variable\n * convention (or a fresh consumer) should adopt these. Extension fields are\n * omitted because the RN/DOM presets carry no extensions.\n */\nexport const DEFAULT_CSS_VAR_NAMES: CssVarNames = {\n primary: '--primary',\n secondary: '--secondary',\n accent: '--accent',\n onBrand: '--on-brand',\n success: '--success',\n warning: '--warning',\n error: '--error',\n info: '--info',\n successBg: '--success-bg',\n warningBg: '--warning-bg',\n errorBg: '--error-bg',\n infoBg: '--info-bg',\n lightBackground: '--background',\n lightSurface: '--surface',\n lightSurfaceElevated: '--surface-elevated',\n lightSurfaceMuted: '--surface-muted',\n lightText: '--text',\n lightTextSecondary: '--text-secondary',\n lightBorder: '--border',\n lightDivider: '--divider',\n darkBackground: '--background',\n darkSurface: '--surface',\n darkSurfaceElevated: '--surface-elevated',\n darkSurfaceMuted: '--surface-muted',\n darkText: '--text',\n darkTextSecondary: '--text-secondary',\n darkBorder: '--border',\n darkDivider: '--divider',\n radiusXs: '--radius-xs',\n radiusSm: '--radius-sm',\n radiusMd: '--radius',\n radiusLg: '--radius-lg',\n radiusPill: '--radius-pill',\n shadowSm: '--shadow-sm',\n shadowMd: '--shadow',\n shadowPop: '--shadow-pop',\n fontFamily: '--font',\n monoFamily: '--font-mono',\n};\n\n/**\n * The AML console's existing `wwwroot/shared/ui.css` variable names. Emitting the\n * `aml` preset with this map reproduces AML's current `:root` byte-for-byte, so\n * ui.css keeps working with zero visual change.\n *\n * Core fields that AML already expresses through an extension variable are mapped\n * to `undefined` to avoid duplicate declarations:\n * - `secondary`/`accent` — AML has a single brand; ui.css never reads them.\n * - `success`/`warning`/`error`/`info` — emitted via the verdict extension\n * (`--ok`/`--warn`/`--bad`); `info` has no AML variable.\n * - `light.surfaceElevated` → via `workspace.surfaceAlt` (`--surface-2`).\n * - `light.text` → via `ink.base` (`--ink`); `light.textSecondary` → `ink.soft`.\n * - `light.divider` — AML reuses `--line`, so no separate variable.\n * - all `dark*` — AML has no dark-mode toggle (its shell lives in the extension).\n */\nexport const AML_CSS_VAR_NAMES: CssVarNames = {\n primary: '--brand',\n // secondary/accent intentionally omitted (single-brand console)\n // semantic emitted via verdict extension; info has no AML variable\n lightBackground: '--bg',\n lightSurface: '--surface',\n // lightSurfaceElevated via workspace.surfaceAlt (--surface-2)\n // lightText via ink.base (--ink); lightTextSecondary via ink.soft (--ink-soft)\n lightBorder: '--line',\n // lightDivider reuses --line\n // dark* omitted (no dark-mode toggle)\n radiusXs: '--r-xs',\n radiusSm: '--r-sm',\n radiusMd: '--r',\n radiusLg: '--r-lg',\n radiusPill: '--r-pill',\n shadowSm: '--sh-1',\n shadowMd: '--sh-2',\n shadowPop: '--sh-pop',\n fontFamily: '--font',\n monoFamily: '--mono',\n shellBackground: '--shell',\n shellBackgroundAlt: '--shell-2',\n shellLine: '--shell-line',\n shellOn: '--on-shell',\n shellOnDim: '--on-shell-dim',\n brandPress: '--brand-press',\n brandSoft: '--brand-soft',\n brandRing: '--brand-ring',\n inkBase: '--ink',\n inkSoft: '--ink-soft',\n inkFaint: '--ink-faint',\n inkOverlay: '--ink-2',\n surfaceAlt: '--surface-2',\n lineStrong: '--line-strong',\n ok: '--ok',\n okSoft: '--ok-soft',\n okInk: '--ok-ink',\n warn: '--warn',\n warnSoft: '--warn-soft',\n warnInk: '--warn-ink',\n bad: '--bad',\n badSoft: '--bad-soft',\n badSoft2: '--bad-soft2',\n badInk: '--bad-ink',\n};\n","import type { DesignTokens } from '../types';\nimport type { CssVarNames } from '../varNames';\n\n/** Options for {@link toCssVars}. */\nexport interface ToCssVarsOptions {\n /**\n * Selector for the dark-mode block. Only used when the name map defines any\n * `dark*` variables. Defaults to `:root[data-theme=\"dark\"]`.\n */\n darkSelector?: string;\n}\n\nconst INDENT = ' ';\nconst DEFAULT_DARK_SELECTOR = ':root[data-theme=\"dark\"]';\n\n/** A single ` --name: value;` line, or `null` when the name or value is absent. */\nfunction declaration(name: string | undefined, value: string | undefined): string | null {\n if (name === undefined || value === undefined) {\n return null;\n }\n return `${INDENT}${name}: ${value};`;\n}\n\nfunction isLine(entry: string | null): entry is string {\n return entry !== null;\n}\n\nfunction block(selector: string, lines: readonly string[]): string {\n return `${selector} {\\n${lines.join('\\n')}\\n}`;\n}\n\n/**\n * Emit a {@link DesignTokens} as CSS custom properties. Base tokens (brand,\n * semantic, light-mode, radii, shadows, fonts and any extensions) go in a\n * `:root {}` block; dark-mode tokens go in a separate selector block, emitted\n * only when the name map defines at least one `dark*` variable.\n */\nexport function toCssVars(\n tokens: DesignTokens,\n names: CssVarNames,\n options?: ToCssVarsOptions,\n): string {\n const ext = tokens.extensions;\n const baseEntries: Array<string | null> = [\n declaration(names.primary, tokens.primary),\n declaration(names.secondary, tokens.secondary),\n declaration(names.accent, tokens.accent),\n declaration(names.onBrand, tokens.onBrand),\n declaration(names.success, tokens.semantic.success),\n declaration(names.warning, tokens.semantic.warning),\n declaration(names.error, tokens.semantic.error),\n declaration(names.info, tokens.semantic.info),\n declaration(names.successBg, tokens.semantic.successBg),\n declaration(names.warningBg, tokens.semantic.warningBg),\n declaration(names.errorBg, tokens.semantic.errorBg),\n declaration(names.infoBg, tokens.semantic.infoBg),\n declaration(names.lightBackground, tokens.light.background),\n declaration(names.lightSurface, tokens.light.surface),\n declaration(names.lightSurfaceElevated, tokens.light.surfaceElevated),\n declaration(names.lightSurfaceMuted, tokens.light.surfaceMuted),\n declaration(names.lightText, tokens.light.text),\n declaration(names.lightTextSecondary, tokens.light.textSecondary),\n declaration(names.lightBorder, tokens.light.border),\n declaration(names.lightDivider, tokens.light.divider),\n declaration(names.radiusXs, tokens.radii?.xs),\n declaration(names.radiusSm, tokens.radii?.sm),\n declaration(names.radiusMd, tokens.radii?.md),\n declaration(names.radiusLg, tokens.radii?.lg),\n declaration(names.radiusPill, tokens.radii?.pill),\n declaration(names.shadowSm, tokens.shadows?.sm),\n declaration(names.shadowMd, tokens.shadows?.md),\n declaration(names.shadowPop, tokens.shadows?.pop),\n declaration(names.fontFamily, tokens.typography?.fontFamily),\n declaration(names.monoFamily, tokens.typography?.monoFamily),\n declaration(names.shellBackground, ext?.shell?.background),\n declaration(names.shellBackgroundAlt, ext?.shell?.backgroundAlt),\n declaration(names.shellLine, ext?.shell?.line),\n declaration(names.shellOn, ext?.shell?.on),\n declaration(names.shellOnDim, ext?.shell?.onDim),\n declaration(names.brandPress, ext?.brand?.press),\n declaration(names.brandSoft, ext?.brand?.soft),\n declaration(names.brandRing, ext?.brand?.ring),\n declaration(names.inkBase, ext?.ink?.base),\n declaration(names.inkSoft, ext?.ink?.soft),\n declaration(names.inkFaint, ext?.ink?.faint),\n declaration(names.inkOverlay, ext?.ink?.overlay),\n declaration(names.surfaceAlt, ext?.workspace?.surfaceAlt),\n declaration(names.lineStrong, ext?.workspace?.lineStrong),\n declaration(names.ok, ext?.verdict?.ok),\n declaration(names.okSoft, ext?.verdict?.okSoft),\n declaration(names.okInk, ext?.verdict?.okInk),\n declaration(names.warn, ext?.verdict?.warn),\n declaration(names.warnSoft, ext?.verdict?.warnSoft),\n declaration(names.warnInk, ext?.verdict?.warnInk),\n declaration(names.bad, ext?.verdict?.bad),\n declaration(names.badSoft, ext?.verdict?.badSoft),\n declaration(names.badSoft2, ext?.verdict?.badSoft2),\n declaration(names.badInk, ext?.verdict?.badInk),\n ];\n const baseBlock = block(':root', baseEntries.filter(isLine));\n\n const darkEntries: Array<string | null> = [\n declaration(names.darkBackground, tokens.dark.background),\n declaration(names.darkSurface, tokens.dark.surface),\n declaration(names.darkSurfaceElevated, tokens.dark.surfaceElevated),\n declaration(names.darkSurfaceMuted, tokens.dark.surfaceMuted),\n declaration(names.darkText, tokens.dark.text),\n declaration(names.darkTextSecondary, tokens.dark.textSecondary),\n declaration(names.darkBorder, tokens.dark.border),\n declaration(names.darkDivider, tokens.dark.divider),\n ];\n const darkLines = darkEntries.filter(isLine);\n if (darkLines.length === 0) {\n return baseBlock;\n }\n\n const selector = options?.darkSelector ?? DEFAULT_DARK_SELECTOR;\n return `${baseBlock}\\n\\n${block(selector, darkLines)}`;\n}\n","import type { Branding, DesignTokens, ModeColors } from '../types';\n\n/**\n * The RN-web theme-config shape. Structurally compatible with\n * `@dloizides/tenant-theme-web`'s `TenantThemeConfig` (and each RN app's local\n * `TenantThemeConfig`), so a preset can be dropped in as the `defaultThemeConfig`\n * fallback without any mapping. Semantic and typography are optional (an RN app\n * may leave them unset, exactly as the current `default` preset does).\n */\nexport interface RnThemeConfig {\n primary: string;\n secondary: string;\n accent: string;\n semantic?: { success?: string; warning?: string; error?: string; info?: string };\n light: ModeColors;\n dark: ModeColors;\n typography?: { fontFamily?: string; headingScale?: number };\n branding: Branding;\n}\n\n/**\n * Emit a {@link DesignTokens} as an RN-web `TenantThemeConfig`-compatible object.\n * Only the core fields are projected; the `radii`/`shadows`/`extensions`\n * supersets are intentionally dropped (RN-web has no centralized token for them).\n * `typography` is included only when the preset defines it, so a preset with no\n * typography yields a config with no `typography` key — byte-identical to the RN\n * apps' current `DEFAULT_THEME_CONFIG`.\n */\nexport function toRnTheme(tokens: DesignTokens): RnThemeConfig {\n const config: RnThemeConfig = {\n primary: tokens.primary,\n secondary: tokens.secondary,\n accent: tokens.accent,\n semantic: { ...tokens.semantic },\n light: { ...tokens.light },\n dark: { ...tokens.dark },\n branding: { ...tokens.branding },\n };\n if (tokens.typography !== undefined) {\n config.typography = {\n fontFamily: tokens.typography.fontFamily,\n headingScale: tokens.typography.headingScale,\n };\n }\n return config;\n}\n","import type { DesignTokens } from '../types';\n\n/** Nested colour scale emitted under `theme.extend.colors`. */\nexport interface TailwindColors {\n primary: string;\n secondary: string;\n accent: string;\n /** Emitted only when the preset declares `onBrand`. */\n 'on-brand'?: string;\n success: string;\n warning: string;\n error: string;\n info: string;\n /** Status background tints. Emitted only when the preset declares them. */\n 'success-bg'?: string;\n 'warning-bg'?: string;\n 'error-bg'?: string;\n 'info-bg'?: string;\n background: string;\n surface: string;\n 'surface-elevated': string;\n /** Emitted only when the preset declares `light.surfaceMuted`. */\n 'surface-muted'?: string;\n text: string;\n 'text-secondary': string;\n border: string;\n divider: string;\n dark: {\n background: string;\n surface: string;\n 'surface-elevated': string;\n /** Emitted only when the preset declares `dark.surfaceMuted`. */\n 'surface-muted'?: string;\n text: string;\n 'text-secondary': string;\n border: string;\n divider: string;\n };\n}\n\n/** A Tailwind preset object: `{ theme: { extend: { … } } }`. Spread into a `tailwind.config`'s `presets`. */\nexport interface TailwindPreset {\n theme: {\n extend: {\n colors: TailwindColors;\n borderRadius?: Record<string, string>;\n boxShadow?: Record<string, string>;\n fontFamily?: Record<string, string[]>;\n };\n };\n}\n\n/**\n * Add the optional colour tokens, each only when the preset declares it — so a\n * preset that predates these slots emits a byte-identical colour object.\n */\nfunction addOptionalColors(colors: TailwindColors, tokens: DesignTokens): void {\n const { semantic } = tokens;\n if (tokens.onBrand !== undefined) {\n colors['on-brand'] = tokens.onBrand;\n }\n if (semantic.successBg !== undefined) {\n colors['success-bg'] = semantic.successBg;\n }\n if (semantic.warningBg !== undefined) {\n colors['warning-bg'] = semantic.warningBg;\n }\n if (semantic.errorBg !== undefined) {\n colors['error-bg'] = semantic.errorBg;\n }\n if (semantic.infoBg !== undefined) {\n colors['info-bg'] = semantic.infoBg;\n }\n if (tokens.light.surfaceMuted !== undefined) {\n colors['surface-muted'] = tokens.light.surfaceMuted;\n }\n if (tokens.dark.surfaceMuted !== undefined) {\n colors.dark['surface-muted'] = tokens.dark.surfaceMuted;\n }\n}\n\n/**\n * Emit a {@link DesignTokens} as a Tailwind preset for the DOM-React ThemeStudio.\n * The core colours are always present; the optional colour slots,\n * `borderRadius`/`boxShadow`/`fontFamily` are emitted only when the preset\n * defines the corresponding token.\n */\nexport function toTailwindPreset(tokens: DesignTokens): TailwindPreset {\n const colors: TailwindColors = {\n primary: tokens.primary,\n secondary: tokens.secondary,\n accent: tokens.accent,\n success: tokens.semantic.success,\n warning: tokens.semantic.warning,\n error: tokens.semantic.error,\n info: tokens.semantic.info,\n background: tokens.light.background,\n surface: tokens.light.surface,\n 'surface-elevated': tokens.light.surfaceElevated,\n text: tokens.light.text,\n 'text-secondary': tokens.light.textSecondary,\n border: tokens.light.border,\n divider: tokens.light.divider,\n dark: {\n background: tokens.dark.background,\n surface: tokens.dark.surface,\n 'surface-elevated': tokens.dark.surfaceElevated,\n text: tokens.dark.text,\n 'text-secondary': tokens.dark.textSecondary,\n border: tokens.dark.border,\n divider: tokens.dark.divider,\n },\n };\n addOptionalColors(colors, tokens);\n\n const extend: TailwindPreset['theme']['extend'] = { colors };\n\n if (tokens.radii !== undefined) {\n extend.borderRadius = {\n xs: tokens.radii.xs,\n sm: tokens.radii.sm,\n DEFAULT: tokens.radii.md,\n lg: tokens.radii.lg,\n pill: tokens.radii.pill,\n };\n }\n if (tokens.shadows !== undefined) {\n extend.boxShadow = {\n sm: tokens.shadows.sm,\n DEFAULT: tokens.shadows.md,\n pop: tokens.shadows.pop,\n };\n }\n if (tokens.typography !== undefined) {\n const fontFamily: Record<string, string[]> = { sans: [tokens.typography.fontFamily] };\n if (tokens.typography.monoFamily !== undefined) {\n fontFamily.mono = [tokens.typography.monoFamily];\n }\n extend.fontFamily = fontFamily;\n }\n\n return { theme: { extend } };\n}\n","/**\n * Emit a {@link DesignTokens} as the shared RN UI kit's theme object — the value\n * `@dloizides/ui-feedback`'s `UiProvider` broadcasts and every kit component\n * (NavShell, DataTable, Filters, Pager, StatusBadge, ThemedTextInput, StatCard)\n * reads via `useUi()`.\n *\n * WHY THIS LIVES HERE\n * -------------------\n * Two apps (ichnos, kefi) independently wrote the same adapter, and both hit the\n * same wall: a naive projection assigns ONE value to every step of a scale, which\n * silently discards the deeper brand step and the status background tints. Each\n * then bolted a private overlay onto the result to smuggle the lost values into\n * free slots. That overlay is this function, done twice — so it belongs in the\n * token package, where the token shape that lost the values is defined.\n *\n * The emitted theme is a LOSSLESS carrier: every token the shape can express has\n * an addressable slot, so an app can round-trip its whole palette back out\n * (see the `*Colors` accessors in each app) instead of keeping a parallel static\n * copy that cannot follow a dark-mode toggle or a per-tenant brand.\n *\n * The type is declared structurally here rather than imported, exactly as\n * {@link RnThemeConfig} declares the `TenantThemeConfig` shape: this package\n * stays framework-agnostic and takes no dependency on the kit it feeds.\n */\nimport type { DesignTokens, ModeColors } from '../types';\n\n/** Flat colour fields the kit reads directly. Mirrors `ui-feedback`'s `FeedbackThemeColors`. */\nexport interface UiThemeColors {\n background: string;\n surface: string;\n surfaceElevated: string;\n text: string;\n textSecondary: string;\n border: string;\n}\n\n/** A colour scale. The `500` step is guaranteed; other steps are addressable. */\nexport interface UiColorScale {\n '500': string;\n [step: string]: string;\n}\n\n/** Brand scales. `primary` is guaranteed; other names are addressable. */\nexport interface UiThemePalette {\n primary: UiColorScale;\n [name: string]: UiColorScale;\n}\n\n/** Status scales. `error` is guaranteed; other names are addressable. */\nexport interface UiThemeSemantic {\n error: UiColorScale;\n [name: string]: UiColorScale;\n}\n\n/** The kit theme. Structurally identical to `@dloizides/ui-feedback`'s `UiTheme`. */\nexport interface UiThemeConfig {\n colors: UiThemeColors;\n palette: UiThemePalette;\n semantic: UiThemeSemantic;\n}\n\n/** Which mode block ({@link DesignTokens.light} / {@link DesignTokens.dark}) to project. */\nexport type UiThemeMode = 'light' | 'dark';\n\n/** The soft/tint step of a scale — status background tints, muted brand fills. */\nexport const UI_TINT_STEP = '100';\n/** The step every shipped kit component reads. */\nexport const UI_MAIN_STEP = '500';\n/** The deep/pressed step of a scale. */\nexport const UI_DEEP_STEP = '700';\n\n/**\n * Fallback foreground for a `primary`-filled surface when a preset declares no\n * {@link DesignTokens.onBrand}. White is correct for a saturated brand; a preset\n * with a pale primary must set `onBrand` rather than rely on this.\n */\nconst DEFAULT_ON_BRAND = '#ffffff';\n\n/** Palette scale carrying the on-brand foreground. */\nconst ON_BRAND_SCALE = 'onBrand';\n/** Palette scale carrying the muted inset surface. */\nconst SURFACE_MUTED_SCALE = 'surfaceMuted';\n\n/**\n * A colour with no distinct tint or deep variant, expressed as a full scale so\n * every step is addressable and no consumer reads `undefined`.\n */\nfunction flat(value: string): UiColorScale {\n return { [UI_TINT_STEP]: value, [UI_MAIN_STEP]: value, [UI_DEEP_STEP]: value };\n}\n\n/**\n * A status scale: the base at `500`/`700` and its background tint at `100`.\n * Falls back to a flat scale when the preset declares no tint, so behaviour is\n * unchanged for presets that predate the `*Bg` slots.\n */\nfunction tinted(base: string, tint: string | undefined): UiColorScale {\n return { [UI_TINT_STEP]: tint ?? base, [UI_MAIN_STEP]: base, [UI_DEEP_STEP]: base };\n}\n\n/**\n * Project a token set onto the shared kit's theme shape.\n *\n * Every value is carried into an addressable slot:\n * - `palette.primary` / `secondary` / `accent` — the brand scales.\n * - `palette.onBrand` — {@link DesignTokens.onBrand}, the primary's contrast partner.\n * - `palette.surfaceMuted` — the mode's {@link ModeColors.surfaceMuted}.\n * - `semantic.*` — each status colour at `500`, its `*Bg` tint at `100`.\n *\n * @param tokens the app's token set\n * @param mode which mode block to project (default `'light'`)\n */\nexport function toUiTheme(tokens: DesignTokens, mode: UiThemeMode = 'light'): UiThemeConfig {\n const modeColors: ModeColors = mode === 'dark' ? tokens.dark : tokens.light;\n const { semantic } = tokens;\n return {\n colors: {\n background: modeColors.background,\n surface: modeColors.surface,\n surfaceElevated: modeColors.surfaceElevated,\n text: modeColors.text,\n textSecondary: modeColors.textSecondary,\n border: modeColors.border,\n },\n palette: {\n primary: flat(tokens.primary),\n secondary: flat(tokens.secondary),\n accent: flat(tokens.accent),\n [ON_BRAND_SCALE]: flat(tokens.onBrand ?? DEFAULT_ON_BRAND),\n [SURFACE_MUTED_SCALE]: flat(modeColors.surfaceMuted ?? modeColors.surface),\n },\n semantic: {\n error: tinted(semantic.error, semantic.errorBg),\n success: tinted(semantic.success, semantic.successBg),\n warning: tinted(semantic.warning, semantic.warningBg),\n info: tinted(semantic.info, semantic.infoBg),\n },\n };\n}\n","import type { DesignTokens } from '../types';\n\n/**\n * PROOViD AML console (Stack A — vanilla JS) tokens.\n *\n * Seeded byte-for-byte from `PROOViD/AMLService/AMLService/wwwroot/shared/ui.css`\n * `:root`. Emitting via `toCssVars(AML_TOKENS, AML_CSS_VAR_NAMES)` reproduces that\n * `:root` block exactly, so ui.css keeps working with zero visual change.\n *\n * Name-mapping notes (AML has no `TenantThemeConfig`-style secondary/accent or\n * light/dark toggle):\n * - `primary` = `--brand`. `secondary`/`accent` mirror it (ui.css reads neither);\n * they exist only so the core shape is complete.\n * - `semantic` mirrors the verdict palette (`--ok`/`--warn`/`--bad`); `info` has\n * no AML variable, so it mirrors `--brand`.\n * - `light` = the light workspace (`--bg`/`--surface`/…); `dark` = the dark app\n * SHELL (`--shell`/`--shell-2`/…) so the shape is complete. The AML name map\n * omits all `dark*` names, so no dark-mode block is emitted; the shell is\n * emitted from the `extensions.shell` group inside `:root`, matching ui.css.\n */\nexport const AML_TOKENS: DesignTokens = {\n primary: '#4f46e5',\n secondary: '#4f46e5',\n accent: '#4f46e5',\n\n semantic: {\n success: '#0c9d6c',\n warning: '#b9690a',\n error: '#d4302b',\n info: '#4f46e5',\n },\n\n light: {\n background: '#f4f6fa',\n surface: '#ffffff',\n surfaceElevated: '#f8fafc',\n text: '#0d1526',\n textSecondary: '#4a5567',\n border: '#e6e9f0',\n divider: '#e6e9f0',\n },\n\n dark: {\n background: '#0b1220',\n surface: '#111a2c',\n surfaceElevated: '#111a2c',\n text: '#e8edf6',\n textSecondary: '#95a3bb',\n border: 'rgba(255, 255, 255, .09)',\n divider: 'rgba(255, 255, 255, .09)',\n },\n\n typography: {\n fontFamily: '\"IBM Plex Sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif',\n monoFamily: '\"IBM Plex Mono\", ui-monospace, SFMono-Regular, Menlo, monospace',\n headingScale: 1,\n },\n\n radii: {\n xs: '7px',\n sm: '9px',\n md: '12px',\n lg: '16px',\n pill: '999px',\n },\n\n shadows: {\n sm: '0 1px 2px rgba(13, 21, 38, .06)',\n md: '0 6px 20px -8px rgba(13, 21, 38, .14), 0 1px 2px rgba(13, 21, 38, .05)',\n pop: '0 24px 60px -16px rgba(13, 21, 38, .32)',\n },\n\n branding: {\n logoContentId: null,\n faviconContentId: null,\n presetId: 'aml',\n },\n\n extensions: {\n shell: {\n background: '#0b1220',\n backgroundAlt: '#111a2c',\n line: 'rgba(255, 255, 255, .09)',\n on: '#e8edf6',\n onDim: '#95a3bb',\n },\n brand: {\n press: '#4035c9',\n soft: '#eef0fe',\n ring: 'rgba(79, 70, 229, .16)',\n },\n ink: {\n base: '#0d1526',\n soft: '#4a5567',\n faint: '#75839a',\n overlay: '#46506220',\n },\n workspace: {\n surfaceAlt: '#f8fafc',\n lineStrong: '#d7dce6',\n },\n verdict: {\n ok: '#0c9d6c',\n okSoft: '#e4f6ef',\n okInk: '#0a7a55',\n warn: '#b9690a',\n warnSoft: '#fcf1e3',\n warnInk: '#985608',\n bad: '#d4302b',\n badSoft: '#fcebea',\n badSoft2: '#fdecec',\n badInk: '#b21f1f',\n },\n },\n};\n","import type { DesignTokens } from '../types';\n\n/**\n * Digital Kin (Greek digital-literacy guide site) tokens.\n *\n * Seeded from the Figma `Typography & Colors Style Guide` (design spec §8): green\n * `#007E4A`, yellow `#FFAB00`, black, white. Unlike the aml/erevna/katalogos\n * presets — which were extracted byte-for-byte from an existing running app — this\n * preset is authored from the brand source, because the app does not exist yet.\n * That difference is not cosmetic: those presets must preserve their app's current\n * pixels, so their AA failures are frozen in `KNOWN_GAPS`. This one has no pixels\n * to preserve, so it is held to the floor the guard actually asks for wherever\n * that is arithmetically reachable (see `border` below).\n *\n * THE ACCENT IS A HIGHLIGHT, NOT A BUTTON COLOUR. `#FFAB00` is light: white text\n * on it measures 1.90:1, nowhere near the 4.5:1 AA floor. It carries stars,\n * focus rings, underlines and small ornaments, always with DARK ink on top\n * (`light.text` on it measures 9.81:1). `digitalkin.test.ts` asserts BOTH halves\n * of that, so \"just make the CTA yellow\" fails the build rather than shipping\n * unreadable.\n *\n * TYPOGRAPHY (spec D21): Geologica ONLY. It covers Greek, Latin, Cyrillic and\n * Vietnamese, and its `CRSV`/`SHRP` variable axes supply the display voice that\n * DynaPuff would otherwise have provided. DynaPuff has NO Greek glyphs at all, and\n * because browser font fallback is per-GLYPH rather than per-element, a heading\n * like \"Digital Kin — Ξεκινήστε εδώ\" would render the Latin half in DynaPuff and\n * the Greek half in an arbitrary system font, inside one element. It is therefore\n * deliberately absent from this file: it exists only inside `wordmark.svg`, whose\n * text is converted to vector paths and loads no font at all.\n *\n * Three deliberate divergences from the raw Figma palette, all for AA contrast on\n * an audience of older users who are frequently outdoors:\n * * `light.textSecondary` is `#5A5A5A` (6.41:1 on the `#F5F7F5` card, its worst\n * surface) rather than a mid grey. A muted grey that fails AA is the single\n * most common way a \"designed\" palette becomes unreadable, and this palette's\n * secondary text carries guide intros and difficulty labels.\n * * `border` is darker than a decorative hairline would be — `#7E8A80` (3.34:1\n * on white) and `#6B7D71` (3.40:1 on the raised dark surface) — so it clears\n * WCAG 1.4.11 as an INPUT OUTLINE. The other three presets have their light\n * borders registered as known gaps because darkening a live portal's hairlines\n * is a visual regression; this preset ships before any pixels exist, so it\n * takes the compliant value instead of inheriting the gap. `divider`, which\n * is decorative only and carries no contrast requirement, stays light.\n * * Dark-mode surfaces lift the green rather than reusing `#007E4A` as a\n * background, which would leave no room for readable text above it.\n *\n * ONE REGISTERED GAP — `dark.semantic.error`. `semantic.error` is a SINGLE token\n * rendered as text in BOTH modes, so one hex must clear 4.5:1 against white AND\n * against `#1E2A22`. Those requirements are mutually exclusive: AA on white caps\n * its relative luminance at 0.183, AA on the raised dark surface demands at least\n * 0.267. No colour satisfies both, so this is not a value that was chosen badly —\n * it needs a mode-aware split of the token, which is a shape change to\n * `SemanticColors` affecting all four presets. Registered in\n * `presets.contrast.test.ts` with its measured ratio, exactly like the identical\n * gap in erevna/katalogos/aml.\n */\nexport const DIGITALKIN_TOKENS: DesignTokens = {\n primary: '#007E4A',\n secondary: '#005532',\n accent: '#FFAB00',\n\n // White on the brand green measures 5.14:1 — AA for normal text, so filled\n // buttons carry white labels. Stated explicitly rather than leaning on the\n // consumer-side default, because a future primary tweak must re-prove it.\n onBrand: '#FFFFFF',\n\n semantic: {\n success: '#007E4A',\n warning: '#B26A00',\n error: '#B3261E',\n info: '#005532',\n },\n\n light: {\n background: '#FFFFFF',\n surface: '#F5F7F5',\n surfaceElevated: '#FFFFFF',\n text: '#101410',\n textSecondary: '#5A5A5A',\n border: '#7E8A80',\n divider: '#E5E9E5',\n surfaceMuted: '#EDF2ED',\n },\n\n dark: {\n background: '#0E1410',\n surface: '#16201A',\n surfaceElevated: '#1E2A22',\n text: '#F2F5F2',\n textSecondary: '#BFC7BF',\n border: '#6B7D71',\n divider: '#2C3A30',\n surfaceMuted: '#1A241D',\n },\n\n typography: {\n // Geologica Variable ships via @fontsource-variable/geologica on the public tier.\n fontFamily:\n \"'Geologica Variable', 'Geologica', system-ui, -apple-system, 'Segoe UI', sans-serif\",\n headingScale: 1,\n },\n\n radii: {\n xs: '4px',\n sm: '8px',\n md: '12px',\n lg: '20px',\n pill: '999px',\n },\n\n shadows: {\n sm: '0 1px 2px rgba(16, 20, 16, 0.06)',\n md: '0 2px 8px rgba(16, 20, 16, 0.08)',\n pop: '0 8px 24px rgba(16, 20, 16, 0.12)',\n },\n\n branding: {\n logoContentId: null,\n faviconContentId: null,\n presetId: 'digitalkin',\n },\n};\n","import type { DesignTokens } from '../types';\n\n/**\n * Erevna (surveys/forms — realm `questioner`) tokens.\n *\n * Seeded byte-for-byte from `erevna-web/src/theme/presets/default.ts`\n * (`DEFAULT_THEME_CONFIG`) and `erevna-web/src/theme/utils/palette.ts`\n * (`basePalette`). No `typography`/`radii`/`shadows` — the RN theme has no\n * centralized tokens for those today, so they are omitted (nothing to emit →\n * zero visual change).\n *\n * ONE deliberate divergence from that seed (UX-11): `light.textSecondary` is\n * `#717171`, not the app's `#777777`. `#777777` measures 4.48:1 on `#ffffff` and\n * 4.18:1 on the `#f7f7f7` card surface — both under the WCAG AA 4.5:1 floor for\n * normal text, and form-field labels render in this colour. `#717171` measures\n * 4.88:1 and 4.56:1 against those same two surfaces. Do not \"restore\" it to\n * match the app; `presets.contrast.test.ts` will fail if you do. The app's own\n * local preset still carries `#777777` and needs the same fix separately.\n */\nexport const EREVNA_TOKENS: DesignTokens = {\n primary: '#005f73',\n secondary: '#94d2bd',\n accent: '#008d5c',\n\n semantic: {\n success: '#0a9396',\n warning: '#ee9b00',\n error: '#ae2012',\n info: '#005f73',\n },\n\n light: {\n background: '#ffffff',\n surface: '#f7f7f7',\n surfaceElevated: '#ffffff',\n text: '#001219',\n textSecondary: '#717171',\n border: '#e6e6e6',\n divider: '#e6e6e6',\n },\n\n dark: {\n background: '#001219',\n surface: '#052f33',\n surfaceElevated: '#073b40',\n text: '#e9d8a6',\n textSecondary: '#a8a090',\n border: '#053f40',\n divider: '#053f40',\n },\n\n branding: {\n logoContentId: null,\n faviconContentId: null,\n presetId: 'default',\n },\n};\n","import type { DesignTokens } from '../types';\n\n/**\n * Katalogos (online menus — realm `onlinemenu`) tokens.\n *\n * Seeded byte-for-byte from `katalogos-web/src/theme/presets/default.ts`\n * (`DEFAULT_THEME_CONFIG`), which is currently identical to Erevna's default.\n * Kept as a separate preset so the two apps can diverge later without touching\n * the other.\n *\n * ONE deliberate divergence from that seed (UX-11): `light.textSecondary` is\n * `#717171`, not the app's `#777777`. `#777777` measures 4.48:1 on `#ffffff` and\n * 4.18:1 on the `#f7f7f7` card surface — both under the WCAG AA 4.5:1 floor for\n * normal text, and form-field labels render in this colour. `#717171` measures\n * 4.88:1 and 4.56:1 against those same two surfaces. Do not \"restore\" it to\n * match the app; `presets.contrast.test.ts` will fail if you do. The app's own\n * local preset still carries `#777777` and needs the same fix separately.\n */\nexport const KATALOGOS_TOKENS: DesignTokens = {\n primary: '#005f73',\n secondary: '#94d2bd',\n accent: '#008d5c',\n\n semantic: {\n success: '#0a9396',\n warning: '#ee9b00',\n error: '#ae2012',\n info: '#005f73',\n },\n\n light: {\n background: '#ffffff',\n surface: '#f7f7f7',\n surfaceElevated: '#ffffff',\n text: '#001219',\n textSecondary: '#717171',\n border: '#e6e6e6',\n divider: '#e6e6e6',\n },\n\n dark: {\n background: '#001219',\n surface: '#052f33',\n surfaceElevated: '#073b40',\n text: '#e9d8a6',\n textSecondary: '#a8a090',\n border: '#053f40',\n divider: '#053f40',\n },\n\n branding: {\n logoContentId: null,\n faviconContentId: null,\n presetId: 'default',\n },\n};\n","import type { DesignTokens } from '../types';\n\nimport { AML_TOKENS } from './aml';\nimport { DIGITALKIN_TOKENS } from './digitalkin';\nimport { EREVNA_TOKENS } from './erevna';\nimport { KATALOGOS_TOKENS } from './katalogos';\n\nexport { AML_TOKENS } from './aml';\nexport { DIGITALKIN_TOKENS } from './digitalkin';\nexport { EREVNA_TOKENS } from './erevna';\nexport { KATALOGOS_TOKENS } from './katalogos';\n\n/** Every shipped app preset keyed by app slug. */\nexport const PRESETS: Readonly<Record<string, DesignTokens>> = {\n aml: AML_TOKENS,\n erevna: EREVNA_TOKENS,\n katalogos: KATALOGOS_TOKENS,\n digitalkin: DIGITALKIN_TOKENS,\n};\n","/**\n * WCAG 2.1 contrast-ratio maths.\n *\n * Exists so every packaged preset can be *proved* accessible instead of\n * eyeballed. `presets/presets.contrast.test.ts` uses it as a permanent guard:\n * any future edit to a text-role colour that drops it under the AA floor fails\n * the build.\n *\n * This is a deliberate COPY of the same function in `@dloizides/theme-web`, not\n * an import. `@dloizides/design-tokens` ships zero dependencies and zero peers\n * by design — it is framework-agnostic values only — so taking a dependency on\n * a React theming package to borrow ~60 lines of pure arithmetic would invert\n * the layering (theme-web already depends on this package). The duplication is\n * bounded, pure, and pinned by `contrast.test.ts` against external reference\n * pairs, so the two copies cannot silently disagree.\n *\n * The relative-luminance formula is the real one from WCAG 2.1 §\"relative\n * luminance\" — sRGB channels are linearized through the gamma transfer function\n * before the ITU-R BT.709 weighting. A naive channel average (or an HSL\n * lightness comparison) is NOT equivalent and will silently pass colours that\n * fail in a browser, which is exactly how `#777777` shipped at 4.48:1.\n *\n * @see https://www.w3.org/TR/WCAG21/#dfn-relative-luminance\n * @see https://www.w3.org/TR/WCAG21/#dfn-contrast-ratio\n */\n\n/** WCAG 1.4.3 Contrast (Minimum), AA, normal-size text. */\nexport const AA_NORMAL_TEXT_RATIO = 4.5;\n/** WCAG 1.4.3 AA for large text (>=18.66px bold, or >=24px). */\nexport const AA_LARGE_TEXT_RATIO = 3;\n/** WCAG 1.4.11 Non-text Contrast — UI-component boundaries and graphical objects. */\nexport const AA_NON_TEXT_RATIO = 3;\n\nconst SRGB_CHANNEL_MAX = 255;\nconst GAMMA_LINEAR_THRESHOLD = 0.03928;\nconst GAMMA_LINEAR_DIVISOR = 12.92;\nconst GAMMA_OFFSET = 0.055;\nconst GAMMA_DIVISOR = 1.055;\nconst GAMMA_EXPONENT = 2.4;\n\n// ITU-R BT.709 luma coefficients, per the WCAG relative-luminance definition.\nconst LUMA_COEFFICIENT_RED = 0.2126;\nconst LUMA_COEFFICIENT_GREEN = 0.7152;\nconst LUMA_COEFFICIENT_BLUE = 0.0722;\n\n/** The +0.05 flare constant in the WCAG contrast-ratio formula. */\nconst CONTRAST_FLARE = 0.05;\n\nconst HEX_RADIX = 16;\nconst HEX_PAIR_LENGTH = 2;\nconst HEX_SHORTHAND_LENGTH = 3;\nconst HEX_FULL_LENGTH = 6;\nconst CHANNEL_OFFSET_RED = 0;\nconst CHANNEL_OFFSET_GREEN = 2;\nconst CHANNEL_OFFSET_BLUE = 4;\n\n/** Strip `#` and expand `#abc` to `aabbcc`, so both notations parse identically. */\nfunction normalizeHexDigits(hex: string): string {\n const clean = hex.trim().replace('#', '').toLowerCase();\n if (clean.length === HEX_SHORTHAND_LENGTH) {\n return `${clean[0] ?? ''}${clean[0] ?? ''}${clean[1] ?? ''}${clean[1] ?? ''}${clean[2] ?? ''}${clean[2] ?? ''}`;\n }\n return clean;\n}\n\nfunction parseChannel(digits: string, offset: number): number {\n const pair = digits.slice(offset, offset + HEX_PAIR_LENGTH);\n return parseInt(pair, HEX_RADIX) / SRGB_CHANNEL_MAX;\n}\n\n/** Undo the sRGB gamma transfer function for one 0-1 channel. */\nfunction linearizeChannel(channel: number): number {\n if (channel <= GAMMA_LINEAR_THRESHOLD) {\n return channel / GAMMA_LINEAR_DIVISOR;\n }\n return Math.pow((channel + GAMMA_OFFSET) / GAMMA_DIVISOR, GAMMA_EXPONENT);\n}\n\n/**\n * True when `value` is an `#rgb` / `#rrggbb` colour this module can score.\n *\n * Tokens may legitimately hold `rgba()` (AML's dark border is a white overlay),\n * which has no fixed luminance without knowing the backdrop. The guard uses this\n * to EXCLUDE such values explicitly rather than let them throw or, worse, be\n * silently skipped.\n */\nexport function isHexColor(value: string): boolean {\n const digits = normalizeHexDigits(value);\n return digits.length === HEX_FULL_LENGTH && /^[0-9a-f]{6}$/.test(digits);\n}\n\n/**\n * WCAG relative luminance (0 = black, 1 = white) of an `#rgb` / `#rrggbb` colour.\n *\n * @throws if the value is not a parseable hex colour — a typo must be loud, not\n * silently scored as black (which would make every ratio look compliant).\n */\nexport function relativeLuminance(hex: string): number {\n if (!isHexColor(hex)) {\n throw new Error(`relativeLuminance: not a hex colour: ${hex}`);\n }\n const digits = normalizeHexDigits(hex);\n\n const red = linearizeChannel(parseChannel(digits, CHANNEL_OFFSET_RED));\n const green = linearizeChannel(parseChannel(digits, CHANNEL_OFFSET_GREEN));\n const blue = linearizeChannel(parseChannel(digits, CHANNEL_OFFSET_BLUE));\n\n return (\n LUMA_COEFFICIENT_RED * red +\n LUMA_COEFFICIENT_GREEN * green +\n LUMA_COEFFICIENT_BLUE * blue\n );\n}\n\n/**\n * WCAG contrast ratio between two colours, in the range 1 (identical) to 21\n * (black on white). Order-independent.\n */\nexport function contrastRatio(foreground: string, background: string): number {\n const first = relativeLuminance(foreground);\n const second = relativeLuminance(background);\n const lighter = Math.max(first, second);\n const darker = Math.min(first, second);\n return (lighter + CONTRAST_FLARE) / (darker + CONTRAST_FLARE);\n}\n\n/** True when `foreground` on `background` meets `requiredRatio`. */\nexport function meetsContrast(\n foreground: string,\n background: string,\n requiredRatio: number,\n): boolean {\n return contrastRatio(foreground, background) >= requiredRatio;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/varNames.ts","../src/contrast.ts","../src/onBrand.ts","../src/emit/toCssVars.ts","../src/emit/toRnTheme.ts","../src/emit/toTailwindPreset.ts","../src/emit/toUiTheme.ts","../src/presets/aml.ts","../src/presets/digitalkin.ts","../src/presets/erevna.ts","../src/presets/katalogos.ts","../src/presets/index.ts","../src/finregModules.ts"],"names":[],"mappings":";AAuGO,IAAM,qBAAA,GAAqC;AAAA,EAChD,OAAA,EAAS,WAAA;AAAA,EACT,SAAA,EAAW,aAAA;AAAA,EACX,MAAA,EAAQ,UAAA;AAAA,EACR,OAAA,EAAS,YAAA;AAAA,EACT,OAAA,EAAS,WAAA;AAAA,EACT,OAAA,EAAS,WAAA;AAAA,EACT,KAAA,EAAO,SAAA;AAAA,EACP,IAAA,EAAM,QAAA;AAAA,EACN,SAAA,EAAW,cAAA;AAAA,EACX,SAAA,EAAW,cAAA;AAAA,EACX,OAAA,EAAS,YAAA;AAAA,EAC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EAAQ,SAAA;AAAA,IACR,OAAA,EAAS;AAAA,GACX;AAAA,EAEA,IAAA,EAAM;AAAA,IACJ,UAAA,EAAY,SAAA;AAAA,IACZ,OAAA,EAAS,SAAA;AAAA,IACT,eAAA,EAAiB,SAAA;AAAA,IACjB,IAAA,EAAM,SAAA;AAAA,IACN,aAAA,EAAe,SAAA;AAAA,IACf,MAAA,EAAQ,SAAA;AAAA,IACR,OAAA,EAAS;AAAA,GACX;AAAA,EAEA,QAAA,EAAU;AAAA,IACR,aAAA,EAAe,IAAA;AAAA,IACf,gBAAA,EAAkB,IAAA;AAAA,IAClB,QAAA,EAAU;AAAA;AAEd;;;AC1CO,IAAM,OAAA,GAAkD;AAAA,EAC7D,GAAA,EAAK,UAAA;AAAA,EACL,MAAA,EAAQ,aAAA;AAAA,EACR,SAAA,EAAW,gBAAA;AAAA,EACX,UAAA,EAAY;AACd;;;ACQO,IAAM,oBAAA,GAA2C;AAAA,EACtD,QAAA,EAAU;AAAA;AAAA,IAER,IAAA,EAAM,SAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,UAAA,EAAY;AAAA;AAAA,IAEV,IAAA,EAAM,SAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,GAAA,EAAK;AAAA;AAAA,IAEH,IAAA,EAAM,SAAA;AAAA,IACN,OAAA,EAAS;AAAA;AAEb","file":"index.mjs","sourcesContent":["/**\n * CSS custom-property NAME MAPS — the cross-stack naming contract.\n *\n * `toCssVars(tokens, names)` reads a {@link DesignTokens} and a {@link CssVarNames}\n * map that says which CSS variable each token field is emitted as. A field whose\n * name is `undefined` in the map is skipped, which lets a stack emit only the\n * variables it actually consumes.\n *\n * Two maps ship:\n * - {@link DEFAULT_CSS_VAR_NAMES} — canonical kebab names (`--primary`, `--bg`, …).\n * The dark-mode fields have names, so a dark-mode block is emitted.\n * - {@link AML_CSS_VAR_NAMES} — the vanilla-JS AML console's existing variable\n * names (`--brand`, `--shell`, `--ok`, `--r`, …), so `wwwroot/shared/ui.css`\n * keeps working byte-for-byte. Core fields that AML expresses via an extension\n * variable are mapped to `undefined` (skipped) to avoid emitting duplicates,\n * and the dark-mode fields are `undefined` (AML has no light/dark toggle — its\n * dark app-shell is captured in the `shell*` extension inside `:root`).\n */\n\n/** Maps each {@link DesignTokens} field to the CSS variable it is emitted as (or `undefined` to skip). */\nexport interface CssVarNames {\n // brand\n primary?: string;\n secondary?: string;\n accent?: string;\n onBrand?: string;\n // semantic\n success?: string;\n warning?: string;\n error?: string;\n info?: string;\n // semantic background tints\n successBg?: string;\n warningBg?: string;\n errorBg?: string;\n infoBg?: string;\n // light-mode colours (emitted in :root)\n lightBackground?: string;\n lightSurface?: string;\n lightSurfaceElevated?: string;\n lightSurfaceMuted?: string;\n lightText?: string;\n lightTextSecondary?: string;\n lightBorder?: string;\n lightDivider?: string;\n // dark-mode colours (emitted in the dark selector block; omit all to skip the block)\n darkBackground?: string;\n darkSurface?: string;\n darkSurfaceElevated?: string;\n darkSurfaceMuted?: string;\n darkText?: string;\n darkTextSecondary?: string;\n darkBorder?: string;\n darkDivider?: string;\n // radii\n radiusXs?: string;\n radiusSm?: string;\n radiusMd?: string;\n radiusLg?: string;\n radiusPill?: string;\n // shadows\n shadowSm?: string;\n shadowMd?: string;\n shadowPop?: string;\n // fonts\n fontFamily?: string;\n monoFamily?: string;\n // extensions — shell\n shellBackground?: string;\n shellBackgroundAlt?: string;\n shellLine?: string;\n shellOn?: string;\n shellOnDim?: string;\n // extensions — brand extras\n brandPress?: string;\n brandSoft?: string;\n brandRing?: string;\n // extensions — ink scale\n inkBase?: string;\n inkSoft?: string;\n inkFaint?: string;\n inkOverlay?: string;\n // extensions — workspace extras\n surfaceAlt?: string;\n lineStrong?: string;\n // extensions — verdict palette\n ok?: string;\n okSoft?: string;\n okInk?: string;\n warn?: string;\n warnSoft?: string;\n warnInk?: string;\n bad?: string;\n badSoft?: string;\n badSoft2?: string;\n badInk?: string;\n}\n\n/**\n * Canonical kebab-case variable names. A stack with no existing CSS-variable\n * convention (or a fresh consumer) should adopt these. Extension fields are\n * omitted because the RN/DOM presets carry no extensions.\n */\nexport const DEFAULT_CSS_VAR_NAMES: CssVarNames = {\n primary: '--primary',\n secondary: '--secondary',\n accent: '--accent',\n onBrand: '--on-brand',\n success: '--success',\n warning: '--warning',\n error: '--error',\n info: '--info',\n successBg: '--success-bg',\n warningBg: '--warning-bg',\n errorBg: '--error-bg',\n infoBg: '--info-bg',\n lightBackground: '--background',\n lightSurface: '--surface',\n lightSurfaceElevated: '--surface-elevated',\n lightSurfaceMuted: '--surface-muted',\n lightText: '--text',\n lightTextSecondary: '--text-secondary',\n lightBorder: '--border',\n lightDivider: '--divider',\n darkBackground: '--background',\n darkSurface: '--surface',\n darkSurfaceElevated: '--surface-elevated',\n darkSurfaceMuted: '--surface-muted',\n darkText: '--text',\n darkTextSecondary: '--text-secondary',\n darkBorder: '--border',\n darkDivider: '--divider',\n radiusXs: '--radius-xs',\n radiusSm: '--radius-sm',\n radiusMd: '--radius',\n radiusLg: '--radius-lg',\n radiusPill: '--radius-pill',\n shadowSm: '--shadow-sm',\n shadowMd: '--shadow',\n shadowPop: '--shadow-pop',\n fontFamily: '--font',\n monoFamily: '--font-mono',\n};\n\n/**\n * The AML console's existing `wwwroot/shared/ui.css` variable names. Emitting the\n * `aml` preset with this map reproduces AML's current `:root` byte-for-byte, so\n * ui.css keeps working with zero visual change.\n *\n * Core fields that AML already expresses through an extension variable are mapped\n * to `undefined` to avoid duplicate declarations:\n * - `secondary`/`accent` — AML has a single brand; ui.css never reads them.\n * - `success`/`warning`/`error`/`info` — emitted via the verdict extension\n * (`--ok`/`--warn`/`--bad`); `info` has no AML variable.\n * - `light.surfaceElevated` → via `workspace.surfaceAlt` (`--surface-2`).\n * - `light.text` → via `ink.base` (`--ink`); `light.textSecondary` → `ink.soft`.\n * - `light.divider` — AML reuses `--line`, so no separate variable.\n * - all `dark*` — AML has no dark-mode toggle (its shell lives in the extension).\n */\nexport const AML_CSS_VAR_NAMES: CssVarNames = {\n primary: '--brand',\n // secondary/accent intentionally omitted (single-brand console)\n // semantic emitted via verdict extension; info has no AML variable\n lightBackground: '--bg',\n lightSurface: '--surface',\n // lightSurfaceElevated via workspace.surfaceAlt (--surface-2)\n // lightText via ink.base (--ink); lightTextSecondary via ink.soft (--ink-soft)\n lightBorder: '--line',\n // lightDivider reuses --line\n // dark* omitted (no dark-mode toggle)\n radiusXs: '--r-xs',\n radiusSm: '--r-sm',\n radiusMd: '--r',\n radiusLg: '--r-lg',\n radiusPill: '--r-pill',\n shadowSm: '--sh-1',\n shadowMd: '--sh-2',\n shadowPop: '--sh-pop',\n fontFamily: '--font',\n monoFamily: '--mono',\n shellBackground: '--shell',\n shellBackgroundAlt: '--shell-2',\n shellLine: '--shell-line',\n shellOn: '--on-shell',\n shellOnDim: '--on-shell-dim',\n brandPress: '--brand-press',\n brandSoft: '--brand-soft',\n brandRing: '--brand-ring',\n inkBase: '--ink',\n inkSoft: '--ink-soft',\n inkFaint: '--ink-faint',\n inkOverlay: '--ink-2',\n surfaceAlt: '--surface-2',\n lineStrong: '--line-strong',\n ok: '--ok',\n okSoft: '--ok-soft',\n okInk: '--ok-ink',\n warn: '--warn',\n warnSoft: '--warn-soft',\n warnInk: '--warn-ink',\n bad: '--bad',\n badSoft: '--bad-soft',\n badSoft2: '--bad-soft2',\n badInk: '--bad-ink',\n};\n","/**\n * WCAG 2.1 contrast-ratio maths.\n *\n * Exists so every packaged preset can be *proved* accessible instead of\n * eyeballed. `presets/presets.contrast.test.ts` uses it as a permanent guard:\n * any future edit to a text-role colour that drops it under the AA floor fails\n * the build.\n *\n * This is a deliberate COPY of the same function in `@dloizides/theme-web`, not\n * an import. `@dloizides/design-tokens` ships zero dependencies and zero peers\n * by design — it is framework-agnostic values only — so taking a dependency on\n * a React theming package to borrow ~60 lines of pure arithmetic would invert\n * the layering (theme-web already depends on this package). The duplication is\n * bounded, pure, and pinned by `contrast.test.ts` against external reference\n * pairs, so the two copies cannot silently disagree.\n *\n * The relative-luminance formula is the real one from WCAG 2.1 §\"relative\n * luminance\" — sRGB channels are linearized through the gamma transfer function\n * before the ITU-R BT.709 weighting. A naive channel average (or an HSL\n * lightness comparison) is NOT equivalent and will silently pass colours that\n * fail in a browser, which is exactly how `#777777` shipped at 4.48:1.\n *\n * @see https://www.w3.org/TR/WCAG21/#dfn-relative-luminance\n * @see https://www.w3.org/TR/WCAG21/#dfn-contrast-ratio\n */\n\n/** WCAG 1.4.3 Contrast (Minimum), AA, normal-size text. */\nexport const AA_NORMAL_TEXT_RATIO = 4.5;\n/** WCAG 1.4.3 AA for large text (>=18.66px bold, or >=24px). */\nexport const AA_LARGE_TEXT_RATIO = 3;\n/** WCAG 1.4.11 Non-text Contrast — UI-component boundaries and graphical objects. */\nexport const AA_NON_TEXT_RATIO = 3;\n\nconst SRGB_CHANNEL_MAX = 255;\nconst GAMMA_LINEAR_THRESHOLD = 0.03928;\nconst GAMMA_LINEAR_DIVISOR = 12.92;\nconst GAMMA_OFFSET = 0.055;\nconst GAMMA_DIVISOR = 1.055;\nconst GAMMA_EXPONENT = 2.4;\n\n// ITU-R BT.709 luma coefficients, per the WCAG relative-luminance definition.\nconst LUMA_COEFFICIENT_RED = 0.2126;\nconst LUMA_COEFFICIENT_GREEN = 0.7152;\nconst LUMA_COEFFICIENT_BLUE = 0.0722;\n\n/** The +0.05 flare constant in the WCAG contrast-ratio formula. */\nconst CONTRAST_FLARE = 0.05;\n\nconst HEX_RADIX = 16;\nconst HEX_PAIR_LENGTH = 2;\nconst HEX_SHORTHAND_LENGTH = 3;\nconst HEX_FULL_LENGTH = 6;\nconst CHANNEL_OFFSET_RED = 0;\nconst CHANNEL_OFFSET_GREEN = 2;\nconst CHANNEL_OFFSET_BLUE = 4;\n\n/** Strip `#` and expand `#abc` to `aabbcc`, so both notations parse identically. */\nfunction normalizeHexDigits(hex: string): string {\n const clean = hex.trim().replace('#', '').toLowerCase();\n if (clean.length === HEX_SHORTHAND_LENGTH) {\n return `${clean[0] ?? ''}${clean[0] ?? ''}${clean[1] ?? ''}${clean[1] ?? ''}${clean[2] ?? ''}${clean[2] ?? ''}`;\n }\n return clean;\n}\n\nfunction parseChannel(digits: string, offset: number): number {\n const pair = digits.slice(offset, offset + HEX_PAIR_LENGTH);\n return parseInt(pair, HEX_RADIX) / SRGB_CHANNEL_MAX;\n}\n\n/** Undo the sRGB gamma transfer function for one 0-1 channel. */\nfunction linearizeChannel(channel: number): number {\n if (channel <= GAMMA_LINEAR_THRESHOLD) {\n return channel / GAMMA_LINEAR_DIVISOR;\n }\n return Math.pow((channel + GAMMA_OFFSET) / GAMMA_DIVISOR, GAMMA_EXPONENT);\n}\n\n/**\n * True when `value` is an `#rgb` / `#rrggbb` colour this module can score.\n *\n * Tokens may legitimately hold `rgba()` (AML's dark border is a white overlay),\n * which has no fixed luminance without knowing the backdrop. The guard uses this\n * to EXCLUDE such values explicitly rather than let them throw or, worse, be\n * silently skipped.\n */\nexport function isHexColor(value: string): boolean {\n const digits = normalizeHexDigits(value);\n return digits.length === HEX_FULL_LENGTH && /^[0-9a-f]{6}$/.test(digits);\n}\n\n/**\n * WCAG relative luminance (0 = black, 1 = white) of an `#rgb` / `#rrggbb` colour.\n *\n * @throws if the value is not a parseable hex colour — a typo must be loud, not\n * silently scored as black (which would make every ratio look compliant).\n */\nexport function relativeLuminance(hex: string): number {\n if (!isHexColor(hex)) {\n throw new Error(`relativeLuminance: not a hex colour: ${hex}`);\n }\n const digits = normalizeHexDigits(hex);\n\n const red = linearizeChannel(parseChannel(digits, CHANNEL_OFFSET_RED));\n const green = linearizeChannel(parseChannel(digits, CHANNEL_OFFSET_GREEN));\n const blue = linearizeChannel(parseChannel(digits, CHANNEL_OFFSET_BLUE));\n\n return (\n LUMA_COEFFICIENT_RED * red +\n LUMA_COEFFICIENT_GREEN * green +\n LUMA_COEFFICIENT_BLUE * blue\n );\n}\n\n/**\n * WCAG contrast ratio between two colours, in the range 1 (identical) to 21\n * (black on white). Order-independent.\n */\nexport function contrastRatio(foreground: string, background: string): number {\n const first = relativeLuminance(foreground);\n const second = relativeLuminance(background);\n const lighter = Math.max(first, second);\n const darker = Math.min(first, second);\n return (lighter + CONTRAST_FLARE) / (darker + CONTRAST_FLARE);\n}\n\n/** True when `foreground` on `background` meets `requiredRatio`. */\nexport function meetsContrast(\n foreground: string,\n background: string,\n requiredRatio: number,\n): boolean {\n return contrastRatio(foreground, background) >= requiredRatio;\n}\n","/**\n * DERIVE the foreground that sits on a brand-filled surface, instead of\n * defaulting it to white.\n *\n * WHY THIS EXISTS\n * ---------------\n * This package already shipped the WCAG maths (`contrast.ts`) and an optional\n * `onBrand` slot, and it still shipped a live AA failure: white on `#38bdf8` at\n * **2.14:1** on a production primary button. The slot was optional *with a white\n * default*, so the safe path required opting in and the default was the failing\n * one. An optional safety feature with an unsafe default is not a safety\n * feature — it is a trap that reads as protection in review.\n *\n * The same pair was then hand-patched five separate times across the codebase\n * (three IdentityService controllers, one of them inside a verification EMAIL\n * where CSS cannot be patched after sending, plus `wwwroot/signin/`). One of\n * those patches carries the comment \"See AccountController for the same pair\" —\n * a code comment doing a shared token's job. That is the recurrence this module\n * ends: the correct value is now what you get by doing nothing.\n *\n * WHY DERIVATION AND NOT A REQUIRED FIELD\n * ---------------------------------------\n * Making `onBrand` required would be a compile-time break for every consumer and\n * every preset author on a published, adopted interface — and it would push the\n * decision back onto exactly the caller who already got it wrong five times.\n * Derivation is non-breaking, and it fixes the DEFAULT, which is where the\n * defect actually lives. The explicit slot is kept (see `explicit` below) so an\n * author who has a considered brand ink can still state it; it is honoured, and\n * the preset guard measures it rather than trusting it.\n *\n * THE TWO CANDIDATE INKS\n * ----------------------\n * A brand fill in this system is always either light enough to want dark ink or\n * dark enough to want light ink, so two candidates cover the space:\n * measured against `#38bdf8`, dark ink scores **8.83:1** where white scores\n * 2.14:1. Note that even the \"deep\" brand blue `#0284c7` fails with white\n * (4.10:1) — picking a darker brand is NOT a reliable fix, which is why the\n * FOREGROUND has to be the derived half of the pair.\n */\nimport { AA_NORMAL_TEXT_RATIO, contrastRatio, isHexColor } from './contrast';\n\n/**\n * Light ink for a dark/saturated brand fill. Also the last-resort value when the\n * brand colour is not a measurable hex (see {@link resolveOnBrand}).\n */\nexport const ON_BRAND_LIGHT_INK = '#ffffff';\n\n/**\n * Dark ink for a pale brand fill.\n *\n * Not pure black: a near-black navy carries the brand's own hue, so a pale-blue\n * button reads as designed rather than as a default. Measured 8.83:1 on\n * `#38bdf8` and 9.98:1 on `#FFAB00`.\n */\nexport const ON_BRAND_DARK_INK = '#03121f';\n\n/**\n * The best available foreground for content sitting ON `background`.\n *\n * Resolution order:\n * 1. `explicit` — an author's stated brand ink is honoured as given. It is NOT\n * silently replaced, because overriding a deliberate design decision behind\n * the author's back is its own class of bug; the preset contrast guard\n * measures it instead, so a bad explicit value fails CI rather than shipping.\n * 2. A non-hex `background` (e.g. `rgba()`) has no fixed luminance without\n * knowing what it composites over, so no ratio can be computed. Returns\n * {@link ON_BRAND_LIGHT_INK} as an unavoidable last resort — documented and\n * pinned by a test, rather than being the unexamined default for everything.\n * 3. Otherwise the higher-contrast of the two candidate inks, measured with the\n * WCAG 2.1 maths in `contrast.ts`.\n *\n * Exported from the package root so consumers that let USERS supply a brand\n * colour at runtime (per-tenant branding endpoints) can derive the matching\n * foreground with the same maths that guards the shipped presets — the runtime\n * path is how an AA failure re-enters a codebase whose static presets all pass.\n */\nexport function resolveOnBrand(background: string, explicit?: string): string {\n if (explicit !== undefined) {\n return explicit;\n }\n if (!isHexColor(background)) {\n return ON_BRAND_LIGHT_INK;\n }\n const lightRatio = contrastRatio(ON_BRAND_LIGHT_INK, background);\n const darkRatio = contrastRatio(ON_BRAND_DARK_INK, background);\n return darkRatio > lightRatio ? ON_BRAND_DARK_INK : ON_BRAND_LIGHT_INK;\n}\n\n/**\n * The contrast ratio the derived foreground achieves on `background`, or `null`\n * when `background` is not measurable.\n *\n * Exists so a consumer can ASSERT the pair rather than assume it. Some brand\n * colours cannot carry an AA foreground in either direction — `#008d5c` peaks at\n * 4.47:1 against its best ink — and the only honest answer there is the number,\n * not a boolean that rounds a near-miss up to \"compliant\".\n */\nexport function onBrandRatio(background: string, explicit?: string): number | null {\n if (!isHexColor(background)) {\n return null;\n }\n const foreground = resolveOnBrand(background, explicit);\n if (!isHexColor(foreground)) {\n return null;\n }\n return contrastRatio(foreground, background);\n}\n\n/**\n * True when `background` can carry an AA-passing foreground at all.\n *\n * A brand colour in the mid-luminance band fails against BOTH inks. Such a\n * colour is not fixable by choosing a better foreground — it needs the fill\n * itself to move — so this distinguishes \"we picked the wrong ink\" from \"no ink\n * works\", which are different bugs with different owners.\n */\nexport function canCarryAccessibleInk(background: string): boolean {\n const ratio = onBrandRatio(background);\n return ratio !== null && ratio >= AA_NORMAL_TEXT_RATIO;\n}\n","import { resolveOnBrand } from '../onBrand';\nimport type { DesignTokens } from '../types';\nimport type { CssVarNames } from '../varNames';\n\n/** Options for {@link toCssVars}. */\nexport interface ToCssVarsOptions {\n /**\n * Selector for the dark-mode block. Only used when the name map defines any\n * `dark*` variables. Defaults to `:root[data-theme=\"dark\"]`.\n */\n darkSelector?: string;\n}\n\nconst INDENT = ' ';\nconst DEFAULT_DARK_SELECTOR = ':root[data-theme=\"dark\"]';\n\n/** A single ` --name: value;` line, or `null` when the name or value is absent. */\nfunction declaration(name: string | undefined, value: string | undefined): string | null {\n if (name === undefined || value === undefined) {\n return null;\n }\n return `${INDENT}${name}: ${value};`;\n}\n\nfunction isLine(entry: string | null): entry is string {\n return entry !== null;\n}\n\nfunction block(selector: string, lines: readonly string[]): string {\n return `${selector} {\\n${lines.join('\\n')}\\n}`;\n}\n\n/**\n * Emit a {@link DesignTokens} as CSS custom properties. Base tokens (brand,\n * semantic, light-mode, radii, shadows, fonts and any extensions) go in a\n * `:root {}` block; dark-mode tokens go in a separate selector block, emitted\n * only when the name map defines at least one `dark*` variable.\n */\nexport function toCssVars(\n tokens: DesignTokens,\n names: CssVarNames,\n options?: ToCssVarsOptions,\n): string {\n const ext = tokens.extensions;\n const baseEntries: Array<string | null> = [\n declaration(names.primary, tokens.primary),\n declaration(names.secondary, tokens.secondary),\n declaration(names.accent, tokens.accent),\n // Always emitted (when the name map asks for it), never skipped: a missing\n // `--on-brand` sends the stylesheet to its own hardcoded fallback, which is\n // how white-on-pale-brand reached production in the first place.\n declaration(names.onBrand, resolveOnBrand(tokens.primary, tokens.onBrand)),\n declaration(names.success, tokens.semantic.success),\n declaration(names.warning, tokens.semantic.warning),\n declaration(names.error, tokens.semantic.error),\n declaration(names.info, tokens.semantic.info),\n declaration(names.successBg, tokens.semantic.successBg),\n declaration(names.warningBg, tokens.semantic.warningBg),\n declaration(names.errorBg, tokens.semantic.errorBg),\n declaration(names.infoBg, tokens.semantic.infoBg),\n declaration(names.lightBackground, tokens.light.background),\n declaration(names.lightSurface, tokens.light.surface),\n declaration(names.lightSurfaceElevated, tokens.light.surfaceElevated),\n declaration(names.lightSurfaceMuted, tokens.light.surfaceMuted),\n declaration(names.lightText, tokens.light.text),\n declaration(names.lightTextSecondary, tokens.light.textSecondary),\n declaration(names.lightBorder, tokens.light.border),\n declaration(names.lightDivider, tokens.light.divider),\n declaration(names.radiusXs, tokens.radii?.xs),\n declaration(names.radiusSm, tokens.radii?.sm),\n declaration(names.radiusMd, tokens.radii?.md),\n declaration(names.radiusLg, tokens.radii?.lg),\n declaration(names.radiusPill, tokens.radii?.pill),\n declaration(names.shadowSm, tokens.shadows?.sm),\n declaration(names.shadowMd, tokens.shadows?.md),\n declaration(names.shadowPop, tokens.shadows?.pop),\n declaration(names.fontFamily, tokens.typography?.fontFamily),\n declaration(names.monoFamily, tokens.typography?.monoFamily),\n declaration(names.shellBackground, ext?.shell?.background),\n declaration(names.shellBackgroundAlt, ext?.shell?.backgroundAlt),\n declaration(names.shellLine, ext?.shell?.line),\n declaration(names.shellOn, ext?.shell?.on),\n declaration(names.shellOnDim, ext?.shell?.onDim),\n declaration(names.brandPress, ext?.brand?.press),\n declaration(names.brandSoft, ext?.brand?.soft),\n declaration(names.brandRing, ext?.brand?.ring),\n declaration(names.inkBase, ext?.ink?.base),\n declaration(names.inkSoft, ext?.ink?.soft),\n declaration(names.inkFaint, ext?.ink?.faint),\n declaration(names.inkOverlay, ext?.ink?.overlay),\n declaration(names.surfaceAlt, ext?.workspace?.surfaceAlt),\n declaration(names.lineStrong, ext?.workspace?.lineStrong),\n declaration(names.ok, ext?.verdict?.ok),\n declaration(names.okSoft, ext?.verdict?.okSoft),\n declaration(names.okInk, ext?.verdict?.okInk),\n declaration(names.warn, ext?.verdict?.warn),\n declaration(names.warnSoft, ext?.verdict?.warnSoft),\n declaration(names.warnInk, ext?.verdict?.warnInk),\n declaration(names.bad, ext?.verdict?.bad),\n declaration(names.badSoft, ext?.verdict?.badSoft),\n declaration(names.badSoft2, ext?.verdict?.badSoft2),\n declaration(names.badInk, ext?.verdict?.badInk),\n ];\n const baseBlock = block(':root', baseEntries.filter(isLine));\n\n const darkEntries: Array<string | null> = [\n declaration(names.darkBackground, tokens.dark.background),\n declaration(names.darkSurface, tokens.dark.surface),\n declaration(names.darkSurfaceElevated, tokens.dark.surfaceElevated),\n declaration(names.darkSurfaceMuted, tokens.dark.surfaceMuted),\n declaration(names.darkText, tokens.dark.text),\n declaration(names.darkTextSecondary, tokens.dark.textSecondary),\n declaration(names.darkBorder, tokens.dark.border),\n declaration(names.darkDivider, tokens.dark.divider),\n ];\n const darkLines = darkEntries.filter(isLine);\n if (darkLines.length === 0) {\n return baseBlock;\n }\n\n const selector = options?.darkSelector ?? DEFAULT_DARK_SELECTOR;\n return `${baseBlock}\\n\\n${block(selector, darkLines)}`;\n}\n","import type { Branding, DesignTokens, ModeColors } from '../types';\n\n/**\n * The RN-web theme-config shape. Structurally compatible with\n * `@dloizides/tenant-theme-web`'s `TenantThemeConfig` (and each RN app's local\n * `TenantThemeConfig`), so a preset can be dropped in as the `defaultThemeConfig`\n * fallback without any mapping. Semantic and typography are optional (an RN app\n * may leave them unset, exactly as the current `default` preset does).\n */\nexport interface RnThemeConfig {\n primary: string;\n secondary: string;\n accent: string;\n semantic?: { success?: string; warning?: string; error?: string; info?: string };\n light: ModeColors;\n dark: ModeColors;\n typography?: { fontFamily?: string; headingScale?: number };\n branding: Branding;\n}\n\n/**\n * Emit a {@link DesignTokens} as an RN-web `TenantThemeConfig`-compatible object.\n * Only the core fields are projected; the `radii`/`shadows`/`extensions`\n * supersets are intentionally dropped (RN-web has no centralized token for them).\n * `typography` is included only when the preset defines it, so a preset with no\n * typography yields a config with no `typography` key — byte-identical to the RN\n * apps' current `DEFAULT_THEME_CONFIG`.\n */\nexport function toRnTheme(tokens: DesignTokens): RnThemeConfig {\n const config: RnThemeConfig = {\n primary: tokens.primary,\n secondary: tokens.secondary,\n accent: tokens.accent,\n semantic: { ...tokens.semantic },\n light: { ...tokens.light },\n dark: { ...tokens.dark },\n branding: { ...tokens.branding },\n };\n if (tokens.typography !== undefined) {\n config.typography = {\n fontFamily: tokens.typography.fontFamily,\n headingScale: tokens.typography.headingScale,\n };\n }\n return config;\n}\n","import { resolveOnBrand } from '../onBrand';\r\nimport type { DesignTokens } from '../types';\r\n\r\n/** Nested colour scale emitted under `theme.extend.colors`. */\r\nexport interface TailwindColors {\r\n primary: string;\r\n secondary: string;\r\n accent: string;\r\n /**\r\n * The primary's contrast partner. ALWAYS emitted — derived from `primary` when\r\n * the preset declares no `onBrand`, so a consumer's `text-on-brand` utility\r\n * cannot silently resolve to its own white fallback on a pale brand.\r\n */\r\n 'on-brand': string;\r\n success: string;\r\n warning: string;\r\n error: string;\r\n info: string;\r\n /** Status background tints. Emitted only when the preset declares them. */\r\n 'success-bg'?: string;\r\n 'warning-bg'?: string;\r\n 'error-bg'?: string;\r\n 'info-bg'?: string;\r\n background: string;\r\n surface: string;\r\n 'surface-elevated': string;\r\n /** Emitted only when the preset declares `light.surfaceMuted`. */\r\n 'surface-muted'?: string;\r\n text: string;\r\n 'text-secondary': string;\r\n border: string;\r\n divider: string;\r\n dark: {\r\n background: string;\r\n surface: string;\r\n 'surface-elevated': string;\r\n /** Emitted only when the preset declares `dark.surfaceMuted`. */\r\n 'surface-muted'?: string;\r\n text: string;\r\n 'text-secondary': string;\r\n border: string;\r\n divider: string;\r\n };\r\n}\r\n\r\n/** A Tailwind preset object: `{ theme: { extend: { … } } }`. Spread into a `tailwind.config`'s `presets`. */\r\nexport interface TailwindPreset {\r\n theme: {\r\n extend: {\r\n colors: TailwindColors;\r\n borderRadius?: Record<string, string>;\r\n boxShadow?: Record<string, string>;\r\n fontFamily?: Record<string, string[]>;\r\n };\r\n };\r\n}\r\n\r\n/**\r\n * Add the optional colour tokens, each only when the preset declares it — so a\r\n * preset that predates these slots emits a byte-identical colour object.\r\n */\r\nfunction addOptionalColors(colors: TailwindColors, tokens: DesignTokens): void {\r\n const { semantic } = tokens;\r\n if (semantic.successBg !== undefined) {\r\n colors['success-bg'] = semantic.successBg;\r\n }\r\n if (semantic.warningBg !== undefined) {\r\n colors['warning-bg'] = semantic.warningBg;\r\n }\r\n if (semantic.errorBg !== undefined) {\r\n colors['error-bg'] = semantic.errorBg;\r\n }\r\n if (semantic.infoBg !== undefined) {\r\n colors['info-bg'] = semantic.infoBg;\r\n }\r\n if (tokens.light.surfaceMuted !== undefined) {\r\n colors['surface-muted'] = tokens.light.surfaceMuted;\r\n }\r\n if (tokens.dark.surfaceMuted !== undefined) {\r\n colors.dark['surface-muted'] = tokens.dark.surfaceMuted;\r\n }\r\n}\r\n\r\n/**\r\n * Emit a {@link DesignTokens} as a Tailwind preset for the DOM-React ThemeStudio.\r\n * The core colours are always present; the optional colour slots,\r\n * `borderRadius`/`boxShadow`/`fontFamily` are emitted only when the preset\r\n * defines the corresponding token.\r\n */\r\nexport function toTailwindPreset(tokens: DesignTokens): TailwindPreset {\r\n const colors: TailwindColors = {\r\n primary: tokens.primary,\r\n secondary: tokens.secondary,\r\n accent: tokens.accent,\r\n 'on-brand': resolveOnBrand(tokens.primary, tokens.onBrand),\r\n success: tokens.semantic.success,\r\n warning: tokens.semantic.warning,\r\n error: tokens.semantic.error,\r\n info: tokens.semantic.info,\r\n background: tokens.light.background,\r\n surface: tokens.light.surface,\r\n 'surface-elevated': tokens.light.surfaceElevated,\r\n text: tokens.light.text,\r\n 'text-secondary': tokens.light.textSecondary,\r\n border: tokens.light.border,\r\n divider: tokens.light.divider,\r\n dark: {\r\n background: tokens.dark.background,\r\n surface: tokens.dark.surface,\r\n 'surface-elevated': tokens.dark.surfaceElevated,\r\n text: tokens.dark.text,\r\n 'text-secondary': tokens.dark.textSecondary,\r\n border: tokens.dark.border,\r\n divider: tokens.dark.divider,\r\n },\r\n };\r\n addOptionalColors(colors, tokens);\r\n\r\n const extend: TailwindPreset['theme']['extend'] = { colors };\r\n\r\n if (tokens.radii !== undefined) {\r\n extend.borderRadius = {\r\n xs: tokens.radii.xs,\r\n sm: tokens.radii.sm,\r\n DEFAULT: tokens.radii.md,\r\n lg: tokens.radii.lg,\r\n pill: tokens.radii.pill,\r\n };\r\n }\r\n if (tokens.shadows !== undefined) {\r\n extend.boxShadow = {\r\n sm: tokens.shadows.sm,\r\n DEFAULT: tokens.shadows.md,\r\n pop: tokens.shadows.pop,\r\n };\r\n }\r\n if (tokens.typography !== undefined) {\r\n const fontFamily: Record<string, string[]> = { sans: [tokens.typography.fontFamily] };\r\n if (tokens.typography.monoFamily !== undefined) {\r\n fontFamily.mono = [tokens.typography.monoFamily];\r\n }\r\n extend.fontFamily = fontFamily;\r\n }\r\n\r\n return { theme: { extend } };\r\n}\r\n","/**\n * Emit a {@link DesignTokens} as the shared RN UI kit's theme object — the value\n * `@dloizides/ui-feedback`'s `UiProvider` broadcasts and every kit component\n * (NavShell, DataTable, Filters, Pager, StatusBadge, ThemedTextInput, StatCard)\n * reads via `useUi()`.\n *\n * WHY THIS LIVES HERE\n * -------------------\n * Two apps (ichnos, kefi) independently wrote the same adapter, and both hit the\n * same wall: a naive projection assigns ONE value to every step of a scale, which\n * silently discards the deeper brand step and the status background tints. Each\n * then bolted a private overlay onto the result to smuggle the lost values into\n * free slots. That overlay is this function, done twice — so it belongs in the\n * token package, where the token shape that lost the values is defined.\n *\n * The emitted theme is a LOSSLESS carrier: every token the shape can express has\n * an addressable slot, so an app can round-trip its whole palette back out\n * (see the `*Colors` accessors in each app) instead of keeping a parallel static\n * copy that cannot follow a dark-mode toggle or a per-tenant brand.\n *\n * The type is declared structurally here rather than imported, exactly as\n * {@link RnThemeConfig} declares the `TenantThemeConfig` shape: this package\n * stays framework-agnostic and takes no dependency on the kit it feeds.\n */\nimport { resolveOnBrand } from '../onBrand';\nimport type { DesignTokens, ModeColors } from '../types';\n\n/** Flat colour fields the kit reads directly. Mirrors `ui-feedback`'s `FeedbackThemeColors`. */\nexport interface UiThemeColors {\n background: string;\n surface: string;\n surfaceElevated: string;\n text: string;\n textSecondary: string;\n border: string;\n}\n\n/** A colour scale. The `500` step is guaranteed; other steps are addressable. */\nexport interface UiColorScale {\n '500': string;\n [step: string]: string;\n}\n\n/** Brand scales. `primary` is guaranteed; other names are addressable. */\nexport interface UiThemePalette {\n primary: UiColorScale;\n [name: string]: UiColorScale;\n}\n\n/** Status scales. `error` is guaranteed; other names are addressable. */\nexport interface UiThemeSemantic {\n error: UiColorScale;\n [name: string]: UiColorScale;\n}\n\n/** The kit theme. Structurally identical to `@dloizides/ui-feedback`'s `UiTheme`. */\nexport interface UiThemeConfig {\n colors: UiThemeColors;\n palette: UiThemePalette;\n semantic: UiThemeSemantic;\n}\n\n/** Which mode block ({@link DesignTokens.light} / {@link DesignTokens.dark}) to project. */\nexport type UiThemeMode = 'light' | 'dark';\n\n/** The soft/tint step of a scale — status background tints, muted brand fills. */\nexport const UI_TINT_STEP = '100';\n/** The step every shipped kit component reads. */\nexport const UI_MAIN_STEP = '500';\n/** The deep/pressed step of a scale. */\nexport const UI_DEEP_STEP = '700';\n\n/** Palette scale carrying the on-brand foreground. */\nconst ON_BRAND_SCALE = 'onBrand';\n/** Palette scale carrying the muted inset surface. */\nconst SURFACE_MUTED_SCALE = 'surfaceMuted';\n\n/**\n * A colour with no distinct tint or deep variant, expressed as a full scale so\n * every step is addressable and no consumer reads `undefined`.\n */\nfunction flat(value: string): UiColorScale {\n return { [UI_TINT_STEP]: value, [UI_MAIN_STEP]: value, [UI_DEEP_STEP]: value };\n}\n\n/**\n * A status scale: the base at `500`/`700` and its background tint at `100`.\n * Falls back to a flat scale when the preset declares no tint, so behaviour is\n * unchanged for presets that predate the `*Bg` slots.\n */\nfunction tinted(base: string, tint: string | undefined): UiColorScale {\n return { [UI_TINT_STEP]: tint ?? base, [UI_MAIN_STEP]: base, [UI_DEEP_STEP]: base };\n}\n\n/**\n * Project a token set onto the shared kit's theme shape.\n *\n * Every value is carried into an addressable slot:\n * - `palette.primary` / `secondary` / `accent` — the brand scales.\n * - `palette.onBrand` — the primary's contrast partner. DERIVED from `primary`\n * via `resolveOnBrand` when the preset declares no {@link DesignTokens.onBrand},\n * so a pale brand gets dark ink instead of the white that used to be the\n * silent default (and which shipped a 2.14:1 button to production).\n * - `palette.surfaceMuted` — the mode's {@link ModeColors.surfaceMuted}.\n * - `semantic.*` — each status colour at `500`, its `*Bg` tint at `100`.\n *\n * @param tokens the app's token set\n * @param mode which mode block to project (default `'light'`)\n */\nexport function toUiTheme(tokens: DesignTokens, mode: UiThemeMode = 'light'): UiThemeConfig {\n const modeColors: ModeColors = mode === 'dark' ? tokens.dark : tokens.light;\n const { semantic } = tokens;\n return {\n colors: {\n background: modeColors.background,\n surface: modeColors.surface,\n surfaceElevated: modeColors.surfaceElevated,\n text: modeColors.text,\n textSecondary: modeColors.textSecondary,\n border: modeColors.border,\n },\n palette: {\n primary: flat(tokens.primary),\n secondary: flat(tokens.secondary),\n accent: flat(tokens.accent),\n [ON_BRAND_SCALE]: flat(resolveOnBrand(tokens.primary, tokens.onBrand)),\n [SURFACE_MUTED_SCALE]: flat(modeColors.surfaceMuted ?? modeColors.surface),\n },\n semantic: {\n error: tinted(semantic.error, semantic.errorBg),\n success: tinted(semantic.success, semantic.successBg),\n warning: tinted(semantic.warning, semantic.warningBg),\n info: tinted(semantic.info, semantic.infoBg),\n },\n };\n}\n","import type { DesignTokens } from '../types';\n\n/**\n * PROOViD AML console (Stack A — vanilla JS) tokens.\n *\n * Seeded byte-for-byte from `PROOViD/AMLService/AMLService/wwwroot/shared/ui.css`\n * `:root`. Emitting via `toCssVars(AML_TOKENS, AML_CSS_VAR_NAMES)` reproduces that\n * `:root` block exactly, so ui.css keeps working with zero visual change.\n *\n * Name-mapping notes (AML has no `TenantThemeConfig`-style secondary/accent or\n * light/dark toggle):\n * - `primary` = `--brand`. `secondary`/`accent` mirror it (ui.css reads neither);\n * they exist only so the core shape is complete.\n * - `semantic` mirrors the verdict palette (`--ok`/`--warn`/`--bad`); `info` has\n * no AML variable, so it mirrors `--brand`.\n * - `light` = the light workspace (`--bg`/`--surface`/…); `dark` = the dark app\n * SHELL (`--shell`/`--shell-2`/…) so the shape is complete. The AML name map\n * omits all `dark*` names, so no dark-mode block is emitted; the shell is\n * emitted from the `extensions.shell` group inside `:root`, matching ui.css.\n */\nexport const AML_TOKENS: DesignTokens = {\n primary: '#4f46e5',\n secondary: '#4f46e5',\n accent: '#4f46e5',\n\n semantic: {\n success: '#0c9d6c',\n warning: '#b9690a',\n error: '#d4302b',\n info: '#4f46e5',\n },\n\n light: {\n background: '#f4f6fa',\n surface: '#ffffff',\n surfaceElevated: '#f8fafc',\n text: '#0d1526',\n textSecondary: '#4a5567',\n border: '#e6e9f0',\n divider: '#e6e9f0',\n },\n\n dark: {\n background: '#0b1220',\n surface: '#111a2c',\n surfaceElevated: '#111a2c',\n text: '#e8edf6',\n textSecondary: '#95a3bb',\n border: 'rgba(255, 255, 255, .09)',\n divider: 'rgba(255, 255, 255, .09)',\n },\n\n typography: {\n fontFamily: '\"IBM Plex Sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif',\n monoFamily: '\"IBM Plex Mono\", ui-monospace, SFMono-Regular, Menlo, monospace',\n headingScale: 1,\n },\n\n radii: {\n xs: '7px',\n sm: '9px',\n md: '12px',\n lg: '16px',\n pill: '999px',\n },\n\n shadows: {\n sm: '0 1px 2px rgba(13, 21, 38, .06)',\n md: '0 6px 20px -8px rgba(13, 21, 38, .14), 0 1px 2px rgba(13, 21, 38, .05)',\n pop: '0 24px 60px -16px rgba(13, 21, 38, .32)',\n },\n\n branding: {\n logoContentId: null,\n faviconContentId: null,\n presetId: 'aml',\n },\n\n extensions: {\n shell: {\n background: '#0b1220',\n backgroundAlt: '#111a2c',\n line: 'rgba(255, 255, 255, .09)',\n on: '#e8edf6',\n onDim: '#95a3bb',\n },\n brand: {\n press: '#4035c9',\n soft: '#eef0fe',\n ring: 'rgba(79, 70, 229, .16)',\n },\n ink: {\n base: '#0d1526',\n soft: '#4a5567',\n faint: '#75839a',\n overlay: '#46506220',\n },\n workspace: {\n surfaceAlt: '#f8fafc',\n lineStrong: '#d7dce6',\n },\n verdict: {\n ok: '#0c9d6c',\n okSoft: '#e4f6ef',\n okInk: '#0a7a55',\n warn: '#b9690a',\n warnSoft: '#fcf1e3',\n warnInk: '#985608',\n bad: '#d4302b',\n badSoft: '#fcebea',\n badSoft2: '#fdecec',\n badInk: '#b21f1f',\n },\n },\n};\n","import type { DesignTokens } from '../types';\n\n/**\n * Digital Kin (Greek digital-literacy guide site) tokens.\n *\n * Seeded from the Figma `Typography & Colors Style Guide` (design spec §8): green\n * `#007E4A`, yellow `#FFAB00`, black, white. Unlike the aml/erevna/katalogos\n * presets — which were extracted byte-for-byte from an existing running app — this\n * preset is authored from the brand source, because the app does not exist yet.\n * That difference is not cosmetic: those presets must preserve their app's current\n * pixels, so their AA failures are frozen in `KNOWN_GAPS`. This one has no pixels\n * to preserve, so it is held to the floor the guard actually asks for wherever\n * that is arithmetically reachable (see `border` below).\n *\n * THE ACCENT IS A HIGHLIGHT, NOT A BUTTON COLOUR. `#FFAB00` is light: white text\n * on it measures 1.90:1, nowhere near the 4.5:1 AA floor. It carries stars,\n * focus rings, underlines and small ornaments, always with DARK ink on top\n * (`light.text` on it measures 9.81:1). `digitalkin.test.ts` asserts BOTH halves\n * of that, so \"just make the CTA yellow\" fails the build rather than shipping\n * unreadable.\n *\n * TYPOGRAPHY (spec D21): Geologica ONLY. It covers Greek, Latin, Cyrillic and\n * Vietnamese, and its `CRSV`/`SHRP` variable axes supply the display voice that\n * DynaPuff would otherwise have provided. DynaPuff has NO Greek glyphs at all, and\n * because browser font fallback is per-GLYPH rather than per-element, a heading\n * like \"Digital Kin — Ξεκινήστε εδώ\" would render the Latin half in DynaPuff and\n * the Greek half in an arbitrary system font, inside one element. It is therefore\n * deliberately absent from this file: it exists only inside `wordmark.svg`, whose\n * text is converted to vector paths and loads no font at all.\n *\n * Three deliberate divergences from the raw Figma palette, all for AA contrast on\n * an audience of older users who are frequently outdoors:\n * * `light.textSecondary` is `#5A5A5A` (6.41:1 on the `#F5F7F5` card, its worst\n * surface) rather than a mid grey. A muted grey that fails AA is the single\n * most common way a \"designed\" palette becomes unreadable, and this palette's\n * secondary text carries guide intros and difficulty labels.\n * * `border` is darker than a decorative hairline would be — `#7E8A80` (3.34:1\n * on white) and `#6B7D71` (3.40:1 on the raised dark surface) — so it clears\n * WCAG 1.4.11 as an INPUT OUTLINE. The other three presets have their light\n * borders registered as known gaps because darkening a live portal's hairlines\n * is a visual regression; this preset ships before any pixels exist, so it\n * takes the compliant value instead of inheriting the gap. `divider`, which\n * is decorative only and carries no contrast requirement, stays light.\n * * Dark-mode surfaces lift the green rather than reusing `#007E4A` as a\n * background, which would leave no room for readable text above it.\n *\n * ONE REGISTERED GAP — `dark.semantic.error`. `semantic.error` is a SINGLE token\n * rendered as text in BOTH modes, so one hex must clear 4.5:1 against white AND\n * against `#1E2A22`. Those requirements are mutually exclusive: AA on white caps\n * its relative luminance at 0.183, AA on the raised dark surface demands at least\n * 0.267. No colour satisfies both, so this is not a value that was chosen badly —\n * it needs a mode-aware split of the token, which is a shape change to\n * `SemanticColors` affecting all four presets. Registered in\n * `presets.contrast.test.ts` with its measured ratio, exactly like the identical\n * gap in erevna/katalogos/aml.\n */\nexport const DIGITALKIN_TOKENS: DesignTokens = {\n primary: '#007E4A',\n secondary: '#005532',\n accent: '#FFAB00',\n\n // White on the brand green measures 5.14:1 — AA for normal text, so filled\n // buttons carry white labels. Stated explicitly rather than leaning on the\n // consumer-side default, because a future primary tweak must re-prove it.\n onBrand: '#FFFFFF',\n\n semantic: {\n success: '#007E4A',\n warning: '#B26A00',\n error: '#B3261E',\n info: '#005532',\n },\n\n light: {\n background: '#FFFFFF',\n surface: '#F5F7F5',\n surfaceElevated: '#FFFFFF',\n text: '#101410',\n textSecondary: '#5A5A5A',\n border: '#7E8A80',\n divider: '#E5E9E5',\n surfaceMuted: '#EDF2ED',\n },\n\n dark: {\n background: '#0E1410',\n surface: '#16201A',\n surfaceElevated: '#1E2A22',\n text: '#F2F5F2',\n textSecondary: '#BFC7BF',\n border: '#6B7D71',\n divider: '#2C3A30',\n surfaceMuted: '#1A241D',\n },\n\n typography: {\n // Geologica Variable ships via @fontsource-variable/geologica on the public tier.\n fontFamily:\n \"'Geologica Variable', 'Geologica', system-ui, -apple-system, 'Segoe UI', sans-serif\",\n headingScale: 1,\n },\n\n radii: {\n xs: '4px',\n sm: '8px',\n md: '12px',\n lg: '20px',\n pill: '999px',\n },\n\n shadows: {\n sm: '0 1px 2px rgba(16, 20, 16, 0.06)',\n md: '0 2px 8px rgba(16, 20, 16, 0.08)',\n pop: '0 8px 24px rgba(16, 20, 16, 0.12)',\n },\n\n branding: {\n logoContentId: null,\n faviconContentId: null,\n presetId: 'digitalkin',\n },\n};\n","import type { DesignTokens } from '../types';\n\n/**\n * Erevna (surveys/forms — realm `questioner`) tokens.\n *\n * Seeded byte-for-byte from `erevna-web/src/theme/presets/default.ts`\n * (`DEFAULT_THEME_CONFIG`) and `erevna-web/src/theme/utils/palette.ts`\n * (`basePalette`). No `typography`/`radii`/`shadows` — the RN theme has no\n * centralized tokens for those today, so they are omitted (nothing to emit →\n * zero visual change).\n *\n * ONE deliberate divergence from that seed (UX-11): `light.textSecondary` is\n * `#717171`, not the app's `#777777`. `#777777` measures 4.48:1 on `#ffffff` and\n * 4.18:1 on the `#f7f7f7` card surface — both under the WCAG AA 4.5:1 floor for\n * normal text, and form-field labels render in this colour. `#717171` measures\n * 4.88:1 and 4.56:1 against those same two surfaces. Do not \"restore\" it to\n * match the app; `presets.contrast.test.ts` will fail if you do. The app's own\n * local preset still carries `#777777` and needs the same fix separately.\n */\nexport const EREVNA_TOKENS: DesignTokens = {\n primary: '#005f73',\n secondary: '#94d2bd',\n accent: '#008d5c',\n\n semantic: {\n success: '#0a9396',\n warning: '#ee9b00',\n error: '#ae2012',\n info: '#005f73',\n },\n\n light: {\n background: '#ffffff',\n surface: '#f7f7f7',\n surfaceElevated: '#ffffff',\n text: '#001219',\n textSecondary: '#717171',\n border: '#e6e6e6',\n divider: '#e6e6e6',\n },\n\n dark: {\n background: '#001219',\n surface: '#052f33',\n surfaceElevated: '#073b40',\n text: '#e9d8a6',\n textSecondary: '#a8a090',\n border: '#053f40',\n divider: '#053f40',\n },\n\n branding: {\n logoContentId: null,\n faviconContentId: null,\n presetId: 'default',\n },\n};\n","import type { DesignTokens } from '../types';\n\n/**\n * Katalogos (online menus — realm `onlinemenu`) tokens.\n *\n * Seeded byte-for-byte from `katalogos-web/src/theme/presets/default.ts`\n * (`DEFAULT_THEME_CONFIG`), which is currently identical to Erevna's default.\n * Kept as a separate preset so the two apps can diverge later without touching\n * the other.\n *\n * ONE deliberate divergence from that seed (UX-11): `light.textSecondary` is\n * `#717171`, not the app's `#777777`. `#777777` measures 4.48:1 on `#ffffff` and\n * 4.18:1 on the `#f7f7f7` card surface — both under the WCAG AA 4.5:1 floor for\n * normal text, and form-field labels render in this colour. `#717171` measures\n * 4.88:1 and 4.56:1 against those same two surfaces. Do not \"restore\" it to\n * match the app; `presets.contrast.test.ts` will fail if you do. The app's own\n * local preset still carries `#777777` and needs the same fix separately.\n */\nexport const KATALOGOS_TOKENS: DesignTokens = {\n primary: '#005f73',\n secondary: '#94d2bd',\n accent: '#008d5c',\n\n semantic: {\n success: '#0a9396',\n warning: '#ee9b00',\n error: '#ae2012',\n info: '#005f73',\n },\n\n light: {\n background: '#ffffff',\n surface: '#f7f7f7',\n surfaceElevated: '#ffffff',\n text: '#001219',\n textSecondary: '#717171',\n border: '#e6e6e6',\n divider: '#e6e6e6',\n },\n\n dark: {\n background: '#001219',\n surface: '#052f33',\n surfaceElevated: '#073b40',\n text: '#e9d8a6',\n textSecondary: '#a8a090',\n border: '#053f40',\n divider: '#053f40',\n },\n\n branding: {\n logoContentId: null,\n faviconContentId: null,\n presetId: 'default',\n },\n};\n","import type { DesignTokens } from '../types';\n\nimport { AML_TOKENS } from './aml';\nimport { DIGITALKIN_TOKENS } from './digitalkin';\nimport { EREVNA_TOKENS } from './erevna';\nimport { KATALOGOS_TOKENS } from './katalogos';\n\nexport { AML_TOKENS } from './aml';\nexport { DIGITALKIN_TOKENS } from './digitalkin';\nexport { EREVNA_TOKENS } from './erevna';\nexport { KATALOGOS_TOKENS } from './katalogos';\n\n/** Every shipped app preset keyed by app slug. */\nexport const PRESETS: Readonly<Record<string, DesignTokens>> = {\n aml: AML_TOKENS,\n erevna: EREVNA_TOKENS,\n katalogos: KATALOGOS_TOKENS,\n digitalkin: DIGITALKIN_TOKENS,\n};\n","/**\n * FINREG module colour tokens (task R-01).\n *\n * FINREG's interim \"EDA\" logo binds a colour to each of the three product\n * modules — Payments, Accounting, CRM — so colour reads as module identity, not\n * as one app's brand primary. Those three base hexes are a DECIDED design input\n * (`#4FD8F0` / `#E85FBF` / `#7B8FF7`), not something this package chose, so they\n * are transcribed here verbatim and pinned by `finregModules.test.ts`.\n *\n * Each module also carries an `onWhite` companion. The base fills are light — a\n * cyan orbit at 1.69:1 on white cannot be read as text — so a badge, a table\n * cell, a nav label or any icon that paints a module colour on a white surface\n * needs a darkened variant that clears the WCAG AA 4.5:1 floor. The `onWhite`\n * hexes were DERIVED, not eyeballed: each is the lightest shade of the same hue\n * (HSL lightness reduced, hue+saturation held) that still measures at least\n * 4.5:1 on `#FFFFFF` under the WCAG 2.1 maths in `contrast.ts`, then carried a\n * little past the floor so sub-pixel rendering and rounding cannot drop it under.\n * The exact measured ratios are asserted in the test, so a future edit that\n * lightens one below AA fails the build rather than shipping an unreadable label.\n *\n * This is the SOURCE of these hexes. Consuming apps (a later rebrand wave) read\n * `FINREG_MODULE_COLORS`; they must not re-declare the literals, which is the\n * whole point of the `no-raw-color-literal` rule the consumers are bound by.\n */\nimport type { FinregModuleColors } from './types';\n\nexport const FINREG_MODULE_COLORS: FinregModuleColors = {\n payments: {\n // cyan — 1.69:1 on white (fill only); onWhite 4.82:1\n base: '#4FD8F0',\n onWhite: '#0C7D91',\n },\n accounting: {\n // magenta — 3.08:1 on white (fill only); onWhite 4.81:1\n base: '#E85FBF',\n onWhite: '#D11E9B',\n },\n crm: {\n // violet — 2.95:1 on white (fill only); onWhite 4.82:1\n base: '#7B8FF7',\n onWhite: '#4763F4',\n },\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dloizides/design-tokens",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Framework-agnostic design-token SOURCE for the dloizides.com portfolio. One typed token set per app (aml / erevna / katalogos), seeded byte-for-byte from each app's CURRENT values, emitted in three forms from one source: CSS custom properties (:root) for the vanilla-JS AML console, a TenantThemeConfig-shaped JS/TS object for the RN-web apps, and a Tailwind preset for the DOM-React ThemeStudio. Values only, no components. Token names align with @dloizides/tenant-theme-web's TenantThemeConfig so per-tenant overrides layer cleanly.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design-tokens",
|