@megha-ui/react 1.2.669 → 1.2.671

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.
@@ -4,6 +4,7 @@ interface ModalProps {
4
4
  onClose: () => void;
5
5
  title: string;
6
6
  subTitle?: string;
7
+ titleHtml?: any;
7
8
  titleAlign?: CSSProperties["textAlign"];
8
9
  children: React.ReactNode;
9
10
  className?: string;
@@ -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, modalBodyClass, bodyOverflow = "auto", }) => {
4
+ const Modal = ({ isOpen, onClose, title, subTitle, titleHtml = null, 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,15 +55,18 @@ 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} flex flex-col`, 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: [_jsxs("div", { style: {
59
59
  marginBottom: 0,
60
60
  paddingLeft: modalContentStyle.paddingLeft === 0 ? "1rem" : 0,
61
61
  paddingRight: modalContentStyle.paddingRight === 0 ? "1rem" : 0,
62
62
  paddingBottom: "1rem",
63
63
  display: "flex",
64
64
  alignItems: "center",
65
- justifyContent: "space-between"
66
- }, children: [_jsxs("div", { style: { textAlign: titleAlign }, children: [_jsx("h4", { style: { fontSize: "1.25rem" }, children: title }), _jsx("p", { style: { margin: 0 }, children: subTitle })] }), _jsx("button", { type: "button", "aria-label": "Close", style: {
65
+ justifyContent: "space-between",
66
+ }, children: [_jsxs("div", { style: {
67
+ display: "flex",
68
+ alignItems: "center",
69
+ }, children: [title && (_jsxs("div", { style: { textAlign: titleAlign }, children: [_jsx("h4", { style: { fontSize: "1.25rem" }, children: title }), _jsx("p", { style: { margin: 0 }, children: subTitle })] })), titleHtml] }), _jsx("button", { type: "button", "aria-label": "Close", style: {
67
70
  background: "transparent",
68
71
  border: "none",
69
72
  cursor: "pointer",
@@ -71,7 +74,7 @@ const Modal = ({ isOpen, onClose, title, subTitle, titleAlign = "left", children
71
74
  alignItems: "center",
72
75
  justifyContent: "center",
73
76
  padding: 4,
74
- }, onClick: onClose, children: _jsx(MdClose, { size: 18 }) })] })), _jsx("div", { className: `${modalBodyClass} flex-grow overflow-auto`, style: {
77
+ }, onClick: onClose, children: _jsx(MdClose, { size: 18 }) })] }), _jsx("div", { className: `${modalBodyClass} flex-grow overflow-auto`, style: {
75
78
  overflowY: bodyOverflow,
76
79
  }, children: children }), footer && (_jsx("div", { ref: footerRef, style: { marginTop: "auto", paddingTop: "1rem" }, children: footer }))] }) }));
77
80
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.669",
3
+ "version": "1.2.671",
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",