@tangible/ui 0.2.23 → 0.2.24

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 (46) hide show
  1. package/components/Checkbox/Checkbox.js +1 -1
  2. package/components/DatePicker/DateRangePicker.js +1 -1
  3. package/components/Dropdown/Dropdown.js +1 -1
  4. package/components/GradientPicker/GradientPicker.js +3 -3
  5. package/components/NavMenu/NavMenu.d.ts +26 -0
  6. package/components/NavMenu/NavMenu.js +113 -0
  7. package/components/NavMenu/index.d.ts +2 -0
  8. package/components/NavMenu/index.js +1 -0
  9. package/components/NavMenu/types.d.ts +75 -0
  10. package/components/NavMenu/types.js +4 -0
  11. package/components/index.d.ts +2 -0
  12. package/components/index.js +1 -0
  13. package/figma-tokens.json +90 -1
  14. package/package.json +5 -1
  15. package/skills/building-with-tui/SKILL.md +10 -6
  16. package/styles/all.css +1 -1
  17. package/styles/all.expanded.css +429 -64
  18. package/styles/all.expanded.unlayered.css +429 -64
  19. package/styles/all.unlayered.css +1 -1
  20. package/styles/components/_bundle.scss +2 -0
  21. package/styles/components/checkbox.scss +13 -2
  22. package/styles/components/color-picker.scss +12 -4
  23. package/styles/components/combobox.scss +7 -6
  24. package/styles/components/date-picker.scss +8 -6
  25. package/styles/components/dropdown.scss +3 -5
  26. package/styles/components/gradient-picker.scss +3 -5
  27. package/styles/components/input/index.scss +16 -6
  28. package/styles/components/multi-combobox.scss +6 -6
  29. package/styles/components/multi-select.scss +10 -7
  30. package/styles/components/nav-menu.scss +212 -0
  31. package/styles/components/radio.scss +11 -3
  32. package/styles/components/search-select.scss +7 -7
  33. package/styles/components/select.scss +7 -6
  34. package/styles/components/slider.scss +1 -1
  35. package/styles/components/switch.scss +1 -1
  36. package/styles/components/text-input.scss +15 -1
  37. package/styles/core.css +1 -1
  38. package/styles/core.unlayered.css +1 -1
  39. package/styles/index.scss +18 -0
  40. package/styles/system/_constants.scss +0 -6
  41. package/styles/system/_palettes.scss +6 -0
  42. package/styles/system/_text-styles.scss +200 -0
  43. package/styles/system/_tokens.scss +7 -0
  44. package/styles/system/index.scss +3 -1
  45. package/tui-manifest.json +94 -3
  46. package/utils/listbox/group.js +3 -1
@@ -33,6 +33,7 @@
33
33
  @use "./slider" as slider;
34
34
  @use "./switch" as switch;
35
35
  @use "./sidebar" as sidebar;
36
+ @use "./nav-menu" as navmenu;
36
37
  @use "./step-indicator" as stepindicator;
37
38
  @use "./search-input" as searchinput;
38
39
  @use "./search-select" as searchselect;
@@ -116,6 +117,7 @@ $-input-dependents: (input, field, text-input, textarea, pager, search-input, se
116
117
  @if -wants($only, slider) { @include slider.styles(); }
117
118
  @if -wants($only, switch) { @include switch.styles(); }
118
119
  @if -wants($only, sidebar) { @include sidebar.styles(); }
120
+ @if -wants($only, nav-menu) { @include navmenu.styles(); }
119
121
  @if -wants($only, step-indicator) { @include stepindicator.styles(); }
120
122
  @if -wants($only, step-list) { @include steplist.styles(); }
121
123
  @if -wants($only, table) { @include table.styles(); }
@@ -3,6 +3,7 @@
3
3
  /* @tui-tokens
4
4
  --tui-checkbox-accent
5
5
  --tui-checkbox-border
6
+ --tui-checkbox-border-hover
6
7
  --tui-checkbox-border-invalid
7
8
  --tui-checkbox-radius
8
9
  --tui-checkbox-bg
@@ -30,7 +31,8 @@ $_indeterminate: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/sv
30
31
  // --tui-checkbox-accent Accent color for checked/indeterminate
31
32
  // → --tui-input-accent → --tui-theme-primary-base
32
33
  // --tui-checkbox-border Border color (unchecked)
33
- // → --tui-color-border
34
+ // --tui-checkbox-border-hover Hover border (opt-in; default: no change)
35
+ // → --tui-input-border → --tui-color-border-control
34
36
  // --tui-checkbox-border-invalid Border color (invalid)
35
37
  // → --tui-theme-danger-base
36
38
  // --tui-checkbox-radius Border radius
@@ -58,7 +60,10 @@ $_indeterminate: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/sv
58
60
  ) {
59
61
  // Internal tokens with real fallbacks
60
62
  --_accent: var(--#{sys.$prefix}checkbox-accent, var(--#{sys.$prefix}input-accent, var(--#{sys.$prefix}theme-primary-base)));
61
- --_border: var(--#{sys.$prefix}checkbox-border, var(--#{sys.$prefix}color-border));
63
+ --_border-rest: var(--#{sys.$prefix}checkbox-border, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border-control)));
64
+ // No hover change unless a consumer opts in (house rule for form controls).
65
+ --_border-hover: var(--#{sys.$prefix}checkbox-border-hover, var(--#{sys.$prefix}input-border-hover, var(--_border-rest)));
66
+ --_border: var(--_border-rest);
62
67
  --_radius: var(--#{sys.$prefix}checkbox-radius, var(--#{sys.$prefix}radius-sm));
63
68
  --_bg: var(--#{sys.$prefix}checkbox-bg, var(--#{sys.$prefix}color-bg));
64
69
 
@@ -110,6 +115,12 @@ $_indeterminate: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/sv
110
115
  background-image: $_indeterminate;
111
116
  }
112
117
 
118
+ // Hover: before Invalid so an invalid box keeps its red. Checked and
119
+ // indeterminate set border-color directly, so this can't touch them.
120
+ &:hover:not(:disabled) {
121
+ --_border: var(--_border-hover);
122
+ }
123
+
113
124
  // Invalid
114
125
  &[aria-invalid="true"] {
115
126
  --_border: var(--#{sys.$prefix}checkbox-border-invalid, var(--#{sys.$prefix}theme-danger-base));
@@ -166,12 +166,17 @@
166
166
  // the tui-input-group hosts do — a context re-pointing --tui-input-border
167
167
  // or --tui-input-radius reaches this box too.
168
168
  border: var(--#{sys.$prefix}border-width) solid
169
- var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border));
169
+ var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border-control));
170
170
  border-radius: var(--#{sys.$prefix}input-radius, var(--#{sys.$prefix}radius-md));
171
171
  background: var(--#{sys.$prefix}input-bg, var(--#{sys.$prefix}color-bg-surface));
172
172
  color: var(--#{sys.$prefix}input-fg, var(--#{sys.$prefix}color-fg));
173
173
  font-size: var(--#{sys.$prefix}typography-size-xs);
174
174
 
175
+ // Opt-in hover, resting border by default; before focus so focus wins.
176
+ &:hover {
177
+ border-color: var(--#{sys.$prefix}input-border-hover, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border-control)));
178
+ }
179
+
175
180
  &:focus-within {
176
181
  border-color: var(--#{sys.$prefix}focus-ring-color);
177
182
  outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
@@ -255,7 +260,7 @@
255
260
  color: var(--#{sys.$prefix}color-fg-muted);
256
261
 
257
262
  code {
258
- font-family: var(--#{sys.$prefix}font-family-mono, monospace);
263
+ font-family: var(--#{sys.$prefix}font-family-mono, #{sys.$font-stack-mono});
259
264
  }
260
265
 
261
266
  // Kept in the DOM (so the aria-live region announces on toggle) but
@@ -285,7 +290,7 @@
285
290
  // --tui-input-border / --tui-input-radius must reach this trigger the
286
291
  // same as every other control.
287
292
  border: var(--#{sys.$prefix}border-width) solid
288
- var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border));
293
+ var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border-control));
289
294
  border-radius: var(--#{sys.$prefix}input-radius, var(--#{sys.$prefix}radius-md));
290
295
  background: var(--#{sys.$prefix}input-bg, var(--#{sys.$prefix}color-bg-surface));
291
296
  color: var(--#{sys.$prefix}color-fg);
@@ -326,8 +331,11 @@
326
331
  min-block-size: 0;
327
332
  }
328
333
 
334
+ // Opt-in hover, resting border by default. This used to read
335
+ // --tui-color-border-strong, which doesn't exist, so it fell back to the
336
+ // decorative border and hover made the boundary LIGHTER than its 3:1 rest.
329
337
  &:hover {
330
- border-color: var(--#{sys.$prefix}color-border-strong, var(--#{sys.$prefix}color-border));
338
+ border-color: var(--#{sys.$prefix}input-border-hover, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border-control)));
331
339
  }
332
340
 
333
341
  // Match the shared form-control focus treatment: border turns primary plus
@@ -5,6 +5,7 @@
5
5
  --tui-combobox-input-bg
6
6
  --tui-combobox-input-fg
7
7
  --tui-combobox-input-border
8
+ --tui-combobox-input-border-hover
8
9
  --tui-combobox-input-border-focus
9
10
  --tui-combobox-input-radius
10
11
  --tui-combobox-content-bg
@@ -42,6 +43,7 @@ $_min-width: 160px;
42
43
  // --tui-combobox-input-bg
43
44
  // --tui-combobox-input-fg
44
45
  // --tui-combobox-input-border
46
+ // --tui-combobox-input-border-hover
45
47
  // --tui-combobox-input-border-focus
46
48
  // --tui-combobox-input-radius
47
49
  // --tui-combobox-content-bg
@@ -89,7 +91,8 @@ $_min-width: 160px;
89
91
  // trigger-* overrides still win; the shared input default sits underneath.
90
92
  --_bg: var(--#{sys.$prefix}combobox-input-bg, var(--#{sys.$prefix}select-trigger-bg, var(--#{sys.$prefix}input-bg, var(--#{sys.$prefix}color-bg-surface))));
91
93
  --_fg: var(--#{sys.$prefix}combobox-input-fg, var(--#{sys.$prefix}select-trigger-fg, var(--#{sys.$prefix}input-fg, var(--#{sys.$prefix}color-fg))));
92
- --_border: var(--#{sys.$prefix}combobox-input-border, var(--#{sys.$prefix}select-trigger-border, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border))));
94
+ --_border-rest: var(--#{sys.$prefix}combobox-input-border, var(--#{sys.$prefix}select-trigger-border, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border-control))));
95
+ --_border-hover: var(--#{sys.$prefix}combobox-input-border-hover, var(--#{sys.$prefix}select-trigger-border-hover, var(--#{sys.$prefix}input-border-hover, var(--_border-rest))));
93
96
  --_border-focus: var(--#{sys.$prefix}combobox-input-border-focus, var(--#{sys.$prefix}select-trigger-border-focus, var(--#{sys.$prefix}input-border-focus, var(--#{sys.$prefix}theme-primary-base))));
94
97
  --_radius: var(--#{sys.$prefix}combobox-input-radius, var(--#{sys.$prefix}select-trigger-radius, var(--#{sys.$prefix}input-radius, var(--#{sys.$prefix}radius-md))));
95
98
 
@@ -342,11 +345,9 @@ $_min-width: 160px;
342
345
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}combobox__label {
343
346
  padding: var(--#{sys.$prefix}spacing-xs) var(--#{sys.$prefix}spacing-sm);
344
347
  padding-bottom: var(--#{sys.$prefix}spacing-xxs);
345
- font-size: var(--#{sys.$prefix}typography-size-xs);
346
- font-weight: var(--#{sys.$prefix}typography-weight-semibold, 600);
347
- color: var(--#{sys.$prefix}color-fg-muted);
348
- text-transform: uppercase;
349
- letter-spacing: sys.$label-letter-spacing;
348
+ // The overline text style. The mixin keeps static markup styled; the
349
+ // component also renders .tui-text-style-overline as the override hook.
350
+ @include sys.text-style(sys.$prefix, overline);
350
351
  }
351
352
 
352
353
  // ---------------------------------------------------------------------------
@@ -282,7 +282,7 @@
282
282
  background-color: var(--#{sys.$prefix}input-bg, var(--#{sys.$prefix}color-bg-surface));
283
283
  color: var(--#{sys.$prefix}input-fg, var(--#{sys.$prefix}color-fg));
284
284
  border: var(--#{sys.$prefix}border-width) solid
285
- var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border));
285
+ var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border-control));
286
286
  border-radius: var(--#{sys.$prefix}input-radius, var(--#{sys.$prefix}radius-md));
287
287
  padding-inline: var(--#{sys.$prefix}spacing-sm);
288
288
 
@@ -299,6 +299,11 @@
299
299
  }
300
300
  }
301
301
 
302
+ // Opt-in hover, resting border by default; before focus so focus wins.
303
+ &:hover {
304
+ border-color: var(--#{sys.$prefix}input-border-hover, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border-control)));
305
+ }
306
+
302
307
  &:focus-within {
303
308
  border-color: var(--#{sys.$prefix}input-border-focus, var(--#{sys.$prefix}theme-primary-base));
304
309
  outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
@@ -399,11 +404,8 @@
399
404
  }
400
405
 
401
406
  &__field-label {
402
- color: var(--#{sys.$prefix}color-fg-muted);
403
- font-size: var(--#{sys.$prefix}typography-size-xs);
404
- font-weight: var(--#{sys.$prefix}typography-weight-medium, 500);
405
- letter-spacing: sys.$label-letter-spacing;
406
- text-transform: uppercase;
407
+ // Overline text style; the component also renders the class.
408
+ @include sys.text-style(sys.$prefix, overline);
407
409
  }
408
410
 
409
411
  &__fields-dash {
@@ -161,12 +161,10 @@
161
161
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}dropdown__header {
162
162
  padding: var(--#{sys.$prefix}spacing-xs, 8px) var(--#{sys.$prefix}spacing-sm, 12px);
163
163
  padding-block-end: var(--#{sys.$prefix}spacing-xxs, 4px);
164
- font-size: var(--#{sys.$prefix}typography-size-xs, 11px);
165
- font-weight: var(--#{sys.$prefix}typography-weight-semibold, 600);
166
- color: var(--#{sys.$prefix}color-fg-muted);
167
- text-transform: uppercase;
168
- letter-spacing: sys.$label-letter-spacing;
169
164
  user-select: none;
165
+ // The overline text style. The mixin keeps static markup styled; the
166
+ // component also renders .tui-text-style-overline as the override hook.
167
+ @include sys.text-style(sys.$prefix, overline);
170
168
  }
171
169
 
172
170
  // ---------------------------------------------------------------------------
@@ -162,11 +162,9 @@
162
162
  // Small uppercase section/field label (matches the design's control labels).
163
163
  .#{sys.$prefix}interface .#{sys.$prefix}gradient-picker__label {
164
164
  display: block;
165
- font-size: var(--#{sys.$prefix}typography-size-xs);
166
- font-weight: var(--#{sys.$prefix}typography-weight-medium, 500);
167
- letter-spacing: 0.04em;
168
- text-transform: uppercase;
169
- color: var(--#{sys.$prefix}color-fg-muted);
165
+ // The overline text style. The mixin keeps static markup styled; the
166
+ // component also renders .tui-text-style-overline as the override hook.
167
+ @include sys.text-style(sys.$prefix, overline);
170
168
  }
171
169
 
172
170
  // The stop list — swatch + position + remove per row, then the add button.
@@ -28,10 +28,12 @@
28
28
  // ---------------------------------------------------------------------------
29
29
  // Labels
30
30
  // ---------------------------------------------------------------------------
31
+ // Bare <label>s read the label text style's knobs, so configuring that style
32
+ // (--tui-text-label-*) reaches them too. .tui-text-style-label is the class form.
31
33
  :where(.#{sys.$prefix}interface) :is(label, .#{sys.$prefix}label) {
32
- color: var(--#{sys.$prefix}color-fg);
33
- font-weight: bold;
34
- font-size: var(--#{sys.$prefix}typography-size-sm);
34
+ color: var(--#{sys.$prefix}text-label-color, var(--#{sys.$prefix}color-fg));
35
+ font-weight: var(--#{sys.$prefix}text-label-weight, 700);
36
+ font-size: var(--#{sys.$prefix}text-label-size, var(--#{sys.$prefix}typography-size-sm));
35
37
  }
36
38
 
37
39
  // ---------------------------------------------------------------------------
@@ -60,7 +62,9 @@
60
62
  // Internal tokens — read component API with fallback to primitives
61
63
  --_bg: var(--#{sys.$prefix}input-bg, var(--#{sys.$prefix}color-bg-surface));
62
64
  --_fg: var(--#{sys.$prefix}input-fg, var(--#{sys.$prefix}color-fg));
63
- --_border: var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border));
65
+ --_border-rest: var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border-control));
66
+ --_border-hover: var(--#{sys.$prefix}input-border-hover, var(--_border-rest));
67
+ --_border: var(--_border-rest);
64
68
  --_border-focus: var(--#{sys.$prefix}input-border-focus, var(--#{sys.$prefix}theme-primary-base));
65
69
  --_border-invalid: var(--#{sys.$prefix}input-border-invalid, var(--#{sys.$prefix}theme-danger-base));
66
70
  --_radius: var(--#{sys.$prefix}input-radius, var(--#{sys.$prefix}radius-md));
@@ -85,6 +89,12 @@
85
89
  opacity: 1; // Normalize Firefox which applies its own opacity reduction
86
90
  }
87
91
 
92
+ // Opt-in hover (resting border by default). Before focus and invalid so
93
+ // both out-order it.
94
+ &:hover:not([disabled]) {
95
+ --_border: var(--_border-hover);
96
+ }
97
+
88
98
  &:focus-visible {
89
99
  --_border: var(--_border-focus);
90
100
  outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
@@ -151,7 +161,7 @@
151
161
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}toggle {
152
162
  // Internal tokens
153
163
  --_accent: var(--#{sys.$prefix}input-accent, var(--#{sys.$prefix}theme-primary-base));
154
- --_track-off: var(--#{sys.$prefix}color-fill-strong);
164
+ --_track-off: var(--#{sys.$prefix}color-border-control);
155
165
 
156
166
  input[type="checkbox"] {
157
167
  position: absolute;
@@ -225,7 +235,7 @@
225
235
  // Internal tokens
226
236
  --_bg: var(--#{sys.$prefix}input-bg, var(--#{sys.$prefix}color-bg-surface));
227
237
  --_fg: var(--#{sys.$prefix}input-fg, var(--#{sys.$prefix}color-fg));
228
- --_border: var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border));
238
+ --_border: var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border-control));
229
239
  --_radius: var(--#{sys.$prefix}input-radius, var(--#{sys.$prefix}radius-md));
230
240
 
231
241
  font-size: var(--#{sys.$prefix}typography-size-sm);
@@ -5,6 +5,7 @@
5
5
  --tui-multicombobox-control-bg Token-field background
6
6
  --tui-multicombobox-control-fg Text / icon colour in the control
7
7
  --tui-multicombobox-control-border Control border colour (rest)
8
+ --tui-multicombobox-control-border-hover Control border colour (hover; opt-in, default: no change)
8
9
  --tui-multicombobox-control-border-focus Control border colour (focus / open)
9
10
  --tui-multicombobox-control-radius Control border radius
10
11
  --tui-multicombobox-content-bg Listbox background
@@ -66,7 +67,8 @@ $_token-row-padding: 2px;
66
67
  // Chain, don't replace — multicombobox → combobox → select → input → system.
67
68
  --_bg: var(--#{sys.$prefix}multicombobox-control-bg, var(--#{sys.$prefix}combobox-input-bg, var(--#{sys.$prefix}select-trigger-bg, var(--#{sys.$prefix}input-bg, var(--#{sys.$prefix}color-bg-surface)))));
68
69
  --_fg: var(--#{sys.$prefix}multicombobox-control-fg, var(--#{sys.$prefix}combobox-input-fg, var(--#{sys.$prefix}select-trigger-fg, var(--#{sys.$prefix}input-fg, var(--#{sys.$prefix}color-fg)))));
69
- --_border: var(--#{sys.$prefix}multicombobox-control-border, var(--#{sys.$prefix}combobox-input-border, var(--#{sys.$prefix}select-trigger-border, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border)))));
70
+ --_border-rest: var(--#{sys.$prefix}multicombobox-control-border, var(--#{sys.$prefix}combobox-input-border, var(--#{sys.$prefix}select-trigger-border, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border-control)))));
71
+ --_border-hover: var(--#{sys.$prefix}multicombobox-control-border-hover, var(--#{sys.$prefix}combobox-input-border-hover, var(--#{sys.$prefix}select-trigger-border-hover, var(--#{sys.$prefix}input-border-hover, var(--_border-rest)))));
70
72
  --_border-focus: var(--#{sys.$prefix}multicombobox-control-border-focus, var(--#{sys.$prefix}combobox-input-border-focus, var(--#{sys.$prefix}select-trigger-border-focus, var(--#{sys.$prefix}input-border-focus, var(--#{sys.$prefix}theme-primary-base)))));
71
73
  --_radius: var(--#{sys.$prefix}multicombobox-control-radius, var(--#{sys.$prefix}combobox-input-radius, var(--#{sys.$prefix}select-trigger-radius, var(--#{sys.$prefix}input-radius, var(--#{sys.$prefix}radius-md)))));
72
74
 
@@ -398,11 +400,9 @@ $_token-row-padding: 2px;
398
400
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}multicombobox__label {
399
401
  padding: var(--#{sys.$prefix}spacing-xs) var(--#{sys.$prefix}spacing-sm);
400
402
  padding-bottom: var(--#{sys.$prefix}spacing-xxs);
401
- font-size: var(--#{sys.$prefix}typography-size-xs);
402
- font-weight: var(--#{sys.$prefix}typography-weight-semibold, 600);
403
- color: var(--#{sys.$prefix}color-fg-muted);
404
- text-transform: uppercase;
405
- letter-spacing: sys.$label-letter-spacing;
403
+ // The overline text style. The mixin keeps static markup styled; the
404
+ // component also renders .tui-text-style-overline as the override hook.
405
+ @include sys.text-style(sys.$prefix, overline);
406
406
  }
407
407
 
408
408
  // ---------------------------------------------------------------------------
@@ -5,6 +5,7 @@
5
5
  --tui-multiselect-trigger-bg
6
6
  --tui-multiselect-trigger-fg
7
7
  --tui-multiselect-trigger-border
8
+ --tui-multiselect-trigger-border-hover
8
9
  --tui-multiselect-trigger-border-focus
9
10
  --tui-multiselect-trigger-radius
10
11
  --tui-multiselect-content-bg
@@ -45,6 +46,7 @@ $_chip-max-width: 120px;
45
46
  // --tui-multiselect-trigger-bg
46
47
  // --tui-multiselect-trigger-fg
47
48
  // --tui-multiselect-trigger-border
49
+ // --tui-multiselect-trigger-border-hover
48
50
  // --tui-multiselect-trigger-border-focus
49
51
  // --tui-multiselect-trigger-radius
50
52
  //
@@ -80,7 +82,8 @@ $_chip-max-width: 120px;
80
82
  // the shared --tui-input-* default moves in underneath it.
81
83
  --_bg: var(--#{sys.$prefix}multiselect-trigger-bg, var(--#{sys.$prefix}input-bg, var(--#{sys.$prefix}color-bg-surface)));
82
84
  --_fg: var(--#{sys.$prefix}multiselect-trigger-fg, var(--#{sys.$prefix}input-fg, var(--#{sys.$prefix}color-fg)));
83
- --_border: var(--#{sys.$prefix}multiselect-trigger-border, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border)));
85
+ --_border-rest: var(--#{sys.$prefix}multiselect-trigger-border, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border-control)));
86
+ --_border-hover: var(--#{sys.$prefix}multiselect-trigger-border-hover, var(--#{sys.$prefix}input-border-hover, var(--_border-rest)));
84
87
  --_border-focus: var(--#{sys.$prefix}multiselect-trigger-border-focus, var(--#{sys.$prefix}input-border-focus, var(--#{sys.$prefix}theme-primary-base)));
85
88
  --_radius: var(--#{sys.$prefix}multiselect-trigger-radius, var(--#{sys.$prefix}input-radius, var(--#{sys.$prefix}radius-md)));
86
89
  --_min-width: var(--#{sys.$prefix}multiselect-min-width, #{$_min-width});
@@ -350,7 +353,9 @@ $_chip-max-width: 120px;
350
353
  flex-shrink: 0;
351
354
  width: 1em;
352
355
  height: 1em;
353
- border: var(--#{sys.$prefix}border-width) solid var(--#{sys.$prefix}color-border);
356
+ // The only visible unchecked affordance, so it needs the control boundary
357
+ // (3:1), chained like the standalone Checkbox.
358
+ border: var(--#{sys.$prefix}border-width) solid var(--#{sys.$prefix}checkbox-border, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border-control)));
354
359
  border-radius: var(--#{sys.$prefix}radius-xs);
355
360
  background-color: var(--#{sys.$prefix}color-bg);
356
361
  color: var(--#{sys.$prefix}color-fg-on-accent);
@@ -389,11 +394,9 @@ $_chip-max-width: 120px;
389
394
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}multiselect__label {
390
395
  padding: var(--#{sys.$prefix}spacing-xs) var(--#{sys.$prefix}spacing-sm);
391
396
  padding-bottom: var(--#{sys.$prefix}spacing-xxs);
392
- font-size: var(--#{sys.$prefix}typography-size-xs);
393
- font-weight: var(--#{sys.$prefix}typography-weight-semibold, 600);
394
- color: var(--#{sys.$prefix}color-fg-muted);
395
- text-transform: uppercase;
396
- letter-spacing: sys.$label-letter-spacing;
397
+ // The overline text style. The mixin keeps static markup styled; the
398
+ // component also renders .tui-text-style-overline as the override hook.
399
+ @include sys.text-style(sys.$prefix, overline);
397
400
  }
398
401
 
399
402
  // ---------------------------------------------------------------------------
@@ -0,0 +1,212 @@
1
+ @use "../system" as sys;
2
+
3
+ /* @tui-tokens
4
+ --tui-nav-menu-group-gap
5
+ --tui-nav-menu-item-gap
6
+ --tui-nav-menu-item-height
7
+ --tui-nav-menu-item-padding-inline
8
+ --tui-nav-menu-item-radius
9
+ --tui-nav-menu-item-font-size
10
+ --tui-nav-menu-item-fg
11
+ --tui-nav-menu-item-weight
12
+ --tui-nav-menu-item-bg-hover
13
+ --tui-nav-menu-item-fg-hover
14
+ --tui-nav-menu-item-bg-current
15
+ --tui-nav-menu-item-fg-current
16
+ --tui-nav-menu-item-weight-current
17
+ --tui-nav-menu-item-fg-ancestor
18
+ --tui-nav-menu-item-weight-ancestor
19
+ --tui-nav-menu-item-fg-disabled
20
+ --tui-nav-menu-icon-size
21
+ --tui-nav-menu-indicator-width
22
+ --tui-nav-menu-indicator-color
23
+ --tui-nav-menu-sub-indent
24
+ --tui-nav-menu-sub-border
25
+ */
26
+
27
+ @mixin styles() {
28
+ // ==========================================================================
29
+ // NavMenu
30
+ // ==========================================================================
31
+ //
32
+ // Rows for app navigation: groups with an overline heading, the current
33
+ // page, an ancestor of it, inert items, one level of nested items. Not a
34
+ // landmark: it sits inside Sidebar.Nav or the consumer's own <nav>.
35
+ //
36
+ // Component API tokens (never defined here, only read via fallback):
37
+ // --tui-nav-menu-group-gap Space above each group after the first
38
+ // --tui-nav-menu-item-gap Space between rows
39
+ // --tui-nav-menu-item-height Row min-height (default: control md)
40
+ // --tui-nav-menu-item-padding-inline Row inline padding; the group heading
41
+ // aligns its text to it
42
+ // --tui-nav-menu-item-radius Row radius
43
+ // --tui-nav-menu-item-font-size Row font size
44
+ // --tui-nav-menu-item-fg Row text
45
+ // --tui-nav-menu-item-weight Row weight (default: normal)
46
+ // --tui-nav-menu-item-bg-hover / -fg-hover
47
+ // --tui-nav-menu-item-bg-current / -fg-current / -weight-current
48
+ // The current page (aria-current="page")
49
+ // --tui-nav-menu-item-fg-ancestor / -weight-ancestor
50
+ // An ancestor of it (any other aria-current)
51
+ // --tui-nav-menu-item-fg-disabled Inert items
52
+ // --tui-nav-menu-icon-size Icon size (default: icon-size-sm, 16px)
53
+ // --tui-nav-menu-indicator-width Leading bar on the current page.
54
+ // Opt-in: 0 by default, try 3px.
55
+ // --tui-nav-menu-indicator-color That bar's colour
56
+ // --tui-nav-menu-sub-indent / -border Nested list indent and guide line
57
+ //
58
+ // !important on the row's color, font-weight and text-decoration, the
59
+ // Button precedent: rows are usually <a>, and hosts (WordPress themes, and
60
+ // Storybook's own preview.css) style bare `a` unlayered, which beats every
61
+ // layered rule regardless of specificity. Values still come from tokens.
62
+ //
63
+ // The group heading uses the overline text style, so --tui-text-overline-*
64
+ // and `.tui-text-style-overline` configure it like every other group label.
65
+ // ==========================================================================
66
+
67
+ // --_item-pad is set on the root and read by the heading and rows (each
68
+ // falls back to the same chain, so a Group used without the root still works).
69
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu {
70
+ --_item-pad: var(--#{sys.$prefix}nav-menu-item-padding-inline, var(--#{sys.$prefix}spacing-sm));
71
+
72
+ display: flex;
73
+ flex-direction: column;
74
+ gap: var(--#{sys.$prefix}nav-menu-group-gap, var(--#{sys.$prefix}spacing-md));
75
+ }
76
+
77
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu__group-label {
78
+ @include sys.text-style(sys.$prefix, overline);
79
+ margin: 0;
80
+ // Text lines up with the rows' label text, not their padding box.
81
+ padding-block: var(--#{sys.$prefix}spacing-xxs);
82
+ padding-inline: var(--_item-pad, var(--#{sys.$prefix}nav-menu-item-padding-inline, var(--#{sys.$prefix}spacing-sm)));
83
+ }
84
+
85
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu__list,
86
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu__sub {
87
+ display: flex;
88
+ flex-direction: column;
89
+ gap: var(--#{sys.$prefix}nav-menu-item-gap, 2px);
90
+ margin: 0;
91
+ padding: 0;
92
+ list-style: none;
93
+ }
94
+
95
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu__entry {
96
+ margin: 0;
97
+ }
98
+
99
+ // Row. Full specificity on .tui-interface: it's a themed element (a, button),
100
+ // and host button/link styles must not win.
101
+ .#{sys.$prefix}interface .#{sys.$prefix}nav-menu__item {
102
+ --_fg: var(--#{sys.$prefix}nav-menu-item-fg, var(--#{sys.$prefix}color-fg));
103
+ --_weight: var(--#{sys.$prefix}nav-menu-item-weight, var(--#{sys.$prefix}typography-weight-normal, 400));
104
+ --_bg: transparent;
105
+ --_indicator: var(--#{sys.$prefix}nav-menu-indicator-width, 0px);
106
+
107
+ position: relative;
108
+ display: flex;
109
+ align-items: center;
110
+ gap: var(--#{sys.$prefix}spacing-xs);
111
+ box-sizing: border-box;
112
+ inline-size: 100%;
113
+ min-block-size: var(--#{sys.$prefix}nav-menu-item-height, var(--#{sys.$prefix}control-height-md, 2.5rem));
114
+ margin: 0;
115
+ padding-block: var(--#{sys.$prefix}spacing-xxs);
116
+ padding-inline: var(--_item-pad, var(--#{sys.$prefix}nav-menu-item-padding-inline, var(--#{sys.$prefix}spacing-sm)));
117
+ border: 0;
118
+ border-radius: var(--#{sys.$prefix}nav-menu-item-radius, var(--#{sys.$prefix}radius-sm));
119
+ background: var(--_bg);
120
+ color: var(--_fg) !important;
121
+ font: inherit;
122
+ font-weight: var(--_weight) !important;
123
+ font-size: var(--#{sys.$prefix}nav-menu-item-font-size, var(--#{sys.$prefix}typography-size-md));
124
+ line-height: 1.4;
125
+ text-align: start;
126
+ text-decoration: none !important;
127
+ cursor: pointer;
128
+ transition: background-color var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
129
+
130
+ &:hover {
131
+ --_bg: var(--#{sys.$prefix}nav-menu-item-bg-hover, var(--#{sys.$prefix}color-fill-subtle));
132
+ --_fg: var(--#{sys.$prefix}nav-menu-item-fg-hover, var(--#{sys.$prefix}nav-menu-item-fg, var(--#{sys.$prefix}color-fg)));
133
+ }
134
+
135
+ // Inset, so adjacent rows and the sidebar edge don't clip it.
136
+ &:focus-visible {
137
+ outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
138
+ outline-offset: calc(-1 * var(--#{sys.$prefix}focus-ring-width));
139
+ }
140
+
141
+ // An ancestor of the current page (aria-current="true", or any value
142
+ // other than "page"): emphasis without the fill.
143
+ &[aria-current]:not([aria-current="page"]) {
144
+ --_fg: var(--#{sys.$prefix}nav-menu-item-fg-ancestor, var(--#{sys.$prefix}color-fg));
145
+ --_weight: var(--#{sys.$prefix}nav-menu-item-weight-ancestor, var(--#{sys.$prefix}typography-weight-semibold, 600));
146
+ }
147
+
148
+ // The current page. Fill + strong text + weight, so it never relies on
149
+ // colour alone. primary-strong measures 4.81:1 on primary-subtlest in dark.
150
+ &[aria-current="page"] {
151
+ --_bg: var(--#{sys.$prefix}nav-menu-item-bg-current, var(--#{sys.$prefix}theme-primary-subtlest));
152
+ --_fg: var(--#{sys.$prefix}nav-menu-item-fg-current, var(--#{sys.$prefix}theme-primary-strong));
153
+ --_weight: var(--#{sys.$prefix}nav-menu-item-weight-current, var(--#{sys.$prefix}typography-weight-semibold, 600));
154
+
155
+ // Opt-in leading bar. Zero-width (invisible) unless the token is set.
156
+ &::before {
157
+ content: "";
158
+ position: absolute;
159
+ inset-inline-start: 0;
160
+ inset-block: 25%;
161
+ inline-size: var(--_indicator);
162
+ border-start-end-radius: var(--#{sys.$prefix}radius-xs);
163
+ border-end-end-radius: var(--#{sys.$prefix}radius-xs);
164
+ background: var(--#{sys.$prefix}nav-menu-indicator-color, var(--#{sys.$prefix}theme-primary-base));
165
+ }
166
+ }
167
+
168
+ &[aria-disabled="true"] {
169
+ --_fg: var(--#{sys.$prefix}nav-menu-item-fg-disabled, var(--#{sys.$prefix}color-fg-muted));
170
+ --_bg: transparent;
171
+ cursor: default;
172
+ }
173
+ }
174
+
175
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu__icon {
176
+ display: inline-flex;
177
+ flex: none;
178
+ font-size: var(--#{sys.$prefix}nav-menu-icon-size, var(--#{sys.$prefix}icon-size-sm, 1rem));
179
+ }
180
+
181
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu__label {
182
+ flex: 1;
183
+ min-inline-size: 0;
184
+ }
185
+
186
+ // Nested items: indented under a guide line.
187
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu__sub {
188
+ margin-block-start: var(--#{sys.$prefix}nav-menu-item-gap, 2px);
189
+ margin-inline-start: var(--#{sys.$prefix}nav-menu-sub-indent, var(--#{sys.$prefix}spacing-sm));
190
+ padding-inline-start: var(--#{sys.$prefix}spacing-xs);
191
+ border-inline-start: var(--#{sys.$prefix}border-width) solid var(--#{sys.$prefix}nav-menu-sub-border, var(--#{sys.$prefix}color-border));
192
+ }
193
+
194
+ @media (forced-colors: active) {
195
+ .#{sys.$prefix}interface .#{sys.$prefix}nav-menu__item[aria-current="page"] {
196
+ outline: 2px solid Highlight;
197
+ outline-offset: -2px;
198
+ }
199
+
200
+ // Focus must stay distinct from the current row's outline: thicker and
201
+ // outside the row. Without this, the two tie and the current-row rule
202
+ // wins on order, so focus vanished on the row users land on most (SC 2.4.7).
203
+ .#{sys.$prefix}interface .#{sys.$prefix}nav-menu__item:focus-visible {
204
+ outline: 3px solid CanvasText;
205
+ outline-offset: 1px;
206
+ }
207
+
208
+ .#{sys.$prefix}interface .#{sys.$prefix}nav-menu__item[aria-disabled="true"] {
209
+ color: GrayText !important;
210
+ }
211
+ }
212
+ }
@@ -4,6 +4,7 @@
4
4
  --tui-radio-accent
5
5
  --tui-radio-size
6
6
  --tui-radio-border
7
+ --tui-radio-border-hover
7
8
  --tui-radio-border-invalid
8
9
  --tui-radio-bg
9
10
  --tui-radio-gap
@@ -22,6 +23,7 @@
22
23
  // --tui-radio-accent Accent color for selected state
23
24
  // --tui-radio-size Indicator size (falls back to 1.15em)
24
25
  // --tui-radio-border Indicator border color (unchecked)
26
+ // --tui-radio-border-hover Hover border (opt-in; default: no change)
25
27
  // --tui-radio-border-invalid Indicator border color when the group is invalid
26
28
  // --tui-radio-bg Indicator background color
27
29
  // --tui-radio-gap Gap between indicator and label
@@ -62,7 +64,9 @@
62
64
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}radio {
63
65
  // Internal tokens
64
66
  --_accent: var(--#{sys.$prefix}radio-accent, var(--#{sys.$prefix}input-accent, var(--#{sys.$prefix}theme-primary-base)));
65
- --_border: var(--#{sys.$prefix}radio-border, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border)));
67
+ --_border: var(--#{sys.$prefix}radio-border, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border-control)));
68
+ // No hover change unless a consumer opts in (house rule for form controls).
69
+ --_border-hover: var(--#{sys.$prefix}radio-border-hover, var(--#{sys.$prefix}input-border-hover, var(--_border)));
66
70
  --_bg: var(--#{sys.$prefix}radio-bg, var(--#{sys.$prefix}color-bg));
67
71
  --_size: var(--#{sys.$prefix}radio-size, 1.15em);
68
72
  --_gap: var(--#{sys.$prefix}radio-gap, var(--#{sys.$prefix}spacing-xs));
@@ -102,8 +106,12 @@
102
106
  cursor: pointer;
103
107
  appearance: none;
104
108
 
105
- &:hover:not(:disabled):not([aria-disabled="true"]) .#{sys.$prefix}radio__indicator {
106
- border-color: var(--_accent);
109
+ // Opt-in hover, resting border by default. It skips the checked item, which
110
+ // keeps its accent border. The :not sits in :where() so this rule's
111
+ // specificity is unchanged: the invalid rule below is written to out-weigh
112
+ // it.
113
+ &:hover:not(:disabled):not([aria-disabled="true"]):where(:not([aria-checked="true"])) .#{sys.$prefix}radio__indicator {
114
+ border-color: var(--_border-hover);
107
115
  }
108
116
 
109
117
  // Focus ring delegated to indicator — intentional (tightly wraps circle