@tamagui/toast 2.7.7 → 3.0.0-beta.643.1

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 (303) hide show
  1. package/dist/cjs/ToastComposable.cjs +773 -882
  2. package/dist/cjs/ToastComposable.native.cjs +924 -0
  3. package/dist/cjs/ToastComposable.native.js +854 -966
  4. package/dist/cjs/ToastComposable.native.js.map +1 -1
  5. package/dist/cjs/ToastItemFrame.cjs +48 -119
  6. package/dist/cjs/ToastItemFrame.native.cjs +76 -0
  7. package/dist/cjs/ToastItemFrame.native.js +50 -120
  8. package/dist/cjs/ToastItemFrame.native.js.map +1 -1
  9. package/dist/cjs/ToastState.cjs +281 -290
  10. package/dist/cjs/ToastState.native.cjs +312 -0
  11. package/dist/cjs/ToastState.native.js +280 -290
  12. package/dist/cjs/ToastState.native.js.map +1 -1
  13. package/dist/cjs/createNativeToast.cjs +38 -44
  14. package/dist/cjs/createNativeToast.native.cjs +54 -0
  15. package/dist/cjs/createNativeToast.native.js +36 -40
  16. package/dist/cjs/createNativeToast.native.js.map +1 -1
  17. package/dist/cjs/dispatchNativeToast.cjs +32 -35
  18. package/dist/cjs/dispatchNativeToast.native.cjs +48 -0
  19. package/dist/cjs/dispatchNativeToast.native.js +34 -36
  20. package/dist/cjs/dispatchNativeToast.native.js.map +1 -1
  21. package/dist/cjs/index.cjs +25 -12
  22. package/dist/cjs/index.native.cjs +35 -0
  23. package/dist/cjs/index.native.js +26 -12
  24. package/dist/cjs/index.native.js.map +1 -1
  25. package/dist/cjs/types.cjs +10 -11
  26. package/dist/cjs/types.native.cjs +19 -0
  27. package/dist/cjs/types.native.js +10 -10
  28. package/dist/cjs/types.native.js.map +1 -1
  29. package/dist/cjs/useAnimatedDragGesture.cjs +197 -194
  30. package/dist/cjs/useAnimatedDragGesture.native.cjs +210 -0
  31. package/dist/cjs/useAnimatedDragGesture.native.js +179 -191
  32. package/dist/cjs/useAnimatedDragGesture.native.js.map +1 -1
  33. package/dist/cjs/useReducedMotion.cjs +47 -55
  34. package/dist/cjs/useReducedMotion.native.cjs +74 -0
  35. package/dist/cjs/useReducedMotion.native.js +53 -60
  36. package/dist/cjs/useReducedMotion.native.js.map +1 -1
  37. package/dist/cjs/useToastAnimations.cjs +198 -270
  38. package/dist/cjs/useToastAnimations.native.cjs +229 -0
  39. package/dist/cjs/useToastAnimations.native.js +205 -276
  40. package/dist/cjs/useToastAnimations.native.js.map +1 -1
  41. package/dist/esm/ToastComposable.mjs +752 -854
  42. package/dist/esm/ToastComposable.mjs.map +1 -1
  43. package/dist/esm/ToastComposable.native.js +834 -940
  44. package/dist/esm/ToastComposable.native.js.map +1 -1
  45. package/dist/esm/ToastItemFrame.mjs +31 -99
  46. package/dist/esm/ToastItemFrame.mjs.map +1 -1
  47. package/dist/esm/ToastItemFrame.native.js +34 -102
  48. package/dist/esm/ToastItemFrame.native.js.map +1 -1
  49. package/dist/esm/ToastState.mjs +266 -273
  50. package/dist/esm/ToastState.mjs.map +1 -1
  51. package/dist/esm/ToastState.native.js +265 -274
  52. package/dist/esm/ToastState.native.js.map +1 -1
  53. package/dist/esm/createNativeToast.mjs +22 -26
  54. package/dist/esm/createNativeToast.mjs.map +1 -1
  55. package/dist/esm/createNativeToast.native.js +21 -23
  56. package/dist/esm/createNativeToast.native.js.map +1 -1
  57. package/dist/esm/dispatchNativeToast.mjs +19 -17
  58. package/dist/esm/dispatchNativeToast.mjs.map +1 -1
  59. package/dist/esm/dispatchNativeToast.native.js +21 -19
  60. package/dist/esm/dispatchNativeToast.native.js.map +1 -1
  61. package/dist/esm/index.js +5 -2
  62. package/dist/esm/index.mjs +5 -2
  63. package/dist/esm/index.native.js +5 -2
  64. package/dist/esm/types.mjs +0 -2
  65. package/dist/esm/types.native.js +0 -2
  66. package/dist/esm/useAnimatedDragGesture.mjs +181 -168
  67. package/dist/esm/useAnimatedDragGesture.mjs.map +1 -1
  68. package/dist/esm/useAnimatedDragGesture.native.js +163 -166
  69. package/dist/esm/useAnimatedDragGesture.native.js.map +1 -1
  70. package/dist/esm/useReducedMotion.mjs +31 -29
  71. package/dist/esm/useReducedMotion.mjs.map +1 -1
  72. package/dist/esm/useReducedMotion.native.js +37 -35
  73. package/dist/esm/useReducedMotion.native.js.map +1 -1
  74. package/dist/esm/useToastAnimations.mjs +183 -245
  75. package/dist/esm/useToastAnimations.mjs.map +1 -1
  76. package/dist/esm/useToastAnimations.native.js +190 -252
  77. package/dist/esm/useToastAnimations.native.js.map +1 -1
  78. package/dist/jsx/ToastComposable.mjs +752 -854
  79. package/dist/jsx/ToastComposable.mjs.map +1 -1
  80. package/dist/jsx/ToastComposable.native.cjs +924 -0
  81. package/dist/jsx/ToastComposable.native.js +854 -966
  82. package/dist/jsx/ToastComposable.native.js.map +1 -1
  83. package/dist/jsx/ToastItemFrame.mjs +31 -99
  84. package/dist/jsx/ToastItemFrame.mjs.map +1 -1
  85. package/dist/jsx/ToastItemFrame.native.cjs +76 -0
  86. package/dist/jsx/ToastItemFrame.native.js +50 -120
  87. package/dist/jsx/ToastItemFrame.native.js.map +1 -1
  88. package/dist/jsx/ToastState.mjs +266 -273
  89. package/dist/jsx/ToastState.mjs.map +1 -1
  90. package/dist/jsx/ToastState.native.cjs +312 -0
  91. package/dist/jsx/ToastState.native.js +280 -290
  92. package/dist/jsx/ToastState.native.js.map +1 -1
  93. package/dist/jsx/createNativeToast.mjs +22 -26
  94. package/dist/jsx/createNativeToast.mjs.map +1 -1
  95. package/dist/jsx/createNativeToast.native.cjs +54 -0
  96. package/dist/jsx/createNativeToast.native.js +36 -40
  97. package/dist/jsx/createNativeToast.native.js.map +1 -1
  98. package/dist/jsx/dispatchNativeToast.mjs +19 -17
  99. package/dist/jsx/dispatchNativeToast.mjs.map +1 -1
  100. package/dist/jsx/dispatchNativeToast.native.cjs +48 -0
  101. package/dist/jsx/dispatchNativeToast.native.js +34 -36
  102. package/dist/jsx/dispatchNativeToast.native.js.map +1 -1
  103. package/dist/jsx/index.js +5 -2
  104. package/dist/jsx/index.mjs +5 -2
  105. package/dist/jsx/index.native.cjs +35 -0
  106. package/dist/jsx/index.native.js +26 -12
  107. package/dist/jsx/index.native.js.map +1 -1
  108. package/dist/jsx/types.mjs +0 -2
  109. package/dist/jsx/types.native.cjs +19 -0
  110. package/dist/jsx/types.native.js +10 -10
  111. package/dist/jsx/types.native.js.map +1 -1
  112. package/dist/jsx/useAnimatedDragGesture.mjs +181 -168
  113. package/dist/jsx/useAnimatedDragGesture.mjs.map +1 -1
  114. package/dist/jsx/useAnimatedDragGesture.native.cjs +210 -0
  115. package/dist/jsx/useAnimatedDragGesture.native.js +179 -191
  116. package/dist/jsx/useAnimatedDragGesture.native.js.map +1 -1
  117. package/dist/jsx/useReducedMotion.mjs +31 -29
  118. package/dist/jsx/useReducedMotion.mjs.map +1 -1
  119. package/dist/jsx/useReducedMotion.native.cjs +74 -0
  120. package/dist/jsx/useReducedMotion.native.js +53 -60
  121. package/dist/jsx/useReducedMotion.native.js.map +1 -1
  122. package/dist/jsx/useToastAnimations.mjs +183 -245
  123. package/dist/jsx/useToastAnimations.mjs.map +1 -1
  124. package/dist/jsx/useToastAnimations.native.cjs +229 -0
  125. package/dist/jsx/useToastAnimations.native.js +205 -276
  126. package/dist/jsx/useToastAnimations.native.js.map +1 -1
  127. package/package.json +20 -37
  128. package/src/ToastComposable.tsx +55 -97
  129. package/src/ToastItemFrame.tsx +22 -81
  130. package/src/ToastState.ts +1 -0
  131. package/src/index.ts +34 -2
  132. package/src/types.ts +11 -0
  133. package/src/useAnimatedDragGesture.native.ts +1 -1
  134. package/src/useAnimatedDragGesture.ts +1 -1
  135. package/src/useToastAnimations.ts +20 -36
  136. package/types/ToastComposable.d.ts +124 -47
  137. package/types/ToastComposable.d.ts.map +1 -1
  138. package/types/ToastItemFrame.d.ts +52 -21
  139. package/types/ToastItemFrame.d.ts.map +1 -1
  140. package/types/ToastState.d.ts +15 -11
  141. package/types/ToastState.d.ts.map +1 -1
  142. package/types/index.d.ts +6 -2
  143. package/types/index.d.ts.map +1 -1
  144. package/types/types.d.ts +1 -0
  145. package/types/types.d.ts.map +1 -1
  146. package/types/useAnimatedDragGesture.d.ts +1 -1
  147. package/types/useAnimatedDragGesture.d.ts.map +1 -1
  148. package/types/useAnimatedDragGesture.native.d.ts +1 -1
  149. package/types/useAnimatedDragGesture.native.d.ts.map +1 -1
  150. package/types/useToastAnimations.d.ts +2 -8
  151. package/types/useToastAnimations.d.ts.map +1 -1
  152. package/dist/cjs/Toast.cjs +0 -178
  153. package/dist/cjs/Toast.native.js +0 -181
  154. package/dist/cjs/Toast.native.js.map +0 -1
  155. package/dist/cjs/ToastAnnounce.cjs +0 -103
  156. package/dist/cjs/ToastAnnounce.native.js +0 -111
  157. package/dist/cjs/ToastAnnounce.native.js.map +0 -1
  158. package/dist/cjs/ToastImperative.cjs +0 -119
  159. package/dist/cjs/ToastImperative.native.js +0 -130
  160. package/dist/cjs/ToastImperative.native.js.map +0 -1
  161. package/dist/cjs/ToastImpl.cjs +0 -354
  162. package/dist/cjs/ToastImpl.native.js +0 -364
  163. package/dist/cjs/ToastImpl.native.js.map +0 -1
  164. package/dist/cjs/ToastPortal.cjs +0 -49
  165. package/dist/cjs/ToastPortal.native.js +0 -52
  166. package/dist/cjs/ToastPortal.native.js.map +0 -1
  167. package/dist/cjs/ToastProvider.cjs +0 -150
  168. package/dist/cjs/ToastProvider.native.js +0 -161
  169. package/dist/cjs/ToastProvider.native.js.map +0 -1
  170. package/dist/cjs/ToastViewport.cjs +0 -319
  171. package/dist/cjs/ToastViewport.native.js +0 -343
  172. package/dist/cjs/ToastViewport.native.js.map +0 -1
  173. package/dist/cjs/Toaster.cjs +0 -87
  174. package/dist/cjs/Toaster.native.js +0 -91
  175. package/dist/cjs/Toaster.native.js.map +0 -1
  176. package/dist/cjs/constants.cjs +0 -30
  177. package/dist/cjs/constants.native.js +0 -33
  178. package/dist/cjs/constants.native.js.map +0 -1
  179. package/dist/cjs/v2.cjs +0 -36
  180. package/dist/cjs/v2.native.js +0 -39
  181. package/dist/cjs/v2.native.js.map +0 -1
  182. package/dist/esm/Toast.mjs +0 -137
  183. package/dist/esm/Toast.mjs.map +0 -1
  184. package/dist/esm/Toast.native.js +0 -137
  185. package/dist/esm/Toast.native.js.map +0 -1
  186. package/dist/esm/ToastAnnounce.mjs +0 -66
  187. package/dist/esm/ToastAnnounce.mjs.map +0 -1
  188. package/dist/esm/ToastAnnounce.native.js +0 -71
  189. package/dist/esm/ToastAnnounce.native.js.map +0 -1
  190. package/dist/esm/ToastImperative.mjs +0 -80
  191. package/dist/esm/ToastImperative.mjs.map +0 -1
  192. package/dist/esm/ToastImperative.native.js +0 -88
  193. package/dist/esm/ToastImperative.native.js.map +0 -1
  194. package/dist/esm/ToastImpl.mjs +0 -316
  195. package/dist/esm/ToastImpl.mjs.map +0 -1
  196. package/dist/esm/ToastImpl.native.js +0 -329
  197. package/dist/esm/ToastImpl.native.js.map +0 -1
  198. package/dist/esm/ToastPortal.mjs +0 -24
  199. package/dist/esm/ToastPortal.mjs.map +0 -1
  200. package/dist/esm/ToastPortal.native.js +0 -24
  201. package/dist/esm/ToastPortal.native.js.map +0 -1
  202. package/dist/esm/ToastProvider.mjs +0 -110
  203. package/dist/esm/ToastProvider.mjs.map +0 -1
  204. package/dist/esm/ToastProvider.native.js +0 -118
  205. package/dist/esm/ToastProvider.native.js.map +0 -1
  206. package/dist/esm/ToastViewport.mjs +0 -280
  207. package/dist/esm/ToastViewport.mjs.map +0 -1
  208. package/dist/esm/ToastViewport.native.js +0 -301
  209. package/dist/esm/ToastViewport.native.js.map +0 -1
  210. package/dist/esm/Toaster.mjs +0 -51
  211. package/dist/esm/Toaster.mjs.map +0 -1
  212. package/dist/esm/Toaster.native.js +0 -52
  213. package/dist/esm/Toaster.native.js.map +0 -1
  214. package/dist/esm/constants.mjs +0 -4
  215. package/dist/esm/constants.mjs.map +0 -1
  216. package/dist/esm/constants.native.js +0 -4
  217. package/dist/esm/constants.native.js.map +0 -1
  218. package/dist/esm/index.js.map +0 -1
  219. package/dist/esm/index.mjs.map +0 -1
  220. package/dist/esm/index.native.js.map +0 -1
  221. package/dist/esm/types.mjs.map +0 -1
  222. package/dist/esm/types.native.js.map +0 -1
  223. package/dist/esm/v2.mjs +0 -6
  224. package/dist/esm/v2.mjs.map +0 -1
  225. package/dist/esm/v2.native.js +0 -6
  226. package/dist/esm/v2.native.js.map +0 -1
  227. package/dist/jsx/Toast.mjs +0 -137
  228. package/dist/jsx/Toast.mjs.map +0 -1
  229. package/dist/jsx/Toast.native.js +0 -181
  230. package/dist/jsx/Toast.native.js.map +0 -1
  231. package/dist/jsx/ToastAnnounce.mjs +0 -66
  232. package/dist/jsx/ToastAnnounce.mjs.map +0 -1
  233. package/dist/jsx/ToastAnnounce.native.js +0 -111
  234. package/dist/jsx/ToastAnnounce.native.js.map +0 -1
  235. package/dist/jsx/ToastImperative.mjs +0 -80
  236. package/dist/jsx/ToastImperative.mjs.map +0 -1
  237. package/dist/jsx/ToastImperative.native.js +0 -130
  238. package/dist/jsx/ToastImperative.native.js.map +0 -1
  239. package/dist/jsx/ToastImpl.mjs +0 -316
  240. package/dist/jsx/ToastImpl.mjs.map +0 -1
  241. package/dist/jsx/ToastImpl.native.js +0 -364
  242. package/dist/jsx/ToastImpl.native.js.map +0 -1
  243. package/dist/jsx/ToastPortal.mjs +0 -24
  244. package/dist/jsx/ToastPortal.mjs.map +0 -1
  245. package/dist/jsx/ToastPortal.native.js +0 -52
  246. package/dist/jsx/ToastPortal.native.js.map +0 -1
  247. package/dist/jsx/ToastProvider.mjs +0 -110
  248. package/dist/jsx/ToastProvider.mjs.map +0 -1
  249. package/dist/jsx/ToastProvider.native.js +0 -161
  250. package/dist/jsx/ToastProvider.native.js.map +0 -1
  251. package/dist/jsx/ToastViewport.mjs +0 -280
  252. package/dist/jsx/ToastViewport.mjs.map +0 -1
  253. package/dist/jsx/ToastViewport.native.js +0 -343
  254. package/dist/jsx/ToastViewport.native.js.map +0 -1
  255. package/dist/jsx/Toaster.mjs +0 -51
  256. package/dist/jsx/Toaster.mjs.map +0 -1
  257. package/dist/jsx/Toaster.native.js +0 -91
  258. package/dist/jsx/Toaster.native.js.map +0 -1
  259. package/dist/jsx/constants.mjs +0 -4
  260. package/dist/jsx/constants.mjs.map +0 -1
  261. package/dist/jsx/constants.native.js +0 -33
  262. package/dist/jsx/constants.native.js.map +0 -1
  263. package/dist/jsx/index.js.map +0 -1
  264. package/dist/jsx/index.mjs.map +0 -1
  265. package/dist/jsx/types.mjs.map +0 -1
  266. package/dist/jsx/v2.mjs +0 -6
  267. package/dist/jsx/v2.mjs.map +0 -1
  268. package/dist/jsx/v2.native.js +0 -39
  269. package/dist/jsx/v2.native.js.map +0 -1
  270. package/src/Toast.tsx +0 -219
  271. package/src/ToastAnnounce.tsx +0 -103
  272. package/src/ToastImperative.tsx +0 -192
  273. package/src/ToastImpl.tsx +0 -514
  274. package/src/ToastPortal.tsx +0 -19
  275. package/src/ToastProvider.tsx +0 -204
  276. package/src/ToastViewport.tsx +0 -430
  277. package/src/Toaster.tsx +0 -181
  278. package/src/constants.ts +0 -2
  279. package/src/v2.ts +0 -31
  280. package/types/Toast.d.ts +0 -84
  281. package/types/Toast.d.ts.map +0 -1
  282. package/types/ToastAnnounce.d.ts +0 -18
  283. package/types/ToastAnnounce.d.ts.map +0 -1
  284. package/types/ToastImperative.d.ts +0 -95
  285. package/types/ToastImperative.d.ts.map +0 -1
  286. package/types/ToastImpl.d.ts +0 -109
  287. package/types/ToastImpl.d.ts.map +0 -1
  288. package/types/ToastPortal.d.ts +0 -8
  289. package/types/ToastPortal.d.ts.map +0 -1
  290. package/types/ToastProvider.d.ts +0 -92
  291. package/types/ToastProvider.d.ts.map +0 -1
  292. package/types/ToastViewport.d.ts +0 -75
  293. package/types/ToastViewport.d.ts.map +0 -1
  294. package/types/Toaster.d.ts +0 -112
  295. package/types/Toaster.d.ts.map +0 -1
  296. package/types/constants.d.ts +0 -3
  297. package/types/constants.d.ts.map +0 -1
  298. package/types/v2.d.ts +0 -10
  299. package/types/v2.d.ts.map +0 -1
  300. package/v2/index.cjs +0 -2
  301. package/v2/index.js +0 -2
  302. package/v2/index.native.cjs +0 -2
  303. package/v2/index.native.js +0 -2
@@ -1,8 +1,8 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Theme, View, createRefComponent, createStyledContext, createStyledHOC, styled, useConfiguration, useEvent, useThemeName } from "@tamagui/core";
2
3
  import { AnimatePresence } from "@tamagui/animate-presence";
3
4
  import { isWeb } from "@tamagui/constants";
4
5
  import { getGestureHandler } from "@tamagui/native";
5
- import { createStyledContext, styled, Theme, useConfiguration, useEvent, useThemeName, View } from "@tamagui/core";
6
6
  import { withStaticProperties } from "@tamagui/helpers";
7
7
  import { Portal } from "@tamagui/portal";
8
8
  import { XStack, YStack } from "@tamagui/stacks";
@@ -14,10 +14,10 @@ import { useAnimatedDragGesture } from "./useAnimatedDragGesture.native.js";
14
14
  import { useToastAnimations } from "./useToastAnimations.native.js";
15
15
  import { useReducedMotion } from "./useReducedMotion.native.js";
16
16
  import { DefaultCloseIcon, ToastActionFrame, ToastCloseFrame, ToastItemFrame, ToastPositionWrapper } from "./ToastItemFrame.native.js";
17
- function _type_of(obj) {
18
- "@swc/helpers - typeof";
19
17
 
20
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
18
+ function _type_of(obj) {
19
+ "@swc/helpers - typeof";
20
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
21
21
  }
22
22
  var VISIBLE_TOASTS_AMOUNT = 4;
23
23
  var VIEWPORT_OFFSET = 16;
@@ -29,969 +29,863 @@ var DEFAULT_HOTKEY = ["altKey", "KeyT"];
29
29
  var ToastContext = createStyledContext({}, "Toast__");
30
30
  var useToastContextValue = ToastContext.useStyledContext;
31
31
  function hasToastContext(ctx) {
32
- return !!ctx && Array.isArray(ctx.toasts) && typeof ctx.setToastHeight === "function" && typeof ctx.removeToast === "function";
32
+ return !!ctx && Array.isArray(ctx.toasts) && typeof ctx.setToastHeight === "function" && typeof ctx.removeToast === "function";
33
33
  }
34
34
  function useToastContext(consumerName) {
35
- var ctx = useToastContextValue();
36
- if (!hasToastContext(ctx)) {
37
- throw new Error(`\`${consumerName}\` must be used within \`Toast\``);
38
- }
39
- return ctx;
35
+ var ctx = useToastContextValue();
36
+ if (!hasToastContext(ctx)) {
37
+ throw new Error(`\`${consumerName}\` must be used within \`Toast\``);
38
+ }
39
+ return ctx;
40
40
  }
41
- var ToastItemContext = /* @__PURE__ */React.createContext(null);
41
+ var ToastItemContext = /* @__PURE__ */ React.createContext(null);
42
42
  function useToastItemContext() {
43
- var ctx = React.useContext(ToastItemContext);
44
- if (!ctx) {
45
- throw new Error("useToastItemContext must be used within Toast.Item or Toast.List");
46
- }
47
- return ctx;
43
+ var ctx = React.useContext(ToastItemContext);
44
+ if (!ctx) {
45
+ throw new Error("useToastItemContext must be used within Toast.Item or Toast.List");
46
+ }
47
+ return ctx;
48
48
  }
49
49
  function resolveSwipeDirection(direction, position) {
50
- if (direction !== "auto") return direction;
51
- var [yPosition, xPosition] = position.split("-");
52
- if (!isWeb) {
53
- return yPosition === "top" ? "up" : "down";
54
- }
55
- if (xPosition === "left") return "left";
56
- if (xPosition === "right") return "right";
57
- return "horizontal";
50
+ if (direction !== "auto") return direction;
51
+ var [yPosition, xPosition] = position.split("-");
52
+ if (!isWeb) {
53
+ return yPosition === "top" ? "up" : "down";
54
+ }
55
+ if (xPosition === "left") return "left";
56
+ if (xPosition === "right") return "right";
57
+ return "horizontal";
58
58
  }
59
- var ToastRoot = /* @__PURE__ */React.forwardRef(function ToastRoot2(props, _ref) {
60
- var {
61
- children,
62
- position = "bottom-right",
63
- duration = TOAST_LIFETIME,
64
- gap = TOAST_GAP,
65
- visibleToasts = VISIBLE_TOASTS_AMOUNT,
66
- swipeDirection: swipeDirectionProp = "auto",
67
- swipeThreshold = 50,
68
- toastHeight = FIXED_TOAST_HEIGHT,
69
- closeButton = false,
70
- expand = false,
71
- theme: themeProp,
72
- reducedMotion: reducedMotionProp,
73
- native = false,
74
- burntOptions,
75
- notificationOptions,
76
- icons
77
- } = props;
78
- var reducedMotion = useReducedMotion(reducedMotionProp);
79
- var [toasts, setToasts] = React.useState([]);
80
- var [heights, setHeights] = React.useState({});
81
- var [localExpanded, setExpanded] = React.useState(false);
82
- var expanded = expand || localExpanded;
83
- var [interacting, setInteracting] = React.useState(false);
84
- var heightsLockedRef = React.useRef(false);
85
- var prevExpandedRef = React.useRef(expanded);
86
- React.useLayoutEffect(function () {
87
- if (prevExpandedRef.current !== expanded) {
88
- heightsLockedRef.current = true;
89
- prevExpandedRef.current = expanded;
90
- }
91
- var timer = setTimeout(function () {
92
- heightsLockedRef.current = false;
93
- }, 350);
94
- return function () {
95
- return clearTimeout(timer);
96
- };
97
- }, [expanded]);
98
- var setToastHeight = React.useCallback(function (toastId, height) {
99
- if (heightsLockedRef.current) return;
100
- var rounded = Math.round(height);
101
- setHeights(function (prev) {
102
- var existing = prev[toastId];
103
- if (existing != null && Math.abs(existing - rounded) <= 2) return prev;
104
- return {
105
- ...prev,
106
- [toastId]: rounded
107
- };
108
- });
109
- }, []);
110
- var removeToastHeight = React.useCallback(function (toastId) {
111
- setHeights(function (prev) {
112
- if (!(toastId in prev)) return prev;
113
- var next = {
114
- ...prev
115
- };
116
- delete next[toastId];
117
- return next;
118
- });
119
- }, []);
120
- var dismissCooldownRef = React.useRef(false);
121
- var dismissCooldownTimerRef = React.useRef(null);
122
- var triggerDismissCooldown = React.useCallback(function () {
123
- dismissCooldownRef.current = true;
124
- if (dismissCooldownTimerRef.current) {
125
- clearTimeout(dismissCooldownTimerRef.current);
126
- }
127
- dismissCooldownTimerRef.current = setTimeout(function () {
128
- dismissCooldownRef.current = false;
129
- }, 800);
130
- }, []);
131
- var isInDismissCooldown = React.useCallback(function () {
132
- return dismissCooldownRef.current;
133
- }, []);
134
- var burntOptionsRef = React.useRef(burntOptions);
135
- var notificationOptionsRef = React.useRef(notificationOptions);
136
- React.useEffect(function () {
137
- burntOptionsRef.current = burntOptions;
138
- }, [burntOptions]);
139
- React.useEffect(function () {
140
- notificationOptionsRef.current = notificationOptions;
141
- }, [notificationOptions]);
142
- React.useEffect(function () {
143
- return ToastState.subscribe(function (toast) {
144
- if (toast.dismiss) {
145
- setToasts(function (toasts2) {
146
- return toasts2.map(function (t) {
147
- return t.id === toast.id ? {
148
- ...t,
149
- delete: true
150
- } : t;
151
- });
152
- });
153
- return;
154
- }
155
- if (native) {
156
- var handled = dispatchNativeToast(toast, {
157
- duration,
158
- burntOptions: burntOptionsRef.current,
159
- notificationOptions: notificationOptionsRef.current
160
- });
161
- if (handled) return;
162
- }
163
- setToasts(function (toasts2) {
164
- var idx = toasts2.findIndex(function (t) {
165
- return t.id === toast.id;
166
- });
167
- if (idx !== -1) {
168
- return [...toasts2.slice(0, idx), {
169
- ...toasts2[idx],
170
- ...toast
171
- }, ...toasts2.slice(idx + 1)];
172
- }
173
- return [toast, ...toasts2];
174
- });
175
- });
176
- }, [native, duration]);
177
- var prevToastCountRef = React.useRef(toasts.length);
178
- React.useEffect(function () {
179
- var prevCount = prevToastCountRef.current;
180
- prevToastCountRef.current = toasts.length;
181
- if (toasts.length <= 1 && !dismissCooldownRef.current) {
182
- setExpanded(false);
183
- } else if (toasts.length > prevCount && expanded) {
184
- setExpanded(false);
185
- }
186
- }, [toasts.length, expanded]);
187
- var removeToast = React.useCallback(function (toastToRemove) {
188
- setToasts(function (toasts2) {
189
- var _toasts_find;
190
- if (!((_toasts_find = toasts2.find(function (t) {
191
- return t.id === toastToRemove.id;
192
- })) === null || _toasts_find === void 0 ? void 0 : _toasts_find.delete)) {
193
- ToastState.dismiss(toastToRemove.id);
194
- }
195
- return toasts2.filter(function (param) {
196
- var {
197
- id
198
- } = param;
199
- return id !== toastToRemove.id;
200
- });
201
- });
202
- }, []);
203
- var swipeDirection = resolveSwipeDirection(swipeDirectionProp, position);
204
- var currentTheme = useThemeName();
205
- var resolvedTheme = themeProp === "system" || !themeProp ? (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.includes("dark")) ? "dark" : "light" : themeProp;
206
- var contextValue = {
207
- toasts,
208
- heights,
209
- setToastHeight,
210
- removeToastHeight,
211
- expanded,
212
- setExpanded,
213
- interacting,
214
- setInteracting,
215
- triggerDismissCooldown,
216
- isInDismissCooldown,
217
- removeToast,
218
- position,
219
- duration,
220
- gap,
221
- visibleToasts,
222
- swipeDirection,
223
- swipeThreshold,
224
- toastHeight,
225
- closeButton,
226
- reducedMotion,
227
- native,
228
- burntOptions,
229
- notificationOptions,
230
- icons
231
- };
232
- return /* @__PURE__ */_jsx(ToastContext.Provider, {
233
- ...contextValue,
234
- children: /* @__PURE__ */_jsx(Theme, {
235
- name: resolvedTheme,
236
- children
237
- })
238
- });
59
+ var ToastRoot = createRefComponent(function ToastRoot2(props, _ref) {
60
+ var { children, toasterId, position = "bottom-right", duration = TOAST_LIFETIME, gap = TOAST_GAP, visibleToasts = VISIBLE_TOASTS_AMOUNT, swipeDirection: swipeDirectionProp = "auto", swipeThreshold = 50, toastHeight = FIXED_TOAST_HEIGHT, closeButton = false, expand = false, theme: themeProp, reducedMotion: reducedMotionProp, native = false, burntOptions, notificationOptions, icons } = props;
61
+ var reducedMotion = useReducedMotion(reducedMotionProp);
62
+ var [toasts, setToasts] = React.useState([]);
63
+ var [heights, setHeights] = React.useState({});
64
+ var [localExpanded, setExpanded] = React.useState(false);
65
+ var expanded = expand || localExpanded;
66
+ var [interacting, setInteracting] = React.useState(false);
67
+ var heightsLockedRef = React.useRef(false);
68
+ var prevExpandedRef = React.useRef(expanded);
69
+ React.useLayoutEffect(function() {
70
+ if (prevExpandedRef.current !== expanded) {
71
+ heightsLockedRef.current = true;
72
+ prevExpandedRef.current = expanded;
73
+ }
74
+ var timer = setTimeout(function() {
75
+ heightsLockedRef.current = false;
76
+ }, 350);
77
+ return function() {
78
+ return clearTimeout(timer);
79
+ };
80
+ }, [expanded]);
81
+ var setToastHeight = React.useCallback(function(toastId, height) {
82
+ if (heightsLockedRef.current) return;
83
+ var rounded = Math.round(height);
84
+ setHeights(function(prev) {
85
+ var existing = prev[toastId];
86
+ if (existing != null && Math.abs(existing - rounded) <= 2) return prev;
87
+ return {
88
+ ...prev,
89
+ [toastId]: rounded
90
+ };
91
+ });
92
+ }, []);
93
+ var removeToastHeight = React.useCallback(function(toastId) {
94
+ setHeights(function(prev) {
95
+ if (!(toastId in prev)) return prev;
96
+ var next = { ...prev };
97
+ delete next[toastId];
98
+ return next;
99
+ });
100
+ }, []);
101
+ var dismissCooldownRef = React.useRef(false);
102
+ var dismissCooldownTimerRef = React.useRef(null);
103
+ var triggerDismissCooldown = React.useCallback(function() {
104
+ dismissCooldownRef.current = true;
105
+ if (dismissCooldownTimerRef.current) {
106
+ clearTimeout(dismissCooldownTimerRef.current);
107
+ }
108
+ dismissCooldownTimerRef.current = setTimeout(function() {
109
+ dismissCooldownRef.current = false;
110
+ }, 800);
111
+ }, []);
112
+ var isInDismissCooldown = React.useCallback(function() {
113
+ return dismissCooldownRef.current;
114
+ }, []);
115
+ var burntOptionsRef = React.useRef(burntOptions);
116
+ var notificationOptionsRef = React.useRef(notificationOptions);
117
+ React.useEffect(function() {
118
+ burntOptionsRef.current = burntOptions;
119
+ }, [burntOptions]);
120
+ React.useEffect(function() {
121
+ notificationOptionsRef.current = notificationOptions;
122
+ }, [notificationOptions]);
123
+ React.useEffect(function() {
124
+ return ToastState.subscribe(function(toast) {
125
+ if (toast.dismiss) {
126
+ setToasts(function(toasts2) {
127
+ return toasts2.map(function(t) {
128
+ return t.id === toast.id ? {
129
+ ...t,
130
+ delete: true
131
+ } : t;
132
+ });
133
+ });
134
+ return;
135
+ }
136
+ if (toast.toasterId !== toasterId) {
137
+ return;
138
+ }
139
+ if (native) {
140
+ var handled = dispatchNativeToast(toast, {
141
+ duration,
142
+ burntOptions: burntOptionsRef.current,
143
+ notificationOptions: notificationOptionsRef.current
144
+ });
145
+ if (handled) return;
146
+ }
147
+ setToasts(function(toasts2) {
148
+ var idx = toasts2.findIndex(function(t) {
149
+ return t.id === toast.id;
150
+ });
151
+ if (idx !== -1) {
152
+ return [
153
+ ...toasts2.slice(0, idx),
154
+ {
155
+ ...toasts2[idx],
156
+ ...toast
157
+ },
158
+ ...toasts2.slice(idx + 1)
159
+ ];
160
+ }
161
+ return [toast, ...toasts2];
162
+ });
163
+ });
164
+ }, [
165
+ native,
166
+ duration,
167
+ toasterId
168
+ ]);
169
+ var prevToastCountRef = React.useRef(toasts.length);
170
+ React.useEffect(function() {
171
+ var prevCount = prevToastCountRef.current;
172
+ prevToastCountRef.current = toasts.length;
173
+ if (toasts.length <= 1 && !dismissCooldownRef.current) {
174
+ setExpanded(false);
175
+ } else if (toasts.length > prevCount && expanded) {
176
+ setExpanded(false);
177
+ }
178
+ }, [toasts.length, expanded]);
179
+ var removeToast = React.useCallback(function(toastToRemove) {
180
+ setToasts(function(toasts2) {
181
+ var _toasts_find;
182
+ if (!((_toasts_find = toasts2.find(function(t) {
183
+ return t.id === toastToRemove.id;
184
+ })) === null || _toasts_find === void 0 ? void 0 : _toasts_find.delete)) {
185
+ ToastState.dismiss(toastToRemove.id);
186
+ }
187
+ return toasts2.filter(function(param) {
188
+ var { id } = param;
189
+ return id !== toastToRemove.id;
190
+ });
191
+ });
192
+ }, []);
193
+ var swipeDirection = resolveSwipeDirection(swipeDirectionProp, position);
194
+ var currentTheme = useThemeName();
195
+ var resolvedTheme = themeProp === "system" || !themeProp ? (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.includes("dark")) ? "dark" : "light" : themeProp;
196
+ var contextValue = {
197
+ toasts,
198
+ heights,
199
+ setToastHeight,
200
+ removeToastHeight,
201
+ expanded,
202
+ setExpanded,
203
+ interacting,
204
+ setInteracting,
205
+ triggerDismissCooldown,
206
+ isInDismissCooldown,
207
+ removeToast,
208
+ position,
209
+ duration,
210
+ gap,
211
+ visibleToasts,
212
+ swipeDirection,
213
+ swipeThreshold,
214
+ toastHeight,
215
+ closeButton,
216
+ reducedMotion,
217
+ native,
218
+ burntOptions,
219
+ notificationOptions,
220
+ icons
221
+ };
222
+ return /* @__PURE__ */ jsx(ToastContext.Provider, {
223
+ ...contextValue,
224
+ children: /* @__PURE__ */ jsx(Theme, {
225
+ name: resolvedTheme,
226
+ children
227
+ })
228
+ });
239
229
  });
240
230
  var ToastViewportFrame = styled(View, {
241
- name: "ToastViewport",
242
- variants: {
243
- unstyled: {
244
- false: {
245
- position: isWeb ? "fixed" : "absolute",
246
- zIndex: 1e5,
247
- pointerEvents: "box-none",
248
- maxWidth: "100%",
249
- ...(isWeb && {
250
- width: 356
251
- }),
252
- minHeight: 1
253
- }
254
- }
255
- },
256
- defaultVariants: {
257
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
258
- }
231
+ displayName: "ToastViewport",
232
+ position: isWeb ? "fixed" : "absolute",
233
+ zIndex: 1e5,
234
+ pointerEvents: "box-none",
235
+ maxWidth: "100%",
236
+ ...isWeb && { width: 356 },
237
+ minHeight: 1
259
238
  });
260
- var ToastViewport = ToastViewportFrame.styleable(function ToastViewport2(props, ref) {
261
- var {
262
- offset = VIEWPORT_OFFSET,
263
- hotkey = DEFAULT_HOTKEY,
264
- label = "Notifications",
265
- portalToRoot = true,
266
- portalZIndex = Number.MAX_SAFE_INTEGER,
267
- children,
268
- ...rest
269
- } = props;
270
- var ctx = useToastContext("Toast.Viewport");
271
- var listRef = React.useRef(null);
272
- var hoverTimeoutRef = React.useRef(null);
273
- var hoverCooldownRef = React.useRef(false);
274
- var deferredCollapseRef = React.useRef(null);
275
- var mouseInsideRef = React.useRef(false);
276
- var [yPosition, xPosition] = ctx.position.split("-");
277
- var {
278
- insets: safeInsets
279
- } = useConfiguration();
280
- var offsetStyles = React.useMemo(function () {
281
- var styles = {};
282
- var defaultOffset = typeof offset === "number" ? offset : VIEWPORT_OFFSET;
283
- var offsetObj = (typeof offset === "undefined" ? "undefined" : _type_of(offset)) === "object" ? offset : {
284
- top: defaultOffset,
285
- right: defaultOffset,
286
- bottom: defaultOffset,
287
- left: defaultOffset
288
- };
289
- var _safeInsets_top;
290
- var safeTop = (_safeInsets_top = safeInsets === null || safeInsets === void 0 ? void 0 : safeInsets.top) !== null && _safeInsets_top !== void 0 ? _safeInsets_top : 0;
291
- var _safeInsets_bottom;
292
- var safeBottom = (_safeInsets_bottom = safeInsets === null || safeInsets === void 0 ? void 0 : safeInsets.bottom) !== null && _safeInsets_bottom !== void 0 ? _safeInsets_bottom : 0;
293
- var _offsetObj_top;
294
- var topOffset = safeTop > 0 ? safeTop : (_offsetObj_top = offsetObj.top) !== null && _offsetObj_top !== void 0 ? _offsetObj_top : defaultOffset;
295
- var _offsetObj_bottom;
296
- var bottomOffset = safeBottom > 0 ? safeBottom : (_offsetObj_bottom = offsetObj.bottom) !== null && _offsetObj_bottom !== void 0 ? _offsetObj_bottom : defaultOffset;
297
- if (yPosition === "top") styles.top = topOffset;else styles.bottom = bottomOffset;
298
- if (isWeb) {
299
- var _offsetObj_left, _offsetObj_right;
300
- if (xPosition === "left") styles.left = (_offsetObj_left = offsetObj.left) !== null && _offsetObj_left !== void 0 ? _offsetObj_left : defaultOffset;else if (xPosition === "right") styles.right = (_offsetObj_right = offsetObj.right) !== null && _offsetObj_right !== void 0 ? _offsetObj_right : defaultOffset;else {
301
- styles.left = "50%";
302
- styles.transform = "translateX(-50%)";
303
- }
304
- } else {
305
- var _offsetObj_left1;
306
- styles.left = (_offsetObj_left1 = offsetObj.left) !== null && _offsetObj_left1 !== void 0 ? _offsetObj_left1 : defaultOffset;
307
- var _offsetObj_right1;
308
- styles.right = (_offsetObj_right1 = offsetObj.right) !== null && _offsetObj_right1 !== void 0 ? _offsetObj_right1 : defaultOffset;
309
- }
310
- return styles;
311
- }, [offset, yPosition, xPosition]);
312
- React.useEffect(function () {
313
- if (!isWeb) return;
314
- var handleKeyDown = function (event) {
315
- var isHotkeyPressed = hotkey.length > 0 && hotkey.every(function (key) {
316
- return event[key] || event.code === key;
317
- });
318
- if (isHotkeyPressed) {
319
- var _listRef_current;
320
- ctx.setExpanded(true);
321
- (_listRef_current = listRef.current) === null || _listRef_current === void 0 ? void 0 : _listRef_current.focus();
322
- }
323
- };
324
- document.addEventListener("keydown", handleKeyDown);
325
- return function () {
326
- return document.removeEventListener("keydown", handleKeyDown);
327
- };
328
- }, [hotkey]);
329
- if (ctx.toasts.length === 0) return null;
330
- var hotkeyLabel = hotkey.join("+").replace(/Key/g, "").replace(/Digit/g, "");
331
- var content = /* @__PURE__ */_jsx(ToastViewportFrame, {
332
- ref: listRef,
333
- "aria-label": `${label} ${hotkeyLabel}`,
334
- tabIndex: -1,
335
- "aria-live": "polite",
336
- style: offsetStyles,
337
- "data-y-position": yPosition,
338
- "data-x-position": xPosition,
339
- ...(isWeb ? {
340
- onMouseEnter: function () {
341
- mouseInsideRef.current = true;
342
- if (deferredCollapseRef.current) {
343
- clearTimeout(deferredCollapseRef.current);
344
- deferredCollapseRef.current = null;
345
- }
346
- if (ctx.toasts.length > 1 && !ctx.interacting && !hoverCooldownRef.current) {
347
- hoverTimeoutRef.current = setTimeout(function () {
348
- return ctx.setExpanded(true);
349
- }, 50);
350
- }
351
- },
352
- onMouseLeave: function () {
353
- mouseInsideRef.current = false;
354
- if (hoverTimeoutRef.current) {
355
- clearTimeout(hoverTimeoutRef.current);
356
- hoverTimeoutRef.current = null;
357
- }
358
- if (!ctx.interacting && !ctx.isInDismissCooldown()) {
359
- ctx.setExpanded(false);
360
- } else if (ctx.isInDismissCooldown()) {
361
- if (deferredCollapseRef.current) {
362
- clearTimeout(deferredCollapseRef.current);
363
- }
364
- deferredCollapseRef.current = setTimeout(function () {
365
- deferredCollapseRef.current = null;
366
- if (!mouseInsideRef.current) {
367
- ctx.setExpanded(false);
368
- }
369
- }, 1200);
370
- }
371
- },
372
- onPointerDown: function () {
373
- if (hoverTimeoutRef.current) {
374
- clearTimeout(hoverTimeoutRef.current);
375
- hoverTimeoutRef.current = null;
376
- }
377
- ctx.setInteracting(true);
378
- },
379
- onPointerUp: function () {
380
- return ctx.setInteracting(false);
381
- },
382
- onPointerCancel: function () {
383
- return ctx.setInteracting(false);
384
- }
385
- } : {
386
- onPress: function () {
387
- if (ctx.toasts.length > 1) {
388
- ctx.setExpanded(function (prev) {
389
- return !prev;
390
- });
391
- }
392
- }
393
- }),
394
- ...(isWeb && {
395
- onFocus: function (event) {
396
- if (!event.currentTarget.contains(event.relatedTarget)) {
397
- if (ctx.toasts.length > 1) {
398
- ctx.setExpanded(true);
399
- }
400
- ctx.setInteracting(true);
401
- }
402
- },
403
- onBlur: function (event) {
404
- if (!event.currentTarget.contains(event.relatedTarget)) {
405
- ctx.setInteracting(false);
406
- if (!ctx.isInDismissCooldown()) {
407
- ctx.setExpanded(false);
408
- }
409
- }
410
- }
411
- }),
412
- ...rest,
413
- children
414
- });
415
- if (portalToRoot) {
416
- return /* @__PURE__ */_jsx(Portal, {
417
- zIndex: portalZIndex,
418
- children: /* @__PURE__ */_jsx(ToastContext.Provider, {
419
- ...ctx,
420
- children: content
421
- })
422
- });
423
- }
424
- return content;
239
+ var ToastViewport = createStyledHOC(ToastViewportFrame, function ToastViewport2(props, ref) {
240
+ var { offset = VIEWPORT_OFFSET, hotkey = DEFAULT_HOTKEY, label = "Notifications", portalToRoot = true, portalZIndex = Number.MAX_SAFE_INTEGER, children, ...rest } = props;
241
+ var ctx = useToastContext("Toast.Viewport");
242
+ var listRef = React.useRef(null);
243
+ var hoverTimeoutRef = React.useRef(null);
244
+ var hoverCooldownRef = React.useRef(false);
245
+ var deferredCollapseRef = React.useRef(null);
246
+ var mouseInsideRef = React.useRef(false);
247
+ var [yPosition, xPosition] = ctx.position.split("-");
248
+ var { insets: safeInsets } = useConfiguration();
249
+ var offsetStyles = React.useMemo(function() {
250
+ var styles = {};
251
+ var defaultOffset = typeof offset === "number" ? offset : VIEWPORT_OFFSET;
252
+ var offsetObj = (typeof offset === "undefined" ? "undefined" : _type_of(offset)) === "object" ? offset : {
253
+ top: defaultOffset,
254
+ right: defaultOffset,
255
+ bottom: defaultOffset,
256
+ left: defaultOffset
257
+ };
258
+ var _safeInsets_top;
259
+ var safeTop = (_safeInsets_top = safeInsets === null || safeInsets === void 0 ? void 0 : safeInsets.top) !== null && _safeInsets_top !== void 0 ? _safeInsets_top : 0;
260
+ var _safeInsets_bottom;
261
+ var safeBottom = (_safeInsets_bottom = safeInsets === null || safeInsets === void 0 ? void 0 : safeInsets.bottom) !== null && _safeInsets_bottom !== void 0 ? _safeInsets_bottom : 0;
262
+ var _offsetObj_top;
263
+ var topOffset = safeTop > 0 ? safeTop : (_offsetObj_top = offsetObj.top) !== null && _offsetObj_top !== void 0 ? _offsetObj_top : defaultOffset;
264
+ var _offsetObj_bottom;
265
+ var bottomOffset = safeBottom > 0 ? safeBottom : (_offsetObj_bottom = offsetObj.bottom) !== null && _offsetObj_bottom !== void 0 ? _offsetObj_bottom : defaultOffset;
266
+ if (yPosition === "top") styles.top = topOffset;
267
+ else styles.bottom = bottomOffset;
268
+ if (isWeb) {
269
+ var _offsetObj_left, _offsetObj_right;
270
+ if (xPosition === "left") styles.left = (_offsetObj_left = offsetObj.left) !== null && _offsetObj_left !== void 0 ? _offsetObj_left : defaultOffset;
271
+ else if (xPosition === "right") styles.right = (_offsetObj_right = offsetObj.right) !== null && _offsetObj_right !== void 0 ? _offsetObj_right : defaultOffset;
272
+ else {
273
+ styles.left = "50%";
274
+ styles.transform = "translateX(-50%)";
275
+ }
276
+ } else {
277
+ var _offsetObj_left1;
278
+ styles.left = (_offsetObj_left1 = offsetObj.left) !== null && _offsetObj_left1 !== void 0 ? _offsetObj_left1 : defaultOffset;
279
+ var _offsetObj_right1;
280
+ styles.right = (_offsetObj_right1 = offsetObj.right) !== null && _offsetObj_right1 !== void 0 ? _offsetObj_right1 : defaultOffset;
281
+ }
282
+ return styles;
283
+ }, [
284
+ offset,
285
+ yPosition,
286
+ xPosition
287
+ ]);
288
+ React.useEffect(function() {
289
+ if (!isWeb) return;
290
+ var handleKeyDown = function(event) {
291
+ var isHotkeyPressed = hotkey.length > 0 && hotkey.every(function(key) {
292
+ return event[key] || event.code === key;
293
+ });
294
+ if (isHotkeyPressed) {
295
+ var _listRef_current;
296
+ ctx.setExpanded(true);
297
+ (_listRef_current = listRef.current) === null || _listRef_current === void 0 ? void 0 : _listRef_current.focus();
298
+ }
299
+ };
300
+ document.addEventListener("keydown", handleKeyDown);
301
+ return function() {
302
+ return document.removeEventListener("keydown", handleKeyDown);
303
+ };
304
+ }, [hotkey]);
305
+ if (ctx.toasts.length === 0) return null;
306
+ var hotkeyLabel = hotkey.join("+").replace(/Key/g, "").replace(/Digit/g, "");
307
+ var content = /* @__PURE__ */ jsx(ToastViewportFrame, {
308
+ ref: listRef,
309
+ "aria-label": `${label} ${hotkeyLabel}`,
310
+ tabIndex: -1,
311
+ "aria-live": "polite",
312
+ style: offsetStyles,
313
+ "data-y-position": yPosition,
314
+ "data-x-position": xPosition,
315
+ ...isWeb ? {
316
+ onMouseEnter: function() {
317
+ mouseInsideRef.current = true;
318
+ if (deferredCollapseRef.current) {
319
+ clearTimeout(deferredCollapseRef.current);
320
+ deferredCollapseRef.current = null;
321
+ }
322
+ if (ctx.toasts.length > 1 && !ctx.interacting && !hoverCooldownRef.current) {
323
+ hoverTimeoutRef.current = setTimeout(function() {
324
+ return ctx.setExpanded(true);
325
+ }, 50);
326
+ }
327
+ },
328
+ onMouseLeave: function() {
329
+ mouseInsideRef.current = false;
330
+ if (hoverTimeoutRef.current) {
331
+ clearTimeout(hoverTimeoutRef.current);
332
+ hoverTimeoutRef.current = null;
333
+ }
334
+ if (!ctx.interacting && !ctx.isInDismissCooldown()) {
335
+ ctx.setExpanded(false);
336
+ } else if (ctx.isInDismissCooldown()) {
337
+ if (deferredCollapseRef.current) {
338
+ clearTimeout(deferredCollapseRef.current);
339
+ }
340
+ deferredCollapseRef.current = setTimeout(function() {
341
+ deferredCollapseRef.current = null;
342
+ if (!mouseInsideRef.current) {
343
+ ctx.setExpanded(false);
344
+ }
345
+ }, 1200);
346
+ }
347
+ },
348
+ onPointerDown: function() {
349
+ if (hoverTimeoutRef.current) {
350
+ clearTimeout(hoverTimeoutRef.current);
351
+ hoverTimeoutRef.current = null;
352
+ }
353
+ ctx.setInteracting(true);
354
+ },
355
+ onPointerUp: function() {
356
+ return ctx.setInteracting(false);
357
+ },
358
+ onPointerCancel: function() {
359
+ return ctx.setInteracting(false);
360
+ }
361
+ } : { onPress: function() {
362
+ if (ctx.toasts.length > 1) {
363
+ ctx.setExpanded(function(prev) {
364
+ return !prev;
365
+ });
366
+ }
367
+ } },
368
+ ...isWeb && {
369
+ onFocus: function(event) {
370
+ if (!event.currentTarget.contains(event.relatedTarget)) {
371
+ if (ctx.toasts.length > 1) {
372
+ ctx.setExpanded(true);
373
+ }
374
+ ctx.setInteracting(true);
375
+ }
376
+ },
377
+ onBlur: function(event) {
378
+ if (!event.currentTarget.contains(event.relatedTarget)) {
379
+ ctx.setInteracting(false);
380
+ if (!ctx.isInDismissCooldown()) {
381
+ ctx.setExpanded(false);
382
+ }
383
+ }
384
+ }
385
+ },
386
+ ...rest,
387
+ children
388
+ });
389
+ if (portalToRoot) {
390
+ return /* @__PURE__ */ jsx(Portal, {
391
+ zIndex: portalZIndex,
392
+ children: /* @__PURE__ */ jsx(ToastContext.Provider, {
393
+ ...ctx,
394
+ children: content
395
+ })
396
+ });
397
+ }
398
+ return content;
425
399
  });
426
400
  function ToastList(param) {
427
- var {
428
- renderItem
429
- } = param;
430
- var ctx = useToastContext("Toast.List");
431
- var maxRender = ctx.toasts.length;
432
- return /* @__PURE__ */_jsx(AnimatePresence, {
433
- children: ctx.toasts.slice(0, maxRender).map(function (toast, index) {
434
- var handleClose = function () {
435
- var _toast_onDismiss;
436
- if (toast.dismissible === false) return;
437
- (_toast_onDismiss = toast.onDismiss) === null || _toast_onDismiss === void 0 ? void 0 : _toast_onDismiss.call(toast, toast);
438
- ctx.removeToast(toast);
439
- };
440
- var itemContextValue = {
441
- toast,
442
- handleClose
443
- };
444
- if (!renderItem) {
445
- return /* @__PURE__ */_jsx(ToastItemContext.Provider, {
446
- value: itemContextValue,
447
- children: /* @__PURE__ */_jsx(ToastItemInner, {
448
- toast,
449
- index,
450
- children: /* @__PURE__ */_jsx(DefaultToastContent, {
451
- toast
452
- })
453
- })
454
- }, toast.id);
455
- }
456
- return /* @__PURE__ */_jsx(ToastItemContext.Provider, {
457
- value: itemContextValue,
458
- children: renderItem({
459
- toast,
460
- index,
461
- handleClose
462
- })
463
- }, toast.id);
464
- })
465
- });
401
+ var { renderItem } = param;
402
+ var ctx = useToastContext("Toast.List");
403
+ var maxRender = ctx.toasts.length;
404
+ return /* @__PURE__ */ jsx(AnimatePresence, { children: ctx.toasts.slice(0, maxRender).map(function(toast, index) {
405
+ var handleClose = function() {
406
+ var _toast_onDismiss;
407
+ if (toast.dismissible === false) return;
408
+ (_toast_onDismiss = toast.onDismiss) === null || _toast_onDismiss === void 0 ? void 0 : _toast_onDismiss.call(toast, toast);
409
+ ctx.removeToast(toast);
410
+ };
411
+ var itemContextValue = {
412
+ toast,
413
+ handleClose
414
+ };
415
+ if (!renderItem) {
416
+ return /* @__PURE__ */ jsx(ToastItemContext.Provider, {
417
+ value: itemContextValue,
418
+ children: /* @__PURE__ */ jsx(ToastItemInner, {
419
+ toast,
420
+ index,
421
+ children: /* @__PURE__ */ jsx(DefaultToastContent, { toast })
422
+ })
423
+ }, toast.id);
424
+ }
425
+ return /* @__PURE__ */ jsx(ToastItemContext.Provider, {
426
+ value: itemContextValue,
427
+ children: renderItem({
428
+ toast,
429
+ index,
430
+ handleClose
431
+ })
432
+ }, toast.id);
433
+ }) });
466
434
  }
467
435
  function DefaultToastContent(param) {
468
- var {
469
- toast
470
- } = param;
471
- var ctx = useToastContext("Toast.Item");
472
- var {
473
- handleClose
474
- } = useToastItemContext();
475
- var _toast_type;
476
- var toastType = (_toast_type = toast.type) !== null && _toast_type !== void 0 ? _toast_type : "default";
477
- var dismissible = toast.dismissible !== false;
478
- var title = typeof toast.title === "function" ? toast.title() : toast.title;
479
- var description = typeof toast.description === "function" ? toast.description() : toast.description;
480
- return /* @__PURE__ */_jsxs(XStack, {
481
- alignItems: "flex-start",
482
- gap: "$3",
483
- children: [/* @__PURE__ */_jsx(ToastIcon, {}), /* @__PURE__ */_jsxs(YStack, {
484
- flex: 1,
485
- gap: "$1",
486
- children: [title && /* @__PURE__ */_jsx(ToastTitle, {
487
- children: title
488
- }), description && /* @__PURE__ */_jsx(ToastDescription, {
489
- children: description
490
- }), (toast.action || toast.cancel) && /* @__PURE__ */_jsxs(XStack, {
491
- gap: "$2",
492
- marginTop: "$2",
493
- children: [toast.cancel && /* @__PURE__ */_jsx(ToastActionFrame, {
494
- backgroundColor: "transparent",
495
- onPress: function (e) {
496
- var _toast_cancel_onClick, _toast_cancel;
497
- (_toast_cancel = toast.cancel) === null || _toast_cancel === void 0 ? void 0 : (_toast_cancel_onClick = _toast_cancel.onClick) === null || _toast_cancel_onClick === void 0 ? void 0 : _toast_cancel_onClick.call(_toast_cancel, e);
498
- handleClose();
499
- },
500
- children: /* @__PURE__ */_jsx(SizableText, {
501
- size: "$2",
502
- color: "$color11",
503
- children: toast.cancel.label
504
- })
505
- }), toast.action && /* @__PURE__ */_jsx(ToastActionFrame, {
506
- backgroundColor: "$color12",
507
- hoverStyle: {
508
- backgroundColor: "$color11"
509
- },
510
- pressStyle: {
511
- backgroundColor: "$color10"
512
- },
513
- onPress: function (e) {
514
- var _toast_action_onClick, _toast_action;
515
- (_toast_action = toast.action) === null || _toast_action === void 0 ? void 0 : (_toast_action_onClick = _toast_action.onClick) === null || _toast_action_onClick === void 0 ? void 0 : _toast_action_onClick.call(_toast_action, e);
516
- if (!e.defaultPrevented) {
517
- handleClose();
518
- }
519
- },
520
- children: /* @__PURE__ */_jsx(SizableText, {
521
- size: "$2",
522
- fontWeight: "600",
523
- color: "$background",
524
- children: toast.action.label
525
- })
526
- })]
527
- })]
528
- }), ctx.closeButton && dismissible && /* @__PURE__ */_jsx(ToastClose, {})]
529
- });
436
+ var { toast } = param;
437
+ var ctx = useToastContext("Toast.Item");
438
+ var { handleClose } = useToastItemContext();
439
+ var _toast_type;
440
+ var toastType = (_toast_type = toast.type) !== null && _toast_type !== void 0 ? _toast_type : "default";
441
+ var dismissible = toast.dismissible !== false;
442
+ var title = typeof toast.title === "function" ? toast.title() : toast.title;
443
+ var description = typeof toast.description === "function" ? toast.description() : toast.description;
444
+ return /* @__PURE__ */ jsxs(XStack, {
445
+ alignItems: "flex-start",
446
+ gap: "3",
447
+ children: [
448
+ /* @__PURE__ */ jsx(ToastIcon, {}),
449
+ /* @__PURE__ */ jsxs(YStack, {
450
+ flex: 1,
451
+ gap: "1",
452
+ children: [
453
+ title && /* @__PURE__ */ jsx(ToastTitle, { children: title }),
454
+ description && /* @__PURE__ */ jsx(ToastDescription, { children: description }),
455
+ (toast.action || toast.cancel) && /* @__PURE__ */ jsxs(XStack, {
456
+ gap: "2",
457
+ marginTop: "2",
458
+ children: [toast.cancel && /* @__PURE__ */ jsx(ToastActionFrame, {
459
+ onPress: function(e) {
460
+ var _toast_cancel_onClick, _toast_cancel;
461
+ (_toast_cancel = toast.cancel) === null || _toast_cancel === void 0 ? void 0 : (_toast_cancel_onClick = _toast_cancel.onClick) === null || _toast_cancel_onClick === void 0 ? void 0 : _toast_cancel_onClick.call(_toast_cancel, e);
462
+ handleClose();
463
+ },
464
+ children: /* @__PURE__ */ jsx(SizableText, {
465
+ size: "2",
466
+ children: toast.cancel.label
467
+ })
468
+ }), toast.action && /* @__PURE__ */ jsx(ToastActionFrame, {
469
+ onPress: function(e) {
470
+ var _toast_action_onClick, _toast_action;
471
+ (_toast_action = toast.action) === null || _toast_action === void 0 ? void 0 : (_toast_action_onClick = _toast_action.onClick) === null || _toast_action_onClick === void 0 ? void 0 : _toast_action_onClick.call(_toast_action, e);
472
+ if (!e.defaultPrevented) {
473
+ handleClose();
474
+ }
475
+ },
476
+ children: /* @__PURE__ */ jsx(SizableText, {
477
+ size: "2",
478
+ children: toast.action.label
479
+ })
480
+ })]
481
+ })
482
+ ]
483
+ }),
484
+ ctx.closeButton && dismissible && /* @__PURE__ */ jsx(ToastClose, {})
485
+ ]
486
+ });
530
487
  }
531
488
  function DragWrapper(param) {
532
- var {
533
- animatedStyle,
534
- gestureHandlers,
535
- gesture,
536
- AnimatedView,
537
- dragRef,
538
- children
539
- } = param;
540
- if (isWeb) {
541
- return /* @__PURE__ */_jsx("div", {
542
- ref: dragRef,
543
- style: {
544
- flex: 1,
545
- display: "flex",
546
- flexDirection: "column",
547
- userSelect: "none",
548
- WebkitUserSelect: "none",
549
- touchAction: "none",
550
- cursor: "default"
551
- },
552
- ...gestureHandlers,
553
- children
554
- });
555
- }
556
- if (gesture) {
557
- var gh = getGestureHandler();
558
- var GestureDetector = gh.state.GestureDetector;
559
- if (GestureDetector) {
560
- return /* @__PURE__ */_jsx(GestureDetector, {
561
- gesture,
562
- children: /* @__PURE__ */_jsx(View, {
563
- style: {
564
- flex: 1
565
- },
566
- ...{
567
- collapsable: false
568
- },
569
- children: /* @__PURE__ */_jsx(AnimatedView, {
570
- style: [{
571
- flex: 1
572
- }, animatedStyle],
573
- children
574
- })
575
- })
576
- });
577
- }
578
- }
579
- return /* @__PURE__ */_jsx(AnimatedView, {
580
- style: [{
581
- flex: 1
582
- }, animatedStyle],
583
- ...gestureHandlers,
584
- children
585
- });
489
+ var { animatedStyle, gestureHandlers, gesture, AnimatedView, dragRef, children } = param;
490
+ if (isWeb) {
491
+ return /* @__PURE__ */ jsx("div", {
492
+ ref: dragRef,
493
+ style: {
494
+ flex: 1,
495
+ display: "flex",
496
+ flexDirection: "column",
497
+ userSelect: "none",
498
+ WebkitUserSelect: "none",
499
+ touchAction: "none",
500
+ cursor: "default"
501
+ },
502
+ ...gestureHandlers,
503
+ children
504
+ });
505
+ }
506
+ if (gesture) {
507
+ var gh = getGestureHandler();
508
+ var GestureDetector = gh.state.GestureDetector;
509
+ if (GestureDetector) {
510
+ return /* @__PURE__ */ jsx(GestureDetector, {
511
+ gesture,
512
+ children: /* @__PURE__ */ jsx(View, {
513
+ style: { flex: 1 },
514
+ ...{ collapsable: false },
515
+ children: /* @__PURE__ */ jsx(AnimatedView, {
516
+ style: [{ flex: 1 }, animatedStyle],
517
+ children
518
+ })
519
+ })
520
+ });
521
+ }
522
+ }
523
+ return /* @__PURE__ */ jsx(AnimatedView, {
524
+ style: [{ flex: 1 }, animatedStyle],
525
+ ...gestureHandlers,
526
+ children
527
+ });
586
528
  }
587
- var ToastItemInner = ToastItemFrame.styleable(function ToastItem(props, ref) {
588
- var {
589
- toast,
590
- index,
591
- children,
592
- ...rest
593
- } = props;
594
- var ctx = useToastContext("Toast.Item");
595
- var [mounted, setMounted] = React.useState(false);
596
- var [removed, setRemoved] = React.useState(false);
597
- var [swipeOut, setSwipeOut] = React.useState(false);
598
- var [offsetBeforeRemove, setOffsetBeforeRemove] = React.useState(0);
599
- var swipeExitYRef = React.useRef(null);
600
- var closeTimerRef = React.useRef(null);
601
- var closeTimerStartRef = React.useRef(0);
602
- var lastPauseTimeRef = React.useRef(0);
603
- var _toast_duration;
604
- var remainingTimeRef = React.useRef((_toast_duration = toast.duration) !== null && _toast_duration !== void 0 ? _toast_duration : ctx.duration);
605
- var isFront = index === 0;
606
- var isVisible = index < ctx.visibleToasts;
607
- var _toast_type;
608
- var toastType = (_toast_type = toast.type) !== null && _toast_type !== void 0 ? _toast_type : "default";
609
- var dismissible = toast.dismissible !== false;
610
- var _toast_duration1;
611
- var duration = (_toast_duration1 = toast.duration) !== null && _toast_duration1 !== void 0 ? _toast_duration1 : ctx.duration;
612
- var [yPosition] = ctx.position.split("-");
613
- var isTop = yPosition === "top";
614
- var expandedOffset = isWeb ? function () {
615
- var totalHeight = 0;
616
- var activeCount = 0;
617
- for (var i = 0; i < index; i++) {
618
- var _ctx_toasts_i;
619
- var toastId = (_ctx_toasts_i = ctx.toasts[i]) === null || _ctx_toasts_i === void 0 ? void 0 : _ctx_toasts_i.id;
620
- if (toastId == null) continue;
621
- var h2 = ctx.heights[toastId];
622
- if (h2 === 0) continue;
623
- totalHeight += h2 !== null && h2 !== void 0 ? h2 : ctx.toastHeight;
624
- activeCount++;
625
- }
626
- return totalHeight + activeCount * ctx.gap;
627
- }() : index * (ctx.toastHeight + ctx.gap);
628
- var expandedOffsetRef = React.useRef(expandedOffset);
629
- expandedOffsetRef.current = expandedOffset;
630
- var isExpandedRef = React.useRef(ctx.expanded);
631
- isExpandedRef.current = ctx.expanded;
632
- var startTimer = React.useCallback(function () {
633
- if (duration === Number.POSITIVE_INFINITY || toastType === "loading") return;
634
- closeTimerStartRef.current = Date.now();
635
- closeTimerRef.current = setTimeout(function () {
636
- var _toast_onAutoClose;
637
- (_toast_onAutoClose = toast.onAutoClose) === null || _toast_onAutoClose === void 0 ? void 0 : _toast_onAutoClose.call(toast, toast);
638
- setRemoved(true);
639
- setTimeout(function () {
640
- return ctx.removeToast(toast);
641
- }, TIME_BEFORE_UNMOUNT);
642
- }, remainingTimeRef.current);
643
- }, [duration, toastType, toast, ctx.removeToast]);
644
- var pauseTimer = useEvent(function () {
645
- if (closeTimerRef.current) {
646
- clearTimeout(closeTimerRef.current);
647
- }
648
- if (lastPauseTimeRef.current < closeTimerStartRef.current) {
649
- var elapsed = Date.now() - closeTimerStartRef.current;
650
- remainingTimeRef.current = Math.max(0, remainingTimeRef.current - elapsed);
651
- }
652
- lastPauseTimeRef.current = Date.now();
653
- });
654
- var resumeTimer = useEvent(function () {
655
- if (ctx.expanded || ctx.interacting) return;
656
- remainingTimeRef.current = duration;
657
- startTimer();
658
- });
659
- React.useEffect(function () {
660
- setMounted(true);
661
- }, []);
662
- React.useEffect(function () {
663
- if (toast.delete) {
664
- setRemoved(true);
665
- if (isExpandedRef.current) {
666
- setOffsetBeforeRemove(expandedOffsetRef.current);
667
- }
668
- setTimeout(function () {
669
- return ctx.removeToast(toast);
670
- }, TIME_BEFORE_UNMOUNT);
671
- }
672
- }, [toast.delete, toast, ctx.removeToast]);
673
- React.useEffect(function () {
674
- if (ctx.expanded || ctx.interacting) {
675
- pauseTimer();
676
- } else {
677
- startTimer();
678
- }
679
- return function () {
680
- if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
681
- };
682
- }, [ctx.expanded, ctx.interacting, startTimer]);
683
- React.useEffect(function () {
684
- remainingTimeRef.current = duration;
685
- }, [duration]);
686
- var {
687
- setDragOffset,
688
- springBack,
689
- animateOut,
690
- animatedStyle,
691
- AnimatedView,
692
- dragRef
693
- } = useToastAnimations({
694
- reducedMotion: ctx.reducedMotion,
695
- swipeAxis: ctx.swipeDirection === "up" || ctx.swipeDirection === "down" || ctx.swipeDirection === "vertical" ? "vertical" : "horizontal"
696
- });
697
- var {
698
- isDragging,
699
- gestureHandlers,
700
- gesture
701
- } = useAnimatedDragGesture({
702
- direction: ctx.swipeDirection,
703
- threshold: ctx.swipeThreshold,
704
- disabled: !dismissible || toastType === "loading",
705
- expanded: ctx.expanded,
706
- onDragStart: pauseTimer,
707
- onDragMove: setDragOffset,
708
- onDismiss: function (exitDirection, velocity) {
709
- var _toast_onDismiss;
710
- ctx.triggerDismissCooldown();
711
- setSwipeOut(true);
712
- (_toast_onDismiss = toast.onDismiss) === null || _toast_onDismiss === void 0 ? void 0 : _toast_onDismiss.call(toast, toast);
713
- swipeExitYRef.current = isExpandedRef.current ? isTop ? expandedOffsetRef.current : -expandedOffsetRef.current : isFront ? 0 : isTop ? ctx.gap * index : -ctx.gap * index;
714
- setRemoved(true);
715
- ctx.removeToast(toast);
716
- animateOut(exitDirection, velocity);
717
- },
718
- onCancel: function () {
719
- springBack(function () {
720
- resumeTimer();
721
- });
722
- }
723
- });
724
- var handleLayout = React.useCallback(function (event) {
725
- if (!isWeb) return;
726
- if (removed) return;
727
- if (!ctx.expanded && index !== 0) return;
728
- var {
729
- height
730
- } = event.nativeEvent.layout;
731
- ctx.setToastHeight(toast.id, height);
732
- }, [toast.id, ctx.setToastHeight, index, ctx.expanded, removed]);
733
- React.useEffect(function () {
734
- if (!isWeb) return;
735
- return function () {
736
- ctx.removeToastHeight(toast.id);
737
- };
738
- }, [toast.id, ctx.removeToastHeight]);
739
- var handleClose = React.useCallback(function () {
740
- var _toast_onDismiss;
741
- if (!dismissible) return;
742
- ctx.triggerDismissCooldown();
743
- (_toast_onDismiss = toast.onDismiss) === null || _toast_onDismiss === void 0 ? void 0 : _toast_onDismiss.call(toast, toast);
744
- setRemoved(true);
745
- if (isExpandedRef.current) {
746
- setOffsetBeforeRemove(expandedOffsetRef.current);
747
- }
748
- setTimeout(function () {
749
- return ctx.removeToast(toast);
750
- }, TIME_BEFORE_UNMOUNT);
751
- }, [dismissible, toast, ctx.removeToast, ctx.triggerDismissCooldown]);
752
- var itemContextValue = React.useMemo(function () {
753
- return {
754
- toast,
755
- handleClose
756
- };
757
- }, [toast, handleClose]);
758
- var frontToastHeight = -1;
759
- if (isWeb) {
760
- var _iteratorNormalCompletion = true,
761
- _didIteratorError = false,
762
- _iteratorError = void 0;
763
- try {
764
- for (var _iterator = ctx.toasts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
765
- var t = _step.value;
766
- var h = ctx.heights[t.id];
767
- if (h != null && h > 0) {
768
- frontToastHeight = h;
769
- break;
770
- }
771
- }
772
- } catch (err) {
773
- _didIteratorError = true;
774
- _iteratorError = err;
775
- } finally {
776
- try {
777
- if (!_iteratorNormalCompletion && _iterator.return != null) {
778
- _iterator.return();
779
- }
780
- } finally {
781
- if (_didIteratorError) {
782
- throw _iteratorError;
783
- }
784
- }
785
- }
786
- }
787
- var stackScale = !ctx.expanded && !isFront ? 1 - index * 0.05 : 1;
788
- var activeExpandedOffset = removed ? offsetBeforeRemove : expandedOffset;
789
- var stackY = ctx.expanded ? isTop ? activeExpandedOffset : -activeExpandedOffset : isFront ? 0 : isTop ? ctx.gap * index : -ctx.gap * index;
790
- var computedOpacity = removed && !swipeOut ? 0 : index >= ctx.visibleToasts ? 0 : 1;
791
- var computedZIndex = removed ? 0 : ctx.visibleToasts - index + 1;
792
- var computedHeight = isWeb ? ctx.expanded ? ctx.heights[toast.id] || void 0 : !isFront && frontToastHeight > 0 ? frontToastHeight : void 0 : void 0;
793
- var computedPointerEvents = index >= ctx.visibleToasts ? "none" : "auto";
794
- var gapFillerHeight = ctx.expanded ? ctx.gap + 1 : 0;
795
- var dataAttributes = {
796
- "data-mounted": mounted ? "true" : "false",
797
- "data-removed": removed ? "true" : "false",
798
- "data-swipe-out": swipeOut ? "true" : "false",
799
- "data-visible": isVisible ? "true" : "false",
800
- "data-front": isFront ? "true" : "false",
801
- "data-index": String(index),
802
- "data-type": toastType,
803
- "data-expanded": ctx.expanded ? "true" : "false"
804
- };
805
- var _swipeExitYRef_current;
806
- return /* @__PURE__ */_jsx(ToastPositionWrapper, {
807
- ref,
808
- testID: rest.testID,
809
- accessibilityLabel: rest.accessibilityLabel,
810
- ...dataAttributes,
811
- transition: isDragging || ctx.reducedMotion ? void 0 : removed ? "200ms" : "400ms",
812
- animateOnly: isWeb ? ["transform", "opacity", "height"] : ["transform", "opacity"],
813
- y: stackY,
814
- scale: stackScale,
815
- opacity: computedOpacity,
816
- zIndex: computedZIndex,
817
- height: computedHeight,
818
- overflow: "visible",
819
- pointerEvents: computedPointerEvents,
820
- top: isTop ? 0 : void 0,
821
- bottom: isTop ? void 0 : 0,
822
- ...(isWeb && !isFront && {
823
- style: {
824
- transformOrigin: isTop ? "top center" : "bottom center"
825
- }
826
- }),
827
- enterStyle: ctx.reducedMotion ? {
828
- opacity: 0
829
- } : {
830
- opacity: 0,
831
- y: isTop ? -80 : 80
832
- },
833
- exitStyle: ctx.reducedMotion ? {
834
- opacity: 0
835
- } : swipeOut ? {
836
- opacity: 0,
837
- y: (_swipeExitYRef_current = swipeExitYRef.current) !== null && _swipeExitYRef_current !== void 0 ? _swipeExitYRef_current : stackY,
838
- scale: stackScale
839
- } : {
840
- opacity: 0,
841
- y: stackY,
842
- scale: stackScale
843
- },
844
- children: /* @__PURE__ */_jsx(DragWrapper, {
845
- animatedStyle,
846
- gestureHandlers,
847
- gesture,
848
- AnimatedView,
849
- dragRef,
850
- children: /* @__PURE__ */_jsxs(ToastItemFrame, {
851
- role: "status",
852
- "aria-live": "polite",
853
- "aria-atomic": true,
854
- tabIndex: 0,
855
- onLayout: handleLayout,
856
- ...(isWeb && {
857
- onKeyDown: function (event) {
858
- if (event.key === "Escape" && dismissible) {
859
- var current = event.currentTarget;
860
- var container = current.closest("[aria-label]");
861
- if (container) {
862
- var focusables = container.querySelectorAll('[tabindex="0"]');
863
- var arr = Array.from(focusables);
864
- var idx = arr.indexOf(current);
865
- var next = arr[idx + 1] || arr[idx - 1];
866
- next === null || next === void 0 ? void 0 : next.focus();
867
- }
868
- handleClose();
869
- }
870
- }
871
- }),
872
- ...rest,
873
- children: [/* gap filler to prevent hover flicker */
874
- ctx.expanded && gapFillerHeight > 0 && /* @__PURE__ */_jsx(View, {
875
- position: "absolute",
876
- left: 0,
877
- right: 0,
878
- height: gapFillerHeight,
879
- pointerEvents: "auto",
880
- ...(isTop ? {
881
- top: "100%"
882
- } : {
883
- bottom: "100%"
884
- })
885
- }), /* @__PURE__ */_jsx(ToastItemContext.Provider, {
886
- value: itemContextValue,
887
- children
888
- })]
889
- })
890
- })
891
- });
892
- });
893
- var ToastTitle = styled(SizableText, {
894
- name: "ToastTitle",
895
- variants: {
896
- unstyled: {
897
- false: {
898
- color: "$color",
899
- fontWeight: "600",
900
- size: "$4"
901
- }
902
- }
903
- },
904
- defaultVariants: {
905
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
906
- }
529
+ var ToastItemInner = createStyledHOC(ToastItemFrame, function ToastItem(props, ref) {
530
+ var { toast, index, children, ...rest } = props;
531
+ var ctx = useToastContext("Toast.Item");
532
+ var [mounted, setMounted] = React.useState(false);
533
+ var [removed, setRemoved] = React.useState(false);
534
+ var [swipeOut, setSwipeOut] = React.useState(false);
535
+ var [offsetBeforeRemove, setOffsetBeforeRemove] = React.useState(0);
536
+ var swipeExitYRef = React.useRef(null);
537
+ var closeTimerRef = React.useRef(null);
538
+ var closeTimerStartRef = React.useRef(0);
539
+ var lastPauseTimeRef = React.useRef(0);
540
+ var _toast_duration;
541
+ var remainingTimeRef = React.useRef((_toast_duration = toast.duration) !== null && _toast_duration !== void 0 ? _toast_duration : ctx.duration);
542
+ var isFront = index === 0;
543
+ var isVisible = index < ctx.visibleToasts;
544
+ var _toast_type;
545
+ var toastType = (_toast_type = toast.type) !== null && _toast_type !== void 0 ? _toast_type : "default";
546
+ var dismissible = toast.dismissible !== false;
547
+ var _toast_duration1;
548
+ var duration = (_toast_duration1 = toast.duration) !== null && _toast_duration1 !== void 0 ? _toast_duration1 : ctx.duration;
549
+ var [yPosition] = ctx.position.split("-");
550
+ var isTop = yPosition === "top";
551
+ var expandedOffset = isWeb ? (function() {
552
+ var totalHeight = 0;
553
+ var activeCount = 0;
554
+ for (var i = 0; i < index; i++) {
555
+ var _ctx_toasts_i;
556
+ var toastId = (_ctx_toasts_i = ctx.toasts[i]) === null || _ctx_toasts_i === void 0 ? void 0 : _ctx_toasts_i.id;
557
+ if (toastId == null) continue;
558
+ var h2 = ctx.heights[toastId];
559
+ if (h2 === 0) continue;
560
+ totalHeight += h2 !== null && h2 !== void 0 ? h2 : ctx.toastHeight;
561
+ activeCount++;
562
+ }
563
+ return totalHeight + activeCount * ctx.gap;
564
+ })() : index * (ctx.toastHeight + ctx.gap);
565
+ var expandedOffsetRef = React.useRef(expandedOffset);
566
+ expandedOffsetRef.current = expandedOffset;
567
+ var isExpandedRef = React.useRef(ctx.expanded);
568
+ isExpandedRef.current = ctx.expanded;
569
+ var startTimer = React.useCallback(function() {
570
+ if (duration === Number.POSITIVE_INFINITY || toastType === "loading") return;
571
+ closeTimerStartRef.current = Date.now();
572
+ closeTimerRef.current = setTimeout(function() {
573
+ var _toast_onAutoClose;
574
+ (_toast_onAutoClose = toast.onAutoClose) === null || _toast_onAutoClose === void 0 ? void 0 : _toast_onAutoClose.call(toast, toast);
575
+ setRemoved(true);
576
+ setTimeout(function() {
577
+ return ctx.removeToast(toast);
578
+ }, TIME_BEFORE_UNMOUNT);
579
+ }, remainingTimeRef.current);
580
+ }, [
581
+ duration,
582
+ toastType,
583
+ toast,
584
+ ctx.removeToast
585
+ ]);
586
+ var pauseTimer = useEvent(function() {
587
+ if (closeTimerRef.current) {
588
+ clearTimeout(closeTimerRef.current);
589
+ }
590
+ if (lastPauseTimeRef.current < closeTimerStartRef.current) {
591
+ var elapsed = Date.now() - closeTimerStartRef.current;
592
+ remainingTimeRef.current = Math.max(0, remainingTimeRef.current - elapsed);
593
+ }
594
+ lastPauseTimeRef.current = Date.now();
595
+ });
596
+ var resumeTimer = useEvent(function() {
597
+ if (ctx.expanded || ctx.interacting) return;
598
+ remainingTimeRef.current = duration;
599
+ startTimer();
600
+ });
601
+ React.useEffect(function() {
602
+ setMounted(true);
603
+ }, []);
604
+ React.useEffect(function() {
605
+ if (toast.delete) {
606
+ setRemoved(true);
607
+ if (isExpandedRef.current) {
608
+ setOffsetBeforeRemove(expandedOffsetRef.current);
609
+ }
610
+ setTimeout(function() {
611
+ return ctx.removeToast(toast);
612
+ }, TIME_BEFORE_UNMOUNT);
613
+ }
614
+ }, [
615
+ toast.delete,
616
+ toast,
617
+ ctx.removeToast
618
+ ]);
619
+ React.useEffect(function() {
620
+ if (ctx.expanded || ctx.interacting) {
621
+ pauseTimer();
622
+ } else {
623
+ startTimer();
624
+ }
625
+ return function() {
626
+ if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
627
+ };
628
+ }, [
629
+ ctx.expanded,
630
+ ctx.interacting,
631
+ startTimer
632
+ ]);
633
+ React.useEffect(function() {
634
+ remainingTimeRef.current = duration;
635
+ }, [duration]);
636
+ var { setDragOffset, springBack, animateOut, animatedStyle, AnimatedView, dragRef } = useToastAnimations({ reducedMotion: ctx.reducedMotion });
637
+ var { isDragging, gestureHandlers, gesture } = useAnimatedDragGesture({
638
+ direction: ctx.swipeDirection,
639
+ threshold: ctx.swipeThreshold,
640
+ disabled: !dismissible || toastType === "loading",
641
+ expanded: ctx.expanded,
642
+ onDragStart: pauseTimer,
643
+ onDragMove: setDragOffset,
644
+ onDismiss: function(exitDirection, velocity) {
645
+ var _toast_onDismiss;
646
+ ctx.triggerDismissCooldown();
647
+ setSwipeOut(true);
648
+ (_toast_onDismiss = toast.onDismiss) === null || _toast_onDismiss === void 0 ? void 0 : _toast_onDismiss.call(toast, toast);
649
+ swipeExitYRef.current = isExpandedRef.current ? isTop ? expandedOffsetRef.current : -expandedOffsetRef.current : isFront ? 0 : isTop ? ctx.gap * index : -ctx.gap * index;
650
+ setRemoved(true);
651
+ ctx.removeToast(toast);
652
+ animateOut(exitDirection, velocity);
653
+ },
654
+ onCancel: function() {
655
+ springBack(function() {
656
+ resumeTimer();
657
+ });
658
+ }
659
+ });
660
+ var handleLayout = React.useCallback(function(event) {
661
+ if (!isWeb) return;
662
+ if (removed) return;
663
+ if (!ctx.expanded && index !== 0) return;
664
+ var { height } = event.nativeEvent.layout;
665
+ ctx.setToastHeight(toast.id, height);
666
+ }, [
667
+ toast.id,
668
+ ctx.setToastHeight,
669
+ index,
670
+ ctx.expanded,
671
+ removed
672
+ ]);
673
+ React.useEffect(function() {
674
+ if (!isWeb) return;
675
+ return function() {
676
+ ctx.removeToastHeight(toast.id);
677
+ };
678
+ }, [toast.id, ctx.removeToastHeight]);
679
+ var handleClose = React.useCallback(function() {
680
+ var _toast_onDismiss;
681
+ if (!dismissible) return;
682
+ ctx.triggerDismissCooldown();
683
+ (_toast_onDismiss = toast.onDismiss) === null || _toast_onDismiss === void 0 ? void 0 : _toast_onDismiss.call(toast, toast);
684
+ setRemoved(true);
685
+ if (isExpandedRef.current) {
686
+ setOffsetBeforeRemove(expandedOffsetRef.current);
687
+ }
688
+ setTimeout(function() {
689
+ return ctx.removeToast(toast);
690
+ }, TIME_BEFORE_UNMOUNT);
691
+ }, [
692
+ dismissible,
693
+ toast,
694
+ ctx.removeToast,
695
+ ctx.triggerDismissCooldown
696
+ ]);
697
+ var itemContextValue = React.useMemo(function() {
698
+ return {
699
+ toast,
700
+ handleClose
701
+ };
702
+ }, [toast, handleClose]);
703
+ var frontToastHeight = -1;
704
+ if (isWeb) {
705
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
706
+ try {
707
+ for (var _iterator = ctx.toasts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
708
+ var t = _step.value;
709
+ var h = ctx.heights[t.id];
710
+ if (h != null && h > 0) {
711
+ frontToastHeight = h;
712
+ break;
713
+ }
714
+ }
715
+ } catch (err) {
716
+ _didIteratorError = true;
717
+ _iteratorError = err;
718
+ } finally {
719
+ try {
720
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
721
+ _iterator.return();
722
+ }
723
+ } finally {
724
+ if (_didIteratorError) {
725
+ throw _iteratorError;
726
+ }
727
+ }
728
+ }
729
+ }
730
+ var stackScale = !ctx.expanded && !isFront ? 1 - index * .05 : 1;
731
+ var activeExpandedOffset = removed ? offsetBeforeRemove : expandedOffset;
732
+ var stackY = ctx.expanded ? isTop ? activeExpandedOffset : -activeExpandedOffset : isFront ? 0 : isTop ? ctx.gap * index : -ctx.gap * index;
733
+ var computedOpacity = removed && !swipeOut ? 0 : index >= ctx.visibleToasts ? 0 : 1;
734
+ var computedZIndex = removed ? 0 : ctx.visibleToasts - index + 1;
735
+ var computedHeight = isWeb ? ctx.expanded ? ctx.heights[toast.id] || void 0 : !isFront && frontToastHeight > 0 ? frontToastHeight : void 0 : void 0;
736
+ var computedPointerEvents = index >= ctx.visibleToasts ? "none" : "auto";
737
+ var gapFillerHeight = ctx.expanded ? ctx.gap + 1 : 0;
738
+ var dataAttributes = {
739
+ "data-mounted": mounted ? "true" : "false",
740
+ "data-removed": removed ? "true" : "false",
741
+ "data-swipe-out": swipeOut ? "true" : "false",
742
+ "data-visible": isVisible ? "true" : "false",
743
+ "data-front": isFront ? "true" : "false",
744
+ "data-index": String(index),
745
+ "data-type": toastType,
746
+ "data-expanded": ctx.expanded ? "true" : "false"
747
+ };
748
+ var _swipeExitYRef_current;
749
+ return /* @__PURE__ */ jsx(ToastPositionWrapper, {
750
+ ref,
751
+ testID: rest.testID,
752
+ "aria-label": rest["aria-label"],
753
+ ...dataAttributes,
754
+ transition: isDragging || ctx.reducedMotion ? void 0 : removed ? "200ms" : "400ms",
755
+ y: ctx.reducedMotion ? stackY : `${stackY} enter:${isTop ? -80 : 80}px exit:${swipeOut ? (_swipeExitYRef_current = swipeExitYRef.current) !== null && _swipeExitYRef_current !== void 0 ? _swipeExitYRef_current : stackY : stackY}px`,
756
+ scale: stackScale,
757
+ opacity: `${computedOpacity} enter:0 exit:0`,
758
+ zIndex: computedZIndex,
759
+ height: computedHeight,
760
+ overflow: "visible",
761
+ pointerEvents: computedPointerEvents,
762
+ top: isTop ? 0 : void 0,
763
+ bottom: isTop ? void 0 : 0,
764
+ ...isWeb && !isFront && { style: { transformOrigin: isTop ? "top center" : "bottom center" } },
765
+ animateOnly: isWeb ? [
766
+ "transform",
767
+ "opacity",
768
+ "height"
769
+ ] : ["transform", "opacity"],
770
+ children: /* @__PURE__ */ jsx(DragWrapper, {
771
+ animatedStyle,
772
+ gestureHandlers,
773
+ gesture,
774
+ AnimatedView,
775
+ dragRef,
776
+ children: /* @__PURE__ */ jsxs(ToastItemFrame, {
777
+ role: "status",
778
+ "aria-live": "polite",
779
+ "aria-atomic": true,
780
+ tabIndex: 0,
781
+ onLayout: handleLayout,
782
+ ...isWeb && { onKeyDown: function(event) {
783
+ if (event.key === "Escape" && dismissible) {
784
+ var current = event.currentTarget;
785
+ var container = current.closest("[aria-label]");
786
+ if (container) {
787
+ var focusables = container.querySelectorAll("[tabindex=\"0\"]");
788
+ var arr = Array.from(focusables);
789
+ var idx = arr.indexOf(current);
790
+ var next = arr[idx + 1] || arr[idx - 1];
791
+ next === null || next === void 0 ? void 0 : next.focus();
792
+ }
793
+ handleClose();
794
+ }
795
+ } },
796
+ ...rest,
797
+ children: [ctx.expanded && gapFillerHeight > 0 && /* @__PURE__ */ jsx(View, {
798
+ position: "absolute",
799
+ left: 0,
800
+ right: 0,
801
+ height: gapFillerHeight,
802
+ pointerEvents: "auto",
803
+ ...isTop ? { top: "100%" } : { bottom: "100%" }
804
+ }), /* @__PURE__ */ jsx(ToastItemContext.Provider, {
805
+ value: itemContextValue,
806
+ children
807
+ })]
808
+ })
809
+ })
810
+ });
907
811
  });
908
- var ToastDescription = styled(SizableText, {
909
- name: "ToastDescription",
910
- variants: {
911
- unstyled: {
912
- false: {
913
- color: "$color11",
914
- size: "$2"
915
- }
916
- }
917
- },
918
- defaultVariants: {
919
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
920
- }
812
+ var ToastTitle = styled(SizableText, { displayName: "ToastTitle" });
813
+ var ToastDescription = styled(SizableText, { displayName: "ToastDescription" });
814
+ var ToastClose = createStyledHOC(ToastCloseFrame, function ToastClose2(props, ref) {
815
+ var _ctx_icons;
816
+ var handleClose;
817
+ try {
818
+ var itemCtx = useToastItemContext();
819
+ handleClose = itemCtx.handleClose;
820
+ } catch (e) {}
821
+ var ctx = useToastContext("Toast.Close");
822
+ var _props_children, _ref;
823
+ return /* @__PURE__ */ jsx(ToastCloseFrame, {
824
+ ref,
825
+ "aria-label": "Close toast",
826
+ onPress: handleClose,
827
+ ...props,
828
+ children: (_ref = (_props_children = props.children) !== null && _props_children !== void 0 ? _props_children : (_ctx_icons = ctx.icons) === null || _ctx_icons === void 0 ? void 0 : _ctx_icons.close) !== null && _ref !== void 0 ? _ref : /* @__PURE__ */ jsx(DefaultCloseIcon, {})
829
+ });
921
830
  });
922
- var ToastClose = ToastCloseFrame.styleable(function ToastClose2(props, ref) {
923
- var _ctx_icons;
924
- var handleClose;
925
- try {
926
- var itemCtx = useToastItemContext();
927
- handleClose = itemCtx.handleClose;
928
- } catch (e) {}
929
- var ctx = useToastContext("Toast.Close");
930
- var _props_children, _ref;
931
- return /* @__PURE__ */_jsx(ToastCloseFrame, {
932
- ref,
933
- "aria-label": "Close toast",
934
- onPress: handleClose,
935
- ...props,
936
- children: (_ref = (_props_children = props.children) !== null && _props_children !== void 0 ? _props_children : (_ctx_icons = ctx.icons) === null || _ctx_icons === void 0 ? void 0 : _ctx_icons.close) !== null && _ref !== void 0 ? _ref : /* @__PURE__ */_jsx(DefaultCloseIcon, {})
937
- });
938
- });
939
- var ToastAction = ToastActionFrame.styleable(function ToastAction2(props, ref) {
940
- return /* @__PURE__ */_jsx(ToastActionFrame, {
941
- ref,
942
- ...props
943
- });
831
+ var ToastAction = createStyledHOC(ToastActionFrame, function ToastAction2(props, ref) {
832
+ return /* @__PURE__ */ jsx(ToastActionFrame, {
833
+ ref,
834
+ ...props
835
+ });
944
836
  });
945
837
  function ToastIcon(props) {
946
- var _ctx_icons;
947
- var ctx = useToastContext("Toast.Icon");
948
- var toast;
949
- try {
950
- var itemCtx = useToastItemContext();
951
- toast = itemCtx.toast;
952
- } catch (e) {
953
- return null;
954
- }
955
- if (!toast) return null;
956
- if (toast.icon !== void 0) {
957
- return /* @__PURE__ */_jsx(View, {
958
- flexShrink: 0,
959
- marginTop: "$0.5",
960
- children: toast.icon
961
- });
962
- }
963
- var _toast_type;
964
- var toastType = (_toast_type = toast.type) !== null && _toast_type !== void 0 ? _toast_type : "default";
965
- var _ctx_icons_toastType;
966
- var icon = (_ctx_icons_toastType = (_ctx_icons = ctx.icons) === null || _ctx_icons === void 0 ? void 0 : _ctx_icons[toastType]) !== null && _ctx_icons_toastType !== void 0 ? _ctx_icons_toastType : null;
967
- if (!icon) return null;
968
- return /* @__PURE__ */_jsx(View, {
969
- flexShrink: 0,
970
- marginTop: "$0.5",
971
- children: icon
972
- });
838
+ var _ctx_icons;
839
+ var ctx = useToastContext("Toast.Icon");
840
+ var toast;
841
+ try {
842
+ var itemCtx = useToastItemContext();
843
+ toast = itemCtx.toast;
844
+ } catch (e) {
845
+ return null;
846
+ }
847
+ if (!toast) return null;
848
+ if (toast.icon !== void 0) {
849
+ return /* @__PURE__ */ jsx(View, {
850
+ flexShrink: 0,
851
+ marginTop: "0-5",
852
+ children: toast.icon
853
+ });
854
+ }
855
+ var _toast_type;
856
+ var toastType = (_toast_type = toast.type) !== null && _toast_type !== void 0 ? _toast_type : "default";
857
+ var _ctx_icons_toastType;
858
+ var icon = (_ctx_icons_toastType = (_ctx_icons = ctx.icons) === null || _ctx_icons === void 0 ? void 0 : _ctx_icons[toastType]) !== null && _ctx_icons_toastType !== void 0 ? _ctx_icons_toastType : null;
859
+ if (!icon) return null;
860
+ return /* @__PURE__ */ jsx(View, {
861
+ flexShrink: 0,
862
+ marginTop: "0-5",
863
+ children: icon
864
+ });
973
865
  }
974
866
  function useToasts() {
975
- var ctx = useToastContext("useToasts");
976
- return {
977
- toasts: ctx.toasts,
978
- expanded: ctx.expanded,
979
- position: ctx.position
980
- };
867
+ var ctx = useToastContext("useToasts");
868
+ return {
869
+ toasts: ctx.toasts,
870
+ expanded: ctx.expanded,
871
+ position: ctx.position,
872
+ closeButton: ctx.closeButton
873
+ };
981
874
  }
982
875
  function useToastItem() {
983
- return useToastItemContext();
876
+ return useToastItemContext();
984
877
  }
985
878
  ToastRoot.displayName = "Toast";
986
879
  var Toast = withStaticProperties(ToastRoot, {
987
- Viewport: ToastViewport,
988
- List: ToastList,
989
- Item: ToastItemInner,
990
- Title: ToastTitle,
991
- Description: ToastDescription,
992
- Close: ToastClose,
993
- Action: ToastAction,
994
- Icon: ToastIcon
880
+ Viewport: ToastViewport,
881
+ List: ToastList,
882
+ Item: ToastItemInner,
883
+ Title: ToastTitle,
884
+ Description: ToastDescription,
885
+ Close: ToastClose,
886
+ Action: ToastAction,
887
+ Icon: ToastIcon
995
888
  });
889
+
996
890
  export { Toast, useToastItem, useToasts };
997
891
  //# sourceMappingURL=ToastComposable.native.js.map