@alixpartners/ui-components 2.6.0 → 2.6.2

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 (100) hide show
  1. package/dist/{RichTextEditor-JH6YBGiw.js → RichTextEditor-xCakhho7.js} +1 -1
  2. package/dist/{ToastProvider-DVycF0zU.js → ToastProvider-D5LImZ-Q.js} +26 -26
  3. package/dist/assets/Dialog.css +1 -1
  4. package/dist/components/Banner/Banner.d.ts +1 -1
  5. package/dist/components/Banner/Banner.test.js +1 -1
  6. package/dist/components/Button/Button.d.ts +1 -1
  7. package/dist/components/Button/Button.test.js +2 -2
  8. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  9. package/dist/components/Checkbox/Checkbox.js +3 -3
  10. package/dist/components/Checkbox/Checkbox.test.js +1 -1
  11. package/dist/components/CorusHeader/CorusHeader.d.ts +1 -1
  12. package/dist/components/CorusHeader/CorusHeader.js +1 -1
  13. package/dist/components/CorusHeader/DropdownItemContent.d.ts +1 -1
  14. package/dist/components/CorusHeader/DropdownItemContent.js +5 -5
  15. package/dist/components/CorusHeader/DropdownMenu.d.ts +1 -1
  16. package/dist/components/CorusHeader/DropdownMenu.js +1 -1
  17. package/dist/components/CorusHeader/MegaMenuContent.d.ts +1 -1
  18. package/dist/components/CorusHeader/MegaMenuContent.js +14 -14
  19. package/dist/components/CorusHeader/UserProfileIcon.d.ts +1 -1
  20. package/dist/components/Creatable/Creatable.d.ts +1 -1
  21. package/dist/components/Creatable/Creatable.js +1 -1
  22. package/dist/components/Datepicker/Datepicker.d.ts +1 -1
  23. package/dist/components/Datepicker/Datepicker.js +1 -1
  24. package/dist/components/Datepicker/Datepicker.test.js +1 -1
  25. package/dist/components/Dialog/Dialog.d.ts +8 -2
  26. package/dist/components/Dialog/Dialog.js +227 -195
  27. package/dist/components/Dialog/Dialog.test.js +227 -202
  28. package/dist/components/DragAndDrop/DragAndDrop.d.ts +1 -1
  29. package/dist/components/DragAndDrop/DragAndDrop.test.js +2 -2
  30. package/dist/components/Dropdown/Dropdown.d.ts +1 -1
  31. package/dist/components/Dropdown/Dropdown.js +1 -1
  32. package/dist/components/FilePicker/FilePicker.d.ts +9 -9
  33. package/dist/components/FilePicker/FilePicker.test.js +2 -2
  34. package/dist/components/Ghost/Ghost.d.ts +1 -1
  35. package/dist/components/Ghost/Ghost.test.js +1 -1
  36. package/dist/components/Icon/Icon.d.ts +1 -1
  37. package/dist/components/Icons/IconsGallery.d.ts +1 -1
  38. package/dist/components/Illustration/Illustration.d.ts +1 -1
  39. package/dist/components/Illustration/Illustration.test.js +1 -1
  40. package/dist/components/Input/Input.test.js +1 -1
  41. package/dist/components/Logo/Logo.d.ts +1 -1
  42. package/dist/components/Logos/LogosGallery.d.ts +1 -1
  43. package/dist/components/NavBar/NavBar.d.ts +1 -1
  44. package/dist/components/NavBar/NavBar.js +1 -1
  45. package/dist/components/Radio/Radio.d.ts +1 -1
  46. package/dist/components/Radio/Radio.js +9 -9
  47. package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
  48. package/dist/components/RadioGroup/RadioGroup.js +11 -11
  49. package/dist/components/RadioGroup/RadioGroup.test.js +1 -1
  50. package/dist/components/RichTextEditor/RichTextEditor.d.ts +1 -1
  51. package/dist/components/RichTextEditor/RichTextEditor.js +2 -2
  52. package/dist/components/RichTextEditor/RichTextEditor.test.js +2 -2
  53. package/dist/components/Search/Search.d.ts +1 -1
  54. package/dist/components/Search/Search.test.js +1 -1
  55. package/dist/components/Spinner/Spinner.d.ts +1 -1
  56. package/dist/components/SplitButton/SplitButton.d.ts +1 -1
  57. package/dist/components/SplitButton/SplitButton.js +3 -3
  58. package/dist/components/SplitButton/SplitButton.test.js +1 -1
  59. package/dist/components/Tab/Tab.d.ts +1 -1
  60. package/dist/components/TabNavigation/TabNavigation.d.ts +1 -1
  61. package/dist/components/Tag/Tag.d.ts +1 -1
  62. package/dist/components/Tag/Tag.test.js +1 -1
  63. package/dist/components/TagsFields/TagsFields.d.ts +1 -1
  64. package/dist/components/TagsFields/TagsFields.js +1 -1
  65. package/dist/components/Textarea/Textarea.d.ts +1 -1
  66. package/dist/components/Textarea/Textarea.test.js +1 -1
  67. package/dist/components/Toast/Toast.test.js +1 -1
  68. package/dist/components/ToastProvider/ToastProvider.d.ts +1 -2
  69. package/dist/components/ToastProvider/ToastProvider.js +1 -1
  70. package/dist/components/ToastProvider/ToastProvider.test.js +4 -4
  71. package/dist/components/Toggle/Toggle.d.ts +1 -1
  72. package/dist/components/Toggle/Toggle.js +126 -211
  73. package/dist/components/Toggle/Toggle.test.js +1 -1
  74. package/dist/components/Tooltip/Tooltip.d.ts +1 -1
  75. package/dist/components/Tooltip/Tooltip.js +61 -60
  76. package/dist/{index-6DGSlWJb.js → index-C2s_VtSb.js} +3 -3
  77. package/dist/index-C8H9A55g.js +222 -0
  78. package/dist/{index-CcsZYEYy.js → index-CCFDXH-J.js} +28 -29
  79. package/dist/index-CCnm5-ML.js +230 -0
  80. package/dist/{index-BVZdJVFB.js → index-CFqDEbIR.js} +191 -192
  81. package/dist/index-CfIcUHKK.js +70 -0
  82. package/dist/index-ChQc_Cm6.js +1544 -0
  83. package/dist/index-CmGGeUr0.js +142 -0
  84. package/dist/{index-IR8HlW5P.js → index-D_L0ncPJ.js} +4 -4
  85. package/dist/{index-banDzeKa.js → index-DkTDHhag.js} +1 -1
  86. package/dist/index-Ii4UOx3H.js +599 -0
  87. package/dist/{index-6j3vTf--.js → index-Nyh2Wa71.js} +5 -5
  88. package/dist/index-z_kiwVc3.js +237 -0
  89. package/dist/main.js +3 -3
  90. package/dist/storybook-docs-page.d.ts +1 -1
  91. package/dist/{useToast-CpwrYPvx.js → useToast-Cz5MGKnw.js} +1 -1
  92. package/dist/{vi.bdSIJ99Y-DWCVXj6K.js → vi.bdSIJ99Y-017e_Pkz.js} +3 -3
  93. package/package.json +1 -1
  94. package/dist/index-B4szHVNJ.js +0 -248
  95. package/dist/index-Bq1FiX6B.js +0 -93
  96. package/dist/index-CE9NpYQR.js +0 -604
  97. package/dist/index-CHy8gqvu.js +0 -353
  98. package/dist/index-CarlZuEo.js +0 -1610
  99. package/dist/index-DH9SO8qV.js +0 -221
  100. package/dist/index-kgC_DL6e.js +0 -216
@@ -1,221 +0,0 @@
1
- import * as o from "react";
2
- import { b as G, a as N, e as O, P as L, c as w, u as z } from "./index-B4szHVNJ.js";
3
- import { jsx as m } from "react/jsx-runtime";
4
- import { u as $, a as J } from "./index-6DGSlWJb.js";
5
- function Q(e) {
6
- const n = e + "CollectionProvider", [u, c] = G(n), [A, v] = u(
7
- n,
8
- { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
9
- ), I = (f) => {
10
- const { scope: t, children: i } = f, d = o.useRef(null), r = o.useRef(/* @__PURE__ */ new Map()).current;
11
- return /* @__PURE__ */ m(A, { scope: t, itemMap: r, collectionRef: d, children: i });
12
- };
13
- I.displayName = n;
14
- const C = e + "CollectionSlot", _ = O(C), p = o.forwardRef(
15
- (f, t) => {
16
- const { scope: i, children: d } = f, r = v(C, i), s = N(t, r.collectionRef);
17
- return /* @__PURE__ */ m(_, { ref: s, children: d });
18
- }
19
- );
20
- p.displayName = C;
21
- const a = e + "CollectionItemSlot", R = "data-radix-collection-item", g = O(a), b = o.forwardRef(
22
- (f, t) => {
23
- const { scope: i, children: d, ...r } = f, s = o.useRef(null), E = N(t, s), T = v(a, i);
24
- return o.useEffect(() => (T.itemMap.set(s, { ref: s, ...r }), () => void T.itemMap.delete(s))), /* @__PURE__ */ m(g, { [R]: "", ref: E, children: d });
25
- }
26
- );
27
- b.displayName = a;
28
- function F(f) {
29
- const t = v(e + "CollectionConsumer", f);
30
- return o.useCallback(() => {
31
- const d = t.collectionRef.current;
32
- if (!d) return [];
33
- const r = Array.from(d.querySelectorAll(`[${R}]`));
34
- return Array.from(t.itemMap.values()).sort(
35
- (T, x) => r.indexOf(T.ref.current) - r.indexOf(x.ref.current)
36
- );
37
- }, [t.collectionRef, t.itemMap]);
38
- }
39
- return [
40
- { Provider: I, Slot: p, ItemSlot: b },
41
- F,
42
- c
43
- ];
44
- }
45
- var W = o.createContext(void 0);
46
- function X(e) {
47
- const n = o.useContext(W);
48
- return e || n || "ltr";
49
- }
50
- var M = "rovingFocusGroup.onEntryFocus", Z = { bubbles: !1, cancelable: !0 }, h = "RovingFocusGroup", [P, K, ee] = Q(h), [te, me] = G(
51
- h,
52
- [ee]
53
- ), [oe, ne] = te(h), k = o.forwardRef(
54
- (e, n) => /* @__PURE__ */ m(P.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ m(P.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ m(re, { ...e, ref: n }) }) })
55
- );
56
- k.displayName = h;
57
- var re = o.forwardRef((e, n) => {
58
- const {
59
- __scopeRovingFocusGroup: u,
60
- orientation: c,
61
- loop: A = !1,
62
- dir: v,
63
- currentTabStopId: I,
64
- defaultCurrentTabStopId: C,
65
- onCurrentTabStopIdChange: _,
66
- onEntryFocus: p,
67
- preventScrollOnEntryFocus: a = !1,
68
- ...R
69
- } = e, g = o.useRef(null), b = N(n, g), F = X(v), [f, t] = z({
70
- prop: I,
71
- defaultProp: C ?? null,
72
- onChange: _,
73
- caller: h
74
- }), [i, d] = o.useState(!1), r = J(p), s = K(u), E = o.useRef(!1), [T, x] = o.useState(0);
75
- return o.useEffect(() => {
76
- const l = g.current;
77
- if (l)
78
- return l.addEventListener(M, r), () => l.removeEventListener(M, r);
79
- }, [r]), /* @__PURE__ */ m(
80
- oe,
81
- {
82
- scope: u,
83
- orientation: c,
84
- dir: F,
85
- loop: A,
86
- currentTabStopId: f,
87
- onItemFocus: o.useCallback(
88
- (l) => t(l),
89
- [t]
90
- ),
91
- onItemShiftTab: o.useCallback(() => d(!0), []),
92
- onFocusableItemAdd: o.useCallback(
93
- () => x((l) => l + 1),
94
- []
95
- ),
96
- onFocusableItemRemove: o.useCallback(
97
- () => x((l) => l - 1),
98
- []
99
- ),
100
- children: /* @__PURE__ */ m(
101
- L.div,
102
- {
103
- tabIndex: i || T === 0 ? -1 : 0,
104
- "data-orientation": c,
105
- ...R,
106
- ref: b,
107
- style: { outline: "none", ...e.style },
108
- onMouseDown: w(e.onMouseDown, () => {
109
- E.current = !0;
110
- }),
111
- onFocus: w(e.onFocus, (l) => {
112
- const Y = !E.current;
113
- if (l.target === l.currentTarget && Y && !i) {
114
- const D = new CustomEvent(M, Z);
115
- if (l.currentTarget.dispatchEvent(D), !D.defaultPrevented) {
116
- const y = s().filter((S) => S.focusable), H = y.find((S) => S.active), j = y.find((S) => S.id === f), q = [H, j, ...y].filter(
117
- Boolean
118
- ).map((S) => S.ref.current);
119
- V(q, a);
120
- }
121
- }
122
- E.current = !1;
123
- }),
124
- onBlur: w(e.onBlur, () => d(!1))
125
- }
126
- )
127
- }
128
- );
129
- }), U = "RovingFocusGroupItem", B = o.forwardRef(
130
- (e, n) => {
131
- const {
132
- __scopeRovingFocusGroup: u,
133
- focusable: c = !0,
134
- active: A = !1,
135
- tabStopId: v,
136
- children: I,
137
- ...C
138
- } = e, _ = $(), p = v || _, a = ne(U, u), R = a.currentTabStopId === p, g = K(u), { onFocusableItemAdd: b, onFocusableItemRemove: F, currentTabStopId: f } = a;
139
- return o.useEffect(() => {
140
- if (c)
141
- return b(), () => F();
142
- }, [c, b, F]), /* @__PURE__ */ m(
143
- P.ItemSlot,
144
- {
145
- scope: u,
146
- id: p,
147
- focusable: c,
148
- active: A,
149
- children: /* @__PURE__ */ m(
150
- L.span,
151
- {
152
- tabIndex: R ? 0 : -1,
153
- "data-orientation": a.orientation,
154
- ...C,
155
- ref: n,
156
- onMouseDown: w(e.onMouseDown, (t) => {
157
- c ? a.onItemFocus(p) : t.preventDefault();
158
- }),
159
- onFocus: w(e.onFocus, () => a.onItemFocus(p)),
160
- onKeyDown: w(e.onKeyDown, (t) => {
161
- if (t.key === "Tab" && t.shiftKey) {
162
- a.onItemShiftTab();
163
- return;
164
- }
165
- if (t.target !== t.currentTarget) return;
166
- const i = ae(t, a.orientation, a.dir);
167
- if (i !== void 0) {
168
- if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey) return;
169
- t.preventDefault();
170
- let r = g().filter((s) => s.focusable).map((s) => s.ref.current);
171
- if (i === "last") r.reverse();
172
- else if (i === "prev" || i === "next") {
173
- i === "prev" && r.reverse();
174
- const s = r.indexOf(t.currentTarget);
175
- r = a.loop ? ie(r, s + 1) : r.slice(s + 1);
176
- }
177
- setTimeout(() => V(r));
178
- }
179
- }),
180
- children: typeof I == "function" ? I({ isCurrentTabStop: R, hasTabStop: f != null }) : I
181
- }
182
- )
183
- }
184
- );
185
- }
186
- );
187
- B.displayName = U;
188
- var ce = {
189
- ArrowLeft: "prev",
190
- ArrowUp: "prev",
191
- ArrowRight: "next",
192
- ArrowDown: "next",
193
- PageUp: "first",
194
- Home: "first",
195
- PageDown: "last",
196
- End: "last"
197
- };
198
- function se(e, n) {
199
- return n !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
200
- }
201
- function ae(e, n, u) {
202
- const c = se(e.key, u);
203
- if (!(n === "vertical" && ["ArrowLeft", "ArrowRight"].includes(c)) && !(n === "horizontal" && ["ArrowUp", "ArrowDown"].includes(c)))
204
- return ce[c];
205
- }
206
- function V(e, n = !1) {
207
- const u = document.activeElement;
208
- for (const c of e)
209
- if (c === u || (c.focus({ preventScroll: n }), document.activeElement !== u)) return;
210
- }
211
- function ie(e, n) {
212
- return e.map((u, c) => e[(n + c) % e.length]);
213
- }
214
- var pe = k, Ie = B;
215
- export {
216
- Ie as I,
217
- pe as R,
218
- Q as a,
219
- me as c,
220
- X as u
221
- };
@@ -1,216 +0,0 @@
1
- import * as t from "react";
2
- import { a as F, P as g, c as C, f as U, d as z } from "./index-B4szHVNJ.js";
3
- import { a as I } from "./index-6DGSlWJb.js";
4
- import { jsx as T } from "react/jsx-runtime";
5
- import * as H from "react-dom";
6
- function K(n, r = globalThis == null ? void 0 : globalThis.document) {
7
- const e = I(n);
8
- t.useEffect(() => {
9
- const o = (i) => {
10
- i.key === "Escape" && e(i);
11
- };
12
- return r.addEventListener("keydown", o, { capture: !0 }), () => r.removeEventListener("keydown", o, { capture: !0 });
13
- }, [e, r]);
14
- }
15
- var j = "DismissableLayer", S = "dismissableLayer.update", X = "dismissableLayer.pointerDownOutside", Y = "dismissableLayer.focusOutside", A, N = t.createContext({
16
- layers: /* @__PURE__ */ new Set(),
17
- layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
18
- branches: /* @__PURE__ */ new Set(),
19
- // Outside elements that belong to a layer's own dismiss affordance (eg, a
20
- // dialog overlay). Pressing them should dismiss the layer regardless of
21
- // whether or not they stop propagation.
22
- //
23
- // See https://github.com/radix-ui/primitives/issues/3346
24
- dismissableSurfaces: /* @__PURE__ */ new Set()
25
- }), q = t.forwardRef(
26
- (n, r) => {
27
- const {
28
- disableOutsidePointerEvents: e = !1,
29
- deferPointerDownOutside: o = !1,
30
- onEscapeKeyDown: i,
31
- onPointerDownOutside: a,
32
- onFocusOutside: v,
33
- onInteractOutside: f,
34
- onDismiss: l,
35
- ...b
36
- } = n, s = t.useContext(N), [d, L] = t.useState(null), E = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, D] = t.useState({}), P = F(r, (u) => L(u)), y = Array.from(s.layers), [O] = [...s.layersWithOutsidePointerEventsDisabled].slice(-1), c = y.indexOf(O), m = d ? y.indexOf(d) : -1, w = s.layersWithOutsidePointerEventsDisabled.size > 0, p = m >= c, B = t.useRef(!1), M = Q(
37
- (u) => {
38
- const h = u.target;
39
- if (!(h instanceof Node))
40
- return;
41
- const k = [...s.branches].some(
42
- (R) => R.contains(h)
43
- );
44
- !p || k || (a == null || a(u), f == null || f(u), u.defaultPrevented || l == null || l());
45
- },
46
- {
47
- ownerDocument: E,
48
- deferPointerDownOutside: o,
49
- isDeferredPointerDownOutsideRef: B,
50
- dismissableSurfaces: s.dismissableSurfaces
51
- }
52
- ), x = V((u) => {
53
- if (o && B.current)
54
- return;
55
- const h = u.target;
56
- [...s.branches].some((R) => R.contains(h)) || (v == null || v(u), f == null || f(u), u.defaultPrevented || l == null || l());
57
- }, E);
58
- return K((u) => {
59
- m === s.layers.size - 1 && (i == null || i(u), !u.defaultPrevented && l && (u.preventDefault(), l()));
60
- }, E), t.useEffect(() => {
61
- if (d)
62
- return e && (s.layersWithOutsidePointerEventsDisabled.size === 0 && (A = E.body.style.pointerEvents, E.body.style.pointerEvents = "none"), s.layersWithOutsidePointerEventsDisabled.add(d)), s.layers.add(d), W(), () => {
63
- e && (s.layersWithOutsidePointerEventsDisabled.delete(d), s.layersWithOutsidePointerEventsDisabled.size === 0 && (E.body.style.pointerEvents = A));
64
- };
65
- }, [d, E, e, s]), t.useEffect(() => () => {
66
- d && (s.layers.delete(d), s.layersWithOutsidePointerEventsDisabled.delete(d), W());
67
- }, [d, s]), t.useEffect(() => {
68
- const u = () => D({});
69
- return document.addEventListener(S, u), () => document.removeEventListener(S, u);
70
- }, []), /* @__PURE__ */ T(
71
- g.div,
72
- {
73
- ...b,
74
- ref: P,
75
- style: {
76
- pointerEvents: w ? p ? "auto" : "none" : void 0,
77
- ...n.style
78
- },
79
- onFocusCapture: C(n.onFocusCapture, x.onFocusCapture),
80
- onBlurCapture: C(n.onBlurCapture, x.onBlurCapture),
81
- onPointerDownCapture: C(
82
- n.onPointerDownCapture,
83
- M.onPointerDownCapture
84
- )
85
- }
86
- );
87
- }
88
- );
89
- q.displayName = j;
90
- var G = "DismissableLayerBranch", J = t.forwardRef((n, r) => {
91
- const e = t.useContext(N), o = t.useRef(null), i = F(r, o);
92
- return t.useEffect(() => {
93
- const a = o.current;
94
- if (a)
95
- return e.branches.add(a), () => {
96
- e.branches.delete(a);
97
- };
98
- }, [e.branches]), /* @__PURE__ */ T(g.div, { ...n, ref: i });
99
- });
100
- J.displayName = G;
101
- function se() {
102
- const n = t.useContext(N), [r, e] = t.useState(null);
103
- return t.useEffect(() => {
104
- if (r)
105
- return n.dismissableSurfaces.add(r), () => {
106
- n.dismissableSurfaces.delete(r);
107
- };
108
- }, [r, n.dismissableSurfaces]), e;
109
- }
110
- function Q(n, r) {
111
- const {
112
- ownerDocument: e = globalThis == null ? void 0 : globalThis.document,
113
- deferPointerDownOutside: o = !1,
114
- isDeferredPointerDownOutsideRef: i,
115
- dismissableSurfaces: a
116
- } = r, v = I(n), f = t.useRef(!1), l = t.useRef(!1), b = t.useRef(/* @__PURE__ */ new Map()), s = t.useRef(() => {
117
- });
118
- return t.useEffect(() => {
119
- function d() {
120
- l.current = !1, i.current = !1, b.current.clear();
121
- }
122
- function L() {
123
- return Array.from(b.current.values()).some(Boolean);
124
- }
125
- function E(c) {
126
- if (!l.current)
127
- return;
128
- const m = c.target;
129
- m instanceof Node && [...a].some((p) => p.contains(m)) || b.current.set(c.type, !0), c.type === "click" && window.setTimeout(() => {
130
- l.current && s.current();
131
- }, 0);
132
- }
133
- function D(c) {
134
- l.current && b.current.set(c.type, !1);
135
- }
136
- const P = (c) => {
137
- if (c.target && !f.current) {
138
- let m = function() {
139
- e.removeEventListener("click", s.current);
140
- const p = L();
141
- d(), p || _(
142
- X,
143
- v,
144
- w,
145
- { discrete: !0 }
146
- );
147
- };
148
- const w = { originalEvent: c };
149
- l.current = !0, i.current = o && c.button === 0, b.current.clear(), !o || c.button !== 0 ? m() : (e.removeEventListener("click", s.current), s.current = m, e.addEventListener("click", s.current, { once: !0 }));
150
- } else
151
- e.removeEventListener("click", s.current), d();
152
- f.current = !1;
153
- }, y = [
154
- "pointerup",
155
- "mousedown",
156
- "mouseup",
157
- "touchstart",
158
- "touchend",
159
- "click"
160
- ];
161
- for (const c of y)
162
- e.addEventListener(c, E, !0), e.addEventListener(c, D);
163
- const O = window.setTimeout(() => {
164
- e.addEventListener("pointerdown", P);
165
- }, 0);
166
- return () => {
167
- window.clearTimeout(O), e.removeEventListener("pointerdown", P), e.removeEventListener("click", s.current);
168
- for (const c of y)
169
- e.removeEventListener(c, E, !0), e.removeEventListener(c, D);
170
- };
171
- }, [
172
- e,
173
- v,
174
- o,
175
- i,
176
- a
177
- ]), {
178
- // ensures we check React component tree (not just DOM tree)
179
- onPointerDownCapture: () => f.current = !0
180
- };
181
- }
182
- function V(n, r = globalThis == null ? void 0 : globalThis.document) {
183
- const e = I(n), o = t.useRef(!1);
184
- return t.useEffect(() => {
185
- const i = (a) => {
186
- a.target && !o.current && _(Y, e, { originalEvent: a }, {
187
- discrete: !1
188
- });
189
- };
190
- return r.addEventListener("focusin", i), () => r.removeEventListener("focusin", i);
191
- }, [r, e]), {
192
- onFocusCapture: () => o.current = !0,
193
- onBlurCapture: () => o.current = !1
194
- };
195
- }
196
- function W() {
197
- const n = new CustomEvent(S);
198
- document.dispatchEvent(n);
199
- }
200
- function _(n, r, e, { discrete: o }) {
201
- const i = e.originalEvent.target, a = new CustomEvent(n, { bubbles: !1, cancelable: !0, detail: e });
202
- r && i.addEventListener(n, r, { once: !0 }), o ? U(i, a) : i.dispatchEvent(a);
203
- }
204
- var Z = "Portal", $ = t.forwardRef((n, r) => {
205
- var f;
206
- const { container: e, ...o } = n, [i, a] = t.useState(!1);
207
- z(() => a(!0), []);
208
- const v = e || i && ((f = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : f.body);
209
- return v ? H.createPortal(/* @__PURE__ */ T(g.div, { ...o, ref: r }), v) : null;
210
- });
211
- $.displayName = Z;
212
- export {
213
- q as D,
214
- $ as P,
215
- se as u
216
- };