next-helios-fe 1.3.5 → 1.3.7

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.3.5",
3
+ "version": "1.3.7",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,7 +16,7 @@ interface ModalProps {
16
16
  };
17
17
  action?: React.ReactNode;
18
18
  open: boolean;
19
- onClose: (open: boolean) => void;
19
+ onClose: () => void;
20
20
  }
21
21
 
22
22
  export const Modal: React.FC<ModalProps> = ({
@@ -31,8 +31,9 @@ export const Modal: React.FC<ModalProps> = ({
31
31
  useEffect(() => {
32
32
  if (!options?.disableClose) {
33
33
  document.addEventListener("keydown", (e) => {
34
+ e.preventDefault();
34
35
  if (e.key === "Escape") {
35
- onClose(false);
36
+ onClose && onClose();
36
37
  }
37
38
  });
38
39
  }
@@ -71,7 +72,7 @@ export const Modal: React.FC<ModalProps> = ({
71
72
  type="button"
72
73
  className="flex justify-center items-center rounded-full px-1 py-1 text-slate-400 hover:bg-secondary-light"
73
74
  onClick={() => {
74
- onClose(false);
75
+ onClose && onClose();
75
76
  }}
76
77
  >
77
78
  <Icon icon="pajamas:close" className="text-2xl" />
@@ -97,7 +98,7 @@ export const Modal: React.FC<ModalProps> = ({
97
98
  border: true,
98
99
  }}
99
100
  onClick={() => {
100
- onClose(false);
101
+ onClose && onClose();
101
102
  }}
102
103
  >
103
104
  Close