@tangible/ui 0.0.21 → 0.2.0

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 (72) hide show
  1. package/components/Button/Button.js +6 -8
  2. package/components/Button/types.d.ts +5 -7
  3. package/components/Chip/Chip.d.ts +28 -0
  4. package/components/Chip/Chip.js +19 -3
  5. package/components/Combobox/Combobox.d.ts +1 -1
  6. package/components/Combobox/Combobox.js +2 -2
  7. package/components/Combobox/types.d.ts +13 -0
  8. package/components/DatePicker/Calendar.d.ts +12 -0
  9. package/components/DatePicker/Calendar.js +145 -0
  10. package/components/DatePicker/DatePicker.d.ts +23 -0
  11. package/components/DatePicker/DatePicker.js +123 -0
  12. package/components/DatePicker/DateRangePicker.d.ts +16 -0
  13. package/components/DatePicker/DateRangePicker.js +114 -0
  14. package/components/DatePicker/date-utils.d.ts +51 -0
  15. package/components/DatePicker/date-utils.js +228 -0
  16. package/components/DatePicker/index.d.ts +8 -0
  17. package/components/DatePicker/index.js +6 -0
  18. package/components/DatePicker/presets.d.ts +3 -0
  19. package/components/DatePicker/presets.js +37 -0
  20. package/components/DatePicker/types.d.ts +138 -0
  21. package/components/DatePicker/types.js +39 -0
  22. package/components/IconButton/types.d.ts +2 -2
  23. package/components/MultiCombobox/MultiCombobox.d.ts +33 -0
  24. package/components/MultiCombobox/MultiCombobox.js +595 -0
  25. package/components/MultiCombobox/MultiComboboxContext.d.ts +8 -0
  26. package/components/MultiCombobox/MultiComboboxContext.js +36 -0
  27. package/components/MultiCombobox/index.d.ts +3 -0
  28. package/components/MultiCombobox/index.js +2 -0
  29. package/components/MultiCombobox/types.d.ts +244 -0
  30. package/components/MultiCombobox/types.js +7 -0
  31. package/components/MultiSelect/MultiSelect.js +22 -2
  32. package/components/Popover/Popover.js +16 -2
  33. package/components/SegmentedControl/types.d.ts +2 -2
  34. package/components/Select/Select.js +14 -0
  35. package/components/Slider/Slider.d.ts +2 -0
  36. package/components/Slider/Slider.js +29 -0
  37. package/components/Slider/index.d.ts +2 -0
  38. package/components/Slider/index.js +1 -0
  39. package/components/Slider/types.d.ts +39 -0
  40. package/components/Slider/types.js +1 -0
  41. package/components/index.d.ts +4 -0
  42. package/components/index.js +3 -0
  43. package/package.json +13 -1
  44. package/styles/all.css +1 -1
  45. package/styles/all.expanded.css +1181 -187
  46. package/styles/all.expanded.unlayered.css +1181 -187
  47. package/styles/all.unlayered.css +1 -1
  48. package/styles/components/_bundle.scss +6 -0
  49. package/styles/components/button.scss +59 -43
  50. package/styles/components/card.scss +1 -1
  51. package/styles/components/chip.scss +84 -10
  52. package/styles/components/combobox.scss +16 -2
  53. package/styles/components/date-picker.scss +400 -0
  54. package/styles/components/icon-button.scss +36 -30
  55. package/styles/components/input/index.scss +1 -2
  56. package/styles/components/multi-combobox.scss +457 -0
  57. package/styles/components/multi-select.scss +34 -18
  58. package/styles/components/notice.scss +15 -6
  59. package/styles/components/pager.scss +4 -2
  60. package/styles/components/popover.scss +6 -0
  61. package/styles/components/progress.scss +23 -6
  62. package/styles/components/segmented-control.scss +53 -15
  63. package/styles/components/select.scss +19 -3
  64. package/styles/components/slider.scss +184 -0
  65. package/styles/components/switch.scss +1 -1
  66. package/styles/core.css +1 -1
  67. package/styles/core.unlayered.css +1 -1
  68. package/styles/system/_control.scss +9 -8
  69. package/styles/system/_tokens.scss +16 -0
  70. package/tui-manifest.json +311 -14
  71. package/utils/portal.d.ts +0 -4
  72. package/utils/portal.js +38 -5
@@ -11,6 +11,11 @@
11
11
  --tui-progress-z3-fill
12
12
  --tui-progress-z4-fill
13
13
  --tui-progress-z5-fill
14
+ --tui-progress-z1-label
15
+ --tui-progress-z2-label
16
+ --tui-progress-z3-label
17
+ --tui-progress-z4-label
18
+ --tui-progress-z5-label
14
19
  */
15
20
 
16
21
  @mixin styles() {
@@ -40,6 +45,9 @@
40
45
  // --tui-progress-z3-fill Segment 3 color (default: success)
41
46
  // --tui-progress-z4-fill Segment 4 color (default: danger)
42
47
  // --tui-progress-z5-fill Segment 5 color (default: info)
48
+ // --tui-progress-z*-label Segment label text color (default: the strong
49
+ // step of the same semantic — base fills are area
50
+ // colors and don't reliably clear 4.5:1 as text)
43
51
  //
44
52
  // To override from consuming code:
45
53
  // .my-context .tui-progress { --tui-progress-fill: hotpink; }
@@ -51,7 +59,7 @@
51
59
  --_track: var(--#{sys.$prefix}progress-track, var(--#{sys.$prefix}color-border));
52
60
  --_fill: var(--#{sys.$prefix}progress-fill, var(--#{sys.$prefix}theme-primary-base));
53
61
  --_label: var(--#{sys.$prefix}progress-label, var(--#{sys.$prefix}color-fg));
54
- --_radius: var(--#{sys.$prefix}progress-radius, var(--#{sys.$prefix}radius-md));
62
+ --_radius: var(--#{sys.$prefix}progress-radius, var(--#{sys.$prefix}radius-full));
55
63
  --_block-size: var(--#{sys.$prefix}progress-block-size, 1em);
56
64
 
57
65
  // Runtime vars (set by component)
@@ -220,6 +228,15 @@
220
228
  --_z3: var(--#{sys.$prefix}progress-z3-fill, var(--#{sys.$prefix}theme-success-base));
221
229
  --_z4: var(--#{sys.$prefix}progress-z4-fill, var(--#{sys.$prefix}theme-danger-base));
222
230
  --_z5: var(--#{sys.$prefix}progress-z5-fill, var(--#{sys.$prefix}theme-info-base));
231
+ // Label text is NOT the fill: base-step fills are tuned as area colors
232
+ // and don't reliably clear 4.5:1 as text on the surface canvas. Labels
233
+ // default to the strong step of the same semantic; override per tier
234
+ // via --tui-progress-z*-label when re-theming fills.
235
+ --_z1-label: var(--#{sys.$prefix}progress-z1-label, var(--#{sys.$prefix}theme-primary-strong));
236
+ --_z2-label: var(--#{sys.$prefix}progress-z2-label, var(--#{sys.$prefix}theme-warning-strong));
237
+ --_z3-label: var(--#{sys.$prefix}progress-z3-label, var(--#{sys.$prefix}theme-success-strong));
238
+ --_z4-label: var(--#{sys.$prefix}progress-z4-label, var(--#{sys.$prefix}theme-danger-strong));
239
+ --_z5-label: var(--#{sys.$prefix}progress-z5-label, var(--#{sys.$prefix}theme-info-strong));
223
240
 
224
241
  &.is-mode-line {
225
242
  .#{sys.$prefix}progress__track {
@@ -288,23 +305,23 @@
288
305
  font-weight: 600;
289
306
 
290
307
  &.is-z1 {
291
- color: var(--_z1);
308
+ color: var(--_z1-label);
292
309
  }
293
310
 
294
311
  &.is-z2 {
295
- color: var(--_z2);
312
+ color: var(--_z2-label);
296
313
  }
297
314
 
298
315
  &.is-z3 {
299
- color: var(--_z3);
316
+ color: var(--_z3-label);
300
317
  }
301
318
 
302
319
  &.is-z4 {
303
- color: var(--_z4);
320
+ color: var(--_z4-label);
304
321
  }
305
322
 
306
323
  &.is-z5 {
307
- color: var(--_z5);
324
+ color: var(--_z5-label);
308
325
  }
309
326
  }
310
327
 
@@ -39,20 +39,39 @@
39
39
  //
40
40
  // ==========================================================================
41
41
 
42
+ // Structural constants (em-based scaling, not tokenised) — control-internal
43
+ // spacing follows the Button/Chip convention: em-locked to the control's
44
+ // type size, NOT the page spacing scale. The root carries the per-size
45
+ // font-size so the track's ems and the items' ems share one key.
46
+ $_track-padding: 0.5em;
47
+ $_track-gap: 0.5em;
48
+ $_track-padding-xs: 0.35em;
49
+ $_track-gap-xs: 0.35em;
50
+ $_underline-gap: 1.15em;
51
+ // Block padding stays under the height ladder at every size (the
52
+ // min-height governs; flex centering does the rest) — same rule as Button.
53
+ $_item-padding-block: 0.35em;
54
+ $_item-padding-inline: 1.15em;
55
+ $_item-padding-inline-xs: 0.65em;
56
+ $_item-padding-inline-sm: 1em;
57
+ $_item-padding-inline-lg: 1.5em;
58
+ $_item-gap: 0.5em;
59
+
42
60
  // ---------------------------------------------------------------------------
43
61
  // Root Container
44
62
  // ---------------------------------------------------------------------------
45
63
 
46
64
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}segmented {
47
65
  // Internal tokens with fallback chains
48
- --_gap: var(--#{sys.$prefix}segmented-gap, var(--#{sys.$prefix}spacing-xs));
49
- --_padding: var(--#{sys.$prefix}segmented-padding, var(--#{sys.$prefix}spacing-xs));
66
+ --_gap: var(--#{sys.$prefix}segmented-gap, #{$_track-gap});
67
+ --_padding: var(--#{sys.$prefix}segmented-padding, #{$_track-padding});
50
68
  --_radius: var(--#{sys.$prefix}segmented-radius, var(--#{sys.$prefix}radius-lg));
51
69
  --_bg: var(--#{sys.$prefix}segmented-bg, var(--#{sys.$prefix}color-bg-muted));
52
70
  --_border: var(--#{sys.$prefix}segmented-border, transparent);
53
71
 
54
72
  display: inline-flex;
55
73
  flex-wrap: nowrap;
74
+ font-size: var(--#{sys.$prefix}typography-size-sm);
56
75
  gap: var(--_gap);
57
76
  padding: var(--_padding);
58
77
  background: var(--_bg);
@@ -97,7 +116,7 @@
97
116
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}segmented.is-variant-underline {
98
117
  --_bg: transparent;
99
118
  --_padding: 0;
100
- --_gap: var(--#{sys.$prefix}segmented-gap, var(--#{sys.$prefix}spacing-md));
119
+ --_gap: var(--#{sys.$prefix}segmented-gap, #{$_underline-gap});
101
120
  border-radius: 0;
102
121
  border-block-end: var(--#{sys.$prefix}border-width) solid var(--#{sys.$prefix}color-border);
103
122
  }
@@ -109,7 +128,7 @@
109
128
 
110
129
  .#{sys.$prefix}interface .#{sys.$prefix}segmented__item {
111
130
  // Internal tokens
112
- --_item-padding: var(--#{sys.$prefix}segmented-item-padding, var(--#{sys.$prefix}spacing-sm) var(--#{sys.$prefix}spacing-md));
131
+ --_item-padding: var(--#{sys.$prefix}segmented-item-padding, #{$_item-padding-block} #{$_item-padding-inline});
113
132
  --_item-radius: var(--#{sys.$prefix}segmented-item-radius, var(--#{sys.$prefix}radius-md));
114
133
  --_item-bg: transparent;
115
134
  --_item-fg: var(--#{sys.$prefix}segmented-item-fg, var(--#{sys.$prefix}color-fg-muted));
@@ -120,15 +139,15 @@
120
139
  display: inline-flex;
121
140
  align-items: center;
122
141
  justify-content: center;
123
- min-height: var(--#{sys.$prefix}control-height-md);
124
- gap: var(--#{sys.$prefix}spacing-xs);
142
+ min-height: var(--#{sys.$prefix}control-height-md, 2.5rem);
143
+ // em-based (not tokenised) — icon-to-label spacing scales with font-size
144
+ gap: $_item-gap;
125
145
  padding: var(--_item-padding);
126
146
  border: none;
127
147
  border-radius: var(--_item-radius);
128
148
  background: var(--_item-bg);
129
149
  color: var(--_item-fg);
130
- font: inherit;
131
- font-size: var(--#{sys.$prefix}typography-size-sm);
150
+ font: inherit; // type size comes from the root's per-size font-size
132
151
  font-weight: var(--#{sys.$prefix}typography-weight-medium, 500);
133
152
  line-height: var(--#{sys.$prefix}typography-line-height-tight, 1.25);
134
153
  white-space: nowrap;
@@ -185,7 +204,7 @@
185
204
  --_item-radius: 0;
186
205
  --_item-fg: var(--#{sys.$prefix}segmented-item-fg, var(--#{sys.$prefix}color-fg));
187
206
  --_indicator: var(--#{sys.$prefix}segmented-indicator, var(--#{sys.$prefix}theme-primary-base));
188
- --_indicator-size: var(--#{sys.$prefix}segmented-indicator-size, 2px);
207
+ --_indicator-size: var(--#{sys.$prefix}segmented-indicator-size, var(--#{sys.$prefix}border-width-bold, 2px));
189
208
 
190
209
  margin-block-end: calc(var(--#{sys.$prefix}border-width) * -1);
191
210
  border-bottom: var(--_indicator-size) solid transparent;
@@ -209,16 +228,35 @@
209
228
  // Size Variants
210
229
  // ---------------------------------------------------------------------------
211
230
 
212
- .#{sys.$prefix}interface .#{sys.$prefix}segmented.is-size-sm .#{sys.$prefix}segmented__item {
213
- --_item-padding: var(--#{sys.$prefix}spacing-xs) var(--#{sys.$prefix}spacing-sm);
231
+ // 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.
233
+ .#{sys.$prefix}interface .#{sys.$prefix}segmented.is-size-xs {
234
+ --_gap: var(--#{sys.$prefix}segmented-gap, #{$_track-gap-xs});
235
+ --_padding: var(--#{sys.$prefix}segmented-padding, #{$_track-padding-xs});
214
236
  font-size: var(--#{sys.$prefix}typography-size-xs);
215
- min-height: var(--#{sys.$prefix}control-height-sm);
216
237
  }
217
238
 
218
- .#{sys.$prefix}interface .#{sys.$prefix}segmented.is-size-lg .#{sys.$prefix}segmented__item {
219
- --_item-padding: var(--#{sys.$prefix}spacing-sm) var(--#{sys.$prefix}spacing-lg);
239
+ .#{sys.$prefix}interface .#{sys.$prefix}segmented.is-size-sm {
240
+ font-size: var(--#{sys.$prefix}typography-size-xs);
241
+ }
242
+
243
+ .#{sys.$prefix}interface .#{sys.$prefix}segmented.is-size-lg {
220
244
  font-size: var(--#{sys.$prefix}typography-size-md);
221
- min-height: var(--#{sys.$prefix}control-height-lg);
245
+ }
246
+
247
+ .#{sys.$prefix}interface .#{sys.$prefix}segmented.is-size-xs .#{sys.$prefix}segmented__item {
248
+ --_item-padding: var(--#{sys.$prefix}segmented-item-padding, #{$_item-padding-block} #{$_item-padding-inline-xs});
249
+ min-height: var(--#{sys.$prefix}control-height-xs, 1.5rem);
250
+ }
251
+
252
+ .#{sys.$prefix}interface .#{sys.$prefix}segmented.is-size-sm .#{sys.$prefix}segmented__item {
253
+ --_item-padding: var(--#{sys.$prefix}segmented-item-padding, #{$_item-padding-block} #{$_item-padding-inline-sm});
254
+ min-height: var(--#{sys.$prefix}control-height-sm, 2rem);
255
+ }
256
+
257
+ .#{sys.$prefix}interface .#{sys.$prefix}segmented.is-size-lg .#{sys.$prefix}segmented__item {
258
+ --_item-padding: var(--#{sys.$prefix}segmented-item-padding, #{$_item-padding-block} #{$_item-padding-inline-lg});
259
+ min-height: var(--#{sys.$prefix}control-height-lg, 3rem);
222
260
  }
223
261
 
224
262
  // ---------------------------------------------------------------------------
@@ -14,6 +14,7 @@
14
14
  --tui-select-option-radius
15
15
  --tui-select-option-bg-hover
16
16
  --tui-select-option-bg-selected
17
+ --tui-select-option-gap
17
18
  */
18
19
 
19
20
  // Structural SCSS constants (compile away, not overridable)
@@ -109,7 +110,9 @@ $_label-letter-spacing: 0.05em;
109
110
  transition-timing-function: var(--#{sys.$prefix}motion-timing);
110
111
  transition-property: border-color, background-color;
111
112
 
112
- &:focus-visible {
113
+ // :focus, not :focus-visible — native selects show the ring on mouse
114
+ // focus too (form-control heuristic), and this button impersonates one
115
+ &:focus {
113
116
  --_border: var(--_border-focus);
114
117
  outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
115
118
  outline-offset: var(--#{sys.$prefix}focus-ring-offset);
@@ -181,7 +184,7 @@ $_label-letter-spacing: 0.05em;
181
184
 
182
185
  &:hover {
183
186
  color: var(--#{sys.$prefix}color-fg);
184
- background-color: var(--#{sys.$prefix}theme-secondary-subtlest);
187
+ background-color: var(--#{sys.$prefix}color-fill-subtle);
185
188
  }
186
189
 
187
190
  &:focus-visible {
@@ -256,7 +259,7 @@ $_label-letter-spacing: 0.05em;
256
259
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}select__option {
257
260
  // Internal tokens with real fallbacks
258
261
  --_option-radius: var(--#{sys.$prefix}select-option-radius, var(--#{sys.$prefix}radius-sm));
259
- --_bg-hover: var(--#{sys.$prefix}select-option-bg-hover, var(--#{sys.$prefix}theme-secondary-subtlest));
262
+ --_bg-hover: var(--#{sys.$prefix}select-option-bg-hover, var(--#{sys.$prefix}color-fill-subtle));
260
263
  --_bg-selected: var(--#{sys.$prefix}select-option-bg-selected, var(--#{sys.$prefix}theme-primary-subtlest));
261
264
 
262
265
  // Layout
@@ -271,6 +274,15 @@ $_label-letter-spacing: 0.05em;
271
274
  font-size: var(--#{sys.$prefix}typography-size-sm);
272
275
  line-height: 1.4;
273
276
 
277
+ transition: background-color var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
278
+
279
+ // Rounded boxes shouldn't abut — a hairline of air between options.
280
+ // (Not `& + &`: sass expands both ampersands to the full compound
281
+ // selector, and the :where() prefix ends up mid-combinator — dead rule.)
282
+ & + .#{sys.$prefix}select__option {
283
+ margin-block-start: var(--#{sys.$prefix}select-option-gap, 2px);
284
+ }
285
+
274
286
  &:hover:not([data-disabled]),
275
287
  &[data-highlighted]:not([data-disabled]) {
276
288
  background-color: var(--_bg-hover);
@@ -351,6 +363,10 @@ $_label-letter-spacing: 0.05em;
351
363
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}select__content {
352
364
  animation-duration: 0ms;
353
365
  }
366
+
367
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}select__option {
368
+ transition-duration: 0ms;
369
+ }
354
370
  }
355
371
 
356
372
  // ---------------------------------------------------------------------------
@@ -0,0 +1,184 @@
1
+ @use "../system" as sys;
2
+
3
+ /* @tui-tokens
4
+ --tui-slider-track-height
5
+ --tui-slider-track-bg
6
+ --tui-slider-fill
7
+ --tui-slider-gap
8
+ --tui-slider-segment-radius
9
+ --tui-slider-thumb-size
10
+ --tui-slider-thumb-bg
11
+ --tui-slider-label-fg
12
+ */
13
+
14
+ @mixin styles() {
15
+ // ==========================================================================
16
+ // Slider Component
17
+ // ==========================================================================
18
+ //
19
+ // Component API tokens (never defined here, only read via fallback):
20
+ // --tui-slider-track-height Track thickness
21
+ // --tui-slider-track-bg Unfilled track color
22
+ // --tui-slider-fill Filled track color
23
+ // --tui-slider-gap Gap between track segments
24
+ // --tui-slider-segment-radius Segment end rounding
25
+ // --tui-slider-thumb-size Thumb diameter
26
+ // --tui-slider-thumb-bg Thumb color
27
+ // --tui-slider-label-fg Start/end label color
28
+ //
29
+ // To override from consuming code:
30
+ // .my-context .tui-slider { --tui-slider-fill: hotpink; }
31
+ //
32
+ // The native input sits transparent over the custom track: it owns every
33
+ // interaction, only its thumb is drawn. Thumb pseudo-selectors cannot be
34
+ // comma-joined (an unknown selector voids the whole rule), hence the
35
+ // repeated blocks.
36
+ // ==========================================================================
37
+
38
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}slider {
39
+ --_track-height: var(--#{sys.$prefix}slider-track-height, 4px);
40
+ --_track-bg: var(--#{sys.$prefix}slider-track-bg, var(--#{sys.$prefix}color-border));
41
+ --_fill: var(--#{sys.$prefix}slider-fill, var(--#{sys.$prefix}theme-primary-base));
42
+ --_gap: var(--#{sys.$prefix}slider-gap, var(--#{sys.$prefix}spacing-xxs));
43
+ --_segment-radius: var(--#{sys.$prefix}slider-segment-radius, var(--#{sys.$prefix}radius-full));
44
+ --_thumb-size: var(--#{sys.$prefix}slider-thumb-size, 1rem);
45
+ --_thumb-bg: var(--#{sys.$prefix}slider-thumb-bg, var(--_fill));
46
+
47
+ display: flex;
48
+ flex-direction: column;
49
+ gap: var(--#{sys.$prefix}spacing-xs);
50
+ inline-size: 100%;
51
+
52
+ &.is-disabled {
53
+ opacity: var(--#{sys.$prefix}opacity-disabled);
54
+ }
55
+
56
+ &__control {
57
+ position: relative;
58
+ block-size: var(--_thumb-size);
59
+ display: flex;
60
+ align-items: center;
61
+ }
62
+
63
+ &__track {
64
+ position: absolute;
65
+ inset-inline: 0;
66
+ inset-block-start: 50%;
67
+ translate: 0 -50%;
68
+ block-size: var(--_track-height);
69
+ display: flex;
70
+ gap: var(--_gap);
71
+ }
72
+
73
+ &__segment {
74
+ flex: 1;
75
+ background: var(--_track-bg);
76
+ border-radius: var(--_segment-radius);
77
+ }
78
+
79
+ // Duplicate segment row in the fill color, clipped to the value
80
+ // percentage from the component (fill and rest stay aligned).
81
+ &__fill {
82
+ position: absolute;
83
+ inset: 0;
84
+ display: flex;
85
+ gap: var(--_gap);
86
+
87
+ .#{sys.$prefix}slider__segment {
88
+ background: var(--_fill);
89
+ }
90
+ }
91
+
92
+ &__input {
93
+ appearance: none;
94
+ -webkit-appearance: none;
95
+ position: relative;
96
+ inline-size: 100%;
97
+ block-size: var(--_thumb-size);
98
+ margin: 0;
99
+ padding: 0;
100
+ background: transparent;
101
+ cursor: pointer;
102
+
103
+ &:disabled {
104
+ cursor: not-allowed;
105
+ }
106
+
107
+ &:focus-visible {
108
+ outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
109
+ outline-offset: var(--#{sys.$prefix}focus-ring-offset);
110
+ border-radius: var(--#{sys.$prefix}radius-full);
111
+ }
112
+
113
+ &::-webkit-slider-thumb {
114
+ -webkit-appearance: none;
115
+ appearance: none;
116
+ inline-size: var(--_thumb-size);
117
+ block-size: var(--_thumb-size);
118
+ border: none;
119
+ border-radius: var(--#{sys.$prefix}radius-full);
120
+ background: var(--_thumb-bg);
121
+ transition: scale var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
122
+ }
123
+
124
+ &::-moz-range-thumb {
125
+ inline-size: var(--_thumb-size);
126
+ block-size: var(--_thumb-size);
127
+ border: none;
128
+ border-radius: var(--#{sys.$prefix}radius-full);
129
+ background: var(--_thumb-bg);
130
+ transition: scale var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
131
+ }
132
+
133
+ &:not(:disabled):hover::-webkit-slider-thumb {
134
+ scale: 1.15;
135
+ }
136
+
137
+ &:not(:disabled):hover::-moz-range-thumb {
138
+ scale: 1.15;
139
+ }
140
+
141
+ // Firefox draws its own track unless flattened
142
+ &::-moz-range-track {
143
+ background: transparent;
144
+ }
145
+ }
146
+
147
+ &__labels {
148
+ display: flex;
149
+ justify-content: space-between;
150
+ gap: var(--#{sys.$prefix}spacing-md);
151
+ font-size: var(--#{sys.$prefix}typography-size-sm);
152
+ color: var(--#{sys.$prefix}slider-label-fg, var(--#{sys.$prefix}color-fg-secondary));
153
+ }
154
+
155
+ &__label {
156
+ &:last-child {
157
+ text-align: end;
158
+ }
159
+ }
160
+ }
161
+
162
+ // ---------------------------------------------------------------------------
163
+ // Forced colors (high contrast mode)
164
+ // ---------------------------------------------------------------------------
165
+ @media (forced-colors: active) {
166
+ .#{sys.$prefix}interface .#{sys.$prefix}slider {
167
+ &__segment {
168
+ background: CanvasText;
169
+ }
170
+
171
+ &__fill .#{sys.$prefix}slider__segment {
172
+ background: Highlight;
173
+ }
174
+
175
+ &__input::-webkit-slider-thumb {
176
+ background: Highlight;
177
+ }
178
+
179
+ &__input::-moz-range-thumb {
180
+ background: Highlight;
181
+ }
182
+ }
183
+ }
184
+ }
@@ -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}theme-secondary-soft));
90
+ --_bg: var(--#{sys.$prefix}switch-bg, var(--#{sys.$prefix}color-fill-strong));
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});