@edu-tosel/design 1.0.19 → 1.0.21

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 (71) hide show
  1. package/board/template/CanvasBoard.d.ts +2 -2
  2. package/board/template/CanvasBoard.js +9 -4
  3. package/board/template/ManageBoard.d.ts +1 -1
  4. package/board/template/ManageBoard.js +1 -2
  5. package/board/widget/Header.d.ts +1 -1
  6. package/board/widget/Header.js +3 -3
  7. package/card/index.d.ts +0 -1
  8. package/card/index.js +0 -1
  9. package/card/template/AddCard.js +1 -1
  10. package/card/template/ChartCard.js +1 -1
  11. package/card/template/InfoCard.d.ts +11 -16
  12. package/card/template/InfoCard.js +82 -7
  13. package/card/template/NavCard.js +1 -1
  14. package/card/template/TableCard.d.ts +6 -2
  15. package/card/template/TableCard.js +18 -20
  16. package/card/widget/Card.design.d.ts +1 -1
  17. package/card/widget/Card.design.js +3 -3
  18. package/card/widget/InfoCard.design.js +1 -1
  19. package/card/widget/NavCard.design.d.ts +1 -1
  20. package/card/widget/NavCard.design.js +13 -7
  21. package/card/widget/TableCard.design.d.ts +4 -0
  22. package/card/widget/TableCard.design.js +28 -0
  23. package/globals.css +3 -0
  24. package/hook/index.d.ts +2 -0
  25. package/hook/index.js +2 -0
  26. package/hook/useEase.d.ts +1 -0
  27. package/hook/useEase.js +11 -0
  28. package/hook/useEvents.d.ts +3 -0
  29. package/{util/hooks.js → hook/useEvents.js} +1 -11
  30. package/html/template/Label.d.ts +2 -4
  31. package/html/template/Label.js +1 -1
  32. package/html/widget/Input.d.ts +1 -1
  33. package/html/widget/Input.js +3 -3
  34. package/interaction/template/NoData.d.ts +9 -1
  35. package/interaction/template/NoData.js +7 -2
  36. package/interaction/widget/Script.design.d.ts +1 -1
  37. package/interaction/widget/Script.design.js +7 -1
  38. package/interaction/widget/Sign.design.d.ts +5 -0
  39. package/interaction/widget/Sign.design.js +10 -0
  40. package/interface/Board.d.ts +16 -21
  41. package/interface/Card.d.ts +51 -3
  42. package/interface/HTMLElement.d.ts +1 -0
  43. package/interface/Property.d.ts +3 -1
  44. package/interface/Widget.d.ts +4 -2
  45. package/layout/index.d.ts +1 -1
  46. package/layout/index.js +1 -1
  47. package/layout/template/Dashboard.d.ts +5 -0
  48. package/layout/template/Dashboard.js +5 -0
  49. package/layout/template/Row.d.ts +6 -2
  50. package/layout/template/Row.js +7 -6
  51. package/layout/widget/Row.design.d.ts +1 -1
  52. package/layout/widget/Row.design.js +5 -5
  53. package/layout/widget/dashboard/Header.js +23 -0
  54. package/layout/widget/dashboard/Layout.d.ts +2 -0
  55. package/layout/{template/dashboard/index.js → widget/dashboard/Layout.js} +1 -5
  56. package/layout/widget/dashboard/Menu.d.ts +4 -0
  57. package/layout/widget/dashboard/Menu.js +20 -0
  58. package/modal/widget/Modal.design.d.ts +1 -1
  59. package/modal/widget/Modal.design.js +7 -1
  60. package/navigation/Navigation.js +1 -1
  61. package/package.json +1 -1
  62. package/tailwind.config.ts +6 -0
  63. package/util/colors.d.ts +8 -0
  64. package/util/colors.js +5 -0
  65. package/util/index.d.ts +1 -2
  66. package/util/index.js +1 -2
  67. package/version.txt +1 -1
  68. package/layout/template/dashboard/Header.js +0 -19
  69. package/layout/template/dashboard/index.d.ts +0 -6
  70. package/util/hooks.d.ts +0 -4
  71. /package/layout/{template → widget}/dashboard/Header.d.ts +0 -0
@@ -1,2 +1,2 @@
1
- import { BoardProps } from "../../interface/Board";
2
- export default function CanvasBoard({ children, options, widgets, }: BoardProps): import("react/jsx-runtime").JSX.Element;
1
+ import { CanvasBoardProps } from "../../interface/Board";
2
+ export default function CanvasBoard({ header, children, options, widgets, buttons, }: CanvasBoardProps): import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,16 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Events } from "../..";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Events, Label } from "../..";
3
3
  import { cn } from "../../util";
4
4
  import { Board } from "../widget/Board.design";
5
- export default function CanvasBoard({ children, options, widgets, }) {
5
+ import BoardHeader from "../widget/Header";
6
+ export default function CanvasBoard({ header, children, options, widgets, buttons, }) {
6
7
  const layouts = "flex flex-col lg:flex-row lg:flex-wrap gap-7.5 ";
7
8
  const sizes = "h-full ";
8
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";
9
10
  const styles = "overflow-y-scroll ";
10
- return (_jsx(Board, { widgets: widgets, options: { ...options, isRounded: true }, children: _jsx(Events.Replace, { widgets: widgets?.replaces, children: _jsx("div", { className: cn(layouts, sizes, paddings, styles), children: children }) }) }));
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
+ } }))) })] }));
11
16
  }
@@ -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, data, widgets, options }: ManageBoardProps<T>): import("react/jsx-runtime").JSX.Element;
4
+ }>({ header, dataSets, dataField, widgets, options }: ManageBoardProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -5,9 +5,8 @@ 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, data, widgets, options }) {
8
+ export default function ManageBoard({ header, dataSets, dataField, widgets, options }) {
9
9
  const { classNames, noPadding } = options ?? {};
10
- const { dataSets, dataField } = data;
11
10
  const { order } = useWidgetStore();
12
11
  const id = useId();
13
12
  const orders = order[id] ?? [];
@@ -1,2 +1,2 @@
1
1
  import { BoardHeaderProps } from "./../../interface/Board";
2
- export default function BoardHeader({ titles, tags, options, }: BoardHeaderProps): import("react/jsx-runtime").JSX.Element;
2
+ export default function BoardHeader({ titles, tag, options, }: BoardHeaderProps): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,9 @@
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 { Input, Select } from "../../html";
4
- export default function BoardHeader({ titles, tags, options, }) {
4
+ export default function BoardHeader({ titles, tag, options, }) {
5
5
  const { title, icon } = titles ?? {};
6
- const { selects, inputs } = tags ?? {};
6
+ const { selects, inputs } = tag ?? {};
7
7
  const { colors } = options ?? {};
8
8
  const { bgColor, textColor } = colors ?? {
9
9
  bgColor: "white",
@@ -20,5 +20,5 @@ export default function BoardHeader({ titles, tags, options, }) {
20
20
  displays: "xl:hidden block ",
21
21
  sizes: "w-full h-22",
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(({ width, title, placeholder, state }, index) => (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { children: title }), _jsx(Input, { placeholder: placeholder, state: state, options: { width } })] }, 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-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
  }
package/card/index.d.ts CHANGED
@@ -3,4 +3,3 @@ export { default as ChartCard } from "./template/ChartCard";
3
3
  export { default as InfoCard } from "./template/InfoCard";
4
4
  export { default as NavCard } from "./template/NavCard";
5
5
  export { default as TableCard } from "./template/TableCard";
6
- export { default as TrumpCard } from "./widget/NavCard.design";
package/card/index.js CHANGED
@@ -3,4 +3,3 @@ export { default as ChartCard } from "./template/ChartCard";
3
3
  export { default as InfoCard } from "./template/InfoCard";
4
4
  export { default as NavCard } from "./template/NavCard";
5
5
  export { default as TableCard } from "./template/TableCard";
6
- export { default as TrumpCard } from "./widget/NavCard.design";
@@ -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 { Card } from "../widget/Card.design";
3
+ import Card from "../widget/Card.design";
4
4
  export default function AddCard({ title, icon, onClick, options, }) {
5
5
  const { width } = options ?? {};
6
6
  const container = {
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Area, Bar, ComposedChart, Legend, Line, ReferenceLine, ResponsiveContainer, Tooltip, XAxis, YAxis, } from "recharts";
3
- import { Card } from "../widget/Card.design";
3
+ import Card from "../widget/Card.design";
4
4
  export default function ChartCard({ data, xAxis, yAxis, lines, bars, areas, options, average, }) {
5
5
  const { width, height } = options ?? {};
6
6
  return (_jsxs(Card, { options: {
@@ -1,23 +1,18 @@
1
- import { InfoCardExamProps, InfoCardProductProps, InfoCardProps } from "../../interface";
1
+ import { InfoCardPersonalInformationProps, InfoCardExamProps, InfoCardGradeProps, InfoCardItemProps, InfoCardProductProps, InfoCardExamDataREGProps, InfoCardExamDataOLYProps } from "../../interface";
2
+ declare function PersonalInformation({ titles, data, }: InfoCardPersonalInformationProps): import("react/jsx-runtime").JSX.Element;
2
3
  declare function Exam({ titles, data }: InfoCardExamProps): import("react/jsx-runtime").JSX.Element;
4
+ declare function ExamDataREG({ titles, data }: InfoCardExamDataREGProps): import("react/jsx-runtime").JSX.Element;
5
+ declare function ExamDataOLY({ titles, data }: InfoCardExamDataOLYProps): import("react/jsx-runtime").JSX.Element;
3
6
  declare function Product({ titles, data }: InfoCardProductProps): import("react/jsx-runtime").JSX.Element;
4
- declare function Item({ titles, data, }: Omit<InfoCardProps, "children"> & {
5
- data: {
6
- item: string;
7
- };
8
- }): import("react/jsx-runtime").JSX.Element;
9
- declare function Grade({ titles, data, }: Omit<InfoCardProps, "children"> & {
10
- data: {
11
- level?: string;
12
- levelString?: string;
13
- levelColor?: string;
14
- profileImage?: string;
15
- score?: number;
16
- grade?: number;
17
- };
18
- }): import("react/jsx-runtime").JSX.Element;
7
+ declare function Item({ titles, data }: InfoCardItemProps): import("react/jsx-runtime").JSX.Element;
8
+ declare function Grade({ titles, data }: InfoCardGradeProps): import("react/jsx-runtime").JSX.Element;
19
9
  declare const InfoCard: {
10
+ PersonalInformation: typeof PersonalInformation;
20
11
  Exam: typeof Exam;
12
+ ExamData: {
13
+ REG: typeof ExamDataREG;
14
+ OLY: typeof ExamDataOLY;
15
+ };
21
16
  Product: typeof Product;
22
17
  Item: typeof Item;
23
18
  Grade: typeof Grade;
@@ -1,11 +1,34 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useNavigate } from "react-router-dom";
3
2
  import { InfoCardDesign } from "../widget/InfoCard.design";
4
- import { Label } from "../..";
5
- import { cn } from "../../util";
3
+ import { Events, Label, NoData } from "../..";
4
+ import { cn, gradient } from "../../util";
6
5
  const label = {
7
6
  positions: "absolute bottom-5 right-5",
8
7
  };
8
+ function PersonalInformation({ titles, data, }) {
9
+ const body = {
10
+ container: "flex flex-col pt-5.75",
11
+ belong: "text-crimson-burgundy",
12
+ username: "text-gray-dim font-bold",
13
+ name: "text-xl font-bold text-crimson-burgundy",
14
+ subInfo: {
15
+ displays: "flex flex-col mt-7.5",
16
+ fonts: "text-xs text-gray-dim",
17
+ },
18
+ };
19
+ return (_jsx(InfoCardDesign, { titles: titles, options: {
20
+ titleBorder: "border-crimson-burgundy",
21
+ width: "md",
22
+ height: "md",
23
+ background: gradient.bg.greenToRedSoft,
24
+ boundary: "border-3 border-crimson-burgundy/30",
25
+ }, children: _jsxs(_Fragment, { children: [_jsxs("div", { className: cn(body.container), children: [_jsxs("div", { className: cn(body.belong), children: [data.school, "/", data.academy] }), _jsx("div", { className: cn(body.username), children: data.username }), _jsx("div", { className: cn(body.name), children: data.name }), _jsxs("div", { className: cn(body.subInfo), children: [_jsx("div", { children: data.email }), _jsx("div", { children: data.phone })] })] }), _jsx(Label.Button, { title: "\uD559\uC6D0 \uB4F1\uB85D\uD558\uAE30", onClick: () => { }, options: {
26
+ width: "md",
27
+ background: "bg-crimson-burgundy",
28
+ text: "text-white",
29
+ className: cn(label),
30
+ } })] }) }));
31
+ }
9
32
  function Exam({ titles, data }) {
10
33
  const { status, isPublic, manager, examDate, endDate } = data;
11
34
  const container = {
@@ -13,12 +36,59 @@ function Exam({ titles, data }) {
13
36
  displays: "flex flex-col justify-between mt-2.5",
14
37
  sizes: "h-19.25 w-full",
15
38
  };
16
- const navigate = useNavigate();
17
39
  return (_jsx(InfoCardDesign, { titles: titles, options: {
18
40
  titleBorder: "border-red-crimson",
19
41
  width: "sm",
20
42
  height: "xs",
21
- }, 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: () => navigate("/admin/grades/1"), 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-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
+ }
45
+ function ExamDataREG({ titles, data }) {
46
+ const container = {
47
+ positions: "relative",
48
+ displays: "flex flex-col gap-5",
49
+ sizes: "h-36.75 w-50 pt-5",
50
+ };
51
+ const dataBox = {
52
+ container: "flex justify-between",
53
+ rightBox: "flex items-end",
54
+ score: "text-4xl font-bold leading-none",
55
+ };
56
+ const arr = [
57
+ ["part 1", data && data?.scores[0], "text-crimson-burgundy"],
58
+ ["part 2", data && data?.scores[1], "text-crimson-burgundy"],
59
+ [
60
+ "total",
61
+ data && data?.scores[0] + data?.scores[1],
62
+ "text-gray-dim border-t border-dashed border-gray-dim pt-1",
63
+ ],
64
+ ];
65
+ return (_jsx(InfoCardDesign, { titles: titles, options: {
66
+ width: "xs",
67
+ height: "md",
68
+ titleBorder: "border-crimson-burgundy",
69
+ }, children: _jsx(Events.Replace, { widgets: [
70
+ [
71
+ !data,
72
+ _jsx(NoData.Sign, { script: "\uC774\uC804 \uAE30\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.", color: "#910023", className: "text-[#910023] mt-12" }),
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" })] })] }))) }) }) }));
75
+ }
76
+ function ExamDataOLY({ titles, data }) {
77
+ const container = {
78
+ displays: "flex justify-center",
79
+ sizes: "w-full",
80
+ margins: "mt-11.375",
81
+ };
82
+ const body = {
83
+ displays: "flex flex-col justify-between items-center",
84
+ sizes: "h-20",
85
+ };
86
+ return (_jsx(InfoCardDesign, { titles: titles, options: { width: "xs", height: "md", titleBorder: "border-green-dark" }, children: _jsx(Events.Replace, { widgets: [
87
+ [
88
+ !data,
89
+ _jsx(NoData.Sign, { script: "\uC774\uC804 \uAE30\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.", color: "#105652", className: "text-[#105652] mt-12" }),
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."] })] }) }) }) }));
22
92
  }
23
93
  function Product({ titles, data }) {
24
94
  const { date, status, receiver, requester } = data;
@@ -39,7 +109,7 @@ function Product({ titles, data }) {
39
109
  text: "hover:text-white",
40
110
  } })] }) }));
41
111
  }
42
- function Item({ titles, data, }) {
112
+ function Item({ titles, data }) {
43
113
  const { item } = data;
44
114
  return (_jsx(InfoCardDesign, { titles: titles, options: {
45
115
  titleBorder: "border-blue-navy",
@@ -47,7 +117,7 @@ function Item({ titles, data, }) {
47
117
  height: "xs",
48
118
  }, children: _jsx("div", { children: item }) }));
49
119
  }
50
- function Grade({ titles, data, }) {
120
+ function Grade({ titles, data }) {
51
121
  const container = {
52
122
  positions: "relative",
53
123
  displays: "flex flex-col justify-between mt-2.5",
@@ -72,7 +142,12 @@ function Grade({ titles, data, }) {
72
142
  } }), _jsx("div", { className: "absolute right-5 top-5 w-22.5 h-22.5", children: _jsx("div", { className: "relative h-full w-full rounded-md overflow-hidden", children: _jsx("img", { className: "bg-cover rounded-md ", src: data.profileImage }) }) })] }) }));
73
143
  }
74
144
  const InfoCard = {
145
+ PersonalInformation,
75
146
  Exam,
147
+ ExamData: {
148
+ REG: ExamDataREG,
149
+ OLY: ExamDataOLY,
150
+ },
76
151
  Product,
77
152
  Item,
78
153
  Grade,
@@ -33,7 +33,7 @@ function BannerAndButtonInLay({ banner, buttonInLay, }) {
33
33
  ...buttonInLay,
34
34
  options: { ...buttonInLay.options, noShadow: true },
35
35
  };
36
- return (_jsxs("div", { className: "flex", children: [_jsx("div", { className: "box-shadow rounded-xl", children: _jsx(Banner, { ...bannerProps }) }), _jsx("div", { className: "box-shadow rounded-xl", children: _jsx(ButtonInLay, { ...buttonInLayProps }) })] }));
36
+ return (_jsxs("div", { className: "flex w-full", children: [_jsx("div", { className: "box-shadow rounded-xl w-full", children: _jsx(Banner, { ...bannerProps }) }), _jsx("div", { className: "box-shadow rounded-xl w-full", children: _jsx(ButtonInLay, { ...buttonInLayProps }) })] }));
37
37
  }
38
38
  const NavCard = {
39
39
  Banner,
@@ -1,4 +1,8 @@
1
1
  import { TableCardProps } from "../../interface";
2
- export default function TableCard<K extends string, T extends {
2
+ declare function TableCard<K extends string, T extends {
3
3
  [p in K]: any;
4
- }>({ dataSets, dataField, options }: TableCardProps<T>): import("react/jsx-runtime").JSX.Element;
4
+ }>(props: TableCardProps<T>): import("react/jsx-runtime").JSX.Element;
5
+ declare namespace TableCard {
6
+ var Log: <K extends string, T extends { [p in K]: any; }>(props: TableCardProps<T>) => import("react/jsx-runtime").JSX.Element;
7
+ }
8
+ export default TableCard;
@@ -1,22 +1,20 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useId } from "react";
3
- import { useWidgetStore } from "../../store";
4
- import { cn, sortByOrder } from "../../util";
5
- import { Card } from "../widget/Card.design";
6
- import { DataField, Row } from "../../layout";
7
- export default function TableCard({ dataSets, dataField, options }) {
8
- const { width, height } = options ?? {};
9
- const { order, setOrder } = useWidgetStore();
10
- const id = useId();
11
- const orders = order[id] ?? [];
12
- const container = {
13
- paddings: "pt-4 pb-14",
14
- };
15
- return (_jsx(Card, { header: _jsx(DataField.Card, { id: id, dataField: dataField }), options: {
16
- classNames: cn(container),
17
- width: width ?? "full",
18
- height: height ?? "lg",
19
- overflow: "y-scroll",
20
- noPadding: true,
21
- }, children: sortByOrder(dataSets, orders).map((dataSet, index) => (_jsx(Row.Card, { dataSet: dataSet, dataField: dataField }, id + index))) }));
2
+ import TableCardDesign from "../widget/TableCard.design";
3
+ function TableCard(props) {
4
+ return _jsx(TableCardDesign, { ...props });
22
5
  }
6
+ function Log(props) {
7
+ return (_jsx(TableCardDesign, { dataField: props.dataField, dataSet: props.dataSet, options: {
8
+ ...props.options,
9
+ rowHeight: "h-5",
10
+ onClick: props.options?.onClick,
11
+ text: "text-white",
12
+ padding: "p-7.5",
13
+ noHeader: true,
14
+ noHover: true,
15
+ noRowPadding: true,
16
+ className: "flex flex-col gap-2.5",
17
+ } }));
18
+ }
19
+ TableCard.Log = Log;
20
+ export default TableCard;
@@ -1,2 +1,2 @@
1
1
  import { CardProps } from "../../interface/Card";
2
- export declare function Card({ header, children, options, debug }: CardProps): import("react/jsx-runtime").JSX.Element;
2
+ export default function CardDesign({ header, children, options, debug, }: CardProps): import("react/jsx-runtime").JSX.Element;
@@ -21,7 +21,7 @@ const heightSize = {
21
21
  full: "h-full",
22
22
  auto: "h-auto min-h-80",
23
23
  };
24
- export function Card({ header, children, options, debug }) {
24
+ export default function CardDesign({ header, children, options, debug, }) {
25
25
  const { setIsOwn } = useWidgetStore();
26
26
  const { classNames, boundary, rounded, height, width, text, background, onClick, overflow, noShadow, } = options ?? {};
27
27
  const setBoundary = () => {
@@ -29,8 +29,8 @@ export function Card({ header, children, options, debug }) {
29
29
  return "";
30
30
  if (boundary === "shadow")
31
31
  return "box-shadow";
32
- if (boundary === "border")
33
- return "border-2";
32
+ if (boundary?.includes("border"))
33
+ return boundary;
34
34
  if (boundary === "none")
35
35
  return "";
36
36
  return "box-shadow";
@@ -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 { Card } from "./Card.design";
3
+ import Card from "./Card.design";
4
4
  export function InfoCardDesign({ titles: { title, subtitle }, debug, options, children, }) {
5
5
  const { titleBorder, text } = options ?? {};
6
6
  const container = {
@@ -1,2 +1,2 @@
1
1
  import { NavCardProps } from "../../interface";
2
- export default function NavCard({ titles, options }: NavCardProps): import("react/jsx-runtime").JSX.Element;
2
+ export default function NavCardDesign({ titles, options }: NavCardProps): import("react/jsx-runtime").JSX.Element;
@@ -2,9 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Label } from "../../html";
3
3
  import { LineBreaks } from "../../text";
4
4
  import { cn } from "../../util";
5
- import { Card } from "./Card.design";
6
- export default function NavCard({ titles, options }) {
7
- const { title, subtitle, color: titleColor } = titles;
5
+ import Card from "./Card.design";
6
+ export default function NavCardDesign({ titles, options }) {
7
+ const { title, subtitle, color, titleColor, subtitleColor } = titles;
8
8
  const { width, image, buttonInLay } = options ?? {};
9
9
  const { path, size } = image ?? { size: "sub" };
10
10
  const flag = !buttonInLay && width === "xl";
@@ -13,17 +13,23 @@ export default function NavCard({ titles, options }) {
13
13
  positons: `absolute z-10 ${flag ? "left-12 top-0" : "top-7.5 left-7.5"}`,
14
14
  sizes: flag && "h-full",
15
15
  displays: `flex flex-col ${flag ? "gap-7.5 justify-center" : "gap-2.5"}`,
16
- styles: `${titleColor ?? "text-gray-dim"}`,
16
+ styles: `${color ?? "text-gray-dim"}`,
17
+ },
18
+ title: {
19
+ fonts: `${flag ? "text-2xl h-6.75" : "text-xl h-6"} font-bold`,
20
+ styles: (!color && titleColor) ?? "text-gray-dim",
21
+ },
22
+ subtitle: {
23
+ fonts: "text-base h-10",
24
+ styles: (!color && subtitleColor) ?? "text-gray-dim",
17
25
  },
18
- title: `${flag ? "text-2xl h-6.75" : "text-xl h-6"} font-bold`,
19
- subtitle: "text-base h-10",
20
26
  };
21
27
  const imageClassNames = () => {
22
28
  if (size === "full")
23
29
  return "w-full h-full object-cover";
24
30
  return "absolute bottom-0 right-0 w-full xs:w-auto max-w-120 z-0 max-h-44 object-contain";
25
31
  };
26
- return (_jsxs(Card, { options: options, children: [_jsxs("div", { className: cn(textBox.container), children: [_jsx("div", { className: cn(textBox.title), children: title }), _jsx(LineBreaks, { className: "subtitle", texts: subtitle ?? "" })] }), buttonInLay && (_jsx(Label.Button, { title: buttonInLay.title, onClick: buttonInLay.onClick, options: {
32
+ return (_jsxs(Card, { options: options, children: [_jsxs("div", { className: cn(textBox.container), children: [_jsx("div", { className: cn(textBox.title), children: title }), _jsx(LineBreaks, { className: cn(textBox.subtitle), texts: subtitle ?? "" })] }), buttonInLay && (_jsx(Label.Button, { title: buttonInLay.title, onClick: buttonInLay.onClick, options: {
27
33
  disabled: buttonInLay.disabled,
28
34
  className: "absolute bottom-7.5 left-7.5",
29
35
  background: buttonInLay?.background,
@@ -0,0 +1,4 @@
1
+ import { TableCardProps } from "../../interface";
2
+ export default function TableCardDesign<K extends string, T extends {
3
+ [p in K]: any;
4
+ }>({ dataSet, dataField, options }: TableCardProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useId } from "react";
3
+ import { useWidgetStore } from "../../store";
4
+ import { cn, sortByOrder } from "../../util";
5
+ import Card from "../widget/Card.design";
6
+ import { DataField, Events, NoData, Row } from "../..";
7
+ export default function TableCardDesign({ dataSet, dataField, options }) {
8
+ const { width, height } = options ?? {};
9
+ const { order } = useWidgetStore();
10
+ const id = useId();
11
+ const orders = order[id] ?? [];
12
+ const container = {
13
+ paddings: options?.padding ?? "pt-4 pb-14",
14
+ className: options?.className,
15
+ };
16
+ return (_jsx(Card, { header: !options?.noHeader && _jsx(DataField.Card, { id: id, dataField: dataField }), options: {
17
+ classNames: cn(container),
18
+ width: width ?? "full",
19
+ height: height ?? "lg",
20
+ overflow: "y-scroll",
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))) }) }));
28
+ }
package/globals.css CHANGED
@@ -60,6 +60,9 @@ input[type="date"]::-webkit-calendar-picker-indicator {
60
60
  box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.2);
61
61
  }
62
62
 
63
+ .border-gradient-green-to-red {
64
+ }
65
+
63
66
  .x-shape {
64
67
  position: relative;
65
68
  width: 0.83625rem;
@@ -0,0 +1,2 @@
1
+ export { default as useEase } from "./useEase";
2
+ export { default as useEvents } from "./useEvents";
package/hook/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { default as useEase } from "./useEase";
2
+ export { default as useEvents } from "./useEvents";
@@ -0,0 +1 @@
1
+ export default function useEase(inTime: number, outTime: number): readonly [boolean, number];
@@ -0,0 +1,11 @@
1
+ import { useEffect, useState } from "react";
2
+ export default function useEase(inTime, outTime) {
3
+ const [flag, setFlag] = useState(false);
4
+ useEffect(() => {
5
+ const id = setTimeout(() => {
6
+ setFlag((prev) => !prev);
7
+ }, flag ? inTime : outTime);
8
+ return () => clearTimeout(id);
9
+ }, [flag, inTime, outTime]);
10
+ return [flag, flag ? inTime : outTime];
11
+ }
@@ -0,0 +1,3 @@
1
+ type Event = readonly [boolean, string];
2
+ export default function useEvents(args: Event[]): string[];
3
+ export {};
@@ -1,15 +1,5 @@
1
1
  import { useEffect, useState } from "react";
2
- export function useEase(inTime, outTime) {
3
- const [flag, setFlag] = useState(false);
4
- useEffect(() => {
5
- const id = setTimeout(() => {
6
- setFlag((prev) => !prev);
7
- }, flag ? inTime : outTime);
8
- return () => clearTimeout(id);
9
- }, [flag, inTime, outTime]);
10
- return [flag, flag ? inTime : outTime];
11
- }
12
- export function useEvents(args) {
2
+ export default function useEvents(args) {
13
3
  const [events, setEvents] = useState([]);
14
4
  args.forEach(([flag, event]) => {
15
5
  useEffect(() => {
@@ -1,8 +1,6 @@
1
- import { HTMLLabelElement, OnClick } from "../../interface";
1
+ import { HTMLLabelElement } from "../../interface";
2
2
  declare function Label({ title, options }: Omit<HTMLLabelElement, "onClick">): import("react/jsx-runtime").JSX.Element;
3
3
  declare namespace Label {
4
- var Button: ({ title, onClick, options, }: HTMLLabelElement & {
5
- onClick: OnClick;
6
- }) => import("react/jsx-runtime").JSX.Element;
4
+ var Button: ({ title, onClick, options }: HTMLLabelElement) => import("react/jsx-runtime").JSX.Element;
7
5
  }
8
6
  export default Label;
@@ -3,7 +3,7 @@ import LabelDesign from "./../widget/Label.design";
3
3
  function Label({ title, options }) {
4
4
  return (_jsx(LabelDesign, { title: title, options: { ...options, width: "sm", height: "xs" } }));
5
5
  }
6
- function Button({ title, onClick, options, }) {
6
+ function Button({ title, onClick, options }) {
7
7
  return (_jsx(LabelDesign, { title: title, onClick: onClick, options: {
8
8
  ...options,
9
9
  width: options?.width ?? "md",
@@ -1,2 +1,2 @@
1
1
  import { HTMLInputElement } from "../../interface";
2
- export default function Input({ state, placeholder, options, }: HTMLInputElement): import("react/jsx-runtime").JSX.Element;
2
+ export default function Input({ state, onKeyDown, placeholder, options, }: HTMLInputElement): import("react/jsx-runtime").JSX.Element;
@@ -10,15 +10,15 @@ const widthSize = {
10
10
  "2xl": "w-144",
11
11
  full: "w-full",
12
12
  };
13
- export default function Input({ state, placeholder, options, }) {
13
+ export default function Input({ state, onKeyDown, placeholder, options, }) {
14
14
  const { width } = options ?? {};
15
15
  const id = useId();
16
16
  const [value, setValue] = state;
17
17
  const container = {
18
- width: `${widthSize[width ?? "md"]} h-8`,
18
+ width: `${widthSize[width ?? "xs"]} h-8`,
19
19
  styles: "rounded-md pl-4 pr-4 pt-2 pb-2 bg-slate-200 text-xs",
20
20
  pseudo: "focus:outline-none focus:bg-white focus:text-black box-shadow-focus",
21
21
  effect: `transition-all`,
22
22
  };
23
- return (_jsx("input", { className: cn(container), id: id, type: "text", placeholder: placeholder ?? "ID를 입력해주세요", onChange: (e) => setValue(e.target.value) }));
23
+ return (_jsx("input", { className: cn(container), id: id, type: "text", placeholder: placeholder ?? "입력해주세요", onKeyDown: onKeyDown, onChange: (e) => setValue(e.target.value) }));
24
24
  }
@@ -1,5 +1,13 @@
1
- declare function Script(): import("react/jsx-runtime").JSX.Element;
1
+ declare function Script(props: {
2
+ script?: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
4
+ declare function Sign(props: {
5
+ script: string;
6
+ color?: string;
7
+ className?: string;
8
+ }): import("react/jsx-runtime").JSX.Element;
2
9
  declare const NoData: {
3
10
  Script: typeof Script;
11
+ Sign: typeof Sign;
4
12
  };
5
13
  export default NoData;
@@ -1,9 +1,14 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import ScriptDesign from "../widget/Script.design";
3
- function Script() {
4
- return _jsx(ScriptDesign, { script: "No Data" });
3
+ import SignDesign from "../widget/Sign.design";
4
+ function Script(props) {
5
+ return _jsx(ScriptDesign, { ...props });
6
+ }
7
+ function Sign(props) {
8
+ return _jsx(SignDesign, { ...props });
5
9
  }
6
10
  const NoData = {
7
11
  Script,
12
+ Sign,
8
13
  };
9
14
  export default NoData;
@@ -1,3 +1,3 @@
1
1
  export default function Script({ script }: {
2
- script: string;
2
+ script?: string;
3
3
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,10 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "../../util";
2
3
  export default function Script({ script }) {
3
- return (_jsx("div", { className: "w-full h-full flex items-center justify-center", children: script }));
4
+ const container = {
5
+ displays: "flex items-center justify-center",
6
+ sizes: "w-full h-full",
7
+ fonts: "text-xl",
8
+ };
9
+ return _jsx("div", { className: cn(container), children: script ?? "No Data" });
4
10
  }
@@ -0,0 +1,5 @@
1
+ export default function SignDesign({ script, color, className, }: {
2
+ script: string;
3
+ color?: string;
4
+ className?: string;
5
+ }): import("react/jsx-runtime").JSX.Element;