@megha-ui/react 1.2.249 → 1.2.251

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.
@@ -28,6 +28,7 @@ interface ModalProps {
28
28
  alignItems?: string;
29
29
  bodyOverflow?: "auto" | "hidden";
30
30
  modalContentClass?: string;
31
+ modalBodyClass?: string;
31
32
  }
32
33
  declare const Modal: FC<ModalProps>;
33
34
  export default Modal;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useState, useRef } from "react";
3
3
  import { MdClose } from "react-icons/md";
4
- const Modal = ({ isOpen, onClose, title, subTitle, titleAlign = "left", children, footer, className = "", width, minHeight = 300, padding = "1rem", borderRadius = 6, backgroundColor = "var(--modal-bg)", paddingBottom = "1rem", paddingLeft = "1rem", paddingRight = "1rem", paddingTop = "1rem", contentHeight = "calc(100vh - 180)", overlayClose = false, alignItems, justifyContent, modalContentClass, bodyOverflow = "auto", }) => {
4
+ const Modal = ({ isOpen, onClose, title, subTitle, titleAlign = "left", children, footer, className = "", width, minHeight = 300, padding = "1rem", borderRadius = 6, backgroundColor = "var(--modal-bg)", paddingBottom = "1rem", paddingLeft = "1rem", paddingRight = "1rem", paddingTop = "1rem", contentHeight = "calc(100vh - 180)", overlayClose = false, alignItems, justifyContent, modalContentClass, modalBodyClass, bodyOverflow = "auto", }) => {
5
5
  const [removelHeight, setRemovalHeight] = useState(0);
6
6
  const footerRef = useRef(null);
7
7
  useEffect(() => {
@@ -55,7 +55,7 @@ const Modal = ({ isOpen, onClose, title, subTitle, titleAlign = "left", children
55
55
  justifyContent,
56
56
  backgroundColor: "rgba(0, 0, 0, 0.5)",
57
57
  zIndex: 1050,
58
- }, onClick: () => overlayClose && onClose(), children: _jsxs("div", { style: modalContentStyle, className: modalContentClass, onClick: (e) => e.stopPropagation(), children: [title && (_jsxs("div", { style: {
58
+ }, onClick: () => overlayClose && onClose(), children: _jsxs("div", { style: modalContentStyle, className: `${modalContentClass} flex flex-col`, onClick: (e) => e.stopPropagation(), children: [title && (_jsxs("div", { style: {
59
59
  position: "relative",
60
60
  marginBottom: 0,
61
61
  padding: "1rem",
@@ -70,9 +70,8 @@ const Modal = ({ isOpen, onClose, title, subTitle, titleAlign = "left", children
70
70
  alignItems: "center",
71
71
  justifyContent: "center",
72
72
  padding: 4,
73
- }, onClick: onClose, children: _jsx(MdClose, { size: 18 }) })] })), _jsx("div", { style: {
73
+ }, onClick: onClose, children: _jsx(MdClose, { size: 18 }) })] })), _jsx("div", { className: `${modalBodyClass} flex-grow overflow-auto`, style: {
74
74
  overflowY: bodyOverflow,
75
- height: `calc(${contentHeight} - ${removelHeight}px)`,
76
75
  paddingLeft: "1rem",
77
76
  paddingRight: "1rem",
78
77
  }, children: children }), footer && (_jsx("div", { ref: footerRef, style: { marginTop: "auto", padding: "1rem" }, children: footer }))] }) }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.249",
3
+ "version": "1.2.251",
4
4
  "description": "A collection of reusable UI components for React applications, built with TypeScript.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",