@edu-tosel/design 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) hide show
  1. package/README.md +0 -20
  2. package/{src/board/index.tsx → board/index.d.ts} +3 -4
  3. package/board/index.js +3 -0
  4. package/board/template/CanvasBoard.d.ts +2 -0
  5. package/board/template/CanvasBoard.js +10 -0
  6. package/board/template/ManageBoard.d.ts +4 -0
  7. package/board/template/ManageBoard.js +27 -0
  8. package/board/widget/Board.d.ts +2 -0
  9. package/board/widget/Board.js +16 -0
  10. package/board/widget/DataField.d.ts +6 -0
  11. package/board/widget/DataField.js +24 -0
  12. package/board/widget/Header.d.ts +2 -0
  13. package/board/widget/Header.js +22 -0
  14. package/board/widget/Tab.d.ts +4 -0
  15. package/board/widget/Tab.js +17 -0
  16. package/board/widget/Tags.d.ts +3 -0
  17. package/board/widget/Tags.js +30 -0
  18. package/{src/card/index.tsx → card/index.d.ts} +6 -6
  19. package/card/index.js +6 -0
  20. package/card/template/ChartCard.d.ts +2 -0
  21. package/card/template/ChartCard.js +6 -0
  22. package/card/template/InfoCard.d.ts +2 -0
  23. package/card/template/InfoCard.js +6 -0
  24. package/card/template/ProfileCard.d.ts +14 -0
  25. package/card/template/ProfileCard.js +8 -0
  26. package/card/template/RowCard.d.ts +5 -0
  27. package/card/template/RowCard.js +26 -0
  28. package/card/template/TableCard.d.ts +2 -0
  29. package/card/template/TableCard.js +12 -0
  30. package/card/template/TrumpCard.d.ts +2 -0
  31. package/card/template/TrumpCard.js +19 -0
  32. package/card/widget/Card.d.ts +2 -0
  33. package/card/widget/Card.js +45 -0
  34. package/deck/Deck.d.ts +16 -0
  35. package/deck/Deck.js +15 -0
  36. package/{src/deck/index.tsx → deck/index.d.ts} +1 -1
  37. package/deck/index.js +1 -0
  38. package/{src/index.tsx → index.d.ts} +11 -11
  39. package/index.js +11 -0
  40. package/interaction/Exception.d.ts +2 -0
  41. package/interaction/Exception.js +9 -0
  42. package/interaction/LoadingSpinner.d.ts +1 -0
  43. package/interaction/LoadingSpinner.js +5 -0
  44. package/interaction/NoData.d.ts +1 -0
  45. package/interaction/NoData.js +4 -0
  46. package/{src/interaction/index.tsx → interaction/index.d.ts} +2 -2
  47. package/interaction/index.js +2 -0
  48. package/interface/Board.d.ts +57 -0
  49. package/interface/Board.js +1 -0
  50. package/interface/Card.d.ts +76 -0
  51. package/interface/Card.js +1 -0
  52. package/{src/interface/HTMLElement.ts → interface/HTMLElement.d.ts} +23 -27
  53. package/interface/HTMLElement.js +1 -0
  54. package/interface/Interaction.d.ts +5 -0
  55. package/interface/Interaction.js +1 -0
  56. package/{src/interface/Menu.ts → interface/Menu.d.ts} +5 -5
  57. package/interface/Menu.js +1 -0
  58. package/interface/Modal.d.ts +18 -0
  59. package/interface/Modal.js +1 -0
  60. package/{src/interface/Property.ts → interface/Property.d.ts} +40 -46
  61. package/interface/Property.js +14 -0
  62. package/interface/Widget.d.ts +4 -0
  63. package/interface/Widget.js +1 -0
  64. package/{src/interface/index.ts → interface/index.d.ts} +3 -3
  65. package/interface/index.js +3 -0
  66. package/layout/dashboard/Header.d.ts +5 -0
  67. package/layout/dashboard/Header.js +19 -0
  68. package/layout/dashboard/index.d.ts +7 -0
  69. package/layout/dashboard/index.js +10 -0
  70. package/{src/layout/index.tsx → layout/index.d.ts} +1 -1
  71. package/layout/index.js +1 -0
  72. package/menu/SideMenu.d.ts +2 -0
  73. package/menu/SideMenu.js +27 -0
  74. package/{src/menu/index.tsx → menu/index.d.ts} +1 -1
  75. package/menu/index.js +1 -0
  76. package/modal/AlertModal.d.ts +2 -0
  77. package/modal/AlertModal.js +8 -0
  78. package/modal/ControllerModal.d.ts +6 -0
  79. package/modal/ControllerModal.js +6 -0
  80. package/modal/Modal.d.ts +2 -0
  81. package/modal/Modal.js +31 -0
  82. package/modal/TestModal.d.ts +8 -0
  83. package/modal/TestModal.js +6 -0
  84. package/{src/modal/index.tsx → modal/index.d.ts} +3 -3
  85. package/modal/index.js +3 -0
  86. package/navigation/Navigation.d.ts +5 -0
  87. package/navigation/Navigation.js +24 -0
  88. package/{src/navigation/index.tsx → navigation/index.d.ts} +1 -1
  89. package/navigation/index.js +1 -0
  90. package/package.json +28 -49
  91. package/shelf/Shelf.d.ts +4 -0
  92. package/shelf/Shelf.js +4 -0
  93. package/{src/shelf/index.tsx → shelf/index.d.ts} +1 -1
  94. package/shelf/index.js +1 -0
  95. package/store/index.d.ts +16 -0
  96. package/store/index.js +39 -0
  97. package/text/LineBreaks.d.ts +4 -0
  98. package/text/LineBreaks.js +5 -0
  99. package/{src/text/index.tsx → text/index.d.ts} +1 -1
  100. package/text/index.js +1 -0
  101. package/util/classNames.d.ts +1 -0
  102. package/util/classNames.js +4 -0
  103. package/util/colors.d.ts +10 -0
  104. package/util/colors.js +10 -0
  105. package/util/display.d.ts +25 -0
  106. package/util/display.js +25 -0
  107. package/util/displayResponsive.d.ts +3 -0
  108. package/util/displayResponsive.js +15 -0
  109. package/{src/util/index.ts → util/index.d.ts} +7 -7
  110. package/util/index.js +7 -0
  111. package/util/pattern.d.ts +7 -0
  112. package/util/pattern.js +15 -0
  113. package/util/position.d.ts +14 -0
  114. package/util/position.js +44 -0
  115. package/util/shape.d.ts +1 -0
  116. package/util/shape.js +3 -0
  117. package/version.txt +1 -0
  118. package/.eslintrc.cjs +0 -17
  119. package/Dockerfile +0 -16
  120. package/LICENCE +0 -19
  121. package/docs/README.md +0 -47
  122. package/index.html +0 -13
  123. package/postcss.config.js +0 -6
  124. package/public/images/daeng.jpg +0 -0
  125. package/public/images/faker.jpg +0 -0
  126. package/public/images/haerin.png +0 -0
  127. package/public/images/haewon.png +0 -0
  128. package/public/images/hani.png +0 -0
  129. package/public/images/home/admin.png +0 -0
  130. package/public/images/home/dashboard.png +0 -0
  131. package/public/images/home/detection.png +0 -0
  132. package/public/images/home/homepage.png +0 -0
  133. package/public/images/home/olympiad.png +0 -0
  134. package/public/images/home/partner.png +0 -0
  135. package/public/images/home/report.png +0 -0
  136. package/public/images/home/space.png +0 -0
  137. package/public/images/home/sun.png +0 -0
  138. package/public/images/info.png +0 -0
  139. package/public/images/itc.png +0 -0
  140. package/public/images/jenkins.png +0 -0
  141. package/public/images/minji.png +0 -0
  142. package/public/images/seulgi.png +0 -0
  143. package/public/images/test-full.png +0 -0
  144. package/public/images/test-image.png +0 -0
  145. package/public/images/test-paper.png +0 -0
  146. package/public/images/tosel-blue-lab-spiral.png +0 -0
  147. package/public/images/tosel.png +0 -0
  148. package/public/images/yujin.png +0 -0
  149. package/public/videos/loading.gif +0 -0
  150. package/public/vite.svg +0 -1
  151. package/setupPackage.js +0 -78
  152. package/src/App.tsx +0 -32
  153. package/src/_components/asset/interface.ts +0 -2
  154. package/src/_components/asset/links.ts +0 -17
  155. package/src/_components/asset/mock/academies.ts +0 -52
  156. package/src/_components/asset/mock/chartData.ts +0 -104
  157. package/src/_components/asset/mock/exams.ts +0 -42
  158. package/src/_components/asset/mock/index.ts +0 -2
  159. package/src/_components/asset/mock/people.ts +0 -291
  160. package/src/_components/asset/mock/test.ts +0 -67
  161. package/src/_components/asset/navigation.ts +0 -17
  162. package/src/_components/asset/people.ts +0 -226
  163. package/src/_components/asset/planets.ts +0 -49
  164. package/src/_components/controller/store.ts +0 -11
  165. package/src/_components/hook/useRoute.ts +0 -47
  166. package/src/_components/hook/useTyping.ts +0 -46
  167. package/src/_components/types/Level.ts +0 -1
  168. package/src/_components/view/Explore.tsx +0 -16
  169. package/src/_components/view/Home.tsx +0 -180
  170. package/src/_components/view/LottiePlayer.tsx +0 -17
  171. package/src/app/admin/exam/page.tsx +0 -36
  172. package/src/app/admin/grade/page.tsx +0 -5
  173. package/src/app/admin/layout.tsx +0 -56
  174. package/src/app/admin/news/page.tsx +0 -15
  175. package/src/app/admin/page.tsx +0 -42
  176. package/src/app/admin/rnd/monthly-test/page.tsx +0 -5
  177. package/src/app/admin/rnd/page.tsx +0 -17
  178. package/src/app/admin/statistics/page.tsx +0 -5
  179. package/src/app/admin/user/page.tsx +0 -147
  180. package/src/app/agency/exam/page.tsx +0 -5
  181. package/src/app/agency/group/page.tsx +0 -5
  182. package/src/app/agency/layout.tsx +0 -55
  183. package/src/app/agency/page.tsx +0 -68
  184. package/src/app/agency/sales/page.tsx +0 -5
  185. package/src/app/convention/page.tsx +0 -58
  186. package/src/app/page.tsx +0 -4
  187. package/src/asset/fonts/Kostar.ttf +0 -0
  188. package/src/asset/fonts/Megrim.ttf +0 -0
  189. package/src/asset/fonts/NicoMoji.ttf +0 -0
  190. package/src/asset/fonts/Pretendard-Medium.otf +0 -0
  191. package/src/board/template/CanvasBoard.tsx +0 -17
  192. package/src/board/template/ManageBoard.tsx +0 -56
  193. package/src/board/widget/Board.tsx +0 -28
  194. package/src/board/widget/DataField.tsx +0 -70
  195. package/src/board/widget/Header.tsx +0 -63
  196. package/src/board/widget/Tab.tsx +0 -36
  197. package/src/board/widget/Tags.tsx +0 -81
  198. package/src/card/template/ChartCard.tsx +0 -42
  199. package/src/card/template/InfoCard.tsx +0 -22
  200. package/src/card/template/ProfileCard.tsx +0 -36
  201. package/src/card/template/RowCard.tsx +0 -91
  202. package/src/card/template/TableCard.tsx +0 -41
  203. package/src/card/template/TrumpCard.tsx +0 -46
  204. package/src/card/widget/Card.tsx +0 -53
  205. package/src/deck/Deck.tsx +0 -46
  206. package/src/interaction/Exception.tsx +0 -10
  207. package/src/interaction/LoadingSpinner.tsx +0 -10
  208. package/src/interaction/NoData.tsx +0 -5
  209. package/src/interface/Board.ts +0 -55
  210. package/src/interface/Card.ts +0 -66
  211. package/src/interface/Interaction.ts +0 -4
  212. package/src/interface/Modal.ts +0 -19
  213. package/src/interface/Widget.ts +0 -4
  214. package/src/layout/dashboard/Header.tsx +0 -56
  215. package/src/layout/dashboard/index.tsx +0 -38
  216. package/src/main.tsx +0 -10
  217. package/src/menu/SideMenu.tsx +0 -104
  218. package/src/modal/AlertModal.tsx +0 -24
  219. package/src/modal/ControllerModal.tsx +0 -17
  220. package/src/modal/Modal.tsx +0 -66
  221. package/src/modal/TestModal.tsx +0 -19
  222. package/src/navigation/Navigation.tsx +0 -37
  223. package/src/shelf/Shelf.tsx +0 -3
  224. package/src/store/index.ts +0 -66
  225. package/src/text/LineBreaks.tsx +0 -13
  226. package/src/util/classNames.ts +0 -4
  227. package/src/util/colors.ts +0 -11
  228. package/src/util/display.ts +0 -31
  229. package/src/util/displayResponsive.ts +0 -17
  230. package/src/util/pattern.ts +0 -18
  231. package/src/util/position.ts +0 -43
  232. package/src/util/shape.ts +0 -3
  233. package/src/vite-env.d.ts +0 -1
  234. package/tsconfig.build.json +0 -42
  235. package/tsconfig.json +0 -28
  236. package/tsconfig.node.json +0 -10
  237. package/vite.config.ts +0 -10
  238. /package/{public → asset}/fonts/Kostar.ttf +0 -0
  239. /package/{public → asset}/fonts/Megrim.ttf +0 -0
  240. /package/{public → asset}/fonts/NicoMoji.ttf +0 -0
  241. /package/{public → asset}/fonts/Pretendard-Medium.otf +0 -0
  242. /package/{src/asset → asset}/json/credit-lottie.json +0 -0
  243. /package/{src/asset → asset}/json/loading-lottie.json +0 -0
  244. /package/{src/asset → asset}/json/test.svg +0 -0
  245. /package/{src/globals.css → globals.css} +0 -0
package/README.md CHANGED
@@ -2,26 +2,6 @@
2
2
 
3
3
  TOSEL 통합 디자인 시스템에 맞춘 UI 라이브러리
4
4
 
5
- ## Tech Stack
6
-
7
- - tailwindcss 3.4.1
8
- - React 18
9
- - Vite 5
10
-
11
- ## Getting Start
12
-
13
- ```bash
14
- # 설치
15
- npm install @edu-tosel/design@latest
16
-
17
- # 개발환경
18
- npm install # 의존성 설치
19
- npm run dev # 개발자 환경에서 실행
20
- npm run test # jest 실행
21
- npm run build # 빌드
22
- npm run publish # npm 배포
23
- ```
24
-
25
5
  ## Component
26
6
 
27
7
  컴포넌트들은 기본적으로 기능 단위로만 구성한다.
@@ -1,4 +1,3 @@
1
- import "../globals.css";
2
-
3
- export { default as CanvasBoard } from "./template/CanvasBoard";
4
- export { default as ManageBoard } from "./template/ManageBoard";
1
+ import "../globals.css";
2
+ export { default as CanvasBoard } from "./template/CanvasBoard";
3
+ export { default as ManageBoard } from "./template/ManageBoard";
package/board/index.js ADDED
@@ -0,0 +1,3 @@
1
+ import "../globals.css";
2
+ export { default as CanvasBoard } from "./template/CanvasBoard";
3
+ export { default as ManageBoard } from "./template/ManageBoard";
@@ -0,0 +1,2 @@
1
+ import { BoardProps } from "../../interface/Board";
2
+ export default function CanvasBoard({ children, options }: BoardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
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
+ }
@@ -0,0 +1,4 @@
1
+ import { ManageBoardProps } from "../../interface/Board";
2
+ type Item = Record<string, any>;
3
+ export default function ManageBoard<T extends Item>({ header, data, widgets, }: ManageBoardProps<T>): import("react/jsx-runtime").JSX.Element;
4
+ export {};
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Deck } from "../../deck";
3
+ import { cn } from "../../util";
4
+ import { Board } from "../widget/Board";
5
+ import BoardHeader from "../widget/Header";
6
+ import BoardDataField from "../widget/DataField";
7
+ import { useWidgetStore } from "../../store";
8
+ import { Exception } from "../../interaction";
9
+ export default function ManageBoard({ header, data, widgets, }) {
10
+ const { order: [orderBy, orderHow], } = useWidgetStore();
11
+ const { dataSets, dataField, gap } = data;
12
+ const positions = `flex flex-col gap-${gap ?? 0}`;
13
+ const sizes = `h-full ${dataField ? "xl:h-135" : "xl:h-158"}`;
14
+ const paddings = "pb-60 xl:pb-0 px-2 xs:px-4 xl:px-8";
15
+ const styles = "overflow-y-scroll";
16
+ 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
17
+ ?.slice()
18
+ .sort((a, b) => {
19
+ if (orderBy) {
20
+ if (orderHow === "asc")
21
+ return a[orderBy] > b[orderBy] ? 1 : -1;
22
+ return a[orderBy] < b[orderBy] ? 1 : -1;
23
+ }
24
+ return 0;
25
+ })
26
+ .map((item) => renderItem(item)))) }) }), widgets?.menu] }));
27
+ }
@@ -0,0 +1,2 @@
1
+ import { BoardProps } from "../../interface/Board";
2
+ export declare function Board({ children, widgets }: BoardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
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
+ }
@@ -0,0 +1,6 @@
1
+ export default function BoardDataField({ dataField, }: {
2
+ dataField: {
3
+ fields: Record<string, string>;
4
+ sizes: Record<string, string>;
5
+ };
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
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:px-8",
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
+ }
@@ -0,0 +1,2 @@
1
+ import { BoardHeaderProps } from "./../../interface/Board";
2
+ export default function BoardHeader({ title, tags, options, }: BoardHeaderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
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
+ }
@@ -0,0 +1,4 @@
1
+ import { Button } from "../../interface";
2
+ export default function Tab({ tabs }: {
3
+ tabs: Button[];
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
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
+ }
@@ -0,0 +1,3 @@
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;
@@ -0,0 +1,30 @@
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
+ }
@@ -1,6 +1,6 @@
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";
6
- export { default as InfoCard } from "./template/InfoCard";
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";
6
+ export { default as InfoCard } from "./template/InfoCard";
package/card/index.js ADDED
@@ -0,0 +1,6 @@
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";
6
+ export { default as InfoCard } from "./template/InfoCard";
@@ -0,0 +1,2 @@
1
+ import { ChartCardProps } from "../../interface/Card";
2
+ export default function ChartCard({ data, xAxis, yAxis, lines, bars, areas, }: ChartCardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
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
+ }
@@ -0,0 +1,2 @@
1
+ import { InfoCardProps } from "../../interface/Card";
2
+ export default function InfoCard({ type }: InfoCardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Deck } from "../..";
3
+ import { Card } from "../widget/Card";
4
+ export default function InfoCard({ type }) {
5
+ return (_jsxs(Deck, { children: [_jsx(Card, { options: { width: "xs", height: "lg" }, children: _jsxs("div", { className: "p-5", children: [_jsx("div", { children: type }), _jsx("div", {})] }) }), _jsx(Card, { options: { width: "md" }, children: _jsxs("div", { className: "p-5", children: [_jsx("div", { children: type }), _jsx("div", {})] }) })] }));
6
+ }
@@ -0,0 +1,14 @@
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 {};
@@ -0,0 +1,8 @@
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
+ }
@@ -0,0 +1,5 @@
1
+ export default function RowCard<T extends Record<string, any>>({ row, fields, sizes, }: {
2
+ row: T;
3
+ fields: Partial<Record<keyof T, "text" | ["select", [string, string][]]>>;
4
+ sizes: Partial<Record<keyof T, string>>;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,26 @@
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
+ }
@@ -0,0 +1,2 @@
1
+ import { TableCardProps } from "../../interface/Card";
2
+ export default function TableCard({ data, fields, sizes, options, }: TableCardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
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
+ }
@@ -0,0 +1,2 @@
1
+ import { TrumpCardProps } from "../../interface/Card";
2
+ export default function TrumpCard({ titles, options }: TrumpCardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
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
+ }
@@ -0,0 +1,2 @@
1
+ import { CardProps } from "../../interface/Card";
2
+ export declare function Card({ children, options }: CardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,45 @@
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 ADDED
@@ -0,0 +1,16 @@
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 ADDED
@@ -0,0 +1,15 @@
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
+ }
@@ -1 +1 @@
1
- export * from "./Deck";
1
+ export * from "./Deck";
package/deck/index.js ADDED
@@ -0,0 +1 @@
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";
package/index.js ADDED
@@ -0,0 +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";
@@ -0,0 +1,2 @@
1
+ import { ExceptionProps } from "../interface/Interaction";
2
+ export default function Exception({ exceptions, children }: ExceptionProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
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
+ }
@@ -0,0 +1 @@
1
+ export default function LoadingSpinner(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
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
+ }
@@ -0,0 +1 @@
1
+ export default function NoData(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export default function NoData() {
3
+ return (_jsx("div", { className: "w-full h-full flex items-center justify-center", children: "NoData" }));
4
+ }
@@ -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,2 @@
1
+ export { default as Exception } from "./Exception";
2
+ export { default as LoadingSpinner } from "./LoadingSpinner";
@@ -0,0 +1,57 @@
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 {};
@@ -0,0 +1 @@
1
+ export {};