@fluentui/react-toast 9.3.47 → 9.3.49

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 (187) hide show
  1. package/CHANGELOG.md +27 -2
  2. package/lib/AriaLive.js.map +1 -1
  3. package/lib/Toast.js.map +1 -1
  4. package/lib/ToastBody.js.map +1 -1
  5. package/lib/ToastContainer.js.map +1 -1
  6. package/lib/ToastFooter.js.map +1 -1
  7. package/lib/ToastTitle.js.map +1 -1
  8. package/lib/ToastTrigger.js.map +1 -1
  9. package/lib/Toaster.js.map +1 -1
  10. package/lib/components/AriaLive/AriaLive.js.map +1 -1
  11. package/lib/components/AriaLive/AriaLive.types.js.map +1 -1
  12. package/lib/components/AriaLive/index.js.map +1 -1
  13. package/lib/components/AriaLive/renderAriaLive.js.map +1 -1
  14. package/lib/components/AriaLive/useAriaLive.js.map +1 -1
  15. package/lib/components/AriaLive/useAriaLiveStyles.styles.js +2 -0
  16. package/lib/components/AriaLive/useAriaLiveStyles.styles.js.map +1 -1
  17. package/lib/components/Timer/Timer.js.map +1 -1
  18. package/lib/components/Timer/index.js.map +1 -1
  19. package/lib/components/Toast/Toast.js.map +1 -1
  20. package/lib/components/Toast/Toast.types.js +3 -1
  21. package/lib/components/Toast/Toast.types.js.map +1 -1
  22. package/lib/components/Toast/index.js.map +1 -1
  23. package/lib/components/Toast/renderToast.js.map +1 -1
  24. package/lib/components/Toast/useToast.js.map +1 -1
  25. package/lib/components/Toast/useToastContextValues.js.map +1 -1
  26. package/lib/components/Toast/useToastStyles.styles.js +2 -0
  27. package/lib/components/Toast/useToastStyles.styles.js.map +1 -1
  28. package/lib/components/ToastBody/ToastBody.js.map +1 -1
  29. package/lib/components/ToastBody/ToastBody.types.js +3 -1
  30. package/lib/components/ToastBody/ToastBody.types.js.map +1 -1
  31. package/lib/components/ToastBody/index.js.map +1 -1
  32. package/lib/components/ToastBody/renderToastBody.js.map +1 -1
  33. package/lib/components/ToastBody/useToastBody.js.map +1 -1
  34. package/lib/components/ToastBody/useToastBodyStyles.styles.js +2 -0
  35. package/lib/components/ToastBody/useToastBodyStyles.styles.js.map +1 -1
  36. package/lib/components/ToastContainer/ToastContainer.js.map +1 -1
  37. package/lib/components/ToastContainer/ToastContainer.types.js.map +1 -1
  38. package/lib/components/ToastContainer/ToastContainerMotion.js.map +1 -1
  39. package/lib/components/ToastContainer/index.js.map +1 -1
  40. package/lib/components/ToastContainer/renderToastContainer.js.map +1 -1
  41. package/lib/components/ToastContainer/useToastContainer.js.map +1 -1
  42. package/lib/components/ToastContainer/useToastContainerContextValues.js.map +1 -1
  43. package/lib/components/ToastContainer/useToastContainerStyles.styles.js +2 -0
  44. package/lib/components/ToastContainer/useToastContainerStyles.styles.js.map +1 -1
  45. package/lib/components/ToastFooter/ToastFooter.js.map +1 -1
  46. package/lib/components/ToastFooter/ToastFooter.types.js +3 -1
  47. package/lib/components/ToastFooter/ToastFooter.types.js.map +1 -1
  48. package/lib/components/ToastFooter/index.js.map +1 -1
  49. package/lib/components/ToastFooter/renderToastFooter.js.map +1 -1
  50. package/lib/components/ToastFooter/useToastFooter.js.map +1 -1
  51. package/lib/components/ToastFooter/useToastFooterStyles.styles.js +2 -0
  52. package/lib/components/ToastFooter/useToastFooterStyles.styles.js.map +1 -1
  53. package/lib/components/ToastTitle/ToastTitle.js.map +1 -1
  54. package/lib/components/ToastTitle/ToastTitle.types.js +3 -1
  55. package/lib/components/ToastTitle/ToastTitle.types.js.map +1 -1
  56. package/lib/components/ToastTitle/index.js.map +1 -1
  57. package/lib/components/ToastTitle/renderToastTitle.js.map +1 -1
  58. package/lib/components/ToastTitle/useToastTitle.js.map +1 -1
  59. package/lib/components/ToastTitle/useToastTitleStyles.styles.js +2 -0
  60. package/lib/components/ToastTitle/useToastTitleStyles.styles.js.map +1 -1
  61. package/lib/components/ToastTrigger/ToastTrigger.js.map +1 -1
  62. package/lib/components/ToastTrigger/ToastTrigger.types.js.map +1 -1
  63. package/lib/components/ToastTrigger/index.js.map +1 -1
  64. package/lib/components/ToastTrigger/renderToastTrigger.js.map +1 -1
  65. package/lib/components/ToastTrigger/useToastTrigger.js.map +1 -1
  66. package/lib/components/Toaster/Toaster.js.map +1 -1
  67. package/lib/components/Toaster/Toaster.types.js +3 -1
  68. package/lib/components/Toaster/Toaster.types.js.map +1 -1
  69. package/lib/components/Toaster/index.js.map +1 -1
  70. package/lib/components/Toaster/renderToaster.js.map +1 -1
  71. package/lib/components/Toaster/useToastAnnounce.js.map +1 -1
  72. package/lib/components/Toaster/useToaster.js +1 -0
  73. package/lib/components/Toaster/useToaster.js.map +1 -1
  74. package/lib/components/Toaster/useToasterFocusManagement.js.map +1 -1
  75. package/lib/components/Toaster/useToasterStyles.styles.js +2 -0
  76. package/lib/components/Toaster/useToasterStyles.styles.js.map +1 -1
  77. package/lib/contexts/toastContainerContext.js.map +1 -1
  78. package/lib/index.js.map +1 -1
  79. package/lib/state/constants.js.map +1 -1
  80. package/lib/state/index.js.map +1 -1
  81. package/lib/state/types.js.map +1 -1
  82. package/lib/state/useToastController.js.map +1 -1
  83. package/lib/state/useToaster.js.map +1 -1
  84. package/lib/state/vanilla/createToaster.js.map +1 -1
  85. package/lib/state/vanilla/dismissAllToasts.js.map +1 -1
  86. package/lib/state/vanilla/dismissToast.js.map +1 -1
  87. package/lib/state/vanilla/dispatchToast.js.map +1 -1
  88. package/lib/state/vanilla/getPositionStyles.js.map +1 -1
  89. package/lib/state/vanilla/index.js.map +1 -1
  90. package/lib/state/vanilla/pauseToast.js.map +1 -1
  91. package/lib/state/vanilla/playToast.js.map +1 -1
  92. package/lib/state/vanilla/updateToast.js.map +1 -1
  93. package/lib-commonjs/AriaLive.js.map +1 -1
  94. package/lib-commonjs/Toast.js.map +1 -1
  95. package/lib-commonjs/ToastBody.js.map +1 -1
  96. package/lib-commonjs/ToastContainer.js.map +1 -1
  97. package/lib-commonjs/ToastFooter.js.map +1 -1
  98. package/lib-commonjs/ToastTitle.js.map +1 -1
  99. package/lib-commonjs/ToastTrigger.js.map +1 -1
  100. package/lib-commonjs/Toaster.js.map +1 -1
  101. package/lib-commonjs/components/AriaLive/AriaLive.js.map +1 -1
  102. package/lib-commonjs/components/AriaLive/AriaLive.types.js.map +1 -1
  103. package/lib-commonjs/components/AriaLive/index.js.map +1 -1
  104. package/lib-commonjs/components/AriaLive/renderAriaLive.js.map +1 -1
  105. package/lib-commonjs/components/AriaLive/useAriaLive.js.map +1 -1
  106. package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.js +1 -0
  107. package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.js.map +1 -1
  108. package/lib-commonjs/components/Timer/Timer.js.map +1 -1
  109. package/lib-commonjs/components/Timer/index.js.map +1 -1
  110. package/lib-commonjs/components/Timer/useTimerStyles.styles.js.map +1 -1
  111. package/lib-commonjs/components/Toast/Toast.js.map +1 -1
  112. package/lib-commonjs/components/Toast/Toast.types.js +3 -1
  113. package/lib-commonjs/components/Toast/Toast.types.js.map +1 -1
  114. package/lib-commonjs/components/Toast/index.js.map +1 -1
  115. package/lib-commonjs/components/Toast/renderToast.js.map +1 -1
  116. package/lib-commonjs/components/Toast/useToast.js.map +1 -1
  117. package/lib-commonjs/components/Toast/useToastContextValues.js.map +1 -1
  118. package/lib-commonjs/components/Toast/useToastStyles.styles.js +1 -0
  119. package/lib-commonjs/components/Toast/useToastStyles.styles.js.map +1 -1
  120. package/lib-commonjs/components/ToastBody/ToastBody.js.map +1 -1
  121. package/lib-commonjs/components/ToastBody/ToastBody.types.js +3 -1
  122. package/lib-commonjs/components/ToastBody/ToastBody.types.js.map +1 -1
  123. package/lib-commonjs/components/ToastBody/index.js.map +1 -1
  124. package/lib-commonjs/components/ToastBody/renderToastBody.js.map +1 -1
  125. package/lib-commonjs/components/ToastBody/useToastBody.js.map +1 -1
  126. package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.js +1 -0
  127. package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.js.map +1 -1
  128. package/lib-commonjs/components/ToastContainer/ToastContainer.js.map +1 -1
  129. package/lib-commonjs/components/ToastContainer/ToastContainer.types.js.map +1 -1
  130. package/lib-commonjs/components/ToastContainer/ToastContainerMotion.js.map +1 -1
  131. package/lib-commonjs/components/ToastContainer/index.js.map +1 -1
  132. package/lib-commonjs/components/ToastContainer/renderToastContainer.js.map +1 -1
  133. package/lib-commonjs/components/ToastContainer/useToastContainer.js.map +1 -1
  134. package/lib-commonjs/components/ToastContainer/useToastContainerContextValues.js.map +1 -1
  135. package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.js +1 -0
  136. package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.js.map +1 -1
  137. package/lib-commonjs/components/ToastFooter/ToastFooter.js.map +1 -1
  138. package/lib-commonjs/components/ToastFooter/ToastFooter.types.js +3 -1
  139. package/lib-commonjs/components/ToastFooter/ToastFooter.types.js.map +1 -1
  140. package/lib-commonjs/components/ToastFooter/index.js.map +1 -1
  141. package/lib-commonjs/components/ToastFooter/renderToastFooter.js.map +1 -1
  142. package/lib-commonjs/components/ToastFooter/useToastFooter.js.map +1 -1
  143. package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.js +1 -0
  144. package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.js.map +1 -1
  145. package/lib-commonjs/components/ToastTitle/ToastTitle.js.map +1 -1
  146. package/lib-commonjs/components/ToastTitle/ToastTitle.types.js +3 -1
  147. package/lib-commonjs/components/ToastTitle/ToastTitle.types.js.map +1 -1
  148. package/lib-commonjs/components/ToastTitle/index.js.map +1 -1
  149. package/lib-commonjs/components/ToastTitle/renderToastTitle.js.map +1 -1
  150. package/lib-commonjs/components/ToastTitle/useToastTitle.js.map +1 -1
  151. package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.js +1 -0
  152. package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.js.map +1 -1
  153. package/lib-commonjs/components/ToastTrigger/ToastTrigger.js.map +1 -1
  154. package/lib-commonjs/components/ToastTrigger/ToastTrigger.types.js.map +1 -1
  155. package/lib-commonjs/components/ToastTrigger/index.js.map +1 -1
  156. package/lib-commonjs/components/ToastTrigger/renderToastTrigger.js.map +1 -1
  157. package/lib-commonjs/components/ToastTrigger/useToastTrigger.js.map +1 -1
  158. package/lib-commonjs/components/Toaster/Toaster.js.map +1 -1
  159. package/lib-commonjs/components/Toaster/Toaster.types.js +3 -1
  160. package/lib-commonjs/components/Toaster/Toaster.types.js.map +1 -1
  161. package/lib-commonjs/components/Toaster/index.js.map +1 -1
  162. package/lib-commonjs/components/Toaster/renderToaster.js.map +1 -1
  163. package/lib-commonjs/components/Toaster/useToastAnnounce.js.map +1 -1
  164. package/lib-commonjs/components/Toaster/useToaster.js +1 -0
  165. package/lib-commonjs/components/Toaster/useToaster.js.map +1 -1
  166. package/lib-commonjs/components/Toaster/useToasterFocusManagement.js.map +1 -1
  167. package/lib-commonjs/components/Toaster/useToasterStyles.styles.js +1 -0
  168. package/lib-commonjs/components/Toaster/useToasterStyles.styles.js.map +1 -1
  169. package/lib-commonjs/contexts/toastContainerContext.js.map +1 -1
  170. package/lib-commonjs/index.js +50 -50
  171. package/lib-commonjs/index.js.map +1 -1
  172. package/lib-commonjs/state/constants.js.map +1 -1
  173. package/lib-commonjs/state/index.js +3 -3
  174. package/lib-commonjs/state/index.js.map +1 -1
  175. package/lib-commonjs/state/types.js.map +1 -1
  176. package/lib-commonjs/state/useToastController.js.map +1 -1
  177. package/lib-commonjs/state/useToaster.js.map +1 -1
  178. package/lib-commonjs/state/vanilla/createToaster.js.map +1 -1
  179. package/lib-commonjs/state/vanilla/dismissAllToasts.js.map +1 -1
  180. package/lib-commonjs/state/vanilla/dismissToast.js.map +1 -1
  181. package/lib-commonjs/state/vanilla/dispatchToast.js.map +1 -1
  182. package/lib-commonjs/state/vanilla/getPositionStyles.js.map +1 -1
  183. package/lib-commonjs/state/vanilla/index.js.map +1 -1
  184. package/lib-commonjs/state/vanilla/pauseToast.js.map +1 -1
  185. package/lib-commonjs/state/vanilla/playToast.js.map +1 -1
  186. package/lib-commonjs/state/vanilla/updateToast.js.map +1 -1
  187. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"sources":["createToaster.ts"],"sourcesContent":["import * as React from 'react';\nimport { createPriorityQueue } from '@fluentui/react-utilities';\nimport { Toast, ToasterOptions, ToastId, ToastImperativeRef, ToastOptions, UpdateToastEventDetail } from '../types';\n\nfunction assignDefined<T extends object>(a: Partial<T>, b: Partial<T>) {\n // This cast is required, as Object.entries will return string as key which is not indexable\n for (const [key, prop] of Object.entries(b) as [keyof T, T[keyof T]][]) {\n // eslint-disable-next-line eqeqeq\n if (prop != undefined) {\n a[key] = prop;\n }\n }\n}\nconst defaulToastOptions: Pick<\n ToastOptions,\n 'priority' | 'pauseOnHover' | 'pauseOnWindowBlur' | 'position' | 'timeout' | 'politeness' | 'onStatusChange'\n> = {\n onStatusChange: undefined,\n priority: 0,\n pauseOnHover: false,\n pauseOnWindowBlur: false,\n position: 'bottom-end',\n timeout: 3000,\n};\n\n// Multiple toasts can be dispatched in a single tick, use counter to prevent collisions\nlet counter = 0;\n\n/**\n * Toast are managed outside of the react lifecycle because they can be\n * dispatched imperatively. Therefore the state of toast visibility can't\n * really be managed properly by a declarative lifecycle.\n */\nexport function createToaster(options: Partial<ToasterOptions>) {\n const { limit = Number.POSITIVE_INFINITY } = options;\n const visibleToasts = new Set<ToastId>();\n const toasts = new Map<ToastId, Toast>();\n\n const queue = createPriorityQueue<ToastId>((ta, tb) => {\n const a = toasts.get(ta);\n const b = toasts.get(tb);\n if (!a || !b) {\n return 0;\n }\n\n if (a.priority === b.priority) {\n return a.order - b.order;\n }\n\n return a.priority - b.priority;\n });\n\n const isToastVisible = (toastId: ToastId) => {\n return visibleToasts.has(toastId);\n };\n\n /**\n * Updates an existing toast with any available option\n */\n const updateToast = (toastOptions: UpdateToastEventDetail) => {\n const { toastId } = toastOptions;\n const toastToUpdate = toasts.get(toastId);\n if (!toastToUpdate) {\n return;\n }\n\n Object.assign(toastToUpdate, toastOptions);\n toastToUpdate.updateId++;\n };\n\n /**\n * Dismisses a toast with a specific id\n */\n const dismissToast = (toastId: ToastId) => {\n visibleToasts.delete(toastId);\n };\n\n /**\n * Dismisses all toasts and clears the queue\n */\n const dismissAllToasts = () => {\n visibleToasts.clear();\n queue.clear();\n };\n\n /**\n * @param toastOptions user configured options\n * @param onUpdate Some toast methods can result in UI changes (i.e. close) use this to dispatch callbacks\n */\n const buildToast = (toastOptions: Partial<ToastOptions> & { toastId: ToastId }, onUpdate: () => void) => {\n const { toastId, content, toasterId } = toastOptions;\n\n if (toasts.has(toastId)) {\n return;\n }\n\n const close = () => {\n const toast = toasts.get(toastId);\n if (!toast) {\n return;\n }\n\n visibleToasts.delete(toastId);\n onUpdate();\n toast.onStatusChange?.(null, { status: 'dismissed', ...toast });\n };\n\n const remove = () => {\n const toast = toasts.get(toastId);\n if (!toast) {\n return;\n }\n\n toasts.delete(toastId);\n\n if (visibleToasts.size < limit && queue.peek()) {\n const nextToast = toasts.get(queue.dequeue());\n if (!nextToast) {\n return;\n }\n\n visibleToasts.add(nextToast.toastId);\n }\n\n onUpdate();\n };\n\n const toast: Toast = {\n ...defaulToastOptions,\n close,\n remove,\n toastId,\n content,\n updateId: 0,\n toasterId,\n order: counter++,\n data: {},\n imperativeRef: React.createRef<ToastImperativeRef>(),\n };\n\n assignDefined(toast, options);\n assignDefined(toast, toastOptions);\n\n toasts.set(toastId, toast);\n toast.onStatusChange?.(null, { status: 'queued', ...toast });\n if (visibleToasts.size >= limit) {\n queue.enqueue(toastId);\n } else {\n visibleToasts.add(toastId);\n }\n };\n\n return {\n buildToast,\n dismissAllToasts,\n dismissToast,\n isToastVisible,\n updateToast,\n visibleToasts,\n toasts,\n };\n}\n"],"names":["React","createPriorityQueue","assignDefined","a","b","key","prop","Object","entries","undefined","defaulToastOptions","onStatusChange","priority","pauseOnHover","pauseOnWindowBlur","position","timeout","counter","createToaster","options","limit","Number","POSITIVE_INFINITY","visibleToasts","Set","toasts","Map","queue","ta","tb","get","order","isToastVisible","toastId","has","updateToast","toastOptions","toastToUpdate","assign","updateId","dismissToast","delete","dismissAllToasts","clear","buildToast","onUpdate","toast","content","toasterId","close","status","remove","size","peek","nextToast","dequeue","add","data","imperativeRef","createRef","set","enqueue"],"mappings":"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"}
1
+ {"version":3,"sources":["createToaster.ts"],"sourcesContent":["import * as React from 'react';\nimport { createPriorityQueue } from '@fluentui/react-utilities';\nimport { Toast, ToasterOptions, ToastId, ToastImperativeRef, ToastOptions, UpdateToastEventDetail } from '../types';\n\nfunction assignDefined<T extends object>(a: Partial<T>, b: Partial<T>) {\n // This cast is required, as Object.entries will return string as key which is not indexable\n for (const [key, prop] of Object.entries(b) as [keyof T, T[keyof T]][]) {\n // eslint-disable-next-line eqeqeq\n if (prop != undefined) {\n a[key] = prop;\n }\n }\n}\nconst defaulToastOptions: Pick<\n ToastOptions,\n 'priority' | 'pauseOnHover' | 'pauseOnWindowBlur' | 'position' | 'timeout' | 'politeness' | 'onStatusChange'\n> = {\n onStatusChange: undefined,\n priority: 0,\n pauseOnHover: false,\n pauseOnWindowBlur: false,\n position: 'bottom-end',\n timeout: 3000,\n};\n\n// Multiple toasts can be dispatched in a single tick, use counter to prevent collisions\nlet counter = 0;\n\n/**\n * Toast are managed outside of the react lifecycle because they can be\n * dispatched imperatively. Therefore the state of toast visibility can't\n * really be managed properly by a declarative lifecycle.\n */\nexport function createToaster(options: Partial<ToasterOptions>) {\n const { limit = Number.POSITIVE_INFINITY } = options;\n const visibleToasts = new Set<ToastId>();\n const toasts = new Map<ToastId, Toast>();\n\n const queue = createPriorityQueue<ToastId>((ta, tb) => {\n const a = toasts.get(ta);\n const b = toasts.get(tb);\n if (!a || !b) {\n return 0;\n }\n\n if (a.priority === b.priority) {\n return a.order - b.order;\n }\n\n return a.priority - b.priority;\n });\n\n const isToastVisible = (toastId: ToastId) => {\n return visibleToasts.has(toastId);\n };\n\n /**\n * Updates an existing toast with any available option\n */\n const updateToast = (toastOptions: UpdateToastEventDetail) => {\n const { toastId } = toastOptions;\n const toastToUpdate = toasts.get(toastId);\n if (!toastToUpdate) {\n return;\n }\n\n Object.assign(toastToUpdate, toastOptions);\n toastToUpdate.updateId++;\n };\n\n /**\n * Dismisses a toast with a specific id\n */\n const dismissToast = (toastId: ToastId) => {\n visibleToasts.delete(toastId);\n };\n\n /**\n * Dismisses all toasts and clears the queue\n */\n const dismissAllToasts = () => {\n visibleToasts.clear();\n queue.clear();\n };\n\n /**\n * @param toastOptions user configured options\n * @param onUpdate Some toast methods can result in UI changes (i.e. close) use this to dispatch callbacks\n */\n const buildToast = (toastOptions: Partial<ToastOptions> & { toastId: ToastId }, onUpdate: () => void) => {\n const { toastId, content, toasterId } = toastOptions;\n\n if (toasts.has(toastId)) {\n return;\n }\n\n const close = () => {\n const toast = toasts.get(toastId);\n if (!toast) {\n return;\n }\n\n visibleToasts.delete(toastId);\n onUpdate();\n toast.onStatusChange?.(null, { status: 'dismissed', ...toast });\n };\n\n const remove = () => {\n const toast = toasts.get(toastId);\n if (!toast) {\n return;\n }\n\n toasts.delete(toastId);\n\n if (visibleToasts.size < limit && queue.peek()) {\n const nextToast = toasts.get(queue.dequeue());\n if (!nextToast) {\n return;\n }\n\n visibleToasts.add(nextToast.toastId);\n }\n\n onUpdate();\n };\n\n const toast: Toast = {\n ...defaulToastOptions,\n close,\n remove,\n toastId,\n content,\n updateId: 0,\n toasterId,\n order: counter++,\n data: {},\n imperativeRef: React.createRef<ToastImperativeRef>(),\n };\n\n assignDefined(toast, options);\n assignDefined(toast, toastOptions);\n\n toasts.set(toastId, toast);\n toast.onStatusChange?.(null, { status: 'queued', ...toast });\n if (visibleToasts.size >= limit) {\n queue.enqueue(toastId);\n } else {\n visibleToasts.add(toastId);\n }\n };\n\n return {\n buildToast,\n dismissAllToasts,\n dismissToast,\n isToastVisible,\n updateToast,\n visibleToasts,\n toasts,\n };\n}\n"],"names":["React","createPriorityQueue","assignDefined","a","b","key","prop","Object","entries","undefined","defaulToastOptions","onStatusChange","priority","pauseOnHover","pauseOnWindowBlur","position","timeout","counter","createToaster","options","limit","Number","POSITIVE_INFINITY","visibleToasts","Set","toasts","Map","queue","ta","tb","get","order","isToastVisible","toastId","has","updateToast","toastOptions","toastToUpdate","assign","updateId","dismissToast","delete","dismissAllToasts","clear","buildToast","onUpdate","toast","content","toasterId","close","status","remove","size","peek","nextToast","dequeue","add","data","imperativeRef","createRef","set","enqueue"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"sources":["dismissAllToasts.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport { DismissAllToastsEventDetail, ToasterId } from '../types';\n\nexport function dismissAllToasts(toasterId: ToasterId | undefined = undefined, targetDocument: Document) {\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":["dismissAllToasts.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport { DismissAllToastsEventDetail, ToasterId } from '../types';\n\nexport function dismissAllToasts(toasterId: ToasterId | undefined = undefined, targetDocument: Document) {\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"],"rangeMappings":";;;;;;;;;;","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 +1 @@
1
- {"version":3,"sources":["dismissToast.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport { DismissToastEventDetail, ToastId, ToasterId } from '../types';\n\nexport function dismissToast(toastId: ToastId, toasterId: ToasterId | undefined = undefined, targetDocument: Document) {\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,aAAaC,OAAgB,EAAEC,YAAmCC,SAAS,EAAEC,cAAwB;IACnH,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":["dismissToast.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport { DismissToastEventDetail, ToastId, ToasterId } from '../types';\n\nexport function dismissToast(toastId: ToastId, toasterId: ToasterId | undefined = undefined, targetDocument: Document) {\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"],"rangeMappings":";;;;;;;;;;;","mappings":"AAAA,SAASA,MAAM,QAAQ,eAAe;AAGtC,OAAO,SAASC,aAAaC,OAAgB,EAAEC,YAAmCC,SAAS,EAAEC,cAAwB;IACnH,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 +1 @@
1
- {"version":3,"sources":["dispatchToast.ts"],"sourcesContent":["import { ShowToastEventDetail, ToastOptions } from '../types';\nimport { EVENTS } from '../constants';\n\nlet counter = 0;\n\nexport function dispatchToast(content: unknown, options: Partial<ToastOptions> = {}, targetDocument: Document) {\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":["dispatchToast.ts"],"sourcesContent":["import { ShowToastEventDetail, ToastOptions } from '../types';\nimport { EVENTS } from '../constants';\n\nlet counter = 0;\n\nexport function dispatchToast(content: unknown, options: Partial<ToastOptions> = {}, targetDocument: Document) {\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"],"rangeMappings":";;;;;;;;;;;;;;;","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 +1 @@
1
- {"version":3,"sources":["getPositionStyles.ts"],"sourcesContent":["import { ToastOffsetObject, ToastOffset, ToastPosition } from '../types';\n\ninterface PositionStyles {\n top?: number;\n left?: number;\n right?: number;\n bottom?: number;\n}\n\nexport const getPositionStyles = (position: ToastPosition, dir: 'rtl' | 'ltr', offset?: ToastOffset) => {\n const positionStyles: PositionStyles = {};\n\n const offsetStyles: ToastOffsetObject = offset ? (isShorthandOffset(offset) ? offset : offset[position] ?? {}) : {};\n\n const centered = position === 'top' || position === 'bottom';\n\n const { horizontal = centered ? 0 : 20, vertical = 16 } = offsetStyles;\n const start = dir === 'ltr' ? 'left' : 'right';\n const end = dir === 'ltr' ? 'right' : 'left';\n\n switch (position) {\n case 'top':\n Object.assign(positionStyles, {\n top: vertical,\n left: `calc(50% + ${horizontal}px)`,\n transform: 'translateX(-50%)',\n });\n break;\n\n case 'bottom':\n Object.assign(positionStyles, {\n bottom: vertical,\n left: `calc(50% + ${horizontal}px)`,\n transform: 'translateX(-50%)',\n });\n break;\n\n case 'top-start':\n Object.assign(positionStyles, {\n top: vertical,\n [start]: horizontal,\n });\n break;\n case 'top-end':\n Object.assign(positionStyles, {\n top: vertical,\n [end]: horizontal,\n });\n break;\n case 'bottom-start':\n Object.assign(positionStyles, {\n bottom: vertical,\n [start]: horizontal,\n });\n break;\n case 'bottom-end':\n Object.assign(positionStyles, {\n bottom: vertical,\n [end]: horizontal,\n });\n break;\n }\n\n return positionStyles;\n};\n\nfunction isShorthandOffset(offset: ToastOffset): offset is ToastOffsetObject {\n return 'horizontal' in offset || 'vertical' in offset;\n}\n"],"names":["getPositionStyles","position","dir","offset","positionStyles","offsetStyles","isShorthandOffset","centered","horizontal","vertical","start","end","Object","assign","top","left","transform","bottom"],"mappings":"AASA,OAAO,MAAMA,oBAAoB,CAACC,UAAyBC,KAAoBC;IAC7E,MAAMC,iBAAiC,CAAC;QAE+CD;IAAvF,MAAME,eAAkCF,SAAUG,kBAAkBH,UAAUA,SAASA,CAAAA,mBAAAA,MAAM,CAACF,SAAS,cAAhBE,8BAAAA,mBAAoB,CAAC,IAAK,CAAC;IAElH,MAAMI,WAAWN,aAAa,SAASA,aAAa;IAEpD,MAAM,EAAEO,aAAaD,WAAW,IAAI,EAAE,EAAEE,WAAW,EAAE,EAAE,GAAGJ;IAC1D,MAAMK,QAAQR,QAAQ,QAAQ,SAAS;IACvC,MAAMS,MAAMT,QAAQ,QAAQ,UAAU;IAEtC,OAAQD;QACN,KAAK;YACHW,OAAOC,MAAM,CAACT,gBAAgB;gBAC5BU,KAAKL;gBACLM,MAAM,CAAC,WAAW,EAAEP,WAAW,GAAG,CAAC;gBACnCQ,WAAW;YACb;YACA;QAEF,KAAK;YACHJ,OAAOC,MAAM,CAACT,gBAAgB;gBAC5Ba,QAAQR;gBACRM,MAAM,CAAC,WAAW,EAAEP,WAAW,GAAG,CAAC;gBACnCQ,WAAW;YACb;YACA;QAEF,KAAK;YACHJ,OAAOC,MAAM,CAACT,gBAAgB;gBAC5BU,KAAKL;gBACL,CAACC,MAAM,EAAEF;YACX;YACA;QACF,KAAK;YACHI,OAAOC,MAAM,CAACT,gBAAgB;gBAC5BU,KAAKL;gBACL,CAACE,IAAI,EAAEH;YACT;YACA;QACF,KAAK;YACHI,OAAOC,MAAM,CAACT,gBAAgB;gBAC5Ba,QAAQR;gBACR,CAACC,MAAM,EAAEF;YACX;YACA;QACF,KAAK;YACHI,OAAOC,MAAM,CAACT,gBAAgB;gBAC5Ba,QAAQR;gBACR,CAACE,IAAI,EAAEH;YACT;YACA;IACJ;IAEA,OAAOJ;AACT,EAAE;AAEF,SAASE,kBAAkBH,MAAmB;IAC5C,OAAO,gBAAgBA,UAAU,cAAcA;AACjD"}
1
+ {"version":3,"sources":["getPositionStyles.ts"],"sourcesContent":["import { ToastOffsetObject, ToastOffset, ToastPosition } from '../types';\n\ninterface PositionStyles {\n top?: number;\n left?: number;\n right?: number;\n bottom?: number;\n}\n\nexport const getPositionStyles = (position: ToastPosition, dir: 'rtl' | 'ltr', offset?: ToastOffset) => {\n const positionStyles: PositionStyles = {};\n\n const offsetStyles: ToastOffsetObject = offset ? (isShorthandOffset(offset) ? offset : offset[position] ?? {}) : {};\n\n const centered = position === 'top' || position === 'bottom';\n\n const { horizontal = centered ? 0 : 20, vertical = 16 } = offsetStyles;\n const start = dir === 'ltr' ? 'left' : 'right';\n const end = dir === 'ltr' ? 'right' : 'left';\n\n switch (position) {\n case 'top':\n Object.assign(positionStyles, {\n top: vertical,\n left: `calc(50% + ${horizontal}px)`,\n transform: 'translateX(-50%)',\n });\n break;\n\n case 'bottom':\n Object.assign(positionStyles, {\n bottom: vertical,\n left: `calc(50% + ${horizontal}px)`,\n transform: 'translateX(-50%)',\n });\n break;\n\n case 'top-start':\n Object.assign(positionStyles, {\n top: vertical,\n [start]: horizontal,\n });\n break;\n case 'top-end':\n Object.assign(positionStyles, {\n top: vertical,\n [end]: horizontal,\n });\n break;\n case 'bottom-start':\n Object.assign(positionStyles, {\n bottom: vertical,\n [start]: horizontal,\n });\n break;\n case 'bottom-end':\n Object.assign(positionStyles, {\n bottom: vertical,\n [end]: horizontal,\n });\n break;\n }\n\n return positionStyles;\n};\n\nfunction isShorthandOffset(offset: ToastOffset): offset is ToastOffsetObject {\n return 'horizontal' in offset || 'vertical' in offset;\n}\n"],"names":["getPositionStyles","position","dir","offset","positionStyles","offsetStyles","isShorthandOffset","centered","horizontal","vertical","start","end","Object","assign","top","left","transform","bottom"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AASA,OAAO,MAAMA,oBAAoB,CAACC,UAAyBC,KAAoBC;IAC7E,MAAMC,iBAAiC,CAAC;QAE+CD;IAAvF,MAAME,eAAkCF,SAAUG,kBAAkBH,UAAUA,SAASA,CAAAA,mBAAAA,MAAM,CAACF,SAAS,cAAhBE,8BAAAA,mBAAoB,CAAC,IAAK,CAAC;IAElH,MAAMI,WAAWN,aAAa,SAASA,aAAa;IAEpD,MAAM,EAAEO,aAAaD,WAAW,IAAI,EAAE,EAAEE,WAAW,EAAE,EAAE,GAAGJ;IAC1D,MAAMK,QAAQR,QAAQ,QAAQ,SAAS;IACvC,MAAMS,MAAMT,QAAQ,QAAQ,UAAU;IAEtC,OAAQD;QACN,KAAK;YACHW,OAAOC,MAAM,CAACT,gBAAgB;gBAC5BU,KAAKL;gBACLM,MAAM,CAAC,WAAW,EAAEP,WAAW,GAAG,CAAC;gBACnCQ,WAAW;YACb;YACA;QAEF,KAAK;YACHJ,OAAOC,MAAM,CAACT,gBAAgB;gBAC5Ba,QAAQR;gBACRM,MAAM,CAAC,WAAW,EAAEP,WAAW,GAAG,CAAC;gBACnCQ,WAAW;YACb;YACA;QAEF,KAAK;YACHJ,OAAOC,MAAM,CAACT,gBAAgB;gBAC5BU,KAAKL;gBACL,CAACC,MAAM,EAAEF;YACX;YACA;QACF,KAAK;YACHI,OAAOC,MAAM,CAACT,gBAAgB;gBAC5BU,KAAKL;gBACL,CAACE,IAAI,EAAEH;YACT;YACA;QACF,KAAK;YACHI,OAAOC,MAAM,CAACT,gBAAgB;gBAC5Ba,QAAQR;gBACR,CAACC,MAAM,EAAEF;YACX;YACA;QACF,KAAK;YACHI,OAAOC,MAAM,CAACT,gBAAgB;gBAC5Ba,QAAQR;gBACR,CAACE,IAAI,EAAEH;YACT;YACA;IACJ;IAEA,OAAOJ;AACT,EAAE;AAEF,SAASE,kBAAkBH,MAAmB;IAC5C,OAAO,gBAAgBA,UAAU,cAAcA;AACjD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './dispatchToast';\nexport * from './dismissToast';\nexport * from './dismissAllToasts';\nexport * from './updateToast';\nexport * from './pauseToast';\nexport * from './playToast';\nexport * from './createToaster';\nexport * from './getPositionStyles';\n"],"names":[],"mappings":"AAAA,cAAc,kBAAkB;AAChC,cAAc,iBAAiB;AAC/B,cAAc,qBAAqB;AACnC,cAAc,gBAAgB;AAC9B,cAAc,eAAe;AAC7B,cAAc,cAAc;AAC5B,cAAc,kBAAkB;AAChC,cAAc,sBAAsB"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './dispatchToast';\nexport * from './dismissToast';\nexport * from './dismissAllToasts';\nexport * from './updateToast';\nexport * from './pauseToast';\nexport * from './playToast';\nexport * from './createToaster';\nexport * from './getPositionStyles';\n"],"names":[],"rangeMappings":";;;;;;;","mappings":"AAAA,cAAc,kBAAkB;AAChC,cAAc,iBAAiB;AAC/B,cAAc,qBAAqB;AACnC,cAAc,gBAAgB;AAC9B,cAAc,eAAe;AAC7B,cAAc,cAAc;AAC5B,cAAc,kBAAkB;AAChC,cAAc,sBAAsB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["pauseToast.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport { PauseToastEventDetail, ToastId, ToasterId } from '../types';\n\nexport function pauseToast(toastId: ToastId, toasterId: ToasterId | undefined = undefined, targetDocument: Document) {\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,WAAWC,OAAgB,EAAEC,YAAmCC,SAAS,EAAEC,cAAwB;IACjH,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":["pauseToast.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport { PauseToastEventDetail, ToastId, ToasterId } from '../types';\n\nexport function pauseToast(toastId: ToastId, toasterId: ToasterId | undefined = undefined, targetDocument: Document) {\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"],"rangeMappings":";;;;;;;;;;;","mappings":"AAAA,SAASA,MAAM,QAAQ,eAAe;AAGtC,OAAO,SAASC,WAAWC,OAAgB,EAAEC,YAAmCC,SAAS,EAAEC,cAAwB;IACjH,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 +1 @@
1
- {"version":3,"sources":["playToast.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport { PlayToastEventDetail, ToastId, ToasterId } from '../types';\n\nexport function playToast(toastId: ToastId, toasterId: ToasterId | undefined = undefined, targetDocument: Document) {\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,UAAUC,OAAgB,EAAEC,YAAmCC,SAAS,EAAEC,cAAwB;IAChH,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":["playToast.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport { PlayToastEventDetail, ToastId, ToasterId } from '../types';\n\nexport function playToast(toastId: ToastId, toasterId: ToasterId | undefined = undefined, targetDocument: Document) {\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"],"rangeMappings":";;;;;;;;;;;","mappings":"AAAA,SAASA,MAAM,QAAQ,eAAe;AAGtC,OAAO,SAASC,UAAUC,OAAgB,EAAEC,YAAmCC,SAAS,EAAEC,cAAwB;IAChH,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 +1 @@
1
- {"version":3,"sources":["updateToast.ts"],"sourcesContent":["import { UpdateToastEventDetail } from '../types';\nimport { EVENTS } from '../constants';\n\nexport function updateToast(options: UpdateToastEventDetail, targetDocument: Document) {\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":["updateToast.ts"],"sourcesContent":["import { UpdateToastEventDetail } from '../types';\nimport { EVENTS } from '../constants';\n\nexport function updateToast(options: UpdateToastEventDetail, targetDocument: Document) {\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"],"rangeMappings":";;;;;;;;","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 +1 @@
1
- {"version":3,"sources":["AriaLive.js"],"sourcesContent":["export * from './components/AriaLive/index';\n"],"names":[],"mappings":";;;;;uBAAc"}
1
+ {"version":3,"sources":["AriaLive.ts"],"sourcesContent":["export * from './components/AriaLive/index';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
@@ -1 +1 @@
1
- {"version":3,"sources":["Toast.js"],"sourcesContent":["export * from './components/Toast/index';\n"],"names":[],"mappings":";;;;;uBAAc"}
1
+ {"version":3,"sources":["Toast.ts"],"sourcesContent":["export * from './components/Toast/index';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
@@ -1 +1 @@
1
- {"version":3,"sources":["ToastBody.js"],"sourcesContent":["export * from './components/ToastBody/index';\n"],"names":[],"mappings":";;;;;uBAAc"}
1
+ {"version":3,"sources":["ToastBody.ts"],"sourcesContent":["export * from './components/ToastBody/index';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
@@ -1 +1 @@
1
- {"version":3,"sources":["ToastContainer.js"],"sourcesContent":["export * from './components/ToastContainer/index';\n"],"names":[],"mappings":";;;;;uBAAc"}
1
+ {"version":3,"sources":["ToastContainer.ts"],"sourcesContent":["export * from './components/ToastContainer/index';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
@@ -1 +1 @@
1
- {"version":3,"sources":["ToastFooter.js"],"sourcesContent":["export * from './components/ToastFooter/index';\n"],"names":[],"mappings":";;;;;uBAAc"}
1
+ {"version":3,"sources":["ToastFooter.ts"],"sourcesContent":["export * from './components/ToastFooter/index';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
@@ -1 +1 @@
1
- {"version":3,"sources":["ToastTitle.js"],"sourcesContent":["export * from './components/ToastTitle/index';\n"],"names":[],"mappings":";;;;;uBAAc"}
1
+ {"version":3,"sources":["ToastTitle.ts"],"sourcesContent":["export * from './components/ToastTitle/index';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
@@ -1 +1 @@
1
- {"version":3,"sources":["ToastTrigger.js"],"sourcesContent":["export * from './components/ToastTrigger/index';\n"],"names":[],"mappings":";;;;;uBAAc"}
1
+ {"version":3,"sources":["ToastTrigger.ts"],"sourcesContent":["export * from './components/ToastTrigger/index';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
@@ -1 +1 @@
1
- {"version":3,"sources":["Toaster.js"],"sourcesContent":["export * from './components/Toaster/index';\n"],"names":[],"mappings":";;;;;uBAAc"}
1
+ {"version":3,"sources":["Toaster.ts"],"sourcesContent":["export * from './components/Toaster/index';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
@@ -1 +1 @@
1
- {"version":3,"sources":["AriaLive.js"],"sourcesContent":["import * as React from 'react';\nimport { useAriaLive_unstable } from './useAriaLive';\nimport { renderAriaLive_unstable } from './renderAriaLive';\nimport { useAriaLiveStyles_unstable } from './useAriaLiveStyles.styles';\n/**\n * A component that manages aria live announcements imperatively\n */ export const AriaLive = (props)=>{\n const state = useAriaLive_unstable(props);\n useAriaLiveStyles_unstable(state);\n return renderAriaLive_unstable(state);\n};\nAriaLive.displayName = 'AriaLive';\n"],"names":["AriaLive","props","state","useAriaLive_unstable","useAriaLiveStyles_unstable","renderAriaLive_unstable","displayName"],"mappings":";;;;+BAMiBA;;;eAAAA;;;;iEANM;6BACc;gCACG;yCACG;AAGhC,MAAMA,WAAW,CAACC;IACzB,MAAMC,QAAQC,IAAAA,iCAAoB,EAACF;IACnCG,IAAAA,mDAA0B,EAACF;IAC3B,OAAOG,IAAAA,uCAAuB,EAACH;AACnC;AACAF,SAASM,WAAW,GAAG"}
1
+ {"version":3,"sources":["AriaLive.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAriaLive_unstable } from './useAriaLive';\nimport { renderAriaLive_unstable } from './renderAriaLive';\nimport { useAriaLiveStyles_unstable } from './useAriaLiveStyles.styles';\nimport type { AriaLiveProps } from './AriaLive.types';\n\n/**\n * A component that manages aria live announcements imperatively\n */\nexport const AriaLive: React.FC<AriaLiveProps> = props => {\n const state = useAriaLive_unstable(props);\n\n useAriaLiveStyles_unstable(state);\n return renderAriaLive_unstable(state);\n};\n\nAriaLive.displayName = 'AriaLive';\n"],"names":["AriaLive","props","state","useAriaLive_unstable","useAriaLiveStyles_unstable","renderAriaLive_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;;iEATU;6BACc;gCACG;yCACG;AAMpC,MAAMA,WAAoCC,CAAAA;IAC/C,MAAMC,QAAQC,IAAAA,iCAAAA,EAAqBF;IAEnCG,IAAAA,mDAAAA,EAA2BF;IAC3B,OAAOG,IAAAA,uCAAAA,EAAwBH;AACjC;AAEAF,SAASM,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["AriaLive.types.js"],"sourcesContent":["import * as React from 'react';\n"],"names":[],"mappings":";;;;;iEAAuB"}
1
+ {"version":3,"sources":["AriaLive.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type AriaLiveSlots = {\n assertive: NonNullable<Slot<'div'>>;\n polite: NonNullable<Slot<'div'>>;\n};\n\nexport type AriaLivePoliteness = 'polite' | 'assertive';\n\n/**\n * AriaLive Props\n */\nexport type AriaLiveProps = ComponentProps<Partial<AriaLiveSlots>> & {\n announceRef: React.Ref<Announce>;\n};\n\n/**\n * State used in rendering AriaLive\n */\nexport type AriaLiveState = ComponentState<AriaLiveSlots>;\n\nexport type Announce = (message: string, options: AnnounceOptions) => void;\n\nexport type LiveMessage = {\n message: string;\n createdAt: number;\n politeness: AriaLivePoliteness;\n};\n\nexport type AnnounceOptions = {\n politeness: AriaLivePoliteness;\n};\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './AriaLive';\nexport * from './AriaLive.types';\nexport * from './renderAriaLive';\nexport * from './useAriaLive';\nexport * from './useAriaLiveStyles.styles';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './AriaLive';\nexport * from './AriaLive.types';\nexport * from './renderAriaLive';\nexport * from './useAriaLive';\nexport * from './useAriaLiveStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["renderAriaLive.js"],"sourcesContent":[" import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of AriaLive\n */ export const renderAriaLive_unstable = (state)=>{\n assertSlots(state);\n return /*#__PURE__*/ _jsxs(_Fragment, {\n children: [\n /*#__PURE__*/ _jsx(state.assertive, {}),\n /*#__PURE__*/ _jsx(state.polite, {})\n ]\n });\n};\n"],"names":["renderAriaLive_unstable","state","assertSlots","_jsxs","_Fragment","children","_jsx","assertive","polite"],"mappings":";;;;+BAIiBA;;;eAAAA;;;4BAJmD;gCACxC;AAGjB,MAAMA,0BAA0B,CAACC;IACxCC,IAAAA,2BAAW,EAACD;IACZ,OAAO,WAAW,GAAGE,IAAAA,gBAAK,EAACC,oBAAS,EAAE;QAClCC,UAAU;YACN,WAAW,GAAGC,IAAAA,eAAI,EAACL,MAAMM,SAAS,EAAE,CAAC;YACrC,WAAW,GAAGD,IAAAA,eAAI,EAACL,MAAMO,MAAM,EAAE,CAAC;SACrC;IACL;AACJ"}
1
+ {"version":3,"sources":["renderAriaLive.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { AriaLiveState, AriaLiveSlots } from './AriaLive.types';\n\n/**\n * Render the final JSX of AriaLive\n */\nexport const renderAriaLive_unstable = (state: AriaLiveState) => {\n assertSlots<AriaLiveSlots>(state);\n\n return (\n <>\n <state.assertive />\n <state.polite />\n </>\n );\n};\n"],"names":["renderAriaLive_unstable","state","assertSlots","_jsxs","_Fragment","_jsx","assertive","polite"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;gCAE4B;AAMrB,MAAMA,0BAA0B,CAACC;IACtCC,IAAAA,2BAAAA,EAA2BD;IAE3B,OAAA,WAAA,GACEE,IAAAA,gBAAA,EAAAC,oBAAA,EAAA;;0BACEC,IAAAA,eAAA,EAACJ,MAAMK,SAAS,EAAA,CAAA;0BAChBD,IAAAA,eAAA,EAACJ,MAAMM,MAAM,EAAA,CAAA;;;AAGnB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useAriaLive.js"],"sourcesContent":["import * as React from 'react';\nimport { createPriorityQueue, useEventCallback, slot, useTimeout } from '@fluentui/react-utilities';\n/** The duration the message needs to be in present in DOM for screen readers to register a change and announce */ const MESSAGE_DURATION = 500;\n/**\n * Create the state required to render AriaLive.\n *\n * The returned state can be modified with hooks such as useAriaLiveStyles_unstable,\n * before being passed to renderAriaLive_unstable.\n *\n * @param props - props from this instance of AriaLive\n */ export const useAriaLive_unstable = (props)=>{\n const [currentMessage, setCurrentMessage] = React.useState(undefined);\n // Can't rely on Date.now() if user invokes announce more than once in a code block\n const order = React.useRef(0);\n const [messageQueue] = React.useState(()=>createPriorityQueue((a, b)=>{\n if (a.politeness === b.politeness) {\n return a.createdAt - b.createdAt;\n }\n return a.politeness === 'assertive' ? -1 : 1;\n }));\n const announce = useEventCallback((message, options)=>{\n const { politeness } = options;\n if (message === (currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.message)) {\n return;\n }\n const liveMessage = {\n message,\n politeness,\n createdAt: order.current++\n };\n if (!currentMessage) {\n setCurrentMessage(liveMessage);\n } else {\n messageQueue.enqueue(liveMessage);\n }\n });\n const [setMessageTimeout, clearMessageTimeout] = useTimeout();\n React.useEffect(()=>{\n setMessageTimeout(()=>{\n if (messageQueue.peek()) {\n setCurrentMessage(messageQueue.dequeue());\n } else {\n setCurrentMessage(undefined);\n }\n }, MESSAGE_DURATION);\n return ()=>clearMessageTimeout();\n }, [\n currentMessage,\n messageQueue,\n setMessageTimeout,\n clearMessageTimeout\n ]);\n React.useImperativeHandle(props.announceRef, ()=>announce);\n const politeMessage = (currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.politeness) === 'polite' ? currentMessage.message : undefined;\n const assertiveMessage = (currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.politeness) === 'assertive' ? currentMessage.message : undefined;\n return {\n components: {\n assertive: 'div',\n polite: 'div'\n },\n assertive: slot.always(props.assertive, {\n defaultProps: {\n 'aria-live': 'assertive',\n children: assertiveMessage\n },\n elementType: 'div'\n }),\n polite: slot.always(props.polite, {\n defaultProps: {\n 'aria-live': 'polite',\n children: politeMessage\n },\n elementType: 'div'\n })\n };\n};\n"],"names":["useAriaLive_unstable","MESSAGE_DURATION","props","currentMessage","setCurrentMessage","React","useState","undefined","order","useRef","messageQueue","createPriorityQueue","a","b","politeness","createdAt","announce","useEventCallback","message","options","liveMessage","current","enqueue","setMessageTimeout","clearMessageTimeout","useTimeout","useEffect","peek","dequeue","useImperativeHandle","announceRef","politeMessage","assertiveMessage","components","assertive","polite","slot","always","defaultProps","children","elementType"],"mappings":";;;;+BAUiBA;;;eAAAA;;;;iEAVM;gCACiD;AACxE,gHAAgH,GAAG,MAAMC,mBAAmB;AAQjI,MAAMD,uBAAuB,CAACE;IACrC,MAAM,CAACC,gBAAgBC,kBAAkB,GAAGC,OAAMC,QAAQ,CAACC;IAC3D,mFAAmF;IACnF,MAAMC,QAAQH,OAAMI,MAAM,CAAC;IAC3B,MAAM,CAACC,aAAa,GAAGL,OAAMC,QAAQ,CAAC,IAAIK,IAAAA,mCAAmB,EAAC,CAACC,GAAGC;YAC1D,IAAID,EAAEE,UAAU,KAAKD,EAAEC,UAAU,EAAE;gBAC/B,OAAOF,EAAEG,SAAS,GAAGF,EAAEE,SAAS;YACpC;YACA,OAAOH,EAAEE,UAAU,KAAK,cAAc,CAAC,IAAI;QAC/C;IACJ,MAAME,WAAWC,IAAAA,gCAAgB,EAAC,CAACC,SAASC;QACxC,MAAM,EAAEL,UAAU,EAAE,GAAGK;QACvB,IAAID,YAAaf,CAAAA,mBAAmB,QAAQA,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAee,OAAO,AAAD,GAAI;YACtG;QACJ;QACA,MAAME,cAAc;YAChBF;YACAJ;YACAC,WAAWP,MAAMa,OAAO;QAC5B;QACA,IAAI,CAAClB,gBAAgB;YACjBC,kBAAkBgB;QACtB,OAAO;YACHV,aAAaY,OAAO,CAACF;QACzB;IACJ;IACA,MAAM,CAACG,mBAAmBC,oBAAoB,GAAGC,IAAAA,0BAAU;IAC3DpB,OAAMqB,SAAS,CAAC;QACZH,kBAAkB;YACd,IAAIb,aAAaiB,IAAI,IAAI;gBACrBvB,kBAAkBM,aAAakB,OAAO;YAC1C,OAAO;gBACHxB,kBAAkBG;YACtB;QACJ,GAAGN;QACH,OAAO,IAAIuB;IACf,GAAG;QACCrB;QACAO;QACAa;QACAC;KACH;IACDnB,OAAMwB,mBAAmB,CAAC3B,MAAM4B,WAAW,EAAE,IAAId;IACjD,MAAMe,gBAAgB,AAAC5B,CAAAA,mBAAmB,QAAQA,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAeW,UAAU,AAAD,MAAO,WAAWX,eAAee,OAAO,GAAGX;IAC1J,MAAMyB,mBAAmB,AAAC7B,CAAAA,mBAAmB,QAAQA,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAeW,UAAU,AAAD,MAAO,cAAcX,eAAee,OAAO,GAAGX;IAChK,OAAO;QACH0B,YAAY;YACRC,WAAW;YACXC,QAAQ;QACZ;QACAD,WAAWE,oBAAI,CAACC,MAAM,CAACnC,MAAMgC,SAAS,EAAE;YACpCI,cAAc;gBACV,aAAa;gBACbC,UAAUP;YACd;YACAQ,aAAa;QACjB;QACAL,QAAQC,oBAAI,CAACC,MAAM,CAACnC,MAAMiC,MAAM,EAAE;YAC9BG,cAAc;gBACV,aAAa;gBACbC,UAAUR;YACd;YACAS,aAAa;QACjB;IACJ;AACJ"}
1
+ {"version":3,"sources":["useAriaLive.ts"],"sourcesContent":["import * as React from 'react';\nimport { createPriorityQueue, useEventCallback, slot, useTimeout } from '@fluentui/react-utilities';\nimport type { AnnounceOptions, AriaLiveProps, AriaLiveState, LiveMessage } from './AriaLive.types';\n\n/** The duration the message needs to be in present in DOM for screen readers to register a change and announce */\nconst MESSAGE_DURATION = 500;\n\n/**\n * Create the state required to render AriaLive.\n *\n * The returned state can be modified with hooks such as useAriaLiveStyles_unstable,\n * before being passed to renderAriaLive_unstable.\n *\n * @param props - props from this instance of AriaLive\n */\nexport const useAriaLive_unstable = (props: AriaLiveProps): AriaLiveState => {\n const [currentMessage, setCurrentMessage] = React.useState<LiveMessage | undefined>(undefined);\n // Can't rely on Date.now() if user invokes announce more than once in a code block\n const order = React.useRef(0);\n const [messageQueue] = React.useState(() =>\n createPriorityQueue<LiveMessage>((a, b) => {\n if (a.politeness === b.politeness) {\n return a.createdAt - b.createdAt;\n }\n\n return a.politeness === 'assertive' ? -1 : 1;\n }),\n );\n\n const announce = useEventCallback((message: string, options: AnnounceOptions) => {\n const { politeness } = options;\n if (message === currentMessage?.message) {\n return;\n }\n\n const liveMessage: LiveMessage = {\n message,\n politeness,\n createdAt: order.current++,\n };\n\n if (!currentMessage) {\n setCurrentMessage(liveMessage);\n } else {\n messageQueue.enqueue(liveMessage);\n }\n });\n\n const [setMessageTimeout, clearMessageTimeout] = useTimeout();\n\n React.useEffect(() => {\n setMessageTimeout(() => {\n if (messageQueue.peek()) {\n setCurrentMessage(messageQueue.dequeue());\n } else {\n setCurrentMessage(undefined);\n }\n }, MESSAGE_DURATION);\n\n return () => clearMessageTimeout();\n }, [currentMessage, messageQueue, setMessageTimeout, clearMessageTimeout]);\n\n React.useImperativeHandle(props.announceRef, () => announce);\n\n const politeMessage = currentMessage?.politeness === 'polite' ? currentMessage.message : undefined;\n const assertiveMessage = currentMessage?.politeness === 'assertive' ? currentMessage.message : undefined;\n\n return {\n components: {\n assertive: 'div',\n polite: 'div',\n },\n\n assertive: slot.always(props.assertive, {\n defaultProps: { 'aria-live': 'assertive', children: assertiveMessage },\n elementType: 'div',\n }),\n polite: slot.always(props.polite, {\n defaultProps: { 'aria-live': 'polite', children: politeMessage },\n elementType: 'div',\n }),\n };\n};\n"],"names":["useAriaLive_unstable","MESSAGE_DURATION","props","currentMessage","setCurrentMessage","React","useState","undefined","order","useRef","messageQueue","createPriorityQueue","a","b","politeness","createdAt","announce","useEventCallback","message","options","liveMessage","current","enqueue","setMessageTimeout","clearMessageTimeout","useTimeout","useEffect","peek","dequeue","useImperativeHandle","announceRef","politeMessage","assertiveMessage","components","assertive","polite","slot","always","defaultProps","children","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAeaA;;;eAAAA;;;;iEAfU;gCACiD;AAGxE,gHAAgH,GAChH,MAAMC,mBAAmB;AAUlB,MAAMD,uBAAuB,CAACE;IACnC,MAAM,CAACC,gBAAgBC,kBAAkB,GAAGC,OAAMC,QAAQ,CAA0BC;IACpF,mFAAmF;IACnF,MAAMC,QAAQH,OAAMI,MAAM,CAAC;IAC3B,MAAM,CAACC,aAAa,GAAGL,OAAMC,QAAQ,CAAC,IACpCK,IAAAA,mCAAAA,EAAiC,CAACC,GAAGC;YACnC,IAAID,EAAEE,UAAU,KAAKD,EAAEC,UAAU,EAAE;gBACjC,OAAOF,EAAEG,SAAS,GAAGF,EAAEE,SAAS;YAClC;YAEA,OAAOH,EAAEE,UAAU,KAAK,cAAc,CAAC,IAAI;QAC7C;IAGF,MAAME,WAAWC,IAAAA,gCAAAA,EAAiB,CAACC,SAAiBC;QAClD,MAAM,EAAEL,UAAU,EAAE,GAAGK;QACvB,IAAID,YAAYf,CAAAA,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAgBe,OAAO,AAAPA,GAAS;YACvC;QACF;QAEA,MAAME,cAA2B;YAC/BF;YACAJ;YACAC,WAAWP,MAAMa,OAAO;QAC1B;QAEA,IAAI,CAAClB,gBAAgB;YACnBC,kBAAkBgB;QACpB,OAAO;YACLV,aAAaY,OAAO,CAACF;QACvB;IACF;IAEA,MAAM,CAACG,mBAAmBC,oBAAoB,GAAGC,IAAAA,0BAAAA;IAEjDpB,OAAMqB,SAAS,CAAC;QACdH,kBAAkB;YAChB,IAAIb,aAAaiB,IAAI,IAAI;gBACvBvB,kBAAkBM,aAAakB,OAAO;YACxC,OAAO;gBACLxB,kBAAkBG;YACpB;QACF,GAAGN;QAEH,OAAO,IAAMuB;IACf,GAAG;QAACrB;QAAgBO;QAAca;QAAmBC;KAAoB;IAEzEnB,OAAMwB,mBAAmB,CAAC3B,MAAM4B,WAAW,EAAE,IAAMd;IAEnD,MAAMe,gBAAgB5B,CAAAA,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAgBW,UAAU,AAAVA,MAAe,WAAWX,eAAee,OAAO,GAAGX;IACzF,MAAMyB,mBAAmB7B,CAAAA,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAgBW,UAAU,AAAVA,MAAe,cAAcX,eAAee,OAAO,GAAGX;IAE/F,OAAO;QACL0B,YAAY;YACVC,WAAW;YACXC,QAAQ;QACV;QAEAD,WAAWE,oBAAAA,CAAKC,MAAM,CAACnC,MAAMgC,SAAS,EAAE;YACtCI,cAAc;gBAAE,aAAa;gBAAaC,UAAUP;YAAiB;YACrEQ,aAAa;QACf;QACAL,QAAQC,oBAAAA,CAAKC,MAAM,CAACnC,MAAMiC,MAAM,EAAE;YAChCG,cAAc;gBAAE,aAAa;gBAAUC,UAAUR;YAAc;YAC/DS,aAAa;QACf;IACF;AACF"}
@@ -27,6 +27,7 @@ const ariaLiveClassNames = {
27
27
  ".rrd10u0{clip:rect(0px, 0px, 0px, 0px);height:1px;margin:-1px;overflow:hidden;padding:0px;width:1px;position:absolute;}"
28
28
  ]);
29
29
  const useAriaLiveStyles_unstable = (state)=>{
30
+ 'use no memo';
30
31
  const visuallyHidden = useResetStyles();
31
32
  state.assertive.className = (0, _react.mergeClasses)(visuallyHidden, ariaLiveClassNames.assertive, state.assertive.className);
32
33
  state.polite.className = (0, _react.mergeClasses)(visuallyHidden, ariaLiveClassNames.polite, state.polite.className);
@@ -1 +1 @@
1
- {"version":3,"sources":["useAriaLiveStyles.styles.js"],"sourcesContent":["import { mergeClasses, __resetStyles } from '@griffel/react';\nexport const ariaLiveClassNames = {\n assertive: 'fui-AriaLive__assertive',\n polite: 'fui-AriaLive__polite'\n};\n/**\n * Styles for the root slot\n */\nconst useResetStyles = /*#__PURE__*/__resetStyles(\"rrd10u0\", null, [\".rrd10u0{clip:rect(0px, 0px, 0px, 0px);height:1px;margin:-1px;overflow:hidden;padding:0px;width:1px;position:absolute;}\"]);\n/**\n * Apply styling to the AriaLive slots based on the state\n */\nexport const useAriaLiveStyles_unstable = state => {\n const visuallyHidden = useResetStyles();\n state.assertive.className = mergeClasses(visuallyHidden, ariaLiveClassNames.assertive, state.assertive.className);\n state.polite.className = mergeClasses(visuallyHidden, ariaLiveClassNames.polite, state.polite.className);\n return state;\n};\n//# sourceMappingURL=useAriaLiveStyles.styles.js.map"],"names":["ariaLiveClassNames","useAriaLiveStyles_unstable","assertive","polite","useResetStyles","__resetStyles","state","visuallyHidden","className","mergeClasses"],"mappings":";;;;;;;;;;;IACaA,kBAAkB;eAAlBA;;IAWAC,0BAA0B;eAA1BA;;;uBAZ+B;AACrC,MAAMD,qBAAqB;IAChCE,WAAW;IACXC,QAAQ;AACV;AACA;;CAEC,GACD,MAAMC,iBAAiB,WAAW,GAAEC,IAAAA,oBAAa,EAAC,WAAW,MAAM;IAAC;CAA0H;AAIvL,MAAMJ,6BAA6BK,CAAAA;IACxC,MAAMC,iBAAiBH;IACvBE,MAAMJ,SAAS,CAACM,SAAS,GAAGC,IAAAA,mBAAY,EAACF,gBAAgBP,mBAAmBE,SAAS,EAAEI,MAAMJ,SAAS,CAACM,SAAS;IAChHF,MAAMH,MAAM,CAACK,SAAS,GAAGC,IAAAA,mBAAY,EAACF,gBAAgBP,mBAAmBG,MAAM,EAAEG,MAAMH,MAAM,CAACK,SAAS;IACvG,OAAOF;AACT,GACA,oDAAoD"}
1
+ {"version":3,"sources":["useAriaLiveStyles.styles.js"],"sourcesContent":["import { mergeClasses, makeResetStyles } from '@griffel/react';\nexport const ariaLiveClassNames = {\n assertive: 'fui-AriaLive__assertive',\n polite: 'fui-AriaLive__polite'\n};\n/**\n * Styles for the root slot\n */ const useResetStyles = makeResetStyles({\n clip: 'rect(0px, 0px, 0px, 0px)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0px',\n width: '1px',\n position: 'absolute'\n});\n/**\n * Apply styling to the AriaLive slots based on the state\n */ export const useAriaLiveStyles_unstable = (state)=>{\n 'use no memo';\n const visuallyHidden = useResetStyles();\n state.assertive.className = mergeClasses(visuallyHidden, ariaLiveClassNames.assertive, state.assertive.className);\n state.polite.className = mergeClasses(visuallyHidden, ariaLiveClassNames.polite, state.polite.className);\n return state;\n};\n"],"names":["ariaLiveClassNames","useAriaLiveStyles_unstable","assertive","polite","useResetStyles","__resetStyles","state","visuallyHidden","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACaA,kBAAkB;eAAlBA;;IAiBIC,0BAA0B;eAA1BA;;;uBAlB6B;AACvC,MAAMD,qBAAqB;IAC9BE,WAAW;IACXC,QAAQ;AACZ;AACA;;CAEA,GAAI,MAAMC,iBAAc,WAAA,GAAGC,IAAAA,oBAAA,EAAA,WAAA,MAAA;IAAA;CAQ1B;AAGU,MAAMJ,6BAA8BK,CAAAA;IAC3C;IACA,MAAMC,iBAAiBH;IACvBE,MAAMJ,SAAS,CAACM,SAAS,GAAGC,IAAAA,mBAAY,EAACF,gBAAgBP,mBAAmBE,SAAS,EAAEI,MAAMJ,SAAS,CAACM,SAAS;IAChHF,MAAMH,MAAM,CAACK,SAAS,GAAGC,IAAAA,mBAAY,EAACF,gBAAgBP,mBAAmBG,MAAM,EAAEG,MAAMH,MAAM,CAACK,SAAS;IACvG,OAAOF;AACX"}
@@ -1 +1 @@
1
- {"version":3,"sources":["Timer.js"],"sourcesContent":["import * as React from 'react';\nimport { useBaseAnimationStyles } from './useTimerStyles.styles';\nexport const Timer = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const baseAnimationStyles = useBaseAnimationStyles();\n const { running, timeout, onTimeout } = props;\n const style = {\n animationDuration: `${timeout}ms`,\n animationPlayState: running ? 'running' : 'paused'\n };\n if (timeout < 0) {\n return null;\n }\n return /*#__PURE__*/ React.createElement(\"span\", {\n onAnimationEnd: onTimeout,\n \"data-timer-status\": style.animationPlayState,\n ref: ref,\n style: style,\n className: baseAnimationStyles\n });\n});\nTimer.displayName = 'Timer';\n"],"names":["Timer","React","forwardRef","props","ref","baseAnimationStyles","useBaseAnimationStyles","running","timeout","onTimeout","style","animationDuration","animationPlayState","createElement","onAnimationEnd","className","displayName"],"mappings":";;;;+BAEaA;;;eAAAA;;;;iEAFU;sCACgB;AAChC,MAAMA,QAAQ,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACxD,MAAMC,sBAAsBC,IAAAA,4CAAsB;IAClD,MAAM,EAAEC,OAAO,EAAEC,OAAO,EAAEC,SAAS,EAAE,GAAGN;IACxC,MAAMO,QAAQ;QACVC,mBAAmB,CAAC,EAAEH,QAAQ,EAAE,CAAC;QACjCI,oBAAoBL,UAAU,YAAY;IAC9C;IACA,IAAIC,UAAU,GAAG;QACb,OAAO;IACX;IACA,OAAO,WAAW,GAAGP,OAAMY,aAAa,CAAC,QAAQ;QAC7CC,gBAAgBL;QAChB,qBAAqBC,MAAME,kBAAkB;QAC7CR,KAAKA;QACLM,OAAOA;QACPK,WAAWV;IACf;AACJ;AACAL,MAAMgB,WAAW,GAAG"}
1
+ {"version":3,"sources":["Timer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useBaseAnimationStyles } from './useTimerStyles.styles';\n\nexport type TimerProps = {\n running: boolean;\n timeout: number;\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onTimeout: () => void;\n as?: 'span';\n};\n\nexport const Timer = React.forwardRef<HTMLDivElement, TimerProps>((props, ref) => {\n const baseAnimationStyles = useBaseAnimationStyles();\n const { running, timeout, onTimeout } = props;\n\n const style: React.CSSProperties = {\n animationDuration: `${timeout}ms`,\n animationPlayState: running ? 'running' : 'paused',\n };\n\n if (timeout < 0) {\n return null;\n }\n\n return (\n <span\n onAnimationEnd={onTimeout}\n data-timer-status={style.animationPlayState}\n ref={ref}\n style={style}\n className={baseAnimationStyles}\n />\n );\n});\n\nTimer.displayName = 'Timer';\n"],"names":["Timer","React","forwardRef","props","ref","baseAnimationStyles","useBaseAnimationStyles","running","timeout","onTimeout","style","animationDuration","animationPlayState","createElement","span","onAnimationEnd","data-timer-status","className","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;iEAXU;sCACgB;AAUhC,MAAMA,QAAAA,WAAAA,GAAQC,OAAMC,UAAU,CAA6B,CAACC,OAAOC;IACxE,MAAMC,sBAAsBC,IAAAA,4CAAAA;IAC5B,MAAM,EAAEC,OAAO,EAAEC,OAAO,EAAEC,SAAS,EAAE,GAAGN;IAExC,MAAMO,QAA6B;QACjCC,mBAAmB,CAAC,EAAEH,QAAQ,EAAE,CAAC;QACjCI,oBAAoBL,UAAU,YAAY;IAC5C;IAEA,IAAIC,UAAU,GAAG;QACf,OAAO;IACT;IAEA,OAAA,WAAA,GACEP,OAAAY,aAAA,CAACC,QAAAA;QACCC,gBAAgBN;QAChBO,qBAAmBN,MAAME,kBAAkB;QAC3CR,KAAKA;QACLM,OAAOA;QACPO,WAAWZ;;AAGjB;AAEAL,MAAMkB,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './Timer';\n"],"names":[],"mappings":";;;;;uBAAc"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Timer';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useTimerStyles.styles.js"],"sourcesContent":["import { __resetStyles } from '@griffel/react';\nexport const useBaseAnimationStyles = /*#__PURE__*/__resetStyles(\"r16zaflb\", \"r75casi\", [\".r16zaflb{animation-name:rsacmq1;}\", \"@keyframes rsacmq1{from{opacity:0;}to{opacity:0;}}\", \".r75casi{animation-name:rsacmq1;}\"]);\n//# sourceMappingURL=useTimerStyles.styles.js.map"],"names":["useBaseAnimationStyles","__resetStyles"],"mappings":";;;;+BACaA;;;eAAAA;;;uBADiB;AACvB,MAAMA,yBAAyB,WAAW,GAAEC,IAAAA,oBAAa,EAAC,YAAY,WAAW;IAAC;IAAsC;IAAsD;CAAoC,GACzN,iDAAiD"}
1
+ {"version":3,"sources":["useTimerStyles.styles.js"],"sourcesContent":["import { makeResetStyles } from '@griffel/react';\nexport const useBaseAnimationStyles = makeResetStyles({\n animationName: {\n from: {\n opacity: 0\n },\n to: {\n opacity: 0\n }\n }\n});\n"],"names":["useBaseAnimationStyles","__resetStyles"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":";;;;+BACaA;;;eAAAA;;;uBADmB;AACzB,MAAMA,yBAAsB,WAAA,GAAGC,IAAAA,oBAAA,EAAA,YAAA,WAAA;IAAA;IAAA;IAAA;CASrC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["Toast.js"],"sourcesContent":["import * as React from 'react';\nimport { useToast_unstable } from './useToast';\nimport { renderToast_unstable } from './renderToast';\nimport { useToastStyles_unstable } from './useToastStyles.styles';\nimport { useToastContextValues_unstable } from './useToastContextValues';\n/**\n * Toast component\n */ export const Toast = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useToast_unstable(props, ref);\n useToastStyles_unstable(state);\n return renderToast_unstable(state, useToastContextValues_unstable(state));\n});\nToast.displayName = 'Toast';\n"],"names":["Toast","React","forwardRef","props","ref","state","useToast_unstable","useToastStyles_unstable","renderToast_unstable","useToastContextValues_unstable","displayName"],"mappings":";;;;+BAOiBA;;;eAAAA;;;;iEAPM;0BACW;6BACG;sCACG;uCACO;AAGpC,MAAMA,QAAQ,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC5D,MAAMC,QAAQC,IAAAA,2BAAiB,EAACH,OAAOC;IACvCG,IAAAA,6CAAuB,EAACF;IACxB,OAAOG,IAAAA,iCAAoB,EAACH,OAAOI,IAAAA,qDAA8B,EAACJ;AACtE;AACAL,MAAMU,WAAW,GAAG"}
1
+ {"version":3,"sources":["Toast.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useToast_unstable } from './useToast';\nimport { renderToast_unstable } from './renderToast';\nimport { useToastStyles_unstable } from './useToastStyles.styles';\nimport type { ToastProps } from './Toast.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useToastContextValues_unstable } from './useToastContextValues';\n\n/**\n * Toast component\n */\nexport const Toast: ForwardRefComponent<ToastProps> = React.forwardRef((props, ref) => {\n const state = useToast_unstable(props, ref);\n\n useToastStyles_unstable(state);\n return renderToast_unstable(state, useToastContextValues_unstable(state));\n});\n\nToast.displayName = 'Toast';\n"],"names":["Toast","React","forwardRef","props","ref","state","useToast_unstable","useToastStyles_unstable","renderToast_unstable","useToastContextValues_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;iEAXU;0BACW;6BACG;sCACG;uCAGO;AAKxC,MAAMA,QAAAA,WAAAA,GAAyCC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC7E,MAAMC,QAAQC,IAAAA,2BAAAA,EAAkBH,OAAOC;IAEvCG,IAAAA,6CAAAA,EAAwBF;IACxB,OAAOG,IAAAA,iCAAAA,EAAqBH,OAAOI,IAAAA,qDAAAA,EAA+BJ;AACpE;AAEAL,MAAMU,WAAW,GAAG"}
@@ -1,4 +1,6 @@
1
- "use strict";
1
+ /**
2
+ * State used in rendering Toast
3
+ */ "use strict";
2
4
  Object.defineProperty(exports, "__esModule", {
3
5
  value: true
4
6
  });
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":["Toast.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { BackgroundAppearanceContextValue } from '@fluentui/react-shared-contexts';\n\nexport type ToastSlots = {\n root: Slot<'div'>;\n};\n\nexport type ToastContextValues = {\n backgroundAppearance: BackgroundAppearanceContextValue;\n};\n\n/**\n * Toast Props\n */\nexport type ToastProps = ComponentProps<ToastSlots> & {\n appearance?: BackgroundAppearanceContextValue;\n};\n\n/**\n * State used in rendering Toast\n */\nexport type ToastState = ComponentState<ToastSlots> & {\n backgroundAppearance: BackgroundAppearanceContextValue;\n};\n"],"names":[],"rangeMappings":";;","mappings":"AAkBA;;CAEC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './Toast';\nexport * from './Toast.types';\nexport * from './renderToast';\nexport * from './useToast';\nexport * from './useToastStyles.styles';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Toast';\nexport * from './Toast.types';\nexport * from './renderToast';\nexport * from './useToast';\nexport * from './useToastStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["renderToast.js"],"sourcesContent":[" import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { BackgroundAppearanceProvider } from '@fluentui/react-shared-contexts';\n/**\n * Render the final JSX of Toast\n */ export const renderToast_unstable = (state, contextValues)=>{\n assertSlots(state);\n return /*#__PURE__*/ _jsx(BackgroundAppearanceProvider, {\n value: contextValues.backgroundAppearance,\n children: /*#__PURE__*/ _jsx(state.root, {})\n });\n};\n"],"names":["renderToast_unstable","state","contextValues","assertSlots","_jsx","BackgroundAppearanceProvider","value","backgroundAppearance","children","root"],"mappings":";;;;+BAKiBA;;;eAAAA;;;4BALa;gCACF;qCACiB;AAGlC,MAAMA,uBAAuB,CAACC,OAAOC;IAC5CC,IAAAA,2BAAW,EAACF;IACZ,OAAO,WAAW,GAAGG,IAAAA,eAAI,EAACC,iDAA4B,EAAE;QACpDC,OAAOJ,cAAcK,oBAAoB;QACzCC,UAAU,WAAW,GAAGJ,IAAAA,eAAI,EAACH,MAAMQ,IAAI,EAAE,CAAC;IAC9C;AACJ"}
1
+ {"version":3,"sources":["renderToast.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { BackgroundAppearanceProvider } from '@fluentui/react-shared-contexts';\nimport type { ToastState, ToastSlots, ToastContextValues } from './Toast.types';\n\n/**\n * Render the final JSX of Toast\n */\nexport const renderToast_unstable = (state: ToastState, contextValues: ToastContextValues) => {\n assertSlots<ToastSlots>(state);\n\n return (\n <BackgroundAppearanceProvider value={contextValues.backgroundAppearance}>\n <state.root />\n </BackgroundAppearanceProvider>\n );\n};\n"],"names":["renderToast_unstable","state","contextValues","assertSlots","_jsx","BackgroundAppearanceProvider","value","backgroundAppearance","root"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;gCAC4B;qCACiB;AAMtC,MAAMA,uBAAuB,CAACC,OAAmBC;IACtDC,IAAAA,2BAAAA,EAAwBF;IAExB,OAAA,WAAA,GACEG,IAAAA,eAAA,EAACC,iDAAAA,EAAAA;QAA6BC,OAAOJ,cAAcK,oBAAoB;kBACrE,WAAA,GAAAH,IAAAA,eAAA,EAACH,MAAMO,IAAI,EAAA,CAAA;;AAGjB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useToast.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\n/**\n * Create the state required to render Toast.\n *\n * The returned state can be modified with hooks such as useToastStyles_unstable,\n * before being passed to renderToast_unstable.\n *\n * @param props - props from this instance of Toast\n * @param ref - reference to root HTMLElement of Toast\n */ export const useToast_unstable = (props, ref)=>{\n return {\n components: {\n root: 'div'\n },\n root: slot.always(getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref,\n ...props\n }), {\n elementType: 'div'\n }),\n backgroundAppearance: props.appearance\n };\n};\n"],"names":["useToast_unstable","props","ref","components","root","slot","always","getIntrinsicElementProps","elementType","backgroundAppearance","appearance"],"mappings":";;;;+BAUiBA;;;eAAAA;;;;iEAVM;gCACwB;AASpC,MAAMA,oBAAoB,CAACC,OAAOC;IACzC,OAAO;QACHC,YAAY;YACRC,MAAM;QACV;QACAA,MAAMC,oBAAI,CAACC,MAAM,CAACC,IAAAA,wCAAwB,EAAC,OAAO;YAC9C,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FL,KAAKA;YACL,GAAGD,KAAK;QACZ,IAAI;YACAO,aAAa;QACjB;QACAC,sBAAsBR,MAAMS,UAAU;IAC1C;AACJ"}
1
+ {"version":3,"sources":["useToast.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { ToastProps, ToastState } from './Toast.types';\n\n/**\n * Create the state required to render Toast.\n *\n * The returned state can be modified with hooks such as useToastStyles_unstable,\n * before being passed to renderToast_unstable.\n *\n * @param props - props from this instance of Toast\n * @param ref - reference to root HTMLElement of Toast\n */\nexport const useToast_unstable = (props: ToastProps, ref: React.Ref<HTMLElement>): ToastState => {\n return {\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref as React.Ref<HTMLDivElement>,\n ...props,\n }),\n { elementType: 'div' },\n ),\n backgroundAppearance: props.appearance,\n };\n};\n"],"names":["useToast_unstable","props","ref","components","root","slot","always","getIntrinsicElementProps","elementType","backgroundAppearance","appearance"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAaaA;;;eAAAA;;;;iEAbU;gCACwB;AAYxC,MAAMA,oBAAoB,CAACC,OAAmBC;IACnD,OAAO;QACLC,YAAY;YACVC,MAAM;QACR;QACAA,MAAMC,oBAAAA,CAAKC,MAAM,CACfC,IAAAA,wCAAAA,EAAyB,OAAO;YAC9B,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FL,KAAKA;YACL,GAAGD,KAAK;QACV,IACA;YAAEO,aAAa;QAAM;QAEvBC,sBAAsBR,MAAMS,UAAU;IACxC;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useToastContextValues.js"],"sourcesContent":["export function useToastContextValues_unstable(state) {\n const { backgroundAppearance } = state;\n return {\n backgroundAppearance\n };\n}\n"],"names":["useToastContextValues_unstable","state","backgroundAppearance"],"mappings":";;;;+BAAgBA;;;eAAAA;;;AAAT,SAASA,+BAA+BC,KAAK;IAChD,MAAM,EAAEC,oBAAoB,EAAE,GAAGD;IACjC,OAAO;QACHC;IACJ;AACJ"}
1
+ {"version":3,"sources":["useToastContextValues.ts"],"sourcesContent":["import { ToastContextValues, ToastState } from './Toast.types';\n\nexport function useToastContextValues_unstable(state: ToastState): ToastContextValues {\n const { backgroundAppearance } = state;\n\n return {\n backgroundAppearance,\n };\n}\n"],"names":["useToastContextValues_unstable","state","backgroundAppearance"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":";;;;+BAEgBA;;;eAAAA;;;AAAT,SAASA,+BAA+BC,KAAiB;IAC9D,MAAM,EAAEC,oBAAoB,EAAE,GAAGD;IAEjC,OAAO;QACLC;IACF;AACF"}
@@ -35,6 +35,7 @@ const useStyles = /*#__PURE__*/ (0, _react.__styles)({
35
35
  ]
36
36
  });
37
37
  const useToastStyles_unstable = (state)=>{
38
+ 'use no memo';
38
39
  const rootBaseClassName = useRootBaseClassName();
39
40
  const styles = useStyles();
40
41
  state.root.className = (0, _react.mergeClasses)(toastClassNames.root, rootBaseClassName, state.backgroundAppearance === 'inverted' && styles.inverted, state.root.className);
@@ -1 +1 @@
1
- {"version":3,"sources":["useToastStyles.styles.js"],"sourcesContent":["import { __resetStyles, __styles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const toastClassNames = {\n root: 'fui-Toast'\n};\nconst useRootBaseClassName = /*#__PURE__*/__resetStyles(\"rhf7k35\", null, [\".rhf7k35{display:grid;grid-template-columns:auto 1fr auto;padding:12px;border-radius:var(--borderRadiusMedium);border:1px solid var(--colorTransparentStroke);box-shadow:var(--shadow8);font-size:var(--fontSizeBase300);line-height:20px;font-weight:var(--fontWeightSemibold);color:var(--colorNeutralForeground1);background-color:var(--colorNeutralBackground1);}\"]);\nconst useStyles = /*#__PURE__*/__styles({\n inverted: {\n sj55zd: \"f1w7i9ko\",\n De3pzq: \"f5pduvr\"\n }\n}, {\n d: [\".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}\", \".f5pduvr{background-color:var(--colorNeutralBackgroundInverted);}\"]\n});\n/**\n * Apply styling to the Toast slots based on the state\n */\nexport const useToastStyles_unstable = state => {\n const rootBaseClassName = useRootBaseClassName();\n const styles = useStyles();\n state.root.className = mergeClasses(toastClassNames.root, rootBaseClassName, state.backgroundAppearance === 'inverted' && styles.inverted, state.root.className);\n return state;\n};\n//# sourceMappingURL=useToastStyles.styles.js.map"],"names":["toastClassNames","useToastStyles_unstable","root","useRootBaseClassName","__resetStyles","useStyles","__styles","inverted","sj55zd","De3pzq","d","state","rootBaseClassName","styles","className","mergeClasses","backgroundAppearance"],"mappings":";;;;;;;;;;;IAEaA,eAAe;eAAfA;;IAeAC,uBAAuB;eAAvBA;;;uBAjByC;AAE/C,MAAMD,kBAAkB;IAC7BE,MAAM;AACR;AACA,MAAMC,uBAAuB,WAAW,GAAEC,IAAAA,oBAAa,EAAC,WAAW,MAAM;IAAC;CAAyW;AACnb,MAAMC,YAAY,WAAW,GAAEC,IAAAA,eAAQ,EAAC;IACtCC,UAAU;QACRC,QAAQ;QACRC,QAAQ;IACV;AACF,GAAG;IACDC,GAAG;QAAC;QAA4D;KAAoE;AACtI;AAIO,MAAMT,0BAA0BU,CAAAA;IACrC,MAAMC,oBAAoBT;IAC1B,MAAMU,SAASR;IACfM,MAAMT,IAAI,CAACY,SAAS,GAAGC,IAAAA,mBAAY,EAACf,gBAAgBE,IAAI,EAAEU,mBAAmBD,MAAMK,oBAAoB,KAAK,cAAcH,OAAON,QAAQ,EAAEI,MAAMT,IAAI,CAACY,SAAS;IAC/J,OAAOH;AACT,GACA,iDAAiD"}
1
+ {"version":3,"sources":["useToastStyles.styles.js"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const toastClassNames = {\n root: 'fui-Toast'\n};\nconst useRootBaseClassName = makeResetStyles({\n display: 'grid',\n gridTemplateColumns: 'auto 1fr auto',\n padding: '12px',\n borderRadius: tokens.borderRadiusMedium,\n border: `1px solid ${tokens.colorTransparentStroke}`,\n boxShadow: tokens.shadow8,\n fontSize: tokens.fontSizeBase300,\n lineHeight: '20px',\n fontWeight: tokens.fontWeightSemibold,\n color: tokens.colorNeutralForeground1,\n backgroundColor: tokens.colorNeutralBackground1\n});\nconst useStyles = makeStyles({\n inverted: {\n color: tokens.colorNeutralForegroundInverted2,\n backgroundColor: tokens.colorNeutralBackgroundInverted\n }\n});\n/**\n * Apply styling to the Toast slots based on the state\n */ export const useToastStyles_unstable = (state)=>{\n 'use no memo';\n const rootBaseClassName = useRootBaseClassName();\n const styles = useStyles();\n state.root.className = mergeClasses(toastClassNames.root, rootBaseClassName, state.backgroundAppearance === 'inverted' && styles.inverted, state.root.className);\n return state;\n};\n"],"names":["toastClassNames","useToastStyles_unstable","root","useRootBaseClassName","__resetStyles","useStyles","__styles","inverted","sj55zd","De3pzq","d","state","rootBaseClassName","styles","className","mergeClasses","backgroundAppearance"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEaA,eAAe;eAAfA;;IAwBIC,uBAAuB;eAAvBA;;;uBA1ByC;AAEnD,MAAMD,kBAAkB;IAC3BE,MAAM;AACV;AACA,MAAMC,uBAAoB,WAAA,GAAGC,IAAAA,oBAAA,EAAA,WAAA,MAAA;IAAA;CAY5B;AACD,MAAMC,YAAS,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAC,UAAA;QAAAC,QAAA;QAAAC,QAAA;IAAA;AAAA,GAAA;IAAAC,GAAA;QAAA;QAAA;KAAA;AAAA;AAQP,MAAMT,0BAA2BU,CAAAA;IACxC;IACA,MAAMC,oBAAoBT;IAC1B,MAAMU,SAASR;IACfM,MAAMT,IAAI,CAACY,SAAS,GAAGC,IAAAA,mBAAY,EAACf,gBAAgBE,IAAI,EAAEU,mBAAmBD,MAAMK,oBAAoB,KAAK,cAAcH,OAAON,QAAQ,EAAEI,MAAMT,IAAI,CAACY,SAAS;IAC/J,OAAOH;AACX"}
@@ -1 +1 @@
1
- {"version":3,"sources":["ToastBody.js"],"sourcesContent":["import * as React from 'react';\nimport { useToastBody_unstable } from './useToastBody';\nimport { renderToastBody_unstable } from './renderToastBody';\nimport { useToastBodyStyles_unstable } from './useToastBodyStyles.styles';\n/**\n * ToastBody component\n */ export const ToastBody = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useToastBody_unstable(props, ref);\n useToastBodyStyles_unstable(state);\n return renderToastBody_unstable(state);\n});\nToastBody.displayName = 'ToastBody';\n"],"names":["ToastBody","React","forwardRef","props","ref","state","useToastBody_unstable","useToastBodyStyles_unstable","renderToastBody_unstable","displayName"],"mappings":";;;;+BAMiBA;;;eAAAA;;;;iEANM;8BACe;iCACG;0CACG;AAGjC,MAAMA,YAAY,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAChE,MAAMC,QAAQC,IAAAA,mCAAqB,EAACH,OAAOC;IAC3CG,IAAAA,qDAA2B,EAACF;IAC5B,OAAOG,IAAAA,yCAAwB,EAACH;AACpC;AACAL,UAAUS,WAAW,GAAG"}
1
+ {"version":3,"sources":["ToastBody.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useToastBody_unstable } from './useToastBody';\nimport { renderToastBody_unstable } from './renderToastBody';\nimport { useToastBodyStyles_unstable } from './useToastBodyStyles.styles';\nimport type { ToastBodyProps } from './ToastBody.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * ToastBody component\n */\nexport const ToastBody: ForwardRefComponent<ToastBodyProps> = React.forwardRef((props, ref) => {\n const state = useToastBody_unstable(props, ref);\n\n useToastBodyStyles_unstable(state);\n return renderToastBody_unstable(state);\n});\n\nToastBody.displayName = 'ToastBody';\n"],"names":["ToastBody","React","forwardRef","props","ref","state","useToastBody_unstable","useToastBodyStyles_unstable","renderToastBody_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAUaA;;;eAAAA;;;;iEAVU;8BACe;iCACG;0CACG;AAOrC,MAAMA,YAAAA,WAAAA,GAAiDC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,QAAQC,IAAAA,mCAAAA,EAAsBH,OAAOC;IAE3CG,IAAAA,qDAAAA,EAA4BF;IAC5B,OAAOG,IAAAA,yCAAAA,EAAyBH;AAClC;AAEAL,UAAUS,WAAW,GAAG"}
@@ -1,4 +1,6 @@
1
- "use strict";
1
+ /**
2
+ * State used in rendering ToastBody
3
+ */ "use strict";
2
4
  Object.defineProperty(exports, "__esModule", {
3
5
  value: true
4
6
  });
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":["ToastBody.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { BackgroundAppearanceContextValue } from '@fluentui/react-shared-contexts';\n\nexport type ToastBodySlots = {\n root: Slot<'div'>;\n subtitle?: Slot<'div'>;\n};\n\n/**\n * ToastBody Props\n */\nexport type ToastBodyProps = ComponentProps<ToastBodySlots> & {};\n\n/**\n * State used in rendering ToastBody\n */\nexport type ToastBodyState = ComponentState<ToastBodySlots> & {\n backgroundAppearance: BackgroundAppearanceContextValue;\n};\n"],"names":[],"rangeMappings":";;","mappings":"AAaA;;CAEC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './ToastBody';\nexport * from './ToastBody.types';\nexport * from './renderToastBody';\nexport * from './useToastBody';\nexport * from './useToastBodyStyles.styles';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ToastBody';\nexport * from './ToastBody.types';\nexport * from './renderToastBody';\nexport * from './useToastBody';\nexport * from './useToastBodyStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["renderToastBody.js"],"sourcesContent":[" import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of ToastBody\n */ export const renderToastBody_unstable = (state)=>{\n assertSlots(state);\n return /*#__PURE__*/ _jsxs(_Fragment, {\n children: [\n /*#__PURE__*/ _jsx(state.root, {}),\n state.subtitle ? /*#__PURE__*/ _jsx(state.subtitle, {}) : null\n ]\n });\n};\n"],"names":["renderToastBody_unstable","state","assertSlots","_jsxs","_Fragment","children","_jsx","root","subtitle"],"mappings":";;;;+BAIiBA;;;eAAAA;;;4BAJmD;gCACxC;AAGjB,MAAMA,2BAA2B,CAACC;IACzCC,IAAAA,2BAAW,EAACD;IACZ,OAAO,WAAW,GAAGE,IAAAA,gBAAK,EAACC,oBAAS,EAAE;QAClCC,UAAU;YACN,WAAW,GAAGC,IAAAA,eAAI,EAACL,MAAMM,IAAI,EAAE,CAAC;YAChCN,MAAMO,QAAQ,GAAG,WAAW,GAAGF,IAAAA,eAAI,EAACL,MAAMO,QAAQ,EAAE,CAAC,KAAK;SAC7D;IACL;AACJ"}
1
+ {"version":3,"sources":["renderToastBody.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { ToastBodyState, ToastBodySlots } from './ToastBody.types';\n\n/**\n * Render the final JSX of ToastBody\n */\nexport const renderToastBody_unstable = (state: ToastBodyState) => {\n assertSlots<ToastBodySlots>(state);\n\n return (\n <>\n <state.root />\n {state.subtitle ? <state.subtitle /> : null}\n </>\n );\n};\n"],"names":["renderToastBody_unstable","state","assertSlots","_jsxs","_Fragment","_jsx","root","subtitle"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;gCAE4B;AAMrB,MAAMA,2BAA2B,CAACC;IACvCC,IAAAA,2BAAAA,EAA4BD;IAE5B,OAAA,WAAA,GACEE,IAAAA,gBAAA,EAAAC,oBAAA,EAAA;;0BACEC,IAAAA,eAAA,EAACJ,MAAMK,IAAI,EAAA,CAAA;YACVL,MAAMM,QAAQ,GAAA,WAAA,GAAGF,IAAAA,eAAA,EAACJ,MAAMM,QAAQ,EAAA,CAAA,KAAM;;;AAG7C"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useToastBody.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\nimport { useBackgroundAppearance } from '@fluentui/react-shared-contexts';\n/**\n * Create the state required to render ToastBody.\n *\n * The returned state can be modified with hooks such as useToastBodyStyles_unstable,\n * before being passed to renderToastBody_unstable.\n *\n * @param props - props from this instance of ToastBody\n * @param ref - reference to root HTMLElement of ToastBody\n */ export const useToastBody_unstable = (props, ref)=>{\n const backgroundAppearance = useBackgroundAppearance();\n const { bodyId } = useToastContainerContext();\n return {\n components: {\n root: 'div',\n subtitle: 'div'\n },\n subtitle: slot.optional(props.subtitle, {\n elementType: 'div'\n }),\n root: slot.always(getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref,\n id: bodyId,\n ...props\n }), {\n elementType: 'div'\n }),\n backgroundAppearance\n };\n};\n"],"names":["useToastBody_unstable","props","ref","backgroundAppearance","useBackgroundAppearance","bodyId","useToastContainerContext","components","root","subtitle","slot","optional","elementType","always","getIntrinsicElementProps","id"],"mappings":";;;;+BAYiBA;;;eAAAA;;;;iEAZM;gCACwB;uCACN;qCACD;AAS7B,MAAMA,wBAAwB,CAACC,OAAOC;IAC7C,MAAMC,uBAAuBC,IAAAA,4CAAuB;IACpD,MAAM,EAAEC,MAAM,EAAE,GAAGC,IAAAA,+CAAwB;IAC3C,OAAO;QACHC,YAAY;YACRC,MAAM;YACNC,UAAU;QACd;QACAA,UAAUC,oBAAI,CAACC,QAAQ,CAACV,MAAMQ,QAAQ,EAAE;YACpCG,aAAa;QACjB;QACAJ,MAAME,oBAAI,CAACG,MAAM,CAACC,IAAAA,wCAAwB,EAAC,OAAO;YAC9C,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FZ,KAAKA;YACLa,IAAIV;YACJ,GAAGJ,KAAK;QACZ,IAAI;YACAW,aAAa;QACjB;QACAT;IACJ;AACJ"}
1
+ {"version":3,"sources":["useToastBody.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { ToastBodyProps, ToastBodyState } from './ToastBody.types';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\nimport { useBackgroundAppearance } from '@fluentui/react-shared-contexts';\n\n/**\n * Create the state required to render ToastBody.\n *\n * The returned state can be modified with hooks such as useToastBodyStyles_unstable,\n * before being passed to renderToastBody_unstable.\n *\n * @param props - props from this instance of ToastBody\n * @param ref - reference to root HTMLElement of ToastBody\n */\nexport const useToastBody_unstable = (props: ToastBodyProps, ref: React.Ref<HTMLElement>): ToastBodyState => {\n const backgroundAppearance = useBackgroundAppearance();\n const { bodyId } = useToastContainerContext();\n return {\n components: {\n root: 'div',\n subtitle: 'div',\n },\n subtitle: slot.optional(props.subtitle, { elementType: 'div' }),\n root: slot.always(\n getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref as React.Ref<HTMLDivElement>,\n id: bodyId,\n ...props,\n }),\n { elementType: 'div' },\n ),\n backgroundAppearance,\n };\n};\n"],"names":["useToastBody_unstable","props","ref","backgroundAppearance","useBackgroundAppearance","bodyId","useToastContainerContext","components","root","subtitle","slot","optional","elementType","always","getIntrinsicElementProps","id"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAeaA;;;eAAAA;;;;iEAfU;gCACwB;uCAEN;qCACD;AAWjC,MAAMA,wBAAwB,CAACC,OAAuBC;IAC3D,MAAMC,uBAAuBC,IAAAA,4CAAAA;IAC7B,MAAM,EAAEC,MAAM,EAAE,GAAGC,IAAAA,+CAAAA;IACnB,OAAO;QACLC,YAAY;YACVC,MAAM;YACNC,UAAU;QACZ;QACAA,UAAUC,oBAAAA,CAAKC,QAAQ,CAACV,MAAMQ,QAAQ,EAAE;YAAEG,aAAa;QAAM;QAC7DJ,MAAME,oBAAAA,CAAKG,MAAM,CACfC,IAAAA,wCAAAA,EAAyB,OAAO;YAC9B,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FZ,KAAKA;YACLa,IAAIV;YACJ,GAAGJ,KAAK;QACV,IACA;YAAEW,aAAa;QAAM;QAEvBT;IACF;AACF"}
@@ -40,6 +40,7 @@ const useInvertedStyles = /*#__PURE__*/ (0, _react.__styles)({
40
40
  ]
41
41
  });
42
42
  const useToastBodyStyles_unstable = (state)=>{
43
+ 'use no memo';
43
44
  const rootBaseClassName = useRootBaseClassName();
44
45
  const subtitleBaseClassName = useSubtitleBaseClassName();
45
46
  const invertedStyles = useInvertedStyles();
@@ -1 +1 @@
1
- {"version":3,"sources":["useToastBodyStyles.styles.js"],"sourcesContent":["import { __resetStyles, __styles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const toastBodyClassNames = {\n root: 'fui-ToastBody',\n subtitle: 'fui-ToastBody__subtitle'\n};\nconst useRootBaseClassName = /*#__PURE__*/__resetStyles(\"rciajo9\", null, [\".rciajo9{grid-column-start:2;grid-column-end:3;padding-top:6px;font-size:var(--fontSizeBase300);line-height:var(--fontSizeBase300);font-weight:var(--fontWeightRegular);color:var(--colorNeutralForeground1);word-break:break-word;}\"]);\nconst useSubtitleBaseClassName = /*#__PURE__*/__resetStyles(\"rzjw1xk\", null, [\".rzjw1xk{padding-top:4px;grid-column-start:2;grid-column-end:3;font-size:var(--fontSizeBase200);line-height:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);color:var(--colorNeutralForeground2);}\"]);\nconst useInvertedStyles = /*#__PURE__*/__styles({\n root: {\n sj55zd: \"f1w7i9ko\"\n },\n subtitle: {\n sj55zd: \"f1w7i9ko\"\n }\n}, {\n d: [\".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}\"]\n});\n/**\n * Apply styling to the ToastBody slots based on the state\n */\nexport const useToastBodyStyles_unstable = state => {\n const rootBaseClassName = useRootBaseClassName();\n const subtitleBaseClassName = useSubtitleBaseClassName();\n const invertedStyles = useInvertedStyles();\n state.root.className = mergeClasses(toastBodyClassNames.root, rootBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.root, state.root.className);\n if (state.subtitle) {\n state.subtitle.className = mergeClasses(toastBodyClassNames.subtitle, subtitleBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.subtitle, state.subtitle.className);\n }\n return state;\n};\n//# sourceMappingURL=useToastBodyStyles.styles.js.map"],"names":["toastBodyClassNames","useToastBodyStyles_unstable","root","subtitle","useRootBaseClassName","__resetStyles","useSubtitleBaseClassName","useInvertedStyles","__styles","sj55zd","d","state","rootBaseClassName","subtitleBaseClassName","invertedStyles","className","mergeClasses","backgroundAppearance"],"mappings":";;;;;;;;;;;IAEaA,mBAAmB;eAAnBA;;IAmBAC,2BAA2B;eAA3BA;;;uBArByC;AAE/C,MAAMD,sBAAsB;IACjCE,MAAM;IACNC,UAAU;AACZ;AACA,MAAMC,uBAAuB,WAAW,GAAEC,IAAAA,oBAAa,EAAC,WAAW,MAAM;IAAC;CAAuO;AACjT,MAAMC,2BAA2B,WAAW,GAAED,IAAAA,oBAAa,EAAC,WAAW,MAAM;IAAC;CAAiN;AAC/R,MAAME,oBAAoB,WAAW,GAAEC,IAAAA,eAAQ,EAAC;IAC9CN,MAAM;QACJO,QAAQ;IACV;IACAN,UAAU;QACRM,QAAQ;IACV;AACF,GAAG;IACDC,GAAG;QAAC;KAA2D;AACjE;AAIO,MAAMT,8BAA8BU,CAAAA;IACzC,MAAMC,oBAAoBR;IAC1B,MAAMS,wBAAwBP;IAC9B,MAAMQ,iBAAiBP;IACvBI,MAAMT,IAAI,CAACa,SAAS,GAAGC,IAAAA,mBAAY,EAAChB,oBAAoBE,IAAI,EAAEU,mBAAmBD,MAAMM,oBAAoB,KAAK,cAAcH,eAAeZ,IAAI,EAAES,MAAMT,IAAI,CAACa,SAAS;IACvK,IAAIJ,MAAMR,QAAQ,EAAE;QAClBQ,MAAMR,QAAQ,CAACY,SAAS,GAAGC,IAAAA,mBAAY,EAAChB,oBAAoBG,QAAQ,EAAEU,uBAAuBF,MAAMM,oBAAoB,KAAK,cAAcH,eAAeX,QAAQ,EAAEQ,MAAMR,QAAQ,CAACY,SAAS;IAC7L;IACA,OAAOJ;AACT,GACA,qDAAqD"}
1
+ {"version":3,"sources":["useToastBodyStyles.styles.js"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const toastBodyClassNames = {\n root: 'fui-ToastBody',\n subtitle: 'fui-ToastBody__subtitle'\n};\nconst useRootBaseClassName = makeResetStyles({\n gridColumnStart: 2,\n gridColumnEnd: 3,\n paddingTop: '6px',\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.fontSizeBase300,\n fontWeight: tokens.fontWeightRegular,\n color: tokens.colorNeutralForeground1,\n wordBreak: 'break-word'\n});\nconst useSubtitleBaseClassName = makeResetStyles({\n paddingTop: '4px',\n gridColumnStart: 2,\n gridColumnEnd: 3,\n fontSize: tokens.fontSizeBase200,\n lineHeight: tokens.fontSizeBase200,\n fontWeight: tokens.fontWeightRegular,\n color: tokens.colorNeutralForeground2\n});\nconst useInvertedStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForegroundInverted2\n },\n subtitle: {\n color: tokens.colorNeutralForegroundInverted2\n }\n});\n/**\n * Apply styling to the ToastBody slots based on the state\n */ export const useToastBodyStyles_unstable = (state)=>{\n 'use no memo';\n const rootBaseClassName = useRootBaseClassName();\n const subtitleBaseClassName = useSubtitleBaseClassName();\n const invertedStyles = useInvertedStyles();\n state.root.className = mergeClasses(toastBodyClassNames.root, rootBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.root, state.root.className);\n if (state.subtitle) {\n state.subtitle.className = mergeClasses(toastBodyClassNames.subtitle, subtitleBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.subtitle, state.subtitle.className);\n }\n return state;\n};\n"],"names":["toastBodyClassNames","useToastBodyStyles_unstable","root","subtitle","useRootBaseClassName","__resetStyles","useSubtitleBaseClassName","useInvertedStyles","__styles","sj55zd","d","state","rootBaseClassName","subtitleBaseClassName","invertedStyles","className","mergeClasses","backgroundAppearance"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEaA,mBAAmB;eAAnBA;;IAiCIC,2BAA2B;eAA3BA;;;uBAnCyC;AAEnD,MAAMD,sBAAsB;IAC/BE,MAAM;IACNC,UAAU;AACd;AACA,MAAMC,uBAAoB,WAAA,GAAGC,IAAAA,oBAAA,EAAA,WAAA,MAAA;IAAA;CAS5B;AACD,MAAMC,2BAAwB,WAAA,GAAGD,IAAAA,oBAAA,EAAA,WAAA,MAAA;IAAA;CAQhC;AACD,MAAME,oBAAiB,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAN,MAAA;QAAAO,QAAA;IAAA;IAAAN,UAAA;QAAAM,QAAA;IAAA;AAAA,GAAA;IAAAC,GAAA;QAAA;KAAA;AAAA;AAUf,MAAMT,8BAA+BU,CAAAA;IAC5C;IACA,MAAMC,oBAAoBR;IAC1B,MAAMS,wBAAwBP;IAC9B,MAAMQ,iBAAiBP;IACvBI,MAAMT,IAAI,CAACa,SAAS,GAAGC,IAAAA,mBAAY,EAAChB,oBAAoBE,IAAI,EAAEU,mBAAmBD,MAAMM,oBAAoB,KAAK,cAAcH,eAAeZ,IAAI,EAAES,MAAMT,IAAI,CAACa,SAAS;IACvK,IAAIJ,MAAMR,QAAQ,EAAE;QAChBQ,MAAMR,QAAQ,CAACY,SAAS,GAAGC,IAAAA,mBAAY,EAAChB,oBAAoBG,QAAQ,EAAEU,uBAAuBF,MAAMM,oBAAoB,KAAK,cAAcH,eAAeX,QAAQ,EAAEQ,MAAMR,QAAQ,CAACY,SAAS;IAC/L;IACA,OAAOJ;AACX"}
@@ -1 +1 @@
1
- {"version":3,"sources":["ToastContainer.js"],"sourcesContent":["import * as React from 'react';\nimport { useToastContainer_unstable } from './useToastContainer';\nimport { renderToastContainer_unstable } from './renderToastContainer';\nimport { useToastContainerStyles_unstable } from './useToastContainerStyles.styles';\nimport { useToastContainerContextValues_unstable } from './useToastContainerContextValues';\n/**\n * ToastContainer component\n */ export const ToastContainer = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useToastContainer_unstable(props, ref);\n useToastContainerStyles_unstable(state);\n return renderToastContainer_unstable(state, useToastContainerContextValues_unstable(state));\n});\nToastContainer.displayName = 'ToastContainer';\n"],"names":["ToastContainer","React","forwardRef","props","ref","state","useToastContainer_unstable","useToastContainerStyles_unstable","renderToastContainer_unstable","useToastContainerContextValues_unstable","displayName"],"mappings":";;;;+BAOiBA;;;eAAAA;;;;iEAPM;mCACoB;sCACG;+CACG;gDACO;AAG7C,MAAMA,iBAAiB,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACrE,MAAMC,QAAQC,IAAAA,6CAA0B,EAACH,OAAOC;IAChDG,IAAAA,+DAAgC,EAACF;IACjC,OAAOG,IAAAA,mDAA6B,EAACH,OAAOI,IAAAA,uEAAuC,EAACJ;AACxF;AACAL,eAAeU,WAAW,GAAG"}
1
+ {"version":3,"sources":["ToastContainer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useToastContainer_unstable } from './useToastContainer';\nimport { renderToastContainer_unstable } from './renderToastContainer';\nimport { useToastContainerStyles_unstable } from './useToastContainerStyles.styles';\nimport type { ToastContainerProps } from './ToastContainer.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useToastContainerContextValues_unstable } from './useToastContainerContextValues';\n\n/**\n * ToastContainer component\n */\nexport const ToastContainer: ForwardRefComponent<ToastContainerProps> = React.forwardRef((props, ref) => {\n const state = useToastContainer_unstable(props, ref);\n\n useToastContainerStyles_unstable(state);\n return renderToastContainer_unstable(state, useToastContainerContextValues_unstable(state));\n});\n\nToastContainer.displayName = 'ToastContainer';\n"],"names":["ToastContainer","React","forwardRef","props","ref","state","useToastContainer_unstable","useToastContainerStyles_unstable","renderToastContainer_unstable","useToastContainerContextValues_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;iEAXU;mCACoB;sCACG;+CACG;gDAGO;AAKjD,MAAMA,iBAAAA,WAAAA,GAA2DC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQC,IAAAA,6CAAAA,EAA2BH,OAAOC;IAEhDG,IAAAA,+DAAAA,EAAiCF;IACjC,OAAOG,IAAAA,mDAAAA,EAA8BH,OAAOI,IAAAA,uEAAAA,EAAwCJ;AACtF;AAEAL,eAAeU,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["ToastContainer.types.js"],"sourcesContent":["import * as React from 'react';\n"],"names":[],"mappings":";;;;;iEAAuB"}
1
+ {"version":3,"sources":["ToastContainer.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { Announce } from '../AriaLive/AriaLive.types';\nimport { Toast, ToastIntent } from '../../state';\nimport { ToastContainerContextValue } from '../../contexts/toastContainerContext';\nimport { TimerProps } from '../Timer/Timer';\n\nexport type ToastContainerContextValues = {\n toast: ToastContainerContextValue;\n};\n\nexport type ToastContainerSlots = {\n root: NonNullable<Slot<'div'>>;\n timer: NonNullable<Slot<TimerProps>>;\n};\n\n/**\n * ToastContainer Props\n */\nexport type ToastContainerProps = Omit<ComponentProps<Partial<ToastContainerSlots>>, 'content'> &\n Toast & {\n visible: boolean;\n announce: Announce;\n intent: ToastIntent | undefined;\n tryRestoreFocus: () => void;\n };\n\n/**\n * State used in rendering ToastContainer\n */\nexport type ToastContainerState = ComponentState<ToastContainerSlots> &\n Pick<ToastContainerProps, 'remove' | 'close' | 'updateId' | 'visible' | 'intent'> &\n Pick<ToastContainerContextValue, 'titleId' | 'bodyId'> & {\n /**\n * @deprecated Will be always \"0\".\n */\n transitionTimeout: number;\n timerTimeout: number;\n running: boolean;\n /**\n * @deprecated Will be always no-op.\n */\n onTransitionEntering: () => void;\n /**\n * @deprecated\n */\n nodeRef: React.Ref<HTMLDivElement>;\n\n onMotionFinish?: (event: null, data: { direction: 'enter' | 'exit' }) => void;\n };\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["ToastContainerMotion.js"],"sourcesContent":["import { createPresenceComponent } from '@fluentui/react-motion';\nexport const ToastContainerMotion = createPresenceComponent(({ element })=>({\n enter: [\n {\n keyframes: [\n {\n marginTop: 0,\n minHeight: 0,\n maxHeight: 0,\n opacity: 0\n },\n {\n marginTop: '16px',\n minHeight: 44,\n maxHeight: `${element.scrollHeight}px`,\n opacity: 0\n }\n ],\n duration: 200\n },\n {\n keyframes: [\n {\n opacity: 0\n },\n {\n opacity: 1\n }\n ],\n delay: 200,\n duration: 400\n }\n ],\n exit: [\n {\n keyframes: [\n {\n marginTop: '16px',\n minHeight: 44,\n maxHeight: `${element.scrollHeight}px`\n },\n {\n marginTop: 0,\n minHeight: 0,\n maxHeight: 0\n }\n ],\n delay: 400,\n duration: 200\n },\n {\n keyframes: [\n {\n opacity: 1\n },\n {\n opacity: 0\n }\n ],\n duration: 400\n }\n ]\n }));\n"],"names":["ToastContainerMotion","createPresenceComponent","element","enter","keyframes","marginTop","minHeight","maxHeight","opacity","scrollHeight","duration","delay","exit"],"mappings":";;;;+BACaA;;;eAAAA;;;6BAD2B;AACjC,MAAMA,uBAAuBC,IAAAA,oCAAuB,EAAC,CAAC,EAAEC,OAAO,EAAE,GAAI,CAAA;QACpEC,OAAO;YACH;gBACIC,WAAW;oBACP;wBACIC,WAAW;wBACXC,WAAW;wBACXC,WAAW;wBACXC,SAAS;oBACb;oBACA;wBACIH,WAAW;wBACXC,WAAW;wBACXC,WAAW,CAAC,EAAEL,QAAQO,YAAY,CAAC,EAAE,CAAC;wBACtCD,SAAS;oBACb;iBACH;gBACDE,UAAU;YACd;YACA;gBACIN,WAAW;oBACP;wBACII,SAAS;oBACb;oBACA;wBACIA,SAAS;oBACb;iBACH;gBACDG,OAAO;gBACPD,UAAU;YACd;SACH;QACDE,MAAM;YACF;gBACIR,WAAW;oBACP;wBACIC,WAAW;wBACXC,WAAW;wBACXC,WAAW,CAAC,EAAEL,QAAQO,YAAY,CAAC,EAAE,CAAC;oBAC1C;oBACA;wBACIJ,WAAW;wBACXC,WAAW;wBACXC,WAAW;oBACf;iBACH;gBACDI,OAAO;gBACPD,UAAU;YACd;YACA;gBACIN,WAAW;oBACP;wBACII,SAAS;oBACb;oBACA;wBACIA,SAAS;oBACb;iBACH;gBACDE,UAAU;YACd;SACH;IACL,CAAA"}
1
+ {"version":3,"sources":["ToastContainerMotion.tsx"],"sourcesContent":["import { createPresenceComponent } from '@fluentui/react-motion';\n\nexport const ToastContainerMotion = createPresenceComponent(({ element }) => ({\n enter: [\n {\n keyframes: [\n { marginTop: 0, minHeight: 0, maxHeight: 0, opacity: 0 },\n { marginTop: '16px', minHeight: 44, maxHeight: `${element.scrollHeight}px`, opacity: 0 },\n ],\n duration: 200,\n },\n {\n keyframes: [{ opacity: 0 }, { opacity: 1 }],\n delay: 200,\n duration: 400,\n },\n ],\n\n exit: [\n {\n keyframes: [\n { marginTop: '16px', minHeight: 44, maxHeight: `${element.scrollHeight}px` },\n { marginTop: 0, minHeight: 0, maxHeight: 0 },\n ],\n delay: 400,\n duration: 200,\n },\n {\n keyframes: [{ opacity: 1 }, { opacity: 0 }],\n duration: 400,\n },\n ],\n}));\n"],"names":["ToastContainerMotion","createPresenceComponent","element","enter","keyframes","marginTop","minHeight","maxHeight","opacity","scrollHeight","duration","delay","exit"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAEaA;;;eAAAA;;;6BAF2B;AAEjC,MAAMA,uBAAuBC,IAAAA,oCAAAA,EAAwB,CAAC,EAAEC,OAAO,EAAE,GAAM,CAAA;QAC5EC,OAAO;YACL;gBACEC,WAAW;oBACT;wBAAEC,WAAW;wBAAGC,WAAW;wBAAGC,WAAW;wBAAGC,SAAS;oBAAE;oBACvD;wBAAEH,WAAW;wBAAQC,WAAW;wBAAIC,WAAW,CAAC,EAAEL,QAAQO,YAAY,CAAC,EAAE,CAAC;wBAAED,SAAS;oBAAE;iBACxF;gBACDE,UAAU;YACZ;YACA;gBACEN,WAAW;oBAAC;wBAAEI,SAAS;oBAAE;oBAAG;wBAAEA,SAAS;oBAAE;iBAAE;gBAC3CG,OAAO;gBACPD,UAAU;YACZ;SACD;QAEDE,MAAM;YACJ;gBACER,WAAW;oBACT;wBAAEC,WAAW;wBAAQC,WAAW;wBAAIC,WAAW,CAAC,EAAEL,QAAQO,YAAY,CAAC,EAAE,CAAC;oBAAC;oBAC3E;wBAAEJ,WAAW;wBAAGC,WAAW;wBAAGC,WAAW;oBAAE;iBAC5C;gBACDI,OAAO;gBACPD,UAAU;YACZ;YACA;gBACEN,WAAW;oBAAC;wBAAEI,SAAS;oBAAE;oBAAG;wBAAEA,SAAS;oBAAE;iBAAE;gBAC3CE,UAAU;YACZ;SACD;IACH,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './ToastContainer';\nexport * from './ToastContainer.types';\nexport * from './renderToastContainer';\nexport * from './useToastContainer';\nexport * from './useToastContainerStyles.styles';\nexport * from './useToastContainerContextValues';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ToastContainer';\nexport * from './ToastContainer.types';\nexport * from './renderToastContainer';\nexport * from './useToastContainer';\nexport * from './useToastContainerStyles.styles';\nexport * from './useToastContainerContextValues';\n"],"names":[],"rangeMappings":";;;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA;uBACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["renderToastContainer.js"],"sourcesContent":[" import { jsx as _jsx, jsxs as _jsxs } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { ToastContainerContextProvider } from '../../contexts/toastContainerContext';\nimport { ToastContainerMotion } from './ToastContainerMotion';\n/**\n * Render the final JSX of ToastContainer\n */ export const renderToastContainer_unstable = (state, contextValues)=>{\n const { onMotionFinish, visible, updateId } = state;\n assertSlots(state);\n return /*#__PURE__*/ _jsx(ToastContainerContextProvider, {\n value: contextValues.toast,\n children: /*#__PURE__*/ _jsx(ToastContainerMotion, {\n appear: true,\n onMotionFinish: onMotionFinish,\n visible: visible,\n unmountOnExit: true,\n children: /*#__PURE__*/ _jsxs(state.root, {\n children: [\n state.root.children,\n /*#__PURE__*/ _jsx(state.timer, {}, updateId)\n ]\n })\n })\n });\n};\n"],"names":["renderToastContainer_unstable","state","contextValues","onMotionFinish","visible","updateId","assertSlots","_jsx","ToastContainerContextProvider","value","toast","children","ToastContainerMotion","appear","unmountOnExit","_jsxs","root","timer"],"mappings":";;;;+BAMiBA;;;eAAAA;;;4BAN4B;gCACjB;uCACkB;sCACT;AAG1B,MAAMA,gCAAgC,CAACC,OAAOC;IACrD,MAAM,EAAEC,cAAc,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGJ;IAC9CK,IAAAA,2BAAW,EAACL;IACZ,OAAO,WAAW,GAAGM,IAAAA,eAAI,EAACC,oDAA6B,EAAE;QACrDC,OAAOP,cAAcQ,KAAK;QAC1BC,UAAU,WAAW,GAAGJ,IAAAA,eAAI,EAACK,0CAAoB,EAAE;YAC/CC,QAAQ;YACRV,gBAAgBA;YAChBC,SAASA;YACTU,eAAe;YACfH,UAAU,WAAW,GAAGI,IAAAA,gBAAK,EAACd,MAAMe,IAAI,EAAE;gBACtCL,UAAU;oBACNV,MAAMe,IAAI,CAACL,QAAQ;oBACnB,WAAW,GAAGJ,IAAAA,eAAI,EAACN,MAAMgB,KAAK,EAAE,CAAC,GAAGZ;iBACvC;YACL;QACJ;IACJ;AACJ"}
1
+ {"version":3,"sources":["renderToastContainer.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { ToastContainerState, ToastContainerSlots, ToastContainerContextValues } from './ToastContainer.types';\nimport { ToastContainerContextProvider } from '../../contexts/toastContainerContext';\nimport { ToastContainerMotion } from './ToastContainerMotion';\n\n/**\n * Render the final JSX of ToastContainer\n */\nexport const renderToastContainer_unstable = (\n state: ToastContainerState,\n contextValues: ToastContainerContextValues,\n) => {\n const { onMotionFinish, visible, updateId } = state;\n assertSlots<ToastContainerSlots>(state);\n\n return (\n <ToastContainerContextProvider value={contextValues.toast}>\n <ToastContainerMotion appear onMotionFinish={onMotionFinish} visible={visible} unmountOnExit>\n <state.root>\n {state.root.children}\n <state.timer key={updateId} />\n </state.root>\n </ToastContainerMotion>\n </ToastContainerContextProvider>\n );\n};\n"],"names":["renderToastContainer_unstable","state","contextValues","onMotionFinish","visible","updateId","assertSlots","_jsx","ToastContainerContextProvider","value","toast","ToastContainerMotion","appear","unmountOnExit","_jsxs","root","children","timer"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAUaA;;;eAAAA;;;4BATb;gCAC4B;uCAEkB;sCACT;AAK9B,MAAMA,gCAAgC,CAC3CC,OACAC;IAEA,MAAM,EAAEC,cAAc,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGJ;IAC9CK,IAAAA,2BAAAA,EAAiCL;IAEjC,OAAA,WAAA,GACEM,IAAAA,eAAA,EAACC,oDAAAA,EAAAA;QAA8BC,OAAOP,cAAcQ,KAAK;kBACvD,WAAA,GAAAH,IAAAA,eAAA,EAACI,0CAAAA,EAAAA;YAAqBC,QAAM;YAACT,gBAAgBA;YAAgBC,SAASA;YAASS,eAAa;sBAC1F,WAAA,GAAAC,IAAAA,gBAAA,EAACb,MAAMc,IAAI,EAAA;;oBACRd,MAAMc,IAAI,CAACC,QAAQ;kCACpBT,IAAAA,eAAA,EAACN,MAAMgB,KAAK,EAAA,CAAA,GAAMZ;;;;;AAK5B"}