@edu-tosel/design 0.1.8 → 1.0.0
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/Kostar.ttf +0 -0
- package/asset/fonts/Megrim.ttf +0 -0
- package/asset/fonts/NicoMoji.ttf +0 -0
- package/asset/fonts/Pretendard-Medium.otf +0 -0
- package/board/Board.d.ts +2 -7
- package/board/Board.js +6 -3
- package/board/CanvasBoard.d.ts +2 -7
- package/board/CanvasBoard.js +3 -3
- package/card/Card.d.ts +2 -14
- package/card/Card.js +13 -11
- package/card/ChartCard.d.ts +1 -18
- package/card/ChartCard.js +1 -1
- package/card/ProfileCard.js +1 -1
- package/card/TableCard.d.ts +2 -11
- package/card/TableCard.js +2 -2
- package/card/TrumpCard.d.ts +2 -19
- package/card/TrumpCard.js +1 -1
- package/deck/Deck.js +2 -2
- package/globals.css +31 -4
- package/interface/Board.d.ts +12 -0
- package/interface/Board.js +1 -0
- package/interface/Card.d.ts +70 -0
- package/interface/Card.js +1 -0
- package/interface/Modal.d.ts +18 -0
- package/interface/Modal.js +1 -0
- package/interface/Property.d.ts +32 -0
- package/interface/Property.js +12 -0
- package/interface/Widget.d.ts +4 -0
- package/interface/Widget.js +1 -0
- package/interface/index.d.ts +3 -0
- package/interface/index.js +3 -0
- package/modal/AlertModal.d.ts +2 -0
- package/modal/AlertModal.js +8 -0
- package/modal/Modal.d.ts +2 -8
- package/modal/Modal.js +25 -20
- package/modal/TestModal.d.ts +4 -0
- package/modal/TestModal.js +5 -0
- package/modal/index.d.ts +2 -1
- package/modal/index.js +2 -1
- package/navigation/Navigation.js +1 -1
- package/package.json +1 -1
- package/store/index.d.ts +10 -0
- package/store/index.js +18 -0
- package/tailwind.config.ts +2 -1
- package/version.txt +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/board/Board.d.ts
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function Board({ children,
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
options: {
|
|
5
|
-
height?: number;
|
|
6
|
-
};
|
|
7
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { BoardProps } from "../interface/Board";
|
|
2
|
+
export declare function Board({ children, widget, options }: BoardProps): import("react/jsx-runtime").JSX.Element;
|
package/board/Board.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export function Board({ children,
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export function Board({ children, widget, options }) {
|
|
3
3
|
const { height } = options ?? {};
|
|
4
|
+
const { events, widgets } = widget ?? {};
|
|
4
5
|
const classNames = [
|
|
5
6
|
`min-h-screen xl:min-h-0 xl:h-186 `,
|
|
6
7
|
"xl:rounded-xl bg-white/80 relative w-full ",
|
|
7
8
|
].join(" ");
|
|
8
|
-
return
|
|
9
|
+
return (_jsxs("div", { className: classNames + "", children: [children, _jsx(_Fragment, { children: widgets?.map(([widgetEvent, Component]) => {
|
|
10
|
+
return events?.some(({ event }) => event === widgetEvent) ? (_jsx(_Fragment, { children: Component })) : null;
|
|
11
|
+
}) })] }));
|
|
9
12
|
}
|
package/board/CanvasBoard.d.ts
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function CanvasBoard({ children,
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
options?: {
|
|
5
|
-
height?: number;
|
|
6
|
-
};
|
|
7
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { BoardProps } from "../interface/Board";
|
|
2
|
+
export declare function CanvasBoard({ children, widget, options }: BoardProps): import("react/jsx-runtime").JSX.Element;
|
package/board/CanvasBoard.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../util";
|
|
3
3
|
import { Board } from "./Board";
|
|
4
|
-
export function CanvasBoard({ children,
|
|
4
|
+
export function CanvasBoard({ children, widget, options }) {
|
|
5
5
|
const { height } = options ?? {};
|
|
6
6
|
const layouts = "flex flex-wrap gap-12 ";
|
|
7
7
|
const sizes = "h-full ";
|
|
8
|
-
const paddings = "pb-36 xl:pb-12 px-2 xs:px-4 xl:pl-
|
|
8
|
+
const paddings = "pb-36 xl:pb-12 px-2 xs:px-4 xl:pl-8 xl:pr-2 pt-2 xs:pt-4 xl:pt-8";
|
|
9
9
|
const styles = "xl:overflow-y-scroll ";
|
|
10
|
-
return (_jsx(Board, { options: { height }, children: _jsx("div", { className: cn(layouts, sizes, paddings, styles), children: children }) }));
|
|
10
|
+
return (_jsx(Board, { widget: widget, options: { height }, children: _jsx("div", { className: cn(layouts, sizes, paddings, styles), children: children }) }));
|
|
11
11
|
}
|
package/card/Card.d.ts
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import "../globals.css";
|
|
3
|
-
|
|
4
|
-
export declare function Card({ children, options
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
options?: {
|
|
7
|
-
height?: Size;
|
|
8
|
-
width?: Size;
|
|
9
|
-
text?: {
|
|
10
|
-
size?: string;
|
|
11
|
-
color?: string;
|
|
12
|
-
};
|
|
13
|
-
onClick?: () => unknown | (() => Promise<unknown>);
|
|
14
|
-
};
|
|
15
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
import { CardProps } from "../interface/Card";
|
|
3
|
+
export declare function Card({ children, options }: CardProps): import("react/jsx-runtime").JSX.Element;
|
package/card/Card.js
CHANGED
|
@@ -2,23 +2,25 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import "../globals.css";
|
|
3
3
|
import { cn } from "../util";
|
|
4
4
|
const widthSize = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
xs: "",
|
|
6
|
+
sm: "md:w-60",
|
|
7
|
+
md: "md:w-90",
|
|
8
|
+
lg: "md:w-135",
|
|
9
|
+
xl: "md:w-225",
|
|
9
10
|
};
|
|
10
11
|
const heightSize = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
xs: "",
|
|
13
|
+
sm: "h-72 sm:h-48",
|
|
14
|
+
md: "h-72 sm:h-48",
|
|
15
|
+
lg: "h-80",
|
|
16
|
+
xl: "h-125",
|
|
15
17
|
};
|
|
16
|
-
export function Card({ children, options
|
|
18
|
+
export function Card({ children, options }) {
|
|
17
19
|
const { height, width, text, onClick } = options ?? {};
|
|
18
20
|
const { size: textSize, color: textColor } = text ?? {};
|
|
19
21
|
const sizes = [
|
|
20
|
-
`${heightSize[height ?? "
|
|
21
|
-
`w-full ${widthSize[width ?? "
|
|
22
|
+
`${heightSize[height ?? "sm"]}`,
|
|
23
|
+
`w-full ${widthSize[width ?? "sm"]}`,
|
|
22
24
|
].join(" ");
|
|
23
25
|
const positions = "relative";
|
|
24
26
|
const styles = [
|
package/card/ChartCard.d.ts
CHANGED
|
@@ -1,20 +1,3 @@
|
|
|
1
1
|
import "../globals.css";
|
|
2
|
-
|
|
3
|
-
data: Record<string, string | number>[];
|
|
4
|
-
xAxis: string;
|
|
5
|
-
yAxis: string;
|
|
6
|
-
lines?: {
|
|
7
|
-
dataKey: string;
|
|
8
|
-
stroke: string;
|
|
9
|
-
}[];
|
|
10
|
-
bars?: {
|
|
11
|
-
dataKey: string;
|
|
12
|
-
fill: string;
|
|
13
|
-
}[];
|
|
14
|
-
areas?: {
|
|
15
|
-
dataKey: string;
|
|
16
|
-
fill: string;
|
|
17
|
-
}[];
|
|
18
|
-
}
|
|
2
|
+
import { ChartCardProps } from "../interface/Card";
|
|
19
3
|
export declare function ChartCard({ data, xAxis, yAxis, lines, bars, areas, }: ChartCardProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
export {};
|
package/card/ChartCard.js
CHANGED
|
@@ -3,5 +3,5 @@ import "../globals.css";
|
|
|
3
3
|
import { Area, Bar, ComposedChart, Line, ResponsiveContainer, Tooltip, XAxis, YAxis, } from "recharts";
|
|
4
4
|
import { Card } from "./Card";
|
|
5
5
|
export function ChartCard({ data, xAxis, yAxis, lines, bars, areas, }) {
|
|
6
|
-
return (_jsx(Card, { options: { width: "
|
|
6
|
+
return (_jsx(Card, { options: { width: "xl", height: "lg", text: { size: "xs" } }, children: _jsx(ResponsiveContainer, { width: "100%", height: "100%", children: _jsxs(ComposedChart, { data: data, children: [_jsx(XAxis, { dataKey: xAxis }), _jsx(YAxis, { dataKey: yAxis }), _jsx(Tooltip, {}), lines?.map((line) => (_jsx(Line, { ...line }, line.dataKey))), bars?.map((bar) => (_jsx(Bar, { ...bar }, bar.dataKey))), areas?.map((area) => (_jsx(Area, { ...area }, area.dataKey)))] }) }) }));
|
|
7
7
|
}
|
package/card/ProfileCard.js
CHANGED
|
@@ -4,5 +4,5 @@ import { colorsByLevel } from "../util";
|
|
|
4
4
|
export function ProfileCard({ info, gradeData, }) {
|
|
5
5
|
const { name, birthday, image } = info;
|
|
6
6
|
const { level, score, grade } = gradeData ?? {};
|
|
7
|
-
return (_jsx(Card, { options: { width: "
|
|
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
8
|
}
|
package/card/TableCard.d.ts
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
1
|
import "../globals.css";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
fields: Record<string, string>;
|
|
5
|
-
sizes: Record<string, string>;
|
|
6
|
-
options?: {
|
|
7
|
-
color?: {
|
|
8
|
-
background: string;
|
|
9
|
-
text: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
import { TableCardProps } from "../interface/Card";
|
|
3
|
+
export declare function TableCard({ data, fields, sizes, options }: TableCardProps): import("react/jsx-runtime").JSX.Element;
|
package/card/TableCard.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import "../globals.css";
|
|
3
3
|
import { Card } from "./Card";
|
|
4
|
-
export function TableCard({ data, fields, sizes, options
|
|
4
|
+
export function TableCard({ data, fields, sizes, options }) {
|
|
5
5
|
const { color } = options ?? {};
|
|
6
6
|
const { background: bgColor, text: textColor } = color ?? {};
|
|
7
7
|
const keys = Object.keys(fields);
|
|
@@ -9,5 +9,5 @@ export function TableCard({ data, fields, sizes, options, }) {
|
|
|
9
9
|
`flex h-11 items-center font-bold pl-4`,
|
|
10
10
|
`bg-${bgColor ?? "gray-300"} text-${textColor ?? "black"}`,
|
|
11
11
|
].join(" ");
|
|
12
|
-
return (_jsx(Card, { options: { width: "
|
|
12
|
+
return (_jsx(Card, { options: { width: "lg", height: "lg" }, children: _jsxs("div", { className: "overflow-hidden text-xs xs:text-sm sm:text-base", children: [_jsx("div", { className: fieldsClassNames, children: keys.map((key) => (_jsx("div", { className: `w-${sizes[key]}`, children: fields[key] }, key))) }), data.map((row, index) => (_jsx("div", { className: "flex items-center pl-4 h-11 ", children: keys.map((key) => (_jsx("div", { className: `truncate w-${sizes[key] ?? "auto"}`, children: row[key] }, key))) }, index)))] }) }));
|
|
13
13
|
}
|
package/card/TrumpCard.d.ts
CHANGED
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare function TrumpCard({ titles, options, }: {
|
|
4
|
-
titles: {
|
|
5
|
-
title: string;
|
|
6
|
-
subTitle?: string[];
|
|
7
|
-
color?: string;
|
|
8
|
-
};
|
|
9
|
-
options?: {
|
|
10
|
-
width?: Size;
|
|
11
|
-
image?: {
|
|
12
|
-
path: string;
|
|
13
|
-
size?: ImageSize;
|
|
14
|
-
};
|
|
15
|
-
onClick?: () => unknown | (() => Promise<unknown>);
|
|
16
|
-
subButton?: [string, string, () => unknown | (() => Promise<unknown>)];
|
|
17
|
-
};
|
|
18
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export {};
|
|
1
|
+
import { TrumpCardProps } from "../interface/Card";
|
|
2
|
+
export declare function TrumpCard({ titles, options }: TrumpCardProps): import("react/jsx-runtime").JSX.Element;
|
package/card/TrumpCard.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { LineBreaks } from "../text";
|
|
3
3
|
import { Card } from "./Card";
|
|
4
|
-
export function TrumpCard({ titles, options
|
|
4
|
+
export function TrumpCard({ titles, options }) {
|
|
5
5
|
const { title, subTitle, color: titleColor } = titles;
|
|
6
6
|
const { onClick, width, image, subButton } = options ?? {};
|
|
7
7
|
const [buttonText, buttonBgColor, buttonAction] = subButton ?? [
|
package/deck/Deck.js
CHANGED
|
@@ -3,10 +3,10 @@ export function Deck({ children, titles, options, }) {
|
|
|
3
3
|
const { title, subTitle, gapTitle } = titles ?? {};
|
|
4
4
|
const { height, gapX, gapY } = options ?? {};
|
|
5
5
|
const containerClassNames = [
|
|
6
|
-
`flex flex-col h-${height ?? "auto"} gap-${gapTitle ?? 4} `,
|
|
6
|
+
`flex sm:w-full flex-col h-${height ?? "auto"} gap-${gapTitle ?? 4} `,
|
|
7
7
|
].join(" ");
|
|
8
8
|
const bodyClassNames = [
|
|
9
|
-
`flex flex-col sm:flex-row `,
|
|
9
|
+
`flex flex-col sm:flex-row sm:w-full `,
|
|
10
10
|
`gap-x-${gapX ?? 5} gap-y-${gapY ?? 5}`,
|
|
11
11
|
"duration-500",
|
|
12
12
|
].join(" ");
|
package/globals.css
CHANGED
|
@@ -4,22 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
@font-face {
|
|
6
6
|
font-family: "Pretendard-Medium";
|
|
7
|
-
src: url("/fonts/Pretendard-Medium.otf") format("opentype");
|
|
7
|
+
src: url("../src/asset/fonts/Pretendard-Medium.otf") format("opentype");
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
@font-face {
|
|
11
11
|
font-family: "Kostar";
|
|
12
|
-
src: url("/fonts/Kostar.ttf") format("truetype");
|
|
12
|
+
src: url("../src/asset/fonts/Kostar.ttf") format("truetype");
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
@font-face {
|
|
16
16
|
font-family: "NicoMoji";
|
|
17
|
-
src: url("/fonts/NicoMoji.ttf") format("truetype");
|
|
17
|
+
src: url("../src/asset/fonts/NicoMoji.ttf") format("truetype");
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
@font-face {
|
|
21
21
|
font-family: "Megrim";
|
|
22
|
-
src: url("/fonts/Megrim.ttf") format("trueType");
|
|
22
|
+
src: url("../src/asset/fonts/Megrim.ttf") format("trueType");
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
::-webkit-scrollbar {
|
|
@@ -38,3 +38,30 @@
|
|
|
38
38
|
.box-shadow {
|
|
39
39
|
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.15);
|
|
40
40
|
}
|
|
41
|
+
|
|
42
|
+
.x-shape {
|
|
43
|
+
position: relative;
|
|
44
|
+
width: 0.83625rem;
|
|
45
|
+
height: 0.83625rem;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.x-shape::before,
|
|
49
|
+
.x-shape::after {
|
|
50
|
+
content: "";
|
|
51
|
+
position: absolute;
|
|
52
|
+
top: 50%;
|
|
53
|
+
left: 50%;
|
|
54
|
+
width: 2.5px;
|
|
55
|
+
border-radius: 2px;
|
|
56
|
+
height: 100%;
|
|
57
|
+
background-color: white;
|
|
58
|
+
transform-origin: center;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.x-shape::before {
|
|
62
|
+
transform: translate(-50%, -50%) rotate(45deg);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.x-shape::after {
|
|
66
|
+
transform: translate(-50%, -50%) rotate(-45deg);
|
|
67
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WidgetEvent } from "./Widget";
|
|
3
|
+
export interface BoardProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
widget?: {
|
|
6
|
+
events: WidgetEvent[];
|
|
7
|
+
widgets: [[string, React.ReactNode]];
|
|
8
|
+
};
|
|
9
|
+
options?: {
|
|
10
|
+
height?: number;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ImageSize, Size } from "./Property";
|
|
3
|
+
/**
|
|
4
|
+
* CardProps is an interface.
|
|
5
|
+
* @interface CardProps
|
|
6
|
+
* @property {React.ReactNode} children
|
|
7
|
+
* @property {object} options
|
|
8
|
+
* @property {Size} options.height
|
|
9
|
+
* @property {Size} options.width
|
|
10
|
+
* @property {object} options.text
|
|
11
|
+
* @property {string} options.text.size
|
|
12
|
+
* @property {string} options.text.color
|
|
13
|
+
* @property {() => unknown | (() => Promise<unknown>)} options.onClick
|
|
14
|
+
*/
|
|
15
|
+
export interface CardProps {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
options?: {
|
|
18
|
+
height?: Size;
|
|
19
|
+
width?: Size;
|
|
20
|
+
text?: {
|
|
21
|
+
size?: string;
|
|
22
|
+
color?: string;
|
|
23
|
+
};
|
|
24
|
+
onClick?: () => unknown | (() => Promise<unknown>);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface ChartCardProps {
|
|
28
|
+
data: Record<string, string | number>[];
|
|
29
|
+
xAxis: string;
|
|
30
|
+
yAxis: string;
|
|
31
|
+
lines?: {
|
|
32
|
+
dataKey: string;
|
|
33
|
+
stroke: string;
|
|
34
|
+
}[];
|
|
35
|
+
bars?: {
|
|
36
|
+
dataKey: string;
|
|
37
|
+
fill: string;
|
|
38
|
+
}[];
|
|
39
|
+
areas?: {
|
|
40
|
+
dataKey: string;
|
|
41
|
+
fill: string;
|
|
42
|
+
}[];
|
|
43
|
+
}
|
|
44
|
+
export interface TableCardProps {
|
|
45
|
+
data: Record<string, string | number>[];
|
|
46
|
+
fields: Record<string, string>;
|
|
47
|
+
sizes: Record<string, string>;
|
|
48
|
+
options?: {
|
|
49
|
+
color?: {
|
|
50
|
+
background: string;
|
|
51
|
+
text: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export interface TrumpCardProps {
|
|
56
|
+
titles: {
|
|
57
|
+
title: string;
|
|
58
|
+
subTitle?: string[];
|
|
59
|
+
color?: string;
|
|
60
|
+
};
|
|
61
|
+
options?: {
|
|
62
|
+
width?: Size;
|
|
63
|
+
image?: {
|
|
64
|
+
path: string;
|
|
65
|
+
size?: ImageSize;
|
|
66
|
+
};
|
|
67
|
+
onClick?: () => unknown | (() => Promise<unknown>);
|
|
68
|
+
subButton?: [string, string, () => unknown | (() => Promise<unknown>)];
|
|
69
|
+
};
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Button, Scripts, Size } from "./Property";
|
|
3
|
+
export interface ModalProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
options?: {
|
|
6
|
+
width?: Size;
|
|
7
|
+
height?: Size;
|
|
8
|
+
padding?: Record<string, number>;
|
|
9
|
+
buttons?: Button[];
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface AlertModalProps {
|
|
13
|
+
title: string;
|
|
14
|
+
scripts: Scripts;
|
|
15
|
+
options?: {
|
|
16
|
+
buttons?: Button[];
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Size type
|
|
3
|
+
* @enum {string}
|
|
4
|
+
* @readonly
|
|
5
|
+
* @description - Size type for the component
|
|
6
|
+
* @property {"xs"} xs - Extra small size
|
|
7
|
+
* @property {"sm"} sm - Small size
|
|
8
|
+
* @property {"md"} md - Medium size
|
|
9
|
+
* @property {"lg"} lg - Large size
|
|
10
|
+
* @property {"xl"} xl - Extra large size
|
|
11
|
+
*/
|
|
12
|
+
export type Size = "xs" | "sm" | "md" | "lg" | "xl";
|
|
13
|
+
/**
|
|
14
|
+
* Image size type
|
|
15
|
+
* @enum {string}
|
|
16
|
+
* @readonly
|
|
17
|
+
* @description - Size type for the image
|
|
18
|
+
* @property {"sub"} sub - Sub size
|
|
19
|
+
* @property {"full"} full - Full size
|
|
20
|
+
*/
|
|
21
|
+
export type ImageSize = "sub" | "full";
|
|
22
|
+
export type OnClick = () => unknown | Promise<unknown>;
|
|
23
|
+
export type Button = [string, OnClick];
|
|
24
|
+
export type Scripts = {
|
|
25
|
+
script: string;
|
|
26
|
+
subScript?: string;
|
|
27
|
+
};
|
|
28
|
+
export type Titles = {
|
|
29
|
+
title: string;
|
|
30
|
+
subTitle?: string[];
|
|
31
|
+
color?: string;
|
|
32
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Size type
|
|
3
|
+
* @enum {string}
|
|
4
|
+
* @readonly
|
|
5
|
+
* @description - Size type for the component
|
|
6
|
+
* @property {"xs"} xs - Extra small size
|
|
7
|
+
* @property {"sm"} sm - Small size
|
|
8
|
+
* @property {"md"} md - Medium size
|
|
9
|
+
* @property {"lg"} lg - Large size
|
|
10
|
+
* @property {"xl"} xl - Extra large size
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { col } from "../util";
|
|
3
|
+
import { Modal } from "./Modal";
|
|
4
|
+
export default function AlertModal({ title, scripts, options, }) {
|
|
5
|
+
const { script, subScript } = scripts ?? {};
|
|
6
|
+
const { buttons } = options ?? {};
|
|
7
|
+
return (_jsx(Modal, { options: { buttons }, children: _jsx("div", { className: col(3) + "pl-25 pt-18 h-full pb-12", children: _jsxs("div", { className: col(6), children: [_jsx("div", { className: "text-3xl font-bold", children: title }), _jsx("div", { className: "h-2 w-14 rounded-full bg-pale-lavender" }), _jsx("div", { className: "text-xl font-bold", children: script })] }) }) }));
|
|
8
|
+
}
|
package/modal/Modal.d.ts
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function
|
|
3
|
-
titles?: string[];
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
buttons?: [string, () => unknown | (() => Promise<unknown>)][];
|
|
6
|
-
close: () => void;
|
|
7
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export declare function AlertModal(): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { ModalProps } from "../interface/Modal";
|
|
2
|
+
export declare function Modal({ children, options }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
package/modal/Modal.js
CHANGED
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
export function
|
|
20
|
-
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useWidgetStore } from "../store";
|
|
3
|
+
import { absolute, cn } from "../util";
|
|
4
|
+
const background = "z-50 flex min-h-screen w-full items-center justify-center bg-black/10 backdrop-blur-sm fixed top-0 left-0";
|
|
5
|
+
const widthSize = {
|
|
6
|
+
xs: "w-2/3 min-w-76 max-w-176",
|
|
7
|
+
sm: "w-2/3 min-w-76 max-w-176",
|
|
8
|
+
md: "w-2/3 min-w-76 max-w-176",
|
|
9
|
+
lg: "w-full min-w-76 max-w-360",
|
|
10
|
+
xl: "w-2/3 min-w-76 max-w-176",
|
|
11
|
+
};
|
|
12
|
+
const heightSize = {
|
|
13
|
+
xs: "",
|
|
14
|
+
sm: "h-100",
|
|
15
|
+
md: "h-72 sm:h-48",
|
|
16
|
+
lg: "h-120",
|
|
17
|
+
xl: "h-180",
|
|
18
|
+
};
|
|
19
|
+
export function Modal({ children, options }) {
|
|
20
|
+
const { buttons, width, height } = options ?? {};
|
|
21
|
+
const { clearModal } = useWidgetStore();
|
|
22
|
+
const sizes = `${heightSize[height ?? "sm"]} ${widthSize[width ?? "md"]}`;
|
|
23
|
+
const styles = "rounded-xl bg-white relative";
|
|
24
|
+
return (_jsx("div", { className: background, children: _jsxs("div", { className: cn(sizes, styles), children: [children, _jsx(_Fragment, { children: buttons ? (_jsx("div", { className: `${absolute.br(5, 7)} flex justify-end gap-4`, children: buttons.map(([text, onClick]) => (_jsx("button", { className: "rounded-2xl bg-black px-8 py-2 text-lg font-bold text-white", onClick: onClick, children: text }, text))) })) : null }), _jsx("button", { className: absolute.tl(5, 7) +
|
|
25
|
+
"bg-black rounded-full h-9 w-9 flex justify-center items-center", onClick: clearModal, children: _jsx("div", { className: "x-shape" }) })] }) }));
|
|
21
26
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Modal } from "./Modal";
|
|
3
|
+
export default function TestModal({ children }) {
|
|
4
|
+
return (_jsx(Modal, { options: { width: "lg", height: "xl", buttons: [["gd", () => { }]] }, children: _jsx("div", { className: "pt-18 pl-25", children: children }) }));
|
|
5
|
+
}
|
package/modal/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { default as TestModal } from "./TestModal";
|
|
2
|
+
export { default as AlertModal } from "./AlertModal";
|
package/modal/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { default as TestModal } from "./TestModal";
|
|
2
|
+
export { default as AlertModal } from "./AlertModal";
|
package/navigation/Navigation.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { center, cn } from "../util";
|
|
3
3
|
export const buttonClassNames = (href, nowPath, color) => {
|
|
4
|
-
const [
|
|
4
|
+
const [bg, text] = color ?? ["white", "black"];
|
|
5
5
|
const classNames = [
|
|
6
6
|
center.row(6),
|
|
7
7
|
`text-${text}`,
|
package/package.json
CHANGED
package/store/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { WidgetEvent } from "../interface/Widget";
|
|
2
|
+
interface WidgetProps {
|
|
3
|
+
events: WidgetEvent[];
|
|
4
|
+
setView: (prop: string) => void;
|
|
5
|
+
setModal: (prop: string) => void;
|
|
6
|
+
removeModal: (prop: string) => void;
|
|
7
|
+
clearModal: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const useWidgetStore: import("zustand").UseBoundStore<import("zustand").StoreApi<WidgetProps>>;
|
|
10
|
+
export {};
|
package/store/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { create } from "zustand";
|
|
2
|
+
export const useWidgetStore = create((set) => ({
|
|
3
|
+
events: [],
|
|
4
|
+
setView: (prop) => set((state) => ({
|
|
5
|
+
events: [...state.events, { event: prop, type: "view" }],
|
|
6
|
+
})),
|
|
7
|
+
setModal: (prop) => set((state) => ({
|
|
8
|
+
events: [...state.events, { event: prop, type: "modal" }],
|
|
9
|
+
})),
|
|
10
|
+
removeModal: (prop) => {
|
|
11
|
+
set((state) => ({
|
|
12
|
+
events: state.events.filter(({ event }) => event !== prop),
|
|
13
|
+
}));
|
|
14
|
+
},
|
|
15
|
+
clearModal: () => set((state) => ({
|
|
16
|
+
events: state.events.filter(({ type }) => type !== "modal"),
|
|
17
|
+
})),
|
|
18
|
+
}));
|
package/tailwind.config.ts
CHANGED
|
@@ -275,8 +275,9 @@ export default {
|
|
|
275
275
|
xs: "480px",
|
|
276
276
|
sm: "640px",
|
|
277
277
|
md: "768px", // IPad Mini
|
|
278
|
-
|
|
278
|
+
xm: "964px", // IPad Air, IPad Pro 11.
|
|
279
279
|
lg: "1024px", // IPad Mini Horizontal Viewport
|
|
280
|
+
ml: "1160px", // IPad Air, IPad Pro 11.
|
|
280
281
|
xl: "1280px",
|
|
281
282
|
"2xl": "1536px",
|
|
282
283
|
},
|
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
1.0.0
|