@edu-tosel/design 1.0.327 → 1.0.328

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.
@@ -1,18 +1,17 @@
1
1
  import { OnClick, State } from "../../../interface";
2
- import { ReactNode } from "react";
3
2
  interface ButtonProps {
4
3
  title: string;
5
4
  onClick: OnClick;
6
5
  disabled?: boolean;
7
6
  size?: string;
8
- icon?: ReactNode;
7
+ icon?: React.ReactNode;
9
8
  bg?: string;
10
9
  }
11
10
  interface SelectButtonProps {
12
11
  state: State<string>;
13
12
  buttons: {
14
13
  type: string;
15
- icon: string;
14
+ icon: string | React.ReactNode;
16
15
  title: string;
17
16
  }[];
18
17
  }
@@ -19,7 +19,7 @@ function Button({ title, onClick, disabled, size, icon, bg }) {
19
19
  }, className: cn(container), children: [title, icon && icon] }));
20
20
  }
21
21
  function Inner({ title, onClick, bg }) {
22
- return (_jsx(Button, { title: title, onClick: onClick, size: "w-full sm:w-102.5 h-13.5", bg: bg }));
22
+ return (_jsx(Button, { title: title, onClick: onClick, size: "w-full h-13.5", bg: bg }));
23
23
  }
24
24
  function Selection({ buttons, state }) {
25
25
  const [value, setValue] = state;
@@ -27,12 +27,14 @@ function Selection({ buttons, state }) {
27
27
  return {
28
28
  displays: "flex flex-1 justify-center items-center gap-3",
29
29
  sizes: "h-15",
30
- backgrounds: value === type ? "bg-green-dark/10 shadow-green" : "bg-gray-light",
30
+ backgrounds: value === type
31
+ ? "bg-green-dark/10 text-green-dark "
32
+ : "bg-gray-light text-gray-medium",
31
33
  styles: "rounded-lgx",
32
34
  animations: "duration-300",
33
35
  };
34
36
  };
35
- return (_jsx("div", { className: "flex gap-2.5", children: buttons.map(({ icon, title, type }) => (_jsxs("button", { className: cn(container(type)), onClick: () => setValue(type), children: [_jsx("img", { src: icon }), _jsx("div", { children: title })] }, type))) }));
37
+ return (_jsx("div", { className: "flex gap-2.5", children: buttons.map(({ icon, title, type }) => (_jsxs("button", { className: cn(container(type)), onClick: () => setValue(type), children: [typeof icon === "string" ? _jsx("img", { src: icon }) : icon, _jsx("div", { children: title })] }, type))) }));
36
38
  }
37
39
  function WithTitle({ buttons, title, state }) {
38
40
  return (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("div", { className: "leading-none", children: title }), _jsx(Selection, { buttons: buttons, state: state })] }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.327",
3
+ "version": "1.0.328",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.327
1
+ 1.0.328