@edu-tosel/design 1.0.59 → 1.0.61
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 +42 -42
- package/asset/SVG.tsx +27 -27
- package/asset/svg/Close.tsx +32 -32
- package/asset/svg/Direction.tsx +36 -36
- package/asset/svg/Email.tsx +20 -20
- package/asset/svg/Icon.tsx +186 -186
- package/asset/svg/Image.tsx +24 -24
- package/asset/svg/Notification.tsx +34 -34
- package/asset/svg/Operation.tsx +130 -130
- package/asset/svg/Phone.tsx +20 -20
- package/asset/svg/Profile.tsx +27 -27
- package/asset/svg/Symbol.tsx +60 -60
- package/asset/svg/TOSEL.tsx +63 -63
- package/card/design/NavCard.design.js +5 -6
- package/globals.css +226 -226
- package/interface/Action.d.ts +4 -3
- package/interface/Board.d.ts +4 -4
- package/interface/Card.d.ts +7 -5
- package/interface/Color.d.ts +3 -0
- package/interface/Color.js +7 -0
- package/interface/Layout.d.ts +4 -3
- package/interface/Modal.d.ts +2 -1
- package/interface/Overlay.d.ts +3 -3
- package/interface/Property.d.ts +2 -2
- package/interface/index.d.ts +2 -2
- package/interface/index.js +2 -2
- package/interface/widget/index.d.ts +55 -0
- package/interface/widget/index.js +7 -0
- package/layout/design/Row.design.d.ts +1 -1
- package/layout/design/Row.design.js +6 -5
- package/layout/template/Row.d.ts +3 -3
- package/layout/template/Row.js +6 -6
- package/layout/widget/sign/WithTitle.d.ts +2 -2
- package/modal/template/Confirm/Input.d.ts +2 -2
- package/package.json +1 -1
- package/tailwind.config.ts +619 -619
- package/version.txt +1 -1
- package/widget/CheckBox.d.ts +2 -2
- package/widget/DatePicker.d.ts +2 -2
- package/widget/EmailInput.d.ts +2 -2
- package/widget/EmailInput.js +1 -1
- package/widget/Toggle.d.ts +2 -2
- package/widget/design/Label.design.d.ts +2 -2
- package/widget/template/Input.d.ts +3 -3
- package/widget/template/Label.d.ts +3 -3
- package/widget/template/Select/Select.LG.d.ts +2 -2
- package/widget/template/Select/Select.d.ts +2 -2
- package/widget/template/Switch/Switch.d.ts +1 -1
- package/interface/HTMLElement.d.ts +0 -56
- package/interface/HTMLElement.js +0 -7
|
@@ -1,2 +1,57 @@
|
|
|
1
|
+
import { Color } from "../Color";
|
|
2
|
+
import { Disabled, OnClick, Size, State } from "../Property";
|
|
1
3
|
export * from "./Carousel";
|
|
2
4
|
export * from "./Switch";
|
|
5
|
+
export declare const WidgetType: {
|
|
6
|
+
readonly TEXT: "text";
|
|
7
|
+
readonly BUTTON: "button";
|
|
8
|
+
readonly INPUT: "input";
|
|
9
|
+
readonly SELECT: "select";
|
|
10
|
+
readonly TOGGLE: "toggle";
|
|
11
|
+
};
|
|
12
|
+
export type WidgetType = (typeof WidgetType)[keyof typeof WidgetType];
|
|
13
|
+
export interface Widget {
|
|
14
|
+
options?: {
|
|
15
|
+
className?: string;
|
|
16
|
+
width?: Size;
|
|
17
|
+
height?: Size;
|
|
18
|
+
background?: string;
|
|
19
|
+
text?: string;
|
|
20
|
+
disabled?: Disabled;
|
|
21
|
+
rounded?: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface LabelWidget extends Widget {
|
|
25
|
+
title: string;
|
|
26
|
+
hoverState?: State<boolean>;
|
|
27
|
+
onClick?: OnClick;
|
|
28
|
+
}
|
|
29
|
+
export type SelectOption<T> = [T, string];
|
|
30
|
+
export interface SelectWidget<T> extends Widget {
|
|
31
|
+
state: State<T>;
|
|
32
|
+
selectOptions?: SelectOption<T>[];
|
|
33
|
+
placeholder?: string;
|
|
34
|
+
}
|
|
35
|
+
type InputType = "text" | "password" | "date" | "email" | "phone" | "number";
|
|
36
|
+
export interface InputWidget extends Widget {
|
|
37
|
+
state: State<string> | State<string | undefined>;
|
|
38
|
+
onKeyDown?: (e: React.KeyboardEvent) => void;
|
|
39
|
+
placeholder?: string;
|
|
40
|
+
flag?: boolean;
|
|
41
|
+
type?: InputType;
|
|
42
|
+
label?: LabelWidget;
|
|
43
|
+
}
|
|
44
|
+
export interface CheckBoxWidget extends Widget {
|
|
45
|
+
state: State<boolean>;
|
|
46
|
+
labels: string;
|
|
47
|
+
color: Color;
|
|
48
|
+
}
|
|
49
|
+
export interface WidgetFrame {
|
|
50
|
+
title: string;
|
|
51
|
+
type: WidgetType;
|
|
52
|
+
state: State<any>;
|
|
53
|
+
selectOptions?: SelectOption<string | number>[];
|
|
54
|
+
labels?: [string | boolean, string][];
|
|
55
|
+
disabled?: Disabled;
|
|
56
|
+
onClick?: OnClick;
|
|
57
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { RowProps } from "../../interface";
|
|
2
|
-
export default function RowDesign<T>({ item, dataField, options, onClick, buttons,
|
|
2
|
+
export default function RowDesign<T>({ item, dataField, options, onClick, buttons, dot, }: RowProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useId } from "react";
|
|
3
|
+
import { ColorSet } from "../../interface";
|
|
3
4
|
import { cn } from "../../util";
|
|
4
5
|
import { Label } from "../../widget";
|
|
5
|
-
export default function RowDesign({ item, dataField, options, onClick, buttons,
|
|
6
|
+
export default function RowDesign({ item, dataField, options, onClick, buttons, dot, }) {
|
|
6
7
|
const { size, padding, text, noHover, className, isPointer } = options ?? {};
|
|
7
8
|
const id = useId();
|
|
8
9
|
const container = {
|
|
@@ -18,13 +19,13 @@ export default function RowDesign({ item, dataField, options, onClick, buttons,
|
|
|
18
19
|
styles: "truncate",
|
|
19
20
|
className,
|
|
20
21
|
};
|
|
21
|
-
const flagBox =
|
|
22
|
+
const flagBox = {
|
|
22
23
|
positions: "absolute left-3.5",
|
|
23
|
-
backgrounds:
|
|
24
|
+
backgrounds: dot && ColorSet[dot],
|
|
24
25
|
sizes: "w-2 h-2",
|
|
25
26
|
styles: "rounded-full",
|
|
26
|
-
}
|
|
27
|
-
return (_jsxs("div", { className: cn(container), onClick: () => onClick?.(), children: [typeof
|
|
27
|
+
};
|
|
28
|
+
return (_jsxs("div", { className: cn(container), onClick: () => onClick?.(), children: [typeof dot !== "undefined" && _jsx("div", { className: cn(flagBox) }), dataField &&
|
|
28
29
|
Object.keys(dataField).map((key) => (_jsx("div", { className: cn(`w-${dataField[key]?.size}/100`, itemBox), children: String(item[key]) }, id + key))), _jsx("div", { className: "absolute right-4 xl:right-8 flex gap-4", children: buttons?.map(({ title, onClick, options }) => (_jsx(Label.Button, { title: title, onClick: onClick, options: {
|
|
29
30
|
background: options?.background ?? "bg-crimson-dark",
|
|
30
31
|
text: options?.text ?? "text-white",
|
package/layout/template/Row.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { RowProps } from "../../interface";
|
|
2
|
-
declare function Row<T>({ item, dataField, onClick, buttons,
|
|
2
|
+
declare function Row<T>({ item, dataField, onClick, buttons, dot }: RowProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
declare namespace Row {
|
|
4
|
-
var Card: <T>({ item, dataField, onClick, buttons, height, noPadding, noHover,
|
|
4
|
+
var Card: <T>({ item, dataField, onClick, buttons, height, noPadding, noHover, dot, }: Omit<RowProps<T>, "options"> & {
|
|
5
5
|
height?: string | undefined;
|
|
6
6
|
noPadding?: boolean | undefined;
|
|
7
7
|
noHover?: boolean | undefined;
|
|
8
8
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
var Board: <T>({ item, dataField, onClick, buttons,
|
|
9
|
+
var Board: <T>({ item, dataField, onClick, buttons, dot, options, }: RowProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
}
|
|
11
11
|
export default Row;
|
package/layout/template/Row.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useId } from "react";
|
|
3
3
|
import RowDesign from "../design/Row.design";
|
|
4
|
-
function Row({ item, dataField, onClick, buttons,
|
|
5
|
-
return (_jsx(RowDesign, { onClick: onClick, item: item, dataField: dataField, buttons: buttons,
|
|
4
|
+
function Row({ item, dataField, onClick, buttons, dot }) {
|
|
5
|
+
return (_jsx(RowDesign, { onClick: onClick, item: item, dataField: dataField, buttons: buttons, dot: dot, options: {
|
|
6
6
|
size: "w-full h-12",
|
|
7
7
|
noHover: true,
|
|
8
8
|
text: "text-xs",
|
|
9
9
|
className: "text-center",
|
|
10
10
|
} }));
|
|
11
11
|
}
|
|
12
|
-
function Board({ item, dataField, onClick, buttons,
|
|
12
|
+
function Board({ item, dataField, onClick, buttons, dot, options, }) {
|
|
13
13
|
const id = useId();
|
|
14
|
-
return (_jsx(RowDesign, { onClick: onClick, item: item, dataField: dataField, buttons: buttons,
|
|
14
|
+
return (_jsx(RowDesign, { onClick: onClick, item: item, dataField: dataField, buttons: buttons, dot: dot, options: {
|
|
15
15
|
...options,
|
|
16
16
|
size: "w-full h-12",
|
|
17
17
|
padding: "px-2 xs:px-4 xl:px-7.5",
|
|
18
18
|
text: "text-xl",
|
|
19
19
|
} }, id));
|
|
20
20
|
}
|
|
21
|
-
function Card({ item, dataField, onClick, buttons, height, noPadding, noHover,
|
|
21
|
+
function Card({ item, dataField, onClick, buttons, height, noPadding, noHover, dot, }) {
|
|
22
22
|
const id = useId();
|
|
23
|
-
return (_jsx(RowDesign, { onClick: onClick, item: item, dataField: dataField, buttons: buttons,
|
|
23
|
+
return (_jsx(RowDesign, { onClick: onClick, item: item, dataField: dataField, buttons: buttons, dot: dot, options: {
|
|
24
24
|
size: `w-full ${height ?? "h-12"}`,
|
|
25
25
|
padding: !noPadding ? "px-2 xs:px-4 xl:px-7.5" : "",
|
|
26
26
|
text: "text-base",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
interface InputWithTitleProps extends
|
|
1
|
+
import { InputWidget } from "../../../interface";
|
|
2
|
+
interface InputWithTitleProps extends InputWidget {
|
|
3
3
|
title: string;
|
|
4
4
|
}
|
|
5
5
|
declare function WithTitle({ title, placeholder, state, flag, type, }: InputWithTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConfirmModalProps } from "../../../interface/Modal";
|
|
2
|
-
import {
|
|
2
|
+
import { InputWidget } from "../../../interface";
|
|
3
3
|
interface InputProps extends Omit<ConfirmModalProps, "children"> {
|
|
4
|
-
inputs: (
|
|
4
|
+
inputs: (InputWidget & {
|
|
5
5
|
title: string;
|
|
6
6
|
})[];
|
|
7
7
|
}
|