@edu-tosel/design 1.0.70 → 1.0.71
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/interface/widget/index.d.ts +1 -0
- package/package.json +1 -1
- package/store/index.d.ts +1 -0
- package/store/index.js +1 -0
- package/version.txt +1 -1
- package/widget/template/Select/Select.LG.js +16 -8
package/package.json
CHANGED
package/store/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ interface ActionProps {
|
|
|
19
19
|
isOwnId: string;
|
|
20
20
|
setIsOwnId: (prop: string) => void;
|
|
21
21
|
isDark: boolean;
|
|
22
|
+
dark: () => void;
|
|
22
23
|
setDark: () => void;
|
|
23
24
|
}
|
|
24
25
|
export declare const useActionStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ActionProps>>;
|
package/store/index.js
CHANGED
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.71
|
|
@@ -16,6 +16,7 @@ const heightSize = {
|
|
|
16
16
|
};
|
|
17
17
|
export default function SelectLG({ state, selectOptions, placeholder, option, }) {
|
|
18
18
|
const id = useId();
|
|
19
|
+
const { isDark } = option ?? {};
|
|
19
20
|
const { setIsOwn, setIsOwnId } = useActionStore();
|
|
20
21
|
const [value, setValue] = state;
|
|
21
22
|
const [text, setText] = useState("");
|
|
@@ -60,6 +61,7 @@ export default function SelectLG({ state, selectOptions, placeholder, option, })
|
|
|
60
61
|
displays: "flex items-center",
|
|
61
62
|
sizes: `${widthSize[option?.width ?? "md"]} ${heightSize[option?.height ?? "sm"]}`,
|
|
62
63
|
styles: "pl-1 rounded-md focus:outline-none duration-100 text-gray-400",
|
|
64
|
+
backgrounds: isDark && "bg-[#282828]",
|
|
63
65
|
shadow: isOpen || isHover ? "box-shadow" : "shadow-none",
|
|
64
66
|
};
|
|
65
67
|
const input = {
|
|
@@ -72,15 +74,23 @@ export default function SelectLG({ state, selectOptions, placeholder, option, })
|
|
|
72
74
|
displays: "flex flex-col gap-1",
|
|
73
75
|
sizes: `${widthSize[option?.width ?? "md"]} min-h-6.5 max-h-40`,
|
|
74
76
|
paddings: "p-2",
|
|
75
|
-
|
|
77
|
+
backgrounds: !isDark ? "bg-white" : "bg-[#282828]",
|
|
78
|
+
styles: "box-shadow rounded-md box-shadow overflow-y-scroll",
|
|
76
79
|
};
|
|
77
|
-
const label = {
|
|
80
|
+
const label = (flag) => ({
|
|
78
81
|
displays: "flex items-center",
|
|
79
82
|
sizes: "h-7 w-full",
|
|
80
83
|
paddings: "px-2",
|
|
81
84
|
styles: "rounded-sm duration-500",
|
|
82
|
-
|
|
83
|
-
|
|
85
|
+
backgrounds: !flag
|
|
86
|
+
? !isDark
|
|
87
|
+
? "hover:bg-green-dark"
|
|
88
|
+
: "bg-[#282828] hover:bg-[#8F7B39] "
|
|
89
|
+
: !isDark
|
|
90
|
+
? "bg-green-dark"
|
|
91
|
+
: "bg-[#8F7B39]",
|
|
92
|
+
fonts: !isDark ? "text-xs text-gray-dim hover:text-white" : "text-white ",
|
|
93
|
+
});
|
|
84
94
|
const inputTransition = useTransition(isOpen, {
|
|
85
95
|
from: { top: 44 },
|
|
86
96
|
enter: { top: 44 },
|
|
@@ -93,14 +103,12 @@ export default function SelectLG({ state, selectOptions, placeholder, option, })
|
|
|
93
103
|
leave: { top: isLong ? 88 : 44 },
|
|
94
104
|
config: { duration: 0 },
|
|
95
105
|
});
|
|
96
|
-
return (_jsxs("div", { className: cn(container), onKeyDown: onKeyDown, onClick: () => setIsOwn(true), children: [_jsx("button", { onClick: () => setIsOpen(!isOpen), className: cn(button), onMouseEnter: () => setIsHover(true), onMouseLeave: () => setIsHover(false), children: value ? (_jsx("div", { className: cn(label), children: selectOptions?.find((option) => value === option[0])?.[1] })) : (_jsx("div", { className: "text-xs pl-1", children: placeholder ?? "선택해주세요" })) }), inputTransition((styles, item) => isLong &&
|
|
106
|
+
return (_jsxs("div", { className: cn(container), onKeyDown: onKeyDown, onClick: () => setIsOwn(true), children: [_jsx("button", { onClick: () => setIsOpen(!isOpen), className: cn(button), onMouseEnter: () => setIsHover(true), onMouseLeave: () => setIsHover(false), children: value ? (_jsx("div", { className: cn(label(false)), children: selectOptions?.find((option) => value === option[0])?.[1] })) : (_jsx("div", { className: "text-xs pl-1", children: placeholder ?? "선택해주세요" })) }), inputTransition((styles, item) => isLong &&
|
|
97
107
|
item && (_jsx(animated.input, { style: styles, placeholder: "\uAC80\uC0C9\uC5B4\uB97C \uC785\uB825\uD558\uC138\uC694", className: cn(input), onChange: (e) => setSearch(e.target.value) }))), bodyTransitions((styles, item) => {
|
|
98
108
|
return (item && (_jsx(animated.div, { style: styles, className: cn(body), ref: listRef, children: filteredOptions?.map(([value, text], order) => (_jsx("section", { children: _jsx("button", { ref: (el) => (itemRefs.current[order] = el), onClick: () => {
|
|
99
109
|
setValue(value);
|
|
100
110
|
setText(text);
|
|
101
111
|
return setIsOpen(false);
|
|
102
|
-
}, className: cn(label
|
|
103
|
-
? "bg-green-dark text-white w-full"
|
|
104
|
-
: "w-auto"), children: text }) }, id + value))) })));
|
|
112
|
+
}, className: cn(label(order === index)), children: text }) }, id + value))) })));
|
|
105
113
|
})] }));
|
|
106
114
|
}
|