@konstructio/ui 0.1.0-alpha.9 → 0.1.1-alpha.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 (167) hide show
  1. package/dist/DatePicker.css +1 -1
  2. package/dist/{Modal-CrG0m703.js → Modal-0oht63vU.js} +32 -32
  3. package/dist/assets/icons/components/Search.js +26 -0
  4. package/dist/assets/icons/components/Warning.js +22 -0
  5. package/dist/assets/icons/components/index.js +6 -0
  6. package/dist/{chevron-down-UW8ts6wI.js → chevron-down-CVce9Mvh.js} +2 -2
  7. package/dist/components/Alert/Alert.js +23 -25
  8. package/dist/components/Alert/Alert.variants.js +1 -1
  9. package/dist/components/AlertDialog/AlertDialog.js +1 -1
  10. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  11. package/dist/components/AlertDialog/components/index.js +1 -1
  12. package/dist/components/AlertDialog/hooks/useAlertDialog.js +7 -7
  13. package/dist/components/Autocomplete/Autocomplete.variants.js +3 -4
  14. package/dist/components/Autocomplete/components/List/List.variants.js +3 -7
  15. package/dist/components/Autocomplete/hooks/useAutocomplete.js +38 -43
  16. package/dist/components/Autocomplete/hooks/useNavigationList.js +29 -37
  17. package/dist/components/Badge/Badge.js +40 -42
  18. package/dist/components/Badge/Badge.variants.js +1 -1
  19. package/dist/components/Breadcrumb/Breadcrumb.variants.js +1 -1
  20. package/dist/components/Breadcrumb/components/Item/Item.js +22 -21
  21. package/dist/components/Breadcrumb/components/Item/Item.variants.js +1 -1
  22. package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
  23. package/dist/components/Button/Button.js +15 -15
  24. package/dist/components/Button/Button.variants.js +10 -77
  25. package/dist/components/Card/Card.variants.js +3 -5
  26. package/dist/components/Checkbox/Checkbox.js +48 -47
  27. package/dist/components/Checkbox/Checkbox.variants.js +3 -4
  28. package/dist/components/Command/Command.js +2 -2
  29. package/dist/components/Command/Command.variants.js +1 -1
  30. package/dist/components/Command/components/Command.js +1 -1
  31. package/dist/components/Command/components/CommandEmpty.js +1 -1
  32. package/dist/components/Command/components/CommandGroup.js +1 -1
  33. package/dist/components/Command/components/CommandInput.js +1 -1
  34. package/dist/components/Command/components/CommandItem.js +13 -13
  35. package/dist/components/Command/components/CommandList.js +1 -1
  36. package/dist/components/Command/components/CommandSeparator.js +1 -1
  37. package/dist/components/Command/components/DialogContent.js +1 -1
  38. package/dist/components/Command/components/DialogOverlay.js +1 -1
  39. package/dist/components/Datepicker/DatePicker.js +1496 -1577
  40. package/dist/components/Datepicker/DatePicker.variants.js +1 -1
  41. package/dist/components/Divider/Divider.variants.js +1 -1
  42. package/dist/components/Dropdown/Dropdown.js +28 -6
  43. package/dist/components/Dropdown/Dropdown.variants.js +43 -26
  44. package/dist/components/Dropdown/components/List/List.variants.js +1 -1
  45. package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +5 -5
  46. package/dist/components/Dropdown/components/Wrapper.js +96 -86
  47. package/dist/components/Dropdown/contexts/dropdown.provider.js +12 -12
  48. package/dist/components/Dropdown/hooks/useDropdown.js +26 -30
  49. package/dist/components/Dropdown/hooks/useNavigationList.js +25 -31
  50. package/dist/components/DropdownButton/DropdownButton.js +135 -0
  51. package/dist/components/Filter/Filter.variants.js +1 -1
  52. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +47 -49
  53. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
  54. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +41 -42
  55. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +30 -30
  56. package/dist/components/Filter/components/ResetButton/ResetButton.js +22 -16
  57. package/dist/components/Input/Input.js +116 -109
  58. package/dist/components/Input/Input.variants.js +18 -5
  59. package/dist/components/Loading/Loading.js +2 -2
  60. package/dist/components/Loading/Loading.variants.js +1 -2
  61. package/dist/components/Modal/Modal.js +2 -2
  62. package/dist/components/Modal/components/Body/Body.js +1 -1
  63. package/dist/components/Modal/components/Footer/Footer.js +1 -1
  64. package/dist/components/Modal/components/Header/Header.js +1 -1
  65. package/dist/components/Modal/components/Wrapper/Wrapper.js +2 -2
  66. package/dist/components/Modal/components/Wrapper/Wrapper.variants.js +7 -9
  67. package/dist/components/Modal/components/index.js +1 -1
  68. package/dist/components/Modal/hooks/useModal.js +16 -17
  69. package/dist/components/NumberInput/NumberInput.js +91 -91
  70. package/dist/components/NumberInput/NumberInput.variants.js +1 -1
  71. package/dist/components/PieChart/PieChart.js +5138 -0
  72. package/dist/components/ProgressBar/ProgressBar.js +58 -26
  73. package/dist/components/ProgressBar/ProgressBar.variants.js +1 -1
  74. package/dist/components/Radio/Radio.js +64 -48
  75. package/dist/components/Radio/Radio.variants.js +3 -3
  76. package/dist/components/RadioCard/RadioCard.js +26 -23
  77. package/dist/components/RadioCard/RadioCard.variants.js +1 -1
  78. package/dist/components/RadioCardGroup/RadioCardGroup.js +28 -28
  79. package/dist/components/RadioCardGroup/RadioCardGroup.variants.js +1 -1
  80. package/dist/components/RadioGroup/RadioGroup.js +37 -37
  81. package/dist/components/RadioGroup/RadioGroup.variants.js +1 -1
  82. package/dist/components/Range/Range.js +1 -1
  83. package/dist/components/Range/Range.variants.js +2 -3
  84. package/dist/components/Sidebar/Sidebar.js +4 -3
  85. package/dist/components/Sidebar/Sidebar.variants.js +1 -1
  86. package/dist/components/Sidebar/components/Footer/Footer.js +5 -4
  87. package/dist/components/Sidebar/components/Footer/Footer.variants.js +1 -1
  88. package/dist/components/Sidebar/components/Logo/Logo.js +6 -5
  89. package/dist/components/Sidebar/components/Logo/Logo.variants.js +1 -1
  90. package/dist/components/Sidebar/components/Navigation/Navigation.js +5 -4
  91. package/dist/components/Sidebar/components/Navigation/Navigation.variants.js +1 -1
  92. package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.js +14 -13
  93. package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.variants.js +1 -1
  94. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +13 -12
  95. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +1 -1
  96. package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.js +5 -6
  97. package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.variants.js +1 -1
  98. package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.js +9 -8
  99. package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.variants.js +1 -1
  100. package/dist/components/Sidebar/components/Wrapper/Wrapper.js +15 -14
  101. package/dist/components/Slider/Slider.js +1 -1
  102. package/dist/components/Slider/Slider.variants.js +2 -8
  103. package/dist/components/Switch/Switch.js +54 -54
  104. package/dist/components/Switch/Switch.variants.js +2 -3
  105. package/dist/components/Table/Table.variants.js +1 -1
  106. package/dist/components/Tabs/Tabs.js +20 -16
  107. package/dist/components/Tabs/Tabs.variants.js +3 -5
  108. package/dist/components/Tabs/components/Content.js +10 -13
  109. package/dist/components/Tabs/components/List.js +9 -8
  110. package/dist/components/Tabs/components/Trigger.js +12 -16
  111. package/dist/components/Tabs/components/index.js +8 -0
  112. package/dist/components/Tag/Tag.js +1 -1
  113. package/dist/components/Tag/Tag.variants.js +1 -1
  114. package/dist/components/TagSelect/TagSelect.variants.js +1 -1
  115. package/dist/components/TagSelect/components/Item/Item.variants.js +1 -1
  116. package/dist/components/TagSelect/components/List/List.variants.js +1 -1
  117. package/dist/components/TagSelect/hooks/useTagSelect.js +14 -16
  118. package/dist/components/TextArea/TextArea.variants.js +4 -5
  119. package/dist/components/TimePicker/TimePicker.variants.js +6 -7
  120. package/dist/components/TimePicker/components/HoursList/HoursList.js +21 -26
  121. package/dist/components/TimePicker/components/MeridianList/MeridianList.js +19 -20
  122. package/dist/components/TimePicker/components/MinutesList/MinutesList.js +24 -25
  123. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +33 -34
  124. package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +1 -1
  125. package/dist/components/Toast/Toast.js +223 -232
  126. package/dist/components/Toast/Toast.variants.js +8 -11
  127. package/dist/components/Tooltip/Tooltip.js +1 -1
  128. package/dist/components/Tooltip/Tooltip.variants.js +7 -14
  129. package/dist/components/Tooltip/hooks/useTooltip.js +8 -9
  130. package/dist/components/Typography/Typography.js +26 -31
  131. package/dist/components/Typography/Typography.variants.js +1 -1
  132. package/dist/components/index.js +78 -66
  133. package/dist/contexts/theme.provider.js +28 -29
  134. package/dist/{createLucideIcon-ByJ0JZvK.js → createLucideIcon-BpsAkT97.js} +4 -4
  135. package/dist/index-0ioNhtNM.js +10 -0
  136. package/dist/{index-CvfCCTEO.js → index-BAraV3ai.js} +7 -7
  137. package/dist/index-BXuxPoz7.js +435 -0
  138. package/dist/index-BfXxHr_2.js +125 -0
  139. package/dist/index-C1g_chDT.js +70 -0
  140. package/dist/{index-BCGvACM9.js → index-C9T9HQaa.js} +1 -1
  141. package/dist/{index-Bc1LNrRD.js → index-CZnD2QxM.js} +1 -1
  142. package/dist/index-CrBonFvu.js +144 -0
  143. package/dist/{index-rUBNhTeF.js → index-Cvx4lqTq.js} +2 -2
  144. package/dist/{index-BNmRGtA6.js → index-D29mdTf5.js} +3 -3
  145. package/dist/{index-Dkt8F6CZ.js → index-D3xzCzcO.js} +12 -12
  146. package/dist/index-DB2XhXHn.js +431 -0
  147. package/dist/{index-B5MIi2tR.js → index-DQH6odE9.js} +2 -3
  148. package/dist/index-Oq5GlCHP.js +131 -0
  149. package/dist/{index-Cs8Lv8Wj.js → index-bwWKd82e.js} +1 -1
  150. package/dist/{index--EmNlyHx.js → index-iXyXtdgP.js} +1 -1
  151. package/dist/index.d.ts +157 -9
  152. package/dist/index.js +88 -76
  153. package/dist/package.json +41 -37
  154. package/dist/styles.css +1 -1
  155. package/dist/ui/civo-theme.css +261 -241
  156. package/dist/ui/kubefirst-theme.css +4 -4
  157. package/dist/ui/theme.css +0 -2
  158. package/dist/{useBreadcrumb-DMERrNkJ.js → useBreadcrumb-B8DnuqkR.js} +254 -261
  159. package/dist/utils/index.js +25 -26
  160. package/package.json +41 -37
  161. package/dist/index-BNU3RH-3.js +0 -133
  162. package/dist/index-BvCZBMfr.js +0 -432
  163. package/dist/index-Cq1I1cG9.js +0 -129
  164. package/dist/index-DLYwlPRZ.js +0 -440
  165. package/dist/index-DNRcvRTB.js +0 -145
  166. package/dist/index-Dm-ooN_M.js +0 -71
  167. package/dist/index-DwYXX2sM.js +0 -13
@@ -1,144 +1,142 @@
1
- import { jsx as c, jsxs as D, Fragment as se } from "react/jsx-runtime";
2
- import { u as ae, S as j } from "../../index-B5MIi2tR.js";
3
- import * as s from "react";
4
- import { useRef as Re, useEffect as be, useMemo as oe, isValidElement as re, useCallback as ge } from "react";
5
- import { P as L, r as Se, d as Ie } from "../../index-BCGvACM9.js";
6
- import { c as Ne, a as Ae, b, u as Fe } from "../../index-Cq1I1cG9.js";
7
- import { c as _e } from "../../index-rUBNhTeF.js";
8
- import { B as De, R as Le, P as Me } from "../../index-DNRcvRTB.js";
9
- import { P as Oe } from "../../index-Dm-ooN_M.js";
10
- import { u as $ } from "../../index-DwYXX2sM.js";
11
- import { V as ie, R as ke } from "../../index--EmNlyHx.js";
12
- import { cn as q } from "../../utils/index.js";
1
+ import { jsx as i, jsxs as A, Fragment as se } from "react/jsx-runtime";
2
+ import { u as ae, S as B } from "../../index-DQH6odE9.js";
3
+ import * as n from "react";
4
+ import { useRef as xe, useEffect as be, useMemo as oe, isValidElement as re, useCallback as ge } from "react";
5
+ import { P as D, r as Se, d as Ie } from "../../index-C9T9HQaa.js";
6
+ import { c as Ne, a as Ae, b as x, u as De } from "../../index-BfXxHr_2.js";
7
+ import { c as Fe } from "../../index-Cvx4lqTq.js";
8
+ import { B as _e, R as Le, P as Me } from "../../index-CrBonFvu.js";
9
+ import { P as Oe } from "../../index-C1g_chDT.js";
10
+ import { u as $ } from "../../index-0ioNhtNM.js";
11
+ import { V as ie, R as ke } from "../../index-iXyXtdgP.js";
12
+ import { cn as j } from "../../utils/index.js";
13
13
  import { closeToastVariants as Ve, toastVariants as Ke, viewportToastVariants as He } from "./Toast.variants.js";
14
14
  import { X as We } from "../../x-BPcqkRZd.js";
15
- var Z = "ToastProvider", [ee, Xe, $e] = _e("Toast"), [ce, Rt] = Ne("Toast", [$e]), [Ue, U] = ce(Z), ue = (e) => {
15
+ var Q = "ToastProvider", [Z, Xe, $e] = Fe("Toast"), [ce, xt] = Ne("Toast", [$e]), [Ue, U] = ce(Q), ue = (e) => {
16
16
  const {
17
17
  __scopeToast: r,
18
18
  label: o = "Notification",
19
19
  duration: t = 5e3,
20
- swipeDirection: u = "right",
20
+ swipeDirection: c = "right",
21
21
  swipeThreshold: d = 50,
22
- children: f
23
- } = e, [m, v] = s.useState(null), [n, h] = s.useState(0), w = s.useRef(!1), S = s.useRef(!1);
22
+ children: p
23
+ } = e, [T, v] = n.useState(null), [a, E] = n.useState(0), w = n.useRef(!1), S = n.useRef(!1);
24
24
  return o.trim() || console.error(
25
- `Invalid prop \`label\` supplied to \`${Z}\`. Expected non-empty \`string\`.`
26
- ), /* @__PURE__ */ c(ee.Provider, { scope: r, children: /* @__PURE__ */ c(
25
+ `Invalid prop \`label\` supplied to \`${Q}\`. Expected non-empty \`string\`.`
26
+ ), /* @__PURE__ */ i(Z.Provider, { scope: r, children: /* @__PURE__ */ i(
27
27
  Ue,
28
28
  {
29
29
  scope: r,
30
30
  label: o,
31
31
  duration: t,
32
- swipeDirection: u,
32
+ swipeDirection: c,
33
33
  swipeThreshold: d,
34
- toastCount: n,
35
- viewport: m,
34
+ toastCount: a,
35
+ viewport: T,
36
36
  onViewportChange: v,
37
- onToastAdd: s.useCallback(() => h((g) => g + 1), []),
38
- onToastRemove: s.useCallback(() => h((g) => g - 1), []),
37
+ onToastAdd: n.useCallback(() => E((b) => b + 1), []),
38
+ onToastRemove: n.useCallback(() => E((b) => b - 1), []),
39
39
  isFocusedToastEscapeKeyDownRef: w,
40
40
  isClosePausedRef: S,
41
- children: f
41
+ children: p
42
42
  }
43
43
  ) });
44
44
  };
45
- ue.displayName = Z;
46
- var le = "ToastViewport", Ye = ["F8"], G = "toast.viewportPause", J = "toast.viewportResume", de = s.forwardRef(
45
+ ue.displayName = Q;
46
+ var le = "ToastViewport", Ye = ["F8"], z = "toast.viewportPause", G = "toast.viewportResume", de = n.forwardRef(
47
47
  (e, r) => {
48
48
  const {
49
49
  __scopeToast: o,
50
50
  hotkey: t = Ye,
51
- label: u = "Notifications ({hotkey})",
51
+ label: c = "Notifications ({hotkey})",
52
52
  ...d
53
- } = e, f = U(le, o), m = Xe(o), v = s.useRef(null), n = s.useRef(null), h = s.useRef(null), w = s.useRef(null), S = ae(r, w, f.onViewportChange), g = t.join("+").replace(/Key/g, "").replace(/Digit/g, ""), R = f.toastCount > 0;
54
- s.useEffect(() => {
55
- const i = (C) => {
56
- var T;
57
- t.length !== 0 && t.every((E) => C[E] || C.code === E) && ((T = w.current) == null || T.focus());
53
+ } = e, p = U(le, o), T = Xe(o), v = n.useRef(null), a = n.useRef(null), E = n.useRef(null), w = n.useRef(null), S = ae(r, w, p.onViewportChange), b = t.join("+").replace(/Key/g, "").replace(/Digit/g, ""), R = p.toastCount > 0;
54
+ n.useEffect(() => {
55
+ const u = (h) => {
56
+ t.length !== 0 && t.every((m) => h[m] || h.code === m) && w.current?.focus();
58
57
  };
59
- return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
60
- }, [t]), s.useEffect(() => {
61
- const i = v.current, C = w.current;
62
- if (R && i && C) {
63
- const p = () => {
64
- if (!f.isClosePausedRef.current) {
65
- const P = new CustomEvent(G);
66
- C.dispatchEvent(P), f.isClosePausedRef.current = !0;
58
+ return document.addEventListener("keydown", u), () => document.removeEventListener("keydown", u);
59
+ }, [t]), n.useEffect(() => {
60
+ const u = v.current, h = w.current;
61
+ if (R && u && h) {
62
+ const f = () => {
63
+ if (!p.isClosePausedRef.current) {
64
+ const y = new CustomEvent(z);
65
+ h.dispatchEvent(y), p.isClosePausedRef.current = !0;
67
66
  }
68
- }, T = () => {
69
- if (f.isClosePausedRef.current) {
70
- const P = new CustomEvent(J);
71
- C.dispatchEvent(P), f.isClosePausedRef.current = !1;
67
+ }, m = () => {
68
+ if (p.isClosePausedRef.current) {
69
+ const y = new CustomEvent(G);
70
+ h.dispatchEvent(y), p.isClosePausedRef.current = !1;
72
71
  }
73
- }, E = (P) => {
74
- !i.contains(P.relatedTarget) && T();
75
- }, y = () => {
76
- i.contains(document.activeElement) || T();
72
+ }, P = (y) => {
73
+ !u.contains(y.relatedTarget) && m();
74
+ }, C = () => {
75
+ u.contains(document.activeElement) || m();
77
76
  };
78
- return i.addEventListener("focusin", p), i.addEventListener("focusout", E), i.addEventListener("pointermove", p), i.addEventListener("pointerleave", y), window.addEventListener("blur", p), window.addEventListener("focus", T), () => {
79
- i.removeEventListener("focusin", p), i.removeEventListener("focusout", E), i.removeEventListener("pointermove", p), i.removeEventListener("pointerleave", y), window.removeEventListener("blur", p), window.removeEventListener("focus", T);
77
+ return u.addEventListener("focusin", f), u.addEventListener("focusout", P), u.addEventListener("pointermove", f), u.addEventListener("pointerleave", C), window.addEventListener("blur", f), window.addEventListener("focus", m), () => {
78
+ u.removeEventListener("focusin", f), u.removeEventListener("focusout", P), u.removeEventListener("pointermove", f), u.removeEventListener("pointerleave", C), window.removeEventListener("blur", f), window.removeEventListener("focus", m);
80
79
  };
81
80
  }
82
- }, [R, f.isClosePausedRef]);
83
- const l = s.useCallback(
84
- ({ tabbingDirection: i }) => {
85
- const p = m().map((T) => {
86
- const E = T.ref.current, y = [E, ...nt(E)];
87
- return i === "forwards" ? y : y.reverse();
81
+ }, [R, p.isClosePausedRef]);
82
+ const l = n.useCallback(
83
+ ({ tabbingDirection: u }) => {
84
+ const f = T().map((m) => {
85
+ const P = m.ref.current, C = [P, ...nt(P)];
86
+ return u === "forwards" ? C : C.reverse();
88
87
  });
89
- return (i === "forwards" ? p.reverse() : p).flat();
88
+ return (u === "forwards" ? f.reverse() : f).flat();
90
89
  },
91
- [m]
90
+ [T]
92
91
  );
93
- return s.useEffect(() => {
94
- const i = w.current;
95
- if (i) {
96
- const C = (p) => {
97
- var y, P, N;
98
- const T = p.altKey || p.ctrlKey || p.metaKey;
99
- if (p.key === "Tab" && !T) {
100
- const M = document.activeElement, F = p.shiftKey;
101
- if (p.target === i && F) {
102
- (y = n.current) == null || y.focus();
92
+ return n.useEffect(() => {
93
+ const u = w.current;
94
+ if (u) {
95
+ const h = (f) => {
96
+ const m = f.altKey || f.ctrlKey || f.metaKey;
97
+ if (f.key === "Tab" && !m) {
98
+ const C = document.activeElement, y = f.shiftKey;
99
+ if (f.target === u && y) {
100
+ a.current?.focus();
103
101
  return;
104
102
  }
105
- const A = l({ tabbingDirection: F ? "backwards" : "forwards" }), K = A.findIndex((a) => a === M);
106
- z(A.slice(K + 1)) ? p.preventDefault() : F ? (P = n.current) == null || P.focus() : (N = h.current) == null || N.focus();
103
+ const _ = l({ tabbingDirection: y ? "backwards" : "forwards" }), V = _.findIndex((N) => N === C);
104
+ q(_.slice(V + 1)) ? f.preventDefault() : y ? a.current?.focus() : E.current?.focus();
107
105
  }
108
106
  };
109
- return i.addEventListener("keydown", C), () => i.removeEventListener("keydown", C);
107
+ return u.addEventListener("keydown", h), () => u.removeEventListener("keydown", h);
110
108
  }
111
- }, [m, l]), /* @__PURE__ */ D(
112
- De,
109
+ }, [T, l]), /* @__PURE__ */ A(
110
+ _e,
113
111
  {
114
112
  ref: v,
115
113
  role: "region",
116
- "aria-label": u.replace("{hotkey}", g),
114
+ "aria-label": c.replace("{hotkey}", b),
117
115
  tabIndex: -1,
118
116
  style: { pointerEvents: R ? void 0 : "none" },
119
117
  children: [
120
- R && /* @__PURE__ */ c(
121
- Q,
118
+ R && /* @__PURE__ */ i(
119
+ J,
122
120
  {
123
- ref: n,
121
+ ref: a,
124
122
  onFocusFromOutsideViewport: () => {
125
- const i = l({
123
+ const u = l({
126
124
  tabbingDirection: "forwards"
127
125
  });
128
- z(i);
126
+ q(u);
129
127
  }
130
128
  }
131
129
  ),
132
- /* @__PURE__ */ c(ee.Slot, { scope: o, children: /* @__PURE__ */ c(L.ol, { tabIndex: -1, ...d, ref: S }) }),
133
- R && /* @__PURE__ */ c(
134
- Q,
130
+ /* @__PURE__ */ i(Z.Slot, { scope: o, children: /* @__PURE__ */ i(D.ol, { tabIndex: -1, ...d, ref: S }) }),
131
+ R && /* @__PURE__ */ i(
132
+ J,
135
133
  {
136
- ref: h,
134
+ ref: E,
137
135
  onFocusFromOutsideViewport: () => {
138
- const i = l({
136
+ const u = l({
139
137
  tabbingDirection: "backwards"
140
138
  });
141
- z(i);
139
+ q(u);
142
140
  }
143
141
  }
144
142
  )
@@ -148,168 +146,161 @@ var le = "ToastViewport", Ye = ["F8"], G = "toast.viewportPause", J = "toast.vie
148
146
  }
149
147
  );
150
148
  de.displayName = le;
151
- var fe = "ToastFocusProxy", Q = s.forwardRef(
149
+ var pe = "ToastFocusProxy", J = n.forwardRef(
152
150
  (e, r) => {
153
- const { __scopeToast: o, onFocusFromOutsideViewport: t, ...u } = e, d = U(fe, o);
154
- return /* @__PURE__ */ c(
151
+ const { __scopeToast: o, onFocusFromOutsideViewport: t, ...c } = e, d = U(pe, o);
152
+ return /* @__PURE__ */ i(
155
153
  ie,
156
154
  {
157
- "aria-hidden": !0,
158
155
  tabIndex: 0,
159
- ...u,
156
+ ...c,
160
157
  ref: r,
161
158
  style: { position: "fixed" },
162
- onFocus: (f) => {
163
- var n;
164
- const m = f.relatedTarget;
165
- !((n = d.viewport) != null && n.contains(m)) && t();
159
+ onFocus: (p) => {
160
+ const T = p.relatedTarget;
161
+ !d.viewport?.contains(T) && t();
166
162
  }
167
163
  }
168
164
  );
169
165
  }
170
166
  );
171
- Q.displayName = fe;
172
- var V = "Toast", Be = "toast.swipeStart", je = "toast.swipeMove", qe = "toast.swipeCancel", ze = "toast.swipeEnd", pe = s.forwardRef(
167
+ J.displayName = pe;
168
+ var O = "Toast", Be = "toast.swipeStart", je = "toast.swipeMove", qe = "toast.swipeCancel", ze = "toast.swipeEnd", fe = n.forwardRef(
173
169
  (e, r) => {
174
- const { forceMount: o, open: t, defaultOpen: u, onOpenChange: d, ...f } = e, [m, v] = Ae({
170
+ const { forceMount: o, open: t, defaultOpen: c, onOpenChange: d, ...p } = e, [T, v] = Ae({
175
171
  prop: t,
176
- defaultProp: u ?? !0,
172
+ defaultProp: c ?? !0,
177
173
  onChange: d,
178
- caller: V
174
+ caller: O
179
175
  });
180
- return /* @__PURE__ */ c(Oe, { present: o || m, children: /* @__PURE__ */ c(
176
+ return /* @__PURE__ */ i(Oe, { present: o || T, children: /* @__PURE__ */ i(
181
177
  Qe,
182
178
  {
183
- open: m,
184
- ...f,
179
+ open: T,
180
+ ...p,
185
181
  ref: r,
186
182
  onClose: () => v(!1),
187
183
  onPause: $(e.onPause),
188
184
  onResume: $(e.onResume),
189
- onSwipeStart: b(e.onSwipeStart, (n) => {
190
- n.currentTarget.setAttribute("data-swipe", "start");
185
+ onSwipeStart: x(e.onSwipeStart, (a) => {
186
+ a.currentTarget.setAttribute("data-swipe", "start");
191
187
  }),
192
- onSwipeMove: b(e.onSwipeMove, (n) => {
193
- const { x: h, y: w } = n.detail.delta;
194
- n.currentTarget.setAttribute("data-swipe", "move"), n.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${h}px`), n.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${w}px`);
188
+ onSwipeMove: x(e.onSwipeMove, (a) => {
189
+ const { x: E, y: w } = a.detail.delta;
190
+ a.currentTarget.setAttribute("data-swipe", "move"), a.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${E}px`), a.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${w}px`);
195
191
  }),
196
- onSwipeCancel: b(e.onSwipeCancel, (n) => {
197
- n.currentTarget.setAttribute("data-swipe", "cancel"), n.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), n.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), n.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"), n.currentTarget.style.removeProperty("--radix-toast-swipe-end-y");
192
+ onSwipeCancel: x(e.onSwipeCancel, (a) => {
193
+ a.currentTarget.setAttribute("data-swipe", "cancel"), a.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), a.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), a.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"), a.currentTarget.style.removeProperty("--radix-toast-swipe-end-y");
198
194
  }),
199
- onSwipeEnd: b(e.onSwipeEnd, (n) => {
200
- const { x: h, y: w } = n.detail.delta;
201
- n.currentTarget.setAttribute("data-swipe", "end"), n.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), n.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), n.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${h}px`), n.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${w}px`), v(!1);
195
+ onSwipeEnd: x(e.onSwipeEnd, (a) => {
196
+ const { x: E, y: w } = a.detail.delta;
197
+ a.currentTarget.setAttribute("data-swipe", "end"), a.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), a.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), a.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${E}px`), a.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${w}px`), v(!1);
202
198
  })
203
199
  }
204
200
  ) });
205
201
  }
206
202
  );
207
- pe.displayName = V;
208
- var [Ge, Je] = ce(V, {
203
+ fe.displayName = O;
204
+ var [Ge, Je] = ce(O, {
209
205
  onClose() {
210
206
  }
211
- }), Qe = s.forwardRef(
207
+ }), Qe = n.forwardRef(
212
208
  (e, r) => {
213
209
  const {
214
210
  __scopeToast: o,
215
211
  type: t = "foreground",
216
- duration: u,
212
+ duration: c,
217
213
  open: d,
218
- onClose: f,
219
- onEscapeKeyDown: m,
214
+ onClose: p,
215
+ onEscapeKeyDown: T,
220
216
  onPause: v,
221
- onResume: n,
222
- onSwipeStart: h,
217
+ onResume: a,
218
+ onSwipeStart: E,
223
219
  onSwipeMove: w,
224
220
  onSwipeCancel: S,
225
- onSwipeEnd: g,
221
+ onSwipeEnd: b,
226
222
  ...R
227
- } = e, l = U(V, o), [i, C] = s.useState(null), p = ae(r, (a) => C(a)), T = s.useRef(null), E = s.useRef(null), y = u || l.duration, P = s.useRef(0), N = s.useRef(y), M = s.useRef(0), { onToastAdd: F, onToastRemove: Y } = l, _ = $(() => {
228
- var x;
229
- (i == null ? void 0 : i.contains(document.activeElement)) && ((x = l.viewport) == null || x.focus()), f();
230
- }), A = s.useCallback(
231
- (a) => {
232
- !a || a === 1 / 0 || (window.clearTimeout(M.current), P.current = (/* @__PURE__ */ new Date()).getTime(), M.current = window.setTimeout(_, a));
223
+ } = e, l = U(O, o), [u, h] = n.useState(null), f = ae(r, (s) => h(s)), m = n.useRef(null), P = n.useRef(null), C = c || l.duration, y = n.useRef(0), F = n.useRef(C), k = n.useRef(0), { onToastAdd: _, onToastRemove: V } = l, N = $(() => {
224
+ u?.contains(document.activeElement) && l.viewport?.focus(), p();
225
+ }), K = n.useCallback(
226
+ (s) => {
227
+ !s || s === 1 / 0 || (window.clearTimeout(k.current), y.current = (/* @__PURE__ */ new Date()).getTime(), k.current = window.setTimeout(N, s));
233
228
  },
234
- [_]
229
+ [N]
235
230
  );
236
- s.useEffect(() => {
237
- const a = l.viewport;
238
- if (a) {
239
- const x = () => {
240
- A(N.current), n == null || n();
231
+ n.useEffect(() => {
232
+ const s = l.viewport;
233
+ if (s) {
234
+ const g = () => {
235
+ K(F.current), a?.();
241
236
  }, I = () => {
242
- const O = (/* @__PURE__ */ new Date()).getTime() - P.current;
243
- N.current = N.current - O, window.clearTimeout(M.current), v == null || v();
237
+ const L = (/* @__PURE__ */ new Date()).getTime() - y.current;
238
+ F.current = F.current - L, window.clearTimeout(k.current), v?.();
244
239
  };
245
- return a.addEventListener(G, I), a.addEventListener(J, x), () => {
246
- a.removeEventListener(G, I), a.removeEventListener(J, x);
240
+ return s.addEventListener(z, I), s.addEventListener(G, g), () => {
241
+ s.removeEventListener(z, I), s.removeEventListener(G, g);
247
242
  };
248
243
  }
249
- }, [l.viewport, y, v, n, A]), s.useEffect(() => {
250
- d && !l.isClosePausedRef.current && A(y);
251
- }, [d, y, l.isClosePausedRef, A]), s.useEffect(() => (F(), () => Y()), [F, Y]);
252
- const K = s.useMemo(() => i ? Ce(i) : null, [i]);
253
- return l.viewport ? /* @__PURE__ */ D(se, { children: [
254
- K && /* @__PURE__ */ c(
244
+ }, [l.viewport, C, v, a, K]), n.useEffect(() => {
245
+ d && !l.isClosePausedRef.current && K(C);
246
+ }, [d, C, l.isClosePausedRef, K]), n.useEffect(() => (_(), () => V()), [_, V]);
247
+ const ee = n.useMemo(() => u ? Pe(u) : null, [u]);
248
+ return l.viewport ? /* @__PURE__ */ A(se, { children: [
249
+ ee && /* @__PURE__ */ i(
255
250
  Ze,
256
251
  {
257
252
  __scopeToast: o,
258
253
  role: "status",
259
254
  "aria-live": t === "foreground" ? "assertive" : "polite",
260
- "aria-atomic": !0,
261
- children: K
255
+ children: ee
262
256
  }
263
257
  ),
264
- /* @__PURE__ */ c(Ge, { scope: o, onClose: _, children: Se.createPortal(
265
- /* @__PURE__ */ c(ee.ItemSlot, { scope: o, children: /* @__PURE__ */ c(
258
+ /* @__PURE__ */ i(Ge, { scope: o, onClose: N, children: Se.createPortal(
259
+ /* @__PURE__ */ i(Z.ItemSlot, { scope: o, children: /* @__PURE__ */ i(
266
260
  Le,
267
261
  {
268
262
  asChild: !0,
269
- onEscapeKeyDown: b(m, () => {
270
- l.isFocusedToastEscapeKeyDownRef.current || _(), l.isFocusedToastEscapeKeyDownRef.current = !1;
263
+ onEscapeKeyDown: x(T, () => {
264
+ l.isFocusedToastEscapeKeyDownRef.current || N(), l.isFocusedToastEscapeKeyDownRef.current = !1;
271
265
  }),
272
- children: /* @__PURE__ */ c(
273
- L.li,
266
+ children: /* @__PURE__ */ i(
267
+ D.li,
274
268
  {
275
- role: "status",
276
- "aria-live": "off",
277
- "aria-atomic": !0,
278
269
  tabIndex: 0,
279
270
  "data-state": d ? "open" : "closed",
280
271
  "data-swipe-direction": l.swipeDirection,
281
272
  ...R,
282
- ref: p,
273
+ ref: f,
283
274
  style: { userSelect: "none", touchAction: "none", ...e.style },
284
- onKeyDown: b(e.onKeyDown, (a) => {
285
- a.key === "Escape" && (m == null || m(a.nativeEvent), a.nativeEvent.defaultPrevented || (l.isFocusedToastEscapeKeyDownRef.current = !0, _()));
275
+ onKeyDown: x(e.onKeyDown, (s) => {
276
+ s.key === "Escape" && (T?.(s.nativeEvent), s.nativeEvent.defaultPrevented || (l.isFocusedToastEscapeKeyDownRef.current = !0, N()));
286
277
  }),
287
- onPointerDown: b(e.onPointerDown, (a) => {
288
- a.button === 0 && (T.current = { x: a.clientX, y: a.clientY });
278
+ onPointerDown: x(e.onPointerDown, (s) => {
279
+ s.button === 0 && (m.current = { x: s.clientX, y: s.clientY });
289
280
  }),
290
- onPointerMove: b(e.onPointerMove, (a) => {
291
- if (!T.current) return;
292
- const x = a.clientX - T.current.x, I = a.clientY - T.current.y, O = !!E.current, k = ["left", "right"].includes(l.swipeDirection), H = ["left", "up"].includes(l.swipeDirection) ? Math.min : Math.max, Pe = k ? H(0, x) : 0, xe = k ? 0 : H(0, I), B = a.pointerType === "touch" ? 10 : 2, W = { x: Pe, y: xe }, te = { originalEvent: a, delta: W };
293
- O ? (E.current = W, X(je, w, te, {
281
+ onPointerMove: x(e.onPointerMove, (s) => {
282
+ if (!m.current) return;
283
+ const g = s.clientX - m.current.x, I = s.clientY - m.current.y, L = !!P.current, M = ["left", "right"].includes(l.swipeDirection), H = ["left", "up"].includes(l.swipeDirection) ? Math.min : Math.max, Ce = M ? H(0, g) : 0, Re = M ? 0 : H(0, I), Y = s.pointerType === "touch" ? 10 : 2, W = { x: Ce, y: Re }, te = { originalEvent: s, delta: W };
284
+ L ? (P.current = W, X(je, w, te, {
294
285
  discrete: !1
295
- })) : ne(W, l.swipeDirection, B) ? (E.current = W, X(Be, h, te, {
286
+ })) : ne(W, l.swipeDirection, Y) ? (P.current = W, X(Be, E, te, {
296
287
  discrete: !1
297
- }), a.target.setPointerCapture(a.pointerId)) : (Math.abs(x) > B || Math.abs(I) > B) && (T.current = null);
288
+ }), s.target.setPointerCapture(s.pointerId)) : (Math.abs(g) > Y || Math.abs(I) > Y) && (m.current = null);
298
289
  }),
299
- onPointerUp: b(e.onPointerUp, (a) => {
300
- const x = E.current, I = a.target;
301
- if (I.hasPointerCapture(a.pointerId) && I.releasePointerCapture(a.pointerId), E.current = null, T.current = null, x) {
302
- const O = a.currentTarget, k = { originalEvent: a, delta: x };
303
- ne(x, l.swipeDirection, l.swipeThreshold) ? X(ze, g, k, {
290
+ onPointerUp: x(e.onPointerUp, (s) => {
291
+ const g = P.current, I = s.target;
292
+ if (I.hasPointerCapture(s.pointerId) && I.releasePointerCapture(s.pointerId), P.current = null, m.current = null, g) {
293
+ const L = s.currentTarget, M = { originalEvent: s, delta: g };
294
+ ne(g, l.swipeDirection, l.swipeThreshold) ? X(ze, b, M, {
304
295
  discrete: !0
305
296
  }) : X(
306
297
  qe,
307
298
  S,
308
- k,
299
+ M,
309
300
  {
310
301
  discrete: !0
311
302
  }
312
- ), O.addEventListener("click", (H) => H.preventDefault(), {
303
+ ), L.addEventListener("click", (H) => H.preventDefault(), {
313
304
  once: !0
314
305
  });
315
306
  }
@@ -323,91 +314,91 @@ var [Ge, Je] = ce(V, {
323
314
  ] }) : null;
324
315
  }
325
316
  ), Ze = (e) => {
326
- const { __scopeToast: r, children: o, ...t } = e, u = U(V, r), [d, f] = s.useState(!1), [m, v] = s.useState(!1);
327
- return ot(() => f(!0)), s.useEffect(() => {
328
- const n = window.setTimeout(() => v(!0), 1e3);
329
- return () => window.clearTimeout(n);
330
- }, []), m ? null : /* @__PURE__ */ c(Me, { asChild: !0, children: /* @__PURE__ */ c(ie, { ...t, children: d && /* @__PURE__ */ D(se, { children: [
331
- u.label,
317
+ const { __scopeToast: r, children: o, ...t } = e, c = U(O, r), [d, p] = n.useState(!1), [T, v] = n.useState(!1);
318
+ return ot(() => p(!0)), n.useEffect(() => {
319
+ const a = window.setTimeout(() => v(!0), 1e3);
320
+ return () => window.clearTimeout(a);
321
+ }, []), T ? null : /* @__PURE__ */ i(Me, { asChild: !0, children: /* @__PURE__ */ i(ie, { ...t, children: d && /* @__PURE__ */ A(se, { children: [
322
+ c.label,
332
323
  " ",
333
324
  o
334
325
  ] }) }) });
335
- }, et = "ToastTitle", me = s.forwardRef(
326
+ }, et = "ToastTitle", me = n.forwardRef(
336
327
  (e, r) => {
337
328
  const { __scopeToast: o, ...t } = e;
338
- return /* @__PURE__ */ c(L.div, { ...t, ref: r });
329
+ return /* @__PURE__ */ i(D.div, { ...t, ref: r });
339
330
  }
340
331
  );
341
332
  me.displayName = et;
342
- var tt = "ToastDescription", Te = s.forwardRef(
333
+ var tt = "ToastDescription", Te = n.forwardRef(
343
334
  (e, r) => {
344
335
  const { __scopeToast: o, ...t } = e;
345
- return /* @__PURE__ */ c(L.div, { ...t, ref: r });
336
+ return /* @__PURE__ */ i(D.div, { ...t, ref: r });
346
337
  }
347
338
  );
348
339
  Te.displayName = tt;
349
- var ve = "ToastAction", we = s.forwardRef(
340
+ var we = "ToastAction", ve = n.forwardRef(
350
341
  (e, r) => {
351
342
  const { altText: o, ...t } = e;
352
- return o.trim() ? /* @__PURE__ */ c(ye, { altText: o, asChild: !0, children: /* @__PURE__ */ c(he, { ...t, ref: r }) }) : (console.error(
353
- `Invalid prop \`altText\` supplied to \`${ve}\`. Expected non-empty \`string\`.`
343
+ return o.trim() ? /* @__PURE__ */ i(he, { altText: o, asChild: !0, children: /* @__PURE__ */ i(ye, { ...t, ref: r }) }) : (console.error(
344
+ `Invalid prop \`altText\` supplied to \`${we}\`. Expected non-empty \`string\`.`
354
345
  ), null);
355
346
  }
356
347
  );
357
- we.displayName = ve;
358
- var Ee = "ToastClose", he = s.forwardRef(
348
+ ve.displayName = we;
349
+ var Ee = "ToastClose", ye = n.forwardRef(
359
350
  (e, r) => {
360
- const { __scopeToast: o, ...t } = e, u = Je(Ee, o);
361
- return /* @__PURE__ */ c(ye, { asChild: !0, children: /* @__PURE__ */ c(
362
- L.button,
351
+ const { __scopeToast: o, ...t } = e, c = Je(Ee, o);
352
+ return /* @__PURE__ */ i(he, { asChild: !0, children: /* @__PURE__ */ i(
353
+ D.button,
363
354
  {
364
355
  type: "button",
365
356
  ...t,
366
357
  ref: r,
367
- onClick: b(e.onClick, u.onClose)
358
+ onClick: x(e.onClick, c.onClose)
368
359
  }
369
360
  ) });
370
361
  }
371
362
  );
372
- he.displayName = Ee;
373
- var ye = s.forwardRef((e, r) => {
374
- const { __scopeToast: o, altText: t, ...u } = e;
375
- return /* @__PURE__ */ c(
376
- L.div,
363
+ ye.displayName = Ee;
364
+ var he = n.forwardRef((e, r) => {
365
+ const { __scopeToast: o, altText: t, ...c } = e;
366
+ return /* @__PURE__ */ i(
367
+ D.div,
377
368
  {
378
369
  "data-radix-toast-announce-exclude": "",
379
370
  "data-radix-toast-announce-alt": t || void 0,
380
- ...u,
371
+ ...c,
381
372
  ref: r
382
373
  }
383
374
  );
384
375
  });
385
- function Ce(e) {
376
+ function Pe(e) {
386
377
  const r = [];
387
378
  return Array.from(e.childNodes).forEach((t) => {
388
379
  if (t.nodeType === t.TEXT_NODE && t.textContent && r.push(t.textContent), rt(t)) {
389
- const u = t.ariaHidden || t.hidden || t.style.display === "none", d = t.dataset.radixToastAnnounceExclude === "";
390
- if (!u)
380
+ const c = t.ariaHidden || t.hidden || t.style.display === "none", d = t.dataset.radixToastAnnounceExclude === "";
381
+ if (!c)
391
382
  if (d) {
392
- const f = t.dataset.radixToastAnnounceAlt;
393
- f && r.push(f);
383
+ const p = t.dataset.radixToastAnnounceAlt;
384
+ p && r.push(p);
394
385
  } else
395
- r.push(...Ce(t));
386
+ r.push(...Pe(t));
396
387
  }
397
388
  }), r;
398
389
  }
399
390
  function X(e, r, o, { discrete: t }) {
400
- const u = o.originalEvent.currentTarget, d = new CustomEvent(e, { bubbles: !0, cancelable: !0, detail: o });
401
- r && u.addEventListener(e, r, { once: !0 }), t ? Ie(u, d) : u.dispatchEvent(d);
391
+ const c = o.originalEvent.currentTarget, d = new CustomEvent(e, { bubbles: !0, cancelable: !0, detail: o });
392
+ r && c.addEventListener(e, r, { once: !0 }), t ? Ie(c, d) : c.dispatchEvent(d);
402
393
  }
403
394
  var ne = (e, r, o = 0) => {
404
- const t = Math.abs(e.x), u = Math.abs(e.y), d = t > u;
405
- return r === "left" || r === "right" ? d && t > o : !d && u > o;
395
+ const t = Math.abs(e.x), c = Math.abs(e.y), d = t > c;
396
+ return r === "left" || r === "right" ? d && t > o : !d && c > o;
406
397
  };
407
398
  function ot(e = () => {
408
399
  }) {
409
400
  const r = $(e);
410
- Fe(() => {
401
+ De(() => {
411
402
  let o = 0, t = 0;
412
403
  return o = window.requestAnimationFrame(() => t = window.requestAnimationFrame(r)), () => {
413
404
  window.cancelAnimationFrame(o), window.cancelAnimationFrame(t);
@@ -420,66 +411,66 @@ function rt(e) {
420
411
  function nt(e) {
421
412
  const r = [], o = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
422
413
  acceptNode: (t) => {
423
- const u = t.tagName === "INPUT" && t.type === "hidden";
424
- return t.disabled || t.hidden || u ? NodeFilter.FILTER_SKIP : t.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
414
+ const c = t.tagName === "INPUT" && t.type === "hidden";
415
+ return t.disabled || t.hidden || c ? NodeFilter.FILTER_SKIP : t.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
425
416
  }
426
417
  });
427
418
  for (; o.nextNode(); ) r.push(o.currentNode);
428
419
  return r;
429
420
  }
430
- function z(e) {
421
+ function q(e) {
431
422
  const r = document.activeElement;
432
423
  return e.some((o) => o === r ? !0 : (o.focus(), document.activeElement !== r));
433
424
  }
434
- var st = ue, at = de, it = pe, ct = me, ut = Te, lt = we;
425
+ var st = ue, at = de, it = fe, ct = me, ut = Te, lt = ve;
435
426
  const bt = ({
436
427
  title: e,
437
428
  duration: r = 5e3,
438
429
  titleClassName: o,
439
430
  descriptionClassName: t,
440
- description: u,
431
+ description: c,
441
432
  children: d,
442
- theme: f,
443
- showCloseButton: m = !0,
433
+ theme: p,
434
+ showCloseButton: T = !0,
444
435
  closeButtonClassName: v,
445
- className: n,
446
- open: h = !1,
436
+ className: a,
437
+ open: E = !1,
447
438
  setOpen: w
448
439
  }) => {
449
- const S = Re(0);
440
+ const S = xe(0);
450
441
  be(() => () => clearTimeout(S.current), []);
451
- const g = oe(() => re(e) ? /* @__PURE__ */ c(j, { className: o, children: e }) : e, [e, o]), R = oe(() => re(u) ? /* @__PURE__ */ c(j, { className: t, children: u }) : u, [u, t]), l = ge(() => {
442
+ const b = oe(() => re(e) ? /* @__PURE__ */ i(B, { className: o, children: e }) : e, [e, o]), R = oe(() => re(c) ? /* @__PURE__ */ i(B, { className: t, children: c }) : c, [c, t]), l = ge(() => {
452
443
  w(!1), S.current = window.setTimeout(() => w(!0), 100);
453
444
  }, [w]);
454
- return /* @__PURE__ */ D(st, { swipeDirection: "right", duration: r, children: [
455
- /* @__PURE__ */ c(j, { onClick: l, children: d }),
456
- /* @__PURE__ */ D(
445
+ return /* @__PURE__ */ A(st, { swipeDirection: "right", duration: r, children: [
446
+ /* @__PURE__ */ i(B, { onClick: l, children: d }),
447
+ /* @__PURE__ */ A(
457
448
  it,
458
449
  {
459
- className: q(Ke({ className: n })),
460
- "data-theme": f,
461
- open: h,
450
+ className: j(Ke({ className: a })),
451
+ "data-theme": p,
452
+ open: E,
462
453
  onOpenChange: w,
463
454
  children: [
464
- /* @__PURE__ */ c(ct, { asChild: !0, className: o, children: g }),
465
- R && /* @__PURE__ */ c(ut, { asChild: !0, children: R }),
466
- m && /* @__PURE__ */ c(lt, { asChild: !0, altText: "Close the toast", children: /* @__PURE__ */ D("button", { type: "button", className: "absolute right-1.5 top-1.5", children: [
467
- /* @__PURE__ */ c(
455
+ /* @__PURE__ */ i(ct, { asChild: !0, className: o, children: b }),
456
+ R && /* @__PURE__ */ i(ut, { asChild: !0, children: R }),
457
+ T && /* @__PURE__ */ i(lt, { asChild: !0, altText: "Close the toast", children: /* @__PURE__ */ A("button", { type: "button", className: "absolute right-1.5 top-1.5", children: [
458
+ /* @__PURE__ */ i(
468
459
  We,
469
460
  {
470
- className: q(
461
+ className: j(
471
462
  Ve({
472
463
  className: v
473
464
  })
474
465
  )
475
466
  }
476
467
  ),
477
- /* @__PURE__ */ c(ke, { children: "Close toast" })
468
+ /* @__PURE__ */ i(ke, { children: "Close toast" })
478
469
  ] }) })
479
470
  ]
480
471
  }
481
472
  ),
482
- /* @__PURE__ */ c(at, { className: q(He()) })
473
+ /* @__PURE__ */ i(at, { className: j(He()) })
483
474
  ] });
484
475
  };
485
476
  export {