se-design 1.0.73-dev3 → 1.0.73-dev6
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.
- package/dist/components/CustomModal/index.d.ts +4 -6
- package/dist/components/MenuList/index.d.ts +3 -2
- package/dist/components/Popover/index.d.ts +2 -2
- package/dist/index12.js +30 -18
- package/dist/index12.js.map +1 -1
- package/dist/index15.js +1 -1
- package/dist/index17.js +36 -33
- package/dist/index17.js.map +1 -1
- package/dist/index18.js +129 -124
- package/dist/index18.js.map +1 -1
- package/dist/index192.js +2 -2
- package/dist/{index229.js → index193.js} +1 -1
- package/dist/{index229.js.map → index193.js.map} +1 -1
- package/dist/index194.js +26 -0
- package/dist/index194.js.map +1 -0
- package/dist/index197.js +20 -80
- package/dist/index197.js.map +1 -1
- package/dist/index199.js +82 -21
- package/dist/index199.js.map +1 -1
- package/dist/{index207.js → index208.js} +1 -1
- package/dist/{index207.js.map → index208.js.map} +1 -1
- package/dist/{index215.js → index216.js} +1 -1
- package/dist/{index215.js.map → index216.js.map} +1 -1
- package/dist/{index218.js → index219.js} +1 -1
- package/dist/{index218.js.map → index219.js.map} +1 -1
- package/dist/{index227.js → index228.js} +1 -1
- package/dist/{index227.js.map → index228.js.map} +1 -1
- package/dist/index24.js +1 -1
- package/dist/index27.js +1 -1
- package/dist/index28.js +94 -90
- package/dist/index28.js.map +1 -1
- package/dist/index32.js +42 -44
- package/dist/index32.js.map +1 -1
- package/dist/index37.js +1 -1
- package/dist/index39.js +1 -1
- package/dist/index44.js +1 -1
- package/dist/index45.js +2 -2
- package/dist/index48.js +1 -1
- package/dist/index52.js +1 -1
- package/dist/index62.js +1 -1
- package/dist/index64.js +52 -60
- package/dist/index64.js.map +1 -1
- package/package.json +1 -1
- package/dist/index195.js +0 -27
- package/dist/index195.js.map +0 -1
package/dist/index18.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { getA11yNameAttributes as
|
|
4
|
-
import { useDismissOnFocusOut as
|
|
1
|
+
import B, { forwardRef as ae, useState as F, useRef as J, useEffect as H, useImperativeHandle as le } from "react";
|
|
2
|
+
import fe from "react-dom";
|
|
3
|
+
import { getA11yNameAttributes as ue } from "./index71.js";
|
|
4
|
+
import { useDismissOnFocusOut as pe } from "./index197.js";
|
|
5
5
|
function O() {
|
|
6
6
|
return O = Object.assign ? Object.assign.bind() : function(y) {
|
|
7
7
|
for (var k = 1; k < arguments.length; k++) {
|
|
@@ -11,7 +11,7 @@ function O() {
|
|
|
11
11
|
return y;
|
|
12
12
|
}, O.apply(null, arguments);
|
|
13
13
|
}
|
|
14
|
-
const
|
|
14
|
+
const R = ['[role="menuitem"]', '[role="option"]', '[role="menuitemcheckbox"]', '[role="menuitemradio"]', "button:not([disabled])", "a[href]", '[tabindex]:not([tabindex="-1"])'].join(", "), we = /* @__PURE__ */ ae(({
|
|
15
15
|
className: y = "",
|
|
16
16
|
automationId: k = "",
|
|
17
17
|
position: p = "bottom-center",
|
|
@@ -19,8 +19,8 @@ const B = ['[role="menuitem"]', '[role="option"]', '[role="menuitemcheckbox"]',
|
|
|
19
19
|
contentWidth: I = "max",
|
|
20
20
|
renderPopoverContents: N,
|
|
21
21
|
renderPopoverSrcElement: Q,
|
|
22
|
-
onPopoverToggle:
|
|
23
|
-
isPopoverOpen:
|
|
22
|
+
onPopoverToggle: q,
|
|
23
|
+
isPopoverOpen: K,
|
|
24
24
|
disabled: P = !1,
|
|
25
25
|
isWithPortal: d = !1,
|
|
26
26
|
ariaLabel: W,
|
|
@@ -35,151 +35,156 @@ const B = ['[role="menuitem"]', '[role="option"]', '[role="menuitemcheckbox"]',
|
|
|
35
35
|
disableClickToggle: b = !1,
|
|
36
36
|
noBorder: Z = !1,
|
|
37
37
|
disableAutoClose: m = !1,
|
|
38
|
-
...
|
|
39
|
-
},
|
|
40
|
-
const [
|
|
38
|
+
...ee
|
|
39
|
+
}, te) => {
|
|
40
|
+
const [i, f] = F(!1), [g, $] = F(p), [oe, j] = F(!1), l = J(null), c = J(null), ne = ue({
|
|
41
41
|
ariaLabel: W,
|
|
42
42
|
ariaLabelledBy: Y,
|
|
43
43
|
ariaDescribedBy: void 0
|
|
44
44
|
// Popover doesn't support describedBy yet
|
|
45
45
|
}), {
|
|
46
|
-
onBlurCapture:
|
|
47
|
-
} =
|
|
48
|
-
disabled: !
|
|
46
|
+
onBlurCapture: re
|
|
47
|
+
} = pe({
|
|
48
|
+
disabled: !i || m || d,
|
|
49
49
|
onFocusOut: () => f(!1),
|
|
50
50
|
closeOnEscape: !1
|
|
51
|
-
}), [M, E] =
|
|
51
|
+
}), [M, E] = F({
|
|
52
52
|
top: 0,
|
|
53
53
|
left: 0
|
|
54
|
-
}), x = (
|
|
54
|
+
}), x = (e = "bottom-center") => {
|
|
55
55
|
if (!l.current) return {
|
|
56
56
|
top: 0,
|
|
57
57
|
left: 0
|
|
58
58
|
};
|
|
59
|
-
let o =
|
|
60
|
-
const
|
|
61
|
-
let
|
|
59
|
+
let o = e;
|
|
60
|
+
const t = l.current.getBoundingClientRect(), n = window.innerWidth, a = window.innerHeight;
|
|
61
|
+
let r = 0, s = 0;
|
|
62
62
|
switch (o) {
|
|
63
63
|
case "bottom-left":
|
|
64
|
-
|
|
64
|
+
r = t.bottom, s = t.left;
|
|
65
65
|
break;
|
|
66
66
|
case "bottom-right":
|
|
67
|
-
|
|
67
|
+
r = t.bottom, s = t.right - t.width * 0.5;
|
|
68
68
|
break;
|
|
69
69
|
case "bottom-center":
|
|
70
|
-
|
|
70
|
+
r = t.bottom, s = t.left + t.width / 2;
|
|
71
71
|
break;
|
|
72
72
|
case "top-left":
|
|
73
|
-
|
|
73
|
+
r = t.top - t.height * 1.9, s = t.left;
|
|
74
74
|
break;
|
|
75
75
|
case "top-right":
|
|
76
|
-
|
|
76
|
+
r = t.top - t.height * 1.9, s = t.right - t.width * 0.5;
|
|
77
77
|
break;
|
|
78
78
|
case "top-center":
|
|
79
|
-
|
|
79
|
+
r = t.top - t.height * 1.9, s = t.left + t.width / 2;
|
|
80
80
|
break;
|
|
81
81
|
default:
|
|
82
|
-
|
|
82
|
+
r = t.bottom, s = t.left;
|
|
83
83
|
break;
|
|
84
84
|
}
|
|
85
85
|
const u = c.current?.getBoundingClientRect(), w = u?.width || 0, v = u?.height || 0;
|
|
86
|
-
if ((o === "bottom-center" || o === "top-center") && (
|
|
87
|
-
const D =
|
|
88
|
-
D >= v || D >
|
|
86
|
+
if ((o === "bottom-center" || o === "top-center") && (s = s - w / 2), s + w > n && (s = Math.max(0, n - w)), s < 0 && (s = 0), r + v > a) {
|
|
87
|
+
const D = t.top, ce = a - t.bottom;
|
|
88
|
+
D >= v || D > ce ? (r = t.top - v, r < 0 && (r = 0)) : r = Math.max(0, a - v);
|
|
89
89
|
}
|
|
90
|
-
return
|
|
91
|
-
top:
|
|
92
|
-
left:
|
|
90
|
+
return r < 0 && (r = t.bottom, r + v > a && (r = Math.max(0, a - v))), {
|
|
91
|
+
top: r,
|
|
92
|
+
left: s
|
|
93
93
|
};
|
|
94
94
|
};
|
|
95
95
|
H(() => {
|
|
96
|
-
if (
|
|
97
|
-
return m || document.body.addEventListener("click", V, !0),
|
|
96
|
+
if (q && q(i), i && !d)
|
|
97
|
+
return m || document.body.addEventListener("click", V, !0), se(), () => {
|
|
98
98
|
m || document.body.removeEventListener("click", V, !0);
|
|
99
99
|
};
|
|
100
|
-
if (
|
|
101
|
-
m ? window.addEventListener("scroll", U) : (document.body.addEventListener("click",
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
-
|
|
100
|
+
if (i && d) {
|
|
101
|
+
m ? window.addEventListener("scroll", U) : (document.body.addEventListener("click", L, !0), window.addEventListener("scroll", L)), window.addEventListener("resize", T);
|
|
102
|
+
const e = setTimeout(() => {
|
|
103
|
+
const t = x(g);
|
|
104
|
+
S(), t && E(t);
|
|
105
105
|
}, 0), o = setTimeout(() => {
|
|
106
|
-
const
|
|
107
|
-
|
|
106
|
+
const t = x(g);
|
|
107
|
+
t && E(t);
|
|
108
108
|
}, 10);
|
|
109
109
|
return () => {
|
|
110
|
-
m ? window.removeEventListener("scroll", U) : (document.body.removeEventListener("click",
|
|
110
|
+
m ? window.removeEventListener("scroll", U) : (document.body.removeEventListener("click", L, !0), window.removeEventListener("scroll", L)), window.removeEventListener("resize", T), clearTimeout(e), clearTimeout(o);
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
|
-
}, [
|
|
114
|
-
const
|
|
113
|
+
}, [i, d, m]);
|
|
114
|
+
const S = () => {
|
|
115
115
|
if (!l.current) {
|
|
116
116
|
j(!1);
|
|
117
117
|
return;
|
|
118
118
|
}
|
|
119
|
-
const
|
|
120
|
-
j(
|
|
119
|
+
const e = l.current.getBoundingClientRect(), o = window.innerHeight, t = window.innerWidth, n = e.top < o && e.bottom > 0 && e.left < t && e.right > 0;
|
|
120
|
+
j(n);
|
|
121
121
|
};
|
|
122
122
|
H(() => {
|
|
123
|
-
f(
|
|
124
|
-
}, [
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
|
|
123
|
+
f(K ?? !1);
|
|
124
|
+
}, [K]), H(() => {
|
|
125
|
+
i && c.current && setTimeout(() => {
|
|
126
|
+
const e = c.current?.querySelector(R);
|
|
127
|
+
e && document.activeElement === l.current && e.focus();
|
|
128
128
|
}, 0);
|
|
129
|
-
}, [
|
|
130
|
-
const
|
|
129
|
+
}, [i]);
|
|
130
|
+
const se = () => {
|
|
131
131
|
if (!c.current) return;
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
}, V = (
|
|
132
|
+
const e = c.current.getBoundingClientRect(), o = window.innerHeight;
|
|
133
|
+
e?.bottom > o ? $(p.includes("left") ? "top-left" : p.includes("right") ? "top-right" : "top-center") : e?.top < 0 && $(p.includes("left") ? "bottom-left" : p.includes("right") ? "bottom-right" : "bottom-center");
|
|
134
|
+
}, V = (e) => {
|
|
135
135
|
const o = l.current;
|
|
136
136
|
if (!o) return;
|
|
137
|
-
const
|
|
138
|
-
m || (!
|
|
139
|
-
},
|
|
140
|
-
const o = l.current,
|
|
137
|
+
const t = e.target, n = o.contains(t), a = c.current?.contains(t), s = t.closest?.(".se-design-popover-wrapper"), u = s && s !== o, w = c.current?.contains(s);
|
|
138
|
+
m || (!n && !a || u && !w) && f(!1);
|
|
139
|
+
}, L = (e) => {
|
|
140
|
+
const o = l.current, t = c.current;
|
|
141
141
|
if (!o) return;
|
|
142
|
-
if (
|
|
142
|
+
if (S(), e.type === "scroll" && i) {
|
|
143
143
|
const D = x(g);
|
|
144
144
|
D && E(D);
|
|
145
145
|
}
|
|
146
|
-
const
|
|
147
|
-
m || (!a && !
|
|
146
|
+
const n = e.target, a = o.contains(n), r = t?.contains(n), u = n.closest?.(".se-design-popover-wrapper"), w = u && u !== o, v = c.current?.contains(u);
|
|
147
|
+
m || (!a && !r || w && !v) && f(!1);
|
|
148
148
|
}, T = () => {
|
|
149
|
-
if (
|
|
150
|
-
|
|
151
|
-
const
|
|
152
|
-
|
|
149
|
+
if (i && d && l.current) {
|
|
150
|
+
S();
|
|
151
|
+
const e = x(g);
|
|
152
|
+
e && E(e);
|
|
153
153
|
}
|
|
154
154
|
}, U = () => {
|
|
155
|
-
if (
|
|
156
|
-
|
|
157
|
-
const
|
|
158
|
-
|
|
155
|
+
if (i && d && l.current) {
|
|
156
|
+
S();
|
|
157
|
+
const e = x(g);
|
|
158
|
+
e && E(e);
|
|
159
159
|
}
|
|
160
|
-
},
|
|
161
|
-
const o =
|
|
162
|
-
f((
|
|
163
|
-
|
|
164
|
-
|
|
160
|
+
}, A = (e = !1) => {
|
|
161
|
+
const o = i;
|
|
162
|
+
f((t) => !t), !o && e && setTimeout(() => {
|
|
163
|
+
if (e === "last") {
|
|
164
|
+
const t = c.current?.querySelectorAll(R), n = t ? t[t.length - 1] : null;
|
|
165
|
+
n && n.focus();
|
|
166
|
+
} else {
|
|
167
|
+
const t = c.current?.querySelector(R);
|
|
168
|
+
t && t.focus();
|
|
169
|
+
}
|
|
165
170
|
}, 50);
|
|
166
|
-
}, _ = (
|
|
171
|
+
}, _ = (e, o) => {
|
|
167
172
|
if (!o) return;
|
|
168
|
-
const
|
|
169
|
-
const u = window.getComputedStyle(
|
|
170
|
-
return !
|
|
173
|
+
const t = ['[role="menuitem"]', '[role="option"]', '[role="menuitemcheckbox"]', '[role="menuitemradio"]', "button:not([disabled])", "a[href]", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])", '[tabindex]:not([tabindex="-1"])'].join(", "), n = Array.from(o.querySelectorAll(t)).filter((s) => {
|
|
174
|
+
const u = window.getComputedStyle(s);
|
|
175
|
+
return !s.hasAttribute("disabled") && !s.hasAttribute("aria-disabled") && u.display !== "none" && u.visibility !== "hidden" && (s.tabIndex >= 0 || s.hasAttribute("role"));
|
|
171
176
|
});
|
|
172
|
-
if (
|
|
173
|
-
const a =
|
|
174
|
-
let
|
|
175
|
-
|
|
176
|
-
}, X = (
|
|
177
|
-
|
|
177
|
+
if (n.length === 0) return;
|
|
178
|
+
const a = n.findIndex((s) => s === document.activeElement);
|
|
179
|
+
let r = -1;
|
|
180
|
+
e.key === "ArrowDown" ? (e.preventDefault(), e.stopPropagation(), r = a < n.length - 1 ? a + 1 : 0) : e.key === "ArrowUp" ? (e.preventDefault(), e.stopPropagation(), r = a > 0 ? a - 1 : n.length - 1) : e.key === "Home" ? (e.preventDefault(), e.stopPropagation(), r = 0) : e.key === "End" && (e.preventDefault(), e.stopPropagation(), r = n.length - 1), r >= 0 && n[r] ? n[r].focus() : a === -1 && n.length > 0 && n[0].focus();
|
|
181
|
+
}, X = (e) => {
|
|
182
|
+
e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), f(!1), l.current?.focus()) : e.key === "Tab" ? (f(!1), e.shiftKey && (e.preventDefault(), l.current?.focus())) : e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Home" || e.key === "End" ? _(e, c.current) : (e.key === "Enter" || e.key === " ") && e.stopPropagation();
|
|
178
183
|
};
|
|
179
|
-
|
|
180
|
-
togglePopover:
|
|
184
|
+
le(te, () => ({
|
|
185
|
+
togglePopover: A
|
|
181
186
|
}), []);
|
|
182
|
-
const
|
|
187
|
+
const ie = {
|
|
183
188
|
"bottom-left": {
|
|
184
189
|
left: "0",
|
|
185
190
|
top: "100%"
|
|
@@ -207,66 +212,66 @@ const B = ['[role="menuitem"]', '[role="option"]', '[role="menuitemcheckbox"]',
|
|
|
207
212
|
bottom: "100%"
|
|
208
213
|
}
|
|
209
214
|
}, G = Z ? "" : "shadow-md border rounded-md";
|
|
210
|
-
return /* @__PURE__ */
|
|
211
|
-
className: "se-design-popover-wrapper cursor-pointer relative focus-outline rounded-md" + (y.length > 0 ? ` ${y}` : "") + (
|
|
215
|
+
return /* @__PURE__ */ B.createElement("div", O({
|
|
216
|
+
className: "se-design-popover-wrapper cursor-pointer relative focus-outline rounded-md" + (y.length > 0 ? ` ${y}` : "") + (i ? " open" : "") + (P ? " opacity-50 cursor-not-allowed pointer-events-none" : ""),
|
|
212
217
|
ref: l,
|
|
213
|
-
onClick: (
|
|
214
|
-
P || b || (
|
|
218
|
+
onClick: (e) => {
|
|
219
|
+
P || b || (e.stopPropagation(), A());
|
|
215
220
|
},
|
|
216
|
-
onKeyDown: (
|
|
221
|
+
onKeyDown: (e) => {
|
|
217
222
|
if (!(P || b))
|
|
218
|
-
if (
|
|
219
|
-
|
|
220
|
-
const o =
|
|
221
|
-
|
|
222
|
-
const
|
|
223
|
-
if (
|
|
224
|
-
const
|
|
225
|
-
|
|
223
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
224
|
+
e.preventDefault(), e.stopPropagation();
|
|
225
|
+
const o = i;
|
|
226
|
+
A(), o || setTimeout(() => {
|
|
227
|
+
const t = c.current;
|
|
228
|
+
if (t) {
|
|
229
|
+
const n = t.querySelector(R);
|
|
230
|
+
n && n.focus();
|
|
226
231
|
}
|
|
227
232
|
}, 0);
|
|
228
|
-
} else if (
|
|
229
|
-
|
|
230
|
-
else if ((
|
|
233
|
+
} else if (e.key === "Escape" && i)
|
|
234
|
+
e.preventDefault(), e.stopPropagation(), f(!1);
|
|
235
|
+
else if ((e.key === "ArrowDown" || e.key === "ArrowUp") && i) {
|
|
231
236
|
const o = c.current;
|
|
232
|
-
o && _(
|
|
233
|
-
} else
|
|
237
|
+
o && _(e, o);
|
|
238
|
+
} else e.key === "ArrowDown" && !i && (e.preventDefault(), e.stopPropagation(), f(!0), setTimeout(() => {
|
|
234
239
|
const o = c.current;
|
|
235
240
|
if (o) {
|
|
236
|
-
const
|
|
237
|
-
|
|
241
|
+
const t = o.querySelector(R);
|
|
242
|
+
t && t.focus();
|
|
238
243
|
}
|
|
239
244
|
}, 0));
|
|
240
245
|
},
|
|
241
|
-
onBlurCapture:
|
|
242
|
-
onBlur: (
|
|
243
|
-
if (!
|
|
244
|
-
const o =
|
|
245
|
-
!
|
|
246
|
+
onBlurCapture: re,
|
|
247
|
+
onBlur: (e) => {
|
|
248
|
+
if (!i || m || !d) return;
|
|
249
|
+
const o = e.relatedTarget, t = !!(o && l.current?.contains(o)), n = !!(o && c.current?.contains(o));
|
|
250
|
+
!t && !n && f(!1);
|
|
246
251
|
},
|
|
247
252
|
role: b ? "none" : z,
|
|
248
|
-
"aria-expanded": b ? void 0 :
|
|
253
|
+
"aria-expanded": b ? void 0 : i ? "true" : "false",
|
|
249
254
|
"aria-haspopup": b ? void 0 : z === "combobox" ? "listbox" : "true",
|
|
250
255
|
tabIndex: P || b ? -1 : 0,
|
|
251
256
|
"aria-disabled": b ? void 0 : P ? "true" : "false"
|
|
252
|
-
},
|
|
257
|
+
}, ne, {
|
|
253
258
|
"data-automation-id": k
|
|
254
|
-
},
|
|
255
|
-
displayPopover:
|
|
256
|
-
togglePopover:
|
|
257
|
-
}),
|
|
259
|
+
}, ee), Q({
|
|
260
|
+
displayPopover: i,
|
|
261
|
+
togglePopover: A
|
|
262
|
+
}), i && !d && /* @__PURE__ */ B.createElement("div", {
|
|
258
263
|
className: `popover-content absolute ${G} z-[1000] ${I == "full" ? "w-full" : "w-max"}`,
|
|
259
264
|
style: {
|
|
260
265
|
...C,
|
|
261
|
-
...
|
|
266
|
+
...ie[g]
|
|
262
267
|
},
|
|
263
|
-
onClick: (
|
|
268
|
+
onClick: (e) => e.stopPropagation(),
|
|
264
269
|
onKeyDown: X,
|
|
265
270
|
ref: c,
|
|
266
271
|
"data-automation-id": h
|
|
267
272
|
}, N({
|
|
268
273
|
closePopoverCb: () => f(!1)
|
|
269
|
-
})), d &&
|
|
274
|
+
})), d && i && oe && /* @__PURE__ */ fe.createPortal(/* @__PURE__ */ B.createElement("div", {
|
|
270
275
|
className: `popover-content-with-portal ${G} ${I == "full" ? "w-full" : "w-max"}`,
|
|
271
276
|
style: {
|
|
272
277
|
position: "fixed",
|
|
@@ -274,7 +279,7 @@ const B = ['[role="menuitem"]', '[role="option"]', '[role="menuitemcheckbox"]',
|
|
|
274
279
|
left: M.left,
|
|
275
280
|
...C
|
|
276
281
|
},
|
|
277
|
-
onClick: (
|
|
282
|
+
onClick: (e) => e.stopPropagation(),
|
|
278
283
|
onKeyDown: X,
|
|
279
284
|
ref: c,
|
|
280
285
|
"data-automation-id": h
|
|
@@ -283,6 +288,6 @@ const B = ['[role="menuitem"]', '[role="option"]', '[role="menuitemcheckbox"]',
|
|
|
283
288
|
})), document.body));
|
|
284
289
|
});
|
|
285
290
|
export {
|
|
286
|
-
|
|
291
|
+
we as Popover
|
|
287
292
|
};
|
|
288
293
|
//# sourceMappingURL=index18.js.map
|
package/dist/index18.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index18.js","sources":["../src/components/Popover/index.tsx"],"sourcesContent":["import React, { useState, useRef, ReactNode, useEffect, forwardRef, ForwardedRef, useImperativeHandle } from 'react';\nimport ReactDOM from 'react-dom';\nimport { getA11yNameAttributes, useDismissOnFocusOut } from '../../utils/a11y';\n\nconst focusableSelectors = [\n '[role=\"menuitem\"]', '[role=\"option\"]', '[role=\"menuitemcheckbox\"]',\n '[role=\"menuitemradio\"]', 'button:not([disabled])', 'a[href]',\n '[tabindex]:not([tabindex=\"-1\"])'\n].join(', ');\n\nexport interface PopoverHandle {\n togglePopover: (focusFirst?: boolean) => void;\n}\n\nexport interface PopoverProps {\n className?: string;\n automationId?: string;\n popoverContentAutomationId?: string;\n renderPopoverContents: (props: { closePopoverCb: () => void }) => ReactNode;\n renderPopoverSrcElement: (props: { displayPopover: boolean; togglePopover: (focusFirst?: boolean) => void }) => ReactNode;\n position?: 'bottom-center' | 'bottom-left' | 'bottom-right' | 'top-center' | 'top-left' | 'top-right';\n onPopoverToggle?: (displayPopover: boolean) => void;\n contentWidth?: 'full' | 'max';\n isPopoverOpen?: boolean;\n disabled?: boolean;\n isWithPortal?: boolean;\n noBorder?: boolean;\n ariaLabel?: string;\n ariaLabelledBy?: string;\n sourceRole?: 'button' | 'combobox';\n popoverContentStyleProperty?: React.CSSProperties;\n disableClickToggle?: boolean;\n disableAutoClose?: boolean;\n}\n\nexport const Popover = forwardRef<PopoverHandle, PopoverProps>(\n (\n {\n className = '',\n automationId = '',\n position = 'bottom-center',\n popoverContentAutomationId = '',\n contentWidth = 'max',\n renderPopoverContents,\n renderPopoverSrcElement,\n onPopoverToggle,\n isPopoverOpen,\n disabled = false,\n isWithPortal = false,\n ariaLabel,\n ariaLabelledBy,\n sourceRole = 'button',\n popoverContentStyleProperty = {\n zIndex: 1000,\n borderColor: 'var(--color-gray-200)',\n color: 'var(--color-gray-900)',\n backgroundColor: 'var(--color-white)'\n },\n disableClickToggle = false,\n noBorder = false,\n disableAutoClose = false,\n ...props\n },\n ref: ForwardedRef<PopoverHandle>\n ) => {\n const [displayPopover, setDisplayPopover] = useState(false);\n const [popoverPosition, setPopoverPosition] = useState(position);\n const [isSrcElementVisible, setIsSrcElementVisible] = useState(false);\n const srcElementRef = useRef<HTMLDivElement>(null);\n const popoverContentRef = useRef<HTMLDivElement>(null);\n\n // Compute accessible name/description props with correct precedence\n const accessibleNameProps = getA11yNameAttributes({\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy: undefined // Popover doesn't support describedBy yet\n });\n\n // Use shared focus-out dismissal for non-portal popovers.\n // Portal content lives outside the wrapper, so portal uses a dedicated onBlur fallback below.\n const { onBlurCapture: onDismissBlurCapture } = useDismissOnFocusOut<HTMLDivElement>({\n disabled: !displayPopover || disableAutoClose || isWithPortal,\n onFocusOut: () => setDisplayPopover(false),\n closeOnEscape: false\n });\n\n const [portalPosition, setPortalPosition] = useState({ top: 0, left: 0 });\n\n const calculatePositionOfPopover = (position: string = 'bottom-center') => {\n if (!srcElementRef.current) return { top: 0, left: 0 };\n\n let localPosition = position;\n\n const srcRect = srcElementRef.current.getBoundingClientRect();\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n\n // Calculate position for portal\n let top = 0;\n let left = 0;\n\n switch (localPosition) {\n case 'bottom-left':\n top = srcRect.bottom;\n left = srcRect.left;\n break;\n case 'bottom-right':\n top = srcRect.bottom;\n left = srcRect.right - srcRect.width * 0.5;\n break;\n case 'bottom-center':\n top = srcRect.bottom;\n // Center the popover relative to the source element\n left = srcRect.left + srcRect.width / 2;\n break;\n case 'top-left':\n top = srcRect.top - srcRect.height * 1.9;\n left = srcRect.left;\n break;\n case 'top-right':\n top = srcRect.top - srcRect.height * 1.9;\n left = srcRect.right - srcRect.width * 0.5;\n break;\n case 'top-center':\n top = srcRect.top - srcRect.height * 1.9;\n // Center the popover relative to the source element\n left = srcRect.left + srcRect.width / 2;\n break;\n default:\n top = srcRect.bottom;\n left = srcRect.left;\n break;\n }\n\n // Get popover dimensions if available\n const popoverRect = popoverContentRef.current?.getBoundingClientRect();\n const popoverWidth = popoverRect?.width || 0;\n const popoverHeight = popoverRect?.height || 0;\n\n // Adjust center positions to account for popover width\n if (localPosition === 'bottom-center' || localPosition === 'top-center') {\n // Center the popover by subtracting half its width from the source center\n left = left - popoverWidth / 2;\n }\n\n // Adjust position to keep popover within viewport bounds\n // Horizontal adjustments\n if (left + popoverWidth > viewportWidth) {\n // Popover extends beyond right edge, shift it left\n left = Math.max(0, viewportWidth - popoverWidth);\n }\n if (left < 0) {\n // Popover extends beyond left edge, shift it right\n left = 0;\n }\n\n // Vertical adjustments\n if (top + popoverHeight > viewportHeight) {\n // Popover extends beyond bottom edge\n // Try to position it above the source element\n const spaceAbove = srcRect.top;\n const spaceBelow = viewportHeight - srcRect.bottom;\n\n if (spaceAbove >= popoverHeight || spaceAbove > spaceBelow) {\n // Position above if there's enough space or more space above\n top = srcRect.top - popoverHeight;\n // Ensure it doesn't go above viewport\n if (top < 0) {\n top = 0;\n }\n } else {\n // Keep at bottom but adjust to fit within viewport\n top = Math.max(0, viewportHeight - popoverHeight);\n }\n }\n if (top < 0) {\n // Popover extends beyond top edge, position it below the source element\n top = srcRect.bottom;\n // Ensure it doesn't go below viewport\n if (top + popoverHeight > viewportHeight) {\n top = Math.max(0, viewportHeight - popoverHeight);\n }\n }\n\n return { top, left };\n };\n\n useEffect(() => {\n if (onPopoverToggle) {\n onPopoverToggle(displayPopover);\n }\n\n if (displayPopover && !isWithPortal) {\n // Add click listener for auto-close behavior only if not disabled\n if (!disableAutoClose) {\n document.body.addEventListener('click', clickListener, true);\n }\n checkPopoverPosition();\n return () => {\n if (!disableAutoClose) {\n document.body.removeEventListener('click', clickListener, true);\n }\n };\n } else if (displayPopover && isWithPortal) {\n // Add click/scroll listeners for auto-close behavior only if not disabled\n if (!disableAutoClose) {\n document.body.addEventListener('click', clickAndScrollListenerWithPortal, true);\n window.addEventListener('scroll', clickAndScrollListenerWithPortal);\n } else {\n // When disableAutoClose is true, still listen to scroll for repositioning\n window.addEventListener('scroll', scrollListenerForRepositioning);\n }\n // Always add resize listener for repositioning\n window.addEventListener('resize', resizeListenerWithPortal);\n\n // Initial position calculation\n const timeout1 = setTimeout(() => {\n const position = calculatePositionOfPopover(popoverPosition);\n checkSourceVisibility();\n\n if (position) {\n setPortalPosition(position);\n }\n }, 0);\n\n // Recalculate after popover is rendered to get accurate dimensions\n const timeout2 = setTimeout(() => {\n const position = calculatePositionOfPopover(popoverPosition);\n if (position) {\n setPortalPosition(position);\n }\n }, 10);\n\n return () => {\n if (!disableAutoClose) {\n document.body.removeEventListener('click', clickAndScrollListenerWithPortal, true);\n window.removeEventListener('scroll', clickAndScrollListenerWithPortal);\n } else {\n window.removeEventListener('scroll', scrollListenerForRepositioning);\n }\n window.removeEventListener('resize', resizeListenerWithPortal);\n clearTimeout(timeout1);\n clearTimeout(timeout2);\n };\n }\n }, [displayPopover, isWithPortal, disableAutoClose]);\n\n const checkSourceVisibility = () => {\n if (!srcElementRef.current) {\n setIsSrcElementVisible(false);\n return;\n }\n\n const rec = srcElementRef.current.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const viewportWidth = window.innerWidth;\n\n const isVisible = rec.top < viewportHeight && rec.bottom > 0 && rec.left < viewportWidth && rec.right > 0;\n\n setIsSrcElementVisible(isVisible);\n };\n\n useEffect(() => {\n setDisplayPopover(isPopoverOpen ?? false);\n }, [isPopoverOpen]);\n\n useEffect(() => {\n // Focus first focusable element when popover opens\n if (displayPopover && popoverContentRef.current) {\n setTimeout(() => {\n const firstFocusable = popoverContentRef.current?.querySelector<HTMLElement>(focusableSelectors);\n if (firstFocusable && document.activeElement === srcElementRef.current) {\n firstFocusable.focus();\n }\n }, 0);\n }\n }, [displayPopover]);\n\n //Function to check popover position\n const checkPopoverPosition = () => {\n if (!popoverContentRef.current) return;\n\n const popoverRect = popoverContentRef.current.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n\n if (popoverRect?.bottom > viewportHeight) {\n setPopoverPosition(\n position.includes('left') ? 'top-left' : position.includes('right') ? 'top-right' : 'top-center'\n );\n } else if (popoverRect?.top < 0) {\n // If popover extends beyond top of viewport, switch to bottom position\n setPopoverPosition(\n position.includes('left') ? 'bottom-left' : position.includes('right') ? 'bottom-right' : 'bottom-center'\n );\n }\n };\n\n const clickListener = (event: MouseEvent) => {\n const currentDropRef = srcElementRef.current;\n if (!currentDropRef) return;\n\n const target = event.target as Node;\n const isSourcePopover = currentDropRef.contains(target);\n const isPopoverContent = popoverContentRef.current?.contains(target);\n\n // Check if click is on another popover's source element\n const clickedElement = target as HTMLElement;\n const closestPopoverWrapper = clickedElement.closest?.('.se-design-popover-wrapper');\n const isAnotherPopoverSource = closestPopoverWrapper && closestPopoverWrapper !== currentDropRef;\n\n // check if the clicked popover is a nesteded child of the current popover content\n const isNestedPopover = popoverContentRef.current?.contains(closestPopoverWrapper as Node);\n\n // if clicked source is parent or the popover-content, do not toggle dropdown.\n // Also close if clicking on another popover's source element\n if (disableAutoClose) return;\n if ((!isSourcePopover && !isPopoverContent) || (isAnotherPopoverSource && !isNestedPopover)) {\n setDisplayPopover(false);\n }\n };\n\n const clickAndScrollListenerWithPortal = (event: Event) => {\n const currentDropRef = srcElementRef.current;\n const currentPopoverRef = popoverContentRef.current;\n if (!currentDropRef) return;\n checkSourceVisibility();\n\n // Recalculate position on scroll\n if (event.type === 'scroll' && displayPopover) {\n const position = calculatePositionOfPopover(popoverPosition);\n if (position) {\n setPortalPosition(position);\n }\n }\n\n const target = event.target as Node;\n const isSourcePopover = currentDropRef.contains(target);\n const isPopoverContent = currentPopoverRef?.contains(target);\n\n // Check if click is on another popover's source element\n const clickedElement = target as HTMLElement;\n const closestPopoverWrapper = clickedElement.closest?.('.se-design-popover-wrapper');\n const isAnotherPopoverSource = closestPopoverWrapper && closestPopoverWrapper !== currentDropRef;\n\n // check if the clicked popover is a nesteded child of the current popover content\n const isNestedPopover = popoverContentRef.current?.contains(closestPopoverWrapper as Node);\n\n if (disableAutoClose) return;\n // if clicked source is parent or the popover-content, do not toggle dropdown.\n // Also close if clicking on another popover's source element\n if ((!isSourcePopover && !isPopoverContent) || (isAnotherPopoverSource && !isNestedPopover)) {\n setDisplayPopover(false);\n }\n };\n\n const resizeListenerWithPortal = () => {\n if (displayPopover && isWithPortal && srcElementRef.current) {\n checkSourceVisibility();\n const position = calculatePositionOfPopover(popoverPosition);\n if (position) {\n setPortalPosition(position);\n }\n }\n };\n\n const scrollListenerForRepositioning = () => {\n if (displayPopover && isWithPortal && srcElementRef.current) {\n checkSourceVisibility();\n const position = calculatePositionOfPopover(popoverPosition);\n if (position) {\n setPortalPosition(position);\n }\n }\n };\n\n const togglePopover = (focusFirst = false) => {\n const wasOpen = displayPopover;\n setDisplayPopover((prev) => !prev);\n if (!wasOpen && focusFirst) {\n setTimeout(() => {\n const firstFocusable = popoverContentRef.current?.querySelector<HTMLElement>(focusableSelectors);\n if (firstFocusable) firstFocusable.focus();\n }, 50);\n }\n };\n\n const handleArrowKeyNavigation = (e: React.KeyboardEvent, container: HTMLDivElement | null) => {\n if (!container) return;\n\n // Find all focusable elements within the popover content\n // This includes elements with role=\"menuitem\", role=\"option\", tabIndex >= 0, etc.\n const focusableSelectors = [\n '[role=\"menuitem\"]',\n '[role=\"option\"]',\n '[role=\"menuitemcheckbox\"]',\n '[role=\"menuitemradio\"]',\n 'button:not([disabled])',\n 'a[href]',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])'\n ].join(', ');\n\n const focusableElements = Array.from(container.querySelectorAll<HTMLElement>(focusableSelectors)).filter((el) => {\n // Filter out disabled and hidden elements\n const style = window.getComputedStyle(el);\n return (\n !el.hasAttribute('disabled') &&\n !el.hasAttribute('aria-disabled') &&\n style.display !== 'none' &&\n style.visibility !== 'hidden' &&\n (el.tabIndex >= 0 || el.hasAttribute('role'))\n );\n });\n\n if (focusableElements.length === 0) return;\n\n const currentIndex = focusableElements.findIndex((el) => el === document.activeElement);\n let nextIndex = -1;\n\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n e.stopPropagation();\n nextIndex = currentIndex < focusableElements.length - 1 ? currentIndex + 1 : 0;\n } else if (e.key === 'ArrowUp') {\n e.preventDefault();\n e.stopPropagation();\n nextIndex = currentIndex > 0 ? currentIndex - 1 : focusableElements.length - 1;\n } else if (e.key === 'Home') {\n e.preventDefault();\n e.stopPropagation();\n nextIndex = 0;\n } else if (e.key === 'End') {\n e.preventDefault();\n e.stopPropagation();\n nextIndex = focusableElements.length - 1;\n }\n\n if (nextIndex >= 0 && focusableElements[nextIndex]) {\n focusableElements[nextIndex].focus();\n } else if (currentIndex === -1 && focusableElements.length > 0) {\n // If no element is currently focused, focus the first one\n focusableElements[0].focus();\n }\n };\n\n const handlePopoverContentKeyDown = (e: React.KeyboardEvent) => {\n // Allow Escape key to close popover when focus is on content\n if (e.key === 'Escape') {\n e.preventDefault();\n e.stopPropagation();\n setDisplayPopover(false);\n srcElementRef.current?.focus();\n } else if (e.key === 'Tab') {\n // Close popover when Tab exits the menu\n setDisplayPopover(false);\n if (e.shiftKey) {\n // Shift+Tab: prevent default (would go to wrapper) and focus trigger instead\n e.preventDefault();\n srcElementRef.current?.focus();\n }\n // Forward Tab: do NOT preventDefault — browser moves focus to next element naturally\n } else if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'Home' || e.key === 'End') {\n // Handle arrow key navigation for focusable elements inside popover\n handleArrowKeyNavigation(e, popoverContentRef.current);\n } else if (e.key === 'Enter' || e.key === ' ') {\n // Prevent Enter/Space from bubbling to wrapper (mirrors click stopPropagation)\n e.stopPropagation();\n }\n };\n\n useImperativeHandle(ref, () => ({ togglePopover }), []);\n\n const popoverContentStyle = {\n 'bottom-left': { left: '0', top: '100%' },\n 'bottom-right': { right: '0', top: '100%' },\n 'bottom-center': { left: '50%', transform: 'translateX(-50%)', top: '100%' },\n 'top-left': { left: '0', bottom: '100%' },\n 'top-right': { right: '0', bottom: '100%' },\n 'top-center': { left: '50%', transform: 'translateX(-50%)', bottom: '100%' }\n };\n const popoverContentClasses = noBorder ? '' : 'shadow-md border rounded-md';\n\n return (\n <div\n className={\n 'se-design-popover-wrapper cursor-pointer relative focus-outline rounded-md' +\n (className.length > 0 ? ` ${className}` : '') +\n (displayPopover ? ' open' : '') +\n (disabled ? ' opacity-50 cursor-not-allowed pointer-events-none' : '')\n }\n ref={srcElementRef}\n onClick={(e) => {\n if (disabled || disableClickToggle) return;\n e.stopPropagation();\n togglePopover();\n }}\n onKeyDown={(e) => {\n if (disabled || disableClickToggle) return;\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n const wasOpen = displayPopover;\n togglePopover();\n // Focus first focusable element when opening\n if (!wasOpen) {\n setTimeout(() => {\n const currentRef = popoverContentRef.current;\n if (currentRef) {\n const firstFocusable = currentRef.querySelector<HTMLElement>(focusableSelectors);\n if (firstFocusable) {\n firstFocusable.focus();\n }\n }\n }, 0);\n }\n } else if (e.key === 'Escape' && displayPopover) {\n e.preventDefault();\n e.stopPropagation();\n setDisplayPopover(false);\n } else if ((e.key === 'ArrowDown' || e.key === 'ArrowUp') && displayPopover) {\n // Handle arrow keys when popover is open\n const currentRef = popoverContentRef.current;\n if (currentRef) {\n handleArrowKeyNavigation(e, currentRef);\n }\n } else if (e.key === 'ArrowDown' && !displayPopover) {\n // Open popover and focus first item when ArrowDown is pressed\n e.preventDefault();\n e.stopPropagation();\n setDisplayPopover(true);\n setTimeout(() => {\n const currentRef = popoverContentRef.current;\n if (currentRef) {\n const firstFocusable = currentRef.querySelector<HTMLElement>(focusableSelectors);\n if (firstFocusable) {\n firstFocusable.focus();\n }\n }\n }, 0);\n }\n }}\n onBlurCapture={onDismissBlurCapture}\n onBlur={(e) => {\n // Portal content is rendered outside wrapper, so keep explicit check for that case.\n if (!displayPopover || disableAutoClose || !isWithPortal) return;\n\n const nextFocused = e.relatedTarget as Node | null;\n const isFocusInSource = !!(nextFocused && srcElementRef.current?.contains(nextFocused));\n const isFocusInPopover = !!(nextFocused && popoverContentRef.current?.contains(nextFocused));\n\n // Close only when focus leaves both source and portal content.\n if (!isFocusInSource && !isFocusInPopover) {\n setDisplayPopover(false);\n }\n }}\n role={disableClickToggle ? 'none' : sourceRole}\n aria-expanded={disableClickToggle ? undefined : displayPopover ? 'true' : 'false'}\n aria-haspopup={disableClickToggle ? undefined : sourceRole === 'combobox' ? 'listbox' : 'true'}\n tabIndex={disabled || disableClickToggle ? -1 : 0}\n aria-disabled={disableClickToggle ? undefined : disabled ? 'true' : 'false'}\n {...accessibleNameProps}\n data-automation-id={automationId}\n {...props}\n >\n {renderPopoverSrcElement({ displayPopover, togglePopover })}\n\n {displayPopover && !isWithPortal && (\n <div\n className={`popover-content absolute ${popoverContentClasses} z-[1000] ${\n contentWidth == 'full' ? 'w-full' : 'w-max'\n }`}\n style={{\n ...popoverContentStyleProperty,\n ...popoverContentStyle[popoverPosition]\n }}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={handlePopoverContentKeyDown}\n ref={popoverContentRef}\n data-automation-id={popoverContentAutomationId}\n >\n {renderPopoverContents({ closePopoverCb: () => setDisplayPopover(false) })}\n </div>\n )}\n {isWithPortal &&\n displayPopover &&\n isSrcElementVisible &&\n ReactDOM.createPortal(\n <div\n className={`popover-content-with-portal ${popoverContentClasses} ${\n contentWidth == 'full' ? 'w-full' : 'w-max'\n }`}\n style={{\n position: 'fixed',\n top: portalPosition.top,\n left: portalPosition.left,\n ...popoverContentStyleProperty\n }}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={handlePopoverContentKeyDown}\n ref={popoverContentRef}\n data-automation-id={popoverContentAutomationId}\n >\n {renderPopoverContents({ closePopoverCb: () => setDisplayPopover(false) })}\n </div>,\n document.body\n )}\n </div>\n );\n }\n);\n"],"names":["focusableSelectors","join","Popover","className","automationId","position","popoverContentAutomationId","contentWidth","renderPopoverContents","renderPopoverSrcElement","onPopoverToggle","isPopoverOpen","disabled","isWithPortal","ariaLabel","ariaLabelledBy","sourceRole","popoverContentStyleProperty","zIndex","borderColor","color","backgroundColor","disableClickToggle","noBorder","disableAutoClose","props","ref","displayPopover","setDisplayPopover","useState","popoverPosition","setPopoverPosition","isSrcElementVisible","setIsSrcElementVisible","srcElementRef","useRef","popoverContentRef","accessibleNameProps","getA11yNameAttributes","ariaDescribedBy","undefined","onBlurCapture","onDismissBlurCapture","useDismissOnFocusOut","onFocusOut","closeOnEscape","portalPosition","setPortalPosition","top","left","calculatePositionOfPopover","current","localPosition","srcRect","getBoundingClientRect","viewportWidth","window","innerWidth","viewportHeight","innerHeight","bottom","right","width","height","popoverRect","popoverWidth","popoverHeight","Math","max","spaceAbove","spaceBelow","useEffect","document","body","addEventListener","clickListener","checkPopoverPosition","removeEventListener","scrollListenerForRepositioning","clickAndScrollListenerWithPortal","resizeListenerWithPortal","timeout1","setTimeout","checkSourceVisibility","timeout2","clearTimeout","rec","isVisible","firstFocusable","querySelector","activeElement","focus","includes","event","currentDropRef","target","isSourcePopover","contains","isPopoverContent","closestPopoverWrapper","closest","isAnotherPopoverSource","isNestedPopover","currentPopoverRef","type","togglePopover","focusFirst","wasOpen","prev","handleArrowKeyNavigation","e","container","focusableElements","Array","from","querySelectorAll","filter","el","style","getComputedStyle","hasAttribute","display","visibility","tabIndex","length","currentIndex","findIndex","nextIndex","key","preventDefault","stopPropagation","handlePopoverContentKeyDown","shiftKey","useImperativeHandle","popoverContentStyle","transform","popoverContentClasses","React","createElement","_extends","onClick","onKeyDown","currentRef","onBlur","nextFocused","relatedTarget","isFocusInSource","isFocusInPopover","role","closePopoverCb","ReactDOM","createPortal"],"mappings":";;;;;;;;;;;;;AAIA,MAAMA,IAAqB,CACzB,qBAAqB,mBAAmB,6BACxC,0BAA0B,0BAA0B,WACpD,iCAAiC,EACjCC,KAAK,IAAI,GA2BEC,wBACX,CACE;AAAA,EACEC,WAAAA,IAAY;AAAA,EACZC,cAAAA,IAAe;AAAA,EACfC,UAAAA,IAAW;AAAA,EACXC,4BAAAA,IAA6B;AAAA,EAC7BC,cAAAA,IAAe;AAAA,EACfC,uBAAAA;AAAAA,EACAC,yBAAAA;AAAAA,EACAC,iBAAAA;AAAAA,EACAC,eAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,cAAAA,IAAe;AAAA,EACfC,WA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AAAAA,IACXzG,KAAKU;AAAAA,IACL,sBAAoB9B;AAAAA,EAAAA,GAEnBE,EAAsB;AAAA,IAAE6I,gBAAgBA,MAAMzH,EAAkB,EAAK;AAAA,EAAA,CAAG,CACtE,GAENf,KACCc,KACAK,MACAsH,gBAAAA,GAASC,aACPd,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IACEvI,WAAW,+BAA+BqI,CAAqB,IAC7DjI,KAAgB,SAAS,WAAW,OAAO;AAAA,IAE7C+G,OAAO;AAAA,MACLjH,UAAU;AAAA,MACV2C,KAAKF,EAAeE;AAAAA,MACpBC,MAAMH,EAAeG;AAAAA,MACrB,GAAGhC;AAAAA,IAAAA;AAAAA,IAEL2H,SAAU9B,CAAAA,MAAMA,EAAEoB,gBAAAA;AAAAA,IAClBW,WAAWV;AAAAA,IACXzG,KAAKU;AAAAA,IACL,sBAAoB9B;AAAAA,EAAAA,GAEnBE,EAAsB;AAAA,IAAE6I,gBAAgBA,MAAMzH,EAAkB,EAAK;AAAA,EAAA,CAAG,CACtE,GACL4C,SAASC,IACX,CACC;AAET,CACF;"}
|
|
1
|
+
{"version":3,"file":"index18.js","sources":["../src/components/Popover/index.tsx"],"sourcesContent":["import React, { useState, useRef, ReactNode, useEffect, forwardRef, ForwardedRef, useImperativeHandle } from 'react';\nimport ReactDOM from 'react-dom';\nimport { getA11yNameAttributes, useDismissOnFocusOut } from '../../utils/a11y';\n\nconst focusableSelectors = [\n '[role=\"menuitem\"]', '[role=\"option\"]', '[role=\"menuitemcheckbox\"]',\n '[role=\"menuitemradio\"]', 'button:not([disabled])', 'a[href]',\n '[tabindex]:not([tabindex=\"-1\"])'\n].join(', ');\n\nexport interface PopoverHandle {\n togglePopover: (focusFirst?: boolean | 'last') => void;\n}\n\nexport interface PopoverProps {\n className?: string;\n automationId?: string;\n popoverContentAutomationId?: string;\n renderPopoverContents: (props: { closePopoverCb: () => void }) => ReactNode;\n renderPopoverSrcElement: (props: { displayPopover: boolean; togglePopover: (focusFirst?: boolean | 'last') => void }) => ReactNode;\n position?: 'bottom-center' | 'bottom-left' | 'bottom-right' | 'top-center' | 'top-left' | 'top-right';\n onPopoverToggle?: (displayPopover: boolean) => void;\n contentWidth?: 'full' | 'max';\n isPopoverOpen?: boolean;\n disabled?: boolean;\n isWithPortal?: boolean;\n noBorder?: boolean;\n ariaLabel?: string;\n ariaLabelledBy?: string;\n sourceRole?: 'button' | 'combobox';\n popoverContentStyleProperty?: React.CSSProperties;\n disableClickToggle?: boolean;\n disableAutoClose?: boolean;\n}\n\nexport const Popover = forwardRef<PopoverHandle, PopoverProps>(\n (\n {\n className = '',\n automationId = '',\n position = 'bottom-center',\n popoverContentAutomationId = '',\n contentWidth = 'max',\n renderPopoverContents,\n renderPopoverSrcElement,\n onPopoverToggle,\n isPopoverOpen,\n disabled = false,\n isWithPortal = false,\n ariaLabel,\n ariaLabelledBy,\n sourceRole = 'button',\n popoverContentStyleProperty = {\n zIndex: 1000,\n borderColor: 'var(--color-gray-200)',\n color: 'var(--color-gray-900)',\n backgroundColor: 'var(--color-white)'\n },\n disableClickToggle = false,\n noBorder = false,\n disableAutoClose = false,\n ...props\n },\n ref: ForwardedRef<PopoverHandle>\n ) => {\n const [displayPopover, setDisplayPopover] = useState(false);\n const [popoverPosition, setPopoverPosition] = useState(position);\n const [isSrcElementVisible, setIsSrcElementVisible] = useState(false);\n const srcElementRef = useRef<HTMLDivElement>(null);\n const popoverContentRef = useRef<HTMLDivElement>(null);\n\n // Compute accessible name/description props with correct precedence\n const accessibleNameProps = getA11yNameAttributes({\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy: undefined // Popover doesn't support describedBy yet\n });\n\n // Use shared focus-out dismissal for non-portal popovers.\n // Portal content lives outside the wrapper, so portal uses a dedicated onBlur fallback below.\n const { onBlurCapture: onDismissBlurCapture } = useDismissOnFocusOut<HTMLDivElement>({\n disabled: !displayPopover || disableAutoClose || isWithPortal,\n onFocusOut: () => setDisplayPopover(false),\n closeOnEscape: false\n });\n\n const [portalPosition, setPortalPosition] = useState({ top: 0, left: 0 });\n\n const calculatePositionOfPopover = (position: string = 'bottom-center') => {\n if (!srcElementRef.current) return { top: 0, left: 0 };\n\n let localPosition = position;\n\n const srcRect = srcElementRef.current.getBoundingClientRect();\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n\n // Calculate position for portal\n let top = 0;\n let left = 0;\n\n switch (localPosition) {\n case 'bottom-left':\n top = srcRect.bottom;\n left = srcRect.left;\n break;\n case 'bottom-right':\n top = srcRect.bottom;\n left = srcRect.right - srcRect.width * 0.5;\n break;\n case 'bottom-center':\n top = srcRect.bottom;\n // Center the popover relative to the source element\n left = srcRect.left + srcRect.width / 2;\n break;\n case 'top-left':\n top = srcRect.top - srcRect.height * 1.9;\n left = srcRect.left;\n break;\n case 'top-right':\n top = srcRect.top - srcRect.height * 1.9;\n left = srcRect.right - srcRect.width * 0.5;\n break;\n case 'top-center':\n top = srcRect.top - srcRect.height * 1.9;\n // Center the popover relative to the source element\n left = srcRect.left + srcRect.width / 2;\n break;\n default:\n top = srcRect.bottom;\n left = srcRect.left;\n break;\n }\n\n // Get popover dimensions if available\n const popoverRect = popoverContentRef.current?.getBoundingClientRect();\n const popoverWidth = popoverRect?.width || 0;\n const popoverHeight = popoverRect?.height || 0;\n\n // Adjust center positions to account for popover width\n if (localPosition === 'bottom-center' || localPosition === 'top-center') {\n // Center the popover by subtracting half its width from the source center\n left = left - popoverWidth / 2;\n }\n\n // Adjust position to keep popover within viewport bounds\n // Horizontal adjustments\n if (left + popoverWidth > viewportWidth) {\n // Popover extends beyond right edge, shift it left\n left = Math.max(0, viewportWidth - popoverWidth);\n }\n if (left < 0) {\n // Popover extends beyond left edge, shift it right\n left = 0;\n }\n\n // Vertical adjustments\n if (top + popoverHeight > viewportHeight) {\n // Popover extends beyond bottom edge\n // Try to position it above the source element\n const spaceAbove = srcRect.top;\n const spaceBelow = viewportHeight - srcRect.bottom;\n\n if (spaceAbove >= popoverHeight || spaceAbove > spaceBelow) {\n // Position above if there's enough space or more space above\n top = srcRect.top - popoverHeight;\n // Ensure it doesn't go above viewport\n if (top < 0) {\n top = 0;\n }\n } else {\n // Keep at bottom but adjust to fit within viewport\n top = Math.max(0, viewportHeight - popoverHeight);\n }\n }\n if (top < 0) {\n // Popover extends beyond top edge, position it below the source element\n top = srcRect.bottom;\n // Ensure it doesn't go below viewport\n if (top + popoverHeight > viewportHeight) {\n top = Math.max(0, viewportHeight - popoverHeight);\n }\n }\n\n return { top, left };\n };\n\n useEffect(() => {\n if (onPopoverToggle) {\n onPopoverToggle(displayPopover);\n }\n\n if (displayPopover && !isWithPortal) {\n // Add click listener for auto-close behavior only if not disabled\n if (!disableAutoClose) {\n document.body.addEventListener('click', clickListener, true);\n }\n checkPopoverPosition();\n return () => {\n if (!disableAutoClose) {\n document.body.removeEventListener('click', clickListener, true);\n }\n };\n } else if (displayPopover && isWithPortal) {\n // Add click/scroll listeners for auto-close behavior only if not disabled\n if (!disableAutoClose) {\n document.body.addEventListener('click', clickAndScrollListenerWithPortal, true);\n window.addEventListener('scroll', clickAndScrollListenerWithPortal);\n } else {\n // When disableAutoClose is true, still listen to scroll for repositioning\n window.addEventListener('scroll', scrollListenerForRepositioning);\n }\n // Always add resize listener for repositioning\n window.addEventListener('resize', resizeListenerWithPortal);\n\n // Initial position calculation\n const timeout1 = setTimeout(() => {\n const position = calculatePositionOfPopover(popoverPosition);\n checkSourceVisibility();\n\n if (position) {\n setPortalPosition(position);\n }\n }, 0);\n\n // Recalculate after popover is rendered to get accurate dimensions\n const timeout2 = setTimeout(() => {\n const position = calculatePositionOfPopover(popoverPosition);\n if (position) {\n setPortalPosition(position);\n }\n }, 10);\n\n return () => {\n if (!disableAutoClose) {\n document.body.removeEventListener('click', clickAndScrollListenerWithPortal, true);\n window.removeEventListener('scroll', clickAndScrollListenerWithPortal);\n } else {\n window.removeEventListener('scroll', scrollListenerForRepositioning);\n }\n window.removeEventListener('resize', resizeListenerWithPortal);\n clearTimeout(timeout1);\n clearTimeout(timeout2);\n };\n }\n }, [displayPopover, isWithPortal, disableAutoClose]);\n\n const checkSourceVisibility = () => {\n if (!srcElementRef.current) {\n setIsSrcElementVisible(false);\n return;\n }\n\n const rec = srcElementRef.current.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const viewportWidth = window.innerWidth;\n\n const isVisible = rec.top < viewportHeight && rec.bottom > 0 && rec.left < viewportWidth && rec.right > 0;\n\n setIsSrcElementVisible(isVisible);\n };\n\n useEffect(() => {\n setDisplayPopover(isPopoverOpen ?? false);\n }, [isPopoverOpen]);\n\n useEffect(() => {\n // Focus first focusable element when popover opens\n if (displayPopover && popoverContentRef.current) {\n setTimeout(() => {\n const firstFocusable = popoverContentRef.current?.querySelector<HTMLElement>(focusableSelectors);\n if (firstFocusable && document.activeElement === srcElementRef.current) {\n firstFocusable.focus();\n }\n }, 0);\n }\n }, [displayPopover]);\n\n //Function to check popover position\n const checkPopoverPosition = () => {\n if (!popoverContentRef.current) return;\n\n const popoverRect = popoverContentRef.current.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n\n if (popoverRect?.bottom > viewportHeight) {\n setPopoverPosition(\n position.includes('left') ? 'top-left' : position.includes('right') ? 'top-right' : 'top-center'\n );\n } else if (popoverRect?.top < 0) {\n // If popover extends beyond top of viewport, switch to bottom position\n setPopoverPosition(\n position.includes('left') ? 'bottom-left' : position.includes('right') ? 'bottom-right' : 'bottom-center'\n );\n }\n };\n\n const clickListener = (event: MouseEvent) => {\n const currentDropRef = srcElementRef.current;\n if (!currentDropRef) return;\n\n const target = event.target as Node;\n const isSourcePopover = currentDropRef.contains(target);\n const isPopoverContent = popoverContentRef.current?.contains(target);\n\n // Check if click is on another popover's source element\n const clickedElement = target as HTMLElement;\n const closestPopoverWrapper = clickedElement.closest?.('.se-design-popover-wrapper');\n const isAnotherPopoverSource = closestPopoverWrapper && closestPopoverWrapper !== currentDropRef;\n\n // check if the clicked popover is a nesteded child of the current popover content\n const isNestedPopover = popoverContentRef.current?.contains(closestPopoverWrapper as Node);\n\n // if clicked source is parent or the popover-content, do not toggle dropdown.\n // Also close if clicking on another popover's source element\n if (disableAutoClose) return;\n if ((!isSourcePopover && !isPopoverContent) || (isAnotherPopoverSource && !isNestedPopover)) {\n setDisplayPopover(false);\n }\n };\n\n const clickAndScrollListenerWithPortal = (event: Event) => {\n const currentDropRef = srcElementRef.current;\n const currentPopoverRef = popoverContentRef.current;\n if (!currentDropRef) return;\n checkSourceVisibility();\n\n // Recalculate position on scroll\n if (event.type === 'scroll' && displayPopover) {\n const position = calculatePositionOfPopover(popoverPosition);\n if (position) {\n setPortalPosition(position);\n }\n }\n\n const target = event.target as Node;\n const isSourcePopover = currentDropRef.contains(target);\n const isPopoverContent = currentPopoverRef?.contains(target);\n\n // Check if click is on another popover's source element\n const clickedElement = target as HTMLElement;\n const closestPopoverWrapper = clickedElement.closest?.('.se-design-popover-wrapper');\n const isAnotherPopoverSource = closestPopoverWrapper && closestPopoverWrapper !== currentDropRef;\n\n // check if the clicked popover is a nesteded child of the current popover content\n const isNestedPopover = popoverContentRef.current?.contains(closestPopoverWrapper as Node);\n\n if (disableAutoClose) return;\n // if clicked source is parent or the popover-content, do not toggle dropdown.\n // Also close if clicking on another popover's source element\n if ((!isSourcePopover && !isPopoverContent) || (isAnotherPopoverSource && !isNestedPopover)) {\n setDisplayPopover(false);\n }\n };\n\n const resizeListenerWithPortal = () => {\n if (displayPopover && isWithPortal && srcElementRef.current) {\n checkSourceVisibility();\n const position = calculatePositionOfPopover(popoverPosition);\n if (position) {\n setPortalPosition(position);\n }\n }\n };\n\n const scrollListenerForRepositioning = () => {\n if (displayPopover && isWithPortal && srcElementRef.current) {\n checkSourceVisibility();\n const position = calculatePositionOfPopover(popoverPosition);\n if (position) {\n setPortalPosition(position);\n }\n }\n };\n\n const togglePopover = (focusFirst: boolean | 'last' = false) => {\n const wasOpen = displayPopover;\n setDisplayPopover((prev) => !prev);\n if (!wasOpen && focusFirst) {\n setTimeout(() => {\n if (focusFirst === 'last') {\n const allFocusable = popoverContentRef.current?.querySelectorAll<HTMLElement>(focusableSelectors);\n const lastFocusable = allFocusable ? allFocusable[allFocusable.length - 1] : null;\n if (lastFocusable) lastFocusable.focus();\n } else {\n const firstFocusable = popoverContentRef.current?.querySelector<HTMLElement>(focusableSelectors);\n if (firstFocusable) firstFocusable.focus();\n }\n }, 50);\n }\n };\n\n const handleArrowKeyNavigation = (e: React.KeyboardEvent, container: HTMLDivElement | null) => {\n if (!container) return;\n\n // Find all focusable elements within the popover content\n // This includes elements with role=\"menuitem\", role=\"option\", tabIndex >= 0, etc.\n const focusableSelectors = [\n '[role=\"menuitem\"]',\n '[role=\"option\"]',\n '[role=\"menuitemcheckbox\"]',\n '[role=\"menuitemradio\"]',\n 'button:not([disabled])',\n 'a[href]',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])'\n ].join(', ');\n\n const focusableElements = Array.from(container.querySelectorAll<HTMLElement>(focusableSelectors)).filter((el) => {\n // Filter out disabled and hidden elements\n const style = window.getComputedStyle(el);\n return (\n !el.hasAttribute('disabled') &&\n !el.hasAttribute('aria-disabled') &&\n style.display !== 'none' &&\n style.visibility !== 'hidden' &&\n (el.tabIndex >= 0 || el.hasAttribute('role'))\n );\n });\n\n if (focusableElements.length === 0) return;\n\n const currentIndex = focusableElements.findIndex((el) => el === document.activeElement);\n let nextIndex = -1;\n\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n e.stopPropagation();\n nextIndex = currentIndex < focusableElements.length - 1 ? currentIndex + 1 : 0;\n } else if (e.key === 'ArrowUp') {\n e.preventDefault();\n e.stopPropagation();\n nextIndex = currentIndex > 0 ? currentIndex - 1 : focusableElements.length - 1;\n } else if (e.key === 'Home') {\n e.preventDefault();\n e.stopPropagation();\n nextIndex = 0;\n } else if (e.key === 'End') {\n e.preventDefault();\n e.stopPropagation();\n nextIndex = focusableElements.length - 1;\n }\n\n if (nextIndex >= 0 && focusableElements[nextIndex]) {\n focusableElements[nextIndex].focus();\n } else if (currentIndex === -1 && focusableElements.length > 0) {\n // If no element is currently focused, focus the first one\n focusableElements[0].focus();\n }\n };\n\n const handlePopoverContentKeyDown = (e: React.KeyboardEvent) => {\n // Allow Escape key to close popover when focus is on content\n if (e.key === 'Escape') {\n e.preventDefault();\n e.stopPropagation();\n setDisplayPopover(false);\n srcElementRef.current?.focus();\n } else if (e.key === 'Tab') {\n // Close popover when Tab exits the menu\n setDisplayPopover(false);\n if (e.shiftKey) {\n // Shift+Tab: prevent default (would go to wrapper) and focus trigger instead\n e.preventDefault();\n srcElementRef.current?.focus();\n }\n // Forward Tab: do NOT preventDefault — browser moves focus to next element naturally\n } else if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'Home' || e.key === 'End') {\n // Handle arrow key navigation for focusable elements inside popover\n handleArrowKeyNavigation(e, popoverContentRef.current);\n } else if (e.key === 'Enter' || e.key === ' ') {\n // Prevent Enter/Space from bubbling to wrapper (mirrors click stopPropagation)\n e.stopPropagation();\n }\n };\n\n useImperativeHandle(ref, () => ({ togglePopover }), []);\n\n const popoverContentStyle = {\n 'bottom-left': { left: '0', top: '100%' },\n 'bottom-right': { right: '0', top: '100%' },\n 'bottom-center': { left: '50%', transform: 'translateX(-50%)', top: '100%' },\n 'top-left': { left: '0', bottom: '100%' },\n 'top-right': { right: '0', bottom: '100%' },\n 'top-center': { left: '50%', transform: 'translateX(-50%)', bottom: '100%' }\n };\n const popoverContentClasses = noBorder ? '' : 'shadow-md border rounded-md';\n\n return (\n <div\n className={\n 'se-design-popover-wrapper cursor-pointer relative focus-outline rounded-md' +\n (className.length > 0 ? ` ${className}` : '') +\n (displayPopover ? ' open' : '') +\n (disabled ? ' opacity-50 cursor-not-allowed pointer-events-none' : '')\n }\n ref={srcElementRef}\n onClick={(e) => {\n if (disabled || disableClickToggle) return;\n e.stopPropagation();\n togglePopover();\n }}\n onKeyDown={(e) => {\n if (disabled || disableClickToggle) return;\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n const wasOpen = displayPopover;\n togglePopover();\n // Focus first focusable element when opening\n if (!wasOpen) {\n setTimeout(() => {\n const currentRef = popoverContentRef.current;\n if (currentRef) {\n const firstFocusable = currentRef.querySelector<HTMLElement>(focusableSelectors);\n if (firstFocusable) {\n firstFocusable.focus();\n }\n }\n }, 0);\n }\n } else if (e.key === 'Escape' && displayPopover) {\n e.preventDefault();\n e.stopPropagation();\n setDisplayPopover(false);\n } else if ((e.key === 'ArrowDown' || e.key === 'ArrowUp') && displayPopover) {\n // Handle arrow keys when popover is open\n const currentRef = popoverContentRef.current;\n if (currentRef) {\n handleArrowKeyNavigation(e, currentRef);\n }\n } else if (e.key === 'ArrowDown' && !displayPopover) {\n // Open popover and focus first item when ArrowDown is pressed\n e.preventDefault();\n e.stopPropagation();\n setDisplayPopover(true);\n setTimeout(() => {\n const currentRef = popoverContentRef.current;\n if (currentRef) {\n const firstFocusable = currentRef.querySelector<HTMLElement>(focusableSelectors);\n if (firstFocusable) {\n firstFocusable.focus();\n }\n }\n }, 0);\n }\n }}\n onBlurCapture={onDismissBlurCapture}\n onBlur={(e) => {\n // Portal content is rendered outside wrapper, so keep explicit check for that case.\n if (!displayPopover || disableAutoClose || !isWithPortal) return;\n\n const nextFocused = e.relatedTarget as Node | null;\n const isFocusInSource = !!(nextFocused && srcElementRef.current?.contains(nextFocused));\n const isFocusInPopover = !!(nextFocused && popoverContentRef.current?.contains(nextFocused));\n\n // Close only when focus leaves both source and portal content.\n if (!isFocusInSource && !isFocusInPopover) {\n setDisplayPopover(false);\n }\n }}\n role={disableClickToggle ? 'none' : sourceRole}\n aria-expanded={disableClickToggle ? undefined : displayPopover ? 'true' : 'false'}\n aria-haspopup={disableClickToggle ? undefined : sourceRole === 'combobox' ? 'listbox' : 'true'}\n tabIndex={disabled || disableClickToggle ? -1 : 0}\n aria-disabled={disableClickToggle ? undefined : disabled ? 'true' : 'false'}\n {...accessibleNameProps}\n data-automation-id={automationId}\n {...props}\n >\n {renderPopoverSrcElement({ displayPopover, togglePopover })}\n\n {displayPopover && !isWithPortal && (\n <div\n className={`popover-content absolute ${popoverContentClasses} z-[1000] ${\n contentWidth == 'full' ? 'w-full' : 'w-max'\n }`}\n style={{\n ...popoverContentStyleProperty,\n ...popoverContentStyle[popoverPosition]\n }}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={handlePopoverContentKeyDown}\n ref={popoverContentRef}\n data-automation-id={popoverContentAutomationId}\n >\n {renderPopoverContents({ closePopoverCb: () => setDisplayPopover(false) })}\n </div>\n )}\n {isWithPortal &&\n displayPopover &&\n isSrcElementVisible &&\n ReactDOM.createPortal(\n <div\n className={`popover-content-with-portal ${popoverContentClasses} ${\n contentWidth == 'full' ? 'w-full' : 'w-max'\n }`}\n style={{\n position: 'fixed',\n top: portalPosition.top,\n left: portalPosition.left,\n ...popoverContentStyleProperty\n }}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={handlePopoverContentKeyDown}\n ref={popoverContentRef}\n data-automation-id={popoverContentAutomationId}\n >\n {renderPopoverContents({ closePopoverCb: () => setDisplayPopover(false) })}\n </div>,\n document.body\n )}\n </div>\n );\n }\n);\n"],"names":["focusableSelectors","join","Popover","className","automationId","position","popoverContentAutomationId","contentWidth","renderPopoverContents","renderPopoverSrcElement","onPopoverToggle","isPopoverOpen","disabled","isWithPortal","ariaLabel","ariaLabelledBy","sourceRole","popoverContentStyleProperty","zIndex","borderColor","color","backgroundColor","disableClickToggle","noBorder","disableAutoClose","props","ref","displayPopover","setDisplayPopover","useState","popoverPosition","setPopoverPosition","isSrcElementVisible","setIsSrcElementVisible","srcElementRef","useRef","popoverContentRef","accessibleNameProps","getA11yNameAttributes","ariaDescribedBy","undefined","onBlurCapture","onDismissBlurCapture","useDismissOnFocusOut","onFocusOut","closeOnEscape","portalPosition","setPortalPosition","top","left","calculatePositionOfPopover","current","localPosition","srcRect","getBoundingClientRect","viewportWidth","window","innerWidth","viewportHeight","innerHeight","bottom","right","width","height","popoverRect","popoverWidth","popoverHeight","Math","max","spaceAbove","spaceBelow","useEffect","document","body","addEventListener","clickListener","checkPopoverPosition","removeEventListener","scrollListenerForRepositioning","clickAndScrollListenerWithPortal","resizeListenerWithPortal","timeout1","setTimeout","checkSourceVisibility","timeout2","clearTimeout","rec","isVisible","firstFocusable","querySelector","activeElement","focus","includes","event","currentDropRef","target","isSourcePopover","contains","isPopoverContent","closestPopoverWrapper","closest","isAnotherPopoverSource","isNestedPopover","currentPopoverRef","type","togglePopover","focusFirst","wasOpen","prev","allFocusable","querySelectorAll","lastFocusable","length","handleArrowKeyNavigation","e","container","focusableElements","Array","from","filter","el","style","getComputedStyle","hasAttribute","display","visibility","tabIndex","currentIndex","findIndex","nextIndex","key","preventDefault","stopPropagation","handlePopoverContentKeyDown","shiftKey","useImperativeHandle","popoverContentStyle","transform","popoverContentClasses","React","createElement","_extends","onClick","onKeyDown","currentRef","onBlur","nextFocused","relatedTarget","isFocusInSource","isFocusInPopover","role","closePopoverCb","ReactDOM","createPortal"],"mappings":";;;;;;;;;;;;;AAIA,MAAMA,IAAqB,CACzB,qBAAqB,mBAAmB,6BACxC,0BAA0B,0BAA0B,WACpD,iCAAiC,EACjCC,KAAK,IAAI,GA2BEC,wBACX,CACE;AAAA,EACEC,WAAAA,IAAY;AAAA,EACZC,cAAAA,IAAe;AAAA,EACfC,UAAAA,IAAW;AAAA,EACXC,4BAAAA,IAA6B;AAAA,EAC7BC,cAAAA,IAAe;AAAA,EACfC,uBAAAA;AAAAA,EACAC,yBAAAA;AAAAA,EACAC,iBAAAA;AAAAA,EACAC,eAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,cAAAA,IAAe;AAAA,EACfC,WAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,YAAAA,IAAa;AAAA,EACbC,6BAAAA,IAA8B;AAAA,IAC5BC,QAAQ;AAAA,IACRC,aAAa;AA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,SAAU5B,CAAAA,MAAMA,EAAEkB,gBAAAA;AAAAA,IAClBW,WAAWV;AAAAA,IACX3G,KAAKU;AAAAA,IACL,sBAAoB9B;AAAAA,EAAAA,GAEnBE,EAAsB;AAAA,IAAE+I,gBAAgBA,MAAM3H,EAAkB,EAAK;AAAA,EAAA,CAAG,CACtE,GAENf,KACCc,KACAK,MACAwH,gBAAAA,GAASC,aACPd,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IACEzI,WAAW,+BAA+BuI,CAAqB,IAC7DnI,KAAgB,SAAS,WAAW,OAAO;AAAA,IAE7CkH,OAAO;AAAA,MACLpH,UAAU;AAAA,MACV2C,KAAKF,EAAeE;AAAAA,MACpBC,MAAMH,EAAeG;AAAAA,MACrB,GAAGhC;AAAAA,IAAAA;AAAAA,IAEL6H,SAAU5B,CAAAA,MAAMA,EAAEkB,gBAAAA;AAAAA,IAClBW,WAAWV;AAAAA,IACX3G,KAAKU;AAAAA,IACL,sBAAoB9B;AAAAA,EAAAA,GAEnBE,EAAsB;AAAA,IAAE+I,gBAAgBA,MAAM3H,EAAkB,EAAK;AAAA,EAAA,CAAG,CACtE,GACL4C,SAASC,IACX,CACC;AAET,CACF;"}
|
package/dist/index192.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRef as n } from "react";
|
|
2
|
-
import { useFocusTrap as d } from "./
|
|
3
|
-
import { useDismissOnEscape as u } from "./
|
|
2
|
+
import { useFocusTrap as d } from "./index193.js";
|
|
3
|
+
import { useDismissOnEscape as u } from "./index194.js";
|
|
4
4
|
import { getA11yNameAttributes as c } from "./index71.js";
|
|
5
5
|
import { useStableId as f } from "./index190.js";
|
|
6
6
|
function I({
|