@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
@@ -0,0 +1,76 @@
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
+ }
74
+ export interface InfoCardProps {
75
+ type: "information" | "profile" | "prpfileSmall";
76
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,27 +1,23 @@
1
- import { Dispatch } from "react";
2
- import { Size } from "./Property";
3
-
4
- export type HTMLElementType = "text" | "input" | "select";
5
-
6
- export interface HTMLElement {
7
- title: string;
8
- onChange: Dispatch<string>;
9
- width?: Size;
10
- }
11
-
12
- export interface HTMLElementSetting {
13
- [key: string]: {
14
- label: string;
15
- type: HTMLElementType;
16
- placeholder?: string;
17
- options?: [string, string][];
18
- onChnage?: Dispatch<string>;
19
- };
20
- }
21
-
22
- export interface HTMLSelectElement extends HTMLElement {
23
- selectOptions?: [string | number, string][];
24
- }
25
- export interface HTMLInputElement extends HTMLElement {
26
- placeholder?: string;
27
- }
1
+ import { Dispatch } from "react";
2
+ import { Size } from "./Property";
3
+ export type HTMLElementType = "text" | "input" | "select";
4
+ export interface HTMLElement {
5
+ title: string;
6
+ onChange: Dispatch<string>;
7
+ width?: Size;
8
+ }
9
+ export interface HTMLElementSetting {
10
+ [key: string]: {
11
+ label: string;
12
+ type: HTMLElementType;
13
+ placeholder?: string;
14
+ options?: [string, string][];
15
+ onChnage?: Dispatch<string>;
16
+ };
17
+ }
18
+ export interface HTMLSelectElement extends HTMLElement {
19
+ selectOptions?: [string | number, string][];
20
+ }
21
+ export interface HTMLInputElement extends HTMLElement {
22
+ placeholder?: string;
23
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export interface ExceptionProps {
3
+ exceptions?: [boolean, React.ReactNode][];
4
+ children: React.ReactNode;
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
- import { Log, HTMLElementSetting } from "../interface";
2
- export interface SideMenuProps<K extends string, T extends string | number> {
3
- log: Log<K, T>;
4
- setting: HTMLElementSetting;
5
- }
1
+ import { Log, HTMLElementSetting } from "../interface";
2
+ export interface SideMenuProps<K extends string, T extends string | number> {
3
+ log: Log<K, T>;
4
+ setting: HTMLElementSetting;
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import { Button, Scripts, Size } from "./Property";
3
+ export interface ModalProps {
4
+ children: React.ReactNode;
5
+ options?: {
6
+ width?: Size;
7
+ height?: Size;
8
+ padding?: boolean;
9
+ buttons?: Button[];
10
+ };
11
+ }
12
+ export interface AlertModalProps {
13
+ title: string;
14
+ scripts: Scripts;
15
+ options?: {
16
+ buttons?: Button[];
17
+ };
18
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,46 +1,40 @@
1
- /**
2
- * Size type
3
- * @enum {string}
4
- * @readonly
5
- * @description - Size type for the component
6
- * @property {"xs"} xs - Extra small size
7
- * @property {"sm"} sm - Small size
8
- * @property {"md"} md - Medium size
9
- * @property {"lg"} lg - Large size
10
- * @property {"xl"} xl - Extra large size
11
- * @property {"2xl"} 2xl - Double extra large size
12
- * @property {"full"} full - Full size
13
- */
14
-
15
- export type Size = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full";
16
-
17
- /**
18
- * Image size type
19
- * @enum {string}
20
- * @readonly
21
- * @description - Size type for the image
22
- * @property {"sub"} sub - Sub size
23
- * @property {"full"} full - Full size
24
- */
25
-
26
- export type ImageSize = "sub" | "full";
27
-
28
- export type OnClick = () => unknown | Promise<unknown>;
29
-
30
- export type Button = [string, OnClick];
31
-
32
- export type Scripts = {
33
- script: string;
34
- subScript?: string;
35
- };
36
-
37
- export type Titles = {
38
- title: string;
39
- subTitle?: string[];
40
- color?: string;
41
- };
42
-
43
- export interface Log<K extends string, T extends string | number> {
44
- prints: K[];
45
- logs: { [p in K]: T }[] | undefined;
46
- }
1
+ /**
2
+ * Size type
3
+ * @enum {string}
4
+ * @readonly
5
+ * @description - Size type for the component
6
+ * @property {"xs"} xs - Extra small size
7
+ * @property {"sm"} sm - Small size
8
+ * @property {"md"} md - Medium size
9
+ * @property {"lg"} lg - Large size
10
+ * @property {"xl"} xl - Extra large size
11
+ * @property {"2xl"} 2xl - Double extra large size
12
+ * @property {"full"} full - Full size
13
+ */
14
+ export type Size = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full";
15
+ /**
16
+ * Image size type
17
+ * @enum {string}
18
+ * @readonly
19
+ * @description - Size type for the image
20
+ * @property {"sub"} sub - Sub size
21
+ * @property {"full"} full - Full size
22
+ */
23
+ export type ImageSize = "sub" | "full";
24
+ export type OnClick = () => unknown | Promise<unknown>;
25
+ export type Button = [string, OnClick];
26
+ export type Scripts = {
27
+ script: string;
28
+ subScript?: string;
29
+ };
30
+ export type Titles = {
31
+ title: string;
32
+ subTitle?: string[];
33
+ color?: string;
34
+ };
35
+ export interface Log<K extends string, T extends string | number> {
36
+ prints: K[];
37
+ logs: {
38
+ [p in K]: T;
39
+ }[] | undefined;
40
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Size type
3
+ * @enum {string}
4
+ * @readonly
5
+ * @description - Size type for the component
6
+ * @property {"xs"} xs - Extra small size
7
+ * @property {"sm"} sm - Small size
8
+ * @property {"md"} md - Medium size
9
+ * @property {"lg"} lg - Large size
10
+ * @property {"xl"} xl - Extra large size
11
+ * @property {"2xl"} 2xl - Double extra large size
12
+ * @property {"full"} full - Full size
13
+ */
14
+ export {};
@@ -0,0 +1,4 @@
1
+ export interface WidgetEvent {
2
+ event: string;
3
+ type: "view" | "modal";
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,3 @@
1
- export * from "./HTMLElement";
2
- export * from "./Property";
3
- export * from "./Widget";
1
+ export * from "./HTMLElement";
2
+ export * from "./Property";
3
+ export * from "./Widget";
@@ -0,0 +1,3 @@
1
+ export * from "./HTMLElement";
2
+ export * from "./Property";
3
+ export * from "./Widget";
@@ -0,0 +1,5 @@
1
+ import "../../globals.css";
2
+ export declare function Header({ title, image, }: {
3
+ title: string;
4
+ image?: [string, string];
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import "../../globals.css";
3
+ import { useState } from "react";
4
+ import { cn } from "../../util";
5
+ export function Header({ title, image, }) {
6
+ const [isOpen, setIsOpen] = useState(false);
7
+ const [src, href] = image ?? [];
8
+ return (_jsx("div", { className: "fixed top-0 left-0 xl:relative flex h-20 w-full items-center justify-between bg-white px-9 shadow-black/10 shadow-b-md z-40", children: _jsxs("div", { className: "flex h-12 items-center gap-12", children: [src && href ? (_jsx("a", { href: href, children: _jsx("img", { src: src, alt: "logo", className: "h-12 w-50" }) })) : (_jsx("div", { className: "text-2xl", children: "TOSEL" })), _jsx("div", { className: "text-3xl font-bold ", children: title })] }) }));
9
+ }
10
+ function Menu({ flag }) {
11
+ const positions = "absolute right-0 z-40 ";
12
+ const layouts = "w-48 overflow-hidden";
13
+ const styles = "shadow-md bg-white";
14
+ const animations = () => {
15
+ const height = flag ? "h-80" : "h-0";
16
+ return [height, "duration-500"].join(" ");
17
+ };
18
+ return (_jsxs("div", { className: cn(positions, layouts, styles, animations()), children: [_jsx("div", { children: "\u314E\u3147" }), _jsx("div", { children: "\u314E\u3147" })] }));
19
+ }
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export declare function DashboardLayout({ subject, colors, navigations, children, }: {
3
+ subject: [string, string, string];
4
+ colors?: [string, string];
5
+ navigations: React.ReactNode[];
6
+ children: React.ReactNode;
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Fragment } from "react";
3
+ import { NavigationContainer } from "../../navigation";
4
+ import { Header } from "./Header";
5
+ import { cn } from "../../util";
6
+ export function DashboardLayout({ subject, colors, navigations, children, }) {
7
+ const [title, image, imageUrl] = subject ?? ["", "", ""];
8
+ const [bgColor, textColor] = colors ?? ["white", "black"];
9
+ return (_jsxs("div", { className: cn(`bg-${bgColor}`, `text-${textColor}`, `min-h-screen h-screen xl:h-auto font-pretendard-medium`), children: [_jsx(Header, { title: title, image: [image, imageUrl] }), _jsxs("div", { className: "h-full flex gap-12 pt-20 xl:gap-8 xl:pl-2 2xl:px-9 xl:pt-10 xl:m-0 ", children: [_jsx(NavigationContainer, { children: navigations.map((nav, index) => (_jsx(Fragment, { children: nav }, index))) }), children] })] }));
10
+ }
@@ -1 +1 @@
1
- export * from "./dashboard";
1
+ export * from "./dashboard";
@@ -0,0 +1 @@
1
+ export * from "./dashboard";
@@ -0,0 +1,2 @@
1
+ import { SideMenuProps } from "../interface/Menu";
2
+ export default function SideMenu<K extends string, T extends string | number>({ log, setting, }: SideMenuProps<K, T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { useWidgetStore } from "../store";
3
+ import { cn } from "../util";
4
+ export default function SideMenu({ log, setting, }) {
5
+ const { tempData, setTempData, clearTempData, events, removeView } = useWidgetStore();
6
+ const isOpen = events.some(({ event }) => event === "sideMenu");
7
+ const positions = "absolute top-20 right-0";
8
+ const paddings = "pt-8";
9
+ const sizes = `${isOpen ? "w-160" : "w-0"} h-full`;
10
+ const styles = `${isOpen ? "opacity-100 z-30" : "opacity-0 z-0"} bg-gray-200 duration-500`;
11
+ const { prints, logs } = log ?? {};
12
+ return (_jsx("div", { className: cn(positions, sizes, styles, paddings), children: _jsxs("div", { className: `relative w-full h-full flex flex-col items-center gap-12 ${isOpen ? "block" : "hidden"}`, children: [_jsx("div", { className: "w-9/10 border-2 border-black p-2 h-80", children: _jsx("div", { className: "grid grid-cols-2", children: Object.entries(setting).map(([key, value]) => (_jsxs("div", { className: "text-base font-bold flex gap-2", children: [_jsxs("div", { className: "w-16", children: [value["label"], ":"] }), _jsx(HTMLElement, { type: value["type"], value: tempData[key], options: value["options"], onChange: (value) => setTempData({
13
+ ...tempData,
14
+ [key]: value,
15
+ }) })] }, key))) }) }), _jsx("div", { className: "border-2 border-black w-9/10 p-2 h-48 overflow-y-scroll", children: logs?.map((log, i) => (_jsx("div", { className: "text-base flex gap-2", children: prints?.map((print) => (_jsx("div", { className: "", children: log[print] }, print))) }, i))) }), _jsx("button", { onClick: () => {
16
+ clearTempData();
17
+ return removeView("sideMenu");
18
+ }, className: "absolute left-0 top-2/5 text-3xl font-bold", children: ">" })] }) }));
19
+ }
20
+ function HTMLElement({ type, value, options, onChange, }) {
21
+ if (type === "text")
22
+ return _jsx("div", { children: value });
23
+ if (type === "input")
24
+ return (_jsx("input", { className: "w-32", value: value, onChange: (e) => onChange?.(e.target.value) }));
25
+ if (type === "select")
26
+ return (_jsx("select", { value: value, onChange: (e) => onChange?.(e.target.value), children: options?.map(([value, label]) => (_jsx("option", { value: value, children: label }, value))) }));
27
+ }
@@ -1 +1 @@
1
- export { default as SideMenu } from "./SideMenu";
1
+ export { default as SideMenu } from "./SideMenu";
package/menu/index.js ADDED
@@ -0,0 +1 @@
1
+ export { default as SideMenu } from "./SideMenu";
@@ -0,0 +1,2 @@
1
+ import { AlertModalProps } from "../interface/Modal";
2
+ export default function AlertModal({ title, scripts, options, }: AlertModalProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { col } from "../util";
3
+ import { Modal } from "./Modal";
4
+ export default function AlertModal({ title, scripts, options, }) {
5
+ const { script, subScript } = scripts ?? {};
6
+ const { buttons } = options ?? {};
7
+ return (_jsx(Modal, { options: { buttons }, children: _jsx("div", { className: col(3) + "pl-25 pt-18 h-full pb-12", children: _jsxs("div", { className: col(6), children: [_jsx("div", { className: "text-3xl font-bold", children: title }), _jsx("div", { className: "h-2 w-14 rounded-full bg-pale-lavender" }), _jsx("div", { className: "text-xl font-bold", children: script })] }) }) }));
8
+ }
@@ -0,0 +1,6 @@
1
+ import { Button } from "../interface";
2
+ export default function ControllerModal({ options, }: {
3
+ options?: {
4
+ buttons?: Button[];
5
+ };
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Modal } from "./Modal";
3
+ export default function ControllerModal({ options, }) {
4
+ const { buttons } = options ?? {};
5
+ return (_jsx(Modal, { options: { width: "lg", height: "xl", buttons }, children: _jsx("div", { className: "w-full h-120 border-2 " }) }));
6
+ }
@@ -0,0 +1,2 @@
1
+ import { ModalProps } from "../interface/Modal";
2
+ export declare function Modal({ children, options }: ModalProps): import("react/jsx-runtime").JSX.Element;
package/modal/Modal.js ADDED
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useWidgetStore } from "../store";
3
+ import { absolute, cn } from "../util";
4
+ const background = "z-50 flex min-h-screen w-full items-center justify-center bg-black/10 backdrop-blur-sm fixed top-0 left-0";
5
+ const widthSize = {
6
+ xs: "w-2/3 min-w-76 max-w-176",
7
+ sm: "w-2/3 min-w-76 max-w-176",
8
+ md: "w-2/3 min-w-76 max-w-176",
9
+ lg: "w-full min-w-76 max-w-360",
10
+ xl: "w-2/3 min-w-76 max-w-176",
11
+ "2xl": "w-2/3 min-w-76 max-w-176",
12
+ full: "w-full",
13
+ };
14
+ const heightSize = {
15
+ xs: "",
16
+ sm: "h-100",
17
+ md: "h-72 sm:h-48",
18
+ lg: "h-120",
19
+ xl: "h-180",
20
+ "2xl": "w-2/3 min-w-76 max-w-176",
21
+ full: "h-full",
22
+ };
23
+ export function Modal({ children, options }) {
24
+ const { buttons, width, height } = options ?? {};
25
+ const { clearModal } = useWidgetStore();
26
+ const sizes = `${heightSize[height ?? "sm"]} ${widthSize[width ?? "md"]}`;
27
+ const paddings = "pt-18 px-25";
28
+ const styles = "rounded-xl bg-white relative overflow-hidden";
29
+ return (_jsx("div", { className: background, children: _jsxs("div", { className: cn(sizes, styles, paddings), children: [children, _jsx(_Fragment, { children: buttons ? (_jsx("div", { className: `${absolute.br(8, 10)} flex justify-end gap-4`, children: buttons.map(([text, onClick]) => (_jsx("button", { className: "rounded-2xl bg-black px-8 py-2 text-2xl font-bold text-white", onClick: onClick, children: text }, text))) })) : null }), _jsx("button", { className: absolute.tl(5, 7) +
30
+ "bg-black rounded-full h-9 w-9 flex justify-center items-center", onClick: clearModal, children: _jsx("div", { className: "x-shape" }) })] }) }));
31
+ }
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { Button } from "../interface";
3
+ export default function TestModal({ children, options, }: {
4
+ children: React.ReactNode;
5
+ options?: {
6
+ buttons?: Button[];
7
+ };
8
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Modal } from "./Modal";
3
+ export default function TestModal({ children, options, }) {
4
+ const { buttons } = options ?? {};
5
+ return (_jsx(Modal, { options: { width: "lg", height: "xl", buttons }, children: _jsx("div", { className: "pt-18 pl-25", children: children }) }));
6
+ }
@@ -1,3 +1,3 @@
1
- export { default as TestModal } from "./TestModal";
2
- export { default as AlertModal } from "./AlertModal";
3
- export { default as ControllerModal } from "./ControllerModal";
1
+ export { default as TestModal } from "./TestModal";
2
+ export { default as AlertModal } from "./AlertModal";
3
+ export { default as ControllerModal } from "./ControllerModal";
package/modal/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { default as TestModal } from "./TestModal";
2
+ export { default as AlertModal } from "./AlertModal";
3
+ export { default as ControllerModal } from "./ControllerModal";
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare const buttonClassNames: (href: string, nowPath: string, color?: [string, string]) => string;
3
+ export declare function NavigationContainer({ children, }: {
4
+ children: React.ReactNode;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { center, cn } from "../util";
3
+ export const buttonClassNames = (href, nowPath, color) => {
4
+ const [bg, text] = color ?? ["white", "black"];
5
+ const classNames = [
6
+ center.row(6),
7
+ `text-${text}`,
8
+ "font-bold w-full xl:w-50 h-11 xl:rounded-2xl flex justify-center xl:justify-start xl:pl-5",
9
+ ].join(" ");
10
+ const checkPathMatch = (href, nowPath) => {
11
+ return href.split("/").pop() === nowPath.split("/").pop();
12
+ };
13
+ const toggle = checkPathMatch(href, nowPath)
14
+ ? `bg-${bg}`
15
+ : "bg-gray-500 xl:bg-transparent";
16
+ return [classNames, toggle].join(" ");
17
+ };
18
+ export function NavigationContainer({ children, }) {
19
+ const displays = "flex flex-row xl:flex-col z-40";
20
+ const positions = "fixed bottom-0 left-0 xl:static";
21
+ const sizes = "w-full xl:w-auto";
22
+ const styles = "";
23
+ return (_jsx("div", { className: cn(displays, positions, sizes, styles), children: children }));
24
+ }
@@ -1 +1 @@
1
- export * from "./Navigation";
1
+ export * from "./Navigation";
@@ -0,0 +1 @@
1
+ export * from "./Navigation";
package/package.json CHANGED
@@ -1,49 +1,28 @@
1
- {
2
- "name": "@edu-tosel/design",
3
- "version": "1.0.6",
4
- "description": "UI components for International TOSEL Committee",
5
- "keywords": [
6
- "jsx",
7
- "tsx",
8
- "tailwindcss",
9
- "ui",
10
- "design system"
11
- ],
12
- "author": "International TOSEL Committee",
13
- "license": "MIT",
14
- "type": "module",
15
- "scripts": {
16
- "dev": "vite",
17
- "build": "tsc && vite build",
18
- "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
19
- "preview": "vite preview",
20
- "build-publish": "rimraf ./dist && tsc -p tsconfig.build.json --noEmit false",
21
- "publish": "npm run build-publish && node setupPackage.js && cd dist && npm publish"
22
- },
23
- "dependencies": {
24
- "react": "^18.2.0",
25
- "react-dom": "^18.2.0",
26
- "react-lottie-player": "^1.5.6",
27
- "react-router-dom": "^6.21.3",
28
- "recharts": "^2.11.0",
29
- "tailwind-scrollbar-hide": "^1.1.7",
30
- "tailwindcss-animate": "^1.0.7",
31
- "typescript": "^5.2.2",
32
- "zustand": "^4.5.0"
33
- },
34
- "devDependencies": {
35
- "@types/react": "^18.2.43",
36
- "@types/react-dom": "^18.2.17",
37
- "@typescript-eslint/eslint-plugin": "^6.14.0",
38
- "@typescript-eslint/parser": "^6.14.0",
39
- "@vitejs/plugin-react-swc": "^3.5.0",
40
- "autoprefixer": "^10.4.17",
41
- "eslint": "^8.55.0",
42
- "eslint-plugin-react-hooks": "^4.6.0",
43
- "eslint-plugin-react-refresh": "^0.4.5",
44
- "postcss": "^8.4.33",
45
- "rimraf": "^5.0.5",
46
- "tailwindcss": "^3.4.1",
47
- "vite": "^5.0.8"
48
- }
49
- }
1
+ {
2
+ "name": "@edu-tosel/design",
3
+ "version": "1.0.7",
4
+ "description": "UI components for International TOSEL Committee",
5
+ "keywords": [
6
+ "jsx",
7
+ "tsx",
8
+ "tailwindcss",
9
+ "ui",
10
+ "design system"
11
+ ],
12
+ "author": "International TOSEL Committee",
13
+ "license": "MIT",
14
+ "type": "module",
15
+ "scripts": {},
16
+ "dependencies": {
17
+ "react": "^18.2.0",
18
+ "react-dom": "^18.2.0",
19
+ "react-lottie-player": "^1.5.6",
20
+ "react-router-dom": "^6.21.3",
21
+ "recharts": "^2.11.0",
22
+ "tailwind-scrollbar-hide": "^1.1.7",
23
+ "tailwindcss-animate": "^1.0.7",
24
+ "typescript": "^5.2.2",
25
+ "zustand": "^4.5.0"
26
+ },
27
+ "devDependencies": {}
28
+ }
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export default function Shelf({ children }: {
3
+ children: React.ReactNode;
4
+ }): import("react/jsx-runtime").JSX.Element;
package/shelf/Shelf.js ADDED
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export default function Shelf({ children }) {
3
+ return _jsx("div", { className: "inline-flex flex-col gap-8 xl:w-auto", children: children });
4
+ }