@edu-tosel/design 1.0.15 → 1.0.16
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/README.md +0 -5
- package/card/template/AddCard.d.ts +1 -1
- package/card/template/AddCard.js +11 -5
- package/html/widget/Select.js +14 -4
- package/index.d.ts +0 -1
- package/index.js +0 -1
- package/interface/Card.d.ts +2 -0
- package/interface/Modal.d.ts +1 -0
- package/modal/template/Input.d.ts +1 -1
- package/modal/template/Input.js +2 -2
- package/modal/widget/Modal.design.d.ts +1 -1
- package/modal/widget/Modal.design.js +3 -3
- package/package.json +1 -1
- package/tailwind.config.ts +1 -0
- package/util/index.d.ts +1 -0
- package/util/index.js +1 -0
- package/version.txt +1 -1
- package/deck/index.d.ts +0 -1
- package/deck/index.js +0 -1
- package/deck/template/Deck.d.ts +0 -6
- package/deck/template/Deck.design.d.ts +0 -2
- package/deck/template/Deck.design.js +0 -21
- package/deck/template/Deck.js +0 -11
- package/deck/widget/Deck.d.ts +0 -2
- package/deck/widget/Deck.js +0 -14
- package/interface/Deck.d.ts +0 -15
- package/interface/Deck.js +0 -1
package/README.md
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { AddCardProps } from "../../interface";
|
|
2
|
-
export default function AddCard({ onClick, options }: AddCardProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function AddCard({ title, icon, onClick, options, }: AddCardProps): import("react/jsx-runtime").JSX.Element;
|
package/card/template/AddCard.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../../util";
|
|
3
3
|
import { Card } from "../widget/Card";
|
|
4
|
-
export default function AddCard({ onClick, options }) {
|
|
4
|
+
export default function AddCard({ title, icon, onClick, options, }) {
|
|
5
5
|
const { width } = options ?? {};
|
|
6
6
|
const container = {
|
|
7
|
-
displays: "flex justify-center items-center",
|
|
8
|
-
text: "text-
|
|
7
|
+
displays: "flex flex-col justify-center items-center gap-2",
|
|
8
|
+
text: "text-xs",
|
|
9
|
+
styles: "duration-500 hover:bg-gray-light",
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
+
const iconBody = {
|
|
12
|
+
displays: "flex items-center justify-center ",
|
|
13
|
+
sizes: "w-9 h-9",
|
|
14
|
+
styles: "bg-gray-light rounded-full",
|
|
15
|
+
};
|
|
16
|
+
return (_jsxs(Card, { options: { width, classNames: cn(container), onClick }, children: [icon && (_jsx("div", { className: cn(iconBody), children: _jsx("img", { src: icon }) })), title && _jsx("div", { children: title })] }));
|
|
11
17
|
}
|
package/html/widget/Select.js
CHANGED
|
@@ -21,29 +21,39 @@ export default function Select({ state, selectOptions, options, }) {
|
|
|
21
21
|
setIsActive(false);
|
|
22
22
|
return setIsButton(false);
|
|
23
23
|
}, [flag]);
|
|
24
|
+
const levelsKey = {
|
|
25
|
+
CoCoon: "CC",
|
|
26
|
+
"Pre-Starter": "PS",
|
|
27
|
+
Starter: "ST",
|
|
28
|
+
Basic: "BA",
|
|
29
|
+
Junior: "JR",
|
|
30
|
+
"High Junior": "HJ",
|
|
31
|
+
};
|
|
24
32
|
const [isActive, setIsActive] = useState(false);
|
|
25
33
|
const [isButton, setIsButton] = useState(false);
|
|
26
34
|
const [selectedItem, setSelectedItem] = useState(null);
|
|
27
35
|
const handleItemClick = (title) => {
|
|
28
36
|
setSelectedItem(title);
|
|
29
37
|
setIsActive(false);
|
|
38
|
+
const selectedValue = levelsKey[title] || title;
|
|
39
|
+
setValue(selectedValue);
|
|
30
40
|
};
|
|
31
41
|
// css
|
|
32
42
|
const levels = [
|
|
33
43
|
"CoCoon",
|
|
34
|
-
"
|
|
44
|
+
"Pre-Starter",
|
|
35
45
|
"Starter",
|
|
36
46
|
"Basic",
|
|
37
47
|
"Junior",
|
|
38
|
-
"
|
|
48
|
+
"High Junior",
|
|
39
49
|
];
|
|
40
50
|
const colorMap = {
|
|
41
51
|
CoCoon: "bg-cocoon-green",
|
|
42
|
-
|
|
52
|
+
"Pre-Starter": "bg-ps-pink",
|
|
43
53
|
Starter: "bg-st-orange",
|
|
44
54
|
Basic: "bg-ba-yellow",
|
|
45
55
|
Junior: "bg-jr-blue",
|
|
46
|
-
|
|
56
|
+
"High Junior": "bg-hj-blue",
|
|
47
57
|
};
|
|
48
58
|
const isActiveCss = () => {
|
|
49
59
|
if (isActive)
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
package/interface/Card.d.ts
CHANGED
package/interface/Modal.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { State } from "../../interface";
|
|
2
2
|
import { ModalProps } from "../../interface/Modal";
|
|
3
|
-
export default function Input<T>({ isVisible, title, options, state, }: Omit<ModalProps, "children"> & {
|
|
3
|
+
export default function Input<T>({ isVisible, event, title, options, state, }: Omit<ModalProps, "children"> & {
|
|
4
4
|
title?: string;
|
|
5
5
|
state: State<T>;
|
|
6
6
|
}): import("react/jsx-runtime").JSX.Element;
|
package/modal/template/Input.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import ModalDesign from "../widget/Modal.design";
|
|
3
|
-
export default function Input({ isVisible, title, options, state, }) {
|
|
3
|
+
export default function Input({ isVisible, event, title, options, state, }) {
|
|
4
4
|
const { buttons } = options ?? {};
|
|
5
|
-
return (_jsxs(ModalDesign, { isVisible: isVisible, classNames: "pt-18 px-25", options: { buttons, isCloseButton: true }, children: [_jsx("div", { className: "text-xl font-bold", children: title }), _jsx("input", { className: "border-2 border-black w-80 h-8", value: state[0], onChange: (e) => state[1](e.target.value) })] }));
|
|
5
|
+
return (_jsxs(ModalDesign, { isVisible: isVisible, event: event, classNames: "pt-18 px-25", options: { buttons, isCloseButton: true }, children: [_jsx("div", { className: "text-xl font-bold", children: title }), _jsx("input", { className: "border-2 border-black w-80 h-8", value: state[0], onChange: (e) => state[1](e.target.value) })] }));
|
|
6
6
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ModalProps } from "../../interface/Modal";
|
|
2
|
-
export default function ModalDesign({ isVisible, children, options, debug, }: ModalProps): import("react").ReactPortal;
|
|
2
|
+
export default function ModalDesign({ isVisible, event, children, options, debug, }: ModalProps): import("react").ReactPortal;
|
|
@@ -22,9 +22,9 @@ const heightSize = {
|
|
|
22
22
|
"2xl": "w-2/3 min-w-76 max-w-176",
|
|
23
23
|
full: "h-full",
|
|
24
24
|
};
|
|
25
|
-
export default function ModalDesign({ isVisible, children, options, debug, }) {
|
|
25
|
+
export default function ModalDesign({ isVisible, event, children, options, debug, }) {
|
|
26
26
|
const { buttons, width, height, closeButtonColor, isCloseButton } = options ?? {};
|
|
27
|
-
const {
|
|
27
|
+
const { setIsOwn, removeModal } = useWidgetStore();
|
|
28
28
|
const background = {
|
|
29
29
|
positions: "z-50 fixed top-0 left-0",
|
|
30
30
|
displays: "flex items-center justify-center ",
|
|
@@ -60,5 +60,5 @@ export default function ModalDesign({ isVisible, children, options, debug, }) {
|
|
|
60
60
|
leave: { opacity: 0 },
|
|
61
61
|
config: { duration: 200 },
|
|
62
62
|
});
|
|
63
|
-
return ReactDOM.createPortal(transitions((styles, item) => item && (_jsx(animated.div, { style: styles, className: cn(background), children: _jsxs("div", { className: cn(container), children: [children, buttons ? (_jsx("div", { className: cn(button.container), children: buttons.map(([text, onClick]) => (_jsx("button", { className: cn(button.body), onClick: onClick, children: text }, text))) })) : null, isCloseButton && (_jsx("button", { className: cn(closeButton), onClick:
|
|
63
|
+
return ReactDOM.createPortal(transitions((styles, item) => item && (_jsx(animated.div, { style: styles, className: cn(background), onClick: () => setIsOwn(true), children: _jsxs("div", { className: cn(container), children: [children, buttons ? (_jsx("div", { className: cn(button.container), children: buttons.map(([text, onClick]) => (_jsx("button", { className: cn(button.body), onClick: onClick, children: text }, text))) })) : null, isCloseButton && event && (_jsx("button", { className: cn(closeButton), onClick: () => removeModal(event), children: _jsx("div", { className: "x-shape" }) }))] }) }))), document.body);
|
|
64
64
|
}
|
package/package.json
CHANGED
package/tailwind.config.ts
CHANGED
package/util/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { default as cn } from "./classNames";
|
|
|
2
2
|
export { default as unixToDate } from "./convertUnixTimestampToDate";
|
|
3
3
|
export { default as isDebug } from "./isDebug";
|
|
4
4
|
export { default as sortByOrder } from "./sortByOrder";
|
|
5
|
+
export { default as checkPathMatch } from "./checkPathMatch";
|
|
5
6
|
export * from "./colors";
|
|
6
7
|
export * from "./display";
|
|
7
8
|
export * from "./displayResponsive";
|
package/util/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export { default as cn } from "./classNames";
|
|
|
2
2
|
export { default as unixToDate } from "./convertUnixTimestampToDate";
|
|
3
3
|
export { default as isDebug } from "./isDebug";
|
|
4
4
|
export { default as sortByOrder } from "./sortByOrder";
|
|
5
|
+
export { default as checkPathMatch } from "./checkPathMatch";
|
|
5
6
|
export * from "./colors";
|
|
6
7
|
export * from "./display";
|
|
7
8
|
export * from "./displayResponsive";
|
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.16
|
package/deck/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Deck } from "./template/Deck";
|
package/deck/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Deck } from "./template/Deck";
|
package/deck/template/Deck.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
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;
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
}
|
package/deck/template/Deck.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
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;
|
package/deck/widget/Deck.d.ts
DELETED
package/deck/widget/Deck.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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/interface/Deck.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Titles } from "./Property";
|
|
2
|
-
export interface DeckProps<T> {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
titles?: Titles;
|
|
5
|
-
options?: {
|
|
6
|
-
flex?: "col" | "row";
|
|
7
|
-
justify?: "between";
|
|
8
|
-
overflowScroll?: boolean;
|
|
9
|
-
width?: T;
|
|
10
|
-
height?: number;
|
|
11
|
-
gapX?: number;
|
|
12
|
-
gapY?: number;
|
|
13
|
-
};
|
|
14
|
-
debug?: string;
|
|
15
|
-
}
|
package/interface/Deck.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|