@sps-woodland/focused-task 8.0.2 → 8.0.4
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/lib/index.cjs.js +3 -3
- package/lib/index.es.js +656 -569
- package/package.json +11 -9
package/lib/index.es.js
CHANGED
@@ -1,59 +1,79 @@
|
|
1
|
-
import { Metadata as Se, cl as
|
2
|
-
import { Button as
|
3
|
-
import * as
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import { code as
|
1
|
+
import { Metadata as Se, cl as R, combineEventHandlers as fe, useChildTestIdAttrBuilder as ze, selectChildren as _e, modChildren as Ge, contentOf as pe } from "@sps-woodland/core";
|
2
|
+
import { Button as Ye } from "@sps-woodland/buttons";
|
3
|
+
import * as g from "react";
|
4
|
+
import $, { useState as V, useRef as w, useEffect as S, useCallback as T, useContext as H, useMemo as I } from "react";
|
5
|
+
import Ue from "react-dom";
|
6
|
+
import { code as me } from "@spscommerce/utils";
|
7
7
|
function Je(e, t, n) {
|
8
|
-
let [r, o] =
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
let [r, o] = V(e || t), a = w(e !== void 0), i = e !== void 0;
|
9
|
+
S(() => {
|
10
|
+
let s = a.current;
|
11
|
+
s !== i && console.warn(`WARN: A component changed from ${s ? "controlled" : "uncontrolled"} to ${i ? "controlled" : "uncontrolled"}.`), a.current = i;
|
12
|
+
}, [
|
13
|
+
i
|
14
|
+
]);
|
15
|
+
let c = i ? e : r, l = T((s, ...u) => {
|
16
|
+
let f = (d, ...p) => {
|
17
|
+
n && (Object.is(c, d) || n(d, ...p)), i || (c = d);
|
13
18
|
};
|
14
|
-
typeof
|
15
|
-
let
|
16
|
-
return
|
17
|
-
})) : (
|
19
|
+
typeof s == "function" ? (console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"), o((p, ...m) => {
|
20
|
+
let F = s(i ? c : p, ...m);
|
21
|
+
return f(F, ...u), i ? p : F;
|
22
|
+
})) : (i || o(s), f(s, ...u));
|
18
23
|
}, [
|
19
|
-
|
24
|
+
i,
|
25
|
+
c,
|
20
26
|
n
|
21
27
|
]);
|
22
|
-
return
|
23
|
-
|
24
|
-
|
28
|
+
return [
|
29
|
+
c,
|
30
|
+
l
|
25
31
|
];
|
26
32
|
}
|
27
|
-
const
|
33
|
+
const _ = {
|
28
34
|
prefix: String(Math.round(Math.random() * 1e10)),
|
29
|
-
current: 0
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
let t = I(ie), n = $(null);
|
35
|
+
current: 0
|
36
|
+
}, Fe = /* @__PURE__ */ $.createContext(_), Xe = /* @__PURE__ */ $.createContext(!1);
|
37
|
+
let Qe = Boolean(typeof window < "u" && window.document && window.document.createElement), Z = /* @__PURE__ */ new WeakMap();
|
38
|
+
function Ze(e = !1) {
|
39
|
+
let t = H(Fe), n = w(null);
|
35
40
|
if (n.current === null && !e) {
|
36
41
|
var r, o;
|
37
|
-
let a = (
|
42
|
+
let a = (o = $.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || o === void 0 || (r = o.ReactCurrentOwner) === null || r === void 0 ? void 0 : r.current;
|
38
43
|
if (a) {
|
39
|
-
let i =
|
40
|
-
i == null ?
|
44
|
+
let i = Z.get(a);
|
45
|
+
i == null ? Z.set(a, {
|
41
46
|
id: t.current,
|
42
47
|
state: a.memoizedState
|
43
|
-
}) : a.memoizedState !== i.state && (t.current = i.id,
|
48
|
+
}) : a.memoizedState !== i.state && (t.current = i.id, Z.delete(a));
|
44
49
|
}
|
45
50
|
n.current = ++t.current;
|
46
51
|
}
|
47
52
|
return n.current;
|
48
53
|
}
|
49
|
-
function
|
50
|
-
let t =
|
51
|
-
t ===
|
52
|
-
let n =
|
53
|
-
return e ||
|
54
|
+
function et(e) {
|
55
|
+
let t = H(Fe);
|
56
|
+
t === _ && !Qe && console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");
|
57
|
+
let n = Ze(!!e), r = t === _ && process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${t.prefix}`;
|
58
|
+
return e || `${r}-${n}`;
|
54
59
|
}
|
55
|
-
function
|
56
|
-
|
60
|
+
function tt(e) {
|
61
|
+
let t = $.useId(), [n] = V(Pe()), r = n || process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${_.prefix}`;
|
62
|
+
return e || `${r}-${t}`;
|
63
|
+
}
|
64
|
+
const nt = typeof $.useId == "function" ? tt : et;
|
65
|
+
function rt() {
|
66
|
+
return !1;
|
67
|
+
}
|
68
|
+
function ot() {
|
69
|
+
return !0;
|
70
|
+
}
|
71
|
+
function at(e) {
|
72
|
+
return () => {
|
73
|
+
};
|
74
|
+
}
|
75
|
+
function Pe() {
|
76
|
+
return typeof $.useSyncExternalStore == "function" ? $.useSyncExternalStore(at, rt, ot) : H(Xe);
|
57
77
|
}
|
58
78
|
function Ce(e) {
|
59
79
|
var t, n, r = "";
|
@@ -68,66 +88,72 @@ function Ce(e) {
|
|
68
88
|
e[t] && (r && (r += " "), r += t);
|
69
89
|
return r;
|
70
90
|
}
|
71
|
-
function
|
91
|
+
function it() {
|
72
92
|
for (var e, t, n = 0, r = ""; n < arguments.length; )
|
73
93
|
(e = arguments[n++]) && (t = Ce(e)) && (r && (r += " "), r += t);
|
74
94
|
return r;
|
75
95
|
}
|
76
|
-
const
|
96
|
+
const h = typeof document < "u" ? $.useLayoutEffect : () => {
|
77
97
|
};
|
78
|
-
function
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
98
|
+
function W(e) {
|
99
|
+
const t = w(null);
|
100
|
+
return h(() => {
|
101
|
+
t.current = e;
|
102
|
+
}, [
|
103
|
+
e
|
104
|
+
]), T((...n) => {
|
105
|
+
const r = t.current;
|
106
|
+
return r(...n);
|
107
|
+
}, []);
|
108
|
+
}
|
109
|
+
function lt(e) {
|
110
|
+
let [t, n] = V(e), r = w(null), o = W(() => {
|
111
|
+
let i = r.current.next();
|
112
|
+
if (i.done) {
|
113
|
+
r.current = null;
|
86
114
|
return;
|
87
115
|
}
|
88
|
-
t ===
|
89
|
-
}
|
90
|
-
|
116
|
+
t === i.value ? o() : n(i.value);
|
117
|
+
});
|
118
|
+
h(() => {
|
119
|
+
r.current && o();
|
120
|
+
});
|
121
|
+
let a = W((i) => {
|
122
|
+
r.current = i(t), o();
|
91
123
|
});
|
92
|
-
let i = P((l) => {
|
93
|
-
o.current = l(r.current), a.current();
|
94
|
-
}, [
|
95
|
-
o,
|
96
|
-
a
|
97
|
-
]);
|
98
124
|
return [
|
99
125
|
t,
|
100
|
-
|
126
|
+
a
|
101
127
|
];
|
102
128
|
}
|
103
|
-
let
|
129
|
+
let ct = Boolean(typeof window < "u" && window.document && window.document.createElement), G = /* @__PURE__ */ new Map();
|
104
130
|
function Le(e) {
|
105
|
-
let [t, n] =
|
131
|
+
let [t, n] = V(e), r = w(null), o = nt(t), a = T((i) => {
|
106
132
|
r.current = i;
|
107
133
|
}, []);
|
108
|
-
return
|
134
|
+
return ct && G.set(o, a), h(() => {
|
109
135
|
let i = o;
|
110
136
|
return () => {
|
111
|
-
|
137
|
+
G.delete(i);
|
112
138
|
};
|
113
139
|
}, [
|
114
140
|
o
|
115
|
-
]),
|
141
|
+
]), S(() => {
|
116
142
|
let i = r.current;
|
117
143
|
i && (r.current = null, n(i));
|
118
144
|
}), o;
|
119
145
|
}
|
120
|
-
function
|
146
|
+
function st(e, t) {
|
121
147
|
if (e === t)
|
122
148
|
return e;
|
123
|
-
let n =
|
149
|
+
let n = G.get(e);
|
124
150
|
if (n)
|
125
151
|
return n(t), t;
|
126
|
-
let r =
|
152
|
+
let r = G.get(t);
|
127
153
|
return r ? (r(e), e) : t;
|
128
154
|
}
|
129
|
-
function
|
130
|
-
let t = Le(), [n, r] =
|
155
|
+
function ut(e = []) {
|
156
|
+
let t = Le(), [n, r] = lt(t), o = T(() => {
|
131
157
|
r(function* () {
|
132
158
|
yield t, yield document.getElementById(t) ? t : void 0;
|
133
159
|
});
|
@@ -135,19 +161,23 @@ function nt(e = []) {
|
|
135
161
|
t,
|
136
162
|
r
|
137
163
|
]);
|
138
|
-
return
|
164
|
+
return h(o, [
|
139
165
|
t,
|
140
166
|
o,
|
141
167
|
...e
|
142
168
|
]), n;
|
143
169
|
}
|
144
|
-
function
|
170
|
+
function Y(...e) {
|
145
171
|
return (...t) => {
|
146
172
|
for (let n of e)
|
147
173
|
typeof n == "function" && n(...t);
|
148
174
|
};
|
149
175
|
}
|
150
|
-
|
176
|
+
const dt = (e) => {
|
177
|
+
var t;
|
178
|
+
return (t = e == null ? void 0 : e.ownerDocument) !== null && t !== void 0 ? t : document;
|
179
|
+
};
|
180
|
+
function ft(...e) {
|
151
181
|
let t = {
|
152
182
|
...e[0]
|
153
183
|
};
|
@@ -155,52 +185,59 @@ function rt(...e) {
|
|
155
185
|
let r = e[n];
|
156
186
|
for (let o in r) {
|
157
187
|
let a = t[o], i = r[o];
|
158
|
-
typeof a == "function" && typeof i == "function" && o[0] === "o" && o[1] === "n" && o.charCodeAt(2) >= 65 && o.charCodeAt(2) <= 90 ? t[o] =
|
188
|
+
typeof a == "function" && typeof i == "function" && o[0] === "o" && o[1] === "n" && o.charCodeAt(2) >= 65 && o.charCodeAt(2) <= 90 ? t[o] = Y(a, i) : (o === "className" || o === "UNSAFE_className") && typeof a == "string" && typeof i == "string" ? t[o] = it(a, i) : o === "id" && a && i ? t.id = st(a, i) : t[o] = i !== void 0 ? i : a;
|
159
189
|
}
|
160
190
|
}
|
161
191
|
return t;
|
162
192
|
}
|
163
|
-
const
|
193
|
+
const pt = /* @__PURE__ */ new Set([
|
164
194
|
"id"
|
165
|
-
]),
|
195
|
+
]), mt = /* @__PURE__ */ new Set([
|
166
196
|
"aria-label",
|
167
197
|
"aria-labelledby",
|
168
198
|
"aria-describedby",
|
169
199
|
"aria-details"
|
170
|
-
]),
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
200
|
+
]), bt = /* @__PURE__ */ new Set([
|
201
|
+
"href",
|
202
|
+
"target",
|
203
|
+
"rel",
|
204
|
+
"download",
|
205
|
+
"ping",
|
206
|
+
"referrerPolicy"
|
207
|
+
]), vt = /^(data-.*)$/;
|
208
|
+
function $t(e, t = {}) {
|
209
|
+
let { labelable: n, isLink: r, propNames: o } = t, a = {};
|
210
|
+
for (const i in e)
|
211
|
+
Object.prototype.hasOwnProperty.call(e, i) && (pt.has(i) || n && mt.has(i) || r && bt.has(i) || (o == null ? void 0 : o.has(i)) || vt.test(i)) && (a[i] = e[i]);
|
212
|
+
return a;
|
213
|
+
}
|
214
|
+
function be(e) {
|
215
|
+
if (ht())
|
179
216
|
e.focus({
|
180
217
|
preventScroll: !0
|
181
218
|
});
|
182
219
|
else {
|
183
|
-
let t =
|
184
|
-
e.focus(),
|
220
|
+
let t = gt(e);
|
221
|
+
e.focus(), Et(t);
|
185
222
|
}
|
186
223
|
}
|
187
|
-
let
|
188
|
-
function
|
189
|
-
if (
|
190
|
-
|
224
|
+
let q = null;
|
225
|
+
function ht() {
|
226
|
+
if (q == null) {
|
227
|
+
q = !1;
|
191
228
|
try {
|
192
229
|
var e = document.createElement("div");
|
193
230
|
e.focus({
|
194
231
|
get preventScroll() {
|
195
|
-
return
|
232
|
+
return q = !0, !0;
|
196
233
|
}
|
197
234
|
});
|
198
235
|
} catch {
|
199
236
|
}
|
200
237
|
}
|
201
|
-
return
|
238
|
+
return q;
|
202
239
|
}
|
203
|
-
function
|
240
|
+
function gt(e) {
|
204
241
|
for (var t = e.parentNode, n = [], r = document.scrollingElement || document.documentElement; t instanceof HTMLElement && t !== r; )
|
205
242
|
(t.offsetHeight < t.scrollHeight || t.offsetWidth < t.scrollWidth) && n.push({
|
206
243
|
element: t,
|
@@ -213,79 +250,83 @@ function st(e) {
|
|
213
250
|
scrollLeft: r.scrollLeft
|
214
251
|
}), n;
|
215
252
|
}
|
216
|
-
function
|
253
|
+
function Et(e) {
|
217
254
|
for (let { element: t, scrollTop: n, scrollLeft: r } of e)
|
218
255
|
t.scrollTop = n, t.scrollLeft = r;
|
219
256
|
}
|
220
|
-
|
221
|
-
|
257
|
+
function wt(e) {
|
258
|
+
var t;
|
259
|
+
return typeof window > "u" || window.navigator == null ? !1 : ((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.brands.some((n) => e.test(n.brand))) || e.test(window.navigator.userAgent);
|
260
|
+
}
|
261
|
+
function ie(e) {
|
262
|
+
var t;
|
263
|
+
return typeof window < "u" && window.navigator != null ? e.test(((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.platform) || window.navigator.platform) : !1;
|
264
|
+
}
|
265
|
+
function ke() {
|
266
|
+
return ie(/^Mac/i);
|
267
|
+
}
|
268
|
+
function yt() {
|
269
|
+
return ie(/^iPhone/i);
|
270
|
+
}
|
271
|
+
function Tt() {
|
272
|
+
return ie(/^iPad/i) || ke() && navigator.maxTouchPoints > 1;
|
273
|
+
}
|
274
|
+
function xt() {
|
275
|
+
return yt() || Tt();
|
276
|
+
}
|
277
|
+
function Nt() {
|
278
|
+
return wt(/Android/i);
|
279
|
+
}
|
280
|
+
let O = /* @__PURE__ */ new Map(), ne = /* @__PURE__ */ new Set();
|
281
|
+
function ve() {
|
222
282
|
if (typeof window > "u")
|
223
283
|
return;
|
224
284
|
let e = (n) => {
|
225
|
-
let r =
|
226
|
-
r || (r = /* @__PURE__ */ new Set(),
|
285
|
+
let r = O.get(n.target);
|
286
|
+
r || (r = /* @__PURE__ */ new Set(), O.set(n.target, r), n.target.addEventListener("transitioncancel", t)), r.add(n.propertyName);
|
227
287
|
}, t = (n) => {
|
228
|
-
let r =
|
229
|
-
if (!!r && (r.delete(n.propertyName), r.size === 0 && (n.target.removeEventListener("transitioncancel", t),
|
230
|
-
for (let o of
|
288
|
+
let r = O.get(n.target);
|
289
|
+
if (!!r && (r.delete(n.propertyName), r.size === 0 && (n.target.removeEventListener("transitioncancel", t), O.delete(n.target)), O.size === 0)) {
|
290
|
+
for (let o of ne)
|
231
291
|
o();
|
232
|
-
|
292
|
+
ne.clear();
|
233
293
|
}
|
234
294
|
};
|
235
295
|
document.body.addEventListener("transitionrun", e), document.body.addEventListener("transitionend", t);
|
236
296
|
}
|
237
|
-
typeof document < "u" && (document.readyState !== "loading" ?
|
238
|
-
function
|
297
|
+
typeof document < "u" && (document.readyState !== "loading" ? ve() : document.addEventListener("DOMContentLoaded", ve));
|
298
|
+
function St(e) {
|
239
299
|
requestAnimationFrame(() => {
|
240
|
-
|
300
|
+
O.size === 0 ? e() : ne.add(e);
|
241
301
|
});
|
242
302
|
}
|
243
|
-
function
|
244
|
-
for (
|
303
|
+
function Oe(e) {
|
304
|
+
for ($e(e) && (e = e.parentElement); e && !$e(e); )
|
245
305
|
e = e.parentElement;
|
246
306
|
return e || document.scrollingElement || document.documentElement;
|
247
307
|
}
|
248
|
-
function
|
308
|
+
function $e(e) {
|
249
309
|
let t = window.getComputedStyle(e);
|
250
310
|
return /(auto|scroll)/.test(t.overflow + t.overflowX + t.overflowY);
|
251
311
|
}
|
252
|
-
function
|
253
|
-
|
254
|
-
return typeof window > "u" || window.navigator == null ? !1 : ((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.brands.some((n) => e.test(n.brand))) || e.test(window.navigator.userAgent);
|
255
|
-
}
|
256
|
-
function le(e) {
|
257
|
-
var t;
|
258
|
-
return typeof window < "u" && window.navigator != null ? e.test(((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.platform) || window.navigator.platform) : !1;
|
259
|
-
}
|
260
|
-
function Oe() {
|
261
|
-
return le(/^Mac/i);
|
262
|
-
}
|
263
|
-
function pt() {
|
264
|
-
return le(/^iPhone/i);
|
265
|
-
}
|
266
|
-
function mt() {
|
267
|
-
return le(/^iPad/i) || Oe() && navigator.maxTouchPoints > 1;
|
268
|
-
}
|
269
|
-
function bt() {
|
270
|
-
return pt() || mt();
|
271
|
-
}
|
272
|
-
function vt() {
|
273
|
-
return ft(/Android/i);
|
312
|
+
function Ft(e) {
|
313
|
+
return e.mozInputSource === 0 && e.isTrusted ? !0 : Nt() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
|
274
314
|
}
|
275
|
-
|
276
|
-
|
277
|
-
}
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
})
|
315
|
+
const Me = $.createContext({
|
316
|
+
register: () => {
|
317
|
+
}
|
318
|
+
});
|
319
|
+
Me.displayName = "PressResponderContext";
|
320
|
+
function Pt({ children: e }) {
|
321
|
+
let t = I(() => ({
|
322
|
+
register: () => {
|
323
|
+
}
|
324
|
+
}), []);
|
325
|
+
return /* @__PURE__ */ $.createElement(Me.Provider, {
|
326
|
+
value: t
|
327
|
+
}, e);
|
285
328
|
}
|
286
|
-
|
287
|
-
ht.displayName = "PressResponderContext";
|
288
|
-
class gt {
|
329
|
+
class Ct {
|
289
330
|
isDefaultPrevented() {
|
290
331
|
return this.nativeEvent.defaultPrevented;
|
291
332
|
}
|
@@ -304,139 +345,153 @@ class gt {
|
|
304
345
|
this.nativeEvent = n, this.target = n.target, this.currentTarget = n.currentTarget, this.relatedTarget = n.relatedTarget, this.bubbles = n.bubbles, this.cancelable = n.cancelable, this.defaultPrevented = n.defaultPrevented, this.eventPhase = n.eventPhase, this.isTrusted = n.isTrusted, this.timeStamp = n.timeStamp, this.type = t;
|
305
346
|
}
|
306
347
|
}
|
307
|
-
function
|
308
|
-
let t =
|
348
|
+
function Lt(e) {
|
349
|
+
let t = w({
|
309
350
|
isFocused: !1,
|
310
|
-
onBlur: e,
|
311
351
|
observer: null
|
312
352
|
});
|
313
|
-
|
314
|
-
const
|
353
|
+
h(() => {
|
354
|
+
const r = t.current;
|
315
355
|
return () => {
|
316
|
-
|
356
|
+
r.observer && (r.observer.disconnect(), r.observer = null);
|
317
357
|
};
|
318
|
-
}, [])
|
319
|
-
|
358
|
+
}, []);
|
359
|
+
let n = W((r) => {
|
360
|
+
e == null || e(r);
|
361
|
+
});
|
362
|
+
return T((r) => {
|
363
|
+
if (r.target instanceof HTMLButtonElement || r.target instanceof HTMLInputElement || r.target instanceof HTMLTextAreaElement || r.target instanceof HTMLSelectElement) {
|
320
364
|
t.current.isFocused = !0;
|
321
|
-
let
|
322
|
-
|
323
|
-
t.current.isFocused = !1, r.disabled && ((l = (i = t.current).onBlur) === null || l === void 0 || l.call(i, new gt("blur", a))), t.current.observer && (t.current.observer.disconnect(), t.current.observer = null);
|
365
|
+
let o = r.target, a = (i) => {
|
366
|
+
t.current.isFocused = !1, o.disabled && n(new Ct("blur", i)), t.current.observer && (t.current.observer.disconnect(), t.current.observer = null);
|
324
367
|
};
|
325
|
-
|
368
|
+
o.addEventListener("focusout", a, {
|
326
369
|
once: !0
|
327
370
|
}), t.current.observer = new MutationObserver(() => {
|
328
|
-
t.current.isFocused &&
|
329
|
-
|
330
|
-
|
331
|
-
|
371
|
+
if (t.current.isFocused && o.disabled) {
|
372
|
+
var i;
|
373
|
+
(i = t.current.observer) === null || i === void 0 || i.disconnect();
|
374
|
+
let c = o === document.activeElement ? null : document.activeElement;
|
375
|
+
o.dispatchEvent(new FocusEvent("blur", {
|
376
|
+
relatedTarget: c
|
377
|
+
})), o.dispatchEvent(new FocusEvent("focusout", {
|
378
|
+
bubbles: !0,
|
379
|
+
relatedTarget: c
|
380
|
+
}));
|
381
|
+
}
|
382
|
+
}), t.current.observer.observe(o, {
|
332
383
|
attributes: !0,
|
333
384
|
attributeFilter: [
|
334
385
|
"disabled"
|
335
386
|
]
|
336
387
|
});
|
337
388
|
}
|
338
|
-
}, [
|
389
|
+
}, [
|
390
|
+
n
|
391
|
+
]);
|
339
392
|
}
|
340
|
-
let
|
341
|
-
function
|
342
|
-
for (let n of
|
393
|
+
let K = null, kt = /* @__PURE__ */ new Set(), he = !1, L = !1, re = !1;
|
394
|
+
function le(e, t) {
|
395
|
+
for (let n of kt)
|
343
396
|
n(e, t);
|
344
397
|
}
|
345
|
-
function
|
346
|
-
return !(e.metaKey || !
|
398
|
+
function Ot(e) {
|
399
|
+
return !(e.metaKey || !ke() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
|
347
400
|
}
|
348
|
-
function
|
349
|
-
|
401
|
+
function ge(e) {
|
402
|
+
L = !0, Ot(e) && (K = "keyboard", le("keyboard", e));
|
350
403
|
}
|
351
|
-
function
|
352
|
-
|
404
|
+
function k(e) {
|
405
|
+
K = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (L = !0, le("pointer", e));
|
353
406
|
}
|
354
|
-
function
|
355
|
-
|
407
|
+
function Mt(e) {
|
408
|
+
Ft(e) && (L = !0, K = "virtual");
|
356
409
|
}
|
357
|
-
function
|
358
|
-
e.target === window || e.target === document || (!
|
410
|
+
function Dt(e) {
|
411
|
+
e.target === window || e.target === document || (!L && !re && (K = "virtual", le("virtual", e)), L = !1, re = !1);
|
359
412
|
}
|
360
|
-
function
|
361
|
-
|
413
|
+
function At() {
|
414
|
+
L = !1, re = !0;
|
362
415
|
}
|
363
|
-
function
|
364
|
-
if (typeof window > "u" ||
|
416
|
+
function Ee() {
|
417
|
+
if (typeof window > "u" || he)
|
365
418
|
return;
|
366
419
|
let e = HTMLElement.prototype.focus;
|
367
420
|
HTMLElement.prototype.focus = function() {
|
368
|
-
|
369
|
-
}, document.addEventListener("keydown",
|
421
|
+
L = !0, e.apply(this, arguments);
|
422
|
+
}, document.addEventListener("keydown", ge, !0), document.addEventListener("keyup", ge, !0), document.addEventListener("click", Mt, !0), window.addEventListener("focus", Dt, !0), window.addEventListener("blur", At, !1), typeof PointerEvent < "u" ? (document.addEventListener("pointerdown", k, !0), document.addEventListener("pointermove", k, !0), document.addEventListener("pointerup", k, !0)) : (document.addEventListener("mousedown", k, !0), document.addEventListener("mousemove", k, !0), document.addEventListener("mouseup", k, !0)), he = !0;
|
370
423
|
}
|
371
|
-
typeof document < "u" && (document.readyState !== "loading" ?
|
372
|
-
function
|
373
|
-
return
|
424
|
+
typeof document < "u" && (document.readyState !== "loading" ? Ee() : document.addEventListener("DOMContentLoaded", Ee));
|
425
|
+
function Rt() {
|
426
|
+
return K;
|
374
427
|
}
|
375
|
-
function
|
376
|
-
let { isDisabled: t, onBlurWithin: n, onFocusWithin: r, onFocusWithinChange: o } = e, a =
|
428
|
+
function It(e) {
|
429
|
+
let { isDisabled: t, onBlurWithin: n, onFocusWithin: r, onFocusWithinChange: o } = e, a = w({
|
377
430
|
isFocusWithin: !1
|
378
|
-
}), i =
|
431
|
+
}), i = T((s) => {
|
379
432
|
a.current.isFocusWithin && !s.currentTarget.contains(s.relatedTarget) && (a.current.isFocusWithin = !1, n && n(s), o && o(!1));
|
380
433
|
}, [
|
381
434
|
n,
|
382
435
|
o,
|
383
436
|
a
|
384
|
-
]),
|
385
|
-
!a.current.isFocusWithin && document.activeElement === s.target && (r && r(s), o && o(!0), a.current.isFocusWithin = !0,
|
437
|
+
]), c = Lt(i), l = T((s) => {
|
438
|
+
!a.current.isFocusWithin && document.activeElement === s.target && (r && r(s), o && o(!0), a.current.isFocusWithin = !0, c(s));
|
386
439
|
}, [
|
387
440
|
r,
|
388
441
|
o,
|
389
|
-
|
442
|
+
c
|
390
443
|
]);
|
391
444
|
return t ? {
|
392
445
|
focusWithinProps: {
|
393
|
-
onFocus:
|
394
|
-
onBlur:
|
446
|
+
onFocus: void 0,
|
447
|
+
onBlur: void 0
|
395
448
|
}
|
396
449
|
} : {
|
397
450
|
focusWithinProps: {
|
398
|
-
onFocus:
|
451
|
+
onFocus: l,
|
399
452
|
onBlur: i
|
400
453
|
}
|
401
454
|
};
|
402
455
|
}
|
403
|
-
function
|
404
|
-
let { ref: t, onInteractOutside: n, isDisabled: r, onInteractOutsideStart: o } = e,
|
456
|
+
function Bt(e) {
|
457
|
+
let { ref: t, onInteractOutside: n, isDisabled: r, onInteractOutsideStart: o } = e, a = w({
|
405
458
|
isPointerDown: !1,
|
406
|
-
ignoreEmulatedMouseEvents: !1
|
407
|
-
|
408
|
-
|
409
|
-
})
|
410
|
-
|
459
|
+
ignoreEmulatedMouseEvents: !1
|
460
|
+
}), i = W((l) => {
|
461
|
+
n && j(l, t) && (o && o(l), a.current.isPointerDown = !0);
|
462
|
+
}), c = W((l) => {
|
463
|
+
n && n(l);
|
464
|
+
});
|
465
|
+
S(() => {
|
466
|
+
let l = a.current;
|
411
467
|
if (r)
|
412
468
|
return;
|
413
|
-
|
414
|
-
H(c, t) && i.onInteractOutside && (i.onInteractOutsideStart && i.onInteractOutsideStart(c), i.isPointerDown = !0);
|
415
|
-
};
|
469
|
+
const s = t.current, u = dt(s);
|
416
470
|
if (typeof PointerEvent < "u") {
|
417
|
-
let
|
418
|
-
|
471
|
+
let f = (d) => {
|
472
|
+
l.isPointerDown && j(d, t) && c(d), l.isPointerDown = !1;
|
419
473
|
};
|
420
|
-
return
|
421
|
-
|
474
|
+
return u.addEventListener("pointerdown", i, !0), u.addEventListener("pointerup", f, !0), () => {
|
475
|
+
u.removeEventListener("pointerdown", i, !0), u.removeEventListener("pointerup", f, !0);
|
422
476
|
};
|
423
477
|
} else {
|
424
|
-
let
|
425
|
-
|
426
|
-
},
|
427
|
-
|
478
|
+
let f = (p) => {
|
479
|
+
l.ignoreEmulatedMouseEvents ? l.ignoreEmulatedMouseEvents = !1 : l.isPointerDown && j(p, t) && c(p), l.isPointerDown = !1;
|
480
|
+
}, d = (p) => {
|
481
|
+
l.ignoreEmulatedMouseEvents = !0, l.isPointerDown && j(p, t) && c(p), l.isPointerDown = !1;
|
428
482
|
};
|
429
|
-
return
|
430
|
-
|
483
|
+
return u.addEventListener("mousedown", i, !0), u.addEventListener("mouseup", f, !0), u.addEventListener("touchstart", i, !0), u.addEventListener("touchend", d, !0), () => {
|
484
|
+
u.removeEventListener("mousedown", i, !0), u.removeEventListener("mouseup", f, !0), u.removeEventListener("touchstart", i, !0), u.removeEventListener("touchend", d, !0);
|
431
485
|
};
|
432
486
|
}
|
433
487
|
}, [
|
434
488
|
t,
|
489
|
+
r,
|
435
490
|
i,
|
436
|
-
|
491
|
+
c
|
437
492
|
]);
|
438
493
|
}
|
439
|
-
function
|
494
|
+
function j(e, t) {
|
440
495
|
if (e.button > 0)
|
441
496
|
return !1;
|
442
497
|
if (e.target) {
|
@@ -447,15 +502,15 @@ function H(e, t) {
|
|
447
502
|
return t.current && !t.current.contains(e.target);
|
448
503
|
}
|
449
504
|
function oe(e) {
|
450
|
-
if (
|
505
|
+
if (Rt() === "virtual") {
|
451
506
|
let t = document.activeElement;
|
452
|
-
|
453
|
-
document.activeElement === t && document.contains(e) &&
|
507
|
+
St(() => {
|
508
|
+
document.activeElement === t && document.contains(e) && be(e);
|
454
509
|
});
|
455
510
|
} else
|
456
|
-
|
511
|
+
be(e);
|
457
512
|
}
|
458
|
-
function
|
513
|
+
function Wt(e) {
|
459
514
|
if (!(e instanceof HTMLElement) && !(e instanceof SVGElement))
|
460
515
|
return !1;
|
461
516
|
let { display: t, visibility: n } = e.style, r = t !== "none" && n !== "hidden" && n !== "collapse";
|
@@ -466,118 +521,119 @@ function Ct(e) {
|
|
466
521
|
}
|
467
522
|
return r;
|
468
523
|
}
|
469
|
-
function
|
524
|
+
function Vt(e, t) {
|
470
525
|
return !e.hasAttribute("hidden") && (e.nodeName === "DETAILS" && t && t.nodeName !== "SUMMARY" ? e.hasAttribute("open") : !0);
|
471
526
|
}
|
472
|
-
function
|
473
|
-
return e.nodeName !== "#comment" &&
|
527
|
+
function De(e, t) {
|
528
|
+
return e.nodeName !== "#comment" && Wt(e) && Vt(e, t) && (!e.parentElement || De(e.parentElement, e));
|
474
529
|
}
|
475
|
-
const
|
530
|
+
const we = /* @__PURE__ */ $.createContext(null);
|
476
531
|
let b = null;
|
477
|
-
function
|
478
|
-
let { children: t, contain: n, restoreFocus: r, autoFocus: o } = e, a =
|
479
|
-
scopeRef:
|
532
|
+
function Ht(e) {
|
533
|
+
let { children: t, contain: n, restoreFocus: r, autoFocus: o } = e, a = w(null), i = w(null), c = w([]), { parentNode: l } = H(we) || {}, s = I(() => new ae({
|
534
|
+
scopeRef: c
|
480
535
|
}), [
|
481
|
-
|
536
|
+
c
|
482
537
|
]);
|
483
|
-
|
484
|
-
let d =
|
485
|
-
if (v.getTreeNode(d.scopeRef) && b && !
|
486
|
-
let
|
487
|
-
|
538
|
+
h(() => {
|
539
|
+
let d = l || v.root;
|
540
|
+
if (v.getTreeNode(d.scopeRef) && b && !J(b, d.scopeRef)) {
|
541
|
+
let p = v.getTreeNode(b);
|
542
|
+
p && (d = p);
|
488
543
|
}
|
489
544
|
d.addChild(s), v.addNode(s);
|
490
545
|
}, [
|
491
546
|
s,
|
492
|
-
|
493
|
-
]),
|
494
|
-
let d = v.getTreeNode(
|
495
|
-
d.contain = n;
|
547
|
+
l
|
548
|
+
]), h(() => {
|
549
|
+
let d = v.getTreeNode(c);
|
550
|
+
d && (d.contain = !!n);
|
496
551
|
}, [
|
497
552
|
n
|
498
|
-
]),
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
553
|
+
]), h(() => {
|
554
|
+
var d;
|
555
|
+
let p = (d = a.current) === null || d === void 0 ? void 0 : d.nextSibling, m = [];
|
556
|
+
for (; p && p !== i.current; )
|
557
|
+
m.push(p), p = p.nextSibling;
|
558
|
+
c.current = m;
|
503
559
|
}, [
|
504
560
|
t
|
505
|
-
]),
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
m === v.getTreeNode(l) && (b = m.scopeRef);
|
512
|
-
}
|
513
|
-
return () => {
|
514
|
-
let f = v.getTreeNode(l).parent.scopeRef;
|
515
|
-
(l === b || Y(l, b)) && (!f || v.getTreeNode(f)) && (b = f), v.removeTreeNode(l);
|
516
|
-
};
|
561
|
+
]), Yt(c, r, n), zt(c, n), Jt(c, r, n), Gt(c, o), S(() => {
|
562
|
+
let d = document.activeElement, p = null;
|
563
|
+
if (E(d, c.current)) {
|
564
|
+
for (let m of v.traverse())
|
565
|
+
m.scopeRef && E(d, m.scopeRef.current) && (p = m);
|
566
|
+
p === v.getTreeNode(c) && (b = p.scopeRef);
|
517
567
|
}
|
518
568
|
}, [
|
519
|
-
|
569
|
+
c
|
570
|
+
]), h(() => () => {
|
571
|
+
var d, p, m;
|
572
|
+
let F = (m = (p = v.getTreeNode(c)) === null || p === void 0 || (d = p.parent) === null || d === void 0 ? void 0 : d.scopeRef) !== null && m !== void 0 ? m : null;
|
573
|
+
(c === b || J(c, b)) && (!F || v.getTreeNode(F)) && (b = F), v.removeTreeNode(c);
|
574
|
+
}, [
|
575
|
+
c
|
520
576
|
]);
|
521
|
-
let u =
|
577
|
+
let u = I(() => Kt(c), []), f = I(() => ({
|
522
578
|
focusManager: u,
|
523
579
|
parentNode: s
|
524
580
|
}), [
|
525
581
|
s,
|
526
582
|
u
|
527
583
|
]);
|
528
|
-
return /* @__PURE__ */
|
529
|
-
value:
|
530
|
-
}, /* @__PURE__ */
|
584
|
+
return /* @__PURE__ */ $.createElement(we.Provider, {
|
585
|
+
value: f
|
586
|
+
}, /* @__PURE__ */ $.createElement("span", {
|
531
587
|
"data-focus-scope-start": !0,
|
532
588
|
hidden: !0,
|
533
589
|
ref: a
|
534
|
-
}), t, /* @__PURE__ */
|
590
|
+
}), t, /* @__PURE__ */ $.createElement("span", {
|
535
591
|
"data-focus-scope-end": !0,
|
536
592
|
hidden: !0,
|
537
593
|
ref: i
|
538
594
|
}));
|
539
595
|
}
|
540
|
-
function
|
596
|
+
function Kt(e) {
|
541
597
|
return {
|
542
598
|
focusNext(t = {}) {
|
543
|
-
let n = e.current, { from: r, tabbable: o, wrap: a, accept: i } = t,
|
599
|
+
let n = e.current, { from: r, tabbable: o, wrap: a, accept: i } = t, c = r || document.activeElement, l = n[0].previousElementSibling, s = C(n), u = P(s, {
|
544
600
|
tabbable: o,
|
545
601
|
accept: i
|
546
602
|
}, n);
|
547
|
-
|
548
|
-
let
|
549
|
-
return !
|
603
|
+
u.currentNode = E(c, n) ? c : l;
|
604
|
+
let f = u.nextNode();
|
605
|
+
return !f && a && (u.currentNode = l, f = u.nextNode()), f && N(f, !0), f;
|
550
606
|
},
|
551
607
|
focusPrevious(t = {}) {
|
552
|
-
let n = e.current, { from: r, tabbable: o, wrap: a, accept: i } = t,
|
608
|
+
let n = e.current, { from: r, tabbable: o, wrap: a, accept: i } = t, c = r || document.activeElement, l = n[n.length - 1].nextElementSibling, s = C(n), u = P(s, {
|
553
609
|
tabbable: o,
|
554
610
|
accept: i
|
555
611
|
}, n);
|
556
|
-
|
557
|
-
let
|
558
|
-
return !
|
612
|
+
u.currentNode = E(c, n) ? c : l;
|
613
|
+
let f = u.previousNode();
|
614
|
+
return !f && a && (u.currentNode = l, f = u.previousNode()), f && N(f, !0), f;
|
559
615
|
},
|
560
616
|
focusFirst(t = {}) {
|
561
|
-
let n = e.current, { tabbable: r, accept: o } = t, a =
|
617
|
+
let n = e.current, { tabbable: r, accept: o } = t, a = C(n), i = P(a, {
|
562
618
|
tabbable: r,
|
563
619
|
accept: o
|
564
620
|
}, n);
|
565
|
-
|
566
|
-
let
|
567
|
-
return
|
621
|
+
i.currentNode = n[0].previousElementSibling;
|
622
|
+
let c = i.nextNode();
|
623
|
+
return c && N(c, !0), c;
|
568
624
|
},
|
569
625
|
focusLast(t = {}) {
|
570
|
-
let n = e.current, { tabbable: r, accept: o } = t, a =
|
626
|
+
let n = e.current, { tabbable: r, accept: o } = t, a = C(n), i = P(a, {
|
571
627
|
tabbable: r,
|
572
628
|
accept: o
|
573
629
|
}, n);
|
574
|
-
|
575
|
-
let
|
576
|
-
return
|
630
|
+
i.currentNode = n[n.length - 1].nextElementSibling;
|
631
|
+
let c = i.previousNode();
|
632
|
+
return c && N(c, !0), c;
|
577
633
|
}
|
578
634
|
};
|
579
635
|
}
|
580
|
-
const
|
636
|
+
const ce = [
|
581
637
|
"input:not([disabled]):not([type=hidden])",
|
582
638
|
"select:not([disabled])",
|
583
639
|
"textarea:not([disabled])",
|
@@ -591,13 +647,13 @@ const se = [
|
|
591
647
|
"audio[controls]",
|
592
648
|
"video[controls]",
|
593
649
|
"[contenteditable]"
|
594
|
-
],
|
595
|
-
|
596
|
-
const
|
597
|
-
function
|
650
|
+
], qt = ce.join(":not([hidden]),") + ",[tabindex]:not([disabled]):not([hidden])";
|
651
|
+
ce.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
|
652
|
+
const jt = ce.join(':not([hidden]):not([tabindex="-1"]),');
|
653
|
+
function C(e) {
|
598
654
|
return e[0].parentElement;
|
599
655
|
}
|
600
|
-
function
|
656
|
+
function A(e) {
|
601
657
|
let t = v.getTreeNode(b);
|
602
658
|
for (; t && t.scopeRef !== e; ) {
|
603
659
|
if (t.contain)
|
@@ -606,63 +662,70 @@ function V(e) {
|
|
606
662
|
}
|
607
663
|
return !0;
|
608
664
|
}
|
609
|
-
function
|
610
|
-
let n =
|
611
|
-
|
665
|
+
function zt(e, t) {
|
666
|
+
let n = w(), r = w();
|
667
|
+
h(() => {
|
612
668
|
let o = e.current;
|
613
669
|
if (!t) {
|
614
|
-
r.current && (cancelAnimationFrame(r.current), r.current =
|
670
|
+
r.current && (cancelAnimationFrame(r.current), r.current = void 0);
|
615
671
|
return;
|
616
672
|
}
|
617
|
-
let a = (
|
618
|
-
if (
|
673
|
+
let a = (l) => {
|
674
|
+
if (l.key !== "Tab" || l.altKey || l.ctrlKey || l.metaKey || !A(e))
|
619
675
|
return;
|
620
676
|
let s = document.activeElement, u = e.current;
|
621
|
-
if (!
|
677
|
+
if (!u || !E(s, u))
|
622
678
|
return;
|
623
|
-
let
|
679
|
+
let f = C(u), d = P(f, {
|
624
680
|
tabbable: !0
|
625
681
|
}, u);
|
626
|
-
|
627
|
-
|
628
|
-
d
|
629
|
-
|
630
|
-
|
631
|
-
},
|
682
|
+
if (!s)
|
683
|
+
return;
|
684
|
+
d.currentNode = s;
|
685
|
+
let p = l.shiftKey ? d.previousNode() : d.nextNode();
|
686
|
+
p || (d.currentNode = l.shiftKey ? u[u.length - 1].nextElementSibling : u[0].previousElementSibling, p = l.shiftKey ? d.previousNode() : d.nextNode()), l.preventDefault(), p && N(p, !0);
|
687
|
+
}, i = (l) => {
|
688
|
+
(!b || J(b, e)) && E(l.target, e.current) ? (b = e, n.current = l.target) : A(e) && !U(l.target, e) ? n.current ? n.current.focus() : b && b.current && X(b.current) : A(e) && (n.current = l.target);
|
689
|
+
}, c = (l) => {
|
632
690
|
r.current && cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
|
633
|
-
|
691
|
+
if (document.activeElement && A(e) && !U(document.activeElement, e))
|
692
|
+
if (b = e, document.body.contains(l.target)) {
|
693
|
+
var s;
|
694
|
+
n.current = l.target, (s = n.current) === null || s === void 0 || s.focus();
|
695
|
+
} else
|
696
|
+
b.current && X(b.current);
|
634
697
|
});
|
635
698
|
};
|
636
|
-
return document.addEventListener("keydown", a, !1), document.addEventListener("focusin", i, !1), o.forEach((
|
637
|
-
document.removeEventListener("keydown", a, !1), document.removeEventListener("focusin", i, !1), o.forEach((
|
699
|
+
return document.addEventListener("keydown", a, !1), document.addEventListener("focusin", i, !1), o == null || o.forEach((l) => l.addEventListener("focusin", i, !1)), o == null || o.forEach((l) => l.addEventListener("focusout", c, !1)), () => {
|
700
|
+
document.removeEventListener("keydown", a, !1), document.removeEventListener("focusin", i, !1), o == null || o.forEach((l) => l.removeEventListener("focusin", i, !1)), o == null || o.forEach((l) => l.removeEventListener("focusout", c, !1));
|
638
701
|
};
|
639
702
|
}, [
|
640
703
|
e,
|
641
704
|
t
|
642
|
-
]),
|
705
|
+
]), h(() => () => {
|
643
706
|
r.current && cancelAnimationFrame(r.current);
|
644
707
|
}, [
|
645
708
|
r
|
646
709
|
]);
|
647
710
|
}
|
648
711
|
function Ae(e) {
|
649
|
-
return
|
712
|
+
return U(e);
|
650
713
|
}
|
651
|
-
function
|
652
|
-
return t.some((n) => n.contains(e));
|
714
|
+
function E(e, t) {
|
715
|
+
return !e || !t ? !1 : t.some((n) => n.contains(e));
|
653
716
|
}
|
654
|
-
function
|
717
|
+
function U(e, t = null) {
|
655
718
|
if (e instanceof Element && e.closest("[data-react-aria-top-layer]"))
|
656
719
|
return !0;
|
657
720
|
for (let { scopeRef: n } of v.traverse(v.getTreeNode(t)))
|
658
|
-
if (
|
721
|
+
if (n && E(e, n.current))
|
659
722
|
return !0;
|
660
723
|
return !1;
|
661
724
|
}
|
662
|
-
function
|
663
|
-
return
|
725
|
+
function _t(e) {
|
726
|
+
return U(e, b);
|
664
727
|
}
|
665
|
-
function
|
728
|
+
function J(e, t) {
|
666
729
|
var n;
|
667
730
|
let r = (n = v.getTreeNode(t)) === null || n === void 0 ? void 0 : n.parent;
|
668
731
|
for (; r; ) {
|
@@ -684,34 +747,34 @@ function N(e, t = !1) {
|
|
684
747
|
} catch {
|
685
748
|
}
|
686
749
|
}
|
687
|
-
function
|
688
|
-
let n = e[0].previousElementSibling, r =
|
750
|
+
function X(e, t = !0) {
|
751
|
+
let n = e[0].previousElementSibling, r = C(e), o = P(r, {
|
689
752
|
tabbable: t
|
690
753
|
}, e);
|
691
|
-
|
692
|
-
let
|
693
|
-
t && !
|
754
|
+
o.currentNode = n;
|
755
|
+
let a = o.nextNode();
|
756
|
+
t && !a && (r = C(e), o = P(r, {
|
694
757
|
tabbable: !1
|
695
|
-
}, e),
|
758
|
+
}, e), o.currentNode = n, a = o.nextNode()), N(a);
|
696
759
|
}
|
697
|
-
function
|
698
|
-
const n =
|
699
|
-
|
700
|
-
n.current && (b = e,
|
760
|
+
function Gt(e, t) {
|
761
|
+
const n = $.useRef(t);
|
762
|
+
S(() => {
|
763
|
+
n.current && (b = e, !E(document.activeElement, b.current) && e.current && X(e.current)), n.current = !1;
|
701
764
|
}, [
|
702
765
|
e
|
703
766
|
]);
|
704
767
|
}
|
705
|
-
function
|
706
|
-
|
768
|
+
function Yt(e, t, n) {
|
769
|
+
h(() => {
|
707
770
|
if (t || n)
|
708
771
|
return;
|
709
772
|
let r = e.current, o = (a) => {
|
710
773
|
let i = a.target;
|
711
|
-
|
774
|
+
E(i, e.current) ? b = e : Ae(i) || (b = null);
|
712
775
|
};
|
713
|
-
return document.addEventListener("focusin", o, !1), r.forEach((a) => a.addEventListener("focusin", o, !1)), () => {
|
714
|
-
document.removeEventListener("focusin", o, !1), r.forEach((a) => a.removeEventListener("focusin", o, !1));
|
776
|
+
return document.addEventListener("focusin", o, !1), r == null || r.forEach((a) => a.addEventListener("focusin", o, !1)), () => {
|
777
|
+
document.removeEventListener("focusin", o, !1), r == null || r.forEach((a) => a.removeEventListener("focusin", o, !1));
|
715
778
|
};
|
716
779
|
}, [
|
717
780
|
e,
|
@@ -719,7 +782,7 @@ function Rt(e, t, n) {
|
|
719
782
|
n
|
720
783
|
]);
|
721
784
|
}
|
722
|
-
function
|
785
|
+
function Ut(e) {
|
723
786
|
let t = v.getTreeNode(b);
|
724
787
|
for (; t && t.scopeRef !== e; ) {
|
725
788
|
if (t.nodeToRestore)
|
@@ -728,86 +791,103 @@ function Wt(e) {
|
|
728
791
|
}
|
729
792
|
return (t == null ? void 0 : t.scopeRef) === e;
|
730
793
|
}
|
731
|
-
function
|
732
|
-
const r =
|
733
|
-
|
794
|
+
function Jt(e, t, n) {
|
795
|
+
const r = w(typeof document < "u" ? document.activeElement : null);
|
796
|
+
h(() => {
|
734
797
|
let o = e.current;
|
735
798
|
if (!t || n)
|
736
799
|
return;
|
737
800
|
let a = () => {
|
738
|
-
(!b ||
|
801
|
+
(!b || J(b, e)) && E(document.activeElement, e.current) && (b = e);
|
739
802
|
};
|
740
|
-
return document.addEventListener("focusin", a, !1), o.forEach((i) => i.addEventListener("focusin", a, !1)), () => {
|
741
|
-
document.removeEventListener("focusin", a, !1), o.forEach((i) => i.removeEventListener("focusin", a, !1));
|
803
|
+
return document.addEventListener("focusin", a, !1), o == null || o.forEach((i) => i.addEventListener("focusin", a, !1)), () => {
|
804
|
+
document.removeEventListener("focusin", a, !1), o == null || o.forEach((i) => i.removeEventListener("focusin", a, !1));
|
742
805
|
};
|
743
806
|
}, [
|
744
807
|
e,
|
745
808
|
n
|
746
|
-
]),
|
809
|
+
]), h(() => {
|
747
810
|
if (!t)
|
748
811
|
return;
|
749
|
-
v.getTreeNode(e).nodeToRestore = r.current;
|
750
812
|
let o = (a) => {
|
751
|
-
if (a.key !== "Tab" || a.altKey || a.ctrlKey || a.metaKey)
|
813
|
+
if (a.key !== "Tab" || a.altKey || a.ctrlKey || a.metaKey || !A(e))
|
752
814
|
return;
|
753
815
|
let i = document.activeElement;
|
754
|
-
if (!
|
816
|
+
if (!E(i, e.current))
|
817
|
+
return;
|
818
|
+
let c = v.getTreeNode(e);
|
819
|
+
if (!c)
|
755
820
|
return;
|
756
|
-
let l =
|
821
|
+
let l = c.nodeToRestore, s = P(document.body, {
|
757
822
|
tabbable: !0
|
758
823
|
});
|
759
|
-
|
760
|
-
let
|
761
|
-
if ((!document.body.contains(l) || l === document.body) && (l =
|
762
|
-
|
824
|
+
s.currentNode = i;
|
825
|
+
let u = a.shiftKey ? s.previousNode() : s.nextNode();
|
826
|
+
if ((!l || !document.body.contains(l) || l === document.body) && (l = void 0, c.nodeToRestore = void 0), (!u || !E(u, e.current)) && l) {
|
827
|
+
s.currentNode = l;
|
763
828
|
do
|
764
|
-
|
765
|
-
while (
|
766
|
-
a.preventDefault(), a.stopPropagation(),
|
829
|
+
u = a.shiftKey ? s.previousNode() : s.nextNode();
|
830
|
+
while (E(u, e.current));
|
831
|
+
a.preventDefault(), a.stopPropagation(), u ? N(u, !0) : Ae(l) ? N(l, !0) : i.blur();
|
767
832
|
}
|
768
833
|
};
|
769
834
|
return n || document.addEventListener("keydown", o, !0), () => {
|
770
835
|
n || document.removeEventListener("keydown", o, !0);
|
771
|
-
let a = v.getTreeNode(e).nodeToRestore;
|
772
|
-
if (t && a && (g(document.activeElement, e.current) || document.activeElement === document.body && Wt(e))) {
|
773
|
-
let i = v.clone();
|
774
|
-
requestAnimationFrame(() => {
|
775
|
-
if (document.activeElement === document.body) {
|
776
|
-
let l = i.getTreeNode(e);
|
777
|
-
for (; l; ) {
|
778
|
-
if (l.nodeToRestore && document.body.contains(l.nodeToRestore)) {
|
779
|
-
N(l.nodeToRestore);
|
780
|
-
return;
|
781
|
-
}
|
782
|
-
l = l.parent;
|
783
|
-
}
|
784
|
-
for (l = i.getTreeNode(e); l; ) {
|
785
|
-
if (l.scopeRef && v.getTreeNode(l.scopeRef)) {
|
786
|
-
J(l.scopeRef.current, !0);
|
787
|
-
return;
|
788
|
-
}
|
789
|
-
l = l.parent;
|
790
|
-
}
|
791
|
-
}
|
792
|
-
});
|
793
|
-
}
|
794
836
|
};
|
795
837
|
}, [
|
796
838
|
e,
|
797
839
|
t,
|
798
840
|
n
|
841
|
+
]), h(() => {
|
842
|
+
if (!t)
|
843
|
+
return;
|
844
|
+
let o = v.getTreeNode(e);
|
845
|
+
if (!!o) {
|
846
|
+
var a;
|
847
|
+
return o.nodeToRestore = (a = r.current) !== null && a !== void 0 ? a : void 0, () => {
|
848
|
+
let i = v.getTreeNode(e);
|
849
|
+
if (!i)
|
850
|
+
return;
|
851
|
+
let c = i.nodeToRestore;
|
852
|
+
if (t && c && (E(document.activeElement, e.current) || document.activeElement === document.body && Ut(e))) {
|
853
|
+
let l = v.clone();
|
854
|
+
requestAnimationFrame(() => {
|
855
|
+
if (document.activeElement === document.body) {
|
856
|
+
let s = l.getTreeNode(e);
|
857
|
+
for (; s; ) {
|
858
|
+
if (s.nodeToRestore && document.body.contains(s.nodeToRestore)) {
|
859
|
+
N(s.nodeToRestore);
|
860
|
+
return;
|
861
|
+
}
|
862
|
+
s = s.parent;
|
863
|
+
}
|
864
|
+
for (s = l.getTreeNode(e); s; ) {
|
865
|
+
if (s.scopeRef && s.scopeRef.current && v.getTreeNode(s.scopeRef)) {
|
866
|
+
X(s.scopeRef.current, !0);
|
867
|
+
return;
|
868
|
+
}
|
869
|
+
s = s.parent;
|
870
|
+
}
|
871
|
+
}
|
872
|
+
});
|
873
|
+
}
|
874
|
+
};
|
875
|
+
}
|
876
|
+
}, [
|
877
|
+
e,
|
878
|
+
t
|
799
879
|
]);
|
800
880
|
}
|
801
|
-
function
|
802
|
-
let r = t != null && t.tabbable ?
|
881
|
+
function P(e, t, n) {
|
882
|
+
let r = t != null && t.tabbable ? jt : qt, o = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
803
883
|
acceptNode(a) {
|
804
884
|
var i;
|
805
|
-
return !(t == null || (i = t.from) === null || i === void 0) && i.contains(a) ? NodeFilter.FILTER_REJECT : a.matches(r) &&
|
885
|
+
return !(t == null || (i = t.from) === null || i === void 0) && i.contains(a) ? NodeFilter.FILTER_REJECT : a.matches(r) && De(a) && (!n || E(a, n)) && (!(t != null && t.accept) || t.accept(a)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
806
886
|
}
|
807
887
|
});
|
808
888
|
return t != null && t.from && (o.currentNode = t.from), o;
|
809
889
|
}
|
810
|
-
class
|
890
|
+
class se {
|
811
891
|
get size() {
|
812
892
|
return this.fastMap.size;
|
813
893
|
}
|
@@ -815,7 +895,10 @@ class ue {
|
|
815
895
|
return this.fastMap.get(t);
|
816
896
|
}
|
817
897
|
addTreeNode(t, n, r) {
|
818
|
-
let o = this.fastMap.get(n != null ? n : null)
|
898
|
+
let o = this.fastMap.get(n != null ? n : null);
|
899
|
+
if (!o)
|
900
|
+
return;
|
901
|
+
let a = new ae({
|
819
902
|
scopeRef: t
|
820
903
|
});
|
821
904
|
o.addChild(a), a.parent = o, this.fastMap.set(t, a), r && (a.nodeToRestore = r);
|
@@ -826,11 +909,14 @@ class ue {
|
|
826
909
|
removeTreeNode(t) {
|
827
910
|
if (t === null)
|
828
911
|
return;
|
829
|
-
let n = this.fastMap.get(t)
|
912
|
+
let n = this.fastMap.get(t);
|
913
|
+
if (!n)
|
914
|
+
return;
|
915
|
+
let r = n.parent;
|
830
916
|
for (let a of this.traverse())
|
831
|
-
a !== n && n.nodeToRestore && a.nodeToRestore && n.scopeRef.current &&
|
917
|
+
a !== n && n.nodeToRestore && a.nodeToRestore && n.scopeRef && n.scopeRef.current && E(a.nodeToRestore, n.scopeRef.current) && (a.nodeToRestore = n.nodeToRestore);
|
832
918
|
let o = n.children;
|
833
|
-
r.removeChild(n), o.size > 0 && o.forEach((a) => r.addChild(a)), this.fastMap.delete(n.scopeRef);
|
919
|
+
r && (r.removeChild(n), o.size > 0 && o.forEach((a) => r && r.addChild(a))), this.fastMap.delete(n.scopeRef);
|
834
920
|
}
|
835
921
|
*traverse(t = this.root) {
|
836
922
|
if (t.scopeRef != null && (yield t), t.children.size > 0)
|
@@ -838,13 +924,15 @@ class ue {
|
|
838
924
|
yield* this.traverse(n);
|
839
925
|
}
|
840
926
|
clone() {
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
927
|
+
var t;
|
928
|
+
let n = new se();
|
929
|
+
var r;
|
930
|
+
for (let o of this.traverse())
|
931
|
+
n.addTreeNode(o.scopeRef, (r = (t = o.parent) === null || t === void 0 ? void 0 : t.scopeRef) !== null && r !== void 0 ? r : null, o.nodeToRestore);
|
932
|
+
return n;
|
845
933
|
}
|
846
934
|
constructor() {
|
847
|
-
|
935
|
+
this.fastMap = /* @__PURE__ */ new Map(), this.root = new ae({
|
848
936
|
scopeRef: null
|
849
937
|
}), this.fastMap.set(null, this.root);
|
850
938
|
}
|
@@ -857,56 +945,56 @@ class ae {
|
|
857
945
|
this.children.delete(t), t.parent = void 0;
|
858
946
|
}
|
859
947
|
constructor(t) {
|
860
|
-
|
948
|
+
this.children = /* @__PURE__ */ new Set(), this.contain = !1, this.scopeRef = t.scopeRef;
|
861
949
|
}
|
862
950
|
}
|
863
|
-
let v = new
|
864
|
-
const
|
865
|
-
function
|
866
|
-
let { onClose: n, shouldCloseOnBlur: r, isOpen: o, isDismissable: a = !1, isKeyboardDismissDisabled: i = !1, shouldCloseOnInteractOutside:
|
867
|
-
|
868
|
-
let
|
869
|
-
|
951
|
+
let v = new se();
|
952
|
+
const Xt = /* @__PURE__ */ new WeakMap(), x = [];
|
953
|
+
function Qt(e, t) {
|
954
|
+
let { onClose: n, shouldCloseOnBlur: r, isOpen: o, isDismissable: a = !1, isKeyboardDismissDisabled: i = !1, shouldCloseOnInteractOutside: c } = e;
|
955
|
+
S(() => (o && x.push(t), () => {
|
956
|
+
let m = x.indexOf(t);
|
957
|
+
m >= 0 && x.splice(m, 1);
|
870
958
|
}), [
|
871
959
|
o,
|
872
960
|
t
|
873
961
|
]);
|
874
|
-
let
|
875
|
-
|
876
|
-
}, s = (
|
877
|
-
(!
|
878
|
-
}, u = (
|
879
|
-
(!
|
880
|
-
},
|
881
|
-
|
962
|
+
let l = () => {
|
963
|
+
x[x.length - 1] === t && n && n();
|
964
|
+
}, s = (m) => {
|
965
|
+
(!c || c(m.target)) && x[x.length - 1] === t && (m.stopPropagation(), m.preventDefault());
|
966
|
+
}, u = (m) => {
|
967
|
+
(!c || c(m.target)) && (x[x.length - 1] === t && (m.stopPropagation(), m.preventDefault()), l());
|
968
|
+
}, f = (m) => {
|
969
|
+
m.key === "Escape" && !i && (m.stopPropagation(), m.preventDefault(), l());
|
882
970
|
};
|
883
|
-
|
971
|
+
Bt({
|
884
972
|
ref: t,
|
885
|
-
onInteractOutside: a ? u : null,
|
973
|
+
onInteractOutside: a && o ? u : null,
|
886
974
|
onInteractOutsideStart: s
|
887
975
|
});
|
888
|
-
let { focusWithinProps: d } =
|
976
|
+
let { focusWithinProps: d } = It({
|
889
977
|
isDisabled: !r,
|
890
|
-
onBlurWithin: (
|
891
|
-
|
978
|
+
onBlurWithin: (m) => {
|
979
|
+
!m.relatedTarget || _t(m.relatedTarget) || (!c || c(m.relatedTarget)) && n();
|
892
980
|
}
|
893
|
-
}),
|
894
|
-
|
981
|
+
}), p = (m) => {
|
982
|
+
m.target === m.currentTarget && m.preventDefault();
|
895
983
|
};
|
896
984
|
return {
|
897
985
|
overlayProps: {
|
898
|
-
onKeyDown:
|
986
|
+
onKeyDown: f,
|
899
987
|
...d
|
900
988
|
},
|
901
989
|
underlayProps: {
|
902
|
-
onPointerDown:
|
990
|
+
onPointerDown: p
|
903
991
|
}
|
904
992
|
};
|
905
993
|
}
|
906
|
-
function
|
994
|
+
function Zt(e, t, n) {
|
907
995
|
let { type: r } = e, { isOpen: o } = t;
|
908
|
-
|
909
|
-
n && n.current &&
|
996
|
+
S(() => {
|
997
|
+
n && n.current && Xt.set(n.current, t.close);
|
910
998
|
});
|
911
999
|
let a;
|
912
1000
|
r === "menu" ? a = !0 : r === "listbox" && (a = "listbox");
|
@@ -923,7 +1011,7 @@ function qt(e, t, n) {
|
|
923
1011
|
}
|
924
1012
|
};
|
925
1013
|
}
|
926
|
-
const
|
1014
|
+
const ee = typeof document < "u" && window.visualViewport, en = /* @__PURE__ */ new Set([
|
927
1015
|
"checkbox",
|
928
1016
|
"radio",
|
929
1017
|
"range",
|
@@ -934,78 +1022,78 @@ const Z = typeof window < "u" && window.visualViewport, jt = /* @__PURE__ */ new
|
|
934
1022
|
"submit",
|
935
1023
|
"reset"
|
936
1024
|
]);
|
937
|
-
let
|
938
|
-
function
|
1025
|
+
let z = 0, te;
|
1026
|
+
function tn(e = {}) {
|
939
1027
|
let { isDisabled: t } = e;
|
940
|
-
|
1028
|
+
h(() => {
|
941
1029
|
if (!t)
|
942
|
-
return
|
943
|
-
|
1030
|
+
return z++, z === 1 && (xt() ? te = rn() : te = nn()), () => {
|
1031
|
+
z--, z === 0 && te();
|
944
1032
|
};
|
945
1033
|
}, [
|
946
1034
|
t
|
947
1035
|
]);
|
948
1036
|
}
|
949
|
-
function
|
950
|
-
return
|
1037
|
+
function nn() {
|
1038
|
+
return Y(B(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), B(document.documentElement, "overflow", "hidden"));
|
951
1039
|
}
|
952
|
-
function
|
953
|
-
let e, t = 0, n = (
|
954
|
-
e =
|
955
|
-
}, r = (
|
956
|
-
if (e === document.documentElement || e === document.body) {
|
957
|
-
|
1040
|
+
function rn() {
|
1041
|
+
let e, t = 0, n = (f) => {
|
1042
|
+
e = Oe(f.target), !(e === document.documentElement && e === document.body) && (t = f.changedTouches[0].pageY);
|
1043
|
+
}, r = (f) => {
|
1044
|
+
if (!e || e === document.documentElement || e === document.body) {
|
1045
|
+
f.preventDefault();
|
958
1046
|
return;
|
959
1047
|
}
|
960
|
-
let d =
|
961
|
-
|
962
|
-
}, o = (
|
963
|
-
let d =
|
964
|
-
|
1048
|
+
let d = f.changedTouches[0].pageY, p = e.scrollTop, m = e.scrollHeight - e.clientHeight;
|
1049
|
+
m !== 0 && ((p <= 0 && d > t || p >= m && d < t) && f.preventDefault(), t = d);
|
1050
|
+
}, o = (f) => {
|
1051
|
+
let d = f.target;
|
1052
|
+
Te(d) && d !== document.activeElement && (f.preventDefault(), d.style.transform = "translateY(-2000px)", d.focus(), requestAnimationFrame(() => {
|
965
1053
|
d.style.transform = "";
|
966
1054
|
}));
|
967
|
-
}, a = (
|
968
|
-
let d =
|
969
|
-
|
970
|
-
d.style.transform = "",
|
971
|
-
|
972
|
-
}) :
|
1055
|
+
}, a = (f) => {
|
1056
|
+
let d = f.target;
|
1057
|
+
Te(d) && (d.style.transform = "translateY(-2000px)", requestAnimationFrame(() => {
|
1058
|
+
d.style.transform = "", ee && (ee.height < window.innerHeight ? requestAnimationFrame(() => {
|
1059
|
+
ye(d);
|
1060
|
+
}) : ee.addEventListener("resize", () => ye(d), {
|
973
1061
|
once: !0
|
974
1062
|
}));
|
975
1063
|
}));
|
976
1064
|
}, i = () => {
|
977
1065
|
window.scrollTo(0, 0);
|
978
|
-
},
|
1066
|
+
}, c = window.pageXOffset, l = window.pageYOffset, s = Y(B(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), B(document.documentElement, "overflow", "hidden"), B(document.body, "marginTop", `-${l}px`));
|
979
1067
|
window.scrollTo(0, 0);
|
980
|
-
let u =
|
1068
|
+
let u = Y(M(document, "touchstart", n, {
|
981
1069
|
passive: !1,
|
982
1070
|
capture: !0
|
983
|
-
}),
|
1071
|
+
}), M(document, "touchmove", r, {
|
984
1072
|
passive: !1,
|
985
1073
|
capture: !0
|
986
|
-
}),
|
1074
|
+
}), M(document, "touchend", o, {
|
987
1075
|
passive: !1,
|
988
1076
|
capture: !0
|
989
|
-
}),
|
1077
|
+
}), M(document, "focus", a, !0), M(window, "scroll", i));
|
990
1078
|
return () => {
|
991
|
-
s(), u(), window.scrollTo(
|
1079
|
+
s(), u(), window.scrollTo(c, l);
|
992
1080
|
};
|
993
1081
|
}
|
994
|
-
function
|
1082
|
+
function B(e, t, n) {
|
995
1083
|
let r = e.style[t];
|
996
1084
|
return e.style[t] = n, () => {
|
997
1085
|
e.style[t] = r;
|
998
1086
|
};
|
999
1087
|
}
|
1000
|
-
function
|
1088
|
+
function M(e, t, n, r) {
|
1001
1089
|
return e.addEventListener(t, n, r), () => {
|
1002
1090
|
e.removeEventListener(t, n, r);
|
1003
1091
|
};
|
1004
1092
|
}
|
1005
|
-
function
|
1093
|
+
function ye(e) {
|
1006
1094
|
let t = document.scrollingElement || document.documentElement;
|
1007
1095
|
for (; e && e !== t; ) {
|
1008
|
-
let n =
|
1096
|
+
let n = Oe(e);
|
1009
1097
|
if (n !== document.documentElement && n !== document.body && n !== e) {
|
1010
1098
|
let r = n.getBoundingClientRect().top, o = e.getBoundingClientRect().top;
|
1011
1099
|
o > r + e.clientHeight && (n.scrollTop += o - r);
|
@@ -1013,37 +1101,37 @@ function Te(e) {
|
|
1013
1101
|
e = n.parentElement;
|
1014
1102
|
}
|
1015
1103
|
}
|
1016
|
-
function
|
1017
|
-
return e instanceof HTMLInputElement && !
|
1104
|
+
function Te(e) {
|
1105
|
+
return e instanceof HTMLInputElement && !en.has(e.type) || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable;
|
1018
1106
|
}
|
1019
|
-
let
|
1020
|
-
function
|
1021
|
-
let n = new Set(e), r = /* @__PURE__ */ new Set(), o = (
|
1022
|
-
for (let d of
|
1107
|
+
let D = /* @__PURE__ */ new WeakMap(), y = [];
|
1108
|
+
function on(e, t = document.body) {
|
1109
|
+
let n = new Set(e), r = /* @__PURE__ */ new Set(), o = (l) => {
|
1110
|
+
for (let d of l.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))
|
1023
1111
|
n.add(d);
|
1024
1112
|
let s = (d) => {
|
1025
1113
|
if (n.has(d) || r.has(d.parentElement) && d.parentElement.getAttribute("role") !== "row")
|
1026
1114
|
return NodeFilter.FILTER_REJECT;
|
1027
|
-
for (let
|
1028
|
-
if (d.contains(
|
1115
|
+
for (let p of n)
|
1116
|
+
if (d.contains(p))
|
1029
1117
|
return NodeFilter.FILTER_SKIP;
|
1030
1118
|
return NodeFilter.FILTER_ACCEPT;
|
1031
|
-
}, u = document.createTreeWalker(
|
1119
|
+
}, u = document.createTreeWalker(l, NodeFilter.SHOW_ELEMENT, {
|
1032
1120
|
acceptNode: s
|
1033
|
-
}),
|
1034
|
-
if (
|
1121
|
+
}), f = s(l);
|
1122
|
+
if (f === NodeFilter.FILTER_ACCEPT && a(l), f !== NodeFilter.FILTER_REJECT) {
|
1035
1123
|
let d = u.nextNode();
|
1036
1124
|
for (; d != null; )
|
1037
1125
|
a(d), d = u.nextNode();
|
1038
1126
|
}
|
1039
|
-
}, a = (
|
1127
|
+
}, a = (l) => {
|
1040
1128
|
var s;
|
1041
|
-
let u = (s =
|
1042
|
-
|
1129
|
+
let u = (s = D.get(l)) !== null && s !== void 0 ? s : 0;
|
1130
|
+
l.getAttribute("aria-hidden") === "true" && u === 0 || (u === 0 && l.setAttribute("aria-hidden", "true"), r.add(l), D.set(l, u + 1));
|
1043
1131
|
};
|
1044
|
-
|
1045
|
-
let i = new MutationObserver((
|
1046
|
-
for (let s of
|
1132
|
+
y.length && y[y.length - 1].disconnect(), o(t);
|
1133
|
+
let i = new MutationObserver((l) => {
|
1134
|
+
for (let s of l)
|
1047
1135
|
if (!(s.type !== "childList" || s.addedNodes.length === 0) && ![
|
1048
1136
|
...n,
|
1049
1137
|
...r
|
@@ -1058,7 +1146,7 @@ function Jt(e, t = document.body) {
|
|
1058
1146
|
childList: !0,
|
1059
1147
|
subtree: !0
|
1060
1148
|
});
|
1061
|
-
let
|
1149
|
+
let c = {
|
1062
1150
|
observe() {
|
1063
1151
|
i.observe(t, {
|
1064
1152
|
childList: !0,
|
@@ -1069,68 +1157,68 @@ function Jt(e, t = document.body) {
|
|
1069
1157
|
i.disconnect();
|
1070
1158
|
}
|
1071
1159
|
};
|
1072
|
-
return
|
1160
|
+
return y.push(c), () => {
|
1073
1161
|
i.disconnect();
|
1074
|
-
for (let
|
1075
|
-
let s =
|
1076
|
-
s === 1 ? (
|
1162
|
+
for (let l of r) {
|
1163
|
+
let s = D.get(l);
|
1164
|
+
s === 1 ? (l.removeAttribute("aria-hidden"), D.delete(l)) : D.set(l, s - 1);
|
1077
1165
|
}
|
1078
|
-
|
1166
|
+
c === y[y.length - 1] ? (y.pop(), y.length && y[y.length - 1].observe()) : y.splice(y.indexOf(c), 1);
|
1079
1167
|
};
|
1080
1168
|
}
|
1081
|
-
const
|
1082
|
-
function
|
1083
|
-
let t =
|
1084
|
-
contain:
|
1085
|
-
setContain:
|
1169
|
+
const Re = /* @__PURE__ */ $.createContext(null);
|
1170
|
+
function an(e) {
|
1171
|
+
let t = Pe(), { portalContainer: n = t ? null : document.body, isExiting: r } = e, [o, a] = V(!1), i = I(() => ({
|
1172
|
+
contain: o,
|
1173
|
+
setContain: a
|
1086
1174
|
}), [
|
1087
|
-
|
1088
|
-
|
1175
|
+
o,
|
1176
|
+
a
|
1089
1177
|
]);
|
1090
1178
|
if (!n)
|
1091
1179
|
return null;
|
1092
|
-
let
|
1093
|
-
|
1094
|
-
}, /* @__PURE__ */ y.createElement(kt, {
|
1180
|
+
let c = e.children;
|
1181
|
+
return e.disableFocusManagement || (c = /* @__PURE__ */ $.createElement(Ht, {
|
1095
1182
|
restoreFocus: !0,
|
1096
|
-
contain: r
|
1097
|
-
},
|
1098
|
-
|
1183
|
+
contain: o && !r
|
1184
|
+
}, c)), c = /* @__PURE__ */ $.createElement(Re.Provider, {
|
1185
|
+
value: i
|
1186
|
+
}, /* @__PURE__ */ $.createElement(Pt, null, c)), /* @__PURE__ */ Ue.createPortal(c, n);
|
1099
1187
|
}
|
1100
1188
|
function Ie() {
|
1101
|
-
let e =
|
1102
|
-
|
1189
|
+
let e = H(Re), t = e == null ? void 0 : e.setContain;
|
1190
|
+
h(() => {
|
1103
1191
|
t == null || t(!0);
|
1104
1192
|
}, [
|
1105
1193
|
t
|
1106
1194
|
]);
|
1107
1195
|
}
|
1108
|
-
function
|
1109
|
-
let { overlayProps: r, underlayProps: o } =
|
1196
|
+
function ln(e, t, n) {
|
1197
|
+
let { overlayProps: r, underlayProps: o } = Qt({
|
1110
1198
|
...e,
|
1111
1199
|
isOpen: t.isOpen,
|
1112
1200
|
onClose: t.close
|
1113
1201
|
}, n);
|
1114
|
-
return
|
1202
|
+
return tn({
|
1115
1203
|
isDisabled: !t.isOpen
|
1116
|
-
}), Ie(),
|
1204
|
+
}), Ie(), S(() => {
|
1117
1205
|
if (t.isOpen)
|
1118
|
-
return
|
1206
|
+
return on([
|
1119
1207
|
n.current
|
1120
1208
|
]);
|
1121
1209
|
}, [
|
1122
1210
|
t.isOpen,
|
1123
1211
|
n
|
1124
1212
|
]), {
|
1125
|
-
modalProps:
|
1213
|
+
modalProps: ft(r),
|
1126
1214
|
underlayProps: o
|
1127
1215
|
};
|
1128
1216
|
}
|
1129
|
-
function
|
1130
|
-
let { role: n = "dialog" } = e, r =
|
1217
|
+
function cn(e, t) {
|
1218
|
+
let { role: n = "dialog" } = e, r = ut();
|
1131
1219
|
r = e["aria-label"] ? void 0 : r;
|
1132
|
-
let o =
|
1133
|
-
return
|
1220
|
+
let o = w(!1);
|
1221
|
+
return S(() => {
|
1134
1222
|
if (t.current && !t.current.contains(document.activeElement)) {
|
1135
1223
|
oe(t.current);
|
1136
1224
|
let a = setTimeout(() => {
|
@@ -1144,7 +1232,7 @@ function _t(e, t) {
|
|
1144
1232
|
t
|
1145
1233
|
]), Ie(), {
|
1146
1234
|
dialogProps: {
|
1147
|
-
|
1235
|
+
...$t(e, {
|
1148
1236
|
labelable: !0
|
1149
1237
|
}),
|
1150
1238
|
role: n,
|
@@ -1159,7 +1247,7 @@ function _t(e, t) {
|
|
1159
1247
|
}
|
1160
1248
|
};
|
1161
1249
|
}
|
1162
|
-
function
|
1250
|
+
function sn(e, t, n) {
|
1163
1251
|
return t in e ? Object.defineProperty(e, t, {
|
1164
1252
|
value: n,
|
1165
1253
|
enumerable: !0,
|
@@ -1177,55 +1265,48 @@ function xe(e, t) {
|
|
1177
1265
|
}
|
1178
1266
|
return n;
|
1179
1267
|
}
|
1180
|
-
function
|
1268
|
+
function Ne(e) {
|
1181
1269
|
for (var t = 1; t < arguments.length; t++) {
|
1182
1270
|
var n = arguments[t] != null ? arguments[t] : {};
|
1183
1271
|
t % 2 ? xe(Object(n), !0).forEach(function(r) {
|
1184
|
-
|
1272
|
+
sn(e, r, n[r]);
|
1185
1273
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : xe(Object(n)).forEach(function(r) {
|
1186
1274
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
1187
1275
|
});
|
1188
1276
|
}
|
1189
1277
|
return e;
|
1190
1278
|
}
|
1191
|
-
var
|
1279
|
+
var un = (e, t, n) => {
|
1192
1280
|
for (var r of Object.keys(e)) {
|
1193
1281
|
var o;
|
1194
1282
|
if (e[r] !== ((o = t[r]) !== null && o !== void 0 ? o : n[r]))
|
1195
1283
|
return !1;
|
1196
1284
|
}
|
1197
1285
|
return !0;
|
1198
|
-
},
|
1199
|
-
var n = e.defaultClassName, r =
|
1286
|
+
}, dn = (e) => (t) => {
|
1287
|
+
var n = e.defaultClassName, r = Ne(Ne({}, e.defaultVariants), t);
|
1200
1288
|
for (var o in r) {
|
1201
1289
|
var a, i = (a = r[o]) !== null && a !== void 0 ? a : e.defaultVariants[o];
|
1202
1290
|
if (i != null) {
|
1203
|
-
var
|
1204
|
-
typeof
|
1205
|
-
var
|
1206
|
-
|
1291
|
+
var c = i;
|
1292
|
+
typeof c == "boolean" && (c = c === !0 ? "true" : "false");
|
1293
|
+
var l = e.variantClassNames[o][c];
|
1294
|
+
l && (n += " " + l);
|
1207
1295
|
}
|
1208
1296
|
}
|
1209
1297
|
for (var [s, u] of e.compoundVariants)
|
1210
|
-
|
1298
|
+
un(s, r, e.defaultVariants) && (n += " " + u);
|
1211
1299
|
return n;
|
1212
|
-
},
|
1300
|
+
}, fn = dn({ defaultClassName: "_1io4psq1", variantClassNames: { fullWidth: { true: "_1io4psq2", false: "_1io4psq3" } }, defaultVariants: {}, compoundVariants: [] }), pn = "_1io4psq5", mn = "_1io4psq6", bn = "_1io4psq0", vn = "_1io4psq9", $n = "_1io4psqa", hn = "_1io4psq8", gn = "_1io4psq4", En = "_1io4psq7";
|
1213
1301
|
function Be({
|
1214
1302
|
children: e,
|
1215
1303
|
className: t = "",
|
1216
1304
|
...n
|
1217
1305
|
}) {
|
1218
|
-
return /* @__PURE__ */
|
1219
|
-
className: A(cn, t),
|
1220
|
-
...n
|
1221
|
-
}, /* @__PURE__ */ h.createElement("div", {
|
1222
|
-
className: A(an)
|
1223
|
-
}, /* @__PURE__ */ h.createElement("div", {
|
1224
|
-
className: A(ln)
|
1225
|
-
}, e)));
|
1306
|
+
return /* @__PURE__ */ g.createElement("div", { className: R(hn, t), ...n }, /* @__PURE__ */ g.createElement("div", { className: R(vn) }, /* @__PURE__ */ g.createElement("div", { className: R($n) }, e)));
|
1226
1307
|
}
|
1227
1308
|
Se.set(Be, { name: "FocusedTaskActions" });
|
1228
|
-
function
|
1309
|
+
function wn({
|
1229
1310
|
children: e,
|
1230
1311
|
className: t,
|
1231
1312
|
"data-testid": n,
|
@@ -1233,53 +1314,51 @@ function dn({
|
|
1233
1314
|
onFocus: o,
|
1234
1315
|
overlayProps: a,
|
1235
1316
|
state: i,
|
1236
|
-
onClose:
|
1237
|
-
fullWidth:
|
1317
|
+
onClose: c,
|
1318
|
+
fullWidth: l = !1,
|
1238
1319
|
...s
|
1239
1320
|
}) {
|
1240
|
-
const u =
|
1321
|
+
const u = g.useRef(null), { modalProps: f, underlayProps: d } = ln(
|
1241
1322
|
{ ...s },
|
1242
1323
|
i,
|
1243
1324
|
u
|
1244
|
-
), { dialogProps:
|
1245
|
-
function
|
1246
|
-
|
1325
|
+
), { dialogProps: p, titleProps: m } = cn(s, u), F = fe(f.onFocus, p.onFocus, o), Ve = fe(f.onBlur, p.onBlur, r), He = ze({ "data-testid": n }), [Q, Ke] = _e(e, [{ type: Be }]);
|
1326
|
+
function qe() {
|
1327
|
+
c && typeof c == "function" && c(), i.close();
|
1247
1328
|
}
|
1248
|
-
const
|
1249
|
-
return /* @__PURE__ */
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1253
|
-
|
1254
|
-
|
1255
|
-
|
1256
|
-
|
1257
|
-
|
1258
|
-
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
|
1263
|
-
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
className:
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1276
|
-
}
|
1277
|
-
function
|
1278
|
-
return e.state.isOpen ? /* @__PURE__ */
|
1279
|
-
...e
|
1280
|
-
}, e.children) : /* @__PURE__ */ h.createElement(h.Fragment, null);
|
1329
|
+
const ue = function() {
|
1330
|
+
return /* @__PURE__ */ g.createElement(
|
1331
|
+
Ye,
|
1332
|
+
{
|
1333
|
+
"aria-label": "Close",
|
1334
|
+
onClick: qe,
|
1335
|
+
kind: "icon",
|
1336
|
+
icon: "x",
|
1337
|
+
className: pn
|
1338
|
+
}
|
1339
|
+
);
|
1340
|
+
}, je = Ge(Ke, (de) => de.type === ue ? [{ className: R(de.props.classname, mn) }] : []);
|
1341
|
+
return /* @__PURE__ */ g.createElement(an, null, /* @__PURE__ */ g.createElement("div", { className: En, ...d, ...s }, /* @__PURE__ */ g.createElement(
|
1342
|
+
"div",
|
1343
|
+
{
|
1344
|
+
...f,
|
1345
|
+
...p,
|
1346
|
+
...a,
|
1347
|
+
onFocus: F,
|
1348
|
+
onBlur: Ve,
|
1349
|
+
...He("dialog"),
|
1350
|
+
ref: u,
|
1351
|
+
className: R(bn, t)
|
1352
|
+
},
|
1353
|
+
/* @__PURE__ */ g.createElement("div", { ...m, className: gn }, /* @__PURE__ */ g.createElement(ue, null)),
|
1354
|
+
/* @__PURE__ */ g.createElement("div", { className: fn({ fullWidth: l }) }, pe(je, i.close)),
|
1355
|
+
Q && Q.length > 0 && /* @__PURE__ */ g.createElement(g.Fragment, null, pe(Q, i.close))
|
1356
|
+
)));
|
1357
|
+
}
|
1358
|
+
function We(e) {
|
1359
|
+
return e.state.isOpen ? /* @__PURE__ */ g.createElement(wn, { ...e }, e.children) : /* @__PURE__ */ g.createElement(g.Fragment, null);
|
1281
1360
|
}
|
1282
|
-
Se.set(
|
1361
|
+
Se.set(We, {
|
1283
1362
|
name: "FocusedTask",
|
1284
1363
|
props: {
|
1285
1364
|
fullWidth: { type: "boolean", default: "false" },
|
@@ -1288,24 +1367,32 @@ Se.set(Re, {
|
|
1288
1367
|
onFocus: { type: "() => void" }
|
1289
1368
|
}
|
1290
1369
|
});
|
1291
|
-
function
|
1370
|
+
function yn(e) {
|
1292
1371
|
let [t, n] = Je(e.isOpen, e.defaultOpen || !1, e.onOpenChange);
|
1372
|
+
const r = T(() => {
|
1373
|
+
n(!0);
|
1374
|
+
}, [
|
1375
|
+
n
|
1376
|
+
]), o = T(() => {
|
1377
|
+
n(!1);
|
1378
|
+
}, [
|
1379
|
+
n
|
1380
|
+
]), a = T(() => {
|
1381
|
+
n(!t);
|
1382
|
+
}, [
|
1383
|
+
n,
|
1384
|
+
t
|
1385
|
+
]);
|
1293
1386
|
return {
|
1294
1387
|
isOpen: t,
|
1295
1388
|
setOpen: n,
|
1296
|
-
open
|
1297
|
-
|
1298
|
-
|
1299
|
-
close() {
|
1300
|
-
n(!1);
|
1301
|
-
},
|
1302
|
-
toggle() {
|
1303
|
-
n(!t);
|
1304
|
-
}
|
1389
|
+
open: r,
|
1390
|
+
close: o,
|
1391
|
+
toggle: a
|
1305
1392
|
};
|
1306
1393
|
}
|
1307
|
-
function
|
1308
|
-
const t =
|
1394
|
+
function Cn(e = {}) {
|
1395
|
+
const t = yn(e), n = w(null), { triggerProps: r, overlayProps: o } = Zt({ type: "dialog" }, t, n), { onPress: a, ...i } = r;
|
1309
1396
|
return {
|
1310
1397
|
triggerProps: {
|
1311
1398
|
...i,
|
@@ -1316,14 +1403,14 @@ function gn(e = {}) {
|
|
1316
1403
|
focusedTaskProps: { overlayProps: o, state: t }
|
1317
1404
|
};
|
1318
1405
|
}
|
1319
|
-
const
|
1320
|
-
components: [
|
1406
|
+
const Tn = {
|
1407
|
+
components: [We],
|
1321
1408
|
examples: {
|
1322
1409
|
standard: {
|
1323
1410
|
label: "Standard",
|
1324
1411
|
examples: {
|
1325
1412
|
basic: {
|
1326
|
-
react:
|
1413
|
+
react: me`
|
1327
1414
|
import { FocusedTask, FocusedTaskActions } from "@sps-woodland/focused-task";
|
1328
1415
|
import { Button } from "@sps-woodland/buttons";
|
1329
1416
|
import { Card } from "@sps-woodland/cards";
|
@@ -1369,7 +1456,7 @@ const pn = {
|
|
1369
1456
|
label: "Fill Width",
|
1370
1457
|
examples: {
|
1371
1458
|
basic: {
|
1372
|
-
react:
|
1459
|
+
react: me`
|
1373
1460
|
import { FocusedTask, FocusedTaskActions } from "@sps-woodland/focused-task";
|
1374
1461
|
import { Button } from "@sps-woodland/buttons";
|
1375
1462
|
import { Card } from "@sps-woodland/cards";
|
@@ -1413,12 +1500,12 @@ const pn = {
|
|
1413
1500
|
}
|
1414
1501
|
}
|
1415
1502
|
}
|
1416
|
-
},
|
1417
|
-
"Focused Task":
|
1503
|
+
}, Ln = {
|
1504
|
+
"Focused Task": Tn
|
1418
1505
|
};
|
1419
1506
|
export {
|
1420
|
-
|
1507
|
+
We as FocusedTask,
|
1421
1508
|
Be as FocusedTaskActions,
|
1422
|
-
|
1423
|
-
|
1509
|
+
Ln as MANIFEST,
|
1510
|
+
Cn as useFocusedTask
|
1424
1511
|
};
|