@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
@@ -4,15 +4,21 @@
4
4
  --tui-search-select-trigger-bg
5
5
  --tui-search-select-trigger-fg
6
6
  --tui-search-select-trigger-border
7
+ --tui-search-select-trigger-border-hover
7
8
  --tui-search-select-trigger-border-focus
8
9
  --tui-search-select-trigger-radius
9
10
  --tui-search-select-panel-bg
11
+ --tui-search-select-panel-fg
10
12
  --tui-search-select-panel-border
11
13
  --tui-search-select-panel-shadow
12
14
  --tui-search-select-panel-radius
13
15
  --tui-search-select-panel-width
14
16
  --tui-search-select-option-bg-hover
15
17
  --tui-search-select-option-bg-selected
18
+ --tui-search-select-option-fg-hover
19
+ --tui-search-select-option-fg-selected
20
+ --tui-search-select-option-bg-selected-hover
21
+ --tui-search-select-option-check
16
22
  */
17
23
 
18
24
  @mixin styles() {
@@ -20,14 +26,21 @@
20
26
  // SearchSelect
21
27
  // ==========================================================================
22
28
  //
29
+ // Panel and option tokens sit on top of the family-wide --tui-listbox-* layer
30
+ // (bg, fg, border, shadow, radius, option-radius, option-gap, option-bg-hover,
31
+ // option-fg-hover, option-bg-selected, option-fg-selected,
32
+ // option-bg-selected-hover, option-check). Set --tui-listbox-* to restyle every
33
+ // listbox at once; a per-component token below overrides it for this one.
34
+ //
23
35
  // Component API tokens (never defined here, only read via fallback — the
24
36
  // fallback chain runs through Select's tokens so context remaps of the
25
37
  // select family carry over automatically):
26
- // --tui-search-select-trigger-bg / -fg / -border / -border-focus / -radius
27
- // --tui-search-select-panel-bg / -border / -shadow / -radius
38
+ // --tui-search-select-trigger-bg / -fg / -border / -border-hover / -border-focus / -radius
39
+ // --tui-search-select-panel-bg / -fg / -border / -shadow / -radius
28
40
  // --tui-search-select-panel-width Panel inline-size (default: reference
29
41
  // width via the floating min-width)
30
- // --tui-search-select-option-bg-hover / -bg-selected
42
+ // --tui-search-select-option-bg-hover / -bg-selected / -bg-selected-hover
43
+ // --tui-search-select-option-fg-hover / -fg-selected / -check
31
44
  //
32
45
  // ==========================================================================
33
46
 
@@ -49,7 +62,8 @@
49
62
  // triggers still carries SearchSelect with it.
50
63
  --_bg: var(--#{sys.$prefix}search-select-trigger-bg, var(--#{sys.$prefix}select-trigger-bg, var(--#{sys.$prefix}input-bg, var(--#{sys.$prefix}color-bg-surface))));
51
64
  --_fg: var(--#{sys.$prefix}search-select-trigger-fg, var(--#{sys.$prefix}select-trigger-fg, var(--#{sys.$prefix}input-fg, var(--#{sys.$prefix}color-fg))));
52
- --_border: var(--#{sys.$prefix}search-select-trigger-border, var(--#{sys.$prefix}select-trigger-border, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border))));
65
+ --_border-rest: var(--#{sys.$prefix}search-select-trigger-border, var(--#{sys.$prefix}select-trigger-border, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border-control))));
66
+ --_border-hover: var(--#{sys.$prefix}search-select-trigger-border-hover, var(--#{sys.$prefix}select-trigger-border-hover, var(--#{sys.$prefix}input-border-hover, var(--_border-rest))));
53
67
  --_border-focus: var(--#{sys.$prefix}search-select-trigger-border-focus, var(--#{sys.$prefix}select-trigger-border-focus, var(--#{sys.$prefix}input-border-focus, var(--#{sys.$prefix}theme-primary-base))));
54
68
  --_radius: var(--#{sys.$prefix}search-select-trigger-radius, var(--#{sys.$prefix}select-trigger-radius, var(--#{sys.$prefix}input-radius, var(--#{sys.$prefix}radius-md))));
55
69
 
@@ -90,10 +104,11 @@
90
104
  // Panel — dialog holding the search field + listbox
91
105
  // ---------------------------------------------------------------------------
92
106
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-select__panel {
93
- --_bg: var(--#{sys.$prefix}search-select-panel-bg, var(--#{sys.$prefix}select-content-bg, var(--#{sys.$prefix}color-bg-elevated)));
94
- --_border: var(--#{sys.$prefix}search-select-panel-border, var(--#{sys.$prefix}select-content-border, var(--#{sys.$prefix}color-border)));
95
- --_shadow: var(--#{sys.$prefix}search-select-panel-shadow, var(--#{sys.$prefix}select-content-shadow, var(--#{sys.$prefix}shadow-dropdown)));
96
- --_radius: var(--#{sys.$prefix}search-select-panel-radius, var(--#{sys.$prefix}select-content-radius, var(--#{sys.$prefix}radius-md)));
107
+ --_bg: var(--#{sys.$prefix}search-select-panel-bg, var(--#{sys.$prefix}select-content-bg, var(--#{sys.$prefix}listbox-bg, var(--#{sys.$prefix}color-bg-elevated))));
108
+ --_fg: var(--#{sys.$prefix}search-select-panel-fg, var(--#{sys.$prefix}select-content-fg, var(--#{sys.$prefix}listbox-fg, var(--#{sys.$prefix}color-fg))));
109
+ --_border: var(--#{sys.$prefix}search-select-panel-border, var(--#{sys.$prefix}select-content-border, var(--#{sys.$prefix}listbox-border, var(--#{sys.$prefix}color-border))));
110
+ --_shadow: var(--#{sys.$prefix}search-select-panel-shadow, var(--#{sys.$prefix}select-content-shadow, var(--#{sys.$prefix}listbox-shadow, var(--#{sys.$prefix}shadow-dropdown))));
111
+ --_radius: var(--#{sys.$prefix}search-select-panel-radius, var(--#{sys.$prefix}select-content-radius, var(--#{sys.$prefix}listbox-radius, var(--#{sys.$prefix}radius-md))));
97
112
 
98
113
  z-index: var(--#{sys.$prefix}layer-top);
99
114
  inline-size: var(--#{sys.$prefix}search-select-panel-width, auto);
@@ -105,6 +120,7 @@
105
120
  pointer-events: auto;
106
121
 
107
122
  background-color: var(--_bg);
123
+ color: var(--_fg);
108
124
  border: var(--#{sys.$prefix}border-width) solid var(--_border);
109
125
  border-radius: var(--_radius);
110
126
  box-shadow: var(--_shadow);
@@ -140,8 +156,12 @@
140
156
  // Option — mirrors Select's option anatomy
141
157
  // ---------------------------------------------------------------------------
142
158
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-select__option {
143
- --_option-bg-hover: var(--#{sys.$prefix}search-select-option-bg-hover, var(--#{sys.$prefix}select-option-bg-hover, var(--#{sys.$prefix}color-fill-subtle)));
144
- --_option-bg-selected: var(--#{sys.$prefix}search-select-option-bg-selected, var(--#{sys.$prefix}select-option-bg-selected, var(--#{sys.$prefix}theme-primary-subtlest)));
159
+ --_option-bg-hover: var(--#{sys.$prefix}search-select-option-bg-hover, var(--#{sys.$prefix}select-option-bg-hover, var(--#{sys.$prefix}listbox-option-bg-hover, var(--#{sys.$prefix}color-fill-subtle))));
160
+ --_option-bg-selected: var(--#{sys.$prefix}search-select-option-bg-selected, var(--#{sys.$prefix}select-option-bg-selected, var(--#{sys.$prefix}listbox-option-bg-selected, var(--#{sys.$prefix}theme-primary-subtlest))));
161
+ --_fg-hover: var(--#{sys.$prefix}search-select-option-fg-hover, var(--#{sys.$prefix}select-option-fg-hover, var(--#{sys.$prefix}listbox-option-fg-hover, inherit)));
162
+ --_fg-selected: var(--#{sys.$prefix}search-select-option-fg-selected, var(--#{sys.$prefix}select-option-fg-selected, var(--#{sys.$prefix}listbox-option-fg-selected, inherit)));
163
+ --_bg-selected-hover: var(--#{sys.$prefix}search-select-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))));
164
+ --_check: var(--#{sys.$prefix}search-select-option-check, var(--#{sys.$prefix}select-option-check, var(--#{sys.$prefix}listbox-option-check, var(--#{sys.$prefix}theme-primary-strong))));
145
165
 
146
166
  display: flex;
147
167
  align-items: center;
@@ -149,7 +169,8 @@
149
169
  gap: var(--#{sys.$prefix}spacing-xs);
150
170
  padding: var(--#{sys.$prefix}spacing-xxs) var(--#{sys.$prefix}spacing-sm);
151
171
  border-radius: var(--#{sys.$prefix}radius-sm);
152
- color: var(--#{sys.$prefix}color-fg);
172
+ // Inherits the panel's --_fg so --tui-search-select-panel-fg reaches options.
173
+ color: inherit;
153
174
  font-size: var(--#{sys.$prefix}typography-size-sm);
154
175
  cursor: pointer;
155
176
  user-select: none;
@@ -157,15 +178,32 @@
157
178
  @media (hover: hover) {
158
179
  &:hover {
159
180
  background-color: var(--_option-bg-hover);
181
+ color: var(--_fg-hover);
160
182
  }
161
183
  }
162
184
 
163
185
  &[data-highlighted] {
164
186
  background-color: var(--_option-bg-hover);
187
+ color: var(--_fg-hover);
165
188
  }
166
189
 
167
190
  &[aria-selected="true"] {
168
191
  background-color: var(--_option-bg-selected);
192
+ color: var(--_fg-selected);
193
+ }
194
+
195
+ // Matches the rest of the listbox family: a selected option still answers
196
+ // hover, rather than the selected fill silently winning.
197
+ @media (hover: hover) {
198
+ &[aria-selected="true"]:hover {
199
+ background-color: var(--_bg-selected-hover);
200
+ color: var(--_fg-selected);
201
+ }
202
+ }
203
+
204
+ &[aria-selected="true"][data-highlighted] {
205
+ background-color: var(--_bg-selected-hover);
206
+ color: var(--_fg-selected);
169
207
  }
170
208
 
171
209
  &[data-disabled] {
@@ -183,7 +221,7 @@
183
221
 
184
222
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-select__option-check {
185
223
  flex-shrink: 0;
186
- color: var(--#{sys.$prefix}theme-primary-base);
224
+ color: var(--_check);
187
225
  }
188
226
 
189
227
  // ---------------------------------------------------------------------------
@@ -204,11 +242,9 @@
204
242
 
205
243
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-select__label {
206
244
  padding: var(--#{sys.$prefix}spacing-xs) var(--#{sys.$prefix}spacing-sm);
207
- color: var(--#{sys.$prefix}color-fg-muted);
208
- font-size: var(--#{sys.$prefix}typography-size-xs);
209
- font-weight: var(--#{sys.$prefix}typography-weight-semibold, 600);
210
- text-transform: uppercase;
211
- letter-spacing: sys.$label-letter-spacing;
245
+ // The overline text style. The mixin keeps static markup styled; the
246
+ // component also renders .tui-text-style-overline as the override hook.
247
+ @include sys.text-style(sys.$prefix, overline);
212
248
  }
213
249
 
214
250
  // High-contrast mode: keep highlighted/selected legible
@@ -5,6 +5,7 @@
5
5
  --tui-segmented-padding
6
6
  --tui-segmented-radius
7
7
  --tui-segmented-bg
8
+ --tui-segmented-fg
8
9
  --tui-segmented-border
9
10
  --tui-segmented-item-padding
10
11
  --tui-segmented-item-radius
@@ -26,6 +27,7 @@
26
27
  // --tui-segmented-padding Container padding
27
28
  // --tui-segmented-radius Container border radius
28
29
  // --tui-segmented-bg Container background
30
+ // --tui-segmented-fg Container text color (pill; outline/underline inherit)
29
31
  // --tui-segmented-border Container border color
30
32
  // --tui-segmented-item-padding Item padding
31
33
  // --tui-segmented-item-radius Item border radius
@@ -69,6 +71,7 @@
69
71
  --_padding: var(--#{sys.$prefix}segmented-padding, #{$_track-padding});
70
72
  --_radius: var(--#{sys.$prefix}segmented-radius, var(--#{sys.$prefix}radius-lg));
71
73
  --_bg: var(--#{sys.$prefix}segmented-bg, var(--#{sys.$prefix}color-bg-muted));
74
+ --_fg: var(--#{sys.$prefix}segmented-fg, var(--#{sys.$prefix}color-fg));
72
75
  --_border: var(--#{sys.$prefix}segmented-border, transparent);
73
76
 
74
77
  display: inline-flex;
@@ -79,6 +82,7 @@
79
82
  gap: var(--_gap);
80
83
  padding: var(--_padding);
81
84
  background: var(--_bg);
85
+ color: var(--_fg);
82
86
  border: var(--#{sys.$prefix}border-width) solid var(--_border);
83
87
  border-radius: var(--_radius);
84
88
 
@@ -110,6 +114,7 @@
110
114
 
111
115
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}segmented.is-variant-outline {
112
116
  --_bg: transparent;
117
+ --_fg: var(--#{sys.$prefix}segmented-fg, inherit);
113
118
  --_border: var(--#{sys.$prefix}segmented-border, var(--#{sys.$prefix}color-border));
114
119
  }
115
120
 
@@ -119,6 +124,7 @@
119
124
 
120
125
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}segmented.is-variant-underline {
121
126
  --_bg: transparent;
127
+ --_fg: var(--#{sys.$prefix}segmented-fg, inherit);
122
128
  --_padding: 0;
123
129
  --_gap: var(--#{sys.$prefix}segmented-gap, #{$_underline-gap});
124
130
  border-radius: 0;
@@ -5,15 +5,21 @@
5
5
  --tui-select-trigger-bg
6
6
  --tui-select-trigger-fg
7
7
  --tui-select-trigger-border
8
+ --tui-select-trigger-border-hover
8
9
  --tui-select-trigger-border-focus
9
10
  --tui-select-trigger-radius
10
11
  --tui-select-content-bg
12
+ --tui-select-content-fg
11
13
  --tui-select-content-border
12
14
  --tui-select-content-shadow
13
15
  --tui-select-content-radius
14
16
  --tui-select-option-radius
15
17
  --tui-select-option-bg-hover
16
18
  --tui-select-option-bg-selected
19
+ --tui-select-option-fg-hover
20
+ --tui-select-option-fg-selected
21
+ --tui-select-option-bg-selected-hover
22
+ --tui-select-option-check
17
23
  --tui-select-option-gap
18
24
  */
19
25
 
@@ -26,6 +32,12 @@ $_min-width: 160px;
26
32
  // Select Component
27
33
  // ==========================================================================
28
34
  //
35
+ // Panel and option tokens sit on top of the family-wide --tui-listbox-* layer
36
+ // (bg, fg, border, shadow, radius, option-radius, option-gap, option-bg-hover,
37
+ // option-fg-hover, option-bg-selected, option-fg-selected,
38
+ // option-bg-selected-hover, option-check). Set --tui-listbox-* to restyle every
39
+ // listbox at once; a per-component token below overrides it for this one.
40
+ //
29
41
  // Component API tokens (never defined here, only read via fallback):
30
42
  //
31
43
  // Shared:
@@ -37,11 +49,13 @@ $_min-width: 160px;
37
49
  // --tui-select-trigger-bg
38
50
  // --tui-select-trigger-fg
39
51
  // --tui-select-trigger-border
52
+ // --tui-select-trigger-border-hover
40
53
  // --tui-select-trigger-border-focus
41
54
  // --tui-select-trigger-radius
42
55
  //
43
56
  // Content:
44
57
  // --tui-select-content-bg
58
+ // --tui-select-content-fg
45
59
  // --tui-select-content-border
46
60
  // --tui-select-content-shadow
47
61
  // --tui-select-content-radius
@@ -50,6 +64,10 @@ $_min-width: 160px;
50
64
  // --tui-select-option-radius
51
65
  // --tui-select-option-bg-hover
52
66
  // --tui-select-option-bg-selected
67
+ // --tui-select-option-fg-hover
68
+ // --tui-select-option-fg-selected
69
+ // --tui-select-option-bg-selected-hover
70
+ // --tui-select-option-check
53
71
  //
54
72
  // ==========================================================================
55
73
 
@@ -78,7 +96,8 @@ $_min-width: 160px;
78
96
  // wins, and the shared --tui-input-* default moves in underneath it.
79
97
  --_bg: var(--#{sys.$prefix}select-trigger-bg, var(--#{sys.$prefix}input-bg, var(--#{sys.$prefix}color-bg-surface)));
80
98
  --_fg: var(--#{sys.$prefix}select-trigger-fg, var(--#{sys.$prefix}input-fg, var(--#{sys.$prefix}color-fg)));
81
- --_border: var(--#{sys.$prefix}select-trigger-border, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border)));
99
+ --_border-rest: var(--#{sys.$prefix}select-trigger-border, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border-control)));
100
+ --_border-hover: var(--#{sys.$prefix}select-trigger-border-hover, var(--#{sys.$prefix}input-border-hover, var(--_border-rest)));
82
101
  --_border-focus: var(--#{sys.$prefix}select-trigger-border-focus, var(--#{sys.$prefix}input-border-focus, var(--#{sys.$prefix}theme-primary-base)));
83
102
  --_radius: var(--#{sys.$prefix}select-trigger-radius, var(--#{sys.$prefix}input-radius, var(--#{sys.$prefix}radius-md)));
84
103
  --_min-width: var(--#{sys.$prefix}select-min-width, #{$_min-width});
@@ -184,10 +203,11 @@ $_min-width: 160px;
184
203
 
185
204
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}select__content {
186
205
  // Internal tokens with real fallbacks
187
- --_bg: var(--#{sys.$prefix}select-content-bg, var(--#{sys.$prefix}color-bg-elevated));
188
- --_border: var(--#{sys.$prefix}select-content-border, var(--#{sys.$prefix}color-border));
189
- --_shadow: var(--#{sys.$prefix}select-content-shadow, var(--#{sys.$prefix}shadow-dropdown));
190
- --_radius: var(--#{sys.$prefix}select-content-radius, var(--#{sys.$prefix}radius-md));
206
+ --_bg: var(--#{sys.$prefix}select-content-bg, var(--#{sys.$prefix}listbox-bg, var(--#{sys.$prefix}color-bg-elevated)));
207
+ --_fg: var(--#{sys.$prefix}select-content-fg, var(--#{sys.$prefix}listbox-fg, var(--#{sys.$prefix}color-fg)));
208
+ --_border: var(--#{sys.$prefix}select-content-border, var(--#{sys.$prefix}listbox-border, var(--#{sys.$prefix}color-border)));
209
+ --_shadow: var(--#{sys.$prefix}select-content-shadow, var(--#{sys.$prefix}listbox-shadow, var(--#{sys.$prefix}shadow-dropdown)));
210
+ --_radius: var(--#{sys.$prefix}select-content-radius, var(--#{sys.$prefix}listbox-radius, var(--#{sys.$prefix}radius-md)));
191
211
  --_min-width: var(--#{sys.$prefix}select-min-width, #{$_min-width});
192
212
 
193
213
  // Layout
@@ -224,6 +244,7 @@ $_min-width: 160px;
224
244
 
225
245
  // Visual
226
246
  background-color: var(--_bg);
247
+ color: var(--_fg);
227
248
  border: var(--#{sys.$prefix}border-width) solid var(--_border);
228
249
  border-radius: var(--_radius);
229
250
  box-shadow: var(--_shadow);
@@ -238,9 +259,13 @@ $_min-width: 160px;
238
259
 
239
260
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}select__option {
240
261
  // Internal tokens with real fallbacks
241
- --_option-radius: var(--#{sys.$prefix}select-option-radius, var(--#{sys.$prefix}radius-sm));
242
- --_bg-hover: var(--#{sys.$prefix}select-option-bg-hover, var(--#{sys.$prefix}color-fill-subtle));
243
- --_bg-selected: var(--#{sys.$prefix}select-option-bg-selected, var(--#{sys.$prefix}theme-primary-subtlest));
262
+ --_option-radius: var(--#{sys.$prefix}select-option-radius, var(--#{sys.$prefix}listbox-option-radius, var(--#{sys.$prefix}radius-sm)));
263
+ --_bg-hover: var(--#{sys.$prefix}select-option-bg-hover, var(--#{sys.$prefix}listbox-option-bg-hover, var(--#{sys.$prefix}color-fill-subtle)));
264
+ --_bg-selected: var(--#{sys.$prefix}select-option-bg-selected, var(--#{sys.$prefix}listbox-option-bg-selected, var(--#{sys.$prefix}theme-primary-subtlest)));
265
+ --_fg-hover: var(--#{sys.$prefix}select-option-fg-hover, var(--#{sys.$prefix}listbox-option-fg-hover, inherit));
266
+ --_fg-selected: var(--#{sys.$prefix}select-option-fg-selected, var(--#{sys.$prefix}listbox-option-fg-selected, inherit));
267
+ --_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)));
268
+ --_check: var(--#{sys.$prefix}select-option-check, var(--#{sys.$prefix}listbox-option-check, var(--#{sys.$prefix}theme-primary-strong)));
244
269
 
245
270
  // Layout
246
271
  display: flex;
@@ -260,22 +285,25 @@ $_min-width: 160px;
260
285
  // (Not `& + &`: sass expands both ampersands to the full compound
261
286
  // selector, and the :where() prefix ends up mid-combinator — dead rule.)
262
287
  & + .#{sys.$prefix}select__option {
263
- margin-block-start: var(--#{sys.$prefix}select-option-gap, 2px);
288
+ margin-block-start: var(--#{sys.$prefix}select-option-gap, var(--#{sys.$prefix}listbox-option-gap, 2px));
264
289
  }
265
290
 
266
291
  &:hover:not([data-disabled]),
267
292
  &[data-highlighted]:not([data-disabled]) {
268
293
  background-color: var(--_bg-hover);
294
+ color: var(--_fg-hover);
269
295
  }
270
296
 
271
297
  &[aria-selected="true"] {
272
298
  background-color: var(--_bg-selected);
299
+ color: var(--_fg-selected);
273
300
  font-weight: var(--#{sys.$prefix}typography-weight-medium, 500);
274
301
  }
275
302
 
276
303
  &[aria-selected="true"]:hover:not([data-disabled]),
277
304
  &[aria-selected="true"][data-highlighted]:not([data-disabled]) {
278
- background-color: var(--#{sys.$prefix}theme-primary-subtle);
305
+ background-color: var(--_bg-selected-hover);
306
+ color: var(--_fg-selected);
279
307
  }
280
308
 
281
309
  &[data-disabled] {
@@ -294,7 +322,7 @@ $_min-width: 160px;
294
322
 
295
323
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}select__option-check {
296
324
  flex-shrink: 0;
297
- color: var(--#{sys.$prefix}theme-primary-base);
325
+ color: var(--_check);
298
326
  }
299
327
 
300
328
  // ---------------------------------------------------------------------------
@@ -316,11 +344,9 @@ $_min-width: 160px;
316
344
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}select__label {
317
345
  padding: var(--#{sys.$prefix}spacing-xs) var(--#{sys.$prefix}spacing-sm);
318
346
  padding-bottom: var(--#{sys.$prefix}spacing-xxs);
319
- font-size: var(--#{sys.$prefix}typography-size-xs);
320
- font-weight: var(--#{sys.$prefix}typography-weight-semibold, 600);
321
- color: var(--#{sys.$prefix}color-fg-muted);
322
- text-transform: uppercase;
323
- letter-spacing: sys.$label-letter-spacing;
347
+ // The overline text style. The mixin keeps static markup styled; the
348
+ // component also renders .tui-text-style-overline as the override hook.
349
+ @include sys.text-style(sys.$prefix, overline);
324
350
  }
325
351
 
326
352
  // ---------------------------------------------------------------------------
@@ -4,6 +4,7 @@
4
4
  --tui-sidebar-width
5
5
  --tui-sidebar-collapsed-width
6
6
  --tui-sidebar-bg
7
+ --tui-sidebar-fg
7
8
  --tui-sidebar-border
8
9
  --tui-sidebar-divider
9
10
  --tui-sidebar-padding
@@ -19,6 +20,7 @@
19
20
  // --tui-sidebar-width Fixed sidebar width
20
21
  // --tui-sidebar-collapsed-width Width of the collapsed rail
21
22
  // --tui-sidebar-bg Background color
23
+ // --tui-sidebar-fg Text color
22
24
  // --tui-sidebar-border Edge border color (docked left/right edge)
23
25
  // --tui-sidebar-divider Header/footer divider color
24
26
  // --tui-sidebar-padding Internal padding
@@ -37,6 +39,7 @@
37
39
  // Internal tokens — read component API with fallback to primitives
38
40
  --_width: var(--#{sys.$prefix}sidebar-width, 320px);
39
41
  --_bg: var(--#{sys.$prefix}sidebar-bg, var(--#{sys.$prefix}color-bg-surface));
42
+ --_fg: var(--#{sys.$prefix}sidebar-fg, var(--#{sys.$prefix}color-fg));
40
43
  --_border: var(--#{sys.$prefix}sidebar-border, var(--#{sys.$prefix}color-border));
41
44
  // Header/footer separators are dividers, not borders — they must stay
42
45
  // subtle when contexts darken --tui-color-border for control contrast.
@@ -46,6 +49,7 @@
46
49
  width: var(--_width);
47
50
  max-width: 100%;
48
51
  background-color: var(--_bg);
52
+ color: var(--_fg);
49
53
  display: flex;
50
54
  flex-direction: column;
51
55
  height: 100%;
@@ -37,7 +37,7 @@
37
37
 
38
38
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}slider {
39
39
  --_track-height: var(--#{sys.$prefix}slider-track-height, 4px);
40
- --_track-bg: var(--#{sys.$prefix}slider-track-bg, var(--#{sys.$prefix}color-fill));
40
+ --_track-bg: var(--#{sys.$prefix}slider-track-bg, var(--#{sys.$prefix}color-border-control));
41
41
  --_fill: var(--#{sys.$prefix}slider-fill, var(--#{sys.$prefix}theme-primary-base));
42
42
  --_gap: var(--#{sys.$prefix}slider-gap, var(--#{sys.$prefix}spacing-xxs));
43
43
  --_segment-radius: var(--#{sys.$prefix}slider-segment-radius, var(--#{sys.$prefix}radius-full));
@@ -87,7 +87,7 @@
87
87
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}switch__track {
88
88
  // Internal tokens
89
89
  --_accent: var(--#{sys.$prefix}switch-accent, var(--#{sys.$prefix}input-accent, var(--#{sys.$prefix}theme-primary-base)));
90
- --_bg: var(--#{sys.$prefix}switch-bg, var(--#{sys.$prefix}color-fill-strong));
90
+ --_bg: var(--#{sys.$prefix}switch-bg, var(--#{sys.$prefix}color-border-control));
91
91
  --_border: var(--#{sys.$prefix}switch-border, var(--_bg));
92
92
  --_thumb-bg: var(--#{sys.$prefix}switch-thumb-bg, var(--#{sys.$prefix}color-bg));
93
93
  --_track-height: var(--#{sys.$prefix}switch-track-height, #{$_track-height});
@@ -7,6 +7,7 @@
7
7
  --tui-table-fg
8
8
  --tui-table-padding
9
9
  --tui-table-selected-bg
10
+ --tui-table-selected-fg
10
11
  */
11
12
 
12
13
  @mixin styles() {
@@ -18,7 +19,9 @@
18
19
  // --tui-table-border Border color
19
20
  // --tui-table-bg Background color
20
21
  // --tui-table-bg-head Header background color
21
- // --tui-table-fg Text color
22
+ // --tui-table-fg Text color (header/footer always; body inherits unless set)
23
+ // --tui-table-selected-bg Selected row background
24
+ // --tui-table-selected-fg Selected row text color
22
25
  // --tui-table-padding Cell padding
23
26
  //
24
27
  // To override from consuming code:
@@ -42,6 +45,9 @@
42
45
  border-collapse: collapse;
43
46
  border-bottom: var(--#{sys.$prefix}border-width) solid var(--_border);
44
47
  background: var(--_bg);
48
+ // --_bg defaults to transparent, so the body keeps inheriting the host
49
+ // colour unless a consumer paints a fill and sets --tui-table-fg with it.
50
+ color: var(--#{sys.$prefix}table-fg, inherit);
45
51
 
46
52
  &__bulkActions {
47
53
  display: flex;
@@ -87,6 +93,7 @@
87
93
  td,
88
94
  .#{sys.$prefix}table__cell--body {
89
95
  background-color: var(--#{sys.$prefix}table-selected-bg, var(--#{sys.$prefix}theme-primary-subtlest));
96
+ color: var(--#{sys.$prefix}table-selected-fg, var(--#{sys.$prefix}color-fg));
90
97
  // Left border accent for non-color-only indication
91
98
  &:first-child {
92
99
  box-shadow: inset 3px 0 0 var(--#{sys.$prefix}theme-primary-base);
@@ -3,6 +3,7 @@
3
3
  /* @tui-tokens
4
4
  --tui-tabs-gap
5
5
  --tui-tabs-list-bg
6
+ --tui-tabs-list-fg
6
7
  --tui-tabs-list-padding
7
8
  --tui-tabs-list-radius
8
9
  --tui-tabs-tab-padding
@@ -24,7 +25,8 @@
24
25
  //
25
26
  // Component API tokens (never defined here, only read via fallback):
26
27
  // --tui-tabs-gap Gap between tabs in list
27
- // --tui-tabs-list-bg Tablist background
28
+ // --tui-tabs-list-bg Tablist background (pill variant)
29
+ // --tui-tabs-list-fg Tablist text color (pill variant; other variants inherit)
28
30
  // --tui-tabs-list-padding Tablist padding
29
31
  // --tui-tabs-list-radius Tablist border radius
30
32
  // --tui-tabs-tab-padding Tab button padding
@@ -92,6 +94,7 @@
92
94
  // Pill variant: list has background
93
95
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}tabs[data-variant="pill"] .#{sys.$prefix}tabs__list {
94
96
  background: var(--#{sys.$prefix}tabs-list-bg, var(--#{sys.$prefix}color-bg-muted));
97
+ color: var(--#{sys.$prefix}tabs-list-fg, var(--#{sys.$prefix}color-fg));
95
98
  padding: var(--#{sys.$prefix}tabs-list-padding, var(--#{sys.$prefix}spacing-xs));
96
99
  border-radius: var(--#{sys.$prefix}tabs-list-radius, var(--#{sys.$prefix}radius-lg));
97
100
  }
@@ -24,7 +24,14 @@
24
24
  --_gap: var(--#{sys.$prefix}input-group-gap, var(--#{sys.$prefix}spacing-xs));
25
25
  --_bg: var(--#{sys.$prefix}input-bg, var(--#{sys.$prefix}color-bg-surface));
26
26
  --_fg: var(--#{sys.$prefix}input-fg, var(--#{sys.$prefix}color-fg));
27
- --_border: var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border));
27
+ // Resting border, named so hover can fall back to it: a custom property
28
+ // can't reference its own earlier value. Hosts set --_border-rest, not
29
+ // --_border.
30
+ --_border-rest: var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border-control));
31
+ // No hover change by default (house rule for form controls). Consumers
32
+ // opt in with --tui-input-border-hover, and hosts expose their own.
33
+ --_border-hover: var(--#{sys.$prefix}input-border-hover, var(--_border-rest));
34
+ --_border: var(--_border-rest);
28
35
  --_border-focus: var(--#{sys.$prefix}input-border-focus, var(--#{sys.$prefix}theme-primary-base));
29
36
  --_radius: var(--#{sys.$prefix}input-radius, var(--#{sys.$prefix}radius-md));
30
37
 
@@ -103,6 +110,13 @@
103
110
  // trade-off (over-application, not under-application, so WCAG 2.4.11 is met).
104
111
  // On a <button> host :focus-within is simply :focus, which is what the select
105
112
  // family wants anyway: native selects ring on mouse focus too.
113
+ // Hover sits FIRST among the border states, so focus, open and invalid all
114
+ // out-order it at equal specificity. Its default is the resting border, so
115
+ // nothing changes unless a consumer sets --tui-input-border-hover.
116
+ .#{sys.$prefix}interface .#{sys.$prefix}input-group:hover {
117
+ --_border: var(--_border-hover);
118
+ }
119
+
106
120
  .#{sys.$prefix}interface .#{sys.$prefix}input-group:focus-within {
107
121
  --_border: var(--_border-focus);
108
122
  outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);