@edu-tosel/design 1.0.13 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/asset/fonts/TimesNewerRoman-Bold.otf +0 -0
- package/asset/fonts/TimesNewerRoman-BoldItalic.otf +0 -0
- package/board/template/CanvasBoard.d.ts +1 -1
- package/board/template/CanvasBoard.js +3 -3
- package/board/template/ManageBoard.d.ts +3 -3
- package/board/template/ManageBoard.js +17 -21
- package/board/template/PaperBoard.d.ts +1 -1
- package/board/template/PaperBoard.js +4 -4
- package/board/widget/Board.js +12 -18
- package/board/widget/DataField.d.ts +4 -3
- package/board/widget/DataField.js +19 -13
- package/board/widget/Header.d.ts +1 -1
- package/board/widget/Header.js +11 -9
- package/board/widget/Tags.d.ts +14 -3
- package/card/index.d.ts +1 -0
- package/card/index.js +1 -0
- package/card/template/AddCard.d.ts +2 -0
- package/card/template/AddCard.js +11 -0
- package/card/template/ChartCard.js +1 -1
- package/card/template/InfoCard.d.ts +32 -2
- package/card/template/InfoCard.design.d.ts +2 -0
- package/card/template/InfoCard.design.js +23 -0
- package/card/template/InfoCard.js +72 -8
- package/card/template/ReportCard.d.ts +1 -1
- package/card/template/ReportCard.js +3 -11
- package/card/template/RowCard.d.ts +2 -5
- package/card/template/RowCard.js +16 -18
- package/card/template/TableCard.d.ts +4 -2
- package/card/template/TableCard.js +22 -9
- package/card/template/TrumpCard.js +2 -2
- package/card/widget/Card.d.ts +1 -1
- package/card/widget/Card.js +40 -13
- package/deck/index.d.ts +1 -1
- package/deck/index.js +1 -1
- package/deck/template/Deck.d.ts +6 -0
- package/deck/template/Deck.design.d.ts +2 -0
- package/deck/template/Deck.design.js +21 -0
- package/deck/template/Deck.js +11 -0
- package/deck/widget/Deck.d.ts +2 -0
- package/deck/widget/Deck.js +14 -0
- package/globals.css +119 -1
- package/html/index.d.ts +4 -0
- package/html/index.js +4 -0
- package/html/widget/Button.d.ts +2 -0
- package/html/widget/Button.js +15 -0
- package/html/widget/DatePicker.d.ts +3 -0
- package/html/widget/DatePicker.js +23 -0
- package/html/widget/Input.d.ts +2 -0
- package/html/widget/Input.js +22 -0
- package/html/widget/Select.d.ts +2 -0
- package/html/widget/Select.js +160 -0
- package/html/widget/Toggle.d.ts +2 -0
- package/html/widget/Toggle.js +13 -0
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/interface/Board.d.ts +16 -19
- package/interface/Card.d.ts +47 -37
- package/{deck → interface}/Deck.d.ts +4 -7
- package/interface/HTMLElement.d.ts +22 -14
- package/interface/HTMLElement.js +7 -1
- package/interface/Modal.d.ts +6 -1
- package/interface/Overlay.d.ts +20 -0
- package/interface/Overlay.js +1 -0
- package/interface/Property.d.ts +12 -1
- package/interface/Shelf.d.ts +22 -0
- package/interface/Shelf.js +1 -0
- package/interface/Widget.d.ts +19 -0
- package/interface/index.d.ts +3 -0
- package/interface/index.js +3 -0
- package/layout/index.d.ts +4 -1
- package/layout/index.js +4 -1
- package/layout/template/Gallery.d.ts +7 -0
- package/layout/template/Gallery.js +6 -0
- package/layout/template/Shelf.d.ts +8 -0
- package/layout/template/Shelf.js +41 -0
- package/layout/{dashboard → template/dashboard}/Header.d.ts +0 -1
- package/layout/template/dashboard/Header.js +17 -0
- package/layout/{dashboard → template/dashboard}/index.d.ts +5 -1
- package/layout/template/dashboard/index.js +33 -0
- package/layout/template/report/Header.js +11 -0
- package/layout/widget/Events.d.ts +8 -0
- package/layout/widget/Events.js +44 -0
- package/layout/widget/Shelf.d.ts +2 -0
- package/layout/widget/Shelf.js +25 -0
- package/{board → layout}/widget/Tab.js +6 -8
- package/modal/index.d.ts +1 -3
- package/modal/index.js +1 -3
- package/modal/template/Alert.d.ts +2 -0
- package/modal/template/Alert.js +8 -0
- package/modal/template/Input.d.ts +6 -0
- package/modal/template/Input.js +6 -0
- package/modal/template/index.d.ts +7 -0
- package/modal/template/index.js +7 -0
- package/modal/widget/Modal.design.d.ts +2 -0
- package/modal/widget/Modal.design.js +64 -0
- package/navigation/Navigation.d.ts +1 -1
- package/navigation/Navigation.js +21 -17
- package/overlay/index.d.ts +1 -0
- package/overlay/index.js +1 -0
- package/overlay/template/Info.d.ts +2 -0
- package/overlay/template/Info.js +5 -0
- package/overlay/template/Manage.d.ts +2 -0
- package/overlay/template/Manage.js +17 -0
- package/overlay/template/index.d.ts +7 -0
- package/overlay/template/index.js +7 -0
- package/overlay/widget/Overlay.design.d.ts +2 -0
- package/overlay/widget/Overlay.design.js +25 -0
- package/package.json +6 -2
- package/store/index.d.ts +10 -3
- package/store/index.js +38 -11
- package/tailwind.config.ts +56 -0
- package/text/Formatter.d.ts +3 -0
- package/text/Formatter.js +18 -0
- package/text/index.d.ts +1 -0
- package/text/index.js +1 -0
- package/util/checkPathMatch.d.ts +2 -0
- package/util/checkPathMatch.js +8 -0
- package/util/colors.d.ts +2 -1
- package/util/colors.js +2 -1
- package/util/convertUnixTimestampToDate.d.ts +1 -0
- package/util/convertUnixTimestampToDate.js +5 -0
- package/util/index.d.ts +3 -0
- package/util/index.js +3 -0
- package/util/isDebug.d.ts +1 -0
- package/util/isDebug.js +5 -0
- package/util/sortByOrder.d.ts +4 -0
- package/util/sortByOrder.js +20 -0
- package/version.txt +1 -1
- package/card/template/InfoCardCssCase.d.ts +0 -25
- package/card/template/InfoCardCssCase.js +0 -32
- package/card/template/PropfileCard.d.ts +0 -2
- package/card/template/PropfileCard.js +0 -6
- package/deck/Deck.js +0 -22
- package/interface/Menu.d.ts +0 -6
- package/layout/dashboard/Header.js +0 -19
- package/layout/dashboard/index.js +0 -10
- package/layout/report/Header.js +0 -11
- package/menu/index.d.ts +0 -1
- package/menu/index.js +0 -1
- package/menu/template/SideMenu.d.ts +0 -2
- package/menu/template/SideMenu.js +0 -20
- package/menu/widget/HTMLElement.d.ts +0 -8
- package/menu/widget/HTMLElement.js +0 -9
- package/modal/AlertModal.d.ts +0 -2
- package/modal/AlertModal.js +0 -8
- package/modal/ControllerModal.d.ts +0 -6
- package/modal/ControllerModal.js +0 -6
- package/modal/Modal.d.ts +0 -2
- package/modal/Modal.js +0 -31
- package/modal/TestModal.d.ts +0 -7
- package/modal/TestModal.js +0 -6
- package/shelf/Shelf.d.ts +0 -3
- package/shelf/Shelf.js +0 -4
- package/shelf/index.d.ts +0 -1
- package/shelf/index.js +0 -1
- /package/interface/{Menu.js → Deck.js} +0 -0
- /package/layout/{report → template/report}/Header.d.ts +0 -0
- /package/{board → layout}/widget/Tab.d.ts +0 -0
package/util/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export { default as cn } from "./classNames";
|
|
2
|
+
export { default as unixToDate } from "./convertUnixTimestampToDate";
|
|
3
|
+
export { default as isDebug } from "./isDebug";
|
|
4
|
+
export { default as sortByOrder } from "./sortByOrder";
|
|
2
5
|
export * from "./colors";
|
|
3
6
|
export * from "./display";
|
|
4
7
|
export * from "./displayResponsive";
|
package/util/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export { default as cn } from "./classNames";
|
|
2
|
+
export { default as unixToDate } from "./convertUnixTimestampToDate";
|
|
3
|
+
export { default as isDebug } from "./isDebug";
|
|
4
|
+
export { default as sortByOrder } from "./sortByOrder";
|
|
2
5
|
export * from "./colors";
|
|
3
6
|
export * from "./display";
|
|
4
7
|
export * from "./displayResponsive";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function isDebug(prop: any): any;
|
package/util/isDebug.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default function sortOrder(args, order) {
|
|
2
|
+
const allEmpty = order.every(({ orderHow }) => orderHow === "");
|
|
3
|
+
const sortedData = allEmpty
|
|
4
|
+
? [...args]
|
|
5
|
+
: [...args].sort((aValue, bValue) => {
|
|
6
|
+
for (let i = 0; i < order.length; i++) {
|
|
7
|
+
const { orderBy, orderHow } = order[i];
|
|
8
|
+
if (orderHow === "")
|
|
9
|
+
continue;
|
|
10
|
+
const a = aValue[orderBy];
|
|
11
|
+
const b = bValue[orderBy];
|
|
12
|
+
if (a > b)
|
|
13
|
+
return orderHow === "asc" ? 1 : -1;
|
|
14
|
+
if (a < b)
|
|
15
|
+
return orderHow === "asc" ? -1 : 1;
|
|
16
|
+
}
|
|
17
|
+
return 0;
|
|
18
|
+
});
|
|
19
|
+
return sortedData;
|
|
20
|
+
}
|
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.15
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Size } from "../../interface/Property";
|
|
2
|
-
export declare const sizeBySetting: {
|
|
3
|
-
widthSize: Record<string, Size>;
|
|
4
|
-
heightSize: Record<string, Size>;
|
|
5
|
-
};
|
|
6
|
-
export declare const bgColorBySetting: {
|
|
7
|
-
information: string;
|
|
8
|
-
profile: string;
|
|
9
|
-
profileSmall: string;
|
|
10
|
-
};
|
|
11
|
-
export declare const lineColorBySetting: {
|
|
12
|
-
information: string;
|
|
13
|
-
profile: string;
|
|
14
|
-
profileSmall: string;
|
|
15
|
-
};
|
|
16
|
-
export declare const fontColorBySetting: {
|
|
17
|
-
information: string;
|
|
18
|
-
profile: string;
|
|
19
|
-
profileSmall: string;
|
|
20
|
-
};
|
|
21
|
-
export declare const btnSizeBySetting: {
|
|
22
|
-
information: string;
|
|
23
|
-
profile: string;
|
|
24
|
-
profileSmall: string;
|
|
25
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export const sizeBySetting = {
|
|
2
|
-
widthSize: {
|
|
3
|
-
information: "md",
|
|
4
|
-
profile: "sm",
|
|
5
|
-
profileSmall: "xs",
|
|
6
|
-
},
|
|
7
|
-
heightSize: {
|
|
8
|
-
information: "lg",
|
|
9
|
-
profile: "md",
|
|
10
|
-
profileSmall: "lg",
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
export const bgColorBySetting = {
|
|
14
|
-
information: "gradient-to-r from-green-dark/20 to-red-crimson/20",
|
|
15
|
-
profile: "white",
|
|
16
|
-
profileSmall: "white",
|
|
17
|
-
};
|
|
18
|
-
export const lineColorBySetting = {
|
|
19
|
-
information: "#760023",
|
|
20
|
-
profile: "#173A8B",
|
|
21
|
-
profileSmall: "#173A8B",
|
|
22
|
-
};
|
|
23
|
-
export const fontColorBySetting = {
|
|
24
|
-
information: "red-crimson",
|
|
25
|
-
profile: "blue-navy",
|
|
26
|
-
profileSmall: "blue-navy",
|
|
27
|
-
};
|
|
28
|
-
export const btnSizeBySetting = {
|
|
29
|
-
information: "w-45 h-11",
|
|
30
|
-
profile: "w-22 h-7 text-xs",
|
|
31
|
-
profileSmall: "w-45 h-11",
|
|
32
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Card } from "../widget/Card";
|
|
3
|
-
import { gradient } from "../../util";
|
|
4
|
-
export default function ProfileCard({ titles, button }) {
|
|
5
|
-
return (_jsx(Card, { options: { width: "lg", height: "lg" }, children: _jsxs("div", { className: "relative w-full h-full p-5 bg-" + `${gradient.green_to_red}`, children: [_jsxs("div", { className: "h-18 w-full border-b-2 border-[#760023] flex justify-between", children: [_jsxs("div", { className: "w-auto", children: [_jsx("div", { className: "h-9 font-bold text-xl text-" + `${titles.color}`, children: titles.title }), _jsx("div", { className: "h-8 text-md font-thin ", children: titles.subTitle })] }), _jsx("div", { className: "w-auto flex flex-col-reverse text-red-crimson p-2", children: _jsx("span", { className: "text-xs font-thin border-b-1 border-[#760023] font-semibold inline-block align-bottom ", children: "\uC218\uC815\uD558\uAE30" }) })] }), _jsx("div", {}), _jsx("div", { className: `absolute bottom-4 right-4 ${button.display}`, children: _jsx("button", { className: `text-white rounded-md bg-${button.color} w-45 h-11 flex justify-center items-center`, children: button.title }) })] }) }));
|
|
6
|
-
}
|
package/deck/Deck.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "../util";
|
|
3
|
-
export function Deck({ children, titles, options, debug, }) {
|
|
4
|
-
const { title, subtitle, gapTitle } = titles ?? {};
|
|
5
|
-
const { flex, height, justify, gapX, gapY, overflowScroll } = options ?? {};
|
|
6
|
-
const container = {
|
|
7
|
-
displays: `flex flex-col gap-${gapTitle ?? 4}`,
|
|
8
|
-
sizes: `w-full h-${height ?? "auto"} `,
|
|
9
|
-
debug: debug &&
|
|
10
|
-
import.meta.env.MODE === "development" &&
|
|
11
|
-
`border-2 border-${debug}`,
|
|
12
|
-
};
|
|
13
|
-
const body = {
|
|
14
|
-
displays: `flex flex-col flex-wrap gap-y-${gapY ?? 5}`,
|
|
15
|
-
flex: flex === "col" ? "sm:flex-col" : "sm:flex-row",
|
|
16
|
-
justify: `justify-${justify ?? "start"}`,
|
|
17
|
-
gapX: `${`gap-x-${gapX ?? 7.5}`}`,
|
|
18
|
-
sizes: "sm:w-full ",
|
|
19
|
-
styles: `${overflowScroll ? "overflow-x-scroll" : ""} duration-500`,
|
|
20
|
-
};
|
|
21
|
-
return (_jsxs("div", { className: cn(container), children: [_jsxs("div", { children: [_jsx("div", { className: "text-xl xl:text-2xl font-bold", children: title }), _jsx("div", { className: "", children: subtitle })] }), _jsx("div", { className: cn(body), children: children })] }));
|
|
22
|
-
}
|
package/interface/Menu.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import "../../globals.css";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { cn } from "../../util";
|
|
5
|
-
export function Header({ title, image, }) {
|
|
6
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
7
|
-
const [src, href] = image ?? [];
|
|
8
|
-
return (_jsx("div", { className: "fixed top-0 left-0 xl:relative flex h-20 w-full items-center justify-between bg-white px-9 shadow-black/10 shadow-b-md z-40", children: _jsxs("div", { className: "flex h-12 items-center gap-12", children: [src && href ? (_jsx("a", { href: href, children: _jsx("img", { src: src, alt: "logo", className: "h-12 w-50" }) })) : (_jsx("div", { className: "text-2xl", children: "TOSEL" })), _jsx("div", { className: "text-3xl font-bold ", children: title })] }) }));
|
|
9
|
-
}
|
|
10
|
-
function Menu({ flag }) {
|
|
11
|
-
const positions = "absolute right-0 z-40 ";
|
|
12
|
-
const layouts = "w-48 overflow-hidden";
|
|
13
|
-
const styles = "shadow-md bg-white";
|
|
14
|
-
const animations = () => {
|
|
15
|
-
const height = flag ? "h-80" : "h-0";
|
|
16
|
-
return [height, "duration-500"].join(" ");
|
|
17
|
-
};
|
|
18
|
-
return (_jsxs("div", { className: cn(positions, layouts, styles, animations()), children: [_jsx("div", { children: "\u314E\u3147" }), _jsx("div", { children: "\u314E\u3147" })] }));
|
|
19
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Fragment } from "react";
|
|
3
|
-
import { NavigationContainer } from "../../navigation";
|
|
4
|
-
import { Header } from "./Header";
|
|
5
|
-
import { cn } from "../../util";
|
|
6
|
-
export function DashboardLayout({ subject, colors, navigations, children, }) {
|
|
7
|
-
const [title, image, imageUrl] = subject ?? ["", "", ""];
|
|
8
|
-
const [bgColor, textColor] = colors ?? ["white", "black"];
|
|
9
|
-
return (_jsxs("div", { className: cn(`bg-${bgColor}`, `text-${textColor}`, `min-h-screen h-screen xl:h-auto font-pretendard-medium`), children: [_jsx(Header, { title: title, image: [image, imageUrl] }), _jsxs("div", { className: "h-full flex gap-12 pt-20 xl:gap-8 xl:pl-2 2xl:px-9 xl:pt-10 xl:m-0 ", children: [_jsx(NavigationContainer, { children: navigations.map((nav, index) => (_jsx(Fragment, { children: nav }, index))) }), children] })] }));
|
|
10
|
-
}
|
package/layout/report/Header.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "../../util";
|
|
3
|
-
export default function Header({ groupName, examName, }) {
|
|
4
|
-
const container = {
|
|
5
|
-
positions: "relative z-20",
|
|
6
|
-
displays: "flex flex-col items-center ",
|
|
7
|
-
sizes: "w-full max-w-280",
|
|
8
|
-
styles: "py-8 bg-white shadow-md",
|
|
9
|
-
};
|
|
10
|
-
return (_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex justify-between w-full items-center pr-2", children: [_jsx("img", { src: "/images/logos/itc.png", alt: "itc", width: 100 }), _jsx("div", { className: "flex items-center", children: _jsx("div", { className: "text-5xl font-bold", children: examName }) }), _jsx("img", { src: "/images/logos/badge-tosel-lab.png", alt: "tosel-lab", width: 80 })] }), _jsxs("div", { className: "", children: ["\uC9C0\uC815\uAD50\uC721\uAE30\uAD00: ", groupName] })] }));
|
|
11
|
-
}
|
package/menu/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as SideMenu } from "./template/SideMenu";
|
package/menu/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as SideMenu } from "./template/SideMenu";
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useWidgetStore } from "../../store";
|
|
3
|
-
import { cn } from "../../util";
|
|
4
|
-
import HTMLElement from "../widget/HTMLElement";
|
|
5
|
-
export default function SideMenu({ log, setting, buttons, }) {
|
|
6
|
-
const { tempData, setTempData, clearTempData, events, removeView } = useWidgetStore();
|
|
7
|
-
const isOpen = events.some(({ event }) => event === "sideMenu");
|
|
8
|
-
const positions = "absolute top-20 right-0";
|
|
9
|
-
const paddings = "pt-8";
|
|
10
|
-
const sizes = `${isOpen ? "w-160" : "w-0"} h-full xl:h-158`;
|
|
11
|
-
const styles = `${isOpen ? "opacity-100 z-30" : "opacity-0 z-0"} bg-gray-200 duration-500`;
|
|
12
|
-
const { prints, logs } = log ?? {};
|
|
13
|
-
return (_jsx("div", { className: cn(positions, sizes, styles, paddings), children: _jsxs("div", { className: `relative w-full h-full flex flex-col items-center gap-12 ${isOpen ? "block" : "hidden"}`, children: [_jsxs("div", { className: "w-9/10 border-2 border-black p-2 h-80 relative", children: [_jsx("div", { className: "grid grid-cols-2", children: Object.entries(setting).map(([key, value]) => (_jsxs("div", { className: "text-base font-bold flex gap-2", children: [_jsxs("div", { className: "w-16", children: [value["label"], ":"] }), _jsx(HTMLElement, { type: value["type"], value: tempData[key], options: value["options"], onChange: (value) => setTempData({
|
|
14
|
-
...tempData,
|
|
15
|
-
[key]: value,
|
|
16
|
-
}) })] }, key))) }), _jsx("div", { className: "absolute bottom-2 right-2 flex justify-end gap-2", children: buttons?.map(([title, onClick]) => (_jsx("button", { onClick: onClick, className: "px-2 py-1 bg-blue-500 text-white", children: title }, title))) })] }), _jsx("div", { className: "border-2 border-black w-9/10 p-2 h-48 overflow-y-scroll", children: logs?.map((log, i) => (_jsx("div", { className: "text-base flex gap-2", children: prints?.map((print) => (_jsx("div", { className: "", children: log[print] }, print))) }, i))) }), _jsx("button", { onClick: () => {
|
|
17
|
-
clearTempData();
|
|
18
|
-
return removeView("sideMenu");
|
|
19
|
-
}, className: "absolute left-0 top-2/5 text-3xl font-bold", children: ">" })] }) }));
|
|
20
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Dispatch } from "react";
|
|
2
|
-
import { HTMLElementType } from "../../interface";
|
|
3
|
-
export default function HTMLElement({ type, value, options, onChange, }: {
|
|
4
|
-
type: HTMLElementType;
|
|
5
|
-
value: string | number;
|
|
6
|
-
options?: [string, string][];
|
|
7
|
-
onChange?: Dispatch<string>;
|
|
8
|
-
}): import("react/jsx-runtime").JSX.Element | undefined;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export default function HTMLElement({ type, value, options, onChange, }) {
|
|
3
|
-
if (type === "text")
|
|
4
|
-
return _jsx("div", { children: value });
|
|
5
|
-
if (type === "input")
|
|
6
|
-
return (_jsx("input", { className: "w-32", value: value, onChange: (e) => onChange?.(e.target.value) }));
|
|
7
|
-
if (type === "select")
|
|
8
|
-
return (_jsx("select", { value: value, onChange: (e) => onChange?.(e.target.value), children: options?.map(([value, label]) => (_jsx("option", { value: value, children: label }, value))) }));
|
|
9
|
-
}
|
package/modal/AlertModal.d.ts
DELETED
package/modal/AlertModal.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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/ControllerModal.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Modal } from "./Modal";
|
|
3
|
-
export default function ControllerModal({ options, }) {
|
|
4
|
-
const { buttons } = options ?? {};
|
|
5
|
-
return (_jsx(Modal, { options: { width: "lg", height: "xl", buttons }, children: _jsx("div", { className: "w-full h-120 border-2 " }) }));
|
|
6
|
-
}
|
package/modal/Modal.d.ts
DELETED
package/modal/Modal.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
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
|
-
"2xl": "w-2/3 min-w-76 max-w-176",
|
|
12
|
-
full: "w-full",
|
|
13
|
-
};
|
|
14
|
-
const heightSize = {
|
|
15
|
-
xs: "",
|
|
16
|
-
sm: "h-100",
|
|
17
|
-
md: "h-72 sm:h-48",
|
|
18
|
-
lg: "h-120",
|
|
19
|
-
xl: "h-180",
|
|
20
|
-
"2xl": "w-2/3 min-w-76 max-w-176",
|
|
21
|
-
full: "h-full",
|
|
22
|
-
};
|
|
23
|
-
export function Modal({ children, options }) {
|
|
24
|
-
const { buttons, width, height } = options ?? {};
|
|
25
|
-
const { clearModal } = useWidgetStore();
|
|
26
|
-
const sizes = `${heightSize[height ?? "sm"]} ${widthSize[width ?? "md"]}`;
|
|
27
|
-
const paddings = "pt-18 px-25";
|
|
28
|
-
const styles = "rounded-xl bg-white relative overflow-hidden";
|
|
29
|
-
return (_jsx("div", { className: background, children: _jsxs("div", { className: cn(sizes, styles, paddings), children: [children, _jsx(_Fragment, { children: buttons ? (_jsx("div", { className: `${absolute.br(8, 10)} flex justify-end gap-4`, children: buttons.map(([text, onClick]) => (_jsx("button", { className: "rounded-2xl bg-black px-8 py-2 text-2xl font-bold text-white", onClick: onClick, children: text }, text))) })) : null }), _jsx("button", { className: absolute.tl(5, 7) +
|
|
30
|
-
"bg-black rounded-full h-9 w-9 flex justify-center items-center", onClick: clearModal, children: _jsx("div", { className: "x-shape" }) })] }) }));
|
|
31
|
-
}
|
package/modal/TestModal.d.ts
DELETED
package/modal/TestModal.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Modal } from "./Modal";
|
|
3
|
-
export default function TestModal({ children, options, }) {
|
|
4
|
-
const { buttons } = options ?? {};
|
|
5
|
-
return (_jsx(Modal, { options: { width: "lg", height: "xl", buttons }, children: _jsx("div", { className: "pt-18 pl-25", children: children }) }));
|
|
6
|
-
}
|
package/shelf/Shelf.d.ts
DELETED
package/shelf/Shelf.js
DELETED
package/shelf/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Shelf } from "./Shelf";
|
package/shelf/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Shelf } from "./Shelf";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|