@edu-tosel/design 1.0.65 → 1.0.67
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.d.ts +2 -0
- package/asset/svg/Direction.d.ts +4 -0
- package/asset/svg/Direction.js +11 -0
- package/asset/svg/Direction.tsx +40 -0
- package/card/design/Card.design.js +13 -12
- package/card/design/CustomCard.design.d.ts +2 -0
- package/card/design/CustomCard.design.js +23 -0
- package/card/design/TableCard.design.js +7 -4
- package/card/index.d.ts +1 -0
- package/card/index.js +1 -0
- package/card/template/ConfirmCard/index.d.ts +3 -0
- package/card/template/ConfirmCard/index.js +3 -3
- package/card/template/CustomCard.d.ts +3 -0
- package/card/template/CustomCard.js +6 -0
- package/card/template/InfoCard/Academy.d.ts +1 -1
- package/card/template/InfoCard/Academy.js +4 -4
- package/card/template/NavCard.js +5 -1
- package/card/template/ProgressCard/Large.d.ts +1 -1
- package/card/template/ProgressCard/Large.js +4 -4
- package/card/template/ProgressCard/Small.d.ts +1 -1
- package/card/template/ProgressCard/Small.js +3 -3
- package/interaction/index.d.ts +1 -0
- package/interaction/index.js +1 -0
- package/interaction/template/Lock.d.ts +3 -0
- package/interaction/template/Lock.js +4 -0
- package/interface/Action.d.ts +6 -1
- package/interface/Board.d.ts +2 -1
- package/interface/Card.d.ts +9 -2
- package/interface/Data.d.ts +41 -0
- package/interface/Data.js +4 -0
- package/interface/Property.d.ts +8 -24
- package/interface/index.d.ts +2 -1
- package/interface/index.js +2 -1
- package/interface/widget/Obstacle.d.ts +10 -0
- package/interface/widget/Obstacle.js +1 -0
- package/interface/widget/Select.d.ts +23 -0
- package/interface/widget/Select.js +1 -0
- package/interface/widget/index.d.ts +1 -0
- package/layout/design/DataField.design.js +7 -5
- package/layout/design/Row.design/SelectRoll.d.ts +7 -0
- package/layout/design/Row.design/SelectRoll.js +39 -0
- package/layout/design/{Row.design.d.ts → Row.design/index.d.ts} +1 -1
- package/layout/design/{Row.design.js → Row.design/index.js} +13 -6
- package/layout/template/DataField.js +1 -1
- package/layout/template/Gallery.d.ts +3 -1
- package/layout/template/Gallery.js +4 -2
- package/layout/template/Row.js +1 -1
- package/layout/template/Tab.d.ts +1 -0
- package/layout/template/Tab.js +5 -3
- package/modal/template/Confirm/Switch.d.ts +2 -6
- package/modal/template/Confirm/Switch.js +2 -6
- package/package.json +1 -1
- package/tailwind.config.ts +2 -0
- package/version.txt +1 -1
- package/widget/design/Label.design.js +2 -1
- package/widget/design/Obstacle.design.d.ts +2 -0
- package/widget/design/Obstacle.design.js +13 -0
- package/widget/index.d.ts +2 -0
- package/widget/index.js +2 -0
- package/widget/template/Counter.d.ts +19 -0
- package/widget/template/Counter.js +48 -0
- package/widget/template/Input/Form.d.ts +1 -1
- package/widget/template/Input/Form.js +3 -2
- package/widget/template/Obstacle/index.d.ts +6 -0
- package/widget/template/Obstacle/index.js +13 -0
- package/widget/template/Pagination.d.ts +7 -0
- package/widget/template/Pagination.js +20 -0
- package/widget/template/Select/Handle.d.ts +2 -0
- package/widget/template/Select/Handle.js +30 -0
- package/widget/template/Select/Swipe.d.ts +10 -0
- package/widget/template/Select/Swipe.js +11 -0
- package/widget/template/Select/Switch.d.ts +3 -0
- package/widget/template/Select/Switch.js +43 -0
- package/widget/template/Select/Tag.d.ts +16 -0
- package/widget/template/Select/Tag.js +29 -0
- package/widget/template/Select/index.d.ts +8 -0
- package/widget/template/Select/index.js +5 -1
- package/widget/template/Switch/Switch.d.ts +17 -3
- package/widget/template/Switch/Switch.js +9 -10
- package/widget/template/Obstacle.d.ts +0 -4
- package/widget/template/Obstacle.js +0 -10
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../../util";
|
|
3
3
|
import { useActionStore } from "../../store";
|
|
4
|
+
import { widthSizes } from "../../asset/sizes";
|
|
5
|
+
import SVG from "../../asset/SVG";
|
|
4
6
|
const heightSize = {
|
|
5
7
|
sm: "h-10",
|
|
6
8
|
md: "h-13.75",
|
|
@@ -14,21 +16,21 @@ export default function DataFieldDesign({ id, dataField, option, }) {
|
|
|
14
16
|
displays: "flex items-center",
|
|
15
17
|
sizes: `w-full ${heightSize[height ?? "md"]}`,
|
|
16
18
|
paddings: padding && padding,
|
|
17
|
-
styles: "bg-white box-shadow-sm font-pretendard-
|
|
19
|
+
styles: "bg-white box-shadow-sm font-pretendard-medium",
|
|
18
20
|
};
|
|
19
21
|
const block = {
|
|
20
22
|
displays: "xl:hidden block ",
|
|
21
23
|
sizes: container.sizes,
|
|
22
24
|
};
|
|
23
25
|
return (_jsxs(_Fragment, { children: [_jsx("div", { className: cn(container), children: dataField &&
|
|
24
|
-
Object.keys(dataField).map((key) => (_jsx("div", { className:
|
|
26
|
+
Object.keys(dataField).map((key) => (_jsx("div", { className: widthSizes[dataField[key]?.size], children: _jsxs("button", { onClick: () => setOrder(id, key), className: "flex items-center", children: [_jsx("div", { children: dataField[key]?.title }), _jsx("div", { className: "text-xs", children: orders?.map(({ orderBy, orderHow }) => {
|
|
25
27
|
if (orderBy === key) {
|
|
26
28
|
if (orderHow === "asc")
|
|
27
|
-
return
|
|
29
|
+
return _jsx(SVG.Direction.Asc, {});
|
|
28
30
|
else if (orderHow === "desc")
|
|
29
|
-
return
|
|
31
|
+
return _jsx(SVG.Direction.Desc, {});
|
|
30
32
|
else
|
|
31
|
-
return
|
|
33
|
+
return null;
|
|
32
34
|
}
|
|
33
35
|
}) })] }) }, id + key))) }), position && _jsx("div", { className: cn(block) })] }));
|
|
34
36
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { cn } from "../../../util";
|
|
4
|
+
export default function SelectRoll({ item, data }) {
|
|
5
|
+
const { options } = data ?? {};
|
|
6
|
+
const [isHover, setIsHover] = useState(false);
|
|
7
|
+
const keys = options?.map((option) => option.key);
|
|
8
|
+
const values = options?.map((option) => option.value);
|
|
9
|
+
const [index, setIndex] = useState(keys?.indexOf(String(item)) ?? 0);
|
|
10
|
+
const container = {
|
|
11
|
+
styles: "group cursor-default",
|
|
12
|
+
displays: "flex justify-center",
|
|
13
|
+
sizes: "w-[120px] ",
|
|
14
|
+
};
|
|
15
|
+
const body = {
|
|
16
|
+
positions: "relative",
|
|
17
|
+
displays: "flex justify-center items-center",
|
|
18
|
+
backgrounds: options[index].option?.background,
|
|
19
|
+
texts: options[index].option?.text,
|
|
20
|
+
sizes: "w-[120px] h-[30px]",
|
|
21
|
+
transitions: "duration-300",
|
|
22
|
+
hoverAct: isHover ? "w-[120px]" : "w-[100px]",
|
|
23
|
+
fonts: "text-[12px]",
|
|
24
|
+
styles: "rounded-[6px] leading-none overflow-hidden",
|
|
25
|
+
};
|
|
26
|
+
const toggle = {
|
|
27
|
+
positions: "absolute ",
|
|
28
|
+
displays: "flex justify-center items-center",
|
|
29
|
+
sizes: "w-[20px] h-full",
|
|
30
|
+
styles: "duration-300 text-gray-dark",
|
|
31
|
+
};
|
|
32
|
+
return (_jsx("div", { className: cn(container), children: _jsxs("div", { className: cn(body), onMouseLeave: () => setIsHover(false), onMouseEnter: () => setIsHover(true), children: [values[index], _jsx("button", { onClick: () => {
|
|
33
|
+
if (index > 0)
|
|
34
|
+
setIndex(index - 1);
|
|
35
|
+
}, className: cn(toggle, "-left-4 group-hover:left-1"), children: "-" }), _jsx("button", { onClick: () => {
|
|
36
|
+
if (index < keys.length - 1)
|
|
37
|
+
setIndex(index + 1);
|
|
38
|
+
}, className: cn(toggle, "-right-4 group-hover:right-1"), children: "+" })] }) }));
|
|
39
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RowProps } from "
|
|
1
|
+
import { RowProps } from "../../../interface";
|
|
2
2
|
export default function RowDesign<T>({ item, dataField, option, onClick, buttons, dot, }: RowProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useId } from "react";
|
|
3
|
-
import { ColorSet } from "
|
|
4
|
-
import { cn } from "
|
|
5
|
-
import { Label } from "
|
|
6
|
-
import { widthSizes } from "
|
|
3
|
+
import { ColorSet, isDataSelectRoll, } from "../../../interface";
|
|
4
|
+
import { cn } from "../../../util";
|
|
5
|
+
import { Label } from "../../../widget";
|
|
6
|
+
import { widthSizes } from "../../../asset/sizes";
|
|
7
|
+
import SelectRoll from "./SelectRoll";
|
|
7
8
|
export default function RowDesign({ item, dataField, option, onClick, buttons, dot, }) {
|
|
8
9
|
const { size, padding, text, noHover, className, isPointer } = option ?? {};
|
|
9
10
|
const id = useId();
|
|
@@ -27,10 +28,16 @@ export default function RowDesign({ item, dataField, option, onClick, buttons, d
|
|
|
27
28
|
styles: "rounded-full",
|
|
28
29
|
};
|
|
29
30
|
return (_jsxs("div", { className: cn(container), onClick: () => onClick?.(), children: [typeof dot !== "undefined" && _jsx("div", { className: cn(flagBox) }), dataField &&
|
|
30
|
-
Object.keys(dataField).map((key) => (_jsx("div", { className: cn(widthSizes[dataField[key]?.size], itemBox), children:
|
|
31
|
+
Object.keys(dataField).map((key) => (_jsx("div", { className: cn(widthSizes[dataField[key]?.size], itemBox), children: _jsx(RowElement, { data: dataField[key]?.data, item: item[key] }) }, id + key))), _jsx("div", { className: "absolute right-4 xl:right-8 flex gap-4", children: buttons?.map(({ title, onClick, option }) => (_jsx(Label.Button, { title: title, onClick: onClick, option: {
|
|
31
32
|
background: option?.background ?? "bg-crimson-dark",
|
|
32
33
|
text: option?.text ?? "text-white",
|
|
33
34
|
width: "xs",
|
|
34
35
|
height: "xs",
|
|
35
36
|
} }, id + title))) })] }));
|
|
36
37
|
}
|
|
38
|
+
function RowElement(props) {
|
|
39
|
+
const { data } = props;
|
|
40
|
+
if (isDataSelectRoll(data))
|
|
41
|
+
return _jsx(SelectRoll, { item: props.item, data: data });
|
|
42
|
+
return _jsx(_Fragment, { children: props.item });
|
|
43
|
+
}
|
|
@@ -9,7 +9,7 @@ function Board({ id, dataField }) {
|
|
|
9
9
|
function Card({ id, dataField }) {
|
|
10
10
|
return (_jsx(DataFieldDesign, { id: id, dataField: dataField, option: {
|
|
11
11
|
height: "sm",
|
|
12
|
-
padding: "px-2 xs:px-4 xl:px-
|
|
12
|
+
padding: "px-2 xs:px-4 xl:px-5",
|
|
13
13
|
} }));
|
|
14
14
|
}
|
|
15
15
|
const DataField = {
|
|
@@ -3,12 +3,14 @@ import Action from "./Action";
|
|
|
3
3
|
import Tab from "./Tab";
|
|
4
4
|
import { cn } from "../../util";
|
|
5
5
|
export default function Gallery({ action, children, option, }) {
|
|
6
|
-
const {
|
|
6
|
+
const { text, background, boundary } = option ?? {};
|
|
7
7
|
const tabBox = {
|
|
8
8
|
positions: "xl:absolute xl:-bottom-18 xl:left-0 z-5",
|
|
9
9
|
};
|
|
10
10
|
return (_jsxs("div", { className: "relative w-full flex", children: [_jsx(Action.Replace, { actions: action?.replaces, children: _jsx(Action.Show, { actions: action?.shows, children: children }) }), action?.tabs && (_jsx(Tab, { tabs: action?.tabs, option: {
|
|
11
11
|
className: cn(tabBox),
|
|
12
|
-
text
|
|
12
|
+
text,
|
|
13
|
+
background,
|
|
14
|
+
boundary,
|
|
13
15
|
} }))] }));
|
|
14
16
|
}
|
package/layout/template/Row.js
CHANGED
|
@@ -22,7 +22,7 @@ function Card({ item, dataField, onClick, buttons, height, noPadding, noHover, d
|
|
|
22
22
|
const id = useId();
|
|
23
23
|
return (_jsx(RowDesign, { onClick: onClick, item: item, dataField: dataField, buttons: buttons, dot: dot, option: {
|
|
24
24
|
size: `w-full ${height ?? "h-15"}`,
|
|
25
|
-
padding: !noPadding ? "px-2 xs:px-4 xl:px-
|
|
25
|
+
padding: !noPadding ? "px-2 xs:px-4 xl:px-5" : "",
|
|
26
26
|
text: "text-base",
|
|
27
27
|
noHover,
|
|
28
28
|
} }, id));
|
package/layout/template/Tab.d.ts
CHANGED
package/layout/template/Tab.js
CHANGED
|
@@ -10,7 +10,7 @@ const heightSize = {
|
|
|
10
10
|
lg: "h-9",
|
|
11
11
|
};
|
|
12
12
|
export default function Tab({ tabs, option, state, }) {
|
|
13
|
-
const { className, background, text, width, height } = option ?? {};
|
|
13
|
+
const { className, background, boundary, text, width, height } = option ?? {};
|
|
14
14
|
const [tabsSelection, setTabsSelection] = state
|
|
15
15
|
? state
|
|
16
16
|
: useState(tabs.map((_, i) => i === 0));
|
|
@@ -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:
|
|
23
|
+
backgrounds: boundary ?? "bg-white/30",
|
|
24
24
|
styles: "rounded-xl ",
|
|
25
25
|
};
|
|
26
26
|
const button = {
|
|
@@ -32,6 +32,8 @@ export default function Tab({ tabs, option, state, }) {
|
|
|
32
32
|
!isStatic &&
|
|
33
33
|
setTabsSelection(tabsSelection.map((_, i) => i === index));
|
|
34
34
|
return onClick && onClick();
|
|
35
|
-
}, className: cn(button, `${!isStatic &&
|
|
35
|
+
}, className: cn(button, `${!isStatic &&
|
|
36
|
+
tabsSelection[index] &&
|
|
37
|
+
`${background ?? "bg-white"} rounded-2xl`}`, `${isStatic &&
|
|
36
38
|
`${option?.background ?? "bg-green-dark"} ${option?.text ?? "text-white"} `}`), children: title }, title))) }));
|
|
37
39
|
}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import { SwitchProps } from "../../../interface";
|
|
2
1
|
import { ConfirmModalProps } from "../../../interface/Modal";
|
|
2
|
+
import { SelectSwitchProps } from "../../../interface/widget/Select";
|
|
3
3
|
interface SwitchModalProps<T> extends ConfirmModalProps {
|
|
4
|
-
switch:
|
|
4
|
+
switch: SelectSwitchProps<T>;
|
|
5
5
|
}
|
|
6
6
|
declare function SwitchModal<T>(props: SwitchModalProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
declare namespace SwitchModal {
|
|
8
|
-
var Handle: typeof SwitchModalHandle;
|
|
9
|
-
}
|
|
10
|
-
declare function SwitchModalHandle<T>(props: Omit<SwitchModalProps<T>, "display">): import("react/jsx-runtime").JSX.Element;
|
|
11
7
|
export default SwitchModal;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Select } from "../../../widget";
|
|
3
3
|
import ConfirmModalDesign from "../../design/ConfirmModal.design";
|
|
4
4
|
import { cn } from "../../../util";
|
|
5
5
|
function SwitchModalDesign(props) {
|
|
@@ -10,10 +10,6 @@ function SwitchModalDesign(props) {
|
|
|
10
10
|
return (_jsx(ConfirmModalDesign, { ...props, children: _jsx("div", { className: cn(container), children: props.children }) }));
|
|
11
11
|
}
|
|
12
12
|
function SwitchModal(props) {
|
|
13
|
-
return (_jsx(SwitchModalDesign, { ...props, children: _jsxs(_Fragment, { children: [_jsx(Switch, { ...props.switch }), props.children] }) }));
|
|
13
|
+
return (_jsx(SwitchModalDesign, { ...props, children: _jsxs(_Fragment, { children: [_jsx(Select.Switch, { ...props.switch }), props.children] }) }));
|
|
14
14
|
}
|
|
15
|
-
function SwitchModalHandle(props) {
|
|
16
|
-
return (_jsx(SwitchModalDesign, { ...props, children: _jsxs(_Fragment, { children: [_jsx(Switch.Handle, { ...props.switch }), props.children] }) }));
|
|
17
|
-
}
|
|
18
|
-
SwitchModal.Handle = SwitchModalHandle;
|
|
19
15
|
export default SwitchModal;
|
package/package.json
CHANGED
package/tailwind.config.ts
CHANGED
|
@@ -163,6 +163,7 @@ export default {
|
|
|
163
163
|
22.5: "5.625rem",
|
|
164
164
|
23: "5.75rem",
|
|
165
165
|
23.25: "5.8125rem",
|
|
166
|
+
23.5: "5.875rem",
|
|
166
167
|
23.75: "5.9375rem",
|
|
167
168
|
25: "6.25rem",
|
|
168
169
|
25.75: "6.4375rem",
|
|
@@ -209,6 +210,7 @@ export default {
|
|
|
209
210
|
75: "18.75rem",
|
|
210
211
|
76: "19rem",
|
|
211
212
|
78: "20rem",
|
|
213
|
+
81: "20.25rem",
|
|
212
214
|
82: "20.5rem",
|
|
213
215
|
84: "21rem",
|
|
214
216
|
85: "21.25rem",
|
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.67
|
|
@@ -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 "
|
|
3
|
+
import { Obstacle } from "../..";
|
|
4
4
|
const widthSize = {
|
|
5
5
|
xs: "w-10",
|
|
6
6
|
sm: "w-22.5",
|
|
@@ -10,6 +10,7 @@ const widthSize = {
|
|
|
10
10
|
const heightSize = {
|
|
11
11
|
xs: "h-6.25",
|
|
12
12
|
sm: "h-11.25",
|
|
13
|
+
md: "h-12.25",
|
|
13
14
|
};
|
|
14
15
|
export default function LabelDesign({ title, onClick, option, hoverState, }) {
|
|
15
16
|
const [hover, setHover] = hoverState ?? [false, () => { }];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../util";
|
|
3
|
+
export default function ObstacleDesign({ disabled, children, option, }) {
|
|
4
|
+
const { position, background, size } = option ?? {};
|
|
5
|
+
const obstacle = {
|
|
6
|
+
default: "absolute",
|
|
7
|
+
displays: "flex justify-center items-center",
|
|
8
|
+
positions: position ?? "top-0 left-0",
|
|
9
|
+
sizes: "w-full h-full",
|
|
10
|
+
background: background ?? "bg-white/30",
|
|
11
|
+
};
|
|
12
|
+
return (disabled && (_jsx("div", { onClick: typeof disabled === "function" ? disabled : undefined, className: cn(obstacle), children: children })));
|
|
13
|
+
}
|
package/widget/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export { default as Input } from "./template/Input";
|
|
2
|
+
export { default as Counter } from "./template/Counter";
|
|
2
3
|
export { default as Select } from "./template/Select";
|
|
3
4
|
export { default as DatePicker } from "./template/DatePicker";
|
|
4
5
|
export { default as CheckBox } from "./template/CheckBox";
|
|
5
6
|
export { default as Label } from "./template/Label";
|
|
6
7
|
export { default as Switch } from "./template/Switch";
|
|
7
8
|
export { default as Toggle } from "./template/Toggle";
|
|
9
|
+
export { default as Obstacle } from "./template/Obstacle";
|
package/widget/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export { default as Input } from "./template/Input";
|
|
2
|
+
export { default as Counter } from "./template/Counter";
|
|
2
3
|
export { default as Select } from "./template/Select";
|
|
3
4
|
export { default as DatePicker } from "./template/DatePicker";
|
|
4
5
|
export { default as CheckBox } from "./template/CheckBox";
|
|
5
6
|
export { default as Label } from "./template/Label";
|
|
6
7
|
export { default as Switch } from "./template/Switch";
|
|
7
8
|
export { default as Toggle } from "./template/Toggle";
|
|
9
|
+
export { default as Obstacle } from "./template/Obstacle";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Titles } from "../../interface";
|
|
2
|
+
interface Count {
|
|
3
|
+
title: string;
|
|
4
|
+
count: number;
|
|
5
|
+
option?: {
|
|
6
|
+
background?: string;
|
|
7
|
+
text?: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
interface CounterProps {
|
|
11
|
+
titles: Titles;
|
|
12
|
+
counts: Count[];
|
|
13
|
+
option?: {
|
|
14
|
+
position?: string;
|
|
15
|
+
boundary?: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export default function Counter({ titles, counts, option }: CounterProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../util";
|
|
3
|
+
export default function Counter({ titles, counts, option }) {
|
|
4
|
+
const { position, boundary } = option ?? {};
|
|
5
|
+
const container = {
|
|
6
|
+
default: "absolute",
|
|
7
|
+
displays: "flex justify-between items-end",
|
|
8
|
+
sizes: "w-full h-15",
|
|
9
|
+
positions: position ?? "top-5 right-0",
|
|
10
|
+
boundaries: boundary ?? "px-5",
|
|
11
|
+
};
|
|
12
|
+
const titleBox = {};
|
|
13
|
+
const countBox = {
|
|
14
|
+
displays: "flex gap-x-5",
|
|
15
|
+
sizes: "h-full",
|
|
16
|
+
};
|
|
17
|
+
const total = {
|
|
18
|
+
sizes: "w-12 h-full",
|
|
19
|
+
displays: "flex flex-col items-center justify-between",
|
|
20
|
+
backgrounds: "bg-gray-light",
|
|
21
|
+
styles: "rounded-[4px] p-1",
|
|
22
|
+
};
|
|
23
|
+
return (_jsxs("div", { className: cn(container), children: [_jsx("div", { className: cn(titleBox), children: titles.title }), _jsxs("div", { className: cn(countBox), children: [_jsx("div", { className: "flex gap-x-2.5 h-full", children: counts?.map((count) => (_jsx(CountBox, { ...count }, count.title))) }), _jsxs("div", { className: cn(total), children: [_jsx("div", { className: "text-xs text-gray-medium leading-tight", children: "\uC804\uCCB4" }), _jsx("div", { className: "font-pretendard-bold w-full leading-none text-end ", children: Object.values(counts)
|
|
24
|
+
.map((count) => count.count)
|
|
25
|
+
.reduce((acc, cur) => acc + cur, 0) })] })] })] }));
|
|
26
|
+
}
|
|
27
|
+
function CountBox({ title, count, option }) {
|
|
28
|
+
const { background, text } = option ?? {};
|
|
29
|
+
const container = {
|
|
30
|
+
displays: "flex flex-col items-center justify-between",
|
|
31
|
+
sizes: "w-12 h-full",
|
|
32
|
+
boundaries: "pb-1 pr-1",
|
|
33
|
+
};
|
|
34
|
+
const titleBox = {
|
|
35
|
+
displays: "flex justify-center items-center",
|
|
36
|
+
fonts: "text-xs leading-none",
|
|
37
|
+
sizes: "w-12 h-5.5",
|
|
38
|
+
backgrounds: background ?? "bg-gray-light",
|
|
39
|
+
texts: text ?? "text-gray-medium",
|
|
40
|
+
styles: "rounded-[4px]",
|
|
41
|
+
};
|
|
42
|
+
const countBox = {
|
|
43
|
+
fonts: "font-pretendard-bold text-end leading-none",
|
|
44
|
+
sizes: "w-full",
|
|
45
|
+
boundaries: "pr-1",
|
|
46
|
+
};
|
|
47
|
+
return (_jsxs("div", { className: cn(container), children: [_jsx("div", { className: cn(titleBox), children: title }), _jsx("div", { className: cn(countBox), children: count })] }));
|
|
48
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { InputWidget } from "../../../interface";
|
|
2
|
-
export default function LG({ state, placeholder, isValid, type, label, maxLength, }: InputWidget): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function LG({ state, placeholder, isValid, type, label, maxLength, disabled, }: InputWidget): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useState } from "react";
|
|
3
3
|
import { cn, gradient } from "../../../util";
|
|
4
4
|
import Label from "../Label";
|
|
5
|
-
|
|
5
|
+
import Obstacle from "../Obstacle";
|
|
6
|
+
export default function LG({ state, placeholder, isValid, type, label, maxLength, disabled, }) {
|
|
6
7
|
const [value, setValue] = state;
|
|
7
8
|
const [onFocus, setOnFocus] = useState(false);
|
|
8
9
|
const ref = useRef(null);
|
|
@@ -44,5 +45,5 @@ export default function LG({ state, placeholder, isValid, type, label, maxLength
|
|
|
44
45
|
background: label.option?.background ?? gradient.bg.greenToRed,
|
|
45
46
|
text: label.option?.text ?? "text-white",
|
|
46
47
|
...label.option,
|
|
47
|
-
} }))] }));
|
|
48
|
+
} })), _jsx(Obstacle, { disabled: disabled })] }));
|
|
48
49
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ObstacleProps } from "../../../interface/widget/Obstacle";
|
|
2
|
+
declare function Obstacle(props: ObstacleProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare namespace Obstacle {
|
|
4
|
+
var Blur: (props: ObstacleProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
}
|
|
6
|
+
export default Obstacle;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import ObstacleDesign from "../../design/Obstacle.design";
|
|
3
|
+
function Obstacle(props) {
|
|
4
|
+
return _jsx(ObstacleDesign, { ...props });
|
|
5
|
+
}
|
|
6
|
+
function Blur(props) {
|
|
7
|
+
return (_jsx(ObstacleDesign, { ...props, option: {
|
|
8
|
+
background: "bg-white/30 backdrop-blur-sm",
|
|
9
|
+
position: props.option?.position ?? "top-0 left-0",
|
|
10
|
+
} }));
|
|
11
|
+
}
|
|
12
|
+
Obstacle.Blur = Blur;
|
|
13
|
+
export default Obstacle;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../util";
|
|
3
|
+
import SVG from "../../asset/SVG";
|
|
4
|
+
export default function Pagination({ state, items }) {
|
|
5
|
+
const [page, setPage] = state;
|
|
6
|
+
const container = {
|
|
7
|
+
displays: "flex items-center justify-between",
|
|
8
|
+
sizes: "w-23.5 h-6.25",
|
|
9
|
+
backgrounds: "bg-gray-dark",
|
|
10
|
+
boundaries: "rounded-full px-2.5",
|
|
11
|
+
fonts: "text-xs",
|
|
12
|
+
};
|
|
13
|
+
return (_jsxs("div", { className: cn(container), children: [_jsx(SVG.Symbol.LessThan, { onClick: () => {
|
|
14
|
+
if (page > 1)
|
|
15
|
+
setPage(page - 1);
|
|
16
|
+
} }), _jsxs("div", { className: "flex items-center gap-x-[3px] text-white", children: [page, _jsx("div", { className: "text-gray-medium text-base font-pretendard-bold", children: "/" }), items ? items.length : 1] }), _jsx(SVG.Symbol.GreaterThan, { onClick: () => {
|
|
17
|
+
if (items && items.length > page)
|
|
18
|
+
setPage(page + 1);
|
|
19
|
+
} })] }));
|
|
20
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { widthSizes } from "../../../asset/sizes";
|
|
3
|
+
import { cn, gradient } from "../../../util";
|
|
4
|
+
export default function SelectHandle({ state, options, option, }) {
|
|
5
|
+
const { className } = option ?? {};
|
|
6
|
+
const length = options?.length;
|
|
7
|
+
const valueIndex = Object.values(options)
|
|
8
|
+
.map(({ value }) => value)
|
|
9
|
+
?.indexOf(state?.[0]);
|
|
10
|
+
const container = {
|
|
11
|
+
positions: "relative",
|
|
12
|
+
sizes: "w-102.5 h-10",
|
|
13
|
+
styles: "rounded-full bg-gray-light p-1.25",
|
|
14
|
+
className,
|
|
15
|
+
};
|
|
16
|
+
const area = {
|
|
17
|
+
sizes: `${widthSizes[Math.round(((valueIndex + 1) / length) * 100)]} h-7.5`,
|
|
18
|
+
displays: "flex justify-end",
|
|
19
|
+
background: gradient.bg.greenToRed,
|
|
20
|
+
styles: "rounded-full p-1.25",
|
|
21
|
+
animations: "duration-200",
|
|
22
|
+
};
|
|
23
|
+
const handle = {
|
|
24
|
+
sizes: "w-5 h-5",
|
|
25
|
+
styles: "rounded-full bg-white",
|
|
26
|
+
};
|
|
27
|
+
return (_jsxs("div", { className: cn(container), children: [_jsx("div", { className: cn(area), children: _jsx("div", { className: cn(handle) }) }), _jsx("div", { className: "absolute flex w-full h-full top-0 left-0", children: options?.map(({ value }) => (_jsx("button", { onClick: () => {
|
|
28
|
+
return state?.[1](value);
|
|
29
|
+
}, className: "flex flex-1 h-10 " }, value))) })] }));
|
|
30
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface SwipeProps<T> {
|
|
2
|
+
title: string;
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
selectOptions: {
|
|
5
|
+
title: string;
|
|
6
|
+
value: T;
|
|
7
|
+
}[];
|
|
8
|
+
}
|
|
9
|
+
export default function Swipe<T>({ title, children, selectOptions, }: SwipeProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import Pagination from "../Pagination";
|
|
4
|
+
import { cn } from "../../../util";
|
|
5
|
+
export default function Swipe({ title, children, selectOptions, }) {
|
|
6
|
+
const page = useState(1);
|
|
7
|
+
const container = {
|
|
8
|
+
displays: "flex flex-col gap-y-3",
|
|
9
|
+
};
|
|
10
|
+
return (_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex justify-between", children: [_jsx("div", { children: title }), _jsx(Pagination, { state: page, items: selectOptions })] }), children] }));
|
|
11
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../util";
|
|
3
|
+
const paddingSize = {
|
|
4
|
+
md: "p-1.5",
|
|
5
|
+
lg: "p-2.5",
|
|
6
|
+
};
|
|
7
|
+
const widthSize = {
|
|
8
|
+
md: "w-81",
|
|
9
|
+
lg: "w-100",
|
|
10
|
+
};
|
|
11
|
+
const heightSize = {
|
|
12
|
+
md: "h-10.5",
|
|
13
|
+
lg: "h-20",
|
|
14
|
+
};
|
|
15
|
+
const gapSize = {
|
|
16
|
+
md: "gap-x-1.5",
|
|
17
|
+
lg: "gap-x-2.5",
|
|
18
|
+
};
|
|
19
|
+
const textSize = {
|
|
20
|
+
md: "text-sm",
|
|
21
|
+
lg: "text-base",
|
|
22
|
+
};
|
|
23
|
+
function SelectSwitch({ state, selectOptions, option, }) {
|
|
24
|
+
const { text, size, className } = option ?? {};
|
|
25
|
+
const container = {
|
|
26
|
+
sizes: `${widthSize[size ?? "md"]} ${heightSize[size ?? "md"]}`,
|
|
27
|
+
displays: `flex ${gapSize[size ?? "md"]}`,
|
|
28
|
+
paddings: paddingSize[size ?? "md"],
|
|
29
|
+
styles: "rounded-full bg-gray-light",
|
|
30
|
+
className,
|
|
31
|
+
};
|
|
32
|
+
const button = (flag) => ({
|
|
33
|
+
displays: "flex flex-1 gap-x-3 justify-center items-center",
|
|
34
|
+
backgrounds: flag ? "bg-white" : "bg-transparent",
|
|
35
|
+
text,
|
|
36
|
+
textSizes: textSize[size ?? "md"],
|
|
37
|
+
styles: "rounded-full ",
|
|
38
|
+
});
|
|
39
|
+
return (_jsx("div", { className: cn(container), children: selectOptions?.map(({ value, icon, title }) => {
|
|
40
|
+
return (_jsxs("button", { onClick: () => state[1](value), className: cn(button(value === state[0])), children: [icon && _jsx("img", { src: icon }), _jsx("div", { children: title })] }));
|
|
41
|
+
}) }));
|
|
42
|
+
}
|
|
43
|
+
export default SelectSwitch;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { State } from "../../../interface";
|
|
2
|
+
interface SelectTagProps<T> {
|
|
3
|
+
state: State<T[]>;
|
|
4
|
+
selectOptions: {
|
|
5
|
+
title: string;
|
|
6
|
+
value: T;
|
|
7
|
+
}[];
|
|
8
|
+
selectHow?: "one" | "plural";
|
|
9
|
+
option?: {
|
|
10
|
+
className?: string;
|
|
11
|
+
background?: string;
|
|
12
|
+
text?: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export default function SelectTag<T>(props: SelectTagProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|