@dloizides/design-tokens 1.2.0 → 1.3.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 +29 -0
- package/dist/index.d.mts +57 -1
- package/dist/index.d.ts +57 -1
- package/dist/index.js +62 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +62 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@dloizides/design-tokens` are documented here.
|
|
4
4
|
|
|
5
|
+
## [1.3.0]
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **`DIGITALKIN_TOKENS`** — the Digital Kin brand preset (green `#007E4A`, yellow `#FFAB00`,
|
|
10
|
+
Geologica as the sole text family). Registered in `PRESETS` under `digitalkin` and
|
|
11
|
+
re-exported from the package root.
|
|
12
|
+
|
|
13
|
+
Purely additive: the other 20 exports are byte-identical to 1.2.0, and all four emitters
|
|
14
|
+
produce identical output for `aml` / `erevna` / `katalogos`. `PRESETS` gains one key and
|
|
15
|
+
loses none. Verified by diffing this build against the published 1.2.0 tarball.
|
|
16
|
+
|
|
17
|
+
### Notes
|
|
18
|
+
|
|
19
|
+
- The Digital Kin accent (`#FFAB00`) is a HIGHLIGHT colour: white on it measures **1.90:1**,
|
|
20
|
+
so it carries stars, focus rings and ornaments with dark ink on top (**9.81:1**) — never a
|
|
21
|
+
white-on-yellow button. Both halves are asserted by `digitalkin.test.ts`.
|
|
22
|
+
- DynaPuff is deliberately absent from the token set. It has **no Greek glyphs**, and browser
|
|
23
|
+
font fallback is per-glyph, so a mixed Greek/Latin heading would render in two typefaces at
|
|
24
|
+
once. It lives only inside the wordmark SVG as vector paths.
|
|
25
|
+
- Unlike the other three presets, `digitalkin`'s **borders meet WCAG 1.4.11** (3.34:1 light,
|
|
26
|
+
3.40:1 dark) rather than inheriting the registered `*.border` gaps. Those gaps are frozen
|
|
27
|
+
current values of live portals; this preset ships before it has pixels to regress, so it
|
|
28
|
+
takes the compliant value.
|
|
29
|
+
- One registered gap: **`digitalkin.dark.semantic.error`** (2.28:1). `semantic.error` is a
|
|
30
|
+
single token rendered as text in both modes, and AA on white caps its luminance at 0.183
|
|
31
|
+
while AA on the raised dark surface demands ≥0.267 — mutually exclusive. Fixing it needs a
|
|
32
|
+
mode-aware split of `SemanticColors` affecting all four presets, not a colour nudge.
|
|
33
|
+
|
|
5
34
|
## [1.2.0]
|
|
6
35
|
|
|
7
36
|
### Added
|
package/dist/index.d.mts
CHANGED
|
@@ -511,6 +511,62 @@ declare function toUiTheme(tokens: DesignTokens, mode?: UiThemeMode): UiThemeCon
|
|
|
511
511
|
*/
|
|
512
512
|
declare const AML_TOKENS: DesignTokens;
|
|
513
513
|
|
|
514
|
+
/**
|
|
515
|
+
* Digital Kin (Greek digital-literacy guide site) tokens.
|
|
516
|
+
*
|
|
517
|
+
* Seeded from the Figma `Typography & Colors Style Guide` (design spec §8): green
|
|
518
|
+
* `#007E4A`, yellow `#FFAB00`, black, white. Unlike the aml/erevna/katalogos
|
|
519
|
+
* presets — which were extracted byte-for-byte from an existing running app — this
|
|
520
|
+
* preset is authored from the brand source, because the app does not exist yet.
|
|
521
|
+
* That difference is not cosmetic: those presets must preserve their app's current
|
|
522
|
+
* pixels, so their AA failures are frozen in `KNOWN_GAPS`. This one has no pixels
|
|
523
|
+
* to preserve, so it is held to the floor the guard actually asks for wherever
|
|
524
|
+
* that is arithmetically reachable (see `border` below).
|
|
525
|
+
*
|
|
526
|
+
* THE ACCENT IS A HIGHLIGHT, NOT A BUTTON COLOUR. `#FFAB00` is light: white text
|
|
527
|
+
* on it measures 1.90:1, nowhere near the 4.5:1 AA floor. It carries stars,
|
|
528
|
+
* focus rings, underlines and small ornaments, always with DARK ink on top
|
|
529
|
+
* (`light.text` on it measures 9.81:1). `digitalkin.test.ts` asserts BOTH halves
|
|
530
|
+
* of that, so "just make the CTA yellow" fails the build rather than shipping
|
|
531
|
+
* unreadable.
|
|
532
|
+
*
|
|
533
|
+
* TYPOGRAPHY (spec D21): Geologica ONLY. It covers Greek, Latin, Cyrillic and
|
|
534
|
+
* Vietnamese, and its `CRSV`/`SHRP` variable axes supply the display voice that
|
|
535
|
+
* DynaPuff would otherwise have provided. DynaPuff has NO Greek glyphs at all, and
|
|
536
|
+
* because browser font fallback is per-GLYPH rather than per-element, a heading
|
|
537
|
+
* like "Digital Kin — Ξεκινήστε εδώ" would render the Latin half in DynaPuff and
|
|
538
|
+
* the Greek half in an arbitrary system font, inside one element. It is therefore
|
|
539
|
+
* deliberately absent from this file: it exists only inside `wordmark.svg`, whose
|
|
540
|
+
* text is converted to vector paths and loads no font at all.
|
|
541
|
+
*
|
|
542
|
+
* Three deliberate divergences from the raw Figma palette, all for AA contrast on
|
|
543
|
+
* an audience of older users who are frequently outdoors:
|
|
544
|
+
* * `light.textSecondary` is `#5A5A5A` (6.41:1 on the `#F5F7F5` card, its worst
|
|
545
|
+
* surface) rather than a mid grey. A muted grey that fails AA is the single
|
|
546
|
+
* most common way a "designed" palette becomes unreadable, and this palette's
|
|
547
|
+
* secondary text carries guide intros and difficulty labels.
|
|
548
|
+
* * `border` is darker than a decorative hairline would be — `#7E8A80` (3.34:1
|
|
549
|
+
* on white) and `#6B7D71` (3.40:1 on the raised dark surface) — so it clears
|
|
550
|
+
* WCAG 1.4.11 as an INPUT OUTLINE. The other three presets have their light
|
|
551
|
+
* borders registered as known gaps because darkening a live portal's hairlines
|
|
552
|
+
* is a visual regression; this preset ships before any pixels exist, so it
|
|
553
|
+
* takes the compliant value instead of inheriting the gap. `divider`, which
|
|
554
|
+
* is decorative only and carries no contrast requirement, stays light.
|
|
555
|
+
* * Dark-mode surfaces lift the green rather than reusing `#007E4A` as a
|
|
556
|
+
* background, which would leave no room for readable text above it.
|
|
557
|
+
*
|
|
558
|
+
* ONE REGISTERED GAP — `dark.semantic.error`. `semantic.error` is a SINGLE token
|
|
559
|
+
* rendered as text in BOTH modes, so one hex must clear 4.5:1 against white AND
|
|
560
|
+
* against `#1E2A22`. Those requirements are mutually exclusive: AA on white caps
|
|
561
|
+
* its relative luminance at 0.183, AA on the raised dark surface demands at least
|
|
562
|
+
* 0.267. No colour satisfies both, so this is not a value that was chosen badly —
|
|
563
|
+
* it needs a mode-aware split of the token, which is a shape change to
|
|
564
|
+
* `SemanticColors` affecting all four presets. Registered in
|
|
565
|
+
* `presets.contrast.test.ts` with its measured ratio, exactly like the identical
|
|
566
|
+
* gap in erevna/katalogos/aml.
|
|
567
|
+
*/
|
|
568
|
+
declare const DIGITALKIN_TOKENS: DesignTokens;
|
|
569
|
+
|
|
514
570
|
/**
|
|
515
571
|
* Erevna (surveys/forms — realm `questioner`) tokens.
|
|
516
572
|
*
|
|
@@ -606,4 +662,4 @@ declare function contrastRatio(foreground: string, background: string): number;
|
|
|
606
662
|
/** True when `foreground` on `background` meets `requiredRatio`. */
|
|
607
663
|
declare function meetsContrast(foreground: string, background: string, requiredRatio: number): boolean;
|
|
608
664
|
|
|
609
|
-
export { AA_LARGE_TEXT_RATIO, AA_NON_TEXT_RATIO, AA_NORMAL_TEXT_RATIO, AML_CSS_VAR_NAMES, AML_TOKENS, type BrandExtras, type Branding, type CssVarNames, DEFAULT_CSS_VAR_NAMES, type DesignTokens, EREVNA_TOKENS, type InkScale, KATALOGOS_TOKENS, type ModeColors, PRESETS, type Radii, type RnThemeConfig, type SemanticColors, type Shadows, type ShellColors, type TailwindColors, type TailwindPreset, type ToCssVarsOptions, type TokenExtensions, type Typography, UI_DEEP_STEP, UI_MAIN_STEP, UI_TINT_STEP, type UiColorScale, type UiThemeColors, type UiThemeConfig, type UiThemeMode, type UiThemePalette, type UiThemeSemantic, type VerdictColors, type WorkspaceExtras, contrastRatio, isHexColor, meetsContrast, relativeLuminance, toCssVars, toRnTheme, toTailwindPreset, toUiTheme };
|
|
665
|
+
export { AA_LARGE_TEXT_RATIO, AA_NON_TEXT_RATIO, AA_NORMAL_TEXT_RATIO, AML_CSS_VAR_NAMES, AML_TOKENS, type BrandExtras, type Branding, type CssVarNames, DEFAULT_CSS_VAR_NAMES, DIGITALKIN_TOKENS, type DesignTokens, EREVNA_TOKENS, type InkScale, KATALOGOS_TOKENS, type ModeColors, PRESETS, type Radii, type RnThemeConfig, type SemanticColors, type Shadows, type ShellColors, type TailwindColors, type TailwindPreset, type ToCssVarsOptions, type TokenExtensions, type Typography, UI_DEEP_STEP, UI_MAIN_STEP, UI_TINT_STEP, type UiColorScale, type UiThemeColors, type UiThemeConfig, type UiThemeMode, type UiThemePalette, type UiThemeSemantic, type VerdictColors, type WorkspaceExtras, contrastRatio, isHexColor, meetsContrast, relativeLuminance, toCssVars, toRnTheme, toTailwindPreset, toUiTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -511,6 +511,62 @@ declare function toUiTheme(tokens: DesignTokens, mode?: UiThemeMode): UiThemeCon
|
|
|
511
511
|
*/
|
|
512
512
|
declare const AML_TOKENS: DesignTokens;
|
|
513
513
|
|
|
514
|
+
/**
|
|
515
|
+
* Digital Kin (Greek digital-literacy guide site) tokens.
|
|
516
|
+
*
|
|
517
|
+
* Seeded from the Figma `Typography & Colors Style Guide` (design spec §8): green
|
|
518
|
+
* `#007E4A`, yellow `#FFAB00`, black, white. Unlike the aml/erevna/katalogos
|
|
519
|
+
* presets — which were extracted byte-for-byte from an existing running app — this
|
|
520
|
+
* preset is authored from the brand source, because the app does not exist yet.
|
|
521
|
+
* That difference is not cosmetic: those presets must preserve their app's current
|
|
522
|
+
* pixels, so their AA failures are frozen in `KNOWN_GAPS`. This one has no pixels
|
|
523
|
+
* to preserve, so it is held to the floor the guard actually asks for wherever
|
|
524
|
+
* that is arithmetically reachable (see `border` below).
|
|
525
|
+
*
|
|
526
|
+
* THE ACCENT IS A HIGHLIGHT, NOT A BUTTON COLOUR. `#FFAB00` is light: white text
|
|
527
|
+
* on it measures 1.90:1, nowhere near the 4.5:1 AA floor. It carries stars,
|
|
528
|
+
* focus rings, underlines and small ornaments, always with DARK ink on top
|
|
529
|
+
* (`light.text` on it measures 9.81:1). `digitalkin.test.ts` asserts BOTH halves
|
|
530
|
+
* of that, so "just make the CTA yellow" fails the build rather than shipping
|
|
531
|
+
* unreadable.
|
|
532
|
+
*
|
|
533
|
+
* TYPOGRAPHY (spec D21): Geologica ONLY. It covers Greek, Latin, Cyrillic and
|
|
534
|
+
* Vietnamese, and its `CRSV`/`SHRP` variable axes supply the display voice that
|
|
535
|
+
* DynaPuff would otherwise have provided. DynaPuff has NO Greek glyphs at all, and
|
|
536
|
+
* because browser font fallback is per-GLYPH rather than per-element, a heading
|
|
537
|
+
* like "Digital Kin — Ξεκινήστε εδώ" would render the Latin half in DynaPuff and
|
|
538
|
+
* the Greek half in an arbitrary system font, inside one element. It is therefore
|
|
539
|
+
* deliberately absent from this file: it exists only inside `wordmark.svg`, whose
|
|
540
|
+
* text is converted to vector paths and loads no font at all.
|
|
541
|
+
*
|
|
542
|
+
* Three deliberate divergences from the raw Figma palette, all for AA contrast on
|
|
543
|
+
* an audience of older users who are frequently outdoors:
|
|
544
|
+
* * `light.textSecondary` is `#5A5A5A` (6.41:1 on the `#F5F7F5` card, its worst
|
|
545
|
+
* surface) rather than a mid grey. A muted grey that fails AA is the single
|
|
546
|
+
* most common way a "designed" palette becomes unreadable, and this palette's
|
|
547
|
+
* secondary text carries guide intros and difficulty labels.
|
|
548
|
+
* * `border` is darker than a decorative hairline would be — `#7E8A80` (3.34:1
|
|
549
|
+
* on white) and `#6B7D71` (3.40:1 on the raised dark surface) — so it clears
|
|
550
|
+
* WCAG 1.4.11 as an INPUT OUTLINE. The other three presets have their light
|
|
551
|
+
* borders registered as known gaps because darkening a live portal's hairlines
|
|
552
|
+
* is a visual regression; this preset ships before any pixels exist, so it
|
|
553
|
+
* takes the compliant value instead of inheriting the gap. `divider`, which
|
|
554
|
+
* is decorative only and carries no contrast requirement, stays light.
|
|
555
|
+
* * Dark-mode surfaces lift the green rather than reusing `#007E4A` as a
|
|
556
|
+
* background, which would leave no room for readable text above it.
|
|
557
|
+
*
|
|
558
|
+
* ONE REGISTERED GAP — `dark.semantic.error`. `semantic.error` is a SINGLE token
|
|
559
|
+
* rendered as text in BOTH modes, so one hex must clear 4.5:1 against white AND
|
|
560
|
+
* against `#1E2A22`. Those requirements are mutually exclusive: AA on white caps
|
|
561
|
+
* its relative luminance at 0.183, AA on the raised dark surface demands at least
|
|
562
|
+
* 0.267. No colour satisfies both, so this is not a value that was chosen badly —
|
|
563
|
+
* it needs a mode-aware split of the token, which is a shape change to
|
|
564
|
+
* `SemanticColors` affecting all four presets. Registered in
|
|
565
|
+
* `presets.contrast.test.ts` with its measured ratio, exactly like the identical
|
|
566
|
+
* gap in erevna/katalogos/aml.
|
|
567
|
+
*/
|
|
568
|
+
declare const DIGITALKIN_TOKENS: DesignTokens;
|
|
569
|
+
|
|
514
570
|
/**
|
|
515
571
|
* Erevna (surveys/forms — realm `questioner`) tokens.
|
|
516
572
|
*
|
|
@@ -606,4 +662,4 @@ declare function contrastRatio(foreground: string, background: string): number;
|
|
|
606
662
|
/** True when `foreground` on `background` meets `requiredRatio`. */
|
|
607
663
|
declare function meetsContrast(foreground: string, background: string, requiredRatio: number): boolean;
|
|
608
664
|
|
|
609
|
-
export { AA_LARGE_TEXT_RATIO, AA_NON_TEXT_RATIO, AA_NORMAL_TEXT_RATIO, AML_CSS_VAR_NAMES, AML_TOKENS, type BrandExtras, type Branding, type CssVarNames, DEFAULT_CSS_VAR_NAMES, type DesignTokens, EREVNA_TOKENS, type InkScale, KATALOGOS_TOKENS, type ModeColors, PRESETS, type Radii, type RnThemeConfig, type SemanticColors, type Shadows, type ShellColors, type TailwindColors, type TailwindPreset, type ToCssVarsOptions, type TokenExtensions, type Typography, UI_DEEP_STEP, UI_MAIN_STEP, UI_TINT_STEP, type UiColorScale, type UiThemeColors, type UiThemeConfig, type UiThemeMode, type UiThemePalette, type UiThemeSemantic, type VerdictColors, type WorkspaceExtras, contrastRatio, isHexColor, meetsContrast, relativeLuminance, toCssVars, toRnTheme, toTailwindPreset, toUiTheme };
|
|
665
|
+
export { AA_LARGE_TEXT_RATIO, AA_NON_TEXT_RATIO, AA_NORMAL_TEXT_RATIO, AML_CSS_VAR_NAMES, AML_TOKENS, type BrandExtras, type Branding, type CssVarNames, DEFAULT_CSS_VAR_NAMES, DIGITALKIN_TOKENS, type DesignTokens, EREVNA_TOKENS, type InkScale, KATALOGOS_TOKENS, type ModeColors, PRESETS, type Radii, type RnThemeConfig, type SemanticColors, type Shadows, type ShellColors, type TailwindColors, type TailwindPreset, type ToCssVarsOptions, type TokenExtensions, type Typography, UI_DEEP_STEP, UI_MAIN_STEP, UI_TINT_STEP, type UiColorScale, type UiThemeColors, type UiThemeConfig, type UiThemeMode, type UiThemePalette, type UiThemeSemantic, type VerdictColors, type WorkspaceExtras, contrastRatio, isHexColor, meetsContrast, relativeLuminance, toCssVars, toRnTheme, toTailwindPreset, toUiTheme };
|
package/dist/index.js
CHANGED
|
@@ -413,6 +413,65 @@ var AML_TOKENS = {
|
|
|
413
413
|
}
|
|
414
414
|
};
|
|
415
415
|
|
|
416
|
+
// src/presets/digitalkin.ts
|
|
417
|
+
var DIGITALKIN_TOKENS = {
|
|
418
|
+
primary: "#007E4A",
|
|
419
|
+
secondary: "#005532",
|
|
420
|
+
accent: "#FFAB00",
|
|
421
|
+
// White on the brand green measures 5.14:1 — AA for normal text, so filled
|
|
422
|
+
// buttons carry white labels. Stated explicitly rather than leaning on the
|
|
423
|
+
// consumer-side default, because a future primary tweak must re-prove it.
|
|
424
|
+
onBrand: "#FFFFFF",
|
|
425
|
+
semantic: {
|
|
426
|
+
success: "#007E4A",
|
|
427
|
+
warning: "#B26A00",
|
|
428
|
+
error: "#B3261E",
|
|
429
|
+
info: "#005532"
|
|
430
|
+
},
|
|
431
|
+
light: {
|
|
432
|
+
background: "#FFFFFF",
|
|
433
|
+
surface: "#F5F7F5",
|
|
434
|
+
surfaceElevated: "#FFFFFF",
|
|
435
|
+
text: "#101410",
|
|
436
|
+
textSecondary: "#5A5A5A",
|
|
437
|
+
border: "#7E8A80",
|
|
438
|
+
divider: "#E5E9E5",
|
|
439
|
+
surfaceMuted: "#EDF2ED"
|
|
440
|
+
},
|
|
441
|
+
dark: {
|
|
442
|
+
background: "#0E1410",
|
|
443
|
+
surface: "#16201A",
|
|
444
|
+
surfaceElevated: "#1E2A22",
|
|
445
|
+
text: "#F2F5F2",
|
|
446
|
+
textSecondary: "#BFC7BF",
|
|
447
|
+
border: "#6B7D71",
|
|
448
|
+
divider: "#2C3A30",
|
|
449
|
+
surfaceMuted: "#1A241D"
|
|
450
|
+
},
|
|
451
|
+
typography: {
|
|
452
|
+
// Geologica Variable ships via @fontsource-variable/geologica on the public tier.
|
|
453
|
+
fontFamily: "'Geologica Variable', 'Geologica', system-ui, -apple-system, 'Segoe UI', sans-serif",
|
|
454
|
+
headingScale: 1
|
|
455
|
+
},
|
|
456
|
+
radii: {
|
|
457
|
+
xs: "4px",
|
|
458
|
+
sm: "8px",
|
|
459
|
+
md: "12px",
|
|
460
|
+
lg: "20px",
|
|
461
|
+
pill: "999px"
|
|
462
|
+
},
|
|
463
|
+
shadows: {
|
|
464
|
+
sm: "0 1px 2px rgba(16, 20, 16, 0.06)",
|
|
465
|
+
md: "0 2px 8px rgba(16, 20, 16, 0.08)",
|
|
466
|
+
pop: "0 8px 24px rgba(16, 20, 16, 0.12)"
|
|
467
|
+
},
|
|
468
|
+
branding: {
|
|
469
|
+
logoContentId: null,
|
|
470
|
+
faviconContentId: null,
|
|
471
|
+
presetId: "digitalkin"
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
|
|
416
475
|
// src/presets/erevna.ts
|
|
417
476
|
var EREVNA_TOKENS = {
|
|
418
477
|
primary: "#005f73",
|
|
@@ -489,7 +548,8 @@ var KATALOGOS_TOKENS = {
|
|
|
489
548
|
var PRESETS = {
|
|
490
549
|
aml: AML_TOKENS,
|
|
491
550
|
erevna: EREVNA_TOKENS,
|
|
492
|
-
katalogos: KATALOGOS_TOKENS
|
|
551
|
+
katalogos: KATALOGOS_TOKENS,
|
|
552
|
+
digitalkin: DIGITALKIN_TOKENS
|
|
493
553
|
};
|
|
494
554
|
|
|
495
555
|
// src/contrast.ts
|
|
@@ -561,6 +621,7 @@ exports.AA_NORMAL_TEXT_RATIO = AA_NORMAL_TEXT_RATIO;
|
|
|
561
621
|
exports.AML_CSS_VAR_NAMES = AML_CSS_VAR_NAMES;
|
|
562
622
|
exports.AML_TOKENS = AML_TOKENS;
|
|
563
623
|
exports.DEFAULT_CSS_VAR_NAMES = DEFAULT_CSS_VAR_NAMES;
|
|
624
|
+
exports.DIGITALKIN_TOKENS = DIGITALKIN_TOKENS;
|
|
564
625
|
exports.EREVNA_TOKENS = EREVNA_TOKENS;
|
|
565
626
|
exports.KATALOGOS_TOKENS = KATALOGOS_TOKENS;
|
|
566
627
|
exports.PRESETS = PRESETS;
|
package/dist/index.js.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/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,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AAa,MAAA,EAAQ,mBAAmB,CAAC,CAAA;AAEvE,EAAA,OACE,oBAAA,GAAuB,GAAA,GACvB,sBAAA,GAAyB,KAAA,GACzB,qBAAA,GAAwB,IAAA;AAE5B;AAMO,SAAS,aAAA,CAAc,YAAoB,UAAA,EAA4B;AAC5E,EAAA,MAAM,KAAA,GAAQ,kBAAkB,UAAU,CAAA;AAC1C,EAAA,MAAM,MAAA,GAAS,kBAAkB,UAAU,CAAA;AAC3C,EAAA,MAAM,OAAA,GAAU,IAAA,CAAK,GAAA,CAAI,KAAA,EAAO,MAAM,CAAA;AACtC,EAAA,MAAM,MAAA,GAAS,IAAA,CAAK,GAAA,CAAI,KAAA,EAAO,MAAM,CAAA;AACrC,EAAA,OAAA,CAAQ,OAAA,GAAU,mBAAmB,MAAA,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.js","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 * 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 { EREVNA_TOKENS } from './erevna';\nimport { KATALOGOS_TOKENS } from './katalogos';\n\nexport { AML_TOKENS } from './aml';\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};\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/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,S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AA,EAC/D;AACA,EAAA,MAAM,MAAA,GAAS,mBAAmB,GAAG,CAAA;AAErC,EAAA,MAAM,GAAA,GAAM,gBAAA,CAAiB,YAAA,CAAa,MAAA,EAAQ,kBAAkB,CAAC,CAAA;AACrE,EAAA,MAAM,KAAA,GAAQ,gBAAA,CAAiB,YAAA,CAAa,MAAA,EAAQ,oBAAoB,CAAC,CAAA;AACzE,EAAA,MAAM,IAAA,GAAO,gBAAA,CAAiB,YAAA,CAAa,MAAA,EAAQ,mBAAmB,CAAC,CAAA;AAEvE,EAAA,OACE,oBAAA,GAAuB,GAAA,GACvB,sBAAA,GAAyB,KAAA,GACzB,qBAAA,GAAwB,IAAA;AAE5B;AAMO,SAAS,aAAA,CAAc,YAAoB,UAAA,EAA4B;AAC5E,EAAA,MAAM,KAAA,GAAQ,kBAAkB,UAAU,CAAA;AAC1C,EAAA,MAAM,MAAA,GAAS,kBAAkB,UAAU,CAAA;AAC3C,EAAA,MAAM,OAAA,GAAU,IAAA,CAAK,GAAA,CAAI,KAAA,EAAO,MAAM,CAAA;AACtC,EAAA,MAAM,MAAA,GAAS,IAAA,CAAK,GAAA,CAAI,KAAA,EAAO,MAAM,CAAA;AACrC,EAAA,OAAA,CAAQ,OAAA,GAAU,mBAAmB,MAAA,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.js","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"]}
|
package/dist/index.mjs
CHANGED
|
@@ -411,6 +411,65 @@ var AML_TOKENS = {
|
|
|
411
411
|
}
|
|
412
412
|
};
|
|
413
413
|
|
|
414
|
+
// src/presets/digitalkin.ts
|
|
415
|
+
var DIGITALKIN_TOKENS = {
|
|
416
|
+
primary: "#007E4A",
|
|
417
|
+
secondary: "#005532",
|
|
418
|
+
accent: "#FFAB00",
|
|
419
|
+
// White on the brand green measures 5.14:1 — AA for normal text, so filled
|
|
420
|
+
// buttons carry white labels. Stated explicitly rather than leaning on the
|
|
421
|
+
// consumer-side default, because a future primary tweak must re-prove it.
|
|
422
|
+
onBrand: "#FFFFFF",
|
|
423
|
+
semantic: {
|
|
424
|
+
success: "#007E4A",
|
|
425
|
+
warning: "#B26A00",
|
|
426
|
+
error: "#B3261E",
|
|
427
|
+
info: "#005532"
|
|
428
|
+
},
|
|
429
|
+
light: {
|
|
430
|
+
background: "#FFFFFF",
|
|
431
|
+
surface: "#F5F7F5",
|
|
432
|
+
surfaceElevated: "#FFFFFF",
|
|
433
|
+
text: "#101410",
|
|
434
|
+
textSecondary: "#5A5A5A",
|
|
435
|
+
border: "#7E8A80",
|
|
436
|
+
divider: "#E5E9E5",
|
|
437
|
+
surfaceMuted: "#EDF2ED"
|
|
438
|
+
},
|
|
439
|
+
dark: {
|
|
440
|
+
background: "#0E1410",
|
|
441
|
+
surface: "#16201A",
|
|
442
|
+
surfaceElevated: "#1E2A22",
|
|
443
|
+
text: "#F2F5F2",
|
|
444
|
+
textSecondary: "#BFC7BF",
|
|
445
|
+
border: "#6B7D71",
|
|
446
|
+
divider: "#2C3A30",
|
|
447
|
+
surfaceMuted: "#1A241D"
|
|
448
|
+
},
|
|
449
|
+
typography: {
|
|
450
|
+
// Geologica Variable ships via @fontsource-variable/geologica on the public tier.
|
|
451
|
+
fontFamily: "'Geologica Variable', 'Geologica', system-ui, -apple-system, 'Segoe UI', sans-serif",
|
|
452
|
+
headingScale: 1
|
|
453
|
+
},
|
|
454
|
+
radii: {
|
|
455
|
+
xs: "4px",
|
|
456
|
+
sm: "8px",
|
|
457
|
+
md: "12px",
|
|
458
|
+
lg: "20px",
|
|
459
|
+
pill: "999px"
|
|
460
|
+
},
|
|
461
|
+
shadows: {
|
|
462
|
+
sm: "0 1px 2px rgba(16, 20, 16, 0.06)",
|
|
463
|
+
md: "0 2px 8px rgba(16, 20, 16, 0.08)",
|
|
464
|
+
pop: "0 8px 24px rgba(16, 20, 16, 0.12)"
|
|
465
|
+
},
|
|
466
|
+
branding: {
|
|
467
|
+
logoContentId: null,
|
|
468
|
+
faviconContentId: null,
|
|
469
|
+
presetId: "digitalkin"
|
|
470
|
+
}
|
|
471
|
+
};
|
|
472
|
+
|
|
414
473
|
// src/presets/erevna.ts
|
|
415
474
|
var EREVNA_TOKENS = {
|
|
416
475
|
primary: "#005f73",
|
|
@@ -487,7 +546,8 @@ var KATALOGOS_TOKENS = {
|
|
|
487
546
|
var PRESETS = {
|
|
488
547
|
aml: AML_TOKENS,
|
|
489
548
|
erevna: EREVNA_TOKENS,
|
|
490
|
-
katalogos: KATALOGOS_TOKENS
|
|
549
|
+
katalogos: KATALOGOS_TOKENS,
|
|
550
|
+
digitalkin: DIGITALKIN_TOKENS
|
|
491
551
|
};
|
|
492
552
|
|
|
493
553
|
// src/contrast.ts
|
|
@@ -553,6 +613,6 @@ function meetsContrast(foreground, background, requiredRatio) {
|
|
|
553
613
|
return contrastRatio(foreground, background) >= requiredRatio;
|
|
554
614
|
}
|
|
555
615
|
|
|
556
|
-
export { AA_LARGE_TEXT_RATIO, AA_NON_TEXT_RATIO, AA_NORMAL_TEXT_RATIO, AML_CSS_VAR_NAMES, AML_TOKENS, DEFAULT_CSS_VAR_NAMES, EREVNA_TOKENS, KATALOGOS_TOKENS, PRESETS, UI_DEEP_STEP, UI_MAIN_STEP, UI_TINT_STEP, contrastRatio, isHexColor, meetsContrast, relativeLuminance, toCssVars, toRnTheme, toTailwindPreset, toUiTheme };
|
|
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 };
|
|
557
617
|
//# sourceMappingURL=index.mjs.map
|
|
558
618
|
//# 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/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,EA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yB,KAAA,GACzB,qBAAA,GAAwB,IAAA;AAE5B;AAMO,SAAS,aAAA,CAAc,YAAoB,UAAA,EAA4B;AAC5E,EAAA,MAAM,KAAA,GAAQ,kBAAkB,UAAU,CAAA;AAC1C,EAAA,MAAM,MAAA,GAAS,kBAAkB,UAAU,CAAA;AAC3C,EAAA,MAAM,OAAA,GAAU,IAAA,CAAK,GAAA,CAAI,KAAA,EAAO,MAAM,CAAA;AACtC,EAAA,MAAM,MAAA,GAAS,IAAA,CAAK,GAAA,CAAI,KAAA,EAAO,MAAM,CAAA;AACrC,EAAA,OAAA,CAAQ,OAAA,GAAU,mBAAmB,MAAA,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 * 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 { EREVNA_TOKENS } from './erevna';\nimport { KATALOGOS_TOKENS } from './katalogos';\n\nexport { AML_TOKENS } from './aml';\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};\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/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;AA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AA,CAAiB,YAAA,CAAa,MAAA,EAAQ,kBAAkB,CAAC,CAAA;AACrE,EAAA,MAAM,KAAA,GAAQ,gBAAA,CAAiB,YAAA,CAAa,MAAA,EAAQ,oBAAoB,CAAC,CAAA;AACzE,EAAA,MAAM,IAAA,GAAO,gBAAA,CAAiB,YAAA,CAAa,MAAA,EAAQ,mBAAmB,CAAC,CAAA;AAEvE,EAAA,OACE,oBAAA,GAAuB,GAAA,GACvB,sBAAA,GAAyB,KAAA,GACzB,qBAAA,GAAwB,IAAA;AAE5B;AAMO,SAAS,aAAA,CAAc,YAAoB,UAAA,EAA4B;AAC5E,EAAA,MAAM,KAAA,GAAQ,kBAAkB,UAAU,CAAA;AAC1C,EAAA,MAAM,MAAA,GAAS,kBAAkB,UAAU,CAAA;AAC3C,EAAA,MAAM,OAAA,GAAU,IAAA,CAAK,GAAA,CAAI,KAAA,EAAO,MAAM,CAAA;AACtC,EAAA,MAAM,MAAA,GAAS,IAAA,CAAK,GAAA,CAAI,KAAA,EAAO,MAAM,CAAA;AACrC,EAAA,OAAA,CAAQ,OAAA,GAAU,mBAAmB,MAAA,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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dloizides/design-tokens",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.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",
|