ml-ui-lib 1.0.50 → 1.0.51
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.
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
background: transparent;
|
|
35
35
|
border: none;
|
|
36
36
|
font-size: 26px;
|
|
37
|
-
color: #
|
|
37
|
+
color: #555;
|
|
38
38
|
cursor: pointer;
|
|
39
39
|
line-height: 1;
|
|
40
40
|
transition: color 0.2s ease, transform 0.15s ease;
|
|
@@ -74,8 +74,7 @@
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
.modal-title {
|
|
77
|
-
|
|
78
|
-
font-weight: 600;
|
|
77
|
+
margin: 0px;
|
|
79
78
|
}
|
|
80
79
|
|
|
81
80
|
/* Animations */
|
|
@@ -15,5 +15,5 @@ export const Modal = ({ open, onClose, title, children, zIndex = 1000, variant =
|
|
|
15
15
|
zIndex: zIndex + 1,
|
|
16
16
|
width: `${width}%`,
|
|
17
17
|
maxWidth: "95vw",
|
|
18
|
-
}, children: [
|
|
18
|
+
}, children: [title && (_jsxs("div", { className: "modal-header", children: [_jsx("h3", { className: "modal-title", children: title }), _jsx("button", { className: "modal-close", onClick: onClose, "aria-label": "Close modal", children: "\u00D7" })] })), _jsx("div", { className: "modal-content", children: children })] }) }));
|
|
19
19
|
};
|
|
@@ -118,11 +118,11 @@
|
|
|
118
118
|
/* Header + body */
|
|
119
119
|
.spb-header {
|
|
120
120
|
display: flex;
|
|
121
|
+
justify-content: space-between;
|
|
121
122
|
align-items: center;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
min-height: 0px;
|
|
123
|
+
gap: 10px;
|
|
124
|
+
/* margin-bottom: 16px; */
|
|
125
|
+
padding: 0px 10px;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
.spb-title {
|
|
@@ -151,19 +151,21 @@
|
|
|
151
151
|
|
|
152
152
|
/* Desktop close button */
|
|
153
153
|
.spb-close-btn {
|
|
154
|
-
|
|
154
|
+
position: absolute;
|
|
155
|
+
top: 12px;
|
|
156
|
+
right: 14px;
|
|
157
|
+
background: transparent;
|
|
155
158
|
border: none;
|
|
156
|
-
font-size:
|
|
157
|
-
|
|
159
|
+
font-size: 26px;
|
|
160
|
+
color: #555;
|
|
158
161
|
cursor: pointer;
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
color: #111827;
|
|
162
|
-
margin-right: 0px;
|
|
162
|
+
line-height: 1;
|
|
163
|
+
transition: color 0.2s ease, transform 0.15s ease;
|
|
163
164
|
}
|
|
164
165
|
|
|
165
166
|
.spb-close-btn:hover {
|
|
166
|
-
|
|
167
|
+
color: #000;
|
|
168
|
+
transform: scale(1.1);
|
|
167
169
|
}
|
|
168
170
|
|
|
169
171
|
/* Handle (mobile) */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useRef, useState } from "react";
|
|
4
4
|
import "./SlidingPanel.css";
|
|
5
|
-
export const SlidingPanel = ({ isOpen, onClose, children, height = "80%", width = "100%", closeOnOverlayClick = true, position = "bottom", }) => {
|
|
5
|
+
export const SlidingPanel = ({ isOpen, onClose, children, height = "80%", width = "100%", closeOnOverlayClick = true, position = "bottom", title = "" }) => {
|
|
6
6
|
const [visible, setVisible] = useState(false);
|
|
7
7
|
const [animateOpen, setAnimateOpen] = useState(false);
|
|
8
8
|
const panelRef = useRef(null);
|
|
@@ -176,6 +176,6 @@ export const SlidingPanel = ({ isOpen, onClose, children, height = "80%", width
|
|
|
176
176
|
}, [onClose, position]);
|
|
177
177
|
if (!visible && !isOpen)
|
|
178
178
|
return null;
|
|
179
|
-
return (_jsxs("div", { className: `spb-root ${animateOpen ? "spb-open" : "spb-close"}`, children: [_jsx("div", { className: "spb-backdrop", onClick: () => closeOnOverlayClick && onClose() }), _jsxs("div", { ref: panelRef, className: `spb-panel spb-panel--position-${position}`, style: { height, width }, role: "dialog", "aria-modal": "true", onClick: (e) => e.stopPropagation(), children: [
|
|
179
|
+
return (_jsxs("div", { className: `spb-root ${animateOpen ? "spb-open" : "spb-close"}`, children: [_jsx("div", { className: "spb-backdrop", onClick: () => closeOnOverlayClick && onClose() }), _jsxs("div", { ref: panelRef, className: `spb-panel spb-panel--position-${position}`, style: { height, width }, role: "dialog", "aria-modal": "true", onClick: (e) => e.stopPropagation(), children: [_jsxs("div", { ref: headerRef, className: "spb-header", children: [_jsx("h3", { children: title }), _jsx("button", { className: "spb-close-btn", onClick: onClose, children: "\u00D7" })] }), _jsx("div", { className: "spb-body", children: children })] })] }));
|
|
180
180
|
};
|
|
181
181
|
export default SlidingPanel;
|