@edu-tosel/design 1.0.6 → 1.0.8
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/README.md +0 -20
- package/{src/board/index.tsx → board/index.d.ts} +3 -4
- package/board/index.js +3 -0
- package/board/template/CanvasBoard.d.ts +2 -0
- package/board/template/CanvasBoard.js +10 -0
- package/board/template/ManageBoard.d.ts +4 -0
- package/board/template/ManageBoard.js +27 -0
- package/board/widget/Board.d.ts +2 -0
- package/board/widget/Board.js +16 -0
- package/board/widget/DataField.d.ts +6 -0
- package/board/widget/DataField.js +24 -0
- package/board/widget/Header.d.ts +2 -0
- package/board/widget/Header.js +22 -0
- package/board/widget/Tab.d.ts +4 -0
- package/board/widget/Tab.js +17 -0
- package/board/widget/Tags.d.ts +3 -0
- package/board/widget/Tags.js +30 -0
- package/{src/card/index.tsx → card/index.d.ts} +6 -6
- package/card/index.js +6 -0
- package/card/template/ChartCard.d.ts +2 -0
- package/card/template/ChartCard.js +6 -0
- package/card/template/InfoCard.d.ts +2 -0
- package/card/template/InfoCard.js +6 -0
- package/card/template/ProfileCard.d.ts +14 -0
- package/card/template/ProfileCard.js +8 -0
- package/card/template/RowCard.d.ts +5 -0
- package/card/template/RowCard.js +26 -0
- package/card/template/TableCard.d.ts +2 -0
- package/card/template/TableCard.js +12 -0
- package/card/template/TrumpCard.d.ts +2 -0
- package/card/template/TrumpCard.js +19 -0
- package/card/widget/Card.d.ts +2 -0
- package/card/widget/Card.js +45 -0
- package/deck/Deck.d.ts +16 -0
- package/deck/Deck.js +15 -0
- package/{src/deck/index.tsx → deck/index.d.ts} +1 -1
- package/deck/index.js +1 -0
- package/{src/index.tsx → index.d.ts} +11 -11
- package/index.js +11 -0
- package/interaction/index.d.ts +4 -0
- package/interaction/index.js +4 -0
- package/interaction/template/Exception.d.ts +2 -0
- package/interaction/template/Exception.js +9 -0
- package/interaction/widget/LoadingJumper.d.ts +1 -0
- package/interaction/widget/LoadingJumper.js +4 -0
- package/interaction/widget/LoadingSpinner.d.ts +1 -0
- package/interaction/widget/LoadingSpinner.js +5 -0
- package/interaction/widget/NoData.d.ts +1 -0
- package/interaction/widget/NoData.js +4 -0
- package/interface/Board.d.ts +57 -0
- package/interface/Board.js +1 -0
- package/interface/Card.d.ts +76 -0
- package/interface/Card.js +1 -0
- package/{src/interface/HTMLElement.ts → interface/HTMLElement.d.ts} +23 -27
- package/interface/HTMLElement.js +1 -0
- package/interface/Interaction.d.ts +5 -0
- package/interface/Interaction.js +1 -0
- package/interface/Menu.d.ts +6 -0
- package/interface/Menu.js +1 -0
- package/interface/Modal.d.ts +18 -0
- package/interface/Modal.js +1 -0
- package/{src/interface/Property.ts → interface/Property.d.ts} +40 -46
- package/interface/Property.js +14 -0
- package/interface/Widget.d.ts +4 -0
- package/interface/Widget.js +1 -0
- package/{src/interface/index.ts → interface/index.d.ts} +3 -3
- package/interface/index.js +3 -0
- package/layout/dashboard/Header.d.ts +5 -0
- package/layout/dashboard/Header.js +19 -0
- package/layout/dashboard/index.d.ts +7 -0
- package/layout/dashboard/index.js +10 -0
- package/{src/layout/index.tsx → layout/index.d.ts} +1 -1
- package/layout/index.js +1 -0
- package/menu/index.d.ts +1 -0
- package/menu/index.js +1 -0
- package/menu/template/SideMenu.d.ts +2 -0
- package/menu/template/SideMenu.js +20 -0
- package/menu/widget/HTMLElement.d.ts +8 -0
- package/menu/widget/HTMLElement.js +9 -0
- package/modal/AlertModal.d.ts +2 -0
- package/modal/AlertModal.js +8 -0
- package/modal/ControllerModal.d.ts +6 -0
- package/modal/ControllerModal.js +6 -0
- package/modal/Modal.d.ts +2 -0
- package/modal/Modal.js +31 -0
- package/modal/TestModal.d.ts +8 -0
- package/modal/TestModal.js +6 -0
- package/{src/modal/index.tsx → modal/index.d.ts} +3 -3
- package/modal/index.js +3 -0
- package/navigation/Navigation.d.ts +5 -0
- package/navigation/Navigation.js +24 -0
- package/{src/navigation/index.tsx → navigation/index.d.ts} +1 -1
- package/navigation/index.js +1 -0
- package/package.json +28 -49
- package/shelf/Shelf.d.ts +4 -0
- package/shelf/Shelf.js +4 -0
- package/{src/shelf/index.tsx → shelf/index.d.ts} +1 -1
- package/shelf/index.js +1 -0
- package/store/index.d.ts +16 -0
- package/store/index.js +39 -0
- package/text/LineBreaks.d.ts +4 -0
- package/text/LineBreaks.js +5 -0
- package/{src/text/index.tsx → text/index.d.ts} +1 -1
- package/text/index.js +1 -0
- package/util/classNames.d.ts +1 -0
- package/util/classNames.js +4 -0
- package/util/colors.d.ts +10 -0
- package/util/colors.js +10 -0
- package/util/display.d.ts +25 -0
- package/util/display.js +25 -0
- package/util/displayResponsive.d.ts +3 -0
- package/util/displayResponsive.js +15 -0
- package/{src/util/index.ts → util/index.d.ts} +7 -7
- package/util/index.js +7 -0
- package/util/pattern.d.ts +7 -0
- package/util/pattern.js +15 -0
- package/util/position.d.ts +14 -0
- package/util/position.js +44 -0
- package/util/shape.d.ts +1 -0
- package/util/shape.js +3 -0
- package/version.txt +1 -0
- package/.eslintrc.cjs +0 -17
- package/Dockerfile +0 -16
- package/LICENCE +0 -19
- package/docs/README.md +0 -47
- package/index.html +0 -13
- package/postcss.config.js +0 -6
- 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 +0 -1
- package/setupPackage.js +0 -78
- package/src/App.tsx +0 -32
- package/src/_components/asset/interface.ts +0 -2
- package/src/_components/asset/links.ts +0 -17
- package/src/_components/asset/mock/academies.ts +0 -52
- package/src/_components/asset/mock/chartData.ts +0 -104
- package/src/_components/asset/mock/exams.ts +0 -42
- package/src/_components/asset/mock/index.ts +0 -2
- package/src/_components/asset/mock/people.ts +0 -291
- package/src/_components/asset/mock/test.ts +0 -67
- package/src/_components/asset/navigation.ts +0 -17
- package/src/_components/asset/people.ts +0 -226
- package/src/_components/asset/planets.ts +0 -49
- package/src/_components/controller/store.ts +0 -11
- package/src/_components/hook/useRoute.ts +0 -47
- package/src/_components/hook/useTyping.ts +0 -46
- package/src/_components/types/Level.ts +0 -1
- package/src/_components/view/Explore.tsx +0 -16
- package/src/_components/view/Home.tsx +0 -180
- package/src/_components/view/LottiePlayer.tsx +0 -17
- package/src/app/admin/exam/page.tsx +0 -36
- package/src/app/admin/grade/page.tsx +0 -5
- package/src/app/admin/layout.tsx +0 -56
- package/src/app/admin/news/page.tsx +0 -15
- package/src/app/admin/page.tsx +0 -42
- package/src/app/admin/rnd/monthly-test/page.tsx +0 -5
- package/src/app/admin/rnd/page.tsx +0 -17
- package/src/app/admin/statistics/page.tsx +0 -5
- package/src/app/admin/user/page.tsx +0 -147
- package/src/app/agency/exam/page.tsx +0 -5
- package/src/app/agency/group/page.tsx +0 -5
- package/src/app/agency/layout.tsx +0 -55
- package/src/app/agency/page.tsx +0 -68
- package/src/app/agency/sales/page.tsx +0 -5
- package/src/app/convention/page.tsx +0 -58
- package/src/app/page.tsx +0 -4
- 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/src/board/template/CanvasBoard.tsx +0 -17
- package/src/board/template/ManageBoard.tsx +0 -56
- package/src/board/widget/Board.tsx +0 -28
- package/src/board/widget/DataField.tsx +0 -70
- package/src/board/widget/Header.tsx +0 -63
- package/src/board/widget/Tab.tsx +0 -36
- package/src/board/widget/Tags.tsx +0 -81
- package/src/card/template/ChartCard.tsx +0 -42
- package/src/card/template/InfoCard.tsx +0 -22
- package/src/card/template/ProfileCard.tsx +0 -36
- package/src/card/template/RowCard.tsx +0 -91
- package/src/card/template/TableCard.tsx +0 -41
- package/src/card/template/TrumpCard.tsx +0 -46
- package/src/card/widget/Card.tsx +0 -53
- package/src/deck/Deck.tsx +0 -46
- package/src/interaction/Exception.tsx +0 -10
- package/src/interaction/LoadingSpinner.tsx +0 -10
- package/src/interaction/NoData.tsx +0 -5
- package/src/interaction/index.tsx +0 -2
- package/src/interface/Board.ts +0 -55
- package/src/interface/Card.ts +0 -66
- package/src/interface/Interaction.ts +0 -4
- package/src/interface/Menu.ts +0 -5
- package/src/interface/Modal.ts +0 -19
- package/src/interface/Widget.ts +0 -4
- package/src/layout/dashboard/Header.tsx +0 -56
- package/src/layout/dashboard/index.tsx +0 -38
- package/src/main.tsx +0 -10
- package/src/menu/SideMenu.tsx +0 -104
- package/src/menu/index.tsx +0 -1
- package/src/modal/AlertModal.tsx +0 -24
- package/src/modal/ControllerModal.tsx +0 -17
- package/src/modal/Modal.tsx +0 -66
- package/src/modal/TestModal.tsx +0 -19
- package/src/navigation/Navigation.tsx +0 -37
- package/src/shelf/Shelf.tsx +0 -3
- package/src/store/index.ts +0 -66
- package/src/text/LineBreaks.tsx +0 -13
- package/src/util/classNames.ts +0 -4
- package/src/util/colors.ts +0 -11
- package/src/util/display.ts +0 -31
- package/src/util/displayResponsive.ts +0 -17
- package/src/util/pattern.ts +0 -18
- package/src/util/position.ts +0 -43
- package/src/util/shape.ts +0 -3
- package/src/vite-env.d.ts +0 -1
- package/tsconfig.build.json +0 -42
- package/tsconfig.json +0 -28
- package/tsconfig.node.json +0 -10
- package/vite.config.ts +0 -10
- /package/{public → asset}/fonts/Kostar.ttf +0 -0
- /package/{public → asset}/fonts/Megrim.ttf +0 -0
- /package/{public → asset}/fonts/NicoMoji.ttf +0 -0
- /package/{public → asset}/fonts/Pretendard-Medium.otf +0 -0
- /package/{src/asset → asset}/json/credit-lottie.json +0 -0
- /package/{src/asset → asset}/json/loading-lottie.json +0 -0
- /package/{src/asset → asset}/json/test.svg +0 -0
- /package/{src/globals.css → globals.css} +0 -0
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { cn } from "../../util";
|
|
2
|
-
import { Input, Select } from "./Tags";
|
|
3
|
-
import { BoardHeaderProps } from "./../../interface/Board";
|
|
4
|
-
export default function BoardHeader({
|
|
5
|
-
title,
|
|
6
|
-
tags,
|
|
7
|
-
options,
|
|
8
|
-
}: BoardHeaderProps) {
|
|
9
|
-
const { selects, inputs } = tags ?? {};
|
|
10
|
-
const { colors } = options ?? {};
|
|
11
|
-
const { bgColor, textColor } = colors ?? {
|
|
12
|
-
bgColor: "gray-200",
|
|
13
|
-
textColor: "black",
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const container = {
|
|
17
|
-
positions: "fixed top-20 left-0 xl:static flex items-center",
|
|
18
|
-
paddings: "px-12",
|
|
19
|
-
styles: `bg-${bgColor} text-${textColor} pl-12 pr-9`,
|
|
20
|
-
sizes: "w-full h-20",
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const block = {
|
|
24
|
-
displays: "xl:hidden block ",
|
|
25
|
-
sizes: container.sizes,
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<>
|
|
30
|
-
<div
|
|
31
|
-
className={cn(
|
|
32
|
-
container.positions,
|
|
33
|
-
container.paddings,
|
|
34
|
-
container.sizes,
|
|
35
|
-
container.styles
|
|
36
|
-
)}
|
|
37
|
-
>
|
|
38
|
-
<div className="text-xl font-bold">{title}</div>
|
|
39
|
-
<div className="flex items-center ml-auto gap-4">
|
|
40
|
-
{selects?.map(({ width, title, options, onChange }) => (
|
|
41
|
-
<Select
|
|
42
|
-
key={title}
|
|
43
|
-
width={width}
|
|
44
|
-
title={title}
|
|
45
|
-
selectOptions={options}
|
|
46
|
-
onChange={onChange}
|
|
47
|
-
/>
|
|
48
|
-
))}
|
|
49
|
-
{inputs?.map(({ width, title, placeholder, onChange }) => (
|
|
50
|
-
<Input
|
|
51
|
-
key={title + placeholder}
|
|
52
|
-
width={width}
|
|
53
|
-
title={title}
|
|
54
|
-
placeholder={placeholder}
|
|
55
|
-
onChange={onChange}
|
|
56
|
-
/>
|
|
57
|
-
))}
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
<div className={cn(block.sizes, block.displays)} />
|
|
61
|
-
</>
|
|
62
|
-
);
|
|
63
|
-
}
|
package/src/board/widget/Tab.tsx
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { useState } from "react";
|
|
2
|
-
import { Button } from "../../interface";
|
|
3
|
-
import { cn } from "../../util";
|
|
4
|
-
|
|
5
|
-
export default function Tab({ tabs }: { tabs: Button[] }) {
|
|
6
|
-
const [tabsSelection, setTabsSelection] = useState(
|
|
7
|
-
tabs.map((_, i) => i === 0)
|
|
8
|
-
);
|
|
9
|
-
|
|
10
|
-
const positions = "xl:absolute xl:-bottom-14 xl:left-0 z-5";
|
|
11
|
-
const displays = "hidden xl:flex xl:items-end xl:gap-4";
|
|
12
|
-
const sizes = "xl:h-16";
|
|
13
|
-
const paddings = "xl:px-8 xl:pb-2 ";
|
|
14
|
-
const styles = "bg-white/50 rounded-b-xl ";
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<div className={cn(displays, positions, sizes, paddings, styles)}>
|
|
18
|
-
{tabs.map(([title, onClick], index) => (
|
|
19
|
-
<button
|
|
20
|
-
key={title}
|
|
21
|
-
onClick={() => {
|
|
22
|
-
setTabsSelection(tabsSelection.map((_, i) => i === index));
|
|
23
|
-
return onClick();
|
|
24
|
-
}}
|
|
25
|
-
className={`h-9 w-32 rounded-md ${
|
|
26
|
-
tabsSelection[index]
|
|
27
|
-
? "border-4 border-blue-500"
|
|
28
|
-
: "border-4 border-red-500"
|
|
29
|
-
}`}
|
|
30
|
-
>
|
|
31
|
-
{title}
|
|
32
|
-
</button>
|
|
33
|
-
))}
|
|
34
|
-
</div>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { useId } from "react";
|
|
2
|
-
import {
|
|
3
|
-
HTMLInputElement,
|
|
4
|
-
HTMLSelectElement,
|
|
5
|
-
} from "../../interface/HTMLElement";
|
|
6
|
-
|
|
7
|
-
export function Select({
|
|
8
|
-
title,
|
|
9
|
-
width,
|
|
10
|
-
onChange,
|
|
11
|
-
selectOptions,
|
|
12
|
-
}: HTMLSelectElement) {
|
|
13
|
-
const id = useId();
|
|
14
|
-
|
|
15
|
-
const widthSize = {
|
|
16
|
-
xs: "w-32",
|
|
17
|
-
sm: "w-48",
|
|
18
|
-
md: "w-64",
|
|
19
|
-
lg: "w-96",
|
|
20
|
-
xl: "w-128",
|
|
21
|
-
"2xl": "w-144",
|
|
22
|
-
full: "w-full",
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const classNames = `${widthSize[width ?? "md"]} h-10 rounded-full pl-4`;
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<div className="flex justify-center items-center gap-4">
|
|
29
|
-
<label htmlFor={id} className="font-bold">
|
|
30
|
-
{title}
|
|
31
|
-
</label>
|
|
32
|
-
<select
|
|
33
|
-
id={id}
|
|
34
|
-
onChange={(e) => onChange(e.target.value)}
|
|
35
|
-
className={classNames}
|
|
36
|
-
>
|
|
37
|
-
{selectOptions?.map(([id, title]) => (
|
|
38
|
-
<option key={id} value={id}>
|
|
39
|
-
{title}
|
|
40
|
-
</option>
|
|
41
|
-
))}
|
|
42
|
-
</select>
|
|
43
|
-
</div>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export function Input({
|
|
48
|
-
title,
|
|
49
|
-
onChange,
|
|
50
|
-
placeholder,
|
|
51
|
-
width,
|
|
52
|
-
}: HTMLInputElement) {
|
|
53
|
-
const id = useId();
|
|
54
|
-
|
|
55
|
-
const widthSize = {
|
|
56
|
-
xs: "w-28",
|
|
57
|
-
sm: "w-48",
|
|
58
|
-
md: "w-64",
|
|
59
|
-
lg: "w-96",
|
|
60
|
-
xl: "w-128",
|
|
61
|
-
"2xl": "w-144",
|
|
62
|
-
full: "w-full",
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const classNames = `${widthSize[width ?? "md"]} h-10 rounded-full pl-4`;
|
|
66
|
-
|
|
67
|
-
return (
|
|
68
|
-
<div className="flex justify-center items-center gap-4">
|
|
69
|
-
<label htmlFor={id} className="font-bold">
|
|
70
|
-
{title}
|
|
71
|
-
</label>
|
|
72
|
-
<input
|
|
73
|
-
className={classNames}
|
|
74
|
-
id={id}
|
|
75
|
-
type="text"
|
|
76
|
-
placeholder={placeholder ?? ""}
|
|
77
|
-
onChange={(e) => onChange(e.target.value)}
|
|
78
|
-
/>
|
|
79
|
-
</div>
|
|
80
|
-
);
|
|
81
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Area,
|
|
3
|
-
Bar,
|
|
4
|
-
ComposedChart,
|
|
5
|
-
Line,
|
|
6
|
-
ResponsiveContainer,
|
|
7
|
-
Tooltip,
|
|
8
|
-
XAxis,
|
|
9
|
-
YAxis,
|
|
10
|
-
} from "recharts";
|
|
11
|
-
import { Card } from "../widget/Card";
|
|
12
|
-
import { ChartCardProps } from "../../interface/Card";
|
|
13
|
-
|
|
14
|
-
export default function ChartCard({
|
|
15
|
-
data,
|
|
16
|
-
xAxis,
|
|
17
|
-
yAxis,
|
|
18
|
-
lines,
|
|
19
|
-
bars,
|
|
20
|
-
areas,
|
|
21
|
-
}: ChartCardProps) {
|
|
22
|
-
return (
|
|
23
|
-
<Card options={{ width: "xl", height: "lg", text: { size: "xs" } }}>
|
|
24
|
-
<ResponsiveContainer width="100%" height="100%">
|
|
25
|
-
<ComposedChart data={data}>
|
|
26
|
-
<XAxis dataKey={xAxis} />
|
|
27
|
-
<YAxis dataKey={yAxis} />
|
|
28
|
-
<Tooltip />
|
|
29
|
-
{lines?.map((line) => (
|
|
30
|
-
<Line key={line.dataKey} {...line} />
|
|
31
|
-
))}
|
|
32
|
-
{bars?.map((bar) => (
|
|
33
|
-
<Bar key={bar.dataKey} {...bar} />
|
|
34
|
-
))}
|
|
35
|
-
{areas?.map((area) => (
|
|
36
|
-
<Area key={area.dataKey} {...area} />
|
|
37
|
-
))}
|
|
38
|
-
</ComposedChart>
|
|
39
|
-
</ResponsiveContainer>
|
|
40
|
-
</Card>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Deck } from "../..";
|
|
2
|
-
import { InfoCardProps } from "../../interface/Card";
|
|
3
|
-
import { Card } from "../widget/Card";
|
|
4
|
-
|
|
5
|
-
export default function InfoCard({ type }: InfoCardProps) {
|
|
6
|
-
return (
|
|
7
|
-
<Deck>
|
|
8
|
-
<Card options={{ width: "xs", height: "lg" }}>
|
|
9
|
-
<div className="p-5">
|
|
10
|
-
<div>{type}</div>
|
|
11
|
-
<div>{}</div>
|
|
12
|
-
</div>
|
|
13
|
-
</Card>
|
|
14
|
-
<Card options={{ width: "md" }}>
|
|
15
|
-
<div className="p-5">
|
|
16
|
-
<div>{type}</div>
|
|
17
|
-
<div>{}</div>
|
|
18
|
-
</div>
|
|
19
|
-
</Card>
|
|
20
|
-
</Deck>
|
|
21
|
-
);
|
|
22
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Card } from "../widget/Card";
|
|
2
|
-
import { center, between, colorsByLevel } from "../../util";
|
|
3
|
-
type Level = "PS" | "ST" | "BA" | "JR" | "HJ";
|
|
4
|
-
|
|
5
|
-
export default function ProfileCard({
|
|
6
|
-
info,
|
|
7
|
-
gradeData,
|
|
8
|
-
}: {
|
|
9
|
-
info: { name: string; birthday: string; image?: string };
|
|
10
|
-
gradeData?: { level?: Level; score?: number; grade?: number };
|
|
11
|
-
}) {
|
|
12
|
-
const { name, birthday, image } = info;
|
|
13
|
-
const { level, score, grade } = gradeData ?? {};
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<Card options={{ width: "sm" }}>
|
|
17
|
-
<div className="flex">
|
|
18
|
-
<img
|
|
19
|
-
src={image}
|
|
20
|
-
alt="profile"
|
|
21
|
-
className="h-20 w-20 overflow-hidden rounded-full object-cover "
|
|
22
|
-
/>
|
|
23
|
-
<div className="ml-auto flex flex-col gap-4">
|
|
24
|
-
<div className="flex w-52 items-end gap-2 border-b-2 border-blue-navy pb-2">
|
|
25
|
-
<div className="text-xl font-bold">{name}</div>
|
|
26
|
-
<div>{birthday}</div>
|
|
27
|
-
</div>
|
|
28
|
-
<div>
|
|
29
|
-
<div>학원생</div>
|
|
30
|
-
<div>{level ? colorsByLevel[level] : ""}</div>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
</Card>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
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
|
-
}
|
package/src/card/widget/Card.tsx
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
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
|
-
}
|
package/src/deck/Deck.tsx
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
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,10 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
-
}
|
package/src/interface/Board.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
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
|
-
}
|