@almadar/ui 6.20.0 → 6.21.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.
@@ -6430,6 +6430,36 @@ var init_resolve_render_bindings = __esm({
6430
6430
  evaluatorResolvedData = /* @__PURE__ */ new WeakSet();
6431
6431
  }
6432
6432
  });
6433
+
6434
+ // lib/portalRoot.ts
6435
+ function lastThemedElement(selector, portalRoot) {
6436
+ const matches = Array.from(document.querySelectorAll(selector)).filter(
6437
+ (el) => el !== document.documentElement && el !== portalRoot
6438
+ );
6439
+ return matches[matches.length - 1] ?? null;
6440
+ }
6441
+ function getOrCreatePortalRoot() {
6442
+ let root = document.getElementById("ui-slot-portal-root");
6443
+ if (!root) {
6444
+ root = document.createElement("div");
6445
+ root.id = "ui-slot-portal-root";
6446
+ root.style.position = "relative";
6447
+ root.style.zIndex = "9999";
6448
+ document.body.appendChild(root);
6449
+ }
6450
+ const themed = lastThemedElement('[data-theme*="-"]', root) ?? lastThemedElement("[data-theme]", root);
6451
+ if (themed) {
6452
+ const theme = themed.getAttribute("data-theme");
6453
+ if (theme && root.getAttribute("data-theme") !== theme) {
6454
+ root.setAttribute("data-theme", theme);
6455
+ }
6456
+ }
6457
+ return root;
6458
+ }
6459
+ var init_portalRoot = __esm({
6460
+ "lib/portalRoot.ts"() {
6461
+ }
6462
+ });
6433
6463
  var sizeClasses6, minWidthClasses, lookStyles2, Modal;
6434
6464
  var init_Modal = __esm({
6435
6465
  "components/core/molecules/Modal.tsx"() {
@@ -6439,6 +6469,7 @@ var init_Modal = __esm({
6439
6469
  init_Dialog();
6440
6470
  init_Typography();
6441
6471
  init_cn();
6472
+ init_portalRoot();
6442
6473
  init_useEventBus();
6443
6474
  init_Presence();
6444
6475
  sizeClasses6 = {
@@ -6649,7 +6680,7 @@ var init_Modal = __esm({
6649
6680
  )
6650
6681
  }
6651
6682
  ),
6652
- document.body
6683
+ getOrCreatePortalRoot()
6653
6684
  );
6654
6685
  };
6655
6686
  Modal.displayName = "Modal";
@@ -16223,6 +16254,7 @@ var init_StateMachineView = __esm({
16223
16254
  init_Icon();
16224
16255
  init_useEventBus();
16225
16256
  init_cn();
16257
+ init_portalRoot();
16226
16258
  StateNode = ({ state, config }) => {
16227
16259
  const { t } = useTranslate();
16228
16260
  const size = state.radius * 2;
@@ -16739,7 +16771,7 @@ var init_StateMachineView = __esm({
16739
16771
  )
16740
16772
  }
16741
16773
  ),
16742
- document.body
16774
+ getOrCreatePortalRoot()
16743
16775
  );
16744
16776
  };
16745
16777
  EntityBox = ({ entity, config }) => {
@@ -25218,7 +25250,7 @@ function SubMenu({
25218
25250
  })
25219
25251
  }
25220
25252
  );
25221
- return typeof document !== "undefined" ? createPortal(panel, document.body) : panel;
25253
+ return typeof document !== "undefined" ? createPortal(panel, getOrCreatePortalRoot()) : panel;
25222
25254
  }
25223
25255
  function MenuItemRow({
25224
25256
  item,
@@ -25305,6 +25337,7 @@ var init_Menu = __esm({
25305
25337
  init_Typography();
25306
25338
  init_Badge();
25307
25339
  init_cn();
25340
+ init_portalRoot();
25308
25341
  init_useEventBus();
25309
25342
  MENU_GAP = 4;
25310
25343
  menuContainerStyles = cn(
@@ -25441,7 +25474,7 @@ var init_Menu = __esm({
25441
25474
  ) : null;
25442
25475
  return /* @__PURE__ */ jsxs(Fragment, { children: [
25443
25476
  triggerElement,
25444
- panel && typeof document !== "undefined" ? createPortal(panel, document.body) : panel
25477
+ panel && typeof document !== "undefined" ? createPortal(panel, getOrCreatePortalRoot()) : panel
25445
25478
  ] });
25446
25479
  };
25447
25480
  Menu.displayName = "Menu";
@@ -29496,6 +29529,7 @@ var init_Popover = __esm({
29496
29529
  init_Typography();
29497
29530
  init_Presence();
29498
29531
  init_cn();
29532
+ init_portalRoot();
29499
29533
  init_useTapReveal();
29500
29534
  arrowClasses = {
29501
29535
  top: "top-full left-1/2 -translate-x-1/2 border-t-white border-l-transparent border-r-transparent border-b-transparent",
@@ -29655,7 +29689,7 @@ var init_Popover = __esm({
29655
29689
  ) : null;
29656
29690
  return /* @__PURE__ */ jsxs(Fragment, { children: [
29657
29691
  triggerElement,
29658
- panel && typeof document !== "undefined" ? createPortal(panel, document.body) : panel
29692
+ panel && typeof document !== "undefined" ? createPortal(panel, getOrCreatePortalRoot()) : panel
29659
29693
  ] });
29660
29694
  };
29661
29695
  Popover.displayName = "Popover";
@@ -29736,6 +29770,7 @@ var init_Coachmark = __esm({
29736
29770
  init_Button();
29737
29771
  init_Icon();
29738
29772
  init_cn();
29773
+ init_portalRoot();
29739
29774
  GAP = 10;
29740
29775
  EDGE = 8;
29741
29776
  Coachmark = ({
@@ -29838,7 +29873,7 @@ var init_Coachmark = __esm({
29838
29873
  beacon,
29839
29874
  card
29840
29875
  ] }),
29841
- document.body
29876
+ getOrCreatePortalRoot()
29842
29877
  );
29843
29878
  };
29844
29879
  Coachmark.displayName = "Coachmark";
@@ -29850,6 +29885,7 @@ var init_OnboardingSpotlight = __esm({
29850
29885
  "use client";
29851
29886
  init_Coachmark();
29852
29887
  init_cn();
29888
+ init_portalRoot();
29853
29889
  DIM = "fixed z-[45] bg-black/60";
29854
29890
  OnboardingSpotlight = ({
29855
29891
  steps,
@@ -29877,7 +29913,7 @@ var init_OnboardingSpotlight = __esm({
29877
29913
  ] });
29878
29914
  })() : /* @__PURE__ */ jsx("div", { className: cn(DIM, "inset-0") });
29879
29915
  return /* @__PURE__ */ jsxs(Fragment, { children: [
29880
- createPortal(backdrop, document.body),
29916
+ createPortal(backdrop, getOrCreatePortalRoot()),
29881
29917
  /* @__PURE__ */ jsxs(
29882
29918
  Coachmark,
29883
29919
  {
@@ -30411,6 +30447,7 @@ var init_Tooltip = __esm({
30411
30447
  "use client";
30412
30448
  init_Typography();
30413
30449
  init_cn();
30450
+ init_portalRoot();
30414
30451
  init_useTapReveal();
30415
30452
  TRIGGER_GAP2 = 8;
30416
30453
  arrowClasses2 = {
@@ -30516,7 +30553,7 @@ var init_Tooltip = __esm({
30516
30553
  ) : null;
30517
30554
  return /* @__PURE__ */ jsxs(Fragment, { children: [
30518
30555
  trigger,
30519
- typeof window !== "undefined" && tooltipContent ? createPortal(tooltipContent, document.body) : tooltipContent
30556
+ typeof window !== "undefined" && tooltipContent ? createPortal(tooltipContent, getOrCreatePortalRoot()) : tooltipContent
30520
30557
  ] });
30521
30558
  };
30522
30559
  Tooltip.displayName = "Tooltip";
@@ -44433,6 +44470,7 @@ var init_GraphCanvas = __esm({
44433
44470
  "components/core/molecules/GraphCanvas.tsx"() {
44434
44471
  "use client";
44435
44472
  init_cn();
44473
+ init_portalRoot();
44436
44474
  init_atoms();
44437
44475
  init_Stack();
44438
44476
  init_LoadingState();
@@ -45144,7 +45182,7 @@ var init_GraphCanvas = __esm({
45144
45182
  children: hoveredObj?.label
45145
45183
  }
45146
45184
  ),
45147
- document.body
45185
+ getOrCreatePortalRoot()
45148
45186
  )
45149
45187
  ] }),
45150
45188
  groups.length > 1 && /* @__PURE__ */ jsx(HStack, { gap: "md", className: "px-4 py-2 border-t border-border", wrap: true, children: groups.map((group, idx) => /* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
@@ -46534,6 +46572,7 @@ var init_DetailPanel = __esm({
46534
46572
  init_ErrorState();
46535
46573
  init_EmptyState();
46536
46574
  init_cn();
46575
+ init_portalRoot();
46537
46576
  init_format();
46538
46577
  init_getNestedValue();
46539
46578
  init_relationLabel();
@@ -46953,7 +46992,7 @@ var init_DetailPanel = __esm({
46953
46992
  return /* @__PURE__ */ jsx(Box, { className, children: content });
46954
46993
  }
46955
46994
  const panel = /* @__PURE__ */ jsx(Box, { className: cn("fixed inset-y-0 right-0 w-full max-w-2xl bg-card shadow-lg z-50 overflow-y-auto p-6", className), children: content });
46956
- return typeof document === "undefined" ? panel : createPortal(panel, document.body);
46995
+ return typeof document === "undefined" ? panel : createPortal(panel, getOrCreatePortalRoot());
46957
46996
  };
46958
46997
  DetailPanel.displayName = "DetailPanel";
46959
46998
  }
@@ -53844,24 +53883,6 @@ function UISlotComponentInner({
53844
53883
  }
53845
53884
  );
53846
53885
  }
53847
- function getOrCreatePortalRoot() {
53848
- let root = document.getElementById("ui-slot-portal-root");
53849
- if (!root) {
53850
- root = document.createElement("div");
53851
- root.id = "ui-slot-portal-root";
53852
- root.style.position = "relative";
53853
- root.style.zIndex = "9999";
53854
- document.body.appendChild(root);
53855
- }
53856
- const themed = document.querySelector('[data-theme*="-"]') ?? document.querySelector("[data-theme]");
53857
- if (themed) {
53858
- const theme = themed.getAttribute("data-theme");
53859
- if (theme && root.getAttribute("data-theme") !== theme) {
53860
- root.setAttribute("data-theme", theme);
53861
- }
53862
- }
53863
- return root;
53864
- }
53865
53886
  function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
53866
53887
  const [portalRoot, setPortalRoot] = useState(null);
53867
53888
  const slotsBus = useUISlots();
@@ -54484,6 +54505,7 @@ var init_UISlotRenderer = __esm({
54484
54505
  init_slot_types();
54485
54506
  init_cn();
54486
54507
  init_format();
54508
+ init_portalRoot();
54487
54509
  init_ErrorBoundary();
54488
54510
  init_Skeleton();
54489
54511
  init_renderer();
@@ -1577,6 +1577,36 @@ var init_Typography = __esm({
1577
1577
  Typography.displayName = "Typography";
1578
1578
  }
1579
1579
  });
1580
+
1581
+ // lib/portalRoot.ts
1582
+ function lastThemedElement(selector, portalRoot) {
1583
+ const matches = Array.from(document.querySelectorAll(selector)).filter(
1584
+ (el) => el !== document.documentElement && el !== portalRoot
1585
+ );
1586
+ return matches[matches.length - 1] ?? null;
1587
+ }
1588
+ function getOrCreatePortalRoot() {
1589
+ let root = document.getElementById("ui-slot-portal-root");
1590
+ if (!root) {
1591
+ root = document.createElement("div");
1592
+ root.id = "ui-slot-portal-root";
1593
+ root.style.position = "relative";
1594
+ root.style.zIndex = "9999";
1595
+ document.body.appendChild(root);
1596
+ }
1597
+ const themed = lastThemedElement('[data-theme*="-"]', root) ?? lastThemedElement("[data-theme]", root);
1598
+ if (themed) {
1599
+ const theme = themed.getAttribute("data-theme");
1600
+ if (theme && root.getAttribute("data-theme") !== theme) {
1601
+ root.setAttribute("data-theme", theme);
1602
+ }
1603
+ }
1604
+ return root;
1605
+ }
1606
+ var init_portalRoot = __esm({
1607
+ "lib/portalRoot.ts"() {
1608
+ }
1609
+ });
1580
1610
  function isMotionEnabled() {
1581
1611
  if (typeof document === "undefined") return true;
1582
1612
  if (motionEnabledCache !== null) return motionEnabledCache;
@@ -1657,6 +1687,7 @@ var init_Modal = __esm({
1657
1687
  init_Dialog();
1658
1688
  init_Typography();
1659
1689
  init_cn();
1690
+ init_portalRoot();
1660
1691
  init_useEventBus();
1661
1692
  init_Presence();
1662
1693
  sizeClasses2 = {
@@ -1867,7 +1898,7 @@ var init_Modal = __esm({
1867
1898
  )
1868
1899
  }
1869
1900
  ),
1870
- document.body
1901
+ getOrCreatePortalRoot()
1871
1902
  );
1872
1903
  };
1873
1904
  Modal.displayName = "Modal";
@@ -20503,6 +20534,7 @@ var init_StateMachineView = __esm({
20503
20534
  init_Icon();
20504
20535
  init_useEventBus();
20505
20536
  init_cn();
20537
+ init_portalRoot();
20506
20538
  StateNode2 = ({ state, config }) => {
20507
20539
  const { t } = hooks.useTranslate();
20508
20540
  const size = state.radius * 2;
@@ -21019,7 +21051,7 @@ var init_StateMachineView = __esm({
21019
21051
  )
21020
21052
  }
21021
21053
  ),
21022
- document.body
21054
+ getOrCreatePortalRoot()
21023
21055
  );
21024
21056
  };
21025
21057
  EntityBox = ({ entity, config }) => {
@@ -27660,7 +27692,7 @@ function SubMenu({
27660
27692
  })
27661
27693
  }
27662
27694
  );
27663
- return typeof document !== "undefined" ? reactDom.createPortal(panel, document.body) : panel;
27695
+ return typeof document !== "undefined" ? reactDom.createPortal(panel, getOrCreatePortalRoot()) : panel;
27664
27696
  }
27665
27697
  function MenuItemRow({
27666
27698
  item,
@@ -27747,6 +27779,7 @@ var init_Menu = __esm({
27747
27779
  init_Typography();
27748
27780
  init_Badge();
27749
27781
  init_cn();
27782
+ init_portalRoot();
27750
27783
  init_useEventBus();
27751
27784
  MENU_GAP = 4;
27752
27785
  menuContainerStyles = cn(
@@ -27883,7 +27916,7 @@ var init_Menu = __esm({
27883
27916
  ) : null;
27884
27917
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
27885
27918
  triggerElement,
27886
- panel && typeof document !== "undefined" ? reactDom.createPortal(panel, document.body) : panel
27919
+ panel && typeof document !== "undefined" ? reactDom.createPortal(panel, getOrCreatePortalRoot()) : panel
27887
27920
  ] });
27888
27921
  };
27889
27922
  Menu.displayName = "Menu";
@@ -31267,6 +31300,7 @@ var init_Popover = __esm({
31267
31300
  init_Typography();
31268
31301
  init_Presence();
31269
31302
  init_cn();
31303
+ init_portalRoot();
31270
31304
  init_useTapReveal();
31271
31305
  arrowClasses = {
31272
31306
  top: "top-full left-1/2 -translate-x-1/2 border-t-white border-l-transparent border-r-transparent border-b-transparent",
@@ -31426,7 +31460,7 @@ var init_Popover = __esm({
31426
31460
  ) : null;
31427
31461
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
31428
31462
  triggerElement,
31429
- panel && typeof document !== "undefined" ? reactDom.createPortal(panel, document.body) : panel
31463
+ panel && typeof document !== "undefined" ? reactDom.createPortal(panel, getOrCreatePortalRoot()) : panel
31430
31464
  ] });
31431
31465
  };
31432
31466
  Popover.displayName = "Popover";
@@ -31932,6 +31966,7 @@ var init_Tooltip = __esm({
31932
31966
  "use client";
31933
31967
  init_Typography();
31934
31968
  init_cn();
31969
+ init_portalRoot();
31935
31970
  init_useTapReveal();
31936
31971
  TRIGGER_GAP2 = 8;
31937
31972
  arrowClasses2 = {
@@ -32037,7 +32072,7 @@ var init_Tooltip = __esm({
32037
32072
  ) : null;
32038
32073
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
32039
32074
  trigger,
32040
- typeof window !== "undefined" && tooltipContent ? reactDom.createPortal(tooltipContent, document.body) : tooltipContent
32075
+ typeof window !== "undefined" && tooltipContent ? reactDom.createPortal(tooltipContent, getOrCreatePortalRoot()) : tooltipContent
32041
32076
  ] });
32042
32077
  };
32043
32078
  Tooltip.displayName = "Tooltip";
@@ -43457,6 +43492,7 @@ var init_GraphCanvas = __esm({
43457
43492
  "components/core/molecules/GraphCanvas.tsx"() {
43458
43493
  "use client";
43459
43494
  init_cn();
43495
+ init_portalRoot();
43460
43496
  init_atoms();
43461
43497
  init_Stack();
43462
43498
  init_LoadingState();
@@ -44168,7 +44204,7 @@ var init_GraphCanvas = __esm({
44168
44204
  children: hoveredObj?.label
44169
44205
  }
44170
44206
  ),
44171
- document.body
44207
+ getOrCreatePortalRoot()
44172
44208
  )
44173
44209
  ] }),
44174
44210
  groups.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "md", className: "px-4 py-2 border-t border-border", wrap: true, children: groups.map((group, idx) => /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", align: "center", children: [
@@ -45329,6 +45365,7 @@ var init_DetailPanel = __esm({
45329
45365
  init_ErrorState();
45330
45366
  init_EmptyState();
45331
45367
  init_cn();
45368
+ init_portalRoot();
45332
45369
  init_format();
45333
45370
  init_getNestedValue();
45334
45371
  init_relationLabel();
@@ -45748,7 +45785,7 @@ var init_DetailPanel = __esm({
45748
45785
  return /* @__PURE__ */ jsxRuntime.jsx(Box, { className, children: content });
45749
45786
  }
45750
45787
  const panel = /* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("fixed inset-y-0 right-0 w-full max-w-2xl bg-card shadow-lg z-50 overflow-y-auto p-6", className), children: content });
45751
- return typeof document === "undefined" ? panel : reactDom.createPortal(panel, document.body);
45788
+ return typeof document === "undefined" ? panel : reactDom.createPortal(panel, getOrCreatePortalRoot());
45752
45789
  };
45753
45790
  DetailPanel.displayName = "DetailPanel";
45754
45791
  }
@@ -52639,24 +52676,6 @@ function UISlotComponentInner({
52639
52676
  }
52640
52677
  );
52641
52678
  }
52642
- function getOrCreatePortalRoot() {
52643
- let root = document.getElementById("ui-slot-portal-root");
52644
- if (!root) {
52645
- root = document.createElement("div");
52646
- root.id = "ui-slot-portal-root";
52647
- root.style.position = "relative";
52648
- root.style.zIndex = "9999";
52649
- document.body.appendChild(root);
52650
- }
52651
- const themed = document.querySelector('[data-theme*="-"]') ?? document.querySelector("[data-theme]");
52652
- if (themed) {
52653
- const theme = themed.getAttribute("data-theme");
52654
- if (theme && root.getAttribute("data-theme") !== theme) {
52655
- root.setAttribute("data-theme", theme);
52656
- }
52657
- }
52658
- return root;
52659
- }
52660
52679
  function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
52661
52680
  const [portalRoot, setPortalRoot] = React89.useState(null);
52662
52681
  const slotsBus = context.useUISlots();
@@ -53279,6 +53298,7 @@ var init_UISlotRenderer = __esm({
53279
53298
  init_slot_types();
53280
53299
  init_cn();
53281
53300
  init_format();
53301
+ init_portalRoot();
53282
53302
  init_ErrorBoundary();
53283
53303
  init_Skeleton();
53284
53304
  init_renderer();
@@ -1503,6 +1503,36 @@ var init_Typography = __esm({
1503
1503
  Typography.displayName = "Typography";
1504
1504
  }
1505
1505
  });
1506
+
1507
+ // lib/portalRoot.ts
1508
+ function lastThemedElement(selector, portalRoot) {
1509
+ const matches = Array.from(document.querySelectorAll(selector)).filter(
1510
+ (el) => el !== document.documentElement && el !== portalRoot
1511
+ );
1512
+ return matches[matches.length - 1] ?? null;
1513
+ }
1514
+ function getOrCreatePortalRoot() {
1515
+ let root = document.getElementById("ui-slot-portal-root");
1516
+ if (!root) {
1517
+ root = document.createElement("div");
1518
+ root.id = "ui-slot-portal-root";
1519
+ root.style.position = "relative";
1520
+ root.style.zIndex = "9999";
1521
+ document.body.appendChild(root);
1522
+ }
1523
+ const themed = lastThemedElement('[data-theme*="-"]', root) ?? lastThemedElement("[data-theme]", root);
1524
+ if (themed) {
1525
+ const theme = themed.getAttribute("data-theme");
1526
+ if (theme && root.getAttribute("data-theme") !== theme) {
1527
+ root.setAttribute("data-theme", theme);
1528
+ }
1529
+ }
1530
+ return root;
1531
+ }
1532
+ var init_portalRoot = __esm({
1533
+ "lib/portalRoot.ts"() {
1534
+ }
1535
+ });
1506
1536
  function isMotionEnabled() {
1507
1537
  if (typeof document === "undefined") return true;
1508
1538
  if (motionEnabledCache !== null) return motionEnabledCache;
@@ -1583,6 +1613,7 @@ var init_Modal = __esm({
1583
1613
  init_Dialog();
1584
1614
  init_Typography();
1585
1615
  init_cn();
1616
+ init_portalRoot();
1586
1617
  init_useEventBus();
1587
1618
  init_Presence();
1588
1619
  sizeClasses2 = {
@@ -1793,7 +1824,7 @@ var init_Modal = __esm({
1793
1824
  )
1794
1825
  }
1795
1826
  ),
1796
- document.body
1827
+ getOrCreatePortalRoot()
1797
1828
  );
1798
1829
  };
1799
1830
  Modal.displayName = "Modal";
@@ -20429,6 +20460,7 @@ var init_StateMachineView = __esm({
20429
20460
  init_Icon();
20430
20461
  init_useEventBus();
20431
20462
  init_cn();
20463
+ init_portalRoot();
20432
20464
  StateNode2 = ({ state, config }) => {
20433
20465
  const { t } = useTranslate();
20434
20466
  const size = state.radius * 2;
@@ -20945,7 +20977,7 @@ var init_StateMachineView = __esm({
20945
20977
  )
20946
20978
  }
20947
20979
  ),
20948
- document.body
20980
+ getOrCreatePortalRoot()
20949
20981
  );
20950
20982
  };
20951
20983
  EntityBox = ({ entity, config }) => {
@@ -27586,7 +27618,7 @@ function SubMenu({
27586
27618
  })
27587
27619
  }
27588
27620
  );
27589
- return typeof document !== "undefined" ? createPortal(panel, document.body) : panel;
27621
+ return typeof document !== "undefined" ? createPortal(panel, getOrCreatePortalRoot()) : panel;
27590
27622
  }
27591
27623
  function MenuItemRow({
27592
27624
  item,
@@ -27673,6 +27705,7 @@ var init_Menu = __esm({
27673
27705
  init_Typography();
27674
27706
  init_Badge();
27675
27707
  init_cn();
27708
+ init_portalRoot();
27676
27709
  init_useEventBus();
27677
27710
  MENU_GAP = 4;
27678
27711
  menuContainerStyles = cn(
@@ -27809,7 +27842,7 @@ var init_Menu = __esm({
27809
27842
  ) : null;
27810
27843
  return /* @__PURE__ */ jsxs(Fragment, { children: [
27811
27844
  triggerElement,
27812
- panel && typeof document !== "undefined" ? createPortal(panel, document.body) : panel
27845
+ panel && typeof document !== "undefined" ? createPortal(panel, getOrCreatePortalRoot()) : panel
27813
27846
  ] });
27814
27847
  };
27815
27848
  Menu.displayName = "Menu";
@@ -31193,6 +31226,7 @@ var init_Popover = __esm({
31193
31226
  init_Typography();
31194
31227
  init_Presence();
31195
31228
  init_cn();
31229
+ init_portalRoot();
31196
31230
  init_useTapReveal();
31197
31231
  arrowClasses = {
31198
31232
  top: "top-full left-1/2 -translate-x-1/2 border-t-white border-l-transparent border-r-transparent border-b-transparent",
@@ -31352,7 +31386,7 @@ var init_Popover = __esm({
31352
31386
  ) : null;
31353
31387
  return /* @__PURE__ */ jsxs(Fragment, { children: [
31354
31388
  triggerElement,
31355
- panel && typeof document !== "undefined" ? createPortal(panel, document.body) : panel
31389
+ panel && typeof document !== "undefined" ? createPortal(panel, getOrCreatePortalRoot()) : panel
31356
31390
  ] });
31357
31391
  };
31358
31392
  Popover.displayName = "Popover";
@@ -31858,6 +31892,7 @@ var init_Tooltip = __esm({
31858
31892
  "use client";
31859
31893
  init_Typography();
31860
31894
  init_cn();
31895
+ init_portalRoot();
31861
31896
  init_useTapReveal();
31862
31897
  TRIGGER_GAP2 = 8;
31863
31898
  arrowClasses2 = {
@@ -31963,7 +31998,7 @@ var init_Tooltip = __esm({
31963
31998
  ) : null;
31964
31999
  return /* @__PURE__ */ jsxs(Fragment, { children: [
31965
32000
  trigger,
31966
- typeof window !== "undefined" && tooltipContent ? createPortal(tooltipContent, document.body) : tooltipContent
32001
+ typeof window !== "undefined" && tooltipContent ? createPortal(tooltipContent, getOrCreatePortalRoot()) : tooltipContent
31967
32002
  ] });
31968
32003
  };
31969
32004
  Tooltip.displayName = "Tooltip";
@@ -43383,6 +43418,7 @@ var init_GraphCanvas = __esm({
43383
43418
  "components/core/molecules/GraphCanvas.tsx"() {
43384
43419
  "use client";
43385
43420
  init_cn();
43421
+ init_portalRoot();
43386
43422
  init_atoms();
43387
43423
  init_Stack();
43388
43424
  init_LoadingState();
@@ -44094,7 +44130,7 @@ var init_GraphCanvas = __esm({
44094
44130
  children: hoveredObj?.label
44095
44131
  }
44096
44132
  ),
44097
- document.body
44133
+ getOrCreatePortalRoot()
44098
44134
  )
44099
44135
  ] }),
44100
44136
  groups.length > 1 && /* @__PURE__ */ jsx(HStack, { gap: "md", className: "px-4 py-2 border-t border-border", wrap: true, children: groups.map((group, idx) => /* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
@@ -45255,6 +45291,7 @@ var init_DetailPanel = __esm({
45255
45291
  init_ErrorState();
45256
45292
  init_EmptyState();
45257
45293
  init_cn();
45294
+ init_portalRoot();
45258
45295
  init_format();
45259
45296
  init_getNestedValue();
45260
45297
  init_relationLabel();
@@ -45674,7 +45711,7 @@ var init_DetailPanel = __esm({
45674
45711
  return /* @__PURE__ */ jsx(Box, { className, children: content });
45675
45712
  }
45676
45713
  const panel = /* @__PURE__ */ jsx(Box, { className: cn("fixed inset-y-0 right-0 w-full max-w-2xl bg-card shadow-lg z-50 overflow-y-auto p-6", className), children: content });
45677
- return typeof document === "undefined" ? panel : createPortal(panel, document.body);
45714
+ return typeof document === "undefined" ? panel : createPortal(panel, getOrCreatePortalRoot());
45678
45715
  };
45679
45716
  DetailPanel.displayName = "DetailPanel";
45680
45717
  }
@@ -52565,24 +52602,6 @@ function UISlotComponentInner({
52565
52602
  }
52566
52603
  );
52567
52604
  }
52568
- function getOrCreatePortalRoot() {
52569
- let root = document.getElementById("ui-slot-portal-root");
52570
- if (!root) {
52571
- root = document.createElement("div");
52572
- root.id = "ui-slot-portal-root";
52573
- root.style.position = "relative";
52574
- root.style.zIndex = "9999";
52575
- document.body.appendChild(root);
52576
- }
52577
- const themed = document.querySelector('[data-theme*="-"]') ?? document.querySelector("[data-theme]");
52578
- if (themed) {
52579
- const theme = themed.getAttribute("data-theme");
52580
- if (theme && root.getAttribute("data-theme") !== theme) {
52581
- root.setAttribute("data-theme", theme);
52582
- }
52583
- }
52584
- return root;
52585
- }
52586
52605
  function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
52587
52606
  const [portalRoot, setPortalRoot] = useState(null);
52588
52607
  const slotsBus = useUISlots();
@@ -53205,6 +53224,7 @@ var init_UISlotRenderer = __esm({
53205
53224
  init_slot_types();
53206
53225
  init_cn();
53207
53226
  init_format();
53227
+ init_portalRoot();
53208
53228
  init_ErrorBoundary();
53209
53229
  init_Skeleton();
53210
53230
  init_renderer();