@symply.io/basic-components 1.3.11-alpha.2 → 1.3.11-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,5 +12,5 @@ interface ToastPromptProps {
|
|
12
12
|
icon?: ElementType;
|
13
13
|
variant?: "success" | "warning" | "info" | "error";
|
14
14
|
}
|
15
|
-
declare
|
16
|
-
export default
|
15
|
+
declare function Presentation(props: ToastPromptProps): JSX.Element;
|
16
|
+
export default Presentation;
|
@@ -32,7 +32,7 @@ import WarningIcon from "@mui/icons-material/Warning";
|
|
32
32
|
import SuccessIcon from "@mui/icons-material/CheckCircle";
|
33
33
|
import { green, amber, red, blue } from "@mui/material/colors";
|
34
34
|
import useCustomTheme from "../useCustomTheme";
|
35
|
-
|
35
|
+
function Presentation(props) {
|
36
36
|
var _a;
|
37
37
|
var _b = props.open, open = _b === void 0 ? false : _b, _c = props.vertical, vertical = _c === void 0 ? "bottom" : _c, _d = props.horizontal, horizontal = _d === void 0 ? "left" : _d, _e = props.timeout, timeout = _e === void 0 ? 3000 : _e, onClose = props.onClose, _f = props.transitionDirection, transitionDirection = _f === void 0 ? "up" : _f, _g = props.message, message = _g === void 0 ? "Unknown message" : _g, _h = props.icon, icon = _h === void 0 ? _jsx(_Fragment, {}) : _h, _j = props.variant, variant = _j === void 0 ? "info" : _j, other = __rest(props, ["open", "vertical", "horizontal", "timeout", "onClose", "transitionDirection", "message", "icon", "variant"]);
|
38
38
|
var theme = useCustomTheme();
|
@@ -78,5 +78,5 @@ var ToastPrompt = function (props) {
|
|
78
78
|
opacity: 0.9,
|
79
79
|
marginRight: theme.spacing(1)
|
80
80
|
} })) : (_jsx(_Fragment, { children: icon })), message] })) }, other)) }), "".concat(Date.now() * Math.round(Math.random()))) })));
|
81
|
-
}
|
82
|
-
export default
|
81
|
+
}
|
82
|
+
export default Presentation;
|
package/ToastPrompt/index.d.ts
CHANGED
package/ToastPrompt/index.js
CHANGED
@@ -12,7 +12,7 @@ var __assign = (this && this.__assign) || function () {
|
|
12
12
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
13
13
|
import { createContext, useRef, useContext } from "react";
|
14
14
|
import Logics from "./Logics";
|
15
|
-
import
|
15
|
+
import Presentation from "./Presentation";
|
16
16
|
var PromptContext = createContext({});
|
17
17
|
export function PromptProvider(props) {
|
18
18
|
var children = props.children;
|
@@ -22,9 +22,8 @@ export function PromptProvider(props) {
|
|
22
22
|
var _a = ((toastRef === null || toastRef === void 0 ? void 0 : toastRef.current) || {}).show, show = _a === void 0 ? function () { } : _a;
|
23
23
|
show(type, message, timeout);
|
24
24
|
}
|
25
|
-
return (_jsx(PromptContext.Provider, __assign({ value: { showPrompt: showPrompt } }, { children: _jsxs(_Fragment, { children: [children, _jsx(Logics, __assign({ ref: toastRef }, { children: _jsx(
|
25
|
+
return (_jsx(PromptContext.Provider, __assign({ value: { showPrompt: showPrompt } }, { children: _jsxs(_Fragment, { children: [children, _jsx(Logics, __assign({ ref: toastRef }, { children: _jsx(Presentation, {}) }))] }) })));
|
26
26
|
}
|
27
27
|
export function usePrompt() {
|
28
28
|
return useContext(PromptContext);
|
29
29
|
}
|
30
|
-
export default PromptProvider;
|