@edu-tosel/design 1.0.34 → 1.0.36

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 (88) hide show
  1. package/board/{widget → design}/Board.design.js +2 -2
  2. package/board/template/CanvasBoard.js +1 -1
  3. package/board/template/ManageBoard.js +4 -4
  4. package/board/template/PaperBoard.js +3 -3
  5. package/card/{widget → design}/Card.design.js +4 -3
  6. package/card/{widget → design}/InfoCard.design.d.ts +1 -1
  7. package/card/design/InfoCard.design.js +24 -0
  8. package/card/design/TableCard.design.d.ts +2 -0
  9. package/card/{widget → design}/TableCard.design.js +4 -4
  10. package/card/template/AddCard.js +2 -2
  11. package/card/template/ChartCard.js +2 -2
  12. package/card/template/InfoCard/Exam.d.ts +2 -0
  13. package/card/template/InfoCard/Exam.js +18 -0
  14. package/card/template/InfoCard/ExamData.d.ts +8 -0
  15. package/card/template/InfoCard/ExamData.js +57 -0
  16. package/card/template/InfoCard/Finance.d.ts +24 -0
  17. package/card/template/InfoCard/Finance.js +53 -0
  18. package/card/template/InfoCard/Grade.d.ts +2 -0
  19. package/card/template/InfoCard/Grade.js +29 -0
  20. package/card/template/InfoCard/Item.d.ts +2 -0
  21. package/card/template/InfoCard/Item.js +10 -0
  22. package/card/template/InfoCard/PersonalInformation.d.ts +2 -0
  23. package/card/template/InfoCard/PersonalInformation.js +29 -0
  24. package/card/template/InfoCard/Product.d.ts +2 -0
  25. package/card/template/InfoCard/Product.js +24 -0
  26. package/card/template/InfoCard/index.d.ts +19 -0
  27. package/card/template/InfoCard/index.js +17 -0
  28. package/card/template/InfoCard/static/label.d.ts +3 -0
  29. package/card/template/InfoCard/static/label.js +3 -0
  30. package/card/template/NavCard.js +1 -1
  31. package/card/template/TableCard.d.ts +2 -4
  32. package/card/template/TableCard.js +1 -1
  33. package/globals.css +17 -5
  34. package/hook/useFlag.d.ts +4 -1
  35. package/hook/useFlag.js +5 -2
  36. package/html/{widget → design}/Label.design.js +1 -1
  37. package/html/{widget → design}/Select.design.js +17 -19
  38. package/html/template/Label.js +1 -1
  39. package/html/template/Select.js +1 -1
  40. package/html/widget/CheckBox.d.ts +2 -0
  41. package/html/widget/CheckBox.js +20 -0
  42. package/html/widget/Toggle.js +1 -1
  43. package/interface/Board.d.ts +4 -11
  44. package/interface/Card.d.ts +5 -11
  45. package/interface/HTMLElement.d.ts +6 -0
  46. package/interface/Layout.d.ts +1 -0
  47. package/interface/Modal.d.ts +1 -1
  48. package/interface/Property.d.ts +19 -2
  49. package/interface/Shelf.d.ts +2 -3
  50. package/interface/Widget.d.ts +3 -6
  51. package/layout/design/Row.design.d.ts +2 -0
  52. package/layout/{widget → design}/Row.design.js +6 -2
  53. package/layout/{widget → design}/Shelf.design.d.ts +1 -1
  54. package/layout/{widget → design}/Shelf.design.js +8 -6
  55. package/layout/template/DataField.js +1 -1
  56. package/layout/template/Gallery.js +1 -1
  57. package/layout/template/Row.d.ts +9 -10
  58. package/layout/template/Row.js +12 -6
  59. package/layout/template/Shelf.d.ts +1 -1
  60. package/layout/template/Shelf.js +15 -8
  61. package/layout/widget/dashboard/Header.js +3 -3
  62. package/modal/template/Alert.js +2 -2
  63. package/modal/template/Input.js +2 -2
  64. package/overlay/widget/Overlay.design.js +1 -1
  65. package/package.json +1 -1
  66. package/store/index.d.ts +4 -2
  67. package/store/index.js +2 -0
  68. package/tailwind.config.ts +5 -0
  69. package/util/sortByOrder.d.ts +4 -3
  70. package/util/sortByOrder.js +6 -6
  71. package/version.txt +1 -1
  72. package/card/template/InfoCard.d.ts +0 -20
  73. package/card/template/InfoCard.js +0 -155
  74. package/card/widget/InfoCard.design.js +0 -23
  75. package/card/widget/TableCard.design.d.ts +0 -4
  76. package/layout/widget/Row.design.d.ts +0 -2
  77. /package/board/{widget → design}/Board.design.d.ts +0 -0
  78. /package/card/{widget → design}/Card.design.d.ts +0 -0
  79. /package/card/{widget → design}/NavCard.design.d.ts +0 -0
  80. /package/card/{widget → design}/NavCard.design.js +0 -0
  81. /package/html/{widget → design}/Label.design.d.ts +0 -0
  82. /package/html/{widget → design}/Select.design.d.ts +0 -0
  83. /package/layout/{widget → design}/DataField.design.d.ts +0 -0
  84. /package/layout/{widget → design}/DataField.design.js +0 -0
  85. /package/layout/{widget → design}/Tab.design.d.ts +0 -0
  86. /package/layout/{widget → design}/Tab.design.js +0 -0
  87. /package/modal/{widget → design}/Modal.design.d.ts +0 -0
  88. /package/modal/{widget → design}/Modal.design.js +0 -0
@@ -23,7 +23,7 @@ const heightSize = {
23
23
  };
24
24
  export function Board({ children, widgets, options, debug, buttons, }) {
25
25
  const { shows } = widgets ?? {};
26
- const { width, height, isRounded, classNames } = options ?? {};
26
+ const { width, height, isRounded, className } = options ?? {};
27
27
  const container = {
28
28
  positions: "relative",
29
29
  width: widthSize[width ?? "full"],
@@ -38,7 +38,7 @@ export function Board({ children, widgets, options, debug, buttons, }) {
38
38
  const button = {
39
39
  positions: "fixed bottom-20 right-4 xl:absolute xl:-bottom-18.5 xl:right-0",
40
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: {
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 " + className, children: children }) }) }), _jsx("div", { className: cn(button), children: buttons?.map(({ title, onClick, options }) => (_jsx(Label.Button, { title: title, onClick: onClick, options: {
42
42
  ...options,
43
43
  text: "text-white",
44
44
  background: "bg-crimson-burgundy",
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Events } from "../..";
3
3
  import { cn } from "../../util";
4
- import { Board } from "../widget/Board.design";
4
+ import { Board } from "../design/Board.design";
5
5
  import BoardHeader from "../widget/Header";
6
6
  export default function CanvasBoard({ header, children, options, widgets, buttons, }) {
7
7
  const body = {
@@ -1,12 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { DataField, Events, Shelf } from "../..";
3
- import { Board } from "../widget/Board.design";
3
+ import { Board } from "../design/Board.design";
4
4
  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
8
  export default function ManageBoard({ header, dataSets, dataField, widgets, options, buttons, }) {
9
- const { classNames, noPadding } = options ?? {};
9
+ const { className, noPadding } = options ?? {};
10
10
  const { order } = useWidgetStore();
11
11
  const id = useId();
12
12
  const orders = order[id] ?? [];
@@ -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, 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
- sortByOrder(items, orders)?.map((item) => renderItem(item)), interaction] }, id + index))) }) })] }));
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, options: { gap: "x" }, className: className, children: [items &&
20
+ sortByOrder({ items, orders })?.map((item) => renderItem(item)), interaction] }, id + index))) }) })] }));
21
21
  }
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cn } from "../../util";
3
- import { Board } from "../widget/Board.design";
3
+ import { Board } from "../design/Board.design";
4
4
  export default function PaperBoard({ children, debug, options, }) {
5
- const { classNames } = options ?? {};
5
+ const { className } = options ?? {};
6
6
  const container = {
7
7
  displays: "flex flex-col gap-7.5",
8
8
  };
9
- return (_jsx(Board, { options: { width: "lg", height: "full", isRounded: false, classNames }, debug: debug, children: _jsx("div", { className: cn(container), children: children }) }));
9
+ return (_jsx(Board, { options: { width: "lg", height: "full", isRounded: false, className }, debug: debug, children: _jsx("div", { className: cn(container), children: children }) }));
10
10
  }
@@ -2,6 +2,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
2
2
  import { cn, isDebug } from "../../util";
3
3
  import { useWidgetStore } from "../../store";
4
4
  const widthSize = {
5
+ "2xs": "w-20",
5
6
  xs: "w-full md:w-60",
6
7
  sm: "w-full md:w-90",
7
8
  md: "w-full md:w-112.5",
@@ -16,14 +17,14 @@ const heightSize = {
16
17
  sm: "h-52.5",
17
18
  md: "h-67.5",
18
19
  lg: "h-67.5",
19
- xl: "h-125",
20
+ xl: "h-125.5",
20
21
  "2xl": "",
21
22
  full: "h-full",
22
23
  auto: "h-auto min-h-80",
23
24
  };
24
25
  export default function CardDesign({ header, children, options, debug, }) {
25
26
  const { setIsOwn } = useWidgetStore();
26
- const { classNames, boundary, rounded, height, width, text, background, onClick, overflow, noShadow, } = options ?? {};
27
+ const { className, boundary, rounded, height, width, text, background, onClick, overflow, noShadow, } = options ?? {};
27
28
  const setBoundary = () => {
28
29
  if (noShadow)
29
30
  return "";
@@ -50,7 +51,7 @@ export default function CardDesign({ header, children, options, debug, }) {
50
51
  const body = {
51
52
  sizes: "h-full",
52
53
  overflow: `overflow-${overflow ?? "hidden"}`,
53
- classNames,
54
+ className,
54
55
  };
55
56
  return (_jsxs("div", { className: cn(container), children: [header && _jsx(_Fragment, { children: header }), _jsx("div", { onClick: onClick && onClick, className: cn(body), children: children })] }));
56
57
  }
@@ -1,2 +1,2 @@
1
1
  import { InfoCardProps } from "../../interface/Card";
2
- export declare function InfoCardDesign({ titles: { title, subtitle }, debug, options, children, }: InfoCardProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function InfoCardDesign({ titles: { title, subtitle }, topRight, debug, options, children, }: InfoCardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../../util";
3
+ import Card from "./Card.design";
4
+ export function InfoCardDesign({ titles: { title, subtitle }, topRight, debug, options, children, }) {
5
+ const { titleBorder, text } = options ?? {};
6
+ const container = {
7
+ displays: "flex flex-col",
8
+ paddings: "pt-5 px-5",
9
+ };
10
+ const topBox = {
11
+ container: {
12
+ displays: "flex justify-between items-end",
13
+ sizes: "w-full h-13.25",
14
+ styles: `${titleBorder} border-b-2 pb-2.5`,
15
+ },
16
+ titleText: "h-6 font-pretendard-bold text-xl w-52 truncate leading-none",
17
+ subtitleText: "h-4.75 text-base font-extralight flex items-center leading-none",
18
+ right: {
19
+ fontColor: `${text ?? "text-black"}`,
20
+ displays: "flex flex-col-reverse",
21
+ },
22
+ };
23
+ return (_jsxs(Card, { options: { ...options, className: cn(container) }, debug: debug, children: [_jsxs("div", { className: cn(topBox.container), children: [_jsxs("div", { className: "text-gray-dim ", children: [_jsx("div", { className: cn(topBox.titleText), children: title }), _jsx("div", { className: cn(topBox.subtitleText), children: subtitle ?? "" })] }), topRight] }), children] }));
24
+ }
@@ -0,0 +1,2 @@
1
+ import { TableCardProps } from "../../interface";
2
+ export default function TableCardDesign<T>({ dataSet, dataField, options, }: TableCardProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -2,9 +2,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useId } from "react";
3
3
  import { useWidgetStore } from "../../store";
4
4
  import { cn, sortByOrder } from "../../util";
5
- import Card from "../widget/Card.design";
5
+ import Card from "./Card.design";
6
6
  import { DataField, Events, Row } from "../..";
7
- export default function TableCardDesign({ dataSet, dataField, options }) {
7
+ export default function TableCardDesign({ dataSet, dataField, options, }) {
8
8
  const { width, height } = options ?? {};
9
9
  const { order } = useWidgetStore();
10
10
  const id = useId();
@@ -14,10 +14,10 @@ export default function TableCardDesign({ dataSet, dataField, options }) {
14
14
  className: options?.className,
15
15
  };
16
16
  return (_jsx(Card, { header: !options?.noHeader && _jsx(DataField.Card, { id: id, dataField: dataField }), options: {
17
- classNames: cn(container),
17
+ className: cn(container),
18
18
  width: width ?? "full",
19
19
  height: height ?? "lg",
20
20
  overflow: "y-scroll",
21
21
  noPadding: true,
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))) }) }));
22
+ }, children: _jsx(Events.Replace, { widgets: dataSet?.replaces, children: sortByOrder({ items: 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))) }) }));
23
23
  }
@@ -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 "../design/Card.design";
4
4
  export default function AddCard({ title, icon, onClick, options, }) {
5
5
  const { width } = options ?? {};
6
6
  const container = {
@@ -13,5 +13,5 @@ export default function AddCard({ title, icon, onClick, options, }) {
13
13
  sizes: "w-9 h-9",
14
14
  styles: "bg-gray-light rounded-full",
15
15
  };
16
- return (_jsxs(Card, { options: { width, classNames: cn(container), onClick }, children: [icon && (_jsx("div", { className: cn(iconBody), children: _jsx("img", { src: icon }) })), title && _jsx("div", { children: title })] }));
16
+ return (_jsxs(Card, { options: { width, className: cn(container), onClick }, children: [icon && (_jsx("div", { className: cn(iconBody), children: _jsx("img", { src: icon }) })), title && _jsx("div", { children: title })] }));
17
17
  }
@@ -1,10 +1,10 @@
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 "../design/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: {
7
- classNames: "pt-4 pr-4",
7
+ className: "pt-4 pr-4",
8
8
  width: width ?? "full",
9
9
  height: height ?? "lg",
10
10
  text: "text-xs",
@@ -0,0 +1,2 @@
1
+ import { InfoCardExamProps } from "../../../interface";
2
+ export default function Exam({ titles, data }: InfoCardExamProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Label } from "../../../html";
3
+ import { cn } from "../../../util";
4
+ import { InfoCardDesign } from "../../design/InfoCard.design";
5
+ import { label } from "./static/label";
6
+ export default function Exam({ titles, data }) {
7
+ const { status, isPublic, manager, examDate, endDate } = data;
8
+ const container = {
9
+ positions: "relative",
10
+ displays: "flex flex-col justify-between mt-2.5",
11
+ sizes: "h-19.25 w-full",
12
+ };
13
+ return (_jsx(InfoCardDesign, { titles: titles, options: {
14
+ titleBorder: "border-red-crimson",
15
+ width: "sm",
16
+ height: "xs",
17
+ }, 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) } })] }) }));
18
+ }
@@ -0,0 +1,8 @@
1
+ import { InfoCardExamDataOLYProps, InfoCardExamDataREGProps } from "../../../interface";
2
+ declare function ExamDataREG({ titles, data }: InfoCardExamDataREGProps): import("react/jsx-runtime").JSX.Element;
3
+ declare function ExamDataOLY({ titles, data }: InfoCardExamDataOLYProps): import("react/jsx-runtime").JSX.Element;
4
+ declare const ExamData: {
5
+ REG: typeof ExamDataREG;
6
+ OLY: typeof ExamDataOLY;
7
+ };
8
+ export default ExamData;
@@ -0,0 +1,57 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Events, NoData } from "../../..";
3
+ import { InfoCardDesign } from "../../design/InfoCard.design";
4
+ import { cn } from "../../../util";
5
+ function ExamDataREG({ titles, data }) {
6
+ const container = {
7
+ positions: "relative",
8
+ displays: "flex flex-col gap-5",
9
+ sizes: "h-36.75 w-50 pt-5",
10
+ };
11
+ const dataBox = {
12
+ container: "flex justify-between",
13
+ rightBox: "flex items-end",
14
+ score: "text-4xl font-pretendard-bold leading-none",
15
+ };
16
+ const arr = [
17
+ ["part 1", data && data?.scores[0], "text-crimson-burgundy"],
18
+ ["part 2", data && data?.scores[1], "text-crimson-burgundy"],
19
+ [
20
+ "total",
21
+ data && data?.scores[0] + data?.scores[1],
22
+ "text-gray-dim border-t border-dashed border-gray-dim pt-1",
23
+ ],
24
+ ];
25
+ return (_jsx(InfoCardDesign, { titles: titles, options: {
26
+ width: "xs",
27
+ height: "md",
28
+ titleBorder: "border-crimson-burgundy",
29
+ }, children: _jsx(Events.Replace, { widgets: [
30
+ [
31
+ !data,
32
+ _jsx(NoData.Sign, { script: "\uC774\uC804 \uAE30\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.", color: "#910023", className: "text-[#910023] mt-12" }),
33
+ ],
34
+ ], 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" })] })] }))) }) }) }));
35
+ }
36
+ function ExamDataOLY({ titles, data }) {
37
+ const container = {
38
+ displays: "flex justify-center",
39
+ sizes: "w-full",
40
+ margins: "mt-11.375",
41
+ };
42
+ const body = {
43
+ displays: "flex flex-col justify-between items-center",
44
+ sizes: "h-20",
45
+ };
46
+ return (_jsx(InfoCardDesign, { titles: titles, options: { width: "xs", height: "md", titleBorder: "border-green-dark" }, children: _jsx(Events.Replace, { widgets: [
47
+ [
48
+ !data,
49
+ _jsx(NoData.Sign, { script: "\uC774\uC804 \uAE30\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.", color: "#105652", className: "text-[#105652] mt-12" }),
50
+ ],
51
+ ], 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."] })] }) }) }) }));
52
+ }
53
+ const ExamData = {
54
+ REG: ExamDataREG,
55
+ OLY: ExamDataOLY,
56
+ };
57
+ export default ExamData;
@@ -0,0 +1,24 @@
1
+ import { DataPackage, InfoCardProps, State } from "../../../interface";
2
+ export interface InfoCardFinanceProps<N, C> extends Omit<InfoCardProps, "children"> {
3
+ data: {
4
+ taxRate: number;
5
+ taxState: State<boolean>;
6
+ dataSets?: {
7
+ title: string;
8
+ sum: number | string;
9
+ tax: number | string;
10
+ total: number | string;
11
+ rate: number | string;
12
+ result: number | string;
13
+ number?: DataPackage<N> & {
14
+ title: string;
15
+ };
16
+ amount?: DataPackage<C> & {
17
+ title: string;
18
+ };
19
+ }[];
20
+ };
21
+ }
22
+ export default function Finance<N, C extends {
23
+ sum: number;
24
+ }>({ titles, data, }: InfoCardFinanceProps<N, C>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,53 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../../../util";
3
+ import { InfoCardDesign } from "../../design/InfoCard.design";
4
+ import { useId } from "react";
5
+ export default function Finance({ titles, data, }) {
6
+ const { taxRate, taxState, dataSets } = data;
7
+ const [taxOn, setTaxOn] = taxState;
8
+ const id = useId();
9
+ return (_jsx(InfoCardDesign, { titles: {
10
+ title: titles.title,
11
+ subtitle: titles.subtitle,
12
+ }, options: {
13
+ titleBorder: "border-green-dark",
14
+ width: "2xl",
15
+ height: "xl",
16
+ }, topRight: _jsxs("div", { className: "flex items-center gap-2.5 text-xs ", children: [_jsx("button", { onClick: () => setTaxOn(!taxOn), className: cn("w-4 h-4 rounded-md", taxOn ? "bg-green-dark" : "border-1") }), _jsxs("div", { children: ["\uC0AC\uC5C5\uC18C\uB4DD\uC138 ", taxRate, "%"] })] }), children: _jsxs("div", { className: "flex flex-col", children: [_jsx("div", { className: "flex gap-7.5 mt-4.25 border-b-1 border-green-dark pb-2.5 ", children: dataSets?.map(({ title, sum, tax, total, rate, amount, number, result }, index) => (_jsxs("div", { className: "flex flex-col gap-2.5", children: [_jsx("div", { className: "font-pretendard-bold text-green-dark", children: title }), _jsxs("div", { className: "flex gap-2.5", children: [_jsxs("div", { className: "flex flex-col justify-between w-20", children: [number && (_jsx(Numbers, { title: number.title, dataSet: number.dataSet, dataField: number.dataField })), _jsx(Result, { title: "\uBE44\uC728", amount: `${rate}%` })] }), amount && (_jsxs("div", { className: "flex flex-col", children: [_jsx(Amount, { title: amount.title, dataSet: amount.dataSet, dataField: amount.dataField }), _jsxs("div", { className: "flex flex-col gap-1.5 mt-2.5", children: [_jsx(Result, { title: "\uD569\uACC4", amount: sum, cnTitle: "text-gray-dim" }), _jsx(Result, { title: "\uC0AC\uC5C5\uC18C\uB4DD\uC138", amount: `${typeof tax === "number" && tax ? "-" : ""}${tax.toLocaleString()}`, cnTitle: "text-gray-dim", cnAmount: "text-crimson-burgundy" }), _jsx(Result, { title: "\uCD1D\uACC4", amount: total, background: "bg-green-dark/10", cnTitle: "font-pretendard-bold" })] }), _jsx(Result, { title: "\uC9C0\uAE09\uBD84", amount: result, background: "bg-green-dark", cnTitle: "font-pretendard-bold text-white", className: "text-white mt-5" })] }))] })] }, id + index))) }), _jsx("div", { className: "flex items-center h-15.5", children: _jsx("div", { className: "w-45 h-10 bg-gray-light rounded-md" }) })] }) }));
17
+ }
18
+ function Numbers({ title, dataSet, dataField, }) {
19
+ const id = useId();
20
+ const itemBox = {
21
+ displays: "flex items-center justify-center ",
22
+ sizes: "w-1/2 h-5",
23
+ };
24
+ return (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("div", { className: "text-xs", children: title }), _jsxs("div", { className: "flex flex-col w-full h-36 pt-2.5 rounded-md bg-gray-light text-sm", children: [_jsx("div", { className: "flex items-center font-pretendard-bold", children: Object.keys(dataField).map((key) => (_jsx("div", { className: "flex items-center justify-center w-1/2 h-5", children: dataField[key]?.title }, key))) }), dataSet.items?.map((item, index) => (_jsx("div", { className: "flex items-center", children: dataField &&
25
+ Object.keys(dataField).map((key, index) => (_jsx("div", { className: cn(itemBox, index % 2 === 0 ? "text-gray-dim" : "text-green-dark"), children: String(item[key]) }, key))) }, id + index)))] })] }));
26
+ }
27
+ function Amount({ title, dataSet, dataField, }) {
28
+ const id = useId();
29
+ const amountBox = {
30
+ displays: "flex items-center justify-end ",
31
+ sizes: "w-1/2 h-5 pr-2.5",
32
+ };
33
+ return (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("div", { className: "text-xs", children: title }), _jsxs("div", { className: "relative flex flex-col w-full h-36 pt-2.5 rounded-md bg-gray-light text-sm", children: [_jsx("div", { className: "absolute top-0 right-0 bg-green-light w-1/2 h-full rounded-md z-0" }), _jsx("div", { className: "flex items-center z-10", children: Object.keys(dataField).map((key) => (_jsx("div", { className: "flex items-center pl-2.5 text-start w-1/2 h-5 font-pretendard-bold", children: dataField[key]?.title }, key))) }), dataSet.items?.map((item, index) => (_jsx("div", { className: "flex items-center z-10", children: dataField &&
34
+ Object.keys(dataField).map((key, index) => (_jsx("div", { className: cn(amountBox, index % 2 === 0 ? "text-gray-dim" : "text-green-dark"), children: Number(item[key]).toLocaleString() }, key))) }, id + index)))] })] }));
35
+ }
36
+ function Result({ title, amount, background, cnTitle, cnAmount, className, }) {
37
+ const container = {
38
+ displays: "flex items-center justify-between",
39
+ paddings: "px-2.5",
40
+ styles: "rounded-md w-full h-6 text-xs text-green-dark",
41
+ backgrounds: background ?? "bg-gray-light",
42
+ className,
43
+ };
44
+ const titleBox = {
45
+ styles: "w-20 text-center",
46
+ cnTitle,
47
+ };
48
+ const amountBox = {
49
+ styles: "w-20 text-end",
50
+ cnAmount,
51
+ };
52
+ return (_jsxs("div", { className: cn(container), children: [_jsx("div", { className: cn(titleBox), children: title }), _jsx("div", { className: cn(amountBox), children: amount?.toLocaleString() })] }));
53
+ }
@@ -0,0 +1,2 @@
1
+ import { InfoCardGradeProps } from "../../../interface";
2
+ export default function Grade({ titles, data }: InfoCardGradeProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Label } from "../../../html";
3
+ import { cn } from "../../../util";
4
+ import { InfoCardDesign } from "../../design/InfoCard.design";
5
+ import { label } from "./static/label";
6
+ export default function Grade({ titles, data }) {
7
+ const container = {
8
+ positions: "relative",
9
+ displays: "flex flex-col justify-between mt-2.5",
10
+ sizes: "h-19.5 w-full",
11
+ };
12
+ const levelBox = {
13
+ displays: "flex justify-center items-center ",
14
+ sizes: "w-22.5 h-6.4",
15
+ styles: "bg-white-off text-sm rounded-md",
16
+ text: data.levelColor,
17
+ };
18
+ return (_jsx(InfoCardDesign, { titles: titles, options: {
19
+ titleBorder: "border-blue-navy",
20
+ width: "sm",
21
+ height: "xs",
22
+ }, 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: {
23
+ width: "sm",
24
+ height: "xs",
25
+ text: "text-white hover:text-blue-navy",
26
+ background: "bg-blue-navy hover:bg-gray-light",
27
+ className: cn(label),
28
+ } }), _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 }) }) })] }) }));
29
+ }
@@ -0,0 +1,2 @@
1
+ import { InfoCardItemProps } from "../../../interface";
2
+ export default function Item({ titles, data }: InfoCardItemProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { InfoCardDesign } from "../../design/InfoCard.design";
3
+ export default function Item({ titles, data }) {
4
+ const { item } = data;
5
+ return (_jsx(InfoCardDesign, { titles: titles, options: {
6
+ titleBorder: "border-blue-navy",
7
+ width: "xs",
8
+ height: "xs",
9
+ }, children: _jsx("div", { children: item }) }));
10
+ }
@@ -0,0 +1,2 @@
1
+ import { InfoCardPersonalInformationProps } from "../../../interface";
2
+ export default function PersonalInformation({ titles, data, }: InfoCardPersonalInformationProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,29 @@
1
+ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { cn, gradient } from "../../../util";
3
+ import { label } from "./static/label";
4
+ import { Label } from "../../..";
5
+ import { InfoCardDesign } from "../../design/InfoCard.design";
6
+ export default function PersonalInformation({ titles, data, }) {
7
+ const body = {
8
+ container: "flex flex-col pt-5.75",
9
+ belong: "text-crimson-burgundy",
10
+ username: "text-gray-dim font-pretendard-bold",
11
+ name: "text-xl font-pretendard-bold text-crimson-burgundy",
12
+ subInfo: {
13
+ displays: "flex flex-col mt-7.5",
14
+ fonts: "text-xs text-gray-dim",
15
+ },
16
+ };
17
+ return (_jsx(InfoCardDesign, { titles: titles, options: {
18
+ titleBorder: "border-crimson-burgundy",
19
+ width: "md",
20
+ height: "md",
21
+ background: gradient.bg.greenToRedSoft,
22
+ boundary: "border-3 border-crimson-burgundy/30",
23
+ }, 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: {
24
+ width: "md",
25
+ background: "bg-crimson-burgundy",
26
+ text: "text-white",
27
+ className: cn(label),
28
+ } })] }) }));
29
+ }
@@ -0,0 +1,2 @@
1
+ import { InfoCardProductProps } from "../../../interface";
2
+ export default function Product({ titles, data }: InfoCardProductProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Label } from "../../..";
3
+ import { cn } from "../../../util";
4
+ import { InfoCardDesign } from "../../design/InfoCard.design";
5
+ import { label } from "./static/label";
6
+ export default function Product({ titles, data }) {
7
+ const { date, status, receiver, requester } = data;
8
+ const container = {
9
+ positions: "relative",
10
+ displays: "flex flex-col mt-2.5",
11
+ sizes: "h-19.25 w-full",
12
+ };
13
+ return (_jsx(InfoCardDesign, { titles: titles, options: {
14
+ titleBorder: "border-jr-blue",
15
+ width: "sm",
16
+ height: "xs",
17
+ }, children: _jsxs(_Fragment, { children: [_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "text-sm", children: ["\uC77C\uC2DC: ", date] }), _jsxs("div", { className: "text-sm", children: ["\uC694\uCCAD\uC790: ", requester ?? "No Data"] }), _jsxs("div", { className: "text-sm", children: ["\uC218\uC2E0\uC790: ", receiver ?? "No Data"] })] }), _jsx(Label.Button, { title: status ?? "", onClick: () => console.log("click"), options: {
18
+ width: "sm",
19
+ height: "xs",
20
+ className: cn(label),
21
+ background: "bg-gray-light hover:bg-blue-sky",
22
+ text: "hover:text-white",
23
+ } })] }) }));
24
+ }
@@ -0,0 +1,19 @@
1
+ import Exam from "./Exam";
2
+ import Finance from "./Finance";
3
+ import Grade from "./Grade";
4
+ import Item from "./Item";
5
+ import PersonalInformation from "./PersonalInformation";
6
+ import Product from "./Product";
7
+ declare const InfoCard: {
8
+ PersonalInformation: typeof PersonalInformation;
9
+ Exam: typeof Exam;
10
+ ExamData: {
11
+ REG: ({ titles, data }: import("../../../interface").InfoCardExamDataREGProps) => import("react/jsx-runtime").JSX.Element;
12
+ OLY: ({ titles, data }: import("../../../interface").InfoCardExamDataOLYProps) => import("react/jsx-runtime").JSX.Element;
13
+ };
14
+ Finance: typeof Finance;
15
+ Product: typeof Product;
16
+ Item: typeof Item;
17
+ Grade: typeof Grade;
18
+ };
19
+ export default InfoCard;
@@ -0,0 +1,17 @@
1
+ import Exam from "./Exam";
2
+ import ExamData from "./ExamData";
3
+ import Finance from "./Finance";
4
+ import Grade from "./Grade";
5
+ import Item from "./Item";
6
+ import PersonalInformation from "./PersonalInformation";
7
+ import Product from "./Product";
8
+ const InfoCard = {
9
+ PersonalInformation,
10
+ Exam,
11
+ ExamData,
12
+ Finance,
13
+ Product,
14
+ Item,
15
+ Grade,
16
+ };
17
+ export default InfoCard;
@@ -0,0 +1,3 @@
1
+ export declare const label: {
2
+ positions: string;
3
+ };
@@ -0,0 +1,3 @@
1
+ export const label = {
2
+ positions: "absolute bottom-5 right-5",
3
+ };
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import NavCardDesign from "../widget/NavCard.design";
2
+ import NavCardDesign from "../design/NavCard.design";
3
3
  function Banner({ titles, options }) {
4
4
  return (_jsx(NavCardDesign, { titles: titles, options: { ...options, width: options?.width ?? "xl", height: "sm" } }));
5
5
  }
@@ -1,8 +1,6 @@
1
1
  import { TableCardProps } from "../../interface";
2
- declare function TableCard<K extends string, T extends {
3
- [p in K]: any;
4
- }>(props: TableCardProps<T>): import("react/jsx-runtime").JSX.Element;
2
+ declare function TableCard<T>(props: TableCardProps<T>): import("react/jsx-runtime").JSX.Element;
5
3
  declare namespace TableCard {
6
- var Log: <K extends string, T extends { [p in K]: any; }>(props: TableCardProps<T>) => import("react/jsx-runtime").JSX.Element;
4
+ var Log: <T>(props: TableCardProps<T>) => import("react/jsx-runtime").JSX.Element;
7
5
  }
8
6
  export default TableCard;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import TableCardDesign from "../widget/TableCard.design";
2
+ import TableCardDesign from "../design/TableCard.design";
3
3
  function TableCard(props) {
4
4
  return _jsx(TableCardDesign, { ...props });
5
5
  }
package/globals.css CHANGED
@@ -185,7 +185,7 @@ input[type="date"]::-webkit-calendar-picker-indicator {
185
185
  width: 16rem !important;
186
186
  }
187
187
  /* toggle button */
188
- [type="checkbox"]::before {
188
+ .toggle[type="checkbox"]::before {
189
189
  content: "";
190
190
  position: absolute;
191
191
  left: 1px;
@@ -197,18 +197,30 @@ input[type="date"]::-webkit-calendar-picker-indicator {
197
197
  background-color: white;
198
198
  transition: left 100ms linear;
199
199
  }
200
- [type="checkbox"]:checked::before {
200
+ .toggle[type="checkbox"]:checked::before {
201
201
  background-color: white;
202
202
  left: 1.32rem;
203
203
  }
204
- [type="checkbox"]:checked {
204
+ .toggle[type="checkbox"]:checked {
205
205
  background-color: #105652;
206
206
  }
207
- [type="checkbox"]:disabled {
207
+ .toggle[type="checkbox"]:disabled {
208
208
  opacity: 0.3;
209
209
  cursor: not-allowed;
210
210
  }
211
- [type="checkbox"]:disabled + span {
211
+ .toggle[type="checkbox"]:disabled + span {
212
212
  opacity: 0.3;
213
213
  cursor: not-allowed;
214
214
  }
215
+
216
+ /* checkbox */
217
+ .check-box[type="checkbox"]:checked {
218
+ border-color: transparent;
219
+ background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M5.707 7.293a1 1 0 0 0-1.414 1.414l2 2a1 1 0 0 0 1.414 0l4-4a1 1 0 0 0-1.414-1.414L7 8.586 5.707 7.293z'/%3e%3c/svg%3e");
220
+ background-size: 150%;
221
+ background-position: 50%;
222
+ background-repeat: no-repeat;
223
+ }
224
+ .check-box[type="checkbox"]:disabled {
225
+ background-color: #7f7f7f;
226
+ }
package/hook/useFlag.d.ts CHANGED
@@ -1,2 +1,5 @@
1
1
  import { State } from "../interface";
2
- export default function useFlag<T>(state: State<T>): void;
2
+ export default function useFlag<T>({ safe, state, }: {
3
+ safe?: string;
4
+ state: State<T>;
5
+ }): void;