@juice-js/design-tokens 3.0.0-alpha.2 → 3.0.0-alpha.3

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 CHANGED
@@ -22,9 +22,11 @@ Generated by `build.mjs`; do not edit. Layers: Tier 1 raw, Tier 2 system, Tier 3
22
22
  | `--juice-color-text-subtle` | `var(--juice-ref-neutral-500)` | `var(--juice-ref-neutral-400)` |
23
23
  | `--juice-color-text-on-accent` | `#ffffff` | `var(--juice-ref-neutral-950)` |
24
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)` |
25
+ | `--juice-color-accent-hover` | `var(--juice-ref-accent-700)` | `var(--juice-ref-accent-350)` |
26
+ | `--juice-color-accent-active` | `var(--juice-ref-accent-800)` | `var(--juice-ref-accent-450)` |
27
+ | `--juice-color-accent-hover-subtle` | `var(--juice-ref-accent-700)` | `var(--juice-ref-accent-350)` |
27
28
  | `--juice-color-accent-subtle` | `var(--juice-ref-accent-100)` | `var(--juice-ref-accent-950)` |
29
+ | `--juice-color-accent-emphasis` | `var(--juice-ref-accent-800)` | `var(--juice-ref-accent-200)` |
28
30
  | `--juice-color-focus-ring` | `var(--juice-ref-accent-600)` | `var(--juice-ref-accent-400)` |
29
31
  | `--juice-color-ok` | `var(--juice-ref-green-700)` | `var(--juice-ref-green-400)` |
30
32
  | `--juice-color-warn` | `var(--juice-ref-amber-700)` | `var(--juice-ref-amber-400)` |
@@ -39,6 +41,16 @@ Generated by `build.mjs`; do not edit. Layers: Tier 1 raw, Tier 2 system, Tier 3
39
41
  | `--juice-color-control-border` | `#8e8e97` | `#76767f` |
40
42
  | `--juice-color-disabled-fill` | `var(--juice-ref-neutral-400)` | `var(--juice-ref-neutral-600)` |
41
43
  | `--juice-color-disabled-on-fill` | `#ffffff` | `var(--juice-ref-neutral-300)` |
44
+ | `--juice-color-control-hover-bg` | `var(--juice-ref-neutral-100)` | `var(--juice-ref-neutral-800)` |
45
+ | `--juice-color-control-active-bg` | `var(--juice-ref-neutral-200)` | `var(--juice-ref-neutral-700)` |
46
+ | `--juice-color-control-border-hover` | `var(--juice-ref-neutral-500)` | `var(--juice-ref-neutral-400)` |
47
+ | `--juice-color-bad-hover` | `var(--juice-ref-red-800)` | `#fa8b8b` |
48
+ | `--juice-color-bad-active` | `var(--juice-ref-red-900)` | `#f45b5b` |
49
+ | `--juice-color-focus-halo` | `var(--juice-ref-accent-200)` | `var(--juice-ref-accent-900)` |
50
+ | `--juice-color-bad-halo` | `var(--juice-ref-red-200)` | `var(--juice-ref-red-900)` |
51
+ | `--juice-color-warn-halo` | `var(--juice-ref-amber-200)` | `var(--juice-ref-amber-900)` |
52
+ | `--juice-color-ok-halo` | `var(--juice-ref-green-200)` | `var(--juice-ref-green-900)` |
53
+ | `--juice-color-item-hover` | `var(--juice-ref-neutral-100)` | `var(--juice-ref-neutral-700)` |
42
54
  | `--juice-shadow-color` | `rgb(9 9 11 / 0.1)` | `rgb(0 0 0 / 0.5)` |
43
55
  | `--juice-shadow-ring` | `rgb(9 9 11 / 0.06)` | `rgb(255 255 255 / 0.08)` |
44
56
 
@@ -113,12 +125,17 @@ Generated by `build.mjs`; do not edit. Layers: Tier 1 raw, Tier 2 system, Tier 3
113
125
  | `--juice-button-active-bg` | `var(--juice-color-accent-active)` |
114
126
  | `--juice-button-secondary-bg` | `var(--juice-color-surface)` |
115
127
  | `--juice-button-secondary-fg` | `var(--juice-color-text)` |
116
- | `--juice-button-secondary-border` | `var(--juice-color-border-strong)` |
117
- | `--juice-button-secondary-hover-bg` | `var(--juice-color-surface-sunken)` |
128
+ | `--juice-button-secondary-border` | `var(--juice-color-control-border)` |
129
+ | `--juice-button-secondary-hover-bg` | `var(--juice-color-control-hover-bg)` |
130
+ | `--juice-button-secondary-hover-border` | `var(--juice-color-control-border-hover)` |
131
+ | `--juice-button-secondary-active-bg` | `var(--juice-color-control-active-bg)` |
118
132
  | `--juice-button-ghost-fg` | `var(--juice-color-text)` |
119
- | `--juice-button-ghost-hover-bg` | `var(--juice-color-surface-sunken)` |
133
+ | `--juice-button-ghost-hover-bg` | `var(--juice-color-control-hover-bg)` |
134
+ | `--juice-button-ghost-active-bg` | `var(--juice-color-control-active-bg)` |
120
135
  | `--juice-button-danger-bg` | `var(--juice-color-bad)` |
121
136
  | `--juice-button-danger-fg` | `var(--juice-color-text-on-accent)` |
137
+ | `--juice-button-danger-hover-bg` | `var(--juice-color-bad-hover)` |
138
+ | `--juice-button-danger-active-bg` | `var(--juice-color-bad-active)` |
122
139
  | `--juice-button-disabled-bg` | `var(--juice-color-disabled-bg)` |
123
140
  | `--juice-button-disabled-fg` | `var(--juice-color-disabled-text)` |
124
141
  | `--juice-button-radius` | `var(--juice-radius-md)` |
@@ -127,39 +144,70 @@ Generated by `build.mjs`; do not edit. Layers: Tier 1 raw, Tier 2 system, Tier 3
127
144
  | `--juice-button-focus-ring` | `var(--juice-color-focus-ring)` |
128
145
  | `--juice-field-bg` | `var(--juice-color-surface)` |
129
146
  | `--juice-field-fg` | `var(--juice-color-text)` |
130
- | `--juice-field-border` | `var(--juice-color-border-strong)` |
131
- | `--juice-field-border-hover` | `var(--juice-color-text-subtle)` |
132
- | `--juice-field-border-focus` | `var(--juice-color-focus-ring)` |
147
+ | `--juice-field-border` | `var(--juice-color-control-border)` |
148
+ | `--juice-field-border-hover` | `var(--juice-color-control-border-hover)` |
149
+ | `--juice-field-border-focus` | `var(--juice-color-accent)` |
150
+ | `--juice-field-focus-halo` | `var(--juice-color-focus-halo)` |
133
151
  | `--juice-field-placeholder` | `var(--juice-color-text-subtle)` |
152
+ | `--juice-field-readonly-bg` | `var(--juice-color-bg)` |
153
+ | `--juice-field-readonly-border` | `var(--juice-color-border)` |
154
+ | `--juice-field-disabled-bg` | `var(--juice-color-disabled-bg)` |
155
+ | `--juice-field-disabled-border` | `var(--juice-color-border)` |
156
+ | `--juice-field-disabled-fg` | `var(--juice-color-disabled-text)` |
134
157
  | `--juice-field-label` | `var(--juice-color-text)` |
135
158
  | `--juice-field-hint` | `var(--juice-color-text-muted)` |
136
159
  | `--juice-field-error` | `var(--juice-color-bad)` |
137
- | `--juice-field-disabled-bg` | `var(--juice-color-disabled-bg)` |
138
- | `--juice-field-disabled-fg` | `var(--juice-color-disabled-text)` |
160
+ | `--juice-field-warning` | `var(--juice-color-warn)` |
161
+ | `--juice-field-success` | `var(--juice-color-ok)` |
162
+ | `--juice-field-error-halo` | `var(--juice-color-bad-halo)` |
163
+ | `--juice-field-warning-halo` | `var(--juice-color-warn-halo)` |
164
+ | `--juice-field-success-halo` | `var(--juice-color-ok-halo)` |
165
+ | `--juice-field-counter-fg` | `var(--juice-color-text-subtle)` |
139
166
  | `--juice-field-radius` | `var(--juice-radius-md)` |
140
167
  | `--juice-field-height` | `var(--juice-control-height-md)` |
141
168
  | `--juice-field-padding-x` | `var(--juice-control-padding-x)` |
169
+ | `--juice-field-textarea-padding-y` | `6px` |
170
+ | `--juice-field-textarea-min-height` | `5rem` |
171
+ | `--juice-field-font-size` | `var(--juice-text-md)` |
172
+ | `--juice-field-line-height` | `1.25rem` |
173
+ | `--juice-field-label-font-size` | `var(--juice-text-sm)` |
174
+ | `--juice-field-label-font-weight` | `var(--juice-weight-medium)` |
175
+ | `--juice-field-message-font-size` | `var(--juice-text-xs)` |
176
+ | `--juice-field-message-line-height` | `1rem` |
177
+ | `--juice-field-label-gap` | `var(--juice-space-2)` |
178
+ | `--juice-field-message-gap` | `var(--juice-space-2)` |
142
179
  | `--juice-field-gap` | `var(--juice-density-gap)` |
180
+ | `--juice-field-stack-gap` | `var(--juice-space-5)` |
181
+ | `--juice-field-duration` | `var(--juice-duration-fast)` |
182
+ | `--juice-field-ease` | `var(--juice-ease-standard)` |
143
183
  | `--juice-listbox-bg` | `var(--juice-color-surface-raised)` |
144
184
  | `--juice-listbox-fg` | `var(--juice-color-text)` |
145
185
  | `--juice-listbox-border` | `var(--juice-color-border)` |
146
- | `--juice-listbox-shadow` | `var(--juice-shadow-overlay)` |
186
+ | `--juice-listbox-shadow` | `var(--juice-shadow-3)` |
147
187
  | `--juice-listbox-radius` | `var(--juice-radius-lg)` |
148
- | `--juice-listbox-option-hover-bg` | `var(--juice-color-surface-sunken)` |
149
- | `--juice-listbox-option-active-bg` | `var(--juice-color-surface-sunken)` |
150
- | `--juice-listbox-option-selected-bg` | `var(--juice-color-accent-subtle)` |
188
+ | `--juice-listbox-padding` | `var(--juice-space-1)` |
189
+ | `--juice-listbox-offset` | `var(--juice-space-1)` |
190
+ | `--juice-listbox-max-height` | `18rem` |
191
+ | `--juice-listbox-option-hover-bg` | `var(--juice-color-item-hover)` |
192
+ | `--juice-listbox-option-active-bg` | `var(--juice-color-item-hover)` |
193
+ | `--juice-listbox-option-selected-bg` | `transparent` |
151
194
  | `--juice-listbox-option-selected-fg` | `var(--juice-color-text)` |
195
+ | `--juice-listbox-option-check` | `var(--juice-color-accent)` |
152
196
  | `--juice-listbox-option-disabled-fg` | `var(--juice-color-disabled-text)` |
153
197
  | `--juice-listbox-option-height` | `var(--juice-control-height-md)` |
198
+ | `--juice-listbox-option-padding-x` | `var(--juice-space-2)` |
199
+ | `--juice-listbox-option-radius` | `var(--juice-radius-sm)` |
200
+ | `--juice-listbox-option-gap` | `var(--juice-space-2)` |
201
+ | `--juice-listbox-chevron` | `var(--juice-color-text-subtle)` |
154
202
  | `--juice-listbox-z` | `var(--juice-z-dropdown)` |
155
203
  | `--juice-checkbox-size` | `var(--juice-space-4)` |
156
204
  | `--juice-checkbox-radius` | `var(--juice-radius-sm)` |
157
205
  | `--juice-checkbox-bg` | `var(--juice-color-surface)` |
158
206
  | `--juice-checkbox-border` | `var(--juice-color-control-border)` |
159
- | `--juice-checkbox-hover-border` | `var(--juice-color-text-subtle)` |
160
- | `--juice-checkbox-active-bg` | `var(--juice-color-surface-sunken)` |
207
+ | `--juice-checkbox-hover-border` | `var(--juice-color-control-border-hover)` |
208
+ | `--juice-checkbox-active-bg` | `var(--juice-color-control-active-bg)` |
161
209
  | `--juice-checkbox-checked-bg` | `var(--juice-color-accent)` |
162
- | `--juice-checkbox-checked-hover-bg` | `var(--juice-color-accent-hover)` |
210
+ | `--juice-checkbox-checked-hover-bg` | `var(--juice-color-accent-hover-subtle)` |
163
211
  | `--juice-checkbox-checked-active-bg` | `var(--juice-color-accent-active)` |
164
212
  | `--juice-checkbox-checked-fg` | `var(--juice-color-text-on-accent)` |
165
213
  | `--juice-checkbox-disabled-bg` | `var(--juice-color-disabled-bg)` |
@@ -182,7 +230,7 @@ Generated by `build.mjs`; do not edit. Layers: Tier 1 raw, Tier 2 system, Tier 3
182
230
  | `--juice-badge-neutral-bg` | `var(--juice-color-surface-sunken)` |
183
231
  | `--juice-badge-neutral-fg` | `var(--juice-color-text-muted)` |
184
232
  | `--juice-badge-accent-bg` | `var(--juice-color-accent-subtle)` |
185
- | `--juice-badge-accent-fg` | `var(--juice-color-accent-active)` |
233
+ | `--juice-badge-accent-fg` | `var(--juice-color-accent-emphasis)` |
186
234
  | `--juice-badge-ok-bg` | `var(--juice-color-ok-subtle)` |
187
235
  | `--juice-badge-ok-fg` | `var(--juice-color-ok)` |
188
236
  | `--juice-badge-warn-bg` | `var(--juice-color-warn-subtle)` |
package/README.md CHANGED
@@ -40,6 +40,39 @@ Values are case-sensitive (`Teal` does not match). An unknown value falls back t
40
40
 
41
41
  Under `prefers-reduced-motion: reduce` every `--juice-duration-*` is `0ms`. Shadows use light-dark() colours, so they need no dark overrides.
42
42
 
43
+ ## Interaction tokens
44
+
45
+ One rule per kind of control, not one colour shift everywhere. Every pair below is checked by the contrast tests in all
46
+ three accents and both themes, and shown live with its measured ratio in Storybook (Foundations / Interaction).
47
+
48
+ | Control | Rest | Hover | Pressed | Focus | Disabled |
49
+ |---|---|---|---|---|---|
50
+ | Filled (primary, danger) | `accent` / `bad` | `accent-hover` / `bad-hover` | `accent-active` / `bad-active` | `focus-ring`, 2px, 2px out | `disabled-bg`, `disabled-text` |
51
+ | Outlined (secondary) | `surface`, `control-border` | `control-hover-bg`, `control-border-hover` | `control-active-bg` | `focus-ring` | `disabled-bg` |
52
+ | Ghost, icon button | transparent | `control-hover-bg` | `control-active-bg` | `focus-ring` | `disabled-text` |
53
+ | Checkbox, checked | `accent` | `accent-hover-subtle` | `accent-active` | `focus-ring` | `disabled-fill` + `disabled-on-fill` |
54
+ | Checkbox, unchecked | `control-border` | `control-border-hover` | `control-active-bg` | `focus-ring` | `disabled-bg`, `border` |
55
+ | Input, select trigger | `control-border` | `control-border-hover` (neutral) | none | `accent` edge + `focus-halo` | `disabled-bg`, `border` |
56
+ | List option | transparent | `item-hover` (neutral) | selects | keyboard highlight = `item-hover` | `disabled-text` |
57
+
58
+ Values, light then dark (`a` is the active accent ramp, `n` neutral):
59
+
60
+ | Token | Light | Dark | Why |
61
+ |---|---|---|---|
62
+ | `accent` | a600 | a400 | rest |
63
+ | `accent-hover` | a700 | a350 | light deepens; dark lightens by a half step, so hover gains prominence without glare |
64
+ | `accent-active` | a800 | a450 | press always deepens; a full 500 behind dark text fails AA for indigo (4.3:1), the half step keeps 5.5:1 |
65
+ | `accent-hover-subtle` | a700 | a350 | small marks (checkbox); its own token so it can stay quieter than a button |
66
+ | `accent-emphasis` | a800 | a200 | accent text on `accent-subtle` (badges); never used as a press colour |
67
+ | `bad-hover` / `bad-active` | red800 / red900 | red 350 / red 450 | danger follows the accent rule |
68
+ | `control-hover-bg` / `control-active-bg` | n100 / n200 | n800 / n700 | one neutral surface step per state |
69
+ | `control-border` / `control-border-hover` | #8e8e97 / n500 | #76767f / n400 | 3:1 edge at rest; hover moves toward the text |
70
+ | `item-hover` | n100 | n700 | neutral, so it never competes with the selected check |
71
+ | `focus-ring` / `focus-halo` | a600 / a200 | a400 / a900 | focus is shown by the ring (or accent edge + halo on fields), independent of hover |
72
+
73
+ The 350 and 450 half steps exist for the accent ramps only (`--juice-ref-accent-350`, `--juice-ref-accent-450`), mixed
74
+ evenly from the neighbouring steps.
75
+
43
76
  ## Material bridge
44
77
 
45
78
  `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.
package/css/juice.css CHANGED
@@ -102,6 +102,8 @@
102
102
  --juice-ref-accent-800: var(--juice-ref-indigo-800);
103
103
  --juice-ref-accent-900: var(--juice-ref-indigo-900);
104
104
  --juice-ref-accent-950: var(--juice-ref-indigo-950);
105
+ --juice-ref-accent-350: #93a0fa;
106
+ --juice-ref-accent-450: #7279f5;
105
107
  /* Tier 2: colours, light-dark() pairs that follow color-scheme */
106
108
  --juice-color-bg: light-dark(var(--juice-ref-neutral-50), var(--juice-ref-neutral-950));
107
109
  --juice-color-surface: light-dark(#ffffff, var(--juice-ref-neutral-900));
@@ -115,9 +117,11 @@
115
117
  --juice-color-text-subtle: light-dark(var(--juice-ref-neutral-500), var(--juice-ref-neutral-400));
116
118
  --juice-color-text-on-accent: light-dark(#ffffff, var(--juice-ref-neutral-950));
117
119
  --juice-color-accent: light-dark(var(--juice-ref-accent-600), var(--juice-ref-accent-400));
118
- --juice-color-accent-hover: light-dark(var(--juice-ref-accent-700), var(--juice-ref-accent-300));
119
- --juice-color-accent-active: light-dark(var(--juice-ref-accent-800), var(--juice-ref-accent-200));
120
+ --juice-color-accent-hover: light-dark(var(--juice-ref-accent-700), var(--juice-ref-accent-350));
121
+ --juice-color-accent-active: light-dark(var(--juice-ref-accent-800), var(--juice-ref-accent-450));
122
+ --juice-color-accent-hover-subtle: light-dark(var(--juice-ref-accent-700), var(--juice-ref-accent-350));
120
123
  --juice-color-accent-subtle: light-dark(var(--juice-ref-accent-100), var(--juice-ref-accent-950));
124
+ --juice-color-accent-emphasis: light-dark(var(--juice-ref-accent-800), var(--juice-ref-accent-200));
121
125
  --juice-color-focus-ring: light-dark(var(--juice-ref-accent-600), var(--juice-ref-accent-400));
122
126
  --juice-color-ok: light-dark(var(--juice-ref-green-700), var(--juice-ref-green-400));
123
127
  --juice-color-warn: light-dark(var(--juice-ref-amber-700), var(--juice-ref-amber-400));
@@ -132,6 +136,16 @@
132
136
  --juice-color-control-border: light-dark(#8e8e97, #76767f);
133
137
  --juice-color-disabled-fill: light-dark(var(--juice-ref-neutral-400), var(--juice-ref-neutral-600));
134
138
  --juice-color-disabled-on-fill: light-dark(#ffffff, var(--juice-ref-neutral-300));
139
+ --juice-color-control-hover-bg: light-dark(var(--juice-ref-neutral-100), var(--juice-ref-neutral-800));
140
+ --juice-color-control-active-bg: light-dark(var(--juice-ref-neutral-200), var(--juice-ref-neutral-700));
141
+ --juice-color-control-border-hover: light-dark(var(--juice-ref-neutral-500), var(--juice-ref-neutral-400));
142
+ --juice-color-bad-hover: light-dark(var(--juice-ref-red-800), #fa8b8b);
143
+ --juice-color-bad-active: light-dark(var(--juice-ref-red-900), #f45b5b);
144
+ --juice-color-focus-halo: light-dark(var(--juice-ref-accent-200), var(--juice-ref-accent-900));
145
+ --juice-color-bad-halo: light-dark(var(--juice-ref-red-200), var(--juice-ref-red-900));
146
+ --juice-color-warn-halo: light-dark(var(--juice-ref-amber-200), var(--juice-ref-amber-900));
147
+ --juice-color-ok-halo: light-dark(var(--juice-ref-green-200), var(--juice-ref-green-900));
148
+ --juice-color-item-hover: light-dark(var(--juice-ref-neutral-100), var(--juice-ref-neutral-700));
135
149
  --juice-shadow-color: light-dark(rgb(9 9 11 / 0.1), rgb(0 0 0 / 0.5));
136
150
  --juice-shadow-ring: light-dark(rgb(9 9 11 / 0.06), rgb(255 255 255 / 0.08));
137
151
  /* Tier 2: space, radius, shadow, motion, type, layers */
@@ -196,12 +210,17 @@
196
210
  --juice-button-active-bg: var(--juice-color-accent-active);
197
211
  --juice-button-secondary-bg: var(--juice-color-surface);
198
212
  --juice-button-secondary-fg: var(--juice-color-text);
199
- --juice-button-secondary-border: var(--juice-color-border-strong);
200
- --juice-button-secondary-hover-bg: var(--juice-color-surface-sunken);
213
+ --juice-button-secondary-border: var(--juice-color-control-border);
214
+ --juice-button-secondary-hover-bg: var(--juice-color-control-hover-bg);
215
+ --juice-button-secondary-hover-border: var(--juice-color-control-border-hover);
216
+ --juice-button-secondary-active-bg: var(--juice-color-control-active-bg);
201
217
  --juice-button-ghost-fg: var(--juice-color-text);
202
- --juice-button-ghost-hover-bg: var(--juice-color-surface-sunken);
218
+ --juice-button-ghost-hover-bg: var(--juice-color-control-hover-bg);
219
+ --juice-button-ghost-active-bg: var(--juice-color-control-active-bg);
203
220
  --juice-button-danger-bg: var(--juice-color-bad);
204
221
  --juice-button-danger-fg: var(--juice-color-text-on-accent);
222
+ --juice-button-danger-hover-bg: var(--juice-color-bad-hover);
223
+ --juice-button-danger-active-bg: var(--juice-color-bad-active);
205
224
  --juice-button-disabled-bg: var(--juice-color-disabled-bg);
206
225
  --juice-button-disabled-fg: var(--juice-color-disabled-text);
207
226
  --juice-button-radius: var(--juice-radius-md);
@@ -210,39 +229,70 @@
210
229
  --juice-button-focus-ring: var(--juice-color-focus-ring);
211
230
  --juice-field-bg: var(--juice-color-surface);
212
231
  --juice-field-fg: var(--juice-color-text);
213
- --juice-field-border: var(--juice-color-border-strong);
214
- --juice-field-border-hover: var(--juice-color-text-subtle);
215
- --juice-field-border-focus: var(--juice-color-focus-ring);
232
+ --juice-field-border: var(--juice-color-control-border);
233
+ --juice-field-border-hover: var(--juice-color-control-border-hover);
234
+ --juice-field-border-focus: var(--juice-color-accent);
235
+ --juice-field-focus-halo: var(--juice-color-focus-halo);
216
236
  --juice-field-placeholder: var(--juice-color-text-subtle);
237
+ --juice-field-readonly-bg: var(--juice-color-bg);
238
+ --juice-field-readonly-border: var(--juice-color-border);
239
+ --juice-field-disabled-bg: var(--juice-color-disabled-bg);
240
+ --juice-field-disabled-border: var(--juice-color-border);
241
+ --juice-field-disabled-fg: var(--juice-color-disabled-text);
217
242
  --juice-field-label: var(--juice-color-text);
218
243
  --juice-field-hint: var(--juice-color-text-muted);
219
244
  --juice-field-error: var(--juice-color-bad);
220
- --juice-field-disabled-bg: var(--juice-color-disabled-bg);
221
- --juice-field-disabled-fg: var(--juice-color-disabled-text);
245
+ --juice-field-warning: var(--juice-color-warn);
246
+ --juice-field-success: var(--juice-color-ok);
247
+ --juice-field-error-halo: var(--juice-color-bad-halo);
248
+ --juice-field-warning-halo: var(--juice-color-warn-halo);
249
+ --juice-field-success-halo: var(--juice-color-ok-halo);
250
+ --juice-field-counter-fg: var(--juice-color-text-subtle);
222
251
  --juice-field-radius: var(--juice-radius-md);
223
252
  --juice-field-height: var(--juice-control-height-md);
224
253
  --juice-field-padding-x: var(--juice-control-padding-x);
254
+ --juice-field-textarea-padding-y: 6px;
255
+ --juice-field-textarea-min-height: 5rem;
256
+ --juice-field-font-size: var(--juice-text-md);
257
+ --juice-field-line-height: 1.25rem;
258
+ --juice-field-label-font-size: var(--juice-text-sm);
259
+ --juice-field-label-font-weight: var(--juice-weight-medium);
260
+ --juice-field-message-font-size: var(--juice-text-xs);
261
+ --juice-field-message-line-height: 1rem;
262
+ --juice-field-label-gap: var(--juice-space-2);
263
+ --juice-field-message-gap: var(--juice-space-2);
225
264
  --juice-field-gap: var(--juice-density-gap);
265
+ --juice-field-stack-gap: var(--juice-space-5);
266
+ --juice-field-duration: var(--juice-duration-fast);
267
+ --juice-field-ease: var(--juice-ease-standard);
226
268
  --juice-listbox-bg: var(--juice-color-surface-raised);
227
269
  --juice-listbox-fg: var(--juice-color-text);
228
270
  --juice-listbox-border: var(--juice-color-border);
229
- --juice-listbox-shadow: var(--juice-shadow-overlay);
271
+ --juice-listbox-shadow: var(--juice-shadow-3);
230
272
  --juice-listbox-radius: var(--juice-radius-lg);
231
- --juice-listbox-option-hover-bg: var(--juice-color-surface-sunken);
232
- --juice-listbox-option-active-bg: var(--juice-color-surface-sunken);
233
- --juice-listbox-option-selected-bg: var(--juice-color-accent-subtle);
273
+ --juice-listbox-padding: var(--juice-space-1);
274
+ --juice-listbox-offset: var(--juice-space-1);
275
+ --juice-listbox-max-height: 18rem;
276
+ --juice-listbox-option-hover-bg: var(--juice-color-item-hover);
277
+ --juice-listbox-option-active-bg: var(--juice-color-item-hover);
278
+ --juice-listbox-option-selected-bg: transparent;
234
279
  --juice-listbox-option-selected-fg: var(--juice-color-text);
280
+ --juice-listbox-option-check: var(--juice-color-accent);
235
281
  --juice-listbox-option-disabled-fg: var(--juice-color-disabled-text);
236
282
  --juice-listbox-option-height: var(--juice-control-height-md);
283
+ --juice-listbox-option-padding-x: var(--juice-space-2);
284
+ --juice-listbox-option-radius: var(--juice-radius-sm);
285
+ --juice-listbox-option-gap: var(--juice-space-2);
286
+ --juice-listbox-chevron: var(--juice-color-text-subtle);
237
287
  --juice-listbox-z: var(--juice-z-dropdown);
238
288
  --juice-checkbox-size: var(--juice-space-4);
239
289
  --juice-checkbox-radius: var(--juice-radius-sm);
240
290
  --juice-checkbox-bg: var(--juice-color-surface);
241
291
  --juice-checkbox-border: var(--juice-color-control-border);
242
- --juice-checkbox-hover-border: var(--juice-color-text-subtle);
243
- --juice-checkbox-active-bg: var(--juice-color-surface-sunken);
292
+ --juice-checkbox-hover-border: var(--juice-color-control-border-hover);
293
+ --juice-checkbox-active-bg: var(--juice-color-control-active-bg);
244
294
  --juice-checkbox-checked-bg: var(--juice-color-accent);
245
- --juice-checkbox-checked-hover-bg: var(--juice-color-accent-hover);
295
+ --juice-checkbox-checked-hover-bg: var(--juice-color-accent-hover-subtle);
246
296
  --juice-checkbox-checked-active-bg: var(--juice-color-accent-active);
247
297
  --juice-checkbox-checked-fg: var(--juice-color-text-on-accent);
248
298
  --juice-checkbox-disabled-bg: var(--juice-color-disabled-bg);
@@ -265,7 +315,7 @@
265
315
  --juice-badge-neutral-bg: var(--juice-color-surface-sunken);
266
316
  --juice-badge-neutral-fg: var(--juice-color-text-muted);
267
317
  --juice-badge-accent-bg: var(--juice-color-accent-subtle);
268
- --juice-badge-accent-fg: var(--juice-color-accent-active);
318
+ --juice-badge-accent-fg: var(--juice-color-accent-emphasis);
269
319
  --juice-badge-ok-bg: var(--juice-color-ok-subtle);
270
320
  --juice-badge-ok-fg: var(--juice-color-ok);
271
321
  --juice-badge-warn-bg: var(--juice-color-warn-subtle);
@@ -342,6 +392,8 @@ body.dark {
342
392
  --juice-ref-accent-800: var(--juice-ref-teal-800);
343
393
  --juice-ref-accent-900: var(--juice-ref-teal-900);
344
394
  --juice-ref-accent-950: var(--juice-ref-teal-950);
395
+ --juice-ref-accent-350: #48cbba;
396
+ --juice-ref-accent-450: #20aa99;
345
397
  }
346
398
  :root[data-accent="violet"],
347
399
  :root[data-juice-palette="violet"] {
@@ -356,6 +408,8 @@ body.dark {
356
408
  --juice-ref-accent-800: var(--juice-ref-violet-800);
357
409
  --juice-ref-accent-900: var(--juice-ref-violet-900);
358
410
  --juice-ref-accent-950: var(--juice-ref-violet-950);
411
+ --juice-ref-accent-350: #b6a0fc;
412
+ --juice-ref-accent-450: #9974f8;
359
413
  }
360
414
  :root[data-accent="indigo"],
361
415
  :root[data-juice-palette="indigo"] {
@@ -370,6 +424,8 @@ body.dark {
370
424
  --juice-ref-accent-800: var(--juice-ref-indigo-800);
371
425
  --juice-ref-accent-900: var(--juice-ref-indigo-900);
372
426
  --juice-ref-accent-950: var(--juice-ref-indigo-950);
427
+ --juice-ref-accent-350: #93a0fa;
428
+ --juice-ref-accent-450: #7279f5;
373
429
  }
374
430
  :root[data-density="compact"] {
375
431
  --juice-control-height-sm: 1.5rem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juice-js/design-tokens",
3
- "version": "3.0.0-alpha.2",
3
+ "version": "3.0.0-alpha.3",
4
4
  "description": "Juice design tokens: CSS custom properties, SCSS, Material bridge and Tailwind theme",
5
5
  "author": "Pavellis Labs <dev@pavellis.com>",
6
6
  "license": "MIT",
package/scss/_tokens.scss CHANGED
@@ -103,6 +103,8 @@
103
103
  --juice-ref-accent-800: var(--juice-ref-indigo-800);
104
104
  --juice-ref-accent-900: var(--juice-ref-indigo-900);
105
105
  --juice-ref-accent-950: var(--juice-ref-indigo-950);
106
+ --juice-ref-accent-350: #93a0fa;
107
+ --juice-ref-accent-450: #7279f5;
106
108
  /* Tier 2: colours, light-dark() pairs that follow color-scheme */
107
109
  --juice-color-bg: light-dark(var(--juice-ref-neutral-50), var(--juice-ref-neutral-950));
108
110
  --juice-color-surface: light-dark(#ffffff, var(--juice-ref-neutral-900));
@@ -116,9 +118,11 @@
116
118
  --juice-color-text-subtle: light-dark(var(--juice-ref-neutral-500), var(--juice-ref-neutral-400));
117
119
  --juice-color-text-on-accent: light-dark(#ffffff, var(--juice-ref-neutral-950));
118
120
  --juice-color-accent: light-dark(var(--juice-ref-accent-600), var(--juice-ref-accent-400));
119
- --juice-color-accent-hover: light-dark(var(--juice-ref-accent-700), var(--juice-ref-accent-300));
120
- --juice-color-accent-active: light-dark(var(--juice-ref-accent-800), var(--juice-ref-accent-200));
121
+ --juice-color-accent-hover: light-dark(var(--juice-ref-accent-700), var(--juice-ref-accent-350));
122
+ --juice-color-accent-active: light-dark(var(--juice-ref-accent-800), var(--juice-ref-accent-450));
123
+ --juice-color-accent-hover-subtle: light-dark(var(--juice-ref-accent-700), var(--juice-ref-accent-350));
121
124
  --juice-color-accent-subtle: light-dark(var(--juice-ref-accent-100), var(--juice-ref-accent-950));
125
+ --juice-color-accent-emphasis: light-dark(var(--juice-ref-accent-800), var(--juice-ref-accent-200));
122
126
  --juice-color-focus-ring: light-dark(var(--juice-ref-accent-600), var(--juice-ref-accent-400));
123
127
  --juice-color-ok: light-dark(var(--juice-ref-green-700), var(--juice-ref-green-400));
124
128
  --juice-color-warn: light-dark(var(--juice-ref-amber-700), var(--juice-ref-amber-400));
@@ -133,6 +137,16 @@
133
137
  --juice-color-control-border: light-dark(#8e8e97, #76767f);
134
138
  --juice-color-disabled-fill: light-dark(var(--juice-ref-neutral-400), var(--juice-ref-neutral-600));
135
139
  --juice-color-disabled-on-fill: light-dark(#ffffff, var(--juice-ref-neutral-300));
140
+ --juice-color-control-hover-bg: light-dark(var(--juice-ref-neutral-100), var(--juice-ref-neutral-800));
141
+ --juice-color-control-active-bg: light-dark(var(--juice-ref-neutral-200), var(--juice-ref-neutral-700));
142
+ --juice-color-control-border-hover: light-dark(var(--juice-ref-neutral-500), var(--juice-ref-neutral-400));
143
+ --juice-color-bad-hover: light-dark(var(--juice-ref-red-800), #fa8b8b);
144
+ --juice-color-bad-active: light-dark(var(--juice-ref-red-900), #f45b5b);
145
+ --juice-color-focus-halo: light-dark(var(--juice-ref-accent-200), var(--juice-ref-accent-900));
146
+ --juice-color-bad-halo: light-dark(var(--juice-ref-red-200), var(--juice-ref-red-900));
147
+ --juice-color-warn-halo: light-dark(var(--juice-ref-amber-200), var(--juice-ref-amber-900));
148
+ --juice-color-ok-halo: light-dark(var(--juice-ref-green-200), var(--juice-ref-green-900));
149
+ --juice-color-item-hover: light-dark(var(--juice-ref-neutral-100), var(--juice-ref-neutral-700));
136
150
  --juice-shadow-color: light-dark(rgb(9 9 11 / 0.1), rgb(0 0 0 / 0.5));
137
151
  --juice-shadow-ring: light-dark(rgb(9 9 11 / 0.06), rgb(255 255 255 / 0.08));
138
152
  /* Tier 2: space, radius, shadow, motion, type, layers */
@@ -197,12 +211,17 @@
197
211
  --juice-button-active-bg: var(--juice-color-accent-active);
198
212
  --juice-button-secondary-bg: var(--juice-color-surface);
199
213
  --juice-button-secondary-fg: var(--juice-color-text);
200
- --juice-button-secondary-border: var(--juice-color-border-strong);
201
- --juice-button-secondary-hover-bg: var(--juice-color-surface-sunken);
214
+ --juice-button-secondary-border: var(--juice-color-control-border);
215
+ --juice-button-secondary-hover-bg: var(--juice-color-control-hover-bg);
216
+ --juice-button-secondary-hover-border: var(--juice-color-control-border-hover);
217
+ --juice-button-secondary-active-bg: var(--juice-color-control-active-bg);
202
218
  --juice-button-ghost-fg: var(--juice-color-text);
203
- --juice-button-ghost-hover-bg: var(--juice-color-surface-sunken);
219
+ --juice-button-ghost-hover-bg: var(--juice-color-control-hover-bg);
220
+ --juice-button-ghost-active-bg: var(--juice-color-control-active-bg);
204
221
  --juice-button-danger-bg: var(--juice-color-bad);
205
222
  --juice-button-danger-fg: var(--juice-color-text-on-accent);
223
+ --juice-button-danger-hover-bg: var(--juice-color-bad-hover);
224
+ --juice-button-danger-active-bg: var(--juice-color-bad-active);
206
225
  --juice-button-disabled-bg: var(--juice-color-disabled-bg);
207
226
  --juice-button-disabled-fg: var(--juice-color-disabled-text);
208
227
  --juice-button-radius: var(--juice-radius-md);
@@ -211,39 +230,70 @@
211
230
  --juice-button-focus-ring: var(--juice-color-focus-ring);
212
231
  --juice-field-bg: var(--juice-color-surface);
213
232
  --juice-field-fg: var(--juice-color-text);
214
- --juice-field-border: var(--juice-color-border-strong);
215
- --juice-field-border-hover: var(--juice-color-text-subtle);
216
- --juice-field-border-focus: var(--juice-color-focus-ring);
233
+ --juice-field-border: var(--juice-color-control-border);
234
+ --juice-field-border-hover: var(--juice-color-control-border-hover);
235
+ --juice-field-border-focus: var(--juice-color-accent);
236
+ --juice-field-focus-halo: var(--juice-color-focus-halo);
217
237
  --juice-field-placeholder: var(--juice-color-text-subtle);
238
+ --juice-field-readonly-bg: var(--juice-color-bg);
239
+ --juice-field-readonly-border: var(--juice-color-border);
240
+ --juice-field-disabled-bg: var(--juice-color-disabled-bg);
241
+ --juice-field-disabled-border: var(--juice-color-border);
242
+ --juice-field-disabled-fg: var(--juice-color-disabled-text);
218
243
  --juice-field-label: var(--juice-color-text);
219
244
  --juice-field-hint: var(--juice-color-text-muted);
220
245
  --juice-field-error: var(--juice-color-bad);
221
- --juice-field-disabled-bg: var(--juice-color-disabled-bg);
222
- --juice-field-disabled-fg: var(--juice-color-disabled-text);
246
+ --juice-field-warning: var(--juice-color-warn);
247
+ --juice-field-success: var(--juice-color-ok);
248
+ --juice-field-error-halo: var(--juice-color-bad-halo);
249
+ --juice-field-warning-halo: var(--juice-color-warn-halo);
250
+ --juice-field-success-halo: var(--juice-color-ok-halo);
251
+ --juice-field-counter-fg: var(--juice-color-text-subtle);
223
252
  --juice-field-radius: var(--juice-radius-md);
224
253
  --juice-field-height: var(--juice-control-height-md);
225
254
  --juice-field-padding-x: var(--juice-control-padding-x);
255
+ --juice-field-textarea-padding-y: 6px;
256
+ --juice-field-textarea-min-height: 5rem;
257
+ --juice-field-font-size: var(--juice-text-md);
258
+ --juice-field-line-height: 1.25rem;
259
+ --juice-field-label-font-size: var(--juice-text-sm);
260
+ --juice-field-label-font-weight: var(--juice-weight-medium);
261
+ --juice-field-message-font-size: var(--juice-text-xs);
262
+ --juice-field-message-line-height: 1rem;
263
+ --juice-field-label-gap: var(--juice-space-2);
264
+ --juice-field-message-gap: var(--juice-space-2);
226
265
  --juice-field-gap: var(--juice-density-gap);
266
+ --juice-field-stack-gap: var(--juice-space-5);
267
+ --juice-field-duration: var(--juice-duration-fast);
268
+ --juice-field-ease: var(--juice-ease-standard);
227
269
  --juice-listbox-bg: var(--juice-color-surface-raised);
228
270
  --juice-listbox-fg: var(--juice-color-text);
229
271
  --juice-listbox-border: var(--juice-color-border);
230
- --juice-listbox-shadow: var(--juice-shadow-overlay);
272
+ --juice-listbox-shadow: var(--juice-shadow-3);
231
273
  --juice-listbox-radius: var(--juice-radius-lg);
232
- --juice-listbox-option-hover-bg: var(--juice-color-surface-sunken);
233
- --juice-listbox-option-active-bg: var(--juice-color-surface-sunken);
234
- --juice-listbox-option-selected-bg: var(--juice-color-accent-subtle);
274
+ --juice-listbox-padding: var(--juice-space-1);
275
+ --juice-listbox-offset: var(--juice-space-1);
276
+ --juice-listbox-max-height: 18rem;
277
+ --juice-listbox-option-hover-bg: var(--juice-color-item-hover);
278
+ --juice-listbox-option-active-bg: var(--juice-color-item-hover);
279
+ --juice-listbox-option-selected-bg: transparent;
235
280
  --juice-listbox-option-selected-fg: var(--juice-color-text);
281
+ --juice-listbox-option-check: var(--juice-color-accent);
236
282
  --juice-listbox-option-disabled-fg: var(--juice-color-disabled-text);
237
283
  --juice-listbox-option-height: var(--juice-control-height-md);
284
+ --juice-listbox-option-padding-x: var(--juice-space-2);
285
+ --juice-listbox-option-radius: var(--juice-radius-sm);
286
+ --juice-listbox-option-gap: var(--juice-space-2);
287
+ --juice-listbox-chevron: var(--juice-color-text-subtle);
238
288
  --juice-listbox-z: var(--juice-z-dropdown);
239
289
  --juice-checkbox-size: var(--juice-space-4);
240
290
  --juice-checkbox-radius: var(--juice-radius-sm);
241
291
  --juice-checkbox-bg: var(--juice-color-surface);
242
292
  --juice-checkbox-border: var(--juice-color-control-border);
243
- --juice-checkbox-hover-border: var(--juice-color-text-subtle);
244
- --juice-checkbox-active-bg: var(--juice-color-surface-sunken);
293
+ --juice-checkbox-hover-border: var(--juice-color-control-border-hover);
294
+ --juice-checkbox-active-bg: var(--juice-color-control-active-bg);
245
295
  --juice-checkbox-checked-bg: var(--juice-color-accent);
246
- --juice-checkbox-checked-hover-bg: var(--juice-color-accent-hover);
296
+ --juice-checkbox-checked-hover-bg: var(--juice-color-accent-hover-subtle);
247
297
  --juice-checkbox-checked-active-bg: var(--juice-color-accent-active);
248
298
  --juice-checkbox-checked-fg: var(--juice-color-text-on-accent);
249
299
  --juice-checkbox-disabled-bg: var(--juice-color-disabled-bg);
@@ -266,7 +316,7 @@
266
316
  --juice-badge-neutral-bg: var(--juice-color-surface-sunken);
267
317
  --juice-badge-neutral-fg: var(--juice-color-text-muted);
268
318
  --juice-badge-accent-bg: var(--juice-color-accent-subtle);
269
- --juice-badge-accent-fg: var(--juice-color-accent-active);
319
+ --juice-badge-accent-fg: var(--juice-color-accent-emphasis);
270
320
  --juice-badge-ok-bg: var(--juice-color-ok-subtle);
271
321
  --juice-badge-ok-fg: var(--juice-color-ok);
272
322
  --juice-badge-warn-bg: var(--juice-color-warn-subtle);
@@ -343,6 +393,8 @@ body.dark {
343
393
  --juice-ref-accent-800: var(--juice-ref-teal-800);
344
394
  --juice-ref-accent-900: var(--juice-ref-teal-900);
345
395
  --juice-ref-accent-950: var(--juice-ref-teal-950);
396
+ --juice-ref-accent-350: #48cbba;
397
+ --juice-ref-accent-450: #20aa99;
346
398
  }
347
399
  :root[data-accent="violet"],
348
400
  :root[data-juice-palette="violet"] {
@@ -357,6 +409,8 @@ body.dark {
357
409
  --juice-ref-accent-800: var(--juice-ref-violet-800);
358
410
  --juice-ref-accent-900: var(--juice-ref-violet-900);
359
411
  --juice-ref-accent-950: var(--juice-ref-violet-950);
412
+ --juice-ref-accent-350: #b6a0fc;
413
+ --juice-ref-accent-450: #9974f8;
360
414
  }
361
415
  :root[data-accent="indigo"],
362
416
  :root[data-juice-palette="indigo"] {
@@ -371,6 +425,8 @@ body.dark {
371
425
  --juice-ref-accent-800: var(--juice-ref-indigo-800);
372
426
  --juice-ref-accent-900: var(--juice-ref-indigo-900);
373
427
  --juice-ref-accent-950: var(--juice-ref-indigo-950);
428
+ --juice-ref-accent-350: #93a0fa;
429
+ --juice-ref-accent-450: #7279f5;
374
430
  }
375
431
  :root[data-density="compact"] {
376
432
  --juice-control-height-sm: 1.5rem;
@@ -15,7 +15,9 @@
15
15
  --color-accent: var(--juice-color-accent);
16
16
  --color-accent-hover: var(--juice-color-accent-hover);
17
17
  --color-accent-active: var(--juice-color-accent-active);
18
+ --color-accent-hover-subtle: var(--juice-color-accent-hover-subtle);
18
19
  --color-accent-subtle: var(--juice-color-accent-subtle);
20
+ --color-accent-emphasis: var(--juice-color-accent-emphasis);
19
21
  --color-focus-ring: var(--juice-color-focus-ring);
20
22
  --color-ok: var(--juice-color-ok);
21
23
  --color-warn: var(--juice-color-warn);
@@ -30,6 +32,16 @@
30
32
  --color-control-border: var(--juice-color-control-border);
31
33
  --color-disabled-fill: var(--juice-color-disabled-fill);
32
34
  --color-disabled-on-fill: var(--juice-color-disabled-on-fill);
35
+ --color-control-hover-bg: var(--juice-color-control-hover-bg);
36
+ --color-control-active-bg: var(--juice-color-control-active-bg);
37
+ --color-control-border-hover: var(--juice-color-control-border-hover);
38
+ --color-bad-hover: var(--juice-color-bad-hover);
39
+ --color-bad-active: var(--juice-color-bad-active);
40
+ --color-focus-halo: var(--juice-color-focus-halo);
41
+ --color-bad-halo: var(--juice-color-bad-halo);
42
+ --color-warn-halo: var(--juice-color-warn-halo);
43
+ --color-ok-halo: var(--juice-color-ok-halo);
44
+ --color-item-hover: var(--juice-color-item-hover);
33
45
  --spacing: 4px;
34
46
  --spacing-1: var(--juice-space-1);
35
47
  --spacing-2: var(--juice-space-2);