@dloizides/design-tokens 1.10.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 +27 -0
- package/README.md +1 -0
- package/dist/index.d.mts +124 -23
- package/dist/index.d.ts +124 -23
- package/dist/index.js +202 -43
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +201 -44
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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",
|
|
@@ -668,12 +797,14 @@ var KATALOGOS_TOKENS = {
|
|
|
668
797
|
};
|
|
669
798
|
|
|
670
799
|
// src/presets/nextgame.ts
|
|
800
|
+
var EASE_OUT = { css: "cubic-bezier(0.2,0.8,0.2,1)", bezier: [0.2, 0.8, 0.2, 1] };
|
|
801
|
+
var EASE_IN = { css: "cubic-bezier(0.4,0,1,1)", bezier: [0.4, 0, 1, 1] };
|
|
671
802
|
var NEXTGAME_TOKENS = {
|
|
672
|
-
/** Signal amber — the recommendation/buy colour. */
|
|
803
|
+
/** Signal amber — the recommendation/buy colour on light surfaces. */
|
|
673
804
|
primary: "#FF8C1A",
|
|
674
|
-
/** Deep teal — structure
|
|
805
|
+
/** Deep teal — light-surface structure and links. */
|
|
675
806
|
secondary: "#0E7C86",
|
|
676
|
-
/** Arcade magenta —
|
|
807
|
+
/** Arcade magenta — light-surface call-out only. */
|
|
677
808
|
accent: "#F5008B",
|
|
678
809
|
semantic: {
|
|
679
810
|
success: "#0E9E6E",
|
|
@@ -696,31 +827,56 @@ var NEXTGAME_TOKENS = {
|
|
|
696
827
|
divider: "#E3D9CB"
|
|
697
828
|
},
|
|
698
829
|
dark: {
|
|
699
|
-
background: "#
|
|
700
|
-
surface: "#
|
|
701
|
-
surfaceElevated: "#
|
|
702
|
-
surfaceMuted: "#
|
|
703
|
-
text: "#
|
|
704
|
-
textSecondary: "#
|
|
705
|
-
|
|
706
|
-
|
|
830
|
+
background: "#0A0D12",
|
|
831
|
+
surface: "#121720",
|
|
832
|
+
surfaceElevated: "#1A212C",
|
|
833
|
+
surfaceMuted: "#070A0E",
|
|
834
|
+
text: "#F2F4F7",
|
|
835
|
+
textSecondary: "#A9B3C1",
|
|
836
|
+
textTertiary: "#8C97A7",
|
|
837
|
+
border: "#6B778A",
|
|
838
|
+
divider: "#242C38",
|
|
839
|
+
focusRing: "#FFFFFF",
|
|
840
|
+
brandFill: "#FFD37A",
|
|
841
|
+
onBrandFill: "#1A1204",
|
|
842
|
+
successText: "#7FD6A4",
|
|
843
|
+
dangerText: "#FF9E8F",
|
|
844
|
+
dangerFill: "#3A1D1A"
|
|
845
|
+
},
|
|
846
|
+
contrastMore: {
|
|
847
|
+
dark: { textSecondary: "#D5DBE3", textTertiary: "#C0C8D3", border: "#9AA5B4", divider: "#3A4452" },
|
|
848
|
+
focusRingWidth: 4
|
|
707
849
|
},
|
|
708
850
|
typography: {
|
|
709
|
-
fontFamily: '"
|
|
710
|
-
|
|
711
|
-
headingScale: 1.1
|
|
851
|
+
fontFamily: '"Barlow", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif',
|
|
852
|
+
headingScale: 1
|
|
712
853
|
},
|
|
713
854
|
radii: {
|
|
714
855
|
xs: "6px",
|
|
715
|
-
sm: "
|
|
856
|
+
sm: "12px",
|
|
716
857
|
md: "14px",
|
|
717
858
|
lg: "22px",
|
|
718
859
|
pill: "999px"
|
|
719
860
|
},
|
|
720
861
|
shadows: {
|
|
721
|
-
sm: "0 1px 2px rgba(
|
|
722
|
-
md: "0
|
|
723
|
-
pop: "0
|
|
862
|
+
sm: "0 1px 2px rgba(0, 0, 0, .6)",
|
|
863
|
+
md: "0 14px 30px -18px rgba(0, 0, 0, .8)",
|
|
864
|
+
pop: "0 34px 60px -22px rgba(0, 0, 0, .9)"
|
|
865
|
+
},
|
|
866
|
+
/**
|
|
867
|
+
* Spec §6 mapped onto the shared 4-slot shape, NOT `DEFAULT_MOTION`: D1 moves
|
|
868
|
+
* are slower and softer than the portal defaults. The 90ms confirm and the
|
|
869
|
+
* 400ms import-bar durations are product-event timings owned by the app
|
|
870
|
+
* (nextgame-web `src/theme/d1.ts`), not tokens.
|
|
871
|
+
*/
|
|
872
|
+
motion: {
|
|
873
|
+
durations: { instant: 0, fast: 160, base: 240, slow: 320 },
|
|
874
|
+
easings: { standard: EASE_OUT, decelerate: EASE_OUT, accelerate: EASE_IN },
|
|
875
|
+
springs: {
|
|
876
|
+
focus: { stiffness: 420, damping: 34 },
|
|
877
|
+
settle: { stiffness: 260, damping: 30 },
|
|
878
|
+
press: { stiffness: 500, damping: 28 }
|
|
879
|
+
}
|
|
724
880
|
},
|
|
725
881
|
branding: {
|
|
726
882
|
logoContentId: null,
|
|
@@ -735,7 +891,8 @@ var PRESETS = {
|
|
|
735
891
|
erevna: EREVNA_TOKENS,
|
|
736
892
|
katalogos: KATALOGOS_TOKENS,
|
|
737
893
|
digitalkin: DIGITALKIN_TOKENS,
|
|
738
|
-
nextgame: NEXTGAME_TOKENS
|
|
894
|
+
nextgame: NEXTGAME_TOKENS,
|
|
895
|
+
interviewprep: INTERVIEWPREP_TOKENS
|
|
739
896
|
};
|
|
740
897
|
|
|
741
898
|
// src/finregModules.ts
|
|
@@ -774,6 +931,8 @@ exports.DIGITALKIN_TOKENS = DIGITALKIN_TOKENS;
|
|
|
774
931
|
exports.EREVNA_TOKENS = EREVNA_TOKENS;
|
|
775
932
|
exports.FINREG_MODULE_COLORS = FINREG_MODULE_COLORS;
|
|
776
933
|
exports.FINREG_SURFACE_COLORS = FINREG_SURFACE_COLORS;
|
|
934
|
+
exports.INTERVIEWPREP_CSS_VAR_NAMES = INTERVIEWPREP_CSS_VAR_NAMES;
|
|
935
|
+
exports.INTERVIEWPREP_TOKENS = INTERVIEWPREP_TOKENS;
|
|
777
936
|
exports.KATALOGOS_TOKENS = KATALOGOS_TOKENS;
|
|
778
937
|
exports.NEXTGAME_TOKENS = NEXTGAME_TOKENS;
|
|
779
938
|
exports.ON_BRAND_DARK_INK = ON_BRAND_DARK_INK;
|