@juice-js/design-tokens 0.0.0-stage → 2.5.0-alpha.4

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/MAPPING.md ADDED
@@ -0,0 +1,419 @@
1
+ # Token mapping
2
+
3
+ Generated by `build.mjs`; do not edit. Layers: Tier 1 raw, Tier 2 system, Tier 3 component, compat (2.x names), bridge (`--mat-sys-*`).
4
+
5
+ ## Tier 1: raw ramps
6
+
7
+ `--juice-ref-neutral-{50..950}`, `--juice-ref-indigo-{50..950}`, `--juice-ref-teal-{50..950}`, `--juice-ref-violet-{50..950}`, `--juice-ref-green-{50..950}`, `--juice-ref-amber-{50..950}`, `--juice-ref-red-{50..950}`, `--juice-ref-blue-{50..950}` and `--juice-ref-accent-{50..950}` (the active accent: indigo, teal, violet; default indigo). Select with `data-accent` or `data-juice-palette` on `<html>`. Values are case-sensitive: `Teal` does not match and the default applies.
8
+
9
+ ## Tier 2: system tokens
10
+
11
+ | Token | Light | Dark |
12
+ | --- | --- | --- |
13
+ | `--juice-color-bg` | `var(--juice-ref-neutral-50)` | `var(--juice-ref-neutral-950)` |
14
+ | `--juice-color-surface` | `#ffffff` | `var(--juice-ref-neutral-900)` |
15
+ | `--juice-color-surface-raised` | `#ffffff` | `var(--juice-ref-neutral-800)` |
16
+ | `--juice-color-surface-sunken` | `var(--juice-ref-neutral-100)` | `#000000` |
17
+ | `--juice-color-overlay` | `rgb(9 9 11 / 0.5)` | `rgb(0 0 0 / 0.7)` |
18
+ | `--juice-color-border` | `var(--juice-ref-neutral-200)` | `var(--juice-ref-neutral-700)` |
19
+ | `--juice-color-border-strong` | `var(--juice-ref-neutral-500)` | `var(--juice-ref-neutral-500)` |
20
+ | `--juice-color-text` | `var(--juice-ref-neutral-950)` | `var(--juice-ref-neutral-50)` |
21
+ | `--juice-color-text-muted` | `var(--juice-ref-neutral-600)` | `var(--juice-ref-neutral-300)` |
22
+ | `--juice-color-text-subtle` | `var(--juice-ref-neutral-500)` | `var(--juice-ref-neutral-400)` |
23
+ | `--juice-color-text-on-accent` | `#ffffff` | `var(--juice-ref-neutral-950)` |
24
+ | `--juice-color-accent` | `var(--juice-ref-accent-600)` | `var(--juice-ref-accent-400)` |
25
+ | `--juice-color-accent-hover` | `var(--juice-ref-accent-700)` | `var(--juice-ref-accent-300)` |
26
+ | `--juice-color-accent-active` | `var(--juice-ref-accent-800)` | `var(--juice-ref-accent-200)` |
27
+ | `--juice-color-accent-subtle` | `var(--juice-ref-accent-100)` | `var(--juice-ref-accent-950)` |
28
+ | `--juice-color-focus-ring` | `var(--juice-ref-accent-600)` | `var(--juice-ref-accent-400)` |
29
+ | `--juice-color-ok` | `var(--juice-ref-green-700)` | `var(--juice-ref-green-400)` |
30
+ | `--juice-color-warn` | `var(--juice-ref-amber-700)` | `var(--juice-ref-amber-400)` |
31
+ | `--juice-color-bad` | `var(--juice-ref-red-700)` | `var(--juice-ref-red-400)` |
32
+ | `--juice-color-info` | `var(--juice-ref-blue-700)` | `var(--juice-ref-blue-400)` |
33
+ | `--juice-color-ok-subtle` | `var(--juice-ref-green-50)` | `var(--juice-ref-green-950)` |
34
+ | `--juice-color-warn-subtle` | `var(--juice-ref-amber-50)` | `var(--juice-ref-amber-950)` |
35
+ | `--juice-color-bad-subtle` | `var(--juice-ref-red-50)` | `var(--juice-ref-red-950)` |
36
+ | `--juice-color-info-subtle` | `var(--juice-ref-blue-50)` | `var(--juice-ref-blue-950)` |
37
+ | `--juice-color-disabled-bg` | `var(--juice-ref-neutral-100)` | `var(--juice-ref-neutral-800)` |
38
+ | `--juice-color-disabled-text` | `var(--juice-ref-neutral-500)` | `var(--juice-ref-neutral-500)` |
39
+ | `--juice-shadow-color` | `rgb(9 9 11 / 0.1)` | `rgb(0 0 0 / 0.5)` |
40
+ | `--juice-shadow-ring` | `rgb(9 9 11 / 0.06)` | `rgb(255 255 255 / 0.08)` |
41
+
42
+ | Token | Value |
43
+ | --- | --- |
44
+ | `--juice-space-0` | 0 |
45
+ | `--juice-space-1` | 4px |
46
+ | `--juice-space-2` | 8px |
47
+ | `--juice-space-3` | 12px |
48
+ | `--juice-space-4` | 16px |
49
+ | `--juice-space-5` | 20px |
50
+ | `--juice-space-6` | 24px |
51
+ | `--juice-space-8` | 32px |
52
+ | `--juice-space-10` | 40px |
53
+ | `--juice-space-12` | 48px |
54
+ | `--juice-space-16` | 64px |
55
+ | `--juice-space-0-5` | 2px |
56
+ | `--juice-radius-xs` | 2px |
57
+ | `--juice-radius-sm` | 4px |
58
+ | `--juice-radius-md` | 6px |
59
+ | `--juice-radius-lg` | 8px |
60
+ | `--juice-radius-xl` | 12px |
61
+ | `--juice-radius-full` | 9999px |
62
+ | `--juice-shadow-0` | elevation |
63
+ | `--juice-shadow-1` | elevation |
64
+ | `--juice-shadow-2` | elevation |
65
+ | `--juice-shadow-3` | elevation |
66
+ | `--juice-shadow-overlay` | elevation |
67
+ | `--juice-duration-fast` | 100ms (0ms under prefers-reduced-motion) |
68
+ | `--juice-duration-normal` | 150ms (0ms under prefers-reduced-motion) |
69
+ | `--juice-duration-slow` | 250ms (0ms under prefers-reduced-motion) |
70
+ | `--juice-ease-standard` | `cubic-bezier(0.2, 0, 0, 1)` |
71
+ | `--juice-ease-emphasized` | `cubic-bezier(0.05, 0.7, 0.1, 1)` |
72
+ | `--juice-ease-exit` | `cubic-bezier(0.3, 0, 0.8, 0.15)` |
73
+ | `--juice-font-sans` | font stack |
74
+ | `--juice-font-mono` | font stack |
75
+ | `--juice-text-xs` | 0.75rem |
76
+ | `--juice-text-sm` | 0.8125rem |
77
+ | `--juice-text-md` | 0.875rem |
78
+ | `--juice-text-lg` | 1rem |
79
+ | `--juice-text-xl` | 1.25rem |
80
+ | `--juice-text-2xl` | 1.5rem |
81
+ | `--juice-leading-tight` | 1.25 |
82
+ | `--juice-leading-snug` | 1.375 |
83
+ | `--juice-leading-normal` | 1.5 |
84
+ | `--juice-leading-relaxed` | 1.625 |
85
+ | `--juice-weight-regular` | 400 |
86
+ | `--juice-weight-medium` | 500 |
87
+ | `--juice-weight-semibold` | 600 |
88
+ | `--juice-z-dropdown` | 1000 |
89
+ | `--juice-z-overlay` | 1100 |
90
+ | `--juice-z-modal` | 1200 |
91
+ | `--juice-z-toast` | 1300 |
92
+
93
+ ### Density
94
+
95
+ | Token | compact | default | comfortable |
96
+ | --- | --- | --- | --- |
97
+ | `--juice-control-height-sm` | 1.5rem | 1.75rem | 2rem |
98
+ | `--juice-control-height-md` | 1.75rem | 2rem | 2.5rem |
99
+ | `--juice-control-height-lg` | 2.25rem | 2.5rem | 3rem |
100
+ | `--juice-control-padding-x` | 0.5rem | 0.75rem | 1rem |
101
+ | `--juice-density-gap` | 0.25rem | 0.5rem | 0.75rem |
102
+
103
+ ## Tier 3: component tokens (each defaults to a Tier 2 token)
104
+
105
+ | Token | Default |
106
+ | --- | --- |
107
+ | `--juice-button-bg` | `var(--juice-color-accent)` |
108
+ | `--juice-button-fg` | `var(--juice-color-text-on-accent)` |
109
+ | `--juice-button-hover-bg` | `var(--juice-color-accent-hover)` |
110
+ | `--juice-button-active-bg` | `var(--juice-color-accent-active)` |
111
+ | `--juice-button-secondary-bg` | `var(--juice-color-surface)` |
112
+ | `--juice-button-secondary-fg` | `var(--juice-color-text)` |
113
+ | `--juice-button-secondary-border` | `var(--juice-color-border-strong)` |
114
+ | `--juice-button-secondary-hover-bg` | `var(--juice-color-surface-sunken)` |
115
+ | `--juice-button-ghost-fg` | `var(--juice-color-text)` |
116
+ | `--juice-button-ghost-hover-bg` | `var(--juice-color-surface-sunken)` |
117
+ | `--juice-button-danger-bg` | `var(--juice-color-bad)` |
118
+ | `--juice-button-danger-fg` | `var(--juice-color-text-on-accent)` |
119
+ | `--juice-button-disabled-bg` | `var(--juice-color-disabled-bg)` |
120
+ | `--juice-button-disabled-fg` | `var(--juice-color-disabled-text)` |
121
+ | `--juice-button-radius` | `var(--juice-radius-md)` |
122
+ | `--juice-button-padding-x` | `var(--juice-control-padding-x)` |
123
+ | `--juice-button-font-weight` | `var(--juice-weight-medium)` |
124
+ | `--juice-button-focus-ring` | `var(--juice-color-focus-ring)` |
125
+ | `--juice-field-bg` | `var(--juice-color-surface)` |
126
+ | `--juice-field-fg` | `var(--juice-color-text)` |
127
+ | `--juice-field-border` | `var(--juice-color-border-strong)` |
128
+ | `--juice-field-border-hover` | `var(--juice-color-text-subtle)` |
129
+ | `--juice-field-border-focus` | `var(--juice-color-focus-ring)` |
130
+ | `--juice-field-placeholder` | `var(--juice-color-text-subtle)` |
131
+ | `--juice-field-label` | `var(--juice-color-text)` |
132
+ | `--juice-field-hint` | `var(--juice-color-text-muted)` |
133
+ | `--juice-field-error` | `var(--juice-color-bad)` |
134
+ | `--juice-field-disabled-bg` | `var(--juice-color-disabled-bg)` |
135
+ | `--juice-field-disabled-fg` | `var(--juice-color-disabled-text)` |
136
+ | `--juice-field-radius` | `var(--juice-radius-md)` |
137
+ | `--juice-field-height` | `var(--juice-control-height-md)` |
138
+ | `--juice-field-padding-x` | `var(--juice-control-padding-x)` |
139
+ | `--juice-field-gap` | `var(--juice-density-gap)` |
140
+ | `--juice-listbox-bg` | `var(--juice-color-surface-raised)` |
141
+ | `--juice-listbox-fg` | `var(--juice-color-text)` |
142
+ | `--juice-listbox-border` | `var(--juice-color-border)` |
143
+ | `--juice-listbox-shadow` | `var(--juice-shadow-overlay)` |
144
+ | `--juice-listbox-radius` | `var(--juice-radius-lg)` |
145
+ | `--juice-listbox-option-hover-bg` | `var(--juice-color-surface-sunken)` |
146
+ | `--juice-listbox-option-active-bg` | `var(--juice-color-surface-sunken)` |
147
+ | `--juice-listbox-option-selected-bg` | `var(--juice-color-accent-subtle)` |
148
+ | `--juice-listbox-option-selected-fg` | `var(--juice-color-text)` |
149
+ | `--juice-listbox-option-disabled-fg` | `var(--juice-color-disabled-text)` |
150
+ | `--juice-listbox-option-height` | `var(--juice-control-height-md)` |
151
+ | `--juice-listbox-z` | `var(--juice-z-dropdown)` |
152
+ | `--juice-checkbox-size` | `var(--juice-space-4)` |
153
+ | `--juice-checkbox-bg` | `var(--juice-color-surface)` |
154
+ | `--juice-checkbox-border` | `var(--juice-color-border-strong)` |
155
+ | `--juice-checkbox-checked-bg` | `var(--juice-color-accent)` |
156
+ | `--juice-checkbox-checked-fg` | `var(--juice-color-text-on-accent)` |
157
+ | `--juice-checkbox-hover-border` | `var(--juice-color-text-subtle)` |
158
+ | `--juice-checkbox-radius` | `var(--juice-radius-sm)` |
159
+ | `--juice-checkbox-disabled-bg` | `var(--juice-color-disabled-bg)` |
160
+ | `--juice-badge-radius` | `var(--juice-radius-full)` |
161
+ | `--juice-badge-padding-x` | `var(--juice-space-2)` |
162
+ | `--juice-badge-font-size` | `var(--juice-text-xs)` |
163
+ | `--juice-badge-font-weight` | `var(--juice-weight-medium)` |
164
+ | `--juice-badge-neutral-bg` | `var(--juice-color-surface-sunken)` |
165
+ | `--juice-badge-neutral-fg` | `var(--juice-color-text-muted)` |
166
+ | `--juice-badge-accent-bg` | `var(--juice-color-accent-subtle)` |
167
+ | `--juice-badge-accent-fg` | `var(--juice-color-accent-active)` |
168
+ | `--juice-badge-ok-bg` | `var(--juice-color-ok-subtle)` |
169
+ | `--juice-badge-ok-fg` | `var(--juice-color-ok)` |
170
+ | `--juice-badge-warn-bg` | `var(--juice-color-warn-subtle)` |
171
+ | `--juice-badge-warn-fg` | `var(--juice-color-warn)` |
172
+ | `--juice-badge-bad-bg` | `var(--juice-color-bad-subtle)` |
173
+ | `--juice-badge-bad-fg` | `var(--juice-color-bad)` |
174
+ | `--juice-badge-info-bg` | `var(--juice-color-info-subtle)` |
175
+ | `--juice-badge-info-fg` | `var(--juice-color-info)` |
176
+ | `--juice-progress-track` | `var(--juice-color-surface-sunken)` |
177
+ | `--juice-progress-bar` | `var(--juice-color-accent)` |
178
+ | `--juice-progress-height` | `var(--juice-space-2)` |
179
+ | `--juice-progress-radius` | `var(--juice-radius-full)` |
180
+ | `--juice-progress-duration` | `var(--juice-duration-slow)` |
181
+ | `--juice-sidebar-bg` | `var(--juice-color-surface)` |
182
+ | `--juice-sidebar-fg` | `var(--juice-color-text-muted)` |
183
+ | `--juice-sidebar-border` | `var(--juice-color-border)` |
184
+ | `--juice-sidebar-width` | `16rem` |
185
+ | `--juice-sidebar-collapsed-width` | `4rem` |
186
+ | `--juice-sidebar-item-hover-bg` | `var(--juice-color-surface-sunken)` |
187
+ | `--juice-sidebar-item-active-bg` | `var(--juice-color-accent-subtle)` |
188
+ | `--juice-sidebar-item-active-fg` | `var(--juice-color-text)` |
189
+ | `--juice-sidebar-item-height` | `var(--juice-control-height-lg)` |
190
+ | `--juice-header-bg` | `var(--juice-color-surface)` |
191
+ | `--juice-header-fg` | `var(--juice-color-text)` |
192
+ | `--juice-header-border` | `var(--juice-color-border)` |
193
+ | `--juice-header-height` | `3.5rem` |
194
+ | `--juice-header-padding-x` | `var(--juice-space-4)` |
195
+ | `--juice-panel-bg` | `var(--juice-color-surface-raised)` |
196
+ | `--juice-panel-fg` | `var(--juice-color-text)` |
197
+ | `--juice-panel-border` | `var(--juice-color-border)` |
198
+ | `--juice-panel-shadow` | `var(--juice-shadow-2)` |
199
+ | `--juice-panel-radius` | `var(--juice-radius-lg)` |
200
+ | `--juice-panel-padding` | `var(--juice-space-4)` |
201
+ | `--juice-panel-header-bg` | `var(--juice-color-surface)` |
202
+ | `--juice-panel-resize-handle` | `var(--juice-color-border-strong)` |
203
+
204
+ ## Compat: layout 2.x `--juice-*` names
205
+
206
+ | 2.x name | Now |
207
+ | --- | --- |
208
+ | `--juice-bg` | `var(--juice-color-bg)` |
209
+ | `--juice-surface` | `var(--juice-color-surface)` |
210
+ | `--juice-border` | `var(--juice-color-border)` |
211
+ | `--juice-text` | `var(--juice-color-text)` |
212
+ | `--juice-muted` | `var(--juice-color-text-muted)` |
213
+ | `--juice-accent` | `var(--juice-color-accent)` |
214
+ | `--juice-on-accent` | `var(--juice-color-text-on-accent)` |
215
+ | `--juice-select` | `var(--juice-color-accent-subtle)` |
216
+ | `--juice-focus` | `var(--juice-color-focus-ring)` |
217
+ | `--juice-ok` | `var(--juice-color-ok)` |
218
+ | `--juice-warn` | `var(--juice-color-warn)` |
219
+ | `--juice-bad` | `var(--juice-color-bad)` |
220
+ | `--juice-info` | `var(--juice-color-info)` |
221
+ | `--juice-none` | `var(--juice-color-text-muted)` |
222
+ | `--juice-ok-bg` | `var(--juice-color-ok-subtle)` |
223
+ | `--juice-warn-bg` | `var(--juice-color-warn-subtle)` |
224
+ | `--juice-bad-bg` | `var(--juice-color-bad-subtle)` |
225
+ | `--juice-info-bg` | `var(--juice-color-info-subtle)` |
226
+ | `--juice-none-bg` | `var(--juice-color-surface-sunken)` |
227
+
228
+ ## `--jc-*`: Console scale (layout 2.4.3)
229
+
230
+ Defined under `:where(:root)` with the 2.4.3 values, so an app's own values still win. `jc-page-header` reads `--jc-border` and `--jc-muted` with fallbacks to `--juice-border` and `--juice-muted`; the tokens do not define those two, the compat names answer. New code should use the Tier 2 tokens in the third column.
231
+
232
+ | Name | Value | Prefer |
233
+ | --- | --- | --- |
234
+ | `--jc-font-xs` | 11px | `--juice-text-xs` |
235
+ | `--jc-font-sm` | 12px | `--juice-text-sm` |
236
+ | `--jc-font-md` | 13px | `--juice-text-md` |
237
+ | `--jc-font-lg` | 14px | `--juice-text-lg` |
238
+ | `--jc-font-xl` | 16px | `--juice-text-xl` |
239
+ | `--jc-font-2xl` | 20px | `--juice-text-2xl` |
240
+ | `--jc-font-fig` | 24px | `--juice-text-2xl` |
241
+ | `--jc-radius-sm` | 4px | `--juice-radius-sm` |
242
+ | `--jc-radius` | 8px | `--juice-radius-lg` |
243
+ | `--jc-radius-pill` | 999px | `--juice-radius-full` |
244
+ | `--jc-border` | not defined (fallback) | `--juice-color-border` |
245
+ | `--jc-muted` | not defined (fallback) | `--juice-color-text-muted` |
246
+
247
+ ## `--mat-sys-*`: Material bridge (`tokens.material-bridge()`)
248
+
249
+ | Material variable | Token |
250
+ | --- | --- |
251
+ | `--mat-sys-background` | `var(--juice-color-bg)` |
252
+ | `--mat-sys-on-background` | `var(--juice-color-text)` |
253
+ | `--mat-sys-surface` | `var(--juice-color-surface)` |
254
+ | `--mat-sys-on-surface` | `var(--juice-color-text)` |
255
+ | `--mat-sys-surface-variant` | `var(--juice-color-surface-sunken)` |
256
+ | `--mat-sys-on-surface-variant` | `var(--juice-color-text-muted)` |
257
+ | `--mat-sys-surface-dim` | `var(--juice-color-surface-sunken)` |
258
+ | `--mat-sys-surface-bright` | `var(--juice-color-surface-raised)` |
259
+ | `--mat-sys-surface-tint` | `var(--juice-color-accent)` |
260
+ | `--mat-sys-surface-container-lowest` | `var(--juice-color-surface)` |
261
+ | `--mat-sys-surface-container-low` | `var(--juice-color-surface)` |
262
+ | `--mat-sys-surface-container` | `var(--juice-color-surface-raised)` |
263
+ | `--mat-sys-surface-container-high` | `var(--juice-color-surface-raised)` |
264
+ | `--mat-sys-surface-container-highest` | `var(--juice-color-border)` |
265
+ | `--mat-sys-inverse-surface` | `light-dark(var(--juice-ref-neutral-900), var(--juice-ref-neutral-50))` |
266
+ | `--mat-sys-inverse-on-surface` | `light-dark(var(--juice-ref-neutral-50), var(--juice-ref-neutral-900))` |
267
+ | `--mat-sys-inverse-primary` | `light-dark(var(--juice-ref-accent-400), var(--juice-ref-accent-600))` |
268
+ | `--mat-sys-primary` | `var(--juice-color-accent)` |
269
+ | `--mat-sys-on-primary` | `var(--juice-color-text-on-accent)` |
270
+ | `--mat-sys-primary-container` | `var(--juice-color-accent-subtle)` |
271
+ | `--mat-sys-on-primary-container` | `var(--juice-color-text)` |
272
+ | `--mat-sys-primary-fixed` | `var(--juice-ref-accent-100)` |
273
+ | `--mat-sys-primary-fixed-dim` | `var(--juice-ref-accent-300)` |
274
+ | `--mat-sys-on-primary-fixed` | `var(--juice-ref-accent-950)` |
275
+ | `--mat-sys-on-primary-fixed-variant` | `var(--juice-ref-accent-800)` |
276
+ | `--mat-sys-secondary` | `var(--juice-color-text-muted)` |
277
+ | `--mat-sys-on-secondary` | `var(--juice-color-surface)` |
278
+ | `--mat-sys-secondary-container` | `var(--juice-color-accent-subtle)` |
279
+ | `--mat-sys-on-secondary-container` | `var(--juice-color-text)` |
280
+ | `--mat-sys-secondary-fixed` | `var(--juice-ref-neutral-200)` |
281
+ | `--mat-sys-secondary-fixed-dim` | `var(--juice-ref-neutral-400)` |
282
+ | `--mat-sys-on-secondary-fixed` | `var(--juice-ref-neutral-950)` |
283
+ | `--mat-sys-on-secondary-fixed-variant` | `var(--juice-ref-neutral-700)` |
284
+ | `--mat-sys-tertiary` | `var(--juice-color-accent)` |
285
+ | `--mat-sys-on-tertiary` | `var(--juice-color-text-on-accent)` |
286
+ | `--mat-sys-tertiary-container` | `var(--juice-color-accent-subtle)` |
287
+ | `--mat-sys-on-tertiary-container` | `var(--juice-color-text)` |
288
+ | `--mat-sys-tertiary-fixed` | `var(--juice-ref-accent-100)` |
289
+ | `--mat-sys-tertiary-fixed-dim` | `var(--juice-ref-accent-300)` |
290
+ | `--mat-sys-on-tertiary-fixed` | `var(--juice-ref-accent-950)` |
291
+ | `--mat-sys-on-tertiary-fixed-variant` | `var(--juice-ref-accent-800)` |
292
+ | `--mat-sys-error` | `var(--juice-color-bad)` |
293
+ | `--mat-sys-on-error` | `light-dark(#ffffff, var(--juice-ref-neutral-950))` |
294
+ | `--mat-sys-error-container` | `var(--juice-color-bad-subtle)` |
295
+ | `--mat-sys-on-error-container` | `var(--juice-color-bad)` |
296
+ | `--mat-sys-outline` | `var(--juice-color-border-strong)` |
297
+ | `--mat-sys-outline-variant` | `var(--juice-color-border)` |
298
+ | `--mat-sys-scrim` | `#000000` |
299
+ | `--mat-sys-shadow` | `#000000` |
300
+ | `--mat-sys-neutral10` | `var(--juice-ref-neutral-900)` |
301
+ | `--mat-sys-neutral-variant20` | `var(--juice-ref-neutral-800)` |
302
+ | `--mat-sys-level0` | `var(--juice-shadow-0)` |
303
+ | `--mat-sys-level1` | `var(--juice-shadow-1)` |
304
+ | `--mat-sys-level2` | `var(--juice-shadow-2)` |
305
+ | `--mat-sys-level3` | `var(--juice-shadow-3)` |
306
+ | `--mat-sys-level4` | `var(--juice-shadow-3)` |
307
+ | `--mat-sys-level5` | `var(--juice-shadow-overlay)` |
308
+ | `--mat-sys-corner-none` | `0` |
309
+ | `--mat-sys-corner-extra-small` | `var(--juice-radius-sm)` |
310
+ | `--mat-sys-corner-small` | `var(--juice-radius-md)` |
311
+ | `--mat-sys-corner-medium` | `var(--juice-radius-lg)` |
312
+ | `--mat-sys-corner-large` | `var(--juice-radius-xl)` |
313
+ | `--mat-sys-corner-extra-large` | `var(--juice-radius-xl)` |
314
+ | `--mat-sys-corner-full` | `var(--juice-radius-full)` |
315
+ | `--mat-sys-corner-extra-small-top` | `var(--juice-radius-sm) var(--juice-radius-sm) 0 0` |
316
+ | `--mat-sys-corner-large-top` | `var(--juice-radius-xl) var(--juice-radius-xl) 0 0` |
317
+ | `--mat-sys-corner-large-start` | `var(--juice-radius-xl) 0 0 var(--juice-radius-xl)` |
318
+ | `--mat-sys-corner-large-end` | `0 var(--juice-radius-xl) var(--juice-radius-xl) 0` |
319
+ | `--mat-sys-corner-extra-large-top` | `var(--juice-radius-xl) var(--juice-radius-xl) 0 0` |
320
+ | `--mat-sys-hover-state-layer-opacity` | `0.08` |
321
+ | `--mat-sys-focus-state-layer-opacity` | `0.12` |
322
+ | `--mat-sys-pressed-state-layer-opacity` | `0.12` |
323
+ | `--mat-sys-dragged-state-layer-opacity` | `0.16` |
324
+ | `--mat-sys-display-large` | `var(--juice-weight-regular) var(--juice-text-2xl) / var(--juice-leading-tight) var(--juice-font-sans)` |
325
+ | `--mat-sys-display-large-font` | `var(--juice-font-sans)` |
326
+ | `--mat-sys-display-large-line-height` | `var(--juice-leading-tight)` |
327
+ | `--mat-sys-display-large-size` | `var(--juice-text-2xl)` |
328
+ | `--mat-sys-display-large-tracking` | `0` |
329
+ | `--mat-sys-display-large-weight` | `var(--juice-weight-regular)` |
330
+ | `--mat-sys-display-medium` | `var(--juice-weight-regular) var(--juice-text-2xl) / var(--juice-leading-tight) var(--juice-font-sans)` |
331
+ | `--mat-sys-display-medium-font` | `var(--juice-font-sans)` |
332
+ | `--mat-sys-display-medium-line-height` | `var(--juice-leading-tight)` |
333
+ | `--mat-sys-display-medium-size` | `var(--juice-text-2xl)` |
334
+ | `--mat-sys-display-medium-tracking` | `0` |
335
+ | `--mat-sys-display-medium-weight` | `var(--juice-weight-regular)` |
336
+ | `--mat-sys-display-small` | `var(--juice-weight-regular) var(--juice-text-2xl) / var(--juice-leading-tight) var(--juice-font-sans)` |
337
+ | `--mat-sys-display-small-font` | `var(--juice-font-sans)` |
338
+ | `--mat-sys-display-small-line-height` | `var(--juice-leading-tight)` |
339
+ | `--mat-sys-display-small-size` | `var(--juice-text-2xl)` |
340
+ | `--mat-sys-display-small-tracking` | `0` |
341
+ | `--mat-sys-display-small-weight` | `var(--juice-weight-regular)` |
342
+ | `--mat-sys-headline-large` | `var(--juice-weight-semibold) var(--juice-text-2xl) / var(--juice-leading-tight) var(--juice-font-sans)` |
343
+ | `--mat-sys-headline-large-font` | `var(--juice-font-sans)` |
344
+ | `--mat-sys-headline-large-line-height` | `var(--juice-leading-tight)` |
345
+ | `--mat-sys-headline-large-size` | `var(--juice-text-2xl)` |
346
+ | `--mat-sys-headline-large-tracking` | `0` |
347
+ | `--mat-sys-headline-large-weight` | `var(--juice-weight-semibold)` |
348
+ | `--mat-sys-headline-medium` | `var(--juice-weight-semibold) var(--juice-text-xl) / var(--juice-leading-tight) var(--juice-font-sans)` |
349
+ | `--mat-sys-headline-medium-font` | `var(--juice-font-sans)` |
350
+ | `--mat-sys-headline-medium-line-height` | `var(--juice-leading-tight)` |
351
+ | `--mat-sys-headline-medium-size` | `var(--juice-text-xl)` |
352
+ | `--mat-sys-headline-medium-tracking` | `0` |
353
+ | `--mat-sys-headline-medium-weight` | `var(--juice-weight-semibold)` |
354
+ | `--mat-sys-headline-small` | `var(--juice-weight-semibold) var(--juice-text-xl) / var(--juice-leading-snug) var(--juice-font-sans)` |
355
+ | `--mat-sys-headline-small-font` | `var(--juice-font-sans)` |
356
+ | `--mat-sys-headline-small-line-height` | `var(--juice-leading-snug)` |
357
+ | `--mat-sys-headline-small-size` | `var(--juice-text-xl)` |
358
+ | `--mat-sys-headline-small-tracking` | `0` |
359
+ | `--mat-sys-headline-small-weight` | `var(--juice-weight-semibold)` |
360
+ | `--mat-sys-title-large` | `var(--juice-weight-semibold) var(--juice-text-xl) / var(--juice-leading-snug) var(--juice-font-sans)` |
361
+ | `--mat-sys-title-large-font` | `var(--juice-font-sans)` |
362
+ | `--mat-sys-title-large-line-height` | `var(--juice-leading-snug)` |
363
+ | `--mat-sys-title-large-size` | `var(--juice-text-xl)` |
364
+ | `--mat-sys-title-large-tracking` | `0` |
365
+ | `--mat-sys-title-large-weight` | `var(--juice-weight-semibold)` |
366
+ | `--mat-sys-title-medium` | `var(--juice-weight-medium) var(--juice-text-lg) / var(--juice-leading-snug) var(--juice-font-sans)` |
367
+ | `--mat-sys-title-medium-font` | `var(--juice-font-sans)` |
368
+ | `--mat-sys-title-medium-line-height` | `var(--juice-leading-snug)` |
369
+ | `--mat-sys-title-medium-size` | `var(--juice-text-lg)` |
370
+ | `--mat-sys-title-medium-tracking` | `0` |
371
+ | `--mat-sys-title-medium-weight` | `var(--juice-weight-medium)` |
372
+ | `--mat-sys-title-small` | `var(--juice-weight-medium) var(--juice-text-md) / var(--juice-leading-snug) var(--juice-font-sans)` |
373
+ | `--mat-sys-title-small-font` | `var(--juice-font-sans)` |
374
+ | `--mat-sys-title-small-line-height` | `var(--juice-leading-snug)` |
375
+ | `--mat-sys-title-small-size` | `var(--juice-text-md)` |
376
+ | `--mat-sys-title-small-tracking` | `0` |
377
+ | `--mat-sys-title-small-weight` | `var(--juice-weight-medium)` |
378
+ | `--mat-sys-body-large` | `var(--juice-weight-regular) var(--juice-text-lg) / var(--juice-leading-normal) var(--juice-font-sans)` |
379
+ | `--mat-sys-body-large-font` | `var(--juice-font-sans)` |
380
+ | `--mat-sys-body-large-line-height` | `var(--juice-leading-normal)` |
381
+ | `--mat-sys-body-large-size` | `var(--juice-text-lg)` |
382
+ | `--mat-sys-body-large-tracking` | `0` |
383
+ | `--mat-sys-body-large-weight` | `var(--juice-weight-regular)` |
384
+ | `--mat-sys-body-medium` | `var(--juice-weight-regular) var(--juice-text-md) / var(--juice-leading-normal) var(--juice-font-sans)` |
385
+ | `--mat-sys-body-medium-font` | `var(--juice-font-sans)` |
386
+ | `--mat-sys-body-medium-line-height` | `var(--juice-leading-normal)` |
387
+ | `--mat-sys-body-medium-size` | `var(--juice-text-md)` |
388
+ | `--mat-sys-body-medium-tracking` | `0` |
389
+ | `--mat-sys-body-medium-weight` | `var(--juice-weight-regular)` |
390
+ | `--mat-sys-body-small` | `var(--juice-weight-regular) var(--juice-text-xs) / var(--juice-leading-normal) var(--juice-font-sans)` |
391
+ | `--mat-sys-body-small-font` | `var(--juice-font-sans)` |
392
+ | `--mat-sys-body-small-line-height` | `var(--juice-leading-normal)` |
393
+ | `--mat-sys-body-small-size` | `var(--juice-text-xs)` |
394
+ | `--mat-sys-body-small-tracking` | `0` |
395
+ | `--mat-sys-body-small-weight` | `var(--juice-weight-regular)` |
396
+ | `--mat-sys-label-large` | `var(--juice-weight-medium) var(--juice-text-md) / var(--juice-leading-snug) var(--juice-font-sans)` |
397
+ | `--mat-sys-label-large-font` | `var(--juice-font-sans)` |
398
+ | `--mat-sys-label-large-line-height` | `var(--juice-leading-snug)` |
399
+ | `--mat-sys-label-large-size` | `var(--juice-text-md)` |
400
+ | `--mat-sys-label-large-tracking` | `0` |
401
+ | `--mat-sys-label-large-weight` | `var(--juice-weight-medium)` |
402
+ | `--mat-sys-label-large-weight-prominent` | `var(--juice-weight-semibold)` |
403
+ | `--mat-sys-label-medium` | `var(--juice-weight-medium) var(--juice-text-xs) / var(--juice-leading-snug) var(--juice-font-sans)` |
404
+ | `--mat-sys-label-medium-font` | `var(--juice-font-sans)` |
405
+ | `--mat-sys-label-medium-line-height` | `var(--juice-leading-snug)` |
406
+ | `--mat-sys-label-medium-size` | `var(--juice-text-xs)` |
407
+ | `--mat-sys-label-medium-tracking` | `0` |
408
+ | `--mat-sys-label-medium-weight` | `var(--juice-weight-medium)` |
409
+ | `--mat-sys-label-medium-weight-prominent` | `var(--juice-weight-semibold)` |
410
+ | `--mat-sys-label-small` | `var(--juice-weight-medium) var(--juice-text-xs) / var(--juice-leading-snug) var(--juice-font-sans)` |
411
+ | `--mat-sys-label-small-font` | `var(--juice-font-sans)` |
412
+ | `--mat-sys-label-small-line-height` | `var(--juice-leading-snug)` |
413
+ | `--mat-sys-label-small-size` | `var(--juice-text-xs)` |
414
+ | `--mat-sys-label-small-tracking` | `0` |
415
+ | `--mat-sys-label-small-weight` | `var(--juice-weight-medium)` |
416
+
417
+ ## Tailwind (`@juice-js/design-tokens/tailwind`)
418
+
419
+ Inside `@theme inline`: `--color-<name>` for every Tier 2 colour, `--spacing: 4px` with `--spacing-<n>` per space token, `--radius-*`, `--font-sans`, `--font-mono`, `--text-*`, `--font-weight-*`, `--leading-*`, `--shadow-*` (`0..3`, `overlay`, and `xs..xl`), `--ease-*`: all `var(--juice-*)`.
package/README.md CHANGED
@@ -1,3 +1,54 @@
1
- # Temporary Holding Version
1
+ # @juice-js/design-tokens
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Material-free design tokens for the Juice UI platform: CSS custom properties, SCSS, a Material bridge and a Tailwind 4 theme. No runtime code, no dependencies.
4
+
5
+ ## Use
6
+
7
+ ```scss
8
+ // global styles
9
+ @use '@juice-js/design-tokens' as tokens;
10
+ @include tokens.css(); // every --juice-* token (or import '@juice-js/design-tokens/css' as plain CSS)
11
+ @include tokens.material-bridge(); // optional: --mat-sys-* from the tokens, so Material components follow them
12
+ ```
13
+
14
+ ```css
15
+ /* Tailwind 4 apps and Storybook */
16
+ @import 'tailwindcss';
17
+ @import '@juice-js/design-tokens/tailwind'; /* bg-surface p-4 rounded-md font-mono text-accent -> var(--juice-*) */
18
+ ```
19
+
20
+ Fonts are not bundled: add `@fontsource-variable/inter` and `@fontsource-variable/jetbrains-mono` to the app (self-hosted, no CDN).
21
+
22
+ ## Layers
23
+
24
+ - **Tier 1 raw:** `--juice-ref-{neutral|indigo|teal|violet|green|amber|red|blue}-{50..950}` and `--juice-ref-accent-*` (the active accent).
25
+ - **Tier 2 system:** `--juice-color-*` (light-dark() pairs, they follow `color-scheme`), `--juice-space-*`, `--juice-radius-*`, `--juice-shadow-*`, `--juice-duration-*`, `--juice-ease-*`, `--juice-font-*`, `--juice-text-*`, `--juice-leading-*`, `--juice-weight-*`, `--juice-control-height-*`, `--juice-z-*`.
26
+ - **Tier 3 component:** `--juice-{button,field,listbox,checkbox,badge,progress,sidebar,header,panel}-*`, each defaulting to a Tier 2 token. Components read these.
27
+ - **Compat:** the 2.x names (`--juice-bg`, `--juice-surface`, `--juice-text`, `--juice-muted`, `--juice-accent`, ...) and the Console scale `--jc-*`.
28
+
29
+ `MAPPING.md` lists every variable, its value, and where the old `--juice-*`, `--jc-*` and `--mat-sys-*` names went.
30
+
31
+ ## Attributes (set on `<html>` only)
32
+
33
+ | Attribute | Values | Default |
34
+ |---|---|---|
35
+ | `data-theme` | `light`, `dark` (also `body.dark` for the 2.x dark switch) | light |
36
+ | `data-accent` or `data-juice-palette` | `indigo`, `teal`, `violet` | indigo |
37
+ | `data-density` | `compact`, `default`, `comfortable` | default |
38
+
39
+ Values are case-sensitive (`Teal` does not match). An unknown value falls back to the default. In light mode the teal accent uses the lightest step that meets WCAG AA with white text (`#13806f`); `#25B9A7` is the brand swatch and the dark-mode accent.
40
+
41
+ Under `prefers-reduced-motion: reduce` every `--juice-duration-*` is `0ms`. Shadows use light-dark() colours, so they need no dark overrides.
42
+
43
+ ## Material bridge
44
+
45
+ `tokens.material-bridge()` only writes `--mat-sys-*` (colour, typography, shape, elevation, state layers) and never `@use`s Material. Include it after layout 2.x `theme()`: `:root` beats theme()'s `html`, and `:root[data-juice-palette]` beats its `[data-juice-palette]` blocks.
46
+
47
+ ## Build and test
48
+
49
+ ```
50
+ node projects/juice-js/design-tokens/build.mjs # writes dist/juice-js/design-tokens and regenerates MAPPING.md
51
+ node --test projects/juice-js/design-tokens/test/
52
+ ```
53
+
54
+ Token sources are in `src/tokens.mjs`; `src/generate.mjs` renders them.