react-restyle-components 0.2.99 → 0.3.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/lib/src/core-components/src/molecules/modal/modal.component.d.ts +3 -1
- package/lib/src/core-components/src/molecules/modal/modal.component.d.ts.map +1 -1
- package/lib/src/core-components/src/molecules/modal/modal.component.js +2 -2
- package/lib/src/core-components/src/molecules/modal-confirm/modal-confirm.component.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -2,9 +2,11 @@ import React from 'react';
|
|
|
2
2
|
export interface ModalProps {
|
|
3
3
|
visible: boolean;
|
|
4
4
|
title: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: React.CSSProperties;
|
|
5
7
|
onClose?: () => void;
|
|
6
8
|
isAutoClose?: boolean;
|
|
7
9
|
children?: React.ReactNode;
|
|
8
10
|
}
|
|
9
|
-
export declare const Modal: ({ visible, title, onClose, isAutoClose, children, }: ModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const Modal: ({ visible, title, className, style, onClose, isAutoClose, children, }: ModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
//# sourceMappingURL=modal.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/molecules/modal/modal.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"modal.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/molecules/modal/modal.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,KAAK,0EAQf,UAAU,4CA2HZ,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import React, { useEffect } from 'react';
|
|
3
3
|
import s from '../../tc.module.css';
|
|
4
4
|
import { cn } from '../../utils';
|
|
5
|
-
export const Modal = ({ visible, title = '', onClose, isAutoClose = false, children, }) => {
|
|
5
|
+
export const Modal = ({ visible, title = '', className = '', style = {}, onClose, isAutoClose = false, children, }) => {
|
|
6
6
|
const [showModal, setShowModal] = React.useState(visible);
|
|
7
7
|
useEffect(() => {
|
|
8
8
|
setShowModal(visible);
|
|
@@ -12,7 +12,7 @@ export const Modal = ({ visible, title = '', onClose, isAutoClose = false, child
|
|
|
12
12
|
}, 1000);
|
|
13
13
|
}
|
|
14
14
|
}, [visible]);
|
|
15
|
-
return (_jsx(_Fragment, { children: showModal && (_jsxs(_Fragment, { children: [_jsx("div", { className: cn(s['flex'], s['justify-center'], s['items-center'], s['overflow-x-hidden'], s['overflow-y-auto'], s['fixed'], s['inset-0'], s['z-50'], s['outline-none'], s['focus:outline-none']), children: _jsx("div", { className: cn(s['relative'], s['w-auto'], s['my-5'], s['mx-auto'], s['max-w-7xl']), children: _jsxs("div", { className: cn(s['border-0'], s['rounded-lg'], s['shadow-lg'], s['relative'], s['flex'], s['flex-col'], s['bg-white'], s['outline-none'], s['focus:outline-none']), children: [_jsxs("div", { className: cn(s['flex'], s['items-start'], s['justify-between'], s['p-2'], s['border-b'], s['border-solid'], s['border-gray-300'], s['rounded-t']), children: [_jsx("h3", { className: cn(s['text-xl'], s['font-semibold']), children: title }), _jsx("button", { className: cn(s['p-1'], s['border-0'], s['text-black'], s['opacity-1'], s['ml-6'], s['float-right'], s['text-3xl'], s['leading-none'], s['font-semibold'], s['outline-none'], s['focus:outline-none']), onClick: () => {
|
|
15
|
+
return (_jsx(_Fragment, { children: showModal && (_jsxs(_Fragment, { children: [_jsx("div", { className: cn(s['flex'], s['justify-center'], s['items-center'], s['overflow-x-hidden'], s['overflow-y-auto'], s['fixed'], s['inset-0'], s['z-50'], s['outline-none'], s['focus:outline-none'], className), style: style, children: _jsx("div", { className: cn(s['relative'], s['w-auto'], s['my-5'], s['mx-auto'], s['max-w-7xl']), children: _jsxs("div", { className: cn(s['border-0'], s['rounded-lg'], s['shadow-lg'], s['relative'], s['flex'], s['flex-col'], s['bg-white'], s['outline-none'], s['focus:outline-none']), children: [_jsxs("div", { className: cn(s['flex'], s['items-start'], s['justify-between'], s['p-2'], s['border-b'], s['border-solid'], s['border-gray-300'], s['rounded-t']), children: [_jsx("h3", { className: cn(s['text-xl'], s['font-semibold']), children: title }), _jsx("button", { className: cn(s['p-1'], s['border-0'], s['text-black'], s['opacity-1'], s['ml-6'], s['float-right'], s['text-3xl'], s['leading-none'], s['font-semibold'], s['outline-none'], s['focus:outline-none']), onClick: () => {
|
|
16
16
|
onClose && onClose();
|
|
17
17
|
setShowModal(false);
|
|
18
18
|
}, children: _jsx("span", { className: cn(s['text-black'], s['h-6'], s['w-6'], s['text-2xl'], s['block'], s['outline-none'], s['focus:outline-none']), children: "\u00D7" }) })] }), _jsx("div", { className: cn(s['flex'], s['p-2'], s['w-auto'], s['h-auto']), children: children })] }) }) }), _jsx("div", { className: cn(s['opacity-25'], s['fixed'], s['inset-0'], s['z-40'], s['bg-black']) })] })) }));
|
package/lib/src/core-components/src/molecules/modal-confirm/modal-confirm.component.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-confirm.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/molecules/modal-confirm/modal-confirm.component.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"modal-confirm.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/molecules/modal-confirm/modal-confirm.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAMjD,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,YAAY,8FAUtB,iBAAiB,4CA0LnB,CAAC"}
|