@konstructio/ui 0.1.0-alpha.4 → 0.1.0-alpha.6
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/{Combination-Cvr3uETz.js → Combination-Dyw3lLGQ.js} +49 -55
- package/dist/Modal-CdsrVAoM.js +98 -0
- package/dist/{chevron-up-DgLBQCKD.js → chevron-up-RLP4nX7V.js} +1 -1
- package/dist/components/Alert/Alert.js +1 -1
- package/dist/components/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Command/Command.js +1 -1
- package/dist/components/Command/components/Command.js +1 -1
- package/dist/components/Command/components/CommandEmpty.js +1 -1
- package/dist/components/Command/components/CommandGroup.js +1 -1
- package/dist/components/Command/components/CommandInput.js +2 -2
- package/dist/components/Command/components/CommandItem.js +1 -1
- package/dist/components/Command/components/CommandList.js +1 -1
- package/dist/components/Command/components/CommandSeparator.js +1 -1
- package/dist/components/Command/components/DialogContent.js +2 -2
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/Dropdown/components/List/List.js +36 -31
- package/dist/components/Dropdown/components/List/List.variants.js +5 -3
- package/dist/components/Dropdown/components/ListItem/ListItem.js +18 -16
- package/dist/components/Dropdown/components/Wrapper.js +110 -91
- package/dist/components/Dropdown/contexts/dropdown.context.js +6 -2
- package/dist/components/Dropdown/contexts/dropdown.provider.js +18 -11
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +3 -3
- package/dist/components/Modal/components/Wrapper/Wrapper.variants.js +4 -6
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/NumberInput/NumberInput.js +1 -1
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +2 -2
- package/dist/components/Toast/Toast.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{index-BuxebbOg.js → index-CI55pdPK.js} +1 -1
- package/dist/{index-Cz09twLl.js → index-Cj4IZ4ka.js} +1 -1
- package/dist/{index-1RDo-S_f.js → index-Cod3awtw.js} +1 -1
- package/dist/{index-C5psggHV.js → index-h-Ul0anl.js} +1 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -1
- package/dist/package.json +1 -1
- package/dist/styles.css +1 -1
- package/dist/{x-DU-Zw-L_.js → x-BPcqkRZd.js} +1 -1
- package/package.json +1 -1
- package/dist/Modal-DXYBiafI.js +0 -926
package/dist/Modal-DXYBiafI.js
DELETED
|
@@ -1,926 +0,0 @@
|
|
|
1
|
-
import { Body as Mr } from "./components/Modal/components/Body/Body.js";
|
|
2
|
-
import { Footer as _r } from "./components/Modal/components/Footer/Footer.js";
|
|
3
|
-
import { Header as kr } from "./components/Modal/components/Header/Header.js";
|
|
4
|
-
import { jsx as k, jsxs as ee } from "react/jsx-runtime";
|
|
5
|
-
import S, { createContext as Lr, forwardRef as Ue, useState as re, useRef as ne, useCallback as W, useEffect as Ge, useMemo as Rr, Fragment as Cr, PureComponent as Wr, Children as K, isValidElement as X } from "react";
|
|
6
|
-
import { r as Br } from "./index-BCGvACM9.js";
|
|
7
|
-
import { R as Ur } from "./index--EmNlyHx.js";
|
|
8
|
-
import { p as l } from "./index-C5psggHV.js";
|
|
9
|
-
import { c as le, a as Gr, u as Hr, R as jr } from "./Combination-Cvr3uETz.js";
|
|
10
|
-
import { cn as Me } from "./utils/index.js";
|
|
11
|
-
import { buttonCloseVariants as Vr, modalVariants as qr } from "./components/Modal/components/Wrapper/Wrapper.variants.js";
|
|
12
|
-
import { X as $r } from "./x-DU-Zw-L_.js";
|
|
13
|
-
function Kr(e, r) {
|
|
14
|
-
if (e == null) return {};
|
|
15
|
-
var n = {};
|
|
16
|
-
for (var t in e) if ({}.hasOwnProperty.call(e, t)) {
|
|
17
|
-
if (r.indexOf(t) !== -1) continue;
|
|
18
|
-
n[t] = e[t];
|
|
19
|
-
}
|
|
20
|
-
return n;
|
|
21
|
-
}
|
|
22
|
-
function U() {
|
|
23
|
-
return U = Object.assign ? Object.assign.bind() : function(e) {
|
|
24
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
25
|
-
var n = arguments[r];
|
|
26
|
-
for (var t in n) ({}).hasOwnProperty.call(n, t) && (e[t] = n[t]);
|
|
27
|
-
}
|
|
28
|
-
return e;
|
|
29
|
-
}, U.apply(null, arguments);
|
|
30
|
-
}
|
|
31
|
-
var ie = "data-focus-lock", He = "data-focus-lock-disabled", Xr = "data-no-focus-lock", Yr = "data-autofocus-inside", zr = "data-no-autofocus", te = {
|
|
32
|
-
width: "1px",
|
|
33
|
-
height: "0px",
|
|
34
|
-
padding: 0,
|
|
35
|
-
overflow: "hidden",
|
|
36
|
-
position: "fixed",
|
|
37
|
-
top: "1px",
|
|
38
|
-
left: "1px"
|
|
39
|
-
}, je = le({}, function(e) {
|
|
40
|
-
var r = e.target, n = e.currentTarget;
|
|
41
|
-
return {
|
|
42
|
-
target: r,
|
|
43
|
-
currentTarget: n
|
|
44
|
-
};
|
|
45
|
-
}), Ve = le(), Jr = le(), Qr = Gr({
|
|
46
|
-
async: !0,
|
|
47
|
-
ssr: typeof document < "u"
|
|
48
|
-
}), Zr = /* @__PURE__ */ Lr(void 0), en = [], ve = /* @__PURE__ */ Ue(function(r, n) {
|
|
49
|
-
var t, o = re(), u = o[0], a = o[1], c = ne(), v = ne(!1), i = ne(null), h = re({}), s = h[1], f = r.children, b = r.disabled, d = b === void 0 ? !1 : b, m = r.noFocusGuards, g = m === void 0 ? !1 : m, x = r.persistentFocus, p = x === void 0 ? !1 : x, y = r.crossFrame, E = y === void 0 ? !0 : y, w = r.autoFocus, D = w === void 0 ? !0 : w, q = r.allowTextSelection, z = r.group, mr = r.className, br = r.whiteList, pr = r.hasPositiveIndices, Ie = r.shards, J = Ie === void 0 ? en : Ie, Se = r.as, Ne = Se === void 0 ? "div" : Se, Pe = r.lockProps, yr = Pe === void 0 ? {} : Pe, hr = r.sideCar, Te = r.returnFocus, $ = Te === void 0 ? !1 : Te, gr = r.focusOptions, Q = r.onActivation, Z = r.onDeactivation, Fr = re({}), xr = Fr[0], Er = W(function(I) {
|
|
50
|
-
var M = I.captureFocusRestore;
|
|
51
|
-
if (!i.current) {
|
|
52
|
-
var _, P = (_ = document) == null ? void 0 : _.activeElement;
|
|
53
|
-
i.current = P, P !== document.body && (i.current = M(P));
|
|
54
|
-
}
|
|
55
|
-
c.current && Q && Q(c.current), v.current = !0, s();
|
|
56
|
-
}, [Q]), Or = W(function() {
|
|
57
|
-
v.current = !1, Z && Z(c.current), s();
|
|
58
|
-
}, [Z]), wr = W(function(I) {
|
|
59
|
-
var M = i.current;
|
|
60
|
-
if (M) {
|
|
61
|
-
var _ = (typeof M == "function" ? M() : M) || document.body, P = typeof $ == "function" ? $(_) : $;
|
|
62
|
-
if (P) {
|
|
63
|
-
var De = typeof P == "object" ? P : void 0;
|
|
64
|
-
i.current = null, I ? Promise.resolve().then(function() {
|
|
65
|
-
return _.focus(De);
|
|
66
|
-
}) : _.focus(De);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}, [$]), Ir = W(function(I) {
|
|
70
|
-
v.current && je.useMedium(I);
|
|
71
|
-
}, []), Sr = Ve.useMedium, Nr = W(function(I) {
|
|
72
|
-
c.current !== I && (c.current = I, a(I));
|
|
73
|
-
}, []);
|
|
74
|
-
process.env.NODE_ENV !== "production" && (typeof q < "u" && console.warn("React-Focus-Lock: allowTextSelection is deprecated and enabled by default"), Ge(function() {
|
|
75
|
-
!c.current && typeof Ne != "string" && console.error("FocusLock: could not obtain ref to internal node");
|
|
76
|
-
}, []));
|
|
77
|
-
var Pr = U((t = {}, t[He] = d && "disabled", t[ie] = z, t), yr), Ae = g !== !0, Tr = Ae && g !== "tail", Ar = Hr([n, Nr]), Dr = Rr(function() {
|
|
78
|
-
return {
|
|
79
|
-
observed: c,
|
|
80
|
-
shards: J,
|
|
81
|
-
enabled: !d,
|
|
82
|
-
active: v.current
|
|
83
|
-
};
|
|
84
|
-
}, [d, v.current, J, u]);
|
|
85
|
-
return /* @__PURE__ */ S.createElement(Cr, null, Ae && [
|
|
86
|
-
/* @__PURE__ */ S.createElement("div", {
|
|
87
|
-
key: "guard-first",
|
|
88
|
-
"data-focus-guard": !0,
|
|
89
|
-
tabIndex: d ? -1 : 0,
|
|
90
|
-
style: te
|
|
91
|
-
}),
|
|
92
|
-
pr ? /* @__PURE__ */ S.createElement("div", {
|
|
93
|
-
key: "guard-nearest",
|
|
94
|
-
"data-focus-guard": !0,
|
|
95
|
-
tabIndex: d ? -1 : 1,
|
|
96
|
-
style: te
|
|
97
|
-
}) : null
|
|
98
|
-
], !d && /* @__PURE__ */ S.createElement(hr, {
|
|
99
|
-
id: xr,
|
|
100
|
-
sideCar: Qr,
|
|
101
|
-
observed: u,
|
|
102
|
-
disabled: d,
|
|
103
|
-
persistentFocus: p,
|
|
104
|
-
crossFrame: E,
|
|
105
|
-
autoFocus: D,
|
|
106
|
-
whiteList: br,
|
|
107
|
-
shards: J,
|
|
108
|
-
onActivation: Er,
|
|
109
|
-
onDeactivation: Or,
|
|
110
|
-
returnFocus: wr,
|
|
111
|
-
focusOptions: gr,
|
|
112
|
-
noFocusGuards: g
|
|
113
|
-
}), /* @__PURE__ */ S.createElement(Ne, U({
|
|
114
|
-
ref: Ar
|
|
115
|
-
}, Pr, {
|
|
116
|
-
className: mr,
|
|
117
|
-
onBlur: Sr,
|
|
118
|
-
onFocus: Ir
|
|
119
|
-
}), /* @__PURE__ */ S.createElement(Zr.Provider, {
|
|
120
|
-
value: Dr
|
|
121
|
-
}, f)), Tr && /* @__PURE__ */ S.createElement("div", {
|
|
122
|
-
"data-focus-guard": !0,
|
|
123
|
-
tabIndex: d ? -1 : 0,
|
|
124
|
-
style: te
|
|
125
|
-
}));
|
|
126
|
-
});
|
|
127
|
-
ve.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
128
|
-
children: l.node,
|
|
129
|
-
disabled: l.bool,
|
|
130
|
-
returnFocus: l.oneOfType([l.bool, l.object, l.func]),
|
|
131
|
-
focusOptions: l.object,
|
|
132
|
-
noFocusGuards: l.bool,
|
|
133
|
-
hasPositiveIndices: l.bool,
|
|
134
|
-
allowTextSelection: l.bool,
|
|
135
|
-
autoFocus: l.bool,
|
|
136
|
-
persistentFocus: l.bool,
|
|
137
|
-
crossFrame: l.bool,
|
|
138
|
-
group: l.string,
|
|
139
|
-
className: l.string,
|
|
140
|
-
whiteList: l.func,
|
|
141
|
-
shards: l.arrayOf(l.any),
|
|
142
|
-
as: l.oneOfType([l.string, l.func, l.object]),
|
|
143
|
-
lockProps: l.object,
|
|
144
|
-
onActivation: l.func,
|
|
145
|
-
onDeactivation: l.func,
|
|
146
|
-
sideCar: l.any.isRequired
|
|
147
|
-
} : {};
|
|
148
|
-
function ce(e, r) {
|
|
149
|
-
return ce = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, t) {
|
|
150
|
-
return n.__proto__ = t, n;
|
|
151
|
-
}, ce(e, r);
|
|
152
|
-
}
|
|
153
|
-
function rn(e, r) {
|
|
154
|
-
e.prototype = Object.create(r.prototype), e.prototype.constructor = e, ce(e, r);
|
|
155
|
-
}
|
|
156
|
-
function G(e) {
|
|
157
|
-
"@babel/helpers - typeof";
|
|
158
|
-
return G = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) {
|
|
159
|
-
return typeof r;
|
|
160
|
-
} : function(r) {
|
|
161
|
-
return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
|
|
162
|
-
}, G(e);
|
|
163
|
-
}
|
|
164
|
-
function nn(e, r) {
|
|
165
|
-
if (G(e) != "object" || !e) return e;
|
|
166
|
-
var n = e[Symbol.toPrimitive];
|
|
167
|
-
if (n !== void 0) {
|
|
168
|
-
var t = n.call(e, r);
|
|
169
|
-
if (G(t) != "object") return t;
|
|
170
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
171
|
-
}
|
|
172
|
-
return (r === "string" ? String : Number)(e);
|
|
173
|
-
}
|
|
174
|
-
function tn(e) {
|
|
175
|
-
var r = nn(e, "string");
|
|
176
|
-
return G(r) == "symbol" ? r : r + "";
|
|
177
|
-
}
|
|
178
|
-
function on(e, r, n) {
|
|
179
|
-
return (r = tn(r)) in e ? Object.defineProperty(e, r, {
|
|
180
|
-
value: n,
|
|
181
|
-
enumerable: !0,
|
|
182
|
-
configurable: !0,
|
|
183
|
-
writable: !0
|
|
184
|
-
}) : e[r] = n, e;
|
|
185
|
-
}
|
|
186
|
-
function un(e, r) {
|
|
187
|
-
if (process.env.NODE_ENV !== "production") {
|
|
188
|
-
if (typeof e != "function")
|
|
189
|
-
throw new Error("Expected reducePropsToState to be a function.");
|
|
190
|
-
if (typeof r != "function")
|
|
191
|
-
throw new Error("Expected handleStateChangeOnClient to be a function.");
|
|
192
|
-
}
|
|
193
|
-
function n(t) {
|
|
194
|
-
return t.displayName || t.name || "Component";
|
|
195
|
-
}
|
|
196
|
-
return function(o) {
|
|
197
|
-
if (process.env.NODE_ENV !== "production" && typeof o != "function")
|
|
198
|
-
throw new Error("Expected WrappedComponent to be a React component.");
|
|
199
|
-
var u = [], a;
|
|
200
|
-
function c() {
|
|
201
|
-
a = e(u.map(function(i) {
|
|
202
|
-
return i.props;
|
|
203
|
-
})), r(a);
|
|
204
|
-
}
|
|
205
|
-
var v = /* @__PURE__ */ function(i) {
|
|
206
|
-
rn(h, i);
|
|
207
|
-
function h() {
|
|
208
|
-
return i.apply(this, arguments) || this;
|
|
209
|
-
}
|
|
210
|
-
h.peek = function() {
|
|
211
|
-
return a;
|
|
212
|
-
};
|
|
213
|
-
var s = h.prototype;
|
|
214
|
-
return s.componentDidMount = function() {
|
|
215
|
-
u.push(this), c();
|
|
216
|
-
}, s.componentDidUpdate = function() {
|
|
217
|
-
c();
|
|
218
|
-
}, s.componentWillUnmount = function() {
|
|
219
|
-
var b = u.indexOf(this);
|
|
220
|
-
u.splice(b, 1), c();
|
|
221
|
-
}, s.render = function() {
|
|
222
|
-
return /* @__PURE__ */ S.createElement(o, this.props);
|
|
223
|
-
}, h;
|
|
224
|
-
}(Wr);
|
|
225
|
-
return on(v, "displayName", "SideEffect(" + n(o) + ")"), v;
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
var O = function(e) {
|
|
229
|
-
for (var r = Array(e.length), n = 0; n < e.length; ++n)
|
|
230
|
-
r[n] = e[n];
|
|
231
|
-
return r;
|
|
232
|
-
}, A = function(e) {
|
|
233
|
-
return Array.isArray(e) ? e : [e];
|
|
234
|
-
}, qe = function(e) {
|
|
235
|
-
return Array.isArray(e) ? e[0] : e;
|
|
236
|
-
}, an = function(e) {
|
|
237
|
-
if (e.nodeType !== Node.ELEMENT_NODE)
|
|
238
|
-
return !1;
|
|
239
|
-
var r = window.getComputedStyle(e, null);
|
|
240
|
-
return !r || !r.getPropertyValue ? !1 : r.getPropertyValue("display") === "none" || r.getPropertyValue("visibility") === "hidden";
|
|
241
|
-
}, $e = function(e) {
|
|
242
|
-
return e.parentNode && e.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? (
|
|
243
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
244
|
-
e.parentNode.host
|
|
245
|
-
) : e.parentNode;
|
|
246
|
-
}, Ke = function(e) {
|
|
247
|
-
return e === document || e && e.nodeType === Node.DOCUMENT_NODE;
|
|
248
|
-
}, cn = function(e) {
|
|
249
|
-
return e.hasAttribute("inert");
|
|
250
|
-
}, fn = function(e, r) {
|
|
251
|
-
return !e || Ke(e) || !an(e) && !cn(e) && r($e(e));
|
|
252
|
-
}, Xe = function(e, r) {
|
|
253
|
-
var n = e.get(r);
|
|
254
|
-
if (n !== void 0)
|
|
255
|
-
return n;
|
|
256
|
-
var t = fn(r, Xe.bind(void 0, e));
|
|
257
|
-
return e.set(r, t), t;
|
|
258
|
-
}, sn = function(e, r) {
|
|
259
|
-
return e && !Ke(e) ? vn(e) ? r($e(e)) : !1 : !0;
|
|
260
|
-
}, Ye = function(e, r) {
|
|
261
|
-
var n = e.get(r);
|
|
262
|
-
if (n !== void 0)
|
|
263
|
-
return n;
|
|
264
|
-
var t = sn(r, Ye.bind(void 0, e));
|
|
265
|
-
return e.set(r, t), t;
|
|
266
|
-
}, ze = function(e) {
|
|
267
|
-
return e.dataset;
|
|
268
|
-
}, dn = function(e) {
|
|
269
|
-
return e.tagName === "BUTTON";
|
|
270
|
-
}, Je = function(e) {
|
|
271
|
-
return e.tagName === "INPUT";
|
|
272
|
-
}, Qe = function(e) {
|
|
273
|
-
return Je(e) && e.type === "radio";
|
|
274
|
-
}, ln = function(e) {
|
|
275
|
-
return !((Je(e) || dn(e)) && (e.type === "hidden" || e.disabled));
|
|
276
|
-
}, vn = function(e) {
|
|
277
|
-
var r = e.getAttribute(zr);
|
|
278
|
-
return ![!0, "true", ""].includes(r);
|
|
279
|
-
}, me = function(e) {
|
|
280
|
-
var r;
|
|
281
|
-
return !!(e && (!((r = ze(e)) === null || r === void 0) && r.focusGuard));
|
|
282
|
-
}, fe = function(e) {
|
|
283
|
-
return !me(e);
|
|
284
|
-
}, mn = function(e) {
|
|
285
|
-
return !!e;
|
|
286
|
-
}, bn = function(e, r) {
|
|
287
|
-
var n = Math.max(0, e.tabIndex), t = Math.max(0, r.tabIndex), o = n - t, u = e.index - r.index;
|
|
288
|
-
if (o) {
|
|
289
|
-
if (!n)
|
|
290
|
-
return 1;
|
|
291
|
-
if (!t)
|
|
292
|
-
return -1;
|
|
293
|
-
}
|
|
294
|
-
return o || u;
|
|
295
|
-
}, pn = function(e) {
|
|
296
|
-
return e.tabIndex < 0 && !e.hasAttribute("tabindex") ? 0 : e.tabIndex;
|
|
297
|
-
}, be = function(e, r, n) {
|
|
298
|
-
return O(e).map(function(t, o) {
|
|
299
|
-
var u = pn(t);
|
|
300
|
-
return {
|
|
301
|
-
node: t,
|
|
302
|
-
index: o,
|
|
303
|
-
tabIndex: n && u === -1 ? (t.dataset || {}).focusGuard ? 0 : -1 : u
|
|
304
|
-
};
|
|
305
|
-
}).filter(function(t) {
|
|
306
|
-
return !r || t.tabIndex >= 0;
|
|
307
|
-
}).sort(bn);
|
|
308
|
-
}, yn = [
|
|
309
|
-
"button:enabled",
|
|
310
|
-
"select:enabled",
|
|
311
|
-
"textarea:enabled",
|
|
312
|
-
"input:enabled",
|
|
313
|
-
// elements with explicit roles will also use explicit tabindex
|
|
314
|
-
// '[role="button"]',
|
|
315
|
-
"a[href]",
|
|
316
|
-
"area[href]",
|
|
317
|
-
"summary",
|
|
318
|
-
"iframe",
|
|
319
|
-
"object",
|
|
320
|
-
"embed",
|
|
321
|
-
"audio[controls]",
|
|
322
|
-
"video[controls]",
|
|
323
|
-
"[tabindex]",
|
|
324
|
-
"[contenteditable]",
|
|
325
|
-
"[autofocus]"
|
|
326
|
-
], pe = yn.join(","), hn = "".concat(pe, ", [data-focus-guard]"), Ze = function(e, r) {
|
|
327
|
-
return O((e.shadowRoot || e).children).reduce(function(n, t) {
|
|
328
|
-
return n.concat(t.matches(r ? hn : pe) ? [t] : [], Ze(t));
|
|
329
|
-
}, []);
|
|
330
|
-
}, gn = function(e, r) {
|
|
331
|
-
var n;
|
|
332
|
-
return e instanceof HTMLIFrameElement && (!((n = e.contentDocument) === null || n === void 0) && n.body) ? C([e.contentDocument.body], r) : [e];
|
|
333
|
-
}, C = function(e, r) {
|
|
334
|
-
return e.reduce(function(n, t) {
|
|
335
|
-
var o, u = Ze(t, r), a = (o = []).concat.apply(o, u.map(function(c) {
|
|
336
|
-
return gn(c, r);
|
|
337
|
-
}));
|
|
338
|
-
return n.concat(
|
|
339
|
-
// add all tabbables inside and within shadow DOMs in DOM order
|
|
340
|
-
a,
|
|
341
|
-
// add if node is tabbable itself
|
|
342
|
-
t.parentNode ? O(t.parentNode.querySelectorAll(pe)).filter(function(c) {
|
|
343
|
-
return c === t;
|
|
344
|
-
}) : []
|
|
345
|
-
);
|
|
346
|
-
}, []);
|
|
347
|
-
}, Fn = function(e) {
|
|
348
|
-
var r = e.querySelectorAll("[".concat(Yr, "]"));
|
|
349
|
-
return O(r).map(function(n) {
|
|
350
|
-
return C([n]);
|
|
351
|
-
}).reduce(function(n, t) {
|
|
352
|
-
return n.concat(t);
|
|
353
|
-
}, []);
|
|
354
|
-
}, ye = function(e, r) {
|
|
355
|
-
return O(e).filter(function(n) {
|
|
356
|
-
return Xe(r, n);
|
|
357
|
-
}).filter(function(n) {
|
|
358
|
-
return ln(n);
|
|
359
|
-
});
|
|
360
|
-
}, _e = function(e, r) {
|
|
361
|
-
return r === void 0 && (r = /* @__PURE__ */ new Map()), O(e).filter(function(n) {
|
|
362
|
-
return Ye(r, n);
|
|
363
|
-
});
|
|
364
|
-
}, he = function(e, r, n) {
|
|
365
|
-
return be(ye(C(e, n), r), !0, n);
|
|
366
|
-
}, H = function(e, r) {
|
|
367
|
-
return be(ye(C(e), r), !1);
|
|
368
|
-
}, xn = function(e, r) {
|
|
369
|
-
return ye(Fn(e), r);
|
|
370
|
-
}, T = function(e, r) {
|
|
371
|
-
return e.shadowRoot ? T(e.shadowRoot, r) : Object.getPrototypeOf(e).contains !== void 0 && Object.getPrototypeOf(e).contains.call(e, r) ? !0 : O(e.children).some(function(n) {
|
|
372
|
-
var t;
|
|
373
|
-
if (n instanceof HTMLIFrameElement) {
|
|
374
|
-
var o = (t = n.contentDocument) === null || t === void 0 ? void 0 : t.body;
|
|
375
|
-
return o ? T(o, r) : !1;
|
|
376
|
-
}
|
|
377
|
-
return T(n, r);
|
|
378
|
-
});
|
|
379
|
-
}, En = function(e) {
|
|
380
|
-
for (var r = /* @__PURE__ */ new Set(), n = e.length, t = 0; t < n; t += 1)
|
|
381
|
-
for (var o = t + 1; o < n; o += 1) {
|
|
382
|
-
var u = e[t].compareDocumentPosition(e[o]);
|
|
383
|
-
(u & Node.DOCUMENT_POSITION_CONTAINED_BY) > 0 && r.add(o), (u & Node.DOCUMENT_POSITION_CONTAINS) > 0 && r.add(t);
|
|
384
|
-
}
|
|
385
|
-
return e.filter(function(a, c) {
|
|
386
|
-
return !r.has(c);
|
|
387
|
-
});
|
|
388
|
-
}, er = function(e) {
|
|
389
|
-
return e.parentNode ? er(e.parentNode) : e;
|
|
390
|
-
}, ge = function(e) {
|
|
391
|
-
var r = A(e);
|
|
392
|
-
return r.filter(Boolean).reduce(function(n, t) {
|
|
393
|
-
var o = t.getAttribute(ie);
|
|
394
|
-
return n.push.apply(n, o ? En(O(er(t).querySelectorAll("[".concat(ie, '="').concat(o, '"]:not([').concat(He, '="disabled"])')))) : [t]), n;
|
|
395
|
-
}, []);
|
|
396
|
-
}, On = function(e) {
|
|
397
|
-
try {
|
|
398
|
-
return e();
|
|
399
|
-
} catch {
|
|
400
|
-
return;
|
|
401
|
-
}
|
|
402
|
-
}, j = function(e) {
|
|
403
|
-
if (e === void 0 && (e = document), !(!e || !e.activeElement)) {
|
|
404
|
-
var r = e.activeElement;
|
|
405
|
-
return r.shadowRoot ? j(r.shadowRoot) : r instanceof HTMLIFrameElement && On(function() {
|
|
406
|
-
return r.contentWindow.document;
|
|
407
|
-
}) ? j(r.contentWindow.document) : r;
|
|
408
|
-
}
|
|
409
|
-
}, wn = function(e, r) {
|
|
410
|
-
return e === r;
|
|
411
|
-
}, In = function(e, r) {
|
|
412
|
-
return !!O(e.querySelectorAll("iframe")).some(function(n) {
|
|
413
|
-
return wn(n, r);
|
|
414
|
-
});
|
|
415
|
-
}, rr = function(e, r) {
|
|
416
|
-
return r === void 0 && (r = j(qe(e).ownerDocument)), !r || r.dataset && r.dataset.focusGuard ? !1 : ge(e).some(function(n) {
|
|
417
|
-
return T(n, r) || In(n, r);
|
|
418
|
-
});
|
|
419
|
-
}, Sn = function(e) {
|
|
420
|
-
e === void 0 && (e = document);
|
|
421
|
-
var r = j(e);
|
|
422
|
-
return r ? O(e.querySelectorAll("[".concat(Xr, "]"))).some(function(n) {
|
|
423
|
-
return T(n, r);
|
|
424
|
-
}) : !1;
|
|
425
|
-
}, Nn = function(e, r) {
|
|
426
|
-
return r.filter(Qe).filter(function(n) {
|
|
427
|
-
return n.name === e.name;
|
|
428
|
-
}).filter(function(n) {
|
|
429
|
-
return n.checked;
|
|
430
|
-
})[0] || e;
|
|
431
|
-
}, Fe = function(e, r) {
|
|
432
|
-
return Qe(e) && e.name ? Nn(e, r) : e;
|
|
433
|
-
}, Pn = function(e) {
|
|
434
|
-
var r = /* @__PURE__ */ new Set();
|
|
435
|
-
return e.forEach(function(n) {
|
|
436
|
-
return r.add(Fe(n, e));
|
|
437
|
-
}), e.filter(function(n) {
|
|
438
|
-
return r.has(n);
|
|
439
|
-
});
|
|
440
|
-
}, ke = function(e) {
|
|
441
|
-
return e[0] && e.length > 1 ? Fe(e[0], e) : e[0];
|
|
442
|
-
}, Le = function(e, r) {
|
|
443
|
-
return e.indexOf(Fe(r, e));
|
|
444
|
-
}, se = "NEW_FOCUS", Tn = function(e, r, n, t, o) {
|
|
445
|
-
var u = e.length, a = e[0], c = e[u - 1], v = me(t);
|
|
446
|
-
if (!(t && e.indexOf(t) >= 0)) {
|
|
447
|
-
var i = t !== void 0 ? n.indexOf(t) : -1, h = o ? n.indexOf(o) : i, s = o ? e.indexOf(o) : -1;
|
|
448
|
-
if (i === -1)
|
|
449
|
-
return s !== -1 ? s : se;
|
|
450
|
-
if (s === -1)
|
|
451
|
-
return se;
|
|
452
|
-
var f = i - h, b = n.indexOf(a), d = n.indexOf(c), m = Pn(n), g = t !== void 0 ? m.indexOf(t) : -1, x = o ? m.indexOf(o) : g, p = m.filter(function(z) {
|
|
453
|
-
return z.tabIndex >= 0;
|
|
454
|
-
}), y = t !== void 0 ? p.indexOf(t) : -1, E = o ? p.indexOf(o) : y, w = y >= 0 && E >= 0 ? (
|
|
455
|
-
// old/new are tabbables, measure distance in tabbable space
|
|
456
|
-
E - y
|
|
457
|
-
) : (
|
|
458
|
-
// or else measure in focusable space
|
|
459
|
-
x - g
|
|
460
|
-
);
|
|
461
|
-
if (!f && s >= 0 || r.length === 0)
|
|
462
|
-
return s;
|
|
463
|
-
var D = Le(e, r[0]), q = Le(e, r[r.length - 1]);
|
|
464
|
-
if (i <= b && v && Math.abs(f) > 1)
|
|
465
|
-
return q;
|
|
466
|
-
if (i >= d && v && Math.abs(f) > 1)
|
|
467
|
-
return D;
|
|
468
|
-
if (f && Math.abs(w) > 1)
|
|
469
|
-
return s;
|
|
470
|
-
if (i <= b)
|
|
471
|
-
return q;
|
|
472
|
-
if (i > d)
|
|
473
|
-
return D;
|
|
474
|
-
if (f)
|
|
475
|
-
return Math.abs(f) > 1 ? s : (u + s + f) % u;
|
|
476
|
-
}
|
|
477
|
-
}, An = function(e) {
|
|
478
|
-
return function(r) {
|
|
479
|
-
var n, t = (n = ze(r)) === null || n === void 0 ? void 0 : n.autofocus;
|
|
480
|
-
return (
|
|
481
|
-
// @ts-expect-error
|
|
482
|
-
r.autofocus || //
|
|
483
|
-
t !== void 0 && t !== "false" || //
|
|
484
|
-
e.indexOf(r) >= 0
|
|
485
|
-
);
|
|
486
|
-
};
|
|
487
|
-
}, Re = function(e, r, n) {
|
|
488
|
-
var t = e.map(function(u) {
|
|
489
|
-
var a = u.node;
|
|
490
|
-
return a;
|
|
491
|
-
}), o = _e(t.filter(An(n)));
|
|
492
|
-
return o && o.length ? ke(o) : ke(_e(r));
|
|
493
|
-
}, de = function(e, r) {
|
|
494
|
-
return r === void 0 && (r = []), r.push(e), e.parentNode && de(e.parentNode.host || e.parentNode, r), r;
|
|
495
|
-
}, oe = function(e, r) {
|
|
496
|
-
for (var n = de(e), t = de(r), o = 0; o < n.length; o += 1) {
|
|
497
|
-
var u = n[o];
|
|
498
|
-
if (t.indexOf(u) >= 0)
|
|
499
|
-
return u;
|
|
500
|
-
}
|
|
501
|
-
return !1;
|
|
502
|
-
}, nr = function(e, r, n) {
|
|
503
|
-
var t = A(e), o = A(r), u = t[0], a = !1;
|
|
504
|
-
return o.filter(Boolean).forEach(function(c) {
|
|
505
|
-
a = oe(a || c, c) || a, n.filter(Boolean).forEach(function(v) {
|
|
506
|
-
var i = oe(u, v);
|
|
507
|
-
i && (!a || T(i, a) ? a = i : a = oe(i, a));
|
|
508
|
-
});
|
|
509
|
-
}), a;
|
|
510
|
-
}, Ce = function(e, r) {
|
|
511
|
-
return e.reduce(function(n, t) {
|
|
512
|
-
return n.concat(xn(t, r));
|
|
513
|
-
}, []);
|
|
514
|
-
}, Dn = function(e, r) {
|
|
515
|
-
var n = /* @__PURE__ */ new Map();
|
|
516
|
-
return r.forEach(function(t) {
|
|
517
|
-
return n.set(t.node, t);
|
|
518
|
-
}), e.map(function(t) {
|
|
519
|
-
return n.get(t);
|
|
520
|
-
}).filter(mn);
|
|
521
|
-
}, Mn = function(e, r) {
|
|
522
|
-
var n = j(A(e).length > 0 ? document : qe(e).ownerDocument), t = ge(e).filter(fe), o = nr(n || e, e, t), u = /* @__PURE__ */ new Map(), a = H(t, u), c = a.filter(function(d) {
|
|
523
|
-
var m = d.node;
|
|
524
|
-
return fe(m);
|
|
525
|
-
});
|
|
526
|
-
if (c[0]) {
|
|
527
|
-
var v = H([o], u).map(function(d) {
|
|
528
|
-
var m = d.node;
|
|
529
|
-
return m;
|
|
530
|
-
}), i = Dn(v, c), h = i.map(function(d) {
|
|
531
|
-
var m = d.node;
|
|
532
|
-
return m;
|
|
533
|
-
}), s = i.filter(function(d) {
|
|
534
|
-
var m = d.tabIndex;
|
|
535
|
-
return m >= 0;
|
|
536
|
-
}).map(function(d) {
|
|
537
|
-
var m = d.node;
|
|
538
|
-
return m;
|
|
539
|
-
}), f = Tn(h, s, v, n, r);
|
|
540
|
-
if (f === se) {
|
|
541
|
-
var b = (
|
|
542
|
-
// first try only tabbable, and the fallback to all focusable, as long as at least one element should be picked for focus
|
|
543
|
-
Re(a, s, Ce(t, u)) || Re(a, h, Ce(t, u))
|
|
544
|
-
);
|
|
545
|
-
if (b)
|
|
546
|
-
return { node: b };
|
|
547
|
-
console.warn("focus-lock: cannot find any node to move focus into");
|
|
548
|
-
return;
|
|
549
|
-
}
|
|
550
|
-
return f === void 0 ? f : i[f];
|
|
551
|
-
}
|
|
552
|
-
}, _n = function(e) {
|
|
553
|
-
var r = ge(e).filter(fe), n = nr(e, e, r), t = be(C([n], !0), !0, !0), o = C(r, !1);
|
|
554
|
-
return t.map(function(u) {
|
|
555
|
-
var a = u.node, c = u.index;
|
|
556
|
-
return {
|
|
557
|
-
node: a,
|
|
558
|
-
index: c,
|
|
559
|
-
lockItem: o.indexOf(a) >= 0,
|
|
560
|
-
guard: me(a)
|
|
561
|
-
};
|
|
562
|
-
});
|
|
563
|
-
}, xe = function(e, r) {
|
|
564
|
-
e && ("focus" in e && e.focus(r), "contentWindow" in e && e.contentWindow && e.contentWindow.focus());
|
|
565
|
-
}, ue = 0, ae = !1, tr = function(e, r, n) {
|
|
566
|
-
n === void 0 && (n = {});
|
|
567
|
-
var t = Mn(e, r);
|
|
568
|
-
if (!ae && t) {
|
|
569
|
-
if (ue > 2) {
|
|
570
|
-
console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"), ae = !0, setTimeout(function() {
|
|
571
|
-
ae = !1;
|
|
572
|
-
}, 1);
|
|
573
|
-
return;
|
|
574
|
-
}
|
|
575
|
-
ue++, xe(t.node, n.focusOptions), ue--;
|
|
576
|
-
}
|
|
577
|
-
};
|
|
578
|
-
function B(e) {
|
|
579
|
-
if (!e)
|
|
580
|
-
return null;
|
|
581
|
-
if (typeof WeakRef > "u")
|
|
582
|
-
return function() {
|
|
583
|
-
return e || null;
|
|
584
|
-
};
|
|
585
|
-
var r = e ? new WeakRef(e) : null;
|
|
586
|
-
return function() {
|
|
587
|
-
return (r == null ? void 0 : r.deref()) || null;
|
|
588
|
-
};
|
|
589
|
-
}
|
|
590
|
-
var kn = function(e) {
|
|
591
|
-
if (!e)
|
|
592
|
-
return null;
|
|
593
|
-
for (var r = [], n = e; n && n !== document.body; )
|
|
594
|
-
r.push({
|
|
595
|
-
current: B(n),
|
|
596
|
-
parent: B(n.parentElement),
|
|
597
|
-
left: B(n.previousElementSibling),
|
|
598
|
-
right: B(n.nextElementSibling)
|
|
599
|
-
}), n = n.parentElement;
|
|
600
|
-
return {
|
|
601
|
-
element: B(e),
|
|
602
|
-
stack: r,
|
|
603
|
-
ownerDocument: e.ownerDocument
|
|
604
|
-
};
|
|
605
|
-
}, Ln = function(e) {
|
|
606
|
-
var r, n, t, o, u;
|
|
607
|
-
if (e)
|
|
608
|
-
for (var a = e.stack, c = e.ownerDocument, v = /* @__PURE__ */ new Map(), i = 0, h = a; i < h.length; i++) {
|
|
609
|
-
var s = h[i], f = (r = s.parent) === null || r === void 0 ? void 0 : r.call(s);
|
|
610
|
-
if (f && c.contains(f)) {
|
|
611
|
-
for (var b = (n = s.left) === null || n === void 0 ? void 0 : n.call(s), d = s.current(), m = f.contains(d) ? d : void 0, g = (t = s.right) === null || t === void 0 ? void 0 : t.call(s), x = he([f], v), p = (
|
|
612
|
-
// that is element itself
|
|
613
|
-
(u = (o = m ?? // or something in it's place
|
|
614
|
-
(b == null ? void 0 : b.nextElementSibling)) !== null && o !== void 0 ? o : (
|
|
615
|
-
// or somebody to the right, still close enough
|
|
616
|
-
g
|
|
617
|
-
)) !== null && u !== void 0 ? u : (
|
|
618
|
-
// or somebody to the left, something?
|
|
619
|
-
b
|
|
620
|
-
)
|
|
621
|
-
); p; ) {
|
|
622
|
-
for (var y = 0, E = x; y < E.length; y++) {
|
|
623
|
-
var w = E[y];
|
|
624
|
-
if (p != null && p.contains(w.node))
|
|
625
|
-
return w.node;
|
|
626
|
-
}
|
|
627
|
-
p = p.nextElementSibling;
|
|
628
|
-
}
|
|
629
|
-
if (x.length)
|
|
630
|
-
return x[0].node;
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
}, or = function(e) {
|
|
634
|
-
var r = kn(e);
|
|
635
|
-
return function() {
|
|
636
|
-
return Ln(r);
|
|
637
|
-
};
|
|
638
|
-
}, Rn = function(e, r, n) {
|
|
639
|
-
if (!e || !r)
|
|
640
|
-
return console.error("no element or scope given"), {};
|
|
641
|
-
var t = A(r);
|
|
642
|
-
if (t.every(function(a) {
|
|
643
|
-
return !T(a, e);
|
|
644
|
-
}))
|
|
645
|
-
return console.error("Active element is not contained in the scope"), {};
|
|
646
|
-
var o = n ? he(t, /* @__PURE__ */ new Map()) : H(t, /* @__PURE__ */ new Map()), u = o.findIndex(function(a) {
|
|
647
|
-
var c = a.node;
|
|
648
|
-
return c === e;
|
|
649
|
-
});
|
|
650
|
-
if (u !== -1)
|
|
651
|
-
return {
|
|
652
|
-
prev: o[u - 1],
|
|
653
|
-
next: o[u + 1],
|
|
654
|
-
first: o[0],
|
|
655
|
-
last: o[o.length - 1]
|
|
656
|
-
};
|
|
657
|
-
}, Cn = function(e, r) {
|
|
658
|
-
var n = r ? he(A(e), /* @__PURE__ */ new Map()) : H(A(e), /* @__PURE__ */ new Map());
|
|
659
|
-
return {
|
|
660
|
-
first: n[0],
|
|
661
|
-
last: n[n.length - 1]
|
|
662
|
-
};
|
|
663
|
-
}, Wn = function(e) {
|
|
664
|
-
return Object.assign({
|
|
665
|
-
scope: document.body,
|
|
666
|
-
cycle: !0,
|
|
667
|
-
onlyTabbable: !0
|
|
668
|
-
}, e);
|
|
669
|
-
}, ur = function(e, r, n) {
|
|
670
|
-
r === void 0 && (r = {});
|
|
671
|
-
var t = Wn(r), o = Rn(e, t.scope, t.onlyTabbable);
|
|
672
|
-
if (o) {
|
|
673
|
-
var u = n(o, t.cycle);
|
|
674
|
-
u && xe(u.node, t.focusOptions);
|
|
675
|
-
}
|
|
676
|
-
}, Bn = function(e, r) {
|
|
677
|
-
r === void 0 && (r = {}), ur(e, r, function(n, t) {
|
|
678
|
-
var o = n.next, u = n.first;
|
|
679
|
-
return o || t && u;
|
|
680
|
-
});
|
|
681
|
-
}, Un = function(e, r) {
|
|
682
|
-
r === void 0 && (r = {}), ur(e, r, function(n, t) {
|
|
683
|
-
var o = n.prev, u = n.last;
|
|
684
|
-
return o || t && u;
|
|
685
|
-
});
|
|
686
|
-
}, ar = function(e, r, n) {
|
|
687
|
-
var t, o = Cn(e, (t = r.onlyTabbable) !== null && t !== void 0 ? t : !0), u = o[n];
|
|
688
|
-
u && xe(u.node, r.focusOptions);
|
|
689
|
-
}, Gn = function(e, r) {
|
|
690
|
-
r === void 0 && (r = {}), ar(e, r, "first");
|
|
691
|
-
}, Hn = function(e, r) {
|
|
692
|
-
r === void 0 && (r = {}), ar(e, r, "last");
|
|
693
|
-
};
|
|
694
|
-
function Ee(e) {
|
|
695
|
-
setTimeout(e, 1);
|
|
696
|
-
}
|
|
697
|
-
var jn = function(r) {
|
|
698
|
-
return r && "current" in r ? r.current : r;
|
|
699
|
-
}, ir = function() {
|
|
700
|
-
return document && document.activeElement === document.body;
|
|
701
|
-
}, Vn = function() {
|
|
702
|
-
return ir() || Sn();
|
|
703
|
-
}, L = null, F = null, We = function() {
|
|
704
|
-
return null;
|
|
705
|
-
}, R = null, V = !1, Oe = !1, qn = function() {
|
|
706
|
-
return !0;
|
|
707
|
-
}, $n = function(r) {
|
|
708
|
-
return (L.whiteList || qn)(r);
|
|
709
|
-
}, Kn = function(r, n) {
|
|
710
|
-
R = {
|
|
711
|
-
observerNode: r,
|
|
712
|
-
portaledElement: n
|
|
713
|
-
};
|
|
714
|
-
}, Xn = function(r) {
|
|
715
|
-
return R && R.portaledElement === r;
|
|
716
|
-
};
|
|
717
|
-
function Be(e, r, n, t) {
|
|
718
|
-
var o = null, u = e;
|
|
719
|
-
do {
|
|
720
|
-
var a = t[u];
|
|
721
|
-
if (a.guard)
|
|
722
|
-
a.node.dataset.focusAutoGuard && (o = a);
|
|
723
|
-
else if (a.lockItem) {
|
|
724
|
-
if (u !== e)
|
|
725
|
-
return;
|
|
726
|
-
o = null;
|
|
727
|
-
} else
|
|
728
|
-
break;
|
|
729
|
-
} while ((u += n) !== r);
|
|
730
|
-
o && (o.node.tabIndex = 0);
|
|
731
|
-
}
|
|
732
|
-
var Yn = function(r) {
|
|
733
|
-
return r ? !!V : V === "meanwhile";
|
|
734
|
-
}, zn = function e(r, n, t) {
|
|
735
|
-
return n && (n.host === r && (!n.activeElement || t.contains(n.activeElement)) || n.parentNode && e(r, n.parentNode, t));
|
|
736
|
-
}, Jn = function(r, n) {
|
|
737
|
-
return n.some(function(t) {
|
|
738
|
-
return zn(r, t, t);
|
|
739
|
-
});
|
|
740
|
-
}, cr = function(r) {
|
|
741
|
-
return H(r, /* @__PURE__ */ new Map());
|
|
742
|
-
}, Qn = function(r) {
|
|
743
|
-
return !cr([r.parentNode]).some(function(n) {
|
|
744
|
-
return n.node === r;
|
|
745
|
-
});
|
|
746
|
-
}, Y = function() {
|
|
747
|
-
var r = !1;
|
|
748
|
-
if (L) {
|
|
749
|
-
var n = L, t = n.observed, o = n.persistentFocus, u = n.autoFocus, a = n.shards, c = n.crossFrame, v = n.focusOptions, i = n.noFocusGuards, h = t || R && R.portaledElement;
|
|
750
|
-
if (ir() && F && F !== document.body && (!document.body.contains(F) || Qn(F))) {
|
|
751
|
-
var s = We();
|
|
752
|
-
s && s.focus();
|
|
753
|
-
}
|
|
754
|
-
var f = document && document.activeElement;
|
|
755
|
-
if (h) {
|
|
756
|
-
var b = [h].concat(a.map(jn).filter(Boolean)), d = function() {
|
|
757
|
-
if (!Yn(c) || !i || !F || Oe)
|
|
758
|
-
return !1;
|
|
759
|
-
var y = cr(b), E = y.findIndex(function(w) {
|
|
760
|
-
var D = w.node;
|
|
761
|
-
return D === F;
|
|
762
|
-
});
|
|
763
|
-
return E === 0 || E === y.length - 1;
|
|
764
|
-
};
|
|
765
|
-
if ((!f || $n(f)) && (o || d() || !Vn() || !F && u) && (h && !(rr(b) || f && Jn(f, b) || Xn(f)) && (document && !F && f && !u ? (f.blur && f.blur(), document.body.focus()) : (r = tr(b, F, {
|
|
766
|
-
focusOptions: v
|
|
767
|
-
}), R = {})), F = document && document.activeElement, F !== document.body && (We = or(F)), V = !1), document && f !== document.activeElement && document.querySelector("[data-focus-auto-guard]")) {
|
|
768
|
-
var m = document && document.activeElement, g = _n(b), x = g.map(function(p) {
|
|
769
|
-
var y = p.node;
|
|
770
|
-
return y;
|
|
771
|
-
}).indexOf(m);
|
|
772
|
-
x > -1 && (g.filter(function(p) {
|
|
773
|
-
var y = p.guard, E = p.node;
|
|
774
|
-
return y && E.dataset.focusAutoGuard;
|
|
775
|
-
}).forEach(function(p) {
|
|
776
|
-
var y = p.node;
|
|
777
|
-
return y.removeAttribute("tabIndex");
|
|
778
|
-
}), Be(x, g.length, 1, g), Be(x, -1, -1, g));
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
return r;
|
|
783
|
-
}, fr = function(r) {
|
|
784
|
-
Y() && r && (r.stopPropagation(), r.preventDefault());
|
|
785
|
-
}, we = function() {
|
|
786
|
-
return Ee(Y);
|
|
787
|
-
}, Zn = function(r) {
|
|
788
|
-
var n = r.target, t = r.currentTarget;
|
|
789
|
-
t.contains(n) || Kn(t, n);
|
|
790
|
-
}, et = function() {
|
|
791
|
-
return null;
|
|
792
|
-
}, sr = function() {
|
|
793
|
-
Oe = !0;
|
|
794
|
-
}, dr = function() {
|
|
795
|
-
Oe = !1, V = "just", Ee(function() {
|
|
796
|
-
V = "meanwhile";
|
|
797
|
-
});
|
|
798
|
-
}, rt = function() {
|
|
799
|
-
document.addEventListener("focusin", fr), document.addEventListener("focusout", we), window.addEventListener("focus", sr), window.addEventListener("blur", dr);
|
|
800
|
-
}, nt = function() {
|
|
801
|
-
document.removeEventListener("focusin", fr), document.removeEventListener("focusout", we), window.removeEventListener("focus", sr), window.removeEventListener("blur", dr);
|
|
802
|
-
};
|
|
803
|
-
function tt(e) {
|
|
804
|
-
return e.filter(function(r) {
|
|
805
|
-
var n = r.disabled;
|
|
806
|
-
return !n;
|
|
807
|
-
});
|
|
808
|
-
}
|
|
809
|
-
var lr = {
|
|
810
|
-
moveFocusInside: tr,
|
|
811
|
-
focusInside: rr,
|
|
812
|
-
focusNextElement: Bn,
|
|
813
|
-
focusPrevElement: Un,
|
|
814
|
-
focusFirstElement: Gn,
|
|
815
|
-
focusLastElement: Hn,
|
|
816
|
-
captureFocusRestore: or
|
|
817
|
-
};
|
|
818
|
-
function ot(e) {
|
|
819
|
-
var r = e.slice(-1)[0];
|
|
820
|
-
r && !L && rt();
|
|
821
|
-
var n = L, t = n && r && r.id === n.id;
|
|
822
|
-
L = r, n && !t && (n.onDeactivation(), e.filter(function(o) {
|
|
823
|
-
var u = o.id;
|
|
824
|
-
return u === n.id;
|
|
825
|
-
}).length || n.returnFocus(!r)), r ? (F = null, (!t || n.observed !== r.observed) && r.onActivation(lr), Y(), Ee(Y)) : (nt(), F = null);
|
|
826
|
-
}
|
|
827
|
-
je.assignSyncMedium(Zn);
|
|
828
|
-
Ve.assignMedium(we);
|
|
829
|
-
Jr.assignMedium(function(e) {
|
|
830
|
-
return e(lr);
|
|
831
|
-
});
|
|
832
|
-
const ut = un(tt, ot)(et);
|
|
833
|
-
var vr = /* @__PURE__ */ Ue(function(r, n) {
|
|
834
|
-
return /* @__PURE__ */ S.createElement(ve, U({
|
|
835
|
-
sideCar: ut,
|
|
836
|
-
ref: n
|
|
837
|
-
}, r));
|
|
838
|
-
}), at = ve.propTypes || {}, it = Kr(at, ["sideCar"]);
|
|
839
|
-
vr.propTypes = process.env.NODE_ENV !== "production" ? it : {};
|
|
840
|
-
const ct = ({
|
|
841
|
-
children: e,
|
|
842
|
-
theme: r,
|
|
843
|
-
className: n,
|
|
844
|
-
buttonCloseClassName: t,
|
|
845
|
-
onClose: o
|
|
846
|
-
}) => {
|
|
847
|
-
const u = K.toArray(e).find(
|
|
848
|
-
(i) => X(i) && i.type === N.Header
|
|
849
|
-
), a = K.toArray(e).find(
|
|
850
|
-
(i) => X(i) && i.type === N.Body
|
|
851
|
-
), c = K.toArray(e).find(
|
|
852
|
-
(i) => X(i) && i.type === N.Footer
|
|
853
|
-
), v = K.toArray(e).filter(
|
|
854
|
-
(i) => !X(i) || ![N.Header, N.Body, N.Footer].includes(
|
|
855
|
-
i.type
|
|
856
|
-
)
|
|
857
|
-
);
|
|
858
|
-
return /* @__PURE__ */ k(vr, { returnFocus: !0, children: /* @__PURE__ */ k(jr, { children: /* @__PURE__ */ ee(
|
|
859
|
-
"div",
|
|
860
|
-
{
|
|
861
|
-
className: "fixed inset-0 grid place-content-center",
|
|
862
|
-
"data-theme": r,
|
|
863
|
-
children: [
|
|
864
|
-
/* @__PURE__ */ k(
|
|
865
|
-
"div",
|
|
866
|
-
{
|
|
867
|
-
className: "absolute inset-0 bg-black opacity-75 animate-in fade-in-0",
|
|
868
|
-
onClick: o,
|
|
869
|
-
role: "presentation"
|
|
870
|
-
}
|
|
871
|
-
),
|
|
872
|
-
/* @__PURE__ */ ee(
|
|
873
|
-
"div",
|
|
874
|
-
{
|
|
875
|
-
className: Me(
|
|
876
|
-
qr({
|
|
877
|
-
className: n
|
|
878
|
-
})
|
|
879
|
-
),
|
|
880
|
-
role: "dialog",
|
|
881
|
-
"aria-modal": "true",
|
|
882
|
-
children: [
|
|
883
|
-
u,
|
|
884
|
-
/* @__PURE__ */ ee(
|
|
885
|
-
"button",
|
|
886
|
-
{
|
|
887
|
-
className: Me(
|
|
888
|
-
Vr({
|
|
889
|
-
className: t
|
|
890
|
-
})
|
|
891
|
-
),
|
|
892
|
-
onClick: o,
|
|
893
|
-
children: [
|
|
894
|
-
/* @__PURE__ */ k($r, {}),
|
|
895
|
-
/* @__PURE__ */ k(Ur, { children: "Dismiss modal" })
|
|
896
|
-
]
|
|
897
|
-
}
|
|
898
|
-
),
|
|
899
|
-
a ?? v,
|
|
900
|
-
c
|
|
901
|
-
]
|
|
902
|
-
}
|
|
903
|
-
)
|
|
904
|
-
]
|
|
905
|
-
}
|
|
906
|
-
) }) });
|
|
907
|
-
}, N = ({ isOpen: e, onClose: r, ...n }) => (Ge(() => {
|
|
908
|
-
const t = new AbortController(), o = (u) => {
|
|
909
|
-
u.code === "Escape" && (r == null || r());
|
|
910
|
-
};
|
|
911
|
-
return window.addEventListener("keydown", o, {
|
|
912
|
-
signal: t.signal
|
|
913
|
-
}), () => {
|
|
914
|
-
t.abort();
|
|
915
|
-
};
|
|
916
|
-
}, [r]), e ? Br.createPortal(
|
|
917
|
-
/* @__PURE__ */ k(ct, { ...n, onClose: r }),
|
|
918
|
-
document.body
|
|
919
|
-
) : null);
|
|
920
|
-
N.Header = kr;
|
|
921
|
-
N.Body = Mr;
|
|
922
|
-
N.Footer = _r;
|
|
923
|
-
export {
|
|
924
|
-
N as M,
|
|
925
|
-
ct as W
|
|
926
|
-
};
|