@symply.io/basic-components 1.3.11-alpha.11 → 1.3.11-alpha.13
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 +5 -9
- package/ToastPrompt/types.d.ts +0 -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 } 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";
|
@@ -15,7 +15,7 @@ function Transition(args) {
|
|
15
15
|
return _jsx(Slide, { ...args, direction: "up" });
|
16
16
|
}
|
17
17
|
function Prompt(props) {
|
18
|
-
const { open,
|
18
|
+
const { open, variant, message, timeout, onClose } = props;
|
19
19
|
const theme = useCustomTheme();
|
20
20
|
const styles = useMemo(() => ({
|
21
21
|
success: {
|
@@ -37,7 +37,7 @@ function Prompt(props) {
|
|
37
37
|
error: ErrorIcon,
|
38
38
|
info: InfoIcon
|
39
39
|
}), []);
|
40
|
-
const Icon = useMemo(() =>
|
40
|
+
const Icon = useMemo(() => 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"
|
@@ -49,15 +49,11 @@ function Prompt(props) {
|
|
49
49
|
borderRadius: "4px"
|
50
50
|
}
|
51
51
|
}
|
52
|
-
}, "aria-describedby": "Toast", message:
|
52
|
+
}, "aria-describedby": "Toast", message: _jsx(Typography, { id: "Toast", component: "span", sx: {
|
53
53
|
fontSize: 14,
|
54
54
|
fontWeight: 700,
|
55
55
|
display: "flex",
|
56
56
|
alignItems: "center"
|
57
|
-
}, children:
|
58
|
-
fontSize: 20,
|
59
|
-
opacity: 0.9,
|
60
|
-
marginRight: theme.spacing(1)
|
61
|
-
} }), message] }) }) }, `${Date.now() * Math.round(Math.random())}`) }));
|
57
|
+
}, children: message }) }) }, `${Date.now() * Math.round(Math.random())}`) }));
|
62
58
|
}
|
63
59
|
export default Prompt;
|
package/ToastPrompt/types.d.ts
CHANGED