@fluentui/react-toast 0.0.0-nightly-20230704-0416.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (310) hide show
  1. package/CHANGELOG.json +161 -0
  2. package/CHANGELOG.md +56 -0
  3. package/LICENSE +15 -0
  4. package/README.md +5 -0
  5. package/dist/index.d.ts +485 -0
  6. package/lib/AriaLive.js +1 -0
  7. package/lib/AriaLive.js.map +1 -0
  8. package/lib/Toast.js +1 -0
  9. package/lib/Toast.js.map +1 -0
  10. package/lib/ToastBody.js +1 -0
  11. package/lib/ToastBody.js.map +1 -0
  12. package/lib/ToastContainer.js +1 -0
  13. package/lib/ToastContainer.js.map +1 -0
  14. package/lib/ToastFooter.js +1 -0
  15. package/lib/ToastFooter.js.map +1 -0
  16. package/lib/ToastTitle.js +1 -0
  17. package/lib/ToastTitle.js.map +1 -0
  18. package/lib/ToastTrigger.js +1 -0
  19. package/lib/ToastTrigger.js.map +1 -0
  20. package/lib/Toaster.js +1 -0
  21. package/lib/Toaster.js.map +1 -0
  22. package/lib/components/AriaLive/AriaLive.js +12 -0
  23. package/lib/components/AriaLive/AriaLive.js.map +1 -0
  24. package/lib/components/AriaLive/AriaLive.types.js +1 -0
  25. package/lib/components/AriaLive/AriaLive.types.js.map +1 -0
  26. package/lib/components/AriaLive/index.js +5 -0
  27. package/lib/components/AriaLive/index.js.map +1 -0
  28. package/lib/components/AriaLive/renderAriaLive.js +8 -0
  29. package/lib/components/AriaLive/renderAriaLive.js.map +1 -0
  30. package/lib/components/AriaLive/useAriaLive.js +73 -0
  31. package/lib/components/AriaLive/useAriaLive.js.map +1 -0
  32. package/lib/components/AriaLive/useAriaLiveStyles.styles.js +19 -0
  33. package/lib/components/AriaLive/useAriaLiveStyles.styles.js.map +1 -0
  34. package/lib/components/Timer/Timer.js +21 -0
  35. package/lib/components/Timer/Timer.js.map +1 -0
  36. package/lib/components/Timer/index.js +1 -0
  37. package/lib/components/Timer/index.js.map +1 -0
  38. package/lib/components/Timer/useTimerStyles.styles.js +3 -0
  39. package/lib/components/Timer/useTimerStyles.styles.js.map +1 -0
  40. package/lib/components/Toast/Toast.js +13 -0
  41. package/lib/components/Toast/Toast.js.map +1 -0
  42. package/lib/components/Toast/Toast.types.js +1 -0
  43. package/lib/components/Toast/Toast.types.js.map +1 -0
  44. package/lib/components/Toast/index.js +5 -0
  45. package/lib/components/Toast/index.js.map +1 -0
  46. package/lib/components/Toast/renderToast.js +11 -0
  47. package/lib/components/Toast/renderToast.js.map +1 -0
  48. package/lib/components/Toast/useToast.js +22 -0
  49. package/lib/components/Toast/useToast.js.map +1 -0
  50. package/lib/components/Toast/useToastContextValues.js +6 -0
  51. package/lib/components/Toast/useToastContextValues.js.map +1 -0
  52. package/lib/components/Toast/useToastStyles.styles.js +24 -0
  53. package/lib/components/Toast/useToastStyles.styles.js.map +1 -0
  54. package/lib/components/ToastBody/ToastBody.js +12 -0
  55. package/lib/components/ToastBody/ToastBody.js.map +1 -0
  56. package/lib/components/ToastBody/ToastBody.types.js +1 -0
  57. package/lib/components/ToastBody/ToastBody.types.js.map +1 -0
  58. package/lib/components/ToastBody/index.js +5 -0
  59. package/lib/components/ToastBody/index.js.map +1 -0
  60. package/lib/components/ToastBody/renderToastBody.js +8 -0
  61. package/lib/components/ToastBody/renderToastBody.js.map +1 -0
  62. package/lib/components/ToastBody/useToastBody.js +29 -0
  63. package/lib/components/ToastBody/useToastBody.js.map +1 -0
  64. package/lib/components/ToastBody/useToastBodyStyles.styles.js +32 -0
  65. package/lib/components/ToastBody/useToastBodyStyles.styles.js.map +1 -0
  66. package/lib/components/ToastContainer/ToastContainer.js +13 -0
  67. package/lib/components/ToastContainer/ToastContainer.js.map +1 -0
  68. package/lib/components/ToastContainer/ToastContainer.types.js +1 -0
  69. package/lib/components/ToastContainer/ToastContainer.types.js.map +1 -0
  70. package/lib/components/ToastContainer/index.js +6 -0
  71. package/lib/components/ToastContainer/index.js.map +1 -0
  72. package/lib/components/ToastContainer/renderToastContainer.js +21 -0
  73. package/lib/components/ToastContainer/renderToastContainer.js.map +1 -0
  74. package/lib/components/ToastContainer/useToastContainer.js +219 -0
  75. package/lib/components/ToastContainer/useToastContainer.js.map +1 -0
  76. package/lib/components/ToastContainer/useToastContainerContextValues.js +18 -0
  77. package/lib/components/ToastContainer/useToastContainerContextValues.js.map +1 -0
  78. package/lib/components/ToastContainer/useToastContainerStyles.styles.js +36 -0
  79. package/lib/components/ToastContainer/useToastContainerStyles.styles.js.map +1 -0
  80. package/lib/components/ToastFooter/ToastFooter.js +12 -0
  81. package/lib/components/ToastFooter/ToastFooter.js.map +1 -0
  82. package/lib/components/ToastFooter/ToastFooter.types.js +1 -0
  83. package/lib/components/ToastFooter/ToastFooter.types.js.map +1 -0
  84. package/lib/components/ToastFooter/index.js +5 -0
  85. package/lib/components/ToastFooter/index.js.map +1 -0
  86. package/lib/components/ToastFooter/renderToastFooter.js +8 -0
  87. package/lib/components/ToastFooter/renderToastFooter.js.map +1 -0
  88. package/lib/components/ToastFooter/useToastFooter.js +21 -0
  89. package/lib/components/ToastFooter/useToastFooter.js.map +1 -0
  90. package/lib/components/ToastFooter/useToastFooterStyles.styles.js +17 -0
  91. package/lib/components/ToastFooter/useToastFooterStyles.styles.js.map +1 -0
  92. package/lib/components/ToastTitle/ToastTitle.js +12 -0
  93. package/lib/components/ToastTitle/ToastTitle.js.map +1 -0
  94. package/lib/components/ToastTitle/ToastTitle.types.js +1 -0
  95. package/lib/components/ToastTitle/ToastTitle.types.js.map +1 -0
  96. package/lib/components/ToastTitle/index.js +5 -0
  97. package/lib/components/ToastTitle/index.js.map +1 -0
  98. package/lib/components/ToastTitle/renderToastTitle.js +8 -0
  99. package/lib/components/ToastTitle/renderToastTitle.js.map +1 -0
  100. package/lib/components/ToastTitle/useToastTitle.js +54 -0
  101. package/lib/components/ToastTitle/useToastTitle.js.map +1 -0
  102. package/lib/components/ToastTitle/useToastTitleStyles.styles.js +78 -0
  103. package/lib/components/ToastTitle/useToastTitleStyles.styles.js.map +1 -0
  104. package/lib/components/ToastTrigger/ToastTrigger.js +10 -0
  105. package/lib/components/ToastTrigger/ToastTrigger.js.map +1 -0
  106. package/lib/components/ToastTrigger/ToastTrigger.types.js +1 -0
  107. package/lib/components/ToastTrigger/ToastTrigger.types.js.map +1 -0
  108. package/lib/components/ToastTrigger/index.js +4 -0
  109. package/lib/components/ToastTrigger/index.js.map +1 -0
  110. package/lib/components/ToastTrigger/renderToastTrigger.js +5 -0
  111. package/lib/components/ToastTrigger/renderToastTrigger.js.map +1 -0
  112. package/lib/components/ToastTrigger/useToastTrigger.js +36 -0
  113. package/lib/components/ToastTrigger/useToastTrigger.js.map +1 -0
  114. package/lib/components/Toaster/Toaster.js +12 -0
  115. package/lib/components/Toaster/Toaster.js.map +1 -0
  116. package/lib/components/Toaster/Toaster.types.js +1 -0
  117. package/lib/components/Toaster/Toaster.types.js.map +1 -0
  118. package/lib/components/Toaster/index.js +5 -0
  119. package/lib/components/Toaster/index.js.map +1 -0
  120. package/lib/components/Toaster/renderToaster.js +14 -0
  121. package/lib/components/Toaster/renderToaster.js.map +1 -0
  122. package/lib/components/Toaster/useToaster.js +76 -0
  123. package/lib/components/Toaster/useToaster.js.map +1 -0
  124. package/lib/components/Toaster/useToasterStyles.styles.js +43 -0
  125. package/lib/components/Toaster/useToasterStyles.styles.js.map +1 -0
  126. package/lib/contexts/toastContainerContext.js +11 -0
  127. package/lib/contexts/toastContainerContext.js.map +1 -0
  128. package/lib/index.js +7 -0
  129. package/lib/index.js.map +1 -0
  130. package/lib/state/constants.js +14 -0
  131. package/lib/state/constants.js.map +1 -0
  132. package/lib/state/index.js +5 -0
  133. package/lib/state/index.js.map +1 -0
  134. package/lib/state/types.js +1 -0
  135. package/lib/state/types.js.map +1 -0
  136. package/lib/state/useToastController.js +57 -0
  137. package/lib/state/useToastController.js.map +1 -0
  138. package/lib/state/useToaster.js +162 -0
  139. package/lib/state/useToaster.js.map +1 -0
  140. package/lib/state/vanilla/createToaster.js +137 -0
  141. package/lib/state/vanilla/createToaster.js.map +1 -0
  142. package/lib/state/vanilla/dismissAllToasts.js +11 -0
  143. package/lib/state/vanilla/dismissAllToasts.js.map +1 -0
  144. package/lib/state/vanilla/dismissToast.js +12 -0
  145. package/lib/state/vanilla/dismissToast.js.map +1 -0
  146. package/lib/state/vanilla/dispatchToast.js +16 -0
  147. package/lib/state/vanilla/dispatchToast.js.map +1 -0
  148. package/lib/state/vanilla/getPositionStyles.js +40 -0
  149. package/lib/state/vanilla/getPositionStyles.js.map +1 -0
  150. package/lib/state/vanilla/index.js +8 -0
  151. package/lib/state/vanilla/index.js.map +1 -0
  152. package/lib/state/vanilla/pauseToast.js +12 -0
  153. package/lib/state/vanilla/pauseToast.js.map +1 -0
  154. package/lib/state/vanilla/playToast.js +12 -0
  155. package/lib/state/vanilla/playToast.js.map +1 -0
  156. package/lib/state/vanilla/updateToast.js +9 -0
  157. package/lib/state/vanilla/updateToast.js.map +1 -0
  158. package/lib-commonjs/AriaLive.js +6 -0
  159. package/lib-commonjs/AriaLive.js.map +1 -0
  160. package/lib-commonjs/Toast.js +6 -0
  161. package/lib-commonjs/Toast.js.map +1 -0
  162. package/lib-commonjs/ToastBody.js +6 -0
  163. package/lib-commonjs/ToastBody.js.map +1 -0
  164. package/lib-commonjs/ToastContainer.js +6 -0
  165. package/lib-commonjs/ToastContainer.js.map +1 -0
  166. package/lib-commonjs/ToastFooter.js +6 -0
  167. package/lib-commonjs/ToastFooter.js.map +1 -0
  168. package/lib-commonjs/ToastTitle.js +6 -0
  169. package/lib-commonjs/ToastTitle.js.map +1 -0
  170. package/lib-commonjs/ToastTrigger.js +6 -0
  171. package/lib-commonjs/ToastTrigger.js.map +1 -0
  172. package/lib-commonjs/Toaster.js +6 -0
  173. package/lib-commonjs/Toaster.js.map +1 -0
  174. package/lib-commonjs/components/AriaLive/AriaLive.js +19 -0
  175. package/lib-commonjs/components/AriaLive/AriaLive.js.map +1 -0
  176. package/lib-commonjs/components/AriaLive/AriaLive.types.js +6 -0
  177. package/lib-commonjs/components/AriaLive/AriaLive.types.js.map +1 -0
  178. package/lib-commonjs/components/AriaLive/index.js +10 -0
  179. package/lib-commonjs/components/AriaLive/index.js.map +1 -0
  180. package/lib-commonjs/components/AriaLive/renderAriaLive.js +14 -0
  181. package/lib-commonjs/components/AriaLive/renderAriaLive.js.map +1 -0
  182. package/lib-commonjs/components/AriaLive/useAriaLive.js +75 -0
  183. package/lib-commonjs/components/AriaLive/useAriaLive.js.map +1 -0
  184. package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.js +31 -0
  185. package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.js.map +1 -0
  186. package/lib-commonjs/components/Timer/Timer.js +30 -0
  187. package/lib-commonjs/components/Timer/Timer.js.map +1 -0
  188. package/lib-commonjs/components/Timer/index.js +6 -0
  189. package/lib-commonjs/components/Timer/index.js.map +1 -0
  190. package/lib-commonjs/components/Timer/useTimerStyles.styles.js +16 -0
  191. package/lib-commonjs/components/Timer/useTimerStyles.styles.js.map +1 -0
  192. package/lib-commonjs/components/Toast/Toast.js +20 -0
  193. package/lib-commonjs/components/Toast/Toast.js.map +1 -0
  194. package/lib-commonjs/components/Toast/Toast.types.js +4 -0
  195. package/lib-commonjs/components/Toast/Toast.types.js.map +1 -0
  196. package/lib-commonjs/components/Toast/index.js +10 -0
  197. package/lib-commonjs/components/Toast/index.js.map +1 -0
  198. package/lib-commonjs/components/Toast/renderToast.js +17 -0
  199. package/lib-commonjs/components/Toast/renderToast.js.map +1 -0
  200. package/lib-commonjs/components/Toast/useToast.js +23 -0
  201. package/lib-commonjs/components/Toast/useToast.js.map +1 -0
  202. package/lib-commonjs/components/Toast/useToastContextValues.js +14 -0
  203. package/lib-commonjs/components/Toast/useToastContextValues.js.map +1 -0
  204. package/lib-commonjs/components/Toast/useToastStyles.styles.js +39 -0
  205. package/lib-commonjs/components/Toast/useToastStyles.styles.js.map +1 -0
  206. package/lib-commonjs/components/ToastBody/ToastBody.js +19 -0
  207. package/lib-commonjs/components/ToastBody/ToastBody.js.map +1 -0
  208. package/lib-commonjs/components/ToastBody/ToastBody.types.js +4 -0
  209. package/lib-commonjs/components/ToastBody/ToastBody.types.js.map +1 -0
  210. package/lib-commonjs/components/ToastBody/index.js +10 -0
  211. package/lib-commonjs/components/ToastBody/index.js.map +1 -0
  212. package/lib-commonjs/components/ToastBody/renderToastBody.js +14 -0
  213. package/lib-commonjs/components/ToastBody/renderToastBody.js.map +1 -0
  214. package/lib-commonjs/components/ToastBody/useToastBody.js +30 -0
  215. package/lib-commonjs/components/ToastBody/useToastBody.js.map +1 -0
  216. package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.js +47 -0
  217. package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.js.map +1 -0
  218. package/lib-commonjs/components/ToastContainer/ToastContainer.js +20 -0
  219. package/lib-commonjs/components/ToastContainer/ToastContainer.js.map +1 -0
  220. package/lib-commonjs/components/ToastContainer/ToastContainer.types.js +6 -0
  221. package/lib-commonjs/components/ToastContainer/ToastContainer.types.js.map +1 -0
  222. package/lib-commonjs/components/ToastContainer/index.js +11 -0
  223. package/lib-commonjs/components/ToastContainer/index.js.map +1 -0
  224. package/lib-commonjs/components/ToastContainer/renderToastContainer.js +27 -0
  225. package/lib-commonjs/components/ToastContainer/renderToastContainer.js.map +1 -0
  226. package/lib-commonjs/components/ToastContainer/useToastContainer.js +220 -0
  227. package/lib-commonjs/components/ToastContainer/useToastContainer.js.map +1 -0
  228. package/lib-commonjs/components/ToastContainer/useToastContainerContextValues.js +27 -0
  229. package/lib-commonjs/components/ToastContainer/useToastContainerContextValues.js.map +1 -0
  230. package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.js +64 -0
  231. package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.js.map +1 -0
  232. package/lib-commonjs/components/ToastFooter/ToastFooter.js +19 -0
  233. package/lib-commonjs/components/ToastFooter/ToastFooter.js.map +1 -0
  234. package/lib-commonjs/components/ToastFooter/ToastFooter.types.js +4 -0
  235. package/lib-commonjs/components/ToastFooter/ToastFooter.types.js.map +1 -0
  236. package/lib-commonjs/components/ToastFooter/index.js +10 -0
  237. package/lib-commonjs/components/ToastFooter/index.js.map +1 -0
  238. package/lib-commonjs/components/ToastFooter/renderToastFooter.js +14 -0
  239. package/lib-commonjs/components/ToastFooter/renderToastFooter.js.map +1 -0
  240. package/lib-commonjs/components/ToastFooter/useToastFooter.js +22 -0
  241. package/lib-commonjs/components/ToastFooter/useToastFooter.js.map +1 -0
  242. package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.js +28 -0
  243. package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.js.map +1 -0
  244. package/lib-commonjs/components/ToastTitle/ToastTitle.js +19 -0
  245. package/lib-commonjs/components/ToastTitle/ToastTitle.js.map +1 -0
  246. package/lib-commonjs/components/ToastTitle/ToastTitle.types.js +4 -0
  247. package/lib-commonjs/components/ToastTitle/ToastTitle.types.js.map +1 -0
  248. package/lib-commonjs/components/ToastTitle/index.js +10 -0
  249. package/lib-commonjs/components/ToastTitle/index.js.map +1 -0
  250. package/lib-commonjs/components/ToastTitle/renderToastTitle.js +14 -0
  251. package/lib-commonjs/components/ToastTitle/renderToastTitle.js.map +1 -0
  252. package/lib-commonjs/components/ToastTitle/useToastTitle.js +55 -0
  253. package/lib-commonjs/components/ToastTitle/useToastTitle.js.map +1 -0
  254. package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.js +107 -0
  255. package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.js.map +1 -0
  256. package/lib-commonjs/components/ToastTrigger/ToastTrigger.js +17 -0
  257. package/lib-commonjs/components/ToastTrigger/ToastTrigger.js.map +1 -0
  258. package/lib-commonjs/components/ToastTrigger/ToastTrigger.types.js +6 -0
  259. package/lib-commonjs/components/ToastTrigger/ToastTrigger.types.js.map +1 -0
  260. package/lib-commonjs/components/ToastTrigger/index.js +9 -0
  261. package/lib-commonjs/components/ToastTrigger/index.js.map +1 -0
  262. package/lib-commonjs/components/ToastTrigger/renderToastTrigger.js +13 -0
  263. package/lib-commonjs/components/ToastTrigger/renderToastTrigger.js.map +1 -0
  264. package/lib-commonjs/components/ToastTrigger/useToastTrigger.js +37 -0
  265. package/lib-commonjs/components/ToastTrigger/useToastTrigger.js.map +1 -0
  266. package/lib-commonjs/components/Toaster/Toaster.js +19 -0
  267. package/lib-commonjs/components/Toaster/Toaster.js.map +1 -0
  268. package/lib-commonjs/components/Toaster/Toaster.types.js +4 -0
  269. package/lib-commonjs/components/Toaster/Toaster.types.js.map +1 -0
  270. package/lib-commonjs/components/Toaster/index.js +10 -0
  271. package/lib-commonjs/components/Toaster/index.js.map +1 -0
  272. package/lib-commonjs/components/Toaster/renderToaster.js +20 -0
  273. package/lib-commonjs/components/Toaster/renderToaster.js.map +1 -0
  274. package/lib-commonjs/components/Toaster/useToaster.js +81 -0
  275. package/lib-commonjs/components/Toaster/useToaster.js.map +1 -0
  276. package/lib-commonjs/components/Toaster/useToasterStyles.styles.js +54 -0
  277. package/lib-commonjs/components/Toaster/useToasterStyles.styles.js.map +1 -0
  278. package/lib-commonjs/contexts/toastContainerContext.js +26 -0
  279. package/lib-commonjs/contexts/toastContainerContext.js.map +1 -0
  280. package/lib-commonjs/index.js +48 -0
  281. package/lib-commonjs/index.js.map +1 -0
  282. package/lib-commonjs/state/constants.js +28 -0
  283. package/lib-commonjs/state/constants.js.map +1 -0
  284. package/lib-commonjs/state/index.js +20 -0
  285. package/lib-commonjs/state/index.js.map +1 -0
  286. package/lib-commonjs/state/types.js +6 -0
  287. package/lib-commonjs/state/types.js.map +1 -0
  288. package/lib-commonjs/state/useToastController.js +63 -0
  289. package/lib-commonjs/state/useToastController.js.map +1 -0
  290. package/lib-commonjs/state/useToaster.js +171 -0
  291. package/lib-commonjs/state/useToaster.js.map +1 -0
  292. package/lib-commonjs/state/vanilla/createToaster.js +142 -0
  293. package/lib-commonjs/state/vanilla/createToaster.js.map +1 -0
  294. package/lib-commonjs/state/vanilla/dismissAllToasts.js +19 -0
  295. package/lib-commonjs/state/vanilla/dismissAllToasts.js.map +1 -0
  296. package/lib-commonjs/state/vanilla/dismissToast.js +20 -0
  297. package/lib-commonjs/state/vanilla/dismissToast.js.map +1 -0
  298. package/lib-commonjs/state/vanilla/dispatchToast.js +24 -0
  299. package/lib-commonjs/state/vanilla/dispatchToast.js.map +1 -0
  300. package/lib-commonjs/state/vanilla/getPositionStyles.js +48 -0
  301. package/lib-commonjs/state/vanilla/getPositionStyles.js.map +1 -0
  302. package/lib-commonjs/state/vanilla/index.js +13 -0
  303. package/lib-commonjs/state/vanilla/index.js.map +1 -0
  304. package/lib-commonjs/state/vanilla/pauseToast.js +20 -0
  305. package/lib-commonjs/state/vanilla/pauseToast.js.map +1 -0
  306. package/lib-commonjs/state/vanilla/playToast.js +20 -0
  307. package/lib-commonjs/state/vanilla/playToast.js.map +1 -0
  308. package/lib-commonjs/state/vanilla/updateToast.js +17 -0
  309. package/lib-commonjs/state/vanilla/updateToast.js.map +1 -0
  310. package/package.json +66 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./ToastTitle"), exports);
7
+ _exportStar(require("./ToastTitle.types"), exports);
8
+ _exportStar(require("./renderToastTitle"), exports);
9
+ _exportStar(require("./useToastTitle"), exports);
10
+ _exportStar(require("./useToastTitleStyles.styles"), exports);
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export * from './ToastTitle';\nexport * from './ToastTitle.types';\nexport * from './renderToastTitle';\nexport * from './useToastTitle';\nexport * from './useToastTitleStyles.styles';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA"}
@@ -0,0 +1,14 @@
1
+ /** @jsxRuntime classic */ /** @jsxFrag Fragment */ /** @jsx createElement */ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "renderToastTitle_unstable", {
6
+ enumerable: true,
7
+ get: ()=>renderToastTitle_unstable
8
+ });
9
+ const _reactJsxRuntime = require("@fluentui/react-jsx-runtime");
10
+ const _reactUtilities = require("@fluentui/react-utilities");
11
+ const renderToastTitle_unstable = (state)=>{
12
+ const { slots , slotProps } = (0, _reactUtilities.getSlotsNext)(state);
13
+ return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(_reactJsxRuntime.Fragment, null, slots.media ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.media, slotProps.media) : null, /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.root, slotProps.root), slots.action ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.action, slotProps.action) : null);
14
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["renderToastTitle.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsxFrag Fragment */ /** @jsx createElement */ import { createElement, Fragment } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of ToastTitle\n */ export const renderToastTitle_unstable = (state)=>{\n const { slots , slotProps } = getSlotsNext(state);\n return /*#__PURE__*/ createElement(Fragment, null, slots.media ? /*#__PURE__*/ createElement(slots.media, slotProps.media) : null, /*#__PURE__*/ createElement(slots.root, slotProps.root), slots.action ? /*#__PURE__*/ createElement(slots.action, slotProps.action) : null);\n};\n"],"names":["renderToastTitle_unstable","state","slots","slotProps","getSlotsNext","createElement","Fragment","media","root","action"],"mappings":"AAAA,wBAAwB,GAAG,sBAAsB,GAAG,uBAAuB;;;;+BAI1DA;;aAAAA;;iCAJqG;gCACzF;AAGlB,MAAMA,4BAA4B,CAACC,QAAQ;IAClD,MAAM,EAAEC,MAAK,EAAGC,UAAS,EAAG,GAAGC,IAAAA,4BAAY,EAACH;IAC5C,OAAO,WAAW,GAAGI,IAAAA,8BAAa,EAACC,yBAAQ,EAAE,IAAI,EAAEJ,MAAMK,KAAK,GAAG,WAAW,GAAGF,IAAAA,8BAAa,EAACH,MAAMK,KAAK,EAAEJ,UAAUI,KAAK,IAAI,IAAI,EAAE,WAAW,GAAGF,IAAAA,8BAAa,EAACH,MAAMM,IAAI,EAAEL,UAAUK,IAAI,GAAGN,MAAMO,MAAM,GAAG,WAAW,GAAGJ,IAAAA,8BAAa,EAACH,MAAMO,MAAM,EAAEN,UAAUM,MAAM,IAAI,IAAI;AACjR"}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "useToastTitle_unstable", {
6
+ enumerable: true,
7
+ get: ()=>useToastTitle_unstable
8
+ });
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _reactIcons = require("@fluentui/react-icons");
12
+ const _reactUtilities = require("@fluentui/react-utilities");
13
+ const _reactSharedContexts = require("@fluentui/react-shared-contexts");
14
+ const _toastContainerContext = require("../../contexts/toastContainerContext");
15
+ const useToastTitle_unstable = (props, ref)=>{
16
+ const { intent , titleId } = (0, _toastContainerContext.useToastContainerContext)();
17
+ const backgroundAppearance = (0, _reactSharedContexts.useBackgroundAppearance)();
18
+ /** Determine the role and media to render based on the intent */ let defaultIcon;
19
+ switch(intent){
20
+ case 'success':
21
+ defaultIcon = /*#__PURE__*/ _react.createElement(_reactIcons.CheckmarkCircleFilled, null);
22
+ break;
23
+ case 'error':
24
+ defaultIcon = /*#__PURE__*/ _react.createElement(_reactIcons.DismissCircleFilled, null);
25
+ break;
26
+ case 'warning':
27
+ defaultIcon = /*#__PURE__*/ _react.createElement(_reactIcons.WarningFilled, null);
28
+ break;
29
+ case 'info':
30
+ defaultIcon = /*#__PURE__*/ _react.createElement(_reactIcons.InfoFilled, null);
31
+ break;
32
+ }
33
+ return {
34
+ action: (0, _reactUtilities.resolveShorthand)(props.action),
35
+ components: {
36
+ root: 'div',
37
+ media: 'div',
38
+ action: 'div'
39
+ },
40
+ media: (0, _reactUtilities.resolveShorthand)(props.media, {
41
+ required: !!intent,
42
+ defaultProps: {
43
+ children: defaultIcon
44
+ }
45
+ }),
46
+ root: (0, _reactUtilities.getNativeElementProps)('div', {
47
+ ref,
48
+ children: props.children,
49
+ id: titleId,
50
+ ...props
51
+ }),
52
+ intent,
53
+ backgroundAppearance
54
+ };
55
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useToastTitle.js"],"sourcesContent":["import * as React from 'react';\nimport { CheckmarkCircleFilled, DismissCircleFilled, InfoFilled, WarningFilled } from '@fluentui/react-icons';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport { useBackgroundAppearance } from '@fluentui/react-shared-contexts';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\n/**\n * Create the state required to render ToastTitle.\n *\n * The returned state can be modified with hooks such as useToastTitleStyles_unstable,\n * before being passed to renderToastTitle_unstable.\n *\n * @param props - props from this instance of ToastTitle\n * @param ref - reference to root HTMLElement of ToastTitle\n */ export const useToastTitle_unstable = (props, ref)=>{\n const { intent , titleId } = useToastContainerContext();\n const backgroundAppearance = useBackgroundAppearance();\n /** Determine the role and media to render based on the intent */ let defaultIcon;\n switch(intent){\n case 'success':\n defaultIcon = /*#__PURE__*/ React.createElement(CheckmarkCircleFilled, null);\n break;\n case 'error':\n defaultIcon = /*#__PURE__*/ React.createElement(DismissCircleFilled, null);\n break;\n case 'warning':\n defaultIcon = /*#__PURE__*/ React.createElement(WarningFilled, null);\n break;\n case 'info':\n defaultIcon = /*#__PURE__*/ React.createElement(InfoFilled, null);\n break;\n }\n return {\n action: resolveShorthand(props.action),\n components: {\n root: 'div',\n media: 'div',\n action: 'div'\n },\n media: resolveShorthand(props.media, {\n required: !!intent,\n defaultProps: {\n children: defaultIcon\n }\n }),\n root: getNativeElementProps('div', {\n ref,\n children: props.children,\n id: titleId,\n ...props\n }),\n intent,\n backgroundAppearance\n };\n};\n"],"names":["useToastTitle_unstable","props","ref","intent","titleId","useToastContainerContext","backgroundAppearance","useBackgroundAppearance","defaultIcon","React","createElement","CheckmarkCircleFilled","DismissCircleFilled","WarningFilled","InfoFilled","action","resolveShorthand","components","root","media","required","defaultProps","children","getNativeElementProps","id"],"mappings":";;;;+BAaiBA;;aAAAA;;;6DAbM;4BAC+D;gCAC9B;qCAChB;uCACC;AAS9B,MAAMA,yBAAyB,CAACC,OAAOC,MAAM;IACpD,MAAM,EAAEC,OAAM,EAAGC,QAAO,EAAG,GAAGC,IAAAA,+CAAwB;IACtD,MAAMC,uBAAuBC,IAAAA,4CAAuB;IACpD,+DAA+D,GAAG,IAAIC;IACtE,OAAOL;QACH,KAAK;YACDK,cAAc,WAAW,GAAGC,OAAMC,aAAa,CAACC,iCAAqB,EAAE,IAAI;YAC3E,KAAM;QACV,KAAK;YACDH,cAAc,WAAW,GAAGC,OAAMC,aAAa,CAACE,+BAAmB,EAAE,IAAI;YACzE,KAAM;QACV,KAAK;YACDJ,cAAc,WAAW,GAAGC,OAAMC,aAAa,CAACG,yBAAa,EAAE,IAAI;YACnE,KAAM;QACV,KAAK;YACDL,cAAc,WAAW,GAAGC,OAAMC,aAAa,CAACI,sBAAU,EAAE,IAAI;YAChE,KAAM;IACd;IACA,OAAO;QACHC,QAAQC,IAAAA,gCAAgB,EAACf,MAAMc,MAAM;QACrCE,YAAY;YACRC,MAAM;YACNC,OAAO;YACPJ,QAAQ;QACZ;QACAI,OAAOH,IAAAA,gCAAgB,EAACf,MAAMkB,KAAK,EAAE;YACjCC,UAAU,CAAC,CAACjB;YACZkB,cAAc;gBACVC,UAAUd;YACd;QACJ;QACAU,MAAMK,IAAAA,qCAAqB,EAAC,OAAO;YAC/BrB;YACAoB,UAAUrB,MAAMqB,QAAQ;YACxBE,IAAIpB;YACJ,GAAGH,KAAK;QACZ;QACAE;QACAG;IACJ;AACJ"}
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ toastTitleClassNames: ()=>toastTitleClassNames,
13
+ useToastTitleStyles_unstable: ()=>useToastTitleStyles_unstable
14
+ });
15
+ const _react = require("@griffel/react");
16
+ const toastTitleClassNames = {
17
+ root: 'fui-ToastTitle',
18
+ media: 'fui-ToastTitle__media',
19
+ action: 'fui-ToastTitle__action'
20
+ };
21
+ const useRootBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("r1mlor6q", null, [
22
+ ".r1mlor6q{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-grid-column-span:3;grid-column-end:3;color:var(--colorNeutralForeground1);}"
23
+ ]);
24
+ const useMediaBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("rnm72z1", "rzj6g76", [
25
+ ".rnm72z1{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-grid-column-span:2;grid-column-end:2;padding-right:8px;font-size:16px;color:var(--colorNeutralForeground1);}",
26
+ ".rzj6g76{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-grid-column-span:2;grid-column-end:2;padding-left:8px;font-size:16px;color:var(--colorNeutralForeground1);}"
27
+ ]);
28
+ const useActionBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("r5vrc68", "rzqb88z", [
29
+ ".r5vrc68{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-left:12px;-ms-grid-column-span:-1;grid-column-end:-1;color:var(--colorBrandForeground1);}",
30
+ ".rzqb88z{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-right:12px;-ms-grid-column-span:-1;grid-column-end:-1;color:var(--colorBrandForeground1);}"
31
+ ]);
32
+ const useInvertedStyles = /*#__PURE__*/ (0, _react["__styles"])({
33
+ root: {
34
+ sj55zd: "f1w7i9ko"
35
+ },
36
+ action: {
37
+ sj55zd: "f1qz2gb0"
38
+ },
39
+ media: {
40
+ sj55zd: "fqpbvvt"
41
+ }
42
+ }, {
43
+ d: [
44
+ ".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}",
45
+ ".f1qz2gb0{color:var(--colorBrandForegroundInverted);}",
46
+ ".fqpbvvt{color:var(--colorNeutralForegroundInverted);}"
47
+ ]
48
+ });
49
+ const useIntentIconStyles = /*#__PURE__*/ (0, _react["__styles"])({
50
+ success: {
51
+ sj55zd: "f1m7fhi8"
52
+ },
53
+ error: {
54
+ sj55zd: "fg9gses"
55
+ },
56
+ warning: {
57
+ sj55zd: "f1k5f75o"
58
+ },
59
+ info: {
60
+ sj55zd: "fkfq4zb"
61
+ }
62
+ }, {
63
+ d: [
64
+ ".f1m7fhi8{color:var(--colorPaletteGreenForeground3);}",
65
+ ".fg9gses{color:var(--colorPaletteCranberryForeground2);}",
66
+ ".f1k5f75o{color:var(--colorPaletteDarkOrangeForeground1);}",
67
+ ".fkfq4zb{color:var(--colorNeutralForeground2);}"
68
+ ]
69
+ });
70
+ const useIntentIconStylesInverted = /*#__PURE__*/ (0, _react["__styles"])({
71
+ success: {
72
+ sj55zd: "f1pvjcpr"
73
+ },
74
+ error: {
75
+ sj55zd: "fcrp5ll"
76
+ },
77
+ warning: {
78
+ sj55zd: "f1r8f1cl"
79
+ },
80
+ info: {
81
+ sj55zd: "f1w7i9ko"
82
+ }
83
+ }, {
84
+ d: [
85
+ ".f1pvjcpr{color:var(--colorPaletteGreenForegroundInverted);}",
86
+ ".fcrp5ll{color:var(--colorPaletteRedForegroundInverted);}",
87
+ ".f1r8f1cl{color:var(--colorPaletteYellowForegroundInverted);}",
88
+ ".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}"
89
+ ]
90
+ });
91
+ const useToastTitleStyles_unstable = (state)=>{
92
+ const rootBaseClassName = useRootBaseClassName();
93
+ const actionBaseClassName = useActionBaseClassName();
94
+ const mediaBaseClassName = useMediaBaseClassName();
95
+ const intentIconStyles = useIntentIconStyles();
96
+ const intentIconStylesInverted = useIntentIconStylesInverted();
97
+ const { intent } = state;
98
+ const invertedStyles = useInvertedStyles();
99
+ state.root.className = (0, _react.mergeClasses)(toastTitleClassNames.root, rootBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.root, state.root.className);
100
+ if (state.media) {
101
+ state.media.className = (0, _react.mergeClasses)(toastTitleClassNames.media, mediaBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.media, state.media.className, intent && intentIconStyles[intent], intent && state.backgroundAppearance === 'inverted' && intentIconStylesInverted[intent]);
102
+ }
103
+ if (state.action) {
104
+ state.action.className = (0, _react.mergeClasses)(toastTitleClassNames.action, actionBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.action, state.action.className);
105
+ }
106
+ return state;
107
+ }; //# sourceMappingURL=useToastTitleStyles.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useToastTitleStyles.styles.js"],"sourcesContent":["import { __styles, __resetStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const toastTitleClassNames = {\n root: 'fui-ToastTitle',\n media: 'fui-ToastTitle__media',\n action: 'fui-ToastTitle__action'\n};\nconst useRootBaseClassName = /*#__PURE__*/__resetStyles(\"r1mlor6q\", null, [\".r1mlor6q{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-grid-column-span:3;grid-column-end:3;color:var(--colorNeutralForeground1);}\"]);\nconst useMediaBaseClassName = /*#__PURE__*/__resetStyles(\"rnm72z1\", \"rzj6g76\", [\".rnm72z1{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-grid-column-span:2;grid-column-end:2;padding-right:8px;font-size:16px;color:var(--colorNeutralForeground1);}\", \".rzj6g76{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-grid-column-span:2;grid-column-end:2;padding-left:8px;font-size:16px;color:var(--colorNeutralForeground1);}\"]);\nconst useActionBaseClassName = /*#__PURE__*/__resetStyles(\"r5vrc68\", \"rzqb88z\", [\".r5vrc68{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-left:12px;-ms-grid-column-span:-1;grid-column-end:-1;color:var(--colorBrandForeground1);}\", \".rzqb88z{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-right:12px;-ms-grid-column-span:-1;grid-column-end:-1;color:var(--colorBrandForeground1);}\"]);\nconst useInvertedStyles = /*#__PURE__*/__styles({\n root: {\n sj55zd: \"f1w7i9ko\"\n },\n action: {\n sj55zd: \"f1qz2gb0\"\n },\n media: {\n sj55zd: \"fqpbvvt\"\n }\n}, {\n d: [\".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}\", \".f1qz2gb0{color:var(--colorBrandForegroundInverted);}\", \".fqpbvvt{color:var(--colorNeutralForegroundInverted);}\"]\n});\nconst useIntentIconStyles = /*#__PURE__*/__styles({\n success: {\n sj55zd: \"f1m7fhi8\"\n },\n error: {\n sj55zd: \"fg9gses\"\n },\n warning: {\n sj55zd: \"f1k5f75o\"\n },\n info: {\n sj55zd: \"fkfq4zb\"\n }\n}, {\n d: [\".f1m7fhi8{color:var(--colorPaletteGreenForeground3);}\", \".fg9gses{color:var(--colorPaletteCranberryForeground2);}\", \".f1k5f75o{color:var(--colorPaletteDarkOrangeForeground1);}\", \".fkfq4zb{color:var(--colorNeutralForeground2);}\"]\n});\nconst useIntentIconStylesInverted = /*#__PURE__*/__styles({\n success: {\n sj55zd: \"f1pvjcpr\"\n },\n error: {\n sj55zd: \"fcrp5ll\"\n },\n warning: {\n sj55zd: \"f1r8f1cl\"\n },\n info: {\n sj55zd: \"f1w7i9ko\"\n }\n}, {\n d: [\".f1pvjcpr{color:var(--colorPaletteGreenForegroundInverted);}\", \".fcrp5ll{color:var(--colorPaletteRedForegroundInverted);}\", \".f1r8f1cl{color:var(--colorPaletteYellowForegroundInverted);}\", \".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}\"]\n});\n/**\n * Apply styling to the ToastTitle slots based on the state\n */\nexport const useToastTitleStyles_unstable = state => {\n const rootBaseClassName = useRootBaseClassName();\n const actionBaseClassName = useActionBaseClassName();\n const mediaBaseClassName = useMediaBaseClassName();\n const intentIconStyles = useIntentIconStyles();\n const intentIconStylesInverted = useIntentIconStylesInverted();\n const {\n intent\n } = state;\n const invertedStyles = useInvertedStyles();\n state.root.className = mergeClasses(toastTitleClassNames.root, rootBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.root, state.root.className);\n if (state.media) {\n state.media.className = mergeClasses(toastTitleClassNames.media, mediaBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.media, state.media.className, intent && intentIconStyles[intent], intent && state.backgroundAppearance === 'inverted' && intentIconStylesInverted[intent]);\n }\n if (state.action) {\n state.action.className = mergeClasses(toastTitleClassNames.action, actionBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.action, state.action.className);\n }\n return state;\n};\n//# sourceMappingURL=useToastTitleStyles.styles.js.map"],"names":["toastTitleClassNames","useToastTitleStyles_unstable","root","media","action","useRootBaseClassName","__resetStyles","useMediaBaseClassName","useActionBaseClassName","useInvertedStyles","__styles","sj55zd","d","useIntentIconStyles","success","error","warning","info","useIntentIconStylesInverted","state","rootBaseClassName","actionBaseClassName","mediaBaseClassName","intentIconStyles","intentIconStylesInverted","intent","invertedStyles","className","mergeClasses","backgroundAppearance"],"mappings":";;;;;;;;;;;IAEaA,oBAAoB,MAApBA;IAwDAC,4BAA4B,MAA5BA;;uBA1DyC;AAE/C,MAAMD,uBAAuB;IAClCE,MAAM;IACNC,OAAO;IACPC,QAAQ;AACV;AACA,MAAMC,uBAAuB,WAAW,GAAEC,IAAAA,uBAAa,EAAC,YAAY,IAAI,EAAE;IAAC;CAAmQ;AAC9U,MAAMC,wBAAwB,WAAW,GAAED,IAAAA,uBAAa,EAAC,WAAW,WAAW;IAAC;IAAoS;CAAkS;AACtpB,MAAME,yBAAyB,WAAW,GAAEF,IAAAA,uBAAa,EAAC,WAAW,WAAW;IAAC;IAAqR;CAAqR;AAC3nB,MAAMG,oBAAoB,WAAW,GAAEC,IAAAA,kBAAQ,EAAC;IAC9CR,MAAM;QACJS,QAAQ;IACV;IACAP,QAAQ;QACNO,QAAQ;IACV;IACAR,OAAO;QACLQ,QAAQ;IACV;AACF,GAAG;IACDC,GAAG;QAAC;QAA4D;QAAyD;KAAyD;AACpL;AACA,MAAMC,sBAAsB,WAAW,GAAEH,IAAAA,kBAAQ,EAAC;IAChDI,SAAS;QACPH,QAAQ;IACV;IACAI,OAAO;QACLJ,QAAQ;IACV;IACAK,SAAS;QACPL,QAAQ;IACV;IACAM,MAAM;QACJN,QAAQ;IACV;AACF,GAAG;IACDC,GAAG;QAAC;QAAyD;QAA4D;QAA8D;KAAkD;AAC3O;AACA,MAAMM,8BAA8B,WAAW,GAAER,IAAAA,kBAAQ,EAAC;IACxDI,SAAS;QACPH,QAAQ;IACV;IACAI,OAAO;QACLJ,QAAQ;IACV;IACAK,SAAS;QACPL,QAAQ;IACV;IACAM,MAAM;QACJN,QAAQ;IACV;AACF,GAAG;IACDC,GAAG;QAAC;QAAgE;QAA6D;QAAiE;KAA2D;AAC/P;AAIO,MAAMX,+BAA+BkB,CAAAA,QAAS;IACnD,MAAMC,oBAAoBf;IAC1B,MAAMgB,sBAAsBb;IAC5B,MAAMc,qBAAqBf;IAC3B,MAAMgB,mBAAmBV;IACzB,MAAMW,2BAA2BN;IACjC,MAAM,EACJO,OAAM,EACP,GAAGN;IACJ,MAAMO,iBAAiBjB;IACvBU,MAAMjB,IAAI,CAACyB,SAAS,GAAGC,IAAAA,mBAAY,EAAC5B,qBAAqBE,IAAI,EAAEkB,mBAAmBD,MAAMU,oBAAoB,KAAK,cAAcH,eAAexB,IAAI,EAAEiB,MAAMjB,IAAI,CAACyB,SAAS;IACxK,IAAIR,MAAMhB,KAAK,EAAE;QACfgB,MAAMhB,KAAK,CAACwB,SAAS,GAAGC,IAAAA,mBAAY,EAAC5B,qBAAqBG,KAAK,EAAEmB,oBAAoBH,MAAMU,oBAAoB,KAAK,cAAcH,eAAevB,KAAK,EAAEgB,MAAMhB,KAAK,CAACwB,SAAS,EAAEF,UAAUF,gBAAgB,CAACE,OAAO,EAAEA,UAAUN,MAAMU,oBAAoB,KAAK,cAAcL,wBAAwB,CAACC,OAAO;IAC5S,CAAC;IACD,IAAIN,MAAMf,MAAM,EAAE;QAChBe,MAAMf,MAAM,CAACuB,SAAS,GAAGC,IAAAA,mBAAY,EAAC5B,qBAAqBI,MAAM,EAAEiB,qBAAqBF,MAAMU,oBAAoB,KAAK,cAAcH,eAAetB,MAAM,EAAEe,MAAMf,MAAM,CAACuB,SAAS;IACpL,CAAC;IACD,OAAOR;AACT,GACA,sDAAsD"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "ToastTrigger", {
6
+ enumerable: true,
7
+ get: ()=>ToastTrigger
8
+ });
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _useToastTrigger = require("./useToastTrigger");
12
+ const _renderToastTrigger = require("./renderToastTrigger");
13
+ const ToastTrigger = (props)=>{
14
+ const state = (0, _useToastTrigger.useToastTrigger_unstable)(props);
15
+ return (0, _renderToastTrigger.renderToastTrigger_unstable)(state);
16
+ };
17
+ ToastTrigger.displayName = 'ToastTrigger';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["ToastTrigger.js"],"sourcesContent":["import * as React from 'react';\nimport { useToastTrigger_unstable } from './useToastTrigger';\nimport { renderToastTrigger_unstable } from './renderToastTrigger';\n/**\n * ToastTrigger component\n */ export const ToastTrigger = (props)=>{\n const state = useToastTrigger_unstable(props);\n return renderToastTrigger_unstable(state);\n};\nToastTrigger.displayName = 'ToastTrigger';\n"],"names":["ToastTrigger","props","state","useToastTrigger_unstable","renderToastTrigger_unstable","displayName"],"mappings":";;;;+BAKiBA;;aAAAA;;;6DALM;iCACkB;oCACG;AAGjC,MAAMA,eAAe,CAACC,QAAQ;IACrC,MAAMC,QAAQC,IAAAA,yCAAwB,EAACF;IACvC,OAAOG,IAAAA,+CAA2B,EAACF;AACvC;AACAF,aAAaK,WAAW,GAAG"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
6
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["ToastTrigger.types.js"],"sourcesContent":["import * as React from 'react';\n"],"names":[],"mappings":";;;;;6DAAuB"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./ToastTrigger"), exports);
7
+ _exportStar(require("./ToastTrigger.types"), exports);
8
+ _exportStar(require("./renderToastTrigger"), exports);
9
+ _exportStar(require("./useToastTrigger"), exports);
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export * from './ToastTrigger';\nexport * from './ToastTrigger.types';\nexport * from './renderToastTrigger';\nexport * from './useToastTrigger';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Render the final JSX of MenuTrigger
3
+ *
4
+ * Only renders children
5
+ */ "use strict";
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ Object.defineProperty(exports, "renderToastTrigger_unstable", {
10
+ enumerable: true,
11
+ get: ()=>renderToastTrigger_unstable
12
+ });
13
+ const renderToastTrigger_unstable = (state)=>state.children;
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["renderToastTrigger.js"],"sourcesContent":["/**\n * Render the final JSX of MenuTrigger\n *\n * Only renders children\n */ export const renderToastTrigger_unstable = (state)=>state.children;\n"],"names":["renderToastTrigger_unstable","state","children"],"mappings":"AAAA;;;;CAIC;;;;+BAAgBA;;aAAAA;;AAAN,MAAMA,8BAA8B,CAACC,QAAQA,MAAMC,QAAQ"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "useToastTrigger_unstable", {
6
+ enumerable: true,
7
+ get: ()=>useToastTrigger_unstable
8
+ });
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _reactUtilities = require("@fluentui/react-utilities");
12
+ const _reactAria = require("@fluentui/react-aria");
13
+ const _toastContainerContext = require("../../contexts/toastContainerContext");
14
+ const useToastTrigger_unstable = (props)=>{
15
+ const { children , disableButtonEnhancement =false } = props;
16
+ const { close } = (0, _toastContainerContext.useToastContainerContext)();
17
+ const child = (0, _reactUtilities.getTriggerChild)(children);
18
+ const handleClick = (0, _reactUtilities.useEventCallback)((e)=>{
19
+ var _child_props, _child_props_onClick;
20
+ (_child_props_onClick = (_child_props = child === null || child === void 0 ? void 0 : child.props).onClick) === null || _child_props_onClick === void 0 ? void 0 : _child_props_onClick.call(_child_props, e);
21
+ if (!e.isDefaultPrevented()) {
22
+ close();
23
+ }
24
+ });
25
+ const triggerChildProps = {
26
+ ...child === null || child === void 0 ? void 0 : child.props,
27
+ ref: child === null || child === void 0 ? void 0 : child.ref,
28
+ onClick: handleClick
29
+ };
30
+ const ariaButtonTriggerChildProps = (0, _reactAria.useARIAButtonProps)((child === null || child === void 0 ? void 0 : child.type) === 'button' || (child === null || child === void 0 ? void 0 : child.type) === 'a' ? child.type : 'div', {
31
+ ...triggerChildProps,
32
+ type: 'button'
33
+ });
34
+ return {
35
+ children: (0, _reactUtilities.applyTriggerPropsToChildren)(children, disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps)
36
+ };
37
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useToastTrigger.js"],"sourcesContent":["import * as React from 'react';\nimport { applyTriggerPropsToChildren, getTriggerChild, useEventCallback } from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\n/**\n * A non-visual component that wraps its child\n * and configures them to be the trigger that will close a `Toast`.\n * This component should only accept one child.\n *\n * This component sole purpose is to avoid opting out of the internal controlled open state of a `Toast`\n * Besides being a trigger that closes a toast through context this component doesn't do much,\n * making it basically unnecessary in cases where the trigger is outside of a toast.\n */ export const useToastTrigger_unstable = (props)=>{\n const { children , disableButtonEnhancement =false } = props;\n const { close } = useToastContainerContext();\n const child = getTriggerChild(children);\n const handleClick = useEventCallback((e)=>{\n var _child_props, _child_props_onClick;\n (_child_props_onClick = (_child_props = child === null || child === void 0 ? void 0 : child.props).onClick) === null || _child_props_onClick === void 0 ? void 0 : _child_props_onClick.call(_child_props, e);\n if (!e.isDefaultPrevented()) {\n close();\n }\n });\n const triggerChildProps = {\n ...child === null || child === void 0 ? void 0 : child.props,\n ref: child === null || child === void 0 ? void 0 : child.ref,\n onClick: handleClick\n };\n const ariaButtonTriggerChildProps = useARIAButtonProps((child === null || child === void 0 ? void 0 : child.type) === 'button' || (child === null || child === void 0 ? void 0 : child.type) === 'a' ? child.type : 'div', {\n ...triggerChildProps,\n type: 'button'\n });\n return {\n children: applyTriggerPropsToChildren(children, disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps)\n };\n};\n"],"names":["useToastTrigger_unstable","props","children","disableButtonEnhancement","close","useToastContainerContext","child","getTriggerChild","handleClick","useEventCallback","e","_child_props","_child_props_onClick","onClick","call","isDefaultPrevented","triggerChildProps","ref","ariaButtonTriggerChildProps","useARIAButtonProps","type","applyTriggerPropsToChildren"],"mappings":";;;;+BAYiBA;;aAAAA;;;6DAZM;gCACwD;2BAC5C;uCACM;AAS9B,MAAMA,2BAA2B,CAACC,QAAQ;IACjD,MAAM,EAAEC,SAAQ,EAAGC,0BAA0B,KAAK,CAAA,EAAG,GAAGF;IACxD,MAAM,EAAEG,MAAK,EAAG,GAAGC,IAAAA,+CAAwB;IAC3C,MAAMC,QAAQC,IAAAA,+BAAe,EAACL;IAC9B,MAAMM,cAAcC,IAAAA,gCAAgB,EAAC,CAACC,IAAI;QACtC,IAAIC,cAAcC;QACjBA,CAAAA,uBAAuB,AAACD,CAAAA,eAAeL,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAML,KAAK,AAAD,EAAGY,OAAO,AAAD,MAAO,IAAI,IAAID,yBAAyB,KAAK,IAAI,KAAK,IAAIA,qBAAqBE,IAAI,CAACH,cAAcD,EAAE;QAC7M,IAAI,CAACA,EAAEK,kBAAkB,IAAI;YACzBX;QACJ,CAAC;IACL;IACA,MAAMY,oBAAoB;QACtB,GAAGV,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAML,KAAK;QAC5DgB,KAAKX,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMW,GAAG;QAC5DJ,SAASL;IACb;IACA,MAAMU,8BAA8BC,IAAAA,6BAAkB,EAAC,AAACb,CAAAA,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMc,IAAI,AAAD,MAAO,YAAY,AAACd,CAAAA,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMc,IAAI,AAAD,MAAO,MAAMd,MAAMc,IAAI,GAAG,KAAK,EAAE;QACvN,GAAGJ,iBAAiB;QACpBI,MAAM;IACV;IACA,OAAO;QACHlB,UAAUmB,IAAAA,2CAA2B,EAACnB,UAAUC,2BAA2Ba,oBAAoBE,2BAA2B;IAC9H;AACJ"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "Toaster", {
6
+ enumerable: true,
7
+ get: ()=>Toaster
8
+ });
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _useToaster = require("./useToaster");
12
+ const _renderToaster = require("./renderToaster");
13
+ const _useToasterStylesStyles = require("./useToasterStyles.styles");
14
+ const Toaster = (props)=>{
15
+ const state = (0, _useToaster.useToaster_unstable)(props);
16
+ (0, _useToasterStylesStyles.useToasterStyles_unstable)(state);
17
+ return (0, _renderToaster.renderToaster_unstable)(state);
18
+ };
19
+ Toaster.displayName = 'Toaster';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Toaster.js"],"sourcesContent":["import * as React from 'react';\nimport { useToaster_unstable } from './useToaster';\nimport { renderToaster_unstable } from './renderToaster';\nimport { useToasterStyles_unstable } from './useToasterStyles.styles';\n/**\n * Toaster component - renders a collection of toasts dispatched imperatively\n */ export const Toaster = (props)=>{\n const state = useToaster_unstable(props);\n useToasterStyles_unstable(state);\n return renderToaster_unstable(state);\n};\nToaster.displayName = 'Toaster';\n"],"names":["Toaster","props","state","useToaster_unstable","useToasterStyles_unstable","renderToaster_unstable","displayName"],"mappings":";;;;+BAMiBA;;aAAAA;;;6DANM;4BACa;+BACG;wCACG;AAG/B,MAAMA,UAAU,CAACC,QAAQ;IAChC,MAAMC,QAAQC,IAAAA,+BAAmB,EAACF;IAClCG,IAAAA,iDAAyB,EAACF;IAC1B,OAAOG,IAAAA,qCAAsB,EAACH;AAClC;AACAF,QAAQM,WAAW,GAAG"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./Toaster"), exports);
7
+ _exportStar(require("./Toaster.types"), exports);
8
+ _exportStar(require("./renderToaster"), exports);
9
+ _exportStar(require("./useToaster"), exports);
10
+ _exportStar(require("./useToasterStyles.styles"), exports);
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export * from './Toaster';\nexport * from './Toaster.types';\nexport * from './renderToaster';\nexport * from './useToaster';\nexport * from './useToasterStyles.styles';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA"}
@@ -0,0 +1,20 @@
1
+ /** @jsxRuntime classic */ /** @jsxFrag Fragment */ /** @jsx createElement */ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "renderToaster_unstable", {
6
+ enumerable: true,
7
+ get: ()=>renderToaster_unstable
8
+ });
9
+ const _reactJsxRuntime = require("@fluentui/react-jsx-runtime");
10
+ const _reactUtilities = require("@fluentui/react-utilities");
11
+ const _reactPortal = require("@fluentui/react-portal");
12
+ const _ariaLive = require("../AriaLive");
13
+ const renderToaster_unstable = (state)=>{
14
+ const { announceRef , renderAriaLive } = state;
15
+ const { slots , slotProps } = (0, _reactUtilities.getSlotsNext)(state);
16
+ const hasToasts = !!slots.bottomStart || !!slots.bottomEnd || !!slots.topStart || !!slots.topEnd;
17
+ return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(_reactJsxRuntime.Fragment, null, renderAriaLive ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(_ariaLive.AriaLive, {
18
+ announceRef: announceRef
19
+ }) : null, hasToasts ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(_reactPortal.Portal, null, slots.bottomStart ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.bottomStart, slotProps.bottomStart) : null, slots.bottomEnd ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.bottomEnd, slotProps.bottomEnd) : null, slots.topStart ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.topStart, slotProps.topStart) : null, slots.topEnd ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.topEnd, slotProps.topEnd) : null) : null);
20
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["renderToaster.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsxFrag Fragment */ /** @jsx createElement */ import { createElement, Fragment } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\nimport { Portal } from '@fluentui/react-portal';\nimport { AriaLive } from '../AriaLive';\n/**\n * Render the final JSX of Toaster\n */ export const renderToaster_unstable = (state)=>{\n const { announceRef , renderAriaLive } = state;\n const { slots , slotProps } = getSlotsNext(state);\n const hasToasts = !!slots.bottomStart || !!slots.bottomEnd || !!slots.topStart || !!slots.topEnd;\n return /*#__PURE__*/ createElement(Fragment, null, renderAriaLive ? /*#__PURE__*/ createElement(AriaLive, {\n announceRef: announceRef\n }) : null, hasToasts ? /*#__PURE__*/ createElement(Portal, null, slots.bottomStart ? /*#__PURE__*/ createElement(slots.bottomStart, slotProps.bottomStart) : null, slots.bottomEnd ? /*#__PURE__*/ createElement(slots.bottomEnd, slotProps.bottomEnd) : null, slots.topStart ? /*#__PURE__*/ createElement(slots.topStart, slotProps.topStart) : null, slots.topEnd ? /*#__PURE__*/ createElement(slots.topEnd, slotProps.topEnd) : null) : null);\n};\n"],"names":["renderToaster_unstable","state","announceRef","renderAriaLive","slots","slotProps","getSlotsNext","hasToasts","bottomStart","bottomEnd","topStart","topEnd","createElement","Fragment","AriaLive","Portal"],"mappings":"AAAA,wBAAwB,GAAG,sBAAsB,GAAG,uBAAuB;;;;+BAM1DA;;aAAAA;;iCANqG;gCACzF;6BACN;0BACE;AAGd,MAAMA,yBAAyB,CAACC,QAAQ;IAC/C,MAAM,EAAEC,YAAW,EAAGC,eAAc,EAAG,GAAGF;IAC1C,MAAM,EAAEG,MAAK,EAAGC,UAAS,EAAG,GAAGC,IAAAA,4BAAY,EAACL;IAC5C,MAAMM,YAAY,CAAC,CAACH,MAAMI,WAAW,IAAI,CAAC,CAACJ,MAAMK,SAAS,IAAI,CAAC,CAACL,MAAMM,QAAQ,IAAI,CAAC,CAACN,MAAMO,MAAM;IAChG,OAAO,WAAW,GAAGC,IAAAA,8BAAa,EAACC,yBAAQ,EAAE,IAAI,EAAEV,iBAAiB,WAAW,GAAGS,IAAAA,8BAAa,EAACE,kBAAQ,EAAE;QACtGZ,aAAaA;IACjB,KAAK,IAAI,EAAEK,YAAY,WAAW,GAAGK,IAAAA,8BAAa,EAACG,mBAAM,EAAE,IAAI,EAAEX,MAAMI,WAAW,GAAG,WAAW,GAAGI,IAAAA,8BAAa,EAACR,MAAMI,WAAW,EAAEH,UAAUG,WAAW,IAAI,IAAI,EAAEJ,MAAMK,SAAS,GAAG,WAAW,GAAGG,IAAAA,8BAAa,EAACR,MAAMK,SAAS,EAAEJ,UAAUI,SAAS,IAAI,IAAI,EAAEL,MAAMM,QAAQ,GAAG,WAAW,GAAGE,IAAAA,8BAAa,EAACR,MAAMM,QAAQ,EAAEL,UAAUK,QAAQ,IAAI,IAAI,EAAEN,MAAMO,MAAM,GAAG,WAAW,GAAGC,IAAAA,8BAAa,EAACR,MAAMO,MAAM,EAAEN,UAAUM,MAAM,IAAI,IAAI,IAAI,IAAI;AACrb"}
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "useToaster_unstable", {
6
+ enumerable: true,
7
+ get: ()=>useToaster_unstable
8
+ });
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _reactUtilities = require("@fluentui/react-utilities");
12
+ const _reactSharedContexts = require("@fluentui/react-shared-contexts");
13
+ const _state = require("../../state");
14
+ const _toastContainer = require("../ToastContainer");
15
+ const useToaster_unstable = (props)=>{
16
+ const { offset , announce: announceProp , ...rest } = props;
17
+ const announceRef = _react.useRef(()=>null);
18
+ const { toastsToRender , isToastVisible , pauseAllToasts , playAllToasts , tryRestoreFocus } = (0, _state.useToaster)(rest);
19
+ const announce = _react.useCallback((message, options)=>announceRef.current(message, options), []);
20
+ const { dir } = (0, _reactSharedContexts.useFluent_unstable)();
21
+ const rootProps = (0, _reactUtilities.getNativeElementProps)('div', rest);
22
+ // Adds native HTML focusin/focusout listeners
23
+ // https://github.com/facebook/react/issues/25194
24
+ const focusListenerRef = _react.useCallback((el)=>{
25
+ if (el) {
26
+ el.addEventListener('focusin', (e)=>{
27
+ if ((0, _reactUtilities.isHTMLElement)(e.currentTarget) && !e.currentTarget.contains((0, _reactUtilities.isHTMLElement)(e.relatedTarget) ? e.relatedTarget : null)) {
28
+ pauseAllToasts();
29
+ }
30
+ });
31
+ el.addEventListener('focusout', (e)=>{
32
+ if ((0, _reactUtilities.isHTMLElement)(e.currentTarget) && !e.currentTarget.contains((0, _reactUtilities.isHTMLElement)(e.relatedTarget) ? e.relatedTarget : null)) {
33
+ playAllToasts();
34
+ tryRestoreFocus();
35
+ }
36
+ });
37
+ }
38
+ }, [
39
+ playAllToasts,
40
+ pauseAllToasts,
41
+ tryRestoreFocus
42
+ ]);
43
+ const createPositionSlot = (toastPosition)=>{
44
+ var _toastsToRender_get;
45
+ return (0, _reactUtilities.resolveShorthand)(toastsToRender.has(toastPosition) ? rootProps : null, {
46
+ defaultProps: {
47
+ ref: focusListenerRef,
48
+ children: (_toastsToRender_get = toastsToRender.get(toastPosition)) === null || _toastsToRender_get === void 0 ? void 0 : _toastsToRender_get.map((toast)=>/*#__PURE__*/ _react.createElement(_toastContainer.ToastContainer, {
49
+ ...toast,
50
+ tryRestoreFocus: tryRestoreFocus,
51
+ intent: toast.intent,
52
+ announce: announce,
53
+ key: toast.toastId,
54
+ visible: isToastVisible(toast.toastId)
55
+ }, toast.content)),
56
+ 'data-toaster-position': toastPosition
57
+ }
58
+ });
59
+ };
60
+ return {
61
+ dir,
62
+ components: {
63
+ root: 'div',
64
+ bottomStart: 'div',
65
+ bottomEnd: 'div',
66
+ topStart: 'div',
67
+ topEnd: 'div'
68
+ },
69
+ root: (0, _reactUtilities.resolveShorthand)(rootProps, {
70
+ required: true
71
+ }),
72
+ bottomStart: createPositionSlot(_state.TOAST_POSITIONS.bottomStart),
73
+ bottomEnd: createPositionSlot(_state.TOAST_POSITIONS.bottomEnd),
74
+ topStart: createPositionSlot(_state.TOAST_POSITIONS.topStart),
75
+ topEnd: createPositionSlot(_state.TOAST_POSITIONS.topEnd),
76
+ announceRef,
77
+ offset,
78
+ announce: announceProp !== null && announceProp !== void 0 ? announceProp : announce,
79
+ renderAriaLive: !announceProp
80
+ };
81
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useToaster.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, isHTMLElement, resolveShorthand } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { TOAST_POSITIONS, useToaster } from '../../state';\nimport { ToastContainer } from '../ToastContainer';\n/**\n * Create the state required to render Toaster.\n *\n * @param props - props from this instance of Toaster\n */ export const useToaster_unstable = (props)=>{\n const { offset , announce: announceProp , ...rest } = props;\n const announceRef = React.useRef(()=>null);\n const { toastsToRender , isToastVisible , pauseAllToasts , playAllToasts , tryRestoreFocus } = useToaster(rest);\n const announce = React.useCallback((message, options)=>announceRef.current(message, options), []);\n const { dir } = useFluent();\n const rootProps = getNativeElementProps('div', rest);\n // Adds native HTML focusin/focusout listeners\n // https://github.com/facebook/react/issues/25194\n const focusListenerRef = React.useCallback((el)=>{\n if (el) {\n el.addEventListener('focusin', (e)=>{\n if (isHTMLElement(e.currentTarget) && !e.currentTarget.contains(isHTMLElement(e.relatedTarget) ? e.relatedTarget : null)) {\n pauseAllToasts();\n }\n });\n el.addEventListener('focusout', (e)=>{\n if (isHTMLElement(e.currentTarget) && !e.currentTarget.contains(isHTMLElement(e.relatedTarget) ? e.relatedTarget : null)) {\n playAllToasts();\n tryRestoreFocus();\n }\n });\n }\n }, [\n playAllToasts,\n pauseAllToasts,\n tryRestoreFocus\n ]);\n const createPositionSlot = (toastPosition)=>{\n var _toastsToRender_get;\n return resolveShorthand(toastsToRender.has(toastPosition) ? rootProps : null, {\n defaultProps: {\n ref: focusListenerRef,\n children: (_toastsToRender_get = toastsToRender.get(toastPosition)) === null || _toastsToRender_get === void 0 ? void 0 : _toastsToRender_get.map((toast)=>/*#__PURE__*/ React.createElement(ToastContainer, {\n ...toast,\n tryRestoreFocus: tryRestoreFocus,\n intent: toast.intent,\n announce: announce,\n key: toast.toastId,\n visible: isToastVisible(toast.toastId)\n }, toast.content)),\n 'data-toaster-position': toastPosition\n }\n });\n };\n return {\n dir,\n components: {\n root: 'div',\n bottomStart: 'div',\n bottomEnd: 'div',\n topStart: 'div',\n topEnd: 'div'\n },\n root: resolveShorthand(rootProps, {\n required: true\n }),\n bottomStart: createPositionSlot(TOAST_POSITIONS.bottomStart),\n bottomEnd: createPositionSlot(TOAST_POSITIONS.bottomEnd),\n topStart: createPositionSlot(TOAST_POSITIONS.topStart),\n topEnd: createPositionSlot(TOAST_POSITIONS.topEnd),\n announceRef,\n offset,\n announce: announceProp !== null && announceProp !== void 0 ? announceProp : announce,\n renderAriaLive: !announceProp\n };\n};\n"],"names":["useToaster_unstable","props","offset","announce","announceProp","rest","announceRef","React","useRef","toastsToRender","isToastVisible","pauseAllToasts","playAllToasts","tryRestoreFocus","useToaster","useCallback","message","options","current","dir","useFluent","rootProps","getNativeElementProps","focusListenerRef","el","addEventListener","e","isHTMLElement","currentTarget","contains","relatedTarget","createPositionSlot","toastPosition","_toastsToRender_get","resolveShorthand","has","defaultProps","ref","children","get","map","toast","createElement","ToastContainer","intent","key","toastId","visible","content","components","root","bottomStart","bottomEnd","topStart","topEnd","required","TOAST_POSITIONS","renderAriaLive"],"mappings":";;;;+BASiBA;;aAAAA;;;6DATM;gCACgD;qCACvB;uBACJ;gCACb;AAKpB,MAAMA,sBAAsB,CAACC,QAAQ;IAC5C,MAAM,EAAEC,OAAM,EAAGC,UAAUC,aAAY,EAAG,GAAGC,MAAM,GAAGJ;IACtD,MAAMK,cAAcC,OAAMC,MAAM,CAAC,IAAI,IAAI;IACzC,MAAM,EAAEC,eAAc,EAAGC,eAAc,EAAGC,eAAc,EAAGC,cAAa,EAAGC,gBAAe,EAAG,GAAGC,IAAAA,iBAAU,EAACT;IAC3G,MAAMF,WAAWI,OAAMQ,WAAW,CAAC,CAACC,SAASC,UAAUX,YAAYY,OAAO,CAACF,SAASC,UAAU,EAAE;IAChG,MAAM,EAAEE,IAAG,EAAG,GAAGC,IAAAA,uCAAS;IAC1B,MAAMC,YAAYC,IAAAA,qCAAqB,EAAC,OAAOjB;IAC/C,8CAA8C;IAC9C,iDAAiD;IACjD,MAAMkB,mBAAmBhB,OAAMQ,WAAW,CAAC,CAACS,KAAK;QAC7C,IAAIA,IAAI;YACJA,GAAGC,gBAAgB,CAAC,WAAW,CAACC,IAAI;gBAChC,IAAIC,IAAAA,6BAAa,EAACD,EAAEE,aAAa,KAAK,CAACF,EAAEE,aAAa,CAACC,QAAQ,CAACF,IAAAA,6BAAa,EAACD,EAAEI,aAAa,IAAIJ,EAAEI,aAAa,GAAG,IAAI,GAAG;oBACtHnB;gBACJ,CAAC;YACL;YACAa,GAAGC,gBAAgB,CAAC,YAAY,CAACC,IAAI;gBACjC,IAAIC,IAAAA,6BAAa,EAACD,EAAEE,aAAa,KAAK,CAACF,EAAEE,aAAa,CAACC,QAAQ,CAACF,IAAAA,6BAAa,EAACD,EAAEI,aAAa,IAAIJ,EAAEI,aAAa,GAAG,IAAI,GAAG;oBACtHlB;oBACAC;gBACJ,CAAC;YACL;QACJ,CAAC;IACL,GAAG;QACCD;QACAD;QACAE;KACH;IACD,MAAMkB,qBAAqB,CAACC,gBAAgB;QACxC,IAAIC;QACJ,OAAOC,IAAAA,gCAAgB,EAACzB,eAAe0B,GAAG,CAACH,iBAAiBX,YAAY,IAAI,EAAE;YAC1Ee,cAAc;gBACVC,KAAKd;gBACLe,UAAU,AAACL,CAAAA,sBAAsBxB,eAAe8B,GAAG,CAACP,cAAa,MAAO,IAAI,IAAIC,wBAAwB,KAAK,IAAI,KAAK,IAAIA,oBAAoBO,GAAG,CAAC,CAACC,QAAQ,WAAW,GAAGlC,OAAMmC,aAAa,CAACC,8BAAc,EAAE;wBACrM,GAAGF,KAAK;wBACR5B,iBAAiBA;wBACjB+B,QAAQH,MAAMG,MAAM;wBACpBzC,UAAUA;wBACV0C,KAAKJ,MAAMK,OAAO;wBAClBC,SAASrC,eAAe+B,MAAMK,OAAO;oBACzC,GAAGL,MAAMO,OAAO,EAAE;gBACtB,yBAAyBhB;YAC7B;QACJ;IACJ;IACA,OAAO;QACHb;QACA8B,YAAY;YACRC,MAAM;YACNC,aAAa;YACbC,WAAW;YACXC,UAAU;YACVC,QAAQ;QACZ;QACAJ,MAAMhB,IAAAA,gCAAgB,EAACb,WAAW;YAC9BkC,UAAU,IAAI;QAClB;QACAJ,aAAapB,mBAAmByB,sBAAe,CAACL,WAAW;QAC3DC,WAAWrB,mBAAmByB,sBAAe,CAACJ,SAAS;QACvDC,UAAUtB,mBAAmByB,sBAAe,CAACH,QAAQ;QACrDC,QAAQvB,mBAAmByB,sBAAe,CAACF,MAAM;QACjDhD;QACAJ;QACAC,UAAUC,iBAAiB,IAAI,IAAIA,iBAAiB,KAAK,IAAIA,eAAeD,QAAQ;QACpFsD,gBAAgB,CAACrD;IACrB;AACJ"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ toasterClassNames: ()=>toasterClassNames,
13
+ useToasterStyles_unstable: ()=>useToasterStyles_unstable
14
+ });
15
+ const _react = require("@griffel/react");
16
+ const _index = require("../../state/index");
17
+ var _state_bottomStart, _state_bottomEnd, _state_topStart, _state_topEnd;
18
+ const toasterClassNames = {
19
+ root: 'fui-Toaster'
20
+ };
21
+ /**
22
+ * Styles for the root slot
23
+ */ const useRootBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("r3hfdjz", null, [
24
+ ".r3hfdjz{position:fixed;width:292px;pointer-events:none;}"
25
+ ]);
26
+ const useToasterStyles_unstable = (state)=>{
27
+ const rootBaseClassName = useRootBaseClassName();
28
+ const className = (0, _react.mergeClasses)(toasterClassNames.root, rootBaseClassName, state.root.className);
29
+ if (state.bottomStart) {
30
+ state.bottomStart.className = className;
31
+ var _style;
32
+ (_style = (_state_bottomStart = state.bottomStart).style) !== null && _style !== void 0 ? _style : _state_bottomStart.style = {};
33
+ Object.assign(state.bottomStart.style, (0, _index.getPositionStyles)(_index.TOAST_POSITIONS.bottomStart, state.dir, state.offset));
34
+ }
35
+ if (state.bottomEnd) {
36
+ state.bottomEnd.className = className;
37
+ var _style1;
38
+ (_style1 = (_state_bottomEnd = state.bottomEnd).style) !== null && _style1 !== void 0 ? _style1 : _state_bottomEnd.style = {};
39
+ Object.assign(state.bottomEnd.style, (0, _index.getPositionStyles)(_index.TOAST_POSITIONS.bottomEnd, state.dir, state.offset));
40
+ }
41
+ if (state.topStart) {
42
+ state.topStart.className = className;
43
+ var _style2;
44
+ (_style2 = (_state_topStart = state.topStart).style) !== null && _style2 !== void 0 ? _style2 : _state_topStart.style = {};
45
+ Object.assign(state.topStart.style, (0, _index.getPositionStyles)(_index.TOAST_POSITIONS.topStart, state.dir, state.offset));
46
+ }
47
+ if (state.topEnd) {
48
+ state.topEnd.className = className;
49
+ var _style3;
50
+ (_style3 = (_state_topEnd = state.topEnd).style) !== null && _style3 !== void 0 ? _style3 : _state_topEnd.style = {};
51
+ Object.assign(state.topEnd.style, (0, _index.getPositionStyles)(_index.TOAST_POSITIONS.topEnd, state.dir, state.offset));
52
+ }
53
+ return state;
54
+ }; //# sourceMappingURL=useToasterStyles.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useToasterStyles.styles.js"],"sourcesContent":["var _state_bottomStart, _state_bottomEnd, _state_topStart, _state_topEnd;\nimport { __resetStyles, 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 */\nconst useRootBaseClassName = /*#__PURE__*/__resetStyles(\"r3hfdjz\", null, [\".r3hfdjz{position:fixed;width:292px;pointer-events:none;}\"]);\n/**\n * Apply styling to the Toaster slots based on the state\n */\nexport const useToasterStyles_unstable = state => {\n const rootBaseClassName = useRootBaseClassName();\n const className = mergeClasses(toasterClassNames.root, rootBaseClassName, state.root.className);\n if (state.bottomStart) {\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 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 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 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 return state;\n};\n//# sourceMappingURL=useToasterStyles.styles.js.map"],"names":["toasterClassNames","useToasterStyles_unstable","_state_bottomStart","_state_bottomEnd","_state_topStart","_state_topEnd","root","useRootBaseClassName","__resetStyles","state","rootBaseClassName","className","mergeClasses","bottomStart","_style","style","Object","assign","getPositionStyles","TOAST_POSITIONS","dir","offset","bottomEnd","_style1","topStart","_style2","topEnd","_style3"],"mappings":";;;;;;;;;;;IAGaA,iBAAiB,MAAjBA;IAUAC,yBAAyB,MAAzBA;;uBAZ+B;uBACO;AAFnD,IAAIC,oBAAoBC,kBAAkBC,iBAAiBC;AAGpD,MAAML,oBAAoB;IAC/BM,MAAM;AACR;AACA;;CAEC,GACD,MAAMC,uBAAuB,WAAW,GAAEC,IAAAA,uBAAa,EAAC,WAAW,IAAI,EAAE;IAAC;CAA4D;AAI/H,MAAMP,4BAA4BQ,CAAAA,QAAS;IAChD,MAAMC,oBAAoBH;IAC1B,MAAMI,YAAYC,IAAAA,mBAAY,EAACZ,kBAAkBM,IAAI,EAAEI,mBAAmBD,MAAMH,IAAI,CAACK,SAAS;IAC9F,IAAIF,MAAMI,WAAW,EAAE;QACrBJ,MAAMI,WAAW,CAACF,SAAS,GAAGA;QAC9B,IAAIG;QACHA,CAAAA,SAAS,AAACZ,CAAAA,qBAAqBO,MAAMI,WAAW,AAAD,EAAGE,KAAK,AAAD,MAAO,IAAI,IAAID,WAAW,KAAK,IAAIA,SAASZ,mBAAmBa,KAAK,GAAG,CAAC,CAAC;QAChIC,OAAOC,MAAM,CAACR,MAAMI,WAAW,CAACE,KAAK,EAAEG,IAAAA,wBAAiB,EAACC,sBAAe,CAACN,WAAW,EAAEJ,MAAMW,GAAG,EAAEX,MAAMY,MAAM;IAC/G,CAAC;IACD,IAAIZ,MAAMa,SAAS,EAAE;QACnBb,MAAMa,SAAS,CAACX,SAAS,GAAGA;QAC5B,IAAIY;QACHA,CAAAA,UAAU,AAACpB,CAAAA,mBAAmBM,MAAMa,SAAS,AAAD,EAAGP,KAAK,AAAD,MAAO,IAAI,IAAIQ,YAAY,KAAK,IAAIA,UAAUpB,iBAAiBY,KAAK,GAAG,CAAC,CAAC;QAC7HC,OAAOC,MAAM,CAACR,MAAMa,SAAS,CAACP,KAAK,EAAEG,IAAAA,wBAAiB,EAACC,sBAAe,CAACG,SAAS,EAAEb,MAAMW,GAAG,EAAEX,MAAMY,MAAM;IAC3G,CAAC;IACD,IAAIZ,MAAMe,QAAQ,EAAE;QAClBf,MAAMe,QAAQ,CAACb,SAAS,GAAGA;QAC3B,IAAIc;QACHA,CAAAA,UAAU,AAACrB,CAAAA,kBAAkBK,MAAMe,QAAQ,AAAD,EAAGT,KAAK,AAAD,MAAO,IAAI,IAAIU,YAAY,KAAK,IAAIA,UAAUrB,gBAAgBW,KAAK,GAAG,CAAC,CAAC;QAC1HC,OAAOC,MAAM,CAACR,MAAMe,QAAQ,CAACT,KAAK,EAAEG,IAAAA,wBAAiB,EAACC,sBAAe,CAACK,QAAQ,EAAEf,MAAMW,GAAG,EAAEX,MAAMY,MAAM;IACzG,CAAC;IACD,IAAIZ,MAAMiB,MAAM,EAAE;QAChBjB,MAAMiB,MAAM,CAACf,SAAS,GAAGA;QACzB,IAAIgB;QACHA,CAAAA,UAAU,AAACtB,CAAAA,gBAAgBI,MAAMiB,MAAM,AAAD,EAAGX,KAAK,AAAD,MAAO,IAAI,IAAIY,YAAY,KAAK,IAAIA,UAAUtB,cAAcU,KAAK,GAAG,CAAC,CAAC;QACpHC,OAAOC,MAAM,CAACR,MAAMiB,MAAM,CAACX,KAAK,EAAEG,IAAAA,wBAAiB,EAACC,sBAAe,CAACO,MAAM,EAAEjB,MAAMW,GAAG,EAAEX,MAAMY,MAAM;IACrG,CAAC;IACD,OAAOZ;AACT,GACA,mDAAmD"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ ToastContainerContextProvider: ()=>ToastContainerContextProvider,
13
+ useToastContainerContext: ()=>useToastContainerContext
14
+ });
15
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
16
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
17
+ const toastContainerContextDefaultValue = {
18
+ close: ()=>null,
19
+ intent: undefined,
20
+ bodyId: '',
21
+ titleId: ''
22
+ };
23
+ const ToastContainerContext = /*#__PURE__*/ _react.createContext(undefined);
24
+ const ToastContainerContextProvider = ToastContainerContext.Provider;
25
+ var _React_useContext;
26
+ const useToastContainerContext = ()=>(_React_useContext = _react.useContext(ToastContainerContext)) !== null && _React_useContext !== void 0 ? _React_useContext : toastContainerContextDefaultValue;