@dloizides/design-tokens 1.14.0 → 1.16.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 +4 -0
- package/dist/index.d.mts +11 -10
- package/dist/index.d.ts +11 -10
- package/dist/index.js +68 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +67 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.16.0
|
|
4
|
+
|
|
5
|
+
- New `FLIER_TOKENS` preset (FLIER-1 "Flier Studio" D7 "App palette: P-A Ink"): light Ink palette, Night dark palette with `brandFill`/`onBrandFill`, a `focusRing` per mode (8.95:1 light, 10.81:1 dark), borders clearing 3:1, text and secondary text at AA on every surface. Registered in `PRESETS` as `flier`; its dark `semantic.error` joins the known unsplit-error gaps (2.24:1).
|
|
6
|
+
|
|
3
7
|
## 1.14.0
|
|
4
8
|
|
|
5
9
|
- One fleet focus ring (FOCUS-RING-1 "One focus ring across the shared kit"): `FOCUS_RING` (2 px solid, 2 px offset), `resolveFocusRingColor` (the mode's `focusRing` token, else the first of primary / a lighter brand step / text reaching 3:1 on the ground), `focusRingOutline` and `isFocusVisible` (keyboard focus only). Consumed by ui-buttons, ui-forms and ui-payments.
|
package/dist/index.d.mts
CHANGED
|
@@ -444,18 +444,11 @@ interface FocusRingOutline {
|
|
|
444
444
|
outlineStyle: typeof FOCUS_RING.style;
|
|
445
445
|
outlineWidth: number;
|
|
446
446
|
}
|
|
447
|
-
/**
|
|
448
|
-
* The focus-ring colour for one mode: the explicit `focusRing` token, else the first of
|
|
449
|
-
* primary, primaryLight and text that reaches 3:1 (WCAG 1.4.11) on the background.
|
|
450
|
-
*/
|
|
447
|
+
/** The focus-ring colour for one mode: the focusRing token, else the first candidate reaching 3:1 on the ground. */
|
|
451
448
|
declare function resolveFocusRingColor(input: FocusRingColorInput): string;
|
|
452
449
|
/** The outline style object for the focus ring in `color`. */
|
|
453
450
|
declare function focusRingOutline(color: string): FocusRingOutline;
|
|
454
|
-
/**
|
|
455
|
-
* True when a focus event's target is keyboard focus (`:focus-visible`). Targets without
|
|
456
|
-
* `matches` (native hosts) and browsers that reject the selector count as visible, so the
|
|
457
|
-
* ring is never lost.
|
|
458
|
-
*/
|
|
451
|
+
/** True when a focus target is keyboard focus; targets that cannot answer count as visible. */
|
|
459
452
|
declare function isFocusVisible(target: unknown): boolean;
|
|
460
453
|
|
|
461
454
|
/**
|
|
@@ -865,6 +858,9 @@ declare const DIGITALKIN_TOKENS: DesignTokens;
|
|
|
865
858
|
*/
|
|
866
859
|
declare const EREVNA_TOKENS: DesignTokens;
|
|
867
860
|
|
|
861
|
+
/** Flier Studio tokens: D7 "P-A Ink" light palette and the Night dark palette (FLIER-1 "Flier Studio"). */
|
|
862
|
+
declare const FLIER_TOKENS: DesignTokens;
|
|
863
|
+
|
|
868
864
|
/**
|
|
869
865
|
* InterviewPrep (interview-prep-hub.dloizides.com) tokens, seeded from
|
|
870
866
|
* `InterviewPrep/sites/portal/theme.css` as of 2026-09-29 (REDESIGN-IP-1, owner
|
|
@@ -1096,4 +1092,9 @@ declare function onBrandRatio(background: string, explicit?: string): number | n
|
|
|
1096
1092
|
*/
|
|
1097
1093
|
declare function canCarryAccessibleInk(background: string): boolean;
|
|
1098
1094
|
|
|
1099
|
-
|
|
1095
|
+
/** A colour scale keyed by step ('50'…'900'); a theme only guarantees some steps. */
|
|
1096
|
+
type ColorStepScale = Readonly<Record<string, string | undefined>>;
|
|
1097
|
+
/** The first scale step that clears 4.5:1 on the ground (light or dark step order), else the highest-contrast one. */
|
|
1098
|
+
declare function readableScaleInk(scale: ColorStepScale, ground: string, lightSteps: readonly string[], darkSteps: readonly string[]): string;
|
|
1099
|
+
|
|
1100
|
+
export { AA_LARGE_TEXT_RATIO, AA_NON_TEXT_RATIO, AA_NORMAL_TEXT_RATIO, AML_CSS_VAR_NAMES, AML_TOKENS, type BrandExtras, type Branding, type ColorStepScale, type ContrastMoreOverrides, type CssVarNames, DEFAULT_CSS_VAR_NAMES, DEFAULT_MOTION, DIGITALKIN_TOKENS, type DesignTokens, EREVNA_TOKENS, FINREG_MODULE_COLORS, FINREG_SURFACE_COLORS, FLIER_TOKENS, FOCUS_RING, type FinregModuleColor, type FinregModuleColors, type FinregSurfaceColors, type FocusRingColorInput, type FocusRingOutline, 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, focusRingOutline, isFocusVisible, isHexColor, meetsContrast, onBrandRatio, readableScaleInk, relativeLuminance, resolveFocusRingColor, resolveOnBrand, toCssVars, toRnTheme, toTailwindPreset, toUiTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -444,18 +444,11 @@ interface FocusRingOutline {
|
|
|
444
444
|
outlineStyle: typeof FOCUS_RING.style;
|
|
445
445
|
outlineWidth: number;
|
|
446
446
|
}
|
|
447
|
-
/**
|
|
448
|
-
* The focus-ring colour for one mode: the explicit `focusRing` token, else the first of
|
|
449
|
-
* primary, primaryLight and text that reaches 3:1 (WCAG 1.4.11) on the background.
|
|
450
|
-
*/
|
|
447
|
+
/** The focus-ring colour for one mode: the focusRing token, else the first candidate reaching 3:1 on the ground. */
|
|
451
448
|
declare function resolveFocusRingColor(input: FocusRingColorInput): string;
|
|
452
449
|
/** The outline style object for the focus ring in `color`. */
|
|
453
450
|
declare function focusRingOutline(color: string): FocusRingOutline;
|
|
454
|
-
/**
|
|
455
|
-
* True when a focus event's target is keyboard focus (`:focus-visible`). Targets without
|
|
456
|
-
* `matches` (native hosts) and browsers that reject the selector count as visible, so the
|
|
457
|
-
* ring is never lost.
|
|
458
|
-
*/
|
|
451
|
+
/** True when a focus target is keyboard focus; targets that cannot answer count as visible. */
|
|
459
452
|
declare function isFocusVisible(target: unknown): boolean;
|
|
460
453
|
|
|
461
454
|
/**
|
|
@@ -865,6 +858,9 @@ declare const DIGITALKIN_TOKENS: DesignTokens;
|
|
|
865
858
|
*/
|
|
866
859
|
declare const EREVNA_TOKENS: DesignTokens;
|
|
867
860
|
|
|
861
|
+
/** Flier Studio tokens: D7 "P-A Ink" light palette and the Night dark palette (FLIER-1 "Flier Studio"). */
|
|
862
|
+
declare const FLIER_TOKENS: DesignTokens;
|
|
863
|
+
|
|
868
864
|
/**
|
|
869
865
|
* InterviewPrep (interview-prep-hub.dloizides.com) tokens, seeded from
|
|
870
866
|
* `InterviewPrep/sites/portal/theme.css` as of 2026-09-29 (REDESIGN-IP-1, owner
|
|
@@ -1096,4 +1092,9 @@ declare function onBrandRatio(background: string, explicit?: string): number | n
|
|
|
1096
1092
|
*/
|
|
1097
1093
|
declare function canCarryAccessibleInk(background: string): boolean;
|
|
1098
1094
|
|
|
1099
|
-
|
|
1095
|
+
/** A colour scale keyed by step ('50'…'900'); a theme only guarantees some steps. */
|
|
1096
|
+
type ColorStepScale = Readonly<Record<string, string | undefined>>;
|
|
1097
|
+
/** The first scale step that clears 4.5:1 on the ground (light or dark step order), else the highest-contrast one. */
|
|
1098
|
+
declare function readableScaleInk(scale: ColorStepScale, ground: string, lightSteps: readonly string[], darkSteps: readonly string[]): string;
|
|
1099
|
+
|
|
1100
|
+
export { AA_LARGE_TEXT_RATIO, AA_NON_TEXT_RATIO, AA_NORMAL_TEXT_RATIO, AML_CSS_VAR_NAMES, AML_TOKENS, type BrandExtras, type Branding, type ColorStepScale, type ContrastMoreOverrides, type CssVarNames, DEFAULT_CSS_VAR_NAMES, DEFAULT_MOTION, DIGITALKIN_TOKENS, type DesignTokens, EREVNA_TOKENS, FINREG_MODULE_COLORS, FINREG_SURFACE_COLORS, FLIER_TOKENS, FOCUS_RING, type FinregModuleColor, type FinregModuleColors, type FinregSurfaceColors, type FocusRingColorInput, type FocusRingOutline, 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, focusRingOutline, isFocusVisible, isHexColor, meetsContrast, onBrandRatio, readableScaleInk, relativeLuminance, resolveFocusRingColor, resolveOnBrand, toCssVars, toRnTheme, toTailwindPreset, toUiTheme };
|
package/dist/index.js
CHANGED
|
@@ -769,6 +769,47 @@ var EREVNA_TOKENS = {
|
|
|
769
769
|
}
|
|
770
770
|
};
|
|
771
771
|
|
|
772
|
+
// src/presets/flier.ts
|
|
773
|
+
var FLIER_TOKENS = {
|
|
774
|
+
primary: "#4a423c",
|
|
775
|
+
onBrand: "#ffffff",
|
|
776
|
+
secondary: "#6f655c",
|
|
777
|
+
accent: "#e9b47f",
|
|
778
|
+
semantic: {
|
|
779
|
+
success: "#2f7a4f",
|
|
780
|
+
warning: "#9a5b00",
|
|
781
|
+
error: "#b3261e",
|
|
782
|
+
info: "#4a423c"
|
|
783
|
+
},
|
|
784
|
+
light: {
|
|
785
|
+
background: "#f5f4f2",
|
|
786
|
+
surface: "#fbfaf8",
|
|
787
|
+
surfaceElevated: "#ffffff",
|
|
788
|
+
text: "#2f2925",
|
|
789
|
+
textSecondary: "#6f655c",
|
|
790
|
+
border: "#8c8279",
|
|
791
|
+
divider: "#e6e2dc",
|
|
792
|
+
focusRing: "#4a423c"
|
|
793
|
+
},
|
|
794
|
+
dark: {
|
|
795
|
+
background: "#1c1a17",
|
|
796
|
+
surface: "#25221e",
|
|
797
|
+
surfaceElevated: "#2c2824",
|
|
798
|
+
text: "#f4efe8",
|
|
799
|
+
textSecondary: "#a59a8c",
|
|
800
|
+
border: "#80766a",
|
|
801
|
+
divider: "#3a352f",
|
|
802
|
+
focusRing: "#e8dccb",
|
|
803
|
+
brandFill: "#e8dccb",
|
|
804
|
+
onBrandFill: "#1c1a17"
|
|
805
|
+
},
|
|
806
|
+
branding: {
|
|
807
|
+
logoContentId: null,
|
|
808
|
+
faviconContentId: null,
|
|
809
|
+
presetId: "flier"
|
|
810
|
+
}
|
|
811
|
+
};
|
|
812
|
+
|
|
772
813
|
// src/presets/interviewprep.ts
|
|
773
814
|
var INTERVIEWPREP_TOKENS = {
|
|
774
815
|
primary: "#c0512d",
|
|
@@ -970,7 +1011,8 @@ var PRESETS = {
|
|
|
970
1011
|
katalogos: KATALOGOS_TOKENS,
|
|
971
1012
|
digitalkin: DIGITALKIN_TOKENS,
|
|
972
1013
|
nextgame: NEXTGAME_TOKENS,
|
|
973
|
-
interviewprep: INTERVIEWPREP_TOKENS
|
|
1014
|
+
interviewprep: INTERVIEWPREP_TOKENS,
|
|
1015
|
+
flier: FLIER_TOKENS
|
|
974
1016
|
};
|
|
975
1017
|
|
|
976
1018
|
// src/finregModules.ts
|
|
@@ -998,6 +1040,29 @@ var FINREG_SURFACE_COLORS = {
|
|
|
998
1040
|
deepest: "#071526"
|
|
999
1041
|
};
|
|
1000
1042
|
|
|
1043
|
+
// src/readableScaleInk.ts
|
|
1044
|
+
var DARK_GROUND_LUMINANCE = 0.179;
|
|
1045
|
+
function definedSteps(scale, steps) {
|
|
1046
|
+
return steps.map((step) => scale[step]).filter((ink) => ink !== void 0);
|
|
1047
|
+
}
|
|
1048
|
+
function highestContrast(inks, ground) {
|
|
1049
|
+
return inks.reduce(
|
|
1050
|
+
(top, ink) => top === void 0 || contrastRatio(ink, ground) > contrastRatio(top, ground) ? ink : top,
|
|
1051
|
+
void 0
|
|
1052
|
+
);
|
|
1053
|
+
}
|
|
1054
|
+
function readableScaleInk(scale, ground, lightSteps, darkSteps) {
|
|
1055
|
+
const lightInks = definedSteps(scale, lightSteps);
|
|
1056
|
+
const fallback = lightInks[0] ?? scale["500"] ?? "";
|
|
1057
|
+
if (!isHexColor(ground)) {
|
|
1058
|
+
return fallback;
|
|
1059
|
+
}
|
|
1060
|
+
const isDarkGround = relativeLuminance(ground) < DARK_GROUND_LUMINANCE;
|
|
1061
|
+
const inks = (isDarkGround ? definedSteps(scale, darkSteps) : lightInks).filter(isHexColor);
|
|
1062
|
+
const passing = inks.find((ink) => contrastRatio(ink, ground) >= AA_NORMAL_TEXT_RATIO);
|
|
1063
|
+
return passing ?? highestContrast(inks, ground) ?? fallback;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1001
1066
|
exports.AA_LARGE_TEXT_RATIO = AA_LARGE_TEXT_RATIO;
|
|
1002
1067
|
exports.AA_NON_TEXT_RATIO = AA_NON_TEXT_RATIO;
|
|
1003
1068
|
exports.AA_NORMAL_TEXT_RATIO = AA_NORMAL_TEXT_RATIO;
|
|
@@ -1009,6 +1074,7 @@ exports.DIGITALKIN_TOKENS = DIGITALKIN_TOKENS;
|
|
|
1009
1074
|
exports.EREVNA_TOKENS = EREVNA_TOKENS;
|
|
1010
1075
|
exports.FINREG_MODULE_COLORS = FINREG_MODULE_COLORS;
|
|
1011
1076
|
exports.FINREG_SURFACE_COLORS = FINREG_SURFACE_COLORS;
|
|
1077
|
+
exports.FLIER_TOKENS = FLIER_TOKENS;
|
|
1012
1078
|
exports.FOCUS_RING = FOCUS_RING;
|
|
1013
1079
|
exports.INTERVIEWPREP_CSS_VAR_NAMES = INTERVIEWPREP_CSS_VAR_NAMES;
|
|
1014
1080
|
exports.INTERVIEWPREP_TOKENS = INTERVIEWPREP_TOKENS;
|
|
@@ -1030,6 +1096,7 @@ exports.isFocusVisible = isFocusVisible;
|
|
|
1030
1096
|
exports.isHexColor = isHexColor;
|
|
1031
1097
|
exports.meetsContrast = meetsContrast;
|
|
1032
1098
|
exports.onBrandRatio = onBrandRatio;
|
|
1099
|
+
exports.readableScaleInk = readableScaleInk;
|
|
1033
1100
|
exports.relativeLuminance = relativeLuminance;
|
|
1034
1101
|
exports.resolveFocusRingColor = resolveFocusRingColor;
|
|
1035
1102
|
exports.resolveOnBrand = resolveOnBrand;
|