ml-ui-lib 1.0.41 → 1.0.43
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.
|
@@ -48,16 +48,74 @@
|
|
|
48
48
|
/* Desktop dropdown bubble */
|
|
49
49
|
.navbar-dropdown-content {
|
|
50
50
|
display: flex;
|
|
51
|
-
flex-direction:
|
|
51
|
+
flex-direction: row;
|
|
52
52
|
position: relative;
|
|
53
|
-
top:
|
|
54
|
-
padding:
|
|
53
|
+
top: 30px;
|
|
54
|
+
padding: 20px;
|
|
55
55
|
background: #fff;
|
|
56
56
|
border-radius: 22px;
|
|
57
57
|
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
|
|
58
|
+
width: 100%;
|
|
59
|
+
max-width: 1200px;
|
|
60
|
+
margin: 0 auto;
|
|
61
|
+
justify-content: space-between;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.navbar-services {
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-direction: row;
|
|
67
|
+
gap: 30px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.navbar-products {
|
|
71
|
+
gap: 30px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.navbar-services-cols {
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-direction: column;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.navbar-services a {
|
|
80
|
+
border-radius: 15px;
|
|
81
|
+
padding: 10px 30px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.navbar-services a:hover {
|
|
85
|
+
background: linear-gradient(90deg, #b70404, #fe2424, red) 0 0 / 200% 100% !important;
|
|
86
|
+
color: #ffffff !important;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.navbar-services-container {
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-wrap: wrap;
|
|
92
|
+
flex-direction: row;
|
|
93
|
+
background-color: #f5f5f5;
|
|
94
|
+
box-shadow: 0 1px 10px #00000017;
|
|
95
|
+
border-radius: 20px;
|
|
96
|
+
padding: 15px;
|
|
97
|
+
gap: 15px 40px;
|
|
98
|
+
align-items: center;
|
|
99
|
+
width: 350px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.navbar-services-item {
|
|
103
|
+
cursor: pointer;
|
|
104
|
+
display: flex;
|
|
105
|
+
justify-content: center;
|
|
106
|
+
align-items: center;
|
|
107
|
+
background: #fa0000;
|
|
108
|
+
width: 140px;
|
|
109
|
+
height: 45px;
|
|
110
|
+
border-radius: 15px;
|
|
111
|
+
color: #ffffff;
|
|
58
112
|
}
|
|
59
113
|
|
|
60
|
-
.navbar-
|
|
114
|
+
.navbar-services-item:hover {
|
|
115
|
+
background: linear-gradient(90deg, #b70404, #fe2424, red) 0 0 / 200% 100%;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* .navbar-dropdown-content::before {
|
|
61
119
|
content: "";
|
|
62
120
|
position: absolute;
|
|
63
121
|
top: -8px;
|
|
@@ -67,11 +125,11 @@
|
|
|
67
125
|
background: #fff;
|
|
68
126
|
transform: rotate(45deg);
|
|
69
127
|
box-shadow: -2px -3px 4px #0000000d
|
|
70
|
-
}
|
|
128
|
+
} */
|
|
71
129
|
|
|
72
130
|
.navbar-dropdown {
|
|
73
131
|
position: absolute;
|
|
74
|
-
top:
|
|
132
|
+
top: 45px;
|
|
75
133
|
left: -35px;
|
|
76
134
|
display: none;
|
|
77
135
|
z-index: 10;
|
|
@@ -86,7 +144,9 @@
|
|
|
86
144
|
}
|
|
87
145
|
|
|
88
146
|
.navbar-dropdown-link:hover {
|
|
89
|
-
background: #
|
|
147
|
+
background: #ff0000;
|
|
148
|
+
color: #ffffff;
|
|
149
|
+
border-radius: 15px;
|
|
90
150
|
}
|
|
91
151
|
|
|
92
152
|
/* Desktop hover */
|
|
@@ -95,6 +155,11 @@
|
|
|
95
155
|
display: flex;
|
|
96
156
|
/* keep it rendered */
|
|
97
157
|
flex-direction: column;
|
|
158
|
+
|
|
159
|
+
position: fixed;
|
|
160
|
+
left: 0px;
|
|
161
|
+
width: 100%;
|
|
162
|
+
|
|
98
163
|
opacity: 0;
|
|
99
164
|
transform: translateY(-10px);
|
|
100
165
|
pointer-events: none;
|
|
@@ -206,6 +271,28 @@
|
|
|
206
271
|
Responsive
|
|
207
272
|
------------------------- */
|
|
208
273
|
@media (max-width: 1100px) {
|
|
274
|
+
|
|
275
|
+
.navbar-dropdown-content {
|
|
276
|
+
flex-direction: column;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.navbar-services {
|
|
280
|
+
flex-direction: column;
|
|
281
|
+
gap: 0px;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.navbar-services a {
|
|
285
|
+
border-radius: 0px !important;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.navbar-services a:hover {
|
|
289
|
+
background: #ff0000 !important;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.navbar-products {
|
|
293
|
+
display: none;
|
|
294
|
+
}
|
|
295
|
+
|
|
209
296
|
.navbar-container {
|
|
210
297
|
/* margin: 0 20px; */
|
|
211
298
|
padding: 1rem 1.5rem;
|
|
@@ -11,9 +11,16 @@ export interface NavbarItem {
|
|
|
11
11
|
target?: '_blank' | '_self';
|
|
12
12
|
subLinks?: NavbarSubItem[];
|
|
13
13
|
}
|
|
14
|
+
export interface NavbarProducts {
|
|
15
|
+
name: string;
|
|
16
|
+
link: string;
|
|
17
|
+
target?: '_blank' | '_self';
|
|
18
|
+
icons?: string;
|
|
19
|
+
}
|
|
14
20
|
export interface NavbarProps {
|
|
15
21
|
siteUrl?: string;
|
|
16
22
|
items: NavbarItem[];
|
|
23
|
+
products?: NavbarProducts[];
|
|
17
24
|
logoSrc?: string;
|
|
18
25
|
logoAlt?: string;
|
|
19
26
|
logoWidth?: number | string;
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import { useState, useEffect } from 'react';
|
|
4
4
|
import './Navbar.css';
|
|
5
5
|
import { SlidingPanel } from '../SlidingPanel/SlidingPanel';
|
|
6
|
-
export const Navbar = ({ siteUrl, items, logoSrc = '', logoAlt = 'Logo', logoWidth = 220, logoHeight = 40, className = '', login = false, logedinData = null, loginContent, otherContent, onClose, }) => {
|
|
6
|
+
export const Navbar = ({ siteUrl, items, products, logoSrc = '', logoAlt = 'Logo', logoWidth = 220, logoHeight = 40, className = '', login = false, logedinData = null, loginContent, otherContent, onClose, }) => {
|
|
7
7
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
8
8
|
const [showLogin, setShowLogin] = useState(false);
|
|
9
9
|
const [isClosing, setIsClosing] = useState(false);
|
|
@@ -84,17 +84,19 @@ export const Navbar = ({ siteUrl, items, logoSrc = '', logoAlt = 'Logo', logoWid
|
|
|
84
84
|
const isActive = currentPath === linkPath;
|
|
85
85
|
const isDropdownOpen = openDropdown === item.name;
|
|
86
86
|
return (_jsxs("div", { className: `navbar-item ${hasSubLinks ? 'has-dropdown' : ''} ${isDropdownOpen ? 'open' : ''}`, children: [_jsx("a", { href: hasSubLinks ? '#' : item.link, target: item.target || '_self', className: `navbar-link ${isActive ? 'active' : ''} ${hasSubLinks ? 'parent-link' : ''}`, onClick: (e) => {
|
|
87
|
-
if (hasSubLinks
|
|
87
|
+
if (hasSubLinks) {
|
|
88
88
|
e.preventDefault();
|
|
89
89
|
setOpenDropdown(prev => (prev === item.name ? null : item.name));
|
|
90
90
|
}
|
|
91
91
|
else {
|
|
92
92
|
setMenuOpen(false);
|
|
93
93
|
}
|
|
94
|
-
}, children: item.name }), hasSubLinks && (_jsx("div", { className: "navbar-dropdown", children:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
}, children: item.name }), hasSubLinks && (_jsx("div", { className: "navbar-dropdown", children: _jsxs("div", { className: "navbar-dropdown-content", children: [_jsx("div", { className: "navbar-services", children: Array.from({ length: Math.ceil(item.subLinks.length / 5) }, (_, i) => item.subLinks.slice(i * 5, i * 5 + 5)).map((column, index) => (_jsx("div", { className: 'navbar-services-cols', children: column.map(sub => (_jsx("a", { href: sub.link, target: sub.target || '_self', className: "navbar-dropdown-link", onClick: () => {
|
|
95
|
+
setMenuOpen(false);
|
|
96
|
+
setOpenDropdown(null);
|
|
97
|
+
}, children: sub.name }, sub.name))) }, index))) }), _jsx("div", { className: "navbar-products", children: _jsx("div", { className: 'navbar-services-container', children: products.map(product => (_jsx("div", { className: 'navbar-services-item', children: _jsx("span", { style: {
|
|
98
|
+
textAlign: 'center'
|
|
99
|
+
}, children: product.name }) }))) }) })] }) }))] }, item.name));
|
|
98
100
|
}) }), isMobile && login && !logedinData && (_jsx("div", { className: 'navbar-item', style: { background: '#ffffff' }, children: _jsx("button", { className: "mobile-login-btn", onClick: toggleLogin, children: "Login" }) }))] }), _jsxs("div", { className: "navbar-right", children: [_jsxs("button", { className: `burger ${menuOpen ? 'active' : ''}`, onClick: toggleMenu, children: [_jsx("span", {}), _jsx("span", {}), _jsx("span", {})] }), !isMobile && login && !logedinData && (_jsx("span", { className: "login-btn", onClick: toggleLogin, children: "Login" }))] })] })] }) }), login && !logedinData && (_jsx(_Fragment, { children: !isMobile ? (showLogin && (_jsxs(_Fragment, { children: [_jsx("div", { className: "overlay-side-content", children: otherContent }), _jsx("div", { className: "navbar-login-panel", children: _jsxs(SlidingPanel, { isOpen: showLogin && !isClosing, width: "400px", height: "100%", position: "right", closeOnOverlayClick: false, onClose: handleInternalClose, children: [_jsx("div", { className: "navbar-panel-header" }), _jsx("div", { className: "navbar-panel-content", children: loginContent })] }) })] }))) : (_jsx("div", { className: "navbar-login-panel", children: _jsxs(SlidingPanel, { isOpen: showLogin, height: "70%", position: "bottom", onClose: handleInternalClose, children: [_jsx("div", { className: "navbar-panel-header" }), _jsx("div", { className: "navbar-panel-content", children: loginContent })] }) })) }))] }));
|
|
99
101
|
};
|
|
100
102
|
export default Navbar;
|