@tangible/ui 0.2.39 → 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 (69) 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/Progress/Progress.js +73 -2
  22. package/components/Progress/index.d.ts +2 -1
  23. package/components/Progress/index.js +1 -0
  24. package/components/Progress/types.d.ts +130 -2
  25. package/components/Progress/types.js +3 -1
  26. package/components/Select/Select.js +2 -1
  27. package/components/Tooltip/Tooltip.js +23 -0
  28. package/components/index.d.ts +28 -26
  29. package/components/index.js +10 -10
  30. package/figma-tokens.json +1 -1
  31. package/icons/icons.svg +15 -5
  32. package/icons/lms/index.d.ts +7 -4
  33. package/icons/lms/index.js +9 -44
  34. package/icons/lms.svg +4 -4
  35. package/icons/manifest.json +96 -12
  36. package/icons/registry.d.ts +20 -0
  37. package/icons/registry.js +11 -0
  38. package/icons/searchsync/index.d.ts +21 -0
  39. package/icons/searchsync/index.js +82 -0
  40. package/icons/searchsync.svg +9 -0
  41. package/icons/sprite-registry.js +10 -0
  42. package/icons/sprite-version.js +1 -1
  43. package/icons/sprite.d.ts +1 -1
  44. package/icons/sprite.js +2 -1
  45. package/icons/sprite.php +3 -2
  46. package/icons/system/index.d.ts +6 -0
  47. package/icons/system/index.js +33 -0
  48. package/icons/system.svg +3 -0
  49. package/package.json +1 -1
  50. package/skills/building-with-tui/SKILL.md +77 -30
  51. package/styles/all.css +1 -1
  52. package/styles/all.expanded.css +180 -44
  53. package/styles/all.expanded.unlayered.css +180 -44
  54. package/styles/all.unlayered.css +1 -1
  55. package/styles/components/button.scss +18 -0
  56. package/styles/components/checkbox.scss +21 -13
  57. package/styles/components/icon-button.scss +44 -25
  58. package/styles/components/nav-menu.scss +3 -0
  59. package/styles/components/notice.scss +4 -0
  60. package/styles/components/progress.scss +96 -0
  61. package/styles/components/radio.scss +35 -7
  62. package/styles/components/segmented-control.scss +98 -18
  63. package/tui-manifest.json +142 -39
  64. package/utils/portal.d.ts +4 -3
  65. package/utils/portal.js +16 -2
  66. package/utils/use-loading-announcer.d.ts +2 -0
  67. package/utils/use-loading-announcer.js +101 -0
  68. package/vanilla/styles.css +1 -1
  69. package/vanilla/styles.unlayered.css +1 -1
package/tui-manifest.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "0.2.39",
3
- "generated": "2026-11-20T00:42:45.126Z",
2
+ "version": "0.2.40",
3
+ "generated": "2026-11-20T21:20:14.273Z",
4
4
  "components": {
5
5
  "Accordion": {
6
6
  "props": {
@@ -154,6 +154,12 @@
154
154
  "required": false,
155
155
  "description": "When true, wraps the avatar with a Tooltip showing the `name`.\nHelps sighted users discover the user's name on hover/focus.\nHas no effect when `name` is not provided."
156
156
  },
157
+ "decorative": {
158
+ "type": "boolean",
159
+ "required": false,
160
+ "defaultValue": "false",
161
+ "description": "Hide the avatar from assistive tech while keeping its picture, initials\nand color. Use it when the person is already named in visible text\nbeside the avatar, e.g. an account-menu button holding an avatar and an\nemail: without it, the avatar's `role=\"img\"` name is concatenated into\nthe button's accessible name.\n\nRenders `aria-hidden=\"true\"` with no `role` and no `aria-label`. `name`\nstill drives the initials and color. `tooltip` is ignored, and\n`indicatorLabel` is never announced (a dev warning fires), so put any\nstatus in the visible text too."
162
+ },
157
163
  "labels": {
158
164
  "type": "AvatarLabels",
159
165
  "required": false,
@@ -187,7 +193,9 @@
187
193
  "stable"
188
194
  ]
189
195
  },
190
- "subcomponents": null,
196
+ "subcomponents": [
197
+ "Group"
198
+ ],
191
199
  "description": null,
192
200
  "gotchas": null,
193
201
  "examples": null,
@@ -241,7 +249,7 @@
241
249
  "type": "boolean",
242
250
  "required": false,
243
251
  "defaultValue": "false",
244
- "description": "Loading state: shows a spinner and blocks activation while keeping the\nbutton focusable (`aria-disabled`, not native `disabled`), so a\nkeyboard user who triggered it keeps their place. Only `onClick` is\nguarded: put the action there, not in `onKeyDown`/`onPointerDown`.\nThe start and end of loading aren't announced; confirm completion\nthrough your own status message (a Toast, say)."
252
+ "description": "Loading state: shows a spinner and blocks activation while keeping the\nbutton focusable (`aria-disabled`, not native `disabled`), so a\nkeyboard user who triggered it keeps their place. Only `onClick` is\nguarded: put the action there, not in `onKeyDown`/`onPointerDown`.\n\nBy default the start and end of loading aren't announced: the busy\nname (\"Save, loading\") is set on the focused button, which screen\nreaders rarely re-read, and it reverts silently. Opt in with\n`labels={{ loadingStart: 'Saving…', loadingEnd: 'Saved' }}` to speak\neach transition through a pre-mounted polite live region (portaled, so\nit never becomes a DOM sibling of the button). If the button unmounts\nwhen the action completes (a dialog closing), the end can't be spoken\nfrom here: confirm through your own status message (a Toast).\n\nWith `loadingStart`, don't set `aria-busy` on an ancestor of the\nbutton: NVDA and Chromium hold live-region output under a busy ancestor.\nTest with a screen reader: some also re-read the busy name (\"Save,\nloading\"), which can double up with `loadingStart`.\n\nWhile loading, the button stays focusable, so it mutes its colors rather\nthan dimming the whole element: the focus ring keeps full contrast."
245
253
  },
246
254
  "loadingLabel": {
247
255
  "type": "string",
@@ -252,7 +260,7 @@
252
260
  "labels": {
253
261
  "type": "ButtonLabels",
254
262
  "required": false,
255
- "description": "Override default English strings for i18n.\nCovers strings not already handled by existing props (e.g. `loadingLabel`)."
263
+ "description": "Override default English strings for i18n, and opt in to loading\nannouncements (`loadingStart` / `loadingEnd`, empty by default).\nCovers strings not already handled by existing props (e.g. `loadingLabel`)."
256
264
  },
257
265
  "target": {
258
266
  "type": "HTMLAttributeAnchorTarget",
@@ -484,6 +492,7 @@
484
492
  "Head",
485
493
  "Body",
486
494
  "Foot",
495
+ "Media",
487
496
  "Link"
488
497
  ],
489
498
  "description": "Content container with semantic structure and optional inline layout",
@@ -571,7 +580,8 @@
571
580
  "--tui-checkbox-bg",
572
581
  "--tui-checkbox-size",
573
582
  "--tui-checkbox-gap",
574
- "--tui-checkbox-label-color"
583
+ "--tui-checkbox-label-color",
584
+ "--tui-checkbox-fg-disabled"
575
585
  ],
576
586
  "story": {
577
587
  "title": "Forms/Checkbox",
@@ -1033,7 +1043,12 @@
1033
1043
  "lms"
1034
1044
  ]
1035
1045
  },
1036
- "subcomponents": null,
1046
+ "subcomponents": [
1047
+ "Content",
1048
+ "Option",
1049
+ "Group",
1050
+ "Label"
1051
+ ],
1037
1052
  "description": null,
1038
1053
  "gotchas": null,
1039
1054
  "examples": null,
@@ -1267,7 +1282,7 @@
1267
1282
  "children": {
1268
1283
  "type": "ReactNode",
1269
1284
  "required": false,
1270
- "description": "Trigger placement. Omit and the picker renders its own input-group button,\nexactly as before. Provide children to place the trigger yourself — inside\na text field's suffix slot, a toolbar — with `<DatePicker.Trigger>` marking\nthe spot, and `asChild` on that Trigger to supply your own element:\n\n```tsx\n<DatePicker value={date} onChange={commit}>\n <TextInput\n value={text}\n onChange={(e) => setText(e.target.value)}\n suffix={\n <DatePicker.Trigger asChild>\n <IconButton icon=\"lms/calendar\" label=\"Pick a date\" />\n </DatePicker.Trigger>\n }\n />\n</DatePicker>\n```\n\nChildren with no Trigger among them leaves the picker unopenable; a dev\nwarning fires for that case."
1285
+ "description": "Trigger placement. Omit and the picker renders its own input-group button,\nexactly as before. Provide children to place the trigger yourself — inside\na text field's suffix slot, a toolbar — with `<DatePicker.Trigger>` marking\nthe spot, and `asChild` on that Trigger to supply your own element:\n\n```tsx\n<DatePicker value={date} onChange={commit}>\n <TextInput\n value={text}\n onChange={(e) => setText(e.target.value)}\n suffix={\n <DatePicker.Trigger asChild>\n <IconButton icon=\"system/calendar\" label=\"Pick a date\" />\n </DatePicker.Trigger>\n }\n />\n</DatePicker>\n```\n\nChildren with no Trigger among them leaves the picker unopenable; a dev\nwarning fires for that case."
1271
1286
  },
1272
1287
  "className": {
1273
1288
  "type": "string",
@@ -1294,7 +1309,9 @@
1294
1309
  "autodocs"
1295
1310
  ]
1296
1311
  },
1297
- "subcomponents": null,
1312
+ "subcomponents": [
1313
+ "Trigger"
1314
+ ],
1298
1315
  "description": null,
1299
1316
  "gotchas": null,
1300
1317
  "examples": null,
@@ -1337,7 +1354,13 @@
1337
1354
  "stable"
1338
1355
  ]
1339
1356
  },
1340
- "subcomponents": null,
1357
+ "subcomponents": [
1358
+ "Trigger",
1359
+ "Content",
1360
+ "Item",
1361
+ "Separator",
1362
+ "Header"
1363
+ ],
1341
1364
  "description": null,
1342
1365
  "gotchas": null,
1343
1366
  "examples": null,
@@ -1360,7 +1383,12 @@
1360
1383
  "lms"
1361
1384
  ]
1362
1385
  },
1363
- "subcomponents": null,
1386
+ "subcomponents": [
1387
+ "Label",
1388
+ "Control",
1389
+ "HelperText",
1390
+ "Error"
1391
+ ],
1364
1392
  "description": null,
1365
1393
  "gotchas": null,
1366
1394
  "examples": null,
@@ -1533,7 +1561,7 @@
1533
1561
  "loading": {
1534
1562
  "type": "boolean",
1535
1563
  "required": false,
1536
- "description": "Loading state: shows a spinner and blocks activation while keeping the\nbutton focusable (`aria-disabled`, not native `disabled`), so a\nkeyboard user who triggered it keeps their place. Only `onClick` is\nguarded: put the action there, not in `onKeyDown`/`onPointerDown`.\nThe start and end of loading aren't announced; confirm completion\nthrough your own status message (a Toast, say)."
1564
+ "description": "Loading state: shows a spinner and blocks activation while keeping the\nbutton focusable (`aria-disabled`, not native `disabled`), so a\nkeyboard user who triggered it keeps their place. Only `onClick` is\nguarded: put the action there, not in `onKeyDown`/`onPointerDown`.\n\nBy default the start and end of loading aren't announced: the busy\nname (\"Save, loading\") is set on the focused button, which screen\nreaders rarely re-read, and it reverts silently. Opt in with\n`labels={{ loadingStart: 'Saving…', loadingEnd: 'Saved' }}` to speak\neach transition through a pre-mounted polite live region (portaled, so\nit never becomes a DOM sibling of the button). If the button unmounts\nwhen the action completes, the end can't be spoken from here: confirm\nthrough your own status message (a Toast).\n\nWith `loadingStart`, don't set `aria-busy` on an ancestor of the\nbutton: NVDA and Chromium hold live-region output under a busy ancestor.\nTest with a screen reader: some also re-read the busy name (\"Save,\nloading\"), which can double up with `loadingStart`.\n\nWhile loading, the button stays focusable, so it mutes its colors rather\nthan dimming the whole element: the focus ring keeps full contrast."
1537
1565
  },
1538
1566
  "loadingLabel": {
1539
1567
  "type": "string",
@@ -1541,6 +1569,11 @@
1541
1569
  "defaultValue": "`${label}, loading` (English)",
1542
1570
  "description": "Accessible label override during loading state. For i18n support."
1543
1571
  },
1572
+ "labels": {
1573
+ "type": "IconButtonLabels",
1574
+ "required": false,
1575
+ "description": "Override default strings for i18n, and opt in to loading announcements\n(`loadingStart` / `loadingEnd`, empty by default). The button's name is\n`label`; the busy name is `loadingLabel`."
1576
+ },
1544
1577
  "pressed": {
1545
1578
  "type": "boolean",
1546
1579
  "required": false,
@@ -1949,7 +1982,12 @@
1949
1982
  "autodocs"
1950
1983
  ]
1951
1984
  },
1952
- "subcomponents": null,
1985
+ "subcomponents": [
1986
+ "Content",
1987
+ "Option",
1988
+ "Group",
1989
+ "Label"
1990
+ ],
1953
1991
  "description": null,
1954
1992
  "gotchas": null,
1955
1993
  "examples": null,
@@ -2051,7 +2089,13 @@
2051
2089
  "lms"
2052
2090
  ]
2053
2091
  },
2054
- "subcomponents": null,
2092
+ "subcomponents": [
2093
+ "Trigger",
2094
+ "Content",
2095
+ "Option",
2096
+ "Group",
2097
+ "Label"
2098
+ ],
2055
2099
  "description": null,
2056
2100
  "gotchas": null,
2057
2101
  "examples": null,
@@ -2194,7 +2238,11 @@
2194
2238
  "stable"
2195
2239
  ]
2196
2240
  },
2197
- "subcomponents": null,
2241
+ "subcomponents": [
2242
+ "Group",
2243
+ "Item",
2244
+ "Sub"
2245
+ ],
2198
2246
  "description": null,
2199
2247
  "gotchas": null,
2200
2248
  "examples": null,
@@ -2438,7 +2486,9 @@
2438
2486
  "stable"
2439
2487
  ]
2440
2488
  },
2441
- "subcomponents": null,
2489
+ "subcomponents": [
2490
+ "Overflow"
2491
+ ],
2442
2492
  "description": null,
2443
2493
  "gotchas": null,
2444
2494
  "examples": null,
@@ -2580,7 +2630,10 @@
2580
2630
  "autodocs"
2581
2631
  ]
2582
2632
  },
2583
- "subcomponents": null,
2633
+ "subcomponents": [
2634
+ "Trigger",
2635
+ "Content"
2636
+ ],
2584
2637
  "description": null,
2585
2638
  "gotchas": null,
2586
2639
  "examples": null,
@@ -2593,7 +2646,7 @@
2593
2646
  "children": {
2594
2647
  "type": "ReactNode",
2595
2648
  "required": false,
2596
- "description": "Custom content to render inside the progress indicator.\n- Line mode with `inside`: Replaces default content inside the bar\n- Circle mode with `inside`: Replaces centered content\n- Segmented mode: Replaces the segment labels area below the bar"
2649
+ "description": "Custom content to render inside the progress indicator.\n- Line mode with `inside`: Replaces default content inside the bar\n- Circle mode with `inside`: Replaces centered content\n- Segmented mode: Replaces the segment labels area below the bar\nNot available in breakdown mode: the legend list is the accessible representation."
2597
2650
  },
2598
2651
  "size": {
2599
2652
  "type": "\"xs\" | \"sm\" | \"md\" | \"lg\"",
@@ -2610,8 +2663,8 @@
2610
2663
  "showLabels": {
2611
2664
  "type": "boolean",
2612
2665
  "required": false,
2613
- "defaultValue": "true",
2614
- "description": "Whether to display labels.\nWhen false, hides all label content regardless of other props."
2666
+ "defaultValue": "true\ntrue",
2667
+ "description": "Whether to display labels.\nWhen false, hides all label content regardless of other props.\nWhether to show the legend. When false the list stays in the\naccessibility tree (visually hidden), but sighted users are left with\ncolor alone (SC 1.4.1): you must show the labels and values in visible\ntext elsewhere."
2615
2668
  },
2616
2669
  "defaultLabel": {
2617
2670
  "type": "string",
@@ -2626,41 +2679,57 @@
2626
2679
  "mode": {
2627
2680
  "type": "\"line\" | \"circle\"",
2628
2681
  "required": false,
2629
- "defaultValue": "'line'\n'line'",
2630
- "description": "Display mode. Segmented progress only supports line mode.\nDisplay mode of the progress indicator.\n- `'line'`: Horizontal bar (default)\n- `'circle'`: Circular/ring indicator"
2682
+ "defaultValue": "'line'\n'line'\n'line'",
2683
+ "description": "Display mode. Segmented progress only supports line mode.\nDisplay mode. A breakdown is a line.\nDisplay mode of the progress indicator.\n- `'line'`: Horizontal bar (default)\n- `'circle'`: Circular/ring indicator"
2684
+ },
2685
+ "breakdown": {
2686
+ "type": "boolean",
2687
+ "required": false,
2688
+ "description": "Cumulative segments. Set `breakdown` for a by-status composition.\nEach segment is its own count, colored by its `theme`.\nNot available in standard mode."
2689
+ },
2690
+ "showPercent": {
2691
+ "type": "boolean",
2692
+ "required": false,
2693
+ "defaultValue": "false",
2694
+ "description": "Breakdown only.\nShow each segment's share of the total (\"25%\") instead of its count.\nThis replaces the count in the accessible output too: the list items\nread \"Done 75%\", so put counts in visible text nearby if they matter.\nNot available in standard mode."
2631
2695
  },
2632
2696
  "segments": {
2633
- "type": "ProgressSegment[]",
2697
+ "type": "ProgressSegment[] | ProgressBreakdownSegment[]",
2634
2698
  "required": false,
2635
- "description": "Segments to display, ordered front-to-back (z1, z2, z3...).\nMaximum 5 segments have default colors; beyond that, override via CSS.\nNot available in standard mode. Use segmented mode instead."
2699
+ "description": "Segments to display, ordered front-to-back (z1, z2, z3...).\nMaximum 5 segments have default colors; beyond that, override via CSS.\nThe parts, in display order (start to end).\nNot available in standard mode. Use segmented mode instead."
2636
2700
  },
2637
2701
  "value": {
2638
2702
  "type": "number",
2639
2703
  "required": false,
2640
2704
  "defaultValue": "0",
2641
- "description": "Not available in segmented mode.\nCurrent progress value (0–100, or use with `max` prop)."
2705
+ "description": "Not available in segmented mode.\nNot available in breakdown mode.\nCurrent progress value (0–100, or use with `max` prop)."
2642
2706
  },
2643
2707
  "indeterminate": {
2644
2708
  "type": "boolean",
2645
2709
  "required": false,
2646
2710
  "defaultValue": "false",
2647
- "description": "Not supported in segmented mode.\nWhen true, shows an animated indeterminate state.\nUse for operations where progress percentage is unknown.\nIgnores `value` when enabled."
2711
+ "description": "Not supported in segmented mode.\nNot supported in breakdown mode.\nWhen true, shows an animated indeterminate state.\nUse for operations where progress percentage is unknown.\nIgnores `value` when enabled."
2648
2712
  },
2649
2713
  "labelPosition": {
2650
2714
  "type": "\"above\" | \"inline\" | \"below\" | \"inside\"",
2651
2715
  "required": false,
2652
2716
  "defaultValue": "'inline'",
2653
- "description": "Not available in segmented mode. Labels appear below the bar.\nWhere to display the labels relative to the progress bar.\n- `'above'`: Labels in a row above the bar\n- `'inline'`: Labels beside the bar horizontally (default)\n- `'below'`: Labels in a row below the bar\n- `'inside'`: Label content inside/overlapping the bar (or centered in circle)\n\nWhen both `labelStart` and `labelEnd` are provided with `above`, `inline`,\nor `below`, they appear on opposite sides (space-between)."
2717
+ "description": "Not available in segmented mode. Labels appear below the bar.\nNot available in breakdown mode.\nWhere to display the labels relative to the progress bar.\n- `'above'`: Labels in a row above the bar\n- `'inline'`: Labels beside the bar horizontally (default)\n- `'below'`: Labels in a row below the bar\n- `'inside'`: Label content inside/overlapping the bar (or centered in circle)\n\nWhen both `labelStart` and `labelEnd` are provided with `above`, `inline`,\nor `below`, they appear on opposite sides (space-between)."
2654
2718
  },
2655
2719
  "labelStart": {
2656
2720
  "type": "ReactNode",
2657
2721
  "required": false,
2658
- "description": "Not available in segmented mode.\nLabel content for the start (left) position.\nUse with `labelPosition` to control placement.\n@example labelStart=\"33% Complete\""
2722
+ "description": "Not available in segmented mode.\nNot available in breakdown mode.\nLabel content for the start (left) position.\nUse with `labelPosition` to control placement.\n@example labelStart=\"33% Complete\""
2659
2723
  },
2660
2724
  "labelEnd": {
2661
2725
  "type": "ReactNode",
2662
2726
  "required": false,
2663
- "description": "Not available in segmented mode.\nLabel content for the end (right) position.\nUse with `labelPosition` to control placement.\n@example labelEnd=\"3/9 Steps\""
2727
+ "description": "Not available in segmented mode.\nNot available in breakdown mode.\nLabel content for the end (right) position.\nUse with `labelPosition` to control placement.\n@example labelEnd=\"3/9 Steps\""
2728
+ },
2729
+ "labels": {
2730
+ "type": "ProgressLabels",
2731
+ "required": false,
2732
+ "description": "Overridable strings for i18n (`remaining`)."
2664
2733
  },
2665
2734
  "variant": {
2666
2735
  "type": "\"ring\" | \"solid\"",
@@ -2684,7 +2753,8 @@
2684
2753
  "--tui-progress-z2-label",
2685
2754
  "--tui-progress-z3-label",
2686
2755
  "--tui-progress-z4-label",
2687
- "--tui-progress-z5-label"
2756
+ "--tui-progress-z5-label",
2757
+ "--tui-progress-segment-gap"
2688
2758
  ],
2689
2759
  "story": {
2690
2760
  "title": "Primitives/Progress",
@@ -2757,6 +2827,7 @@
2757
2827
  "--tui-radio-font-size",
2758
2828
  "--tui-radio-label-color",
2759
2829
  "--tui-radio-description-color",
2830
+ "--tui-radio-fg-disabled",
2760
2831
  "--tui-radio-group-gap"
2761
2832
  ],
2762
2833
  "story": {
@@ -3043,7 +3114,13 @@
3043
3114
  "stable"
3044
3115
  ]
3045
3116
  },
3046
- "subcomponents": null,
3117
+ "subcomponents": [
3118
+ "Trigger",
3119
+ "Content",
3120
+ "Option",
3121
+ "Group",
3122
+ "Label"
3123
+ ],
3047
3124
  "description": null,
3048
3125
  "gotchas": null,
3049
3126
  "examples": null,
@@ -3216,6 +3293,7 @@
3216
3293
  "--tui-segmented-item-bg-active",
3217
3294
  "--tui-segmented-item-fg-active",
3218
3295
  "--tui-segmented-item-border-active",
3296
+ "--tui-segmented-item-fg-disabled",
3219
3297
  "--tui-segmented-indicator",
3220
3298
  "--tui-segmented-indicator-size"
3221
3299
  ],
@@ -3365,7 +3443,13 @@
3365
3443
  "stable"
3366
3444
  ]
3367
3445
  },
3368
- "subcomponents": null,
3446
+ "subcomponents": [
3447
+ "Trigger",
3448
+ "Content",
3449
+ "Option",
3450
+ "Group",
3451
+ "Label"
3452
+ ],
3369
3453
  "description": null,
3370
3454
  "gotchas": null,
3371
3455
  "examples": null,
@@ -3448,7 +3532,12 @@
3448
3532
  "lms"
3449
3533
  ]
3450
3534
  },
3451
- "subcomponents": null,
3535
+ "subcomponents": [
3536
+ "Header",
3537
+ "Footer",
3538
+ "Nav",
3539
+ "Toggle"
3540
+ ],
3452
3541
  "description": null,
3453
3542
  "gotchas": null,
3454
3543
  "examples": null,
@@ -3662,7 +3751,9 @@
3662
3751
  "lms"
3663
3752
  ]
3664
3753
  },
3665
- "subcomponents": null,
3754
+ "subcomponents": [
3755
+ "Item"
3756
+ ],
3666
3757
  "description": null,
3667
3758
  "gotchas": null,
3668
3759
  "examples": null,
@@ -4144,7 +4235,10 @@
4144
4235
  "a11y"
4145
4236
  ]
4146
4237
  },
4147
- "subcomponents": null,
4238
+ "subcomponents": [
4239
+ "Group",
4240
+ "Item"
4241
+ ],
4148
4242
  "description": null,
4149
4243
  "gotchas": null,
4150
4244
  "examples": null,
@@ -4191,7 +4285,11 @@
4191
4285
  "stable"
4192
4286
  ]
4193
4287
  },
4194
- "subcomponents": null,
4288
+ "subcomponents": [
4289
+ "Provider",
4290
+ "Trigger",
4291
+ "Content"
4292
+ ],
4195
4293
  "description": null,
4196
4294
  "gotchas": null,
4197
4295
  "examples": null,
@@ -4270,7 +4368,11 @@
4270
4368
  "stable"
4271
4369
  ]
4272
4370
  },
4273
- "subcomponents": null,
4371
+ "subcomponents": [
4372
+ "Message",
4373
+ "Actions",
4374
+ "SaveActions"
4375
+ ],
4274
4376
  "description": null,
4275
4377
  "gotchas": null,
4276
4378
  "examples": null,
@@ -4484,9 +4586,10 @@
4484
4586
  "membersync": 22,
4485
4587
  "player": 24,
4486
4588
  "reaction": 36,
4487
- "system": 141
4589
+ "searchsync": 7,
4590
+ "system": 144
4488
4591
  },
4489
- "total": 280,
4592
+ "total": 290,
4490
4593
  "manifest": "./icons/manifest.json"
4491
4594
  }
4492
4595
  }
package/utils/portal.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- export declare function getPortalRoot(): HTMLElement;
1
+ export declare function getPortalRoot(): HTMLElement | null;
2
2
  /**
3
3
  * Gets portal root for a specific element (finds its nearest .tui-interface ancestor).
4
4
  * Reuses existing portal roots per interface container to prevent DOM accumulation.
5
- * Always returns a valid portal root inside .tui-interface scope.
5
+ * Returns a valid portal root inside .tui-interface scope, or null on the
6
+ * server (no `document`).
6
7
  */
7
- export declare function getPortalRootFor(element: HTMLElement | null): HTMLElement;
8
+ export declare function getPortalRootFor(element: HTMLElement | null): HTMLElement | null;
package/utils/portal.js CHANGED
@@ -2,7 +2,12 @@
2
2
  // Portal Root Utility
3
3
  // =============================================================================
4
4
  //
5
- // GUARANTEE: Always returns a node inside `.tui-interface` scope.
5
+ // GUARANTEE: In the browser, always returns a node inside `.tui-interface`
6
+ // scope. On the server (no `document`) it returns null: Floating UI's
7
+ // FloatingPortal waits on a null root and renders nothing, and a client's
8
+ // first render also renders nothing (the portal node is created in a layout
9
+ // effect), so server and client markup agree and the content portals on
10
+ // mount (#139). Callers that mount into it directly must handle null.
6
11
  //
7
12
  // If no interface wrapper exists, creates one at document.body level.
8
13
  // Components using this utility can rely on token inheritance and
@@ -15,6 +20,8 @@
15
20
  // =============================================================================
16
21
  import { PREFIX, INTERFACE_CLASS } from '../constants.js';
17
22
  const PORTAL_ID = `${PREFIX}-portal-root`;
23
+ /** False while server-rendering: these helpers are called during render. */
24
+ const hasDocument = () => typeof document !== 'undefined';
18
25
  // Track which interface elements have portal roots (prevents accumulation)
19
26
  const portalRoots = new WeakMap();
20
27
  /**
@@ -85,6 +92,8 @@ function getOrCreateGlobalInterface() {
85
92
  * created under.
86
93
  */
87
94
  function reconcileFallback() {
95
+ if (!hasDocument())
96
+ return;
88
97
  const fallback = document.getElementById(GLOBAL_INTERFACE_ID);
89
98
  if (!fallback)
90
99
  return;
@@ -110,6 +119,8 @@ function reconcileFallback() {
110
119
  fallback.remove();
111
120
  }
112
121
  export function getPortalRoot() {
122
+ if (!hasDocument())
123
+ return null;
113
124
  reconcileFallback();
114
125
  // Check if we already have a global portal root
115
126
  const portalRoot = document.getElementById(PORTAL_ID);
@@ -129,9 +140,12 @@ export function getPortalRoot() {
129
140
  /**
130
141
  * Gets portal root for a specific element (finds its nearest .tui-interface ancestor).
131
142
  * Reuses existing portal roots per interface container to prevent DOM accumulation.
132
- * Always returns a valid portal root inside .tui-interface scope.
143
+ * Returns a valid portal root inside .tui-interface scope, or null on the
144
+ * server (no `document`).
133
145
  */
134
146
  export function getPortalRootFor(element) {
147
+ if (!hasDocument())
148
+ return null;
135
149
  reconcileFallback();
136
150
  if (!element)
137
151
  return getPortalRoot();
@@ -0,0 +1,2 @@
1
+ import type { ReactNode, RefObject } from 'react';
2
+ export declare function useLoadingAnnouncer(elementRef: RefObject<HTMLElement | null>, loading: boolean, start: string | undefined, end: string | undefined): ReactNode;
@@ -0,0 +1,101 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
3
+ import { createPortal } from 'react-dom';
4
+ import { getPortalRootFor } from './portal.js';
5
+ // =============================================================================
6
+ // useLoadingAnnouncer (@internal) — Button / IconButton loading announcements
7
+ // =============================================================================
8
+ //
9
+ // A loading button keeps focus (#130), and a focused element's aria-label
10
+ // change ("Save, loading") is not reliably re-announced, nor is the silent
11
+ // revert when loading ends (#131, WCAG 4.1.3). This speaks the transitions
12
+ // through a polite live region instead.
13
+ //
14
+ // Rules, from Toast's announcers:
15
+ // - The region is PRE-MOUNTED (empty) as soon as the feature is enabled, so
16
+ // an announcement is a text mutation in a region AT already knows about. A
17
+ // live region inserted together with its text is the unreliable path.
18
+ // - An alternating trailing NBSP guarantees a DOM mutation when the same text
19
+ // repeats (Save twice), and a timer clears the text so browse mode can't
20
+ // stumble on it later.
21
+ //
22
+ // Where it lives: PORTALED, never a DOM sibling of the button. A sibling
23
+ // would become the button's `:last-child`/`+` neighbour and break connected
24
+ // groups (Pager's flush segments), input-group slot rules
25
+ // (`__suffix > .tui-button`) and any consumer's structural selectors. The
26
+ // container is the nearest dialog ancestor when there is one, because the
27
+ // page outside a dialog can be hidden from AT: Modal inerts its siblings, and
28
+ // a `Popover modal` (DatePicker's) is role="dialog" WITHOUT aria-modal while
29
+ // Floating UI's FloatingFocusManager aria-hides everything else, so checking
30
+ // aria-modal alone left the region silenced there. Matches role="dialog",
31
+ // role="alertdialog", aria-modal="true" and dialog[open] (Sidebar's drawer is
32
+ // role="dialog" aria-modal="true"); closest() takes the nearest. Otherwise
33
+ // the portal root of the button's `.tui-interface`.
34
+ //
35
+ // Don't put aria-busy on an ancestor of the button: NVDA and Chromium hold
36
+ // live-region output under a busy ancestor until it clears. The clip styles are inline because
37
+ // `.tui-visually-hidden` is scoped under `.tui-interface` and a fallback
38
+ // portal root may sit outside one.
39
+ //
40
+ // Only rendered when a start or end string is set: nothing changes for
41
+ // consumers who don't opt in.
42
+ // =============================================================================
43
+ const CLEAR_AFTER_MS = 3000;
44
+ const VISUALLY_HIDDEN = {
45
+ position: 'absolute',
46
+ width: 1,
47
+ height: 1,
48
+ padding: 0,
49
+ margin: -1,
50
+ overflow: 'hidden',
51
+ clip: 'rect(0 0 0 0)',
52
+ clipPath: 'inset(50%)',
53
+ whiteSpace: 'nowrap',
54
+ border: 0,
55
+ };
56
+ function resolveContainer(el) {
57
+ const modal = el.closest('[role="dialog"], [role="alertdialog"], [aria-modal="true"], dialog[open]');
58
+ return modal ?? getPortalRootFor(el);
59
+ }
60
+ export function useLoadingAnnouncer(elementRef, loading, start, end) {
61
+ const enabled = !!(start || end);
62
+ const [container, setContainer] = useState(null);
63
+ const [text, setText] = useState('');
64
+ const seqRef = useRef(0);
65
+ const clearRef = useRef(null);
66
+ const prevLoadingRef = useRef(loading);
67
+ // Resolve once enabled, before paint, so the empty region is in the DOM
68
+ // well before the first loading change.
69
+ useLayoutEffect(() => {
70
+ if (!enabled) {
71
+ setContainer(null);
72
+ return;
73
+ }
74
+ const el = elementRef.current;
75
+ if (el)
76
+ setContainer(resolveContainer(el));
77
+ }, [enabled, elementRef]);
78
+ const announce = useCallback((message) => {
79
+ seqRef.current += 1;
80
+ setText(message + (seqRef.current % 2 ? ' ' : ''));
81
+ if (clearRef.current)
82
+ clearTimeout(clearRef.current);
83
+ clearRef.current = setTimeout(() => setText(''), CLEAR_AFTER_MS);
84
+ }, []);
85
+ useEffect(() => {
86
+ const wasLoading = prevLoadingRef.current;
87
+ prevLoadingRef.current = loading;
88
+ if (!enabled || wasLoading === loading)
89
+ return;
90
+ const message = loading ? start : end;
91
+ if (message)
92
+ announce(message);
93
+ }, [loading, enabled, start, end, announce]);
94
+ useEffect(() => () => {
95
+ if (clearRef.current)
96
+ clearTimeout(clearRef.current);
97
+ }, []);
98
+ if (!enabled || !container)
99
+ return null;
100
+ return createPortal(_jsx("span", { className: "tui-loading-announcer", role: "status", "aria-live": "polite", "aria-atomic": "true", style: VISUALLY_HIDDEN, children: text }), container);
101
+ }