@edu-tosel/design 1.0.16 → 1.0.18
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 +2 -2
- package/board/template/ManageBoard.js +3 -4
- package/board/template/PaperBoard.js +1 -1
- package/board/widget/Header.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} +2 -2
- 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/modal/template/Alert.js +1 -2
- package/navigation/Navigation.js +2 -2
- package/overlay/template/Manage.js +1 -1
- package/package.json +1 -1
- package/tailwind.config.ts +15 -91
- package/text/Formatter.d.ts +1 -1
- package/text/Formatter.js +76 -13
- package/util/colors.d.ts +8 -1
- package/util/colors.js +6 -3
- package/util/index.d.ts +0 -3
- package/util/index.js +0 -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/util/display.d.ts +0 -25
- package/util/display.js +0 -25
- package/util/displayResponsive.d.ts +0 -3
- package/util/displayResponsive.js +0 -15
- package/util/position.d.ts +0 -14
- package/util/position.js +0 -44
- /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,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../../util";
|
|
3
|
-
import { Board } from "../widget/Board";
|
|
3
|
+
import { Board } from "../widget/Board.design";
|
|
4
4
|
export default function CanvasBoard({ children, options, widgets, }) {
|
|
5
5
|
const layouts = "flex flex-col lg:flex-row lg:flex-wrap gap-7.5 ";
|
|
6
6
|
const sizes = "h-full ";
|
|
7
|
-
const paddings = "pb-36 xl:pb-
|
|
7
|
+
const paddings = "pb-36 xl:pb-6 px-2 xs:px-4 xl:pl-7.5 xl:pr-2 pt-2 xs:pt-4 xl:pt-7.5";
|
|
8
8
|
const styles = "overflow-y-scroll ";
|
|
9
9
|
return (_jsx(Board, { widgets: widgets, options: { ...options, isRounded: true }, children: _jsx("div", { className: cn(layouts, sizes, paddings, styles), children: children }) }));
|
|
10
10
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Events, Shelf } from "../..";
|
|
3
|
-
import { Board } from "../widget/Board";
|
|
2
|
+
import { DataField, Events, Shelf } from "../..";
|
|
3
|
+
import { Board } from "../widget/Board.design";
|
|
4
4
|
import BoardHeader from "../widget/Header";
|
|
5
|
-
import BoardDataField from "../widget/DataField";
|
|
6
5
|
import { cn, sortByOrder } from "../../util";
|
|
7
6
|
import { useWidgetStore } from "../../store";
|
|
8
7
|
import { useId } from "react";
|
|
@@ -18,6 +17,6 @@ export default function ManageBoard({ header, data, widgets, options }) {
|
|
|
18
17
|
paddings: `${!noPadding ? "pt-7.5 pb-60 px-2 xs:pl-4 xl:pl-7.5 xl:pb-7.5 " : ""} `,
|
|
19
18
|
styles: "overflow-y-scroll",
|
|
20
19
|
};
|
|
21
|
-
return (_jsxs(Board, { widgets: widgets, options: { isRounded: true }, children: [header && _jsx(BoardHeader, { ...header }), dataField && _jsx(
|
|
20
|
+
return (_jsxs(Board, { widgets: widgets, options: { isRounded: true }, children: [header && _jsx(BoardHeader, { ...header }), dataField && _jsx(DataField.Board, { id: id, dataField: dataField }), _jsx("div", { className: cn(container), children: _jsx(Events.Replace, { widgets: widgets?.replaces, children: dataSets.map(({ titles, items, renderItem, interaction }, index) => (_jsxs(Shelf.Wrap, { titles: titles, classNames: classNames, children: [items &&
|
|
22
21
|
sortByOrder(items, orders)?.map((item) => renderItem(item)), interaction] }, id + index))) }) })] }));
|
|
23
22
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../../util";
|
|
3
|
-
import { Board } from "../widget/Board";
|
|
3
|
+
import { Board } from "../widget/Board.design";
|
|
4
4
|
export default function PaperBoard({ children, debug, options, }) {
|
|
5
5
|
const { classNames } = options ?? {};
|
|
6
6
|
const container = {
|
package/board/widget/Header.js
CHANGED
|
@@ -12,7 +12,7 @@ export default function BoardHeader({ titles, tags, options, }) {
|
|
|
12
12
|
const container = {
|
|
13
13
|
positions: "fixed top-15 xl:top-0 left-0 z-20 xl:relative flex items-center",
|
|
14
14
|
paddings: "px-7.5",
|
|
15
|
-
styles:
|
|
15
|
+
styles: `${bgColor} ${textColor}`,
|
|
16
16
|
sizes: "w-full h-19",
|
|
17
17
|
border: "border-b-2 border-green-dark",
|
|
18
18
|
};
|
package/card/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export { default as AddCard } from "./template/AddCard";
|
|
2
|
-
export { default as ProfileCard } from "./template/ProfileCard";
|
|
3
|
-
export { default as TrumpCard } from "./template/TrumpCard";
|
|
4
2
|
export { default as ChartCard } from "./template/ChartCard";
|
|
5
|
-
export { default as TableCard } from "./template/TableCard";
|
|
6
|
-
export { default as RowCard } from "./template/RowCard";
|
|
7
3
|
export { default as InfoCard } from "./template/InfoCard";
|
|
8
|
-
export { default as
|
|
4
|
+
export { default as NavCard } from "./template/NavCard";
|
|
5
|
+
export { default as TableCard } from "./template/TableCard";
|
|
6
|
+
export { default as TrumpCard } from "./widget/NavCard.design";
|
package/card/index.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export { default as AddCard } from "./template/AddCard";
|
|
2
|
-
export { default as ProfileCard } from "./template/ProfileCard";
|
|
3
|
-
export { default as TrumpCard } from "./template/TrumpCard";
|
|
4
2
|
export { default as ChartCard } from "./template/ChartCard";
|
|
5
|
-
export { default as TableCard } from "./template/TableCard";
|
|
6
|
-
export { default as RowCard } from "./template/RowCard";
|
|
7
3
|
export { default as InfoCard } from "./template/InfoCard";
|
|
8
|
-
export { default as
|
|
4
|
+
export { default as NavCard } from "./template/NavCard";
|
|
5
|
+
export { default as TableCard } from "./template/TableCard";
|
|
6
|
+
export { default as TrumpCard } from "./widget/NavCard.design";
|
package/card/template/AddCard.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../../util";
|
|
3
|
-
import { Card } from "../widget/Card";
|
|
3
|
+
import { Card } from "../widget/Card.design";
|
|
4
4
|
export default function AddCard({ title, icon, onClick, options, }) {
|
|
5
5
|
const { width } = options ?? {};
|
|
6
6
|
const container = {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Area, Bar, ComposedChart, Legend, Line, ReferenceLine, ResponsiveContainer, Tooltip, XAxis, YAxis, } from "recharts";
|
|
3
|
-
import { Card } from "../widget/Card";
|
|
3
|
+
import { Card } from "../widget/Card.design";
|
|
4
4
|
export default function ChartCard({ data, xAxis, yAxis, lines, bars, areas, options, average, }) {
|
|
5
5
|
const { width, height } = options ?? {};
|
|
6
6
|
return (_jsxs(Card, { options: {
|
|
7
7
|
classNames: "pt-4 pr-4",
|
|
8
8
|
width: width ?? "full",
|
|
9
9
|
height: height ?? "lg",
|
|
10
|
-
text:
|
|
10
|
+
text: "text-xs",
|
|
11
11
|
}, children: [_jsx(ResponsiveContainer, { width: "100%", height: "100%", children: _jsxs(ComposedChart, { data: data, children: [_jsx(XAxis, { dataKey: xAxis }), _jsx(YAxis, { dataKey: yAxis }), _jsx(Tooltip, {}), _jsx(Legend, {}), lines?.map((line) => (_jsx(Line, { ...line }, line.dataKey))), bars?.map((bar) => (_jsx(Bar, { ...bar }, bar.dataKey))), areas?.map((area) => (_jsx(Area, { ...area }, area.dataKey))), average && (_jsx(_Fragment, { children: _jsx(ReferenceLine, { x: average.x, stroke: "#ff0000" }) }))] }) }), average && (_jsxs("div", { className: "absolute top-0 left-0 w-full h-full flex justify-center items-center text-3xl text-gray-300 font-bold", children: ["\uD3C9\uADE0: ", average?.score, "\uC810"] }))] }));
|
|
12
12
|
}
|
|
@@ -1,32 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare function Exam({ titles, data
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
examDate: string;
|
|
6
|
-
endDate: string;
|
|
7
|
-
manager: string;
|
|
8
|
-
isPublic: boolean;
|
|
9
|
-
};
|
|
10
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
declare function Product({ titles, data, }: Omit<InfoCardProps, "children"> & {
|
|
1
|
+
import { InfoCardExamProps, InfoCardProductProps, InfoCardProps } from "../../interface";
|
|
2
|
+
declare function Exam({ titles, data }: InfoCardExamProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function Product({ titles, data }: InfoCardProductProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function Item({ titles, data, }: Omit<InfoCardProps, "children"> & {
|
|
12
5
|
data: {
|
|
13
|
-
|
|
14
|
-
status?: string;
|
|
15
|
-
receiver?: string | null;
|
|
16
|
-
requester?: string | null;
|
|
17
|
-
button?: Button;
|
|
6
|
+
item: string;
|
|
18
7
|
};
|
|
19
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
declare function
|
|
9
|
+
declare function Grade({ titles, data, }: Omit<InfoCardProps, "children"> & {
|
|
21
10
|
data: {
|
|
22
|
-
|
|
11
|
+
level?: string;
|
|
12
|
+
levelString?: string;
|
|
13
|
+
levelColor?: string;
|
|
14
|
+
profileImage?: string;
|
|
15
|
+
score?: number;
|
|
16
|
+
grade?: number;
|
|
23
17
|
};
|
|
24
18
|
}): import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
declare function Profile(props: Partial<InfoCardProps>): import("react/jsx-runtime").JSX.Element;
|
|
26
19
|
declare const InfoCard: {
|
|
27
20
|
Exam: typeof Exam;
|
|
28
21
|
Product: typeof Product;
|
|
29
22
|
Item: typeof Item;
|
|
30
|
-
|
|
23
|
+
Grade: typeof Grade;
|
|
31
24
|
};
|
|
32
25
|
export default InfoCard;
|
|
@@ -1,73 +1,80 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useNavigate } from "react-router-dom";
|
|
3
|
+
import { InfoCardDesign } from "../widget/InfoCard.design";
|
|
4
|
+
import { Label } from "../..";
|
|
3
5
|
import { cn } from "../../util";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
const label = {
|
|
7
|
+
positions: "absolute bottom-5 right-5",
|
|
8
|
+
};
|
|
9
|
+
function Exam({ titles, data }) {
|
|
6
10
|
const { status, isPublic, manager, examDate, endDate } = data;
|
|
7
11
|
const container = {
|
|
8
12
|
positions: "relative",
|
|
9
13
|
displays: "flex flex-col justify-between mt-2.5",
|
|
10
14
|
sizes: "h-19.25 w-full",
|
|
11
15
|
};
|
|
12
|
-
const
|
|
13
|
-
positions: "absolute bottom-0 right-0",
|
|
14
|
-
sizes: "w-22 h-6",
|
|
15
|
-
displays: "flex justify-center items-center",
|
|
16
|
-
styles: "text-black rounded-md text-sm",
|
|
17
|
-
background: `bg-gray-light`,
|
|
18
|
-
};
|
|
16
|
+
const navigate = useNavigate();
|
|
19
17
|
return (_jsx(InfoCardDesign, { titles: titles, options: {
|
|
20
|
-
|
|
21
|
-
rightTextColor: "red-crimson",
|
|
18
|
+
titleBorder: "border-red-crimson",
|
|
22
19
|
width: "sm",
|
|
23
|
-
height: "
|
|
24
|
-
|
|
25
|
-
}, children: _jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex gap-4 font-bold ", children: [manager, " / ", isPublic ? "공개시험" : "비공개시험"] }), _jsxs("div", { children: [_jsxs("div", { className: "text-xs", children: ["\uC811\uC218\uB9C8\uAC10: ", endDate] }), _jsxs("div", { className: "text-xs", children: ["\uC2DC\uD5D8\uC77C: ", examDate] })] }), _jsx("div", { className: cn(style), children: status })] }) }));
|
|
20
|
+
height: "xs",
|
|
21
|
+
}, children: _jsxs(_Fragment, { children: [_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex gap-4 font-bold ", children: [manager, " / ", isPublic ? "공개시험" : "비공개시험"] }), _jsxs("div", { children: [_jsxs("div", { className: "text-xs", children: ["\uC811\uC218\uB9C8\uAC10: ", endDate] }), _jsxs("div", { className: "text-xs", children: ["\uC2DC\uD5D8\uC77C: ", examDate] })] })] }), _jsx(Label.Button, { title: status, onClick: () => navigate("/admin/grades/1"), options: { width: "sm", height: "xs", className: cn(label) } })] }) }));
|
|
26
22
|
}
|
|
27
|
-
function Product({ titles, data
|
|
28
|
-
const { date, status, receiver, requester
|
|
23
|
+
function Product({ titles, data }) {
|
|
24
|
+
const { date, status, receiver, requester } = data;
|
|
29
25
|
const container = {
|
|
30
26
|
positions: "relative",
|
|
31
27
|
displays: "flex flex-col mt-2.5",
|
|
32
28
|
sizes: "h-19.25 w-full",
|
|
33
29
|
};
|
|
34
|
-
const style = {
|
|
35
|
-
positions: "absolute bottom-0 right-0",
|
|
36
|
-
sizes: "w-22 h-6",
|
|
37
|
-
displays: "flex justify-center items-center",
|
|
38
|
-
styles: "rounded-md text-sm",
|
|
39
|
-
animation: "text-black bg-gray-light hover:bg-blue-sky hover:text-white duration-500",
|
|
40
|
-
};
|
|
41
|
-
const [hover, setHover] = useState(false);
|
|
42
30
|
return (_jsx(InfoCardDesign, { titles: titles, options: {
|
|
43
|
-
|
|
44
|
-
rightTextColor: "red-crimson",
|
|
31
|
+
titleBorder: "border-jr-blue",
|
|
45
32
|
width: "sm",
|
|
46
|
-
height: "
|
|
47
|
-
|
|
48
|
-
|
|
33
|
+
height: "xs",
|
|
34
|
+
}, children: _jsxs(_Fragment, { children: [_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "text-sm", children: ["\uC77C\uC2DC: ", date] }), _jsxs("div", { className: "text-sm", children: ["\uC694\uCCAD\uC790: ", requester ?? "No Data"] }), _jsxs("div", { className: "text-sm", children: ["\uC218\uC2E0\uC790: ", receiver ?? "No Data"] })] }), _jsx(Label.Button, { title: status ?? "", onClick: () => console.log("click"), options: {
|
|
35
|
+
width: "sm",
|
|
36
|
+
height: "xs",
|
|
37
|
+
className: cn(label),
|
|
38
|
+
background: "bg-gray-light hover:bg-blue-sky",
|
|
39
|
+
text: "hover:text-white",
|
|
40
|
+
} })] }) }));
|
|
49
41
|
}
|
|
50
42
|
function Item({ titles, data, }) {
|
|
51
43
|
const { item } = data;
|
|
52
44
|
return (_jsx(InfoCardDesign, { titles: titles, options: {
|
|
53
|
-
|
|
54
|
-
rightTextColor: "blue-navy",
|
|
45
|
+
titleBorder: "border-blue-navy",
|
|
55
46
|
width: "xs",
|
|
56
|
-
height: "
|
|
47
|
+
height: "xs",
|
|
57
48
|
}, children: _jsx("div", { children: item }) }));
|
|
58
49
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
50
|
+
function Grade({ titles, data, }) {
|
|
51
|
+
const container = {
|
|
52
|
+
positions: "relative",
|
|
53
|
+
displays: "flex flex-col justify-between mt-2.5",
|
|
54
|
+
sizes: "h-19.5 w-full",
|
|
55
|
+
};
|
|
56
|
+
const levelBox = {
|
|
57
|
+
displays: "flex justify-center items-center ",
|
|
58
|
+
sizes: "w-22.5 h-6.4",
|
|
59
|
+
styles: "bg-white-off text-sm rounded-md",
|
|
60
|
+
text: data.levelColor,
|
|
61
|
+
};
|
|
62
|
+
return (_jsx(InfoCardDesign, { titles: titles, options: {
|
|
63
|
+
titleBorder: "border-blue-navy",
|
|
63
64
|
width: "sm",
|
|
64
|
-
height: "
|
|
65
|
-
},
|
|
65
|
+
height: "xs",
|
|
66
|
+
}, children: _jsxs(_Fragment, { children: [_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex items-center gap-5", children: [_jsx("div", { className: cn(levelBox), children: data.levelString }), _jsx("span", { className: "text-sm", children: "\uD559\uC6D0\uC0DD, 23\uC138" })] }), _jsxs("div", { className: "absolute bottom-0 left-0 flex items-end gap-8 text-blue-navy", children: [_jsxs("div", { className: "w-20 h-12 flex justify-end items-end", children: [_jsx("div", { className: "leading-none text-4xl font-bold", children: data.score }), _jsx("div", { children: "\uC810" })] }), _jsxs("div", { className: "w-14 h-12 flex justify-end items-end", children: [_jsx("div", { className: "leading-none text-4xl font-bold", children: data.grade }), _jsx("div", { children: "\uB4F1\uAE09" })] })] })] }), _jsx(Label.Button, { title: "\uC0C1\uC138\uBCF4\uAE30", onClick: () => { }, options: {
|
|
67
|
+
width: "sm",
|
|
68
|
+
height: "xs",
|
|
69
|
+
text: "text-white hover:text-blue-navy",
|
|
70
|
+
background: "bg-blue-navy hover:bg-gray-light",
|
|
71
|
+
className: cn(label),
|
|
72
|
+
} }), _jsx("div", { className: "absolute right-5 top-5 w-22.5 h-22.5", children: _jsx("div", { className: "relative h-full w-full rounded-md overflow-hidden", children: _jsx("img", { className: "bg-cover rounded-md ", src: data.profileImage }) }) })] }) }));
|
|
66
73
|
}
|
|
67
74
|
const InfoCard = {
|
|
68
75
|
Exam,
|
|
69
76
|
Product,
|
|
70
77
|
Item,
|
|
71
|
-
|
|
78
|
+
Grade,
|
|
72
79
|
};
|
|
73
80
|
export default InfoCard;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NavCardBannerProps, NavCardButtonProps, NavCardButtonInLayProps } from "../../interface";
|
|
2
|
+
declare function Banner({ titles, options }: NavCardBannerProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function _Button({ titles, onClick, options }: NavCardButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function ButtonInLay({ titles, buttonInLay, options, }: NavCardButtonInLayProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function BannerAndButtonInLay({ banner, buttonInLay, }: {
|
|
6
|
+
banner: NavCardBannerProps;
|
|
7
|
+
buttonInLay: NavCardButtonInLayProps;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const NavCard: {
|
|
10
|
+
Banner: typeof Banner;
|
|
11
|
+
Button: typeof _Button;
|
|
12
|
+
ButtonInLay: typeof ButtonInLay;
|
|
13
|
+
BannerAndButtonInLay: typeof BannerAndButtonInLay;
|
|
14
|
+
};
|
|
15
|
+
export default NavCard;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import NavCardDesign from "../widget/NavCard.design";
|
|
3
|
+
function Banner({ titles, options }) {
|
|
4
|
+
return (_jsx(NavCardDesign, { titles: titles, options: { ...options, width: options?.width ?? "xl", height: "sm" } }));
|
|
5
|
+
}
|
|
6
|
+
function _Button({ titles, onClick, options }) {
|
|
7
|
+
return (_jsx(NavCardDesign, { titles: titles, options: {
|
|
8
|
+
...options,
|
|
9
|
+
onClick,
|
|
10
|
+
width: options?.width ?? "xs",
|
|
11
|
+
height: options?.height ?? "sm",
|
|
12
|
+
} }));
|
|
13
|
+
}
|
|
14
|
+
function ButtonInLay({ titles, buttonInLay, options, }) {
|
|
15
|
+
return (_jsx(NavCardDesign, { titles: titles, options: {
|
|
16
|
+
...options,
|
|
17
|
+
width: options?.width ?? "2xl",
|
|
18
|
+
height: options?.height ?? "sm",
|
|
19
|
+
buttonInLay: {
|
|
20
|
+
disabled: buttonInLay.disabled,
|
|
21
|
+
...buttonInLay,
|
|
22
|
+
width: buttonInLay.width ?? "lg",
|
|
23
|
+
height: "sm",
|
|
24
|
+
},
|
|
25
|
+
} }));
|
|
26
|
+
}
|
|
27
|
+
function BannerAndButtonInLay({ banner, buttonInLay, }) {
|
|
28
|
+
const bannerProps = {
|
|
29
|
+
...banner,
|
|
30
|
+
options: { ...banner.options, noShadow: true },
|
|
31
|
+
};
|
|
32
|
+
const buttonInLayProps = {
|
|
33
|
+
...buttonInLay,
|
|
34
|
+
options: { ...buttonInLay.options, noShadow: true },
|
|
35
|
+
};
|
|
36
|
+
return (_jsxs("div", { className: "flex", children: [_jsx("div", { className: "box-shadow rounded-xl", children: _jsx(Banner, { ...bannerProps }) }), _jsx("div", { className: "box-shadow rounded-xl", children: _jsx(ButtonInLay, { ...buttonInLayProps }) })] }));
|
|
37
|
+
}
|
|
38
|
+
const NavCard = {
|
|
39
|
+
Banner,
|
|
40
|
+
Button: _Button,
|
|
41
|
+
ButtonInLay,
|
|
42
|
+
BannerAndButtonInLay,
|
|
43
|
+
};
|
|
44
|
+
export default NavCard;
|
|
@@ -1,30 +1,22 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useId } from "react";
|
|
3
3
|
import { useWidgetStore } from "../../store";
|
|
4
4
|
import { cn, sortByOrder } from "../../util";
|
|
5
|
-
import { Card } from "../widget/Card";
|
|
5
|
+
import { Card } from "../widget/Card.design";
|
|
6
|
+
import { DataField, Row } from "../../layout";
|
|
6
7
|
export default function TableCard({ dataSets, dataField, options }) {
|
|
7
|
-
const { width, height
|
|
8
|
-
const { color: bgColor } = background ?? {};
|
|
9
|
-
const { color: textColor } = text ?? {};
|
|
8
|
+
const { width, height } = options ?? {};
|
|
10
9
|
const { order, setOrder } = useWidgetStore();
|
|
11
10
|
const id = useId();
|
|
12
11
|
const orders = order[id] ?? [];
|
|
13
12
|
const container = {
|
|
14
|
-
|
|
13
|
+
paddings: "pt-4 pb-14",
|
|
15
14
|
};
|
|
16
|
-
return (_jsx(Card, { header:
|
|
17
|
-
|
|
18
|
-
if (orderHow === "asc")
|
|
19
|
-
return "▲";
|
|
20
|
-
else if (orderHow === "desc")
|
|
21
|
-
return "▼";
|
|
22
|
-
else
|
|
23
|
-
return "";
|
|
24
|
-
}
|
|
25
|
-
}) })] }) }, id + key))), options: {
|
|
15
|
+
return (_jsx(Card, { header: _jsx(DataField.Card, { id: id, dataField: dataField }), options: {
|
|
16
|
+
classNames: cn(container),
|
|
26
17
|
width: width ?? "full",
|
|
27
18
|
height: height ?? "lg",
|
|
28
19
|
overflow: "y-scroll",
|
|
29
|
-
|
|
20
|
+
noPadding: true,
|
|
21
|
+
}, children: sortByOrder(dataSets, orders).map((dataSet, index) => (_jsx(Row.Card, { dataSet: dataSet, dataField: dataField }, id + index))) }));
|
|
30
22
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn, isDebug } from "../../util";
|
|
3
3
|
import { useWidgetStore } from "../../store";
|
|
4
4
|
const widthSize = {
|
|
@@ -12,9 +12,9 @@ const widthSize = {
|
|
|
12
12
|
auto: "w-auto",
|
|
13
13
|
};
|
|
14
14
|
const heightSize = {
|
|
15
|
-
xs: "h-
|
|
16
|
-
sm: "h-
|
|
17
|
-
md: "h-
|
|
15
|
+
xs: "h-45",
|
|
16
|
+
sm: "h-52.5",
|
|
17
|
+
md: "h-67.5",
|
|
18
18
|
lg: "h-67.5",
|
|
19
19
|
xl: "h-125",
|
|
20
20
|
"2xl": "",
|
|
@@ -23,10 +23,10 @@ const heightSize = {
|
|
|
23
23
|
};
|
|
24
24
|
export function Card({ header, children, options, debug }) {
|
|
25
25
|
const { setIsOwn } = useWidgetStore();
|
|
26
|
-
const { classNames, boundary, rounded, height, width, text, background, onClick, overflow, } = options ?? {};
|
|
27
|
-
const { size: textSize } = text ?? {};
|
|
28
|
-
const { color: bgColor } = background ?? {};
|
|
26
|
+
const { classNames, boundary, rounded, height, width, text, background, onClick, overflow, noShadow, } = options ?? {};
|
|
29
27
|
const setBoundary = () => {
|
|
28
|
+
if (noShadow)
|
|
29
|
+
return "";
|
|
30
30
|
if (boundary === "shadow")
|
|
31
31
|
return "box-shadow";
|
|
32
32
|
if (boundary === "border")
|
|
@@ -37,37 +37,22 @@ export function Card({ header, children, options, debug }) {
|
|
|
37
37
|
};
|
|
38
38
|
const container = {
|
|
39
39
|
positions: "relative",
|
|
40
|
-
sizes: `${widthSize[width ?? "sm"]} ${heightSize[height ?? "
|
|
40
|
+
sizes: `${widthSize[width ?? "sm"]} ${heightSize[height ?? "xs"]}`,
|
|
41
41
|
onClick: onClick ? "cursor-pointer" : "",
|
|
42
|
-
text:
|
|
42
|
+
text: `${text ?? "text-base"} text-black dark:text-white`,
|
|
43
43
|
boundary: setBoundary(),
|
|
44
44
|
rounded: `rounded-${rounded ?? "xl"}`,
|
|
45
|
-
bgColor:
|
|
45
|
+
bgColor: `${background ?? "bg-white/80"} dark:bg-black/80`,
|
|
46
46
|
styles: "duration-500 ",
|
|
47
|
-
debug: debug && isDebug(`border-2
|
|
47
|
+
debug: debug && isDebug(`border-2 ${debug}`),
|
|
48
48
|
overflow: "overflow-hidden",
|
|
49
49
|
};
|
|
50
|
-
const headerStyle = {
|
|
51
|
-
container: {
|
|
52
|
-
positions: "relative",
|
|
53
|
-
sizes: "h-11 ",
|
|
54
|
-
},
|
|
55
|
-
body: {
|
|
56
|
-
positions: "absolute top-0 left-0",
|
|
57
|
-
displays: "flex items-center pl-4",
|
|
58
|
-
sizes: "w-full h-full",
|
|
59
|
-
styles: `bg-${bgColor ?? "gray-300"} text-black font-bold`,
|
|
60
|
-
},
|
|
61
|
-
block: {
|
|
62
|
-
sizes: "w-full h-full",
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
50
|
const body = {
|
|
66
51
|
sizes: "h-full",
|
|
67
52
|
overflow: `overflow-${overflow ?? "hidden"}`,
|
|
68
53
|
classNames,
|
|
69
54
|
};
|
|
70
|
-
return (_jsxs("div", { className: cn(container), children: [header &&
|
|
55
|
+
return (_jsxs("div", { className: cn(container), children: [header && _jsx(_Fragment, { children: header }), _jsx("div", { onClick: onClick &&
|
|
71
56
|
(() => {
|
|
72
57
|
setIsOwn(true);
|
|
73
58
|
return onClick();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../../util";
|
|
3
|
-
import { Card } from "
|
|
3
|
+
import { Card } from "./Card.design";
|
|
4
4
|
export function InfoCardDesign({ titles: { title, subtitle }, debug, options, children, }) {
|
|
5
|
-
const {
|
|
5
|
+
const { titleBorder, text } = options ?? {};
|
|
6
6
|
const container = {
|
|
7
7
|
paddings: "pt-5 px-5",
|
|
8
8
|
};
|
|
@@ -10,14 +10,14 @@ export function InfoCardDesign({ titles: { title, subtitle }, debug, options, ch
|
|
|
10
10
|
container: {
|
|
11
11
|
displays: "flex justify-between",
|
|
12
12
|
sizes: "w-full h-13.25",
|
|
13
|
-
styles:
|
|
13
|
+
styles: `${titleBorder} border-b-2 pb-2.5`,
|
|
14
14
|
},
|
|
15
|
-
titleText: "h-6 font-bold text-
|
|
16
|
-
subtitleText: "h-
|
|
15
|
+
titleText: "h-6 font-bold text-xl w-52 truncate",
|
|
16
|
+
subtitleText: "h-7 text-base font-extralight flex items-center",
|
|
17
17
|
right: {
|
|
18
|
-
fontColor:
|
|
18
|
+
fontColor: `${text ?? "text-black"}`,
|
|
19
19
|
displays: "flex flex-col-reverse",
|
|
20
20
|
},
|
|
21
21
|
};
|
|
22
|
-
return (_jsxs(Card, { options: { ...options, classNames: cn(container) }, debug: debug, children: [_jsx("div", { className: cn(topBox.container), children: _jsxs("div", { children: [_jsx("div", { className: cn(topBox.titleText), children: title }), _jsx("div", { className: cn(topBox.subtitleText), children: subtitle ?? "
|
|
22
|
+
return (_jsxs(Card, { options: { ...options, classNames: cn(container) }, debug: debug, children: [_jsx("div", { className: cn(topBox.container), children: _jsxs("div", { className: "text-gray-dim ", children: [_jsx("div", { className: cn(topBox.titleText), children: title }), _jsx("div", { className: cn(topBox.subtitleText), children: subtitle ?? "" })] }) }), children] }));
|
|
23
23
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Label } from "../../html";
|
|
3
|
+
import { LineBreaks } from "../../text";
|
|
4
|
+
import { cn } from "../../util";
|
|
5
|
+
import { Card } from "./Card.design";
|
|
6
|
+
export default function NavCard({ titles, options }) {
|
|
7
|
+
const { title, subtitle, color: titleColor } = titles;
|
|
8
|
+
const { width, image, buttonInLay } = options ?? {};
|
|
9
|
+
const { path, size } = image ?? { size: "sub" };
|
|
10
|
+
const flag = !buttonInLay && width === "xl";
|
|
11
|
+
const textBox = {
|
|
12
|
+
container: {
|
|
13
|
+
positons: `absolute z-10 ${flag ? "left-12 top-0" : "top-7.5 left-7.5"}`,
|
|
14
|
+
sizes: flag && "h-full",
|
|
15
|
+
displays: `flex flex-col ${flag ? "gap-7.5 justify-center" : "gap-2.5"}`,
|
|
16
|
+
styles: `${titleColor ?? "text-gray-dim"}`,
|
|
17
|
+
},
|
|
18
|
+
title: `${flag ? "text-2xl h-6.75" : "text-xl h-6"} font-bold`,
|
|
19
|
+
subtitle: "text-base h-10",
|
|
20
|
+
};
|
|
21
|
+
const imageClassNames = () => {
|
|
22
|
+
if (size === "full")
|
|
23
|
+
return "w-full h-full object-cover";
|
|
24
|
+
return "absolute bottom-0 right-0 w-full xs:w-auto max-w-120 z-0 max-h-44 object-contain";
|
|
25
|
+
};
|
|
26
|
+
return (_jsxs(Card, { options: options, children: [_jsxs("div", { className: cn(textBox.container), children: [_jsx("div", { className: cn(textBox.title), children: title }), _jsx(LineBreaks, { className: "subtitle", texts: subtitle ?? "" })] }), buttonInLay && (_jsx(Label.Button, { title: buttonInLay.title, onClick: buttonInLay.onClick, options: {
|
|
27
|
+
disabled: buttonInLay.disabled,
|
|
28
|
+
className: "absolute bottom-7.5 left-7.5",
|
|
29
|
+
background: buttonInLay?.background,
|
|
30
|
+
text: buttonInLay?.text,
|
|
31
|
+
} })), path ? (_jsx("img", { src: path, alt: "trump-image", loading: "lazy", className: imageClassNames() })) : null] }));
|
|
32
|
+
}
|
package/globals.css
CHANGED
|
@@ -91,7 +91,24 @@ input[type="date"]::-webkit-calendar-picker-indicator {
|
|
|
91
91
|
box-shadow: 0 0 0 1px #e5e7eb inset, 0 4px 6px -1px rgba(0, 0, 0, 0.1),
|
|
92
92
|
0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
93
93
|
}
|
|
94
|
-
.
|
|
94
|
+
.box-shadow-focus:focus {
|
|
95
|
+
box-shadow: 0 0 0 1px #e5e7eb inset, 0 4px 6px -1px rgba(0, 0, 0, 0.1),
|
|
96
|
+
0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
97
|
+
}
|
|
98
|
+
.box-shadow-focus-red:focus {
|
|
99
|
+
box-shadow: 0px 0px 10px 0px #ff8383;
|
|
100
|
+
}
|
|
101
|
+
.box-green {
|
|
102
|
+
background: rgba(16, 86, 82, 0.1);
|
|
103
|
+
color: #105652;
|
|
104
|
+
}
|
|
105
|
+
.box-green-focus:focus {
|
|
106
|
+
background: white;
|
|
107
|
+
color: black;
|
|
108
|
+
box-shadow: 0px 0px 10px 0px rgba(16, 86, 82, 0.38);
|
|
109
|
+
}
|
|
110
|
+
/* box-shadow: 0px 0px 10px 0px rgba(16, 86, 82, 0.38); */
|
|
111
|
+
.box-inner-shadow:hover {
|
|
95
112
|
box-shadow: 0 0 0 1px #e5e7eb inset, 0 4px 6px -1px rgba(0, 0, 0, 0.1),
|
|
96
113
|
0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
97
114
|
}
|
|
@@ -154,7 +171,6 @@ input[type="date"]::-webkit-calendar-picker-indicator {
|
|
|
154
171
|
.react-datepicker__children-container {
|
|
155
172
|
width: 16rem !important;
|
|
156
173
|
}
|
|
157
|
-
|
|
158
174
|
/* toggle button */
|
|
159
175
|
[type="checkbox"]::before {
|
|
160
176
|
content: "";
|
package/html/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { default as
|
|
1
|
+
export { default as DatePicker } from "./widget/DatePicker";
|
|
2
2
|
export { default as Input } from "./widget/Input";
|
|
3
|
+
export { default as Label } from "./template/Label";
|
|
3
4
|
export { default as Select } from "./widget/Select";
|
|
4
5
|
export { default as Toggle } from "./widget/Toggle";
|
package/html/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { default as
|
|
1
|
+
export { default as DatePicker } from "./widget/DatePicker";
|
|
2
2
|
export { default as Input } from "./widget/Input";
|
|
3
|
+
export { default as Label } from "./template/Label";
|
|
3
4
|
export { default as Select } from "./widget/Select";
|
|
4
5
|
export { default as Toggle } from "./widget/Toggle";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLLabelElement, OnClick } from "../../interface";
|
|
2
|
+
declare function Label({ title, options }: Omit<HTMLLabelElement, "onClick">): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare namespace Label {
|
|
4
|
+
var Button: ({ title, onClick, options, }: HTMLLabelElement & {
|
|
5
|
+
onClick: OnClick;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
}
|
|
8
|
+
export default Label;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import LabelDesign from "./../widget/Label.design";
|
|
3
|
+
function Label({ title, options }) {
|
|
4
|
+
return (_jsx(LabelDesign, { title: title, options: { ...options, width: "sm", height: "xs" } }));
|
|
5
|
+
}
|
|
6
|
+
function Button({ title, onClick, options, }) {
|
|
7
|
+
return (_jsx(LabelDesign, { title: title, onClick: onClick, options: {
|
|
8
|
+
...options,
|
|
9
|
+
width: options?.width ?? "md",
|
|
10
|
+
height: options?.height ?? "sm",
|
|
11
|
+
} }));
|
|
12
|
+
}
|
|
13
|
+
Label.Button = Button;
|
|
14
|
+
export default Label;
|
|
@@ -17,7 +17,7 @@ export default function DatePicker({ options }) {
|
|
|
17
17
|
const { width } = options ?? {};
|
|
18
18
|
const [selectedDate, setSelectedDate] = useState(new Date());
|
|
19
19
|
const calRef = useRef(null);
|
|
20
|
-
return (_jsx("div", { children: _jsx(ReactDatePicker, { dateFormat: "yyyy\uB144 MM\uC6D4 dd\uC77C", icon: "fa fa-calendar", minDate: new Date("1900-01-01"), maxDate: new Date("2100-01-01"), selected: selectedDate, shouldCloseOnSelect: false, ref: calRef, onChange: (date) => setSelectedDate(date), locale: ko, className: "bg-slate-200 p-1 pl-
|
|
20
|
+
return (_jsx("div", { children: _jsx(ReactDatePicker, { dateFormat: "yyyy\uB144 MM\uC6D4 dd\uC77C", icon: "fa fa-calendar", minDate: new Date("1900-01-01"), maxDate: new Date("2100-01-01"), selected: selectedDate, shouldCloseOnSelect: false, ref: calRef, onChange: (date) => setSelectedDate(date), locale: ko, className: "bg-slate-200 p-1 pl-2 pr-4 text-sm text-left rounded-md hover:bg-white focus:bg-white transition-all box-inner-shadow focus:outline-none w-68 h-8", children: _jsx("div", { className: "w-full h-auto flex justify-end items-end pr-4 pb-4", children: _jsx("button", { className: "p-2 bg-green-dark text-white rounded-md pr-4 pl-4 hover:opacity-85 hover:shadow-md transition-all", onClick: () => {
|
|
21
21
|
calRef.current.setOpen(false);
|
|
22
22
|
}, children: "\uC800\uC7A5\uD558\uAE30" }) }) }) }));
|
|
23
23
|
}
|