@ttoss/fsl-theme 1.1.12 → 1.1.14
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/dist/Types-BiBa17RL.d.cts +1427 -0
- package/dist/Types-BiBa17RL.d.mts +1427 -0
- package/dist/baseBundle-DxvXyhGa.mjs +17 -0
- package/dist/baseBundle-iEFf5nqT.cjs +22 -0
- package/dist/{esm/chunk-SE5Z52RE.js → createTheme-BLNYztZU.mjs} +76 -172
- package/dist/createTheme-Cv6RP9D6.cjs +1825 -0
- package/dist/css.cjs +48 -0
- package/dist/{css.d.ts → css.d.cts} +67 -63
- package/dist/css.d.mts +168 -0
- package/dist/css.mjs +42 -0
- package/dist/dataviz/index.cjs +45 -0
- package/dist/dataviz/{index.d.ts → index.d.cts} +9 -5
- package/dist/dataviz/index.d.mts +66 -0
- package/dist/dataviz/index.mjs +39 -0
- package/dist/dtcg.cjs +115 -0
- package/dist/{dtcg.d.ts → dtcg.d.cts} +9 -7
- package/dist/dtcg.d.mts +51 -0
- package/dist/dtcg.mjs +112 -0
- package/dist/helpers-4p4-QVt_.cjs +258 -0
- package/dist/helpers-CaswNJMy.mjs +211 -0
- package/dist/{index.d.ts → index-CsIjfw86.d.cts} +42 -34
- package/dist/index-nJrjI0BA.d.mts +94 -0
- package/dist/index.cjs +16 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.mjs +7 -0
- package/dist/{react.d.ts → react-CGa6FlNL.d.cts} +130 -106
- package/dist/react-DnKxR2gK.d.mts +370 -0
- package/dist/react-EUwpdvY7.cjs +481 -0
- package/dist/react.cjs +12 -0
- package/dist/react.d.cts +4 -0
- package/dist/react.d.mts +4 -0
- package/dist/react.mjs +412 -0
- package/dist/runtime-entry.cjs +9 -0
- package/dist/runtime-entry.d.cts +3 -0
- package/dist/runtime-entry.d.mts +3 -0
- package/dist/runtime-entry.mjs +3 -0
- package/dist/{runtime-entry.d.ts → ssrScript-BVysxDws.d.cts} +26 -23
- package/dist/ssrScript-BVysxDws.d.mts +98 -0
- package/dist/ssrScript-CRfrN8Pm.cjs +202 -0
- package/dist/ssrScript-D3kGPQpi.mjs +179 -0
- package/dist/themes/bruttal.cjs +75 -0
- package/dist/themes/bruttal.d.cts +3 -0
- package/dist/themes/bruttal.d.mts +3 -0
- package/dist/themes/bruttal.mjs +72 -0
- package/dist/themes/corporate.cjs +34 -0
- package/dist/themes/corporate.d.cts +3 -0
- package/dist/themes/corporate.d.mts +3 -0
- package/dist/{esm/chunk-TPMN75JM.js → themes/corporate.mjs} +7 -5
- package/dist/themes/oca.cjs +34 -0
- package/dist/themes/oca.d.cts +3 -0
- package/dist/themes/oca.d.mts +3 -0
- package/dist/{esm/chunk-DU4QDQUC.js → themes/oca.mjs} +7 -5
- package/dist/themes/ventures.cjs +34 -0
- package/dist/themes/ventures.d.cts +3 -0
- package/dist/themes/ventures.d.mts +3 -0
- package/dist/{esm/chunk-BXKVVQEP.js → themes/ventures.mjs} +7 -5
- package/dist/toCssVars-CYZCe-on.mjs +286 -0
- package/dist/toCssVars-DudHKvt2.cjs +297 -0
- package/dist/{esm/chunk-4Q4P3JBB.js → tokenRegistry-DjgSN3oU.mjs} +23 -20
- package/dist/tokenRegistry-OhaJ9sPJ.cjs +199 -0
- package/dist/vars.cjs +127 -0
- package/dist/{vars.d.ts → vars.d.cts} +8 -7
- package/dist/vars.d.mts +128 -0
- package/dist/vars.mjs +123 -0
- package/dist/withDataviz-B4pVsOwV.cjs +192 -0
- package/dist/{esm/chunk-FBVUI2PK.js → withDataviz-DY5s7R51.mjs} +40 -12
- package/package.json +6 -6
- package/dist/Types-6tR0_2Ss.d.ts +0 -1452
- package/dist/esm/chunk-5PWPAQMC.js +0 -9
- package/dist/esm/chunk-HRNXVRS3.js +0 -54
- package/dist/esm/chunk-IJGA42O6.js +0 -141
- package/dist/esm/chunk-PQPQNZ73.js +0 -262
- package/dist/esm/chunk-UMRQ4OTX.js +0 -11
- package/dist/esm/chunk-VL6EGE6Z.js +0 -222
- package/dist/esm/chunk-WVQSTQD5.js +0 -192
- package/dist/esm/css.js +0 -6
- package/dist/esm/dataviz/index.js +0 -19
- package/dist/esm/dtcg.js +0 -65
- package/dist/esm/index.js +0 -10
- package/dist/esm/react.js +0 -8
- package/dist/esm/runtime-entry.js +0 -4
- package/dist/esm/themes/bruttal.js +0 -6
- package/dist/esm/themes/corporate.js +0 -6
- package/dist/esm/themes/oca.js +0 -6
- package/dist/esm/themes/ventures.js +0 -6
- package/dist/esm/vars.js +0 -28
- package/dist/themes/bruttal.d.ts +0 -5
- package/dist/themes/corporate.d.ts +0 -5
- package/dist/themes/oca.d.ts +0 -5
- package/dist/themes/ventures.d.ts +0 -5
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
-
import {
|
|
2
|
+
import { c as validateRefs, r as deepMerge } from "./helpers-CaswNJMy.mjs";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
//#region src/baseTheme.ts
|
|
5
|
+
/**
|
|
6
|
+
* **Foundation** — Neutral baseline theme.
|
|
7
|
+
*
|
|
8
|
+
* System fonts, gray palette, and balanced proportions. Serves as the
|
|
9
|
+
* canonical base that all other themes extend via `createTheme`.
|
|
10
|
+
*/
|
|
11
|
+
const baseTheme = {
|
|
9
12
|
core: {
|
|
10
|
-
// -- Colors -------------------------------------------------------------
|
|
11
|
-
// Core colors are intent-free primitives. Scale positions only.
|
|
12
13
|
colors: {
|
|
13
14
|
brand: {
|
|
14
15
|
50: "#eff6ff",
|
|
@@ -84,7 +85,6 @@ var baseTheme = {
|
|
|
84
85
|
900: "#831843"
|
|
85
86
|
}
|
|
86
87
|
},
|
|
87
|
-
// -- Elevation ----------------------------------------------------------
|
|
88
88
|
elevation: {
|
|
89
89
|
level: {
|
|
90
90
|
0: "none",
|
|
@@ -93,7 +93,6 @@ var baseTheme = {
|
|
|
93
93
|
3: "0 8px 16px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.08)",
|
|
94
94
|
4: "0 16px 32px rgba(0,0,0,0.14), 0 8px 16px rgba(0,0,0,0.10)"
|
|
95
95
|
},
|
|
96
|
-
// High-opacity recipes — stronger depth contrast for dark or heavily-colored surfaces
|
|
97
96
|
emphatic: {
|
|
98
97
|
0: "none",
|
|
99
98
|
1: "0 1px 2px rgba(0,0,0,0.20), 0 1px 1px rgba(0,0,0,0.14)",
|
|
@@ -102,12 +101,11 @@ var baseTheme = {
|
|
|
102
101
|
4: "0 16px 32px rgba(0,0,0,0.34), 0 8px 16px rgba(0,0,0,0.28)"
|
|
103
102
|
}
|
|
104
103
|
},
|
|
105
|
-
// -- Font Primitives ----------------------------------------------------
|
|
106
104
|
font: {
|
|
107
105
|
family: {
|
|
108
|
-
sans:
|
|
109
|
-
serif:
|
|
110
|
-
mono:
|
|
106
|
+
sans: "ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, \"Apple Color Emoji\", \"Segoe UI Emoji\"",
|
|
107
|
+
serif: "ui-serif, Georgia, Cambria, \"Times New Roman\", Times, serif",
|
|
108
|
+
mono: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace"
|
|
111
109
|
},
|
|
112
110
|
weight: {
|
|
113
111
|
regular: 400,
|
|
@@ -139,7 +137,6 @@ var baseTheme = {
|
|
|
139
137
|
ordinal: "ordinal",
|
|
140
138
|
normal: "normal"
|
|
141
139
|
},
|
|
142
|
-
// -- Font Size Scale (Responsive Engine) --------------------------------
|
|
143
140
|
scale: {
|
|
144
141
|
text: {
|
|
145
142
|
1: "clamp(12px, calc(0.6cqi + 10px), 14px)",
|
|
@@ -159,23 +156,6 @@ var baseTheme = {
|
|
|
159
156
|
}
|
|
160
157
|
}
|
|
161
158
|
},
|
|
162
|
-
// -- Spacing (Responsive Engine) ----------------------------------------
|
|
163
|
-
// Tuned for medium-high density (mouse-first). The engine caps at 6px
|
|
164
|
-
// — above that, button paddings compound with hit floors and produce
|
|
165
|
-
// visually heavy controls (>48px desktop) that fight modern UI rhythm
|
|
166
|
-
// (Material 40px, GitHub 32–40px, Bootstrap 38px). Touch density is
|
|
167
|
-
// restored automatically via `@media (any-pointer: coarse)` overrides.
|
|
168
|
-
//
|
|
169
|
-
// CSS-coupled tokens (registered in model.md §8 → "CSS-coupled core
|
|
170
|
-
// tokens"):
|
|
171
|
-
// • `engine.unit` — fluid primitive (`clamp()` + `cqi`); viewport
|
|
172
|
-
// fallback emitted by `toCssVars`.
|
|
173
|
-
// • steps 1..16 — cascade-preserving aliases that reference
|
|
174
|
-
// `--tt-core-spacing-engine-unit` directly so the engine stays a
|
|
175
|
-
// single point of override. Replacing `var()` with a token ref
|
|
176
|
-
// would inline `clamp(...cqi...)` into every step and inflate the
|
|
177
|
-
// `@supports (width: 1cqi)` block. Non-CSS consumers receive the
|
|
178
|
-
// unresolved expression — see model.md §8.
|
|
179
159
|
spacing: {
|
|
180
160
|
engine: {
|
|
181
161
|
unit: "clamp(4px, 0.25cqi + 3px, 6px)"
|
|
@@ -190,7 +170,6 @@ var baseTheme = {
|
|
|
190
170
|
12: "calc(12 * var(--tt-core-spacing-engine-unit))",
|
|
191
171
|
16: "calc(16 * var(--tt-core-spacing-engine-unit))"
|
|
192
172
|
},
|
|
193
|
-
// -- Sizing (Responsive Engine) -----------------------------------------
|
|
194
173
|
sizing: {
|
|
195
174
|
ramp: {
|
|
196
175
|
ui: {
|
|
@@ -232,20 +211,11 @@ var baseTheme = {
|
|
|
232
211
|
}
|
|
233
212
|
},
|
|
234
213
|
hit: {
|
|
235
|
-
// Fine: clamp(floor, preferred, max) — floor is the fixed ergonomic
|
|
236
|
-
// minimum; preferred scales with rem so user font-size preferences
|
|
237
|
-
// (accessibility) are respected. Caps tuned to medium-high density:
|
|
238
|
-
// min 32px → secondary / icon-only / dense list controls
|
|
239
|
-
// base 40px → default button (Material 40, GitHub 40, Tailwind 40)
|
|
240
|
-
// prominent 48px → hero CTAs and primary form submits
|
|
241
|
-
// 24px WCAG 2.2 minimum is well exceeded at every step.
|
|
242
214
|
fine: {
|
|
243
215
|
min: "clamp(28px, 1.75rem, 32px)",
|
|
244
216
|
base: "clamp(32px, 2rem, 40px)",
|
|
245
217
|
prominent: "clamp(40px, 2.5rem, 48px)"
|
|
246
218
|
},
|
|
247
|
-
// Coarse: always fixed px — touch ergonomics require predictable,
|
|
248
|
-
// reliable targets (Apple HIG 44px floor, Material 48dp default).
|
|
249
219
|
coarse: {
|
|
250
220
|
min: "32px",
|
|
251
221
|
base: "48px",
|
|
@@ -253,7 +223,6 @@ var baseTheme = {
|
|
|
253
223
|
}
|
|
254
224
|
}
|
|
255
225
|
},
|
|
256
|
-
// -- Radii --------------------------------------------------------------
|
|
257
226
|
radii: {
|
|
258
227
|
none: "0px",
|
|
259
228
|
sm: "4px",
|
|
@@ -262,7 +231,6 @@ var baseTheme = {
|
|
|
262
231
|
xl: "16px",
|
|
263
232
|
full: "9999px"
|
|
264
233
|
},
|
|
265
|
-
// -- Borders ------------------------------------------------------------
|
|
266
234
|
border: {
|
|
267
235
|
width: {
|
|
268
236
|
none: "0px",
|
|
@@ -277,15 +245,13 @@ var baseTheme = {
|
|
|
277
245
|
none: "none"
|
|
278
246
|
}
|
|
279
247
|
},
|
|
280
|
-
// -- Opacity ------------------------------------------------------------
|
|
281
248
|
opacity: {
|
|
282
249
|
100: 1,
|
|
283
|
-
75:
|
|
284
|
-
50:
|
|
285
|
-
25:
|
|
250
|
+
75: .75,
|
|
251
|
+
50: .5,
|
|
252
|
+
25: .25,
|
|
286
253
|
0: 0
|
|
287
254
|
},
|
|
288
|
-
// -- Motion -------------------------------------------------------------
|
|
289
255
|
motion: {
|
|
290
256
|
duration: {
|
|
291
257
|
none: "0ms",
|
|
@@ -302,7 +268,6 @@ var baseTheme = {
|
|
|
302
268
|
linear: "linear"
|
|
303
269
|
}
|
|
304
270
|
},
|
|
305
|
-
// -- Z-Index ------------------------------------------------------------
|
|
306
271
|
zIndex: {
|
|
307
272
|
level: {
|
|
308
273
|
0: 0,
|
|
@@ -312,7 +277,6 @@ var baseTheme = {
|
|
|
312
277
|
4: 400
|
|
313
278
|
}
|
|
314
279
|
},
|
|
315
|
-
// -- Breakpoints --------------------------------------------------------
|
|
316
280
|
breakpoints: {
|
|
317
281
|
sm: "30rem",
|
|
318
282
|
md: "48rem",
|
|
@@ -321,31 +285,10 @@ var baseTheme = {
|
|
|
321
285
|
"2xl": "96rem"
|
|
322
286
|
}
|
|
323
287
|
},
|
|
324
|
-
// ==========================================================================
|
|
325
|
-
// SEMANTIC TOKENS — stable aliases consumed by components
|
|
326
|
-
//
|
|
327
|
-
// Semantic tokens reference core tokens only.
|
|
328
|
-
// No raw values are allowed in this layer.
|
|
329
|
-
// ==========================================================================
|
|
330
288
|
semantic: {
|
|
331
|
-
// -- Colors -------------------------------------------------------------
|
|
332
|
-
// Grammar: {ux}.{role}.{dimension}.{state?}
|
|
333
|
-
// Components consume semantic colors only. Core colors are never referenced directly.
|
|
334
289
|
colors: {
|
|
335
|
-
// Grammar: {ux}.{role}.{dimension}.{state?}
|
|
336
|
-
// States are only defined when they produce a VALUE DIFFERENT from the
|
|
337
|
-
// default state in that dimension. Hover/active/focused/selected/current
|
|
338
|
-
// that resolve to the same color as default are intentionally omitted —
|
|
339
|
-
// a token that looks identical to default is semantically invisible.
|
|
340
|
-
//
|
|
341
|
-
// Checked pairs enforced by the distinguishability test:
|
|
342
|
-
// hover, active, focused, selected, current → must differ from default
|
|
343
|
-
// Other states (disabled, droptarget, pressed, expanded, checked,
|
|
344
|
-
// indeterminate, visited) may match default when semantically justified.
|
|
345
290
|
action: {
|
|
346
291
|
primary: {
|
|
347
|
-
// neutral.1000 (black) background — authoritative, neutral primary action.
|
|
348
|
-
// Contrast: neutral.0 text on neutral.1000 → ~20:1 ✓ ; neutral.700 hover → ~12:1 ✓
|
|
349
292
|
background: {
|
|
350
293
|
default: "{core.colors.neutral.1000}",
|
|
351
294
|
hover: "{core.colors.neutral.900}",
|
|
@@ -367,12 +310,10 @@ var baseTheme = {
|
|
|
367
310
|
text: {
|
|
368
311
|
default: "{core.colors.neutral.0}",
|
|
369
312
|
disabled: "{core.colors.neutral.500}",
|
|
370
|
-
// On droptarget background (neutral.100 = light), dark text is required
|
|
371
313
|
droptarget: "{core.colors.neutral.900}"
|
|
372
314
|
}
|
|
373
315
|
},
|
|
374
316
|
secondary: {
|
|
375
|
-
// neutral.100 background, neutral.300 border, neutral.900 text
|
|
376
317
|
background: {
|
|
377
318
|
default: "{core.colors.neutral.200}",
|
|
378
319
|
hover: "{core.colors.neutral.300}",
|
|
@@ -397,9 +338,6 @@ var baseTheme = {
|
|
|
397
338
|
}
|
|
398
339
|
},
|
|
399
340
|
accent: {
|
|
400
|
-
// brand.500 background — vivid blue that draws attention in the UI.
|
|
401
|
-
// Contrast: neutral.0 text on brand.500 (#0469e3) → ~5.7:1 ✓ AA
|
|
402
|
-
// All interactive states darken further → neutral.0 text remains valid.
|
|
403
341
|
background: {
|
|
404
342
|
default: "{core.colors.brand.500}",
|
|
405
343
|
hover: "{core.colors.brand.700}",
|
|
@@ -419,14 +357,12 @@ var baseTheme = {
|
|
|
419
357
|
expanded: "{core.colors.brand.700}"
|
|
420
358
|
},
|
|
421
359
|
text: {
|
|
422
|
-
// brand.500 is dark enough — neutral.0 meets ≥ 4.5:1 AA on all states
|
|
423
360
|
default: "{core.colors.neutral.0}",
|
|
424
361
|
disabled: "{core.colors.neutral.500}",
|
|
425
362
|
droptarget: "{core.colors.neutral.900}"
|
|
426
363
|
}
|
|
427
364
|
},
|
|
428
365
|
negative: {
|
|
429
|
-
// red.500 background, red.500 border, neutral.0 text
|
|
430
366
|
background: {
|
|
431
367
|
default: "{core.colors.red.500}",
|
|
432
368
|
hover: "{core.colors.red.700}",
|
|
@@ -452,7 +388,6 @@ var baseTheme = {
|
|
|
452
388
|
}
|
|
453
389
|
},
|
|
454
390
|
muted: {
|
|
455
|
-
// neutral.0 background, neutral.200 border, neutral.700 text
|
|
456
391
|
background: {
|
|
457
392
|
default: "{core.colors.neutral.0}",
|
|
458
393
|
hover: "{core.colors.neutral.50}",
|
|
@@ -483,7 +418,6 @@ var baseTheme = {
|
|
|
483
418
|
},
|
|
484
419
|
input: {
|
|
485
420
|
primary: {
|
|
486
|
-
// neutral.0 background, neutral.300 border, neutral.900 text
|
|
487
421
|
background: {
|
|
488
422
|
default: "{core.colors.neutral.0}",
|
|
489
423
|
hover: "{core.colors.neutral.50}",
|
|
@@ -512,13 +446,9 @@ var baseTheme = {
|
|
|
512
446
|
default: "{core.colors.neutral.900}",
|
|
513
447
|
disabled: "{core.colors.neutral.500}",
|
|
514
448
|
checked: "{core.colors.neutral.0}",
|
|
515
|
-
// brand.300 (indeterminate bg) is light — use dark text for contrast
|
|
516
449
|
indeterminate: "{core.colors.neutral.900}"
|
|
517
450
|
}
|
|
518
451
|
},
|
|
519
|
-
// Lower-emphasis input field (inline editors, filter pills, optional fields).
|
|
520
|
-
// Mirrors primary controls but uses a lighter chrome — default border is
|
|
521
|
-
// neutral.200 (vs primary's neutral.300) so it recedes until interacted with.
|
|
522
452
|
secondary: {
|
|
523
453
|
background: {
|
|
524
454
|
default: "{core.colors.neutral.0}",
|
|
@@ -555,7 +485,6 @@ var baseTheme = {
|
|
|
555
485
|
background: {
|
|
556
486
|
default: "{core.colors.red.100}",
|
|
557
487
|
disabled: "{core.colors.neutral.100}",
|
|
558
|
-
// red.700 (not red.500) so neutral.0 text meets 4.5:1 AA contrast
|
|
559
488
|
checked: "{core.colors.red.700}",
|
|
560
489
|
indeterminate: "{core.colors.red.300}"
|
|
561
490
|
},
|
|
@@ -578,7 +507,6 @@ var baseTheme = {
|
|
|
578
507
|
background: {
|
|
579
508
|
default: "{core.colors.green.100}",
|
|
580
509
|
disabled: "{core.colors.neutral.100}",
|
|
581
|
-
// green.700 (not green.500) so neutral.0 text meets 4.5:1 AA contrast
|
|
582
510
|
checked: "{core.colors.green.700}",
|
|
583
511
|
indeterminate: "{core.colors.green.300}"
|
|
584
512
|
},
|
|
@@ -616,7 +544,6 @@ var baseTheme = {
|
|
|
616
544
|
text: {
|
|
617
545
|
default: "{core.colors.yellow.900}",
|
|
618
546
|
disabled: "{core.colors.neutral.500}",
|
|
619
|
-
// yellow.500 is light — dark text required for 4.5:1 AA
|
|
620
547
|
checked: "{core.colors.neutral.900}"
|
|
621
548
|
}
|
|
622
549
|
},
|
|
@@ -695,7 +622,6 @@ var baseTheme = {
|
|
|
695
622
|
default: "{core.colors.neutral.700}",
|
|
696
623
|
active: "{core.colors.neutral.900}",
|
|
697
624
|
disabled: "{core.colors.neutral.500}",
|
|
698
|
-
// neutral.700 (not neutral.500) to meet 4.5:1 AA on neutral.100 background
|
|
699
625
|
visited: "{core.colors.neutral.700}"
|
|
700
626
|
}
|
|
701
627
|
},
|
|
@@ -781,15 +707,11 @@ var baseTheme = {
|
|
|
781
707
|
}
|
|
782
708
|
},
|
|
783
709
|
accent: {
|
|
784
|
-
// brand.400 bg — louder than primary (brand.500). Outlined/tinted card accent.
|
|
785
|
-
// Follows filled pattern for selected, rest stays light.
|
|
786
710
|
background: {
|
|
787
711
|
default: "{core.colors.brand.50}",
|
|
788
712
|
hover: "{core.colors.brand.100}",
|
|
789
713
|
active: "{core.colors.brand.200}",
|
|
790
714
|
disabled: "{core.colors.neutral.100}",
|
|
791
|
-
// selected uses brand.500 (not brand.400) so neutral.0 text meets
|
|
792
|
-
// AA Normal (≥ 4.5:1). brand.400 on white fails the normal threshold.
|
|
793
715
|
selected: "{core.colors.brand.500}"
|
|
794
716
|
},
|
|
795
717
|
border: {
|
|
@@ -805,16 +727,12 @@ var baseTheme = {
|
|
|
805
727
|
hover: "{core.colors.brand.900}",
|
|
806
728
|
active: "{core.colors.brand.900}",
|
|
807
729
|
disabled: "{core.colors.neutral.500}",
|
|
808
|
-
// selected uses filled bg (brand.500) — neutral.0 meets 4.5:1
|
|
809
730
|
selected: "{core.colors.neutral.0}",
|
|
810
731
|
visited: "{core.colors.brand.700}"
|
|
811
732
|
}
|
|
812
733
|
}
|
|
813
734
|
},
|
|
814
735
|
feedback: {
|
|
815
|
-
// Feedback is informational — surfaces show state, not interactions.
|
|
816
|
-
// Legal states: default | focused (close button or focusable wrapper) | disabled.
|
|
817
|
-
// hover, active, selected, pressed, expanded are absent: FSL §7.
|
|
818
736
|
primary: {
|
|
819
737
|
background: {
|
|
820
738
|
default: "{core.colors.neutral.50}"
|
|
@@ -883,8 +801,6 @@ var baseTheme = {
|
|
|
883
801
|
},
|
|
884
802
|
navigation: {
|
|
885
803
|
primary: {
|
|
886
|
-
// Inline link on light surfaces: transparent bg, brand text underline.
|
|
887
|
-
// Contrast: brand.700 (#034da6) on neutral.0 (#ffffff) → ~9.5:1 ✓
|
|
888
804
|
background: {
|
|
889
805
|
default: "{core.colors.neutral.0}",
|
|
890
806
|
hover: "{core.colors.neutral.50}",
|
|
@@ -909,7 +825,6 @@ var baseTheme = {
|
|
|
909
825
|
}
|
|
910
826
|
},
|
|
911
827
|
secondary: {
|
|
912
|
-
// Light nav: neutral.50 background, neutral.200 border, neutral.700 text
|
|
913
828
|
background: {
|
|
914
829
|
default: "{core.colors.neutral.50}",
|
|
915
830
|
hover: "{core.colors.neutral.100}",
|
|
@@ -941,8 +856,6 @@ var baseTheme = {
|
|
|
941
856
|
}
|
|
942
857
|
},
|
|
943
858
|
accent: {
|
|
944
|
-
// Brand accent nav: brand.50 background with brand border — louder than secondary.
|
|
945
|
-
// Targeted use: highlighted/featured nav items.
|
|
946
859
|
background: {
|
|
947
860
|
default: "{core.colors.brand.50}",
|
|
948
861
|
hover: "{core.colors.brand.100}",
|
|
@@ -965,7 +878,6 @@ var baseTheme = {
|
|
|
965
878
|
default: "{core.colors.brand.700}",
|
|
966
879
|
hover: "{core.colors.brand.900}",
|
|
967
880
|
disabled: "{core.colors.neutral.500}",
|
|
968
|
-
// selected/current use brand.700 bg — neutral.0 meets ≥ 4.5:1
|
|
969
881
|
selected: "{core.colors.neutral.0}",
|
|
970
882
|
current: "{core.colors.neutral.0}",
|
|
971
883
|
visited: "{core.colors.brand.500}",
|
|
@@ -973,8 +885,6 @@ var baseTheme = {
|
|
|
973
885
|
}
|
|
974
886
|
},
|
|
975
887
|
muted: {
|
|
976
|
-
// Subdued nav: transparent / neutral.100 background, none border, neutral.500 text.
|
|
977
|
-
// Used for secondary nav items, breadcrumbs, or inactive sidebar links.
|
|
978
888
|
background: {
|
|
979
889
|
default: "{core.colors.neutral.0}",
|
|
980
890
|
hover: "{core.colors.neutral.50}",
|
|
@@ -1006,8 +916,6 @@ var baseTheme = {
|
|
|
1006
916
|
}
|
|
1007
917
|
}
|
|
1008
918
|
},
|
|
1009
|
-
// -- Elevation ----------------------------------------------------------
|
|
1010
|
-
// Grammar: elevation.surface.{stratum}
|
|
1011
919
|
elevation: {
|
|
1012
920
|
surface: {
|
|
1013
921
|
flat: "{core.elevation.level.0}",
|
|
@@ -1016,8 +924,6 @@ var baseTheme = {
|
|
|
1016
924
|
blocking: "{core.elevation.level.4}"
|
|
1017
925
|
}
|
|
1018
926
|
},
|
|
1019
|
-
// -- Typography ---------------------------------------------------------
|
|
1020
|
-
// Grammar: text.{family}.{step}
|
|
1021
927
|
text: {
|
|
1022
928
|
display: {
|
|
1023
929
|
lg: {
|
|
@@ -1168,22 +1074,13 @@ var baseTheme = {
|
|
|
1168
1074
|
}
|
|
1169
1075
|
}
|
|
1170
1076
|
},
|
|
1171
|
-
// -- Spacing ------------------------------------------------------------
|
|
1172
|
-
// Grammar: {pattern}.{context}.{step?}
|
|
1173
1077
|
spacing: {
|
|
1174
1078
|
inset: {
|
|
1175
|
-
// Mapped to the documented defaults from spacing.md. Medium-high
|
|
1176
|
-
// density is delivered by `core.sizing.hit.fine.*` (40px base)
|
|
1177
|
-
// combined with the spacing engine clamp — not by tightening
|
|
1178
|
-
// inset.control, which previously caused cramped vertical padding
|
|
1179
|
-
// (~4px) when content grew beyond `min-height: hit.base`.
|
|
1180
1079
|
control: {
|
|
1181
1080
|
sm: "{core.spacing.2}",
|
|
1182
1081
|
md: "{core.spacing.3}",
|
|
1183
1082
|
lg: "{core.spacing.4}"
|
|
1184
1083
|
},
|
|
1185
|
-
// Surfaces breathe more than controls; the invariant
|
|
1186
|
-
// inset.surface.X ≥ inset.control.X is preserved.
|
|
1187
1084
|
surface: {
|
|
1188
1085
|
sm: "{core.spacing.3}",
|
|
1189
1086
|
md: "{core.spacing.4}",
|
|
@@ -1216,8 +1113,6 @@ var baseTheme = {
|
|
|
1216
1113
|
}
|
|
1217
1114
|
}
|
|
1218
1115
|
},
|
|
1219
|
-
// -- Sizing -------------------------------------------------------------
|
|
1220
|
-
// Grammar: {family}.{stepOrProperty}
|
|
1221
1116
|
sizing: {
|
|
1222
1117
|
hit: {
|
|
1223
1118
|
min: "{core.sizing.hit.fine.min}",
|
|
@@ -1250,13 +1145,11 @@ var baseTheme = {
|
|
|
1250
1145
|
}
|
|
1251
1146
|
}
|
|
1252
1147
|
},
|
|
1253
|
-
// -- Radii --------------------------------------------------------------
|
|
1254
1148
|
radii: {
|
|
1255
1149
|
control: "{core.radii.md}",
|
|
1256
1150
|
surface: "{core.radii.lg}",
|
|
1257
1151
|
round: "{core.radii.full}"
|
|
1258
1152
|
},
|
|
1259
|
-
// -- Borders ------------------------------------------------------------
|
|
1260
1153
|
border: {
|
|
1261
1154
|
divider: {
|
|
1262
1155
|
width: "{core.border.width.default}",
|
|
@@ -1277,31 +1170,21 @@ var baseTheme = {
|
|
|
1277
1170
|
}
|
|
1278
1171
|
}
|
|
1279
1172
|
},
|
|
1280
|
-
// -- Focus --------------------------------------------------------------
|
|
1281
1173
|
focus: {
|
|
1282
1174
|
ring: {
|
|
1283
1175
|
width: "{core.border.width.focused}",
|
|
1284
1176
|
style: "{core.border.style.solid}",
|
|
1285
|
-
// References the semantic accent focused border so mode overrides
|
|
1286
|
-
// remap focus color automatically (e.g. brand.300 in dark mode).
|
|
1287
1177
|
color: "{semantic.colors.action.accent.border.focused}"
|
|
1288
1178
|
}
|
|
1289
1179
|
},
|
|
1290
|
-
// -- Overlay ------------------------------------------------------------
|
|
1291
1180
|
overlay: {
|
|
1292
|
-
// Full modal backdrop color. Alpha is sourced from semantic.opacity.scrim
|
|
1293
|
-
// so both tokens stay in sync across themes and modes.
|
|
1294
|
-
// RawValue rationale: rgba() composing a token ref cannot be expressed
|
|
1295
|
-
// as a single TokenRef — see model.md §8 RawValue inventory.
|
|
1296
1181
|
scrim: "rgba(0, 0, 0, {semantic.opacity.scrim})"
|
|
1297
1182
|
},
|
|
1298
|
-
// -- Opacity ------------------------------------------------------------
|
|
1299
1183
|
opacity: {
|
|
1300
1184
|
scrim: "{core.opacity.50}",
|
|
1301
1185
|
loading: "{core.opacity.50}",
|
|
1302
1186
|
disabled: "{core.opacity.50}"
|
|
1303
1187
|
},
|
|
1304
|
-
// -- Motion -------------------------------------------------------------
|
|
1305
1188
|
motion: {
|
|
1306
1189
|
feedback: {
|
|
1307
1190
|
duration: "{core.motion.duration.sm}",
|
|
@@ -1326,7 +1209,6 @@ var baseTheme = {
|
|
|
1326
1209
|
easing: "{core.motion.easing.linear}"
|
|
1327
1210
|
}
|
|
1328
1211
|
},
|
|
1329
|
-
// -- Z-Index ------------------------------------------------------------
|
|
1330
1212
|
zIndex: {
|
|
1331
1213
|
layer: {
|
|
1332
1214
|
base: "{core.zIndex.level.0}",
|
|
@@ -1338,13 +1220,11 @@ var baseTheme = {
|
|
|
1338
1220
|
}
|
|
1339
1221
|
}
|
|
1340
1222
|
};
|
|
1341
|
-
|
|
1223
|
+
const darkAlternate = {
|
|
1342
1224
|
semantic: {
|
|
1343
1225
|
colors: {
|
|
1344
1226
|
action: {
|
|
1345
1227
|
primary: {
|
|
1346
|
-
// White button on dark surface — inverted authority for dark contexts.
|
|
1347
|
-
// Contrast: neutral.900 text on neutral.0 → ~19:1 ✓
|
|
1348
1228
|
background: {
|
|
1349
1229
|
default: "{core.colors.neutral.0}",
|
|
1350
1230
|
hover: "{core.colors.neutral.100}",
|
|
@@ -1364,7 +1244,6 @@ var darkAlternate = {
|
|
|
1364
1244
|
text: {
|
|
1365
1245
|
default: "{core.colors.neutral.900}",
|
|
1366
1246
|
disabled: "{core.colors.neutral.500}",
|
|
1367
|
-
// droptarget bg is now neutral.700 (dark) — neutral.0 required for contrast
|
|
1368
1247
|
droptarget: "{core.colors.neutral.0}"
|
|
1369
1248
|
}
|
|
1370
1249
|
},
|
|
@@ -1407,15 +1286,12 @@ var darkAlternate = {
|
|
|
1407
1286
|
text: {
|
|
1408
1287
|
default: "{core.colors.neutral.50}",
|
|
1409
1288
|
disabled: "{core.colors.neutral.500}",
|
|
1410
|
-
// neutral.900 text on neutral.700 dark bg → ~3:1 — fails WCAG AA
|
|
1411
1289
|
hover: "{core.colors.neutral.0}",
|
|
1412
1290
|
active: "{core.colors.neutral.0}",
|
|
1413
1291
|
pressed: "{core.colors.neutral.0}",
|
|
1414
1292
|
expanded: "{core.colors.neutral.0}"
|
|
1415
1293
|
}
|
|
1416
1294
|
},
|
|
1417
|
-
// negative: red.500 bg/border + neutral.0 text remain valid on dark
|
|
1418
|
-
// pages (vivid destructive colour). Only state-specific overrides.
|
|
1419
1295
|
negative: {
|
|
1420
1296
|
background: {
|
|
1421
1297
|
disabled: "{core.colors.neutral.700}",
|
|
@@ -1425,12 +1301,9 @@ var darkAlternate = {
|
|
|
1425
1301
|
disabled: "{core.colors.neutral.700}"
|
|
1426
1302
|
},
|
|
1427
1303
|
text: {
|
|
1428
|
-
// droptarget bg is now neutral.700 (dark) — neutral.0 required for contrast
|
|
1429
1304
|
droptarget: "{core.colors.neutral.0}"
|
|
1430
1305
|
}
|
|
1431
1306
|
},
|
|
1432
|
-
// accent: brand.500 bg/border + neutral.0 text remain valid on dark
|
|
1433
|
-
// surface. Only remap states that use light-mode fills that fail on dark.
|
|
1434
1307
|
accent: {
|
|
1435
1308
|
background: {
|
|
1436
1309
|
disabled: "{core.colors.neutral.700}",
|
|
@@ -1468,8 +1341,6 @@ var darkAlternate = {
|
|
|
1468
1341
|
disabled: "{core.colors.neutral.500}"
|
|
1469
1342
|
}
|
|
1470
1343
|
},
|
|
1471
|
-
// input.secondary: lower-emphasis field, matches primary dark values since both
|
|
1472
|
-
// render on a dark page. base neutral.0 default fails on dark — full override.
|
|
1473
1344
|
secondary: {
|
|
1474
1345
|
background: {
|
|
1475
1346
|
default: "{core.colors.neutral.700}",
|
|
@@ -1567,7 +1438,6 @@ var darkAlternate = {
|
|
|
1567
1438
|
},
|
|
1568
1439
|
text: {
|
|
1569
1440
|
default: "{core.colors.neutral.0}",
|
|
1570
|
-
// neutral.700 on neutral.900 dark bg → ~2:1 — fails WCAG AA
|
|
1571
1441
|
visited: "{core.colors.neutral.300}"
|
|
1572
1442
|
}
|
|
1573
1443
|
},
|
|
@@ -1586,9 +1456,7 @@ var darkAlternate = {
|
|
|
1586
1456
|
},
|
|
1587
1457
|
text: {
|
|
1588
1458
|
default: "{core.colors.neutral.50}",
|
|
1589
|
-
// neutral.900 on neutral.700 dark bg → ~3:1 — fails WCAG AA
|
|
1590
1459
|
active: "{core.colors.neutral.0}",
|
|
1591
|
-
// neutral.700 on neutral.700 → 1:1 — invisible
|
|
1592
1460
|
visited: "{core.colors.neutral.300}"
|
|
1593
1461
|
}
|
|
1594
1462
|
},
|
|
@@ -1642,7 +1510,6 @@ var darkAlternate = {
|
|
|
1642
1510
|
default: "{core.colors.red.300}"
|
|
1643
1511
|
}
|
|
1644
1512
|
},
|
|
1645
|
-
// Full remap: base brand.50/100/200 backgrounds are near-white and fail on dark pages.
|
|
1646
1513
|
accent: {
|
|
1647
1514
|
background: {
|
|
1648
1515
|
default: "{core.colors.brand.900}",
|
|
@@ -1654,13 +1521,11 @@ var darkAlternate = {
|
|
|
1654
1521
|
default: "{core.colors.brand.300}",
|
|
1655
1522
|
hover: "{core.colors.brand.400}",
|
|
1656
1523
|
active: "{core.colors.brand.400}",
|
|
1657
|
-
// brand.100 for focused — must differ from default (brand.300) for state distinguishability
|
|
1658
1524
|
focused: "{core.colors.brand.100}",
|
|
1659
1525
|
disabled: "{core.colors.neutral.700}",
|
|
1660
1526
|
selected: "{core.colors.brand.400}"
|
|
1661
1527
|
},
|
|
1662
1528
|
text: {
|
|
1663
|
-
// brand.700 on neutral.900 bg → ~1.3:1 — invisible; use brand.300
|
|
1664
1529
|
default: "{core.colors.brand.300}",
|
|
1665
1530
|
hover: "{core.colors.brand.100}",
|
|
1666
1531
|
active: "{core.colors.brand.100}",
|
|
@@ -1726,17 +1591,7 @@ var darkAlternate = {
|
|
|
1726
1591
|
}
|
|
1727
1592
|
},
|
|
1728
1593
|
navigation: {
|
|
1729
|
-
// Stacked-surface separation in dark mode.
|
|
1730
|
-
// The page background and informational.primary.background.default both
|
|
1731
|
-
// resolve to neutral.900 here. Per the prescribed pattern (see
|
|
1732
|
-
// colors.md → "Stacking informational surfaces"), separation is paid in
|
|
1733
|
-
// elevation + border + theme-side step displacement, never in colour.
|
|
1734
|
-
// navigation.primary applies (3): hover/active/current/expanded shift to
|
|
1735
|
-
// neutral.700 so a nav item reads as a distinct affordance against the
|
|
1736
|
-
// page surface even with no elevation of its own.
|
|
1737
1594
|
primary: {
|
|
1738
|
-
// Inline link on dark surfaces: transparent bg, brand.300 text.
|
|
1739
|
-
// Contrast: brand.300 (#60a5fa) on neutral.900 (#0f172a) → ~6.8:1 ✓
|
|
1740
1595
|
background: {
|
|
1741
1596
|
default: "{core.colors.neutral.900}",
|
|
1742
1597
|
hover: "{core.colors.neutral.700}",
|
|
@@ -1860,23 +1715,70 @@ var darkAlternate = {
|
|
|
1860
1715
|
}
|
|
1861
1716
|
};
|
|
1862
1717
|
|
|
1863
|
-
|
|
1864
|
-
|
|
1718
|
+
//#endregion
|
|
1719
|
+
//#region src/createTheme.ts
|
|
1720
|
+
/**
|
|
1721
|
+
* Creates a fully resolved `ThemeTokens` by merging partial overrides into a base.
|
|
1722
|
+
* Internal engine — consumers should use `createTheme` which returns `ThemeBundle`.
|
|
1723
|
+
*
|
|
1724
|
+
* @internal
|
|
1725
|
+
*/
|
|
1726
|
+
const buildTheme = ({
|
|
1865
1727
|
base = baseTheme,
|
|
1866
1728
|
overrides = {}
|
|
1867
1729
|
} = {}) => {
|
|
1868
1730
|
const merged = deepMerge(base, overrides);
|
|
1869
|
-
if (process.env.NODE_ENV !== "production")
|
|
1870
|
-
validateRefs(merged);
|
|
1871
|
-
}
|
|
1731
|
+
if (process.env.NODE_ENV !== "production") validateRefs(merged);
|
|
1872
1732
|
return structuredClone(merged);
|
|
1873
|
-
}
|
|
1874
|
-
|
|
1733
|
+
};
|
|
1734
|
+
const resolveAlternate = (alternate, parentBundle) => {
|
|
1875
1735
|
if (alternate === null) return void 0;
|
|
1876
1736
|
if (alternate !== void 0) return alternate;
|
|
1877
1737
|
return parentBundle?.alternate ?? darkAlternate;
|
|
1878
|
-
}
|
|
1879
|
-
|
|
1738
|
+
};
|
|
1739
|
+
/**
|
|
1740
|
+
* Creates a theme bundle with an optional alternate color mode.
|
|
1741
|
+
*
|
|
1742
|
+
* The `extends` param is the idiomatic way to build on a built-in theme:
|
|
1743
|
+
* it inherits the base tokens **and** the dark-mode alternate automatically.
|
|
1744
|
+
*
|
|
1745
|
+
* @param params.extends - Parent bundle to inherit from. `base`, `baseMode`, and
|
|
1746
|
+
* `alternate` default to the parent's values when this is provided.
|
|
1747
|
+
* @param params.baseMode - Which mode the base represents. Defaults to `'light'`.
|
|
1748
|
+
* @param params.base - Base theme to extend. Defaults to `extends.base` or `baseTheme`.
|
|
1749
|
+
* @param params.overrides - Brand overrides applied to the base theme.
|
|
1750
|
+
* @param params.alternate - Semantic remapping overrides for the opposite color mode.
|
|
1751
|
+
* Defaults to `darkAlternate` (built-in dark mode) when neither `alternate` nor
|
|
1752
|
+
* `extends` is provided. Inherits from `extends.alternate` when `extends` is given.
|
|
1753
|
+
* Pass `null` to explicitly opt out of any alternate (single-mode theme).
|
|
1754
|
+
* Core tokens are immutable — only semantic references change between modes.
|
|
1755
|
+
*
|
|
1756
|
+
* @example
|
|
1757
|
+
* ```ts
|
|
1758
|
+
* // Path A — default foundation (light base + dark alternate included)
|
|
1759
|
+
* const myTheme = createTheme();
|
|
1760
|
+
* <ThemeProvider theme={myTheme} />
|
|
1761
|
+
*
|
|
1762
|
+
* // Path B — custom brand overrides (dark mode still included)
|
|
1763
|
+
* const myTheme = createTheme({
|
|
1764
|
+
* overrides: { core: { colors: { brand: { 500: '#FF0000' } } } },
|
|
1765
|
+
* });
|
|
1766
|
+
*
|
|
1767
|
+
* // Path C — custom semantic dark alternate
|
|
1768
|
+
* const myTheme = createTheme({
|
|
1769
|
+
* overrides: { core: { colors: { brand: { 500: '#FF0000' } } } },
|
|
1770
|
+
* alternate: {
|
|
1771
|
+
* semantic: {
|
|
1772
|
+
* colors: { informational: { primary: { background: { default: '{core.colors.neutral.900}' } } } },
|
|
1773
|
+
* },
|
|
1774
|
+
* },
|
|
1775
|
+
* });
|
|
1776
|
+
*
|
|
1777
|
+
* // Path D — single-mode theme (no dark alternate)
|
|
1778
|
+
* const myTheme = createTheme({ alternate: null });
|
|
1779
|
+
* ```
|
|
1780
|
+
*/
|
|
1781
|
+
const createTheme = ({
|
|
1880
1782
|
extends: parentBundle,
|
|
1881
1783
|
baseMode,
|
|
1882
1784
|
base,
|
|
@@ -1894,5 +1796,7 @@ var createTheme = /* @__PURE__ */__name(({
|
|
|
1894
1796
|
}),
|
|
1895
1797
|
alternate: resolvedAlternate
|
|
1896
1798
|
};
|
|
1897
|
-
}
|
|
1898
|
-
|
|
1799
|
+
};
|
|
1800
|
+
|
|
1801
|
+
//#endregion
|
|
1802
|
+
export { darkAlternate as i, createTheme as n, baseTheme as r, buildTheme as t };
|