@zhin.js/console-ui 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +118 -11
  3. package/audit/index.mjs +21 -0
  4. package/audit/layout-audit.mjs +492 -0
  5. package/audit/mount-page.jsx +90 -0
  6. package/audit/plugin-pages.mjs +186 -0
  7. package/dist/components/BrandMark.d.ts +16 -0
  8. package/dist/components/BrandMark.js +21 -0
  9. package/dist/components/InfoHint.js +2 -1
  10. package/dist/components/PageHeader.d.ts +9 -2
  11. package/dist/components/PageHeader.js +6 -3
  12. package/dist/components/PageShell.d.ts +18 -3
  13. package/dist/components/PageShell.js +5 -3
  14. package/dist/components/RefreshControl.d.ts +6 -1
  15. package/dist/components/RefreshControl.js +9 -6
  16. package/dist/components/StatCard.d.ts +19 -5
  17. package/dist/components/StatCard.js +36 -10
  18. package/dist/components/StatusBadge.d.ts +14 -0
  19. package/dist/components/StatusBadge.js +19 -0
  20. package/dist/components/actions.d.ts +53 -0
  21. package/dist/components/actions.js +50 -0
  22. package/dist/components/code.d.ts +11 -0
  23. package/dist/components/code.js +10 -0
  24. package/dist/components/confirm-dialog.js +3 -2
  25. package/dist/components/content-blocks.d.ts +141 -0
  26. package/dist/components/content-blocks.js +77 -0
  27. package/dist/components/empty-illustrations.d.ts +15 -0
  28. package/dist/components/empty-illustrations.js +36 -0
  29. package/dist/components/empty-state.d.ts +23 -3
  30. package/dist/components/empty-state.js +36 -8
  31. package/dist/components/error-alert.js +2 -1
  32. package/dist/components/icon.d.ts +11 -0
  33. package/dist/components/icon.js +8 -0
  34. package/dist/components/layout.d.ts +38 -0
  35. package/dist/components/layout.js +28 -0
  36. package/dist/components/page-chrome.d.ts +12 -0
  37. package/dist/components/page-chrome.js +6 -5
  38. package/dist/components/ui/accordion.js +3 -2
  39. package/dist/components/ui/alert.js +5 -5
  40. package/dist/components/ui/badge.js +10 -9
  41. package/dist/components/ui/button.d.ts +10 -1
  42. package/dist/components/ui/button.js +26 -11
  43. package/dist/components/ui/card.d.ts +6 -0
  44. package/dist/components/ui/card.js +5 -4
  45. package/dist/components/ui/checkbox.js +2 -1
  46. package/dist/components/ui/control-variant.d.ts +10 -0
  47. package/dist/components/ui/control-variant.js +6 -0
  48. package/dist/components/ui/date-field-model.d.ts +39 -0
  49. package/dist/components/ui/date-field-model.js +105 -0
  50. package/dist/components/ui/date-field.d.ts +33 -0
  51. package/dist/components/ui/date-field.js +161 -0
  52. package/dist/components/ui/dialog.js +7 -6
  53. package/dist/components/ui/dropdown-menu.js +6 -5
  54. package/dist/components/ui/input.d.ts +6 -1
  55. package/dist/components/ui/input.js +3 -2
  56. package/dist/components/ui/list-item-button.js +1 -1
  57. package/dist/components/ui/popover.js +1 -1
  58. package/dist/components/ui/radio-group.js +1 -1
  59. package/dist/components/ui/scroll-area.js +1 -1
  60. package/dist/components/ui/searchable-select.d.ts +3 -0
  61. package/dist/components/ui/searchable-select.js +4 -3
  62. package/dist/components/ui/select.d.ts +7 -1
  63. package/dist/components/ui/select.js +7 -5
  64. package/dist/components/ui/sheet.js +4 -3
  65. package/dist/components/ui/skeleton.js +1 -1
  66. package/dist/components/ui/switch.js +1 -1
  67. package/dist/components/ui/table.d.ts +11 -0
  68. package/dist/components/ui/table.js +37 -6
  69. package/dist/components/ui/tabs.js +3 -3
  70. package/dist/components/ui/textarea.d.ts +6 -1
  71. package/dist/components/ui/textarea.js +3 -2
  72. package/dist/components/ui/tooltip.js +1 -1
  73. package/dist/components/use-container-width.d.ts +13 -0
  74. package/dist/components/use-container-width.js +30 -0
  75. package/dist/custom-media.css +13 -0
  76. package/dist/exports.json +41 -1
  77. package/dist/i18n/messages.d.ts +20 -1
  78. package/dist/i18n/messages.js +40 -2
  79. package/dist/index.d.ts +12 -0
  80. package/dist/index.js +11 -0
  81. package/dist/scale.json +643 -0
  82. package/dist/styles.css +1919 -836
  83. package/dist/theme.css +469 -0
  84. package/dist/tokens.css +434 -123
  85. package/dist/version.js +1 -1
  86. package/lint/eslint-plugin.mjs +128 -0
  87. package/lint/stylelint-config.mjs +43 -0
  88. package/lint/stylelint-plugin.mjs +195 -0
  89. package/lint/tailwind-classes.mjs +121 -0
  90. package/package.json +33 -3
  91. package/tokens/color.mjs +104 -0
  92. package/tokens/colors.css +220 -0
  93. package/tokens/generate.mjs +288 -0
  94. package/tokens/scale.mjs +137 -0
  95. package/tokens/tokens.mjs +362 -0
@@ -0,0 +1,362 @@
1
+ /**
2
+ * @zhin.js/console-ui design tokens — the single source of truth (ADR 0063 D16, D17).
3
+ *
4
+ * Everything that sizes the Console is defined here once and only here. `tokens/generate.mjs`
5
+ * turns it into the files that consumers read; none of them may be edited by hand:
6
+ * - client/styles/generated/tokens.css three tiers of CSS variables + the by-size rules
7
+ * - client/styles/generated/theme.css Tailwind 4 `@theme` (only the on-scale keys)
8
+ * - client/styles/generated/custom-media.css `@custom-media --console-<bp>` for the shell
9
+ * - client/styles/generated/scale.json allowed values for stylelint, ESLint,
10
+ * `zhin plugin check` and the Playwright audit
11
+ *
12
+ * Tiers:
13
+ * 1. base scale — the only values the Console uses (type, weight, space-1…8, r-0…4/full,
14
+ * hairline/focus, e-0…3, breakpoints, content widths)
15
+ * 2. semantic — what components read (`--console-card-padding`, …); components and Console
16
+ * pages never read tier 1 directly, let alone write numbers
17
+ * 3. by size — the value of each semantic token per width (D16 「按尺寸取值」 table):
18
+ * page-level tokens follow the viewport, every other token follows the width of
19
+ * the container the component sits in (D18)
20
+ *
21
+ * Colors stay in tokens/colors.css (hand-written, also defined only once) and are copied into
22
+ * tokens.css by the generator.
23
+ */
24
+
25
+ /** Breakpoints (D16). Media queries are for the global shell only; components use containers. */
26
+ export const breakpoints = {
27
+ sm: '40rem',
28
+ md: '48rem',
29
+ lg: '64rem',
30
+ xl: '90rem',
31
+ };
32
+
33
+ /** Type scale: at most 5 sizes (D16). `display` is only for stat values and page titles. */
34
+ export const text = {
35
+ label: { size: '0.8125rem', leading: '1.45' },
36
+ body: { size: '0.875rem', leading: '1.6' },
37
+ section: { size: '1rem', leading: '1.4' },
38
+ title: { size: '1.375rem', leading: '1.25' },
39
+ display: { size: '1.75rem', leading: '1.15' },
40
+ };
41
+
42
+ /** Font weights: at most 3 (D16). */
43
+ export const weight = {
44
+ regular: '400',
45
+ medium: '500',
46
+ strong: '600',
47
+ };
48
+
49
+ /**
50
+ * Spacing: space-1 … space-8 on a 4px grid (D16). `tailwind` is the Tailwind key with the same
51
+ * value (D17): the names diverge from space-5 on (space-5 is `p-6`).
52
+ */
53
+ export const space = {
54
+ 'space-1': { value: '0.25rem', tailwind: '1' },
55
+ 'space-2': { value: '0.5rem', tailwind: '2' },
56
+ 'space-3': { value: '0.75rem', tailwind: '3' },
57
+ 'space-4': { value: '1rem', tailwind: '4' },
58
+ 'space-5': { value: '1.5rem', tailwind: '6' },
59
+ 'space-6': { value: '2rem', tailwind: '8' },
60
+ 'space-7': { value: '3rem', tailwind: '12' },
61
+ 'space-8': { value: '4rem', tailwind: '16' },
62
+ };
63
+
64
+ /** Radii (D16). No `calc(… - Npx)` radii any more. */
65
+ export const radius = {
66
+ 'r-0': '0rem',
67
+ 'r-1': '0.375rem',
68
+ 'r-2': '0.625rem',
69
+ 'r-3': '0.875rem',
70
+ 'r-4': '1.125rem',
71
+ 'r-full': '9999px',
72
+ };
73
+
74
+ /** Borders (D16): hairline for every divider and outline, focus only for focus rings. */
75
+ export const border = {
76
+ hairline: '1px',
77
+ focus: '2px',
78
+ };
79
+
80
+ /**
81
+ * Elevation (D16): e-0 none, e-1 hover, e-2 dropdown / popover, e-3 dialog / drawer.
82
+ * Light theme: soft drops (shadows are for overlays; static content uses hairlines). Dark theme:
83
+ * edges and surface lightness only (a hairline ring, no drop).
84
+ */
85
+ export const elevation = {
86
+ light: {
87
+ 'e-0': 'none',
88
+ 'e-1': '0 1px 2px hsl(var(--console-shadow-color) / 0.06), 0 2px 6px -2px hsl(var(--console-shadow-color) / 0.08)',
89
+ 'e-2': '0 6px 16px -4px hsl(var(--console-shadow-color) / 0.12), 0 2px 4px -2px hsl(var(--console-shadow-color) / 0.06)',
90
+ 'e-3': '0 24px 48px -12px hsl(var(--console-shadow-color) / 0.2), 0 4px 12px -4px hsl(var(--console-shadow-color) / 0.08)',
91
+ },
92
+ dark: {
93
+ 'e-0': 'none',
94
+ 'e-1': '0 0 0 1px hsl(0 0% 100% / 0.08)',
95
+ 'e-2': '0 0 0 1px hsl(0 0% 100% / 0.1)',
96
+ 'e-3': '0 0 0 1px hsl(0 0% 100% / 0.12)',
97
+ },
98
+ };
99
+
100
+ /** Content widths (D16, D18): reading / form pages and data pages. */
101
+ export const contentWidth = {
102
+ reading: '60rem',
103
+ data: '120rem',
104
+ };
105
+
106
+ /** Minimum touch target on phone-sized containers (D18): 44 × 44 px. */
107
+ export const touchTarget = '2.75rem';
108
+
109
+ /**
110
+ * Other base-tier tokens that are not part of the size scale (fonts, line heights for code,
111
+ * the easing curve, derived surfaces). Unchanged from P1a except the durations, which moved to
112
+ * {@link motion}.
113
+ */
114
+ export const misc = {
115
+ // Font stacks (ADR 0063 D33): Inter / JetBrains Mono first, then system faces. The package ships
116
+ // no font files — the host (the Console) loads Inter and JetBrains Mono with @font-face.
117
+ 'font-sans': "'Inter', 'MiSans', 'SF Pro Text', -apple-system, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', 'Microsoft YaHei', sans-serif",
118
+ 'font-mono': "'JetBrains Mono', 'SF Mono', 'Cascadia Code', ui-monospace, Menlo, Consolas, 'Noto Sans Mono CJK SC', monospace",
119
+ 'line-code': '1.25rem',
120
+ 'leading-code': '1.6',
121
+ 'shadow-color': '222 30% 12%',
122
+ // The one easing curve of every transition and animation (ADR 0063 「色板角色与信号色」, zhinjs/console#125).
123
+ 'ease-out': 'cubic-bezier(0.25, 1, 0.5, 1)',
124
+ 'surface-raised': 'hsl(var(--card))',
125
+ 'surface-muted': 'hsl(var(--secondary))',
126
+ 'surface-inset': 'hsl(var(--secondary))',
127
+ 'surface-hover': 'hsl(var(--foreground) / 0.045)',
128
+ 'surface-active': 'hsl(var(--foreground) / 0.08)',
129
+ 'border-subtle': 'hsl(var(--border) / 0.7)',
130
+ 'border-default': 'hsl(var(--border))',
131
+ 'border-strong': 'hsl(var(--border-strong))',
132
+ };
133
+
134
+ /**
135
+ * Motion (zhinjs/console#125): three durations, all with `--console-ease-out`. Components never
136
+ * write milliseconds (stylelint `console/motion-tokens`).
137
+ * fast hover, press, color changes
138
+ * base expand / collapse, popovers, toasts
139
+ * slow drawers, sheets, page transitions
140
+ */
141
+ export const motion = {
142
+ 'motion-fast': '120ms',
143
+ 'motion-base': '200ms',
144
+ 'motion-slow': '280ms',
145
+ };
146
+
147
+ /**
148
+ * Color roles that do not follow the palette (ADR 0063 「色板角色与信号色」, zhinjs/console#125).
149
+ * HSL triplets like the palette colors (`hsl(var(--console-brand) / 0.1)`); one value per theme.
150
+ *
151
+ * brand #76EEC6 (light) / #7FFFD4 (dark), owner's decision 2026-11-16 — the fill of
152
+ * the brand mark and of the one solid primary button of a view. The same
153
+ * under every palette. Too light for text or thin lines on light surfaces.
154
+ * brand-foreground text and the Z on brand (dark teal, ≥ 4.5:1)
155
+ * brand-text brand as text or a thin line — links, focus ring, selection marks: the
156
+ * same hue darkened to ≥ 4.5:1 on light surfaces; #7FFFD4 in the dark theme
157
+ * brand-tint quiet brand surfaces (selected rows)
158
+ * signal-*-fill bright: dots, bars, gauges, icons, badge tints — never text
159
+ * signal-*-text the same hue darkened (light) / lightened (dark) to ≥ 4.5:1 for text
160
+ * Hue and saturation are the same in both themes; only lightness changes.
161
+ * chart-1 … chart-8 categorical data colors, independent of the palette; neighbours differ
162
+ * by ΔE2000 ≥ 20 in both themes. `chart-other` is the 「其他」 series.
163
+ *
164
+ * Steady states (running, succeeded, 0 failures) use no signal color; failures and rejections
165
+ * must be more prominent than successes.
166
+ */
167
+ export const color = {
168
+ light: {
169
+ brand: '160 78% 69.8%',
170
+ 'brand-foreground': '160 80% 10%',
171
+ 'brand-text': '160 84% 25%',
172
+ 'brand-tint': '160 60% 94%',
173
+ 'signal-danger-fill': '0 76% 54%',
174
+ 'signal-danger-text': '0 76% 40%',
175
+ 'signal-warning-fill': '38 92% 50%',
176
+ 'signal-warning-text': '38 92% 26%',
177
+ 'signal-success-fill': '145 60% 40%',
178
+ 'signal-success-text': '145 60% 25%',
179
+ 'signal-info-fill': '217 84% 56%',
180
+ 'signal-info-text': '217 84% 42%',
181
+ 'chart-1': '217 74% 50%',
182
+ 'chart-2': '32 94% 42%',
183
+ 'chart-3': '164 72% 32%',
184
+ 'chart-4': '330 66% 48%',
185
+ 'chart-5': '262 56% 56%',
186
+ 'chart-6': '48 92% 32%',
187
+ 'chart-7': '192 80% 38%',
188
+ 'chart-8': '8 66% 46%',
189
+ 'chart-other': '220 6% 58%',
190
+ },
191
+ dark: {
192
+ brand: '159.8 100% 74.9%',
193
+ 'brand-foreground': '160 80% 10%',
194
+ 'brand-text': '159.8 100% 74.9%',
195
+ 'brand-tint': '160 40% 14%',
196
+ 'signal-danger-fill': '0 76% 58%',
197
+ 'signal-danger-text': '0 76% 70%',
198
+ 'signal-warning-fill': '38 92% 52%',
199
+ 'signal-warning-text': '38 92% 62%',
200
+ 'signal-success-fill': '145 60% 44%',
201
+ 'signal-success-text': '145 60% 58%',
202
+ 'signal-info-fill': '217 84% 62%',
203
+ 'signal-info-text': '217 84% 72%',
204
+ 'chart-1': '217 80% 66%',
205
+ 'chart-2': '32 92% 58%',
206
+ 'chart-3': '164 60% 48%',
207
+ 'chart-4': '330 72% 62%',
208
+ 'chart-5': '262 70% 74%',
209
+ 'chart-6': '48 86% 56%',
210
+ 'chart-7': '192 70% 52%',
211
+ 'chart-8': '8 72% 64%',
212
+ 'chart-other': '220 6% 50%',
213
+ },
214
+ };
215
+
216
+ /** Dark overrides of {@link misc}. */
217
+ export const miscDark = {
218
+ 'shadow-color': '0 0% 0%',
219
+ 'surface-hover': 'hsl(0 0% 100% / 0.05)',
220
+ 'surface-active': 'hsl(0 0% 100% / 0.09)',
221
+ };
222
+
223
+ /**
224
+ * Tier 2 + 3: semantic tokens and their value per width (D16 「按尺寸取值」).
225
+ * Values name tier-1 tokens (`space-3`, `r-2`, `e-1`, `hairline`, `focus`) or are sizes
226
+ * (`2.75rem`). `base` applies below 40rem, `sm` from 40rem, `lg` from 64rem.
227
+ * `scope: 'viewport'` tokens follow the viewport (page-level tokens and overlays, which are
228
+ * portaled out of any container); the others follow the nearest `.console-cq` container.
229
+ * `kind` tells the linters and the audit what the token sizes.
230
+ */
231
+ export const semantic = {
232
+ // Page level (viewport).
233
+ 'page-padding-inline': { kind: 'space', scope: 'viewport', base: 'space-3', sm: 'space-4', lg: 'clamp(space-4, 2.5vw, space-6)' },
234
+ 'page-padding-block': { kind: 'space', scope: 'viewport', base: 'space-4', sm: 'space-5', lg: 'space-6' },
235
+ 'section-gap': { kind: 'space', scope: 'viewport', base: 'space-4', sm: 'space-5', lg: 'space-6' },
236
+ // Groups and cards (container).
237
+ 'stack-gap': { kind: 'space', base: 'space-2', sm: 'space-3', lg: 'space-3' },
238
+ 'inline-gap': { kind: 'space', base: 'space-2', sm: 'space-2', lg: 'space-2' },
239
+ 'heading-gap': { kind: 'space', base: 'space-1', sm: 'space-1', lg: 'space-1' },
240
+ 'card-padding': { kind: 'space', base: 'space-3', sm: 'space-4', lg: 'space-4' },
241
+ 'card-padding-wide': { kind: 'space', base: 'space-3', sm: 'space-4', lg: 'space-5' },
242
+ 'card-radius': { kind: 'radius', base: 'r-2', sm: 'r-3', lg: 'r-3' },
243
+ 'card-edge-radius': { kind: 'radius', base: 'r-0', sm: 'r-3', lg: 'r-3' },
244
+ 'card-border': { kind: 'border', base: 'hairline', sm: 'hairline', lg: 'hairline' },
245
+ 'card-elevation': { kind: 'elevation', base: 'e-0', sm: 'e-0', lg: 'e-0' },
246
+ 'card-hover-elevation': { kind: 'elevation', base: 'e-0', sm: 'e-0', lg: 'e-1' },
247
+ 'grid-gap': { kind: 'space', base: 'space-2', sm: 'space-3', lg: 'space-4' },
248
+ 'list-row-padding': { kind: 'space', base: 'space-3', sm: 'space-2', lg: 'space-2' },
249
+ 'list-row-padding-inline': { kind: 'space', base: 'space-3', sm: 'space-3', lg: 'space-3' },
250
+ // Controls (container).
251
+ 'control-height': { kind: 'size', base: '2.75rem', sm: '2.25rem', lg: '2.25rem' },
252
+ 'control-height-compact': { kind: 'size', base: '2.75rem', sm: '2.25rem', lg: '2rem' },
253
+ 'control-radius': { kind: 'radius', base: 'r-2', sm: 'r-2', lg: 'r-2' },
254
+ 'check-radius': { kind: 'radius', base: 'r-1', sm: 'r-1', lg: 'r-1' },
255
+ // Items inside a segmented control (tabs): control radius − its space-1 padding (D16 nested radii).
256
+ 'segment-radius': { kind: 'radius', base: 'r-1', sm: 'r-1', lg: 'r-1' },
257
+ 'control-padding-inline': { kind: 'space', base: 'space-3', sm: 'space-3', lg: 'space-3' },
258
+ 'control-gap': { kind: 'space', base: 'space-2', sm: 'space-2', lg: 'space-2' },
259
+ 'control-border': { kind: 'border', base: 'hairline', sm: 'hairline', lg: 'hairline' },
260
+ 'touch-min': { kind: 'size', base: '2.75rem', sm: '0rem', lg: '0rem' },
261
+ 'badge-height': { kind: 'size', base: '1.25rem', sm: '1.25rem', lg: '1.25rem' },
262
+ 'badge-radius': { kind: 'radius', base: 'r-full', sm: 'r-full', lg: 'r-full' },
263
+ 'badge-padding-inline': { kind: 'space', base: 'space-2', sm: 'space-2', lg: 'space-2' },
264
+ // Overlays (viewport: they are portaled to <body>). Below 40rem they are bottom drawers.
265
+ 'popover-radius': { kind: 'radius', scope: 'viewport', base: 'r-4 r-4 r-0 r-0', sm: 'r-3', lg: 'r-3' },
266
+ 'popover-item-radius': { kind: 'radius', scope: 'viewport', base: 'r-3', sm: 'r-2', lg: 'r-2' },
267
+ 'popover-padding': { kind: 'space', scope: 'viewport', base: 'space-1', sm: 'space-1', lg: 'space-1' },
268
+ 'popover-elevation': { kind: 'elevation', scope: 'viewport', base: 'e-3', sm: 'e-2', lg: 'e-2' },
269
+ 'dialog-radius': { kind: 'radius', scope: 'viewport', base: 'r-4 r-4 r-0 r-0', sm: 'r-4', lg: 'r-4' },
270
+ 'dialog-padding': { kind: 'space', scope: 'viewport', base: 'space-4', sm: 'space-5', lg: 'space-5' },
271
+ 'dialog-elevation': { kind: 'elevation', scope: 'viewport', base: 'e-3', sm: 'e-3', lg: 'e-3' },
272
+ // Room the header keeps for the dialog / sheet close button.
273
+ 'dialog-close-clearance': { kind: 'space', scope: 'viewport', base: 'space-7', sm: 'space-7', lg: 'space-7' },
274
+ 'sheet-radius': { kind: 'radius', scope: 'viewport', base: 'r-4', sm: 'r-4', lg: 'r-4' },
275
+ // Focus ring: focus (2px) + 2px offset at every width.
276
+ 'focus-ring-width': { kind: 'border', scope: 'viewport', base: 'focus', sm: 'focus', lg: 'focus' },
277
+ 'focus-ring-offset': { kind: 'space', scope: 'viewport', base: '2px', sm: '2px', lg: '2px' },
278
+ };
279
+
280
+ /**
281
+ * Composite semantic tokens built from the ones above (same value at every width, resolved where
282
+ * the component reads them).
283
+ */
284
+ export const composite = {
285
+ // The focus ring is brand-text (zhinjs/console#125), the same under every palette.
286
+ 'focus-ring': 'var(--console-focus-ring-width) solid hsl(var(--console-brand-text))',
287
+ /* Content width the shell resolved for the current page (D16, D22): `data` unless the page is a reading page. */
288
+ 'content-max': 'var(--console-content-data)',
289
+ };
290
+
291
+ /**
292
+ * Deprecated names kept as aliases until P4 (D16 配套规则, D21). Each maps to a token name
293
+ * (without `--console-`). They are redeclared wherever their target is, so they follow the same
294
+ * viewport / container values.
295
+ */
296
+ export const aliases = {
297
+ // Radii.
298
+ 'radius-sm': 'radius-1',
299
+ 'radius-md': 'radius-2',
300
+ 'radius-lg': 'radius-3',
301
+ 'radius-xl': 'radius-4',
302
+ 'radius-2xl': 'radius-4',
303
+ // Shadows.
304
+ 'shadow-xs': 'elevation-0',
305
+ 'shadow-sm': 'card-elevation',
306
+ 'shadow-md': 'elevation-2',
307
+ 'shadow-lg': 'elevation-3',
308
+ 'shadow-xl': 'elevation-3',
309
+ 'shadow-panel': 'card-elevation',
310
+ 'shadow-hover': 'card-hover-elevation',
311
+ 'shadow-button': 'elevation-0',
312
+ // Spacing.
313
+ 'space-page-x': 'page-padding-inline',
314
+ 'space-page-y': 'page-padding-block',
315
+ 'space-section': 'section-gap',
316
+ 'space-stack': 'stack-gap',
317
+ 'space-card': 'card-padding',
318
+ 'space-card-sm': 'card-padding',
319
+ // Controls and borders.
320
+ 'control-height-sm': 'control-height-compact',
321
+ 'control-height-lg': 'control-height',
322
+ 'border-width': 'border-hairline',
323
+ 'focus-width': 'border-focus',
324
+ // Motion (zhinjs/console#125): 150ms became motion-fast 120ms, 200ms motion-base.
325
+ 'duration-fast': 'motion-fast',
326
+ 'duration-page': 'motion-base',
327
+ // Type.
328
+ 'text-caption': 'text-label',
329
+ 'text-code': 'text-label',
330
+ 'text-body-sm': 'text-label',
331
+ 'text-section-sm': 'text-section',
332
+ 'text-title-compact': 'text-title',
333
+ };
334
+
335
+ /** Unprefixed deprecated aliases (shadcn-style `--radius`). */
336
+ export const bareAliases = {
337
+ '--radius': 'control-radius',
338
+ };
339
+
340
+ /** Deprecated tokens without a successor, kept with their P1a value until P4. */
341
+ export const deprecated = {
342
+ 'shadow-ring': '0 0 0 1px hsl(var(--console-shadow-color) / 0.045)',
343
+ };
344
+
345
+ /**
346
+ * Sizes for `w-*` / `h-*` / `size-*` / `inset-*` / `min-*` / `max-*` / `translate-*` / `basis-*`
347
+ * (D17: not limited by the spacing scale; e.g. `h-11` is the 44px touch target). These are
348
+ * Tailwind's default numeric keys; each is `n × 0.25rem`.
349
+ */
350
+ export const sizingKeys = [
351
+ '0', '0.5', '1', '1.5', '2', '2.5', '3', '3.5', '4', '5', '6', '7', '8', '9', '10', '11', '12',
352
+ '14', '16', '20', '24', '28', '32', '36', '40', '44', '48', '52', '56', '60', '64', '72', '80', '96',
353
+ ];
354
+
355
+ /** Semantic size keys for the same utilities (`h-control`, `size-touch`, …). */
356
+ export const semanticSizes = {
357
+ control: 'var(--console-control-height)',
358
+ 'control-compact': 'var(--console-control-height-compact)',
359
+ touch: 'var(--console-touch-target)',
360
+ 'touch-min': 'var(--console-touch-min)',
361
+ badge: 'var(--console-badge-height)',
362
+ };