@fluentui/react-toast 9.8.1 → 9.8.3
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.
- package/CHANGELOG.md +31 -2
- package/dist/index.d.cts +640 -0
- package/lib/AriaLive.js +1 -1
- package/lib/AriaLive.js.map +1 -1
- package/lib/Toast.js +1 -1
- package/lib/Toast.js.map +1 -1
- package/lib/ToastBody.js +1 -1
- package/lib/ToastBody.js.map +1 -1
- package/lib/ToastContainer.js +1 -1
- package/lib/ToastContainer.js.map +1 -1
- package/lib/ToastFooter.js +1 -1
- package/lib/ToastFooter.js.map +1 -1
- package/lib/ToastTitle.js +1 -1
- package/lib/ToastTitle.js.map +1 -1
- package/lib/ToastTrigger.js +1 -1
- package/lib/ToastTrigger.js.map +1 -1
- package/lib/Toaster.js +1 -1
- package/lib/Toaster.js.map +1 -1
- package/lib/components/AriaLive/AriaLive.js +3 -3
- package/lib/components/AriaLive/AriaLive.js.map +1 -1
- package/lib/components/AriaLive/index.js +4 -4
- package/lib/components/AriaLive/index.js.map +1 -1
- package/lib/components/AriaLive/renderAriaLive.js +1 -1
- package/lib/components/AriaLive/useAriaLive.js +2 -2
- package/lib/components/AriaLive/useAriaLiveStyles.styles.js +1 -1
- package/lib/components/AriaLive/useAriaLiveStyles.styles.js.map +1 -1
- package/lib/components/AriaLive/useAriaLiveStyles.styles.raw.js +1 -1
- package/lib/components/Timer/Timer.js +2 -2
- package/lib/components/Timer/Timer.js.map +1 -1
- package/lib/components/Timer/index.js +1 -1
- package/lib/components/Timer/index.js.map +1 -1
- package/lib/components/Timer/useTimerStyles.styles.js +1 -1
- package/lib/components/Timer/useTimerStyles.styles.js.map +1 -1
- package/lib/components/Timer/useTimerStyles.styles.raw.js +1 -1
- package/lib/components/Toast/Toast.js +6 -6
- package/lib/components/Toast/Toast.js.map +1 -1
- package/lib/components/Toast/index.js +4 -4
- package/lib/components/Toast/index.js.map +1 -1
- package/lib/components/Toast/renderToast.js +2 -2
- package/lib/components/Toast/useToast.js +2 -2
- package/lib/components/Toast/useToast.js.map +1 -1
- package/lib/components/Toast/useToastStyles.styles.js +2 -2
- package/lib/components/Toast/useToastStyles.styles.js.map +1 -1
- package/lib/components/Toast/useToastStyles.styles.raw.js +2 -2
- package/lib/components/ToastBody/ToastBody.js +5 -5
- package/lib/components/ToastBody/ToastBody.js.map +1 -1
- package/lib/components/ToastBody/index.js +4 -4
- package/lib/components/ToastBody/index.js.map +1 -1
- package/lib/components/ToastBody/renderToastBody.js +1 -1
- package/lib/components/ToastBody/useToastBody.js +3 -3
- package/lib/components/ToastBody/useToastBody.js.map +1 -1
- package/lib/components/ToastBody/useToastBodyStyles.styles.js +2 -2
- package/lib/components/ToastBody/useToastBodyStyles.styles.js.map +1 -1
- package/lib/components/ToastBody/useToastBodyStyles.styles.raw.js +2 -2
- package/lib/components/ToastContainer/ToastContainer.js +6 -6
- package/lib/components/ToastContainer/ToastContainer.js.map +1 -1
- package/lib/components/ToastContainer/index.js +5 -5
- package/lib/components/ToastContainer/index.js.map +1 -1
- package/lib/components/ToastContainer/renderToastContainer.js +3 -3
- package/lib/components/ToastContainer/renderToastContainer.js.map +1 -1
- package/lib/components/ToastContainer/useToastContainer.js +6 -6
- package/lib/components/ToastContainer/useToastContainer.js.map +1 -1
- package/lib/components/ToastContainer/useToastContainerContextValues.js +1 -1
- package/lib/components/ToastContainer/useToastContainerStyles.styles.js +3 -3
- package/lib/components/ToastContainer/useToastContainerStyles.styles.js.map +1 -1
- package/lib/components/ToastContainer/useToastContainerStyles.styles.raw.js +3 -3
- package/lib/components/ToastFooter/ToastFooter.js +5 -5
- package/lib/components/ToastFooter/ToastFooter.js.map +1 -1
- package/lib/components/ToastFooter/index.js +4 -4
- package/lib/components/ToastFooter/index.js.map +1 -1
- package/lib/components/ToastFooter/renderToastFooter.js +1 -1
- package/lib/components/ToastFooter/useToastFooter.js +1 -1
- package/lib/components/ToastFooter/useToastFooterStyles.styles.js +1 -1
- package/lib/components/ToastFooter/useToastFooterStyles.styles.js.map +1 -1
- package/lib/components/ToastFooter/useToastFooterStyles.styles.raw.js +1 -1
- package/lib/components/ToastTitle/ToastTitle.js +5 -5
- package/lib/components/ToastTitle/ToastTitle.js.map +1 -1
- package/lib/components/ToastTitle/index.js +4 -4
- package/lib/components/ToastTitle/index.js.map +1 -1
- package/lib/components/ToastTitle/renderToastTitle.js +1 -1
- package/lib/components/ToastTitle/useToastTitle.js +5 -5
- package/lib/components/ToastTitle/useToastTitle.js.map +1 -1
- package/lib/components/ToastTitle/useToastTitleStyles.styles.js +2 -2
- package/lib/components/ToastTitle/useToastTitleStyles.styles.js.map +1 -1
- package/lib/components/ToastTitle/useToastTitleStyles.styles.raw.js +2 -2
- package/lib/components/ToastTrigger/ToastTrigger.js +2 -2
- package/lib/components/ToastTrigger/ToastTrigger.js.map +1 -1
- package/lib/components/ToastTrigger/index.js +3 -3
- package/lib/components/ToastTrigger/index.js.map +1 -1
- package/lib/components/ToastTrigger/useToastTrigger.js +3 -3
- package/lib/components/ToastTrigger/useToastTrigger.js.map +1 -1
- package/lib/components/Toaster/Toaster.js +4 -4
- package/lib/components/Toaster/Toaster.js.map +1 -1
- package/lib/components/Toaster/index.js +5 -5
- package/lib/components/Toaster/index.js.map +1 -1
- package/lib/components/Toaster/renderToaster.js +3 -3
- package/lib/components/Toaster/renderToaster.js.map +1 -1
- package/lib/components/Toaster/useToastAnnounce.js +2 -2
- package/lib/components/Toaster/useToaster.js +9 -9
- package/lib/components/Toaster/useToaster.js.map +1 -1
- package/lib/components/Toaster/useToasterFocusManagement.js +5 -5
- package/lib/components/Toaster/useToasterFocusManagement.js.map +1 -1
- package/lib/components/Toaster/useToasterStyles.styles.js +2 -2
- package/lib/components/Toaster/useToasterStyles.styles.js.map +1 -1
- package/lib/components/Toaster/useToasterStyles.styles.raw.js +2 -2
- package/lib/components/Toaster/useToasterStyles.styles.raw.js.map +1 -1
- package/lib/contexts/toastContainerContext.js +1 -1
- package/lib/index.js +10 -10
- package/lib/index.js.map +1 -1
- package/lib/state/index.js +4 -4
- package/lib/state/index.js.map +1 -1
- package/lib/state/useToastController.js +3 -3
- package/lib/state/useToastController.js.map +1 -1
- package/lib/state/useToaster.js +5 -5
- package/lib/state/useToaster.js.map +1 -1
- package/lib/state/vanilla/createToaster.js +2 -2
- package/lib/state/vanilla/dismissAllToasts.js +1 -1
- package/lib/state/vanilla/dismissAllToasts.js.map +1 -1
- package/lib/state/vanilla/dismissToast.js +1 -1
- package/lib/state/vanilla/dismissToast.js.map +1 -1
- package/lib/state/vanilla/dispatchToast.js +1 -1
- package/lib/state/vanilla/dispatchToast.js.map +1 -1
- package/lib/state/vanilla/index.js +8 -8
- package/lib/state/vanilla/index.js.map +1 -1
- package/lib/state/vanilla/pauseToast.js +1 -1
- package/lib/state/vanilla/pauseToast.js.map +1 -1
- package/lib/state/vanilla/playToast.js +1 -1
- package/lib/state/vanilla/playToast.js.map +1 -1
- package/lib/state/vanilla/updateToast.js +1 -1
- package/lib/state/vanilla/updateToast.js.map +1 -1
- package/lib-commonjs/{AriaLive.js → AriaLive.cjs} +1 -1
- package/lib-commonjs/{AriaLive.js.map → AriaLive.cjs.map} +1 -1
- package/lib-commonjs/{Toast.js → Toast.cjs} +1 -1
- package/lib-commonjs/{Toast.js.map → Toast.cjs.map} +1 -1
- package/lib-commonjs/{ToastBody.js → ToastBody.cjs} +1 -1
- package/lib-commonjs/{ToastBody.js.map → ToastBody.cjs.map} +1 -1
- package/lib-commonjs/{ToastContainer.js → ToastContainer.cjs} +1 -1
- package/lib-commonjs/{ToastContainer.js.map → ToastContainer.cjs.map} +1 -1
- package/lib-commonjs/{ToastFooter.js → ToastFooter.cjs} +1 -1
- package/lib-commonjs/{ToastFooter.js.map → ToastFooter.cjs.map} +1 -1
- package/lib-commonjs/{ToastTitle.js → ToastTitle.cjs} +1 -1
- package/lib-commonjs/{ToastTitle.js.map → ToastTitle.cjs.map} +1 -1
- package/lib-commonjs/{ToastTrigger.js → ToastTrigger.cjs} +1 -1
- package/lib-commonjs/{ToastTrigger.js.map → ToastTrigger.cjs.map} +1 -1
- package/lib-commonjs/{Toaster.js → Toaster.cjs} +1 -1
- package/lib-commonjs/{Toaster.js.map → Toaster.cjs.map} +1 -1
- package/lib-commonjs/components/AriaLive/{AriaLive.js → AriaLive.cjs} +3 -3
- package/lib-commonjs/components/AriaLive/{AriaLive.js.map → AriaLive.cjs.map} +1 -1
- package/lib-commonjs/components/AriaLive/{index.js → index.cjs} +4 -4
- package/lib-commonjs/components/AriaLive/{index.js.map → index.cjs.map} +1 -1
- package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.cjs.map +1 -0
- package/lib-commonjs/components/Timer/{Timer.js → Timer.cjs} +1 -1
- package/lib-commonjs/components/Timer/{Timer.js.map → Timer.cjs.map} +1 -1
- package/lib-commonjs/components/Timer/{index.js → index.cjs} +1 -1
- package/lib-commonjs/components/Timer/{index.js.map → index.cjs.map} +1 -1
- package/lib-commonjs/components/Timer/useTimerStyles.styles.cjs.map +1 -0
- package/lib-commonjs/components/Toast/{Toast.js → Toast.cjs} +4 -4
- package/lib-commonjs/components/Toast/{Toast.js.map → Toast.cjs.map} +1 -1
- package/lib-commonjs/components/Toast/{index.js → index.cjs} +4 -4
- package/lib-commonjs/components/Toast/{index.js.map → index.cjs.map} +1 -1
- package/lib-commonjs/components/Toast/{useToast.js → useToast.cjs} +1 -1
- package/lib-commonjs/components/Toast/{useToast.js.map → useToast.cjs.map} +1 -1
- package/lib-commonjs/components/Toast/useToastStyles.styles.cjs.map +1 -0
- package/lib-commonjs/components/ToastBody/{ToastBody.js → ToastBody.cjs} +3 -3
- package/lib-commonjs/components/ToastBody/{ToastBody.js.map → ToastBody.cjs.map} +1 -1
- package/lib-commonjs/components/ToastBody/{index.js → index.cjs} +4 -4
- package/lib-commonjs/components/ToastBody/{index.js.map → index.cjs.map} +1 -1
- package/lib-commonjs/components/ToastBody/{useToastBody.js → useToastBody.cjs} +1 -1
- package/lib-commonjs/components/ToastBody/{useToastBody.js.map → useToastBody.cjs.map} +1 -1
- package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.cjs.map +1 -0
- package/lib-commonjs/components/ToastContainer/{ToastContainer.js → ToastContainer.cjs} +4 -4
- package/lib-commonjs/components/ToastContainer/{ToastContainer.js.map → ToastContainer.cjs.map} +1 -1
- package/lib-commonjs/components/ToastContainer/{index.js → index.cjs} +5 -5
- package/lib-commonjs/components/ToastContainer/{index.js.map → index.cjs.map} +1 -1
- package/lib-commonjs/components/ToastContainer/{renderToastContainer.js → renderToastContainer.cjs} +1 -1
- package/lib-commonjs/components/ToastContainer/{renderToastContainer.js.map → renderToastContainer.cjs.map} +1 -1
- package/lib-commonjs/components/ToastContainer/{useToastContainer.js → useToastContainer.cjs} +1 -1
- package/lib-commonjs/components/ToastContainer/{useToastContainer.js.map → useToastContainer.cjs.map} +1 -1
- package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.cjs.map +1 -0
- package/lib-commonjs/components/ToastFooter/{ToastFooter.js → ToastFooter.cjs} +3 -3
- package/lib-commonjs/components/ToastFooter/{ToastFooter.js.map → ToastFooter.cjs.map} +1 -1
- package/lib-commonjs/components/ToastFooter/{index.js → index.cjs} +4 -4
- package/lib-commonjs/components/ToastFooter/{index.js.map → index.cjs.map} +1 -1
- package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.cjs.map +1 -0
- package/lib-commonjs/components/ToastTitle/{ToastTitle.js → ToastTitle.cjs} +3 -3
- package/lib-commonjs/components/ToastTitle/{ToastTitle.js.map → ToastTitle.cjs.map} +1 -1
- package/lib-commonjs/components/ToastTitle/{index.js → index.cjs} +4 -4
- package/lib-commonjs/components/ToastTitle/{index.js.map → index.cjs.map} +1 -1
- package/lib-commonjs/components/ToastTitle/{useToastTitle.js → useToastTitle.cjs} +1 -1
- package/lib-commonjs/components/ToastTitle/{useToastTitle.js.map → useToastTitle.cjs.map} +1 -1
- package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.cjs.map +1 -0
- package/lib-commonjs/components/ToastTrigger/{ToastTrigger.js → ToastTrigger.cjs} +2 -2
- package/lib-commonjs/components/ToastTrigger/{ToastTrigger.js.map → ToastTrigger.cjs.map} +1 -1
- package/lib-commonjs/components/ToastTrigger/{index.js → index.cjs} +3 -3
- package/lib-commonjs/components/ToastTrigger/{index.js.map → index.cjs.map} +1 -1
- package/lib-commonjs/components/ToastTrigger/{useToastTrigger.js → useToastTrigger.cjs} +1 -1
- package/lib-commonjs/components/ToastTrigger/{useToastTrigger.js.map → useToastTrigger.cjs.map} +1 -1
- package/lib-commonjs/components/Toaster/{Toaster.js → Toaster.cjs} +3 -3
- package/lib-commonjs/components/Toaster/{Toaster.js.map → Toaster.cjs.map} +1 -1
- package/lib-commonjs/components/Toaster/{index.js → index.cjs} +5 -5
- package/lib-commonjs/components/Toaster/{index.js.map → index.cjs.map} +1 -1
- package/lib-commonjs/components/Toaster/{renderToaster.js → renderToaster.cjs} +2 -2
- package/lib-commonjs/components/Toaster/{renderToaster.js.map → renderToaster.cjs.map} +1 -1
- package/lib-commonjs/components/Toaster/{useToaster.js → useToaster.cjs} +12 -12
- package/lib-commonjs/components/Toaster/{useToaster.js.map → useToaster.cjs.map} +1 -1
- package/lib-commonjs/components/Toaster/{useToasterFocusManagement.js → useToasterFocusManagement.cjs} +2 -2
- package/lib-commonjs/components/Toaster/{useToasterFocusManagement.js.map → useToasterFocusManagement.cjs.map} +1 -1
- package/lib-commonjs/components/Toaster/{useToasterStyles.styles.js → useToasterStyles.styles.cjs} +1 -1
- package/lib-commonjs/components/Toaster/useToasterStyles.styles.cjs.map +1 -0
- package/lib-commonjs/components/Toaster/{useToasterStyles.styles.raw.js → useToasterStyles.styles.raw.cjs} +1 -1
- package/lib-commonjs/components/Toaster/{useToasterStyles.styles.raw.js.map → useToasterStyles.styles.raw.cjs.map} +1 -1
- package/lib-commonjs/{index.js → index.cjs} +11 -11
- package/lib-commonjs/{index.js.map → index.cjs.map} +1 -1
- package/lib-commonjs/state/{index.js → index.cjs} +5 -5
- package/lib-commonjs/state/{index.js.map → index.cjs.map} +1 -1
- package/lib-commonjs/state/{useToastController.js → useToastController.cjs} +7 -7
- package/lib-commonjs/state/{useToastController.js.map → useToastController.cjs.map} +1 -1
- package/lib-commonjs/state/{useToaster.js → useToaster.cjs} +3 -3
- package/lib-commonjs/state/{useToaster.js.map → useToaster.cjs.map} +1 -1
- package/lib-commonjs/state/vanilla/{dismissAllToasts.js → dismissAllToasts.cjs} +1 -1
- package/lib-commonjs/state/vanilla/{dismissAllToasts.js.map → dismissAllToasts.cjs.map} +1 -1
- package/lib-commonjs/state/vanilla/{dismissToast.js → dismissToast.cjs} +1 -1
- package/lib-commonjs/state/vanilla/{dismissToast.js.map → dismissToast.cjs.map} +1 -1
- package/lib-commonjs/state/vanilla/{dispatchToast.js → dispatchToast.cjs} +1 -1
- package/lib-commonjs/state/vanilla/{dispatchToast.js.map → dispatchToast.cjs.map} +1 -1
- package/lib-commonjs/state/vanilla/{index.js → index.cjs} +8 -8
- package/lib-commonjs/state/vanilla/{index.js.map → index.cjs.map} +1 -1
- package/lib-commonjs/state/vanilla/{pauseToast.js → pauseToast.cjs} +1 -1
- package/lib-commonjs/state/vanilla/{pauseToast.js.map → pauseToast.cjs.map} +1 -1
- package/lib-commonjs/state/vanilla/{playToast.js → playToast.cjs} +1 -1
- package/lib-commonjs/state/vanilla/{playToast.js.map → playToast.cjs.map} +1 -1
- package/lib-commonjs/state/vanilla/{updateToast.js → updateToast.cjs} +1 -1
- package/lib-commonjs/state/vanilla/{updateToast.js.map → updateToast.cjs.map} +1 -1
- package/package.json +23 -17
- package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.js.map +0 -1
- package/lib-commonjs/components/Timer/useTimerStyles.styles.js.map +0 -1
- package/lib-commonjs/components/Toast/useToastStyles.styles.js.map +0 -1
- package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.js.map +0 -1
- package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.js.map +0 -1
- package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.js.map +0 -1
- package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.js.map +0 -1
- package/lib-commonjs/components/Toaster/useToasterStyles.styles.js.map +0 -1
- /package/lib-commonjs/components/AriaLive/{AriaLive.types.js → AriaLive.types.cjs} +0 -0
- /package/lib-commonjs/components/AriaLive/{AriaLive.types.js.map → AriaLive.types.cjs.map} +0 -0
- /package/lib-commonjs/components/AriaLive/{renderAriaLive.js → renderAriaLive.cjs} +0 -0
- /package/lib-commonjs/components/AriaLive/{renderAriaLive.js.map → renderAriaLive.cjs.map} +0 -0
- /package/lib-commonjs/components/AriaLive/{useAriaLive.js → useAriaLive.cjs} +0 -0
- /package/lib-commonjs/components/AriaLive/{useAriaLive.js.map → useAriaLive.cjs.map} +0 -0
- /package/lib-commonjs/components/AriaLive/{useAriaLiveStyles.styles.js → useAriaLiveStyles.styles.cjs} +0 -0
- /package/lib-commonjs/components/AriaLive/{useAriaLiveStyles.styles.raw.js → useAriaLiveStyles.styles.raw.cjs} +0 -0
- /package/lib-commonjs/components/AriaLive/{useAriaLiveStyles.styles.raw.js.map → useAriaLiveStyles.styles.raw.cjs.map} +0 -0
- /package/lib-commonjs/components/Timer/{useTimerStyles.styles.js → useTimerStyles.styles.cjs} +0 -0
- /package/lib-commonjs/components/Timer/{useTimerStyles.styles.raw.js → useTimerStyles.styles.raw.cjs} +0 -0
- /package/lib-commonjs/components/Timer/{useTimerStyles.styles.raw.js.map → useTimerStyles.styles.raw.cjs.map} +0 -0
- /package/lib-commonjs/components/Toast/{Toast.types.js → Toast.types.cjs} +0 -0
- /package/lib-commonjs/components/Toast/{Toast.types.js.map → Toast.types.cjs.map} +0 -0
- /package/lib-commonjs/components/Toast/{renderToast.js → renderToast.cjs} +0 -0
- /package/lib-commonjs/components/Toast/{renderToast.js.map → renderToast.cjs.map} +0 -0
- /package/lib-commonjs/components/Toast/{useToastContextValues.js → useToastContextValues.cjs} +0 -0
- /package/lib-commonjs/components/Toast/{useToastContextValues.js.map → useToastContextValues.cjs.map} +0 -0
- /package/lib-commonjs/components/Toast/{useToastStyles.styles.js → useToastStyles.styles.cjs} +0 -0
- /package/lib-commonjs/components/Toast/{useToastStyles.styles.raw.js → useToastStyles.styles.raw.cjs} +0 -0
- /package/lib-commonjs/components/Toast/{useToastStyles.styles.raw.js.map → useToastStyles.styles.raw.cjs.map} +0 -0
- /package/lib-commonjs/components/ToastBody/{ToastBody.types.js → ToastBody.types.cjs} +0 -0
- /package/lib-commonjs/components/ToastBody/{ToastBody.types.js.map → ToastBody.types.cjs.map} +0 -0
- /package/lib-commonjs/components/ToastBody/{renderToastBody.js → renderToastBody.cjs} +0 -0
- /package/lib-commonjs/components/ToastBody/{renderToastBody.js.map → renderToastBody.cjs.map} +0 -0
- /package/lib-commonjs/components/ToastBody/{useToastBodyStyles.styles.js → useToastBodyStyles.styles.cjs} +0 -0
- /package/lib-commonjs/components/ToastBody/{useToastBodyStyles.styles.raw.js → useToastBodyStyles.styles.raw.cjs} +0 -0
- /package/lib-commonjs/components/ToastBody/{useToastBodyStyles.styles.raw.js.map → useToastBodyStyles.styles.raw.cjs.map} +0 -0
- /package/lib-commonjs/components/ToastContainer/{ToastContainer.types.js → ToastContainer.types.cjs} +0 -0
- /package/lib-commonjs/components/ToastContainer/{ToastContainer.types.js.map → ToastContainer.types.cjs.map} +0 -0
- /package/lib-commonjs/components/ToastContainer/{useToastContainerContextValues.js → useToastContainerContextValues.cjs} +0 -0
- /package/lib-commonjs/components/ToastContainer/{useToastContainerContextValues.js.map → useToastContainerContextValues.cjs.map} +0 -0
- /package/lib-commonjs/components/ToastContainer/{useToastContainerStyles.styles.js → useToastContainerStyles.styles.cjs} +0 -0
- /package/lib-commonjs/components/ToastContainer/{useToastContainerStyles.styles.raw.js → useToastContainerStyles.styles.raw.cjs} +0 -0
- /package/lib-commonjs/components/ToastContainer/{useToastContainerStyles.styles.raw.js.map → useToastContainerStyles.styles.raw.cjs.map} +0 -0
- /package/lib-commonjs/components/ToastFooter/{ToastFooter.types.js → ToastFooter.types.cjs} +0 -0
- /package/lib-commonjs/components/ToastFooter/{ToastFooter.types.js.map → ToastFooter.types.cjs.map} +0 -0
- /package/lib-commonjs/components/ToastFooter/{renderToastFooter.js → renderToastFooter.cjs} +0 -0
- /package/lib-commonjs/components/ToastFooter/{renderToastFooter.js.map → renderToastFooter.cjs.map} +0 -0
- /package/lib-commonjs/components/ToastFooter/{useToastFooter.js → useToastFooter.cjs} +0 -0
- /package/lib-commonjs/components/ToastFooter/{useToastFooter.js.map → useToastFooter.cjs.map} +0 -0
- /package/lib-commonjs/components/ToastFooter/{useToastFooterStyles.styles.js → useToastFooterStyles.styles.cjs} +0 -0
- /package/lib-commonjs/components/ToastFooter/{useToastFooterStyles.styles.raw.js → useToastFooterStyles.styles.raw.cjs} +0 -0
- /package/lib-commonjs/components/ToastFooter/{useToastFooterStyles.styles.raw.js.map → useToastFooterStyles.styles.raw.cjs.map} +0 -0
- /package/lib-commonjs/components/ToastTitle/{ToastTitle.types.js → ToastTitle.types.cjs} +0 -0
- /package/lib-commonjs/components/ToastTitle/{ToastTitle.types.js.map → ToastTitle.types.cjs.map} +0 -0
- /package/lib-commonjs/components/ToastTitle/{renderToastTitle.js → renderToastTitle.cjs} +0 -0
- /package/lib-commonjs/components/ToastTitle/{renderToastTitle.js.map → renderToastTitle.cjs.map} +0 -0
- /package/lib-commonjs/components/ToastTitle/{useToastTitleStyles.styles.js → useToastTitleStyles.styles.cjs} +0 -0
- /package/lib-commonjs/components/ToastTitle/{useToastTitleStyles.styles.raw.js → useToastTitleStyles.styles.raw.cjs} +0 -0
- /package/lib-commonjs/components/ToastTitle/{useToastTitleStyles.styles.raw.js.map → useToastTitleStyles.styles.raw.cjs.map} +0 -0
- /package/lib-commonjs/components/ToastTrigger/{ToastTrigger.types.js → ToastTrigger.types.cjs} +0 -0
- /package/lib-commonjs/components/ToastTrigger/{ToastTrigger.types.js.map → ToastTrigger.types.cjs.map} +0 -0
- /package/lib-commonjs/components/ToastTrigger/{renderToastTrigger.js → renderToastTrigger.cjs} +0 -0
- /package/lib-commonjs/components/ToastTrigger/{renderToastTrigger.js.map → renderToastTrigger.cjs.map} +0 -0
- /package/lib-commonjs/components/Toaster/{Toaster.types.js → Toaster.types.cjs} +0 -0
- /package/lib-commonjs/components/Toaster/{Toaster.types.js.map → Toaster.types.cjs.map} +0 -0
- /package/lib-commonjs/components/Toaster/{useToastAnnounce.js → useToastAnnounce.cjs} +0 -0
- /package/lib-commonjs/components/Toaster/{useToastAnnounce.js.map → useToastAnnounce.cjs.map} +0 -0
- /package/lib-commonjs/contexts/{toastContainerContext.js → toastContainerContext.cjs} +0 -0
- /package/lib-commonjs/contexts/{toastContainerContext.js.map → toastContainerContext.cjs.map} +0 -0
- /package/lib-commonjs/state/{constants.js → constants.cjs} +0 -0
- /package/lib-commonjs/state/{constants.js.map → constants.cjs.map} +0 -0
- /package/lib-commonjs/state/{types.js → types.cjs} +0 -0
- /package/lib-commonjs/state/{types.js.map → types.cjs.map} +0 -0
- /package/lib-commonjs/state/vanilla/{createToaster.js → createToaster.cjs} +0 -0
- /package/lib-commonjs/state/vanilla/{createToaster.js.map → createToaster.cjs.map} +0 -0
- /package/lib-commonjs/state/vanilla/{getPositionStyles.js → getPositionStyles.cjs} +0 -0
- /package/lib-commonjs/state/vanilla/{getPositionStyles.js.map → getPositionStyles.cjs.map} +0 -0
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "useToastController", {
|
|
|
12
12
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
13
13
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
14
14
|
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
|
15
|
-
const
|
|
15
|
+
const _index = require("./vanilla/index.cjs");
|
|
16
16
|
const noop = ()=>undefined;
|
|
17
17
|
function useToastController(toasterId) {
|
|
18
18
|
const { targetDocument } = (0, _reactsharedcontexts.useFluent_unstable)();
|
|
@@ -29,7 +29,7 @@ function useToastController(toasterId) {
|
|
|
29
29
|
}
|
|
30
30
|
return {
|
|
31
31
|
dispatchToast: (content, options)=>{
|
|
32
|
-
(0,
|
|
32
|
+
(0, _index.dispatchToast)(content, {
|
|
33
33
|
...options,
|
|
34
34
|
toasterId,
|
|
35
35
|
data: {
|
|
@@ -38,13 +38,13 @@ function useToastController(toasterId) {
|
|
|
38
38
|
}, targetDocument);
|
|
39
39
|
},
|
|
40
40
|
dismissToast: (toastId)=>{
|
|
41
|
-
(0,
|
|
41
|
+
(0, _index.dismissToast)(toastId, toasterId, targetDocument);
|
|
42
42
|
},
|
|
43
43
|
dismissAllToasts: ()=>{
|
|
44
|
-
(0,
|
|
44
|
+
(0, _index.dismissAllToasts)(toasterId, targetDocument);
|
|
45
45
|
},
|
|
46
46
|
updateToast: (options)=>{
|
|
47
|
-
(0,
|
|
47
|
+
(0, _index.updateToast)({
|
|
48
48
|
...options,
|
|
49
49
|
data: {
|
|
50
50
|
root: options.root
|
|
@@ -53,10 +53,10 @@ function useToastController(toasterId) {
|
|
|
53
53
|
}, targetDocument);
|
|
54
54
|
},
|
|
55
55
|
pauseToast: (toastId)=>{
|
|
56
|
-
(0,
|
|
56
|
+
(0, _index.pauseToast)(toastId, toasterId, targetDocument);
|
|
57
57
|
},
|
|
58
58
|
playToast: (toastId)=>{
|
|
59
|
-
(0,
|
|
59
|
+
(0, _index.playToast)(toastId, toasterId, targetDocument);
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
}, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/state/useToastController.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport {\n dispatchToast as dispatchToastVanilla,\n dismissToast as dismissToastVanilla,\n dismissAllToasts as dismissAllToastsVanilla,\n updateToast as updateToastVanilla,\n playToast as playToastVanilla,\n pauseToast as pauseToastVanilla,\n} from './vanilla';\nimport type { DispatchToastOptions, ToastId, ToasterId, UpdateToastOptions } from './types';\n\nconst noop = () => undefined;\n\n/**\n * @param toasterId - If an id is provided all imperative methods control that specific toaster\n * @returns Imperative methods to control toasts\n */\nexport function useToastController(toasterId?: ToasterId): {\n dispatchToast: (content: React.ReactNode, options?: DispatchToastOptions) => void;\n dismissToast: (toastId: ToastId) => void;\n dismissAllToasts: () => void;\n updateToast: (options: UpdateToastOptions) => void;\n pauseToast: (toastId: ToastId) => void;\n playToast: (toastId: ToastId) => void;\n} {\n const { targetDocument } = useFluent();\n\n return React.useMemo(() => {\n if (!targetDocument) {\n return {\n dispatchToast: noop,\n dismissToast: noop,\n dismissAllToasts: noop,\n updateToast: noop,\n pauseToast: noop,\n playToast: noop,\n };\n }\n\n return {\n dispatchToast: (content: React.ReactNode, options?: DispatchToastOptions) => {\n dispatchToastVanilla(content, { ...options, toasterId, data: { root: options?.root } }, targetDocument);\n },\n dismissToast: (toastId: ToastId) => {\n dismissToastVanilla(toastId, toasterId, targetDocument);\n },\n dismissAllToasts: () => {\n dismissAllToastsVanilla(toasterId, targetDocument);\n },\n updateToast: (options: UpdateToastOptions) => {\n updateToastVanilla({ ...options, data: { root: options.root }, toasterId }, targetDocument);\n },\n pauseToast: (toastId: ToastId) => {\n pauseToastVanilla(toastId, toasterId, targetDocument);\n },\n playToast: (toastId: ToastId) => {\n playToastVanilla(toastId, toasterId, targetDocument);\n },\n };\n }, [targetDocument, toasterId]);\n}\n"],"names":["React","useFluent_unstable","useFluent","dispatchToast","dispatchToastVanilla","dismissToast","dismissToastVanilla","dismissAllToasts","dismissAllToastsVanilla","updateToast","updateToastVanilla","playToast","playToastVanilla","pauseToast","pauseToastVanilla","noop","undefined","useToastController","toasterId","targetDocument","useMemo","content","options","data","root","toastId"],"mappings":"AAAA;;;;;+BAoBgBiB;;;;;;;iEAlBO,QAAQ;qCACiB,kCAAkC;
|
|
1
|
+
{"version":3,"sources":["../src/state/useToastController.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport {\n dispatchToast as dispatchToastVanilla,\n dismissToast as dismissToastVanilla,\n dismissAllToasts as dismissAllToastsVanilla,\n updateToast as updateToastVanilla,\n playToast as playToastVanilla,\n pauseToast as pauseToastVanilla,\n} from './vanilla';\nimport type { DispatchToastOptions, ToastId, ToasterId, UpdateToastOptions } from './types';\n\nconst noop = () => undefined;\n\n/**\n * @param toasterId - If an id is provided all imperative methods control that specific toaster\n * @returns Imperative methods to control toasts\n */\nexport function useToastController(toasterId?: ToasterId): {\n dispatchToast: (content: React.ReactNode, options?: DispatchToastOptions) => void;\n dismissToast: (toastId: ToastId) => void;\n dismissAllToasts: () => void;\n updateToast: (options: UpdateToastOptions) => void;\n pauseToast: (toastId: ToastId) => void;\n playToast: (toastId: ToastId) => void;\n} {\n const { targetDocument } = useFluent();\n\n return React.useMemo(() => {\n if (!targetDocument) {\n return {\n dispatchToast: noop,\n dismissToast: noop,\n dismissAllToasts: noop,\n updateToast: noop,\n pauseToast: noop,\n playToast: noop,\n };\n }\n\n return {\n dispatchToast: (content: React.ReactNode, options?: DispatchToastOptions) => {\n dispatchToastVanilla(content, { ...options, toasterId, data: { root: options?.root } }, targetDocument);\n },\n dismissToast: (toastId: ToastId) => {\n dismissToastVanilla(toastId, toasterId, targetDocument);\n },\n dismissAllToasts: () => {\n dismissAllToastsVanilla(toasterId, targetDocument);\n },\n updateToast: (options: UpdateToastOptions) => {\n updateToastVanilla({ ...options, data: { root: options.root }, toasterId }, targetDocument);\n },\n pauseToast: (toastId: ToastId) => {\n pauseToastVanilla(toastId, toasterId, targetDocument);\n },\n playToast: (toastId: ToastId) => {\n playToastVanilla(toastId, toasterId, targetDocument);\n },\n };\n }, [targetDocument, toasterId]);\n}\n"],"names":["React","useFluent_unstable","useFluent","dispatchToast","dispatchToastVanilla","dismissToast","dismissToastVanilla","dismissAllToasts","dismissAllToastsVanilla","updateToast","updateToastVanilla","playToast","playToastVanilla","pauseToast","pauseToastVanilla","noop","undefined","useToastController","toasterId","targetDocument","useMemo","content","options","data","root","toastId"],"mappings":"AAAA;;;;;+BAoBgBiB;;;;;;;iEAlBO,QAAQ;qCACiB,kCAAkC;uBAQ3E,qBAAY;AAGnB,MAAMF,OAAO,IAAMC;AAMZ,4BAA4BE,SAAqB;IAQtD,MAAM,EAAEC,cAAc,EAAE,OAAGjB,uCAAAA;IAE3B,OAAOF,OAAMoB,OAAO,CAAC;QACnB,IAAI,CAACD,gBAAgB;YACnB,OAAO;gBACLhB,eAAeY;gBACfV,cAAcU;gBACdR,kBAAkBQ;gBAClBN,aAAaM;gBACbF,YAAYE;gBACZJ,WAAWI;YACb;QACF;QAEA,OAAO;YACLZ,eAAe,CAACkB,SAA0BC;oBACxClB,oBAAAA,EAAqBiB,SAAS;oBAAE,GAAGC,OAAO;oBAAEJ;oBAAWK,MAAM;wBAAEC,IAAI,EAAEF,YAAAA,QAAAA,YAAAA,KAAAA,IAAAA,KAAAA,IAAAA,QAASE,IAAI;oBAAC;gBAAE,GAAGL;YAC1F;YACAd,cAAc,CAACoB;gBACbnB,uBAAAA,EAAoBmB,SAASP,WAAWC;YAC1C;YACAZ,kBAAkB;oBAChBC,uBAAAA,EAAwBU,WAAWC;YACrC;YACAV,aAAa,CAACa;oBACZZ,kBAAAA,EAAmB;oBAAE,GAAGY,OAAO;oBAAEC,MAAM;wBAAEC,MAAMF,QAAQE,IAAI;oBAAC;oBAAGN;gBAAU,GAAGC;YAC9E;YACAN,YAAY,CAACY;oBACXX,iBAAAA,EAAkBW,SAASP,WAAWC;YACxC;YACAR,WAAW,CAACc;oBACVb,gBAAAA,EAAiBa,SAASP,WAAWC;YACvC;QACF;IACF,GAAG;QAACA;QAAgBD;KAAU;AAChC"}
|
|
@@ -13,13 +13,13 @@ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildc
|
|
|
13
13
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
14
14
|
const _reactutilities = require("@fluentui/react-utilities");
|
|
15
15
|
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
|
16
|
-
const
|
|
17
|
-
const _constants = require("./constants");
|
|
16
|
+
const _index = require("./vanilla/index.cjs");
|
|
17
|
+
const _constants = require("./constants.cjs");
|
|
18
18
|
function useToaster(options = {}) {
|
|
19
19
|
const forceUpdate = (0, _reactutilities.useForceUpdate)();
|
|
20
20
|
const { toasterId: userToasterId, shortcuts } = options;
|
|
21
21
|
// Currently the toaster options can never be changed at runtime
|
|
22
|
-
const [toaster] = _react.useState(()=>(0,
|
|
22
|
+
const [toaster] = _react.useState(()=>(0, _index.createToaster)(options));
|
|
23
23
|
const { targetDocument } = (0, _reactsharedcontexts.useFluent_unstable)();
|
|
24
24
|
const lastActiveElementRef = _react.useRef(null);
|
|
25
25
|
const isCorrectToaster = (0, _reactutilities.useEventCallback)((toasterId)=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/state/useToaster.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { isHTMLElement, useEventCallback, useForceUpdate } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { createToaster } from './vanilla';\nimport type {\n CommonToastDetail,\n ShowToastEventDetail,\n Toast,\n ToastId,\n ToastListenerMap,\n ToastPosition,\n ToasterId,\n ToasterOptions,\n} from './types';\nimport { EVENTS } from './constants';\n\nexport function useToaster<TElement extends HTMLElement = HTMLDivElement>(\n options: Partial<ToasterOptions> = {},\n): {\n isToastVisible: (toastId: ToastId) => boolean;\n toastsToRender: Map<ToastPosition, Toast[]>;\n pauseAllToasts: () => void;\n playAllToasts: () => void;\n tryRestoreFocus: () => void;\n closeAllToasts: () => void;\n} {\n const forceUpdate = useForceUpdate();\n const { toasterId: userToasterId, shortcuts } = options;\n // Currently the toaster options can never be changed at runtime\n const [toaster] = React.useState(() => createToaster(options));\n const { targetDocument } = useFluent();\n\n const lastActiveElementRef = React.useRef<HTMLElement | null>(null);\n\n const isCorrectToaster = useEventCallback((toasterId: ToasterId | undefined) => {\n return toasterId === userToasterId;\n });\n\n const isFocusShortcut = useEventCallback((e: KeyboardEvent) => {\n if (shortcuts?.focus) {\n return shortcuts.focus(e);\n }\n });\n\n const pauseAllToasts = React.useCallback(() => {\n toaster.visibleToasts.forEach(toastId => {\n const toast = toaster.toasts.get(toastId);\n toast?.imperativeRef.current?.pause();\n });\n }, [toaster]);\n\n const playAllToasts = React.useCallback(() => {\n toaster.visibleToasts.forEach(toastId => {\n const toast = toaster.toasts.get(toastId);\n toast?.imperativeRef.current?.play();\n });\n }, [toaster]);\n\n const getMostRecentVisibleToast = React.useCallback(() => {\n return Array.from(toaster.visibleToasts).reduce((cur, next) => {\n const toast = toaster.toasts.get(next);\n if (!toast) {\n return cur;\n }\n\n if (!cur) {\n return toast;\n }\n\n if (cur.order < toast?.order) {\n return toast;\n }\n\n return cur;\n }, undefined as Toast | undefined);\n }, [toaster]);\n\n const tryRestoreFocus = React.useCallback(() => {\n const mostRecentToast = getMostRecentVisibleToast();\n if (mostRecentToast?.imperativeRef.current) {\n mostRecentToast.imperativeRef.current.focus();\n } else {\n lastActiveElementRef.current?.focus();\n lastActiveElementRef.current = null;\n }\n }, [getMostRecentVisibleToast]);\n\n const closeAllToasts = React.useCallback(() => {\n toaster.visibleToasts.forEach(toastId => {\n const toast = toaster.toasts.get(toastId);\n toast?.close();\n });\n\n tryRestoreFocus();\n }, [toaster, tryRestoreFocus]);\n\n React.useEffect(() => {\n if (!targetDocument) {\n return;\n }\n\n const addToastListener = <TType extends keyof ToastListenerMap>(\n eventType: TType,\n callback: ToastListenerMap[TType],\n ) => {\n const listener: ToastListenerMap[TType] = (e: CustomEvent<CommonToastDetail>) => {\n if (!isCorrectToaster(e.detail.toasterId)) {\n return;\n }\n\n callback(e as CustomEvent<ShowToastEventDetail>);\n forceUpdate();\n };\n\n targetDocument.addEventListener(eventType, listener as () => void);\n return () => targetDocument.removeEventListener(eventType, listener as () => void);\n };\n\n const buildToast: ToastListenerMap[typeof EVENTS.show] = e => {\n toaster.buildToast(e.detail, forceUpdate);\n };\n\n const dismissToast: ToastListenerMap[typeof EVENTS.dismiss] = e => {\n toaster.dismissToast(e.detail.toastId);\n };\n\n const updateToast: ToastListenerMap[typeof EVENTS.update] = e => {\n toaster.updateToast(e.detail);\n };\n\n const dismissAllToasts: ToastListenerMap[typeof EVENTS.dismissAll] = e => {\n toaster.dismissAllToasts();\n };\n\n const pauseToast: ToastListenerMap[typeof EVENTS.pause] = e => {\n const toast = toaster.toasts.get(e.detail.toastId);\n if (toast) {\n toast.imperativeRef.current?.pause();\n }\n };\n\n const playToast: ToastListenerMap[typeof EVENTS.play] = e => {\n const toast = toaster.toasts.get(e.detail.toastId);\n if (toast) {\n toast.imperativeRef.current?.play();\n }\n };\n\n const cleanupBuildListener = addToastListener(EVENTS.show, buildToast);\n const cleanupUpdateListener = addToastListener(EVENTS.update, updateToast);\n const cleanupDismissListener = addToastListener(EVENTS.dismiss, dismissToast);\n const cleanupDismissAllListener = addToastListener(EVENTS.dismissAll, dismissAllToasts);\n const cleanupPauseListener = addToastListener(EVENTS.pause, pauseToast);\n const cleanupPlayListener = addToastListener(EVENTS.play, playToast);\n\n const focusShortcutListener = (e: KeyboardEvent) => {\n if (isFocusShortcut(e)) {\n pauseAllToasts();\n const mostRecentToast = getMostRecentVisibleToast();\n\n if (mostRecentToast) {\n lastActiveElementRef.current = isHTMLElement(targetDocument.activeElement)\n ? targetDocument.activeElement\n : null;\n mostRecentToast.imperativeRef.current?.focus();\n }\n }\n };\n\n targetDocument.addEventListener('keydown', focusShortcutListener);\n\n return () => {\n cleanupBuildListener();\n cleanupDismissAllListener();\n cleanupUpdateListener();\n cleanupDismissListener();\n cleanupPauseListener();\n cleanupPlayListener();\n\n targetDocument.removeEventListener('keydown', focusShortcutListener);\n };\n }, [\n toaster,\n forceUpdate,\n targetDocument,\n isCorrectToaster,\n pauseAllToasts,\n getMostRecentVisibleToast,\n isFocusShortcut,\n ]);\n\n const toastsToRender = (() => {\n if (!toaster) {\n return new Map<ToastPosition, Toast[]>();\n }\n\n const toRender = new Map<ToastPosition, Toast[]>();\n const toasts = Array.from(toaster.toasts.values());\n\n toasts.forEach(toast => {\n const { position } = toast;\n toRender.has(position) || toRender.set(position, []);\n if (position.startsWith('bottom')) {\n toRender.get(position)!.push(toast);\n } else {\n toRender.get(position)!.unshift(toast);\n }\n });\n\n return toRender;\n })();\n\n return {\n isToastVisible: toaster.isToastVisible,\n toastsToRender,\n pauseAllToasts,\n playAllToasts,\n tryRestoreFocus,\n closeAllToasts,\n };\n}\n"],"names":["React","isHTMLElement","useEventCallback","useForceUpdate","useFluent_unstable","useFluent","createToaster","EVENTS","useToaster","options","forceUpdate","toasterId","userToasterId","shortcuts","toaster","useState","targetDocument","lastActiveElementRef","useRef","isCorrectToaster","isFocusShortcut","e","focus","pauseAllToasts","useCallback","visibleToasts","forEach","toastId","toast","toasts","get","imperativeRef","current","pause","playAllToasts","play","getMostRecentVisibleToast","Array","from","reduce","cur","next","order","undefined","tryRestoreFocus","mostRecentToast","closeAllToasts","close","useEffect","addToastListener","eventType","callback","listener","detail","addEventListener","removeEventListener","buildToast","dismissToast","updateToast","dismissAllToasts","pauseToast","playToast","cleanupBuildListener","show","cleanupUpdateListener","update","cleanupDismissListener","dismiss","cleanupDismissAllListener","dismissAll","cleanupPauseListener","cleanupPlayListener","focusShortcutListener","activeElement","toastsToRender","Map","toRender","values","position","has","set","startsWith","push","unshift","isToastVisible"],"mappings":"AAAA;;;;;+BAkBgBQ;;;;;;;iEAhBO,QAAQ;gCACiC,4BAA4B;qCAC5C,kCAAkC;yBACpD,YAAY;2BAWnB,cAAc;AAE9B,oBACLC,UAAmC,CAAC,CAAC;IASrC,MAAMC,kBAAcP,8BAAAA;IACpB,MAAM,EAAEQ,WAAWC,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OAAOgD;KACT,CAAA;IAEA,OAAO;QACLQ,gBAAgBtE,QAAQsE,cAAc;QACtCV;QACAnD;QACAW;QACAU;QACAE;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../src/state/useToaster.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { isHTMLElement, useEventCallback, useForceUpdate } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { createToaster } from './vanilla';\nimport type {\n CommonToastDetail,\n ShowToastEventDetail,\n Toast,\n ToastId,\n ToastListenerMap,\n ToastPosition,\n ToasterId,\n ToasterOptions,\n} from './types';\nimport { EVENTS } from './constants';\n\nexport function useToaster<TElement extends HTMLElement = HTMLDivElement>(\n options: Partial<ToasterOptions> = {},\n): {\n isToastVisible: (toastId: ToastId) => boolean;\n toastsToRender: Map<ToastPosition, Toast[]>;\n pauseAllToasts: () => void;\n playAllToasts: () => void;\n tryRestoreFocus: () => void;\n closeAllToasts: () => void;\n} {\n const forceUpdate = useForceUpdate();\n const { toasterId: userToasterId, shortcuts } = options;\n // Currently the toaster options can never be changed at runtime\n const [toaster] = React.useState(() => createToaster(options));\n const { targetDocument } = useFluent();\n\n const lastActiveElementRef = React.useRef<HTMLElement | null>(null);\n\n const isCorrectToaster = useEventCallback((toasterId: ToasterId | undefined) => {\n return toasterId === userToasterId;\n });\n\n const isFocusShortcut = useEventCallback((e: KeyboardEvent) => {\n if (shortcuts?.focus) {\n return shortcuts.focus(e);\n }\n });\n\n const pauseAllToasts = React.useCallback(() => {\n toaster.visibleToasts.forEach(toastId => {\n const toast = toaster.toasts.get(toastId);\n toast?.imperativeRef.current?.pause();\n });\n }, [toaster]);\n\n const playAllToasts = React.useCallback(() => {\n toaster.visibleToasts.forEach(toastId => {\n const toast = toaster.toasts.get(toastId);\n toast?.imperativeRef.current?.play();\n });\n }, [toaster]);\n\n const getMostRecentVisibleToast = React.useCallback(() => {\n return Array.from(toaster.visibleToasts).reduce((cur, next) => {\n const toast = toaster.toasts.get(next);\n if (!toast) {\n return cur;\n }\n\n if (!cur) {\n return toast;\n }\n\n if (cur.order < toast?.order) {\n return toast;\n }\n\n return cur;\n }, undefined as Toast | undefined);\n }, [toaster]);\n\n const tryRestoreFocus = React.useCallback(() => {\n const mostRecentToast = getMostRecentVisibleToast();\n if (mostRecentToast?.imperativeRef.current) {\n mostRecentToast.imperativeRef.current.focus();\n } else {\n lastActiveElementRef.current?.focus();\n lastActiveElementRef.current = null;\n }\n }, [getMostRecentVisibleToast]);\n\n const closeAllToasts = React.useCallback(() => {\n toaster.visibleToasts.forEach(toastId => {\n const toast = toaster.toasts.get(toastId);\n toast?.close();\n });\n\n tryRestoreFocus();\n }, [toaster, tryRestoreFocus]);\n\n React.useEffect(() => {\n if (!targetDocument) {\n return;\n }\n\n const addToastListener = <TType extends keyof ToastListenerMap>(\n eventType: TType,\n callback: ToastListenerMap[TType],\n ) => {\n const listener: ToastListenerMap[TType] = (e: CustomEvent<CommonToastDetail>) => {\n if (!isCorrectToaster(e.detail.toasterId)) {\n return;\n }\n\n callback(e as CustomEvent<ShowToastEventDetail>);\n forceUpdate();\n };\n\n targetDocument.addEventListener(eventType, listener as () => void);\n return () => targetDocument.removeEventListener(eventType, listener as () => void);\n };\n\n const buildToast: ToastListenerMap[typeof EVENTS.show] = e => {\n toaster.buildToast(e.detail, forceUpdate);\n };\n\n const dismissToast: ToastListenerMap[typeof EVENTS.dismiss] = e => {\n toaster.dismissToast(e.detail.toastId);\n };\n\n const updateToast: ToastListenerMap[typeof EVENTS.update] = e => {\n toaster.updateToast(e.detail);\n };\n\n const dismissAllToasts: ToastListenerMap[typeof EVENTS.dismissAll] = e => {\n toaster.dismissAllToasts();\n };\n\n const pauseToast: ToastListenerMap[typeof EVENTS.pause] = e => {\n const toast = toaster.toasts.get(e.detail.toastId);\n if (toast) {\n toast.imperativeRef.current?.pause();\n }\n };\n\n const playToast: ToastListenerMap[typeof EVENTS.play] = e => {\n const toast = toaster.toasts.get(e.detail.toastId);\n if (toast) {\n toast.imperativeRef.current?.play();\n }\n };\n\n const cleanupBuildListener = addToastListener(EVENTS.show, buildToast);\n const cleanupUpdateListener = addToastListener(EVENTS.update, updateToast);\n const cleanupDismissListener = addToastListener(EVENTS.dismiss, dismissToast);\n const cleanupDismissAllListener = addToastListener(EVENTS.dismissAll, dismissAllToasts);\n const cleanupPauseListener = addToastListener(EVENTS.pause, pauseToast);\n const cleanupPlayListener = addToastListener(EVENTS.play, playToast);\n\n const focusShortcutListener = (e: KeyboardEvent) => {\n if (isFocusShortcut(e)) {\n pauseAllToasts();\n const mostRecentToast = getMostRecentVisibleToast();\n\n if (mostRecentToast) {\n lastActiveElementRef.current = isHTMLElement(targetDocument.activeElement)\n ? targetDocument.activeElement\n : null;\n mostRecentToast.imperativeRef.current?.focus();\n }\n }\n };\n\n targetDocument.addEventListener('keydown', focusShortcutListener);\n\n return () => {\n cleanupBuildListener();\n cleanupDismissAllListener();\n cleanupUpdateListener();\n cleanupDismissListener();\n cleanupPauseListener();\n cleanupPlayListener();\n\n targetDocument.removeEventListener('keydown', focusShortcutListener);\n };\n }, [\n toaster,\n forceUpdate,\n targetDocument,\n isCorrectToaster,\n pauseAllToasts,\n getMostRecentVisibleToast,\n isFocusShortcut,\n ]);\n\n const toastsToRender = (() => {\n if (!toaster) {\n return new Map<ToastPosition, Toast[]>();\n }\n\n const toRender = new Map<ToastPosition, Toast[]>();\n const toasts = Array.from(toaster.toasts.values());\n\n toasts.forEach(toast => {\n const { position } = toast;\n toRender.has(position) || toRender.set(position, []);\n if (position.startsWith('bottom')) {\n toRender.get(position)!.push(toast);\n } else {\n toRender.get(position)!.unshift(toast);\n }\n });\n\n return toRender;\n })();\n\n return {\n isToastVisible: toaster.isToastVisible,\n toastsToRender,\n pauseAllToasts,\n playAllToasts,\n tryRestoreFocus,\n closeAllToasts,\n };\n}\n"],"names":["React","isHTMLElement","useEventCallback","useForceUpdate","useFluent_unstable","useFluent","createToaster","EVENTS","useToaster","options","forceUpdate","toasterId","userToasterId","shortcuts","toaster","useState","targetDocument","lastActiveElementRef","useRef","isCorrectToaster","isFocusShortcut","e","focus","pauseAllToasts","useCallback","visibleToasts","forEach","toastId","toast","toasts","get","imperativeRef","current","pause","playAllToasts","play","getMostRecentVisibleToast","Array","from","reduce","cur","next","order","undefined","tryRestoreFocus","mostRecentToast","closeAllToasts","close","useEffect","addToastListener","eventType","callback","listener","detail","addEventListener","removeEventListener","buildToast","dismissToast","updateToast","dismissAllToasts","pauseToast","playToast","cleanupBuildListener","show","cleanupUpdateListener","update","cleanupDismissListener","dismiss","cleanupDismissAllListener","dismissAll","cleanupPauseListener","cleanupPlayListener","focusShortcutListener","activeElement","toastsToRender","Map","toRender","values","position","has","set","startsWith","push","unshift","isToastVisible"],"mappings":"AAAA;;;;;+BAkBgBQ;;;;;;;iEAhBO,QAAQ;gCACiC,4BAA4B;qCAC5C,kCAAkC;uBACpD,qBAAY;2BAWnB,iBAAc;AAE9B,oBACLC,UAAmC,CAAC,CAAC;IASrC,MAAMC,kBAAcP,8BAAAA;IACpB,MAAM,EAAEQ,WAAWC,aAAa,EAAEC,SAAS,EAAE,GAAGJ;IAChD,gEAAgE;IAChE,MAAM,CAACK,QAAQ,GAAGd,OAAMe,QAAQ,CAAC,QAAMT,oBAAAA,EAAcG;IACrD,MAAM,EAAEO,cAAc,EAAE,OAAGX,uCAAAA;IAE3B,MAAMY,uBAAuBjB,OAAMkB,MAAM,CAAqB;IAE9D,MAAMC,uBAAmBjB,gCAAAA,EAAiB,CAACS;QACzC,OAAOA,cAAcC;IACvB;IAEA,MAAMQ,sBAAkBlB,gCAAAA,EAAiB,CAACmB;QACxC,IAAIR,cAAAA,QAAAA,cAAAA,KAAAA,IAAAA,KAAAA,IAAAA,UAAWS,KAAK,EAAE;YACpB,OAAOT,UAAUS,KAAK,CAACD;QACzB;IACF;IAEA,MAAME,iBAAiBvB,OAAMwB,WAAW,CAAC;QACvCV,QAAQW,aAAa,CAACC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K;gBAC9C;YACF;QACF;QAEAN,eAAesC,gBAAgB,CAAC,WAAWkB;QAE3C,OAAO;YACLV;YACAM;YACAJ;YACAE;YACAI;YACAC;YAEAvD,eAAeuC,mBAAmB,CAAC,WAAWiB;QAChD;IACF,GAAG;QACD1D;QACAJ;QACAM;QACAG;QACAI;QACAa;QACAhB;KACD;IAED,MAAMsD,iBAAkB,CAAA;QACtB,IAAI,CAAC5D,SAAS;YACZ,OAAO,IAAI6D;QACb;QAEA,MAAMC,WAAW,IAAID;QACrB,MAAM9C,SAASQ,MAAMC,IAAI,CAACxB,QAAQe,MAAM,CAACgD,MAAM;QAE/ChD,OAAOH,OAAO,CAACE,CAAAA;YACb,MAAM,EAAEkD,QAAQ,EAAE,GAAGlD;YACrBgD,SAASG,GAAG,CAACD,aAAaF,SAASI,GAAG,CAACF,UAAU,EAAE;YACnD,IAAIA,SAASG,UAAU,CAAC,WAAW;gBACjCL,SAAS9C,GAAG,CAACgD,UAAWI,IAAI,CAACtD;YAC/B,OAAO;gBACLgD,SAAS9C,GAAG,CAACgD,UAAWK,OAAO,CAACvD;YAClC;QACF;QAEA,OAAOgD;KACT,CAAA;IAEA,OAAO;QACLQ,gBAAgBtE,QAAQsE,cAAc;QACtCV;QACAnD;QACAW;QACAU;QACAE;IACF;AACF"}
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "dismissAllToasts", {
|
|
|
8
8
|
return dismissAllToasts;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _constants = require("../constants");
|
|
11
|
+
const _constants = require("../constants.cjs");
|
|
12
12
|
function dismissAllToasts(toasterId = undefined, targetDocument) {
|
|
13
13
|
const event = new CustomEvent(_constants.EVENTS.dismissAll, {
|
|
14
14
|
bubbles: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/state/vanilla/dismissAllToasts.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport type { DismissAllToastsEventDetail, ToasterId } from '../types';\n\nexport function dismissAllToasts(toasterId: ToasterId | undefined = undefined, targetDocument: Document): void {\n const event = new CustomEvent<DismissAllToastsEventDetail>(EVENTS.dismissAll, {\n bubbles: false,\n cancelable: false,\n detail: { toasterId },\n });\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","dismissAllToasts","toasterId","undefined","targetDocument","event","CustomEvent","dismissAll","bubbles","cancelable","detail","dispatchEvent"],"mappings":";;;;+BAGgBC;;;;;;2BAHO,
|
|
1
|
+
{"version":3,"sources":["../src/state/vanilla/dismissAllToasts.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport type { DismissAllToastsEventDetail, ToasterId } from '../types';\n\nexport function dismissAllToasts(toasterId: ToasterId | undefined = undefined, targetDocument: Document): void {\n const event = new CustomEvent<DismissAllToastsEventDetail>(EVENTS.dismissAll, {\n bubbles: false,\n cancelable: false,\n detail: { toasterId },\n });\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","dismissAllToasts","toasterId","undefined","targetDocument","event","CustomEvent","dismissAll","bubbles","cancelable","detail","dispatchEvent"],"mappings":";;;;+BAGgBC;;;;;;2BAHO,kBAAe;AAG/B,0BAA0BC,YAAmCC,SAAS,EAAEC,cAAwB;IACrG,MAAMC,QAAQ,IAAIC,YAAyCN,iBAAAA,CAAOO,UAAU,EAAE;QAC5EC,SAAS;QACTC,YAAY;QACZC,QAAQ;YAAER;QAAU;IACtB;IACAE,eAAeO,aAAa,CAACN;AAC/B"}
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "dismissToast", {
|
|
|
8
8
|
return dismissToast;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _constants = require("../constants");
|
|
11
|
+
const _constants = require("../constants.cjs");
|
|
12
12
|
function dismissToast(toastId, toasterId = undefined, targetDocument) {
|
|
13
13
|
const event = new CustomEvent(_constants.EVENTS.dismiss, {
|
|
14
14
|
bubbles: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/state/vanilla/dismissToast.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport type { DismissToastEventDetail, ToastId, ToasterId } from '../types';\n\nexport function dismissToast(\n toastId: ToastId,\n toasterId: ToasterId | undefined = undefined,\n targetDocument: Document,\n): void {\n const event = new CustomEvent<DismissToastEventDetail>(EVENTS.dismiss, {\n bubbles: false,\n cancelable: false,\n detail: { toastId, toasterId },\n });\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","dismissToast","toastId","toasterId","undefined","targetDocument","event","CustomEvent","dismiss","bubbles","cancelable","detail","dispatchEvent"],"mappings":";;;;+BAGgBC;;;;;;2BAHO,
|
|
1
|
+
{"version":3,"sources":["../src/state/vanilla/dismissToast.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport type { DismissToastEventDetail, ToastId, ToasterId } from '../types';\n\nexport function dismissToast(\n toastId: ToastId,\n toasterId: ToasterId | undefined = undefined,\n targetDocument: Document,\n): void {\n const event = new CustomEvent<DismissToastEventDetail>(EVENTS.dismiss, {\n bubbles: false,\n cancelable: false,\n detail: { toastId, toasterId },\n });\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","dismissToast","toastId","toasterId","undefined","targetDocument","event","CustomEvent","dismiss","bubbles","cancelable","detail","dispatchEvent"],"mappings":";;;;+BAGgBC;;;;;;2BAHO,kBAAe;AAG/B,sBACLC,OAAgB,EAChBC,YAAmCC,SAAS,EAC5CC,cAAwB;IAExB,MAAMC,QAAQ,IAAIC,YAAqCP,iBAAAA,CAAOQ,OAAO,EAAE;QACrEC,SAAS;QACTC,YAAY;QACZC,QAAQ;YAAET;YAASC;QAAU;IAC/B;IACAE,eAAeO,aAAa,CAACN;AAC/B"}
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "dispatchToast", {
|
|
|
8
8
|
return dispatchToast;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _constants = require("../constants");
|
|
11
|
+
const _constants = require("../constants.cjs");
|
|
12
12
|
let counter = 0;
|
|
13
13
|
function dispatchToast(content, options = {}, targetDocument) {
|
|
14
14
|
var _options_toastId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/state/vanilla/dispatchToast.ts"],"sourcesContent":["import type { ShowToastEventDetail, ToastOptions } from '../types';\nimport { EVENTS } from '../constants';\n\nlet counter = 0;\n\nexport function dispatchToast(content: unknown, options: Partial<ToastOptions> = {}, targetDocument: Document): void {\n const detail: ShowToastEventDetail = {\n ...options,\n content,\n toastId: options.toastId ?? (counter++).toString(),\n };\n const event = new CustomEvent<ShowToastEventDetail>(EVENTS.show, {\n bubbles: false,\n cancelable: false,\n detail,\n });\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","counter","dispatchToast","content","options","targetDocument","detail","toastId","toString","event","CustomEvent","show","bubbles","cancelable","dispatchEvent"],"mappings":";;;;+BAKgBE;;;;;;2BAJO,
|
|
1
|
+
{"version":3,"sources":["../src/state/vanilla/dispatchToast.ts"],"sourcesContent":["import type { ShowToastEventDetail, ToastOptions } from '../types';\nimport { EVENTS } from '../constants';\n\nlet counter = 0;\n\nexport function dispatchToast(content: unknown, options: Partial<ToastOptions> = {}, targetDocument: Document): void {\n const detail: ShowToastEventDetail = {\n ...options,\n content,\n toastId: options.toastId ?? (counter++).toString(),\n };\n const event = new CustomEvent<ShowToastEventDetail>(EVENTS.show, {\n bubbles: false,\n cancelable: false,\n detail,\n });\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","counter","dispatchToast","content","options","targetDocument","detail","toastId","toString","event","CustomEvent","show","bubbles","cancelable","dispatchEvent"],"mappings":";;;;+BAKgBE;;;;;;2BAJO,kBAAe;AAEtC,IAAID,UAAU;AAEP,uBAAuBE,OAAgB,EAAEC,UAAiC,CAAC,CAAC,EAAEC,cAAwB;QAIhGD;IAHX,MAAME,SAA+B;QACnC,GAAGF,OAAO;QACVD;QACAI,SAASH,CAAAA,mBAAAA,QAAQG,OAAAA,AAAO,MAAA,QAAfH,qBAAAA,KAAAA,IAAAA,mBAAoBH,CAAAA,SAAAA,CAAQ,CAAGO,QAAQ;IAClD;IACA,MAAMC,QAAQ,IAAIC,YAAkCV,iBAAAA,CAAOW,IAAI,EAAE;QAC/DC,SAAS;QACTC,YAAY;QACZP;IACF;IACAD,eAAeS,aAAa,CAACL;AAC/B"}
|
|
@@ -34,11 +34,11 @@ _export(exports, {
|
|
|
34
34
|
return _updateToast.updateToast;
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
|
-
const _dispatchToast = require("./dispatchToast");
|
|
38
|
-
const _dismissToast = require("./dismissToast");
|
|
39
|
-
const _dismissAllToasts = require("./dismissAllToasts");
|
|
40
|
-
const _updateToast = require("./updateToast");
|
|
41
|
-
const _pauseToast = require("./pauseToast");
|
|
42
|
-
const _playToast = require("./playToast");
|
|
43
|
-
const _createToaster = require("./createToaster");
|
|
44
|
-
const _getPositionStyles = require("./getPositionStyles");
|
|
37
|
+
const _dispatchToast = require("./dispatchToast.cjs");
|
|
38
|
+
const _dismissToast = require("./dismissToast.cjs");
|
|
39
|
+
const _dismissAllToasts = require("./dismissAllToasts.cjs");
|
|
40
|
+
const _updateToast = require("./updateToast.cjs");
|
|
41
|
+
const _pauseToast = require("./pauseToast.cjs");
|
|
42
|
+
const _playToast = require("./playToast.cjs");
|
|
43
|
+
const _createToaster = require("./createToaster.cjs");
|
|
44
|
+
const _getPositionStyles = require("./getPositionStyles.cjs");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/state/vanilla/index.ts"],"sourcesContent":["export { dispatchToast } from './dispatchToast';\nexport { dismissToast } from './dismissToast';\nexport { dismissAllToasts } from './dismissAllToasts';\nexport { updateToast } from './updateToast';\nexport { pauseToast } from './pauseToast';\nexport { playToast } from './playToast';\nexport { createToaster } from './createToaster';\nexport { getPositionStyles } from './getPositionStyles';\n"],"names":["dispatchToast","dismissToast","dismissAllToasts","updateToast","pauseToast","playToast","createToaster","getPositionStyles"],"mappings":";;;;;;;;;;;IAMSM;2CAAa;;;eAJbJ,kCAAgB;;;eADhBD,0BAAY;;;eADZD,4BAAa;;;eAObO,oCAAiB;;cAHP;eAAVH;;;eACAC,oBAAS;;;eAFTF,wBAAW;;;+BAHU,
|
|
1
|
+
{"version":3,"sources":["../src/state/vanilla/index.ts"],"sourcesContent":["export { dispatchToast } from './dispatchToast';\nexport { dismissToast } from './dismissToast';\nexport { dismissAllToasts } from './dismissAllToasts';\nexport { updateToast } from './updateToast';\nexport { pauseToast } from './pauseToast';\nexport { playToast } from './playToast';\nexport { createToaster } from './createToaster';\nexport { getPositionStyles } from './getPositionStyles';\n"],"names":["dispatchToast","dismissToast","dismissAllToasts","updateToast","pauseToast","playToast","createToaster","getPositionStyles"],"mappings":";;;;;;;;;;;IAMSM;2CAAa;;;eAJbJ,kCAAgB;;;eADhBD,0BAAY;;;eADZD,4BAAa;;;eAObO,oCAAiB;;cAHP;eAAVH;;;eACAC,oBAAS;;;eAFTF,wBAAW;;;+BAHU,qBAAkB;8BACnB,oBAAiB;kCACb,wBAAqB;6BAC1B,mBAAgB;4BACjB,kBAAe;2BAChB,iBAAc;+BACV,qBAAkB;mCACd,yBAAsB"}
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "pauseToast", {
|
|
|
8
8
|
return pauseToast;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _constants = require("../constants");
|
|
11
|
+
const _constants = require("../constants.cjs");
|
|
12
12
|
function pauseToast(toastId, toasterId = undefined, targetDocument) {
|
|
13
13
|
const event = new CustomEvent(_constants.EVENTS.pause, {
|
|
14
14
|
bubbles: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/state/vanilla/pauseToast.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport type { PauseToastEventDetail, ToastId, ToasterId } from '../types';\n\nexport function pauseToast(\n toastId: ToastId,\n toasterId: ToasterId | undefined = undefined,\n targetDocument: Document,\n): void {\n const event = new CustomEvent<PauseToastEventDetail>(EVENTS.pause, {\n bubbles: false,\n cancelable: false,\n detail: { toastId, toasterId },\n });\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","pauseToast","toastId","toasterId","undefined","targetDocument","event","CustomEvent","pause","bubbles","cancelable","detail","dispatchEvent"],"mappings":";;;;+BAGgBC;;;;;;2BAHO,
|
|
1
|
+
{"version":3,"sources":["../src/state/vanilla/pauseToast.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport type { PauseToastEventDetail, ToastId, ToasterId } from '../types';\n\nexport function pauseToast(\n toastId: ToastId,\n toasterId: ToasterId | undefined = undefined,\n targetDocument: Document,\n): void {\n const event = new CustomEvent<PauseToastEventDetail>(EVENTS.pause, {\n bubbles: false,\n cancelable: false,\n detail: { toastId, toasterId },\n });\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","pauseToast","toastId","toasterId","undefined","targetDocument","event","CustomEvent","pause","bubbles","cancelable","detail","dispatchEvent"],"mappings":";;;;+BAGgBC;;;;;;2BAHO,kBAAe;AAG/B,oBACLC,OAAgB,EAChBC,YAAmCC,SAAS,EAC5CC,cAAwB;IAExB,MAAMC,QAAQ,IAAIC,YAAmCP,iBAAAA,CAAOQ,KAAK,EAAE;QACjEC,SAAS;QACTC,YAAY;QACZC,QAAQ;YAAET;YAASC;QAAU;IAC/B;IACAE,eAAeO,aAAa,CAACN;AAC/B"}
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "playToast", {
|
|
|
8
8
|
return playToast;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _constants = require("../constants");
|
|
11
|
+
const _constants = require("../constants.cjs");
|
|
12
12
|
function playToast(toastId, toasterId = undefined, targetDocument) {
|
|
13
13
|
const event = new CustomEvent(_constants.EVENTS.play, {
|
|
14
14
|
bubbles: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/state/vanilla/playToast.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport type { PlayToastEventDetail, ToastId, ToasterId } from '../types';\n\nexport function playToast(\n toastId: ToastId,\n toasterId: ToasterId | undefined = undefined,\n targetDocument: Document,\n): void {\n const event = new CustomEvent<PlayToastEventDetail>(EVENTS.play, {\n bubbles: false,\n cancelable: false,\n detail: { toastId, toasterId },\n });\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","playToast","toastId","toasterId","undefined","targetDocument","event","CustomEvent","play","bubbles","cancelable","detail","dispatchEvent"],"mappings":";;;;+BAGgBC;;;;;;2BAHO,
|
|
1
|
+
{"version":3,"sources":["../src/state/vanilla/playToast.ts"],"sourcesContent":["import { EVENTS } from '../constants';\nimport type { PlayToastEventDetail, ToastId, ToasterId } from '../types';\n\nexport function playToast(\n toastId: ToastId,\n toasterId: ToasterId | undefined = undefined,\n targetDocument: Document,\n): void {\n const event = new CustomEvent<PlayToastEventDetail>(EVENTS.play, {\n bubbles: false,\n cancelable: false,\n detail: { toastId, toasterId },\n });\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","playToast","toastId","toasterId","undefined","targetDocument","event","CustomEvent","play","bubbles","cancelable","detail","dispatchEvent"],"mappings":";;;;+BAGgBC;;;;;;2BAHO,kBAAe;AAG/B,mBACLC,OAAgB,EAChBC,YAAmCC,SAAS,EAC5CC,cAAwB;IAExB,MAAMC,QAAQ,IAAIC,YAAkCP,iBAAAA,CAAOQ,IAAI,EAAE;QAC/DC,SAAS;QACTC,YAAY;QACZC,QAAQ;YAAET;YAASC;QAAU;IAC/B;IACAE,eAAeO,aAAa,CAACN;AAC/B"}
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "updateToast", {
|
|
|
8
8
|
return updateToast;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _constants = require("../constants");
|
|
11
|
+
const _constants = require("../constants.cjs");
|
|
12
12
|
function updateToast(options, targetDocument) {
|
|
13
13
|
const event = new CustomEvent(_constants.EVENTS.update, {
|
|
14
14
|
bubbles: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/state/vanilla/updateToast.ts"],"sourcesContent":["import type { UpdateToastEventDetail } from '../types';\nimport { EVENTS } from '../constants';\n\nexport function updateToast(options: UpdateToastEventDetail, targetDocument: Document): void {\n const event = new CustomEvent<UpdateToastEventDetail>(EVENTS.update, {\n bubbles: false,\n cancelable: false,\n detail: options,\n });\n\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","updateToast","options","targetDocument","event","CustomEvent","update","bubbles","cancelable","detail","dispatchEvent"],"mappings":";;;;;;;;;;2BACuB,
|
|
1
|
+
{"version":3,"sources":["../src/state/vanilla/updateToast.ts"],"sourcesContent":["import type { UpdateToastEventDetail } from '../types';\nimport { EVENTS } from '../constants';\n\nexport function updateToast(options: UpdateToastEventDetail, targetDocument: Document): void {\n const event = new CustomEvent<UpdateToastEventDetail>(EVENTS.update, {\n bubbles: false,\n cancelable: false,\n detail: options,\n });\n\n targetDocument.dispatchEvent(event);\n}\n"],"names":["EVENTS","updateToast","options","targetDocument","event","CustomEvent","update","bubbles","cancelable","detail","dispatchEvent"],"mappings":";;;;;;;;;;2BACuB,kBAAe;AAE/B,SAASC,YAAYC,OAA+B,EAAEC,cAAwB;IACnF,MAAMC,QAAQ,IAAIC,YAAoCL,iBAAAA,CAAOM,MAAM,EAAE;QACnEC,SAAS;QACTC,YAAY;QACZC,QAAQP;IACV;IAEAC,eAAeO,aAAa,CAACN;AAC/B"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-toast",
|
|
3
|
-
"version": "9.8.
|
|
3
|
+
"version": "9.8.3",
|
|
4
4
|
"description": "Toast component for Fluent UI",
|
|
5
|
-
"main": "lib-commonjs/index.
|
|
5
|
+
"main": "lib-commonjs/index.cjs",
|
|
6
6
|
"module": "lib/index.js",
|
|
7
7
|
"typings": "./dist/index.d.ts",
|
|
8
8
|
"sideEffects": false,
|
|
@@ -12,17 +12,17 @@
|
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@fluentui/keyboard-keys": "^9.0.
|
|
16
|
-
"@fluentui/react-aria": "^9.17.
|
|
15
|
+
"@fluentui/keyboard-keys": "^9.0.9",
|
|
16
|
+
"@fluentui/react-aria": "^9.17.14",
|
|
17
17
|
"@fluentui/react-icons": "^2.0.245",
|
|
18
|
-
"@fluentui/react-jsx-runtime": "^9.4.
|
|
19
|
-
"@fluentui/react-motion": "^9.16.
|
|
20
|
-
"@fluentui/react-motion-components-preview": "^0.15.
|
|
21
|
-
"@fluentui/react-portal": "^9.8.
|
|
22
|
-
"@fluentui/react-shared-contexts": "^9.26.
|
|
23
|
-
"@fluentui/react-tabster": "^9.26.
|
|
24
|
-
"@fluentui/react-theme": "^9.2.
|
|
25
|
-
"@fluentui/react-utilities": "^9.26.
|
|
18
|
+
"@fluentui/react-jsx-runtime": "^9.4.5",
|
|
19
|
+
"@fluentui/react-motion": "^9.16.3",
|
|
20
|
+
"@fluentui/react-motion-components-preview": "^0.15.8",
|
|
21
|
+
"@fluentui/react-portal": "^9.8.15",
|
|
22
|
+
"@fluentui/react-shared-contexts": "^9.26.3",
|
|
23
|
+
"@fluentui/react-tabster": "^9.26.17",
|
|
24
|
+
"@fluentui/react-theme": "^9.2.2",
|
|
25
|
+
"@fluentui/react-utilities": "^9.26.6",
|
|
26
26
|
"@griffel/react": "^1.5.32",
|
|
27
27
|
"@swc/helpers": "^0.5.1"
|
|
28
28
|
},
|
|
@@ -40,17 +40,23 @@
|
|
|
40
40
|
},
|
|
41
41
|
"exports": {
|
|
42
42
|
".": {
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
"import": {
|
|
44
|
+
"types": "./dist/index.d.ts",
|
|
45
|
+
"default": "./lib/index.js"
|
|
46
|
+
},
|
|
47
|
+
"require": {
|
|
48
|
+
"types": "./dist/index.d.cts",
|
|
49
|
+
"default": "./lib-commonjs/index.cjs"
|
|
50
|
+
}
|
|
47
51
|
},
|
|
48
52
|
"./package.json": "./package.json"
|
|
49
53
|
},
|
|
50
54
|
"files": [
|
|
51
55
|
"*.md",
|
|
52
56
|
"dist/*.d.ts",
|
|
57
|
+
"dist/*.d.cts",
|
|
53
58
|
"lib",
|
|
54
59
|
"lib-commonjs"
|
|
55
|
-
]
|
|
60
|
+
],
|
|
61
|
+
"type": "module"
|
|
56
62
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["useAriaLiveStyles.styles.js"],"sourcesContent":["'use client';\nimport { mergeClasses, makeResetStyles } from '@griffel/react';\nexport const ariaLiveClassNames = {\n assertive: 'fui-AriaLive__assertive',\n polite: 'fui-AriaLive__polite'\n};\n/**\n * Styles for the root slot\n */ const useResetStyles = makeResetStyles({\n clip: 'rect(0px, 0px, 0px, 0px)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0px',\n width: '1px',\n position: 'absolute'\n});\n/**\n * Apply styling to the AriaLive slots based on the state\n */ export const useAriaLiveStyles_unstable = (state)=>{\n const visuallyHidden = useResetStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.assertive.className = mergeClasses(visuallyHidden, ariaLiveClassNames.assertive, state.assertive.className);\n // eslint-disable-next-line react-hooks/immutability\n state.polite.className = mergeClasses(visuallyHidden, ariaLiveClassNames.polite, state.polite.className);\n return state;\n};\n"],"names":["mergeClasses","__resetStyles","ariaLiveClassNames","assertive","polite","useResetStyles","useAriaLiveStyles_unstable","state","visuallyHidden","className"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAECE,kBAAkB;;;IAiBdI,0BAA0B;;;;uBAlBG,gBAAgB;AACvD,2BAA2B;IAC9BH,SAAS,EAAE,yBAAyB;IACpCC,MAAM,EAAE;AACZ,CAAC;AACD;;CAEA,GAAI,MAAMC,cAAc,GAAA,WAAA,OAAGJ,oBAAA,EAAA,WAAA,MAAA;IAAA;CAQ1B,CAAC;AAGS,oCAAoCM,KAAK,IAAG;IACnD,MAAMC,cAAc,GAAGH,cAAc,CAAC,CAAC;IACvC,oDAAA;IACAE,KAAK,CAACJ,SAAS,CAACM,SAAS,OAAGT,mBAAY,EAACQ,cAAc,EAAEN,kBAAkB,CAACC,SAAS,EAAEI,KAAK,CAACJ,SAAS,CAACM,SAAS,CAAC;IACjH,oDAAA;IACAF,KAAK,CAACH,MAAM,CAACK,SAAS,OAAGT,mBAAY,EAACQ,cAAc,EAAEN,kBAAkB,CAACE,MAAM,EAAEG,KAAK,CAACH,MAAM,CAACK,SAAS,CAAC;IACxG,OAAOF,KAAK;AAChB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["useTimerStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles } from '@griffel/react';\nexport const useBaseAnimationStyles = makeResetStyles({\n animationName: {\n from: {\n opacity: 0\n },\n to: {\n opacity: 0\n }\n }\n});\n"],"names":["__resetStyles","useBaseAnimationStyles"],"mappings":"AAAA,YAAY;;;;;;;;;;;uBACoB,gBAAgB;AACzC,MAAMC,sBAAsB,GAAA,WAAA,OAAGD,oBAAA,EAAA,YAAA,WAAA;IAAA;IAAA;IAAA;CASrC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["useToastStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const toastClassNames = {\n root: 'fui-Toast'\n};\nconst useRootBaseClassName = makeResetStyles({\n display: 'grid',\n gridTemplateColumns: 'auto 1fr auto',\n padding: '12px',\n borderRadius: tokens.borderRadiusMedium,\n border: `1px solid ${tokens.colorTransparentStroke}`,\n boxShadow: tokens.shadow8,\n fontSize: tokens.fontSizeBase300,\n lineHeight: '20px',\n fontWeight: tokens.fontWeightSemibold,\n color: tokens.colorNeutralForeground1,\n backgroundColor: tokens.colorNeutralBackground1\n});\nconst useStyles = makeStyles({\n inverted: {\n color: tokens.colorNeutralForegroundInverted2,\n backgroundColor: tokens.colorNeutralBackgroundInverted\n }\n});\n/**\n * Apply styling to the Toast slots based on the state\n */ export const useToastStyles_unstable = (state)=>{\n const rootBaseClassName = useRootBaseClassName();\n const styles = useStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(toastClassNames.root, rootBaseClassName, state.backgroundAppearance === 'inverted' && styles.inverted, state.root.className);\n return state;\n};\n"],"names":["__resetStyles","__styles","mergeClasses","tokens","toastClassNames","root","useRootBaseClassName","useStyles","inverted","sj55zd","De3pzq","d","useToastStyles_unstable","state","rootBaseClassName","styles","className","backgroundAppearance"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAGCI,eAAe;;;IAwBXQ,uBAAuB;;;;uBA1BkB,gBAAgB;AAEnE,wBAAwB;IAC3BP,IAAI,EAAE;AACV,CAAC;AACD,MAAMC,oBAAoB,GAAA,WAAA,OAAGN,oBAAA,EAAA,WAAA,MAAA;IAAA;CAY5B,CAAC;AACF,MAAMO,SAAS,GAAA,WAAA,OAAGN,eAAA,EAAA;IAAAO,QAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;IAAA;AAAA,GAAA;IAAAC,CAAA,EAAA;QAAA;QAAA;KAAA;AAAA,CAKjB,CAAC;AAGS,iCAAiCE,KAAK,IAAG;IAChD,MAAMC,iBAAiB,GAAGR,oBAAoB,CAAC,CAAC;IAChD,MAAMS,MAAM,GAAGR,SAAS,CAAC,CAAC;IAC1B,oDAAA;IACAM,KAAK,CAACR,IAAI,CAACW,SAAS,OAAGd,mBAAY,EAACE,eAAe,CAACC,IAAI,EAAES,iBAAiB,EAAED,KAAK,CAACI,oBAAoB,KAAK,UAAU,IAAIF,MAAM,CAACP,QAAQ,EAAEK,KAAK,CAACR,IAAI,CAACW,SAAS,CAAC;IAChK,OAAOH,KAAK;AAChB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["useToastBodyStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const toastBodyClassNames = {\n root: 'fui-ToastBody',\n subtitle: 'fui-ToastBody__subtitle'\n};\nconst useRootBaseClassName = makeResetStyles({\n gridColumnStart: 2,\n gridColumnEnd: 3,\n paddingTop: '6px',\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n fontWeight: tokens.fontWeightRegular,\n color: tokens.colorNeutralForeground1,\n wordBreak: 'break-word'\n});\nconst useSubtitleBaseClassName = makeResetStyles({\n paddingTop: '4px',\n gridColumnStart: 2,\n gridColumnEnd: 3,\n fontSize: tokens.fontSizeBase200,\n lineHeight: tokens.fontSizeBase200,\n fontWeight: tokens.fontWeightRegular,\n color: tokens.colorNeutralForeground2\n});\nconst useInvertedStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForegroundInverted2\n },\n subtitle: {\n color: tokens.colorNeutralForegroundInverted2\n }\n});\n/**\n * Apply styling to the ToastBody slots based on the state\n */ export const useToastBodyStyles_unstable = (state)=>{\n const rootBaseClassName = useRootBaseClassName();\n const subtitleBaseClassName = useSubtitleBaseClassName();\n const invertedStyles = useInvertedStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(toastBodyClassNames.root, rootBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.root, state.root.className);\n if (state.subtitle) {\n // eslint-disable-next-line react-hooks/immutability\n state.subtitle.className = mergeClasses(toastBodyClassNames.subtitle, subtitleBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.subtitle, state.subtitle.className);\n }\n return state;\n};\n"],"names":["__resetStyles","__styles","mergeClasses","tokens","toastBodyClassNames","root","subtitle","useRootBaseClassName","useSubtitleBaseClassName","useInvertedStyles","sj55zd","d","useToastBodyStyles_unstable","state","rootBaseClassName","sub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AOJ,KAAK;AAChB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["useToastContainerStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, mergeClasses } 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 = makeResetStyles({\n boxSizing: 'border-box',\n marginTop: '16px',\n pointerEvents: 'all',\n borderRadius: tokens.borderRadiusMedium,\n ...createCustomFocusIndicatorStyle({\n outline: `${tokens.strokeWidthThick} solid ${tokens.colorStrokeFocus2}`\n })\n});\n/**\n * Apply styling to the ToastContainer slots based on the state\n */ export const useToastContainerStyles_unstable = (state)=>{\n const rootBaseClassName = useRootBaseClassName();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(toastContainerClassNames.root, rootBaseClassName, state.root.className);\n return state;\n};\n"],"names":["__resetStyles","mergeClasses","tokens","createCustomFocusIndicatorStyle","toastContainerClassNames","root","timer","useRootBaseClassName","useToastContainerStyles_unstable","state","rootBaseClassName","className"],"mappings":"AAAA,YAAY;;;;;;;;;;;;4BAIyB;;;oCAeY;;;;uBAlBH,gBAAgB;AAGvD,MAAMI,2BAA2B;IACpCC,IAAI,EAAE,oBAAoB;IAC1BC,KAAK,EAAE;AACX,CAAC;AACD,MAAMC,oBAAoB,GAAA,WAAA,OAAGP,oBAAA,EAAA,WAAA,MAAA;IAAA;IAAA;CAQ5B,CAAC;AAGS,MAAMQ,oCAAoCC,KAAK,IAAG;IACzD,MAAMC,iBAAiB,GAAGH,oBAAoB,CAAC,CAAC;IAChD,oDAAA;IACAE,KAAK,CAACJ,IAAI,CAACM,SAAS,OAAGV,mBAAY,EAACG,wBAAwB,CAACC,IAAI,EAAEK,iBAAiB,EAAED,KAAK,CAACJ,IAAI,CAACM,SAAS,CAAC;IAC3G,OAAOF,KAAK;AAChB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["useToastFooterStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, mergeClasses } from '@griffel/react';\nexport const toastFooterClassNames = {\n root: 'fui-ToastFooter'\n};\n/**\n * Styles for the root slot\n */ const useRootBaseClassName = makeResetStyles({\n paddingTop: '16px',\n gridColumnStart: 2,\n gridColumnEnd: 3,\n display: 'flex',\n alignItems: 'center',\n gap: '14px'\n});\n/**\n * Apply styling to the ToastFooter slots based on the state\n */ export const useToastFooterStyles_unstable = (state)=>{\n const rootBaseClassName = useRootBaseClassName();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(toastFooterClassNames.root, rootBaseClassName, state.root.className);\n return state;\n};\n"],"names":["__resetStyles","mergeClasses","toastFooterClassNames","root","useRootBaseClassName","useToastFooterStyles_unstable","state","rootBaseClassName","className"],"mappings":"AAAA,YAAY;;;;;;;;;;;;yBAEsB;;;iCAeY;;;;uBAhBA,gBAAgB;AACvD,MAAME,wBAAwB;IACjCC,IAAI,EAAE;AACV,CAAC;AACD;;CAEA,GAAI,MAAMC,oBAAoB,GAAA,WAAA,OAAGJ,oBAAA,EAAA,WAAA,MAAA;IAAA;CAOhC,CAAC;AAGS,MAAMK,iCAAiCC,KAAK,IAAG;IACtD,MAAMC,iBAAiB,GAAGH,oBAAoB,CAAC,CAAC;IAChD,oDAAA;IACAE,KAAK,CAACH,IAAI,CAACK,SAAS,OAAGP,mBAAY,EAACC,qBAAqB,CAACC,IAAI,EAAEI,iBAAiB,EAAED,KAAK,CAACH,IAAI,CAACK,SAAS,CAAC;IACxG,OAAOF,KAAK;AAChB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["useToastTitleStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, makeResetStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const toastTitleClassNames = {\n root: 'fui-ToastTitle',\n media: 'fui-ToastTitle__media',\n action: 'fui-ToastTitle__action'\n};\nconst useRootBaseClassName = makeResetStyles({\n display: 'flex',\n gridColumnEnd: 3,\n color: tokens.colorNeutralForeground1,\n wordBreak: 'break-word'\n});\nconst useMediaBaseClassName = makeResetStyles({\n display: 'flex',\n paddingTop: '2px',\n gridColumnEnd: 2,\n paddingRight: '8px',\n fontSize: '16px',\n color: tokens.colorNeutralForeground1\n});\nconst useActionBaseClassName = makeResetStyles({\n display: 'flex',\n alignItems: 'start',\n paddingLeft: '12px',\n gridColumnEnd: -1,\n color: tokens.colorBrandForeground1\n});\nconst useInvertedStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForegroundInverted2\n },\n action: {\n color: tokens.colorBrandForegroundInverted\n },\n media: {\n color: tokens.colorNeutralForegroundInverted\n }\n});\nconst useIntentIconStyles = makeStyles({\n success: {\n color: tokens.colorStatusSuccessForeground1\n },\n error: {\n color: tokens.colorStatusDangerForeground1\n },\n warning: {\n color: tokens.colorStatusWarningForeground1\n },\n info: {\n color: tokens.colorNeutralForeground2\n }\n});\nconst useIntentIconStylesInverted = makeStyles({\n success: {\n color: tokens.colorStatusSuccessForegroundInverted\n },\n error: {\n color: tokens.colorStatusDangerForegroundInverted\n },\n warning: {\n color: tokens.colorStatusWarningForegroundInverted\n },\n info: {\n color: tokens.colorNeutralForegroundInverted2\n }\n});\n/**\n * Apply styling to the ToastTitle slots based on the state\n */ export const useToastTitleStyles_unstable = (state)=>{\n const rootBaseClassName = useRootBaseClassName();\n const actionBaseClassName = useActionBaseClassName();\n const mediaBaseClassName = useMediaBaseClassName();\n const intentIconStyles = useIntentIconStyles();\n const intentIconStylesInverted = useIntentIconStylesInverted();\n const { intent } = state;\n const invertedStyles = useInvertedStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(toastTitleClassNames.root, rootBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.root, state.root.className);\n if (state.media) {\n // eslint-disable-next-line react-hooks/immutability\n state.media.className = mergeClasses(toastTitleClassNames.media, mediaBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.media, intent && intentIconStyles[intent], intent && state.backgroundAppearance === 'inverted' && intentIconStylesInverted[intent], state.media.className);\n }\n if (state.action) {\n // eslint-disable-next-line react-hooks/immutability\n state.action.className = mergeClasses(toastTitleClassNames.action, actionBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.action, state.action.className);\n }\n return state;\n};\n"],"names":["__styles","__resetStyles","mergeClasses","tokens","toastTitleClassNames","root","media","action","useRootBaseClassName","useMediaBaseClassName","useActionBaseClassName","useInvertedStyles","sj55zd","d","useIntentIconStyles","success","error","warning","info","useIntentIconStylesInverted","useToastTitleStyles_unstable","state","rootBaseClassName","actionBaseClassName","mediaBaseClassName","intentIconStyles","intentIconStylesInverted","intent","invertedStyles","className","backgroundAppearance"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAGCI,oBAAoB;;;gCAmEY;eAA5BgB;;;uBArEyC,gBAAgB;AAEnE,6BAA6B;IAChCf,IAAI,EAAE,gBAAgB;IACtBC,KAAK,EAAE,uBAAuB;IAC9BC,MAAM,EAAE;AACZ,CAAC;AACD,MAAMC,oBAAoB,GAAA,WAAA,OAAGP,oBAAA,EAAA,WAAA,MAAA;IAAA;CAK5B,CAAC;AACF,MAAMQ,qBAAqB,GAAA,WAAA,OAAGR,oBAAA,EAAA,WAAA,YAAA;IAAA;IAAA;CAO7B,CAAC;AACF,MAAMS,sBAAsB,GAAA,WAAA,OAAGT,oBAAA,EAAA,WAAA,WAAA;IAAA;IAAA;CAM9B,CAAC;AACF,MAAMU,iBAAiB,GAAA,WAAA,OAAGX,eAAA,EAAA;IAAAK,IAAA,EAAA;QAAAO,MAAA,EAAA;IAAA;IAAAL,MAAA,EAAA;QAAAK,MAAA,EAAA;IAAA;IAAAN,KAAA,EAAA;QAAAM,MAAA,EAAA;IAAA;AAAA,GAAA;IAAAC,CAA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gB,KAAK,CAAChB,IAAI,CAACwB,SAAS,CAAC;IACzK,IAAIR,KAAK,CAACf,KAAK,EAAE;QACb,oDAAA;QACAe,KAAK,CAACf,KAAK,CAACuB,SAAS,OAAG3B,mBAAY,EAACE,oBAAoB,CAACE,KAAK,EAAEkB,kBAAkB,EAAEH,KAAK,CAACS,oBAAoB,KAAK,UAAU,IAAIF,cAAc,CAACtB,KAAK,EAAEqB,MAAM,IAAIF,gBAAgB,CAACE,MAAM,CAAC,EAAEA,MAAM,IAAIN,KAAK,CAACS,oBAAoB,KAAK,UAAU,IAAIJ,wBAAwB,CAACC,MAAM,CAAC,EAAEN,KAAK,CAACf,KAAK,CAACuB,SAAS,CAAC;IAC/S;IACA,IAAIR,KAAK,CAACd,MAAM,EAAE;QACd,oDAAA;QACAc,KAAK,CAACd,MAAM,CAACsB,SAAS,OAAG3B,mBAAY,EAACE,oBAAoB,CAACG,MAAM,EAAEgB,mBAAmB,EAAEF,KAAK,CAACS,oBAAoB,KAAK,UAAU,IAAIF,cAAc,CAACrB,MAAM,EAAEc,KAAK,CAACd,MAAM,CAACsB,SAAS,CAAC;IACvL;IACA,OAAOR,KAAK;AAChB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["useToasterStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { TOAST_POSITIONS, getPositionStyles } from '../../state/index';\nexport const toasterClassNames = {\n root: 'fui-Toaster'\n};\n/**\n * Styles for the root slot\n */ const useRootBaseClassName = makeResetStyles({\n position: 'fixed',\n width: '292px',\n pointerEvents: 'none'\n});\nconst useToasterStyles = makeStyles({\n inline: {\n position: 'absolute'\n }\n});\n/**\n * Apply styling to the Toaster slots based on the state\n */ export const useToasterStyles_unstable = (state)=>{\n const rootBaseClassName = useRootBaseClassName();\n const styles = useToasterStyles();\n const className = mergeClasses(toasterClassNames.root, rootBaseClassName, state.inline && styles.inline, state.root.className);\n if (state.bottomStart) {\n var _state_bottomStart;\n // eslint-disable-next-line react-hooks/immutability\n state.bottomStart.className = className;\n var _style;\n (_style = (_state_bottomStart = state.bottomStart).style) !== null && _style !== void 0 ? _style : _state_bottomStart.style = {};\n Object.assign(state.bottomStart.style, getPositionStyles(TOAST_POSITIONS.bottomStart, state.dir, state.offset));\n }\n if (state.bottomEnd) {\n var _state_bottomEnd;\n // eslint-disable-next-line react-hooks/immutability\n state.bottomEnd.className = className;\n var _style1;\n (_style1 = (_state_bottomEnd = state.bottomEnd).style) !== null && _style1 !== void 0 ? _style1 : _state_bottomEnd.style = {};\n Object.assign(state.bottomEnd.style, getPositionStyles(TOAST_POSITIONS.bottomEnd, state.dir, state.offset));\n }\n if (state.topStart) {\n var _state_topStart;\n // eslint-disable-next-line react-hooks/immutability\n state.topStart.className = className;\n var _style2;\n (_style2 = (_state_topStart = state.topStart).style) !== null && _style2 !== void 0 ? _style2 : _state_topStart.style = {};\n Object.assign(state.topStart.style, getPositionStyles(TOAST_POSITIONS.topStart, state.dir, state.offset));\n }\n if (state.topEnd) {\n var _state_topEnd;\n // eslint-disable-next-line react-hooks/immutability\n state.topEnd.className = className;\n var _style3;\n (_style3 = (_state_topEnd = state.topEnd).style) !== null && _style3 !== void 0 ? _style3 : _state_topEnd.style = {};\n Object.assign(state.topEnd.style, getPositionStyles(TOAST_POSITIONS.topEnd, state.dir, state.offset));\n }\n if (state.top) {\n var _state_top;\n // eslint-disable-next-line react-hooks/immutability\n state.top.className = className;\n var _style4;\n (_style4 = (_state_top = state.top).style) !== null && _style4 !== void 0 ? _style4 : _state_top.style = {};\n Object.assign(state.top.style, getPositionStyles(TOAST_POSITIONS.top, state.dir, state.offset));\n }\n if (state.bottom) {\n var _state_bottom;\n // eslint-disable-next-line react-hooks/immutability\n state.bottom.className = className;\n var _style5;\n (_style5 = (_state_bottom = state.bottom).style) !== null && _style5 !== void 0 ? _style5 : _state_bottom.style = {};\n Object.assign(state.bottom.style, getPositionStyles(TOAST_POSITIONS.bottom, state.dir, state.offset));\n }\n return state;\n};\n"],"names":["__resetStyles","__styles","mergeClasses","TOAST_POSITIONS","getPositionStyles","toasterClassNames","root","useRootBaseClassName","useToasterStyles","inline","qhf8xq","d","useToasterStyles_unstable","state","rootBaseClassName","styles","className","bottomStart","_state_bottomStart","_style","style","Object","assign","dir","offset","bottomEnd","_state_bottomEnd","_style1","topStart","_state_topStart","_style2","topEnd","_state_topEnd","_style3","top","_state_top","_style4","bottom","_state_bottom","_style5"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAGCK,iBAAiB;;;6BAiBY;eAAzBO;;;uBAnByC,gBAAgB;uBACvB,mBAAmB;AAC/D,0BAA0B;IAC7BN,IAAI,EAAE;AACV,CAAC;AACD;;CAEA,GAAI,MAAMC,oBAAoB,GAAA,WAAA,OAAGP,oBAAA,EAAA,WAAA,MAAA;IAAA;CAIhC,CAAC;AACF,MAAMQ,gBAAgB,GAAA,WAAA,OAAGP,eAAA,EAAA;IAAAQ,MAAA,EAAA;QAAAC,MAAA,EAAA;IAAA;AAAA,GAAA;IAAAC,CAAA,EAAA;QAAA;KAAA;AAAA,CAIxB,CAAC;AAGS,mCAAmCE,KAAK,IAAG;IAClD,MAAMC,iBAAiB,GAAGP,oBAAoB,CAAC,CAAC;IAChD,MAAMQ,MAAM,GAAGP,gBAAgB,CAAC,CAAC;IACjC,MAAMQ,SAAS,OAAGd,mBAAY,EAACG,iBAAiB,CAACC,IAAI,EAAEQ,iBAAiB,EAAED,KAAK,CAACJ,MAAM,IAAIM,MAAM,CAACN,MAAM,EAAEI,KAAK,CAACP,IAAI,CAACU,SAAS,CAAC;IAC9H,IAAIH,KAAK,CAACI,WAAW,EAAE;QACnB,IAAIC,kBAAkB;QACtB,oDAAA;QACAL,KAAK,CAACI,WAAW,CAACD,SAAS,GAAGA,SAAS;QACvC,IAAIG,MAAM;SACTA,MAAM,GAAG,CAACD,kBAAkB,GAAGL,KAAK,CAACI,WAAAA,AAAW,EAAEG,K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D,aAAa,GAAGzB,KAAK,CAACwB,MAAAA,AAAM,EAAEjB,KAAAA,AAAK,MAAM,IAAI,IAAImB,OAAO,KAAK,KAAK,CAAC,GAAGA,OAAO,GAAGD,aAAa,CAAClB,KAAK,GAAG,CAAC,CAAC;QACpHC,MAAM,CAACC,MAAM,CAACT,KAAK,CAACwB,MAAM,CAACjB,KAAK,MAAEhB,wBAAiB,EAACD,sBAAe,CAACkC,MAAM,EAAExB,KAAK,CAACU,GAAG,EAAEV,KAAK,CAACW,MAAM,CAAC,CAAC;IACzG;IACA,OAAOX,KAAK;AAChB,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib-commonjs/components/Timer/{useTimerStyles.styles.js → useTimerStyles.styles.cjs}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib-commonjs/components/Toast/{useToastContextValues.js → useToastContextValues.cjs}
RENAMED
|
File without changes
|
|
File without changes
|
/package/lib-commonjs/components/Toast/{useToastStyles.styles.js → useToastStyles.styles.cjs}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib-commonjs/components/ToastBody/{ToastBody.types.js.map → ToastBody.types.cjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
/package/lib-commonjs/components/ToastBody/{renderToastBody.js.map → renderToastBody.cjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib-commonjs/components/ToastContainer/{ToastContainer.types.js → ToastContainer.types.cjs}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib-commonjs/components/ToastFooter/{ToastFooter.types.js.map → ToastFooter.types.cjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
/package/lib-commonjs/components/ToastFooter/{renderToastFooter.js.map → renderToastFooter.cjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
/package/lib-commonjs/components/ToastFooter/{useToastFooter.js.map → useToastFooter.cjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib-commonjs/components/ToastTitle/{ToastTitle.types.js.map → ToastTitle.types.cjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
/package/lib-commonjs/components/ToastTitle/{renderToastTitle.js.map → renderToastTitle.cjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib-commonjs/components/ToastTrigger/{ToastTrigger.types.js → ToastTrigger.types.cjs}
RENAMED
|
File without changes
|