@edu-tosel/design 1.0.5 → 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/NoData.d.ts +0 -1
- package/interaction/NoData.js +0 -4
- 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
package/vite.config.ts
ADDED
package/board/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "../../util";
|
|
3
|
-
import { Board } from "../widget/Board";
|
|
4
|
-
export default function CanvasBoard({ children, options }) {
|
|
5
|
-
const layouts = "flex flex-col lg:flex-row lg:flex-wrap gap-7.5 ";
|
|
6
|
-
const sizes = "h-full ";
|
|
7
|
-
const paddings = "pb-36 xl:pb-0 px-2 xs:px-4 xl:pl-8 xl:pr-2 pt-2 xs:pt-4 xl:pt-8";
|
|
8
|
-
const styles = "overflow-y-scroll ";
|
|
9
|
-
return (_jsx(Board, { options: options, children: _jsx("div", { className: cn(layouts, sizes, paddings, styles), children: children }) }));
|
|
10
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Deck } from "../../deck";
|
|
3
|
-
import { SideMenu } from "../../menu";
|
|
4
|
-
import { cn } from "../../util";
|
|
5
|
-
import { Board } from "../widget/Board";
|
|
6
|
-
import BoardHeader from "../widget/Header";
|
|
7
|
-
import BoardDataField from "../widget/DataField";
|
|
8
|
-
import { useWidgetStore } from "../../store";
|
|
9
|
-
import { Exception } from "../../interaction";
|
|
10
|
-
export default function ManageBoard({ header, data, widgets, }) {
|
|
11
|
-
const { order: [orderBy, orderHow], } = useWidgetStore();
|
|
12
|
-
const { dataSets, dataField, gap } = data;
|
|
13
|
-
const positions = `flex flex-col gap-${gap ?? 0}`;
|
|
14
|
-
const sizes = `h-full ${dataField ? "xl:h-135" : "xl:h-158"}`;
|
|
15
|
-
const paddings = "pb-60 xl:pb-0 px-2 xs:px-4 xl:px-8";
|
|
16
|
-
const styles = "overflow-y-scroll";
|
|
17
|
-
return (_jsxs(Board, { widgets: widgets, children: [_jsx(BoardHeader, { ...header }), dataField && _jsx(BoardDataField, { dataField: dataField }), _jsx("div", { className: cn(positions, sizes, paddings, styles), children: _jsx(Exception, { exceptions: widgets?.exceptions, children: dataSets.map(({ title: deckTitle, items, renderItem }) => deckTitle ? (_jsx("div", { className: "pt-4", children: _jsx(Deck, { titles: { title: deckTitle ?? "" }, children: items?.map((item) => renderItem(item)) }) }, deckTitle)) : (items
|
|
18
|
-
?.slice()
|
|
19
|
-
.sort((a, b) => {
|
|
20
|
-
if (orderBy) {
|
|
21
|
-
if (orderHow === "asc")
|
|
22
|
-
return a[orderBy] > b[orderBy] ? 1 : -1;
|
|
23
|
-
return a[orderBy] < b[orderBy] ? 1 : -1;
|
|
24
|
-
}
|
|
25
|
-
return 0;
|
|
26
|
-
})
|
|
27
|
-
.map((item) => renderItem(item)))) }) }), widgets?.menu && _jsx(SideMenu, {})] }));
|
|
28
|
-
}
|
package/board/widget/Board.d.ts
DELETED
package/board/widget/Board.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useWidgetStore } from "../../store";
|
|
3
|
-
import Tab from "./Tab";
|
|
4
|
-
export function Board({ children, widgets }) {
|
|
5
|
-
const { events } = useWidgetStore();
|
|
6
|
-
const { components, tabs } = widgets ?? {};
|
|
7
|
-
const classNames = [
|
|
8
|
-
`h-full xl:min-h-0 `,
|
|
9
|
-
"xl:rounded-xl bg-white relative w-full z-10 overflow-hidden",
|
|
10
|
-
].join(" ");
|
|
11
|
-
return (_jsxs("div", { className: "h-full xl:min-h-0 xl:h-178 w-full relative ", children: [_jsxs("div", { className: classNames, children: [children, components?.map(([flag, Component]) => {
|
|
12
|
-
if (typeof flag === "boolean")
|
|
13
|
-
return flag ? _jsx(_Fragment, { children: Component }) : null;
|
|
14
|
-
return events?.some(({ event }) => event === flag) ? (_jsx(_Fragment, { children: Component })) : null;
|
|
15
|
-
})] }), tabs && _jsx(Tab, { tabs: tabs })] }));
|
|
16
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "../../util";
|
|
3
|
-
import { useWidgetStore } from "./../../store";
|
|
4
|
-
export default function BoardDataField({ dataField, }) {
|
|
5
|
-
const { order: [orderBy, orderHow], setOrder, } = useWidgetStore();
|
|
6
|
-
const { fields, sizes } = dataField;
|
|
7
|
-
const container = {
|
|
8
|
-
positions: "fixed top-40 left-0 xl:static",
|
|
9
|
-
displays: "flex items-center",
|
|
10
|
-
styles: `bg-gray-200`,
|
|
11
|
-
sizes: "w-full h-23",
|
|
12
|
-
};
|
|
13
|
-
const dataFieldContainer = {
|
|
14
|
-
displays: "flex items-center",
|
|
15
|
-
sizes: "w-full h-12",
|
|
16
|
-
paddings: "px-2 xs:px-4 xl:pl-8 xl:pr-2 ",
|
|
17
|
-
styles: "bg-white-off",
|
|
18
|
-
};
|
|
19
|
-
const block = {
|
|
20
|
-
displays: "xl:hidden block ",
|
|
21
|
-
sizes: container.sizes,
|
|
22
|
-
};
|
|
23
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { className: cn(container.positions, container.displays, container.sizes, container.styles), children: _jsx("div", { className: cn(dataFieldContainer.displays, dataFieldContainer.sizes, dataFieldContainer.paddings, dataFieldContainer.styles), children: Object.entries(fields).map(([key, value]) => (_jsx("div", { className: `w-${`${sizes[key]}/100`} ?? "auto"}`, children: _jsxs("button", { onClick: () => setOrder(key), className: "flex items-center gap-1", children: [_jsx("div", { children: value }), _jsx("div", { className: "text-xs", children: orderBy === key ? (orderHow === "asc" ? "▼" : "▲") : "" })] }) }, key))) }) }), _jsx("div", { className: cn(block.sizes, block.displays) })] }));
|
|
24
|
-
}
|
package/board/widget/Header.d.ts
DELETED
package/board/widget/Header.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "../../util";
|
|
3
|
-
import { Input, Select } from "./Tags";
|
|
4
|
-
export default function BoardHeader({ title, tags, options, }) {
|
|
5
|
-
const { selects, inputs } = tags ?? {};
|
|
6
|
-
const { colors } = options ?? {};
|
|
7
|
-
const { bgColor, textColor } = colors ?? {
|
|
8
|
-
bgColor: "gray-200",
|
|
9
|
-
textColor: "black",
|
|
10
|
-
};
|
|
11
|
-
const container = {
|
|
12
|
-
positions: "fixed top-20 left-0 xl:static flex items-center",
|
|
13
|
-
paddings: "px-12",
|
|
14
|
-
styles: `bg-${bgColor} text-${textColor} pl-12 pr-9`,
|
|
15
|
-
sizes: "w-full h-20",
|
|
16
|
-
};
|
|
17
|
-
const block = {
|
|
18
|
-
displays: "xl:hidden block ",
|
|
19
|
-
sizes: container.sizes,
|
|
20
|
-
};
|
|
21
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: cn(container.positions, container.paddings, container.sizes, container.styles), children: [_jsx("div", { className: "text-xl font-bold", children: title }), _jsxs("div", { className: "flex items-center ml-auto gap-4", children: [selects?.map(({ width, title, options, onChange }) => (_jsx(Select, { width: width, title: title, selectOptions: options, onChange: onChange }, title))), inputs?.map(({ width, title, placeholder, onChange }) => (_jsx(Input, { width: width, title: title, placeholder: placeholder, onChange: onChange }, title + placeholder)))] })] }), _jsx("div", { className: cn(block.sizes, block.displays) })] }));
|
|
22
|
-
}
|
package/board/widget/Tab.d.ts
DELETED
package/board/widget/Tab.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { cn } from "../../util";
|
|
4
|
-
export default function Tab({ tabs }) {
|
|
5
|
-
const [tabsSelection, setTabsSelection] = useState(tabs.map((_, i) => i === 0));
|
|
6
|
-
const positions = "xl:absolute xl:-bottom-14 xl:left-0 z-5";
|
|
7
|
-
const displays = "hidden xl:flex xl:items-end xl:gap-4";
|
|
8
|
-
const sizes = "xl:h-16";
|
|
9
|
-
const paddings = "xl:px-8 xl:pb-2 ";
|
|
10
|
-
const styles = "bg-white/50 rounded-b-xl ";
|
|
11
|
-
return (_jsx("div", { className: cn(displays, positions, sizes, paddings, styles), children: tabs.map(([title, onClick], index) => (_jsx("button", { onClick: () => {
|
|
12
|
-
setTabsSelection(tabsSelection.map((_, i) => i === index));
|
|
13
|
-
return onClick();
|
|
14
|
-
}, className: `h-9 w-32 rounded-md ${tabsSelection[index]
|
|
15
|
-
? "border-4 border-blue-500"
|
|
16
|
-
: "border-4 border-red-500"}`, children: title }, title))) }));
|
|
17
|
-
}
|
package/board/widget/Tags.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { HTMLInputElement, HTMLSelectElement } from "../../interface/HTMLElement";
|
|
2
|
-
export declare function Select({ title, width, onChange, selectOptions, }: HTMLSelectElement): import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
export declare function Input({ title, onChange, placeholder, width, }: HTMLInputElement): import("react/jsx-runtime").JSX.Element;
|
package/board/widget/Tags.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useId } from "react";
|
|
3
|
-
export function Select({ title, width, onChange, selectOptions, }) {
|
|
4
|
-
const id = useId();
|
|
5
|
-
const widthSize = {
|
|
6
|
-
xs: "w-32",
|
|
7
|
-
sm: "w-48",
|
|
8
|
-
md: "w-64",
|
|
9
|
-
lg: "w-96",
|
|
10
|
-
xl: "w-128",
|
|
11
|
-
"2xl": "w-144",
|
|
12
|
-
full: "w-full",
|
|
13
|
-
};
|
|
14
|
-
const classNames = `${widthSize[width ?? "md"]} h-10 rounded-full pl-4`;
|
|
15
|
-
return (_jsxs("div", { className: "flex justify-center items-center gap-4", children: [_jsx("label", { htmlFor: id, className: "font-bold", children: title }), _jsx("select", { id: id, onChange: (e) => onChange(e.target.value), className: classNames, children: selectOptions?.map(([id, title]) => (_jsx("option", { value: id, children: title }, id))) })] }));
|
|
16
|
-
}
|
|
17
|
-
export function Input({ title, onChange, placeholder, width, }) {
|
|
18
|
-
const id = useId();
|
|
19
|
-
const widthSize = {
|
|
20
|
-
xs: "w-28",
|
|
21
|
-
sm: "w-48",
|
|
22
|
-
md: "w-64",
|
|
23
|
-
lg: "w-96",
|
|
24
|
-
xl: "w-128",
|
|
25
|
-
"2xl": "w-144",
|
|
26
|
-
full: "w-full",
|
|
27
|
-
};
|
|
28
|
-
const classNames = `${widthSize[width ?? "md"]} h-10 rounded-full pl-4`;
|
|
29
|
-
return (_jsxs("div", { className: "flex justify-center items-center gap-4", children: [_jsx("label", { htmlFor: id, className: "font-bold", children: title }), _jsx("input", { className: classNames, id: id, type: "text", placeholder: placeholder ?? "", onChange: (e) => onChange(e.target.value) })] }));
|
|
30
|
-
}
|
package/card/index.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { default as ProfileCard } from "./template/ProfileCard";
|
|
2
|
-
export { default as TrumpCard } from "./template/TrumpCard";
|
|
3
|
-
export { default as ChartCard } from "./template/ChartCard";
|
|
4
|
-
export { default as TableCard } from "./template/TableCard";
|
|
5
|
-
export { default as RowCard } from "./template/RowCard";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Area, Bar, ComposedChart, Line, ResponsiveContainer, Tooltip, XAxis, YAxis, } from "recharts";
|
|
3
|
-
import { Card } from "../widget/Card";
|
|
4
|
-
export default function ChartCard({ data, xAxis, yAxis, lines, bars, areas, }) {
|
|
5
|
-
return (_jsx(Card, { options: { width: "xl", height: "lg", text: { size: "xs" } }, children: _jsx(ResponsiveContainer, { width: "100%", height: "100%", children: _jsxs(ComposedChart, { data: data, children: [_jsx(XAxis, { dataKey: xAxis }), _jsx(YAxis, { dataKey: yAxis }), _jsx(Tooltip, {}), lines?.map((line) => (_jsx(Line, { ...line }, line.dataKey))), bars?.map((bar) => (_jsx(Bar, { ...bar }, bar.dataKey))), areas?.map((area) => (_jsx(Area, { ...area }, area.dataKey)))] }) }) }));
|
|
6
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
type Level = "PS" | "ST" | "BA" | "JR" | "HJ";
|
|
2
|
-
export default function ProfileCard({ info, gradeData, }: {
|
|
3
|
-
info: {
|
|
4
|
-
name: string;
|
|
5
|
-
birthday: string;
|
|
6
|
-
image?: string;
|
|
7
|
-
};
|
|
8
|
-
gradeData?: {
|
|
9
|
-
level?: Level;
|
|
10
|
-
score?: number;
|
|
11
|
-
grade?: number;
|
|
12
|
-
};
|
|
13
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Card } from "../widget/Card";
|
|
3
|
-
import { colorsByLevel } from "../../util";
|
|
4
|
-
export default function ProfileCard({ info, gradeData, }) {
|
|
5
|
-
const { name, birthday, image } = info;
|
|
6
|
-
const { level, score, grade } = gradeData ?? {};
|
|
7
|
-
return (_jsx(Card, { options: { width: "sm" }, children: _jsxs("div", { className: "flex", children: [_jsx("img", { src: image, alt: "profile", className: "h-20 w-20 overflow-hidden rounded-full object-cover " }), _jsxs("div", { className: "ml-auto flex flex-col gap-4", children: [_jsxs("div", { className: "flex w-52 items-end gap-2 border-b-2 border-blue-navy pb-2", children: [_jsx("div", { className: "text-xl font-bold", children: name }), _jsx("div", { children: birthday })] }), _jsxs("div", { children: [_jsx("div", { children: "\uD559\uC6D0\uC0DD" }), _jsx("div", { children: level ? colorsByLevel[level] : "" })] })] })] }) }));
|
|
8
|
-
}
|
package/card/template/RowCard.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Card } from "../widget/Card";
|
|
3
|
-
import { useWidgetStore } from "../../store";
|
|
4
|
-
import { useId, useState } from "react";
|
|
5
|
-
export default function RowCard({ row, fields, sizes, }) {
|
|
6
|
-
const [rowState, setRowState] = useState(row);
|
|
7
|
-
const { setView, setTempData } = useWidgetStore();
|
|
8
|
-
const entries = Object.entries(fields).map(([key, type]) => [type, key, rowState[key]]);
|
|
9
|
-
return (_jsx(Card, { options: {
|
|
10
|
-
width: "full",
|
|
11
|
-
height: "xs",
|
|
12
|
-
boundary: "none",
|
|
13
|
-
rounded: "none",
|
|
14
|
-
}, children: _jsxs("div", { className: "flex items-center h-full", children: [entries.map(([type, key, value]) => (_jsx("div", { className: `w-${`${sizes[key]}/100`} ?? "auto"}`, children: Array.isArray(type) && type[0] === "select" ? (_jsx(Select, { type: type, entry: [key, value], row: rowState, setRow: setRowState }, key + type + value.toString())) : (_jsx("div", { className: "w-full truncate", children: value ?? "No Data" }, key + value.toString())) }, key))), _jsx("button", { onClick: () => {
|
|
15
|
-
setTempData(row);
|
|
16
|
-
setView("sideMenu");
|
|
17
|
-
}, children: "click" })] }) }));
|
|
18
|
-
}
|
|
19
|
-
function Select({ type, entry, row, setRow, }) {
|
|
20
|
-
const id = useId();
|
|
21
|
-
const [key, value] = entry;
|
|
22
|
-
return (_jsx("select", { value: value, onChange: (e) => setRow({
|
|
23
|
-
...row,
|
|
24
|
-
[key]: e.target.value,
|
|
25
|
-
}), children: type[1].map(([value, title]) => (_jsx("option", { value: value, children: title }, id + value))) }, id));
|
|
26
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Card } from "../widget/Card";
|
|
3
|
-
export default function TableCard({ data, fields, sizes, options, }) {
|
|
4
|
-
const { color } = options ?? {};
|
|
5
|
-
const { background: bgColor, text: textColor } = color ?? {};
|
|
6
|
-
const keys = Object.keys(fields);
|
|
7
|
-
const fieldsClassNames = [
|
|
8
|
-
`flex h-11 items-center font-bold pl-4`,
|
|
9
|
-
`bg-${bgColor ?? "gray-300"} text-${textColor ?? "black"}`,
|
|
10
|
-
].join(" ");
|
|
11
|
-
return (_jsx(Card, { options: { width: "lg", height: "lg" }, children: _jsxs("div", { className: "overflow-hidden text-xs xs:text-sm sm:text-base", children: [_jsx("div", { className: fieldsClassNames, children: keys.map((key) => (_jsx("div", { className: `w-${sizes[key]}`, children: fields[key] }, key))) }), data.map((row, index) => (_jsx("div", { className: "flex items-center pl-4 h-11 ", children: keys.map((key) => (_jsx("div", { className: `truncate w-${sizes[key] ?? "auto"}`, children: row[key] }, key))) }, index)))] }) }));
|
|
12
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { LineBreaks } from "../../text";
|
|
3
|
-
import { Card } from "../widget/Card";
|
|
4
|
-
export default function TrumpCard({ titles, options }) {
|
|
5
|
-
const { title, subTitle, color: titleColor } = titles;
|
|
6
|
-
const { onClick, width, image, subButton } = options ?? {};
|
|
7
|
-
const [buttonText, buttonBgColor, buttonAction] = subButton ?? [
|
|
8
|
-
null,
|
|
9
|
-
"red-crimson",
|
|
10
|
-
() => { },
|
|
11
|
-
];
|
|
12
|
-
const { path, size } = image ?? { size: "sub" };
|
|
13
|
-
const imageClassNames = () => {
|
|
14
|
-
if (size === "full")
|
|
15
|
-
return "w-full h-full object-cover";
|
|
16
|
-
return "absolute bottom-0 right-0 w-full xs:w-auto max-w-120 z-0 max-h-44 object-contain";
|
|
17
|
-
};
|
|
18
|
-
return (_jsxs(Card, { options: { width: width ?? "xs", onClick: onClick }, children: [_jsxs("div", { className: `absolute top-8 left-8 w-48 flex flex-col gap-2 z-10 text-${titleColor}`, children: [_jsx("div", { className: "text-xl font-bold", children: title }), _jsx(LineBreaks, { gap: 0, texts: subTitle ?? [""] }), subButton ? (_jsx("button", { className: `text-white rounded-md bg-${buttonBgColor} w-45 h-11 flex justify-center items-center`, onClick: buttonAction, children: buttonText })) : null] }), path ? (_jsx("img", { src: path, alt: "trump-image", loading: "lazy", className: imageClassNames() })) : null] }));
|
|
19
|
-
}
|
package/card/widget/Card.d.ts
DELETED
package/card/widget/Card.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "../../util";
|
|
3
|
-
const widthSize = {
|
|
4
|
-
xs: "w-full md:w-60",
|
|
5
|
-
sm: "w-full md:w-90",
|
|
6
|
-
md: "w-full md:w-112.5",
|
|
7
|
-
lg: "w-full md:w-127.5",
|
|
8
|
-
xl: "w-full lg:w-187.5",
|
|
9
|
-
"2xl": "w-full lg:w-247.5",
|
|
10
|
-
full: "w-full",
|
|
11
|
-
};
|
|
12
|
-
const heightSize = {
|
|
13
|
-
xs: "min-h-16",
|
|
14
|
-
sm: "h-72 sm:h-48",
|
|
15
|
-
md: "h-72 sm:h-48",
|
|
16
|
-
lg: "h-80",
|
|
17
|
-
xl: "h-125",
|
|
18
|
-
"2xl": "",
|
|
19
|
-
};
|
|
20
|
-
export function Card({ children, options }) {
|
|
21
|
-
const { boundary, rounded, height, width, text, onClick } = options ?? {};
|
|
22
|
-
const { size: textSize, color: textColor } = text ?? {};
|
|
23
|
-
const setBoundary = () => {
|
|
24
|
-
if (boundary === "shadow")
|
|
25
|
-
return "box-shadow";
|
|
26
|
-
if (boundary === "border")
|
|
27
|
-
return "border-2";
|
|
28
|
-
if (boundary === "none")
|
|
29
|
-
return "";
|
|
30
|
-
return "box-shadow";
|
|
31
|
-
};
|
|
32
|
-
const sizes = [
|
|
33
|
-
`${heightSize[height ?? "sm"]}`,
|
|
34
|
-
`${widthSize[width ?? "sm"]}`,
|
|
35
|
-
].join(" ");
|
|
36
|
-
const positions = "relative";
|
|
37
|
-
const styles = [
|
|
38
|
-
`${onClick ? "cursor-pointer" : ""}`,
|
|
39
|
-
`text-${textSize ?? "base"}`,
|
|
40
|
-
setBoundary(),
|
|
41
|
-
`rounded-${rounded ?? "xl"}`,
|
|
42
|
-
`bg-white/80 duration-500 overflow-hidden`,
|
|
43
|
-
].join(" ");
|
|
44
|
-
return (_jsx("div", { onClick: onClick, className: cn(sizes, positions, styles), children: children }));
|
|
45
|
-
}
|
package/deck/Deck.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare function Deck<T extends string | number>({ children, titles, options, }: {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
titles?: {
|
|
5
|
-
title: string;
|
|
6
|
-
subTitle?: string;
|
|
7
|
-
gapTitle?: number;
|
|
8
|
-
};
|
|
9
|
-
options?: {
|
|
10
|
-
overflowScroll?: boolean;
|
|
11
|
-
width?: T;
|
|
12
|
-
height?: number;
|
|
13
|
-
gapX?: number;
|
|
14
|
-
gapY?: number;
|
|
15
|
-
};
|
|
16
|
-
}): import("react/jsx-runtime").JSX.Element;
|
package/deck/Deck.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "../util";
|
|
3
|
-
export function Deck({ children, titles, options, }) {
|
|
4
|
-
const { title, subTitle, gapTitle } = titles ?? {};
|
|
5
|
-
const { height, gapX, gapY, overflowScroll } = options ?? {};
|
|
6
|
-
const container = {
|
|
7
|
-
positions: `flex flex-col gap-${gapTitle ?? 4}`,
|
|
8
|
-
sizes: `sm:w-full h-${height ?? "auto"} `,
|
|
9
|
-
};
|
|
10
|
-
const body = {
|
|
11
|
-
positions: `flex flex-col sm:flex-row sm:w-full gap-x-${gapX ?? 7.5} gap-y-${gapY ?? 5}`,
|
|
12
|
-
styles: `${overflowScroll ? "overflow-x-scroll" : ""} duration-500`,
|
|
13
|
-
};
|
|
14
|
-
return (_jsxs("div", { className: cn(container.positions, container.sizes), children: [_jsxs("div", { className: "pl-1", children: [_jsx("div", { className: "text-xl xl:text-2xl font-bold", children: title }), _jsx("div", { className: "", children: subTitle })] }), _jsx("div", { className: cn(body.positions, body.styles), children: children })] }));
|
|
15
|
-
}
|
package/deck/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Deck";
|
package/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
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";
|
package/interaction/Exception.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export default function Exception({ exceptions, children }) {
|
|
3
|
-
if (!exceptions)
|
|
4
|
-
return _jsx(_Fragment, { children: children });
|
|
5
|
-
const trueComponents = exceptions
|
|
6
|
-
.filter(([exception]) => exception)
|
|
7
|
-
.map(([, component]) => component);
|
|
8
|
-
return _jsx(_Fragment, { children: trueComponents.length > 0 ? trueComponents : children });
|
|
9
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function LoadingSpinner(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// NOTE: This is Prototype code and should be replaced with a proper loading spinner
|
|
3
|
-
export default function LoadingSpinner() {
|
|
4
|
-
return (_jsx("div", { className: "w-full h-full flex items-center justify-center", children: _jsx("div", { className: "h-16 w-16 animate-spin rounded-full border-6 border-black border-r-transparent flex justify-center items-center", children: _jsx("div", { className: "h-12 w-12 animate-spin rounded-full border-6 border-red-500 border-r-transparent " }) }) }));
|
|
5
|
-
}
|
package/interaction/NoData.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function NoData(): import("react/jsx-runtime").JSX.Element;
|
package/interaction/NoData.js
DELETED
package/interaction/index.js
DELETED
package/interface/Board.d.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { Dispatch } from "react";
|
|
2
|
-
import { Button, Size } from "./Property";
|
|
3
|
-
interface OptionsProps {
|
|
4
|
-
color?: string;
|
|
5
|
-
}
|
|
6
|
-
interface WidgetsProps {
|
|
7
|
-
exceptions?: [boolean, React.ReactNode][];
|
|
8
|
-
components?: [boolean | string, React.ReactNode][];
|
|
9
|
-
tabs?: Button[];
|
|
10
|
-
}
|
|
11
|
-
export interface BoardProps {
|
|
12
|
-
children?: React.ReactNode;
|
|
13
|
-
widgets?: WidgetsProps;
|
|
14
|
-
options?: OptionsProps;
|
|
15
|
-
}
|
|
16
|
-
export interface BoardHeaderProps {
|
|
17
|
-
title?: string;
|
|
18
|
-
tags?: {
|
|
19
|
-
selects?: {
|
|
20
|
-
title: string;
|
|
21
|
-
onChange: Dispatch<string>;
|
|
22
|
-
options: [string | number, string][];
|
|
23
|
-
width?: Size;
|
|
24
|
-
}[];
|
|
25
|
-
inputs?: {
|
|
26
|
-
title: string;
|
|
27
|
-
onChange: Dispatch<string>;
|
|
28
|
-
placeholder: string;
|
|
29
|
-
width?: Size;
|
|
30
|
-
}[];
|
|
31
|
-
};
|
|
32
|
-
options?: {
|
|
33
|
-
colors?: {
|
|
34
|
-
bgColor?: string;
|
|
35
|
-
textColor?: string;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
export interface ManageBoardProps<T> extends BoardProps {
|
|
40
|
-
data: {
|
|
41
|
-
dataSets: {
|
|
42
|
-
title?: string;
|
|
43
|
-
items: T[] | undefined;
|
|
44
|
-
renderItem: (items: T) => React.ReactNode;
|
|
45
|
-
}[];
|
|
46
|
-
dataField?: {
|
|
47
|
-
fields: Record<string, string>;
|
|
48
|
-
sizes: Record<string, string>;
|
|
49
|
-
};
|
|
50
|
-
gap?: number;
|
|
51
|
-
};
|
|
52
|
-
header?: BoardHeaderProps;
|
|
53
|
-
widgets?: {
|
|
54
|
-
menu?: React.ReactNode;
|
|
55
|
-
} & WidgetsProps;
|
|
56
|
-
}
|
|
57
|
-
export {};
|
package/interface/Board.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/interface/Card.d.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ImageSize, Size } from "./Property";
|
|
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
|
-
export interface CardProps {
|
|
16
|
-
children: React.ReactNode;
|
|
17
|
-
options?: {
|
|
18
|
-
boundary?: "shadow" | "border" | "none";
|
|
19
|
-
rounded?: string;
|
|
20
|
-
height?: Size;
|
|
21
|
-
width?: Size;
|
|
22
|
-
text?: {
|
|
23
|
-
size?: string;
|
|
24
|
-
color?: string;
|
|
25
|
-
};
|
|
26
|
-
onClick?: () => unknown | (() => Promise<unknown>);
|
|
27
|
-
overflow?: "hiden" | "auto";
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
export interface ChartCardProps {
|
|
31
|
-
data: Record<string, string | number>[];
|
|
32
|
-
xAxis: string;
|
|
33
|
-
yAxis: string;
|
|
34
|
-
lines?: {
|
|
35
|
-
dataKey: string;
|
|
36
|
-
stroke: string;
|
|
37
|
-
}[];
|
|
38
|
-
bars?: {
|
|
39
|
-
dataKey: string;
|
|
40
|
-
fill: string;
|
|
41
|
-
}[];
|
|
42
|
-
areas?: {
|
|
43
|
-
dataKey: string;
|
|
44
|
-
fill: string;
|
|
45
|
-
}[];
|
|
46
|
-
}
|
|
47
|
-
export interface TableCardProps {
|
|
48
|
-
data: Record<string, string | number>[];
|
|
49
|
-
fields: Record<string, string>;
|
|
50
|
-
sizes: Record<string, string>;
|
|
51
|
-
options?: {
|
|
52
|
-
color?: {
|
|
53
|
-
background: string;
|
|
54
|
-
text: string;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
export interface TrumpCardProps {
|
|
59
|
-
titles: {
|
|
60
|
-
title: string;
|
|
61
|
-
subTitle?: string[];
|
|
62
|
-
color?: string;
|
|
63
|
-
};
|
|
64
|
-
options?: {
|
|
65
|
-
width?: Size;
|
|
66
|
-
image?: {
|
|
67
|
-
path: string;
|
|
68
|
-
size?: ImageSize;
|
|
69
|
-
};
|
|
70
|
-
onClick?: () => unknown | (() => Promise<unknown>);
|
|
71
|
-
subButton?: [string, string, () => unknown | (() => Promise<unknown>)];
|
|
72
|
-
};
|
|
73
|
-
}
|
package/interface/Card.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|