@fluentui/react-toast 9.1.0 → 9.1.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 (82) hide show
  1. package/CHANGELOG.json +58 -1
  2. package/CHANGELOG.md +18 -2
  3. package/lib/components/AriaLive/renderAriaLive.js +3 -3
  4. package/lib/components/AriaLive/renderAriaLive.js.map +1 -1
  5. package/lib/components/AriaLive/useAriaLive.js +7 -7
  6. package/lib/components/AriaLive/useAriaLive.js.map +1 -1
  7. package/lib/components/Timer/useTimerStyles.styles.js +1 -1
  8. package/lib/components/Timer/useTimerStyles.styles.js.map +1 -1
  9. package/lib/components/Toast/renderToast.js +3 -3
  10. package/lib/components/Toast/renderToast.js.map +1 -1
  11. package/lib/components/Toast/useToast.js +4 -2
  12. package/lib/components/Toast/useToast.js.map +1 -1
  13. package/lib/components/Toast/useToastStyles.styles.js +1 -1
  14. package/lib/components/Toast/useToastStyles.styles.js.map +1 -1
  15. package/lib/components/ToastBody/renderToastBody.js +3 -3
  16. package/lib/components/ToastBody/renderToastBody.js.map +1 -1
  17. package/lib/components/ToastBody/useToastBody.js +7 -3
  18. package/lib/components/ToastBody/useToastBody.js.map +1 -1
  19. package/lib/components/ToastBody/useToastBodyStyles.styles.js +2 -2
  20. package/lib/components/ToastBody/useToastBodyStyles.styles.js.map +1 -1
  21. package/lib/components/ToastContainer/renderToastContainer.js +3 -3
  22. package/lib/components/ToastContainer/renderToastContainer.js.map +1 -1
  23. package/lib/components/ToastContainer/useToastContainer.js +6 -4
  24. package/lib/components/ToastContainer/useToastContainer.js.map +1 -1
  25. package/lib/components/ToastContainer/useToastContainerStyles.styles.js +2 -2
  26. package/lib/components/ToastFooter/renderToastFooter.js +3 -3
  27. package/lib/components/ToastFooter/renderToastFooter.js.map +1 -1
  28. package/lib/components/ToastFooter/useToastFooter.js +4 -2
  29. package/lib/components/ToastFooter/useToastFooter.js.map +1 -1
  30. package/lib/components/ToastFooter/useToastFooterStyles.styles.js +1 -1
  31. package/lib/components/ToastFooter/useToastFooterStyles.styles.js.map +1 -1
  32. package/lib/components/ToastTitle/renderToastTitle.js +3 -3
  33. package/lib/components/ToastTitle/renderToastTitle.js.map +1 -1
  34. package/lib/components/ToastTitle/useToastTitle.js +11 -6
  35. package/lib/components/ToastTitle/useToastTitle.js.map +1 -1
  36. package/lib/components/ToastTitle/useToastTitleStyles.styles.js +3 -3
  37. package/lib/components/ToastTitle/useToastTitleStyles.styles.js.map +1 -1
  38. package/lib/components/Toaster/renderToaster.js +4 -4
  39. package/lib/components/Toaster/renderToaster.js.map +1 -1
  40. package/lib/components/Toaster/useToaster.js +9 -6
  41. package/lib/components/Toaster/useToaster.js.map +1 -1
  42. package/lib-commonjs/components/AriaLive/renderAriaLive.js +2 -2
  43. package/lib-commonjs/components/AriaLive/renderAriaLive.js.map +1 -1
  44. package/lib-commonjs/components/AriaLive/useAriaLive.js +6 -6
  45. package/lib-commonjs/components/AriaLive/useAriaLive.js.map +1 -1
  46. package/lib-commonjs/components/Timer/useTimerStyles.styles.js +3 -5
  47. package/lib-commonjs/components/Timer/useTimerStyles.styles.js.map +1 -1
  48. package/lib-commonjs/components/Toast/renderToast.js +2 -2
  49. package/lib-commonjs/components/Toast/renderToast.js.map +1 -1
  50. package/lib-commonjs/components/Toast/useToast.js +3 -1
  51. package/lib-commonjs/components/Toast/useToast.js.map +1 -1
  52. package/lib-commonjs/components/Toast/useToastStyles.styles.js +2 -2
  53. package/lib-commonjs/components/Toast/useToastStyles.styles.js.map +1 -1
  54. package/lib-commonjs/components/ToastBody/renderToastBody.js +2 -2
  55. package/lib-commonjs/components/ToastBody/renderToastBody.js.map +1 -1
  56. package/lib-commonjs/components/ToastBody/useToastBody.js +6 -2
  57. package/lib-commonjs/components/ToastBody/useToastBody.js.map +1 -1
  58. package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.js +2 -2
  59. package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.js.map +1 -1
  60. package/lib-commonjs/components/ToastContainer/renderToastContainer.js +2 -2
  61. package/lib-commonjs/components/ToastContainer/renderToastContainer.js.map +1 -1
  62. package/lib-commonjs/components/ToastContainer/useToastContainer.js +5 -3
  63. package/lib-commonjs/components/ToastContainer/useToastContainer.js.map +1 -1
  64. package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.js +6 -10
  65. package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.js.map +1 -1
  66. package/lib-commonjs/components/ToastFooter/renderToastFooter.js +2 -2
  67. package/lib-commonjs/components/ToastFooter/renderToastFooter.js.map +1 -1
  68. package/lib-commonjs/components/ToastFooter/useToastFooter.js +3 -1
  69. package/lib-commonjs/components/ToastFooter/useToastFooter.js.map +1 -1
  70. package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.js +1 -1
  71. package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.js.map +1 -1
  72. package/lib-commonjs/components/ToastTitle/renderToastTitle.js +2 -2
  73. package/lib-commonjs/components/ToastTitle/renderToastTitle.js.map +1 -1
  74. package/lib-commonjs/components/ToastTitle/useToastTitle.js +10 -5
  75. package/lib-commonjs/components/ToastTitle/useToastTitle.js.map +1 -1
  76. package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.js +5 -5
  77. package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.js.map +1 -1
  78. package/lib-commonjs/components/Toaster/renderToaster.js +3 -3
  79. package/lib-commonjs/components/Toaster/renderToaster.js.map +1 -1
  80. package/lib-commonjs/components/Toaster/useToaster.js +8 -5
  81. package/lib-commonjs/components/Toaster/useToaster.js.map +1 -1
  82. package/package.json +8 -8
@@ -12,7 +12,7 @@ const _reactTransitionGroup = require("react-transition-group");
12
12
  const _toastContainerContext = require("../../contexts/toastContainerContext");
13
13
  const renderToastContainer_unstable = (state, contextValues)=>{
14
14
  const { onTransitionEntering , visible , transitionTimeout , remove , nodeRef } = state;
15
- const { slots , slotProps } = (0, _reactUtilities.getSlotsNext)(state);
15
+ (0, _reactUtilities.assertSlots)(state);
16
16
  return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(_reactTransitionGroup.Transition, {
17
17
  in: visible,
18
18
  appear: true,
@@ -23,5 +23,5 @@ const renderToastContainer_unstable = (state, contextValues)=>{
23
23
  nodeRef: nodeRef
24
24
  }, /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(_toastContainerContext.ToastContainerContextProvider, {
25
25
  value: contextValues.toast
26
- }, /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.root, slotProps.root), /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.timer, slotProps.timer)));
26
+ }, /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(state.root, null), /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(state.timer, null)));
27
27
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["renderToastContainer.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\nimport { Transition } from 'react-transition-group';\nimport { ToastContainerContextProvider } from '../../contexts/toastContainerContext';\n/**\n * Render the final JSX of ToastContainer\n */ export const renderToastContainer_unstable = (state, contextValues)=>{\n const { onTransitionEntering , visible , transitionTimeout , remove , nodeRef } = state;\n const { slots , slotProps } = getSlotsNext(state);\n return /*#__PURE__*/ createElement(Transition, {\n in: visible,\n appear: true,\n unmountOnExit: true,\n timeout: transitionTimeout,\n onExited: remove,\n onEntering: onTransitionEntering,\n nodeRef: nodeRef\n }, /*#__PURE__*/ createElement(ToastContainerContextProvider, {\n value: contextValues.toast\n }, /*#__PURE__*/ createElement(slots.root, slotProps.root), /*#__PURE__*/ createElement(slots.timer, slotProps.timer)));\n};\n"],"names":["renderToastContainer_unstable","state","contextValues","onTransitionEntering","visible","transitionTimeout","remove","nodeRef","slots","slotProps","getSlotsNext","createElement","Transition","in","appear","unmountOnExit","timeout","onExited","onEntering","ToastContainerContextProvider","value","toast","root","timer"],"mappings":"AAAA,wBAAwB,GAAG,uBAAuB;;;;+BAMjCA;;aAAAA;;iCANkE;gCACtD;sCACF;uCACmB;AAGnC,MAAMA,gCAAgC,CAACC,OAAOC,gBAAgB;IACrE,MAAM,EAAEC,qBAAoB,EAAGC,QAAO,EAAGC,kBAAiB,EAAGC,OAAM,EAAGC,QAAO,EAAG,GAAGN;IACnF,MAAM,EAAEO,MAAK,EAAGC,UAAS,EAAG,GAAGC,IAAAA,4BAAY,EAACT;IAC5C,OAAO,WAAW,GAAGU,IAAAA,8BAAa,EAACC,gCAAU,EAAE;QAC3CC,IAAIT;QACJU,QAAQ,IAAI;QACZC,eAAe,IAAI;QACnBC,SAASX;QACTY,UAAUX;QACVY,YAAYf;QACZI,SAASA;IACb,GAAG,WAAW,GAAGI,IAAAA,8BAAa,EAACQ,oDAA6B,EAAE;QAC1DC,OAAOlB,cAAcmB,KAAK;IAC9B,GAAG,WAAW,GAAGV,IAAAA,8BAAa,EAACH,MAAMc,IAAI,EAAEb,UAAUa,IAAI,GAAG,WAAW,GAAGX,IAAAA,8BAAa,EAACH,MAAMe,KAAK,EAAEd,UAAUc,KAAK;AACxH"}
1
+ {"version":3,"sources":["renderToastContainer.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { Transition } from 'react-transition-group';\nimport { ToastContainerContextProvider } from '../../contexts/toastContainerContext';\n/**\n * Render the final JSX of ToastContainer\n */ export const renderToastContainer_unstable = (state, contextValues)=>{\n const { onTransitionEntering , visible , transitionTimeout , remove , nodeRef } = state;\n assertSlots(state);\n return /*#__PURE__*/ createElement(Transition, {\n in: visible,\n appear: true,\n unmountOnExit: true,\n timeout: transitionTimeout,\n onExited: remove,\n onEntering: onTransitionEntering,\n nodeRef: nodeRef\n }, /*#__PURE__*/ createElement(ToastContainerContextProvider, {\n value: contextValues.toast\n }, /*#__PURE__*/ createElement(state.root, null), /*#__PURE__*/ createElement(state.timer, null)));\n};\n"],"names":["renderToastContainer_unstable","state","contextValues","onTransitionEntering","visible","transitionTimeout","remove","nodeRef","assertSlots","createElement","Transition","in","appear","unmountOnExit","timeout","onExited","onEntering","ToastContainerContextProvider","value","toast","root","timer"],"mappings":"AAAA,wBAAwB,GAAG,uBAAuB;;;;+BAMjCA;;aAAAA;;iCANkE;gCACvD;sCACD;uCACmB;AAGnC,MAAMA,gCAAgC,CAACC,OAAOC,gBAAgB;IACrE,MAAM,EAAEC,qBAAoB,EAAGC,QAAO,EAAGC,kBAAiB,EAAGC,OAAM,EAAGC,QAAO,EAAG,GAAGN;IACnFO,IAAAA,2BAAW,EAACP;IACZ,OAAO,WAAW,GAAGQ,IAAAA,8BAAa,EAACC,gCAAU,EAAE;QAC3CC,IAAIP;QACJQ,QAAQ,IAAI;QACZC,eAAe,IAAI;QACnBC,SAAST;QACTU,UAAUT;QACVU,YAAYb;QACZI,SAASA;IACb,GAAG,WAAW,GAAGE,IAAAA,8BAAa,EAACQ,oDAA6B,EAAE;QAC1DC,OAAOhB,cAAciB,KAAK;IAC9B,GAAG,WAAW,GAAGV,IAAAA,8BAAa,EAACR,MAAMmB,IAAI,EAAE,IAAI,GAAG,WAAW,GAAGX,IAAAA,8BAAa,EAACR,MAAMoB,KAAK,EAAE,IAAI;AACnG"}
@@ -199,15 +199,15 @@ const useToastContainer_unstable = (props, ref)=>{
199
199
  timer: _timer.Timer,
200
200
  root: 'div'
201
201
  },
202
- timer: (0, _reactUtilities.resolveShorthand)({
202
+ timer: _reactUtilities.slot.always({
203
203
  key: updateId,
204
204
  onTimeout: close,
205
205
  running,
206
206
  timeout: timerTimeout !== null && timerTimeout !== void 0 ? timerTimeout : -1
207
207
  }, {
208
- required: true
208
+ elementType: _timer.Timer
209
209
  }),
210
- root: (0, _reactUtilities.getNativeElementProps)('div', {
210
+ root: _reactUtilities.slot.always((0, _reactUtilities.getNativeElementProps)('div', {
211
211
  ref: (0, _reactUtilities.useMergedRefs)(ref, toastRef, toastAnimationRef),
212
212
  children,
213
213
  tabIndex: 0,
@@ -220,6 +220,8 @@ const useToastContainer_unstable = (props, ref)=>{
220
220
  onMouseEnter,
221
221
  onMouseLeave,
222
222
  onKeyDown
223
+ }), {
224
+ elementType: 'div'
223
225
  }),
224
226
  timerTimeout,
225
227
  transitionTimeout: 500,
@@ -1 +1 @@
1
- {"version":3,"sources":["useToastContainer.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useMergedRefs, useEventCallback, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport { Delete, Tab } from '@fluentui/keyboard-keys';\nimport { useFocusableGroup, useFocusFinders } from '@fluentui/react-tabster';\nimport { Timer } from '../Timer/Timer';\nconst intentPolitenessMap = {\n success: 'assertive',\n warning: 'assertive',\n error: 'assertive',\n info: 'polite'\n};\n/**\n * Create the state required to render ToastContainer.\n *\n * The returned state can be modified with hooks such as useToastContainerStyles_unstable,\n * before being passed to renderToastContainer_unstable.\n *\n * @param props - props from this instance of ToastContainer\n * @param ref - reference to root HTMLElement of ToastContainer\n */ export const useToastContainer_unstable = (props, ref)=>{\n const { visible , children , close: closeProp , remove , updateId , announce , data , timeout: timerTimeout , politeness: desiredPoliteness , intent ='info' , pauseOnHover , pauseOnWindowBlur , imperativeRef , tryRestoreFocus , ...rest } = props;\n const titleId = useId('toast-title');\n const bodyId = useId('toast-body');\n const toastRef = React.useRef(null);\n const { targetDocument } = useFluent_unstable();\n const [running, setRunning] = React.useState(false);\n const imperativePauseRef = React.useRef(false);\n const focusedToastBeforeClose = React.useRef(false);\n const focusableGroupAttribute = useFocusableGroup({\n tabBehavior: 'limited-trap-focus',\n // Users should only use Tab to focus into the toast\n // Escape is already reserved to dismiss all toasts\n ignoreDefaultKeydown: {\n Tab: true,\n Escape: true,\n Enter: true\n }\n });\n const close = useEventCallback(()=>{\n var _toastRef_current;\n const activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;\n if (activeElement && ((_toastRef_current = toastRef.current) === null || _toastRef_current === void 0 ? void 0 : _toastRef_current.contains(activeElement))) {\n focusedToastBeforeClose.current = true;\n }\n closeProp();\n });\n const onStatusChange = useEventCallback((status)=>{\n var _props_onStatusChange;\n return (_props_onStatusChange = props.onStatusChange) === null || _props_onStatusChange === void 0 ? void 0 : _props_onStatusChange.call(props, null, {\n status,\n ...props\n });\n });\n const pause = useEventCallback(()=>setRunning(false));\n const play = useEventCallback(()=>{\n var _toastRef_current;\n if (imperativePauseRef.current) {\n return;\n }\n var _targetDocument_activeElement;\n const containsActive = !!((_toastRef_current = toastRef.current) === null || _toastRef_current === void 0 ? void 0 : _toastRef_current.contains((_targetDocument_activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement) !== null && _targetDocument_activeElement !== void 0 ? _targetDocument_activeElement : null));\n if (timerTimeout < 0) {\n setRunning(true);\n return;\n }\n if (!containsActive) {\n setRunning(true);\n }\n });\n React.useImperativeHandle(imperativeRef, ()=>({\n focus: ()=>{\n if (!toastRef.current) {\n return;\n }\n toastRef.current.focus();\n },\n play: ()=>{\n imperativePauseRef.current = false;\n play();\n },\n pause: ()=>{\n imperativePauseRef.current = true;\n pause();\n }\n }));\n React.useEffect(()=>{\n return ()=>onStatusChange('unmounted');\n }, [\n onStatusChange\n ]);\n React.useEffect(()=>{\n if (!targetDocument) {\n return;\n }\n if (pauseOnWindowBlur) {\n var _targetDocument_defaultView, _targetDocument_defaultView1;\n (_targetDocument_defaultView = targetDocument.defaultView) === null || _targetDocument_defaultView === void 0 ? void 0 : _targetDocument_defaultView.addEventListener('focus', play);\n (_targetDocument_defaultView1 = targetDocument.defaultView) === null || _targetDocument_defaultView1 === void 0 ? void 0 : _targetDocument_defaultView1.addEventListener('blur', pause);\n return ()=>{\n var _targetDocument_defaultView, _targetDocument_defaultView1;\n (_targetDocument_defaultView = targetDocument.defaultView) === null || _targetDocument_defaultView === void 0 ? void 0 : _targetDocument_defaultView.removeEventListener('focus', play);\n (_targetDocument_defaultView1 = targetDocument.defaultView) === null || _targetDocument_defaultView1 === void 0 ? void 0 : _targetDocument_defaultView1.removeEventListener('blur', pause);\n };\n }\n }, [\n targetDocument,\n pause,\n play,\n pauseOnWindowBlur\n ]);\n // It's impossible to animate to height: auto in CSS, the actual pixel value must be known\n // Get the height of the toast before animation styles have been applied and set a CSS\n // variable with its height. The CSS variable will be used by the styles\n const onTransitionEntering = ()=>{\n if (!toastRef.current) {\n return;\n }\n const element = toastRef.current;\n element.style.setProperty('--fui-toast-height', `${element.scrollHeight}px`);\n };\n // Users never actually use ToastContainer as a JSX but imperatively through useToastContainerController\n const userRootSlot = data.root;\n // Using a ref callback here because addEventListener supports `once`\n const toastAnimationRef = React.useCallback((el)=>{\n if (el && toastRef.current) {\n toastRef.current.addEventListener('animationend', ()=>{\n // start toast once it's fully animated in\n play();\n onStatusChange('visible');\n }, {\n once: true\n });\n }\n }, [\n play,\n onStatusChange\n ]);\n const onMouseEnter = useEventCallback((e)=>{\n var _userRootSlot_onMouseEnter;\n pause();\n userRootSlot === null || userRootSlot === void 0 ? void 0 : (_userRootSlot_onMouseEnter = userRootSlot.onMouseEnter) === null || _userRootSlot_onMouseEnter === void 0 ? void 0 : _userRootSlot_onMouseEnter.call(userRootSlot, e);\n });\n const onMouseLeave = useEventCallback((e)=>{\n var _userRootSlot_onMouseEnter;\n play();\n userRootSlot === null || userRootSlot === void 0 ? void 0 : (_userRootSlot_onMouseEnter = userRootSlot.onMouseEnter) === null || _userRootSlot_onMouseEnter === void 0 ? void 0 : _userRootSlot_onMouseEnter.call(userRootSlot, e);\n });\n const { findFirstFocusable , findLastFocusable } = useFocusFinders();\n const onKeyDown = useEventCallback((e)=>{\n var _userRootSlot_onKeyDown;\n if (e.key === Delete) {\n e.preventDefault();\n close();\n }\n if (e.key === Tab && e.currentTarget === e.target) {\n e.preventDefault();\n if (e.shiftKey) {\n var _findLastFocusable;\n (_findLastFocusable = findLastFocusable(e.currentTarget)) === null || _findLastFocusable === void 0 ? void 0 : _findLastFocusable.focus();\n } else {\n var _findFirstFocusable;\n (_findFirstFocusable = findFirstFocusable(e.currentTarget)) === null || _findFirstFocusable === void 0 ? void 0 : _findFirstFocusable.focus();\n }\n }\n userRootSlot === null || userRootSlot === void 0 ? void 0 : (_userRootSlot_onKeyDown = userRootSlot.onKeyDown) === null || _userRootSlot_onKeyDown === void 0 ? void 0 : _userRootSlot_onKeyDown.call(userRootSlot, e);\n });\n React.useEffect(()=>{\n var _toastRef_current;\n if (!visible) {\n return;\n }\n const politeness = desiredPoliteness !== null && desiredPoliteness !== void 0 ? desiredPoliteness : intentPolitenessMap[intent];\n var _toastRef_current_textContent;\n announce((_toastRef_current_textContent = (_toastRef_current = toastRef.current) === null || _toastRef_current === void 0 ? void 0 : _toastRef_current.textContent) !== null && _toastRef_current_textContent !== void 0 ? _toastRef_current_textContent : '', {\n politeness\n });\n }, [\n announce,\n desiredPoliteness,\n toastRef,\n visible,\n updateId,\n intent\n ]);\n React.useEffect(()=>{\n return ()=>{\n if (focusedToastBeforeClose.current) {\n focusedToastBeforeClose.current = false;\n tryRestoreFocus();\n }\n };\n }, [\n tryRestoreFocus\n ]);\n return {\n components: {\n timer: Timer,\n root: 'div'\n },\n timer: resolveShorthand({\n key: updateId,\n onTimeout: close,\n running,\n timeout: timerTimeout !== null && timerTimeout !== void 0 ? timerTimeout : -1\n }, {\n required: true\n }),\n root: getNativeElementProps('div', {\n ref: useMergedRefs(ref, toastRef, toastAnimationRef),\n children,\n tabIndex: 0,\n role: 'listitem',\n 'aria-labelledby': titleId,\n 'aria-describedby': bodyId,\n ...rest,\n ...userRootSlot,\n ...focusableGroupAttribute,\n onMouseEnter,\n onMouseLeave,\n onKeyDown\n }),\n timerTimeout,\n transitionTimeout: 500,\n running,\n visible,\n remove,\n close,\n onTransitionEntering,\n updateId,\n nodeRef: toastRef,\n intent,\n titleId,\n bodyId\n };\n};\n"],"names":["useToastContainer_unstable","intentPolitenessMap","success","warning","error","info","props","ref","visible","children","close","closeProp","remove","updateId","announce","data","timeout","timerTimeout","politeness","desiredPoliteness","intent","pauseOnHover","pauseOnWindowBlur","imperativeRef","tryRestoreFocus","rest","titleId","useId","bodyId","toastRef","React","useRef","targetDocument","useFluent_unstable","running","setRunning","useState","imperativePauseRef","focusedToastBeforeClose","focusableGroupAttribute","useFocusableGroup","tabBehavior","ignoreDefaultKeydown","Tab","Escape","Enter","useEventCallback","_toastRef_current","activeElement","current","contains","onStatusChange","status","_props_onStatusChange","call","pause","play","_targetDocument_activeElement","containsActive","useImperativeHandle","focus","useEffect","_targetDocument_defaultView","_targetDocument_defaultView1","defaultView","addEventListener","removeEventListener","onTransitionEntering","element","style","setProperty","scrollHeight","userRootSlot","root","toastAnimationRef","useCallback","el","once","onMouseEnter","e","_userRootSlot_onMouseEnter","onMouseLeave","findFirstFocusable","findLastFocusable","useFocusFinders","onKeyDown","_userRootSlot_onKeyDown","key","Delete","preventDefault","currentTarget","target","shiftKey","_findLastFocusable","_findFirstFocusable","_toastRef_current_textContent","textContent","components","timer","Timer","resolveShorthand","onTimeout","required","getNativeElementProps","useMergedRefs","tabIndex","role","transitionTimeout","nodeRef"],"mappings":";;;;+BAoBiBA;;aAAAA;;;6DApBM;gCACyE;qCAC7D;8BACP;8BACuB;uBAC7B;AACtB,MAAMC,sBAAsB;IACxBC,SAAS;IACTC,SAAS;IACTC,OAAO;IACPC,MAAM;AACV;AASW,MAAML,6BAA6B,CAACM,OAAOC,MAAM;IACxD,MAAM,EAAEC,QAAO,EAAGC,SAAQ,EAAGC,OAAOC,UAAS,EAAGC,OAAM,EAAGC,SAAQ,EAAGC,SAAQ,EAAGC,KAAI,EAAGC,SAASC,aAAY,EAAGC,YAAYC,kBAAiB,EAAGC,QAAQ,OAAM,EAAGC,aAAY,EAAGC,kBAAiB,EAAGC,cAAa,EAAGC,gBAAe,EAAG,GAAGC,MAAM,GAAGnB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uB;YAC1BuC;YACAG;YACAI;QACJ;QACApE;QACA0F,mBAAmB;QACnBzE;QACA1B;QACAI;QACAF;QACAyD;QACAtD;QACA+F,SAAS/E;QACTT;QACAM;QACAE;IACJ;AACJ"}
1
+ {"version":3,"sources":["useToastContainer.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useMergedRefs, useEventCallback, useId, slot } from '@fluentui/react-utilities';\nimport { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport { Delete, Tab } from '@fluentui/keyboard-keys';\nimport { useFocusableGroup, useFocusFinders } from '@fluentui/react-tabster';\nimport { Timer } from '../Timer/Timer';\nconst intentPolitenessMap = {\n success: 'assertive',\n warning: 'assertive',\n error: 'assertive',\n info: 'polite'\n};\n/**\n * Create the state required to render ToastContainer.\n *\n * The returned state can be modified with hooks such as useToastContainerStyles_unstable,\n * before being passed to renderToastContainer_unstable.\n *\n * @param props - props from this instance of ToastContainer\n * @param ref - reference to root HTMLElement of ToastContainer\n */ export const useToastContainer_unstable = (props, ref)=>{\n const { visible , children , close: closeProp , remove , updateId , announce , data , timeout: timerTimeout , politeness: desiredPoliteness , intent ='info' , pauseOnHover , pauseOnWindowBlur , imperativeRef , tryRestoreFocus , ...rest } = props;\n const titleId = useId('toast-title');\n const bodyId = useId('toast-body');\n const toastRef = React.useRef(null);\n const { targetDocument } = useFluent_unstable();\n const [running, setRunning] = React.useState(false);\n const imperativePauseRef = React.useRef(false);\n const focusedToastBeforeClose = React.useRef(false);\n const focusableGroupAttribute = useFocusableGroup({\n tabBehavior: 'limited-trap-focus',\n // Users should only use Tab to focus into the toast\n // Escape is already reserved to dismiss all toasts\n ignoreDefaultKeydown: {\n Tab: true,\n Escape: true,\n Enter: true\n }\n });\n const close = useEventCallback(()=>{\n var _toastRef_current;\n const activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;\n if (activeElement && ((_toastRef_current = toastRef.current) === null || _toastRef_current === void 0 ? void 0 : _toastRef_current.contains(activeElement))) {\n focusedToastBeforeClose.current = true;\n }\n closeProp();\n });\n const onStatusChange = useEventCallback((status)=>{\n var _props_onStatusChange;\n return (_props_onStatusChange = props.onStatusChange) === null || _props_onStatusChange === void 0 ? void 0 : _props_onStatusChange.call(props, null, {\n status,\n ...props\n });\n });\n const pause = useEventCallback(()=>setRunning(false));\n const play = useEventCallback(()=>{\n var _toastRef_current;\n if (imperativePauseRef.current) {\n return;\n }\n var _targetDocument_activeElement;\n const containsActive = !!((_toastRef_current = toastRef.current) === null || _toastRef_current === void 0 ? void 0 : _toastRef_current.contains((_targetDocument_activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement) !== null && _targetDocument_activeElement !== void 0 ? _targetDocument_activeElement : null));\n if (timerTimeout < 0) {\n setRunning(true);\n return;\n }\n if (!containsActive) {\n setRunning(true);\n }\n });\n React.useImperativeHandle(imperativeRef, ()=>({\n focus: ()=>{\n if (!toastRef.current) {\n return;\n }\n toastRef.current.focus();\n },\n play: ()=>{\n imperativePauseRef.current = false;\n play();\n },\n pause: ()=>{\n imperativePauseRef.current = true;\n pause();\n }\n }));\n React.useEffect(()=>{\n return ()=>onStatusChange('unmounted');\n }, [\n onStatusChange\n ]);\n React.useEffect(()=>{\n if (!targetDocument) {\n return;\n }\n if (pauseOnWindowBlur) {\n var _targetDocument_defaultView, _targetDocument_defaultView1;\n (_targetDocument_defaultView = targetDocument.defaultView) === null || _targetDocument_defaultView === void 0 ? void 0 : _targetDocument_defaultView.addEventListener('focus', play);\n (_targetDocument_defaultView1 = targetDocument.defaultView) === null || _targetDocument_defaultView1 === void 0 ? void 0 : _targetDocument_defaultView1.addEventListener('blur', pause);\n return ()=>{\n var _targetDocument_defaultView, _targetDocument_defaultView1;\n (_targetDocument_defaultView = targetDocument.defaultView) === null || _targetDocument_defaultView === void 0 ? void 0 : _targetDocument_defaultView.removeEventListener('focus', play);\n (_targetDocument_defaultView1 = targetDocument.defaultView) === null || _targetDocument_defaultView1 === void 0 ? void 0 : _targetDocument_defaultView1.removeEventListener('blur', pause);\n };\n }\n }, [\n targetDocument,\n pause,\n play,\n pauseOnWindowBlur\n ]);\n // It's impossible to animate to height: auto in CSS, the actual pixel value must be known\n // Get the height of the toast before animation styles have been applied and set a CSS\n // variable with its height. The CSS variable will be used by the styles\n const onTransitionEntering = ()=>{\n if (!toastRef.current) {\n return;\n }\n const element = toastRef.current;\n element.style.setProperty('--fui-toast-height', `${element.scrollHeight}px`);\n };\n // Users never actually use ToastContainer as a JSX but imperatively through useToastContainerController\n const userRootSlot = data.root;\n // Using a ref callback here because addEventListener supports `once`\n const toastAnimationRef = React.useCallback((el)=>{\n if (el && toastRef.current) {\n toastRef.current.addEventListener('animationend', ()=>{\n // start toast once it's fully animated in\n play();\n onStatusChange('visible');\n }, {\n once: true\n });\n }\n }, [\n play,\n onStatusChange\n ]);\n const onMouseEnter = useEventCallback((e)=>{\n var _userRootSlot_onMouseEnter;\n pause();\n userRootSlot === null || userRootSlot === void 0 ? void 0 : (_userRootSlot_onMouseEnter = userRootSlot.onMouseEnter) === null || _userRootSlot_onMouseEnter === void 0 ? void 0 : _userRootSlot_onMouseEnter.call(userRootSlot, e);\n });\n const onMouseLeave = useEventCallback((e)=>{\n var _userRootSlot_onMouseEnter;\n play();\n userRootSlot === null || userRootSlot === void 0 ? void 0 : (_userRootSlot_onMouseEnter = userRootSlot.onMouseEnter) === null || _userRootSlot_onMouseEnter === void 0 ? void 0 : _userRootSlot_onMouseEnter.call(userRootSlot, e);\n });\n const { findFirstFocusable , findLastFocusable } = useFocusFinders();\n const onKeyDown = useEventCallback((e)=>{\n var _userRootSlot_onKeyDown;\n if (e.key === Delete) {\n e.preventDefault();\n close();\n }\n if (e.key === Tab && e.currentTarget === e.target) {\n e.preventDefault();\n if (e.shiftKey) {\n var _findLastFocusable;\n (_findLastFocusable = findLastFocusable(e.currentTarget)) === null || _findLastFocusable === void 0 ? void 0 : _findLastFocusable.focus();\n } else {\n var _findFirstFocusable;\n (_findFirstFocusable = findFirstFocusable(e.currentTarget)) === null || _findFirstFocusable === void 0 ? void 0 : _findFirstFocusable.focus();\n }\n }\n userRootSlot === null || userRootSlot === void 0 ? void 0 : (_userRootSlot_onKeyDown = userRootSlot.onKeyDown) === null || _userRootSlot_onKeyDown === void 0 ? void 0 : _userRootSlot_onKeyDown.call(userRootSlot, e);\n });\n React.useEffect(()=>{\n var _toastRef_current;\n if (!visible) {\n return;\n }\n const politeness = desiredPoliteness !== null && desiredPoliteness !== void 0 ? desiredPoliteness : intentPolitenessMap[intent];\n var _toastRef_current_textContent;\n announce((_toastRef_current_textContent = (_toastRef_current = toastRef.current) === null || _toastRef_current === void 0 ? void 0 : _toastRef_current.textContent) !== null && _toastRef_current_textContent !== void 0 ? _toastRef_current_textContent : '', {\n politeness\n });\n }, [\n announce,\n desiredPoliteness,\n toastRef,\n visible,\n updateId,\n intent\n ]);\n React.useEffect(()=>{\n return ()=>{\n if (focusedToastBeforeClose.current) {\n focusedToastBeforeClose.current = false;\n tryRestoreFocus();\n }\n };\n }, [\n tryRestoreFocus\n ]);\n return {\n components: {\n timer: Timer,\n root: 'div'\n },\n timer: slot.always({\n key: updateId,\n onTimeout: close,\n running,\n timeout: timerTimeout !== null && timerTimeout !== void 0 ? timerTimeout : -1\n }, {\n elementType: Timer\n }),\n root: slot.always(getNativeElementProps('div', {\n ref: useMergedRefs(ref, toastRef, toastAnimationRef),\n children,\n tabIndex: 0,\n role: 'listitem',\n 'aria-labelledby': titleId,\n 'aria-describedby': bodyId,\n ...rest,\n ...userRootSlot,\n ...focusableGroupAttribute,\n onMouseEnter,\n onMouseLeave,\n onKeyDown\n }), {\n elementType: 'div'\n }),\n timerTimeout,\n transitionTimeout: 500,\n running,\n visible,\n remove,\n close,\n onTransitionEntering,\n updateId,\n nodeRef: toastRef,\n intent,\n titleId,\n bodyId\n };\n};\n"],"names":["useToastContainer_unstable","intentPolitenessMap","success","warning","error","info","props","ref","visible","children","close","closeProp","remove","updateId","announce","data","timeout","timerTimeout","politeness","desiredPoliteness","intent","pauseOnHover","pauseOnWindowBlur","imperativeRef","tryRestoreFocus","rest","titleId","useId","bodyId","toastRef","React","useRef","targetDocument","useFluent_unstable","running","setRunning","useState","imperativePauseRef","focusedToastBeforeClose","focusableGroupAttribute","useFocusableGroup","tabBehavior","ignoreDefaultKeydown","Tab","Escape","Enter","useEventCallback","_toastRef_current","activeElement","current","contains","onStatusChange","status","_props_onStatusChange","call","pause","play","_targetDocument_activeElement","containsActive","useImperativeHandle","focus","useEffect","_targetDocument_defaultView","_targetDocument_defaultView1","defaultView","addEventListener","removeEventListener","onTransitionEntering","element","style","setProperty","scrollHeight","userRootSlot","root","toastAnimationRef","useCallback","el","once","onMouseEnter","e","_userRootSlot_onMouseEnter","onMouseLeave","findFirstFocusable","findLastFocusable","useFocusFinders","onKeyDown","_userRootSlot_onKeyDown","key","Delete","preventDefault","currentTarget","target","shiftKey","_findLastFocusable","_findFirstFocusable","_toastRef_current_textContent","textContent","components","timer","Timer","slot","always","onTimeout","elementType","getNativeElementProps","useMergedRefs","tabIndex","role","transitionTimeout","nodeRef"],"mappings":";;;;+BAoBiBA;;aAAAA;;;6DApBM;gCAC6D;qCACjD;8BACP;8BACuB;uBAC7B;AACtB,MAAMC,sBAAsB;IACxBC,SAAS;IACTC,SAAS;IACTC,OAAO;IACPC,MAAM;AACV;AASW,MAAML,6BAA6B,CAACM,OAAOC,MAAM;IACxD,MAAM,EAAEC,QAAO,EAAGC,SAAQ,EAAGC,OAAOC,UAAS,EAAGC,OAAM,EAAGC,SAAQ,EAAGC,SAAQ,EAAGC,KAAI,EAAGC,SAASC,aAAY,EAAGC,YAAYC,kBAAiB,EAAGC,QAAQ,OAAM,EAAGC,aAAY,EAAGC,kBAAiB,EAAGC,cAAa,EAAGC,gBAAe,EAAG,GAAGC,MAAM,GAAGnB;IAChP,MAAMoB,UAAUC,IAAAA,qBAAK,EAAC;IACtB,MAAMC,SAASD,IAAAA,qBAAK,EAAC;IACrB,MAAME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QACA2F,mBAAmB;QACnB1E;QACA1B;QACAI;QACAF;QACAyD;QACAtD;QACAgG,SAAShF;QACTT;QACAM;QACAE;IACJ;AACJ"}
@@ -38,21 +38,17 @@ const useRootBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("r1qaza6
38
38
  }
39
39
  }, {
40
40
  d: [
41
- ".fayl5bc{-webkit-animation-duration:200ms,400ms;animation-duration:200ms,400ms;}",
42
- ".f17oyct0{-webkit-animation-delay:0ms,200ms;animation-delay:0ms,200ms;}",
43
- ".fvv8lvk{-webkit-animation-name:f1rp83na,f5j8bii;animation-name:f1rp83na,f5j8bii;}",
44
- ".f1tk3cza{-webkit-animation-duration:400ms,200ms;animation-duration:400ms,200ms;}",
45
- ".f1nx6yy9{-webkit-animation-delay:0ms,400ms;animation-delay:0ms,400ms;}",
46
- ".f9wuypy{-webkit-animation-name:fk0lfw7,f1n32sdh;animation-name:fk0lfw7,f1n32sdh;}"
41
+ ".fayl5bc{animation-duration:200ms,400ms;}",
42
+ ".f17oyct0{animation-delay:0ms,200ms;}",
43
+ ".fvv8lvk{animation-name:f1rp83na,f5j8bii;}",
44
+ ".f1tk3cza{animation-duration:400ms,200ms;}",
45
+ ".f1nx6yy9{animation-delay:0ms,400ms;}",
46
+ ".f9wuypy{animation-name:fk0lfw7,f1n32sdh;}"
47
47
  ],
48
48
  k: [
49
- "@-webkit-keyframes f1rp83na{from{max-height:0;opacity:0;margin-top:0;}to{margin-top:16px;opacity:0;max-height:var(--fui-toast-height);}}",
50
49
  "@keyframes f1rp83na{from{max-height:0;opacity:0;margin-top:0;}to{margin-top:16px;opacity:0;max-height:var(--fui-toast-height);}}",
51
- "@-webkit-keyframes f5j8bii{from{opacity:0;}to{opacity:1;}}",
52
50
  "@keyframes f5j8bii{from{opacity:0;}to{opacity:1;}}",
53
- "@-webkit-keyframes fk0lfw7{from{opacity:1;}to{opacity:0;}}",
54
51
  "@keyframes fk0lfw7{from{opacity:1;}to{opacity:0;}}",
55
- "@-webkit-keyframes f1n32sdh{from{opacity:0;}to{opacity:0;margin-top:0;max-height:0;}}",
56
52
  "@keyframes f1n32sdh{from{opacity:0;}to{opacity:0;margin-top:0;max-height:0;}}"
57
53
  ]
58
54
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["useToastContainerStyles.styles.js"],"sourcesContent":["import { __resetStyles, __styles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nexport const toastContainerClassNames = {\n root: 'fui-ToastContainer',\n timer: 'fui-ToastContainer__timer'\n};\nconst useRootBaseClassName = /*#__PURE__*/__resetStyles(\"r1qaza64\", \"r1e6dlul\", [\".r1qaza64{box-sizing:border-box;margin-top:16px;min-height:44px;pointer-events:all;border-bottom-right-radius:var(--borderRadiusMedium);border-bottom-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);--fui-toast-height:44px;}\", \".r1qaza64[data-fui-focus-visible]{outline-width:var(--strokeWidthThick);outline-style:solid;outline-color:var(--colorStrokeFocus2);}\", \".r1e6dlul{box-sizing:border-box;margin-top:16px;min-height:44px;pointer-events:all;border-bottom-left-radius:var(--borderRadiusMedium);border-bottom-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);--fui-toast-height:44px;}\", \".r1e6dlul[data-fui-focus-visible]{outline-width:var(--strokeWidthThick);outline-style:solid;outline-color:var(--colorStrokeFocus2);}\"]);\n/**\n * Styles for the root slot\n */\nconst useStyles = /*#__PURE__*/__styles({\n enter: {\n vin17d: \"fayl5bc\",\n m1gqa9: \"f17oyct0\",\n Bv12yb3: \"fvv8lvk\"\n },\n exit: {\n vin17d: \"f1tk3cza\",\n m1gqa9: \"f1nx6yy9\",\n Bv12yb3: \"f9wuypy\"\n }\n}, {\n d: [\".fayl5bc{-webkit-animation-duration:200ms,400ms;animation-duration:200ms,400ms;}\", \".f17oyct0{-webkit-animation-delay:0ms,200ms;animation-delay:0ms,200ms;}\", \".fvv8lvk{-webkit-animation-name:f1rp83na,f5j8bii;animation-name:f1rp83na,f5j8bii;}\", \".f1tk3cza{-webkit-animation-duration:400ms,200ms;animation-duration:400ms,200ms;}\", \".f1nx6yy9{-webkit-animation-delay:0ms,400ms;animation-delay:0ms,400ms;}\", \".f9wuypy{-webkit-animation-name:fk0lfw7,f1n32sdh;animation-name:fk0lfw7,f1n32sdh;}\"],\n k: [\"@-webkit-keyframes f1rp83na{from{max-height:0;opacity:0;margin-top:0;}to{margin-top:16px;opacity:0;max-height:var(--fui-toast-height);}}\", \"@keyframes f1rp83na{from{max-height:0;opacity:0;margin-top:0;}to{margin-top:16px;opacity:0;max-height:var(--fui-toast-height);}}\", \"@-webkit-keyframes f5j8bii{from{opacity:0;}to{opacity:1;}}\", \"@keyframes f5j8bii{from{opacity:0;}to{opacity:1;}}\", \"@-webkit-keyframes fk0lfw7{from{opacity:1;}to{opacity:0;}}\", \"@keyframes fk0lfw7{from{opacity:1;}to{opacity:0;}}\", \"@-webkit-keyframes f1n32sdh{from{opacity:0;}to{opacity:0;margin-top:0;max-height:0;}}\", \"@keyframes f1n32sdh{from{opacity:0;}to{opacity:0;margin-top:0;max-height:0;}}\"]\n});\n/**\n * Apply styling to the ToastContainer slots based on the state\n */\nexport const useToastContainerStyles_unstable = state => {\n const rootBaseClassName = useRootBaseClassName();\n const styles = useStyles();\n state.root.className = mergeClasses(toastContainerClassNames.root, rootBaseClassName, state.visible ? styles.enter : styles.exit, state.root.className);\n return state;\n};\n//# sourceMappingURL=useToastContainerStyles.styles.js.map"],"names":["toastContainerClassNames","useToastContainerStyles_unstable","root","timer","useRootBaseClassName","__resetStyles","useStyles","__styles","enter","vin17d","m1gqa9","Bv12yb3","exit","d","k","state","rootBaseClassName","styles","className","mergeClasses","visible"],"mappings":";;;;;;;;;;;IAGaA,wBAAwB,MAAxBA;IA0BAC,gCAAgC,MAAhCA;;uBA7BqD;AAG3D,MAAMD,2BAA2B;IACtCE,MAAM;IACNC,OAAO;AACT;AACA,MAAMC,uBAAuB,WAAW,GAAEC,IAAAA,uBAAa,EAAC,YAAY,YAAY;IAAC;IAA4T;IAAwI;IAA4T;CAAuI;AACx9B;;CAEC,GACD,MAAMC,YAAY,WAAW,GAAEC,IAAAA,kBAAQ,EAAC;IACtCC,OAAO;QACLC,QAAQ;QACRC,QAAQ;QACRC,SAAS;IACX;IACAC,MAAM;QACJH,QAAQ;QACRC,QAAQ;QACRC,SAAS;IACX;AACF,GAAG;IACDE,GAAG;QAAC;QAAoF;QAA2E;QAAsF;QAAqF;QAA2E;KAAqF;IAC9eC,GAAG;QAAC;QAA4I;QAAoI;QAA8D;QAAsD;QAA8D;QAAsD;QAAyF;KAAgF;AACvqB;AAIO,MAAMb,mCAAmCc,CAAAA,QAAS;IACvD,MAAMC,oBAAoBZ;IAC1B,MAAMa,SAASX;IACfS,MAAMb,IAAI,CAACgB,SAAS,GAAGC,IAAAA,mBAAY,EAACnB,yBAAyBE,IAAI,EAAEc,mBAAmBD,MAAMK,OAAO,GAAGH,OAAOT,KAAK,GAAGS,OAAOL,IAAI,EAAEG,MAAMb,IAAI,CAACgB,SAAS;IACtJ,OAAOH;AACT,GACA,0DAA0D"}
1
+ {"version":3,"sources":["useToastContainerStyles.styles.js"],"sourcesContent":["import { __resetStyles, __styles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nexport const toastContainerClassNames = {\n root: 'fui-ToastContainer',\n timer: 'fui-ToastContainer__timer'\n};\nconst useRootBaseClassName = /*#__PURE__*/__resetStyles(\"r1qaza64\", \"r1e6dlul\", [\".r1qaza64{box-sizing:border-box;margin-top:16px;min-height:44px;pointer-events:all;border-bottom-right-radius:var(--borderRadiusMedium);border-bottom-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);--fui-toast-height:44px;}\", \".r1qaza64[data-fui-focus-visible]{outline-width:var(--strokeWidthThick);outline-style:solid;outline-color:var(--colorStrokeFocus2);}\", \".r1e6dlul{box-sizing:border-box;margin-top:16px;min-height:44px;pointer-events:all;border-bottom-left-radius:var(--borderRadiusMedium);border-bottom-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);--fui-toast-height:44px;}\", \".r1e6dlul[data-fui-focus-visible]{outline-width:var(--strokeWidthThick);outline-style:solid;outline-color:var(--colorStrokeFocus2);}\"]);\n/**\n * Styles for the root slot\n */\nconst useStyles = /*#__PURE__*/__styles({\n enter: {\n vin17d: \"fayl5bc\",\n m1gqa9: \"f17oyct0\",\n Bv12yb3: \"fvv8lvk\"\n },\n exit: {\n vin17d: \"f1tk3cza\",\n m1gqa9: \"f1nx6yy9\",\n Bv12yb3: \"f9wuypy\"\n }\n}, {\n d: [\".fayl5bc{animation-duration:200ms,400ms;}\", \".f17oyct0{animation-delay:0ms,200ms;}\", \".fvv8lvk{animation-name:f1rp83na,f5j8bii;}\", \".f1tk3cza{animation-duration:400ms,200ms;}\", \".f1nx6yy9{animation-delay:0ms,400ms;}\", \".f9wuypy{animation-name:fk0lfw7,f1n32sdh;}\"],\n k: [\"@keyframes f1rp83na{from{max-height:0;opacity:0;margin-top:0;}to{margin-top:16px;opacity:0;max-height:var(--fui-toast-height);}}\", \"@keyframes f5j8bii{from{opacity:0;}to{opacity:1;}}\", \"@keyframes fk0lfw7{from{opacity:1;}to{opacity:0;}}\", \"@keyframes f1n32sdh{from{opacity:0;}to{opacity:0;margin-top:0;max-height:0;}}\"]\n});\n/**\n * Apply styling to the ToastContainer slots based on the state\n */\nexport const useToastContainerStyles_unstable = state => {\n const rootBaseClassName = useRootBaseClassName();\n const styles = useStyles();\n state.root.className = mergeClasses(toastContainerClassNames.root, rootBaseClassName, state.visible ? styles.enter : styles.exit, state.root.className);\n return state;\n};\n//# sourceMappingURL=useToastContainerStyles.styles.js.map"],"names":["toastContainerClassNames","useToastContainerStyles_unstable","root","timer","useRootBaseClassName","__resetStyles","useStyles","__styles","enter","vin17d","m1gqa9","Bv12yb3","exit","d","k","state","rootBaseClassName","styles","className","mergeClasses","visible"],"mappings":";;;;;;;;;;;IAGaA,wBAAwB,MAAxBA;IA0BAC,gCAAgC,MAAhCA;;uBA7BqD;AAG3D,MAAMD,2BAA2B;IACtCE,MAAM;IACNC,OAAO;AACT;AACA,MAAMC,uBAAuB,WAAW,GAAEC,IAAAA,uBAAa,EAAC,YAAY,YAAY;IAAC;IAA4T;IAAwI;IAA4T;CAAuI;AACx9B;;CAEC,GACD,MAAMC,YAAY,WAAW,GAAEC,IAAAA,kBAAQ,EAAC;IACtCC,OAAO;QACLC,QAAQ;QACRC,QAAQ;QACRC,SAAS;IACX;IACAC,MAAM;QACJH,QAAQ;QACRC,QAAQ;QACRC,SAAS;IACX;AACF,GAAG;IACDE,GAAG;QAAC;QAA6C;QAAyC;QAA8C;QAA8C;QAAyC;KAA6C;IAC5QC,GAAG;QAAC;QAAoI;QAAsD;QAAsD;KAAgF;AACtU;AAIO,MAAMb,mCAAmCc,CAAAA,QAAS;IACvD,MAAMC,oBAAoBZ;IAC1B,MAAMa,SAASX;IACfS,MAAMb,IAAI,CAACgB,SAAS,GAAGC,IAAAA,mBAAY,EAACnB,yBAAyBE,IAAI,EAAEc,mBAAmBD,MAAMK,OAAO,GAAGH,OAAOT,KAAK,GAAGS,OAAOL,IAAI,EAAEG,MAAMb,IAAI,CAACgB,SAAS;IACtJ,OAAOH;AACT,GACA,0DAA0D"}
@@ -9,6 +9,6 @@ Object.defineProperty(exports, "renderToastFooter_unstable", {
9
9
  const _reactJsxRuntime = require("@fluentui/react-jsx-runtime");
10
10
  const _reactUtilities = require("@fluentui/react-utilities");
11
11
  const renderToastFooter_unstable = (state)=>{
12
- const { slots , slotProps } = (0, _reactUtilities.getSlotsNext)(state);
13
- return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.root, slotProps.root);
12
+ (0, _reactUtilities.assertSlots)(state);
13
+ return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(state.root, null);
14
14
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["renderToastFooter.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of ToastFooter\n */ export const renderToastFooter_unstable = (state)=>{\n const { slots , slotProps } = getSlotsNext(state);\n return /*#__PURE__*/ createElement(slots.root, slotProps.root);\n};\n"],"names":["renderToastFooter_unstable","state","slots","slotProps","getSlotsNext","createElement","root"],"mappings":"AAAA,wBAAwB,GAAG,uBAAuB;;;;+BAIjCA;;aAAAA;;iCAJkE;gCACtD;AAGlB,MAAMA,6BAA6B,CAACC,QAAQ;IACnD,MAAM,EAAEC,MAAK,EAAGC,UAAS,EAAG,GAAGC,IAAAA,4BAAY,EAACH;IAC5C,OAAO,WAAW,GAAGI,IAAAA,8BAAa,EAACH,MAAMI,IAAI,EAAEH,UAAUG,IAAI;AACjE"}
1
+ {"version":3,"sources":["renderToastFooter.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of ToastFooter\n */ export const renderToastFooter_unstable = (state)=>{\n assertSlots(state);\n return /*#__PURE__*/ createElement(state.root, null);\n};\n"],"names":["renderToastFooter_unstable","state","assertSlots","createElement","root"],"mappings":"AAAA,wBAAwB,GAAG,uBAAuB;;;;+BAIjCA;;aAAAA;;iCAJkE;gCACvD;AAGjB,MAAMA,6BAA6B,CAACC,QAAQ;IACnDC,IAAAA,2BAAW,EAACD;IACZ,OAAO,WAAW,GAAGE,IAAAA,8BAAa,EAACF,MAAMG,IAAI,EAAE,IAAI;AACvD"}
@@ -14,9 +14,11 @@ const useToastFooter_unstable = (props, ref)=>{
14
14
  components: {
15
15
  root: 'div'
16
16
  },
17
- root: (0, _reactUtilities.getNativeElementProps)('div', {
17
+ root: _reactUtilities.slot.always((0, _reactUtilities.getNativeElementProps)('div', {
18
18
  ref,
19
19
  ...props
20
+ }), {
21
+ elementType: 'div'
20
22
  })
21
23
  };
22
24
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["useToastFooter.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\n/**\n * Create the state required to render ToastFooter.\n *\n * The returned state can be modified with hooks such as useToastFooterStyles_unstable,\n * before being passed to renderToastFooter_unstable.\n *\n * @param props - props from this instance of ToastFooter\n * @param ref - reference to root HTMLElement of ToastFooter\n */ export const useToastFooter_unstable = (props, ref)=>{\n return {\n components: {\n root: 'div'\n },\n root: getNativeElementProps('div', {\n ref,\n ...props\n })\n };\n};\n"],"names":["useToastFooter_unstable","props","ref","components","root","getNativeElementProps"],"mappings":";;;;+BAUiBA;;aAAAA;;;6DAVM;gCACe;AAS3B,MAAMA,0BAA0B,CAACC,OAAOC,MAAM;IACrD,OAAO;QACHC,YAAY;YACRC,MAAM;QACV;QACAA,MAAMC,IAAAA,qCAAqB,EAAC,OAAO;YAC/BH;YACA,GAAGD,KAAK;QACZ;IACJ;AACJ"}
1
+ {"version":3,"sources":["useToastFooter.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, slot } from '@fluentui/react-utilities';\n/**\n * Create the state required to render ToastFooter.\n *\n * The returned state can be modified with hooks such as useToastFooterStyles_unstable,\n * before being passed to renderToastFooter_unstable.\n *\n * @param props - props from this instance of ToastFooter\n * @param ref - reference to root HTMLElement of ToastFooter\n */ export const useToastFooter_unstable = (props, ref)=>{\n return {\n components: {\n root: 'div'\n },\n root: slot.always(getNativeElementProps('div', {\n ref,\n ...props\n }), {\n elementType: 'div'\n })\n };\n};\n"],"names":["useToastFooter_unstable","props","ref","components","root","slot","always","getNativeElementProps","elementType"],"mappings":";;;;+BAUiBA;;aAAAA;;;6DAVM;gCACqB;AASjC,MAAMA,0BAA0B,CAACC,OAAOC,MAAM;IACrD,OAAO;QACHC,YAAY;YACRC,MAAM;QACV;QACAA,MAAMC,oBAAI,CAACC,MAAM,CAACC,IAAAA,qCAAqB,EAAC,OAAO;YAC3CL;YACA,GAAGD,KAAK;QACZ,IAAI;YACAO,aAAa;QACjB;IACJ;AACJ"}
@@ -19,7 +19,7 @@ const toastFooterClassNames = {
19
19
  /**
20
20
  * Styles for the root slot
21
21
  */ const useRootBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("r1u6izx1", null, [
22
- ".r1u6izx1{padding-top:16px;-ms-grid-column:2;grid-column-start:2;-ms-grid-row-span:1;grid-column-end:3;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-column-gap:14px;column-gap:14px;row-gap:14px;}"
22
+ ".r1u6izx1{padding-top:16px;grid-column-start:2;grid-column-end:3;display:flex;align-items:center;column-gap:14px;row-gap:14px;}"
23
23
  ]);
24
24
  const useToastFooterStyles_unstable = (state)=>{
25
25
  const rootBaseClassName = useRootBaseClassName();
@@ -1 +1 @@
1
- {"version":3,"sources":["useToastFooterStyles.styles.js"],"sourcesContent":["import { __resetStyles, mergeClasses, shorthands } from '@griffel/react';\nexport const toastFooterClassNames = {\n root: 'fui-ToastFooter'\n};\n/**\n * Styles for the root slot\n */\nconst useRootBaseClassName = /*#__PURE__*/__resetStyles(\"r1u6izx1\", null, [\".r1u6izx1{padding-top:16px;-ms-grid-column:2;grid-column-start:2;-ms-grid-row-span:1;grid-column-end:3;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-column-gap:14px;column-gap:14px;row-gap:14px;}\"]);\n/**\n * Apply styling to the ToastFooter slots based on the state\n */\nexport const useToastFooterStyles_unstable = state => {\n const rootBaseClassName = useRootBaseClassName();\n state.root.className = mergeClasses(toastFooterClassNames.root, rootBaseClassName, state.root.className);\n return state;\n};\n//# sourceMappingURL=useToastFooterStyles.styles.js.map"],"names":["toastFooterClassNames","useToastFooterStyles_unstable","root","useRootBaseClassName","__resetStyles","state","rootBaseClassName","className","mergeClasses"],"mappings":";;;;;;;;;;;IACaA,qBAAqB,MAArBA;IAUAC,6BAA6B,MAA7BA;;uBAX2C;AACjD,MAAMD,wBAAwB;IACnCE,MAAM;AACR;AACA;;CAEC,GACD,MAAMC,uBAAuB,WAAW,GAAEC,IAAAA,uBAAa,EAAC,YAAY,IAAI,EAAE;IAAC;CAAuU;AAI3Y,MAAMH,gCAAgCI,CAAAA,QAAS;IACpD,MAAMC,oBAAoBH;IAC1BE,MAAMH,IAAI,CAACK,SAAS,GAAGC,IAAAA,mBAAY,EAACR,sBAAsBE,IAAI,EAAEI,mBAAmBD,MAAMH,IAAI,CAACK,SAAS;IACvG,OAAOF;AACT,GACA,uDAAuD"}
1
+ {"version":3,"sources":["useToastFooterStyles.styles.js"],"sourcesContent":["import { __resetStyles, mergeClasses, shorthands } from '@griffel/react';\nexport const toastFooterClassNames = {\n root: 'fui-ToastFooter'\n};\n/**\n * Styles for the root slot\n */\nconst useRootBaseClassName = /*#__PURE__*/__resetStyles(\"r1u6izx1\", null, [\".r1u6izx1{padding-top:16px;grid-column-start:2;grid-column-end:3;display:flex;align-items:center;column-gap:14px;row-gap:14px;}\"]);\n/**\n * Apply styling to the ToastFooter slots based on the state\n */\nexport const useToastFooterStyles_unstable = state => {\n const rootBaseClassName = useRootBaseClassName();\n state.root.className = mergeClasses(toastFooterClassNames.root, rootBaseClassName, state.root.className);\n return state;\n};\n//# sourceMappingURL=useToastFooterStyles.styles.js.map"],"names":["toastFooterClassNames","useToastFooterStyles_unstable","root","useRootBaseClassName","__resetStyles","state","rootBaseClassName","className","mergeClasses"],"mappings":";;;;;;;;;;;IACaA,qBAAqB,MAArBA;IAUAC,6BAA6B,MAA7BA;;uBAX2C;AACjD,MAAMD,wBAAwB;IACnCE,MAAM;AACR;AACA;;CAEC,GACD,MAAMC,uBAAuB,WAAW,GAAEC,IAAAA,uBAAa,EAAC,YAAY,IAAI,EAAE;IAAC;CAAkI;AAItM,MAAMH,gCAAgCI,CAAAA,QAAS;IACpD,MAAMC,oBAAoBH;IAC1BE,MAAMH,IAAI,CAACK,SAAS,GAAGC,IAAAA,mBAAY,EAACR,sBAAsBE,IAAI,EAAEI,mBAAmBD,MAAMH,IAAI,CAACK,SAAS;IACvG,OAAOF;AACT,GACA,uDAAuD"}
@@ -9,6 +9,6 @@ Object.defineProperty(exports, "renderToastTitle_unstable", {
9
9
  const _reactJsxRuntime = require("@fluentui/react-jsx-runtime");
10
10
  const _reactUtilities = require("@fluentui/react-utilities");
11
11
  const renderToastTitle_unstable = (state)=>{
12
- const { slots , slotProps } = (0, _reactUtilities.getSlotsNext)(state);
13
- return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(_reactJsxRuntime.Fragment, null, slots.media ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.media, slotProps.media) : null, /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.root, slotProps.root), slots.action ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.action, slotProps.action) : null);
12
+ (0, _reactUtilities.assertSlots)(state);
13
+ return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(_reactJsxRuntime.Fragment, null, state.media ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(state.media, null) : null, /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(state.root, null), state.action ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(state.action, null) : null);
14
14
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["renderToastTitle.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsxFrag Fragment */ /** @jsx createElement */ import { createElement, Fragment } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of ToastTitle\n */ export const renderToastTitle_unstable = (state)=>{\n const { slots , slotProps } = getSlotsNext(state);\n return /*#__PURE__*/ createElement(Fragment, null, slots.media ? /*#__PURE__*/ createElement(slots.media, slotProps.media) : null, /*#__PURE__*/ createElement(slots.root, slotProps.root), slots.action ? /*#__PURE__*/ createElement(slots.action, slotProps.action) : null);\n};\n"],"names":["renderToastTitle_unstable","state","slots","slotProps","getSlotsNext","createElement","Fragment","media","root","action"],"mappings":"AAAA,wBAAwB,GAAG,sBAAsB,GAAG,uBAAuB;;;;+BAI1DA;;aAAAA;;iCAJqG;gCACzF;AAGlB,MAAMA,4BAA4B,CAACC,QAAQ;IAClD,MAAM,EAAEC,MAAK,EAAGC,UAAS,EAAG,GAAGC,IAAAA,4BAAY,EAACH;IAC5C,OAAO,WAAW,GAAGI,IAAAA,8BAAa,EAACC,yBAAQ,EAAE,IAAI,EAAEJ,MAAMK,KAAK,GAAG,WAAW,GAAGF,IAAAA,8BAAa,EAACH,MAAMK,KAAK,EAAEJ,UAAUI,KAAK,IAAI,IAAI,EAAE,WAAW,GAAGF,IAAAA,8BAAa,EAACH,MAAMM,IAAI,EAAEL,UAAUK,IAAI,GAAGN,MAAMO,MAAM,GAAG,WAAW,GAAGJ,IAAAA,8BAAa,EAACH,MAAMO,MAAM,EAAEN,UAAUM,MAAM,IAAI,IAAI;AACjR"}
1
+ {"version":3,"sources":["renderToastTitle.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsxFrag Fragment */ /** @jsx createElement */ import { createElement, Fragment } from '@fluentui/react-jsx-runtime';\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of ToastTitle\n */ export const renderToastTitle_unstable = (state)=>{\n assertSlots(state);\n return /*#__PURE__*/ createElement(Fragment, null, state.media ? /*#__PURE__*/ createElement(state.media, null) : null, /*#__PURE__*/ createElement(state.root, null), state.action ? /*#__PURE__*/ createElement(state.action, null) : null);\n};\n"],"names":["renderToastTitle_unstable","state","assertSlots","createElement","Fragment","media","root","action"],"mappings":"AAAA,wBAAwB,GAAG,sBAAsB,GAAG,uBAAuB;;;;+BAI1DA;;aAAAA;;iCAJqG;gCAC1F;AAGjB,MAAMA,4BAA4B,CAACC,QAAQ;IAClDC,IAAAA,2BAAW,EAACD;IACZ,OAAO,WAAW,GAAGE,IAAAA,8BAAa,EAACC,yBAAQ,EAAE,IAAI,EAAEH,MAAMI,KAAK,GAAG,WAAW,GAAGF,IAAAA,8BAAa,EAACF,MAAMI,KAAK,EAAE,IAAI,IAAI,IAAI,EAAE,WAAW,GAAGF,IAAAA,8BAAa,EAACF,MAAMK,IAAI,EAAE,IAAI,GAAGL,MAAMM,MAAM,GAAG,WAAW,GAAGJ,IAAAA,8BAAa,EAACF,MAAMM,MAAM,EAAE,IAAI,IAAI,IAAI;AAChP"}
@@ -31,23 +31,28 @@ const useToastTitle_unstable = (props, ref)=>{
31
31
  break;
32
32
  }
33
33
  return {
34
- action: (0, _reactUtilities.resolveShorthand)(props.action),
34
+ action: _reactUtilities.slot.optional(props.action, {
35
+ elementType: 'div'
36
+ }),
35
37
  components: {
36
38
  root: 'div',
37
39
  media: 'div',
38
40
  action: 'div'
39
41
  },
40
- media: (0, _reactUtilities.resolveShorthand)(props.media, {
41
- required: !!intent,
42
+ media: _reactUtilities.slot.optional(props.media, {
43
+ renderByDefault: !!intent,
42
44
  defaultProps: {
43
45
  children: defaultIcon
44
- }
46
+ },
47
+ elementType: 'div'
45
48
  }),
46
- root: (0, _reactUtilities.getNativeElementProps)('div', {
49
+ root: _reactUtilities.slot.always((0, _reactUtilities.getNativeElementProps)('div', {
47
50
  ref,
48
51
  children: props.children,
49
52
  id: titleId,
50
53
  ...props
54
+ }), {
55
+ elementType: 'div'
51
56
  }),
52
57
  intent,
53
58
  backgroundAppearance
@@ -1 +1 @@
1
- {"version":3,"sources":["useToastTitle.js"],"sourcesContent":["import * as React from 'react';\nimport { CheckmarkCircleFilled, DismissCircleFilled, InfoFilled, WarningFilled } from '@fluentui/react-icons';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport { useBackgroundAppearance } from '@fluentui/react-shared-contexts';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\n/**\n * Create the state required to render ToastTitle.\n *\n * The returned state can be modified with hooks such as useToastTitleStyles_unstable,\n * before being passed to renderToastTitle_unstable.\n *\n * @param props - props from this instance of ToastTitle\n * @param ref - reference to root HTMLElement of ToastTitle\n */ export const useToastTitle_unstable = (props, ref)=>{\n const { intent , titleId } = useToastContainerContext();\n const backgroundAppearance = useBackgroundAppearance();\n /** Determine the role and media to render based on the intent */ let defaultIcon;\n switch(intent){\n case 'success':\n defaultIcon = /*#__PURE__*/ React.createElement(CheckmarkCircleFilled, null);\n break;\n case 'error':\n defaultIcon = /*#__PURE__*/ React.createElement(DismissCircleFilled, null);\n break;\n case 'warning':\n defaultIcon = /*#__PURE__*/ React.createElement(WarningFilled, null);\n break;\n case 'info':\n defaultIcon = /*#__PURE__*/ React.createElement(InfoFilled, null);\n break;\n }\n return {\n action: resolveShorthand(props.action),\n components: {\n root: 'div',\n media: 'div',\n action: 'div'\n },\n media: resolveShorthand(props.media, {\n required: !!intent,\n defaultProps: {\n children: defaultIcon\n }\n }),\n root: getNativeElementProps('div', {\n ref,\n children: props.children,\n id: titleId,\n ...props\n }),\n intent,\n backgroundAppearance\n };\n};\n"],"names":["useToastTitle_unstable","props","ref","intent","titleId","useToastContainerContext","backgroundAppearance","useBackgroundAppearance","defaultIcon","React","createElement","CheckmarkCircleFilled","DismissCircleFilled","WarningFilled","InfoFilled","action","resolveShorthand","components","root","media","required","defaultProps","children","getNativeElementProps","id"],"mappings":";;;;+BAaiBA;;aAAAA;;;6DAbM;4BAC+D;gCAC9B;qCAChB;uCACC;AAS9B,MAAMA,yBAAyB,CAACC,OAAOC,MAAM;IACpD,MAAM,EAAEC,OAAM,EAAGC,QAAO,EAAG,GAAGC,IAAAA,+CAAwB;IACtD,MAAMC,uBAAuBC,IAAAA,4CAAuB;IACpD,+DAA+D,GAAG,IAAIC;IACtE,OAAOL;QACH,KAAK;YACDK,cAAc,WAAW,GAAGC,OAAMC,aAAa,CAACC,iCAAqB,EAAE,IAAI;YAC3E,KAAM;QACV,KAAK;YACDH,cAAc,WAAW,GAAGC,OAAMC,aAAa,CAACE,+BAAmB,EAAE,IAAI;YACzE,KAAM;QACV,KAAK;YACDJ,cAAc,WAAW,GAAGC,OAAMC,aAAa,CAACG,yBAAa,EAAE,IAAI;YACnE,KAAM;QACV,KAAK;YACDL,cAAc,WAAW,GAAGC,OAAMC,aAAa,CAACI,sBAAU,EAAE,IAAI;YAChE,KAAM;IACd;IACA,OAAO;QACHC,QAAQC,IAAAA,gCAAgB,EAACf,MAAMc,MAAM;QACrCE,YAAY;YACRC,MAAM;YACNC,OAAO;YACPJ,QAAQ;QACZ;QACAI,OAAOH,IAAAA,gCAAgB,EAACf,MAAMkB,KAAK,EAAE;YACjCC,UAAU,CAAC,CAACjB;YACZkB,cAAc;gBACVC,UAAUd;YACd;QACJ;QACAU,MAAMK,IAAAA,qCAAqB,EAAC,OAAO;YAC/BrB;YACAoB,UAAUrB,MAAMqB,QAAQ;YACxBE,IAAIpB;YACJ,GAAGH,KAAK;QACZ;QACAE;QACAG;IACJ;AACJ"}
1
+ {"version":3,"sources":["useToastTitle.js"],"sourcesContent":["import * as React from 'react';\nimport { CheckmarkCircleFilled, DismissCircleFilled, InfoFilled, WarningFilled } from '@fluentui/react-icons';\nimport { getNativeElementProps, slot } from '@fluentui/react-utilities';\nimport { useBackgroundAppearance } from '@fluentui/react-shared-contexts';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\n/**\n * Create the state required to render ToastTitle.\n *\n * The returned state can be modified with hooks such as useToastTitleStyles_unstable,\n * before being passed to renderToastTitle_unstable.\n *\n * @param props - props from this instance of ToastTitle\n * @param ref - reference to root HTMLElement of ToastTitle\n */ export const useToastTitle_unstable = (props, ref)=>{\n const { intent , titleId } = useToastContainerContext();\n const backgroundAppearance = useBackgroundAppearance();\n /** Determine the role and media to render based on the intent */ let defaultIcon;\n switch(intent){\n case 'success':\n defaultIcon = /*#__PURE__*/ React.createElement(CheckmarkCircleFilled, null);\n break;\n case 'error':\n defaultIcon = /*#__PURE__*/ React.createElement(DismissCircleFilled, null);\n break;\n case 'warning':\n defaultIcon = /*#__PURE__*/ React.createElement(WarningFilled, null);\n break;\n case 'info':\n defaultIcon = /*#__PURE__*/ React.createElement(InfoFilled, null);\n break;\n }\n return {\n action: slot.optional(props.action, {\n elementType: 'div'\n }),\n components: {\n root: 'div',\n media: 'div',\n action: 'div'\n },\n media: slot.optional(props.media, {\n renderByDefault: !!intent,\n defaultProps: {\n children: defaultIcon\n },\n elementType: 'div'\n }),\n root: slot.always(getNativeElementProps('div', {\n ref,\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","getNativeElementProps","id"],"mappings":";;;;+BAaiBA;;aAAAA;;;6DAbM;4BAC+D;gCAC1C;qCACJ;uCACC;AAS9B,MAAMA,yBAAyB,CAACC,OAAOC,MAAM;IACpD,MAAM,EAAEC,OAAM,EAAGC,QAAO,EAAG,GAAGC,IAAAA,+CAAwB;IACtD,MAAMC,uBAAuBC,IAAAA,4CAAuB;IACpD,+DAA+D,GAAG,IAAIC;IACtE,OAAOL;QACH,KAAK;YACDK,cAAc,WAAW,GAAGC,OAAMC,aAAa,CAACC,iCAAqB,EAAE,IAAI;YAC3E,KAAM;QACV,KAAK;YACDH,cAAc,WAAW,GAAGC,OAAMC,aAAa,CAACE,+BAAmB,EAAE,IAAI;YACzE,KAAM;QACV,KAAK;YACDJ,cAAc,WAAW,GAAGC,OAAMC,aAAa,CAACG,yBAAa,EAAE,IAAI;YACnE,KAAM;QACV,KAAK;YACDL,cAAc,WAAW,GAAGC,OAAMC,aAAa,CAACI,sBAAU,EAAE,IAAI;YAChE,KAAM;IACd;IACA,OAAO;QACHC,QAAQC,oBAAI,CAACC,QAAQ,CAAChB,MAAMc,MAAM,EAAE;YAChCG,aAAa;QACjB;QACAC,YAAY;YACRC,MAAM;YACNC,OAAO;YACPN,QAAQ;QACZ;QACAM,OAAOL,oBAAI,CAACC,QAAQ,CAAChB,MAAMoB,KAAK,EAAE;YAC9BC,iBAAiB,CAAC,CAACnB;YACnBoB,cAAc;gBACVC,UAAUhB;YACd;YACAU,aAAa;QACjB;QACAE,MAAMJ,oBAAI,CAACS,MAAM,CAACC,IAAAA,qCAAqB,EAAC,OAAO;YAC3CxB;YACAsB,UAAUvB,MAAMuB,QAAQ;YACxBG,IAAIvB;YACJ,GAAGH,KAAK;QACZ,IAAI;YACAiB,aAAa;QACjB;QACAf;QACAG;IACJ;AACJ"}
@@ -19,15 +19,15 @@ const toastTitleClassNames = {
19
19
  action: 'fui-ToastTitle__action'
20
20
  };
21
21
  const useRootBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("r1mlor6q", null, [
22
- ".r1mlor6q{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-grid-column-span:3;grid-column-end:3;color:var(--colorNeutralForeground1);}"
22
+ ".r1mlor6q{display:flex;align-items:center;grid-column-end:3;color:var(--colorNeutralForeground1);}"
23
23
  ]);
24
24
  const useMediaBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("rnm72z1", "rzj6g76", [
25
- ".rnm72z1{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-grid-column-span:2;grid-column-end:2;padding-right:8px;font-size:16px;color:var(--colorNeutralForeground1);}",
26
- ".rzj6g76{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-grid-column-span:2;grid-column-end:2;padding-left:8px;font-size:16px;color:var(--colorNeutralForeground1);}"
25
+ ".rnm72z1{display:flex;align-items:center;grid-column-end:2;padding-right:8px;font-size:16px;color:var(--colorNeutralForeground1);}",
26
+ ".rzj6g76{display:flex;align-items:center;grid-column-end:2;padding-left:8px;font-size:16px;color:var(--colorNeutralForeground1);}"
27
27
  ]);
28
28
  const useActionBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("r5vrc68", "rzqb88z", [
29
- ".r5vrc68{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-left:12px;-ms-grid-column-span:-1;grid-column-end:-1;color:var(--colorBrandForeground1);}",
30
- ".rzqb88z{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-right:12px;-ms-grid-column-span:-1;grid-column-end:-1;color:var(--colorBrandForeground1);}"
29
+ ".r5vrc68{display:flex;align-items:center;padding-left:12px;grid-column-end:-1;color:var(--colorBrandForeground1);}",
30
+ ".rzqb88z{display:flex;align-items:center;padding-right:12px;grid-column-end:-1;color:var(--colorBrandForeground1);}"
31
31
  ]);
32
32
  const useInvertedStyles = /*#__PURE__*/ (0, _react["__styles"])({
33
33
  root: {
@@ -1 +1 @@
1
- {"version":3,"sources":["useToastTitleStyles.styles.js"],"sourcesContent":["import { __styles, __resetStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const toastTitleClassNames = {\n root: 'fui-ToastTitle',\n media: 'fui-ToastTitle__media',\n action: 'fui-ToastTitle__action'\n};\nconst useRootBaseClassName = /*#__PURE__*/__resetStyles(\"r1mlor6q\", null, [\".r1mlor6q{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-grid-column-span:3;grid-column-end:3;color:var(--colorNeutralForeground1);}\"]);\nconst useMediaBaseClassName = /*#__PURE__*/__resetStyles(\"rnm72z1\", \"rzj6g76\", [\".rnm72z1{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-grid-column-span:2;grid-column-end:2;padding-right:8px;font-size:16px;color:var(--colorNeutralForeground1);}\", \".rzj6g76{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-grid-column-span:2;grid-column-end:2;padding-left:8px;font-size:16px;color:var(--colorNeutralForeground1);}\"]);\nconst useActionBaseClassName = /*#__PURE__*/__resetStyles(\"r5vrc68\", \"rzqb88z\", [\".r5vrc68{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-left:12px;-ms-grid-column-span:-1;grid-column-end:-1;color:var(--colorBrandForeground1);}\", \".rzqb88z{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-right:12px;-ms-grid-column-span:-1;grid-column-end:-1;color:var(--colorBrandForeground1);}\"]);\nconst useInvertedStyles = /*#__PURE__*/__styles({\n root: {\n sj55zd: \"f1w7i9ko\"\n },\n action: {\n sj55zd: \"f1qz2gb0\"\n },\n media: {\n sj55zd: \"fqpbvvt\"\n }\n}, {\n d: [\".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}\", \".f1qz2gb0{color:var(--colorBrandForegroundInverted);}\", \".fqpbvvt{color:var(--colorNeutralForegroundInverted);}\"]\n});\nconst useIntentIconStyles = /*#__PURE__*/__styles({\n success: {\n sj55zd: \"f1m7fhi8\"\n },\n error: {\n sj55zd: \"fg9gses\"\n },\n warning: {\n sj55zd: \"f1k5f75o\"\n },\n info: {\n sj55zd: \"fkfq4zb\"\n }\n}, {\n d: [\".f1m7fhi8{color:var(--colorPaletteGreenForeground3);}\", \".fg9gses{color:var(--colorPaletteCranberryForeground2);}\", \".f1k5f75o{color:var(--colorPaletteDarkOrangeForeground1);}\", \".fkfq4zb{color:var(--colorNeutralForeground2);}\"]\n});\nconst useIntentIconStylesInverted = /*#__PURE__*/__styles({\n success: {\n sj55zd: \"f1pvjcpr\"\n },\n error: {\n sj55zd: \"fcrp5ll\"\n },\n warning: {\n sj55zd: \"f1r8f1cl\"\n },\n info: {\n sj55zd: \"f1w7i9ko\"\n }\n}, {\n d: [\".f1pvjcpr{color:var(--colorPaletteGreenForegroundInverted);}\", \".fcrp5ll{color:var(--colorPaletteRedForegroundInverted);}\", \".f1r8f1cl{color:var(--colorPaletteYellowForegroundInverted);}\", \".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}\"]\n});\n/**\n * Apply styling to the ToastTitle slots based on the state\n */\nexport const useToastTitleStyles_unstable = state => {\n const rootBaseClassName = useRootBaseClassName();\n const actionBaseClassName = useActionBaseClassName();\n const mediaBaseClassName = useMediaBaseClassName();\n const intentIconStyles = useIntentIconStyles();\n const intentIconStylesInverted = useIntentIconStylesInverted();\n const {\n intent\n } = state;\n const invertedStyles = useInvertedStyles();\n state.root.className = mergeClasses(toastTitleClassNames.root, rootBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.root, state.root.className);\n if (state.media) {\n state.media.className = mergeClasses(toastTitleClassNames.media, mediaBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.media, state.media.className, intent && intentIconStyles[intent], intent && state.backgroundAppearance === 'inverted' && intentIconStylesInverted[intent]);\n }\n if (state.action) {\n state.action.className = mergeClasses(toastTitleClassNames.action, actionBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.action, state.action.className);\n }\n return state;\n};\n//# sourceMappingURL=useToastTitleStyles.styles.js.map"],"names":["toastTitleClassNames","useToastTitleStyles_unstable","root","media","action","useRootBaseClassName","__resetStyles","useMediaBaseClassName","useActionBaseClassName","useInvertedStyles","__styles","sj55zd","d","useIntentIconStyles","success","error","warning","info","useIntentIconStylesInverted","state","rootBaseClassName","actionBaseClassName","mediaBaseClassName","intentIconStyles","intentIconStylesInverted","intent","invertedStyles","className","mergeClasses","backgroundAppearance"],"mappings":";;;;;;;;;;;IAEaA,oBAAoB,MAApBA;IAwDAC,4BAA4B,MAA5BA;;uBA1DyC;AAE/C,MAAMD,uBAAuB;IAClCE,MAAM;IACNC,OAAO;IACPC,QAAQ;AACV;AACA,MAAMC,uBAAuB,WAAW,GAAEC,IAAAA,uBAAa,EAAC,YAAY,IAAI,EAAE;IAAC;CAAmQ;AAC9U,MAAMC,wBAAwB,WAAW,GAAED,IAAAA,uBAAa,EAAC,WAAW,WAAW;IAAC;IAAoS;CAAkS;AACtpB,MAAME,yBAAyB,WAAW,GAAEF,IAAAA,uBAAa,EAAC,WAAW,WAAW;IAAC;IAAqR;CAAqR;AAC3nB,MAAMG,oBAAoB,WAAW,GAAEC,IAAAA,kBAAQ,EAAC;IAC9CR,MAAM;QACJS,QAAQ;IACV;IACAP,QAAQ;QACNO,QAAQ;IACV;IACAR,OAAO;QACLQ,QAAQ;IACV;AACF,GAAG;IACDC,GAAG;QAAC;QAA4D;QAAyD;KAAyD;AACpL;AACA,MAAMC,sBAAsB,WAAW,GAAEH,IAAAA,kBAAQ,EAAC;IAChDI,SAAS;QACPH,QAAQ;IACV;IACAI,OAAO;QACLJ,QAAQ;IACV;IACAK,SAAS;QACPL,QAAQ;IACV;IACAM,MAAM;QACJN,QAAQ;IACV;AACF,GAAG;IACDC,GAAG;QAAC;QAAyD;QAA4D;QAA8D;KAAkD;AAC3O;AACA,MAAMM,8BAA8B,WAAW,GAAER,IA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Styles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const toastTitleClassNames = {\n root: 'fui-ToastTitle',\n media: 'fui-ToastTitle__media',\n action: 'fui-ToastTitle__action'\n};\nconst useRootBaseClassName = /*#__PURE__*/__resetStyles(\"r1mlor6q\", null, [\".r1mlor6q{display:flex;align-items:center;grid-column-end:3;color:var(--colorNeutralForeground1);}\"]);\nconst useMediaBaseClassName = /*#__PURE__*/__resetStyles(\"rnm72z1\", \"rzj6g76\", [\".rnm72z1{display:flex;align-items:center;grid-column-end:2;padding-right:8px;font-size:16px;color:var(--colorNeutralForeground1);}\", \".rzj6g76{display:flex;align-items:center;grid-column-end:2;padding-left:8px;font-size:16px;color:var(--colorNeutralForeground1);}\"]);\nconst useActionBaseClassName = /*#__PURE__*/__resetStyles(\"r5vrc68\", \"rzqb88z\", [\".r5vrc68{display:flex;align-items:center;padding-left:12px;grid-column-end:-1;color:var(--colorBrandForeground1);}\", \".rzqb88z{display:flex;align-items:center;padding-right:12px;grid-column-end:-1;color:var(--colorBrandForeground1);}\"]);\nconst useInvertedStyles = /*#__PURE__*/__styles({\n root: {\n sj55zd: \"f1w7i9ko\"\n },\n action: {\n sj55zd: \"f1qz2gb0\"\n },\n media: {\n sj55zd: \"fqpbvvt\"\n }\n}, {\n d: [\".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}\", \".f1qz2gb0{color:var(--colorBrandForegroundInverted);}\", \".fqpbvvt{color:var(--colorNeutralForegroundInverted);}\"]\n});\nconst useIntentIconStyles = /*#__PURE__*/__styles({\n success: {\n sj55zd: \"f1m7fhi8\"\n },\n error: {\n sj55zd: \"fg9gses\"\n },\n warning: {\n sj55zd: \"f1k5f75o\"\n },\n info: {\n sj55zd: \"fkfq4zb\"\n }\n}, {\n d: [\".f1m7fhi8{color:var(--colorPaletteGreenForeground3);}\", \".fg9gses{color:var(--colorPaletteCranberryForeground2);}\", \".f1k5f75o{color:var(--colorPaletteDarkOrangeForeground1);}\", \".fkfq4zb{color:var(--colorNeutralForeground2);}\"]\n});\nconst useIntentIconStylesInverted = /*#__PURE__*/__styles({\n success: {\n sj55zd: \"f1pvjcpr\"\n },\n error: {\n sj55zd: \"fcrp5ll\"\n },\n warning: {\n sj55zd: \"f1r8f1cl\"\n },\n info: {\n sj55zd: \"f1w7i9ko\"\n }\n}, {\n d: [\".f1pvjcpr{color:var(--colorPaletteGreenForegroundInverted);}\", \".fcrp5ll{color:var(--colorPaletteRedForegroundInverted);}\", \".f1r8f1cl{color:var(--colorPaletteYellowForegroundInverted);}\", \".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}\"]\n});\n/**\n * Apply styling to the ToastTitle slots based on the state\n */\nexport const useToastTitleStyles_unstable = state => {\n const rootBaseClassName = useRootBaseClassName();\n const actionBaseClassName = useActionBaseClassName();\n const mediaBaseClassName = useMediaBaseClassName();\n const intentIconStyles = useIntentIconStyles();\n const intentIconStylesInverted = useIntentIconStylesInverted();\n const {\n intent\n } = state;\n const invertedStyles = useInvertedStyles();\n state.root.className = mergeClasses(toastTitleClassNames.root, rootBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.root, state.root.className);\n if (state.media) {\n state.media.className = mergeClasses(toastTitleClassNames.media, mediaBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.media, state.media.className, intent && intentIconStyles[intent], intent && state.backgroundAppearance === 'inverted' && intentIconStylesInverted[intent]);\n }\n if (state.action) {\n state.action.className = mergeClasses(toastTitleClassNames.action, actionBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.action, state.action.className);\n }\n return state;\n};\n//# sourceMappingURL=useToastTitleStyles.styles.js.map"],"names":["toastTitleClassNames","useToastTitleStyles_unstable","root","media","action","useRootBaseClassName","__resetStyles","useMediaBaseClassName","useActionBaseClassName","useInvertedStyles","__styles","sj55zd","d","useIntentIconStyles","success","error","warning","info","useIntentIconStylesInverted","state","rootBaseClassName","actionBaseClassName","mediaBaseClassName","intentIconStyles","intentIconStylesInverted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c,qBAAqBf;IAC3B,MAAMgB,mBAAmBV;IACzB,MAAMW,2BAA2BN;IACjC,MAAM,EACJO,OAAM,EACP,GAAGN;IACJ,MAAMO,iBAAiBjB;IACvBU,MAAMjB,IAAI,CAACyB,SAAS,GAAGC,IAAAA,mBAAY,EAAC5B,qBAAqBE,IAAI,EAAEkB,mBAAmBD,MAAMU,oBAAoB,KAAK,cAAcH,eAAexB,IAAI,EAAEiB,MAAMjB,IAAI,CAACyB,SAAS;IACxK,IAAIR,MAAMhB,KAAK,EAAE;QACfgB,MAAMhB,KAAK,CAACwB,SAAS,GAAGC,IAAAA,mBAAY,EAAC5B,qBAAqBG,KAAK,EAAEmB,oBAAoBH,MAAMU,oBAAoB,KAAK,cAAcH,eAAevB,KAAK,EAAEgB,MAAMhB,KAAK,CAACwB,SAAS,EAAEF,UAAUF,gBAAgB,CAACE,OAAO,EAAEA,UAAUN,MAAMU,oBAAoB,KAAK,cAAcL,wBAAwB,CAACC,OAAO;IAC5S,CAAC;IACD,IAAIN,MAAMf,MAAM,EAAE;QAChBe,MAAMf,MAAM,CAACuB,SAAS,GAAGC,IAAAA,mBAAY,EAAC5B,qBAAqBI,MAAM,EAAEiB,qBAAqBF,MAAMU,oBAAoB,KAAK,cAAcH,eAAetB,MAAM,EAAEe,MAAMf,MAAM,CAACuB,SAAS;IACpL,CAAC;IACD,OAAOR;AACT,GACA,sDAAsD"}
@@ -12,9 +12,9 @@ const _reactPortal = require("@fluentui/react-portal");
12
12
  const _ariaLive = require("../AriaLive");
13
13
  const renderToaster_unstable = (state)=>{
14
14
  const { announceRef , renderAriaLive } = state;
15
- const { slots , slotProps } = (0, _reactUtilities.getSlotsNext)(state);
16
- const hasToasts = !!slots.bottomStart || !!slots.bottomEnd || !!slots.topStart || !!slots.topEnd;
15
+ (0, _reactUtilities.assertSlots)(state);
16
+ const hasToasts = !!state.bottomStart || !!state.bottomEnd || !!state.topStart || !!state.topEnd;
17
17
  return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(_reactJsxRuntime.Fragment, null, renderAriaLive ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(_ariaLive.AriaLive, {
18
18
  announceRef: announceRef
19
- }) : null, hasToasts ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(_reactPortal.Portal, null, slots.bottomStart ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.bottomStart, slotProps.bottomStart) : null, slots.bottomEnd ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.bottomEnd, slotProps.bottomEnd) : null, slots.topStart ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.topStart, slotProps.topStart) : null, slots.topEnd ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.topEnd, slotProps.topEnd) : null) : null);
19
+ }) : null, hasToasts ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(_reactPortal.Portal, null, state.bottomStart ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(state.bottomStart, null) : null, state.bottomEnd ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(state.bottomEnd, null) : null, state.topStart ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(state.topStart, null) : null, state.topEnd ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(state.topEnd, null) : null) : null);
20
20
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["renderToaster.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsxFrag Fragment */ /** @jsx createElement */ import { createElement, Fragment } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\nimport { Portal } from '@fluentui/react-portal';\nimport { AriaLive } from '../AriaLive';\n/**\n * Render the final JSX of Toaster\n */ export const renderToaster_unstable = (state)=>{\n const { announceRef , renderAriaLive } = state;\n const { slots , slotProps } = getSlotsNext(state);\n const hasToasts = !!slots.bottomStart || !!slots.bottomEnd || !!slots.topStart || !!slots.topEnd;\n return /*#__PURE__*/ createElement(Fragment, null, renderAriaLive ? /*#__PURE__*/ createElement(AriaLive, {\n announceRef: announceRef\n }) : null, hasToasts ? /*#__PURE__*/ createElement(Portal, null, slots.bottomStart ? /*#__PURE__*/ createElement(slots.bottomStart, slotProps.bottomStart) : null, slots.bottomEnd ? /*#__PURE__*/ createElement(slots.bottomEnd, slotProps.bottomEnd) : null, slots.topStart ? /*#__PURE__*/ createElement(slots.topStart, slotProps.topStart) : null, slots.topEnd ? /*#__PURE__*/ createElement(slots.topEnd, slotProps.topEnd) : null) : null);\n};\n"],"names":["renderToaster_unstable","state","announceRef","renderAriaLive","slots","slotProps","getSlotsNext","hasToasts","bottomStart","bottomEnd","topStart","topEnd","createElement","Fragment","AriaLive","Portal"],"mappings":"AAAA,wBAAwB,GAAG,sBAAsB,GAAG,uBAAuB;;;;+BAM1DA;;aAAAA;;iCANqG;gCACzF;6BACN;0BACE;AAGd,MAAMA,yBAAyB,CAACC,QAAQ;IAC/C,MAAM,EAAEC,YAAW,EAAGC,eAAc,EAAG,GAAGF;IAC1C,MAAM,EAAEG,MAAK,EAAGC,UAAS,EAAG,GAAGC,IAAAA,4BAAY,EAACL;IAC5C,MAAMM,YAAY,CAAC,CAACH,MAAMI,WAAW,IAAI,CAAC,CAACJ,MAAMK,SAAS,IAAI,CAAC,CAACL,MAAMM,QAAQ,IAAI,CAAC,CAACN,MAAMO,MAAM;IAChG,OAAO,WAAW,GAAGC,IAAAA,8BAAa,EAACC,yBAAQ,EAAE,IAAI,EAAEV,iBAAiB,WAAW,GAAGS,IAAAA,8BAAa,EAACE,kBAAQ,EAAE;QACtGZ,aAAaA;IACjB,KAAK,IAAI,EAAEK,YAAY,WAAW,GAAGK,IAAAA,8BAAa,EAACG,mBAAM,EAAE,IAAI,EAAEX,MAAMI,WAAW,GAAG,WAAW,GAAGI,IAAAA,8BAAa,EAACR,MAAMI,WAAW,EAAEH,UAAUG,WAAW,IAAI,IAAI,EAAEJ,MAAMK,SAAS,GAAG,WAAW,GAAGG,IAAAA,8BAAa,EAACR,MAAMK,SAAS,EAAEJ,UAAUI,SAAS,IAAI,IAAI,EAAEL,MAAMM,QAAQ,GAAG,WAAW,GAAGE,IAAAA,8BAAa,EAACR,MAAMM,QAAQ,EAAEL,UAAUK,QAAQ,IAAI,IAAI,EAAEN,MAAMO,MAAM,GAAG,WAAW,GAAGC,IAAAA,8BAAa,EAACR,MAAMO,MAAM,EAAEN,UAAUM,MAAM,IAAI,IAAI,IAAI,IAAI;AACrb"}
1
+ {"version":3,"sources":["renderToaster.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsxFrag Fragment */ /** @jsx createElement */ import { createElement, Fragment } from '@fluentui/react-jsx-runtime';\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { Portal } from '@fluentui/react-portal';\nimport { AriaLive } from '../AriaLive';\n/**\n * Render the final JSX of Toaster\n */ export const renderToaster_unstable = (state)=>{\n const { announceRef , renderAriaLive } = state;\n assertSlots(state);\n const hasToasts = !!state.bottomStart || !!state.bottomEnd || !!state.topStart || !!state.topEnd;\n return /*#__PURE__*/ createElement(Fragment, null, renderAriaLive ? /*#__PURE__*/ createElement(AriaLive, {\n announceRef: announceRef\n }) : null, hasToasts ? /*#__PURE__*/ createElement(Portal, null, state.bottomStart ? /*#__PURE__*/ createElement(state.bottomStart, null) : null, state.bottomEnd ? /*#__PURE__*/ createElement(state.bottomEnd, null) : null, state.topStart ? /*#__PURE__*/ createElement(state.topStart, null) : null, state.topEnd ? /*#__PURE__*/ createElement(state.topEnd, null) : null) : null);\n};\n"],"names":["renderToaster_unstable","state","announceRef","renderAriaLive","assertSlots","hasToasts","bottomStart","bottomEnd","topStart","topEnd","createElement","Fragment","AriaLive","Portal"],"mappings":"AAAA,wBAAwB,GAAG,sBAAsB,GAAG,uBAAuB;;;;+BAM1DA;;aAAAA;;iCANqG;gCAC1F;6BACL;0BACE;AAGd,MAAMA,yBAAyB,CAACC,QAAQ;IAC/C,MAAM,EAAEC,YAAW,EAAGC,eAAc,EAAG,GAAGF;IAC1CG,IAAAA,2BAAW,EAACH;IACZ,MAAMI,YAAY,CAAC,CAACJ,MAAMK,WAAW,IAAI,CAAC,CAACL,MAAMM,SAAS,IAAI,CAAC,CAACN,MAAMO,QAAQ,IAAI,CAAC,CAACP,MAAMQ,MAAM;IAChG,OAAO,WAAW,GAAGC,IAAAA,8BAAa,EAACC,yBAAQ,EAAE,IAAI,EAAER,iBAAiB,WAAW,GAAGO,IAAAA,8BAAa,EAACE,kBAAQ,EAAE;QACtGV,aAAaA;IACjB,KAAK,IAAI,EAAEG,YAAY,WAAW,GAAGK,IAAAA,8BAAa,EAACG,mBAAM,EAAE,IAAI,EAAEZ,MAAMK,WAAW,GAAG,WAAW,GAAGI,IAAAA,8BAAa,EAACT,MAAMK,WAAW,EAAE,IAAI,IAAI,IAAI,EAAEL,MAAMM,SAAS,GAAG,WAAW,GAAGG,IAAAA,8BAAa,EAACT,MAAMM,SAAS,EAAE,IAAI,IAAI,IAAI,EAAEN,MAAMO,QAAQ,GAAG,WAAW,GAAGE,IAAAA,8BAAa,EAACT,MAAMO,QAAQ,EAAE,IAAI,IAAI,IAAI,EAAEP,MAAMQ,MAAM,GAAG,WAAW,GAAGC,IAAAA,8BAAa,EAACT,MAAMQ,MAAM,EAAE,IAAI,IAAI,IAAI,IAAI,IAAI;AAC3X"}
@@ -22,7 +22,9 @@ const useToaster_unstable = (props)=>{
22
22
  const { toastsToRender , isToastVisible , pauseAllToasts , playAllToasts , tryRestoreFocus , closeAllToasts } = (0, _state.useToaster)(rest);
23
23
  const announce = _react.useCallback((message, options)=>announceRef.current(message, options), []);
24
24
  const { dir } = (0, _reactSharedContexts.useFluent_unstable)();
25
- const rootProps = (0, _reactUtilities.getNativeElementProps)('div', rest);
25
+ const rootProps = _reactUtilities.slot.always((0, _reactUtilities.getNativeElementProps)('div', rest), {
26
+ elementType: 'div'
27
+ });
26
28
  const focusableGroupAttr = (0, _reactTabster.useFocusableGroup)({
27
29
  tabBehavior: 'limited-trap-focus',
28
30
  ignoreDefaultKeydown: {
@@ -41,7 +43,7 @@ const useToaster_unstable = (props)=>{
41
43
  var _toastsToRender_get;
42
44
  const focusManagementRef = (0, _useToasterFocusManagement.useToasterFocusManagement_unstable)(pauseAllToasts, playAllToasts);
43
45
  const { announceToast , toasterRef } = (0, _useToastAnnounce.useToastAnnounce)(announceProp !== null && announceProp !== void 0 ? announceProp : announce);
44
- return (0, _reactUtilities.resolveShorthand)(toastsToRender.has(toastPosition) ? rootProps : null, {
46
+ return _reactUtilities.slot.optional(toastsToRender.has(toastPosition) ? rootProps : null, {
45
47
  defaultProps: {
46
48
  ref: (0, _reactUtilities.useMergedRefs)(focusManagementRef, toasterRef),
47
49
  children: (_toastsToRender_get = toastsToRender.get(toastPosition)) === null || _toastsToRender_get === void 0 ? void 0 : _toastsToRender_get.map((toast)=>/*#__PURE__*/ _react.createElement(_toastContainer.ToastContainer, {
@@ -56,7 +58,8 @@ const useToaster_unstable = (props)=>{
56
58
  ...focusableGroupAttr,
57
59
  'data-toaster-position': toastPosition,
58
60
  role: 'list'
59
- }
61
+ },
62
+ elementType: 'div'
60
63
  });
61
64
  };
62
65
  return {
@@ -68,8 +71,8 @@ const useToaster_unstable = (props)=>{
68
71
  topStart: 'div',
69
72
  topEnd: 'div'
70
73
  },
71
- root: (0, _reactUtilities.resolveShorthand)(rootProps, {
72
- required: true
74
+ root: _reactUtilities.slot.always(rootProps, {
75
+ elementType: 'div'
73
76
  }),
74
77
  bottomStart: usePositionSlot(_state.TOAST_POSITIONS.bottomStart),
75
78
  bottomEnd: usePositionSlot(_state.TOAST_POSITIONS.bottomEnd),
@@ -1 +1 @@
1
- {"version":3,"sources":["useToaster.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { Escape } from '@fluentui/keyboard-keys';\nimport { TOAST_POSITIONS, useToaster } from '../../state';\nimport { ToastContainer } from '../ToastContainer';\nimport { useToasterFocusManagement_unstable } from './useToasterFocusManagement';\nimport { useToastAnnounce } from './useToastAnnounce';\n/**\n * Create the state required to render Toaster.\n *\n * @param props - props from this instance of Toaster\n */ export const useToaster_unstable = (props)=>{\n const { offset , announce: announceProp , ...rest } = props;\n const announceRef = React.useRef(()=>null);\n const { toastsToRender , isToastVisible , pauseAllToasts , playAllToasts , tryRestoreFocus , closeAllToasts } = useToaster(rest);\n const announce = React.useCallback((message, options)=>announceRef.current(message, options), []);\n const { dir } = useFluent();\n const rootProps = getNativeElementProps('div', rest);\n const focusableGroupAttr = useFocusableGroup({\n tabBehavior: 'limited-trap-focus',\n ignoreDefaultKeydown: {\n Escape: true\n }\n });\n const onKeyDown = useEventCallback((e)=>{\n var _props_onKeyDown;\n if (e.key === Escape) {\n e.preventDefault();\n closeAllToasts();\n }\n (_props_onKeyDown = props.onKeyDown) === null || _props_onKeyDown === void 0 ? void 0 : _props_onKeyDown.call(props, e);\n });\n const usePositionSlot = (toastPosition)=>{\n var _toastsToRender_get;\n const focusManagementRef = useToasterFocusManagement_unstable(pauseAllToasts, playAllToasts);\n const { announceToast , toasterRef } = useToastAnnounce(announceProp !== null && announceProp !== void 0 ? announceProp : announce);\n return resolveShorthand(toastsToRender.has(toastPosition) ? rootProps : null, {\n defaultProps: {\n ref: useMergedRefs(focusManagementRef, toasterRef),\n children: (_toastsToRender_get = toastsToRender.get(toastPosition)) === null || _toastsToRender_get === void 0 ? void 0 : _toastsToRender_get.map((toast)=>/*#__PURE__*/ React.createElement(ToastContainer, {\n ...toast,\n tryRestoreFocus: tryRestoreFocus,\n intent: toast.intent,\n announce: announceToast,\n key: toast.toastId,\n visible: isToastVisible(toast.toastId)\n }, toast.content)),\n onKeyDown,\n ...focusableGroupAttr,\n 'data-toaster-position': toastPosition,\n role: 'list'\n }\n });\n };\n return {\n dir,\n components: {\n root: 'div',\n bottomStart: 'div',\n bottomEnd: 'div',\n topStart: 'div',\n topEnd: 'div'\n },\n root: resolveShorthand(rootProps, {\n required: true\n }),\n bottomStart: usePositionSlot(TOAST_POSITIONS.bottomStart),\n bottomEnd: usePositionSlot(TOAST_POSITIONS.bottomEnd),\n topStart: usePositionSlot(TOAST_POSITIONS.topStart),\n topEnd: usePositionSlot(TOAST_POSITIONS.topEnd),\n announceRef,\n offset,\n announce: announceProp !== null && announceProp !== void 0 ? announceProp : announce,\n renderAriaLive: !announceProp\n };\n};\n"],"names":["useToaster_unstable","props","offset","announce","announceProp","rest","announceRef","React","useRef","toastsToRender","isToastVisible","pauseAllToasts","playAllToasts","tryRestoreFocus","closeAllToasts","useToaster","useCallback","message","options","current","dir","useFluent","rootProps","getNativeElementProps","focusableGroupAttr","useFocusableGroup","tabBehavior","ignoreDefaultKeydown","Escape","onKeyDown","useEventCallback","e","_props_onKeyDown","key","preventDefault","call","usePositionSlot","toastPosition","_toastsToRender_get","focusManagementRef","useToasterFocusManagement_unstable","announceToast","toasterRef","useToastAnnounce","resolveShorthand","has","defaultProps","ref","useMergedRefs","children","get","map","toast","createElement","ToastContainer","intent","toastId","visible","content","role","components","root","bottomStart","bottomEnd","topStart","topEnd","required","TOAST_POSITIONS","renderAriaLive"],"mappings":";;;;+BAaiBA;;aAAAA;;;6DAbM;gCACkE;qCACzC;8BACd;8BACX;uBACqB;gCACb;2CACoB;kCAClB;AAKtB,MAAMA,sBAAsB,CAACC,QAAQ;IAC5C,MAAM,EAAEC,OAAM,EAAGC,UAAUC,aAAY,EAAG,GAAGC,MAAM,GAAGJ;IACtD,MAAMK,cAAcC,OAAMC,MAAM,CAAC,IAAI,IAAI;IACzC,MAAM,EAAEC,eAAc,EAAGC,eAAc,EAAGC,eAAc,EAAGC,cAAa,EAAGC,gBAAe,EAAGC,eAAc,EAAG,GAAGC,IAAAA,iBAAU,EAACV;IAC5H,MAAMF,WAAWI,OAAMS,WAAW,CAAC,CAACC,SAASC,UAAUZ,YAAYa,OAAO,CAACF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ClBC,SAAS/C,eAAe0C,MAAMI,OAAO;oBACzC,GAAGJ,MAAMM,OAAO,EAAE;gBACtB7B;gBACA,GAAGL,kBAAkB;gBACrB,yBAAyBa;gBACzBsB,MAAM;YACV;QACJ;IACJ;IACA,OAAO;QACHvC;QACAwC,YAAY;YACRC,MAAM;YACNC,aAAa;YACbC,WAAW;YACXC,UAAU;YACVC,QAAQ;QACZ;QACAJ,MAAMjB,IAAAA,gCAAgB,EAACtB,WAAW;YAC9B4C,UAAU,IAAI;QAClB;QACAJ,aAAa1B,gBAAgB+B,sBAAe,CAACL,WAAW;QACxDC,WAAW3B,gBAAgB+B,sBAAe,CAACJ,SAAS;QACpDC,UAAU5B,gBAAgB+B,sBAAe,CAACH,QAAQ;QAClDC,QAAQ7B,gBAAgB+B,sBAAe,CAACF,MAAM;QAC9C3D;QACAJ;QACAC,UAAUC,iBAAiB,IAAI,IAAIA,iBAAiB,KAAK,IAAIA,eAAeD,QAAQ;QACpFiE,gBAAgB,CAAChE;IACrB;AACJ"}
1
+ {"version":3,"sources":["useToaster.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useEventCallback, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { Escape } from '@fluentui/keyboard-keys';\nimport { TOAST_POSITIONS, useToaster } from '../../state';\nimport { ToastContainer } from '../ToastContainer';\nimport { useToasterFocusManagement_unstable } from './useToasterFocusManagement';\nimport { useToastAnnounce } from './useToastAnnounce';\n/**\n * Create the state required to render Toaster.\n *\n * @param props - props from this instance of Toaster\n */ export const useToaster_unstable = (props)=>{\n const { offset , announce: announceProp , ...rest } = props;\n const announceRef = React.useRef(()=>null);\n const { toastsToRender , isToastVisible , pauseAllToasts , playAllToasts , tryRestoreFocus , closeAllToasts } = useToaster(rest);\n const announce = React.useCallback((message, options)=>announceRef.current(message, options), []);\n const { dir } = useFluent();\n const rootProps = slot.always(getNativeElementProps('div', rest), {\n elementType: 'div'\n });\n const focusableGroupAttr = useFocusableGroup({\n tabBehavior: 'limited-trap-focus',\n ignoreDefaultKeydown: {\n Escape: true\n }\n });\n const onKeyDown = useEventCallback((e)=>{\n var _props_onKeyDown;\n if (e.key === Escape) {\n e.preventDefault();\n closeAllToasts();\n }\n (_props_onKeyDown = props.onKeyDown) === null || _props_onKeyDown === void 0 ? void 0 : _props_onKeyDown.call(props, e);\n });\n const usePositionSlot = (toastPosition)=>{\n var _toastsToRender_get;\n const focusManagementRef = useToasterFocusManagement_unstable(pauseAllToasts, playAllToasts);\n const { announceToast , toasterRef } = useToastAnnounce(announceProp !== null && announceProp !== void 0 ? announceProp : announce);\n return slot.optional(toastsToRender.has(toastPosition) ? rootProps : null, {\n defaultProps: {\n ref: useMergedRefs(focusManagementRef, toasterRef),\n children: (_toastsToRender_get = toastsToRender.get(toastPosition)) === null || _toastsToRender_get === void 0 ? void 0 : _toastsToRender_get.map((toast)=>/*#__PURE__*/ React.createElement(ToastContainer, {\n ...toast,\n tryRestoreFocus: tryRestoreFocus,\n intent: toast.intent,\n announce: announceToast,\n key: toast.toastId,\n visible: isToastVisible(toast.toastId)\n }, toast.content)),\n onKeyDown,\n ...focusableGroupAttr,\n 'data-toaster-position': toastPosition,\n role: 'list'\n },\n elementType: 'div'\n });\n };\n return {\n dir,\n components: {\n root: 'div',\n bottomStart: 'div',\n bottomEnd: 'div',\n topStart: 'div',\n topEnd: 'div'\n },\n root: slot.always(rootProps, {\n elementType: 'div'\n }),\n bottomStart: usePositionSlot(TOAST_POSITIONS.bottomStart),\n bottomEnd: usePositionSlot(TOAST_POSITIONS.bottomEnd),\n topStart: usePositionSlot(TOAST_POSITIONS.topStart),\n topEnd: usePositionSlot(TOAST_POSITIONS.topEnd),\n announceRef,\n offset,\n announce: announceProp !== null && announceProp !== void 0 ? announceProp : announce,\n renderAriaLive: !announceProp\n };\n};\n"],"names":["useToaster_unstable","props","offset","announce","announceProp","rest","announceRef","React","useRef","toastsToRender","isToastVisible","pauseAllToasts","playAllToasts","tryRestoreFocus","closeAllToasts","useToaster","useCallback","message","options","current","dir","useFluent","rootProps","slot","always","getNativeElementProps","elementType","focusableGroupAttr","useFocusableGroup","tabBehavior","ignoreDefaultKeydown","Escape","onKeyDown","useEventCallback","e","_props_onKeyDown","key","preventDefault","call","usePositionSlot","toastPosition","_toastsToRender_get","focusManagementRef","useToasterFocusManagement_unstable","announceToast","toasterRef","useToastAnnounce","optional","has","defaultProps","ref","useMergedRefs","children","get","map","toast","createElement","ToastContainer","intent","toastId","visible","content","role","components","root","bottomStart","bottomEnd","topStart","topEnd","TOAST_POSITIONS","renderAriaLive"],"mappings":";;;;+BAaiBA;;aAAAA;;;6DAbM;gCACsD;qCAC7B;8BACd;8BACX;uBACqB;gCACb;2CACoB;kCAClB;AAKtB,MAAMA,sBAAsB,CAACC,QAAQ;IAC5C,MAAM,EAAEC,OAAM,EAAGC,UAAUC,aAAY,EAAG,GAAGC,MAAM,GAAGJ;IACtD,MAAMK,cAAcC,OAAMC,MAAM,CAAC,IAAI,IAAI;IACzC,MAAM,EAAEC,eAAc,EAAGC,eAAc,EAAGC,eAAc,EAAGC,cAAa,EAAGC,gBAAe,EAAGC,eAAc,EAAG,GAAGC,IAAAA,iBAAU,EAACV;IAC5H,MAAMF,WAAWI,OAAMS,WAAW,CAAC,CAACC,SAASC,UAAUZ,YAAYa,OAAO,CAACF,SAASC,UAAU,EAAE;IAChG,MAAM,EAAEE,IAAG,EAAG,GAAGC,IAAAA,uCAAS;IAC1B,MAAMC,YAAYC,oBAAI,CAACC,MAAM,CAACC,IAAAA,qCAAqB,EAAC,OAAOpB,OAAO;QAC9DqB,aAAa;IACjB;IACA,MAAMC,qBAAqBC,IAAAA,+BAAiB,EAAC;QACzCC,aAAa;QACbC,sBAAsB;YAClBC,QAAQ,IAAI;QAChB;IACJ;IACA,MAAMC,YAAYC,IAAAA,gCAAgB,EAAC,CAACC,IAAI;QACpC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AACC,MAAM,CAACF,WAAW;YACzBI,aAAa;QACjB;QACAuC,aAAa1B,gBAAgB8B,sBAAe,CAACJ,WAAW;QACxDC,WAAW3B,gBAAgB8B,sBAAe,CAACH,SAAS;QACpDC,UAAU5B,gBAAgB8B,sBAAe,CAACF,QAAQ;QAClDC,QAAQ7B,gBAAgB8B,sBAAe,CAACD,MAAM;QAC9C9D;QACAJ;QACAC,UAAUC,iBAAiB,IAAI,IAAIA,iBAAiB,KAAK,IAAIA,eAAeD,QAAQ;QACpFmE,gBAAgB,CAAClE;IACrB;AACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-toast",
3
- "version": "9.1.0",
3
+ "version": "9.1.1",
4
4
  "description": "Toast component for Fluent UI",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -37,15 +37,15 @@
37
37
  "dependencies": {
38
38
  "react-transition-group": "^4.4.1",
39
39
  "@fluentui/keyboard-keys": "^9.0.3",
40
- "@fluentui/react-aria": "^9.3.28",
40
+ "@fluentui/react-aria": "^9.3.29",
41
41
  "@fluentui/react-icons": "^2.0.207",
42
- "@fluentui/react-jsx-runtime": "9.0.0-alpha.13",
43
- "@fluentui/react-portal": "^9.3.5",
44
- "@fluentui/react-shared-contexts": "^9.7.1",
45
- "@fluentui/react-tabster": "^9.12.0",
46
- "@fluentui/react-theme": "^9.1.10",
42
+ "@fluentui/react-jsx-runtime": "9.0.0-alpha.14",
43
+ "@fluentui/react-portal": "^9.3.6",
44
+ "@fluentui/react-shared-contexts": "^9.7.2",
45
+ "@fluentui/react-tabster": "^9.12.1",
46
+ "@fluentui/react-theme": "^9.1.11",
47
47
  "@fluentui/react-utilities": "^9.11.0",
48
- "@griffel/react": "^1.5.7",
48
+ "@griffel/react": "^1.5.14",
49
49
  "@swc/helpers": "^0.4.14"
50
50
  },
51
51
  "peerDependencies": {