@tangible/ui 0.0.18 → 0.0.20

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 (80) hide show
  1. package/README.md +32 -1
  2. package/components/Avatar/Avatar.d.ts +3 -1
  3. package/components/Avatar/Avatar.js +6 -25
  4. package/components/Avatar/index.d.ts +2 -2
  5. package/components/Avatar/index.js +1 -1
  6. package/components/Avatar/types.d.ts +8 -8
  7. package/components/Avatar/types.js +0 -12
  8. package/components/Icon/Icon.d.ts +10 -1
  9. package/components/Icon/Icon.js +5 -1
  10. package/components/Modal/Modal.js +1 -1
  11. package/components/OverlapStack/OverlapStack.js +4 -2
  12. package/components/Pager/Pager.js +9 -3
  13. package/components/Pager/types.d.ts +9 -0
  14. package/components/Pager/types.js +2 -0
  15. package/components/Progress/Progress.js +3 -3
  16. package/components/Rating/Rating.js +4 -2
  17. package/components/Rating/types.d.ts +5 -1
  18. package/components/Rating/types.js +1 -0
  19. package/components/Select/Select.d.ts +1 -1
  20. package/components/Select/Select.js +5 -3
  21. package/components/Select/types.d.ts +5 -0
  22. package/components/StepIndicator/StepIndicator.js +6 -2
  23. package/components/StepIndicator/types.d.ts +3 -0
  24. package/components/StepIndicator/types.js +1 -0
  25. package/components/Table/BulkActionsBar.js +4 -1
  26. package/components/Table/DataTable.js +8 -5
  27. package/components/index.d.ts +3 -2
  28. package/components/index.js +2 -1
  29. package/package.json +3 -1
  30. package/styles/all.css +1 -1
  31. package/styles/all.expanded.css +220 -88
  32. package/styles/all.expanded.unlayered.css +220 -88
  33. package/styles/all.unlayered.css +1 -1
  34. package/styles/components/_bundle.scss +98 -71
  35. package/styles/components/accordion.scss +289 -0
  36. package/styles/components/avatar.scss +298 -0
  37. package/styles/components/button.scss +468 -0
  38. package/styles/components/card.scss +261 -0
  39. package/styles/components/checkbox.scss +184 -0
  40. package/styles/components/chip-group.scss +49 -0
  41. package/styles/components/chip.scss +472 -0
  42. package/styles/components/combobox.scss +378 -0
  43. package/styles/components/content-indicator.scss +114 -0
  44. package/styles/components/dropdown.scss +179 -0
  45. package/styles/components/field.scss +120 -0
  46. package/styles/components/icon-button.scss +311 -0
  47. package/styles/components/icon.scss +42 -0
  48. package/styles/components/input/index.scss +6 -1
  49. package/styles/components/modal.scss +312 -0
  50. package/styles/components/move-handle.scss +383 -0
  51. package/styles/components/multi-select.scss +449 -0
  52. package/styles/components/notice.scss +430 -0
  53. package/styles/components/overlap-stack.scss +82 -0
  54. package/styles/components/pager.scss +86 -0
  55. package/styles/components/popover.scss +70 -0
  56. package/styles/components/progress.scss +403 -0
  57. package/styles/components/radio.scss +259 -0
  58. package/styles/components/rating.scss +142 -0
  59. package/styles/components/segmented-control.scss +285 -0
  60. package/styles/components/select.scss +386 -0
  61. package/styles/components/sidebar.scss +240 -0
  62. package/styles/components/step-indicator.scss +118 -0
  63. package/styles/components/step-list.scss +130 -0
  64. package/styles/components/switch.scss +229 -0
  65. package/styles/components/table.scss +140 -0
  66. package/styles/components/tabs.scss +297 -0
  67. package/styles/components/text-input.scss +142 -0
  68. package/styles/components/textarea.scss +35 -0
  69. package/styles/components/toolbar.scss +62 -0
  70. package/styles/components/tooltip.scss +102 -0
  71. package/styles/core.css +1 -0
  72. package/styles/core.scss +12 -0
  73. package/styles/core.unlayered.css +1 -0
  74. package/styles/index.scss +34 -6
  75. package/styles/system/_constants.scss +2 -2
  76. package/styles/system/_motion.scss +20 -18
  77. package/styles/system/_tokens.scss +89 -10
  78. package/tui-manifest.json +10 -3
  79. package/utils/generative.d.ts +16 -0
  80. package/utils/generative.js +45 -0
@@ -0,0 +1,403 @@
1
+ @use "../system" as sys;
2
+
3
+ /* @tui-tokens
4
+ --tui-progress-track
5
+ --tui-progress-fill
6
+ --tui-progress-label
7
+ --tui-progress-radius
8
+ --tui-progress-block-size
9
+ --tui-progress-z1-fill
10
+ --tui-progress-z2-fill
11
+ --tui-progress-z3-fill
12
+ --tui-progress-z4-fill
13
+ --tui-progress-z5-fill
14
+ */
15
+
16
+ @mixin styles() {
17
+ // ==========================================================================
18
+ // Progress Component
19
+ // ==========================================================================
20
+ //
21
+ // Component API tokens (never defined here, only read via fallback):
22
+ // --tui-progress-track Track/background color
23
+ // --tui-progress-fill Fill/bar color
24
+ // --tui-progress-label Label text color
25
+ // --tui-progress-radius Border radius
26
+ // --tui-progress-block-size Track thickness (line mode). Default 1em — scales with size class.
27
+ // Override with a fixed value (e.g. 8px) to break the em coupling.
28
+ //
29
+ // Design Decisions:
30
+ // - background declarations carry !important as WordPress-host defence —
31
+ // admin and theme CSS target bars/track-like elements aggressively.
32
+ // Same rationale as Button and Chip (see their headers). Candidates for
33
+ // retirement if a host audit proves them unnecessary; do not add new
34
+ // ones. Sibling components must NOT counter them — bridge the
35
+ // --tui-progress-* API tokens instead (see StepIndicator).
36
+ //
37
+ // Segmented mode adds:
38
+ // --tui-progress-z1-fill Segment 1 color (default: primary)
39
+ // --tui-progress-z2-fill Segment 2 color (default: warning)
40
+ // --tui-progress-z3-fill Segment 3 color (default: success)
41
+ // --tui-progress-z4-fill Segment 4 color (default: danger)
42
+ // --tui-progress-z5-fill Segment 5 color (default: info)
43
+ //
44
+ // To override from consuming code:
45
+ // .my-context .tui-progress { --tui-progress-fill: hotpink; }
46
+ //
47
+ // ==========================================================================
48
+
49
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}progress {
50
+ // Internal tokens — read component API with fallback to primitives
51
+ --_track: var(--#{sys.$prefix}progress-track, var(--#{sys.$prefix}color-border));
52
+ --_fill: var(--#{sys.$prefix}progress-fill, var(--#{sys.$prefix}theme-primary-base));
53
+ --_label: var(--#{sys.$prefix}progress-label, var(--#{sys.$prefix}color-fg));
54
+ --_radius: var(--#{sys.$prefix}progress-radius, var(--#{sys.$prefix}radius-md));
55
+ --_block-size: var(--#{sys.$prefix}progress-block-size, 1em);
56
+
57
+ // Runtime vars (set by component)
58
+ --#{sys.$prefix}progress-value: 0;
59
+ --#{sys.$prefix}progress-max: 100;
60
+ --_pct: calc((var(--#{sys.$prefix}progress-value) / var(--#{sys.$prefix}progress-max)) * 100);
61
+
62
+ color: var(--_label);
63
+
64
+ // -------------------------------------------------------------------------
65
+ // Sizes
66
+ // -------------------------------------------------------------------------
67
+ &.is-size-xs {
68
+ font-size: var(--#{sys.$prefix}typography-size-xs);
69
+ }
70
+
71
+ &.is-size-sm {
72
+ font-size: var(--#{sys.$prefix}typography-size-sm);
73
+ }
74
+
75
+ &.is-size-md {
76
+ font-size: var(--#{sys.$prefix}typography-size-md);
77
+ }
78
+
79
+ &.is-size-lg {
80
+ font-size: var(--#{sys.$prefix}typography-size-lg);
81
+ }
82
+
83
+ // -------------------------------------------------------------------------
84
+ // Line mode
85
+ // -------------------------------------------------------------------------
86
+ &.is-mode-line {
87
+ .#{sys.$prefix}progress__track {
88
+ position: relative;
89
+ inline-size: 100%;
90
+ block-size: var(--_block-size);
91
+ background: var(--_track) !important;
92
+ border-radius: var(--_radius);
93
+ overflow: clip;
94
+ }
95
+
96
+ .#{sys.$prefix}progress__bar {
97
+ block-size: 100%;
98
+ inline-size: calc(var(--_pct) * 1%);
99
+ background: var(--_fill) !important;
100
+ border-radius: var(--_radius);
101
+ transition: inline-size var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
102
+ }
103
+
104
+ // Inside label follows the bar's head
105
+ .#{sys.$prefix}progress__label-wrapper {
106
+ position: absolute;
107
+ font-size: 1em;
108
+ line-height: 1;
109
+ inset: 0;
110
+ display: grid;
111
+ grid-template-columns: 1fr minmax(max-content, calc(100% - (var(--_pct) * 1%)));
112
+ transition: grid-template-columns var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
113
+ }
114
+
115
+ .#{sys.$prefix}progress__label.is-inside {
116
+ pointer-events: none;
117
+ min-width: max-content;
118
+ font-weight: bold;
119
+ background: color-mix(in oklab, var(--_track) 50%, transparent);
120
+ border-radius: var(--_radius);
121
+ padding-inline: 0.5em;
122
+ grid-column: 2;
123
+ }
124
+ }
125
+
126
+ // -------------------------------------------------------------------------
127
+ // Circle mode
128
+ // -------------------------------------------------------------------------
129
+ &.is-mode-circle {
130
+ .#{sys.$prefix}progress__circle {
131
+ position: relative;
132
+ inline-size: 2em;
133
+
134
+ &__bar {
135
+ aspect-ratio: 1;
136
+ background:
137
+ conic-gradient(
138
+ var(--_fill) calc(var(--_pct) * 1%),
139
+ var(--_track) 0
140
+ ) !important;
141
+
142
+ // Hollow centre with mask
143
+ -webkit-mask: radial-gradient(closest-side, transparent 78%, #000 0);
144
+ mask: radial-gradient(closest-side, transparent 78%, #000 0);
145
+ border-radius: 50%;
146
+ }
147
+ }
148
+
149
+ .#{sys.$prefix}progress__label.is-inside {
150
+ position: absolute;
151
+ inset: 0;
152
+ display: grid;
153
+ place-items: center;
154
+ font-size: 0.5em;
155
+ font-weight: bold;
156
+ pointer-events: none;
157
+ }
158
+ }
159
+
160
+ // -------------------------------------------------------------------------
161
+ // Circle mode: solid variant (no hollow centre)
162
+ // -------------------------------------------------------------------------
163
+ &.is-mode-circle.is-variant-solid {
164
+ .#{sys.$prefix}progress__circle__bar {
165
+ -webkit-mask: none;
166
+ mask: none;
167
+ }
168
+ }
169
+
170
+ // -------------------------------------------------------------------------
171
+ // Label styles (shared)
172
+ // -------------------------------------------------------------------------
173
+ .#{sys.$prefix}progress__label {
174
+ font-weight: 600;
175
+ white-space: nowrap;
176
+
177
+ &.is-end {
178
+ color: var(--#{sys.$prefix}color-fg-muted);
179
+ }
180
+ }
181
+
182
+ // -------------------------------------------------------------------------
183
+ // Label position: above / below (row of labels)
184
+ // -------------------------------------------------------------------------
185
+ .#{sys.$prefix}progress__labels {
186
+ display: flex;
187
+ justify-content: space-between;
188
+ align-items: baseline;
189
+ gap: var(--#{sys.$prefix}spacing-md);
190
+ }
191
+
192
+ &.is-label-above .#{sys.$prefix}progress__labels {
193
+ margin-block-end: var(--#{sys.$prefix}spacing-xs);
194
+ }
195
+
196
+ &.is-label-below .#{sys.$prefix}progress__labels {
197
+ margin-block-start: var(--#{sys.$prefix}spacing-xs);
198
+ }
199
+
200
+ // -------------------------------------------------------------------------
201
+ // Label position: inline (labels beside bar)
202
+ // -------------------------------------------------------------------------
203
+ .#{sys.$prefix}progress__inline {
204
+ display: flex;
205
+ align-items: center;
206
+ gap: var(--#{sys.$prefix}spacing-xs);
207
+
208
+ .#{sys.$prefix}progress__track {
209
+ flex: 1;
210
+ }
211
+ }
212
+
213
+ // -------------------------------------------------------------------------
214
+ // Segmented mode (z1, z2, z3...)
215
+ // -------------------------------------------------------------------------
216
+ &.is-segmented {
217
+ // Segment color defaults (customizable via component API)
218
+ --_z1: var(--#{sys.$prefix}progress-z1-fill, var(--#{sys.$prefix}theme-primary-base));
219
+ --_z2: var(--#{sys.$prefix}progress-z2-fill, var(--#{sys.$prefix}theme-warning-base));
220
+ --_z3: var(--#{sys.$prefix}progress-z3-fill, var(--#{sys.$prefix}theme-success-base));
221
+ --_z4: var(--#{sys.$prefix}progress-z4-fill, var(--#{sys.$prefix}theme-danger-base));
222
+ --_z5: var(--#{sys.$prefix}progress-z5-fill, var(--#{sys.$prefix}theme-info-base));
223
+
224
+ &.is-mode-line {
225
+ .#{sys.$prefix}progress__track {
226
+ display: flex;
227
+ }
228
+
229
+ .#{sys.$prefix}progress__bar {
230
+ flex-shrink: 0;
231
+ block-size: 100%;
232
+ inline-size: var(--tui-segment-width);
233
+ transition: inline-size var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
234
+
235
+ // First segment: left radius only
236
+ &:first-child {
237
+ border-radius: var(--_radius) 0 0 var(--_radius);
238
+ }
239
+
240
+ // Middle segments: no radius
241
+ &:not(:first-child):not(:last-child) {
242
+ border-radius: 0;
243
+ }
244
+
245
+ // Last segment: right radius only
246
+ &:last-child {
247
+ border-radius: 0 var(--_radius) var(--_radius) 0;
248
+ }
249
+
250
+ // Only segment: full radius
251
+ &:only-child {
252
+ border-radius: var(--_radius);
253
+ }
254
+
255
+ // Segment colors
256
+ &.is-z1 {
257
+ background: var(--_z1) !important;
258
+ }
259
+
260
+ &.is-z2 {
261
+ background: var(--_z2) !important;
262
+ }
263
+
264
+ &.is-z3 {
265
+ background: var(--_z3) !important;
266
+ }
267
+
268
+ &.is-z4 {
269
+ background: var(--_z4) !important;
270
+ }
271
+
272
+ &.is-z5 {
273
+ background: var(--_z5) !important;
274
+ }
275
+ }
276
+ }
277
+
278
+ // Segment labels below the bar
279
+ .#{sys.$prefix}progress__segment-labels {
280
+ display: flex;
281
+ gap: var(--#{sys.$prefix}spacing-md);
282
+ margin-block-start: var(--#{sys.$prefix}spacing-xs);
283
+ }
284
+
285
+ .#{sys.$prefix}progress__segment-label {
286
+ display: inline-flex;
287
+ gap: 0.35em;
288
+ font-weight: 600;
289
+
290
+ &.is-z1 {
291
+ color: var(--_z1);
292
+ }
293
+
294
+ &.is-z2 {
295
+ color: var(--_z2);
296
+ }
297
+
298
+ &.is-z3 {
299
+ color: var(--_z3);
300
+ }
301
+
302
+ &.is-z4 {
303
+ color: var(--_z4);
304
+ }
305
+
306
+ &.is-z5 {
307
+ color: var(--_z5);
308
+ }
309
+ }
310
+
311
+ .#{sys.$prefix}progress__segment-label-text {
312
+ font-weight: 600;
313
+ }
314
+
315
+ .#{sys.$prefix}progress__segment-label-value {
316
+ font-weight: 600;
317
+ }
318
+ }
319
+
320
+ // -------------------------------------------------------------------------
321
+ // Indeterminate state
322
+ // -------------------------------------------------------------------------
323
+ &.is-indeterminate {
324
+ &.is-mode-line .#{sys.$prefix}progress__bar {
325
+ animation: #{sys.$prefix}progress-indeterminate 2s ease-in-out infinite backwards;
326
+ }
327
+
328
+ &.is-mode-circle .#{sys.$prefix}progress__circle__bar {
329
+ animation: #{sys.$prefix}progress-spin 1s linear infinite;
330
+ background:
331
+ conic-gradient(var(--_fill) 25%, var(--_track) 0) !important;
332
+ }
333
+ }
334
+
335
+ @media (prefers-reduced-motion: reduce) {
336
+ &.is-indeterminate {
337
+ &.is-mode-line .#{sys.$prefix}progress__bar {
338
+ animation: none;
339
+ inline-size: 50%;
340
+ }
341
+
342
+ &.is-mode-circle .#{sys.$prefix}progress__circle__bar {
343
+ animation: none;
344
+ }
345
+ }
346
+
347
+ .#{sys.$prefix}progress__bar {
348
+ transition: none;
349
+ }
350
+ }
351
+ }
352
+
353
+ @keyframes #{sys.$prefix}progress-indeterminate {
354
+ 0% {
355
+ inline-size: 25%;
356
+ transform: translateX(-100%);
357
+ }
358
+
359
+ 30% {
360
+ inline-size: 60%;
361
+ }
362
+
363
+ 100% {
364
+ inline-size: 25%;
365
+ transform: translateX(420%);
366
+ }
367
+ }
368
+
369
+ @keyframes #{sys.$prefix}progress-spin {
370
+ to {
371
+ transform: rotate(1turn);
372
+ }
373
+ }
374
+
375
+ // ---------------------------------------------------------------------------
376
+ // Forced colors (Windows High Contrast Mode)
377
+ // ---------------------------------------------------------------------------
378
+
379
+ @media (forced-colors: active) {
380
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}progress {
381
+ &.is-mode-line .#{sys.$prefix}progress__track {
382
+ forced-color-adjust: none;
383
+ background: Canvas !important;
384
+ border: 1px solid CanvasText;
385
+ }
386
+
387
+ &.is-mode-line .#{sys.$prefix}progress__bar {
388
+ background: Highlight !important;
389
+ }
390
+
391
+ &.is-mode-circle .#{sys.$prefix}progress__circle__bar {
392
+ forced-color-adjust: none;
393
+ background:
394
+ conic-gradient(
395
+ Highlight calc(var(--_pct) * 1%),
396
+ Canvas 0
397
+ ) !important;
398
+ border: 1px solid CanvasText;
399
+ border-radius: 50%;
400
+ }
401
+ }
402
+ }
403
+ }
@@ -0,0 +1,259 @@
1
+ @use "../system" as sys;
2
+
3
+ /* @tui-tokens
4
+ --tui-radio-accent
5
+ --tui-radio-size
6
+ --tui-radio-border
7
+ --tui-radio-bg
8
+ --tui-radio-gap
9
+ --tui-radio-font-size
10
+ --tui-radio-label-color
11
+ --tui-radio-description-color
12
+ --tui-radio-group-gap
13
+ */
14
+
15
+ @mixin styles() {
16
+ // ==========================================================================
17
+ // RadioGroup + Radio Components
18
+ // ==========================================================================
19
+ //
20
+ // Component API tokens (never defined here, only read via fallback):
21
+ // --tui-radio-accent Accent color for selected state
22
+ // --tui-radio-size Indicator size (falls back to 1.15em)
23
+ // --tui-radio-border Indicator border color (unchecked)
24
+ // --tui-radio-bg Indicator background color
25
+ // --tui-radio-gap Gap between indicator and label
26
+ // --tui-radio-font-size Font size for label + description base
27
+ // --tui-radio-label-color Label text color
28
+ // --tui-radio-description-color Description text color
29
+ // --tui-radio-group-gap Gap between items in the group
30
+ //
31
+ // ==========================================================================
32
+
33
+ // Structural constants
34
+ $_dot-ratio: 0.435; // dot is ~43.5% of indicator
35
+
36
+ // ---------------------------------------------------------------------------
37
+ // RadioGroup wrapper
38
+ // ---------------------------------------------------------------------------
39
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}radio-group {
40
+ --_group-gap: var(--#{sys.$prefix}radio-group-gap, var(--#{sys.$prefix}spacing-xs));
41
+
42
+ display: flex;
43
+ flex-direction: column;
44
+ gap: var(--_group-gap);
45
+
46
+ &.is-horizontal {
47
+ flex-direction: row;
48
+ flex-wrap: wrap;
49
+ gap: var(--_group-gap);
50
+ }
51
+
52
+ &[aria-disabled="true"] {
53
+ opacity: var(--#{sys.$prefix}opacity-disabled);
54
+ }
55
+ }
56
+
57
+ // ---------------------------------------------------------------------------
58
+ // Radio item (outer wrapper)
59
+ // ---------------------------------------------------------------------------
60
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}radio {
61
+ // Internal tokens
62
+ --_accent: var(--#{sys.$prefix}radio-accent, var(--#{sys.$prefix}input-accent, var(--#{sys.$prefix}theme-primary-base)));
63
+ --_border: var(--#{sys.$prefix}radio-border, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border)));
64
+ --_bg: var(--#{sys.$prefix}radio-bg, var(--#{sys.$prefix}color-bg));
65
+ --_size: var(--#{sys.$prefix}radio-size, 1.15em);
66
+ --_gap: var(--#{sys.$prefix}radio-gap, var(--#{sys.$prefix}spacing-xs));
67
+ --_fs: var(--#{sys.$prefix}radio-font-size, var(--#{sys.$prefix}typography-size-sm));
68
+ --_label-color: var(--#{sys.$prefix}radio-label-color, var(--#{sys.$prefix}color-fg));
69
+ --_desc-color: var(--#{sys.$prefix}radio-description-color, var(--#{sys.$prefix}color-fg-muted));
70
+
71
+ display: flex;
72
+ flex-direction: column;
73
+
74
+ // Selected state — targets the control button inside
75
+ &:has(.#{sys.$prefix}radio__control[aria-checked="true"]) {
76
+ .#{sys.$prefix}radio__indicator {
77
+ border-color: var(--_accent);
78
+
79
+ &::after {
80
+ transform: scale(1);
81
+ background-color: var(--_accent);
82
+ }
83
+ }
84
+ }
85
+ }
86
+
87
+ // ---------------------------------------------------------------------------
88
+ // Radio control (the button with role="radio")
89
+ // ---------------------------------------------------------------------------
90
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}radio__control {
91
+ display: inline-flex;
92
+ align-items: center;
93
+ gap: var(--_gap);
94
+ padding: 0;
95
+ border: none;
96
+ background: none;
97
+ font: inherit;
98
+ font-size: var(--_fs);
99
+ color: var(--_label-color);
100
+ cursor: pointer;
101
+ appearance: none;
102
+
103
+ &:hover:not(:disabled):not([aria-disabled="true"]) .#{sys.$prefix}radio__indicator {
104
+ border-color: var(--_accent);
105
+ }
106
+
107
+ // Focus ring delegated to indicator — intentional (tightly wraps circle
108
+ // instead of full button width). outline: none on button is not a bug.
109
+ &:focus-visible {
110
+ outline: none;
111
+
112
+ .#{sys.$prefix}radio__indicator {
113
+ outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
114
+ outline-offset: var(--#{sys.$prefix}focus-ring-offset);
115
+ }
116
+ }
117
+
118
+ &:disabled {
119
+ cursor: not-allowed;
120
+ opacity: var(--#{sys.$prefix}opacity-disabled);
121
+ pointer-events: none;
122
+ }
123
+
124
+ // Group-disabled: no opacity here (group wrapper handles it),
125
+ // no pointer-events: none (so cursor: not-allowed is visible).
126
+ // JS guard prevents selection.
127
+ &[aria-disabled="true"] {
128
+ cursor: not-allowed;
129
+ }
130
+ }
131
+
132
+ // ---------------------------------------------------------------------------
133
+ // Radio indicator (the circle)
134
+ // ---------------------------------------------------------------------------
135
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}radio__indicator {
136
+ display: inline-flex;
137
+ align-items: center;
138
+ justify-content: center;
139
+ flex-shrink: 0;
140
+ width: var(--_size);
141
+ height: var(--_size);
142
+ border-radius: 50%;
143
+ border: var(--#{sys.$prefix}border-width) solid var(--_border);
144
+ background-color: var(--_bg);
145
+ transition-duration: var(--#{sys.$prefix}motion-duration);
146
+ transition-timing-function: var(--#{sys.$prefix}motion-timing);
147
+ transition-property: border-color;
148
+
149
+ // The dot
150
+ &::after {
151
+ content: "";
152
+ display: block;
153
+ width: calc(var(--_size) * #{$_dot-ratio});
154
+ height: calc(var(--_size) * #{$_dot-ratio});
155
+ border-radius: 50%;
156
+ background-color: transparent;
157
+ transform: scale(0);
158
+ transition-duration: var(--#{sys.$prefix}motion-duration);
159
+ transition-timing-function: var(--#{sys.$prefix}motion-timing);
160
+ transition-property: transform, background-color;
161
+ }
162
+ }
163
+
164
+ // ---------------------------------------------------------------------------
165
+ // Radio label
166
+ // ---------------------------------------------------------------------------
167
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}radio__label {
168
+ font-weight: unset;
169
+ line-height: 1.25em;
170
+ user-select: none;
171
+ }
172
+
173
+ // ---------------------------------------------------------------------------
174
+ // Radio body (description + nested content)
175
+ // ---------------------------------------------------------------------------
176
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}radio__body {
177
+ // Indent to align with label text (indicator size + gap)
178
+ padding-inline-start: calc(var(--_size) + var(--_gap));
179
+ }
180
+
181
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}radio__description {
182
+ display: block;
183
+ margin: 0;
184
+ font-size: var(--_fs);
185
+ color: var(--_desc-color);
186
+ line-height: var(--#{sys.$prefix}typography-line-height);
187
+ }
188
+
189
+ // ---------------------------------------------------------------------------
190
+ // Reduced motion
191
+ // ---------------------------------------------------------------------------
192
+ // Transitions use --tui-motion-duration which is zeroed globally under
193
+ // prefers-reduced-motion. Explicit rule as safety net.
194
+ @media (prefers-reduced-motion: reduce) {
195
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}radio__indicator,
196
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}radio__indicator::after {
197
+ transition: none;
198
+ }
199
+ }
200
+
201
+ // ---------------------------------------------------------------------------
202
+ // CSS-only inline-choice radio
203
+ // ---------------------------------------------------------------------------
204
+ //
205
+ // For native <input type="radio"> rendered without the React Radio component.
206
+ // Native rendering preserved (no appearance: none) — uses accent-color for
207
+ // checked state. Opt-in via class OR convention:
208
+ // - `.tui-inline-choice__control` class on input[type="radio"]
209
+ // - any `<input type="radio">` inside a `.tui-inline-choice` wrapper
210
+ // Bare `<input type="radio">` outside both contexts renders fully natively.
211
+ //
212
+ // Parallel to Checkbox/styles.scss — see that file for the matching pattern.
213
+ //
214
+ .#{sys.$prefix}interface :is(
215
+ .#{sys.$prefix}inline-choice__control[type="radio"],
216
+ .#{sys.$prefix}inline-choice input[type="radio"]
217
+ ) {
218
+ --_accent: var(--#{sys.$prefix}input-accent, var(--#{sys.$prefix}theme-primary-base));
219
+
220
+ font-size: 1.15em;
221
+ width: 1em;
222
+ height: 1em;
223
+ flex: 0 0 1em;
224
+ margin: 0;
225
+
226
+ &:focus-visible {
227
+ outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
228
+ outline-offset: var(--#{sys.$prefix}focus-ring-offset);
229
+ }
230
+
231
+ &:checked {
232
+ accent-color: var(--_accent);
233
+ }
234
+ }
235
+
236
+ // ---------------------------------------------------------------------------
237
+ // Forced colors (Windows High Contrast Mode)
238
+ // ---------------------------------------------------------------------------
239
+
240
+ @media (forced-colors: active) {
241
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}radio__indicator {
242
+ forced-color-adjust: none;
243
+ border-color: CanvasText;
244
+ background-color: Canvas;
245
+
246
+ &::after {
247
+ background-color: CanvasText;
248
+ }
249
+ }
250
+
251
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}radio:has(.#{sys.$prefix}radio__control[aria-checked="true"]) .#{sys.$prefix}radio__indicator {
252
+ border-color: Highlight;
253
+
254
+ &::after {
255
+ background-color: Highlight;
256
+ }
257
+ }
258
+ }
259
+ }