@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,446 @@
1
+ import * as n from "react";
2
+ import * as Pe from "react-dom";
3
+ import { composeEventHandlers as R } from "../../primitive/dist/index.js";
4
+ import { useComposedRefs as oe } from "../../react-compose-refs/dist/index.js";
5
+ import { createCollection as Ce } from "../../react-collection/dist/index.js";
6
+ import { createContextScope as xe } from "../../react-context/dist/index.js";
7
+ import { Branch as he, Root as Re } from "../../react-dismissable-layer/dist/index.js";
8
+ import { Portal as be } from "../../react-portal/dist/index.js";
9
+ import { Presence as ge } from "../../react-presence/dist/index.js";
10
+ import { Primitive as D, dispatchDiscreteCustomEvent as Se } from "../../react-primitive/dist/index.js";
11
+ import { useCallbackRef as U } from "../../react-use-callback-ref/dist/index.js";
12
+ import { useControllableState as Ie } from "../../react-use-controllable-state/dist/index.js";
13
+ import { useLayoutEffect as Ae } from "../../react-use-layout-effect/dist/index.js";
14
+ import { VisuallyHidden as re } from "../../react-visually-hidden/dist/index.js";
15
+ import { jsx as l, jsxs as G, Fragment as ne } from "react/jsx-runtime";
16
+ var J = "ToastProvider", [Q, Fe, _e] = Ce("Toast"), [se] = xe("Toast", [_e]), [De, X] = se(J), ae = (e) => {
17
+ const {
18
+ __scopeToast: o,
19
+ label: r = "Notification",
20
+ duration: t = 5e3,
21
+ swipeDirection: c = "right",
22
+ swipeThreshold: d = 50,
23
+ children: p
24
+ } = e, [v, T] = n.useState(null), [s, h] = n.useState(0), y = n.useRef(!1), N = n.useRef(!1);
25
+ return r.trim() || console.error(
26
+ `Invalid prop \`label\` supplied to \`${J}\`. Expected non-empty \`string\`.`
27
+ ), /* @__PURE__ */ l(Q.Provider, { scope: o, children: /* @__PURE__ */ l(
28
+ De,
29
+ {
30
+ scope: o,
31
+ label: r,
32
+ duration: t,
33
+ swipeDirection: c,
34
+ swipeThreshold: d,
35
+ toastCount: s,
36
+ viewport: v,
37
+ onViewportChange: T,
38
+ onToastAdd: n.useCallback(() => h((g) => g + 1), []),
39
+ onToastRemove: n.useCallback(() => h((g) => g - 1), []),
40
+ isFocusedToastEscapeKeyDownRef: y,
41
+ isClosePausedRef: N,
42
+ children: p
43
+ }
44
+ ) });
45
+ };
46
+ ae.displayName = J;
47
+ var ie = "ToastViewport", Ne = ["F8"], j = "toast.viewportPause", q = "toast.viewportResume", ce = n.forwardRef(
48
+ (e, o) => {
49
+ const {
50
+ __scopeToast: r,
51
+ hotkey: t = Ne,
52
+ label: c = "Notifications ({hotkey})",
53
+ ...d
54
+ } = e, p = X(ie, r), v = Fe(r), T = n.useRef(null), s = n.useRef(null), h = n.useRef(null), y = n.useRef(null), N = oe(o, y, p.onViewportChange), g = t.join("+").replace(/Key/g, "").replace(/Digit/g, ""), S = p.toastCount > 0;
55
+ n.useEffect(() => {
56
+ const i = (P) => {
57
+ var m;
58
+ t.length !== 0 && t.every((w) => P[w] || P.code === w) && ((m = y.current) == null || m.focus());
59
+ };
60
+ return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
61
+ }, [t]), n.useEffect(() => {
62
+ const i = T.current, P = y.current;
63
+ if (S && i && P) {
64
+ const f = () => {
65
+ if (!p.isClosePausedRef.current) {
66
+ const C = new CustomEvent(j);
67
+ P.dispatchEvent(C), p.isClosePausedRef.current = !0;
68
+ }
69
+ }, m = () => {
70
+ if (p.isClosePausedRef.current) {
71
+ const C = new CustomEvent(q);
72
+ P.dispatchEvent(C), p.isClosePausedRef.current = !1;
73
+ }
74
+ }, w = (C) => {
75
+ !i.contains(C.relatedTarget) && m();
76
+ }, E = () => {
77
+ i.contains(document.activeElement) || m();
78
+ };
79
+ return i.addEventListener("focusin", f), i.addEventListener("focusout", w), i.addEventListener("pointermove", f), i.addEventListener("pointerleave", E), window.addEventListener("blur", f), window.addEventListener("focus", m), () => {
80
+ i.removeEventListener("focusin", f), i.removeEventListener("focusout", w), i.removeEventListener("pointermove", f), i.removeEventListener("pointerleave", E), window.removeEventListener("blur", f), window.removeEventListener("focus", m);
81
+ };
82
+ }
83
+ }, [S, p.isClosePausedRef]);
84
+ const u = n.useCallback(
85
+ ({ tabbingDirection: i }) => {
86
+ const f = v().map((m) => {
87
+ const w = m.ref.current, E = [w, ...Be(w)];
88
+ return i === "forwards" ? E : E.reverse();
89
+ });
90
+ return (i === "forwards" ? f.reverse() : f).flat();
91
+ },
92
+ [v]
93
+ );
94
+ return n.useEffect(() => {
95
+ const i = y.current;
96
+ if (i) {
97
+ const P = (f) => {
98
+ var E, C, I;
99
+ const m = f.altKey || f.ctrlKey || f.metaKey;
100
+ if (f.key === "Tab" && !m) {
101
+ const L = document.activeElement, F = f.shiftKey;
102
+ if (f.target === i && F) {
103
+ (E = s.current) == null || E.focus();
104
+ return;
105
+ }
106
+ const A = u({ tabbingDirection: F ? "backwards" : "forwards" }), V = A.findIndex((a) => a === L);
107
+ B(A.slice(V + 1)) ? f.preventDefault() : F ? (C = s.current) == null || C.focus() : (I = h.current) == null || I.focus();
108
+ }
109
+ };
110
+ return i.addEventListener("keydown", P), () => i.removeEventListener("keydown", P);
111
+ }
112
+ }, [v, u]), /* @__PURE__ */ G(
113
+ he,
114
+ {
115
+ ref: T,
116
+ role: "region",
117
+ "aria-label": c.replace("{hotkey}", g),
118
+ tabIndex: -1,
119
+ style: { pointerEvents: S ? void 0 : "none" },
120
+ children: [
121
+ S && /* @__PURE__ */ l(
122
+ z,
123
+ {
124
+ ref: s,
125
+ onFocusFromOutsideViewport: () => {
126
+ const i = u({
127
+ tabbingDirection: "forwards"
128
+ });
129
+ B(i);
130
+ }
131
+ }
132
+ ),
133
+ /* @__PURE__ */ l(Q.Slot, { scope: r, children: /* @__PURE__ */ l(D.ol, { tabIndex: -1, ...d, ref: N }) }),
134
+ S && /* @__PURE__ */ l(
135
+ z,
136
+ {
137
+ ref: h,
138
+ onFocusFromOutsideViewport: () => {
139
+ const i = u({
140
+ tabbingDirection: "backwards"
141
+ });
142
+ B(i);
143
+ }
144
+ }
145
+ )
146
+ ]
147
+ }
148
+ );
149
+ }
150
+ );
151
+ ce.displayName = ie;
152
+ var ue = "ToastFocusProxy", z = n.forwardRef(
153
+ (e, o) => {
154
+ const { __scopeToast: r, onFocusFromOutsideViewport: t, ...c } = e, d = X(ue, r);
155
+ return /* @__PURE__ */ l(
156
+ re,
157
+ {
158
+ tabIndex: 0,
159
+ ...c,
160
+ ref: o,
161
+ style: { position: "fixed" },
162
+ onFocus: (p) => {
163
+ var s;
164
+ const v = p.relatedTarget;
165
+ !((s = d.viewport) != null && s.contains(v)) && t();
166
+ }
167
+ }
168
+ );
169
+ }
170
+ );
171
+ z.displayName = ue;
172
+ var k = "Toast", Le = "toast.swipeStart", Me = "toast.swipeMove", Oe = "toast.swipeCancel", ke = "toast.swipeEnd", le = n.forwardRef(
173
+ (e, o) => {
174
+ const { forceMount: r, open: t, defaultOpen: c, onOpenChange: d, ...p } = e, [v, T] = Ie({
175
+ prop: t,
176
+ defaultProp: c ?? !0,
177
+ onChange: d,
178
+ caller: k
179
+ });
180
+ return /* @__PURE__ */ l(ge, { present: r || v, children: /* @__PURE__ */ l(
181
+ He,
182
+ {
183
+ open: v,
184
+ ...p,
185
+ ref: o,
186
+ onClose: () => T(!1),
187
+ onPause: U(e.onPause),
188
+ onResume: U(e.onResume),
189
+ onSwipeStart: R(e.onSwipeStart, (s) => {
190
+ s.currentTarget.setAttribute("data-swipe", "start");
191
+ }),
192
+ onSwipeMove: R(e.onSwipeMove, (s) => {
193
+ const { x: h, y } = s.detail.delta;
194
+ s.currentTarget.setAttribute("data-swipe", "move"), s.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${h}px`), s.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${y}px`);
195
+ }),
196
+ onSwipeCancel: R(e.onSwipeCancel, (s) => {
197
+ s.currentTarget.setAttribute("data-swipe", "cancel"), s.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), s.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), s.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"), s.currentTarget.style.removeProperty("--radix-toast-swipe-end-y");
198
+ }),
199
+ onSwipeEnd: R(e.onSwipeEnd, (s) => {
200
+ const { x: h, y } = s.detail.delta;
201
+ s.currentTarget.setAttribute("data-swipe", "end"), s.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), s.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), s.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${h}px`), s.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${y}px`), T(!1);
202
+ })
203
+ }
204
+ ) });
205
+ }
206
+ );
207
+ le.displayName = k;
208
+ var [Ve, Ke] = se(k, {
209
+ onClose() {
210
+ }
211
+ }), He = n.forwardRef(
212
+ (e, o) => {
213
+ const {
214
+ __scopeToast: r,
215
+ type: t = "foreground",
216
+ duration: c,
217
+ open: d,
218
+ onClose: p,
219
+ onEscapeKeyDown: v,
220
+ onPause: T,
221
+ onResume: s,
222
+ onSwipeStart: h,
223
+ onSwipeMove: y,
224
+ onSwipeCancel: N,
225
+ onSwipeEnd: g,
226
+ ...S
227
+ } = e, u = X(k, r), [i, P] = n.useState(null), f = oe(o, (a) => P(a)), m = n.useRef(null), w = n.useRef(null), E = c || u.duration, C = n.useRef(0), I = n.useRef(E), L = n.useRef(0), { onToastAdd: F, onToastRemove: Y } = u, _ = U(() => {
228
+ var x;
229
+ (i == null ? void 0 : i.contains(document.activeElement)) && ((x = u.viewport) == null || x.focus()), p();
230
+ }), A = n.useCallback(
231
+ (a) => {
232
+ !a || a === 1 / 0 || (window.clearTimeout(L.current), C.current = (/* @__PURE__ */ new Date()).getTime(), L.current = window.setTimeout(_, a));
233
+ },
234
+ [_]
235
+ );
236
+ n.useEffect(() => {
237
+ const a = u.viewport;
238
+ if (a) {
239
+ const x = () => {
240
+ A(I.current), s == null || s();
241
+ }, b = () => {
242
+ const M = (/* @__PURE__ */ new Date()).getTime() - C.current;
243
+ I.current = I.current - M, window.clearTimeout(L.current), T == null || T();
244
+ };
245
+ return a.addEventListener(j, b), a.addEventListener(q, x), () => {
246
+ a.removeEventListener(j, b), a.removeEventListener(q, x);
247
+ };
248
+ }
249
+ }, [u.viewport, E, T, s, A]), n.useEffect(() => {
250
+ d && !u.isClosePausedRef.current && A(E);
251
+ }, [d, E, u.isClosePausedRef, A]), n.useEffect(() => (F(), () => Y()), [F, Y]);
252
+ const V = n.useMemo(() => i ? we(i) : null, [i]);
253
+ return u.viewport ? /* @__PURE__ */ G(ne, { children: [
254
+ V && /* @__PURE__ */ l(
255
+ We,
256
+ {
257
+ __scopeToast: r,
258
+ role: "status",
259
+ "aria-live": t === "foreground" ? "assertive" : "polite",
260
+ children: V
261
+ }
262
+ ),
263
+ /* @__PURE__ */ l(Ve, { scope: r, onClose: _, children: Pe.createPortal(
264
+ /* @__PURE__ */ l(Q.ItemSlot, { scope: r, children: /* @__PURE__ */ l(
265
+ Re,
266
+ {
267
+ asChild: !0,
268
+ onEscapeKeyDown: R(v, () => {
269
+ u.isFocusedToastEscapeKeyDownRef.current || _(), u.isFocusedToastEscapeKeyDownRef.current = !1;
270
+ }),
271
+ children: /* @__PURE__ */ l(
272
+ D.li,
273
+ {
274
+ tabIndex: 0,
275
+ "data-state": d ? "open" : "closed",
276
+ "data-swipe-direction": u.swipeDirection,
277
+ ...S,
278
+ ref: f,
279
+ style: { userSelect: "none", touchAction: "none", ...e.style },
280
+ onKeyDown: R(e.onKeyDown, (a) => {
281
+ a.key === "Escape" && (v == null || v(a.nativeEvent), a.nativeEvent.defaultPrevented || (u.isFocusedToastEscapeKeyDownRef.current = !0, _()));
282
+ }),
283
+ onPointerDown: R(e.onPointerDown, (a) => {
284
+ a.button === 0 && (m.current = { x: a.clientX, y: a.clientY });
285
+ }),
286
+ onPointerMove: R(e.onPointerMove, (a) => {
287
+ if (!m.current) return;
288
+ const x = a.clientX - m.current.x, b = a.clientY - m.current.y, M = !!w.current, O = ["left", "right"].includes(u.swipeDirection), K = ["left", "up"].includes(u.swipeDirection) ? Math.min : Math.max, Ee = O ? K(0, x) : 0, ye = O ? 0 : K(0, b), $ = a.pointerType === "touch" ? 10 : 2, H = { x: Ee, y: ye }, ee = { originalEvent: a, delta: H };
289
+ M ? (w.current = H, W(Me, y, ee, {
290
+ discrete: !1
291
+ })) : te(H, u.swipeDirection, $) ? (w.current = H, W(Le, h, ee, {
292
+ discrete: !1
293
+ }), a.target.setPointerCapture(a.pointerId)) : (Math.abs(x) > $ || Math.abs(b) > $) && (m.current = null);
294
+ }),
295
+ onPointerUp: R(e.onPointerUp, (a) => {
296
+ const x = w.current, b = a.target;
297
+ if (b.hasPointerCapture(a.pointerId) && b.releasePointerCapture(a.pointerId), w.current = null, m.current = null, x) {
298
+ const M = a.currentTarget, O = { originalEvent: a, delta: x };
299
+ te(x, u.swipeDirection, u.swipeThreshold) ? W(ke, g, O, {
300
+ discrete: !0
301
+ }) : W(
302
+ Oe,
303
+ N,
304
+ O,
305
+ {
306
+ discrete: !0
307
+ }
308
+ ), M.addEventListener("click", (K) => K.preventDefault(), {
309
+ once: !0
310
+ });
311
+ }
312
+ })
313
+ }
314
+ )
315
+ }
316
+ ) }),
317
+ u.viewport
318
+ ) })
319
+ ] }) : null;
320
+ }
321
+ ), We = (e) => {
322
+ const { __scopeToast: o, children: r, ...t } = e, c = X(k, o), [d, p] = n.useState(!1), [v, T] = n.useState(!1);
323
+ return Ye(() => p(!0)), n.useEffect(() => {
324
+ const s = window.setTimeout(() => T(!0), 1e3);
325
+ return () => window.clearTimeout(s);
326
+ }, []), v ? null : /* @__PURE__ */ l(be, { asChild: !0, children: /* @__PURE__ */ l(re, { ...t, children: d && /* @__PURE__ */ G(ne, { children: [
327
+ c.label,
328
+ " ",
329
+ r
330
+ ] }) }) });
331
+ }, Ue = "ToastTitle", de = n.forwardRef(
332
+ (e, o) => {
333
+ const { __scopeToast: r, ...t } = e;
334
+ return /* @__PURE__ */ l(D.div, { ...t, ref: o });
335
+ }
336
+ );
337
+ de.displayName = Ue;
338
+ var Xe = "ToastDescription", pe = n.forwardRef(
339
+ (e, o) => {
340
+ const { __scopeToast: r, ...t } = e;
341
+ return /* @__PURE__ */ l(D.div, { ...t, ref: o });
342
+ }
343
+ );
344
+ pe.displayName = Xe;
345
+ var fe = "ToastAction", me = n.forwardRef(
346
+ (e, o) => {
347
+ const { altText: r, ...t } = e;
348
+ return r.trim() ? /* @__PURE__ */ l(Te, { altText: r, asChild: !0, children: /* @__PURE__ */ l(Z, { ...t, ref: o }) }) : (console.error(
349
+ `Invalid prop \`altText\` supplied to \`${fe}\`. Expected non-empty \`string\`.`
350
+ ), null);
351
+ }
352
+ );
353
+ me.displayName = fe;
354
+ var ve = "ToastClose", Z = n.forwardRef(
355
+ (e, o) => {
356
+ const { __scopeToast: r, ...t } = e, c = Ke(ve, r);
357
+ return /* @__PURE__ */ l(Te, { asChild: !0, children: /* @__PURE__ */ l(
358
+ D.button,
359
+ {
360
+ type: "button",
361
+ ...t,
362
+ ref: o,
363
+ onClick: R(e.onClick, c.onClose)
364
+ }
365
+ ) });
366
+ }
367
+ );
368
+ Z.displayName = ve;
369
+ var Te = n.forwardRef((e, o) => {
370
+ const { __scopeToast: r, altText: t, ...c } = e;
371
+ return /* @__PURE__ */ l(
372
+ D.div,
373
+ {
374
+ "data-radix-toast-announce-exclude": "",
375
+ "data-radix-toast-announce-alt": t || void 0,
376
+ ...c,
377
+ ref: o
378
+ }
379
+ );
380
+ });
381
+ function we(e) {
382
+ const o = [];
383
+ return Array.from(e.childNodes).forEach((t) => {
384
+ if (t.nodeType === t.TEXT_NODE && t.textContent && o.push(t.textContent), $e(t)) {
385
+ const c = t.ariaHidden || t.hidden || t.style.display === "none", d = t.dataset.radixToastAnnounceExclude === "";
386
+ if (!c)
387
+ if (d) {
388
+ const p = t.dataset.radixToastAnnounceAlt;
389
+ p && o.push(p);
390
+ } else
391
+ o.push(...we(t));
392
+ }
393
+ }), o;
394
+ }
395
+ function W(e, o, r, { discrete: t }) {
396
+ const c = r.originalEvent.currentTarget, d = new CustomEvent(e, { bubbles: !0, cancelable: !0, detail: r });
397
+ o && c.addEventListener(e, o, { once: !0 }), t ? Se(c, d) : c.dispatchEvent(d);
398
+ }
399
+ var te = (e, o, r = 0) => {
400
+ const t = Math.abs(e.x), c = Math.abs(e.y), d = t > c;
401
+ return o === "left" || o === "right" ? d && t > r : !d && c > r;
402
+ };
403
+ function Ye(e = () => {
404
+ }) {
405
+ const o = U(e);
406
+ Ae(() => {
407
+ let r = 0, t = 0;
408
+ return r = window.requestAnimationFrame(() => t = window.requestAnimationFrame(o)), () => {
409
+ window.cancelAnimationFrame(r), window.cancelAnimationFrame(t);
410
+ };
411
+ }, [o]);
412
+ }
413
+ function $e(e) {
414
+ return e.nodeType === e.ELEMENT_NODE;
415
+ }
416
+ function Be(e) {
417
+ const o = [], r = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
418
+ acceptNode: (t) => {
419
+ const c = t.tagName === "INPUT" && t.type === "hidden";
420
+ return t.disabled || t.hidden || c ? NodeFilter.FILTER_SKIP : t.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
421
+ }
422
+ });
423
+ for (; r.nextNode(); ) o.push(r.currentNode);
424
+ return o;
425
+ }
426
+ function B(e) {
427
+ const o = document.activeElement;
428
+ return e.some((r) => r === o ? !0 : (r.focus(), document.activeElement !== o));
429
+ }
430
+ var at = ae, it = ce, ct = le, ut = de, lt = pe, dt = me, pt = Z;
431
+ export {
432
+ dt as Action,
433
+ pt as Close,
434
+ lt as Description,
435
+ at as Provider,
436
+ ct as Root,
437
+ ut as Title,
438
+ le as Toast,
439
+ me as ToastAction,
440
+ Z as ToastClose,
441
+ pe as ToastDescription,
442
+ ae as ToastProvider,
443
+ de as ToastTitle,
444
+ ce as ToastViewport,
445
+ it as Viewport
446
+ };