@syscore/ui-library 1.7.1 → 1.7.3
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/client/components/ui/navigation.tsx +14 -7
- package/client/global.css +9 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +10 -6
- package/package.json +1 -1
|
@@ -367,13 +367,14 @@ const NavigationTray = React.forwardRef<HTMLDivElement, NavigationTrayProps>(
|
|
|
367
367
|
children,
|
|
368
368
|
_index,
|
|
369
369
|
_renderTriggerOnly,
|
|
370
|
+
|
|
370
371
|
...props
|
|
371
372
|
},
|
|
372
373
|
ref,
|
|
373
374
|
) => {
|
|
374
|
-
const { light, activeIndex, setActiveIndex, setIsOpen } = useNavigation();
|
|
375
|
+
const { light, activeIndex, setActiveIndex, setIsOpen, isOpen } = useNavigation();
|
|
375
376
|
const isActive = activeIndex === _index;
|
|
376
|
-
|
|
377
|
+
|
|
377
378
|
const handleMouseEnter = () => {
|
|
378
379
|
setIsOpen(true);
|
|
379
380
|
setActiveIndex(_index ?? null);
|
|
@@ -417,7 +418,7 @@ const NavigationTray = React.forwardRef<HTMLDivElement, NavigationTrayProps>(
|
|
|
417
418
|
|
|
418
419
|
// Render the tray content
|
|
419
420
|
return (
|
|
420
|
-
<div ref={ref} className={cn("navigation-tray", className)} {...props}>
|
|
421
|
+
<div ref={ref} className={cn("navigation-tray", className)} {...props} data-open={isOpen}>
|
|
421
422
|
<h2
|
|
422
423
|
className="heading-xsmall navigation-tray__title"
|
|
423
424
|
style={{
|
|
@@ -506,10 +507,16 @@ interface NavigationLinkProps extends React.ComponentPropsWithoutRef<"a"> {
|
|
|
506
507
|
}
|
|
507
508
|
|
|
508
509
|
const NavigationLink = React.forwardRef<HTMLAnchorElement, NavigationLinkProps>(
|
|
509
|
-
({ className, asChild, sub, bullet, badge, children, ...props }, ref) => {
|
|
510
|
+
({ className, asChild, sub, bullet, badge, children, onClick, ...props }, ref) => {
|
|
510
511
|
const { light } = useNavigation();
|
|
511
512
|
const Comp = asChild ? Slot : "a";
|
|
512
513
|
|
|
514
|
+
const handleClick = (e: React.MouseEvent<HTMLAnchorElement>) => {
|
|
515
|
+
// Prevent navigation from closing when clicking on links
|
|
516
|
+
e.stopPropagation();
|
|
517
|
+
onClick?.(e);
|
|
518
|
+
};
|
|
519
|
+
|
|
513
520
|
const isSubItem = sub || bullet;
|
|
514
521
|
const baseClassName = isSubItem
|
|
515
522
|
? cn(
|
|
@@ -533,7 +540,7 @@ const NavigationLink = React.forwardRef<HTMLAnchorElement, NavigationLinkProps>(
|
|
|
533
540
|
<li>
|
|
534
541
|
<div className="navigation-link__container">
|
|
535
542
|
{bulletElement}
|
|
536
|
-
<Comp ref={ref} className={cn(baseClassName, className)} {...props}>
|
|
543
|
+
<Comp ref={ref} className={cn(baseClassName, className)} onClick={handleClick} {...props}>
|
|
537
544
|
{children}
|
|
538
545
|
</Comp>
|
|
539
546
|
</div>
|
|
@@ -554,7 +561,7 @@ const NavigationLink = React.forwardRef<HTMLAnchorElement, NavigationLinkProps>(
|
|
|
554
561
|
return (
|
|
555
562
|
<li>
|
|
556
563
|
<span className="navigation-link__badge-wrapper">
|
|
557
|
-
<Comp ref={ref} className={cn(baseClassName, className)} {...props}>
|
|
564
|
+
<Comp ref={ref} className={cn(baseClassName, className)} onClick={handleClick} {...props}>
|
|
558
565
|
{children}
|
|
559
566
|
</Comp>
|
|
560
567
|
<span className="overline-small navigation-link__badge">
|
|
@@ -567,7 +574,7 @@ const NavigationLink = React.forwardRef<HTMLAnchorElement, NavigationLinkProps>(
|
|
|
567
574
|
|
|
568
575
|
return (
|
|
569
576
|
<li>
|
|
570
|
-
<Comp ref={ref} className={linkClassName} {...props}>
|
|
577
|
+
<Comp ref={ref} className={linkClassName} onClick={handleClick} {...props}>
|
|
571
578
|
{children}
|
|
572
579
|
</Comp>
|
|
573
580
|
</li>
|
package/client/global.css
CHANGED
|
@@ -6087,6 +6087,13 @@ body {
|
|
|
6087
6087
|
-webkit-backdrop-filter: blur(12px);
|
|
6088
6088
|
border-bottom: 1px solid rgb(239 241 242);
|
|
6089
6089
|
}
|
|
6090
|
+
/* added temporary */
|
|
6091
|
+
.navigation__content {
|
|
6092
|
+
background-color: rgb(249 250 251);
|
|
6093
|
+
backdrop-filter: blur(12px);
|
|
6094
|
+
-webkit-backdrop-filter: blur(12px);
|
|
6095
|
+
border-bottom: 1px solid rgb(239 241 242);
|
|
6096
|
+
}
|
|
6090
6097
|
|
|
6091
6098
|
.navigation-overlay {
|
|
6092
6099
|
position: absolute;
|
|
@@ -7175,6 +7182,7 @@ body {
|
|
|
7175
7182
|
.navigation-tray__content {
|
|
7176
7183
|
display: flex;
|
|
7177
7184
|
gap: 5rem;
|
|
7185
|
+
pointer-events: auto;
|
|
7178
7186
|
}
|
|
7179
7187
|
|
|
7180
7188
|
.navigation-column {
|
|
@@ -7204,6 +7212,7 @@ body {
|
|
|
7204
7212
|
.navigation-link {
|
|
7205
7213
|
display: block;
|
|
7206
7214
|
font-weight: 500;
|
|
7215
|
+
pointer-events: auto;
|
|
7207
7216
|
}
|
|
7208
7217
|
|
|
7209
7218
|
.navigation-link--light {
|