@konstructio/ui 0.1.2-alpha.5 → 0.1.2-alpha.51

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