@gardenfi/garden-book 0.2.31 → 0.3.0-beta.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 (147) hide show
  1. package/dist/BulletList/BulletList.d.ts +21 -0
  2. package/dist/BulletList/index.d.ts +2 -0
  3. package/dist/BulletList/index.js +31 -0
  4. package/dist/CardList/CardList.d.ts +32 -0
  5. package/dist/CardList/index.d.ts +2 -0
  6. package/dist/CardList/index.js +141 -0
  7. package/dist/Checkbox/Checkbox.js +7 -0
  8. package/dist/Checkbox/RadixCheckbox.d.ts +3 -0
  9. package/dist/Checkbox/RadixCheckbox.js +27 -0
  10. package/dist/Checkbox/index.d.ts +1 -0
  11. package/dist/Checkbox/index.js +4 -5
  12. package/dist/DashboardLayout/DashboardLayout.d.ts +23 -0
  13. package/dist/DashboardLayout/DashboardNavbar.d.ts +11 -0
  14. package/dist/DashboardLayout/DashboardNavbar.js +32 -0
  15. package/dist/DashboardLayout/DashboardSidebar.d.ts +30 -0
  16. package/dist/DashboardLayout/DashboardSidebar.js +139 -0
  17. package/dist/DashboardLayout/MobileMenu.d.ts +11 -0
  18. package/dist/DashboardLayout/MobileMenu.js +126 -0
  19. package/dist/DashboardLayout/PageHeader.d.ts +13 -0
  20. package/dist/DashboardLayout/PageHeader.js +47 -0
  21. package/dist/DashboardLayout/index.d.ts +10 -0
  22. package/dist/DashboardLayout/index.js +93 -0
  23. package/dist/DataTable/DataTable.d.ts +50 -0
  24. package/dist/DataTable/Table.d.ts +7 -0
  25. package/dist/DataTable/Table.js +57 -0
  26. package/dist/DataTable/index.d.ts +2 -0
  27. package/dist/DataTable/index.js +269 -0
  28. package/dist/DataTable/useAnimatedTable.d.ts +8 -0
  29. package/dist/DataTable/useAnimatedTable.js +44 -0
  30. package/dist/DirectionalIconHover/DirectionalIconHover.d.ts +12 -0
  31. package/dist/DirectionalIconHover/index.d.ts +2 -0
  32. package/dist/DirectionalIconHover/index.js +72 -0
  33. package/dist/EmptyState/EmptyState.d.ts +20 -0
  34. package/dist/EmptyState/index.d.ts +2 -0
  35. package/dist/EmptyState/index.js +35 -0
  36. package/dist/ErrorState/ErrorState.d.ts +17 -0
  37. package/dist/ErrorState/errorMessages.d.ts +2 -0
  38. package/dist/ErrorState/errorMessages.js +13 -0
  39. package/dist/ErrorState/index.d.ts +2 -0
  40. package/dist/ErrorState/index.js +37 -0
  41. package/dist/Field/Field.d.ts +14 -0
  42. package/dist/Field/index.d.ts +2 -0
  43. package/dist/Field/index.js +14 -0
  44. package/dist/HamburgerIcon/HamburgerIcon.d.ts +5 -0
  45. package/dist/HamburgerIcon/index.d.ts +2 -0
  46. package/dist/HamburgerIcon/index.js +47 -0
  47. package/dist/InfoTooltip/InfoTooltip.d.ts +22 -0
  48. package/dist/InfoTooltip/index.d.ts +2 -0
  49. package/dist/InfoTooltip/index.js +81 -0
  50. package/dist/Input/Input.d.ts +19 -0
  51. package/dist/Input/index.d.ts +2 -0
  52. package/dist/Input/index.js +113 -0
  53. package/dist/Logo/index.d.ts +0 -1
  54. package/dist/Logo/index.js +8 -10
  55. package/dist/OTPInput/OTPInput.d.ts +11 -0
  56. package/dist/OTPInput/index.d.ts +2 -0
  57. package/dist/OTPInput/index.js +88 -0
  58. package/dist/Pagination/Pagination.d.ts +16 -0
  59. package/dist/Pagination/index.d.ts +2 -0
  60. package/dist/Pagination/index.js +111 -0
  61. package/dist/Portal/Portal.d.ts +8 -0
  62. package/dist/Portal/index.d.ts +2 -0
  63. package/dist/Portal/index.js +11 -0
  64. package/dist/ResponsiveModal/ResponsiveModal.d.ts +14 -0
  65. package/dist/ResponsiveModal/index.d.ts +2 -0
  66. package/dist/ResponsiveModal/index.js +62 -0
  67. package/dist/SelectDropdown/SelectDropdown.d.ts +41 -0
  68. package/dist/SelectDropdown/index.d.ts +2 -0
  69. package/dist/SelectDropdown/index.js +195 -0
  70. package/dist/Skeleton/Skeleton.d.ts +3 -0
  71. package/dist/Skeleton/index.d.ts +2 -0
  72. package/dist/Skeleton/index.js +12 -0
  73. package/dist/StatCard/StatCard.d.ts +20 -0
  74. package/dist/StatCard/index.d.ts +2 -0
  75. package/dist/StatCard/index.js +42 -0
  76. package/dist/StateContainer/StateContainer.d.ts +8 -0
  77. package/dist/StateContainer/index.d.ts +2 -0
  78. package/dist/StateContainer/index.js +15 -0
  79. package/dist/StatusChip/StatusChip.d.ts +11 -0
  80. package/dist/StatusChip/index.d.ts +2 -0
  81. package/dist/StatusChip/index.js +33 -0
  82. package/dist/Switch/Switch.d.ts +3 -0
  83. package/dist/Switch/index.d.ts +1 -0
  84. package/dist/Switch/index.js +31 -0
  85. package/dist/Toast/Toast.d.ts +15 -0
  86. package/dist/Toast/Toast.js +93 -0
  87. package/dist/Toast/Toaster.d.ts +5 -0
  88. package/dist/Toast/Toaster.js +30 -0
  89. package/dist/Toast/index.d.ts +5 -0
  90. package/dist/Toast/index.js +16 -0
  91. package/dist/Toast/useToast.d.ts +46 -0
  92. package/dist/Toast/useToast.js +76 -0
  93. package/dist/ToggleGroup/ToggleGroup.d.ts +15 -0
  94. package/dist/ToggleGroup/index.d.ts +2 -0
  95. package/dist/ToggleGroup/index.js +57 -0
  96. package/dist/Typography/Typography.d.ts +2 -2
  97. package/dist/Viewport/Viewport.d.ts +11 -0
  98. package/dist/Viewport/index.d.ts +2 -0
  99. package/dist/Viewport/index.js +7 -0
  100. package/dist/index.d.ts +24 -0
  101. package/dist/index.js +386 -314
  102. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +532 -0
  103. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +403 -0
  104. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +232 -0
  105. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +136 -0
  106. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +128 -0
  107. package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +24 -0
  108. package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +251 -0
  109. package/dist/node_modules/@radix-ui/react-collection/dist/index.js +48 -0
  110. package/dist/node_modules/@radix-ui/{react-slot → react-collection/node_modules/@radix-ui/react-slot}/dist/index.js +1 -1
  111. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +1 -1
  112. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
  113. package/dist/node_modules/@radix-ui/react-direction/dist/index.js +10 -0
  114. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +29 -26
  115. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +208 -0
  116. package/dist/node_modules/@radix-ui/react-menu/dist/index.js +624 -0
  117. package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
  118. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +221 -0
  119. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +1 -1
  120. package/dist/node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
  121. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +183 -0
  122. package/dist/node_modules/@radix-ui/react-switch/dist/index.js +132 -0
  123. package/dist/node_modules/@radix-ui/react-toast/dist/index.js +446 -0
  124. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +330 -0
  125. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.js +11 -0
  126. package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +8 -0
  127. package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +27 -0
  128. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +32 -0
  129. package/dist/node_modules/lucide-react/dist/esm/Icon.js +40 -0
  130. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +23 -0
  131. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +20 -0
  132. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-down.js +14 -0
  133. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-up-down.js +16 -0
  134. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-up.js +14 -0
  135. package/dist/node_modules/lucide-react/dist/esm/icons/check.js +11 -0
  136. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +13 -0
  137. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +11 -0
  138. package/dist/node_modules/lucide-react/dist/esm/icons/circle-alert.js +15 -0
  139. package/dist/node_modules/lucide-react/dist/esm/icons/eye-off.js +28 -0
  140. package/dist/node_modules/lucide-react/dist/esm/icons/eye.js +20 -0
  141. package/dist/node_modules/lucide-react/dist/esm/icons/log-out.js +15 -0
  142. package/dist/node_modules/lucide-react/dist/esm/icons/x.js +14 -0
  143. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +11 -0
  144. package/dist/style.css +1 -1
  145. package/package.json +12 -3
  146. package/dist/Logo/Code4renaLogo.d.ts +0 -5
  147. package/dist/Logo/Code4renaLogo.js +0 -45
@@ -0,0 +1,624 @@
1
+ import * as r from "react";
2
+ import { composeEventHandlers as v } from "../../primitive/dist/index.js";
3
+ import { createCollection as je } from "../../react-collection/dist/index.js";
4
+ import { useComposedRefs as N, composeRefs as He } from "../../react-compose-refs/dist/index.js";
5
+ import { createContextScope as We } from "../../react-context/dist/index.js";
6
+ import { useDirection as ze } from "../../react-direction/dist/index.js";
7
+ import { DismissableLayer as Ze } from "../../react-dismissable-layer/dist/index.js";
8
+ import { useFocusGuards as $e } from "../../react-focus-guards/dist/index.js";
9
+ import { FocusScope as qe } from "../../react-focus-scope/dist/index.js";
10
+ import { Root as Je, Anchor as Qe, createPopperScope as pe, Content as et, Arrow as tt } from "../../react-popper/dist/index.js";
11
+ import { Portal as nt } from "../../react-portal/dist/index.js";
12
+ import { Presence as H } from "../../react-presence/dist/index.js";
13
+ import { Primitive as F, dispatchDiscreteCustomEvent as ot } from "../../react-primitive/dist/index.js";
14
+ import { Item as rt, createRovingFocusGroupScope as ve, Root as ct } from "../../react-roving-focus/dist/index.js";
15
+ import { createSlot as at } from "../node_modules/@radix-ui/react-slot/dist/index.js";
16
+ import { useCallbackRef as Me } from "../../react-use-callback-ref/dist/index.js";
17
+ import { hideOthers as ut } from "../../../aria-hidden/dist/es2015/index.js";
18
+ import { RemoveScroll as st } from "react-remove-scroll";
19
+ import { jsx as s } from "react/jsx-runtime";
20
+ var Q = ["Enter", " "], it = ["ArrowDown", "PageUp", "Home"], he = ["ArrowUp", "PageDown", "End"], lt = [...it, ...he], dt = {
21
+ ltr: [...Q, "ArrowRight"],
22
+ rtl: [...Q, "ArrowLeft"]
23
+ }, ft = {
24
+ ltr: ["ArrowLeft"],
25
+ rtl: ["ArrowRight"]
26
+ }, L = "Menu", [D, mt, pt] = je(L), [S, tn] = We(L, [
27
+ pt,
28
+ pe,
29
+ ve
30
+ ]), W = pe(), Ce = ve(), [vt, I] = S(L), [Mt, K] = S(L), _e = (e) => {
31
+ const { __scopeMenu: n, open: t = !1, children: o, dir: u, onOpenChange: c, modal: d = !0 } = e, p = W(n), [M, m] = r.useState(null), f = r.useRef(!1), a = Me(c), l = ze(u);
32
+ return r.useEffect(() => {
33
+ const C = () => {
34
+ f.current = !0, document.addEventListener("pointerdown", h, { capture: !0, once: !0 }), document.addEventListener("pointermove", h, { capture: !0, once: !0 });
35
+ }, h = () => f.current = !1;
36
+ return document.addEventListener("keydown", C, { capture: !0 }), () => {
37
+ document.removeEventListener("keydown", C, { capture: !0 }), document.removeEventListener("pointerdown", h, { capture: !0 }), document.removeEventListener("pointermove", h, { capture: !0 });
38
+ };
39
+ }, []), /* @__PURE__ */ s(Je, { ...p, children: /* @__PURE__ */ s(
40
+ vt,
41
+ {
42
+ scope: n,
43
+ open: t,
44
+ onOpenChange: a,
45
+ content: M,
46
+ onContentChange: m,
47
+ children: /* @__PURE__ */ s(
48
+ Mt,
49
+ {
50
+ scope: n,
51
+ onClose: r.useCallback(() => a(!1), [a]),
52
+ isUsingKeyboardRef: f,
53
+ dir: l,
54
+ modal: d,
55
+ children: o
56
+ }
57
+ )
58
+ }
59
+ ) });
60
+ };
61
+ _e.displayName = L;
62
+ var ht = "MenuAnchor", ee = r.forwardRef(
63
+ (e, n) => {
64
+ const { __scopeMenu: t, ...o } = e, u = W(t);
65
+ return /* @__PURE__ */ s(Qe, { ...u, ...o, ref: n });
66
+ }
67
+ );
68
+ ee.displayName = ht;
69
+ var te = "MenuPortal", [Ct, ge] = S(te, {
70
+ forceMount: void 0
71
+ }), Re = (e) => {
72
+ const { __scopeMenu: n, forceMount: t, children: o, container: u } = e, c = I(te, n);
73
+ return /* @__PURE__ */ s(Ct, { scope: n, forceMount: t, children: /* @__PURE__ */ s(H, { present: t || c.open, children: /* @__PURE__ */ s(nt, { asChild: !0, container: u, children: o }) }) });
74
+ };
75
+ Re.displayName = te;
76
+ var g = "MenuContent", [_t, ne] = S(g), Pe = r.forwardRef(
77
+ (e, n) => {
78
+ const t = ge(g, e.__scopeMenu), { forceMount: o = t.forceMount, ...u } = e, c = I(g, e.__scopeMenu), d = K(g, e.__scopeMenu);
79
+ return /* @__PURE__ */ s(D.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ s(H, { present: o || c.open, children: /* @__PURE__ */ s(D.Slot, { scope: e.__scopeMenu, children: d.modal ? /* @__PURE__ */ s(gt, { ...u, ref: n }) : /* @__PURE__ */ s(Rt, { ...u, ref: n }) }) }) });
80
+ }
81
+ ), gt = r.forwardRef(
82
+ (e, n) => {
83
+ const t = I(g, e.__scopeMenu), o = r.useRef(null), u = N(n, o);
84
+ return r.useEffect(() => {
85
+ const c = o.current;
86
+ if (c) return ut(c);
87
+ }, []), /* @__PURE__ */ s(
88
+ oe,
89
+ {
90
+ ...e,
91
+ ref: u,
92
+ trapFocus: t.open,
93
+ disableOutsidePointerEvents: t.open,
94
+ disableOutsideScroll: !0,
95
+ onFocusOutside: v(
96
+ e.onFocusOutside,
97
+ (c) => c.preventDefault(),
98
+ { checkForDefaultPrevented: !1 }
99
+ ),
100
+ onDismiss: () => t.onOpenChange(!1)
101
+ }
102
+ );
103
+ }
104
+ ), Rt = r.forwardRef((e, n) => {
105
+ const t = I(g, e.__scopeMenu);
106
+ return /* @__PURE__ */ s(
107
+ oe,
108
+ {
109
+ ...e,
110
+ ref: n,
111
+ trapFocus: !1,
112
+ disableOutsidePointerEvents: !1,
113
+ disableOutsideScroll: !1,
114
+ onDismiss: () => t.onOpenChange(!1)
115
+ }
116
+ );
117
+ }), Pt = at("MenuContent.ScrollLock"), oe = r.forwardRef(
118
+ (e, n) => {
119
+ const {
120
+ __scopeMenu: t,
121
+ loop: o = !1,
122
+ trapFocus: u,
123
+ onOpenAutoFocus: c,
124
+ onCloseAutoFocus: d,
125
+ disableOutsidePointerEvents: p,
126
+ onEntryFocus: M,
127
+ onEscapeKeyDown: m,
128
+ onPointerDownOutside: f,
129
+ onFocusOutside: a,
130
+ onInteractOutside: l,
131
+ onDismiss: C,
132
+ disableOutsideScroll: h,
133
+ ...w
134
+ } = e, y = I(g, t), T = K(g, t), G = W(t), U = Ce(t), ue = mt(t), [Ge, se] = r.useState(null), B = r.useRef(null), Ue = N(n, B, y.onContentChange), V = r.useRef(0), Y = r.useRef(""), Be = r.useRef(0), Z = r.useRef(null), ie = r.useRef("right"), $ = r.useRef(0), Ve = h ? st : r.Fragment, Ye = h ? { as: Pt, allowPinchZoom: !0 } : void 0, Xe = (i) => {
135
+ var b, de;
136
+ const _ = Y.current + i, R = ue().filter((P) => !P.disabled), E = document.activeElement, q = (b = R.find((P) => P.ref.current === E)) == null ? void 0 : b.textValue, J = R.map((P) => P.textValue), le = kt(J, _, q), A = (de = R.find((P) => P.textValue === le)) == null ? void 0 : de.ref.current;
137
+ (function P(fe) {
138
+ Y.current = fe, window.clearTimeout(V.current), fe !== "" && (V.current = window.setTimeout(() => P(""), 1e3));
139
+ })(_), A && setTimeout(() => A.focus());
140
+ };
141
+ r.useEffect(() => () => window.clearTimeout(V.current), []), $e();
142
+ const x = r.useCallback((i) => {
143
+ var R, E;
144
+ return ie.current === ((R = Z.current) == null ? void 0 : R.side) && Ft(i, (E = Z.current) == null ? void 0 : E.area);
145
+ }, []);
146
+ return /* @__PURE__ */ s(
147
+ _t,
148
+ {
149
+ scope: t,
150
+ searchRef: Y,
151
+ onItemEnter: r.useCallback(
152
+ (i) => {
153
+ x(i) && i.preventDefault();
154
+ },
155
+ [x]
156
+ ),
157
+ onItemLeave: r.useCallback(
158
+ (i) => {
159
+ var _;
160
+ x(i) || ((_ = B.current) == null || _.focus(), se(null));
161
+ },
162
+ [x]
163
+ ),
164
+ onTriggerLeave: r.useCallback(
165
+ (i) => {
166
+ x(i) && i.preventDefault();
167
+ },
168
+ [x]
169
+ ),
170
+ pointerGraceTimerRef: Be,
171
+ onPointerGraceIntentChange: r.useCallback((i) => {
172
+ Z.current = i;
173
+ }, []),
174
+ children: /* @__PURE__ */ s(Ve, { ...Ye, children: /* @__PURE__ */ s(
175
+ qe,
176
+ {
177
+ asChild: !0,
178
+ trapped: u,
179
+ onMountAutoFocus: v(c, (i) => {
180
+ var _;
181
+ i.preventDefault(), (_ = B.current) == null || _.focus({ preventScroll: !0 });
182
+ }),
183
+ onUnmountAutoFocus: d,
184
+ children: /* @__PURE__ */ s(
185
+ Ze,
186
+ {
187
+ asChild: !0,
188
+ disableOutsidePointerEvents: p,
189
+ onEscapeKeyDown: m,
190
+ onPointerDownOutside: f,
191
+ onFocusOutside: a,
192
+ onInteractOutside: l,
193
+ onDismiss: C,
194
+ children: /* @__PURE__ */ s(
195
+ ct,
196
+ {
197
+ asChild: !0,
198
+ ...U,
199
+ dir: T.dir,
200
+ orientation: "vertical",
201
+ loop: o,
202
+ currentTabStopId: Ge,
203
+ onCurrentTabStopIdChange: se,
204
+ onEntryFocus: v(M, (i) => {
205
+ T.isUsingKeyboardRef.current || i.preventDefault();
206
+ }),
207
+ preventScrollOnEntryFocus: !0,
208
+ children: /* @__PURE__ */ s(
209
+ et,
210
+ {
211
+ role: "menu",
212
+ "aria-orientation": "vertical",
213
+ "data-state": Ke(y.open),
214
+ "data-radix-menu-content": "",
215
+ dir: T.dir,
216
+ ...G,
217
+ ...w,
218
+ ref: Ue,
219
+ style: { outline: "none", ...w.style },
220
+ onKeyDown: v(w.onKeyDown, (i) => {
221
+ const R = i.target.closest("[data-radix-menu-content]") === i.currentTarget, E = i.ctrlKey || i.altKey || i.metaKey, q = i.key.length === 1;
222
+ R && (i.key === "Tab" && i.preventDefault(), !E && q && Xe(i.key));
223
+ const J = B.current;
224
+ if (i.target !== J || !lt.includes(i.key)) return;
225
+ i.preventDefault();
226
+ const A = ue().filter((b) => !b.disabled).map((b) => b.ref.current);
227
+ he.includes(i.key) && A.reverse(), Ot(A);
228
+ }),
229
+ onBlur: v(e.onBlur, (i) => {
230
+ i.currentTarget.contains(i.target) || (window.clearTimeout(V.current), Y.current = "");
231
+ }),
232
+ onPointerMove: v(
233
+ e.onPointerMove,
234
+ k((i) => {
235
+ const _ = i.target, R = $.current !== i.clientX;
236
+ if (i.currentTarget.contains(_) && R) {
237
+ const E = i.clientX > $.current ? "right" : "left";
238
+ ie.current = E, $.current = i.clientX;
239
+ }
240
+ })
241
+ )
242
+ }
243
+ )
244
+ }
245
+ )
246
+ }
247
+ )
248
+ }
249
+ ) })
250
+ }
251
+ );
252
+ }
253
+ );
254
+ Pe.displayName = g;
255
+ var Et = "MenuGroup", re = r.forwardRef(
256
+ (e, n) => {
257
+ const { __scopeMenu: t, ...o } = e;
258
+ return /* @__PURE__ */ s(F.div, { role: "group", ...o, ref: n });
259
+ }
260
+ );
261
+ re.displayName = Et;
262
+ var wt = "MenuLabel", Ee = r.forwardRef(
263
+ (e, n) => {
264
+ const { __scopeMenu: t, ...o } = e;
265
+ return /* @__PURE__ */ s(F.div, { ...o, ref: n });
266
+ }
267
+ );
268
+ Ee.displayName = wt;
269
+ var X = "MenuItem", me = "menu.itemSelect", z = r.forwardRef(
270
+ (e, n) => {
271
+ const { disabled: t = !1, onSelect: o, ...u } = e, c = r.useRef(null), d = K(X, e.__scopeMenu), p = ne(X, e.__scopeMenu), M = N(n, c), m = r.useRef(!1), f = () => {
272
+ const a = c.current;
273
+ if (!t && a) {
274
+ const l = new CustomEvent(me, { bubbles: !0, cancelable: !0 });
275
+ a.addEventListener(me, (C) => o == null ? void 0 : o(C), { once: !0 }), ot(a, l), l.defaultPrevented ? m.current = !1 : d.onClose();
276
+ }
277
+ };
278
+ return /* @__PURE__ */ s(
279
+ we,
280
+ {
281
+ ...u,
282
+ ref: M,
283
+ disabled: t,
284
+ onClick: v(e.onClick, f),
285
+ onPointerDown: (a) => {
286
+ var l;
287
+ (l = e.onPointerDown) == null || l.call(e, a), m.current = !0;
288
+ },
289
+ onPointerUp: v(e.onPointerUp, (a) => {
290
+ var l;
291
+ m.current || (l = a.currentTarget) == null || l.click();
292
+ }),
293
+ onKeyDown: v(e.onKeyDown, (a) => {
294
+ const l = p.searchRef.current !== "";
295
+ t || l && a.key === " " || Q.includes(a.key) && (a.currentTarget.click(), a.preventDefault());
296
+ })
297
+ }
298
+ );
299
+ }
300
+ );
301
+ z.displayName = X;
302
+ var we = r.forwardRef(
303
+ (e, n) => {
304
+ const { __scopeMenu: t, disabled: o = !1, textValue: u, ...c } = e, d = ne(X, t), p = Ce(t), M = r.useRef(null), m = N(n, M), [f, a] = r.useState(!1), [l, C] = r.useState("");
305
+ return r.useEffect(() => {
306
+ const h = M.current;
307
+ h && C((h.textContent ?? "").trim());
308
+ }, [c.children]), /* @__PURE__ */ s(
309
+ D.ItemSlot,
310
+ {
311
+ scope: t,
312
+ disabled: o,
313
+ textValue: u ?? l,
314
+ children: /* @__PURE__ */ s(rt, { asChild: !0, ...p, focusable: !o, children: /* @__PURE__ */ s(
315
+ F.div,
316
+ {
317
+ role: "menuitem",
318
+ "data-highlighted": f ? "" : void 0,
319
+ "aria-disabled": o || void 0,
320
+ "data-disabled": o ? "" : void 0,
321
+ ...c,
322
+ ref: m,
323
+ onPointerMove: v(
324
+ e.onPointerMove,
325
+ k((h) => {
326
+ o ? d.onItemLeave(h) : (d.onItemEnter(h), h.defaultPrevented || h.currentTarget.focus({ preventScroll: !0 }));
327
+ })
328
+ ),
329
+ onPointerLeave: v(
330
+ e.onPointerLeave,
331
+ k((h) => d.onItemLeave(h))
332
+ ),
333
+ onFocus: v(e.onFocus, () => a(!0)),
334
+ onBlur: v(e.onBlur, () => a(!1))
335
+ }
336
+ ) })
337
+ }
338
+ );
339
+ }
340
+ ), St = "MenuCheckboxItem", Se = r.forwardRef(
341
+ (e, n) => {
342
+ const { checked: t = !1, onCheckedChange: o, ...u } = e;
343
+ return /* @__PURE__ */ s(Te, { scope: e.__scopeMenu, checked: t, children: /* @__PURE__ */ s(
344
+ z,
345
+ {
346
+ role: "menuitemcheckbox",
347
+ "aria-checked": j(t) ? "mixed" : t,
348
+ ...u,
349
+ ref: n,
350
+ "data-state": ae(t),
351
+ onSelect: v(
352
+ u.onSelect,
353
+ () => o == null ? void 0 : o(j(t) ? !0 : !t),
354
+ { checkForDefaultPrevented: !1 }
355
+ )
356
+ }
357
+ ) });
358
+ }
359
+ );
360
+ Se.displayName = St;
361
+ var Ie = "MenuRadioGroup", [It, yt] = S(
362
+ Ie,
363
+ { value: void 0, onValueChange: () => {
364
+ } }
365
+ ), ye = r.forwardRef(
366
+ (e, n) => {
367
+ const { value: t, onValueChange: o, ...u } = e, c = Me(o);
368
+ return /* @__PURE__ */ s(It, { scope: e.__scopeMenu, value: t, onValueChange: c, children: /* @__PURE__ */ s(re, { ...u, ref: n }) });
369
+ }
370
+ );
371
+ ye.displayName = Ie;
372
+ var xe = "MenuRadioItem", be = r.forwardRef(
373
+ (e, n) => {
374
+ const { value: t, ...o } = e, u = yt(xe, e.__scopeMenu), c = t === u.value;
375
+ return /* @__PURE__ */ s(Te, { scope: e.__scopeMenu, checked: c, children: /* @__PURE__ */ s(
376
+ z,
377
+ {
378
+ role: "menuitemradio",
379
+ "aria-checked": c,
380
+ ...o,
381
+ ref: n,
382
+ "data-state": ae(c),
383
+ onSelect: v(
384
+ o.onSelect,
385
+ () => {
386
+ var d;
387
+ return (d = u.onValueChange) == null ? void 0 : d.call(u, t);
388
+ },
389
+ { checkForDefaultPrevented: !1 }
390
+ )
391
+ }
392
+ ) });
393
+ }
394
+ );
395
+ be.displayName = xe;
396
+ var ce = "MenuItemIndicator", [Te, xt] = S(
397
+ ce,
398
+ { checked: !1 }
399
+ ), Ae = r.forwardRef(
400
+ (e, n) => {
401
+ const { __scopeMenu: t, forceMount: o, ...u } = e, c = xt(ce, t);
402
+ return /* @__PURE__ */ s(
403
+ H,
404
+ {
405
+ present: o || j(c.checked) || c.checked === !0,
406
+ children: /* @__PURE__ */ s(
407
+ F.span,
408
+ {
409
+ ...u,
410
+ ref: n,
411
+ "data-state": ae(c.checked)
412
+ }
413
+ )
414
+ }
415
+ );
416
+ }
417
+ );
418
+ Ae.displayName = ce;
419
+ var bt = "MenuSeparator", Oe = r.forwardRef(
420
+ (e, n) => {
421
+ const { __scopeMenu: t, ...o } = e;
422
+ return /* @__PURE__ */ s(
423
+ F.div,
424
+ {
425
+ role: "separator",
426
+ "aria-orientation": "horizontal",
427
+ ...o,
428
+ ref: n
429
+ }
430
+ );
431
+ }
432
+ );
433
+ Oe.displayName = bt;
434
+ var Tt = "MenuArrow", De = r.forwardRef(
435
+ (e, n) => {
436
+ const { __scopeMenu: t, ...o } = e, u = W(t);
437
+ return /* @__PURE__ */ s(tt, { ...u, ...o, ref: n });
438
+ }
439
+ );
440
+ De.displayName = Tt;
441
+ var At = "MenuSub", [nn, ke] = S(At), O = "MenuSubTrigger", Ne = r.forwardRef(
442
+ (e, n) => {
443
+ const t = I(O, e.__scopeMenu), o = K(O, e.__scopeMenu), u = ke(O, e.__scopeMenu), c = ne(O, e.__scopeMenu), d = r.useRef(null), { pointerGraceTimerRef: p, onPointerGraceIntentChange: M } = c, m = { __scopeMenu: e.__scopeMenu }, f = r.useCallback(() => {
444
+ d.current && window.clearTimeout(d.current), d.current = null;
445
+ }, []);
446
+ return r.useEffect(() => f, [f]), r.useEffect(() => {
447
+ const a = p.current;
448
+ return () => {
449
+ window.clearTimeout(a), M(null);
450
+ };
451
+ }, [p, M]), /* @__PURE__ */ s(ee, { asChild: !0, ...m, children: /* @__PURE__ */ s(
452
+ we,
453
+ {
454
+ id: u.triggerId,
455
+ "aria-haspopup": "menu",
456
+ "aria-expanded": t.open,
457
+ "aria-controls": u.contentId,
458
+ "data-state": Ke(t.open),
459
+ ...e,
460
+ ref: He(n, u.onTriggerChange),
461
+ onClick: (a) => {
462
+ var l;
463
+ (l = e.onClick) == null || l.call(e, a), !(e.disabled || a.defaultPrevented) && (a.currentTarget.focus(), t.open || t.onOpenChange(!0));
464
+ },
465
+ onPointerMove: v(
466
+ e.onPointerMove,
467
+ k((a) => {
468
+ c.onItemEnter(a), !a.defaultPrevented && !e.disabled && !t.open && !d.current && (c.onPointerGraceIntentChange(null), d.current = window.setTimeout(() => {
469
+ t.onOpenChange(!0), f();
470
+ }, 100));
471
+ })
472
+ ),
473
+ onPointerLeave: v(
474
+ e.onPointerLeave,
475
+ k((a) => {
476
+ var C, h;
477
+ f();
478
+ const l = (C = t.content) == null ? void 0 : C.getBoundingClientRect();
479
+ if (l) {
480
+ const w = (h = t.content) == null ? void 0 : h.dataset.side, y = w === "right", T = y ? -5 : 5, G = l[y ? "left" : "right"], U = l[y ? "right" : "left"];
481
+ c.onPointerGraceIntentChange({
482
+ area: [
483
+ // Apply a bleed on clientX to ensure that our exit point is
484
+ // consistently within polygon bounds
485
+ { x: a.clientX + T, y: a.clientY },
486
+ { x: G, y: l.top },
487
+ { x: U, y: l.top },
488
+ { x: U, y: l.bottom },
489
+ { x: G, y: l.bottom }
490
+ ],
491
+ side: w
492
+ }), window.clearTimeout(p.current), p.current = window.setTimeout(
493
+ () => c.onPointerGraceIntentChange(null),
494
+ 300
495
+ );
496
+ } else {
497
+ if (c.onTriggerLeave(a), a.defaultPrevented) return;
498
+ c.onPointerGraceIntentChange(null);
499
+ }
500
+ })
501
+ ),
502
+ onKeyDown: v(e.onKeyDown, (a) => {
503
+ var C;
504
+ const l = c.searchRef.current !== "";
505
+ e.disabled || l && a.key === " " || dt[o.dir].includes(a.key) && (t.onOpenChange(!0), (C = t.content) == null || C.focus(), a.preventDefault());
506
+ })
507
+ }
508
+ ) });
509
+ }
510
+ );
511
+ Ne.displayName = O;
512
+ var Fe = "MenuSubContent", Le = r.forwardRef(
513
+ (e, n) => {
514
+ const t = ge(g, e.__scopeMenu), { forceMount: o = t.forceMount, ...u } = e, c = I(g, e.__scopeMenu), d = K(g, e.__scopeMenu), p = ke(Fe, e.__scopeMenu), M = r.useRef(null), m = N(n, M);
515
+ return /* @__PURE__ */ s(D.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ s(H, { present: o || c.open, children: /* @__PURE__ */ s(D.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ s(
516
+ oe,
517
+ {
518
+ id: p.contentId,
519
+ "aria-labelledby": p.triggerId,
520
+ ...u,
521
+ ref: m,
522
+ align: "start",
523
+ side: d.dir === "rtl" ? "left" : "right",
524
+ disableOutsidePointerEvents: !1,
525
+ disableOutsideScroll: !1,
526
+ trapFocus: !1,
527
+ onOpenAutoFocus: (f) => {
528
+ var a;
529
+ d.isUsingKeyboardRef.current && ((a = M.current) == null || a.focus()), f.preventDefault();
530
+ },
531
+ onCloseAutoFocus: (f) => f.preventDefault(),
532
+ onFocusOutside: v(e.onFocusOutside, (f) => {
533
+ f.target !== p.trigger && c.onOpenChange(!1);
534
+ }),
535
+ onEscapeKeyDown: v(e.onEscapeKeyDown, (f) => {
536
+ d.onClose(), f.preventDefault();
537
+ }),
538
+ onKeyDown: v(e.onKeyDown, (f) => {
539
+ var C;
540
+ const a = f.currentTarget.contains(f.target), l = ft[d.dir].includes(f.key);
541
+ a && l && (c.onOpenChange(!1), (C = p.trigger) == null || C.focus(), f.preventDefault());
542
+ })
543
+ }
544
+ ) }) }) });
545
+ }
546
+ );
547
+ Le.displayName = Fe;
548
+ function Ke(e) {
549
+ return e ? "open" : "closed";
550
+ }
551
+ function j(e) {
552
+ return e === "indeterminate";
553
+ }
554
+ function ae(e) {
555
+ return j(e) ? "indeterminate" : e ? "checked" : "unchecked";
556
+ }
557
+ function Ot(e) {
558
+ const n = document.activeElement;
559
+ for (const t of e)
560
+ if (t === n || (t.focus(), document.activeElement !== n)) return;
561
+ }
562
+ function Dt(e, n) {
563
+ return e.map((t, o) => e[(n + o) % e.length]);
564
+ }
565
+ function kt(e, n, t) {
566
+ const u = n.length > 1 && Array.from(n).every((m) => m === n[0]) ? n[0] : n, c = t ? e.indexOf(t) : -1;
567
+ let d = Dt(e, Math.max(c, 0));
568
+ u.length === 1 && (d = d.filter((m) => m !== t));
569
+ const M = d.find(
570
+ (m) => m.toLowerCase().startsWith(u.toLowerCase())
571
+ );
572
+ return M !== t ? M : void 0;
573
+ }
574
+ function Nt(e, n) {
575
+ const { x: t, y: o } = e;
576
+ let u = !1;
577
+ for (let c = 0, d = n.length - 1; c < n.length; d = c++) {
578
+ const p = n[c], M = n[d], m = p.x, f = p.y, a = M.x, l = M.y;
579
+ f > o != l > o && t < (a - m) * (o - f) / (l - f) + m && (u = !u);
580
+ }
581
+ return u;
582
+ }
583
+ function Ft(e, n) {
584
+ if (!n) return !1;
585
+ const t = { x: e.clientX, y: e.clientY };
586
+ return Nt(t, n);
587
+ }
588
+ function k(e) {
589
+ return (n) => n.pointerType === "mouse" ? e(n) : void 0;
590
+ }
591
+ var on = _e, rn = ee, cn = Re, an = Pe, un = re, sn = Ee, ln = z, dn = Se, fn = ye, mn = be, pn = Ae, vn = Oe, Mn = De, hn = Ne, Cn = Le;
592
+ export {
593
+ rn as Anchor,
594
+ Mn as Arrow,
595
+ dn as CheckboxItem,
596
+ an as Content,
597
+ un as Group,
598
+ ln as Item,
599
+ pn as ItemIndicator,
600
+ sn as Label,
601
+ _e as Menu,
602
+ ee as MenuAnchor,
603
+ De as MenuArrow,
604
+ Se as MenuCheckboxItem,
605
+ Pe as MenuContent,
606
+ re as MenuGroup,
607
+ z as MenuItem,
608
+ Ae as MenuItemIndicator,
609
+ Ee as MenuLabel,
610
+ Re as MenuPortal,
611
+ ye as MenuRadioGroup,
612
+ be as MenuRadioItem,
613
+ Oe as MenuSeparator,
614
+ Le as MenuSubContent,
615
+ Ne as MenuSubTrigger,
616
+ cn as Portal,
617
+ fn as RadioGroup,
618
+ mn as RadioItem,
619
+ on as Root,
620
+ vn as Separator,
621
+ Cn as SubContent,
622
+ hn as SubTrigger,
623
+ tn as createMenuScope
624
+ };
@@ -0,0 +1,50 @@
1
+ import * as l from "react";
2
+ import { composeRefs as m } from "../../../../../react-compose-refs/dist/index.js";
3
+ import { jsx as u } from "react/jsx-runtime";
4
+ // @__NO_SIDE_EFFECTS__
5
+ function b(e) {
6
+ const n = /* @__PURE__ */ y(e), o = l.forwardRef((t, r) => {
7
+ const { children: i, ...c } = t, s = l.Children.toArray(i), a = s.find(E);
8
+ if (a) {
9
+ const f = a.props.children, d = s.map((p) => p === a ? l.Children.count(f) > 1 ? l.Children.only(null) : l.isValidElement(f) ? f.props.children : null : p);
10
+ return /* @__PURE__ */ u(n, { ...c, ref: r, children: l.isValidElement(f) ? l.cloneElement(f, void 0, d) : null });
11
+ }
12
+ return /* @__PURE__ */ u(n, { ...c, ref: r, children: i });
13
+ });
14
+ return o.displayName = `${e}.Slot`, o;
15
+ }
16
+ // @__NO_SIDE_EFFECTS__
17
+ function y(e) {
18
+ const n = l.forwardRef((o, t) => {
19
+ const { children: r, ...i } = o;
20
+ if (l.isValidElement(r)) {
21
+ const c = S(r), s = C(i, r.props);
22
+ return r.type !== l.Fragment && (s.ref = t ? m(t, c) : c), l.cloneElement(r, s);
23
+ }
24
+ return l.Children.count(r) > 1 ? l.Children.only(null) : null;
25
+ });
26
+ return n.displayName = `${e}.SlotClone`, n;
27
+ }
28
+ var g = Symbol("radix.slottable");
29
+ function E(e) {
30
+ return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === g;
31
+ }
32
+ function C(e, n) {
33
+ const o = { ...n };
34
+ for (const t in n) {
35
+ const r = e[t], i = n[t];
36
+ /^on[A-Z]/.test(t) ? r && i ? o[t] = (...s) => {
37
+ const a = i(...s);
38
+ return r(...s), a;
39
+ } : r && (o[t] = r) : t === "style" ? o[t] = { ...r, ...i } : t === "className" && (o[t] = [r, i].filter(Boolean).join(" "));
40
+ }
41
+ return { ...e, ...o };
42
+ }
43
+ function S(e) {
44
+ var t, r;
45
+ let n = (t = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : t.get, o = n && "isReactWarning" in n && n.isReactWarning;
46
+ return o ? e.ref : (n = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, o = n && "isReactWarning" in n && n.isReactWarning, o ? e.props.ref : e.props.ref || e.ref);
47
+ }
48
+ export {
49
+ b as createSlot
50
+ };