@edu-tosel/design 1.0.22 → 1.0.24

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.
Files changed (47) hide show
  1. package/asset/fonts/Pretendard-Bold.otf +0 -0
  2. package/asset/fonts/Pretendard-Light.otf +0 -0
  3. package/board/template/CanvasBoard.js +8 -10
  4. package/board/template/ManageBoard.d.ts +1 -1
  5. package/board/template/ManageBoard.js +2 -2
  6. package/board/widget/Board.design.d.ts +1 -1
  7. package/board/widget/Board.design.js +11 -4
  8. package/board/widget/Header.js +2 -2
  9. package/card/template/ChartCard.js +1 -1
  10. package/card/template/InfoCard.js +7 -7
  11. package/card/widget/Card.design.js +1 -5
  12. package/card/widget/InfoCard.design.js +1 -1
  13. package/card/widget/NavCard.design.js +1 -1
  14. package/card/widget/TableCard.design.js +2 -7
  15. package/globals.css +10 -0
  16. package/html/widget/Input.js +11 -4
  17. package/html/widget/Label.design.js +3 -1
  18. package/html/widget/Obstacle.d.ts +4 -0
  19. package/html/widget/Obstacle.js +10 -0
  20. package/html/widget/Select.js +3 -3
  21. package/interface/Card.d.ts +4 -3
  22. package/interface/HTMLElement.d.ts +2 -2
  23. package/interface/Overlay.d.ts +14 -11
  24. package/interface/Property.d.ts +1 -0
  25. package/interface/Widget.d.ts +3 -1
  26. package/layout/template/Row.d.ts +2 -2
  27. package/layout/template/Row.js +4 -4
  28. package/layout/template/report/Header.js +1 -1
  29. package/layout/widget/DataField.design.js +3 -3
  30. package/layout/widget/Row.design.d.ts +1 -1
  31. package/layout/widget/Row.design.js +11 -4
  32. package/layout/widget/Shelf.design.js +1 -1
  33. package/layout/widget/dashboard/Header.js +1 -1
  34. package/modal/template/Alert.js +1 -1
  35. package/modal/template/Input.js +1 -1
  36. package/modal/widget/Modal.design.js +1 -1
  37. package/navigation/Navigation.js +1 -1
  38. package/overlay/template/Manage.d.ts +1 -1
  39. package/overlay/template/Manage.js +26 -12
  40. package/overlay/widget/Frame.design.d.ts +4 -0
  41. package/overlay/widget/Frame.design.js +4 -0
  42. package/overlay/widget/Overlay.design.js +11 -5
  43. package/package.json +1 -1
  44. package/store/index.js +1 -0
  45. package/tailwind.config.ts +3 -0
  46. package/util/pattern.js +1 -1
  47. package/version.txt +1 -1
Binary file
Binary file
@@ -1,16 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Events, Label } from "../..";
2
+ import { Events } from "../..";
3
3
  import { cn } from "../../util";
4
4
  import { Board } from "../widget/Board.design";
5
5
  import BoardHeader from "../widget/Header";
6
6
  export default function CanvasBoard({ header, children, options, widgets, buttons, }) {
7
- const layouts = "flex flex-col lg:flex-row lg:flex-wrap gap-7.5 ";
8
- const sizes = "h-full ";
9
- const paddings = "pb-36 xl:pb-6 px-2 xs:px-4 xl:pl-7.5 xl:pr-2 pt-2 xs:pt-4 xl:pt-7.5";
10
- const styles = "overflow-y-scroll ";
11
- return (_jsxs("div", { className: "relative w-full", children: [_jsxs(Board, { widgets: widgets, options: { ...options, isRounded: true }, children: [header && _jsx(BoardHeader, { ...header }), _jsx(Events.Replace, { widgets: widgets?.replaces, children: _jsx("div", { className: cn(layouts, sizes, paddings, styles), children: children }) })] }), _jsx("div", { className: "absolute -bottom-18.5 right-0", children: buttons?.map(({ title, onClick, options }) => (_jsx(Label.Button, { title: title, onClick: onClick, options: {
12
- ...options,
13
- text: "text-white",
14
- background: "bg-crimson-burgundy",
15
- } }))) })] }));
7
+ const body = {
8
+ displays: "flex flex-col lg:flex-row lg:flex-wrap gap-7.5 ",
9
+ sizes: "h-full",
10
+ paddings: `${header ? "pb-55 xl:pb-25" : "pb-36 xl:pb-6"} px-2 xs:px-4 xl:pl-7.5 xl:pr-2 pt-2 xs:pt-4 xl:pt-7.5`,
11
+ styles: "overflow-y-scroll",
12
+ };
13
+ return (_jsxs(Board, { widgets: widgets, buttons: buttons, options: { ...options, isRounded: true }, children: [header && _jsx(BoardHeader, { ...header }), _jsx(Events.Replace, { widgets: widgets?.replaces, children: _jsx("div", { className: cn(body), children: children }) })] }));
16
14
  }
@@ -1,4 +1,4 @@
1
1
  import { ManageBoardProps } from "../../interface/Board";
2
2
  export default function ManageBoard<K extends string, T extends {
3
3
  [p in K]: any;
4
- }>({ header, dataSets, dataField, widgets, options }: ManageBoardProps<T>): import("react/jsx-runtime").JSX.Element;
4
+ }>({ header, dataSets, dataField, widgets, options, buttons, }: ManageBoardProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -5,7 +5,7 @@ import BoardHeader from "../widget/Header";
5
5
  import { cn, sortByOrder } from "../../util";
6
6
  import { useWidgetStore } from "../../store";
7
7
  import { useId } from "react";
8
- export default function ManageBoard({ header, dataSets, dataField, widgets, options }) {
8
+ export default function ManageBoard({ header, dataSets, dataField, widgets, options, buttons, }) {
9
9
  const { classNames, noPadding } = options ?? {};
10
10
  const { order } = useWidgetStore();
11
11
  const id = useId();
@@ -16,6 +16,6 @@ export default function ManageBoard({ header, dataSets, dataField, widgets, opti
16
16
  paddings: `${!noPadding ? "pt-7.5 pb-60 px-2 xs:pl-4 xl:pl-7.5 xl:pb-7.5 " : ""} `,
17
17
  styles: "overflow-y-scroll",
18
18
  };
19
- return (_jsxs(Board, { widgets: widgets, options: { isRounded: true }, children: [header && _jsx(BoardHeader, { ...header }), dataField && _jsx(DataField.Board, { id: id, dataField: dataField }), _jsx("div", { className: cn(container), children: _jsx(Events.Replace, { widgets: widgets?.replaces, children: dataSets.map(({ titles, items, renderItem, interaction }, index) => (_jsxs(Shelf.Wrap, { titles: titles, classNames: classNames, children: [items &&
19
+ return (_jsxs(Board, { widgets: widgets, buttons: buttons, options: { isRounded: true }, children: [header && _jsx(BoardHeader, { ...header }), dataField && _jsx(DataField.Board, { id: id, dataField: dataField }), _jsx("div", { className: cn(container), children: _jsx(Events.Replace, { widgets: widgets?.replaces, children: dataSets.map(({ titles, items, renderItem, interaction }, index) => (_jsxs(Shelf.Wrap, { titles: titles, classNames: classNames, children: [items &&
20
20
  sortByOrder(items, orders)?.map((item) => renderItem(item)), interaction] }, id + index))) }) })] }));
21
21
  }
@@ -1,2 +1,2 @@
1
1
  import { BoardProps } from "../../interface/Board";
2
- export declare function Board({ children, widgets, options, debug }: BoardProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function Board({ children, widgets, options, debug, buttons, }: BoardProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cn, isDebug } from "../../util";
3
- import { Events } from "../../layout";
3
+ import { Events, Label } from "../..";
4
4
  const widthSize = {
5
5
  xs: "w-20",
6
6
  sm: "w-24",
@@ -21,7 +21,7 @@ const heightSize = {
21
21
  full: "min-h-screen h-full",
22
22
  auto: "h-auto",
23
23
  };
24
- export function Board({ children, widgets, options, debug }) {
24
+ export function Board({ children, widgets, options, debug, buttons, }) {
25
25
  const { shows } = widgets ?? {};
26
26
  const { width, height, isRounded, classNames } = options ?? {};
27
27
  const container = {
@@ -35,5 +35,12 @@ export function Board({ children, widgets, options, debug }) {
35
35
  styles: "bg-white text-black",
36
36
  rounded: `rounded-none ${isRounded ? "xl:rounded-xl" : ""}`,
37
37
  };
38
- return (_jsx("div", { className: cn(container), children: _jsx("div", { className: cn(body), children: _jsx(Events.Show, { widgets: shows, children: _jsx("div", { className: "h-full " + classNames, children: children }) }) }) }));
38
+ const button = {
39
+ positions: "fixed bottom-20 right-4 xl:absolute xl:-bottom-18.5 xl:right-0",
40
+ };
41
+ return (_jsxs("div", { className: cn(container), children: [_jsx("div", { className: cn(body), children: _jsx(Events.Show, { widgets: shows, children: _jsx("div", { className: "h-full " + classNames, children: children }) }) }), _jsx("div", { className: cn(button), children: buttons?.map(({ title, onClick, options }) => (_jsx(Label.Button, { title: title, onClick: onClick, options: {
42
+ ...options,
43
+ text: "text-white",
44
+ background: "bg-crimson-burgundy",
45
+ } }))) })] }));
39
46
  }
@@ -18,7 +18,7 @@ export default function BoardHeader({ titles, tag, options, }) {
18
18
  };
19
19
  const block = {
20
20
  displays: "xl:hidden block ",
21
- sizes: "w-full h-22",
21
+ sizes: "w-full h-19",
22
22
  };
23
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex items-center gap-2.5", children: [icon && _jsx("img", { src: icon, className: "fill-blue-500" }), _jsx("div", { className: "text-2xl font-bold text-green-dark", children: title })] }), _jsxs("div", { className: "flex items-center ml-auto gap-4", children: [selects?.map(({ width, title, options, state }, index) => (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { children: title }), _jsx(Select, { options: { width }, selectOptions: options, state: state }, title)] }, index))), inputs?.map((prop, index) => (_jsx(Input, { ...prop }, index)))] })] }), _jsx("div", { className: cn(block) })] }));
23
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex items-center gap-2.5", children: [icon && _jsx("img", { src: icon, className: "fill-blue-500" }), _jsx("div", { className: "text-2xl font-pretendard-bold text-green-dark", children: title })] }), _jsxs("div", { className: "flex items-center ml-auto gap-4", children: [selects?.map(({ width, title, options, state }, index) => (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { children: title }), _jsx(Select, { options: { width }, selectOptions: options, state: state }, title)] }, index))), inputs?.map((prop, index) => (_jsx(Input, { ...prop }, index)))] })] }), _jsx("div", { className: cn(block) })] }));
24
24
  }
@@ -8,5 +8,5 @@ export default function ChartCard({ data, xAxis, yAxis, lines, bars, areas, opti
8
8
  width: width ?? "full",
9
9
  height: height ?? "lg",
10
10
  text: "text-xs",
11
- }, children: [_jsx(ResponsiveContainer, { width: "100%", height: "100%", children: _jsxs(ComposedChart, { data: data, children: [_jsx(XAxis, { dataKey: xAxis }), _jsx(YAxis, { dataKey: yAxis }), _jsx(Tooltip, {}), _jsx(Legend, {}), lines?.map((line) => (_jsx(Line, { ...line }, line.dataKey))), bars?.map((bar) => (_jsx(Bar, { ...bar }, bar.dataKey))), areas?.map((area) => (_jsx(Area, { ...area }, area.dataKey))), average && (_jsx(_Fragment, { children: _jsx(ReferenceLine, { x: average.x, stroke: "#ff0000" }) }))] }) }), average && (_jsxs("div", { className: "absolute top-0 left-0 w-full h-full flex justify-center items-center text-3xl text-gray-300 font-bold", children: ["\uD3C9\uADE0: ", average?.score, "\uC810"] }))] }));
11
+ }, children: [_jsx(ResponsiveContainer, { width: "100%", height: "100%", children: _jsxs(ComposedChart, { data: data, children: [_jsx(XAxis, { dataKey: xAxis }), _jsx(YAxis, { dataKey: yAxis }), _jsx(Tooltip, {}), _jsx(Legend, {}), lines?.map((line) => (_jsx(Line, { ...line }, line.dataKey))), bars?.map((bar) => (_jsx(Bar, { ...bar }, bar.dataKey))), areas?.map((area) => (_jsx(Area, { ...area }, area.dataKey))), average && (_jsx(_Fragment, { children: _jsx(ReferenceLine, { x: average.x, stroke: "#ff0000" }) }))] }) }), average && (_jsxs("div", { className: "absolute top-0 left-0 w-full h-full flex justify-center items-center text-3xl text-gray-300 font-pretendard-bold", children: ["\uD3C9\uADE0: ", average?.score, "\uC810"] }))] }));
12
12
  }
@@ -9,8 +9,8 @@ function PersonalInformation({ titles, data, }) {
9
9
  const body = {
10
10
  container: "flex flex-col pt-5.75",
11
11
  belong: "text-crimson-burgundy",
12
- username: "text-gray-dim font-bold",
13
- name: "text-xl font-bold text-crimson-burgundy",
12
+ username: "text-gray-dim font-pretendard-bold",
13
+ name: "text-xl font-pretendard-bold text-crimson-burgundy",
14
14
  subInfo: {
15
15
  displays: "flex flex-col mt-7.5",
16
16
  fonts: "text-xs text-gray-dim",
@@ -40,7 +40,7 @@ function Exam({ titles, data }) {
40
40
  titleBorder: "border-red-crimson",
41
41
  width: "sm",
42
42
  height: "xs",
43
- }, children: _jsxs(_Fragment, { children: [_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex gap-4 font-bold ", children: [manager, " / ", isPublic ? "공개시험" : "비공개시험"] }), _jsxs("div", { children: [_jsxs("div", { className: "text-xs", children: ["\uC811\uC218\uB9C8\uAC10: ", endDate] }), _jsxs("div", { className: "text-xs", children: ["\uC2DC\uD5D8\uC77C: ", examDate] })] })] }), _jsx(Label.Button, { title: status, onClick: () => { }, options: { width: "sm", height: "xs", className: cn(label) } })] }) }));
43
+ }, children: _jsxs(_Fragment, { children: [_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex gap-4 font-pretendard-bold ", children: [manager, " / ", isPublic ? "공개시험" : "비공개시험"] }), _jsxs("div", { children: [_jsxs("div", { className: "text-xs", children: ["\uC811\uC218\uB9C8\uAC10: ", endDate] }), _jsxs("div", { className: "text-xs", children: ["\uC2DC\uD5D8\uC77C: ", examDate] })] })] }), _jsx(Label.Button, { title: status, onClick: () => { }, options: { width: "sm", height: "xs", className: cn(label) } })] }) }));
44
44
  }
45
45
  function ExamDataREG({ titles, data }) {
46
46
  const container = {
@@ -51,7 +51,7 @@ function ExamDataREG({ titles, data }) {
51
51
  const dataBox = {
52
52
  container: "flex justify-between",
53
53
  rightBox: "flex items-end",
54
- score: "text-4xl font-bold leading-none",
54
+ score: "text-4xl font-pretendard-bold leading-none",
55
55
  };
56
56
  const arr = [
57
57
  ["part 1", data && data?.scores[0], "text-crimson-burgundy"],
@@ -71,7 +71,7 @@ function ExamDataREG({ titles, data }) {
71
71
  !data,
72
72
  _jsx(NoData.Sign, { script: "\uC774\uC804 \uAE30\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.", color: "#910023", className: "text-[#910023] mt-12" }),
73
73
  ],
74
- ], children: _jsx("div", { className: cn(container), children: arr.map(([part, score, styles]) => (_jsxs("div", { className: cn(dataBox.container, styles), children: [_jsx("div", { children: part }), _jsxs("div", { className: cn(dataBox.rightBox), children: [_jsx("div", { className: "text-4xl font-bold leading-none", children: score }), _jsx("div", { children: "\uC810" })] })] }))) }) }) }));
74
+ ], children: _jsx("div", { className: cn(container), children: arr.map(([part, score, styles]) => (_jsxs("div", { className: cn(dataBox.container, styles), children: [_jsx("div", { children: part }), _jsxs("div", { className: cn(dataBox.rightBox), children: [_jsx("div", { className: "text-4xl font-pretendard-bold leading-none", children: score }), _jsx("div", { children: "\uC810" })] })] }))) }) }) }));
75
75
  }
76
76
  function ExamDataOLY({ titles, data }) {
77
77
  const container = {
@@ -88,7 +88,7 @@ function ExamDataOLY({ titles, data }) {
88
88
  !data,
89
89
  _jsx(NoData.Sign, { script: "\uC774\uC804 \uAE30\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.", color: "#105652", className: "text-[#105652] mt-12" }),
90
90
  ],
91
- ], children: _jsx("div", { className: cn(container), children: _jsxs("div", { className: cn(body), children: [_jsxs("div", { className: "flex items-end text-green-dark", children: [_jsx("div", { className: "text-4xl font-bold leading-none ", children: data?.score }), _jsx("div", { children: "\uC810" })] }), _jsxs("div", { className: "text-gray-dim", children: [data?.prize, "\uC744 \uC218\uC0C1\uD558\uC600\uC2B5\uB2C8\uB2E4."] })] }) }) }) }));
91
+ ], children: _jsx("div", { className: cn(container), children: _jsxs("div", { className: cn(body), children: [_jsxs("div", { className: "flex items-end text-green-dark", children: [_jsx("div", { className: "text-4xl font-pretendard-bold leading-none ", children: data?.score }), _jsx("div", { children: "\uC810" })] }), _jsxs("div", { className: "text-gray-dim", children: [data?.prize, "\uC744 \uC218\uC0C1\uD558\uC600\uC2B5\uB2C8\uB2E4."] })] }) }) }) }));
92
92
  }
93
93
  function Product({ titles, data }) {
94
94
  const { date, status, receiver, requester } = data;
@@ -133,7 +133,7 @@ function Grade({ titles, data }) {
133
133
  titleBorder: "border-blue-navy",
134
134
  width: "sm",
135
135
  height: "xs",
136
- }, children: _jsxs(_Fragment, { children: [_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex items-center gap-5", children: [_jsx("div", { className: cn(levelBox), children: data.levelString }), _jsx("span", { className: "text-sm", children: "\uD559\uC6D0\uC0DD, 23\uC138" })] }), _jsxs("div", { className: "absolute bottom-0 left-0 flex items-end gap-8 text-blue-navy", children: [_jsxs("div", { className: "w-20 h-12 flex justify-end items-end", children: [_jsx("div", { className: "leading-none text-4xl font-bold", children: data.score }), _jsx("div", { children: "\uC810" })] }), _jsxs("div", { className: "w-14 h-12 flex justify-end items-end", children: [_jsx("div", { className: "leading-none text-4xl font-bold", children: data.grade }), _jsx("div", { children: "\uB4F1\uAE09" })] })] })] }), _jsx(Label.Button, { title: "\uC0C1\uC138\uBCF4\uAE30", onClick: () => { }, options: {
136
+ }, children: _jsxs(_Fragment, { children: [_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex items-center gap-5", children: [_jsx("div", { className: cn(levelBox), children: data.levelString }), _jsx("span", { className: "text-sm", children: "\uD559\uC6D0\uC0DD, 23\uC138" })] }), _jsxs("div", { className: "absolute bottom-0 left-0 flex items-end gap-8 text-blue-navy", children: [_jsxs("div", { className: "w-20 h-12 flex justify-end items-end", children: [_jsx("div", { className: "leading-none text-4xl font-pretendard-bold", children: data.score }), _jsx("div", { children: "\uC810" })] }), _jsxs("div", { className: "w-14 h-12 flex justify-end items-end", children: [_jsx("div", { className: "leading-none text-4xl font-pretendard-bold", children: data.grade }), _jsx("div", { children: "\uB4F1\uAE09" })] })] })] }), _jsx(Label.Button, { title: "\uC0C1\uC138\uBCF4\uAE30", onClick: () => { }, options: {
137
137
  width: "sm",
138
138
  height: "xs",
139
139
  text: "text-white hover:text-blue-navy",
@@ -52,9 +52,5 @@ export default function CardDesign({ header, children, options, debug, }) {
52
52
  overflow: `overflow-${overflow ?? "hidden"}`,
53
53
  classNames,
54
54
  };
55
- return (_jsxs("div", { className: cn(container), children: [header && _jsx(_Fragment, { children: header }), _jsx("div", { onClick: onClick &&
56
- (() => {
57
- setIsOwn(true);
58
- return onClick();
59
- }), className: cn(body), children: children })] }));
55
+ return (_jsxs("div", { className: cn(container), children: [header && _jsx(_Fragment, { children: header }), _jsx("div", { onClick: onClick && onClick, className: cn(body), children: children })] }));
60
56
  }
@@ -12,7 +12,7 @@ export function InfoCardDesign({ titles: { title, subtitle }, debug, options, ch
12
12
  sizes: "w-full h-13.25",
13
13
  styles: `${titleBorder} border-b-2 pb-2.5`,
14
14
  },
15
- titleText: "h-6 font-bold text-xl w-52 truncate",
15
+ titleText: "h-6 font-pretendard-bold text-xl w-52 truncate",
16
16
  subtitleText: "h-7 text-base font-extralight flex items-center",
17
17
  right: {
18
18
  fontColor: `${text ?? "text-black"}`,
@@ -16,7 +16,7 @@ export default function NavCardDesign({ titles, options }) {
16
16
  styles: `${color ?? "text-gray-dim"}`,
17
17
  },
18
18
  title: {
19
- fonts: `${flag ? "text-2xl h-6.75" : "text-xl h-6"} font-bold`,
19
+ fonts: `${flag ? "text-2xl h-6.75" : "text-xl h-6"} font-pretendard-bold`,
20
20
  styles: (!color && titleColor) ?? "text-gray-dim",
21
21
  },
22
22
  subtitle: {
@@ -3,7 +3,7 @@ import { useId } from "react";
3
3
  import { useWidgetStore } from "../../store";
4
4
  import { cn, sortByOrder } from "../../util";
5
5
  import Card from "../widget/Card.design";
6
- import { DataField, Events, NoData, Row } from "../..";
6
+ import { DataField, Events, Row } from "../..";
7
7
  export default function TableCardDesign({ dataSet, dataField, options }) {
8
8
  const { width, height } = options ?? {};
9
9
  const { order } = useWidgetStore();
@@ -19,10 +19,5 @@ export default function TableCardDesign({ dataSet, dataField, options }) {
19
19
  height: height ?? "lg",
20
20
  overflow: "y-scroll",
21
21
  noPadding: true,
22
- }, children: _jsx(Events.Replace, { widgets: [
23
- [
24
- dataSet.items.length === 0,
25
- dataSet.noData ?? _jsx(NoData.Script, { script: "No Data" }),
26
- ],
27
- ], children: sortByOrder(dataSet.items, orders).map((item, index) => (_jsx(Row.Card, { item: item, onClick: () => dataSet.onClick?.(item), dataField: dataField, height: options?.rowHeight, noHover: options?.noHover, noPadding: options?.noRowPadding }, id + index))) }) }));
22
+ }, children: _jsx(Events.Replace, { widgets: dataSet?.replaces, children: sortByOrder(dataSet.items, orders).map((item, index) => (_jsx(Row.Card, { item: item, onClick: () => dataSet.onClick?.(item), dataField: dataField, height: options?.rowHeight, noHover: options?.noHover, noPadding: options?.noRowPadding }, id + index))) }) }));
28
23
  }
package/globals.css CHANGED
@@ -7,6 +7,16 @@
7
7
  src: url("./asset/fonts/Pretendard-Medium.otf") format("opentype");
8
8
  }
9
9
 
10
+ @font-face {
11
+ font-family: "Pretendard-Bold";
12
+ src: url("./asset/fonts/Pretendard-Bold.otf") format("opentype");
13
+ }
14
+
15
+ @font-face {
16
+ font-family: "Pretendard-Light";
17
+ src: url("./asset/fonts/Pretendard-Light.otf") format("opentype");
18
+ }
19
+
10
20
  @font-face {
11
21
  font-family: "Kostar";
12
22
  src: url("./asset/fonts/Kostar.ttf") format("truetype");
@@ -1,6 +1,7 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useId } from "react";
3
3
  import { cn } from "../../util";
4
+ import Obstacle from "./Obstacle";
4
5
  const widthSize = {
5
6
  xs: "w-28",
6
7
  sm: "w-48",
@@ -11,14 +12,20 @@ const widthSize = {
11
12
  full: "w-full",
12
13
  };
13
14
  export default function Input({ state, onKeyDown, placeholder, options, }) {
14
- const { width } = options ?? {};
15
+ const { width, disabled } = options ?? {};
15
16
  const id = useId();
16
17
  const [value, setValue] = state;
17
18
  const container = {
19
+ positions: "relative",
18
20
  width: `${widthSize[width ?? "xs"]} h-8`,
19
- styles: "rounded-md pl-4 pr-4 pt-2 pb-2 bg-slate-200 text-xs",
21
+ displays: "flex items-center",
22
+ };
23
+ const body = {
24
+ styles: "rounded-md bg-slate-200 text-xs",
25
+ sizes: "w-full h-full",
26
+ paddings: "pl-4",
20
27
  pseudo: "focus:outline-none focus:bg-white focus:text-black box-shadow-focus",
21
28
  effect: `transition-all`,
22
29
  };
23
- return (_jsx("input", { className: cn(container), id: id, type: "text", placeholder: placeholder ?? "입력해주세요", onKeyDown: onKeyDown, onChange: (e) => setValue(e.target.value) }));
30
+ 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 })] }));
24
31
  }
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
3
  import { cn } from "../../util";
4
4
  const widthSize = {
5
+ xs: "w-10",
5
6
  sm: "w-22.5",
6
7
  md: "w-45",
7
8
  lg: "w-50",
@@ -25,12 +26,13 @@ export default function LabelDesign({ title, onClick, options, }) {
25
26
  background: background ?? "bg-gray-light",
26
27
  texts: text ?? "text-gray-dim",
27
28
  animation: "duration-500",
29
+ fonts: "font-pretendard-light",
28
30
  styles: height !== "xs" ? "rounded-xl" : "rounded-md text-xs",
29
31
  };
30
32
  const obstacle = {
31
33
  positions: "absolute",
32
34
  sizes: "w-full h-full",
33
- background: "bg-white/80 rounded-xl",
35
+ background: "bg-white/80 ",
34
36
  };
35
37
  return (_jsx("div", { className: className, children: _jsxs("div", { className: cn(container), children: [_jsx("div", { className: cn(body), onClick: onClick, onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), children: title }), disabled && (_jsx("div", { onClick: typeof disabled === "function" ? disabled : undefined, className: cn(obstacle) }))] }) }));
36
38
  }
@@ -0,0 +1,4 @@
1
+ import { Disabled } from "../../interface";
2
+ export default function Obstacle({ disabled }: {
3
+ disabled?: Disabled;
4
+ }): false | import("react/jsx-runtime").JSX.Element | undefined;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "../../util";
3
+ export default function Obstacle({ disabled }) {
4
+ const obstacle = {
5
+ positions: "absolute",
6
+ sizes: "w-full h-full",
7
+ background: "bg-white/80 ",
8
+ };
9
+ return (disabled && (_jsx("div", { onClick: typeof disabled === "function" ? disabled : undefined, className: cn(obstacle) })));
10
+ }
@@ -64,7 +64,7 @@ export default function Select({ state, selectOptions, options, }) {
64
64
  const { width } = options ?? {};
65
65
  const dropdown = {
66
66
  size: `w-40 h-6`,
67
- styles: "cursor-pointer pt-4 pb-4 pl-2 pr-4 font-bold text-xs bg-white",
67
+ styles: "cursor-pointer pt-4 pb-4 pl-2 pr-4 font-pretendard-bold text-xs bg-white",
68
68
  display: `flex items-center`,
69
69
  hover: `hover:rounded-md`,
70
70
  effect: `transition-all`,
@@ -73,7 +73,7 @@ export default function Select({ state, selectOptions, options, }) {
73
73
  };
74
74
  const dropdownInput = {
75
75
  size: `w-40 h-6 `,
76
- styles: "shadow-md text-xs pt-4 pb-4 pl-2 pr-4 font-bold bg-white text-left cursor-text border-1 rounded-md ",
76
+ styles: "shadow-md text-xs pt-4 pb-4 pl-2 pr-4 font-pretendard-bold bg-white text-left cursor-text border-1 rounded-md ",
77
77
  display: "absolute top-12 flex items-center z-10 ",
78
78
  focus: "focus:outline-none focus:border-[#44C5F3] focus:border-1 ",
79
79
  };
@@ -85,7 +85,7 @@ export default function Select({ state, selectOptions, options, }) {
85
85
  };
86
86
  const dropdownItem = {
87
87
  size: `${widthSize[width ?? "full"]} h-6 `,
88
- styles: `text-xs text-left pt-4 pb-4 pl-2 pr-4 font-bold cursor-pointer `,
88
+ styles: `text-xs text-left pt-4 pb-4 pl-2 pr-4 font-pretendard-bold cursor-pointer `,
89
89
  display: `flex items-center z-40`,
90
90
  hover: `hover:bg-slate-200 `,
91
91
  effect: `transition-all `,
@@ -1,4 +1,5 @@
1
- import { Button, DataField, ImageSize, OnClick, Size, Titles } from "./Property";
1
+ import { Button, DataField, Disabled, ImageSize, OnClick, Size, Titles } from "./Property";
2
+ import { Replace } from "./Widget";
2
3
  interface CardOptions {
3
4
  classNames?: string;
4
5
  boundary?: string;
@@ -44,7 +45,7 @@ export interface ChartCardProps extends Omit<CardProps, "children"> {
44
45
  interface ButtonInLay {
45
46
  title: string;
46
47
  onClick: OnClick;
47
- disabled?: boolean | OnClick;
48
+ disabled?: Disabled;
48
49
  width?: Size;
49
50
  height?: Size;
50
51
  background?: string;
@@ -138,7 +139,7 @@ export interface TableCardProps<T> extends Omit<CardProps, "children"> {
138
139
  dataSet: {
139
140
  items: T[];
140
141
  onClick?: OnClick<T>;
141
- noData?: React.ReactNode;
142
+ replaces?: Replace[];
142
143
  };
143
144
  dataField: {
144
145
  [p in keyof T]?: Partial<DataField>;
@@ -1,4 +1,4 @@
1
- import { OnClick, Size, State } from "./Property";
1
+ import { Disabled, OnClick, Size, State } from "./Property";
2
2
  export declare const HTMLElementType: {
3
3
  readonly TEXT: "text";
4
4
  readonly BUTTON: "button";
@@ -14,7 +14,7 @@ export interface HTMLElement {
14
14
  height?: Size;
15
15
  background?: string;
16
16
  text?: string;
17
- disabled?: boolean | OnClick;
17
+ disabled?: Disabled;
18
18
  };
19
19
  }
20
20
  export interface HTMLLabelElement extends HTMLElement {
@@ -1,20 +1,23 @@
1
- import { HTMLElementType } from "./HTMLElement";
2
- import { State, Titles } from "./Property";
1
+ import { HTMLElementType, HTMLLabelElement } from "./HTMLElement";
2
+ import { Disabled, OnClick, State, Titles } from "./Property";
3
3
  export interface OverlayProps {
4
4
  titles: Titles;
5
5
  isVisible?: boolean;
6
6
  event?: string;
7
7
  children?: React.ReactNode;
8
8
  }
9
+ export interface HTMLElementFrame {
10
+ title: string;
11
+ type: HTMLElementType;
12
+ state?: State<string> | State<boolean>;
13
+ selectOptions?: [string | number, string][];
14
+ labels?: [string | boolean, string][];
15
+ disabled?: Disabled;
16
+ onClick?: OnClick;
17
+ }
9
18
  export interface InfoOverlayProps extends OverlayProps {
10
19
  }
11
- export interface ManageOverlayProps extends InfoOverlayProps {
12
- elements?: {
13
- title: string;
14
- state: State<string> | State<boolean>;
15
- type: HTMLElementType;
16
- selectOptions?: [string | number, string][];
17
- labels?: [string | boolean, string][];
18
- isDisabled?: boolean;
19
- }[];
20
+ export interface ManageOverlayProps extends OverlayProps {
21
+ elements?: HTMLElementFrame[];
22
+ buttons?: HTMLLabelElement[];
20
23
  }
@@ -36,6 +36,7 @@ export type Size = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "auto";
36
36
  */
37
37
  export type OnClick<T = unknown> = (prop?: T) => unknown | ((prop?: T) => Promise<unknown>);
38
38
  export type Button = [string, OnClick];
39
+ export type Disabled = boolean | OnClick;
39
40
  export type Scripts = {
40
41
  script: string;
41
42
  subScript?: string;
@@ -1,3 +1,4 @@
1
+ import { HTMLLabelElement } from "./HTMLElement";
1
2
  import { DataField, OnClick } from "./Property";
2
3
  export interface WidgetEvent {
3
4
  event: string;
@@ -32,11 +33,12 @@ export interface DataFieldProps<T> {
32
33
  };
33
34
  }
34
35
  export interface RowProps<T> {
35
- onClick?: OnClick<T>;
36
36
  item: T;
37
37
  dataField?: {
38
38
  [p in keyof T]?: Partial<DataField>;
39
39
  };
40
+ onClick?: OnClick<T>;
41
+ buttons?: HTMLLabelElement[];
40
42
  options?: {
41
43
  height?: string;
42
44
  size?: string;
@@ -1,6 +1,6 @@
1
1
  import { RowProps } from "../../interface";
2
- declare function Board<T extends Record<string, any>>({ item, dataField, onClick, }: RowProps<T>): import("react/jsx-runtime").JSX.Element;
3
- declare function Card<T extends Record<string, any>>({ item, dataField, onClick, height, noPadding, noHover, }: Omit<RowProps<T>, "options"> & {
2
+ declare function Board<T extends Record<string, any>>({ item, dataField, onClick, buttons, }: RowProps<T>): import("react/jsx-runtime").JSX.Element;
3
+ declare function Card<T extends Record<string, any>>({ item, dataField, onClick, buttons, height, noPadding, noHover, }: Omit<RowProps<T>, "options"> & {
4
4
  height?: string;
5
5
  noPadding?: boolean;
6
6
  noHover?: boolean;
@@ -1,17 +1,17 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useId } from "react";
3
3
  import RowDesign from "../widget/Row.design";
4
- function Board({ item, dataField, onClick, }) {
4
+ function Board({ item, dataField, onClick, buttons, }) {
5
5
  const id = useId();
6
- return (_jsx(RowDesign, { onClick: onClick, item: item, dataField: dataField, options: {
6
+ return (_jsx(RowDesign, { onClick: onClick, item: item, dataField: dataField, buttons: buttons, options: {
7
7
  size: "w-full h-12",
8
8
  padding: "px-2 xs:px-4 xl:px-7.5",
9
9
  text: "text-xl",
10
10
  } }, id));
11
11
  }
12
- function Card({ item, dataField, onClick, height, noPadding, noHover, }) {
12
+ function Card({ item, dataField, onClick, buttons, height, noPadding, noHover, }) {
13
13
  const id = useId();
14
- return (_jsx(RowDesign, { onClick: onClick, item: item, dataField: dataField, options: {
14
+ return (_jsx(RowDesign, { onClick: onClick, item: item, dataField: dataField, buttons: buttons, options: {
15
15
  size: `w-full ${height ?? "h-12"}`,
16
16
  padding: !noPadding ? "px-2 xs:px-4 xl:px-7.5" : "",
17
17
  text: "text-base",
@@ -7,5 +7,5 @@ export default function Header({ groupName, examName, }) {
7
7
  sizes: "w-full max-w-280",
8
8
  styles: "py-8 bg-white shadow-md",
9
9
  };
10
- return (_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex justify-between w-full items-center px-2", children: [_jsx("img", { src: "/images/logos/itc.png", alt: "itc", width: 80 }), _jsx("div", { className: "flex items-center", children: _jsx("div", { className: "text-5xl font-bold", children: examName }) }), _jsx("img", { src: "/images/logos/badge-tosel-lab.png", alt: "tosel-lab", width: 80 })] }), _jsxs("div", { className: "", children: ["\uC9C0\uC815\uAD50\uC721\uAE30\uAD00: ", groupName] })] }));
10
+ return (_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex justify-between w-full items-center px-2", children: [_jsx("img", { src: "/images/logos/itc.png", alt: "itc", width: 80 }), _jsx("div", { className: "flex items-center", children: _jsx("div", { className: "text-5xl font-pretendard-bold", children: examName }) }), _jsx("img", { src: "/images/logos/badge-tosel-lab.png", alt: "tosel-lab", width: 80 })] }), _jsxs("div", { className: "", children: ["\uC9C0\uC815\uAD50\uC721\uAE30\uAD00: ", groupName] })] }));
11
11
  }
@@ -10,7 +10,7 @@ export default function DataFieldDesign({ id, dataField, options, }) {
10
10
  displays: "flex items-center",
11
11
  sizes: "w-full h-13.75",
12
12
  paddings: padding && padding,
13
- styles: "bg-white box-shadow-sm font-bold",
13
+ styles: "bg-white box-shadow-sm font-pretendard-bold",
14
14
  };
15
15
  const block = {
16
16
  displays: "xl:hidden block ",
@@ -20,9 +20,9 @@ export default function DataFieldDesign({ id, dataField, options, }) {
20
20
  Object.keys(dataField).map((key) => (_jsx("div", { className: `w-${dataField[key]?.size}/100`, 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 }) => {
21
21
  if (orderBy === key) {
22
22
  if (orderHow === "asc")
23
- return (_jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M7.15859 15.0437C6.7079 15.9134 7.27152 17 8.17239 17H15.8279C16.7282 17 17.2919 15.9134 16.8417 15.0437L13.0145 7.65229C12.5638 6.78257 11.4365 6.78257 10.9858 7.65229L7.15859 15.0437Z", fill: "#105652" }) }));
23
+ return (_jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M7.15859 15.0437C6.7079 15.9134 7.27152 17 8.17239 17H15.8279C16.7282 17 17.2919 15.9134 16.8417 15.0437L13.0145 7.65229C12.5638 6.78257 11.4365 6.78257 10.9858 7.65229L7.15859 15.0437Z", fill: "#105652" }) }, id + key + "asc"));
24
24
  else if (orderHow === "desc")
25
- return (_jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M16.8414 8.95628C17.2921 8.08657 16.7285 7 15.8276 7L8.1721 7C7.27176 7 6.70813 8.08657 7.15831 8.95628L10.9855 16.3477C11.4362 17.2174 12.5635 17.2174 13.0142 16.3477L16.8414 8.95628Z", fill: "#105652" }) }));
25
+ return (_jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M16.8414 8.95628C17.2921 8.08657 16.7285 7 15.8276 7L8.1721 7C7.27176 7 6.70813 8.08657 7.15831 8.95628L10.9855 16.3477C11.4362 17.2174 12.5635 17.2174 13.0142 16.3477L16.8414 8.95628Z", fill: "#105652" }) }, id + key + "asc"));
26
26
  else
27
27
  return "";
28
28
  }
@@ -1,2 +1,2 @@
1
1
  import { RowProps } from "../../interface";
2
- export default function RowDesign<T extends Record<string, any>>({ item, dataField, options, onClick, }: RowProps<T>): import("react/jsx-runtime").JSX.Element;
2
+ export default function RowDesign<T extends Record<string, any>>({ item, dataField, options, onClick, buttons, }: RowProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -1,16 +1,23 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useId } from "react";
3
3
  import { cn } from "../../util";
4
- export default function RowDesign({ item, dataField, options, onClick, }) {
4
+ import { Label } from "../../html";
5
+ export default function RowDesign({ item, dataField, options, onClick, buttons, }) {
5
6
  const { size, padding, text, noHover } = options ?? {};
6
7
  const id = useId();
7
8
  const container = {
9
+ positions: "relative",
8
10
  displays: "flex items-center ",
9
11
  sizes: size,
10
12
  paddings: padding,
11
13
  text: text,
12
14
  styles: !noHover && "hover:bg-gray-100 duration-100",
13
15
  };
14
- return (_jsx("div", { className: cn(container), onClick: () => onClick?.(), children: dataField &&
15
- Object.keys(dataField).map((key) => (_jsx("div", { className: `w-${dataField[key]?.size}/100 truncate`, children: item[key] }, id + key))) }));
16
+ return (_jsxs("div", { className: cn(container), onClick: () => onClick?.(), children: [dataField &&
17
+ Object.keys(dataField).map((key) => (_jsx("div", { className: `w-${dataField[key]?.size}/100 truncate`, children: item[key] }, id + key))), _jsx("div", { className: "absolute right-4 xl:right-8 flex gap-4", children: buttons?.map(({ title, onClick, options }) => (_jsx(Label.Button, { title: title, onClick: onClick, options: {
18
+ background: options?.background ?? "bg-crimson-dark",
19
+ text: options?.text ?? "text-white",
20
+ width: "xs",
21
+ height: "xs",
22
+ } }, id + title))) })] }));
16
23
  }
@@ -11,7 +11,7 @@ export default function Shelf({ children, classNames, options, titles, debug, })
11
11
  container: "flex flex-col text-gray-dim",
12
12
  title: {
13
13
  text: titleSize ?? "text-xl xl:text-3xl",
14
- font: "font-bold",
14
+ font: "font-pretendard-bold",
15
15
  },
16
16
  subtitle: {
17
17
  text: subtitleSize ?? "text-base xl:text-lg",
@@ -16,7 +16,7 @@ export function Header({ title, logo, options }) {
16
16
  styles: "px-5 xl:px-8 2xl:px-16 ",
17
17
  className,
18
18
  };
19
- return (_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex h-12 items-center gap-8 xl:gap-24 2xl:gap-26", children: [logo ? (_jsx("a", { href: logo.href, children: _jsx("img", { src: logo.image, alt: "logo", className: "h-6.25 w-28.78" }) })) : (_jsx("div", { className: "text-2xl", children: "TOSEL" })), _jsx("div", { className: "text-3xl font-bold", children: title })] }), _jsx("div", { className: "relative flex gap-5.25", children: _jsxs(Events.Show, { widgets: [["menu", _jsx(Menu, { image: "/images/hani.png" })]], children: [_jsx("svg", { className: "cursor-pointer", xmlns: "http://www.w3.org/2000/svg", width: "25", height: "25", viewBox: "0 0 25 25", fill: "none", children: _jsx("path", { d: "M15.4759 17.7938C17.4168 17.564 19.3237 17.1059 21.1572 16.4292C19.6044 14.7092 18.7465 12.4734 18.7499 10.1562V9.375C18.7499 7.7174 18.0914 6.12769 16.9193 4.95558C15.7472 3.78348 14.1575 3.125 12.4999 3.125C10.8423 3.125 9.25257 3.78348 8.08047 4.95558C6.90837 6.12769 6.24989 7.7174 6.24989 9.375V10.1562C6.25303 12.4736 5.39466 14.7093 3.84155 16.4292C5.64676 17.0958 7.54989 17.5594 9.52384 17.7938M15.4759 17.7938C13.4988 18.0283 11.5009 18.0283 9.52384 17.7938M15.4759 17.7938C15.626 18.2624 15.6634 18.7598 15.5849 19.2455C15.5064 19.7313 15.3143 20.1917 15.0242 20.5891C14.7342 20.9866 14.3544 21.31 13.9157 21.5329C13.4771 21.7559 12.9919 21.8721 12.4999 21.8721C12.0078 21.8721 11.5227 21.7559 11.0841 21.5329C10.6454 21.31 10.2656 20.9866 9.97553 20.5891C9.68548 20.1917 9.49339 19.7313 9.4149 19.2455C9.33641 18.7598 9.37374 18.2624 9.52384 17.7938", stroke: "#910023", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }), _jsx("svg", { className: "cursor-pointer", onClick: () => {
19
+ return (_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex h-12 items-center gap-8 xl:gap-24 2xl:gap-26", children: [logo ? (_jsx("a", { href: logo.href, children: _jsx("img", { src: logo.image, alt: "logo", className: "h-6.25 w-28.78" }) })) : (_jsx("div", { className: "text-2xl", children: "TOSEL" })), _jsx("div", { className: "text-3xl font-pretendard-bold", children: title })] }), _jsx("div", { className: "relative flex gap-5.25", children: _jsxs(Events.Show, { widgets: [["menu", _jsx(Menu, { image: "/images/hani.png" })]], children: [_jsx("svg", { className: "cursor-pointer", xmlns: "http://www.w3.org/2000/svg", width: "25", height: "25", viewBox: "0 0 25 25", fill: "none", children: _jsx("path", { d: "M15.4759 17.7938C17.4168 17.564 19.3237 17.1059 21.1572 16.4292C19.6044 14.7092 18.7465 12.4734 18.7499 10.1562V9.375C18.7499 7.7174 18.0914 6.12769 16.9193 4.95558C15.7472 3.78348 14.1575 3.125 12.4999 3.125C10.8423 3.125 9.25257 3.78348 8.08047 4.95558C6.90837 6.12769 6.24989 7.7174 6.24989 9.375V10.1562C6.25303 12.4736 5.39466 14.7093 3.84155 16.4292C5.64676 17.0958 7.54989 17.5594 9.52384 17.7938M15.4759 17.7938C13.4988 18.0283 11.5009 18.0283 9.52384 17.7938M15.4759 17.7938C15.626 18.2624 15.6634 18.7598 15.5849 19.2455C15.5064 19.7313 15.3143 20.1917 15.0242 20.5891C14.7342 20.9866 14.3544 21.31 13.9157 21.5329C13.4771 21.7559 12.9919 21.8721 12.4999 21.8721C12.0078 21.8721 11.5227 21.7559 11.0841 21.5329C10.6454 21.31 10.2656 20.9866 9.97553 20.5891C9.68548 20.1917 9.49339 19.7313 9.4149 19.2455C9.33641 18.7598 9.37374 18.2624 9.52384 17.7938", stroke: "#910023", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }), _jsx("svg", { className: "cursor-pointer", onClick: () => {
20
20
  setIsOwn(true);
21
21
  return setView("menu");
22
22
  }, xmlns: "http://www.w3.org/2000/svg", width: "25", height: "25", viewBox: "0 0 25 25", fill: "none", children: _jsx("path", { d: "M18.7313 19.5053C18.0034 18.5416 17.0618 17.7601 15.9804 17.2223C14.8991 16.6846 13.7077 16.4052 12.5 16.4063C11.2924 16.4052 10.101 16.6846 9.01964 17.2223C7.93832 17.7601 6.99664 18.5416 6.26878 19.5053M18.7313 19.5053C20.1516 18.2419 21.1533 16.5767 21.6054 14.7304C22.0576 12.884 21.9378 10.9439 21.262 9.16722C20.5862 7.39055 19.3862 5.86128 17.8213 4.78224C16.2564 3.7032 14.4004 3.12537 12.4995 3.12537C10.5986 3.12537 8.74267 3.7032 7.17775 4.78224C5.61282 5.86128 4.41288 7.39055 3.73705 9.16722C3.06122 10.9439 2.94144 12.884 3.3936 14.7304C3.84575 16.5767 4.84847 18.2419 6.26878 19.5053M18.7313 19.5053C17.0167 21.0346 14.7976 21.8783 12.5 21.8751C10.2021 21.8786 7.98361 21.0349 6.26878 19.5053M15.625 10.1563C15.625 10.9851 15.2958 11.78 14.7097 12.366C14.1237 12.9521 13.3288 13.2813 12.5 13.2813C11.6712 13.2813 10.8764 12.9521 10.2903 12.366C9.70427 11.78 9.37503 10.9851 9.37503 10.1563C9.37503 9.32751 9.70427 8.53265 10.2903 7.9466C10.8764 7.36055 11.6712 7.03131 12.5 7.03131C13.3288 7.03131 14.1237 7.36055 14.7097 7.9466C15.2958 8.53265 15.625 9.32751 15.625 10.1563Z", stroke: "#910023", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })] }) })] }));
@@ -3,5 +3,5 @@ import ModalDesign from "../widget/Modal.design";
3
3
  export default function Alert({ isVisible, title, scripts, options, }) {
4
4
  const { script, subScript } = scripts ?? {};
5
5
  const { buttons } = options ?? {};
6
- return (_jsx(ModalDesign, { isVisible: isVisible, classNames: "pt-18 px-25", options: { buttons, isCloseButton: true }, children: _jsx("div", { className: "flex flex-col gap-3", children: _jsxs("div", { className: "flex flex-col gap-6", children: [_jsx("div", { className: "text-3xl font-bold", children: title }), _jsx("div", { className: "h-2 w-14 rounded-full bg-pale-lavender" }), _jsx("div", { className: "text-xl font-bold", children: script })] }) }) }));
6
+ return (_jsx(ModalDesign, { isVisible: isVisible, classNames: "pt-18 px-25", options: { buttons, isCloseButton: true }, children: _jsx("div", { className: "flex flex-col gap-3", children: _jsxs("div", { className: "flex flex-col gap-6", children: [_jsx("div", { className: "text-3xl font-pretendard-bold", children: title }), _jsx("div", { className: "h-2 w-14 rounded-full bg-pale-lavender" }), _jsx("div", { className: "text-xl font-pretendard-bold", children: script })] }) }) }));
7
7
  }
@@ -2,5 +2,5 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import ModalDesign from "../widget/Modal.design";
3
3
  export default function Input({ isVisible, event, title, options, state, }) {
4
4
  const { buttons } = options ?? {};
5
- return (_jsxs(ModalDesign, { isVisible: isVisible, event: event, classNames: "pt-18 px-25", options: { buttons, isCloseButton: true }, children: [_jsx("div", { className: "text-xl font-bold", children: title }), _jsx("input", { className: "border-2 border-black w-80 h-8", value: state[0], onChange: (e) => state[1](e.target.value) })] }));
5
+ return (_jsxs(ModalDesign, { isVisible: isVisible, event: event, classNames: "pt-18 px-25", options: { buttons, isCloseButton: true }, children: [_jsx("div", { className: "text-xl font-pretendard-bold", children: title }), _jsx("input", { className: "border-2 border-black w-80 h-8", value: state[0], onChange: (e) => state[1](e.target.value) })] }));
6
6
  }
@@ -49,7 +49,7 @@ export default function ModalDesign({ isVisible, event, children, options, debug
49
49
  },
50
50
  body: {
51
51
  paddings: "px-8 py-2 ",
52
- styles: "rounded-2xl bg-black text-2xl font-bold text-white",
52
+ styles: "rounded-2xl bg-black text-2xl font-pretendard-bold text-white",
53
53
  },
54
54
  };
55
55
  const closeButton = {
@@ -8,7 +8,7 @@ export const buttonClassNames = (href, nowPath, color) => {
8
8
  const container = {
9
9
  displays: "flex flex-row items-center justify-center xl:justify-start gap-2.5",
10
10
  sizes: " w-full xl:w-51 h-11 ",
11
- styles: "xl:rounded-lg xl:pl-5 font-bold ",
11
+ styles: "xl:rounded-lg xl:pl-5 font-pretendard-bold",
12
12
  };
13
13
  const toggle = checkPathMatch(href, nowPath)
14
14
  ? !isDark
@@ -1,2 +1,2 @@
1
1
  import { ManageOverlayProps } from "../../interface";
2
- export default function Manage({ titles, isVisible, event, elements, }: ManageOverlayProps): import("react/jsx-runtime").JSX.Element;
2
+ export default function Manage({ titles, isVisible, event, elements, buttons, }: ManageOverlayProps): import("react/jsx-runtime").JSX.Element;
@@ -1,17 +1,31 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Select, Toggle } from "../..";
2
+ import { Input, Label, Select, Toggle } from "../..";
3
3
  import OverlayDesign from "../widget/Overlay.design";
4
+ import Frame from "../widget/Frame.design";
4
5
  import { useId } from "react";
5
- export default function Manage({ titles, isVisible, event, elements, }) {
6
+ import { cn } from "../../util";
7
+ export default function Manage({ titles, isVisible, event, elements, buttons, }) {
6
8
  const id = useId();
7
- return (_jsx(OverlayDesign, { titles: titles, event: event, isVisible: isVisible, children: elements?.map(({ title, type, labels, state, isDisabled, selectOptions }) => {
8
- if (type === "select")
9
- return (_jsx(Frame, { title: title, children: _jsx(Select, { state: state, selectOptions: selectOptions }) }, id + title));
10
- if (type === "toggle")
11
- return (_jsx(Frame, { title: title, children: _jsx(Toggle, { state: state, labels: labels, options: { disabled: isDisabled } }) }, id + title));
12
- return null;
13
- }) }));
14
- }
15
- function Frame({ title, children, }) {
16
- return (_jsxs("div", { className: "flex items-center gap-3.75", children: [_jsx("div", { className: "w-20 text-sm font-bold text-gray-dim", children: title }), children] }));
9
+ const body = {
10
+ sizes: "w-full xl:h-120 ",
11
+ styles: "overflow-y-scroll",
12
+ };
13
+ return (_jsxs(OverlayDesign, { titles: titles, event: event, isVisible: isVisible, children: [_jsx("div", { className: cn(body), children: elements?.map(({ title, type, labels, state, selectOptions, disabled }) => {
14
+ if (type === "select")
15
+ return (_jsx(Frame, { title: title, children: _jsx(Select, { state: state, selectOptions: selectOptions }) }, id + title));
16
+ if (type === "toggle")
17
+ return (_jsx(Frame, { title: title, children: _jsx(Toggle, { state: state, labels: labels, options: { disabled } }) }, id + title));
18
+ if (type === "input")
19
+ return (_jsx(Frame, { title: title, children: _jsx(Input, { state: state, options: {
20
+ width: "md",
21
+ disabled,
22
+ } }) }, id + title));
23
+ return null;
24
+ }) }), _jsx("div", { className: "absolute bottom-12 right-12 flex gap-4", children: buttons?.map(({ title, onClick, options }) => (_jsx(Label.Button, { title: title, onClick: onClick, options: {
25
+ width: "sm",
26
+ height: "xs",
27
+ background: options?.background ?? "bg-crimson-dark",
28
+ text: options?.text ?? "text-white",
29
+ disabled: !onClick ? true : false,
30
+ } }, id + title))) })] }));
17
31
  }
@@ -0,0 +1,4 @@
1
+ export default function Frame({ title, children, }: {
2
+ title: string;
3
+ children: React.ReactNode;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export default function Frame({ title, children, }) {
3
+ return (_jsxs("div", { className: "flex items-center gap-3.75 h-9 ", children: [_jsx("div", { className: "w-20 text-sm font-pretendard-bold text-gray-dim", children: title }), children] }));
4
+ }
@@ -7,19 +7,25 @@ export default function OverlayDesign({ titles, children, event, isVisible, }) {
7
7
  const { title } = titles;
8
8
  const container = {
9
9
  positions: "absolute top-0 right-0 z-30",
10
- sizes: "h-full h",
10
+ sizes: "h-full",
11
11
  styles: "box-shadow-sm bg-white",
12
12
  };
13
13
  const body = {
14
14
  positions: "relative",
15
+ sizes: "h-full",
15
16
  paddings: "pt-12 pl-12",
16
17
  displays: "flex flex-col gap-3.5",
17
18
  };
19
+ const button = {
20
+ positions: "absolute top-2 left-2",
21
+ displays: "flex justify-center items-center ",
22
+ sizes: "w-7 h-7",
23
+ };
18
24
  const transitions = useTransition(isVisible, {
19
- from: { width: "0%" },
20
- enter: { width: "80%", maxWidth: "540px" },
21
- leave: { width: "0%" },
25
+ from: { width: "10%", opacity: 0 },
26
+ enter: { width: "80%", maxWidth: "540px", opacity: 1 },
27
+ leave: { width: "10%", opacity: 0 },
22
28
  config: { duration: 300 },
23
29
  });
24
- return transitions((styles, item) => item && (_jsxs(animated.div, { style: styles, className: cn(container), onClick: () => setIsOwn(true), children: [_jsxs("div", { className: cn(body), children: [_jsx("div", { className: "font-bold text-2xl", children: title }), _jsx("div", { className: "flex flex-col gap-3", children: children })] }), event && (_jsx("button", { className: "absolute top-3 left-3 bg-black w-6 h-6", onClick: () => removeView(event) }))] })));
30
+ return transitions((styles, item) => item && (_jsxs(animated.div, { style: styles, className: cn(container), onClick: () => setIsOwn(true), children: [_jsxs("div", { className: cn(body), children: [_jsx("div", { className: "font-pretendard-bold text-2xl", children: title }), _jsx("div", { className: "flex flex-col gap-3", children: children })] }), event && (_jsx("button", { onClick: () => removeView(event), className: cn(button), children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: _jsx("path", { d: "M6.28003 5.22C6.13786 5.08752 5.94981 5.0154 5.75551 5.01882C5.56121 5.02225 5.37582 5.10096 5.23841 5.23838C5.101 5.37579 5.02228 5.56118 5.01886 5.75548C5.01543 5.94978 5.08755 6.13782 5.22003 6.28L8.94003 10L5.22003 13.72C5.14634 13.7887 5.08724 13.8715 5.04625 13.9635C5.00526 14.0555 4.98322 14.1548 4.98144 14.2555C4.97966 14.3562 4.99819 14.4562 5.03591 14.5496C5.07363 14.643 5.12977 14.7278 5.20099 14.799C5.27221 14.8703 5.35705 14.9264 5.45043 14.9641C5.54382 15.0018 5.64385 15.0204 5.74455 15.0186C5.84526 15.0168 5.94457 14.9948 6.03657 14.9538C6.12857 14.9128 6.21137 14.8537 6.28003 14.78L10 11.06L13.72 14.78C13.7887 14.8537 13.8715 14.9128 13.9635 14.9538C14.0555 14.9948 14.1548 15.0168 14.2555 15.0186C14.3562 15.0204 14.4562 15.0018 14.5496 14.9641C14.643 14.9264 14.7279 14.8703 14.7991 14.799C14.8703 14.7278 14.9264 14.643 14.9642 14.5496C15.0019 14.4562 15.0204 14.3562 15.0186 14.2555C15.0168 14.1548 14.9948 14.0555 14.9538 13.9635C14.9128 13.8715 14.8537 13.7887 14.78 13.72L11.06 10L14.78 6.28C14.9125 6.13782 14.9846 5.94978 14.9812 5.75548C14.9778 5.56118 14.8991 5.37579 14.7617 5.23838C14.6242 5.10096 14.4389 5.02225 14.2446 5.01882C14.0503 5.0154 13.8622 5.08752 13.72 5.22L10 8.94L6.28003 5.22Z", fill: "#7F7F7F" }) }) }))] })));
25
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
package/store/index.js CHANGED
@@ -2,6 +2,7 @@ import { create } from "zustand";
2
2
  export const useWidgetStore = create((set) => ({
3
3
  events: [],
4
4
  setView: (prop) => set((state) => {
5
+ state.setIsOwn(true);
5
6
  if (state.events.find(({ event }) => event === prop) !== undefined)
6
7
  return state;
7
8
  return {
@@ -14,6 +14,8 @@ export default {
14
14
  extend: {
15
15
  fontFamily: {
16
16
  "pretendard-medium": ["pretendard-medium"],
17
+ "pretendard-bold": ["pretendard-bold"],
18
+ "pretendard-light": ["pretendard-light"],
17
19
  kostar: ["kostar"],
18
20
  nicomoji: ["nicomoji"],
19
21
  megrim: ["megrim"],
@@ -150,6 +152,7 @@ export default {
150
152
  52: "13rem",
151
153
  52.5: "13.125rem",
152
154
  54: "13.5rem",
155
+ 55: "13.75rem",
153
156
  56: "14rem",
154
157
  62: "15.5rem",
155
158
  64: "16rem",
package/util/pattern.js CHANGED
@@ -8,7 +8,7 @@ export const buttonStyle = {
8
8
  `w-${width}`,
9
9
  `bg-${bgColor} ${bgHoverColor ? `hover:bg-${bgHoverColor}` : ""}`,
10
10
  `text-${textColor} ${textHoverColor ? `hover:text-${textHoverColor}` : ""}`,
11
- "font-bold py-2 px-4 rounded",
11
+ "font-pretendard-bold py-2 px-4 rounded",
12
12
  ];
13
13
  return classNames.join(" ");
14
14
  },
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.22
1
+ 1.0.24