@cripty2001/utils 0.0.112 → 0.0.113
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/dist/react-ui/modal.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type ModalComponentProps = {
|
|
2
2
|
children: React.ReactNode;
|
|
3
|
-
open: boolean
|
|
4
|
-
setOpen: (open: boolean) => void
|
|
3
|
+
open: boolean;
|
|
4
|
+
setOpen: (open: boolean) => void;
|
|
5
5
|
};
|
|
6
6
|
export default function ModalComponent(props: ModalComponentProps): import("react/jsx-runtime").JSX.Element | null;
|
package/dist/react-ui/modal.js
CHANGED
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = ModalComponent;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const react_whispr_1 = require("../react-whispr");
|
|
7
6
|
const slideUpKeyframes = `
|
|
8
7
|
@keyframes slide-up {
|
|
9
8
|
from {
|
|
@@ -28,8 +27,7 @@ let modalCount = 0;
|
|
|
28
27
|
function ModalComponent(props) {
|
|
29
28
|
const zIndex = (0, react_1.useRef)(1000 + modalCount++).current;
|
|
30
29
|
const id = (0, react_1.useRef)(`modal-${zIndex}`).current;
|
|
31
|
-
|
|
32
|
-
if (!open)
|
|
30
|
+
if (!props.open)
|
|
33
31
|
return null;
|
|
34
32
|
return ((0, jsx_runtime_1.jsx)("div", { id: id, style: {
|
|
35
33
|
position: 'fixed',
|
|
@@ -45,5 +43,5 @@ function ModalComponent(props) {
|
|
|
45
43
|
height: '100vh',
|
|
46
44
|
width: '100vw',
|
|
47
45
|
zIndex: zIndex
|
|
48
|
-
}, onClick: () => setOpen(false), children: (0, jsx_runtime_1.jsx)("div", { style: { maxWidth: '100%', animation: 'slide-up 0.3s ease-out' }, onClick: (e) => e.stopPropagation(), children: props.children }) }));
|
|
46
|
+
}, onClick: () => props.setOpen(false), children: (0, jsx_runtime_1.jsx)("div", { style: { maxWidth: '100%', animation: 'slide-up 0.3s ease-out' }, onClick: (e) => e.stopPropagation(), children: props.children }) }));
|
|
49
47
|
}
|
package/package.json
CHANGED