@fluentui/react-toast 9.5.5 → 9.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/CHANGELOG.md +29 -2
  2. package/lib/AriaLive.js.map +1 -1
  3. package/lib/Toast.js.map +1 -1
  4. package/lib/ToastBody.js.map +1 -1
  5. package/lib/ToastContainer.js.map +1 -1
  6. package/lib/ToastFooter.js.map +1 -1
  7. package/lib/ToastTitle.js.map +1 -1
  8. package/lib/ToastTrigger.js.map +1 -1
  9. package/lib/Toaster.js.map +1 -1
  10. package/lib/components/AriaLive/AriaLive.js.map +1 -1
  11. package/lib/components/AriaLive/AriaLive.types.js.map +1 -1
  12. package/lib/components/AriaLive/index.js.map +1 -1
  13. package/lib/components/AriaLive/renderAriaLive.js.map +1 -1
  14. package/lib/components/AriaLive/useAriaLive.js.map +1 -1
  15. package/lib/components/AriaLive/useAriaLiveStyles.styles.raw.js +25 -0
  16. package/lib/components/AriaLive/useAriaLiveStyles.styles.raw.js.map +1 -0
  17. package/lib/components/Timer/Timer.js.map +1 -1
  18. package/lib/components/Timer/index.js.map +1 -1
  19. package/lib/components/Timer/useTimerStyles.styles.raw.js +11 -0
  20. package/lib/components/Timer/useTimerStyles.styles.raw.js.map +1 -0
  21. package/lib/components/Toast/Toast.js.map +1 -1
  22. package/lib/components/Toast/Toast.types.js.map +1 -1
  23. package/lib/components/Toast/index.js.map +1 -1
  24. package/lib/components/Toast/renderToast.js.map +1 -1
  25. package/lib/components/Toast/useToast.js.map +1 -1
  26. package/lib/components/Toast/useToastContextValues.js.map +1 -1
  27. package/lib/components/Toast/useToastStyles.styles.raw.js +33 -0
  28. package/lib/components/Toast/useToastStyles.styles.raw.js.map +1 -0
  29. package/lib/components/ToastBody/ToastBody.js.map +1 -1
  30. package/lib/components/ToastBody/ToastBody.types.js.map +1 -1
  31. package/lib/components/ToastBody/index.js.map +1 -1
  32. package/lib/components/ToastBody/renderToastBody.js.map +1 -1
  33. package/lib/components/ToastBody/useToastBody.js.map +1 -1
  34. package/lib/components/ToastBody/useToastBodyStyles.styles.raw.js +46 -0
  35. package/lib/components/ToastBody/useToastBodyStyles.styles.raw.js.map +1 -0
  36. package/lib/components/ToastContainer/ToastContainer.js.map +1 -1
  37. package/lib/components/ToastContainer/ToastContainer.types.js.map +1 -1
  38. package/lib/components/ToastContainer/index.js.map +1 -1
  39. package/lib/components/ToastContainer/renderToastContainer.js.map +1 -1
  40. package/lib/components/ToastContainer/useToastContainer.js.map +1 -1
  41. package/lib/components/ToastContainer/useToastContainerContextValues.js.map +1 -1
  42. package/lib/components/ToastContainer/useToastContainerStyles.styles.raw.js +24 -0
  43. package/lib/components/ToastContainer/useToastContainerStyles.styles.raw.js.map +1 -0
  44. package/lib/components/ToastFooter/ToastFooter.js.map +1 -1
  45. package/lib/components/ToastFooter/ToastFooter.types.js.map +1 -1
  46. package/lib/components/ToastFooter/index.js.map +1 -1
  47. package/lib/components/ToastFooter/renderToastFooter.js.map +1 -1
  48. package/lib/components/ToastFooter/useToastFooter.js.map +1 -1
  49. package/lib/components/ToastFooter/useToastFooterStyles.styles.raw.js +22 -0
  50. package/lib/components/ToastFooter/useToastFooterStyles.styles.raw.js.map +1 -0
  51. package/lib/components/ToastTitle/ToastTitle.js.map +1 -1
  52. package/lib/components/ToastTitle/ToastTitle.types.js.map +1 -1
  53. package/lib/components/ToastTitle/index.js.map +1 -1
  54. package/lib/components/ToastTitle/renderToastTitle.js.map +1 -1
  55. package/lib/components/ToastTitle/useToastTitle.js.map +1 -1
  56. package/lib/components/ToastTitle/useToastTitleStyles.styles.raw.js +87 -0
  57. package/lib/components/ToastTitle/useToastTitleStyles.styles.raw.js.map +1 -0
  58. package/lib/components/ToastTrigger/ToastTrigger.js.map +1 -1
  59. package/lib/components/ToastTrigger/ToastTrigger.types.js.map +1 -1
  60. package/lib/components/ToastTrigger/index.js.map +1 -1
  61. package/lib/components/ToastTrigger/renderToastTrigger.js.map +1 -1
  62. package/lib/components/ToastTrigger/useToastTrigger.js.map +1 -1
  63. package/lib/components/Toaster/Toaster.js.map +1 -1
  64. package/lib/components/Toaster/Toaster.types.js.map +1 -1
  65. package/lib/components/Toaster/index.js.map +1 -1
  66. package/lib/components/Toaster/renderToaster.js.map +1 -1
  67. package/lib/components/Toaster/useToastAnnounce.js.map +1 -1
  68. package/lib/components/Toaster/useToaster.js.map +1 -1
  69. package/lib/components/Toaster/useToasterFocusManagement.js.map +1 -1
  70. package/lib/components/Toaster/useToasterStyles.styles.raw.js +68 -0
  71. package/lib/components/Toaster/useToasterStyles.styles.raw.js.map +1 -0
  72. package/lib/contexts/toastContainerContext.js.map +1 -1
  73. package/lib/index.js.map +1 -1
  74. package/lib/state/constants.js.map +1 -1
  75. package/lib/state/index.js.map +1 -1
  76. package/lib/state/types.js.map +1 -1
  77. package/lib/state/useToastController.js.map +1 -1
  78. package/lib/state/useToaster.js.map +1 -1
  79. package/lib/state/vanilla/createToaster.js.map +1 -1
  80. package/lib/state/vanilla/dismissAllToasts.js.map +1 -1
  81. package/lib/state/vanilla/dismissToast.js.map +1 -1
  82. package/lib/state/vanilla/dispatchToast.js.map +1 -1
  83. package/lib/state/vanilla/getPositionStyles.js.map +1 -1
  84. package/lib/state/vanilla/index.js.map +1 -1
  85. package/lib/state/vanilla/pauseToast.js.map +1 -1
  86. package/lib/state/vanilla/playToast.js.map +1 -1
  87. package/lib/state/vanilla/updateToast.js.map +1 -1
  88. package/lib-commonjs/AriaLive.js.map +1 -1
  89. package/lib-commonjs/Toast.js.map +1 -1
  90. package/lib-commonjs/ToastBody.js.map +1 -1
  91. package/lib-commonjs/ToastContainer.js.map +1 -1
  92. package/lib-commonjs/ToastFooter.js.map +1 -1
  93. package/lib-commonjs/ToastTitle.js.map +1 -1
  94. package/lib-commonjs/ToastTrigger.js.map +1 -1
  95. package/lib-commonjs/Toaster.js.map +1 -1
  96. package/lib-commonjs/components/AriaLive/AriaLive.js.map +1 -1
  97. package/lib-commonjs/components/AriaLive/AriaLive.types.js.map +1 -1
  98. package/lib-commonjs/components/AriaLive/index.js.map +1 -1
  99. package/lib-commonjs/components/AriaLive/renderAriaLive.js.map +1 -1
  100. package/lib-commonjs/components/AriaLive/useAriaLive.js.map +1 -1
  101. package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.js.map +1 -1
  102. package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.raw.js +41 -0
  103. package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.raw.js.map +1 -0
  104. package/lib-commonjs/components/Timer/Timer.js.map +1 -1
  105. package/lib-commonjs/components/Timer/index.js.map +1 -1
  106. package/lib-commonjs/components/Timer/useTimerStyles.styles.js.map +1 -1
  107. package/lib-commonjs/components/Timer/useTimerStyles.styles.raw.js +21 -0
  108. package/lib-commonjs/components/Timer/useTimerStyles.styles.raw.js.map +1 -0
  109. package/lib-commonjs/components/Toast/Toast.js.map +1 -1
  110. package/lib-commonjs/components/Toast/Toast.types.js.map +1 -1
  111. package/lib-commonjs/components/Toast/index.js.map +1 -1
  112. package/lib-commonjs/components/Toast/renderToast.js.map +1 -1
  113. package/lib-commonjs/components/Toast/useToast.js.map +1 -1
  114. package/lib-commonjs/components/Toast/useToastContextValues.js.map +1 -1
  115. package/lib-commonjs/components/Toast/useToastStyles.styles.js.map +1 -1
  116. package/lib-commonjs/components/Toast/useToastStyles.styles.raw.js +49 -0
  117. package/lib-commonjs/components/Toast/useToastStyles.styles.raw.js.map +1 -0
  118. package/lib-commonjs/components/ToastBody/ToastBody.js.map +1 -1
  119. package/lib-commonjs/components/ToastBody/ToastBody.types.js.map +1 -1
  120. package/lib-commonjs/components/ToastBody/index.js.map +1 -1
  121. package/lib-commonjs/components/ToastBody/renderToastBody.js.map +1 -1
  122. package/lib-commonjs/components/ToastBody/useToastBody.js.map +1 -1
  123. package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.js.map +1 -1
  124. package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.raw.js +62 -0
  125. package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.raw.js.map +1 -0
  126. package/lib-commonjs/components/ToastContainer/ToastContainer.js.map +1 -1
  127. package/lib-commonjs/components/ToastContainer/ToastContainer.types.js.map +1 -1
  128. package/lib-commonjs/components/ToastContainer/index.js.map +1 -1
  129. package/lib-commonjs/components/ToastContainer/renderToastContainer.js.map +1 -1
  130. package/lib-commonjs/components/ToastContainer/useToastContainer.js.map +1 -1
  131. package/lib-commonjs/components/ToastContainer/useToastContainerContextValues.js.map +1 -1
  132. package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.js.map +1 -1
  133. package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.raw.js +40 -0
  134. package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.raw.js.map +1 -0
  135. package/lib-commonjs/components/ToastFooter/ToastFooter.js.map +1 -1
  136. package/lib-commonjs/components/ToastFooter/ToastFooter.types.js.map +1 -1
  137. package/lib-commonjs/components/ToastFooter/index.js.map +1 -1
  138. package/lib-commonjs/components/ToastFooter/renderToastFooter.js.map +1 -1
  139. package/lib-commonjs/components/ToastFooter/useToastFooter.js.map +1 -1
  140. package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.js.map +1 -1
  141. package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.raw.js +38 -0
  142. package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.raw.js.map +1 -0
  143. package/lib-commonjs/components/ToastTitle/ToastTitle.js.map +1 -1
  144. package/lib-commonjs/components/ToastTitle/ToastTitle.types.js.map +1 -1
  145. package/lib-commonjs/components/ToastTitle/index.js.map +1 -1
  146. package/lib-commonjs/components/ToastTitle/renderToastTitle.js.map +1 -1
  147. package/lib-commonjs/components/ToastTitle/useToastTitle.js.map +1 -1
  148. package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.js.map +1 -1
  149. package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.raw.js +103 -0
  150. package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.raw.js.map +1 -0
  151. package/lib-commonjs/components/ToastTrigger/ToastTrigger.js.map +1 -1
  152. package/lib-commonjs/components/ToastTrigger/ToastTrigger.types.js.map +1 -1
  153. package/lib-commonjs/components/ToastTrigger/index.js.map +1 -1
  154. package/lib-commonjs/components/ToastTrigger/renderToastTrigger.js.map +1 -1
  155. package/lib-commonjs/components/ToastTrigger/useToastTrigger.js.map +1 -1
  156. package/lib-commonjs/components/Toaster/Toaster.js.map +1 -1
  157. package/lib-commonjs/components/Toaster/Toaster.types.js.map +1 -1
  158. package/lib-commonjs/components/Toaster/index.js.map +1 -1
  159. package/lib-commonjs/components/Toaster/renderToaster.js.map +1 -1
  160. package/lib-commonjs/components/Toaster/useToastAnnounce.js.map +1 -1
  161. package/lib-commonjs/components/Toaster/useToaster.js.map +1 -1
  162. package/lib-commonjs/components/Toaster/useToasterFocusManagement.js.map +1 -1
  163. package/lib-commonjs/components/Toaster/useToasterStyles.styles.js.map +1 -1
  164. package/lib-commonjs/components/Toaster/useToasterStyles.styles.raw.js +84 -0
  165. package/lib-commonjs/components/Toaster/useToasterStyles.styles.raw.js.map +1 -0
  166. package/lib-commonjs/contexts/toastContainerContext.js.map +1 -1
  167. package/lib-commonjs/index.js.map +1 -1
  168. package/lib-commonjs/state/constants.js.map +1 -1
  169. package/lib-commonjs/state/index.js.map +1 -1
  170. package/lib-commonjs/state/types.js.map +1 -1
  171. package/lib-commonjs/state/useToastController.js.map +1 -1
  172. package/lib-commonjs/state/useToaster.js.map +1 -1
  173. package/lib-commonjs/state/vanilla/createToaster.js.map +1 -1
  174. package/lib-commonjs/state/vanilla/dismissAllToasts.js.map +1 -1
  175. package/lib-commonjs/state/vanilla/dismissToast.js.map +1 -1
  176. package/lib-commonjs/state/vanilla/dispatchToast.js.map +1 -1
  177. package/lib-commonjs/state/vanilla/getPositionStyles.js.map +1 -1
  178. package/lib-commonjs/state/vanilla/index.js.map +1 -1
  179. package/lib-commonjs/state/vanilla/pauseToast.js.map +1 -1
  180. package/lib-commonjs/state/vanilla/playToast.js.map +1 -1
  181. package/lib-commonjs/state/vanilla/updateToast.js.map +1 -1
  182. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ToastTitle/renderToastTitle.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { ToastTitleState, ToastTitleSlots } from './ToastTitle.types';\n\n/**\n * Render the final JSX of ToastTitle\n */\nexport const renderToastTitle_unstable = (state: ToastTitleState) => {\n assertSlots<ToastTitleSlots>(state);\n\n return (\n <>\n {state.media ? <state.media /> : null}\n <state.root />\n {state.action ? <state.action /> : null}\n </>\n );\n};\n"],"names":["renderToastTitle_unstable","state","assertSlots","_jsxs","_Fragment","media","_jsx","root","action"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;gCAE4B;AAMrB,MAAMA,4BAA4B,CAACC;IACxCC,IAAAA,2BAAAA,EAA6BD;IAE7B,OAAA,WAAA,GACEE,IAAAA,gBAAA,EAAAC,oBAAA,EAAA;;YACGH,MAAMI,KAAK,GAAA,WAAA,GAAGC,IAAAA,eAAA,EAACL,MAAMI,KAAK,EAAA,CAAA,KAAM;0BACjCC,IAAAA,eAAA,EAACL,MAAMM,IAAI,EAAA,CAAA;YACVN,MAAMO,MAAM,GAAA,WAAA,GAAGF,IAAAA,eAAA,EAACL,MAAMO,MAAM,EAAA,CAAA,KAAM;;;AAGzC"}
1
+ {"version":3,"sources":["../src/components/ToastTitle/renderToastTitle.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { ToastTitleState, ToastTitleSlots } from './ToastTitle.types';\n\n/**\n * Render the final JSX of ToastTitle\n */\nexport const renderToastTitle_unstable = (state: ToastTitleState) => {\n assertSlots<ToastTitleSlots>(state);\n\n return (\n <>\n {state.media ? <state.media /> : null}\n <state.root />\n {state.action ? <state.action /> : null}\n </>\n );\n};\n"],"names":["assertSlots","renderToastTitle_unstable","state","media","root","action"],"mappings":";;;;+BASaC;;;;;;4BARb,UAAiD;gCAErB,4BAA4B;AAMjD,kCAAkC,CAACC;QACxCF,2BAAAA,EAA6BE;IAE7B,OAAA,WAAA,OACE,gBAAA,EAAA,oBAAA,EAAA;;YACGA,MAAMC,KAAK,GAAA,WAAA,OAAG,eAAA,EAACD,MAAMC,KAAK,EAAA,CAAA,KAAM;8BACjC,eAAA,EAACD,MAAME,IAAI,EAAA,CAAA;YACVF,MAAMG,MAAM,GAAA,WAAA,OAAG,eAAA,EAACH,MAAMG,MAAM,EAAA,CAAA,KAAM;;;AAGzC,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ToastTitle/useToastTitle.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { CheckmarkCircleFilled, DismissCircleFilled, InfoFilled, WarningFilled } from '@fluentui/react-icons';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { useBackgroundAppearance } from '@fluentui/react-shared-contexts';\n\nimport type { ToastTitleProps, ToastTitleState } from './ToastTitle.types';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\n\n/**\n * Create the state required to render ToastTitle.\n *\n * The returned state can be modified with hooks such as useToastTitleStyles_unstable,\n * before being passed to renderToastTitle_unstable.\n *\n * @param props - props from this instance of ToastTitle\n * @param ref - reference to root HTMLElement of ToastTitle\n */\nexport const useToastTitle_unstable = (props: ToastTitleProps, ref: React.Ref<HTMLElement>): ToastTitleState => {\n const { intent, titleId } = useToastContainerContext();\n const backgroundAppearance = useBackgroundAppearance();\n\n /** Determine the role and media to render based on the intent */\n let defaultIcon;\n switch (intent) {\n case 'success':\n defaultIcon = <CheckmarkCircleFilled />;\n break;\n case 'error':\n defaultIcon = <DismissCircleFilled />;\n break;\n case 'warning':\n defaultIcon = <WarningFilled />;\n break;\n case 'info':\n defaultIcon = <InfoFilled />;\n break;\n }\n\n return {\n action: slot.optional(props.action, { elementType: 'div' }),\n components: { root: 'div', media: 'div', action: 'div' },\n media: slot.optional(props.media, {\n renderByDefault: !!intent,\n defaultProps: { children: defaultIcon },\n elementType: 'div',\n }),\n root: slot.always(\n getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref as React.Ref<HTMLDivElement>,\n children: props.children,\n id: titleId,\n ...props,\n }),\n { elementType: 'div' },\n ),\n intent,\n backgroundAppearance,\n };\n};\n"],"names":["useToastTitle_unstable","props","ref","intent","titleId","useToastContainerContext","backgroundAppearance","useBackgroundAppearance","defaultIcon","React","createElement","CheckmarkCircleFilled","DismissCircleFilled","WarningFilled","InfoFilled","action","slot","optional","elementType","components","root","media","renderByDefault","defaultProps","children","always","getIntrinsicElementProps","id"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAkBaA;;;eAAAA;;;;iEAlBU;4BAE+D;gCACvC;qCACP;uCAGC;AAWlC,MAAMA,yBAAyB,CAACC,OAAwBC;IAC7D,MAAM,EAAEC,MAAM,EAAEC,OAAO,EAAE,GAAGC,IAAAA,+CAAAA;IAC5B,MAAMC,uBAAuBC,IAAAA,4CAAAA;IAE7B,+DAA+D,GAC/D,IAAIC;IACJ,OAAQL;QACN,KAAK;YACHK,cAAAA,WAAAA,GAAcC,OAAAC,aAAA,CAACC,iCAAAA,EAAAA;YACf;QACF,KAAK;YACHH,cAAAA,WAAAA,GAAcC,OAAAC,aAAA,CAACE,+BAAAA,EAAAA;YACf;QACF,KAAK;YACHJ,cAAAA,WAAAA,GAAcC,OAAAC,aAAA,CAACG,yBAAAA,EAAAA;YACf;QACF,KAAK;YACHL,cAAAA,WAAAA,GAAcC,OAAAC,aAAA,CAACI,sBAAAA,EAAAA;YACf;IACJ;IAEA,OAAO;QACLC,QAAQC,oBAAAA,CAAKC,QAAQ,CAAChB,MAAMc,MAAM,EAAE;YAAEG,aAAa;QAAM;QACzDC,YAAY;YAAEC,MAAM;YAAOC,OAAO;YAAON,QAAQ;QAAM;QACvDM,OAAOL,oBAAAA,CAAKC,QAAQ,CAAChB,MAAMoB,KAAK,EAAE;YAChCC,iBAAiB,CAAC,CAACnB;YACnBoB,cAAc;gBAAEC,UAAUhB;YAAY;YACtCU,aAAa;QACf;QACAE,MAAMJ,oBAAAA,CAAKS,MAAM,CACfC,IAAAA,wCAAAA,EAAyB,OAAO;YAC9B,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FxB,KAAKA;YACLsB,UAAUvB,MAAMuB,QAAQ;YACxBG,IAAIvB;YACJ,GAAGH,KAAK;QACV,IACA;YAAEiB,aAAa;QAAM;QAEvBf;QACAG;IACF;AACF"}
1
+ {"version":3,"sources":["../src/components/ToastTitle/useToastTitle.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { CheckmarkCircleFilled, DismissCircleFilled, InfoFilled, WarningFilled } from '@fluentui/react-icons';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { useBackgroundAppearance } from '@fluentui/react-shared-contexts';\n\nimport type { ToastTitleProps, ToastTitleState } from './ToastTitle.types';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\n\n/**\n * Create the state required to render ToastTitle.\n *\n * The returned state can be modified with hooks such as useToastTitleStyles_unstable,\n * before being passed to renderToastTitle_unstable.\n *\n * @param props - props from this instance of ToastTitle\n * @param ref - reference to root HTMLElement of ToastTitle\n */\nexport const useToastTitle_unstable = (props: ToastTitleProps, ref: React.Ref<HTMLElement>): ToastTitleState => {\n const { intent, titleId } = useToastContainerContext();\n const backgroundAppearance = useBackgroundAppearance();\n\n /** Determine the role and media to render based on the intent */\n let defaultIcon;\n switch (intent) {\n case 'success':\n defaultIcon = <CheckmarkCircleFilled />;\n break;\n case 'error':\n defaultIcon = <DismissCircleFilled />;\n break;\n case 'warning':\n defaultIcon = <WarningFilled />;\n break;\n case 'info':\n defaultIcon = <InfoFilled />;\n break;\n }\n\n return {\n action: slot.optional(props.action, { elementType: 'div' }),\n components: { root: 'div', media: 'div', action: 'div' },\n media: slot.optional(props.media, {\n renderByDefault: !!intent,\n defaultProps: { children: defaultIcon },\n elementType: 'div',\n }),\n root: slot.always(\n getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref as React.Ref<HTMLDivElement>,\n children: props.children,\n id: titleId,\n ...props,\n }),\n { elementType: 'div' },\n ),\n intent,\n backgroundAppearance,\n };\n};\n"],"names":["React","CheckmarkCircleFilled","DismissCircleFilled","InfoFilled","WarningFilled","getIntrinsicElementProps","slot","useBackgroundAppearance","useToastContainerContext","useToastTitle_unstable","props","ref","intent","titleId","backgroundAppearance","defaultIcon","action","optional","elementType","components","root","media","renderByDefault","defaultProps","children","always","id"],"mappings":";;;;+BAkBaS;;;;;;;iEAlBU,QAAQ;4BAEuD,wBAAwB;gCAC/D,4BAA4B;qCACnC,kCAAkC;uCAGjC,uCAAuC;AAWzE,+BAA+B,CAACC,OAAwBC;IAC7D,MAAM,EAAEC,MAAM,EAAEC,OAAO,EAAE,OAAGL,+CAAAA;IAC5B,MAAMM,2BAAuBP,4CAAAA;IAE7B,+DAA+D,GAC/D,IAAIQ;IACJ,OAAQH;QACN,KAAK;YACHG,cAAAA,WAAAA,GAAc,OAAA,aAAA,CAACd,iCAAAA,EAAAA;YACf;QACF,KAAK;YACHc,cAAAA,WAAAA,GAAc,OAAA,aAAA,CAACb,+BAAAA,EAAAA;YACf;QACF,KAAK;YACHa,cAAAA,WAAAA,GAAc,OAAA,aAAA,CAACX,yBAAAA,EAAAA;YACf;QACF,KAAK;YACHW,cAAAA,WAAAA,GAAc,OAAA,aAAA,CAACZ,sBAAAA,EAAAA;YACf;IACJ;IAEA,OAAO;QACLa,QAAQV,oBAAAA,CAAKW,QAAQ,CAACP,MAAMM,MAAM,EAAE;YAAEE,aAAa;QAAM;QACzDC,YAAY;YAAEC,MAAM;YAAOC,OAAO;YAAOL,QAAQ;QAAM;QACvDK,OAAOf,oBAAAA,CAAKW,QAAQ,CAACP,MAAMW,KAAK,EAAE;YAChCC,iBAAiB,CAAC,CAACV;YACnBW,cAAc;gBAAEC,UAAUT;YAAY;YACtCG,aAAa;QACf;QACAE,MAAMd,oBAAAA,CAAKmB,MAAM,KACfpB,wCAAAA,EAAyB,OAAO;YAC9B,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FM,KAAKA;YACLa,UAAUd,MAAMc,QAAQ;YACxBE,IAAIb;YACJ,GAAGH,KAAK;QACV,IACA;YAAEQ,aAAa;QAAM;QAEvBN;QACAE;IACF;AACF,EAAE"}
@@ -1 +1 @@
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, intent && intentIconStyles[intent], intent && state.backgroundAppearance === 'inverted' && intentIconStylesInverted[intent], state.media.className);\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","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C,GAAA;QAAA;QAAA;QAAA;QAAA;KAAA;AAAA;AAgBzB,MAAMX,+BAAgCkB,CAAAA;IAC7C;IACA,MAAMC,oBAAoBf;IAC1B,MAAMgB,sBAAsBb;IAC5B,MAAMc,qBAAqBf;IAC3B,MAAMgB,mBAAmBV;IACzB,MAAMW,2BAA2BN;IACjC,MAAM,EAAEO,MAAAA,EAAQ,GAAGN;IACnB,MAAMO,iBAAiBjB;IACvBU,MAAMjB,IAAI,CAACyB,SAAS,GAAGC,IAAAA,mBAAY,EAAC5B,qBAAqBE,IAAI,EAAEkB,mBAAmBD,MAAMU,oBAAoB,KAAK,cAAcH,eAAexB,IAAI,EAAEiB,MAAMjB,IAAI,CAACyB,SAAS;IACxK,IAAIR,MAAMhB,KAAK,EAAE;QACbgB,MAAMhB,KAAK,CAACwB,SAAS,GAAGC,IAAAA,mBAAY,EAAC5B,qBAAqBG,KAAK,EAAEmB,oBAAoBH,MAAMU,oBAAoB,KAAK,cAAcH,eAAevB,KAAK,EAAEsB,UAAUF,gBAAgB,CAACE,OAAO,EAAEA,UAAUN,MAAMU,oBAAoB,KAAK,cAAcL,wBAAwB,CAACC,OAAO,EAAEN,MAAMhB,KAAK,CAACwB,SAAS;IAC9S;IACA,IAAIR,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
+ {"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, intent && intentIconStyles[intent], intent && state.backgroundAppearance === 'inverted' && intentIconStylesInverted[intent], state.media.className);\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":["__styles","__resetStyles","mergeClasses","tokens","toastTitleClassNames","root","media","action","useRootBaseClassName","useMediaBaseClassName","useActionBaseClassName","useInvertedStyles","sj55zd","d","useIntentIconStyles","success","error","warning","info","useIntentIconStylesInverted","useToastTitleStyles_unstable","state","rootBaseClassName","actionBaseClassName","mediaBaseClassName","intentIconStyles","intentIconStylesInverted","intent","invertedStyles","className","backgroundAppearance"],"mappings":";;;;;;;;;;;IAEaI,oBAAoB;;;gCAmEY;eAA5BgB;;;uBArEyC,gBAAgB;AAEnE,6BAA6B;IAChCf,IAAI,EAAE,gBAAgB;IACtBC,KAAK,EAAE,uBAAuB;IAC9BC,MAAM,EAAE;AACZ,CAAC;AACD,MAAMC,oBAAoB,GAAA,WAAA,OAAGP,oBAAA,EAAA,WAAA,MAAA;IAAA;CAK5B,CAAC;AACF,MAAMQ,qBAAqB,GAAA,WAAA,OAAGR,oBAAA,EAAA,WAAA,YAAA;IAAA;IAAA;CAO7B,CAAC;AACF,MAAMS,sBAAsB,GAAA,WAAA,OAAGT,oBAAA,EAAA,WAAA,WAAA;IAAA;IAAA;CAM9B,CAAC;AACF,MAAMU,iBAAiB,GAAA,WAAA,OAAGX,eAAA,EAAA;IAAAK,IAAA,EAAA;QAAAO,MAAA,EAAA;IAAA;IAAAL,MAAA,EAAA;QAAAK,MAAA,EAAA;IAAA;IAAAN,KAAA,EAAA;QAAAM,MAAA,EAAA;IAAA;AAAA,GAAA;IAAAC,CAAA,EAAA;QAAA;QAAA;QAAA;KAAA;AAAA,CAUzB,CAAC;AACF,MAAMC,mBAAmB,GAAA,WAAA,GAAGd,mBAAA,EAAA;IAAAe,OAAA,EAAA;QAAAH,MAAA,EAAA;IAAA;IAAAI,KAAA,EAAA;QAAAJ,MAAA,EAAA;IAAA;IAAAK,O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KAAK,UAAU,IAAIF,cAAc,CAACtB,KAAK,EAAEqB,MAAM,IAAIF,gBAAgB,CAACE,MAAM,CAAC,EAAEA,MAAM,IAAIN,KAAK,CAACS,oBAAoB,KAAK,UAAU,IAAIJ,wBAAwB,CAACC,MAAM,CAAC,EAAEN,KAAK,CAACf,KAAK,CAACuB,SAAS,CAAC;IAC/S;IACA,IAAIR,KAAK,CAACd,MAAM,EAAE;QACdc,KAAK,CAACd,MAAM,CAACsB,SAAS,OAAG3B,mBAAY,EAACE,oBAAoB,CAACG,MAAM,EAAEgB,mBAAmB,EAAEF,KAAK,CAACS,oBAAoB,KAAK,UAAU,IAAIF,cAAc,CAACrB,MAAM,EAAEc,KAAK,CAACd,MAAM,CAACsB,SAAS,CAAC;IACvL;IACA,OAAOR,KAAK;AAChB,CAAC"}
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ toastTitleClassNames: function() {
13
+ return toastTitleClassNames;
14
+ },
15
+ useToastTitleStyles_unstable: function() {
16
+ return useToastTitleStyles_unstable;
17
+ }
18
+ });
19
+ const _react = require("@griffel/react");
20
+ const _reacttheme = require("@fluentui/react-theme");
21
+ const toastTitleClassNames = {
22
+ root: 'fui-ToastTitle',
23
+ media: 'fui-ToastTitle__media',
24
+ action: 'fui-ToastTitle__action'
25
+ };
26
+ const useRootBaseClassName = (0, _react.makeResetStyles)({
27
+ display: 'flex',
28
+ gridColumnEnd: 3,
29
+ color: _reacttheme.tokens.colorNeutralForeground1,
30
+ wordBreak: 'break-word'
31
+ });
32
+ const useMediaBaseClassName = (0, _react.makeResetStyles)({
33
+ display: 'flex',
34
+ paddingTop: '2px',
35
+ gridColumnEnd: 2,
36
+ paddingRight: '8px',
37
+ fontSize: '16px',
38
+ color: _reacttheme.tokens.colorNeutralForeground1
39
+ });
40
+ const useActionBaseClassName = (0, _react.makeResetStyles)({
41
+ display: 'flex',
42
+ alignItems: 'start',
43
+ paddingLeft: '12px',
44
+ gridColumnEnd: -1,
45
+ color: _reacttheme.tokens.colorBrandForeground1
46
+ });
47
+ const useInvertedStyles = (0, _react.makeStyles)({
48
+ root: {
49
+ color: _reacttheme.tokens.colorNeutralForegroundInverted2
50
+ },
51
+ action: {
52
+ color: _reacttheme.tokens.colorBrandForegroundInverted
53
+ },
54
+ media: {
55
+ color: _reacttheme.tokens.colorNeutralForegroundInverted
56
+ }
57
+ });
58
+ const useIntentIconStyles = (0, _react.makeStyles)({
59
+ success: {
60
+ color: _reacttheme.tokens.colorStatusSuccessForeground1
61
+ },
62
+ error: {
63
+ color: _reacttheme.tokens.colorStatusDangerForeground1
64
+ },
65
+ warning: {
66
+ color: _reacttheme.tokens.colorStatusWarningForeground1
67
+ },
68
+ info: {
69
+ color: _reacttheme.tokens.colorNeutralForeground2
70
+ }
71
+ });
72
+ const useIntentIconStylesInverted = (0, _react.makeStyles)({
73
+ success: {
74
+ color: _reacttheme.tokens.colorStatusSuccessForegroundInverted
75
+ },
76
+ error: {
77
+ color: _reacttheme.tokens.colorStatusDangerForegroundInverted
78
+ },
79
+ warning: {
80
+ color: _reacttheme.tokens.colorStatusWarningForegroundInverted
81
+ },
82
+ info: {
83
+ color: _reacttheme.tokens.colorNeutralForegroundInverted2
84
+ }
85
+ });
86
+ const useToastTitleStyles_unstable = (state)=>{
87
+ 'use no memo';
88
+ const rootBaseClassName = useRootBaseClassName();
89
+ const actionBaseClassName = useActionBaseClassName();
90
+ const mediaBaseClassName = useMediaBaseClassName();
91
+ const intentIconStyles = useIntentIconStyles();
92
+ const intentIconStylesInverted = useIntentIconStylesInverted();
93
+ const { intent } = state;
94
+ const invertedStyles = useInvertedStyles();
95
+ state.root.className = (0, _react.mergeClasses)(toastTitleClassNames.root, rootBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.root, state.root.className);
96
+ if (state.media) {
97
+ state.media.className = (0, _react.mergeClasses)(toastTitleClassNames.media, mediaBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.media, intent && intentIconStyles[intent], intent && state.backgroundAppearance === 'inverted' && intentIconStylesInverted[intent], state.media.className);
98
+ }
99
+ if (state.action) {
100
+ state.action.className = (0, _react.mergeClasses)(toastTitleClassNames.action, actionBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.action, state.action.className);
101
+ }
102
+ return state;
103
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ToastTitle/useToastTitleStyles.styles.ts"],"sourcesContent":["import { makeStyles, makeResetStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { ToastTitleSlots, ToastTitleState } from './ToastTitle.types';\n\nexport const toastTitleClassNames: SlotClassNames<ToastTitleSlots> = {\n root: 'fui-ToastTitle',\n media: 'fui-ToastTitle__media',\n action: 'fui-ToastTitle__action',\n};\n\nconst useRootBaseClassName = makeResetStyles({\n display: 'flex',\n gridColumnEnd: 3,\n color: tokens.colorNeutralForeground1,\n wordBreak: 'break-word',\n});\n\nconst useMediaBaseClassName = makeResetStyles({\n display: 'flex',\n paddingTop: '2px',\n gridColumnEnd: 2,\n paddingRight: '8px',\n fontSize: '16px',\n color: tokens.colorNeutralForeground1,\n});\n\nconst useActionBaseClassName = makeResetStyles({\n display: 'flex',\n alignItems: 'start',\n paddingLeft: '12px',\n gridColumnEnd: -1,\n color: tokens.colorBrandForeground1,\n});\n\nconst useInvertedStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForegroundInverted2,\n },\n\n action: {\n color: tokens.colorBrandForegroundInverted,\n },\n\n media: {\n color: tokens.colorNeutralForegroundInverted,\n },\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});\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/**\n * Apply styling to the ToastTitle slots based on the state\n */\nexport const useToastTitleStyles_unstable = (state: ToastTitleState): ToastTitleState => {\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 { intent } = state;\n const invertedStyles = useInvertedStyles();\n state.root.className = mergeClasses(\n toastTitleClassNames.root,\n rootBaseClassName,\n state.backgroundAppearance === 'inverted' && invertedStyles.root,\n state.root.className,\n );\n\n if (state.media) {\n state.media.className = mergeClasses(\n toastTitleClassNames.media,\n mediaBaseClassName,\n state.backgroundAppearance === 'inverted' && invertedStyles.media,\n intent && intentIconStyles[intent],\n intent && state.backgroundAppearance === 'inverted' && intentIconStylesInverted[intent],\n state.media.className,\n );\n }\n\n if (state.action) {\n state.action.className = mergeClasses(\n toastTitleClassNames.action,\n actionBaseClassName,\n state.backgroundAppearance === 'inverted' && invertedStyles.action,\n state.action.className,\n );\n }\n\n return state;\n};\n"],"names":["makeStyles","makeResetStyles","mergeClasses","tokens","toastTitleClassNames","root","media","action","useRootBaseClassName","display","gridColumnEnd","color","colorNeutralForeground1","wordBreak","useMediaBaseClassName","paddingTop","paddingRight","fontSize","useActionBaseClassName","alignItems","paddingLeft","colorBrandForeground1","useInvertedStyles","colorNeutralForegroundInverted2","colorBrandForegroundInverted","colorNeutralForegroundInverted","useIntentIconStyles","success","colorStatusSuccessForeground1","error","colorStatusDangerForeground1","warning","colorStatusWarningForeground1","info","colorNeutralForeground2","useIntentIconStylesInverted","colorStatusSuccessForegroundInverted","colorStatusDangerForegroundInverted","colorStatusWarningForegroundInverted","useToastTitleStyles_unstable","state","rootBaseClassName","actionBaseClassName","mediaBaseClassName","intentIconStyles","intentIconStylesInverted","intent","invertedStyles","className","backgroundAppearance"],"mappings":";;;;;;;;;;;IAKaI,oBAAAA;;;gCA6EAmC;eAAAA;;;uBAlF6C,iBAAiB;4BACpD,wBAAwB;AAIxC,6BAA8D;IACnElC,MAAM;IACNC,OAAO;IACPC,QAAQ;AACV,EAAE;AAEF,MAAMC,2BAAuBP,sBAAAA,EAAgB;IAC3CQ,SAAS;IACTC,eAAe;IACfC,OAAOR,kBAAAA,CAAOS,uBAAuB;IACrCC,WAAW;AACb;AAEA,MAAMC,4BAAwBb,sBAAAA,EAAgB;IAC5CQ,SAAS;IACTM,YAAY;IACZL,eAAe;IACfM,cAAc;IACdC,UAAU;IACVN,OAAOR,kBAAAA,CAAOS,uBAAuB;AACvC;AAEA,MAAMM,6BAAyBjB,sBAAAA,EAAgB;IAC7CQ,SAAS;IACTU,YAAY;IACZC,aAAa;IACbV,eAAe,CAAC;IAChBC,OAAOR,kBAAAA,CAAOkB,qBAAqB;AACrC;AAEA,MAAMC,wBAAoBtB,iBAAAA,EAAW;IACnCK,MAAM;QACJM,OAAOR,kBAAAA,CAAOoB,+BAA+B;IAC/C;IAEAhB,QAAQ;QACNI,OAAOR,kBAAAA,CAAOqB,4BAA4B;IAC5C;IAEAlB,OAAO;QACLK,OAAOR,kBAAAA,CAAOsB,8BAA8B;IAC9C;AACF;AAEA,MAAMC,0BAAsB1B,iBAAAA,EAAW;IACrC2B,SAAS;QACPhB,OAAOR,kBAAAA,CAAOyB,6BAA6B;IAC7C;IACAC,OAAO;QACLlB,OAAOR,kBAAAA,CAAO2B,4BAA4B;IAC5C;IACAC,SAAS;QACPpB,OAAOR,kBAAAA,CAAO6B,6BAA6B;IAC7C;IACAC,MAAM;QACJtB,OA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AE1B;IAEA,OAAOR;AACT,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ToastTrigger/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
+ {"version":3,"sources":["../src/components/ToastTrigger/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":["React","useToastTrigger_unstable","renderToastTrigger_unstable","ToastTrigger","props","state","displayName"],"mappings":";;;;;;;;;;;iEAAuB,QAAQ;iCACU,oBAAoB;oCACjB,uBAAuB;AAM5D,MAAMG,eAA4CC,CAAAA;IACvD,MAAMC,YAAQJ,yCAAAA,EAAyBG;IAEvC,WAAOF,+CAAAA,EAA4BG;AACrC,EAAE;AAEFF,aAAaG,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ToastTrigger/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
+ {"version":3,"sources":["../src/components/ToastTrigger/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":["React"],"mappings":";;;;;iEAEuB,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ToastTrigger/index.ts"],"sourcesContent":["export { ToastTrigger } from './ToastTrigger';\nexport type { ToastTriggerChildProps, ToastTriggerProps, ToastTriggerState } from './ToastTrigger.types';\nexport { renderToastTrigger_unstable } from './renderToastTrigger';\nexport { useToastTrigger_unstable } from './useToastTrigger';\n"],"names":["ToastTrigger","renderToastTrigger_unstable","useToastTrigger_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,YAAY;eAAZA,0BAAY;;IAEZC,2BAA2B;eAA3BA,+CAA2B;;IAC3BC,wBAAwB;eAAxBA,yCAAwB;;;8BAHJ;oCAEe;iCACH"}
1
+ {"version":3,"sources":["../src/components/ToastTrigger/index.ts"],"sourcesContent":["export { ToastTrigger } from './ToastTrigger';\nexport type { ToastTriggerChildProps, ToastTriggerProps, ToastTriggerState } from './ToastTrigger.types';\nexport { renderToastTrigger_unstable } from './renderToastTrigger';\nexport { useToastTrigger_unstable } from './useToastTrigger';\n"],"names":["ToastTrigger","renderToastTrigger_unstable","useToastTrigger_unstable"],"mappings":";;;;;;;;;;;;eAASA,0BAAY;;;eAEZC,+CAA2B;;;eAC3BC,yCAAwB;;;8BAHJ,iBAAiB;oCAEF,uBAAuB;iCAC1B,oBAAoB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ToastTrigger/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
+ {"version":3,"sources":["../src/components/ToastTrigger/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"],"mappings":"AAEA;;;;CAIC,GACD;;;;;;;;;;AAAO,MAAMA,8BAA8B,CAACC,QAA6BA,MAAMC,QAAQ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ToastTrigger/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
+ {"version":3,"sources":["../src/components/ToastTrigger/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":["React","applyTriggerPropsToChildren","getTriggerChild","useEventCallback","useARIAButtonProps","useToastContainerContext","useToastTrigger_unstable","props","children","disableButtonEnhancement","close","child","handleClick","e","onClick","isDefaultPrevented","triggerChildProps","ref","ariaButtonTriggerChildProps","type"],"mappings":";;;;+BAeaM;;;;;;;iEAfU,QAAQ;gCACgD,4BAA4B;2BACxE,uBAAuB;uCAEjB,uCAAuC;AAWzE,iCAAiC,CAACC;IACvC,MAAM,EAAEC,QAAQ,EAAEC,2BAA2B,KAAK,EAAE,GAAGF;IACvD,MAAM,EAAEG,KAAK,EAAE,OAAGL,+CAAAA;IAElB,MAAMM,YAAQT,+BAAAA,EAAgBM;IAE9B,MAAMI,kBAAcT,gCAAAA,EAClB,CAACU;YACCF,sBAAAA;QAAAA,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,wBAAAA,CAAAA,eAAAA,MAAOJ,KAAAA,AAAK,EAACO,OAAAA,AAAO,MAAA,QAApBH,yBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,qBAAAA,IAAAA,CAAAA,cAAuBE;QACvB,IAAI,CAACA,EAAEE,kBAAkB,IAAI;YAC3BL;QACF;IACF;IAGF,MAAMM,oBAAoB;WACrBL,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOJ,KAAV;QACAU,GAAG,EAAEN,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOM,GAAG;QACfH,SAASF;IACX;IAEA,MAAMM,kCAA8Bd,6BAAAA,EAClCO,CAAAA,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOQ,IAAAA,AAAI,MAAK,YAAYR,CAAAA,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOQ,IAAAA,AAAI,MAAK,MAAMR,MAAMQ,IAAI,GAAG,OAC/D;QACE,GAAGH,iBAAiB;QACpBG,MAAM;IACR;IAGF,OAAO;QACLX,cAAUP,2CAAAA,EACRO,UACAC,2BAA2BO,oBAAoBE;IAEnD;AACF,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Toaster/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
+ {"version":3,"sources":["../src/components/Toaster/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":["useCustomStyleHook_unstable","React","useToaster_unstable","renderToaster_unstable","useToasterStyles_unstable","Toaster","props","state","displayName"],"mappings":";;;;+BAWaK;;;;;;;qCAX+B,kCAAkC;iEACvD,QAAQ;4BAEK,eAAe;+BACZ,kBAAkB;wCACf,4BAA4B;AAM/D,gBAAwCC,CAAAA;IAC7C,MAAMC,YAAQL,+BAAAA,EAAoBI;QAElCF,iDAAAA,EAA0BG;QAC1BP,gDAAAA,EAA4B,6BAA6BO;IACzD,WAAOJ,qCAAAA,EAAuBI;AAChC,EAAE;AAEFF,QAAQG,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Toaster/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
+ {"version":3,"sources":["../src/components/Toaster/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":[],"mappings":"AAoCA;;CAEC,GACD,WAOI"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Toaster/index.ts"],"sourcesContent":["export { Toaster } from './Toaster';\nexport type { ToasterProps, ToasterSlots, ToasterSlotsInternal, ToasterState } from './Toaster.types';\nexport { renderToaster_unstable } from './renderToaster';\nexport { useToaster_unstable } from './useToaster';\nexport { toasterClassNames, useToasterStyles_unstable } from './useToasterStyles.styles';\n"],"names":["Toaster","renderToaster_unstable","toasterClassNames","useToasterStyles_unstable","useToaster_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,OAAO;eAAPA,gBAAO;;IAEPC,sBAAsB;eAAtBA,qCAAsB;;IAEtBC,iBAAiB;eAAjBA,yCAAiB;;IAAEC,yBAAyB;eAAzBA,iDAAyB;;IAD5CC,mBAAmB;eAAnBA,+BAAmB;;;yBAHJ;+BAEe;4BACH;wCACyB"}
1
+ {"version":3,"sources":["../src/components/Toaster/index.ts"],"sourcesContent":["export { Toaster } from './Toaster';\nexport type { ToasterProps, ToasterSlots, ToasterSlotsInternal, ToasterState } from './Toaster.types';\nexport { renderToaster_unstable } from './renderToaster';\nexport { useToaster_unstable } from './useToaster';\nexport { toasterClassNames, useToasterStyles_unstable } from './useToasterStyles.styles';\n"],"names":["Toaster","renderToaster_unstable","useToaster_unstable","toasterClassNames","useToasterStyles_unstable"],"mappings":";;;;;;;;;;;;eAASA,gBAAO;;;eAEPC,qCAAsB;;;eAEtBE,yCAAiB;;;eAAEC,iDAAyB;;;eAD5CF,+BAAmB;;;yBAHJ,YAAY;+BAEG,kBAAkB;4BACrB,eAAe;wCACU,4BAA4B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Toaster/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
+ {"version":3,"sources":["../src/components/Toaster/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":["assertSlots","Portal","AriaLive","renderToaster_unstable","state","announceRef","renderAriaLive","inline","mountNode","hasToasts","bottomStart","bottomEnd","topStart","topEnd","top","bottom","ariaLive","positionSlots"],"mappings":";;;;+BAWaG;;;;;;4BAVb,UAAiD;gCAErB,4BAA4B;6BACjC,yBAAyB;0BAEvB,cAAc;AAKhC,+BAA+B,CAACC;IACrC,MAAM,EAAEC,WAAW,EAAEC,cAAc,EAAEC,MAAM,EAAEC,SAAS,EAAE,GAAGJ;IAC3DJ,+BAAAA,EAAkCI;IAElC,MAAMK,YACJ,CAAC,CAACL,MAAMM,WAAW,IAAI,CAAC,CAACN,MAAMO,SAAS,IAAI,CAAC,CAACP,MAAMQ,QAAQ,IAAI,CAAC,CAACR,MAAMS,MAAM,IAAI,CAAC,CAACT,MAAMU,GAAG,IAAI,CAAC,CAACV,MAAMW,MAAM;IAEjH,MAAMC,WAAWV,iBAAAA,WAAAA,OAAiB,eAAA,EAACJ,kBAAAA,EAAAA;QAASG,aAAaA;SAAkB;IAC3E,MAAMY,gBAAAA,WAAAA,OACJ,gBAAA,EAAA,oBAAA,EAAA;;YACGb,MAAMW,MAAM,GAAA,WAAA,GAAG,mBAAA,EAACX,MAAMW,MAAM,EAAA,CAAA,KAAM;YAClCX,MAAMM,WAAW,GAAA,WAAA,OAAG,eAAA,EAACN,MAAMM,WAAW,EAAA,CAAA,KAAM;YAC5CN,MAAMO,SAAS,GAAA,WAAA,OAAG,eAAA,EAACP,MAAMO,SAAS,EAAA,CAAA,KAAM;YACxCP,MAAMQ,QAAQ,GAAA,WAAA,OAAG,eAAA,EAACR,MAAMQ,QAAQ,EAAA,CAAA,KAAM;YACtCR,MAAMS,MAAM,GAAA,WAAA,OAAG,eAAA,EAACT,MAAMS,MAAM,EAAA,CAAA,KAAM;YAClCT,MAAMU,GAAG,GAAA,WAAA,OAAG,eAAA,EAACV,MAAMU,GAAG,EAAA,CAAA,KAAM;;;IAIjC,IAAIP,QAAQ;QACV,OAAA,WAAA,OACE,gBAAA,EAAA,oBAAA,EAAA;;gBACGS;gBACAP,YAAYQ,gBAAgB;;;IAGnC;IAEA,OAAA,WAAA,OACE,gBAAA,EAAA,oBAAA,EAAA;;YACGD;YACAP,YAAAA,WAAAA,OAAY,eAAA,EAACR,mBAAAA,EAAAA;gBAAOO,WAAWA;0BAAYS;iBAA0B;;;AAG5E,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Toaster/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
+ {"version":3,"sources":["../src/components/Toaster/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":["React","isHTMLElement","useToastAnnounce","announce","activeRef","useRef","cleanupRef","undefined","announceToast","useCallback","message","options","current","toasterRef","el","onFocusIn","e","currentTarget","contains","relatedTarget","onFocusOut","addEventListener","removeEventListener"],"mappings":";;;;+BAWgBE;;;;;;;iEAXO,QAAQ;gCAED,4BAA4B;AASnD,0BAA0BC,QAAkB;IACjD,MAAMC,YAAYJ,OAAMK,MAAM,CAAC;IAC/B,MAAMC,aAAaN,OAAMK,MAAM,CAAa,IAAME;IAClD,MAAMC,gBAAgBR,OAAMS,WAAW,CACrC,CAACC,SAASC;QACR,IAAIP,UAAUQ,OAAO,EAAE;YACrBT,SAASO,SAASC;QACpB;IACF,GACA;QAACR;KAAS;IAGZ,MAAMU,aAAab,OAAMS,WAAW,CAAC,CAACK;QACpC,IAAI,CAACA,IAAI;YACPR,WAAWM,OAAO;YAClB;QACF;QAEA,MAAMG,YAAY,CAACC;YACjB,QACEf,6BAAAA,EAAce,EAAEC,aAAa,KAC7BD,EAAEC,aAAa,CAACC,QAAQ,KAACjB,6BAAAA,EAAce,EAAEG,aAAa,IAAIH,EAAEG,aAAa,GAAG,OAC5E;gBACA;YACF;YAEAf,UAAUQ,OAAO,GAAG;QACtB;QAEA,MAAMQ,aAAa,CAACJ;YAClB,QACEf,6BAAAA,EAAce,EAAEC,aAAa,KAC7BD,EAAEC,aAAa,CAACC,QAAQ,KAACjB,6BAAAA,EAAce,EAAEG,aAAa,IAAIH,EAAEG,aAAa,GAAG,OAC5E;gBACA;YACF;YAEAf,UAAUQ,OAAO,GAAG;QACtB;QAEAE,GAAGO,gBAAgB,CAAC,WAAWN;QAC/BD,GAAGO,gBAAgB,CAAC,YAAYD;QAEhCd,WAAWM,OAAO,GAAG;YACnBE,GAAGQ,mBAAmB,CAAC,WAAWP;YAClCD,GAAGQ,mBAAmB,CAAC,YAAYF;QACrC;IACF,GAAG,EAAE;IAEL,OAAO;QACLZ;QACAK;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Toaster/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;8BAC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version":3,"sources":["../src/components/Toaster/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":["React","getIntrinsicElementProps","useEventCallback","useMergedRefs","slot","useFluent_unstable","useFluent","useFocusableGroup","Escape","TOAST_POSITIONS","useToaster","ToastContainer","useToasterFocusManagement_unstable","useToastAnnounce","useToaster_unstable","props","offset","announce","announceProp","mountNode","inline","rest","announceRef","useRef","toastsToRender","isToastVisible","pauseAllToasts","playAllToasts","tryRestoreFocus","closeAllToasts","useCallback","message","options","current","dir","rootProps","always","elementType","focusableGroupAttr","tabBehavior","ignoreDefaultKeydown","onKeyDown","e","key","preventDefault","usePositionSlot","toastPosition","focusManagementRef","announceToast","toasterRef","optional","has","defaultProps","ref","children","get","map","toast","intent","toastId","visible","content","role","components","root","bottomStart","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C,UAAUC,iBAAAA,QAAAA,iBAAAA,KAAAA,IAAAA,eAAgBD;QAC1BsD,gBAAgB,CAACrD;QACjBE;IACF;AACF,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Toaster/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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Y;gBACxD;gBAEA,IAAI,CAACD,oBAAoB;oBACvBvB,qBAAqBkB,WAAW,GAAGpB;oBACnCyB,qBAAqBvB,qBAAqByB,SAAS;gBACrD;gBAEA,IAAInB,IAAAA,6BAAAA,EAAciB,qBAAqB;oBACrCA,mBAAmBF,KAAK;gBAC1B;YACF;QACF;QAEA,MAAMK,kBAAkB,CAACZ;YACvB,IACER,IAAAA,6BAAAA,EAAcQ,EAAEa,aAAa,KAC7B,CAACb,EAAEa,aAAa,CAACnB,QAAQ,CAACF,IAAAA,6BAAAA,EAAcQ,EAAEc,aAAa,IAAId,EAAEc,aAAa,GAAG,OAC7E;gBACAtC;YACF;QACF;QAEA,MAAMuC,mBAAmB,CAACf;YACxB,IACER,IAAAA,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
+ {"version":3,"sources":["../src/components/Toaster/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":["isHTMLElement","React","useFluent_unstable","useFluent","ArrowDown","ArrowUp","toastContainerClassNames","noop","undefined","useToasterFocusManagement_unstable","pauseAllToasts","playAllToasts","targetDocument","cleanupListenersRef","useRef","useCallback","el","current","toastContainerWalker","createTreeWalker","NodeFilter","SHOW_ELEMENT","acceptNode","node","classList","contains","root","FILTER_ACCEPT","FILTER_SKIP","keydownListener","e","target","key","currentNode","nextToastContainer","nextNode","focus","prevToastContainer","previousNode","lastChild","focusInListener","currentTarget","relatedTarget","focusOutListener","addEventListener","removeEventListener"],"mappings":";;;;+BAWgBS;;;;;;;gCAXc,4BAA4B;iEACnC,QAAQ;qCACiB,kCAAkC;8BAC/C,0BAA0B;gCACpB,oBAAoB;AAE7D,MAAMF,OAAO,IAAMC;AAKZ,4CAA4CE,cAA0B,EAAEC,aAAyB;IACtG,MAAM,EAAEC,cAAc,EAAE,OAAGT,uCAAAA;IAC3B,MAAMU,sBAAsBZ,OAAMa,MAAM,CAAaP;IAErD,OAAON,OAAMc,WAAW,CACtB,CAACC;QACC,IAAI,CAACA,MAAM,CAACJ,gBAAgB;YAC1BC,oBAAoBI,OAAO;YAC3BJ,oBAAoBI,OAAO,GAAGV;YAC9B;QACF;QAEA,MAAMW,uBAAuBN,eAAeO,gBAAgB,CAACH,IAAII,WAAWC,YAAY,EAAE;YACxFC,YAAWC,IAAU;gBACnB,QAAIvB,6BAAAA,EAAcuB,SAASA,KAAKC,SAAS,CAACC,QAAQ,CAACnB,wCAAAA,CAAyBoB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a,CAAChB,QAAQ,KAACzB,6BAAAA,EAAc8B,EAAEY,aAAa,IAAIZ,EAAEY,aAAa,GAAG,OAC7E;gBACA/B;YACF;QACF;QAEAK,GAAG4B,gBAAgB,CAAC,WAAWf;QAC/Bb,GAAG4B,gBAAgB,CAAC,WAAWJ;QAC/BxB,GAAG4B,gBAAgB,CAAC,YAAYD;QAEhC9B,oBAAoBI,OAAO,GAAG;YAC5BD,GAAG6B,mBAAmB,CAAC,WAAWhB;YAClCb,GAAG6B,mBAAmB,CAAC,WAAWL;YAClCxB,GAAG6B,mBAAmB,CAAC,YAAYF;QACrC;IACF,GACA;QAAC/B;QAAgBF;QAAgBC;KAAc;AAEnD"}
@@ -1 +1 @@
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEaA,iBAAiB;eAAjBA;;IAiBIC,yBAA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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
+ {"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":["__resetStyles","__styles","mergeClasses","TOAST_POSITIONS","getPositionStyles","toasterClassNames","root","useRootBaseClassName","useToasterStyles","inline","qhf8xq","d","useToasterStyles_unstable","state","rootBaseClassName","styles","className","bottomStart","_state_bottomStart","_style","style","Object","assign","dir","offset","bottomEnd","_state_bottomEnd","_style1","topStart","_state_topStart","_style2","topEnd","_state_topEnd","_style3","top","_state_top","_style4","bottom","_state_bottom","_style5"],"mappings":";;;;;;;;;;;qBAE8B;eAAjBK;;IAiBIO,yBAAyB;;;;uBAnBgB,gBAAgB;uBACvB,mBAAmB;AAC/D,0BAA0B;IAC7BN,IAAI,EAAE;AACV,CAAC;AACD;;CAEA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,CAACU,GAAG,EAAEV,KAAK,CAACW,MAAM,CAAC,CAAC;IACzG;IACA,IAAIX,KAAK,CAACqB,GAAG,EAAE;QACX,IAAIC,UAAU;QACdtB,KAAK,CAACqB,GAAG,CAAClB,SAAS,GAAGA,SAAS;QAC/B,IAAIoB,OAAO;SACVA,OAAO,GAAG,CAACD,UAAU,GAAGtB,KAAK,CAACqB,GAAAA,AAAG,EAAEd,KAAAA,AAAK,MAAM,IAAI,IAAIgB,OAAO,KAAK,KAAK,CAAC,GAAGA,OAAO,GAAGD,UAAU,CAACf,KAAK,GAAG,CAAC,CAAC;QAC3GC,MAAM,CAACC,MAAM,CAACT,KAAK,CAACqB,GAAG,CAACd,KAAK,MAAEhB,wBAAiB,EAACD,sBAAe,CAAC+B,GAAG,EAAErB,KAAK,CAACU,GAAG,EAAEV,KAAK,CAACW,MAAM,CAAC,CAAC;IACnG;IACA,IAAIX,KAAK,CAACwB,MAAM,EAAE;QACd,IAAIC,aAAa;QACjBzB,KAAK,CAACwB,MAAM,CAACrB,SAAS,GAAGA,SAAS;QAClC,IAAIuB,OAAO;SACVA,OAAO,GAAG,CAACD,aAAa,GAAGzB,KAAK,CAACwB,MAAM,AAANA,EAAQjB,KAAAA,AAAK,MAAM,IAAI,IAAImB,OAAO,KAAK,KAAK,CAAC,GAAGA,OAAO,GAAGD,aAAa,CAAClB,KAAK,GAAG,CAAC,CAAC;QACpHC,MAAM,CAACC,MAAM,CAACT,KAAK,CAACwB,MAAM,CAACjB,KAAK,MAAEhB,wBAAiB,EAACD,sBAAe,CAACkC,MAAM,EAAExB,KAAK,CAACU,GAAG,EAAEV,KAAK,CAACW,MAAM,CAAC,CAAC;IACzG;IACA,OAAOX,KAAK;AAChB,CAAC"}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ toasterClassNames: function() {
13
+ return toasterClassNames;
14
+ },
15
+ useToasterStyles_unstable: function() {
16
+ return useToasterStyles_unstable;
17
+ }
18
+ });
19
+ const _react = require("@griffel/react");
20
+ const _index = require("../../state/index");
21
+ const toasterClassNames = {
22
+ root: 'fui-Toaster'
23
+ };
24
+ /**
25
+ * Styles for the root slot
26
+ */ const useRootBaseClassName = (0, _react.makeResetStyles)({
27
+ position: 'fixed',
28
+ width: '292px',
29
+ pointerEvents: 'none'
30
+ });
31
+ const useToasterStyles = (0, _react.makeStyles)({
32
+ inline: {
33
+ position: 'absolute'
34
+ }
35
+ });
36
+ const useToasterStyles_unstable = (state)=>{
37
+ 'use no memo';
38
+ const rootBaseClassName = useRootBaseClassName();
39
+ const styles = useToasterStyles();
40
+ const className = (0, _react.mergeClasses)(toasterClassNames.root, rootBaseClassName, state.inline && styles.inline, state.root.className);
41
+ if (state.bottomStart) {
42
+ var _state_bottomStart;
43
+ state.bottomStart.className = className;
44
+ var _style;
45
+ (_style = (_state_bottomStart = state.bottomStart).style) !== null && _style !== void 0 ? _style : _state_bottomStart.style = {};
46
+ Object.assign(state.bottomStart.style, (0, _index.getPositionStyles)(_index.TOAST_POSITIONS.bottomStart, state.dir, state.offset));
47
+ }
48
+ if (state.bottomEnd) {
49
+ var _state_bottomEnd;
50
+ state.bottomEnd.className = className;
51
+ var _style1;
52
+ (_style1 = (_state_bottomEnd = state.bottomEnd).style) !== null && _style1 !== void 0 ? _style1 : _state_bottomEnd.style = {};
53
+ Object.assign(state.bottomEnd.style, (0, _index.getPositionStyles)(_index.TOAST_POSITIONS.bottomEnd, state.dir, state.offset));
54
+ }
55
+ if (state.topStart) {
56
+ var _state_topStart;
57
+ state.topStart.className = className;
58
+ var _style2;
59
+ (_style2 = (_state_topStart = state.topStart).style) !== null && _style2 !== void 0 ? _style2 : _state_topStart.style = {};
60
+ Object.assign(state.topStart.style, (0, _index.getPositionStyles)(_index.TOAST_POSITIONS.topStart, state.dir, state.offset));
61
+ }
62
+ if (state.topEnd) {
63
+ var _state_topEnd;
64
+ state.topEnd.className = className;
65
+ var _style3;
66
+ (_style3 = (_state_topEnd = state.topEnd).style) !== null && _style3 !== void 0 ? _style3 : _state_topEnd.style = {};
67
+ Object.assign(state.topEnd.style, (0, _index.getPositionStyles)(_index.TOAST_POSITIONS.topEnd, state.dir, state.offset));
68
+ }
69
+ if (state.top) {
70
+ var _state_top;
71
+ state.top.className = className;
72
+ var _style4;
73
+ (_style4 = (_state_top = state.top).style) !== null && _style4 !== void 0 ? _style4 : _state_top.style = {};
74
+ Object.assign(state.top.style, (0, _index.getPositionStyles)(_index.TOAST_POSITIONS.top, state.dir, state.offset));
75
+ }
76
+ if (state.bottom) {
77
+ var _state_bottom;
78
+ state.bottom.className = className;
79
+ var _style5;
80
+ (_style5 = (_state_bottom = state.bottom).style) !== null && _style5 !== void 0 ? _style5 : _state_bottom.style = {};
81
+ Object.assign(state.bottom.style, (0, _index.getPositionStyles)(_index.TOAST_POSITIONS.bottom, state.dir, state.offset));
82
+ }
83
+ return state;
84
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Toaster/useToasterStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { ToasterSlots, ToasterState } from './Toaster.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { TOAST_POSITIONS, getPositionStyles } from '../../state/index';\n\nexport const toasterClassNames: SlotClassNames<ToasterSlots> = {\n root: 'fui-Toaster',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootBaseClassName = makeResetStyles({\n position: 'fixed',\n width: '292px',\n pointerEvents: 'none',\n});\n\nconst useToasterStyles = makeStyles({\n inline: {\n position: 'absolute',\n },\n});\n\n/**\n * Apply styling to the Toaster slots based on the state\n */\nexport const useToasterStyles_unstable = (state: ToasterState): ToasterState => {\n 'use no memo';\n\n const rootBaseClassName = useRootBaseClassName();\n const styles = useToasterStyles();\n const className = mergeClasses(\n toasterClassNames.root,\n rootBaseClassName,\n state.inline && styles.inline,\n state.root.className,\n );\n if (state.bottomStart) {\n state.bottomStart.className = className;\n state.bottomStart.style ??= {};\n Object.assign(state.bottomStart.style, getPositionStyles(TOAST_POSITIONS.bottomStart, state.dir, state.offset));\n }\n\n if (state.bottomEnd) {\n state.bottomEnd.className = className;\n state.bottomEnd.style ??= {};\n Object.assign(state.bottomEnd.style, getPositionStyles(TOAST_POSITIONS.bottomEnd, state.dir, state.offset));\n }\n\n if (state.topStart) {\n state.topStart.className = className;\n state.topStart.style ??= {};\n Object.assign(state.topStart.style, getPositionStyles(TOAST_POSITIONS.topStart, state.dir, state.offset));\n }\n\n if (state.topEnd) {\n state.topEnd.className = className;\n state.topEnd.style ??= {};\n Object.assign(state.topEnd.style, getPositionStyles(TOAST_POSITIONS.topEnd, state.dir, state.offset));\n }\n\n if (state.top) {\n state.top.className = className;\n state.top.style ??= {};\n Object.assign(state.top.style, getPositionStyles(TOAST_POSITIONS.top, state.dir, state.offset));\n }\n\n if (state.bottom) {\n state.bottom.className = className;\n state.bottom.style ??= {};\n Object.assign(state.bottom.style, getPositionStyles(TOAST_POSITIONS.bottom, state.dir, state.offset));\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","TOAST_POSITIONS","getPositionStyles","toasterClassNames","root","useRootBaseClassName","position","width","pointerEvents","useToasterStyles","inline","useToasterStyles_unstable","state","rootBaseClassName","styles","className","bottomStart","style","Object","assign","dir","offset","bottomEnd","topStart","topEnd","top","bottom"],"mappings":";;;;;;;;;;;qBAKaK;eAAAA;;IAsBAQ,yBAAAA;;;;uBA3B6C,iBAAiB;uBAGxB,oBAAoB;AAEhE,0BAAwD;IAC7DP,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,2BAAuBP,sBAAAA,EAAgB;IAC3CQ,UAAU;IACVC,OAAO;IACPC,eAAe;AACjB;AAEA,MAAMC,uBAAmBV,iBAA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,MAAM;IACrG;IAEA,OAAOT;AACT,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/contexts/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"}
1
+ {"version":3,"sources":["../src/contexts/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":["React","toastContainerContextDefaultValue","close","intent","undefined","bodyId","titleId","ToastContainerContext","createContext","ToastContainerContextProvider","Provider","useToastContainerContext","useContext"],"mappings":";;;;;;;;;;;iCAmBaS;;;4BACAE;;;;;iEApBU,QAAQ;AAU/B,MAAMV,oCAAgE;IACpEC,OAAO,IAAM;IACbC,QAAQC;IACRC,QAAQ;IACRC,SAAS;AACX;AAEA,MAAMC,wBAAAA,WAAAA,GAAwBP,OAAMQ,aAAa,CAAyCJ;AAEnF,MAAMK,gCAAgCF,sBAAsBG,QAAQ,CAAC;AACrE,MAAMC,2BAA2B;QACtCX;WAAAA,CAAAA,oBAAAA,OAAMY,UAAU,CAACL,sBAAAA,MAAAA,QAAjBP,sBAAAA,KAAAA,IAAAA,oBAA2CC;EAAkC"}