@edu-tosel/design 1.0.86 → 1.0.88
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.
|
@@ -24,7 +24,7 @@ export default function RollCardDesign({ titles, state, disabled, isFixed, child
|
|
|
24
24
|
};
|
|
25
25
|
return (_jsxs(Card, { option: {
|
|
26
26
|
width: "2xl",
|
|
27
|
-
height: !isFixed && isOpen ? "
|
|
27
|
+
height: !isFixed && isOpen ? "2xs" : "4xs",
|
|
28
28
|
background: isDisabled || flag ? "bg-green-dark/10" : "bg-white",
|
|
29
29
|
className: "p-7.5 flex flex-col gap-y-6",
|
|
30
30
|
}, children: [_jsxs(Shelf.Row, { className: "justify-between", children: [_jsxs(Shelf.Col, { className: "gap-y-2.5", children: [_jsxs(Shelf.Row, { className: "gap-x-2.5 items-center", children: [titles.icon && _jsx("img", { src: titles.icon, alt: "icon" }), _jsx("div", { className: "text-xl leading-none font-pretendard-bold text-green-dark", children: titles.title })] }), _jsx("div", { className: "leading-none", children: titles.subtitle })] }), _jsxs("div", { className: "flex gap-3.5 items-center", children: [_jsx(Label, { title: !isDisabled
|
package/layout/template/Tab.js
CHANGED
|
@@ -20,7 +20,7 @@ export default function Tab({ tabs, option, state, }) {
|
|
|
20
20
|
displays: "hidden xl:flex xl:items-center xl:gap-2.5",
|
|
21
21
|
sizes: "w-auto",
|
|
22
22
|
paddings: "p-2.5",
|
|
23
|
-
backgrounds: boundary ?? "bg-
|
|
23
|
+
backgrounds: boundary ?? "bg-gray-light",
|
|
24
24
|
styles: "rounded-xl ",
|
|
25
25
|
};
|
|
26
26
|
const button = {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ModalProps } from "../../interface/Modal";
|
|
2
|
-
export default function
|
|
2
|
+
export default function ModalProvider(props: ModalProps): JSX.Element | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { createPortal } from "react-dom";
|
|
3
3
|
import { useTransition, animated } from "react-spring";
|
|
4
4
|
import { useActionStore } from "../../store";
|
|
5
5
|
import { cn } from "../../util";
|
|
@@ -25,20 +25,39 @@ const heightSize = {
|
|
|
25
25
|
"2xl": "max-w-176",
|
|
26
26
|
full: "h-full",
|
|
27
27
|
};
|
|
28
|
-
export default function
|
|
29
|
-
const { isVisible
|
|
30
|
-
const { position,
|
|
28
|
+
export default function ModalProvider(props) {
|
|
29
|
+
const { isVisible } = props.showAction ?? {};
|
|
30
|
+
const { position, noBackground } = props.option ?? {};
|
|
31
31
|
const [detection, setDetection] = useState(null);
|
|
32
|
-
const { setIsOwn
|
|
32
|
+
const { setIsOwn } = useActionStore();
|
|
33
33
|
useEffect(() => {
|
|
34
34
|
setDetection(document.getElementById("portal"));
|
|
35
35
|
}, []);
|
|
36
|
+
const transitions = useTransition(isVisible, {
|
|
37
|
+
from: { opacity: 0 },
|
|
38
|
+
enter: { opacity: 1 },
|
|
39
|
+
leave: { opacity: 0 },
|
|
40
|
+
config: { duration: 200 },
|
|
41
|
+
});
|
|
36
42
|
const background = {
|
|
37
43
|
positions: "z-50 fixed top-0 left-0",
|
|
38
|
-
displays: position
|
|
44
|
+
displays: !position && "flex items-center justify-center ",
|
|
39
45
|
sizes: "min-h-screen w-full ",
|
|
40
46
|
styles: !noBackground && "bg-black/10 backdrop-blur-sm ",
|
|
41
47
|
};
|
|
48
|
+
const positionContainer = {
|
|
49
|
+
positions: "absolute z-45",
|
|
50
|
+
position,
|
|
51
|
+
};
|
|
52
|
+
return (detection &&
|
|
53
|
+
(!position
|
|
54
|
+
? createPortal(transitions((styles, item) => item && (_jsx(animated.div, { style: styles, className: cn(background), onClick: () => setIsOwn(true), children: _jsx(ModalDesign, { ...props }) }))), document.body)
|
|
55
|
+
: transitions((styles, item) => item && (_jsx(animated.div, { style: styles, className: cn(positionContainer), onClick: () => setIsOwn(true), children: _jsx(ModalDesign, { ...props }) })))));
|
|
56
|
+
}
|
|
57
|
+
function ModalDesign({ titles, showAction, children, option, debug, }) {
|
|
58
|
+
const { removeModal } = useActionStore();
|
|
59
|
+
const { width, height, noClose, isShadow } = option ?? {};
|
|
60
|
+
const { event } = showAction ?? {};
|
|
42
61
|
const container = {
|
|
43
62
|
paddings: "p-5",
|
|
44
63
|
sizes: `${heightSize[height ?? "lg"]} ${widthSize[width ?? "md"]}`,
|
|
@@ -50,12 +69,5 @@ export default function ModalDesign({ titles, showAction, children, option, debu
|
|
|
50
69
|
displays: "flex flex-col items-end",
|
|
51
70
|
sizes: "w-full min-h-[83px]",
|
|
52
71
|
};
|
|
53
|
-
|
|
54
|
-
from: { opacity: 0 },
|
|
55
|
-
enter: { opacity: 1 },
|
|
56
|
-
leave: { opacity: 0 },
|
|
57
|
-
config: { duration: 200 },
|
|
58
|
-
});
|
|
59
|
-
return (detection &&
|
|
60
|
-
ReactDOM.createPortal(transitions((styles, item) => item && (_jsx(animated.div, { style: styles, className: cn(background), onClick: () => setIsOwn(true), children: _jsxs("div", { className: cn(container), children: [_jsxs("div", { className: cn(titleBox), children: [_jsx("div", { className: "text-xl leading-none font-pretendard-bold", children: titles.title }), _jsx("div", { className: "bg-gray-light w-13.75 h-2 mt-3" }), _jsx(LineBreaks, { texts: titles.subtitle, className: "mt-5 text-base leading-none text-end font-pretendard-bold" })] }), children, !noClose && event && (_jsx(SVG.Close, { onClick: () => removeModal(event), className: "absolute top-5 left-5" }))] }) }))), document.body));
|
|
72
|
+
return (_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: cn(titleBox), children: [_jsx("div", { className: "text-xl leading-none font-pretendard-bold", children: titles.title }), _jsx("div", { className: "bg-gray-light w-13.75 h-2 mt-3" }), _jsx(LineBreaks, { texts: titles.subtitle, className: "mt-5 text-base leading-none text-end font-pretendard-bold" })] }), children, !noClose && event && (_jsx(SVG.Close, { onClick: () => removeModal(event), className: "absolute top-5 left-5" }))] }));
|
|
61
73
|
}
|
|
@@ -12,6 +12,7 @@ export default function Confirm(props) {
|
|
|
12
12
|
sizes: "w-full h-60",
|
|
13
13
|
};
|
|
14
14
|
return (_jsx(ConfirmModalDesign, { ...props, children: _jsx("div", { className: cn(container), children: props.widgets?.map((widget, index) => (_createElement(ConfirmModalWidget, { ...widget, key: index }))) }), option: {
|
|
15
|
+
...props.option,
|
|
15
16
|
width: "md",
|
|
16
17
|
height: "lg",
|
|
17
18
|
} }));
|
package/package.json
CHANGED
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.88
|