@astryxdesign/cli 0.7.5-canary.fccd771 → 0.7.5-canary.fd0aba8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -3
- package/README.md +2 -2
- package/api/hook/detail/detail.test.mjs +11 -0
- package/api/integration/pack-check.lifecycle-output.test.mjs +24 -1
- package/api/integration/pack-check.mjs +10 -4
- package/api/integration/pack-check.test.mjs +5 -1
- package/api/swizzle/copy/copy.mjs +1 -1
- package/api/template/tokenizer-showcase.test.mjs +47 -0
- package/api/theme/build/build.adaptation-enrollment.test.mjs +4 -0
- package/api/theme/build/build.icon-entry-variants.test.mjs +134 -0
- package/api/theme/build/build.icon-function-entries.test.mjs +499 -0
- package/api/theme/build/build.icon-variants.test.mjs +105 -0
- package/api/theme/build/build.mjs +371 -113
- package/api/theme/build/build.project-core.test.mjs +63 -8
- package/api/theme/build/build.test.mjs +77 -0
- package/api/theme/build/icon-imports.d.mts +12 -2
- package/api/theme/build/icon-imports.mjs +36 -11
- package/api/upgrade/_adapter.d.mts +47 -2
- package/api/upgrade/_adapter.mjs +58 -2
- package/api/upgrade/run/failure-receipt.test.mjs +212 -0
- package/api/upgrade/run/outcomes.test.mjs +646 -0
- package/api/upgrade/run/run.d.mts +36 -0
- package/api/upgrade/run/run.mjs +670 -44
- package/api/upgrade/upgrade.doc.mjs +4 -4
- package/api/upgrade/upgrade.mjs +19 -4
- package/api/upgrade/upgrade.type.d.mts +36 -1
- package/api/upgrade/upgrade.type.mjs +29 -4
- package/assets/codemods/__tests__/runner.symlinks.test.mjs +205 -0
- package/assets/codemods/__tests__/runner.unparseable.test.mjs +457 -0
- package/assets/codemods/integration-runner.mjs +8 -2
- package/assets/codemods/integration-runner.protection.test.mjs +53 -0
- package/assets/codemods/outcome.mjs +79 -0
- package/assets/codemods/outcome.test.mjs +40 -0
- package/assets/codemods/parse.mjs +94 -0
- package/assets/codemods/run-codemod.mjs +109 -5
- package/assets/codemods/runner.mjs +119 -13
- package/assets/codemods/transform-prop.mjs +99 -49
- package/assets/codemods/transform-prop.test.mjs +36 -1
- package/assets/codemods/transforms/next/__tests__/migrate-codeblock-tokenizer-to-language.test.mjs +130 -0
- package/assets/codemods/transforms/next/index.mjs +11 -1
- package/assets/codemods/transforms/next/migrate-codeblock-tokenizer-to-language.mjs +315 -0
- package/assets/codemods/transforms/v0.1.2/rename-text-color-active-to-accent.mjs +1 -1
- package/assets/codemods/transforms/v0.1.3/__tests__/migrate-layout-components-to-experimental.test.mjs +216 -2
- package/assets/codemods/transforms/v0.1.3/migrate-layout-components-to-experimental.mjs +88 -6
- package/assets/codemods/transforms/v0.1.5/rename-switch-label-spacing-default-to-hug.mjs +1 -1
- package/assets/codemods/transforms/v0.1.7/migrate-table-tableprops-to-direct-props.mjs +1 -1
- package/assets/codemods/transforms/v0.1.8/rename-avatar-size-scale.mjs +1 -1
- package/assets/codemods/transforms/v0.2.0/remove-tablist-orientation.mjs +1 -1
- package/assets/codemods/transforms/v0.2.1/migrate-dialog-position-to-logical.mjs +1 -1
- package/assets/codemods/transforms/v0.6.0/migrate-astryx-theme-selectors-to-data-attrs.mjs +4 -3
- package/assets/codemods/transforms/v0.7.0/__tests__/migrate-deprecated-theme-surface.test.mjs +207 -6
- package/assets/codemods/transforms/v0.7.0/__tests__/validate-data-token-ownership.test.mjs +143 -70
- package/assets/codemods/transforms/v0.7.0/migrate-deprecated-theme-surface-v0.6-data.mjs +6 -1
- package/assets/codemods/transforms/v0.7.0/migrate-deprecated-theme-surface.mjs +244 -42
- package/assets/codemods/transforms/v0.7.0/validate-data-token-ownership.mjs +23 -78
- package/assets/docs/README.md +13 -13
- package/assets/docs/author-a-theme.doc.mjs +5 -1
- package/assets/docs/getting-started.doc.mjs +5 -5
- package/assets/docs/icons.doc.mjs +82 -1
- package/assets/docs/motion.doc.mjs +1 -1
- package/assets/docs/theme.doc.dense.mjs +8 -0
- package/assets/docs/theme.doc.mjs +16 -0
- package/assets/docs/theme.doc.zh.mjs +11 -0
- package/assets/docs/tree/i18n-library-integration.doc.mjs +1 -1
- package/assets/docs/tree/styling-advanced.doc.mjs +1 -1
- package/assets/docs/tree/template-styles.doc.mjs +1 -1
- package/assets/docs/tree/tokens-color.doc.mjs +145 -1
- package/assets/docs/tree/tokens-ease.doc.mjs +4 -0
- package/assets/docs/tree/tokens.doc.mjs +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherReviewFlow.doc.mjs +6 -4
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherReviewFlow.tsx +61 -55
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherShowcase.doc.mjs +6 -4
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherShowcase.tsx +68 -37
- package/assets/templates/blocks/components/CodeBlock/CodeBlockBashCommand.doc.mjs +1 -1
- package/assets/templates/blocks/components/CodeBlock/CodeBlockBashCommand.tsx +10 -2
- package/assets/templates/blocks/components/Thumbnail/ThumbnailDisabled.doc.mjs +1 -1
- package/assets/templates/blocks/components/Tokenizer/TokenizerShowcase.tsx +13 -6
- package/assets/templates/pages/dashboard-alert-rail/page.tsx +3 -3
- package/assets/templates/pages/library/page.tsx +1 -2
- package/assets/templates/pages/table-comparison/page.tsx +12 -3
- package/assets/templates/themes/butter/butterPaletteRefs.generated.ts +3 -2
- package/assets/templates/themes/butter/butterTheme.ts +47 -44
- package/assets/templates/themes/chocolate/chocolateTheme.ts +15 -2
- package/assets/templates/themes/gothic/gothicTheme.ts +21 -16
- package/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts +1 -1
- package/assets/templates/themes/matcha/matchaTheme.ts +15 -2
- package/assets/templates/themes/neutral/neutralPaletteRefs.generated.ts +4 -4
- package/assets/templates/themes/neutral/neutralTheme.ts +24 -119
- package/assets/templates/themes/stone/stoneTheme.ts +46 -21
- package/assets/templates/themes/y2k/y2kTheme.ts +20 -16
- package/assets/theme.template.ts +19 -6
- package/authoring/codemod/type.ts +10 -0
- package/authoring/config/config.doc.mjs +1 -1
- package/clients/cli/commands/build-theme.adaptations.test.mjs +110 -0
- package/clients/cli/commands/build-theme.outside-project.test.mjs +140 -0
- package/clients/cli/commands/swizzle.routing.test.mjs +1 -1
- package/clients/cli/commands/upgrade.doc.mjs +47 -2
- package/clients/cli/commands/upgrade.file-protection.test.mjs +175 -0
- package/clients/cli/commands/upgrade.flag-help.test.mjs +37 -0
- package/clients/cli/commands/upgrade.integration-policy.test.mjs +103 -0
- package/clients/cli/commands/upgrade.mjs +9 -2
- package/clients/cli/commands/upgrade.outcomes.test.mjs +350 -0
- package/foundation/agent-docs/agent-docs.mjs +1 -0
- package/foundation/agent-docs/agent-docs.test.mjs +5 -0
- package/foundation/config/project.d.mts +1 -1
- package/foundation/config/project.mjs +1 -1
- package/foundation/debug/redact.test.mjs +1 -1
- package/foundation/doc-compiler/doc-loads.test.mjs +2 -6
- package/foundation/response/base.d.ts +7 -0
- package/foundation/response/error-codes.doc.mjs +3 -2
- package/foundation/response/error-codes.mjs +1 -1
- package/foundation/response/json.d.mts +10 -3
- package/foundation/response/json.mjs +16 -4
- package/foundation/response/response-types.doc.mjs +1 -1
- package/package.json +13 -12
|
@@ -33,40 +33,12 @@ const neutralSyntax = defineSyntaxTheme({
|
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
const neutralLocalTokens: Record<string, TokenValue> = {
|
|
36
|
+
// Deprecated: kept with its released name, meaning, and value for Neutral
|
|
37
|
+
// extensions (theme:neutral DEC-1); Neutral itself paints status through the
|
|
38
|
+
// portable --color-* roles and no longer reads it.
|
|
36
39
|
'--astryx-theme-neutral-color-status-fill-accent': ['#0074e2', '#6d9cfe'],
|
|
37
|
-
'--astryx-theme-neutral-color-status-fill-success': ['#198100', '#64af4c'],
|
|
38
|
-
'--astryx-theme-neutral-color-status-fill-warning': '#ffce2f',
|
|
39
|
-
'--astryx-theme-neutral-color-status-fill-error': ['#c9303a', '#ff705d'],
|
|
40
|
-
'--astryx-theme-neutral-color-status-muted-accent': [
|
|
41
|
-
blue.light[85],
|
|
42
|
-
withAlpha(blue.dark[75], '3D'),
|
|
43
|
-
],
|
|
44
|
-
'--astryx-theme-neutral-color-on-tint-neutral': ['#fafafa4D', '#0a0a0a4D'],
|
|
45
|
-
'--astryx-theme-neutral-color-on-tint-overlay-hover': [
|
|
46
|
-
'#fafafa1A',
|
|
47
|
-
'#0a0a0a1A',
|
|
48
|
-
],
|
|
49
|
-
'--astryx-theme-neutral-color-on-tint-overlay-pressed': [
|
|
50
|
-
'#fafafa33',
|
|
51
|
-
'#0a0a0a33',
|
|
52
|
-
],
|
|
53
|
-
'--astryx-theme-neutral-color-destructive-overlay-hover': [
|
|
54
|
-
withAlpha(red.light[70], '0D'),
|
|
55
|
-
withAlpha(red.dark[65], '0D'),
|
|
56
|
-
],
|
|
57
|
-
'--astryx-theme-neutral-color-destructive-overlay-pressed': [
|
|
58
|
-
withAlpha(red.light[70], '1A'),
|
|
59
|
-
withAlpha(red.dark[65], '1A'),
|
|
60
|
-
],
|
|
61
40
|
};
|
|
62
41
|
|
|
63
|
-
const statusFill = {
|
|
64
|
-
accent: 'var(--astryx-theme-neutral-color-status-fill-accent)',
|
|
65
|
-
success: 'var(--astryx-theme-neutral-color-status-fill-success)',
|
|
66
|
-
warning: 'var(--astryx-theme-neutral-color-status-fill-warning)',
|
|
67
|
-
error: 'var(--astryx-theme-neutral-color-status-fill-error)',
|
|
68
|
-
} as const;
|
|
69
|
-
|
|
70
42
|
export const neutralTheme = defineTheme({
|
|
71
43
|
name: 'neutral',
|
|
72
44
|
localTokens: neutralLocalTokens,
|
|
@@ -154,15 +126,31 @@ export const neutralTheme = defineTheme({
|
|
|
154
126
|
'--color-on-error': [neutral.light[100], neutral.dark[5]],
|
|
155
127
|
'--color-on-warning': neutral.light[5],
|
|
156
128
|
|
|
129
|
+
'--color-info': ['#0074e2', '#6d9cfe'],
|
|
130
|
+
'--color-info-muted': [blue.light[85], withAlpha(blue.dark[75], '3D')],
|
|
131
|
+
'--color-on-info': [neutral.light[100], neutral.dark[5]],
|
|
132
|
+
|
|
133
|
+
'--color-text-info': [blue.light[45], blue.dark[80]],
|
|
134
|
+
'--color-text-success': [green.light[45], green.light[75]],
|
|
135
|
+
'--color-text-warning': [yellow.light[45], yellow.light[80]],
|
|
136
|
+
'--color-text-error': [red.light[45], red.dark[80]],
|
|
137
|
+
|
|
138
|
+
'--color-on-info-muted': [blue.light[25], blue.dark[80]],
|
|
139
|
+
'--color-on-success-muted': [green.light[25], green.light[75]],
|
|
140
|
+
'--color-on-warning-muted': [yellow.light[25], yellow.light[80]],
|
|
141
|
+
'--color-on-error-muted': [red.light[25], red.dark[80]],
|
|
142
|
+
|
|
157
143
|
// Icon
|
|
158
144
|
'--color-icon-accent': [neutral.light[10], neutral.dark[95]],
|
|
159
145
|
'--color-icon-primary': [neutral.light[0], neutral.dark[100]],
|
|
160
146
|
'--color-icon-secondary': [neutral.light[45], neutral.dark[65]],
|
|
161
147
|
'--color-icon-disabled': [neutral.light[60], neutral.dark[35]],
|
|
162
148
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
'--color-
|
|
149
|
+
// Strong status fills (architecture:theme-tokens INV11): Neutral's
|
|
150
|
+
// reviewed status-fill colours, with --color-on-<status> above.
|
|
151
|
+
'--color-success': ['#198100', '#64af4c'],
|
|
152
|
+
'--color-warning': '#ffce2f',
|
|
153
|
+
'--color-error': ['#c9303a', '#ff705d'],
|
|
166
154
|
'--color-success-muted': [green.dark[85], withAlpha(green.light[75], '3D')],
|
|
167
155
|
'--color-error-muted': [red.light[85], withAlpha(red.dark[75], '3D')],
|
|
168
156
|
'--color-warning-muted': [
|
|
@@ -182,7 +170,7 @@ export const neutralTheme = defineTheme({
|
|
|
182
170
|
withAlpha(neutral.light[0], '1A'),
|
|
183
171
|
withAlpha(neutral.dark[0], '4D'),
|
|
184
172
|
],
|
|
185
|
-
'--color-tint-hover': [
|
|
173
|
+
'--color-tint-hover': [neutral.light[0], neutral.dark[100]],
|
|
186
174
|
|
|
187
175
|
'--color-background-red': [red.light[85], red.dark[25]],
|
|
188
176
|
'--color-border-red': [red.light[80], red.light[65]],
|
|
@@ -288,35 +276,15 @@ export const neutralTheme = defineTheme({
|
|
|
288
276
|
button: {
|
|
289
277
|
'variant:destructive': {
|
|
290
278
|
backgroundColor: 'var(--color-error-muted)',
|
|
291
|
-
color: 'var(--color-error)',
|
|
292
|
-
'--color-overlay-hover':
|
|
293
|
-
'var(--astryx-theme-neutral-color-destructive-overlay-hover)',
|
|
294
|
-
'--color-overlay-pressed':
|
|
295
|
-
'var(--astryx-theme-neutral-color-destructive-overlay-pressed)',
|
|
279
|
+
color: 'var(--color-on-error-muted)',
|
|
296
280
|
},
|
|
297
281
|
},
|
|
298
282
|
|
|
299
283
|
badge: {
|
|
300
|
-
'variant:info': {
|
|
301
|
-
backgroundColor: statusFill.accent,
|
|
302
|
-
color: 'var(--color-on-accent)',
|
|
303
|
-
},
|
|
304
284
|
'variant:neutral': {
|
|
305
285
|
backgroundColor: 'var(--color-background-gray)',
|
|
306
286
|
color: 'var(--color-text-gray)',
|
|
307
287
|
},
|
|
308
|
-
'variant:success': {
|
|
309
|
-
backgroundColor: statusFill.success,
|
|
310
|
-
color: 'var(--color-on-success)',
|
|
311
|
-
},
|
|
312
|
-
'variant:warning': {
|
|
313
|
-
backgroundColor: statusFill.warning,
|
|
314
|
-
color: 'var(--color-on-warning)',
|
|
315
|
-
},
|
|
316
|
-
'variant:error': {
|
|
317
|
-
backgroundColor: statusFill.error,
|
|
318
|
-
color: 'var(--color-on-error)',
|
|
319
|
-
},
|
|
320
288
|
|
|
321
289
|
'variant:red': {
|
|
322
290
|
backgroundColor: 'var(--color-background-red)',
|
|
@@ -360,18 +328,6 @@ export const neutralTheme = defineTheme({
|
|
|
360
328
|
},
|
|
361
329
|
},
|
|
362
330
|
|
|
363
|
-
'status-dot': {
|
|
364
|
-
'variant:success': {backgroundColor: statusFill.success},
|
|
365
|
-
'variant:warning': {backgroundColor: statusFill.warning},
|
|
366
|
-
'variant:error': {backgroundColor: statusFill.error},
|
|
367
|
-
'variant:accent': {backgroundColor: statusFill.accent},
|
|
368
|
-
},
|
|
369
|
-
|
|
370
|
-
'avatar-status-dot': {
|
|
371
|
-
'variant:success': {backgroundColor: statusFill.success},
|
|
372
|
-
'variant:error': {backgroundColor: statusFill.error},
|
|
373
|
-
},
|
|
374
|
-
|
|
375
331
|
// Give the Neutral segmented control a roomier inset without changing its
|
|
376
332
|
// outside height. The selected item stays flat against the tinted track.
|
|
377
333
|
'segmented-control': {
|
|
@@ -394,45 +350,6 @@ export const neutralTheme = defineTheme({
|
|
|
394
350
|
},
|
|
395
351
|
},
|
|
396
352
|
|
|
397
|
-
banner: {
|
|
398
|
-
base: {
|
|
399
|
-
'--color-neutral': 'var(--astryx-theme-neutral-color-on-tint-neutral)',
|
|
400
|
-
'--color-overlay-hover':
|
|
401
|
-
'var(--astryx-theme-neutral-color-on-tint-overlay-hover)',
|
|
402
|
-
'--color-overlay-pressed':
|
|
403
|
-
'var(--astryx-theme-neutral-color-on-tint-overlay-pressed)',
|
|
404
|
-
},
|
|
405
|
-
'status:info': {
|
|
406
|
-
'--color-accent-muted':
|
|
407
|
-
'var(--astryx-theme-neutral-color-status-muted-accent)',
|
|
408
|
-
'--color-text-primary': 'var(--color-text-blue)',
|
|
409
|
-
'--color-text-secondary': 'var(--color-text-blue)',
|
|
410
|
-
'--color-accent': 'var(--color-text-blue)',
|
|
411
|
-
},
|
|
412
|
-
'status:success': {
|
|
413
|
-
'--color-text-primary': 'var(--color-text-green)',
|
|
414
|
-
'--color-text-secondary': 'var(--color-text-green)',
|
|
415
|
-
'--color-success': 'var(--color-text-green)',
|
|
416
|
-
},
|
|
417
|
-
'status:warning': {
|
|
418
|
-
'--color-text-primary': 'var(--color-text-yellow)',
|
|
419
|
-
'--color-text-secondary': 'var(--color-text-yellow)',
|
|
420
|
-
'--color-warning': 'var(--color-text-yellow)',
|
|
421
|
-
},
|
|
422
|
-
'status:error': {
|
|
423
|
-
'--color-text-primary': 'var(--color-text-red)',
|
|
424
|
-
'--color-text-secondary': 'var(--color-text-red)',
|
|
425
|
-
'--color-error': 'var(--color-text-red)',
|
|
426
|
-
},
|
|
427
|
-
},
|
|
428
|
-
|
|
429
|
-
'step-indicator': {
|
|
430
|
-
'status:accent': {'--color-accent': statusFill.accent},
|
|
431
|
-
'status:success': {'--color-success': statusFill.success},
|
|
432
|
-
'status:warning': {'--color-warning': statusFill.warning},
|
|
433
|
-
'status:error': {'--color-error': statusFill.error},
|
|
434
|
-
},
|
|
435
|
-
|
|
436
353
|
switch: {
|
|
437
354
|
base: {
|
|
438
355
|
'--color-background-gray': 'var(--color-border-emphasized)',
|
|
@@ -443,18 +360,6 @@ export const neutralTheme = defineTheme({
|
|
|
443
360
|
base: {
|
|
444
361
|
'--color-background-muted': 'var(--color-border-emphasized)',
|
|
445
362
|
},
|
|
446
|
-
'variant:accent': {
|
|
447
|
-
'--color-accent': statusFill.accent,
|
|
448
|
-
},
|
|
449
|
-
'variant:success': {
|
|
450
|
-
'--color-success': statusFill.success,
|
|
451
|
-
},
|
|
452
|
-
'variant:warning': {
|
|
453
|
-
'--color-warning': statusFill.warning,
|
|
454
|
-
},
|
|
455
|
-
'variant:error': {
|
|
456
|
-
'--color-error': statusFill.error,
|
|
457
|
-
},
|
|
458
363
|
},
|
|
459
364
|
|
|
460
365
|
card: {
|
|
@@ -26,13 +26,16 @@ const withAlpha = (color: string, alpha: string): string => `${color}${alpha}`;
|
|
|
26
26
|
*/
|
|
27
27
|
const INPUT_STATUS_VARS = {
|
|
28
28
|
'status:success': {
|
|
29
|
-
'--color-success': lightDark(green.light[55], green.dark[70]),
|
|
29
|
+
'--color-border-success': lightDark(green.light[55], green.dark[70]),
|
|
30
|
+
'--color-icon-success': lightDark(green.light[55], green.dark[70]),
|
|
30
31
|
},
|
|
31
32
|
'status:warning': {
|
|
32
|
-
'--color-warning': lightDark(yellow.light[55], yellow.dark[70]),
|
|
33
|
+
'--color-border-warning': lightDark(yellow.light[55], yellow.dark[70]),
|
|
34
|
+
'--color-icon-warning': lightDark(yellow.light[55], yellow.dark[70]),
|
|
33
35
|
},
|
|
34
36
|
'status:error': {
|
|
35
|
-
'--color-error': lightDark(red.light[60], red.dark[70]),
|
|
37
|
+
'--color-border-error': lightDark(red.light[60], red.dark[70]),
|
|
38
|
+
'--color-icon-error': lightDark(red.light[60], red.dark[70]),
|
|
36
39
|
},
|
|
37
40
|
} as const;
|
|
38
41
|
|
|
@@ -188,9 +191,22 @@ export const stoneTheme = defineTheme({
|
|
|
188
191
|
'--color-on-dark': neutral.light[100],
|
|
189
192
|
'--color-on-light': [neutral.light[15], neutral.dark[15]],
|
|
190
193
|
'--color-on-accent': [neutral.light[100], neutral.dark[15]],
|
|
191
|
-
'--color-on-success': [
|
|
192
|
-
'--color-on-error': [
|
|
193
|
-
'--color-on-warning': [
|
|
194
|
+
'--color-on-success': [neutral.light[100], neutral.dark[10]],
|
|
195
|
+
'--color-on-error': [neutral.light[100], neutral.dark[10]],
|
|
196
|
+
'--color-on-warning': [neutral.light[100], neutral.dark[10]],
|
|
197
|
+
|
|
198
|
+
'--color-info': [blue.light[40], blue.dark[70]],
|
|
199
|
+
'--color-info-muted': [blue.light[90], blue.dark[25]],
|
|
200
|
+
'--color-on-info': [neutral.light[100], neutral.dark[15]],
|
|
201
|
+
|
|
202
|
+
'--color-text-info': [blue.light[30], blue.dark[90]],
|
|
203
|
+
'--color-text-success': [green.light[30], green.dark[90]],
|
|
204
|
+
'--color-text-warning': [yellow.light[30], yellow.dark[90]],
|
|
205
|
+
'--color-text-error': [red.light[30], red.dark[90]],
|
|
206
|
+
'--color-on-info-muted': [blue.light[30], blue.dark[90]],
|
|
207
|
+
'--color-on-success-muted': [green.light[30], green.dark[25]],
|
|
208
|
+
'--color-on-warning-muted': [yellow.light[30], yellow.dark[25]],
|
|
209
|
+
'--color-on-error-muted': [red.light[30], red.dark[25]],
|
|
194
210
|
|
|
195
211
|
// Icon
|
|
196
212
|
'--color-icon-accent': [neutral.light[15], neutral.dark[95]],
|
|
@@ -336,32 +352,23 @@ export const stoneTheme = defineTheme({
|
|
|
336
352
|
},
|
|
337
353
|
},
|
|
338
354
|
|
|
339
|
-
// Banner
|
|
340
|
-
// semantic variables here instead of attempting a losing direct fill.
|
|
355
|
+
// Banner status surfaces and content use the matching categorical pair.
|
|
341
356
|
banner: {
|
|
342
357
|
'status:info': {
|
|
343
|
-
'--color-
|
|
344
|
-
'--color-
|
|
345
|
-
'--color-text-secondary': 'var(--color-text-blue)',
|
|
346
|
-
'--color-accent': 'var(--color-text-blue)',
|
|
358
|
+
'--color-info-muted': 'var(--color-background-blue)',
|
|
359
|
+
'--color-on-info-muted': 'var(--color-text-blue)',
|
|
347
360
|
},
|
|
348
361
|
'status:success': {
|
|
349
362
|
'--color-success-muted': 'var(--color-background-green)',
|
|
350
|
-
'--color-
|
|
351
|
-
'--color-text-secondary': 'var(--color-text-green)',
|
|
352
|
-
'--color-success': 'var(--color-text-green)',
|
|
363
|
+
'--color-on-success-muted': 'var(--color-text-green)',
|
|
353
364
|
},
|
|
354
365
|
'status:warning': {
|
|
355
366
|
'--color-warning-muted': 'var(--color-background-yellow)',
|
|
356
|
-
'--color-
|
|
357
|
-
'--color-text-secondary': 'var(--color-text-yellow)',
|
|
358
|
-
'--color-warning': 'var(--color-text-yellow)',
|
|
367
|
+
'--color-on-warning-muted': 'var(--color-text-yellow)',
|
|
359
368
|
},
|
|
360
369
|
'status:error': {
|
|
361
370
|
'--color-error-muted': 'var(--color-background-red)',
|
|
362
|
-
'--color-
|
|
363
|
-
'--color-text-secondary': 'var(--color-text-red)',
|
|
364
|
-
'--color-error': 'var(--color-text-red)',
|
|
371
|
+
'--color-on-error-muted': 'var(--color-text-red)',
|
|
365
372
|
},
|
|
366
373
|
},
|
|
367
374
|
|
|
@@ -382,6 +389,21 @@ export const stoneTheme = defineTheme({
|
|
|
382
389
|
},
|
|
383
390
|
},
|
|
384
391
|
|
|
392
|
+
'progress-bar-mark': {
|
|
393
|
+
'placement:fill+variant:accent': {
|
|
394
|
+
backgroundColor: 'var(--color-on-light)',
|
|
395
|
+
},
|
|
396
|
+
'placement:fill+variant:success': {
|
|
397
|
+
backgroundColor: 'var(--color-on-light)',
|
|
398
|
+
},
|
|
399
|
+
'placement:fill+variant:warning': {
|
|
400
|
+
backgroundColor: 'var(--color-on-light)',
|
|
401
|
+
},
|
|
402
|
+
'placement:fill+variant:error': {
|
|
403
|
+
backgroundColor: 'var(--color-on-light)',
|
|
404
|
+
},
|
|
405
|
+
},
|
|
406
|
+
|
|
385
407
|
// The default muted track is too close to Stone's body surface.
|
|
386
408
|
'progress-bar-track': {
|
|
387
409
|
base: {
|
|
@@ -400,12 +422,15 @@ export const stoneTheme = defineTheme({
|
|
|
400
422
|
'field-status': {
|
|
401
423
|
'type:success': {
|
|
402
424
|
backgroundColor: 'var(--color-background-green)',
|
|
425
|
+
color: 'var(--color-text-green)',
|
|
403
426
|
},
|
|
404
427
|
'type:warning': {
|
|
405
428
|
backgroundColor: 'var(--color-background-yellow)',
|
|
429
|
+
color: 'var(--color-text-yellow)',
|
|
406
430
|
},
|
|
407
431
|
'type:error': {
|
|
408
432
|
backgroundColor: 'var(--color-background-red)',
|
|
433
|
+
color: 'var(--color-text-red)',
|
|
409
434
|
},
|
|
410
435
|
},
|
|
411
436
|
|
|
@@ -192,6 +192,18 @@ export const y2kTheme = defineTheme({
|
|
|
192
192
|
'--color-on-error': [red.light[30], red.dark[20]],
|
|
193
193
|
'--color-on-warning': [yellow.light[30], yellow.dark[20]],
|
|
194
194
|
|
|
195
|
+
'--color-info': [blue.light[40], blue.dark[75]],
|
|
196
|
+
'--color-info-muted': 'var(--color-background-blue)',
|
|
197
|
+
|
|
198
|
+
'--color-text-info': [blue.light[20], blue.dark[75]],
|
|
199
|
+
'--color-text-success': [green.light[30], green.dark[75]],
|
|
200
|
+
'--color-text-warning': [yellow.light[30], yellow.dark[85]],
|
|
201
|
+
'--color-text-error': [red.light[30], red.dark[75]],
|
|
202
|
+
'--color-on-info-muted': 'var(--color-text-blue)',
|
|
203
|
+
'--color-on-success-muted': 'var(--color-text-green)',
|
|
204
|
+
'--color-on-warning-muted': 'var(--color-text-yellow)',
|
|
205
|
+
'--color-on-error-muted': 'var(--color-text-red)',
|
|
206
|
+
|
|
195
207
|
// Icon
|
|
196
208
|
'--color-icon-accent': [neutral.light[15], neutral.dark[95]],
|
|
197
209
|
'--color-icon-primary': [neutral.light[15], neutral.dark[95]],
|
|
@@ -393,28 +405,20 @@ export const y2kTheme = defineTheme({
|
|
|
393
405
|
borderRadius: '0px',
|
|
394
406
|
},
|
|
395
407
|
'status:info': {
|
|
396
|
-
|
|
397
|
-
'--color-
|
|
398
|
-
'--color-text-secondary': 'var(--color-text-blue)',
|
|
399
|
-
'--color-accent': 'var(--color-text-blue)',
|
|
408
|
+
'--color-info-muted': 'var(--color-background-blue)',
|
|
409
|
+
'--color-on-info-muted': 'var(--color-text-blue)',
|
|
400
410
|
},
|
|
401
411
|
'status:success': {
|
|
402
|
-
|
|
403
|
-
'--color-
|
|
404
|
-
'--color-text-secondary': 'var(--color-text-green)',
|
|
405
|
-
'--color-success': 'var(--color-text-green)',
|
|
412
|
+
'--color-success-muted': 'var(--color-background-green)',
|
|
413
|
+
'--color-on-success-muted': 'var(--color-text-green)',
|
|
406
414
|
},
|
|
407
415
|
'status:warning': {
|
|
408
|
-
|
|
409
|
-
'--color-
|
|
410
|
-
'--color-text-secondary': 'var(--color-text-yellow)',
|
|
411
|
-
'--color-warning': 'var(--color-text-yellow)',
|
|
416
|
+
'--color-warning-muted': 'var(--color-background-yellow)',
|
|
417
|
+
'--color-on-warning-muted': 'var(--color-text-yellow)',
|
|
412
418
|
},
|
|
413
419
|
'status:error': {
|
|
414
|
-
|
|
415
|
-
'--color-
|
|
416
|
-
'--color-text-secondary': 'var(--color-text-red)',
|
|
417
|
-
'--color-error': 'var(--color-text-red)',
|
|
420
|
+
'--color-error-muted': 'var(--color-background-red)',
|
|
421
|
+
'--color-on-error-muted': 'var(--color-text-red)',
|
|
418
422
|
},
|
|
419
423
|
},
|
|
420
424
|
|
package/assets/theme.template.ts
CHANGED
|
@@ -91,9 +91,11 @@ export const myTheme = defineTheme({
|
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
93
|
* Start from another theme instead of the defaults. Tokens are copied then
|
|
94
|
-
* overridden, `components` deep-merge, `icons` shallow-merge — but the
|
|
95
|
-
* configs below REPLACE the base's rather
|
|
96
|
-
* inputs to a generator, not values.
|
|
94
|
+
* overridden, `components` deep-merge, `icons` shallow-merge — but the
|
|
95
|
+
* typography, radius and color scale configs below REPLACE the base's rather
|
|
96
|
+
* than merging, because they are inputs to a generator, not values. `motion`
|
|
97
|
+
* inherits field by field: `fast`, `medium` and `ratio` regenerate the fast
|
|
98
|
+
* and medium durations, and a `slow` or `easing` left unset keeps the base's.
|
|
97
99
|
*
|
|
98
100
|
* Reference: `astryx theme list` (themes you can install and extend).
|
|
99
101
|
*/
|
|
@@ -215,7 +217,7 @@ export const myTheme = defineTheme({
|
|
|
215
217
|
// --radius-* none · inner · element · container · page · chat · full
|
|
216
218
|
// --shadow-* low/med/high + inset-{hover,selected,success,warning,error}
|
|
217
219
|
// --duration-* {fast,medium,slow} × {-min, base, -max}
|
|
218
|
-
// --ease
|
|
220
|
+
// --ease-* standard (arriving, state) · exit (leaving)
|
|
219
221
|
// --font-family-* body · heading · code
|
|
220
222
|
// --font-size-* 4xs … 5xl
|
|
221
223
|
// --font-weight-* normal · medium · semibold · bold
|
|
@@ -312,10 +314,21 @@ export const myTheme = defineTheme({
|
|
|
312
314
|
|
|
313
315
|
/**
|
|
314
316
|
* Swap the artwork behind semantic icon names — every component that asks
|
|
315
|
-
* for `check`, `close`, `chevron-down` gets yours.
|
|
317
|
+
* for `check`, `close`, `chevron-down` gets yours. An entry may also be a
|
|
318
|
+
* pure function of `{size, variant}` that picks artwork for the size Icon
|
|
319
|
+
* renders at.
|
|
316
320
|
* Reference: `astryx docs icons` lists the names.
|
|
317
321
|
*/
|
|
318
|
-
// icons: {check: <MyCheck />,
|
|
322
|
+
// icons: {check: <MyCheck />, info: ({size}) => <MyInfo bold={size === 'sm'} />},
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* The icon variant names this theme supports, listed once for the whole
|
|
326
|
+
* theme. An icon entry function receives `variant` typed as these names.
|
|
327
|
+
* A theme that sets the list replaces the one it would inherit; omit it to
|
|
328
|
+
* inherit the base's list.
|
|
329
|
+
* Reference: `astryx docs icons`.
|
|
330
|
+
*/
|
|
331
|
+
// iconVariants: ['outline', 'filled'],
|
|
319
332
|
|
|
320
333
|
/**
|
|
321
334
|
* Replace the small components that DRAW control state — the checkbox box,
|
|
@@ -141,6 +141,16 @@ export interface CodemodRunResult {
|
|
|
141
141
|
generated: boolean;
|
|
142
142
|
command?: string;
|
|
143
143
|
}>;
|
|
144
|
+
/**
|
|
145
|
+
* Protected files left for manual review because their own source does not
|
|
146
|
+
* parse, so no change can be proven in them. They do not fail the run.
|
|
147
|
+
*/
|
|
148
|
+
declinedCandidates?: Array<{
|
|
149
|
+
file: string;
|
|
150
|
+
codemod: string;
|
|
151
|
+
location?: string;
|
|
152
|
+
reason: string;
|
|
153
|
+
}>;
|
|
144
154
|
errors: Array<{file: string; codemod: string; error: string}>;
|
|
145
155
|
}
|
|
146
156
|
|
|
@@ -31,7 +31,7 @@ export const doc = {
|
|
|
31
31
|
type: 'string',
|
|
32
32
|
description:
|
|
33
33
|
"Where reports about Core go: `{@command gap-report}` routes a Core report here when no handler is loaded, gapReport handlers receive it as `report.target.issuesUrl`, and `{@command swizzle}` prints it as the feedback link for a Core component. A report or swizzle for an integration's component uses that integration's own issuesUrl, never this one. An absolute URL; a value that is not a URL makes the config invalid.",
|
|
34
|
-
default: "'https://github.com/
|
|
34
|
+
default: "'https://github.com/meta/astryx/issues/new'",
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
name: 'hooks',
|
|
@@ -95,6 +95,116 @@ describe('theme build adaptations', () => {
|
|
|
95
95
|
);
|
|
96
96
|
});
|
|
97
97
|
|
|
98
|
+
it('emits scoped status aliases in built CSS and preserves child extension parity', async () => {
|
|
99
|
+
const {defineTheme, generateThemeCSS} =
|
|
100
|
+
await import('@astryxdesign/core/theme');
|
|
101
|
+
const project = path.join(tmpDir, 'project');
|
|
102
|
+
const themesDir = path.join(project, 'themes');
|
|
103
|
+
const input = {
|
|
104
|
+
name: 'status-aliases',
|
|
105
|
+
tokens: {
|
|
106
|
+
'--color-info': '#225bff',
|
|
107
|
+
'--color-text-blue': '#203a6c',
|
|
108
|
+
},
|
|
109
|
+
adaptations: {
|
|
110
|
+
rules: [
|
|
111
|
+
{
|
|
112
|
+
when: {contrast: 'more'},
|
|
113
|
+
value: {
|
|
114
|
+
tokens: {'--color-text-success': '#123456'},
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
when: {pointer: 'coarse'},
|
|
119
|
+
value: {tokens: {'--color-text-green': '#abcdef'}},
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
onDark: {
|
|
124
|
+
tokens: {'--color-text-blue': '#fefefe'},
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
const themeFile = writeTheme(themesDir, input.name, JSON.stringify(input));
|
|
128
|
+
|
|
129
|
+
const result = await build(project, themeFile);
|
|
130
|
+
expect(result.code, result.stderr).toBe(0);
|
|
131
|
+
|
|
132
|
+
const css = fs.readFileSync(
|
|
133
|
+
path.join(themesDir, 'status-aliases.css'),
|
|
134
|
+
'utf8',
|
|
135
|
+
);
|
|
136
|
+
const mediaAlias = '--color-text-info: var(--color-text-blue);';
|
|
137
|
+
const adaptationAlias = '--color-text-success: var(--color-text-green);';
|
|
138
|
+
const authoredRole = '--color-text-success: #123456;';
|
|
139
|
+
// The authored Info fill is a concrete hue, so theme generation derives
|
|
140
|
+
// its content, text, and pale-fill content (theme-compilation INV17).
|
|
141
|
+
for (const role of ['on-info', 'text-info', 'on-info-muted']) {
|
|
142
|
+
expect(css).toMatch(
|
|
143
|
+
new RegExp(
|
|
144
|
+
`--color-${role}: light-dark\\(#[0-9A-F]{6}, #[0-9A-F]{6}\\);`,
|
|
145
|
+
),
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
// The dark media surface that sets the hue rebinds the text alias.
|
|
149
|
+
expect(css).toContain(mediaAlias);
|
|
150
|
+
expect(css).toContain(adaptationAlias);
|
|
151
|
+
expect(css.split(authoredRole).length - 1).toBeGreaterThanOrEqual(2);
|
|
152
|
+
expect(css.lastIndexOf(authoredRole)).toBeGreaterThan(
|
|
153
|
+
css.lastIndexOf(adaptationAlias),
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
const {statusAliasesTheme: builtTheme} = await import(
|
|
157
|
+
pathToFileURL(path.join(themesDir, 'status-aliases.js')).href
|
|
158
|
+
);
|
|
159
|
+
const source = defineTheme(input);
|
|
160
|
+
const childInput = {
|
|
161
|
+
name: 'status-alias-child',
|
|
162
|
+
tokens: {'--color-text-blue': '#345678'},
|
|
163
|
+
};
|
|
164
|
+
const fromSource = defineTheme({...childInput, extends: source});
|
|
165
|
+
const fromBuilt = defineTheme({...childInput, extends: builtTheme});
|
|
166
|
+
expect(generateThemeCSS(fromBuilt)).toEqual(generateThemeCSS(fromSource));
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
it('derives a complete status set for a minimal theme in built CSS (INV17)', async () => {
|
|
170
|
+
const {defineTheme, generateThemeCSS} =
|
|
171
|
+
await import('@astryxdesign/core/theme');
|
|
172
|
+
const project = path.join(tmpDir, 'project');
|
|
173
|
+
const themesDir = path.join(project, 'themes');
|
|
174
|
+
const input = {
|
|
175
|
+
name: 'status-minimal',
|
|
176
|
+
tokens: {
|
|
177
|
+
'--color-success': '#3FB950',
|
|
178
|
+
'--color-warning': '#D29922',
|
|
179
|
+
'--color-error': '#F85149',
|
|
180
|
+
'--color-info': '#6E40C9',
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
const themeFile = writeTheme(themesDir, input.name, JSON.stringify(input));
|
|
184
|
+
const result = await build(project, themeFile);
|
|
185
|
+
expect(result.code, result.stderr).toBe(0);
|
|
186
|
+
|
|
187
|
+
const css = fs.readFileSync(
|
|
188
|
+
path.join(themesDir, 'status-minimal.css'),
|
|
189
|
+
'utf8',
|
|
190
|
+
);
|
|
191
|
+
for (const status of ['success', 'warning', 'error', 'info']) {
|
|
192
|
+
expect(css).toMatch(
|
|
193
|
+
new RegExp(
|
|
194
|
+
`--color-text-${status}: light-dark\\(#[0-9A-F]{6}, #[0-9A-F]{6}\\);`,
|
|
195
|
+
),
|
|
196
|
+
);
|
|
197
|
+
expect(css).toContain(
|
|
198
|
+
`--color-icon-${status}: var(--color-text-${status});`,
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
// Built and runtime output derive the same values.
|
|
202
|
+
const runtime = generateThemeCSS(defineTheme(input));
|
|
203
|
+
const derived = css.match(/--color-text-warning: [^;]+;/)?.[0];
|
|
204
|
+
expect(derived).toBeDefined();
|
|
205
|
+
expect(JSON.stringify(runtime)).toContain(derived);
|
|
206
|
+
});
|
|
207
|
+
|
|
98
208
|
it.each([
|
|
99
209
|
['defined', writeTheme],
|
|
100
210
|
['plain', writePlainTheme],
|