@dloizides/design-tokens 1.11.0 → 1.12.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 +6 -0
- package/README.md +1 -0
- package/dist/index.d.mts +71 -5
- package/dist/index.d.ts +71 -5
- package/dist/index.js +157 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +156 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.12.0
|
|
4
|
+
|
|
5
|
+
- New `INTERVIEWPREP_TOKENS` preset + `INTERVIEWPREP_CSS_VAR_NAMES`, seeded from InterviewPrep theme.css (REDESIGN-IP-1 Q-TOKENS "New interviewprep preset").
|
|
6
|
+
- `toCssVars` `lightSelector` option: dark-first output (dark in `:root`, light in the given selector). Light-first output is byte-identical.
|
|
7
|
+
- `CssVarNames` gains per-mode names for the optional `ModeColors` fields (textTertiary, focusRing, brandFill, onBrandFill, successText, dangerText, dangerFill).
|
|
8
|
+
|
|
3
9
|
## 1.11.0
|
|
4
10
|
|
|
5
11
|
**Optional mode extras, increased-contrast overrides, motion springs, and the D1 "Living Room" `nextgame` preset.**
|
package/README.md
CHANGED
|
@@ -75,6 +75,7 @@ Each preset is seeded from that app's current source of truth:
|
|
|
75
75
|
| `EREVNA_TOKENS` | `erevna-web/src/theme/presets/default.ts` + `theme/utils/palette.ts` | primary `#005f73`, secondary `#94d2bd`, accent `#008d5c`; full light+dark mode |
|
|
76
76
|
| `KATALOGOS_TOKENS` | `katalogos-web/src/theme/presets/default.ts` | currently **identical** to Erevna; kept separate so they can diverge |
|
|
77
77
|
| `AML_TOKENS` | `PROOViD/AMLService/.../wwwroot/shared/ui.css` `:root` | brand `#4f46e5`; dark app-shell + light workspace + verdict palette + radii/shadows/fonts |
|
|
78
|
+
| `INTERVIEWPREP_TOKENS` | `InterviewPrep/sites/portal/theme.css` (dark `:root` + `[data-theme='light']`) | DARK-FIRST: emit with `toCssVars(INTERVIEWPREP_TOKENS, INTERVIEWPREP_CSS_VAR_NAMES, { lightSelector: ":root[data-theme='light']" })` (1.12.0); per-mode `brandFill`/`dangerFill`/... carry the site colours |
|
|
78
79
|
|
|
79
80
|
RN presets carry **no** `typography`/`radii`/`shadows`/`extensions` — the RN theme has no
|
|
80
81
|
centralized tokens for those today, so they are omitted (nothing to emit → zero change). The AML
|
package/dist/index.d.mts
CHANGED
|
@@ -424,6 +424,20 @@ interface CssVarNames {
|
|
|
424
424
|
darkTextSecondary?: string;
|
|
425
425
|
darkBorder?: string;
|
|
426
426
|
darkDivider?: string;
|
|
427
|
+
lightTextTertiary?: string;
|
|
428
|
+
darkTextTertiary?: string;
|
|
429
|
+
lightFocusRing?: string;
|
|
430
|
+
darkFocusRing?: string;
|
|
431
|
+
lightBrandFill?: string;
|
|
432
|
+
darkBrandFill?: string;
|
|
433
|
+
lightOnBrandFill?: string;
|
|
434
|
+
darkOnBrandFill?: string;
|
|
435
|
+
lightSuccessText?: string;
|
|
436
|
+
darkSuccessText?: string;
|
|
437
|
+
lightDangerText?: string;
|
|
438
|
+
darkDangerText?: string;
|
|
439
|
+
lightDangerFill?: string;
|
|
440
|
+
darkDangerFill?: string;
|
|
427
441
|
radiusXs?: string;
|
|
428
442
|
radiusSm?: string;
|
|
429
443
|
radiusMd?: string;
|
|
@@ -481,6 +495,20 @@ declare const DEFAULT_CSS_VAR_NAMES: CssVarNames;
|
|
|
481
495
|
* - all `dark*` — AML has no dark-mode toggle (its shell lives in the extension).
|
|
482
496
|
*/
|
|
483
497
|
declare const AML_CSS_VAR_NAMES: CssVarNames;
|
|
498
|
+
/**
|
|
499
|
+
* InterviewPrep's existing `sites/portal/theme.css` variable names. InterviewPrep is
|
|
500
|
+
* DARK-FIRST (dark on `:root`, light under `:root[data-theme='light']`), so emit with
|
|
501
|
+
* `toCssVars(INTERVIEWPREP_TOKENS, INTERVIEWPREP_CSS_VAR_NAMES, { lightSelector:
|
|
502
|
+
* ":root[data-theme='light']" })`. `darkSelector` alone cannot express it: a later
|
|
503
|
+
* `:root` dark block would override the light values in both modes.
|
|
504
|
+
*
|
|
505
|
+
* Covers only the variables that have a token field. Every brand/status colour in
|
|
506
|
+
* theme.css differs per mode, so it is carried by a per-mode field (`brandFill` ->
|
|
507
|
+
* `--primary`, `dangerFill` -> `--status-error`, ...) and the top-level single-value
|
|
508
|
+
* fields are left unnamed. Mode-specific shadows and the app-only variables
|
|
509
|
+
* (`--space-*`, `--code-*`, `--line-*`, `--xp-*`, alpha tints) stay hand-written.
|
|
510
|
+
*/
|
|
511
|
+
declare const INTERVIEWPREP_CSS_VAR_NAMES: CssVarNames;
|
|
484
512
|
|
|
485
513
|
/** Options for {@link toCssVars}. */
|
|
486
514
|
interface ToCssVarsOptions {
|
|
@@ -489,12 +517,24 @@ interface ToCssVarsOptions {
|
|
|
489
517
|
* `dark*` variables. Defaults to `:root[data-theme="dark"]`.
|
|
490
518
|
*/
|
|
491
519
|
darkSelector?: string;
|
|
520
|
+
/**
|
|
521
|
+
* DARK-FIRST output. When set, `:root` carries the shared tokens plus the
|
|
522
|
+
* DARK-mode colours (the site's default), and the light-mode colours move to
|
|
523
|
+
* this selector (e.g. `:root[data-theme='light']`); `darkSelector` is ignored.
|
|
524
|
+
* The light selector must out-rank plain `:root` (an attribute selector does),
|
|
525
|
+
* so the order the blocks are loaded in does not matter.
|
|
526
|
+
*/
|
|
527
|
+
lightSelector?: string;
|
|
492
528
|
}
|
|
493
529
|
/**
|
|
494
|
-
* Emit a {@link DesignTokens} as CSS custom properties.
|
|
495
|
-
*
|
|
496
|
-
*
|
|
497
|
-
*
|
|
530
|
+
* Emit a {@link DesignTokens} as CSS custom properties.
|
|
531
|
+
*
|
|
532
|
+
* Light-first (default): shared tokens (brand, semantic, radii, shadows, fonts,
|
|
533
|
+
* extensions) and the LIGHT-mode colours go in `:root {}`; DARK-mode colours go
|
|
534
|
+
* in `darkSelector`, emitted only when the name map names at least one `dark*`
|
|
535
|
+
* variable. Dark-first (`lightSelector` set): `:root {}` carries the shared
|
|
536
|
+
* tokens plus the DARK-mode colours and the LIGHT-mode colours go in
|
|
537
|
+
* `lightSelector`.
|
|
498
538
|
*/
|
|
499
539
|
declare function toCssVars(tokens: DesignTokens, names: CssVarNames, options?: ToCssVarsOptions): string;
|
|
500
540
|
|
|
@@ -743,6 +783,32 @@ declare const DIGITALKIN_TOKENS: DesignTokens;
|
|
|
743
783
|
*/
|
|
744
784
|
declare const EREVNA_TOKENS: DesignTokens;
|
|
745
785
|
|
|
786
|
+
/**
|
|
787
|
+
* InterviewPrep (interview-prep-hub.dloizides.com) tokens, seeded from
|
|
788
|
+
* `InterviewPrep/sites/portal/theme.css` as of 2026-09-29 (REDESIGN-IP-1, owner
|
|
789
|
+
* decision Q-TOKENS "New interviewprep preset"), so emitting it changes nothing on
|
|
790
|
+
* the site.
|
|
791
|
+
*
|
|
792
|
+
* DARK-FIRST. theme.css declares the dark palette on `:root` and the light one on
|
|
793
|
+
* `:root[data-theme='light']`; emit with `lightSelector` (see
|
|
794
|
+
* `INTERVIEWPREP_CSS_VAR_NAMES`). Every brand/status colour differs by mode, so the
|
|
795
|
+
* site-facing values live in the per-mode fields (`brandFill`, `dangerFill`, ...).
|
|
796
|
+
* The top-level single-value fields follow the nextgame precedent and carry the
|
|
797
|
+
* LIGHT values, for RN / OG-image consumers:
|
|
798
|
+
* - `primary`/`accent` `#c0512d` (light --primary / --accent); `onBrand` white, 4.71:1.
|
|
799
|
+
* - `secondary` `#1f9d8a` (light --accent-2 teal).
|
|
800
|
+
* - `semantic.error` `#b91c1c` = light --status-error-text, the TEXT-tuned red (the
|
|
801
|
+
* contrast guard reads semantic.error as text); the light FILL `#dc2626` is
|
|
802
|
+
* `light.dangerFill`.
|
|
803
|
+
*
|
|
804
|
+
* `textSecondary` = --text-muted, `textTertiary` = --text-secondary (the lighter tier
|
|
805
|
+
* in light mode). `border`/`divider`/`surfaceMuted`/`focusRing` are rgba overlays in
|
|
806
|
+
* theme.css and are kept verbatim. No `shadows`: theme.css shadows differ per mode and
|
|
807
|
+
* the token shape has one set. `radii.xs` has no theme.css step: it aliases `sm` and
|
|
808
|
+
* the name map does not emit it.
|
|
809
|
+
*/
|
|
810
|
+
declare const INTERVIEWPREP_TOKENS: DesignTokens;
|
|
811
|
+
|
|
746
812
|
/**
|
|
747
813
|
* Katalogos (online menus — realm `onlinemenu`) tokens.
|
|
748
814
|
*
|
|
@@ -948,4 +1014,4 @@ declare function onBrandRatio(background: string, explicit?: string): number | n
|
|
|
948
1014
|
*/
|
|
949
1015
|
declare function canCarryAccessibleInk(background: string): boolean;
|
|
950
1016
|
|
|
951
|
-
export { AA_LARGE_TEXT_RATIO, AA_NON_TEXT_RATIO, AA_NORMAL_TEXT_RATIO, AML_CSS_VAR_NAMES, AML_TOKENS, type BrandExtras, type Branding, type ContrastMoreOverrides, type CssVarNames, DEFAULT_CSS_VAR_NAMES, DEFAULT_MOTION, DIGITALKIN_TOKENS, type DesignTokens, EREVNA_TOKENS, FINREG_MODULE_COLORS, FINREG_SURFACE_COLORS, type FinregModuleColor, type FinregModuleColors, type FinregSurfaceColors, type InkScale, KATALOGOS_TOKENS, type ModeColors, type Motion, type MotionDurations, type MotionEasing, type MotionEasings, type MotionSpring, type MotionSprings, NEXTGAME_TOKENS, ON_BRAND_DARK_INK, ON_BRAND_LIGHT_INK, 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, canCarryAccessibleInk, contrastRatio, isHexColor, meetsContrast, onBrandRatio, relativeLuminance, resolveOnBrand, toCssVars, toRnTheme, toTailwindPreset, toUiTheme };
|
|
1017
|
+
export { AA_LARGE_TEXT_RATIO, AA_NON_TEXT_RATIO, AA_NORMAL_TEXT_RATIO, AML_CSS_VAR_NAMES, AML_TOKENS, type BrandExtras, type Branding, type ContrastMoreOverrides, type CssVarNames, DEFAULT_CSS_VAR_NAMES, DEFAULT_MOTION, DIGITALKIN_TOKENS, type DesignTokens, EREVNA_TOKENS, FINREG_MODULE_COLORS, FINREG_SURFACE_COLORS, type FinregModuleColor, type FinregModuleColors, type FinregSurfaceColors, INTERVIEWPREP_CSS_VAR_NAMES, INTERVIEWPREP_TOKENS, type InkScale, KATALOGOS_TOKENS, type ModeColors, type Motion, type MotionDurations, type MotionEasing, type MotionEasings, type MotionSpring, type MotionSprings, NEXTGAME_TOKENS, ON_BRAND_DARK_INK, ON_BRAND_LIGHT_INK, 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, canCarryAccessibleInk, contrastRatio, isHexColor, meetsContrast, onBrandRatio, relativeLuminance, resolveOnBrand, toCssVars, toRnTheme, toTailwindPreset, toUiTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -424,6 +424,20 @@ interface CssVarNames {
|
|
|
424
424
|
darkTextSecondary?: string;
|
|
425
425
|
darkBorder?: string;
|
|
426
426
|
darkDivider?: string;
|
|
427
|
+
lightTextTertiary?: string;
|
|
428
|
+
darkTextTertiary?: string;
|
|
429
|
+
lightFocusRing?: string;
|
|
430
|
+
darkFocusRing?: string;
|
|
431
|
+
lightBrandFill?: string;
|
|
432
|
+
darkBrandFill?: string;
|
|
433
|
+
lightOnBrandFill?: string;
|
|
434
|
+
darkOnBrandFill?: string;
|
|
435
|
+
lightSuccessText?: string;
|
|
436
|
+
darkSuccessText?: string;
|
|
437
|
+
lightDangerText?: string;
|
|
438
|
+
darkDangerText?: string;
|
|
439
|
+
lightDangerFill?: string;
|
|
440
|
+
darkDangerFill?: string;
|
|
427
441
|
radiusXs?: string;
|
|
428
442
|
radiusSm?: string;
|
|
429
443
|
radiusMd?: string;
|
|
@@ -481,6 +495,20 @@ declare const DEFAULT_CSS_VAR_NAMES: CssVarNames;
|
|
|
481
495
|
* - all `dark*` — AML has no dark-mode toggle (its shell lives in the extension).
|
|
482
496
|
*/
|
|
483
497
|
declare const AML_CSS_VAR_NAMES: CssVarNames;
|
|
498
|
+
/**
|
|
499
|
+
* InterviewPrep's existing `sites/portal/theme.css` variable names. InterviewPrep is
|
|
500
|
+
* DARK-FIRST (dark on `:root`, light under `:root[data-theme='light']`), so emit with
|
|
501
|
+
* `toCssVars(INTERVIEWPREP_TOKENS, INTERVIEWPREP_CSS_VAR_NAMES, { lightSelector:
|
|
502
|
+
* ":root[data-theme='light']" })`. `darkSelector` alone cannot express it: a later
|
|
503
|
+
* `:root` dark block would override the light values in both modes.
|
|
504
|
+
*
|
|
505
|
+
* Covers only the variables that have a token field. Every brand/status colour in
|
|
506
|
+
* theme.css differs per mode, so it is carried by a per-mode field (`brandFill` ->
|
|
507
|
+
* `--primary`, `dangerFill` -> `--status-error`, ...) and the top-level single-value
|
|
508
|
+
* fields are left unnamed. Mode-specific shadows and the app-only variables
|
|
509
|
+
* (`--space-*`, `--code-*`, `--line-*`, `--xp-*`, alpha tints) stay hand-written.
|
|
510
|
+
*/
|
|
511
|
+
declare const INTERVIEWPREP_CSS_VAR_NAMES: CssVarNames;
|
|
484
512
|
|
|
485
513
|
/** Options for {@link toCssVars}. */
|
|
486
514
|
interface ToCssVarsOptions {
|
|
@@ -489,12 +517,24 @@ interface ToCssVarsOptions {
|
|
|
489
517
|
* `dark*` variables. Defaults to `:root[data-theme="dark"]`.
|
|
490
518
|
*/
|
|
491
519
|
darkSelector?: string;
|
|
520
|
+
/**
|
|
521
|
+
* DARK-FIRST output. When set, `:root` carries the shared tokens plus the
|
|
522
|
+
* DARK-mode colours (the site's default), and the light-mode colours move to
|
|
523
|
+
* this selector (e.g. `:root[data-theme='light']`); `darkSelector` is ignored.
|
|
524
|
+
* The light selector must out-rank plain `:root` (an attribute selector does),
|
|
525
|
+
* so the order the blocks are loaded in does not matter.
|
|
526
|
+
*/
|
|
527
|
+
lightSelector?: string;
|
|
492
528
|
}
|
|
493
529
|
/**
|
|
494
|
-
* Emit a {@link DesignTokens} as CSS custom properties.
|
|
495
|
-
*
|
|
496
|
-
*
|
|
497
|
-
*
|
|
530
|
+
* Emit a {@link DesignTokens} as CSS custom properties.
|
|
531
|
+
*
|
|
532
|
+
* Light-first (default): shared tokens (brand, semantic, radii, shadows, fonts,
|
|
533
|
+
* extensions) and the LIGHT-mode colours go in `:root {}`; DARK-mode colours go
|
|
534
|
+
* in `darkSelector`, emitted only when the name map names at least one `dark*`
|
|
535
|
+
* variable. Dark-first (`lightSelector` set): `:root {}` carries the shared
|
|
536
|
+
* tokens plus the DARK-mode colours and the LIGHT-mode colours go in
|
|
537
|
+
* `lightSelector`.
|
|
498
538
|
*/
|
|
499
539
|
declare function toCssVars(tokens: DesignTokens, names: CssVarNames, options?: ToCssVarsOptions): string;
|
|
500
540
|
|
|
@@ -743,6 +783,32 @@ declare const DIGITALKIN_TOKENS: DesignTokens;
|
|
|
743
783
|
*/
|
|
744
784
|
declare const EREVNA_TOKENS: DesignTokens;
|
|
745
785
|
|
|
786
|
+
/**
|
|
787
|
+
* InterviewPrep (interview-prep-hub.dloizides.com) tokens, seeded from
|
|
788
|
+
* `InterviewPrep/sites/portal/theme.css` as of 2026-09-29 (REDESIGN-IP-1, owner
|
|
789
|
+
* decision Q-TOKENS "New interviewprep preset"), so emitting it changes nothing on
|
|
790
|
+
* the site.
|
|
791
|
+
*
|
|
792
|
+
* DARK-FIRST. theme.css declares the dark palette on `:root` and the light one on
|
|
793
|
+
* `:root[data-theme='light']`; emit with `lightSelector` (see
|
|
794
|
+
* `INTERVIEWPREP_CSS_VAR_NAMES`). Every brand/status colour differs by mode, so the
|
|
795
|
+
* site-facing values live in the per-mode fields (`brandFill`, `dangerFill`, ...).
|
|
796
|
+
* The top-level single-value fields follow the nextgame precedent and carry the
|
|
797
|
+
* LIGHT values, for RN / OG-image consumers:
|
|
798
|
+
* - `primary`/`accent` `#c0512d` (light --primary / --accent); `onBrand` white, 4.71:1.
|
|
799
|
+
* - `secondary` `#1f9d8a` (light --accent-2 teal).
|
|
800
|
+
* - `semantic.error` `#b91c1c` = light --status-error-text, the TEXT-tuned red (the
|
|
801
|
+
* contrast guard reads semantic.error as text); the light FILL `#dc2626` is
|
|
802
|
+
* `light.dangerFill`.
|
|
803
|
+
*
|
|
804
|
+
* `textSecondary` = --text-muted, `textTertiary` = --text-secondary (the lighter tier
|
|
805
|
+
* in light mode). `border`/`divider`/`surfaceMuted`/`focusRing` are rgba overlays in
|
|
806
|
+
* theme.css and are kept verbatim. No `shadows`: theme.css shadows differ per mode and
|
|
807
|
+
* the token shape has one set. `radii.xs` has no theme.css step: it aliases `sm` and
|
|
808
|
+
* the name map does not emit it.
|
|
809
|
+
*/
|
|
810
|
+
declare const INTERVIEWPREP_TOKENS: DesignTokens;
|
|
811
|
+
|
|
746
812
|
/**
|
|
747
813
|
* Katalogos (online menus — realm `onlinemenu`) tokens.
|
|
748
814
|
*
|
|
@@ -948,4 +1014,4 @@ declare function onBrandRatio(background: string, explicit?: string): number | n
|
|
|
948
1014
|
*/
|
|
949
1015
|
declare function canCarryAccessibleInk(background: string): boolean;
|
|
950
1016
|
|
|
951
|
-
export { AA_LARGE_TEXT_RATIO, AA_NON_TEXT_RATIO, AA_NORMAL_TEXT_RATIO, AML_CSS_VAR_NAMES, AML_TOKENS, type BrandExtras, type Branding, type ContrastMoreOverrides, type CssVarNames, DEFAULT_CSS_VAR_NAMES, DEFAULT_MOTION, DIGITALKIN_TOKENS, type DesignTokens, EREVNA_TOKENS, FINREG_MODULE_COLORS, FINREG_SURFACE_COLORS, type FinregModuleColor, type FinregModuleColors, type FinregSurfaceColors, type InkScale, KATALOGOS_TOKENS, type ModeColors, type Motion, type MotionDurations, type MotionEasing, type MotionEasings, type MotionSpring, type MotionSprings, NEXTGAME_TOKENS, ON_BRAND_DARK_INK, ON_BRAND_LIGHT_INK, 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, canCarryAccessibleInk, contrastRatio, isHexColor, meetsContrast, onBrandRatio, relativeLuminance, resolveOnBrand, toCssVars, toRnTheme, toTailwindPreset, toUiTheme };
|
|
1017
|
+
export { AA_LARGE_TEXT_RATIO, AA_NON_TEXT_RATIO, AA_NORMAL_TEXT_RATIO, AML_CSS_VAR_NAMES, AML_TOKENS, type BrandExtras, type Branding, type ContrastMoreOverrides, type CssVarNames, DEFAULT_CSS_VAR_NAMES, DEFAULT_MOTION, DIGITALKIN_TOKENS, type DesignTokens, EREVNA_TOKENS, FINREG_MODULE_COLORS, FINREG_SURFACE_COLORS, type FinregModuleColor, type FinregModuleColors, type FinregSurfaceColors, INTERVIEWPREP_CSS_VAR_NAMES, INTERVIEWPREP_TOKENS, type InkScale, KATALOGOS_TOKENS, type ModeColors, type Motion, type MotionDurations, type MotionEasing, type MotionEasings, type MotionSpring, type MotionSprings, NEXTGAME_TOKENS, ON_BRAND_DARK_INK, ON_BRAND_LIGHT_INK, 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, canCarryAccessibleInk, contrastRatio, isHexColor, meetsContrast, onBrandRatio, relativeLuminance, resolveOnBrand, toCssVars, toRnTheme, toTailwindPreset, toUiTheme };
|
package/dist/index.js
CHANGED
|
@@ -118,6 +118,45 @@ var AML_CSS_VAR_NAMES = {
|
|
|
118
118
|
badSoft2: "--bad-soft2",
|
|
119
119
|
badInk: "--bad-ink"
|
|
120
120
|
};
|
|
121
|
+
var INTERVIEWPREP_CSS_VAR_NAMES = {
|
|
122
|
+
lightBackground: "--bg",
|
|
123
|
+
lightSurface: "--panel",
|
|
124
|
+
lightSurfaceElevated: "--card",
|
|
125
|
+
lightSurfaceMuted: "--surface-muted",
|
|
126
|
+
lightText: "--text",
|
|
127
|
+
lightTextSecondary: "--text-muted",
|
|
128
|
+
lightTextTertiary: "--text-secondary",
|
|
129
|
+
lightBorder: "--border",
|
|
130
|
+
lightDivider: "--border-soft",
|
|
131
|
+
lightFocusRing: "--focus-ring",
|
|
132
|
+
lightBrandFill: "--primary",
|
|
133
|
+
lightOnBrandFill: "--primary-on",
|
|
134
|
+
lightSuccessText: "--status-success-text",
|
|
135
|
+
lightDangerText: "--status-error-text",
|
|
136
|
+
lightDangerFill: "--status-error",
|
|
137
|
+
darkBackground: "--bg",
|
|
138
|
+
darkSurface: "--panel",
|
|
139
|
+
darkSurfaceElevated: "--card",
|
|
140
|
+
darkSurfaceMuted: "--surface-muted",
|
|
141
|
+
darkText: "--text",
|
|
142
|
+
darkTextSecondary: "--text-muted",
|
|
143
|
+
darkTextTertiary: "--text-secondary",
|
|
144
|
+
darkBorder: "--border",
|
|
145
|
+
darkDivider: "--border-soft",
|
|
146
|
+
darkFocusRing: "--focus-ring",
|
|
147
|
+
darkBrandFill: "--primary",
|
|
148
|
+
darkOnBrandFill: "--primary-on",
|
|
149
|
+
darkSuccessText: "--status-success-text",
|
|
150
|
+
darkDangerText: "--status-error-text",
|
|
151
|
+
darkDangerFill: "--status-error",
|
|
152
|
+
// radiusXs omitted: theme.css has no xs step
|
|
153
|
+
radiusSm: "--radius-sm",
|
|
154
|
+
radiusMd: "--radius-md",
|
|
155
|
+
radiusLg: "--radius-lg",
|
|
156
|
+
radiusPill: "--radius-full",
|
|
157
|
+
fontFamily: "--font-sans",
|
|
158
|
+
monoFamily: "--font-mono"
|
|
159
|
+
};
|
|
121
160
|
|
|
122
161
|
// src/contrast.ts
|
|
123
162
|
var AA_NORMAL_TEXT_RATIO = 4.5;
|
|
@@ -228,7 +267,32 @@ function block(selector, lines) {
|
|
|
228
267
|
${lines.join("\n")}
|
|
229
268
|
}`;
|
|
230
269
|
}
|
|
231
|
-
|
|
270
|
+
var MODE_FIELDS = [
|
|
271
|
+
["background", "lightBackground", "darkBackground"],
|
|
272
|
+
["surface", "lightSurface", "darkSurface"],
|
|
273
|
+
["surfaceElevated", "lightSurfaceElevated", "darkSurfaceElevated"],
|
|
274
|
+
["surfaceMuted", "lightSurfaceMuted", "darkSurfaceMuted"],
|
|
275
|
+
["text", "lightText", "darkText"],
|
|
276
|
+
["textSecondary", "lightTextSecondary", "darkTextSecondary"],
|
|
277
|
+
["border", "lightBorder", "darkBorder"],
|
|
278
|
+
["divider", "lightDivider", "darkDivider"],
|
|
279
|
+
["textTertiary", "lightTextTertiary", "darkTextTertiary"],
|
|
280
|
+
["focusRing", "lightFocusRing", "darkFocusRing"],
|
|
281
|
+
["brandFill", "lightBrandFill", "darkBrandFill"],
|
|
282
|
+
["onBrandFill", "lightOnBrandFill", "darkOnBrandFill"],
|
|
283
|
+
["successText", "lightSuccessText", "darkSuccessText"],
|
|
284
|
+
["dangerText", "lightDangerText", "darkDangerText"],
|
|
285
|
+
["dangerFill", "lightDangerFill", "darkDangerFill"]
|
|
286
|
+
];
|
|
287
|
+
var LIGHT_INDEX = 1;
|
|
288
|
+
var DARK_INDEX = 2;
|
|
289
|
+
function modeLines(colors, names, nameIndex) {
|
|
290
|
+
return MODE_FIELDS.map((entry) => {
|
|
291
|
+
const nameKey = entry[nameIndex];
|
|
292
|
+
return declaration(names[nameKey], colors[entry[0]]);
|
|
293
|
+
}).filter(isLine);
|
|
294
|
+
}
|
|
295
|
+
function sharedLines(tokens, names) {
|
|
232
296
|
const ext = tokens.extensions;
|
|
233
297
|
const baseEntries = [
|
|
234
298
|
declaration(names.primary, tokens.primary),
|
|
@@ -245,15 +309,9 @@ function toCssVars(tokens, names, options) {
|
|
|
245
309
|
declaration(names.successBg, tokens.semantic.successBg),
|
|
246
310
|
declaration(names.warningBg, tokens.semantic.warningBg),
|
|
247
311
|
declaration(names.errorBg, tokens.semantic.errorBg),
|
|
248
|
-
declaration(names.infoBg, tokens.semantic.infoBg)
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
declaration(names.lightSurfaceElevated, tokens.light.surfaceElevated),
|
|
252
|
-
declaration(names.lightSurfaceMuted, tokens.light.surfaceMuted),
|
|
253
|
-
declaration(names.lightText, tokens.light.text),
|
|
254
|
-
declaration(names.lightTextSecondary, tokens.light.textSecondary),
|
|
255
|
-
declaration(names.lightBorder, tokens.light.border),
|
|
256
|
-
declaration(names.lightDivider, tokens.light.divider),
|
|
312
|
+
declaration(names.infoBg, tokens.semantic.infoBg)
|
|
313
|
+
];
|
|
314
|
+
const tailEntries = [
|
|
257
315
|
declaration(names.radiusXs, tokens.radii?.xs),
|
|
258
316
|
declaration(names.radiusSm, tokens.radii?.sm),
|
|
259
317
|
declaration(names.radiusMd, tokens.radii?.md),
|
|
@@ -289,25 +347,27 @@ function toCssVars(tokens, names, options) {
|
|
|
289
347
|
declaration(names.badSoft2, ext?.verdict?.badSoft2),
|
|
290
348
|
declaration(names.badInk, ext?.verdict?.badInk)
|
|
291
349
|
];
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
350
|
+
return { head: baseEntries.filter(isLine), tail: tailEntries.filter(isLine) };
|
|
351
|
+
}
|
|
352
|
+
function toCssVars(tokens, names, options) {
|
|
353
|
+
const shared = sharedLines(tokens, names);
|
|
354
|
+
const light = modeLines(tokens.light, names, LIGHT_INDEX);
|
|
355
|
+
const dark = modeLines(tokens.dark, names, DARK_INDEX);
|
|
356
|
+
const lightSelector = options?.lightSelector;
|
|
357
|
+
if (lightSelector !== void 0) {
|
|
358
|
+
const rootBlock = block(":root", [...shared.head, ...shared.tail, ...dark]);
|
|
359
|
+
return light.length === 0 ? rootBlock : `${rootBlock}
|
|
360
|
+
|
|
361
|
+
${block(lightSelector, light)}`;
|
|
362
|
+
}
|
|
363
|
+
const baseBlock = block(":root", [...shared.head, ...light, ...shared.tail]);
|
|
364
|
+
if (dark.length === 0) {
|
|
305
365
|
return baseBlock;
|
|
306
366
|
}
|
|
307
367
|
const selector = options?.darkSelector ?? DEFAULT_DARK_SELECTOR;
|
|
308
368
|
return `${baseBlock}
|
|
309
369
|
|
|
310
|
-
${block(selector,
|
|
370
|
+
${block(selector, dark)}`;
|
|
311
371
|
}
|
|
312
372
|
|
|
313
373
|
// src/emit/toRnTheme.ts
|
|
@@ -631,6 +691,75 @@ var EREVNA_TOKENS = {
|
|
|
631
691
|
}
|
|
632
692
|
};
|
|
633
693
|
|
|
694
|
+
// src/presets/interviewprep.ts
|
|
695
|
+
var INTERVIEWPREP_TOKENS = {
|
|
696
|
+
primary: "#c0512d",
|
|
697
|
+
secondary: "#1f9d8a",
|
|
698
|
+
accent: "#c0512d",
|
|
699
|
+
onBrand: "#ffffff",
|
|
700
|
+
semantic: {
|
|
701
|
+
success: "#148a3f",
|
|
702
|
+
warning: "#b45309",
|
|
703
|
+
error: "#b91c1c",
|
|
704
|
+
info: "#2563eb",
|
|
705
|
+
successBg: "rgba(20, 138, 63, 0.12)",
|
|
706
|
+
warningBg: "rgba(180, 83, 9, 0.12)",
|
|
707
|
+
errorBg: "rgba(220, 38, 38, 0.12)",
|
|
708
|
+
infoBg: "rgba(37, 99, 235, 0.12)"
|
|
709
|
+
},
|
|
710
|
+
light: {
|
|
711
|
+
background: "#f7f1ea",
|
|
712
|
+
surface: "#ffffff",
|
|
713
|
+
surfaceElevated: "#fef7f0",
|
|
714
|
+
surfaceMuted: "rgba(15, 23, 42, 0.04)",
|
|
715
|
+
text: "#1a2332",
|
|
716
|
+
textSecondary: "#4b5c6e",
|
|
717
|
+
textTertiary: "#5a6b7d",
|
|
718
|
+
border: "rgba(15, 23, 42, 0.15)",
|
|
719
|
+
divider: "rgba(15, 23, 42, 0.1)",
|
|
720
|
+
focusRing: "rgba(192, 81, 45, 0.5)",
|
|
721
|
+
brandFill: "#c0512d",
|
|
722
|
+
onBrandFill: "#ffffff",
|
|
723
|
+
successText: "#166534",
|
|
724
|
+
dangerText: "#b91c1c",
|
|
725
|
+
dangerFill: "#dc2626"
|
|
726
|
+
},
|
|
727
|
+
dark: {
|
|
728
|
+
background: "#0b121a",
|
|
729
|
+
surface: "#121a24",
|
|
730
|
+
surfaceElevated: "#162030",
|
|
731
|
+
surfaceMuted: "rgba(148, 163, 184, 0.08)",
|
|
732
|
+
text: "#f1f5f9",
|
|
733
|
+
textSecondary: "#a1b0c4",
|
|
734
|
+
textTertiary: "#a1b0c4",
|
|
735
|
+
border: "rgba(148, 163, 184, 0.2)",
|
|
736
|
+
divider: "rgba(148, 163, 184, 0.15)",
|
|
737
|
+
focusRing: "rgba(255, 138, 91, 0.6)",
|
|
738
|
+
brandFill: "#ff8a5b",
|
|
739
|
+
onBrandFill: "#0f172a",
|
|
740
|
+
successText: "#4ade80",
|
|
741
|
+
dangerText: "#f87171",
|
|
742
|
+
dangerFill: "#ef4444"
|
|
743
|
+
},
|
|
744
|
+
typography: {
|
|
745
|
+
fontFamily: "'Atkinson Hyperlegible Next', system-ui, -apple-system, 'Segoe UI', sans-serif",
|
|
746
|
+
monoFamily: "'Atkinson Hyperlegible Mono', ui-monospace, SFMono-Regular, Consolas, monospace",
|
|
747
|
+
headingScale: 1
|
|
748
|
+
},
|
|
749
|
+
radii: {
|
|
750
|
+
xs: "0.375rem",
|
|
751
|
+
sm: "0.375rem",
|
|
752
|
+
md: "0.75rem",
|
|
753
|
+
lg: "1rem",
|
|
754
|
+
pill: "9999px"
|
|
755
|
+
},
|
|
756
|
+
branding: {
|
|
757
|
+
logoContentId: null,
|
|
758
|
+
faviconContentId: null,
|
|
759
|
+
presetId: "interviewprep"
|
|
760
|
+
}
|
|
761
|
+
};
|
|
762
|
+
|
|
634
763
|
// src/presets/katalogos.ts
|
|
635
764
|
var KATALOGOS_TOKENS = {
|
|
636
765
|
primary: "#005f73",
|
|
@@ -762,7 +891,8 @@ var PRESETS = {
|
|
|
762
891
|
erevna: EREVNA_TOKENS,
|
|
763
892
|
katalogos: KATALOGOS_TOKENS,
|
|
764
893
|
digitalkin: DIGITALKIN_TOKENS,
|
|
765
|
-
nextgame: NEXTGAME_TOKENS
|
|
894
|
+
nextgame: NEXTGAME_TOKENS,
|
|
895
|
+
interviewprep: INTERVIEWPREP_TOKENS
|
|
766
896
|
};
|
|
767
897
|
|
|
768
898
|
// src/finregModules.ts
|
|
@@ -801,6 +931,8 @@ exports.DIGITALKIN_TOKENS = DIGITALKIN_TOKENS;
|
|
|
801
931
|
exports.EREVNA_TOKENS = EREVNA_TOKENS;
|
|
802
932
|
exports.FINREG_MODULE_COLORS = FINREG_MODULE_COLORS;
|
|
803
933
|
exports.FINREG_SURFACE_COLORS = FINREG_SURFACE_COLORS;
|
|
934
|
+
exports.INTERVIEWPREP_CSS_VAR_NAMES = INTERVIEWPREP_CSS_VAR_NAMES;
|
|
935
|
+
exports.INTERVIEWPREP_TOKENS = INTERVIEWPREP_TOKENS;
|
|
804
936
|
exports.KATALOGOS_TOKENS = KATALOGOS_TOKENS;
|
|
805
937
|
exports.NEXTGAME_TOKENS = NEXTGAME_TOKENS;
|
|
806
938
|
exports.ON_BRAND_DARK_INK = ON_BRAND_DARK_INK;
|