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