@edu-tosel/design 1.0.17 → 1.0.19
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/board/template/CanvasBoard.js +4 -3
- package/board/template/ManageBoard.js +3 -4
- package/board/template/PaperBoard.js +1 -1
- package/card/index.d.ts +3 -5
- package/card/index.js +3 -5
- package/card/template/AddCard.js +1 -1
- package/card/template/ChartCard.js +2 -2
- package/card/template/InfoCard.d.ts +13 -20
- package/card/template/InfoCard.js +47 -40
- package/card/template/NavCard.d.ts +15 -0
- package/card/template/NavCard.js +44 -0
- package/card/template/TableCard.js +9 -17
- package/card/widget/{Card.js → Card.design.js} +12 -27
- package/card/{template → widget}/InfoCard.design.js +7 -7
- package/card/widget/NavCard.design.d.ts +2 -0
- package/card/widget/NavCard.design.js +32 -0
- package/globals.css +18 -2
- package/html/index.d.ts +2 -1
- package/html/index.js +2 -1
- package/html/template/Label.d.ts +8 -0
- package/html/template/Label.js +14 -0
- package/html/widget/DatePicker.js +1 -1
- package/html/widget/EmailInput.d.ts +2 -0
- package/html/widget/EmailInput.js +44 -0
- package/html/widget/Input.js +6 -4
- package/html/widget/Label.design.d.ts +2 -0
- package/html/widget/Label.design.js +36 -0
- package/html/widget/Select.js +5 -5
- package/html/widget/Toggle.d.ts +1 -1
- package/html/widget/Toggle.js +3 -2
- package/interaction/index.d.ts +2 -5
- package/interaction/index.js +2 -5
- package/interaction/template/Loading.d.ts +9 -0
- package/interaction/template/Loading.js +9 -0
- package/interaction/template/NoData.d.ts +5 -0
- package/interaction/template/NoData.js +9 -0
- package/interaction/widget/Jumper.design.d.ts +1 -0
- package/interaction/widget/{LoadingJumper.js → Jumper.design.js} +1 -1
- package/interaction/widget/Script.design.d.ts +3 -0
- package/interaction/widget/{NoData.js → Script.design.js} +2 -2
- package/interaction/widget/Spinner.design.d.ts +1 -0
- package/interaction/widget/{LoadingSpinner.js → Spinner.design.js} +1 -1
- package/interaction/widget/Worm.design.d.ts +1 -0
- package/interaction/widget/{LoadingWorm.js → Worm.design.js} +1 -1
- package/interface/Card.d.ts +48 -41
- package/interface/HTMLElement.d.ts +7 -3
- package/interface/Layout.d.ts +20 -0
- package/interface/Layout.js +1 -0
- package/interface/Property.d.ts +1 -1
- package/interface/Widget.d.ts +23 -0
- package/interface/index.d.ts +1 -0
- package/interface/index.js +1 -0
- package/layout/index.d.ts +3 -1
- package/layout/index.js +3 -1
- package/layout/template/DataField.d.ts +8 -0
- package/layout/template/DataField.js +16 -0
- package/layout/{widget → template}/Events.d.ts +1 -1
- package/layout/template/Gallery.js +2 -2
- package/layout/template/Row.d.ts +8 -0
- package/layout/template/Row.js +24 -0
- package/layout/template/Shelf.js +1 -1
- package/layout/template/dashboard/Header.d.ts +2 -4
- package/layout/template/dashboard/Header.js +7 -5
- package/layout/template/dashboard/index.d.ts +2 -6
- package/layout/template/dashboard/index.js +6 -6
- package/layout/widget/DataField.design.d.ts +2 -0
- package/{board/widget/DataField.js → layout/widget/DataField.design.js} +8 -8
- package/layout/widget/Row.design.d.ts +2 -0
- package/layout/widget/Row.design.js +16 -0
- package/overlay/template/Manage.js +1 -1
- package/package.json +1 -1
- package/tailwind.config.ts +15 -3
- package/version.txt +1 -1
- package/board/widget/DataField.d.ts +0 -7
- package/board/widget/Tags.d.ts +0 -14
- package/board/widget/Tags.js +0 -30
- package/card/template/ProfileCard.d.ts +0 -14
- package/card/template/ProfileCard.js +0 -8
- package/card/template/ReportCard.d.ts +0 -33
- package/card/template/ReportCard.js +0 -15
- package/card/template/RowCard.d.ts +0 -2
- package/card/template/RowCard.js +0 -24
- package/card/template/TrumpCard.d.ts +0 -2
- package/card/template/TrumpCard.js +0 -19
- package/html/widget/Button.d.ts +0 -2
- package/html/widget/Button.js +0 -15
- package/interaction/template/Exception.d.ts +0 -2
- package/interaction/template/Exception.js +0 -10
- package/interaction/widget/LoadingJumper.d.ts +0 -1
- package/interaction/widget/LoadingSpinner.d.ts +0 -1
- package/interaction/widget/LoadingWorm.d.ts +0 -1
- package/interaction/widget/NoData.d.ts +0 -1
- /package/board/widget/{Board.d.ts → Board.design.d.ts} +0 -0
- /package/board/widget/{Board.js → Board.design.js} +0 -0
- /package/card/widget/{Card.d.ts → Card.design.d.ts} +0 -0
- /package/card/{template → widget}/InfoCard.design.d.ts +0 -0
- /package/layout/{widget → template}/Events.js +0 -0
- /package/layout/widget/{Shelf.d.ts → Shelf.design.d.ts} +0 -0
- /package/layout/widget/{Shelf.js → Shelf.design.js} +0 -0
- /package/layout/widget/{Tab.d.ts → Tab.design.d.ts} +0 -0
- /package/layout/widget/{Tab.js → Tab.design.js} +0 -0
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
|
-
import { cn
|
|
3
|
+
import { cn } from "../../../util";
|
|
4
4
|
import { useWidgetStore } from "../../../store";
|
|
5
|
-
export function Header({ title,
|
|
5
|
+
export function Header({ title, logo, options }) {
|
|
6
|
+
const { text, background, className } = options ?? {};
|
|
6
7
|
const { isDark, setDark } = useWidgetStore();
|
|
7
8
|
const [isOpen, setIsOpen] = useState(false);
|
|
8
|
-
const [src, href] = image ?? [];
|
|
9
9
|
const container = {
|
|
10
10
|
positions: "fixed xl:static top-0 left-0 z-40",
|
|
11
11
|
displays: "flex items-center justify-between ",
|
|
12
12
|
sizes: "h-15 w-full",
|
|
13
|
-
background:
|
|
13
|
+
background: `${background ?? "bg-white"} dark:bg-black`,
|
|
14
|
+
text: `${text ?? "text-black"} dark:text-white`,
|
|
14
15
|
styles: "px-5 xl:px-8 2xl:px-16 ",
|
|
16
|
+
className,
|
|
15
17
|
};
|
|
16
|
-
return (_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex h-12 items-center gap-8 xl:gap-24 2xl:gap-
|
|
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" })] }));
|
|
17
19
|
}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
colors?: [string, string];
|
|
4
|
-
navigations: React.ReactNode[];
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { DashboardProps } from "../../../interface";
|
|
2
|
+
declare function Layout({ header, navigations, children, options }: DashboardProps): import("react/jsx-runtime").JSX.Element;
|
|
7
3
|
declare const Dashboard: {
|
|
8
4
|
Layout: typeof Layout;
|
|
9
5
|
};
|
|
@@ -4,10 +4,10 @@ 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({
|
|
7
|
+
function Layout({ header, navigations, children, options }) {
|
|
8
8
|
const { isDark, flag, setFlag, isOwn, setIsOwn, clearView } = useWidgetStore();
|
|
9
|
-
const
|
|
10
|
-
const
|
|
9
|
+
const { title, options: headerOptions, logo } = header;
|
|
10
|
+
const { background } = options ?? {};
|
|
11
11
|
useEffect(() => {
|
|
12
12
|
if (isOwn) {
|
|
13
13
|
return setIsOwn(false);
|
|
@@ -16,8 +16,8 @@ function Layout({ subject, colors, navigations, children, }) {
|
|
|
16
16
|
}, [flag]);
|
|
17
17
|
const container = {
|
|
18
18
|
sizes: "min-h-screen h-screen xl:h-auto",
|
|
19
|
-
background:
|
|
20
|
-
styles:
|
|
19
|
+
background: `${background ?? "bg-gray-light"} dark:bg-black/80`,
|
|
20
|
+
styles: "font-pretendard-medium",
|
|
21
21
|
dark: isDark && "dark",
|
|
22
22
|
};
|
|
23
23
|
const body = {
|
|
@@ -25,7 +25,7 @@ function Layout({ subject, colors, navigations, children, }) {
|
|
|
25
25
|
displays: "flex gap-12 xl:gap-7.5 ",
|
|
26
26
|
paddings: "pt-15 xl:pl-2 2xl:px-12 xl:pt-7.5",
|
|
27
27
|
};
|
|
28
|
-
return (_jsxs("div", { className: cn(container), onClick: setFlag, children: [_jsx(Header, { title: title,
|
|
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
30
|
const Dashboard = {
|
|
31
31
|
Layout,
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../../util";
|
|
3
|
-
import { useWidgetStore } from "
|
|
4
|
-
export default function
|
|
3
|
+
import { useWidgetStore } from "../../store";
|
|
4
|
+
export default function DataFieldDesign({ id, dataField, options, }) {
|
|
5
5
|
const { order, setOrder } = useWidgetStore();
|
|
6
|
+
const { padding, position } = options ?? {};
|
|
6
7
|
const orders = order[id] ?? [];
|
|
7
8
|
const container = {
|
|
8
|
-
positions:
|
|
9
|
+
positions: position && position,
|
|
9
10
|
displays: "flex items-center",
|
|
10
11
|
sizes: "w-full h-13.75",
|
|
11
|
-
paddings:
|
|
12
|
-
styles: "bg-white",
|
|
13
|
-
test: "box-shadow-sm",
|
|
12
|
+
paddings: padding && padding,
|
|
13
|
+
styles: "bg-white box-shadow-sm font-bold",
|
|
14
14
|
};
|
|
15
15
|
const block = {
|
|
16
16
|
displays: "xl:hidden block ",
|
|
17
17
|
sizes: container.sizes,
|
|
18
18
|
};
|
|
19
19
|
return (_jsxs(_Fragment, { children: [_jsx("div", { className: cn(container), children: dataField &&
|
|
20
|
-
Object.keys(dataField).map((key) => (_jsx("div", { className: `w-${dataField[key]?.size}/100
|
|
20
|
+
Object.keys(dataField).map((key) => (_jsx("div", { className: `w-${dataField[key]?.size}/100`, children: _jsxs("button", { onClick: () => setOrder(id, key), className: "flex items-center", children: [_jsx("div", { children: dataField[key]?.title }), _jsx("div", { className: "text-xs", children: orders?.map(({ orderBy, orderHow }) => {
|
|
21
21
|
if (orderBy === key) {
|
|
22
22
|
if (orderHow === "asc")
|
|
23
23
|
return (_jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M7.15859 15.0437C6.7079 15.9134 7.27152 17 8.17239 17H15.8279C16.7282 17 17.2919 15.9134 16.8417 15.0437L13.0145 7.65229C12.5638 6.78257 11.4365 6.78257 10.9858 7.65229L7.15859 15.0437Z", fill: "#105652" }) }));
|
|
@@ -26,5 +26,5 @@ export default function BoardDataField({ id, dataField, }) {
|
|
|
26
26
|
else
|
|
27
27
|
return "";
|
|
28
28
|
}
|
|
29
|
-
}) })] }) }, id + key))) }), _jsx("div", { className: cn(block) })] }));
|
|
29
|
+
}) })] }) }, id + key))) }), position && _jsx("div", { className: cn(block) })] }));
|
|
30
30
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
import { cn } from "../../util";
|
|
4
|
+
export default function RowDesign({ dataSet, dataField, options, onClick, }) {
|
|
5
|
+
const { size, padding, text } = options ?? {};
|
|
6
|
+
const id = useId();
|
|
7
|
+
const container = {
|
|
8
|
+
displays: "flex items-center ",
|
|
9
|
+
sizes: size,
|
|
10
|
+
paddings: padding,
|
|
11
|
+
text: text,
|
|
12
|
+
styles: "hover:bg-gray-100 duration-100",
|
|
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))) }));
|
|
16
|
+
}
|
|
@@ -8,7 +8,7 @@ export default function Manage({ titles, isVisible, event, elements, }) {
|
|
|
8
8
|
if (type === "select")
|
|
9
9
|
return (_jsx(Frame, { title: title, children: _jsx(Select, { state: state, selectOptions: selectOptions }) }, id + title));
|
|
10
10
|
if (type === "toggle")
|
|
11
|
-
return (_jsx(Frame, { title: title, children: _jsx(Toggle, { state: state, labels: labels,
|
|
11
|
+
return (_jsx(Frame, { title: title, children: _jsx(Toggle, { state: state, labels: labels, options: { disabled: isDisabled } }) }, id + title));
|
|
12
12
|
return null;
|
|
13
13
|
}) }));
|
|
14
14
|
}
|
package/package.json
CHANGED
package/tailwind.config.ts
CHANGED
|
@@ -48,6 +48,8 @@ export default {
|
|
|
48
48
|
colors: {
|
|
49
49
|
"white-off": "#F5F5F5",
|
|
50
50
|
"red-burgundy": "#933652",
|
|
51
|
+
"crimson-burgundy": "#910023",
|
|
52
|
+
"crimson-dark": "#760023",
|
|
51
53
|
"red-crimson": "#760023",
|
|
52
54
|
"red-velvet": "#AC647A",
|
|
53
55
|
"green-dark": "#105652",
|
|
@@ -86,18 +88,25 @@ export default {
|
|
|
86
88
|
2.5: "0.625rem",
|
|
87
89
|
3.5: "0.875rem",
|
|
88
90
|
3.75: "0.9375rem",
|
|
91
|
+
4.25: "1.0625rem",
|
|
89
92
|
4.75: "1.1875rem",
|
|
93
|
+
5.25: "1.3125rem",
|
|
90
94
|
6.25: "1.5625rem",
|
|
95
|
+
6.4: "1.6rem",
|
|
91
96
|
6.5: "1.625rem",
|
|
92
97
|
7: "1.75rem",
|
|
93
98
|
7.5: "1.875rem",
|
|
94
99
|
8: "2rem",
|
|
95
100
|
9: "2.25rem",
|
|
101
|
+
9.25: "2.3125rem",
|
|
102
|
+
10.25: "2.5625rem",
|
|
96
103
|
11: "2.75rem",
|
|
104
|
+
11.25: "2.8125rem",
|
|
97
105
|
12: "3rem",
|
|
98
106
|
13.25: "3.3125rem",
|
|
99
107
|
13.75: "3.4375rem",
|
|
100
108
|
14: "3.5rem",
|
|
109
|
+
14.125: "3.53125rem",
|
|
101
110
|
14.5: "3.625rem",
|
|
102
111
|
15: "3.75rem",
|
|
103
112
|
16: "4rem",
|
|
@@ -105,9 +114,14 @@ export default {
|
|
|
105
114
|
18.75: "4.6875rem",
|
|
106
115
|
19: "4.75rem",
|
|
107
116
|
19.25: "4.8125rem",
|
|
117
|
+
19.5: "4.875rem",
|
|
118
|
+
20: "5rem",
|
|
119
|
+
20.5: "5.125rem",
|
|
108
120
|
21: "5.25rem",
|
|
121
|
+
21.5: "5.375rem",
|
|
109
122
|
21.75: "5.4375rem",
|
|
110
123
|
22: "5.5rem",
|
|
124
|
+
22.5: "5.625rem",
|
|
111
125
|
23: "5.75rem",
|
|
112
126
|
25: "6.25rem",
|
|
113
127
|
26: "6.5rem",
|
|
@@ -121,6 +135,7 @@ export default {
|
|
|
121
135
|
40: "10rem",
|
|
122
136
|
41: "10.25rem",
|
|
123
137
|
42: "10.5rem",
|
|
138
|
+
43: "10.75rem",
|
|
124
139
|
44: "11rem",
|
|
125
140
|
45: "11.25rem",
|
|
126
141
|
48: "12rem",
|
|
@@ -514,9 +529,6 @@ export default {
|
|
|
514
529
|
{
|
|
515
530
|
pattern: /delay-.*/,
|
|
516
531
|
},
|
|
517
|
-
{
|
|
518
|
-
pattern: /duration-.*/,
|
|
519
|
-
},
|
|
520
532
|
],
|
|
521
533
|
plugins: [tailwindcssAnimate],
|
|
522
534
|
darkMode: "selector",
|
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.19
|
package/board/widget/Tags.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Dispatch } from "react";
|
|
2
|
-
import { Size } from "../../interface";
|
|
3
|
-
export declare function Select({ title, width, onChange, selectOptions, }: {
|
|
4
|
-
title: string;
|
|
5
|
-
width?: Size;
|
|
6
|
-
onChange: Dispatch<string>;
|
|
7
|
-
selectOptions?: [string | number, string][];
|
|
8
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export declare function Input({ title, onChange, placeholder, width, }: {
|
|
10
|
-
title: string;
|
|
11
|
-
onChange: Dispatch<string>;
|
|
12
|
-
placeholder?: string;
|
|
13
|
-
width?: Size;
|
|
14
|
-
}): import("react/jsx-runtime").JSX.Element;
|
package/board/widget/Tags.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useId } from "react";
|
|
3
|
-
export function Select({ title, width, onChange, selectOptions, }) {
|
|
4
|
-
const id = useId();
|
|
5
|
-
const widthSize = {
|
|
6
|
-
xs: "w-32",
|
|
7
|
-
sm: "w-48",
|
|
8
|
-
md: "w-64",
|
|
9
|
-
lg: "w-96",
|
|
10
|
-
xl: "w-128",
|
|
11
|
-
"2xl": "w-144",
|
|
12
|
-
full: "w-full",
|
|
13
|
-
};
|
|
14
|
-
const classNames = `${widthSize[width ?? "md"]} h-10 rounded-full pl-4`;
|
|
15
|
-
return (_jsxs("div", { className: "flex justify-center items-center gap-4", children: [_jsx("label", { htmlFor: id, className: "font-bold", children: title }), _jsx("select", { id: id, onChange: (e) => onChange(e.target.value), className: classNames, children: selectOptions?.map(([id, title]) => (_jsx("option", { value: id, children: title }, id))) })] }));
|
|
16
|
-
}
|
|
17
|
-
export function Input({ title, onChange, placeholder, width, }) {
|
|
18
|
-
const id = useId();
|
|
19
|
-
const widthSize = {
|
|
20
|
-
xs: "w-28",
|
|
21
|
-
sm: "w-48",
|
|
22
|
-
md: "w-64",
|
|
23
|
-
lg: "w-96",
|
|
24
|
-
xl: "w-128",
|
|
25
|
-
"2xl": "w-144",
|
|
26
|
-
full: "w-full",
|
|
27
|
-
};
|
|
28
|
-
const classNames = `${widthSize[width ?? "md"]} h-10 rounded-full pl-4`;
|
|
29
|
-
return (_jsxs("div", { className: "flex justify-center items-center gap-4", children: [_jsx("label", { htmlFor: id, className: "font-bold", children: title }), _jsx("input", { className: classNames, id: id, type: "text", placeholder: placeholder ?? "", onChange: (e) => onChange(e.target.value) })] }));
|
|
30
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
type Level = "PS" | "ST" | "BA" | "JR" | "HJ";
|
|
2
|
-
export default function ProfileCard({ info, gradeData, }: {
|
|
3
|
-
info: {
|
|
4
|
-
name: string;
|
|
5
|
-
birthday: string;
|
|
6
|
-
image?: string;
|
|
7
|
-
};
|
|
8
|
-
gradeData?: {
|
|
9
|
-
level?: Level;
|
|
10
|
-
score?: number;
|
|
11
|
-
grade?: number;
|
|
12
|
-
};
|
|
13
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Card } from "../widget/Card";
|
|
3
|
-
import { colorsByLevel } from "../../util";
|
|
4
|
-
export default function ProfileCard({ info, gradeData, }) {
|
|
5
|
-
const { name, birthday, image } = info;
|
|
6
|
-
const { level, score, grade } = gradeData ?? {};
|
|
7
|
-
return (_jsx(Card, { options: { width: "sm" }, children: _jsxs("div", { className: "flex", children: [_jsx("img", { src: image, alt: "profile", className: "h-20 w-20 overflow-hidden rounded-full object-cover " }), _jsxs("div", { className: "ml-auto flex flex-col gap-4", children: [_jsxs("div", { className: "flex w-52 items-end gap-2 border-b-2 border-blue-navy pb-2", children: [_jsx("div", { className: "text-xl font-bold", children: name }), _jsx("div", { children: birthday })] }), _jsxs("div", { children: [_jsx("div", { children: "\uD559\uC6D0\uC0DD" }), _jsx("div", { children: level ? colorsByLevel[level] : "" })] })] })] }) }));
|
|
8
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Titles } from "../../interface";
|
|
2
|
-
export default function ReportCard({ titles, dataField, }: {
|
|
3
|
-
titles: Titles;
|
|
4
|
-
type: "text" | "table" | "chart";
|
|
5
|
-
dataSets: {
|
|
6
|
-
items: Record<string, string | number>[];
|
|
7
|
-
average?: {
|
|
8
|
-
x: string;
|
|
9
|
-
score: number;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
dataField: {
|
|
13
|
-
fields: Record<string, string>;
|
|
14
|
-
axis?: {
|
|
15
|
-
x: string;
|
|
16
|
-
y: string;
|
|
17
|
-
};
|
|
18
|
-
lines?: {
|
|
19
|
-
dataKey: string;
|
|
20
|
-
stroke: string;
|
|
21
|
-
}[];
|
|
22
|
-
bars?: {
|
|
23
|
-
name: string;
|
|
24
|
-
dataKey: string;
|
|
25
|
-
fill: string;
|
|
26
|
-
}[];
|
|
27
|
-
areas?: {
|
|
28
|
-
dataKey: string;
|
|
29
|
-
fill: string;
|
|
30
|
-
}[];
|
|
31
|
-
sizes?: Record<string, string>;
|
|
32
|
-
};
|
|
33
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "../../util";
|
|
3
|
-
export default function ReportCard({ titles, dataField, }) {
|
|
4
|
-
const { title, subtitle } = titles;
|
|
5
|
-
const { axis, fields, lines, bars, areas, sizes } = dataField;
|
|
6
|
-
const container = {
|
|
7
|
-
displays: "flex flex-col gap-4",
|
|
8
|
-
};
|
|
9
|
-
const titleBox = {
|
|
10
|
-
container: "flex flex-col gap-1",
|
|
11
|
-
title: "text-lg font-bold",
|
|
12
|
-
subtitle: "text-sm",
|
|
13
|
-
};
|
|
14
|
-
return (_jsx("div", { className: cn(container) }));
|
|
15
|
-
}
|
package/card/template/RowCard.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useId } from "react";
|
|
3
|
-
import { cn } from "../../util";
|
|
4
|
-
import { Card } from "../widget/Card";
|
|
5
|
-
import { useWidgetStore } from "../../store";
|
|
6
|
-
export default function RowCard({ onClick, dataSet, dataField, }) {
|
|
7
|
-
const id = useId();
|
|
8
|
-
const { flag, setIsOwn } = useWidgetStore();
|
|
9
|
-
const container = {
|
|
10
|
-
displays: "flex items-center ",
|
|
11
|
-
sizes: "h-full",
|
|
12
|
-
paddings: "px-2 xs:px-4 xl:px-7.5 ",
|
|
13
|
-
styles: "text-xl hover:bg-gray-100 duration-100",
|
|
14
|
-
};
|
|
15
|
-
return (_jsx(Card, { options: {
|
|
16
|
-
onClick,
|
|
17
|
-
classNames: cn(container),
|
|
18
|
-
width: "full",
|
|
19
|
-
height: "xs",
|
|
20
|
-
boundary: "none",
|
|
21
|
-
rounded: "none",
|
|
22
|
-
}, children: dataField &&
|
|
23
|
-
Object.keys(dataField).map((key) => (_jsx("div", { className: `w-${dataField[key]?.size}/100 truncate`, children: dataSet[key] }, id + key))) }));
|
|
24
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { LineBreaks } from "../../text";
|
|
3
|
-
import { Card } from "../widget/Card";
|
|
4
|
-
export default function TrumpCard({ titles, options }) {
|
|
5
|
-
const { title, subtitle, color: titleColor } = titles;
|
|
6
|
-
const { onClick, width, image, subButton } = options ?? {};
|
|
7
|
-
const [buttonText, buttonBgColor, buttonAction] = subButton ?? [
|
|
8
|
-
null,
|
|
9
|
-
"red-crimson",
|
|
10
|
-
() => { },
|
|
11
|
-
];
|
|
12
|
-
const { path, size } = image ?? { size: "sub" };
|
|
13
|
-
const imageClassNames = () => {
|
|
14
|
-
if (size === "full")
|
|
15
|
-
return "w-full h-full object-cover";
|
|
16
|
-
return "absolute bottom-0 right-0 w-full xs:w-auto max-w-120 z-0 max-h-44 object-contain";
|
|
17
|
-
};
|
|
18
|
-
return (_jsxs(Card, { options: { width: width ?? "xs", onClick }, children: [_jsxs("div", { className: `absolute top-8 left-8 w-48 flex flex-col gap-2 z-10 text-${titleColor}`, children: [_jsx("div", { className: "text-xl font-bold", children: title }), _jsx(LineBreaks, { texts: subtitle ?? "" }), subButton ? (_jsx("button", { className: `text-white rounded-md bg-${buttonBgColor} w-45 h-11 flex justify-center items-center`, onClick: buttonAction, children: buttonText })) : null] }), path ? (_jsx("img", { src: path, alt: "trump-image", loading: "lazy", className: imageClassNames() })) : null] }));
|
|
19
|
-
}
|
package/html/widget/Button.d.ts
DELETED
package/html/widget/Button.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "../../util";
|
|
3
|
-
const widthSize = {
|
|
4
|
-
md: "w-45",
|
|
5
|
-
lg: "w-50",
|
|
6
|
-
};
|
|
7
|
-
const heightSize = {
|
|
8
|
-
md: "h-11",
|
|
9
|
-
};
|
|
10
|
-
export default function Button({ title, onClick }) {
|
|
11
|
-
const container = {
|
|
12
|
-
sizes: "",
|
|
13
|
-
};
|
|
14
|
-
return (_jsx("button", { onClick: onClick, className: cn(container), children: title }));
|
|
15
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Fragment } from "react";
|
|
3
|
-
export default function Exception({ exceptions, children }) {
|
|
4
|
-
if (!exceptions)
|
|
5
|
-
return _jsx(_Fragment, { children: children });
|
|
6
|
-
const trueComponents = exceptions
|
|
7
|
-
.filter(([exception]) => exception)
|
|
8
|
-
.map(([, Component], index) => (_jsx(Fragment, { children: Component }, index)));
|
|
9
|
-
return _jsx(_Fragment, { children: trueComponents.length > 0 ? trueComponents : children });
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function LoadingJumper(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function LoadingSpinner(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function LoadingWorm(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function NoData(): import("react/jsx-runtime").JSX.Element;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|