@trackunit/react-modal 0.0.133 → 0.0.136

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
@@ -135,9 +135,9 @@ const ModalBackdrop = ({ children, isVisible, onClick, noShadow }) => {
135
135
  * - Modals are used to present critical information or request user input needed to complete a user's workflow.
136
136
  * - Modals interrupt a user's workflow by design.
137
137
  * - The modal component provides a foundation for creating dialogs, lightboxes, etc.
138
-
138
+
139
139
  */
140
- const Modal = React__namespace.forwardRef(({ isOpen, children, dataTestId, className, role = "", noBackdropShadow = false, onDismissClick = () => {
140
+ const Modal = React__namespace.forwardRef(({ isOpen, children, dataTestId, className, containerClassName, role = "", noBackdropShadow = false, onDismissClick = () => {
141
141
  return;
142
142
  }, }, ref) => {
143
143
  const { openModal, closeModal } = reactCoreHooks.useModalDialogContext();
@@ -157,7 +157,7 @@ const Modal = React__namespace.forwardRef(({ isOpen, children, dataTestId, class
157
157
  };
158
158
  // eslint-disable-next-line react-hooks/exhaustive-deps
159
159
  }, []); // Empty dependency array means this effect runs only on mount and unmount
160
- 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 }));
160
+ return (jsxRuntime.jsx(ModalBackdrop, { isVisible: isOpen, noShadow: noBackdropShadow, onClick: onDismissClick, children: isOpen ? (jsxRuntime.jsx("div", { className: cvaModalContainer({ className: containerClassName }), ref: ref, role: role, children: jsxRuntime.jsx(reactComponents.Card, { className: cvaModalCard({ className }), dataTestId: dataTestId, children: children }) })) : null }));
161
161
  });
162
162
  Modal.displayName = "Modal";
163
163
 
package/index.esm.js CHANGED
@@ -115,9 +115,9 @@ const ModalBackdrop = ({ children, isVisible, onClick, noShadow }) => {
115
115
  * - Modals are used to present critical information or request user input needed to complete a user's workflow.
116
116
  * - Modals interrupt a user's workflow by design.
117
117
  * - The modal component provides a foundation for creating dialogs, lightboxes, etc.
118
-
118
+
119
119
  */
120
- const Modal = React.forwardRef(({ isOpen, children, dataTestId, className, role = "", noBackdropShadow = false, onDismissClick = () => {
120
+ const Modal = React.forwardRef(({ isOpen, children, dataTestId, className, containerClassName, role = "", noBackdropShadow = false, onDismissClick = () => {
121
121
  return;
122
122
  }, }, ref) => {
123
123
  const { openModal, closeModal } = useModalDialogContext();
@@ -137,7 +137,7 @@ const Modal = React.forwardRef(({ isOpen, children, dataTestId, className, role
137
137
  };
138
138
  // eslint-disable-next-line react-hooks/exhaustive-deps
139
139
  }, []); // Empty dependency array means this effect runs only on mount and unmount
140
- 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 }));
140
+ return (jsx(ModalBackdrop, { isVisible: isOpen, noShadow: noBackdropShadow, onClick: onDismissClick, children: isOpen ? (jsx("div", { className: cvaModalContainer({ className: containerClassName }), ref: ref, role: role, children: jsx(Card, { className: cvaModalCard({ className }), dataTestId: dataTestId, children: children }) })) : null }));
141
141
  });
142
142
  Modal.displayName = "Modal";
143
143
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-modal",
3
- "version": "0.0.133",
3
+ "version": "0.0.136",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -25,11 +25,15 @@ export interface ModalProps extends CommonProps {
25
25
  * Whether modal has backdrop shadow or not
26
26
  */
27
27
  noBackdropShadow?: boolean;
28
+ /**
29
+ * A custom class name to be attached to modal container
30
+ */
31
+ containerClassName?: string;
28
32
  }
29
33
  /**
30
34
  * - Modals are used to present critical information or request user input needed to complete a user's workflow.
31
35
  * - Modals interrupt a user's workflow by design.
32
36
  * - The modal component provides a foundation for creating dialogs, lightboxes, etc.
33
-
37
+
34
38
  */
35
39
  export declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<HTMLDivElement>>;