@edu-tosel/design 1.0.308 → 1.0.310

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.
@@ -11,9 +11,7 @@ export default function RollCardDesign({ titles, state, disabled, isFixed, child
11
11
  const [isDisabled, disabledFn] = disabled || [false, () => { }];
12
12
  const [flag, setFlag] = useState(false);
13
13
  useEffect(() => {
14
- if (isFixed) {
15
- setFlag(true);
16
- }
14
+ setFlag(!!isFixed);
17
15
  }, [isFixed]);
18
16
  const childBox = {
19
17
  sizes: "h-full",
@@ -24,7 +22,7 @@ export default function RollCardDesign({ titles, state, disabled, isFixed, child
24
22
  width: "3xl",
25
23
  height: isMobile ? (!isFixed && isOpen ? "2xs" : "4xs") : "2xs",
26
24
  background: isDisabled || flag ? "bg-green-light" : "bg-white",
27
- boundary: flag ? "" : "shadow-main hover:shadow-green", // isFixed일 때 그림자 제거
25
+ boundary: isFixed ? "" : "shadow-main hover:shadow-green", // isFixed일 때 그림자 제거
28
26
  className: "p-7.5 flex flex-col gap-y-6",
29
27
  }, children: [_jsxs("div", { className: "flex flex-col gap-y-3.5 sm:flex-row justify-between", children: [_jsxs(Shelf.Col, { className: "gap-y-2.5", children: [_jsxs("div", { className: "flex gap-x-2.5 items-center", children: [titles.icon && _jsx("img", { src: titles.icon, alt: "icon" }), _jsx("div", { className: "text-xl leading-none font-pretendard-bold text-green-dark", children: titles.title })] }), _jsx("div", { className: "leading-none", children: titles.subtitle })] }), _jsxs("div", { className: "flex justify-between sm:justify-start gap-3.5 items-center", children: [_jsx(Label, { title: !isDisabled
30
28
  ? isFixed
@@ -37,6 +37,8 @@ export interface SelectTagProps<T> {
37
37
  className?: string;
38
38
  background?: string;
39
39
  text?: string;
40
+ unselectedHoverBackground?: string;
41
+ unselectedHoverText?: string;
40
42
  };
41
43
  }
42
44
  export interface SelectHandleProps<T> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.308",
3
+ "version": "1.0.310",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.308
1
+ 1.0.310
@@ -3,7 +3,7 @@ import { cn } from "../../../util";
3
3
  import { selectOne, selectPlural } from "../../../util/select";
4
4
  export default function SelectTag(props) {
5
5
  const { state, selectOptions, selectHow, option } = props;
6
- const { className, background, text } = option || {
6
+ const { className, background, text, unselectedHoverBackground, unselectedHoverText, } = option || {
7
7
  selectHow: "plural",
8
8
  };
9
9
  const container = {
@@ -15,14 +15,29 @@ export default function SelectTag(props) {
15
15
  background ?? "bg-green-dark",
16
16
  text ?? "text-white",
17
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
- });
18
+ const unselectedHoverStyle = [
19
+ unselectedHoverBackground
20
+ ? unselectedHoverBackground.startsWith("hover:")
21
+ ? unselectedHoverBackground
22
+ : `hover:${unselectedHoverBackground.replace("bg-", "")}`
23
+ : "hover:bg-gray-light",
24
+ unselectedHoverText
25
+ ? unselectedHoverText.startsWith("hover:")
26
+ ? unselectedHoverText
27
+ : `hover:${unselectedHoverText.replace("text-", "")}`
28
+ : "hover:text-gray-dark",
29
+ ].join(" ");
30
+ const button = (key) => {
31
+ const isSelected = state[0].includes(key);
32
+ return {
33
+ sizes: "h-10",
34
+ styles: "rounded-md",
35
+ animations: "duration-300 transition-all",
36
+ boundaries: isSelected
37
+ ? isSelectedStyle // 선택된 태그는 호버 스타일 제거
38
+ : `bg-gray-light/50 text-gray-medium/80 ${unselectedHoverStyle}`,
39
+ };
40
+ };
26
41
  return (_jsx("div", { className: cn(container), children: selectOptions.map(({ title, value }) => (_jsx("button", { onClick: () => selectHow === "one"
27
42
  ? selectOne({ state, key: value })
28
43
  : selectPlural({ state, key: value }), className: cn(button(value)), children: title }, value))) }));