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