@lazar-ui/kit 0.1.0 → 0.2.2
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/CHANGELOG.md +83 -0
- package/LICENSE +21 -0
- package/README.md +64 -23
- package/dist/Icon-flib0kme.mjs +684 -0
- package/dist/Icon.css +1 -0
- package/dist/{Overlay-RmiBtqDR.mjs → Overlay-OYo7gW8m.mjs} +165 -156
- package/dist/accordion.css +1 -1
- package/dist/accordion.d.ts +59 -9
- package/dist/accordion.js +59 -41
- package/dist/alert.css +1 -1
- package/dist/alert.js +12 -12
- package/dist/avatar.css +1 -1
- package/dist/avatar.d.ts +2 -2
- package/dist/avatar.js +18 -18
- package/dist/badge.css +1 -1
- package/dist/badge.d.ts +3 -3
- package/dist/badge.js +8 -8
- package/dist/breadcrumbs.css +1 -1
- package/dist/breadcrumbs.js +35 -35
- package/dist/button.css +1 -1
- package/dist/button.d.ts +2 -0
- package/dist/button.js +41 -35
- package/dist/card.css +1 -1
- package/dist/card.js +15 -15
- package/dist/checkbox.css +1 -1
- package/dist/checkbox.js +25 -25
- package/dist/css/palettes/indigo.css +75 -75
- package/dist/css/palettes/monochrome.css +75 -75
- package/dist/css/semantic.css +67 -67
- package/dist/dialog.css +1 -1
- package/dist/dialog.js +61 -60
- package/dist/drawer.css +1 -1
- package/dist/drawer.d.ts +11 -0
- package/dist/drawer.js +102 -81
- package/dist/empty-state.css +1 -1
- package/dist/empty-state.d.ts +1 -1
- package/dist/empty-state.js +27 -26
- package/dist/error-boundary.css +1 -1
- package/dist/error-boundary.js +9 -9
- package/dist/flex.js +6 -6
- package/dist/form-field.css +1 -1
- package/dist/form-field.js +10 -10
- package/dist/icon.d.ts +30 -0
- package/dist/icon.js +4 -0
- package/dist/input.css +1 -1
- package/dist/input.js +77 -103
- package/dist/{config-provider.d.ts → lazar-ui-provider.d.ts} +33 -33
- package/dist/lazar-ui-provider.js +14 -0
- package/dist/menu.css +1 -1
- package/dist/menu.d.ts +3 -3
- package/dist/menu.js +73 -91
- package/dist/pagination.css +1 -1
- package/dist/pagination.js +49 -48
- package/dist/popover.css +1 -1
- package/dist/popover.d.ts +1 -1
- package/dist/popover.js +26 -25
- package/dist/select.css +1 -1
- package/dist/select.js +81 -119
- package/dist/separator.css +1 -1
- package/dist/separator.d.ts +2 -2
- package/dist/separator.js +9 -9
- package/dist/skeleton.css +1 -1
- package/dist/skeleton.js +13 -13
- package/dist/spinner.css +1 -1
- package/dist/spinner.d.ts +2 -2
- package/dist/spinner.js +7 -7
- package/dist/switch.css +1 -1
- package/dist/switch.js +15 -15
- package/dist/table.css +1 -1
- package/dist/table.js +23 -23
- package/dist/tabs.css +1 -1
- package/dist/tabs.js +48 -48
- package/dist/textarea.css +1 -1
- package/dist/textarea.js +17 -17
- package/dist/tooltip.css +1 -1
- package/dist/tooltip.js +34 -33
- package/dist/typography.css +1 -0
- package/dist/typography.d.ts +76 -0
- package/dist/typography.js +40 -0
- package/dist/{useLocale-D2Z0JH0l.mjs → useLocale-DdHNhmvT.mjs} +24 -24
- package/dist/{useModalOverlay-D5Bs9FCB.mjs → useModalOverlay-B93fkWbb.mjs} +2 -2
- package/dist/{useOverlayPosition-DVu1Qziq.mjs → useOverlayPosition-CK3oEqVS.mjs} +1 -1
- package/dist/{useOverlayTriggerState-BIo1Jcba.mjs → useOverlayTriggerState-DK8Xy6Kr.mjs} +1 -1
- package/package.json +17 -4
- package/dist/config-provider.js +0 -14
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import p, { useRef as S, useCallback as de, useContext as M, useState as fe, useMemo as D, useEffect as $e, createContext as Fe } from "react";
|
|
2
|
+
import Re from "react-dom";
|
|
3
3
|
function J(e) {
|
|
4
|
-
if (
|
|
4
|
+
if (Me()) e.focus({
|
|
5
5
|
preventScroll: !0
|
|
6
6
|
});
|
|
7
7
|
else {
|
|
8
|
-
let t =
|
|
9
|
-
e.focus(),
|
|
8
|
+
let t = Oe(e);
|
|
9
|
+
e.focus(), De(t);
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
let V = null;
|
|
13
|
-
function
|
|
13
|
+
function Me() {
|
|
14
14
|
if (V == null) {
|
|
15
15
|
V = !1;
|
|
16
16
|
try {
|
|
@@ -24,7 +24,7 @@ function Fe() {
|
|
|
24
24
|
}
|
|
25
25
|
return V;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function Oe(e) {
|
|
28
28
|
let t = e.parentNode, r = [], n = document.scrollingElement || document.documentElement;
|
|
29
29
|
for (; t instanceof HTMLElement && t !== n; )
|
|
30
30
|
(t.offsetHeight < t.scrollHeight || t.offsetWidth < t.scrollWidth) && r.push({
|
|
@@ -38,20 +38,20 @@ function Re(e) {
|
|
|
38
38
|
scrollLeft: n.scrollLeft
|
|
39
39
|
}), r;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function De(e) {
|
|
42
42
|
for (let { element: t, scrollTop: r, scrollLeft: n } of e)
|
|
43
43
|
t.scrollTop = r, t.scrollLeft = n;
|
|
44
44
|
}
|
|
45
45
|
const h = (e) => e?.ownerDocument ?? document, R = (e) => e && "window" in e && e.window === e ? e : h(e).defaultView || window;
|
|
46
|
-
function
|
|
46
|
+
function Ae(e) {
|
|
47
47
|
return e !== null && typeof e == "object" && "nodeType" in e && typeof e.nodeType == "number";
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
return
|
|
49
|
+
function Pe(e) {
|
|
50
|
+
return Ae(e) && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE && "host" in e;
|
|
51
51
|
}
|
|
52
|
-
let
|
|
52
|
+
let Ke = !1;
|
|
53
53
|
function U() {
|
|
54
|
-
return
|
|
54
|
+
return Ke;
|
|
55
55
|
}
|
|
56
56
|
function W(e, t) {
|
|
57
57
|
if (!U()) return t && e ? e.contains(t) : !1;
|
|
@@ -59,7 +59,7 @@ function W(e, t) {
|
|
|
59
59
|
let r = t;
|
|
60
60
|
for (; r !== null; ) {
|
|
61
61
|
if (r === e) return !0;
|
|
62
|
-
r.tagName === "SLOT" && r.assignedSlot ? r = r.assignedSlot.parentNode :
|
|
62
|
+
r.tagName === "SLOT" && r.assignedSlot ? r = r.assignedSlot.parentNode : Pe(r) ? r = r.host : r = r.parentNode;
|
|
63
63
|
}
|
|
64
64
|
return !1;
|
|
65
65
|
}
|
|
@@ -83,8 +83,8 @@ function Lt(e) {
|
|
|
83
83
|
let n = t.activeElement;
|
|
84
84
|
return n != null && e.contains(n);
|
|
85
85
|
}
|
|
86
|
-
const
|
|
87
|
-
function
|
|
86
|
+
const Ie = typeof Element < "u" && "checkVisibility" in Element.prototype;
|
|
87
|
+
function Ve(e) {
|
|
88
88
|
const t = R(e);
|
|
89
89
|
if (!(e instanceof t.HTMLElement) && !(e instanceof t.SVGElement)) return !1;
|
|
90
90
|
let { display: r, visibility: n } = e.style, o = r !== "none" && n !== "hidden" && n !== "collapse";
|
|
@@ -95,14 +95,14 @@ function Ke(e) {
|
|
|
95
95
|
}
|
|
96
96
|
return o;
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function We(e, t) {
|
|
99
99
|
return !e.hasAttribute("hidden") && // Ignore HiddenSelect when tree walking.
|
|
100
100
|
!e.hasAttribute("data-react-aria-prevent-focus") && (e.nodeName === "DETAILS" && t && t.nodeName !== "SUMMARY" ? e.hasAttribute("open") : !0);
|
|
101
101
|
}
|
|
102
102
|
function te(e, t) {
|
|
103
|
-
return
|
|
103
|
+
return Ie ? e.checkVisibility({
|
|
104
104
|
visibilityProperty: !0
|
|
105
|
-
}) && !e.closest("[data-react-aria-prevent-focus]") : e.nodeName !== "#comment" &&
|
|
105
|
+
}) && !e.closest("[data-react-aria-prevent-focus]") : e.nodeName !== "#comment" && Ve(e) && We(e, t) && (!e.parentElement || te(e.parentElement, e));
|
|
106
106
|
}
|
|
107
107
|
const re = [
|
|
108
108
|
"input:not([disabled]):not([type=hidden])",
|
|
@@ -119,14 +119,14 @@ const re = [
|
|
|
119
119
|
"video[controls]",
|
|
120
120
|
'[contenteditable]:not([contenteditable^="false"])',
|
|
121
121
|
"permission"
|
|
122
|
-
],
|
|
122
|
+
], He = re.join(":not([hidden]),") + ",[tabindex]:not([disabled]):not([hidden])";
|
|
123
123
|
re.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
|
|
124
|
-
const
|
|
125
|
-
function
|
|
126
|
-
return e.matches(
|
|
124
|
+
const je = re.join(':not([hidden]):not([tabindex="-1"]),');
|
|
125
|
+
function Be(e, t) {
|
|
126
|
+
return e.matches(He) && !be(e) && (t?.skipVisibilityCheck || te(e));
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
return e.matches(
|
|
128
|
+
function Ue(e) {
|
|
129
|
+
return e.matches(je) && te(e) && !be(e);
|
|
130
130
|
}
|
|
131
131
|
function be(e) {
|
|
132
132
|
let t = e;
|
|
@@ -136,21 +136,21 @@ function be(e) {
|
|
|
136
136
|
}
|
|
137
137
|
return !1;
|
|
138
138
|
}
|
|
139
|
-
const N = typeof document < "u" ?
|
|
139
|
+
const N = typeof document < "u" ? p.useLayoutEffect : () => {
|
|
140
140
|
};
|
|
141
|
-
function
|
|
141
|
+
function ze(e) {
|
|
142
142
|
let t = e;
|
|
143
143
|
return t.nativeEvent = e, t.isDefaultPrevented = () => t.defaultPrevented, t.isPropagationStopped = () => t.cancelBubble, t.persist = () => {
|
|
144
144
|
}, t;
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function Ct(e, t) {
|
|
147
147
|
Object.defineProperty(e, "target", {
|
|
148
148
|
value: t
|
|
149
149
|
}), Object.defineProperty(e, "currentTarget", {
|
|
150
150
|
value: t
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function kt(e) {
|
|
154
154
|
let t = S({
|
|
155
155
|
isFocused: !1,
|
|
156
156
|
observer: null
|
|
@@ -166,7 +166,7 @@ function Ct(e) {
|
|
|
166
166
|
t.current.isFocused = !0;
|
|
167
167
|
let o = n, i = (c) => {
|
|
168
168
|
if (t.current.isFocused = !1, o.disabled) {
|
|
169
|
-
let a =
|
|
169
|
+
let a = ze(c);
|
|
170
170
|
e?.(a);
|
|
171
171
|
}
|
|
172
172
|
t.current.observer && (t.current.observer.disconnect(), t.current.observer = null);
|
|
@@ -195,7 +195,7 @@ function Ct(e) {
|
|
|
195
195
|
e
|
|
196
196
|
]);
|
|
197
197
|
}
|
|
198
|
-
let
|
|
198
|
+
let Ge = !1;
|
|
199
199
|
function z(e) {
|
|
200
200
|
if (typeof window > "u" || window.navigator == null) return !1;
|
|
201
201
|
let t = window.navigator.userAgentData?.brands;
|
|
@@ -211,33 +211,33 @@ function x(e) {
|
|
|
211
211
|
}
|
|
212
212
|
const P = x(function() {
|
|
213
213
|
return ne(/^Mac/i);
|
|
214
|
-
}),
|
|
214
|
+
}), qe = x(function() {
|
|
215
215
|
return ne(/^iPhone/i);
|
|
216
216
|
}), pe = x(function() {
|
|
217
217
|
return ne(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
218
218
|
P() && navigator.maxTouchPoints > 1;
|
|
219
|
-
}),
|
|
220
|
-
return
|
|
219
|
+
}), Je = x(function() {
|
|
220
|
+
return qe() || pe();
|
|
221
221
|
});
|
|
222
222
|
x(function() {
|
|
223
|
-
return P() ||
|
|
223
|
+
return P() || Je();
|
|
224
224
|
});
|
|
225
|
-
const
|
|
225
|
+
const Ye = x(function() {
|
|
226
226
|
return z(/AppleWebKit/i) && !ve();
|
|
227
227
|
}), ve = x(function() {
|
|
228
228
|
return z(/Chrome/i);
|
|
229
229
|
}), he = x(function() {
|
|
230
230
|
return z(/Android/i);
|
|
231
|
-
}),
|
|
231
|
+
}), Xe = x(function() {
|
|
232
232
|
return z(/Firefox/i);
|
|
233
233
|
});
|
|
234
|
-
function
|
|
234
|
+
function Qe(e) {
|
|
235
235
|
return e.pointerType === "" && e.isTrusted ? !0 : he() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
|
|
236
236
|
}
|
|
237
237
|
function K(e, t, r = !0) {
|
|
238
238
|
let { metaKey: n, ctrlKey: o, altKey: i, shiftKey: c } = t;
|
|
239
|
-
|
|
240
|
-
let a =
|
|
239
|
+
Xe() && window.event?.type?.startsWith("key") && e.target === "_blank" && (P() ? n = !0 : o = !0);
|
|
240
|
+
let a = Ye() && P() && !pe() && process.env.NODE_ENV !== "test" ? new KeyboardEvent("keydown", {
|
|
241
241
|
keyIdentifier: "Enter",
|
|
242
242
|
metaKey: n,
|
|
243
243
|
ctrlKey: o,
|
|
@@ -258,12 +258,12 @@ K.isOpening = !1;
|
|
|
258
258
|
const H = {
|
|
259
259
|
prefix: String(Math.round(Math.random() * 1e10)),
|
|
260
260
|
current: 0
|
|
261
|
-
}, Ee = /* @__PURE__ */
|
|
262
|
-
let
|
|
263
|
-
function
|
|
261
|
+
}, Ee = /* @__PURE__ */ p.createContext(H), Ze = /* @__PURE__ */ p.createContext(!1);
|
|
262
|
+
let et = !!(typeof window < "u" && window.document && window.document.createElement), q = /* @__PURE__ */ new WeakMap();
|
|
263
|
+
function tt(e = !1) {
|
|
264
264
|
let t = M(Ee), r = S(null);
|
|
265
265
|
if (r.current === null && !e) {
|
|
266
|
-
let n =
|
|
266
|
+
let n = p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentOwner?.current;
|
|
267
267
|
if (n) {
|
|
268
268
|
let o = q.get(n);
|
|
269
269
|
o == null ? q.set(n, {
|
|
@@ -275,51 +275,51 @@ function Ze(e = !1) {
|
|
|
275
275
|
}
|
|
276
276
|
return r.current;
|
|
277
277
|
}
|
|
278
|
-
function
|
|
278
|
+
function rt(e) {
|
|
279
279
|
let t = M(Ee);
|
|
280
|
-
t === H && !
|
|
281
|
-
let r =
|
|
280
|
+
t === H && !et && process.env.NODE_ENV !== "production" && console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");
|
|
281
|
+
let r = tt(!!e), n = t === H && process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${t.prefix}`;
|
|
282
282
|
return e || `${n}-${r}`;
|
|
283
283
|
}
|
|
284
|
-
function
|
|
285
|
-
let t =
|
|
284
|
+
function nt(e) {
|
|
285
|
+
let t = p.useId(), [r] = fe(me()), n = r || process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${H.prefix}`;
|
|
286
286
|
return e || `${n}-${t}`;
|
|
287
287
|
}
|
|
288
|
-
const _t = typeof
|
|
289
|
-
function
|
|
288
|
+
const _t = typeof p.useId == "function" ? nt : rt;
|
|
289
|
+
function ot() {
|
|
290
290
|
return !1;
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function it() {
|
|
293
293
|
return !0;
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function at(e) {
|
|
296
296
|
return () => {
|
|
297
297
|
};
|
|
298
298
|
}
|
|
299
299
|
function me() {
|
|
300
|
-
return typeof
|
|
300
|
+
return typeof p.useSyncExternalStore == "function" ? p.useSyncExternalStore(at, ot, it) : M(Ze);
|
|
301
301
|
}
|
|
302
302
|
let I = null;
|
|
303
|
-
const
|
|
303
|
+
const ct = /* @__PURE__ */ new Set();
|
|
304
304
|
let A = /* @__PURE__ */ new Map(), F = !1, Y = !1;
|
|
305
305
|
function oe(e, t) {
|
|
306
|
-
for (let r of
|
|
306
|
+
for (let r of ct) r(e, t);
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function st(e) {
|
|
309
309
|
return !(e.metaKey || !P() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
|
|
310
310
|
}
|
|
311
311
|
function j(e) {
|
|
312
|
-
F = !0, !K.isOpening &&
|
|
312
|
+
F = !0, !K.isOpening && st(e) && (I = "keyboard", oe("keyboard", e));
|
|
313
313
|
}
|
|
314
314
|
function y(e) {
|
|
315
315
|
I = "pointer", "pointerType" in e && e.pointerType, (e.type === "mousedown" || e.type === "pointerdown") && (F = !0, oe("pointer", e));
|
|
316
316
|
}
|
|
317
317
|
function Ne(e) {
|
|
318
|
-
!K.isOpening &&
|
|
318
|
+
!K.isOpening && Qe(e) && (F = !0, I = "virtual");
|
|
319
319
|
}
|
|
320
320
|
function we(e) {
|
|
321
321
|
let t = R(m(e)), r = h(m(e));
|
|
322
|
-
m(e) === t || m(e) === r ||
|
|
322
|
+
m(e) === t || m(e) === r || Ge || !e.isTrusted || (!F && !Y && (I = "virtual", oe("virtual", e)), F = !1, Y = !1);
|
|
323
323
|
}
|
|
324
324
|
function ye() {
|
|
325
325
|
F = !1, Y = !0;
|
|
@@ -343,14 +343,14 @@ const Te = (e, t) => {
|
|
|
343
343
|
const r = R(e), n = h(e);
|
|
344
344
|
t && n.removeEventListener("DOMContentLoaded", t), A.has(r) && (r.HTMLElement.prototype.focus = A.get(r).focus, n.removeEventListener("keydown", j, !0), n.removeEventListener("keyup", j, !0), n.removeEventListener("click", Ne, !0), r.removeEventListener("focus", we, !0), r.removeEventListener("blur", ye, !1), typeof PointerEvent < "u" ? (n.removeEventListener("pointerdown", y, !0), n.removeEventListener("pointermove", y, !0), n.removeEventListener("pointerup", y, !0)) : process.env.NODE_ENV === "test" && (n.removeEventListener("mousedown", y, !0), n.removeEventListener("mousemove", y, !0), n.removeEventListener("mouseup", y, !0)), A.delete(r));
|
|
345
345
|
};
|
|
346
|
-
function
|
|
346
|
+
function ut(e) {
|
|
347
347
|
const t = h(e);
|
|
348
348
|
let r;
|
|
349
349
|
return t.readyState !== "loading" ? ae(e) : (r = () => {
|
|
350
350
|
ae(e);
|
|
351
351
|
}, t.addEventListener("DOMContentLoaded", r)), () => Te(e, r);
|
|
352
352
|
}
|
|
353
|
-
typeof document < "u" &&
|
|
353
|
+
typeof document < "u" && ut();
|
|
354
354
|
function ge() {
|
|
355
355
|
return I;
|
|
356
356
|
}
|
|
@@ -379,30 +379,30 @@ function ce() {
|
|
|
379
379
|
document.body.addEventListener("transitionrun", t), document.body.addEventListener("transitionend", r);
|
|
380
380
|
}
|
|
381
381
|
typeof document < "u" && (document.readyState !== "loading" ? ce() : document.addEventListener("DOMContentLoaded", ce));
|
|
382
|
-
function
|
|
382
|
+
function lt() {
|
|
383
383
|
for (const [e] of L)
|
|
384
384
|
"isConnected" in e && !e.isConnected && L.delete(e);
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function dt(e) {
|
|
387
387
|
requestAnimationFrame(() => {
|
|
388
|
-
|
|
388
|
+
lt(), L.size === 0 ? e() : X.add(e);
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
|
-
function
|
|
391
|
+
function ft(e) {
|
|
392
392
|
if (!e.isConnected) return;
|
|
393
393
|
const t = h(e);
|
|
394
394
|
if (ge() === "virtual") {
|
|
395
395
|
let r = w(t);
|
|
396
|
-
|
|
396
|
+
dt(() => {
|
|
397
397
|
const n = w(t);
|
|
398
398
|
(n === r || n === t.body) && e.isConnected && J(e);
|
|
399
399
|
});
|
|
400
400
|
} else J(e);
|
|
401
401
|
}
|
|
402
|
-
const
|
|
402
|
+
const $t = p.useInsertionEffect ?? N;
|
|
403
403
|
function Ft(e) {
|
|
404
404
|
const t = S(null);
|
|
405
|
-
return
|
|
405
|
+
return $t(() => {
|
|
406
406
|
t.current = e;
|
|
407
407
|
}, [
|
|
408
408
|
e
|
|
@@ -411,12 +411,12 @@ function Ft(e) {
|
|
|
411
411
|
return n?.(...r);
|
|
412
412
|
}, []);
|
|
413
413
|
}
|
|
414
|
-
const Se =
|
|
414
|
+
const Se = p.createContext({
|
|
415
415
|
register: () => {
|
|
416
416
|
}
|
|
417
417
|
});
|
|
418
418
|
Se.displayName = "PressResponderContext";
|
|
419
|
-
class
|
|
419
|
+
class bt {
|
|
420
420
|
constructor(t, r, n, o) {
|
|
421
421
|
this._walkerStack = [], this._currentSetFor = /* @__PURE__ */ new Set(), this._acceptNode = (c) => {
|
|
422
422
|
if (c.nodeType === Node.ELEMENT_NODE) {
|
|
@@ -534,29 +534,29 @@ class ft {
|
|
|
534
534
|
return null;
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
|
-
function
|
|
538
|
-
return U() ? new
|
|
537
|
+
function pt(e, t, r, n) {
|
|
538
|
+
return U() ? new bt(e, t, r, n) : e.createTreeWalker(t, r, n);
|
|
539
539
|
}
|
|
540
|
-
const se = /* @__PURE__ */
|
|
540
|
+
const se = /* @__PURE__ */ p.createContext(null), Q = "react-aria-focus-scope-restore";
|
|
541
541
|
let $ = null;
|
|
542
|
-
function
|
|
542
|
+
function vt(e) {
|
|
543
543
|
let { children: t, contain: r, restoreFocus: n, autoFocus: o } = e, i = S(null), c = S(null), a = S([]), { parentNode: d } = M(se) || {}, s = D(() => new ee({
|
|
544
544
|
scopeRef: a
|
|
545
545
|
}), [
|
|
546
546
|
a
|
|
547
547
|
]);
|
|
548
548
|
N(() => {
|
|
549
|
-
let f = d ||
|
|
550
|
-
if (
|
|
551
|
-
let b =
|
|
549
|
+
let f = d || v.root;
|
|
550
|
+
if (v.getTreeNode(f.scopeRef) && $ && !B($, f.scopeRef)) {
|
|
551
|
+
let b = v.getTreeNode($);
|
|
552
552
|
b && (f = b);
|
|
553
553
|
}
|
|
554
|
-
f.addChild(s),
|
|
554
|
+
f.addChild(s), v.addNode(s);
|
|
555
555
|
}, [
|
|
556
556
|
s,
|
|
557
557
|
d
|
|
558
558
|
]), N(() => {
|
|
559
|
-
let f =
|
|
559
|
+
let f = v.getTreeNode(a);
|
|
560
560
|
f && (f.contain = !!r);
|
|
561
561
|
}, [
|
|
562
562
|
r
|
|
@@ -569,44 +569,44 @@ function bt(e) {
|
|
|
569
569
|
};
|
|
570
570
|
}, [
|
|
571
571
|
t
|
|
572
|
-
]),
|
|
572
|
+
]), yt(a, n, r), Nt(a, r), Tt(a, n, r), wt(a, o), $e(() => {
|
|
573
573
|
const f = w(h(a.current ? a.current[0] : void 0));
|
|
574
574
|
let b = null;
|
|
575
575
|
if (T(f, a.current)) {
|
|
576
|
-
for (let E of
|
|
577
|
-
b ===
|
|
576
|
+
for (let E of v.traverse()) E.scopeRef && T(f, E.scopeRef.current) && (b = E);
|
|
577
|
+
b === v.getTreeNode(a) && ($ = b.scopeRef);
|
|
578
578
|
}
|
|
579
579
|
}, [
|
|
580
580
|
a
|
|
581
581
|
]), N(() => () => {
|
|
582
|
-
let f =
|
|
583
|
-
(a === $ || B(a, $)) && (!f ||
|
|
582
|
+
let f = v.getTreeNode(a)?.parent?.scopeRef ?? null;
|
|
583
|
+
(a === $ || B(a, $)) && (!f || v.getTreeNode(f)) && ($ = f), v.removeTreeNode(a);
|
|
584
584
|
}, [
|
|
585
585
|
a
|
|
586
586
|
]);
|
|
587
|
-
let u = D(() =>
|
|
587
|
+
let u = D(() => ht(a), []), l = D(() => ({
|
|
588
588
|
focusManager: u,
|
|
589
589
|
parentNode: s
|
|
590
590
|
}), [
|
|
591
591
|
s,
|
|
592
592
|
u
|
|
593
593
|
]);
|
|
594
|
-
return /* @__PURE__ */
|
|
594
|
+
return /* @__PURE__ */ p.createElement(se.Provider, {
|
|
595
595
|
value: l
|
|
596
|
-
}, /* @__PURE__ */
|
|
596
|
+
}, /* @__PURE__ */ p.createElement("span", {
|
|
597
597
|
"data-focus-scope-start": !0,
|
|
598
598
|
hidden: !0,
|
|
599
599
|
ref: i
|
|
600
|
-
}), t, /* @__PURE__ */
|
|
600
|
+
}), t, /* @__PURE__ */ p.createElement("span", {
|
|
601
601
|
"data-focus-scope-end": !0,
|
|
602
602
|
hidden: !0,
|
|
603
603
|
ref: c
|
|
604
604
|
}));
|
|
605
605
|
}
|
|
606
|
-
function
|
|
606
|
+
function ht(e) {
|
|
607
607
|
return {
|
|
608
608
|
focusNext(t = {}) {
|
|
609
|
-
let r = e.current, { from: n, tabbable: o, wrap: i, accept: c } = t, a = n || w(h(r[0] ?? void 0)), d = r[0].previousElementSibling, s = _(r), u =
|
|
609
|
+
let r = e.current, { from: n, tabbable: o, wrap: i, accept: c } = t, a = n || w(h(r[0] ?? void 0)), d = r[0].previousElementSibling, s = _(r), u = k(s, {
|
|
610
610
|
tabbable: o,
|
|
611
611
|
accept: c
|
|
612
612
|
}, r);
|
|
@@ -615,7 +615,7 @@ function pt(e) {
|
|
|
615
615
|
return !l && i && (u.currentNode = d, l = u.nextNode()), l && g(l, !0), l;
|
|
616
616
|
},
|
|
617
617
|
focusPrevious(t = {}) {
|
|
618
|
-
let r = e.current, { from: n, tabbable: o, wrap: i, accept: c } = t, a = n || w(h(r[0] ?? void 0)), d = r[r.length - 1].nextElementSibling, s = _(r), u =
|
|
618
|
+
let r = e.current, { from: n, tabbable: o, wrap: i, accept: c } = t, a = n || w(h(r[0] ?? void 0)), d = r[r.length - 1].nextElementSibling, s = _(r), u = k(s, {
|
|
619
619
|
tabbable: o,
|
|
620
620
|
accept: c
|
|
621
621
|
}, r);
|
|
@@ -624,7 +624,7 @@ function pt(e) {
|
|
|
624
624
|
return !l && i && (u.currentNode = d, l = u.previousNode()), l && g(l, !0), l;
|
|
625
625
|
},
|
|
626
626
|
focusFirst(t = {}) {
|
|
627
|
-
let r = e.current, { tabbable: n, accept: o } = t, i = _(r), c =
|
|
627
|
+
let r = e.current, { tabbable: n, accept: o } = t, i = _(r), c = k(i, {
|
|
628
628
|
tabbable: n,
|
|
629
629
|
accept: o
|
|
630
630
|
}, r);
|
|
@@ -633,7 +633,7 @@ function pt(e) {
|
|
|
633
633
|
return a && g(a, !0), a;
|
|
634
634
|
},
|
|
635
635
|
focusLast(t = {}) {
|
|
636
|
-
let r = e.current, { tabbable: n, accept: o } = t, i = _(r), c =
|
|
636
|
+
let r = e.current, { tabbable: n, accept: o } = t, i = _(r), c = k(i, {
|
|
637
637
|
tabbable: n,
|
|
638
638
|
accept: o
|
|
639
639
|
}, r);
|
|
@@ -647,14 +647,14 @@ function _(e) {
|
|
|
647
647
|
return e[0].parentElement;
|
|
648
648
|
}
|
|
649
649
|
function O(e) {
|
|
650
|
-
let t =
|
|
650
|
+
let t = v.getTreeNode($);
|
|
651
651
|
for (; t && t.scopeRef !== e; ) {
|
|
652
652
|
if (t.contain) return !1;
|
|
653
653
|
t = t.parent;
|
|
654
654
|
}
|
|
655
655
|
return !0;
|
|
656
656
|
}
|
|
657
|
-
function
|
|
657
|
+
function Et(e) {
|
|
658
658
|
if (!e.form)
|
|
659
659
|
return Array.from(h(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter((n) => !n.form);
|
|
660
660
|
const t = e.form.elements.namedItem(e.name);
|
|
@@ -663,12 +663,12 @@ function vt(e) {
|
|
|
663
663
|
t
|
|
664
664
|
] : [];
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function mt(e) {
|
|
667
667
|
if (e.checked) return !0;
|
|
668
|
-
const t =
|
|
668
|
+
const t = Et(e);
|
|
669
669
|
return t.length > 0 && !t.some((r) => r.checked);
|
|
670
670
|
}
|
|
671
|
-
function
|
|
671
|
+
function Nt(e, t) {
|
|
672
672
|
let r = S(void 0), n = S(void 0);
|
|
673
673
|
N(() => {
|
|
674
674
|
let o = e.current;
|
|
@@ -681,7 +681,7 @@ function Et(e, t) {
|
|
|
681
681
|
if (s.key !== "Tab" || s.altKey || s.ctrlKey || s.metaKey || !O(e) || s.isComposing) return;
|
|
682
682
|
let u = w(i), l = e.current;
|
|
683
683
|
if (!l || !T(u, l)) return;
|
|
684
|
-
let f = _(l), b =
|
|
684
|
+
let f = _(l), b = k(f, {
|
|
685
685
|
tabbable: !0
|
|
686
686
|
}, l);
|
|
687
687
|
if (!u) return;
|
|
@@ -689,11 +689,11 @@ function Et(e, t) {
|
|
|
689
689
|
let E = s.shiftKey ? b.previousNode() : b.nextNode();
|
|
690
690
|
E || (b.currentNode = s.shiftKey ? l[l.length - 1].nextElementSibling : l[0].previousElementSibling, E = s.shiftKey ? b.previousNode() : b.nextNode()), s.preventDefault(), E && (g(E, !0), E instanceof R(E).HTMLInputElement && E.select());
|
|
691
691
|
}, a = (s) => {
|
|
692
|
-
(!$ || B($, e)) && T(m(s), e.current) ? ($ = e, r.current = m(s)) : O(e) && !
|
|
692
|
+
(!$ || B($, e)) && T(m(s), e.current) ? ($ = e, r.current = m(s)) : O(e) && !C(m(s), e) ? r.current ? r.current.focus() : $ && $.current && Z($.current) : O(e) && (r.current = m(s));
|
|
693
693
|
}, d = (s) => {
|
|
694
694
|
n.current && cancelAnimationFrame(n.current), n.current = requestAnimationFrame(() => {
|
|
695
695
|
let u = ge(), l = (u === "virtual" || u === null) && he() && ve(), f = w(i);
|
|
696
|
-
if (!l && f && O(e) && !
|
|
696
|
+
if (!l && f && O(e) && !C(f, e)) {
|
|
697
697
|
$ = e;
|
|
698
698
|
let b = m(s);
|
|
699
699
|
b && b.isConnected ? (r.current = b, r.current?.focus()) : $.current && Z($.current);
|
|
@@ -713,22 +713,22 @@ function Et(e, t) {
|
|
|
713
713
|
]);
|
|
714
714
|
}
|
|
715
715
|
function xe(e) {
|
|
716
|
-
return
|
|
716
|
+
return C(e);
|
|
717
717
|
}
|
|
718
718
|
function T(e, t) {
|
|
719
719
|
return !e || !t ? !1 : t.some((r) => W(r, e));
|
|
720
720
|
}
|
|
721
|
-
function
|
|
721
|
+
function C(e, t = null) {
|
|
722
722
|
if (e instanceof Element && e.closest("[data-react-aria-top-layer]")) return !0;
|
|
723
|
-
for (let { scopeRef: r } of
|
|
723
|
+
for (let { scopeRef: r } of v.traverse(v.getTreeNode(t)))
|
|
724
724
|
if (r && T(e, r.current)) return !0;
|
|
725
725
|
return !1;
|
|
726
726
|
}
|
|
727
727
|
function Rt(e) {
|
|
728
|
-
return
|
|
728
|
+
return C(e, $);
|
|
729
729
|
}
|
|
730
730
|
function B(e, t) {
|
|
731
|
-
let r =
|
|
731
|
+
let r = v.getTreeNode(t)?.parent;
|
|
732
732
|
for (; r; ) {
|
|
733
733
|
if (r.scopeRef === e) return !0;
|
|
734
734
|
r = r.parent;
|
|
@@ -737,7 +737,7 @@ function B(e, t) {
|
|
|
737
737
|
}
|
|
738
738
|
function g(e, t = !1) {
|
|
739
739
|
if (e != null && !t) try {
|
|
740
|
-
|
|
740
|
+
ft(e);
|
|
741
741
|
} catch {
|
|
742
742
|
}
|
|
743
743
|
else if (e != null) try {
|
|
@@ -746,20 +746,20 @@ function g(e, t = !1) {
|
|
|
746
746
|
}
|
|
747
747
|
}
|
|
748
748
|
function Le(e, t = !0) {
|
|
749
|
-
let r = e[0].previousElementSibling, n = _(e), o =
|
|
749
|
+
let r = e[0].previousElementSibling, n = _(e), o = k(n, {
|
|
750
750
|
tabbable: t
|
|
751
751
|
}, e);
|
|
752
752
|
o.currentNode = r;
|
|
753
753
|
let i = o.nextNode();
|
|
754
|
-
return t && !i && (n = _(e), o =
|
|
754
|
+
return t && !i && (n = _(e), o = k(n, {
|
|
755
755
|
tabbable: !1
|
|
756
756
|
}, e), o.currentNode = r, i = o.nextNode()), i;
|
|
757
757
|
}
|
|
758
758
|
function Z(e, t = !0) {
|
|
759
759
|
g(Le(e, t));
|
|
760
760
|
}
|
|
761
|
-
function
|
|
762
|
-
const r =
|
|
761
|
+
function wt(e, t) {
|
|
762
|
+
const r = p.useRef(t);
|
|
763
763
|
$e(() => {
|
|
764
764
|
if (r.current) {
|
|
765
765
|
$ = e;
|
|
@@ -771,7 +771,7 @@ function mt(e, t) {
|
|
|
771
771
|
e
|
|
772
772
|
]);
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function yt(e, t, r) {
|
|
775
775
|
N(() => {
|
|
776
776
|
if (t || r) return;
|
|
777
777
|
let n = e.current;
|
|
@@ -790,14 +790,14 @@ function Nt(e, t, r) {
|
|
|
790
790
|
]);
|
|
791
791
|
}
|
|
792
792
|
function ue(e) {
|
|
793
|
-
let t =
|
|
793
|
+
let t = v.getTreeNode($);
|
|
794
794
|
for (; t && t.scopeRef !== e; ) {
|
|
795
795
|
if (t.nodeToRestore) return !1;
|
|
796
796
|
t = t.parent;
|
|
797
797
|
}
|
|
798
798
|
return t?.scopeRef === e;
|
|
799
799
|
}
|
|
800
|
-
function
|
|
800
|
+
function Tt(e, t, r) {
|
|
801
801
|
const n = S(typeof document < "u" ? w(h(e.current ? e.current[0] : void 0)) : null);
|
|
802
802
|
N(() => {
|
|
803
803
|
let o = e.current;
|
|
@@ -818,19 +818,19 @@ function wt(e, t, r) {
|
|
|
818
818
|
let i = (c) => {
|
|
819
819
|
if (c.key !== "Tab" || c.altKey || c.ctrlKey || c.metaKey || !O(e) || c.isComposing) return;
|
|
820
820
|
let a = o.activeElement;
|
|
821
|
-
if (!
|
|
822
|
-
let d =
|
|
821
|
+
if (!C(a, e) || !ue(e)) return;
|
|
822
|
+
let d = v.getTreeNode(e);
|
|
823
823
|
if (!d) return;
|
|
824
|
-
let s = d.nodeToRestore, u =
|
|
824
|
+
let s = d.nodeToRestore, u = k(o.body, {
|
|
825
825
|
tabbable: !0
|
|
826
826
|
});
|
|
827
827
|
u.currentNode = a;
|
|
828
828
|
let l = c.shiftKey ? u.previousNode() : u.nextNode();
|
|
829
|
-
if ((!s || !s.isConnected || s === o.body) && (s = void 0, d.nodeToRestore = void 0), (!l || !
|
|
829
|
+
if ((!s || !s.isConnected || s === o.body) && (s = void 0, d.nodeToRestore = void 0), (!l || !C(l, e)) && s) {
|
|
830
830
|
u.currentNode = s;
|
|
831
831
|
do
|
|
832
832
|
l = c.shiftKey ? u.previousNode() : u.nextNode();
|
|
833
|
-
while (
|
|
833
|
+
while (C(l, e));
|
|
834
834
|
c.preventDefault(), c.stopPropagation(), l ? g(l, !0) : xe(s) ? g(s, !0) : a.blur();
|
|
835
835
|
}
|
|
836
836
|
};
|
|
@@ -844,14 +844,14 @@ function wt(e, t, r) {
|
|
|
844
844
|
]), N(() => {
|
|
845
845
|
const o = h(e.current ? e.current[0] : void 0);
|
|
846
846
|
if (!t) return;
|
|
847
|
-
let i =
|
|
847
|
+
let i = v.getTreeNode(e);
|
|
848
848
|
if (i)
|
|
849
849
|
return i.nodeToRestore = n.current ?? void 0, () => {
|
|
850
|
-
let c =
|
|
850
|
+
let c = v.getTreeNode(e);
|
|
851
851
|
if (!c) return;
|
|
852
852
|
let a = c.nodeToRestore, d = w(o);
|
|
853
|
-
if (t && a && (d &&
|
|
854
|
-
let s =
|
|
853
|
+
if (t && a && (d && C(d, e) || d === o.body && ue(e))) {
|
|
854
|
+
let s = v.clone();
|
|
855
855
|
requestAnimationFrame(() => {
|
|
856
856
|
if (o.activeElement === o.body) {
|
|
857
857
|
let u = s.getTreeNode(e);
|
|
@@ -863,7 +863,7 @@ function wt(e, t, r) {
|
|
|
863
863
|
u = u.parent;
|
|
864
864
|
}
|
|
865
865
|
for (u = s.getTreeNode(e); u; ) {
|
|
866
|
-
if (u.scopeRef && u.scopeRef.current &&
|
|
866
|
+
if (u.scopeRef && u.scopeRef.current && v.getTreeNode(u.scopeRef)) {
|
|
867
867
|
let l = Le(u.scopeRef.current, !0);
|
|
868
868
|
le(l);
|
|
869
869
|
return;
|
|
@@ -885,10 +885,10 @@ function le(e) {
|
|
|
885
885
|
cancelable: !0
|
|
886
886
|
})) && g(e);
|
|
887
887
|
}
|
|
888
|
-
function
|
|
889
|
-
let n = t?.tabbable ?
|
|
888
|
+
function k(e, t, r) {
|
|
889
|
+
let n = t?.tabbable ? Ue : Be, o = e?.nodeType === Node.ELEMENT_NODE ? e : null, i = h(o), c = pt(i, e || i, NodeFilter.SHOW_ELEMENT, {
|
|
890
890
|
acceptNode(a) {
|
|
891
|
-
return W(t?.from, a) || t?.tabbable && a.tagName === "INPUT" && a.getAttribute("type") === "radio" && (!
|
|
891
|
+
return W(t?.from, a) || t?.tabbable && a.tagName === "INPUT" && a.getAttribute("type") === "radio" && (!mt(a) || c.currentNode.tagName === "INPUT" && c.currentNode.type === "radio" && c.currentNode.name === a.name) ? NodeFilter.FILTER_REJECT : n(a) && (!r || T(a, r)) && (!t?.accept || t.accept(a)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
892
892
|
}
|
|
893
893
|
});
|
|
894
894
|
return t?.from && (c.currentNode = t.from), c;
|
|
@@ -946,40 +946,48 @@ class ee {
|
|
|
946
946
|
this.children.delete(t), t.parent = void 0;
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
|
-
let
|
|
950
|
-
function
|
|
949
|
+
let v = new ie();
|
|
950
|
+
function gt({ children: e }) {
|
|
951
951
|
let t = D(() => ({
|
|
952
952
|
register: () => {
|
|
953
953
|
}
|
|
954
954
|
}), []);
|
|
955
|
-
return /* @__PURE__ */
|
|
955
|
+
return /* @__PURE__ */ p.createElement(Se.Provider, {
|
|
956
956
|
value: t
|
|
957
957
|
}, e);
|
|
958
958
|
}
|
|
959
|
-
const
|
|
960
|
-
function gt() {
|
|
961
|
-
return M(Tt) ?? {};
|
|
962
|
-
}
|
|
963
|
-
const ke = /* @__PURE__ */ v.createContext(null);
|
|
959
|
+
const Ce = /* @__PURE__ */ Fe({});
|
|
964
960
|
function Mt(e) {
|
|
961
|
+
let { getContainer: t } = e, { getContainer: r } = ke();
|
|
962
|
+
return /* @__PURE__ */ p.createElement(Ce.Provider, {
|
|
963
|
+
value: {
|
|
964
|
+
getContainer: t === null ? void 0 : t ?? r
|
|
965
|
+
}
|
|
966
|
+
}, e.children);
|
|
967
|
+
}
|
|
968
|
+
function ke() {
|
|
969
|
+
return M(Ce) ?? {};
|
|
970
|
+
}
|
|
971
|
+
const _e = /* @__PURE__ */ p.createContext(null);
|
|
972
|
+
function Ot(e) {
|
|
965
973
|
let t = me(), { portalContainer: r = t ? null : document.body, isExiting: n } = e, [o, i] = fe(!1), c = D(() => ({
|
|
966
974
|
contain: o,
|
|
967
975
|
setContain: i
|
|
968
976
|
}), [
|
|
969
977
|
o,
|
|
970
978
|
i
|
|
971
|
-
]), { getContainer: a } =
|
|
979
|
+
]), { getContainer: a } = ke();
|
|
972
980
|
if (!e.portalContainer && a && (r = a()), !r) return null;
|
|
973
981
|
let d = e.children;
|
|
974
|
-
return e.disableFocusManagement || (d = /* @__PURE__ */
|
|
982
|
+
return e.disableFocusManagement || (d = /* @__PURE__ */ p.createElement(vt, {
|
|
975
983
|
restoreFocus: !0,
|
|
976
984
|
contain: (e.shouldContainFocus || o) && !n
|
|
977
|
-
}, d)), d = /* @__PURE__ */
|
|
985
|
+
}, d)), d = /* @__PURE__ */ p.createElement(_e.Provider, {
|
|
978
986
|
value: c
|
|
979
|
-
}, /* @__PURE__ */
|
|
987
|
+
}, /* @__PURE__ */ p.createElement(gt, null, d)), /* @__PURE__ */ Re.createPortal(d, r);
|
|
980
988
|
}
|
|
981
|
-
function
|
|
982
|
-
let t = M(
|
|
989
|
+
function Dt() {
|
|
990
|
+
let t = M(_e)?.setContain;
|
|
983
991
|
N(() => {
|
|
984
992
|
t?.(!0);
|
|
985
993
|
}, [
|
|
@@ -991,21 +999,22 @@ export {
|
|
|
991
999
|
Lt as a,
|
|
992
1000
|
w as b,
|
|
993
1001
|
m as c,
|
|
994
|
-
|
|
995
|
-
|
|
1002
|
+
Ye as d,
|
|
1003
|
+
Je as e,
|
|
996
1004
|
Rt as f,
|
|
997
|
-
|
|
1005
|
+
pt as g,
|
|
998
1006
|
U as h,
|
|
999
|
-
|
|
1000
|
-
|
|
1007
|
+
Mt as i,
|
|
1008
|
+
ze as j,
|
|
1001
1009
|
kt as k,
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1010
|
+
Ct as l,
|
|
1011
|
+
N as m,
|
|
1012
|
+
me as n,
|
|
1013
|
+
_t as o,
|
|
1014
|
+
h as p,
|
|
1015
|
+
R as q,
|
|
1016
|
+
Dt as r,
|
|
1017
|
+
Ot as s,
|
|
1018
|
+
ft as t,
|
|
1019
|
+
Ft as u
|
|
1011
1020
|
};
|