@edu-tosel/design 1.0.61 → 1.0.63
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/asset/svg/Operation.js +1 -1
- package/asset/svg/Operation.tsx +3 -3
- package/board/design/Board.design.d.ts +1 -1
- package/board/design/Board.design.js +5 -5
- package/board/design/Header.design.d.ts +1 -1
- package/board/design/Header.design.js +6 -6
- package/board/template/CanvasBoard.d.ts +1 -1
- package/board/template/CanvasBoard.js +3 -3
- package/board/template/ManageBoard.d.ts +1 -1
- package/board/template/ManageBoard.js +5 -5
- package/board/template/PaperBoard.d.ts +1 -1
- package/board/template/PaperBoard.js +3 -3
- package/card/design/Card.design.d.ts +1 -1
- package/card/design/Card.design.js +8 -6
- package/card/design/InfoCard.design.d.ts +1 -1
- package/card/design/InfoCard.design.js +3 -3
- package/card/design/NavCard.design.d.ts +1 -1
- package/card/design/NavCard.design.js +3 -3
- package/card/design/RollCard.design.js +2 -2
- package/card/design/TableCard.design.d.ts +1 -1
- package/card/design/TableCard.design.js +7 -7
- package/card/index.d.ts +1 -0
- package/card/index.js +1 -0
- package/card/template/AddCard.d.ts +1 -1
- package/card/template/AddCard.js +3 -3
- package/card/template/ChartCard.d.ts +1 -1
- package/card/template/ChartCard.js +3 -3
- package/card/template/ConfirmCard/index.d.ts +9 -0
- package/card/template/ConfirmCard/index.js +19 -0
- package/card/template/InfoCard/Academy.js +4 -4
- package/card/template/InfoCard/Exam.d.ts +1 -1
- package/card/template/InfoCard/Exam.js +4 -4
- package/card/template/InfoCard/ExamData.js +2 -2
- package/card/template/InfoCard/Finance.js +1 -1
- package/card/template/InfoCard/Grade.js +2 -2
- package/card/template/InfoCard/Item.js +1 -1
- package/card/template/InfoCard/PersonalInformation.js +2 -2
- package/card/template/InfoCard/Product.js +2 -2
- package/card/template/InfoCard/Student.js +2 -2
- package/card/template/NavCard.d.ts +3 -3
- package/card/template/NavCard.js +14 -14
- package/card/template/ProgressCard/Large.d.ts +2 -0
- package/card/template/{ProgressCard.js → ProgressCard/Large.js} +6 -6
- package/card/template/ProgressCard/Small.d.ts +2 -0
- package/card/template/ProgressCard/Small.js +34 -0
- package/card/template/ProgressCard/index.d.ts +7 -0
- package/card/template/ProgressCard/index.js +7 -0
- package/card/template/TableCard.js +4 -3
- package/globals.css +4 -3
- package/interface/Action.d.ts +7 -14
- package/interface/Board.d.ts +9 -10
- package/interface/Card.d.ts +13 -7
- package/interface/Layout.d.ts +2 -2
- package/interface/Modal.d.ts +3 -3
- package/interface/Property.d.ts +2 -1
- package/interface/Shelf.d.ts +4 -4
- package/interface/widget/Carousel.d.ts +2 -2
- package/interface/widget/Switch.d.ts +2 -2
- package/interface/widget/index.d.ts +1 -1
- package/layout/design/DataField.design.d.ts +1 -1
- package/layout/design/DataField.design.js +7 -3
- package/layout/design/Row.design.d.ts +1 -1
- package/layout/design/Row.design.js +5 -5
- package/layout/design/Shelf.design.d.ts +1 -1
- package/layout/design/Shelf.design.js +2 -2
- package/layout/index.d.ts +1 -1
- package/layout/index.js +1 -1
- package/layout/template/Action.d.ts +10 -1
- package/layout/template/DataField.js +5 -2
- package/layout/template/Gallery.d.ts +4 -4
- package/layout/template/Gallery.js +3 -3
- package/layout/template/Promotion.d.ts +1 -1
- package/layout/template/Promotion.js +1 -1
- package/layout/template/Row.d.ts +2 -2
- package/layout/template/Row.js +6 -6
- package/layout/template/Shelf.d.ts +1 -1
- package/layout/template/Shelf.js +6 -6
- package/layout/template/Sign.d.ts +5 -5
- package/layout/template/Sign.js +5 -5
- package/layout/template/Tab.d.ts +2 -2
- package/layout/template/Tab.js +4 -4
- package/layout/{widget → template}/dashboard/Header.d.ts +1 -1
- package/layout/{widget → template}/dashboard/Header.js +3 -3
- package/layout/{widget → template}/dashboard/Layout.d.ts +1 -1
- package/layout/{widget → template}/dashboard/Layout.js +5 -5
- package/layout/{widget → template}/dashboard/Menu.js +2 -2
- package/layout/template/dashboard/Navigation.d.ts +7 -0
- package/layout/{widget → template}/dashboard/Navigation.js +5 -1
- package/layout/{widget → template}/dashboard/Notification.js +1 -1
- package/layout/template/dashboard/index.d.ts +28 -0
- package/layout/template/dashboard/index.js +18 -0
- package/layout/{widget → template}/dashboard/mypage/Layout.d.ts +1 -1
- package/layout/{widget → template}/dashboard/mypage/Layout.js +5 -5
- package/layout/{widget → template}/dashboard/mypage/Navigate.js +2 -2
- package/layout/{widget → template}/dashboard/mypage/Profile.js +4 -4
- package/layout/template/dashboard/style.d.ts +10 -0
- package/layout/template/dashboard/style.js +16 -0
- package/layout/template/home/Notice.d.ts +2 -2
- package/layout/template/home/Notice.js +2 -2
- package/layout/template/home/Promotion.d.ts +3 -3
- package/layout/template/home/Promotion.js +4 -4
- package/layout/template/home/Service.d.ts +1 -1
- package/layout/template/home/Service.js +2 -2
- package/layout/template/home/layout/Carousel.js +2 -2
- package/layout/{widget → template}/sign/WithTitle.js +1 -1
- package/modal/design/ConfirmModal.design.d.ts +1 -1
- package/modal/design/ConfirmModal.design.js +3 -3
- package/modal/design/Modal.design.d.ts +1 -1
- package/modal/design/Modal.design.js +3 -6
- package/modal/template/Alert.d.ts +1 -1
- package/modal/template/Alert.js +3 -3
- package/modal/template/Confirm/Alert.js +1 -1
- package/modal/template/Confirm/Confirm.js +1 -1
- package/modal/template/Confirm/Input.js +1 -1
- package/modal/template/Confirm/Tag.d.ts +1 -1
- package/modal/template/Confirm/Tag.js +2 -2
- package/modal/template/Input.d.ts +1 -1
- package/modal/template/Input.js +3 -3
- package/modal/template/Postcode.js +1 -1
- package/overlay/design/Overlay.design.js +1 -1
- package/overlay/template/Manage.js +5 -5
- package/package.json +1 -1
- package/tailwind.config.ts +1 -0
- package/version.txt +1 -1
- package/widget/design/Label.design.d.ts +1 -1
- package/widget/design/Label.design.js +3 -3
- package/widget/index.d.ts +3 -2
- package/widget/index.js +3 -2
- package/widget/template/CheckBox.d.ts +2 -0
- package/widget/{CheckBox.js → template/CheckBox.js} +2 -2
- package/widget/template/DatePicker.d.ts +3 -0
- package/widget/{DatePicker.js → template/DatePicker.js} +2 -2
- package/widget/template/EmailInput.d.ts +2 -0
- package/widget/{EmailInput.js → template/EmailInput.js} +4 -4
- package/widget/template/Input/Form.d.ts +2 -0
- package/widget/template/Input/Form.js +44 -0
- package/widget/template/Input/index.d.ts +6 -0
- package/widget/template/Input/index.js +34 -0
- package/widget/template/Label.d.ts +2 -2
- package/widget/template/Label.js +7 -7
- package/widget/{Obstacle.d.ts → template/Obstacle.d.ts} +1 -1
- package/widget/{Obstacle.js → template/Obstacle.js} +1 -1
- package/widget/template/Select/Select.LG.d.ts +1 -1
- package/widget/template/Select/Select.LG.js +3 -3
- package/widget/template/Select/Select.d.ts +1 -1
- package/widget/template/Select/Select.js +3 -3
- package/widget/template/Switch/Handle.d.ts +1 -1
- package/widget/template/Switch/Handle.js +2 -2
- package/widget/template/Switch/Switch.d.ts +1 -1
- package/widget/template/Switch/Switch.js +2 -2
- package/widget/{Toggle.d.ts → template/Toggle.d.ts} +2 -2
- package/widget/{Toggle.js → template/Toggle.js} +3 -3
- package/card/template/ProgressCard.d.ts +0 -10
- package/layout/template/Dashboard.d.ts +0 -22
- package/layout/template/Dashboard.js +0 -13
- package/layout/widget/dashboard/Navigation.d.ts +0 -3
- package/widget/CheckBox.d.ts +0 -2
- package/widget/DatePicker.d.ts +0 -3
- package/widget/EmailInput.d.ts +0 -2
- package/widget/design/Tag.design.d.ts +0 -0
- package/widget/design/Tag.design.js +0 -1
- package/widget/template/Input.d.ts +0 -6
- package/widget/template/Input.js +0 -68
- /package/layout/{widget → template}/dashboard/Menu.d.ts +0 -0
- /package/layout/{widget → template}/dashboard/Notification.d.ts +0 -0
- /package/layout/{widget → template}/dashboard/buttonClassNames.d.ts +0 -0
- /package/layout/{widget → template}/dashboard/buttonClassNames.js +0 -0
- /package/layout/{widget → template}/dashboard/mypage/Navigate.d.ts +0 -0
- /package/layout/{widget → template}/dashboard/mypage/Profile.d.ts +0 -0
- /package/layout/{widget → template}/promotion/Layout.d.ts +0 -0
- /package/layout/{widget → template}/promotion/Layout.js +0 -0
- /package/layout/{widget → template}/promotion/Thumbnail.d.ts +0 -0
- /package/layout/{widget → template}/promotion/Thumbnail.js +0 -0
- /package/layout/{widget → template}/sign/Box.d.ts +0 -0
- /package/layout/{widget → template}/sign/Box.js +0 -0
- /package/layout/{widget → template}/sign/Button.d.ts +0 -0
- /package/layout/{widget → template}/sign/Button.js +0 -0
- /package/layout/{widget → template}/sign/Check.d.ts +0 -0
- /package/layout/{widget → template}/sign/Check.js +0 -0
- /package/layout/{widget → template}/sign/Layout.d.ts +0 -0
- /package/layout/{widget → template}/sign/Layout.js +0 -0
- /package/layout/{widget → template}/sign/WithTitle.d.ts +0 -0
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Label } from "../../widget";
|
|
3
3
|
import { cn } from "../../util";
|
|
4
4
|
import ModalDesign from "../design/Modal.design";
|
|
5
|
-
export default function ConfirmModalDesign({ titles, showAction, buttons, children,
|
|
5
|
+
export default function ConfirmModalDesign({ titles, showAction, buttons, children, option, }) {
|
|
6
6
|
const container = {
|
|
7
7
|
displays: "flex flex-col",
|
|
8
8
|
};
|
|
@@ -10,8 +10,8 @@ export default function ConfirmModalDesign({ titles, showAction, buttons, childr
|
|
|
10
10
|
positions: "absolute bottom-5 left-5",
|
|
11
11
|
displays: "flex gap-2.5",
|
|
12
12
|
};
|
|
13
|
-
return (_jsx(ModalDesign, { titles: titles, showAction: showAction,
|
|
14
|
-
...
|
|
13
|
+
return (_jsx(ModalDesign, { titles: titles, showAction: showAction, option: option, children: _jsxs("div", { className: cn(container), children: [children, _jsx("div", { className: cn(buttonBox), children: buttons.map(({ title, onClick, option }) => (_jsx(Label.Button, { title: title, onClick: onClick, option: {
|
|
14
|
+
...option,
|
|
15
15
|
width: "lg",
|
|
16
16
|
height: "sm",
|
|
17
17
|
} }, title))) })] }) }));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ModalProps } from "../../interface/Modal";
|
|
2
|
-
export default function ModalDesign({ titles, showAction, children,
|
|
2
|
+
export default function ModalDesign({ titles, showAction, children, option, debug, }: ModalProps): import("react").ReactPortal | null;
|
|
@@ -25,9 +25,9 @@ const heightSize = {
|
|
|
25
25
|
"2xl": "max-w-176",
|
|
26
26
|
full: "h-full",
|
|
27
27
|
};
|
|
28
|
-
export default function ModalDesign({ titles, showAction, children,
|
|
28
|
+
export default function ModalDesign({ titles, showAction, children, option, debug, }) {
|
|
29
29
|
const { isVisible, event } = showAction ?? {};
|
|
30
|
-
const { position, width, height, noClose, noBackground, isShadow } =
|
|
30
|
+
const { position, width, height, noClose, noBackground, isShadow } = option ?? {};
|
|
31
31
|
const [detection, setDetection] = useState(null);
|
|
32
32
|
const { setIsOwn, removeModal } = useActionStore();
|
|
33
33
|
useEffect(() => {
|
|
@@ -57,8 +57,5 @@ export default function ModalDesign({ titles, showAction, children, options, deb
|
|
|
57
57
|
config: { duration: 200 },
|
|
58
58
|
});
|
|
59
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(
|
|
61
|
-
texts: titles.subtitle,
|
|
62
|
-
className: "text-base leading-none text-end font-pretendard-bold",
|
|
63
|
-
}) })] }), children, !noClose && event && (_jsx(SVG.Close, { onClick: () => removeModal(event), className: "absolute top-5 left-5" }))] }) }))), document.body));
|
|
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));
|
|
64
61
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { AlertModalProps } from "../../interface/Modal";
|
|
2
|
-
export default function Alert({ titles, showAction, scripts,
|
|
2
|
+
export default function Alert({ titles, showAction, scripts, option, }: AlertModalProps): import("react/jsx-runtime").JSX.Element;
|
package/modal/template/Alert.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import ModalDesign from "../design/Modal.design";
|
|
3
|
-
export default function Alert({ titles, showAction, scripts,
|
|
3
|
+
export default function Alert({ titles, showAction, scripts, option, }) {
|
|
4
4
|
const { script } = scripts ?? {};
|
|
5
|
-
const { buttons } =
|
|
6
|
-
return (_jsx(ModalDesign, { titles: titles, showAction: showAction, className: "pt-18 px-25",
|
|
5
|
+
const { buttons } = option ?? {};
|
|
6
|
+
return (_jsx(ModalDesign, { titles: titles, showAction: showAction, className: "pt-18 px-25", option: { buttons }, children: _jsx("div", { className: "flex flex-col gap-3", children: _jsxs("div", { className: "flex flex-col gap-6", children: [_jsx("div", { className: "h-2 w-14 rounded-full bg-pale-lavender" }), _jsx("div", { className: "text-xl font-pretendard-bold", children: script })] }) }) }));
|
|
7
7
|
}
|
|
@@ -8,7 +8,7 @@ export default function Alert(props) {
|
|
|
8
8
|
margins: "mt-2.5",
|
|
9
9
|
sizes: "w-full h-60",
|
|
10
10
|
};
|
|
11
|
-
return (_jsx(ConfirmModalDesign, { ...props, children: _jsxs("div", { className: cn(container), children: [_jsx("div", { className: "leading-none text-xl font-pretendard-bold", children: props.scripts.script }), _jsx(LineBreaks, { className: "text-center", texts: props.scripts.subscript }), _jsx("div", { className: "leading-none font-pretendard-bold text-crimson-burgundy", children: props.scripts.alert })] }),
|
|
11
|
+
return (_jsx(ConfirmModalDesign, { ...props, children: _jsxs("div", { className: cn(container), children: [_jsx("div", { className: "leading-none text-xl font-pretendard-bold", children: props.scripts.script }), _jsx(LineBreaks, { className: "text-center", texts: props.scripts.subscript }), _jsx("div", { className: "leading-none font-pretendard-bold text-crimson-burgundy", children: props.scripts.alert })] }), option: {
|
|
12
12
|
width: "md",
|
|
13
13
|
height: "lg",
|
|
14
14
|
} }));
|
|
@@ -7,7 +7,7 @@ export default function Confirm(props) {
|
|
|
7
7
|
margins: "mt-2.5",
|
|
8
8
|
sizes: "w-full h-60",
|
|
9
9
|
};
|
|
10
|
-
return (_jsx(ConfirmModalDesign, { ...props, children: _jsx("div", { className: cn(container), children: props.children }),
|
|
10
|
+
return (_jsx(ConfirmModalDesign, { ...props, children: _jsx("div", { className: cn(container), children: props.children }), option: {
|
|
11
11
|
width: "md",
|
|
12
12
|
height: "lg",
|
|
13
13
|
} }));
|
|
@@ -3,5 +3,5 @@ import ConfirmModal from "../../design/ConfirmModal.design";
|
|
|
3
3
|
import { Input as _Input } from "../../../widget";
|
|
4
4
|
export default function Input(props) {
|
|
5
5
|
const { inputs } = props;
|
|
6
|
-
return (_jsx(ConfirmModal, { ...props, children: _jsx("div", { className: "flex flex-col gap-3", children: inputs.map((input, index) => (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("div", { className: "font-pretendard-bold", children: input.title }), _jsx(_Input.
|
|
6
|
+
return (_jsx(ConfirmModal, { ...props, children: _jsx("div", { className: "flex flex-col gap-3", children: inputs.map((input, index) => (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("div", { className: "font-pretendard-bold", children: input.title }), _jsx(_Input.Form, { ...input })] }, index))) }) }));
|
|
7
7
|
}
|
|
@@ -4,8 +4,8 @@ import { cn } from "../../../util";
|
|
|
4
4
|
import { selectOne, selectPlural } from "../../../util/select";
|
|
5
5
|
import { animated, useTransition } from "react-spring";
|
|
6
6
|
export default function Tag(props) {
|
|
7
|
-
const { state, tags,
|
|
8
|
-
const { selectHow } =
|
|
7
|
+
const { state, tags, option, process } = props.tag;
|
|
8
|
+
const { selectHow } = option || { selectHow: "plural" };
|
|
9
9
|
const button = (key) => ({
|
|
10
10
|
sizes: "h-10",
|
|
11
11
|
styles: "rounded-full",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { State } from "../../interface";
|
|
2
2
|
import { ModalProps } from "../../interface/Modal";
|
|
3
|
-
export default function Input<T>({ titles, showAction,
|
|
3
|
+
export default function Input<T>({ titles, showAction, option, state, }: Omit<ModalProps, "children"> & {
|
|
4
4
|
title?: string;
|
|
5
5
|
state: State<T>;
|
|
6
6
|
}): import("react/jsx-runtime").JSX.Element;
|
package/modal/template/Input.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import ModalDesign from "../design/Modal.design";
|
|
3
|
-
export default function Input({ titles, showAction,
|
|
4
|
-
const { buttons } =
|
|
5
|
-
return (_jsx(ModalDesign, { titles: titles, showAction: showAction, className: "pt-18 px-25",
|
|
3
|
+
export default function Input({ titles, showAction, option, state, }) {
|
|
4
|
+
const { buttons } = option ?? {};
|
|
5
|
+
return (_jsx(ModalDesign, { titles: titles, showAction: showAction, className: "pt-18 px-25", option: { buttons }, children: _jsx("input", { className: "border-2 border-black w-80 h-8", value: state[0], onChange: (e) => state[1](e.target.value) }) }));
|
|
6
6
|
}
|
|
@@ -22,7 +22,7 @@ export default function PostcodeModal({ state, showAction, }) {
|
|
|
22
22
|
return (_jsx(ModalDesign, { titles: {
|
|
23
23
|
title: "주소를 검색하고 선택해주세요",
|
|
24
24
|
subtitle: "주소를 검색하고 선택해주세요",
|
|
25
|
-
}, showAction: showAction,
|
|
25
|
+
}, showAction: showAction, option: {
|
|
26
26
|
width: "lg",
|
|
27
27
|
height: "xl",
|
|
28
28
|
}, children: _jsx(Suspense, { fallback: _jsx(Loading.Spinner, {}), children: isClient && (_jsx(DaumPostcodeEmbed, { onComplete: handler, className: "mt-16" })) }) }));
|
|
@@ -9,7 +9,7 @@ export default function OverlayDesign({ titles, children, showAction, }) {
|
|
|
9
9
|
const container = {
|
|
10
10
|
positions: "absolute top-0 right-0 z-30",
|
|
11
11
|
sizes: "h-full",
|
|
12
|
-
styles: "box-shadow-
|
|
12
|
+
styles: "box-shadow-md bg-white",
|
|
13
13
|
};
|
|
14
14
|
const body = {
|
|
15
15
|
positions: "relative",
|
|
@@ -16,18 +16,18 @@ export default function Manage({ titles, showAction, elements, buttons, }) {
|
|
|
16
16
|
if (type === "select")
|
|
17
17
|
return (_jsx(Frame, { title: title, children: _jsx(Select, { state: state, selectOptions: selectOptions }) }, id + title));
|
|
18
18
|
if (type === "toggle")
|
|
19
|
-
return (_jsx(Frame, { title: title, children: _jsx(Toggle, { state: state, labels: labels,
|
|
19
|
+
return (_jsx(Frame, { title: title, children: _jsx(Toggle, { state: state, labels: labels, option: { disabled } }) }, id + title));
|
|
20
20
|
if (type === "input")
|
|
21
|
-
return (_jsx(Frame, { title: title, children: _jsx(Input, { state: state,
|
|
21
|
+
return (_jsx(Frame, { title: title, children: _jsx(Input, { state: state, option: {
|
|
22
22
|
width: "md",
|
|
23
23
|
disabled,
|
|
24
24
|
} }) }, id + title));
|
|
25
25
|
return null;
|
|
26
|
-
}) }), _jsx("div", { className: "absolute bottom-12 right-12 flex gap-4", children: buttons?.map(({ title, onClick,
|
|
26
|
+
}) }), _jsx("div", { className: "absolute bottom-12 right-12 flex gap-4", children: buttons?.map(({ title, onClick, option }) => (_jsx(Label.Button, { title: title, onClick: onClick, option: {
|
|
27
27
|
width: "sm",
|
|
28
28
|
height: "xs",
|
|
29
|
-
background:
|
|
30
|
-
text:
|
|
29
|
+
background: option?.background ?? "bg-crimson-dark",
|
|
30
|
+
text: option?.text ?? "text-white",
|
|
31
31
|
disabled: !onClick ? true : false,
|
|
32
32
|
} }, id + title))) })] }));
|
|
33
33
|
}
|
package/package.json
CHANGED
package/tailwind.config.ts
CHANGED
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.63
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { LabelWidget } from "../../interface";
|
|
2
|
-
export default function LabelDesign({ title, onClick,
|
|
2
|
+
export default function LabelDesign({ title, onClick, option, hoverState, }: LabelWidget): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../../util";
|
|
3
|
-
import Obstacle from "../Obstacle";
|
|
3
|
+
import Obstacle from "../template/Obstacle";
|
|
4
4
|
const widthSize = {
|
|
5
5
|
xs: "w-10",
|
|
6
6
|
sm: "w-22.5",
|
|
@@ -11,9 +11,9 @@ const heightSize = {
|
|
|
11
11
|
xs: "h-6.25",
|
|
12
12
|
sm: "h-11.25",
|
|
13
13
|
};
|
|
14
|
-
export default function LabelDesign({ title, onClick,
|
|
14
|
+
export default function LabelDesign({ title, onClick, option, hoverState, }) {
|
|
15
15
|
const [hover, setHover] = hoverState ?? [false, () => { }];
|
|
16
|
-
const { width, height, text, background, className, disabled } =
|
|
16
|
+
const { width, height, text, background, className, disabled } = option ?? {};
|
|
17
17
|
const container = {
|
|
18
18
|
positions: "relative z-10",
|
|
19
19
|
sizes: `${widthSize[width ?? "sm"]} ${heightSize[height ?? "xs"]}`,
|
package/widget/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as Input } from "./template/Input";
|
|
2
2
|
export { default as Select } from "./template/Select";
|
|
3
|
-
export { default as DatePicker } from "./DatePicker";
|
|
3
|
+
export { default as DatePicker } from "./template/DatePicker";
|
|
4
|
+
export { default as CheckBox } from "./template/CheckBox";
|
|
4
5
|
export { default as Label } from "./template/Label";
|
|
5
6
|
export { default as Switch } from "./template/Switch";
|
|
6
|
-
export { default as Toggle } from "./Toggle";
|
|
7
|
+
export { default as Toggle } from "./template/Toggle";
|
package/widget/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as Input } from "./template/Input";
|
|
2
2
|
export { default as Select } from "./template/Select";
|
|
3
|
-
export { default as DatePicker } from "./DatePicker";
|
|
3
|
+
export { default as DatePicker } from "./template/DatePicker";
|
|
4
|
+
export { default as CheckBox } from "./template/CheckBox";
|
|
4
5
|
export { default as Label } from "./template/Label";
|
|
5
6
|
export { default as Switch } from "./template/Switch";
|
|
6
|
-
export { default as Toggle } from "./Toggle";
|
|
7
|
+
export { default as Toggle } from "./template/Toggle";
|
|
@@ -8,12 +8,12 @@ const widthSize = {
|
|
|
8
8
|
"2xl": "w-144",
|
|
9
9
|
full: "w-full",
|
|
10
10
|
};
|
|
11
|
-
export default function Checkbox({ state: [checked, setChecked], labels,
|
|
11
|
+
export default function Checkbox({ state: [checked, setChecked], labels, option, color, }) {
|
|
12
12
|
const checkBoxColor = {
|
|
13
13
|
red: "checked:bg-[#910023]",
|
|
14
14
|
blue: "checked:bg-[#173A8B]",
|
|
15
15
|
green: "checked:bg-[#DFE6E5]",
|
|
16
16
|
};
|
|
17
|
-
const { disabled } =
|
|
17
|
+
const { disabled } = option ?? {};
|
|
18
18
|
return (_jsxs("div", { className: "w-auto h-6 flex items-center ", children: [_jsx("input", { type: "checkbox", className: `check-box mr-2 appearance-none w-6 h-6 border-2 border-[#E8EBF3] rounded-md ${checkBoxColor[color]} hover:box-shadow`, disabled: typeof disabled === "boolean" && disabled, checked: checked, onChange: (e) => setChecked(e.target.checked) }), _jsx("label", { htmlFor: "checkbox1", children: labels })] }));
|
|
19
19
|
}
|
|
@@ -13,8 +13,8 @@ const widthSize = {
|
|
|
13
13
|
"2xl": "w-144",
|
|
14
14
|
full: "w-full",
|
|
15
15
|
};
|
|
16
|
-
export default function DatePicker({
|
|
17
|
-
const { width } =
|
|
16
|
+
export default function DatePicker({ option }) {
|
|
17
|
+
const { width } = option ?? {};
|
|
18
18
|
const [selectedDate, setSelectedDate] = useState(new Date());
|
|
19
19
|
const calRef = useRef(null);
|
|
20
20
|
return (_jsx("div", { children: _jsx(ReactDatePicker, { dateFormat: "yyyy\uB144 MM\uC6D4 dd\uC77C", icon: "fa fa-calendar", minDate: new Date("1900-01-01"), maxDate: new Date("2100-01-01"), selected: selectedDate, shouldCloseOnSelect: false, ref: calRef, onChange: (date) => setSelectedDate(date), locale: ko, className: "bg-slate-200 p-1 pl-2 pr-4 text-sm text-left rounded-md hover:bg-white focus:bg-white transition-all box-inner-shadow focus:outline-none w-68 h-8", children: _jsx("div", { className: "w-full h-auto flex justify-end items-end pr-4 pb-4", children: _jsx("button", { className: "p-2 bg-green-dark text-white rounded-md pr-4 pl-4 hover:opacity-85 hover:shadow-md transition-all", onClick: () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useId, useState } from "react";
|
|
3
|
-
import { cn } from "
|
|
3
|
+
import { cn } from "../../util";
|
|
4
4
|
const widthSize = {
|
|
5
5
|
xs: "w-28",
|
|
6
6
|
sm: "w-48",
|
|
@@ -10,12 +10,12 @@ const widthSize = {
|
|
|
10
10
|
"2xl": "w-144",
|
|
11
11
|
full: "w-full",
|
|
12
12
|
};
|
|
13
|
-
export default function EmailInput({ state, placeholder,
|
|
14
|
-
const { width } =
|
|
13
|
+
export default function EmailInput({ state, placeholder, option, }) {
|
|
14
|
+
const { width } = option ?? {};
|
|
15
15
|
const id = useId();
|
|
16
16
|
const [value, setValue] = state;
|
|
17
17
|
const [focused, setFocused] = useState(false);
|
|
18
|
-
const { text } =
|
|
18
|
+
const { text } = option ?? {};
|
|
19
19
|
const isValidEmail = (email) => {
|
|
20
20
|
return /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(email);
|
|
21
21
|
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState } from "react";
|
|
3
|
+
import { cn, gradient } from "../../../util";
|
|
4
|
+
import Label from "../Label";
|
|
5
|
+
export default function LG({ state, placeholder, flag, type, label, }) {
|
|
6
|
+
const [value, setValue] = state;
|
|
7
|
+
const [onFocus, setOnFocus] = useState(false);
|
|
8
|
+
const ref = useRef(null);
|
|
9
|
+
const container = {
|
|
10
|
+
positions: "relative",
|
|
11
|
+
};
|
|
12
|
+
const placeholderBox = {
|
|
13
|
+
positions: "absolute left-5",
|
|
14
|
+
styles: "duration-300",
|
|
15
|
+
fonts: "leading-none text-gray-medium font-pretendard-medium",
|
|
16
|
+
animation: value || onFocus ? "top-2.625 text-xs" : "top-4.375 text-base",
|
|
17
|
+
};
|
|
18
|
+
const styleByFlag = (flag) => {
|
|
19
|
+
if (typeof flag === "undefined")
|
|
20
|
+
return "bg-gray-light border-green-dark";
|
|
21
|
+
if (flag)
|
|
22
|
+
return "bg-green-dark/10 text-green-dark border-green-dark ";
|
|
23
|
+
return "bg-crimson-burgundy/10 text-crimson-burgundy border-crimson-burgundy";
|
|
24
|
+
};
|
|
25
|
+
const inputBox = {
|
|
26
|
+
styles: styleByFlag(flag),
|
|
27
|
+
sizes: "w-102.5 h-13.5",
|
|
28
|
+
paddings: `${placeholder && "pt-3"} pl-5`,
|
|
29
|
+
fonts: "text-sm",
|
|
30
|
+
boundaries: "rounded-md outline-none",
|
|
31
|
+
focuses: onFocus ? "border " : "border-0",
|
|
32
|
+
shadows: onFocus &&
|
|
33
|
+
!(flag === false) &&
|
|
34
|
+
"shadow-[0px_0px_10px_0px_rgba(16,86,82,0.38)]",
|
|
35
|
+
};
|
|
36
|
+
return (_jsxs("div", { className: cn(container), children: [_jsx("div", { onClick: () => ref.current?.focus(), className: cn(placeholderBox), children: placeholder }), _jsx("input", { ref: ref, className: cn(inputBox), value: value, onFocus: () => setOnFocus(true), onBlur: () => setOnFocus(false), onChange: (e) => setValue(e.target.value), type: type ?? "text" }), label && (_jsx(Label.Button, { title: label.title, onClick: label.onClick, option: {
|
|
37
|
+
width: "sm",
|
|
38
|
+
height: "xs",
|
|
39
|
+
className: "absolute top-3.5 right-3.75",
|
|
40
|
+
background: label.option?.background ?? gradient.bg.greenToRed,
|
|
41
|
+
text: label.option?.text ?? "text-white",
|
|
42
|
+
...label.option,
|
|
43
|
+
} }))] }));
|
|
44
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InputWidget } from "../../../interface";
|
|
2
|
+
declare function Input({ state, onKeyDown, placeholder, option }: InputWidget): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare namespace Input {
|
|
4
|
+
var Form: typeof import("./Form").default;
|
|
5
|
+
}
|
|
6
|
+
export default Input;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
import { cn } from "../../../util";
|
|
4
|
+
import Obstacle from "../Obstacle";
|
|
5
|
+
import Form from "./Form";
|
|
6
|
+
const widthSize = {
|
|
7
|
+
xs: "w-28",
|
|
8
|
+
sm: "w-48",
|
|
9
|
+
md: "w-64",
|
|
10
|
+
lg: "w-96",
|
|
11
|
+
xl: "w-128",
|
|
12
|
+
"2xl": "w-144",
|
|
13
|
+
full: "w-full",
|
|
14
|
+
};
|
|
15
|
+
function Input({ state, onKeyDown, placeholder, option }) {
|
|
16
|
+
const { width, disabled } = option ?? {};
|
|
17
|
+
const [value, setValue] = state;
|
|
18
|
+
const id = useId();
|
|
19
|
+
const container = {
|
|
20
|
+
positions: "relative",
|
|
21
|
+
width: `${widthSize[width ?? "xs"]} h-8`,
|
|
22
|
+
displays: "flex items-center",
|
|
23
|
+
};
|
|
24
|
+
const body = {
|
|
25
|
+
styles: "rounded-md bg-slate-200 text-xs",
|
|
26
|
+
sizes: "w-full h-full",
|
|
27
|
+
paddings: "pl-4",
|
|
28
|
+
pseudo: "focus:outline-none focus:bg-white focus:text-black box-shadow-focus",
|
|
29
|
+
effect: `transition-all`,
|
|
30
|
+
};
|
|
31
|
+
return (_jsxs("div", { className: cn(container), children: [_jsx("input", { className: cn(body), id: id, type: "text", value: value, placeholder: placeholder ?? "입력해주세요", onKeyDown: onKeyDown, onChange: (e) => setValue(e.target.value) }), _jsx(Obstacle, { disabled: disabled })] }));
|
|
32
|
+
}
|
|
33
|
+
Input.Form = Form;
|
|
34
|
+
export default Input;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LabelWidget } from "../../interface";
|
|
2
|
-
declare function Label({ title,
|
|
2
|
+
declare function Label({ title, option }: Omit<LabelWidget, "onClick">): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
declare namespace Label {
|
|
4
|
-
var Button: ({ title, hoverTitle, onClick,
|
|
4
|
+
var Button: ({ title, hoverTitle, onClick, option, }: Omit<LabelWidget, "hoverState"> & {
|
|
5
5
|
hoverTitle?: string | undefined;
|
|
6
6
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
}
|
package/widget/template/Label.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import LabelDesign from "../design/Label.design";
|
|
4
|
-
function Label({ title,
|
|
4
|
+
function Label({ title, option }) {
|
|
5
5
|
const [hover, setHover] = useState(false);
|
|
6
|
-
return (_jsx(LabelDesign, { title: title, hoverState: [hover, setHover],
|
|
6
|
+
return (_jsx(LabelDesign, { title: title, hoverState: [hover, setHover], option: { ...option, width: "sm", height: "xs" } }));
|
|
7
7
|
}
|
|
8
|
-
function Button({ title, hoverTitle, onClick,
|
|
8
|
+
function Button({ title, hoverTitle, onClick, option, }) {
|
|
9
9
|
const [hover, setHover] = useState(false);
|
|
10
|
-
return (_jsx(LabelDesign, { title: hoverTitle ? (!hover ? title : hoverTitle) : title, onClick: onClick, hoverState: [hover, setHover],
|
|
11
|
-
...
|
|
12
|
-
width:
|
|
13
|
-
height:
|
|
10
|
+
return (_jsx(LabelDesign, { title: hoverTitle ? (!hover ? title : hoverTitle) : title, onClick: onClick, hoverState: [hover, setHover], option: {
|
|
11
|
+
...option,
|
|
12
|
+
width: option?.width ?? "md",
|
|
13
|
+
height: option?.height ?? "sm",
|
|
14
14
|
} }));
|
|
15
15
|
}
|
|
16
16
|
Label.Button = Button;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SelectWidget } from "../../../interface";
|
|
2
|
-
export default function SelectLG<T>({ state, selectOptions, placeholder,
|
|
2
|
+
export default function SelectLG<T>({ state, selectOptions, placeholder, option, }: SelectWidget<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,7 +14,7 @@ const heightSize = {
|
|
|
14
14
|
xs: "h-6.5",
|
|
15
15
|
sm: "h-9",
|
|
16
16
|
};
|
|
17
|
-
export default function SelectLG({ state, selectOptions, placeholder,
|
|
17
|
+
export default function SelectLG({ state, selectOptions, placeholder, option, }) {
|
|
18
18
|
const id = useId();
|
|
19
19
|
const { setIsOwn, setIsOwnId } = useActionStore();
|
|
20
20
|
const [value, setValue] = state;
|
|
@@ -58,7 +58,7 @@ export default function SelectLG({ state, selectOptions, placeholder, options, }
|
|
|
58
58
|
};
|
|
59
59
|
const button = {
|
|
60
60
|
displays: "flex items-center",
|
|
61
|
-
sizes: `${widthSize[
|
|
61
|
+
sizes: `${widthSize[option?.width ?? "md"]} ${heightSize[option?.height ?? "sm"]}`,
|
|
62
62
|
styles: "pl-1 rounded-md focus:outline-none duration-100 text-gray-400",
|
|
63
63
|
shadow: isOpen || isHover ? "box-shadow" : "shadow-none",
|
|
64
64
|
};
|
|
@@ -70,7 +70,7 @@ export default function SelectLG({ state, selectOptions, placeholder, options, }
|
|
|
70
70
|
const body = {
|
|
71
71
|
positions: "absolute z-30",
|
|
72
72
|
displays: "flex flex-col gap-1",
|
|
73
|
-
sizes: `${widthSize[
|
|
73
|
+
sizes: `${widthSize[option?.width ?? "md"]} min-h-6.5 max-h-40`,
|
|
74
74
|
paddings: "p-2",
|
|
75
75
|
styles: "bg-white box-shadow rounded-md box-shadow overflow-y-scroll",
|
|
76
76
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SelectWidget } from "../../../interface";
|
|
2
|
-
export default function Select<T>({ state, selectOptions, placeholder,
|
|
2
|
+
export default function Select<T>({ state, selectOptions, placeholder, option, }: SelectWidget<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -13,7 +13,7 @@ const widthSize = {
|
|
|
13
13
|
const heightSize = {
|
|
14
14
|
xs: "h-6.5",
|
|
15
15
|
};
|
|
16
|
-
export default function Select({ state, selectOptions, placeholder,
|
|
16
|
+
export default function Select({ state, selectOptions, placeholder, option, }) {
|
|
17
17
|
const id = useId();
|
|
18
18
|
const { setIsOwn, setIsOwnId } = useActionStore();
|
|
19
19
|
const [value, setValue] = state;
|
|
@@ -56,7 +56,7 @@ export default function Select({ state, selectOptions, placeholder, options, })
|
|
|
56
56
|
};
|
|
57
57
|
const button = {
|
|
58
58
|
displays: "flex items-center",
|
|
59
|
-
sizes: `${widthSize[
|
|
59
|
+
sizes: `${widthSize[option?.width ?? "md"]} ${heightSize[option?.height ?? "xs"]}`,
|
|
60
60
|
styles: "pl-1 rounded-md focus:outline-none duration-100 text-gray-400",
|
|
61
61
|
shadow: isOpen || isHover ? "box-shadow" : "shadow-none",
|
|
62
62
|
};
|
|
@@ -68,7 +68,7 @@ export default function Select({ state, selectOptions, placeholder, options, })
|
|
|
68
68
|
const body = {
|
|
69
69
|
positions: "absolute z-30",
|
|
70
70
|
displays: "flex flex-col gap-1",
|
|
71
|
-
sizes: `${widthSize[
|
|
71
|
+
sizes: `${widthSize[option?.width ?? "md"]} min-h-6.5 max-h-23.75`,
|
|
72
72
|
paddings: "pl-1 py-1",
|
|
73
73
|
styles: "bg-white box-shadow rounded-md box-shadow overflow-y-scroll",
|
|
74
74
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SwitchProps } from "../../../interface";
|
|
2
|
-
export default function Handle<T>({ state, values,
|
|
2
|
+
export default function Handle<T>({ state, values, option, }: Omit<SwitchProps<T>, "display">): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn, gradient } from "../../../util";
|
|
3
|
-
export default function Handle({ state, values,
|
|
4
|
-
const { className } =
|
|
3
|
+
export default function Handle({ state, values, option, }) {
|
|
4
|
+
const { className } = option ?? {};
|
|
5
5
|
const valueIndex = values?.indexOf(state?.[0]);
|
|
6
6
|
const container = {
|
|
7
7
|
positions: "relative",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SwitchProps } from "../../../interface";
|
|
2
|
-
declare function Switch<T>({ state, values, display,
|
|
2
|
+
declare function Switch<T>({ state, values, display, option }: SwitchProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Switch;
|
|
@@ -20,8 +20,8 @@ const textSize = {
|
|
|
20
20
|
md: "text-sm",
|
|
21
21
|
lg: "text-base",
|
|
22
22
|
};
|
|
23
|
-
function Switch({ state, values, display,
|
|
24
|
-
const { text, size, className } =
|
|
23
|
+
function Switch({ state, values, display, option }) {
|
|
24
|
+
const { text, size, className } = option ?? {};
|
|
25
25
|
const container = {
|
|
26
26
|
displays: `flex ${gapSize[size ?? "md"]}`,
|
|
27
27
|
paddings: paddingSize[size ?? "md"],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Widget, State } from "
|
|
1
|
+
import { Widget, State } from "../../interface";
|
|
2
2
|
export interface HTMLToggleElement extends Widget {
|
|
3
3
|
state: State<boolean>;
|
|
4
4
|
labels?: [[true, string], [false, string]];
|
|
5
5
|
}
|
|
6
|
-
export default function Toggle({ state: [chekced, setChecked], labels,
|
|
6
|
+
export default function Toggle({ state: [chekced, setChecked], labels, option, }: HTMLToggleElement): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "
|
|
3
|
-
export default function Toggle({ state: [chekced, setChecked], labels,
|
|
4
|
-
const { disabled, className } =
|
|
2
|
+
import { cn } from "../../util";
|
|
3
|
+
export default function Toggle({ state: [chekced, setChecked], labels, option, }) {
|
|
4
|
+
const { disabled, className } = option ?? {};
|
|
5
5
|
const container = {
|
|
6
6
|
displays: "flex items-center",
|
|
7
7
|
sizes: "h-6",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Titles } from "../../interface";
|
|
2
|
-
import { Theme } from "../../interface";
|
|
3
|
-
type Step = [string, boolean];
|
|
4
|
-
interface ProgressCardProps {
|
|
5
|
-
titles: Titles;
|
|
6
|
-
steps: Step[];
|
|
7
|
-
theme?: Theme;
|
|
8
|
-
}
|
|
9
|
-
export default function ProgressCard({ titles, steps, theme, }: ProgressCardProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export {};
|