@fluentui/react-toast 9.0.0
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.json +56 -0
- package/CHANGELOG.md +19 -0
- package/LICENSE +15 -0
- package/README.md +5 -0
- package/dist/index.d.ts +485 -0
- package/lib/AriaLive.js +1 -0
- package/lib/AriaLive.js.map +1 -0
- package/lib/Toast.js +1 -0
- package/lib/Toast.js.map +1 -0
- package/lib/ToastBody.js +1 -0
- package/lib/ToastBody.js.map +1 -0
- package/lib/ToastContainer.js +1 -0
- package/lib/ToastContainer.js.map +1 -0
- package/lib/ToastFooter.js +1 -0
- package/lib/ToastFooter.js.map +1 -0
- package/lib/ToastTitle.js +1 -0
- package/lib/ToastTitle.js.map +1 -0
- package/lib/ToastTrigger.js +1 -0
- package/lib/ToastTrigger.js.map +1 -0
- package/lib/Toaster.js +1 -0
- package/lib/Toaster.js.map +1 -0
- package/lib/components/AriaLive/AriaLive.js +12 -0
- package/lib/components/AriaLive/AriaLive.js.map +1 -0
- package/lib/components/AriaLive/AriaLive.types.js +1 -0
- package/lib/components/AriaLive/AriaLive.types.js.map +1 -0
- package/lib/components/AriaLive/index.js +5 -0
- package/lib/components/AriaLive/index.js.map +1 -0
- package/lib/components/AriaLive/renderAriaLive.js +8 -0
- package/lib/components/AriaLive/renderAriaLive.js.map +1 -0
- package/lib/components/AriaLive/useAriaLive.js +73 -0
- package/lib/components/AriaLive/useAriaLive.js.map +1 -0
- package/lib/components/AriaLive/useAriaLiveStyles.styles.js +19 -0
- package/lib/components/AriaLive/useAriaLiveStyles.styles.js.map +1 -0
- package/lib/components/Timer/Timer.js +21 -0
- package/lib/components/Timer/Timer.js.map +1 -0
- package/lib/components/Timer/index.js +1 -0
- package/lib/components/Timer/index.js.map +1 -0
- package/lib/components/Timer/useTimerStyles.styles.js +3 -0
- package/lib/components/Timer/useTimerStyles.styles.js.map +1 -0
- package/lib/components/Toast/Toast.js +13 -0
- package/lib/components/Toast/Toast.js.map +1 -0
- package/lib/components/Toast/Toast.types.js +1 -0
- package/lib/components/Toast/Toast.types.js.map +1 -0
- package/lib/components/Toast/index.js +5 -0
- package/lib/components/Toast/index.js.map +1 -0
- package/lib/components/Toast/renderToast.js +11 -0
- package/lib/components/Toast/renderToast.js.map +1 -0
- package/lib/components/Toast/useToast.js +22 -0
- package/lib/components/Toast/useToast.js.map +1 -0
- package/lib/components/Toast/useToastContextValues.js +6 -0
- package/lib/components/Toast/useToastContextValues.js.map +1 -0
- package/lib/components/Toast/useToastStyles.styles.js +24 -0
- package/lib/components/Toast/useToastStyles.styles.js.map +1 -0
- package/lib/components/ToastBody/ToastBody.js +12 -0
- package/lib/components/ToastBody/ToastBody.js.map +1 -0
- package/lib/components/ToastBody/ToastBody.types.js +1 -0
- package/lib/components/ToastBody/ToastBody.types.js.map +1 -0
- package/lib/components/ToastBody/index.js +5 -0
- package/lib/components/ToastBody/index.js.map +1 -0
- package/lib/components/ToastBody/renderToastBody.js +8 -0
- package/lib/components/ToastBody/renderToastBody.js.map +1 -0
- package/lib/components/ToastBody/useToastBody.js +29 -0
- package/lib/components/ToastBody/useToastBody.js.map +1 -0
- package/lib/components/ToastBody/useToastBodyStyles.styles.js +32 -0
- package/lib/components/ToastBody/useToastBodyStyles.styles.js.map +1 -0
- package/lib/components/ToastContainer/ToastContainer.js +13 -0
- package/lib/components/ToastContainer/ToastContainer.js.map +1 -0
- package/lib/components/ToastContainer/ToastContainer.types.js +1 -0
- package/lib/components/ToastContainer/ToastContainer.types.js.map +1 -0
- package/lib/components/ToastContainer/index.js +6 -0
- package/lib/components/ToastContainer/index.js.map +1 -0
- package/lib/components/ToastContainer/renderToastContainer.js +21 -0
- package/lib/components/ToastContainer/renderToastContainer.js.map +1 -0
- package/lib/components/ToastContainer/useToastContainer.js +219 -0
- package/lib/components/ToastContainer/useToastContainer.js.map +1 -0
- package/lib/components/ToastContainer/useToastContainerContextValues.js +18 -0
- package/lib/components/ToastContainer/useToastContainerContextValues.js.map +1 -0
- package/lib/components/ToastContainer/useToastContainerStyles.styles.js +36 -0
- package/lib/components/ToastContainer/useToastContainerStyles.styles.js.map +1 -0
- package/lib/components/ToastFooter/ToastFooter.js +12 -0
- package/lib/components/ToastFooter/ToastFooter.js.map +1 -0
- package/lib/components/ToastFooter/ToastFooter.types.js +1 -0
- package/lib/components/ToastFooter/ToastFooter.types.js.map +1 -0
- package/lib/components/ToastFooter/index.js +5 -0
- package/lib/components/ToastFooter/index.js.map +1 -0
- package/lib/components/ToastFooter/renderToastFooter.js +8 -0
- package/lib/components/ToastFooter/renderToastFooter.js.map +1 -0
- package/lib/components/ToastFooter/useToastFooter.js +21 -0
- package/lib/components/ToastFooter/useToastFooter.js.map +1 -0
- package/lib/components/ToastFooter/useToastFooterStyles.styles.js +17 -0
- package/lib/components/ToastFooter/useToastFooterStyles.styles.js.map +1 -0
- package/lib/components/ToastTitle/ToastTitle.js +12 -0
- package/lib/components/ToastTitle/ToastTitle.js.map +1 -0
- package/lib/components/ToastTitle/ToastTitle.types.js +1 -0
- package/lib/components/ToastTitle/ToastTitle.types.js.map +1 -0
- package/lib/components/ToastTitle/index.js +5 -0
- package/lib/components/ToastTitle/index.js.map +1 -0
- package/lib/components/ToastTitle/renderToastTitle.js +8 -0
- package/lib/components/ToastTitle/renderToastTitle.js.map +1 -0
- package/lib/components/ToastTitle/useToastTitle.js +54 -0
- package/lib/components/ToastTitle/useToastTitle.js.map +1 -0
- package/lib/components/ToastTitle/useToastTitleStyles.styles.js +78 -0
- package/lib/components/ToastTitle/useToastTitleStyles.styles.js.map +1 -0
- package/lib/components/ToastTrigger/ToastTrigger.js +10 -0
- package/lib/components/ToastTrigger/ToastTrigger.js.map +1 -0
- package/lib/components/ToastTrigger/ToastTrigger.types.js +1 -0
- package/lib/components/ToastTrigger/ToastTrigger.types.js.map +1 -0
- package/lib/components/ToastTrigger/index.js +4 -0
- package/lib/components/ToastTrigger/index.js.map +1 -0
- package/lib/components/ToastTrigger/renderToastTrigger.js +5 -0
- package/lib/components/ToastTrigger/renderToastTrigger.js.map +1 -0
- package/lib/components/ToastTrigger/useToastTrigger.js +36 -0
- package/lib/components/ToastTrigger/useToastTrigger.js.map +1 -0
- package/lib/components/Toaster/Toaster.js +12 -0
- package/lib/components/Toaster/Toaster.js.map +1 -0
- package/lib/components/Toaster/Toaster.types.js +1 -0
- package/lib/components/Toaster/Toaster.types.js.map +1 -0
- package/lib/components/Toaster/index.js +5 -0
- package/lib/components/Toaster/index.js.map +1 -0
- package/lib/components/Toaster/renderToaster.js +14 -0
- package/lib/components/Toaster/renderToaster.js.map +1 -0
- package/lib/components/Toaster/useToaster.js +71 -0
- package/lib/components/Toaster/useToaster.js.map +1 -0
- package/lib/components/Toaster/useToasterStyles.styles.js +43 -0
- package/lib/components/Toaster/useToasterStyles.styles.js.map +1 -0
- package/lib/contexts/toastContainerContext.js +11 -0
- package/lib/contexts/toastContainerContext.js.map +1 -0
- package/lib/index.js +7 -0
- package/lib/index.js.map +1 -0
- package/lib/state/constants.js +14 -0
- package/lib/state/constants.js.map +1 -0
- package/lib/state/index.js +5 -0
- package/lib/state/index.js.map +1 -0
- package/lib/state/types.js +1 -0
- package/lib/state/types.js.map +1 -0
- package/lib/state/useToastController.js +57 -0
- package/lib/state/useToastController.js.map +1 -0
- package/lib/state/useToaster.js +162 -0
- package/lib/state/useToaster.js.map +1 -0
- package/lib/state/vanilla/createToaster.js +137 -0
- package/lib/state/vanilla/createToaster.js.map +1 -0
- package/lib/state/vanilla/dismissAllToasts.js +11 -0
- package/lib/state/vanilla/dismissAllToasts.js.map +1 -0
- package/lib/state/vanilla/dismissToast.js +12 -0
- package/lib/state/vanilla/dismissToast.js.map +1 -0
- package/lib/state/vanilla/dispatchToast.js +16 -0
- package/lib/state/vanilla/dispatchToast.js.map +1 -0
- package/lib/state/vanilla/getPositionStyles.js +40 -0
- package/lib/state/vanilla/getPositionStyles.js.map +1 -0
- package/lib/state/vanilla/index.js +8 -0
- package/lib/state/vanilla/index.js.map +1 -0
- package/lib/state/vanilla/pauseToast.js +12 -0
- package/lib/state/vanilla/pauseToast.js.map +1 -0
- package/lib/state/vanilla/playToast.js +12 -0
- package/lib/state/vanilla/playToast.js.map +1 -0
- package/lib/state/vanilla/updateToast.js +9 -0
- package/lib/state/vanilla/updateToast.js.map +1 -0
- package/lib-commonjs/AriaLive.js +6 -0
- package/lib-commonjs/AriaLive.js.map +1 -0
- package/lib-commonjs/Toast.js +6 -0
- package/lib-commonjs/Toast.js.map +1 -0
- package/lib-commonjs/ToastBody.js +6 -0
- package/lib-commonjs/ToastBody.js.map +1 -0
- package/lib-commonjs/ToastContainer.js +6 -0
- package/lib-commonjs/ToastContainer.js.map +1 -0
- package/lib-commonjs/ToastFooter.js +6 -0
- package/lib-commonjs/ToastFooter.js.map +1 -0
- package/lib-commonjs/ToastTitle.js +6 -0
- package/lib-commonjs/ToastTitle.js.map +1 -0
- package/lib-commonjs/ToastTrigger.js +6 -0
- package/lib-commonjs/ToastTrigger.js.map +1 -0
- package/lib-commonjs/Toaster.js +6 -0
- package/lib-commonjs/Toaster.js.map +1 -0
- package/lib-commonjs/components/AriaLive/AriaLive.js +19 -0
- package/lib-commonjs/components/AriaLive/AriaLive.js.map +1 -0
- package/lib-commonjs/components/AriaLive/AriaLive.types.js +6 -0
- package/lib-commonjs/components/AriaLive/AriaLive.types.js.map +1 -0
- package/lib-commonjs/components/AriaLive/index.js +10 -0
- package/lib-commonjs/components/AriaLive/index.js.map +1 -0
- package/lib-commonjs/components/AriaLive/renderAriaLive.js +14 -0
- package/lib-commonjs/components/AriaLive/renderAriaLive.js.map +1 -0
- package/lib-commonjs/components/AriaLive/useAriaLive.js +75 -0
- package/lib-commonjs/components/AriaLive/useAriaLive.js.map +1 -0
- package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.js +31 -0
- package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.js.map +1 -0
- package/lib-commonjs/components/Timer/Timer.js +30 -0
- package/lib-commonjs/components/Timer/Timer.js.map +1 -0
- package/lib-commonjs/components/Timer/index.js +6 -0
- package/lib-commonjs/components/Timer/index.js.map +1 -0
- package/lib-commonjs/components/Timer/useTimerStyles.styles.js +16 -0
- package/lib-commonjs/components/Timer/useTimerStyles.styles.js.map +1 -0
- package/lib-commonjs/components/Toast/Toast.js +20 -0
- package/lib-commonjs/components/Toast/Toast.js.map +1 -0
- package/lib-commonjs/components/Toast/Toast.types.js +4 -0
- package/lib-commonjs/components/Toast/Toast.types.js.map +1 -0
- package/lib-commonjs/components/Toast/index.js +10 -0
- package/lib-commonjs/components/Toast/index.js.map +1 -0
- package/lib-commonjs/components/Toast/renderToast.js +17 -0
- package/lib-commonjs/components/Toast/renderToast.js.map +1 -0
- package/lib-commonjs/components/Toast/useToast.js +23 -0
- package/lib-commonjs/components/Toast/useToast.js.map +1 -0
- package/lib-commonjs/components/Toast/useToastContextValues.js +14 -0
- package/lib-commonjs/components/Toast/useToastContextValues.js.map +1 -0
- package/lib-commonjs/components/Toast/useToastStyles.styles.js +39 -0
- package/lib-commonjs/components/Toast/useToastStyles.styles.js.map +1 -0
- package/lib-commonjs/components/ToastBody/ToastBody.js +19 -0
- package/lib-commonjs/components/ToastBody/ToastBody.js.map +1 -0
- package/lib-commonjs/components/ToastBody/ToastBody.types.js +4 -0
- package/lib-commonjs/components/ToastBody/ToastBody.types.js.map +1 -0
- package/lib-commonjs/components/ToastBody/index.js +10 -0
- package/lib-commonjs/components/ToastBody/index.js.map +1 -0
- package/lib-commonjs/components/ToastBody/renderToastBody.js +14 -0
- package/lib-commonjs/components/ToastBody/renderToastBody.js.map +1 -0
- package/lib-commonjs/components/ToastBody/useToastBody.js +30 -0
- package/lib-commonjs/components/ToastBody/useToastBody.js.map +1 -0
- package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.js +47 -0
- package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.js.map +1 -0
- package/lib-commonjs/components/ToastContainer/ToastContainer.js +20 -0
- package/lib-commonjs/components/ToastContainer/ToastContainer.js.map +1 -0
- package/lib-commonjs/components/ToastContainer/ToastContainer.types.js +6 -0
- package/lib-commonjs/components/ToastContainer/ToastContainer.types.js.map +1 -0
- package/lib-commonjs/components/ToastContainer/index.js +11 -0
- package/lib-commonjs/components/ToastContainer/index.js.map +1 -0
- package/lib-commonjs/components/ToastContainer/renderToastContainer.js +27 -0
- package/lib-commonjs/components/ToastContainer/renderToastContainer.js.map +1 -0
- package/lib-commonjs/components/ToastContainer/useToastContainer.js +220 -0
- package/lib-commonjs/components/ToastContainer/useToastContainer.js.map +1 -0
- package/lib-commonjs/components/ToastContainer/useToastContainerContextValues.js +27 -0
- package/lib-commonjs/components/ToastContainer/useToastContainerContextValues.js.map +1 -0
- package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.js +64 -0
- package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.js.map +1 -0
- package/lib-commonjs/components/ToastFooter/ToastFooter.js +19 -0
- package/lib-commonjs/components/ToastFooter/ToastFooter.js.map +1 -0
- package/lib-commonjs/components/ToastFooter/ToastFooter.types.js +4 -0
- package/lib-commonjs/components/ToastFooter/ToastFooter.types.js.map +1 -0
- package/lib-commonjs/components/ToastFooter/index.js +10 -0
- package/lib-commonjs/components/ToastFooter/index.js.map +1 -0
- package/lib-commonjs/components/ToastFooter/renderToastFooter.js +14 -0
- package/lib-commonjs/components/ToastFooter/renderToastFooter.js.map +1 -0
- package/lib-commonjs/components/ToastFooter/useToastFooter.js +22 -0
- package/lib-commonjs/components/ToastFooter/useToastFooter.js.map +1 -0
- package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.js +28 -0
- package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.js.map +1 -0
- package/lib-commonjs/components/ToastTitle/ToastTitle.js +19 -0
- package/lib-commonjs/components/ToastTitle/ToastTitle.js.map +1 -0
- package/lib-commonjs/components/ToastTitle/ToastTitle.types.js +4 -0
- package/lib-commonjs/components/ToastTitle/ToastTitle.types.js.map +1 -0
- package/lib-commonjs/components/ToastTitle/index.js +10 -0
- package/lib-commonjs/components/ToastTitle/index.js.map +1 -0
- package/lib-commonjs/components/ToastTitle/renderToastTitle.js +14 -0
- package/lib-commonjs/components/ToastTitle/renderToastTitle.js.map +1 -0
- package/lib-commonjs/components/ToastTitle/useToastTitle.js +55 -0
- package/lib-commonjs/components/ToastTitle/useToastTitle.js.map +1 -0
- package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.js +107 -0
- package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.js.map +1 -0
- package/lib-commonjs/components/ToastTrigger/ToastTrigger.js +17 -0
- package/lib-commonjs/components/ToastTrigger/ToastTrigger.js.map +1 -0
- package/lib-commonjs/components/ToastTrigger/ToastTrigger.types.js +6 -0
- package/lib-commonjs/components/ToastTrigger/ToastTrigger.types.js.map +1 -0
- package/lib-commonjs/components/ToastTrigger/index.js +9 -0
- package/lib-commonjs/components/ToastTrigger/index.js.map +1 -0
- package/lib-commonjs/components/ToastTrigger/renderToastTrigger.js +13 -0
- package/lib-commonjs/components/ToastTrigger/renderToastTrigger.js.map +1 -0
- package/lib-commonjs/components/ToastTrigger/useToastTrigger.js +37 -0
- package/lib-commonjs/components/ToastTrigger/useToastTrigger.js.map +1 -0
- package/lib-commonjs/components/Toaster/Toaster.js +19 -0
- package/lib-commonjs/components/Toaster/Toaster.js.map +1 -0
- package/lib-commonjs/components/Toaster/Toaster.types.js +4 -0
- package/lib-commonjs/components/Toaster/Toaster.types.js.map +1 -0
- package/lib-commonjs/components/Toaster/index.js +10 -0
- package/lib-commonjs/components/Toaster/index.js.map +1 -0
- package/lib-commonjs/components/Toaster/renderToaster.js +20 -0
- package/lib-commonjs/components/Toaster/renderToaster.js.map +1 -0
- package/lib-commonjs/components/Toaster/useToaster.js +76 -0
- package/lib-commonjs/components/Toaster/useToaster.js.map +1 -0
- package/lib-commonjs/components/Toaster/useToasterStyles.styles.js +54 -0
- package/lib-commonjs/components/Toaster/useToasterStyles.styles.js.map +1 -0
- package/lib-commonjs/contexts/toastContainerContext.js +26 -0
- package/lib-commonjs/contexts/toastContainerContext.js.map +1 -0
- package/lib-commonjs/index.js +48 -0
- package/lib-commonjs/index.js.map +1 -0
- package/lib-commonjs/state/constants.js +28 -0
- package/lib-commonjs/state/constants.js.map +1 -0
- package/lib-commonjs/state/index.js +20 -0
- package/lib-commonjs/state/index.js.map +1 -0
- package/lib-commonjs/state/types.js +6 -0
- package/lib-commonjs/state/types.js.map +1 -0
- package/lib-commonjs/state/useToastController.js +63 -0
- package/lib-commonjs/state/useToastController.js.map +1 -0
- package/lib-commonjs/state/useToaster.js +171 -0
- package/lib-commonjs/state/useToaster.js.map +1 -0
- package/lib-commonjs/state/vanilla/createToaster.js +142 -0
- package/lib-commonjs/state/vanilla/createToaster.js.map +1 -0
- package/lib-commonjs/state/vanilla/dismissAllToasts.js +19 -0
- package/lib-commonjs/state/vanilla/dismissAllToasts.js.map +1 -0
- package/lib-commonjs/state/vanilla/dismissToast.js +20 -0
- package/lib-commonjs/state/vanilla/dismissToast.js.map +1 -0
- package/lib-commonjs/state/vanilla/dispatchToast.js +24 -0
- package/lib-commonjs/state/vanilla/dispatchToast.js.map +1 -0
- package/lib-commonjs/state/vanilla/getPositionStyles.js +48 -0
- package/lib-commonjs/state/vanilla/getPositionStyles.js.map +1 -0
- package/lib-commonjs/state/vanilla/index.js +13 -0
- package/lib-commonjs/state/vanilla/index.js.map +1 -0
- package/lib-commonjs/state/vanilla/pauseToast.js +20 -0
- package/lib-commonjs/state/vanilla/pauseToast.js.map +1 -0
- package/lib-commonjs/state/vanilla/playToast.js +20 -0
- package/lib-commonjs/state/vanilla/playToast.js.map +1 -0
- package/lib-commonjs/state/vanilla/updateToast.js +17 -0
- package/lib-commonjs/state/vanilla/updateToast.js.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AriaLive.js"],"sourcesContent":["import * as React from 'react';\nimport { useAriaLive_unstable } from './useAriaLive';\nimport { renderAriaLive_unstable } from './renderAriaLive';\nimport { useAriaLiveStyles_unstable } from './useAriaLiveStyles.styles';\n/**\n * A component that manages aria live announcements imperatively\n */ export const AriaLive = (props)=>{\n const state = useAriaLive_unstable(props);\n useAriaLiveStyles_unstable(state);\n return renderAriaLive_unstable(state);\n};\nAriaLive.displayName = 'AriaLive';\n"],"names":["AriaLive","props","state","useAriaLive_unstable","useAriaLiveStyles_unstable","renderAriaLive_unstable","displayName"],"mappings":";;;;+BAMiBA;;aAAAA;;;6DANM;6BACc;gCACG;yCACG;AAGhC,MAAMA,WAAW,CAACC,QAAQ;IACjC,MAAMC,QAAQC,IAAAA,iCAAoB,EAACF;IACnCG,IAAAA,mDAA0B,EAACF;IAC3B,OAAOG,IAAAA,uCAAuB,EAACH;AACnC;AACAF,SAASM,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AriaLive.types.js"],"sourcesContent":["import * as React from 'react';\n"],"names":[],"mappings":";;;;;6DAAuB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./AriaLive"), exports);
|
|
7
|
+
_exportStar(require("./AriaLive.types"), exports);
|
|
8
|
+
_exportStar(require("./renderAriaLive"), exports);
|
|
9
|
+
_exportStar(require("./useAriaLive"), exports);
|
|
10
|
+
_exportStar(require("./useAriaLiveStyles.styles"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './AriaLive';\nexport * from './AriaLive.types';\nexport * from './renderAriaLive';\nexport * from './useAriaLive';\nexport * from './useAriaLiveStyles.styles';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** @jsxRuntime classic */ /** @jsxFrag Fragment */ /** @jsx createElement */ "use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderAriaLive_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>renderAriaLive_unstable
|
|
8
|
+
});
|
|
9
|
+
const _reactJsxRuntime = require("@fluentui/react-jsx-runtime");
|
|
10
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
11
|
+
const renderAriaLive_unstable = (state)=>{
|
|
12
|
+
const { slots , slotProps } = (0, _reactUtilities.getSlotsNext)(state);
|
|
13
|
+
return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(_reactJsxRuntime.Fragment, null, /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.assertive, slotProps.assertive), /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.polite, slotProps.polite));
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderAriaLive.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 AriaLive\n */ export const renderAriaLive_unstable = (state)=>{\n const { slots , slotProps } = getSlotsNext(state);\n return /*#__PURE__*/ createElement(Fragment, null, /*#__PURE__*/ createElement(slots.assertive, slotProps.assertive), /*#__PURE__*/ createElement(slots.polite, slotProps.polite));\n};\n"],"names":["renderAriaLive_unstable","state","slots","slotProps","getSlotsNext","createElement","Fragment","assertive","polite"],"mappings":"AAAA,wBAAwB,GAAG,sBAAsB,GAAG,uBAAuB;;;;+BAI1DA;;aAAAA;;iCAJqG;gCACzF;AAGlB,MAAMA,0BAA0B,CAACC,QAAQ;IAChD,MAAM,EAAEC,MAAK,EAAGC,UAAS,EAAG,GAAGC,IAAAA,4BAAY,EAACH;IAC5C,OAAO,WAAW,GAAGI,IAAAA,8BAAa,EAACC,yBAAQ,EAAE,IAAI,EAAE,WAAW,GAAGD,IAAAA,8BAAa,EAACH,MAAMK,SAAS,EAAEJ,UAAUI,SAAS,GAAG,WAAW,GAAGF,IAAAA,8BAAa,EAACH,MAAMM,MAAM,EAAEL,UAAUK,MAAM;AACpL"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useAriaLive_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>useAriaLive_unstable
|
|
8
|
+
});
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
12
|
+
/** The duration the message needs to be in present in DOM for screen readers to register a change and announce */ const MESSAGE_DURATION = 500;
|
|
13
|
+
const useAriaLive_unstable = (props)=>{
|
|
14
|
+
const [currentMessage, setCurrentMessage] = _react.useState(undefined);
|
|
15
|
+
// Can't rely on Date.now() if user invokes announce more than once in a code block
|
|
16
|
+
const order = _react.useRef(0);
|
|
17
|
+
const [messageQueue] = _react.useState(()=>(0, _reactUtilities.createPriorityQueue)((a, b)=>{
|
|
18
|
+
if (a.politeness === b.politeness) {
|
|
19
|
+
return a.createdAt - b.createdAt;
|
|
20
|
+
}
|
|
21
|
+
return a.politeness === 'assertive' ? -1 : 1;
|
|
22
|
+
}));
|
|
23
|
+
const announce = (0, _reactUtilities.useEventCallback)((message, options)=>{
|
|
24
|
+
const { politeness } = options;
|
|
25
|
+
if (message === (currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.message)) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const liveMessage = {
|
|
29
|
+
message,
|
|
30
|
+
politeness,
|
|
31
|
+
createdAt: order.current++
|
|
32
|
+
};
|
|
33
|
+
if (!currentMessage) {
|
|
34
|
+
setCurrentMessage(liveMessage);
|
|
35
|
+
} else {
|
|
36
|
+
messageQueue.enqueue(liveMessage);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
_react.useEffect(()=>{
|
|
40
|
+
const timeout = setTimeout(()=>{
|
|
41
|
+
if (messageQueue.peek()) {
|
|
42
|
+
setCurrentMessage(messageQueue.dequeue());
|
|
43
|
+
} else {
|
|
44
|
+
setCurrentMessage(undefined);
|
|
45
|
+
}
|
|
46
|
+
}, MESSAGE_DURATION);
|
|
47
|
+
return ()=>clearTimeout(timeout);
|
|
48
|
+
}, [
|
|
49
|
+
currentMessage,
|
|
50
|
+
messageQueue
|
|
51
|
+
]);
|
|
52
|
+
_react.useImperativeHandle(props.announceRef, ()=>announce);
|
|
53
|
+
const politeMessage = (currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.politeness) === 'polite' ? currentMessage.message : undefined;
|
|
54
|
+
const assertiveMessage = (currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.politeness) === 'assertive' ? currentMessage.message : undefined;
|
|
55
|
+
return {
|
|
56
|
+
components: {
|
|
57
|
+
assertive: 'div',
|
|
58
|
+
polite: 'div'
|
|
59
|
+
},
|
|
60
|
+
assertive: (0, _reactUtilities.resolveShorthand)(props.assertive, {
|
|
61
|
+
required: true,
|
|
62
|
+
defaultProps: {
|
|
63
|
+
'aria-live': 'assertive',
|
|
64
|
+
children: assertiveMessage
|
|
65
|
+
}
|
|
66
|
+
}),
|
|
67
|
+
polite: (0, _reactUtilities.resolveShorthand)(props.polite, {
|
|
68
|
+
required: true,
|
|
69
|
+
defaultProps: {
|
|
70
|
+
'aria-live': 'polite',
|
|
71
|
+
children: politeMessage
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
};
|
|
75
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAriaLive.js"],"sourcesContent":["import * as React from 'react';\nimport { resolveShorthand, createPriorityQueue, useEventCallback } from '@fluentui/react-utilities';\n/** The duration the message needs to be in present in DOM for screen readers to register a change and announce */ const MESSAGE_DURATION = 500;\n/**\n * Create the state required to render AriaLive.\n *\n * The returned state can be modified with hooks such as useAriaLiveStyles_unstable,\n * before being passed to renderAriaLive_unstable.\n *\n * @param props - props from this instance of AriaLive\n */ export const useAriaLive_unstable = (props)=>{\n const [currentMessage, setCurrentMessage] = React.useState(undefined);\n // Can't rely on Date.now() if user invokes announce more than once in a code block\n const order = React.useRef(0);\n const [messageQueue] = React.useState(()=>createPriorityQueue((a, b)=>{\n if (a.politeness === b.politeness) {\n return a.createdAt - b.createdAt;\n }\n return a.politeness === 'assertive' ? -1 : 1;\n }));\n const announce = useEventCallback((message, options)=>{\n const { politeness } = options;\n if (message === (currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.message)) {\n return;\n }\n const liveMessage = {\n message,\n politeness,\n createdAt: order.current++\n };\n if (!currentMessage) {\n setCurrentMessage(liveMessage);\n } else {\n messageQueue.enqueue(liveMessage);\n }\n });\n React.useEffect(()=>{\n const timeout = setTimeout(()=>{\n if (messageQueue.peek()) {\n setCurrentMessage(messageQueue.dequeue());\n } else {\n setCurrentMessage(undefined);\n }\n }, MESSAGE_DURATION);\n return ()=>clearTimeout(timeout);\n }, [\n currentMessage,\n messageQueue\n ]);\n React.useImperativeHandle(props.announceRef, ()=>announce);\n const politeMessage = (currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.politeness) === 'polite' ? currentMessage.message : undefined;\n const assertiveMessage = (currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.politeness) === 'assertive' ? currentMessage.message : undefined;\n return {\n components: {\n assertive: 'div',\n polite: 'div'\n },\n assertive: resolveShorthand(props.assertive, {\n required: true,\n defaultProps: {\n 'aria-live': 'assertive',\n children: assertiveMessage\n }\n }),\n polite: resolveShorthand(props.polite, {\n required: true,\n defaultProps: {\n 'aria-live': 'polite',\n children: politeMessage\n }\n })\n };\n};\n"],"names":["useAriaLive_unstable","MESSAGE_DURATION","props","currentMessage","setCurrentMessage","React","useState","undefined","order","useRef","messageQueue","createPriorityQueue","a","b","politeness","createdAt","announce","useEventCallback","message","options","liveMessage","current","enqueue","useEffect","timeout","setTimeout","peek","dequeue","clearTimeout","useImperativeHandle","announceRef","politeMessage","assertiveMessage","components","assertive","polite","resolveShorthand","required","defaultProps","children"],"mappings":";;;;+BAUiBA;;aAAAA;;;6DAVM;gCACiD;AACxE,gHAAgH,GAAG,MAAMC,mBAAmB;AAQjI,MAAMD,uBAAuB,CAACE,QAAQ;IAC7C,MAAM,CAACC,gBAAgBC,kBAAkB,GAAGC,OAAMC,QAAQ,CAACC;IAC3D,mFAAmF;IACnF,MAAMC,QAAQH,OAAMI,MAAM,CAAC;IAC3B,MAAM,CAACC,aAAa,GAAGL,OAAMC,QAAQ,CAAC,IAAIK,IAAAA,mCAAmB,EAAC,CAACC,GAAGC,IAAI;YAC9D,IAAID,EAAEE,UAAU,KAAKD,EAAEC,UAAU,EAAE;gBAC/B,OAAOF,EAAEG,SAAS,GAAGF,EAAEE,SAAS;YACpC,CAAC;YACD,OAAOH,EAAEE,UAAU,KAAK,cAAc,CAAC,IAAI,CAAC;QAChD;IACJ,MAAME,WAAWC,IAAAA,gCAAgB,EAAC,CAACC,SAASC,UAAU;QAClD,MAAM,EAAEL,WAAU,EAAG,GAAGK;QACxB,IAAID,YAAaf,CAAAA,mBAAmB,IAAI,IAAIA,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAee,OAAO,AAAD,GAAI;YACtG;QACJ,CAAC;QACD,MAAME,cAAc;YAChBF;YACAJ;YACAC,WAAWP,MAAMa,OAAO;QAC5B;QACA,IAAI,CAAClB,gBAAgB;YACjBC,kBAAkBgB;QACtB,OAAO;YACHV,aAAaY,OAAO,CAACF;QACzB,CAAC;IACL;IACAf,OAAMkB,SAAS,CAAC,IAAI;QAChB,MAAMC,UAAUC,WAAW,IAAI;YAC3B,IAAIf,aAAagB,IAAI,IAAI;gBACrBtB,kBAAkBM,aAAaiB,OAAO;YAC1C,OAAO;gBACHvB,kBAAkBG;YACtB,CAAC;QACL,GAAGN;QACH,OAAO,IAAI2B,aAAaJ;IAC5B,GAAG;QACCrB;QACAO;KACH;IACDL,OAAMwB,mBAAmB,CAAC3B,MAAM4B,WAAW,EAAE,IAAId;IACjD,MAAMe,gBAAgB,AAAC5B,CAAAA,mBAAmB,IAAI,IAAIA,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAeW,UAAU,AAAD,MAAO,WAAWX,eAAee,OAAO,GAAGX,SAAS;IACnK,MAAMyB,mBAAmB,AAAC7B,CAAAA,mBAAmB,IAAI,IAAIA,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAeW,UAAU,AAAD,MAAO,cAAcX,eAAee,OAAO,GAAGX,SAAS;IACzK,OAAO;QACH0B,YAAY;YACRC,WAAW;YACXC,QAAQ;QACZ;QACAD,WAAWE,IAAAA,gCAAgB,EAAClC,MAAMgC,SAAS,EAAE;YACzCG,UAAU,IAAI;YACdC,cAAc;gBACV,aAAa;gBACbC,UAAUP;YACd;QACJ;QACAG,QAAQC,IAAAA,gCAAgB,EAAClC,MAAMiC,MAAM,EAAE;YACnCE,UAAU,IAAI;YACdC,cAAc;gBACV,aAAa;gBACbC,UAAUR;YACd;QACJ;IACJ;AACJ"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
ariaLiveClassNames: ()=>ariaLiveClassNames,
|
|
13
|
+
useAriaLiveStyles_unstable: ()=>useAriaLiveStyles_unstable
|
|
14
|
+
});
|
|
15
|
+
const _react = require("@griffel/react");
|
|
16
|
+
const ariaLiveClassNames = {
|
|
17
|
+
assertive: 'fui-AriaLive__assertive',
|
|
18
|
+
polite: 'fui-AriaLive__polite'
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Styles for the root slot
|
|
22
|
+
*/ const useResetStyles = /*#__PURE__*/ (0, _react["__resetStyles"])("rsuwu0d", "r1m1grr4", [
|
|
23
|
+
".rsuwu0d{clip:rect(0px, 0px, 0px, 0px);height:1px;margin-top:-1px;margin-right:-1px;margin-bottom:-1px;margin-left:-1px;overflow-x:hidden;overflow-y:hidden;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;width:1px;position:absolute;}",
|
|
24
|
+
".r1m1grr4{clip:rect(0px, 0px, 0px, 0px);height:1px;margin-top:-1px;margin-left:-1px;margin-bottom:-1px;margin-right:-1px;overflow-x:hidden;overflow-y:hidden;padding-top:0px;padding-left:0px;padding-bottom:0px;padding-right:0px;width:1px;position:absolute;}"
|
|
25
|
+
]);
|
|
26
|
+
const useAriaLiveStyles_unstable = (state)=>{
|
|
27
|
+
const visuallyHidden = useResetStyles();
|
|
28
|
+
state.assertive.className = (0, _react.mergeClasses)(visuallyHidden, ariaLiveClassNames.assertive, state.assertive.className);
|
|
29
|
+
state.polite.className = (0, _react.mergeClasses)(visuallyHidden, ariaLiveClassNames.polite, state.polite.className);
|
|
30
|
+
return state;
|
|
31
|
+
}; //# sourceMappingURL=useAriaLiveStyles.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAriaLiveStyles.styles.js"],"sourcesContent":["import { mergeClasses, shorthands, __resetStyles } 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 */\nconst useResetStyles = /*#__PURE__*/__resetStyles(\"rsuwu0d\", \"r1m1grr4\", [\".rsuwu0d{clip:rect(0px, 0px, 0px, 0px);height:1px;margin-top:-1px;margin-right:-1px;margin-bottom:-1px;margin-left:-1px;overflow-x:hidden;overflow-y:hidden;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;width:1px;position:absolute;}\", \".r1m1grr4{clip:rect(0px, 0px, 0px, 0px);height:1px;margin-top:-1px;margin-left:-1px;margin-bottom:-1px;margin-right:-1px;overflow-x:hidden;overflow-y:hidden;padding-top:0px;padding-left:0px;padding-bottom:0px;padding-right:0px;width:1px;position:absolute;}\"]);\n/**\n * Apply styling to the AriaLive slots based on the state\n */\nexport const useAriaLiveStyles_unstable = state => {\n const visuallyHidden = useResetStyles();\n state.assertive.className = mergeClasses(visuallyHidden, ariaLiveClassNames.assertive, state.assertive.className);\n state.polite.className = mergeClasses(visuallyHidden, ariaLiveClassNames.polite, state.polite.className);\n return state;\n};\n//# sourceMappingURL=useAriaLiveStyles.styles.js.map"],"names":["ariaLiveClassNames","useAriaLiveStyles_unstable","assertive","polite","useResetStyles","__resetStyles","state","visuallyHidden","className","mergeClasses"],"mappings":";;;;;;;;;;;IACaA,kBAAkB,MAAlBA;IAWAC,0BAA0B,MAA1BA;;uBAZ2C;AACjD,MAAMD,qBAAqB;IAChCE,WAAW;IACXC,QAAQ;AACV;AACA;;CAEC,GACD,MAAMC,iBAAiB,WAAW,GAAEC,IAAAA,uBAAa,EAAC,WAAW,YAAY;IAAC;IAAmQ;CAAmQ;AAIzkB,MAAMJ,6BAA6BK,CAAAA,QAAS;IACjD,MAAMC,iBAAiBH;IACvBE,MAAMJ,SAAS,CAACM,SAAS,GAAGC,IAAAA,mBAAY,EAACF,gBAAgBP,mBAAmBE,SAAS,EAAEI,MAAMJ,SAAS,CAACM,SAAS;IAChHF,MAAMH,MAAM,CAACK,SAAS,GAAGC,IAAAA,mBAAY,EAACF,gBAAgBP,mBAAmBG,MAAM,EAAEG,MAAMH,MAAM,CAACK,SAAS;IACvG,OAAOF;AACT,GACA,oDAAoD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "Timer", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>Timer
|
|
8
|
+
});
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _useTimerStylesStyles = require("./useTimerStyles.styles");
|
|
12
|
+
const Timer = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
13
|
+
const baseAnimationStyles = (0, _useTimerStylesStyles.useBaseAnimationStyles)();
|
|
14
|
+
const { running , timeout , onTimeout } = props;
|
|
15
|
+
const style = {
|
|
16
|
+
animationDuration: `${timeout}ms`,
|
|
17
|
+
animationPlayState: running ? 'running' : 'paused'
|
|
18
|
+
};
|
|
19
|
+
if (timeout < 0) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return /*#__PURE__*/ _react.createElement("span", {
|
|
23
|
+
onAnimationEnd: onTimeout,
|
|
24
|
+
"data-timer-status": style.animationPlayState,
|
|
25
|
+
ref: ref,
|
|
26
|
+
style: style,
|
|
27
|
+
className: baseAnimationStyles
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
Timer.displayName = 'Timer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Timer.js"],"sourcesContent":["import * as React from 'react';\nimport { useBaseAnimationStyles } from './useTimerStyles.styles';\nexport const Timer = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const baseAnimationStyles = useBaseAnimationStyles();\n const { running , timeout , onTimeout } = props;\n const style = {\n animationDuration: `${timeout}ms`,\n animationPlayState: running ? 'running' : 'paused'\n };\n if (timeout < 0) {\n return null;\n }\n return /*#__PURE__*/ React.createElement(\"span\", {\n onAnimationEnd: onTimeout,\n \"data-timer-status\": style.animationPlayState,\n ref: ref,\n style: style,\n className: baseAnimationStyles\n });\n});\nTimer.displayName = 'Timer';\n"],"names":["Timer","React","forwardRef","props","ref","baseAnimationStyles","useBaseAnimationStyles","running","timeout","onTimeout","style","animationDuration","animationPlayState","createElement","onAnimationEnd","className","displayName"],"mappings":";;;;+BAEaA;;aAAAA;;;6DAFU;sCACgB;AAChC,MAAMA,QAAQ,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAM;IAC9D,MAAMC,sBAAsBC,IAAAA,4CAAsB;IAClD,MAAM,EAAEC,QAAO,EAAGC,QAAO,EAAGC,UAAS,EAAG,GAAGN;IAC3C,MAAMO,QAAQ;QACVC,mBAAmB,CAAC,EAAEH,QAAQ,EAAE,CAAC;QACjCI,oBAAoBL,UAAU,YAAY,QAAQ;IACtD;IACA,IAAIC,UAAU,GAAG;QACb,OAAO,IAAI;IACf,CAAC;IACD,OAAO,WAAW,GAAGP,OAAMY,aAAa,CAAC,QAAQ;QAC7CC,gBAAgBL;QAChB,qBAAqBC,MAAME,kBAAkB;QAC7CR,KAAKA;QACLM,OAAOA;QACPK,WAAWV;IACf;AACJ;AACAL,MAAMgB,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './Timer';\n"],"names":[],"mappings":";;;;;oBAAc"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useBaseAnimationStyles", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>useBaseAnimationStyles
|
|
8
|
+
});
|
|
9
|
+
const _react = require("@griffel/react");
|
|
10
|
+
const useBaseAnimationStyles = /*#__PURE__*/ (0, _react["__resetStyles"])("r17x0t3n", "r75casi", [
|
|
11
|
+
".r17x0t3n{-webkit-animation-name:rsacmq1;animation-name:rsacmq1;}",
|
|
12
|
+
"@-webkit-keyframes rsacmq1{from{opacity:0;}to{opacity:0;}}",
|
|
13
|
+
"@-webkit-keyframes rsacmq1{from{opacity:0;}to{opacity:0;}}",
|
|
14
|
+
"@keyframes rsacmq1{from{opacity:0;}to{opacity:0;}}",
|
|
15
|
+
".r75casi{-webkit-animation-name:rsacmq1;animation-name:rsacmq1;}"
|
|
16
|
+
]); //# sourceMappingURL=useTimerStyles.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useTimerStyles.styles.js"],"sourcesContent":["import { __resetStyles } from '@griffel/react';\nexport const useBaseAnimationStyles = /*#__PURE__*/__resetStyles(\"r17x0t3n\", \"r75casi\", [\".r17x0t3n{-webkit-animation-name:rsacmq1;animation-name:rsacmq1;}\", \"@-webkit-keyframes rsacmq1{from{opacity:0;}to{opacity:0;}}\", \"@-webkit-keyframes rsacmq1{from{opacity:0;}to{opacity:0;}}\", \"@keyframes rsacmq1{from{opacity:0;}to{opacity:0;}}\", \".r75casi{-webkit-animation-name:rsacmq1;animation-name:rsacmq1;}\"]);\n//# sourceMappingURL=useTimerStyles.styles.js.map"],"names":["useBaseAnimationStyles","__resetStyles"],"mappings":";;;;+BACaA;;aAAAA;;uBADiB;AACvB,MAAMA,yBAAyB,WAAW,GAAEC,IAAAA,uBAAa,EAAC,YAAY,WAAW;IAAC;IAAqE;IAA8D;IAA8D;IAAsD;CAAmE,GACnZ,iDAAiD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "Toast", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>Toast
|
|
8
|
+
});
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _useToast = require("./useToast");
|
|
12
|
+
const _renderToast = require("./renderToast");
|
|
13
|
+
const _useToastStylesStyles = require("./useToastStyles.styles");
|
|
14
|
+
const _useToastContextValues = require("./useToastContextValues");
|
|
15
|
+
const Toast = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
16
|
+
const state = (0, _useToast.useToast_unstable)(props, ref);
|
|
17
|
+
(0, _useToastStylesStyles.useToastStyles_unstable)(state);
|
|
18
|
+
return (0, _renderToast.renderToast_unstable)(state, (0, _useToastContextValues.useToastContextValues_unstable)(state));
|
|
19
|
+
});
|
|
20
|
+
Toast.displayName = 'Toast';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Toast.js"],"sourcesContent":["import * as React from 'react';\nimport { useToast_unstable } from './useToast';\nimport { renderToast_unstable } from './renderToast';\nimport { useToastStyles_unstable } from './useToastStyles.styles';\nimport { useToastContextValues_unstable } from './useToastContextValues';\n/**\n * Toast component\n */ export const Toast = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useToast_unstable(props, ref);\n useToastStyles_unstable(state);\n return renderToast_unstable(state, useToastContextValues_unstable(state));\n});\nToast.displayName = 'Toast';\n"],"names":["Toast","React","forwardRef","props","ref","state","useToast_unstable","useToastStyles_unstable","renderToast_unstable","useToastContextValues_unstable","displayName"],"mappings":";;;;+BAOiBA;;aAAAA;;;6DAPM;0BACW;6BACG;sCACG;uCACO;AAGpC,MAAMA,QAAQ,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAM;IAClE,MAAMC,QAAQC,IAAAA,2BAAiB,EAACH,OAAOC;IACvCG,IAAAA,6CAAuB,EAACF;IACxB,OAAOG,IAAAA,iCAAoB,EAACH,OAAOI,IAAAA,qDAA8B,EAACJ;AACtE;AACAL,MAAMU,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./Toast"), exports);
|
|
7
|
+
_exportStar(require("./Toast.types"), exports);
|
|
8
|
+
_exportStar(require("./renderToast"), exports);
|
|
9
|
+
_exportStar(require("./useToast"), exports);
|
|
10
|
+
_exportStar(require("./useToastStyles.styles"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './Toast';\nexport * from './Toast.types';\nexport * from './renderToast';\nexport * from './useToast';\nexport * from './useToastStyles.styles';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** @jsxRuntime classic */ /** @jsx createElement */ "use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderToast_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>renderToast_unstable
|
|
8
|
+
});
|
|
9
|
+
const _reactJsxRuntime = require("@fluentui/react-jsx-runtime");
|
|
10
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
11
|
+
const _reactSharedContexts = require("@fluentui/react-shared-contexts");
|
|
12
|
+
const renderToast_unstable = (state, contextValues)=>{
|
|
13
|
+
const { slots , slotProps } = (0, _reactUtilities.getSlotsNext)(state);
|
|
14
|
+
return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(_reactSharedContexts.BackgroundAppearanceProvider, {
|
|
15
|
+
value: contextValues.backgroundAppearance
|
|
16
|
+
}, /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.root, slotProps.root));
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderToast.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\nimport { BackgroundAppearanceProvider } from '@fluentui/react-shared-contexts';\n/**\n * Render the final JSX of Toast\n */ export const renderToast_unstable = (state, contextValues)=>{\n const { slots , slotProps } = getSlotsNext(state);\n return /*#__PURE__*/ createElement(BackgroundAppearanceProvider, {\n value: contextValues.backgroundAppearance\n }, /*#__PURE__*/ createElement(slots.root, slotProps.root));\n};\n"],"names":["renderToast_unstable","state","contextValues","slots","slotProps","getSlotsNext","createElement","BackgroundAppearanceProvider","value","backgroundAppearance","root"],"mappings":"AAAA,wBAAwB,GAAG,uBAAuB;;;;+BAKjCA;;aAAAA;;iCALkE;gCACtD;qCACgB;AAGlC,MAAMA,uBAAuB,CAACC,OAAOC,gBAAgB;IAC5D,MAAM,EAAEC,MAAK,EAAGC,UAAS,EAAG,GAAGC,IAAAA,4BAAY,EAACJ;IAC5C,OAAO,WAAW,GAAGK,IAAAA,8BAAa,EAACC,iDAA4B,EAAE;QAC7DC,OAAON,cAAcO,oBAAoB;IAC7C,GAAG,WAAW,GAAGH,IAAAA,8BAAa,EAACH,MAAMO,IAAI,EAAEN,UAAUM,IAAI;AAC7D"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useToast_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>useToast_unstable
|
|
8
|
+
});
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
12
|
+
const useToast_unstable = (props, ref)=>{
|
|
13
|
+
return {
|
|
14
|
+
components: {
|
|
15
|
+
root: 'div'
|
|
16
|
+
},
|
|
17
|
+
root: (0, _reactUtilities.getNativeElementProps)('div', {
|
|
18
|
+
ref,
|
|
19
|
+
...props
|
|
20
|
+
}),
|
|
21
|
+
backgroundAppearance: props.appearance
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useToast.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\n/**\n * Create the state required to render Toast.\n *\n * The returned state can be modified with hooks such as useToastStyles_unstable,\n * before being passed to renderToast_unstable.\n *\n * @param props - props from this instance of Toast\n * @param ref - reference to root HTMLElement of Toast\n */ export const useToast_unstable = (props, ref)=>{\n return {\n components: {\n root: 'div'\n },\n root: getNativeElementProps('div', {\n ref,\n ...props\n }),\n backgroundAppearance: props.appearance\n };\n};\n"],"names":["useToast_unstable","props","ref","components","root","getNativeElementProps","backgroundAppearance","appearance"],"mappings":";;;;+BAUiBA;;aAAAA;;;6DAVM;gCACe;AAS3B,MAAMA,oBAAoB,CAACC,OAAOC,MAAM;IAC/C,OAAO;QACHC,YAAY;YACRC,MAAM;QACV;QACAA,MAAMC,IAAAA,qCAAqB,EAAC,OAAO;YAC/BH;YACA,GAAGD,KAAK;QACZ;QACAK,sBAAsBL,MAAMM,UAAU;IAC1C;AACJ"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useToastContextValues_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>useToastContextValues_unstable
|
|
8
|
+
});
|
|
9
|
+
function useToastContextValues_unstable(state) {
|
|
10
|
+
const { backgroundAppearance } = state;
|
|
11
|
+
return {
|
|
12
|
+
backgroundAppearance
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useToastContextValues.js"],"sourcesContent":["export function useToastContextValues_unstable(state) {\n const { backgroundAppearance } = state;\n return {\n backgroundAppearance\n };\n}\n"],"names":["useToastContextValues_unstable","state","backgroundAppearance"],"mappings":";;;;+BAAgBA;;aAAAA;;AAAT,SAASA,+BAA+BC,KAAK,EAAE;IAClD,MAAM,EAAEC,qBAAoB,EAAG,GAAGD;IAClC,OAAO;QACHC;IACJ;AACJ"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
toastClassNames: ()=>toastClassNames,
|
|
13
|
+
useToastStyles_unstable: ()=>useToastStyles_unstable
|
|
14
|
+
});
|
|
15
|
+
const _react = require("@griffel/react");
|
|
16
|
+
const toastClassNames = {
|
|
17
|
+
root: 'fui-Toast'
|
|
18
|
+
};
|
|
19
|
+
const useRootBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("rzyoxeq", "r1lipnsg", [
|
|
20
|
+
".rzyoxeq{display:-ms-grid;display:grid;-ms-grid-columns:auto 1fr auto;grid-template-columns:auto 1fr auto;padding-top:12px;padding-right:12px;padding-bottom:12px;padding-left:12px;border-bottom-right-radius:var(--borderRadiusMedium);border-bottom-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:var(--colorTransparentStroke);border-right-color:var(--colorTransparentStroke);border-bottom-color:var(--colorTransparentStroke);border-left-color:var(--colorTransparentStroke);box-shadow:var(--shadow8);font-size:var(--fontSizeBase300);line-height:20px;font-weight:var(--fontWeightSemibold);color:var(--colorNeutralForeground1);background-color:var(--colorNeutralBackground1);}",
|
|
21
|
+
".r1lipnsg{display:-ms-grid;display:grid;-ms-grid-columns:auto 1fr auto;grid-template-columns:auto 1fr auto;padding-top:12px;padding-left:12px;padding-bottom:12px;padding-right:12px;border-bottom-left-radius:var(--borderRadiusMedium);border-bottom-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-width:1px;border-left-width:1px;border-bottom-width:1px;border-right-width:1px;border-top-style:solid;border-left-style:solid;border-bottom-style:solid;border-right-style:solid;border-top-color:var(--colorTransparentStroke);border-left-color:var(--colorTransparentStroke);border-bottom-color:var(--colorTransparentStroke);border-right-color:var(--colorTransparentStroke);box-shadow:var(--shadow8);font-size:var(--fontSizeBase300);line-height:20px;font-weight:var(--fontWeightSemibold);color:var(--colorNeutralForeground1);background-color:var(--colorNeutralBackground1);}"
|
|
22
|
+
]);
|
|
23
|
+
const useStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
24
|
+
inverted: {
|
|
25
|
+
sj55zd: "f1w7i9ko",
|
|
26
|
+
De3pzq: "f5pduvr"
|
|
27
|
+
}
|
|
28
|
+
}, {
|
|
29
|
+
d: [
|
|
30
|
+
".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}",
|
|
31
|
+
".f5pduvr{background-color:var(--colorNeutralBackgroundInverted);}"
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
const useToastStyles_unstable = (state)=>{
|
|
35
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
36
|
+
const styles = useStyles();
|
|
37
|
+
state.root.className = (0, _react.mergeClasses)(toastClassNames.root, rootBaseClassName, state.backgroundAppearance === 'inverted' && styles.inverted, state.root.className);
|
|
38
|
+
return state;
|
|
39
|
+
}; //# sourceMappingURL=useToastStyles.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useToastStyles.styles.js"],"sourcesContent":["import { __resetStyles, __styles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const toastClassNames = {\n root: 'fui-Toast'\n};\nconst useRootBaseClassName = /*#__PURE__*/__resetStyles(\"rzyoxeq\", \"r1lipnsg\", [\".rzyoxeq{display:-ms-grid;display:grid;-ms-grid-columns:auto 1fr auto;grid-template-columns:auto 1fr auto;padding-top:12px;padding-right:12px;padding-bottom:12px;padding-left:12px;border-bottom-right-radius:var(--borderRadiusMedium);border-bottom-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:var(--colorTransparentStroke);border-right-color:var(--colorTransparentStroke);border-bottom-color:var(--colorTransparentStroke);border-left-color:var(--colorTransparentStroke);box-shadow:var(--shadow8);font-size:var(--fontSizeBase300);line-height:20px;font-weight:var(--fontWeightSemibold);color:var(--colorNeutralForeground1);background-color:var(--colorNeutralBackground1);}\", \".r1lipnsg{display:-ms-grid;display:grid;-ms-grid-columns:auto 1fr auto;grid-template-columns:auto 1fr auto;padding-top:12px;padding-left:12px;padding-bottom:12px;padding-right:12px;border-bottom-left-radius:var(--borderRadiusMedium);border-bottom-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-width:1px;border-left-width:1px;border-bottom-width:1px;border-right-width:1px;border-top-style:solid;border-left-style:solid;border-bottom-style:solid;border-right-style:solid;border-top-color:var(--colorTransparentStroke);border-left-color:var(--colorTransparentStroke);border-bottom-color:var(--colorTransparentStroke);border-right-color:var(--colorTransparentStroke);box-shadow:var(--shadow8);font-size:var(--fontSizeBase300);line-height:20px;font-weight:var(--fontWeightSemibold);color:var(--colorNeutralForeground1);background-color:var(--colorNeutralBackground1);}\"]);\nconst useStyles = /*#__PURE__*/__styles({\n inverted: {\n sj55zd: \"f1w7i9ko\",\n De3pzq: \"f5pduvr\"\n }\n}, {\n d: [\".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}\", \".f5pduvr{background-color:var(--colorNeutralBackgroundInverted);}\"]\n});\n/**\n * Apply styling to the Toast slots based on the state\n */\nexport const useToastStyles_unstable = state => {\n const rootBaseClassName = useRootBaseClassName();\n const styles = useStyles();\n state.root.className = mergeClasses(toastClassNames.root, rootBaseClassName, state.backgroundAppearance === 'inverted' && styles.inverted, state.root.className);\n return state;\n};\n//# sourceMappingURL=useToastStyles.styles.js.map"],"names":["toastClassNames","useToastStyles_unstable","root","useRootBaseClassName","__resetStyles","useStyles","__styles","inverted","sj55zd","De3pzq","d","state","rootBaseClassName","styles","className","mergeClasses","backgroundAppearance"],"mappings":";;;;;;;;;;;IAEaA,eAAe,MAAfA;IAeAC,uBAAuB,MAAvBA;;uBAjBqD;AAE3D,MAAMD,kBAAkB;IAC7BE,MAAM;AACR;AACA,MAAMC,uBAAuB,WAAW,GAAEC,IAAAA,uBAAa,EAAC,WAAW,YAAY;IAAC;IAA08B;CAA08B;AACp+D,MAAMC,YAAY,WAAW,GAAEC,IAAAA,kBAAQ,EAAC;IACtCC,UAAU;QACRC,QAAQ;QACRC,QAAQ;IACV;AACF,GAAG;IACDC,GAAG;QAAC;QAA4D;KAAoE;AACtI;AAIO,MAAMT,0BAA0BU,CAAAA,QAAS;IAC9C,MAAMC,oBAAoBT;IAC1B,MAAMU,SAASR;IACfM,MAAMT,IAAI,CAACY,SAAS,GAAGC,IAAAA,mBAAY,EAACf,gBAAgBE,IAAI,EAAEU,mBAAmBD,MAAMK,oBAAoB,KAAK,cAAcH,OAAON,QAAQ,EAAEI,MAAMT,IAAI,CAACY,SAAS;IAC/J,OAAOH;AACT,GACA,iDAAiD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "ToastBody", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>ToastBody
|
|
8
|
+
});
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _useToastBody = require("./useToastBody");
|
|
12
|
+
const _renderToastBody = require("./renderToastBody");
|
|
13
|
+
const _useToastBodyStylesStyles = require("./useToastBodyStyles.styles");
|
|
14
|
+
const ToastBody = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
15
|
+
const state = (0, _useToastBody.useToastBody_unstable)(props, ref);
|
|
16
|
+
(0, _useToastBodyStylesStyles.useToastBodyStyles_unstable)(state);
|
|
17
|
+
return (0, _renderToastBody.renderToastBody_unstable)(state);
|
|
18
|
+
});
|
|
19
|
+
ToastBody.displayName = 'ToastBody';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ToastBody.js"],"sourcesContent":["import * as React from 'react';\nimport { useToastBody_unstable } from './useToastBody';\nimport { renderToastBody_unstable } from './renderToastBody';\nimport { useToastBodyStyles_unstable } from './useToastBodyStyles.styles';\n/**\n * ToastBody component\n */ export const ToastBody = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useToastBody_unstable(props, ref);\n useToastBodyStyles_unstable(state);\n return renderToastBody_unstable(state);\n});\nToastBody.displayName = 'ToastBody';\n"],"names":["ToastBody","React","forwardRef","props","ref","state","useToastBody_unstable","useToastBodyStyles_unstable","renderToastBody_unstable","displayName"],"mappings":";;;;+BAMiBA;;aAAAA;;;6DANM;8BACe;iCACG;0CACG;AAGjC,MAAMA,YAAY,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAM;IACtE,MAAMC,QAAQC,IAAAA,mCAAqB,EAACH,OAAOC;IAC3CG,IAAAA,qDAA2B,EAACF;IAC5B,OAAOG,IAAAA,yCAAwB,EAACH;AACpC;AACAL,UAAUS,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./ToastBody"), exports);
|
|
7
|
+
_exportStar(require("./ToastBody.types"), exports);
|
|
8
|
+
_exportStar(require("./renderToastBody"), exports);
|
|
9
|
+
_exportStar(require("./useToastBody"), exports);
|
|
10
|
+
_exportStar(require("./useToastBodyStyles.styles"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './ToastBody';\nexport * from './ToastBody.types';\nexport * from './renderToastBody';\nexport * from './useToastBody';\nexport * from './useToastBodyStyles.styles';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** @jsxRuntime classic */ /** @jsxFrag Fragment */ /** @jsx createElement */ "use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderToastBody_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>renderToastBody_unstable
|
|
8
|
+
});
|
|
9
|
+
const _reactJsxRuntime = require("@fluentui/react-jsx-runtime");
|
|
10
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
11
|
+
const renderToastBody_unstable = (state)=>{
|
|
12
|
+
const { slots , slotProps } = (0, _reactUtilities.getSlotsNext)(state);
|
|
13
|
+
return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(_reactJsxRuntime.Fragment, null, /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.root, slotProps.root), slots.subtitle ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.subtitle, slotProps.subtitle) : null);
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderToastBody.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 ToastBody\n */ export const renderToastBody_unstable = (state)=>{\n const { slots , slotProps } = getSlotsNext(state);\n return /*#__PURE__*/ createElement(Fragment, null, /*#__PURE__*/ createElement(slots.root, slotProps.root), slots.subtitle ? /*#__PURE__*/ createElement(slots.subtitle, slotProps.subtitle) : null);\n};\n"],"names":["renderToastBody_unstable","state","slots","slotProps","getSlotsNext","createElement","Fragment","root","subtitle"],"mappings":"AAAA,wBAAwB,GAAG,sBAAsB,GAAG,uBAAuB;;;;+BAI1DA;;aAAAA;;iCAJqG;gCACzF;AAGlB,MAAMA,2BAA2B,CAACC,QAAQ;IACjD,MAAM,EAAEC,MAAK,EAAGC,UAAS,EAAG,GAAGC,IAAAA,4BAAY,EAACH;IAC5C,OAAO,WAAW,GAAGI,IAAAA,8BAAa,EAACC,yBAAQ,EAAE,IAAI,EAAE,WAAW,GAAGD,IAAAA,8BAAa,EAACH,MAAMK,IAAI,EAAEJ,UAAUI,IAAI,GAAGL,MAAMM,QAAQ,GAAG,WAAW,GAAGH,IAAAA,8BAAa,EAACH,MAAMM,QAAQ,EAAEL,UAAUK,QAAQ,IAAI,IAAI;AACvM"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useToastBody_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>useToastBody_unstable
|
|
8
|
+
});
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
12
|
+
const _toastContainerContext = require("../../contexts/toastContainerContext");
|
|
13
|
+
const _reactSharedContexts = require("@fluentui/react-shared-contexts");
|
|
14
|
+
const useToastBody_unstable = (props, ref)=>{
|
|
15
|
+
const backgroundAppearance = (0, _reactSharedContexts.useBackgroundAppearance)();
|
|
16
|
+
const { bodyId } = (0, _toastContainerContext.useToastContainerContext)();
|
|
17
|
+
return {
|
|
18
|
+
components: {
|
|
19
|
+
root: 'div',
|
|
20
|
+
subtitle: 'div'
|
|
21
|
+
},
|
|
22
|
+
subtitle: (0, _reactUtilities.resolveShorthand)(props.subtitle),
|
|
23
|
+
root: (0, _reactUtilities.getNativeElementProps)('div', {
|
|
24
|
+
ref,
|
|
25
|
+
id: bodyId,
|
|
26
|
+
...props
|
|
27
|
+
}),
|
|
28
|
+
backgroundAppearance
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useToastBody.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\nimport { useBackgroundAppearance } from '@fluentui/react-shared-contexts';\n/**\n * Create the state required to render ToastBody.\n *\n * The returned state can be modified with hooks such as useToastBodyStyles_unstable,\n * before being passed to renderToastBody_unstable.\n *\n * @param props - props from this instance of ToastBody\n * @param ref - reference to root HTMLElement of ToastBody\n */ export const useToastBody_unstable = (props, ref)=>{\n const backgroundAppearance = useBackgroundAppearance();\n const { bodyId } = useToastContainerContext();\n return {\n components: {\n root: 'div',\n subtitle: 'div'\n },\n subtitle: resolveShorthand(props.subtitle),\n root: getNativeElementProps('div', {\n ref,\n id: bodyId,\n ...props\n }),\n backgroundAppearance\n };\n};\n"],"names":["useToastBody_unstable","props","ref","backgroundAppearance","useBackgroundAppearance","bodyId","useToastContainerContext","components","root","subtitle","resolveShorthand","getNativeElementProps","id"],"mappings":";;;;+BAYiBA;;aAAAA;;;6DAZM;gCACiC;uCACf;qCACD;AAS7B,MAAMA,wBAAwB,CAACC,OAAOC,MAAM;IACnD,MAAMC,uBAAuBC,IAAAA,4CAAuB;IACpD,MAAM,EAAEC,OAAM,EAAG,GAAGC,IAAAA,+CAAwB;IAC5C,OAAO;QACHC,YAAY;YACRC,MAAM;YACNC,UAAU;QACd;QACAA,UAAUC,IAAAA,gCAAgB,EAACT,MAAMQ,QAAQ;QACzCD,MAAMG,IAAAA,qCAAqB,EAAC,OAAO;YAC/BT;YACAU,IAAIP;YACJ,GAAGJ,KAAK;QACZ;QACAE;IACJ;AACJ"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
toastBodyClassNames: ()=>toastBodyClassNames,
|
|
13
|
+
useToastBodyStyles_unstable: ()=>useToastBodyStyles_unstable
|
|
14
|
+
});
|
|
15
|
+
const _react = require("@griffel/react");
|
|
16
|
+
const toastBodyClassNames = {
|
|
17
|
+
root: 'fui-ToastBody',
|
|
18
|
+
subtitle: 'fui-ToastBody__subtitle'
|
|
19
|
+
};
|
|
20
|
+
const useRootBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("rnxxsue", null, [
|
|
21
|
+
".rnxxsue{-ms-grid-column:2;grid-column-start:2;-ms-grid-row-span:1;grid-column-end:3;padding-top:6px;font-size:var(--fontSizeBase300);line-height:var(--fontSizeBase300);font-weight:var(--fontWeightRegular);color:var(--colorNeutralForeground1);}"
|
|
22
|
+
]);
|
|
23
|
+
const useSubtitleBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("rzjw1xk", null, [
|
|
24
|
+
".rzjw1xk{padding-top:4px;-ms-grid-column:2;grid-column-start:2;-ms-grid-row-span:1;grid-column-end:3;font-size:var(--fontSizeBase200);line-height:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);color:var(--colorNeutralForeground2);}"
|
|
25
|
+
]);
|
|
26
|
+
const useInvertedStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
27
|
+
root: {
|
|
28
|
+
sj55zd: "f1w7i9ko"
|
|
29
|
+
},
|
|
30
|
+
subtitle: {
|
|
31
|
+
sj55zd: "f1w7i9ko"
|
|
32
|
+
}
|
|
33
|
+
}, {
|
|
34
|
+
d: [
|
|
35
|
+
".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}"
|
|
36
|
+
]
|
|
37
|
+
});
|
|
38
|
+
const useToastBodyStyles_unstable = (state)=>{
|
|
39
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
40
|
+
const subtitleBaseClassName = useSubtitleBaseClassName();
|
|
41
|
+
const invertedStyles = useInvertedStyles();
|
|
42
|
+
state.root.className = (0, _react.mergeClasses)(toastBodyClassNames.root, rootBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.root, state.root.className);
|
|
43
|
+
if (state.subtitle) {
|
|
44
|
+
state.subtitle.className = (0, _react.mergeClasses)(toastBodyClassNames.subtitle, subtitleBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.subtitle, state.subtitle.className);
|
|
45
|
+
}
|
|
46
|
+
return state;
|
|
47
|
+
}; //# sourceMappingURL=useToastBodyStyles.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useToastBodyStyles.styles.js"],"sourcesContent":["import { __resetStyles, __styles, 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 = /*#__PURE__*/__resetStyles(\"rnxxsue\", null, [\".rnxxsue{-ms-grid-column:2;grid-column-start:2;-ms-grid-row-span:1;grid-column-end:3;padding-top:6px;font-size:var(--fontSizeBase300);line-height:var(--fontSizeBase300);font-weight:var(--fontWeightRegular);color:var(--colorNeutralForeground1);}\"]);\nconst useSubtitleBaseClassName = /*#__PURE__*/__resetStyles(\"rzjw1xk\", null, [\".rzjw1xk{padding-top:4px;-ms-grid-column:2;grid-column-start:2;-ms-grid-row-span:1;grid-column-end:3;font-size:var(--fontSizeBase200);line-height:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);color:var(--colorNeutralForeground2);}\"]);\nconst useInvertedStyles = /*#__PURE__*/__styles({\n root: {\n sj55zd: \"f1w7i9ko\"\n },\n subtitle: {\n sj55zd: \"f1w7i9ko\"\n }\n}, {\n d: [\".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}\"]\n});\n/**\n * Apply styling to the ToastBody slots based on the state\n */\nexport const useToastBodyStyles_unstable = state => {\n const rootBaseClassName = useRootBaseClassName();\n const subtitleBaseClassName = useSubtitleBaseClassName();\n const invertedStyles = useInvertedStyles();\n state.root.className = mergeClasses(toastBodyClassNames.root, rootBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.root, state.root.className);\n if (state.subtitle) {\n state.subtitle.className = mergeClasses(toastBodyClassNames.subtitle, subtitleBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.subtitle, state.subtitle.className);\n }\n return state;\n};\n//# sourceMappingURL=useToastBodyStyles.styles.js.map"],"names":["toastBodyClassNames","useToastBodyStyles_unstable","root","subtitle","useRootBaseClassName","__resetStyles","useSubtitleBaseClassName","useInvertedStyles","__styles","sj55zd","d","state","rootBaseClassName","subtitleBaseClassName","invertedStyles","className","mergeClasses","backgroundAppearance"],"mappings":";;;;;;;;;;;IAEaA,mBAAmB,MAAnBA;IAmBAC,2BAA2B,MAA3BA;;uBArByC;AAE/C,MAAMD,sBAAsB;IACjCE,MAAM;IACNC,UAAU;AACZ;AACA,MAAMC,uBAAuB,WAAW,GAAEC,IAAAA,uBAAa,EAAC,WAAW,IAAI,EAAE;IAAC;CAAuP;AACjU,MAAMC,2BAA2B,WAAW,GAAED,IAAAA,uBAAa,EAAC,WAAW,IAAI,EAAE;IAAC;CAAuP;AACrU,MAAME,oBAAoB,WAAW,GAAEC,IAAAA,kBAAQ,EAAC;IAC9CN,MAAM;QACJO,QAAQ;IACV;IACAN,UAAU;QACRM,QAAQ;IACV;AACF,GAAG;IACDC,GAAG;QAAC;KAA2D;AACjE;AAIO,MAAMT,8BAA8BU,CAAAA,QAAS;IAClD,MAAMC,oBAAoBR;IAC1B,MAAMS,wBAAwBP;IAC9B,MAAMQ,iBAAiBP;IACvBI,MAAMT,IAAI,CAACa,SAAS,GAAGC,IAAAA,mBAAY,EAAChB,oBAAoBE,IAAI,EAAEU,mBAAmBD,MAAMM,oBAAoB,KAAK,cAAcH,eAAeZ,IAAI,EAAES,MAAMT,IAAI,CAACa,SAAS;IACvK,IAAIJ,MAAMR,QAAQ,EAAE;QAClBQ,MAAMR,QAAQ,CAACY,SAAS,GAAGC,IAAAA,mBAAY,EAAChB,oBAAoBG,QAAQ,EAAEU,uBAAuBF,MAAMM,oBAAoB,KAAK,cAAcH,eAAeX,QAAQ,EAAEQ,MAAMR,QAAQ,CAACY,SAAS;IAC7L,CAAC;IACD,OAAOJ;AACT,GACA,qDAAqD"}
|