@edu-tosel/design 1.0.65 → 1.0.67
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/SVG.d.ts +2 -0
- package/asset/svg/Direction.d.ts +4 -0
- package/asset/svg/Direction.js +11 -0
- package/asset/svg/Direction.tsx +40 -0
- package/card/design/Card.design.js +13 -12
- package/card/design/CustomCard.design.d.ts +2 -0
- package/card/design/CustomCard.design.js +23 -0
- package/card/design/TableCard.design.js +7 -4
- package/card/index.d.ts +1 -0
- package/card/index.js +1 -0
- package/card/template/ConfirmCard/index.d.ts +3 -0
- package/card/template/ConfirmCard/index.js +3 -3
- package/card/template/CustomCard.d.ts +3 -0
- package/card/template/CustomCard.js +6 -0
- package/card/template/InfoCard/Academy.d.ts +1 -1
- package/card/template/InfoCard/Academy.js +4 -4
- package/card/template/NavCard.js +5 -1
- package/card/template/ProgressCard/Large.d.ts +1 -1
- package/card/template/ProgressCard/Large.js +4 -4
- package/card/template/ProgressCard/Small.d.ts +1 -1
- package/card/template/ProgressCard/Small.js +3 -3
- package/interaction/index.d.ts +1 -0
- package/interaction/index.js +1 -0
- package/interaction/template/Lock.d.ts +3 -0
- package/interaction/template/Lock.js +4 -0
- package/interface/Action.d.ts +6 -1
- package/interface/Board.d.ts +2 -1
- package/interface/Card.d.ts +9 -2
- package/interface/Data.d.ts +41 -0
- package/interface/Data.js +4 -0
- package/interface/Property.d.ts +8 -24
- package/interface/index.d.ts +2 -1
- package/interface/index.js +2 -1
- package/interface/widget/Obstacle.d.ts +10 -0
- package/interface/widget/Obstacle.js +1 -0
- package/interface/widget/Select.d.ts +23 -0
- package/interface/widget/Select.js +1 -0
- package/interface/widget/index.d.ts +1 -0
- package/layout/design/DataField.design.js +7 -5
- package/layout/design/Row.design/SelectRoll.d.ts +7 -0
- package/layout/design/Row.design/SelectRoll.js +39 -0
- package/layout/design/{Row.design.d.ts → Row.design/index.d.ts} +1 -1
- package/layout/design/{Row.design.js → Row.design/index.js} +13 -6
- package/layout/template/DataField.js +1 -1
- package/layout/template/Gallery.d.ts +3 -1
- package/layout/template/Gallery.js +4 -2
- package/layout/template/Row.js +1 -1
- package/layout/template/Tab.d.ts +1 -0
- package/layout/template/Tab.js +5 -3
- package/modal/template/Confirm/Switch.d.ts +2 -6
- package/modal/template/Confirm/Switch.js +2 -6
- package/package.json +1 -1
- package/tailwind.config.ts +2 -0
- package/version.txt +1 -1
- package/widget/design/Label.design.js +2 -1
- package/widget/design/Obstacle.design.d.ts +2 -0
- package/widget/design/Obstacle.design.js +13 -0
- package/widget/index.d.ts +2 -0
- package/widget/index.js +2 -0
- package/widget/template/Counter.d.ts +19 -0
- package/widget/template/Counter.js +48 -0
- package/widget/template/Input/Form.d.ts +1 -1
- package/widget/template/Input/Form.js +3 -2
- package/widget/template/Obstacle/index.d.ts +6 -0
- package/widget/template/Obstacle/index.js +13 -0
- package/widget/template/Pagination.d.ts +7 -0
- package/widget/template/Pagination.js +20 -0
- package/widget/template/Select/Handle.d.ts +2 -0
- package/widget/template/Select/Handle.js +30 -0
- package/widget/template/Select/Swipe.d.ts +10 -0
- package/widget/template/Select/Swipe.js +11 -0
- package/widget/template/Select/Switch.d.ts +3 -0
- package/widget/template/Select/Switch.js +43 -0
- package/widget/template/Select/Tag.d.ts +16 -0
- package/widget/template/Select/Tag.js +29 -0
- package/widget/template/Select/index.d.ts +8 -0
- package/widget/template/Select/index.js +5 -1
- package/widget/template/Switch/Switch.d.ts +17 -3
- package/widget/template/Switch/Switch.js +9 -10
- package/widget/template/Obstacle.d.ts +0 -4
- package/widget/template/Obstacle.js +0 -10
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../util";
|
|
3
|
+
import { selectOne, selectPlural } from "../../../util/select";
|
|
4
|
+
export default function SelectTag(props) {
|
|
5
|
+
const { state, selectOptions, selectHow, option } = props;
|
|
6
|
+
const { className, background, text } = option || {
|
|
7
|
+
selectHow: "plural",
|
|
8
|
+
};
|
|
9
|
+
const container = {
|
|
10
|
+
sizes: "w-full",
|
|
11
|
+
displays: "grid grid-cols-4 gap-2.5",
|
|
12
|
+
className,
|
|
13
|
+
};
|
|
14
|
+
const isSelectedStyle = [
|
|
15
|
+
background ?? "bg-green-dark",
|
|
16
|
+
text ?? "text-white",
|
|
17
|
+
].join(" ");
|
|
18
|
+
const button = (key) => ({
|
|
19
|
+
sizes: "h-10",
|
|
20
|
+
styles: "rounded-full",
|
|
21
|
+
animations: "duration-300",
|
|
22
|
+
boundaries: state[0].includes(key)
|
|
23
|
+
? isSelectedStyle
|
|
24
|
+
: "border border-gray-medium",
|
|
25
|
+
});
|
|
26
|
+
return (_jsx("div", { className: cn(container), children: selectOptions.map(({ title, value }) => (_jsx("button", { onClick: () => selectHow === "one"
|
|
27
|
+
? selectOne({ state, key: value })
|
|
28
|
+
: selectPlural({ state, key: value }), className: cn(button(value)), children: title }, value))) }));
|
|
29
|
+
}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import _Select from "./Select";
|
|
2
2
|
import LG from "./Select.LG";
|
|
3
|
+
import Tag from "./Tag";
|
|
4
|
+
import Handle from "./Handle";
|
|
5
|
+
import Switch from "./Switch";
|
|
6
|
+
import Swipe from "./Swipe";
|
|
3
7
|
declare const Select: typeof _Select & {
|
|
4
8
|
LG: typeof LG;
|
|
9
|
+
Tag: typeof Tag;
|
|
10
|
+
Handle: typeof Handle;
|
|
11
|
+
Switch: typeof Switch;
|
|
12
|
+
Swipe: typeof Swipe;
|
|
5
13
|
};
|
|
6
14
|
export default Select;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import _Select from "./Select";
|
|
2
2
|
import LG from "./Select.LG";
|
|
3
|
-
|
|
3
|
+
import Tag from "./Tag";
|
|
4
|
+
import Handle from "./Handle";
|
|
5
|
+
import Switch from "./Switch";
|
|
6
|
+
import Swipe from "./Swipe";
|
|
7
|
+
const Select = Object.assign(_Select, { LG, Tag, Handle, Switch, Swipe });
|
|
4
8
|
export default Select;
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { Size, State } from "../../../interface";
|
|
2
|
+
interface Option<T> {
|
|
3
|
+
title: string;
|
|
4
|
+
value: T;
|
|
5
|
+
icon?: string;
|
|
6
|
+
}
|
|
7
|
+
interface SelectSwitchProps<T> {
|
|
8
|
+
state: State<T>;
|
|
9
|
+
selectOptions: Option<T>[];
|
|
10
|
+
option?: {
|
|
11
|
+
size?: Size;
|
|
12
|
+
text?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
declare function SelectSwitch<T>({ state, selectOptions, option, }: SelectSwitchProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default SelectSwitch;
|
|
@@ -5,12 +5,12 @@ const paddingSize = {
|
|
|
5
5
|
lg: "p-2.5",
|
|
6
6
|
};
|
|
7
7
|
const widthSize = {
|
|
8
|
-
md: "w-
|
|
9
|
-
lg: "w-
|
|
8
|
+
md: "w-81",
|
|
9
|
+
lg: "w-100",
|
|
10
10
|
};
|
|
11
11
|
const heightSize = {
|
|
12
|
-
md: "h-
|
|
13
|
-
lg: "h-
|
|
12
|
+
md: "h-10.5",
|
|
13
|
+
lg: "h-20",
|
|
14
14
|
};
|
|
15
15
|
const gapSize = {
|
|
16
16
|
md: "gap-x-1.5",
|
|
@@ -20,25 +20,24 @@ const textSize = {
|
|
|
20
20
|
md: "text-sm",
|
|
21
21
|
lg: "text-base",
|
|
22
22
|
};
|
|
23
|
-
function
|
|
23
|
+
function SelectSwitch({ state, selectOptions, option, }) {
|
|
24
24
|
const { text, size, className } = option ?? {};
|
|
25
25
|
const container = {
|
|
26
|
+
sizes: `${widthSize[size ?? "md"]} ${heightSize[size ?? "md"]}`,
|
|
26
27
|
displays: `flex ${gapSize[size ?? "md"]}`,
|
|
27
28
|
paddings: paddingSize[size ?? "md"],
|
|
28
|
-
styles: "rounded-full bg-gray-light
|
|
29
|
+
styles: "rounded-full bg-gray-light",
|
|
29
30
|
className,
|
|
30
31
|
};
|
|
31
32
|
const button = (flag) => ({
|
|
32
|
-
sizes: `${widthSize[size ?? "md"]} ${heightSize[size ?? "md"]}`,
|
|
33
33
|
displays: "flex flex-1 gap-x-3 justify-center items-center",
|
|
34
34
|
backgrounds: flag ? "bg-white" : "bg-transparent",
|
|
35
35
|
text,
|
|
36
36
|
textSizes: textSize[size ?? "md"],
|
|
37
37
|
styles: "rounded-full ",
|
|
38
38
|
});
|
|
39
|
-
return (_jsx("div", { className: cn(container), children:
|
|
40
|
-
const { title, icon } = (display && display[value]) ?? {};
|
|
39
|
+
return (_jsx("div", { className: cn(container), children: selectOptions?.map(({ value, icon, title }) => {
|
|
41
40
|
return (_jsxs("button", { onClick: () => state[1](value), className: cn(button(value === state[0])), children: [icon && _jsx("img", { src: icon }), _jsx("div", { children: title })] }));
|
|
42
41
|
}) }));
|
|
43
42
|
}
|
|
44
|
-
export default
|
|
43
|
+
export default SelectSwitch;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "../../util";
|
|
3
|
-
export default function Obstacle({ disabled }) {
|
|
4
|
-
const obstacle = {
|
|
5
|
-
positions: "absolute",
|
|
6
|
-
sizes: "w-full h-full",
|
|
7
|
-
background: "bg-white/80 ",
|
|
8
|
-
};
|
|
9
|
-
return (disabled && (_jsx("div", { onClick: typeof disabled === "function" ? disabled : undefined, className: cn(obstacle) })));
|
|
10
|
-
}
|