@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
package/src/Toaster.tsx DELETED
@@ -1,181 +0,0 @@
1
- /**
2
- * Toaster — drop-in all-in-one toast component.
3
- * Thin wrapper around Toast + Toast.Viewport + Toast.List (composable API).
4
- */
5
-
6
- import type { TamaguiElement } from '@tamagui/core'
7
- import * as React from 'react'
8
- import { Toast } from './ToastComposable'
9
- import type { ToastPosition } from './ToastComposable'
10
- import type { SwipeDirection } from './ToastProvider'
11
- import type { ExternalToast } from './ToastState'
12
- import type { BurntToastOptions } from './types'
13
-
14
- export type ToasterPosition = ToastPosition
15
-
16
- export interface ToasterProps {
17
- /**
18
- * Position of the toasts on screen
19
- * @default 'bottom-right'
20
- */
21
- position?: ToasterPosition
22
-
23
- /**
24
- * Expand toasts on hover to show all
25
- * @default false
26
- */
27
- expand?: boolean
28
-
29
- /**
30
- * Number of toasts visible at once
31
- * @default 4
32
- */
33
- visibleToasts?: number
34
-
35
- /**
36
- * Gap between toasts in pixels
37
- * @default 14
38
- */
39
- gap?: number
40
-
41
- /**
42
- * Default duration for toasts in ms
43
- * @default 4000
44
- */
45
- duration?: number
46
-
47
- /**
48
- * Offset from screen edge in pixels
49
- * @default 24
50
- */
51
- offset?: number | { top?: number; right?: number; bottom?: number; left?: number }
52
-
53
- /**
54
- * Hotkey to focus toast viewport
55
- * @default ['altKey', 'KeyT']
56
- */
57
- hotkey?: string[]
58
-
59
- /**
60
- * Direction(s) toasts can be swiped to dismiss.
61
- * 'auto' detects based on position (swipe toward nearest edge).
62
- * @default 'auto'
63
- */
64
- swipeDirection?: SwipeDirection
65
-
66
- /**
67
- * Distance in pixels swipe must pass to dismiss
68
- * @default 50
69
- */
70
- swipeThreshold?: number
71
-
72
- /**
73
- * Show close button on toasts
74
- * @default false
75
- */
76
- closeButton?: boolean
77
-
78
- /**
79
- * Theme for toasts (auto-detected if not set)
80
- */
81
- theme?: 'light' | 'dark' | 'system'
82
-
83
- /**
84
- * Custom icons for toast types
85
- */
86
- icons?: {
87
- success?: React.ReactNode
88
- error?: React.ReactNode
89
- warning?: React.ReactNode
90
- info?: React.ReactNode
91
- loading?: React.ReactNode
92
- close?: React.ReactNode
93
- }
94
-
95
- /**
96
- * Default toast options
97
- */
98
- toastOptions?: ExternalToast
99
-
100
- /**
101
- * Container aria label for screen readers
102
- * @default 'Notifications'
103
- */
104
- containerAriaLabel?: string
105
-
106
- /**
107
- * When true, uses burnt native OS toasts on mobile instead of RN views.
108
- * @default false
109
- */
110
- native?: boolean
111
-
112
- /**
113
- * Options for burnt native toasts on mobile
114
- */
115
- burntOptions?: Omit<BurntToastOptions, 'title' | 'message' | 'duration'>
116
-
117
- /**
118
- * Options for web Notification API
119
- */
120
- notificationOptions?: NotificationOptions
121
-
122
- /**
123
- * Force reduced motion mode (disables animations)
124
- */
125
- reducedMotion?: boolean
126
- }
127
-
128
- export const Toaster = React.forwardRef<TamaguiElement, ToasterProps>(
129
- function Toaster(props, ref) {
130
- const {
131
- position = 'bottom-right',
132
- expand = false,
133
- visibleToasts,
134
- gap,
135
- duration,
136
- offset,
137
- hotkey,
138
- swipeDirection,
139
- swipeThreshold,
140
- closeButton,
141
- theme,
142
- icons,
143
- toastOptions,
144
- containerAriaLabel = 'Notifications',
145
- native,
146
- burntOptions,
147
- notificationOptions,
148
- reducedMotion,
149
- } = props
150
-
151
- return (
152
- <Toast
153
- position={position}
154
- expand={expand}
155
- visibleToasts={visibleToasts}
156
- gap={gap}
157
- duration={toastOptions?.duration ?? duration}
158
- swipeDirection={swipeDirection}
159
- swipeThreshold={swipeThreshold}
160
- closeButton={closeButton}
161
- theme={theme}
162
- icons={icons}
163
- native={native}
164
- burntOptions={burntOptions}
165
- notificationOptions={notificationOptions}
166
- reducedMotion={reducedMotion}
167
- >
168
- <Toast.Viewport
169
- ref={ref}
170
- offset={offset}
171
- hotkey={hotkey}
172
- label={containerAriaLabel}
173
- >
174
- <Toast.List />
175
- </Toast.Viewport>
176
- </Toast>
177
- )
178
- }
179
- )
180
-
181
- Toaster.displayName = 'Toaster'
package/src/constants.ts DELETED
@@ -1,2 +0,0 @@
1
- export const TOAST_NAME = 'Toast'
2
- export const TOAST_CONTEXT = 'Toast'
package/src/v2.ts DELETED
@@ -1,31 +0,0 @@
1
- // Toast v2 - composable component API
2
- export { Toast, useToasts, useToastItem } from './ToastComposable'
3
- export type {
4
- ToastRootProps,
5
- ToastViewportProps,
6
- ToastItemProps,
7
- ToastItemRenderProps,
8
- ToastListProps,
9
- ToastPosition,
10
- ToastIcons,
11
- } from './ToastComposable'
12
-
13
- // Toast v2 - imperative API
14
- export { toast } from './ToastState'
15
- export type {
16
- ToastT,
17
- ToastType,
18
- ToastToDismiss,
19
- ExternalToast,
20
- PromiseT,
21
- PromiseData,
22
- ToastAction,
23
- } from './ToastState'
24
-
25
- // Toaster - all-in-one component (thin wrapper over composable API)
26
- export { Toaster } from './Toaster'
27
- export type { ToasterProps, ToasterPosition } from './Toaster'
28
-
29
- export type { SwipeDirection } from './ToastProvider'
30
- export type { BurntToastOptions, CreateNativeToastOptions, NativeToastRef } from './types'
31
- export { requestNotificationPermission } from './createNativeToast'
package/types/Toast.d.ts DELETED
@@ -1,84 +0,0 @@
1
- import type { GetProps, NativePlatform, NativeValue, TamaguiElement } from '@tamagui/core';
2
- import * as React from 'react';
3
- import type { CustomData } from './ToastImperative';
4
- import { useToast, useToastController, useToastState } from './ToastImperative';
5
- import type { ToastExtraProps, ToastProps } from './ToastImpl';
6
- import type { ScopedProps, ToastProviderProps } from './ToastProvider';
7
- import { ToastProvider } from './ToastProvider';
8
- import type { ToastViewportProps } from './ToastViewport';
9
- import { ToastViewport } from './ToastViewport';
10
- declare const ToastTitle: import("@tamagui/core").TamaguiComponent<import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiTextElement, import("@tamagui/core").TextNonStyleProps, import("@tamagui/core").TextStylePropsBase, {
11
- unstyled?: boolean | undefined;
12
- size?: import("@tamagui/core").FontSizeTokens | undefined;
13
- }, import("@tamagui/core").StaticConfigPublic>;
14
- type ToastTitleProps = GetProps<typeof ToastTitle>;
15
- declare const ToastDescription: import("@tamagui/core").TamaguiComponent<import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiTextElement, import("@tamagui/core").TextNonStyleProps, import("@tamagui/core").TextStylePropsBase, {
16
- unstyled?: boolean | undefined;
17
- size?: import("@tamagui/core").FontSizeTokens | undefined;
18
- }, import("@tamagui/core").StaticConfigPublic>;
19
- type ToastDescriptionProps = GetProps<typeof ToastDescription>;
20
- type ToastActionProps = ScopedProps<ToastCloseProps & {
21
- /**
22
- * A short description for an alternate way to carry out the action. For screen reader users
23
- * who will not be able to navigate to the button easily/quickly.
24
- * @example <ToastAction altText="Goto account settings to updgrade">Upgrade</ToastAction>
25
- * @example <ToastAction altText="Undo (Alt+U)">Undo</ToastAction>
26
- */
27
- altText: string;
28
- }>;
29
- declare const ToastCloseFrame: import("@tamagui/core").TamaguiComponent<import("@tamagui/core").TamaDefer, TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {
30
- elevation?: number | import("@tamagui/core").SizeTokens | undefined;
31
- fullscreen?: boolean | undefined;
32
- }, import("@tamagui/core").StaticConfigPublic>;
33
- type ToastCloseFrameProps = GetProps<typeof ToastCloseFrame>;
34
- type ToastCloseProps = ScopedProps<ToastCloseFrameProps & {}>;
35
- declare const Toast: React.ForwardRefExoticComponent<Omit<import("@tamagui/core").GetFinalProps<import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {
36
- unstyled?: boolean | undefined;
37
- elevation?: number | import("@tamagui/core").SizeTokens | undefined;
38
- fullscreen?: boolean | undefined;
39
- }>, keyof ToastExtraProps> & ToastExtraProps & React.RefAttributes<TamaguiElement>> & import("@tamagui/core").StaticComponentObject<Omit<import("@tamagui/core").GetFinalProps<import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {
40
- unstyled?: boolean | undefined;
41
- elevation?: number | import("@tamagui/core").SizeTokens | undefined;
42
- fullscreen?: boolean | undefined;
43
- }>, keyof ToastExtraProps> & ToastExtraProps, TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps & ToastExtraProps, import("@tamagui/core").StackStyleBase, {
44
- unstyled?: boolean | undefined;
45
- elevation?: number | import("@tamagui/core").SizeTokens | undefined;
46
- fullscreen?: boolean | undefined;
47
- }, import("@tamagui/core").StaticConfigPublic> & Omit<import("@tamagui/core").StaticConfigPublic, "staticConfig" | "styleable"> & {
48
- __tama: [Omit<import("@tamagui/core").GetFinalProps<import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {
49
- unstyled?: boolean | undefined;
50
- elevation?: number | import("@tamagui/core").SizeTokens | undefined;
51
- fullscreen?: boolean | undefined;
52
- }>, keyof ToastExtraProps> & ToastExtraProps, TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps & ToastExtraProps, import("@tamagui/core").StackStyleBase, {
53
- unstyled?: boolean | undefined;
54
- elevation?: number | import("@tamagui/core").SizeTokens | undefined;
55
- fullscreen?: boolean | undefined;
56
- }, import("@tamagui/core").StaticConfigPublic];
57
- } & {
58
- Title: import("@tamagui/core").TamaguiComponent<import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiTextElement, import("@tamagui/core").TextNonStyleProps, import("@tamagui/core").TextStylePropsBase, {
59
- unstyled?: boolean | undefined;
60
- size?: import("@tamagui/core").FontSizeTokens | undefined;
61
- }, import("@tamagui/core").StaticConfigPublic>;
62
- Description: import("@tamagui/core").TamaguiComponent<import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiTextElement, import("@tamagui/core").TextNonStyleProps, import("@tamagui/core").TextStylePropsBase, {
63
- unstyled?: boolean | undefined;
64
- size?: import("@tamagui/core").FontSizeTokens | undefined;
65
- }, import("@tamagui/core").StaticConfigPublic>;
66
- Action: React.ForwardRefExoticComponent<Omit<ToastActionProps, "scope"> & {
67
- scope?: import("./ToastProvider").ToastScopes;
68
- } & React.RefAttributes<TamaguiElement>>;
69
- Close: React.ForwardRefExoticComponent<Omit<Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "elevation" | keyof import("@tamagui/core").StackStyleBase | "fullscreen"> & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase> & {
70
- elevation?: number | import("@tamagui/core").SizeTokens | undefined;
71
- fullscreen?: boolean | undefined;
72
- } & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>> & import("@tamagui/core").WithPseudoProps<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase> & {
73
- elevation?: number | import("@tamagui/core").SizeTokens | undefined;
74
- fullscreen?: boolean | undefined;
75
- } & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>>> & import("@tamagui/core").WithMediaProps<import("@tamagui/core").WithThemeShorthandsAndPseudos<import("@tamagui/core").StackStyleBase, {
76
- elevation?: number | import("@tamagui/core").SizeTokens | undefined;
77
- fullscreen?: boolean | undefined;
78
- }>>, "scope"> & {
79
- scope?: import("./ToastProvider").ToastScopes;
80
- } & React.RefAttributes<TamaguiElement>>;
81
- };
82
- export { Toast, ToastProvider, ToastViewport, useToast, useToastController, useToastState, };
83
- export type { CustomData, ToastActionProps, ToastCloseProps, ToastDescriptionProps, NativePlatform as ToastNativePlatform, NativeValue as ToastNativeValue, ToastProps, ToastProviderProps, ToastTitleProps, ToastViewportProps, };
84
- //# sourceMappingURL=Toast.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../src/Toast.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAM1F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAC/E,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE9D,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAQ/C,QAAA,MAAM,UAAU;;;8CAed,CAAA;AAEF,KAAK,eAAe,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAA;AAQlD,QAAA,MAAM,gBAAgB;;;8CAepB,CAAA;AAEF,KAAK,qBAAqB,GAAG,QAAQ,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAQ9D,KAAK,gBAAgB,GAAG,WAAW,CACjC,eAAe,GAAG;IAChB;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAA;CAChB,CACF,CAAA;AA6BD,QAAA,MAAM,eAAe;;;8CAGnB,CAAA;AAEF,KAAK,oBAAoB,GAAG,QAAQ,CAAC,OAAO,eAAe,CAAC,CAAA;AAC5D,KAAK,eAAe,GAAG,WAAW,CAAC,oBAAoB,GAAG,EAAE,CAAC,CAAA;AAmE7D,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKT,CAAA;AAIF,OAAO,EACL,KAAK,EACL,aAAa,EACb,aAAa,EAGb,QAAQ,EACR,kBAAkB,EAClB,aAAa,GACd,CAAA;AACD,YAAY,EAEV,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,cAAc,IAAI,mBAAmB,EAErC,WAAW,IAAI,gBAAgB,EAC/B,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,kBAAkB,GACnB,CAAA"}
@@ -1,18 +0,0 @@
1
- import type { GetProps, TamaguiElement } from '@tamagui/core';
2
- import { VisuallyHidden } from '@tamagui/visually-hidden';
3
- import * as React from 'react';
4
- import type { ScopedProps } from './ToastProvider';
5
- declare const ToastAnnounceExcludeFrame: import("@tamagui/core").TamaguiComponent<import("@tamagui/core").TamaDefer, TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {}, import("@tamagui/core").StaticConfigPublic>;
6
- type ToastAnnounceExcludeFrameProps = GetProps<typeof ToastAnnounceExcludeFrame>;
7
- type ToastAnnounceExcludeExtraProps = {
8
- altText?: string;
9
- };
10
- type ToastAnnounceExcludeProps = ToastAnnounceExcludeFrameProps & ToastAnnounceExcludeExtraProps;
11
- declare const ToastAnnounceExclude: React.ForwardRefExoticComponent<Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, keyof import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>> & import("@tamagui/core").WithPseudoProps<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>>> & import("@tamagui/core").WithMediaProps<import("@tamagui/core").WithThemeShorthandsAndPseudos<import("@tamagui/core").StackStyleBase, {}>> & ToastAnnounceExcludeExtraProps & React.RefAttributes<TamaguiElement>>;
12
- interface ToastAnnounceProps extends Omit<GetProps<typeof VisuallyHidden>, 'children'>, ScopedProps<{
13
- children: string[];
14
- }> {
15
- }
16
- declare const ToastAnnounce: React.FC<ToastAnnounceProps>;
17
- export { ToastAnnounce, ToastAnnounceExclude, type ToastAnnounceExcludeProps, type ToastAnnounceProps, };
18
- //# sourceMappingURL=ToastAnnounce.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ToastAnnounce.d.ts","sourceRoot":"","sources":["../src/ToastAnnounce.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAI7D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGlD,QAAA,MAAM,yBAAyB,yOAE7B,CAAA;AAEF,KAAK,8BAA8B,GAAG,QAAQ,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAEhF,KAAK,8BAA8B,GAAG;IACpC,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,KAAK,yBAAyB,GAAG,8BAA8B,GAC7D,8BAA8B,CAAA;AAEhC,QAAA,MAAM,oBAAoB,6xBAazB,CAAA;AAID,UAAU,kBACR,SACE,IAAI,CAAC,QAAQ,CAAC,OAAO,cAAc,CAAC,EAAE,UAAU,CAAC,EACjD,WAAW,CAAC;IAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;CAAG;AAE1C,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAgC/C,CAAA;AAmBD,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,GACxB,CAAA"}
@@ -1,95 +0,0 @@
1
- import type { NativePlatform, NativeValue } from '@tamagui/core';
2
- import React from 'react';
3
- import type { CreateNativeToastOptions, NativeToastRef } from './types';
4
- export interface ToastImperativeOptions extends Omit<CreateNativeToastOptions, 'message'> {
5
- /**
6
- * Will show a native toast if is true or is set to the current platform. On iOS, it wraps `SPIndicator` and `SPAlert`. On Android, it wraps `ToastAndroid`. On web, it wraps Notification API. Mobile's native features are handled by `burnt`.
7
- */
8
- native?: NativeValue;
9
- }
10
- /**
11
- * Override this in your application to get custom toast fields.
12
- *
13
- * e.g.
14
- * ```ts
15
- * declare module '@tamagui/toast' {
16
- * interface CustomData {
17
- * preset: 'error' | 'success'
18
- * isUrgent: true
19
- * }
20
- * }
21
- *```
22
- * You will get auto-completion:
23
- * ```ts
24
- * toast.show("Message", { preset: 'error', isUrgent: true })
25
- * ```
26
- */
27
- export interface CustomData {
28
- [key: string]: any;
29
- }
30
- type ShowOptions = CreateNativeToastOptions & CustomData & {
31
- /**
32
- * Used when need custom data
33
- */
34
- customData?: CustomData;
35
- /**
36
- * Overrides the native option on `ToastImperativeProvider`
37
- */
38
- native?: NativeValue;
39
- /**
40
- * Which viewport to send this toast to. This is only intended to be used with custom toasts and you should wire it up when creating the toast.
41
- */
42
- viewportName?: string | 'default';
43
- };
44
- type ToastData = {
45
- title: string;
46
- id: string;
47
- } & ShowOptions & {
48
- isHandledNatively: boolean;
49
- } & CustomData;
50
- interface ToastContextI {
51
- nativeToast: NativeToastRef | null;
52
- /**
53
- * Call it to show a new toast. If you're using native toasts, you can pass native options using \`burntOptions\` or \`notificationOptions\` depending on the native platform (mobile/web).
54
- */
55
- show: (title: string, options?: ShowOptions) => boolean;
56
- /**
57
- * Call it to hide the currently displayed toast.
58
- *
59
- * _NOTE_: does not work on Android native toasts
60
- *
61
- * _NOTE_: hides the last toast on web notification toasts
62
- */
63
- hide: () => void;
64
- options?: ToastImperativeOptions;
65
- }
66
- export declare const useToastController: () => ToastContextI;
67
- export declare const useToastState: () => ToastData | null;
68
- /** @deprecated use `useToastController` and `useToastState` instead to avoid performance pitfalls */
69
- export declare const useToast: () => {
70
- currentToast: ToastData | null;
71
- nativeToast: NativeToastRef | null;
72
- /**
73
- * Call it to show a new toast. If you're using native toasts, you can pass native options using \`burntOptions\` or \`notificationOptions\` depending on the native platform (mobile/web).
74
- */
75
- show: (title: string, options?: ShowOptions) => boolean;
76
- /**
77
- * Call it to hide the currently displayed toast.
78
- *
79
- * _NOTE_: does not work on Android native toasts
80
- *
81
- * _NOTE_: hides the last toast on web notification toasts
82
- */
83
- hide: () => void;
84
- options?: ToastImperativeOptions;
85
- };
86
- interface ToastImperativeProviderProps {
87
- children: React.ReactNode;
88
- /**
89
- * Used to provide defaults to imperative API. Options can be overwritten when calling `show()`.
90
- */
91
- options: ToastImperativeOptions;
92
- }
93
- export declare const ToastImperativeProvider: ({ children, options, }: ToastImperativeProviderProps) => import("react/jsx-runtime").JSX.Element;
94
- export type { NativePlatform, NativeValue, ToastImperativeProviderProps };
95
- //# sourceMappingURL=ToastImperative.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ToastImperative.d.ts","sourceRoot":"","sources":["../src/ToastImperative.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhE,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAEvE,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAClD,wBAAwB,EACxB,SAAS,CACV;IACC;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,UAAU;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB;AAED,KAAK,WAAW,GAAG,wBAAwB,GACzC,UAAU,GAAG;IACX;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAClC,CAAA;AAEH,KAAK,SAAS,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,WAAW,GAAG;IAC3D,iBAAiB,EAAE,OAAO,CAAA;CAC3B,GAAG,UAAU,CAAA;AAEhB,UAAU,aAAa;IACrB,WAAW,EAAE,cAAc,GAAG,IAAI,CAAA;IAElC;;OAEG;IACH,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,KAAK,OAAO,CAAA;IAEvD;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,IAAI,CAAA;IAEhB,OAAO,CAAC,EAAE,sBAAsB,CAAA;CACjC;AAKD,eAAO,MAAM,kBAAkB,qBAE9B,CAAA;AAED,eAAO,MAAM,aAAa,wBAEzB,CAAA;AAED,qGAAqG;AACrG,eAAO,MAAM,QAAQ;;iBA/BN,cAAc,GAAG,IAAI;IAElC;;OAEG;UACG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,KAAK,OAAO;IAEvD;;;;;;OAMG;UACG,MAAM,IAAI;cAEN,sBAAsB;CAoBjC,CAAA;AAED,UAAU,4BAA4B;IACpC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;OAEG;IACH,OAAO,EAAE,sBAAsB,CAAA;CAChC;AAED,eAAO,MAAM,uBAAuB,GAAI,wBAGrC,4BAA4B,4CAkF9B,CAAA;AAED,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAA"}
@@ -1,109 +0,0 @@
1
- import type { GetProps, TamaguiElement } from '@tamagui/core';
2
- import type { DismissableProps } from '@tamagui/dismissable';
3
- import * as React from 'react';
4
- import type { GestureResponderEvent } from 'react-native';
5
- import type { ScopedProps } from './ToastProvider';
6
- declare const ToastImplFrame: import("@tamagui/core").TamaguiComponent<import("@tamagui/core").TamaDefer, TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {
7
- unstyled?: boolean | undefined;
8
- elevation?: number | import("@tamagui/core").SizeTokens | undefined;
9
- fullscreen?: boolean | undefined;
10
- }, import("@tamagui/core").StaticConfigPublic>;
11
- type ToastProps = Omit<ToastImplProps, keyof ToastImplPrivateProps>;
12
- type SwipeEvent = GestureResponderEvent;
13
- declare const useToastInteractiveContext: (scope?: string) => {
14
- onClose(): void;
15
- };
16
- type ToastImplPrivateProps = {
17
- open?: boolean;
18
- onClose(): void;
19
- };
20
- type ToastImplFrameProps = GetProps<typeof ToastImplFrame>;
21
- export type ToastExtraProps = {
22
- /**
23
- * The controlled open state of the dialog. Must be used in conjunction with `onOpenChange`.
24
- */
25
- open?: boolean;
26
- /**
27
- * The open state of the dialog when it is initially rendered. Use when you do not need to control its open state.
28
- */
29
- defaultOpen?: boolean;
30
- /**
31
- * Event handler called when the open state of the dialog changes.
32
- */
33
- onOpenChange?(open: boolean): void;
34
- /**
35
- * Used to force mounting when more control is needed. Useful when
36
- * controlling animation with React animation libraries.
37
- */
38
- forceMount?: boolean;
39
- /**
40
- * Control the sensitivity of the toast for accessibility purposes.
41
- * For toasts that are the result of a user action, choose foreground. Toasts generated from background tasks should use background.
42
- */
43
- type?: 'foreground' | 'background';
44
- /**
45
- * Time in milliseconds that toast should remain visible for. Overrides value given to `ToastProvider`.
46
- */
47
- duration?: number;
48
- /**
49
- * Event handler called when the escape key is down. It can be prevented by calling `event.preventDefault`.
50
- */
51
- onEscapeKeyDown?: DismissableProps['onEscapeKeyDown'];
52
- /**
53
- * Event handler called when the dismiss timer is paused.
54
- * On web, this occurs when the pointer is moved over the viewport, the viewport is focused or when the window is blurred.
55
- * On mobile, this occurs when the toast is touched.
56
- */
57
- onPause?(): void;
58
- /**
59
- * Event handler called when the dismiss timer is resumed.
60
- * On web, this occurs when the pointer is moved away from the viewport, the viewport is blurred or when the window is focused.
61
- * On mobile, this occurs when the toast is released.
62
- */
63
- onResume?(): void;
64
- /**
65
- * Event handler called when starting a swipe interaction. It can be prevented by calling `event.preventDefault`.
66
- */
67
- onSwipeStart?(event: SwipeEvent): void;
68
- /**
69
- * Event handler called during a swipe interaction. It can be prevented by calling `event.preventDefault`.
70
- */
71
- onSwipeMove?(event: SwipeEvent): void;
72
- /**
73
- * Event handler called at the cancellation of a swipe interaction. It can be prevented by calling `event.preventDefault`.
74
- */
75
- onSwipeCancel?(event: SwipeEvent): void;
76
- /**
77
- * Event handler called at the end of a swipe interaction. It can be prevented by calling `event.preventDefault`.
78
- */
79
- onSwipeEnd?(event: SwipeEvent): void;
80
- /**
81
- * The viewport's name to send the toast to. Used when using multiple viewports and want to forward toasts to different ones.
82
- *
83
- * @default "default"
84
- */
85
- viewportName?: string;
86
- /**
87
- *
88
- */
89
- id?: string;
90
- };
91
- type ToastImplProps = ScopedProps<ToastImplPrivateProps & ToastImplFrameProps & ToastExtraProps>;
92
- declare const ToastImpl: React.ForwardRefExoticComponent<Omit<ToastImplPrivateProps & Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "unstyled" | "elevation" | keyof import("@tamagui/core").StackStyleBase | "fullscreen"> & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase> & {
93
- unstyled?: boolean | undefined;
94
- elevation?: number | import("@tamagui/core").SizeTokens | undefined;
95
- fullscreen?: boolean | undefined;
96
- } & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>> & import("@tamagui/core").WithPseudoProps<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase> & {
97
- unstyled?: boolean | undefined;
98
- elevation?: number | import("@tamagui/core").SizeTokens | undefined;
99
- fullscreen?: boolean | undefined;
100
- } & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>>> & import("@tamagui/core").WithMediaProps<import("@tamagui/core").WithThemeShorthandsAndPseudos<import("@tamagui/core").StackStyleBase, {
101
- unstyled?: boolean | undefined;
102
- elevation?: number | import("@tamagui/core").SizeTokens | undefined;
103
- fullscreen?: boolean | undefined;
104
- }>> & ToastExtraProps, "scope"> & {
105
- scope?: import("./ToastProvider").ToastScopes;
106
- } & React.RefAttributes<TamaguiElement>>;
107
- export { ToastImpl, ToastImplFrame, useToastInteractiveContext, type ToastImplProps };
108
- export type { ToastProps };
109
- //# sourceMappingURL=ToastImpl.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ToastImpl.d.ts","sourceRoot":"","sources":["../src/ToastImpl.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAU7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAK5D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAEV,qBAAqB,EAGtB,MAAM,cAAc,CAAA;AAYrB,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,iBAAiB,CAAA;AAIlE,QAAA,MAAM,cAAc;;;;8CA0BlB,CAAA;AAEF,KAAK,UAAU,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,qBAAqB,CAAC,CAAA;AAEnE,KAAK,UAAU,GAAG,qBAAqB,CAAA;AAEvC,QAAA,MAEoB,0BAA0B;;CAG5C,CAAA;AAEF,KAAK,qBAAqB,GAAG;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,OAAO,IAAI,IAAI,CAAA;CAChB,CAAA;AAED,KAAK,mBAAmB,GAAG,QAAQ,CAAC,OAAO,cAAc,CAAC,CAAA;AAE1D,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IAEd;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;OAEG;IACH,YAAY,CAAC,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAA;IAClC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IAEpB;;;OAGG;IACH,IAAI,CAAC,EAAE,YAAY,GAAG,YAAY,CAAA;IAClC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,eAAe,CAAC,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;IACrD;;;;OAIG;IACH,OAAO,CAAC,IAAI,IAAI,CAAA;IAChB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,IAAI,CAAA;IACjB;;OAEG;IACH,YAAY,CAAC,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAA;IACtC;;OAEG;IACH,WAAW,CAAC,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAA;IACrC;;OAEG;IACH,aAAa,CAAC,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAA;IACvC;;OAEG;IACH,UAAU,CAAC,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAA;IACpC;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,KAAK,cAAc,GAAG,WAAW,CAC/B,qBAAqB,GAAG,mBAAmB,GAAG,eAAe,CAC9D,CAAA;AAED,QAAA,MAAM,SAAS;;;;;;;;;;;;;;wCAuPd,CAAA;AAsGD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,0BAA0B,EAAE,KAAK,cAAc,EAAE,CAAA;AACrF,YAAY,EAAE,UAAU,EAAE,CAAA"}
@@ -1,8 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- import { type ToastProviderContextValue } from './ToastProvider';
3
- export declare function ToastPortal(props: {
4
- children: ReactNode;
5
- zIndex?: number;
6
- context: ToastProviderContextValue;
7
- }): import("react/jsx-runtime").JSX.Element;
8
- //# sourceMappingURL=ToastPortal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ToastPortal.d.ts","sourceRoot":"","sources":["../src/ToastPortal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAA4B,KAAK,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAE1F,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,QAAQ,EAAE,SAAS,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,yBAAyB,CAAA;CACnC,2CASA"}
@@ -1,92 +0,0 @@
1
- import type { NativeValue, TamaguiElement } from '@tamagui/core';
2
- import * as React from 'react';
3
- import type { ToastImperativeOptions } from './ToastImperative';
4
- import type { BurntToastOptions } from './types';
5
- declare const Collection: {
6
- readonly Provider: React.FC<{
7
- children?: React.ReactNode;
8
- } & {
9
- scope?: any;
10
- }>;
11
- readonly Slot: React.ForwardRefExoticComponent<import("@tamagui/collection").CollectionProps & {
12
- scope?: any;
13
- } & React.RefAttributes<TamaguiElement | undefined>>;
14
- readonly ItemSlot: React.ForwardRefExoticComponent<{
15
- children: React.ReactNode;
16
- } & {
17
- scope?: any;
18
- } & React.RefAttributes<TamaguiElement | undefined>>;
19
- }, useCollection: (scope: string) => () => {
20
- ref: React.RefObject<TamaguiElement | undefined>;
21
- }[];
22
- export type SwipeDirection = 'vertical' | 'up' | 'down' | 'horizontal' | 'left' | 'right' | 'auto';
23
- export type ToastProviderContextValue = {
24
- id: string;
25
- toastScope: string;
26
- label: string;
27
- duration: number;
28
- swipeDirection: SwipeDirection;
29
- swipeThreshold: number;
30
- toastCount: number;
31
- viewports: Record<string, TamaguiElement | null>;
32
- onViewportChange(name: string, viewport: TamaguiElement): void;
33
- onToastAdd(): void;
34
- onToastRemove(): void;
35
- isFocusedToastEscapeKeyDownRef: React.MutableRefObject<boolean>;
36
- isClosePausedRef: React.MutableRefObject<boolean>;
37
- options: ToastImperativeOptions;
38
- };
39
- export type ToastScopes = string;
40
- type ScopedProps<P> = Omit<P, 'scope'> & {
41
- scope?: ToastScopes;
42
- };
43
- declare const useToastProviderContext: (scope?: string) => ToastProviderContextValue;
44
- interface ToastProviderProps {
45
- children?: React.ReactNode;
46
- /**
47
- * An author-localized label for each toast. Used to help screen reader users
48
- * associate the interruption with a toast.
49
- * @defaultValue 'Notification'
50
- */
51
- label?: string;
52
- /**
53
- * Time in milliseconds that each toast should remain visible for.
54
- * @defaultValue 5000
55
- */
56
- duration?: number;
57
- /**
58
- * Direction of pointer swipe that should close the toast.
59
- * @defaultValue 'right'
60
- */
61
- swipeDirection?: SwipeDirection;
62
- /**
63
- * Distance in pixels that the swipe must pass before a close is triggered.
64
- * @defaultValue 50
65
- */
66
- swipeThreshold?: number;
67
- /**
68
- * @defaultValue unique generated identifier
69
- */
70
- id?: string;
71
- /**
72
- * Will show a native toast if is true or is set to the current platform. On iOS, it wraps `SPIndicator` and `SPAlert`. On Android, it wraps `ToastAndroid`. On web, it wraps Notification API. Mobile's native features are handled by `burnt`.
73
- * Only works with the imperative `useToast` hook.
74
- */
75
- native?: NativeValue;
76
- /**
77
- * Options for the burnt package if you're using native toasts on mobile
78
- */
79
- burntOptions?: Omit<BurntToastOptions, 'title' | 'message' | 'duration'>;
80
- /**
81
- * Options for the notification API if you're using native toasts on web
82
- */
83
- notificationOptions?: NotificationOptions;
84
- }
85
- declare const ToastProvider: React.FC<ToastProviderProps>;
86
- export declare function ReprogapateToastProvider(props: {
87
- children: React.ReactNode;
88
- context: ToastProviderContextValue;
89
- }): import("react/jsx-runtime").JSX.Element;
90
- export { Collection, ToastProvider, useCollection, useToastProviderContext };
91
- export type { ScopedProps, ToastProviderProps };
92
- //# sourceMappingURL=ToastProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ToastProvider.d.ts","sourceRoot":"","sources":["../src/ToastProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAGhE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAE/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAQhD,QAAA,MAAO,UAAU;;gBATC,CAAC;;aAClB,CAAC;;;aAEiD,CAAC;;;;;;;GAMjC,aAAa;;GAA6C,CAAA;AAE7E,MAAM,MAAM,cAAc,GACtB,UAAU,GACV,IAAI,GACJ,MAAM,GACN,YAAY,GACZ,MAAM,GACN,OAAO,GACP,MAAM,CAAA;AAEV,MAAM,MAAM,yBAAyB,GAAG;IACtC,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,EAAE,cAAc,CAAA;IAC9B,cAAc,EAAE,MAAM,CAAA;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC,CAAA;IAChD,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAA;IAC9D,UAAU,IAAI,IAAI,CAAA;IAClB,aAAa,IAAI,IAAI,CAAA;IACrB,8BAA8B,EAAE,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAC/D,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAA;IACjD,OAAO,EAAE,sBAAsB,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,CAAA;AAEhC,KAAK,WAAW,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG;IAAE,KAAK,CAAC,EAAE,WAAW,CAAA;CAAE,CAAA;AAEhE,QAAA,MAA2D,uBAAuB,+CAK/E,CAAA;AAEH,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IACX;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB;;OAEG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,SAAS,GAAG,UAAU,CAAC,CAAA;IACxE;;OAEG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAA;CAC1C;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA0E/C,CAAA;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,OAAO,EAAE,yBAAyB,CAAA;CACnC,2CAWA;AAcD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,uBAAuB,EAAE,CAAA;AAC5E,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAA"}