@vellira-ui/tokens 2.98.3 → 2.98.5
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/README.md +53 -0
- package/dist/css/tokens.css +40 -18
- package/dist/dark/components/modal.d.ts +1 -1
- package/dist/dark/semantic/index.d.ts +1 -0
- package/dist/dark/semantic/index.d.ts.map +1 -1
- package/dist/dark/semantic/index.js +1 -0
- package/dist/factories/createModalTokens.d.ts +2 -2
- package/dist/factories/createModalTokens.js +1 -1
- package/dist/highContrast/components/modal.d.ts +1 -1
- package/dist/light/components/modal.d.ts +1 -1
- package/dist/light/semantic/index.d.ts +1 -0
- package/dist/light/semantic/index.d.ts.map +1 -1
- package/dist/light/semantic/index.js +1 -0
- package/dist/preservation/token-migrations.d.ts +90 -0
- package/dist/preservation/token-migrations.d.ts.map +1 -0
- package/dist/preservation/token-migrations.js +95 -0
- package/dist/token-architecture.d.ts +195 -0
- package/dist/token-architecture.d.ts.map +1 -0
- package/dist/token-architecture.js +461 -0
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -151,6 +151,59 @@ Verify that generated token types are up to date:
|
|
|
151
151
|
pnpm --filter @vellira-ui/tokens generate:types:check
|
|
152
152
|
```
|
|
153
153
|
|
|
154
|
+
### Token preservation baseline
|
|
155
|
+
|
|
156
|
+
Token Architecture Normalization V1 uses a committed resolved-value baseline to
|
|
157
|
+
prevent naming and ownership cleanup from silently redesigning Vellira.
|
|
158
|
+
|
|
159
|
+
Verify the baseline with:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
pnpm --filter @vellira-ui/tokens preservation:check
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
The preservation contract covers the complete current public visual surface:
|
|
166
|
+
|
|
167
|
+
- every resolved scalar leaf under the Light, Dark, and High Contrast theme
|
|
168
|
+
graphs;
|
|
169
|
+
- shared public visual tokens exported outside those theme graphs, including
|
|
170
|
+
overlay primitives and control-size values;
|
|
171
|
+
- generated Web CSS variable names together with their serialized values, using
|
|
172
|
+
the same serializer as the published `@vellira-ui/tokens/css` artifact;
|
|
173
|
+
- the current React Native output contract, which consumes the canonical theme
|
|
174
|
+
objects directly until a dedicated native platform adapter is introduced.
|
|
175
|
+
|
|
176
|
+
Normal token changes must not regenerate the baseline just to make a failure
|
|
177
|
+
disappear. Instead, record the change in
|
|
178
|
+
`src/preservation/token-migrations.ts` as an explicit rename, compatibility
|
|
179
|
+
alias, removal, addition, representation-only change, or approved visual
|
|
180
|
+
change. Renames and aliases are checked against the previous resolved identity,
|
|
181
|
+
so cleanup does not require obsolete token names to remain canonical forever.
|
|
182
|
+
|
|
183
|
+
Representation-only migrations explicitly declare their layer. A `canonical`
|
|
184
|
+
representation change is used when the renderer-neutral value changes shape or
|
|
185
|
+
type while retaining the same rendered meaning, for example a reviewed numeric
|
|
186
|
+
normalization such as `'1'` to `1`. A `platform-output` representation change
|
|
187
|
+
must additionally name the affected Web or React Native platform. Both forms
|
|
188
|
+
require explicit equivalence evidence; neither is an escape hatch for visual
|
|
189
|
+
drift.
|
|
190
|
+
|
|
191
|
+
`preservation:baseline` is a bootstrap command and refuses to overwrite an
|
|
192
|
+
existing committed baseline during normal work. A deliberate reviewed reset
|
|
193
|
+
requires the explicit `--force-reset` CLI flag. Resetting a baseline is never by
|
|
194
|
+
itself evidence that a visual change is safe.
|
|
195
|
+
|
|
196
|
+
Broad token migrations must also use the repository's canonical pinned Linux
|
|
197
|
+
visual regression path:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
pnpm test:e2e:web:visual:docker
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Do not update visual baselines or the token preservation baseline merely to
|
|
204
|
+
obtain green CI. Any intended visual change must be isolated and explicitly
|
|
205
|
+
approved.
|
|
206
|
+
|
|
154
207
|
## Principles
|
|
155
208
|
|
|
156
209
|
- Semantic tokens over hardcoded colors
|
package/dist/css/tokens.css
CHANGED
|
@@ -272,6 +272,17 @@
|
|
|
272
272
|
--focus-ring-width: 2px;
|
|
273
273
|
--focus-ring-shadow: 0 0 8px rgba(99, 70, 232, 0.14);
|
|
274
274
|
--focus-ring-offset: #FFFFFF;
|
|
275
|
+
--icons-default: #3D3754;
|
|
276
|
+
--icons-secondary: #6B6386;
|
|
277
|
+
--icons-muted: #958CB0;
|
|
278
|
+
--icons-subtle: #958CB0;
|
|
279
|
+
--icons-disabled: #958CB0;
|
|
280
|
+
--icons-primary: #5037C8;
|
|
281
|
+
--icons-brand: #5037C8;
|
|
282
|
+
--icons-hover: #402C9F;
|
|
283
|
+
--icons-success: #14B8A6;
|
|
284
|
+
--icons-danger: #BE123C;
|
|
285
|
+
--icons-inverse: #FFFFFF;
|
|
275
286
|
--menu-background: #FFFFFF;
|
|
276
287
|
--menu-border: #E4DDF4;
|
|
277
288
|
--menu-item-default-bg: transparent;
|
|
@@ -1320,8 +1331,8 @@
|
|
|
1320
1331
|
--popover-content-shadow-native-y: 12px;
|
|
1321
1332
|
--popover-content-shadow-native-blur: 32px;
|
|
1322
1333
|
--popover-content-shadow-native-color: #000000;
|
|
1323
|
-
--popover-content-shadow-native-opacity: 0.
|
|
1324
|
-
--popover-content-shadow-native-elevation:
|
|
1334
|
+
--popover-content-shadow-native-opacity: 0.1;
|
|
1335
|
+
--popover-content-shadow-native-elevation: 8;
|
|
1325
1336
|
--popover-content-border-width: 1px;
|
|
1326
1337
|
--popover-content-radius: 16px;
|
|
1327
1338
|
--popover-content-padding: 16px;
|
|
@@ -1355,9 +1366,9 @@
|
|
|
1355
1366
|
--radio-motion-easing: cubic-bezier(0.16, 1, 0.3, 1);
|
|
1356
1367
|
--radio-motion-indicator-duration: 180ms;
|
|
1357
1368
|
--radio-motion-selected-duration: 260ms;
|
|
1358
|
-
--radio-motion-pressed-scale: 0.
|
|
1359
|
-
--radio-motion-active-scale: 0.
|
|
1360
|
-
--radio-motion-pressed-opacity: 0.
|
|
1369
|
+
--radio-motion-pressed-scale: 0.96;
|
|
1370
|
+
--radio-motion-active-scale: 0.92;
|
|
1371
|
+
--radio-motion-pressed-opacity: 0.8;
|
|
1361
1372
|
--radio-default-bg: #FFFFFF;
|
|
1362
1373
|
--radio-default-fg: #3D3754;
|
|
1363
1374
|
--radio-default-border: #BBB2D2;
|
|
@@ -2349,7 +2360,7 @@
|
|
|
2349
2360
|
--tooltip-content-compact-line-height: 16px;
|
|
2350
2361
|
--tooltip-content-animation-duration: 150ms;
|
|
2351
2362
|
--tooltip-content-translate-y: 2px;
|
|
2352
|
-
--tooltip-content-scale: 0.
|
|
2363
|
+
--tooltip-content-scale: 0.98;
|
|
2353
2364
|
--tooltip-arrow-bg: #FFFFFF;
|
|
2354
2365
|
--tooltip-arrow-size: 10px;
|
|
2355
2366
|
--tooltip-arrow-compact-size: 6px;
|
|
@@ -2571,6 +2582,17 @@
|
|
|
2571
2582
|
--focus-ring-width: 2px;
|
|
2572
2583
|
--focus-ring-shadow: 0 0 8px rgba(184, 168, 255, 0.14);
|
|
2573
2584
|
--focus-ring-offset: #181521;
|
|
2585
|
+
--icons-default: #F4F1FB;
|
|
2586
|
+
--icons-secondary: #E5E7EB;
|
|
2587
|
+
--icons-muted: #958CB0;
|
|
2588
|
+
--icons-subtle: #6B6386;
|
|
2589
|
+
--icons-disabled: #6B6386;
|
|
2590
|
+
--icons-primary: #B8A8FF;
|
|
2591
|
+
--icons-brand: #B8A8FF;
|
|
2592
|
+
--icons-hover: #D4CCFF;
|
|
2593
|
+
--icons-success: #2DD4BF;
|
|
2594
|
+
--icons-danger: #FB7185;
|
|
2595
|
+
--icons-inverse: #000000;
|
|
2574
2596
|
--menu-background: #2F2A42;
|
|
2575
2597
|
--menu-border: #4F4867;
|
|
2576
2598
|
--menu-item-default-bg: transparent;
|
|
@@ -3619,8 +3641,8 @@
|
|
|
3619
3641
|
--popover-content-shadow-native-y: 12px;
|
|
3620
3642
|
--popover-content-shadow-native-blur: 32px;
|
|
3621
3643
|
--popover-content-shadow-native-color: #000000;
|
|
3622
|
-
--popover-content-shadow-native-opacity: 0.
|
|
3623
|
-
--popover-content-shadow-native-elevation:
|
|
3644
|
+
--popover-content-shadow-native-opacity: 0.1;
|
|
3645
|
+
--popover-content-shadow-native-elevation: 8;
|
|
3624
3646
|
--popover-content-border-width: 1px;
|
|
3625
3647
|
--popover-content-radius: 16px;
|
|
3626
3648
|
--popover-content-padding: 16px;
|
|
@@ -3654,9 +3676,9 @@
|
|
|
3654
3676
|
--radio-motion-easing: cubic-bezier(0.16, 1, 0.3, 1);
|
|
3655
3677
|
--radio-motion-indicator-duration: 180ms;
|
|
3656
3678
|
--radio-motion-selected-duration: 260ms;
|
|
3657
|
-
--radio-motion-pressed-scale: 0.
|
|
3658
|
-
--radio-motion-active-scale: 0.
|
|
3659
|
-
--radio-motion-pressed-opacity: 0.
|
|
3679
|
+
--radio-motion-pressed-scale: 0.96;
|
|
3680
|
+
--radio-motion-active-scale: 0.92;
|
|
3681
|
+
--radio-motion-pressed-opacity: 0.8;
|
|
3660
3682
|
--radio-default-bg: #2F2A42;
|
|
3661
3683
|
--radio-default-fg: #F4F1FB;
|
|
3662
3684
|
--radio-default-border: #4F4867;
|
|
@@ -4648,7 +4670,7 @@
|
|
|
4648
4670
|
--tooltip-content-compact-line-height: 16px;
|
|
4649
4671
|
--tooltip-content-animation-duration: 150ms;
|
|
4650
4672
|
--tooltip-content-translate-y: 2px;
|
|
4651
|
-
--tooltip-content-scale: 0.
|
|
4673
|
+
--tooltip-content-scale: 0.98;
|
|
4652
4674
|
--tooltip-arrow-bg: #2F2A42;
|
|
4653
4675
|
--tooltip-arrow-size: 10px;
|
|
4654
4676
|
--tooltip-arrow-compact-size: 6px;
|
|
@@ -5929,8 +5951,8 @@
|
|
|
5929
5951
|
--popover-content-shadow-native-y: 12px;
|
|
5930
5952
|
--popover-content-shadow-native-blur: 32px;
|
|
5931
5953
|
--popover-content-shadow-native-color: #000000;
|
|
5932
|
-
--popover-content-shadow-native-opacity: 0.
|
|
5933
|
-
--popover-content-shadow-native-elevation:
|
|
5954
|
+
--popover-content-shadow-native-opacity: 0.1;
|
|
5955
|
+
--popover-content-shadow-native-elevation: 8;
|
|
5934
5956
|
--popover-content-border-width: 1px;
|
|
5935
5957
|
--popover-content-radius: 16px;
|
|
5936
5958
|
--popover-content-padding: 16px;
|
|
@@ -5964,9 +5986,9 @@
|
|
|
5964
5986
|
--radio-motion-easing: cubic-bezier(0.16, 1, 0.3, 1);
|
|
5965
5987
|
--radio-motion-indicator-duration: 180ms;
|
|
5966
5988
|
--radio-motion-selected-duration: 260ms;
|
|
5967
|
-
--radio-motion-pressed-scale: 0.
|
|
5968
|
-
--radio-motion-active-scale: 0.
|
|
5969
|
-
--radio-motion-pressed-opacity: 0.
|
|
5989
|
+
--radio-motion-pressed-scale: 0.96;
|
|
5990
|
+
--radio-motion-active-scale: 0.92;
|
|
5991
|
+
--radio-motion-pressed-opacity: 0.8;
|
|
5970
5992
|
--radio-default-bg: #000000;
|
|
5971
5993
|
--radio-default-fg: #FFFFFF;
|
|
5972
5994
|
--radio-default-border: #9CA3AF;
|
|
@@ -6958,7 +6980,7 @@
|
|
|
6958
6980
|
--tooltip-content-compact-line-height: 16px;
|
|
6959
6981
|
--tooltip-content-animation-duration: 150ms;
|
|
6960
6982
|
--tooltip-content-translate-y: 2px;
|
|
6961
|
-
--tooltip-content-scale: 0.
|
|
6983
|
+
--tooltip-content-scale: 0.98;
|
|
6962
6984
|
--tooltip-arrow-bg: #FFFFFF;
|
|
6963
6985
|
--tooltip-arrow-size: 10px;
|
|
6964
6986
|
--tooltip-arrow-compact-size: 6px;
|
|
@@ -18,7 +18,7 @@ export declare const modal: {
|
|
|
18
18
|
readonly nativeMaxHeight: "90%";
|
|
19
19
|
readonly viewportMargin: number;
|
|
20
20
|
readonly topOffset: number;
|
|
21
|
-
readonly zIndexOffset:
|
|
21
|
+
readonly zIndexOffset: 1;
|
|
22
22
|
readonly animationDuration: "180ms";
|
|
23
23
|
readonly size: {
|
|
24
24
|
readonly sm: 400;
|
|
@@ -3,6 +3,7 @@ export { border } from './border.js';
|
|
|
3
3
|
export { control } from './control.js';
|
|
4
4
|
export { divider } from './divider.js';
|
|
5
5
|
export { focus } from './focus.js';
|
|
6
|
+
export { icons } from './icons.js';
|
|
6
7
|
export { menu } from './menu.js';
|
|
7
8
|
export { navigation } from './navigation.js';
|
|
8
9
|
export { overlay } from './overlay.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dark/semantic/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dark/semantic/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -3,6 +3,7 @@ export { border } from './border.js';
|
|
|
3
3
|
export { control } from './control.js';
|
|
4
4
|
export { divider } from './divider.js';
|
|
5
5
|
export { focus } from './focus.js';
|
|
6
|
+
export { icons } from './icons.js';
|
|
6
7
|
export { menu } from './menu.js';
|
|
7
8
|
export { navigation } from './navigation.js';
|
|
8
9
|
export { overlay } from './overlay.js';
|
|
@@ -84,7 +84,7 @@ export declare const createModalTokens: (config: ModalTokensConfig) => {
|
|
|
84
84
|
readonly nativeMaxHeight: "90%";
|
|
85
85
|
readonly viewportMargin: number;
|
|
86
86
|
readonly topOffset: number;
|
|
87
|
-
readonly zIndexOffset:
|
|
87
|
+
readonly zIndexOffset: 1;
|
|
88
88
|
readonly animationDuration: "180ms";
|
|
89
89
|
readonly size: {
|
|
90
90
|
readonly sm: 400;
|
|
@@ -165,7 +165,7 @@ export declare const createModalTokensFromSemantics: ({ closeButtonHoverBg, clos
|
|
|
165
165
|
readonly nativeMaxHeight: "90%";
|
|
166
166
|
readonly viewportMargin: number;
|
|
167
167
|
readonly topOffset: number;
|
|
168
|
-
readonly zIndexOffset:
|
|
168
|
+
readonly zIndexOffset: 1;
|
|
169
169
|
readonly animationDuration: "180ms";
|
|
170
170
|
readonly size: {
|
|
171
171
|
readonly sm: 400;
|
|
@@ -18,7 +18,7 @@ export declare const modal: {
|
|
|
18
18
|
readonly nativeMaxHeight: "90%";
|
|
19
19
|
readonly viewportMargin: number;
|
|
20
20
|
readonly topOffset: number;
|
|
21
|
-
readonly zIndexOffset:
|
|
21
|
+
readonly zIndexOffset: 1;
|
|
22
22
|
readonly animationDuration: "180ms";
|
|
23
23
|
readonly size: {
|
|
24
24
|
readonly sm: 400;
|
|
@@ -18,7 +18,7 @@ export declare const modal: {
|
|
|
18
18
|
readonly nativeMaxHeight: "90%";
|
|
19
19
|
readonly viewportMargin: number;
|
|
20
20
|
readonly topOffset: number;
|
|
21
|
-
readonly zIndexOffset:
|
|
21
|
+
readonly zIndexOffset: 1;
|
|
22
22
|
readonly animationDuration: "180ms";
|
|
23
23
|
readonly size: {
|
|
24
24
|
readonly sm: 400;
|
|
@@ -3,6 +3,7 @@ export { border } from './border.js';
|
|
|
3
3
|
export { control } from './control.js';
|
|
4
4
|
export { divider } from './divider.js';
|
|
5
5
|
export { focus } from './focus.js';
|
|
6
|
+
export { icons } from './icons.js';
|
|
6
7
|
export { menu } from './menu.js';
|
|
7
8
|
export { navigation } from './navigation.js';
|
|
8
9
|
export { overlay } from './overlay.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/light/semantic/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/light/semantic/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -3,6 +3,7 @@ export { border } from './border.js';
|
|
|
3
3
|
export { control } from './control.js';
|
|
4
4
|
export { divider } from './divider.js';
|
|
5
5
|
export { focus } from './focus.js';
|
|
6
|
+
export { icons } from './icons.js';
|
|
6
7
|
export { menu } from './menu.js';
|
|
7
8
|
export { navigation } from './navigation.js';
|
|
8
9
|
export { overlay } from './overlay.js';
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export declare const tokenPreservationBaselineRevisionV1: "c218cd97244cf5738bb22b9fb1e5ce172c0f516a";
|
|
2
|
+
export declare const tokenMigrationKinds: readonly ["rename", "alias", "remove", "addition", "representation-change", "visual-change"];
|
|
3
|
+
export type TokenMigrationKind = (typeof tokenMigrationKinds)[number];
|
|
4
|
+
export declare const tokenMigrationThemeNames: readonly ["light", "dark", "high-contrast"];
|
|
5
|
+
export type TokenMigrationThemeName = (typeof tokenMigrationThemeNames)[number];
|
|
6
|
+
export declare const tokenMigrationPlatforms: readonly ["web", "react-native"];
|
|
7
|
+
export type TokenMigrationPlatform = (typeof tokenMigrationPlatforms)[number];
|
|
8
|
+
type TokenMigrationBase = {
|
|
9
|
+
id: string;
|
|
10
|
+
issue: `#${number}`;
|
|
11
|
+
reason: string;
|
|
12
|
+
themes?: readonly TokenMigrationThemeName[];
|
|
13
|
+
platforms?: readonly TokenMigrationPlatform[];
|
|
14
|
+
};
|
|
15
|
+
export type TokenRenameMigration = TokenMigrationBase & {
|
|
16
|
+
kind: 'rename';
|
|
17
|
+
from: string;
|
|
18
|
+
to: string;
|
|
19
|
+
};
|
|
20
|
+
export type TokenAliasMigration = TokenMigrationBase & {
|
|
21
|
+
kind: 'alias';
|
|
22
|
+
from: string;
|
|
23
|
+
to: string;
|
|
24
|
+
};
|
|
25
|
+
export type TokenRemovalMigration = TokenMigrationBase & {
|
|
26
|
+
kind: 'remove';
|
|
27
|
+
from: string;
|
|
28
|
+
};
|
|
29
|
+
export type TokenAdditionMigration = TokenMigrationBase & {
|
|
30
|
+
kind: 'addition';
|
|
31
|
+
to: string;
|
|
32
|
+
};
|
|
33
|
+
type TokenRepresentationMigrationBase = Omit<TokenMigrationBase, 'platforms'> & {
|
|
34
|
+
kind: 'representation-change';
|
|
35
|
+
from: string;
|
|
36
|
+
to?: string;
|
|
37
|
+
equivalence: string;
|
|
38
|
+
evidence: string;
|
|
39
|
+
};
|
|
40
|
+
export type TokenCanonicalRepresentationMigration = TokenRepresentationMigrationBase & {
|
|
41
|
+
layer: 'canonical';
|
|
42
|
+
platforms?: never;
|
|
43
|
+
};
|
|
44
|
+
export type TokenPlatformRepresentationMigration = TokenRepresentationMigrationBase & {
|
|
45
|
+
layer: 'platform-output';
|
|
46
|
+
platforms: readonly [TokenMigrationPlatform, ...TokenMigrationPlatform[]];
|
|
47
|
+
};
|
|
48
|
+
export type TokenRepresentationMigration = TokenCanonicalRepresentationMigration | TokenPlatformRepresentationMigration;
|
|
49
|
+
export type TokenVisualChangeMigration = TokenMigrationBase & {
|
|
50
|
+
kind: 'visual-change';
|
|
51
|
+
from?: string;
|
|
52
|
+
to?: string;
|
|
53
|
+
approved: true;
|
|
54
|
+
approvalEvidence: string;
|
|
55
|
+
};
|
|
56
|
+
export type TokenMigrationEntry = TokenRenameMigration | TokenAliasMigration | TokenRemovalMigration | TokenAdditionMigration | TokenRepresentationMigration | TokenVisualChangeMigration;
|
|
57
|
+
/**
|
|
58
|
+
* Migration/test metadata only. This is not a runtime token registry.
|
|
59
|
+
*
|
|
60
|
+
* Every #879 token rename, alias, removal, addition, representation-only
|
|
61
|
+
* change, or intentionally approved visual change must be recorded here before
|
|
62
|
+
* the preservation baseline is allowed to accept it.
|
|
63
|
+
*/
|
|
64
|
+
export declare const tokenMigrationManifestV1: ({
|
|
65
|
+
id: string;
|
|
66
|
+
kind: "representation-change";
|
|
67
|
+
layer: "canonical";
|
|
68
|
+
issue: "#881";
|
|
69
|
+
reason: string;
|
|
70
|
+
from: string;
|
|
71
|
+
equivalence: string;
|
|
72
|
+
evidence: string;
|
|
73
|
+
platforms?: undefined;
|
|
74
|
+
approved?: undefined;
|
|
75
|
+
approvalEvidence?: undefined;
|
|
76
|
+
} | {
|
|
77
|
+
id: string;
|
|
78
|
+
kind: "visual-change";
|
|
79
|
+
issue: "#881";
|
|
80
|
+
platforms: "web"[];
|
|
81
|
+
reason: string;
|
|
82
|
+
from: string;
|
|
83
|
+
approved: true;
|
|
84
|
+
approvalEvidence: string;
|
|
85
|
+
layer?: undefined;
|
|
86
|
+
equivalence?: undefined;
|
|
87
|
+
evidence?: undefined;
|
|
88
|
+
})[];
|
|
89
|
+
export {};
|
|
90
|
+
//# sourceMappingURL=token-migrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-migrations.d.ts","sourceRoot":"","sources":["../../src/preservation/token-migrations.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mCAAmC,EAC9C,0CAAmD,CAAC;AAEtD,eAAO,MAAM,mBAAmB,8FAOtB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,eAAO,MAAM,wBAAwB,6CAI3B,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhF,eAAO,MAAM,uBAAuB,kCAAmC,CAAC;AAExE,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9E,KAAK,kBAAkB,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,IAAI,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,SAAS,uBAAuB,EAAE,CAAC;IAC5C,SAAS,CAAC,EAAE,SAAS,sBAAsB,EAAE,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,GAAG;IACtD,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,GAAG;IACrD,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,kBAAkB,GAAG;IACvD,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,GAAG;IACxD,IAAI,EAAE,UAAU,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,KAAK,gCAAgC,GAAG,IAAI,CAC1C,kBAAkB,EAClB,WAAW,CACZ,GAAG;IACF,IAAI,EAAE,uBAAuB,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAIF,MAAM,MAAM,qCAAqC,GAC/C,gCAAgC,GAAG;IACjC,KAAK,EAAE,WAAW,CAAC;IACnB,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB,CAAC;AAEJ,MAAM,MAAM,oCAAoC,GAC9C,gCAAgC,GAAG;IACjC,KAAK,EAAE,iBAAiB,CAAC;IACzB,SAAS,EAAE,SAAS,CAAC,sBAAsB,EAAE,GAAG,sBAAsB,EAAE,CAAC,CAAC;CAC3E,CAAC;AAEJ,MAAM,MAAM,4BAA4B,GACtC,qCAAqC,GAAG,oCAAoC,CAAC;AAE/E,MAAM,MAAM,0BAA0B,GAAG,kBAAkB,GAAG;IAC5D,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,IAAI,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAC3B,oBAAoB,GACpB,mBAAmB,GACnB,qBAAqB,GACrB,sBAAsB,GACtB,4BAA4B,GAC5B,0BAA0B,CAAC;AAK/B;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;IAgFK,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
export const tokenPreservationBaselineRevisionV1 = 'c218cd97244cf5738bb22b9fb1e5ce172c0f516a';
|
|
2
|
+
export const tokenMigrationKinds = [
|
|
3
|
+
'rename',
|
|
4
|
+
'alias',
|
|
5
|
+
'remove',
|
|
6
|
+
'addition',
|
|
7
|
+
'representation-change',
|
|
8
|
+
'visual-change',
|
|
9
|
+
];
|
|
10
|
+
export const tokenMigrationThemeNames = [
|
|
11
|
+
'light',
|
|
12
|
+
'dark',
|
|
13
|
+
'high-contrast',
|
|
14
|
+
];
|
|
15
|
+
export const tokenMigrationPlatforms = ['web', 'react-native'];
|
|
16
|
+
const valueKindWebFixApproval = '#881 explicitly requires correcting invalid unitless CSS serialization; targeted serializer regressions and the pinned Linux visual suite are the approval evidence.';
|
|
17
|
+
/**
|
|
18
|
+
* Migration/test metadata only. This is not a runtime token registry.
|
|
19
|
+
*
|
|
20
|
+
* Every #879 token rename, alias, removal, addition, representation-only
|
|
21
|
+
* change, or intentionally approved visual change must be recorded here before
|
|
22
|
+
* the preservation baseline is allowed to accept it.
|
|
23
|
+
*/
|
|
24
|
+
export const tokenMigrationManifestV1 = [
|
|
25
|
+
{
|
|
26
|
+
id: '881-modal-z-index-offset-number',
|
|
27
|
+
kind: 'representation-change',
|
|
28
|
+
layer: 'canonical',
|
|
29
|
+
issue: '#881',
|
|
30
|
+
reason: 'Remove a stringified-number workaround now that z-index/order has a canonical unitless numeric kind.',
|
|
31
|
+
from: 'components.modal.content.zIndexOffset',
|
|
32
|
+
equivalence: 'Canonical "1" and numeric 1 represent the same stack offset; Web serialization remains the literal value 1.',
|
|
33
|
+
evidence: 'The value-kind serializer regression locks Web output to 1 and current first-party Modal renderers do not consume the old string representation directly.',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: '881-radio-pressed-scale-web',
|
|
37
|
+
kind: 'visual-change',
|
|
38
|
+
issue: '#881',
|
|
39
|
+
platforms: ['web'],
|
|
40
|
+
reason: 'Correct Radio pressed scale from invalid px-suffixed transform input to the intended unitless scale.',
|
|
41
|
+
from: 'components.radio.motion.pressedScale',
|
|
42
|
+
approved: true,
|
|
43
|
+
approvalEvidence: valueKindWebFixApproval,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: '881-radio-active-scale-web',
|
|
47
|
+
kind: 'visual-change',
|
|
48
|
+
issue: '#881',
|
|
49
|
+
platforms: ['web'],
|
|
50
|
+
reason: 'Correct Radio active scale from invalid px-suffixed transform input to the intended unitless scale.',
|
|
51
|
+
from: 'components.radio.motion.activeScale',
|
|
52
|
+
approved: true,
|
|
53
|
+
approvalEvidence: valueKindWebFixApproval,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: '881-radio-pressed-opacity-web',
|
|
57
|
+
kind: 'visual-change',
|
|
58
|
+
issue: '#881',
|
|
59
|
+
platforms: ['web'],
|
|
60
|
+
reason: 'Correct Radio pressed opacity from invalid px-suffixed output to the intended unitless opacity.',
|
|
61
|
+
from: 'components.radio.motion.pressedOpacity',
|
|
62
|
+
approved: true,
|
|
63
|
+
approvalEvidence: valueKindWebFixApproval,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: '881-tooltip-scale-web',
|
|
67
|
+
kind: 'visual-change',
|
|
68
|
+
issue: '#881',
|
|
69
|
+
platforms: ['web'],
|
|
70
|
+
reason: 'Correct Tooltip content scale from invalid px-suffixed transform input to the intended unitless scale.',
|
|
71
|
+
from: 'components.tooltip.content.scale',
|
|
72
|
+
approved: true,
|
|
73
|
+
approvalEvidence: valueKindWebFixApproval,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: '881-popover-native-shadow-opacity-web',
|
|
77
|
+
kind: 'visual-change',
|
|
78
|
+
issue: '#881',
|
|
79
|
+
platforms: ['web'],
|
|
80
|
+
reason: 'Publish the native Popover shadow opacity with its canonical unitless representation instead of an invalid px suffix.',
|
|
81
|
+
from: 'components.popover.content.shadow.native.opacity',
|
|
82
|
+
approved: true,
|
|
83
|
+
approvalEvidence: valueKindWebFixApproval,
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: '881-popover-native-shadow-elevation-web',
|
|
87
|
+
kind: 'visual-change',
|
|
88
|
+
issue: '#881',
|
|
89
|
+
platforms: ['web'],
|
|
90
|
+
reason: 'Publish the native Popover shadow elevation with its canonical unitless representation instead of an invalid px suffix.',
|
|
91
|
+
from: 'components.popover.content.shadow.native.elevation',
|
|
92
|
+
approved: true,
|
|
93
|
+
approvalEvidence: valueKindWebFixApproval,
|
|
94
|
+
},
|
|
95
|
+
];
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical token architecture metadata for tooling, Generator V2, and agents.
|
|
3
|
+
*
|
|
4
|
+
* This file intentionally describes ownership, vocabulary, and audit findings
|
|
5
|
+
* without changing any resolved token value.
|
|
6
|
+
*/
|
|
7
|
+
export declare const tokenArchitectureLayers: readonly ["primitive", "semantic", "component-factory", "component", "platform-output", "consumer"];
|
|
8
|
+
export declare const tokenArchitectureFlow: "primitive -> semantic -> component-factory -> component -> platform-output -> consumer";
|
|
9
|
+
export declare const tokenValueKinds: readonly ["color", "length", "unitless-number", "opacity", "scale", "z-index", "duration", "easing", "shadow", "font-family", "font-weight", "font-size", "line-height", "raw-string"];
|
|
10
|
+
export type TokenValueKind = (typeof tokenValueKinds)[number];
|
|
11
|
+
export declare const tokenValueKindWebContract: {
|
|
12
|
+
readonly color: {
|
|
13
|
+
readonly numericUnit: null;
|
|
14
|
+
};
|
|
15
|
+
readonly length: {
|
|
16
|
+
readonly numericUnit: "px";
|
|
17
|
+
};
|
|
18
|
+
readonly 'unitless-number': {
|
|
19
|
+
readonly numericUnit: "";
|
|
20
|
+
};
|
|
21
|
+
readonly opacity: {
|
|
22
|
+
readonly numericUnit: "";
|
|
23
|
+
};
|
|
24
|
+
readonly scale: {
|
|
25
|
+
readonly numericUnit: "";
|
|
26
|
+
};
|
|
27
|
+
readonly 'z-index': {
|
|
28
|
+
readonly numericUnit: "";
|
|
29
|
+
};
|
|
30
|
+
readonly duration: {
|
|
31
|
+
readonly numericUnit: "ms";
|
|
32
|
+
};
|
|
33
|
+
readonly easing: {
|
|
34
|
+
readonly numericUnit: null;
|
|
35
|
+
};
|
|
36
|
+
readonly shadow: {
|
|
37
|
+
readonly numericUnit: null;
|
|
38
|
+
};
|
|
39
|
+
readonly 'font-family': {
|
|
40
|
+
readonly numericUnit: null;
|
|
41
|
+
};
|
|
42
|
+
readonly 'font-weight': {
|
|
43
|
+
readonly numericUnit: "";
|
|
44
|
+
};
|
|
45
|
+
readonly 'font-size': {
|
|
46
|
+
readonly numericUnit: "px";
|
|
47
|
+
};
|
|
48
|
+
readonly 'line-height': {
|
|
49
|
+
readonly numericUnit: "px";
|
|
50
|
+
};
|
|
51
|
+
readonly 'raw-string': {
|
|
52
|
+
readonly numericUnit: null;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Canonical numeric role families. Matching is by semantic role words, not by
|
|
57
|
+
* one-off full token paths. Compound roles may put the semantic family at
|
|
58
|
+
* either edge (`paddingBottom`, `borderWidth`, `contentScale`), and nested
|
|
59
|
+
* scales may inherit meaning from their nearest parent role (`size.sm`).
|
|
60
|
+
*/
|
|
61
|
+
export declare const canonicalComponentNumericRoleFamilies: {
|
|
62
|
+
readonly scale: readonly ["scale"];
|
|
63
|
+
readonly opacity: readonly ["opacity"];
|
|
64
|
+
readonly 'z-index': readonly ["zIndex", "zIndexOffset", "order"];
|
|
65
|
+
readonly 'unitless-number': readonly ["elevation"];
|
|
66
|
+
readonly 'font-weight': readonly ["fontWeight"];
|
|
67
|
+
readonly 'font-size': readonly ["fontSize"];
|
|
68
|
+
readonly 'line-height': readonly ["lineHeight"];
|
|
69
|
+
readonly duration: readonly ["duration"];
|
|
70
|
+
readonly length: readonly ["width", "height", "size", "gap", "padding", "paddingX", "paddingY", "radius", "margin", "marginX", "marginY", "offset", "blur", "translateX", "translateY", "travel"];
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Resolve the canonical value kind for a scalar token path.
|
|
74
|
+
*
|
|
75
|
+
* Unknown strings remain explicit raw strings because CSS accepts many
|
|
76
|
+
* renderer-specific string representations. Unknown numeric paths are rejected
|
|
77
|
+
* by `requireTokenValueKind`: a number must always declare meaning through the
|
|
78
|
+
* canonical namespace or role vocabulary before it can reach a renderer.
|
|
79
|
+
*/
|
|
80
|
+
export declare function resolveTokenValueKind(tokenPath: string, value: string | number): TokenValueKind | null;
|
|
81
|
+
export declare function requireTokenValueKind(tokenPath: string, value: string | number): TokenValueKind;
|
|
82
|
+
export declare const canonicalTokenVocabulary: {
|
|
83
|
+
readonly surface: readonly ["canvas", "default", "subtle", "muted", "elevated", "hover", "active", "pressed", "disabled", "danger", "inverse"];
|
|
84
|
+
readonly state: readonly ["default", "hover", "active", "pressed", "selected", "disabled", "focus"];
|
|
85
|
+
readonly foreground: readonly ["primary", "secondary", "muted", "subtle", "disabled", "brand", "interactive", "interactiveHover", "interactiveActive", "inverse"];
|
|
86
|
+
readonly border: readonly ["subtle", "muted", "default", "strong", "elevated", "disabled"];
|
|
87
|
+
readonly intent: readonly ["primary", "neutral", "success", "warning", "danger"];
|
|
88
|
+
readonly status: readonly ["success", "error", "warning", "info"];
|
|
89
|
+
};
|
|
90
|
+
export declare const canonicalSemanticRolePaths: readonly ["surface.canvas", "surface.default", "surface.subtle", "surface.muted", "surface.elevated", "surface.hover", "surface.active", "surface.pressed", "surface.disabled", "surface.danger", "surface.inverse", "text.primary", "text.secondary", "text.muted", "text.subtle", "text.disabled", "text.brand", "text.interactive", "text.interactiveHover", "text.interactiveActive", "text.inverse", "border.subtle", "border.muted", "border.default", "border.strong", "border.elevated", "border.disabled", "border.focus", "divider.muted", "divider.default", "divider.strong", "focus.ring.color", "focus.ring.width", "focus.ring.shadow", "focus.ring.offset", "status.success.fg", "status.success.bg", "status.success.border", "status.success.ring", "status.success.strong", "status.error.fg", "status.error.bg", "status.error.border", "status.error.ring", "status.error.strong", "status.warning.fg", "status.warning.bg", "status.warning.border", "status.warning.ring", "status.warning.strong", "status.info.fg", "status.info.bg", "status.info.border", "status.info.ring", "status.info.strong", "overlay.backdrop", "overlay.tooltip.bg", "overlay.tooltip.fg", "overlay.tooltip.border", "overlay.popover.bg", "overlay.popover.border", "overlay.modal.bg", "overlay.modal.border"];
|
|
91
|
+
export declare const componentTokenFactoryModel: {
|
|
92
|
+
readonly canonicalName: "create<Component>Tokens";
|
|
93
|
+
readonly legacyPaletteName: "create<Component>Palette is retained when the component exposes intent palettes.";
|
|
94
|
+
readonly role: "Factories compose semantic inputs and stable implementation primitives into component contracts.";
|
|
95
|
+
readonly transparentPrimitive: "transparent is an implementation primitive for absent paint, not a theme color.";
|
|
96
|
+
readonly generatorRule: "Reuse an existing factory when a generated component has equivalent state vocabulary; extend a reusable factory only when the existing component contract needs a stable shared state; introduce a component-specific factory only for a reusable component contract that generic semantic roles cannot express.";
|
|
97
|
+
};
|
|
98
|
+
export declare const maintainedComponentFactories: readonly [{
|
|
99
|
+
readonly name: "createAccordionTokens";
|
|
100
|
+
readonly source: "packages/tokens/src/factories/createAccordionTokens.ts";
|
|
101
|
+
readonly semanticAdapter: "createAccordionTokensFromSemantics";
|
|
102
|
+
readonly stateKeys: readonly ["default", "expanded", "hover", "pressed", "disabled"];
|
|
103
|
+
}, {
|
|
104
|
+
readonly name: "createButtonPalette";
|
|
105
|
+
readonly source: "packages/tokens/src/factories/createButtonPalette.ts";
|
|
106
|
+
readonly semanticAdapter: null;
|
|
107
|
+
readonly stateKeys: readonly ["default", "hover", "pressed"];
|
|
108
|
+
}, {
|
|
109
|
+
readonly name: "createCheckboxPalette";
|
|
110
|
+
readonly source: "packages/tokens/src/factories/createCheckboxPalette.ts";
|
|
111
|
+
readonly semanticAdapter: null;
|
|
112
|
+
readonly stateKeys: readonly ["default", "hover", "pressed"];
|
|
113
|
+
}, {
|
|
114
|
+
readonly name: "createContextMenuTokens";
|
|
115
|
+
readonly source: "packages/tokens/src/factories/createContextMenuTokens.ts";
|
|
116
|
+
readonly semanticAdapter: "createContextMenuTokensFromSemantics";
|
|
117
|
+
readonly stateKeys: readonly ["default", "hover", "active", "pressed", "focus", "disabled"];
|
|
118
|
+
}, {
|
|
119
|
+
readonly name: "createDropdownPalette";
|
|
120
|
+
readonly source: "packages/tokens/src/factories/createDropdownPalette.ts";
|
|
121
|
+
readonly semanticAdapter: null;
|
|
122
|
+
readonly stateKeys: readonly ["default", "hover", "focus", "active", "pressed"];
|
|
123
|
+
}, {
|
|
124
|
+
readonly name: "createFormFieldTokensFromTheme";
|
|
125
|
+
readonly source: "packages/tokens/src/factories/createFormFieldTokens.ts";
|
|
126
|
+
readonly semanticAdapter: "createFormFieldTokensFromTheme";
|
|
127
|
+
readonly stateKeys: readonly ["default", "error", "success", "warning", "info", "disabled"];
|
|
128
|
+
}, {
|
|
129
|
+
readonly name: "createInputPalette";
|
|
130
|
+
readonly source: "packages/tokens/src/factories/createInputPalette.ts";
|
|
131
|
+
readonly semanticAdapter: null;
|
|
132
|
+
readonly stateKeys: readonly ["default", "hover", "focus"];
|
|
133
|
+
}, {
|
|
134
|
+
readonly name: "createModalTokens";
|
|
135
|
+
readonly source: "packages/tokens/src/factories/createModalTokens.ts";
|
|
136
|
+
readonly semanticAdapter: "createModalTokensFromSemantics";
|
|
137
|
+
readonly stateKeys: readonly ["default", "hover", "pressed", "focus", "disabled"];
|
|
138
|
+
}, {
|
|
139
|
+
readonly name: "createPopoverTokens";
|
|
140
|
+
readonly source: "packages/tokens/src/factories/createPopoverTokens.ts";
|
|
141
|
+
readonly semanticAdapter: "createPopoverTokensFromTheme";
|
|
142
|
+
readonly stateKeys: readonly ["default"];
|
|
143
|
+
}, {
|
|
144
|
+
readonly name: "createRadioGroupTokens";
|
|
145
|
+
readonly source: "packages/tokens/src/factories/createRadioGroupTokens.ts";
|
|
146
|
+
readonly semanticAdapter: "createRadioGroupTokensFromSpacing";
|
|
147
|
+
readonly stateKeys: readonly ["default"];
|
|
148
|
+
}, {
|
|
149
|
+
readonly name: "createRadioPalette";
|
|
150
|
+
readonly source: "packages/tokens/src/factories/createRadioPalette.ts";
|
|
151
|
+
readonly semanticAdapter: null;
|
|
152
|
+
readonly stateKeys: readonly ["default", "hover", "pressed"];
|
|
153
|
+
}, {
|
|
154
|
+
readonly name: "createSelectPalette";
|
|
155
|
+
readonly source: "packages/tokens/src/factories/createSelectPalette.ts";
|
|
156
|
+
readonly semanticAdapter: null;
|
|
157
|
+
readonly stateKeys: readonly ["default", "hover", "focus", "active", "pressed", "selected", "selectedHover", "selectedActive", "selectedPressed"];
|
|
158
|
+
}, {
|
|
159
|
+
readonly name: "createSwitchTokens";
|
|
160
|
+
readonly source: "packages/tokens/src/factories/createSwitchTokens.ts";
|
|
161
|
+
readonly semanticAdapter: "createSwitchTokensFromSemantics";
|
|
162
|
+
readonly stateKeys: readonly ["default", "hover", "pressed", "disabled"];
|
|
163
|
+
}, {
|
|
164
|
+
readonly name: "createTabsTokens";
|
|
165
|
+
readonly source: "packages/tokens/src/factories/createTabsTokens.ts";
|
|
166
|
+
readonly semanticAdapter: null;
|
|
167
|
+
readonly stateKeys: readonly ["default", "hover", "active", "disabled"];
|
|
168
|
+
}, {
|
|
169
|
+
readonly name: "createTooltipTokens";
|
|
170
|
+
readonly source: "packages/tokens/src/factories/createTooltipTokens.ts";
|
|
171
|
+
readonly semanticAdapter: "createTooltipTokensFromTheme";
|
|
172
|
+
readonly stateKeys: readonly ["default"];
|
|
173
|
+
}];
|
|
174
|
+
export declare const tokenArchitectureAuditFindings: readonly [{
|
|
175
|
+
readonly id: "semantic-shape-parity";
|
|
176
|
+
readonly classification: "A";
|
|
177
|
+
readonly summary: "Light, dark, and high-contrast themes expose the same semantic token shape.";
|
|
178
|
+
}, {
|
|
179
|
+
readonly id: "component-shape-parity";
|
|
180
|
+
readonly classification: "A";
|
|
181
|
+
readonly summary: "Light, dark, and high-contrast themes expose the same component token shape.";
|
|
182
|
+
}, {
|
|
183
|
+
readonly id: "factory-layer";
|
|
184
|
+
readonly classification: "E";
|
|
185
|
+
readonly summary: "Component token factories are a first-class layer for stable component state contracts.";
|
|
186
|
+
}, {
|
|
187
|
+
readonly id: "website-text-tertiary";
|
|
188
|
+
readonly classification: "H";
|
|
189
|
+
readonly summary: "Website CSS references --text-tertiary, which is not a canonical semantic token. Adding or remapping it would visibly affect website text and should be handled by a focused visual issue.";
|
|
190
|
+
}, {
|
|
191
|
+
readonly id: "website-demo-raw-border";
|
|
192
|
+
readonly classification: "H";
|
|
193
|
+
readonly summary: "Some component catalog examples use raw demonstration border colors. Replacing them with tokens may alter examples and should be handled only with explicit visual approval.";
|
|
194
|
+
}];
|
|
195
|
+
//# sourceMappingURL=token-architecture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-architecture.d.ts","sourceRoot":"","sources":["../src/token-architecture.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,uBAAuB,qGAO1B,CAAC;AAEX,eAAO,MAAM,qBAAqB,EAChC,wFAAiG,CAAC;AAEpG,eAAO,MAAM,eAAe,wLAelB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9D,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBrC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;CA2BqB,CAAC;AAsHxE;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GAAG,MAAM,GACrB,cAAc,GAAG,IAAI,CAwCvB;AAED,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GAAG,MAAM,GACrB,cAAc,CAQhB;AAED,eAAO,MAAM,wBAAwB;;;;;;;CAsC3B,CAAC;AAEX,eAAO,MAAM,0BAA0B,svCAgE7B,CAAC;AAEX,eAAO,MAAM,0BAA0B;;;;;;CAS7B,CAAC;AAEX,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqG/B,CAAC;AAEX,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;EA+BjC,CAAC"}
|
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical token architecture metadata for tooling, Generator V2, and agents.
|
|
3
|
+
*
|
|
4
|
+
* This file intentionally describes ownership, vocabulary, and audit findings
|
|
5
|
+
* without changing any resolved token value.
|
|
6
|
+
*/
|
|
7
|
+
export const tokenArchitectureLayers = [
|
|
8
|
+
'primitive',
|
|
9
|
+
'semantic',
|
|
10
|
+
'component-factory',
|
|
11
|
+
'component',
|
|
12
|
+
'platform-output',
|
|
13
|
+
'consumer',
|
|
14
|
+
];
|
|
15
|
+
export const tokenArchitectureFlow = 'primitive -> semantic -> component-factory -> component -> platform-output -> consumer';
|
|
16
|
+
export const tokenValueKinds = [
|
|
17
|
+
'color',
|
|
18
|
+
'length',
|
|
19
|
+
'unitless-number',
|
|
20
|
+
'opacity',
|
|
21
|
+
'scale',
|
|
22
|
+
'z-index',
|
|
23
|
+
'duration',
|
|
24
|
+
'easing',
|
|
25
|
+
'shadow',
|
|
26
|
+
'font-family',
|
|
27
|
+
'font-weight',
|
|
28
|
+
'font-size',
|
|
29
|
+
'line-height',
|
|
30
|
+
'raw-string',
|
|
31
|
+
];
|
|
32
|
+
export const tokenValueKindWebContract = {
|
|
33
|
+
color: { numericUnit: null },
|
|
34
|
+
length: { numericUnit: 'px' },
|
|
35
|
+
'unitless-number': { numericUnit: '' },
|
|
36
|
+
opacity: { numericUnit: '' },
|
|
37
|
+
scale: { numericUnit: '' },
|
|
38
|
+
'z-index': { numericUnit: '' },
|
|
39
|
+
duration: { numericUnit: 'ms' },
|
|
40
|
+
easing: { numericUnit: null },
|
|
41
|
+
shadow: { numericUnit: null },
|
|
42
|
+
'font-family': { numericUnit: null },
|
|
43
|
+
'font-weight': { numericUnit: '' },
|
|
44
|
+
'font-size': { numericUnit: 'px' },
|
|
45
|
+
'line-height': { numericUnit: 'px' },
|
|
46
|
+
'raw-string': { numericUnit: null },
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Canonical numeric role families. Matching is by semantic role words, not by
|
|
50
|
+
* one-off full token paths. Compound roles may put the semantic family at
|
|
51
|
+
* either edge (`paddingBottom`, `borderWidth`, `contentScale`), and nested
|
|
52
|
+
* scales may inherit meaning from their nearest parent role (`size.sm`).
|
|
53
|
+
*/
|
|
54
|
+
export const canonicalComponentNumericRoleFamilies = {
|
|
55
|
+
scale: ['scale'],
|
|
56
|
+
opacity: ['opacity'],
|
|
57
|
+
'z-index': ['zIndex', 'zIndexOffset', 'order'],
|
|
58
|
+
'unitless-number': ['elevation'],
|
|
59
|
+
'font-weight': ['fontWeight'],
|
|
60
|
+
'font-size': ['fontSize'],
|
|
61
|
+
'line-height': ['lineHeight'],
|
|
62
|
+
duration: ['duration'],
|
|
63
|
+
length: [
|
|
64
|
+
'width',
|
|
65
|
+
'height',
|
|
66
|
+
'size',
|
|
67
|
+
'gap',
|
|
68
|
+
'padding',
|
|
69
|
+
'paddingX',
|
|
70
|
+
'paddingY',
|
|
71
|
+
'radius',
|
|
72
|
+
'margin',
|
|
73
|
+
'marginX',
|
|
74
|
+
'marginY',
|
|
75
|
+
'offset',
|
|
76
|
+
'blur',
|
|
77
|
+
'translateX',
|
|
78
|
+
'translateY',
|
|
79
|
+
'travel',
|
|
80
|
+
],
|
|
81
|
+
};
|
|
82
|
+
const componentStringRoleFamilies = {
|
|
83
|
+
duration: ['duration'],
|
|
84
|
+
easing: ['easing'],
|
|
85
|
+
color: [
|
|
86
|
+
'bg',
|
|
87
|
+
'fg',
|
|
88
|
+
'border',
|
|
89
|
+
'ring',
|
|
90
|
+
'color',
|
|
91
|
+
'placeholder',
|
|
92
|
+
'icon',
|
|
93
|
+
'indicator',
|
|
94
|
+
'divider',
|
|
95
|
+
],
|
|
96
|
+
shadow: ['shadow'],
|
|
97
|
+
};
|
|
98
|
+
function lastTokenPathSegment(tokenPath) {
|
|
99
|
+
return tokenPath.split('.').at(-1) ?? '';
|
|
100
|
+
}
|
|
101
|
+
function splitRoleWords(role) {
|
|
102
|
+
return role
|
|
103
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1 $2')
|
|
104
|
+
.replace(/[^a-zA-Z0-9]+/g, ' ')
|
|
105
|
+
.trim()
|
|
106
|
+
.toLowerCase()
|
|
107
|
+
.split(/\s+/)
|
|
108
|
+
.filter(Boolean);
|
|
109
|
+
}
|
|
110
|
+
function matchesRoleFamily(role, families) {
|
|
111
|
+
const roleWords = splitRoleWords(role);
|
|
112
|
+
return families.some((family) => {
|
|
113
|
+
const familyWords = splitRoleWords(family);
|
|
114
|
+
if (familyWords.length > roleWords.length)
|
|
115
|
+
return false;
|
|
116
|
+
const prefixMatches = familyWords.every((word, index) => roleWords[index] === word);
|
|
117
|
+
const suffixStart = roleWords.length - familyWords.length;
|
|
118
|
+
const suffixMatches = familyWords.every((word, index) => roleWords[suffixStart + index] === word);
|
|
119
|
+
return prefixMatches || suffixMatches;
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
function resolveRoleKind(role, families) {
|
|
123
|
+
for (const [kind, roleFamilies] of Object.entries(families)) {
|
|
124
|
+
if (matchesRoleFamily(role, roleFamilies))
|
|
125
|
+
return kind;
|
|
126
|
+
}
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
function resolveShadowLeafKind(tokenPath) {
|
|
130
|
+
const role = lastTokenPathSegment(tokenPath).toLowerCase();
|
|
131
|
+
if (role === 'x' || role === 'y' || role === 'blur')
|
|
132
|
+
return 'length';
|
|
133
|
+
if (role === 'opacity')
|
|
134
|
+
return 'opacity';
|
|
135
|
+
if (role === 'elevation')
|
|
136
|
+
return 'unitless-number';
|
|
137
|
+
if (role === 'color')
|
|
138
|
+
return 'color';
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
function componentRoleSegments(tokenPath) {
|
|
142
|
+
const segments = tokenPath.split('.');
|
|
143
|
+
if (tokenPath.startsWith('components.') ||
|
|
144
|
+
tokenPath.startsWith('tokens.controlSizes.')) {
|
|
145
|
+
return segments.slice(2);
|
|
146
|
+
}
|
|
147
|
+
return segments;
|
|
148
|
+
}
|
|
149
|
+
function resolveComponentValueKind(tokenPath, value) {
|
|
150
|
+
if (tokenPath.includes('.shadow.native.')) {
|
|
151
|
+
const shadowKind = resolveShadowLeafKind(tokenPath);
|
|
152
|
+
if (shadowKind)
|
|
153
|
+
return shadowKind;
|
|
154
|
+
}
|
|
155
|
+
const roleSegments = componentRoleSegments(tokenPath);
|
|
156
|
+
// Token meaning comes from its canonical path, not from the runtime storage
|
|
157
|
+
// type. This keeps stringified numeric workarounds visible to validation.
|
|
158
|
+
for (let index = roleSegments.length - 1; index >= 0; index -= 1) {
|
|
159
|
+
const numericRoleKind = resolveRoleKind(roleSegments[index], canonicalComponentNumericRoleFamilies);
|
|
160
|
+
if (numericRoleKind)
|
|
161
|
+
return numericRoleKind;
|
|
162
|
+
}
|
|
163
|
+
if (typeof value === 'number')
|
|
164
|
+
return null;
|
|
165
|
+
const role = roleSegments.at(-1) ?? '';
|
|
166
|
+
return resolveRoleKind(role, componentStringRoleFamilies) ?? 'raw-string';
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Resolve the canonical value kind for a scalar token path.
|
|
170
|
+
*
|
|
171
|
+
* Unknown strings remain explicit raw strings because CSS accepts many
|
|
172
|
+
* renderer-specific string representations. Unknown numeric paths are rejected
|
|
173
|
+
* by `requireTokenValueKind`: a number must always declare meaning through the
|
|
174
|
+
* canonical namespace or role vocabulary before it can reach a renderer.
|
|
175
|
+
*/
|
|
176
|
+
export function resolveTokenValueKind(tokenPath, value) {
|
|
177
|
+
if (tokenPath.startsWith('colors.'))
|
|
178
|
+
return 'color';
|
|
179
|
+
if (tokenPath.startsWith('primitives.overlay.'))
|
|
180
|
+
return 'color';
|
|
181
|
+
if (tokenPath.startsWith('semantic.')) {
|
|
182
|
+
if (tokenPath.startsWith('semantic.shadow.') ||
|
|
183
|
+
tokenPath.endsWith('.shadow')) {
|
|
184
|
+
return 'shadow';
|
|
185
|
+
}
|
|
186
|
+
if (tokenPath === 'semantic.focus.ring.width')
|
|
187
|
+
return 'length';
|
|
188
|
+
return 'color';
|
|
189
|
+
}
|
|
190
|
+
if (tokenPath.startsWith('tokens.spacing.'))
|
|
191
|
+
return 'length';
|
|
192
|
+
if (tokenPath.startsWith('tokens.radius.'))
|
|
193
|
+
return 'length';
|
|
194
|
+
if (tokenPath.startsWith('tokens.zIndex.'))
|
|
195
|
+
return 'z-index';
|
|
196
|
+
if (tokenPath.startsWith('tokens.typography.family.'))
|
|
197
|
+
return 'font-family';
|
|
198
|
+
if (tokenPath.startsWith('tokens.typography.weight.'))
|
|
199
|
+
return 'font-weight';
|
|
200
|
+
if (tokenPath.startsWith('tokens.typography.size.'))
|
|
201
|
+
return 'font-size';
|
|
202
|
+
if (tokenPath.startsWith('tokens.typography.lineHeight.')) {
|
|
203
|
+
return 'line-height';
|
|
204
|
+
}
|
|
205
|
+
if (tokenPath.startsWith('tokens.shadows.')) {
|
|
206
|
+
return resolveShadowLeafKind(tokenPath);
|
|
207
|
+
}
|
|
208
|
+
if (tokenPath.startsWith('tokens.controlSizes.')) {
|
|
209
|
+
return resolveComponentValueKind(tokenPath, value);
|
|
210
|
+
}
|
|
211
|
+
if (tokenPath.startsWith('components.')) {
|
|
212
|
+
return resolveComponentValueKind(tokenPath, value);
|
|
213
|
+
}
|
|
214
|
+
return typeof value === 'number' ? null : 'raw-string';
|
|
215
|
+
}
|
|
216
|
+
export function requireTokenValueKind(tokenPath, value) {
|
|
217
|
+
const kind = resolveTokenValueKind(tokenPath, value);
|
|
218
|
+
if (kind)
|
|
219
|
+
return kind;
|
|
220
|
+
throw new Error(`Unknown numeric token value kind for "${tokenPath}". Add a canonical namespace or role rule before serializing this token.`);
|
|
221
|
+
}
|
|
222
|
+
export const canonicalTokenVocabulary = {
|
|
223
|
+
surface: [
|
|
224
|
+
'canvas',
|
|
225
|
+
'default',
|
|
226
|
+
'subtle',
|
|
227
|
+
'muted',
|
|
228
|
+
'elevated',
|
|
229
|
+
'hover',
|
|
230
|
+
'active',
|
|
231
|
+
'pressed',
|
|
232
|
+
'disabled',
|
|
233
|
+
'danger',
|
|
234
|
+
'inverse',
|
|
235
|
+
],
|
|
236
|
+
state: [
|
|
237
|
+
'default',
|
|
238
|
+
'hover',
|
|
239
|
+
'active',
|
|
240
|
+
'pressed',
|
|
241
|
+
'selected',
|
|
242
|
+
'disabled',
|
|
243
|
+
'focus',
|
|
244
|
+
],
|
|
245
|
+
foreground: [
|
|
246
|
+
'primary',
|
|
247
|
+
'secondary',
|
|
248
|
+
'muted',
|
|
249
|
+
'subtle',
|
|
250
|
+
'disabled',
|
|
251
|
+
'brand',
|
|
252
|
+
'interactive',
|
|
253
|
+
'interactiveHover',
|
|
254
|
+
'interactiveActive',
|
|
255
|
+
'inverse',
|
|
256
|
+
],
|
|
257
|
+
border: ['subtle', 'muted', 'default', 'strong', 'elevated', 'disabled'],
|
|
258
|
+
intent: ['primary', 'neutral', 'success', 'warning', 'danger'],
|
|
259
|
+
status: ['success', 'error', 'warning', 'info'],
|
|
260
|
+
};
|
|
261
|
+
export const canonicalSemanticRolePaths = [
|
|
262
|
+
'surface.canvas',
|
|
263
|
+
'surface.default',
|
|
264
|
+
'surface.subtle',
|
|
265
|
+
'surface.muted',
|
|
266
|
+
'surface.elevated',
|
|
267
|
+
'surface.hover',
|
|
268
|
+
'surface.active',
|
|
269
|
+
'surface.pressed',
|
|
270
|
+
'surface.disabled',
|
|
271
|
+
'surface.danger',
|
|
272
|
+
'surface.inverse',
|
|
273
|
+
'text.primary',
|
|
274
|
+
'text.secondary',
|
|
275
|
+
'text.muted',
|
|
276
|
+
'text.subtle',
|
|
277
|
+
'text.disabled',
|
|
278
|
+
'text.brand',
|
|
279
|
+
'text.interactive',
|
|
280
|
+
'text.interactiveHover',
|
|
281
|
+
'text.interactiveActive',
|
|
282
|
+
'text.inverse',
|
|
283
|
+
'border.subtle',
|
|
284
|
+
'border.muted',
|
|
285
|
+
'border.default',
|
|
286
|
+
'border.strong',
|
|
287
|
+
'border.elevated',
|
|
288
|
+
'border.disabled',
|
|
289
|
+
'border.focus',
|
|
290
|
+
'divider.muted',
|
|
291
|
+
'divider.default',
|
|
292
|
+
'divider.strong',
|
|
293
|
+
'focus.ring.color',
|
|
294
|
+
'focus.ring.width',
|
|
295
|
+
'focus.ring.shadow',
|
|
296
|
+
'focus.ring.offset',
|
|
297
|
+
'status.success.fg',
|
|
298
|
+
'status.success.bg',
|
|
299
|
+
'status.success.border',
|
|
300
|
+
'status.success.ring',
|
|
301
|
+
'status.success.strong',
|
|
302
|
+
'status.error.fg',
|
|
303
|
+
'status.error.bg',
|
|
304
|
+
'status.error.border',
|
|
305
|
+
'status.error.ring',
|
|
306
|
+
'status.error.strong',
|
|
307
|
+
'status.warning.fg',
|
|
308
|
+
'status.warning.bg',
|
|
309
|
+
'status.warning.border',
|
|
310
|
+
'status.warning.ring',
|
|
311
|
+
'status.warning.strong',
|
|
312
|
+
'status.info.fg',
|
|
313
|
+
'status.info.bg',
|
|
314
|
+
'status.info.border',
|
|
315
|
+
'status.info.ring',
|
|
316
|
+
'status.info.strong',
|
|
317
|
+
'overlay.backdrop',
|
|
318
|
+
'overlay.tooltip.bg',
|
|
319
|
+
'overlay.tooltip.fg',
|
|
320
|
+
'overlay.tooltip.border',
|
|
321
|
+
'overlay.popover.bg',
|
|
322
|
+
'overlay.popover.border',
|
|
323
|
+
'overlay.modal.bg',
|
|
324
|
+
'overlay.modal.border',
|
|
325
|
+
];
|
|
326
|
+
export const componentTokenFactoryModel = {
|
|
327
|
+
canonicalName: 'create<Component>Tokens',
|
|
328
|
+
legacyPaletteName: 'create<Component>Palette is retained when the component exposes intent palettes.',
|
|
329
|
+
role: 'Factories compose semantic inputs and stable implementation primitives into component contracts.',
|
|
330
|
+
transparentPrimitive: 'transparent is an implementation primitive for absent paint, not a theme color.',
|
|
331
|
+
generatorRule: 'Reuse an existing factory when a generated component has equivalent state vocabulary; extend a reusable factory only when the existing component contract needs a stable shared state; introduce a component-specific factory only for a reusable component contract that generic semantic roles cannot express.',
|
|
332
|
+
};
|
|
333
|
+
export const maintainedComponentFactories = [
|
|
334
|
+
{
|
|
335
|
+
name: 'createAccordionTokens',
|
|
336
|
+
source: 'packages/tokens/src/factories/createAccordionTokens.ts',
|
|
337
|
+
semanticAdapter: 'createAccordionTokensFromSemantics',
|
|
338
|
+
stateKeys: ['default', 'expanded', 'hover', 'pressed', 'disabled'],
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
name: 'createButtonPalette',
|
|
342
|
+
source: 'packages/tokens/src/factories/createButtonPalette.ts',
|
|
343
|
+
semanticAdapter: null,
|
|
344
|
+
stateKeys: ['default', 'hover', 'pressed'],
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
name: 'createCheckboxPalette',
|
|
348
|
+
source: 'packages/tokens/src/factories/createCheckboxPalette.ts',
|
|
349
|
+
semanticAdapter: null,
|
|
350
|
+
stateKeys: ['default', 'hover', 'pressed'],
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
name: 'createContextMenuTokens',
|
|
354
|
+
source: 'packages/tokens/src/factories/createContextMenuTokens.ts',
|
|
355
|
+
semanticAdapter: 'createContextMenuTokensFromSemantics',
|
|
356
|
+
stateKeys: ['default', 'hover', 'active', 'pressed', 'focus', 'disabled'],
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
name: 'createDropdownPalette',
|
|
360
|
+
source: 'packages/tokens/src/factories/createDropdownPalette.ts',
|
|
361
|
+
semanticAdapter: null,
|
|
362
|
+
stateKeys: ['default', 'hover', 'focus', 'active', 'pressed'],
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
name: 'createFormFieldTokensFromTheme',
|
|
366
|
+
source: 'packages/tokens/src/factories/createFormFieldTokens.ts',
|
|
367
|
+
semanticAdapter: 'createFormFieldTokensFromTheme',
|
|
368
|
+
stateKeys: ['default', 'error', 'success', 'warning', 'info', 'disabled'],
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
name: 'createInputPalette',
|
|
372
|
+
source: 'packages/tokens/src/factories/createInputPalette.ts',
|
|
373
|
+
semanticAdapter: null,
|
|
374
|
+
stateKeys: ['default', 'hover', 'focus'],
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
name: 'createModalTokens',
|
|
378
|
+
source: 'packages/tokens/src/factories/createModalTokens.ts',
|
|
379
|
+
semanticAdapter: 'createModalTokensFromSemantics',
|
|
380
|
+
stateKeys: ['default', 'hover', 'pressed', 'focus', 'disabled'],
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
name: 'createPopoverTokens',
|
|
384
|
+
source: 'packages/tokens/src/factories/createPopoverTokens.ts',
|
|
385
|
+
semanticAdapter: 'createPopoverTokensFromTheme',
|
|
386
|
+
stateKeys: ['default'],
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
name: 'createRadioGroupTokens',
|
|
390
|
+
source: 'packages/tokens/src/factories/createRadioGroupTokens.ts',
|
|
391
|
+
semanticAdapter: 'createRadioGroupTokensFromSpacing',
|
|
392
|
+
stateKeys: ['default'],
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
name: 'createRadioPalette',
|
|
396
|
+
source: 'packages/tokens/src/factories/createRadioPalette.ts',
|
|
397
|
+
semanticAdapter: null,
|
|
398
|
+
stateKeys: ['default', 'hover', 'pressed'],
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
name: 'createSelectPalette',
|
|
402
|
+
source: 'packages/tokens/src/factories/createSelectPalette.ts',
|
|
403
|
+
semanticAdapter: null,
|
|
404
|
+
stateKeys: [
|
|
405
|
+
'default',
|
|
406
|
+
'hover',
|
|
407
|
+
'focus',
|
|
408
|
+
'active',
|
|
409
|
+
'pressed',
|
|
410
|
+
'selected',
|
|
411
|
+
'selectedHover',
|
|
412
|
+
'selectedActive',
|
|
413
|
+
'selectedPressed',
|
|
414
|
+
],
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
name: 'createSwitchTokens',
|
|
418
|
+
source: 'packages/tokens/src/factories/createSwitchTokens.ts',
|
|
419
|
+
semanticAdapter: 'createSwitchTokensFromSemantics',
|
|
420
|
+
stateKeys: ['default', 'hover', 'pressed', 'disabled'],
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
name: 'createTabsTokens',
|
|
424
|
+
source: 'packages/tokens/src/factories/createTabsTokens.ts',
|
|
425
|
+
semanticAdapter: null,
|
|
426
|
+
stateKeys: ['default', 'hover', 'active', 'disabled'],
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
name: 'createTooltipTokens',
|
|
430
|
+
source: 'packages/tokens/src/factories/createTooltipTokens.ts',
|
|
431
|
+
semanticAdapter: 'createTooltipTokensFromTheme',
|
|
432
|
+
stateKeys: ['default'],
|
|
433
|
+
},
|
|
434
|
+
];
|
|
435
|
+
export const tokenArchitectureAuditFindings = [
|
|
436
|
+
{
|
|
437
|
+
id: 'semantic-shape-parity',
|
|
438
|
+
classification: 'A',
|
|
439
|
+
summary: 'Light, dark, and high-contrast themes expose the same semantic token shape.',
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
id: 'component-shape-parity',
|
|
443
|
+
classification: 'A',
|
|
444
|
+
summary: 'Light, dark, and high-contrast themes expose the same component token shape.',
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
id: 'factory-layer',
|
|
448
|
+
classification: 'E',
|
|
449
|
+
summary: 'Component token factories are a first-class layer for stable component state contracts.',
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
id: 'website-text-tertiary',
|
|
453
|
+
classification: 'H',
|
|
454
|
+
summary: 'Website CSS references --text-tertiary, which is not a canonical semantic token. Adding or remapping it would visibly affect website text and should be handled by a focused visual issue.',
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
id: 'website-demo-raw-border',
|
|
458
|
+
classification: 'H',
|
|
459
|
+
summary: 'Some component catalog examples use raw demonstration border colors. Replacing them with tokens may alter examples and should be handled only with explicit visual approval.',
|
|
460
|
+
},
|
|
461
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vellira-ui/tokens",
|
|
3
|
-
"version": "2.98.
|
|
3
|
+
"version": "2.98.5",
|
|
4
4
|
"description": "Design tokens for Vellira Design System",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vellira",
|
|
@@ -52,10 +52,12 @@
|
|
|
52
52
|
"clean:build": "node --input-type=module -e \"import fs from 'node:fs'; if (fs.existsSync('dist')) for (const entry of fs.readdirSync('dist')) { if (entry !== 'css') fs.rmSync('dist/' + entry, { recursive: true, force: true }); }\"",
|
|
53
53
|
"generate:types": "tsx scripts/generate-token-types.ts",
|
|
54
54
|
"generate:types:check": "tsx scripts/generate-token-types.ts --check",
|
|
55
|
+
"preservation:baseline": "tsx scripts/token-preservation-cli.ts --write",
|
|
56
|
+
"preservation:check": "tsx scripts/token-preservation-cli.ts --check",
|
|
55
57
|
"build:tokens": "pnpm run generate:types && tsx scripts/generate-css.ts",
|
|
56
58
|
"build": "pnpm run clean:build && pnpm run build:tokens && tsc -p tsconfig.build.json",
|
|
57
|
-
"typecheck": "pnpm run generate:types:check && tsc -p tsconfig.json --noEmit && tsc -p tsconfig.scripts.json --noEmit",
|
|
58
|
-
"test": "pnpm run generate:types:check && vitest run"
|
|
59
|
+
"typecheck": "pnpm run generate:types:check && pnpm run preservation:check && tsc -p tsconfig.json --noEmit && tsc -p tsconfig.scripts.json --noEmit",
|
|
60
|
+
"test": "pnpm run generate:types:check && pnpm run preservation:check && vitest run"
|
|
59
61
|
},
|
|
60
62
|
"publishConfig": {
|
|
61
63
|
"access": "public"
|