@edu-tosel/design 1.0.327 → 1.0.329

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.
@@ -7,9 +7,9 @@ function Box({ children, className, texts }) {
7
7
  className,
8
8
  };
9
9
  const alarmText = {
10
- textStyles: "text-crimson-burgundy font-medium text-xs leading-none",
10
+ textStyles: "text-red-500 font-medium text-xs leading-none",
11
11
  };
12
- return (_jsxs("div", { className: "w-full", children: [_jsx("div", { className: cn(container), children: children }), texts && (_jsx("div", { className: "mt-2", children: texts.map((text) => (_jsx("div", { className: cn(alarmText), children: text }))) }))] }));
12
+ return (_jsxs("div", { className: "w-full", children: [_jsx("div", { className: cn(container), children: children }), texts && (_jsx("div", { className: "mt-3 flex flex-col gap-1 px-2", children: texts.map((text) => (_jsx("div", { className: cn(alarmText), children: text }))) }))] }));
13
13
  }
14
14
  function Fix({ children, className }) {
15
15
  return (_jsx(Box, { className: className, sizes: "w-full max-w-112.5 h-65 xs:h-67.5 pt-8 xs:pt-10.25 px-2.5 xs:px-5 pb-2.5 xs:pb-5", children: children }));
@@ -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.329",
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.329
@@ -21,7 +21,7 @@ export default function InputForm({ title, state, placeholder, isValid, type, on
21
21
  const styleByFlag = () => {
22
22
  const gray = "bg-gray-light/50 border-green-dark";
23
23
  const green = "bg-green-dark/10 text-green-dark border-green-dark";
24
- const red = "bg-red-50 text-red-400 border-red-500";
24
+ const red = "bg-red-50 text-red-500 border-red-500";
25
25
  if (typeof isValid === "undefined")
26
26
  return gray;
27
27
  if (typeof isValid === "function")
@@ -42,9 +42,7 @@ export default function InputForm({ title, state, placeholder, isValid, type, on
42
42
  fonts: "text-sm",
43
43
  boundaries: "rounded-md outline-none",
44
44
  focuses: onFocus ? "border " : "border-0",
45
- shadows: onFocus &&
46
- !(isValid === false) &&
47
- "shadow-[0px_0px_10px_0px_rgba(16,86,82,0.38)]",
45
+ shadows: onFocus && !(isValid === false) && "shadow-green",
48
46
  };
49
47
  useEffect(() => {
50
48
  if (type === "password") {