@edu-tosel/design 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +17 -0
- package/Dockerfile +16 -0
- package/LICENCE +19 -0
- package/README.md +20 -0
- package/docs/README.md +47 -0
- package/index.html +13 -0
- package/package.json +49 -28
- package/postcss.config.js +6 -0
- package/public/images/daeng.jpg +0 -0
- package/public/images/faker.jpg +0 -0
- package/public/images/haerin.png +0 -0
- package/public/images/haewon.png +0 -0
- package/public/images/hani.png +0 -0
- package/public/images/home/admin.png +0 -0
- package/public/images/home/dashboard.png +0 -0
- package/public/images/home/detection.png +0 -0
- package/public/images/home/homepage.png +0 -0
- package/public/images/home/olympiad.png +0 -0
- package/public/images/home/partner.png +0 -0
- package/public/images/home/report.png +0 -0
- package/public/images/home/space.png +0 -0
- package/public/images/home/sun.png +0 -0
- package/public/images/info.png +0 -0
- package/public/images/itc.png +0 -0
- package/public/images/jenkins.png +0 -0
- package/public/images/minji.png +0 -0
- package/public/images/seulgi.png +0 -0
- package/public/images/test-full.png +0 -0
- package/public/images/test-image.png +0 -0
- package/public/images/test-paper.png +0 -0
- package/public/images/tosel-blue-lab-spiral.png +0 -0
- package/public/images/tosel.png +0 -0
- package/public/images/yujin.png +0 -0
- package/public/videos/loading.gif +0 -0
- package/public/vite.svg +1 -0
- package/setupPackage.js +78 -0
- package/src/App.tsx +32 -0
- package/src/_components/asset/interface.ts +2 -0
- package/src/_components/asset/links.ts +17 -0
- package/src/_components/asset/mock/academies.ts +52 -0
- package/src/_components/asset/mock/chartData.ts +104 -0
- package/src/_components/asset/mock/exams.ts +42 -0
- package/src/_components/asset/mock/index.ts +2 -0
- package/src/_components/asset/mock/people.ts +291 -0
- package/src/_components/asset/mock/test.ts +67 -0
- package/src/_components/asset/navigation.ts +17 -0
- package/src/_components/asset/people.ts +226 -0
- package/src/_components/asset/planets.ts +49 -0
- package/src/_components/controller/store.ts +11 -0
- package/src/_components/hook/useRoute.ts +47 -0
- package/src/_components/hook/useTyping.ts +46 -0
- package/src/_components/types/Level.ts +1 -0
- package/src/_components/view/Explore.tsx +16 -0
- package/src/_components/view/Home.tsx +180 -0
- package/src/_components/view/LottiePlayer.tsx +17 -0
- package/src/app/admin/exam/page.tsx +36 -0
- package/src/app/admin/grade/page.tsx +5 -0
- package/src/app/admin/layout.tsx +56 -0
- package/src/app/admin/news/page.tsx +15 -0
- package/src/app/admin/page.tsx +42 -0
- package/src/app/admin/rnd/monthly-test/page.tsx +5 -0
- package/src/app/admin/rnd/page.tsx +17 -0
- package/src/app/admin/statistics/page.tsx +5 -0
- package/src/app/admin/user/page.tsx +147 -0
- package/src/app/agency/exam/page.tsx +5 -0
- package/src/app/agency/group/page.tsx +5 -0
- package/src/app/agency/layout.tsx +55 -0
- package/src/app/agency/page.tsx +68 -0
- package/src/app/agency/sales/page.tsx +5 -0
- package/src/app/convention/page.tsx +58 -0
- package/src/app/page.tsx +4 -0
- package/src/asset/fonts/Kostar.ttf +0 -0
- package/src/asset/fonts/Megrim.ttf +0 -0
- package/src/asset/fonts/NicoMoji.ttf +0 -0
- package/src/asset/fonts/Pretendard-Medium.otf +0 -0
- package/{board/index.d.ts → src/board/index.tsx} +4 -3
- package/src/board/template/CanvasBoard.tsx +17 -0
- package/src/board/template/ManageBoard.tsx +56 -0
- package/src/board/widget/Board.tsx +28 -0
- package/src/board/widget/DataField.tsx +70 -0
- package/src/board/widget/Header.tsx +63 -0
- package/src/board/widget/Tab.tsx +36 -0
- package/src/board/widget/Tags.tsx +81 -0
- package/{card/index.d.ts → src/card/index.tsx} +6 -5
- package/src/card/template/ChartCard.tsx +42 -0
- package/src/card/template/InfoCard.tsx +22 -0
- package/src/card/template/ProfileCard.tsx +36 -0
- package/src/card/template/RowCard.tsx +91 -0
- package/src/card/template/TableCard.tsx +41 -0
- package/src/card/template/TrumpCard.tsx +46 -0
- package/src/card/widget/Card.tsx +53 -0
- package/src/deck/Deck.tsx +46 -0
- package/{deck/index.d.ts → src/deck/index.tsx} +1 -1
- package/{index.d.ts → src/index.tsx} +11 -11
- package/src/interaction/Exception.tsx +10 -0
- package/src/interaction/LoadingSpinner.tsx +10 -0
- package/src/interaction/NoData.tsx +5 -0
- package/{interaction/index.d.ts → src/interaction/index.tsx} +2 -2
- package/src/interface/Board.ts +55 -0
- package/src/interface/Card.ts +66 -0
- package/src/interface/HTMLElement.ts +27 -0
- package/src/interface/Interaction.ts +4 -0
- package/src/interface/Menu.ts +5 -0
- package/src/interface/Modal.ts +19 -0
- package/{interface/Property.d.ts → src/interface/Property.ts} +46 -34
- package/src/interface/Widget.ts +4 -0
- package/{interface/index.d.ts → src/interface/index.ts} +3 -2
- package/src/layout/dashboard/Header.tsx +56 -0
- package/src/layout/dashboard/index.tsx +38 -0
- package/{layout/index.d.ts → src/layout/index.tsx} +1 -1
- package/src/main.tsx +10 -0
- package/src/menu/SideMenu.tsx +104 -0
- package/{menu/index.d.ts → src/menu/index.tsx} +1 -1
- package/src/modal/AlertModal.tsx +24 -0
- package/src/modal/ControllerModal.tsx +17 -0
- package/src/modal/Modal.tsx +66 -0
- package/src/modal/TestModal.tsx +19 -0
- package/{modal/index.d.ts → src/modal/index.tsx} +3 -3
- package/src/navigation/Navigation.tsx +37 -0
- package/{navigation/index.d.ts → src/navigation/index.tsx} +1 -1
- package/src/shelf/Shelf.tsx +3 -0
- package/{shelf/index.d.ts → src/shelf/index.tsx} +1 -1
- package/src/store/index.ts +66 -0
- package/src/text/LineBreaks.tsx +13 -0
- package/{text/index.d.ts → src/text/index.tsx} +1 -1
- package/src/util/classNames.ts +4 -0
- package/src/util/colors.ts +11 -0
- package/src/util/display.ts +31 -0
- package/src/util/displayResponsive.ts +17 -0
- package/{util/index.d.ts → src/util/index.ts} +7 -7
- package/src/util/pattern.ts +18 -0
- package/src/util/position.ts +43 -0
- package/src/util/shape.ts +3 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.build.json +42 -0
- package/tsconfig.json +28 -0
- package/tsconfig.node.json +10 -0
- package/vite.config.ts +10 -0
- package/board/index.js +0 -3
- package/board/template/CanvasBoard.d.ts +0 -2
- package/board/template/CanvasBoard.js +0 -10
- package/board/template/ManageBoard.d.ts +0 -4
- package/board/template/ManageBoard.js +0 -28
- package/board/widget/Board.d.ts +0 -2
- package/board/widget/Board.js +0 -16
- package/board/widget/DataField.d.ts +0 -6
- package/board/widget/DataField.js +0 -24
- package/board/widget/Header.d.ts +0 -2
- package/board/widget/Header.js +0 -22
- package/board/widget/Tab.d.ts +0 -4
- package/board/widget/Tab.js +0 -17
- package/board/widget/Tags.d.ts +0 -3
- package/board/widget/Tags.js +0 -30
- package/card/index.js +0 -5
- package/card/template/ChartCard.d.ts +0 -2
- package/card/template/ChartCard.js +0 -6
- package/card/template/ProfileCard.d.ts +0 -14
- package/card/template/ProfileCard.js +0 -8
- package/card/template/RowCard.d.ts +0 -5
- package/card/template/RowCard.js +0 -26
- package/card/template/TableCard.d.ts +0 -2
- package/card/template/TableCard.js +0 -12
- package/card/template/TrumpCard.d.ts +0 -2
- package/card/template/TrumpCard.js +0 -19
- package/card/widget/Card.d.ts +0 -2
- package/card/widget/Card.js +0 -45
- package/deck/Deck.d.ts +0 -16
- package/deck/Deck.js +0 -15
- package/deck/index.js +0 -1
- package/index.js +0 -11
- package/interaction/Exception.d.ts +0 -2
- package/interaction/Exception.js +0 -9
- package/interaction/LoadingSpinner.d.ts +0 -1
- package/interaction/LoadingSpinner.js +0 -5
- package/interaction/index.js +0 -2
- package/interface/Board.d.ts +0 -57
- package/interface/Board.js +0 -1
- package/interface/Card.d.ts +0 -73
- package/interface/Card.js +0 -1
- package/interface/HTMLElement.d.ts +0 -13
- package/interface/HTMLElement.js +0 -1
- package/interface/Interaction.d.ts +0 -5
- package/interface/Interaction.js +0 -1
- package/interface/Modal.d.ts +0 -18
- package/interface/Modal.js +0 -1
- package/interface/Property.js +0 -14
- package/interface/Widget.d.ts +0 -4
- package/interface/Widget.js +0 -1
- package/interface/index.js +0 -2
- package/layout/dashboard/Header.d.ts +0 -5
- package/layout/dashboard/Header.js +0 -19
- package/layout/dashboard/index.d.ts +0 -7
- package/layout/dashboard/index.js +0 -10
- package/layout/index.js +0 -1
- package/menu/SideMenu.d.ts +0 -1
- package/menu/SideMenu.js +0 -14
- package/menu/index.js +0 -1
- package/modal/AlertModal.d.ts +0 -2
- package/modal/AlertModal.js +0 -8
- package/modal/ControllerModal.d.ts +0 -6
- package/modal/ControllerModal.js +0 -6
- package/modal/Modal.d.ts +0 -2
- package/modal/Modal.js +0 -31
- package/modal/TestModal.d.ts +0 -8
- package/modal/TestModal.js +0 -6
- package/modal/index.js +0 -3
- package/navigation/Navigation.d.ts +0 -5
- package/navigation/Navigation.js +0 -24
- package/navigation/index.js +0 -1
- package/shelf/Shelf.d.ts +0 -4
- package/shelf/Shelf.js +0 -4
- package/shelf/index.js +0 -1
- package/store/index.d.ts +0 -16
- package/store/index.js +0 -39
- package/text/LineBreaks.d.ts +0 -4
- package/text/LineBreaks.js +0 -5
- package/text/index.js +0 -1
- package/util/classNames.d.ts +0 -1
- package/util/classNames.js +0 -4
- package/util/colors.d.ts +0 -10
- package/util/colors.js +0 -10
- package/util/display.d.ts +0 -25
- package/util/display.js +0 -25
- package/util/displayResponsive.d.ts +0 -3
- package/util/displayResponsive.js +0 -15
- package/util/index.js +0 -7
- package/util/pattern.d.ts +0 -7
- package/util/pattern.js +0 -15
- package/util/position.d.ts +0 -14
- package/util/position.js +0 -44
- package/util/shape.d.ts +0 -1
- package/util/shape.js +0 -3
- package/version.txt +0 -1
- /package/{asset → public}/fonts/Kostar.ttf +0 -0
- /package/{asset → public}/fonts/Megrim.ttf +0 -0
- /package/{asset → public}/fonts/NicoMoji.ttf +0 -0
- /package/{asset → public}/fonts/Pretendard-Medium.otf +0 -0
- /package/{asset → src/asset}/json/credit-lottie.json +0 -0
- /package/{asset → src/asset}/json/loading-lottie.json +0 -0
- /package/{asset → src/asset}/json/test.svg +0 -0
- /package/{globals.css → src/globals.css} +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Card } from "../widget/Card";
|
|
2
|
+
import { useWidgetStore } from "../../store";
|
|
3
|
+
import { Dispatch, useId, useState } from "react";
|
|
4
|
+
|
|
5
|
+
export default function RowCard<T extends Record<string, any>>({
|
|
6
|
+
row,
|
|
7
|
+
fields,
|
|
8
|
+
sizes,
|
|
9
|
+
}: {
|
|
10
|
+
row: T;
|
|
11
|
+
fields: Partial<Record<keyof T, "text" | ["select", [string, string][]]>>;
|
|
12
|
+
sizes: Partial<Record<keyof T, string>>;
|
|
13
|
+
}) {
|
|
14
|
+
const [rowState, setRowState] = useState<T>(row);
|
|
15
|
+
const { setView, setTempData } = useWidgetStore();
|
|
16
|
+
const entries = Object.entries(fields).map(
|
|
17
|
+
([key, type]) => [type, key, rowState[key]] as const
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Card
|
|
22
|
+
options={{
|
|
23
|
+
width: "full",
|
|
24
|
+
height: "xs",
|
|
25
|
+
boundary: "none",
|
|
26
|
+
rounded: "none",
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
<div className="flex items-center h-full">
|
|
30
|
+
{entries.map(([type, key, value]) => (
|
|
31
|
+
<div key={key} className={`w-${`${sizes[key]}/100` ?? "auto"}`}>
|
|
32
|
+
{Array.isArray(type) && type[0] === "select" ? (
|
|
33
|
+
<Select
|
|
34
|
+
key={key + type + value.toString()}
|
|
35
|
+
type={type}
|
|
36
|
+
entry={[key, value]}
|
|
37
|
+
row={rowState}
|
|
38
|
+
setRow={setRowState}
|
|
39
|
+
/>
|
|
40
|
+
) : (
|
|
41
|
+
<div key={key + value.toString()} className="w-full truncate">
|
|
42
|
+
{value ?? "No Data"}
|
|
43
|
+
</div>
|
|
44
|
+
)}
|
|
45
|
+
</div>
|
|
46
|
+
))}
|
|
47
|
+
<button
|
|
48
|
+
onClick={() => {
|
|
49
|
+
setTempData(row);
|
|
50
|
+
setView("sideMenu");
|
|
51
|
+
}}
|
|
52
|
+
>
|
|
53
|
+
click
|
|
54
|
+
</button>
|
|
55
|
+
</div>
|
|
56
|
+
</Card>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function Select<T>({
|
|
61
|
+
type,
|
|
62
|
+
entry,
|
|
63
|
+
row,
|
|
64
|
+
setRow,
|
|
65
|
+
}: {
|
|
66
|
+
type: ["select", [string, string][]];
|
|
67
|
+
entry: [string, string];
|
|
68
|
+
row: T;
|
|
69
|
+
setRow: Dispatch<T>;
|
|
70
|
+
}) {
|
|
71
|
+
const id = useId();
|
|
72
|
+
const [key, value] = entry;
|
|
73
|
+
return (
|
|
74
|
+
<select
|
|
75
|
+
key={id}
|
|
76
|
+
value={value}
|
|
77
|
+
onChange={(e) =>
|
|
78
|
+
setRow({
|
|
79
|
+
...row,
|
|
80
|
+
[key]: e.target.value,
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
>
|
|
84
|
+
{type[1].map(([value, title]) => (
|
|
85
|
+
<option key={id + value} value={value}>
|
|
86
|
+
{title}
|
|
87
|
+
</option>
|
|
88
|
+
))}
|
|
89
|
+
</select>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { TableCardProps } from "../../interface/Card";
|
|
2
|
+
import { Card } from "../widget/Card";
|
|
3
|
+
|
|
4
|
+
export default function TableCard({
|
|
5
|
+
data,
|
|
6
|
+
fields,
|
|
7
|
+
sizes,
|
|
8
|
+
options,
|
|
9
|
+
}: TableCardProps) {
|
|
10
|
+
const { color } = options ?? {};
|
|
11
|
+
const { background: bgColor, text: textColor } = color ?? {};
|
|
12
|
+
const keys = Object.keys(fields);
|
|
13
|
+
|
|
14
|
+
const fieldsClassNames = [
|
|
15
|
+
`flex h-11 items-center font-bold pl-4`,
|
|
16
|
+
`bg-${bgColor ?? "gray-300"} text-${textColor ?? "black"}`,
|
|
17
|
+
].join(" ");
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<Card options={{ width: "lg", height: "lg" }}>
|
|
21
|
+
<div className="overflow-hidden text-xs xs:text-sm sm:text-base">
|
|
22
|
+
<div className={fieldsClassNames}>
|
|
23
|
+
{keys.map((key) => (
|
|
24
|
+
<div key={key} className={`w-${sizes[key]}`}>
|
|
25
|
+
{fields[key]}
|
|
26
|
+
</div>
|
|
27
|
+
))}
|
|
28
|
+
</div>
|
|
29
|
+
{data.map((row, index) => (
|
|
30
|
+
<div key={index} className="flex items-center pl-4 h-11 ">
|
|
31
|
+
{keys.map((key) => (
|
|
32
|
+
<div key={key} className={`truncate w-${sizes[key] ?? "auto"}`}>
|
|
33
|
+
{row[key]}
|
|
34
|
+
</div>
|
|
35
|
+
))}
|
|
36
|
+
</div>
|
|
37
|
+
))}
|
|
38
|
+
</div>
|
|
39
|
+
</Card>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { TrumpCardProps } from "../../interface/Card";
|
|
2
|
+
import { LineBreaks } from "../../text";
|
|
3
|
+
import { Card } from "../widget/Card";
|
|
4
|
+
|
|
5
|
+
export default function TrumpCard({ titles, options }: TrumpCardProps) {
|
|
6
|
+
const { title, subTitle, color: titleColor } = titles;
|
|
7
|
+
const { onClick, width, image, subButton } = options ?? {};
|
|
8
|
+
const [buttonText, buttonBgColor, buttonAction] = subButton ?? [
|
|
9
|
+
null,
|
|
10
|
+
"red-crimson",
|
|
11
|
+
() => {},
|
|
12
|
+
];
|
|
13
|
+
const { path, size } = image ?? { size: "sub" };
|
|
14
|
+
|
|
15
|
+
const imageClassNames = () => {
|
|
16
|
+
if (size === "full") return "w-full h-full object-cover";
|
|
17
|
+
return "absolute bottom-0 right-0 w-full xs:w-auto max-w-120 z-0 max-h-44 object-contain";
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Card options={{ width: width ?? "xs", onClick: onClick }}>
|
|
22
|
+
<div
|
|
23
|
+
className={`absolute top-8 left-8 w-48 flex flex-col gap-2 z-10 text-${titleColor}`}
|
|
24
|
+
>
|
|
25
|
+
<div className="text-xl font-bold">{title}</div>
|
|
26
|
+
<LineBreaks gap={0} texts={subTitle ?? [""]} />
|
|
27
|
+
{subButton ? (
|
|
28
|
+
<button
|
|
29
|
+
className={`text-white rounded-md bg-${buttonBgColor} w-45 h-11 flex justify-center items-center`}
|
|
30
|
+
onClick={buttonAction}
|
|
31
|
+
>
|
|
32
|
+
{buttonText}
|
|
33
|
+
</button>
|
|
34
|
+
) : null}
|
|
35
|
+
</div>
|
|
36
|
+
{path ? (
|
|
37
|
+
<img
|
|
38
|
+
src={path}
|
|
39
|
+
alt="trump-image"
|
|
40
|
+
loading="lazy"
|
|
41
|
+
className={imageClassNames()}
|
|
42
|
+
/>
|
|
43
|
+
) : null}
|
|
44
|
+
</Card>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { cn } from "../../util";
|
|
2
|
+
import { CardProps } from "../../interface/Card";
|
|
3
|
+
|
|
4
|
+
const widthSize = {
|
|
5
|
+
xs: "w-full md:w-60",
|
|
6
|
+
sm: "w-full md:w-90",
|
|
7
|
+
md: "w-full md:w-112.5",
|
|
8
|
+
lg: "w-full md:w-127.5",
|
|
9
|
+
xl: "w-full lg:w-187.5",
|
|
10
|
+
"2xl": "w-full lg:w-247.5",
|
|
11
|
+
full: "w-full",
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const heightSize: Record<string, string> = {
|
|
15
|
+
xs: "min-h-16",
|
|
16
|
+
sm: "h-72 sm:h-48",
|
|
17
|
+
md: "h-72 sm:h-48",
|
|
18
|
+
lg: "h-80",
|
|
19
|
+
xl: "h-125",
|
|
20
|
+
"2xl": "",
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export function Card({ children, options }: CardProps) {
|
|
24
|
+
const { boundary, rounded, height, width, text, onClick } = options ?? {};
|
|
25
|
+
const { size: textSize, color: textColor } = text ?? {};
|
|
26
|
+
|
|
27
|
+
const setBoundary = () => {
|
|
28
|
+
if (boundary === "shadow") return "box-shadow";
|
|
29
|
+
if (boundary === "border") return "border-2";
|
|
30
|
+
if (boundary === "none") return "";
|
|
31
|
+
return "box-shadow";
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const sizes = [
|
|
35
|
+
`${heightSize[height ?? "sm"]}`,
|
|
36
|
+
`${widthSize[width ?? "sm"]}`,
|
|
37
|
+
].join(" ");
|
|
38
|
+
|
|
39
|
+
const positions = "relative";
|
|
40
|
+
const styles = [
|
|
41
|
+
`${onClick ? "cursor-pointer" : ""}`,
|
|
42
|
+
`text-${textSize ?? "base"}`,
|
|
43
|
+
setBoundary(),
|
|
44
|
+
`rounded-${rounded ?? "xl"}`,
|
|
45
|
+
`bg-white/80 duration-500 overflow-hidden`,
|
|
46
|
+
].join(" ");
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<div onClick={onClick} className={cn(sizes, positions, styles)}>
|
|
50
|
+
{children}
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { cn } from "../util";
|
|
2
|
+
|
|
3
|
+
export function Deck<T extends string | number>({
|
|
4
|
+
children,
|
|
5
|
+
titles,
|
|
6
|
+
options,
|
|
7
|
+
}: {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
titles?: {
|
|
10
|
+
title: string;
|
|
11
|
+
subTitle?: string;
|
|
12
|
+
gapTitle?: number;
|
|
13
|
+
};
|
|
14
|
+
options?: {
|
|
15
|
+
overflowScroll?: boolean;
|
|
16
|
+
width?: T;
|
|
17
|
+
height?: number;
|
|
18
|
+
gapX?: number;
|
|
19
|
+
gapY?: number;
|
|
20
|
+
};
|
|
21
|
+
}) {
|
|
22
|
+
const { title, subTitle, gapTitle } = titles ?? {};
|
|
23
|
+
const { height, gapX, gapY, overflowScroll } = options ?? {};
|
|
24
|
+
|
|
25
|
+
const container = {
|
|
26
|
+
positions: `flex flex-col gap-${gapTitle ?? 4}`,
|
|
27
|
+
sizes: `sm:w-full h-${height ?? "auto"} `,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const body = {
|
|
31
|
+
positions: `flex flex-col sm:flex-row sm:w-full gap-x-${
|
|
32
|
+
gapX ?? 7.5
|
|
33
|
+
} gap-y-${gapY ?? 5}`,
|
|
34
|
+
styles: `${overflowScroll ? "overflow-x-scroll" : ""} duration-500`,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<div className={cn(container.positions, container.sizes)}>
|
|
39
|
+
<div className="pl-1">
|
|
40
|
+
<div className="text-xl xl:text-2xl font-bold">{title}</div>
|
|
41
|
+
<div className="">{subTitle}</div>
|
|
42
|
+
</div>
|
|
43
|
+
<div className={cn(body.positions, body.styles)}>{children}</div>
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Deck";
|
|
1
|
+
export * from "./Deck";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "./globals.css";
|
|
2
|
-
export * from "./board";
|
|
3
|
-
export * from "./card";
|
|
4
|
-
export * from "./deck";
|
|
5
|
-
export * from "./layout";
|
|
6
|
-
export * from "./interaction";
|
|
7
|
-
export * from "./menu";
|
|
8
|
-
export * from "./modal";
|
|
9
|
-
export * from "./navigation";
|
|
10
|
-
export * from "./shelf";
|
|
11
|
-
export * from "./text";
|
|
1
|
+
import "./globals.css";
|
|
2
|
+
export * from "./board";
|
|
3
|
+
export * from "./card";
|
|
4
|
+
export * from "./deck";
|
|
5
|
+
export * from "./layout";
|
|
6
|
+
export * from "./interaction";
|
|
7
|
+
export * from "./menu";
|
|
8
|
+
export * from "./modal";
|
|
9
|
+
export * from "./navigation";
|
|
10
|
+
export * from "./shelf";
|
|
11
|
+
export * from "./text";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ExceptionProps } from "../interface/Interaction";
|
|
2
|
+
|
|
3
|
+
export default function Exception({ exceptions, children }: ExceptionProps) {
|
|
4
|
+
if (!exceptions) return <>{children}</>;
|
|
5
|
+
const trueComponents = exceptions
|
|
6
|
+
.filter(([exception]) => exception)
|
|
7
|
+
.map(([, component]) => component);
|
|
8
|
+
|
|
9
|
+
return <>{trueComponents.length > 0 ? trueComponents : children}</>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// NOTE: This is Prototype code and should be replaced with a proper loading spinner
|
|
2
|
+
export default function LoadingSpinner() {
|
|
3
|
+
return (
|
|
4
|
+
<div className="w-full h-full flex items-center justify-center">
|
|
5
|
+
<div className="h-16 w-16 animate-spin rounded-full border-6 border-black border-r-transparent flex justify-center items-center">
|
|
6
|
+
<div className="h-12 w-12 animate-spin rounded-full border-6 border-red-500 border-r-transparent " />
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as Exception } from "./Exception";
|
|
2
|
-
export { default as LoadingSpinner } from "./LoadingSpinner";
|
|
1
|
+
export { default as Exception } from "./Exception";
|
|
2
|
+
export { default as LoadingSpinner } from "./LoadingSpinner";
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Dispatch } from "react";
|
|
2
|
+
import { Button, Size } from "./Property";
|
|
3
|
+
|
|
4
|
+
interface OptionsProps {
|
|
5
|
+
color?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface WidgetsProps {
|
|
9
|
+
exceptions?: [boolean, React.ReactNode][];
|
|
10
|
+
components?: [boolean | string, React.ReactNode][];
|
|
11
|
+
tabs?: Button[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface BoardProps {
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
widgets?: WidgetsProps;
|
|
17
|
+
options?: OptionsProps;
|
|
18
|
+
}
|
|
19
|
+
export interface BoardHeaderProps {
|
|
20
|
+
title?: string;
|
|
21
|
+
tags?: {
|
|
22
|
+
selects?: {
|
|
23
|
+
title: string;
|
|
24
|
+
onChange: Dispatch<string>;
|
|
25
|
+
options: [string | number, string][];
|
|
26
|
+
width?: Size;
|
|
27
|
+
}[];
|
|
28
|
+
inputs?: {
|
|
29
|
+
title: string;
|
|
30
|
+
onChange: Dispatch<string>;
|
|
31
|
+
placeholder: string;
|
|
32
|
+
width?: Size;
|
|
33
|
+
}[];
|
|
34
|
+
};
|
|
35
|
+
options?: {
|
|
36
|
+
colors?: { bgColor?: string; textColor?: string };
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface ManageBoardProps<T> extends BoardProps {
|
|
41
|
+
data: {
|
|
42
|
+
dataSets: {
|
|
43
|
+
title?: string;
|
|
44
|
+
items: T[] | undefined;
|
|
45
|
+
renderItem: (items: T) => React.ReactNode;
|
|
46
|
+
}[];
|
|
47
|
+
dataField?: {
|
|
48
|
+
fields: Record<string, string>;
|
|
49
|
+
sizes: Record<string, string>;
|
|
50
|
+
};
|
|
51
|
+
gap?: number;
|
|
52
|
+
};
|
|
53
|
+
header?: BoardHeaderProps;
|
|
54
|
+
widgets?: { menu?: React.ReactNode } & WidgetsProps;
|
|
55
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ImageSize, Size } from "./Property";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CardProps is an interface.
|
|
5
|
+
* @interface CardProps
|
|
6
|
+
* @property {React.ReactNode} children
|
|
7
|
+
* @property {object} options
|
|
8
|
+
* @property {Size} options.height
|
|
9
|
+
* @property {Size} options.width
|
|
10
|
+
* @property {object} options.text
|
|
11
|
+
* @property {string} options.text.size
|
|
12
|
+
* @property {string} options.text.color
|
|
13
|
+
* @property {() => unknown | (() => Promise<unknown>)} options.onClick
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
export interface CardProps {
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
options?: {
|
|
19
|
+
boundary?: "shadow" | "border" | "none";
|
|
20
|
+
rounded?: string;
|
|
21
|
+
height?: Size;
|
|
22
|
+
width?: Size;
|
|
23
|
+
text?: { size?: string; color?: string };
|
|
24
|
+
onClick?: () => unknown | (() => Promise<unknown>);
|
|
25
|
+
overflow?: "hiden" | "auto";
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ChartCardProps {
|
|
30
|
+
data: Record<string, string | number>[];
|
|
31
|
+
xAxis: string;
|
|
32
|
+
yAxis: string;
|
|
33
|
+
lines?: { dataKey: string; stroke: string }[];
|
|
34
|
+
bars?: { dataKey: string; fill: string }[];
|
|
35
|
+
areas?: { dataKey: string; fill: string }[];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface TableCardProps {
|
|
39
|
+
data: Record<string, string | number>[];
|
|
40
|
+
fields: Record<string, string>;
|
|
41
|
+
sizes: Record<string, string>;
|
|
42
|
+
options?: {
|
|
43
|
+
color?: {
|
|
44
|
+
background: string;
|
|
45
|
+
text: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface TrumpCardProps {
|
|
51
|
+
titles: {
|
|
52
|
+
title: string;
|
|
53
|
+
subTitle?: string[];
|
|
54
|
+
color?: string;
|
|
55
|
+
};
|
|
56
|
+
options?: {
|
|
57
|
+
width?: Size;
|
|
58
|
+
image?: { path: string; size?: ImageSize };
|
|
59
|
+
onClick?: () => unknown | (() => Promise<unknown>);
|
|
60
|
+
subButton?: [string, string, () => unknown | (() => Promise<unknown>)];
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface InfoCardProps {
|
|
65
|
+
type: "information" | "profile" | "prpfileSmall";
|
|
66
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Dispatch } from "react";
|
|
2
|
+
import { Size } from "./Property";
|
|
3
|
+
|
|
4
|
+
export type HTMLElementType = "text" | "input" | "select";
|
|
5
|
+
|
|
6
|
+
export interface HTMLElement {
|
|
7
|
+
title: string;
|
|
8
|
+
onChange: Dispatch<string>;
|
|
9
|
+
width?: Size;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface HTMLElementSetting {
|
|
13
|
+
[key: string]: {
|
|
14
|
+
label: string;
|
|
15
|
+
type: HTMLElementType;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
options?: [string, string][];
|
|
18
|
+
onChnage?: Dispatch<string>;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface HTMLSelectElement extends HTMLElement {
|
|
23
|
+
selectOptions?: [string | number, string][];
|
|
24
|
+
}
|
|
25
|
+
export interface HTMLInputElement extends HTMLElement {
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Button, Scripts, Size } from "./Property";
|
|
2
|
+
|
|
3
|
+
export interface ModalProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
options?: {
|
|
6
|
+
width?: Size;
|
|
7
|
+
height?: Size;
|
|
8
|
+
padding?: boolean;
|
|
9
|
+
buttons?: Button[];
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface AlertModalProps {
|
|
14
|
+
title: string;
|
|
15
|
+
scripts: Scripts;
|
|
16
|
+
options?: {
|
|
17
|
+
buttons?: Button[];
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -1,34 +1,46 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Size type
|
|
3
|
-
* @enum {string}
|
|
4
|
-
* @readonly
|
|
5
|
-
* @description - Size type for the component
|
|
6
|
-
* @property {"xs"} xs - Extra small size
|
|
7
|
-
* @property {"sm"} sm - Small size
|
|
8
|
-
* @property {"md"} md - Medium size
|
|
9
|
-
* @property {"lg"} lg - Large size
|
|
10
|
-
* @property {"xl"} xl - Extra large size
|
|
11
|
-
* @property {"2xl"} 2xl - Double extra large size
|
|
12
|
-
* @property {"full"} full - Full size
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
* @
|
|
20
|
-
* @
|
|
21
|
-
* @
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export type
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export type
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Size type
|
|
3
|
+
* @enum {string}
|
|
4
|
+
* @readonly
|
|
5
|
+
* @description - Size type for the component
|
|
6
|
+
* @property {"xs"} xs - Extra small size
|
|
7
|
+
* @property {"sm"} sm - Small size
|
|
8
|
+
* @property {"md"} md - Medium size
|
|
9
|
+
* @property {"lg"} lg - Large size
|
|
10
|
+
* @property {"xl"} xl - Extra large size
|
|
11
|
+
* @property {"2xl"} 2xl - Double extra large size
|
|
12
|
+
* @property {"full"} full - Full size
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export type Size = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Image size type
|
|
19
|
+
* @enum {string}
|
|
20
|
+
* @readonly
|
|
21
|
+
* @description - Size type for the image
|
|
22
|
+
* @property {"sub"} sub - Sub size
|
|
23
|
+
* @property {"full"} full - Full size
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
export type ImageSize = "sub" | "full";
|
|
27
|
+
|
|
28
|
+
export type OnClick = () => unknown | Promise<unknown>;
|
|
29
|
+
|
|
30
|
+
export type Button = [string, OnClick];
|
|
31
|
+
|
|
32
|
+
export type Scripts = {
|
|
33
|
+
script: string;
|
|
34
|
+
subScript?: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type Titles = {
|
|
38
|
+
title: string;
|
|
39
|
+
subTitle?: string[];
|
|
40
|
+
color?: string;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export interface Log<K extends string, T extends string | number> {
|
|
44
|
+
prints: K[];
|
|
45
|
+
logs: { [p in K]: T }[] | undefined;
|
|
46
|
+
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
1
|
+
export * from "./HTMLElement";
|
|
2
|
+
export * from "./Property";
|
|
3
|
+
export * from "./Widget";
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import "../../globals.css";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { circle, cn } from "../../util";
|
|
4
|
+
|
|
5
|
+
export function Header({
|
|
6
|
+
title,
|
|
7
|
+
image,
|
|
8
|
+
}: {
|
|
9
|
+
title: string;
|
|
10
|
+
image?: [string, string];
|
|
11
|
+
}) {
|
|
12
|
+
const [isOpen, setIsOpen] = useState<boolean>(false);
|
|
13
|
+
const [src, href] = image ?? [];
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<div className="fixed top-0 left-0 xl:relative flex h-20 w-full items-center justify-between bg-white px-9 shadow-black/10 shadow-b-md z-40">
|
|
17
|
+
<div className="flex h-12 items-center gap-12">
|
|
18
|
+
{src && href ? (
|
|
19
|
+
<a href={href}>
|
|
20
|
+
<img src={src} alt="logo" className="h-12 w-50" />
|
|
21
|
+
</a>
|
|
22
|
+
) : (
|
|
23
|
+
<div className="text-2xl">TOSEL</div>
|
|
24
|
+
)}
|
|
25
|
+
<div className="text-3xl font-bold ">{title}</div>
|
|
26
|
+
</div>
|
|
27
|
+
{/* <div className="relative">
|
|
28
|
+
<button
|
|
29
|
+
onClick={() => setIsOpen(!isOpen)}
|
|
30
|
+
className={circle(9) + "border-2"}
|
|
31
|
+
>
|
|
32
|
+
+
|
|
33
|
+
</button>
|
|
34
|
+
<Menu flag={isOpen} />
|
|
35
|
+
</div> */}
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function Menu({ flag }: { flag: boolean }) {
|
|
41
|
+
const positions = "absolute right-0 z-40 ";
|
|
42
|
+
const layouts = "w-48 overflow-hidden";
|
|
43
|
+
const styles = "shadow-md bg-white";
|
|
44
|
+
|
|
45
|
+
const animations = () => {
|
|
46
|
+
const height = flag ? "h-80" : "h-0";
|
|
47
|
+
return [height, "duration-500"].join(" ");
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<div className={cn(positions, layouts, styles, animations())}>
|
|
52
|
+
<div>ㅎㅇ</div>
|
|
53
|
+
<div>ㅎㅇ</div>
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
}
|