@symply.io/basic-components 1.3.11-alpha.10 → 1.3.11-alpha.11
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/ToastPrompt/Prompt.js +4 -4
- package/ToastPrompt/index.js +1 -1
- package/package.json +1 -1
package/ToastPrompt/Prompt.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { jsx as _jsx,
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import { useMemo } from "react";
|
3
3
|
import Slide from "@mui/material/Slide";
|
4
4
|
import Snackbar from "@mui/material/Snackbar";
|
@@ -37,7 +37,7 @@ function Prompt(props) {
|
|
37
37
|
error: ErrorIcon,
|
38
38
|
info: InfoIcon
|
39
39
|
}), []);
|
40
|
-
const Icon = useMemo(() => VariantIcon[variant], []);
|
40
|
+
const Icon = useMemo(() => icon || VariantIcon[variant], []);
|
41
41
|
return (_jsx(ThemeProvider, { theme: theme, children: _jsx(Snackbar, { anchorOrigin: { vertical: "bottom", horizontal: "left" }, open: open, onClose: onClose, autoHideDuration: timeout, TransitionComponent: Transition, sx: {
|
42
42
|
zIndex: 99999,
|
43
43
|
marginTop: "3vh"
|
@@ -54,10 +54,10 @@ function Prompt(props) {
|
|
54
54
|
fontWeight: 700,
|
55
55
|
display: "flex",
|
56
56
|
alignItems: "center"
|
57
|
-
}, children: [
|
57
|
+
}, children: [_jsx(Icon, { sx: {
|
58
58
|
fontSize: 20,
|
59
59
|
opacity: 0.9,
|
60
60
|
marginRight: theme.spacing(1)
|
61
|
-
} })
|
61
|
+
} }), message] }) }) }, `${Date.now() * Math.round(Math.random())}`) }));
|
62
62
|
}
|
63
63
|
export default Prompt;
|
package/ToastPrompt/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import { createContext, useContext, cloneElement } from "react";
|
3
|
-
import
|
3
|
+
import Prompt from "./Prompt";
|
4
4
|
import useInteractions from "./useInteractions";
|
5
5
|
const PromptContext = createContext({
|
6
6
|
showPrompt: () => { }
|