@la-batcave/ui 3.1.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.
Files changed (107) hide show
  1. package/README.md +95 -0
  2. package/dist/Alert.d.ts +27 -0
  3. package/dist/Alert.js +56 -0
  4. package/dist/Avatar.d.ts +20 -0
  5. package/dist/Avatar.js +40 -0
  6. package/dist/Badge.d.ts +56 -0
  7. package/dist/Badge.js +74 -0
  8. package/dist/Button.d.ts +53 -0
  9. package/dist/Button.js +66 -0
  10. package/dist/Card.d.ts +18 -0
  11. package/dist/Card.js +98 -0
  12. package/dist/CodeBlock.d.ts +45 -0
  13. package/dist/CodeBlock.js +306 -0
  14. package/dist/Collapse.d.ts +58 -0
  15. package/dist/Collapse.js +89 -0
  16. package/dist/Combobox.d.ts +44 -0
  17. package/dist/Combobox.js +409 -0
  18. package/dist/DarkMode.d.ts +59 -0
  19. package/dist/DarkMode.js +56 -0
  20. package/dist/DatePicker.d.ts +48 -0
  21. package/dist/DatePicker.js +2954 -0
  22. package/dist/Dialog.d.ts +119 -0
  23. package/dist/Dialog.js +337 -0
  24. package/dist/Drawer.d.ts +28 -0
  25. package/dist/Drawer.js +1126 -0
  26. package/dist/Dropdown.d.ts +23 -0
  27. package/dist/Dropdown.js +247 -0
  28. package/dist/EasyForm.d.ts +138 -0
  29. package/dist/EasyForm.js +286 -0
  30. package/dist/HoverCard.d.ts +10 -0
  31. package/dist/HoverCard.js +195 -0
  32. package/dist/Input.d.ts +230 -0
  33. package/dist/Input.js +2216 -0
  34. package/dist/LogViewer.d.ts +57 -0
  35. package/dist/LogViewer.js +120 -0
  36. package/dist/Menubar.d.ts +32 -0
  37. package/dist/Menubar.js +398 -0
  38. package/dist/Navbar.d.ts +20 -0
  39. package/dist/Navbar.js +31 -0
  40. package/dist/Pagination.d.ts +78 -0
  41. package/dist/Pagination.js +106 -0
  42. package/dist/Popover.d.ts +11 -0
  43. package/dist/Popover.js +28 -0
  44. package/dist/ProgressBar.d.ts +35 -0
  45. package/dist/ProgressBar.js +210 -0
  46. package/dist/Resizable.d.ts +23 -0
  47. package/dist/Resizable.js +1532 -0
  48. package/dist/Separator.d.ts +4 -0
  49. package/dist/Separator.js +46 -0
  50. package/dist/Sheet.d.ts +29 -0
  51. package/dist/Sheet.js +104 -0
  52. package/dist/Sidebar.d.ts +117 -0
  53. package/dist/Sidebar.js +237 -0
  54. package/dist/Skeleton.d.ts +57 -0
  55. package/dist/Skeleton.js +47 -0
  56. package/dist/Table.d.ts +71 -0
  57. package/dist/Table.js +94 -0
  58. package/dist/Tabs.d.ts +76 -0
  59. package/dist/Tabs.js +202 -0
  60. package/dist/Toast.d.ts +54 -0
  61. package/dist/Toast.js +827 -0
  62. package/dist/Tooltip.d.ts +29 -0
  63. package/dist/Tooltip.js +352 -0
  64. package/dist/Typography.d.ts +101 -0
  65. package/dist/Typography.js +123 -0
  66. package/dist/Widget.d.ts +133 -0
  67. package/dist/Widget.js +207 -0
  68. package/dist/_shared/Combination-D_l4PLF_.js +676 -0
  69. package/dist/_shared/index-B03TCNO5.js +142 -0
  70. package/dist/_shared/index-B1f-hyuh.js +31 -0
  71. package/dist/_shared/index-BC7vfx-u.js +13 -0
  72. package/dist/_shared/index-BrLJJgkl.js +67 -0
  73. package/dist/_shared/index-C0gNQvxa.js +269 -0
  74. package/dist/_shared/index-C3aZemLI.js +268 -0
  75. package/dist/_shared/index-CXeb1OMI.js +198 -0
  76. package/dist/_shared/index-CukUn3R0.js +626 -0
  77. package/dist/_shared/index-DLcqcWxM.js +29 -0
  78. package/dist/_shared/index-DlSuDb9N.js +283 -0
  79. package/dist/_shared/index-V-Ajw7Ac.js +79 -0
  80. package/dist/_shared/index-uPOYJZpG.js +34 -0
  81. package/dist/_shared/index-uu9PT5Nu.js +1588 -0
  82. package/dist/_shared/utils-eGXXUFl7.js +2935 -0
  83. package/dist/backgrounds/Aurora.d.ts +7 -0
  84. package/dist/backgrounds/Aurora.js +126 -0
  85. package/dist/backgrounds/Iridescence.d.ts +7 -0
  86. package/dist/backgrounds/Iridescence.js +77 -0
  87. package/dist/backgrounds/Lightning.d.ts +8 -0
  88. package/dist/backgrounds/Lightning.js +75 -0
  89. package/dist/backgrounds/LiquidChrome.d.ts +9 -0
  90. package/dist/backgrounds/LiquidChrome.js +89 -0
  91. package/dist/backgrounds/Particles.d.ts +15 -0
  92. package/dist/backgrounds/Particles.js +137 -0
  93. package/dist/backgrounds/PixelSnow.d.ts +9 -0
  94. package/dist/backgrounds/PixelSnow.js +52 -0
  95. package/dist/backgrounds/Silk.d.ts +8 -0
  96. package/dist/backgrounds/Silk.js +92 -0
  97. package/dist/backgrounds/Squares.d.ts +9 -0
  98. package/dist/backgrounds/Squares.js +75 -0
  99. package/dist/backgrounds/Threads.d.ts +7 -0
  100. package/dist/backgrounds/Threads.js +110 -0
  101. package/dist/backgrounds/Waves.d.ts +14 -0
  102. package/dist/backgrounds/Waves.js +139 -0
  103. package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
  104. package/dist/index.css +1 -0
  105. package/dist/index.d.ts +2 -0
  106. package/dist/index.js +4 -0
  107. package/package.json +318 -0
@@ -0,0 +1,142 @@
1
+ import * as r from "react";
2
+ import { d as m, c as p, b as k } from "./index-CXeb1OMI.js";
3
+ import { P as b, d as M } from "./index-V-Ajw7Ac.js";
4
+ import { u as T } from "./index-DLcqcWxM.js";
5
+ import { jsx as P } from "react/jsx-runtime";
6
+ import U from "react-dom";
7
+ function z(n, e = globalThis?.document) {
8
+ const t = m(n);
9
+ r.useEffect(() => {
10
+ const o = (s) => {
11
+ s.key === "Escape" && t(s);
12
+ };
13
+ return e.addEventListener("keydown", o, { capture: !0 }), () => e.removeEventListener("keydown", o, { capture: !0 });
14
+ }, [t, e]);
15
+ }
16
+ var H = "DismissableLayer", h = "dismissableLayer.update", K = "dismissableLayer.pointerDownOutside", j = "dismissableLayer.focusOutside", R, B = r.createContext({
17
+ layers: /* @__PURE__ */ new Set(),
18
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
19
+ branches: /* @__PURE__ */ new Set()
20
+ }), X = r.forwardRef(
21
+ (n, e) => {
22
+ const {
23
+ disableOutsidePointerEvents: t = !1,
24
+ onEscapeKeyDown: o,
25
+ onPointerDownOutside: s,
26
+ onFocusOutside: a,
27
+ onInteractOutside: d,
28
+ onDismiss: l,
29
+ ...E
30
+ } = n, c = r.useContext(B), [u, F] = r.useState(null), f = u?.ownerDocument ?? globalThis?.document, [, I] = r.useState({}), S = T(e, (i) => F(i)), D = Array.from(c.layers), [A] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), N = D.indexOf(A), O = u ? D.indexOf(u) : -1, W = c.layersWithOutsidePointerEventsDisabled.size > 0, L = O >= N, _ = G((i) => {
31
+ const v = i.target, w = [...c.branches].some((y) => y.contains(v));
32
+ !L || w || (s?.(i), d?.(i), i.defaultPrevented || l?.());
33
+ }, f), C = J((i) => {
34
+ const v = i.target;
35
+ [...c.branches].some((y) => y.contains(v)) || (a?.(i), d?.(i), i.defaultPrevented || l?.());
36
+ }, f);
37
+ return z((i) => {
38
+ O === c.layers.size - 1 && (o?.(i), !i.defaultPrevented && l && (i.preventDefault(), l()));
39
+ }, f), r.useEffect(() => {
40
+ if (u)
41
+ return t && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (R = f.body.style.pointerEvents, f.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(u)), c.layers.add(u), g(), () => {
42
+ t && c.layersWithOutsidePointerEventsDisabled.size === 1 && (f.body.style.pointerEvents = R);
43
+ };
44
+ }, [u, f, t, c]), r.useEffect(() => () => {
45
+ u && (c.layers.delete(u), c.layersWithOutsidePointerEventsDisabled.delete(u), g());
46
+ }, [u, c]), r.useEffect(() => {
47
+ const i = () => I({});
48
+ return document.addEventListener(h, i), () => document.removeEventListener(h, i);
49
+ }, []), /* @__PURE__ */ P(
50
+ b.div,
51
+ {
52
+ ...E,
53
+ ref: S,
54
+ style: {
55
+ pointerEvents: W ? L ? "auto" : "none" : void 0,
56
+ ...n.style
57
+ },
58
+ onFocusCapture: p(n.onFocusCapture, C.onFocusCapture),
59
+ onBlurCapture: p(n.onBlurCapture, C.onBlurCapture),
60
+ onPointerDownCapture: p(
61
+ n.onPointerDownCapture,
62
+ _.onPointerDownCapture
63
+ )
64
+ }
65
+ );
66
+ }
67
+ );
68
+ X.displayName = H;
69
+ var Y = "DismissableLayerBranch", q = r.forwardRef((n, e) => {
70
+ const t = r.useContext(B), o = r.useRef(null), s = T(e, o);
71
+ return r.useEffect(() => {
72
+ const a = o.current;
73
+ if (a)
74
+ return t.branches.add(a), () => {
75
+ t.branches.delete(a);
76
+ };
77
+ }, [t.branches]), /* @__PURE__ */ P(b.div, { ...n, ref: s });
78
+ });
79
+ q.displayName = Y;
80
+ function G(n, e = globalThis?.document) {
81
+ const t = m(n), o = r.useRef(!1), s = r.useRef(() => {
82
+ });
83
+ return r.useEffect(() => {
84
+ const a = (l) => {
85
+ if (l.target && !o.current) {
86
+ let E = function() {
87
+ x(
88
+ K,
89
+ t,
90
+ c,
91
+ { discrete: !0 }
92
+ );
93
+ };
94
+ const c = { originalEvent: l };
95
+ l.pointerType === "touch" ? (e.removeEventListener("click", s.current), s.current = E, e.addEventListener("click", s.current, { once: !0 })) : E();
96
+ } else
97
+ e.removeEventListener("click", s.current);
98
+ o.current = !1;
99
+ }, d = window.setTimeout(() => {
100
+ e.addEventListener("pointerdown", a);
101
+ }, 0);
102
+ return () => {
103
+ window.clearTimeout(d), e.removeEventListener("pointerdown", a), e.removeEventListener("click", s.current);
104
+ };
105
+ }, [e, t]), {
106
+ // ensures we check React component tree (not just DOM tree)
107
+ onPointerDownCapture: () => o.current = !0
108
+ };
109
+ }
110
+ function J(n, e = globalThis?.document) {
111
+ const t = m(n), o = r.useRef(!1);
112
+ return r.useEffect(() => {
113
+ const s = (a) => {
114
+ a.target && !o.current && x(j, t, { originalEvent: a }, {
115
+ discrete: !1
116
+ });
117
+ };
118
+ return e.addEventListener("focusin", s), () => e.removeEventListener("focusin", s);
119
+ }, [e, t]), {
120
+ onFocusCapture: () => o.current = !0,
121
+ onBlurCapture: () => o.current = !1
122
+ };
123
+ }
124
+ function g() {
125
+ const n = new CustomEvent(h);
126
+ document.dispatchEvent(n);
127
+ }
128
+ function x(n, e, t, { discrete: o }) {
129
+ const s = t.originalEvent.target, a = new CustomEvent(n, { bubbles: !1, cancelable: !0, detail: t });
130
+ e && s.addEventListener(n, e, { once: !0 }), o ? M(s, a) : s.dispatchEvent(a);
131
+ }
132
+ var Q = "Portal", V = r.forwardRef((n, e) => {
133
+ const { container: t, ...o } = n, [s, a] = r.useState(!1);
134
+ k(() => a(!0), []);
135
+ const d = t || s && globalThis?.document?.body;
136
+ return d ? U.createPortal(/* @__PURE__ */ P(b.div, { ...o, ref: e }), d) : null;
137
+ });
138
+ V.displayName = Q;
139
+ export {
140
+ X as D,
141
+ V as P
142
+ };
@@ -0,0 +1,31 @@
1
+ import * as i from "react";
2
+ import { P as o } from "./index-V-Ajw7Ac.js";
3
+ import { jsx as t } from "react/jsx-runtime";
4
+ var d = Object.freeze({
5
+ // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
6
+ position: "absolute",
7
+ border: 0,
8
+ width: 1,
9
+ height: 1,
10
+ padding: 0,
11
+ margin: -1,
12
+ overflow: "hidden",
13
+ clip: "rect(0, 0, 0, 0)",
14
+ whiteSpace: "nowrap",
15
+ wordWrap: "normal"
16
+ }), s = "VisuallyHidden", e = i.forwardRef(
17
+ (r, a) => /* @__PURE__ */ t(
18
+ o.span,
19
+ {
20
+ ...r,
21
+ ref: a,
22
+ style: { ...d, ...r.style }
23
+ }
24
+ )
25
+ );
26
+ e.displayName = s;
27
+ var n = e;
28
+ export {
29
+ n as R,
30
+ d as V
31
+ };
@@ -0,0 +1,13 @@
1
+ import * as o from "react";
2
+ import { b as u } from "./index-CXeb1OMI.js";
3
+ var s = o[" useId ".trim().toString()] || (() => {
4
+ }), i = 0;
5
+ function c(t) {
6
+ const [r, a] = o.useState(s());
7
+ return u(() => {
8
+ a((e) => e ?? String(i++));
9
+ }, [t]), t || (r ? `radix-${r}` : "");
10
+ }
11
+ export {
12
+ c as u
13
+ };
@@ -0,0 +1,67 @@
1
+ import * as o from "react";
2
+ import { c as b } from "./index-DLcqcWxM.js";
3
+ import { jsx as u, Fragment as g } from "react/jsx-runtime";
4
+ var E = /* @__PURE__ */ Symbol.for("react.lazy"), p = o[" use ".trim().toString()];
5
+ function _(t) {
6
+ return typeof t == "object" && t !== null && "then" in t;
7
+ }
8
+ function d(t) {
9
+ return t != null && typeof t == "object" && "$$typeof" in t && t.$$typeof === E && "_payload" in t && _(t._payload);
10
+ }
11
+ // @__NO_SIDE_EFFECTS__
12
+ function C(t) {
13
+ const r = /* @__PURE__ */ R(t), n = o.forwardRef((l, e) => {
14
+ let { children: i, ...s } = l;
15
+ d(i) && typeof p == "function" && (i = p(i._payload));
16
+ const a = o.Children.toArray(i), c = a.find(P);
17
+ if (c) {
18
+ const f = c.props.children, m = a.map((y) => y === c ? o.Children.count(f) > 1 ? o.Children.only(null) : o.isValidElement(f) ? f.props.children : null : y);
19
+ return /* @__PURE__ */ u(r, { ...s, ref: e, children: o.isValidElement(f) ? o.cloneElement(f, void 0, m) : null });
20
+ }
21
+ return /* @__PURE__ */ u(r, { ...s, ref: e, children: i });
22
+ });
23
+ return n.displayName = `${t}.Slot`, n;
24
+ }
25
+ var I = /* @__PURE__ */ C("Slot");
26
+ // @__NO_SIDE_EFFECTS__
27
+ function R(t) {
28
+ const r = o.forwardRef((n, l) => {
29
+ let { children: e, ...i } = n;
30
+ if (d(e) && typeof p == "function" && (e = p(e._payload)), o.isValidElement(e)) {
31
+ const s = j(e), a = $(i, e.props);
32
+ return e.type !== o.Fragment && (a.ref = l ? b(l, s) : s), o.cloneElement(e, a);
33
+ }
34
+ return o.Children.count(e) > 1 ? o.Children.only(null) : null;
35
+ });
36
+ return r.displayName = `${t}.SlotClone`, r;
37
+ }
38
+ var S = /* @__PURE__ */ Symbol("radix.slottable");
39
+ // @__NO_SIDE_EFFECTS__
40
+ function h(t) {
41
+ const r = ({ children: n }) => /* @__PURE__ */ u(g, { children: n });
42
+ return r.displayName = `${t}.Slottable`, r.__radixId = S, r;
43
+ }
44
+ var V = /* @__PURE__ */ h("Slottable");
45
+ function P(t) {
46
+ return o.isValidElement(t) && typeof t.type == "function" && "__radixId" in t.type && t.type.__radixId === S;
47
+ }
48
+ function $(t, r) {
49
+ const n = { ...r };
50
+ for (const l in r) {
51
+ const e = t[l], i = r[l];
52
+ /^on[A-Z]/.test(l) ? e && i ? n[l] = (...a) => {
53
+ const c = i(...a);
54
+ return e(...a), c;
55
+ } : e && (n[l] = e) : l === "style" ? n[l] = { ...e, ...i } : l === "className" && (n[l] = [e, i].filter(Boolean).join(" "));
56
+ }
57
+ return { ...t, ...n };
58
+ }
59
+ function j(t) {
60
+ let r = Object.getOwnPropertyDescriptor(t.props, "ref")?.get, n = r && "isReactWarning" in r && r.isReactWarning;
61
+ return n ? t.ref : (r = Object.getOwnPropertyDescriptor(t, "ref")?.get, n = r && "isReactWarning" in r && r.isReactWarning, n ? t.props.ref : t.props.ref || t.ref);
62
+ }
63
+ export {
64
+ I as S,
65
+ V as a,
66
+ C as c
67
+ };
@@ -0,0 +1,269 @@
1
+ import * as n from "react";
2
+ import y from "react";
3
+ import { a as G, c as h, u as q, d as z } from "./index-CXeb1OMI.js";
4
+ import { c as Z, u as O } from "./index-DLcqcWxM.js";
5
+ import { jsx as R } from "react/jsx-runtime";
6
+ import { u as J } from "./index-BC7vfx-u.js";
7
+ import { P as K } from "./index-V-Ajw7Ac.js";
8
+ // @__NO_SIDE_EFFECTS__
9
+ function L(e) {
10
+ const t = /* @__PURE__ */ Q(e), r = n.forwardRef((o, s) => {
11
+ const { children: l, ...d } = o, u = n.Children.toArray(l), g = u.find(ee);
12
+ if (g) {
13
+ const p = g.props.children, a = u.map((S) => S === g ? n.Children.count(p) > 1 ? n.Children.only(null) : n.isValidElement(p) ? p.props.children : null : S);
14
+ return /* @__PURE__ */ R(t, { ...d, ref: s, children: n.isValidElement(p) ? n.cloneElement(p, void 0, a) : null });
15
+ }
16
+ return /* @__PURE__ */ R(t, { ...d, ref: s, children: l });
17
+ });
18
+ return r.displayName = `${e}.Slot`, r;
19
+ }
20
+ // @__NO_SIDE_EFFECTS__
21
+ function Q(e) {
22
+ const t = n.forwardRef((r, o) => {
23
+ const { children: s, ...l } = r;
24
+ if (n.isValidElement(s)) {
25
+ const d = oe(s), u = te(l, s.props);
26
+ return s.type !== n.Fragment && (u.ref = o ? Z(o, d) : d), n.cloneElement(s, u);
27
+ }
28
+ return n.Children.count(s) > 1 ? n.Children.only(null) : null;
29
+ });
30
+ return t.displayName = `${e}.SlotClone`, t;
31
+ }
32
+ var X = /* @__PURE__ */ Symbol("radix.slottable");
33
+ function ee(e) {
34
+ return n.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === X;
35
+ }
36
+ function te(e, t) {
37
+ const r = { ...t };
38
+ for (const o in t) {
39
+ const s = e[o], l = t[o];
40
+ /^on[A-Z]/.test(o) ? s && l ? r[o] = (...u) => {
41
+ const g = l(...u);
42
+ return s(...u), g;
43
+ } : s && (r[o] = s) : o === "style" ? r[o] = { ...s, ...l } : o === "className" && (r[o] = [s, l].filter(Boolean).join(" "));
44
+ }
45
+ return { ...e, ...r };
46
+ }
47
+ function oe(e) {
48
+ let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning;
49
+ return r ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
50
+ }
51
+ function re(e) {
52
+ const t = e + "CollectionProvider", [r, o] = G(t), [s, l] = r(
53
+ t,
54
+ { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
55
+ ), d = (C) => {
56
+ const { scope: c, children: m } = C, v = y.useRef(null), i = y.useRef(/* @__PURE__ */ new Map()).current;
57
+ return /* @__PURE__ */ R(s, { scope: c, itemMap: i, collectionRef: v, children: m });
58
+ };
59
+ d.displayName = t;
60
+ const u = e + "CollectionSlot", g = /* @__PURE__ */ L(u), p = y.forwardRef(
61
+ (C, c) => {
62
+ const { scope: m, children: v } = C, i = l(u, m), f = O(c, i.collectionRef);
63
+ return /* @__PURE__ */ R(g, { ref: f, children: v });
64
+ }
65
+ );
66
+ p.displayName = u;
67
+ const a = e + "CollectionItemSlot", S = "data-radix-collection-item", F = /* @__PURE__ */ L(a), b = y.forwardRef(
68
+ (C, c) => {
69
+ const { scope: m, children: v, ...i } = C, f = y.useRef(null), w = O(c, f), _ = l(a, m);
70
+ return y.useEffect(() => (_.itemMap.set(f, { ref: f, ...i }), () => {
71
+ _.itemMap.delete(f);
72
+ })), /* @__PURE__ */ R(F, { [S]: "", ref: w, children: v });
73
+ }
74
+ );
75
+ b.displayName = a;
76
+ function T(C) {
77
+ const c = l(e + "CollectionConsumer", C);
78
+ return y.useCallback(() => {
79
+ const v = c.collectionRef.current;
80
+ if (!v) return [];
81
+ const i = Array.from(v.querySelectorAll(`[${S}]`));
82
+ return Array.from(c.itemMap.values()).sort(
83
+ (_, x) => i.indexOf(_.ref.current) - i.indexOf(x.ref.current)
84
+ );
85
+ }, [c.collectionRef, c.itemMap]);
86
+ }
87
+ return [
88
+ { Provider: d, Slot: p, ItemSlot: b },
89
+ T,
90
+ o
91
+ ];
92
+ }
93
+ var ne = n.createContext(void 0);
94
+ function ce(e) {
95
+ const t = n.useContext(ne);
96
+ return e || t || "ltr";
97
+ }
98
+ var P = "rovingFocusGroup.onEntryFocus", se = { bubbles: !1, cancelable: !0 }, A = "RovingFocusGroup", [D, k, ie] = re(A), [le, ye] = G(
99
+ A,
100
+ [ie]
101
+ ), [ae, ue] = le(A), V = n.forwardRef(
102
+ (e, t) => /* @__PURE__ */ R(D.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ R(D.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ R(fe, { ...e, ref: t }) }) })
103
+ );
104
+ V.displayName = A;
105
+ var fe = n.forwardRef((e, t) => {
106
+ const {
107
+ __scopeRovingFocusGroup: r,
108
+ orientation: o,
109
+ loop: s = !1,
110
+ dir: l,
111
+ currentTabStopId: d,
112
+ defaultCurrentTabStopId: u,
113
+ onCurrentTabStopIdChange: g,
114
+ onEntryFocus: p,
115
+ preventScrollOnEntryFocus: a = !1,
116
+ ...S
117
+ } = e, F = n.useRef(null), b = O(t, F), T = ce(l), [C, c] = q({
118
+ prop: d,
119
+ defaultProp: u ?? null,
120
+ onChange: g,
121
+ caller: A
122
+ }), [m, v] = n.useState(!1), i = z(p), f = k(r), w = n.useRef(!1), [_, x] = n.useState(0);
123
+ return n.useEffect(() => {
124
+ const I = F.current;
125
+ if (I)
126
+ return I.addEventListener(P, i), () => I.removeEventListener(P, i);
127
+ }, [i]), /* @__PURE__ */ R(
128
+ ae,
129
+ {
130
+ scope: r,
131
+ orientation: o,
132
+ dir: T,
133
+ loop: s,
134
+ currentTabStopId: C,
135
+ onItemFocus: n.useCallback(
136
+ (I) => c(I),
137
+ [c]
138
+ ),
139
+ onItemShiftTab: n.useCallback(() => v(!0), []),
140
+ onFocusableItemAdd: n.useCallback(
141
+ () => x((I) => I + 1),
142
+ []
143
+ ),
144
+ onFocusableItemRemove: n.useCallback(
145
+ () => x((I) => I - 1),
146
+ []
147
+ ),
148
+ children: /* @__PURE__ */ R(
149
+ K.div,
150
+ {
151
+ tabIndex: m || _ === 0 ? -1 : 0,
152
+ "data-orientation": o,
153
+ ...S,
154
+ ref: b,
155
+ style: { outline: "none", ...e.style },
156
+ onMouseDown: h(e.onMouseDown, () => {
157
+ w.current = !0;
158
+ }),
159
+ onFocus: h(e.onFocus, (I) => {
160
+ const j = !w.current;
161
+ if (I.target === I.currentTarget && j && !m) {
162
+ const M = new CustomEvent(P, se);
163
+ if (I.currentTarget.dispatchEvent(M), !M.defaultPrevented) {
164
+ const N = f().filter((E) => E.focusable), H = N.find((E) => E.active), Y = N.find((E) => E.id === C), $ = [H, Y, ...N].filter(
165
+ Boolean
166
+ ).map((E) => E.ref.current);
167
+ W($, a);
168
+ }
169
+ }
170
+ w.current = !1;
171
+ }),
172
+ onBlur: h(e.onBlur, () => v(!1))
173
+ }
174
+ )
175
+ }
176
+ );
177
+ }), U = "RovingFocusGroupItem", B = n.forwardRef(
178
+ (e, t) => {
179
+ const {
180
+ __scopeRovingFocusGroup: r,
181
+ focusable: o = !0,
182
+ active: s = !1,
183
+ tabStopId: l,
184
+ children: d,
185
+ ...u
186
+ } = e, g = J(), p = l || g, a = ue(U, r), S = a.currentTabStopId === p, F = k(r), { onFocusableItemAdd: b, onFocusableItemRemove: T, currentTabStopId: C } = a;
187
+ return n.useEffect(() => {
188
+ if (o)
189
+ return b(), () => T();
190
+ }, [o, b, T]), /* @__PURE__ */ R(
191
+ D.ItemSlot,
192
+ {
193
+ scope: r,
194
+ id: p,
195
+ focusable: o,
196
+ active: s,
197
+ children: /* @__PURE__ */ R(
198
+ K.span,
199
+ {
200
+ tabIndex: S ? 0 : -1,
201
+ "data-orientation": a.orientation,
202
+ ...u,
203
+ ref: t,
204
+ onMouseDown: h(e.onMouseDown, (c) => {
205
+ o ? a.onItemFocus(p) : c.preventDefault();
206
+ }),
207
+ onFocus: h(e.onFocus, () => a.onItemFocus(p)),
208
+ onKeyDown: h(e.onKeyDown, (c) => {
209
+ if (c.key === "Tab" && c.shiftKey) {
210
+ a.onItemShiftTab();
211
+ return;
212
+ }
213
+ if (c.target !== c.currentTarget) return;
214
+ const m = me(c, a.orientation, a.dir);
215
+ if (m !== void 0) {
216
+ if (c.metaKey || c.ctrlKey || c.altKey || c.shiftKey) return;
217
+ c.preventDefault();
218
+ let i = F().filter((f) => f.focusable).map((f) => f.ref.current);
219
+ if (m === "last") i.reverse();
220
+ else if (m === "prev" || m === "next") {
221
+ m === "prev" && i.reverse();
222
+ const f = i.indexOf(c.currentTarget);
223
+ i = a.loop ? Ie(i, f + 1) : i.slice(f + 1);
224
+ }
225
+ setTimeout(() => W(i));
226
+ }
227
+ }),
228
+ children: typeof d == "function" ? d({ isCurrentTabStop: S, hasTabStop: C != null }) : d
229
+ }
230
+ )
231
+ }
232
+ );
233
+ }
234
+ );
235
+ B.displayName = U;
236
+ var de = {
237
+ ArrowLeft: "prev",
238
+ ArrowUp: "prev",
239
+ ArrowRight: "next",
240
+ ArrowDown: "next",
241
+ PageUp: "first",
242
+ Home: "first",
243
+ PageDown: "last",
244
+ End: "last"
245
+ };
246
+ function pe(e, t) {
247
+ return t !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
248
+ }
249
+ function me(e, t, r) {
250
+ const o = pe(e.key, r);
251
+ if (!(t === "vertical" && ["ArrowLeft", "ArrowRight"].includes(o)) && !(t === "horizontal" && ["ArrowUp", "ArrowDown"].includes(o)))
252
+ return de[o];
253
+ }
254
+ function W(e, t = !1) {
255
+ const r = document.activeElement;
256
+ for (const o of e)
257
+ if (o === r || (o.focus({ preventScroll: t }), document.activeElement !== r)) return;
258
+ }
259
+ function Ie(e, t) {
260
+ return e.map((r, o) => e[(t + o) % e.length]);
261
+ }
262
+ var Fe = V, Te = B;
263
+ export {
264
+ Te as I,
265
+ Fe as R,
266
+ re as a,
267
+ ye as c,
268
+ ce as u
269
+ };