@tangible/ui 0.2.7 → 0.2.9

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 (62) hide show
  1. package/components/ColorPicker/ColorField.js +33 -10
  2. package/components/Combobox/Combobox.d.ts +16 -11
  3. package/components/Combobox/Combobox.js +42 -196
  4. package/components/Combobox/types.d.ts +3 -7
  5. package/components/MultiCombobox/MultiCombobox.d.ts +16 -11
  6. package/components/MultiCombobox/MultiCombobox.js +46 -157
  7. package/components/MultiCombobox/types.d.ts +4 -7
  8. package/components/MultiSelect/MultiSelect.d.ts +16 -11
  9. package/components/MultiSelect/MultiSelect.js +74 -210
  10. package/components/MultiSelect/types.d.ts +5 -8
  11. package/components/SearchSelect/SearchSelect.d.ts +34 -0
  12. package/components/SearchSelect/SearchSelect.js +444 -0
  13. package/components/SearchSelect/SearchSelectContext.d.ts +7 -0
  14. package/components/SearchSelect/SearchSelectContext.js +21 -0
  15. package/components/SearchSelect/index.d.ts +2 -0
  16. package/components/SearchSelect/index.js +1 -0
  17. package/components/SearchSelect/types.d.ts +134 -0
  18. package/components/SearchSelect/types.js +5 -0
  19. package/components/Select/Select.d.ts +16 -11
  20. package/components/Select/Select.js +78 -237
  21. package/components/Select/types.d.ts +5 -8
  22. package/components/Tabs/Tabs.js +16 -1
  23. package/components/index.d.ts +2 -0
  24. package/components/index.js +1 -0
  25. package/package.json +5 -1
  26. package/styles/all.css +1 -1
  27. package/styles/all.expanded.css +230 -34
  28. package/styles/all.expanded.unlayered.css +230 -34
  29. package/styles/all.unlayered.css +1 -1
  30. package/styles/components/_bundle.scss +8 -4
  31. package/styles/components/combobox.scss +29 -6
  32. package/styles/components/date-picker.scss +9 -3
  33. package/styles/components/multi-combobox.scss +18 -3
  34. package/styles/components/multi-select.scss +28 -9
  35. package/styles/components/notice.scss +7 -5
  36. package/styles/components/search-select.scss +244 -0
  37. package/styles/components/segmented-control.scss +10 -5
  38. package/styles/components/select.scss +16 -7
  39. package/styles/components/sidebar.scss +31 -22
  40. package/styles/components/tabs.scss +26 -15
  41. package/tui-manifest.json +75 -2
  42. package/utils/color/color.js +14 -2
  43. package/utils/listbox/blur.d.ts +14 -0
  44. package/utils/listbox/blur.js +51 -0
  45. package/utils/listbox/filter-active-index.d.ts +16 -0
  46. package/utils/listbox/filter-active-index.js +72 -0
  47. package/utils/listbox/floating.d.ts +7 -0
  48. package/utils/listbox/floating.js +34 -0
  49. package/utils/listbox/group.d.ts +26 -0
  50. package/utils/listbox/group.js +40 -0
  51. package/utils/listbox/ids.d.ts +9 -0
  52. package/utils/listbox/ids.js +31 -0
  53. package/utils/listbox/index.d.ts +9 -0
  54. package/utils/listbox/index.js +11 -0
  55. package/utils/listbox/navigation.d.ts +27 -0
  56. package/utils/listbox/navigation.js +53 -0
  57. package/utils/listbox/registry.d.ts +61 -0
  58. package/utils/listbox/registry.js +121 -0
  59. package/utils/listbox/scroll.d.ts +7 -0
  60. package/utils/listbox/scroll.js +15 -0
  61. package/utils/listbox/trigger.d.ts +16 -0
  62. package/utils/listbox/trigger.js +35 -0
@@ -35,6 +35,7 @@
35
35
  @use "./sidebar" as sidebar;
36
36
  @use "./step-indicator" as stepindicator;
37
37
  @use "./search-input" as searchinput;
38
+ @use "./search-select" as searchselect;
38
39
  @use "./step-list" as steplist;
39
40
  @use "./table" as table;
40
41
  @use "./tabs" as tabs;
@@ -53,10 +54,11 @@
53
54
  // gradient-picker renders TextInput internally for its numeric fields.
54
55
  // NOTE: a subset build requesting gradient-picker must ALSO request
55
56
  // color-picker, popover, select, tooltip, button, and icon-button — the
56
- // panel composes all of them. The dependents mechanism below only covers the
57
- // input core; extend it to full dependency sets if subset builds become a
58
- // real workflow (Pager has the same latent gap).
59
- $-input-dependents: (input, field, text-input, textarea, pager, search-input, gradient-picker);
57
+ // panel composes all of them. Likewise search-select must also request
58
+ // search-input (its panel embeds one). The dependents mechanism below only
59
+ // covers the input core; extend it to full dependency sets if subset builds
60
+ // become a real workflow (Pager has the same latent gap).
61
+ $-input-dependents: (input, field, text-input, textarea, pager, search-input, search-select, gradient-picker);
60
62
 
61
63
  @function -needs-input($only) {
62
64
  @if $only == null {
@@ -92,6 +94,8 @@ $-input-dependents: (input, field, text-input, textarea, pager, search-input, gr
92
94
  @if -wants($only, field) { @include field.styles(); }
93
95
  @if -wants($only, multi-select) { @include multiselect.styles(); }
94
96
  @if -wants($only, select) { @include select.styles(); }
97
+ // search-select embeds a SearchInput, hence its place in $-input-dependents
98
+ @if -wants($only, search-select) { @include searchselect.styles(); }
95
99
  @if -needs-input($only) { @include input.styles(); }
96
100
  @include icon.styles();
97
101
  @if -wants($only, icon-button) { @include iconbutton.styles(); }
@@ -62,6 +62,20 @@ $_label-letter-spacing: 0.05em;
62
62
  position: relative;
63
63
  display: flex;
64
64
  align-items: center;
65
+ // The chevron and clear button are siblings of the input, outside its
66
+ // control-sizing scope — they'd inherit the interface base font and ignore
67
+ // --tui-control-font-size-* remaps. Key the wrapper to the control font so
68
+ // both track it; the input sets its own font via control-sizing, so it's
69
+ // unaffected. Size classes live on the input, hence :has().
70
+ font-size: var(--#{sys.$prefix}control-font-size-md, var(--#{sys.$prefix}typography-size-md));
71
+
72
+ &:has(> .#{sys.$prefix}combobox__input.is-size-sm) {
73
+ font-size: var(--#{sys.$prefix}control-font-size-sm, var(--#{sys.$prefix}typography-size-sm));
74
+ }
75
+
76
+ &:has(> .#{sys.$prefix}combobox__input.is-size-lg) {
77
+ font-size: var(--#{sys.$prefix}control-font-size-lg, var(--#{sys.$prefix}typography-size-lg));
78
+ }
65
79
  }
66
80
 
67
81
  // ---------------------------------------------------------------------------
@@ -159,10 +173,14 @@ $_label-letter-spacing: 0.05em;
159
173
  outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
160
174
  outline-offset: var(--#{sys.$prefix}focus-ring-offset);
161
175
  }
176
+ }
162
177
 
163
- :disabled ~ & {
164
- pointer-events: none;
165
- }
178
+ // Disabled input → inert clear (belt-and-braces; the clear doesn't render
179
+ // while disabled). Top-level: trailing `&` would splice the interface prefix
180
+ // after the sibling combinator and never match.
181
+ .#{sys.$prefix}interface
182
+ .#{sys.$prefix}combobox__input:disabled ~ .#{sys.$prefix}combobox__clear {
183
+ pointer-events: none;
166
184
  }
167
185
 
168
186
  // ---------------------------------------------------------------------------
@@ -178,10 +196,15 @@ $_label-letter-spacing: 0.05em;
178
196
  color: var(--#{sys.$prefix}color-fg-muted);
179
197
  pointer-events: none;
180
198
  transition: transform var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
199
+ }
181
200
 
182
- [aria-expanded="true"] ~ & {
183
- transform: rotate(180deg);
184
- }
201
+ // Open-state rotation. NOT `[aria-expanded="true"] ~ &` inside the icon
202
+ // block — trailing `&` substitutes the FULL parent selector (interface
203
+ // prefix included), compiling to a sibling combinator against
204
+ // `.tui-interface` that matches nothing.
205
+ .#{sys.$prefix}interface
206
+ .#{sys.$prefix}combobox__input[aria-expanded="true"] ~ .#{sys.$prefix}combobox__icon {
207
+ transform: rotate(180deg);
185
208
  }
186
209
 
187
210
  // ---------------------------------------------------------------------------
@@ -17,7 +17,7 @@
17
17
  // ==========================================================================
18
18
  //
19
19
  // Component API tokens (never defined here, only read via fallback):
20
- // --tui-calendar-cell-size Day cell square (default 2.5rem)
20
+ // --tui-calendar-cell-size Day cell square (default 2.5 × control-font-md, i.e. 2.5rem)
21
21
  // --tui-calendar-cell-radius Day cell radius (default full circle)
22
22
  // --tui-calendar-selected-bg Selected/range-endpoint fill
23
23
  // --tui-calendar-selected-fg Selected/range-endpoint text
@@ -32,7 +32,13 @@
32
32
  // Calendar
33
33
  // ---------------------------------------------------------------------------
34
34
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}calendar {
35
- --_cell: var(--#{sys.$prefix}calendar-cell-size, 2.5rem);
35
+ // Day/month buttons and cell geometry track the control font, so a
36
+ // context's --tui-control-font-size-md remap scales the whole calendar.
37
+ // Fallbacks are inherit/rem (NOT the md typography rung): the calendar
38
+ // inherits 14px inside the popover (.tui-popover sets typography-size-sm),
39
+ // so a hard md default would grow picker text. Unset token = no change.
40
+ --_cell: var(--#{sys.$prefix}calendar-cell-size, calc(2.5 * var(--#{sys.$prefix}control-font-size-md, 1rem)));
41
+ font-size: var(--#{sys.$prefix}control-font-size-md, 1em);
36
42
  --_cell-radius: var(--#{sys.$prefix}calendar-cell-radius, var(--#{sys.$prefix}radius-full, 999px));
37
43
  --_selected-bg: var(--#{sys.$prefix}calendar-selected-bg, var(--#{sys.$prefix}theme-primary-base));
38
44
  --_selected-fg: var(--#{sys.$prefix}calendar-selected-fg, var(--#{sys.$prefix}color-fg-on-accent));
@@ -81,7 +87,7 @@
81
87
  block-size: var(--_cell);
82
88
  color: var(--#{sys.$prefix}color-fg-muted);
83
89
  font-weight: var(--#{sys.$prefix}typography-weight-normal, 400);
84
- font-size: var(--#{sys.$prefix}typography-size-sm);
90
+ font-size: var(--#{sys.$prefix}control-font-size-sm, var(--#{sys.$prefix}typography-size-sm));
85
91
  }
86
92
 
87
93
  &__day {
@@ -136,6 +136,13 @@ $_token-row-padding: 2px;
136
136
  flex: none;
137
137
  }
138
138
 
139
+ // Token-field chips size em-relative to their host control (see MultiSelect
140
+ // for the rationale and the 0.875em ratio). Chained .tui-chip outranks the
141
+ // Chip size presets' own font-size.
142
+ .#{sys.$prefix}interface .#{sys.$prefix}multicombobox__chip.#{sys.$prefix}chip {
143
+ font-size: 0.875em;
144
+ }
145
+
139
146
  // ---------------------------------------------------------------------------
140
147
  // Overflow: trim — single line, chips clip toward the inline-start
141
148
  // ---------------------------------------------------------------------------
@@ -255,13 +262,21 @@ $_token-row-padding: 2px;
255
262
  display: flex;
256
263
  align-items: center;
257
264
  justify-content: center;
265
+ // No font-size here: the icon is a direct child of __control, which
266
+ // carries control-sizing — it already inherits the control font at every
267
+ // size tier (unlike Combobox's icon, whose wrapper needed the ladder).
258
268
  color: var(--#{sys.$prefix}color-fg-muted);
259
269
  pointer-events: none;
260
270
  transition: transform var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
271
+ }
261
272
 
262
- .#{sys.$prefix}multicombobox__control:has(input[aria-expanded="true"]) & {
263
- transform: rotate(180deg);
264
- }
273
+ // Open-state rotation. NOT `:has(...) &` inside the icon block — trailing
274
+ // `&` substitutes the FULL parent selector (interface prefix included),
275
+ // producing a descendant chain through `.tui-interface` that matches nothing.
276
+ .#{sys.$prefix}interface
277
+ .#{sys.$prefix}multicombobox__control:has(input[aria-expanded="true"])
278
+ .#{sys.$prefix}multicombobox__icon {
279
+ transform: rotate(180deg);
265
280
  }
266
281
 
267
282
  // ---------------------------------------------------------------------------
@@ -154,6 +154,15 @@ $_chip-max-width: 120px;
154
154
  // token chips. The --tui-multiselect-chip-* override hooks are preserved by
155
155
  // mapping them onto the Chip tokens; when unset, the Chip's own secondary
156
156
  // default applies (the aligned look).
157
+ // Token-field chips size em-relative to their HOST CONTROL (the trigger's
158
+ // control font), not the global typography ladder — so contexts that resize
159
+ // controls get proportional chips for free. 0.875em preserves the historic
160
+ // default ratio (14px chip in a 16px-type md control) within a subpixel.
161
+ // Chained .tui-chip outranks the Chip size presets' own font-size.
162
+ .#{sys.$prefix}interface .#{sys.$prefix}multiselect__chip.#{sys.$prefix}chip {
163
+ font-size: 0.875em;
164
+ }
165
+
157
166
  .#{sys.$prefix}interface .#{sys.$prefix}multiselect__chip {
158
167
  --#{sys.$prefix}chip-bg: var(--#{sys.$prefix}multiselect-chip-bg);
159
168
  --#{sys.$prefix}chip-fg: var(--#{sys.$prefix}multiselect-chip-fg);
@@ -202,19 +211,26 @@ $_chip-max-width: 120px;
202
211
  background-color: var(--#{sys.$prefix}color-fill-subtle);
203
212
  }
204
213
 
205
- [data-disabled] & {
206
- pointer-events: none;
207
- }
208
214
  }
209
215
 
210
216
  .#{sys.$prefix}interface .#{sys.$prefix}multiselect__icon {
211
217
  flex-shrink: 0;
212
218
  color: var(--#{sys.$prefix}color-fg-muted);
213
219
  transition: transform var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
220
+ }
214
221
 
215
- [data-state="open"] & {
216
- transform: rotate(180deg);
217
- }
222
+ // Trigger-state styling for the parts above. Top-level rules: trailing `&`
223
+ // would splice the interface prefix after the attribute selector
224
+ // (`[data-state] .tui-interface …`) and never match. The trigger carries
225
+ // data-state, and data-disabled (asChild) or native disabled (default).
226
+ .#{sys.$prefix}interface
227
+ .#{sys.$prefix}multiselect__trigger:is([data-disabled], [disabled]) .#{sys.$prefix}multiselect__clear {
228
+ pointer-events: none;
229
+ }
230
+
231
+ .#{sys.$prefix}interface
232
+ .#{sys.$prefix}multiselect__trigger[data-state="open"] .#{sys.$prefix}multiselect__icon {
233
+ transform: rotate(180deg);
218
234
  }
219
235
 
220
236
  // ---------------------------------------------------------------------------
@@ -359,10 +375,13 @@ $_chip-max-width: 120px;
359
375
  background-color: var(--#{sys.$prefix}theme-primary-base);
360
376
  border-color: var(--#{sys.$prefix}theme-primary-base);
361
377
  }
378
+ }
362
379
 
363
- [data-disabled] & {
364
- opacity: var(--#{sys.$prefix}opacity-disabled);
365
- }
380
+ // Top-level: trailing `&` would splice the interface prefix after the
381
+ // attribute selector and never match. data-disabled lives on the option row.
382
+ :where(.#{sys.$prefix}interface)
383
+ .#{sys.$prefix}multiselect__option[data-disabled] .#{sys.$prefix}multiselect__checkbox {
384
+ opacity: var(--#{sys.$prefix}opacity-disabled);
366
385
  }
367
386
 
368
387
  // ---------------------------------------------------------------------------
@@ -11,6 +11,7 @@
11
11
  --tui-notice-padding
12
12
  --tui-notice-gap
13
13
  --tui-notice-para-gap
14
+ --tui-notice-icon
14
15
  --tui-notice-title-size
15
16
  --tui-notice-foot-basis
16
17
  */
@@ -31,6 +32,7 @@
31
32
  // --tui-notice-padding Padding
32
33
  // --tui-notice-gap Gap between head items / inner slots (defaults per size preset)
33
34
  // --tui-notice-para-gap Spacing between body paragraphs (defaults per size preset)
35
+ // --tui-notice-icon Icon color (defaults to the theme base per variant)
34
36
  // --tui-notice-title-size Title font size (defaults per size preset)
35
37
  // --tui-notice-foot-basis Flex basis for foot in inline layout
36
38
  //
@@ -324,7 +326,7 @@
324
326
  --_bg-hover: var(--#{sys.$prefix}theme-info-subtle);
325
327
  --_border: var(--#{sys.$prefix}notice-border, var(--#{sys.$prefix}theme-info-subtle));
326
328
  --_stripe: var(--#{sys.$prefix}notice-stripe, var(--#{sys.$prefix}theme-info-base));
327
- --_icon-color: var(--#{sys.$prefix}theme-info-base);
329
+ --_icon-color: var(--#{sys.$prefix}notice-icon, var(--#{sys.$prefix}theme-info-base));
328
330
  }
329
331
 
330
332
  &.is-theme-success {
@@ -332,7 +334,7 @@
332
334
  --_bg-hover: var(--#{sys.$prefix}theme-success-subtle);
333
335
  --_border: var(--#{sys.$prefix}notice-border, var(--#{sys.$prefix}theme-success-subtle));
334
336
  --_stripe: var(--#{sys.$prefix}notice-stripe, var(--#{sys.$prefix}theme-success-base));
335
- --_icon-color: var(--#{sys.$prefix}theme-success-base);
337
+ --_icon-color: var(--#{sys.$prefix}notice-icon, var(--#{sys.$prefix}theme-success-base));
336
338
  }
337
339
 
338
340
  &.is-theme-warning {
@@ -340,7 +342,7 @@
340
342
  --_bg-hover: var(--#{sys.$prefix}theme-warning-subtle);
341
343
  --_border: var(--#{sys.$prefix}notice-border, var(--#{sys.$prefix}theme-warning-subtle));
342
344
  --_stripe: var(--#{sys.$prefix}notice-stripe, var(--#{sys.$prefix}theme-warning-base));
343
- --_icon-color: var(--#{sys.$prefix}theme-warning-base);
345
+ --_icon-color: var(--#{sys.$prefix}notice-icon, var(--#{sys.$prefix}theme-warning-base));
344
346
  }
345
347
 
346
348
  &.is-theme-danger {
@@ -348,7 +350,7 @@
348
350
  --_bg-hover: var(--#{sys.$prefix}theme-danger-subtle);
349
351
  --_border: var(--#{sys.$prefix}notice-border, var(--#{sys.$prefix}theme-danger-subtle));
350
352
  --_stripe: var(--#{sys.$prefix}notice-stripe, var(--#{sys.$prefix}theme-danger-base));
351
- --_icon-color: var(--#{sys.$prefix}theme-danger-base);
353
+ --_icon-color: var(--#{sys.$prefix}notice-icon, var(--#{sys.$prefix}theme-danger-base));
352
354
  }
353
355
 
354
356
  // No-status treatment on the neutral palette, for resting/empty states.
@@ -357,7 +359,7 @@
357
359
  --_bg-hover: var(--#{sys.$prefix}color-bg-muted);
358
360
  --_border: var(--#{sys.$prefix}notice-border, var(--#{sys.$prefix}color-border));
359
361
  --_stripe: var(--#{sys.$prefix}notice-stripe, var(--#{sys.$prefix}color-fg-muted));
360
- --_icon-color: var(--#{sys.$prefix}color-fg-muted);
362
+ --_icon-color: var(--#{sys.$prefix}notice-icon, var(--#{sys.$prefix}color-fg-muted));
361
363
  }
362
364
 
363
365
  // -------------------------------------------------------------------------
@@ -0,0 +1,244 @@
1
+ @use "../system" as sys;
2
+
3
+ /* @tui-tokens
4
+ --tui-search-select-trigger-bg
5
+ --tui-search-select-trigger-fg
6
+ --tui-search-select-trigger-border
7
+ --tui-search-select-trigger-border-focus
8
+ --tui-search-select-trigger-radius
9
+ --tui-search-select-panel-bg
10
+ --tui-search-select-panel-border
11
+ --tui-search-select-panel-shadow
12
+ --tui-search-select-panel-radius
13
+ --tui-search-select-panel-width
14
+ --tui-search-select-option-bg-hover
15
+ --tui-search-select-option-bg-selected
16
+ */
17
+
18
+ @mixin styles() {
19
+ // ==========================================================================
20
+ // SearchSelect
21
+ // ==========================================================================
22
+ //
23
+ // Component API tokens (never defined here, only read via fallback — the
24
+ // fallback chain runs through Select's tokens so context remaps of the
25
+ // 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
28
+ // --tui-search-select-panel-width Panel inline-size (default: reference
29
+ // width via the floating min-width)
30
+ // --tui-search-select-option-bg-hover / -bg-selected
31
+ //
32
+ // ==========================================================================
33
+
34
+ // ---------------------------------------------------------------------------
35
+ // Root
36
+ // ---------------------------------------------------------------------------
37
+ .#{sys.$prefix}interface .#{sys.$prefix}search-select {
38
+ position: relative;
39
+ display: inline-block;
40
+ width: 100%;
41
+ }
42
+
43
+ // ---------------------------------------------------------------------------
44
+ // Trigger — a select-shaped button
45
+ // ---------------------------------------------------------------------------
46
+ .#{sys.$prefix}interface .#{sys.$prefix}search-select__trigger {
47
+ --_bg: var(--#{sys.$prefix}search-select-trigger-bg, var(--#{sys.$prefix}select-trigger-bg, var(--#{sys.$prefix}color-bg-surface)));
48
+ --_fg: var(--#{sys.$prefix}search-select-trigger-fg, var(--#{sys.$prefix}select-trigger-fg, var(--#{sys.$prefix}color-fg)));
49
+ --_border: var(--#{sys.$prefix}search-select-trigger-border, var(--#{sys.$prefix}select-trigger-border, var(--#{sys.$prefix}color-border)));
50
+ --_border-focus: var(--#{sys.$prefix}search-select-trigger-border-focus, var(--#{sys.$prefix}select-trigger-border-focus, var(--#{sys.$prefix}theme-primary-base)));
51
+ --_radius: var(--#{sys.$prefix}search-select-trigger-radius, var(--#{sys.$prefix}select-trigger-radius, var(--#{sys.$prefix}radius-md)));
52
+
53
+ // Reset
54
+ appearance: none;
55
+ margin: 0;
56
+
57
+ // Unified control sizing (height + font ladder)
58
+ @include sys.control-sizing(sys.$prefix);
59
+
60
+ display: inline-flex;
61
+ align-items: center;
62
+ justify-content: space-between;
63
+ gap: var(--#{sys.$prefix}spacing-xs);
64
+ width: 100%;
65
+ padding-inline: var(--#{sys.$prefix}spacing-sm);
66
+ text-align: start;
67
+
68
+ background-color: var(--_bg);
69
+ color: var(--_fg);
70
+ border: var(--#{sys.$prefix}border-width) solid var(--_border);
71
+ border-radius: var(--_radius);
72
+ cursor: pointer;
73
+ transition: border-color var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
74
+
75
+ &:focus-visible {
76
+ border-color: var(--_border-focus);
77
+ outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
78
+ outline-offset: var(--#{sys.$prefix}focus-ring-offset);
79
+ }
80
+
81
+ &:disabled {
82
+ opacity: var(--#{sys.$prefix}opacity-disabled);
83
+ cursor: not-allowed;
84
+ }
85
+ }
86
+
87
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-select__value {
88
+ flex: 1 1 auto;
89
+ overflow: hidden;
90
+ text-overflow: ellipsis;
91
+ white-space: nowrap;
92
+ }
93
+
94
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-select__placeholder {
95
+ color: var(--#{sys.$prefix}input-fg-placeholder, var(--#{sys.$prefix}color-fg-muted));
96
+ }
97
+
98
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-select__icon {
99
+ flex-shrink: 0;
100
+ color: var(--#{sys.$prefix}color-fg-muted);
101
+ transition: transform var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
102
+ }
103
+
104
+ // Open-state rotation — top-level rule (trailing `&` splices the interface
105
+ // prefix into an impossible position; see the CLAUDE.md Sass gotcha)
106
+ .#{sys.$prefix}interface
107
+ .#{sys.$prefix}search-select__trigger[data-state="open"] .#{sys.$prefix}search-select__icon {
108
+ transform: rotate(180deg);
109
+ }
110
+
111
+ // ---------------------------------------------------------------------------
112
+ // Panel — dialog holding the search field + listbox
113
+ // ---------------------------------------------------------------------------
114
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-select__panel {
115
+ --_bg: var(--#{sys.$prefix}search-select-panel-bg, var(--#{sys.$prefix}select-content-bg, var(--#{sys.$prefix}color-bg-elevated)));
116
+ --_border: var(--#{sys.$prefix}search-select-panel-border, var(--#{sys.$prefix}select-content-border, var(--#{sys.$prefix}color-border)));
117
+ --_shadow: var(--#{sys.$prefix}search-select-panel-shadow, var(--#{sys.$prefix}select-content-shadow, var(--#{sys.$prefix}shadow-dropdown)));
118
+ --_radius: var(--#{sys.$prefix}search-select-panel-radius, var(--#{sys.$prefix}select-content-radius, var(--#{sys.$prefix}radius-md)));
119
+
120
+ z-index: var(--#{sys.$prefix}layer-top);
121
+ inline-size: var(--#{sys.$prefix}search-select-panel-width, auto);
122
+
123
+ // The floating size middleware caps max-height on THIS element; flex keeps
124
+ // the search field pinned while the listbox scrolls.
125
+ display: flex;
126
+ flex-direction: column;
127
+ pointer-events: auto;
128
+
129
+ background-color: var(--_bg);
130
+ border: var(--#{sys.$prefix}border-width) solid var(--_border);
131
+ border-radius: var(--_radius);
132
+ box-shadow: var(--_shadow);
133
+
134
+ animation: #{sys.$prefix}fadeFromTransparent var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
135
+ }
136
+
137
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-select__search {
138
+ flex-shrink: 0;
139
+ padding: var(--#{sys.$prefix}spacing-xs);
140
+ border-block-end: var(--#{sys.$prefix}border-width) solid var(--#{sys.$prefix}color-border);
141
+ }
142
+
143
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-select__listbox {
144
+ flex: 1 1 auto;
145
+ min-block-size: 0;
146
+ padding: var(--#{sys.$prefix}spacing-xxs);
147
+ overflow-y: auto;
148
+ overscroll-behavior: contain;
149
+
150
+ scrollbar-width: thin;
151
+ scrollbar-color: var(--#{sys.$prefix}color-fg-muted) transparent;
152
+ }
153
+
154
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-select__empty {
155
+ padding: var(--#{sys.$prefix}spacing-sm);
156
+ color: var(--#{sys.$prefix}color-fg-muted);
157
+ font-size: var(--#{sys.$prefix}typography-size-sm);
158
+ text-align: center;
159
+ }
160
+
161
+ // ---------------------------------------------------------------------------
162
+ // Option — mirrors Select's option anatomy
163
+ // ---------------------------------------------------------------------------
164
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-select__option {
165
+ --_option-bg-hover: var(--#{sys.$prefix}search-select-option-bg-hover, var(--#{sys.$prefix}select-option-bg-hover, var(--#{sys.$prefix}color-fill-subtle)));
166
+ --_option-bg-selected: var(--#{sys.$prefix}search-select-option-bg-selected, var(--#{sys.$prefix}select-option-bg-selected, var(--#{sys.$prefix}theme-primary-subtlest)));
167
+
168
+ display: flex;
169
+ align-items: center;
170
+ justify-content: space-between;
171
+ gap: var(--#{sys.$prefix}spacing-xs);
172
+ padding: var(--#{sys.$prefix}spacing-xxs) var(--#{sys.$prefix}spacing-sm);
173
+ border-radius: var(--#{sys.$prefix}radius-sm);
174
+ color: var(--#{sys.$prefix}color-fg);
175
+ font-size: var(--#{sys.$prefix}typography-size-sm);
176
+ cursor: pointer;
177
+ user-select: none;
178
+
179
+ @media (hover: hover) {
180
+ &:hover {
181
+ background-color: var(--_option-bg-hover);
182
+ }
183
+ }
184
+
185
+ &[data-highlighted] {
186
+ background-color: var(--_option-bg-hover);
187
+ }
188
+
189
+ &[aria-selected="true"] {
190
+ background-color: var(--_option-bg-selected);
191
+ }
192
+
193
+ &[data-disabled] {
194
+ opacity: var(--#{sys.$prefix}opacity-disabled);
195
+ cursor: not-allowed;
196
+ }
197
+ }
198
+
199
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-select__option-content {
200
+ flex: 1 1 auto;
201
+ overflow: hidden;
202
+ text-overflow: ellipsis;
203
+ white-space: nowrap;
204
+ }
205
+
206
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-select__option-check {
207
+ flex-shrink: 0;
208
+ color: var(--#{sys.$prefix}theme-primary-base);
209
+ }
210
+
211
+ // ---------------------------------------------------------------------------
212
+ // Group / Label
213
+ // ---------------------------------------------------------------------------
214
+ // A group whose options all filtered out hides entirely — otherwise its
215
+ // heading lingers over nothing (and over the "No results" state).
216
+ :where(.#{sys.$prefix}interface)
217
+ .#{sys.$prefix}search-select__group:not(:has(.#{sys.$prefix}search-select__option)) {
218
+ display: none;
219
+ }
220
+
221
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-select__group + .#{sys.$prefix}search-select__group {
222
+ margin-block-start: var(--#{sys.$prefix}spacing-xxs);
223
+ padding-block-start: var(--#{sys.$prefix}spacing-xxs);
224
+ border-block-start: var(--#{sys.$prefix}border-width) solid var(--#{sys.$prefix}color-border);
225
+ }
226
+
227
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-select__label {
228
+ padding: var(--#{sys.$prefix}spacing-xxs) var(--#{sys.$prefix}spacing-sm);
229
+ color: var(--#{sys.$prefix}color-fg-muted);
230
+ font-size: var(--#{sys.$prefix}typography-size-xs);
231
+ font-weight: var(--#{sys.$prefix}typography-weight-medium, 600);
232
+ text-transform: uppercase;
233
+ letter-spacing: 0.05em;
234
+ }
235
+
236
+ // High-contrast mode: keep highlighted/selected legible
237
+ @media (forced-colors: active) {
238
+ .#{sys.$prefix}interface .#{sys.$prefix}search-select__option[data-highlighted] {
239
+ background-color: Highlight;
240
+ color: HighlightText;
241
+ forced-color-adjust: none;
242
+ }
243
+ }
244
+ }
@@ -71,7 +71,9 @@
71
71
 
72
72
  display: inline-flex;
73
73
  flex-wrap: nowrap;
74
- font-size: var(--#{sys.$prefix}typography-size-sm);
74
+ // Joins the control-font ladder like every other form control; historic
75
+ // typography-size fallbacks keep the defaults unchanged.
76
+ font-size: var(--#{sys.$prefix}control-font-size-md, var(--#{sys.$prefix}typography-size-sm));
75
77
  gap: var(--_gap);
76
78
  padding: var(--_padding);
77
79
  background: var(--_bg);
@@ -229,19 +231,22 @@
229
231
  // ---------------------------------------------------------------------------
230
232
 
231
233
  // xs: inline micro-switchers (e.g. a picker's AM/PM toggle) — tightest
232
- // padding and gap on the track, tightest padding on the items.
234
+ // padding and gap on the track, tightest padding on the items. There is no
235
+ // xs rung on the control-font ladder; xs borrows sm's, which mirrors the
236
+ // historic behaviour (xs and sm always shared typography-size-xs — they
237
+ // differ in track/item padding and control height, not font).
233
238
  .#{sys.$prefix}interface .#{sys.$prefix}segmented.is-size-xs {
234
239
  --_gap: var(--#{sys.$prefix}segmented-gap, #{$_track-gap-xs});
235
240
  --_padding: var(--#{sys.$prefix}segmented-padding, #{$_track-padding-xs});
236
- font-size: var(--#{sys.$prefix}typography-size-xs);
241
+ font-size: var(--#{sys.$prefix}control-font-size-sm, var(--#{sys.$prefix}typography-size-xs));
237
242
  }
238
243
 
239
244
  .#{sys.$prefix}interface .#{sys.$prefix}segmented.is-size-sm {
240
- font-size: var(--#{sys.$prefix}typography-size-xs);
245
+ font-size: var(--#{sys.$prefix}control-font-size-sm, var(--#{sys.$prefix}typography-size-xs));
241
246
  }
242
247
 
243
248
  .#{sys.$prefix}interface .#{sys.$prefix}segmented.is-size-lg {
244
- font-size: var(--#{sys.$prefix}typography-size-md);
249
+ font-size: var(--#{sys.$prefix}control-font-size-lg, var(--#{sys.$prefix}typography-size-md));
245
250
  }
246
251
 
247
252
  .#{sys.$prefix}interface .#{sys.$prefix}segmented.is-size-xs .#{sys.$prefix}segmented__item {
@@ -146,9 +146,14 @@ $_label-letter-spacing: 0.05em;
146
146
  color: var(--#{sys.$prefix}color-fg-muted);
147
147
  transition: transform var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
148
148
 
149
- [data-state="open"] & {
150
- transform: rotate(180deg);
151
- }
149
+ }
150
+
151
+ // Open-state rotation. Top-level: trailing `&` would splice the interface
152
+ // prefix after the attribute selector and never match. data-state lives on
153
+ // the trigger; the icon is inside it.
154
+ :where(.#{sys.$prefix}interface)
155
+ .#{sys.$prefix}select__trigger[data-state="open"] .#{sys.$prefix}select__icon {
156
+ transform: rotate(180deg);
152
157
  }
153
158
 
154
159
  // ---------------------------------------------------------------------------
@@ -191,11 +196,15 @@ $_label-letter-spacing: 0.05em;
191
196
  outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
192
197
  outline-offset: var(--#{sys.$prefix}focus-ring-offset);
193
198
  }
199
+ }
194
200
 
195
- [data-disabled] &,
196
- [disabled] & {
197
- pointer-events: none;
198
- }
201
+ // Disabled trigger → inert clear. Top-level: trailing `&` would splice the
202
+ // interface prefix after the attribute selector and never match. The clear
203
+ // is the trigger's SIBLING inside __trigger-wrap; the trigger carries
204
+ // data-disabled (asChild) or native disabled (default).
205
+ :where(.#{sys.$prefix}interface)
206
+ .#{sys.$prefix}select__trigger:is([data-disabled], [disabled]) ~ .#{sys.$prefix}select__clear {
207
+ pointer-events: none;
199
208
  }
200
209
 
201
210
  // ---------------------------------------------------------------------------