@edu-tosel/design 1.0.13 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/asset/fonts/TimesNewerRoman-Bold.otf +0 -0
- package/asset/fonts/TimesNewerRoman-BoldItalic.otf +0 -0
- package/board/template/CanvasBoard.d.ts +1 -1
- package/board/template/CanvasBoard.js +3 -3
- package/board/template/ManageBoard.d.ts +3 -3
- package/board/template/ManageBoard.js +17 -21
- package/board/template/PaperBoard.d.ts +1 -1
- package/board/template/PaperBoard.js +4 -4
- package/board/widget/Board.js +12 -18
- package/board/widget/DataField.d.ts +4 -3
- package/board/widget/DataField.js +19 -13
- package/board/widget/Header.d.ts +1 -1
- package/board/widget/Header.js +11 -9
- package/board/widget/Tags.d.ts +14 -3
- package/card/index.d.ts +1 -0
- package/card/index.js +1 -0
- package/card/template/AddCard.d.ts +2 -0
- package/card/template/AddCard.js +11 -0
- package/card/template/ChartCard.js +1 -1
- package/card/template/InfoCard.d.ts +32 -2
- package/card/template/InfoCard.design.d.ts +2 -0
- package/card/template/InfoCard.design.js +23 -0
- package/card/template/InfoCard.js +72 -8
- package/card/template/ReportCard.d.ts +1 -1
- package/card/template/ReportCard.js +3 -11
- package/card/template/RowCard.d.ts +2 -5
- package/card/template/RowCard.js +16 -18
- package/card/template/TableCard.d.ts +4 -2
- package/card/template/TableCard.js +22 -9
- package/card/template/TrumpCard.js +2 -2
- package/card/widget/Card.d.ts +1 -1
- package/card/widget/Card.js +40 -13
- package/deck/index.d.ts +1 -1
- package/deck/index.js +1 -1
- package/deck/template/Deck.d.ts +6 -0
- package/deck/template/Deck.design.d.ts +2 -0
- package/deck/template/Deck.design.js +21 -0
- package/deck/template/Deck.js +11 -0
- package/deck/widget/Deck.d.ts +2 -0
- package/deck/widget/Deck.js +14 -0
- package/globals.css +119 -1
- package/html/index.d.ts +4 -0
- package/html/index.js +4 -0
- package/html/widget/Button.d.ts +2 -0
- package/html/widget/Button.js +15 -0
- package/html/widget/DatePicker.d.ts +3 -0
- package/html/widget/DatePicker.js +23 -0
- package/html/widget/Input.d.ts +2 -0
- package/html/widget/Input.js +22 -0
- package/html/widget/Select.d.ts +2 -0
- package/html/widget/Select.js +160 -0
- package/html/widget/Toggle.d.ts +2 -0
- package/html/widget/Toggle.js +13 -0
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/interface/Board.d.ts +16 -19
- package/interface/Card.d.ts +47 -37
- package/{deck → interface}/Deck.d.ts +4 -7
- package/interface/HTMLElement.d.ts +22 -14
- package/interface/HTMLElement.js +7 -1
- package/interface/Modal.d.ts +6 -1
- package/interface/Overlay.d.ts +20 -0
- package/interface/Overlay.js +1 -0
- package/interface/Property.d.ts +12 -1
- package/interface/Shelf.d.ts +22 -0
- package/interface/Shelf.js +1 -0
- package/interface/Widget.d.ts +19 -0
- package/interface/index.d.ts +3 -0
- package/interface/index.js +3 -0
- package/layout/index.d.ts +4 -1
- package/layout/index.js +4 -1
- package/layout/template/Gallery.d.ts +7 -0
- package/layout/template/Gallery.js +6 -0
- package/layout/template/Shelf.d.ts +8 -0
- package/layout/template/Shelf.js +41 -0
- package/layout/{dashboard → template/dashboard}/Header.d.ts +0 -1
- package/layout/template/dashboard/Header.js +17 -0
- package/layout/{dashboard → template/dashboard}/index.d.ts +5 -1
- package/layout/template/dashboard/index.js +33 -0
- package/layout/template/report/Header.js +11 -0
- package/layout/widget/Events.d.ts +8 -0
- package/layout/widget/Events.js +44 -0
- package/layout/widget/Shelf.d.ts +2 -0
- package/layout/widget/Shelf.js +25 -0
- package/{board → layout}/widget/Tab.js +6 -8
- package/modal/index.d.ts +1 -3
- package/modal/index.js +1 -3
- package/modal/template/Alert.d.ts +2 -0
- package/modal/template/Alert.js +8 -0
- package/modal/template/Input.d.ts +6 -0
- package/modal/template/Input.js +6 -0
- package/modal/template/index.d.ts +7 -0
- package/modal/template/index.js +7 -0
- package/modal/widget/Modal.design.d.ts +2 -0
- package/modal/widget/Modal.design.js +64 -0
- package/navigation/Navigation.d.ts +1 -1
- package/navigation/Navigation.js +21 -17
- package/overlay/index.d.ts +1 -0
- package/overlay/index.js +1 -0
- package/overlay/template/Info.d.ts +2 -0
- package/overlay/template/Info.js +5 -0
- package/overlay/template/Manage.d.ts +2 -0
- package/overlay/template/Manage.js +17 -0
- package/overlay/template/index.d.ts +7 -0
- package/overlay/template/index.js +7 -0
- package/overlay/widget/Overlay.design.d.ts +2 -0
- package/overlay/widget/Overlay.design.js +25 -0
- package/package.json +6 -2
- package/store/index.d.ts +10 -3
- package/store/index.js +38 -11
- package/tailwind.config.ts +56 -0
- package/text/Formatter.d.ts +3 -0
- package/text/Formatter.js +18 -0
- package/text/index.d.ts +1 -0
- package/text/index.js +1 -0
- package/util/checkPathMatch.d.ts +2 -0
- package/util/checkPathMatch.js +8 -0
- package/util/colors.d.ts +2 -1
- package/util/colors.js +2 -1
- package/util/convertUnixTimestampToDate.d.ts +1 -0
- package/util/convertUnixTimestampToDate.js +5 -0
- package/util/index.d.ts +3 -0
- package/util/index.js +3 -0
- package/util/isDebug.d.ts +1 -0
- package/util/isDebug.js +5 -0
- package/util/sortByOrder.d.ts +4 -0
- package/util/sortByOrder.js +20 -0
- package/version.txt +1 -1
- package/card/template/InfoCardCssCase.d.ts +0 -25
- package/card/template/InfoCardCssCase.js +0 -32
- package/card/template/PropfileCard.d.ts +0 -2
- package/card/template/PropfileCard.js +0 -6
- package/deck/Deck.js +0 -22
- package/interface/Menu.d.ts +0 -6
- package/layout/dashboard/Header.js +0 -19
- package/layout/dashboard/index.js +0 -10
- package/layout/report/Header.js +0 -11
- package/menu/index.d.ts +0 -1
- package/menu/index.js +0 -1
- package/menu/template/SideMenu.d.ts +0 -2
- package/menu/template/SideMenu.js +0 -20
- package/menu/widget/HTMLElement.d.ts +0 -8
- package/menu/widget/HTMLElement.js +0 -9
- package/modal/AlertModal.d.ts +0 -2
- package/modal/AlertModal.js +0 -8
- package/modal/ControllerModal.d.ts +0 -6
- package/modal/ControllerModal.js +0 -6
- package/modal/Modal.d.ts +0 -2
- package/modal/Modal.js +0 -31
- package/modal/TestModal.d.ts +0 -7
- package/modal/TestModal.js +0 -6
- package/shelf/Shelf.d.ts +0 -3
- package/shelf/Shelf.js +0 -4
- package/shelf/index.d.ts +0 -1
- package/shelf/index.js +0 -1
- /package/interface/{Menu.js → Deck.js} +0 -0
- /package/layout/{report → template/report}/Header.d.ts +0 -0
- /package/{board → layout}/widget/Tab.d.ts +0 -0
package/interface/Board.d.ts
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { DataField, Size, State, Titles } from "./Property";
|
|
3
|
+
import { EventsProps } from "./Widget";
|
|
3
4
|
interface OptionsProps {
|
|
5
|
+
classNames?: string;
|
|
4
6
|
width?: Size;
|
|
5
7
|
height?: Size;
|
|
6
8
|
color?: string;
|
|
7
9
|
isRounded?: boolean;
|
|
8
|
-
|
|
9
|
-
interface WidgetsProps {
|
|
10
|
-
exceptions?: [boolean, React.ReactNode][];
|
|
11
|
-
components?: [boolean | string, React.ReactNode][];
|
|
12
|
-
tabs?: Button[];
|
|
10
|
+
noPadding?: boolean;
|
|
13
11
|
}
|
|
14
12
|
export interface BoardProps {
|
|
15
13
|
children?: React.ReactNode;
|
|
16
|
-
widgets?:
|
|
14
|
+
widgets?: EventsProps;
|
|
17
15
|
options?: OptionsProps;
|
|
18
16
|
debug?: string;
|
|
19
17
|
}
|
|
20
18
|
export interface BoardHeaderProps {
|
|
21
|
-
|
|
19
|
+
titles?: Titles & {
|
|
20
|
+
icon?: string;
|
|
21
|
+
};
|
|
22
22
|
tags?: {
|
|
23
23
|
selects?: {
|
|
24
24
|
title: string;
|
|
25
|
-
|
|
25
|
+
state: State<string>;
|
|
26
26
|
options: [string | number, string][];
|
|
27
27
|
width?: Size;
|
|
28
28
|
}[];
|
|
29
29
|
inputs?: {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
state: State<string>;
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
title?: string;
|
|
33
33
|
width?: Size;
|
|
34
34
|
}[];
|
|
35
35
|
};
|
|
@@ -43,20 +43,17 @@ export interface BoardHeaderProps {
|
|
|
43
43
|
export interface ManageBoardProps<T> extends BoardProps {
|
|
44
44
|
data: {
|
|
45
45
|
dataSets: {
|
|
46
|
-
title?: string;
|
|
47
46
|
items: T[] | undefined;
|
|
48
47
|
renderItem: (item: T) => React.ReactNode;
|
|
48
|
+
titles?: Titles;
|
|
49
|
+
interaction?: React.ReactNode;
|
|
49
50
|
}[];
|
|
50
51
|
dataField?: {
|
|
51
|
-
|
|
52
|
-
sizes: Record<string, string>;
|
|
52
|
+
[p in keyof T]?: Partial<DataField>;
|
|
53
53
|
};
|
|
54
54
|
gap?: number;
|
|
55
55
|
};
|
|
56
56
|
header?: BoardHeaderProps;
|
|
57
|
-
widgets?: {
|
|
58
|
-
menu?: React.ReactNode;
|
|
59
|
-
} & WidgetsProps;
|
|
60
57
|
}
|
|
61
58
|
export interface PaperBoardProps extends BoardProps {
|
|
62
59
|
}
|
package/interface/Card.d.ts
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
|
-
import { ImageSize, Size } from "./Property";
|
|
1
|
+
import { Button, DataField, ImageSize, OnClick, Size, Titles } from "./Property";
|
|
2
|
+
interface CardOptions {
|
|
3
|
+
classNames?: string;
|
|
4
|
+
boundary?: "shadow" | "border" | "none";
|
|
5
|
+
rounded?: string;
|
|
6
|
+
height?: Size;
|
|
7
|
+
width?: Size;
|
|
8
|
+
background?: {
|
|
9
|
+
color?: string;
|
|
10
|
+
};
|
|
11
|
+
text?: {
|
|
12
|
+
size?: string;
|
|
13
|
+
color?: string;
|
|
14
|
+
};
|
|
15
|
+
border?: {
|
|
16
|
+
color?: string;
|
|
17
|
+
};
|
|
18
|
+
onClick?: () => unknown | (() => Promise<unknown>);
|
|
19
|
+
overflow?: "hiden" | "y-scroll" | "auto";
|
|
20
|
+
}
|
|
2
21
|
/**
|
|
3
22
|
* CardProps is an interface.
|
|
4
23
|
* @interface CardProps
|
|
@@ -13,22 +32,8 @@ import { ImageSize, Size } from "./Property";
|
|
|
13
32
|
*/
|
|
14
33
|
export interface CardProps {
|
|
15
34
|
children: React.ReactNode;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
boundary?: "shadow" | "border" | "none";
|
|
19
|
-
rounded?: string;
|
|
20
|
-
height?: Size;
|
|
21
|
-
width?: Size;
|
|
22
|
-
background?: {
|
|
23
|
-
color?: string;
|
|
24
|
-
};
|
|
25
|
-
text?: {
|
|
26
|
-
size?: string;
|
|
27
|
-
color?: string;
|
|
28
|
-
};
|
|
29
|
-
onClick?: () => unknown | (() => Promise<unknown>);
|
|
30
|
-
overflow?: "hiden" | "auto";
|
|
31
|
-
};
|
|
35
|
+
header?: React.ReactNode;
|
|
36
|
+
options?: CardOptions;
|
|
32
37
|
debug?: string;
|
|
33
38
|
}
|
|
34
39
|
export interface ChartCardProps extends Omit<CardProps, "children"> {
|
|
@@ -52,17 +57,15 @@ export interface ChartCardProps extends Omit<CardProps, "children"> {
|
|
|
52
57
|
score: number;
|
|
53
58
|
};
|
|
54
59
|
}
|
|
55
|
-
export interface TableCardProps extends Omit<CardProps, "children"> {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
export interface TableCardProps<T> extends Omit<CardProps, "children"> {
|
|
61
|
+
dataSets: T[];
|
|
62
|
+
dataField: {
|
|
63
|
+
[p in keyof T]: Partial<DataField>;
|
|
64
|
+
};
|
|
65
|
+
options?: CardOptions;
|
|
59
66
|
}
|
|
60
67
|
export interface TrumpCardProps {
|
|
61
|
-
titles:
|
|
62
|
-
title: string;
|
|
63
|
-
subTitle?: string[];
|
|
64
|
-
color?: string;
|
|
65
|
-
};
|
|
68
|
+
titles: Titles;
|
|
66
69
|
options?: {
|
|
67
70
|
width?: Size;
|
|
68
71
|
image?: {
|
|
@@ -73,16 +76,23 @@ export interface TrumpCardProps {
|
|
|
73
76
|
subButton?: [string, string, () => unknown | (() => Promise<unknown>)];
|
|
74
77
|
};
|
|
75
78
|
}
|
|
76
|
-
export interface InfoCardProps {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
export interface InfoCardProps extends CardProps {
|
|
80
|
+
titles: Titles;
|
|
81
|
+
button?: Button;
|
|
82
|
+
options?: {
|
|
83
|
+
titleBorderColor?: string;
|
|
84
|
+
rightTextColor?: string;
|
|
85
|
+
buttonBackgroundColor?: string;
|
|
86
|
+
} & CardOptions;
|
|
87
|
+
}
|
|
88
|
+
export interface AddCardProps extends Omit<CardProps, "children"> {
|
|
89
|
+
onClick: OnClick;
|
|
90
|
+
}
|
|
91
|
+
export interface RowCardProps<T> {
|
|
92
|
+
onClick?: OnClick;
|
|
93
|
+
dataSet: T;
|
|
94
|
+
dataField?: {
|
|
95
|
+
[p in keyof T]?: Partial<DataField>;
|
|
87
96
|
};
|
|
88
97
|
}
|
|
98
|
+
export {};
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { Titles } from "./Property";
|
|
2
|
+
export interface DeckProps<T> {
|
|
2
3
|
children: React.ReactNode;
|
|
3
|
-
titles?:
|
|
4
|
-
title: string;
|
|
5
|
-
subtitle?: string;
|
|
6
|
-
gapTitle?: number;
|
|
7
|
-
};
|
|
4
|
+
titles?: Titles;
|
|
8
5
|
options?: {
|
|
9
6
|
flex?: "col" | "row";
|
|
10
7
|
justify?: "between";
|
|
@@ -15,4 +12,4 @@ export declare function Deck<T extends string | number>({ children, titles, opti
|
|
|
15
12
|
gapY?: number;
|
|
16
13
|
};
|
|
17
14
|
debug?: string;
|
|
18
|
-
}
|
|
15
|
+
}
|
|
@@ -1,23 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { OnClick, Size, State } from "./Property";
|
|
2
|
+
export declare const HTMLElementType: {
|
|
3
|
+
readonly TEXT: "text";
|
|
4
|
+
readonly BUTTON: "button";
|
|
5
|
+
readonly INPUT: "input";
|
|
6
|
+
readonly SELECT: "select";
|
|
7
|
+
readonly TOGGLE: "toggle";
|
|
8
|
+
};
|
|
9
|
+
export type HTMLElementType = (typeof HTMLElementType)[keyof typeof HTMLElementType];
|
|
4
10
|
export interface HTMLElement {
|
|
5
|
-
|
|
6
|
-
|
|
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>;
|
|
11
|
+
options?: {
|
|
12
|
+
width?: Size;
|
|
16
13
|
};
|
|
17
14
|
}
|
|
15
|
+
export interface HTMLButtonElement extends HTMLElement {
|
|
16
|
+
title: string;
|
|
17
|
+
onClick: OnClick;
|
|
18
|
+
}
|
|
18
19
|
export interface HTMLSelectElement extends HTMLElement {
|
|
20
|
+
state: State<string>;
|
|
19
21
|
selectOptions?: [string | number, string][];
|
|
20
22
|
}
|
|
21
23
|
export interface HTMLInputElement extends HTMLElement {
|
|
24
|
+
state: State<string>;
|
|
22
25
|
placeholder?: string;
|
|
23
26
|
}
|
|
27
|
+
export interface HTMLToggleElement extends HTMLElement {
|
|
28
|
+
state: State<boolean>;
|
|
29
|
+
labels: [[true, string], [false, string]];
|
|
30
|
+
isDisabled?: boolean;
|
|
31
|
+
}
|
package/interface/HTMLElement.js
CHANGED
package/interface/Modal.d.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { Button, Scripts, Size } from "./Property";
|
|
2
2
|
export interface ModalProps {
|
|
3
|
+
isVisible?: boolean;
|
|
3
4
|
children: React.ReactNode;
|
|
5
|
+
classNames?: string;
|
|
4
6
|
options?: {
|
|
5
7
|
width?: Size;
|
|
6
8
|
height?: Size;
|
|
7
9
|
padding?: boolean;
|
|
8
10
|
buttons?: Button[];
|
|
11
|
+
isCloseButton?: boolean;
|
|
12
|
+
closeButtonColor?: string;
|
|
9
13
|
};
|
|
14
|
+
debug?: string;
|
|
10
15
|
}
|
|
11
|
-
export interface AlertModalProps {
|
|
16
|
+
export interface AlertModalProps extends Omit<ModalProps, "children"> {
|
|
12
17
|
title: string;
|
|
13
18
|
scripts: Scripts;
|
|
14
19
|
options?: {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HTMLElementType } from "./HTMLElement";
|
|
2
|
+
import { State, Titles } from "./Property";
|
|
3
|
+
export interface OverlayProps {
|
|
4
|
+
titles: Titles;
|
|
5
|
+
isVisible?: boolean;
|
|
6
|
+
event?: string;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface InfoOverlayProps extends OverlayProps {
|
|
10
|
+
}
|
|
11
|
+
export interface ManageOverlayProps extends InfoOverlayProps {
|
|
12
|
+
elements?: {
|
|
13
|
+
title: string;
|
|
14
|
+
state: State<string> | State<boolean>;
|
|
15
|
+
type: HTMLElementType;
|
|
16
|
+
selectOptions?: [string | number, string][];
|
|
17
|
+
labels?: [string | boolean, string][];
|
|
18
|
+
isDisabled?: boolean;
|
|
19
|
+
}[];
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/interface/Property.d.ts
CHANGED
|
@@ -9,7 +9,8 @@ import { Dispatch, SetStateAction } from "react";
|
|
|
9
9
|
* const [state, setState] = useState<T>(initialState);
|
|
10
10
|
* @typedef {Array<T, Dispatch<SetStateAction<T>>>} State
|
|
11
11
|
*/
|
|
12
|
-
export type
|
|
12
|
+
export type StateAction<T> = Dispatch<SetStateAction<T>>;
|
|
13
|
+
export type State<T> = [T, StateAction<T>];
|
|
13
14
|
/**
|
|
14
15
|
* Size type
|
|
15
16
|
* @enum {string}
|
|
@@ -42,11 +43,21 @@ export type Scripts = {
|
|
|
42
43
|
export type Titles = {
|
|
43
44
|
title: string;
|
|
44
45
|
subtitle?: string | string[];
|
|
46
|
+
isSub?: boolean;
|
|
45
47
|
color?: string;
|
|
46
48
|
};
|
|
49
|
+
export type DataField = {
|
|
50
|
+
title: string | number;
|
|
51
|
+
type: string;
|
|
52
|
+
size: string | number;
|
|
53
|
+
};
|
|
47
54
|
export interface Log<K extends string, T extends string | number> {
|
|
48
55
|
prints: K[];
|
|
49
56
|
logs: {
|
|
50
57
|
[p in K]: T;
|
|
51
58
|
}[] | undefined;
|
|
52
59
|
}
|
|
60
|
+
export interface Order {
|
|
61
|
+
orderBy: string;
|
|
62
|
+
orderHow: "asc" | "desc" | "";
|
|
63
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Button, Titles } from "./Property";
|
|
2
|
+
import { EventsProps } from "./Widget";
|
|
3
|
+
interface Options<T> {
|
|
4
|
+
titleSize?: string;
|
|
5
|
+
subtitleSize?: string;
|
|
6
|
+
overflowScroll?: boolean;
|
|
7
|
+
width?: T;
|
|
8
|
+
height?: number;
|
|
9
|
+
gapX?: number;
|
|
10
|
+
gapY?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface ShelfProps<T> {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
widgets?: EventsProps & {
|
|
15
|
+
tabs?: Button[];
|
|
16
|
+
};
|
|
17
|
+
titles?: Titles;
|
|
18
|
+
debug?: string;
|
|
19
|
+
classNames?: string;
|
|
20
|
+
options?: Options<T>;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/interface/Widget.d.ts
CHANGED
|
@@ -2,3 +2,22 @@ export interface WidgetEvent {
|
|
|
2
2
|
event: string;
|
|
3
3
|
type: "view" | "modal";
|
|
4
4
|
}
|
|
5
|
+
type Event<T extends boolean | string | null | undefined> = [
|
|
6
|
+
T,
|
|
7
|
+
React.ReactNode
|
|
8
|
+
];
|
|
9
|
+
export type Show = Event<boolean | string>;
|
|
10
|
+
export type Replace = Event<boolean | string | null | undefined>;
|
|
11
|
+
export interface ShowProps {
|
|
12
|
+
widgets?: Show[];
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export interface ReplaceProps {
|
|
16
|
+
widgets?: Replace[];
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export interface EventsProps {
|
|
20
|
+
replaces?: Event<boolean | string | null | undefined>[];
|
|
21
|
+
shows?: Event<boolean | string>[];
|
|
22
|
+
}
|
|
23
|
+
export {};
|
package/interface/index.d.ts
CHANGED
package/interface/index.js
CHANGED
package/layout/index.d.ts
CHANGED
package/layout/index.js
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Events from "../widget/Events";
|
|
3
|
+
import Tab from "../widget/Tab";
|
|
4
|
+
export default function Gallery({ widgets, children, }) {
|
|
5
|
+
return (_jsxs("div", { className: "relative w-full flex", children: [_jsx(Events.Replace, { widgets: widgets?.replaces, children: _jsx(Events.Show, { widgets: widgets?.shows, children: children }) }), widgets?.tabs && _jsx(Tab, { tabs: widgets?.tabs })] }));
|
|
6
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ShelfProps } from "../../interface/Shelf";
|
|
2
|
+
declare function Shelf({ titles, debug, children }: ShelfProps<string | number>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare namespace Shelf {
|
|
4
|
+
var Wrap: ({ classNames, titles, children, debug, }: ShelfProps<string | number>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
var Row: ({ titles, children, debug }: ShelfProps<string | number>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
var Col: ({ titles, children, debug }: ShelfProps<string | number>) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
}
|
|
8
|
+
export default Shelf;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../util";
|
|
3
|
+
import ShelfDesign from "../widget/Shelf";
|
|
4
|
+
function Shelf({ titles, debug, children }) {
|
|
5
|
+
const container = {
|
|
6
|
+
displays: "inline-flex flex-col gap-12 w-full",
|
|
7
|
+
};
|
|
8
|
+
return (_jsx(ShelfDesign, { titles: titles, classNames: cn(container), debug: debug, children: children }));
|
|
9
|
+
}
|
|
10
|
+
function Wrap({ classNames, titles, children, debug, }) {
|
|
11
|
+
const container = {
|
|
12
|
+
displays: "flex flex-row flex-wrap gap-x-7.5",
|
|
13
|
+
classNames,
|
|
14
|
+
};
|
|
15
|
+
return (_jsx(ShelfDesign, { titles: titles, classNames: cn(container), options: {
|
|
16
|
+
titleSize: "text-lg xl:text-2xl",
|
|
17
|
+
subtitleSize: "text-sm",
|
|
18
|
+
}, debug: debug, children: children }));
|
|
19
|
+
}
|
|
20
|
+
function Row({ titles, children, debug }) {
|
|
21
|
+
const container = {
|
|
22
|
+
displays: "flex flex-row gap-7.5",
|
|
23
|
+
};
|
|
24
|
+
return (_jsx(ShelfDesign, { titles: titles, classNames: cn(container), options: {
|
|
25
|
+
titleSize: "text-lg xl:text-2xl",
|
|
26
|
+
subtitleSize: "text-sm",
|
|
27
|
+
}, debug: debug, children: children }));
|
|
28
|
+
}
|
|
29
|
+
function Col({ titles, children, debug }) {
|
|
30
|
+
const container = {
|
|
31
|
+
displays: "flex flex-col flex-wrap gap-y-5",
|
|
32
|
+
};
|
|
33
|
+
return (_jsx(ShelfDesign, { titles: titles, classNames: cn(container), options: {
|
|
34
|
+
titleSize: "text-lg xl:text-2xl",
|
|
35
|
+
subtitleSize: "text-sm",
|
|
36
|
+
}, debug: debug, children: children }));
|
|
37
|
+
}
|
|
38
|
+
Shelf.Wrap = Wrap;
|
|
39
|
+
Shelf.Row = Row;
|
|
40
|
+
Shelf.Col = Col;
|
|
41
|
+
export default Shelf;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { cn, gradient } from "../../../util";
|
|
4
|
+
import { useWidgetStore } from "../../../store";
|
|
5
|
+
export function Header({ title, image, }) {
|
|
6
|
+
const { isDark, setDark } = useWidgetStore();
|
|
7
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
8
|
+
const [src, href] = image ?? [];
|
|
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: !isDark ? `bg-${gradient.greenToRed}` : "bg-black",
|
|
14
|
+
styles: "px-5 xl:px-8 2xl:px-16 ",
|
|
15
|
+
};
|
|
16
|
+
return (_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex h-12 items-center gap-8 xl:gap-24 2xl:gap-22", children: [src && href ? (_jsx("a", { href: href, children: _jsx("img", { src: src, alt: "logo", className: "h-6.25 w-28.78" }) })) : (_jsx("div", { className: "text-2xl", children: "TOSEL" })), _jsx("div", { className: "text-3xl font-bold text-white ", children: title })] }), _jsx("button", { onClick: setDark, className: "text-white", children: "DARK" })] }));
|
|
17
|
+
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
declare function Layout({ subject, colors, navigations, children, }: {
|
|
2
2
|
subject: [string, string, string];
|
|
3
3
|
colors?: [string, string];
|
|
4
4
|
navigations: React.ReactNode[];
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const Dashboard: {
|
|
8
|
+
Layout: typeof Layout;
|
|
9
|
+
};
|
|
10
|
+
export default Dashboard;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment, useEffect } from "react";
|
|
3
|
+
import { NavigationContainer } from "../../../navigation";
|
|
4
|
+
import { Header } from "./Header";
|
|
5
|
+
import { cn } from "../../../util";
|
|
6
|
+
import { useWidgetStore } from "../../../store";
|
|
7
|
+
function Layout({ subject, colors, navigations, children, }) {
|
|
8
|
+
const { isDark, flag, setFlag, isOwn, setIsOwn, clearView } = useWidgetStore();
|
|
9
|
+
const [title, image, imageUrl] = subject ?? ["", "", ""];
|
|
10
|
+
const [bgColor, textColor] = colors ?? ["white", "black"];
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (isOwn) {
|
|
13
|
+
return setIsOwn(false);
|
|
14
|
+
}
|
|
15
|
+
return clearView();
|
|
16
|
+
}, [flag]);
|
|
17
|
+
const container = {
|
|
18
|
+
sizes: "min-h-screen h-screen xl:h-auto",
|
|
19
|
+
background: !isDark ? `bg-${bgColor}` : "bg-black/80",
|
|
20
|
+
styles: `text-${textColor} font-pretendard-medium`,
|
|
21
|
+
dark: isDark && "dark",
|
|
22
|
+
};
|
|
23
|
+
const body = {
|
|
24
|
+
sizes: "h-full ",
|
|
25
|
+
displays: "flex gap-12 xl:gap-7.5 ",
|
|
26
|
+
paddings: "pt-15 xl:pl-2 2xl:px-12 xl:pt-7.5",
|
|
27
|
+
};
|
|
28
|
+
return (_jsxs("div", { className: cn(container), onClick: setFlag, children: [_jsx(Header, { title: title, image: [image, imageUrl] }), _jsxs("div", { className: cn(body), children: [_jsx(NavigationContainer, { children: navigations.map((nav, index) => (_jsx(Fragment, { children: nav }, index))) }), children] })] }));
|
|
29
|
+
}
|
|
30
|
+
const Dashboard = {
|
|
31
|
+
Layout,
|
|
32
|
+
};
|
|
33
|
+
export default Dashboard;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../util";
|
|
3
|
+
export default function Header({ groupName, examName, }) {
|
|
4
|
+
const container = {
|
|
5
|
+
positions: "relative z-20",
|
|
6
|
+
displays: "flex flex-col items-center ",
|
|
7
|
+
sizes: "w-full max-w-280",
|
|
8
|
+
styles: "py-8 bg-white shadow-md",
|
|
9
|
+
};
|
|
10
|
+
return (_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex justify-between w-full items-center px-2", children: [_jsx("img", { src: "/images/logos/itc.png", alt: "itc", width: 80 }), _jsx("div", { className: "flex items-center", children: _jsx("div", { className: "text-5xl font-bold", children: examName }) }), _jsx("img", { src: "/images/logos/badge-tosel-lab.png", alt: "tosel-lab", width: 80 })] }), _jsxs("div", { className: "", children: ["\uC9C0\uC815\uAD50\uC721\uAE30\uAD00: ", groupName] })] }));
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReplaceProps, ShowProps } from "./../../interface/Widget";
|
|
2
|
+
declare function Show({ widgets, children }: ShowProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function Replace({ widgets, children }: ReplaceProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const Events: {
|
|
5
|
+
Show: typeof Show;
|
|
6
|
+
Replace: typeof Replace;
|
|
7
|
+
};
|
|
8
|
+
export default Events;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { Fragment } from "react";
|
|
3
|
+
import { useWidgetStore } from "../../store";
|
|
4
|
+
function Show({ widgets, children }) {
|
|
5
|
+
const { events } = useWidgetStore();
|
|
6
|
+
return (_jsxs(_Fragment, { children: [children, widgets?.map(([flag, Component], index) => {
|
|
7
|
+
const isVisible = typeof flag === "boolean"
|
|
8
|
+
? flag
|
|
9
|
+
: events?.some(({ event }) => event === flag);
|
|
10
|
+
const event = () => {
|
|
11
|
+
if (typeof flag === "string") {
|
|
12
|
+
return flag;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
if (React.isValidElement(Component)) {
|
|
16
|
+
const ComponentWithVisibility = React.cloneElement(Component, {
|
|
17
|
+
event: event(),
|
|
18
|
+
isVisible,
|
|
19
|
+
});
|
|
20
|
+
return _jsx(Fragment, { children: ComponentWithVisibility }, index);
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
})] }));
|
|
24
|
+
}
|
|
25
|
+
function Replace({ widgets, children }) {
|
|
26
|
+
const { events } = useWidgetStore();
|
|
27
|
+
if (!widgets)
|
|
28
|
+
return _jsx(_Fragment, { children: children });
|
|
29
|
+
const trueComponents = widgets
|
|
30
|
+
.filter(([widget]) => widget)
|
|
31
|
+
.map(([flag, Component], index) => {
|
|
32
|
+
if (typeof flag === "string") {
|
|
33
|
+
return events?.some(({ event }) => event === flag) ? (_jsx(_Fragment, { children: Component })) : null;
|
|
34
|
+
}
|
|
35
|
+
return _jsx(Fragment, { children: Component }, index);
|
|
36
|
+
})
|
|
37
|
+
.filter((component) => component !== null);
|
|
38
|
+
return _jsx(_Fragment, { children: trueComponents.length > 0 ? trueComponents : children });
|
|
39
|
+
}
|
|
40
|
+
const Events = {
|
|
41
|
+
Show,
|
|
42
|
+
Replace,
|
|
43
|
+
};
|
|
44
|
+
export default Events;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { LineBreaks } from "../../text";
|
|
3
|
+
import { cn, isDebug } from "../../util";
|
|
4
|
+
export default function Shelf({ children, classNames, options, titles, debug, }) {
|
|
5
|
+
const { titleSize, subtitleSize } = options ?? {};
|
|
6
|
+
const container = {
|
|
7
|
+
displays: "flex flex-col gap-4",
|
|
8
|
+
debug: debug && isDebug(`border-2 border-${debug}`),
|
|
9
|
+
};
|
|
10
|
+
const titleBox = {
|
|
11
|
+
container: "flex flex-col text-gray-dim",
|
|
12
|
+
title: {
|
|
13
|
+
text: titleSize ?? "text-xl xl:text-3xl",
|
|
14
|
+
font: "font-bold",
|
|
15
|
+
},
|
|
16
|
+
subtitle: {
|
|
17
|
+
text: subtitleSize ?? "text-base xl:text-lg",
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
const childrenBox = {
|
|
21
|
+
sizes: "w-full",
|
|
22
|
+
classNames,
|
|
23
|
+
};
|
|
24
|
+
return (_jsxs("div", { className: cn(container), children: [titles && (_jsxs("div", { className: cn(titleBox.container), children: [_jsx("div", { className: cn(titleBox.title), children: titles?.title }), _jsx(LineBreaks, { className: cn(titleBox.subtitle), texts: titles?.subtitle })] })), _jsx("div", { className: cn(childrenBox), children: children })] }));
|
|
25
|
+
}
|