@tangible/ui 0.2.38 → 0.2.40

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 (73) hide show
  1. package/README.md +2 -2
  2. package/components/Avatar/Avatar.js +20 -5
  3. package/components/Avatar/types.d.ts +15 -0
  4. package/components/Button/Button.js +10 -3
  5. package/components/Button/types.d.ts +31 -3
  6. package/components/Button/types.js +2 -0
  7. package/components/ColorPicker/ColorField.d.ts +1 -1
  8. package/components/ColorPicker/ColorField.js +9 -1
  9. package/components/DatePicker/DateRangePicker.d.ts +1 -0
  10. package/components/DatePicker/DateRangePicker.js +24 -6
  11. package/components/DatePicker/PickerTrigger.js +1 -1
  12. package/components/DatePicker/types.d.ts +20 -3
  13. package/components/DatePicker/types.js +1 -0
  14. package/components/IconButton/IconButtonCore.js +13 -5
  15. package/components/IconButton/index.d.ts +2 -1
  16. package/components/IconButton/index.js +1 -0
  17. package/components/IconButton/types.d.ts +37 -2
  18. package/components/IconButton/types.js +4 -1
  19. package/components/MultiSelect/MultiSelect.js +9 -3
  20. package/components/NavMenu/NavMenu.js +37 -3
  21. package/components/Notice/Notice.d.ts +13 -0
  22. package/components/Notice/Notice.js +10 -2
  23. package/components/Progress/Progress.js +73 -2
  24. package/components/Progress/index.d.ts +2 -1
  25. package/components/Progress/index.js +1 -0
  26. package/components/Progress/types.d.ts +130 -2
  27. package/components/Progress/types.js +3 -1
  28. package/components/Select/Select.js +2 -1
  29. package/components/Tooltip/Tooltip.js +23 -0
  30. package/components/index.d.ts +28 -26
  31. package/components/index.js +10 -10
  32. package/figma-tokens.json +1 -1
  33. package/icons/icons.svg +15 -5
  34. package/icons/lms/index.d.ts +7 -4
  35. package/icons/lms/index.js +9 -44
  36. package/icons/lms.svg +4 -4
  37. package/icons/manifest.json +96 -12
  38. package/icons/registry.d.ts +20 -0
  39. package/icons/registry.js +11 -0
  40. package/icons/searchsync/index.d.ts +21 -0
  41. package/icons/searchsync/index.js +82 -0
  42. package/icons/searchsync.svg +9 -0
  43. package/icons/sprite-registry.js +10 -0
  44. package/icons/sprite-version.js +1 -1
  45. package/icons/sprite.d.ts +1 -1
  46. package/icons/sprite.js +2 -1
  47. package/icons/sprite.php +3 -2
  48. package/icons/system/index.d.ts +6 -0
  49. package/icons/system/index.js +33 -0
  50. package/icons/system.svg +3 -0
  51. package/package.json +1 -1
  52. package/skills/building-with-tui/SKILL.md +81 -30
  53. package/styles/all.css +1 -1
  54. package/styles/all.expanded.css +221 -64
  55. package/styles/all.expanded.unlayered.css +221 -64
  56. package/styles/all.unlayered.css +1 -1
  57. package/styles/app.css +2 -0
  58. package/styles/components/button.scss +18 -0
  59. package/styles/components/checkbox.scss +21 -13
  60. package/styles/components/icon-button.scss +44 -25
  61. package/styles/components/nav-menu.scss +3 -0
  62. package/styles/components/notice.scss +38 -0
  63. package/styles/components/progress.scss +96 -0
  64. package/styles/components/radio.scss +35 -7
  65. package/styles/components/segmented-control.scss +98 -18
  66. package/styles/components/table.scss +39 -24
  67. package/tui-manifest.json +151 -39
  68. package/utils/portal.d.ts +4 -3
  69. package/utils/portal.js +16 -2
  70. package/utils/use-loading-announcer.d.ts +2 -0
  71. package/utils/use-loading-announcer.js +101 -0
  72. package/vanilla/styles.css +1 -1
  73. package/vanilla/styles.unlayered.css +1 -1
@@ -13,6 +13,7 @@
13
13
  --tui-segmented-item-bg-active
14
14
  --tui-segmented-item-fg-active
15
15
  --tui-segmented-item-border-active
16
+ --tui-segmented-item-fg-disabled
16
17
  --tui-segmented-indicator
17
18
  --tui-segmented-indicator-size
18
19
  */
@@ -24,7 +25,8 @@
24
25
  //
25
26
  // Component API tokens (never defined here, only read via fallback):
26
27
  // --tui-segmented-gap Gap between items
27
- // --tui-segmented-padding Container padding
28
+ // --tui-segmented-padding Track inset from the outer edge, border
29
+ // included (pill, outline; default 4px, xs 2px)
28
30
  // --tui-segmented-radius Container border radius
29
31
  // --tui-segmented-bg Container background
30
32
  // --tui-segmented-fg Container text color (pill; outline/underline inherit)
@@ -35,6 +37,8 @@
35
37
  // --tui-segmented-item-bg-active Item background (active)
36
38
  // --tui-segmented-item-fg-active Item foreground (active)
37
39
  // --tui-segmented-item-border-active Item border (active, outline variant)
40
+ // --tui-segmented-item-fg-disabled Item foreground (disabled, unselected;
41
+ // default fg-muted). Wins over -item-fg.
38
42
  // --tui-segmented-indicator Underline indicator color
39
43
  // --tui-segmented-indicator-size Underline indicator thickness
40
44
  //
@@ -47,14 +51,21 @@
47
51
  // spacing follows the Button/Chip convention: em-locked to the control's
48
52
  // type size, NOT the page spacing scale. The root carries the per-size
49
53
  // font-size so the track's ems and the items' ems share one key.
50
- $_track-padding: 0.5em;
51
54
  $_track-gap: 0.5em;
52
- $_track-padding-xs: 0.35em;
53
55
  $_track-gap-xs: 0.35em;
54
56
  $_underline-gap: 1.15em;
57
+ // Track height (pill, outline) is exactly the control height, so the track
58
+ // inset is fixed, not em: 4px, 2px at xs (Figma, #176). The inset is
59
+ // measured from the track's OUTER edge, border included, as Figma's inside
60
+ // stroke is, so items land exactly one rung down (md item = sm height).
61
+ $_track-padding: 4px;
62
+ $_track-padding-xs: 2px;
55
63
  // Block padding stays under the height ladder at every size (the
56
64
  // min-height governs; flex centering does the rest) — same rule as Button.
57
- $_item-padding-block: 0.35em;
65
+ // Pill and outline items sit one rung down inside the track and take no
66
+ // block padding; underline items keep theirs.
67
+ $_item-padding-block: 0;
68
+ $_item-padding-block-underline: 0.35em;
58
69
  $_item-padding-inline: 1.15em;
59
70
  $_item-padding-inline-xs: 0.65em;
60
71
  $_item-padding-inline-sm: 1em;
@@ -69,7 +80,14 @@
69
80
  // Internal tokens with fallback chains
70
81
  --_gap: var(--#{sys.$prefix}segmented-gap, #{$_track-gap});
71
82
  --_padding: var(--#{sys.$prefix}segmented-padding, #{$_track-padding});
72
- --_radius: var(--#{sys.$prefix}segmented-radius, var(--#{sys.$prefix}radius-lg));
83
+ // Corners nest: the track's radius is the item's plus the inset.
84
+ --_radius: var(--#{sys.$prefix}segmented-radius, calc(var(--#{sys.$prefix}segmented-item-radius, var(--#{sys.$prefix}radius-md)) + var(--_padding)));
85
+ // Height: the track (pill, outline) is exactly the control height, and
86
+ // the item is what's left inside the inset. Items read --_item-h; size
87
+ // classes move --_h. Declared here, where --_padding is.
88
+ --_h: var(--#{sys.$prefix}control-height-md, 2.5rem);
89
+ --_item-h: calc(var(--_h) - 2 * var(--_padding));
90
+ --_item-pad-block: #{$_item-padding-block};
73
91
  --_bg: var(--#{sys.$prefix}segmented-bg, var(--#{sys.$prefix}color-bg-muted));
74
92
  --_fg: var(--#{sys.$prefix}segmented-fg, var(--#{sys.$prefix}color-fg));
75
93
  --_border: var(--#{sys.$prefix}segmented-border, transparent);
@@ -80,7 +98,8 @@
80
98
  // typography-size fallbacks keep the defaults unchanged.
81
99
  font-size: var(--#{sys.$prefix}control-font-size-md, var(--#{sys.$prefix}typography-size-sm));
82
100
  gap: var(--_gap);
83
- padding: var(--_padding);
101
+ // --_padding is the inset from the outer edge; the border is inside it.
102
+ padding: max(0px, calc(var(--_padding) - var(--#{sys.$prefix}border-width)));
84
103
  background: var(--_bg);
85
104
  color: var(--_fg);
86
105
  border: var(--#{sys.$prefix}border-width) solid var(--_border);
@@ -94,9 +113,9 @@
94
113
  flex-direction: column;
95
114
  }
96
115
 
97
- &[aria-disabled="true"] {
98
- opacity: var(--#{sys.$prefix}opacity-disabled);
99
- }
116
+ // No opacity here: a disabled control disables every item, and the
117
+ // item rules below mute and dim them. Dimming the root as well would
118
+ // compound (see "Disabled items").
100
119
  }
101
120
 
102
121
  // ---------------------------------------------------------------------------
@@ -116,6 +135,14 @@
116
135
  --_bg: transparent;
117
136
  --_fg: var(--#{sys.$prefix}segmented-fg, inherit);
118
137
  --_border: var(--#{sys.$prefix}segmented-border, var(--#{sys.$prefix}color-border));
138
+ // One control, not chips in a box: a full-radius track around
139
+ // full-radius items. Vertical can't be full (it would pill the whole
140
+ // column), so it nests on half the item height.
141
+ --_radius: var(--#{sys.$prefix}segmented-radius, var(--#{sys.$prefix}radius-full));
142
+
143
+ &.is-vertical {
144
+ --_radius: var(--#{sys.$prefix}segmented-radius, calc(var(--_item-h) / 2 + var(--_padding)));
145
+ }
119
146
  }
120
147
 
121
148
  // ---------------------------------------------------------------------------
@@ -127,6 +154,9 @@
127
154
  --_fg: var(--#{sys.$prefix}segmented-fg, inherit);
128
155
  --_padding: 0;
129
156
  --_gap: var(--#{sys.$prefix}segmented-gap, #{$_underline-gap});
157
+ // Underline has no track: items keep the full control height.
158
+ --_item-h: var(--_h);
159
+ --_item-pad-block: #{$_item-padding-block-underline};
130
160
  border-radius: 0;
131
161
  border-block-end: var(--#{sys.$prefix}border-width) solid var(--#{sys.$prefix}color-divider);
132
162
  }
@@ -138,7 +168,7 @@
138
168
 
139
169
  .#{sys.$prefix}interface .#{sys.$prefix}segmented__item {
140
170
  // Internal tokens
141
- --_item-padding: var(--#{sys.$prefix}segmented-item-padding, #{$_item-padding-block} #{$_item-padding-inline});
171
+ --_item-padding: var(--#{sys.$prefix}segmented-item-padding, var(--_item-pad-block) #{$_item-padding-inline});
142
172
  --_item-radius: var(--#{sys.$prefix}segmented-item-radius, var(--#{sys.$prefix}radius-md));
143
173
  --_item-bg: transparent;
144
174
  --_item-fg: var(--#{sys.$prefix}segmented-item-fg, var(--#{sys.$prefix}color-fg-muted));
@@ -149,7 +179,7 @@
149
179
  display: inline-flex;
150
180
  align-items: center;
151
181
  justify-content: center;
152
- min-height: var(--#{sys.$prefix}control-height-md, 2.5rem);
182
+ min-height: var(--_item-h);
153
183
  // em-based (not tokenised) — icon-to-label spacing scales with font-size
154
184
  gap: $_item-gap;
155
185
  padding: var(--_item-padding);
@@ -193,7 +223,9 @@
193
223
 
194
224
  .#{sys.$prefix}interface .#{sys.$prefix}segmented.is-variant-outline .#{sys.$prefix}segmented__item {
195
225
  --_item-radius: var(--#{sys.$prefix}segmented-item-radius, var(--#{sys.$prefix}radius-full));
196
- --_item-border: var(--#{sys.$prefix}segmented-border, var(--#{sys.$prefix}color-border));
226
+ // Unselected items draw no border (the track is the boundary); the width
227
+ // stays, transparent, so selecting an item doesn't shift layout.
228
+ --_item-border: transparent;
197
229
  --_item-bg-active: var(--#{sys.$prefix}segmented-item-bg-active, var(--#{sys.$prefix}theme-primary-subtlest));
198
230
  --_item-fg-active: var(--#{sys.$prefix}segmented-item-fg-active, var(--#{sys.$prefix}theme-primary-strong));
199
231
  // The selected border is this variant's whole selection indicator, so it
@@ -274,6 +306,48 @@
274
306
  }
275
307
  }
276
308
 
309
+ // ---------------------------------------------------------------------------
310
+ // Disabled items
311
+ // ---------------------------------------------------------------------------
312
+ // One rule for both paths: an item's own `disabled` and a disabled control
313
+ // both set data-disabled on every affected item. Same recipe as Radio and
314
+ // Checkbox: text mutes to fg-muted at FULL opacity, and only the selection
315
+ // chrome (fill, border, underline) dims. Dimming muted text as well drops
316
+ // it under 3:1. A selected item keeps its active text color, since muting
317
+ // it on the selected fill would lose the answer to "which one is picked?".
318
+ // (0,4,0): out-weighs the pill and underline item rules that set --_item-fg.
319
+
320
+ .#{sys.$prefix}interface .#{sys.$prefix}segmented .#{sys.$prefix}segmented__item[data-disabled] {
321
+ --_item-fg: var(--#{sys.$prefix}segmented-item-fg-disabled, var(--#{sys.$prefix}color-fg-muted));
322
+ }
323
+
324
+ // Forced colors paint their own selection (Highlight), so the dim is
325
+ // skipped there; see the forced-colors block for the disabled text.
326
+ @media not (forced-colors: active) {
327
+ .#{sys.$prefix}interface .#{sys.$prefix}segmented.is-variant-pill .#{sys.$prefix}segmented__item[data-disabled][aria-checked="true"] {
328
+ background: color-mix(in srgb, var(--_item-bg-active) calc(var(--#{sys.$prefix}opacity-disabled) * 100%), transparent);
329
+ }
330
+
331
+ .#{sys.$prefix}interface .#{sys.$prefix}segmented.is-variant-outline .#{sys.$prefix}segmented__item[data-disabled][aria-checked="true"] {
332
+ background: color-mix(in srgb, var(--_item-bg-active) calc(var(--#{sys.$prefix}opacity-disabled) * 100%), transparent);
333
+ border-color: color-mix(in srgb, var(--_item-border-active) calc(var(--#{sys.$prefix}opacity-disabled) * 100%), transparent);
334
+ }
335
+
336
+ // Outline's unselected text is already fg-muted, so the muted text alone
337
+ // doesn't read as disabled here, and since the outline reads as one
338
+ // control (#176) the item border dim barely shows. The text dims too.
339
+ // Disabled controls are exempt from 1.4.3, so dropping under 4.5:1 here
340
+ // is the point, not a slip.
341
+ .#{sys.$prefix}interface .#{sys.$prefix}segmented.is-variant-outline .#{sys.$prefix}segmented__item[data-disabled]:not([aria-checked="true"]) {
342
+ color: color-mix(in srgb, var(--_item-fg) calc(var(--#{sys.$prefix}opacity-disabled) * 100%), transparent);
343
+ border-color: color-mix(in srgb, var(--_item-border) calc(var(--#{sys.$prefix}opacity-disabled) * 100%), transparent);
344
+ }
345
+
346
+ .#{sys.$prefix}interface .#{sys.$prefix}segmented.is-variant-underline .#{sys.$prefix}segmented__item[data-disabled][aria-checked="true"] {
347
+ border-bottom-color: color-mix(in srgb, var(--_indicator) calc(var(--#{sys.$prefix}opacity-disabled) * 100%), transparent);
348
+ }
349
+ }
350
+
277
351
  // ---------------------------------------------------------------------------
278
352
  // Size Variants
279
353
  // ---------------------------------------------------------------------------
@@ -286,30 +360,30 @@
286
360
  .#{sys.$prefix}interface .#{sys.$prefix}segmented.is-size-xs {
287
361
  --_gap: var(--#{sys.$prefix}segmented-gap, #{$_track-gap-xs});
288
362
  --_padding: var(--#{sys.$prefix}segmented-padding, #{$_track-padding-xs});
363
+ --_h: var(--#{sys.$prefix}control-height-xs, 1.5rem);
289
364
  font-size: var(--#{sys.$prefix}control-font-size-sm, var(--#{sys.$prefix}typography-size-xs));
290
365
  }
291
366
 
292
367
  .#{sys.$prefix}interface .#{sys.$prefix}segmented.is-size-sm {
368
+ --_h: var(--#{sys.$prefix}control-height-sm, 2rem);
293
369
  font-size: var(--#{sys.$prefix}control-font-size-sm, var(--#{sys.$prefix}typography-size-xs));
294
370
  }
295
371
 
296
372
  .#{sys.$prefix}interface .#{sys.$prefix}segmented.is-size-lg {
373
+ --_h: var(--#{sys.$prefix}control-height-lg, 3rem);
297
374
  font-size: var(--#{sys.$prefix}control-font-size-lg, var(--#{sys.$prefix}typography-size-md));
298
375
  }
299
376
 
300
377
  .#{sys.$prefix}interface .#{sys.$prefix}segmented.is-size-xs .#{sys.$prefix}segmented__item {
301
- --_item-padding: var(--#{sys.$prefix}segmented-item-padding, #{$_item-padding-block} #{$_item-padding-inline-xs});
302
- min-height: var(--#{sys.$prefix}control-height-xs, 1.5rem);
378
+ --_item-padding: var(--#{sys.$prefix}segmented-item-padding, var(--_item-pad-block) #{$_item-padding-inline-xs});
303
379
  }
304
380
 
305
381
  .#{sys.$prefix}interface .#{sys.$prefix}segmented.is-size-sm .#{sys.$prefix}segmented__item {
306
- --_item-padding: var(--#{sys.$prefix}segmented-item-padding, #{$_item-padding-block} #{$_item-padding-inline-sm});
307
- min-height: var(--#{sys.$prefix}control-height-sm, 2rem);
382
+ --_item-padding: var(--#{sys.$prefix}segmented-item-padding, var(--_item-pad-block) #{$_item-padding-inline-sm});
308
383
  }
309
384
 
310
385
  .#{sys.$prefix}interface .#{sys.$prefix}segmented.is-size-lg .#{sys.$prefix}segmented__item {
311
- --_item-padding: var(--#{sys.$prefix}segmented-item-padding, #{$_item-padding-block} #{$_item-padding-inline-lg});
312
- min-height: var(--#{sys.$prefix}control-height-lg, 3rem);
386
+ --_item-padding: var(--#{sys.$prefix}segmented-item-padding, var(--_item-pad-block) #{$_item-padding-inline-lg});
313
387
  }
314
388
 
315
389
  // ---------------------------------------------------------------------------
@@ -339,6 +413,12 @@
339
413
  // ---------------------------------------------------------------------------
340
414
 
341
415
  @media (forced-colors: active) {
416
+ // GrayText is the system's own disabled text color; it replaces the
417
+ // fg-muted cue. A selected item keeps HighlightText on its Highlight fill.
418
+ .#{sys.$prefix}interface .#{sys.$prefix}segmented .#{sys.$prefix}segmented__item[data-disabled]:not([aria-checked="true"]) {
419
+ color: GrayText;
420
+ }
421
+
342
422
  .#{sys.$prefix}interface .#{sys.$prefix}segmented__item {
343
423
  &[aria-checked="true"] {
344
424
  forced-color-adjust: none;
@@ -4,6 +4,9 @@
4
4
  --tui-table-border
5
5
  --tui-table-bg
6
6
  --tui-table-bg-head
7
+ --tui-table-font-size
8
+ --tui-table-head-transform
9
+ --tui-table-head-tracking
7
10
  --tui-table-fg
8
11
  --tui-table-padding
9
12
  --tui-table-selected-bg
@@ -21,6 +24,12 @@
21
24
  // --tui-table-bg-head Header and footer background (default: bg-muted, so
22
25
  // the head reads as one on tinted pages too)
23
26
  // --tui-table-fg Text color (header/footer always; body inherits unless set)
27
+ // --tui-table-font-size Cell text size (default typography-size-md; the
28
+ // app sheet sets sm, as the list template does)
29
+ // --tui-table-head-transform / -tracking
30
+ // Head and foot casing (default uppercase / normal).
31
+ // The app sheet sets `none`: the Figma list template
32
+ // uses sentence case.
24
33
  // --tui-table-selected-bg Selected row background
25
34
  // --tui-table-selected-fg Selected row text color
26
35
  // --tui-table-padding Cell padding
@@ -41,7 +50,7 @@
41
50
  --_fg: var(--#{sys.$prefix}table-fg, var(--#{sys.$prefix}color-fg));
42
51
  --_padding: var(--#{sys.$prefix}table-padding, var(--#{sys.$prefix}spacing-sm));
43
52
 
44
- font-size: var(--#{sys.$prefix}typography-size-md);
53
+ font-size: var(--#{sys.$prefix}table-font-size, var(--#{sys.$prefix}typography-size-md));
45
54
  width: 100%;
46
55
  border-collapse: collapse;
47
56
  border-bottom: var(--#{sys.$prefix}border-width) solid var(--_border);
@@ -57,28 +66,6 @@
57
66
  padding-inline: var(--_padding);
58
67
  padding-block: var(--_padding);
59
68
  }
60
-
61
- &__sortButton {
62
- padding: unset;
63
- display: inline-flex;
64
- gap: 0.5em;
65
- color: inherit;
66
- background-color: transparent;
67
- text-transform: inherit;
68
- font-size: inherit;
69
- font-weight: inherit;
70
- border-radius: var(--#{sys.$prefix}radius-sm);
71
-
72
- &:focus-visible {
73
- outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
74
- outline-offset: var(--#{sys.$prefix}focus-ring-offset);
75
- }
76
-
77
- &__icon {
78
- min-width: 1em;
79
- }
80
- }
81
-
82
69
  // Selection checkboxes
83
70
  input[type="checkbox"] {
84
71
  accent-color: var(--#{sys.$prefix}theme-primary-base);
@@ -113,7 +100,8 @@
113
100
  td {
114
101
  color: var(--_fg);
115
102
  background-color: var(--_bg-head);
116
- text-transform: uppercase;
103
+ text-transform: var(--#{sys.$prefix}table-head-transform, uppercase);
104
+ letter-spacing: var(--#{sys.$prefix}table-head-tracking, normal);
117
105
  font-size: var(--#{sys.$prefix}typography-size-sm);
118
106
  }
119
107
  }
@@ -149,4 +137,31 @@
149
137
  -webkit-overflow-scrolling: touch;
150
138
  }
151
139
  }
140
+
141
+ // Full specificity, outside the :where() block: the sort button is a real
142
+ // <button>, and in the unlayered build the interface's button reset
143
+ // (.tui-interface button, 0,1,1: text-transform none, letter-spacing normal)
144
+ // beat a (0,1,0) rule, so sortable headers lost the head's uppercase while
145
+ // their neighbours kept it. Layered builds were fine (resets < components).
146
+ .#{sys.$prefix}interface .#{sys.$prefix}table__sortButton {
147
+ padding: unset;
148
+ display: inline-flex;
149
+ gap: 0.5em;
150
+ color: inherit;
151
+ background-color: transparent;
152
+ text-transform: inherit;
153
+ letter-spacing: inherit;
154
+ font-size: inherit;
155
+ font-weight: inherit;
156
+ border-radius: var(--#{sys.$prefix}radius-sm);
157
+
158
+ &:focus-visible {
159
+ outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
160
+ outline-offset: var(--#{sys.$prefix}focus-ring-offset);
161
+ }
162
+
163
+ &__icon {
164
+ min-width: 1em;
165
+ }
166
+ }
152
167
  }