@konstructio/ui 0.1.2-alpha.4 → 0.1.2-alpha.40

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