@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
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { LineBreaks } from "../../text";
|
|
3
3
|
import { Card } from "../widget/Card";
|
|
4
4
|
export default function TrumpCard({ titles, options }) {
|
|
5
|
-
const { title,
|
|
5
|
+
const { title, subtitle, color: titleColor } = titles;
|
|
6
6
|
const { onClick, width, image, subButton } = options ?? {};
|
|
7
7
|
const [buttonText, buttonBgColor, buttonAction] = subButton ?? [
|
|
8
8
|
null,
|
|
@@ -15,5 +15,5 @@ export default function TrumpCard({ titles, options }) {
|
|
|
15
15
|
return "w-full h-full object-cover";
|
|
16
16
|
return "absolute bottom-0 right-0 w-full xs:w-auto max-w-120 z-0 max-h-44 object-contain";
|
|
17
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:
|
|
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
19
|
}
|
package/card/widget/Card.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CardProps } from "../../interface/Card";
|
|
2
|
-
export declare function Card({ children, options, debug }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function Card({ header, children, options, debug }: CardProps): import("react/jsx-runtime").JSX.Element;
|
package/card/widget/Card.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "../../util";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn, isDebug } from "../../util";
|
|
3
|
+
import { useWidgetStore } from "../../store";
|
|
3
4
|
const widthSize = {
|
|
4
5
|
xs: "w-full md:w-60",
|
|
5
6
|
sm: "w-full md:w-90",
|
|
@@ -11,18 +12,19 @@ const widthSize = {
|
|
|
11
12
|
auto: "w-auto",
|
|
12
13
|
};
|
|
13
14
|
const heightSize = {
|
|
14
|
-
xs: "
|
|
15
|
-
sm: "h-
|
|
16
|
-
md: "h-
|
|
17
|
-
lg: "h-
|
|
15
|
+
xs: "h-12",
|
|
16
|
+
sm: "h-45",
|
|
17
|
+
md: "h-52.5",
|
|
18
|
+
lg: "h-67.5",
|
|
18
19
|
xl: "h-125",
|
|
19
20
|
"2xl": "",
|
|
20
21
|
full: "h-full",
|
|
21
22
|
auto: "h-auto min-h-80",
|
|
22
23
|
};
|
|
23
|
-
export function Card({ children, options, debug }) {
|
|
24
|
+
export function Card({ header, children, options, debug }) {
|
|
25
|
+
const { setIsOwn } = useWidgetStore();
|
|
24
26
|
const { classNames, boundary, rounded, height, width, text, background, onClick, overflow, } = options ?? {};
|
|
25
|
-
const { size: textSize
|
|
27
|
+
const { size: textSize } = text ?? {};
|
|
26
28
|
const { color: bgColor } = background ?? {};
|
|
27
29
|
const setBoundary = () => {
|
|
28
30
|
if (boundary === "shadow")
|
|
@@ -37,12 +39,37 @@ export function Card({ children, options, debug }) {
|
|
|
37
39
|
positions: "relative",
|
|
38
40
|
sizes: `${widthSize[width ?? "sm"]} ${heightSize[height ?? "sm"]}`,
|
|
39
41
|
onClick: onClick ? "cursor-pointer" : "",
|
|
40
|
-
text: `text-${textSize ?? "base"}`,
|
|
42
|
+
text: `text-${textSize ?? "base"} text-black dark:text-white`,
|
|
41
43
|
boundary: setBoundary(),
|
|
42
44
|
rounded: `rounded-${rounded ?? "xl"}`,
|
|
43
|
-
bgColor: `bg-${bgColor ?? "white/80"}`,
|
|
44
|
-
styles: "duration-500
|
|
45
|
-
debug: debug &&
|
|
45
|
+
bgColor: `bg-${bgColor ?? "white/80"} dark:bg-black/80`,
|
|
46
|
+
styles: "duration-500 ",
|
|
47
|
+
debug: debug && isDebug(`border-2 border-${debug}`),
|
|
48
|
+
overflow: "overflow-hidden",
|
|
46
49
|
};
|
|
47
|
-
|
|
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
|
+
const body = {
|
|
66
|
+
sizes: "h-full",
|
|
67
|
+
overflow: `overflow-${overflow ?? "hidden"}`,
|
|
68
|
+
classNames,
|
|
69
|
+
};
|
|
70
|
+
return (_jsxs("div", { className: cn(container), children: [header && (_jsxs("div", { className: cn(headerStyle.container), children: [_jsx("div", { className: cn(headerStyle.body), children: header }), _jsx("div", { className: cn(headerStyle.block) })] })), _jsx("div", { onClick: onClick &&
|
|
71
|
+
(() => {
|
|
72
|
+
setIsOwn(true);
|
|
73
|
+
return onClick();
|
|
74
|
+
}), className: cn(body), children: children })] }));
|
|
48
75
|
}
|
package/deck/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { default as Deck } from "./template/Deck";
|
package/deck/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { default as Deck } from "./template/Deck";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DeckProps } from "../../interface/Deck";
|
|
2
|
+
declare function Deck<T extends string | number>(props: DeckProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare namespace Deck {
|
|
4
|
+
var Sub: <T extends string | number>({ titles, children, options, debug, }: DeckProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
}
|
|
6
|
+
export default Deck;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn, isDebug } from "../../util";
|
|
3
|
+
import { Deck } from "./../widget/Deck";
|
|
4
|
+
export default function DeckDesign({ children, titles, options, debug, }) {
|
|
5
|
+
const { title, subtitle, isSub } = titles ?? {};
|
|
6
|
+
const { height } = options ?? {};
|
|
7
|
+
const container = {
|
|
8
|
+
displays: "flex flex-col gap-4",
|
|
9
|
+
sizes: `w-full h-${height ?? "auto"} `,
|
|
10
|
+
debug: debug && isDebug(`border-2 border-${debug}`),
|
|
11
|
+
};
|
|
12
|
+
const titleBox = {
|
|
13
|
+
container: "flex flex-col gap-1",
|
|
14
|
+
title: {
|
|
15
|
+
text: isSub ? "text-base xl:text-lg" : "text-xl xl:text-2xl",
|
|
16
|
+
font: "font-bold",
|
|
17
|
+
},
|
|
18
|
+
subtitle: isSub ? "text-xs xl:text-sm" : "text-sm xl:text-base",
|
|
19
|
+
};
|
|
20
|
+
return (_jsxs("div", { className: cn(container), children: [titles && (_jsxs("div", { children: [_jsx("div", { className: cn(titleBox.title), children: title }), _jsx("div", { className: cn(titleBox.subtitle), children: subtitle })] })), _jsx(Deck, { children: children })] }));
|
|
21
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import DeckDesign from "./Deck.design";
|
|
3
|
+
function Deck(props) {
|
|
4
|
+
return _jsx(DeckDesign, { ...props });
|
|
5
|
+
}
|
|
6
|
+
function Sub({ titles, children, options, debug, }) {
|
|
7
|
+
const { title, subtitle } = titles ?? { title: "" };
|
|
8
|
+
return (_jsx(DeckDesign, { titles: { title, subtitle, isSub: true }, debug: debug, ...options, children: children }));
|
|
9
|
+
}
|
|
10
|
+
Deck.Sub = Sub;
|
|
11
|
+
export default Deck;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../util";
|
|
3
|
+
export function Deck({ children, options, }) {
|
|
4
|
+
const { flex, justify, gapX, gapY, overflowScroll } = options ?? {};
|
|
5
|
+
const body = {
|
|
6
|
+
displays: `flex flex-col flex-wrap gap-y-${gapY ?? 5}`,
|
|
7
|
+
flex: flex === "col" ? "sm:flex-col" : "sm:flex-row",
|
|
8
|
+
justify: `justify-${justify ?? "start"}`,
|
|
9
|
+
gapX: `${`gap-x-${gapX ?? 7.5}`}`,
|
|
10
|
+
sizes: "sm:w-full ",
|
|
11
|
+
styles: `${overflowScroll ? "overflow-x-scroll" : ""} duration-500`,
|
|
12
|
+
};
|
|
13
|
+
return _jsx("div", { className: cn(body), children: children });
|
|
14
|
+
}
|
package/globals.css
CHANGED
|
@@ -19,11 +19,28 @@
|
|
|
19
19
|
|
|
20
20
|
@font-face {
|
|
21
21
|
font-family: "Megrim";
|
|
22
|
-
src: url("./asset/fonts/Megrim.ttf") format("
|
|
22
|
+
src: url("./asset/fonts/Megrim.ttf") format("truetype");
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@font-face {
|
|
26
|
+
font-family: "Times-Newer-Roman-Bold";
|
|
27
|
+
src: url("./asset/fonts/TimesNewerRoman-Bold.otf") format("opentype");
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@font-face {
|
|
31
|
+
font-family: "Times-Newer-Roman-BoldItalic";
|
|
32
|
+
src: url("./asset/fonts/TimesNewerRoman-BoldItalic.otf") format("opentype");
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
input[type="date"]::-webkit-inner-spin-button,
|
|
36
|
+
input[type="date"]::-webkit-calendar-picker-indicator {
|
|
37
|
+
display: none;
|
|
38
|
+
-webkit-appearance: none;
|
|
23
39
|
}
|
|
24
40
|
|
|
25
41
|
::-webkit-scrollbar {
|
|
26
42
|
width: 3px;
|
|
43
|
+
padding-right: 10px;
|
|
27
44
|
}
|
|
28
45
|
|
|
29
46
|
::-webkit-scrollbar-track {
|
|
@@ -39,6 +56,10 @@
|
|
|
39
56
|
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.15);
|
|
40
57
|
}
|
|
41
58
|
|
|
59
|
+
.box-shadow-sm {
|
|
60
|
+
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.2);
|
|
61
|
+
}
|
|
62
|
+
|
|
42
63
|
.x-shape {
|
|
43
64
|
position: relative;
|
|
44
65
|
width: 0.83625rem;
|
|
@@ -65,3 +86,100 @@
|
|
|
65
86
|
.x-shape::after {
|
|
66
87
|
transform: translate(-50%, -50%) rotate(-45deg);
|
|
67
88
|
}
|
|
89
|
+
|
|
90
|
+
.border-inner {
|
|
91
|
+
box-shadow: 0 0 0 1px #e5e7eb inset, 0 4px 6px -1px rgba(0, 0, 0, 0.1),
|
|
92
|
+
0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
93
|
+
}
|
|
94
|
+
.asdfasdf:hover {
|
|
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
|
+
/* Date Picker Css */
|
|
99
|
+
.react-datepicker__day--selected {
|
|
100
|
+
background-color: #105652 !important;
|
|
101
|
+
}
|
|
102
|
+
.react-datepicker__header {
|
|
103
|
+
background: white !important;
|
|
104
|
+
border: none !important;
|
|
105
|
+
}
|
|
106
|
+
.react-datepicker {
|
|
107
|
+
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.15) !important;
|
|
108
|
+
border-radius: 0.375rem !important;
|
|
109
|
+
border: none !important;
|
|
110
|
+
}
|
|
111
|
+
.react-datepicker__day--keyboard-selected {
|
|
112
|
+
background-color: white !important;
|
|
113
|
+
color: black !important;
|
|
114
|
+
}
|
|
115
|
+
.react-datepicker__day--outside-month {
|
|
116
|
+
color: rgb(161 161 170) !important;
|
|
117
|
+
}
|
|
118
|
+
.react-datepicker__month-container {
|
|
119
|
+
padding-top: 1rem;
|
|
120
|
+
padding-left: 1rem;
|
|
121
|
+
padding-right: 1rem;
|
|
122
|
+
padding-bottom: 0.5rem;
|
|
123
|
+
}
|
|
124
|
+
.react-datepicker-popper {
|
|
125
|
+
transform: translate(0px 295px) !important;
|
|
126
|
+
}
|
|
127
|
+
.react-datepicker__input-container {
|
|
128
|
+
text-align: center !important;
|
|
129
|
+
border-radius: 0.375rem !important;
|
|
130
|
+
transition: all 0.3s;
|
|
131
|
+
}
|
|
132
|
+
.react-datepicker__input-container > input {
|
|
133
|
+
cursor: pointer !important;
|
|
134
|
+
}
|
|
135
|
+
.react-datepicker__input-container:hover {
|
|
136
|
+
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.15) !important;
|
|
137
|
+
}
|
|
138
|
+
.react-datepicker__navigation {
|
|
139
|
+
top: 18px !important;
|
|
140
|
+
}
|
|
141
|
+
.react-datepicker__navigation--next {
|
|
142
|
+
right: 20px !important;
|
|
143
|
+
}
|
|
144
|
+
.react-datepicker__navigation--previous {
|
|
145
|
+
left: 182px !important;
|
|
146
|
+
}
|
|
147
|
+
.react-datepicker__current-month {
|
|
148
|
+
text-align: left !important;
|
|
149
|
+
margin-left: 16px !important;
|
|
150
|
+
}
|
|
151
|
+
.react-datepicker__triangle {
|
|
152
|
+
display: none !important;
|
|
153
|
+
}
|
|
154
|
+
.react-datepicker__children-container {
|
|
155
|
+
width: 16rem !important;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* toggle button */
|
|
159
|
+
[type="checkbox"]::before {
|
|
160
|
+
content: "";
|
|
161
|
+
position: absolute;
|
|
162
|
+
left: 1px;
|
|
163
|
+
top: 1px;
|
|
164
|
+
width: 1.1rem;
|
|
165
|
+
height: 1.1rem;
|
|
166
|
+
border-radius: 50%;
|
|
167
|
+
transform: scale(0.9);
|
|
168
|
+
background-color: white;
|
|
169
|
+
transition: left 100ms linear;
|
|
170
|
+
}
|
|
171
|
+
[type="checkbox"]:checked::before {
|
|
172
|
+
background-color: white;
|
|
173
|
+
left: 1.32rem;
|
|
174
|
+
}
|
|
175
|
+
[type="checkbox"]:checked {
|
|
176
|
+
background-color: #105652;
|
|
177
|
+
}
|
|
178
|
+
[type="checkbox"]:disabled {
|
|
179
|
+
opacity: 0.3;
|
|
180
|
+
cursor: not-allowed;
|
|
181
|
+
}
|
|
182
|
+
[type="checkbox"]:disabled + span {
|
|
183
|
+
opacity: 0.3;
|
|
184
|
+
cursor: not-allowed;
|
|
185
|
+
}
|
package/html/index.d.ts
ADDED
package/html/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import ReactDatePicker from "react-datepicker";
|
|
4
|
+
import "react-datepicker/dist/react-datepicker.css";
|
|
5
|
+
import ko from "date-fns/locale/ko";
|
|
6
|
+
import { useRef } from "react";
|
|
7
|
+
const widthSize = {
|
|
8
|
+
xs: "w-28",
|
|
9
|
+
sm: "w-48",
|
|
10
|
+
md: "w-64",
|
|
11
|
+
lg: "w-96",
|
|
12
|
+
xl: "w-128",
|
|
13
|
+
"2xl": "w-144",
|
|
14
|
+
full: "w-full",
|
|
15
|
+
};
|
|
16
|
+
export default function DatePicker({ options }) {
|
|
17
|
+
const { width } = options ?? {};
|
|
18
|
+
const [selectedDate, setSelectedDate] = useState(new Date());
|
|
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-4 pr-4 text-left rounded-md hover:bg-white focus:bg-white transition-all asdfasdf focus:outline-none w-68 h-10", 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
|
+
calRef.current.setOpen(false);
|
|
22
|
+
}, children: "\uC800\uC7A5\uD558\uAE30" }) }) }) }));
|
|
23
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
import { cn } from "../../util";
|
|
4
|
+
const widthSize = {
|
|
5
|
+
xs: "w-28",
|
|
6
|
+
sm: "w-48",
|
|
7
|
+
md: "w-64",
|
|
8
|
+
lg: "w-96",
|
|
9
|
+
xl: "w-128",
|
|
10
|
+
"2xl": "w-144",
|
|
11
|
+
full: "w-full",
|
|
12
|
+
};
|
|
13
|
+
export default function Input({ state, placeholder, options, }) {
|
|
14
|
+
const [_, onChange] = state;
|
|
15
|
+
const { width } = options ?? {};
|
|
16
|
+
const id = useId();
|
|
17
|
+
const container = {
|
|
18
|
+
width: `${widthSize[width ?? "md"]} h-10`,
|
|
19
|
+
styles: "rounded-full pl-4 border-4",
|
|
20
|
+
};
|
|
21
|
+
return (_jsx("input", { className: cn(container), id: id, type: "text", placeholder: placeholder ?? "", onChange: (e) => onChange(e.target.value) }));
|
|
22
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { BiChevronDown } from "react-icons/bi";
|
|
4
|
+
import { useWidgetStore } from "../../store";
|
|
5
|
+
import { cn } from "../../util";
|
|
6
|
+
const widthSize = {
|
|
7
|
+
xs: "w-32",
|
|
8
|
+
sm: "w-48",
|
|
9
|
+
md: "w-64",
|
|
10
|
+
lg: "w-96",
|
|
11
|
+
xl: "w-128",
|
|
12
|
+
"2xl": "w-144",
|
|
13
|
+
full: "w-full",
|
|
14
|
+
};
|
|
15
|
+
export default function Select({ state, selectOptions, options, }) {
|
|
16
|
+
const [value, setValue] = state;
|
|
17
|
+
// isActive 드롭다운 이벤트 통제
|
|
18
|
+
const { flag } = useWidgetStore();
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (!isButton)
|
|
21
|
+
setIsActive(false);
|
|
22
|
+
return setIsButton(false);
|
|
23
|
+
}, [flag]);
|
|
24
|
+
const [isActive, setIsActive] = useState(false);
|
|
25
|
+
const [isButton, setIsButton] = useState(false);
|
|
26
|
+
const [selectedItem, setSelectedItem] = useState(null);
|
|
27
|
+
const handleItemClick = (title) => {
|
|
28
|
+
setSelectedItem(title);
|
|
29
|
+
setIsActive(false);
|
|
30
|
+
};
|
|
31
|
+
// css
|
|
32
|
+
const levels = [
|
|
33
|
+
"CoCoon",
|
|
34
|
+
"PreStarter",
|
|
35
|
+
"Starter",
|
|
36
|
+
"Basic",
|
|
37
|
+
"Junior",
|
|
38
|
+
"HighJunior",
|
|
39
|
+
];
|
|
40
|
+
const colorMap = {
|
|
41
|
+
CoCoon: "bg-cocoon-green",
|
|
42
|
+
PreStarter: "bg-ps-pink",
|
|
43
|
+
Starter: "bg-st-orange",
|
|
44
|
+
Basic: "bg-ba-yellow",
|
|
45
|
+
Junior: "bg-jr-blue",
|
|
46
|
+
HighJunior: "bg-hj-blue",
|
|
47
|
+
};
|
|
48
|
+
const isActiveCss = () => {
|
|
49
|
+
if (isActive)
|
|
50
|
+
return `shadow-md border-inner rounded-md`;
|
|
51
|
+
};
|
|
52
|
+
const tagCss = `bg-slate-200 p-1 pl-2 pr-2 rounded-md`;
|
|
53
|
+
const dropdownTop = selectOptions && selectOptions.length > 6 ? "top-24" : "top-12";
|
|
54
|
+
const { width } = options ?? {};
|
|
55
|
+
const dropdown = {
|
|
56
|
+
size: `w-40 h-6`,
|
|
57
|
+
styles: "cursor-pointer pt-4 pb-4 pl-4 pr-4 font-bold text-sm bg-white",
|
|
58
|
+
display: `flex items-center`,
|
|
59
|
+
hover: `hover:rounded-md`,
|
|
60
|
+
effect: `transition-all`,
|
|
61
|
+
function: `${isActiveCss()}`,
|
|
62
|
+
etc: "asdfasdf",
|
|
63
|
+
};
|
|
64
|
+
const dropdownInput = {
|
|
65
|
+
size: `w-40 h-6 `,
|
|
66
|
+
styles: "shadow-md text-sm p-4 font-bold bg-white text-left cursor-text border-1 rounded-md ",
|
|
67
|
+
display: "absolute top-12 flex items-center z-10 ",
|
|
68
|
+
focus: "focus:outline-none focus:border-[#44C5F3] focus:border-1 ",
|
|
69
|
+
};
|
|
70
|
+
const dropdownContent = {
|
|
71
|
+
size: `w-40 min-h-6 max-h-48 overflow-y-auto `,
|
|
72
|
+
styles: `text-sm mt-1 border-1 rounded-md shadow-md`,
|
|
73
|
+
display: `absolute z-40`,
|
|
74
|
+
function: `${dropdownTop}`,
|
|
75
|
+
};
|
|
76
|
+
const dropdownItem = {
|
|
77
|
+
size: `${widthSize[width ?? "full"]} h-6 `,
|
|
78
|
+
styles: `text-sm text-left p-4 font-bold cursor-pointer `,
|
|
79
|
+
display: `flex items-center z-40`,
|
|
80
|
+
hover: `hover:bg-slate-200 `,
|
|
81
|
+
effect: `transition-all `,
|
|
82
|
+
};
|
|
83
|
+
// input
|
|
84
|
+
const [searchTerm, setSearchTerm] = useState("");
|
|
85
|
+
const filteredOptions = selectOptions?.filter(([_, title]) => title.toLowerCase().includes(searchTerm.toLowerCase())) || [];
|
|
86
|
+
// Keyboard event handling
|
|
87
|
+
const [selectedIndex, setSelectedIndex] = useState(-1);
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
const handleKeyDown = (event) => {
|
|
90
|
+
if (!isActive)
|
|
91
|
+
return;
|
|
92
|
+
// Arrow Up
|
|
93
|
+
if (event.key === "ArrowUp") {
|
|
94
|
+
event.preventDefault();
|
|
95
|
+
const currentIndex = filteredOptions.findIndex(([_, title]) => title === selectedItem);
|
|
96
|
+
const newIndex = currentIndex === -1
|
|
97
|
+
? 0
|
|
98
|
+
: (currentIndex - 1 + filteredOptions.length) %
|
|
99
|
+
filteredOptions.length;
|
|
100
|
+
setSelectedItem(filteredOptions[newIndex][1]);
|
|
101
|
+
setSelectedIndex(newIndex);
|
|
102
|
+
}
|
|
103
|
+
// Arrow Down
|
|
104
|
+
if (event.key === "ArrowDown") {
|
|
105
|
+
event.preventDefault();
|
|
106
|
+
const currentIndex = filteredOptions.findIndex(([_, title]) => title === selectedItem);
|
|
107
|
+
const newIndex = currentIndex === -1 ? 0 : (currentIndex + 1) % filteredOptions.length;
|
|
108
|
+
setSelectedItem(filteredOptions[newIndex][1]);
|
|
109
|
+
setSelectedIndex(newIndex);
|
|
110
|
+
}
|
|
111
|
+
// Enter
|
|
112
|
+
if (event.key === "Enter") {
|
|
113
|
+
if (selectedItem) {
|
|
114
|
+
setIsActive(false);
|
|
115
|
+
setValue(selectedItem);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
// Esc
|
|
119
|
+
if (event.key === "Escape") {
|
|
120
|
+
setIsActive(false);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
124
|
+
// 선택된 항목 스크롤을 조정하는 함수
|
|
125
|
+
const scrollIntoView = () => {
|
|
126
|
+
if (selectedIndex === -1)
|
|
127
|
+
return;
|
|
128
|
+
const dropdownContent = document.querySelector(".dropdown-content");
|
|
129
|
+
if (!dropdownContent)
|
|
130
|
+
return;
|
|
131
|
+
const selectedItemElement = dropdownContent.children[selectedIndex];
|
|
132
|
+
if (!selectedItemElement)
|
|
133
|
+
return;
|
|
134
|
+
const dropdownRect = dropdownContent.getBoundingClientRect();
|
|
135
|
+
const selectedItemRect = selectedItemElement.getBoundingClientRect();
|
|
136
|
+
if (selectedItemRect.top < dropdownRect.top) {
|
|
137
|
+
dropdownContent.scrollTop -= dropdownRect.top - selectedItemRect.top;
|
|
138
|
+
}
|
|
139
|
+
else if (selectedItemRect.bottom > dropdownRect.bottom) {
|
|
140
|
+
dropdownContent.scrollTop +=
|
|
141
|
+
selectedItemRect.bottom - dropdownRect.bottom;
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
scrollIntoView();
|
|
145
|
+
window.addEventListener("resize", scrollIntoView);
|
|
146
|
+
return () => {
|
|
147
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
148
|
+
window.removeEventListener("resize", scrollIntoView);
|
|
149
|
+
};
|
|
150
|
+
}, [isActive, selectedIndex, filteredOptions, selectedItem, setValue]);
|
|
151
|
+
return (_jsxs("div", { className: "relative", children: [_jsxs("div", { className: cn(dropdown), onClick: () => {
|
|
152
|
+
setIsActive(!isActive);
|
|
153
|
+
setIsButton(true);
|
|
154
|
+
}, children: [_jsx("div", { className: `w-4 h-4 mr-2 ${selectedItem && colorMap[selectedItem]
|
|
155
|
+
? colorMap[selectedItem]
|
|
156
|
+
: "hidden"}` }), _jsx("div", { className: `${!selectedItem || levels.includes(selectedItem) ? "" : tagCss}`, children: selectedItem || (_jsx("span", { className: "text-zinc-400", children: "\uC635\uC158\uC744 \uC120\uD0DD\uD558\uC138\uC694" })) }), isActive && _jsx(BiChevronDown, { className: "ml-auto" })] }), isActive && selectOptions && selectOptions.length > 6 && (_jsx("input", { type: "text", placeholder: "\uAC80\uC0C9\uC5B4\uB97C \uC785\uB825\uD558\uC138\uC694", className: cn(dropdownInput), value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), onClick: (e) => e.stopPropagation() })), isActive && filteredOptions && (_jsx("div", { className: "dropdown-content " + cn(dropdownContent), children: filteredOptions.map(([id, title], index) => (_jsxs("div", { className: cn(dropdownItem) +
|
|
157
|
+
(selectedIndex === index ? "bg-slate-200" : "bg-white"), onClick: () => handleItemClick(title), children: [_jsx("div", { className: `w-4 h-4 mr-2 ${colorMap[title] && levels.includes(title)
|
|
158
|
+
? colorMap[title]
|
|
159
|
+
: "hidden"}` }), _jsx("div", { className: `${levels.includes(title) ? "" : tagCss}`, children: title })] }, id))) }))] }));
|
|
160
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const widthSize = {
|
|
3
|
+
xs: "w-32",
|
|
4
|
+
sm: "w-48",
|
|
5
|
+
md: "w-64",
|
|
6
|
+
lg: "w-96",
|
|
7
|
+
xl: "w-128",
|
|
8
|
+
"2xl": "w-144",
|
|
9
|
+
full: "w-full",
|
|
10
|
+
};
|
|
11
|
+
export default function Toggle({ state: [chekced, setChecked], isDisabled, labels, }) {
|
|
12
|
+
return (_jsxs("div", { className: "w-24 h-6 flex", children: [_jsx("label", { htmlFor: "", className: "inline-flex items-center gap-2 ", children: _jsx("input", { disabled: isDisabled, type: "checkbox", className: "bg-red-crimson appearance-none relative rounded-full w-10 h-5 cursor-pointer", checked: chekced, onChange: (e) => setChecked(e.target.checked) }) }), _jsx("div", { className: "ml-2 transition-all", children: labels.map(([status, label]) => (status === chekced ? label : "")) })] }));
|
|
13
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ export * from "./board";
|
|
|
3
3
|
export * from "./card";
|
|
4
4
|
export * from "./deck";
|
|
5
5
|
export * from "./layout";
|
|
6
|
+
export * from "./html";
|
|
6
7
|
export * from "./interaction";
|
|
7
|
-
export * from "./menu";
|
|
8
8
|
export * from "./modal";
|
|
9
9
|
export * from "./navigation";
|
|
10
|
-
export * from "./
|
|
10
|
+
export * from "./overlay";
|
|
11
11
|
export * from "./text";
|
package/index.js
CHANGED
|
@@ -3,9 +3,9 @@ export * from "./board";
|
|
|
3
3
|
export * from "./card";
|
|
4
4
|
export * from "./deck";
|
|
5
5
|
export * from "./layout";
|
|
6
|
+
export * from "./html";
|
|
6
7
|
export * from "./interaction";
|
|
7
|
-
export * from "./menu";
|
|
8
8
|
export * from "./modal";
|
|
9
9
|
export * from "./navigation";
|
|
10
|
-
export * from "./
|
|
10
|
+
export * from "./overlay";
|
|
11
11
|
export * from "./text";
|