@oxyhq/bloom 0.50.2 → 0.51.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 (567) 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 +2 -1
  6. package/lib/commonjs/bottom-sheet/index.web.js.map +1 -1
  7. package/lib/commonjs/context-menu/index.web.js +3 -2
  8. package/lib/commonjs/context-menu/index.web.js.map +1 -1
  9. package/lib/commonjs/dialog/Dialog.web.js +4 -3
  10. package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
  11. package/lib/commonjs/frosted-icon-button/shared.js +1 -1
  12. package/lib/commonjs/index.js +90 -83
  13. package/lib/commonjs/index.js.map +1 -1
  14. package/lib/commonjs/index.web.js +116 -109
  15. package/lib/commonjs/index.web.js.map +1 -1
  16. package/lib/commonjs/menu/index.web.js +2 -1
  17. package/lib/commonjs/menu/index.web.js.map +1 -1
  18. package/lib/commonjs/popover/index.web.js +3 -2
  19. package/lib/commonjs/popover/index.web.js.map +1 -1
  20. package/lib/commonjs/portal/index.js +4 -1
  21. package/lib/commonjs/portal/index.js.map +1 -1
  22. package/lib/commonjs/progressive-blur/index.js +79 -0
  23. package/lib/commonjs/progressive-blur/index.js.map +1 -0
  24. package/lib/commonjs/progressive-blur/index.web.js +67 -0
  25. package/lib/commonjs/progressive-blur/index.web.js.map +1 -0
  26. package/lib/commonjs/progressive-blur/shared.js +66 -0
  27. package/lib/commonjs/progressive-blur/shared.js.map +1 -0
  28. package/lib/commonjs/progressive-blur/types.js +6 -0
  29. package/lib/commonjs/progressive-blur/types.js.map +1 -0
  30. package/lib/commonjs/select/index.web.js +2 -1
  31. package/lib/commonjs/select/index.web.js.map +1 -1
  32. package/lib/commonjs/styles/web-view-style.js +26 -0
  33. package/lib/commonjs/styles/web-view-style.js.map +1 -0
  34. package/lib/commonjs/tab-bar/TabBarBase.js +415 -0
  35. package/lib/commonjs/tab-bar/TabBarBase.js.map +1 -0
  36. package/lib/commonjs/tab-bar/expo-router/RouterTabBar.js +83 -0
  37. package/lib/commonjs/tab-bar/expo-router/RouterTabBar.js.map +1 -0
  38. package/lib/commonjs/tab-bar/expo-router/fading-tab-screen.js +119 -0
  39. package/lib/commonjs/tab-bar/expo-router/fading-tab-screen.js.map +1 -0
  40. package/lib/commonjs/tab-bar/expo-router/index.js +26 -0
  41. package/lib/commonjs/tab-bar/expo-router/index.js.map +1 -0
  42. package/lib/commonjs/tab-bar/glyph.js +43 -0
  43. package/lib/commonjs/tab-bar/glyph.js.map +1 -0
  44. package/lib/commonjs/tab-bar/glyph.native.js +55 -0
  45. package/lib/commonjs/tab-bar/glyph.native.js.map +1 -0
  46. package/lib/commonjs/tab-bar/index.js +65 -0
  47. package/lib/commonjs/tab-bar/index.js.map +1 -0
  48. package/lib/commonjs/tab-bar/index.web.js +67 -0
  49. package/lib/commonjs/tab-bar/index.web.js.map +1 -0
  50. package/lib/commonjs/tab-bar/minimize-context.js +127 -0
  51. package/lib/commonjs/tab-bar/minimize-context.js.map +1 -0
  52. package/lib/commonjs/tab-bar/shared.js +139 -0
  53. package/lib/commonjs/tab-bar/shared.js.map +1 -0
  54. package/lib/commonjs/tab-bar/surface-solid.js +43 -0
  55. package/lib/commonjs/tab-bar/surface-solid.js.map +1 -0
  56. package/lib/commonjs/tab-bar/surface.js +13 -0
  57. package/lib/commonjs/tab-bar/surface.js.map +1 -0
  58. package/lib/commonjs/tab-bar/surface.native.js +113 -0
  59. package/lib/commonjs/tab-bar/surface.native.js.map +1 -0
  60. package/lib/commonjs/tab-bar/surface.web.js +59 -0
  61. package/lib/commonjs/tab-bar/surface.web.js.map +1 -0
  62. package/lib/commonjs/tab-bar/types.js +6 -0
  63. package/lib/commonjs/tab-bar/types.js.map +1 -0
  64. package/lib/commonjs/toast/Positioner.js +117 -0
  65. package/lib/commonjs/toast/Positioner.js.map +1 -0
  66. package/lib/commonjs/toast/ToastContent.js +301 -0
  67. package/lib/commonjs/toast/ToastContent.js.map +1 -0
  68. package/lib/commonjs/toast/ToastHost.js +69 -0
  69. package/lib/commonjs/toast/ToastHost.js.map +1 -0
  70. package/lib/commonjs/toast/ToastHost.native.js +44 -0
  71. package/lib/commonjs/toast/ToastHost.native.js.map +1 -0
  72. package/lib/commonjs/toast/ToastIcon.js +57 -0
  73. package/lib/commonjs/toast/ToastIcon.js.map +1 -0
  74. package/lib/commonjs/toast/ToastRow.js +411 -0
  75. package/lib/commonjs/toast/ToastRow.js.map +1 -0
  76. package/lib/commonjs/toast/ToastSwipeHandler.js +189 -0
  77. package/lib/commonjs/toast/ToastSwipeHandler.js.map +1 -0
  78. package/lib/commonjs/toast/Toaster.js +205 -0
  79. package/lib/commonjs/toast/Toaster.js.map +1 -0
  80. package/lib/commonjs/toast/animations.js +274 -0
  81. package/lib/commonjs/toast/animations.js.map +1 -0
  82. package/lib/commonjs/toast/constants.js +56 -0
  83. package/lib/commonjs/toast/constants.js.map +1 -0
  84. package/lib/commonjs/toast/context.js +42 -0
  85. package/lib/commonjs/toast/context.js.map +1 -0
  86. package/lib/commonjs/toast/index.js +32 -126
  87. package/lib/commonjs/toast/index.js.map +1 -1
  88. package/lib/commonjs/toast/position-utils.js +115 -0
  89. package/lib/commonjs/toast/position-utils.js.map +1 -0
  90. package/lib/commonjs/toast/positioner-utils.js +141 -0
  91. package/lib/commonjs/toast/positioner-utils.js.map +1 -0
  92. package/lib/commonjs/toast/toast-comparator.js +28 -0
  93. package/lib/commonjs/toast/toast-comparator.js.map +1 -0
  94. package/lib/commonjs/toast/toast-fns.js +90 -0
  95. package/lib/commonjs/toast/toast-fns.js.map +1 -0
  96. package/lib/commonjs/toast/toast-store.js +352 -0
  97. package/lib/commonjs/toast/toast-store.js.map +1 -0
  98. package/lib/commonjs/toast/toast-timers.js +110 -0
  99. package/lib/commonjs/toast/toast-timers.js.map +1 -0
  100. package/lib/commonjs/toast/types.js +42 -0
  101. package/lib/commonjs/toast/types.js.map +1 -1
  102. package/lib/commonjs/toast/use-animated-target.js +57 -0
  103. package/lib/commonjs/toast/use-animated-target.js.map +1 -0
  104. package/lib/commonjs/toast/use-app-state.js +76 -0
  105. package/lib/commonjs/toast/use-app-state.js.map +1 -0
  106. package/lib/commonjs/toast/use-toast-colors.js +114 -0
  107. package/lib/commonjs/toast/use-toast-colors.js.map +1 -0
  108. package/lib/commonjs/toast/use-toast-position.js +40 -0
  109. package/lib/commonjs/toast/use-toast-position.js.map +1 -0
  110. package/lib/commonjs/tooltip/index.web.js +2 -1
  111. package/lib/commonjs/tooltip/index.web.js.map +1 -1
  112. package/lib/commonjs/zoomable-image-gallery/ZoomableImageGallery.js +20 -8
  113. package/lib/commonjs/zoomable-image-gallery/ZoomableImageGallery.js.map +1 -1
  114. package/lib/module/avatar-group/AvatarGroup.web.js +2 -1
  115. package/lib/module/avatar-group/AvatarGroup.web.js.map +1 -1
  116. package/lib/module/bottom-sheet/index.web.js +2 -1
  117. package/lib/module/bottom-sheet/index.web.js.map +1 -1
  118. package/lib/module/context-menu/index.web.js +3 -2
  119. package/lib/module/context-menu/index.web.js.map +1 -1
  120. package/lib/module/dialog/Dialog.web.js +4 -3
  121. package/lib/module/dialog/Dialog.web.js.map +1 -1
  122. package/lib/module/frosted-icon-button/shared.js +1 -1
  123. package/lib/module/index.js +3 -2
  124. package/lib/module/index.js.map +1 -1
  125. package/lib/module/index.web.js +3 -2
  126. package/lib/module/index.web.js.map +1 -1
  127. package/lib/module/menu/index.web.js +2 -1
  128. package/lib/module/menu/index.web.js.map +1 -1
  129. package/lib/module/popover/index.web.js +3 -2
  130. package/lib/module/popover/index.web.js.map +1 -1
  131. package/lib/module/portal/index.js +4 -1
  132. package/lib/module/portal/index.js.map +1 -1
  133. package/lib/module/progressive-blur/index.js +74 -0
  134. package/lib/module/progressive-blur/index.js.map +1 -0
  135. package/lib/module/progressive-blur/index.web.js +62 -0
  136. package/lib/module/progressive-blur/index.web.js.map +1 -0
  137. package/lib/module/progressive-blur/shared.js +60 -0
  138. package/lib/module/progressive-blur/shared.js.map +1 -0
  139. package/lib/module/progressive-blur/types.js +4 -0
  140. package/lib/module/progressive-blur/types.js.map +1 -0
  141. package/lib/module/select/index.web.js +2 -1
  142. package/lib/module/select/index.web.js.map +1 -1
  143. package/lib/module/styles/web-view-style.js +22 -0
  144. package/lib/module/styles/web-view-style.js.map +1 -0
  145. package/lib/module/tab-bar/TabBarBase.js +408 -0
  146. package/lib/module/tab-bar/TabBarBase.js.map +1 -0
  147. package/lib/module/tab-bar/expo-router/RouterTabBar.js +78 -0
  148. package/lib/module/tab-bar/expo-router/RouterTabBar.js.map +1 -0
  149. package/lib/module/tab-bar/expo-router/fading-tab-screen.js +113 -0
  150. package/lib/module/tab-bar/expo-router/fading-tab-screen.js.map +1 -0
  151. package/lib/module/tab-bar/expo-router/index.js +15 -0
  152. package/lib/module/tab-bar/expo-router/index.js.map +1 -0
  153. package/lib/module/tab-bar/glyph.js +38 -0
  154. package/lib/module/tab-bar/glyph.js.map +1 -0
  155. package/lib/module/tab-bar/glyph.native.js +50 -0
  156. package/lib/module/tab-bar/glyph.native.js.map +1 -0
  157. package/lib/module/tab-bar/index.js +24 -0
  158. package/lib/module/tab-bar/index.js.map +1 -0
  159. package/lib/module/tab-bar/index.web.js +26 -0
  160. package/lib/module/tab-bar/index.web.js.map +1 -0
  161. package/lib/module/tab-bar/minimize-context.js +118 -0
  162. package/lib/module/tab-bar/minimize-context.js.map +1 -0
  163. package/lib/module/tab-bar/shared.js +132 -0
  164. package/lib/module/tab-bar/shared.js.map +1 -0
  165. package/lib/module/tab-bar/surface-solid.js +37 -0
  166. package/lib/module/tab-bar/surface-solid.js.map +1 -0
  167. package/lib/module/tab-bar/surface.js +31 -0
  168. package/lib/module/tab-bar/surface.js.map +1 -0
  169. package/lib/module/tab-bar/surface.native.js +109 -0
  170. package/lib/module/tab-bar/surface.native.js.map +1 -0
  171. package/lib/module/tab-bar/surface.web.js +53 -0
  172. package/lib/module/tab-bar/surface.web.js.map +1 -0
  173. package/lib/module/tab-bar/types.js +4 -0
  174. package/lib/module/tab-bar/types.js.map +1 -0
  175. package/lib/module/toast/Positioner.js +110 -0
  176. package/lib/module/toast/Positioner.js.map +1 -0
  177. package/lib/module/toast/ToastContent.js +295 -0
  178. package/lib/module/toast/ToastContent.js.map +1 -0
  179. package/lib/module/toast/ToastHost.js +63 -0
  180. package/lib/module/toast/ToastHost.js.map +1 -0
  181. package/lib/module/toast/ToastHost.native.js +38 -0
  182. package/lib/module/toast/ToastHost.native.js.map +1 -0
  183. package/lib/module/toast/ToastIcon.js +52 -0
  184. package/lib/module/toast/ToastIcon.js.map +1 -0
  185. package/lib/module/toast/ToastRow.js +407 -0
  186. package/lib/module/toast/ToastRow.js.map +1 -0
  187. package/lib/module/toast/ToastSwipeHandler.js +182 -0
  188. package/lib/module/toast/ToastSwipeHandler.js.map +1 -0
  189. package/lib/module/toast/Toaster.js +198 -0
  190. package/lib/module/toast/Toaster.js.map +1 -0
  191. package/lib/module/toast/animations.js +261 -0
  192. package/lib/module/toast/animations.js.map +1 -0
  193. package/lib/module/toast/constants.js +52 -0
  194. package/lib/module/toast/constants.js.map +1 -0
  195. package/lib/module/toast/context.js +34 -0
  196. package/lib/module/toast/context.js.map +1 -0
  197. package/lib/module/toast/index.js +27 -103
  198. package/lib/module/toast/index.js.map +1 -1
  199. package/lib/module/toast/position-utils.js +107 -0
  200. package/lib/module/toast/position-utils.js.map +1 -0
  201. package/lib/module/toast/positioner-utils.js +134 -0
  202. package/lib/module/toast/positioner-utils.js.map +1 -0
  203. package/lib/module/toast/toast-comparator.js +22 -0
  204. package/lib/module/toast/toast-comparator.js.map +1 -0
  205. package/lib/module/toast/toast-fns.js +85 -0
  206. package/lib/module/toast/toast-fns.js.map +1 -0
  207. package/lib/module/toast/toast-store.js +346 -0
  208. package/lib/module/toast/toast-store.js.map +1 -0
  209. package/lib/module/toast/toast-timers.js +104 -0
  210. package/lib/module/toast/toast-timers.js.map +1 -0
  211. package/lib/module/toast/types.js +38 -0
  212. package/lib/module/toast/types.js.map +1 -1
  213. package/lib/module/toast/use-animated-target.js +52 -0
  214. package/lib/module/toast/use-animated-target.js.map +1 -0
  215. package/lib/module/toast/use-app-state.js +70 -0
  216. package/lib/module/toast/use-app-state.js.map +1 -0
  217. package/lib/module/toast/use-toast-colors.js +109 -0
  218. package/lib/module/toast/use-toast-colors.js.map +1 -0
  219. package/lib/module/toast/use-toast-position.js +35 -0
  220. package/lib/module/toast/use-toast-position.js.map +1 -0
  221. package/lib/module/tooltip/index.web.js +2 -1
  222. package/lib/module/tooltip/index.web.js.map +1 -1
  223. package/lib/module/zoomable-image-gallery/ZoomableImageGallery.js +20 -8
  224. package/lib/module/zoomable-image-gallery/ZoomableImageGallery.js.map +1 -1
  225. package/lib/typescript/commonjs/avatar-group/AvatarGroup.web.d.ts.map +1 -1
  226. package/lib/typescript/commonjs/benefit-list/types.d.ts +2 -1
  227. package/lib/typescript/commonjs/benefit-list/types.d.ts.map +1 -1
  228. package/lib/typescript/commonjs/bottom-sheet/index.web.d.ts.map +1 -1
  229. package/lib/typescript/commonjs/context-menu/index.web.d.ts.map +1 -1
  230. package/lib/typescript/commonjs/dialog/Dialog.web.d.ts.map +1 -1
  231. package/lib/typescript/commonjs/fab/types.d.ts +4 -2
  232. package/lib/typescript/commonjs/fab/types.d.ts.map +1 -1
  233. package/lib/typescript/commonjs/frosted-icon-button/shared.d.ts +1 -1
  234. package/lib/typescript/commonjs/frosted-icon-button/types.d.ts +2 -1
  235. package/lib/typescript/commonjs/frosted-icon-button/types.d.ts.map +1 -1
  236. package/lib/typescript/commonjs/index.d.ts +2 -1
  237. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  238. package/lib/typescript/commonjs/index.web.d.ts +2 -1
  239. package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
  240. package/lib/typescript/commonjs/menu/index.web.d.ts.map +1 -1
  241. package/lib/typescript/commonjs/popover/index.web.d.ts.map +1 -1
  242. package/lib/typescript/commonjs/portal/index.d.ts.map +1 -1
  243. package/lib/typescript/commonjs/progressive-blur/index.d.ts +23 -0
  244. package/lib/typescript/commonjs/progressive-blur/index.d.ts.map +1 -0
  245. package/lib/typescript/commonjs/progressive-blur/index.web.d.ts +30 -0
  246. package/lib/typescript/commonjs/progressive-blur/index.web.d.ts.map +1 -0
  247. package/lib/typescript/commonjs/progressive-blur/shared.d.ts +35 -0
  248. package/lib/typescript/commonjs/progressive-blur/shared.d.ts.map +1 -0
  249. package/lib/typescript/commonjs/progressive-blur/types.d.ts +21 -0
  250. package/lib/typescript/commonjs/progressive-blur/types.d.ts.map +1 -0
  251. package/lib/typescript/commonjs/select/index.web.d.ts.map +1 -1
  252. package/lib/typescript/commonjs/styles/web-view-style.d.ts +21 -0
  253. package/lib/typescript/commonjs/styles/web-view-style.d.ts.map +1 -0
  254. package/lib/typescript/commonjs/tab-bar/TabBarBase.d.ts +36 -0
  255. package/lib/typescript/commonjs/tab-bar/TabBarBase.d.ts.map +1 -0
  256. package/lib/typescript/commonjs/tab-bar/expo-router/RouterTabBar.d.ts +59 -0
  257. package/lib/typescript/commonjs/tab-bar/expo-router/RouterTabBar.d.ts.map +1 -0
  258. package/lib/typescript/commonjs/tab-bar/expo-router/fading-tab-screen.d.ts +11 -0
  259. package/lib/typescript/commonjs/tab-bar/expo-router/fading-tab-screen.d.ts.map +1 -0
  260. package/lib/typescript/commonjs/tab-bar/expo-router/index.d.ts +14 -0
  261. package/lib/typescript/commonjs/tab-bar/expo-router/index.d.ts.map +1 -0
  262. package/lib/typescript/commonjs/tab-bar/glyph.d.ts +6 -0
  263. package/lib/typescript/commonjs/tab-bar/glyph.d.ts.map +1 -0
  264. package/lib/typescript/commonjs/tab-bar/glyph.native.d.ts +6 -0
  265. package/lib/typescript/commonjs/tab-bar/glyph.native.d.ts.map +1 -0
  266. package/lib/typescript/commonjs/tab-bar/index.d.ts +12 -0
  267. package/lib/typescript/commonjs/tab-bar/index.d.ts.map +1 -0
  268. package/lib/typescript/commonjs/tab-bar/index.web.d.ts +12 -0
  269. package/lib/typescript/commonjs/tab-bar/index.web.d.ts.map +1 -0
  270. package/lib/typescript/commonjs/tab-bar/minimize-context.d.ts +51 -0
  271. package/lib/typescript/commonjs/tab-bar/minimize-context.d.ts.map +1 -0
  272. package/lib/typescript/commonjs/tab-bar/shared.d.ts +93 -0
  273. package/lib/typescript/commonjs/tab-bar/shared.d.ts.map +1 -0
  274. package/lib/typescript/commonjs/tab-bar/surface-solid.d.ts +6 -0
  275. package/lib/typescript/commonjs/tab-bar/surface-solid.d.ts.map +1 -0
  276. package/lib/typescript/commonjs/tab-bar/surface.d.ts +29 -0
  277. package/lib/typescript/commonjs/tab-bar/surface.d.ts.map +1 -0
  278. package/lib/typescript/commonjs/tab-bar/surface.native.d.ts +6 -0
  279. package/lib/typescript/commonjs/tab-bar/surface.native.d.ts.map +1 -0
  280. package/lib/typescript/commonjs/tab-bar/surface.web.d.ts +6 -0
  281. package/lib/typescript/commonjs/tab-bar/surface.web.d.ts.map +1 -0
  282. package/lib/typescript/commonjs/tab-bar/types.d.ts +88 -0
  283. package/lib/typescript/commonjs/tab-bar/types.d.ts.map +1 -0
  284. package/lib/typescript/commonjs/toast/Positioner.d.ts +21 -0
  285. package/lib/typescript/commonjs/toast/Positioner.d.ts.map +1 -0
  286. package/lib/typescript/commonjs/toast/ToastContent.d.ts +14 -0
  287. package/lib/typescript/commonjs/toast/ToastContent.d.ts.map +1 -0
  288. package/lib/typescript/commonjs/toast/ToastHost.d.ts +6 -0
  289. package/lib/typescript/commonjs/toast/ToastHost.d.ts.map +1 -0
  290. package/lib/typescript/commonjs/toast/ToastHost.native.d.ts +6 -0
  291. package/lib/typescript/commonjs/toast/ToastHost.native.d.ts.map +1 -0
  292. package/lib/typescript/commonjs/toast/ToastIcon.d.ts +9 -0
  293. package/lib/typescript/commonjs/toast/ToastIcon.d.ts.map +1 -0
  294. package/lib/typescript/commonjs/toast/ToastRow.d.ts +80 -0
  295. package/lib/typescript/commonjs/toast/ToastRow.d.ts.map +1 -0
  296. package/lib/typescript/commonjs/toast/ToastSwipeHandler.d.ts +30 -0
  297. package/lib/typescript/commonjs/toast/ToastSwipeHandler.d.ts.map +1 -0
  298. package/lib/typescript/commonjs/toast/Toaster.d.ts +19 -0
  299. package/lib/typescript/commonjs/toast/Toaster.d.ts.map +1 -0
  300. package/lib/typescript/commonjs/toast/animations.d.ts +62 -0
  301. package/lib/typescript/commonjs/toast/animations.d.ts.map +1 -0
  302. package/lib/typescript/commonjs/toast/constants.d.ts +39 -0
  303. package/lib/typescript/commonjs/toast/constants.d.ts.map +1 -0
  304. package/lib/typescript/commonjs/toast/context.d.ts +19 -0
  305. package/lib/typescript/commonjs/toast/context.d.ts.map +1 -0
  306. package/lib/typescript/commonjs/toast/index.d.ts +23 -76
  307. package/lib/typescript/commonjs/toast/index.d.ts.map +1 -1
  308. package/lib/typescript/commonjs/toast/position-utils.d.ts +30 -0
  309. package/lib/typescript/commonjs/toast/position-utils.d.ts.map +1 -0
  310. package/lib/typescript/commonjs/toast/positioner-utils.d.ts +72 -0
  311. package/lib/typescript/commonjs/toast/positioner-utils.d.ts.map +1 -0
  312. package/lib/typescript/commonjs/toast/toast-comparator.d.ts +12 -0
  313. package/lib/typescript/commonjs/toast/toast-comparator.d.ts.map +1 -0
  314. package/lib/typescript/commonjs/toast/toast-fns.d.ts +3 -0
  315. package/lib/typescript/commonjs/toast/toast-fns.d.ts.map +1 -0
  316. package/lib/typescript/commonjs/toast/toast-store.d.ts +52 -0
  317. package/lib/typescript/commonjs/toast/toast-store.d.ts.map +1 -0
  318. package/lib/typescript/commonjs/toast/toast-timers.d.ts +24 -0
  319. package/lib/typescript/commonjs/toast/toast-timers.d.ts.map +1 -0
  320. package/lib/typescript/commonjs/toast/types.d.ts +222 -5
  321. package/lib/typescript/commonjs/toast/types.d.ts.map +1 -1
  322. package/lib/typescript/commonjs/toast/use-animated-target.d.ts +7 -0
  323. package/lib/typescript/commonjs/toast/use-animated-target.d.ts.map +1 -0
  324. package/lib/typescript/commonjs/toast/use-app-state.d.ts +18 -0
  325. package/lib/typescript/commonjs/toast/use-app-state.d.ts.map +1 -0
  326. package/lib/typescript/commonjs/toast/use-toast-colors.d.ts +22 -0
  327. package/lib/typescript/commonjs/toast/use-toast-colors.d.ts.map +1 -0
  328. package/lib/typescript/commonjs/toast/use-toast-position.d.ts +37 -0
  329. package/lib/typescript/commonjs/toast/use-toast-position.d.ts.map +1 -0
  330. package/lib/typescript/commonjs/tooltip/index.web.d.ts.map +1 -1
  331. package/lib/typescript/commonjs/zoomable-image-gallery/ZoomableImageGallery.d.ts.map +1 -1
  332. package/lib/typescript/module/avatar-group/AvatarGroup.web.d.ts.map +1 -1
  333. package/lib/typescript/module/benefit-list/types.d.ts +2 -1
  334. package/lib/typescript/module/benefit-list/types.d.ts.map +1 -1
  335. package/lib/typescript/module/bottom-sheet/index.web.d.ts.map +1 -1
  336. package/lib/typescript/module/context-menu/index.web.d.ts.map +1 -1
  337. package/lib/typescript/module/dialog/Dialog.web.d.ts.map +1 -1
  338. package/lib/typescript/module/fab/types.d.ts +4 -2
  339. package/lib/typescript/module/fab/types.d.ts.map +1 -1
  340. package/lib/typescript/module/frosted-icon-button/shared.d.ts +1 -1
  341. package/lib/typescript/module/frosted-icon-button/types.d.ts +2 -1
  342. package/lib/typescript/module/frosted-icon-button/types.d.ts.map +1 -1
  343. package/lib/typescript/module/index.d.ts +2 -1
  344. package/lib/typescript/module/index.d.ts.map +1 -1
  345. package/lib/typescript/module/index.web.d.ts +2 -1
  346. package/lib/typescript/module/index.web.d.ts.map +1 -1
  347. package/lib/typescript/module/menu/index.web.d.ts.map +1 -1
  348. package/lib/typescript/module/popover/index.web.d.ts.map +1 -1
  349. package/lib/typescript/module/portal/index.d.ts.map +1 -1
  350. package/lib/typescript/module/progressive-blur/index.d.ts +23 -0
  351. package/lib/typescript/module/progressive-blur/index.d.ts.map +1 -0
  352. package/lib/typescript/module/progressive-blur/index.web.d.ts +30 -0
  353. package/lib/typescript/module/progressive-blur/index.web.d.ts.map +1 -0
  354. package/lib/typescript/module/progressive-blur/shared.d.ts +35 -0
  355. package/lib/typescript/module/progressive-blur/shared.d.ts.map +1 -0
  356. package/lib/typescript/module/progressive-blur/types.d.ts +21 -0
  357. package/lib/typescript/module/progressive-blur/types.d.ts.map +1 -0
  358. package/lib/typescript/module/select/index.web.d.ts.map +1 -1
  359. package/lib/typescript/module/styles/web-view-style.d.ts +21 -0
  360. package/lib/typescript/module/styles/web-view-style.d.ts.map +1 -0
  361. package/lib/typescript/module/tab-bar/TabBarBase.d.ts +36 -0
  362. package/lib/typescript/module/tab-bar/TabBarBase.d.ts.map +1 -0
  363. package/lib/typescript/module/tab-bar/expo-router/RouterTabBar.d.ts +59 -0
  364. package/lib/typescript/module/tab-bar/expo-router/RouterTabBar.d.ts.map +1 -0
  365. package/lib/typescript/module/tab-bar/expo-router/fading-tab-screen.d.ts +11 -0
  366. package/lib/typescript/module/tab-bar/expo-router/fading-tab-screen.d.ts.map +1 -0
  367. package/lib/typescript/module/tab-bar/expo-router/index.d.ts +14 -0
  368. package/lib/typescript/module/tab-bar/expo-router/index.d.ts.map +1 -0
  369. package/lib/typescript/module/tab-bar/glyph.d.ts +6 -0
  370. package/lib/typescript/module/tab-bar/glyph.d.ts.map +1 -0
  371. package/lib/typescript/module/tab-bar/glyph.native.d.ts +6 -0
  372. package/lib/typescript/module/tab-bar/glyph.native.d.ts.map +1 -0
  373. package/lib/typescript/module/tab-bar/index.d.ts +12 -0
  374. package/lib/typescript/module/tab-bar/index.d.ts.map +1 -0
  375. package/lib/typescript/module/tab-bar/index.web.d.ts +12 -0
  376. package/lib/typescript/module/tab-bar/index.web.d.ts.map +1 -0
  377. package/lib/typescript/module/tab-bar/minimize-context.d.ts +51 -0
  378. package/lib/typescript/module/tab-bar/minimize-context.d.ts.map +1 -0
  379. package/lib/typescript/module/tab-bar/shared.d.ts +93 -0
  380. package/lib/typescript/module/tab-bar/shared.d.ts.map +1 -0
  381. package/lib/typescript/module/tab-bar/surface-solid.d.ts +6 -0
  382. package/lib/typescript/module/tab-bar/surface-solid.d.ts.map +1 -0
  383. package/lib/typescript/module/tab-bar/surface.d.ts +29 -0
  384. package/lib/typescript/module/tab-bar/surface.d.ts.map +1 -0
  385. package/lib/typescript/module/tab-bar/surface.native.d.ts +6 -0
  386. package/lib/typescript/module/tab-bar/surface.native.d.ts.map +1 -0
  387. package/lib/typescript/module/tab-bar/surface.web.d.ts +6 -0
  388. package/lib/typescript/module/tab-bar/surface.web.d.ts.map +1 -0
  389. package/lib/typescript/module/tab-bar/types.d.ts +88 -0
  390. package/lib/typescript/module/tab-bar/types.d.ts.map +1 -0
  391. package/lib/typescript/module/toast/Positioner.d.ts +21 -0
  392. package/lib/typescript/module/toast/Positioner.d.ts.map +1 -0
  393. package/lib/typescript/module/toast/ToastContent.d.ts +14 -0
  394. package/lib/typescript/module/toast/ToastContent.d.ts.map +1 -0
  395. package/lib/typescript/module/toast/ToastHost.d.ts +6 -0
  396. package/lib/typescript/module/toast/ToastHost.d.ts.map +1 -0
  397. package/lib/typescript/module/toast/ToastHost.native.d.ts +6 -0
  398. package/lib/typescript/module/toast/ToastHost.native.d.ts.map +1 -0
  399. package/lib/typescript/module/toast/ToastIcon.d.ts +9 -0
  400. package/lib/typescript/module/toast/ToastIcon.d.ts.map +1 -0
  401. package/lib/typescript/module/toast/ToastRow.d.ts +80 -0
  402. package/lib/typescript/module/toast/ToastRow.d.ts.map +1 -0
  403. package/lib/typescript/module/toast/ToastSwipeHandler.d.ts +30 -0
  404. package/lib/typescript/module/toast/ToastSwipeHandler.d.ts.map +1 -0
  405. package/lib/typescript/module/toast/Toaster.d.ts +19 -0
  406. package/lib/typescript/module/toast/Toaster.d.ts.map +1 -0
  407. package/lib/typescript/module/toast/animations.d.ts +62 -0
  408. package/lib/typescript/module/toast/animations.d.ts.map +1 -0
  409. package/lib/typescript/module/toast/constants.d.ts +39 -0
  410. package/lib/typescript/module/toast/constants.d.ts.map +1 -0
  411. package/lib/typescript/module/toast/context.d.ts +19 -0
  412. package/lib/typescript/module/toast/context.d.ts.map +1 -0
  413. package/lib/typescript/module/toast/index.d.ts +23 -76
  414. package/lib/typescript/module/toast/index.d.ts.map +1 -1
  415. package/lib/typescript/module/toast/position-utils.d.ts +30 -0
  416. package/lib/typescript/module/toast/position-utils.d.ts.map +1 -0
  417. package/lib/typescript/module/toast/positioner-utils.d.ts +72 -0
  418. package/lib/typescript/module/toast/positioner-utils.d.ts.map +1 -0
  419. package/lib/typescript/module/toast/toast-comparator.d.ts +12 -0
  420. package/lib/typescript/module/toast/toast-comparator.d.ts.map +1 -0
  421. package/lib/typescript/module/toast/toast-fns.d.ts +3 -0
  422. package/lib/typescript/module/toast/toast-fns.d.ts.map +1 -0
  423. package/lib/typescript/module/toast/toast-store.d.ts +52 -0
  424. package/lib/typescript/module/toast/toast-store.d.ts.map +1 -0
  425. package/lib/typescript/module/toast/toast-timers.d.ts +24 -0
  426. package/lib/typescript/module/toast/toast-timers.d.ts.map +1 -0
  427. package/lib/typescript/module/toast/types.d.ts +222 -5
  428. package/lib/typescript/module/toast/types.d.ts.map +1 -1
  429. package/lib/typescript/module/toast/use-animated-target.d.ts +7 -0
  430. package/lib/typescript/module/toast/use-animated-target.d.ts.map +1 -0
  431. package/lib/typescript/module/toast/use-app-state.d.ts +18 -0
  432. package/lib/typescript/module/toast/use-app-state.d.ts.map +1 -0
  433. package/lib/typescript/module/toast/use-toast-colors.d.ts +22 -0
  434. package/lib/typescript/module/toast/use-toast-colors.d.ts.map +1 -0
  435. package/lib/typescript/module/toast/use-toast-position.d.ts +37 -0
  436. package/lib/typescript/module/toast/use-toast-position.d.ts.map +1 -0
  437. package/lib/typescript/module/tooltip/index.web.d.ts.map +1 -1
  438. package/lib/typescript/module/zoomable-image-gallery/ZoomableImageGallery.d.ts.map +1 -1
  439. package/package.json +58 -26
  440. package/src/__tests__/TabBar.test.tsx +342 -0
  441. package/src/__tests__/TabBarGlassFallback.test.tsx +234 -0
  442. package/src/__tests__/TabBarReanimatedDeps.test.ts +130 -0
  443. package/src/__tests__/TabBarWebFork.test.ts +243 -0
  444. package/src/__tests__/ToastContent.test.tsx +192 -0
  445. package/src/__tests__/ToastHostWebFork.test.ts +155 -0
  446. package/src/__tests__/Toaster.test.tsx +527 -0
  447. package/src/__tests__/animated-style-deps.test.ts +156 -0
  448. package/src/__tests__/icon-references.test.ts +243 -0
  449. package/src/__tests__/toast-animations.test.ts +98 -0
  450. package/src/__tests__/toast-comparator.test.ts +131 -0
  451. package/src/__tests__/toast-enter-driver.test.ts +147 -0
  452. package/src/__tests__/toast-fns.test.ts +240 -0
  453. package/src/__tests__/toast-position-utils.test.ts +259 -0
  454. package/src/__tests__/toast-positioner-utils.test.ts +214 -0
  455. package/src/__tests__/toast-store.test.ts +622 -0
  456. package/src/__tests__/toast-timers.test.ts +163 -0
  457. package/src/__tests__/use-animated-target.test.tsx +60 -0
  458. package/src/__tests__/use-app-state.test.tsx +127 -0
  459. package/src/__tests__/use-toast-colors.test.tsx +189 -0
  460. package/src/__tests__/web-position-fixed.test.ts +70 -0
  461. package/src/avatar-group/AvatarGroup.web.tsx +2 -1
  462. package/src/benefit-list/types.ts +2 -1
  463. package/src/bottom-sheet/index.web.tsx +3 -2
  464. package/src/context-menu/index.web.tsx +3 -2
  465. package/src/dialog/Dialog.web.tsx +4 -3
  466. package/src/fab/types.ts +4 -2
  467. package/src/frosted-icon-button/shared.ts +1 -1
  468. package/src/frosted-icon-button/types.ts +2 -1
  469. package/src/index.ts +4 -1
  470. package/src/index.web.ts +4 -1
  471. package/src/menu/index.web.tsx +2 -1
  472. package/src/popover/index.web.tsx +3 -2
  473. package/src/portal/index.tsx +4 -1
  474. package/src/progressive-blur/index.tsx +78 -0
  475. package/src/progressive-blur/index.web.tsx +65 -0
  476. package/src/progressive-blur/shared.ts +81 -0
  477. package/src/progressive-blur/types.ts +21 -0
  478. package/src/select/index.web.tsx +2 -1
  479. package/src/styles/web-view-style.ts +21 -0
  480. package/src/tab-bar/TabBar.stories.tsx +217 -0
  481. package/src/tab-bar/TabBarBase.tsx +517 -0
  482. package/src/tab-bar/expo-router/RouterTabBar.tsx +80 -0
  483. package/src/tab-bar/expo-router/fading-tab-screen.tsx +109 -0
  484. package/src/tab-bar/expo-router/index.ts +13 -0
  485. package/src/tab-bar/glyph.native.tsx +46 -0
  486. package/src/tab-bar/glyph.tsx +31 -0
  487. package/src/tab-bar/index.ts +32 -0
  488. package/src/tab-bar/index.web.tsx +34 -0
  489. package/src/tab-bar/minimize-context.tsx +117 -0
  490. package/src/tab-bar/shared.ts +159 -0
  491. package/src/tab-bar/surface-solid.tsx +40 -0
  492. package/src/tab-bar/surface.native.tsx +122 -0
  493. package/src/tab-bar/surface.tsx +28 -0
  494. package/src/tab-bar/surface.web.tsx +56 -0
  495. package/src/tab-bar/types.ts +91 -0
  496. package/src/toast/Positioner.tsx +121 -0
  497. package/src/toast/Toast.stories.tsx +292 -65
  498. package/src/toast/ToastContent.tsx +405 -0
  499. package/src/toast/ToastHost.native.tsx +31 -0
  500. package/src/toast/ToastHost.tsx +67 -0
  501. package/src/toast/ToastIcon.tsx +55 -0
  502. package/src/toast/ToastRow.tsx +485 -0
  503. package/src/toast/ToastSwipeHandler.tsx +222 -0
  504. package/src/toast/Toaster.tsx +259 -0
  505. package/src/toast/animations.ts +313 -0
  506. package/src/toast/constants.ts +76 -0
  507. package/src/toast/context.tsx +44 -0
  508. package/src/toast/index.tsx +47 -123
  509. package/src/toast/position-utils.ts +149 -0
  510. package/src/toast/positioner-utils.ts +142 -0
  511. package/src/toast/toast-comparator.ts +41 -0
  512. package/src/toast/toast-fns.ts +104 -0
  513. package/src/toast/toast-store.ts +432 -0
  514. package/src/toast/toast-timers.ts +124 -0
  515. package/src/toast/types.ts +301 -5
  516. package/src/toast/use-animated-target.ts +61 -0
  517. package/src/toast/use-app-state.ts +77 -0
  518. package/src/toast/use-toast-colors.ts +133 -0
  519. package/src/toast/use-toast-position.ts +46 -0
  520. package/src/tooltip/index.web.tsx +2 -1
  521. package/src/zoomable-image-gallery/ZoomableImageGallery.stories.tsx +134 -0
  522. package/src/zoomable-image-gallery/ZoomableImageGallery.tsx +50 -27
  523. package/lib/commonjs/toast/Toast.js +0 -267
  524. package/lib/commonjs/toast/Toast.js.map +0 -1
  525. package/lib/commonjs/toast/const.js +0 -8
  526. package/lib/commonjs/toast/const.js.map +0 -1
  527. package/lib/commonjs/toast/index.web.js +0 -114
  528. package/lib/commonjs/toast/index.web.js.map +0 -1
  529. package/lib/commonjs/toast/sonner/index.js +0 -9
  530. package/lib/commonjs/toast/sonner/index.js.map +0 -1
  531. package/lib/commonjs/toast/sonner/index.web.js +0 -9
  532. package/lib/commonjs/toast/sonner/index.web.js.map +0 -1
  533. package/lib/module/toast/Toast.js +0 -258
  534. package/lib/module/toast/Toast.js.map +0 -1
  535. package/lib/module/toast/const.js +0 -4
  536. package/lib/module/toast/const.js.map +0 -1
  537. package/lib/module/toast/index.web.js +0 -74
  538. package/lib/module/toast/index.web.js.map +0 -1
  539. package/lib/module/toast/sonner/index.js +0 -5
  540. package/lib/module/toast/sonner/index.js.map +0 -1
  541. package/lib/module/toast/sonner/index.web.js +0 -5
  542. package/lib/module/toast/sonner/index.web.js.map +0 -1
  543. package/lib/typescript/commonjs/toast/Toast.d.ts +0 -23
  544. package/lib/typescript/commonjs/toast/Toast.d.ts.map +0 -1
  545. package/lib/typescript/commonjs/toast/const.d.ts +0 -2
  546. package/lib/typescript/commonjs/toast/const.d.ts.map +0 -1
  547. package/lib/typescript/commonjs/toast/index.web.d.ts +0 -29
  548. package/lib/typescript/commonjs/toast/index.web.d.ts.map +0 -1
  549. package/lib/typescript/commonjs/toast/sonner/index.d.ts +0 -2
  550. package/lib/typescript/commonjs/toast/sonner/index.d.ts.map +0 -1
  551. package/lib/typescript/commonjs/toast/sonner/index.web.d.ts +0 -2
  552. package/lib/typescript/commonjs/toast/sonner/index.web.d.ts.map +0 -1
  553. package/lib/typescript/module/toast/Toast.d.ts +0 -23
  554. package/lib/typescript/module/toast/Toast.d.ts.map +0 -1
  555. package/lib/typescript/module/toast/const.d.ts +0 -2
  556. package/lib/typescript/module/toast/const.d.ts.map +0 -1
  557. package/lib/typescript/module/toast/index.web.d.ts +0 -29
  558. package/lib/typescript/module/toast/index.web.d.ts.map +0 -1
  559. package/lib/typescript/module/toast/sonner/index.d.ts +0 -2
  560. package/lib/typescript/module/toast/sonner/index.d.ts.map +0 -1
  561. package/lib/typescript/module/toast/sonner/index.web.d.ts +0 -2
  562. package/lib/typescript/module/toast/sonner/index.web.d.ts.map +0 -1
  563. package/src/toast/Toast.tsx +0 -269
  564. package/src/toast/const.ts +0 -1
  565. package/src/toast/index.web.tsx +0 -101
  566. package/src/toast/sonner/index.ts +0 -3
  567. package/src/toast/sonner/index.web.ts +0 -3
@@ -1,112 +1,36 @@
1
1
  "use strict";
2
2
 
3
- import React, { isValidElement } from 'react';
4
- import { View, StyleSheet } from 'react-native';
5
- import { nanoid } from 'nanoid/non-secure';
6
- import { toast as sonner, Toaster } from 'sonner-native';
7
- import { DURATION } from "./const.js";
8
- import { Icon as ToastIcon, Outer as BaseOuter, Text as ToastText, ToastConfigProvider } from "./Toast.js";
9
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
- export { DURATION } from "./const.js";
11
- export { Action, Icon, Outer, Text, ToastConfigProvider } from "./Toast.js";
3
+ import * as React from 'react';
4
+ import { Toaster } from "./Toaster.js";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ export { toast } from "./toast-fns.js";
7
+ export { Toaster } from "./Toaster.js";
8
+ export { toastDefaults } from "./constants.js";
12
9
  /**
13
- * Toasts are rendered in a global outlet, which is placed at the top of the
14
- * component tree.
15
- */
16
- export function ToastOutlet() {
17
- return /*#__PURE__*/_jsx(Toaster, {
18
- pauseWhenPageIsHidden: true,
19
- gap: 8
20
- });
21
- }
22
- function OuterWrapper({
23
- children
24
- }) {
25
- return /*#__PURE__*/_jsx(View, {
26
- style: wrapperStyles.container,
27
- children: /*#__PURE__*/_jsx(BaseOuter, {
28
- children: children
29
- })
30
- });
31
- }
32
-
33
- /**
34
- * Direct access to the Sonner API. Use sparingly — `toast()` covers the
35
- * common case and keeps the surface tied to bloom's themed look.
36
- */
37
- export const api = sonner;
38
- function dispatch(content, type, options = {}) {
39
- const id = nanoid();
40
- if (typeof content === 'string') {
41
- sonner.custom(/*#__PURE__*/_jsx(ToastConfigProvider, {
42
- id: id,
43
- type: type,
44
- children: /*#__PURE__*/_jsxs(OuterWrapper, {
45
- children: [/*#__PURE__*/_jsx(ToastIcon, {}), /*#__PURE__*/_jsx(ToastText, {
46
- children: content
47
- })]
48
- })
49
- }), {
50
- ...options,
51
- id,
52
- duration: options?.duration ?? DURATION
53
- });
54
- } else if (/*#__PURE__*/isValidElement(content)) {
55
- sonner.custom(/*#__PURE__*/_jsx(ToastConfigProvider, {
56
- id: id,
57
- type: type,
58
- children: content
59
- }), {
60
- ...options,
61
- id,
62
- duration: options?.duration ?? DURATION
63
- });
64
- } else {
65
- throw new Error(`Toast can be a string or a React element, got ${typeof content}`);
66
- }
67
- }
68
-
69
- /**
70
- * Show a toast notification.
10
+ * The toast stack. Mount this ONCE near the app root `OxyProvider` already
11
+ * does, so most apps never write it themselves.
71
12
  *
72
- * Pass a string for a simple text toast, or a React element for a custom
73
- * toast. The optional `options` argument accepts the standard Sonner
74
- * options plus a bloom `type` (defaults to `'default'`).
13
+ * Every default (position, swipe direction, offset, gap, `visibleToasts`,
14
+ * duration, pause-when-hidden) comes from `toastDefaults`, which `Toaster`
15
+ * applies; passing a prop here overrides exactly that one.
75
16
  *
76
- * ```ts
77
- * toast('Saved');
78
- * toast.success('Profile updated');
79
- * toast.error('Network error', { duration: 5000 });
80
- * toast.dismiss(id);
17
+ * ```tsx
18
+ * <ToastOutlet />
19
+ * <ToastOutlet position="top-center" visibleToasts={5} />
81
20
  * ```
82
21
  *
83
- * Pre-typed variants (`toast.success`, `toast.error`, `toast.warning`,
84
- * `toast.info`) are aliases for the corresponding `type`.
85
- */
86
-
87
- const toastImpl = (content, options = {}) => {
88
- dispatch(content, options.type ?? 'default', options);
89
- };
90
- toastImpl.success = (content, options) => dispatch(content, 'success', options ?? {});
91
- toastImpl.error = (content, options) => dispatch(content, 'error', options ?? {});
92
- toastImpl.warning = (content, options) => dispatch(content, 'warning', options ?? {});
93
- toastImpl.info = (content, options) => dispatch(content, 'info', options ?? {});
94
- toastImpl.dismiss = id => sonner.dismiss(id);
95
- export const toast = toastImpl;
96
-
97
- /**
98
- * Alias of `toast` kept for compatibility with the original 0.4.x surface
99
- * where `show()` was the documented entry point. New code should prefer
100
- * `toast()` directly.
22
+ * On iOS a toast that must appear above a native modal needs the overlay host
23
+ * injected Bloom does not depend on `react-native-screens` itself:
24
+ *
25
+ * ```tsx
26
+ * import { FullWindowOverlay } from 'react-native-screens';
27
+ * <ToastOutlet ToasterOverlayWrapper={FullWindowOverlay} />
28
+ * ```
101
29
  */
102
- export const show = toastImpl;
103
-
104
- /** Re-export the Toast function type so callers can refer to it. */
105
-
106
- const wrapperStyles = StyleSheet.create({
107
- container: {
108
- paddingHorizontal: 20,
109
- width: '100%'
110
- }
111
- });
30
+ export function ToastOutlet(props) {
31
+ return /*#__PURE__*/_jsx(Toaster, {
32
+ ...props
33
+ });
34
+ }
35
+ ToastOutlet.displayName = 'ToastOutlet';
112
36
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","isValidElement","View","StyleSheet","nanoid","toast","sonner","Toaster","DURATION","Icon","ToastIcon","Outer","BaseOuter","Text","ToastText","ToastConfigProvider","jsx","_jsx","jsxs","_jsxs","Action","ToastOutlet","pauseWhenPageIsHidden","gap","OuterWrapper","children","style","wrapperStyles","container","api","dispatch","content","type","options","id","custom","duration","Error","toastImpl","success","error","warning","info","dismiss","show","create","paddingHorizontal","width"],"sourceRoot":"../../../src","sources":["toast/index.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,cAAc,QAAQ,OAAO;AAC7C,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC/C,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,KAAK,IAAIC,MAAM,EAAEC,OAAO,QAAQ,eAAe;AAExD,SAASC,QAAQ,QAAQ,YAAS;AAClC,SACEC,IAAI,IAAIC,SAAS,EACjBC,KAAK,IAAIC,SAAS,EAClBC,IAAI,IAAIC,SAAS,EACjBC,mBAAmB,QACd,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAGjB,SAASX,QAAQ,QAAQ,YAAS;AAClC,SAASY,MAAM,EAAEX,IAAI,EAAEE,KAAK,EAAEE,IAAI,EAAEE,mBAAmB,QAAQ,YAAS;AAGxE;AACA;AACA;AACA;AACA,OAAO,SAASM,WAAWA,CAAA,EAAG;EAC5B,oBAAOJ,IAAA,CAACV,OAAO;IAACe,qBAAqB;IAACC,GAAG,EAAE;EAAE,CAAE,CAAC;AAClD;AAEA,SAASC,YAAYA,CAAC;EAAEC;AAAwC,CAAC,EAAE;EACjE,oBACER,IAAA,CAACf,IAAI;IAACwB,KAAK,EAAEC,aAAa,CAACC,SAAU;IAAAH,QAAA,eACnCR,IAAA,CAACL,SAAS;MAAAa,QAAA,EAAEA;IAAQ,CAAY;EAAC,CAC7B,CAAC;AAEX;;AAEA;AACA;AACA;AACA;AACA,OAAO,MAAMI,GAAG,GAAGvB,MAAM;AAEzB,SAASwB,QAAQA,CACfC,OAAwB,EACxBC,IAAe,EACfC,OAAyB,GAAG,CAAC,CAAC,EACxB;EACN,MAAMC,EAAE,GAAG9B,MAAM,CAAC,CAAC;EACnB,IAAI,OAAO2B,OAAO,KAAK,QAAQ,EAAE;IAC/BzB,MAAM,CAAC6B,MAA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O,EAAE,OAAO,EAAEE,OAAO,IAAI,CAAC,CAAC,CAAC;AACjFK,SAAS,CAACG,OAAO,GAAG,CAACV,OAAO,EAAEE,OAAO,KAAKH,QAAQ,CAACC,OAAO,EAAE,SAAS,EAAEE,OAAO,IAAI,CAAC,CAAC,CAAC;AACrFK,SAAS,CAACI,IAAI,GAAG,CAACX,OAAO,EAAEE,OAAO,KAAKH,QAAQ,CAACC,OAAO,EAAE,MAAM,EAAEE,OAAO,IAAI,CAAC,CAAC,CAAC;AAC/EK,SAAS,CAACK,OAAO,GAAIT,EAAE,IAAK5B,MAAM,CAACqC,OAAO,CAACT,EAAE,CAAC;AAE9C,OAAO,MAAM7B,KAAc,GAAGiC,SAAS;;AAEvC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMM,IAAa,GAAGN,SAAS;;AAEtC;;AAGA,MAAMX,aAAa,GAAGxB,UAAU,CAAC0C,MAAM,CAAC;EACtCjB,SAAS,EAAE;IACTkB,iBAAiB,EAAE,EAAE;IACrBC,KAAK,EAAE;EACT;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","Toaster","jsx","_jsx","toast","toastDefaults","ToastOutlet","props","displayName"],"sourceRoot":"../../../src","sources":["toast/index.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,OAAO,QAAQ,cAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGpC,SAASC,KAAK,QAAQ,gBAAa;AACnC,SAASH,OAAO,QAAQ,cAAW;AACnC,SAASI,aAAa,QAAQ,gBAAa;AAuB3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAACC,KAAmB,EAAE;EAC/C,oBAAOJ,IAAA,CAACF,OAAO;IAAA,GAAKM;EAAK,CAAG,CAAC;AAC/B;AAEAD,WAAW,CAACE,WAAW,GAAG,aAAa","ignoreList":[]}
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Derived from sonner-native v0.26.4 — src/position-utils.ts
5
+ * (MIT © Gunnar Torfi Steinarsson). See the top-level NOTICE.
6
+ *
7
+ * PURE geometry, called from plain JS. Upstream runs `calculateToastPosition`
8
+ * inside a Reanimated mapper (hence its `'worklet'` directive); Bloom computes the
9
+ * target in React and drives the shared value imperatively instead, because an
10
+ * animation returned from a mapper never ticks on web — see `use-animated-target.ts`.
11
+ * That also makes every function here directly unit-testable.
12
+ *
13
+ * Upstream's non-null assertions on the ordered id lookups are replaced with real
14
+ * guards: an id can genuinely be missing for a frame while the store's ordering
15
+ * and the rendered rows converge.
16
+ */
17
+ import { ESTIMATED_TOAST_HEIGHT, MIN_STACK_SCALE_X } from "./constants.js";
18
+ export const getOrderedToastIds = (toasts, position, enableStacking) => {
19
+ if (enableStacking) {
20
+ // Already in rendering order — the Toaster reverses top-center up front.
21
+ return toasts.map(t => t.id);
22
+ }
23
+ return position === 'top-center' ? toasts.map(t => t.id).reverse() : toasts.map(t => t.id);
24
+ };
25
+
26
+ /**
27
+ * How much a buried row is squeezed horizontally, so the stack reads as depth.
28
+ *
29
+ * Scale rather than width: changing the real width would rewrap the text. Returns
30
+ * 1 (no squeeze) for a single row, an expanded stack, stacking turned off, or
31
+ * before the window width is known.
32
+ */
33
+ export const calculateStackScaleX = ({
34
+ index,
35
+ numberOfToasts,
36
+ enableStacking,
37
+ position,
38
+ isExpanded,
39
+ stackGap,
40
+ screenWidth
41
+ }) => {
42
+ if (!enableStacking || numberOfToasts <= 1 || isExpanded || screenWidth <= 0) {
43
+ return 1;
44
+ }
45
+ const distanceFromFront = position === 'top-center' ? index : numberOfToasts - index - 1;
46
+ const narrowAmount = stackGap * distanceFromFront * 2;
47
+ return Math.max(MIN_STACK_SCALE_X, 1 - narrowAmount / screenWidth);
48
+ };
49
+ const heightOf = (allToastHeights, id) => {
50
+ if (id === undefined) {
51
+ return ESTIMATED_TOAST_HEIGHT;
52
+ }
53
+ // A measured 0 is not a real height — treat it as "not measured yet".
54
+ return allToastHeights[id] || ESTIMATED_TOAST_HEIGHT;
55
+ };
56
+ export const calculateToastPosition = ({
57
+ index,
58
+ numberOfToasts,
59
+ enableStacking,
60
+ position,
61
+ allToastHeights,
62
+ gap,
63
+ orderedToastIds,
64
+ isExpanded,
65
+ stackGap
66
+ }) => {
67
+ const effectiveEnableStacking = enableStacking && !isExpanded;
68
+
69
+ // Center anchors at top:50% of the screen (top edge of toast = center line).
70
+ // Shift by -frontHeight/2 so the front toast is visually centered on the line.
71
+ const centerShift = position === 'center' ? -(heightOf(allToastHeights, orderedToastIds[numberOfToasts - 1]) / 2) : 0;
72
+ if (effectiveEnableStacking) {
73
+ const currentHeight = heightOf(allToastHeights, orderedToastIds[index]);
74
+ if (position === 'top-center') {
75
+ const frontHeight = heightOf(allToastHeights, orderedToastIds[0]);
76
+ return frontHeight + index * stackGap - currentHeight;
77
+ }
78
+ // bottom-center and center
79
+ const frontHeight = heightOf(allToastHeights, orderedToastIds[numberOfToasts - 1]);
80
+ const distFromFront = numberOfToasts - 1 - index;
81
+ return centerShift - (frontHeight + distFromFront * stackGap - currentHeight);
82
+ }
83
+ const effectiveGap = isExpanded ? stackGap : gap;
84
+ if (position === 'top-center') {
85
+ let totalOffset = 0;
86
+ for (let i = 0; i < index; i++) {
87
+ const toastId = orderedToastIds[i];
88
+ if (toastId === undefined) {
89
+ continue;
90
+ }
91
+ totalOffset += heightOf(allToastHeights, toastId) + effectiveGap;
92
+ }
93
+ return totalOffset;
94
+ }
95
+
96
+ // bottom-center and center
97
+ let totalOffset = 0;
98
+ for (let i = numberOfToasts - 1; i > index; i--) {
99
+ const toastId = orderedToastIds[i];
100
+ if (toastId === undefined) {
101
+ continue;
102
+ }
103
+ totalOffset += heightOf(allToastHeights, toastId) + effectiveGap;
104
+ }
105
+ return centerShift - totalOffset;
106
+ };
107
+ //# sourceMappingURL=position-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ESTIMATED_TOAST_HEIGHT","MIN_STACK_SCALE_X","getOrderedToastIds","toasts","position","enableStacking","map","t","id","reverse","calculateStackScaleX","index","numberOfToasts","isExpanded","stackGap","screenWidth","distanceFromFront","narrowAmount","Math","max","heightOf","allToastHeights","undefined","calculateToastPosition","gap","orderedToastIds","effectiveEnableStacking","centerShift","currentHeight","frontHeight","distFromFront","effectiveGap","totalOffset","i","toastId"],"sourceRoot":"../../../src","sources":["toast/position-utils.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,sBAAsB,EAAEC,iBAAiB,QAAQ,gBAAa;AAGvE,OAAO,MAAMC,kBAAkB,GAAGA,CAChCC,MAAoB,EACpBC,QAAuB,EACvBC,cAAuB,KACI;EAC3B,IAAIA,cAAc,EAAE;IAClB;IACA,OAAOF,MAAM,CAACG,GAAG,CAAEC,CAAC,IAAKA,CAAC,CAACC,EAAE,CAAC;EAChC;EACA,OAAOJ,QAAQ,KAAK,YAAY,GAC5BD,MAAM,CAACG,GAAG,CAAEC,CAAC,IAAKA,CAAC,CAACC,EAAE,CAAC,CAACC,OAAO,CAAC,CAAC,GACjCN,MAAM,CAACG,GAAG,CAAEC,CAAC,IAAKA,CAAC,CAACC,EAAE,CAAC;AAC7B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,oBAAoB,GAAGA,CAAC;EACnCC,KAAK;EACLC,cAAc;EACdP,cAAc;EACdD,QAAQ;EACRS,UAAU;EACVC,QAAQ;EACRC;AASF,CAAC,KAAa;EACZ,IAAI,CAACV,cAAc,IAAIO,cAAc,IAAI,CAAC,IAAIC,UAAU,IAAIE,WAAW,IAAI,CAAC,EAAE;IAC5E,OAAO,CAAC;EACV;EAEA,MAAMC,iBAAiB,GACrBZ,QAAQ,KAAK,YAAY,GAAGO,KAAK,GAAGC,cAAc,GAAGD,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KAAK;IAChD,OACEgB,WAAW,IAAIE,WAAW,GAAGC,aAAa,GAAGhB,QAAQ,GAAGc,aAAa,CAAC;EAE1E;EAEA,MAAMG,YAAY,GAAGlB,UAAU,GAAGC,QAAQ,GAAGU,GAAG;EAEhD,IAAIpB,QAAQ,KAAK,YAAY,EAAE;IAC7B,IAAI4B,WAAW,GAAG,CAAC;IACnB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGtB,KAAK,EAAEsB,CAAC,EAAE,EAAE;MAC9B,MAAMC,OAAO,GAAGT,eAAe,CAACQ,CAAC,CAAC;MAClC,IAAIC,OAAO,KAAKZ,SAAS,EAAE;QACzB;MACF;MACAU,WAAW,IAAIZ,QAAQ,CAACC,eAAe,EAAEa,OAAO,CAAC,GAAGH,YAAY;IAClE;IACA,OAAOC,WAAW;EACpB;;EAEA;EACA,IAAIA,WAAW,GAAG,CAAC;EACnB,KAAK,IAAIC,CAAC,GAAGrB,cAAc,GAAG,CAAC,EAAEqB,CAAC,GAAGtB,KAAK,EAAEsB,CAAC,EAAE,EAAE;IAC/C,MAAMC,OAAO,GAAGT,eAAe,CAACQ,CAAC,CAAC;IAClC,IAAIC,OAAO,KAAKZ,SAAS,EAAE;MACzB;IACF;IACAU,WAAW,IAAIZ,QAAQ,CAACC,eAAe,EAAEa,OAAO,CAAC,GAAGH,YAAY;EAClE;EACA,OAAOJ,WAAW,GAAGK,WAAW;AAClC,CAAC","ignoreList":[]}
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Derived from sonner-native v0.26.4 — src/positioner-utils.ts
5
+ * (MIT © Gunnar Torfi Steinarsson). See the top-level NOTICE.
6
+ *
7
+ * Pure geometry for the per-position container: `position: 'absolute'` is correct
8
+ * here because the toast host provides a viewport-sized containing block (see
9
+ * `ToastHost`), which is what keeps this module platform-agnostic.
10
+ *
11
+ * INVARIANT: a row must never be laid out outside its container's box. See
12
+ * `getContainerStyle`.
13
+ */
14
+
15
+ import { ESTIMATED_TOAST_HEIGHT, OUTSIDE_PRESS_PADDING } from "./constants.js";
16
+ /**
17
+ * ALL FOUR EDGES ARE PINNED, for every position. `Positioner` then overrides the
18
+ * one anchored edge with `getInsetValues`, so the container still spans the host in
19
+ * the other direction and always has a REAL HEIGHT.
20
+ *
21
+ * That is the whole point. This used to be `{position:'absolute', width:'100%'}`
22
+ * plus an inset of only `{bottom: N}` — and since every row inside is ITSELF
23
+ * `position:'absolute'`, the container had no in-flow content and measured ZERO
24
+ * HEIGHT, so every row was laid out entirely OUTSIDE its parent's box. Measured on
25
+ * web: a bottom-center container was a 0-height line at y=884 with its rows at
26
+ * y=784 and y=838, i.e. at NEGATIVE offsets (`top: -46px`) from a zero-height
27
+ * parent. The DOM does not clip, so web rendered it anyway; Android does not
28
+ * tolerate it, and `bottom-center` — the DEFAULT position — painted nothing at all.
29
+ *
30
+ * Two things that look like they would work here and do NOT:
31
+ * - `justifyContent` cannot place the rows. They are absolutely positioned, so it
32
+ * has no effect on them; the row's own anchor (`top: 0` / `bottom: 0` /
33
+ * `top: '50%'`) does the placing.
34
+ * - PADDING cannot supply the edge offset. In CSS an absolutely positioned child
35
+ * resolves against its ancestor's PADDING BOX, so padding does not inset it —
36
+ * while Yoga DOES inset it. Padding would have moved the rows on native and left
37
+ * them at the screen edge on web. The offset therefore stays an inset on the
38
+ * container itself, which behaves identically on both.
39
+ */
40
+ export const getContainerStyle = () => ({
41
+ position: 'absolute',
42
+ top: 0,
43
+ right: 0,
44
+ bottom: 0,
45
+ left: 0,
46
+ alignItems: 'center',
47
+ // Enter and exit animations translate a row past the container edge on purpose.
48
+ overflow: 'visible'
49
+ });
50
+
51
+ /**
52
+ * How far the stack sits from its screen edge. A falsy `offset` means "derive from
53
+ * the safe area": `inset + 8`, or 16 when there is no inset.
54
+ *
55
+ * `Positioner` applies this over ONE of `getContainerStyle`'s four pinned edges;
56
+ * `calculateOutsidePressableArea` reads the same numbers as a plain edge distance.
57
+ */
58
+ export const getInsetValues = ({
59
+ position,
60
+ offset,
61
+ safeAreaInsets
62
+ }) => {
63
+ const {
64
+ top = 0,
65
+ bottom = 0
66
+ } = safeAreaInsets || {};
67
+ if (position === 'bottom-center') {
68
+ if (offset) return {
69
+ bottom: offset
70
+ };
71
+ return {
72
+ bottom: bottom > 0 ? bottom + 8 : 16
73
+ };
74
+ }
75
+ if (position === 'top-center') {
76
+ if (offset) return {
77
+ top: offset
78
+ };
79
+ return {
80
+ top: top > 0 ? top + 8 : 16
81
+ };
82
+ }
83
+ return {};
84
+ };
85
+
86
+ /**
87
+ * The area OUTSIDE the toast stack, used to collapse an expanded stack on press.
88
+ * It deliberately stops short of the stack itself so a press on a toast still
89
+ * reaches the toast.
90
+ */
91
+ export const calculateOutsidePressableArea = ({
92
+ position,
93
+ toastHeights,
94
+ gap,
95
+ visibleToasts,
96
+ insetValues
97
+ }) => {
98
+ const measuredHeights = Object.values(toastHeights);
99
+ const hasMeasurements = measuredHeights.length > 0;
100
+
101
+ // Upstream counts `min(measured.length, visibleToasts)` rows and only THEN
102
+ // falls back to the estimate — which makes the fallback multiply by zero, so
103
+ // an unmeasured stack reserved nothing and the press area ran underneath it.
104
+ // Reserve a full stack instead: this area is only rendered while the stack is
105
+ // expanded, so over-reserving is the safe direction.
106
+ const rowCount = hasMeasurements ? Math.min(measuredHeights.length, visibleToasts) : visibleToasts;
107
+ const totalToastHeight = hasMeasurements ? measuredHeights.slice(0, rowCount).reduce((sum, height) => sum + height, 0) : ESTIMATED_TOAST_HEIGHT * rowCount;
108
+ const gapHeight = gap * Math.max(0, rowCount - 1);
109
+ const stackHeight = totalToastHeight + gapHeight + OUTSIDE_PRESS_PADDING;
110
+ if (position === 'top-center') {
111
+ const topOffset = (insetValues.top || 40) + stackHeight;
112
+ return {
113
+ position: 'absolute',
114
+ top: topOffset,
115
+ bottom: 0,
116
+ left: 0,
117
+ right: 0
118
+ };
119
+ }
120
+ if (position === 'bottom-center') {
121
+ const bottomOffset = (insetValues.bottom || 40) + stackHeight;
122
+ return {
123
+ position: 'absolute',
124
+ top: 0,
125
+ bottom: bottomOffset,
126
+ left: 0,
127
+ right: 0
128
+ };
129
+ }
130
+ return {
131
+ display: 'none'
132
+ };
133
+ };
134
+ //# sourceMappingURL=positioner-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ESTIMATED_TOAST_HEIGHT","OUTSIDE_PRESS_PADDING","getContainerStyle","position","top","right","bottom","left","alignItems","overflow","getInsetValues","offset","safeAreaInsets","calculateOutsidePressableArea","toastHeights","gap","visibleToasts","insetValues","measuredHeights","Object","values","hasMeasurements","length","rowCount","Math","min","totalToastHeight","slice","reduce","sum","height","gapHeight","max","stackHeight","topOffset","bottomOffset","display"],"sourceRoot":"../../../src","sources":["toast/positioner-utils.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,sBAAsB,EAAEC,qBAAqB,QAAQ,gBAAa;AAG3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAGA,CAAA,MAAkB;EACjDC,QAAQ,EAAE,UAAU;EACpBC,GAAG,EAAE,CAAC;EACNC,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE,CAAC;EACTC,IAAI,EAAE,CAAC;EACPC,UAAU,EAAE,QAAQ;EACpB;EACAC,QAAQ,EAAE;AACZ,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAGA,CAAC;EAC7BP,QAAQ;EACRQ,MAAM;EACNC;AAKF,CAAC,KAAwC;EACvC,MAAM;IAAER,GAAG,GAAG,CAAC;IAAEE,MAAM,GAAG;EAAE,CAAC,GAAGM,cAAc,IAAI,CAAC,CAAC;EAEpD,IAAIT,QAAQ,KAAK,eAAe,EAAE;IAChC,IAAI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M+B,SAAS,GAAG,CAACjB,WAAW,CAACb,GAAG,IAAI,EAAE,IAAI6B,WAAW;IACvD,OAAO;MACL9B,QAAQ,EAAE,UAAU;MACpBC,GAAG,EAAE8B,SAAS;MACd5B,MAAM,EAAE,CAAC;MACTC,IAAI,EAAE,CAAC;MACPF,KAAK,EAAE;IACT,CAAC;EACH;EAEA,IAAIF,QAAQ,KAAK,eAAe,EAAE;IAChC,MAAMgC,YAAY,GAAG,CAAClB,WAAW,CAACX,MAAM,IAAI,EAAE,IAAI2B,WAAW;IAC7D,OAAO;MACL9B,QAAQ,EAAE,UAAU;MACpBC,GAAG,EAAE,CAAC;MACNE,MAAM,EAAE6B,YAAY;MACpB5B,IAAI,EAAE,CAAC;MACPF,KAAK,EAAE;IACT,CAAC;EACH;EAEA,OAAO;IAAE+B,OAAO,EAAE;EAAO,CAAC;AAC5B,CAAC","ignoreList":[]}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Derived from sonner-native v0.26.4 — src/toast-comparator.ts
5
+ * (MIT © Gunnar Torfi Steinarsson). See the top-level NOTICE.
6
+ *
7
+ * Drives `autoWiggleOnUpdate: 'toast-change'`: an update-by-id only wiggles the
8
+ * row when something a user can actually see changed. `description` is
9
+ * deliberately typed `string` (not `ReactNode`) so this stays a value compare —
10
+ * a ReactNode would differ on every parent re-render and wiggle forever.
11
+ */
12
+ import { isToastAction } from "./types.js";
13
+ const areActionsEqual = (a, b) => {
14
+ if (isToastAction(a) && isToastAction(b)) {
15
+ return a.label === b.label;
16
+ }
17
+ return a === b;
18
+ };
19
+ export const areToastsEqual = (a, b) => {
20
+ return a.id === b.id && a.title === b.title && a.variant === b.variant && a.description === b.description && a.closeButton === b.closeButton && a.invert === b.invert && a.position === b.position && a.dismissible === b.dismissible && a.icon === b.icon && a.jsx === b.jsx && a.duration === b.duration && a.style === b.style && a.styles === b.styles && a.important === b.important && a.richColors === b.richColors && a.promiseOptions === b.promiseOptions && areActionsEqual(a.action, b.action) && areActionsEqual(a.cancel, b.cancel);
21
+ };
22
+ //# sourceMappingURL=toast-comparator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isToastAction","areActionsEqual","a","b","label","areToastsEqual","id","title","variant","description","closeButton","invert","position","dismissible","icon","jsx","duration","style","styles","important","richColors","promiseOptions","action","cancel"],"sourceRoot":"../../../src","sources":["toast/toast-comparator.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,aAAa,QAAyB,YAAS;AAExD,MAAMC,eAAe,GAAGA,CAACC,CAAuB,EAAEC,CAAuB,KAAK;EAC5E,IAAIH,aAAa,CAACE,CAAC,CAAC,IAAIF,aAAa,CAACG,CAAC,CAAC,EAAE;IACxC,OAAOD,CAAC,CAACE,KAAK,KAAKD,CAAC,CAACC,KAAK;EAC5B;EAEA,OAAOF,CAAC,KAAKC,CAAC;AAChB,CAAC;AAED,OAAO,MAAME,cAAc,GAAGA,CAACH,CAAa,EAAEC,CAAa,KAAK;EAC9D,OACED,CAAC,CAACI,EAAE,KAAKH,CAAC,CAACG,EAAE,IACbJ,CAAC,CAACK,KAAK,KAAKJ,CAAC,CAACI,KAAK,IACnBL,CAAC,CAACM,OAAO,KAAKL,CAAC,CAACK,OAAO,IACvBN,CAAC,CAACO,WAAW,KAAKN,CAAC,CAACM,WAAW,IAC/BP,CAAC,CAACQ,WAAW,KAAKP,CAAC,CAACO,WAAW,IAC/BR,CAAC,CAACS,MAAM,KAAKR,CAAC,CAACQ,MAAM,IACrBT,CAAC,CAACU,QAAQ,KAAKT,CAAC,CAACS,QAAQ,IACzBV,CAAC,CAACW,WAAW,KAAKV,CAAC,CAACU,WAAW,IAC/BX,CAAC,CAACY,IAAI,KAAKX,CAAC,CAACW,IAAI,IACjBZ,CAAC,CAACa,GAAG,KAAKZ,CAAC,CAACY,GAAG,IACfb,CAAC,CAACc,QAAQ,KAAKb,CAAC,CAACa,QAAQ,IACzBd,CAAC,CAACe,KAAK,KAAKd,CAAC,CAACc,KAAK,IACnBf,CAAC,CAACgB,MAAM,KAAKf,CAAC,CAACe,MAAM,IACrBhB,CAAC,CAACiB,SAAS,KAAKhB,CAAC,CAACgB,SAAS,IAC3BjB,CAAC,CAACkB,UAAU,KAAKjB,CAAC,CAACiB,UAAU,IAC7BlB,CAAC,CAACmB,cAAc,KAAKlB,CAAC,CAACkB,cAAc,IACrCpB,eAAe,CAACC,CAAC,CAACoB,MAAM,EAAEnB,CAAC,CAACmB,MAAM,CAAC,IACnCrB,eAAe,CAACC,CAAC,CAACqB,MAAM,EAAEpB,CAAC,CAACoB,MAAM,CAAC;AAEvC,CAAC","ignoreList":[]}
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Derived from sonner-native v0.26.4 — src/toast-fns.ts
5
+ * (MIT © Gunnar Torfi Steinarsson). See the top-level NOTICE.
6
+ *
7
+ * This module is the ONLY translation layer between the public API and the
8
+ * engine:
9
+ * - the public option `type` becomes the internal `variant` (`'default'` →
10
+ * absent, so an unqualified toast renders neutral);
11
+ * - a `ReactNode` content becomes either `title` (string) or `jsx` (element).
12
+ * Nothing downstream of here knows the word `type`.
13
+ */
14
+ import { isValidElement } from 'react';
15
+ import { toastStore } from "./toast-store.js";
16
+ const TYPE_TO_VARIANT = {
17
+ default: undefined,
18
+ success: 'success',
19
+ error: 'error',
20
+ warning: 'warning',
21
+ info: 'info',
22
+ loading: 'loading'
23
+ };
24
+ const resolveContent = content => {
25
+ if (typeof content === 'string') {
26
+ return {
27
+ title: content
28
+ };
29
+ }
30
+ if (/*#__PURE__*/isValidElement(content)) {
31
+ // A custom element owns the whole row, so there is no title to render.
32
+ return {
33
+ title: '',
34
+ jsx: content
35
+ };
36
+ }
37
+ throw new Error(`Toast can be a string or a React element, got ${typeof content}`);
38
+ };
39
+ const dispatch = (content, options, variant) => {
40
+ const {
41
+ type,
42
+ ...rest
43
+ } = options;
44
+ return toastStore.addToast({
45
+ ...rest,
46
+ ...resolveContent(content),
47
+ variant: variant ?? (type === undefined ? undefined : TYPE_TO_VARIANT[type])
48
+ });
49
+ };
50
+ export const toast = Object.assign((content, options = {}) => dispatch(content, options), {
51
+ success: (content, options = {}) => dispatch(content, options, 'success'),
52
+ error: (content, options = {}) => dispatch(content, options, 'error'),
53
+ warning: (content, options = {}) => dispatch(content, options, 'warning'),
54
+ info: (content, options = {}) => dispatch(content, options, 'info'),
55
+ loading: (content, options = {}) => dispatch(content, options, 'loading'),
56
+ custom: (jsx, options = {}) => dispatch(jsx, options),
57
+ promise: (promise, options) => {
58
+ const {
59
+ loading,
60
+ success,
61
+ error,
62
+ styles,
63
+ ...rest
64
+ } = options;
65
+ return toastStore.addToast({
66
+ ...rest,
67
+ title: loading,
68
+ variant: 'loading',
69
+ styles: styles?.loading,
70
+ promiseOptions: {
71
+ // Mapping the result to its title here is what keeps `PromiseOptions`
72
+ // non-generic — the store never sees the caller's result type.
73
+ promise: promise.then(success),
74
+ loading,
75
+ error,
76
+ styles
77
+ }
78
+ });
79
+ },
80
+ dismiss: id => toastStore.dismissToast(id),
81
+ wiggle: id => {
82
+ toastStore.wiggleToast(id);
83
+ }
84
+ });
85
+ //# sourceMappingURL=toast-fns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isValidElement","toastStore","TYPE_TO_VARIANT","default","undefined","success","error","warning","info","loading","resolveContent","content","title","jsx","Error","dispatch","options","variant","type","rest","addToast","toast","Object","assign","custom","promise","styles","promiseOptions","then","dismiss","id","dismissToast","wiggle","wiggleToast"],"sourceRoot":"../../../src","sources":["toast/toast-fns.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,cAAc,QAA2C,OAAO;AACzE,SAASC,UAAU,QAAQ,kBAAe;AAS1C,MAAMC,eAA4D,GAAG;EACnEC,OAAO,EAAEC,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,KAAK,EAAE,OAAO;EACdC,OAAO,EAAE,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