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.
Files changed (38) hide show
  1. package/dist/active-element-history-Djev6nPQ.js +43 -0
  2. package/dist/{keyboard-WLAoTvIF.js → bugs-CHTtT8VX.js} +116 -123
  3. package/dist/calculate-active-index-xXUBsarF.js +1141 -0
  4. package/dist/close-provider-Cs3ZWgEC.js +9 -0
  5. package/dist/{combobox-GYodOLPS.js → combobox-Dj9kDXdY.js} +213 -243
  6. package/dist/components/AutoComplete/AutoCompleteBase.js +26 -26
  7. package/dist/components/AutoComplete/AutoCompleteMultiple.js +11 -11
  8. package/dist/components/DatePicker/DatePicker.js +12 -12
  9. package/dist/components/Modal/Modal.d.ts +25 -0
  10. package/dist/components/Modal/Modal.js +342 -0
  11. package/dist/components/Modal/index.d.ts +2 -0
  12. package/dist/components/Modal/index.js +4 -0
  13. package/dist/components/NavList/NavList.js +53 -56
  14. package/dist/components/Navbar/Navbar.js +9 -9
  15. package/dist/components/RadioGroup/RadioGroup.js +62 -59
  16. package/dist/components/Selectbox/SelectboxBase.js +4 -4
  17. package/dist/components/Selectbox/SelectboxMultiple.js +4 -4
  18. package/dist/components/Switch/Switch.js +19 -17
  19. package/dist/components/index.d.ts +2 -0
  20. package/dist/components/index.js +12 -10
  21. package/dist/description-BGLBXSvA.js +53 -0
  22. package/dist/focus-management-BnM4wN4Z.js +86 -0
  23. package/dist/index-bj2cEeS0.js +29 -0
  24. package/dist/index.css +1 -1
  25. package/dist/index.js +19 -17
  26. package/dist/keyboard-DnlWU23I.js +9 -0
  27. package/dist/label-9PX7EyLe.js +119 -0
  28. package/dist/layouts/SideMenu/SideMenu.js +25 -25
  29. package/dist/{listbox-BXC8z9Qj.js → listbox-ClkgDv_m.js} +113 -109
  30. package/dist/{open-closed-C-QjnEr7.js → open-closed-CowzTowH.js} +5 -5
  31. package/dist/portal-B7hH6hDh.js +326 -0
  32. package/dist/{transition-B_YPzh_T.js → transition-6o20faRl.js} +18 -16
  33. package/dist/{use-resolve-button-type-BXUD2Zvz.js → use-resolve-button-type-DkEA2l9L.js} +2 -2
  34. package/dist/{use-sync-refs-DhGTVDyx.js → use-sync-refs-TDnk3jQt.js} +2 -2
  35. package/package.json +1 -1
  36. package/dist/index-CGOwpnLF.js +0 -109
  37. package/dist/label-C-udG76R.js +0 -164
  38. 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 U, { useRef as h, useCallback as v, useEffect as P, useState as M, useMemo as j } from "react";
2
- import { b as G } from "./use-sync-refs-DhGTVDyx.js";
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 R(e) {
4
+ function U(t) {
6
5
  const n = h(null);
7
- return C(() => {
8
- n.current = e;
6
+ return I(() => {
7
+ n.current = t;
9
8
  }, [
10
- e
11
- ]), v((...t) => {
9
+ t
10
+ ]), v((...e) => {
12
11
  const r = n.current;
13
- return r == null ? void 0 : r(...t);
12
+ return r == null ? void 0 : r(...e);
14
13
  }, []);
15
14
  }
16
- const w = (e) => {
15
+ const w = (t) => {
17
16
  var n;
18
- return (n = e == null ? void 0 : e.ownerDocument) !== null && n !== void 0 ? n : document;
19
- }, p = (e) => e && "window" in e && e.window === e ? e : w(e).defaultView || window;
20
- function N(e) {
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((t) => e.test(t.brand))) || e.test(window.navigator.userAgent);
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(e) {
23
+ function z(t) {
25
24
  var n;
26
- return typeof window < "u" && window.navigator != null ? e.test(((n = window.navigator.userAgentData) === null || n === void 0 ? void 0 : n.platform) || window.navigator.platform) : !1;
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 Y() {
27
+ function N() {
29
28
  return z(/^Mac/i);
30
29
  }
31
- function q() {
32
- return N(/Android/i);
30
+ function Y() {
31
+ return R(/Android/i);
33
32
  }
34
- function J(e) {
35
- return e.mozInputSource === 0 && e.isTrusted ? !0 : q() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
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 Q {
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, t) {
53
- this.nativeEvent = t, this.target = t.target, this.currentTarget = t.currentTarget, this.relatedTarget = t.relatedTarget, this.bubbles = t.bubbles, this.cancelable = t.cancelable, this.defaultPrevented = t.defaultPrevented, this.eventPhase = t.eventPhase, this.isTrusted = t.isTrusted, this.timeStamp = t.timeStamp, this.type = n;
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 I(e) {
55
+ function B(t) {
57
56
  let n = h({
58
57
  isFocused: !1,
59
58
  observer: null
60
59
  });
61
- C(() => {
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 t = R((r) => {
68
- e == null || e(r);
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 && t(new Q("blur", s)), n.current.observer && (n.current.observer.disconnect(), n.current.observer = null);
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
- t
97
+ e
99
98
  ]);
100
99
  }
101
- function X(e) {
102
- let { isDisabled: n, onFocus: t, onBlur: r, onFocusChange: o } = e;
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 = I(a), i = v((d) => {
108
+ ]), s = B(a), i = v((d) => {
110
109
  const c = w(d.target);
111
- d.target === d.currentTarget && c.activeElement === d.target && (t && t(d), o && o(!0), s(d));
110
+ d.target === d.currentTarget && c.activeElement === d.target && (e && e(d), o && o(!0), s(d));
112
111
  }, [
113
112
  o,
114
- t,
113
+ e,
115
114
  s
116
115
  ]);
117
116
  return {
118
117
  focusProps: {
119
- onFocus: !n && (t || o || r) ? i : void 0,
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 T = null, D = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Map(), b = !1, S = !1;
125
- const Z = {
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 A(e, n) {
130
- for (let t of D) t(e, n);
128
+ function k(t, n) {
129
+ for (let e of x) e(t, n);
131
130
  }
132
- function ee(e) {
133
- return !(e.metaKey || !Y() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
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(e) {
136
- b = !0, ee(e) && (T = "keyboard", A("keyboard", e));
134
+ function L(t) {
135
+ p = !0, Z(t) && (y = "keyboard", k("keyboard", t));
137
136
  }
138
- function l(e) {
139
- T = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (b = !0, A("pointer", e));
137
+ function l(t) {
138
+ y = "pointer", (t.type === "mousedown" || t.type === "pointerdown") && (p = !0, k("pointer", t));
140
139
  }
141
- function B(e) {
142
- J(e) && (b = !0, T = "virtual");
140
+ function A(t) {
141
+ q(t) && (p = !0, y = "virtual");
143
142
  }
144
- function K(e) {
145
- e.target === window || e.target === document || (!b && !S && (T = "virtual", A("virtual", e)), b = !1, S = !1);
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 O() {
148
- b = !1, S = !0;
146
+ function V() {
147
+ p = !1, S = !0;
149
148
  }
150
- function x(e) {
151
- if (typeof window > "u" || m.get(p(e))) return;
152
- const n = p(e), t = w(e);
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
- b = !0, r.apply(this, arguments);
156
- }, t.addEventListener("keydown", L, !0), t.addEventListener("keyup", L, !0), t.addEventListener("click", B, !0), n.addEventListener("focus", K, !0), n.addEventListener("blur", O, !1), typeof PointerEvent < "u" ? (t.addEventListener("pointerdown", l, !0), t.addEventListener("pointermove", l, !0), t.addEventListener("pointerup", l, !0)) : (t.addEventListener("mousedown", l, !0), t.addEventListener("mousemove", l, !0), t.addEventListener("mouseup", l, !0)), n.addEventListener("beforeunload", () => {
157
- V(e);
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 V = (e, n) => {
165
- const t = p(e), r = w(e);
166
- n && r.removeEventListener("DOMContentLoaded", n), m.has(t) && (t.HTMLElement.prototype.focus = m.get(t).focus, r.removeEventListener("keydown", L, !0), r.removeEventListener("keyup", L, !0), r.removeEventListener("click", B, !0), t.removeEventListener("focus", K, !0), t.removeEventListener("blur", O, !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(t));
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 te(e) {
169
- const n = w(e);
170
- let t;
171
- return n.readyState !== "loading" ? x(e) : (t = () => {
172
- x(e);
173
- }, n.addEventListener("DOMContentLoaded", t)), () => V(e, t);
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" && te();
174
+ typeof document < "u" && ee();
176
175
  function _() {
177
- return T !== "pointer";
176
+ return y !== "pointer";
178
177
  }
179
- const ne = /* @__PURE__ */ new Set([
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 re(e, n, t) {
189
+ function ne(t, n, e) {
191
190
  var r;
192
- const o = typeof window < "u" ? p(t == null ? void 0 : t.target).HTMLInputElement : HTMLInputElement, a = typeof window < "u" ? p(t == null ? void 0 : t.target).HTMLTextAreaElement : HTMLTextAreaElement, s = typeof window < "u" ? p(t == null ? void 0 : t.target).HTMLElement : HTMLElement, i = typeof window < "u" ? p(t == null ? void 0 : t.target).KeyboardEvent : KeyboardEvent;
193
- return e = e || (t == null ? void 0 : t.target) instanceof o && !ne.has(t == null || (r = t.target) === null || r === void 0 ? void 0 : r.type) || (t == null ? void 0 : t.target) instanceof a || (t == null ? void 0 : t.target) instanceof s && (t == null ? void 0 : t.target.isContentEditable), !(e && n === "keyboard" && t instanceof i && !Z[t.key]);
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 oe(e, n, t) {
196
- x(), P(() => {
194
+ function re(t, n, e) {
195
+ D(), P(() => {
197
196
  let r = (o, a) => {
198
- re(!!(t != null && t.isTextInput), o, a) && e(_());
197
+ ne(!!(e != null && e.isTextInput), o, a) && t(_());
199
198
  };
200
- return D.add(r), () => {
201
- D.delete(r);
199
+ return x.add(r), () => {
200
+ x.delete(r);
202
201
  };
203
202
  }, n);
204
203
  }
205
- function ie(e) {
206
- let { isDisabled: n, onBlurWithin: t, onFocusWithin: r, onFocusWithinChange: o } = e, a = h({
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, t && t(c), o && o(!1));
208
+ a.current.isFocusWithin && !c.currentTarget.contains(c.relatedTarget) && (a.current.isFocusWithin = !1, e && e(c), o && o(!1));
210
209
  }, [
211
- t,
210
+ e,
212
211
  o,
213
212
  a
214
- ]), i = I(s), d = v((c) => {
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 k() {
234
+ function W() {
236
235
  F = !0, setTimeout(() => {
237
236
  F = !1;
238
237
  }, 50);
239
238
  }
240
- function W(e) {
241
- e.pointerType === "touch" && k();
239
+ function C(t) {
240
+ t.pointerType === "touch" && W();
242
241
  }
243
- function ue() {
242
+ function ie() {
244
243
  if (!(typeof document > "u"))
245
- return typeof PointerEvent < "u" ? document.addEventListener("pointerup", W) : document.addEventListener("touchend", k), H++, () => {
246
- H--, !(H > 0) && (typeof PointerEvent < "u" ? document.removeEventListener("pointerup", W) : document.removeEventListener("touchend", k));
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 le(e) {
250
- let { onHoverStart: n, onHoverChange: t, onHoverEnd: r, isDisabled: o } = e, [a, s] = M(!1), i = h({
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(ue, []);
257
- let { hoverProps: d, triggerHoverEnd: c } = j(() => {
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 y = u.currentTarget;
262
- i.target = y, n && n({
260
+ let T = u.currentTarget;
261
+ i.target = T, n && n({
263
262
  type: "hoverstart",
264
- target: y,
263
+ target: T,
265
264
  pointerType: $
266
- }), t && t(!0), s(!0);
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 y = u.currentTarget;
269
+ let T = u.currentTarget;
271
270
  r && r({
272
271
  type: "hoverend",
273
- target: y,
272
+ target: T,
274
273
  pointerType: $
275
- }), t && t(!1), s(!1);
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
- t,
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 fe(e = {}) {
310
- let { autoFocus: n = !1, isTextInput: t, within: r } = e, o = h({
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
- oe((u) => {
317
+ re((u) => {
319
318
  o.current.isFocusVisible = u, c();
320
319
  }, [], {
321
- isTextInput: t
320
+ isTextInput: e
322
321
  });
323
- let { focusProps: E } = X({
322
+ let { focusProps: E } = Q({
324
323
  isDisabled: r,
325
324
  onFocusChange: g
326
- }), { focusWithinProps: f } = ie({
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 ve(e) {
337
- return G.isServer ? null : e instanceof Node ? e.ownerDocument : e != null && e.hasOwnProperty("current") && e.current instanceof Node ? e.current.ownerDocument : document;
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 && ae(t) ? !1 : r;
339
+ return r && ue(e) ? !1 : r;
344
340
  }
345
- function ae(e) {
346
- if (!e) return !1;
347
- let n = e.previousElementSibling;
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
- fe as $,
357
- le as a,
358
- se as o,
359
- pe as r,
360
- ve as u
351
+ de as $,
352
+ se as a,
353
+ ce as r
361
354
  };