baaz-custom-components 3.1.2 → 3.1.4
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/dist/index.css +14 -0
- package/dist/index.d.mts +3 -9
- package/dist/index.d.ts +3 -9
- package/dist/index.js +275 -114
- package/dist/index.mjs +274 -113
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -385,27 +385,58 @@ function MenubarSubContent(_a) {
|
|
|
385
385
|
|
|
386
386
|
// src/components/custom/navbar/customMenu.tsx
|
|
387
387
|
import { ChevronDown, ChevronUp } from "lucide-react";
|
|
388
|
-
import { useRouter } from "next/navigation";
|
|
388
|
+
import { usePathname, useRouter } from "next/navigation";
|
|
389
389
|
import { Fragment, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
390
390
|
function isLeaf(value) {
|
|
391
391
|
return typeof value === "string";
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function normalizePath(path) {
|
|
394
|
+
return path.startsWith("/") ? path : `/${path}`;
|
|
395
|
+
}
|
|
396
|
+
function treeContainsPath(data, pathname) {
|
|
397
|
+
for (const [, value] of Object.entries(data)) {
|
|
398
|
+
if (typeof value === "string") {
|
|
399
|
+
if (normalizePath(value) === pathname) return true;
|
|
400
|
+
} else if (treeContainsPath(value, pathname)) {
|
|
401
|
+
return true;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
return false;
|
|
405
|
+
}
|
|
406
|
+
function MenuItems({ data, pathname }) {
|
|
394
407
|
const router = useRouter();
|
|
395
408
|
return /* @__PURE__ */ jsx6(Fragment, { children: Object.entries(data).map(([label, value]) => {
|
|
396
409
|
if (isLeaf(value)) {
|
|
410
|
+
const active = normalizePath(value) === pathname;
|
|
397
411
|
return /* @__PURE__ */ jsx6(
|
|
398
412
|
MenubarItem,
|
|
399
413
|
{
|
|
400
414
|
onClick: () => router.push(`/${value}`),
|
|
415
|
+
className: cn(
|
|
416
|
+
active && "bg-accent text-accent-foreground"
|
|
417
|
+
),
|
|
401
418
|
children: label
|
|
402
419
|
},
|
|
403
420
|
label
|
|
404
421
|
);
|
|
405
422
|
}
|
|
406
423
|
return /* @__PURE__ */ jsxs4(MenubarSub, { children: [
|
|
407
|
-
/* @__PURE__ */ jsx6(
|
|
408
|
-
|
|
424
|
+
/* @__PURE__ */ jsx6(
|
|
425
|
+
MenubarSubTrigger,
|
|
426
|
+
{
|
|
427
|
+
className: cn(
|
|
428
|
+
treeContainsPath(value, pathname) && "bg-accent text-accent-foreground"
|
|
429
|
+
),
|
|
430
|
+
children: label
|
|
431
|
+
}
|
|
432
|
+
),
|
|
433
|
+
/* @__PURE__ */ jsx6(MenubarSubContent, { children: /* @__PURE__ */ jsx6(
|
|
434
|
+
MenuItems,
|
|
435
|
+
{
|
|
436
|
+
data: value,
|
|
437
|
+
pathname
|
|
438
|
+
}
|
|
439
|
+
) })
|
|
409
440
|
] }, label);
|
|
410
441
|
}) });
|
|
411
442
|
}
|
|
@@ -413,49 +444,179 @@ function MenuList({
|
|
|
413
444
|
menuKey,
|
|
414
445
|
menuData
|
|
415
446
|
}) {
|
|
447
|
+
const pathname = usePathname();
|
|
448
|
+
const topActive = treeContainsPath(menuData, pathname);
|
|
416
449
|
return /* @__PURE__ */ jsx6(Menubar, { className: "bg-transparent border-none ", children: /* @__PURE__ */ jsxs4(MenubarMenu, { children: [
|
|
417
|
-
/* @__PURE__ */ jsxs4(
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
450
|
+
/* @__PURE__ */ jsxs4(
|
|
451
|
+
MenubarTrigger,
|
|
452
|
+
{
|
|
453
|
+
className: cn(
|
|
454
|
+
"cursor-pointer group inline-flex items-center",
|
|
455
|
+
topActive && "bg-accent text-accent-foreground"
|
|
456
|
+
),
|
|
457
|
+
children: [
|
|
458
|
+
menuKey,
|
|
459
|
+
/* @__PURE__ */ jsx6(
|
|
460
|
+
ChevronDown,
|
|
461
|
+
{
|
|
462
|
+
size: 16,
|
|
463
|
+
className: "ml-1 group-data-[state=open]:hidden"
|
|
464
|
+
}
|
|
465
|
+
),
|
|
466
|
+
/* @__PURE__ */ jsx6(
|
|
467
|
+
ChevronUp,
|
|
468
|
+
{
|
|
469
|
+
size: 16,
|
|
470
|
+
className: "ml-1 hidden group-data-[state=open]:inline"
|
|
471
|
+
}
|
|
472
|
+
)
|
|
473
|
+
]
|
|
474
|
+
}
|
|
475
|
+
),
|
|
476
|
+
/* @__PURE__ */ jsx6(MenubarContent, { children: /* @__PURE__ */ jsx6(MenuItems, { data: menuData, pathname }) })
|
|
435
477
|
] }) });
|
|
436
478
|
}
|
|
437
479
|
|
|
438
|
-
// src/components/custom/
|
|
480
|
+
// src/components/custom/breadcrumb/index.tsx
|
|
481
|
+
import { Slash } from "lucide-react";
|
|
482
|
+
import { usePathname as usePathname2 } from "next/navigation";
|
|
483
|
+
|
|
484
|
+
// src/components/ui/breadcrumb.tsx
|
|
485
|
+
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
486
|
+
import { ChevronRight, MoreHorizontal } from "lucide-react";
|
|
439
487
|
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
488
|
+
function Breadcrumb(_a) {
|
|
489
|
+
var props = __objRest(_a, []);
|
|
490
|
+
return /* @__PURE__ */ jsx7("nav", __spreadValues({ "aria-label": "breadcrumb", "data-slot": "breadcrumb" }, props));
|
|
491
|
+
}
|
|
492
|
+
function BreadcrumbList(_a) {
|
|
493
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
494
|
+
return /* @__PURE__ */ jsx7(
|
|
495
|
+
"ol",
|
|
496
|
+
__spreadValues({
|
|
497
|
+
"data-slot": "breadcrumb-list",
|
|
498
|
+
className: cn(
|
|
499
|
+
"text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
|
|
500
|
+
className
|
|
501
|
+
)
|
|
502
|
+
}, props)
|
|
503
|
+
);
|
|
504
|
+
}
|
|
505
|
+
function BreadcrumbItem(_a) {
|
|
506
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
507
|
+
return /* @__PURE__ */ jsx7(
|
|
508
|
+
"li",
|
|
509
|
+
__spreadValues({
|
|
510
|
+
"data-slot": "breadcrumb-item",
|
|
511
|
+
className: cn("inline-flex items-center gap-1.5", className)
|
|
512
|
+
}, props)
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
function BreadcrumbLink(_a) {
|
|
516
|
+
var _b = _a, {
|
|
517
|
+
asChild,
|
|
518
|
+
className
|
|
519
|
+
} = _b, props = __objRest(_b, [
|
|
520
|
+
"asChild",
|
|
521
|
+
"className"
|
|
522
|
+
]);
|
|
523
|
+
const Comp = asChild ? Slot2 : "a";
|
|
524
|
+
return /* @__PURE__ */ jsx7(
|
|
525
|
+
Comp,
|
|
526
|
+
__spreadValues({
|
|
527
|
+
"data-slot": "breadcrumb-link",
|
|
528
|
+
className: cn("hover:text-foreground transition-colors", className)
|
|
529
|
+
}, props)
|
|
530
|
+
);
|
|
531
|
+
}
|
|
532
|
+
function BreadcrumbSeparator(_a) {
|
|
533
|
+
var _b = _a, {
|
|
534
|
+
children,
|
|
535
|
+
className
|
|
536
|
+
} = _b, props = __objRest(_b, [
|
|
537
|
+
"children",
|
|
538
|
+
"className"
|
|
539
|
+
]);
|
|
540
|
+
return /* @__PURE__ */ jsx7(
|
|
541
|
+
"li",
|
|
542
|
+
__spreadProps(__spreadValues({
|
|
543
|
+
"data-slot": "breadcrumb-separator",
|
|
544
|
+
role: "presentation",
|
|
545
|
+
"aria-hidden": "true",
|
|
546
|
+
className: cn("[&>svg]:size-3.5", className)
|
|
547
|
+
}, props), {
|
|
548
|
+
children: children != null ? children : /* @__PURE__ */ jsx7(ChevronRight, {})
|
|
549
|
+
})
|
|
550
|
+
);
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
// src/utils/helper.ts
|
|
554
|
+
var buildUrl = (urls, index) => {
|
|
555
|
+
return `/${urls.slice(0, index + 1).join("/")}`;
|
|
556
|
+
};
|
|
557
|
+
var capitalizeFirstLetter = (text, splitter = "-") => {
|
|
558
|
+
return text.split(splitter).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
559
|
+
};
|
|
560
|
+
|
|
561
|
+
// src/components/custom/breadcrumb/index.tsx
|
|
562
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
563
|
+
var CustomBreadcrumb = ({ layoutName, includeFrom = 0 }) => {
|
|
564
|
+
const pathname = usePathname2();
|
|
565
|
+
const completeUrl = pathname.split("/").filter(Boolean);
|
|
566
|
+
const urls = pathname.split("/").filter(Boolean).slice(includeFrom);
|
|
567
|
+
const activeClassName = "!text-primary";
|
|
568
|
+
return /* @__PURE__ */ jsx8(Breadcrumb, { children: /* @__PURE__ */ jsxs6(BreadcrumbList, { children: [
|
|
569
|
+
/* @__PURE__ */ jsx8(BreadcrumbItem, { children: /* @__PURE__ */ jsx8("h2", { className: "text-text !text-xxl font-semibold", children: layoutName }) }),
|
|
570
|
+
urls.length > 0 && /* @__PURE__ */ jsx8(BreadcrumbSeparator, { children: /* @__PURE__ */ jsx8(Slash, { className: "!h-md !w-md" }) }),
|
|
571
|
+
urls.map((url, index) => {
|
|
572
|
+
const href = buildUrl(
|
|
573
|
+
completeUrl,
|
|
574
|
+
index + includeFrom
|
|
575
|
+
);
|
|
576
|
+
return /* @__PURE__ */ jsxs6(BreadcrumbItem, { children: [
|
|
577
|
+
/* @__PURE__ */ jsx8(
|
|
578
|
+
BreadcrumbLink,
|
|
579
|
+
{
|
|
580
|
+
href,
|
|
581
|
+
className: `!font-light !text-md !text-off-white ${index >= urls.length - 1 && activeClassName}`,
|
|
582
|
+
children: capitalizeFirstLetter(url)
|
|
583
|
+
}
|
|
584
|
+
),
|
|
585
|
+
index < urls.length - 1 && /* @__PURE__ */ jsx8(BreadcrumbSeparator, { children: /* @__PURE__ */ jsx8(Slash, { className: "!h-md !w-md" }) })
|
|
586
|
+
] }, index);
|
|
587
|
+
})
|
|
588
|
+
] }) });
|
|
589
|
+
};
|
|
590
|
+
var breadcrumb_default = CustomBreadcrumb;
|
|
591
|
+
|
|
592
|
+
// src/components/custom/navbar/menuList.tsx
|
|
593
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
440
594
|
function DesktopNavbar({
|
|
441
595
|
navbarData,
|
|
442
596
|
userData,
|
|
443
597
|
onLogout
|
|
444
598
|
}) {
|
|
445
|
-
return /* @__PURE__ */
|
|
446
|
-
/* @__PURE__ */
|
|
447
|
-
/* @__PURE__ */
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
599
|
+
return /* @__PURE__ */ jsxs7("nav", { className: "", children: [
|
|
600
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex justify-between px-10 py-2 bg-card items-center border-b-1", children: [
|
|
601
|
+
/* @__PURE__ */ jsxs7("div", { className: "left flex gap-4 items-center", children: [
|
|
602
|
+
/* @__PURE__ */ jsx9(Image2, { src: sidebarIcon_default, alt: "Logo", width: 72, height: 18 }),
|
|
603
|
+
Object.keys(navbarData).map((menuKey) => {
|
|
604
|
+
const value = navbarData[menuKey];
|
|
605
|
+
if (typeof value === "string") return null;
|
|
606
|
+
return /* @__PURE__ */ jsx9(
|
|
607
|
+
MenuList,
|
|
608
|
+
{
|
|
609
|
+
menuKey,
|
|
610
|
+
menuData: value
|
|
611
|
+
},
|
|
612
|
+
menuKey
|
|
613
|
+
);
|
|
614
|
+
})
|
|
615
|
+
] }),
|
|
616
|
+
/* @__PURE__ */ jsx9(user_default2, { userData, onLogout })
|
|
456
617
|
] }),
|
|
457
|
-
/* @__PURE__ */
|
|
458
|
-
] })
|
|
618
|
+
/* @__PURE__ */ jsx9("div", { className: "px-10 py-2", children: /* @__PURE__ */ jsx9(breadcrumb_default, { layoutName: "Navbar Links", includeFrom: 1 }) })
|
|
619
|
+
] });
|
|
459
620
|
}
|
|
460
621
|
|
|
461
622
|
// src/components/custom/navbar/mobileNavbar.tsx
|
|
@@ -464,21 +625,21 @@ import Image3 from "next/image";
|
|
|
464
625
|
|
|
465
626
|
// src/components/ui/sidebar.tsx
|
|
466
627
|
import * as React2 from "react";
|
|
467
|
-
import { Slot as
|
|
628
|
+
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
468
629
|
import { cva as cva2 } from "class-variance-authority";
|
|
469
630
|
import { Menu as Menu2, X } from "lucide-react";
|
|
470
631
|
|
|
471
632
|
// src/components/ui/sheet.tsx
|
|
472
633
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
473
634
|
import { XIcon } from "lucide-react";
|
|
474
|
-
import { jsx as
|
|
635
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
475
636
|
function Sheet(_a) {
|
|
476
637
|
var props = __objRest(_a, []);
|
|
477
|
-
return /* @__PURE__ */
|
|
638
|
+
return /* @__PURE__ */ jsx10(SheetPrimitive.Root, __spreadValues({ "data-slot": "sheet" }, props));
|
|
478
639
|
}
|
|
479
640
|
function SheetPortal(_a) {
|
|
480
641
|
var props = __objRest(_a, []);
|
|
481
|
-
return /* @__PURE__ */
|
|
642
|
+
return /* @__PURE__ */ jsx10(SheetPrimitive.Portal, __spreadValues({ "data-slot": "sheet-portal" }, props));
|
|
482
643
|
}
|
|
483
644
|
function SheetOverlay(_a) {
|
|
484
645
|
var _b = _a, {
|
|
@@ -486,7 +647,7 @@ function SheetOverlay(_a) {
|
|
|
486
647
|
} = _b, props = __objRest(_b, [
|
|
487
648
|
"className"
|
|
488
649
|
]);
|
|
489
|
-
return /* @__PURE__ */
|
|
650
|
+
return /* @__PURE__ */ jsx10(
|
|
490
651
|
SheetPrimitive.Overlay,
|
|
491
652
|
__spreadValues({
|
|
492
653
|
"data-slot": "sheet-overlay",
|
|
@@ -507,9 +668,9 @@ function SheetContent(_a) {
|
|
|
507
668
|
"children",
|
|
508
669
|
"side"
|
|
509
670
|
]);
|
|
510
|
-
return /* @__PURE__ */
|
|
511
|
-
/* @__PURE__ */
|
|
512
|
-
/* @__PURE__ */
|
|
671
|
+
return /* @__PURE__ */ jsxs8(SheetPortal, { children: [
|
|
672
|
+
/* @__PURE__ */ jsx10(SheetOverlay, {}),
|
|
673
|
+
/* @__PURE__ */ jsxs8(
|
|
513
674
|
SheetPrimitive.Content,
|
|
514
675
|
__spreadProps(__spreadValues({
|
|
515
676
|
"data-slot": "sheet-content",
|
|
@@ -524,9 +685,9 @@ function SheetContent(_a) {
|
|
|
524
685
|
}, props), {
|
|
525
686
|
children: [
|
|
526
687
|
children,
|
|
527
|
-
/* @__PURE__ */
|
|
528
|
-
/* @__PURE__ */
|
|
529
|
-
/* @__PURE__ */
|
|
688
|
+
/* @__PURE__ */ jsxs8(SheetPrimitive.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
|
|
689
|
+
/* @__PURE__ */ jsx10(XIcon, { className: "size-4" }),
|
|
690
|
+
/* @__PURE__ */ jsx10("span", { className: "sr-only", children: "Close" })
|
|
530
691
|
] })
|
|
531
692
|
]
|
|
532
693
|
})
|
|
@@ -535,7 +696,7 @@ function SheetContent(_a) {
|
|
|
535
696
|
}
|
|
536
697
|
function SheetHeader(_a) {
|
|
537
698
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
538
|
-
return /* @__PURE__ */
|
|
699
|
+
return /* @__PURE__ */ jsx10(
|
|
539
700
|
"div",
|
|
540
701
|
__spreadValues({
|
|
541
702
|
"data-slot": "sheet-header",
|
|
@@ -549,7 +710,7 @@ function SheetTitle(_a) {
|
|
|
549
710
|
} = _b, props = __objRest(_b, [
|
|
550
711
|
"className"
|
|
551
712
|
]);
|
|
552
|
-
return /* @__PURE__ */
|
|
713
|
+
return /* @__PURE__ */ jsx10(
|
|
553
714
|
SheetPrimitive.Title,
|
|
554
715
|
__spreadValues({
|
|
555
716
|
"data-slot": "sheet-title",
|
|
@@ -563,7 +724,7 @@ function SheetDescription(_a) {
|
|
|
563
724
|
} = _b, props = __objRest(_b, [
|
|
564
725
|
"className"
|
|
565
726
|
]);
|
|
566
|
-
return /* @__PURE__ */
|
|
727
|
+
return /* @__PURE__ */ jsx10(
|
|
567
728
|
SheetPrimitive.Description,
|
|
568
729
|
__spreadValues({
|
|
569
730
|
"data-slot": "sheet-description",
|
|
@@ -574,14 +735,14 @@ function SheetDescription(_a) {
|
|
|
574
735
|
|
|
575
736
|
// src/components/ui/tooltip.tsx
|
|
576
737
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
577
|
-
import { jsx as
|
|
738
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
578
739
|
function TooltipProvider(_a) {
|
|
579
740
|
var _b = _a, {
|
|
580
741
|
delayDuration = 0
|
|
581
742
|
} = _b, props = __objRest(_b, [
|
|
582
743
|
"delayDuration"
|
|
583
744
|
]);
|
|
584
|
-
return /* @__PURE__ */
|
|
745
|
+
return /* @__PURE__ */ jsx11(
|
|
585
746
|
TooltipPrimitive.Provider,
|
|
586
747
|
__spreadValues({
|
|
587
748
|
"data-slot": "tooltip-provider",
|
|
@@ -591,11 +752,11 @@ function TooltipProvider(_a) {
|
|
|
591
752
|
}
|
|
592
753
|
function Tooltip(_a) {
|
|
593
754
|
var props = __objRest(_a, []);
|
|
594
|
-
return /* @__PURE__ */
|
|
755
|
+
return /* @__PURE__ */ jsx11(TooltipProvider, { children: /* @__PURE__ */ jsx11(TooltipPrimitive.Root, __spreadValues({ "data-slot": "tooltip" }, props)) });
|
|
595
756
|
}
|
|
596
757
|
function TooltipTrigger(_a) {
|
|
597
758
|
var props = __objRest(_a, []);
|
|
598
|
-
return /* @__PURE__ */
|
|
759
|
+
return /* @__PURE__ */ jsx11(TooltipPrimitive.Trigger, __spreadValues({ "data-slot": "tooltip-trigger" }, props));
|
|
599
760
|
}
|
|
600
761
|
function TooltipContent(_a) {
|
|
601
762
|
var _b = _a, {
|
|
@@ -607,7 +768,7 @@ function TooltipContent(_a) {
|
|
|
607
768
|
"sideOffset",
|
|
608
769
|
"children"
|
|
609
770
|
]);
|
|
610
|
-
return /* @__PURE__ */
|
|
771
|
+
return /* @__PURE__ */ jsx11(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs9(
|
|
611
772
|
TooltipPrimitive.Content,
|
|
612
773
|
__spreadProps(__spreadValues({
|
|
613
774
|
"data-slot": "tooltip-content",
|
|
@@ -619,14 +780,14 @@ function TooltipContent(_a) {
|
|
|
619
780
|
}, props), {
|
|
620
781
|
children: [
|
|
621
782
|
children,
|
|
622
|
-
/* @__PURE__ */
|
|
783
|
+
/* @__PURE__ */ jsx11(TooltipPrimitive.Arrow, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
|
|
623
784
|
]
|
|
624
785
|
})
|
|
625
786
|
) });
|
|
626
787
|
}
|
|
627
788
|
|
|
628
789
|
// src/components/ui/sidebar.tsx
|
|
629
|
-
import { jsx as
|
|
790
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
630
791
|
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
631
792
|
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
632
793
|
var SIDEBAR_WIDTH = "16rem";
|
|
@@ -707,7 +868,7 @@ function SidebarProvider(_a) {
|
|
|
707
868
|
toggleSidebar
|
|
708
869
|
]
|
|
709
870
|
);
|
|
710
|
-
return /* @__PURE__ */
|
|
871
|
+
return /* @__PURE__ */ jsx12(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx12(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx12(
|
|
711
872
|
"div",
|
|
712
873
|
__spreadProps(__spreadValues({
|
|
713
874
|
"data-slot": "sidebar-wrapper",
|
|
@@ -740,7 +901,7 @@ function Sidebar(_a) {
|
|
|
740
901
|
]);
|
|
741
902
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
742
903
|
if (collapsible === "none") {
|
|
743
|
-
return /* @__PURE__ */
|
|
904
|
+
return /* @__PURE__ */ jsx12(
|
|
744
905
|
"div",
|
|
745
906
|
__spreadProps(__spreadValues({
|
|
746
907
|
"data-slot": "sidebar",
|
|
@@ -754,7 +915,7 @@ function Sidebar(_a) {
|
|
|
754
915
|
);
|
|
755
916
|
}
|
|
756
917
|
if (isMobile) {
|
|
757
|
-
return /* @__PURE__ */
|
|
918
|
+
return /* @__PURE__ */ jsx12(Sheet, __spreadProps(__spreadValues({ open: openMobile, onOpenChange: setOpenMobile }, props), { children: /* @__PURE__ */ jsxs10(
|
|
758
919
|
SheetContent,
|
|
759
920
|
{
|
|
760
921
|
"data-sidebar": "sidebar",
|
|
@@ -766,16 +927,16 @@ function Sidebar(_a) {
|
|
|
766
927
|
},
|
|
767
928
|
side,
|
|
768
929
|
children: [
|
|
769
|
-
/* @__PURE__ */
|
|
770
|
-
/* @__PURE__ */
|
|
771
|
-
/* @__PURE__ */
|
|
930
|
+
/* @__PURE__ */ jsxs10(SheetHeader, { className: "sr-only", children: [
|
|
931
|
+
/* @__PURE__ */ jsx12(SheetTitle, { children: "Sidebar" }),
|
|
932
|
+
/* @__PURE__ */ jsx12(SheetDescription, { children: "Displays the mobile sidebar." })
|
|
772
933
|
] }),
|
|
773
|
-
/* @__PURE__ */
|
|
934
|
+
/* @__PURE__ */ jsx12("div", { className: "flex h-full w-full flex-col", children })
|
|
774
935
|
]
|
|
775
936
|
}
|
|
776
937
|
) }));
|
|
777
938
|
}
|
|
778
|
-
return /* @__PURE__ */
|
|
939
|
+
return /* @__PURE__ */ jsxs10(
|
|
779
940
|
"div",
|
|
780
941
|
{
|
|
781
942
|
className: "group peer text-sidebar-foreground hidden md:block",
|
|
@@ -785,7 +946,7 @@ function Sidebar(_a) {
|
|
|
785
946
|
"data-side": side,
|
|
786
947
|
"data-slot": "sidebar",
|
|
787
948
|
children: [
|
|
788
|
-
/* @__PURE__ */
|
|
949
|
+
/* @__PURE__ */ jsx12(
|
|
789
950
|
"div",
|
|
790
951
|
{
|
|
791
952
|
"data-slot": "sidebar-gap",
|
|
@@ -797,7 +958,7 @@ function Sidebar(_a) {
|
|
|
797
958
|
)
|
|
798
959
|
}
|
|
799
960
|
),
|
|
800
|
-
/* @__PURE__ */
|
|
961
|
+
/* @__PURE__ */ jsx12(
|
|
801
962
|
"div",
|
|
802
963
|
__spreadProps(__spreadValues({
|
|
803
964
|
"data-slot": "sidebar-container",
|
|
@@ -809,7 +970,7 @@ function Sidebar(_a) {
|
|
|
809
970
|
className
|
|
810
971
|
)
|
|
811
972
|
}, props), {
|
|
812
|
-
children: /* @__PURE__ */
|
|
973
|
+
children: /* @__PURE__ */ jsx12(
|
|
813
974
|
"div",
|
|
814
975
|
{
|
|
815
976
|
"data-sidebar": "sidebar",
|
|
@@ -833,7 +994,7 @@ function SidebarTrigger(_a) {
|
|
|
833
994
|
"onClick"
|
|
834
995
|
]);
|
|
835
996
|
const { toggleSidebar, openMobile } = useSidebar();
|
|
836
|
-
return /* @__PURE__ */
|
|
997
|
+
return /* @__PURE__ */ jsxs10(
|
|
837
998
|
"button",
|
|
838
999
|
__spreadProps(__spreadValues({
|
|
839
1000
|
"data-sidebar": "trigger",
|
|
@@ -848,15 +1009,15 @@ function SidebarTrigger(_a) {
|
|
|
848
1009
|
}
|
|
849
1010
|
}, props), {
|
|
850
1011
|
children: [
|
|
851
|
-
openMobile ? /* @__PURE__ */
|
|
852
|
-
/* @__PURE__ */
|
|
1012
|
+
openMobile ? /* @__PURE__ */ jsx12(X, { className: "size-[clamp(1.5rem,1.5rem,1.5rem)]" }) : /* @__PURE__ */ jsx12(Menu2, { className: "size-[clamp(1.5rem,1.5rem,1.5rem)]" }),
|
|
1013
|
+
/* @__PURE__ */ jsx12("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
853
1014
|
]
|
|
854
1015
|
})
|
|
855
1016
|
);
|
|
856
1017
|
}
|
|
857
1018
|
function SidebarInset(_a) {
|
|
858
1019
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
859
|
-
return /* @__PURE__ */
|
|
1020
|
+
return /* @__PURE__ */ jsx12(
|
|
860
1021
|
"main",
|
|
861
1022
|
__spreadValues({
|
|
862
1023
|
"data-slot": "sidebar-inset",
|
|
@@ -870,7 +1031,7 @@ function SidebarInset(_a) {
|
|
|
870
1031
|
}
|
|
871
1032
|
function SidebarContent(_a) {
|
|
872
1033
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
873
|
-
return /* @__PURE__ */
|
|
1034
|
+
return /* @__PURE__ */ jsx12(
|
|
874
1035
|
"div",
|
|
875
1036
|
__spreadValues({
|
|
876
1037
|
"data-slot": "sidebar-content",
|
|
@@ -884,7 +1045,7 @@ function SidebarContent(_a) {
|
|
|
884
1045
|
}
|
|
885
1046
|
function SidebarGroup(_a) {
|
|
886
1047
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
887
|
-
return /* @__PURE__ */
|
|
1048
|
+
return /* @__PURE__ */ jsx12(
|
|
888
1049
|
"div",
|
|
889
1050
|
__spreadValues({
|
|
890
1051
|
"data-slot": "sidebar-group",
|
|
@@ -898,7 +1059,7 @@ function SidebarGroup(_a) {
|
|
|
898
1059
|
}
|
|
899
1060
|
function SidebarMenu(_a) {
|
|
900
1061
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
901
|
-
return /* @__PURE__ */
|
|
1062
|
+
return /* @__PURE__ */ jsx12(
|
|
902
1063
|
"ul",
|
|
903
1064
|
__spreadValues({
|
|
904
1065
|
"data-slot": "sidebar-menu",
|
|
@@ -909,7 +1070,7 @@ function SidebarMenu(_a) {
|
|
|
909
1070
|
}
|
|
910
1071
|
function SidebarMenuItem(_a) {
|
|
911
1072
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
912
|
-
return /* @__PURE__ */
|
|
1073
|
+
return /* @__PURE__ */ jsx12(
|
|
913
1074
|
"li",
|
|
914
1075
|
__spreadValues({
|
|
915
1076
|
"data-slot": "sidebar-menu-item",
|
|
@@ -954,9 +1115,9 @@ function SidebarMenuButton(_a) {
|
|
|
954
1115
|
"tooltip",
|
|
955
1116
|
"className"
|
|
956
1117
|
]);
|
|
957
|
-
const Comp = asChild ?
|
|
1118
|
+
const Comp = asChild ? Slot3 : "button";
|
|
958
1119
|
const { isMobile, state } = useSidebar();
|
|
959
|
-
const button = /* @__PURE__ */
|
|
1120
|
+
const button = /* @__PURE__ */ jsx12(
|
|
960
1121
|
Comp,
|
|
961
1122
|
__spreadValues({
|
|
962
1123
|
"data-slot": "sidebar-menu-button",
|
|
@@ -977,9 +1138,9 @@ function SidebarMenuButton(_a) {
|
|
|
977
1138
|
children: tooltip
|
|
978
1139
|
};
|
|
979
1140
|
}
|
|
980
|
-
return /* @__PURE__ */
|
|
981
|
-
/* @__PURE__ */
|
|
982
|
-
/* @__PURE__ */
|
|
1141
|
+
return /* @__PURE__ */ jsxs10(Tooltip, { children: [
|
|
1142
|
+
/* @__PURE__ */ jsx12(TooltipTrigger, { asChild: true, children: button }),
|
|
1143
|
+
/* @__PURE__ */ jsx12(
|
|
983
1144
|
TooltipContent,
|
|
984
1145
|
__spreadValues({
|
|
985
1146
|
side: "right",
|
|
@@ -991,7 +1152,7 @@ function SidebarMenuButton(_a) {
|
|
|
991
1152
|
}
|
|
992
1153
|
function SidebarMenuSub(_a) {
|
|
993
1154
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
994
|
-
return /* @__PURE__ */
|
|
1155
|
+
return /* @__PURE__ */ jsx12(
|
|
995
1156
|
"ul",
|
|
996
1157
|
__spreadValues({
|
|
997
1158
|
"data-slot": "sidebar-menu-sub",
|
|
@@ -1010,7 +1171,7 @@ function SidebarMenuSubItem(_a) {
|
|
|
1010
1171
|
} = _b, props = __objRest(_b, [
|
|
1011
1172
|
"className"
|
|
1012
1173
|
]);
|
|
1013
|
-
return /* @__PURE__ */
|
|
1174
|
+
return /* @__PURE__ */ jsx12(
|
|
1014
1175
|
"li",
|
|
1015
1176
|
__spreadValues({
|
|
1016
1177
|
"data-slot": "sidebar-menu-sub-item",
|
|
@@ -1031,8 +1192,8 @@ function SidebarMenuSubButton(_a) {
|
|
|
1031
1192
|
"isActive",
|
|
1032
1193
|
"className"
|
|
1033
1194
|
]);
|
|
1034
|
-
const Comp = asChild ?
|
|
1035
|
-
return /* @__PURE__ */
|
|
1195
|
+
const Comp = asChild ? Slot3 : "a";
|
|
1196
|
+
return /* @__PURE__ */ jsx12(
|
|
1036
1197
|
Comp,
|
|
1037
1198
|
__spreadValues({
|
|
1038
1199
|
"data-slot": "sidebar-menu-sub-button",
|
|
@@ -1052,18 +1213,18 @@ function SidebarMenuSubButton(_a) {
|
|
|
1052
1213
|
}
|
|
1053
1214
|
|
|
1054
1215
|
// src/components/custom/navbar/nav-main.tsx
|
|
1055
|
-
import { ChevronRight, CornerDownRight } from "lucide-react";
|
|
1216
|
+
import { ChevronRight as ChevronRight2, CornerDownRight } from "lucide-react";
|
|
1056
1217
|
|
|
1057
1218
|
// src/components/ui/collapsible.tsx
|
|
1058
1219
|
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
1059
|
-
import { jsx as
|
|
1220
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1060
1221
|
function Collapsible(_a) {
|
|
1061
1222
|
var props = __objRest(_a, []);
|
|
1062
|
-
return /* @__PURE__ */
|
|
1223
|
+
return /* @__PURE__ */ jsx13(CollapsiblePrimitive.Root, __spreadValues({ "data-slot": "collapsible" }, props));
|
|
1063
1224
|
}
|
|
1064
1225
|
function CollapsibleTrigger2(_a) {
|
|
1065
1226
|
var props = __objRest(_a, []);
|
|
1066
|
-
return /* @__PURE__ */
|
|
1227
|
+
return /* @__PURE__ */ jsx13(
|
|
1067
1228
|
CollapsiblePrimitive.CollapsibleTrigger,
|
|
1068
1229
|
__spreadValues({
|
|
1069
1230
|
"data-slot": "collapsible-trigger"
|
|
@@ -1072,7 +1233,7 @@ function CollapsibleTrigger2(_a) {
|
|
|
1072
1233
|
}
|
|
1073
1234
|
function CollapsibleContent2(_a) {
|
|
1074
1235
|
var props = __objRest(_a, []);
|
|
1075
|
-
return /* @__PURE__ */
|
|
1236
|
+
return /* @__PURE__ */ jsx13(
|
|
1076
1237
|
CollapsiblePrimitive.CollapsibleContent,
|
|
1077
1238
|
__spreadValues({
|
|
1078
1239
|
"data-slot": "collapsible-content"
|
|
@@ -1081,30 +1242,30 @@ function CollapsibleContent2(_a) {
|
|
|
1081
1242
|
}
|
|
1082
1243
|
|
|
1083
1244
|
// src/components/custom/navbar/nav-main.tsx
|
|
1084
|
-
import { jsx as
|
|
1245
|
+
import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1085
1246
|
function NavMain({ items }) {
|
|
1086
|
-
return /* @__PURE__ */
|
|
1247
|
+
return /* @__PURE__ */ jsx14(SidebarGroup, { children: /* @__PURE__ */ jsx14(SidebarMenu, { children: renderMenu(items) }) });
|
|
1087
1248
|
}
|
|
1088
1249
|
function renderMenu(data) {
|
|
1089
1250
|
return Object.entries(data).map(([title, value]) => {
|
|
1090
1251
|
if (typeof value === "string") {
|
|
1091
|
-
return /* @__PURE__ */
|
|
1092
|
-
/* @__PURE__ */
|
|
1093
|
-
/* @__PURE__ */
|
|
1252
|
+
return /* @__PURE__ */ jsx14(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx14(SidebarMenuSubButton, { asChild: true, children: /* @__PURE__ */ jsxs11("a", { href: `/${value}`, children: [
|
|
1253
|
+
/* @__PURE__ */ jsx14(CornerDownRight, {}),
|
|
1254
|
+
/* @__PURE__ */ jsx14("span", { className: "font-light text-sm", children: title })
|
|
1094
1255
|
] }) }) }, title);
|
|
1095
1256
|
}
|
|
1096
|
-
return /* @__PURE__ */
|
|
1257
|
+
return /* @__PURE__ */ jsx14(
|
|
1097
1258
|
Collapsible,
|
|
1098
1259
|
{
|
|
1099
1260
|
asChild: true,
|
|
1100
1261
|
defaultOpen: false,
|
|
1101
1262
|
className: "group/collapsible group-data-[state=open]:bg-sidebar-accent group-data-[state=open]:text-sidebar-accent-foreground",
|
|
1102
|
-
children: /* @__PURE__ */
|
|
1103
|
-
/* @__PURE__ */
|
|
1104
|
-
/* @__PURE__ */
|
|
1105
|
-
/* @__PURE__ */
|
|
1263
|
+
children: /* @__PURE__ */ jsxs11(SidebarMenuItem, { children: [
|
|
1264
|
+
/* @__PURE__ */ jsx14(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs11(SidebarMenuButton, { tooltip: title, children: [
|
|
1265
|
+
/* @__PURE__ */ jsx14("span", { className: "font-medium text-lg", children: title }),
|
|
1266
|
+
/* @__PURE__ */ jsx14(ChevronRight2, { className: "ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })
|
|
1106
1267
|
] }) }),
|
|
1107
|
-
/* @__PURE__ */
|
|
1268
|
+
/* @__PURE__ */ jsx14(CollapsibleContent2, { children: /* @__PURE__ */ jsx14(SidebarMenuSub, { children: renderMenu(value) }) })
|
|
1108
1269
|
] })
|
|
1109
1270
|
},
|
|
1110
1271
|
title
|
|
@@ -1113,32 +1274,32 @@ function renderMenu(data) {
|
|
|
1113
1274
|
}
|
|
1114
1275
|
|
|
1115
1276
|
// src/components/custom/navbar/app-sidebar.tsx
|
|
1116
|
-
import { jsx as
|
|
1277
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1117
1278
|
function AppSidebar(_a) {
|
|
1118
1279
|
var _b = _a, { data } = _b, props = __objRest(_b, ["data"]);
|
|
1119
|
-
return /* @__PURE__ */
|
|
1280
|
+
return /* @__PURE__ */ jsx15(Sidebar, __spreadProps(__spreadValues({ collapsible: "icon" }, props), { children: /* @__PURE__ */ jsx15(SidebarContent, { children: /* @__PURE__ */ jsx15(NavMain, { items: data }) }) }));
|
|
1120
1281
|
}
|
|
1121
1282
|
|
|
1122
1283
|
// src/components/custom/navbar/mobileNavbar.tsx
|
|
1123
|
-
import { jsx as
|
|
1284
|
+
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1124
1285
|
function MobileNavbar({
|
|
1125
1286
|
navbarData,
|
|
1126
1287
|
userData,
|
|
1127
1288
|
onLogout
|
|
1128
1289
|
}) {
|
|
1129
1290
|
const safeData = navbarData || {};
|
|
1130
|
-
return /* @__PURE__ */
|
|
1131
|
-
/* @__PURE__ */
|
|
1132
|
-
/* @__PURE__ */
|
|
1133
|
-
/* @__PURE__ */
|
|
1134
|
-
/* @__PURE__ */
|
|
1291
|
+
return /* @__PURE__ */ jsxs12(SidebarProvider, { className: "relative w-full", children: [
|
|
1292
|
+
/* @__PURE__ */ jsxs12("header", { className: "fixed top-0 left-0 right-0 z-50 flex bg-card h-12 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12 justify-between px-4 w-full border-b-1", children: [
|
|
1293
|
+
/* @__PURE__ */ jsx16(SidebarTrigger, {}),
|
|
1294
|
+
/* @__PURE__ */ jsx16(Link, { href: "/", children: /* @__PURE__ */ jsx16(Image3, { src: sidebarIcon_default, alt: "Logo", width: 72, height: 18 }) }),
|
|
1295
|
+
/* @__PURE__ */ jsx16(user_default2, { userData, onLogout })
|
|
1135
1296
|
] }),
|
|
1136
|
-
/* @__PURE__ */
|
|
1297
|
+
/* @__PURE__ */ jsx16(SidebarInset, { className: "pt-12", children: /* @__PURE__ */ jsx16(AppSidebar, { data: safeData }) })
|
|
1137
1298
|
] });
|
|
1138
1299
|
}
|
|
1139
1300
|
|
|
1140
1301
|
// src/components/custom/navbar/navbar.tsx
|
|
1141
|
-
import { Fragment as Fragment2, jsx as
|
|
1302
|
+
import { Fragment as Fragment2, jsx as jsx17 } from "react/jsx-runtime";
|
|
1142
1303
|
function Navbar({
|
|
1143
1304
|
navbarData,
|
|
1144
1305
|
userData,
|
|
@@ -1150,14 +1311,14 @@ function Navbar({
|
|
|
1150
1311
|
setMounted(true);
|
|
1151
1312
|
}, []);
|
|
1152
1313
|
if (!mounted) return null;
|
|
1153
|
-
return /* @__PURE__ */
|
|
1314
|
+
return /* @__PURE__ */ jsx17(Fragment2, { children: isMobile ? /* @__PURE__ */ jsx17(
|
|
1154
1315
|
MobileNavbar,
|
|
1155
1316
|
{
|
|
1156
1317
|
navbarData,
|
|
1157
1318
|
userData,
|
|
1158
1319
|
onLogout
|
|
1159
1320
|
}
|
|
1160
|
-
) : /* @__PURE__ */
|
|
1321
|
+
) : /* @__PURE__ */ jsx17(
|
|
1161
1322
|
DesktopNavbar,
|
|
1162
1323
|
{
|
|
1163
1324
|
navbarData,
|