@pibit.ai/cure-design-system 0.5.7 → 0.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/applications/date-picker/calendar.d.ts +42 -0
- package/dist/applications/date-picker/calendar.d.ts.map +1 -0
- package/dist/applications/date-picker/calendar.js +310 -0
- package/dist/applications/date-picker/cell.d.ts +15 -0
- package/dist/applications/date-picker/cell.d.ts.map +1 -0
- package/dist/applications/date-picker/cell.js +90 -0
- package/dist/applications/date-picker/date-input.d.ts +7 -0
- package/dist/applications/date-picker/date-input.d.ts.map +1 -0
- package/dist/applications/date-picker/date-input.js +39 -0
- package/dist/applications/date-picker/date-picker.d.ts +47 -0
- package/dist/applications/date-picker/date-picker.d.ts.map +1 -0
- package/dist/applications/date-picker/date-picker.js +237 -0
- package/dist/applications/date-picker/date-range-picker.d.ts +44 -0
- package/dist/applications/date-picker/date-range-picker.d.ts.map +1 -0
- package/dist/applications/date-picker/date-range-picker.js +335 -0
- package/dist/applications/date-picker/date-range-presets.d.ts +50 -0
- package/dist/applications/date-picker/date-range-presets.d.ts.map +1 -0
- package/dist/applications/date-picker/date-range-presets.js +86 -0
- package/dist/applications/date-picker/date-time-calendar.d.ts +34 -0
- package/dist/applications/date-picker/date-time-calendar.d.ts.map +1 -0
- package/dist/applications/date-picker/date-time-calendar.js +140 -0
- package/dist/applications/date-picker/index.d.ts +12 -0
- package/dist/applications/date-picker/index.d.ts.map +1 -0
- package/dist/applications/date-picker/index.js +36 -0
- package/dist/applications/date-picker/range-calendar.d.ts +23 -0
- package/dist/applications/date-picker/range-calendar.d.ts.map +1 -0
- package/dist/applications/date-picker/range-calendar.js +210 -0
- package/dist/applications/date-picker/range-preset.d.ts +10 -0
- package/dist/applications/date-picker/range-preset.d.ts.map +1 -0
- package/dist/applications/date-picker/range-preset.js +27 -0
- package/dist/applications/date-picker/styles.d.ts +8 -0
- package/dist/applications/date-picker/styles.d.ts.map +1 -0
- package/dist/applications/date-picker/styles.js +14 -0
- package/dist/applications/date-picker/time-field.d.ts +7 -0
- package/dist/applications/date-picker/time-field.d.ts.map +1 -0
- package/dist/applications/date-picker/time-field.js +116 -0
- package/dist/applications/date-picker/time-list.d.ts +23 -0
- package/dist/applications/date-picker/time-list.d.ts.map +1 -0
- package/dist/applications/date-picker/time-list.js +89 -0
- package/dist/hooks/use-breakpoint.d.ts +10 -0
- package/dist/hooks/use-breakpoint.d.ts.map +1 -0
- package/dist/hooks/use-breakpoint.js +21 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +341 -316
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +6 -6
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +6 -6
- package/dist/primitives/select/multi-select.js +81 -82
- package/dist/styles/components.css +1 -1
- package/package.json +8 -1
- package/dist/node_modules/@react-aria/focus/dist/FocusScope.js +0 -442
- package/dist/node_modules/@react-aria/i18n/dist/context.js +0 -10
- package/dist/node_modules/@react-aria/i18n/dist/useCollator.js +0 -11
- package/dist/node_modules/@react-aria/i18n/dist/useDefaultLocale.js +0 -36
- package/dist/node_modules/@react-aria/i18n/dist/useFilter.js +0 -35
- package/dist/node_modules/@react-aria/i18n/dist/utils.js +0 -44
- package/dist/node_modules/@react-aria/interactions/dist/focusSafely.js +0 -18
- package/dist/node_modules/@react-aria/interactions/dist/useFocusVisible.js +0 -62
- package/dist/node_modules/@react-aria/interactions/dist/utils.js +0 -5
- package/dist/node_modules/@react-aria/ssr/dist/SSRProvider.js +0 -49
- package/dist/node_modules/@react-aria/utils/dist/DOMFunctions.js +0 -27
- package/dist/node_modules/@react-aria/utils/dist/ShadowTreeWalker.js +0 -130
- package/dist/node_modules/@react-aria/utils/dist/domHelpers.js +0 -15
- package/dist/node_modules/@react-aria/utils/dist/focusWithoutScrolling.js +0 -45
- package/dist/node_modules/@react-aria/utils/dist/isElementVisible.js +0 -25
- package/dist/node_modules/@react-aria/utils/dist/isFocusable.js +0 -37
- package/dist/node_modules/@react-aria/utils/dist/isVirtualEvent.js +0 -7
- package/dist/node_modules/@react-aria/utils/dist/openLink.js +0 -28
- package/dist/node_modules/@react-aria/utils/dist/platform.js +0 -47
- package/dist/node_modules/@react-aria/utils/dist/runAfterTransition.js +0 -35
- package/dist/node_modules/@react-aria/utils/dist/useLayoutEffect.js +0 -6
- package/dist/node_modules/@react-stately/flags/dist/import.js +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pibit.ai/cure-design-system",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.8",
|
|
4
4
|
"description": "CURE Design System - React component library",
|
|
5
5
|
"author": "Pibit",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,6 +43,10 @@
|
|
|
43
43
|
"import": "./dist/primitives/icon/icons.js",
|
|
44
44
|
"types": "./dist/primitives/icon/icons.d.ts"
|
|
45
45
|
},
|
|
46
|
+
"./applications/date-picker": {
|
|
47
|
+
"import": "./dist/applications/date-picker/index.js",
|
|
48
|
+
"types": "./dist/applications/date-picker/index.d.ts"
|
|
49
|
+
},
|
|
46
50
|
"./patterns/*": {
|
|
47
51
|
"import": "./dist/patterns/*/index.js",
|
|
48
52
|
"types": "./dist/patterns/*/index.d.ts"
|
|
@@ -83,15 +87,18 @@
|
|
|
83
87
|
},
|
|
84
88
|
"dependencies": {
|
|
85
89
|
"@floating-ui/dom": "^1.7.6",
|
|
90
|
+
"@internationalized/date": "^3.10.1",
|
|
86
91
|
"@tanstack/react-table": "^9.2.4",
|
|
87
92
|
"@radix-ui/react-avatar": "^1.1.2",
|
|
88
93
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
89
94
|
"@radix-ui/react-switch": "^1.2.6",
|
|
90
95
|
"@radix-ui/react-tooltip": "^1.1.8",
|
|
96
|
+
"@react-stately/utils": "^3.11.0",
|
|
91
97
|
"@untitledui/icons": "^0.0.19",
|
|
92
98
|
"class-variance-authority": "^0.7.1",
|
|
93
99
|
"clsx": "^2.1.1",
|
|
94
100
|
"framer-motion": "^12.30.0",
|
|
101
|
+
"react-aria": "^3.45.0",
|
|
95
102
|
"react-aria-components": "^1.14.0",
|
|
96
103
|
"tailwind-merge": "^3.3.1"
|
|
97
104
|
},
|
|
@@ -1,442 +0,0 @@
|
|
|
1
|
-
import { createShadowTreeWalker as W } from "../../utils/dist/ShadowTreeWalker.js";
|
|
2
|
-
import { getActiveElement as T, getEventTarget as F } from "../../utils/dist/DOMFunctions.js";
|
|
3
|
-
import { getOwnerDocument as N } from "../../utils/dist/domHelpers.js";
|
|
4
|
-
import { useLayoutEffect as E } from "../../utils/dist/useLayoutEffect.js";
|
|
5
|
-
import { isAndroid as B, isChrome as H } from "../../utils/dist/platform.js";
|
|
6
|
-
import { isTabbable as V, isFocusable as j } from "../../utils/dist/isFocusable.js";
|
|
7
|
-
import { getInteractionModality as G } from "../../interactions/dist/useFocusVisible.js";
|
|
8
|
-
import { focusSafely as Q } from "../../interactions/dist/focusSafely.js";
|
|
9
|
-
import C, { useRef as S, useContext as z, useMemo as k, useEffect as q } from "react";
|
|
10
|
-
const M = /* @__PURE__ */ C.createContext(null), I = "react-aria-focus-scope-restore";
|
|
11
|
-
let s = null;
|
|
12
|
-
function se(e) {
|
|
13
|
-
let { children: t, contain: r, restoreFocus: a, autoFocus: n } = e, i = S(null), u = S(null), o = S([]), { parentNode: b } = z(M) || {}, l = k(() => new K({
|
|
14
|
-
scopeRef: o
|
|
15
|
-
}), [
|
|
16
|
-
o
|
|
17
|
-
]);
|
|
18
|
-
E(() => {
|
|
19
|
-
let c = b || $.root;
|
|
20
|
-
if ($.getTreeNode(c.scopeRef) && s && !R(s, c.scopeRef)) {
|
|
21
|
-
let f = $.getTreeNode(s);
|
|
22
|
-
f && (c = f);
|
|
23
|
-
}
|
|
24
|
-
c.addChild(l), $.addNode(l);
|
|
25
|
-
}, [
|
|
26
|
-
l,
|
|
27
|
-
b
|
|
28
|
-
]), E(() => {
|
|
29
|
-
let c = $.getTreeNode(o);
|
|
30
|
-
c && (c.contain = !!r);
|
|
31
|
-
}, [
|
|
32
|
-
r
|
|
33
|
-
]), E(() => {
|
|
34
|
-
var c;
|
|
35
|
-
let f = (c = i.current) === null || c === void 0 ? void 0 : c.nextSibling, p = [], x = (_) => _.stopPropagation();
|
|
36
|
-
for (; f && f !== u.current; )
|
|
37
|
-
p.push(f), f.addEventListener(I, x), f = f.nextSibling;
|
|
38
|
-
return o.current = p, () => {
|
|
39
|
-
for (let _ of p) _.removeEventListener(I, x);
|
|
40
|
-
};
|
|
41
|
-
}, [
|
|
42
|
-
t
|
|
43
|
-
]), te(o, a, r), Z(o, r), re(o, a, r), ee(o, n), q(() => {
|
|
44
|
-
const c = T(N(o.current ? o.current[0] : void 0));
|
|
45
|
-
let f = null;
|
|
46
|
-
if (m(c, o.current)) {
|
|
47
|
-
for (let p of $.traverse()) p.scopeRef && m(c, p.scopeRef.current) && (f = p);
|
|
48
|
-
f === $.getTreeNode(o) && (s = f.scopeRef);
|
|
49
|
-
}
|
|
50
|
-
}, [
|
|
51
|
-
o
|
|
52
|
-
]), E(() => () => {
|
|
53
|
-
var c, f, p;
|
|
54
|
-
let x = (p = (f = $.getTreeNode(o)) === null || f === void 0 || (c = f.parent) === null || c === void 0 ? void 0 : c.scopeRef) !== null && p !== void 0 ? p : null;
|
|
55
|
-
(o === s || R(o, s)) && (!x || $.getTreeNode(x)) && (s = x), $.removeTreeNode(o);
|
|
56
|
-
}, [
|
|
57
|
-
o
|
|
58
|
-
]);
|
|
59
|
-
let v = k(() => X(o), []), d = k(() => ({
|
|
60
|
-
focusManager: v,
|
|
61
|
-
parentNode: l
|
|
62
|
-
}), [
|
|
63
|
-
l,
|
|
64
|
-
v
|
|
65
|
-
]);
|
|
66
|
-
return /* @__PURE__ */ C.createElement(M.Provider, {
|
|
67
|
-
value: d
|
|
68
|
-
}, /* @__PURE__ */ C.createElement("span", {
|
|
69
|
-
"data-focus-scope-start": !0,
|
|
70
|
-
hidden: !0,
|
|
71
|
-
ref: i
|
|
72
|
-
}), t, /* @__PURE__ */ C.createElement("span", {
|
|
73
|
-
"data-focus-scope-end": !0,
|
|
74
|
-
hidden: !0,
|
|
75
|
-
ref: u
|
|
76
|
-
}));
|
|
77
|
-
}
|
|
78
|
-
function ve() {
|
|
79
|
-
var e;
|
|
80
|
-
return (e = z(M)) === null || e === void 0 ? void 0 : e.focusManager;
|
|
81
|
-
}
|
|
82
|
-
function X(e) {
|
|
83
|
-
return {
|
|
84
|
-
focusNext(t = {}) {
|
|
85
|
-
let r = e.current, { from: a, tabbable: n, wrap: i, accept: u } = t;
|
|
86
|
-
var o;
|
|
87
|
-
let b = a || T(N((o = r[0]) !== null && o !== void 0 ? o : void 0)), l = r[0].previousElementSibling, v = w(r), d = g(v, {
|
|
88
|
-
tabbable: n,
|
|
89
|
-
accept: u
|
|
90
|
-
}, r);
|
|
91
|
-
d.currentNode = m(b, r) ? b : l;
|
|
92
|
-
let c = d.nextNode();
|
|
93
|
-
return !c && i && (d.currentNode = l, c = d.nextNode()), c && h(c, !0), c;
|
|
94
|
-
},
|
|
95
|
-
focusPrevious(t = {}) {
|
|
96
|
-
let r = e.current, { from: a, tabbable: n, wrap: i, accept: u } = t;
|
|
97
|
-
var o;
|
|
98
|
-
let b = a || T(N((o = r[0]) !== null && o !== void 0 ? o : void 0)), l = r[r.length - 1].nextElementSibling, v = w(r), d = g(v, {
|
|
99
|
-
tabbable: n,
|
|
100
|
-
accept: u
|
|
101
|
-
}, r);
|
|
102
|
-
d.currentNode = m(b, r) ? b : l;
|
|
103
|
-
let c = d.previousNode();
|
|
104
|
-
return !c && i && (d.currentNode = l, c = d.previousNode()), c && h(c, !0), c;
|
|
105
|
-
},
|
|
106
|
-
focusFirst(t = {}) {
|
|
107
|
-
let r = e.current, { tabbable: a, accept: n } = t, i = w(r), u = g(i, {
|
|
108
|
-
tabbable: a,
|
|
109
|
-
accept: n
|
|
110
|
-
}, r);
|
|
111
|
-
u.currentNode = r[0].previousElementSibling;
|
|
112
|
-
let o = u.nextNode();
|
|
113
|
-
return o && h(o, !0), o;
|
|
114
|
-
},
|
|
115
|
-
focusLast(t = {}) {
|
|
116
|
-
let r = e.current, { tabbable: a, accept: n } = t, i = w(r), u = g(i, {
|
|
117
|
-
tabbable: a,
|
|
118
|
-
accept: n
|
|
119
|
-
}, r);
|
|
120
|
-
u.currentNode = r[r.length - 1].nextElementSibling;
|
|
121
|
-
let o = u.previousNode();
|
|
122
|
-
return o && h(o, !0), o;
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
function w(e) {
|
|
127
|
-
return e[0].parentElement;
|
|
128
|
-
}
|
|
129
|
-
function L(e) {
|
|
130
|
-
let t = $.getTreeNode(s);
|
|
131
|
-
for (; t && t.scopeRef !== e; ) {
|
|
132
|
-
if (t.contain) return !1;
|
|
133
|
-
t = t.parent;
|
|
134
|
-
}
|
|
135
|
-
return !0;
|
|
136
|
-
}
|
|
137
|
-
function Y(e) {
|
|
138
|
-
if (e.checked) return !0;
|
|
139
|
-
let t = [];
|
|
140
|
-
if (!e.form) t = [
|
|
141
|
-
...N(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)
|
|
142
|
-
].filter((i) => !i.form);
|
|
143
|
-
else {
|
|
144
|
-
var r, a;
|
|
145
|
-
let i = (a = e.form) === null || a === void 0 || (r = a.elements) === null || r === void 0 ? void 0 : r.namedItem(e.name);
|
|
146
|
-
t = [
|
|
147
|
-
...i ?? []
|
|
148
|
-
];
|
|
149
|
-
}
|
|
150
|
-
return t ? !t.some((i) => i.checked) : !1;
|
|
151
|
-
}
|
|
152
|
-
function Z(e, t) {
|
|
153
|
-
let r = S(void 0), a = S(void 0);
|
|
154
|
-
E(() => {
|
|
155
|
-
let n = e.current;
|
|
156
|
-
if (!t) {
|
|
157
|
-
a.current && (cancelAnimationFrame(a.current), a.current = void 0);
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
const i = N(n ? n[0] : void 0);
|
|
161
|
-
let u = (l) => {
|
|
162
|
-
if (l.key !== "Tab" || l.altKey || l.ctrlKey || l.metaKey || !L(e) || l.isComposing) return;
|
|
163
|
-
let v = T(i), d = e.current;
|
|
164
|
-
if (!d || !m(v, d)) return;
|
|
165
|
-
let c = w(d), f = g(c, {
|
|
166
|
-
tabbable: !0
|
|
167
|
-
}, d);
|
|
168
|
-
if (!v) return;
|
|
169
|
-
f.currentNode = v;
|
|
170
|
-
let p = l.shiftKey ? f.previousNode() : f.nextNode();
|
|
171
|
-
p || (f.currentNode = l.shiftKey ? d[d.length - 1].nextElementSibling : d[0].previousElementSibling, p = l.shiftKey ? f.previousNode() : f.nextNode()), l.preventDefault(), p && h(p, !0);
|
|
172
|
-
}, o = (l) => {
|
|
173
|
-
(!s || R(s, e)) && m(F(l), e.current) ? (s = e, r.current = F(l)) : L(e) && !y(F(l), e) ? r.current ? r.current.focus() : s && s.current && A(s.current) : L(e) && (r.current = F(l));
|
|
174
|
-
}, b = (l) => {
|
|
175
|
-
a.current && cancelAnimationFrame(a.current), a.current = requestAnimationFrame(() => {
|
|
176
|
-
let v = G(), d = (v === "virtual" || v === null) && B() && H(), c = T(i);
|
|
177
|
-
if (!d && c && L(e) && !y(c, e)) {
|
|
178
|
-
s = e;
|
|
179
|
-
let p = F(l);
|
|
180
|
-
if (p && p.isConnected) {
|
|
181
|
-
var f;
|
|
182
|
-
r.current = p, (f = r.current) === null || f === void 0 || f.focus();
|
|
183
|
-
} else s.current && A(s.current);
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
};
|
|
187
|
-
return i.addEventListener("keydown", u, !1), i.addEventListener("focusin", o, !1), n == null || n.forEach((l) => l.addEventListener("focusin", o, !1)), n == null || n.forEach((l) => l.addEventListener("focusout", b, !1)), () => {
|
|
188
|
-
i.removeEventListener("keydown", u, !1), i.removeEventListener("focusin", o, !1), n == null || n.forEach((l) => l.removeEventListener("focusin", o, !1)), n == null || n.forEach((l) => l.removeEventListener("focusout", b, !1));
|
|
189
|
-
};
|
|
190
|
-
}, [
|
|
191
|
-
e,
|
|
192
|
-
t
|
|
193
|
-
]), E(() => () => {
|
|
194
|
-
a.current && cancelAnimationFrame(a.current);
|
|
195
|
-
}, [
|
|
196
|
-
a
|
|
197
|
-
]);
|
|
198
|
-
}
|
|
199
|
-
function J(e) {
|
|
200
|
-
return y(e);
|
|
201
|
-
}
|
|
202
|
-
function m(e, t) {
|
|
203
|
-
return !e || !t ? !1 : t.some((r) => r.contains(e));
|
|
204
|
-
}
|
|
205
|
-
function y(e, t = null) {
|
|
206
|
-
if (e instanceof Element && e.closest("[data-react-aria-top-layer]")) return !0;
|
|
207
|
-
for (let { scopeRef: r } of $.traverse($.getTreeNode(t)))
|
|
208
|
-
if (r && m(e, r.current)) return !0;
|
|
209
|
-
return !1;
|
|
210
|
-
}
|
|
211
|
-
function R(e, t) {
|
|
212
|
-
var r;
|
|
213
|
-
let a = (r = $.getTreeNode(t)) === null || r === void 0 ? void 0 : r.parent;
|
|
214
|
-
for (; a; ) {
|
|
215
|
-
if (a.scopeRef === e) return !0;
|
|
216
|
-
a = a.parent;
|
|
217
|
-
}
|
|
218
|
-
return !1;
|
|
219
|
-
}
|
|
220
|
-
function h(e, t = !1) {
|
|
221
|
-
if (e != null && !t) try {
|
|
222
|
-
Q(e);
|
|
223
|
-
} catch {
|
|
224
|
-
}
|
|
225
|
-
else if (e != null) try {
|
|
226
|
-
e.focus();
|
|
227
|
-
} catch {
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
function U(e, t = !0) {
|
|
231
|
-
let r = e[0].previousElementSibling, a = w(e), n = g(a, {
|
|
232
|
-
tabbable: t
|
|
233
|
-
}, e);
|
|
234
|
-
n.currentNode = r;
|
|
235
|
-
let i = n.nextNode();
|
|
236
|
-
return t && !i && (a = w(e), n = g(a, {
|
|
237
|
-
tabbable: !1
|
|
238
|
-
}, e), n.currentNode = r, i = n.nextNode()), i;
|
|
239
|
-
}
|
|
240
|
-
function A(e, t = !0) {
|
|
241
|
-
h(U(e, t));
|
|
242
|
-
}
|
|
243
|
-
function ee(e, t) {
|
|
244
|
-
const r = C.useRef(t);
|
|
245
|
-
q(() => {
|
|
246
|
-
if (r.current) {
|
|
247
|
-
s = e;
|
|
248
|
-
const a = N(e.current ? e.current[0] : void 0);
|
|
249
|
-
!m(T(a), s.current) && e.current && A(e.current);
|
|
250
|
-
}
|
|
251
|
-
r.current = !1;
|
|
252
|
-
}, [
|
|
253
|
-
e
|
|
254
|
-
]);
|
|
255
|
-
}
|
|
256
|
-
function te(e, t, r) {
|
|
257
|
-
E(() => {
|
|
258
|
-
if (t || r) return;
|
|
259
|
-
let a = e.current;
|
|
260
|
-
const n = N(a ? a[0] : void 0);
|
|
261
|
-
let i = (u) => {
|
|
262
|
-
let o = F(u);
|
|
263
|
-
m(o, e.current) ? s = e : J(o) || (s = null);
|
|
264
|
-
};
|
|
265
|
-
return n.addEventListener("focusin", i, !1), a == null || a.forEach((u) => u.addEventListener("focusin", i, !1)), () => {
|
|
266
|
-
n.removeEventListener("focusin", i, !1), a == null || a.forEach((u) => u.removeEventListener("focusin", i, !1));
|
|
267
|
-
};
|
|
268
|
-
}, [
|
|
269
|
-
e,
|
|
270
|
-
t,
|
|
271
|
-
r
|
|
272
|
-
]);
|
|
273
|
-
}
|
|
274
|
-
function P(e) {
|
|
275
|
-
let t = $.getTreeNode(s);
|
|
276
|
-
for (; t && t.scopeRef !== e; ) {
|
|
277
|
-
if (t.nodeToRestore) return !1;
|
|
278
|
-
t = t.parent;
|
|
279
|
-
}
|
|
280
|
-
return (t == null ? void 0 : t.scopeRef) === e;
|
|
281
|
-
}
|
|
282
|
-
function re(e, t, r) {
|
|
283
|
-
const a = S(typeof document < "u" ? T(N(e.current ? e.current[0] : void 0)) : null);
|
|
284
|
-
E(() => {
|
|
285
|
-
let n = e.current;
|
|
286
|
-
const i = N(n ? n[0] : void 0);
|
|
287
|
-
if (!t || r) return;
|
|
288
|
-
let u = () => {
|
|
289
|
-
(!s || R(s, e)) && m(T(i), e.current) && (s = e);
|
|
290
|
-
};
|
|
291
|
-
return i.addEventListener("focusin", u, !1), n == null || n.forEach((o) => o.addEventListener("focusin", u, !1)), () => {
|
|
292
|
-
i.removeEventListener("focusin", u, !1), n == null || n.forEach((o) => o.removeEventListener("focusin", u, !1));
|
|
293
|
-
};
|
|
294
|
-
}, [
|
|
295
|
-
e,
|
|
296
|
-
r
|
|
297
|
-
]), E(() => {
|
|
298
|
-
const n = N(e.current ? e.current[0] : void 0);
|
|
299
|
-
if (!t) return;
|
|
300
|
-
let i = (u) => {
|
|
301
|
-
if (u.key !== "Tab" || u.altKey || u.ctrlKey || u.metaKey || !L(e) || u.isComposing) return;
|
|
302
|
-
let o = n.activeElement;
|
|
303
|
-
if (!y(o, e) || !P(e)) return;
|
|
304
|
-
let b = $.getTreeNode(e);
|
|
305
|
-
if (!b) return;
|
|
306
|
-
let l = b.nodeToRestore, v = g(n.body, {
|
|
307
|
-
tabbable: !0
|
|
308
|
-
});
|
|
309
|
-
v.currentNode = o;
|
|
310
|
-
let d = u.shiftKey ? v.previousNode() : v.nextNode();
|
|
311
|
-
if ((!l || !l.isConnected || l === n.body) && (l = void 0, b.nodeToRestore = void 0), (!d || !y(d, e)) && l) {
|
|
312
|
-
v.currentNode = l;
|
|
313
|
-
do
|
|
314
|
-
d = u.shiftKey ? v.previousNode() : v.nextNode();
|
|
315
|
-
while (y(d, e));
|
|
316
|
-
u.preventDefault(), u.stopPropagation(), d ? h(d, !0) : J(l) ? h(l, !0) : o.blur();
|
|
317
|
-
}
|
|
318
|
-
};
|
|
319
|
-
return r || n.addEventListener("keydown", i, !0), () => {
|
|
320
|
-
r || n.removeEventListener("keydown", i, !0);
|
|
321
|
-
};
|
|
322
|
-
}, [
|
|
323
|
-
e,
|
|
324
|
-
t,
|
|
325
|
-
r
|
|
326
|
-
]), E(() => {
|
|
327
|
-
const n = N(e.current ? e.current[0] : void 0);
|
|
328
|
-
if (!t) return;
|
|
329
|
-
let i = $.getTreeNode(e);
|
|
330
|
-
if (i) {
|
|
331
|
-
var u;
|
|
332
|
-
return i.nodeToRestore = (u = a.current) !== null && u !== void 0 ? u : void 0, () => {
|
|
333
|
-
let o = $.getTreeNode(e);
|
|
334
|
-
if (!o) return;
|
|
335
|
-
let b = o.nodeToRestore, l = T(n);
|
|
336
|
-
if (t && b && (l && y(l, e) || l === n.body && P(e))) {
|
|
337
|
-
let v = $.clone();
|
|
338
|
-
requestAnimationFrame(() => {
|
|
339
|
-
if (n.activeElement === n.body) {
|
|
340
|
-
let d = v.getTreeNode(e);
|
|
341
|
-
for (; d; ) {
|
|
342
|
-
if (d.nodeToRestore && d.nodeToRestore.isConnected) {
|
|
343
|
-
O(d.nodeToRestore);
|
|
344
|
-
return;
|
|
345
|
-
}
|
|
346
|
-
d = d.parent;
|
|
347
|
-
}
|
|
348
|
-
for (d = v.getTreeNode(e); d; ) {
|
|
349
|
-
if (d.scopeRef && d.scopeRef.current && $.getTreeNode(d.scopeRef)) {
|
|
350
|
-
let c = U(d.scopeRef.current, !0);
|
|
351
|
-
O(c);
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
d = d.parent;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
}, [
|
|
362
|
-
e,
|
|
363
|
-
t
|
|
364
|
-
]);
|
|
365
|
-
}
|
|
366
|
-
function O(e) {
|
|
367
|
-
e.dispatchEvent(new CustomEvent(I, {
|
|
368
|
-
bubbles: !0,
|
|
369
|
-
cancelable: !0
|
|
370
|
-
})) && h(e);
|
|
371
|
-
}
|
|
372
|
-
function g(e, t, r) {
|
|
373
|
-
let a = t != null && t.tabbable ? V : j, n = (e == null ? void 0 : e.nodeType) === Node.ELEMENT_NODE ? e : null, i = N(n), u = W(i, e || i, NodeFilter.SHOW_ELEMENT, {
|
|
374
|
-
acceptNode(o) {
|
|
375
|
-
var b;
|
|
376
|
-
return !(t == null || (b = t.from) === null || b === void 0) && b.contains(o) || t != null && t.tabbable && o.tagName === "INPUT" && o.getAttribute("type") === "radio" && (!Y(o) || u.currentNode.tagName === "INPUT" && u.currentNode.type === "radio" && u.currentNode.name === o.name) ? NodeFilter.FILTER_REJECT : a(o) && (!r || m(o, r)) && (!(t != null && t.accept) || t.accept(o)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
377
|
-
}
|
|
378
|
-
});
|
|
379
|
-
return t != null && t.from && (u.currentNode = t.from), u;
|
|
380
|
-
}
|
|
381
|
-
class D {
|
|
382
|
-
get size() {
|
|
383
|
-
return this.fastMap.size;
|
|
384
|
-
}
|
|
385
|
-
getTreeNode(t) {
|
|
386
|
-
return this.fastMap.get(t);
|
|
387
|
-
}
|
|
388
|
-
addTreeNode(t, r, a) {
|
|
389
|
-
let n = this.fastMap.get(r ?? null);
|
|
390
|
-
if (!n) return;
|
|
391
|
-
let i = new K({
|
|
392
|
-
scopeRef: t
|
|
393
|
-
});
|
|
394
|
-
n.addChild(i), i.parent = n, this.fastMap.set(t, i), a && (i.nodeToRestore = a);
|
|
395
|
-
}
|
|
396
|
-
addNode(t) {
|
|
397
|
-
this.fastMap.set(t.scopeRef, t);
|
|
398
|
-
}
|
|
399
|
-
removeTreeNode(t) {
|
|
400
|
-
if (t === null) return;
|
|
401
|
-
let r = this.fastMap.get(t);
|
|
402
|
-
if (!r) return;
|
|
403
|
-
let a = r.parent;
|
|
404
|
-
for (let i of this.traverse()) i !== r && r.nodeToRestore && i.nodeToRestore && r.scopeRef && r.scopeRef.current && m(i.nodeToRestore, r.scopeRef.current) && (i.nodeToRestore = r.nodeToRestore);
|
|
405
|
-
let n = r.children;
|
|
406
|
-
a && (a.removeChild(r), n.size > 0 && n.forEach((i) => a && a.addChild(i))), this.fastMap.delete(r.scopeRef);
|
|
407
|
-
}
|
|
408
|
-
// Pre Order Depth First
|
|
409
|
-
*traverse(t = this.root) {
|
|
410
|
-
if (t.scopeRef != null && (yield t), t.children.size > 0) for (let r of t.children) yield* this.traverse(r);
|
|
411
|
-
}
|
|
412
|
-
clone() {
|
|
413
|
-
var t;
|
|
414
|
-
let r = new D();
|
|
415
|
-
var a;
|
|
416
|
-
for (let n of this.traverse()) r.addTreeNode(n.scopeRef, (a = (t = n.parent) === null || t === void 0 ? void 0 : t.scopeRef) !== null && a !== void 0 ? a : null, n.nodeToRestore);
|
|
417
|
-
return r;
|
|
418
|
-
}
|
|
419
|
-
constructor() {
|
|
420
|
-
this.fastMap = /* @__PURE__ */ new Map(), this.root = new K({
|
|
421
|
-
scopeRef: null
|
|
422
|
-
}), this.fastMap.set(null, this.root);
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
class K {
|
|
426
|
-
addChild(t) {
|
|
427
|
-
this.children.add(t), t.parent = this;
|
|
428
|
-
}
|
|
429
|
-
removeChild(t) {
|
|
430
|
-
this.children.delete(t), t.parent = void 0;
|
|
431
|
-
}
|
|
432
|
-
constructor(t) {
|
|
433
|
-
this.children = /* @__PURE__ */ new Set(), this.contain = !1, this.scopeRef = t.scopeRef;
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
let $ = new D();
|
|
437
|
-
export {
|
|
438
|
-
se as FocusScope,
|
|
439
|
-
$ as focusScopeTree,
|
|
440
|
-
g as getFocusableTreeWalker,
|
|
441
|
-
ve as useFocusManager
|
|
442
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { useLocale as o } from "./context.js";
|
|
2
|
-
let t = /* @__PURE__ */ new Map();
|
|
3
|
-
function b(a) {
|
|
4
|
-
let { locale: r } = o(), e = r + (a ? Object.entries(a).sort((l, f) => l[0] < f[0] ? -1 : 1).join() : "");
|
|
5
|
-
if (t.has(e)) return t.get(e);
|
|
6
|
-
let c = new Intl.Collator(r, a);
|
|
7
|
-
return t.set(e, c), c;
|
|
8
|
-
}
|
|
9
|
-
export {
|
|
10
|
-
b as useCollator
|
|
11
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { isRTL as f } from "./utils.js";
|
|
2
|
-
import { useState as d, useEffect as i } from "react";
|
|
3
|
-
import { useIsSSR as u } from "../../ssr/dist/SSRProvider.js";
|
|
4
|
-
const r = Symbol.for("react-aria.i18n.locale");
|
|
5
|
-
function l() {
|
|
6
|
-
let e = typeof window < "u" && window[r] || typeof navigator < "u" && (navigator.language || navigator.userLanguage) || "en-US";
|
|
7
|
-
try {
|
|
8
|
-
Intl.DateTimeFormat.supportedLocalesOf([
|
|
9
|
-
e
|
|
10
|
-
]);
|
|
11
|
-
} catch {
|
|
12
|
-
e = "en-US";
|
|
13
|
-
}
|
|
14
|
-
return {
|
|
15
|
-
locale: e,
|
|
16
|
-
direction: f(e) ? "rtl" : "ltr"
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
let t = l(), a = /* @__PURE__ */ new Set();
|
|
20
|
-
function n() {
|
|
21
|
-
t = l();
|
|
22
|
-
for (let e of a) e(t);
|
|
23
|
-
}
|
|
24
|
-
function w() {
|
|
25
|
-
let e = u(), [c, o] = d(t);
|
|
26
|
-
return i(() => (a.size === 0 && window.addEventListener("languagechange", n), a.add(o), () => {
|
|
27
|
-
a.delete(o), a.size === 0 && window.removeEventListener("languagechange", n);
|
|
28
|
-
}), []), e ? {
|
|
29
|
-
locale: typeof window < "u" && window[r] || "en-US",
|
|
30
|
-
direction: "ltr"
|
|
31
|
-
} : c;
|
|
32
|
-
}
|
|
33
|
-
export {
|
|
34
|
-
l as getDefaultLocale,
|
|
35
|
-
w as useDefaultLocale
|
|
36
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { useCollator as p } from "./useCollator.js";
|
|
2
|
-
import { useCallback as o, useMemo as C } from "react";
|
|
3
|
-
function u(h) {
|
|
4
|
-
let a = p({
|
|
5
|
-
usage: "search",
|
|
6
|
-
...h
|
|
7
|
-
}), r = o((l, e) => e.length === 0 ? !0 : (l = l.normalize("NFC"), e = e.normalize("NFC"), a.compare(l.slice(0, e.length), e) === 0), [
|
|
8
|
-
a
|
|
9
|
-
]), c = o((l, e) => e.length === 0 ? !0 : (l = l.normalize("NFC"), e = e.normalize("NFC"), a.compare(l.slice(-e.length), e) === 0), [
|
|
10
|
-
a
|
|
11
|
-
]), f = o((l, e) => {
|
|
12
|
-
if (e.length === 0) return !0;
|
|
13
|
-
l = l.normalize("NFC"), e = e.normalize("NFC");
|
|
14
|
-
let t = 0, m = e.length;
|
|
15
|
-
for (; t + m <= l.length; t++) {
|
|
16
|
-
let n = l.slice(t, t + m);
|
|
17
|
-
if (a.compare(e, n) === 0) return !0;
|
|
18
|
-
}
|
|
19
|
-
return !1;
|
|
20
|
-
}, [
|
|
21
|
-
a
|
|
22
|
-
]);
|
|
23
|
-
return C(() => ({
|
|
24
|
-
startsWith: r,
|
|
25
|
-
endsWith: c,
|
|
26
|
-
contains: f
|
|
27
|
-
}), [
|
|
28
|
-
r,
|
|
29
|
-
c,
|
|
30
|
-
f
|
|
31
|
-
]);
|
|
32
|
-
}
|
|
33
|
-
export {
|
|
34
|
-
u as useFilter
|
|
35
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
const r = /* @__PURE__ */ new Set([
|
|
2
|
-
"Arab",
|
|
3
|
-
"Syrc",
|
|
4
|
-
"Samr",
|
|
5
|
-
"Mand",
|
|
6
|
-
"Thaa",
|
|
7
|
-
"Mend",
|
|
8
|
-
"Nkoo",
|
|
9
|
-
"Adlm",
|
|
10
|
-
"Rohg",
|
|
11
|
-
"Hebr"
|
|
12
|
-
]), o = /* @__PURE__ */ new Set([
|
|
13
|
-
"ae",
|
|
14
|
-
"ar",
|
|
15
|
-
"arc",
|
|
16
|
-
"bcc",
|
|
17
|
-
"bqi",
|
|
18
|
-
"ckb",
|
|
19
|
-
"dv",
|
|
20
|
-
"fa",
|
|
21
|
-
"glk",
|
|
22
|
-
"he",
|
|
23
|
-
"ku",
|
|
24
|
-
"mzn",
|
|
25
|
-
"nqo",
|
|
26
|
-
"pnb",
|
|
27
|
-
"ps",
|
|
28
|
-
"sd",
|
|
29
|
-
"ug",
|
|
30
|
-
"ur",
|
|
31
|
-
"yi"
|
|
32
|
-
]);
|
|
33
|
-
function c(t) {
|
|
34
|
-
if (Intl.Locale) {
|
|
35
|
-
let e = new Intl.Locale(t).maximize(), a = typeof e.getTextInfo == "function" ? e.getTextInfo() : e.textInfo;
|
|
36
|
-
if (a) return a.direction === "rtl";
|
|
37
|
-
if (e.script) return r.has(e.script);
|
|
38
|
-
}
|
|
39
|
-
let n = t.split("-")[0];
|
|
40
|
-
return o.has(n);
|
|
41
|
-
}
|
|
42
|
-
export {
|
|
43
|
-
c as isRTL
|
|
44
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { getInteractionModality as a } from "./useFocusVisible.js";
|
|
2
|
-
import { getActiveElement as f } from "../../utils/dist/DOMFunctions.js";
|
|
3
|
-
import { getOwnerDocument as i } from "../../utils/dist/domHelpers.js";
|
|
4
|
-
import { focusWithoutScrolling as c } from "../../utils/dist/focusWithoutScrolling.js";
|
|
5
|
-
import { runAfterTransition as $ } from "../../utils/dist/runAfterTransition.js";
|
|
6
|
-
function p(e) {
|
|
7
|
-
const o = i(e);
|
|
8
|
-
if (a() === "virtual") {
|
|
9
|
-
let r = f(o);
|
|
10
|
-
$(() => {
|
|
11
|
-
const t = f(o);
|
|
12
|
-
(t === r || t === o.body) && e.isConnected && c(e);
|
|
13
|
-
});
|
|
14
|
-
} else c(e);
|
|
15
|
-
}
|
|
16
|
-
export {
|
|
17
|
-
p as focusSafely
|
|
18
|
-
};
|