@fluentui/react-toast 9.8.1 → 9.8.3

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 (311) hide show
  1. package/CHANGELOG.md +31 -2
  2. package/dist/index.d.cts +640 -0
  3. package/lib/AriaLive.js +1 -1
  4. package/lib/AriaLive.js.map +1 -1
  5. package/lib/Toast.js +1 -1
  6. package/lib/Toast.js.map +1 -1
  7. package/lib/ToastBody.js +1 -1
  8. package/lib/ToastBody.js.map +1 -1
  9. package/lib/ToastContainer.js +1 -1
  10. package/lib/ToastContainer.js.map +1 -1
  11. package/lib/ToastFooter.js +1 -1
  12. package/lib/ToastFooter.js.map +1 -1
  13. package/lib/ToastTitle.js +1 -1
  14. package/lib/ToastTitle.js.map +1 -1
  15. package/lib/ToastTrigger.js +1 -1
  16. package/lib/ToastTrigger.js.map +1 -1
  17. package/lib/Toaster.js +1 -1
  18. package/lib/Toaster.js.map +1 -1
  19. package/lib/components/AriaLive/AriaLive.js +3 -3
  20. package/lib/components/AriaLive/AriaLive.js.map +1 -1
  21. package/lib/components/AriaLive/index.js +4 -4
  22. package/lib/components/AriaLive/index.js.map +1 -1
  23. package/lib/components/AriaLive/renderAriaLive.js +1 -1
  24. package/lib/components/AriaLive/useAriaLive.js +2 -2
  25. package/lib/components/AriaLive/useAriaLiveStyles.styles.js +1 -1
  26. package/lib/components/AriaLive/useAriaLiveStyles.styles.js.map +1 -1
  27. package/lib/components/AriaLive/useAriaLiveStyles.styles.raw.js +1 -1
  28. package/lib/components/Timer/Timer.js +2 -2
  29. package/lib/components/Timer/Timer.js.map +1 -1
  30. package/lib/components/Timer/index.js +1 -1
  31. package/lib/components/Timer/index.js.map +1 -1
  32. package/lib/components/Timer/useTimerStyles.styles.js +1 -1
  33. package/lib/components/Timer/useTimerStyles.styles.js.map +1 -1
  34. package/lib/components/Timer/useTimerStyles.styles.raw.js +1 -1
  35. package/lib/components/Toast/Toast.js +6 -6
  36. package/lib/components/Toast/Toast.js.map +1 -1
  37. package/lib/components/Toast/index.js +4 -4
  38. package/lib/components/Toast/index.js.map +1 -1
  39. package/lib/components/Toast/renderToast.js +2 -2
  40. package/lib/components/Toast/useToast.js +2 -2
  41. package/lib/components/Toast/useToast.js.map +1 -1
  42. package/lib/components/Toast/useToastStyles.styles.js +2 -2
  43. package/lib/components/Toast/useToastStyles.styles.js.map +1 -1
  44. package/lib/components/Toast/useToastStyles.styles.raw.js +2 -2
  45. package/lib/components/ToastBody/ToastBody.js +5 -5
  46. package/lib/components/ToastBody/ToastBody.js.map +1 -1
  47. package/lib/components/ToastBody/index.js +4 -4
  48. package/lib/components/ToastBody/index.js.map +1 -1
  49. package/lib/components/ToastBody/renderToastBody.js +1 -1
  50. package/lib/components/ToastBody/useToastBody.js +3 -3
  51. package/lib/components/ToastBody/useToastBody.js.map +1 -1
  52. package/lib/components/ToastBody/useToastBodyStyles.styles.js +2 -2
  53. package/lib/components/ToastBody/useToastBodyStyles.styles.js.map +1 -1
  54. package/lib/components/ToastBody/useToastBodyStyles.styles.raw.js +2 -2
  55. package/lib/components/ToastContainer/ToastContainer.js +6 -6
  56. package/lib/components/ToastContainer/ToastContainer.js.map +1 -1
  57. package/lib/components/ToastContainer/index.js +5 -5
  58. package/lib/components/ToastContainer/index.js.map +1 -1
  59. package/lib/components/ToastContainer/renderToastContainer.js +3 -3
  60. package/lib/components/ToastContainer/renderToastContainer.js.map +1 -1
  61. package/lib/components/ToastContainer/useToastContainer.js +6 -6
  62. package/lib/components/ToastContainer/useToastContainer.js.map +1 -1
  63. package/lib/components/ToastContainer/useToastContainerContextValues.js +1 -1
  64. package/lib/components/ToastContainer/useToastContainerStyles.styles.js +3 -3
  65. package/lib/components/ToastContainer/useToastContainerStyles.styles.js.map +1 -1
  66. package/lib/components/ToastContainer/useToastContainerStyles.styles.raw.js +3 -3
  67. package/lib/components/ToastFooter/ToastFooter.js +5 -5
  68. package/lib/components/ToastFooter/ToastFooter.js.map +1 -1
  69. package/lib/components/ToastFooter/index.js +4 -4
  70. package/lib/components/ToastFooter/index.js.map +1 -1
  71. package/lib/components/ToastFooter/renderToastFooter.js +1 -1
  72. package/lib/components/ToastFooter/useToastFooter.js +1 -1
  73. package/lib/components/ToastFooter/useToastFooterStyles.styles.js +1 -1
  74. package/lib/components/ToastFooter/useToastFooterStyles.styles.js.map +1 -1
  75. package/lib/components/ToastFooter/useToastFooterStyles.styles.raw.js +1 -1
  76. package/lib/components/ToastTitle/ToastTitle.js +5 -5
  77. package/lib/components/ToastTitle/ToastTitle.js.map +1 -1
  78. package/lib/components/ToastTitle/index.js +4 -4
  79. package/lib/components/ToastTitle/index.js.map +1 -1
  80. package/lib/components/ToastTitle/renderToastTitle.js +1 -1
  81. package/lib/components/ToastTitle/useToastTitle.js +5 -5
  82. package/lib/components/ToastTitle/useToastTitle.js.map +1 -1
  83. package/lib/components/ToastTitle/useToastTitleStyles.styles.js +2 -2
  84. package/lib/components/ToastTitle/useToastTitleStyles.styles.js.map +1 -1
  85. package/lib/components/ToastTitle/useToastTitleStyles.styles.raw.js +2 -2
  86. package/lib/components/ToastTrigger/ToastTrigger.js +2 -2
  87. package/lib/components/ToastTrigger/ToastTrigger.js.map +1 -1
  88. package/lib/components/ToastTrigger/index.js +3 -3
  89. package/lib/components/ToastTrigger/index.js.map +1 -1
  90. package/lib/components/ToastTrigger/useToastTrigger.js +3 -3
  91. package/lib/components/ToastTrigger/useToastTrigger.js.map +1 -1
  92. package/lib/components/Toaster/Toaster.js +4 -4
  93. package/lib/components/Toaster/Toaster.js.map +1 -1
  94. package/lib/components/Toaster/index.js +5 -5
  95. package/lib/components/Toaster/index.js.map +1 -1
  96. package/lib/components/Toaster/renderToaster.js +3 -3
  97. package/lib/components/Toaster/renderToaster.js.map +1 -1
  98. package/lib/components/Toaster/useToastAnnounce.js +2 -2
  99. package/lib/components/Toaster/useToaster.js +9 -9
  100. package/lib/components/Toaster/useToaster.js.map +1 -1
  101. package/lib/components/Toaster/useToasterFocusManagement.js +5 -5
  102. package/lib/components/Toaster/useToasterFocusManagement.js.map +1 -1
  103. package/lib/components/Toaster/useToasterStyles.styles.js +2 -2
  104. package/lib/components/Toaster/useToasterStyles.styles.js.map +1 -1
  105. package/lib/components/Toaster/useToasterStyles.styles.raw.js +2 -2
  106. package/lib/components/Toaster/useToasterStyles.styles.raw.js.map +1 -1
  107. package/lib/contexts/toastContainerContext.js +1 -1
  108. package/lib/index.js +10 -10
  109. package/lib/index.js.map +1 -1
  110. package/lib/state/index.js +4 -4
  111. package/lib/state/index.js.map +1 -1
  112. package/lib/state/useToastController.js +3 -3
  113. package/lib/state/useToastController.js.map +1 -1
  114. package/lib/state/useToaster.js +5 -5
  115. package/lib/state/useToaster.js.map +1 -1
  116. package/lib/state/vanilla/createToaster.js +2 -2
  117. package/lib/state/vanilla/dismissAllToasts.js +1 -1
  118. package/lib/state/vanilla/dismissAllToasts.js.map +1 -1
  119. package/lib/state/vanilla/dismissToast.js +1 -1
  120. package/lib/state/vanilla/dismissToast.js.map +1 -1
  121. package/lib/state/vanilla/dispatchToast.js +1 -1
  122. package/lib/state/vanilla/dispatchToast.js.map +1 -1
  123. package/lib/state/vanilla/index.js +8 -8
  124. package/lib/state/vanilla/index.js.map +1 -1
  125. package/lib/state/vanilla/pauseToast.js +1 -1
  126. package/lib/state/vanilla/pauseToast.js.map +1 -1
  127. package/lib/state/vanilla/playToast.js +1 -1
  128. package/lib/state/vanilla/playToast.js.map +1 -1
  129. package/lib/state/vanilla/updateToast.js +1 -1
  130. package/lib/state/vanilla/updateToast.js.map +1 -1
  131. package/lib-commonjs/{AriaLive.js → AriaLive.cjs} +1 -1
  132. package/lib-commonjs/{AriaLive.js.map → AriaLive.cjs.map} +1 -1
  133. package/lib-commonjs/{Toast.js → Toast.cjs} +1 -1
  134. package/lib-commonjs/{Toast.js.map → Toast.cjs.map} +1 -1
  135. package/lib-commonjs/{ToastBody.js → ToastBody.cjs} +1 -1
  136. package/lib-commonjs/{ToastBody.js.map → ToastBody.cjs.map} +1 -1
  137. package/lib-commonjs/{ToastContainer.js → ToastContainer.cjs} +1 -1
  138. package/lib-commonjs/{ToastContainer.js.map → ToastContainer.cjs.map} +1 -1
  139. package/lib-commonjs/{ToastFooter.js → ToastFooter.cjs} +1 -1
  140. package/lib-commonjs/{ToastFooter.js.map → ToastFooter.cjs.map} +1 -1
  141. package/lib-commonjs/{ToastTitle.js → ToastTitle.cjs} +1 -1
  142. package/lib-commonjs/{ToastTitle.js.map → ToastTitle.cjs.map} +1 -1
  143. package/lib-commonjs/{ToastTrigger.js → ToastTrigger.cjs} +1 -1
  144. package/lib-commonjs/{ToastTrigger.js.map → ToastTrigger.cjs.map} +1 -1
  145. package/lib-commonjs/{Toaster.js → Toaster.cjs} +1 -1
  146. package/lib-commonjs/{Toaster.js.map → Toaster.cjs.map} +1 -1
  147. package/lib-commonjs/components/AriaLive/{AriaLive.js → AriaLive.cjs} +3 -3
  148. package/lib-commonjs/components/AriaLive/{AriaLive.js.map → AriaLive.cjs.map} +1 -1
  149. package/lib-commonjs/components/AriaLive/{index.js → index.cjs} +4 -4
  150. package/lib-commonjs/components/AriaLive/{index.js.map → index.cjs.map} +1 -1
  151. package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.cjs.map +1 -0
  152. package/lib-commonjs/components/Timer/{Timer.js → Timer.cjs} +1 -1
  153. package/lib-commonjs/components/Timer/{Timer.js.map → Timer.cjs.map} +1 -1
  154. package/lib-commonjs/components/Timer/{index.js → index.cjs} +1 -1
  155. package/lib-commonjs/components/Timer/{index.js.map → index.cjs.map} +1 -1
  156. package/lib-commonjs/components/Timer/useTimerStyles.styles.cjs.map +1 -0
  157. package/lib-commonjs/components/Toast/{Toast.js → Toast.cjs} +4 -4
  158. package/lib-commonjs/components/Toast/{Toast.js.map → Toast.cjs.map} +1 -1
  159. package/lib-commonjs/components/Toast/{index.js → index.cjs} +4 -4
  160. package/lib-commonjs/components/Toast/{index.js.map → index.cjs.map} +1 -1
  161. package/lib-commonjs/components/Toast/{useToast.js → useToast.cjs} +1 -1
  162. package/lib-commonjs/components/Toast/{useToast.js.map → useToast.cjs.map} +1 -1
  163. package/lib-commonjs/components/Toast/useToastStyles.styles.cjs.map +1 -0
  164. package/lib-commonjs/components/ToastBody/{ToastBody.js → ToastBody.cjs} +3 -3
  165. package/lib-commonjs/components/ToastBody/{ToastBody.js.map → ToastBody.cjs.map} +1 -1
  166. package/lib-commonjs/components/ToastBody/{index.js → index.cjs} +4 -4
  167. package/lib-commonjs/components/ToastBody/{index.js.map → index.cjs.map} +1 -1
  168. package/lib-commonjs/components/ToastBody/{useToastBody.js → useToastBody.cjs} +1 -1
  169. package/lib-commonjs/components/ToastBody/{useToastBody.js.map → useToastBody.cjs.map} +1 -1
  170. package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.cjs.map +1 -0
  171. package/lib-commonjs/components/ToastContainer/{ToastContainer.js → ToastContainer.cjs} +4 -4
  172. package/lib-commonjs/components/ToastContainer/{ToastContainer.js.map → ToastContainer.cjs.map} +1 -1
  173. package/lib-commonjs/components/ToastContainer/{index.js → index.cjs} +5 -5
  174. package/lib-commonjs/components/ToastContainer/{index.js.map → index.cjs.map} +1 -1
  175. package/lib-commonjs/components/ToastContainer/{renderToastContainer.js → renderToastContainer.cjs} +1 -1
  176. package/lib-commonjs/components/ToastContainer/{renderToastContainer.js.map → renderToastContainer.cjs.map} +1 -1
  177. package/lib-commonjs/components/ToastContainer/{useToastContainer.js → useToastContainer.cjs} +1 -1
  178. package/lib-commonjs/components/ToastContainer/{useToastContainer.js.map → useToastContainer.cjs.map} +1 -1
  179. package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.cjs.map +1 -0
  180. package/lib-commonjs/components/ToastFooter/{ToastFooter.js → ToastFooter.cjs} +3 -3
  181. package/lib-commonjs/components/ToastFooter/{ToastFooter.js.map → ToastFooter.cjs.map} +1 -1
  182. package/lib-commonjs/components/ToastFooter/{index.js → index.cjs} +4 -4
  183. package/lib-commonjs/components/ToastFooter/{index.js.map → index.cjs.map} +1 -1
  184. package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.cjs.map +1 -0
  185. package/lib-commonjs/components/ToastTitle/{ToastTitle.js → ToastTitle.cjs} +3 -3
  186. package/lib-commonjs/components/ToastTitle/{ToastTitle.js.map → ToastTitle.cjs.map} +1 -1
  187. package/lib-commonjs/components/ToastTitle/{index.js → index.cjs} +4 -4
  188. package/lib-commonjs/components/ToastTitle/{index.js.map → index.cjs.map} +1 -1
  189. package/lib-commonjs/components/ToastTitle/{useToastTitle.js → useToastTitle.cjs} +1 -1
  190. package/lib-commonjs/components/ToastTitle/{useToastTitle.js.map → useToastTitle.cjs.map} +1 -1
  191. package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.cjs.map +1 -0
  192. package/lib-commonjs/components/ToastTrigger/{ToastTrigger.js → ToastTrigger.cjs} +2 -2
  193. package/lib-commonjs/components/ToastTrigger/{ToastTrigger.js.map → ToastTrigger.cjs.map} +1 -1
  194. package/lib-commonjs/components/ToastTrigger/{index.js → index.cjs} +3 -3
  195. package/lib-commonjs/components/ToastTrigger/{index.js.map → index.cjs.map} +1 -1
  196. package/lib-commonjs/components/ToastTrigger/{useToastTrigger.js → useToastTrigger.cjs} +1 -1
  197. package/lib-commonjs/components/ToastTrigger/{useToastTrigger.js.map → useToastTrigger.cjs.map} +1 -1
  198. package/lib-commonjs/components/Toaster/{Toaster.js → Toaster.cjs} +3 -3
  199. package/lib-commonjs/components/Toaster/{Toaster.js.map → Toaster.cjs.map} +1 -1
  200. package/lib-commonjs/components/Toaster/{index.js → index.cjs} +5 -5
  201. package/lib-commonjs/components/Toaster/{index.js.map → index.cjs.map} +1 -1
  202. package/lib-commonjs/components/Toaster/{renderToaster.js → renderToaster.cjs} +2 -2
  203. package/lib-commonjs/components/Toaster/{renderToaster.js.map → renderToaster.cjs.map} +1 -1
  204. package/lib-commonjs/components/Toaster/{useToaster.js → useToaster.cjs} +12 -12
  205. package/lib-commonjs/components/Toaster/{useToaster.js.map → useToaster.cjs.map} +1 -1
  206. package/lib-commonjs/components/Toaster/{useToasterFocusManagement.js → useToasterFocusManagement.cjs} +2 -2
  207. package/lib-commonjs/components/Toaster/{useToasterFocusManagement.js.map → useToasterFocusManagement.cjs.map} +1 -1
  208. package/lib-commonjs/components/Toaster/{useToasterStyles.styles.js → useToasterStyles.styles.cjs} +1 -1
  209. package/lib-commonjs/components/Toaster/useToasterStyles.styles.cjs.map +1 -0
  210. package/lib-commonjs/components/Toaster/{useToasterStyles.styles.raw.js → useToasterStyles.styles.raw.cjs} +1 -1
  211. package/lib-commonjs/components/Toaster/{useToasterStyles.styles.raw.js.map → useToasterStyles.styles.raw.cjs.map} +1 -1
  212. package/lib-commonjs/{index.js → index.cjs} +11 -11
  213. package/lib-commonjs/{index.js.map → index.cjs.map} +1 -1
  214. package/lib-commonjs/state/{index.js → index.cjs} +5 -5
  215. package/lib-commonjs/state/{index.js.map → index.cjs.map} +1 -1
  216. package/lib-commonjs/state/{useToastController.js → useToastController.cjs} +7 -7
  217. package/lib-commonjs/state/{useToastController.js.map → useToastController.cjs.map} +1 -1
  218. package/lib-commonjs/state/{useToaster.js → useToaster.cjs} +3 -3
  219. package/lib-commonjs/state/{useToaster.js.map → useToaster.cjs.map} +1 -1
  220. package/lib-commonjs/state/vanilla/{dismissAllToasts.js → dismissAllToasts.cjs} +1 -1
  221. package/lib-commonjs/state/vanilla/{dismissAllToasts.js.map → dismissAllToasts.cjs.map} +1 -1
  222. package/lib-commonjs/state/vanilla/{dismissToast.js → dismissToast.cjs} +1 -1
  223. package/lib-commonjs/state/vanilla/{dismissToast.js.map → dismissToast.cjs.map} +1 -1
  224. package/lib-commonjs/state/vanilla/{dispatchToast.js → dispatchToast.cjs} +1 -1
  225. package/lib-commonjs/state/vanilla/{dispatchToast.js.map → dispatchToast.cjs.map} +1 -1
  226. package/lib-commonjs/state/vanilla/{index.js → index.cjs} +8 -8
  227. package/lib-commonjs/state/vanilla/{index.js.map → index.cjs.map} +1 -1
  228. package/lib-commonjs/state/vanilla/{pauseToast.js → pauseToast.cjs} +1 -1
  229. package/lib-commonjs/state/vanilla/{pauseToast.js.map → pauseToast.cjs.map} +1 -1
  230. package/lib-commonjs/state/vanilla/{playToast.js → playToast.cjs} +1 -1
  231. package/lib-commonjs/state/vanilla/{playToast.js.map → playToast.cjs.map} +1 -1
  232. package/lib-commonjs/state/vanilla/{updateToast.js → updateToast.cjs} +1 -1
  233. package/lib-commonjs/state/vanilla/{updateToast.js.map → updateToast.cjs.map} +1 -1
  234. package/package.json +23 -17
  235. package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.js.map +0 -1
  236. package/lib-commonjs/components/Timer/useTimerStyles.styles.js.map +0 -1
  237. package/lib-commonjs/components/Toast/useToastStyles.styles.js.map +0 -1
  238. package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.js.map +0 -1
  239. package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.js.map +0 -1
  240. package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.js.map +0 -1
  241. package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.js.map +0 -1
  242. package/lib-commonjs/components/Toaster/useToasterStyles.styles.js.map +0 -1
  243. /package/lib-commonjs/components/AriaLive/{AriaLive.types.js → AriaLive.types.cjs} +0 -0
  244. /package/lib-commonjs/components/AriaLive/{AriaLive.types.js.map → AriaLive.types.cjs.map} +0 -0
  245. /package/lib-commonjs/components/AriaLive/{renderAriaLive.js → renderAriaLive.cjs} +0 -0
  246. /package/lib-commonjs/components/AriaLive/{renderAriaLive.js.map → renderAriaLive.cjs.map} +0 -0
  247. /package/lib-commonjs/components/AriaLive/{useAriaLive.js → useAriaLive.cjs} +0 -0
  248. /package/lib-commonjs/components/AriaLive/{useAriaLive.js.map → useAriaLive.cjs.map} +0 -0
  249. /package/lib-commonjs/components/AriaLive/{useAriaLiveStyles.styles.js → useAriaLiveStyles.styles.cjs} +0 -0
  250. /package/lib-commonjs/components/AriaLive/{useAriaLiveStyles.styles.raw.js → useAriaLiveStyles.styles.raw.cjs} +0 -0
  251. /package/lib-commonjs/components/AriaLive/{useAriaLiveStyles.styles.raw.js.map → useAriaLiveStyles.styles.raw.cjs.map} +0 -0
  252. /package/lib-commonjs/components/Timer/{useTimerStyles.styles.js → useTimerStyles.styles.cjs} +0 -0
  253. /package/lib-commonjs/components/Timer/{useTimerStyles.styles.raw.js → useTimerStyles.styles.raw.cjs} +0 -0
  254. /package/lib-commonjs/components/Timer/{useTimerStyles.styles.raw.js.map → useTimerStyles.styles.raw.cjs.map} +0 -0
  255. /package/lib-commonjs/components/Toast/{Toast.types.js → Toast.types.cjs} +0 -0
  256. /package/lib-commonjs/components/Toast/{Toast.types.js.map → Toast.types.cjs.map} +0 -0
  257. /package/lib-commonjs/components/Toast/{renderToast.js → renderToast.cjs} +0 -0
  258. /package/lib-commonjs/components/Toast/{renderToast.js.map → renderToast.cjs.map} +0 -0
  259. /package/lib-commonjs/components/Toast/{useToastContextValues.js → useToastContextValues.cjs} +0 -0
  260. /package/lib-commonjs/components/Toast/{useToastContextValues.js.map → useToastContextValues.cjs.map} +0 -0
  261. /package/lib-commonjs/components/Toast/{useToastStyles.styles.js → useToastStyles.styles.cjs} +0 -0
  262. /package/lib-commonjs/components/Toast/{useToastStyles.styles.raw.js → useToastStyles.styles.raw.cjs} +0 -0
  263. /package/lib-commonjs/components/Toast/{useToastStyles.styles.raw.js.map → useToastStyles.styles.raw.cjs.map} +0 -0
  264. /package/lib-commonjs/components/ToastBody/{ToastBody.types.js → ToastBody.types.cjs} +0 -0
  265. /package/lib-commonjs/components/ToastBody/{ToastBody.types.js.map → ToastBody.types.cjs.map} +0 -0
  266. /package/lib-commonjs/components/ToastBody/{renderToastBody.js → renderToastBody.cjs} +0 -0
  267. /package/lib-commonjs/components/ToastBody/{renderToastBody.js.map → renderToastBody.cjs.map} +0 -0
  268. /package/lib-commonjs/components/ToastBody/{useToastBodyStyles.styles.js → useToastBodyStyles.styles.cjs} +0 -0
  269. /package/lib-commonjs/components/ToastBody/{useToastBodyStyles.styles.raw.js → useToastBodyStyles.styles.raw.cjs} +0 -0
  270. /package/lib-commonjs/components/ToastBody/{useToastBodyStyles.styles.raw.js.map → useToastBodyStyles.styles.raw.cjs.map} +0 -0
  271. /package/lib-commonjs/components/ToastContainer/{ToastContainer.types.js → ToastContainer.types.cjs} +0 -0
  272. /package/lib-commonjs/components/ToastContainer/{ToastContainer.types.js.map → ToastContainer.types.cjs.map} +0 -0
  273. /package/lib-commonjs/components/ToastContainer/{useToastContainerContextValues.js → useToastContainerContextValues.cjs} +0 -0
  274. /package/lib-commonjs/components/ToastContainer/{useToastContainerContextValues.js.map → useToastContainerContextValues.cjs.map} +0 -0
  275. /package/lib-commonjs/components/ToastContainer/{useToastContainerStyles.styles.js → useToastContainerStyles.styles.cjs} +0 -0
  276. /package/lib-commonjs/components/ToastContainer/{useToastContainerStyles.styles.raw.js → useToastContainerStyles.styles.raw.cjs} +0 -0
  277. /package/lib-commonjs/components/ToastContainer/{useToastContainerStyles.styles.raw.js.map → useToastContainerStyles.styles.raw.cjs.map} +0 -0
  278. /package/lib-commonjs/components/ToastFooter/{ToastFooter.types.js → ToastFooter.types.cjs} +0 -0
  279. /package/lib-commonjs/components/ToastFooter/{ToastFooter.types.js.map → ToastFooter.types.cjs.map} +0 -0
  280. /package/lib-commonjs/components/ToastFooter/{renderToastFooter.js → renderToastFooter.cjs} +0 -0
  281. /package/lib-commonjs/components/ToastFooter/{renderToastFooter.js.map → renderToastFooter.cjs.map} +0 -0
  282. /package/lib-commonjs/components/ToastFooter/{useToastFooter.js → useToastFooter.cjs} +0 -0
  283. /package/lib-commonjs/components/ToastFooter/{useToastFooter.js.map → useToastFooter.cjs.map} +0 -0
  284. /package/lib-commonjs/components/ToastFooter/{useToastFooterStyles.styles.js → useToastFooterStyles.styles.cjs} +0 -0
  285. /package/lib-commonjs/components/ToastFooter/{useToastFooterStyles.styles.raw.js → useToastFooterStyles.styles.raw.cjs} +0 -0
  286. /package/lib-commonjs/components/ToastFooter/{useToastFooterStyles.styles.raw.js.map → useToastFooterStyles.styles.raw.cjs.map} +0 -0
  287. /package/lib-commonjs/components/ToastTitle/{ToastTitle.types.js → ToastTitle.types.cjs} +0 -0
  288. /package/lib-commonjs/components/ToastTitle/{ToastTitle.types.js.map → ToastTitle.types.cjs.map} +0 -0
  289. /package/lib-commonjs/components/ToastTitle/{renderToastTitle.js → renderToastTitle.cjs} +0 -0
  290. /package/lib-commonjs/components/ToastTitle/{renderToastTitle.js.map → renderToastTitle.cjs.map} +0 -0
  291. /package/lib-commonjs/components/ToastTitle/{useToastTitleStyles.styles.js → useToastTitleStyles.styles.cjs} +0 -0
  292. /package/lib-commonjs/components/ToastTitle/{useToastTitleStyles.styles.raw.js → useToastTitleStyles.styles.raw.cjs} +0 -0
  293. /package/lib-commonjs/components/ToastTitle/{useToastTitleStyles.styles.raw.js.map → useToastTitleStyles.styles.raw.cjs.map} +0 -0
  294. /package/lib-commonjs/components/ToastTrigger/{ToastTrigger.types.js → ToastTrigger.types.cjs} +0 -0
  295. /package/lib-commonjs/components/ToastTrigger/{ToastTrigger.types.js.map → ToastTrigger.types.cjs.map} +0 -0
  296. /package/lib-commonjs/components/ToastTrigger/{renderToastTrigger.js → renderToastTrigger.cjs} +0 -0
  297. /package/lib-commonjs/components/ToastTrigger/{renderToastTrigger.js.map → renderToastTrigger.cjs.map} +0 -0
  298. /package/lib-commonjs/components/Toaster/{Toaster.types.js → Toaster.types.cjs} +0 -0
  299. /package/lib-commonjs/components/Toaster/{Toaster.types.js.map → Toaster.types.cjs.map} +0 -0
  300. /package/lib-commonjs/components/Toaster/{useToastAnnounce.js → useToastAnnounce.cjs} +0 -0
  301. /package/lib-commonjs/components/Toaster/{useToastAnnounce.js.map → useToastAnnounce.cjs.map} +0 -0
  302. /package/lib-commonjs/contexts/{toastContainerContext.js → toastContainerContext.cjs} +0 -0
  303. /package/lib-commonjs/contexts/{toastContainerContext.js.map → toastContainerContext.cjs.map} +0 -0
  304. /package/lib-commonjs/state/{constants.js → constants.cjs} +0 -0
  305. /package/lib-commonjs/state/{constants.js.map → constants.cjs.map} +0 -0
  306. /package/lib-commonjs/state/{types.js → types.cjs} +0 -0
  307. /package/lib-commonjs/state/{types.js.map → types.cjs.map} +0 -0
  308. /package/lib-commonjs/state/vanilla/{createToaster.js → createToaster.cjs} +0 -0
  309. /package/lib-commonjs/state/vanilla/{createToaster.js.map → createToaster.cjs.map} +0 -0
  310. /package/lib-commonjs/state/vanilla/{getPositionStyles.js → getPositionStyles.cjs} +0 -0
  311. /package/lib-commonjs/state/vanilla/{getPositionStyles.js.map → getPositionStyles.cjs.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Toaster/useToaster.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ExtractSlotProps, Slot } from '@fluentui/react-utilities';\nimport { getIntrinsicElementProps, useEventCallback, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { Escape } from '@fluentui/keyboard-keys';\nimport type { ToasterProps, ToasterState } from './Toaster.types';\nimport type { ToastPosition } from '../../state';\nimport { TOAST_POSITIONS, useToaster } from '../../state';\nimport type { Announce } from '../AriaLive';\nimport { ToastContainer } from '../ToastContainer';\nimport { useToasterFocusManagement_unstable } from './useToasterFocusManagement';\nimport { useToastAnnounce } from './useToastAnnounce';\n\n/**\n * Create the state required to render Toaster.\n *\n * @param props - props from this instance of Toaster\n */\nexport const useToaster_unstable = (props: ToasterProps): ToasterState => {\n const { offset, announce: announceProp, mountNode, inline = false, ...rest } = props;\n const announceRef = React.useRef<Announce>(() => null);\n const { toastsToRender, isToastVisible, pauseAllToasts, playAllToasts, tryRestoreFocus, closeAllToasts } =\n useToaster<HTMLDivElement>(rest);\n const announce = React.useCallback<Announce>((message, options) => announceRef.current(message, options), []);\n const { dir } = useFluent();\n\n const { onKeyDown: onKeyDownProp, ...rootProps } = slot.always(\n getIntrinsicElementProps<ExtractSlotProps<Slot<'div'>>>('div', rest),\n {\n elementType: 'div',\n },\n );\n const focusableGroupAttr = useFocusableGroup({\n tabBehavior: 'limited-trap-focus',\n ignoreDefaultKeydown: { Escape: true },\n });\n const onKeyDown = useEventCallback((e: React.KeyboardEvent<HTMLDivElement>) => {\n if (e.key === Escape) {\n e.preventDefault();\n closeAllToasts();\n }\n onKeyDownProp?.(e);\n });\n const usePositionSlot = (toastPosition: ToastPosition) => {\n const focusManagementRef = useToasterFocusManagement_unstable(pauseAllToasts, playAllToasts);\n const { announceToast, toasterRef } = useToastAnnounce(announceProp ?? announce);\n return slot.optional<ExtractSlotProps<Slot<'div'>>>(toastsToRender.has(toastPosition) ? rootProps : null, {\n defaultProps: {\n ref: useMergedRefs(focusManagementRef, toasterRef),\n children: toastsToRender.get(toastPosition)?.map(toast => (\n <ToastContainer\n {...toast}\n tryRestoreFocus={tryRestoreFocus}\n intent={toast.intent}\n announce={announceToast}\n key={toast.toastId}\n visible={isToastVisible(toast.toastId)}\n >\n {toast.content as React.ReactNode}\n </ToastContainer>\n )),\n onKeyDown,\n ...focusableGroupAttr,\n 'data-toaster-position': toastPosition,\n role: 'list',\n // Explicitly casting because our slot types can't handle data attributes\n } as ExtractSlotProps<Slot<'div'>>,\n elementType: 'div',\n });\n };\n\n return {\n dir,\n mountNode,\n components: {\n root: 'div',\n bottomStart: 'div',\n bottomEnd: 'div',\n topStart: 'div',\n topEnd: 'div',\n top: 'div',\n bottom: 'div',\n },\n root: slot.always(rootProps, { elementType: 'div' }),\n bottomStart: usePositionSlot(TOAST_POSITIONS.bottomStart),\n bottomEnd: usePositionSlot(TOAST_POSITIONS.bottomEnd),\n topStart: usePositionSlot(TOAST_POSITIONS.topStart),\n topEnd: usePositionSlot(TOAST_POSITIONS.topEnd),\n top: usePositionSlot(TOAST_POSITIONS.top),\n bottom: usePositionSlot(TOAST_POSITIONS.bottom),\n announceRef,\n offset,\n announce: announceProp ?? announce,\n renderAriaLive: !announceProp,\n inline,\n };\n};\n"],"names":["React","getIntrinsicElementProps","useEventCallback","useMergedRefs","slot","useFluent_unstable","useFluent","useFocusableGroup","Escape","TOAST_POSITIONS","useToaster","ToastContainer","useToasterFocusManagement_unstable","useToastAnnounce","useToaster_unstable","props","offset","announce","announceProp","mountNode","inline","rest","announceRef","useRef","toastsToRender","isToastVisible","pauseAllToasts","playAllToasts","tryRestoreFocus","closeAllToasts","useCallback","message","options","current","dir","onKeyDown","onKeyDownProp","rootProps","always","elementType","focusableGroupAttr","tabBehavior","ignoreDefaultKeydown","e","key","preventDefault","usePositionSlot","toastPosition","focusManagementRef","announceToast","toasterRef","optional","has","defaultProps","ref","children","get","map","toast","intent","toastId","visible","content","role","components","root","bottomStart","bottomEnd","topStart","topEnd","top","bottom","renderAriaLive"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,wBAAwB,EAAEC,gBAAgB,EAAEC,aAAa,EAAEC,IAAI,QAAQ,4BAA4B;AAC5G,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,iBAAiB,QAAQ,0BAA0B;AAC5D,SAASC,MAAM,QAAQ,0BAA0B;AAGjD,SAASC,eAAe,EAAEC,UAAU,QAAQ,cAAc;AAE1D,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,kCAAkC,QAAQ,8BAA8B;AACjF,SAASC,gBAAgB,QAAQ,qBAAqB;AAEtD;;;;CAIC,GACD,OAAO,MAAMC,sBAAsB,CAACC;IAClC,MAAM,EAAEC,MAAM,EAAEC,UAAUC,YAAY,EAAEC,SAAS,EAAEC,SAAS,KAAK,EAAE,GAAGC,MAAM,GAAGN;IAC/E,MAAMO,cAActB,MAAMuB,MAAM,CAAW,IAAM;IACjD,MAAM,EAAEC,cAAc,EAAEC,cAAc,EAAEC,cAAc,EAAEC,aAAa,EAAEC,eAA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AEA,OAAO;QACLL;QACAf;QACA6C,YAAY;YACVC,MAAM;YACNC,aAAa;YACbC,WAAW;YACXC,UAAU;YACVC,QAAQ;YACRC,KAAK;YACLC,QAAQ;QACV;QACAN,MAAM7D,KAAKkC,MAAM,CAACD,WAAW;YAAEE,aAAa;QAAM;QAClD2B,aAAapB,gBAAgBrC,gBAAgByD,WAAW;QACxDC,WAAWrB,gBAAgBrC,gBAAgB0D,SAAS;QACpDC,UAAUtB,gBAAgBrC,gBAAgB2D,QAAQ;QAClDC,QAAQvB,gBAAgBrC,gBAAgB4D,MAAM;QAC9CC,KAAKxB,gBAAgBrC,gBAAgB6D,GAAG;QACxCC,QAAQzB,gBAAgBrC,gBAAgB8D,MAAM;QAC9CjD;QACAN;QACAC,UAAUC,yBAAAA,0BAAAA,eAAgBD;QAC1BuD,gBAAgB,CAACtD;QACjBE;IACF;AACF,EAAE"}
1
+ {"version":3,"sources":["../src/components/Toaster/useToaster.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ExtractSlotProps, Slot } from '@fluentui/react-utilities';\nimport { getIntrinsicElementProps, useEventCallback, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { Escape } from '@fluentui/keyboard-keys';\nimport type { ToasterProps, ToasterState } from './Toaster.types';\nimport type { ToastPosition } from '../../state';\nimport { TOAST_POSITIONS, useToaster } from '../../state';\nimport type { Announce } from '../AriaLive';\nimport { ToastContainer } from '../ToastContainer';\nimport { useToasterFocusManagement_unstable } from './useToasterFocusManagement';\nimport { useToastAnnounce } from './useToastAnnounce';\n\n/**\n * Create the state required to render Toaster.\n *\n * @param props - props from this instance of Toaster\n */\nexport const useToaster_unstable = (props: ToasterProps): ToasterState => {\n const { offset, announce: announceProp, mountNode, inline = false, ...rest } = props;\n const announceRef = React.useRef<Announce>(() => null);\n const { toastsToRender, isToastVisible, pauseAllToasts, playAllToasts, tryRestoreFocus, closeAllToasts } =\n useToaster<HTMLDivElement>(rest);\n const announce = React.useCallback<Announce>((message, options) => announceRef.current(message, options), []);\n const { dir } = useFluent();\n\n const { onKeyDown: onKeyDownProp, ...rootProps } = slot.always(\n getIntrinsicElementProps<ExtractSlotProps<Slot<'div'>>>('div', rest),\n {\n elementType: 'div',\n },\n );\n const focusableGroupAttr = useFocusableGroup({\n tabBehavior: 'limited-trap-focus',\n ignoreDefaultKeydown: { Escape: true },\n });\n const onKeyDown = useEventCallback((e: React.KeyboardEvent<HTMLDivElement>) => {\n if (e.key === Escape) {\n e.preventDefault();\n closeAllToasts();\n }\n onKeyDownProp?.(e);\n });\n const usePositionSlot = (toastPosition: ToastPosition) => {\n const focusManagementRef = useToasterFocusManagement_unstable(pauseAllToasts, playAllToasts);\n const { announceToast, toasterRef } = useToastAnnounce(announceProp ?? announce);\n return slot.optional<ExtractSlotProps<Slot<'div'>>>(toastsToRender.has(toastPosition) ? rootProps : null, {\n defaultProps: {\n ref: useMergedRefs(focusManagementRef, toasterRef),\n children: toastsToRender.get(toastPosition)?.map(toast => (\n <ToastContainer\n {...toast}\n tryRestoreFocus={tryRestoreFocus}\n intent={toast.intent}\n announce={announceToast}\n key={toast.toastId}\n visible={isToastVisible(toast.toastId)}\n >\n {toast.content as React.ReactNode}\n </ToastContainer>\n )),\n onKeyDown,\n ...focusableGroupAttr,\n 'data-toaster-position': toastPosition,\n role: 'list',\n // Explicitly casting because our slot types can't handle data attributes\n } as ExtractSlotProps<Slot<'div'>>,\n elementType: 'div',\n });\n };\n\n return {\n dir,\n mountNode,\n components: {\n root: 'div',\n bottomStart: 'div',\n bottomEnd: 'div',\n topStart: 'div',\n topEnd: 'div',\n top: 'div',\n bottom: 'div',\n },\n root: slot.always(rootProps, { elementType: 'div' }),\n bottomStart: usePositionSlot(TOAST_POSITIONS.bottomStart),\n bottomEnd: usePositionSlot(TOAST_POSITIONS.bottomEnd),\n topStart: usePositionSlot(TOAST_POSITIONS.topStart),\n topEnd: usePositionSlot(TOAST_POSITIONS.topEnd),\n top: usePositionSlot(TOAST_POSITIONS.top),\n bottom: usePositionSlot(TOAST_POSITIONS.bottom),\n announceRef,\n offset,\n announce: announceProp ?? announce,\n renderAriaLive: !announceProp,\n inline,\n };\n};\n"],"names":["React","getIntrinsicElementProps","useEventCallback","useMergedRefs","slot","useFluent_unstable","useFluent","useFocusableGroup","Escape","TOAST_POSITIONS","useToaster","ToastContainer","useToasterFocusManagement_unstable","useToastAnnounce","useToaster_unstable","props","offset","announce","announceProp","mountNode","inline","rest","announceRef","useRef","toastsToRender","isToastVisible","pauseAllToasts","playAllToasts","tryRestoreFocus","closeAllToasts","useCallback","message","options","current","dir","onKeyDown","onKeyDownProp","rootProps","always","elementType","focusableGroupAttr","tabBehavior","ignoreDefaultKeydown","e","key","preventDefault","usePositionSlot","toastPosition","focusManagementRef","announceToast","toasterRef","optional","has","defaultProps","ref","children","get","map","toast","intent","toastId","visible","content","role","components","root","bottomStart","bottomEnd","topStart","topEnd","top","bottom","renderAriaLive"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,wBAAwB,EAAEC,gBAAgB,EAAEC,aAAa,EAAEC,IAAI,QAAQ,4BAA4B;AAC5G,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,iBAAiB,QAAQ,0BAA0B;AAC5D,SAASC,MAAM,QAAQ,0BAA0B;AAGjD,SAASC,eAAe,EAAEC,UAAU,QAAQ,uBAAc;AAE1D,SAASC,cAAc,QAAQ,6BAAoB;AACnD,SAASC,kCAAkC,QAAQ,iCAA8B;AACjF,SAASC,gBAAgB,QAAQ,wBAAqB;AAEtD;;;;CAIC,GACD,OAAO,MAAMC,sBAAsB,CAACC;IAClC,MAAM,EAAEC,MAAM,EAAEC,UAAUC,YAAY,EAAEC,SAAS,EAAEC,SAAS,KAAK,EAAE,GAAGC,MAAM,GAAGN;IAC/E,MAAMO,cAActB,MAAMuB,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gBAGlB3B;gBACA,GAAGK,kBAAkB;gBACrB,yBAAyBO;gBACzBgB,MAAM;YAER;YACAxB,aAAa;QACf;IACF;IAEA,OAAO;QACLL;QACAf;QACA6C,YAAY;YACVC,MAAM;YACNC,aAAa;YACbC,WAAW;YACXC,UAAU;YACVC,QAAQ;YACRC,KAAK;YACLC,QAAQ;QACV;QACAN,MAAM7D,KAAKkC,MAAM,CAACD,WAAW;YAAEE,aAAa;QAAM;QAClD2B,aAAapB,gBAAgBrC,gBAAgByD,WAAW;QACxDC,WAAWrB,gBAAgBrC,gBAAgB0D,SAAS;QACpDC,UAAUtB,gBAAgBrC,gBAAgB2D,QAAQ;QAClDC,QAAQvB,gBAAgBrC,gBAAgB4D,MAAM;QAC9CC,KAAKxB,gBAAgBrC,gBAAgB6D,GAAG;QACxCC,QAAQzB,gBAAgBrC,gBAAgB8D,MAAM;QAC9CjD;QACAN;QACAC,UAAUC,yBAAAA,0BAAAA,eAAgBD;QAC1BuD,gBAAgB,CAACtD;QACjBE;IACF;AACF,EAAE"}
@@ -1,9 +1,9 @@
1
1
  'use client';
2
- import { isHTMLElement } from '@fluentui/react-utilities';
3
- import * as React from 'react';
4
- import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';
5
- import { ArrowDown, ArrowUp } from '@fluentui/keyboard-keys';
6
- import { toastContainerClassNames } from '../ToastContainer';
2
+ import { isHTMLElement } from "@fluentui/react-utilities";
3
+ import * as React from "react";
4
+ import { useFluent_unstable as useFluent } from "@fluentui/react-shared-contexts";
5
+ import { ArrowDown, ArrowUp } from "@fluentui/keyboard-keys";
6
+ import { toastContainerClassNames } from "../ToastContainer/index.js";
7
7
  const noop = ()=>undefined;
8
8
  /**
9
9
  * @internal
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Toaster/useToasterFocusManagement.ts"],"sourcesContent":["'use client';\n\nimport { isHTMLElement } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { ArrowDown, ArrowUp } from '@fluentui/keyboard-keys';\nimport { toastContainerClassNames } from '../ToastContainer';\n\nconst noop = () => undefined;\n\n/**\n * @internal\n */\nexport function useToasterFocusManagement_unstable(\n pauseAllToasts: () => void,\n playAllToasts: () => void,\n): (el: HTMLDivElement) => void {\n const { targetDocument } = useFluent();\n const cleanupListenersRef = React.useRef<() => void>(noop);\n\n return React.useCallback(\n (el: HTMLDivElement) => {\n if (!el || !targetDocument) {\n cleanupListenersRef.current();\n cleanupListenersRef.current = noop;\n return;\n }\n\n const toastContainerWalker = targetDocument.createTreeWalker(el, NodeFilter.SHOW_ELEMENT, {\n acceptNode(node: Node) {\n if (isHTMLElement(node) && node.classList.contains(toastContainerClassNames.root)) {\n return NodeFilter.FILTER_ACCEPT;\n }\n\n return NodeFilter.FILTER_SKIP;\n },\n });\n\n /**\n * FIXME: https://github.com/microsoft/tabster/issues/299\n * Toasts should be arrow navigable and focus should be trapped in a stack of tasts\n * This is a temporary measure, Tabster does not have an API yet to enable mover arrow keys from within grouppers\n * Once tabster fully supports this use case, remove this hook\n */\n const keydownListener = (e: KeyboardEvent) => {\n const { target, key } = e;\n if (!isHTMLElement(target)) {\n return;\n }\n\n if (key === ArrowDown) {\n toastContainerWalker.currentNode = target;\n let nextToastContainer = toastContainerWalker.nextNode();\n if (!nextToastContainer) {\n toastContainerWalker.currentNode = el;\n nextToastContainer = toastContainerWalker.nextNode();\n }\n\n if (isHTMLElement(nextToastContainer)) {\n nextToastContainer.focus();\n }\n }\n\n if (key === ArrowUp) {\n toastContainerWalker.currentNode = target;\n let prevToastContainer = toastContainerWalker.previousNode();\n if (prevToastContainer && prevToastContainer.contains(target)) {\n prevToastContainer = toastContainerWalker.previousNode();\n }\n\n if (!prevToastContainer) {\n toastContainerWalker.currentNode = el;\n prevToastContainer = toastContainerWalker.lastChild();\n }\n\n if (isHTMLElement(prevToastContainer)) {\n prevToastContainer.focus();\n }\n }\n };\n\n const focusInListener = (e: FocusEvent) => {\n if (\n isHTMLElement(e.currentTarget) &&\n !e.currentTarget.contains(isHTMLElement(e.relatedTarget) ? e.relatedTarget : null)\n ) {\n pauseAllToasts();\n }\n };\n\n const focusOutListener = (e: FocusEvent) => {\n if (\n isHTMLElement(e.currentTarget) &&\n !e.currentTarget.contains(isHTMLElement(e.relatedTarget) ? e.relatedTarget : null)\n ) {\n playAllToasts();\n }\n };\n\n el.addEventListener('keydown', keydownListener);\n el.addEventListener('focusin', focusInListener);\n el.addEventListener('focusout', focusOutListener);\n\n cleanupListenersRef.current = () => {\n el.removeEventListener('keydown', keydownListener);\n el.removeEventListener('focusin', focusInListener);\n el.removeEventListener('focusout', focusOutListener);\n };\n },\n [targetDocument, pauseAllToasts, playAllToasts],\n );\n}\n"],"names":["isHTMLElement","React","useFluent_unstable","useFluent","ArrowDown","ArrowUp","toastContainerClassNames","noop","undefined","useToasterFocusManagement_unstable","pauseAllToasts","playAllToasts","targetDocument","cleanupListenersRef","useRef","useCallback","el","current","toastContainerWalker","createTreeWalker","NodeFilter","SHOW_ELEMENT","acceptNode","node","classList","contains","root","FILTER_ACCEPT","FILTER_SKIP","keydownListener","e","target","key","currentNode","nextToastContainer","nextNode","focus","prevToastContainer","previousNode","lastChild","focusInListener","currentTarget","relatedTarget","focusOutListener","addEventListener","removeEventListener"],"mappings":"AAAA;AAEA,SAASA,aAAa,QAAQ,4BAA4B;AAC1D,YAAYC,WAAW,QAAQ;AAC/B,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,SAAS,EAAEC,OAAO,QAAQ,0BAA0B;AAC7D,SAASC,wBAAwB,QAAQ,oBAAoB;AAE7D,MAAMC,OAAO,IAAMC;AAEnB;;CAEC,GACD,OAAO,SAASC,mCACdC,cAA0B,EAC1BC,aAAyB;IAEzB,MAAM,EAAEC,cAAc,EAAE,GAAGT;IAC3B,MAAMU,sBAAsBZ,MAAMa,MAAM,CAAaP;IAErD,OAAON,MAAMc,WAAW,CACtB,CAACC;QAC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ACX,EAAEW,aAAa,CAAChB,QAAQ,CAACzB,cAAc8B,EAAEY,aAAa,IAAIZ,EAAEY,aAAa,GAAG,OAC7E;gBACAhC;YACF;QACF;QAEA,MAAMiC,mBAAmB,CAACb;YACxB,IACE9B,cAAc8B,EAAEW,aAAa,KAC7B,CAACX,EAAEW,aAAa,CAAChB,QAAQ,CAACzB,cAAc8B,EAAEY,aAAa,IAAIZ,EAAEY,aAAa,GAAG,OAC7E;gBACA/B;YACF;QACF;QAEAK,GAAG4B,gBAAgB,CAAC,WAAWf;QAC/Bb,GAAG4B,gBAAgB,CAAC,WAAWJ;QAC/BxB,GAAG4B,gBAAgB,CAAC,YAAYD;QAEhC9B,oBAAoBI,OAAO,GAAG;YAC5BD,GAAG6B,mBAAmB,CAAC,WAAWhB;YAClCb,GAAG6B,mBAAmB,CAAC,WAAWL;YAClCxB,GAAG6B,mBAAmB,CAAC,YAAYF;QACrC;IACF,GACA;QAAC/B;QAAgBF;QAAgBC;KAAc;AAEnD"}
1
+ {"version":3,"sources":["../src/components/Toaster/useToasterFocusManagement.ts"],"sourcesContent":["'use client';\n\nimport { isHTMLElement } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { ArrowDown, ArrowUp } from '@fluentui/keyboard-keys';\nimport { toastContainerClassNames } from '../ToastContainer';\n\nconst noop = () => undefined;\n\n/**\n * @internal\n */\nexport function useToasterFocusManagement_unstable(\n pauseAllToasts: () => void,\n playAllToasts: () => void,\n): (el: HTMLDivElement) => void {\n const { targetDocument } = useFluent();\n const cleanupListenersRef = React.useRef<() => void>(noop);\n\n return React.useCallback(\n (el: HTMLDivElement) => {\n if (!el || !targetDocument) {\n cleanupListenersRef.current();\n cleanupListenersRef.current = noop;\n return;\n }\n\n const toastContainerWalker = targetDocument.createTreeWalker(el, NodeFilter.SHOW_ELEMENT, {\n acceptNode(node: Node) {\n if (isHTMLElement(node) && node.classList.contains(toastContainerClassNames.root)) {\n return NodeFilter.FILTER_ACCEPT;\n }\n\n return NodeFilter.FILTER_SKIP;\n },\n });\n\n /**\n * FIXME: https://github.com/microsoft/tabster/issues/299\n * Toasts should be arrow navigable and focus should be trapped in a stack of tasts\n * This is a temporary measure, Tabster does not have an API yet to enable mover arrow keys from within grouppers\n * Once tabster fully supports this use case, remove this hook\n */\n const keydownListener = (e: KeyboardEvent) => {\n const { target, key } = e;\n if (!isHTMLElement(target)) {\n return;\n }\n\n if (key === ArrowDown) {\n toastContainerWalker.currentNode = target;\n let nextToastContainer = toastContainerWalker.nextNode();\n if (!nextToastContainer) {\n toastContainerWalker.currentNode = el;\n nextToastContainer = toastContainerWalker.nextNode();\n }\n\n if (isHTMLElement(nextToastContainer)) {\n nextToastContainer.focus();\n }\n }\n\n if (key === ArrowUp) {\n toastContainerWalker.currentNode = target;\n let prevToastContainer = toastContainerWalker.previousNode();\n if (prevToastContainer && prevToastContainer.contains(target)) {\n prevToastContainer = toastContainerWalker.previousNode();\n }\n\n if (!prevToastContainer) {\n toastContainerWalker.currentNode = el;\n prevToastContainer = toastContainerWalker.lastChild();\n }\n\n if (isHTMLElement(prevToastContainer)) {\n prevToastContainer.focus();\n }\n }\n };\n\n const focusInListener = (e: FocusEvent) => {\n if (\n isHTMLElement(e.currentTarget) &&\n !e.currentTarget.contains(isHTMLElement(e.relatedTarget) ? e.relatedTarget : null)\n ) {\n pauseAllToasts();\n }\n };\n\n const focusOutListener = (e: FocusEvent) => {\n if (\n isHTMLElement(e.currentTarget) &&\n !e.currentTarget.contains(isHTMLElement(e.relatedTarget) ? e.relatedTarget : null)\n ) {\n playAllToasts();\n }\n };\n\n el.addEventListener('keydown', keydownListener);\n el.addEventListener('focusin', focusInListener);\n el.addEventListener('focusout', focusOutListener);\n\n cleanupListenersRef.current = () => {\n el.removeEventListener('keydown', keydownListener);\n el.removeEventListener('focusin', focusInListener);\n el.removeEventListener('focusout', focusOutListener);\n };\n },\n [targetDocument, pauseAllToasts, playAllToasts],\n );\n}\n"],"names":["isHTMLElement","React","useFluent_unstable","useFluent","ArrowDown","ArrowUp","toastContainerClassNames","noop","undefined","useToasterFocusManagement_unstable","pauseAllToasts","playAllToasts","targetDocument","cleanupListenersRef","useRef","useCallback","el","current","toastContainerWalker","createTreeWalker","NodeFilter","SHOW_ELEMENT","acceptNode","node","classList","contains","root","FILTER_ACCEPT","FILTER_SKIP","keydownListener","e","target","key","currentNode","nextToastContainer","nextNode","focus","prevToastContainer","previousNode","lastChild","focusInListener","currentTarget","relatedTarget","focusOutListener","addEventListener","removeEventListener"],"mappings":"AAAA;AAEA,SAASA,aAAa,QAAQ,4BAA4B;AAC1D,YAAYC,WAAW,QAAQ;AAC/B,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,SAAS,EAAEC,OAAO,QAAQ,0BAA0B;AAC7D,SAASC,wBAAwB,QAAQ,6BAAoB;AAE7D,MAAMC,OAAO,IAAMC;AAEnB;;CAEC,GACD,OAAO,SAASC,mCACdC,cAA0B,EAC1BC,aAAyB;IAEzB,MAAM,EAAEC,cAAc,EAAE,GAAGT;IAC3B,MAAMU,sBAAsBZ,MAAMa,MAAM,CAAaP;IAErD,OAAON,MAAMc,WAAW,CACtB,CAACC;QACC,IAAI,CAACA,MAAM,CAACJ,gBAAgB;YAC1BC,oBAAoBI,OAAO;YAC3BJ,oBAAoBI,OAAO,GAAGV;YAC9B;QACF;QAEA,MAAMW,uBAAuBN,eAAeO,gBAAgB,CAACH,IAAII,WAAWC,YAAY,EAAE;YACxFC,YAAWC,IAAU;gBACnB,IAAIvB,cAAcuB,SAASA,KAAKC,SAAS,CAACC,QAAQ,CAACnB,yBAAyBoB,IAAI,GAAG;oBACjF,OAAON,WAAWO,aAAa;gBACjC;gBAEA,OAAOP,WAAWQ,WAAW;YAC/B;QACF;QAEA;;;;;OAKC,GACD,MAAMC,kBAAkB,CAACC;YACvB,MAAM,EAAEC,MAAM,EAAEC,GAAG,EAAE,GAAGF;YACxB,IAA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G6B,mBAAmB,CAAC,WAAWhB;YAClCb,GAAG6B,mBAAmB,CAAC,WAAWL;YAClCxB,GAAG6B,mBAAmB,CAAC,YAAYF;QACrC;IACF,GACA;QAAC/B;QAAgBF;QAAgBC;KAAc;AAEnD"}
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
- import { __resetStyles, __styles, mergeClasses } from '@griffel/react';
4
- import { TOAST_POSITIONS, getPositionStyles } from '../../state/index';
3
+ import { __resetStyles, __styles, mergeClasses } from "@griffel/react";
4
+ import { TOAST_POSITIONS, getPositionStyles } from "../../state/index.js";
5
5
  export const toasterClassNames = {
6
6
  root: 'fui-Toaster'
7
7
  };
@@ -1 +1 @@
1
- {"version":3,"names":["__resetStyles","__styles","mergeClasses","TOAST_POSITIONS","getPositionStyles","toasterClassNames","root","useRootBaseClassName","useToasterStyles","inline","qhf8xq","d","useToasterStyles_unstable","state","rootBaseClassName","styles","className","bottomStart","_state_bottomStart","_style","style","Object","assign","dir","offset","bottomEnd","_state_bottomEnd","_style1","topStart","_state_topStart","_style2","topEnd","_state_topEnd","_style3","top","_state_top","_style4","bottom","_state_bottom","_style5"],"sources":["useToasterStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { TOAST_POSITIONS, getPositionStyles } from '../../state/index';\nexport const toasterClassNames = {\n root: 'fui-Toaster'\n};\n/**\n * Styles for the root slot\n */ const useRootBaseClassName = makeResetStyles({\n position: 'fixed',\n width: '292px',\n pointerEvents: 'none'\n});\nconst useToasterStyles = makeStyles({\n inline: {\n position: 'absolute'\n }\n});\n/**\n * Apply styling to the Toaster slots based on the state\n */ export const useToasterStyles_unstable = (state)=>{\n const rootBaseClassName = useRootBaseClassName();\n const styles = useToasterStyles();\n const className = mergeClasses(toasterClassNames.root, rootBaseClassName, state.inline && styles.inline, state.root.className);\n if (state.bottomStart) {\n var _state_bottomStart;\n // eslint-disable-next-line react-hooks/immutability\n state.bottomStart.className = className;\n var _style;\n (_style = (_state_bottomStart = state.bottomStart).style) !== null && _style !== void 0 ? _style : _state_bottomStart.style = {};\n Object.assign(state.bottomStart.style, getPositionStyles(TOAST_POSITIONS.bottomStart, state.dir, state.offset));\n }\n if (state.bottomEnd) {\n var _state_bottomEnd;\n // eslint-disable-next-line react-hooks/immutability\n state.bottomEnd.className = className;\n var _style1;\n (_style1 = (_state_bottomEnd = state.bottomEnd).style) !== null && _style1 !== void 0 ? _style1 : _state_bottomEnd.style = {};\n Object.assign(state.bottomEnd.style, getPositionStyles(TOAST_POSITIONS.bottomEnd, state.dir, state.offset));\n }\n if (state.topStart) {\n var _state_topStart;\n // eslint-disable-next-line react-hooks/immutability\n state.topStart.className = className;\n var _style2;\n (_style2 = (_state_topStart = state.topStart).style) !== null && _style2 !== void 0 ? _style2 : _state_topStart.style = {};\n Object.assign(state.topStart.style, getPositionStyles(TOAST_POSITIONS.topStart, state.dir, state.offset));\n }\n if (state.topEnd) {\n var _state_topEnd;\n // eslint-disable-next-line react-hooks/immutability\n state.topEnd.className = className;\n var _style3;\n (_style3 = (_state_topEnd = state.topEnd).style) !== null && _style3 !== void 0 ? _style3 : _state_topEnd.style = {};\n Object.assign(state.topEnd.style, getPositionStyles(TOAST_POSITIONS.topEnd, state.dir, state.offset));\n }\n if (state.top) {\n var _state_top;\n // eslint-disable-next-line react-hooks/immutability\n state.top.className = className;\n var _style4;\n (_style4 = (_state_top = state.top).style) !== null && _style4 !== void 0 ? _style4 : _state_top.style = {};\n Object.assign(state.top.style, getPositionStyles(TOAST_POSITIONS.top, state.dir, state.offset));\n }\n if (state.bottom) {\n var _state_bottom;\n // eslint-disable-next-line react-hooks/immutability\n state.bottom.className = className;\n var _style5;\n (_style5 = (_state_bottom = state.bottom).style) !== null && _style5 !== void 0 ? _style5 : _state_bottom.style = {};\n Object.assign(state.bottom.style, getPositionStyles(TOAST_POSITIONS.bottom, state.dir, state.offset));\n }\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,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M,CAACT,KAAK,CAACkB,MAAM,CAACX,KAAK,EAAEhB,iBAAiB,CAACD,eAAe,CAAC4B,MAAM,EAAElB,KAAK,CAACU,GAAG,EAAEV,KAAK,CAACW,MAAM,CAAC,CAAC;EACzG;EACA,IAAIX,KAAK,CAACqB,GAAG,EAAE;IACX,IAAIC,UAAU;IACd;IACAtB,KAAK,CAACqB,GAAG,CAAClB,SAAS,GAAGA,SAAS;IAC/B,IAAIoB,OAAO;IACX,CAACA,OAAO,GAAG,CAACD,UAAU,GAAGtB,KAAK,CAACqB,GAAG,EAAEd,KAAK,MAAM,IAAI,IAAIgB,OAAO,KAAK,KAAK,CAAC,GAAGA,OAAO,GAAGD,UAAU,CAACf,KAAK,GAAG,CAAC,CAAC;IAC3GC,MAAM,CAACC,MAAM,CAACT,KAAK,CAACqB,GAAG,CAACd,KAAK,EAAEhB,iBAAiB,CAACD,eAAe,CAAC+B,GAAG,EAAErB,KAAK,CAACU,GAAG,EAAEV,KAAK,CAACW,MAAM,CAAC,CAAC;EACnG;EACA,IAAIX,KAAK,CAACwB,MAAM,EAAE;IACd,IAAIC,aAAa;IACjB;IACAzB,KAAK,CAACwB,MAAM,CAACrB,SAAS,GAAGA,SAAS;IAClC,IAAIuB,OAAO;IACX,CAACA,OAAO,GAAG,CAACD,aAAa,GAAGzB,KAAK,CAACwB,MAAM,EAAEjB,KAAK,MAAM,IAAI,IAAImB,OAAO,KAAK,KAAK,CAAC,GAAGA,OAAO,GAAGD,aAAa,CAAClB,KAAK,GAAG,CAAC,CAAC;IACpHC,MAAM,CAACC,MAAM,CAACT,KAAK,CAACwB,MAAM,CAACjB,KAAK,EAAEhB,iBAAiB,CAACD,eAAe,CAACkC,MAAM,EAAExB,KAAK,CAACU,GAAG,EAAEV,KAAK,CAACW,MAAM,CAAC,CAAC;EACzG;EACA,OAAOX,KAAK;AAChB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__resetStyles","__styles","mergeClasses","TOAST_POSITIONS","getPositionStyles","toasterClassNames","root","useRootBaseClassName","useToasterStyles","inline","qhf8xq","d","useToasterStyles_unstable","state","rootBaseClassName","styles","className","bottomStart","_state_bottomStart","_style","style","Object","assign","dir","offset","bottomEnd","_state_bottomEnd","_style1","topStart","_state_topStart","_style2","topEnd","_state_topEnd","_style3","top","_state_top","_style4","bottom","_state_bottom","_style5"],"sources":["useToasterStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses } from \"@griffel/react\";\nimport { TOAST_POSITIONS, getPositionStyles } from \"../../state/index.js\";\nexport const toasterClassNames = {\n root: 'fui-Toaster'\n};\n/**\n * Styles for the root slot\n */ const useRootBaseClassName = makeResetStyles({\n position: 'fixed',\n width: '292px',\n pointerEvents: 'none'\n});\nconst useToasterStyles = makeStyles({\n inline: {\n position: 'absolute'\n }\n});\n/**\n * Apply styling to the Toaster slots based on the state\n */ export const useToasterStyles_unstable = (state)=>{\n const rootBaseClassName = useRootBaseClassName();\n const styles = useToasterStyles();\n const className = mergeClasses(toasterClassNames.root, rootBaseClassName, state.inline && styles.inline, state.root.className);\n if (state.bottomStart) {\n var _state_bottomStart;\n // eslint-disable-next-line react-hooks/immutability\n state.bottomStart.className = className;\n var _style;\n (_style = (_state_bottomStart = state.bottomStart).style) !== null && _style !== void 0 ? _style : _state_bottomStart.style = {};\n Object.assign(state.bottomStart.style, getPositionStyles(TOAST_POSITIONS.bottomStart, state.dir, state.offset));\n }\n if (state.bottomEnd) {\n var _state_bottomEnd;\n // eslint-disable-next-line react-hooks/immutability\n state.bottomEnd.className = className;\n var _style1;\n (_style1 = (_state_bottomEnd = state.bottomEnd).style) !== null && _style1 !== void 0 ? _style1 : _state_bottomEnd.style = {};\n Object.assign(state.bottomEnd.style, getPositionStyles(TOAST_POSITIONS.bottomEnd, state.dir, state.offset));\n }\n if (state.topStart) {\n var _state_topStart;\n // eslint-disable-next-line react-hooks/immutability\n state.topStart.className = className;\n var _style2;\n (_style2 = (_state_topStart = state.topStart).style) !== null && _style2 !== void 0 ? _style2 : _state_topStart.style = {};\n Object.assign(state.topStart.style, getPositionStyles(TOAST_POSITIONS.topStart, state.dir, state.offset));\n }\n if (state.topEnd) {\n var _state_topEnd;\n // eslint-disable-next-line react-hooks/immutability\n state.topEnd.className = className;\n var _style3;\n (_style3 = (_state_topEnd = state.topEnd).style) !== null && _style3 !== void 0 ? _style3 : _state_topEnd.style = {};\n Object.assign(state.topEnd.style, getPositionStyles(TOAST_POSITIONS.topEnd, state.dir, state.offset));\n }\n if (state.top) {\n var _state_top;\n // eslint-disable-next-line react-hooks/immutability\n state.top.className = className;\n var _style4;\n (_style4 = (_state_top = state.top).style) !== null && _style4 !== void 0 ? _style4 : _state_top.style = {};\n Object.assign(state.top.style, getPositionStyles(TOAST_POSITIONS.top, state.dir, state.offset));\n }\n if (state.bottom) {\n var _state_bottom;\n // eslint-disable-next-line react-hooks/immutability\n state.bottom.className = className;\n var _style5;\n (_style5 = (_state_bottom = state.bottom).style) !== null && _style5 !== void 0 ? _style5 : _state_bottom.style = {};\n Object.assign(state.bottom.style, getPositionStyles(TOAST_POSITIONS.bottom, state.dir, state.offset));\n }\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,aAAA,EAAAC,QAAA,EAAsCC,YAAY,QAAQ,gBAAgB;AAC1E,SAASC,eAAe,EAAEC,iBAAiB,QAAQ,sBAAsB;AACzE,OAAO,MAAMC,iBAAiB,GAAG;EAC7BC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,oBAAoB,gBAAGP,aAAA,+EAIhC,CAAC;AACF,MAAMQ,gBAAgB,gBAAGP,QAAA;EAAAQ,MAAA;IAAAC,MAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAIxB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,yBAAyB,GAAIC,KAAK,IAAG;EAClD,MAAMC,iBAAiB,GAAGP,oBAAoB,CAAC,CAAC;EAChD,MAAMQ,MAAM,GAAGP,g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AAM,CAACT,KAAK,CAACqB,GAAG,CAACd,KAAK,EAAEhB,iBAAiB,CAACD,eAAe,CAAC+B,GAAG,EAAErB,KAAK,CAACU,GAAG,EAAEV,KAAK,CAACW,MAAM,CAAC,CAAC;EACnG;EACA,IAAIX,KAAK,CAACwB,MAAM,EAAE;IACd,IAAIC,aAAa;IACjB;IACAzB,KAAK,CAACwB,MAAM,CAACrB,SAAS,GAAGA,SAAS;IAClC,IAAIuB,OAAO;IACX,CAACA,OAAO,GAAG,CAACD,aAAa,GAAGzB,KAAK,CAACwB,MAAM,EAAEjB,KAAK,MAAM,IAAI,IAAImB,OAAO,KAAK,KAAK,CAAC,GAAGA,OAAO,GAAGD,aAAa,CAAClB,KAAK,GAAG,CAAC,CAAC;IACpHC,MAAM,CAACC,MAAM,CAACT,KAAK,CAACwB,MAAM,CAACjB,KAAK,EAAEhB,iBAAiB,CAACD,eAAe,CAACkC,MAAM,EAAExB,KAAK,CAACU,GAAG,EAAEV,KAAK,CAACW,MAAM,CAAC,CAAC;EACzG;EACA,OAAOX,KAAK;AAChB,CAAC","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';
3
- import { TOAST_POSITIONS, getPositionStyles } from '../../state/index';
2
+ import { makeResetStyles, makeStyles, mergeClasses } from "@griffel/react";
3
+ import { TOAST_POSITIONS, getPositionStyles } from "../../state/index.js";
4
4
  export const toasterClassNames = {
5
5
  root: 'fui-Toaster'
6
6
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Toaster/useToasterStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { ToasterSlots, ToasterState } from './Toaster.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { TOAST_POSITIONS, getPositionStyles } from '../../state/index';\n\nexport const toasterClassNames: SlotClassNames<ToasterSlots> = {\n root: 'fui-Toaster',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootBaseClassName = makeResetStyles({\n position: 'fixed',\n width: '292px',\n pointerEvents: 'none',\n});\n\nconst useToasterStyles = makeStyles({\n inline: {\n position: 'absolute',\n },\n});\n\n/**\n * Apply styling to the Toaster slots based on the state\n */\nexport const useToasterStyles_unstable = (state: ToasterState): ToasterState => {\n const rootBaseClassName = useRootBaseClassName();\n const styles = useToasterStyles();\n const className = mergeClasses(\n toasterClassNames.root,\n rootBaseClassName,\n state.inline && styles.inline,\n state.root.className,\n );\n if (state.bottomStart) {\n // eslint-disable-next-line react-hooks/immutability\n state.bottomStart.className = className;\n state.bottomStart.style ??= {};\n Object.assign(state.bottomStart.style, getPositionStyles(TOAST_POSITIONS.bottomStart, state.dir, state.offset));\n }\n\n if (state.bottomEnd) {\n // eslint-disable-next-line react-hooks/immutability\n state.bottomEnd.className = className;\n state.bottomEnd.style ??= {};\n Object.assign(state.bottomEnd.style, getPositionStyles(TOAST_POSITIONS.bottomEnd, state.dir, state.offset));\n }\n\n if (state.topStart) {\n // eslint-disable-next-line react-hooks/immutability\n state.topStart.className = className;\n state.topStart.style ??= {};\n Object.assign(state.topStart.style, getPositionStyles(TOAST_POSITIONS.topStart, state.dir, state.offset));\n }\n\n if (state.topEnd) {\n // eslint-disable-next-line react-hooks/immutability\n state.topEnd.className = className;\n state.topEnd.style ??= {};\n Object.assign(state.topEnd.style, getPositionStyles(TOAST_POSITIONS.topEnd, state.dir, state.offset));\n }\n\n if (state.top) {\n // eslint-disable-next-line react-hooks/immutability\n state.top.className = className;\n state.top.style ??= {};\n Object.assign(state.top.style, getPositionStyles(TOAST_POSITIONS.top, state.dir, state.offset));\n }\n\n if (state.bottom) {\n // eslint-disable-next-line react-hooks/immutability\n state.bottom.className = className;\n state.bottom.style ??= {};\n Object.assign(state.bottom.style, getPositionStyles(TOAST_POSITIONS.bottom, state.dir, state.offset));\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","TOAST_POSITIONS","getPositionStyles","toasterClassNames","root","useRootBaseClassName","position","width","pointerEvents","useToasterStyles","inline","useToasterStyles_unstable","state","rootBaseClassName","styles","className","bottomStart","style","Object","assign","dir","offset","bottomEnd","topStart","topEnd","top","bottom"],"mappings":"AAAA;AAEA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAG3E,SAASC,eAAe,EAAEC,iBAAiB,QAAQ,oBAAoB;AAEvE,OAAO,MAAMC,oBAAkD;IAC7DC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,uBAAuBP,gBAAgB;IAC3CQ,UAAU;IACVC,OAAO;IACPC,eAAe;AACjB;AAEA,MAAMC,mBAAmBV,WAAW;IAClCW,QAAQ;QACNJ,UAAU;IACZ;AACF;AAEA;;CAEC,GACD,OAAO,MAAMK,4BAA4B,CAACC;IACxC,MAAMC,oBAAoBR;IAC1B,MAAMS,SAASL;IACf,MAAMM,YAAYf,aAChBG,kBAAkBC,IAAI,EACtBS,mBACAD,MAAMF,MAAM,IAAII,OAAOJ,MAAM,EAC7BE,MAAMR,IAAI,CAACW,SAAS;IAEtB,IAAIH,MAAMI,WAAW,EAAE;YAGrBJ;QAFA,oDAAoD;QACpDA,MAAMI,WAAW,CAACD,SAAS,GAAGA;;QAC9BH,WAAAA,qBAAAA,MAAMI,WAAW,EAACC,gDAAlBL,mBAAkBK,QAAU,CAAC;QAC7BC,OAAOC,MAAM,CAACP,MAAMI,WAAW,CAACC,KAAK,EAAEf,kBAAkBD,gBAAgBe,WAAW,EAAEJ,MAAMQ,GAAG,EAAER,MAAMS,MAAM;IAC/G;IAEA,IAAIT,MAAMU,SAAS,EAAE;YAGnBV;QAFA,oDAAoD;QACpDA,MAAMU,SAAS,CAACP,SAAS,GAAGA;;QAC5BH,YAAAA,mBAAAA,MAAMU,SAAS,EAACL,kDAAhBL,iBAAgBK,QAAU,CAAC;QAC3BC,OAAOC,MAAM,CAACP,MAAMU,SAAS,CAACL,KAAK,EAAEf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EAAEd,MAAMQ,GAAG,EAAER,MAAMS,MAAM;IACrG;IAEA,OAAOT;AACT,EAAE"}
1
+ {"version":3,"sources":["../src/components/Toaster/useToasterStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { ToasterSlots, ToasterState } from './Toaster.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { TOAST_POSITIONS, getPositionStyles } from '../../state/index';\n\nexport const toasterClassNames: SlotClassNames<ToasterSlots> = {\n root: 'fui-Toaster',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootBaseClassName = makeResetStyles({\n position: 'fixed',\n width: '292px',\n pointerEvents: 'none',\n});\n\nconst useToasterStyles = makeStyles({\n inline: {\n position: 'absolute',\n },\n});\n\n/**\n * Apply styling to the Toaster slots based on the state\n */\nexport const useToasterStyles_unstable = (state: ToasterState): ToasterState => {\n const rootBaseClassName = useRootBaseClassName();\n const styles = useToasterStyles();\n const className = mergeClasses(\n toasterClassNames.root,\n rootBaseClassName,\n state.inline && styles.inline,\n state.root.className,\n );\n if (state.bottomStart) {\n // eslint-disable-next-line react-hooks/immutability\n state.bottomStart.className = className;\n state.bottomStart.style ??= {};\n Object.assign(state.bottomStart.style, getPositionStyles(TOAST_POSITIONS.bottomStart, state.dir, state.offset));\n }\n\n if (state.bottomEnd) {\n // eslint-disable-next-line react-hooks/immutability\n state.bottomEnd.className = className;\n state.bottomEnd.style ??= {};\n Object.assign(state.bottomEnd.style, getPositionStyles(TOAST_POSITIONS.bottomEnd, state.dir, state.offset));\n }\n\n if (state.topStart) {\n // eslint-disable-next-line react-hooks/immutability\n state.topStart.className = className;\n state.topStart.style ??= {};\n Object.assign(state.topStart.style, getPositionStyles(TOAST_POSITIONS.topStart, state.dir, state.offset));\n }\n\n if (state.topEnd) {\n // eslint-disable-next-line react-hooks/immutability\n state.topEnd.className = className;\n state.topEnd.style ??= {};\n Object.assign(state.topEnd.style, getPositionStyles(TOAST_POSITIONS.topEnd, state.dir, state.offset));\n }\n\n if (state.top) {\n // eslint-disable-next-line react-hooks/immutability\n state.top.className = className;\n state.top.style ??= {};\n Object.assign(state.top.style, getPositionStyles(TOAST_POSITIONS.top, state.dir, state.offset));\n }\n\n if (state.bottom) {\n // eslint-disable-next-line react-hooks/immutability\n state.bottom.className = className;\n state.bottom.style ??= {};\n Object.assign(state.bottom.style, getPositionStyles(TOAST_POSITIONS.bottom, state.dir, state.offset));\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","TOAST_POSITIONS","getPositionStyles","toasterClassNames","root","useRootBaseClassName","position","width","pointerEvents","useToasterStyles","inline","useToasterStyles_unstable","state","rootBaseClassName","styles","className","bottomStart","style","Object","assign","dir","offset","bottomEnd","topStart","topEnd","top","bottom"],"mappings":"AAAA;AAEA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAG3E,SAASC,eAAe,EAAEC,iBAAiB,QAAQ,uBAAoB;AAEvE,OAAO,MAAMC,oBAAkD;IAC7DC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,uBAAuBP,gBAAgB;IAC3CQ,UAAU;IACVC,OAAO;IACPC,eAAe;AACjB;AAEA,MAAMC,mBAAmBV,WAAW;IAClCW,QAAQ;QACNJ,UAAU;IACZ;AACF;AAEA;;CAEC,GACD,OAAO,MAAMK,4BAA4B,CAACC;IACxC,MAAMC,oBAAoBR;IAC1B,MAAMS,SAASL;IACf,MAAMM,YAAYf,aAChBG,kBAAkBC,IAAI,EACtBS,mBACAD,MAAMF,MAAM,IAAII,OAAOJ,MAAM,EAC7BE,MAAMR,IAAI,CAACW,SAAS;IAEtB,IAAIH,MAAMI,WAAW,EAAE;YAGrBJ;QAFA,oDAAoD;QACpDA,MAAMI,WAAW,CAACD,SAAS,GAAGA;;QAC9BH,WAAAA,qBAAAA,MAAMI,WAAW,EAACC,gDAAlBL,mBAAkBK,QAAU,CAAC;QAC7BC,OA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Ma,GAAG,CAACR,KAAK,EAAEf,kBAAkBD,gBAAgBwB,GAAG,EAAEb,MAAMQ,GAAG,EAAER,MAAMS,MAAM;IAC/F;IAEA,IAAIT,MAAMc,MAAM,EAAE;YAGhBd;QAFA,oDAAoD;QACpDA,MAAMc,MAAM,CAACX,SAAS,GAAGA;;QACzBH,YAAAA,gBAAAA,MAAMc,MAAM,EAACT,kDAAbL,cAAaK,QAAU,CAAC;QACxBC,OAAOC,MAAM,CAACP,MAAMc,MAAM,CAACT,KAAK,EAAEf,kBAAkBD,gBAAgByB,MAAM,EAAEd,MAAMQ,GAAG,EAAER,MAAMS,MAAM;IACrG;IAEA,OAAOT;AACT,EAAE"}
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import * as React from 'react';
2
+ import * as React from "react";
3
3
  const toastContainerContextDefaultValue = {
4
4
  close: ()=>null,
5
5
  intent: undefined,
package/lib/index.js CHANGED
@@ -1,10 +1,10 @@
1
- export { useToastController, useToaster } from './state';
2
- export { ToastTrigger, useToastTrigger_unstable, renderToastTrigger_unstable } from './ToastTrigger';
3
- export { Toaster, useToaster_unstable, useToasterStyles_unstable, renderToaster_unstable, toasterClassNames, useToastAnnounce } from './Toaster';
4
- export { Toast, useToastStyles_unstable, useToastBase_unstable, useToast_unstable, renderToast_unstable, toastClassNames } from './Toast';
5
- export { ToastTitle, useToastTitleStyles_unstable, useToastTitleBase_unstable, useToastTitle_unstable, renderToastTitle_unstable, toastTitleClassNames } from './ToastTitle';
6
- export { ToastBody, useToastBodyStyles_unstable, useToastBodyBase_unstable, useToastBody_unstable, renderToastBody_unstable, toastBodyClassNames } from './ToastBody';
7
- export { ToastFooter, useToastFooterStyles_unstable, useToastFooter_unstable, renderToastFooter_unstable, toastFooterClassNames } from './ToastFooter';
8
- export { ToastContainerContextProvider, useToastContainerContext } from './contexts/toastContainerContext';
9
- export { toastContainerClassNames } from './ToastContainer';
10
- export { useToastContainer_unstable, renderToastContainer_unstable, useToastContainerContextValues_unstable } from './ToastContainer';
1
+ export { useToastController, useToaster } from "./state/index.js";
2
+ export { ToastTrigger, useToastTrigger_unstable, renderToastTrigger_unstable } from "./ToastTrigger.js";
3
+ export { Toaster, useToaster_unstable, useToasterStyles_unstable, renderToaster_unstable, toasterClassNames, useToastAnnounce } from "./Toaster.js";
4
+ export { Toast, useToastStyles_unstable, useToastBase_unstable, useToast_unstable, renderToast_unstable, toastClassNames } from "./Toast.js";
5
+ export { ToastTitle, useToastTitleStyles_unstable, useToastTitleBase_unstable, useToastTitle_unstable, renderToastTitle_unstable, toastTitleClassNames } from "./ToastTitle.js";
6
+ export { ToastBody, useToastBodyStyles_unstable, useToastBodyBase_unstable, useToastBody_unstable, renderToastBody_unstable, toastBodyClassNames } from "./ToastBody.js";
7
+ export { ToastFooter, useToastFooterStyles_unstable, useToastFooter_unstable, renderToastFooter_unstable, toastFooterClassNames } from "./ToastFooter.js";
8
+ export { ToastContainerContextProvider, useToastContainerContext } from "./contexts/toastContainerContext.js";
9
+ export { toastContainerClassNames } from "./ToastContainer.js";
10
+ export { useToastContainer_unstable, renderToastContainer_unstable, useToastContainerContextValues_unstable } from "./ToastContainer.js";
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { useToastController, useToaster } from './state';\nexport type {\n Announce as ToastAnnounce,\n AnnounceOptions as ToastAnnounceOptions,\n LiveMessage as ToastLiveMessage,\n} from './AriaLive';\nexport type {\n ToastPosition,\n ToastId,\n ToastOffset,\n ToastPoliteness,\n ToastStatus,\n ToastIntent,\n ToasterId,\n ToasterOptions,\n ToasterShortcuts,\n ToastImperativeRef,\n Toast as ToastData,\n ToastChangeData,\n ToastChangeHandler,\n ToastOptions,\n DispatchToastOptions as ToastDispatchOptions,\n UpdateToastOptions as ToastUpdateOptions,\n UpdateToastEventDetail as ToastUpdateEventDetail,\n} from './state';\n\nexport { ToastTrigger, useToastTrigger_unstable, renderToastTrigger_unstable } from './ToastTrigger';\nexport type { ToastTriggerChildProps, ToastTriggerProps, ToastTriggerState } from './ToastTrigger';\nexport {\n Toaster,\n useToaster_unstable,\n useToasterStyles_unstable,\n renderToaster_unstable,\n toasterClassNames,\n useToastAnnounce,\n} from './Toaster';\nexport type { ToasterProps, ToasterState, ToasterSlots } from './Toaster';\nexport {\n Toast,\n useToastStyles_unstable,\n useToastBase_unstable,\n useToast_unstable,\n renderToast_unstable,\n toastClassNames,\n} from './Toast';\nexport type { ToastBaseProps, ToastBaseState, ToastProps, ToastState, ToastSlots } from './Toast';\n\nexport {\n ToastTitle,\n useToastTitleStyles_unstable,\n useToastTitleBase_unstable,\n useToastTitle_unstable,\n renderToastTitle_unstable,\n toastTitleClassNames,\n} from './ToastTitle';\nexport type {\n ToastTitleBaseProps,\n ToastTitleBaseState,\n ToastTitleProps,\n ToastTitleState,\n ToastTitleSlots,\n} from './ToastTitle';\n\nexport {\n ToastBody,\n useToastBodyStyles_unstable,\n useToastBodyBase_unstable,\n useToastBody_unstable,\n renderToastBody_unstable,\n toastBodyClassNames,\n} from './ToastBody';\nexport type {\n ToastBodyBaseProps,\n ToastBodyBaseState,\n ToastBodyProps,\n ToastBodyState,\n ToastBodySlots,\n} from './ToastBody';\n\nexport {\n ToastFooter,\n useToastFooterStyles_unstable,\n useToastFooter_unstable,\n renderToastFooter_unstable,\n toastFooterClassNames,\n} from './ToastFooter';\nexport type { ToastFooterProps, ToastFooterState, ToastFooterSlots } from './ToastFooter';\n\nexport type { ToastContainerContextValue } from './contexts/toastContainerContext';\nexport { ToastContainerContextProvider, useToastContainerContext } from './contexts/toastContainerContext';\nexport { toastContainerClassNames } from './ToastContainer';\nexport type { ToastContainerSlots, ToastContainerProps, ToastContainerState } from './ToastContainer';\nexport {\n useToastContainer_unstable,\n renderToastContainer_unstable,\n useToastContainerContextValues_unstable,\n} from './ToastContainer';\n"],"names":["useToastController","useToaster","ToastTrigger","useToastTrigger_unstable","renderToastTrigger_unstable","Toaster","useToaster_unstable","useToasterStyles_unstable","renderToaster_unstable","toasterClassNames","useToastAnnounce","Toast","useToastStyles_unstable","useToastBase_unstable","useToast_unstable","renderToast_unstable","toastClassNames","ToastTitle","useToastTitleStyles_unstable","useToastTitleBase_unstable","useToastTitle_unstable","renderToastTitle_unstable","toastTitleClassNames","ToastBody","useToastBodyStyles_unstable","useToastBodyBase_unstable","useToastBody_unstable","renderToastBody_unstable","toastBodyClassNames","ToastFooter","useToastFooterStyles_unstable","useToastFooter_unstable","renderToastFooter_unstable","toastFooterClassNames","ToastContainerContextProvider","useToastContainerContext","toastContainerClassNames","useToastContainer_unstable","renderToastContainer_unstable","useToastContainerContextValues_unstable"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,UAAU,QAAQ,UAAU;AA0BzD,SAASC,YAAY,EAAEC,wBAAwB,EAAEC,2BAA2B,QAAQ,iBAAiB;AAErG,SACEC,OAAO,EACPC,mBAAmB,EACnBC,yBAAyB,EACzBC,sBAAsB,EACtBC,iBAAiB,EACjBC,gBAAgB,QACX,YAAY;AAEnB,SACEC,KAAK,EACLC,uBAAuB,EACvBC,qBAAqB,EACrBC,iBAAiB,EACjBC,oBAAoB,EACpBC,eAAe,QACV,UAAU;AAGjB,SACEC,UAAU,EACVC,4BAA4B,EAC5BC,0BAA0B,EAC1BC,sBAAsB,EACtBC,yBAAyB,EACzBC,oBAAoB,QACf,eAAe;AAStB,SACEC,SAAS,EACTC,2BAA2B,EAC3BC,yBAAyB,EACzBC,qBAAqB,EACrBC,wBAAwB,EACxBC,mBAAmB,QACd,cAAc;AASrB,SACEC,WAAW,EACXC,6BAA6B,EAC7BC,uBAAuB,EACvBC,0BAA0B,EAC1BC,qBAAqB,QAChB,gBAAgB;AAIvB,SAASC,6BAA6B,EAAEC,wBAAwB,QAAQ,mCAAmC;AAC3G,SAASC,wBAAwB,QAAQ,mBAAmB;AAE5D,SACEC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,uCAAuC,QAClC,mBAAmB"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { useToastController, useToaster } from './state';\nexport type {\n Announce as ToastAnnounce,\n AnnounceOptions as ToastAnnounceOptions,\n LiveMessage as ToastLiveMessage,\n} from './AriaLive';\nexport type {\n ToastPosition,\n ToastId,\n ToastOffset,\n ToastPoliteness,\n ToastStatus,\n ToastIntent,\n ToasterId,\n ToasterOptions,\n ToasterShortcuts,\n ToastImperativeRef,\n Toast as ToastData,\n ToastChangeData,\n ToastChangeHandler,\n ToastOptions,\n DispatchToastOptions as ToastDispatchOptions,\n UpdateToastOptions as ToastUpdateOptions,\n UpdateToastEventDetail as ToastUpdateEventDetail,\n} from './state';\n\nexport { ToastTrigger, useToastTrigger_unstable, renderToastTrigger_unstable } from './ToastTrigger';\nexport type { ToastTriggerChildProps, ToastTriggerProps, ToastTriggerState } from './ToastTrigger';\nexport {\n Toaster,\n useToaster_unstable,\n useToasterStyles_unstable,\n renderToaster_unstable,\n toasterClassNames,\n useToastAnnounce,\n} from './Toaster';\nexport type { ToasterProps, ToasterState, ToasterSlots } from './Toaster';\nexport {\n Toast,\n useToastStyles_unstable,\n useToastBase_unstable,\n useToast_unstable,\n renderToast_unstable,\n toastClassNames,\n} from './Toast';\nexport type { ToastBaseProps, ToastBaseState, ToastProps, ToastState, ToastSlots } from './Toast';\n\nexport {\n ToastTitle,\n useToastTitleStyles_unstable,\n useToastTitleBase_unstable,\n useToastTitle_unstable,\n renderToastTitle_unstable,\n toastTitleClassNames,\n} from './ToastTitle';\nexport type {\n ToastTitleBaseProps,\n ToastTitleBaseState,\n ToastTitleProps,\n ToastTitleState,\n ToastTitleSlots,\n} from './ToastTitle';\n\nexport {\n ToastBody,\n useToastBodyStyles_unstable,\n useToastBodyBase_unstable,\n useToastBody_unstable,\n renderToastBody_unstable,\n toastBodyClassNames,\n} from './ToastBody';\nexport type {\n ToastBodyBaseProps,\n ToastBodyBaseState,\n ToastBodyProps,\n ToastBodyState,\n ToastBodySlots,\n} from './ToastBody';\n\nexport {\n ToastFooter,\n useToastFooterStyles_unstable,\n useToastFooter_unstable,\n renderToastFooter_unstable,\n toastFooterClassNames,\n} from './ToastFooter';\nexport type { ToastFooterProps, ToastFooterState, ToastFooterSlots } from './ToastFooter';\n\nexport type { ToastContainerContextValue } from './contexts/toastContainerContext';\nexport { ToastContainerContextProvider, useToastContainerContext } from './contexts/toastContainerContext';\nexport { toastContainerClassNames } from './ToastContainer';\nexport type { ToastContainerSlots, ToastContainerProps, ToastContainerState } from './ToastContainer';\nexport {\n useToastContainer_unstable,\n renderToastContainer_unstable,\n useToastContainerContextValues_unstable,\n} from './ToastContainer';\n"],"names":["useToastController","useToaster","ToastTrigger","useToastTrigger_unstable","renderToastTrigger_unstable","Toaster","useToaster_unstable","useToasterStyles_unstable","renderToaster_unstable","toasterClassNames","useToastAnnounce","Toast","useToastStyles_unstable","useToastBase_unstable","useToast_unstable","renderToast_unstable","toastClassNames","ToastTitle","useToastTitleStyles_unstable","useToastTitleBase_unstable","useToastTitle_unstable","renderToastTitle_unstable","toastTitleClassNames","ToastBody","useToastBodyStyles_unstable","useToastBodyBase_unstable","useToastBody_unstable","renderToastBody_unstable","toastBodyClassNames","ToastFooter","useToastFooterStyles_unstable","useToastFooter_unstable","renderToastFooter_unstable","toastFooterClassNames","ToastContainerContextProvider","useToastContainerContext","toastContainerClassNames","useToastContainer_unstable","renderToastContainer_unstable","useToastContainerContextValues_unstable"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,UAAU,QAAQ,mBAAU;AA0BzD,SAASC,YAAY,EAAEC,wBAAwB,EAAEC,2BAA2B,QAAQ,oBAAiB;AAErG,SACEC,OAAO,EACPC,mBAAmB,EACnBC,yBAAyB,EACzBC,sBAAsB,EACtBC,iBAAiB,EACjBC,gBAAgB,QACX,eAAY;AAEnB,SACEC,KAAK,EACLC,uBAAuB,EACvBC,qBAAqB,EACrBC,iBAAiB,EACjBC,oBAAoB,EACpBC,eAAe,QACV,aAAU;AAGjB,SACEC,UAAU,EACVC,4BAA4B,EAC5BC,0BAA0B,EAC1BC,sBAAsB,EACtBC,yBAAyB,EACzBC,oBAAoB,QACf,kBAAe;AAStB,SACEC,SAAS,EACTC,2BAA2B,EAC3BC,yBAAyB,EACzBC,qBAAqB,EACrBC,wBAAwB,EACxBC,mBAAmB,QACd,iBAAc;AASrB,SACEC,WAAW,EACXC,6BAA6B,EAC7BC,uBAAuB,EACvBC,0BAA0B,EAC1BC,qBAAqB,QAChB,mBAAgB;AAIvB,SAASC,6BAA6B,EAAEC,wBAAwB,QAAQ,sCAAmC;AAC3G,SAASC,wBAAwB,QAAQ,sBAAmB;AAE5D,SACEC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,uCAAuC,QAClC,sBAAmB"}
@@ -1,4 +1,4 @@
1
- export { useToaster } from './useToaster';
2
- export { useToastController } from './useToastController';
3
- export { getPositionStyles } from './vanilla';
4
- export { TOAST_POSITIONS } from './constants';
1
+ export { useToaster } from "./useToaster.js";
2
+ export { useToastController } from "./useToastController.js";
3
+ export { getPositionStyles } from "./vanilla/index.js";
4
+ export { TOAST_POSITIONS } from "./constants.js";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/state/index.ts"],"sourcesContent":["export type {\n CommonToastDetail,\n DismissAllToastsEventDetail,\n DismissToastEventDetail,\n DispatchToastOptions,\n PauseToastEventDetail,\n PlayToastEventDetail,\n ShowToastEventDetail,\n Toast,\n ToastChangeData,\n ToastChangeHandler,\n ToastId,\n ToastImperativeRef,\n ToastIntent,\n ToastListenerMap,\n ToastOffset,\n ToastOffsetObject,\n ToastOptions,\n ToastPoliteness,\n ToastPosition,\n ToastStatus,\n ToasterId,\n ToasterOptions,\n ToasterShortcuts,\n UpdateToastEventDetail,\n UpdateToastOptions,\n} from './types';\nexport { useToaster } from './useToaster';\nexport { useToastController } from './useToastController';\nexport { getPositionStyles } from './vanilla';\nexport { TOAST_POSITIONS } from './constants';\n"],"names":["useToaster","useToastController","getPositionStyles","TOAST_POSITIONS"],"mappings":"AA2BA,SAASA,UAAU,QAAQ,eAAe;AAC1C,SAASC,kBAAkB,QAAQ,uBAAuB;AAC1D,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,eAAe,QAAQ,cAAc"}
1
+ {"version":3,"sources":["../src/state/index.ts"],"sourcesContent":["export type {\n CommonToastDetail,\n DismissAllToastsEventDetail,\n DismissToastEventDetail,\n DispatchToastOptions,\n PauseToastEventDetail,\n PlayToastEventDetail,\n ShowToastEventDetail,\n Toast,\n ToastChangeData,\n ToastChangeHandler,\n ToastId,\n ToastImperativeRef,\n ToastIntent,\n ToastListenerMap,\n ToastOffset,\n ToastOffsetObject,\n ToastOptions,\n ToastPoliteness,\n ToastPosition,\n ToastStatus,\n ToasterId,\n ToasterOptions,\n ToasterShortcuts,\n UpdateToastEventDetail,\n UpdateToastOptions,\n} from './types';\nexport { useToaster } from './useToaster';\nexport { useToastController } from './useToastController';\nexport { getPositionStyles } from './vanilla';\nexport { TOAST_POSITIONS } from './constants';\n"],"names":["useToaster","useToastController","getPositionStyles","TOAST_POSITIONS"],"mappings":"AA2BA,SAASA,UAAU,QAAQ,kBAAe;AAC1C,SAASC,kBAAkB,QAAQ,0BAAuB;AAC1D,SAASC,iBAAiB,QAAQ,qBAAY;AAC9C,SAASC,eAAe,QAAQ,iBAAc"}
@@ -1,7 +1,7 @@
1
1
  'use client';
2
- import * as React from 'react';
3
- import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';
4
- import { dispatchToast as dispatchToastVanilla, dismissToast as dismissToastVanilla, dismissAllToasts as dismissAllToastsVanilla, updateToast as updateToastVanilla, playToast as playToastVanilla, pauseToast as pauseToastVanilla } from './vanilla';
2
+ import * as React from "react";
3
+ import { useFluent_unstable as useFluent } from "@fluentui/react-shared-contexts";
4
+ import { dispatchToast as dispatchToastVanilla, dismissToast as dismissToastVanilla, dismissAllToasts as dismissAllToastsVanilla, updateToast as updateToastVanilla, playToast as playToastVanilla, pauseToast as pauseToastVanilla } from "./vanilla/index.js";
5
5
  const noop = ()=>undefined;
6
6
  /**
7
7
  * @param toasterId - If an id is provided all imperative methods control that specific toaster
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/state/useToastController.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport {\n dispatchToast as dispatchToastVanilla,\n dismissToast as dismissToastVanilla,\n dismissAllToasts as dismissAllToastsVanilla,\n updateToast as updateToastVanilla,\n playToast as playToastVanilla,\n pauseToast as pauseToastVanilla,\n} from './vanilla';\nimport type { DispatchToastOptions, ToastId, ToasterId, UpdateToastOptions } from './types';\n\nconst noop = () => undefined;\n\n/**\n * @param toasterId - If an id is provided all imperative methods control that specific toaster\n * @returns Imperative methods to control toasts\n */\nexport function useToastController(toasterId?: ToasterId): {\n dispatchToast: (content: React.ReactNode, options?: DispatchToastOptions) => void;\n dismissToast: (toastId: ToastId) => void;\n dismissAllToasts: () => void;\n updateToast: (options: UpdateToastOptions) => void;\n pauseToast: (toastId: ToastId) => void;\n playToast: (toastId: ToastId) => void;\n} {\n const { targetDocument } = useFluent();\n\n return React.useMemo(() => {\n if (!targetDocument) {\n return {\n dispatchToast: noop,\n dismissToast: noop,\n dismissAllToasts: noop,\n updateToast: noop,\n pauseToast: noop,\n playToast: noop,\n };\n }\n\n return {\n dispatchToast: (content: React.ReactNode, options?: DispatchToastOptions) => {\n dispatchToastVanilla(content, { ...options, toasterId, data: { root: options?.root } }, targetDocument);\n },\n dismissToast: (toastId: ToastId) => {\n dismissToastVanilla(toastId, toasterId, targetDocument);\n },\n dismissAllToasts: () => {\n dismissAllToastsVanilla(toasterId, targetDocument);\n },\n updateToast: (options: UpdateToastOptions) => {\n updateToastVanilla({ ...options, data: { root: options.root }, toasterId }, targetDocument);\n },\n pauseToast: (toastId: ToastId) => {\n pauseToastVanilla(toastId, toasterId, targetDocument);\n },\n playToast: (toastId: ToastId) => {\n playToastVanilla(toastId, toasterId, targetDocument);\n },\n };\n }, [targetDocument, toasterId]);\n}\n"],"names":["React","useFluent_unstable","useFluent","dispatchToast","dispatchToastVanilla","dismissToast","dismissToastVanilla","dismissAllToasts","dismissAllToastsVanilla","updateToast","updateToastVanilla","playToast","playToastVanilla","pauseToast","pauseToastVanilla","noop","undefined","useToastController","toasterId","targetDocument","useMemo","content","options","data","root","toastId"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SACEC,iBAAiBC,oBAAoB,EACrCC,gBAAgBC,mBAAmB,EACnCC,oBAAoBC,uBAAuB,EAC3CC,eAAeC,kBAAkB,EACjCC,aAAaC,gBAAgB,EAC7BC,cAAcC,iBAAiB,QAC1B,YAAY;AAGnB,MAAMC,OAAO,IAAMC;AAEnB;;;CAGC,GACD,OAAO,SAASC,mBAAmBC,SAAqB;IAQtD,MAAM,EAAEC,cAAc,EAAE,GAAGjB;IAE3B,OAAOF,MAAMoB,OAAO,CAAC;QACnB,IAAI,CAACD,gBAAgB;YACnB,OAAO;gBACLhB,eAAeY;gBACfV,cAAcU;gBACdR,kBAAkBQ;gBAClBN,aAAaM;gBACbF,YAAYE;gBACZJ,WAAWI;YACb;QACF;QAEA,OAAO;YACLZ,eAAe,CAACkB,SAA0BC;gBACxClB,qBAAqBiB,SAAS;oBAAE,GAAGC,OAAO;oBAAEJ;oBAAWK,MAAM;wBAAEC,IAAI,EAAEF,oBAAAA,8BAAAA,QAASE,IAAI;oBAAC;gBAAE,GAAGL;YAC1F;YACAd,cAAc,CAACoB;gBACbnB,oBAAoBmB,SAASP,WAAWC;YAC1C;YACAZ,kBAAkB;gBAChBC,wBAAwBU,WAAWC;YACrC;YACAV,aAAa,CAACa;gBACZZ,mBAAmB;oBAAE,GAAGY,OAAO;oBAAEC,MAAM;wBAAEC,MAAMF,QAAQE,IAAI;oBAAC;oBAAGN;gBAAU,GAAGC;YAC9E;YACAN,YAAY,CAACY;gBACXX,kBAAkBW,SAASP,WAAWC;YACxC;YACAR,WAAW,CAACc;gBACVb,iBAAiBa,SAASP,WAAWC;YACvC;QACF;IACF,GAAG;QAACA;QAAgBD;KAAU;AAChC"}
1
+ {"version":3,"sources":["../src/state/useToastController.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport {\n dispatchToast as dispatchToastVanilla,\n dismissToast as dismissToastVanilla,\n dismissAllToasts as dismissAllToastsVanilla,\n updateToast as updateToastVanilla,\n playToast as playToastVanilla,\n pauseToast as pauseToastVanilla,\n} from './vanilla';\nimport type { DispatchToastOptions, ToastId, ToasterId, UpdateToastOptions } from './types';\n\nconst noop = () => undefined;\n\n/**\n * @param toasterId - If an id is provided all imperative methods control that specific toaster\n * @returns Imperative methods to control toasts\n */\nexport function useToastController(toasterId?: ToasterId): {\n dispatchToast: (content: React.ReactNode, options?: DispatchToastOptions) => void;\n dismissToast: (toastId: ToastId) => void;\n dismissAllToasts: () => void;\n updateToast: (options: UpdateToastOptions) => void;\n pauseToast: (toastId: ToastId) => void;\n playToast: (toastId: ToastId) => void;\n} {\n const { targetDocument } = useFluent();\n\n return React.useMemo(() => {\n if (!targetDocument) {\n return {\n dispatchToast: noop,\n dismissToast: noop,\n dismissAllToasts: noop,\n updateToast: noop,\n pauseToast: noop,\n playToast: noop,\n };\n }\n\n return {\n dispatchToast: (content: React.ReactNode, options?: DispatchToastOptions) => {\n dispatchToastVanilla(content, { ...options, toasterId, data: { root: options?.root } }, targetDocument);\n },\n dismissToast: (toastId: ToastId) => {\n dismissToastVanilla(toastId, toasterId, targetDocument);\n },\n dismissAllToasts: () => {\n dismissAllToastsVanilla(toasterId, targetDocument);\n },\n updateToast: (options: UpdateToastOptions) => {\n updateToastVanilla({ ...options, data: { root: options.root }, toasterId }, targetDocument);\n },\n pauseToast: (toastId: ToastId) => {\n pauseToastVanilla(toastId, toasterId, targetDocument);\n },\n playToast: (toastId: ToastId) => {\n playToastVanilla(toastId, toasterId, targetDocument);\n },\n };\n }, [targetDocument, toasterId]);\n}\n"],"names":["React","useFluent_unstable","useFluent","dispatchToast","dispatchToastVanilla","dismissToast","dismissToastVanilla","dismissAllToasts","dismissAllToastsVanilla","updateToast","updateToastVanilla","playToast","playToastVanilla","pauseToast","pauseToastVanilla","noop","undefined","useToastController","toasterId","targetDocument","useMemo","content","options","data","root","toastId"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SACEC,iBAAiBC,oBAAoB,EACrCC,gBAAgBC,mBAAmB,EACnCC,oBAAoBC,uBAAuB,EAC3CC,eAAeC,kBAAkB,EACjCC,aAAaC,gBAAgB,EAC7BC,cAAcC,iBAAiB,QAC1B,qBAAY;AAGnB,MAAMC,OAAO,IAAMC;AAEnB;;;CAGC,GACD,OAAO,SAASC,mBAAmBC,SAAqB;IAQtD,MAAM,EAAEC,cAAc,EAAE,GAAGjB;IAE3B,OAAOF,MAAMoB,OAAO,CAAC;QACnB,IAAI,CAACD,gBAAgB;YACnB,OAAO;gBACLhB,eAAeY;gBACfV,cAAcU;gBACdR,kBAAkBQ;gBAClBN,aAAaM;gBACbF,YAAYE;gBACZJ,WAAWI;YACb;QACF;QAEA,OAAO;YACLZ,eAAe,CAACkB,SAA0BC;gBACxClB,qBAAqBiB,SAAS;oBAAE,GAAGC,OAAO;oBAAEJ;oBAAWK,MAAM;wBAAEC,IAAI,EAAEF,oBAAAA,8BAAAA,QAASE,IAAI;oBAAC;gBAAE,GAAGL;YAC1F;YACAd,cAAc,CAACoB;gBACbnB,oBAAoBmB,SAASP,WAAWC;YAC1C;YACAZ,kBAAkB;gBAChBC,wBAAwBU,WAAWC;YACrC;YACAV,aAAa,CAACa;gBACZZ,mBAAmB;oBAAE,GAAGY,OAAO;oBAAEC,MAAM;wBAAEC,MAAMF,QAAQE,IAAI;oBAAC;oBAAGN;gBAAU,GAAGC;YAC9E;YACAN,YAAY,CAACY;gBACXX,kBAAkBW,SAASP,WAAWC;YACxC;YACAR,WAAW,CAACc;gBACVb,iBAAiBa,SAASP,WAAWC;YACvC;QACF;IACF,GAAG;QAACA;QAAgBD;KAAU;AAChC"}
@@ -1,9 +1,9 @@
1
1
  'use client';
2
- import * as React from 'react';
3
- import { isHTMLElement, useEventCallback, useForceUpdate } from '@fluentui/react-utilities';
4
- import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';
5
- import { createToaster } from './vanilla';
6
- import { EVENTS } from './constants';
2
+ import * as React from "react";
3
+ import { isHTMLElement, useEventCallback, useForceUpdate } from "@fluentui/react-utilities";
4
+ import { useFluent_unstable as useFluent } from "@fluentui/react-shared-contexts";
5
+ import { createToaster } from "./vanilla/index.js";
6
+ import { EVENTS } from "./constants.js";
7
7
  export function useToaster(options = {}) {
8
8
  const forceUpdate = useForceUpdate();
9
9
  const { toasterId: userToasterId, shortcuts } = options;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/state/useToaster.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { isHTMLElement, useEventCallback, useForceUpdate } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { createToaster } from './vanilla';\nimport type {\n CommonToastDetail,\n ShowToastEventDetail,\n Toast,\n ToastId,\n ToastListenerMap,\n ToastPosition,\n ToasterId,\n ToasterOptions,\n} from './types';\nimport { EVENTS } from './constants';\n\nexport function useToaster<TElement extends HTMLElement = HTMLDivElement>(\n options: Partial<ToasterOptions> = {},\n): {\n isToastVisible: (toastId: ToastId) => boolean;\n toastsToRender: Map<ToastPosition, Toast[]>;\n pauseAllToasts: () => void;\n playAllToasts: () => void;\n tryRestoreFocus: () => void;\n closeAllToasts: () => void;\n} {\n const forceUpdate = useForceUpdate();\n const { toasterId: userToasterId, shortcuts } = options;\n // Currently the toaster options can never be changed at runtime\n const [toaster] = React.useState(() => createToaster(options));\n const { targetDocument } = useFluent();\n\n const lastActiveElementRef = React.useRef<HTMLElement | null>(null);\n\n const isCorrectToaster = useEventCallback((toasterId: ToasterId | undefined) => {\n return toasterId === userToasterId;\n });\n\n const isFocusShortcut = useEventCallback((e: KeyboardEvent) => {\n if (shortcuts?.focus) {\n return shortcuts.focus(e);\n }\n });\n\n const pauseAllToasts = React.useCallback(() => {\n toaster.visibleToasts.forEach(toastId => {\n const toast = toaster.toasts.get(toastId);\n toast?.imperativeRef.current?.pause();\n });\n }, [toaster]);\n\n const playAllToasts = React.useCallback(() => {\n toaster.visibleToasts.forEach(toastId => {\n const toast = toaster.toasts.get(toastId);\n toast?.imperativeRef.current?.play();\n });\n }, [toaster]);\n\n const getMostRecentVisibleToast = React.useCallback(() => {\n return Array.from(toaster.visibleToasts).reduce((cur, next) => {\n const toast = toaster.toasts.get(next);\n if (!toast) {\n return cur;\n }\n\n if (!cur) {\n return toast;\n }\n\n if (cur.order < toast?.order) {\n return toast;\n }\n\n return cur;\n }, undefined as Toast | undefined);\n }, [toaster]);\n\n const tryRestoreFocus = React.useCallback(() => {\n const mostRecentToast = getMostRecentVisibleToast();\n if (mostRecentToast?.imperativeRef.current) {\n mostRecentToast.imperativeRef.current.focus();\n } else {\n lastActiveElementRef.current?.focus();\n lastActiveElementRef.current = null;\n }\n }, [getMostRecentVisibleToast]);\n\n const closeAllToasts = React.useCallback(() => {\n toaster.visibleToasts.forEach(toastId => {\n const toast = toaster.toasts.get(toastId);\n toast?.close();\n });\n\n tryRestoreFocus();\n }, [toaster, tryRestoreFocus]);\n\n React.useEffect(() => {\n if (!targetDocument) {\n return;\n }\n\n const addToastListener = <TType extends keyof ToastListenerMap>(\n eventType: TType,\n callback: ToastListenerMap[TType],\n ) => {\n const listener: ToastListenerMap[TType] = (e: CustomEvent<CommonToastDetail>) => {\n if (!isCorrectToaster(e.detail.toasterId)) {\n return;\n }\n\n callback(e as CustomEvent<ShowToastEventDetail>);\n forceUpdate();\n };\n\n targetDocument.addEventListener(eventType, listener as () => void);\n return () => targetDocument.removeEventListener(eventType, listener as () => void);\n };\n\n const buildToast: ToastListenerMap[typeof EVENTS.show] = e => {\n toaster.buildToast(e.detail, forceUpdate);\n };\n\n const dismissToast: ToastListenerMap[typeof EVENTS.dismiss] = e => {\n toaster.dismissToast(e.detail.toastId);\n };\n\n const updateToast: ToastListenerMap[typeof EVENTS.update] = e => {\n toaster.updateToast(e.detail);\n };\n\n const dismissAllToasts: ToastListenerMap[typeof EVENTS.dismissAll] = e => {\n toaster.dismissAllToasts();\n };\n\n const pauseToast: ToastListenerMap[typeof EVENTS.pause] = e => {\n const toast = toaster.toasts.get(e.detail.toastId);\n if (toast) {\n toast.imperativeRef.current?.pause();\n }\n };\n\n const playToast: ToastListenerMap[typeof EVENTS.play] = e => {\n const toast = toaster.toasts.get(e.detail.toastId);\n if (toast) {\n toast.imperativeRef.current?.play();\n }\n };\n\n const cleanupBuildListener = addToastListener(EVENTS.show, buildToast);\n const cleanupUpdateListener = addToastListener(EVENTS.update, updateToast);\n const cleanupDismissListener = addToastListener(EVENTS.dismiss, dismissToast);\n const cleanupDismissAllListener = addToastListener(EVENTS.dismissAll, dismissAllToasts);\n const cleanupPauseListener = addToastListener(EVENTS.pause, pauseToast);\n const cleanupPlayListener = addToastListener(EVENTS.play, playToast);\n\n const focusShortcutListener = (e: KeyboardEvent) => {\n if (isFocusShortcut(e)) {\n pauseAllToasts();\n const mostRecentToast = getMostRecentVisibleToast();\n\n if (mostRecentToast) {\n lastActiveElementRef.current = isHTMLElement(targetDocument.activeElement)\n ? targetDocument.activeElement\n : null;\n mostRecentToast.imperativeRef.current?.focus();\n }\n }\n };\n\n targetDocument.addEventListener('keydown', focusShortcutListener);\n\n return () => {\n cleanupBuildListener();\n cleanupDismissAllListener();\n cleanupUpdateListener();\n cleanupDismissListener();\n cleanupPauseListener();\n cleanupPlayListener();\n\n targetDocument.removeEventListener('keydown', focusShortcutListener);\n };\n }, [\n toaster,\n forceUpdate,\n targetDocument,\n isCorrectToaster,\n pauseAllToasts,\n getMostRecentVisibleToast,\n isFocusShortcut,\n ]);\n\n const toastsToRender = (() => {\n if (!toaster) {\n return new Map<ToastPosition, Toast[]>();\n }\n\n const toRender = new Map<ToastPosition, Toast[]>();\n const toasts = Array.from(toaster.toasts.values());\n\n toasts.forEach(toast => {\n const { position } = toast;\n toRender.has(position) || toRender.set(position, []);\n if (position.startsWith('bottom')) {\n toRender.get(position)!.push(toast);\n } else {\n toRender.get(position)!.unshift(toast);\n }\n });\n\n return toRender;\n })();\n\n return {\n isToastVisible: toaster.isToastVisible,\n toastsToRender,\n pauseAllToasts,\n playAllToasts,\n tryRestoreFocus,\n closeAllToasts,\n };\n}\n"],"names":["React","isHTMLElement","useEventCallback","useForceUpdate","useFluent_unstable","useFluent","createToaster","EVENTS","useToaster","options","forceUpdate","toasterId","userToasterId","shortcuts","toaster","useState","targetDocument","lastActiveElementRef","useRef","isCorrectToaster","isFocusShortcut","e","focus","pauseAllToasts","useCallback","visibleToasts","forEach","toastId","toast","toasts","get","imperativeRef","current","pause","playAllToasts","play","getMostRecentVisibleToast","Array","from","reduce","cur","next","order","undefined","tryRestoreFocus","mostRecentToast","closeAllToasts","close","useEffect","addToastListener","eventType","callback","listener","detail","addEventListener","removeEventListener","buildToast","dismissToast","updateToast","dismissAllToasts","pauseToast","playToast","cleanupBuildListener","show","cleanupUpdateListener","update","cleanupDismissListener","dismiss","cleanupDismissAllListener","dismissAll","cleanupPauseListener","cleanupPlayListener","focusShortcutListener","activeElement","toastsToRender","Map","toRender","values","position","has","set","startsWith","push","unshift","isToastVisible"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,aAAa,EAAEC,gBAAgB,EAAEC,cAAc,QAAQ,4BAA4B;AAC5F,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,aAAa,QAAQ,YAAY;AAW1C,SAASC,MAAM,QAAQ,cAAc;AAErC,OAAO,SAASC,WACdC,UAAmC,CAAC,CAAC;IASrC,MAAMC,cAAcP;I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C;YACF;QACF;QAEAN,eAAesC,gBAAgB,CAAC,WAAWkB;QAE3C,OAAO;YACLV;YACAM;YACAJ;YACAE;YACAI;YACAC;YAEAvD,eAAeuC,mBAAmB,CAAC,WAAWiB;QAChD;IACF,GAAG;QACD1D;QACAJ;QACAM;QACAG;QACAI;QACAa;QACAhB;KACD;IAED,MAAMsD,iBAAiB,AAAC,CAAA;QACtB,IAAI,CAAC5D,SAAS;YACZ,OAAO,IAAI6D;QACb;QAEA,MAAMC,WAAW,IAAID;QACrB,MAAM9C,SAASQ,MAAMC,IAAI,CAACxB,QAAQe,MAAM,CAACgD,MAAM;QAE/ChD,OAAOH,OAAO,CAACE,CAAAA;YACb,MAAM,EAAEkD,QAAQ,EAAE,GAAGlD;YACrBgD,SAASG,GAAG,CAACD,aAAaF,SAASI,GAAG,CAACF,UAAU,EAAE;YACnD,IAAIA,SAASG,UAAU,CAAC,WAAW;gBACjCL,SAAS9C,GAAG,CAACgD,UAAWI,IAAI,CAACtD;YAC/B,OAAO;gBACLgD,SAAS9C,GAAG,CAACgD,UAAWK,OAAO,CAACvD;YAClC;QACF;QAEA,OAAOgD;IACT,CAAA;IAEA,OAAO;QACLQ,gBAAgBtE,QAAQsE,cAAc;QACtCV;QACAnD;QACAW;QACAU;QACAE;IACF;AACF"}
1
+ {"version":3,"sources":["../src/state/useToaster.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { isHTMLElement, useEventCallback, useForceUpdate } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { createToaster } from './vanilla';\nimport type {\n CommonToastDetail,\n ShowToastEventDetail,\n Toast,\n ToastId,\n ToastListenerMap,\n ToastPosition,\n ToasterId,\n ToasterOptions,\n} from './types';\nimport { EVENTS } from './constants';\n\nexport function useToaster<TElement extends HTMLElement = HTMLDivElement>(\n options: Partial<ToasterOptions> = {},\n): {\n isToastVisible: (toastId: ToastId) => boolean;\n toastsToRender: Map<ToastPosition, Toast[]>;\n pauseAllToasts: () => void;\n playAllToasts: () => void;\n tryRestoreFocus: () => void;\n closeAllToasts: () => void;\n} {\n const forceUpdate = useForceUpdate();\n const { toasterId: userToasterId, shortcuts } = options;\n // Currently the toaster options can never be changed at runtime\n const [toaster] = React.useState(() => createToaster(options));\n const { targetDocument } = useFluent();\n\n const lastActiveElementRef = React.useRef<HTMLElement | null>(null);\n\n const isCorrectToaster = useEventCallback((toasterId: ToasterId | undefined) => {\n return toasterId === userToasterId;\n });\n\n const isFocusShortcut = useEventCallback((e: KeyboardEvent) => {\n if (shortcuts?.focus) {\n return shortcuts.focus(e);\n }\n });\n\n const pauseAllToasts = React.useCallback(() => {\n toaster.visibleToasts.forEach(toastId => {\n const toast = toaster.toasts.get(toastId);\n toast?.imperativeRef.current?.pause();\n });\n }, [toaster]);\n\n const playAllToasts = React.useCallback(() => {\n toaster.visibleToasts.forEach(toastId => {\n const toast = toaster.toasts.get(toastId);\n toast?.imperativeRef.current?.play();\n });\n }, [toaster]);\n\n const getMostRecentVisibleToast = React.useCallback(() => {\n return Array.from(toaster.visibleToasts).reduce((cur, next) => {\n const toast = toaster.toasts.get(next);\n if (!toast) {\n return cur;\n }\n\n if (!cur) {\n return toast;\n }\n\n if (cur.order < toast?.order) {\n return toast;\n }\n\n return cur;\n }, undefined as Toast | undefined);\n }, [toaster]);\n\n const tryRestoreFocus = React.useCallback(() => {\n const mostRecentToast = getMostRecentVisibleToast();\n if (mostRecentToast?.imperativeRef.current) {\n mostRecentToast.imperativeRef.current.focus();\n } else {\n lastActiveElementRef.current?.focus();\n lastActiveElementRef.current = null;\n }\n }, [getMostRecentVisibleToast]);\n\n const closeAllToasts = React.useCallback(() => {\n toaster.visibleToasts.forEach(toastId => {\n const toast = toaster.toasts.get(toastId);\n toast?.close();\n });\n\n tryRestoreFocus();\n }, [toaster, tryRestoreFocus]);\n\n React.useEffect(() => {\n if (!targetDocument) {\n return;\n }\n\n const addToastListener = <TType extends keyof ToastListenerMap>(\n eventType: TType,\n callback: ToastListenerMap[TType],\n ) => {\n const listener: ToastListenerMap[TType] = (e: CustomEvent<CommonToastDetail>) => {\n if (!isCorrectToaster(e.detail.toasterId)) {\n return;\n }\n\n callback(e as CustomEvent<ShowToastEventDetail>);\n forceUpdate();\n };\n\n targetDocument.addEventListener(eventType, listener as () => void);\n return () => targetDocument.removeEventListener(eventType, listener as () => void);\n };\n\n const buildToast: ToastListenerMap[typeof EVENTS.show] = e => {\n toaster.buildToast(e.detail, forceUpdate);\n };\n\n const dismissToast: ToastListenerMap[typeof EVENTS.dismiss] = e => {\n toaster.dismissToast(e.detail.toastId);\n };\n\n const updateToast: ToastListenerMap[typeof EVENTS.update] = e => {\n toaster.updateToast(e.detail);\n };\n\n const dismissAllToasts: ToastListenerMap[typeof EVENTS.dismissAll] = e => {\n toaster.dismissAllToasts();\n };\n\n const pauseToast: ToastListenerMap[typeof EVENTS.pause] = e => {\n const toast = toaster.toasts.get(e.detail.toastId);\n if (toast) {\n toast.imperativeRef.current?.pause();\n }\n };\n\n const playToast: ToastListenerMap[typeof EVENTS.play] = e => {\n const toast = toaster.toasts.get(e.detail.toastId);\n if (toast) {\n toast.imperativeRef.current?.play();\n }\n };\n\n const cleanupBuildListener = addToastListener(EVENTS.show, buildToast);\n const cleanupUpdateListener = addToastListener(EVENTS.update, updateToast);\n const cleanupDismissListener = addToastListener(EVENTS.dismiss, dismissToast);\n const cleanupDismissAllListener = addToastListener(EVENTS.dismissAll, dismissAllToasts);\n const cleanupPauseListener = addToastListener(EVENTS.pause, pauseToast);\n const cleanupPlayListener = addToastListener(EVENTS.play, playToast);\n\n const focusShortcutListener = (e: KeyboardEvent) => {\n if (isFocusShortcut(e)) {\n pauseAllToasts();\n const mostRecentToast = getMostRecentVisibleToast();\n\n if (mostRecentToast) {\n lastActiveElementRef.current = isHTMLElement(targetDocument.activeElement)\n ? targetDocument.activeElement\n : null;\n mostRecentToast.imperativeRef.current?.focus();\n }\n }\n };\n\n targetDocument.addEventListener('keydown', focusShortcutListener);\n\n return () => {\n cleanupBuildListener();\n cleanupDismissAllListener();\n cleanupUpdateListener();\n cleanupDismissListener();\n cleanupPauseListener();\n cleanupPlayListener();\n\n targetDocument.removeEventListener('keydown', focusShortcutListener);\n };\n }, [\n toaster,\n forceUpdate,\n targetDocument,\n isCorrectToaster,\n pauseAllToasts,\n getMostRecentVisibleToast,\n isFocusShortcut,\n ]);\n\n const toastsToRender = (() => {\n if (!toaster) {\n return new Map<ToastPosition, Toast[]>();\n }\n\n const toRender = new Map<ToastPosition, Toast[]>();\n const toasts = Array.from(toaster.toasts.values());\n\n toasts.forEach(toast => {\n const { position } = toast;\n toRender.has(position) || toRender.set(position, []);\n if (position.startsWith('bottom')) {\n toRender.get(position)!.push(toast);\n } else {\n toRender.get(position)!.unshift(toast);\n }\n });\n\n return toRender;\n })();\n\n return {\n isToastVisible: toaster.isToastVisible,\n toastsToRender,\n pauseAllToasts,\n playAllToasts,\n tryRestoreFocus,\n closeAllToasts,\n };\n}\n"],"names":["React","isHTMLElement","useEventCallback","useForceUpdate","useFluent_unstable","useFluent","createToaster","EVENTS","useToaster","options","forceUpdate","toasterId","userToasterId","shortcuts","toaster","useState","targetDocument","lastActiveElementRef","useRef","isCorrectToaster","isFocusShortcut","e","focus","pauseAllToasts","useCallback","visibleToasts","forEach","toastId","toast","toasts","get","imperativeRef","current","pause","playAllToasts","play","getMostRecentVisibleToast","Array","from","reduce","cur","next","order","undefined","tryRestoreFocus","mostRecentToast","closeAllToasts","close","useEffect","addToastListener","eventType","callback","listener","detail","addEventListener","removeEventListener","buildToast","dismissToast","updateToast","dismissAllToasts","pauseToast","playToast","cleanupBuildListener","show","cleanupUpdateListener","update","cleanupDismissListener","dismiss","cleanupDismissAllListener","dismissAll","cleanupPauseListener","cleanupPlayListener","focusShortcutListener","activeElement","toastsToRender","Map","toRender","values","position","has","set","startsWith","push","unshift","isToastVisible"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,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E;gBACA,MAAMsB,kBAAkBT;gBAExB,IAAIS,iBAAiB;wBAInBA;oBAHA5B,qBAAqBe,OAAO,GAAG/B,cAAce,eAAeyD,aAAa,IACrEzD,eAAeyD,aAAa,GAC5B;qBACJ5B,yCAAAA,gBAAgBd,aAAa,CAACC,OAAO,cAArCa,6DAAAA,uCAAuCvB,KAAK;gBAC9C;YACF;QACF;QAEAN,eAAesC,gBAAgB,CAAC,WAAWkB;QAE3C,OAAO;YACLV;YACAM;YACAJ;YACAE;YACAI;YACAC;YAEAvD,eAAeuC,mBAAmB,CAAC,WAAWiB;QAChD;IACF,GAAG;QACD1D;QACAJ;QACAM;QACAG;QACAI;QACAa;QACAhB;KACD;IAED,MAAMsD,iBAAiB,AAAC,CAAA;QACtB,IAAI,CAAC5D,SAAS;YACZ,OAAO,IAAI6D;QACb;QAEA,MAAMC,WAAW,IAAID;QACrB,MAAM9C,SAASQ,MAAMC,IAAI,CAACxB,QAAQe,MAAM,CAACgD,MAAM;QAE/ChD,OAAOH,OAAO,CAACE,CAAAA;YACb,MAAM,EAAEkD,QAAQ,EAAE,GAAGlD;YACrBgD,SAASG,GAAG,CAACD,aAAaF,SAASI,GAAG,CAACF,UAAU,EAAE;YACnD,IAAIA,SAASG,UAAU,CAAC,WAAW;gBACjCL,SAAS9C,GAAG,CAACgD,UAAWI,IAAI,CAACtD;YAC/B,OAAO;gBACLgD,SAAS9C,GAAG,CAACgD,UAAWK,OAAO,CAACvD;YAClC;QACF;QAEA,OAAOgD;IACT,CAAA;IAEA,OAAO;QACLQ,gBAAgBtE,QAAQsE,cAAc;QACtCV;QACAnD;QACAW;QACAU;QACAE;IACF;AACF"}
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
- import { createPriorityQueue } from '@fluentui/react-utilities';
1
+ import * as React from "react";
2
+ import { createPriorityQueue } from "@fluentui/react-utilities";
3
3
  function assignDefined(a, b) {
4
4
  // This cast is required, as Object.entries will return string as key which is not indexable
5
5
  for (const [key, prop] of Object.entries(b)){
@@ -1,4 +1,4 @@
1
- import { EVENTS } from '../constants';
1
+ import { EVENTS } from "../constants.js";
2
2
  export function dismissAllToasts(toasterId = undefined, targetDocument) {
3
3
  const event = new CustomEvent(EVENTS.dismissAll, {
4
4
  bubbles: false,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/state/vanilla/dismissAllToasts.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport type { DismissAllToastsEventDetail, ToasterId } from '../types';\n\nexport function dismissAllToasts(toasterId: ToasterId | undefined = undefined, targetDocument: Document): void {\n const event = new CustomEvent<DismissAllToastsEventDetail>(EVENTS.dismissAll, {\n bubbles: false,\n cancelable: false,\n detail: { toasterId },\n });\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","dismissAllToasts","toasterId","undefined","targetDocument","event","CustomEvent","dismissAll","bubbles","cancelable","detail","dispatchEvent"],"mappings":"AAAA,SAASA,MAAM,QAAQ,eAAe;AAGtC,OAAO,SAASC,iBAAiBC,YAAmCC,SAAS,EAAEC,cAAwB;IACrG,MAAMC,QAAQ,IAAIC,YAAyCN,OAAOO,UAAU,EAAE;QAC5EC,SAAS;QACTC,YAAY;QACZC,QAAQ;YAAER;QAAU;IACtB;IACAE,eAAeO,aAAa,CAACN;AAC/B"}
1
+ {"version":3,"sources":["../src/state/vanilla/dismissAllToasts.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport type { DismissAllToastsEventDetail, ToasterId } from '../types';\n\nexport function dismissAllToasts(toasterId: ToasterId | undefined = undefined, targetDocument: Document): void {\n const event = new CustomEvent<DismissAllToastsEventDetail>(EVENTS.dismissAll, {\n bubbles: false,\n cancelable: false,\n detail: { toasterId },\n });\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","dismissAllToasts","toasterId","undefined","targetDocument","event","CustomEvent","dismissAll","bubbles","cancelable","detail","dispatchEvent"],"mappings":"AAAA,SAASA,MAAM,QAAQ,kBAAe;AAGtC,OAAO,SAASC,iBAAiBC,YAAmCC,SAAS,EAAEC,cAAwB;IACrG,MAAMC,QAAQ,IAAIC,YAAyCN,OAAOO,UAAU,EAAE;QAC5EC,SAAS;QACTC,YAAY;QACZC,QAAQ;YAAER;QAAU;IACtB;IACAE,eAAeO,aAAa,CAACN;AAC/B"}
@@ -1,4 +1,4 @@
1
- import { EVENTS } from '../constants';
1
+ import { EVENTS } from "../constants.js";
2
2
  export function dismissToast(toastId, toasterId = undefined, targetDocument) {
3
3
  const event = new CustomEvent(EVENTS.dismiss, {
4
4
  bubbles: false,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/state/vanilla/dismissToast.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport type { DismissToastEventDetail, ToastId, ToasterId } from '../types';\n\nexport function dismissToast(\n toastId: ToastId,\n toasterId: ToasterId | undefined = undefined,\n targetDocument: Document,\n): void {\n const event = new CustomEvent<DismissToastEventDetail>(EVENTS.dismiss, {\n bubbles: false,\n cancelable: false,\n detail: { toastId, toasterId },\n });\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","dismissToast","toastId","toasterId","undefined","targetDocument","event","CustomEvent","dismiss","bubbles","cancelable","detail","dispatchEvent"],"mappings":"AAAA,SAASA,MAAM,QAAQ,eAAe;AAGtC,OAAO,SAASC,aACdC,OAAgB,EAChBC,YAAmCC,SAAS,EAC5CC,cAAwB;IAExB,MAAMC,QAAQ,IAAIC,YAAqCP,OAAOQ,OAAO,EAAE;QACrEC,SAAS;QACTC,YAAY;QACZC,QAAQ;YAAET;YAASC;QAAU;IAC/B;IACAE,eAAeO,aAAa,CAACN;AAC/B"}
1
+ {"version":3,"sources":["../src/state/vanilla/dismissToast.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport type { DismissToastEventDetail, ToastId, ToasterId } from '../types';\n\nexport function dismissToast(\n toastId: ToastId,\n toasterId: ToasterId | undefined = undefined,\n targetDocument: Document,\n): void {\n const event = new CustomEvent<DismissToastEventDetail>(EVENTS.dismiss, {\n bubbles: false,\n cancelable: false,\n detail: { toastId, toasterId },\n });\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","dismissToast","toastId","toasterId","undefined","targetDocument","event","CustomEvent","dismiss","bubbles","cancelable","detail","dispatchEvent"],"mappings":"AAAA,SAASA,MAAM,QAAQ,kBAAe;AAGtC,OAAO,SAASC,aACdC,OAAgB,EAChBC,YAAmCC,SAAS,EAC5CC,cAAwB;IAExB,MAAMC,QAAQ,IAAIC,YAAqCP,OAAOQ,OAAO,EAAE;QACrEC,SAAS;QACTC,YAAY;QACZC,QAAQ;YAAET;YAASC;QAAU;IAC/B;IACAE,eAAeO,aAAa,CAACN;AAC/B"}
@@ -1,4 +1,4 @@
1
- import { EVENTS } from '../constants';
1
+ import { EVENTS } from "../constants.js";
2
2
  let counter = 0;
3
3
  export function dispatchToast(content, options = {}, targetDocument) {
4
4
  var _options_toastId;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/state/vanilla/dispatchToast.ts"],"sourcesContent":["import type { ShowToastEventDetail, ToastOptions } from '../types';\nimport { EVENTS } from '../constants';\n\nlet counter = 0;\n\nexport function dispatchToast(content: unknown, options: Partial<ToastOptions> = {}, targetDocument: Document): void {\n const detail: ShowToastEventDetail = {\n ...options,\n content,\n toastId: options.toastId ?? (counter++).toString(),\n };\n const event = new CustomEvent<ShowToastEventDetail>(EVENTS.show, {\n bubbles: false,\n cancelable: false,\n detail,\n });\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","counter","dispatchToast","content","options","targetDocument","detail","toastId","toString","event","CustomEvent","show","bubbles","cancelable","dispatchEvent"],"mappings":"AACA,SAASA,MAAM,QAAQ,eAAe;AAEtC,IAAIC,UAAU;AAEd,OAAO,SAASC,cAAcC,OAAgB,EAAEC,UAAiC,CAAC,CAAC,EAAEC,cAAwB;QAIhGD;IAHX,MAAME,SAA+B;QACnC,GAAGF,OAAO;QACVD;QACAI,SAASH,CAAAA,mBAAAA,QAAQG,OAAO,cAAfH,8BAAAA,mBAAmB,AAACH,CAAAA,SAAQ,EAAGO,QAAQ;IAClD;IACA,MAAMC,QAAQ,IAAIC,YAAkCV,OAAOW,IAAI,EAAE;QAC/DC,SAAS;QACTC,YAAY;QACZP;IACF;IACAD,eAAeS,aAAa,CAACL;AAC/B"}
1
+ {"version":3,"sources":["../src/state/vanilla/dispatchToast.ts"],"sourcesContent":["import type { ShowToastEventDetail, ToastOptions } from '../types';\nimport { EVENTS } from '../constants';\n\nlet counter = 0;\n\nexport function dispatchToast(content: unknown, options: Partial<ToastOptions> = {}, targetDocument: Document): void {\n const detail: ShowToastEventDetail = {\n ...options,\n content,\n toastId: options.toastId ?? (counter++).toString(),\n };\n const event = new CustomEvent<ShowToastEventDetail>(EVENTS.show, {\n bubbles: false,\n cancelable: false,\n detail,\n });\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","counter","dispatchToast","content","options","targetDocument","detail","toastId","toString","event","CustomEvent","show","bubbles","cancelable","dispatchEvent"],"mappings":"AACA,SAASA,MAAM,QAAQ,kBAAe;AAEtC,IAAIC,UAAU;AAEd,OAAO,SAASC,cAAcC,OAAgB,EAAEC,UAAiC,CAAC,CAAC,EAAEC,cAAwB;QAIhGD;IAHX,MAAME,SAA+B;QACnC,GAAGF,OAAO;QACVD;QACAI,SAASH,CAAAA,mBAAAA,QAAQG,OAAO,cAAfH,8BAAAA,mBAAmB,AAACH,CAAAA,SAAQ,EAAGO,QAAQ;IAClD;IACA,MAAMC,QAAQ,IAAIC,YAAkCV,OAAOW,IAAI,EAAE;QAC/DC,SAAS;QACTC,YAAY;QACZP;IACF;IACAD,eAAeS,aAAa,CAACL;AAC/B"}
@@ -1,8 +1,8 @@
1
- export { dispatchToast } from './dispatchToast';
2
- export { dismissToast } from './dismissToast';
3
- export { dismissAllToasts } from './dismissAllToasts';
4
- export { updateToast } from './updateToast';
5
- export { pauseToast } from './pauseToast';
6
- export { playToast } from './playToast';
7
- export { createToaster } from './createToaster';
8
- export { getPositionStyles } from './getPositionStyles';
1
+ export { dispatchToast } from "./dispatchToast.js";
2
+ export { dismissToast } from "./dismissToast.js";
3
+ export { dismissAllToasts } from "./dismissAllToasts.js";
4
+ export { updateToast } from "./updateToast.js";
5
+ export { pauseToast } from "./pauseToast.js";
6
+ export { playToast } from "./playToast.js";
7
+ export { createToaster } from "./createToaster.js";
8
+ export { getPositionStyles } from "./getPositionStyles.js";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/state/vanilla/index.ts"],"sourcesContent":["export { dispatchToast } from './dispatchToast';\nexport { dismissToast } from './dismissToast';\nexport { dismissAllToasts } from './dismissAllToasts';\nexport { updateToast } from './updateToast';\nexport { pauseToast } from './pauseToast';\nexport { playToast } from './playToast';\nexport { createToaster } from './createToaster';\nexport { getPositionStyles } from './getPositionStyles';\n"],"names":["dispatchToast","dismissToast","dismissAllToasts","updateToast","pauseToast","playToast","createToaster","getPositionStyles"],"mappings":"AAAA,SAASA,aAAa,QAAQ,kBAAkB;AAChD,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,gBAAgB,QAAQ,qBAAqB;AACtD,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,iBAAiB,QAAQ,sBAAsB"}
1
+ {"version":3,"sources":["../src/state/vanilla/index.ts"],"sourcesContent":["export { dispatchToast } from './dispatchToast';\nexport { dismissToast } from './dismissToast';\nexport { dismissAllToasts } from './dismissAllToasts';\nexport { updateToast } from './updateToast';\nexport { pauseToast } from './pauseToast';\nexport { playToast } from './playToast';\nexport { createToaster } from './createToaster';\nexport { getPositionStyles } from './getPositionStyles';\n"],"names":["dispatchToast","dismissToast","dismissAllToasts","updateToast","pauseToast","playToast","createToaster","getPositionStyles"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAkB;AAChD,SAASC,YAAY,QAAQ,oBAAiB;AAC9C,SAASC,gBAAgB,QAAQ,wBAAqB;AACtD,SAASC,WAAW,QAAQ,mBAAgB;AAC5C,SAASC,UAAU,QAAQ,kBAAe;AAC1C,SAASC,SAAS,QAAQ,iBAAc;AACxC,SAASC,aAAa,QAAQ,qBAAkB;AAChD,SAASC,iBAAiB,QAAQ,yBAAsB"}
@@ -1,4 +1,4 @@
1
- import { EVENTS } from '../constants';
1
+ import { EVENTS } from "../constants.js";
2
2
  export function pauseToast(toastId, toasterId = undefined, targetDocument) {
3
3
  const event = new CustomEvent(EVENTS.pause, {
4
4
  bubbles: false,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/state/vanilla/pauseToast.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport type { PauseToastEventDetail, ToastId, ToasterId } from '../types';\n\nexport function pauseToast(\n toastId: ToastId,\n toasterId: ToasterId | undefined = undefined,\n targetDocument: Document,\n): void {\n const event = new CustomEvent<PauseToastEventDetail>(EVENTS.pause, {\n bubbles: false,\n cancelable: false,\n detail: { toastId, toasterId },\n });\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","pauseToast","toastId","toasterId","undefined","targetDocument","event","CustomEvent","pause","bubbles","cancelable","detail","dispatchEvent"],"mappings":"AAAA,SAASA,MAAM,QAAQ,eAAe;AAGtC,OAAO,SAASC,WACdC,OAAgB,EAChBC,YAAmCC,SAAS,EAC5CC,cAAwB;IAExB,MAAMC,QAAQ,IAAIC,YAAmCP,OAAOQ,KAAK,EAAE;QACjEC,SAAS;QACTC,YAAY;QACZC,QAAQ;YAAET;YAASC;QAAU;IAC/B;IACAE,eAAeO,aAAa,CAACN;AAC/B"}
1
+ {"version":3,"sources":["../src/state/vanilla/pauseToast.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport type { PauseToastEventDetail, ToastId, ToasterId } from '../types';\n\nexport function pauseToast(\n toastId: ToastId,\n toasterId: ToasterId | undefined = undefined,\n targetDocument: Document,\n): void {\n const event = new CustomEvent<PauseToastEventDetail>(EVENTS.pause, {\n bubbles: false,\n cancelable: false,\n detail: { toastId, toasterId },\n });\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","pauseToast","toastId","toasterId","undefined","targetDocument","event","CustomEvent","pause","bubbles","cancelable","detail","dispatchEvent"],"mappings":"AAAA,SAASA,MAAM,QAAQ,kBAAe;AAGtC,OAAO,SAASC,WACdC,OAAgB,EAChBC,YAAmCC,SAAS,EAC5CC,cAAwB;IAExB,MAAMC,QAAQ,IAAIC,YAAmCP,OAAOQ,KAAK,EAAE;QACjEC,SAAS;QACTC,YAAY;QACZC,QAAQ;YAAET;YAASC;QAAU;IAC/B;IACAE,eAAeO,aAAa,CAACN;AAC/B"}
@@ -1,4 +1,4 @@
1
- import { EVENTS } from '../constants';
1
+ import { EVENTS } from "../constants.js";
2
2
  export function playToast(toastId, toasterId = undefined, targetDocument) {
3
3
  const event = new CustomEvent(EVENTS.play, {
4
4
  bubbles: false,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/state/vanilla/playToast.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport type { PlayToastEventDetail, ToastId, ToasterId } from '../types';\n\nexport function playToast(\n toastId: ToastId,\n toasterId: ToasterId | undefined = undefined,\n targetDocument: Document,\n): void {\n const event = new CustomEvent<PlayToastEventDetail>(EVENTS.play, {\n bubbles: false,\n cancelable: false,\n detail: { toastId, toasterId },\n });\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","playToast","toastId","toasterId","undefined","targetDocument","event","CustomEvent","play","bubbles","cancelable","detail","dispatchEvent"],"mappings":"AAAA,SAASA,MAAM,QAAQ,eAAe;AAGtC,OAAO,SAASC,UACdC,OAAgB,EAChBC,YAAmCC,SAAS,EAC5CC,cAAwB;IAExB,MAAMC,QAAQ,IAAIC,YAAkCP,OAAOQ,IAAI,EAAE;QAC/DC,SAAS;QACTC,YAAY;QACZC,QAAQ;YAAET;YAASC;QAAU;IAC/B;IACAE,eAAeO,aAAa,CAACN;AAC/B"}
1
+ {"version":3,"sources":["../src/state/vanilla/playToast.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport type { PlayToastEventDetail, ToastId, ToasterId } from '../types';\n\nexport function playToast(\n toastId: ToastId,\n toasterId: ToasterId | undefined = undefined,\n targetDocument: Document,\n): void {\n const event = new CustomEvent<PlayToastEventDetail>(EVENTS.play, {\n bubbles: false,\n cancelable: false,\n detail: { toastId, toasterId },\n });\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","playToast","toastId","toasterId","undefined","targetDocument","event","CustomEvent","play","bubbles","cancelable","detail","dispatchEvent"],"mappings":"AAAA,SAASA,MAAM,QAAQ,kBAAe;AAGtC,OAAO,SAASC,UACdC,OAAgB,EAChBC,YAAmCC,SAAS,EAC5CC,cAAwB;IAExB,MAAMC,QAAQ,IAAIC,YAAkCP,OAAOQ,IAAI,EAAE;QAC/DC,SAAS;QACTC,YAAY;QACZC,QAAQ;YAAET;YAASC;QAAU;IAC/B;IACAE,eAAeO,aAAa,CAACN;AAC/B"}
@@ -1,4 +1,4 @@
1
- import { EVENTS } from '../constants';
1
+ import { EVENTS } from "../constants.js";
2
2
  export function updateToast(options, targetDocument) {
3
3
  const event = new CustomEvent(EVENTS.update, {
4
4
  bubbles: false,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/state/vanilla/updateToast.ts"],"sourcesContent":["import type { UpdateToastEventDetail } from '../types';\nimport { EVENTS } from '../constants';\n\nexport function updateToast(options: UpdateToastEventDetail, targetDocument: Document): void {\n const event = new CustomEvent<UpdateToastEventDetail>(EVENTS.update, {\n bubbles: false,\n cancelable: false,\n detail: options,\n });\n\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","updateToast","options","targetDocument","event","CustomEvent","update","bubbles","cancelable","detail","dispatchEvent"],"mappings":"AACA,SAASA,MAAM,QAAQ,eAAe;AAEtC,OAAO,SAASC,YAAYC,OAA+B,EAAEC,cAAwB;IACnF,MAAMC,QAAQ,IAAIC,YAAoCL,OAAOM,MAAM,EAAE;QACnEC,SAAS;QACTC,YAAY;QACZC,QAAQP;IACV;IAEAC,eAAeO,aAAa,CAACN;AAC/B"}
1
+ {"version":3,"sources":["../src/state/vanilla/updateToast.ts"],"sourcesContent":["import type { UpdateToastEventDetail } from '../types';\nimport { EVENTS } from '../constants';\n\nexport function updateToast(options: UpdateToastEventDetail, targetDocument: Document): void {\n const event = new CustomEvent<UpdateToastEventDetail>(EVENTS.update, {\n bubbles: false,\n cancelable: false,\n detail: options,\n });\n\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","updateToast","options","targetDocument","event","CustomEvent","update","bubbles","cancelable","detail","dispatchEvent"],"mappings":"AACA,SAASA,MAAM,QAAQ,kBAAe;AAEtC,OAAO,SAASC,YAAYC,OAA+B,EAAEC,cAAwB;IACnF,MAAMC,QAAQ,IAAIC,YAAoCL,OAAOM,MAAM,EAAE;QACnEC,SAAS;QACTC,YAAY;QACZC,QAAQP;IACV;IAEAC,eAAeO,aAAa,CAACN;AAC/B"}
@@ -25,4 +25,4 @@ _export(exports, {
25
25
  return _index.useAriaLive_unstable;
26
26
  }
27
27
  });
28
- const _index = require("./components/AriaLive/index");
28
+ const _index = require("./components/AriaLive/index.cjs");
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/AriaLive.ts"],"sourcesContent":["export type {\n Announce,\n AnnounceOptions,\n AriaLivePoliteness,\n AriaLiveProps,\n AriaLiveSlots,\n AriaLiveState,\n LiveMessage,\n} from './components/AriaLive/index';\nexport {\n AriaLive,\n ariaLiveClassNames,\n renderAriaLive_unstable,\n useAriaLiveStyles_unstable,\n useAriaLive_unstable,\n} from './components/AriaLive/index';\n"],"names":["AriaLive","ariaLiveClassNames","renderAriaLive_unstable","useAriaLiveStyles_unstable","useAriaLive_unstable"],"mappings":";;;;;;;;;;;;eAUEA,eAAQ;;;eACRC,yBAAkB;;;eAClBC,8BAAuB;;;eACvBC,iCAA0B;;;eAC1BC,2BAAoB;;;uBACf,8BAA8B"}
1
+ {"version":3,"sources":["../src/AriaLive.ts"],"sourcesContent":["export type {\n Announce,\n AnnounceOptions,\n AriaLivePoliteness,\n AriaLiveProps,\n AriaLiveSlots,\n AriaLiveState,\n LiveMessage,\n} from './components/AriaLive/index';\nexport {\n AriaLive,\n ariaLiveClassNames,\n renderAriaLive_unstable,\n useAriaLiveStyles_unstable,\n useAriaLive_unstable,\n} from './components/AriaLive/index';\n"],"names":["AriaLive","ariaLiveClassNames","renderAriaLive_unstable","useAriaLiveStyles_unstable","useAriaLive_unstable"],"mappings":";;;;;;;;;;;;eAUEA,eAAQ;;;eACRC,yBAAkB;;;eAClBC,8BAAuB;;;eACvBC,iCAA0B;;;eAC1BC,2BAAoB;;;uBACf,iCAA8B"}
@@ -28,4 +28,4 @@ _export(exports, {
28
28
  return _index.useToast_unstable;
29
29
  }
30
30
  });
31
- const _index = require("./components/Toast/index");
31
+ const _index = require("./components/Toast/index.cjs");
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Toast.ts"],"sourcesContent":["export type {\n ToastBaseProps,\n ToastBaseState,\n ToastContextValues,\n ToastProps,\n ToastSlots,\n ToastState,\n} from './components/Toast/index';\nexport {\n Toast,\n renderToast_unstable,\n toastClassNames,\n useToastStyles_unstable,\n useToastBase_unstable,\n useToast_unstable,\n} from './components/Toast/index';\n"],"names":["Toast","renderToast_unstable","toastClassNames","useToastStyles_unstable","useToastBase_unstable","useToast_unstable"],"mappings":";;;;;;;;;;;;eASEA,YAAK;;;eACLC,2BAAoB;;;eACpBC,sBAAe;;;eAEfE,4BAAqB;;;eADrBD,8BAAuB;;;eAEvBE,wBAAiB;;;uBACZ,2BAA2B"}
1
+ {"version":3,"sources":["../src/Toast.ts"],"sourcesContent":["export type {\n ToastBaseProps,\n ToastBaseState,\n ToastContextValues,\n ToastProps,\n ToastSlots,\n ToastState,\n} from './components/Toast/index';\nexport {\n Toast,\n renderToast_unstable,\n toastClassNames,\n useToastStyles_unstable,\n useToastBase_unstable,\n useToast_unstable,\n} from './components/Toast/index';\n"],"names":["Toast","renderToast_unstable","toastClassNames","useToastStyles_unstable","useToastBase_unstable","useToast_unstable"],"mappings":";;;;;;;;;;;;eASEA,YAAK;;;eACLC,2BAAoB;;;eACpBC,sBAAe;;;eAEfE,4BAAqB;;;eADrBD,8BAAuB;;;eAEvBE,wBAAiB;;;uBACZ,8BAA2B"}
@@ -28,4 +28,4 @@ _export(exports, {
28
28
  return _index.useToastBody_unstable;
29
29
  }
30
30
  });
31
- const _index = require("./components/ToastBody/index");
31
+ const _index = require("./components/ToastBody/index.cjs");
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ToastBody.ts"],"sourcesContent":["export type {\n ToastBodyBaseProps,\n ToastBodyBaseState,\n ToastBodyProps,\n ToastBodySlots,\n ToastBodyState,\n} from './components/ToastBody/index';\nexport {\n ToastBody,\n renderToastBody_unstable,\n toastBodyClassNames,\n useToastBodyStyles_unstable,\n useToastBodyBase_unstable,\n useToastBody_unstable,\n} from './components/ToastBody/index';\n"],"names":["ToastBody","renderToastBody_unstable","toastBodyClassNames","useToastBodyStyles_unstable","useToastBodyBase_unstable","useToastBody_unstable"],"mappings":";;;;;;;;;;;;eAQEA,gBAAS;;;eACTC,+BAAwB;;;eACxBC,0BAAmB;;;eAEnBE,gCAAyB;;;eADzBD,kCAA2B;;;eAE3BE,4BAAqB;;;uBAChB,+BAA+B"}
1
+ {"version":3,"sources":["../src/ToastBody.ts"],"sourcesContent":["export type {\n ToastBodyBaseProps,\n ToastBodyBaseState,\n ToastBodyProps,\n ToastBodySlots,\n ToastBodyState,\n} from './components/ToastBody/index';\nexport {\n ToastBody,\n renderToastBody_unstable,\n toastBodyClassNames,\n useToastBodyStyles_unstable,\n useToastBodyBase_unstable,\n useToastBody_unstable,\n} from './components/ToastBody/index';\n"],"names":["ToastBody","renderToastBody_unstable","toastBodyClassNames","useToastBodyStyles_unstable","useToastBodyBase_unstable","useToastBody_unstable"],"mappings":";;;;;;;;;;;;eAQEA,gBAAS;;;eACTC,+BAAwB;;;eACxBC,0BAAmB;;;eAEnBE,gCAAyB;;;eADzBD,kCAA2B;;;eAE3BE,4BAAqB;;;uBAChB,kCAA+B"}
@@ -28,4 +28,4 @@ _export(exports, {
28
28
  return _index.useToastContainer_unstable;
29
29
  }
30
30
  });
31
- const _index = require("./components/ToastContainer/index");
31
+ const _index = require("./components/ToastContainer/index.cjs");
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ToastContainer.ts"],"sourcesContent":["export type {\n ToastContainerContextValues,\n ToastContainerProps,\n ToastContainerSlots,\n ToastContainerState,\n} from './components/ToastContainer/index';\nexport {\n ToastContainer,\n renderToastContainer_unstable,\n toastContainerClassNames,\n useToastContainerContextValues_unstable,\n useToastContainerStyles_unstable,\n useToastContainer_unstable,\n} from './components/ToastContainer/index';\n"],"names":["ToastContainer","renderToastContainer_unstable","toastContainerClassNames","useToastContainerContextValues_unstable","useToastContainerStyles_unstable","useToastContainer_unstable"],"mappings":";;;;;;;;;;;;eAOEA,qBAAc;;;eACdC,oCAA6B;;;eAC7BC,+BAAwB;;;eACxBC,8CAAuC;;;eACvCC,uCAAgC;;;eAChCC,iCAA0B;;;uBACrB,oCAAoC"}
1
+ {"version":3,"sources":["../src/ToastContainer.ts"],"sourcesContent":["export type {\n ToastContainerContextValues,\n ToastContainerProps,\n ToastContainerSlots,\n ToastContainerState,\n} from './components/ToastContainer/index';\nexport {\n ToastContainer,\n renderToastContainer_unstable,\n toastContainerClassNames,\n useToastContainerContextValues_unstable,\n useToastContainerStyles_unstable,\n useToastContainer_unstable,\n} from './components/ToastContainer/index';\n"],"names":["ToastContainer","renderToastContainer_unstable","toastContainerClassNames","useToastContainerContextValues_unstable","useToastContainerStyles_unstable","useToastContainer_unstable"],"mappings":";;;;;;;;;;;;eAOEA,qBAAc;;;eACdC,oCAA6B;;;eAC7BC,+BAAwB;;;eACxBC,8CAAuC;;;eACvCC,uCAAgC;;;eAChCC,iCAA0B;;;uBACrB,uCAAoC"}