@edu-tosel/design 1.0.19 → 1.0.21

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 (71) hide show
  1. package/board/template/CanvasBoard.d.ts +2 -2
  2. package/board/template/CanvasBoard.js +9 -4
  3. package/board/template/ManageBoard.d.ts +1 -1
  4. package/board/template/ManageBoard.js +1 -2
  5. package/board/widget/Header.d.ts +1 -1
  6. package/board/widget/Header.js +3 -3
  7. package/card/index.d.ts +0 -1
  8. package/card/index.js +0 -1
  9. package/card/template/AddCard.js +1 -1
  10. package/card/template/ChartCard.js +1 -1
  11. package/card/template/InfoCard.d.ts +11 -16
  12. package/card/template/InfoCard.js +82 -7
  13. package/card/template/NavCard.js +1 -1
  14. package/card/template/TableCard.d.ts +6 -2
  15. package/card/template/TableCard.js +18 -20
  16. package/card/widget/Card.design.d.ts +1 -1
  17. package/card/widget/Card.design.js +3 -3
  18. package/card/widget/InfoCard.design.js +1 -1
  19. package/card/widget/NavCard.design.d.ts +1 -1
  20. package/card/widget/NavCard.design.js +13 -7
  21. package/card/widget/TableCard.design.d.ts +4 -0
  22. package/card/widget/TableCard.design.js +28 -0
  23. package/globals.css +3 -0
  24. package/hook/index.d.ts +2 -0
  25. package/hook/index.js +2 -0
  26. package/hook/useEase.d.ts +1 -0
  27. package/hook/useEase.js +11 -0
  28. package/hook/useEvents.d.ts +3 -0
  29. package/{util/hooks.js → hook/useEvents.js} +1 -11
  30. package/html/template/Label.d.ts +2 -4
  31. package/html/template/Label.js +1 -1
  32. package/html/widget/Input.d.ts +1 -1
  33. package/html/widget/Input.js +3 -3
  34. package/interaction/template/NoData.d.ts +9 -1
  35. package/interaction/template/NoData.js +7 -2
  36. package/interaction/widget/Script.design.d.ts +1 -1
  37. package/interaction/widget/Script.design.js +7 -1
  38. package/interaction/widget/Sign.design.d.ts +5 -0
  39. package/interaction/widget/Sign.design.js +10 -0
  40. package/interface/Board.d.ts +16 -21
  41. package/interface/Card.d.ts +51 -3
  42. package/interface/HTMLElement.d.ts +1 -0
  43. package/interface/Property.d.ts +3 -1
  44. package/interface/Widget.d.ts +4 -2
  45. package/layout/index.d.ts +1 -1
  46. package/layout/index.js +1 -1
  47. package/layout/template/Dashboard.d.ts +5 -0
  48. package/layout/template/Dashboard.js +5 -0
  49. package/layout/template/Row.d.ts +6 -2
  50. package/layout/template/Row.js +7 -6
  51. package/layout/widget/Row.design.d.ts +1 -1
  52. package/layout/widget/Row.design.js +5 -5
  53. package/layout/widget/dashboard/Header.js +23 -0
  54. package/layout/widget/dashboard/Layout.d.ts +2 -0
  55. package/layout/{template/dashboard/index.js → widget/dashboard/Layout.js} +1 -5
  56. package/layout/widget/dashboard/Menu.d.ts +4 -0
  57. package/layout/widget/dashboard/Menu.js +20 -0
  58. package/modal/widget/Modal.design.d.ts +1 -1
  59. package/modal/widget/Modal.design.js +7 -1
  60. package/navigation/Navigation.js +1 -1
  61. package/package.json +1 -1
  62. package/tailwind.config.ts +6 -0
  63. package/util/colors.d.ts +8 -0
  64. package/util/colors.js +5 -0
  65. package/util/index.d.ts +1 -2
  66. package/util/index.js +1 -2
  67. package/version.txt +1 -1
  68. package/layout/template/dashboard/Header.js +0 -19
  69. package/layout/template/dashboard/index.d.ts +0 -6
  70. package/util/hooks.d.ts +0 -4
  71. /package/layout/{template → widget}/dashboard/Header.d.ts +0 -0
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../../util";
3
+ export default function SignDesign({ script, color, className, }) {
4
+ const container = {
5
+ displays: "flex flex-col justify-center items-center gap-2",
6
+ sizes: "w-full h-16.25",
7
+ className,
8
+ };
9
+ return (_jsxs("div", { className: cn(container), children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", children: [_jsx("path", { d: "M8.75 23.75H31.25M8.75 23.75C7.42392 23.75 6.15215 23.2232 5.21447 22.2855C4.27678 21.3479 3.75 20.0761 3.75 18.75M8.75 23.75C7.42392 23.75 6.15215 24.2768 5.21447 25.2145C4.27678 26.1521 3.75 27.4239 3.75 28.75C3.75 30.0761 4.27678 31.3479 5.21447 32.2855C6.15215 33.2232 7.42392 33.75 8.75 33.75H31.25C32.5761 33.75 33.8479 33.2232 34.7855 32.2855C35.7232 31.3479 36.25 30.0761 36.25 28.75C36.25 27.4239 35.7232 26.1521 34.7855 25.2145C33.8479 24.2768 32.5761 23.75 31.25 23.75M31.25 23.75C32.5761 23.75 33.8479 23.2232 34.7855 22.2855C35.7232 21.3479 36.25 20.0761 36.25 18.75M3.75 18.75C3.75 17.4239 4.27678 16.1521 5.21447 15.2145C6.15215 14.2768 7.42392 13.75 8.75 13.75H31.25C32.5761 13.75 33.8479 14.2768 34.7855 15.2145C35.7232 16.1521 36.25 17.4239 36.25 18.75M3.75 18.75C3.75 17.1272 4.27633 15.5482 5.25 14.25L9.56167 8.5C10.0856 7.8014 10.765 7.23438 11.5461 6.84385C12.3272 6.45332 13.1884 6.25 14.0617 6.25M36.25 18.75C36.25 17.1272 35.7237 15.5482 34.75 14.25L30.4383 8.5C29.375 7.08333 27.7083 6.25 25.9383 6.25M31.25 28.75H31.2633V28.7633H31.25V28.75ZM31.25 18.75H31.2633V18.7633H31.25V18.75ZM26.25 28.75H26.2633V28.7633H26.25V28.75ZM26.25 18.75H26.2633V18.7633H26.25V18.75Z", stroke: color ?? "#910023", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M18 4L22 8M22 4L18 8", stroke: color ?? "#910023", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })] }), _jsx("div", { className: "text-sm", children: script })] }));
10
+ }
@@ -1,6 +1,6 @@
1
- import React from "react";
2
1
  import { DataField, Size, State, Titles } from "./Property";
3
2
  import { EventsProps } from "./Widget";
3
+ import { HTMLInputElement, HTMLLabelElement } from "./HTMLElement";
4
4
  interface OptionsProps {
5
5
  classNames?: string;
6
6
  width?: Size;
@@ -10,28 +10,25 @@ interface OptionsProps {
10
10
  noPadding?: boolean;
11
11
  }
12
12
  export interface BoardProps {
13
+ header?: BoardHeaderProps;
13
14
  children?: React.ReactNode;
14
15
  widgets?: EventsProps;
15
16
  options?: OptionsProps;
16
17
  debug?: string;
18
+ buttons?: HTMLLabelElement[];
17
19
  }
18
20
  export interface BoardHeaderProps {
19
- titles?: Titles & {
21
+ titles?: Omit<Titles, "subtitle"> & {
20
22
  icon?: string;
21
23
  };
22
- tags?: {
24
+ tag?: {
23
25
  selects?: {
24
26
  title: string;
25
27
  state: State<string>;
26
28
  options: [string | number, string][];
27
29
  width?: Size;
28
30
  }[];
29
- inputs?: {
30
- state: State<string>;
31
- placeholder?: string;
32
- title?: string;
33
- width?: Size;
34
- }[];
31
+ inputs?: HTMLInputElement[];
35
32
  };
36
33
  options?: {
37
34
  colors?: {
@@ -40,20 +37,18 @@ export interface BoardHeaderProps {
40
37
  };
41
38
  };
42
39
  }
40
+ export interface CanvasBoardProps extends BoardProps {
41
+ }
43
42
  export interface ManageBoardProps<T> extends BoardProps {
44
- data: {
45
- dataSets: {
46
- items: T[] | undefined;
47
- renderItem: (item: T) => React.ReactNode;
48
- titles?: Titles;
49
- interaction?: React.ReactNode;
50
- }[];
51
- dataField?: {
52
- [p in keyof T]?: Partial<DataField>;
53
- };
54
- gap?: number;
43
+ dataSets: {
44
+ items: T[] | undefined;
45
+ renderItem: (item: T) => React.ReactNode;
46
+ titles?: Titles;
47
+ interaction?: React.ReactNode;
48
+ }[];
49
+ dataField?: {
50
+ [p in keyof T]?: Partial<DataField>;
55
51
  };
56
- header?: BoardHeaderProps;
57
52
  }
58
53
  export interface PaperBoardProps extends BoardProps {
59
54
  }
@@ -1,7 +1,7 @@
1
1
  import { Button, DataField, ImageSize, OnClick, Size, Titles } from "./Property";
2
2
  interface CardOptions {
3
3
  classNames?: string;
4
- boundary?: "shadow" | "border" | "none";
4
+ boundary?: string;
5
5
  rounded?: string;
6
6
  height?: Size;
7
7
  width?: Size;
@@ -11,6 +11,7 @@ interface CardOptions {
11
11
  onClick?: OnClick;
12
12
  overflow?: "hiden" | "y-scroll" | "auto";
13
13
  noPadding?: boolean;
14
+ padding?: string | false;
14
15
  noShadow?: boolean;
15
16
  }
16
17
  export interface CardProps {
@@ -74,6 +75,16 @@ export interface InfoCardProps extends CardProps {
74
75
  titleBorder?: string;
75
76
  } & CardOptions;
76
77
  }
78
+ export interface InfoCardPersonalInformationProps extends Omit<InfoCardProps, "children"> {
79
+ data: {
80
+ school: string;
81
+ academy: string;
82
+ username: string;
83
+ name: string;
84
+ email: string;
85
+ phone: string;
86
+ };
87
+ }
77
88
  export interface InfoCardExamProps extends Omit<InfoCardProps, "children"> {
78
89
  data: {
79
90
  status: string;
@@ -83,6 +94,17 @@ export interface InfoCardExamProps extends Omit<InfoCardProps, "children"> {
83
94
  isPublic: boolean;
84
95
  };
85
96
  }
97
+ export interface InfoCardExamDataREGProps extends Omit<InfoCardProps, "children"> {
98
+ data?: {
99
+ scores: number[];
100
+ };
101
+ }
102
+ export interface InfoCardExamDataOLYProps extends Omit<InfoCardProps, "children"> {
103
+ data?: {
104
+ score: number;
105
+ prize: string | null;
106
+ };
107
+ }
86
108
  export interface InfoCardProductProps extends Omit<InfoCardProps, "children"> {
87
109
  data: {
88
110
  date?: string;
@@ -92,16 +114,42 @@ export interface InfoCardProductProps extends Omit<InfoCardProps, "children"> {
92
114
  button?: Button;
93
115
  };
94
116
  }
117
+ export interface InfoCardItemProps extends Omit<InfoCardProps, "children"> {
118
+ data: {
119
+ item: string;
120
+ };
121
+ }
122
+ export interface InfoCardGradeProps extends Omit<InfoCardProps, "children"> {
123
+ data: {
124
+ level?: string;
125
+ levelString?: string;
126
+ levelColor?: string;
127
+ profileImage?: string;
128
+ score?: number;
129
+ grade?: number;
130
+ };
131
+ }
95
132
  export interface AddCardProps extends Omit<CardProps, "children"> {
96
133
  title?: string;
97
134
  icon?: string;
98
135
  onClick: OnClick;
99
136
  }
100
137
  export interface TableCardProps<T> extends Omit<CardProps, "children"> {
101
- dataSets: T[];
138
+ dataSet: {
139
+ items: T[];
140
+ onClick?: OnClick<T>;
141
+ noData?: React.ReactNode;
142
+ };
102
143
  dataField: {
103
144
  [p in keyof T]?: Partial<DataField>;
104
145
  };
105
- options?: CardOptions;
146
+ options?: CardOptions & {
147
+ className?: string;
148
+ limit?: number;
149
+ rowHeight?: string;
150
+ noHover?: boolean;
151
+ noRowPadding?: boolean;
152
+ noHeader?: boolean;
153
+ };
106
154
  }
107
155
  export {};
@@ -27,6 +27,7 @@ export interface HTMLSelectElement extends HTMLElement {
27
27
  }
28
28
  export interface HTMLInputElement extends HTMLElement {
29
29
  state: State<string>;
30
+ onKeyDown?: (e: React.KeyboardEvent) => void;
30
31
  placeholder?: string;
31
32
  }
32
33
  export interface HTMLToggleElement extends HTMLElement {
@@ -34,7 +34,7 @@ export type Size = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "auto";
34
34
  * @property {"sub"} sub - Sub size
35
35
  * @property {"full"} full - Full size
36
36
  */
37
- export type OnClick = () => unknown | (() => Promise<unknown>);
37
+ export type OnClick<T = unknown> = (prop?: T) => unknown | ((prop?: T) => Promise<unknown>);
38
38
  export type Button = [string, OnClick];
39
39
  export type Scripts = {
40
40
  script: string;
@@ -45,6 +45,8 @@ export type Titles = {
45
45
  subtitle?: string | string[];
46
46
  isSub?: boolean;
47
47
  color?: string;
48
+ titleColor?: string;
49
+ subtitleColor?: string;
48
50
  };
49
51
  export type DataField = {
50
52
  title: string | number;
@@ -32,15 +32,17 @@ export interface DataFieldProps<T> {
32
32
  };
33
33
  }
34
34
  export interface RowProps<T> {
35
- onClick?: OnClick;
36
- dataSet: T;
35
+ onClick?: OnClick<T>;
36
+ item: T;
37
37
  dataField?: {
38
38
  [p in keyof T]?: Partial<DataField>;
39
39
  };
40
40
  options?: {
41
+ height?: string;
41
42
  size?: string;
42
43
  padding?: string;
43
44
  text?: string;
45
+ noHover?: boolean;
44
46
  };
45
47
  }
46
48
  export {};
package/layout/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { default as Events } from "./template/Events";
2
- export { default as Dashboard } from "./template/dashboard";
2
+ export { default as Dashboard } from "./template/Dashboard";
3
3
  export { default as DataField } from "./template/DataField";
4
4
  export { default as Gallery } from "./template/Gallery";
5
5
  export { default as Row } from "./template/Row";
package/layout/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export { default as Events } from "./template/Events";
2
- export { default as Dashboard } from "./template/dashboard";
2
+ export { default as Dashboard } from "./template/Dashboard";
3
3
  export { default as DataField } from "./template/DataField";
4
4
  export { default as Gallery } from "./template/Gallery";
5
5
  export { default as Row } from "./template/Row";
@@ -0,0 +1,5 @@
1
+ import Layout from "../widget/dashboard/Layout";
2
+ declare const Dashboard: {
3
+ Layout: typeof Layout;
4
+ };
5
+ export default Dashboard;
@@ -0,0 +1,5 @@
1
+ import Layout from "../widget/dashboard/Layout";
2
+ const Dashboard = {
3
+ Layout,
4
+ };
5
+ export default Dashboard;
@@ -1,6 +1,10 @@
1
1
  import { RowProps } from "../../interface";
2
- declare function Board<T extends Record<string, any>>({ dataSet, dataField, onClick, }: RowProps<T>): import("react/jsx-runtime").JSX.Element;
3
- declare function Card<T extends Record<string, any>>({ dataSet, dataField, onClick, }: RowProps<T>): import("react/jsx-runtime").JSX.Element;
2
+ declare function Board<T extends Record<string, any>>({ item, dataField, onClick, }: RowProps<T>): import("react/jsx-runtime").JSX.Element;
3
+ declare function Card<T extends Record<string, any>>({ item, dataField, onClick, height, noPadding, noHover, }: Omit<RowProps<T>, "options"> & {
4
+ height?: string;
5
+ noPadding?: boolean;
6
+ noHover?: boolean;
7
+ }): import("react/jsx-runtime").JSX.Element;
4
8
  declare const Row: {
5
9
  Board: typeof Board;
6
10
  Card: typeof Card;
@@ -1,20 +1,21 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useId } from "react";
3
3
  import RowDesign from "../widget/Row.design";
4
- function Board({ dataSet, dataField, onClick, }) {
4
+ function Board({ item, dataField, onClick, }) {
5
5
  const id = useId();
6
- return (_jsx(RowDesign, { onClick: onClick, dataSet: dataSet, dataField: dataField, options: {
6
+ return (_jsx(RowDesign, { onClick: onClick, item: item, dataField: dataField, options: {
7
7
  size: "w-full h-12",
8
8
  padding: "px-2 xs:px-4 xl:px-7.5",
9
9
  text: "text-xl",
10
10
  } }, id));
11
11
  }
12
- function Card({ dataSet, dataField, onClick, }) {
12
+ function Card({ item, dataField, onClick, height, noPadding, noHover, }) {
13
13
  const id = useId();
14
- return (_jsx(RowDesign, { onClick: onClick, dataSet: dataSet, dataField: dataField, options: {
15
- size: "w-full h-10",
16
- padding: "px-2 xs:px-4 xl:px-7.5",
14
+ return (_jsx(RowDesign, { onClick: onClick, item: item, dataField: dataField, options: {
15
+ size: `w-full ${height ?? "h-12"}`,
16
+ padding: !noPadding ? "px-2 xs:px-4 xl:px-7.5" : "",
17
17
  text: "text-base",
18
+ noHover,
18
19
  } }, id));
19
20
  }
20
21
  const Row = {
@@ -1,2 +1,2 @@
1
1
  import { RowProps } from "../../interface";
2
- export default function RowDesign<T extends Record<string, any>>({ dataSet, dataField, options, onClick, }: RowProps<T>): import("react/jsx-runtime").JSX.Element;
2
+ export default function RowDesign<T extends Record<string, any>>({ item, dataField, options, onClick, }: RowProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -1,16 +1,16 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useId } from "react";
3
3
  import { cn } from "../../util";
4
- export default function RowDesign({ dataSet, dataField, options, onClick, }) {
5
- const { size, padding, text } = options ?? {};
4
+ export default function RowDesign({ item, dataField, options, onClick, }) {
5
+ const { size, padding, text, noHover } = options ?? {};
6
6
  const id = useId();
7
7
  const container = {
8
8
  displays: "flex items-center ",
9
9
  sizes: size,
10
10
  paddings: padding,
11
11
  text: text,
12
- styles: "hover:bg-gray-100 duration-100",
12
+ styles: !noHover && "hover:bg-gray-100 duration-100",
13
13
  };
14
- return (_jsx("div", { className: cn(container), onClick: onClick, children: dataField &&
15
- Object.keys(dataField).map((key) => (_jsx("div", { className: `w-${dataField[key]?.size}/100 truncate`, children: dataSet[key] }, id + key))) }));
14
+ return (_jsx("div", { className: cn(container), onClick: () => onClick?.(), children: dataField &&
15
+ Object.keys(dataField).map((key) => (_jsx("div", { className: `w-${dataField[key]?.size}/100 truncate`, children: item[key] }, id + key))) }));
16
16
  }
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../../../util";
3
+ import { useWidgetStore } from "../../../store";
4
+ import Menu from "./Menu";
5
+ import { Events } from "../..";
6
+ export function Header({ title, logo, options }) {
7
+ const { events, setView, setIsOwn } = useWidgetStore();
8
+ const { text, background, className } = options ?? {};
9
+ const { isDark, setDark } = useWidgetStore();
10
+ const container = {
11
+ positions: "fixed xl:static top-0 left-0 z-40",
12
+ displays: "flex items-center justify-between ",
13
+ sizes: "h-15 w-full",
14
+ background: `${background ?? "bg-white"} dark:bg-black`,
15
+ text: `${text ?? "text-black"} dark:text-white`,
16
+ styles: "px-5 xl:px-8 2xl:px-16 ",
17
+ className,
18
+ };
19
+ return (_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex h-12 items-center gap-8 xl:gap-24 2xl:gap-26", children: [logo ? (_jsx("a", { href: logo.href, children: _jsx("img", { src: logo.image, alt: "logo", className: "h-6.25 w-28.78" }) })) : (_jsx("div", { className: "text-2xl", children: "TOSEL" })), _jsx("div", { className: "text-3xl font-bold", children: title })] }), _jsx("div", { className: "relative flex gap-5.25", children: _jsxs(Events.Show, { widgets: [["menu", _jsx(Menu, { image: "/images/hani.png" })]], children: [_jsx("svg", { className: "cursor-pointer", xmlns: "http://www.w3.org/2000/svg", width: "25", height: "25", viewBox: "0 0 25 25", fill: "none", children: _jsx("path", { d: "M15.4759 17.7938C17.4168 17.564 19.3237 17.1059 21.1572 16.4292C19.6044 14.7092 18.7465 12.4734 18.7499 10.1562V9.375C18.7499 7.7174 18.0914 6.12769 16.9193 4.95558C15.7472 3.78348 14.1575 3.125 12.4999 3.125C10.8423 3.125 9.25257 3.78348 8.08047 4.95558C6.90837 6.12769 6.24989 7.7174 6.24989 9.375V10.1562C6.25303 12.4736 5.39466 14.7093 3.84155 16.4292C5.64676 17.0958 7.54989 17.5594 9.52384 17.7938M15.4759 17.7938C13.4988 18.0283 11.5009 18.0283 9.52384 17.7938M15.4759 17.7938C15.626 18.2624 15.6634 18.7598 15.5849 19.2455C15.5064 19.7313 15.3143 20.1917 15.0242 20.5891C14.7342 20.9866 14.3544 21.31 13.9157 21.5329C13.4771 21.7559 12.9919 21.8721 12.4999 21.8721C12.0078 21.8721 11.5227 21.7559 11.0841 21.5329C10.6454 21.31 10.2656 20.9866 9.97553 20.5891C9.68548 20.1917 9.49339 19.7313 9.4149 19.2455C9.33641 18.7598 9.37374 18.2624 9.52384 17.7938", stroke: "#910023", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }), _jsx("svg", { className: "cursor-pointer", onClick: () => {
20
+ setIsOwn(true);
21
+ return setView("menu");
22
+ }, xmlns: "http://www.w3.org/2000/svg", width: "25", height: "25", viewBox: "0 0 25 25", fill: "none", children: _jsx("path", { d: "M18.7313 19.5053C18.0034 18.5416 17.0618 17.7601 15.9804 17.2223C14.8991 16.6846 13.7077 16.4052 12.5 16.4063C11.2924 16.4052 10.101 16.6846 9.01964 17.2223C7.93832 17.7601 6.99664 18.5416 6.26878 19.5053M18.7313 19.5053C20.1516 18.2419 21.1533 16.5767 21.6054 14.7304C22.0576 12.884 21.9378 10.9439 21.262 9.16722C20.5862 7.39055 19.3862 5.86128 17.8213 4.78224C16.2564 3.7032 14.4004 3.12537 12.4995 3.12537C10.5986 3.12537 8.74267 3.7032 7.17775 4.78224C5.61282 5.86128 4.41288 7.39055 3.73705 9.16722C3.06122 10.9439 2.94144 12.884 3.3936 14.7304C3.84575 16.5767 4.84847 18.2419 6.26878 19.5053M18.7313 19.5053C17.0167 21.0346 14.7976 21.8783 12.5 21.8751C10.2021 21.8786 7.98361 21.0349 6.26878 19.5053M15.625 10.1563C15.625 10.9851 15.2958 11.78 14.7097 12.366C14.1237 12.9521 13.3288 13.2813 12.5 13.2813C11.6712 13.2813 10.8764 12.9521 10.2903 12.366C9.70427 11.78 9.37503 10.9851 9.37503 10.1563C9.37503 9.32751 9.70427 8.53265 10.2903 7.9466C10.8764 7.36055 11.6712 7.03131 12.5 7.03131C13.3288 7.03131 14.1237 7.36055 14.7097 7.9466C15.2958 8.53265 15.625 9.32751 15.625 10.1563Z", stroke: "#910023", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })] }) })] }));
23
+ }
@@ -0,0 +1,2 @@
1
+ import { DashboardProps } from "../../../interface";
2
+ export default function Layout({ header, navigations, children, options, }: DashboardProps): import("react/jsx-runtime").JSX.Element;
@@ -4,7 +4,7 @@ import { NavigationContainer } from "../../../navigation";
4
4
  import { Header } from "./Header";
5
5
  import { cn } from "../../../util";
6
6
  import { useWidgetStore } from "../../../store";
7
- function Layout({ header, navigations, children, options }) {
7
+ export default function Layout({ header, navigations, children, options, }) {
8
8
  const { isDark, flag, setFlag, isOwn, setIsOwn, clearView } = useWidgetStore();
9
9
  const { title, options: headerOptions, logo } = header;
10
10
  const { background } = options ?? {};
@@ -27,7 +27,3 @@ function Layout({ header, navigations, children, options }) {
27
27
  };
28
28
  return (_jsxs("div", { className: cn(container), onClick: setFlag, children: [_jsx(Header, { title: title, options: headerOptions, logo: logo }), _jsxs("div", { className: cn(body), children: [_jsx(NavigationContainer, { children: navigations.map((nav, index) => (_jsx(Fragment, { children: nav }, index))) }), children] })] }));
29
29
  }
30
- const Dashboard = {
31
- Layout,
32
- };
33
- export default Dashboard;
@@ -0,0 +1,4 @@
1
+ export default function Menu({ isVisible, image, }: {
2
+ isVisible?: boolean;
3
+ image: string;
4
+ }): JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useTransition, animated } from "react-spring";
3
+ import { cn } from "../../../util";
4
+ import { useWidgetStore } from "../../../store";
5
+ export default function Menu({ isVisible, image, }) {
6
+ const { setIsOwn } = useWidgetStore();
7
+ const container = {
8
+ displays: "flex flex-col",
9
+ positions: "absolute top-8 right-0 z-45 ",
10
+ sizes: "w-72 ",
11
+ styles: " bg-white box-shadow",
12
+ };
13
+ const transitions = useTransition(isVisible, {
14
+ from: { opacity: 0 },
15
+ enter: { opacity: 1 },
16
+ leave: { opacity: 0 },
17
+ config: { duration: 200 },
18
+ });
19
+ return transitions((styles, item) => item && (_jsxs(animated.div, { style: styles, className: cn(container), onClick: () => setIsOwn(true), children: [_jsxs("div", { className: "h-48 flex gap-12 justify-center items-center text-black", children: [_jsx("img", { src: image, className: "rounded-full w-20 h-20" }), _jsxs("div", { children: [_jsx("div", { children: "\uD31C\uD558\uB2C8" }), _jsx("div", { className: "text-xs", children: "\uB274\uC9C4\uC2A4 \uCD08\uB4F1\uD559\uAD50" })] })] }), _jsx("a", { href: "/user", className: "flex justify-center py-3 px-5 hover:bg-gray-light", children: "\uB300\uC2DC\uBCF4\uB4DC" }), _jsx("a", { href: "/mypage", className: "flex justify-center py-3 px-5 hover:bg-gray-light", children: "My Page" })] })));
20
+ }
@@ -1,2 +1,2 @@
1
1
  import { ModalProps } from "../../interface/Modal";
2
- export default function ModalDesign({ isVisible, event, children, options, debug, }: ModalProps): import("react").ReactPortal;
2
+ export default function ModalDesign({ isVisible, event, children, options, debug, }: ModalProps): import("react").ReactPortal | null;
@@ -4,6 +4,7 @@ import { useTransition, animated } from "react-spring";
4
4
  import { useWidgetStore } from "../../store";
5
5
  import { cn } from "../../util";
6
6
  import isDebug from "../../util/isDebug";
7
+ import { useEffect, useState } from "react";
7
8
  const widthSize = {
8
9
  xs: "w-2/3 min-w-76 max-w-176",
9
10
  sm: "w-2/3 min-w-76 max-w-176",
@@ -24,7 +25,11 @@ const heightSize = {
24
25
  };
25
26
  export default function ModalDesign({ isVisible, event, children, options, debug, }) {
26
27
  const { buttons, width, height, closeButtonColor, isCloseButton } = options ?? {};
28
+ const [detection, setDetection] = useState(null);
27
29
  const { setIsOwn, removeModal } = useWidgetStore();
30
+ useEffect(() => {
31
+ setDetection(document.getElementById("portal"));
32
+ }, []);
28
33
  const background = {
29
34
  positions: "z-50 fixed top-0 left-0",
30
35
  displays: "flex items-center justify-center ",
@@ -60,5 +65,6 @@ export default function ModalDesign({ isVisible, event, children, options, debug
60
65
  leave: { opacity: 0 },
61
66
  config: { duration: 200 },
62
67
  });
63
- return ReactDOM.createPortal(transitions((styles, item) => item && (_jsx(animated.div, { style: styles, className: cn(background), onClick: () => setIsOwn(true), children: _jsxs("div", { className: cn(container), children: [children, buttons ? (_jsx("div", { className: cn(button.container), children: buttons.map(([text, onClick]) => (_jsx("button", { className: cn(button.body), onClick: onClick, children: text }, text))) })) : null, isCloseButton && event && (_jsx("button", { className: cn(closeButton), onClick: () => removeModal(event), children: _jsx("div", { className: "x-shape" }) }))] }) }))), document.body);
68
+ return (detection &&
69
+ ReactDOM.createPortal(transitions((styles, item) => item && (_jsx(animated.div, { style: styles, className: cn(background), onClick: () => setIsOwn(true), children: _jsxs("div", { className: cn(container), children: [children, buttons ? (_jsx("div", { className: cn(button.container), children: buttons.map(([text, onClick]) => (_jsx("button", { className: cn(button.body), onClick: onClick, children: text }, text))) })) : null, isCloseButton && event && (_jsx("button", { className: cn(closeButton), onClick: () => removeModal(event), children: _jsx("div", { className: "x-shape" }) }))] }) }))), document.body));
64
70
  }
@@ -8,7 +8,7 @@ export const buttonClassNames = (href, nowPath, color) => {
8
8
  const container = {
9
9
  displays: "flex flex-row items-center justify-center xl:justify-start gap-2.5",
10
10
  sizes: " w-full xl:w-51 h-11 ",
11
- styles: "xl:rounded-2xl xl:pl-5 font-bold ",
11
+ styles: "xl:rounded-lg xl:pl-5 font-bold ",
12
12
  };
13
13
  const toggle = checkPathMatch(href, nowPath)
14
14
  ? !isDark
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
@@ -49,6 +49,7 @@ export default {
49
49
  "white-off": "#F5F5F5",
50
50
  "red-burgundy": "#933652",
51
51
  "crimson-burgundy": "#910023",
52
+ "crimson-burgundy-light": "#EDDFE2",
52
53
  "crimson-dark": "#760023",
53
54
  "red-crimson": "#760023",
54
55
  "red-velvet": "#AC647A",
@@ -91,6 +92,7 @@ export default {
91
92
  4.25: "1.0625rem",
92
93
  4.75: "1.1875rem",
93
94
  5.25: "1.3125rem",
95
+ 5.75: "1.4375rem",
94
96
  6.25: "1.5625rem",
95
97
  6.4: "1.6rem",
96
98
  6.5: "1.625rem",
@@ -102,6 +104,7 @@ export default {
102
104
  10.25: "2.5625rem",
103
105
  11: "2.75rem",
104
106
  11.25: "2.8125rem",
107
+ 11.375: "2.84375rem",
105
108
  12: "3rem",
106
109
  13.25: "3.3125rem",
107
110
  13.75: "3.4375rem",
@@ -111,6 +114,7 @@ export default {
111
114
  15: "3.75rem",
112
115
  16: "4rem",
113
116
  18: "4.5rem",
117
+ 18.5: "4.625rem",
114
118
  18.75: "4.6875rem",
115
119
  19: "4.75rem",
116
120
  19.25: "4.8125rem",
@@ -131,6 +135,7 @@ export default {
131
135
  30: "7.5rem",
132
136
  34: "8.5rem",
133
137
  36: "9rem",
138
+ 36.75: "9.1875rem",
134
139
  38: "9.5rem",
135
140
  40: "10rem",
136
141
  41: "10.25rem",
@@ -175,6 +180,7 @@ export default {
175
180
  120: "30rem",
176
181
  122: "30.5rem",
177
182
  124: "31rem",
183
+ 125: "31.25rem",
178
184
  126: "31.5rem",
179
185
  127.5: "31.875rem",
180
186
  128: "32rem",
package/util/colors.d.ts CHANGED
@@ -10,10 +10,18 @@ export declare const gradientBackground: {
10
10
  greenToRed: string;
11
11
  greenToRedSoft: string;
12
12
  };
13
+ export declare const gradientBorder: {
14
+ greenToRed: string;
15
+ greenToRedSoft: string;
16
+ };
13
17
  export declare const gradient: {
14
18
  bg: {
15
19
  lab: string;
16
20
  greenToRed: string;
17
21
  greenToRedSoft: string;
18
22
  };
23
+ border: {
24
+ greenToRed: string;
25
+ greenToRedSoft: string;
26
+ };
19
27
  };
package/util/colors.js CHANGED
@@ -10,6 +10,11 @@ export const gradientBackground = {
10
10
  greenToRed: "bg-gradient-to-r from-green-dark to-red-crimson",
11
11
  greenToRedSoft: "bg-gradient-to-r from-green-dark/20 to-red-crimson/20",
12
12
  };
13
+ export const gradientBorder = {
14
+ greenToRed: "border-gradient-to-r from-green-dark to-crimson-burgundy",
15
+ greenToRedSoft: "border-gradient-to-r from-green-dark/20 to-red-crimson/20",
16
+ };
13
17
  export const gradient = {
14
18
  bg: gradientBackground,
19
+ border: gradientBorder,
15
20
  };
package/util/index.d.ts CHANGED
@@ -4,7 +4,6 @@ export { default as isDebug } from "./isDebug";
4
4
  export { default as sortByOrder } from "./sortByOrder";
5
5
  export { default as checkPathMatch } from "./checkPathMatch";
6
6
  export * from "./colors";
7
- export * from "./hooks";
8
7
  export * from "./pattern";
9
8
  export * from "./shape";
10
- export * from "./hooks";
9
+ export * from "../hook";
package/util/index.js CHANGED
@@ -4,7 +4,6 @@ export { default as isDebug } from "./isDebug";
4
4
  export { default as sortByOrder } from "./sortByOrder";
5
5
  export { default as checkPathMatch } from "./checkPathMatch";
6
6
  export * from "./colors";
7
- export * from "./hooks";
8
7
  export * from "./pattern";
9
8
  export * from "./shape";
10
- export * from "./hooks";
9
+ export * from "../hook";
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.19
1
+ 1.0.21
@@ -1,19 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from "react";
3
- import { cn } from "../../../util";
4
- import { useWidgetStore } from "../../../store";
5
- export function Header({ title, logo, options }) {
6
- const { text, background, className } = options ?? {};
7
- const { isDark, setDark } = useWidgetStore();
8
- const [isOpen, setIsOpen] = useState(false);
9
- const container = {
10
- positions: "fixed xl:static top-0 left-0 z-40",
11
- displays: "flex items-center justify-between ",
12
- sizes: "h-15 w-full",
13
- background: `${background ?? "bg-white"} dark:bg-black`,
14
- text: `${text ?? "text-black"} dark:text-white`,
15
- styles: "px-5 xl:px-8 2xl:px-16 ",
16
- className,
17
- };
18
- return (_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex h-12 items-center gap-8 xl:gap-24 2xl:gap-26", children: [logo ? (_jsx("a", { href: logo.href, children: _jsx("img", { src: logo.image, alt: "logo", className: "h-6.25 w-28.78" }) })) : (_jsx("div", { className: "text-2xl", children: "TOSEL" })), _jsx("div", { className: "text-3xl font-bold", children: title })] }), _jsx("button", { onClick: setDark, children: "DARK" })] }));
19
- }
@@ -1,6 +0,0 @@
1
- import { DashboardProps } from "../../../interface";
2
- declare function Layout({ header, navigations, children, options }: DashboardProps): import("react/jsx-runtime").JSX.Element;
3
- declare const Dashboard: {
4
- Layout: typeof Layout;
5
- };
6
- export default Dashboard;
package/util/hooks.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export declare function useEase(inTime: number, outTime: number): readonly [boolean, number];
2
- type Event = readonly [boolean, string];
3
- export declare function useEvents(args: Event[]): string[];
4
- export {};