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