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