ml-ui-lib 1.0.41 → 1.0.42

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,70 @@
48
48
  /* Desktop dropdown bubble */
49
49
  .navbar-dropdown-content {
50
50
  display: flex;
51
- flex-direction: column;
51
+ flex-direction: row;
52
52
  position: relative;
53
- top: 15px;
54
- padding: 12px 45px 12px 20px;
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-services-cols {
71
+ display: flex;
72
+ flex-direction: column;
73
+ }
74
+
75
+ .navbar-services a{
76
+ border-radius: 15px;
77
+ padding: 10px 30px;
78
+ }
79
+
80
+ .navbar-services a:hover {
81
+ background: linear-gradient(90deg, #b70404, #fe2424, red) 0 0 / 200% 100% !important;
82
+ color: #ffffff !important;
58
83
  }
59
84
 
60
- .navbar-dropdown-content::before {
85
+ .navbar-services-container {
86
+ display: flex;
87
+ flex-wrap: wrap;
88
+ flex-direction: row;
89
+ background-color: #f5f5f5;
90
+ box-shadow: 0 1px 10px #00000017;
91
+ border-radius: 20px;
92
+ padding: 15px;
93
+ gap: 0px 40px;
94
+ align-items: center;
95
+ width: 350px;
96
+ }
97
+
98
+ .navbar-services-item {
99
+ cursor: pointer;
100
+ display: flex;
101
+ justify-content: center;
102
+ align-items: center;
103
+ background: #fa0000;
104
+ width: 140px;
105
+ height: 45px;
106
+ border-radius: 15px;
107
+ color: #ffffff;
108
+ }
109
+
110
+ .navbar-services-item:hover {
111
+ background: linear-gradient(90deg, #b70404, #fe2424, red) 0 0 / 200% 100%;
112
+ }
113
+
114
+ /* .navbar-dropdown-content::before {
61
115
  content: "";
62
116
  position: absolute;
63
117
  top: -8px;
@@ -67,11 +121,11 @@
67
121
  background: #fff;
68
122
  transform: rotate(45deg);
69
123
  box-shadow: -2px -3px 4px #0000000d
70
- }
124
+ } */
71
125
 
72
126
  .navbar-dropdown {
73
127
  position: absolute;
74
- top: 20px;
128
+ top: 45px;
75
129
  left: -35px;
76
130
  display: none;
77
131
  z-index: 10;
@@ -86,7 +140,9 @@
86
140
  }
87
141
 
88
142
  .navbar-dropdown-link:hover {
89
- background: #f2f2f2;
143
+ background: #ff0000;
144
+ color: #ffffff;
145
+ border-radius: 15px;
90
146
  }
91
147
 
92
148
  /* Desktop hover */
@@ -95,6 +151,11 @@
95
151
  display: flex;
96
152
  /* keep it rendered */
97
153
  flex-direction: column;
154
+
155
+ position: fixed;
156
+ left: 0px;
157
+ width: 100%;
158
+
98
159
  opacity: 0;
99
160
  transform: translateY(-10px);
100
161
  pointer-events: none;
@@ -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);
@@ -91,10 +91,12 @@ export const Navbar = ({ siteUrl, items, logoSrc = '', logoAlt = 'Logo', logoWid
91
91
  else {
92
92
  setMenuOpen(false);
93
93
  }
94
- }, children: item.name }), hasSubLinks && (_jsx("div", { className: "navbar-dropdown", children: _jsx("div", { className: "navbar-dropdown-content", children: item.subLinks.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))) }) }))] }, item.name));
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-services", 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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ml-ui-lib",
3
- "version": "1.0.41",
3
+ "version": "1.0.42",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",