next-helios-fe 1.1.2 → 1.1.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-helios-fe",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -20,7 +20,7 @@ interface ModalProps {
20
20
  onClick: () => void;
21
21
  };
22
22
  open: boolean;
23
- setOpen: (open: boolean) => void;
23
+ onClose: (open: boolean) => void;
24
24
  }
25
25
 
26
26
  export const Modal: React.FC<ModalProps> = ({
@@ -30,13 +30,13 @@ export const Modal: React.FC<ModalProps> = ({
30
30
  options,
31
31
  action,
32
32
  open,
33
- setOpen,
33
+ onClose,
34
34
  }) => {
35
35
  useEffect(() => {
36
36
  if (!options?.disableClose) {
37
37
  document.addEventListener("keydown", (e) => {
38
38
  if (e.key === "Escape") {
39
- setOpen(false);
39
+ onClose(false);
40
40
  }
41
41
  });
42
42
  }
@@ -73,7 +73,7 @@ export const Modal: React.FC<ModalProps> = ({
73
73
  type="button"
74
74
  className="flex justify-center items-center rounded-full px-1 py-1 text-slate-400 hover:bg-secondary-light"
75
75
  onClick={() => {
76
- setOpen(false);
76
+ onClose(false);
77
77
  }}
78
78
  >
79
79
  <Icon icon="pajamas:close" className="text-2xl" />
@@ -98,7 +98,7 @@ export const Modal: React.FC<ModalProps> = ({
98
98
  border: true,
99
99
  }}
100
100
  onClick={() => {
101
- setOpen(false);
101
+ onClose(false);
102
102
  }}
103
103
  >
104
104
  Close
@@ -12,7 +12,7 @@ interface DialogProps {
12
12
  timeout?: 3000 | 5000 | 7000 | 10000;
13
13
  };
14
14
  open: boolean;
15
- setOpen: (open: boolean) => void;
15
+ onClose: (open: boolean) => void;
16
16
  }
17
17
 
18
18
  export const Dialog: React.FC<DialogProps> = ({
@@ -20,7 +20,7 @@ export const Dialog: React.FC<DialogProps> = ({
20
20
  action,
21
21
  options,
22
22
  open,
23
- setOpen,
23
+ onClose,
24
24
  }) => {
25
25
  const actionVariant =
26
26
  action.variant === "secondary"
@@ -46,7 +46,7 @@ export const Dialog: React.FC<DialogProps> = ({
46
46
  useEffect(() => {
47
47
  if (options?.timeout) {
48
48
  const timeout = setTimeout(() => {
49
- setOpen(false);
49
+ onClose(false);
50
50
  }, options.timeout);
51
51
  return () => clearTimeout(timeout);
52
52
  }
@@ -70,7 +70,7 @@ export const Dialog: React.FC<DialogProps> = ({
70
70
  <button
71
71
  className="text-danger hover:text-danger-dark hover:underline"
72
72
  onClick={() => {
73
- setOpen(false);
73
+ onClose(false);
74
74
  }}
75
75
  >
76
76
  Close