@dloizides/design-tokens 1.12.0 → 1.13.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 +10 -6
- package/dist/index.d.mts +43 -1
- package/dist/index.d.ts +43 -1
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +38 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
4
|
-
|
|
5
|
-
- New `
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
## 1.13.0
|
|
4
|
+
|
|
5
|
+
- New overlay stacking scale `Z_INDEX` (`base` 0 < `sticky` 2 < `raised` 30 < `drawer` 50 < `palette` 60 < `dropdown` 1000 < `modal` 9999 < `popover` 10000 < `toast` 10100 < `blocking` 100000), plus `Z_INDEX_ORDER`, `RN_WEB_MODAL_Z_INDEX` and type `ZIndexLayer`. `modal` is react-native-web's fixed Modal layer; body-portalled menus use `popover` so they paint above an open Modal (UI-ZINDEX-SCALE-1 "Shared overlay z-index scale").
|
|
6
|
+
|
|
7
|
+
## 1.12.0
|
|
8
|
+
|
|
9
|
+
- New `INTERVIEWPREP_TOKENS` preset + `INTERVIEWPREP_CSS_VAR_NAMES`, seeded from InterviewPrep theme.css (REDESIGN-IP-1 Q-TOKENS "New interviewprep preset").
|
|
10
|
+
- `toCssVars` `lightSelector` option: dark-first output (dark in `:root`, light in the given selector). Light-first output is byte-identical.
|
|
11
|
+
- `CssVarNames` gains per-mode names for the optional `ModeColors` fields (textTertiary, focusRing, brandFill, onBrandFill, successText, dangerText, dangerFill).
|
|
12
|
+
|
|
9
13
|
## 1.11.0
|
|
10
14
|
|
|
11
15
|
**Optional mode extras, increased-contrast overrides, motion springs, and the D1 "Living Room" `nextgame` preset.**
|
package/dist/index.d.mts
CHANGED
|
@@ -376,6 +376,48 @@ interface FinregSurfaceColors {
|
|
|
376
376
|
|
|
377
377
|
declare const DEFAULT_MOTION: Motion;
|
|
378
378
|
|
|
379
|
+
/**
|
|
380
|
+
* The shared overlay stacking scale — one named z-index per layer, ordered low to high.
|
|
381
|
+
*
|
|
382
|
+
* react-native-web mounts `Modal` in a body-level `position: fixed` container at
|
|
383
|
+
* `zIndex: 9999` (react-native-web `Modal/ModalAnimation.js`). We cannot move that number,
|
|
384
|
+
* so the scale is built around it: everything a Modal must cover sits below it, and
|
|
385
|
+
* everything that must stay usable WITH a Modal open (body-portalled menus, toasts, the
|
|
386
|
+
* blocking warm-up overlay) sits above it.
|
|
387
|
+
*
|
|
388
|
+
* Values only — framework-agnostic, usable as an RN `zIndex` or a CSS `z-index`.
|
|
389
|
+
*/
|
|
390
|
+
/** react-native-web's fixed Modal layer. A constant of the library, not a design choice. */
|
|
391
|
+
declare const RN_WEB_MODAL_Z_INDEX = 9999;
|
|
392
|
+
/**
|
|
393
|
+
* - `base`: in-flow content.
|
|
394
|
+
* - `sticky`: sticky table headers / columns.
|
|
395
|
+
* - `raised`: in-tree elements lifted over their siblings (cards, row chrome).
|
|
396
|
+
* - `drawer`: the mobile navigation drawer + scrim.
|
|
397
|
+
* - `palette`: the command palette, above the drawer.
|
|
398
|
+
* - `dropdown`: an in-tree (non-portalled) dropdown, or an anchor lifted while its menu is open.
|
|
399
|
+
* - `modal`: react-native-web's Modal container (read-only — RN-web sets it).
|
|
400
|
+
* - `popover`: every body-portalled menu / popover; clears an open Modal so a dropdown inside a
|
|
401
|
+
* dialog paints above it and receives the click.
|
|
402
|
+
* - `toast`: toasts stay readable over an open popover.
|
|
403
|
+
* - `blocking`: the full-screen blocking overlay (service warm-up); covers everything.
|
|
404
|
+
*/
|
|
405
|
+
declare const Z_INDEX: {
|
|
406
|
+
readonly base: 0;
|
|
407
|
+
readonly sticky: 2;
|
|
408
|
+
readonly raised: 30;
|
|
409
|
+
readonly drawer: 50;
|
|
410
|
+
readonly palette: 60;
|
|
411
|
+
readonly dropdown: 1000;
|
|
412
|
+
readonly modal: 9999;
|
|
413
|
+
readonly popover: number;
|
|
414
|
+
readonly toast: number;
|
|
415
|
+
readonly blocking: 100000;
|
|
416
|
+
};
|
|
417
|
+
type ZIndexLayer = keyof typeof Z_INDEX;
|
|
418
|
+
/** The layers in stacking order, lowest first. */
|
|
419
|
+
declare const Z_INDEX_ORDER: readonly ZIndexLayer[];
|
|
420
|
+
|
|
379
421
|
/**
|
|
380
422
|
* CSS custom-property NAME MAPS — the cross-stack naming contract.
|
|
381
423
|
*
|
|
@@ -1014,4 +1056,4 @@ declare function onBrandRatio(background: string, explicit?: string): number | n
|
|
|
1014
1056
|
*/
|
|
1015
1057
|
declare function canCarryAccessibleInk(background: string): boolean;
|
|
1016
1058
|
|
|
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 };
|
|
1059
|
+
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, RN_WEB_MODAL_Z_INDEX, 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, type ZIndexLayer, Z_INDEX, Z_INDEX_ORDER, canCarryAccessibleInk, contrastRatio, isHexColor, meetsContrast, onBrandRatio, relativeLuminance, resolveOnBrand, toCssVars, toRnTheme, toTailwindPreset, toUiTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -376,6 +376,48 @@ interface FinregSurfaceColors {
|
|
|
376
376
|
|
|
377
377
|
declare const DEFAULT_MOTION: Motion;
|
|
378
378
|
|
|
379
|
+
/**
|
|
380
|
+
* The shared overlay stacking scale — one named z-index per layer, ordered low to high.
|
|
381
|
+
*
|
|
382
|
+
* react-native-web mounts `Modal` in a body-level `position: fixed` container at
|
|
383
|
+
* `zIndex: 9999` (react-native-web `Modal/ModalAnimation.js`). We cannot move that number,
|
|
384
|
+
* so the scale is built around it: everything a Modal must cover sits below it, and
|
|
385
|
+
* everything that must stay usable WITH a Modal open (body-portalled menus, toasts, the
|
|
386
|
+
* blocking warm-up overlay) sits above it.
|
|
387
|
+
*
|
|
388
|
+
* Values only — framework-agnostic, usable as an RN `zIndex` or a CSS `z-index`.
|
|
389
|
+
*/
|
|
390
|
+
/** react-native-web's fixed Modal layer. A constant of the library, not a design choice. */
|
|
391
|
+
declare const RN_WEB_MODAL_Z_INDEX = 9999;
|
|
392
|
+
/**
|
|
393
|
+
* - `base`: in-flow content.
|
|
394
|
+
* - `sticky`: sticky table headers / columns.
|
|
395
|
+
* - `raised`: in-tree elements lifted over their siblings (cards, row chrome).
|
|
396
|
+
* - `drawer`: the mobile navigation drawer + scrim.
|
|
397
|
+
* - `palette`: the command palette, above the drawer.
|
|
398
|
+
* - `dropdown`: an in-tree (non-portalled) dropdown, or an anchor lifted while its menu is open.
|
|
399
|
+
* - `modal`: react-native-web's Modal container (read-only — RN-web sets it).
|
|
400
|
+
* - `popover`: every body-portalled menu / popover; clears an open Modal so a dropdown inside a
|
|
401
|
+
* dialog paints above it and receives the click.
|
|
402
|
+
* - `toast`: toasts stay readable over an open popover.
|
|
403
|
+
* - `blocking`: the full-screen blocking overlay (service warm-up); covers everything.
|
|
404
|
+
*/
|
|
405
|
+
declare const Z_INDEX: {
|
|
406
|
+
readonly base: 0;
|
|
407
|
+
readonly sticky: 2;
|
|
408
|
+
readonly raised: 30;
|
|
409
|
+
readonly drawer: 50;
|
|
410
|
+
readonly palette: 60;
|
|
411
|
+
readonly dropdown: 1000;
|
|
412
|
+
readonly modal: 9999;
|
|
413
|
+
readonly popover: number;
|
|
414
|
+
readonly toast: number;
|
|
415
|
+
readonly blocking: 100000;
|
|
416
|
+
};
|
|
417
|
+
type ZIndexLayer = keyof typeof Z_INDEX;
|
|
418
|
+
/** The layers in stacking order, lowest first. */
|
|
419
|
+
declare const Z_INDEX_ORDER: readonly ZIndexLayer[];
|
|
420
|
+
|
|
379
421
|
/**
|
|
380
422
|
* CSS custom-property NAME MAPS — the cross-stack naming contract.
|
|
381
423
|
*
|
|
@@ -1014,4 +1056,4 @@ declare function onBrandRatio(background: string, explicit?: string): number | n
|
|
|
1014
1056
|
*/
|
|
1015
1057
|
declare function canCarryAccessibleInk(background: string): boolean;
|
|
1016
1058
|
|
|
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 };
|
|
1059
|
+
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, RN_WEB_MODAL_Z_INDEX, 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, type ZIndexLayer, Z_INDEX, Z_INDEX_ORDER, canCarryAccessibleInk, contrastRatio, isHexColor, meetsContrast, onBrandRatio, relativeLuminance, resolveOnBrand, toCssVars, toRnTheme, toTailwindPreset, toUiTheme };
|
package/dist/index.js
CHANGED
|
@@ -31,6 +31,43 @@ var DEFAULT_MOTION = {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
+
// src/zIndex.ts
|
|
35
|
+
var RN_WEB_MODAL_Z_INDEX = 9999;
|
|
36
|
+
var BASE = 0;
|
|
37
|
+
var STICKY = 2;
|
|
38
|
+
var RAISED = 30;
|
|
39
|
+
var DRAWER = 50;
|
|
40
|
+
var PALETTE = 60;
|
|
41
|
+
var DROPDOWN = 1e3;
|
|
42
|
+
var POPOVER = RN_WEB_MODAL_Z_INDEX + 1;
|
|
43
|
+
var TOAST_HEADROOM = 100;
|
|
44
|
+
var TOAST = POPOVER + TOAST_HEADROOM;
|
|
45
|
+
var BLOCKING = 1e5;
|
|
46
|
+
var Z_INDEX = {
|
|
47
|
+
base: BASE,
|
|
48
|
+
sticky: STICKY,
|
|
49
|
+
raised: RAISED,
|
|
50
|
+
drawer: DRAWER,
|
|
51
|
+
palette: PALETTE,
|
|
52
|
+
dropdown: DROPDOWN,
|
|
53
|
+
modal: RN_WEB_MODAL_Z_INDEX,
|
|
54
|
+
popover: POPOVER,
|
|
55
|
+
toast: TOAST,
|
|
56
|
+
blocking: BLOCKING
|
|
57
|
+
};
|
|
58
|
+
var Z_INDEX_ORDER = [
|
|
59
|
+
"base",
|
|
60
|
+
"sticky",
|
|
61
|
+
"raised",
|
|
62
|
+
"drawer",
|
|
63
|
+
"palette",
|
|
64
|
+
"dropdown",
|
|
65
|
+
"modal",
|
|
66
|
+
"popover",
|
|
67
|
+
"toast",
|
|
68
|
+
"blocking"
|
|
69
|
+
];
|
|
70
|
+
|
|
34
71
|
// src/varNames.ts
|
|
35
72
|
var DEFAULT_CSS_VAR_NAMES = {
|
|
36
73
|
primary: "--primary",
|
|
@@ -938,9 +975,12 @@ exports.NEXTGAME_TOKENS = NEXTGAME_TOKENS;
|
|
|
938
975
|
exports.ON_BRAND_DARK_INK = ON_BRAND_DARK_INK;
|
|
939
976
|
exports.ON_BRAND_LIGHT_INK = ON_BRAND_LIGHT_INK;
|
|
940
977
|
exports.PRESETS = PRESETS;
|
|
978
|
+
exports.RN_WEB_MODAL_Z_INDEX = RN_WEB_MODAL_Z_INDEX;
|
|
941
979
|
exports.UI_DEEP_STEP = UI_DEEP_STEP;
|
|
942
980
|
exports.UI_MAIN_STEP = UI_MAIN_STEP;
|
|
943
981
|
exports.UI_TINT_STEP = UI_TINT_STEP;
|
|
982
|
+
exports.Z_INDEX = Z_INDEX;
|
|
983
|
+
exports.Z_INDEX_ORDER = Z_INDEX_ORDER;
|
|
944
984
|
exports.canCarryAccessibleInk = canCarryAccessibleInk;
|
|
945
985
|
exports.contrastRatio = contrastRatio;
|
|
946
986
|
exports.isHexColor = isHexColor;
|