anysystem-design 0.0.16 → 0.0.18
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/active-element-history-Djev6nPQ.js +43 -0
- package/dist/{keyboard-WLAoTvIF.js → bugs-CHTtT8VX.js} +116 -123
- package/dist/calculate-active-index-xXUBsarF.js +1141 -0
- package/dist/close-provider-Cs3ZWgEC.js +9 -0
- package/dist/{combobox-GYodOLPS.js → combobox-Dj9kDXdY.js} +213 -243
- package/dist/components/AutoComplete/AutoCompleteBase.js +26 -26
- package/dist/components/AutoComplete/AutoCompleteMultiple.js +11 -11
- package/dist/components/DatePicker/DatePicker.js +12 -12
- package/dist/components/Modal/Modal.d.ts +25 -0
- package/dist/components/Modal/Modal.js +342 -0
- package/dist/components/Modal/index.d.ts +2 -0
- package/dist/components/Modal/index.js +4 -0
- package/dist/components/NavList/NavList.js +53 -56
- package/dist/components/Navbar/Navbar.js +9 -9
- package/dist/components/RadioGroup/RadioGroup.js +62 -59
- package/dist/components/Selectbox/SelectboxBase.js +4 -4
- package/dist/components/Selectbox/SelectboxMultiple.js +4 -4
- package/dist/components/Switch/Switch.js +19 -17
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +12 -10
- package/dist/description-BGLBXSvA.js +53 -0
- package/dist/focus-management-BnM4wN4Z.js +86 -0
- package/dist/index-bj2cEeS0.js +29 -0
- package/dist/index.css +1 -1
- package/dist/index.js +19 -17
- package/dist/keyboard-DnlWU23I.js +9 -0
- package/dist/label-9PX7EyLe.js +119 -0
- package/dist/layouts/SideMenu/SideMenu.js +25 -25
- package/dist/{listbox-BXC8z9Qj.js → listbox-ClkgDv_m.js} +113 -109
- package/dist/{open-closed-C-QjnEr7.js → open-closed-CowzTowH.js} +5 -5
- package/dist/portal-B7hH6hDh.js +326 -0
- package/dist/{transition-B_YPzh_T.js → transition-6o20faRl.js} +18 -16
- package/dist/{use-resolve-button-type-BXUD2Zvz.js → use-resolve-button-type-DkEA2l9L.js} +2 -2
- package/dist/{use-sync-refs-DhGTVDyx.js → use-sync-refs-TDnk3jQt.js} +2 -2
- package/package.json +1 -1
- package/dist/index-CGOwpnLF.js +0 -109
- package/dist/label-C-udG76R.js +0 -164
- package/dist/portal-Cczr4jWX.js +0 -1443
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useEffect as c, useRef as f } from "react";
|
|
2
|
+
import { s, o as l } from "./use-sync-refs-TDnk3jQt.js";
|
|
3
|
+
import { f as m } from "./focus-management-BnM4wN4Z.js";
|
|
4
|
+
function w(t, e, n, o) {
|
|
5
|
+
let u = s(n);
|
|
6
|
+
c(() => {
|
|
7
|
+
t = t ?? window;
|
|
8
|
+
function d(i) {
|
|
9
|
+
u.current(i);
|
|
10
|
+
}
|
|
11
|
+
return t.addEventListener(e, d, o), () => t.removeEventListener(e, d, o);
|
|
12
|
+
}, [t, e, o]);
|
|
13
|
+
}
|
|
14
|
+
function y(t, e) {
|
|
15
|
+
let n = f([]), o = l(t);
|
|
16
|
+
c(() => {
|
|
17
|
+
let u = [...n.current];
|
|
18
|
+
for (let [d, i] of e.entries()) if (n.current[d] !== i) {
|
|
19
|
+
let a = o(e, u);
|
|
20
|
+
return n.current = e, a;
|
|
21
|
+
}
|
|
22
|
+
}, [o, ...e]);
|
|
23
|
+
}
|
|
24
|
+
function p(t) {
|
|
25
|
+
function e() {
|
|
26
|
+
document.readyState !== "loading" && (t(), document.removeEventListener("DOMContentLoaded", e));
|
|
27
|
+
}
|
|
28
|
+
typeof window < "u" && typeof document < "u" && (document.addEventListener("DOMContentLoaded", e), e());
|
|
29
|
+
}
|
|
30
|
+
let r = [];
|
|
31
|
+
p(() => {
|
|
32
|
+
function t(e) {
|
|
33
|
+
if (!(e.target instanceof HTMLElement) || e.target === document.body || r[0] === e.target) return;
|
|
34
|
+
let n = e.target;
|
|
35
|
+
n = n.closest(m), r.unshift(n ?? e.target), r = r.filter((o) => o != null && o.isConnected), r.splice(10);
|
|
36
|
+
}
|
|
37
|
+
window.addEventListener("click", t, { capture: !0 }), window.addEventListener("mousedown", t, { capture: !0 }), window.addEventListener("focus", t, { capture: !0 }), document.body.addEventListener("click", t, { capture: !0 }), document.body.addEventListener("mousedown", t, { capture: !0 }), document.body.addEventListener("focus", t, { capture: !0 });
|
|
38
|
+
});
|
|
39
|
+
export {
|
|
40
|
+
w as E,
|
|
41
|
+
y as m,
|
|
42
|
+
r
|
|
43
|
+
};
|
|
@@ -1,40 +1,39 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const C = typeof document < "u" ? U.useLayoutEffect : () => {
|
|
1
|
+
import j, { useRef as h, useCallback as v, useEffect as P, useState as M, useMemo as G } from "react";
|
|
2
|
+
const I = typeof document < "u" ? j.useLayoutEffect : () => {
|
|
4
3
|
};
|
|
5
|
-
function
|
|
4
|
+
function U(t) {
|
|
6
5
|
const n = h(null);
|
|
7
|
-
return
|
|
8
|
-
n.current =
|
|
6
|
+
return I(() => {
|
|
7
|
+
n.current = t;
|
|
9
8
|
}, [
|
|
10
|
-
|
|
11
|
-
]), v((...
|
|
9
|
+
t
|
|
10
|
+
]), v((...e) => {
|
|
12
11
|
const r = n.current;
|
|
13
|
-
return r == null ? void 0 : r(...
|
|
12
|
+
return r == null ? void 0 : r(...e);
|
|
14
13
|
}, []);
|
|
15
14
|
}
|
|
16
|
-
const w = (
|
|
15
|
+
const w = (t) => {
|
|
17
16
|
var n;
|
|
18
|
-
return (n =
|
|
19
|
-
},
|
|
20
|
-
function
|
|
17
|
+
return (n = t == null ? void 0 : t.ownerDocument) !== null && n !== void 0 ? n : document;
|
|
18
|
+
}, b = (t) => t && "window" in t && t.window === t ? t : w(t).defaultView || window;
|
|
19
|
+
function R(t) {
|
|
21
20
|
var n;
|
|
22
|
-
return typeof window > "u" || window.navigator == null ? !1 : ((n = window.navigator.userAgentData) === null || n === void 0 ? void 0 : n.brands.some((
|
|
21
|
+
return typeof window > "u" || window.navigator == null ? !1 : ((n = window.navigator.userAgentData) === null || n === void 0 ? void 0 : n.brands.some((e) => t.test(e.brand))) || t.test(window.navigator.userAgent);
|
|
23
22
|
}
|
|
24
|
-
function z(
|
|
23
|
+
function z(t) {
|
|
25
24
|
var n;
|
|
26
|
-
return typeof window < "u" && window.navigator != null ?
|
|
25
|
+
return typeof window < "u" && window.navigator != null ? t.test(((n = window.navigator.userAgentData) === null || n === void 0 ? void 0 : n.platform) || window.navigator.platform) : !1;
|
|
27
26
|
}
|
|
28
|
-
function
|
|
27
|
+
function N() {
|
|
29
28
|
return z(/^Mac/i);
|
|
30
29
|
}
|
|
31
|
-
function
|
|
32
|
-
return
|
|
30
|
+
function Y() {
|
|
31
|
+
return R(/Android/i);
|
|
33
32
|
}
|
|
34
|
-
function
|
|
35
|
-
return
|
|
33
|
+
function q(t) {
|
|
34
|
+
return t.mozInputSource === 0 && t.isTrusted ? !0 : Y() && t.pointerType ? t.type === "click" && t.buttons === 1 : t.detail === 0 && !t.pointerType;
|
|
36
35
|
}
|
|
37
|
-
class
|
|
36
|
+
class J {
|
|
38
37
|
isDefaultPrevented() {
|
|
39
38
|
return this.nativeEvent.defaultPrevented;
|
|
40
39
|
}
|
|
@@ -49,29 +48,29 @@ class Q {
|
|
|
49
48
|
}
|
|
50
49
|
persist() {
|
|
51
50
|
}
|
|
52
|
-
constructor(n,
|
|
53
|
-
this.nativeEvent =
|
|
51
|
+
constructor(n, e) {
|
|
52
|
+
this.nativeEvent = e, this.target = e.target, this.currentTarget = e.currentTarget, this.relatedTarget = e.relatedTarget, this.bubbles = e.bubbles, this.cancelable = e.cancelable, this.defaultPrevented = e.defaultPrevented, this.eventPhase = e.eventPhase, this.isTrusted = e.isTrusted, this.timeStamp = e.timeStamp, this.type = n;
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
|
-
function
|
|
55
|
+
function B(t) {
|
|
57
56
|
let n = h({
|
|
58
57
|
isFocused: !1,
|
|
59
58
|
observer: null
|
|
60
59
|
});
|
|
61
|
-
|
|
60
|
+
I(() => {
|
|
62
61
|
const r = n.current;
|
|
63
62
|
return () => {
|
|
64
63
|
r.observer && (r.observer.disconnect(), r.observer = null);
|
|
65
64
|
};
|
|
66
65
|
}, []);
|
|
67
|
-
let
|
|
68
|
-
|
|
66
|
+
let e = U((r) => {
|
|
67
|
+
t == null || t(r);
|
|
69
68
|
});
|
|
70
69
|
return v((r) => {
|
|
71
70
|
if (r.target instanceof HTMLButtonElement || r.target instanceof HTMLInputElement || r.target instanceof HTMLTextAreaElement || r.target instanceof HTMLSelectElement) {
|
|
72
71
|
n.current.isFocused = !0;
|
|
73
72
|
let o = r.target, a = (s) => {
|
|
74
|
-
n.current.isFocused = !1, o.disabled &&
|
|
73
|
+
n.current.isFocused = !1, o.disabled && e(new J("blur", s)), n.current.observer && (n.current.observer.disconnect(), n.current.observer = null);
|
|
75
74
|
};
|
|
76
75
|
o.addEventListener("focusout", a, {
|
|
77
76
|
once: !0
|
|
@@ -95,88 +94,88 @@ function I(e) {
|
|
|
95
94
|
});
|
|
96
95
|
}
|
|
97
96
|
}, [
|
|
98
|
-
|
|
97
|
+
e
|
|
99
98
|
]);
|
|
100
99
|
}
|
|
101
|
-
function
|
|
102
|
-
let { isDisabled: n, onFocus:
|
|
100
|
+
function Q(t) {
|
|
101
|
+
let { isDisabled: n, onFocus: e, onBlur: r, onFocusChange: o } = t;
|
|
103
102
|
const a = v((d) => {
|
|
104
103
|
if (d.target === d.currentTarget)
|
|
105
104
|
return r && r(d), o && o(!1), !0;
|
|
106
105
|
}, [
|
|
107
106
|
r,
|
|
108
107
|
o
|
|
109
|
-
]), s =
|
|
108
|
+
]), s = B(a), i = v((d) => {
|
|
110
109
|
const c = w(d.target);
|
|
111
|
-
d.target === d.currentTarget && c.activeElement === d.target && (
|
|
110
|
+
d.target === d.currentTarget && c.activeElement === d.target && (e && e(d), o && o(!0), s(d));
|
|
112
111
|
}, [
|
|
113
112
|
o,
|
|
114
|
-
|
|
113
|
+
e,
|
|
115
114
|
s
|
|
116
115
|
]);
|
|
117
116
|
return {
|
|
118
117
|
focusProps: {
|
|
119
|
-
onFocus: !n && (
|
|
118
|
+
onFocus: !n && (e || o || r) ? i : void 0,
|
|
120
119
|
onBlur: !n && (r || o) ? a : void 0
|
|
121
120
|
}
|
|
122
121
|
};
|
|
123
122
|
}
|
|
124
|
-
let
|
|
125
|
-
const
|
|
123
|
+
let y = null, x = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Map(), p = !1, S = !1;
|
|
124
|
+
const X = {
|
|
126
125
|
Tab: !0,
|
|
127
126
|
Escape: !0
|
|
128
127
|
};
|
|
129
|
-
function
|
|
130
|
-
for (let
|
|
128
|
+
function k(t, n) {
|
|
129
|
+
for (let e of x) e(t, n);
|
|
131
130
|
}
|
|
132
|
-
function
|
|
133
|
-
return !(
|
|
131
|
+
function Z(t) {
|
|
132
|
+
return !(t.metaKey || !N() && t.altKey || t.ctrlKey || t.key === "Control" || t.key === "Shift" || t.key === "Meta");
|
|
134
133
|
}
|
|
135
|
-
function L(
|
|
136
|
-
|
|
134
|
+
function L(t) {
|
|
135
|
+
p = !0, Z(t) && (y = "keyboard", k("keyboard", t));
|
|
137
136
|
}
|
|
138
|
-
function l(
|
|
139
|
-
|
|
137
|
+
function l(t) {
|
|
138
|
+
y = "pointer", (t.type === "mousedown" || t.type === "pointerdown") && (p = !0, k("pointer", t));
|
|
140
139
|
}
|
|
141
|
-
function
|
|
142
|
-
|
|
140
|
+
function A(t) {
|
|
141
|
+
q(t) && (p = !0, y = "virtual");
|
|
143
142
|
}
|
|
144
|
-
function K(
|
|
145
|
-
|
|
143
|
+
function K(t) {
|
|
144
|
+
t.target === window || t.target === document || (!p && !S && (y = "virtual", k("virtual", t)), p = !1, S = !1);
|
|
146
145
|
}
|
|
147
|
-
function
|
|
148
|
-
|
|
146
|
+
function V() {
|
|
147
|
+
p = !1, S = !0;
|
|
149
148
|
}
|
|
150
|
-
function
|
|
151
|
-
if (typeof window > "u" || m.get(
|
|
152
|
-
const n =
|
|
149
|
+
function D(t) {
|
|
150
|
+
if (typeof window > "u" || m.get(b(t))) return;
|
|
151
|
+
const n = b(t), e = w(t);
|
|
153
152
|
let r = n.HTMLElement.prototype.focus;
|
|
154
153
|
n.HTMLElement.prototype.focus = function() {
|
|
155
|
-
|
|
156
|
-
},
|
|
157
|
-
|
|
154
|
+
p = !0, r.apply(this, arguments);
|
|
155
|
+
}, e.addEventListener("keydown", L, !0), e.addEventListener("keyup", L, !0), e.addEventListener("click", A, !0), n.addEventListener("focus", K, !0), n.addEventListener("blur", V, !1), typeof PointerEvent < "u" ? (e.addEventListener("pointerdown", l, !0), e.addEventListener("pointermove", l, !0), e.addEventListener("pointerup", l, !0)) : (e.addEventListener("mousedown", l, !0), e.addEventListener("mousemove", l, !0), e.addEventListener("mouseup", l, !0)), n.addEventListener("beforeunload", () => {
|
|
156
|
+
O(t);
|
|
158
157
|
}, {
|
|
159
158
|
once: !0
|
|
160
159
|
}), m.set(n, {
|
|
161
160
|
focus: r
|
|
162
161
|
});
|
|
163
162
|
}
|
|
164
|
-
const
|
|
165
|
-
const
|
|
166
|
-
n && r.removeEventListener("DOMContentLoaded", n), m.has(
|
|
163
|
+
const O = (t, n) => {
|
|
164
|
+
const e = b(t), r = w(t);
|
|
165
|
+
n && r.removeEventListener("DOMContentLoaded", n), m.has(e) && (e.HTMLElement.prototype.focus = m.get(e).focus, r.removeEventListener("keydown", L, !0), r.removeEventListener("keyup", L, !0), r.removeEventListener("click", A, !0), e.removeEventListener("focus", K, !0), e.removeEventListener("blur", V, !1), typeof PointerEvent < "u" ? (r.removeEventListener("pointerdown", l, !0), r.removeEventListener("pointermove", l, !0), r.removeEventListener("pointerup", l, !0)) : (r.removeEventListener("mousedown", l, !0), r.removeEventListener("mousemove", l, !0), r.removeEventListener("mouseup", l, !0)), m.delete(e));
|
|
167
166
|
};
|
|
168
|
-
function
|
|
169
|
-
const n = w(
|
|
170
|
-
let
|
|
171
|
-
return n.readyState !== "loading" ?
|
|
172
|
-
|
|
173
|
-
}, n.addEventListener("DOMContentLoaded",
|
|
167
|
+
function ee(t) {
|
|
168
|
+
const n = w(t);
|
|
169
|
+
let e;
|
|
170
|
+
return n.readyState !== "loading" ? D(t) : (e = () => {
|
|
171
|
+
D(t);
|
|
172
|
+
}, n.addEventListener("DOMContentLoaded", e)), () => O(t, e);
|
|
174
173
|
}
|
|
175
|
-
typeof document < "u" &&
|
|
174
|
+
typeof document < "u" && ee();
|
|
176
175
|
function _() {
|
|
177
|
-
return
|
|
176
|
+
return y !== "pointer";
|
|
178
177
|
}
|
|
179
|
-
const
|
|
178
|
+
const te = /* @__PURE__ */ new Set([
|
|
180
179
|
"checkbox",
|
|
181
180
|
"radio",
|
|
182
181
|
"range",
|
|
@@ -187,31 +186,31 @@ const ne = /* @__PURE__ */ new Set([
|
|
|
187
186
|
"submit",
|
|
188
187
|
"reset"
|
|
189
188
|
]);
|
|
190
|
-
function
|
|
189
|
+
function ne(t, n, e) {
|
|
191
190
|
var r;
|
|
192
|
-
const o = typeof window < "u" ?
|
|
193
|
-
return
|
|
191
|
+
const o = typeof window < "u" ? b(e == null ? void 0 : e.target).HTMLInputElement : HTMLInputElement, a = typeof window < "u" ? b(e == null ? void 0 : e.target).HTMLTextAreaElement : HTMLTextAreaElement, s = typeof window < "u" ? b(e == null ? void 0 : e.target).HTMLElement : HTMLElement, i = typeof window < "u" ? b(e == null ? void 0 : e.target).KeyboardEvent : KeyboardEvent;
|
|
192
|
+
return t = t || (e == null ? void 0 : e.target) instanceof o && !te.has(e == null || (r = e.target) === null || r === void 0 ? void 0 : r.type) || (e == null ? void 0 : e.target) instanceof a || (e == null ? void 0 : e.target) instanceof s && (e == null ? void 0 : e.target.isContentEditable), !(t && n === "keyboard" && e instanceof i && !X[e.key]);
|
|
194
193
|
}
|
|
195
|
-
function
|
|
196
|
-
|
|
194
|
+
function re(t, n, e) {
|
|
195
|
+
D(), P(() => {
|
|
197
196
|
let r = (o, a) => {
|
|
198
|
-
|
|
197
|
+
ne(!!(e != null && e.isTextInput), o, a) && t(_());
|
|
199
198
|
};
|
|
200
|
-
return
|
|
201
|
-
|
|
199
|
+
return x.add(r), () => {
|
|
200
|
+
x.delete(r);
|
|
202
201
|
};
|
|
203
202
|
}, n);
|
|
204
203
|
}
|
|
205
|
-
function
|
|
206
|
-
let { isDisabled: n, onBlurWithin:
|
|
204
|
+
function oe(t) {
|
|
205
|
+
let { isDisabled: n, onBlurWithin: e, onFocusWithin: r, onFocusWithinChange: o } = t, a = h({
|
|
207
206
|
isFocusWithin: !1
|
|
208
207
|
}), s = v((c) => {
|
|
209
|
-
a.current.isFocusWithin && !c.currentTarget.contains(c.relatedTarget) && (a.current.isFocusWithin = !1,
|
|
208
|
+
a.current.isFocusWithin && !c.currentTarget.contains(c.relatedTarget) && (a.current.isFocusWithin = !1, e && e(c), o && o(!1));
|
|
210
209
|
}, [
|
|
211
|
-
|
|
210
|
+
e,
|
|
212
211
|
o,
|
|
213
212
|
a
|
|
214
|
-
]), i =
|
|
213
|
+
]), i = B(s), d = v((c) => {
|
|
215
214
|
!a.current.isFocusWithin && document.activeElement === c.target && (r && r(c), o && o(!0), a.current.isFocusWithin = !0, i(c));
|
|
216
215
|
}, [
|
|
217
216
|
r,
|
|
@@ -232,47 +231,47 @@ function ie(e) {
|
|
|
232
231
|
};
|
|
233
232
|
}
|
|
234
233
|
let F = !1, H = 0;
|
|
235
|
-
function
|
|
234
|
+
function W() {
|
|
236
235
|
F = !0, setTimeout(() => {
|
|
237
236
|
F = !1;
|
|
238
237
|
}, 50);
|
|
239
238
|
}
|
|
240
|
-
function
|
|
241
|
-
|
|
239
|
+
function C(t) {
|
|
240
|
+
t.pointerType === "touch" && W();
|
|
242
241
|
}
|
|
243
|
-
function
|
|
242
|
+
function ie() {
|
|
244
243
|
if (!(typeof document > "u"))
|
|
245
|
-
return typeof PointerEvent < "u" ? document.addEventListener("pointerup",
|
|
246
|
-
H--, !(H > 0) && (typeof PointerEvent < "u" ? document.removeEventListener("pointerup",
|
|
244
|
+
return typeof PointerEvent < "u" ? document.addEventListener("pointerup", C) : document.addEventListener("touchend", W), H++, () => {
|
|
245
|
+
H--, !(H > 0) && (typeof PointerEvent < "u" ? document.removeEventListener("pointerup", C) : document.removeEventListener("touchend", W));
|
|
247
246
|
};
|
|
248
247
|
}
|
|
249
|
-
function
|
|
250
|
-
let { onHoverStart: n, onHoverChange:
|
|
248
|
+
function se(t) {
|
|
249
|
+
let { onHoverStart: n, onHoverChange: e, onHoverEnd: r, isDisabled: o } = t, [a, s] = M(!1), i = h({
|
|
251
250
|
isHovered: !1,
|
|
252
251
|
ignoreEmulatedMouseEvents: !1,
|
|
253
252
|
pointerType: "",
|
|
254
253
|
target: null
|
|
255
254
|
}).current;
|
|
256
|
-
P(
|
|
257
|
-
let { hoverProps: d, triggerHoverEnd: c } =
|
|
255
|
+
P(ie, []);
|
|
256
|
+
let { hoverProps: d, triggerHoverEnd: c } = G(() => {
|
|
258
257
|
let g = (u, $) => {
|
|
259
258
|
if (i.pointerType = $, o || $ === "touch" || i.isHovered || !u.currentTarget.contains(u.target)) return;
|
|
260
259
|
i.isHovered = !0;
|
|
261
|
-
let
|
|
262
|
-
i.target =
|
|
260
|
+
let T = u.currentTarget;
|
|
261
|
+
i.target = T, n && n({
|
|
263
262
|
type: "hoverstart",
|
|
264
|
-
target:
|
|
263
|
+
target: T,
|
|
265
264
|
pointerType: $
|
|
266
|
-
}),
|
|
265
|
+
}), e && e(!0), s(!0);
|
|
267
266
|
}, E = (u, $) => {
|
|
268
267
|
if (i.pointerType = "", i.target = null, $ === "touch" || !i.isHovered) return;
|
|
269
268
|
i.isHovered = !1;
|
|
270
|
-
let
|
|
269
|
+
let T = u.currentTarget;
|
|
271
270
|
r && r({
|
|
272
271
|
type: "hoverend",
|
|
273
|
-
target:
|
|
272
|
+
target: T,
|
|
274
273
|
pointerType: $
|
|
275
|
-
}),
|
|
274
|
+
}), e && e(!1), s(!1);
|
|
276
275
|
}, f = {};
|
|
277
276
|
return typeof PointerEvent < "u" ? (f.onPointerEnter = (u) => {
|
|
278
277
|
F && u.pointerType === "mouse" || g(u, u.pointerType);
|
|
@@ -290,7 +289,7 @@ function le(e) {
|
|
|
290
289
|
};
|
|
291
290
|
}, [
|
|
292
291
|
n,
|
|
293
|
-
|
|
292
|
+
e,
|
|
294
293
|
r,
|
|
295
294
|
o,
|
|
296
295
|
i
|
|
@@ -306,8 +305,8 @@ function le(e) {
|
|
|
306
305
|
isHovered: a
|
|
307
306
|
};
|
|
308
307
|
}
|
|
309
|
-
function
|
|
310
|
-
let { autoFocus: n = !1, isTextInput:
|
|
308
|
+
function de(t = {}) {
|
|
309
|
+
let { autoFocus: n = !1, isTextInput: e, within: r } = t, o = h({
|
|
311
310
|
isFocused: !1,
|
|
312
311
|
isFocusVisible: n || _()
|
|
313
312
|
}), [a, s] = M(!1), [i, d] = M(() => o.current.isFocused && o.current.isFocusVisible), c = v(() => d(o.current.isFocused && o.current.isFocusVisible), []), g = v((u) => {
|
|
@@ -315,15 +314,15 @@ function fe(e = {}) {
|
|
|
315
314
|
}, [
|
|
316
315
|
c
|
|
317
316
|
]);
|
|
318
|
-
|
|
317
|
+
re((u) => {
|
|
319
318
|
o.current.isFocusVisible = u, c();
|
|
320
319
|
}, [], {
|
|
321
|
-
isTextInput:
|
|
320
|
+
isTextInput: e
|
|
322
321
|
});
|
|
323
|
-
let { focusProps: E } =
|
|
322
|
+
let { focusProps: E } = Q({
|
|
324
323
|
isDisabled: r,
|
|
325
324
|
onFocusChange: g
|
|
326
|
-
}), { focusWithinProps: f } =
|
|
325
|
+
}), { focusWithinProps: f } = oe({
|
|
327
326
|
isDisabled: !r,
|
|
328
327
|
onFocusWithinChange: g
|
|
329
328
|
});
|
|
@@ -333,29 +332,23 @@ function fe(e = {}) {
|
|
|
333
332
|
focusProps: r ? f : E
|
|
334
333
|
};
|
|
335
334
|
}
|
|
336
|
-
function
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
function pe(e) {
|
|
340
|
-
let n = e.parentElement, t = null;
|
|
341
|
-
for (; n && !(n instanceof HTMLFieldSetElement); ) n instanceof HTMLLegendElement && (t = n), n = n.parentElement;
|
|
335
|
+
function ce(t) {
|
|
336
|
+
let n = t.parentElement, e = null;
|
|
337
|
+
for (; n && !(n instanceof HTMLFieldSetElement); ) n instanceof HTMLLegendElement && (e = n), n = n.parentElement;
|
|
342
338
|
let r = (n == null ? void 0 : n.getAttribute("disabled")) === "";
|
|
343
|
-
return r &&
|
|
339
|
+
return r && ue(e) ? !1 : r;
|
|
344
340
|
}
|
|
345
|
-
function
|
|
346
|
-
if (!
|
|
347
|
-
let n =
|
|
341
|
+
function ue(t) {
|
|
342
|
+
if (!t) return !1;
|
|
343
|
+
let n = t.previousElementSibling;
|
|
348
344
|
for (; n !== null; ) {
|
|
349
345
|
if (n instanceof HTMLLegendElement) return !1;
|
|
350
346
|
n = n.previousElementSibling;
|
|
351
347
|
}
|
|
352
348
|
return !0;
|
|
353
349
|
}
|
|
354
|
-
var se = ((e) => (e.Space = " ", e.Enter = "Enter", e.Escape = "Escape", e.Backspace = "Backspace", e.Delete = "Delete", e.ArrowLeft = "ArrowLeft", e.ArrowUp = "ArrowUp", e.ArrowRight = "ArrowRight", e.ArrowDown = "ArrowDown", e.Home = "Home", e.End = "End", e.PageUp = "PageUp", e.PageDown = "PageDown", e.Tab = "Tab", e))(se || {});
|
|
355
350
|
export {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
pe as r,
|
|
360
|
-
ve as u
|
|
351
|
+
de as $,
|
|
352
|
+
se as a,
|
|
353
|
+
ce as r
|
|
361
354
|
};
|