@fluentui/react-toast 9.3.48 → 9.3.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/CHANGELOG.md +11 -2
  2. package/lib/AriaLive.js.map +1 -1
  3. package/lib/Toast.js.map +1 -1
  4. package/lib/ToastBody.js.map +1 -1
  5. package/lib/ToastContainer.js.map +1 -1
  6. package/lib/ToastFooter.js.map +1 -1
  7. package/lib/ToastTitle.js.map +1 -1
  8. package/lib/ToastTrigger.js.map +1 -1
  9. package/lib/Toaster.js.map +1 -1
  10. package/lib/components/AriaLive/AriaLive.js.map +1 -1
  11. package/lib/components/AriaLive/AriaLive.types.js.map +1 -1
  12. package/lib/components/AriaLive/index.js.map +1 -1
  13. package/lib/components/AriaLive/renderAriaLive.js.map +1 -1
  14. package/lib/components/AriaLive/useAriaLive.js.map +1 -1
  15. package/lib/components/Timer/Timer.js.map +1 -1
  16. package/lib/components/Timer/index.js.map +1 -1
  17. package/lib/components/Toast/Toast.js.map +1 -1
  18. package/lib/components/Toast/Toast.types.js +3 -1
  19. package/lib/components/Toast/Toast.types.js.map +1 -1
  20. package/lib/components/Toast/index.js.map +1 -1
  21. package/lib/components/Toast/renderToast.js.map +1 -1
  22. package/lib/components/Toast/useToast.js.map +1 -1
  23. package/lib/components/Toast/useToastContextValues.js.map +1 -1
  24. package/lib/components/ToastBody/ToastBody.js.map +1 -1
  25. package/lib/components/ToastBody/ToastBody.types.js +3 -1
  26. package/lib/components/ToastBody/ToastBody.types.js.map +1 -1
  27. package/lib/components/ToastBody/index.js.map +1 -1
  28. package/lib/components/ToastBody/renderToastBody.js.map +1 -1
  29. package/lib/components/ToastBody/useToastBody.js.map +1 -1
  30. package/lib/components/ToastContainer/ToastContainer.js.map +1 -1
  31. package/lib/components/ToastContainer/ToastContainer.types.js.map +1 -1
  32. package/lib/components/ToastContainer/ToastContainerMotion.js.map +1 -1
  33. package/lib/components/ToastContainer/index.js.map +1 -1
  34. package/lib/components/ToastContainer/renderToastContainer.js.map +1 -1
  35. package/lib/components/ToastContainer/useToastContainer.js.map +1 -1
  36. package/lib/components/ToastContainer/useToastContainerContextValues.js.map +1 -1
  37. package/lib/components/ToastFooter/ToastFooter.js.map +1 -1
  38. package/lib/components/ToastFooter/ToastFooter.types.js +3 -1
  39. package/lib/components/ToastFooter/ToastFooter.types.js.map +1 -1
  40. package/lib/components/ToastFooter/index.js.map +1 -1
  41. package/lib/components/ToastFooter/renderToastFooter.js.map +1 -1
  42. package/lib/components/ToastFooter/useToastFooter.js.map +1 -1
  43. package/lib/components/ToastTitle/ToastTitle.js.map +1 -1
  44. package/lib/components/ToastTitle/ToastTitle.types.js +3 -1
  45. package/lib/components/ToastTitle/ToastTitle.types.js.map +1 -1
  46. package/lib/components/ToastTitle/index.js.map +1 -1
  47. package/lib/components/ToastTitle/renderToastTitle.js.map +1 -1
  48. package/lib/components/ToastTitle/useToastTitle.js.map +1 -1
  49. package/lib/components/ToastTrigger/ToastTrigger.js.map +1 -1
  50. package/lib/components/ToastTrigger/ToastTrigger.types.js.map +1 -1
  51. package/lib/components/ToastTrigger/index.js.map +1 -1
  52. package/lib/components/ToastTrigger/renderToastTrigger.js.map +1 -1
  53. package/lib/components/ToastTrigger/useToastTrigger.js.map +1 -1
  54. package/lib/components/Toaster/Toaster.js.map +1 -1
  55. package/lib/components/Toaster/Toaster.types.js +3 -1
  56. package/lib/components/Toaster/Toaster.types.js.map +1 -1
  57. package/lib/components/Toaster/index.js.map +1 -1
  58. package/lib/components/Toaster/renderToaster.js.map +1 -1
  59. package/lib/components/Toaster/useToastAnnounce.js.map +1 -1
  60. package/lib/components/Toaster/useToaster.js.map +1 -1
  61. package/lib/components/Toaster/useToasterFocusManagement.js.map +1 -1
  62. package/lib/contexts/toastContainerContext.js.map +1 -1
  63. package/lib/index.js.map +1 -1
  64. package/lib/state/constants.js.map +1 -1
  65. package/lib/state/index.js.map +1 -1
  66. package/lib/state/types.js.map +1 -1
  67. package/lib/state/useToastController.js.map +1 -1
  68. package/lib/state/useToaster.js.map +1 -1
  69. package/lib/state/vanilla/createToaster.js.map +1 -1
  70. package/lib/state/vanilla/dismissAllToasts.js.map +1 -1
  71. package/lib/state/vanilla/dismissToast.js.map +1 -1
  72. package/lib/state/vanilla/dispatchToast.js.map +1 -1
  73. package/lib/state/vanilla/getPositionStyles.js.map +1 -1
  74. package/lib/state/vanilla/index.js.map +1 -1
  75. package/lib/state/vanilla/pauseToast.js.map +1 -1
  76. package/lib/state/vanilla/playToast.js.map +1 -1
  77. package/lib/state/vanilla/updateToast.js.map +1 -1
  78. package/lib-commonjs/AriaLive.js.map +1 -1
  79. package/lib-commonjs/Toast.js.map +1 -1
  80. package/lib-commonjs/ToastBody.js.map +1 -1
  81. package/lib-commonjs/ToastContainer.js.map +1 -1
  82. package/lib-commonjs/ToastFooter.js.map +1 -1
  83. package/lib-commonjs/ToastTitle.js.map +1 -1
  84. package/lib-commonjs/ToastTrigger.js.map +1 -1
  85. package/lib-commonjs/Toaster.js.map +1 -1
  86. package/lib-commonjs/components/AriaLive/AriaLive.js.map +1 -1
  87. package/lib-commonjs/components/AriaLive/AriaLive.types.js.map +1 -1
  88. package/lib-commonjs/components/AriaLive/index.js.map +1 -1
  89. package/lib-commonjs/components/AriaLive/renderAriaLive.js.map +1 -1
  90. package/lib-commonjs/components/AriaLive/useAriaLive.js.map +1 -1
  91. package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.js.map +1 -1
  92. package/lib-commonjs/components/Timer/Timer.js.map +1 -1
  93. package/lib-commonjs/components/Timer/index.js.map +1 -1
  94. package/lib-commonjs/components/Timer/useTimerStyles.styles.js.map +1 -1
  95. package/lib-commonjs/components/Toast/Toast.js.map +1 -1
  96. package/lib-commonjs/components/Toast/Toast.types.js +3 -1
  97. package/lib-commonjs/components/Toast/Toast.types.js.map +1 -1
  98. package/lib-commonjs/components/Toast/index.js.map +1 -1
  99. package/lib-commonjs/components/Toast/renderToast.js.map +1 -1
  100. package/lib-commonjs/components/Toast/useToast.js.map +1 -1
  101. package/lib-commonjs/components/Toast/useToastContextValues.js.map +1 -1
  102. package/lib-commonjs/components/Toast/useToastStyles.styles.js.map +1 -1
  103. package/lib-commonjs/components/ToastBody/ToastBody.js.map +1 -1
  104. package/lib-commonjs/components/ToastBody/ToastBody.types.js +3 -1
  105. package/lib-commonjs/components/ToastBody/ToastBody.types.js.map +1 -1
  106. package/lib-commonjs/components/ToastBody/index.js.map +1 -1
  107. package/lib-commonjs/components/ToastBody/renderToastBody.js.map +1 -1
  108. package/lib-commonjs/components/ToastBody/useToastBody.js.map +1 -1
  109. package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.js.map +1 -1
  110. package/lib-commonjs/components/ToastContainer/ToastContainer.js.map +1 -1
  111. package/lib-commonjs/components/ToastContainer/ToastContainer.types.js.map +1 -1
  112. package/lib-commonjs/components/ToastContainer/ToastContainerMotion.js.map +1 -1
  113. package/lib-commonjs/components/ToastContainer/index.js.map +1 -1
  114. package/lib-commonjs/components/ToastContainer/renderToastContainer.js.map +1 -1
  115. package/lib-commonjs/components/ToastContainer/useToastContainer.js.map +1 -1
  116. package/lib-commonjs/components/ToastContainer/useToastContainerContextValues.js.map +1 -1
  117. package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.js.map +1 -1
  118. package/lib-commonjs/components/ToastFooter/ToastFooter.js.map +1 -1
  119. package/lib-commonjs/components/ToastFooter/ToastFooter.types.js +3 -1
  120. package/lib-commonjs/components/ToastFooter/ToastFooter.types.js.map +1 -1
  121. package/lib-commonjs/components/ToastFooter/index.js.map +1 -1
  122. package/lib-commonjs/components/ToastFooter/renderToastFooter.js.map +1 -1
  123. package/lib-commonjs/components/ToastFooter/useToastFooter.js.map +1 -1
  124. package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.js.map +1 -1
  125. package/lib-commonjs/components/ToastTitle/ToastTitle.js.map +1 -1
  126. package/lib-commonjs/components/ToastTitle/ToastTitle.types.js +3 -1
  127. package/lib-commonjs/components/ToastTitle/ToastTitle.types.js.map +1 -1
  128. package/lib-commonjs/components/ToastTitle/index.js.map +1 -1
  129. package/lib-commonjs/components/ToastTitle/renderToastTitle.js.map +1 -1
  130. package/lib-commonjs/components/ToastTitle/useToastTitle.js.map +1 -1
  131. package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.js.map +1 -1
  132. package/lib-commonjs/components/ToastTrigger/ToastTrigger.js.map +1 -1
  133. package/lib-commonjs/components/ToastTrigger/ToastTrigger.types.js.map +1 -1
  134. package/lib-commonjs/components/ToastTrigger/index.js.map +1 -1
  135. package/lib-commonjs/components/ToastTrigger/renderToastTrigger.js.map +1 -1
  136. package/lib-commonjs/components/ToastTrigger/useToastTrigger.js.map +1 -1
  137. package/lib-commonjs/components/Toaster/Toaster.js.map +1 -1
  138. package/lib-commonjs/components/Toaster/Toaster.types.js +3 -1
  139. package/lib-commonjs/components/Toaster/Toaster.types.js.map +1 -1
  140. package/lib-commonjs/components/Toaster/index.js.map +1 -1
  141. package/lib-commonjs/components/Toaster/renderToaster.js.map +1 -1
  142. package/lib-commonjs/components/Toaster/useToastAnnounce.js.map +1 -1
  143. package/lib-commonjs/components/Toaster/useToaster.js.map +1 -1
  144. package/lib-commonjs/components/Toaster/useToasterFocusManagement.js.map +1 -1
  145. package/lib-commonjs/components/Toaster/useToasterStyles.styles.js.map +1 -1
  146. package/lib-commonjs/contexts/toastContainerContext.js.map +1 -1
  147. package/lib-commonjs/index.js +50 -50
  148. package/lib-commonjs/index.js.map +1 -1
  149. package/lib-commonjs/state/constants.js.map +1 -1
  150. package/lib-commonjs/state/index.js +3 -3
  151. package/lib-commonjs/state/index.js.map +1 -1
  152. package/lib-commonjs/state/types.js.map +1 -1
  153. package/lib-commonjs/state/useToastController.js.map +1 -1
  154. package/lib-commonjs/state/useToaster.js.map +1 -1
  155. package/lib-commonjs/state/vanilla/createToaster.js.map +1 -1
  156. package/lib-commonjs/state/vanilla/dismissAllToasts.js.map +1 -1
  157. package/lib-commonjs/state/vanilla/dismissToast.js.map +1 -1
  158. package/lib-commonjs/state/vanilla/dispatchToast.js.map +1 -1
  159. package/lib-commonjs/state/vanilla/getPositionStyles.js.map +1 -1
  160. package/lib-commonjs/state/vanilla/index.js.map +1 -1
  161. package/lib-commonjs/state/vanilla/pauseToast.js.map +1 -1
  162. package/lib-commonjs/state/vanilla/playToast.js.map +1 -1
  163. package/lib-commonjs/state/vanilla/updateToast.js.map +1 -1
  164. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["useToastTitleStyles.styles.js"],"sourcesContent":["import { __styles, __resetStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const toastTitleClassNames = {\n root: 'fui-ToastTitle',\n media: 'fui-ToastTitle__media',\n action: 'fui-ToastTitle__action'\n};\nconst useRootBaseClassName = /*#__PURE__*/__resetStyles(\"rdjap1e\", null, [\".rdjap1e{display:flex;grid-column-end:3;color:var(--colorNeutralForeground1);word-break:break-word;}\"]);\nconst useMediaBaseClassName = /*#__PURE__*/__resetStyles(\"r8x5mrd\", \"r1soj19y\", [\".r8x5mrd{display:flex;padding-top:2px;grid-column-end:2;padding-right:8px;font-size:16px;color:var(--colorNeutralForeground1);}\", \".r1soj19y{display:flex;padding-top:2px;grid-column-end:2;padding-left:8px;font-size:16px;color:var(--colorNeutralForeground1);}\"]);\nconst useActionBaseClassName = /*#__PURE__*/__resetStyles(\"r2j19ip\", \"rjfozdo\", [\".r2j19ip{display:flex;align-items:start;padding-left:12px;grid-column-end:-1;color:var(--colorBrandForeground1);}\", \".rjfozdo{display:flex;align-items:start;padding-right:12px;grid-column-end:-1;color:var(--colorBrandForeground1);}\"]);\nconst useInvertedStyles = /*#__PURE__*/__styles({\n root: {\n sj55zd: \"f1w7i9ko\"\n },\n action: {\n sj55zd: \"f1qz2gb0\"\n },\n media: {\n sj55zd: \"fqpbvvt\"\n }\n}, {\n d: [\".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}\", \".f1qz2gb0{color:var(--colorBrandForegroundInverted);}\", \".fqpbvvt{color:var(--colorNeutralForegroundInverted);}\"]\n});\nconst useIntentIconStyles = /*#__PURE__*/__styles({\n success: {\n sj55zd: \"f36rra6\"\n },\n error: {\n sj55zd: \"f1ca9wz\"\n },\n warning: {\n sj55zd: \"f13isgzr\"\n },\n info: {\n sj55zd: \"fkfq4zb\"\n }\n}, {\n d: [\".f36rra6{color:var(--colorStatusSuccessForeground1);}\", \".f1ca9wz{color:var(--colorStatusDangerForeground1);}\", \".f13isgzr{color:var(--colorStatusWarningForeground1);}\", \".fkfq4zb{color:var(--colorNeutralForeground2);}\"]\n});\nconst useIntentIconStylesInverted = /*#__PURE__*/__styles({\n success: {\n sj55zd: \"ff3wk4x\"\n },\n error: {\n sj55zd: \"fbq2gqr\"\n },\n warning: {\n sj55zd: \"fx6hq1t\"\n },\n info: {\n sj55zd: \"f1w7i9ko\"\n }\n}, {\n d: [\".ff3wk4x{color:var(--colorStatusSuccessForegroundInverted);}\", \".fbq2gqr{color:var(--colorStatusDangerForegroundInverted);}\", \".fx6hq1t{color:var(--colorStatusWarningForegroundInverted);}\", \".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}\"]\n});\n/**\n * Apply styling to the ToastTitle slots based on the state\n */\nexport const useToastTitleStyles_unstable = state => {\n 'use no memo';\n\n const rootBaseClassName = useRootBaseClassName();\n const actionBaseClassName = useActionBaseClassName();\n const mediaBaseClassName = useMediaBaseClassName();\n const intentIconStyles = useIntentIconStyles();\n const intentIconStylesInverted = useIntentIconStylesInverted();\n const {\n intent\n } = state;\n const invertedStyles = useInvertedStyles();\n state.root.className = mergeClasses(toastTitleClassNames.root, rootBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.root, state.root.className);\n if (state.media) {\n state.media.className = mergeClasses(toastTitleClassNames.media, mediaBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.media, state.media.className, intent && intentIconStyles[intent], intent && state.backgroundAppearance === 'inverted' && intentIconStylesInverted[intent]);\n }\n if (state.action) {\n state.action.className = mergeClasses(toastTitleClassNames.action, actionBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.action, state.action.className);\n }\n return state;\n};\n//# sourceMappingURL=useToastTitleStyles.styles.js.map"],"names":["toastTitleClassNames","useToastTitleStyles_unstable","root","media","action","useRootBaseClassName","__resetStyles","useMediaBaseClassName","useActionBaseClassName","useInvertedStyles","__styles","sj55zd","d","useIntentIconStyles","success","error","warning","info","useIntentIconStylesInverted","state","rootBaseClassName","actionBaseClassName","mediaBaseClassName","intentIconStyles","intentIconStylesInverted","intent","invertedStyles","className","mergeClasses","backgroundAppearance"],"mappings":";;;;;;;;;;;IAEaA,oBAAoB;eAApBA;;IAwDAC,4BAA4B;eAA5BA;;;uBA1DyC;AAE/C,MAAMD,uBAAuB;IAClCE,MAAM;IACNC,OAAO;IACPC,QAAQ;AACV;AACA,MAAMC,uBAAuB,WAAW,GAAEC,IAAAA,oBAAa,EAAC,WAAW,MAAM;IAAC;CAAuG;AACjL,MAAMC,wBAAwB,WAAW,GAAED,IAAAA,oBAAa,EAAC,WAAW,YAAY;IAAC;IAAmI;CAAkI;AACtV,MAAME,yBAAyB,WAAW,GAAEF,IAAAA,oBAAa,EAAC,WAAW,WAAW;IAAC;IAAqH;CAAqH;AAC3T,MAAMG,oBAAoB,WAAW,GAAEC,IAAAA,eAAQ,EAAC;IAC9CR,MAAM;QACJS,QAAQ;IACV;IACAP,QAAQ;QACNO,QAAQ;IACV;IACAR,OAAO;QACLQ,QAAQ;IACV;AACF,GAAG;IACDC,GAAG;QAAC;QAA4D;QAAyD;KAAyD;AACpL;AACA,MAAMC,sBAAsB,WAAW,GAAEH,IAAAA,eAAQ,EAAC;IAChDI,SAAS;QACPH,QAAQ;IACV;IACAI,OAAO;QACLJ,QAAQ;IACV;IACAK,SAAS;QACPL,QAAQ;IACV;IACAM,MAAM;QACJN,QAAQ;IACV;AACF,GAAG;IACDC,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sDAAsD"}
1
+ {"version":3,"sources":["useToastTitleStyles.styles.js"],"sourcesContent":["import { makeStyles, makeResetStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const toastTitleClassNames = {\n root: 'fui-ToastTitle',\n media: 'fui-ToastTitle__media',\n action: 'fui-ToastTitle__action'\n};\nconst useRootBaseClassName = makeResetStyles({\n display: 'flex',\n gridColumnEnd: 3,\n color: tokens.colorNeutralForeground1,\n wordBreak: 'break-word'\n});\nconst useMediaBaseClassName = makeResetStyles({\n display: 'flex',\n paddingTop: '2px',\n gridColumnEnd: 2,\n paddingRight: '8px',\n fontSize: '16px',\n color: tokens.colorNeutralForeground1\n});\nconst useActionBaseClassName = makeResetStyles({\n display: 'flex',\n alignItems: 'start',\n paddingLeft: '12px',\n gridColumnEnd: -1,\n color: tokens.colorBrandForeground1\n});\nconst useInvertedStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForegroundInverted2\n },\n action: {\n color: tokens.colorBrandForegroundInverted\n },\n media: {\n color: tokens.colorNeutralForegroundInverted\n }\n});\nconst useIntentIconStyles = makeStyles({\n success: {\n color: tokens.colorStatusSuccessForeground1\n },\n error: {\n color: tokens.colorStatusDangerForeground1\n },\n warning: {\n color: tokens.colorStatusWarningForeground1\n },\n info: {\n color: tokens.colorNeutralForeground2\n }\n});\nconst useIntentIconStylesInverted = makeStyles({\n success: {\n color: tokens.colorStatusSuccessForegroundInverted\n },\n error: {\n color: tokens.colorStatusDangerForegroundInverted\n },\n warning: {\n color: tokens.colorStatusWarningForegroundInverted\n },\n info: {\n color: tokens.colorNeutralForegroundInverted2\n }\n});\n/**\n * Apply styling to the ToastTitle slots based on the state\n */ export const useToastTitleStyles_unstable = (state)=>{\n 'use no memo';\n const rootBaseClassName = useRootBaseClassName();\n const actionBaseClassName = useActionBaseClassName();\n const mediaBaseClassName = useMediaBaseClassName();\n const intentIconStyles = useIntentIconStyles();\n const intentIconStylesInverted = useIntentIconStylesInverted();\n const { intent } = state;\n const invertedStyles = useInvertedStyles();\n state.root.className = mergeClasses(toastTitleClassNames.root, rootBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.root, state.root.className);\n if (state.media) {\n state.media.className = mergeClasses(toastTitleClassNames.media, mediaBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.media, state.media.className, intent && intentIconStyles[intent], intent && state.backgroundAppearance === 'inverted' && intentIconStylesInverted[intent]);\n }\n if (state.action) {\n state.action.className = mergeClasses(toastTitleClassNames.action, actionBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.action, state.action.className);\n }\n return state;\n};\n"],"names":["toastTitleClassNames","useToastTitleStyles_unstable","root","media","action","useRootBaseClassName","__resetStyles","useMediaBaseClassName","useActionBaseClassName","useInvertedStyles","__styles","sj55zd","d","useIntentIconStyles","success","error","warning","info","useIntentIconStylesInverted","state","rootBaseClassName","actionBaseClassName","mediaBaseClassName","intentIconStyles","intentIconStylesInverted","intent","invertedStyles","className","mergeClasses","backgroundAppearance"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEaA,oBAAoB;eAApBA;;IAmEIC,4BAA4B;eAA5BA;;;uBArEyC;AAEnD,MAAMD,uBAAuB;IAChCE,MAAM;IACNC,OAAO;IACPC,QAAQ;AACZ;AACA,MAAMC,uBAAoB,WAAA,GAAGC,IAAAA,oBAAA,EAAA,WAAA,MAAA;IAAA;CAK5B;AACD,MAAMC,wBAAqB,WAAA,GAAGD,IAAAA,oBAAA,EAAA,WAAA,YAAA;IAAA;IAAA;CAO7B;AACD,MAAME,yBAAsB,WAAA,GAAGF,IAAAA,oBAAA,EAAA,WAAA,WAAA;IAAA;IAAA;CAM9B;AACD,MAAMG,oBAAiB,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAR,MAAA;Q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K,CAACwB,SAAS,EAAEF,UAAUF,gBAAgB,CAACE,OAAO,EAAEA,UAAUN,MAAMU,oBAAoB,KAAK,cAAcL,wBAAwB,CAACC,OAAO;IAC9S;IACA,IAAIN,MAAMf,MAAM,EAAE;QACde,MAAMf,MAAM,CAACuB,SAAS,GAAGC,IAAAA,mBAAY,EAAC5B,qBAAqBI,MAAM,EAAEiB,qBAAqBF,MAAMU,oBAAoB,KAAK,cAAcH,eAAetB,MAAM,EAAEe,MAAMf,MAAM,CAACuB,SAAS;IACtL;IACA,OAAOR;AACX"}
@@ -1 +1 @@
1
- {"version":3,"sources":["ToastTrigger.js"],"sourcesContent":["import * as React from 'react';\nimport { useToastTrigger_unstable } from './useToastTrigger';\nimport { renderToastTrigger_unstable } from './renderToastTrigger';\n/**\n * ToastTrigger component\n */ export const ToastTrigger = (props)=>{\n const state = useToastTrigger_unstable(props);\n return renderToastTrigger_unstable(state);\n};\nToastTrigger.displayName = 'ToastTrigger';\n"],"names":["ToastTrigger","props","state","useToastTrigger_unstable","renderToastTrigger_unstable","displayName"],"mappings":";;;;+BAKiBA;;;eAAAA;;;;iEALM;iCACkB;oCACG;AAGjC,MAAMA,eAAe,CAACC;IAC7B,MAAMC,QAAQC,IAAAA,yCAAwB,EAACF;IACvC,OAAOG,IAAAA,+CAA2B,EAACF;AACvC;AACAF,aAAaK,WAAW,GAAG"}
1
+ {"version":3,"sources":["ToastTrigger.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useToastTrigger_unstable } from './useToastTrigger';\nimport { renderToastTrigger_unstable } from './renderToastTrigger';\nimport type { ToastTriggerProps } from './ToastTrigger.types';\n\n/**\n * ToastTrigger component\n */\nexport const ToastTrigger: React.FC<ToastTriggerProps> = props => {\n const state = useToastTrigger_unstable(props);\n\n return renderToastTrigger_unstable(state);\n};\n\nToastTrigger.displayName = 'ToastTrigger';\n"],"names":["ToastTrigger","props","state","useToastTrigger_unstable","renderToastTrigger_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;iCACkB;oCACG;AAMrC,MAAMA,eAA4CC,CAAAA;IACvD,MAAMC,QAAQC,IAAAA,yCAAAA,EAAyBF;IAEvC,OAAOG,IAAAA,+CAAAA,EAA4BF;AACrC;AAEAF,aAAaK,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["ToastTrigger.types.js"],"sourcesContent":["import * as React from 'react';\n"],"names":[],"mappings":";;;;;iEAAuB"}
1
+ {"version":3,"sources":["ToastTrigger.types.ts"],"sourcesContent":["import { ARIAButtonResultProps, ARIAButtonType } from '@fluentui/react-aria';\nimport type { TriggerProps } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nexport type ToastTriggerProps = TriggerProps<ToastTriggerChildProps> & {\n /**\n * Disables internal trigger mechanism that ensures a child provided will be a compliant ARIA button.\n * @default false\n */\n disableButtonEnhancement?: boolean;\n};\n\n/**\n * Props that are passed to the child of the ToastTrigger when cloned to ensure correct behaviour for the Toast\n */\nexport type ToastTriggerChildProps<Type extends ARIAButtonType = ARIAButtonType, Props = {}> = ARIAButtonResultProps<\n Type,\n Props\n>;\n\nexport type ToastTriggerState = {\n children: React.ReactElement | null;\n};\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAEuB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './ToastTrigger';\nexport * from './ToastTrigger.types';\nexport * from './renderToastTrigger';\nexport * from './useToastTrigger';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ToastTrigger';\nexport * from './ToastTrigger.types';\nexport * from './renderToastTrigger';\nexport * from './useToastTrigger';\n"],"names":[],"rangeMappings":";;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["renderToastTrigger.js"],"sourcesContent":["/**\n * Render the final JSX of MenuTrigger\n *\n * Only renders children\n */ export const renderToastTrigger_unstable = (state)=>state.children;\n"],"names":["renderToastTrigger_unstable","state","children"],"mappings":"AAAA;;;;CAIC;;;;+BAAgBA;;;eAAAA;;;AAAN,MAAMA,8BAA8B,CAACC,QAAQA,MAAMC,QAAQ"}
1
+ {"version":3,"sources":["renderToastTrigger.tsx"],"sourcesContent":["import type { ToastTriggerState } from './ToastTrigger.types';\n\n/**\n * Render the final JSX of MenuTrigger\n *\n * Only renders children\n */\nexport const renderToastTrigger_unstable = (state: ToastTriggerState) => state.children;\n"],"names":["renderToastTrigger_unstable","state","children"],"rangeMappings":";;;;;;;;;;;;;;","mappings":"AAEA;;;;CAIC;;;;+BACYA;;;eAAAA;;;AAAN,MAAMA,8BAA8B,CAACC,QAA6BA,MAAMC,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useToastTrigger.js"],"sourcesContent":["import * as React from 'react';\nimport { applyTriggerPropsToChildren, getTriggerChild, useEventCallback } from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\n/**\n * A non-visual component that wraps its child\n * and configures them to be the trigger that will close a `Toast`.\n * This component should only accept one child.\n *\n * This component sole purpose is to avoid opting out of the internal controlled open state of a `Toast`\n * Besides being a trigger that closes a toast through context this component doesn't do much,\n * making it basically unnecessary in cases where the trigger is outside of a toast.\n */ export const useToastTrigger_unstable = (props)=>{\n const { children, disableButtonEnhancement = false } = props;\n const { close } = useToastContainerContext();\n const child = getTriggerChild(children);\n const handleClick = useEventCallback((e)=>{\n var _child_props_onClick, _child_props;\n child === null || child === void 0 ? void 0 : (_child_props_onClick = (_child_props = child.props).onClick) === null || _child_props_onClick === void 0 ? void 0 : _child_props_onClick.call(_child_props, e);\n if (!e.isDefaultPrevented()) {\n close();\n }\n });\n const triggerChildProps = {\n ...child === null || child === void 0 ? void 0 : child.props,\n ref: child === null || child === void 0 ? void 0 : child.ref,\n onClick: handleClick\n };\n const ariaButtonTriggerChildProps = useARIAButtonProps((child === null || child === void 0 ? void 0 : child.type) === 'button' || (child === null || child === void 0 ? void 0 : child.type) === 'a' ? child.type : 'div', {\n ...triggerChildProps,\n type: 'button'\n });\n return {\n children: applyTriggerPropsToChildren(children, disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps)\n };\n};\n"],"names":["useToastTrigger_unstable","props","children","disableButtonEnhancement","close","useToastContainerContext","child","getTriggerChild","handleClick","useEventCallback","e","_child_props_onClick","_child_props","onClick","call","isDefaultPrevented","triggerChildProps","ref","ariaButtonTriggerChildProps","useARIAButtonProps","type","applyTriggerPropsToChildren"],"mappings":";;;;+BAYiBA;;;eAAAA;;;;iEAZM;gCACwD;2BAC5C;uCACM;AAS9B,MAAMA,2BAA2B,CAACC;IACzC,MAAM,EAAEC,QAAQ,EAAEC,2BAA2B,KAAK,EAAE,GAAGF;IACvD,MAAM,EAAEG,KAAK,EAAE,GAAGC,IAAAA,+CAAwB;IAC1C,MAAMC,QAAQC,IAAAA,+BAAe,EAACL;IAC9B,MAAMM,cAAcC,IAAAA,gCAAgB,EAAC,CAACC;QAClC,IAAIC,sBAAsBC;QAC1BN,UAAU,QAAQA,UAAU,KAAK,IAAI,KAAK,IAAI,AAACK,CAAAA,uBAAuB,AAACC,CAAAA,eAAeN,MAAML,KAAK,AAAD,EAAGY,OAAO,AAAD,MAAO,QAAQF,yBAAyB,KAAK,IAAI,KAAK,IAAIA,qBAAqBG,IAAI,CAACF,cAAcF;QAC3M,IAAI,CAACA,EAAEK,kBAAkB,IAAI;YACzBX;QACJ;IACJ;IACA,MAAMY,oBAAoB;QACtB,GAAGV,UAAU,QAAQA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAML,KAAK;QAC5DgB,KAAKX,UAAU,QAAQA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMW,GAAG;QAC5DJ,SAASL;IACb;IACA,MAAMU,8BAA8BC,IAAAA,6BAAkB,EAAC,AAACb,CAAAA,UAAU,QAAQA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMc,IAAI,AAAD,MAAO,YAAY,AAACd,CAAAA,UAAU,QAAQA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMc,IAAI,AAAD,MAAO,MAAMd,MAAMc,IAAI,GAAG,OAAO;QACvN,GAAGJ,iBAAiB;QACpBI,MAAM;IACV;IACA,OAAO;QACHlB,UAAUmB,IAAAA,2CAA2B,EAACnB,UAAUC,2BAA2Ba,oBAAoBE;IACnG;AACJ"}
1
+ {"version":3,"sources":["useToastTrigger.ts"],"sourcesContent":["import * as React from 'react';\nimport { applyTriggerPropsToChildren, getTriggerChild, useEventCallback } from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport type { ToastTriggerProps, ToastTriggerState } from './ToastTrigger.types';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\n\n/**\n * A non-visual component that wraps its child\n * and configures them to be the trigger that will close a `Toast`.\n * This component should only accept one child.\n *\n * This component sole purpose is to avoid opting out of the internal controlled open state of a `Toast`\n * Besides being a trigger that closes a toast through context this component doesn't do much,\n * making it basically unnecessary in cases where the trigger is outside of a toast.\n */\nexport const useToastTrigger_unstable = (props: ToastTriggerProps): ToastTriggerState => {\n const { children, disableButtonEnhancement = false } = props;\n const { close } = useToastContainerContext();\n\n const child = getTriggerChild(children);\n\n const handleClick = useEventCallback(\n (e: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n child?.props.onClick?.(e);\n if (!e.isDefaultPrevented()) {\n close();\n }\n },\n );\n\n const triggerChildProps = {\n ...child?.props,\n ref: child?.ref,\n onClick: handleClick,\n };\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n {\n ...triggerChildProps,\n type: 'button',\n },\n );\n\n return {\n children: applyTriggerPropsToChildren(\n children,\n disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n };\n};\n"],"names":["useToastTrigger_unstable","props","children","disableButtonEnhancement","close","useToastContainerContext","child","getTriggerChild","handleClick","useEventCallback","e","onClick","isDefaultPrevented","triggerChildProps","ref","ariaButtonTriggerChildProps","useARIAButtonProps","type","applyTriggerPropsToChildren"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAeaA;;;eAAAA;;;;iEAfU;gCACwD;2BAC5C;uCAEM;AAWlC,MAAMA,2BAA2B,CAACC;IACvC,MAAM,EAAEC,QAAQ,EAAEC,2BAA2B,KAAK,EAAE,GAAGF;IACvD,MAAM,EAAEG,KAAK,EAAE,GAAGC,IAAAA,+CAAAA;IAElB,MAAMC,QAAQC,IAAAA,+BAAAA,EAAgBL;IAE9B,MAAMM,cAAcC,IAAAA,gCAAAA,EAClB,CAACC;YACCJ,sBAAAA;QAAAA,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,CAAAA,uBAAAA,CAAAA,eAAAA,MAAOL,KAAK,AAALA,EAAMU,OAAO,AAAPA,MAAO,QAApBL,yBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,qBAAAA,IAAAA,CAAAA,cAAuBI;QACvB,IAAI,CAACA,EAAEE,kBAAkB,IAAI;YAC3BR;QACF;IACF;IAGF,MAAMS,oBAAoB;WACrBP,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOL,KAAK;QACfa,KAAKR,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOQ,GAAG;QACfH,SAASH;IACX;IAEA,MAAMO,8BAA8BC,IAAAA,6BAAAA,EAClCV,CAAAA,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOW,IAAI,AAAJA,MAAS,YAAYX,CAAAA,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOW,IAAI,AAAJA,MAAS,MAAMX,MAAMW,IAAI,GAAG,OAC/D;QACE,GAAGJ,iBAAiB;QACpBI,MAAM;IACR;IAGF,OAAO;QACLf,UAAUgB,IAAAA,2CAAAA,EACRhB,UACAC,2BAA2BU,oBAAoBE;IAEnD;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["Toaster.js"],"sourcesContent":["import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport * as React from 'react';\nimport { useToaster_unstable } from './useToaster';\nimport { renderToaster_unstable } from './renderToaster';\nimport { useToasterStyles_unstable } from './useToasterStyles.styles';\n/**\n * Toaster component - renders a collection of toasts dispatched imperatively\n */ export const Toaster = (props)=>{\n const state = useToaster_unstable(props);\n useToasterStyles_unstable(state);\n useCustomStyleHook_unstable('useToasterStyles_unstable')(state);\n return renderToaster_unstable(state);\n};\nToaster.displayName = 'Toaster';\n"],"names":["Toaster","props","state","useToaster_unstable","useToasterStyles_unstable","useCustomStyleHook_unstable","renderToaster_unstable","displayName"],"mappings":";;;;+BAOiBA;;;eAAAA;;;;qCAP2B;iEACrB;4BACa;+BACG;wCACG;AAG/B,MAAMA,UAAU,CAACC;IACxB,MAAMC,QAAQC,IAAAA,+BAAmB,EAACF;IAClCG,IAAAA,iDAAyB,EAACF;IAC1BG,IAAAA,gDAA2B,EAAC,6BAA6BH;IACzD,OAAOI,IAAAA,qCAAsB,EAACJ;AAClC;AACAF,QAAQO,WAAW,GAAG"}
1
+ {"version":3,"sources":["Toaster.tsx"],"sourcesContent":["import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport * as React from 'react';\n\nimport { useToaster_unstable } from './useToaster';\nimport { renderToaster_unstable } from './renderToaster';\nimport { useToasterStyles_unstable } from './useToasterStyles.styles';\nimport type { ToasterProps } from './Toaster.types';\n\n/**\n * Toaster component - renders a collection of toasts dispatched imperatively\n */\nexport const Toaster: React.FC<ToasterProps> = props => {\n const state = useToaster_unstable(props);\n\n useToasterStyles_unstable(state);\n useCustomStyleHook_unstable('useToasterStyles_unstable')(state);\n return renderToaster_unstable(state);\n};\n\nToaster.displayName = 'Toaster';\n"],"names":["Toaster","props","state","useToaster_unstable","useToasterStyles_unstable","useCustomStyleHook_unstable","renderToaster_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;qCAX+B;iEACrB;4BAEa;+BACG;wCACG;AAMnC,MAAMA,UAAkCC,CAAAA;IAC7C,MAAMC,QAAQC,IAAAA,+BAAAA,EAAoBF;IAElCG,IAAAA,iDAAAA,EAA0BF;IAC1BG,IAAAA,gDAAAA,EAA4B,6BAA6BH;IACzD,OAAOI,IAAAA,qCAAAA,EAAuBJ;AAChC;AAEAF,QAAQO,WAAW,GAAG"}
@@ -1,4 +1,6 @@
1
- "use strict";
1
+ /**
2
+ * State used in rendering Toaster
3
+ */ "use strict";
2
4
  Object.defineProperty(exports, "__esModule", {
3
5
  value: true
4
6
  });
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":["Toaster.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { PortalProps } from '@fluentui/react-portal';\nimport { ToasterOptions } from '../../state/types';\nimport { Announce, AriaLiveProps } from '../AriaLive';\n\nexport type ToasterSlots = {\n /**\n * NOTE: This root slot maps in exactly the same way to the containers rendered for each toast position\n * There is no intention (currently) to let users customize the div for each toast position.\n */\n root: Slot<'div'>;\n};\n\nexport type ToasterSlotsInternal = ToasterSlots & {\n bottomEnd?: Slot<'div'>;\n bottomStart?: Slot<'div'>;\n topEnd?: Slot<'div'>;\n topStart?: Slot<'div'>;\n top?: Slot<'div'>;\n bottom?: Slot<'div'>;\n};\n\n/**\n * Toaster Props\n */\nexport type ToasterProps = Omit<ComponentProps<ToasterSlots>, 'children'> &\n Partial<ToasterOptions> &\n Pick<PortalProps, 'mountNode'> & {\n /**\n * User override API for aria-live narration for toasts\n */\n announce?: Announce;\n\n inline?: boolean;\n };\n\n/**\n * State used in rendering Toaster\n */\nexport type ToasterState = ComponentState<ToasterSlotsInternal> &\n Pick<AriaLiveProps, 'announceRef'> &\n Pick<PortalProps, 'mountNode'> &\n Pick<Required<ToasterProps>, 'announce' | 'inline'> & {\n offset: ToasterOptions['offset'] | undefined;\n renderAriaLive: boolean;\n dir: 'rtl' | 'ltr';\n };\n"],"names":[],"rangeMappings":";;","mappings":"AAoCA;;CAEC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './Toaster';\nexport * from './Toaster.types';\nexport * from './renderToaster';\nexport * from './useToaster';\nexport * from './useToasterStyles.styles';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Toaster';\nexport * from './Toaster.types';\nexport * from './renderToaster';\nexport * from './useToaster';\nexport * from './useToasterStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["renderToaster.js"],"sourcesContent":[" import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { Portal } from '@fluentui/react-portal';\nimport { AriaLive } from '../AriaLive';\n/**\n * Render the final JSX of Toaster\n */ export const renderToaster_unstable = (state)=>{\n const { announceRef, renderAriaLive, inline, mountNode } = state;\n assertSlots(state);\n const hasToasts = !!state.bottomStart || !!state.bottomEnd || !!state.topStart || !!state.topEnd || !!state.top || !!state.bottom;\n const ariaLive = renderAriaLive ? /*#__PURE__*/ _jsx(AriaLive, {\n announceRef: announceRef\n }) : null;\n const positionSlots = /*#__PURE__*/ _jsxs(_Fragment, {\n children: [\n state.bottom ? /*#__PURE__*/ _jsx(state.bottom, {}) : null,\n state.bottomStart ? /*#__PURE__*/ _jsx(state.bottomStart, {}) : null,\n state.bottomEnd ? /*#__PURE__*/ _jsx(state.bottomEnd, {}) : null,\n state.topStart ? /*#__PURE__*/ _jsx(state.topStart, {}) : null,\n state.topEnd ? /*#__PURE__*/ _jsx(state.topEnd, {}) : null,\n state.top ? /*#__PURE__*/ _jsx(state.top, {}) : null\n ]\n });\n if (inline) {\n return /*#__PURE__*/ _jsxs(_Fragment, {\n children: [\n ariaLive,\n hasToasts ? positionSlots : null\n ]\n });\n }\n return /*#__PURE__*/ _jsxs(_Fragment, {\n children: [\n ariaLive,\n hasToasts ? /*#__PURE__*/ _jsx(Portal, {\n mountNode: mountNode,\n children: positionSlots\n }) : null\n ]\n });\n};\n"],"names":["renderToaster_unstable","state","announceRef","renderAriaLive","inline","mountNode","assertSlots","hasToasts","bottomStart","bottomEnd","topStart","topEnd","top","bottom","ariaLive","_jsx","AriaLive","positionSlots","_jsxs","_Fragment","children","Portal"],"mappings":";;;;+BAMiBA;;;eAAAA;;;4BANmD;gCACxC;6BACL;0BACE;AAGd,MAAMA,yBAAyB,CAACC;IACvC,MAAM,EAAEC,WAAW,EAAEC,cAAc,EAAEC,MAAM,EAAEC,SAAS,EAAE,GAAGJ;IAC3DK,IAAAA,2BAAW,EAACL;IACZ,MAAMM,YAAY,CAAC,CAACN,MAAMO,WAAW,IAAI,CAAC,CAACP,MAAMQ,SAAS,IAAI,CAAC,CAACR,MAAMS,QAAQ,IAAI,CAAC,CAACT,MAAMU,MAAM,IAAI,CAAC,CAACV,MAAMW,GAAG,IAAI,CAAC,CAACX,MAAMY,MAAM;IACjI,MAAMC,WAAWX,iBAAiB,WAAW,GAAGY,IAAAA,eAAI,EAACC,kBAAQ,EAAE;QAC3Dd,aAAaA;IACjB,KAAK;IACL,MAAMe,gBAAgB,WAAW,GAAGC,IAAAA,gBAAK,EAACC,oBAAS,EAAE;QACjDC,UAAU;YACNnB,MAAMY,MAAM,GAAG,WAAW,GAAGE,IAAAA,eAAI,EAACd,MAAMY,MAAM,EAAE,CAAC,KAAK;YACtDZ,MAAMO,WAAW,GAAG,WAAW,GAAGO,IAAAA,eAAI,EAACd,MAAMO,WAAW,EAAE,CAAC,KAAK;YAChEP,MAAMQ,SAAS,GAAG,WAAW,GAAGM,IAAAA,eAAI,EAACd,MAAMQ,SAAS,EAAE,CAAC,KAAK;YAC5DR,MAAMS,QAAQ,GAAG,WAAW,GAAGK,IAAAA,eAAI,EAACd,MAAMS,QAAQ,EAAE,CAAC,KAAK;YAC1DT,MAAMU,MAAM,GAAG,WAAW,GAAGI,IAAAA,eAAI,EAACd,MAAMU,MAAM,EAAE,CAAC,KAAK;YACtDV,MAAMW,GAAG,GAAG,WAAW,GAAGG,IAAAA,eAAI,EAACd,MAAMW,GAAG,EAAE,CAAC,KAAK;SACnD;IACL;IACA,IAAIR,QAAQ;QACR,OAAO,WAAW,GAAGc,IAAAA,gBAAK,EAACC,oBAAS,EAAE;YAClCC,UAAU;gBACNN;gBACAP,YAAYU,gBAAgB;aAC/B;QACL;IACJ;IACA,OAAO,WAAW,GAAGC,IAAAA,gBAAK,EAACC,oBAAS,EAAE;QAClCC,UAAU;YACNN;YACAP,YAAY,WAAW,GAAGQ,IAAAA,eAAI,EAACM,mBAAM,EAAE;gBACnChB,WAAWA;gBACXe,UAAUH;YACd,KAAK;SACR;IACL;AACJ"}
1
+ {"version":3,"sources":["renderToaster.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { Portal } from '@fluentui/react-portal';\nimport type { ToasterState, ToasterSlotsInternal } from './Toaster.types';\nimport { AriaLive } from '../AriaLive';\n\n/**\n * Render the final JSX of Toaster\n */\nexport const renderToaster_unstable = (state: ToasterState) => {\n const { announceRef, renderAriaLive, inline, mountNode } = state;\n assertSlots<ToasterSlotsInternal>(state);\n\n const hasToasts =\n !!state.bottomStart || !!state.bottomEnd || !!state.topStart || !!state.topEnd || !!state.top || !!state.bottom;\n\n const ariaLive = renderAriaLive ? <AriaLive announceRef={announceRef} /> : null;\n const positionSlots = (\n <>\n {state.bottom ? <state.bottom /> : null}\n {state.bottomStart ? <state.bottomStart /> : null}\n {state.bottomEnd ? <state.bottomEnd /> : null}\n {state.topStart ? <state.topStart /> : null}\n {state.topEnd ? <state.topEnd /> : null}\n {state.top ? <state.top /> : null}\n </>\n );\n\n if (inline) {\n return (\n <>\n {ariaLive}\n {hasToasts ? positionSlots : null}\n </>\n );\n }\n\n return (\n <>\n {ariaLive}\n {hasToasts ? <Portal mountNode={mountNode}>{positionSlots}</Portal> : null}\n </>\n );\n};\n"],"names":["renderToaster_unstable","state","announceRef","renderAriaLive","inline","mountNode","assertSlots","hasToasts","bottomStart","bottomEnd","topStart","topEnd","top","bottom","ariaLive","_jsx","AriaLive","positionSlots","_jsxs","_Fragment","Portal"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;4BAVb;gCAE4B;6BACL;0BAEE;AAKlB,MAAMA,yBAAyB,CAACC;IACrC,MAAM,EAAEC,WAAW,EAAEC,cAAc,EAAEC,MAAM,EAAEC,SAAS,EAAE,GAAGJ;IAC3DK,IAAAA,2BAAAA,EAAkCL;IAElC,MAAMM,YACJ,CAAC,CAACN,MAAMO,WAAW,IAAI,CAAC,CAACP,MAAMQ,SAAS,IAAI,CAAC,CAACR,MAAMS,QAAQ,IAAI,CAAC,CAACT,MAAMU,MAAM,IAAI,CAAC,CAACV,MAAMW,GAAG,IAAI,CAAC,CAACX,MAAMY,MAAM;IAEjH,MAAMC,WAAWX,iBAAAA,WAAAA,GAAiBY,IAAAA,eAAA,EAACC,kBAAAA,EAAAA;QAASd,aAAaA;SAAkB;IAC3E,MAAMe,gBAAAA,WAAAA,GACJC,IAAAA,gBAAA,EAAAC,oBAAA,EAAA;;YACGlB,MAAMY,MAAM,GAAA,WAAA,GAAGE,IAAAA,eAAA,EAACd,MAAMY,MAAM,EAAA,CAAA,KAAM;YAClCZ,MAAMO,WAAW,GAAA,WAAA,GAAGO,IAAAA,eAAA,EAACd,MAAMO,WAAW,EAAA,CAAA,KAAM;YAC5CP,MAAMQ,SAAS,GAAA,WAAA,GAAGM,IAAAA,eAAA,EAACd,MAAMQ,SAAS,EAAA,CAAA,KAAM;YACxCR,MAAMS,QAAQ,GAAA,WAAA,GAAGK,IAAAA,eAAA,EAACd,MAAMS,QAAQ,EAAA,CAAA,KAAM;YACtCT,MAAMU,MAAM,GAAA,WAAA,GAAGI,IAAAA,eAAA,EAACd,MAAMU,MAAM,EAAA,CAAA,KAAM;YAClCV,MAAMW,GAAG,GAAA,WAAA,GAAGG,IAAAA,eAAA,EAACd,MAAMW,GAAG,EAAA,CAAA,KAAM;;;IAIjC,IAAIR,QAAQ;QACV,OAAA,WAAA,GACEc,IAAAA,gBAAA,EAAAC,oBAAA,EAAA;;gBACGL;gBACAP,YAAYU,gBAAgB;;;IAGnC;IAEA,OAAA,WAAA,GACEC,IAAAA,gBAAA,EAAAC,oBAAA,EAAA;;YACGL;YACAP,YAAAA,WAAAA,GAAYQ,IAAAA,eAAA,EAACK,mBAAAA,EAAAA;gBAAOf,WAAWA;0BAAYY;iBAA0B;;;AAG5E"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useToastAnnounce.js"],"sourcesContent":["import * as React from 'react';\nimport { isHTMLElement } from '@fluentui/react-utilities';\n/**\n * Wraps an aria live announcement function.\n * Aria live announcements can be detrimental once the user is already navigating\n * multiple toasts. Once the user is focused inside the toaster, the announecments should be disabled.\n * @param announce\n * @returns A function to announce a toast and a ref to attach to the toaster element\n */ export function useToastAnnounce(announce) {\n const activeRef = React.useRef(true);\n const cleanupRef = React.useRef(()=>undefined);\n const announceToast = React.useCallback((message, options)=>{\n if (activeRef.current) {\n announce(message, options);\n }\n }, [\n announce\n ]);\n const toasterRef = React.useCallback((el)=>{\n if (!el) {\n cleanupRef.current();\n return;\n }\n const onFocusIn = (e)=>{\n if (isHTMLElement(e.currentTarget) && e.currentTarget.contains(isHTMLElement(e.relatedTarget) ? e.relatedTarget : null)) {\n return;\n }\n activeRef.current = false;\n };\n const onFocusOut = (e)=>{\n if (isHTMLElement(e.currentTarget) && e.currentTarget.contains(isHTMLElement(e.relatedTarget) ? e.relatedTarget : null)) {\n return;\n }\n activeRef.current = true;\n };\n el.addEventListener('focusin', onFocusIn);\n el.addEventListener('focusout', onFocusOut);\n cleanupRef.current = ()=>{\n el.removeEventListener('focusin', onFocusIn);\n el.removeEventListener('focusout', onFocusOut);\n };\n }, []);\n return {\n announceToast,\n toasterRef\n };\n}\n"],"names":["useToastAnnounce","announce","activeRef","React","useRef","cleanupRef","undefined","announceToast","useCallback","message","options","current","toasterRef","el","onFocusIn","e","isHTMLElement","currentTarget","contains","relatedTarget","onFocusOut","addEventListener","removeEventListener"],"mappings":";;;;+BAQoBA;;;eAAAA;;;;iEARG;gCACO;AAOnB,SAASA,iBAAiBC,QAAQ;IACzC,MAAMC,YAAYC,OAAMC,MAAM,CAAC;IAC/B,MAAMC,aAAaF,OAAMC,MAAM,CAAC,IAAIE;IACpC,MAAMC,gBAAgBJ,OAAMK,WAAW,CAAC,CAACC,SAASC;QAC9C,IAAIR,UAAUS,OAAO,EAAE;YACnBV,SAASQ,SAASC;QACtB;IACJ,GAAG;QACCT;KACH;IACD,MAAMW,aAAaT,OAAMK,WAAW,CAAC,CAACK;QAClC,IAAI,CAACA,IAAI;YACLR,WAAWM,OAAO;YAClB;QACJ;QACA,MAAMG,YAAY,CAACC;YACf,IAAIC,IAAAA,6BAAa,EAACD,EAAEE,aAAa,KAAKF,EAAEE,aAAa,CAACC,QAAQ,CAACF,IAAAA,6BAAa,EAACD,EAAEI,aAAa,IAAIJ,EAAEI,aAAa,GAAG,OAAO;gBACrH;YACJ;YACAjB,UAAUS,OAAO,GAAG;QACxB;QACA,MAAMS,aAAa,CAACL;YAChB,IAAIC,IAAAA,6BAAa,EAACD,EAAEE,aAAa,KAAKF,EAAEE,aAAa,CAACC,QAAQ,CAACF,IAAAA,6BAAa,EAACD,EAAEI,aAAa,IAAIJ,EAAEI,aAAa,GAAG,OAAO;gBACrH;YACJ;YACAjB,UAAUS,OAAO,GAAG;QACxB;QACAE,GAAGQ,gBAAgB,CAAC,WAAWP;QAC/BD,GAAGQ,gBAAgB,CAAC,YAAYD;QAChCf,WAAWM,OAAO,GAAG;YACjBE,GAAGS,mBAAmB,CAAC,WAAWR;YAClCD,GAAGS,mBAAmB,CAAC,YAAYF;QACvC;IACJ,GAAG,EAAE;IACL,OAAO;QACHb;QACAK;IACJ;AACJ"}
1
+ {"version":3,"sources":["useToastAnnounce.ts"],"sourcesContent":["import * as React from 'react';\nimport { Announce } from '../AriaLive';\nimport { isHTMLElement } from '@fluentui/react-utilities';\n\n/**\n * Wraps an aria live announcement function.\n * Aria live announcements can be detrimental once the user is already navigating\n * multiple toasts. Once the user is focused inside the toaster, the announecments should be disabled.\n * @param announce\n * @returns A function to announce a toast and a ref to attach to the toaster element\n */\nexport function useToastAnnounce(announce: Announce) {\n const activeRef = React.useRef(true);\n const cleanupRef = React.useRef<() => void>(() => undefined);\n const announceToast = React.useCallback<Announce>(\n (message, options) => {\n if (activeRef.current) {\n announce(message, options);\n }\n },\n [announce],\n );\n\n const toasterRef = React.useCallback((el: HTMLDivElement | null) => {\n if (!el) {\n cleanupRef.current();\n return;\n }\n\n const onFocusIn = (e: FocusEvent) => {\n if (\n isHTMLElement(e.currentTarget) &&\n e.currentTarget.contains(isHTMLElement(e.relatedTarget) ? e.relatedTarget : null)\n ) {\n return;\n }\n\n activeRef.current = false;\n };\n\n const onFocusOut = (e: FocusEvent) => {\n if (\n isHTMLElement(e.currentTarget) &&\n e.currentTarget.contains(isHTMLElement(e.relatedTarget) ? e.relatedTarget : null)\n ) {\n return;\n }\n\n activeRef.current = true;\n };\n\n el.addEventListener('focusin', onFocusIn);\n el.addEventListener('focusout', onFocusOut);\n\n cleanupRef.current = () => {\n el.removeEventListener('focusin', onFocusIn);\n el.removeEventListener('focusout', onFocusOut);\n };\n }, []);\n\n return {\n announceToast,\n toasterRef,\n };\n}\n"],"names":["useToastAnnounce","announce","activeRef","React","useRef","cleanupRef","undefined","announceToast","useCallback","message","options","current","toasterRef","el","onFocusIn","e","isHTMLElement","currentTarget","contains","relatedTarget","onFocusOut","addEventListener","removeEventListener"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWgBA;;;eAAAA;;;;iEAXO;gCAEO;AASvB,SAASA,iBAAiBC,QAAkB;IACjD,MAAMC,YAAYC,OAAMC,MAAM,CAAC;IAC/B,MAAMC,aAAaF,OAAMC,MAAM,CAAa,IAAME;IAClD,MAAMC,gBAAgBJ,OAAMK,WAAW,CACrC,CAACC,SAASC;QACR,IAAIR,UAAUS,OAAO,EAAE;YACrBV,SAASQ,SAASC;QACpB;IACF,GACA;QAACT;KAAS;IAGZ,MAAMW,aAAaT,OAAMK,WAAW,CAAC,CAACK;QACpC,IAAI,CAACA,IAAI;YACPR,WAAWM,OAAO;YAClB;QACF;QAEA,MAAMG,YAAY,CAACC;YACjB,IACEC,IAAAA,6BAAAA,EAAcD,EAAEE,aAAa,KAC7BF,EAAEE,aAAa,CAACC,QAAQ,CAACF,IAAAA,6BAAAA,EAAcD,EAAEI,aAAa,IAAIJ,EAAEI,aAAa,GAAG,OAC5E;gBACA;YACF;YAEAjB,UAAUS,OAAO,GAAG;QACtB;QAEA,MAAMS,aAAa,CAACL;YAClB,IACEC,IAAAA,6BAAAA,EAAcD,EAAEE,aAAa,KAC7BF,EAAEE,aAAa,CAACC,QAAQ,CAACF,IAAAA,6BAAAA,EAAcD,EAAEI,aAAa,IAAIJ,EAAEI,aAAa,GAAG,OAC5E;gBACA;YACF;YAEAjB,UAAUS,OAAO,GAAG;QACtB;QAEAE,GAAGQ,gBAAgB,CAAC,WAAWP;QAC/BD,GAAGQ,gBAAgB,CAAC,YAAYD;QAEhCf,WAAWM,OAAO,GAAG;YACnBE,GAAGS,mBAAmB,CAAC,WAAWR;YAClCD,GAAGS,mBAAmB,CAAC,YAAYF;QACrC;IACF,GAAG,EAAE;IAEL,OAAO;QACLb;QACAK;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useToaster.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, useEventCallback, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { Escape } from '@fluentui/keyboard-keys';\nimport { TOAST_POSITIONS, useToaster } from '../../state';\nimport { ToastContainer } from '../ToastContainer';\nimport { useToasterFocusManagement_unstable } from './useToasterFocusManagement';\nimport { useToastAnnounce } from './useToastAnnounce';\n/**\n * Create the state required to render Toaster.\n *\n * @param props - props from this instance of Toaster\n */ export const useToaster_unstable = (props)=>{\n 'use no memo';\n const { offset, announce: announceProp, mountNode, inline = false, ...rest } = props;\n const announceRef = React.useRef(()=>null);\n const { toastsToRender, isToastVisible, pauseAllToasts, playAllToasts, tryRestoreFocus, closeAllToasts } = useToaster(rest);\n const announce = React.useCallback((message, options)=>announceRef.current(message, options), []);\n const { dir } = useFluent();\n const rootProps = slot.always(getIntrinsicElementProps('div', rest), {\n elementType: 'div'\n });\n const focusableGroupAttr = useFocusableGroup({\n tabBehavior: 'limited-trap-focus',\n ignoreDefaultKeydown: {\n Escape: true\n }\n });\n const onKeyDown = useEventCallback((e)=>{\n var _props_onKeyDown;\n if (e.key === Escape) {\n e.preventDefault();\n closeAllToasts();\n }\n (_props_onKeyDown = props.onKeyDown) === null || _props_onKeyDown === void 0 ? void 0 : _props_onKeyDown.call(props, e);\n });\n const usePositionSlot = (toastPosition)=>{\n var _toastsToRender_get;\n const focusManagementRef = useToasterFocusManagement_unstable(pauseAllToasts, playAllToasts);\n const { announceToast, toasterRef } = useToastAnnounce(announceProp !== null && announceProp !== void 0 ? announceProp : announce);\n return slot.optional(toastsToRender.has(toastPosition) ? rootProps : null, {\n defaultProps: {\n ref: useMergedRefs(focusManagementRef, toasterRef),\n children: (_toastsToRender_get = toastsToRender.get(toastPosition)) === null || _toastsToRender_get === void 0 ? void 0 : _toastsToRender_get.map((toast)=>/*#__PURE__*/ React.createElement(ToastContainer, {\n ...toast,\n tryRestoreFocus: tryRestoreFocus,\n intent: toast.intent,\n announce: announceToast,\n key: toast.toastId,\n visible: isToastVisible(toast.toastId)\n }, toast.content)),\n onKeyDown,\n ...focusableGroupAttr,\n 'data-toaster-position': toastPosition,\n role: 'list'\n },\n elementType: 'div'\n });\n };\n return {\n dir,\n mountNode,\n components: {\n root: 'div',\n bottomStart: 'div',\n bottomEnd: 'div',\n topStart: 'div',\n topEnd: 'div',\n top: 'div',\n bottom: 'div'\n },\n root: slot.always(rootProps, {\n elementType: 'div'\n }),\n bottomStart: usePositionSlot(TOAST_POSITIONS.bottomStart),\n bottomEnd: usePositionSlot(TOAST_POSITIONS.bottomEnd),\n topStart: usePositionSlot(TOAST_POSITIONS.topStart),\n topEnd: usePositionSlot(TOAST_POSITIONS.topEnd),\n top: usePositionSlot(TOAST_POSITIONS.top),\n bottom: usePositionSlot(TOAST_POSITIONS.bottom),\n announceRef,\n offset,\n announce: announceProp !== null && announceProp !== void 0 ? announceProp : announce,\n renderAriaLive: !announceProp,\n inline\n };\n};\n"],"names":["useToaster_unstable","props","offset","announce","announceProp","mountNode","inline","rest","announceRef","React","useRef","toastsToRender","isToastVisible","pauseAllToasts","playAllToasts","tryRestoreFocus","closeAllToasts","useToaster","useCallback","message","options","current","dir","useFluent","rootProps","slot","always","getIntrinsicElementProps","elementType","focusableGroupAttr","useFocusableGroup","tabBehavior","ignoreDefaultKeydown","Escape","onKeyDown","useEventCallback","e","_props_onKeyDown","key","preventDefault","call","usePositionSlot","toastPosition","_toastsToRender_get","focusManagementRef","useToasterFocusManagement_unstable","announceToast","toasterRef","useToastAnnounce","optional","has","defaultProps","ref","useMergedRefs","children","get","map","toast","createElement","ToastContainer","intent","toastId","visible","content","role","components","root","bottomStart","bottomEnd","topStart","topEnd","top","bottom","TOAST_POSITIONS","renderAriaLive"],"mappings":";;;;+BAaiBA;;;eAAAA;;;;iEAbM;gCACyD;qCAChC;8BACd;8BACX;uBACqB;gCACb;2CACoB;kCAClB;AAKtB,MAAMA,sBAAsB,CAACC;IACpC;IACA,MAAM,EAAEC,MAAM,EAAEC,UAAUC,YAAY,EAAEC,SAAS,EAAEC,SAAS,KAAK,EAAE,GAAGC,MAAM,GAAGN;IAC/E,MAAMO,cAAcC,OAAMC,MAAM,CAAC,IAAI;IACrC,MAAM,EAAEC,cAAc,EAAEC,cAAc,EAAEC,cAAc,EAAEC,aAAa,EAAEC,eAAe,EAAEC,cAAc,EAAE,GAAGC,IAAAA,iBAAU,EAACV;IACtH,MAAMJ,WAAWM,OAAMS,WAAW,CAAC,CAACC,SAASC,UAAUZ,YAAYa,OAAO,CAACF,SAASC,UAAU,EAAE;IAChG,MAAM,EAAEE,GAAG,EAAE,GAAGC,IAAAA,uCAAS;IACzB,MAAMC,YAAYC,oBAAI,CAACC,MAAM,CAACC,IAAAA,wCAAwB,EAAC,OAAOpB,OAAO;QACjEqB,aAAa;IACjB;IACA,MAAMC,qBAAqBC,IAAAA,+BAAiB,EAAC;QACzCC,aAAa;QACbC,sBAAsB;YAClBC,QAAQ;QACZ;IACJ;IACA,MAAMC,YAAYC,IAAAA,gCAAgB,EAAC,CAACC;QAChC,IAAIC;QACJ,IAAID,EAAEE,GAAG,KAAKL,oBAAM,EAAE;YAClBG,EAAEG,cAAc;YAChBvB;QACJ;QACCqB,CAAAA,mBAAmBpC,MAAMiC,SAAS,AAAD,MAAO,QAAQG,qBAAqB,KAAK,IAAI,KAAK,IAAIA,iBAAiBG,IAAI,CAACvC,OAAOmC;IACzH;IACA,MAAMK,kBAAkB,CAACC;QACrB,IAAIC;QACJ,MAAMC,qBAAqBC,IAA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ACD,MAAM;QAC9ChE;QACAN;QACAC,UAAUC,iBAAiB,QAAQA,iBAAiB,KAAK,IAAIA,eAAeD;QAC5EuE,gBAAgB,CAACtE;QACjBE;IACJ;AACJ"}
1
+ {"version":3,"sources":["useToaster.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n ExtractSlotProps,\n Slot,\n getIntrinsicElementProps,\n useEventCallback,\n useMergedRefs,\n slot,\n} from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { Escape } from '@fluentui/keyboard-keys';\nimport type { ToasterProps, ToasterState } from './Toaster.types';\nimport { TOAST_POSITIONS, ToastPosition, useToaster } from '../../state';\nimport { Announce } from '../AriaLive';\nimport { ToastContainer } from '../ToastContainer';\nimport { useToasterFocusManagement_unstable } from './useToasterFocusManagement';\nimport { useToastAnnounce } from './useToastAnnounce';\n\n/**\n * Create the state required to render Toaster.\n *\n * @param props - props from this instance of Toaster\n */\nexport const useToaster_unstable = (props: ToasterProps): ToasterState => {\n 'use no memo';\n\n const { offset, announce: announceProp, mountNode, inline = false, ...rest } = props;\n const announceRef = React.useRef<Announce>(() => null);\n const { toastsToRender, isToastVisible, pauseAllToasts, playAllToasts, tryRestoreFocus, closeAllToasts } =\n useToaster<HTMLDivElement>(rest);\n const announce = React.useCallback<Announce>((message, options) => announceRef.current(message, options), []);\n const { dir } = useFluent();\n\n const rootProps = slot.always(getIntrinsicElementProps<ExtractSlotProps<Slot<'div'>>>('div', rest), {\n elementType: 'div',\n });\n const focusableGroupAttr = useFocusableGroup({\n tabBehavior: 'limited-trap-focus',\n ignoreDefaultKeydown: { Escape: true },\n });\n const onKeyDown = useEventCallback((e: React.KeyboardEvent<HTMLDivElement>) => {\n if (e.key === Escape) {\n e.preventDefault();\n closeAllToasts();\n }\n props.onKeyDown?.(e);\n });\n const usePositionSlot = (toastPosition: ToastPosition) => {\n const focusManagementRef = useToasterFocusManagement_unstable(pauseAllToasts, playAllToasts);\n const { announceToast, toasterRef } = useToastAnnounce(announceProp ?? announce);\n return slot.optional<ExtractSlotProps<Slot<'div'>>>(toastsToRender.has(toastPosition) ? rootProps : null, {\n defaultProps: {\n ref: useMergedRefs(focusManagementRef, toasterRef),\n children: toastsToRender.get(toastPosition)?.map(toast => (\n <ToastContainer\n {...toast}\n tryRestoreFocus={tryRestoreFocus}\n intent={toast.intent}\n announce={announceToast}\n key={toast.toastId}\n visible={isToastVisible(toast.toastId)}\n >\n {toast.content as React.ReactNode}\n </ToastContainer>\n )),\n onKeyDown,\n ...focusableGroupAttr,\n 'data-toaster-position': toastPosition,\n role: 'list',\n // Explicitly casting because our slot types can't handle data attributes\n } as ExtractSlotProps<Slot<'div'>>,\n elementType: 'div',\n });\n };\n\n return {\n dir,\n mountNode,\n components: {\n root: 'div',\n bottomStart: 'div',\n bottomEnd: 'div',\n topStart: 'div',\n topEnd: 'div',\n top: 'div',\n bottom: 'div',\n },\n root: slot.always(rootProps, { elementType: 'div' }),\n bottomStart: usePositionSlot(TOAST_POSITIONS.bottomStart),\n bottomEnd: usePositionSlot(TOAST_POSITIONS.bottomEnd),\n topStart: usePositionSlot(TOAST_POSITIONS.topStart),\n topEnd: usePositionSlot(TOAST_POSITIONS.topEnd),\n top: usePositionSlot(TOAST_POSITIONS.top),\n bottom: usePositionSlot(TOAST_POSITIONS.bottom),\n announceRef,\n offset,\n announce: announceProp ?? announce,\n renderAriaLive: !announceProp,\n inline,\n };\n};\n"],"names":["useToaster_unstable","props","offset","announce","announceProp","mountNode","inline","rest","announceRef","React","useRef","toastsToRender","isToastVisible","pauseAllToasts","playAllToasts","tryRestoreFocus","closeAllToasts","useToaster","useCallback","message","options","current","dir","useFluent","rootProps","slot","always","getIntrinsicElementProps","elementType","focusableGroupAttr","useFocusableGroup","tabBehavior","ignoreDefaultKeydown","Escape","onKeyDown","useEventCallback","e","key","preventDefault","usePositionSlot","toastPosition","focusManagementRef","useToasterFocusManagement_unstable","announceToast","toasterRef","useToastAnnounce","optional","has","defaultProps","ref","useMergedRefs","children","get","map","toast","createElement","ToastContainer","intent","toastId","visible","content","role","components","root","bottomStart","bottomEnd","topStart","topEnd","top","bottom","TOAST_POSITIONS","renderAriaLive"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAwBaA;;;eAAAA;;;;iEAxBU;gCAQhB;qCACyC;8BACd;8BACX;uBAEoC;gCAE5B;2CACoB;kCAClB;AAO1B,MAAMA,sBAAsB,CAACC;IAClC;IAEA,MAAM,EAAEC,MAAM,EAAEC,UAAUC,YAAY,EAAEC,SAAS,EAAEC,SAAS,KAAK,EAAE,GAAGC,MAAM,GAAGN;IAC/E,MAAMO,cAAcC,OAAMC,MAAM,CAAW,IAAM;IACjD,MAAM,EAAEC,cAAc,EAAEC,cAAc,EAAEC,cAAc,EAAEC,aAAa,EAAEC,eAAe,EAAEC,cAAc,EAAE,GACtGC,IAAAA,iBAAAA,EAA2BV;IAC7B,MAAMJ,WAAWM,OAAMS,WAAW,CAAW,CAACC,SAASC,UAAYZ,YAAYa,OAAO,CAACF,SAASC,UAAU,EAAE;IAC5G,MAAM,EAAEE,GAAG,EAAE,GAAGC,IAAAA,uCAAAA;IAEhB,MAAMC,YAAYC,oBAAAA,CAAKC,MAAM,CAACC,IAAAA,wCAAAA,EAAwD,OAAOpB,OAAO;QAClGqB,aAAa;IACf;IACA,MAAMC,qBAAqBC,IAAAA,+BAAAA,EAAkB;QAC3CC,aAAa;QACbC,sBAAsB;YAAEC,QAAQ;QAAK;IACvC;IACA,MAAMC,YAAYC,IAAAA,gCAAAA,EAAiB,CAACC;YAKlCnC;QAJA,IAAImC,EAAEC,GAAG,KAAKJ,oBAAAA,EAAQ;YACpBG,EAAEE,cAAc;YAChBtB;QACF;QACAf,CAAAA,mBAAAA,MAAMiC,SAA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,CAAgBL,SAAS;QACpDC,UAAU3B,gBAAgB+B,sBAAAA,CAAgBJ,QAAQ;QAClDC,QAAQ5B,gBAAgB+B,sBAAAA,CAAgBH,MAAM;QAC9CC,KAAK7B,gBAAgB+B,sBAAAA,CAAgBF,GAAG;QACxCC,QAAQ9B,gBAAgB+B,sBAAAA,CAAgBD,MAAM;QAC9C7D;QACAN;QACAC,UAAUC,iBAAAA,QAAAA,iBAAAA,KAAAA,IAAAA,eAAgBD;QAC1BoE,gBAAgB,CAACnE;QACjBE;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useToasterFocusManagement.js"],"sourcesContent":["import { isHTMLElement } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { ArrowDown, ArrowUp } from '@fluentui/keyboard-keys';\nimport { toastContainerClassNames } from '../ToastContainer';\nconst noop = ()=>undefined;\n/**\n * @internal\n */ export function useToasterFocusManagement_unstable(pauseAllToasts, playAllToasts) {\n const { targetDocument } = useFluent();\n const cleanupListenersRef = React.useRef(noop);\n return React.useCallback((el)=>{\n if (!el || !targetDocument) {\n cleanupListenersRef.current();\n cleanupListenersRef.current = noop;\n return;\n }\n const toastContainerWalker = targetDocument.createTreeWalker(el, NodeFilter.SHOW_ELEMENT, {\n acceptNode (node) {\n if (isHTMLElement(node) && node.classList.contains(toastContainerClassNames.root)) {\n return NodeFilter.FILTER_ACCEPT;\n }\n return NodeFilter.FILTER_SKIP;\n }\n });\n /**\n * FIXME: https://github.com/microsoft/tabster/issues/299\n * Toasts should be arrow navigable and focus should be trapped in a stack of tasts\n * This is a temporary measure, Tabster does not have an API yet to enable mover arrow keys from within grouppers\n * Once tabster fully supports this use case, remove this hook\n */ const keydownListener = (e)=>{\n const { target, key } = e;\n if (!isHTMLElement(target)) {\n return;\n }\n if (key === ArrowDown) {\n toastContainerWalker.currentNode = target;\n let nextToastContainer = toastContainerWalker.nextNode();\n if (!nextToastContainer) {\n toastContainerWalker.currentNode = el;\n nextToastContainer = toastContainerWalker.nextNode();\n }\n if (isHTMLElement(nextToastContainer)) {\n nextToastContainer.focus();\n }\n }\n if (key === ArrowUp) {\n toastContainerWalker.currentNode = target;\n let prevToastContainer = toastContainerWalker.previousNode();\n if (prevToastContainer && prevToastContainer.contains(target)) {\n prevToastContainer = toastContainerWalker.previousNode();\n }\n if (!prevToastContainer) {\n toastContainerWalker.currentNode = el;\n prevToastContainer = toastContainerWalker.lastChild();\n }\n if (isHTMLElement(prevToastContainer)) {\n prevToastContainer.focus();\n }\n }\n };\n const focusInListener = (e)=>{\n if (isHTMLElement(e.currentTarget) && !e.currentTarget.contains(isHTMLElement(e.relatedTarget) ? e.relatedTarget : null)) {\n pauseAllToasts();\n }\n };\n const focusOutListener = (e)=>{\n if (isHTMLElement(e.currentTarget) && !e.currentTarget.contains(isHTMLElement(e.relatedTarget) ? e.relatedTarget : null)) {\n playAllToasts();\n }\n };\n el.addEventListener('keydown', keydownListener);\n el.addEventListener('focusin', focusInListener);\n el.addEventListener('focusout', focusOutListener);\n cleanupListenersRef.current = ()=>{\n el.removeEventListener('keydown', keydownListener);\n el.removeEventListener('focusin', focusInListener);\n el.removeEventListener('focusout', focusOutListener);\n };\n }, [\n targetDocument,\n pauseAllToasts,\n playAllToasts\n ]);\n}\n"],"names":["useToasterFocusManagement_unstable","noop","undefined","pauseAllToasts","playAllToasts","targetDocument","useFluent","cleanupListenersRef","React","useRef","useCallback","el","current","toastContainerWalker","createTreeWalker","NodeFilter","SHOW_ELEMENT","acceptNode","node","isHTMLElement","classList","contains","toastContainerClassNames","root","FILTER_ACCEPT","FILTER_SKIP","keydownListener","e","target","key","ArrowDown","currentNode","nextToastContainer","nextNode","focus","ArrowUp","prevToastContainer","previousNode","lastChild","focusInListener","currentTarget","relatedTarget","focusOutListener","addEventListener","removeEventListener"],"mappings":";;;;+BAQoBA;;;eAAAA;;;;gCARU;iEACP;qCACyB;8BACb;gCACM;AACzC,MAAMC,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oBAAoB;oBACrBvB,qBAAqBkB,WAAW,GAAGpB;oBACnCyB,qBAAqBvB,qBAAqByB,SAAS;gBACvD;gBACA,IAAInB,IAAAA,6BAAa,EAACiB,qBAAqB;oBACnCA,mBAAmBF,KAAK;gBAC5B;YACJ;QACJ;QACA,MAAMK,kBAAkB,CAACZ;YACrB,IAAIR,IAAAA,6BAAa,EAACQ,EAAEa,aAAa,KAAK,CAACb,EAAEa,aAAa,CAACnB,QAAQ,CAACF,IAAAA,6BAAa,EAACQ,EAAEc,aAAa,IAAId,EAAEc,aAAa,GAAG,OAAO;gBACtHtC;YACJ;QACJ;QACA,MAAMuC,mBAAmB,CAACf;YACtB,IAAIR,IAAAA,6BAAa,EAACQ,EAAEa,aAAa,KAAK,CAACb,EAAEa,aAAa,CAACnB,QAAQ,CAACF,IAAAA,6BAAa,EAACQ,EAAEc,aAAa,IAAId,EAAEc,aAAa,GAAG,OAAO;gBACtHrC;YACJ;QACJ;QACAO,GAAGgC,gBAAgB,CAAC,WAAWjB;QAC/Bf,GAAGgC,gBAAgB,CAAC,WAAWJ;QAC/B5B,GAAGgC,gBAAgB,CAAC,YAAYD;QAChCnC,oBAAoBK,OAAO,GAAG;YAC1BD,GAAGiC,mBAAmB,CAAC,WAAWlB;YAClCf,GAAGiC,mBAAmB,CAAC,WAAWL;YAClC5B,GAAGiC,mBAAmB,CAAC,YAAYF;QACvC;IACJ,GAAG;QACCrC;QACAF;QACAC;KACH;AACL"}
1
+ {"version":3,"sources":["useToasterFocusManagement.ts"],"sourcesContent":["import { isHTMLElement } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { ArrowDown, ArrowUp } from '@fluentui/keyboard-keys';\nimport { toastContainerClassNames } from '../ToastContainer';\n\nconst noop = () => undefined;\n\n/**\n * @internal\n */\nexport function useToasterFocusManagement_unstable(pauseAllToasts: () => void, playAllToasts: () => void) {\n const { targetDocument } = useFluent();\n const cleanupListenersRef = React.useRef<() => void>(noop);\n\n return React.useCallback(\n (el: HTMLDivElement) => {\n if (!el || !targetDocument) {\n cleanupListenersRef.current();\n cleanupListenersRef.current = noop;\n return;\n }\n\n const toastContainerWalker = targetDocument.createTreeWalker(el, NodeFilter.SHOW_ELEMENT, {\n acceptNode(node: Node) {\n if (isHTMLElement(node) && node.classList.contains(toastContainerClassNames.root)) {\n return NodeFilter.FILTER_ACCEPT;\n }\n\n return NodeFilter.FILTER_SKIP;\n },\n });\n\n /**\n * FIXME: https://github.com/microsoft/tabster/issues/299\n * Toasts should be arrow navigable and focus should be trapped in a stack of tasts\n * This is a temporary measure, Tabster does not have an API yet to enable mover arrow keys from within grouppers\n * Once tabster fully supports this use case, remove this hook\n */\n const keydownListener = (e: KeyboardEvent) => {\n const { target, key } = e;\n if (!isHTMLElement(target)) {\n return;\n }\n\n if (key === ArrowDown) {\n toastContainerWalker.currentNode = target;\n let nextToastContainer = toastContainerWalker.nextNode();\n if (!nextToastContainer) {\n toastContainerWalker.currentNode = el;\n nextToastContainer = toastContainerWalker.nextNode();\n }\n\n if (isHTMLElement(nextToastContainer)) {\n nextToastContainer.focus();\n }\n }\n\n if (key === ArrowUp) {\n toastContainerWalker.currentNode = target;\n let prevToastContainer = toastContainerWalker.previousNode();\n if (prevToastContainer && prevToastContainer.contains(target)) {\n prevToastContainer = toastContainerWalker.previousNode();\n }\n\n if (!prevToastContainer) {\n toastContainerWalker.currentNode = el;\n prevToastContainer = toastContainerWalker.lastChild();\n }\n\n if (isHTMLElement(prevToastContainer)) {\n prevToastContainer.focus();\n }\n }\n };\n\n const focusInListener = (e: FocusEvent) => {\n if (\n isHTMLElement(e.currentTarget) &&\n !e.currentTarget.contains(isHTMLElement(e.relatedTarget) ? e.relatedTarget : null)\n ) {\n pauseAllToasts();\n }\n };\n\n const focusOutListener = (e: FocusEvent) => {\n if (\n isHTMLElement(e.currentTarget) &&\n !e.currentTarget.contains(isHTMLElement(e.relatedTarget) ? e.relatedTarget : null)\n ) {\n playAllToasts();\n }\n };\n\n el.addEventListener('keydown', keydownListener);\n el.addEventListener('focusin', focusInListener);\n el.addEventListener('focusout', focusOutListener);\n\n cleanupListenersRef.current = () => {\n el.removeEventListener('keydown', keydownListener);\n el.removeEventListener('focusin', focusInListener);\n el.removeEventListener('focusout', focusOutListener);\n };\n },\n [targetDocument, pauseAllToasts, playAllToasts],\n );\n}\n"],"names":["useToasterFocusManagement_unstable","noop","undefined","pauseAllToasts","playAllToasts","targetDocument","useFluent","cleanupListenersRef","React","useRef","useCallback","el","current","toastContainerWalker","createTreeWalker","NodeFilter","SHOW_ELEMENT","acceptNode","node","isHTMLElement","classList","contains","toastContainerClassNames","root","FILTER_ACCEPT","FILTER_SKIP","keydownListener","e","target","key","ArrowDown","currentNode","nextToastContainer","nextNode","focus","ArrowUp","prevToastContainer","previousNode","lastChild","focusInListener","currentTarget","relatedTarget","focusOutListener","addEventListener","removeEventListener"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWgBA;;;eAAAA;;;;gCAXc;iEACP;qCACyB;8BACb;gCACM;AAEzC,MAAMC,OAAO,IAAMC;AAKZ,SAASF,mCAAmCG,cAA0B,EAAEC,aAAyB;IACtG,MAAM,EAAEC,cAAc,EAAE,GAAGC,IAAAA,uCAAAA;IAC3B,MAAMC,sBAAsBC,OAAMC,MAAM,CAAaR;IAErD,OAAOO,OAAME,WAAW,CACtB,CAACC;QACC,IAAI,CAACA,MAAM,CAACN,gBAAgB;YAC1BE,oBAAoBK,OAAO;YAC3BL,oBAAoBK,OAAO,GAAGX;YAC9B;QACF;QAEA,MAAMY,uBAAuBR,eAAeS,gBAAgB,CAACH,IAAII,WAAWC,YAAY,EAAE;YACxFC,YAAWC,IAAU;gBACnB,IAAIC,IAAAA,6BAAAA,EAAcD,SAASA,KAAKE,SAAS,CAACC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AA,6BAAAA,EAAcQ,EAAEa,aAAa,KAC7B,CAACb,EAAEa,aAAa,CAACnB,QAAQ,CAACF,IAAAA,6BAAAA,EAAcQ,EAAEc,aAAa,IAAId,EAAEc,aAAa,GAAG,OAC7E;gBACArC;YACF;QACF;QAEAO,GAAGgC,gBAAgB,CAAC,WAAWjB;QAC/Bf,GAAGgC,gBAAgB,CAAC,WAAWJ;QAC/B5B,GAAGgC,gBAAgB,CAAC,YAAYD;QAEhCnC,oBAAoBK,OAAO,GAAG;YAC5BD,GAAGiC,mBAAmB,CAAC,WAAWlB;YAClCf,GAAGiC,mBAAmB,CAAC,WAAWL;YAClC5B,GAAGiC,mBAAmB,CAAC,YAAYF;QACrC;IACF,GACA;QAACrC;QAAgBF;QAAgBC;KAAc;AAEnD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useToasterStyles.styles.js"],"sourcesContent":["import { __resetStyles, __styles, mergeClasses } from '@griffel/react';\nimport { TOAST_POSITIONS, getPositionStyles } from '../../state/index';\nexport const toasterClassNames = {\n root: 'fui-Toaster'\n};\n/**\n * Styles for the root slot\n */\nconst useRootBaseClassName = /*#__PURE__*/__resetStyles(\"r3hfdjz\", null, [\".r3hfdjz{position:fixed;width:292px;pointer-events:none;}\"]);\nconst useToasterStyles = /*#__PURE__*/__styles({\n inline: {\n qhf8xq: \"f1euv43f\"\n }\n}, {\n d: [\".f1euv43f{position:absolute;}\"]\n});\n/**\n * Apply styling to the Toaster slots based on the state\n */\nexport const useToasterStyles_unstable = state => {\n 'use no memo';\n\n const rootBaseClassName = useRootBaseClassName();\n const styles = useToasterStyles();\n const className = mergeClasses(toasterClassNames.root, rootBaseClassName, state.inline && styles.inline, state.root.className);\n if (state.bottomStart) {\n var _state_bottomStart;\n state.bottomStart.className = className;\n var _style;\n (_style = (_state_bottomStart = state.bottomStart).style) !== null && _style !== void 0 ? _style : _state_bottomStart.style = {};\n Object.assign(state.bottomStart.style, getPositionStyles(TOAST_POSITIONS.bottomStart, state.dir, state.offset));\n }\n if (state.bottomEnd) {\n var _state_bottomEnd;\n state.bottomEnd.className = className;\n var _style1;\n (_style1 = (_state_bottomEnd = state.bottomEnd).style) !== null && _style1 !== void 0 ? _style1 : _state_bottomEnd.style = {};\n Object.assign(state.bottomEnd.style, getPositionStyles(TOAST_POSITIONS.bottomEnd, state.dir, state.offset));\n }\n if (state.topStart) {\n var _state_topStart;\n state.topStart.className = className;\n var _style2;\n (_style2 = (_state_topStart = state.topStart).style) !== null && _style2 !== void 0 ? _style2 : _state_topStart.style = {};\n Object.assign(state.topStart.style, getPositionStyles(TOAST_POSITIONS.topStart, state.dir, state.offset));\n }\n if (state.topEnd) {\n var _state_topEnd;\n state.topEnd.className = className;\n var _style3;\n (_style3 = (_state_topEnd = state.topEnd).style) !== null && _style3 !== void 0 ? _style3 : _state_topEnd.style = {};\n Object.assign(state.topEnd.style, getPositionStyles(TOAST_POSITIONS.topEnd, state.dir, state.offset));\n }\n if (state.top) {\n var _state_top;\n state.top.className = className;\n var _style4;\n (_style4 = (_state_top = state.top).style) !== null && _style4 !== void 0 ? _style4 : _state_top.style = {};\n Object.assign(state.top.style, getPositionStyles(TOAST_POSITIONS.top, state.dir, state.offset));\n }\n if (state.bottom) {\n var _state_bottom;\n state.bottom.className = className;\n var _style5;\n (_style5 = (_state_bottom = state.bottom).style) !== null && _style5 !== void 0 ? _style5 : _state_bottom.style = {};\n Object.assign(state.bottom.style, getPositionStyles(TOAST_POSITIONS.bottom, state.dir, state.offset));\n }\n return state;\n};\n//# sourceMappingURL=useToasterStyles.styles.js.map"],"names":["toasterClassNames","useToasterStyles_unstable","root","useRootBaseClassName","__resetStyles","useToasterStyles","__styles","inline","qhf8xq","d","state","rootBaseClassName","styles","className","mergeClasses","bottomStart","_state_bottomStart","_style","style","Object","assign","getPositionStyles","TOAST_POSITIONS","dir","offset","bottomEnd","_state_bottomEnd","_style1","topStart","_state_topStart","_style2","topEnd","_state_topEnd","_style3","top","_state_top","_style4","bottom","_state_bottom","_style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KAAK,EAAEG,IAAAA,wBAAiB,EAACC,sBAAe,CAACY,GAAG,EAAExB,MAAMa,GAAG,EAAEb,MAAMc,MAAM;IAC/F;IACA,IAAId,MAAM2B,MAAM,EAAE;QAChB,IAAIC;QACJ5B,MAAM2B,MAAM,CAACxB,SAAS,GAAGA;QACzB,IAAI0B;QACHA,CAAAA,UAAU,AAACD,CAAAA,gBAAgB5B,MAAM2B,MAAM,AAAD,EAAGnB,KAAK,AAAD,MAAO,QAAQqB,YAAY,KAAK,IAAIA,UAAUD,cAAcpB,KAAK,GAAG,CAAC;QACnHC,OAAOC,MAAM,CAACV,MAAM2B,MAAM,CAACnB,KAAK,EAAEG,IAAAA,wBAAiB,EAACC,sBAAe,CAACe,MAAM,EAAE3B,MAAMa,GAAG,EAAEb,MAAMc,MAAM;IACrG;IACA,OAAOd;AACT,GACA,mDAAmD"}
1
+ {"version":3,"sources":["useToasterStyles.styles.js"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { TOAST_POSITIONS, getPositionStyles } from '../../state/index';\nexport const toasterClassNames = {\n root: 'fui-Toaster'\n};\n/**\n * Styles for the root slot\n */ const useRootBaseClassName = makeResetStyles({\n position: 'fixed',\n width: '292px',\n pointerEvents: 'none'\n});\nconst useToasterStyles = makeStyles({\n inline: {\n position: 'absolute'\n }\n});\n/**\n * Apply styling to the Toaster slots based on the state\n */ export const useToasterStyles_unstable = (state)=>{\n 'use no memo';\n const rootBaseClassName = useRootBaseClassName();\n const styles = useToasterStyles();\n const className = mergeClasses(toasterClassNames.root, rootBaseClassName, state.inline && styles.inline, state.root.className);\n if (state.bottomStart) {\n var _state_bottomStart;\n state.bottomStart.className = className;\n var _style;\n (_style = (_state_bottomStart = state.bottomStart).style) !== null && _style !== void 0 ? _style : _state_bottomStart.style = {};\n Object.assign(state.bottomStart.style, getPositionStyles(TOAST_POSITIONS.bottomStart, state.dir, state.offset));\n }\n if (state.bottomEnd) {\n var _state_bottomEnd;\n state.bottomEnd.className = className;\n var _style1;\n (_style1 = (_state_bottomEnd = state.bottomEnd).style) !== null && _style1 !== void 0 ? _style1 : _state_bottomEnd.style = {};\n Object.assign(state.bottomEnd.style, getPositionStyles(TOAST_POSITIONS.bottomEnd, state.dir, state.offset));\n }\n if (state.topStart) {\n var _state_topStart;\n state.topStart.className = className;\n var _style2;\n (_style2 = (_state_topStart = state.topStart).style) !== null && _style2 !== void 0 ? _style2 : _state_topStart.style = {};\n Object.assign(state.topStart.style, getPositionStyles(TOAST_POSITIONS.topStart, state.dir, state.offset));\n }\n if (state.topEnd) {\n var _state_topEnd;\n state.topEnd.className = className;\n var _style3;\n (_style3 = (_state_topEnd = state.topEnd).style) !== null && _style3 !== void 0 ? _style3 : _state_topEnd.style = {};\n Object.assign(state.topEnd.style, getPositionStyles(TOAST_POSITIONS.topEnd, state.dir, state.offset));\n }\n if (state.top) {\n var _state_top;\n state.top.className = className;\n var _style4;\n (_style4 = (_state_top = state.top).style) !== null && _style4 !== void 0 ? _style4 : _state_top.style = {};\n Object.assign(state.top.style, getPositionStyles(TOAST_POSITIONS.top, state.dir, state.offset));\n }\n if (state.bottom) {\n var _state_bottom;\n state.bottom.className = className;\n var _style5;\n (_style5 = (_state_bottom = state.bottom).style) !== null && _style5 !== void 0 ? _style5 : _state_bottom.style = {};\n Object.assign(state.bottom.style, getPositionStyles(TOAST_POSITIONS.bottom, state.dir, state.offset));\n }\n return state;\n};\n"],"names":["toasterClassNames","useToasterStyles_unstable","root","useRootBaseClassName","__resetStyles","useToasterStyles","__styles","inline","qhf8xq","d","state","rootBaseClassName","styles","className","mergeClasses","bottomStart","_state_bottomStart","_style","style","Object","assign","getPositionStyles","TOAST_POSITIONS","dir","offset","bottomEnd","_state_bottomEnd","_style1","topStart","_state_topStart","_style2","topEnd","_state_topEnd","_style3","top","_state_top","_style4","bottom","_state_bottom","_style5"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C,MAAM,CAACV,MAAMwB,GAAG,CAAChB,KAAK,EAAEG,IAAAA,wBAAiB,EAACC,sBAAe,CAACY,GAAG,EAAExB,MAAMa,GAAG,EAAEb,MAAMc,MAAM;IACjG;IACA,IAAId,MAAM2B,MAAM,EAAE;QACd,IAAIC;QACJ5B,MAAM2B,MAAM,CAACxB,SAAS,GAAGA;QACzB,IAAI0B;QACHA,CAAAA,UAAU,AAACD,CAAAA,gBAAgB5B,MAAM2B,MAAM,AAANA,EAAQnB,KAAK,AAALA,MAAW,QAAQqB,YAAY,KAAK,IAAIA,UAAUD,cAAcpB,KAAK,GAAG,CAAC;QACnHC,OAAOC,MAAM,CAACV,MAAM2B,MAAM,CAACnB,KAAK,EAAEG,IAAAA,wBAAiB,EAACC,sBAAe,CAACe,MAAM,EAAE3B,MAAMa,GAAG,EAAEb,MAAMc,MAAM;IACvG;IACA,OAAOd;AACX"}
@@ -1 +1 @@
1
- {"version":3,"sources":["toastContainerContext.js"],"sourcesContent":["import * as React from 'react';\nconst toastContainerContextDefaultValue = {\n close: ()=>null,\n intent: undefined,\n bodyId: '',\n titleId: ''\n};\nconst ToastContainerContext = /*#__PURE__*/ React.createContext(undefined);\nexport const ToastContainerContextProvider = ToastContainerContext.Provider;\nexport const useToastContainerContext = ()=>{\n var _React_useContext;\n return (_React_useContext = React.useContext(ToastContainerContext)) !== null && _React_useContext !== void 0 ? _React_useContext : toastContainerContextDefaultValue;\n};\n"],"names":["ToastContainerContextProvider","useToastContainerContext","toastContainerContextDefaultValue","close","intent","undefined","bodyId","titleId","ToastContainerContext","React","createContext","Provider","_React_useContext","useContext"],"mappings":";;;;;;;;;;;IAQaA,6BAA6B;eAA7BA;;IACAC,wBAAwB;eAAxBA;;;;iEATU;AACvB,MAAMC,oCAAoC;IACtCC,OAAO,IAAI;IACXC,QAAQC;IACRC,QAAQ;IACRC,SAAS;AACb;AACA,MAAMC,wBAAwB,WAAW,GAAGC,OAAMC,aAAa,CAACL;AACzD,MAAML,gCAAgCQ,sBAAsBG,QAAQ;AACpE,MAAMV,2BAA2B;IACpC,IAAIW;IACJ,OAAO,AAACA,CAAAA,oBAAoBH,OAAMI,UAAU,CAACL,sBAAqB,MAAO,QAAQI,sBAAsB,KAAK,IAAIA,oBAAoBV;AACxI"}
1
+ {"version":3,"sources":["toastContainerContext.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ToastIntent } from '../state/types';\n\nexport type ToastContainerContextValue = {\n close: () => void;\n intent: ToastIntent | undefined;\n bodyId: string;\n titleId: string;\n};\n\nconst toastContainerContextDefaultValue: ToastContainerContextValue = {\n close: () => null,\n intent: undefined,\n bodyId: '',\n titleId: '',\n};\n\nconst ToastContainerContext = React.createContext<ToastContainerContextValue | undefined>(undefined);\n\nexport const ToastContainerContextProvider = ToastContainerContext.Provider;\nexport const useToastContainerContext = () =>\n React.useContext(ToastContainerContext) ?? toastContainerContextDefaultValue;\n"],"names":["ToastContainerContextProvider","useToastContainerContext","toastContainerContextDefaultValue","close","intent","undefined","bodyId","titleId","ToastContainerContext","React","createContext","Provider","useContext"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAmBaA,6BAAAA;eAAAA;;IACAC,wBAAAA;eAAAA;;;;iEApBU;AAUvB,MAAMC,oCAAgE;IACpEC,OAAO,IAAM;IACbC,QAAQC;IACRC,QAAQ;IACRC,SAAS;AACX;AAEA,MAAMC,wBAAAA,WAAAA,GAAwBC,OAAMC,aAAa,CAAyCL;AAEnF,MAAML,gCAAgCQ,sBAAsBG,QAAQ;AACpE,MAAMV,2BAA2B;QACtCQ;WAAAA,CAAAA,oBAAAA,OAAMG,UAAU,CAACJ,sBAAAA,MAAAA,QAAjBC,sBAAAA,KAAAA,IAAAA,oBAA2CP;AAAgC"}
@@ -9,65 +9,56 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- useToastController: function() {
13
- return _state.useToastController;
12
+ Toast: function() {
13
+ return _Toast.Toast;
14
14
  },
15
- ToastTrigger: function() {
16
- return _ToastTrigger.ToastTrigger;
15
+ ToastBody: function() {
16
+ return _ToastBody.ToastBody;
17
17
  },
18
- useToastTrigger_unstable: function() {
19
- return _ToastTrigger.useToastTrigger_unstable;
18
+ ToastFooter: function() {
19
+ return _ToastFooter.ToastFooter;
20
20
  },
21
- renderToastTrigger_unstable: function() {
22
- return _ToastTrigger.renderToastTrigger_unstable;
21
+ ToastTitle: function() {
22
+ return _ToastTitle.ToastTitle;
23
+ },
24
+ ToastTrigger: function() {
25
+ return _ToastTrigger.ToastTrigger;
23
26
  },
24
27
  Toaster: function() {
25
28
  return _Toaster.Toaster;
26
29
  },
27
- useToaster_unstable: function() {
28
- return _Toaster.useToaster_unstable;
29
- },
30
- useToasterStyles_unstable: function() {
31
- return _Toaster.useToasterStyles_unstable;
32
- },
33
- renderToaster_unstable: function() {
34
- return _Toaster.renderToaster_unstable;
35
- },
36
- toasterClassNames: function() {
37
- return _Toaster.toasterClassNames;
30
+ renderToastBody_unstable: function() {
31
+ return _ToastBody.renderToastBody_unstable;
38
32
  },
39
- Toast: function() {
40
- return _Toast.Toast;
33
+ renderToastFooter_unstable: function() {
34
+ return _ToastFooter.renderToastFooter_unstable;
41
35
  },
42
- useToastStyles_unstable: function() {
43
- return _Toast.useToastStyles_unstable;
36
+ renderToastTitle_unstable: function() {
37
+ return _ToastTitle.renderToastTitle_unstable;
44
38
  },
45
- useToast_unstable: function() {
46
- return _Toast.useToast_unstable;
39
+ renderToastTrigger_unstable: function() {
40
+ return _ToastTrigger.renderToastTrigger_unstable;
47
41
  },
48
42
  renderToast_unstable: function() {
49
43
  return _Toast.renderToast_unstable;
50
44
  },
51
- toastClassNames: function() {
52
- return _Toast.toastClassNames;
53
- },
54
- ToastTitle: function() {
55
- return _ToastTitle.ToastTitle;
45
+ renderToaster_unstable: function() {
46
+ return _Toaster.renderToaster_unstable;
56
47
  },
57
- useToastTitleStyles_unstable: function() {
58
- return _ToastTitle.useToastTitleStyles_unstable;
48
+ toastBodyClassNames: function() {
49
+ return _ToastBody.toastBodyClassNames;
59
50
  },
60
- useToastTitle_unstable: function() {
61
- return _ToastTitle.useToastTitle_unstable;
51
+ toastClassNames: function() {
52
+ return _Toast.toastClassNames;
62
53
  },
63
- renderToastTitle_unstable: function() {
64
- return _ToastTitle.renderToastTitle_unstable;
54
+ toastFooterClassNames: function() {
55
+ return _ToastFooter.toastFooterClassNames;
65
56
  },
66
57
  toastTitleClassNames: function() {
67
58
  return _ToastTitle.toastTitleClassNames;
68
59
  },
69
- ToastBody: function() {
70
- return _ToastBody.ToastBody;
60
+ toasterClassNames: function() {
61
+ return _Toaster.toasterClassNames;
71
62
  },
72
63
  useToastBodyStyles_unstable: function() {
73
64
  return _ToastBody.useToastBodyStyles_unstable;
@@ -75,14 +66,8 @@ _export(exports, {
75
66
  useToastBody_unstable: function() {
76
67
  return _ToastBody.useToastBody_unstable;
77
68
  },
78
- renderToastBody_unstable: function() {
79
- return _ToastBody.renderToastBody_unstable;
80
- },
81
- toastBodyClassNames: function() {
82
- return _ToastBody.toastBodyClassNames;
83
- },
84
- ToastFooter: function() {
85
- return _ToastFooter.ToastFooter;
69
+ useToastController: function() {
70
+ return _state.useToastController;
86
71
  },
87
72
  useToastFooterStyles_unstable: function() {
88
73
  return _ToastFooter.useToastFooterStyles_unstable;
@@ -90,11 +75,26 @@ _export(exports, {
90
75
  useToastFooter_unstable: function() {
91
76
  return _ToastFooter.useToastFooter_unstable;
92
77
  },
93
- renderToastFooter_unstable: function() {
94
- return _ToastFooter.renderToastFooter_unstable;
78
+ useToastStyles_unstable: function() {
79
+ return _Toast.useToastStyles_unstable;
95
80
  },
96
- toastFooterClassNames: function() {
97
- return _ToastFooter.toastFooterClassNames;
81
+ useToastTitleStyles_unstable: function() {
82
+ return _ToastTitle.useToastTitleStyles_unstable;
83
+ },
84
+ useToastTitle_unstable: function() {
85
+ return _ToastTitle.useToastTitle_unstable;
86
+ },
87
+ useToastTrigger_unstable: function() {
88
+ return _ToastTrigger.useToastTrigger_unstable;
89
+ },
90
+ useToast_unstable: function() {
91
+ return _Toast.useToast_unstable;
92
+ },
93
+ useToasterStyles_unstable: function() {
94
+ return _Toaster.useToasterStyles_unstable;
95
+ },
96
+ useToaster_unstable: function() {
97
+ return _Toaster.useToaster_unstable;
98
98
  }
99
99
  });
100
100
  const _state = require("./state");
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export { useToastController } from './state';\nexport { ToastTrigger, useToastTrigger_unstable, renderToastTrigger_unstable } from './ToastTrigger';\nexport { Toaster, useToaster_unstable, useToasterStyles_unstable, renderToaster_unstable, toasterClassNames } from './Toaster';\nexport { Toast, useToastStyles_unstable, useToast_unstable, renderToast_unstable, toastClassNames } from './Toast';\nexport { ToastTitle, useToastTitleStyles_unstable, useToastTitle_unstable, renderToastTitle_unstable, toastTitleClassNames } from './ToastTitle';\nexport { ToastBody, useToastBodyStyles_unstable, useToastBody_unstable, renderToastBody_unstable, toastBodyClassNames } from './ToastBody';\nexport { ToastFooter, useToastFooterStyles_unstable, useToastFooter_unstable, renderToastFooter_unstable, toastFooterClassNames } from './ToastFooter';\n"],"names":["useToastController","ToastTrigger","useToastTrigger_unstable","renderToastTrigger_unstable","Toaster","useToaster_unstable","useToasterStyles_unstable","renderToaster_unstable","toasterClassNames","Toast","useToastStyles_unstable","useToast_unstable","renderToast_unstable","toastClassNames","ToastTitle","useToastTitleStyles_unstable","useToastTitle_unstable","renderToastTitle_unstable","toastTitleClassNames","ToastBody","useToastBodyStyles_unstable","useToastBody_unstable","renderToastBody_unstable","toastBodyClassNames","ToastFooter","useToastFooterStyles_unstable","useToastFooter_unstable","renderToastFooter_unstable","toastFooterClassNames"],"mappings":";;;;;;;;;;;IAASA,kBAAkB;eAAlBA,yBAAkB;;IAClBC,YAAY;eAAZA,0BAAY;;IAAEC,wBAAwB;eAAxBA,sCAAwB;;IAAEC,2BAA2B;eAA3BA,yCAA2B;;IACnEC,OAAO;eAAPA,gBAAO;;IAAEC,mBAAmB;eAAnBA,4BAAmB;;IAAEC,yBAAyB;eAAzBA,kCAAyB;;IAAEC,sBAAsB;eAAtBA,+BAAsB;;IAAEC,iBAAiB;eAAjBA,0BAAiB;;IAClGC,KAAK;eAALA,YAAK;;IAAEC,uBAAuB;eAAvBA,8BAAuB;;IAAEC,iBAAiB;eAAjBA,wBAAiB;;IAAEC,oBAAoB;eAApBA,2BAAoB;;IAAEC,eAAe;eAAfA,sBAAe;;IACxFC,UAAU;eAAVA,sBAAU;;IAAEC,4BAA4B;eAA5BA,wCAA4B;;IAAEC,sBAAsB;eAAtBA,kCAAsB;;IAAEC,yBAAyB;eAAzBA,qCAAyB;;IAAEC,oBAAoB;eAApBA,gCAAoB;;IACjHC,SAAS;eAATA,oBAAS;;IAAEC,2BAA2B;eAA3BA,sCAA2B;;IAAEC,qBAAqB;eAArBA,gCAAqB;;IAAEC,wBAAwB;eAAxBA,mCAAwB;;IAAEC,mBAAmB;eAAnBA,8BAAmB;;IAC5GC,WAAW;eAAXA,wBAAW;;IAAEC,6BAA6B;eAA7BA,0CAA6B;;IAAEC,uBAAuB;eAAvBA,oCAAuB;;IAAEC,0BAA0B;eAA1BA,uCAA0B;;IAAEC,qBAAqB;eAArBA,kCAAqB;;;uBAN5F;8BACiD;yBAC+B;uBACV;4BACyB;2BACL;6BACU"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export { useToastController } from './state';\nexport type { ToastPosition, ToastId, ToastOffset, ToastPoliteness, ToastStatus, ToastIntent } from './state';\n\nexport { ToastTrigger, useToastTrigger_unstable, renderToastTrigger_unstable } from './ToastTrigger';\nexport type { ToastTriggerChildProps, ToastTriggerProps, ToastTriggerState } from './ToastTrigger';\nexport {\n Toaster,\n useToaster_unstable,\n useToasterStyles_unstable,\n renderToaster_unstable,\n toasterClassNames,\n} from './Toaster';\nexport type { ToasterProps, ToasterState, ToasterSlots } from './Toaster';\nexport { Toast, useToastStyles_unstable, useToast_unstable, renderToast_unstable, toastClassNames } from './Toast';\nexport type { ToastProps, ToastState, ToastSlots } from './Toast';\n\nexport {\n ToastTitle,\n useToastTitleStyles_unstable,\n useToastTitle_unstable,\n renderToastTitle_unstable,\n toastTitleClassNames,\n} from './ToastTitle';\nexport type { ToastTitleProps, ToastTitleState, ToastTitleSlots } from './ToastTitle';\n\nexport {\n ToastBody,\n useToastBodyStyles_unstable,\n useToastBody_unstable,\n renderToastBody_unstable,\n toastBodyClassNames,\n} from './ToastBody';\nexport type { ToastBodyProps, ToastBodyState, ToastBodySlots } from './ToastBody';\n\nexport {\n ToastFooter,\n useToastFooterStyles_unstable,\n useToastFooter_unstable,\n renderToastFooter_unstable,\n toastFooterClassNames,\n} from './ToastFooter';\nexport type { ToastFooterProps, ToastFooterState, ToastFooterSlots } from './ToastFooter';\n"],"names":["Toast","ToastBody","ToastFooter","ToastTitle","ToastTrigger","Toaster","renderToastBody_unstable","renderToastFooter_unstable","renderToastTitle_unstable","renderToastTrigger_unstable","renderToast_unstable","renderToaster_unstable","toastBodyClassNames","toastClassNames","toastFooterClassNames","toastTitleClassNames","toasterClassNames","useToastBodyStyles_unstable","useToastBody_unstable","useToastController","useToastFooterStyles_unstable","useToastFooter_unstable","useToastStyles_unstable","useToastTitleStyles_unstable","useToastTitle_unstable","useToastTrigger_unstable","useToast_unstable","useToasterStyles_unstable","useToaster_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAaSA,KAAK;eAALA,YAAK;;IAaZC,SAAS;eAATA,oBAAS;;IASTC,WAAW;eAAXA,wBAAW;;IAlBXC,UAAU;eAAVA,sBAAU;;IAdHC,YAAY;eAAZA,0BAAY;;IAGnBC,OAAO;eAAPA,gBAAO;;IAuBPC,wBAAwB;eAAxBA,mCAAwB;;IASxBC,0BAA0B;eAA1BA,uCAA0B;;IAlB1BC,yBAAyB;eAAzBA,qCAAyB;;IAjBsBC,2BAA2B;eAA3BA,yCAA2B;;IAUhBC,oBAAoB;eAApBA,2BAAoB;;IAJ9EC,sBAAsB;eAAtBA,+BAAsB;;IAqBtBC,mBAAmB;eAAnBA,8BAAmB;;IAjB6DC,eAAe;eAAfA,sBAAe;;IA0B/FC,qBAAqB;eAArBA,kCAAqB;;IAlBrBC,oBAAoB;eAApBA,gCAAoB;;IAXpBC,iBAAiB;eAAjBA,0BAAiB;;IAiBjBC,2BAA2B;eAA3BA,sCAA2B;;IAC3BC,qBAAqB;eAArBA,gCAAqB;;IA5BdC,kBAAkB;eAAlBA,yBAAkB;;IAoCzBC,6BAA6B;eAA7BA,0CAA6B;;IAC7BC,uBAAuB;eAAvBA,oCAAuB;;IAxBTC,uBAAuB;eAAvBA,8BAAuB;;IAKrCC,4BAA4B;eAA5BA,wCAA4B;;IAC5BC,sBAAsB;eAAtBA,kCAAsB;;IAhBDC,wBAAwB;eAAxBA,sCAAwB;;IAUNC,iBAAiB;eAAjBA,wBAAiB;;IALxDC,yBAAyB;eAAzBA,kCAAyB;;IADzBC,mBAAmB;eAAnBA,4BAAmB;;;uBAPc;8BAGiD;yBAQ7E;uBAEkG;4BASlG;2BASA;6BASA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["constants.js"],"sourcesContent":["export const EVENTS = {\n show: 'fui-toast-show',\n dismiss: 'fui-toast-dismiss',\n dismissAll: 'fui-toast-dismiss-all',\n update: 'fui-toast-update',\n pause: 'fui-toast-pause',\n play: 'fui-toast-play'\n};\nexport const TOAST_POSITIONS = {\n bottom: 'bottom',\n bottomEnd: 'bottom-end',\n bottomStart: 'bottom-start',\n top: 'top',\n topEnd: 'top-end',\n topStart: 'top-start'\n};\n"],"names":["EVENTS","TOAST_POSITIONS","show","dismiss","dismissAll","update","pause","play","bottom","bottomEnd","bottomStart","top","topEnd","topStart"],"mappings":";;;;;;;;;;;IAAaA,MAAM;eAANA;;IAQAC,eAAe;eAAfA;;;AARN,MAAMD,SAAS;IAClBE,MAAM;IACNC,SAAS;IACTC,YAAY;IACZC,QAAQ;IACRC,OAAO;IACPC,MAAM;AACV;AACO,MAAMN,kBAAkB;IAC3BO,QAAQ;IACRC,WAAW;IACXC,aAAa;IACbC,KAAK;IACLC,QAAQ;IACRC,UAAU;AACd"}
1
+ {"version":3,"sources":["constants.ts"],"sourcesContent":["export const EVENTS = {\n show: 'fui-toast-show',\n dismiss: 'fui-toast-dismiss',\n dismissAll: 'fui-toast-dismiss-all',\n update: 'fui-toast-update',\n pause: 'fui-toast-pause',\n play: 'fui-toast-play',\n} as const;\n\nexport const TOAST_POSITIONS = {\n bottom: 'bottom',\n bottomEnd: 'bottom-end',\n bottomStart: 'bottom-start',\n top: 'top',\n topEnd: 'top-end',\n topStart: 'top-start',\n} as const;\n"],"names":["EVENTS","TOAST_POSITIONS","show","dismiss","dismissAll","update","pause","play","bottom","bottomEnd","bottomStart","top","topEnd","topStart"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAAaA,MAAAA;eAAAA;;IASAC,eAAAA;eAAAA;;;AATN,MAAMD,SAAS;IACpBE,MAAM;IACNC,SAAS;IACTC,YAAY;IACZC,QAAQ;IACRC,OAAO;IACPC,MAAM;AACR;AAEO,MAAMN,kBAAkB;IAC7BO,QAAQ;IACRC,WAAW;IACXC,aAAa;IACbC,KAAK;IACLC,QAAQ;IACRC,UAAU;AACZ"}
@@ -9,11 +9,11 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- getPositionStyles: function() {
13
- return _vanilla.getPositionStyles;
14
- },
15
12
  TOAST_POSITIONS: function() {
16
13
  return _constants.TOAST_POSITIONS;
14
+ },
15
+ getPositionStyles: function() {
16
+ return _vanilla.getPositionStyles;
17
17
  }
18
18
  });
19
19
  const _export_star = require("@swc/helpers/_/_export_star");
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './types';\nexport * from './useToaster';\nexport * from './useToastController';\nexport { getPositionStyles } from './vanilla';\nexport { TOAST_POSITIONS } from './constants';\n"],"names":["getPositionStyles","TOAST_POSITIONS"],"mappings":";;;;;;;;;;;IAGSA,iBAAiB;eAAjBA,0BAAiB;;IACjBC,eAAe;eAAfA,0BAAe;;;;uBAJV;uBACA;uBACA;yBACoB;2BACF"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './types';\nexport * from './useToaster';\nexport * from './useToastController';\nexport { getPositionStyles } from './vanilla';\nexport { TOAST_POSITIONS } from './constants';\n"],"names":["TOAST_POSITIONS","getPositionStyles"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAISA,eAAe;eAAfA,0BAAe;;IADfC,iBAAiB;eAAjBA,0BAAiB;;;;uBAHZ;uBACA;uBACA;yBACoB;2BACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["types.js"],"sourcesContent":["import * as React from 'react';\n"],"names":[],"mappings":";;;;;iEAAuB"}
1
+ {"version":3,"sources":["types.ts"],"sourcesContent":["import type { Slot } from '@fluentui/react-utilities';\nimport { EVENTS } from './constants';\nimport * as React from 'react';\n\nexport type ToastId = string;\nexport type ToasterId = string;\n\nexport type ToastPosition = 'top-end' | 'top-start' | 'bottom-end' | 'bottom-start' | 'top' | 'bottom';\nexport type ToastPoliteness = 'assertive' | 'polite';\nexport type ToastStatus = 'queued' | 'visible' | 'dismissed' | 'unmounted';\nexport type ToastIntent = 'info' | 'success' | 'error' | 'warning';\nexport type ToastChangeHandler = (event: null, data: ToastChangeData) => void;\n\nexport interface ToastChangeData extends ToastOptions, Pick<Toast, 'updateId'> {\n status: ToastStatus;\n}\n\nexport interface ToastOptions<TData = object> {\n /**\n * Uniquely identifies a toast, used for update and dismiss operations\n */\n toastId: ToastId;\n /**\n * The position the toast should render to\n */\n position: ToastPosition;\n /**\n * Toast content\n */\n content: unknown;\n /**\n * Auto dismiss timeout in milliseconds\n * @default 3000\n */\n timeout: number;\n /**\n * Toast timeout pauses while focus is on another window\n * @default false\n */\n pauseOnWindowBlur: boolean;\n /**\n * Toast timeout pauses while user cursor is on the toast\n * @default false\n */\n pauseOnHover: boolean;\n /**\n * Toast belongs to a specific toaster\n */\n toasterId: ToasterId | undefined;\n /**\n * Higher priority toasts will be rendered before lower priority toasts\n */\n priority: number;\n /**\n * Used to determine [aria-live](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions) narration\n * This will override the intent prop\n */\n politeness?: ToastPoliteness;\n\n /**\n * Default toast types that determine the urgency or [aria-live](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions) narration\n * The UI layer may use these intents to apply specific styling.\n * @default info\n */\n intent?: ToastIntent;\n /**\n * Additional data that needs to be passed to the toast\n */\n data: TData;\n\n /**\n * Reports changes to the Toast lifecycle\n */\n onStatusChange: ToastChangeHandler | undefined;\n}\n\nexport interface ToastOffsetObject {\n horizontal?: number;\n vertical?: number;\n}\n\nexport type ToastOffset = Partial<Record<ToastPosition, ToastOffsetObject>> | ToastOffsetObject;\n\nexport interface ToasterShortcuts {\n focus: (e: KeyboardEvent) => boolean;\n}\n\nexport interface ToasterOptions\n extends Pick<ToastOptions, 'position' | 'timeout' | 'pauseOnWindowBlur' | 'pauseOnHover' | 'priority'> {\n offset?: ToastOffset;\n toasterId?: ToasterId;\n limit?: number;\n shortcuts?: ToasterShortcuts;\n}\n\nexport interface Toast<TData = object> extends ToastOptions<TData> {\n /**\n * Determines the visiblity of a toast\n */\n close: () => void;\n /**\n * Removes a toast completely\n */\n remove: () => void;\n /**\n * A number used to track updates immutably\n */\n updateId: number;\n /**\n * Used to determine default priority when the user does not set one\n * Simple counter of toasts dispatched.\n */\n order: number;\n\n imperativeRef: React.RefObject<ToastImperativeRef>;\n}\n\nexport interface CommonToastDetail {\n toasterId?: ToasterId;\n}\n\nexport interface ShowToastEventDetail extends Partial<ToastOptions>, CommonToastDetail {\n toastId: ToastId;\n}\n\nexport interface UpdateToastEventDetail extends Partial<ToastOptions>, CommonToastDetail {\n toastId: ToastId;\n}\n\nexport interface DismissToastEventDetail extends CommonToastDetail {\n toastId: ToastId;\n}\n\nexport interface PauseToastEventDetail extends CommonToastDetail {\n toastId: ToastId;\n}\n\nexport interface PlayToastEventDetail extends CommonToastDetail {\n toastId: ToastId;\n}\n\nexport interface DismissAllToastsEventDetail extends CommonToastDetail {}\n\ntype EventListener<TDetail> = (e: CustomEvent<TDetail>) => void;\n\nexport type ToastListenerMap = {\n [EVENTS.show]: EventListener<ShowToastEventDetail>;\n [EVENTS.dismiss]: EventListener<DismissToastEventDetail>;\n [EVENTS.dismissAll]: EventListener<DismissAllToastsEventDetail>;\n [EVENTS.update]: EventListener<UpdateToastEventDetail>;\n [EVENTS.play]: EventListener<PlayToastEventDetail>;\n [EVENTS.pause]: EventListener<PauseToastEventDetail>;\n};\n\ntype RootSlot = Slot<'div'>;\n\nexport interface DispatchToastOptions extends Partial<Omit<ToastOptions, 'toasterId'>> {\n root?: RootSlot;\n}\n\nexport interface UpdateToastOptions extends UpdateToastEventDetail {\n root?: RootSlot;\n}\n\nexport type ToastImperativeRef = {\n /**\n * Focuses the Toast.\n * If there are no focusable elements in the Toast, the Toast itself is focused.\n */\n focus: () => void;\n\n /**\n * Resumes the timeout of a paused toast\n */\n play: () => void;\n\n /**\n * Pauses the timeout of a toast\n */\n pause: () => void;\n};\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAEuB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useToastController.js"],"sourcesContent":["import * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { dispatchToast as dispatchToastVanilla, dismissToast as dismissToastVanilla, dismissAllToasts as dismissAllToastsVanilla, updateToast as updateToastVanilla, playToast as playToastVanilla, pauseToast as pauseToastVanilla } from './vanilla';\nconst noop = ()=>undefined;\n/**\n * @param toasterId - If an id is provided all imperative methods control that specific toaster\n * @returns Imperative methods to control toasts\n */ export function useToastController(toasterId) {\n const { targetDocument } = useFluent();\n return React.useMemo(()=>{\n if (!targetDocument) {\n return {\n dispatchToast: noop,\n dismissToast: noop,\n dismissAllToasts: noop,\n updateToast: noop,\n pauseToast: noop,\n playToast: noop\n };\n }\n return {\n dispatchToast: (content, options)=>{\n dispatchToastVanilla(content, {\n ...options,\n toasterId,\n data: {\n root: options === null || options === void 0 ? void 0 : options.root\n }\n }, targetDocument);\n },\n dismissToast: (toastId)=>{\n dismissToastVanilla(toastId, toasterId, targetDocument);\n },\n dismissAllToasts: ()=>{\n dismissAllToastsVanilla(toasterId, targetDocument);\n },\n updateToast: (options)=>{\n updateToastVanilla({\n ...options,\n data: {\n root: options.root\n },\n toasterId\n }, targetDocument);\n },\n pauseToast: (toastId)=>{\n pauseToastVanilla(toastId, toasterId, targetDocument);\n },\n playToast: (toastId)=>{\n playToastVanilla(toastId, toasterId, targetDocument);\n }\n };\n }, [\n targetDocument,\n toasterId\n ]);\n}\n"],"names":["useToastController","noop","undefined","toasterId","targetDocument","useFluent","React","useMemo","dispatchToast","dismissToast","dismissAllToasts","updateToast","pauseToast","playToast","content","options","dispatchToastVanilla","data","root","toastId","dismissToastVanilla","dismissAllToastsVanilla","updateToastVanilla","pauseToastVanilla","playToastVanilla"],"mappings":";;;;+BAOoBA;;;eAAAA;;;;iEAPG;qCACyB;yBAC2L;AAC3O,MAAMC,OAAO,IAAIC;AAIN,SAASF,mBAAmBG,SAAS;IAC5C,MAAM,EAAEC,cAAc,EAAE,GAAGC,IAAAA,uCAAS;IACpC,OAAOC,OAAMC,OAAO,CAAC;QACjB,IAAI,CAACH,gBAAgB;YACjB,OAAO;gBACHI,eAAeP;gBACfQ,cAAcR;gBACdS,kBAAkBT;gBAClBU,aAAaV;gBACbW,YAAYX;gBACZY,WAAWZ;YACf;QACJ;QACA,OAAO;YACHO,eAAe,CAACM,SAASC;gBACrBC,IAAAA,sBAAoB,EAACF,SAAS;oBAC1B,GAAGC,OAAO;oBACVZ;oBACAc,MAAM;wBACFC,MAAMH,YAAY,QAAQA,YAAY,KAAK,IAAI,KAAK,IAAIA,QAAQG,IAAI;oBACxE;gBACJ,GAAGd;YACP;YACAK,cAAc,CAACU;gBACXC,IAAAA,qBAAmB,EAACD,SAAShB,WAAWC;YAC5C;YACAM,kBAAkB;gBACdW,IAAAA,yBAAuB,EAAClB,WAAWC;YACvC;YACAO,aAAa,CAACI;gBACVO,IAAAA,oBAAkB,EAAC;oBACf,GAAGP,OAAO;oBACVE,MAAM;wBACFC,MAAMH,QAAQG,IAAI;oBACtB;oBACAf;gBACJ,GAAGC;YACP;YACAQ,YAAY,CAACO;gBACTI,IAAAA,mBAAiB,EAACJ,SAAShB,WAAWC;YAC1C;YACAS,WAAW,CAACM;gBACRK,IAAAA,kBAAgB,EAACL,SAAShB,WAAWC;YACzC;QACJ;IACJ,GAAG;QACCA;QACAD;KACH;AACL"}
1
+ {"version":3,"sources":["useToastController.ts"],"sourcesContent":["import * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport {\n dispatchToast as dispatchToastVanilla,\n dismissToast as dismissToastVanilla,\n dismissAllToasts as dismissAllToastsVanilla,\n updateToast as updateToastVanilla,\n playToast as playToastVanilla,\n pauseToast as pauseToastVanilla,\n} from './vanilla';\nimport { DispatchToastOptions, ToastId, ToasterId, UpdateToastOptions } from './types';\n\nconst noop = () => undefined;\n\n/**\n * @param toasterId - If an id is provided all imperative methods control that specific toaster\n * @returns Imperative methods to control toasts\n */\nexport function useToastController(toasterId?: ToasterId) {\n const { targetDocument } = useFluent();\n\n return React.useMemo(() => {\n if (!targetDocument) {\n return {\n dispatchToast: noop,\n dismissToast: noop,\n dismissAllToasts: noop,\n updateToast: noop,\n pauseToast: noop,\n playToast: noop,\n };\n }\n\n return {\n dispatchToast: (content: React.ReactNode, options?: DispatchToastOptions) => {\n dispatchToastVanilla(content, { ...options, toasterId, data: { root: options?.root } }, targetDocument);\n },\n dismissToast: (toastId: ToastId) => {\n dismissToastVanilla(toastId, toasterId, targetDocument);\n },\n dismissAllToasts: () => {\n dismissAllToastsVanilla(toasterId, targetDocument);\n },\n updateToast: (options: UpdateToastOptions) => {\n updateToastVanilla({ ...options, data: { root: options.root }, toasterId }, targetDocument);\n },\n pauseToast: (toastId: ToastId) => {\n pauseToastVanilla(toastId, toasterId, targetDocument);\n },\n playToast: (toastId: ToastId) => {\n playToastVanilla(toastId, toasterId, targetDocument);\n },\n };\n }, [targetDocument, toasterId]);\n}\n"],"names":["useToastController","noop","undefined","toasterId","targetDocument","useFluent","React","useMemo","dispatchToast","dismissToast","dismissAllToasts","updateToast","pauseToast","playToast","content","options","dispatchToastVanilla","data","root","toastId","dismissToastVanilla","dismissAllToastsVanilla","updateToastVanilla","pauseToastVanilla","playToastVanilla"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAkBgBA;;;eAAAA;;;;iEAlBO;qCACyB;yBAQzC;AAGP,MAAMC,OAAO,IAAMC;AAMZ,SAASF,mBAAmBG,SAAqB;IACtD,MAAM,EAAEC,cAAc,EAAE,GAAGC,IAAAA,uCAAAA;IAE3B,OAAOC,OAAMC,OAAO,CAAC;QACnB,IAAI,CAACH,gBAAgB;YACnB,OAAO;gBACLI,eAAeP;gBACfQ,cAAcR;gBACdS,kBAAkBT;gBAClBU,aAAaV;gBACbW,YAAYX;gBACZY,WAAWZ;YACb;QACF;QAEA,OAAO;YACLO,eAAe,CAACM,SAA0BC;gBACxCC,IAAAA,sBAAAA,EAAqBF,SAAS;oBAAE,GAAGC,OAAO;oBAAEZ;oBAAWc,MAAM;wBAAEC,MAAMH,YAAAA,QAAAA,YAAAA,KAAAA,IAAAA,KAAAA,IAAAA,QAASG,IAAI;oBAAC;gBAAE,GAAGd;YAC1F;YACAK,cAAc,CAACU;gBACbC,IAAAA,qBAAAA,EAAoBD,SAAShB,WAAWC;YAC1C;YACAM,kBAAkB;gBAChBW,IAAAA,yBAAAA,EAAwBlB,WAAWC;YACrC;YACAO,aAAa,CAACI;gBACZO,IAAAA,oBAAAA,EAAmB;oBAAE,GAAGP,OAAO;oBAAEE,MAAM;wBAAEC,MAAMH,QAAQG,IAAI;oBAAC;oBAAGf;gBAAU,GAAGC;YAC9E;YACAQ,YAAY,CAACO;gBACXI,IAAAA,mBAAAA,EAAkBJ,SAAShB,WAAWC;YACxC;YACAS,WAAW,CAACM;gBACVK,IAAAA,kBAAAA,EAAiBL,SAAShB,WAAWC;YACvC;QACF;IACF,GAAG;QAACA;QAAgBD;KAAU;AAChC"}