@trackunit/react-modal 0.0.11 → 0.0.14

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/index.cjs.js CHANGED
@@ -82,9 +82,7 @@ const cvaModalContainer = cssClassVarianceUtilities.cvaMerge([
82
82
  "fixed",
83
83
  "top-0",
84
84
  "left-0",
85
- "min-h-[100dvh]",
86
- "min-w-[100dvw]",
87
- "overflow-auto",
85
+ "overflow-hidden",
88
86
  "items-center",
89
87
  ]);
90
88
  const cvaModalCard = cssClassVarianceUtilities.cvaMerge([
@@ -95,13 +93,12 @@ const cvaModalCard = cssClassVarianceUtilities.cvaMerge([
95
93
  "max-w-[min(100%-1rem,30%+600px)]",
96
94
  ]);
97
95
  const cvaModalBackdrop = cssClassVarianceUtilities.cvaMerge([
96
+ "flex",
98
97
  "justify-center",
99
98
  "items-center",
100
99
  "fixed",
101
100
  "top-0",
102
101
  "left-0",
103
- "min-h-[100dvh]",
104
- "min-w-[100dvw]",
105
102
  "w-full",
106
103
  "h-full",
107
104
  "z-overlay",
@@ -155,14 +152,6 @@ const Modal = React__namespace.forwardRef(({ isOpen, children, dataTestId, class
155
152
  closeModal();
156
153
  }
157
154
  }, [isOpen, openModal, closeModal]);
158
- React__namespace.useEffect(() => {
159
- return () => {
160
- if (isOpen) {
161
- closeModal();
162
- }
163
- };
164
- // eslint-disable-next-line react-hooks/exhaustive-deps
165
- }, []); // Empty dependency array means this effect runs only on mount and unmount
166
155
  return (jsxRuntime.jsx(ModalBackdrop, { isVisible: isOpen, noShadow: noBackdropShadow, onClick: onDismissClick, children: isOpen ? (jsxRuntime.jsx("div", { className: cvaModalContainer(), ref: ref, role: role, children: jsxRuntime.jsx(reactComponents.Card, { className: cvaModalCard({ className }), dataTestId: dataTestId, children: children }) })) : null }));
167
156
  });
168
157
  Modal.displayName = "Modal";
package/index.esm.js CHANGED
@@ -56,9 +56,7 @@ const cvaModalContainer = cvaMerge([
56
56
  "fixed",
57
57
  "top-0",
58
58
  "left-0",
59
- "min-h-[100dvh]",
60
- "min-w-[100dvw]",
61
- "overflow-auto",
59
+ "overflow-hidden",
62
60
  "items-center",
63
61
  ]);
64
62
  const cvaModalCard = cvaMerge([
@@ -69,13 +67,12 @@ const cvaModalCard = cvaMerge([
69
67
  "max-w-[min(100%-1rem,30%+600px)]",
70
68
  ]);
71
69
  const cvaModalBackdrop = cvaMerge([
70
+ "flex",
72
71
  "justify-center",
73
72
  "items-center",
74
73
  "fixed",
75
74
  "top-0",
76
75
  "left-0",
77
- "min-h-[100dvh]",
78
- "min-w-[100dvw]",
79
76
  "w-full",
80
77
  "h-full",
81
78
  "z-overlay",
@@ -129,14 +126,6 @@ const Modal = React.forwardRef(({ isOpen, children, dataTestId, className, role
129
126
  closeModal();
130
127
  }
131
128
  }, [isOpen, openModal, closeModal]);
132
- React.useEffect(() => {
133
- return () => {
134
- if (isOpen) {
135
- closeModal();
136
- }
137
- };
138
- // eslint-disable-next-line react-hooks/exhaustive-deps
139
- }, []); // Empty dependency array means this effect runs only on mount and unmount
140
129
  return (jsx(ModalBackdrop, { isVisible: isOpen, noShadow: noBackdropShadow, onClick: onDismissClick, children: isOpen ? (jsx("div", { className: cvaModalContainer(), ref: ref, role: role, children: jsx(Card, { className: cvaModalCard({ className }), dataTestId: dataTestId, children: children }) })) : null }));
141
130
  });
142
131
  Modal.displayName = "Modal";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-modal",
3
- "version": "0.0.11",
3
+ "version": "0.0.14",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {