@edu-tosel/design 1.0.124 → 1.0.126
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.
|
@@ -6,7 +6,7 @@ export default function Banner() {
|
|
|
6
6
|
displays: "flex justify-center items-center",
|
|
7
7
|
spacings: "px-5",
|
|
8
8
|
textstyles: "antialiased",
|
|
9
|
-
backgrounds: "bg-[url('images/olympiad/img-oly-bg-a.png')] bg-cover bg-center",
|
|
9
|
+
backgrounds: "bg-[url('/images/olympiad/img-oly-bg-a.png')] bg-cover bg-center",
|
|
10
10
|
};
|
|
11
11
|
const explainer = {
|
|
12
12
|
textstyles: "text-xl md:text-2xl font-pretendard-medium text-gray-light mix-blend-difference sm:text-green-dark sm:mix-blend-normal",
|
package/package.json
CHANGED
package/tailwind.config.ts
CHANGED
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.126
|
|
@@ -17,6 +17,7 @@ const heightSize = {
|
|
|
17
17
|
};
|
|
18
18
|
export default function SelectLG({ state, selectOptions: selectOptionsInput, placeholder, option, }) {
|
|
19
19
|
const selectOptions = selectOptionsInput?.map(toSelectOption);
|
|
20
|
+
const [filteredOptions, setFilteredOptions] = useState();
|
|
20
21
|
const id = useId();
|
|
21
22
|
const { isDark } = option ?? {};
|
|
22
23
|
const { setIsOwn, setIsOwnId } = useActionStore();
|
|
@@ -25,7 +26,6 @@ export default function SelectLG({ state, selectOptions: selectOptionsInput, pla
|
|
|
25
26
|
const [search, setSearch] = useState("");
|
|
26
27
|
const [isOpen, setIsOpen] = useState(false);
|
|
27
28
|
const [isHover, setIsHover] = useState(false);
|
|
28
|
-
const [filteredOptions, setFilterdOptions] = useState();
|
|
29
29
|
const [index, setIndex] = useState();
|
|
30
30
|
const listRef = useRef(null);
|
|
31
31
|
const itemRefs = useRef([]);
|
|
@@ -47,8 +47,9 @@ export default function SelectLG({ state, selectOptions: selectOptionsInput, pla
|
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
useEffect(() => {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
const responses = selectOptions?.filter(({ title }) => title?.includes(search));
|
|
51
|
+
setFilteredOptions(responses);
|
|
52
|
+
}, [search]);
|
|
52
53
|
useEffect(() => {
|
|
53
54
|
if (typeof index === "number" && itemRefs.current[index]) {
|
|
54
55
|
itemRefs.current[index]?.scrollIntoView({ block: "nearest" });
|
|
@@ -105,7 +106,7 @@ export default function SelectLG({ state, selectOptions: selectOptionsInput, pla
|
|
|
105
106
|
leave: { top: isLong ? 88 : 44 },
|
|
106
107
|
config: { duration: 0 },
|
|
107
108
|
});
|
|
108
|
-
return (_jsxs("div", { className: cn(container),
|
|
109
|
+
return (_jsxs("div", { className: cn(container), onClick: () => setIsOwn(true), onKeyDown: onKeyDown, 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.value)?.title })) : (_jsx("div", { className: "text-xs pl-1", children: placeholder ?? "선택해주세요" })) }), inputTransition((styles, item) => isLong &&
|
|
109
110
|
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) => {
|
|
110
111
|
return (item && (_jsx(animated.div, { style: styles, className: cn(body), ref: listRef, children: filteredOptions?.map(({ value, title }, order) => (_jsx("section", { children: _jsx("button", { ref: (el) => (itemRefs.current[order] = el), onClick: () => {
|
|
111
112
|
setValue(value);
|