@tangible/ui 0.2.22 → 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 (54) 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 +94 -5
  14. package/package.json +5 -1
  15. package/skills/building-with-tui/SKILL.md +24 -10
  16. package/styles/all.css +1 -1
  17. package/styles/all.expanded.css +604 -125
  18. package/styles/all.expanded.unlayered.css +604 -125
  19. package/styles/all.unlayered.css +1 -1
  20. package/styles/components/_bundle.scss +2 -0
  21. package/styles/components/accordion.scss +5 -0
  22. package/styles/components/button.scss +13 -9
  23. package/styles/components/card.scss +14 -0
  24. package/styles/components/checkbox.scss +13 -2
  25. package/styles/components/color-picker.scss +13 -4
  26. package/styles/components/combobox.scss +42 -16
  27. package/styles/components/date-picker.scss +9 -6
  28. package/styles/components/dropdown.scss +30 -13
  29. package/styles/components/gradient-picker.scss +4 -5
  30. package/styles/components/input/index.scss +16 -6
  31. package/styles/components/multi-combobox.scss +32 -17
  32. package/styles/components/multi-select.scss +41 -16
  33. package/styles/components/nav-menu.scss +212 -0
  34. package/styles/components/radio.scss +11 -3
  35. package/styles/components/search-select.scss +53 -17
  36. package/styles/components/segmented-control.scss +6 -0
  37. package/styles/components/select.scss +42 -16
  38. package/styles/components/sidebar.scss +4 -0
  39. package/styles/components/slider.scss +1 -1
  40. package/styles/components/switch.scss +1 -1
  41. package/styles/components/table.scss +8 -1
  42. package/styles/components/tabs.scss +4 -1
  43. package/styles/components/text-input.scss +15 -1
  44. package/styles/core.css +1 -1
  45. package/styles/core.unlayered.css +1 -1
  46. package/styles/index.scss +18 -0
  47. package/styles/system/_constants.scss +0 -6
  48. package/styles/system/_palettes.scss +6 -0
  49. package/styles/system/_text-styles.scss +200 -0
  50. package/styles/system/_tokens.scss +9 -2
  51. package/styles/system/index.scss +3 -1
  52. package/tui-manifest.json +130 -6
  53. package/utils/listbox/group.js +3 -1
  54. package/utils/portal.js +34 -5
@@ -5,15 +5,21 @@
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
12
+ --tui-multicombobox-content-fg Listbox text colour
11
13
  --tui-multicombobox-content-border Listbox border colour
12
14
  --tui-multicombobox-content-shadow Listbox drop shadow
13
15
  --tui-multicombobox-content-radius Listbox border radius
14
16
  --tui-multicombobox-option-radius Option corner radius
15
17
  --tui-multicombobox-option-bg-hover Option background (hover / highlighted)
16
18
  --tui-multicombobox-option-bg-selected Option background (selected)
19
+ --tui-multicombobox-option-fg-hover
20
+ --tui-multicombobox-option-fg-selected
21
+ --tui-multicombobox-option-bg-selected-hover
22
+ --tui-multicombobox-option-check
17
23
  --tui-multicombobox-option-gap Vertical gap between options
18
24
  */
19
25
 
@@ -31,7 +37,8 @@ $_token-row-padding: 2px;
31
37
  //
32
38
  // The free-typing sibling of MultiSelect. Shares Combobox's visual language
33
39
  // for the listbox and Select tokens as the ultimate fallback: token chains
34
- // resolve --tui-multicombobox-* → --tui-combobox-* → --tui-select-* → system.
40
+ // resolve --tui-multicombobox-* → --tui-combobox-* → --tui-select-* →
41
+ // --tui-listbox-* (the family-wide layer) → system.
35
42
  //
36
43
  // The control is a token field: a bordered box holding wrapping chips and an
37
44
  // auto-growing search input, with the clear-all button and chevron pinned to
@@ -60,7 +67,8 @@ $_token-row-padding: 2px;
60
67
  // Chain, don't replace — multicombobox → combobox → select → input → system.
61
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)))));
62
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)))));
63
- --_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)))));
64
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)))));
65
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)))));
66
74
 
@@ -264,10 +272,11 @@ $_token-row-padding: 2px;
264
272
  // ---------------------------------------------------------------------------
265
273
 
266
274
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}multicombobox__content {
267
- --_bg: var(--#{sys.$prefix}multicombobox-content-bg, var(--#{sys.$prefix}combobox-content-bg, var(--#{sys.$prefix}select-content-bg, var(--#{sys.$prefix}color-bg-elevated))));
268
- --_border: var(--#{sys.$prefix}multicombobox-content-border, var(--#{sys.$prefix}combobox-content-border, var(--#{sys.$prefix}select-content-border, var(--#{sys.$prefix}color-border))));
269
- --_shadow: var(--#{sys.$prefix}multicombobox-content-shadow, var(--#{sys.$prefix}combobox-content-shadow, var(--#{sys.$prefix}select-content-shadow, var(--#{sys.$prefix}shadow-dropdown))));
270
- --_radius: var(--#{sys.$prefix}multicombobox-content-radius, var(--#{sys.$prefix}combobox-content-radius, var(--#{sys.$prefix}select-content-radius, var(--#{sys.$prefix}radius-md))));
275
+ --_bg: var(--#{sys.$prefix}multicombobox-content-bg, var(--#{sys.$prefix}combobox-content-bg, var(--#{sys.$prefix}select-content-bg, var(--#{sys.$prefix}listbox-bg, var(--#{sys.$prefix}color-bg-elevated)))));
276
+ --_fg: var(--#{sys.$prefix}multicombobox-content-fg, var(--#{sys.$prefix}combobox-content-fg, var(--#{sys.$prefix}select-content-fg, var(--#{sys.$prefix}listbox-fg, var(--#{sys.$prefix}color-fg)))));
277
+ --_border: var(--#{sys.$prefix}multicombobox-content-border, var(--#{sys.$prefix}combobox-content-border, var(--#{sys.$prefix}select-content-border, var(--#{sys.$prefix}listbox-border, var(--#{sys.$prefix}color-border)))));
278
+ --_shadow: var(--#{sys.$prefix}multicombobox-content-shadow, var(--#{sys.$prefix}combobox-content-shadow, var(--#{sys.$prefix}select-content-shadow, var(--#{sys.$prefix}listbox-shadow, var(--#{sys.$prefix}shadow-dropdown)))));
279
+ --_radius: var(--#{sys.$prefix}multicombobox-content-radius, var(--#{sys.$prefix}combobox-content-radius, var(--#{sys.$prefix}select-content-radius, var(--#{sys.$prefix}listbox-radius, var(--#{sys.$prefix}radius-md)))));
271
280
  --_min-width: var(--#{sys.$prefix}multicombobox-min-width, var(--#{sys.$prefix}combobox-min-width, var(--#{sys.$prefix}select-min-width, #{$_min-width})));
272
281
 
273
282
  z-index: var(--#{sys.$prefix}layer-top);
@@ -301,6 +310,7 @@ $_token-row-padding: 2px;
301
310
  }
302
311
 
303
312
  background-color: var(--_bg);
313
+ color: var(--_fg);
304
314
  border: var(--#{sys.$prefix}border-width) solid var(--_border);
305
315
  border-radius: var(--_radius);
306
316
  box-shadow: var(--_shadow);
@@ -313,9 +323,13 @@ $_token-row-padding: 2px;
313
323
  // ---------------------------------------------------------------------------
314
324
 
315
325
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}multicombobox__option {
316
- --_option-radius: var(--#{sys.$prefix}multicombobox-option-radius, var(--#{sys.$prefix}combobox-option-radius, var(--#{sys.$prefix}select-option-radius, var(--#{sys.$prefix}radius-sm))));
317
- --_bg-hover: var(--#{sys.$prefix}multicombobox-option-bg-hover, var(--#{sys.$prefix}combobox-option-bg-hover, var(--#{sys.$prefix}select-option-bg-hover, var(--#{sys.$prefix}color-fill-subtle))));
318
- --_bg-selected: var(--#{sys.$prefix}multicombobox-option-bg-selected, var(--#{sys.$prefix}combobox-option-bg-selected, var(--#{sys.$prefix}select-option-bg-selected, var(--#{sys.$prefix}theme-primary-subtlest))));
326
+ --_option-radius: var(--#{sys.$prefix}multicombobox-option-radius, var(--#{sys.$prefix}combobox-option-radius, var(--#{sys.$prefix}select-option-radius, var(--#{sys.$prefix}listbox-option-radius, var(--#{sys.$prefix}radius-sm)))));
327
+ --_bg-hover: var(--#{sys.$prefix}multicombobox-option-bg-hover, var(--#{sys.$prefix}combobox-option-bg-hover, var(--#{sys.$prefix}select-option-bg-hover, var(--#{sys.$prefix}listbox-option-bg-hover, var(--#{sys.$prefix}color-fill-subtle)))));
328
+ --_bg-selected: var(--#{sys.$prefix}multicombobox-option-bg-selected, var(--#{sys.$prefix}combobox-option-bg-selected, var(--#{sys.$prefix}select-option-bg-selected, var(--#{sys.$prefix}listbox-option-bg-selected, var(--#{sys.$prefix}theme-primary-subtlest)))));
329
+ --_fg-hover: var(--#{sys.$prefix}multicombobox-option-fg-hover, var(--#{sys.$prefix}combobox-option-fg-hover, var(--#{sys.$prefix}select-option-fg-hover, var(--#{sys.$prefix}listbox-option-fg-hover, inherit))));
330
+ --_fg-selected: var(--#{sys.$prefix}multicombobox-option-fg-selected, var(--#{sys.$prefix}combobox-option-fg-selected, var(--#{sys.$prefix}select-option-fg-selected, var(--#{sys.$prefix}listbox-option-fg-selected, inherit))));
331
+ --_bg-selected-hover: var(--#{sys.$prefix}multicombobox-option-bg-selected-hover, var(--#{sys.$prefix}combobox-option-bg-selected-hover, var(--#{sys.$prefix}select-option-bg-selected-hover, var(--#{sys.$prefix}listbox-option-bg-selected-hover, var(--#{sys.$prefix}theme-primary-subtle)))));
332
+ --_check: var(--#{sys.$prefix}multicombobox-option-check, var(--#{sys.$prefix}combobox-option-check, var(--#{sys.$prefix}select-option-check, var(--#{sys.$prefix}listbox-option-check, var(--#{sys.$prefix}theme-primary-strong)))));
319
333
 
320
334
  display: flex;
321
335
  align-items: center;
@@ -330,21 +344,24 @@ $_token-row-padding: 2px;
330
344
  transition: background-color var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
331
345
 
332
346
  & + .#{sys.$prefix}multicombobox__option {
333
- margin-block-start: var(--#{sys.$prefix}multicombobox-option-gap, var(--#{sys.$prefix}combobox-option-gap, var(--#{sys.$prefix}select-option-gap, 2px)));
347
+ margin-block-start: var(--#{sys.$prefix}multicombobox-option-gap, var(--#{sys.$prefix}combobox-option-gap, var(--#{sys.$prefix}select-option-gap, var(--#{sys.$prefix}listbox-option-gap, 2px))));
334
348
  }
335
349
 
336
350
  &:hover:not([data-disabled]),
337
351
  &[data-highlighted]:not([data-disabled]) {
338
352
  background-color: var(--_bg-hover);
353
+ color: var(--_fg-hover);
339
354
  }
340
355
 
341
356
  &[aria-selected="true"] {
342
357
  background-color: var(--_bg-selected);
358
+ color: var(--_fg-selected);
343
359
  }
344
360
 
345
361
  &[aria-selected="true"]:hover:not([data-disabled]),
346
362
  &[aria-selected="true"][data-highlighted]:not([data-disabled]) {
347
- background-color: var(--#{sys.$prefix}theme-primary-subtle);
363
+ background-color: var(--_bg-selected-hover);
364
+ color: var(--_fg-selected);
348
365
  }
349
366
 
350
367
  &[data-disabled] {
@@ -360,7 +377,7 @@ $_token-row-padding: 2px;
360
377
  align-items: center;
361
378
  justify-content: center;
362
379
  width: 1.25em;
363
- color: var(--#{sys.$prefix}theme-primary-base);
380
+ color: var(--_check);
364
381
  }
365
382
 
366
383
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}multicombobox__option-content {
@@ -383,11 +400,9 @@ $_token-row-padding: 2px;
383
400
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}multicombobox__label {
384
401
  padding: var(--#{sys.$prefix}spacing-xs) var(--#{sys.$prefix}spacing-sm);
385
402
  padding-bottom: var(--#{sys.$prefix}spacing-xxs);
386
- font-size: var(--#{sys.$prefix}typography-size-xs);
387
- font-weight: var(--#{sys.$prefix}typography-weight-semibold, 600);
388
- color: var(--#{sys.$prefix}color-fg-muted);
389
- text-transform: uppercase;
390
- 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);
391
406
  }
392
407
 
393
408
  // ---------------------------------------------------------------------------
@@ -5,15 +5,20 @@
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
12
+ --tui-multiselect-content-fg
11
13
  --tui-multiselect-content-border
12
14
  --tui-multiselect-content-shadow
13
15
  --tui-multiselect-content-radius
14
16
  --tui-multiselect-option-radius
15
17
  --tui-multiselect-option-bg-hover
16
18
  --tui-multiselect-option-bg-selected
19
+ --tui-multiselect-option-fg-hover
20
+ --tui-multiselect-option-fg-selected
21
+ --tui-multiselect-option-bg-selected-hover
17
22
  --tui-multiselect-option-gap
18
23
  --tui-multiselect-chip-bg
19
24
  --tui-multiselect-chip-fg
@@ -29,17 +34,25 @@ $_chip-max-width: 120px;
29
34
  // MultiSelect Component
30
35
  // ==========================================================================
31
36
  //
37
+ // Panel and option tokens sit on top of the family-wide --tui-listbox-* layer
38
+ // (bg, fg, border, shadow, radius, option-radius, option-gap, option-bg-hover,
39
+ // option-fg-hover, option-bg-selected, option-fg-selected,
40
+ // option-bg-selected-hover, option-check). Set --tui-listbox-* to restyle every
41
+ // listbox at once; a per-component token below overrides it for this one.
42
+ //
32
43
  // Component API tokens (never defined here, only read via fallback):
33
44
  //
34
45
  // Trigger:
35
46
  // --tui-multiselect-trigger-bg
36
47
  // --tui-multiselect-trigger-fg
37
48
  // --tui-multiselect-trigger-border
49
+ // --tui-multiselect-trigger-border-hover
38
50
  // --tui-multiselect-trigger-border-focus
39
51
  // --tui-multiselect-trigger-radius
40
52
  //
41
53
  // Content:
42
54
  // --tui-multiselect-content-bg
55
+ // --tui-multiselect-content-fg
43
56
  // --tui-multiselect-content-border
44
57
  // --tui-multiselect-content-shadow
45
58
  // --tui-multiselect-content-radius
@@ -48,6 +61,9 @@ $_chip-max-width: 120px;
48
61
  // --tui-multiselect-option-radius
49
62
  // --tui-multiselect-option-bg-hover
50
63
  // --tui-multiselect-option-bg-selected
64
+ // --tui-multiselect-option-fg-hover
65
+ // --tui-multiselect-option-fg-selected
66
+ // --tui-multiselect-option-bg-selected-hover
51
67
  //
52
68
  // Chips:
53
69
  // --tui-multiselect-chip-bg
@@ -66,7 +82,8 @@ $_chip-max-width: 120px;
66
82
  // the shared --tui-input-* default moves in underneath it.
67
83
  --_bg: var(--#{sys.$prefix}multiselect-trigger-bg, var(--#{sys.$prefix}input-bg, var(--#{sys.$prefix}color-bg-surface)));
68
84
  --_fg: var(--#{sys.$prefix}multiselect-trigger-fg, var(--#{sys.$prefix}input-fg, var(--#{sys.$prefix}color-fg)));
69
- --_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)));
70
87
  --_border-focus: var(--#{sys.$prefix}multiselect-trigger-border-focus, var(--#{sys.$prefix}input-border-focus, var(--#{sys.$prefix}theme-primary-base)));
71
88
  --_radius: var(--#{sys.$prefix}multiselect-trigger-radius, var(--#{sys.$prefix}input-radius, var(--#{sys.$prefix}radius-md)));
72
89
  --_min-width: var(--#{sys.$prefix}multiselect-min-width, #{$_min-width});
@@ -203,10 +220,11 @@ $_chip-max-width: 120px;
203
220
 
204
221
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}multiselect__content {
205
222
  // Internal tokens with real fallbacks
206
- --_bg: var(--#{sys.$prefix}multiselect-content-bg, var(--#{sys.$prefix}color-bg-elevated));
207
- --_border: var(--#{sys.$prefix}multiselect-content-border, var(--#{sys.$prefix}color-border));
208
- --_shadow: var(--#{sys.$prefix}multiselect-content-shadow, var(--#{sys.$prefix}shadow-dropdown));
209
- --_radius: var(--#{sys.$prefix}multiselect-content-radius, var(--#{sys.$prefix}radius-md));
223
+ --_bg: var(--#{sys.$prefix}multiselect-content-bg, var(--#{sys.$prefix}listbox-bg, var(--#{sys.$prefix}color-bg-elevated)));
224
+ --_fg: var(--#{sys.$prefix}multiselect-content-fg, var(--#{sys.$prefix}listbox-fg, var(--#{sys.$prefix}color-fg)));
225
+ --_border: var(--#{sys.$prefix}multiselect-content-border, var(--#{sys.$prefix}listbox-border, var(--#{sys.$prefix}color-border)));
226
+ --_shadow: var(--#{sys.$prefix}multiselect-content-shadow, var(--#{sys.$prefix}listbox-shadow, var(--#{sys.$prefix}shadow-dropdown)));
227
+ --_radius: var(--#{sys.$prefix}multiselect-content-radius, var(--#{sys.$prefix}listbox-radius, var(--#{sys.$prefix}radius-md)));
210
228
  --_min-width: var(--#{sys.$prefix}multiselect-min-width, #{$_min-width});
211
229
 
212
230
  // Layout
@@ -243,6 +261,7 @@ $_chip-max-width: 120px;
243
261
 
244
262
  // Visual
245
263
  background-color: var(--_bg);
264
+ color: var(--_fg);
246
265
  border: var(--#{sys.$prefix}border-width) solid var(--_border);
247
266
  border-radius: var(--_radius);
248
267
  box-shadow: var(--_shadow);
@@ -257,9 +276,12 @@ $_chip-max-width: 120px;
257
276
 
258
277
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}multiselect__option {
259
278
  // Internal tokens with real fallbacks
260
- --_option-radius: var(--#{sys.$prefix}multiselect-option-radius, var(--#{sys.$prefix}radius-sm));
261
- --_bg-hover: var(--#{sys.$prefix}multiselect-option-bg-hover, var(--#{sys.$prefix}color-fill-subtle));
262
- --_bg-selected: var(--#{sys.$prefix}multiselect-option-bg-selected, var(--#{sys.$prefix}theme-primary-subtlest));
279
+ --_option-radius: var(--#{sys.$prefix}multiselect-option-radius, var(--#{sys.$prefix}listbox-option-radius, var(--#{sys.$prefix}radius-sm)));
280
+ --_bg-hover: var(--#{sys.$prefix}multiselect-option-bg-hover, var(--#{sys.$prefix}listbox-option-bg-hover, var(--#{sys.$prefix}color-fill-subtle)));
281
+ --_bg-selected: var(--#{sys.$prefix}multiselect-option-bg-selected, var(--#{sys.$prefix}listbox-option-bg-selected, var(--#{sys.$prefix}theme-primary-subtlest)));
282
+ --_fg-hover: var(--#{sys.$prefix}multiselect-option-fg-hover, var(--#{sys.$prefix}listbox-option-fg-hover, inherit));
283
+ --_fg-selected: var(--#{sys.$prefix}multiselect-option-fg-selected, var(--#{sys.$prefix}listbox-option-fg-selected, inherit));
284
+ --_bg-selected-hover: var(--#{sys.$prefix}multiselect-option-bg-selected-hover, var(--#{sys.$prefix}listbox-option-bg-selected-hover, var(--#{sys.$prefix}theme-primary-subtle)));
263
285
 
264
286
  // Layout
265
287
  display: flex;
@@ -279,21 +301,24 @@ $_chip-max-width: 120px;
279
301
  // (Not `& + &`: sass expands both ampersands to the full compound
280
302
  // selector, and the :where() prefix ends up mid-combinator — dead rule.)
281
303
  & + .#{sys.$prefix}multiselect__option {
282
- margin-block-start: var(--#{sys.$prefix}multiselect-option-gap, var(--#{sys.$prefix}select-option-gap, 2px));
304
+ margin-block-start: var(--#{sys.$prefix}multiselect-option-gap, var(--#{sys.$prefix}select-option-gap, var(--#{sys.$prefix}listbox-option-gap, 2px)));
283
305
  }
284
306
 
285
307
  &:hover:not([data-disabled]):not([data-blocked]),
286
308
  &[data-highlighted]:not([data-disabled]):not([data-blocked]) {
287
309
  background-color: var(--_bg-hover);
310
+ color: var(--_fg-hover);
288
311
  }
289
312
 
290
313
  &[aria-selected="true"] {
291
314
  background-color: var(--_bg-selected);
315
+ color: var(--_fg-selected);
292
316
  }
293
317
 
294
318
  &[aria-selected="true"]:hover:not([data-disabled]):not([data-blocked]),
295
319
  &[aria-selected="true"][data-highlighted]:not([data-disabled]):not([data-blocked]) {
296
- background-color: var(--#{sys.$prefix}theme-primary-subtle);
320
+ background-color: var(--_bg-selected-hover);
321
+ color: var(--_fg-selected);
297
322
  }
298
323
 
299
324
  // Intrinsically disabled (disabled prop)
@@ -328,7 +353,9 @@ $_chip-max-width: 120px;
328
353
  flex-shrink: 0;
329
354
  width: 1em;
330
355
  height: 1em;
331
- 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)));
332
359
  border-radius: var(--#{sys.$prefix}radius-xs);
333
360
  background-color: var(--#{sys.$prefix}color-bg);
334
361
  color: var(--#{sys.$prefix}color-fg-on-accent);
@@ -367,11 +394,9 @@ $_chip-max-width: 120px;
367
394
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}multiselect__label {
368
395
  padding: var(--#{sys.$prefix}spacing-xs) var(--#{sys.$prefix}spacing-sm);
369
396
  padding-bottom: var(--#{sys.$prefix}spacing-xxs);
370
- font-size: var(--#{sys.$prefix}typography-size-xs);
371
- font-weight: var(--#{sys.$prefix}typography-weight-semibold, 600);
372
- color: var(--#{sys.$prefix}color-fg-muted);
373
- text-transform: uppercase;
374
- 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);
375
400
  }
376
401
 
377
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