@fluentui/react-toast 9.2.0 → 9.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/CHANGELOG.json +70 -1
  2. package/CHANGELOG.md +20 -2
  3. package/lib/components/AriaLive/AriaLive.js.map +1 -1
  4. package/lib/components/AriaLive/renderAriaLive.js +7 -2
  5. package/lib/components/AriaLive/renderAriaLive.js.map +1 -1
  6. package/lib/components/AriaLive/useAriaLive.js +6 -4
  7. package/lib/components/AriaLive/useAriaLive.js.map +1 -1
  8. package/lib/components/Timer/Timer.js +1 -1
  9. package/lib/components/Timer/Timer.js.map +1 -1
  10. package/lib/components/Toast/Toast.js.map +1 -1
  11. package/lib/components/Toast/renderToast.js +5 -4
  12. package/lib/components/Toast/renderToast.js.map +1 -1
  13. package/lib/components/Toast/useToast.js.map +1 -1
  14. package/lib/components/Toast/useToastContextValues.js +1 -1
  15. package/lib/components/Toast/useToastContextValues.js.map +1 -1
  16. package/lib/components/ToastBody/ToastBody.js.map +1 -1
  17. package/lib/components/ToastBody/renderToastBody.js +7 -2
  18. package/lib/components/ToastBody/renderToastBody.js.map +1 -1
  19. package/lib/components/ToastBody/useToastBody.js +1 -1
  20. package/lib/components/ToastBody/useToastBody.js.map +1 -1
  21. package/lib/components/ToastContainer/ToastContainer.js.map +1 -1
  22. package/lib/components/ToastContainer/renderToastContainer.js +12 -7
  23. package/lib/components/ToastContainer/renderToastContainer.js.map +1 -1
  24. package/lib/components/ToastContainer/useToastContainer.js +15 -15
  25. package/lib/components/ToastContainer/useToastContainer.js.map +1 -1
  26. package/lib/components/ToastContainer/useToastContainerContextValues.js +1 -1
  27. package/lib/components/ToastContainer/useToastContainerContextValues.js.map +1 -1
  28. package/lib/components/ToastFooter/ToastFooter.js.map +1 -1
  29. package/lib/components/ToastFooter/renderToastFooter.js +2 -2
  30. package/lib/components/ToastFooter/renderToastFooter.js.map +1 -1
  31. package/lib/components/ToastFooter/useToastFooter.js.map +1 -1
  32. package/lib/components/ToastTitle/ToastTitle.js.map +1 -1
  33. package/lib/components/ToastTitle/renderToastTitle.js +8 -2
  34. package/lib/components/ToastTitle/renderToastTitle.js.map +1 -1
  35. package/lib/components/ToastTitle/useToastTitle.js +1 -1
  36. package/lib/components/ToastTitle/useToastTitle.js.map +1 -1
  37. package/lib/components/ToastTitle/useToastTitleStyles.styles.js.map +1 -1
  38. package/lib/components/ToastTrigger/ToastTrigger.js.map +1 -1
  39. package/lib/components/ToastTrigger/useToastTrigger.js +8 -7
  40. package/lib/components/ToastTrigger/useToastTrigger.js.map +1 -1
  41. package/lib/components/Toaster/Toaster.js.map +1 -1
  42. package/lib/components/Toaster/renderToaster.js +18 -7
  43. package/lib/components/Toaster/renderToaster.js.map +1 -1
  44. package/lib/components/Toaster/useToastAnnounce.js.map +1 -1
  45. package/lib/components/Toaster/useToaster.js +6 -6
  46. package/lib/components/Toaster/useToaster.js.map +1 -1
  47. package/lib/components/Toaster/useToasterFocusManagement.js +2 -2
  48. package/lib/components/Toaster/useToasterFocusManagement.js.map +1 -1
  49. package/lib/contexts/toastContainerContext.js.map +1 -1
  50. package/lib/state/useToastController.js +3 -2
  51. package/lib/state/useToastController.js.map +1 -1
  52. package/lib/state/useToaster.js +15 -11
  53. package/lib/state/useToaster.js.map +1 -1
  54. package/lib/state/vanilla/createToaster.js +7 -7
  55. package/lib/state/vanilla/createToaster.js.map +1 -1
  56. package/lib/state/vanilla/dismissAllToasts.js.map +1 -1
  57. package/lib/state/vanilla/dismissToast.js.map +1 -1
  58. package/lib/state/vanilla/dispatchToast.js.map +1 -1
  59. package/lib/state/vanilla/getPositionStyles.js +1 -1
  60. package/lib/state/vanilla/getPositionStyles.js.map +1 -1
  61. package/lib/state/vanilla/pauseToast.js.map +1 -1
  62. package/lib/state/vanilla/playToast.js.map +1 -1
  63. package/lib/state/vanilla/updateToast.js.map +1 -1
  64. package/lib-commonjs/AriaLive.js +2 -2
  65. package/lib-commonjs/AriaLive.js.map +1 -1
  66. package/lib-commonjs/Toast.js +2 -2
  67. package/lib-commonjs/Toast.js.map +1 -1
  68. package/lib-commonjs/ToastBody.js +2 -2
  69. package/lib-commonjs/ToastBody.js.map +1 -1
  70. package/lib-commonjs/ToastContainer.js +2 -2
  71. package/lib-commonjs/ToastContainer.js.map +1 -1
  72. package/lib-commonjs/ToastFooter.js +2 -2
  73. package/lib-commonjs/ToastFooter.js.map +1 -1
  74. package/lib-commonjs/ToastTitle.js +2 -2
  75. package/lib-commonjs/ToastTitle.js.map +1 -1
  76. package/lib-commonjs/ToastTrigger.js +2 -2
  77. package/lib-commonjs/ToastTrigger.js.map +1 -1
  78. package/lib-commonjs/Toaster.js +2 -2
  79. package/lib-commonjs/Toaster.js.map +1 -1
  80. package/lib-commonjs/components/AriaLive/AriaLive.js +7 -5
  81. package/lib-commonjs/components/AriaLive/AriaLive.js.map +1 -1
  82. package/lib-commonjs/components/AriaLive/AriaLive.types.js +2 -2
  83. package/lib-commonjs/components/AriaLive/AriaLive.types.js.map +1 -1
  84. package/lib-commonjs/components/AriaLive/index.js +6 -6
  85. package/lib-commonjs/components/AriaLive/index.js.map +1 -1
  86. package/lib-commonjs/components/AriaLive/renderAriaLive.js +13 -6
  87. package/lib-commonjs/components/AriaLive/renderAriaLive.js.map +1 -1
  88. package/lib-commonjs/components/AriaLive/useAriaLive.js +16 -12
  89. package/lib-commonjs/components/AriaLive/useAriaLive.js.map +1 -1
  90. package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.js +7 -3
  91. package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.js.map +1 -1
  92. package/lib-commonjs/components/Timer/Timer.js +8 -6
  93. package/lib-commonjs/components/Timer/Timer.js.map +1 -1
  94. package/lib-commonjs/components/Timer/index.js +2 -2
  95. package/lib-commonjs/components/Timer/index.js.map +1 -1
  96. package/lib-commonjs/components/Timer/useTimerStyles.styles.js +4 -2
  97. package/lib-commonjs/components/Timer/useTimerStyles.styles.js.map +1 -1
  98. package/lib-commonjs/components/Toast/Toast.js +7 -5
  99. package/lib-commonjs/components/Toast/Toast.js.map +1 -1
  100. package/lib-commonjs/components/Toast/index.js +6 -6
  101. package/lib-commonjs/components/Toast/index.js.map +1 -1
  102. package/lib-commonjs/components/Toast/renderToast.js +12 -9
  103. package/lib-commonjs/components/Toast/renderToast.js.map +1 -1
  104. package/lib-commonjs/components/Toast/useToast.js +7 -5
  105. package/lib-commonjs/components/Toast/useToast.js.map +1 -1
  106. package/lib-commonjs/components/Toast/useToastContextValues.js +4 -2
  107. package/lib-commonjs/components/Toast/useToastContextValues.js.map +1 -1
  108. package/lib-commonjs/components/Toast/useToastStyles.styles.js +8 -4
  109. package/lib-commonjs/components/Toast/useToastStyles.styles.js.map +1 -1
  110. package/lib-commonjs/components/ToastBody/ToastBody.js +7 -5
  111. package/lib-commonjs/components/ToastBody/ToastBody.js.map +1 -1
  112. package/lib-commonjs/components/ToastBody/index.js +6 -6
  113. package/lib-commonjs/components/ToastBody/index.js.map +1 -1
  114. package/lib-commonjs/components/ToastBody/renderToastBody.js +13 -6
  115. package/lib-commonjs/components/ToastBody/renderToastBody.js.map +1 -1
  116. package/lib-commonjs/components/ToastBody/useToastBody.js +11 -9
  117. package/lib-commonjs/components/ToastBody/useToastBody.js.map +1 -1
  118. package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.js +9 -5
  119. package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.js.map +1 -1
  120. package/lib-commonjs/components/ToastContainer/ToastContainer.js +7 -5
  121. package/lib-commonjs/components/ToastContainer/ToastContainer.js.map +1 -1
  122. package/lib-commonjs/components/ToastContainer/ToastContainer.types.js +2 -2
  123. package/lib-commonjs/components/ToastContainer/ToastContainer.types.js.map +1 -1
  124. package/lib-commonjs/components/ToastContainer/index.js +7 -7
  125. package/lib-commonjs/components/ToastContainer/index.js.map +1 -1
  126. package/lib-commonjs/components/ToastContainer/renderToastContainer.js +19 -12
  127. package/lib-commonjs/components/ToastContainer/renderToastContainer.js.map +1 -1
  128. package/lib-commonjs/components/ToastContainer/useToastContainer.js +42 -40
  129. package/lib-commonjs/components/ToastContainer/useToastContainer.js.map +1 -1
  130. package/lib-commonjs/components/ToastContainer/useToastContainerContextValues.js +6 -4
  131. package/lib-commonjs/components/ToastContainer/useToastContainerContextValues.js.map +1 -1
  132. package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.js +8 -4
  133. package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.js.map +1 -1
  134. package/lib-commonjs/components/ToastFooter/ToastFooter.js +7 -5
  135. package/lib-commonjs/components/ToastFooter/ToastFooter.js.map +1 -1
  136. package/lib-commonjs/components/ToastFooter/index.js +6 -6
  137. package/lib-commonjs/components/ToastFooter/index.js.map +1 -1
  138. package/lib-commonjs/components/ToastFooter/renderToastFooter.js +8 -6
  139. package/lib-commonjs/components/ToastFooter/renderToastFooter.js.map +1 -1
  140. package/lib-commonjs/components/ToastFooter/useToastFooter.js +7 -5
  141. package/lib-commonjs/components/ToastFooter/useToastFooter.js.map +1 -1
  142. package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.js +7 -3
  143. package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.js.map +1 -1
  144. package/lib-commonjs/components/ToastTitle/ToastTitle.js +7 -5
  145. package/lib-commonjs/components/ToastTitle/ToastTitle.js.map +1 -1
  146. package/lib-commonjs/components/ToastTitle/index.js +6 -6
  147. package/lib-commonjs/components/ToastTitle/index.js.map +1 -1
  148. package/lib-commonjs/components/ToastTitle/renderToastTitle.js +14 -6
  149. package/lib-commonjs/components/ToastTitle/renderToastTitle.js.map +1 -1
  150. package/lib-commonjs/components/ToastTitle/useToastTitle.js +17 -15
  151. package/lib-commonjs/components/ToastTitle/useToastTitle.js.map +1 -1
  152. package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.js +13 -9
  153. package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.js.map +1 -1
  154. package/lib-commonjs/components/ToastTrigger/ToastTrigger.js +5 -3
  155. package/lib-commonjs/components/ToastTrigger/ToastTrigger.js.map +1 -1
  156. package/lib-commonjs/components/ToastTrigger/ToastTrigger.types.js +2 -2
  157. package/lib-commonjs/components/ToastTrigger/ToastTrigger.types.js.map +1 -1
  158. package/lib-commonjs/components/ToastTrigger/index.js +5 -5
  159. package/lib-commonjs/components/ToastTrigger/index.js.map +1 -1
  160. package/lib-commonjs/components/ToastTrigger/renderToastTrigger.js +3 -1
  161. package/lib-commonjs/components/ToastTrigger/renderToastTrigger.js.map +1 -1
  162. package/lib-commonjs/components/ToastTrigger/useToastTrigger.js +18 -15
  163. package/lib-commonjs/components/ToastTrigger/useToastTrigger.js.map +1 -1
  164. package/lib-commonjs/components/Toaster/Toaster.js +7 -5
  165. package/lib-commonjs/components/Toaster/Toaster.js.map +1 -1
  166. package/lib-commonjs/components/Toaster/index.js +6 -6
  167. package/lib-commonjs/components/Toaster/index.js.map +1 -1
  168. package/lib-commonjs/components/Toaster/renderToaster.js +26 -13
  169. package/lib-commonjs/components/Toaster/renderToaster.js.map +1 -1
  170. package/lib-commonjs/components/Toaster/useToastAnnounce.js +8 -6
  171. package/lib-commonjs/components/Toaster/useToastAnnounce.js.map +1 -1
  172. package/lib-commonjs/components/Toaster/useToaster.js +24 -22
  173. package/lib-commonjs/components/Toaster/useToaster.js.map +1 -1
  174. package/lib-commonjs/components/Toaster/useToasterFocusManagement.js +19 -17
  175. package/lib-commonjs/components/Toaster/useToasterFocusManagement.js.map +1 -1
  176. package/lib-commonjs/components/Toaster/useToasterStyles.styles.js +7 -3
  177. package/lib-commonjs/components/Toaster/useToasterStyles.styles.js.map +1 -1
  178. package/lib-commonjs/contexts/toastContainerContext.js +8 -4
  179. package/lib-commonjs/contexts/toastContainerContext.js.map +1 -1
  180. package/lib-commonjs/index.js +93 -35
  181. package/lib-commonjs/index.js.map +1 -1
  182. package/lib-commonjs/state/constants.js +6 -2
  183. package/lib-commonjs/state/constants.js.map +1 -1
  184. package/lib-commonjs/state/index.js +10 -6
  185. package/lib-commonjs/state/index.js.map +1 -1
  186. package/lib-commonjs/state/types.js +2 -2
  187. package/lib-commonjs/state/types.js.map +1 -1
  188. package/lib-commonjs/state/useToastController.js +9 -6
  189. package/lib-commonjs/state/useToastController.js.map +1 -1
  190. package/lib-commonjs/state/useToaster.js +26 -20
  191. package/lib-commonjs/state/useToaster.js.map +1 -1
  192. package/lib-commonjs/state/vanilla/createToaster.js +14 -12
  193. package/lib-commonjs/state/vanilla/createToaster.js.map +1 -1
  194. package/lib-commonjs/state/vanilla/dismissAllToasts.js +3 -1
  195. package/lib-commonjs/state/vanilla/dismissAllToasts.js.map +1 -1
  196. package/lib-commonjs/state/vanilla/dismissToast.js +3 -1
  197. package/lib-commonjs/state/vanilla/dismissToast.js.map +1 -1
  198. package/lib-commonjs/state/vanilla/dispatchToast.js +3 -1
  199. package/lib-commonjs/state/vanilla/dispatchToast.js.map +1 -1
  200. package/lib-commonjs/state/vanilla/getPositionStyles.js +4 -2
  201. package/lib-commonjs/state/vanilla/getPositionStyles.js.map +1 -1
  202. package/lib-commonjs/state/vanilla/index.js +9 -9
  203. package/lib-commonjs/state/vanilla/index.js.map +1 -1
  204. package/lib-commonjs/state/vanilla/pauseToast.js +3 -1
  205. package/lib-commonjs/state/vanilla/pauseToast.js.map +1 -1
  206. package/lib-commonjs/state/vanilla/playToast.js +3 -1
  207. package/lib-commonjs/state/vanilla/playToast.js.map +1 -1
  208. package/lib-commonjs/state/vanilla/updateToast.js +3 -1
  209. package/lib-commonjs/state/vanilla/updateToast.js.map +1 -1
  210. package/package.json +14 -14
package/CHANGELOG.json CHANGED
@@ -2,7 +2,76 @@
2
2
  "name": "@fluentui/react-toast",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 29 Aug 2023 12:53:35 GMT",
5
+ "date": "Tue, 05 Sep 2023 13:23:14 GMT",
6
+ "tag": "@fluentui/react-toast_v9.2.1",
7
+ "version": "9.2.1",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "bernardo.sunderhus@gmail.com",
12
+ "package": "@fluentui/react-toast",
13
+ "commit": "b93c2ac22355b6cb6f33dd509c6cd9c21f4fffc8",
14
+ "comment": "bumps @swc/helpers version to 0.5.1"
15
+ },
16
+ {
17
+ "author": "bernardo.sunderhus@gmail.com",
18
+ "package": "@fluentui/react-toast",
19
+ "commit": "eea6d93a62249ba4fba3347fb291c67ee1a3fb24",
20
+ "comment": "chore: migrate package to use JSX importSource"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-toast",
25
+ "comment": "Bump @fluentui/keyboard-keys to v9.0.4",
26
+ "commit": "0bf811dbcaaa6b78743537d142fe4d348b457045"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-toast",
31
+ "comment": "Bump @fluentui/react-aria to v9.3.34",
32
+ "commit": "0bf811dbcaaa6b78743537d142fe4d348b457045"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-toast",
37
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.4",
38
+ "commit": "0bf811dbcaaa6b78743537d142fe4d348b457045"
39
+ },
40
+ {
41
+ "author": "beachball",
42
+ "package": "@fluentui/react-toast",
43
+ "comment": "Bump @fluentui/react-portal to v9.3.11",
44
+ "commit": "0bf811dbcaaa6b78743537d142fe4d348b457045"
45
+ },
46
+ {
47
+ "author": "beachball",
48
+ "package": "@fluentui/react-toast",
49
+ "comment": "Bump @fluentui/react-shared-contexts to v9.7.3",
50
+ "commit": "0bf811dbcaaa6b78743537d142fe4d348b457045"
51
+ },
52
+ {
53
+ "author": "beachball",
54
+ "package": "@fluentui/react-toast",
55
+ "comment": "Bump @fluentui/react-tabster to v9.12.6",
56
+ "commit": "0bf811dbcaaa6b78743537d142fe4d348b457045"
57
+ },
58
+ {
59
+ "author": "beachball",
60
+ "package": "@fluentui/react-toast",
61
+ "comment": "Bump @fluentui/react-theme to v9.1.12",
62
+ "commit": "0bf811dbcaaa6b78743537d142fe4d348b457045"
63
+ },
64
+ {
65
+ "author": "beachball",
66
+ "package": "@fluentui/react-toast",
67
+ "comment": "Bump @fluentui/react-utilities to v9.13.1",
68
+ "commit": "0bf811dbcaaa6b78743537d142fe4d348b457045"
69
+ }
70
+ ]
71
+ }
72
+ },
73
+ {
74
+ "date": "Tue, 29 Aug 2023 12:57:35 GMT",
6
75
  "tag": "@fluentui/react-toast_v9.2.0",
7
76
  "version": "9.2.0",
8
77
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,30 @@
1
1
  # Change Log - @fluentui/react-toast
2
2
 
3
- This log was last generated on Tue, 29 Aug 2023 12:53:35 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 05 Sep 2023 13:23:14 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.2.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-toast_v9.2.1)
8
+
9
+ Tue, 05 Sep 2023 13:23:14 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toast_v9.2.0..@fluentui/react-toast_v9.2.1)
11
+
12
+ ### Patches
13
+
14
+ - bumps @swc/helpers version to 0.5.1 ([PR #28989](https://github.com/microsoft/fluentui/pull/28989) by bernardo.sunderhus@gmail.com)
15
+ - chore: migrate package to use JSX importSource ([PR #28959](https://github.com/microsoft/fluentui/pull/28959) by bernardo.sunderhus@gmail.com)
16
+ - Bump @fluentui/keyboard-keys to v9.0.4 ([PR #27840](https://github.com/microsoft/fluentui/pull/27840) by beachball)
17
+ - Bump @fluentui/react-aria to v9.3.34 ([PR #27840](https://github.com/microsoft/fluentui/pull/27840) by beachball)
18
+ - Bump @fluentui/react-jsx-runtime to v9.0.4 ([PR #27840](https://github.com/microsoft/fluentui/pull/27840) by beachball)
19
+ - Bump @fluentui/react-portal to v9.3.11 ([PR #27840](https://github.com/microsoft/fluentui/pull/27840) by beachball)
20
+ - Bump @fluentui/react-shared-contexts to v9.7.3 ([PR #27840](https://github.com/microsoft/fluentui/pull/27840) by beachball)
21
+ - Bump @fluentui/react-tabster to v9.12.6 ([PR #27840](https://github.com/microsoft/fluentui/pull/27840) by beachball)
22
+ - Bump @fluentui/react-theme to v9.1.12 ([PR #27840](https://github.com/microsoft/fluentui/pull/27840) by beachball)
23
+ - Bump @fluentui/react-utilities to v9.13.1 ([PR #27840](https://github.com/microsoft/fluentui/pull/27840) by beachball)
24
+
7
25
  ## [9.2.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-toast_v9.2.0)
8
26
 
9
- Tue, 29 Aug 2023 12:53:35 GMT
27
+ Tue, 29 Aug 2023 12:57:35 GMT
10
28
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toast_v9.1.6..@fluentui/react-toast_v9.2.0)
11
29
 
12
30
  ### Minor changes
@@ -1 +1 @@
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":["React","useAriaLive_unstable","renderAriaLive_unstable","useAriaLiveStyles_unstable","AriaLive","props","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,6BAA6B;AAGxE;;CAEC,GACD,OAAO,MAAMC,WAAoCC,CAAAA,QAAS;IACxD,MAAMC,QAAQL,qBAAqBI;IAEnCF,2BAA2BG;IAC3B,OAAOJ,wBAAwBI;AACjC,EAAE;AAEFF,SAASG,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":["React","useAriaLive_unstable","renderAriaLive_unstable","useAriaLiveStyles_unstable","AriaLive","props","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,6BAA6B;AAGxE;;CAEC,GACD,OAAO,MAAMC,WAAoCC,CAAAA;IAC/C,MAAMC,QAAQL,qBAAqBI;IAEnCF,2BAA2BG;IAC3B,OAAOJ,wBAAwBI;AACjC,EAAE;AAEFF,SAASG,WAAW,GAAG"}
@@ -1,8 +1,13 @@
1
- /** @jsxRuntime classic */ /** @jsxFrag Fragment */ /** @jsx createElement */ import { createElement, Fragment } from '@fluentui/react-jsx-runtime';
1
+ /** @jsxRuntime automatic */ /** @jsxImportSource @fluentui/react-jsx-runtime */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
2
  import { assertSlots } from '@fluentui/react-utilities';
3
3
  /**
4
4
  * Render the final JSX of AriaLive
5
5
  */ export const renderAriaLive_unstable = (state)=>{
6
6
  assertSlots(state);
7
- return /*#__PURE__*/ createElement(Fragment, null, /*#__PURE__*/ createElement(state.assertive, null), /*#__PURE__*/ createElement(state.polite, null));
7
+ return /*#__PURE__*/ _jsxs(_Fragment, {
8
+ children: [
9
+ /*#__PURE__*/ _jsx(state.assertive, {}),
10
+ /*#__PURE__*/ _jsx(state.polite, {})
11
+ ]
12
+ });
8
13
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["renderAriaLive.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsxFrag Fragment */\n/** @jsx createElement */\n\nimport { createElement, Fragment } from '@fluentui/react-jsx-runtime';\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":["createElement","Fragment","assertSlots","renderAriaLive_unstable","state","assertive","polite"],"mappings":"AAAA,wBAAwB,GACxB,sBAAsB,GACtB,uBAAuB,GAEvB,SAASA,aAAa,EAAEC,QAAQ,QAAQ,8BAA8B;AACtE,SAASC,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,0BAA0B,CAACC,QAAyB;IAC/DF,YAA2BE;IAE3B,qBACE,AAbJ,cADA,8BAeM,AAdN,cAcOA,MAAMC,SAAS,uBAChB,AAfN,cAeOD,MAAME,MAAM;AAGnB,EAAE"}
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":["assertSlots","renderAriaLive_unstable","state","assertive","polite"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,0BAA0B,CAACC;IACtCF,YAA2BE;IAE3B,qBACE;;0BACE,KAACA,MAAMC,SAAS;0BAChB,KAACD,MAAME,MAAM;;;AAGnB,EAAE"}
@@ -9,6 +9,7 @@ import { createPriorityQueue, useEventCallback, slot } from '@fluentui/react-uti
9
9
  *
10
10
  * @param props - props from this instance of AriaLive
11
11
  */ export const useAriaLive_unstable = (props)=>{
12
+ var _currentMessage, _currentMessage1;
12
13
  const [currentMessage, setCurrentMessage] = React.useState(undefined);
13
14
  // Can't rely on Date.now() if user invokes announce more than once in a code block
14
15
  const order = React.useRef(0);
@@ -19,8 +20,9 @@ import { createPriorityQueue, useEventCallback, slot } from '@fluentui/react-uti
19
20
  return a.politeness === 'assertive' ? -1 : 1;
20
21
  }));
21
22
  const announce = useEventCallback((message, options)=>{
22
- const { politeness } = options;
23
- if (message === (currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.message)) {
23
+ var _currentMessage;
24
+ const { politeness } = options;
25
+ if (message === ((_currentMessage = currentMessage) === null || _currentMessage === void 0 ? void 0 : _currentMessage.message)) {
24
26
  return;
25
27
  }
26
28
  const liveMessage = {
@@ -48,8 +50,8 @@ import { createPriorityQueue, useEventCallback, slot } from '@fluentui/react-uti
48
50
  messageQueue
49
51
  ]);
50
52
  React.useImperativeHandle(props.announceRef, ()=>announce);
51
- const politeMessage = (currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.politeness) === 'polite' ? currentMessage.message : undefined;
52
- const assertiveMessage = (currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.politeness) === 'assertive' ? currentMessage.message : undefined;
53
+ const politeMessage = ((_currentMessage = currentMessage) === null || _currentMessage === void 0 ? void 0 : _currentMessage.politeness) === 'polite' ? currentMessage.message : undefined;
54
+ const assertiveMessage = ((_currentMessage1 = currentMessage) === null || _currentMessage1 === void 0 ? void 0 : _currentMessage1.politeness) === 'assertive' ? currentMessage.message : undefined;
53
55
  return {
54
56
  components: {
55
57
  assertive: 'div',
@@ -1 +1 @@
1
- {"version":3,"sources":["useAriaLive.ts"],"sourcesContent":["import * as React from 'react';\nimport { createPriorityQueue, useEventCallback, slot } 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 React.useEffect(() => {\n const timeout = setTimeout(() => {\n if (messageQueue.peek()) {\n setCurrentMessage(messageQueue.dequeue());\n } else {\n setCurrentMessage(undefined);\n }\n }, MESSAGE_DURATION);\n\n return () => clearTimeout(timeout);\n }, [currentMessage, messageQueue]);\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":["React","createPriorityQueue","useEventCallback","slot","MESSAGE_DURATION","useAriaLive_unstable","props","currentMessage","setCurrentMessage","useState","undefined","order","useRef","messageQueue","a","b","politeness","createdAt","announce","message","options","liveMessage","current","enqueue","useEffect","timeout","setTimeout","peek","dequeue","clearTimeout","useImperativeHandle","announceRef","politeMessage","assertiveMessage","components","assertive","polite","always","defaultProps","children","elementType"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,mBAAmB,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,4BAA4B;AAGxF,gHAAgH,GAChH,MAAMC,mBAAmB;AAEzB;;;;;;;CAOC,GACD,OAAO,MAAMC,uBAAuB,CAACC,QAAwC;IAC3E,MAAM,CAACC,gBAAgBC,kBAAkB,GAAGR,MAAMS,QAAQ,CAA0BC;IACpF,mFAAmF;IACnF,MAAMC,QAAQX,MAAMY,MAAM,CAAC;IAC3B,MAAM,CAACC,aAAa,GAAGb,MAAMS,QAAQ,CAAC,IACpCR,oBAAiC,CAACa,GAAGC,IAAM;YACzC,IAAID,EAAEE,UAAU,KAAKD,EAAEC,UAAU,EAAE;gBACjC,OAAOF,EAAEG,SAAS,GAAGF,EAAEE,SAAS;YAClC,CAAC;YAED,OAAOH,EAAEE,UAAU,KAAK,cAAc,CAAC,IAAI,CAAC;QAC9C;IAGF,MAAME,WAAWhB,iBAAiB,CAACiB,SAAiBC,UAA6B;QAC/E,MAAM,EAAEJ,WAAU,EAAE,GAAGI;QACvB,IAAID,YAAYZ,CAAAA,2BAAAA,4BAAAA,KAAAA,IAAAA,eAAgBY,OAAO,AAAD,GAAG;YACvC;QACF,CAAC;QAED,MAAME,cAA2B;YAC/BF;YACAH;YACAC,WAAWN,MAAMW,OAAO;QAC1B;QAEA,IAAI,CAACf,gBAAgB;YACnBC,kBAAkBa;QACpB,OAAO;YACLR,aAAaU,OAAO,CAACF;QACvB,CAAC;IACH;IAEArB,MAAMwB,SAAS,CAAC,IAAM;QACpB,MAAMC,UAAUC,WAAW,IAAM;YAC/B,IAAIb,aAAac,IAAI,IAAI;gBACvBnB,kBAAkBK,aAAae,OAAO;YACxC,OAAO;gBACLpB,kBAAkBE;YACpB,CAAC;QACH,GAAGN;QAEH,OAAO,IAAMyB,aAAaJ;IAC5B,GAAG;QAAClB;QAAgBM;KAAa;IAEjCb,MAAM8B,mBAAmB,CAACxB,MAAMyB,WAAW,EAAE,IAAMb;IAEnD,MAAMc,gBAAgBzB,CAAAA,2BAAAA,4BAAAA,KAAAA,IAAAA,eAAgBS,UAAU,AAAD,MAAM,WAAWT,eAAeY,OAAO,GAAGT,SAAS;IAClG,MAAMuB,mBAAmB1B,CAAAA,2BAAAA,4BAAAA,KAAAA,IAAAA,eAAgBS,UAAU,AAAD,MAAM,cAAcT,eAAeY,OAAO,GAAGT,SAAS;IAExG,OAAO;QACLwB,YAAY;YACVC,WAAW;YACXC,QAAQ;QACV;QAEAD,WAAWhC,KAAKkC,MAAM,CAAC/B,MAAM6B,SAAS,EAAE;YACtCG,cAAc;gBAAE,aAAa;gBAAaC,UAAUN;YAAiB;YACrEO,aAAa;QACf;QACAJ,QAAQjC,KAAKkC,MAAM,CAAC/B,MAAM8B,MAAM,EAAE;YAChCE,cAAc;gBAAE,aAAa;gBAAUC,UAAUP;YAAc;YAC/DQ,aAAa;QACf;IACF;AACF,EAAE"}
1
+ {"version":3,"sources":["useAriaLive.ts"],"sourcesContent":["import * as React from 'react';\nimport { createPriorityQueue, useEventCallback, slot } 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 React.useEffect(() => {\n const timeout = setTimeout(() => {\n if (messageQueue.peek()) {\n setCurrentMessage(messageQueue.dequeue());\n } else {\n setCurrentMessage(undefined);\n }\n }, MESSAGE_DURATION);\n\n return () => clearTimeout(timeout);\n }, [currentMessage, messageQueue]);\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":["React","createPriorityQueue","useEventCallback","slot","MESSAGE_DURATION","useAriaLive_unstable","props","currentMessage","setCurrentMessage","useState","undefined","order","useRef","messageQueue","a","b","politeness","createdAt","announce","message","options","liveMessage","current","enqueue","useEffect","timeout","setTimeout","peek","dequeue","clearTimeout","useImperativeHandle","announceRef","politeMessage","assertiveMessage","components","assertive","polite","always","defaultProps","children","elementType"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,mBAAmB,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,4BAA4B;AAGxF,gHAAgH,GAChH,MAAMC,mBAAmB;AAEzB;;;;;;;CAOC,GACD,OAAO,MAAMC,uBAAuB,CAACC;QA+CbC,iBACGA;IA/CzB,MAAM,CAACA,gBAAgBC,kBAAkB,GAAGR,MAAMS,QAAQ,CAA0BC;IACpF,mFAAmF;IACnF,MAAMC,QAAQX,MAAMY,MAAM,CAAC;IAC3B,MAAM,CAACC,aAAa,GAAGb,MAAMS,QAAQ,CAAC,IACpCR,oBAAiC,CAACa,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,WAAWhB,iBAAiB,CAACiB,SAAiBC;YAElCb;QADhB,MAAM,EAAES,UAAU,EAAE,GAAGI;QACvB,IAAID,cAAYZ,kBAAAA,4BAAAA,sCAAAA,gBAAgBY,OAAO,GAAE;YACvC;QACF;QAEA,MAAME,cAA2B;YAC/BF;YACAH;YACAC,WAAWN,MAAMW,OAAO;QAC1B;QAEA,IAAI,CAACf,gBAAgB;YACnBC,kBAAkBa;QACpB,OAAO;YACLR,aAAaU,OAAO,CAACF;QACvB;IACF;IAEArB,MAAMwB,SAAS,CAAC;QACd,MAAMC,UAAUC,WAAW;YACzB,IAAIb,aAAac,IAAI,IAAI;gBACvBnB,kBAAkBK,aAAae,OAAO;YACxC,OAAO;gBACLpB,kBAAkBE;YACpB;QACF,GAAGN;QAEH,OAAO,IAAMyB,aAAaJ;IAC5B,GAAG;QAAClB;QAAgBM;KAAa;IAEjCb,MAAM8B,mBAAmB,CAACxB,MAAMyB,WAAW,EAAE,IAAMb;IAEnD,MAAMc,gBAAgBzB,EAAAA,kBAAAA,4BAAAA,sCAAAA,gBAAgBS,UAAU,MAAK,WAAWT,eAAeY,OAAO,GAAGT;IACzF,MAAMuB,mBAAmB1B,EAAAA,mBAAAA,4BAAAA,uCAAAA,iBAAgBS,UAAU,MAAK,cAAcT,eAAeY,OAAO,GAAGT;IAE/F,OAAO;QACLwB,YAAY;YACVC,WAAW;YACXC,QAAQ;QACV;QAEAD,WAAWhC,KAAKkC,MAAM,CAAC/B,MAAM6B,SAAS,EAAE;YACtCG,cAAc;gBAAE,aAAa;gBAAaC,UAAUN;YAAiB;YACrEO,aAAa;QACf;QACAJ,QAAQjC,KAAKkC,MAAM,CAAC/B,MAAM8B,MAAM,EAAE;YAChCE,cAAc;gBAAE,aAAa;gBAAUC,UAAUP;YAAc;YAC/DQ,aAAa;QACf;IACF;AACF,EAAE"}
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { useBaseAnimationStyles } from './useTimerStyles.styles';
3
3
  export const Timer = /*#__PURE__*/ React.forwardRef((props, ref)=>{
4
4
  const baseAnimationStyles = useBaseAnimationStyles();
5
- const { running , timeout , onTimeout } = props;
5
+ const { running, timeout, onTimeout } = props;
6
6
  const style = {
7
7
  animationDuration: `${timeout}ms`,
8
8
  animationPlayState: running ? 'running' : 'paused'
@@ -1 +1 @@
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 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":["React","useBaseAnimationStyles","Timer","forwardRef","props","ref","baseAnimationStyles","running","timeout","onTimeout","style","animationDuration","animationPlayState","span","onAnimationEnd","data-timer-status","className","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sBAAsB,QAAQ,0BAA0B;AASjE,OAAO,MAAMC,sBAAQF,MAAMG,UAAU,CAA6B,CAACC,OAAOC,MAAQ;IAChF,MAAMC,sBAAsBL;IAC5B,MAAM,EAAEM,QAAO,EAAEC,QAAO,EAAEC,UAAS,EAAE,GAAGL;IAExC,MAAMM,QAA6B;QACjCC,mBAAmB,CAAC,EAAEH,QAAQ,EAAE,CAAC;QACjCI,oBAAoBL,UAAU,YAAY,QAAQ;IACpD;IAEA,IAAIC,UAAU,GAAG;QACf,OAAO,IAAI;IACb,CAAC;IAED,qBACE,oBAACK;QACCC,gBAAgBL;QAChBM,qBAAmBL,MAAME,kBAAkB;QAC3CP,KAAKA;QACLK,OAAOA;QACPM,WAAWV;;AAGjB,GAAG;AAEHJ,MAAMe,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 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":["React","useBaseAnimationStyles","Timer","forwardRef","props","ref","baseAnimationStyles","running","timeout","onTimeout","style","animationDuration","animationPlayState","span","onAnimationEnd","data-timer-status","className","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sBAAsB,QAAQ,0BAA0B;AASjE,OAAO,MAAMC,sBAAQF,MAAMG,UAAU,CAA6B,CAACC,OAAOC;IACxE,MAAMC,sBAAsBL;IAC5B,MAAM,EAAEM,OAAO,EAAEC,OAAO,EAAEC,SAAS,EAAE,GAAGL;IAExC,MAAMM,QAA6B;QACjCC,mBAAmB,CAAC,EAAEH,QAAQ,EAAE,CAAC;QACjCI,oBAAoBL,UAAU,YAAY;IAC5C;IAEA,IAAIC,UAAU,GAAG;QACf,OAAO;IACT;IAEA,qBACE,oBAACK;QACCC,gBAAgBL;QAChBM,qBAAmBL,MAAME,kBAAkB;QAC3CP,KAAKA;QACLK,OAAOA;QACPM,WAAWV;;AAGjB,GAAG;AAEHJ,MAAMe,WAAW,GAAG"}
@@ -1 +1 @@
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":["React","useToast_unstable","renderToast_unstable","useToastStyles_unstable","useToastContextValues_unstable","Toast","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,uBAAuB,QAAQ,0BAA0B;AAGlE,SAASC,8BAA8B,QAAQ,0BAA0B;AAEzE;;CAEC,GACD,OAAO,MAAMC,sBAAyCL,MAAMM,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACrF,MAAMC,QAAQR,kBAAkBM,OAAOC;IAEvCL,wBAAwBM;IACxB,OAAOP,qBAAqBO,OAAOL,+BAA+BK;AACpE,GAAG;AAEHJ,MAAMK,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":["React","useToast_unstable","renderToast_unstable","useToastStyles_unstable","useToastContextValues_unstable","Toast","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,uBAAuB,QAAQ,0BAA0B;AAGlE,SAASC,8BAA8B,QAAQ,0BAA0B;AAEzE;;CAEC,GACD,OAAO,MAAMC,sBAAyCL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC7E,MAAMC,QAAQR,kBAAkBM,OAAOC;IAEvCL,wBAAwBM;IACxB,OAAOP,qBAAqBO,OAAOL,+BAA+BK;AACpE,GAAG;AAEHJ,MAAMK,WAAW,GAAG"}
@@ -1,11 +1,12 @@
1
- /** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';
1
+ /** @jsxRuntime automatic */ /** @jsxImportSource @fluentui/react-jsx-runtime */ import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
2
  import { assertSlots } from '@fluentui/react-utilities';
3
3
  import { BackgroundAppearanceProvider } from '@fluentui/react-shared-contexts';
4
4
  /**
5
5
  * Render the final JSX of Toast
6
6
  */ export const renderToast_unstable = (state, contextValues)=>{
7
7
  assertSlots(state);
8
- return /*#__PURE__*/ createElement(BackgroundAppearanceProvider, {
9
- value: contextValues.backgroundAppearance
10
- }, /*#__PURE__*/ createElement(state.root, null));
8
+ return /*#__PURE__*/ _jsx(BackgroundAppearanceProvider, {
9
+ value: contextValues.backgroundAppearance,
10
+ children: /*#__PURE__*/ _jsx(state.root, {})
11
+ });
11
12
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["renderToast.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsx createElement */\n\nimport { createElement } from '@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":["createElement","assertSlots","BackgroundAppearanceProvider","renderToast_unstable","state","contextValues","value","backgroundAppearance","root"],"mappings":"AAAA,wBAAwB,GACxB,uBAAuB,GAEvB,SAASA,aAAa,QAAQ,8BAA8B;AAC5D,SAASC,WAAW,QAAQ,4BAA4B;AACxD,SAASC,4BAA4B,QAAQ,kCAAkC;AAG/E;;CAEC,GACD,OAAO,MAAMC,uBAAuB,CAACC,OAAmBC,gBAAsC;IAC5FJ,YAAwBG;IAExB,qBACE,AAdJ,cAcKF;QAA6BI,OAAOD,cAAcE,oBAAoB;qBACrE,AAfN,cAeOH,MAAMI,IAAI;AAGjB,EAAE"}
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":["assertSlots","BackgroundAppearanceProvider","renderToast_unstable","state","contextValues","value","backgroundAppearance","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AACjD,SAASA,WAAW,QAAQ,4BAA4B;AACxD,SAASC,4BAA4B,QAAQ,kCAAkC;AAG/E;;CAEC,GACD,OAAO,MAAMC,uBAAuB,CAACC,OAAmBC;IACtDJ,YAAwBG;IAExB,qBACE,KAACF;QAA6BI,OAAOD,cAAcE,oBAAoB;kBACrE,cAAA,KAACH,MAAMI,IAAI;;AAGjB,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useToast.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, 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 getNativeElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n backgroundAppearance: props.appearance,\n };\n};\n"],"names":["React","getNativeElementProps","slot","useToast_unstable","props","ref","components","root","always","elementType","backgroundAppearance","appearance"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,IAAI,QAAQ,4BAA4B;AAGxE;;;;;;;;CAQC,GACD,OAAO,MAAMC,oBAAoB,CAACC,OAAmBC,MAA4C;IAC/F,OAAO;QACLC,YAAY;YACVC,MAAM;QACR;QACAA,MAAML,KAAKM,MAAM,CACfP,sBAAsB,OAAO;YAC3BI;YACA,GAAGD,KAAK;QACV,IACA;YAAEK,aAAa;QAAM;QAEvBC,sBAAsBN,MAAMO,UAAU;IACxC;AACF,EAAE"}
1
+ {"version":3,"sources":["useToast.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, 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 getNativeElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n backgroundAppearance: props.appearance,\n };\n};\n"],"names":["React","getNativeElementProps","slot","useToast_unstable","props","ref","components","root","always","elementType","backgroundAppearance","appearance"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,IAAI,QAAQ,4BAA4B;AAGxE;;;;;;;;CAQC,GACD,OAAO,MAAMC,oBAAoB,CAACC,OAAmBC;IACnD,OAAO;QACLC,YAAY;YACVC,MAAM;QACR;QACAA,MAAML,KAAKM,MAAM,CACfP,sBAAsB,OAAO;YAC3BI;YACA,GAAGD,KAAK;QACV,IACA;YAAEK,aAAa;QAAM;QAEvBC,sBAAsBN,MAAMO,UAAU;IACxC;AACF,EAAE"}
@@ -1,5 +1,5 @@
1
1
  export function useToastContextValues_unstable(state) {
2
- const { backgroundAppearance } = state;
2
+ const { backgroundAppearance } = state;
3
3
  return {
4
4
  backgroundAppearance
5
5
  };
@@ -1 +1 @@
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"],"mappings":"AAEA,OAAO,SAASA,+BAA+BC,KAAiB,EAAsB;IACpF,MAAM,EAAEC,qBAAoB,EAAE,GAAGD;IAEjC,OAAO;QACLC;IACF;AACF,CAAC"}
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"],"mappings":"AAEA,OAAO,SAASA,+BAA+BC,KAAiB;IAC9D,MAAM,EAAEC,oBAAoB,EAAE,GAAGD;IAEjC,OAAO;QACLC;IACF;AACF"}
@@ -1 +1 @@
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":["React","useToastBody_unstable","renderToastBody_unstable","useToastBodyStyles_unstable","ToastBody","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,8BAA8B;AAI1E;;CAEC,GACD,OAAO,MAAMC,0BAAiDJ,MAAMK,UAAU,CAAC,CAACC,OAAOC,MAAQ;IAC7F,MAAMC,QAAQP,sBAAsBK,OAAOC;IAE3CJ,4BAA4BK;IAC5B,OAAON,yBAAyBM;AAClC,GAAG;AAEHJ,UAAUK,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":["React","useToastBody_unstable","renderToastBody_unstable","useToastBodyStyles_unstable","ToastBody","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,8BAA8B;AAI1E;;CAEC,GACD,OAAO,MAAMC,0BAAiDJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,QAAQP,sBAAsBK,OAAOC;IAE3CJ,4BAA4BK;IAC5B,OAAON,yBAAyBM;AAClC,GAAG;AAEHJ,UAAUK,WAAW,GAAG"}
@@ -1,8 +1,13 @@
1
- /** @jsxRuntime classic */ /** @jsxFrag Fragment */ /** @jsx createElement */ import { createElement, Fragment } from '@fluentui/react-jsx-runtime';
1
+ /** @jsxRuntime automatic */ /** @jsxImportSource @fluentui/react-jsx-runtime */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
2
  import { assertSlots } from '@fluentui/react-utilities';
3
3
  /**
4
4
  * Render the final JSX of ToastBody
5
5
  */ export const renderToastBody_unstable = (state)=>{
6
6
  assertSlots(state);
7
- return /*#__PURE__*/ createElement(Fragment, null, /*#__PURE__*/ createElement(state.root, null), state.subtitle ? /*#__PURE__*/ createElement(state.subtitle, null) : null);
7
+ return /*#__PURE__*/ _jsxs(_Fragment, {
8
+ children: [
9
+ /*#__PURE__*/ _jsx(state.root, {}),
10
+ state.subtitle ? /*#__PURE__*/ _jsx(state.subtitle, {}) : null
11
+ ]
12
+ });
8
13
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["renderToastBody.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsxFrag Fragment */\n/** @jsx createElement */\n\nimport { createElement, Fragment } from '@fluentui/react-jsx-runtime';\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":["createElement","Fragment","assertSlots","renderToastBody_unstable","state","root","subtitle"],"mappings":"AAAA,wBAAwB,GACxB,sBAAsB,GACtB,uBAAuB,GAEvB,SAASA,aAAa,EAAEC,QAAQ,QAAQ,8BAA8B;AACtE,SAASC,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,2BAA2B,CAACC,QAA0B;IACjEF,YAA4BE;IAE5B,qBACE,AAbJ,cADA,8BAeM,AAdN,cAcOA,MAAMC,IAAI,SACVD,MAAME,QAAQ,iBAAG,AAfxB,cAeyBF,MAAME,QAAQ,UAAM,IAAI;AAGjD,EAAE"}
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":["assertSlots","renderToastBody_unstable","state","root","subtitle"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,2BAA2B,CAACC;IACvCF,YAA4BE;IAE5B,qBACE;;0BACE,KAACA,MAAMC,IAAI;YACVD,MAAME,QAAQ,iBAAG,KAACF,MAAME,QAAQ,QAAM;;;AAG7C,EAAE"}
@@ -12,7 +12,7 @@ import { useBackgroundAppearance } from '@fluentui/react-shared-contexts';
12
12
  * @param ref - reference to root HTMLElement of ToastBody
13
13
  */ export const useToastBody_unstable = (props, ref)=>{
14
14
  const backgroundAppearance = useBackgroundAppearance();
15
- const { bodyId } = useToastContainerContext();
15
+ const { bodyId } = useToastContainerContext();
16
16
  return {
17
17
  components: {
18
18
  root: 'div',
@@ -1 +1 @@
1
- {"version":3,"sources":["useToastBody.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, 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 getNativeElementProps('div', {\n ref,\n id: bodyId,\n ...props,\n }),\n { elementType: 'div' },\n ),\n backgroundAppearance,\n };\n};\n"],"names":["React","getNativeElementProps","slot","useToastContainerContext","useBackgroundAppearance","useToastBody_unstable","props","ref","backgroundAppearance","bodyId","components","root","subtitle","optional","elementType","always","id"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,IAAI,QAAQ,4BAA4B;AAExE,SAASC,wBAAwB,QAAQ,uCAAuC;AAChF,SAASC,uBAAuB,QAAQ,kCAAkC;AAE1E;;;;;;;;CAQC,GACD,OAAO,MAAMC,wBAAwB,CAACC,OAAuBC,MAAgD;IAC3G,MAAMC,uBAAuBJ;IAC7B,MAAM,EAAEK,OAAM,EAAE,GAAGN;IACnB,OAAO;QACLO,YAAY;YACVC,MAAM;YACNC,UAAU;QACZ;QACAA,UAAUV,KAAKW,QAAQ,CAACP,MAAMM,QAAQ,EAAE;YAAEE,aAAa;QAAM;QAC7DH,MAAMT,KAAKa,MAAM,CACfd,sBAAsB,OAAO;YAC3BM;YACAS,IAAIP;YACJ,GAAGH,KAAK;QACV,IACA;YAAEQ,aAAa;QAAM;QAEvBN;IACF;AACF,EAAE"}
1
+ {"version":3,"sources":["useToastBody.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, 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 getNativeElementProps('div', {\n ref,\n id: bodyId,\n ...props,\n }),\n { elementType: 'div' },\n ),\n backgroundAppearance,\n };\n};\n"],"names":["React","getNativeElementProps","slot","useToastContainerContext","useBackgroundAppearance","useToastBody_unstable","props","ref","backgroundAppearance","bodyId","components","root","subtitle","optional","elementType","always","id"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,IAAI,QAAQ,4BAA4B;AAExE,SAASC,wBAAwB,QAAQ,uCAAuC;AAChF,SAASC,uBAAuB,QAAQ,kCAAkC;AAE1E;;;;;;;;CAQC,GACD,OAAO,MAAMC,wBAAwB,CAACC,OAAuBC;IAC3D,MAAMC,uBAAuBJ;IAC7B,MAAM,EAAEK,MAAM,EAAE,GAAGN;IACnB,OAAO;QACLO,YAAY;YACVC,MAAM;YACNC,UAAU;QACZ;QACAA,UAAUV,KAAKW,QAAQ,CAACP,MAAMM,QAAQ,EAAE;YAAEE,aAAa;QAAM;QAC7DH,MAAMT,KAAKa,MAAM,CACfd,sBAAsB,OAAO;YAC3BM;YACAS,IAAIP;YACJ,GAAGH,KAAK;QACV,IACA;YAAEQ,aAAa;QAAM;QAEvBN;IACF;AACF,EAAE"}
@@ -1 +1 @@
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":["React","useToastContainer_unstable","renderToastContainer_unstable","useToastContainerStyles_unstable","useToastContainerContextValues_unstable","ToastContainer","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,mCAAmC;AAGpF,SAASC,uCAAuC,QAAQ,mCAAmC;AAE3F;;CAEC,GACD,OAAO,MAAMC,+BAA2DL,MAAMM,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACvG,MAAMC,QAAQR,2BAA2BM,OAAOC;IAEhDL,iCAAiCM;IACjC,OAAOP,8BAA8BO,OAAOL,wCAAwCK;AACtF,GAAG;AAEHJ,eAAeK,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":["React","useToastContainer_unstable","renderToastContainer_unstable","useToastContainerStyles_unstable","useToastContainerContextValues_unstable","ToastContainer","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,mCAAmC;AAGpF,SAASC,uCAAuC,QAAQ,mCAAmC;AAE3F;;CAEC,GACD,OAAO,MAAMC,+BAA2DL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQR,2BAA2BM,OAAOC;IAEhDL,iCAAiCM;IACjC,OAAOP,8BAA8BO,OAAOL,wCAAwCK;AACtF,GAAG;AAEHJ,eAAeK,WAAW,GAAG"}
@@ -1,21 +1,26 @@
1
- /** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';
1
+ /** @jsxRuntime automatic */ /** @jsxImportSource @fluentui/react-jsx-runtime */ import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
2
  import { assertSlots } from '@fluentui/react-utilities';
3
3
  import { Transition } from 'react-transition-group';
4
4
  import { ToastContainerContextProvider } from '../../contexts/toastContainerContext';
5
5
  /**
6
6
  * Render the final JSX of ToastContainer
7
7
  */ export const renderToastContainer_unstable = (state, contextValues)=>{
8
- const { onTransitionEntering , visible , transitionTimeout , remove , nodeRef } = state;
8
+ const { onTransitionEntering, visible, transitionTimeout, remove, nodeRef } = state;
9
9
  assertSlots(state);
10
- return /*#__PURE__*/ createElement(Transition, {
10
+ return /*#__PURE__*/ _jsx(Transition, {
11
11
  in: visible,
12
12
  appear: true,
13
13
  unmountOnExit: true,
14
14
  timeout: transitionTimeout,
15
15
  onExited: remove,
16
16
  onEntering: onTransitionEntering,
17
- nodeRef: nodeRef
18
- }, /*#__PURE__*/ createElement(ToastContainerContextProvider, {
19
- value: contextValues.toast
20
- }, /*#__PURE__*/ createElement(state.root, null), /*#__PURE__*/ createElement(state.timer, null)));
17
+ nodeRef: nodeRef,
18
+ children: /*#__PURE__*/ _jsxs(ToastContainerContextProvider, {
19
+ value: contextValues.toast,
20
+ children: [
21
+ /*#__PURE__*/ _jsx(state.root, {}),
22
+ /*#__PURE__*/ _jsx(state.timer, {})
23
+ ]
24
+ })
25
+ });
21
26
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["renderToastContainer.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsx createElement */\n\nimport { createElement } from '@fluentui/react-jsx-runtime';\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { Transition } from 'react-transition-group';\nimport type { ToastContainerState, ToastContainerSlots, ToastContainerContextValues } from './ToastContainer.types';\nimport { ToastContainerContextProvider } from '../../contexts/toastContainerContext';\n\n/**\n * Render the final JSX of ToastContainer\n */\nexport const renderToastContainer_unstable = (\n state: ToastContainerState,\n contextValues: ToastContainerContextValues,\n) => {\n const { onTransitionEntering, visible, transitionTimeout, remove, nodeRef } = state;\n assertSlots<ToastContainerSlots>(state);\n\n return (\n <Transition\n in={visible}\n appear\n unmountOnExit\n timeout={transitionTimeout}\n onExited={remove}\n onEntering={onTransitionEntering}\n nodeRef={nodeRef}\n >\n <ToastContainerContextProvider value={contextValues.toast}>\n <state.root />\n <state.timer />\n </ToastContainerContextProvider>\n </Transition>\n );\n};\n"],"names":["createElement","assertSlots","Transition","ToastContainerContextProvider","renderToastContainer_unstable","state","contextValues","onTransitionEntering","visible","transitionTimeout","remove","nodeRef","in","appear","unmountOnExit","timeout","onExited","onEntering","value","toast","root","timer"],"mappings":"AAAA,wBAAwB,GACxB,uBAAuB,GAEvB,SAASA,aAAa,QAAQ,8BAA8B;AAC5D,SAASC,WAAW,QAAQ,4BAA4B;AACxD,SAASC,UAAU,QAAQ,yBAAyB;AAEpD,SAASC,6BAA6B,QAAQ,uCAAuC;AAErF;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAC3CC,OACAC,gBACG;IACH,MAAM,EAAEC,qBAAoB,EAAEC,QAAO,EAAEC,kBAAiB,EAAEC,OAAM,EAAEC,QAAO,EAAE,GAAGN;IAC9EJ,YAAiCI;IAEjC,qBACE,AAnBJ,cAmBKH;QACCU,IAAIJ;QACJK,QAAAA,IAAM;QACNC,eAAAA,IAAa;QACbC,SAASN;QACTO,UAAUN;QACVO,YAAYV;QACZI,SAASA;qBAET,AA5BN,cA4BOR;QAA8Be,OAAOZ,cAAca,KAAK;qBACvD,AA7BR,cA6BSd,MAAMe,IAAI,uBACX,AA9BR,cA8BSf,MAAMgB,KAAK;AAIpB,EAAE"}
1
+ {"version":3,"sources":["renderToastContainer.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { Transition } from 'react-transition-group';\nimport type { ToastContainerState, ToastContainerSlots, ToastContainerContextValues } from './ToastContainer.types';\nimport { ToastContainerContextProvider } from '../../contexts/toastContainerContext';\n\n/**\n * Render the final JSX of ToastContainer\n */\nexport const renderToastContainer_unstable = (\n state: ToastContainerState,\n contextValues: ToastContainerContextValues,\n) => {\n const { onTransitionEntering, visible, transitionTimeout, remove, nodeRef } = state;\n assertSlots<ToastContainerSlots>(state);\n\n return (\n <Transition\n in={visible}\n appear\n unmountOnExit\n timeout={transitionTimeout}\n onExited={remove}\n onEntering={onTransitionEntering}\n nodeRef={nodeRef}\n >\n <ToastContainerContextProvider value={contextValues.toast}>\n <state.root />\n <state.timer />\n </ToastContainerContextProvider>\n </Transition>\n );\n};\n"],"names":["assertSlots","Transition","ToastContainerContextProvider","renderToastContainer_unstable","state","contextValues","onTransitionEntering","visible","transitionTimeout","remove","nodeRef","in","appear","unmountOnExit","timeout","onExited","onEntering","value","toast","root","timer"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AACjD,SAASA,WAAW,QAAQ,4BAA4B;AACxD,SAASC,UAAU,QAAQ,yBAAyB;AAEpD,SAASC,6BAA6B,QAAQ,uCAAuC;AAErF;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAC3CC,OACAC;IAEA,MAAM,EAAEC,oBAAoB,EAAEC,OAAO,EAAEC,iBAAiB,EAAEC,MAAM,EAAEC,OAAO,EAAE,GAAGN;IAC9EJ,YAAiCI;IAEjC,qBACE,KAACH;QACCU,IAAIJ;QACJK,MAAM;QACNC,aAAa;QACbC,SAASN;QACTO,UAAUN;QACVO,YAAYV;QACZI,SAASA;kBAET,cAAA,MAACR;YAA8Be,OAAOZ,cAAca,KAAK;;8BACvD,KAACd,MAAMe,IAAI;8BACX,KAACf,MAAMgB,KAAK;;;;AAIpB,EAAE"}
@@ -19,11 +19,11 @@ const intentPolitenessMap = {
19
19
  * @param props - props from this instance of ToastContainer
20
20
  * @param ref - reference to root HTMLElement of ToastContainer
21
21
  */ export const useToastContainer_unstable = (props, ref)=>{
22
- const { visible , children , close: closeProp , remove , updateId , announce , data , timeout: timerTimeout , politeness: desiredPoliteness , intent ='info' , pauseOnHover , pauseOnWindowBlur , imperativeRef , tryRestoreFocus , ...rest } = props;
22
+ const { visible, children, close: closeProp, remove, updateId, announce, data, timeout: timerTimeout, politeness: desiredPoliteness, intent = 'info', pauseOnHover, pauseOnWindowBlur, imperativeRef, tryRestoreFocus, ...rest } = props;
23
23
  const titleId = useId('toast-title');
24
24
  const bodyId = useId('toast-body');
25
25
  const toastRef = React.useRef(null);
26
- const { targetDocument } = useFluent_unstable();
26
+ const { targetDocument } = useFluent_unstable();
27
27
  const [running, setRunning] = React.useState(false);
28
28
  const imperativePauseRef = React.useRef(false);
29
29
  const focusedToastBeforeClose = React.useRef(false);
@@ -38,28 +38,28 @@ const intentPolitenessMap = {
38
38
  }
39
39
  });
40
40
  const close = useEventCallback(()=>{
41
- var _toastRef_current;
42
- const activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;
41
+ var _targetDocument, _toastRef_current;
42
+ const activeElement = (_targetDocument = targetDocument) === null || _targetDocument === void 0 ? void 0 : _targetDocument.activeElement;
43
43
  if (activeElement && ((_toastRef_current = toastRef.current) === null || _toastRef_current === void 0 ? void 0 : _toastRef_current.contains(activeElement))) {
44
44
  focusedToastBeforeClose.current = true;
45
45
  }
46
46
  closeProp();
47
47
  });
48
48
  const onStatusChange = useEventCallback((status)=>{
49
- var _props_onStatusChange;
50
- return (_props_onStatusChange = props.onStatusChange) === null || _props_onStatusChange === void 0 ? void 0 : _props_onStatusChange.call(props, null, {
49
+ var _props_onStatusChange, _props;
50
+ return (_props_onStatusChange = (_props = props).onStatusChange) === null || _props_onStatusChange === void 0 ? void 0 : _props_onStatusChange.call(_props, null, {
51
51
  status,
52
52
  ...props
53
53
  });
54
54
  });
55
55
  const pause = useEventCallback(()=>setRunning(false));
56
56
  const play = useEventCallback(()=>{
57
- var _toastRef_current;
57
+ var _targetDocument, _toastRef_current;
58
58
  if (imperativePauseRef.current) {
59
59
  return;
60
60
  }
61
61
  var _targetDocument_activeElement;
62
- const containsActive = !!((_toastRef_current = toastRef.current) === null || _toastRef_current === void 0 ? void 0 : _toastRef_current.contains((_targetDocument_activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement) !== null && _targetDocument_activeElement !== void 0 ? _targetDocument_activeElement : null));
62
+ const containsActive = !!((_toastRef_current = toastRef.current) === null || _toastRef_current === void 0 ? void 0 : _toastRef_current.contains((_targetDocument_activeElement = (_targetDocument = targetDocument) === null || _targetDocument === void 0 ? void 0 : _targetDocument.activeElement) !== null && _targetDocument_activeElement !== void 0 ? _targetDocument_activeElement : null));
63
63
  if (timerTimeout < 0) {
64
64
  setRunning(true);
65
65
  return;
@@ -137,18 +137,18 @@ const intentPolitenessMap = {
137
137
  onStatusChange
138
138
  ]);
139
139
  const onMouseEnter = useEventCallback((e)=>{
140
- var _userRootSlot_onMouseEnter;
140
+ var _userRootSlot_onMouseEnter, _userRootSlot;
141
141
  pause();
142
- userRootSlot === null || userRootSlot === void 0 ? void 0 : (_userRootSlot_onMouseEnter = userRootSlot.onMouseEnter) === null || _userRootSlot_onMouseEnter === void 0 ? void 0 : _userRootSlot_onMouseEnter.call(userRootSlot, e);
142
+ (_userRootSlot = userRootSlot) === null || _userRootSlot === void 0 ? void 0 : (_userRootSlot_onMouseEnter = _userRootSlot.onMouseEnter) === null || _userRootSlot_onMouseEnter === void 0 ? void 0 : _userRootSlot_onMouseEnter.call(_userRootSlot, e);
143
143
  });
144
144
  const onMouseLeave = useEventCallback((e)=>{
145
- var _userRootSlot_onMouseEnter;
145
+ var _userRootSlot_onMouseEnter, _userRootSlot;
146
146
  play();
147
- userRootSlot === null || userRootSlot === void 0 ? void 0 : (_userRootSlot_onMouseEnter = userRootSlot.onMouseEnter) === null || _userRootSlot_onMouseEnter === void 0 ? void 0 : _userRootSlot_onMouseEnter.call(userRootSlot, e);
147
+ (_userRootSlot = userRootSlot) === null || _userRootSlot === void 0 ? void 0 : (_userRootSlot_onMouseEnter = _userRootSlot.onMouseEnter) === null || _userRootSlot_onMouseEnter === void 0 ? void 0 : _userRootSlot_onMouseEnter.call(_userRootSlot, e);
148
148
  });
149
- const { findFirstFocusable , findLastFocusable } = useFocusFinders();
149
+ const { findFirstFocusable, findLastFocusable } = useFocusFinders();
150
150
  const onKeyDown = useEventCallback((e)=>{
151
- var _userRootSlot_onKeyDown;
151
+ var _userRootSlot_onKeyDown, _userRootSlot;
152
152
  if (e.key === Delete) {
153
153
  e.preventDefault();
154
154
  close();
@@ -163,7 +163,7 @@ const intentPolitenessMap = {
163
163
  (_findFirstFocusable = findFirstFocusable(e.currentTarget)) === null || _findFirstFocusable === void 0 ? void 0 : _findFirstFocusable.focus();
164
164
  }
165
165
  }
166
- userRootSlot === null || userRootSlot === void 0 ? void 0 : (_userRootSlot_onKeyDown = userRootSlot.onKeyDown) === null || _userRootSlot_onKeyDown === void 0 ? void 0 : _userRootSlot_onKeyDown.call(userRootSlot, e);
166
+ (_userRootSlot = userRootSlot) === null || _userRootSlot === void 0 ? void 0 : (_userRootSlot_onKeyDown = _userRootSlot.onKeyDown) === null || _userRootSlot_onKeyDown === void 0 ? void 0 : _userRootSlot_onKeyDown.call(_userRootSlot, e);
167
167
  });
168
168
  React.useEffect(()=>{
169
169
  var _toastRef_current;
@@ -1 +1 @@
1
- {"version":3,"sources":["useToastContainer.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n getNativeElementProps,\n useMergedRefs,\n ExtractSlotProps,\n Slot,\n useEventCallback,\n useId,\n slot,\n} from '@fluentui/react-utilities';\nimport { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport { Delete, Tab } from '@fluentui/keyboard-keys';\nimport { useFocusableGroup, useFocusFinders } from '@fluentui/react-tabster';\nimport { ToastStatus } from '../../state';\nimport type { ToastContainerProps, ToastContainerState } from './ToastContainer.types';\nimport { Timer, TimerProps } from '../Timer/Timer';\n\nconst intentPolitenessMap = {\n success: 'assertive',\n warning: 'assertive',\n error: 'assertive',\n info: 'polite',\n} as const;\n\n/**\n * Create the state required to render ToastContainer.\n *\n * The returned state can be modified with hooks such as useToastContainerStyles_unstable,\n * before being passed to renderToastContainer_unstable.\n *\n * @param props - props from this instance of ToastContainer\n * @param ref - reference to root HTMLElement of ToastContainer\n */\nexport const useToastContainer_unstable = (\n props: ToastContainerProps,\n ref: React.Ref<HTMLElement>,\n): ToastContainerState => {\n const {\n visible,\n children,\n close: closeProp,\n remove,\n updateId,\n announce,\n data,\n timeout: timerTimeout,\n politeness: desiredPoliteness,\n intent = 'info',\n pauseOnHover,\n pauseOnWindowBlur,\n imperativeRef,\n tryRestoreFocus,\n ...rest\n } = props;\n const titleId = useId('toast-title');\n const bodyId = useId('toast-body');\n const toastRef = React.useRef<HTMLDivElement | null>(null);\n const { targetDocument } = useFluent_unstable();\n const [running, setRunning] = React.useState(false);\n const imperativePauseRef = React.useRef(false);\n const focusedToastBeforeClose = React.useRef(false);\n const focusableGroupAttribute = useFocusableGroup({\n tabBehavior: 'limited-trap-focus',\n // Users should only use Tab to focus into the toast\n // Escape is already reserved to dismiss all toasts\n ignoreDefaultKeydown: { Tab: true, Escape: true, Enter: true },\n });\n\n const close = useEventCallback(() => {\n const activeElement = targetDocument?.activeElement;\n if (activeElement && toastRef.current?.contains(activeElement)) {\n focusedToastBeforeClose.current = true;\n }\n\n closeProp();\n });\n const onStatusChange = useEventCallback((status: ToastStatus) => props.onStatusChange?.(null, { status, ...props }));\n const pause = useEventCallback(() => setRunning(false));\n const play = useEventCallback(() => {\n if (imperativePauseRef.current) {\n return;\n }\n const containsActive = !!toastRef.current?.contains(targetDocument?.activeElement ?? null);\n if (timerTimeout < 0) {\n setRunning(true);\n return;\n }\n\n if (!containsActive) {\n setRunning(true);\n }\n });\n\n React.useImperativeHandle(imperativeRef, () => ({\n focus: () => {\n if (!toastRef.current) {\n return;\n }\n\n toastRef.current.focus();\n },\n\n play: () => {\n imperativePauseRef.current = false;\n play();\n },\n pause: () => {\n imperativePauseRef.current = true;\n pause();\n },\n }));\n\n React.useEffect(() => {\n return () => onStatusChange('unmounted');\n }, [onStatusChange]);\n\n React.useEffect(() => {\n if (!targetDocument) {\n return;\n }\n\n if (pauseOnWindowBlur) {\n targetDocument.defaultView?.addEventListener('focus', play);\n targetDocument.defaultView?.addEventListener('blur', pause);\n return () => {\n targetDocument.defaultView?.removeEventListener('focus', play);\n targetDocument.defaultView?.removeEventListener('blur', pause);\n };\n }\n }, [targetDocument, pause, play, pauseOnWindowBlur]);\n\n // It's impossible to animate to height: auto in CSS, the actual pixel value must be known\n // Get the height of the toast before animation styles have been applied and set a CSS\n // variable with its height. The CSS variable will be used by the styles\n const onTransitionEntering = () => {\n if (!toastRef.current) {\n return;\n }\n\n const element = toastRef.current;\n element.style.setProperty('--fui-toast-height', `${element.scrollHeight}px`);\n };\n\n // Users never actually use ToastContainer as a JSX but imperatively through useToastContainerController\n const userRootSlot = (data as { root?: ExtractSlotProps<Slot<'div'>> }).root;\n\n // Using a ref callback here because addEventListener supports `once`\n const toastAnimationRef = React.useCallback(\n (el: HTMLDivElement | null) => {\n if (el && toastRef.current) {\n toastRef.current.addEventListener(\n 'animationend',\n () => {\n // start toast once it's fully animated in\n play();\n onStatusChange('visible');\n },\n { once: true },\n );\n }\n },\n [play, onStatusChange],\n );\n\n const onMouseEnter = useEventCallback((e: React.MouseEvent<HTMLDivElement>) => {\n pause();\n userRootSlot?.onMouseEnter?.(e);\n });\n\n const onMouseLeave = useEventCallback((e: React.MouseEvent<HTMLDivElement>) => {\n play();\n userRootSlot?.onMouseEnter?.(e);\n });\n\n const { findFirstFocusable, findLastFocusable } = useFocusFinders();\n const onKeyDown = useEventCallback((e: React.KeyboardEvent<HTMLDivElement>) => {\n if (e.key === Delete) {\n e.preventDefault();\n close();\n }\n\n if (e.key === Tab && e.currentTarget === e.target) {\n e.preventDefault();\n if (e.shiftKey) {\n findLastFocusable(e.currentTarget)?.focus();\n } else {\n findFirstFocusable(e.currentTarget)?.focus();\n }\n }\n\n userRootSlot?.onKeyDown?.(e);\n });\n\n React.useEffect(() => {\n if (!visible) {\n return;\n }\n\n const politeness = desiredPoliteness ?? intentPolitenessMap[intent];\n announce(toastRef.current?.textContent ?? '', { politeness });\n }, [announce, desiredPoliteness, toastRef, visible, updateId, intent]);\n\n React.useEffect(() => {\n return () => {\n if (focusedToastBeforeClose.current) {\n focusedToastBeforeClose.current = false;\n tryRestoreFocus();\n }\n };\n }, [tryRestoreFocus]);\n\n return {\n components: {\n timer: Timer,\n root: 'div',\n },\n timer: slot.always<TimerProps>(\n { key: updateId, onTimeout: close, running, timeout: timerTimeout ?? -1 },\n { elementType: Timer },\n ),\n root: slot.always(\n getNativeElementProps('div', {\n ref: useMergedRefs(ref, toastRef, toastAnimationRef),\n children,\n tabIndex: 0,\n role: 'listitem',\n 'aria-labelledby': titleId,\n 'aria-describedby': bodyId,\n ...rest,\n ...userRootSlot,\n ...focusableGroupAttribute,\n onMouseEnter,\n onMouseLeave,\n onKeyDown,\n }),\n { elementType: 'div' },\n ),\n timerTimeout,\n transitionTimeout: 500,\n running,\n visible,\n remove,\n close,\n onTransitionEntering,\n updateId,\n nodeRef: toastRef,\n intent,\n titleId,\n bodyId,\n };\n};\n"],"names":["React","getNativeElementProps","useMergedRefs","useEventCallback","useId","slot","useFluent_unstable","Delete","Tab","useFocusableGroup","useFocusFinders","Timer","intentPolitenessMap","success","warning","error","info","useToastContainer_unstable","props","ref","visible","children","close","closeProp","remove","updateId","announce","data","timeout","timerTimeout","politeness","desiredPoliteness","intent","pauseOnHover","pauseOnWindowBlur","imperativeRef","tryRestoreFocus","rest","titleId","bodyId","toastRef","useRef","targetDocument","running","setRunning","useState","imperativePauseRef","focusedToastBeforeClose","focusableGroupAttribute","tabBehavior","ignoreDefaultKeydown","Escape","Enter","activeElement","current","contains","onStatusChange","status","pause","play","containsActive","useImperativeHandle","focus","useEffect","defaultView","addEventListener","removeEventListener","onTransitionEntering","element","style","setProperty","scrollHeight","userRootSlot","root","toastAnimationRef","useCallback","el","once","onMouseEnter","e","onMouseLeave","findFirstFocusable","findLastFocusable","onKeyDown","key","preventDefault","currentTarget","target","shiftKey","textContent","components","timer","always","onTimeout","elementType","tabIndex","role","transitionTimeout","nodeRef"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,qBAAqB,EACrBC,aAAa,EAGbC,gBAAgB,EAChBC,KAAK,EACLC,IAAI,QACC,4BAA4B;AACnC,SAASC,kBAAkB,QAAQ,kCAAkC;AACrE,SAASC,MAAM,EAAEC,GAAG,QAAQ,0BAA0B;AACtD,SAASC,iBAAiB,EAAEC,eAAe,QAAQ,0BAA0B;AAG7E,SAASC,KAAK,QAAoB,i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D,SAAS,CAAC,IAAM;QACpB,OAAO,IAAM;YACX,IAAIhB,wBAAwBO,OAAO,EAAE;gBACnCP,wBAAwBO,OAAO,GAAG,KAAK;gBACvClB;YACF,CAAC;QACH;IACF,GAAG;QAACA;KAAgB;IAEpB,OAAO;QACLsD,YAAY;YACVC,OAAOhF;YACP8D,MAAM;QACR;QACAkB,OAAOtF,KAAKuF,MAAM,CAChB;YAAER,KAAK3D;YAAUoE,WAAWvE;YAAOqB;YAASf,SAASC,yBAAAA,0BAAAA,eAAgB,CAAC,CAAC;QAAC,GACxE;YAAEiE,aAAanF;QAAM;QAEvB8D,MAAMpE,KAAKuF,MAAM,CACf3F,sBAAsB,OAAO;YAC3BkB,KAAKjB,cAAciB,KAAKqB,UAAUkC;YAClCrD;YACA0E,UAAU;YACVC,MAAM;YACN,mBAAmB1D;YACnB,oBAAoBC;YACpB,GAAGF,IAAI;YACP,GAAGmC,YAAY;YACf,GAAGxB,uBAAuB;YAC1B8B;YACAE;YACAG;QACF,IACA;YAAEW,aAAa;QAAM;QAEvBjE;QACAoE,mBAAmB;QACnBtD;QACAvB;QACAI;QACAF;QACA6C;QACA1C;QACAyE,SAAS1D;QACTR;QACAM;QACAC;IACF;AACF,EAAE"}
1
+ {"version":3,"sources":["useToastContainer.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n getNativeElementProps,\n useMergedRefs,\n ExtractSlotProps,\n Slot,\n useEventCallback,\n useId,\n slot,\n} from '@fluentui/react-utilities';\nimport { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport { Delete, Tab } from '@fluentui/keyboard-keys';\nimport { useFocusableGroup, useFocusFinders } from '@fluentui/react-tabster';\nimport { ToastStatus } from '../../state';\nimport type { ToastContainerProps, ToastContainerState } from './ToastContainer.types';\nimport { Timer, TimerProps } from '../Timer/Timer';\n\nconst intentPolitenessMap = {\n success: 'assertive',\n warning: 'assertive',\n error: 'assertive',\n info: 'polite',\n} as const;\n\n/**\n * Create the state required to render ToastContainer.\n *\n * The returned state can be modified with hooks such as useToastContainerStyles_unstable,\n * before being passed to renderToastContainer_unstable.\n *\n * @param props - props from this instance of ToastContainer\n * @param ref - reference to root HTMLElement of ToastContainer\n */\nexport const useToastContainer_unstable = (\n props: ToastContainerProps,\n ref: React.Ref<HTMLElement>,\n): ToastContainerState => {\n const {\n visible,\n children,\n close: closeProp,\n remove,\n updateId,\n announce,\n data,\n timeout: timerTimeout,\n politeness: desiredPoliteness,\n intent = 'info',\n pauseOnHover,\n pauseOnWindowBlur,\n imperativeRef,\n tryRestoreFocus,\n ...rest\n } = props;\n const titleId = useId('toast-title');\n const bodyId = useId('toast-body');\n const toastRef = React.useRef<HTMLDivElement | null>(null);\n const { targetDocument } = useFluent_unstable();\n const [running, setRunning] = React.useState(false);\n const imperativePauseRef = React.useRef(false);\n const focusedToastBeforeClose = React.useRef(false);\n const focusableGroupAttribute = useFocusableGroup({\n tabBehavior: 'limited-trap-focus',\n // Users should only use Tab to focus into the toast\n // Escape is already reserved to dismiss all toasts\n ignoreDefaultKeydown: { Tab: true, Escape: true, Enter: true },\n });\n\n const close = useEventCallback(() => {\n const activeElement = targetDocument?.activeElement;\n if (activeElement && toastRef.current?.contains(activeElement)) {\n focusedToastBeforeClose.current = true;\n }\n\n closeProp();\n });\n const onStatusChange = useEventCallback((status: ToastStatus) => props.onStatusChange?.(null, { status, ...props }));\n const pause = useEventCallback(() => setRunning(false));\n const play = useEventCallback(() => {\n if (imperativePauseRef.current) {\n return;\n }\n const containsActive = !!toastRef.current?.contains(targetDocument?.activeElement ?? null);\n if (timerTimeout < 0) {\n setRunning(true);\n return;\n }\n\n if (!containsActive) {\n setRunning(true);\n }\n });\n\n React.useImperativeHandle(imperativeRef, () => ({\n focus: () => {\n if (!toastRef.current) {\n return;\n }\n\n toastRef.current.focus();\n },\n\n play: () => {\n imperativePauseRef.current = false;\n play();\n },\n pause: () => {\n imperativePauseRef.current = true;\n pause();\n },\n }));\n\n React.useEffect(() => {\n return () => onStatusChange('unmounted');\n }, [onStatusChange]);\n\n React.useEffect(() => {\n if (!targetDocument) {\n return;\n }\n\n if (pauseOnWindowBlur) {\n targetDocument.defaultView?.addEventListener('focus', play);\n targetDocument.defaultView?.addEventListener('blur', pause);\n return () => {\n targetDocument.defaultView?.removeEventListener('focus', play);\n targetDocument.defaultView?.removeEventListener('blur', pause);\n };\n }\n }, [targetDocument, pause, play, pauseOnWindowBlur]);\n\n // It's impossible to animate to height: auto in CSS, the actual pixel value must be known\n // Get the height of the toast before animation styles have been applied and set a CSS\n // variable with its height. The CSS variable will be used by the styles\n const onTransitionEntering = () => {\n if (!toastRef.current) {\n return;\n }\n\n const element = toastRef.current;\n element.style.setProperty('--fui-toast-height', `${element.scrollHeight}px`);\n };\n\n // Users never actually use ToastContainer as a JSX but imperatively through useToastContainerController\n const userRootSlot = (data as { root?: ExtractSlotProps<Slot<'div'>> }).root;\n\n // Using a ref callback here because addEventListener supports `once`\n const toastAnimationRef = React.useCallback(\n (el: HTMLDivElement | null) => {\n if (el && toastRef.current) {\n toastRef.current.addEventListener(\n 'animationend',\n () => {\n // start toast once it's fully animated in\n play();\n onStatusChange('visible');\n },\n { once: true },\n );\n }\n },\n [play, onStatusChange],\n );\n\n const onMouseEnter = useEventCallback((e: React.MouseEvent<HTMLDivElement>) => {\n pause();\n userRootSlot?.onMouseEnter?.(e);\n });\n\n const onMouseLeave = useEventCallback((e: React.MouseEvent<HTMLDivElement>) => {\n play();\n userRootSlot?.onMouseEnter?.(e);\n });\n\n const { findFirstFocusable, findLastFocusable } = useFocusFinders();\n const onKeyDown = useEventCallback((e: React.KeyboardEvent<HTMLDivElement>) => {\n if (e.key === Delete) {\n e.preventDefault();\n close();\n }\n\n if (e.key === Tab && e.currentTarget === e.target) {\n e.preventDefault();\n if (e.shiftKey) {\n findLastFocusable(e.currentTarget)?.focus();\n } else {\n findFirstFocusable(e.currentTarget)?.focus();\n }\n }\n\n userRootSlot?.onKeyDown?.(e);\n });\n\n React.useEffect(() => {\n if (!visible) {\n return;\n }\n\n const politeness = desiredPoliteness ?? intentPolitenessMap[intent];\n announce(toastRef.current?.textContent ?? '', { politeness });\n }, [announce, desiredPoliteness, toastRef, visible, updateId, intent]);\n\n React.useEffect(() => {\n return () => {\n if (focusedToastBeforeClose.current) {\n focusedToastBeforeClose.current = false;\n tryRestoreFocus();\n }\n };\n }, [tryRestoreFocus]);\n\n return {\n components: {\n timer: Timer,\n root: 'div',\n },\n timer: slot.always<TimerProps>(\n { key: updateId, onTimeout: close, running, timeout: timerTimeout ?? -1 },\n { elementType: Timer },\n ),\n root: slot.always(\n getNativeElementProps('div', {\n ref: useMergedRefs(ref, toastRef, toastAnimationRef),\n children,\n tabIndex: 0,\n role: 'listitem',\n 'aria-labelledby': titleId,\n 'aria-describedby': bodyId,\n ...rest,\n ...userRootSlot,\n ...focusableGroupAttribute,\n onMouseEnter,\n onMouseLeave,\n onKeyDown,\n }),\n { elementType: 'div' },\n ),\n timerTimeout,\n transitionTimeout: 500,\n running,\n visible,\n remove,\n close,\n onTransitionEntering,\n updateId,\n nodeRef: toastRef,\n intent,\n titleId,\n bodyId,\n };\n};\n"],"names":["React","getNativeElementProps","useMergedRefs","useEventCallback","useId","slot","useFluent_unstable","Delete","Tab","useFocusableGroup","useFocusFinders","Timer","intentPolitenessMap","success","warning","error","info","useToastContainer_unstable","props","ref","visible","children","close","closeProp","remove","updateId","announce","data","timeout","timerTimeout","politeness","desiredPoliteness","intent","pauseOnHover","pauseOnWindowBlur","imperativeRef","tryRestoreFocus","rest","titleId","bodyId","toastRef","useRef","targetDocument","running","setRunning","useState","imperativePauseRef","focusedToastBeforeClose","focusableGroupAttribute","tabBehavior","ignoreDefaultKeydown","Escape","Enter","activeElement","current","contains","onStatusChange","status","pause","play","containsActive","useImperativeHandle","focus","useEffect","defaultView","addEventListener","removeEventListener","onTransitionEntering","element","style","setProperty","scrollHeight","userRootSlot","root","toastAnimationRef","useCallback","el","once","onMouseEnter","e","onMouseLeave","findFirstFocusable","findLastFocusable","onKeyDown","key","preventDefault","currentTarget","target","shiftKey","textContent","components","timer","always","onTimeout","elementType","tabIndex","role","transitionTimeout","nodeRef"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,qBAAqB,EACrBC,aAAa,EAGbC,gBAAgB,EAChBC,KAAK,EACLC,IAAI,QACC,4BAA4B;AACnC,SAASC,kBAAkB,QAAQ,kCAAkC;AACrE,SAASC,MAAM,EAAEC,GAAG,QAAQ,0BAA0B;AACtD,SAASC,iBAAiB,EAAEC,eAAe,QAAQ,0BAA0B;AAG7E,SAASC,KAAK,QAAoB,iBAAiB;AAEnD,MAAMC,sBAAsB;IAC1BC,SAAS;IACTC,SAAS;IACTC,OAAO;IACPC,MAAM;AACR;AAEA;;;;;;;;CAQC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEA,MAAM,EACJC,OAAO,EACPC,QAAQ,EACRC,OAAOC,SAAS,EAChBC,MAAM,EACNC,QAAQ,EACRC,QAAQ,EACRC,IAAI,EACJC,SAASC,YAAY,EACrBC,YAAYC,iBAAiB,EAC7BC,SAAS,MAAM,EACfC,YAAY,EACZC,iBAAiB,EACjBC,aAAa,EACbC,eAAe,EACf,GAAGC,MACJ,GAAGnB;IACJ,MAAMoB,UAAUlC,MAAM;IACtB,MAAMmC,SAASnC,MAAM;IACrB,MAAMoC,WAAWxC,MAAMyC,MAAM,CAAwB;IACrD,MAAM,EAAEC,cAAc,EAAE,GAAGpC;IAC3B,MAAM,CAACqC,SAASC,WAAW,GAAG5C,MAAM6C,QAAQ,CAAC;IAC7C,MAAMC,qBAAqB9C,MAAMyC,MAAM,CAAC;IACxC,MAAMM,0BAA0B/C,MAAMyC,MAAM,CAAC;IAC7C,MAAMO,0BAA0BvC,kBAAkB;QAChDwC,aAAa;QACb,oDAAoD;QACpD,mDAAmD;QACnDC,sBAAsB;YAAE1C,KAAK;YAAM2C,QAAQ;YAAMC,OAAO;QAAK;IAC/D;IAEA,MAAM9B,QAAQnB,i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AEpB,OAAO;QACLsD,YAAY;YACVC,OAAOhF;YACP8D,MAAM;QACR;QACAkB,OAAOtF,KAAKuF,MAAM,CAChB;YAAER,KAAK3D;YAAUoE,WAAWvE;YAAOqB;YAASf,SAASC,yBAAAA,0BAAAA,eAAgB,CAAC;QAAE,GACxE;YAAEiE,aAAanF;QAAM;QAEvB8D,MAAMpE,KAAKuF,MAAM,CACf3F,sBAAsB,OAAO;YAC3BkB,KAAKjB,cAAciB,KAAKqB,UAAUkC;YAClCrD;YACA0E,UAAU;YACVC,MAAM;YACN,mBAAmB1D;YACnB,oBAAoBC;YACpB,GAAGF,IAAI;YACP,GAAGmC,YAAY;YACf,GAAGxB,uBAAuB;YAC1B8B;YACAE;YACAG;QACF,IACA;YAAEW,aAAa;QAAM;QAEvBjE;QACAoE,mBAAmB;QACnBtD;QACAvB;QACAI;QACAF;QACA6C;QACA1C;QACAyE,SAAS1D;QACTR;QACAM;QACAC;IACF;AACF,EAAE"}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  export function useToastContainerContextValues_unstable(state) {
3
- const { close , intent , titleId , bodyId } = state;
3
+ const { close, intent, titleId, bodyId } = state;
4
4
  const toastContainerContext = React.useMemo(()=>({
5
5
  close,
6
6
  intent,
@@ -1 +1 @@
1
- {"version":3,"sources":["useToastContainerContextValues.ts"],"sourcesContent":["import * as React from 'react';\nimport { ToastContainerContextValues, ToastContainerState } from './ToastContainer.types';\n\nexport function useToastContainerContextValues_unstable(state: ToastContainerState): ToastContainerContextValues {\n const { close, intent, titleId, bodyId } = state;\n\n const toastContainerContext = React.useMemo(\n () => ({\n close,\n intent,\n titleId,\n bodyId,\n }),\n [close, intent, titleId, bodyId],\n );\n\n return {\n toast: toastContainerContext,\n };\n}\n"],"names":["React","useToastContainerContextValues_unstable","state","close","intent","titleId","bodyId","toastContainerContext","useMemo","toast"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAG/B,OAAO,SAASC,wCAAwCC,KAA0B,EAA+B;IAC/G,MAAM,EAAEC,MAAK,EAAEC,OAAM,EAAEC,QAAO,EAAEC,OAAM,EAAE,GAAGJ;IAE3C,MAAMK,wBAAwBP,MAAMQ,OAAO,CACzC,IAAO,CAAA;YACLL;YACAC;YACAC;YACAC;QACF,CAAA,GACA;QAACH;QAAOC;QAAQC;QAASC;KAAO;IAGlC,OAAO;QACLG,OAAOF;IACT;AACF,CAAC"}
1
+ {"version":3,"sources":["useToastContainerContextValues.ts"],"sourcesContent":["import * as React from 'react';\nimport { ToastContainerContextValues, ToastContainerState } from './ToastContainer.types';\n\nexport function useToastContainerContextValues_unstable(state: ToastContainerState): ToastContainerContextValues {\n const { close, intent, titleId, bodyId } = state;\n\n const toastContainerContext = React.useMemo(\n () => ({\n close,\n intent,\n titleId,\n bodyId,\n }),\n [close, intent, titleId, bodyId],\n );\n\n return {\n toast: toastContainerContext,\n };\n}\n"],"names":["React","useToastContainerContextValues_unstable","state","close","intent","titleId","bodyId","toastContainerContext","useMemo","toast"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAG/B,OAAO,SAASC,wCAAwCC,KAA0B;IAChF,MAAM,EAAEC,KAAK,EAAEC,MAAM,EAAEC,OAAO,EAAEC,MAAM,EAAE,GAAGJ;IAE3C,MAAMK,wBAAwBP,MAAMQ,OAAO,CACzC,IAAO,CAAA;YACLL;YACAC;YACAC;YACAC;QACF,CAAA,GACA;QAACH;QAAOC;QAAQC;QAASC;KAAO;IAGlC,OAAO;QACLG,OAAOF;IACT;AACF"}