@edu-tosel/design 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) 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/index.d.ts +4 -0
  41. package/interaction/index.js +4 -0
  42. package/interaction/template/Exception.d.ts +2 -0
  43. package/interaction/template/Exception.js +9 -0
  44. package/interaction/widget/LoadingJumper.d.ts +1 -0
  45. package/interaction/widget/LoadingJumper.js +4 -0
  46. package/interaction/widget/LoadingSpinner.d.ts +1 -0
  47. package/interaction/widget/LoadingSpinner.js +5 -0
  48. package/interaction/widget/NoData.d.ts +1 -0
  49. package/interaction/widget/NoData.js +4 -0
  50. package/interface/Board.d.ts +57 -0
  51. package/interface/Board.js +1 -0
  52. package/interface/Card.d.ts +76 -0
  53. package/interface/Card.js +1 -0
  54. package/{src/interface/HTMLElement.ts → interface/HTMLElement.d.ts} +23 -27
  55. package/interface/HTMLElement.js +1 -0
  56. package/interface/Interaction.d.ts +5 -0
  57. package/interface/Interaction.js +1 -0
  58. package/interface/Menu.d.ts +6 -0
  59. package/interface/Menu.js +1 -0
  60. package/interface/Modal.d.ts +18 -0
  61. package/interface/Modal.js +1 -0
  62. package/{src/interface/Property.ts → interface/Property.d.ts} +40 -46
  63. package/interface/Property.js +14 -0
  64. package/interface/Widget.d.ts +4 -0
  65. package/interface/Widget.js +1 -0
  66. package/{src/interface/index.ts → interface/index.d.ts} +3 -3
  67. package/interface/index.js +3 -0
  68. package/layout/dashboard/Header.d.ts +5 -0
  69. package/layout/dashboard/Header.js +19 -0
  70. package/layout/dashboard/index.d.ts +7 -0
  71. package/layout/dashboard/index.js +10 -0
  72. package/{src/layout/index.tsx → layout/index.d.ts} +1 -1
  73. package/layout/index.js +1 -0
  74. package/menu/index.d.ts +1 -0
  75. package/menu/index.js +1 -0
  76. package/menu/template/SideMenu.d.ts +2 -0
  77. package/menu/template/SideMenu.js +20 -0
  78. package/menu/widget/HTMLElement.d.ts +8 -0
  79. package/menu/widget/HTMLElement.js +9 -0
  80. package/modal/AlertModal.d.ts +2 -0
  81. package/modal/AlertModal.js +8 -0
  82. package/modal/ControllerModal.d.ts +6 -0
  83. package/modal/ControllerModal.js +6 -0
  84. package/modal/Modal.d.ts +2 -0
  85. package/modal/Modal.js +31 -0
  86. package/modal/TestModal.d.ts +8 -0
  87. package/modal/TestModal.js +6 -0
  88. package/{src/modal/index.tsx → modal/index.d.ts} +3 -3
  89. package/modal/index.js +3 -0
  90. package/navigation/Navigation.d.ts +5 -0
  91. package/navigation/Navigation.js +24 -0
  92. package/{src/navigation/index.tsx → navigation/index.d.ts} +1 -1
  93. package/navigation/index.js +1 -0
  94. package/package.json +28 -49
  95. package/shelf/Shelf.d.ts +4 -0
  96. package/shelf/Shelf.js +4 -0
  97. package/{src/shelf/index.tsx → shelf/index.d.ts} +1 -1
  98. package/shelf/index.js +1 -0
  99. package/store/index.d.ts +16 -0
  100. package/store/index.js +39 -0
  101. package/text/LineBreaks.d.ts +4 -0
  102. package/text/LineBreaks.js +5 -0
  103. package/{src/text/index.tsx → text/index.d.ts} +1 -1
  104. package/text/index.js +1 -0
  105. package/util/classNames.d.ts +1 -0
  106. package/util/classNames.js +4 -0
  107. package/util/colors.d.ts +10 -0
  108. package/util/colors.js +10 -0
  109. package/util/display.d.ts +25 -0
  110. package/util/display.js +25 -0
  111. package/util/displayResponsive.d.ts +3 -0
  112. package/util/displayResponsive.js +15 -0
  113. package/{src/util/index.ts → util/index.d.ts} +7 -7
  114. package/util/index.js +7 -0
  115. package/util/pattern.d.ts +7 -0
  116. package/util/pattern.js +15 -0
  117. package/util/position.d.ts +14 -0
  118. package/util/position.js +44 -0
  119. package/util/shape.d.ts +1 -0
  120. package/util/shape.js +3 -0
  121. package/version.txt +1 -0
  122. package/.eslintrc.cjs +0 -17
  123. package/Dockerfile +0 -16
  124. package/LICENCE +0 -19
  125. package/docs/README.md +0 -47
  126. package/index.html +0 -13
  127. package/postcss.config.js +0 -6
  128. package/public/images/daeng.jpg +0 -0
  129. package/public/images/faker.jpg +0 -0
  130. package/public/images/haerin.png +0 -0
  131. package/public/images/haewon.png +0 -0
  132. package/public/images/hani.png +0 -0
  133. package/public/images/home/admin.png +0 -0
  134. package/public/images/home/dashboard.png +0 -0
  135. package/public/images/home/detection.png +0 -0
  136. package/public/images/home/homepage.png +0 -0
  137. package/public/images/home/olympiad.png +0 -0
  138. package/public/images/home/partner.png +0 -0
  139. package/public/images/home/report.png +0 -0
  140. package/public/images/home/space.png +0 -0
  141. package/public/images/home/sun.png +0 -0
  142. package/public/images/info.png +0 -0
  143. package/public/images/itc.png +0 -0
  144. package/public/images/jenkins.png +0 -0
  145. package/public/images/minji.png +0 -0
  146. package/public/images/seulgi.png +0 -0
  147. package/public/images/test-full.png +0 -0
  148. package/public/images/test-image.png +0 -0
  149. package/public/images/test-paper.png +0 -0
  150. package/public/images/tosel-blue-lab-spiral.png +0 -0
  151. package/public/images/tosel.png +0 -0
  152. package/public/images/yujin.png +0 -0
  153. package/public/videos/loading.gif +0 -0
  154. package/public/vite.svg +0 -1
  155. package/setupPackage.js +0 -78
  156. package/src/App.tsx +0 -32
  157. package/src/_components/asset/interface.ts +0 -2
  158. package/src/_components/asset/links.ts +0 -17
  159. package/src/_components/asset/mock/academies.ts +0 -52
  160. package/src/_components/asset/mock/chartData.ts +0 -104
  161. package/src/_components/asset/mock/exams.ts +0 -42
  162. package/src/_components/asset/mock/index.ts +0 -2
  163. package/src/_components/asset/mock/people.ts +0 -291
  164. package/src/_components/asset/mock/test.ts +0 -67
  165. package/src/_components/asset/navigation.ts +0 -17
  166. package/src/_components/asset/people.ts +0 -226
  167. package/src/_components/asset/planets.ts +0 -49
  168. package/src/_components/controller/store.ts +0 -11
  169. package/src/_components/hook/useRoute.ts +0 -47
  170. package/src/_components/hook/useTyping.ts +0 -46
  171. package/src/_components/types/Level.ts +0 -1
  172. package/src/_components/view/Explore.tsx +0 -16
  173. package/src/_components/view/Home.tsx +0 -180
  174. package/src/_components/view/LottiePlayer.tsx +0 -17
  175. package/src/app/admin/exam/page.tsx +0 -36
  176. package/src/app/admin/grade/page.tsx +0 -5
  177. package/src/app/admin/layout.tsx +0 -56
  178. package/src/app/admin/news/page.tsx +0 -15
  179. package/src/app/admin/page.tsx +0 -42
  180. package/src/app/admin/rnd/monthly-test/page.tsx +0 -5
  181. package/src/app/admin/rnd/page.tsx +0 -17
  182. package/src/app/admin/statistics/page.tsx +0 -5
  183. package/src/app/admin/user/page.tsx +0 -147
  184. package/src/app/agency/exam/page.tsx +0 -5
  185. package/src/app/agency/group/page.tsx +0 -5
  186. package/src/app/agency/layout.tsx +0 -55
  187. package/src/app/agency/page.tsx +0 -68
  188. package/src/app/agency/sales/page.tsx +0 -5
  189. package/src/app/convention/page.tsx +0 -58
  190. package/src/app/page.tsx +0 -4
  191. package/src/asset/fonts/Kostar.ttf +0 -0
  192. package/src/asset/fonts/Megrim.ttf +0 -0
  193. package/src/asset/fonts/NicoMoji.ttf +0 -0
  194. package/src/asset/fonts/Pretendard-Medium.otf +0 -0
  195. package/src/board/template/CanvasBoard.tsx +0 -17
  196. package/src/board/template/ManageBoard.tsx +0 -56
  197. package/src/board/widget/Board.tsx +0 -28
  198. package/src/board/widget/DataField.tsx +0 -70
  199. package/src/board/widget/Header.tsx +0 -63
  200. package/src/board/widget/Tab.tsx +0 -36
  201. package/src/board/widget/Tags.tsx +0 -81
  202. package/src/card/template/ChartCard.tsx +0 -42
  203. package/src/card/template/InfoCard.tsx +0 -22
  204. package/src/card/template/ProfileCard.tsx +0 -36
  205. package/src/card/template/RowCard.tsx +0 -91
  206. package/src/card/template/TableCard.tsx +0 -41
  207. package/src/card/template/TrumpCard.tsx +0 -46
  208. package/src/card/widget/Card.tsx +0 -53
  209. package/src/deck/Deck.tsx +0 -46
  210. package/src/interaction/Exception.tsx +0 -10
  211. package/src/interaction/LoadingSpinner.tsx +0 -10
  212. package/src/interaction/NoData.tsx +0 -5
  213. package/src/interaction/index.tsx +0 -2
  214. package/src/interface/Board.ts +0 -55
  215. package/src/interface/Card.ts +0 -66
  216. package/src/interface/Interaction.ts +0 -4
  217. package/src/interface/Menu.ts +0 -5
  218. package/src/interface/Modal.ts +0 -19
  219. package/src/interface/Widget.ts +0 -4
  220. package/src/layout/dashboard/Header.tsx +0 -56
  221. package/src/layout/dashboard/index.tsx +0 -38
  222. package/src/main.tsx +0 -10
  223. package/src/menu/SideMenu.tsx +0 -104
  224. package/src/menu/index.tsx +0 -1
  225. package/src/modal/AlertModal.tsx +0 -24
  226. package/src/modal/ControllerModal.tsx +0 -17
  227. package/src/modal/Modal.tsx +0 -66
  228. package/src/modal/TestModal.tsx +0 -19
  229. package/src/navigation/Navigation.tsx +0 -37
  230. package/src/shelf/Shelf.tsx +0 -3
  231. package/src/store/index.ts +0 -66
  232. package/src/text/LineBreaks.tsx +0 -13
  233. package/src/util/classNames.ts +0 -4
  234. package/src/util/colors.ts +0 -11
  235. package/src/util/display.ts +0 -31
  236. package/src/util/displayResponsive.ts +0 -17
  237. package/src/util/pattern.ts +0 -18
  238. package/src/util/position.ts +0 -43
  239. package/src/util/shape.ts +0 -3
  240. package/src/vite-env.d.ts +0 -1
  241. package/tsconfig.build.json +0 -42
  242. package/tsconfig.json +0 -28
  243. package/tsconfig.node.json +0 -10
  244. package/vite.config.ts +0 -10
  245. /package/{public → asset}/fonts/Kostar.ttf +0 -0
  246. /package/{public → asset}/fonts/Megrim.ttf +0 -0
  247. /package/{public → asset}/fonts/NicoMoji.ttf +0 -0
  248. /package/{public → asset}/fonts/Pretendard-Medium.otf +0 -0
  249. /package/{src/asset → asset}/json/credit-lottie.json +0 -0
  250. /package/{src/asset → asset}/json/loading-lottie.json +0 -0
  251. /package/{src/asset → asset}/json/test.svg +0 -0
  252. /package/{src/globals.css → globals.css} +0 -0
@@ -1,66 +0,0 @@
1
- import { ImageSize, Size } from "./Property";
2
-
3
- /**
4
- * CardProps is an interface.
5
- * @interface CardProps
6
- * @property {React.ReactNode} children
7
- * @property {object} options
8
- * @property {Size} options.height
9
- * @property {Size} options.width
10
- * @property {object} options.text
11
- * @property {string} options.text.size
12
- * @property {string} options.text.color
13
- * @property {() => unknown | (() => Promise<unknown>)} options.onClick
14
- */
15
-
16
- export interface CardProps {
17
- children: React.ReactNode;
18
- options?: {
19
- boundary?: "shadow" | "border" | "none";
20
- rounded?: string;
21
- height?: Size;
22
- width?: Size;
23
- text?: { size?: string; color?: string };
24
- onClick?: () => unknown | (() => Promise<unknown>);
25
- overflow?: "hiden" | "auto";
26
- };
27
- }
28
-
29
- export interface ChartCardProps {
30
- data: Record<string, string | number>[];
31
- xAxis: string;
32
- yAxis: string;
33
- lines?: { dataKey: string; stroke: string }[];
34
- bars?: { dataKey: string; fill: string }[];
35
- areas?: { dataKey: string; fill: string }[];
36
- }
37
-
38
- export interface TableCardProps {
39
- data: Record<string, string | number>[];
40
- fields: Record<string, string>;
41
- sizes: Record<string, string>;
42
- options?: {
43
- color?: {
44
- background: string;
45
- text: string;
46
- };
47
- };
48
- }
49
-
50
- export interface TrumpCardProps {
51
- titles: {
52
- title: string;
53
- subTitle?: string[];
54
- color?: string;
55
- };
56
- options?: {
57
- width?: Size;
58
- image?: { path: string; size?: ImageSize };
59
- onClick?: () => unknown | (() => Promise<unknown>);
60
- subButton?: [string, string, () => unknown | (() => Promise<unknown>)];
61
- };
62
- }
63
-
64
- export interface InfoCardProps {
65
- type: "information" | "profile" | "prpfileSmall";
66
- }
@@ -1,4 +0,0 @@
1
- export interface ExceptionProps {
2
- exceptions?: [boolean, React.ReactNode][];
3
- children: React.ReactNode;
4
- }
@@ -1,5 +0,0 @@
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,19 +0,0 @@
1
- import { Button, Scripts, Size } from "./Property";
2
-
3
- export interface ModalProps {
4
- children: React.ReactNode;
5
- options?: {
6
- width?: Size;
7
- height?: Size;
8
- padding?: boolean;
9
- buttons?: Button[];
10
- };
11
- }
12
-
13
- export interface AlertModalProps {
14
- title: string;
15
- scripts: Scripts;
16
- options?: {
17
- buttons?: Button[];
18
- };
19
- }
@@ -1,4 +0,0 @@
1
- export interface WidgetEvent {
2
- event: string;
3
- type: "view" | "modal";
4
- }
@@ -1,56 +0,0 @@
1
- import "../../globals.css";
2
- import { useState } from "react";
3
- import { circle, cn } from "../../util";
4
-
5
- export function Header({
6
- title,
7
- image,
8
- }: {
9
- title: string;
10
- image?: [string, string];
11
- }) {
12
- const [isOpen, setIsOpen] = useState<boolean>(false);
13
- const [src, href] = image ?? [];
14
-
15
- return (
16
- <div className="fixed top-0 left-0 xl:relative flex h-20 w-full items-center justify-between bg-white px-9 shadow-black/10 shadow-b-md z-40">
17
- <div className="flex h-12 items-center gap-12">
18
- {src && href ? (
19
- <a href={href}>
20
- <img src={src} alt="logo" className="h-12 w-50" />
21
- </a>
22
- ) : (
23
- <div className="text-2xl">TOSEL</div>
24
- )}
25
- <div className="text-3xl font-bold ">{title}</div>
26
- </div>
27
- {/* <div className="relative">
28
- <button
29
- onClick={() => setIsOpen(!isOpen)}
30
- className={circle(9) + "border-2"}
31
- >
32
- +
33
- </button>
34
- <Menu flag={isOpen} />
35
- </div> */}
36
- </div>
37
- );
38
- }
39
-
40
- function Menu({ flag }: { flag: boolean }) {
41
- const positions = "absolute right-0 z-40 ";
42
- const layouts = "w-48 overflow-hidden";
43
- const styles = "shadow-md bg-white";
44
-
45
- const animations = () => {
46
- const height = flag ? "h-80" : "h-0";
47
- return [height, "duration-500"].join(" ");
48
- };
49
-
50
- return (
51
- <div className={cn(positions, layouts, styles, animations())}>
52
- <div>ㅎㅇ</div>
53
- <div>ㅎㅇ</div>
54
- </div>
55
- );
56
- }
@@ -1,38 +0,0 @@
1
- import { Fragment } from "react";
2
- import { NavigationContainer } from "../../navigation";
3
- import { Header } from "./Header";
4
- import { cn } from "../../util";
5
-
6
- export function DashboardLayout({
7
- subject,
8
- colors,
9
- navigations,
10
- children,
11
- }: {
12
- subject: [string, string, string];
13
- colors?: [string, string];
14
- navigations: React.ReactNode[];
15
- children: React.ReactNode;
16
- }) {
17
- const [title, image, imageUrl] = subject ?? ["", "", ""];
18
- const [bgColor, textColor] = colors ?? ["white", "black"];
19
- return (
20
- <div
21
- className={cn(
22
- `bg-${bgColor}`,
23
- `text-${textColor}`,
24
- `min-h-screen h-screen xl:h-auto font-pretendard-medium`
25
- )}
26
- >
27
- <Header title={title} image={[image, imageUrl]} />
28
- <div className="h-full flex gap-12 pt-20 xl:gap-8 xl:pl-2 2xl:px-9 xl:pt-10 xl:m-0 ">
29
- <NavigationContainer>
30
- {navigations.map((nav, index) => (
31
- <Fragment key={index}>{nav}</Fragment>
32
- ))}
33
- </NavigationContainer>
34
- {children}
35
- </div>
36
- </div>
37
- );
38
- }
package/src/main.tsx DELETED
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- import ReactDOM from "react-dom/client";
3
- import App from "./App.tsx";
4
- import "./globals.css";
5
-
6
- ReactDOM.createRoot(document.getElementById("root")!).render(
7
- <React.StrictMode>
8
- <App />
9
- </React.StrictMode>
10
- );
@@ -1,104 +0,0 @@
1
- import { Dispatch, useEffect } from "react";
2
- import { useWidgetStore } from "../store";
3
- import { cn } from "../util";
4
- import { HTMLElementType } from "../interface";
5
- import { SideMenuProps } from "../interface/Menu";
6
-
7
- export default function SideMenu<K extends string, T extends string | number>({
8
- log,
9
- setting,
10
- }: SideMenuProps<K, T>) {
11
- const { tempData, setTempData, clearTempData, events, removeView } =
12
- useWidgetStore();
13
- const isOpen = events.some(({ event }) => event === "sideMenu");
14
- const positions = "absolute top-20 right-0";
15
- const paddings = "pt-8";
16
- const sizes = `${isOpen ? "w-160" : "w-0"} h-full`;
17
- const styles = `${
18
- isOpen ? "opacity-100 z-30" : "opacity-0 z-0"
19
- } bg-gray-200 duration-500`;
20
- const { prints, logs } = log ?? {};
21
-
22
- return (
23
- <div className={cn(positions, sizes, styles, paddings)}>
24
- <div
25
- className={`relative w-full h-full flex flex-col items-center gap-12 ${
26
- isOpen ? "block" : "hidden"
27
- }`}
28
- >
29
- <div className="w-9/10 border-2 border-black p-2 h-80">
30
- <div className="grid grid-cols-2">
31
- {Object.entries(setting).map(([key, value]) => (
32
- <div key={key} className="text-base font-bold flex gap-2">
33
- <div className="w-16">{value["label"]}:</div>
34
- <HTMLElement
35
- type={value["type"]}
36
- value={tempData[key]}
37
- options={value["options"]}
38
- onChange={(value) =>
39
- setTempData({
40
- ...tempData,
41
- [key]: value,
42
- })
43
- }
44
- />
45
- </div>
46
- ))}
47
- </div>
48
- </div>
49
- <div className="border-2 border-black w-9/10 p-2 h-48 overflow-y-scroll">
50
- {logs?.map((log, i) => (
51
- <div key={i} className="text-base flex gap-2">
52
- {prints?.map((print) => (
53
- <div key={print} className="">
54
- {log[print]}
55
- </div>
56
- ))}
57
- </div>
58
- ))}
59
- </div>
60
- <button
61
- onClick={() => {
62
- clearTempData();
63
- return removeView("sideMenu");
64
- }}
65
- className="absolute left-0 top-2/5 text-3xl font-bold"
66
- >
67
- {">"}
68
- </button>
69
- </div>
70
- </div>
71
- );
72
- }
73
-
74
- function HTMLElement({
75
- type,
76
- value,
77
- options,
78
- onChange,
79
- }: {
80
- type: HTMLElementType;
81
- value: string | number;
82
- options?: [string, string][];
83
- onChange?: Dispatch<string>;
84
- }) {
85
- if (type === "text") return <div>{value}</div>;
86
- if (type === "input")
87
- return (
88
- <input
89
- className="w-32"
90
- value={value}
91
- onChange={(e) => onChange?.(e.target.value)}
92
- />
93
- );
94
- if (type === "select")
95
- return (
96
- <select value={value} onChange={(e) => onChange?.(e.target.value)}>
97
- {options?.map(([value, label]) => (
98
- <option key={value} value={value}>
99
- {label}
100
- </option>
101
- ))}
102
- </select>
103
- );
104
- }
@@ -1 +0,0 @@
1
- export { default as SideMenu } from "./SideMenu";
@@ -1,24 +0,0 @@
1
- import { AlertModalProps } from "../interface/Modal";
2
- import { col } from "../util";
3
- import { Modal } from "./Modal";
4
-
5
- export default function AlertModal({
6
- title,
7
- scripts,
8
- options,
9
- }: AlertModalProps) {
10
- const { script, subScript } = scripts ?? {};
11
- const { buttons } = options ?? {};
12
-
13
- return (
14
- <Modal options={{ buttons }}>
15
- <div className={col(3) + "pl-25 pt-18 h-full pb-12"}>
16
- <div className={col(6)}>
17
- <div className="text-3xl font-bold">{title}</div>
18
- <div className="h-2 w-14 rounded-full bg-pale-lavender" />
19
- <div className="text-xl font-bold">{script}</div>
20
- </div>
21
- </div>
22
- </Modal>
23
- );
24
- }
@@ -1,17 +0,0 @@
1
- import { Button } from "../interface";
2
- import { Modal } from "./Modal";
3
-
4
- export default function ControllerModal({
5
- options,
6
- }: {
7
- options?: {
8
- buttons?: Button[];
9
- };
10
- }) {
11
- const { buttons } = options ?? {};
12
- return (
13
- <Modal options={{ width: "lg", height: "xl", buttons }}>
14
- <div className="w-full h-120 border-2 "></div>
15
- </Modal>
16
- );
17
- }
@@ -1,66 +0,0 @@
1
- import { ModalProps } from "../interface/Modal";
2
- import { useWidgetStore } from "../store";
3
- import { absolute, cn } from "../util";
4
-
5
- const background =
6
- "z-50 flex min-h-screen w-full items-center justify-center bg-black/10 backdrop-blur-sm fixed top-0 left-0";
7
-
8
- const widthSize = {
9
- xs: "w-2/3 min-w-76 max-w-176",
10
- sm: "w-2/3 min-w-76 max-w-176",
11
- md: "w-2/3 min-w-76 max-w-176",
12
- lg: "w-full min-w-76 max-w-360",
13
- xl: "w-2/3 min-w-76 max-w-176",
14
- "2xl": "w-2/3 min-w-76 max-w-176",
15
- full: "w-full",
16
- };
17
- const heightSize = {
18
- xs: "",
19
- sm: "h-100",
20
- md: "h-72 sm:h-48",
21
- lg: "h-120",
22
- xl: "h-180",
23
- "2xl": "w-2/3 min-w-76 max-w-176",
24
- full: "h-full",
25
- };
26
-
27
- export function Modal({ children, options }: ModalProps) {
28
- const { buttons, width, height } = options ?? {};
29
- const { clearModal } = useWidgetStore();
30
-
31
- const sizes = `${heightSize[height ?? "sm"]} ${widthSize[width ?? "md"]}`;
32
- const paddings = "pt-18 px-25";
33
- const styles = "rounded-xl bg-white relative overflow-hidden";
34
-
35
- return (
36
- <div className={background}>
37
- <div className={cn(sizes, styles, paddings)}>
38
- {children}
39
- <>
40
- {buttons ? (
41
- <div className={`${absolute.br(8, 10)} flex justify-end gap-4`}>
42
- {buttons.map(([text, onClick]) => (
43
- <button
44
- key={text}
45
- className="rounded-2xl bg-black px-8 py-2 text-2xl font-bold text-white"
46
- onClick={onClick}
47
- >
48
- {text}
49
- </button>
50
- ))}
51
- </div>
52
- ) : null}
53
- </>
54
- <button
55
- className={
56
- absolute.tl(5, 7) +
57
- "bg-black rounded-full h-9 w-9 flex justify-center items-center"
58
- }
59
- onClick={clearModal}
60
- >
61
- <div className="x-shape" />
62
- </button>
63
- </div>
64
- </div>
65
- );
66
- }
@@ -1,19 +0,0 @@
1
- import { Button } from "../interface";
2
- import { Modal } from "./Modal";
3
-
4
- export default function TestModal({
5
- children,
6
- options,
7
- }: {
8
- children: React.ReactNode;
9
- options?: {
10
- buttons?: Button[];
11
- };
12
- }) {
13
- const { buttons } = options ?? {};
14
- return (
15
- <Modal options={{ width: "lg", height: "xl", buttons }}>
16
- <div className="pt-18 pl-25">{children}</div>
17
- </Modal>
18
- );
19
- }
@@ -1,37 +0,0 @@
1
- import { center, cn } from "../util";
2
-
3
- export const buttonClassNames = (
4
- href: string,
5
- nowPath: string,
6
- color?: [string, string]
7
- ) => {
8
- const [bg, text] = color ?? ["white", "black"];
9
- const classNames = [
10
- center.row(6),
11
- `text-${text}`,
12
- "font-bold w-full xl:w-50 h-11 xl:rounded-2xl flex justify-center xl:justify-start xl:pl-5",
13
- ].join(" ");
14
-
15
- const checkPathMatch = (href: string, nowPath: string) => {
16
- return href.split("/").pop() === nowPath.split("/").pop();
17
- };
18
-
19
- const toggle = checkPathMatch(href, nowPath)
20
- ? `bg-${bg}`
21
- : "bg-gray-500 xl:bg-transparent";
22
- return [classNames, toggle].join(" ");
23
- };
24
-
25
- export function NavigationContainer({
26
- children,
27
- }: {
28
- children: React.ReactNode;
29
- }) {
30
- const displays = "flex flex-row xl:flex-col z-40";
31
- const positions = "fixed bottom-0 left-0 xl:static";
32
- const sizes = "w-full xl:w-auto";
33
- const styles = "";
34
- return (
35
- <div className={cn(displays, positions, sizes, styles)}>{children}</div>
36
- );
37
- }
@@ -1,3 +0,0 @@
1
- export default function Shelf({ children }: { children: React.ReactNode }) {
2
- return <div className="inline-flex flex-col gap-8 xl:w-auto">{children}</div>;
3
- }
@@ -1,66 +0,0 @@
1
- import { create } from "zustand";
2
- import { WidgetEvent } from "../interface/Widget";
3
-
4
- interface WidgetProps {
5
- events: WidgetEvent[];
6
- setView: (prop: string) => void;
7
- removeView: (prop: string) => void;
8
- setModal: (prop: string) => void;
9
- removeModal: (prop: string) => void;
10
- clearModal: () => void;
11
-
12
- // order for widgets
13
- order: [string, "asc" | "desc"];
14
- setOrder: (prop: string) => void;
15
-
16
- // Temporary data for widgets
17
- tempData: Record<string, string | number>;
18
- setTempData: (prop: Record<string, string | number>) => void;
19
- clearTempData: () => void;
20
- }
21
-
22
- export const useWidgetStore = create<WidgetProps>((set) => ({
23
- events: [],
24
- setView: (prop) =>
25
- set((state) => ({
26
- events: [...state.events, { event: prop, type: "view" }],
27
- })),
28
- removeView: (prop) => {
29
- set((state) => ({
30
- events: state.events.filter(({ event }) => event !== prop),
31
- }));
32
- },
33
-
34
- order: ["", "asc"],
35
- setOrder: (prop) => {
36
- set((state) => {
37
- if (state.order[0] !== prop) {
38
- return {
39
- order: [prop, "asc"],
40
- };
41
- }
42
- return {
43
- order: [prop, state.order[1] === "asc" ? "desc" : "asc"],
44
- };
45
- });
46
- },
47
-
48
- setModal: (prop) =>
49
- set((state) => ({
50
- events: [...state.events, { event: prop, type: "modal" }],
51
- })),
52
- removeModal: (prop) => {
53
- set((state) => ({
54
- events: state.events.filter(({ event }) => event !== prop),
55
- }));
56
- },
57
- clearModal: () =>
58
- set((state) => ({
59
- events: state.events.filter(({ type }) => type !== "modal"),
60
- })),
61
-
62
- tempData: {},
63
- setTempData: (prop) =>
64
- set((state) => ({ tempData: { ...state.tempData, ...prop } })),
65
- clearTempData: () => set({ tempData: {} }),
66
- }));
@@ -1,13 +0,0 @@
1
- import { col } from "../util";
2
-
3
- export function LineBreaks({ texts, gap }: { texts: string[]; gap?: number }) {
4
- return (
5
- <div className={col(gap)}>
6
- {texts.map((text, index) => (
7
- <div key={index} className="leading-tight">
8
- {text}
9
- </div>
10
- ))}
11
- </div>
12
- );
13
- }
@@ -1,4 +0,0 @@
1
- export default function classNames(...props: string[]) {
2
- const array = props.map((prop) => prop.split(" "));
3
- return array.flat().join(" ");
4
- }
@@ -1,11 +0,0 @@
1
- export const colorsByLevel = {
2
- PS: "ps-pink",
3
- ST: "st-orange",
4
- BA: "ba-yellow",
5
- JR: "jr-blue",
6
- HJ: "hj-blue",
7
- };
8
-
9
- export const gradient = {
10
- lab: "gradient-to-br from-violet-light/20 to-blue-sky/40 ",
11
- };
@@ -1,31 +0,0 @@
1
- export const row = (gap = 8) => `flex flex-row gap-${gap} `;
2
- export const col = (gap = 8, width?: number | string) =>
3
- `flex flex-col gap-${gap} ${width ? `w-${width}` : "w-full"} `;
4
-
5
- export const between = {
6
- row: "flex flex-row justify-between items-center ",
7
- col: "flex flex-col justify-between items-center ",
8
- };
9
-
10
- export const center = {
11
- col: (gap = 0) => `gap-${gap} flex flex-col items-center `,
12
- row: (gap = 0) => `gap-${gap} flex flex-row items-center `,
13
- colO: (gap = 0) => `gap-${gap} flex flex-col justify-center items-center `,
14
- rowO: (gap = 0) => `gap-${gap} flex flex-row justify-center items-center `,
15
- screen: {
16
- default:
17
- "flex justify-center items-center min-h-screen w-full overflow-hidden min-h-screen relative ",
18
- col: (gap = 0) => `gap-${gap} flex flex-col justify-center items-center min-h-screen w-full `,
19
- row: (gap = 0) => `gap-${gap} flex flex-row justify-center items-center min-h-screen w-full `,
20
- },
21
- };
22
-
23
- export const grid = {
24
- col: (col: number, gap = 12) => `grid grid-cols-${col} gap-${gap} `,
25
- row: (row: number, gap = 12) => `grid grid-rows-${row} gap-${gap}`,
26
- };
27
-
28
- export const box = {
29
- row: (height: number, gap?: number) => `h-${height} gap-${gap} flex flex-row `,
30
- col: (width: number, gap?: number) => `w-${width} gap-${gap} flex flex-col `,
31
- };
@@ -1,17 +0,0 @@
1
- export const responsiveColToRow = () => {
2
- const df = "flex flex-col";
3
- const mark = "md:flex-row";
4
- return [df, mark].join(" ");
5
- };
6
-
7
- export const responsiveRowToCol = () => {
8
- const df = "flex flex-row";
9
- const md = "md:flex-col";
10
- return [df, md].join(" ");
11
- };
12
-
13
- export const responsiveGridToCol = (gridCell: number) => {
14
- const df = `grid grid-cols-${gridCell}`;
15
- const md = "md:flex md:flex-col";
16
- return [df, md].join(" ");
17
- };
@@ -1,18 +0,0 @@
1
- type Color = [string, string];
2
- export const buttonStyle = {
3
- default: (colorSet: [Color, Color] | [Color], size?: { width: number }) => {
4
- const [colors, hoverColors] = colorSet;
5
- const [bgColor, textColor] = colors;
6
- const [bgHoverColor, textHoverColor] = hoverColors || ["", ""];
7
- const { width } = size || { width: 32 };
8
-
9
- const classNames = [
10
- `w-${width}`,
11
- `bg-${bgColor} ${bgHoverColor ? `hover:bg-${bgHoverColor}` : ""}`,
12
- `text-${textColor} ${textHoverColor ? `hover:text-${textHoverColor}` : ""}`,
13
- "font-bold py-2 px-4 rounded",
14
- ];
15
-
16
- return classNames.join(" ");
17
- },
18
- };