@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
package/tui-manifest.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "0.0.21",
3
- "generated": "2026-07-27T16:54:04.911Z",
2
+ "version": "0.2.0",
3
+ "generated": "2026-07-31T00:04:15.270Z",
4
4
  "components": {
5
5
  "Accordion": {
6
6
  "props": {
@@ -197,7 +197,7 @@
197
197
  "description": "Size of the button."
198
198
  },
199
199
  "theme": {
200
- "type": "\"primary\" | \"secondary\" | \"danger\" | \"destructive\"",
200
+ "type": "\"primary\" | \"secondary\" | \"danger\" | \"info\" | \"success\" | \"warning\" | \"destructive\"",
201
201
  "required": false,
202
202
  "defaultValue": "primary",
203
203
  "description": "Semantic color theme.\nNote: Defaults to 'primary' (unlike IconButton which defaults to 'secondary')\nbecause Buttons are typically primary CTAs."
@@ -272,12 +272,6 @@
272
272
  "required": false,
273
273
  "description": "Custom right icon element. Overrides rightIconName."
274
274
  },
275
- "iconSize": {
276
- "type": "\"xs\" | \"sm\" | \"md\" | \"lg\"",
277
- "required": false,
278
- "defaultValue": "'sm'",
279
- "description": "Size of icons."
280
- },
281
275
  "className": {
282
276
  "type": "string",
283
277
  "required": false,
@@ -320,6 +314,7 @@
320
314
  "--tui-button-border-interact",
321
315
  "--tui-button-fg-active",
322
316
  "--tui-button-icon-scale",
317
+ "--tui-control-height-xs",
323
318
  "--tui-control-height-sm",
324
319
  "--tui-control-height-md",
325
320
  "--tui-control-height-lg"
@@ -622,6 +617,12 @@
622
617
  "type": "MouseEventHandler<HTMLElement>",
623
618
  "required": false
624
619
  },
620
+ "removeLabel": {
621
+ "type": "string",
622
+ "required": false,
623
+ "defaultValue": "Remove",
624
+ "description": "Accessible label for the remove button. Pass a specific label like\n`Remove Alice` for context."
625
+ },
625
626
  "value": {
626
627
  "type": "OptionValue",
627
628
  "required": false,
@@ -880,7 +881,8 @@
880
881
  "--tui-combobox-content-radius",
881
882
  "--tui-combobox-option-radius",
882
883
  "--tui-combobox-option-bg-hover",
883
- "--tui-combobox-option-bg-selected"
884
+ "--tui-combobox-option-bg-selected",
885
+ "--tui-combobox-option-gap"
884
886
  ],
885
887
  "story": {
886
888
  "title": "Forms/Combobox",
@@ -954,6 +956,93 @@
954
956
  "use": null,
955
957
  "notFor": null
956
958
  },
959
+ "DatePicker": {
960
+ "props": {
961
+ "min": {
962
+ "type": "Date",
963
+ "required": false,
964
+ "description": "Earliest selectable day (inclusive, time-of-day ignored)."
965
+ },
966
+ "max": {
967
+ "type": "Date",
968
+ "required": false,
969
+ "description": "Latest selectable day (inclusive, time-of-day ignored)."
970
+ },
971
+ "isDayDisabled": {
972
+ "type": "(day: Date) => boolean",
973
+ "required": false,
974
+ "description": "Per-day disable hook, applied on top of min/max."
975
+ },
976
+ "weekStartsOn": {
977
+ "type": "0 | 1 | 2 | 3 | 4 | 5 | 6",
978
+ "required": false,
979
+ "defaultValue": "1",
980
+ "description": "First day of the week. 0 = Sunday … 6 = Saturday."
981
+ },
982
+ "locale": {
983
+ "type": "string",
984
+ "required": false,
985
+ "defaultValue": "the document language, falling back to 'en-US'",
986
+ "description": "BCP 47 locale for month/weekday names and numeric formats."
987
+ },
988
+ "onChange": {
989
+ "type": "(value: Date) => void",
990
+ "required": false
991
+ },
992
+ "withTime": {
993
+ "type": "boolean",
994
+ "required": false,
995
+ "defaultValue": "false",
996
+ "description": "Include the time field (and format the trigger with time)."
997
+ },
998
+ "hour12": {
999
+ "type": "boolean",
1000
+ "required": false,
1001
+ "defaultValue": "true",
1002
+ "description": "12-hour time UI with an AM/PM toggle."
1003
+ },
1004
+ "zoneLabel": {
1005
+ "type": "ReactNode",
1006
+ "required": false,
1007
+ "description": "Display-only zone badge next to the time field, e.g. \"UTC+0\"."
1008
+ },
1009
+ "disabled": {
1010
+ "type": "boolean",
1011
+ "required": false
1012
+ },
1013
+ "className": {
1014
+ "type": "string",
1015
+ "required": false
1016
+ },
1017
+ "id": {
1018
+ "type": "string",
1019
+ "required": false
1020
+ }
1021
+ },
1022
+ "cssTokens": [
1023
+ "--tui-calendar-cell-size",
1024
+ "--tui-calendar-cell-radius",
1025
+ "--tui-calendar-selected-bg",
1026
+ "--tui-calendar-selected-fg",
1027
+ "--tui-calendar-range-bg",
1028
+ "--tui-calendar-today-bg",
1029
+ "--tui-calendar-caption-color",
1030
+ "--tui-date-picker-width"
1031
+ ],
1032
+ "story": {
1033
+ "title": "Forms/DatePicker",
1034
+ "tags": [
1035
+ "autodocs"
1036
+ ]
1037
+ },
1038
+ "subcomponents": null,
1039
+ "description": null,
1040
+ "gotchas": null,
1041
+ "examples": null,
1042
+ "related": null,
1043
+ "use": null,
1044
+ "notFor": null
1045
+ },
957
1046
  "Dropdown": {
958
1047
  "props": {
959
1048
  "open": {
@@ -1086,7 +1175,7 @@
1086
1175
  "description": "Size of the button.\n- `'xs'`: 24px — below WCAG 2.5.8 minimum target size (24×24 CSS px).\n Use only in dense, mouse-first UIs (toolbars, table rows) where touch\n is not expected. Consider pairing with adequate spacing or a larger\n touch target via padding/margin.\n- `'sm'`: 32px (default)\n- `'md'`: 40px\n- `'lg'`: 48px"
1087
1176
  },
1088
1177
  "theme": {
1089
- "type": "\"primary\" | \"secondary\" | \"danger\"",
1178
+ "type": "\"info\" | \"primary\" | \"secondary\" | \"danger\" | \"success\" | \"warning\"",
1090
1179
  "required": false,
1091
1180
  "defaultValue": "'secondary'",
1092
1181
  "description": "Semantic color theme.\nNote: Defaults to 'secondary' (unlike Button which defaults to 'primary')\nbecause IconButtons are typically used for toolbar/utility actions."
@@ -1378,6 +1467,118 @@
1378
1467
  "use": null,
1379
1468
  "notFor": null
1380
1469
  },
1470
+ "MultiCombobox": {
1471
+ "props": {
1472
+ "size": {
1473
+ "type": "\"sm\" | \"md\" | \"lg\"",
1474
+ "required": false,
1475
+ "defaultValue": "'md'",
1476
+ "description": "Control size."
1477
+ },
1478
+ "overflow": {
1479
+ "type": "\"wrap\" | \"trim\"",
1480
+ "required": false,
1481
+ "defaultValue": "'trim'",
1482
+ "description": "How selected chips behave when they exceed the control width.\n- 'trim' (default): the control stays a single line (fixed height); chips\n flow horizontally and clip toward the inline-start, keeping the typing\n area in view. Preserves row alignment in multi-column form layouts.\n- 'wrap': chips wrap onto new lines and the control grows vertically.\n Opt in for standalone or spacious placements."
1483
+ },
1484
+ "value": {
1485
+ "type": "MultiComboboxValue",
1486
+ "required": false,
1487
+ "description": "Controlled selected values."
1488
+ },
1489
+ "onValueChange": {
1490
+ "type": "(value: MultiComboboxValue) => void",
1491
+ "required": false,
1492
+ "description": "Callback when selection changes."
1493
+ },
1494
+ "inputValue": {
1495
+ "type": "string",
1496
+ "required": false,
1497
+ "description": "Controlled input value for search/filter."
1498
+ },
1499
+ "filterMode": {
1500
+ "type": "\"always\" | \"when-searching\"",
1501
+ "required": false,
1502
+ "defaultValue": "'always'",
1503
+ "description": "Controls filtering behavior."
1504
+ },
1505
+ "open": {
1506
+ "type": "boolean",
1507
+ "required": false,
1508
+ "description": "Controlled open state."
1509
+ },
1510
+ "defaultOpen": {
1511
+ "type": "boolean",
1512
+ "required": false,
1513
+ "defaultValue": "false",
1514
+ "description": "Default open state for uncontrolled usage."
1515
+ },
1516
+ "disabled": {
1517
+ "type": "boolean",
1518
+ "required": false,
1519
+ "defaultValue": "false",
1520
+ "description": "Whether the combobox is disabled."
1521
+ },
1522
+ "openOnFocus": {
1523
+ "type": "boolean",
1524
+ "required": false,
1525
+ "defaultValue": "true",
1526
+ "description": "Whether to open the listbox when the input receives focus."
1527
+ },
1528
+ "max": {
1529
+ "type": "number",
1530
+ "required": false,
1531
+ "description": "Maximum number of selections allowed.\nWhen reached, unselected options become disabled."
1532
+ },
1533
+ "clearable": {
1534
+ "type": "boolean",
1535
+ "required": false,
1536
+ "defaultValue": "true",
1537
+ "description": "Whether to show the clear-all button when values are present."
1538
+ },
1539
+ "inputClassName": {
1540
+ "type": "string",
1541
+ "required": false,
1542
+ "description": "Class name applied directly to the `<input>` element.\nUse for utilities like `tui-input-reset` that must target the input itself."
1543
+ },
1544
+ "labels": {
1545
+ "type": "MultiComboboxLabels",
1546
+ "required": false,
1547
+ "description": "Override default English strings for i18n."
1548
+ }
1549
+ },
1550
+ "cssTokens": [
1551
+ "--tui-multicombobox-min-width Minimum width of the dropdown content",
1552
+ "--tui-multicombobox-control-bg Token-field background",
1553
+ "--tui-multicombobox-control-fg Text / icon colour in the control",
1554
+ "--tui-multicombobox-control-border Control border colour (rest)",
1555
+ "--tui-multicombobox-control-border-focus Control border colour (focus / open)",
1556
+ "--tui-multicombobox-control-radius Control border radius",
1557
+ "--tui-multicombobox-content-bg Listbox background",
1558
+ "--tui-multicombobox-content-border Listbox border colour",
1559
+ "--tui-multicombobox-content-shadow Listbox drop shadow",
1560
+ "--tui-multicombobox-content-radius Listbox border radius",
1561
+ "--tui-multicombobox-option-radius Option corner radius",
1562
+ "--tui-multicombobox-option-bg-hover Option background (hover / highlighted)",
1563
+ "--tui-multicombobox-option-bg-selected Option background (selected)",
1564
+ "--tui-multicombobox-option-gap Vertical gap between options"
1565
+ ],
1566
+ "story": {
1567
+ "title": "Forms/MultiCombobox",
1568
+ "tags": [
1569
+ "stable",
1570
+ "lms",
1571
+ "autodocs"
1572
+ ]
1573
+ },
1574
+ "subcomponents": null,
1575
+ "description": null,
1576
+ "gotchas": null,
1577
+ "examples": null,
1578
+ "related": null,
1579
+ "use": null,
1580
+ "notFor": null
1581
+ },
1381
1582
  "MultiSelect": {
1382
1583
  "props": {
1383
1584
  "size": {
@@ -1455,6 +1656,7 @@
1455
1656
  "--tui-multiselect-option-radius",
1456
1657
  "--tui-multiselect-option-bg-hover",
1457
1658
  "--tui-multiselect-option-bg-selected",
1659
+ "--tui-multiselect-option-gap",
1458
1660
  "--tui-multiselect-chip-bg",
1459
1661
  "--tui-multiselect-chip-fg"
1460
1662
  ],
@@ -1575,6 +1777,7 @@
1575
1777
  "cssTokens": [
1576
1778
  "--tui-notice-bg",
1577
1779
  "--tui-notice-border",
1780
+ "--tui-notice-border-width",
1578
1781
  "--tui-notice-stripe",
1579
1782
  "--tui-notice-stripe-width",
1580
1783
  "--tui-notice-fg",
@@ -1900,7 +2103,12 @@
1900
2103
  "--tui-progress-z2-fill",
1901
2104
  "--tui-progress-z3-fill",
1902
2105
  "--tui-progress-z4-fill",
1903
- "--tui-progress-z5-fill"
2106
+ "--tui-progress-z5-fill",
2107
+ "--tui-progress-z1-label",
2108
+ "--tui-progress-z2-label",
2109
+ "--tui-progress-z3-label",
2110
+ "--tui-progress-z4-label",
2111
+ "--tui-progress-z5-label"
1904
2112
  ],
1905
2113
  "story": {
1906
2114
  "title": "Primitives/Progress",
@@ -2067,7 +2275,7 @@
2067
2275
  "description": "Visual style"
2068
2276
  },
2069
2277
  "size": {
2070
- "type": "\"sm\" | \"md\" | \"lg\"",
2278
+ "type": "\"xs\" | \"sm\" | \"md\" | \"lg\"",
2071
2279
  "required": false,
2072
2280
  "description": "Size scale"
2073
2281
  },
@@ -2240,7 +2448,8 @@
2240
2448
  "--tui-select-content-radius",
2241
2449
  "--tui-select-option-radius",
2242
2450
  "--tui-select-option-bg-hover",
2243
- "--tui-select-option-bg-selected"
2451
+ "--tui-select-option-bg-selected",
2452
+ "--tui-select-option-gap"
2244
2453
  ],
2245
2454
  "story": {
2246
2455
  "title": "Forms/Select",
@@ -2316,6 +2525,94 @@
2316
2525
  "use": null,
2317
2526
  "notFor": null
2318
2527
  },
2528
+ "Slider": {
2529
+ "props": {
2530
+ "value": {
2531
+ "type": "number",
2532
+ "required": false,
2533
+ "description": "Controlled value."
2534
+ },
2535
+ "min": {
2536
+ "type": "number",
2537
+ "required": false,
2538
+ "defaultValue": "0",
2539
+ "description": "Minimum value. Defaults to 0."
2540
+ },
2541
+ "max": {
2542
+ "type": "number",
2543
+ "required": false,
2544
+ "defaultValue": "100",
2545
+ "description": "Maximum value. Defaults to 100."
2546
+ },
2547
+ "step": {
2548
+ "type": "number",
2549
+ "required": false,
2550
+ "description": "Step increment. Defaults to 1 — except on a segmented track, where it\ndefaults to the segment span so the value snaps to segment boundaries.\nPass an explicit step to override either default."
2551
+ },
2552
+ "onValueChange": {
2553
+ "type": "(value: number) => void",
2554
+ "required": false,
2555
+ "description": "Called with the new value on every change."
2556
+ },
2557
+ "segments": {
2558
+ "type": "number",
2559
+ "required": false,
2560
+ "defaultValue": "1",
2561
+ "description": "Track segmentation: renders the track as this many pill segments with\ngaps between them, and (unless `step` says otherwise) snaps the value\nto the segment boundaries. `1` (default) is a continuous track."
2562
+ },
2563
+ "startLabel": {
2564
+ "type": "ReactNode",
2565
+ "required": false,
2566
+ "description": "Label rendered under the track's start edge (e.g. \"Less rounded\")."
2567
+ },
2568
+ "endLabel": {
2569
+ "type": "ReactNode",
2570
+ "required": false,
2571
+ "description": "Label rendered under the track's end edge (e.g. \"More rounded\")."
2572
+ },
2573
+ "getValueText": {
2574
+ "type": "(value: number) => string",
2575
+ "required": false,
2576
+ "description": "Human-readable value for assistive tech (`aria-valuetext`), e.g.\n`(v) => `${v} pixels``. Without it screen readers announce the number."
2577
+ },
2578
+ "disabled": {
2579
+ "type": "boolean",
2580
+ "required": false,
2581
+ "defaultValue": "false"
2582
+ },
2583
+ "id": {
2584
+ "type": "string",
2585
+ "required": false
2586
+ },
2587
+ "className": {
2588
+ "type": "string",
2589
+ "required": false
2590
+ }
2591
+ },
2592
+ "cssTokens": [
2593
+ "--tui-slider-track-height",
2594
+ "--tui-slider-track-bg",
2595
+ "--tui-slider-fill",
2596
+ "--tui-slider-gap",
2597
+ "--tui-slider-segment-radius",
2598
+ "--tui-slider-thumb-size",
2599
+ "--tui-slider-thumb-bg",
2600
+ "--tui-slider-label-fg"
2601
+ ],
2602
+ "story": {
2603
+ "title": "Forms/Slider",
2604
+ "tags": [
2605
+ "autodocs"
2606
+ ]
2607
+ },
2608
+ "subcomponents": null,
2609
+ "description": null,
2610
+ "gotchas": null,
2611
+ "examples": null,
2612
+ "related": null,
2613
+ "use": null,
2614
+ "notFor": null
2615
+ },
2319
2616
  "StepIndicator": {
2320
2617
  "props": {
2321
2618
  "value": {
package/utils/portal.d.ts CHANGED
@@ -1,7 +1,3 @@
1
- /**
2
- * Gets or creates a portal root inside the first .tui-interface.
3
- * If no interface wrapper exists, creates a global one at body level.
4
- */
5
1
  export declare function getPortalRoot(): HTMLElement;
6
2
  /**
7
3
  * Gets portal root for a specific element (finds its nearest .tui-interface ancestor).
package/utils/portal.js CHANGED
@@ -34,6 +34,11 @@ const GLOBAL_INTERFACE_ID = `${PREFIX}-global-interface`;
34
34
  /**
35
35
  * Gets or creates a global .tui-interface wrapper at body level.
36
36
  * Used as fallback when no interface wrapper exists in the DOM.
37
+ *
38
+ * The fallback mirrors the host's `data-theme` (body, then html) at creation
39
+ * time so portaled content doesn't render light-mode inside a dark host —
40
+ * this is a snapshot, not a live sync; hosts that switch theme after mount
41
+ * should render a real .tui-interface instead of relying on the fallback.
37
42
  */
38
43
  function getOrCreateGlobalInterface() {
39
44
  let globalInterface = document.getElementById(GLOBAL_INTERFACE_ID);
@@ -41,6 +46,10 @@ function getOrCreateGlobalInterface() {
41
46
  globalInterface = document.createElement('div');
42
47
  globalInterface.id = GLOBAL_INTERFACE_ID;
43
48
  globalInterface.className = INTERFACE_CLASS;
49
+ const theme = document.body.getAttribute('data-theme') ??
50
+ document.documentElement.getAttribute('data-theme');
51
+ if (theme)
52
+ globalInterface.setAttribute('data-theme', theme);
44
53
  document.body.appendChild(globalInterface);
45
54
  }
46
55
  return globalInterface;
@@ -49,9 +58,32 @@ function getOrCreateGlobalInterface() {
49
58
  * Gets or creates a portal root inside the first .tui-interface.
50
59
  * If no interface wrapper exists, creates a global one at body level.
51
60
  */
61
+ /**
62
+ * A root created against the global fallback goes stale the moment a real
63
+ * interface exists (render-phase calls can beat the first commit,
64
+ * manufacturing the fallback next to a perfectly good interface). Re-home
65
+ * the root — moving the node keeps any mounted portals attached — and drop
66
+ * the empty fallback. Runs cheaply on every resolution.
67
+ */
68
+ function reconcileFallback() {
69
+ const fallback = document.getElementById(GLOBAL_INTERFACE_ID);
70
+ if (!fallback)
71
+ return;
72
+ const real = document.querySelector(`.${INTERFACE_CLASS}:not(#${GLOBAL_INTERFACE_ID})`);
73
+ if (!real)
74
+ return;
75
+ const strandedRoot = fallback.querySelector(`[id^="${PORTAL_ID}"]`);
76
+ if (strandedRoot) {
77
+ real.appendChild(strandedRoot);
78
+ portalRoots.set(real, strandedRoot);
79
+ }
80
+ if (fallback.childElementCount === 0)
81
+ fallback.remove();
82
+ }
52
83
  export function getPortalRoot() {
84
+ reconcileFallback();
53
85
  // Check if we already have a global portal root
54
- let portalRoot = document.getElementById(PORTAL_ID);
86
+ const portalRoot = document.getElementById(PORTAL_ID);
55
87
  if (portalRoot)
56
88
  return portalRoot;
57
89
  // Find the interface wrapper, or create global fallback
@@ -60,10 +92,10 @@ export function getPortalRoot() {
60
92
  interfaceEl = getOrCreateGlobalInterface();
61
93
  }
62
94
  // Create portal root inside the interface
63
- portalRoot = createPortalRoot(PORTAL_ID);
64
- interfaceEl.appendChild(portalRoot);
65
- portalRoots.set(interfaceEl, portalRoot);
66
- return portalRoot;
95
+ const created = createPortalRoot(PORTAL_ID);
96
+ interfaceEl.appendChild(created);
97
+ portalRoots.set(interfaceEl, created);
98
+ return created;
67
99
  }
68
100
  /**
69
101
  * Gets portal root for a specific element (finds its nearest .tui-interface ancestor).
@@ -71,6 +103,7 @@ export function getPortalRoot() {
71
103
  * Always returns a valid portal root inside .tui-interface scope.
72
104
  */
73
105
  export function getPortalRootFor(element) {
106
+ reconcileFallback();
74
107
  if (!element)
75
108
  return getPortalRoot();
76
109
  // Find nearest interface ancestor