@megha-ui/react 1.2.181 → 1.2.182

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.
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useState, useRef } from "react";
3
+ import { MdClose } from "react-icons/md";
3
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
5
  const [removelHeight, setRemovalHeight] = useState(0);
5
6
  const footerRef = useRef(null);
@@ -58,7 +59,18 @@ const Modal = ({ isOpen, onClose, title, subTitle, titleAlign = "left", children
58
59
  position: "relative",
59
60
  marginBottom: 0,
60
61
  padding: "1rem",
61
- }, children: [_jsxs("div", { style: { textAlign: titleAlign }, children: [_jsx("h4", { style: { fontSize: "1.25rem" }, children: title }), _jsx("p", { style: { margin: 0 }, children: subTitle })] }), _jsx("button", { style: { position: "absolute", top: 10, right: 10 }, onClick: onClose, children: "\u00D7" })] })), _jsx("div", { style: {
62
+ }, 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: {
63
+ position: "absolute",
64
+ top: 10,
65
+ right: 10,
66
+ background: "transparent",
67
+ border: "none",
68
+ cursor: "pointer",
69
+ display: "flex",
70
+ alignItems: "center",
71
+ justifyContent: "center",
72
+ padding: 4,
73
+ }, onClick: onClose, children: _jsx(MdClose, { size: 18 }) })] })), _jsx("div", { style: {
62
74
  overflowY: bodyOverflow,
63
75
  height: `calc(${contentHeight} - ${removelHeight}px)`,
64
76
  paddingLeft: "1rem",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.181",
3
+ "version": "1.2.182",
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",