@oxyhq/bloom 0.50.1 → 0.51.0

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 (571) hide show
  1. package/NOTICE +89 -0
  2. package/README.md +12 -7
  3. package/lib/commonjs/avatar-group/AvatarGroup.web.js +2 -1
  4. package/lib/commonjs/avatar-group/AvatarGroup.web.js.map +1 -1
  5. package/lib/commonjs/bottom-sheet/index.web.js +5 -3
  6. package/lib/commonjs/bottom-sheet/index.web.js.map +1 -1
  7. package/lib/commonjs/context-menu/index.web.js +6 -9
  8. package/lib/commonjs/context-menu/index.web.js.map +1 -1
  9. package/lib/commonjs/dialog/Dialog.js +12 -7
  10. package/lib/commonjs/dialog/Dialog.js.map +1 -1
  11. package/lib/commonjs/dialog/Dialog.web.js +18 -22
  12. package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
  13. package/lib/commonjs/dialog/DialogHeader.js +61 -12
  14. package/lib/commonjs/dialog/DialogHeader.js.map +1 -1
  15. package/lib/commonjs/index.js +90 -83
  16. package/lib/commonjs/index.js.map +1 -1
  17. package/lib/commonjs/index.web.js +116 -109
  18. package/lib/commonjs/index.web.js.map +1 -1
  19. package/lib/commonjs/menu/index.web.js +5 -8
  20. package/lib/commonjs/menu/index.web.js.map +1 -1
  21. package/lib/commonjs/popover/index.web.js +8 -9
  22. package/lib/commonjs/popover/index.web.js.map +1 -1
  23. package/lib/commonjs/portal/index.js +4 -1
  24. package/lib/commonjs/portal/index.js.map +1 -1
  25. package/lib/commonjs/progressive-blur/index.js +79 -0
  26. package/lib/commonjs/progressive-blur/index.js.map +1 -0
  27. package/lib/commonjs/progressive-blur/index.web.js +67 -0
  28. package/lib/commonjs/progressive-blur/index.web.js.map +1 -0
  29. package/lib/commonjs/progressive-blur/shared.js +66 -0
  30. package/lib/commonjs/progressive-blur/shared.js.map +1 -0
  31. package/lib/commonjs/progressive-blur/types.js +6 -0
  32. package/lib/commonjs/progressive-blur/types.js.map +1 -0
  33. package/lib/commonjs/select/index.web.js +5 -8
  34. package/lib/commonjs/select/index.web.js.map +1 -1
  35. package/lib/commonjs/slider/Slider.js +4 -9
  36. package/lib/commonjs/slider/Slider.js.map +1 -1
  37. package/lib/commonjs/styles/web-view-style.js +26 -0
  38. package/lib/commonjs/styles/web-view-style.js.map +1 -0
  39. package/lib/commonjs/switch/Switch.js +4 -8
  40. package/lib/commonjs/switch/Switch.js.map +1 -1
  41. package/lib/commonjs/tab-bar/TabBarBase.js +415 -0
  42. package/lib/commonjs/tab-bar/TabBarBase.js.map +1 -0
  43. package/lib/commonjs/tab-bar/expo-router/RouterTabBar.js +83 -0
  44. package/lib/commonjs/tab-bar/expo-router/RouterTabBar.js.map +1 -0
  45. package/lib/commonjs/tab-bar/expo-router/fading-tab-screen.js +119 -0
  46. package/lib/commonjs/tab-bar/expo-router/fading-tab-screen.js.map +1 -0
  47. package/lib/commonjs/tab-bar/expo-router/index.js +26 -0
  48. package/lib/commonjs/tab-bar/expo-router/index.js.map +1 -0
  49. package/lib/commonjs/tab-bar/glyph.js +43 -0
  50. package/lib/commonjs/tab-bar/glyph.js.map +1 -0
  51. package/lib/commonjs/tab-bar/glyph.native.js +55 -0
  52. package/lib/commonjs/tab-bar/glyph.native.js.map +1 -0
  53. package/lib/commonjs/tab-bar/index.js +65 -0
  54. package/lib/commonjs/tab-bar/index.js.map +1 -0
  55. package/lib/commonjs/tab-bar/index.web.js +67 -0
  56. package/lib/commonjs/tab-bar/index.web.js.map +1 -0
  57. package/lib/commonjs/tab-bar/minimize-context.js +127 -0
  58. package/lib/commonjs/tab-bar/minimize-context.js.map +1 -0
  59. package/lib/commonjs/tab-bar/shared.js +139 -0
  60. package/lib/commonjs/tab-bar/shared.js.map +1 -0
  61. package/lib/commonjs/tab-bar/surface.js +50 -0
  62. package/lib/commonjs/tab-bar/surface.js.map +1 -0
  63. package/lib/commonjs/tab-bar/surface.native.js +56 -0
  64. package/lib/commonjs/tab-bar/surface.native.js.map +1 -0
  65. package/lib/commonjs/tab-bar/surface.web.js +59 -0
  66. package/lib/commonjs/tab-bar/surface.web.js.map +1 -0
  67. package/lib/commonjs/tab-bar/types.js +6 -0
  68. package/lib/commonjs/tab-bar/types.js.map +1 -0
  69. package/lib/commonjs/tabs/Tabs.js +3 -8
  70. package/lib/commonjs/tabs/Tabs.js.map +1 -1
  71. package/lib/commonjs/toast/Positioner.js +117 -0
  72. package/lib/commonjs/toast/Positioner.js.map +1 -0
  73. package/lib/commonjs/toast/ToastContent.js +301 -0
  74. package/lib/commonjs/toast/ToastContent.js.map +1 -0
  75. package/lib/commonjs/toast/ToastHost.js +69 -0
  76. package/lib/commonjs/toast/ToastHost.js.map +1 -0
  77. package/lib/commonjs/toast/ToastHost.native.js +44 -0
  78. package/lib/commonjs/toast/ToastHost.native.js.map +1 -0
  79. package/lib/commonjs/toast/ToastIcon.js +57 -0
  80. package/lib/commonjs/toast/ToastIcon.js.map +1 -0
  81. package/lib/commonjs/toast/ToastRow.js +411 -0
  82. package/lib/commonjs/toast/ToastRow.js.map +1 -0
  83. package/lib/commonjs/toast/ToastSwipeHandler.js +189 -0
  84. package/lib/commonjs/toast/ToastSwipeHandler.js.map +1 -0
  85. package/lib/commonjs/toast/Toaster.js +205 -0
  86. package/lib/commonjs/toast/Toaster.js.map +1 -0
  87. package/lib/commonjs/toast/animations.js +274 -0
  88. package/lib/commonjs/toast/animations.js.map +1 -0
  89. package/lib/commonjs/toast/constants.js +56 -0
  90. package/lib/commonjs/toast/constants.js.map +1 -0
  91. package/lib/commonjs/toast/context.js +42 -0
  92. package/lib/commonjs/toast/context.js.map +1 -0
  93. package/lib/commonjs/toast/index.js +32 -126
  94. package/lib/commonjs/toast/index.js.map +1 -1
  95. package/lib/commonjs/toast/position-utils.js +115 -0
  96. package/lib/commonjs/toast/position-utils.js.map +1 -0
  97. package/lib/commonjs/toast/positioner-utils.js +141 -0
  98. package/lib/commonjs/toast/positioner-utils.js.map +1 -0
  99. package/lib/commonjs/toast/toast-comparator.js +28 -0
  100. package/lib/commonjs/toast/toast-comparator.js.map +1 -0
  101. package/lib/commonjs/toast/toast-fns.js +90 -0
  102. package/lib/commonjs/toast/toast-fns.js.map +1 -0
  103. package/lib/commonjs/toast/toast-store.js +352 -0
  104. package/lib/commonjs/toast/toast-store.js.map +1 -0
  105. package/lib/commonjs/toast/toast-timers.js +110 -0
  106. package/lib/commonjs/toast/toast-timers.js.map +1 -0
  107. package/lib/commonjs/toast/types.js +42 -0
  108. package/lib/commonjs/toast/types.js.map +1 -1
  109. package/lib/commonjs/toast/use-animated-target.js +57 -0
  110. package/lib/commonjs/toast/use-animated-target.js.map +1 -0
  111. package/lib/commonjs/toast/use-app-state.js +76 -0
  112. package/lib/commonjs/toast/use-app-state.js.map +1 -0
  113. package/lib/commonjs/toast/use-toast-colors.js +114 -0
  114. package/lib/commonjs/toast/use-toast-colors.js.map +1 -0
  115. package/lib/commonjs/toast/use-toast-position.js +40 -0
  116. package/lib/commonjs/toast/use-toast-position.js.map +1 -0
  117. package/lib/commonjs/tooltip/index.web.js +2 -1
  118. package/lib/commonjs/tooltip/index.web.js.map +1 -1
  119. package/lib/commonjs/zoomable-image-gallery/ZoomableImageGallery.js +20 -8
  120. package/lib/commonjs/zoomable-image-gallery/ZoomableImageGallery.js.map +1 -1
  121. package/lib/module/avatar-group/AvatarGroup.web.js +2 -1
  122. package/lib/module/avatar-group/AvatarGroup.web.js.map +1 -1
  123. package/lib/module/bottom-sheet/index.web.js +5 -3
  124. package/lib/module/bottom-sheet/index.web.js.map +1 -1
  125. package/lib/module/context-menu/index.web.js +6 -9
  126. package/lib/module/context-menu/index.web.js.map +1 -1
  127. package/lib/module/dialog/Dialog.js +12 -7
  128. package/lib/module/dialog/Dialog.js.map +1 -1
  129. package/lib/module/dialog/Dialog.web.js +18 -22
  130. package/lib/module/dialog/Dialog.web.js.map +1 -1
  131. package/lib/module/dialog/DialogHeader.js +61 -12
  132. package/lib/module/dialog/DialogHeader.js.map +1 -1
  133. package/lib/module/index.js +3 -2
  134. package/lib/module/index.js.map +1 -1
  135. package/lib/module/index.web.js +3 -2
  136. package/lib/module/index.web.js.map +1 -1
  137. package/lib/module/menu/index.web.js +5 -8
  138. package/lib/module/menu/index.web.js.map +1 -1
  139. package/lib/module/popover/index.web.js +8 -9
  140. package/lib/module/popover/index.web.js.map +1 -1
  141. package/lib/module/portal/index.js +4 -1
  142. package/lib/module/portal/index.js.map +1 -1
  143. package/lib/module/progressive-blur/index.js +74 -0
  144. package/lib/module/progressive-blur/index.js.map +1 -0
  145. package/lib/module/progressive-blur/index.web.js +62 -0
  146. package/lib/module/progressive-blur/index.web.js.map +1 -0
  147. package/lib/module/progressive-blur/shared.js +60 -0
  148. package/lib/module/progressive-blur/shared.js.map +1 -0
  149. package/lib/module/progressive-blur/types.js +4 -0
  150. package/lib/module/progressive-blur/types.js.map +1 -0
  151. package/lib/module/select/index.web.js +5 -8
  152. package/lib/module/select/index.web.js.map +1 -1
  153. package/lib/module/slider/Slider.js +4 -9
  154. package/lib/module/slider/Slider.js.map +1 -1
  155. package/lib/module/styles/web-view-style.js +22 -0
  156. package/lib/module/styles/web-view-style.js.map +1 -0
  157. package/lib/module/switch/Switch.js +4 -8
  158. package/lib/module/switch/Switch.js.map +1 -1
  159. package/lib/module/tab-bar/TabBarBase.js +408 -0
  160. package/lib/module/tab-bar/TabBarBase.js.map +1 -0
  161. package/lib/module/tab-bar/expo-router/RouterTabBar.js +78 -0
  162. package/lib/module/tab-bar/expo-router/RouterTabBar.js.map +1 -0
  163. package/lib/module/tab-bar/expo-router/fading-tab-screen.js +113 -0
  164. package/lib/module/tab-bar/expo-router/fading-tab-screen.js.map +1 -0
  165. package/lib/module/tab-bar/expo-router/index.js +15 -0
  166. package/lib/module/tab-bar/expo-router/index.js.map +1 -0
  167. package/lib/module/tab-bar/glyph.js +38 -0
  168. package/lib/module/tab-bar/glyph.js.map +1 -0
  169. package/lib/module/tab-bar/glyph.native.js +50 -0
  170. package/lib/module/tab-bar/glyph.native.js.map +1 -0
  171. package/lib/module/tab-bar/index.js +24 -0
  172. package/lib/module/tab-bar/index.js.map +1 -0
  173. package/lib/module/tab-bar/index.web.js +26 -0
  174. package/lib/module/tab-bar/index.web.js.map +1 -0
  175. package/lib/module/tab-bar/minimize-context.js +118 -0
  176. package/lib/module/tab-bar/minimize-context.js.map +1 -0
  177. package/lib/module/tab-bar/shared.js +132 -0
  178. package/lib/module/tab-bar/shared.js.map +1 -0
  179. package/lib/module/tab-bar/surface.js +44 -0
  180. package/lib/module/tab-bar/surface.js.map +1 -0
  181. package/lib/module/tab-bar/surface.native.js +50 -0
  182. package/lib/module/tab-bar/surface.native.js.map +1 -0
  183. package/lib/module/tab-bar/surface.web.js +53 -0
  184. package/lib/module/tab-bar/surface.web.js.map +1 -0
  185. package/lib/module/tab-bar/types.js +4 -0
  186. package/lib/module/tab-bar/types.js.map +1 -0
  187. package/lib/module/tabs/Tabs.js +3 -8
  188. package/lib/module/tabs/Tabs.js.map +1 -1
  189. package/lib/module/toast/Positioner.js +110 -0
  190. package/lib/module/toast/Positioner.js.map +1 -0
  191. package/lib/module/toast/ToastContent.js +295 -0
  192. package/lib/module/toast/ToastContent.js.map +1 -0
  193. package/lib/module/toast/ToastHost.js +63 -0
  194. package/lib/module/toast/ToastHost.js.map +1 -0
  195. package/lib/module/toast/ToastHost.native.js +38 -0
  196. package/lib/module/toast/ToastHost.native.js.map +1 -0
  197. package/lib/module/toast/ToastIcon.js +52 -0
  198. package/lib/module/toast/ToastIcon.js.map +1 -0
  199. package/lib/module/toast/ToastRow.js +407 -0
  200. package/lib/module/toast/ToastRow.js.map +1 -0
  201. package/lib/module/toast/ToastSwipeHandler.js +182 -0
  202. package/lib/module/toast/ToastSwipeHandler.js.map +1 -0
  203. package/lib/module/toast/Toaster.js +198 -0
  204. package/lib/module/toast/Toaster.js.map +1 -0
  205. package/lib/module/toast/animations.js +261 -0
  206. package/lib/module/toast/animations.js.map +1 -0
  207. package/lib/module/toast/constants.js +52 -0
  208. package/lib/module/toast/constants.js.map +1 -0
  209. package/lib/module/toast/context.js +34 -0
  210. package/lib/module/toast/context.js.map +1 -0
  211. package/lib/module/toast/index.js +27 -103
  212. package/lib/module/toast/index.js.map +1 -1
  213. package/lib/module/toast/position-utils.js +107 -0
  214. package/lib/module/toast/position-utils.js.map +1 -0
  215. package/lib/module/toast/positioner-utils.js +134 -0
  216. package/lib/module/toast/positioner-utils.js.map +1 -0
  217. package/lib/module/toast/toast-comparator.js +22 -0
  218. package/lib/module/toast/toast-comparator.js.map +1 -0
  219. package/lib/module/toast/toast-fns.js +85 -0
  220. package/lib/module/toast/toast-fns.js.map +1 -0
  221. package/lib/module/toast/toast-store.js +346 -0
  222. package/lib/module/toast/toast-store.js.map +1 -0
  223. package/lib/module/toast/toast-timers.js +104 -0
  224. package/lib/module/toast/toast-timers.js.map +1 -0
  225. package/lib/module/toast/types.js +38 -0
  226. package/lib/module/toast/types.js.map +1 -1
  227. package/lib/module/toast/use-animated-target.js +52 -0
  228. package/lib/module/toast/use-animated-target.js.map +1 -0
  229. package/lib/module/toast/use-app-state.js +70 -0
  230. package/lib/module/toast/use-app-state.js.map +1 -0
  231. package/lib/module/toast/use-toast-colors.js +109 -0
  232. package/lib/module/toast/use-toast-colors.js.map +1 -0
  233. package/lib/module/toast/use-toast-position.js +35 -0
  234. package/lib/module/toast/use-toast-position.js.map +1 -0
  235. package/lib/module/tooltip/index.web.js +2 -1
  236. package/lib/module/tooltip/index.web.js.map +1 -1
  237. package/lib/module/zoomable-image-gallery/ZoomableImageGallery.js +20 -8
  238. package/lib/module/zoomable-image-gallery/ZoomableImageGallery.js.map +1 -1
  239. package/lib/typescript/commonjs/avatar-group/AvatarGroup.web.d.ts.map +1 -1
  240. package/lib/typescript/commonjs/bottom-sheet/index.web.d.ts.map +1 -1
  241. package/lib/typescript/commonjs/context-menu/index.web.d.ts.map +1 -1
  242. package/lib/typescript/commonjs/dialog/Dialog.d.ts.map +1 -1
  243. package/lib/typescript/commonjs/dialog/Dialog.web.d.ts.map +1 -1
  244. package/lib/typescript/commonjs/dialog/DialogHeader.d.ts.map +1 -1
  245. package/lib/typescript/commonjs/index.d.ts +2 -1
  246. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  247. package/lib/typescript/commonjs/index.web.d.ts +2 -1
  248. package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
  249. package/lib/typescript/commonjs/menu/index.web.d.ts.map +1 -1
  250. package/lib/typescript/commonjs/popover/index.web.d.ts.map +1 -1
  251. package/lib/typescript/commonjs/portal/index.d.ts.map +1 -1
  252. package/lib/typescript/commonjs/progressive-blur/index.d.ts +23 -0
  253. package/lib/typescript/commonjs/progressive-blur/index.d.ts.map +1 -0
  254. package/lib/typescript/commonjs/progressive-blur/index.web.d.ts +30 -0
  255. package/lib/typescript/commonjs/progressive-blur/index.web.d.ts.map +1 -0
  256. package/lib/typescript/commonjs/progressive-blur/shared.d.ts +35 -0
  257. package/lib/typescript/commonjs/progressive-blur/shared.d.ts.map +1 -0
  258. package/lib/typescript/commonjs/progressive-blur/types.d.ts +21 -0
  259. package/lib/typescript/commonjs/progressive-blur/types.d.ts.map +1 -0
  260. package/lib/typescript/commonjs/select/index.web.d.ts.map +1 -1
  261. package/lib/typescript/commonjs/slider/Slider.d.ts.map +1 -1
  262. package/lib/typescript/commonjs/styles/web-view-style.d.ts +21 -0
  263. package/lib/typescript/commonjs/styles/web-view-style.d.ts.map +1 -0
  264. package/lib/typescript/commonjs/switch/Switch.d.ts.map +1 -1
  265. package/lib/typescript/commonjs/tab-bar/TabBarBase.d.ts +36 -0
  266. package/lib/typescript/commonjs/tab-bar/TabBarBase.d.ts.map +1 -0
  267. package/lib/typescript/commonjs/tab-bar/expo-router/RouterTabBar.d.ts +59 -0
  268. package/lib/typescript/commonjs/tab-bar/expo-router/RouterTabBar.d.ts.map +1 -0
  269. package/lib/typescript/commonjs/tab-bar/expo-router/fading-tab-screen.d.ts +11 -0
  270. package/lib/typescript/commonjs/tab-bar/expo-router/fading-tab-screen.d.ts.map +1 -0
  271. package/lib/typescript/commonjs/tab-bar/expo-router/index.d.ts +14 -0
  272. package/lib/typescript/commonjs/tab-bar/expo-router/index.d.ts.map +1 -0
  273. package/lib/typescript/commonjs/tab-bar/glyph.d.ts +6 -0
  274. package/lib/typescript/commonjs/tab-bar/glyph.d.ts.map +1 -0
  275. package/lib/typescript/commonjs/tab-bar/glyph.native.d.ts +6 -0
  276. package/lib/typescript/commonjs/tab-bar/glyph.native.d.ts.map +1 -0
  277. package/lib/typescript/commonjs/tab-bar/index.d.ts +12 -0
  278. package/lib/typescript/commonjs/tab-bar/index.d.ts.map +1 -0
  279. package/lib/typescript/commonjs/tab-bar/index.web.d.ts +12 -0
  280. package/lib/typescript/commonjs/tab-bar/index.web.d.ts.map +1 -0
  281. package/lib/typescript/commonjs/tab-bar/minimize-context.d.ts +51 -0
  282. package/lib/typescript/commonjs/tab-bar/minimize-context.d.ts.map +1 -0
  283. package/lib/typescript/commonjs/tab-bar/shared.d.ts +93 -0
  284. package/lib/typescript/commonjs/tab-bar/shared.d.ts.map +1 -0
  285. package/lib/typescript/commonjs/tab-bar/surface.d.ts +6 -0
  286. package/lib/typescript/commonjs/tab-bar/surface.d.ts.map +1 -0
  287. package/lib/typescript/commonjs/tab-bar/surface.native.d.ts +6 -0
  288. package/lib/typescript/commonjs/tab-bar/surface.native.d.ts.map +1 -0
  289. package/lib/typescript/commonjs/tab-bar/surface.web.d.ts +6 -0
  290. package/lib/typescript/commonjs/tab-bar/surface.web.d.ts.map +1 -0
  291. package/lib/typescript/commonjs/tab-bar/types.d.ts +85 -0
  292. package/lib/typescript/commonjs/tab-bar/types.d.ts.map +1 -0
  293. package/lib/typescript/commonjs/tabs/Tabs.d.ts.map +1 -1
  294. package/lib/typescript/commonjs/toast/Positioner.d.ts +21 -0
  295. package/lib/typescript/commonjs/toast/Positioner.d.ts.map +1 -0
  296. package/lib/typescript/commonjs/toast/ToastContent.d.ts +14 -0
  297. package/lib/typescript/commonjs/toast/ToastContent.d.ts.map +1 -0
  298. package/lib/typescript/commonjs/toast/ToastHost.d.ts +6 -0
  299. package/lib/typescript/commonjs/toast/ToastHost.d.ts.map +1 -0
  300. package/lib/typescript/commonjs/toast/ToastHost.native.d.ts +6 -0
  301. package/lib/typescript/commonjs/toast/ToastHost.native.d.ts.map +1 -0
  302. package/lib/typescript/commonjs/toast/ToastIcon.d.ts +9 -0
  303. package/lib/typescript/commonjs/toast/ToastIcon.d.ts.map +1 -0
  304. package/lib/typescript/commonjs/toast/ToastRow.d.ts +80 -0
  305. package/lib/typescript/commonjs/toast/ToastRow.d.ts.map +1 -0
  306. package/lib/typescript/commonjs/toast/ToastSwipeHandler.d.ts +30 -0
  307. package/lib/typescript/commonjs/toast/ToastSwipeHandler.d.ts.map +1 -0
  308. package/lib/typescript/commonjs/toast/Toaster.d.ts +19 -0
  309. package/lib/typescript/commonjs/toast/Toaster.d.ts.map +1 -0
  310. package/lib/typescript/commonjs/toast/animations.d.ts +62 -0
  311. package/lib/typescript/commonjs/toast/animations.d.ts.map +1 -0
  312. package/lib/typescript/commonjs/toast/constants.d.ts +39 -0
  313. package/lib/typescript/commonjs/toast/constants.d.ts.map +1 -0
  314. package/lib/typescript/commonjs/toast/context.d.ts +19 -0
  315. package/lib/typescript/commonjs/toast/context.d.ts.map +1 -0
  316. package/lib/typescript/commonjs/toast/index.d.ts +23 -76
  317. package/lib/typescript/commonjs/toast/index.d.ts.map +1 -1
  318. package/lib/typescript/commonjs/toast/position-utils.d.ts +30 -0
  319. package/lib/typescript/commonjs/toast/position-utils.d.ts.map +1 -0
  320. package/lib/typescript/commonjs/toast/positioner-utils.d.ts +72 -0
  321. package/lib/typescript/commonjs/toast/positioner-utils.d.ts.map +1 -0
  322. package/lib/typescript/commonjs/toast/toast-comparator.d.ts +12 -0
  323. package/lib/typescript/commonjs/toast/toast-comparator.d.ts.map +1 -0
  324. package/lib/typescript/commonjs/toast/toast-fns.d.ts +3 -0
  325. package/lib/typescript/commonjs/toast/toast-fns.d.ts.map +1 -0
  326. package/lib/typescript/commonjs/toast/toast-store.d.ts +52 -0
  327. package/lib/typescript/commonjs/toast/toast-store.d.ts.map +1 -0
  328. package/lib/typescript/commonjs/toast/toast-timers.d.ts +24 -0
  329. package/lib/typescript/commonjs/toast/toast-timers.d.ts.map +1 -0
  330. package/lib/typescript/commonjs/toast/types.d.ts +222 -5
  331. package/lib/typescript/commonjs/toast/types.d.ts.map +1 -1
  332. package/lib/typescript/commonjs/toast/use-animated-target.d.ts +7 -0
  333. package/lib/typescript/commonjs/toast/use-animated-target.d.ts.map +1 -0
  334. package/lib/typescript/commonjs/toast/use-app-state.d.ts +18 -0
  335. package/lib/typescript/commonjs/toast/use-app-state.d.ts.map +1 -0
  336. package/lib/typescript/commonjs/toast/use-toast-colors.d.ts +22 -0
  337. package/lib/typescript/commonjs/toast/use-toast-colors.d.ts.map +1 -0
  338. package/lib/typescript/commonjs/toast/use-toast-position.d.ts +37 -0
  339. package/lib/typescript/commonjs/toast/use-toast-position.d.ts.map +1 -0
  340. package/lib/typescript/commonjs/tooltip/index.web.d.ts.map +1 -1
  341. package/lib/typescript/commonjs/zoomable-image-gallery/ZoomableImageGallery.d.ts.map +1 -1
  342. package/lib/typescript/module/avatar-group/AvatarGroup.web.d.ts.map +1 -1
  343. package/lib/typescript/module/bottom-sheet/index.web.d.ts.map +1 -1
  344. package/lib/typescript/module/context-menu/index.web.d.ts.map +1 -1
  345. package/lib/typescript/module/dialog/Dialog.d.ts.map +1 -1
  346. package/lib/typescript/module/dialog/Dialog.web.d.ts.map +1 -1
  347. package/lib/typescript/module/dialog/DialogHeader.d.ts.map +1 -1
  348. package/lib/typescript/module/index.d.ts +2 -1
  349. package/lib/typescript/module/index.d.ts.map +1 -1
  350. package/lib/typescript/module/index.web.d.ts +2 -1
  351. package/lib/typescript/module/index.web.d.ts.map +1 -1
  352. package/lib/typescript/module/menu/index.web.d.ts.map +1 -1
  353. package/lib/typescript/module/popover/index.web.d.ts.map +1 -1
  354. package/lib/typescript/module/portal/index.d.ts.map +1 -1
  355. package/lib/typescript/module/progressive-blur/index.d.ts +23 -0
  356. package/lib/typescript/module/progressive-blur/index.d.ts.map +1 -0
  357. package/lib/typescript/module/progressive-blur/index.web.d.ts +30 -0
  358. package/lib/typescript/module/progressive-blur/index.web.d.ts.map +1 -0
  359. package/lib/typescript/module/progressive-blur/shared.d.ts +35 -0
  360. package/lib/typescript/module/progressive-blur/shared.d.ts.map +1 -0
  361. package/lib/typescript/module/progressive-blur/types.d.ts +21 -0
  362. package/lib/typescript/module/progressive-blur/types.d.ts.map +1 -0
  363. package/lib/typescript/module/select/index.web.d.ts.map +1 -1
  364. package/lib/typescript/module/slider/Slider.d.ts.map +1 -1
  365. package/lib/typescript/module/styles/web-view-style.d.ts +21 -0
  366. package/lib/typescript/module/styles/web-view-style.d.ts.map +1 -0
  367. package/lib/typescript/module/switch/Switch.d.ts.map +1 -1
  368. package/lib/typescript/module/tab-bar/TabBarBase.d.ts +36 -0
  369. package/lib/typescript/module/tab-bar/TabBarBase.d.ts.map +1 -0
  370. package/lib/typescript/module/tab-bar/expo-router/RouterTabBar.d.ts +59 -0
  371. package/lib/typescript/module/tab-bar/expo-router/RouterTabBar.d.ts.map +1 -0
  372. package/lib/typescript/module/tab-bar/expo-router/fading-tab-screen.d.ts +11 -0
  373. package/lib/typescript/module/tab-bar/expo-router/fading-tab-screen.d.ts.map +1 -0
  374. package/lib/typescript/module/tab-bar/expo-router/index.d.ts +14 -0
  375. package/lib/typescript/module/tab-bar/expo-router/index.d.ts.map +1 -0
  376. package/lib/typescript/module/tab-bar/glyph.d.ts +6 -0
  377. package/lib/typescript/module/tab-bar/glyph.d.ts.map +1 -0
  378. package/lib/typescript/module/tab-bar/glyph.native.d.ts +6 -0
  379. package/lib/typescript/module/tab-bar/glyph.native.d.ts.map +1 -0
  380. package/lib/typescript/module/tab-bar/index.d.ts +12 -0
  381. package/lib/typescript/module/tab-bar/index.d.ts.map +1 -0
  382. package/lib/typescript/module/tab-bar/index.web.d.ts +12 -0
  383. package/lib/typescript/module/tab-bar/index.web.d.ts.map +1 -0
  384. package/lib/typescript/module/tab-bar/minimize-context.d.ts +51 -0
  385. package/lib/typescript/module/tab-bar/minimize-context.d.ts.map +1 -0
  386. package/lib/typescript/module/tab-bar/shared.d.ts +93 -0
  387. package/lib/typescript/module/tab-bar/shared.d.ts.map +1 -0
  388. package/lib/typescript/module/tab-bar/surface.d.ts +6 -0
  389. package/lib/typescript/module/tab-bar/surface.d.ts.map +1 -0
  390. package/lib/typescript/module/tab-bar/surface.native.d.ts +6 -0
  391. package/lib/typescript/module/tab-bar/surface.native.d.ts.map +1 -0
  392. package/lib/typescript/module/tab-bar/surface.web.d.ts +6 -0
  393. package/lib/typescript/module/tab-bar/surface.web.d.ts.map +1 -0
  394. package/lib/typescript/module/tab-bar/types.d.ts +85 -0
  395. package/lib/typescript/module/tab-bar/types.d.ts.map +1 -0
  396. package/lib/typescript/module/tabs/Tabs.d.ts.map +1 -1
  397. package/lib/typescript/module/toast/Positioner.d.ts +21 -0
  398. package/lib/typescript/module/toast/Positioner.d.ts.map +1 -0
  399. package/lib/typescript/module/toast/ToastContent.d.ts +14 -0
  400. package/lib/typescript/module/toast/ToastContent.d.ts.map +1 -0
  401. package/lib/typescript/module/toast/ToastHost.d.ts +6 -0
  402. package/lib/typescript/module/toast/ToastHost.d.ts.map +1 -0
  403. package/lib/typescript/module/toast/ToastHost.native.d.ts +6 -0
  404. package/lib/typescript/module/toast/ToastHost.native.d.ts.map +1 -0
  405. package/lib/typescript/module/toast/ToastIcon.d.ts +9 -0
  406. package/lib/typescript/module/toast/ToastIcon.d.ts.map +1 -0
  407. package/lib/typescript/module/toast/ToastRow.d.ts +80 -0
  408. package/lib/typescript/module/toast/ToastRow.d.ts.map +1 -0
  409. package/lib/typescript/module/toast/ToastSwipeHandler.d.ts +30 -0
  410. package/lib/typescript/module/toast/ToastSwipeHandler.d.ts.map +1 -0
  411. package/lib/typescript/module/toast/Toaster.d.ts +19 -0
  412. package/lib/typescript/module/toast/Toaster.d.ts.map +1 -0
  413. package/lib/typescript/module/toast/animations.d.ts +62 -0
  414. package/lib/typescript/module/toast/animations.d.ts.map +1 -0
  415. package/lib/typescript/module/toast/constants.d.ts +39 -0
  416. package/lib/typescript/module/toast/constants.d.ts.map +1 -0
  417. package/lib/typescript/module/toast/context.d.ts +19 -0
  418. package/lib/typescript/module/toast/context.d.ts.map +1 -0
  419. package/lib/typescript/module/toast/index.d.ts +23 -76
  420. package/lib/typescript/module/toast/index.d.ts.map +1 -1
  421. package/lib/typescript/module/toast/position-utils.d.ts +30 -0
  422. package/lib/typescript/module/toast/position-utils.d.ts.map +1 -0
  423. package/lib/typescript/module/toast/positioner-utils.d.ts +72 -0
  424. package/lib/typescript/module/toast/positioner-utils.d.ts.map +1 -0
  425. package/lib/typescript/module/toast/toast-comparator.d.ts +12 -0
  426. package/lib/typescript/module/toast/toast-comparator.d.ts.map +1 -0
  427. package/lib/typescript/module/toast/toast-fns.d.ts +3 -0
  428. package/lib/typescript/module/toast/toast-fns.d.ts.map +1 -0
  429. package/lib/typescript/module/toast/toast-store.d.ts +52 -0
  430. package/lib/typescript/module/toast/toast-store.d.ts.map +1 -0
  431. package/lib/typescript/module/toast/toast-timers.d.ts +24 -0
  432. package/lib/typescript/module/toast/toast-timers.d.ts.map +1 -0
  433. package/lib/typescript/module/toast/types.d.ts +222 -5
  434. package/lib/typescript/module/toast/types.d.ts.map +1 -1
  435. package/lib/typescript/module/toast/use-animated-target.d.ts +7 -0
  436. package/lib/typescript/module/toast/use-animated-target.d.ts.map +1 -0
  437. package/lib/typescript/module/toast/use-app-state.d.ts +18 -0
  438. package/lib/typescript/module/toast/use-app-state.d.ts.map +1 -0
  439. package/lib/typescript/module/toast/use-toast-colors.d.ts +22 -0
  440. package/lib/typescript/module/toast/use-toast-colors.d.ts.map +1 -0
  441. package/lib/typescript/module/toast/use-toast-position.d.ts +37 -0
  442. package/lib/typescript/module/toast/use-toast-position.d.ts.map +1 -0
  443. package/lib/typescript/module/tooltip/index.web.d.ts.map +1 -1
  444. package/lib/typescript/module/zoomable-image-gallery/ZoomableImageGallery.d.ts.map +1 -1
  445. package/package.json +63 -25
  446. package/src/__tests__/TabBar.test.tsx +342 -0
  447. package/src/__tests__/TabBarReanimatedDeps.test.ts +130 -0
  448. package/src/__tests__/TabBarWebFork.test.ts +197 -0
  449. package/src/__tests__/ToastContent.test.tsx +192 -0
  450. package/src/__tests__/ToastHostWebFork.test.ts +155 -0
  451. package/src/__tests__/Toaster.test.tsx +527 -0
  452. package/src/__tests__/animated-style-deps.test.ts +156 -0
  453. package/src/__tests__/toast-animations.test.ts +98 -0
  454. package/src/__tests__/toast-comparator.test.ts +131 -0
  455. package/src/__tests__/toast-enter-driver.test.ts +147 -0
  456. package/src/__tests__/toast-fns.test.ts +240 -0
  457. package/src/__tests__/toast-position-utils.test.ts +259 -0
  458. package/src/__tests__/toast-positioner-utils.test.ts +214 -0
  459. package/src/__tests__/toast-store.test.ts +622 -0
  460. package/src/__tests__/toast-timers.test.ts +163 -0
  461. package/src/__tests__/use-animated-target.test.tsx +60 -0
  462. package/src/__tests__/use-app-state.test.tsx +127 -0
  463. package/src/__tests__/use-toast-colors.test.tsx +189 -0
  464. package/src/__tests__/web-position-fixed.test.ts +70 -0
  465. package/src/avatar-group/AvatarGroup.web.tsx +2 -1
  466. package/src/bottom-sheet/index.web.tsx +4 -3
  467. package/src/context-menu/index.web.tsx +6 -6
  468. package/src/dialog/Dialog.tsx +7 -4
  469. package/src/dialog/Dialog.web.tsx +14 -14
  470. package/src/dialog/DialogHeader.tsx +72 -17
  471. package/src/index.ts +4 -1
  472. package/src/index.web.ts +4 -1
  473. package/src/menu/index.web.tsx +5 -5
  474. package/src/popover/index.web.tsx +8 -6
  475. package/src/portal/index.tsx +4 -1
  476. package/src/progressive-blur/index.tsx +78 -0
  477. package/src/progressive-blur/index.web.tsx +65 -0
  478. package/src/progressive-blur/shared.ts +81 -0
  479. package/src/progressive-blur/types.ts +21 -0
  480. package/src/select/index.web.tsx +5 -5
  481. package/src/slider/Slider.tsx +3 -5
  482. package/src/styles/web-view-style.ts +21 -0
  483. package/src/switch/Switch.tsx +4 -5
  484. package/src/tab-bar/TabBar.stories.tsx +217 -0
  485. package/src/tab-bar/TabBarBase.tsx +517 -0
  486. package/src/tab-bar/expo-router/RouterTabBar.tsx +80 -0
  487. package/src/tab-bar/expo-router/fading-tab-screen.tsx +109 -0
  488. package/src/tab-bar/expo-router/index.ts +13 -0
  489. package/src/tab-bar/glyph.native.tsx +46 -0
  490. package/src/tab-bar/glyph.tsx +31 -0
  491. package/src/tab-bar/index.ts +32 -0
  492. package/src/tab-bar/index.web.tsx +34 -0
  493. package/src/tab-bar/minimize-context.tsx +117 -0
  494. package/src/tab-bar/shared.ts +159 -0
  495. package/src/tab-bar/surface.native.tsx +60 -0
  496. package/src/tab-bar/surface.tsx +47 -0
  497. package/src/tab-bar/surface.web.tsx +56 -0
  498. package/src/tab-bar/types.ts +88 -0
  499. package/src/tabs/Tabs.tsx +3 -5
  500. package/src/toast/Positioner.tsx +121 -0
  501. package/src/toast/Toast.stories.tsx +292 -65
  502. package/src/toast/ToastContent.tsx +405 -0
  503. package/src/toast/ToastHost.native.tsx +31 -0
  504. package/src/toast/ToastHost.tsx +67 -0
  505. package/src/toast/ToastIcon.tsx +55 -0
  506. package/src/toast/ToastRow.tsx +485 -0
  507. package/src/toast/ToastSwipeHandler.tsx +222 -0
  508. package/src/toast/Toaster.tsx +259 -0
  509. package/src/toast/animations.ts +313 -0
  510. package/src/toast/constants.ts +76 -0
  511. package/src/toast/context.tsx +44 -0
  512. package/src/toast/index.tsx +47 -123
  513. package/src/toast/position-utils.ts +149 -0
  514. package/src/toast/positioner-utils.ts +142 -0
  515. package/src/toast/toast-comparator.ts +41 -0
  516. package/src/toast/toast-fns.ts +104 -0
  517. package/src/toast/toast-store.ts +432 -0
  518. package/src/toast/toast-timers.ts +124 -0
  519. package/src/toast/types.ts +301 -5
  520. package/src/toast/use-animated-target.ts +61 -0
  521. package/src/toast/use-app-state.ts +77 -0
  522. package/src/toast/use-toast-colors.ts +133 -0
  523. package/src/toast/use-toast-position.ts +46 -0
  524. package/src/tooltip/index.web.tsx +2 -1
  525. package/src/zoomable-image-gallery/ZoomableImageGallery.stories.tsx +134 -0
  526. package/src/zoomable-image-gallery/ZoomableImageGallery.tsx +50 -27
  527. package/lib/commonjs/toast/Toast.js +0 -272
  528. package/lib/commonjs/toast/Toast.js.map +0 -1
  529. package/lib/commonjs/toast/const.js +0 -8
  530. package/lib/commonjs/toast/const.js.map +0 -1
  531. package/lib/commonjs/toast/index.web.js +0 -114
  532. package/lib/commonjs/toast/index.web.js.map +0 -1
  533. package/lib/commonjs/toast/sonner/index.js +0 -9
  534. package/lib/commonjs/toast/sonner/index.js.map +0 -1
  535. package/lib/commonjs/toast/sonner/index.web.js +0 -9
  536. package/lib/commonjs/toast/sonner/index.web.js.map +0 -1
  537. package/lib/module/toast/Toast.js +0 -263
  538. package/lib/module/toast/Toast.js.map +0 -1
  539. package/lib/module/toast/const.js +0 -4
  540. package/lib/module/toast/const.js.map +0 -1
  541. package/lib/module/toast/index.web.js +0 -74
  542. package/lib/module/toast/index.web.js.map +0 -1
  543. package/lib/module/toast/sonner/index.js +0 -5
  544. package/lib/module/toast/sonner/index.js.map +0 -1
  545. package/lib/module/toast/sonner/index.web.js +0 -5
  546. package/lib/module/toast/sonner/index.web.js.map +0 -1
  547. package/lib/typescript/commonjs/toast/Toast.d.ts +0 -23
  548. package/lib/typescript/commonjs/toast/Toast.d.ts.map +0 -1
  549. package/lib/typescript/commonjs/toast/const.d.ts +0 -2
  550. package/lib/typescript/commonjs/toast/const.d.ts.map +0 -1
  551. package/lib/typescript/commonjs/toast/index.web.d.ts +0 -29
  552. package/lib/typescript/commonjs/toast/index.web.d.ts.map +0 -1
  553. package/lib/typescript/commonjs/toast/sonner/index.d.ts +0 -2
  554. package/lib/typescript/commonjs/toast/sonner/index.d.ts.map +0 -1
  555. package/lib/typescript/commonjs/toast/sonner/index.web.d.ts +0 -2
  556. package/lib/typescript/commonjs/toast/sonner/index.web.d.ts.map +0 -1
  557. package/lib/typescript/module/toast/Toast.d.ts +0 -23
  558. package/lib/typescript/module/toast/Toast.d.ts.map +0 -1
  559. package/lib/typescript/module/toast/const.d.ts +0 -2
  560. package/lib/typescript/module/toast/const.d.ts.map +0 -1
  561. package/lib/typescript/module/toast/index.web.d.ts +0 -29
  562. package/lib/typescript/module/toast/index.web.d.ts.map +0 -1
  563. package/lib/typescript/module/toast/sonner/index.d.ts +0 -2
  564. package/lib/typescript/module/toast/sonner/index.d.ts.map +0 -1
  565. package/lib/typescript/module/toast/sonner/index.web.d.ts +0 -2
  566. package/lib/typescript/module/toast/sonner/index.web.d.ts.map +0 -1
  567. package/src/toast/Toast.tsx +0 -271
  568. package/src/toast/const.ts +0 -1
  569. package/src/toast/index.web.tsx +0 -101
  570. package/src/toast/sonner/index.ts +0 -3
  571. package/src/toast/sonner/index.web.ts +0 -3
@@ -0,0 +1,205 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Toaster = void 0;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ var _constants = require("./constants.js");
9
+ var _context = require("./context.js");
10
+ var _positionUtils = require("./position-utils.js");
11
+ var _Positioner = require("./Positioner.js");
12
+ var _ToastHost = require("./ToastHost");
13
+ var _ToastRow = require("./ToastRow.js");
14
+ var _toastStore = require("./toast-store.js");
15
+ var _useAppState = require("./use-app-state.js");
16
+ var _jsxRuntime = require("react/jsx-runtime");
17
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
18
+ /**
19
+ * Derived from sonner-native v0.26.4 — src/toaster.tsx
20
+ * (MIT © Gunnar Torfi Steinarsson). See the top-level NOTICE.
21
+ *
22
+ * Subscribes to the store, resolves the outlet configuration once, groups rows by
23
+ * position and renders each group through `Positioner` inside the platform
24
+ * `ToastHost`.
25
+ *
26
+ * W5 — ONE `AppState` subscription for the whole stack. Upstream subscribes per
27
+ * row, so N toasts meant N `visibilitychange` listeners all doing the same work;
28
+ * the store already exposes stack-wide `pauseAllTimers`/`resumeAllTimers`.
29
+ *
30
+ * `react-native-screens` is not imported here either — the platform wrapper is
31
+ * `ToastHost`'s concern (D6).
32
+ */
33
+
34
+ const ALL_POSITIONS = ['top-center', 'bottom-center', 'center'];
35
+
36
+ // Stable identities so the context memos below do not invalidate every render.
37
+ const EMPTY_TOAST_OPTIONS = {};
38
+ const EMPTY_ICONS = {};
39
+ const EMPTY_ANIMATION = {};
40
+
41
+ /**
42
+ * A top-anchored stack grows downward from the newest toast, so its rows render
43
+ * in reverse order.
44
+ */
45
+ function orderToastsFromPosition(toasts, position) {
46
+ return position === 'top-center' ? toasts.slice().reverse() : toasts;
47
+ }
48
+ const Toaster = ({
49
+ ToasterOverlayWrapper,
50
+ ToastWrapper,
51
+ duration = _constants.toastDefaults.duration,
52
+ position = _constants.toastDefaults.position,
53
+ offset = _constants.toastDefaults.offset,
54
+ visibleToasts = _constants.toastDefaults.visibleToasts,
55
+ swipeToDismissDirection = _constants.toastDefaults.swipeToDismissDirection,
56
+ closeButton = _constants.toastDefaults.closeButton,
57
+ gap = _constants.toastDefaults.gap,
58
+ theme = _constants.toastDefaults.theme,
59
+ invert = _constants.toastDefaults.invert,
60
+ richColors = _constants.toastDefaults.richColors,
61
+ enableStacking = _constants.toastDefaults.enableStacking,
62
+ autoWiggleOnUpdate = _constants.toastDefaults.autoWiggleOnUpdate,
63
+ pauseWhenPageIsHidden = _constants.toastDefaults.pauseWhenPageIsHidden,
64
+ allowFontScaling = _constants.toastDefaults.allowFontScaling,
65
+ maxFontSizeMultiplier,
66
+ toastOptions = EMPTY_TOAST_OPTIONS,
67
+ icons = EMPTY_ICONS,
68
+ animation = EMPTY_ANIMATION,
69
+ unstyled,
70
+ positionerStyle,
71
+ style,
72
+ styles: styleOverrides
73
+ }) => {
74
+ const {
75
+ toasts,
76
+ shouldShowOverlay,
77
+ toastHeights,
78
+ isExpanded
79
+ } = React.useSyncExternalStore(_toastStore.toastStore.subscribe, _toastStore.toastStore.getSnapshot, _toastStore.toastStore.getSnapshot);
80
+
81
+ // Runs even while idle: the store must know the outlet's limits BEFORE the
82
+ // first toast arrives, or that toast is resolved against the bare defaults.
83
+ React.useEffect(() => {
84
+ _toastStore.toastStore.setConfig({
85
+ autoWiggleOnUpdate,
86
+ visibleToasts,
87
+ duration,
88
+ pauseWhenPageIsHidden
89
+ });
90
+ }, [autoWiggleOnUpdate, visibleToasts, duration, pauseWhenPageIsHidden]);
91
+ const onBackground = React.useCallback(() => {
92
+ if (pauseWhenPageIsHidden) {
93
+ _toastStore.toastStore.pauseAllTimers();
94
+ }
95
+ }, [pauseWhenPageIsHidden]);
96
+ const onForeground = React.useCallback(() => {
97
+ if (pauseWhenPageIsHidden) {
98
+ _toastStore.toastStore.resumeAllTimers();
99
+ }
100
+ }, [pauseWhenPageIsHidden]);
101
+ (0, _useAppState.useAppStateChange)({
102
+ onBackground,
103
+ onForeground
104
+ });
105
+ const stableValue = React.useMemo(() => ({
106
+ duration,
107
+ position,
108
+ offset,
109
+ visibleToasts,
110
+ swipeToDismissDirection,
111
+ closeButton,
112
+ gap,
113
+ theme,
114
+ invert,
115
+ richColors,
116
+ enableStacking,
117
+ autoWiggleOnUpdate,
118
+ pauseWhenPageIsHidden,
119
+ allowFontScaling,
120
+ maxFontSizeMultiplier,
121
+ toastOptions,
122
+ icons,
123
+ animation,
124
+ unstyled: unstyled ?? toastOptions.unstyled ?? _constants.toastDefaults.unstyled
125
+ }), [duration, position, offset, visibleToasts, swipeToDismissDirection, closeButton, gap, theme, invert, richColors, enableStacking, autoWiggleOnUpdate, pauseWhenPageIsHidden, allowFontScaling, maxFontSizeMultiplier, toastOptions, icons, animation, unstyled]);
126
+ const dynamicValue = React.useMemo(() => ({
127
+ toastHeights,
128
+ isExpanded,
129
+ expand: _toastStore.toastStore.expand,
130
+ collapse: _toastStore.toastStore.collapse,
131
+ toggleExpand: _toastStore.toastStore.toggleExpand
132
+ }), [toastHeights, isExpanded]);
133
+
134
+ /**
135
+ * Rows grouped by their EFFECTIVE position, which for a toast with no explicit
136
+ * `position` is the outlet's configured one — the same resolution `ToastRow`
137
+ * itself does (`positionProp ?? positionCtx`).
138
+ *
139
+ * It must NOT be "whichever group happens to come first". Grouping a
140
+ * position-less row by index put it in the top-center group the moment any
141
+ * top-center toast existed, because `ALL_POSITIONS` starts with `top-center`:
142
+ * a plain `toast('Saved')` then rendered against the top inset (visible only as
143
+ * a sliver above the screen edge), and an already-placed one JUMPED there when a
144
+ * top-center toast arrived.
145
+ *
146
+ * The configured position is always kept, even with no rows in it, so
147
+ * position-less rows always have a home. Each group is ordered by its OWN
148
+ * position: a top-anchored stack renders in reverse, and applying the outlet's
149
+ * ordering to every group reversed the wrong ones.
150
+ */
151
+ const toastsByPosition = React.useMemo(() => {
152
+ const groups = new Map();
153
+ for (const candidate of ALL_POSITIONS) {
154
+ const group = toasts.filter(toast => (toast.position ?? position) === candidate);
155
+ if (candidate === position || group.length > 0) {
156
+ groups.set(candidate, orderToastsFromPosition(group, candidate));
157
+ }
158
+ }
159
+ return groups;
160
+ }, [toasts, position]);
161
+ const onDismiss = React.useCallback(id => {
162
+ _toastStore.toastStore.dismissToast(id, 'onDismiss');
163
+ }, []);
164
+
165
+ // Nothing to host while idle. `shouldShowOverlay` stays true for the length of
166
+ // the exit animation after the last dismissal, so this never cuts one short.
167
+ if (!shouldShowOverlay) {
168
+ return null;
169
+ }
170
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ToastHost.ToastHost, {
171
+ ToasterOverlayWrapper: ToasterOverlayWrapper,
172
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.ToastContext.Provider, {
173
+ value: stableValue,
174
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.DynamicToastContext.Provider, {
175
+ value: dynamicValue,
176
+ children: Array.from(toastsByPosition, ([currentPosition, toastsForPosition]) => {
177
+ const orderedToastIds = (0, _positionUtils.getOrderedToastIds)(toastsForPosition, currentPosition, enableStacking);
178
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Positioner.Positioner, {
179
+ position: currentPosition,
180
+ style: positionerStyle,
181
+ children: toastsForPosition.map((toast, index) => {
182
+ const row = /*#__PURE__*/(0, _jsxRuntime.jsx)(_ToastRow.ToastRow, {
183
+ ...toast,
184
+ style: toast.style ?? style,
185
+ styles: toast.styles ?? styleOverrides,
186
+ index: index,
187
+ numberOfToasts: toastsForPosition.length,
188
+ orderedToastIds: orderedToastIds,
189
+ onDismiss: onDismiss,
190
+ ref: _toastStore.toastStore.getToastRef(toast.id)
191
+ }, toast.id);
192
+ return ToastWrapper ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ToastWrapper, {
193
+ toastId: toast.id,
194
+ children: row
195
+ }, toast.id) : row;
196
+ })
197
+ }, currentPosition);
198
+ })
199
+ })
200
+ })
201
+ });
202
+ };
203
+ exports.Toaster = Toaster;
204
+ Toaster.displayName = 'Toaster';
205
+ //# sourceMappingURL=Toaster.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","_interopRequireWildcard","require","_constants","_context","_positionUtils","_Positioner","_ToastHost","_ToastRow","_toastStore","_useAppState","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ALL_POSITIONS","EMPTY_TOAST_OPTIONS","EMPTY_ICONS","EMPTY_ANIMATION","orderToastsFromPosition","toasts","position","slice","reverse","Toaster","ToasterOverlayWrapper","ToastWrapper","duration","toastDefaults","offset","visibleToasts","swipeToDismissDirection","closeButton","gap","theme","invert","richColors","enableStacking","autoWiggleOnUpdate","pauseWhenPageIsHidden","allowFontScaling","maxFontSizeMultiplier","toastOptions","icons","animation","unstyled","positionerStyle","style","styles","styleOverrides","shouldShowOverlay","toastHeights","isExpanded","useSyncExternalStore","toastStore","subscribe","getSnapshot","useEffect","setConfig","onBackground","useCallback","pauseAllTimers","onForeground","resumeAllTimers","useAppStateChange","stableValue","useMemo","dynamicValue","expand","collapse","toggleExpand","toastsByPosition","groups","Map","candidate","group","filter","toast","length","onDismiss","id","dismissToast","jsx","ToastHost","children","ToastContext","Provider","value","DynamicToastContext","Array","from","currentPosition","toastsForPosition","orderedToastIds","getOrderedToastIds","Positioner","map","index","row","ToastRow","numberOfToasts","ref","getToastRef","toastId","exports","displayName"],"sourceRoot":"../../../src","sources":["toast/Toaster.tsx"],"mappings":";;;;;;AAeA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAQA,IAAAQ,YAAA,GAAAR,OAAA;AAAoD,IAAAS,WAAA,GAAAT,OAAA;AAAA,SAAAD,wBAAAW,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAb,uBAAA,YAAAA,CAAAW,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,C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B;IAAC,CACV;EAAC,CACf,CAAC;AAEhB,CAAC;AAACa,OAAA,CAAAhF,OAAA,GAAAA,OAAA;AAEFA,OAAO,CAACiF,WAAW,GAAG,SAAS","ignoreList":[]}
@@ -0,0 +1,274 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.easeOutQuartFn = exports.easeInOutCircFn = exports.TOAST_ENTER_DRIVER = exports.MAX_CACHED_ANIMATIONS = void 0;
7
+ exports.getToastEnterAnimation = getToastEnterAnimation;
8
+ exports.getToastExitAnimation = getToastExitAnimation;
9
+ exports.resolveAnimationField = void 0;
10
+ exports.resolveToastEnterAnimation = resolveToastEnterAnimation;
11
+ exports.toastAnimationCacheSize = toastAnimationCacheSize;
12
+ exports.useToastLayoutAnimations = void 0;
13
+ var _reactNative = require("react-native");
14
+ var _reactNativeReanimated = require("react-native-reanimated");
15
+ var _constants = require("./constants.js");
16
+ var _context = require("./context.js");
17
+ /**
18
+ * Derived from sonner-native v0.26.4 — src/animations.ts, src/animation-utils.ts
19
+ * and src/easings.ts (MIT © Gunnar Torfi Steinarsson). See the top-level NOTICE.
20
+ *
21
+ * W1 — THE EXIT DEFAULT IS A `Keyframe` INSTANCE, NOT A WORKLET BUILDER.
22
+ *
23
+ * Upstream returns a custom `EntryExitAnimationFunction` for both directions. On
24
+ * web that produces NO animation at all: reanimated's web layout-animation
25
+ * manager looks the builder up by preset name, finds none, logs a warning per
26
+ * toast and falls through to `makeElementVisible`, so a toast simply appears and
27
+ * disappears. A `ReanimatedKeyframe` compiles to a real CSS `@keyframes` rule on
28
+ * web and to the same interpolation on native, so one definition covers both
29
+ * platforms — which is what the exit default below is.
30
+ *
31
+ * ON WEB THE ENTER IS NOT A LAYOUT ANIMATION — NEVER HAND IT TO `entering`
32
+ * THERE. This is the fix for a blocker where a second toast landed exactly on top
33
+ * of the first, and it MUST NOT be undone by "simplifying" the web enter back
34
+ * into a `Keyframe`:
35
+ *
36
+ * reanimated's web ENTERING path calls `setElementAnimation(element, config,
37
+ * true)`, whose third argument is `shouldSavePosition`. For any animation name
38
+ * that is not one of its own predefined presets — which is every `Keyframe`,
39
+ * since those mint a fresh `REA-ENTERING-n` rule — it also schedules
40
+ * `scheduleAnimationCleanup(name, duration, cb)`, and that callback runs
41
+ * `setElementPosition(element, snapshot)`: `position: absolute`, an explicit
42
+ * `top`/`left`/`width`/`height` and `transform: ''`, taken from a snapshot
43
+ * captured when the enter animation ENDED. The timeout is `duration * 5`, so at
44
+ * Bloom's 300ms enter the row is frozen in VIEWPORT coordinates 1500ms after it
45
+ * appeared, and its parent collapses to `height: 0`. A row that moves inside
46
+ * that window — i.e. any row that is still on screen when the next toast
47
+ * arrives — has its stack translate exactly cancelled and redraws on top of the
48
+ * newcomer. It is completely silent: no error, no warning.
49
+ *
50
+ * So on web the enter is driven imperatively instead: `ToastRow` seeds a shared
51
+ * value at 0 and animates it to 1 (`useAnimatedTarget`'s `from`), interpolating
52
+ * opacity and `ENTER_TRANSLATE_Y` to the same distances and curve the `Keyframe`
53
+ * uses, without touching reanimated's web layout-animation machinery.
54
+ *
55
+ * NATIVE KEEPS THE `Keyframe` ON `entering`. `ENTER_DRIVER` below is the ONE
56
+ * switch: there is no `setElementPosition` on native — that whole pin is a web-DOM
57
+ * behaviour — so native pays nothing for the web bug, and driving the enter
58
+ * imperatively there instead regressed it hard (a `bottom-center` toast stopped
59
+ * painting altogether). Native runs the device-verified layout-animation path and
60
+ * never starts a mount-time `withTiming` for the enter at all.
61
+ *
62
+ * The EXIT goes through `exiting` on BOTH platforms, which is safe: reanimated
63
+ * pins the throwaway dummy clone it animates (`shouldSavePosition` is false for
64
+ * the real element), and it is what keeps a dismissed row mounted long enough to
65
+ * animate.
66
+ *
67
+ * Consumer-supplied *predefined* builders (`FadeIn`, `SlideInUp`) keep working on
68
+ * both platforms for both enter and exit, and always go through `entering` /
69
+ * `exiting`. A consumer's own custom worklet builder still animates on native and
70
+ * is silently ignored on web, and a consumer's custom `Keyframe` passed as
71
+ * `animation.enter` will hit the pin described above on web — both are reanimated
72
+ * limitations Bloom cannot bridge.
73
+ *
74
+ * Exit instances are cached per animation shape because building one is not free
75
+ * and, more importantly, because `Keyframe.parseDefinitions()` MUTATES the
76
+ * definition object it was constructed with (it rewrites `from`/`to` into
77
+ * `0`/`100` and deletes them). Each cached instance therefore owns its own
78
+ * definition object; sharing one definition across two instances would make the
79
+ * second throw "Please provide 0 or 'from' keyframe". Re-parsing a single
80
+ * instance is idempotent, so one instance is safely shared by every row of the
81
+ * same shape.
82
+ */
83
+
84
+ /**
85
+ * `Easing.bezier()` (not `bezierFn`) returns an easing *factory*, which is what
86
+ * `Keyframe` accepts on both platforms — reanimated's dev-only worklet assertion
87
+ * short-circuits on the `.factory` property, so these pass without the worklets
88
+ * babel plugin too.
89
+ */
90
+ const EASE_OUT_QUART = _reactNativeReanimated.Easing.bezier(0.165, 0.84, 0.44, 1);
91
+ const EASE_IN_OUT_CUBIC = _reactNativeReanimated.Easing.bezier(0.645, 0.045, 0.355, 1);
92
+ /**
93
+ * THE one platform switch in the toast engine: which mechanism plays Bloom's
94
+ * DEFAULT enter animation. See the header for why the two platforms cannot share
95
+ * one mechanism.
96
+ */
97
+ const TOAST_ENTER_DRIVER = exports.TOAST_ENTER_DRIVER = _reactNative.Platform.OS === 'web' ? 'imperative' : 'layoutAnimation';
98
+
99
+ /** Worklet-callable easing for `withTiming` inside mappers and layout transitions. */
100
+ const easeOutQuartFn = exports.easeOutQuartFn = _reactNativeReanimated.Easing.bezierFn(0.165, 0.84, 0.44, 1);
101
+ const easeInOutCircFn = exports.easeInOutCircFn = _reactNativeReanimated.Easing.bezierFn(0.785, 0.135, 0.15, 0.86);
102
+
103
+ /** How far a row travels on the way in, per position. */
104
+ const ENTER_TRANSLATE_Y = {
105
+ 'top-center': -20,
106
+ 'bottom-center': 50,
107
+ center: 50
108
+ };
109
+
110
+ /** A lone row leaves the screen entirely; a stacked one only slides by `stackGap`. */
111
+ const EXIT_TRANSLATE_Y_SINGLE = 150;
112
+
113
+ /**
114
+ * Bounded so an animated `gap` cannot grow the cache without limit. The natural
115
+ * key space is 3 enter shapes + 3 positions x hidden x single x one stackGap = 15
116
+ * entries, so this leaves room for a few gap values while staying O(1) memory.
117
+ */
118
+ const MAX_CACHED_ANIMATIONS = exports.MAX_CACHED_ANIMATIONS = 32;
119
+ const animationCache = new Map();
120
+ function cachedAnimation(key, build) {
121
+ const hit = animationCache.get(key);
122
+ if (hit) {
123
+ return hit;
124
+ }
125
+ if (animationCache.size >= MAX_CACHED_ANIMATIONS) {
126
+ // Map iterates in insertion order, so this evicts the least recently added.
127
+ const oldest = animationCache.keys().next();
128
+ if (!oldest.done) {
129
+ animationCache.delete(oldest.value);
130
+ }
131
+ }
132
+ const built = build();
133
+ animationCache.set(key, built);
134
+ return built;
135
+ }
136
+
137
+ /** Exported so the bounded-growth invariant above is testable. */
138
+ function toastAnimationCacheSize() {
139
+ return animationCache.size;
140
+ }
141
+
142
+ /** Native only — on web the same shape is played imperatively by `ToastRow`. */
143
+ function getToastEnterAnimation(position) {
144
+ return cachedAnimation(`enter|${position}`, () => new _reactNativeReanimated.Keyframe({
145
+ from: {
146
+ opacity: 0,
147
+ transform: [{
148
+ translateY: ENTER_TRANSLATE_Y[position]
149
+ }]
150
+ },
151
+ to: {
152
+ opacity: 1,
153
+ transform: [{
154
+ translateY: 0
155
+ }],
156
+ easing: EASE_OUT_QUART
157
+ }
158
+ }).duration(_constants.ENTERING_ANIMATION_DURATION));
159
+ }
160
+ function getToastExitAnimation({
161
+ position,
162
+ isHiddenByLimit,
163
+ isSingle,
164
+ stackGap
165
+ }) {
166
+ return cachedAnimation(`exit|${position}|${isHiddenByLimit}|${isSingle}|${stackGap}`, () => {
167
+ // A row culled by `visibleToasts` is buried under the stack; sliding it
168
+ // would look wrong, so it only fades.
169
+ if (isHiddenByLimit) {
170
+ return new _reactNativeReanimated.Keyframe({
171
+ from: {
172
+ opacity: 1
173
+ },
174
+ to: {
175
+ opacity: 0,
176
+ easing: EASE_IN_OUT_CUBIC
177
+ }
178
+ }).duration(_constants.ENTERING_ANIMATION_DURATION);
179
+ }
180
+ const distance = isSingle ? EXIT_TRANSLATE_Y_SINGLE : stackGap;
181
+ const translateY = position === 'top-center' ? -distance : distance;
182
+ return new _reactNativeReanimated.Keyframe({
183
+ from: {
184
+ opacity: 1,
185
+ transform: [{
186
+ translateY: 0
187
+ }]
188
+ },
189
+ to: {
190
+ opacity: 0,
191
+ transform: [{
192
+ translateY
193
+ }],
194
+ easing: EASE_IN_OUT_CUBIC
195
+ }
196
+ })
197
+ // Matches the store's overlay teardown delay, which is also
198
+ // ENTERING_ANIMATION_DURATION — a longer exit would be cut off.
199
+ .duration(_constants.ENTERING_ANIMATION_DURATION);
200
+ });
201
+ }
202
+ /**
203
+ * Pure so the platform split is testable without a renderer.
204
+ *
205
+ * INVARIANT: exactly ONE of `entering` / `enterTranslateY` is ever set. Both
206
+ * would play the enter twice; neither would leave the row with no enter animation
207
+ * at all and — on the imperative path — parked at `opacity: 0`, one full
208
+ * `enterTranslateY` away from its slot. A consumer override always wins and always
209
+ * goes through `entering`, on both platforms.
210
+ */
211
+ function resolveToastEnterAnimation({
212
+ position,
213
+ enterOverride,
214
+ driver
215
+ }) {
216
+ if (enterOverride !== undefined && enterOverride !== 'default') {
217
+ return {
218
+ entering: enterOverride,
219
+ enterTranslateY: undefined
220
+ };
221
+ }
222
+ return driver === 'imperative' ? {
223
+ entering: undefined,
224
+ enterTranslateY: ENTER_TRANSLATE_Y[position]
225
+ } : {
226
+ entering: getToastEnterAnimation(position),
227
+ enterTranslateY: undefined
228
+ };
229
+ }
230
+
231
+ /** Per-toast animation wins over the outlet's; `'default'` opts back in to Bloom's. */
232
+ const resolveAnimationField = (toastValue, toasterValue, defaultValue) => {
233
+ const resolved = toastValue !== undefined ? toastValue : toasterValue;
234
+ if (resolved === undefined || resolved === 'default') {
235
+ return defaultValue;
236
+ }
237
+ return resolved;
238
+ };
239
+ exports.resolveAnimationField = resolveAnimationField;
240
+ const useToastLayoutAnimations = (positionProp, animationProp, isHiddenByLimit, numberOfToasts) => {
241
+ const {
242
+ position: positionCtx,
243
+ gap,
244
+ animation: animationCtx
245
+ } = (0, _context.useToastContext)();
246
+ const position = positionProp ?? positionCtx;
247
+ const stackGap = gap ?? _constants.toastDefaults.stackGap;
248
+ const reducedMotion = (0, _reactNativeReanimated.useReducedMotion)();
249
+ if (reducedMotion) {
250
+ return {
251
+ entering: undefined,
252
+ exiting: undefined,
253
+ enterTranslateY: undefined
254
+ };
255
+ }
256
+ const defaultExiting = getToastExitAnimation({
257
+ position,
258
+ isHiddenByLimit,
259
+ isSingle: numberOfToasts <= 1,
260
+ stackGap
261
+ });
262
+ return {
263
+ ...resolveToastEnterAnimation({
264
+ position,
265
+ enterOverride: animationProp?.enter !== undefined ? animationProp.enter : animationCtx?.enter,
266
+ driver: TOAST_ENTER_DRIVER
267
+ }),
268
+ // An overflow-culled row always uses Bloom's fade: a consumer's custom exit
269
+ // would animate a row the user cannot even see.
270
+ exiting: isHiddenByLimit ? defaultExiting : resolveAnimationField(animationProp?.exit, animationCtx?.exit, defaultExiting)
271
+ };
272
+ };
273
+ exports.useToastLayoutAnimations = useToastLayoutAnimations;
274
+ //# sourceMappingURL=animations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_reactNativeReanimated","_constants","_context","EASE_OUT_QUART","Easing","bezier","EASE_IN_OUT_CUBIC","TOAST_ENTER_DRIVER","exports","Platform","OS","easeOutQuartFn","bezierFn","easeInOutCircFn","ENTER_TRANSLATE_Y","center","EXIT_TRANSLATE_Y_SINGLE","MAX_CACHED_ANIMATIONS","animationCache","Map","cachedAnimation","key","build","hit","get","size","oldest","keys","next","done","delete","value","built","set","toastAnimationCacheSize","getToastEnterAnimation","position","Keyframe","from","opacity","transform","translateY","to","easing","duration","ENTERING_ANIMATION_DURATION","getToastExitAnimation","isHiddenByLimit","isSingle","stackGap","distance","resolveToastEnterAnimation","enterOverride","driver","undefined","entering","enterTranslateY","resolveAnimationField","toastValue","toasterValue","defaultValue","resolved","useToastLayoutAnimations","positionProp","animationProp","numberOfToasts","positionCtx","gap","animation","animationCtx","useToastContext","toastDefaults","reducedMotion","useReducedMotion","exiting","defaultExiting","enter","exit"],"sourceRoot":"../../../src","sources":["toast/animations.ts"],"mappings":";;;;;;;;;;;;AAkEA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AAOA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AA3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMI,cAAc,GAAGC,6BAAM,CAACC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1D,MAAMC,iBAAiB,GAAGF,6BAAM,CAACC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AAI/D;AACA;AACA;AACA;AACA;AACO,MAAME,kBAAoC,GAAAC,OAAA,CAAAD,kBAAA,GAC/CE,qBAAQ,CAACC,EAAE,KAAK,KAAK,GAAG,YAAY,GAAG,iBAAiB;;AAE1D;AACO,MAAMC,cAAc,GAAAH,OAAA,CAAAG,cAAA,GAAGP,6BAAM,CAACQ,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AAC5D,MAAMC,eAAe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OAAO,EAAEpB,SAAS;MAAEE,eAAe,EAAEF;IAAU,CAAC;EAChF;EAEA,MAAMqB,cAAc,GAAG7B,qBAAqB,CAAC;IAC3CV,QAAQ;IACRW,eAAe;IACfC,QAAQ,EAAEiB,cAAc,IAAI,CAAC;IAC7BhB;EACF,CAAC,CAAC;EAEF,OAAO;IACL,GAAGE,0BAA0B,CAAC;MAC5Bf,QAAQ;MACRgB,aAAa,EACXY,aAAa,EAAEY,KAAK,KAAKtB,SAAS,GAC9BU,aAAa,CAACY,KAAK,GACnBP,YAAY,EAAEO,KAAK;MACzBvB,MAAM,EAAE9C;IACV,CAAC,CAAC;IACF;IACA;IACAmE,OAAO,EAAE3B,eAAe,GACpB4B,cAAc,GACdlB,qBAAqB,CACnBO,aAAa,EAAEa,IAAI,EACnBR,YAAY,EAAEQ,IAAI,EAClBF,cACF;EACN,CAAC;AACH,CAAC;AAACnE,OAAA,CAAAsD,wBAAA,GAAAA,wBAAA","ignoreList":[]}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.toastDefaults = exports.STACKING_ANIMATION_DURATION = exports.OUTSIDE_PRESS_PADDING = exports.MIN_STACK_SCALE_X = exports.ESTIMATED_TOAST_HEIGHT = exports.ENTERING_ANIMATION_DURATION = exports.CLOSE_BUTTON_HIT_AREA = void 0;
7
+ /**
8
+ * Derived from sonner-native v0.26.4 — src/constants.ts and src/animations.ts
9
+ * (MIT © Gunnar Torfi Steinarsson). See the top-level NOTICE.
10
+ *
11
+ * The two animation durations live HERE rather than in `animations.ts` so
12
+ * `toast-store.ts` never has to import a Reanimated-dependent module: the store
13
+ * stays pure JS and its suite needs zero React Native mocks.
14
+ */
15
+
16
+ /** Fallback row height until a toast has been measured. */
17
+ const ESTIMATED_TOAST_HEIGHT = exports.ESTIMATED_TOAST_HEIGHT = 70;
18
+ const CLOSE_BUTTON_HIT_AREA = exports.CLOSE_BUTTON_HIT_AREA = 60;
19
+ const OUTSIDE_PRESS_PADDING = exports.OUTSIDE_PRESS_PADDING = 20;
20
+ /** However deep a stack gets, a buried row never narrows past this scale. */
21
+ const MIN_STACK_SCALE_X = exports.MIN_STACK_SCALE_X = 0.8;
22
+
23
+ /** Enter animation length; also the auto-close timer's head start and the overlay teardown delay. */
24
+ const ENTERING_ANIMATION_DURATION = exports.ENTERING_ANIMATION_DURATION = 300;
25
+ const STACKING_ANIMATION_DURATION = exports.STACKING_ANIMATION_DURATION = 600;
26
+ const toastDefaults = exports.toastDefaults = {
27
+ duration: 3000,
28
+ position: 'bottom-center',
29
+ /**
30
+ * 0 means "derive from the safe-area inset" — `getInsetValues` then yields
31
+ * `inset + 8`, or 16 when there is no inset. A non-zero default would pin the
32
+ * stack to a fixed offset and ignore the notch / home indicator entirely.
33
+ */
34
+ offset: 0,
35
+ swipeToDismissDirection: 'left',
36
+ /**
37
+ * No default variant: a plain `toast('Saved')` must render neutral. Upstream
38
+ * defaults this to `'info'`, which silently gives every unqualified toast
39
+ * info styling.
40
+ */
41
+ variant: undefined,
42
+ visibleToasts: 3,
43
+ closeButton: false,
44
+ dismissible: true,
45
+ unstyled: false,
46
+ invert: false,
47
+ pauseWhenPageIsHidden: true,
48
+ gap: 8,
49
+ theme: 'system',
50
+ autoWiggleOnUpdate: 'never',
51
+ richColors: false,
52
+ enableStacking: false,
53
+ stackGap: 8,
54
+ allowFontScaling: true
55
+ };
56
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ESTIMATED_TOAST_HEIGHT","exports","CLOSE_BUTTON_HIT_AREA","OUTSIDE_PRESS_PADDING","MIN_STACK_SCALE_X","ENTERING_ANIMATION_DURATION","STACKING_ANIMATION_DURATION","toastDefaults","duration","position","offset","swipeToDismissDirection","variant","undefined","visibleToasts","closeButton","dismissible","unstyled","invert","pauseWhenPageIsHidden","gap","theme","autoWiggleOnUpdate","richColors","enableStacking","stackGap","allowFontScaling"],"sourceRoot":"../../../src","sources":["toast/constants.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA;AACO,MAAMA,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG,EAAE;AACjC,MAAME,qBAAqB,GAAAD,OAAA,CAAAC,qBAAA,GAAG,EAAE;AAChC,MAAMC,qBAAqB,GAAAF,OAAA,CAAAE,qBAAA,GAAG,EAAE;AACvC;AACO,MAAMC,iBAAiB,GAAAH,OAAA,CAAAG,iBAAA,GAAG,GAAG;;AAEpC;AACO,MAAMC,2BAA2B,GAAAJ,OAAA,CAAAI,2BAAA,GAAG,GAAG;AACvC,MAAMC,2BAA2B,GAAAL,OAAA,CAAAK,2BAAA,GAAG,GAAG;AAEvC,MAAMC,aAmBZ,GAAAN,OAAA,CAAAM,aAAA,GAAG;EACFC,QAAQ,EAAE,IAAI;EACdC,QAAQ,EAAE,eAAe;EACzB;AACF;AACA;AACA;AACA;EACEC,MAAM,EAAE,CAAC;EACTC,uBAAuB,EAAE,MAAM;EAC/B;AACF;AACA;AACA;AACA;EACEC,OAAO,EAAEC,SAAS;EAClBC,aAAa,EAAE,CAAC;EAChBC,WAAW,EAAE,KAAK;EAClBC,WAAW,EAAE,IAAI;EACjBC,QAAQ,EAAE,KAAK;EACfC,MAAM,EAAE,KAAK;EACbC,qBAAqB,EAAE,IAAI;EAC3BC,GAAG,EAAE,CAAC;EACNC,KAAK,EAAE,QAAQ;EACfC,kBAAkB,EAAE,OAAO;EAC3BC,UAAU,EAAE,KAAK;EACjBC,cAAc,EAAE,KAAK;EACrBC,QAAQ,EAAE,CAAC;EACXC,gBAAgB,EAAE;AACpB,CAAC","ignoreList":[]}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useToastContext = exports.useDynamicToastContext = exports.ToastContext = exports.DynamicToastContext = void 0;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
9
+ /**
10
+ * Derived from sonner-native v0.26.4 — src/context.tsx
11
+ * (MIT © Gunnar Torfi Steinarsson). See the top-level NOTICE.
12
+ *
13
+ * Two contexts, split by change frequency: the resolved `Toaster` configuration
14
+ * (stable for the lifetime of the outlet) and the live stack state (changes on
15
+ * every measurement). Splitting them keeps a height measurement from
16
+ * re-rendering every row's config-derived memo.
17
+ *
18
+ * Upstream also passes `addToast` through the stable context; Bloom's rows talk
19
+ * to `toastStore` directly, which is the single authority.
20
+ */
21
+
22
+ const ToastContext = exports.ToastContext = /*#__PURE__*/React.createContext(null);
23
+ ToastContext.displayName = 'BloomToastContext';
24
+ const DynamicToastContext = exports.DynamicToastContext = /*#__PURE__*/React.createContext(null);
25
+ DynamicToastContext.displayName = 'BloomDynamicToastContext';
26
+ const useToastContext = () => {
27
+ const context = React.useContext(ToastContext);
28
+ if (!context) {
29
+ throw new Error('useToastContext must be used within a <ToastOutlet>');
30
+ }
31
+ return context;
32
+ };
33
+ exports.useToastContext = useToastContext;
34
+ const useDynamicToastContext = () => {
35
+ const context = React.useContext(DynamicToastContext);
36
+ if (!context) {
37
+ throw new Error('useDynamicToastContext must be used within a <ToastOutlet>');
38
+ }
39
+ return context;
40
+ };
41
+ exports.useDynamicToastContext = useDynamicToastContext;
42
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ToastContext","exports","createContext","displayName","DynamicToastContext","useToastContext","context","useContext","Error","useDynamicToastContext"],"sourceRoot":"../../../src","sources":["toast/context.tsx"],"mappings":";;;;;;AAYA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA+B,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAZ/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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