se-design 1.0.83-dev.3 → 1.0.83-dev.5
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 +7 -1
- package/dist/components/Header/index.d.ts +2 -2
- package/dist/index13.js +48 -34
- package/dist/index13.js.map +1 -1
- package/dist/index19.js +176 -158
- package/dist/index19.js.map +1 -1
- package/dist/index20.js +10 -9
- package/dist/index20.js.map +1 -1
- package/dist/index72.js +46 -46
- package/dist/index72.js.map +1 -1
- package/dist/index79.js +30 -33
- package/dist/index79.js.map +1 -1
- package/package.json +1 -1
package/dist/index19.js
CHANGED
|
@@ -1,250 +1,265 @@
|
|
|
1
|
-
import B, { forwardRef as
|
|
1
|
+
import B, { forwardRef as ge, useState as F, useRef as oe, useEffect as M, useImperativeHandle as we } from "react";
|
|
2
2
|
import he from "react-dom";
|
|
3
3
|
import { getA11yNameAttributes as be } from "./index81.js";
|
|
4
|
-
import { useDismissOnFocusOut as
|
|
5
|
-
import { getFirstFocusableElement as
|
|
4
|
+
import { useDismissOnFocusOut as Ee } from "./index80.js";
|
|
5
|
+
import { getFirstFocusableElement as R, getLastFocusableElement as ye, getFocusableElements as T, FOCUSABLE_WITH_ROLES_SELECTOR as ke } from "./index71.js";
|
|
6
6
|
import "./index72.js";
|
|
7
7
|
import { useRegisterPortalWithFocusTrap as Pe } from "./index208.js";
|
|
8
|
-
function
|
|
9
|
-
return
|
|
10
|
-
for (var
|
|
11
|
-
var m = arguments[
|
|
8
|
+
function C() {
|
|
9
|
+
return C = Object.assign ? Object.assign.bind() : function(b) {
|
|
10
|
+
for (var E = 1; E < arguments.length; E++) {
|
|
11
|
+
var m = arguments[E];
|
|
12
12
|
for (var h in m) ({}).hasOwnProperty.call(m, h) && (b[h] = m[h]);
|
|
13
13
|
}
|
|
14
14
|
return b;
|
|
15
|
-
},
|
|
15
|
+
}, C.apply(null, arguments);
|
|
16
16
|
}
|
|
17
|
-
const
|
|
17
|
+
const Se = /* @__PURE__ */ ge(({
|
|
18
18
|
className: b = "",
|
|
19
|
-
automationId:
|
|
19
|
+
automationId: E = "",
|
|
20
20
|
position: m = "bottom-center",
|
|
21
21
|
popoverContentAutomationId: h = "",
|
|
22
|
-
contentWidth:
|
|
22
|
+
contentWidth: D = "max",
|
|
23
23
|
renderPopoverContents: K,
|
|
24
|
-
renderPopoverSrcElement:
|
|
24
|
+
renderPopoverSrcElement: ne,
|
|
25
25
|
onPopoverToggle: z,
|
|
26
|
-
isPopoverOpen:
|
|
27
|
-
disabled:
|
|
26
|
+
isPopoverOpen: q,
|
|
27
|
+
disabled: y = !1,
|
|
28
28
|
isWithPortal: f = !1,
|
|
29
|
-
ariaLabel:
|
|
30
|
-
ariaLabelledBy:
|
|
31
|
-
sourceRole:
|
|
32
|
-
popupType:
|
|
33
|
-
popoverContentStyleProperty:
|
|
29
|
+
ariaLabel: re,
|
|
30
|
+
ariaLabelledBy: se,
|
|
31
|
+
sourceRole: _ = "button",
|
|
32
|
+
popupType: $ = "true",
|
|
33
|
+
popoverContentStyleProperty: U = {
|
|
34
34
|
zIndex: 1e3,
|
|
35
35
|
borderColor: "var(--color-gray-200)",
|
|
36
36
|
color: "var(--color-gray-900)",
|
|
37
37
|
backgroundColor: "var(--color-white)"
|
|
38
38
|
},
|
|
39
|
-
disableClickToggle:
|
|
40
|
-
noBorder:
|
|
39
|
+
disableClickToggle: w = !1,
|
|
40
|
+
noBorder: ce = !1,
|
|
41
41
|
disableAutoClose: v = !1,
|
|
42
|
-
focusFirstOnOpen:
|
|
43
|
-
...
|
|
42
|
+
focusFirstOnOpen: O = !1,
|
|
43
|
+
...ie
|
|
44
44
|
}, ae) => {
|
|
45
|
-
const [
|
|
46
|
-
Pe(
|
|
45
|
+
const [c, p] = F(!1), [k, V] = F(m), [le, X] = F(!1), l = oe(null), i = oe(null);
|
|
46
|
+
Pe(i, f && c);
|
|
47
47
|
const ue = be({
|
|
48
|
-
ariaLabel:
|
|
49
|
-
ariaLabelledBy:
|
|
48
|
+
ariaLabel: re,
|
|
49
|
+
ariaLabelledBy: se,
|
|
50
50
|
ariaDescribedBy: void 0
|
|
51
51
|
// Popover doesn't support describedBy yet
|
|
52
52
|
}), {
|
|
53
53
|
onBlurCapture: fe
|
|
54
|
-
} =
|
|
55
|
-
disabled: !
|
|
54
|
+
} = Ee({
|
|
55
|
+
disabled: !c || v || f,
|
|
56
56
|
onFocusOut: () => p(!1),
|
|
57
57
|
closeOnEscape: !1
|
|
58
58
|
}), [L, A] = F({
|
|
59
59
|
top: 0,
|
|
60
60
|
left: 0,
|
|
61
61
|
srcWidth: 0
|
|
62
|
-
}), [pe,
|
|
63
|
-
|
|
62
|
+
}), [pe, j] = F(!1), P = () => {
|
|
63
|
+
w ? (R({
|
|
64
64
|
container: l.current,
|
|
65
65
|
includeRoles: !0
|
|
66
66
|
}) ?? l.current)?.focus() : l.current?.focus();
|
|
67
|
-
},
|
|
67
|
+
}, W = (e) => {
|
|
68
68
|
p(!1), e?.returnFocus !== !1 && requestAnimationFrame(() => {
|
|
69
69
|
e?.returnFocusTo ? (e.returnFocusTo instanceof HTMLElement ? e.returnFocusTo : e.returnFocusTo.current)?.focus() : P();
|
|
70
70
|
});
|
|
71
|
-
},
|
|
71
|
+
}, H = (e = "bottom-center") => {
|
|
72
72
|
if (!l.current) return {
|
|
73
73
|
top: 0,
|
|
74
74
|
left: 0,
|
|
75
75
|
srcWidth: 0
|
|
76
76
|
};
|
|
77
77
|
let o = e;
|
|
78
|
-
const t = l.current.getBoundingClientRect(),
|
|
79
|
-
let
|
|
78
|
+
const t = l.current.getBoundingClientRect(), n = window.innerWidth - document.documentElement.clientWidth, u = window.innerWidth - Math.max(n, 16), a = window.innerHeight;
|
|
79
|
+
let r = 0, s = 0;
|
|
80
80
|
switch (o) {
|
|
81
81
|
case "bottom-left":
|
|
82
|
-
|
|
82
|
+
r = t.bottom, s = t.left;
|
|
83
83
|
break;
|
|
84
84
|
case "bottom-right":
|
|
85
|
-
|
|
85
|
+
r = t.bottom, s = t.right - t.width * 0.5;
|
|
86
86
|
break;
|
|
87
87
|
case "bottom-center":
|
|
88
|
-
|
|
88
|
+
r = t.bottom, s = t.left + t.width / 2;
|
|
89
89
|
break;
|
|
90
90
|
case "top-left":
|
|
91
|
-
|
|
91
|
+
r = t.top - t.height * 1.9, s = t.left;
|
|
92
92
|
break;
|
|
93
93
|
case "top-right":
|
|
94
|
-
|
|
94
|
+
r = t.top - t.height * 1.9, s = t.right - t.width * 0.5;
|
|
95
95
|
break;
|
|
96
96
|
case "top-center":
|
|
97
|
-
|
|
97
|
+
r = t.top - t.height * 1.9, s = t.left + t.width / 2;
|
|
98
98
|
break;
|
|
99
99
|
default:
|
|
100
|
-
|
|
100
|
+
r = t.bottom, s = t.left;
|
|
101
101
|
break;
|
|
102
102
|
}
|
|
103
|
-
const d =
|
|
104
|
-
if ((o === "bottom-center" || o === "top-center") && (s = s - x / 2), s + x > u && (s = Math.max(0, u - x)), s < 0 && (s = 0),
|
|
105
|
-
const
|
|
106
|
-
|
|
103
|
+
const d = i.current?.getBoundingClientRect(), x = (D === "full" ? Math.max(t.width, d?.width || 0) : d?.width) || 0, g = d?.height || 0;
|
|
104
|
+
if ((o === "bottom-center" || o === "top-center") && (s = s - x / 2), s + x > u && (s = Math.max(0, u - x)), s < 0 && (s = 0), r + g > a) {
|
|
105
|
+
const te = t.top, ve = a - t.bottom;
|
|
106
|
+
te >= g || te > ve ? (r = t.top - g, r < 48 && (r = 48)) : r = Math.max(48, a - g);
|
|
107
107
|
}
|
|
108
|
-
return
|
|
109
|
-
top: Math.round(
|
|
108
|
+
return r < 48 && (r = t.bottom, r + g > a && (r = Math.max(48, a - g))), {
|
|
109
|
+
top: Math.round(r),
|
|
110
110
|
left: Math.round(s),
|
|
111
111
|
srcWidth: t.width
|
|
112
112
|
};
|
|
113
113
|
};
|
|
114
114
|
M(() => {
|
|
115
|
-
if (z && z(
|
|
116
|
-
return v || document.body.addEventListener("click",
|
|
117
|
-
v || document.body.removeEventListener("click",
|
|
115
|
+
if (z && z(c), c && !f)
|
|
116
|
+
return v || document.body.addEventListener("click", Y, !0), de(), () => {
|
|
117
|
+
v || document.body.removeEventListener("click", Y, !0);
|
|
118
118
|
};
|
|
119
|
-
if (
|
|
120
|
-
v ? window.addEventListener("scroll",
|
|
121
|
-
const e = (
|
|
122
|
-
|
|
119
|
+
if (c && f) {
|
|
120
|
+
v ? window.addEventListener("scroll", J) : (document.body.addEventListener("click", I, !0), window.addEventListener("scroll", I)), window.addEventListener("resize", G);
|
|
121
|
+
const e = (n) => {
|
|
122
|
+
n.key === "Escape" && i.current?.contains(document.activeElement) && (n.preventDefault(), n.stopPropagation(), p(!1), requestAnimationFrame(() => P()));
|
|
123
123
|
};
|
|
124
|
-
window.addEventListener("keydown", e, !0),
|
|
124
|
+
window.addEventListener("keydown", e, !0), S();
|
|
125
125
|
let o, t;
|
|
126
126
|
return o = requestAnimationFrame(() => {
|
|
127
127
|
t = requestAnimationFrame(() => {
|
|
128
|
-
const
|
|
129
|
-
|
|
128
|
+
const n = H(k);
|
|
129
|
+
n && A(n), j(!0);
|
|
130
130
|
});
|
|
131
131
|
}), () => {
|
|
132
|
-
v ? window.removeEventListener("scroll",
|
|
132
|
+
v ? window.removeEventListener("scroll", J) : (document.body.removeEventListener("click", I, !0), window.removeEventListener("scroll", I)), window.removeEventListener("resize", G), window.removeEventListener("keydown", e, !0), cancelAnimationFrame(o), cancelAnimationFrame(t), j(!1);
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
-
}, [
|
|
136
|
-
const
|
|
135
|
+
}, [c, f, v]);
|
|
136
|
+
const S = () => {
|
|
137
137
|
if (!l.current) {
|
|
138
|
-
|
|
138
|
+
X(!1);
|
|
139
139
|
return;
|
|
140
140
|
}
|
|
141
|
-
const e = l.current.getBoundingClientRect(), o = window.innerHeight, t = window.innerWidth,
|
|
142
|
-
|
|
141
|
+
const e = l.current.getBoundingClientRect(), o = window.innerHeight, t = window.innerWidth, n = e.top < o && e.bottom > 0 && e.left < t && e.right > 0;
|
|
142
|
+
X(n);
|
|
143
143
|
};
|
|
144
144
|
M(() => {
|
|
145
|
-
p(
|
|
146
|
-
}, [
|
|
147
|
-
|
|
148
|
-
const e =
|
|
149
|
-
container:
|
|
145
|
+
p(q ?? !1);
|
|
146
|
+
}, [q]), M(() => {
|
|
147
|
+
c && setTimeout(() => {
|
|
148
|
+
const e = R({
|
|
149
|
+
container: i.current,
|
|
150
150
|
includeRoles: !0
|
|
151
151
|
});
|
|
152
|
-
|
|
152
|
+
console.log("[Popover open] focus check:", {
|
|
153
|
+
hasFocusable: !!e,
|
|
154
|
+
focusFirstOnOpen: O,
|
|
155
|
+
isSrcFocused: document.activeElement === l.current,
|
|
156
|
+
activeEl: document.activeElement?.className?.slice(0, 50),
|
|
157
|
+
willFocus: !!(e && (O || document.activeElement === l.current)),
|
|
158
|
+
isWithPortal: f,
|
|
159
|
+
hasPortalContent: !!i.current
|
|
160
|
+
}), e && (O || document.activeElement === l.current) && e.focus();
|
|
153
161
|
}, f ? 60 : 0);
|
|
154
|
-
}, [
|
|
162
|
+
}, [c]);
|
|
155
163
|
const de = () => {
|
|
156
|
-
if (!
|
|
157
|
-
const e =
|
|
158
|
-
e?.bottom > o ?
|
|
159
|
-
},
|
|
164
|
+
if (!i.current) return;
|
|
165
|
+
const e = i.current.getBoundingClientRect(), o = window.innerHeight;
|
|
166
|
+
e?.bottom > o ? V(m.includes("left") ? "top-left" : m.includes("right") ? "top-right" : "top-center") : e?.top < 0 && V(m.includes("left") ? "bottom-left" : m.includes("right") ? "bottom-right" : "bottom-center");
|
|
167
|
+
}, Y = (e) => {
|
|
160
168
|
const o = l.current;
|
|
161
169
|
if (!o) return;
|
|
162
|
-
const t = e.target,
|
|
163
|
-
v || (!
|
|
170
|
+
const t = e.target, n = o.contains(t), u = i.current?.contains(t), r = t.closest?.(".se-design-popover-wrapper"), s = r && r !== o, d = i.current?.contains(r);
|
|
171
|
+
v || (!n && !u || s && !d) && p(!1);
|
|
164
172
|
}, I = (e) => {
|
|
165
|
-
const o = l.current, t =
|
|
173
|
+
const o = l.current, t = i.current;
|
|
166
174
|
if (!o) return;
|
|
167
|
-
if (
|
|
168
|
-
const
|
|
169
|
-
|
|
175
|
+
if (S(), e.type === "scroll" && c) {
|
|
176
|
+
const g = H(k);
|
|
177
|
+
g && A(g);
|
|
170
178
|
}
|
|
171
|
-
const
|
|
179
|
+
const n = e.target, u = o.contains(n), a = t?.contains(n), s = n.closest?.(".se-design-popover-wrapper"), d = s && s !== o, x = i.current?.contains(s);
|
|
172
180
|
v || (!u && !a || d && !x) && p(!1);
|
|
173
|
-
},
|
|
174
|
-
if (
|
|
175
|
-
|
|
176
|
-
const e =
|
|
181
|
+
}, G = () => {
|
|
182
|
+
if (c && f && l.current) {
|
|
183
|
+
S();
|
|
184
|
+
const e = H(k);
|
|
177
185
|
e && A(e);
|
|
178
186
|
}
|
|
179
|
-
},
|
|
180
|
-
if (
|
|
181
|
-
|
|
182
|
-
const e =
|
|
187
|
+
}, J = () => {
|
|
188
|
+
if (c && f && l.current) {
|
|
189
|
+
S();
|
|
190
|
+
const e = H(k);
|
|
183
191
|
e && A(e);
|
|
184
192
|
}
|
|
185
|
-
},
|
|
186
|
-
const o =
|
|
193
|
+
}, N = (e = !1) => {
|
|
194
|
+
const o = c;
|
|
187
195
|
p((t) => !t), !o && e && setTimeout(() => {
|
|
188
196
|
if (e === "last") {
|
|
189
|
-
const t =
|
|
190
|
-
container:
|
|
197
|
+
const t = ye({
|
|
198
|
+
container: i.current,
|
|
191
199
|
includeRoles: !0
|
|
192
200
|
});
|
|
193
201
|
t && t.focus();
|
|
194
202
|
} else {
|
|
195
|
-
const t =
|
|
196
|
-
container:
|
|
203
|
+
const t = R({
|
|
204
|
+
container: i.current,
|
|
197
205
|
includeRoles: !0
|
|
198
206
|
});
|
|
199
207
|
t && t.focus();
|
|
200
208
|
}
|
|
201
209
|
}, 50);
|
|
202
|
-
},
|
|
210
|
+
}, Q = (e, o) => {
|
|
203
211
|
if (!o) return;
|
|
204
212
|
const t = document.activeElement;
|
|
205
213
|
if (t?.tagName === "INPUT" || t?.tagName === "TEXTAREA" || t?.tagName === "SELECT")
|
|
206
214
|
return;
|
|
207
|
-
const
|
|
208
|
-
const s = window.getComputedStyle(
|
|
209
|
-
return !
|
|
215
|
+
const n = Array.from(o.querySelectorAll(ke)).filter((r) => {
|
|
216
|
+
const s = window.getComputedStyle(r);
|
|
217
|
+
return !r.hasAttribute("disabled") && r.getAttribute("aria-disabled") !== "true" && s.display !== "none" && s.visibility !== "hidden" && (r.tabIndex >= 0 || r.hasAttribute("role"));
|
|
210
218
|
});
|
|
211
|
-
if (
|
|
212
|
-
const u =
|
|
219
|
+
if (n.length === 0) return;
|
|
220
|
+
const u = n.findIndex((r) => r === document.activeElement);
|
|
213
221
|
let a = -1;
|
|
214
|
-
e.key === "ArrowDown" ? (e.preventDefault(), e.stopPropagation(), a = u <
|
|
215
|
-
|
|
222
|
+
e.key === "ArrowDown" ? (e.preventDefault(), e.stopPropagation(), a = u < n.length - 1 ? u + 1 : 0) : e.key === "ArrowUp" ? (e.preventDefault(), e.stopPropagation(), a = u > 0 ? u - 1 : n.length - 1) : e.key === "Home" ? (e.preventDefault(), e.stopPropagation(), a = 0) : e.key === "End" && (e.preventDefault(), e.stopPropagation(), a = n.length - 1), console.log("[Popover] arrowNav:", {
|
|
223
|
+
focusableCount: n.length,
|
|
224
|
+
currentIndex: u,
|
|
225
|
+
nextIndex: a,
|
|
226
|
+
activeEl: document.activeElement?.tagName,
|
|
227
|
+
activeRole: document.activeElement?.getAttribute("role"),
|
|
228
|
+
firstEl: n[0]?.tagName + "." + n[0]?.className?.slice(0, 30)
|
|
229
|
+
}), a >= 0 && n[a] ? n[a].focus() : u === -1 && n.length > 0 && n[0].focus();
|
|
230
|
+
}, Z = (e) => {
|
|
216
231
|
if (e.key === "Escape")
|
|
217
232
|
e.preventDefault(), e.stopPropagation(), p(!1), requestAnimationFrame(() => P());
|
|
218
233
|
else if (e.key === "Tab") {
|
|
219
|
-
if (
|
|
220
|
-
const o =
|
|
221
|
-
container:
|
|
234
|
+
if ($ === "dialog") {
|
|
235
|
+
const o = T({
|
|
236
|
+
container: i.current,
|
|
222
237
|
filterHidden: !0
|
|
223
|
-
}), t = o.indexOf(e.target),
|
|
238
|
+
}), t = o.indexOf(e.target), n = t === o.length - 1, u = t === 0 || t === -1;
|
|
224
239
|
if (e.shiftKey && u)
|
|
225
240
|
e.preventDefault(), p(!1), P();
|
|
226
|
-
else if (!e.shiftKey &&
|
|
241
|
+
else if (!e.shiftKey && n && (p(!1), f)) {
|
|
227
242
|
e.preventDefault();
|
|
228
|
-
const a = l.current,
|
|
243
|
+
const a = l.current, r = T({
|
|
229
244
|
container: document.body,
|
|
230
245
|
filterHidden: !0
|
|
231
|
-
}), s = a ?
|
|
246
|
+
}), s = a ? r.indexOf(a) : -1, d = r[s + 1];
|
|
232
247
|
d ? d.focus() : a?.focus();
|
|
233
248
|
}
|
|
234
249
|
} else if (p(!1), e.shiftKey)
|
|
235
250
|
e.preventDefault(), P();
|
|
236
251
|
else if (f) {
|
|
237
252
|
e.preventDefault();
|
|
238
|
-
const o = l.current, t =
|
|
253
|
+
const o = l.current, t = T({
|
|
239
254
|
container: document.body,
|
|
240
255
|
filterHidden: !0
|
|
241
|
-
}),
|
|
256
|
+
}), n = o ? t.indexOf(o) : -1, u = t[n + 1];
|
|
242
257
|
u ? u.focus() : o?.focus();
|
|
243
258
|
}
|
|
244
|
-
} else e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Home" || e.key === "End" ?
|
|
259
|
+
} else e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Home" || e.key === "End" ? Q(e, i.current) : (e.key === "Enter" || e.key === " ") && e.stopPropagation();
|
|
245
260
|
};
|
|
246
|
-
|
|
247
|
-
togglePopover:
|
|
261
|
+
we(ae, () => ({
|
|
262
|
+
togglePopover: N,
|
|
248
263
|
focusTrigger: () => l.current?.focus(),
|
|
249
264
|
element: l.current
|
|
250
265
|
}), []);
|
|
@@ -275,33 +290,36 @@ const He = /* @__PURE__ */ we(({
|
|
|
275
290
|
transform: "translateX(-50%)",
|
|
276
291
|
bottom: "100%"
|
|
277
292
|
}
|
|
278
|
-
},
|
|
279
|
-
return /* @__PURE__ */ B.createElement("div",
|
|
280
|
-
className: "se-design-popover-wrapper cursor-pointer relative focus-outline rounded-md" + (b.length > 0 ? ` ${b}` : "") + (
|
|
293
|
+
}, ee = ce ? "" : "shadow-md border rounded-md";
|
|
294
|
+
return /* @__PURE__ */ B.createElement("div", C({
|
|
295
|
+
className: "se-design-popover-wrapper cursor-pointer relative focus-outline rounded-md" + (b.length > 0 ? ` ${b}` : "") + (c ? " open" : "") + (y ? " opacity-50 cursor-not-allowed pointer-events-none" : ""),
|
|
281
296
|
ref: l,
|
|
282
297
|
onClick: (e) => {
|
|
283
|
-
|
|
298
|
+
y || w || (e.stopPropagation(), N());
|
|
284
299
|
},
|
|
285
300
|
onKeyDown: (e) => {
|
|
286
|
-
if (!(
|
|
301
|
+
if (!(y || w))
|
|
287
302
|
if (e.key === "Enter" || e.key === " ") {
|
|
288
303
|
e.preventDefault(), e.stopPropagation();
|
|
289
|
-
const o =
|
|
290
|
-
|
|
291
|
-
const t =
|
|
292
|
-
container:
|
|
304
|
+
const o = c;
|
|
305
|
+
N(), o || setTimeout(() => {
|
|
306
|
+
const t = R({
|
|
307
|
+
container: i.current,
|
|
293
308
|
includeRoles: !0
|
|
294
309
|
});
|
|
295
310
|
t && t.focus();
|
|
296
311
|
}, f ? 60 : 0);
|
|
297
|
-
} else if (e.key === "Escape" &&
|
|
312
|
+
} else if (e.key === "Escape" && c)
|
|
298
313
|
e.preventDefault(), e.stopPropagation(), p(!1);
|
|
299
|
-
else if ((e.key === "ArrowDown" || e.key === "ArrowUp") &&
|
|
300
|
-
const o =
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
314
|
+
else if ((e.key === "ArrowDown" || e.key === "ArrowUp") && c) {
|
|
315
|
+
const o = i.current;
|
|
316
|
+
console.log("[Popover] arrow on wrapper:", {
|
|
317
|
+
key: e.key,
|
|
318
|
+
hasRef: !!o
|
|
319
|
+
}), o && Q(e, o);
|
|
320
|
+
} else e.key === "ArrowDown" && !c && (e.preventDefault(), e.stopPropagation(), p(!0), setTimeout(() => {
|
|
321
|
+
const o = R({
|
|
322
|
+
container: i.current,
|
|
305
323
|
includeRoles: !0
|
|
306
324
|
});
|
|
307
325
|
o && o.focus();
|
|
@@ -309,34 +327,34 @@ const He = /* @__PURE__ */ we(({
|
|
|
309
327
|
},
|
|
310
328
|
onBlurCapture: fe,
|
|
311
329
|
onBlur: (e) => {
|
|
312
|
-
if (!
|
|
313
|
-
const o = e.relatedTarget, t = !!(o && l.current?.contains(o)),
|
|
314
|
-
!t && !
|
|
330
|
+
if (!c || v || !f) return;
|
|
331
|
+
const o = e.relatedTarget, t = !!(o && l.current?.contains(o)), n = !!(o && i.current?.contains(o));
|
|
332
|
+
!t && !n && p(!1);
|
|
315
333
|
},
|
|
316
|
-
role:
|
|
317
|
-
"aria-expanded":
|
|
318
|
-
"aria-haspopup":
|
|
319
|
-
tabIndex:
|
|
320
|
-
"aria-disabled":
|
|
334
|
+
role: w ? "none" : _,
|
|
335
|
+
"aria-expanded": w ? void 0 : c ? "true" : "false",
|
|
336
|
+
"aria-haspopup": w ? void 0 : _ === "combobox" ? "listbox" : $,
|
|
337
|
+
tabIndex: y || w ? -1 : 0,
|
|
338
|
+
"aria-disabled": w ? void 0 : y ? "true" : void 0
|
|
321
339
|
}, ue, {
|
|
322
|
-
"data-automation-id":
|
|
323
|
-
},
|
|
324
|
-
displayPopover:
|
|
325
|
-
togglePopover:
|
|
326
|
-
}),
|
|
327
|
-
className: `popover-content absolute ${
|
|
340
|
+
"data-automation-id": E
|
|
341
|
+
}, ie), ne({
|
|
342
|
+
displayPopover: c,
|
|
343
|
+
togglePopover: N
|
|
344
|
+
}), c && !f && /* @__PURE__ */ B.createElement("div", {
|
|
345
|
+
className: `popover-content absolute ${ee} z-[1000] ${D == "full" ? "w-full" : "w-max"}`,
|
|
328
346
|
style: {
|
|
329
|
-
|
|
347
|
+
...U,
|
|
330
348
|
...me[k]
|
|
331
349
|
},
|
|
332
350
|
onClick: (e) => e.stopPropagation(),
|
|
333
|
-
onKeyDown:
|
|
334
|
-
ref:
|
|
351
|
+
onKeyDown: Z,
|
|
352
|
+
ref: i,
|
|
335
353
|
"data-automation-id": h
|
|
336
354
|
}, K({
|
|
337
|
-
closePopoverCb:
|
|
338
|
-
})), f &&
|
|
339
|
-
className: `popover-content-with-portal z-[2002] ${
|
|
355
|
+
closePopoverCb: W
|
|
356
|
+
})), f && c && le && /* @__PURE__ */ he.createPortal(/* @__PURE__ */ B.createElement("div", {
|
|
357
|
+
className: `popover-content-with-portal z-[2002] ${ee} ${D == "full" ? "" : "w-max"}`,
|
|
340
358
|
style: {
|
|
341
359
|
position: "fixed",
|
|
342
360
|
top: L.top,
|
|
@@ -344,21 +362,21 @@ const He = /* @__PURE__ */ we(({
|
|
|
344
362
|
visibility: pe ? "visible" : "hidden",
|
|
345
363
|
maxHeight: "calc(100vh - 96px)",
|
|
346
364
|
overflowY: "hidden",
|
|
347
|
-
...
|
|
365
|
+
...D === "full" && L.srcWidth ? {
|
|
348
366
|
width: `${L.srcWidth}px`
|
|
349
367
|
} : {},
|
|
350
|
-
|
|
368
|
+
...U,
|
|
351
369
|
zIndex: 2002
|
|
352
370
|
},
|
|
353
371
|
onClick: (e) => e.stopPropagation(),
|
|
354
|
-
onKeyDown:
|
|
355
|
-
ref:
|
|
372
|
+
onKeyDown: Z,
|
|
373
|
+
ref: i,
|
|
356
374
|
"data-automation-id": h
|
|
357
375
|
}, K({
|
|
358
|
-
closePopoverCb:
|
|
376
|
+
closePopoverCb: W
|
|
359
377
|
})), document.body));
|
|
360
378
|
});
|
|
361
379
|
export {
|
|
362
|
-
|
|
380
|
+
Se as Popover
|
|
363
381
|
};
|
|
364
382
|
//# sourceMappingURL=index19.js.map
|