@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":[],"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("./ToastTitle"), exports);
|
|
7
|
+
_exportStar(require("./ToastTitle.types"), exports);
|
|
8
|
+
_exportStar(require("./renderToastTitle"), exports);
|
|
9
|
+
_exportStar(require("./useToastTitle"), exports);
|
|
10
|
+
_exportStar(require("./useToastTitleStyles.styles"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './ToastTitle';\nexport * from './ToastTitle.types';\nexport * from './renderToastTitle';\nexport * from './useToastTitle';\nexport * from './useToastTitleStyles.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, "renderToastTitle_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>renderToastTitle_unstable
|
|
8
|
+
});
|
|
9
|
+
const _reactJsxRuntime = require("@fluentui/react-jsx-runtime");
|
|
10
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
11
|
+
const renderToastTitle_unstable = (state)=>{
|
|
12
|
+
const { slots , slotProps } = (0, _reactUtilities.getSlotsNext)(state);
|
|
13
|
+
return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(_reactJsxRuntime.Fragment, null, slots.media ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.media, slotProps.media) : null, /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.root, slotProps.root), slots.action ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.action, slotProps.action) : null);
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderToastTitle.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsxFrag Fragment */ /** @jsx createElement */ import { createElement, Fragment } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of ToastTitle\n */ export const renderToastTitle_unstable = (state)=>{\n const { slots , slotProps } = getSlotsNext(state);\n return /*#__PURE__*/ createElement(Fragment, null, slots.media ? /*#__PURE__*/ createElement(slots.media, slotProps.media) : null, /*#__PURE__*/ createElement(slots.root, slotProps.root), slots.action ? /*#__PURE__*/ createElement(slots.action, slotProps.action) : null);\n};\n"],"names":["renderToastTitle_unstable","state","slots","slotProps","getSlotsNext","createElement","Fragment","media","root","action"],"mappings":"AAAA,wBAAwB,GAAG,sBAAsB,GAAG,uBAAuB;;;;+BAI1DA;;aAAAA;;iCAJqG;gCACzF;AAGlB,MAAMA,4BAA4B,CAACC,QAAQ;IAClD,MAAM,EAAEC,MAAK,EAAGC,UAAS,EAAG,GAAGC,IAAAA,4BAAY,EAACH;IAC5C,OAAO,WAAW,GAAGI,IAAAA,8BAAa,EAACC,yBAAQ,EAAE,IAAI,EAAEJ,MAAMK,KAAK,GAAG,WAAW,GAAGF,IAAAA,8BAAa,EAACH,MAAMK,KAAK,EAAEJ,UAAUI,KAAK,IAAI,IAAI,EAAE,WAAW,GAAGF,IAAAA,8BAAa,EAACH,MAAMM,IAAI,EAAEL,UAAUK,IAAI,GAAGN,MAAMO,MAAM,GAAG,WAAW,GAAGJ,IAAAA,8BAAa,EAACH,MAAMO,MAAM,EAAEN,UAAUM,MAAM,IAAI,IAAI;AACjR"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useToastTitle_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>useToastTitle_unstable
|
|
8
|
+
});
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _reactIcons = require("@fluentui/react-icons");
|
|
12
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
13
|
+
const _reactSharedContexts = require("@fluentui/react-shared-contexts");
|
|
14
|
+
const _toastContainerContext = require("../../contexts/toastContainerContext");
|
|
15
|
+
const useToastTitle_unstable = (props, ref)=>{
|
|
16
|
+
const { intent , titleId } = (0, _toastContainerContext.useToastContainerContext)();
|
|
17
|
+
const backgroundAppearance = (0, _reactSharedContexts.useBackgroundAppearance)();
|
|
18
|
+
/** Determine the role and media to render based on the intent */ let defaultIcon;
|
|
19
|
+
switch(intent){
|
|
20
|
+
case 'success':
|
|
21
|
+
defaultIcon = /*#__PURE__*/ _react.createElement(_reactIcons.CheckmarkCircleFilled, null);
|
|
22
|
+
break;
|
|
23
|
+
case 'error':
|
|
24
|
+
defaultIcon = /*#__PURE__*/ _react.createElement(_reactIcons.DismissCircleFilled, null);
|
|
25
|
+
break;
|
|
26
|
+
case 'warning':
|
|
27
|
+
defaultIcon = /*#__PURE__*/ _react.createElement(_reactIcons.WarningFilled, null);
|
|
28
|
+
break;
|
|
29
|
+
case 'info':
|
|
30
|
+
defaultIcon = /*#__PURE__*/ _react.createElement(_reactIcons.InfoFilled, null);
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
action: (0, _reactUtilities.resolveShorthand)(props.action),
|
|
35
|
+
components: {
|
|
36
|
+
root: 'div',
|
|
37
|
+
media: 'div',
|
|
38
|
+
action: 'div'
|
|
39
|
+
},
|
|
40
|
+
media: (0, _reactUtilities.resolveShorthand)(props.media, {
|
|
41
|
+
required: !!intent,
|
|
42
|
+
defaultProps: {
|
|
43
|
+
children: defaultIcon
|
|
44
|
+
}
|
|
45
|
+
}),
|
|
46
|
+
root: (0, _reactUtilities.getNativeElementProps)('div', {
|
|
47
|
+
ref,
|
|
48
|
+
children: props.children,
|
|
49
|
+
id: titleId,
|
|
50
|
+
...props
|
|
51
|
+
}),
|
|
52
|
+
intent,
|
|
53
|
+
backgroundAppearance
|
|
54
|
+
};
|
|
55
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useToastTitle.js"],"sourcesContent":["import * as React from 'react';\nimport { CheckmarkCircleFilled, DismissCircleFilled, InfoFilled, WarningFilled } from '@fluentui/react-icons';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport { useBackgroundAppearance } from '@fluentui/react-shared-contexts';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\n/**\n * Create the state required to render ToastTitle.\n *\n * The returned state can be modified with hooks such as useToastTitleStyles_unstable,\n * before being passed to renderToastTitle_unstable.\n *\n * @param props - props from this instance of ToastTitle\n * @param ref - reference to root HTMLElement of ToastTitle\n */ export const useToastTitle_unstable = (props, ref)=>{\n const { intent , titleId } = useToastContainerContext();\n const backgroundAppearance = useBackgroundAppearance();\n /** Determine the role and media to render based on the intent */ let defaultIcon;\n switch(intent){\n case 'success':\n defaultIcon = /*#__PURE__*/ React.createElement(CheckmarkCircleFilled, null);\n break;\n case 'error':\n defaultIcon = /*#__PURE__*/ React.createElement(DismissCircleFilled, null);\n break;\n case 'warning':\n defaultIcon = /*#__PURE__*/ React.createElement(WarningFilled, null);\n break;\n case 'info':\n defaultIcon = /*#__PURE__*/ React.createElement(InfoFilled, null);\n break;\n }\n return {\n action: resolveShorthand(props.action),\n components: {\n root: 'div',\n media: 'div',\n action: 'div'\n },\n media: resolveShorthand(props.media, {\n required: !!intent,\n defaultProps: {\n children: defaultIcon\n }\n }),\n root: getNativeElementProps('div', {\n ref,\n children: props.children,\n id: titleId,\n ...props\n }),\n intent,\n backgroundAppearance\n };\n};\n"],"names":["useToastTitle_unstable","props","ref","intent","titleId","useToastContainerContext","backgroundAppearance","useBackgroundAppearance","defaultIcon","React","createElement","CheckmarkCircleFilled","DismissCircleFilled","WarningFilled","InfoFilled","action","resolveShorthand","components","root","media","required","defaultProps","children","getNativeElementProps","id"],"mappings":";;;;+BAaiBA;;aAAAA;;;6DAbM;4BAC+D;gCAC9B;qCAChB;uCACC;AAS9B,MAAMA,yBAAyB,CAACC,OAAOC,MAAM;IACpD,MAAM,EAAEC,OAAM,EAAGC,QAAO,EAAG,GAAGC,IAAAA,+CAAwB;IACtD,MAAMC,uBAAuBC,IAAAA,4CAAuB;IACpD,+DAA+D,GAAG,IAAIC;IACtE,OAAOL;QACH,KAAK;YACDK,cAAc,WAAW,GAAGC,OAAMC,aAAa,CAACC,iCAAqB,EAAE,IAAI;YAC3E,KAAM;QACV,KAAK;YACDH,cAAc,WAAW,GAAGC,OAAMC,aAAa,CAACE,+BAAmB,EAAE,IAAI;YACzE,KAAM;QACV,KAAK;YACDJ,cAAc,WAAW,GAAGC,OAAMC,aAAa,CAACG,yBAAa,EAAE,IAAI;YACnE,KAAM;QACV,KAAK;YACDL,cAAc,WAAW,GAAGC,OAAMC,aAAa,CAACI,sBAAU,EAAE,IAAI;YAChE,KAAM;IACd;IACA,OAAO;QACHC,QAAQC,IAAAA,gCAAgB,EAACf,MAAMc,MAAM;QACrCE,YAAY;YACRC,MAAM;YACNC,OAAO;YACPJ,QAAQ;QACZ;QACAI,OAAOH,IAAAA,gCAAgB,EAACf,MAAMkB,KAAK,EAAE;YACjCC,UAAU,CAAC,CAACjB;YACZkB,cAAc;gBACVC,UAAUd;YACd;QACJ;QACAU,MAAMK,IAAAA,qCAAqB,EAAC,OAAO;YAC/BrB;YACAoB,UAAUrB,MAAMqB,QAAQ;YACxBE,IAAIpB;YACJ,GAAGH,KAAK;QACZ;QACAE;QACAG;IACJ;AACJ"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
toastTitleClassNames: ()=>toastTitleClassNames,
|
|
13
|
+
useToastTitleStyles_unstable: ()=>useToastTitleStyles_unstable
|
|
14
|
+
});
|
|
15
|
+
const _react = require("@griffel/react");
|
|
16
|
+
const toastTitleClassNames = {
|
|
17
|
+
root: 'fui-ToastTitle',
|
|
18
|
+
media: 'fui-ToastTitle__media',
|
|
19
|
+
action: 'fui-ToastTitle__action'
|
|
20
|
+
};
|
|
21
|
+
const useRootBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("r1mlor6q", null, [
|
|
22
|
+
".r1mlor6q{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-grid-column-span:3;grid-column-end:3;color:var(--colorNeutralForeground1);}"
|
|
23
|
+
]);
|
|
24
|
+
const useMediaBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("rnm72z1", "rzj6g76", [
|
|
25
|
+
".rnm72z1{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-grid-column-span:2;grid-column-end:2;padding-right:8px;font-size:16px;color:var(--colorNeutralForeground1);}",
|
|
26
|
+
".rzj6g76{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-grid-column-span:2;grid-column-end:2;padding-left:8px;font-size:16px;color:var(--colorNeutralForeground1);}"
|
|
27
|
+
]);
|
|
28
|
+
const useActionBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("r5vrc68", "rzqb88z", [
|
|
29
|
+
".r5vrc68{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-left:12px;-ms-grid-column-span:-1;grid-column-end:-1;color:var(--colorBrandForeground1);}",
|
|
30
|
+
".rzqb88z{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-right:12px;-ms-grid-column-span:-1;grid-column-end:-1;color:var(--colorBrandForeground1);}"
|
|
31
|
+
]);
|
|
32
|
+
const useInvertedStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
33
|
+
root: {
|
|
34
|
+
sj55zd: "f1w7i9ko"
|
|
35
|
+
},
|
|
36
|
+
action: {
|
|
37
|
+
sj55zd: "f1qz2gb0"
|
|
38
|
+
},
|
|
39
|
+
media: {
|
|
40
|
+
sj55zd: "fqpbvvt"
|
|
41
|
+
}
|
|
42
|
+
}, {
|
|
43
|
+
d: [
|
|
44
|
+
".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}",
|
|
45
|
+
".f1qz2gb0{color:var(--colorBrandForegroundInverted);}",
|
|
46
|
+
".fqpbvvt{color:var(--colorNeutralForegroundInverted);}"
|
|
47
|
+
]
|
|
48
|
+
});
|
|
49
|
+
const useIntentIconStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
50
|
+
success: {
|
|
51
|
+
sj55zd: "f1m7fhi8"
|
|
52
|
+
},
|
|
53
|
+
error: {
|
|
54
|
+
sj55zd: "fg9gses"
|
|
55
|
+
},
|
|
56
|
+
warning: {
|
|
57
|
+
sj55zd: "f1k5f75o"
|
|
58
|
+
},
|
|
59
|
+
info: {
|
|
60
|
+
sj55zd: "fkfq4zb"
|
|
61
|
+
}
|
|
62
|
+
}, {
|
|
63
|
+
d: [
|
|
64
|
+
".f1m7fhi8{color:var(--colorPaletteGreenForeground3);}",
|
|
65
|
+
".fg9gses{color:var(--colorPaletteCranberryForeground2);}",
|
|
66
|
+
".f1k5f75o{color:var(--colorPaletteDarkOrangeForeground1);}",
|
|
67
|
+
".fkfq4zb{color:var(--colorNeutralForeground2);}"
|
|
68
|
+
]
|
|
69
|
+
});
|
|
70
|
+
const useIntentIconStylesInverted = /*#__PURE__*/ (0, _react["__styles"])({
|
|
71
|
+
success: {
|
|
72
|
+
sj55zd: "f1pvjcpr"
|
|
73
|
+
},
|
|
74
|
+
error: {
|
|
75
|
+
sj55zd: "fcrp5ll"
|
|
76
|
+
},
|
|
77
|
+
warning: {
|
|
78
|
+
sj55zd: "f1r8f1cl"
|
|
79
|
+
},
|
|
80
|
+
info: {
|
|
81
|
+
sj55zd: "f1w7i9ko"
|
|
82
|
+
}
|
|
83
|
+
}, {
|
|
84
|
+
d: [
|
|
85
|
+
".f1pvjcpr{color:var(--colorPaletteGreenForegroundInverted);}",
|
|
86
|
+
".fcrp5ll{color:var(--colorPaletteRedForegroundInverted);}",
|
|
87
|
+
".f1r8f1cl{color:var(--colorPaletteYellowForegroundInverted);}",
|
|
88
|
+
".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}"
|
|
89
|
+
]
|
|
90
|
+
});
|
|
91
|
+
const useToastTitleStyles_unstable = (state)=>{
|
|
92
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
93
|
+
const actionBaseClassName = useActionBaseClassName();
|
|
94
|
+
const mediaBaseClassName = useMediaBaseClassName();
|
|
95
|
+
const intentIconStyles = useIntentIconStyles();
|
|
96
|
+
const intentIconStylesInverted = useIntentIconStylesInverted();
|
|
97
|
+
const { intent } = state;
|
|
98
|
+
const invertedStyles = useInvertedStyles();
|
|
99
|
+
state.root.className = (0, _react.mergeClasses)(toastTitleClassNames.root, rootBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.root, state.root.className);
|
|
100
|
+
if (state.media) {
|
|
101
|
+
state.media.className = (0, _react.mergeClasses)(toastTitleClassNames.media, mediaBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.media, state.media.className, intent && intentIconStyles[intent], intent && state.backgroundAppearance === 'inverted' && intentIconStylesInverted[intent]);
|
|
102
|
+
}
|
|
103
|
+
if (state.action) {
|
|
104
|
+
state.action.className = (0, _react.mergeClasses)(toastTitleClassNames.action, actionBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.action, state.action.className);
|
|
105
|
+
}
|
|
106
|
+
return state;
|
|
107
|
+
}; //# sourceMappingURL=useToastTitleStyles.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useToastTitleStyles.styles.js"],"sourcesContent":["import { __styles, __resetStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const toastTitleClassNames = {\n root: 'fui-ToastTitle',\n media: 'fui-ToastTitle__media',\n action: 'fui-ToastTitle__action'\n};\nconst useRootBaseClassName = /*#__PURE__*/__resetStyles(\"r1mlor6q\", null, [\".r1mlor6q{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-grid-column-span:3;grid-column-end:3;color:var(--colorNeutralForeground1);}\"]);\nconst useMediaBaseClassName = /*#__PURE__*/__resetStyles(\"rnm72z1\", \"rzj6g76\", [\".rnm72z1{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-grid-column-span:2;grid-column-end:2;padding-right:8px;font-size:16px;color:var(--colorNeutralForeground1);}\", \".rzj6g76{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-grid-column-span:2;grid-column-end:2;padding-left:8px;font-size:16px;color:var(--colorNeutralForeground1);}\"]);\nconst useActionBaseClassName = /*#__PURE__*/__resetStyles(\"r5vrc68\", \"rzqb88z\", [\".r5vrc68{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-left:12px;-ms-grid-column-span:-1;grid-column-end:-1;color:var(--colorBrandForeground1);}\", \".rzqb88z{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-right:12px;-ms-grid-column-span:-1;grid-column-end:-1;color:var(--colorBrandForeground1);}\"]);\nconst useInvertedStyles = /*#__PURE__*/__styles({\n root: {\n sj55zd: \"f1w7i9ko\"\n },\n action: {\n sj55zd: \"f1qz2gb0\"\n },\n media: {\n sj55zd: \"fqpbvvt\"\n }\n}, {\n d: [\".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}\", \".f1qz2gb0{color:var(--colorBrandForegroundInverted);}\", \".fqpbvvt{color:var(--colorNeutralForegroundInverted);}\"]\n});\nconst useIntentIconStyles = /*#__PURE__*/__styles({\n success: {\n sj55zd: \"f1m7fhi8\"\n },\n error: {\n sj55zd: \"fg9gses\"\n },\n warning: {\n sj55zd: \"f1k5f75o\"\n },\n info: {\n sj55zd: \"fkfq4zb\"\n }\n}, {\n d: [\".f1m7fhi8{color:var(--colorPaletteGreenForeground3);}\", \".fg9gses{color:var(--colorPaletteCranberryForeground2);}\", \".f1k5f75o{color:var(--colorPaletteDarkOrangeForeground1);}\", \".fkfq4zb{color:var(--colorNeutralForeground2);}\"]\n});\nconst useIntentIconStylesInverted = /*#__PURE__*/__styles({\n success: {\n sj55zd: \"f1pvjcpr\"\n },\n error: {\n sj55zd: \"fcrp5ll\"\n },\n warning: {\n sj55zd: \"f1r8f1cl\"\n },\n info: {\n sj55zd: \"f1w7i9ko\"\n }\n}, {\n d: [\".f1pvjcpr{color:var(--colorPaletteGreenForegroundInverted);}\", \".fcrp5ll{color:var(--colorPaletteRedForegroundInverted);}\", \".f1r8f1cl{color:var(--colorPaletteYellowForegroundInverted);}\", \".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}\"]\n});\n/**\n * Apply styling to the ToastTitle slots based on the state\n */\nexport const useToastTitleStyles_unstable = state => {\n const rootBaseClassName = useRootBaseClassName();\n const actionBaseClassName = useActionBaseClassName();\n const mediaBaseClassName = useMediaBaseClassName();\n const intentIconStyles = useIntentIconStyles();\n const intentIconStylesInverted = useIntentIconStylesInverted();\n const {\n intent\n } = state;\n const invertedStyles = useInvertedStyles();\n state.root.className = mergeClasses(toastTitleClassNames.root, rootBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.root, state.root.className);\n if (state.media) {\n state.media.className = mergeClasses(toastTitleClassNames.media, mediaBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.media, state.media.className, intent && intentIconStyles[intent], intent && state.backgroundAppearance === 'inverted' && intentIconStylesInverted[intent]);\n }\n if (state.action) {\n state.action.className = mergeClasses(toastTitleClassNames.action, actionBaseClassName, state.backgroundAppearance === 'inverted' && invertedStyles.action, state.action.className);\n }\n return state;\n};\n//# sourceMappingURL=useToastTitleStyles.styles.js.map"],"names":["toastTitleClassNames","useToastTitleStyles_unstable","root","media","action","useRootBaseClassName","__resetStyles","useMediaBaseClassName","useActionBaseClassName","useInvertedStyles","__styles","sj55zd","d","useIntentIconStyles","success","error","warning","info","useIntentIconStylesInverted","state","rootBaseClassName","actionBaseClassName","mediaBaseClassName","intentIconStyles","intentIconStylesInverted","intent","invertedStyles","className","mergeClasses","backgroundAppearance"],"mappings":";;;;;;;;;;;IAEaA,oBAAoB,MAApBA;IAwDAC,4BAA4B,MAA5BA;;uBA1DyC;AAE/C,MAAMD,uBAAuB;IAClCE,MAAM;IACNC,OAAO;IACPC,QAAQ;AACV;AACA,MAAMC,uBAAuB,WAAW,GAAEC,IAAAA,uBAAa,EAAC,YAAY,IAAI,EAAE;IAAC;CAAmQ;AAC9U,MAAMC,wBAAwB,WAAW,GAAED,IAAAA,uBAAa,EAAC,WAAW,WAAW;IAAC;IAAoS;CAAkS;AACtpB,MAAME,yBAAyB,WAAW,GAAEF,IAAAA,uBAAa,EAAC,WAAW,WAAW;IAAC;IAAqR;CAAqR;AAC3nB,MAAMG,oBAAoB,WAAW,GAAEC,IAAAA,kBAAQ,EAAC;IAC9CR,MAAM;QACJS,QAAQ;IACV;IACAP,QAAQ;QACNO,QAAQ;IACV;IACAR,OAAO;QACLQ,QAAQ;IACV;AACF,GAAG;IACDC,GAAG;QAAC;QAA4D;QAAyD;KAAyD;AACpL;AACA,MAAMC,sBAAsB,WAAW,GAAEH,IAAAA,kBAAQ,EAAC;IAChDI,SAAS;QACPH,QAAQ;IACV;IACAI,OAAO;QACLJ,QAAQ;IACV;IACAK,SAAS;QACPL,QAAQ;IACV;IACAM,MAAM;QACJN,QAAQ;IACV;AACF,GAAG;IACDC,GAAG;QAAC;QAAyD;QAA4D;QAA8D;KAAkD;AAC3O;AACA,MAAMM,8BAA8B,WAAW,GAAER,IAAAA,kBAAQ,EAAC;IACxDI,SAAS;QACPH,QAAQ;IACV;IACAI,OAAO;QACLJ,QAAQ;IACV;IACAK,SAAS;QACPL,QAAQ;IACV;IACAM,MAAM;QACJN,QAAQ;IACV;AACF,GAAG;IACDC,GAAG;QAAC;QAAgE;QAA6D;QAAiE;KAA2D;AAC/P;AAIO,MAAMX,+BAA+BkB,CAAAA,QAAS;IACnD,MAAMC,oBAAoBf;IAC1B,MAAMgB,sBAAsBb;IAC5B,MAAMc,qBAAqBf;IAC3B,MAAMgB,mBAAmBV;IACzB,MAAMW,2BAA2BN;IACjC,MAAM,EACJO,OAAM,EACP,GAAGN;IACJ,MAAMO,iBAAiBjB;IACvBU,MAAMjB,IAAI,CAACyB,SAAS,GAAGC,IAAAA,mBAAY,EAAC5B,qBAAqBE,IAAI,EAAEkB,mBAAmBD,MAAMU,oBAAoB,KAAK,cAAcH,eAAexB,IAAI,EAAEiB,MAAMjB,IAAI,CAACyB,SAAS;IACxK,IAAIR,MAAMhB,KAAK,EAAE;QACfgB,MAAMhB,KAAK,CAACwB,SAAS,GAAGC,IAAAA,mBAAY,EAAC5B,qBAAqBG,KAAK,EAAEmB,oBAAoBH,MAAMU,oBAAoB,KAAK,cAAcH,eAAevB,KAAK,EAAEgB,MAAMhB,KAAK,CAACwB,SAAS,EAAEF,UAAUF,gBAAgB,CAACE,OAAO,EAAEA,UAAUN,MAAMU,oBAAoB,KAAK,cAAcL,wBAAwB,CAACC,OAAO;IAC5S,CAAC;IACD,IAAIN,MAAMf,MAAM,EAAE;QAChBe,MAAMf,MAAM,CAACuB,SAAS,GAAGC,IAAAA,mBAAY,EAAC5B,qBAAqBI,MAAM,EAAEiB,qBAAqBF,MAAMU,oBAAoB,KAAK,cAAcH,eAAetB,MAAM,EAAEe,MAAMf,MAAM,CAACuB,SAAS;IACpL,CAAC;IACD,OAAOR;AACT,GACA,sDAAsD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "ToastTrigger", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>ToastTrigger
|
|
8
|
+
});
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _useToastTrigger = require("./useToastTrigger");
|
|
12
|
+
const _renderToastTrigger = require("./renderToastTrigger");
|
|
13
|
+
const ToastTrigger = (props)=>{
|
|
14
|
+
const state = (0, _useToastTrigger.useToastTrigger_unstable)(props);
|
|
15
|
+
return (0, _renderToastTrigger.renderToastTrigger_unstable)(state);
|
|
16
|
+
};
|
|
17
|
+
ToastTrigger.displayName = 'ToastTrigger';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ToastTrigger.js"],"sourcesContent":["import * as React from 'react';\nimport { useToastTrigger_unstable } from './useToastTrigger';\nimport { renderToastTrigger_unstable } from './renderToastTrigger';\n/**\n * ToastTrigger component\n */ export const ToastTrigger = (props)=>{\n const state = useToastTrigger_unstable(props);\n return renderToastTrigger_unstable(state);\n};\nToastTrigger.displayName = 'ToastTrigger';\n"],"names":["ToastTrigger","props","state","useToastTrigger_unstable","renderToastTrigger_unstable","displayName"],"mappings":";;;;+BAKiBA;;aAAAA;;;6DALM;iCACkB;oCACG;AAGjC,MAAMA,eAAe,CAACC,QAAQ;IACrC,MAAMC,QAAQC,IAAAA,yCAAwB,EAACF;IACvC,OAAOG,IAAAA,+CAA2B,EAACF;AACvC;AACAF,aAAaK,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ToastTrigger.types.js"],"sourcesContent":["import * as React from 'react';\n"],"names":[],"mappings":";;;;;6DAAuB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
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("./ToastTrigger"), exports);
|
|
7
|
+
_exportStar(require("./ToastTrigger.types"), exports);
|
|
8
|
+
_exportStar(require("./renderToastTrigger"), exports);
|
|
9
|
+
_exportStar(require("./useToastTrigger"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './ToastTrigger';\nexport * from './ToastTrigger.types';\nexport * from './renderToastTrigger';\nexport * from './useToastTrigger';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render the final JSX of MenuTrigger
|
|
3
|
+
*
|
|
4
|
+
* Only renders children
|
|
5
|
+
*/ "use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
Object.defineProperty(exports, "renderToastTrigger_unstable", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: ()=>renderToastTrigger_unstable
|
|
12
|
+
});
|
|
13
|
+
const renderToastTrigger_unstable = (state)=>state.children;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderToastTrigger.js"],"sourcesContent":["/**\n * Render the final JSX of MenuTrigger\n *\n * Only renders children\n */ export const renderToastTrigger_unstable = (state)=>state.children;\n"],"names":["renderToastTrigger_unstable","state","children"],"mappings":"AAAA;;;;CAIC;;;;+BAAgBA;;aAAAA;;AAAN,MAAMA,8BAA8B,CAACC,QAAQA,MAAMC,QAAQ"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useToastTrigger_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>useToastTrigger_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 _reactAria = require("@fluentui/react-aria");
|
|
13
|
+
const _toastContainerContext = require("../../contexts/toastContainerContext");
|
|
14
|
+
const useToastTrigger_unstable = (props)=>{
|
|
15
|
+
const { children , disableButtonEnhancement =false } = props;
|
|
16
|
+
const { close } = (0, _toastContainerContext.useToastContainerContext)();
|
|
17
|
+
const child = (0, _reactUtilities.getTriggerChild)(children);
|
|
18
|
+
const handleClick = (0, _reactUtilities.useEventCallback)((e)=>{
|
|
19
|
+
var _child_props, _child_props_onClick;
|
|
20
|
+
(_child_props_onClick = (_child_props = child === null || child === void 0 ? void 0 : child.props).onClick) === null || _child_props_onClick === void 0 ? void 0 : _child_props_onClick.call(_child_props, e);
|
|
21
|
+
if (!e.isDefaultPrevented()) {
|
|
22
|
+
close();
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
const triggerChildProps = {
|
|
26
|
+
...child === null || child === void 0 ? void 0 : child.props,
|
|
27
|
+
ref: child === null || child === void 0 ? void 0 : child.ref,
|
|
28
|
+
onClick: handleClick
|
|
29
|
+
};
|
|
30
|
+
const ariaButtonTriggerChildProps = (0, _reactAria.useARIAButtonProps)((child === null || child === void 0 ? void 0 : child.type) === 'button' || (child === null || child === void 0 ? void 0 : child.type) === 'a' ? child.type : 'div', {
|
|
31
|
+
...triggerChildProps,
|
|
32
|
+
type: 'button'
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
children: (0, _reactUtilities.applyTriggerPropsToChildren)(children, disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps)
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useToastTrigger.js"],"sourcesContent":["import * as React from 'react';\nimport { applyTriggerPropsToChildren, getTriggerChild, useEventCallback } from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\n/**\n * A non-visual component that wraps its child\n * and configures them to be the trigger that will close a `Toast`.\n * This component should only accept one child.\n *\n * This component sole purpose is to avoid opting out of the internal controlled open state of a `Toast`\n * Besides being a trigger that closes a toast through context this component doesn't do much,\n * making it basically unnecessary in cases where the trigger is outside of a toast.\n */ export const useToastTrigger_unstable = (props)=>{\n const { children , disableButtonEnhancement =false } = props;\n const { close } = useToastContainerContext();\n const child = getTriggerChild(children);\n const handleClick = useEventCallback((e)=>{\n var _child_props, _child_props_onClick;\n (_child_props_onClick = (_child_props = child === null || child === void 0 ? void 0 : child.props).onClick) === null || _child_props_onClick === void 0 ? void 0 : _child_props_onClick.call(_child_props, e);\n if (!e.isDefaultPrevented()) {\n close();\n }\n });\n const triggerChildProps = {\n ...child === null || child === void 0 ? void 0 : child.props,\n ref: child === null || child === void 0 ? void 0 : child.ref,\n onClick: handleClick\n };\n const ariaButtonTriggerChildProps = useARIAButtonProps((child === null || child === void 0 ? void 0 : child.type) === 'button' || (child === null || child === void 0 ? void 0 : child.type) === 'a' ? child.type : 'div', {\n ...triggerChildProps,\n type: 'button'\n });\n return {\n children: applyTriggerPropsToChildren(children, disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps)\n };\n};\n"],"names":["useToastTrigger_unstable","props","children","disableButtonEnhancement","close","useToastContainerContext","child","getTriggerChild","handleClick","useEventCallback","e","_child_props","_child_props_onClick","onClick","call","isDefaultPrevented","triggerChildProps","ref","ariaButtonTriggerChildProps","useARIAButtonProps","type","applyTriggerPropsToChildren"],"mappings":";;;;+BAYiBA;;aAAAA;;;6DAZM;gCACwD;2BAC5C;uCACM;AAS9B,MAAMA,2BAA2B,CAACC,QAAQ;IACjD,MAAM,EAAEC,SAAQ,EAAGC,0BAA0B,KAAK,CAAA,EAAG,GAAGF;IACxD,MAAM,EAAEG,MAAK,EAAG,GAAGC,IAAAA,+CAAwB;IAC3C,MAAMC,QAAQC,IAAAA,+BAAe,EAACL;IAC9B,MAAMM,cAAcC,IAAAA,gCAAgB,EAAC,CAACC,IAAI;QACtC,IAAIC,cAAcC;QACjBA,CAAAA,uBAAuB,AAACD,CAAAA,eAAeL,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAML,KAAK,AAAD,EAAGY,OAAO,AAAD,MAAO,IAAI,IAAID,yBAAyB,KAAK,IAAI,KAAK,IAAIA,qBAAqBE,IAAI,CAACH,cAAcD,EAAE;QAC7M,IAAI,CAACA,EAAEK,kBAAkB,IAAI;YACzBX;QACJ,CAAC;IACL;IACA,MAAMY,oBAAoB;QACtB,GAAGV,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAML,KAAK;QAC5DgB,KAAKX,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMW,GAAG;QAC5DJ,SAASL;IACb;IACA,MAAMU,8BAA8BC,IAAAA,6BAAkB,EAAC,AAACb,CAAAA,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMc,IAAI,AAAD,MAAO,YAAY,AAACd,CAAAA,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMc,IAAI,AAAD,MAAO,MAAMd,MAAMc,IAAI,GAAG,KAAK,EAAE;QACvN,GAAGJ,iBAAiB;QACpBI,MAAM;IACV;IACA,OAAO;QACHlB,UAAUmB,IAAAA,2CAA2B,EAACnB,UAAUC,2BAA2Ba,oBAAoBE,2BAA2B;IAC9H;AACJ"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "Toaster", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>Toaster
|
|
8
|
+
});
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _useToaster = require("./useToaster");
|
|
12
|
+
const _renderToaster = require("./renderToaster");
|
|
13
|
+
const _useToasterStylesStyles = require("./useToasterStyles.styles");
|
|
14
|
+
const Toaster = (props)=>{
|
|
15
|
+
const state = (0, _useToaster.useToaster_unstable)(props);
|
|
16
|
+
(0, _useToasterStylesStyles.useToasterStyles_unstable)(state);
|
|
17
|
+
return (0, _renderToaster.renderToaster_unstable)(state);
|
|
18
|
+
};
|
|
19
|
+
Toaster.displayName = 'Toaster';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Toaster.js"],"sourcesContent":["import * as React from 'react';\nimport { useToaster_unstable } from './useToaster';\nimport { renderToaster_unstable } from './renderToaster';\nimport { useToasterStyles_unstable } from './useToasterStyles.styles';\n/**\n * Toaster component - renders a collection of toasts dispatched imperatively\n */ export const Toaster = (props)=>{\n const state = useToaster_unstable(props);\n useToasterStyles_unstable(state);\n return renderToaster_unstable(state);\n};\nToaster.displayName = 'Toaster';\n"],"names":["Toaster","props","state","useToaster_unstable","useToasterStyles_unstable","renderToaster_unstable","displayName"],"mappings":";;;;+BAMiBA;;aAAAA;;;6DANM;4BACa;+BACG;wCACG;AAG/B,MAAMA,UAAU,CAACC,QAAQ;IAChC,MAAMC,QAAQC,IAAAA,+BAAmB,EAACF;IAClCG,IAAAA,iDAAyB,EAACF;IAC1B,OAAOG,IAAAA,qCAAsB,EAACH;AAClC;AACAF,QAAQM,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("./Toaster"), exports);
|
|
7
|
+
_exportStar(require("./Toaster.types"), exports);
|
|
8
|
+
_exportStar(require("./renderToaster"), exports);
|
|
9
|
+
_exportStar(require("./useToaster"), exports);
|
|
10
|
+
_exportStar(require("./useToasterStyles.styles"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './Toaster';\nexport * from './Toaster.types';\nexport * from './renderToaster';\nexport * from './useToaster';\nexport * from './useToasterStyles.styles';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** @jsxRuntime classic */ /** @jsxFrag Fragment */ /** @jsx createElement */ "use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderToaster_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>renderToaster_unstable
|
|
8
|
+
});
|
|
9
|
+
const _reactJsxRuntime = require("@fluentui/react-jsx-runtime");
|
|
10
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
11
|
+
const _reactPortal = require("@fluentui/react-portal");
|
|
12
|
+
const _ariaLive = require("../AriaLive");
|
|
13
|
+
const renderToaster_unstable = (state)=>{
|
|
14
|
+
const { announceRef , renderAriaLive } = state;
|
|
15
|
+
const { slots , slotProps } = (0, _reactUtilities.getSlotsNext)(state);
|
|
16
|
+
const hasToasts = !!slots.bottomStart || !!slots.bottomEnd || !!slots.topStart || !!slots.topEnd;
|
|
17
|
+
return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(_reactJsxRuntime.Fragment, null, renderAriaLive ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(_ariaLive.AriaLive, {
|
|
18
|
+
announceRef: announceRef
|
|
19
|
+
}) : null, hasToasts ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(_reactPortal.Portal, null, slots.bottomStart ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.bottomStart, slotProps.bottomStart) : null, slots.bottomEnd ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.bottomEnd, slotProps.bottomEnd) : null, slots.topStart ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.topStart, slotProps.topStart) : null, slots.topEnd ? /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.topEnd, slotProps.topEnd) : null) : null);
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderToaster.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsxFrag Fragment */ /** @jsx createElement */ import { createElement, Fragment } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\nimport { Portal } from '@fluentui/react-portal';\nimport { AriaLive } from '../AriaLive';\n/**\n * Render the final JSX of Toaster\n */ export const renderToaster_unstable = (state)=>{\n const { announceRef , renderAriaLive } = state;\n const { slots , slotProps } = getSlotsNext(state);\n const hasToasts = !!slots.bottomStart || !!slots.bottomEnd || !!slots.topStart || !!slots.topEnd;\n return /*#__PURE__*/ createElement(Fragment, null, renderAriaLive ? /*#__PURE__*/ createElement(AriaLive, {\n announceRef: announceRef\n }) : null, hasToasts ? /*#__PURE__*/ createElement(Portal, null, slots.bottomStart ? /*#__PURE__*/ createElement(slots.bottomStart, slotProps.bottomStart) : null, slots.bottomEnd ? /*#__PURE__*/ createElement(slots.bottomEnd, slotProps.bottomEnd) : null, slots.topStart ? /*#__PURE__*/ createElement(slots.topStart, slotProps.topStart) : null, slots.topEnd ? /*#__PURE__*/ createElement(slots.topEnd, slotProps.topEnd) : null) : null);\n};\n"],"names":["renderToaster_unstable","state","announceRef","renderAriaLive","slots","slotProps","getSlotsNext","hasToasts","bottomStart","bottomEnd","topStart","topEnd","createElement","Fragment","AriaLive","Portal"],"mappings":"AAAA,wBAAwB,GAAG,sBAAsB,GAAG,uBAAuB;;;;+BAM1DA;;aAAAA;;iCANqG;gCACzF;6BACN;0BACE;AAGd,MAAMA,yBAAyB,CAACC,QAAQ;IAC/C,MAAM,EAAEC,YAAW,EAAGC,eAAc,EAAG,GAAGF;IAC1C,MAAM,EAAEG,MAAK,EAAGC,UAAS,EAAG,GAAGC,IAAAA,4BAAY,EAACL;IAC5C,MAAMM,YAAY,CAAC,CAACH,MAAMI,WAAW,IAAI,CAAC,CAACJ,MAAMK,SAAS,IAAI,CAAC,CAACL,MAAMM,QAAQ,IAAI,CAAC,CAACN,MAAMO,MAAM;IAChG,OAAO,WAAW,GAAGC,IAAAA,8BAAa,EAACC,yBAAQ,EAAE,IAAI,EAAEV,iBAAiB,WAAW,GAAGS,IAAAA,8BAAa,EAACE,kBAAQ,EAAE;QACtGZ,aAAaA;IACjB,KAAK,IAAI,EAAEK,YAAY,WAAW,GAAGK,IAAAA,8BAAa,EAACG,mBAAM,EAAE,IAAI,EAAEX,MAAMI,WAAW,GAAG,WAAW,GAAGI,IAAAA,8BAAa,EAACR,MAAMI,WAAW,EAAEH,UAAUG,WAAW,IAAI,IAAI,EAAEJ,MAAMK,SAAS,GAAG,WAAW,GAAGG,IAAAA,8BAAa,EAACR,MAAMK,SAAS,EAAEJ,UAAUI,SAAS,IAAI,IAAI,EAAEL,MAAMM,QAAQ,GAAG,WAAW,GAAGE,IAAAA,8BAAa,EAACR,MAAMM,QAAQ,EAAEL,UAAUK,QAAQ,IAAI,IAAI,EAAEN,MAAMO,MAAM,GAAG,WAAW,GAAGC,IAAAA,8BAAa,EAACR,MAAMO,MAAM,EAAEN,UAAUM,MAAM,IAAI,IAAI,IAAI,IAAI;AACrb"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useToaster_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>useToaster_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 _reactSharedContexts = require("@fluentui/react-shared-contexts");
|
|
13
|
+
const _state = require("../../state");
|
|
14
|
+
const _toastContainer = require("../ToastContainer");
|
|
15
|
+
const useToaster_unstable = (props)=>{
|
|
16
|
+
const { offset , announce: announceProp , ...rest } = props;
|
|
17
|
+
const announceRef = _react.useRef(()=>null);
|
|
18
|
+
const { toastsToRender , isToastVisible , pauseAllToasts , playAllToasts , tryRestoreFocus } = (0, _state.useToaster)(rest);
|
|
19
|
+
const announce = _react.useCallback((message, options)=>announceRef.current(message, options), []);
|
|
20
|
+
const { dir } = (0, _reactSharedContexts.useFluent_unstable)();
|
|
21
|
+
const rootProps = (0, _reactUtilities.getNativeElementProps)('div', rest);
|
|
22
|
+
const onFocusPositionSlot = (0, _reactUtilities.useEventCallback)((e)=>{
|
|
23
|
+
var _rootProps_onFocus;
|
|
24
|
+
if (!e.currentTarget.contains(e.relatedTarget)) {
|
|
25
|
+
pauseAllToasts();
|
|
26
|
+
}
|
|
27
|
+
(_rootProps_onFocus = rootProps.onFocus) === null || _rootProps_onFocus === void 0 ? void 0 : _rootProps_onFocus.call(rootProps, e);
|
|
28
|
+
});
|
|
29
|
+
const onBlurPositionSlot = (0, _reactUtilities.useEventCallback)((e)=>{
|
|
30
|
+
var _rootProps_onBlur;
|
|
31
|
+
if (!e.currentTarget.contains(e.relatedTarget)) {
|
|
32
|
+
playAllToasts();
|
|
33
|
+
tryRestoreFocus();
|
|
34
|
+
}
|
|
35
|
+
(_rootProps_onBlur = rootProps.onBlur) === null || _rootProps_onBlur === void 0 ? void 0 : _rootProps_onBlur.call(rootProps, e);
|
|
36
|
+
});
|
|
37
|
+
const createPositionSlot = (toastPosition)=>{
|
|
38
|
+
var _toastsToRender_get;
|
|
39
|
+
return (0, _reactUtilities.resolveShorthand)(toastsToRender.has(toastPosition) ? rootProps : null, {
|
|
40
|
+
defaultProps: {
|
|
41
|
+
children: (_toastsToRender_get = toastsToRender.get(toastPosition)) === null || _toastsToRender_get === void 0 ? void 0 : _toastsToRender_get.map((toast)=>/*#__PURE__*/ _react.createElement(_toastContainer.ToastContainer, {
|
|
42
|
+
...toast,
|
|
43
|
+
tryRestoreFocus: tryRestoreFocus,
|
|
44
|
+
intent: toast.intent,
|
|
45
|
+
announce: announce,
|
|
46
|
+
key: toast.toastId,
|
|
47
|
+
visible: isToastVisible(toast.toastId)
|
|
48
|
+
}, toast.content)),
|
|
49
|
+
'data-toaster-position': toastPosition,
|
|
50
|
+
onFocus: onFocusPositionSlot,
|
|
51
|
+
onBlur: onBlurPositionSlot
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
return {
|
|
56
|
+
dir,
|
|
57
|
+
components: {
|
|
58
|
+
root: 'div',
|
|
59
|
+
bottomStart: 'div',
|
|
60
|
+
bottomEnd: 'div',
|
|
61
|
+
topStart: 'div',
|
|
62
|
+
topEnd: 'div'
|
|
63
|
+
},
|
|
64
|
+
root: (0, _reactUtilities.resolveShorthand)(rootProps, {
|
|
65
|
+
required: true
|
|
66
|
+
}),
|
|
67
|
+
bottomStart: createPositionSlot(_state.TOAST_POSITIONS.bottomStart),
|
|
68
|
+
bottomEnd: createPositionSlot(_state.TOAST_POSITIONS.bottomEnd),
|
|
69
|
+
topStart: createPositionSlot(_state.TOAST_POSITIONS.topStart),
|
|
70
|
+
topEnd: createPositionSlot(_state.TOAST_POSITIONS.topEnd),
|
|
71
|
+
announceRef,
|
|
72
|
+
offset,
|
|
73
|
+
announce: announceProp !== null && announceProp !== void 0 ? announceProp : announce,
|
|
74
|
+
renderAriaLive: !announceProp
|
|
75
|
+
};
|
|
76
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useToaster.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand, useEventCallback } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { TOAST_POSITIONS, useToaster } from '../../state';\nimport { ToastContainer } from '../ToastContainer';\n/**\n * Create the state required to render Toaster.\n *\n * @param props - props from this instance of Toaster\n */ export const useToaster_unstable = (props)=>{\n const { offset , announce: announceProp , ...rest } = props;\n const announceRef = React.useRef(()=>null);\n const { toastsToRender , isToastVisible , pauseAllToasts , playAllToasts , tryRestoreFocus } = useToaster(rest);\n const announce = React.useCallback((message, options)=>announceRef.current(message, options), []);\n const { dir } = useFluent();\n const rootProps = getNativeElementProps('div', rest);\n const onFocusPositionSlot = useEventCallback((e)=>{\n var _rootProps_onFocus;\n if (!e.currentTarget.contains(e.relatedTarget)) {\n pauseAllToasts();\n }\n (_rootProps_onFocus = rootProps.onFocus) === null || _rootProps_onFocus === void 0 ? void 0 : _rootProps_onFocus.call(rootProps, e);\n });\n const onBlurPositionSlot = useEventCallback((e)=>{\n var _rootProps_onBlur;\n if (!e.currentTarget.contains(e.relatedTarget)) {\n playAllToasts();\n tryRestoreFocus();\n }\n (_rootProps_onBlur = rootProps.onBlur) === null || _rootProps_onBlur === void 0 ? void 0 : _rootProps_onBlur.call(rootProps, e);\n });\n const createPositionSlot = (toastPosition)=>{\n var _toastsToRender_get;\n return resolveShorthand(toastsToRender.has(toastPosition) ? rootProps : null, {\n defaultProps: {\n children: (_toastsToRender_get = toastsToRender.get(toastPosition)) === null || _toastsToRender_get === void 0 ? void 0 : _toastsToRender_get.map((toast)=>/*#__PURE__*/ React.createElement(ToastContainer, {\n ...toast,\n tryRestoreFocus: tryRestoreFocus,\n intent: toast.intent,\n announce: announce,\n key: toast.toastId,\n visible: isToastVisible(toast.toastId)\n }, toast.content)),\n 'data-toaster-position': toastPosition,\n onFocus: onFocusPositionSlot,\n onBlur: onBlurPositionSlot\n }\n });\n };\n return {\n dir,\n components: {\n root: 'div',\n bottomStart: 'div',\n bottomEnd: 'div',\n topStart: 'div',\n topEnd: 'div'\n },\n root: resolveShorthand(rootProps, {\n required: true\n }),\n bottomStart: createPositionSlot(TOAST_POSITIONS.bottomStart),\n bottomEnd: createPositionSlot(TOAST_POSITIONS.bottomEnd),\n topStart: createPositionSlot(TOAST_POSITIONS.topStart),\n topEnd: createPositionSlot(TOAST_POSITIONS.topEnd),\n announceRef,\n offset,\n announce: announceProp !== null && announceProp !== void 0 ? announceProp : announce,\n renderAriaLive: !announceProp\n };\n};\n"],"names":["useToaster_unstable","props","offset","announce","announceProp","rest","announceRef","React","useRef","toastsToRender","isToastVisible","pauseAllToasts","playAllToasts","tryRestoreFocus","useToaster","useCallback","message","options","current","dir","useFluent","rootProps","getNativeElementProps","onFocusPositionSlot","useEventCallback","e","_rootProps_onFocus","currentTarget","contains","relatedTarget","onFocus","call","onBlurPositionSlot","_rootProps_onBlur","onBlur","createPositionSlot","toastPosition","_toastsToRender_get","resolveShorthand","has","defaultProps","children","get","map","toast","createElement","ToastContainer","intent","key","toastId","visible","content","components","root","bottomStart","bottomEnd","topStart","topEnd","required","TOAST_POSITIONS","renderAriaLive"],"mappings":";;;;+BASiBA;;aAAAA;;;6DATM;gCACmD;qCAC1B;uBACJ;gCACb;AAKpB,MAAMA,sBAAsB,CAACC,QAAQ;IAC5C,MAAM,EAAEC,OAAM,EAAGC,UAAUC,aAAY,EAAG,GAAGC,MAAM,GAAGJ;IACtD,MAAMK,cAAcC,OAAMC,MAAM,CAAC,IAAI,IAAI;IACzC,MAAM,EAAEC,eAAc,EAAGC,eAAc,EAAGC,eAAc,EAAGC,cAAa,EAAGC,gBAAe,EAAG,GAAGC,IAAAA,iBAAU,EAACT;IAC3G,MAAMF,WAAWI,OAAMQ,WAAW,CAAC,CAACC,SAASC,UAAUX,YAAYY,OAAO,CAACF,SAASC,UAAU,EAAE;IAChG,MAAM,EAAEE,IAAG,EAAG,GAAGC,IAAAA,uCAAS;IAC1B,MAAMC,YAAYC,IAAAA,qCAAqB,EAAC,OAAOjB;IAC/C,MAAMkB,sBAAsBC,IAAAA,gCAAgB,EAAC,CAACC,IAAI;QAC9C,IAAIC;QACJ,IAAI,CAACD,EAAEE,aAAa,CAACC,QAAQ,CAACH,EAAEI,aAAa,GAAG;YAC5ClB;QACJ,CAAC;QACAe,CAAAA,qBAAqBL,UAAUS,OAAO,AAAD,MAAO,IAAI,IAAIJ,uBAAuB,KAAK,IAAI,KAAK,IAAIA,mBAAmBK,IAAI,CAACV,WAAWI,EAAE;IACvI;IACA,MAAMO,qBAAqBR,IAAAA,gCAAgB,EAAC,CAACC,IAAI;QAC7C,IAAIQ;QACJ,IAAI,CAACR,EAAEE,aAAa,CAACC,QAAQ,CAACH,EAAEI,aAAa,GAAG;YAC5CjB;YACAC;QACJ,CAAC;QACAoB,CAAAA,oBAAoBZ,UAAUa,MAAM,AAAD,MAAO,IAAI,IAAID,sBAAsB,KAAK,IAAI,KAAK,IAAIA,kBAAkBF,IAAI,CAACV,WAAWI,EAAE;IACnI;IACA,MAAMU,qBAAqB,CAACC,gBAAgB;QACxC,IAAIC;QACJ,OAAOC,IAAAA,gCAAgB,EAAC7B,eAAe8B,GAAG,CAACH,iBAAiBf,YAAY,IAAI,EAAE;YAC1EmB,cAAc;gBACVC,UAAU,AAACJ,CAAAA,sBAAsB5B,eAAeiC,GAAG,CAACN,cAAa,MAAO,IAAI,IAAIC,wBAAwB,KAAK,IAAI,KAAK,IAAIA,oBAAoBM,GAAG,CAAC,CAACC,QAAQ,WAAW,GAAGrC,OAAMsC,aAAa,CAACC,8BAAc,EAAE;wBACrM,GAAGF,KAAK;wBACR/B,iBAAiBA;wBACjBkC,QAAQH,MAAMG,MAAM;wBACpB5C,UAAUA;wBACV6C,KAAKJ,MAAMK,OAAO;wBAClBC,SAASxC,eAAekC,MAAMK,OAAO;oBACzC,GAAGL,MAAMO,OAAO,EAAE;gBACtB,yBAAyBf;gBACzBN,SAASP;gBACTW,QAAQF;YACZ;QACJ;IACJ;IACA,OAAO;QACHb;QACAiC,YAAY;YACRC,MAAM;YACNC,aAAa;YACbC,WAAW;YACXC,UAAU;YACVC,QAAQ;QACZ;QACAJ,MAAMf,IAAAA,gCAAgB,EAACjB,WAAW;YAC9BqC,UAAU,IAAI;QAClB;QACAJ,aAAanB,mBAAmBwB,sBAAe,CAACL,WAAW;QAC3DC,WAAWpB,mBAAmBwB,sBAAe,CAACJ,SAAS;QACvDC,UAAUrB,mBAAmBwB,sBAAe,CAACH,QAAQ;QACrDC,QAAQtB,mBAAmBwB,sBAAe,CAACF,MAAM;QACjDnD;QACAJ;QACAC,UAAUC,iBAAiB,IAAI,IAAIA,iBAAiB,KAAK,IAAIA,eAAeD,QAAQ;QACpFyD,gBAAgB,CAACxD;IACrB;AACJ"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
toasterClassNames: ()=>toasterClassNames,
|
|
13
|
+
useToasterStyles_unstable: ()=>useToasterStyles_unstable
|
|
14
|
+
});
|
|
15
|
+
const _react = require("@griffel/react");
|
|
16
|
+
const _index = require("../../state/index");
|
|
17
|
+
var _state_bottomStart, _state_bottomEnd, _state_topStart, _state_topEnd;
|
|
18
|
+
const toasterClassNames = {
|
|
19
|
+
root: 'fui-Toaster'
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Styles for the root slot
|
|
23
|
+
*/ const useRootBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("r3hfdjz", null, [
|
|
24
|
+
".r3hfdjz{position:fixed;width:292px;pointer-events:none;}"
|
|
25
|
+
]);
|
|
26
|
+
const useToasterStyles_unstable = (state)=>{
|
|
27
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
28
|
+
const className = (0, _react.mergeClasses)(toasterClassNames.root, rootBaseClassName, state.root.className);
|
|
29
|
+
if (state.bottomStart) {
|
|
30
|
+
state.bottomStart.className = className;
|
|
31
|
+
var _style;
|
|
32
|
+
(_style = (_state_bottomStart = state.bottomStart).style) !== null && _style !== void 0 ? _style : _state_bottomStart.style = {};
|
|
33
|
+
Object.assign(state.bottomStart.style, (0, _index.getPositionStyles)(_index.TOAST_POSITIONS.bottomStart, state.dir, state.offset));
|
|
34
|
+
}
|
|
35
|
+
if (state.bottomEnd) {
|
|
36
|
+
state.bottomEnd.className = className;
|
|
37
|
+
var _style1;
|
|
38
|
+
(_style1 = (_state_bottomEnd = state.bottomEnd).style) !== null && _style1 !== void 0 ? _style1 : _state_bottomEnd.style = {};
|
|
39
|
+
Object.assign(state.bottomEnd.style, (0, _index.getPositionStyles)(_index.TOAST_POSITIONS.bottomEnd, state.dir, state.offset));
|
|
40
|
+
}
|
|
41
|
+
if (state.topStart) {
|
|
42
|
+
state.topStart.className = className;
|
|
43
|
+
var _style2;
|
|
44
|
+
(_style2 = (_state_topStart = state.topStart).style) !== null && _style2 !== void 0 ? _style2 : _state_topStart.style = {};
|
|
45
|
+
Object.assign(state.topStart.style, (0, _index.getPositionStyles)(_index.TOAST_POSITIONS.topStart, state.dir, state.offset));
|
|
46
|
+
}
|
|
47
|
+
if (state.topEnd) {
|
|
48
|
+
state.topEnd.className = className;
|
|
49
|
+
var _style3;
|
|
50
|
+
(_style3 = (_state_topEnd = state.topEnd).style) !== null && _style3 !== void 0 ? _style3 : _state_topEnd.style = {};
|
|
51
|
+
Object.assign(state.topEnd.style, (0, _index.getPositionStyles)(_index.TOAST_POSITIONS.topEnd, state.dir, state.offset));
|
|
52
|
+
}
|
|
53
|
+
return state;
|
|
54
|
+
}; //# sourceMappingURL=useToasterStyles.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useToasterStyles.styles.js"],"sourcesContent":["var _state_bottomStart, _state_bottomEnd, _state_topStart, _state_topEnd;\nimport { __resetStyles, mergeClasses } from '@griffel/react';\nimport { TOAST_POSITIONS, getPositionStyles } from '../../state/index';\nexport const toasterClassNames = {\n root: 'fui-Toaster'\n};\n/**\n * Styles for the root slot\n */\nconst useRootBaseClassName = /*#__PURE__*/__resetStyles(\"r3hfdjz\", null, [\".r3hfdjz{position:fixed;width:292px;pointer-events:none;}\"]);\n/**\n * Apply styling to the Toaster slots based on the state\n */\nexport const useToasterStyles_unstable = state => {\n const rootBaseClassName = useRootBaseClassName();\n const className = mergeClasses(toasterClassNames.root, rootBaseClassName, state.root.className);\n if (state.bottomStart) {\n state.bottomStart.className = className;\n var _style;\n (_style = (_state_bottomStart = state.bottomStart).style) !== null && _style !== void 0 ? _style : _state_bottomStart.style = {};\n Object.assign(state.bottomStart.style, getPositionStyles(TOAST_POSITIONS.bottomStart, state.dir, state.offset));\n }\n if (state.bottomEnd) {\n 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 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 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 return state;\n};\n//# sourceMappingURL=useToasterStyles.styles.js.map"],"names":["toasterClassNames","useToasterStyles_unstable","_state_bottomStart","_state_bottomEnd","_state_topStart","_state_topEnd","root","useRootBaseClassName","__resetStyles","state","rootBaseClassName","className","mergeClasses","bottomStart","_style","style","Object","assign","getPositionStyles","TOAST_POSITIONS","dir","offset","bottomEnd","_style1","topStart","_style2","topEnd","_style3"],"mappings":";;;;;;;;;;;IAGaA,iBAAiB,MAAjBA;IAUAC,yBAAyB,MAAzBA;;uBAZ+B;uBACO;AAFnD,IAAIC,oBAAoBC,kBAAkBC,iBAAiBC;AAGpD,MAAML,oBAAoB;IAC/BM,MAAM;AACR;AACA;;CAEC,GACD,MAAMC,uBAAuB,WAAW,GAAEC,IAAAA,uBAAa,EAAC,WAAW,IAAI,EAAE;IAAC;CAA4D;AAI/H,MAAMP,4BAA4BQ,CAAAA,QAAS;IAChD,MAAMC,oBAAoBH;IAC1B,MAAMI,YAAYC,IAAAA,mBAAY,EAACZ,kBAAkBM,IAAI,EAAEI,mBAAmBD,MAAMH,IAAI,CAACK,SAAS;IAC9F,IAAIF,MAAMI,WAAW,EAAE;QACrBJ,MAAMI,WAAW,CAACF,SAAS,GAAGA;QAC9B,IAAIG;QACHA,CAAAA,SAAS,AAACZ,CAAAA,qBAAqBO,MAAMI,WAAW,AAAD,EAAGE,KAAK,AAAD,MAAO,IAAI,IAAID,WAAW,KAAK,IAAIA,SAASZ,mBAAmBa,KAAK,GAAG,CAAC,CAAC;QAChIC,OAAOC,MAAM,CAACR,MAAMI,WAAW,CAACE,KAAK,EAAEG,IAAAA,wBAAiB,EAACC,sBAAe,CAACN,WAAW,EAAEJ,MAAMW,GAAG,EAAEX,MAAMY,MAAM;IAC/G,CAAC;IACD,IAAIZ,MAAMa,SAAS,EAAE;QACnBb,MAAMa,SAAS,CAACX,SAAS,GAAGA;QAC5B,IAAIY;QACHA,CAAAA,UAAU,AAACpB,CAAAA,mBAAmBM,MAAMa,SAAS,AAAD,EAAGP,KAAK,AAAD,MAAO,IAAI,IAAIQ,YAAY,KAAK,IAAIA,UAAUpB,iBAAiBY,KAAK,GAAG,CAAC,CAAC;QAC7HC,OAAOC,MAAM,CAACR,MAAMa,SAAS,CAACP,KAAK,EAAEG,IAAAA,wBAAiB,EAACC,sBAAe,CAACG,SAAS,EAAEb,MAAMW,GAAG,EAAEX,MAAMY,MAAM;IAC3G,CAAC;IACD,IAAIZ,MAAMe,QAAQ,EAAE;QAClBf,MAAMe,QAAQ,CAACb,SAAS,GAAGA;QAC3B,IAAIc;QACHA,CAAAA,UAAU,AAACrB,CAAAA,kBAAkBK,MAAMe,QAAQ,AAAD,EAAGT,KAAK,AAAD,MAAO,IAAI,IAAIU,YAAY,KAAK,IAAIA,UAAUrB,gBAAgBW,KAAK,GAAG,CAAC,CAAC;QAC1HC,OAAOC,MAAM,CAACR,MAAMe,QAAQ,CAACT,KAAK,EAAEG,IAAAA,wBAAiB,EAACC,sBAAe,CAACK,QAAQ,EAAEf,MAAMW,GAAG,EAAEX,MAAMY,MAAM;IACzG,CAAC;IACD,IAAIZ,MAAMiB,MAAM,EAAE;QAChBjB,MAAMiB,MAAM,CAACf,SAAS,GAAGA;QACzB,IAAIgB;QACHA,CAAAA,UAAU,AAACtB,CAAAA,gBAAgBI,MAAMiB,MAAM,AAAD,EAAGX,KAAK,AAAD,MAAO,IAAI,IAAIY,YAAY,KAAK,IAAIA,UAAUtB,cAAcU,KAAK,GAAG,CAAC,CAAC;QACpHC,OAAOC,MAAM,CAACR,MAAMiB,MAAM,CAACX,KAAK,EAAEG,IAAAA,wBAAiB,EAACC,sBAAe,CAACO,MAAM,EAAEjB,MAAMW,GAAG,EAAEX,MAAMY,MAAM;IACrG,CAAC;IACD,OAAOZ;AACT,GACA,mDAAmD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
ToastContainerContextProvider: ()=>ToastContainerContextProvider,
|
|
13
|
+
useToastContainerContext: ()=>useToastContainerContext
|
|
14
|
+
});
|
|
15
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
16
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
17
|
+
const toastContainerContextDefaultValue = {
|
|
18
|
+
close: ()=>null,
|
|
19
|
+
intent: undefined,
|
|
20
|
+
bodyId: '',
|
|
21
|
+
titleId: ''
|
|
22
|
+
};
|
|
23
|
+
const ToastContainerContext = /*#__PURE__*/ _react.createContext(undefined);
|
|
24
|
+
const ToastContainerContextProvider = ToastContainerContext.Provider;
|
|
25
|
+
var _React_useContext;
|
|
26
|
+
const useToastContainerContext = ()=>(_React_useContext = _react.useContext(ToastContainerContext)) !== null && _React_useContext !== void 0 ? _React_useContext : toastContainerContextDefaultValue;
|