@visns-studio/visns-components 5.7.3 → 5.7.5
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.
package/package.json
CHANGED
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
83
83
|
},
|
|
84
84
|
"name": "@visns-studio/visns-components",
|
|
85
|
-
"version": "5.7.
|
|
85
|
+
"version": "5.7.5",
|
|
86
86
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
87
87
|
"main": "src/index.js",
|
|
88
88
|
"files": [
|
|
@@ -287,6 +287,9 @@ function Navigation({
|
|
|
287
287
|
}
|
|
288
288
|
};
|
|
289
289
|
|
|
290
|
+
const [, setActiveDropdown] = useState(null); // We only need the setter
|
|
291
|
+
const navWrapRef = useRef(null);
|
|
292
|
+
|
|
290
293
|
const renderNav = (n) => {
|
|
291
294
|
let navItemClasses;
|
|
292
295
|
|
|
@@ -302,8 +305,30 @@ function Navigation({
|
|
|
302
305
|
: styles['nav-item'];
|
|
303
306
|
}
|
|
304
307
|
|
|
308
|
+
const hasChildren = n.children && n.children.length > 0;
|
|
309
|
+
|
|
310
|
+
const handleMouseEnter = () => {
|
|
311
|
+
if (hasChildren) {
|
|
312
|
+
setActiveDropdown(n.id);
|
|
313
|
+
// Temporarily disable overflow on the navwrap when dropdown is active
|
|
314
|
+
if (navWrapRef.current) {
|
|
315
|
+
navWrapRef.current.style.overflowX = 'visible';
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
const handleMouseLeave = () => {
|
|
321
|
+
if (hasChildren) {
|
|
322
|
+
setActiveDropdown(null);
|
|
323
|
+
// Restore overflow when dropdown is no longer active
|
|
324
|
+
if (navWrapRef.current) {
|
|
325
|
+
navWrapRef.current.style.overflowX = 'auto';
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
|
|
305
330
|
const renderChildren = () => {
|
|
306
|
-
if (
|
|
331
|
+
if (hasChildren) {
|
|
307
332
|
return (
|
|
308
333
|
<ul className={styles.navDropdown}>
|
|
309
334
|
{n.children.map(
|
|
@@ -331,7 +356,11 @@ function Navigation({
|
|
|
331
356
|
};
|
|
332
357
|
|
|
333
358
|
return (
|
|
334
|
-
<li
|
|
359
|
+
<li
|
|
360
|
+
className={navItemClasses}
|
|
361
|
+
onMouseEnter={handleMouseEnter}
|
|
362
|
+
onMouseLeave={handleMouseLeave}
|
|
363
|
+
>
|
|
335
364
|
{n.url ? (
|
|
336
365
|
<Link to={n.url}>{n.label}</Link>
|
|
337
366
|
) : (
|
|
@@ -508,7 +537,7 @@ function Navigation({
|
|
|
508
537
|
</Link>
|
|
509
538
|
</div>
|
|
510
539
|
<div className={styles.awrap}>
|
|
511
|
-
<nav className={styles.navwrap}>
|
|
540
|
+
<nav className={styles.navwrap} ref={navWrapRef}>
|
|
512
541
|
<ul className={appNavClasses}>
|
|
513
542
|
{navData.navigations.map((nav, navKey) =>
|
|
514
543
|
nav.permission === true ||
|
|
@@ -578,7 +607,7 @@ function Navigation({
|
|
|
578
607
|
<img src={logo} alt="System Logo" />
|
|
579
608
|
</Link>
|
|
580
609
|
</div>
|
|
581
|
-
<div className={styles.navwrap}>
|
|
610
|
+
<div className={styles.navwrap} ref={navWrapRef}>
|
|
582
611
|
<ul className={appNavClasses}>
|
|
583
612
|
{navData.navigations.map((nav, navKey) =>
|
|
584
613
|
nav.permission === true || nav.permissionKey === '' ? (
|
|
@@ -205,11 +205,61 @@ function Notification(props) {
|
|
|
205
205
|
<h3>Notifications</h3>
|
|
206
206
|
{hasNotifications && (
|
|
207
207
|
<button
|
|
208
|
-
className={styles.markAllReadBtn}
|
|
209
208
|
onClick={markAllAsRead}
|
|
210
209
|
disabled={loading}
|
|
210
|
+
aria-label="Mark all notifications as read"
|
|
211
|
+
style={{
|
|
212
|
+
backgroundColor: 'var(--primary-color)',
|
|
213
|
+
color: 'var(--tertiary-color, white)',
|
|
214
|
+
padding: '8px 16px',
|
|
215
|
+
borderRadius: 'var(--br, 6px)',
|
|
216
|
+
border: 'none',
|
|
217
|
+
display: 'flex',
|
|
218
|
+
alignItems: 'center',
|
|
219
|
+
justifyContent: 'center',
|
|
220
|
+
gap: '6px',
|
|
221
|
+
fontSize: '14px',
|
|
222
|
+
fontWeight: '500',
|
|
223
|
+
cursor: 'pointer',
|
|
224
|
+
boxShadow:
|
|
225
|
+
'0 2px 4px rgba(0, 0, 0, 0.1)',
|
|
226
|
+
transition: 'all 0.2s ease',
|
|
227
|
+
opacity: loading ? '0.7' : '1',
|
|
228
|
+
}}
|
|
229
|
+
onMouseOver={(e) => {
|
|
230
|
+
if (!loading) {
|
|
231
|
+
e.target.style.backgroundColor =
|
|
232
|
+
'var(--secondary-color)';
|
|
233
|
+
e.target.style.boxShadow =
|
|
234
|
+
'0 4px 8px rgba(0, 0, 0, 0.15)';
|
|
235
|
+
}
|
|
236
|
+
}}
|
|
237
|
+
onMouseOut={(e) => {
|
|
238
|
+
if (!loading) {
|
|
239
|
+
e.target.style.backgroundColor =
|
|
240
|
+
'var(--primary-color)';
|
|
241
|
+
e.target.style.boxShadow =
|
|
242
|
+
'0 2px 4px rgba(0, 0, 0, 0.1)';
|
|
243
|
+
}
|
|
244
|
+
}}
|
|
245
|
+
onFocus={(e) => {
|
|
246
|
+
if (!loading) {
|
|
247
|
+
e.target.style.boxShadow =
|
|
248
|
+
'0 0 0 3px rgba(var(--primary-color-rgb, 0, 86, 179), 0.4)';
|
|
249
|
+
}
|
|
250
|
+
}}
|
|
251
|
+
onBlur={(e) => {
|
|
252
|
+
if (!loading) {
|
|
253
|
+
e.target.style.boxShadow =
|
|
254
|
+
'0 2px 4px rgba(0, 0, 0, 0.1)';
|
|
255
|
+
}
|
|
256
|
+
}}
|
|
211
257
|
>
|
|
212
|
-
<Check
|
|
258
|
+
<Check
|
|
259
|
+
size={16}
|
|
260
|
+
strokeWidth={2}
|
|
261
|
+
color="white"
|
|
262
|
+
/>
|
|
213
263
|
<span>Mark all as read</span>
|
|
214
264
|
</button>
|
|
215
265
|
)}
|
|
@@ -257,7 +307,10 @@ function Notification(props) {
|
|
|
257
307
|
data-index={index}
|
|
258
308
|
aria-label="Dismiss notification"
|
|
259
309
|
>
|
|
260
|
-
<CircleX
|
|
310
|
+
<CircleX
|
|
311
|
+
size={18}
|
|
312
|
+
strokeWidth={2}
|
|
313
|
+
/>
|
|
261
314
|
</button>
|
|
262
315
|
</div>
|
|
263
316
|
</div>
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
align-items: center;
|
|
5
5
|
gap: var(--padding);
|
|
6
6
|
width: 100%;
|
|
7
|
+
position: relative; /* Establish a positioning context */
|
|
7
8
|
|
|
8
9
|
.logo {
|
|
9
10
|
width: var(--logo-width);
|
|
@@ -42,6 +43,7 @@
|
|
|
42
43
|
flex: 1;
|
|
43
44
|
overflow-x: auto;
|
|
44
45
|
-webkit-overflow-scrolling: touch; /* For smooth scrolling on iOS */
|
|
46
|
+
position: relative; /* Ensure proper stacking context */
|
|
45
47
|
|
|
46
48
|
/* Hide scrollbar for most browsers but keep functionality */
|
|
47
49
|
scrollbar-width: none; /* Firefox */
|
|
@@ -67,8 +69,10 @@
|
|
|
67
69
|
|
|
68
70
|
.navDropdown {
|
|
69
71
|
border-radius: var(--br);
|
|
70
|
-
overflow:
|
|
71
|
-
box-shadow: 0
|
|
72
|
+
overflow: visible;
|
|
73
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
|
74
|
+
z-index: 1000; /* Ensure dropdown appears above other elements */
|
|
75
|
+
position: absolute; /* Ensure it's positioned absolutely */
|
|
72
76
|
}
|
|
73
77
|
|
|
74
78
|
.nav-item,
|
|
@@ -78,6 +82,11 @@
|
|
|
78
82
|
box-sizing: border-box;
|
|
79
83
|
position: relative;
|
|
80
84
|
flex-shrink: 0; /* Prevent items from shrinking too much */
|
|
85
|
+
z-index: 10; /* Base z-index for nav items */
|
|
86
|
+
|
|
87
|
+
&:hover {
|
|
88
|
+
z-index: 100; /* Higher z-index when hovered to ensure dropdown visibility */
|
|
89
|
+
}
|
|
81
90
|
|
|
82
91
|
a,
|
|
83
92
|
span {
|
|
@@ -132,9 +141,11 @@
|
|
|
132
141
|
opacity: 0;
|
|
133
142
|
background: rgba(var(--primary-rgb), 0.75);
|
|
134
143
|
border-radius: var(--br);
|
|
135
|
-
overflow:
|
|
144
|
+
overflow: visible;
|
|
136
145
|
margin-top: 1px;
|
|
137
146
|
clip-path: inset(0 0 0 0 round var(--br));
|
|
147
|
+
z-index: 1000; /* Ensure dropdown appears above other elements */
|
|
148
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); /* Add shadow for better visibility */
|
|
138
149
|
|
|
139
150
|
li {
|
|
140
151
|
display: block;
|
|
@@ -230,9 +241,11 @@
|
|
|
230
241
|
opacity: 0;
|
|
231
242
|
background: rgba(var(--primary-rgb), 0.9);
|
|
232
243
|
border-radius: var(--br);
|
|
233
|
-
overflow:
|
|
244
|
+
overflow: visible;
|
|
234
245
|
margin-top: 1px;
|
|
235
246
|
clip-path: inset(0 0 0 0 round var(--br));
|
|
247
|
+
z-index: 1000; /* Ensure dropdown appears above other elements */
|
|
248
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); /* Add shadow for better visibility */
|
|
236
249
|
|
|
237
250
|
li {
|
|
238
251
|
display: block;
|
|
@@ -544,7 +557,9 @@
|
|
|
544
557
|
background: var(--primary-color);
|
|
545
558
|
border-radius: 5px;
|
|
546
559
|
clip-path: inset(0 0 0 0 round 5px);
|
|
547
|
-
overflow:
|
|
560
|
+
overflow: visible;
|
|
561
|
+
z-index: 1000; /* Ensure dropdown appears above other elements */
|
|
562
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); /* Add shadow for better visibility */
|
|
548
563
|
|
|
549
564
|
li {
|
|
550
565
|
display: block;
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
justify-content: space-between;
|
|
81
81
|
padding: 12px 16px;
|
|
82
82
|
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
|
|
83
|
+
gap: 10px;
|
|
83
84
|
}
|
|
84
85
|
|
|
85
86
|
.notiboxHeader h3 {
|
|
@@ -87,29 +88,7 @@
|
|
|
87
88
|
font-size: 16px;
|
|
88
89
|
font-weight: 600;
|
|
89
90
|
color: var(--heading-color, #333);
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
.markAllReadBtn {
|
|
93
|
-
background: transparent;
|
|
94
|
-
border: none;
|
|
95
|
-
display: flex;
|
|
96
|
-
align-items: center;
|
|
97
|
-
gap: 4px;
|
|
98
|
-
font-size: 12px;
|
|
99
|
-
color: var(--primary-color);
|
|
100
|
-
cursor: pointer;
|
|
101
|
-
padding: 4px 8px;
|
|
102
|
-
border-radius: 4px;
|
|
103
|
-
transition: background-color 0.2s;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.markAllReadBtn:hover {
|
|
107
|
-
background-color: rgba(var(--primary-color-rgb), 0.08);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.markAllReadBtn:disabled {
|
|
111
|
-
opacity: 0.5;
|
|
112
|
-
cursor: not-allowed;
|
|
91
|
+
flex-shrink: 0;
|
|
113
92
|
}
|
|
114
93
|
|
|
115
94
|
/* Notification Scroll Wrap */
|
|
@@ -204,7 +183,7 @@
|
|
|
204
183
|
top: 10px;
|
|
205
184
|
background: transparent;
|
|
206
185
|
border: none;
|
|
207
|
-
color:
|
|
186
|
+
color: #666; /* Darker color to ensure visibility */
|
|
208
187
|
cursor: pointer;
|
|
209
188
|
padding: 0;
|
|
210
189
|
display: flex;
|
|
@@ -214,7 +193,7 @@
|
|
|
214
193
|
height: 24px;
|
|
215
194
|
border-radius: 50%;
|
|
216
195
|
transition: all 0.2s;
|
|
217
|
-
opacity: 0;
|
|
196
|
+
opacity: 0.6; /* Start with some opacity to ensure visibility */
|
|
218
197
|
}
|
|
219
198
|
|
|
220
199
|
.notiContent:hover .notiDismiss {
|
|
@@ -223,7 +202,9 @@
|
|
|
223
202
|
|
|
224
203
|
.notiDismiss:hover {
|
|
225
204
|
background-color: rgba(0, 0, 0, 0.05);
|
|
226
|
-
color: var(
|
|
205
|
+
color: var(
|
|
206
|
+
--secondary-color
|
|
207
|
+
); /* Use secondary color on hover for better visibility */
|
|
227
208
|
}
|
|
228
209
|
|
|
229
210
|
/* Empty State */
|