baaz-custom-components 3.2.10 → 3.2.12
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 +7 -0
- package/dist/index.js +207 -140
- package/dist/index.mjs +188 -121
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -738,12 +738,13 @@ function buildFullHref(base, child) {
|
|
|
738
738
|
return new URL(child, base).toString();
|
|
739
739
|
}
|
|
740
740
|
function isRouteActive(fullHref, currentPathname) {
|
|
741
|
-
const
|
|
741
|
+
const hrefPathRaw = extractPathname(fullHref);
|
|
742
742
|
const hrefOrigin = extractOrigin(fullHref);
|
|
743
743
|
const currentOrigin = getCurrentOrigin();
|
|
744
744
|
if (hrefOrigin && currentOrigin && hrefOrigin !== currentOrigin) {
|
|
745
745
|
return false;
|
|
746
746
|
}
|
|
747
|
+
const hrefPath = hrefPathRaw.endsWith("/-") ? hrefPathRaw.slice(0, -2) : hrefPathRaw;
|
|
747
748
|
return currentPathname === hrefPath || currentPathname.startsWith(hrefPath + "/");
|
|
748
749
|
}
|
|
749
750
|
function treeContainsPath({
|
|
@@ -782,9 +783,63 @@ function treeContainsPath({
|
|
|
782
783
|
}
|
|
783
784
|
return false;
|
|
784
785
|
}
|
|
786
|
+
function getDeepestActiveChildren(data, base, pathname) {
|
|
787
|
+
let result = null;
|
|
788
|
+
function dfs(routes, parentBase) {
|
|
789
|
+
for (const node of routes) {
|
|
790
|
+
if (typeof node.routes === "string") {
|
|
791
|
+
const full = buildFullHref(parentBase, node.routes);
|
|
792
|
+
let hrefPath = extractPathname(full);
|
|
793
|
+
if (hrefPath.endsWith("/-")) hrefPath = hrefPath.slice(0, -2);
|
|
794
|
+
if (pathname === hrefPath || pathname.startsWith(hrefPath + "/")) {
|
|
795
|
+
}
|
|
796
|
+
} else {
|
|
797
|
+
const firstChild = node.routes[0];
|
|
798
|
+
const maybePath = typeof firstChild.routes === "string" ? firstChild.routes : "";
|
|
799
|
+
const full = buildFullHref(parentBase, maybePath);
|
|
800
|
+
let hrefPath = extractPathname(full);
|
|
801
|
+
if (hrefPath.endsWith("/-")) hrefPath = hrefPath.slice(0, -2);
|
|
802
|
+
if (pathname.startsWith(hrefPath)) {
|
|
803
|
+
result = { base: parentBase, children: node.routes };
|
|
804
|
+
dfs(node.routes, parentBase);
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
dfs(data, base);
|
|
810
|
+
return result;
|
|
811
|
+
}
|
|
785
812
|
|
|
786
|
-
// src/components/custom/navbar/
|
|
813
|
+
// src/components/custom/navbar/sub-nav.tsx
|
|
787
814
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
815
|
+
function SubNav({
|
|
816
|
+
base,
|
|
817
|
+
childrenRoutes,
|
|
818
|
+
router
|
|
819
|
+
}) {
|
|
820
|
+
const pathname = typeof window !== "undefined" ? window.location.pathname : "";
|
|
821
|
+
if (!childrenRoutes || childrenRoutes.length === 0) return null;
|
|
822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "bg-transparent border rounded-md px-2 py-1 shadow-lg flex gap-2", children: childrenRoutes.map((child) => {
|
|
823
|
+
if (typeof child.routes !== "string") return null;
|
|
824
|
+
const href = buildFullHref(base, child.routes);
|
|
825
|
+
const active = isRouteActive(href, pathname);
|
|
826
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
827
|
+
"button",
|
|
828
|
+
{
|
|
829
|
+
onClick: () => router.push(href),
|
|
830
|
+
className: cn(
|
|
831
|
+
"px-3 py-1 text-sm rounded-md whitespace-nowrap cursor-pointer",
|
|
832
|
+
active ? "bg-accent text-accent-foreground" : "text-muted-foreground hover:bg-primary"
|
|
833
|
+
),
|
|
834
|
+
children: child.label
|
|
835
|
+
},
|
|
836
|
+
child.label
|
|
837
|
+
);
|
|
838
|
+
}) });
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
// src/components/custom/navbar/customMenu.tsx
|
|
842
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
788
843
|
function isLeaf(value) {
|
|
789
844
|
return typeof value === "string";
|
|
790
845
|
}
|
|
@@ -793,11 +848,11 @@ function MenuItems({
|
|
|
793
848
|
base,
|
|
794
849
|
router
|
|
795
850
|
}) {
|
|
796
|
-
return /* @__PURE__ */ (0,
|
|
851
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: data.map((value) => {
|
|
797
852
|
if (isLeaf(value.routes)) {
|
|
798
853
|
const fullPath = buildFullHref(base, value.routes);
|
|
799
854
|
const active = isRouteActive(fullPath, router.pathname);
|
|
800
|
-
return /* @__PURE__ */ (0,
|
|
855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
801
856
|
MenubarItem,
|
|
802
857
|
{
|
|
803
858
|
onClick: () => router.push(fullPath),
|
|
@@ -815,8 +870,8 @@ function MenuItems({
|
|
|
815
870
|
base,
|
|
816
871
|
pathname: router.pathname
|
|
817
872
|
});
|
|
818
|
-
return /* @__PURE__ */ (0,
|
|
819
|
-
/* @__PURE__ */ (0,
|
|
873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(MenubarSub, { children: [
|
|
874
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
820
875
|
MenubarSubTrigger,
|
|
821
876
|
{
|
|
822
877
|
className: cn(
|
|
@@ -825,7 +880,7 @@ function MenuItems({
|
|
|
825
880
|
children: value.label
|
|
826
881
|
}
|
|
827
882
|
),
|
|
828
|
-
/* @__PURE__ */ (0,
|
|
883
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MenubarSubContent, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
829
884
|
MenuItems,
|
|
830
885
|
{
|
|
831
886
|
data: value.routes,
|
|
@@ -841,56 +896,68 @@ function MenuList({
|
|
|
841
896
|
router
|
|
842
897
|
}) {
|
|
843
898
|
const { name, url, routes } = entry;
|
|
899
|
+
const pathname = router.pathname;
|
|
844
900
|
const isGroupActive = treeContainsPath({
|
|
845
901
|
data: routes,
|
|
846
902
|
base: url,
|
|
847
|
-
pathname
|
|
903
|
+
pathname
|
|
848
904
|
});
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
905
|
+
const sub = getDeepestActiveChildren(routes, url, pathname);
|
|
906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "relative inline-block", children: [
|
|
907
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Menubar, { className: "bg-transparent border-none", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(MenubarMenu, { children: [
|
|
908
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
909
|
+
MenubarTrigger,
|
|
910
|
+
{
|
|
911
|
+
className: cn(
|
|
912
|
+
"cursor-pointer group inline-flex items-center",
|
|
913
|
+
isGroupActive && "bg-accent text-accent-foreground"
|
|
914
|
+
),
|
|
915
|
+
children: [
|
|
916
|
+
name,
|
|
917
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react5.ChevronDown, { size: 16, className: "ml-1 inline-block" })
|
|
918
|
+
]
|
|
919
|
+
}
|
|
920
|
+
),
|
|
921
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MenubarContent, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MenuItems, { data: routes, base: url, router }) })
|
|
922
|
+
] }) }),
|
|
923
|
+
sub ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "absolute left-0 top-12 z-40", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
924
|
+
SubNav,
|
|
852
925
|
{
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
),
|
|
857
|
-
children: [
|
|
858
|
-
name,
|
|
859
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react5.ChevronDown, { size: 16, className: "ml-1 inline-block" })
|
|
860
|
-
]
|
|
926
|
+
base: sub.base,
|
|
927
|
+
childrenRoutes: sub.children,
|
|
928
|
+
router
|
|
861
929
|
}
|
|
862
|
-
)
|
|
863
|
-
|
|
864
|
-
] }) });
|
|
930
|
+
) }) : null
|
|
931
|
+
] });
|
|
865
932
|
}
|
|
866
933
|
|
|
867
934
|
// src/components/custom/navbar/notifications.tsx
|
|
868
935
|
var import_lucide_react6 = require("lucide-react");
|
|
869
|
-
var
|
|
936
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
870
937
|
var Notifications = ({
|
|
871
938
|
notificationData,
|
|
872
939
|
notificationHandler
|
|
873
940
|
}) => {
|
|
874
|
-
return /* @__PURE__ */ (0,
|
|
875
|
-
/* @__PURE__ */ (0,
|
|
876
|
-
/* @__PURE__ */ (0,
|
|
941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(DropdownMenu, { onOpenChange: (open) => open && notificationHandler(), children: [
|
|
942
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DropdownMenuTrigger, { className: "cursor-pointer", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react6.BellDot, { size: 24 }) }),
|
|
943
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
877
944
|
DropdownMenuContent,
|
|
878
945
|
{
|
|
879
946
|
className: "w-80 h-96 bg-card-foreground",
|
|
880
947
|
align: "start",
|
|
881
|
-
children: /* @__PURE__ */ (0,
|
|
882
|
-
/* @__PURE__ */ (0,
|
|
883
|
-
/* @__PURE__ */ (0,
|
|
884
|
-
/* @__PURE__ */ (0,
|
|
885
|
-
/* @__PURE__ */ (0,
|
|
886
|
-
/* @__PURE__ */ (0,
|
|
887
|
-
/* @__PURE__ */ (0,
|
|
888
|
-
/* @__PURE__ */ (0,
|
|
889
|
-
/* @__PURE__ */ (0,
|
|
890
|
-
/* @__PURE__ */ (0,
|
|
948
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ScrollArea, { className: "w-full h-full", children: (notificationData == null ? void 0 : notificationData.length) == 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h1", { className: "text-center flex items-center justify-center h-80 w-full", children: "No Notifications" }) : notificationData == null ? void 0 : notificationData.map((data, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
|
|
949
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex py-4 px-5 gap-6", children: [
|
|
950
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "w-3 h-3 mt-2 bg-accent rounded-full flex-shrink-0" }),
|
|
951
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: " flex gap-2 flex-col text-sm", children: [
|
|
952
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h2", { className: "font-semibold text-base", children: data == null ? void 0 : data.topic }),
|
|
953
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h3", { children: data == null ? void 0 : data.heading }),
|
|
954
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h2", { children: data == null ? void 0 : data.trail }),
|
|
955
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h1", { className: " bg-background rounded-sm p-2", children: data == null ? void 0 : data.body }),
|
|
956
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h3", { className: "bg-white/10 rounded-sm p-1 px-3 w-fit text-md font-semibold text-accent tracking-[0.25rem]", children: data == null ? void 0 : data.otp }),
|
|
957
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h4", { className: "text-xs", children: formatDateAndTime(data == null ? void 0 : data.time) })
|
|
891
958
|
] })
|
|
892
959
|
] }),
|
|
893
|
-
index < (notificationData == null ? void 0 : notificationData.length) - 1 && /* @__PURE__ */ (0,
|
|
960
|
+
index < (notificationData == null ? void 0 : notificationData.length) - 1 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Separator2, { className: "my-2" })
|
|
894
961
|
] }, data.otp)) })
|
|
895
962
|
}
|
|
896
963
|
)
|
|
@@ -899,7 +966,7 @@ var Notifications = ({
|
|
|
899
966
|
var notifications_default = Notifications;
|
|
900
967
|
|
|
901
968
|
// src/components/custom/navbar/desktopNavbar.tsx
|
|
902
|
-
var
|
|
969
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
903
970
|
function DesktopNavbar({
|
|
904
971
|
navbarData,
|
|
905
972
|
userData,
|
|
@@ -911,9 +978,9 @@ function DesktopNavbar({
|
|
|
911
978
|
hubIdEnable,
|
|
912
979
|
hubIdChangeHandler
|
|
913
980
|
}) {
|
|
914
|
-
return /* @__PURE__ */ (0,
|
|
915
|
-
/* @__PURE__ */ (0,
|
|
916
|
-
/* @__PURE__ */ (0,
|
|
981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("nav", { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex justify-between px-10 py-2 bg-card items-center border-b-1", children: [
|
|
982
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "left flex gap-4 items-center", children: [
|
|
983
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
917
984
|
"img",
|
|
918
985
|
{
|
|
919
986
|
src: sidebarIcon_default.src || sidebarIcon_default,
|
|
@@ -922,7 +989,7 @@ function DesktopNavbar({
|
|
|
922
989
|
height: 18
|
|
923
990
|
}
|
|
924
991
|
),
|
|
925
|
-
navbarData == null ? void 0 : navbarData.map((entry) => /* @__PURE__ */ (0,
|
|
992
|
+
navbarData == null ? void 0 : navbarData.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
926
993
|
MenuList,
|
|
927
994
|
{
|
|
928
995
|
entry,
|
|
@@ -931,9 +998,9 @@ function DesktopNavbar({
|
|
|
931
998
|
entry.name
|
|
932
999
|
))
|
|
933
1000
|
] }),
|
|
934
|
-
/* @__PURE__ */ (0,
|
|
935
|
-
/* @__PURE__ */ (0,
|
|
936
|
-
/* @__PURE__ */ (0,
|
|
1001
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex gap-4 items-center", children: [
|
|
1002
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(notifications_default, { notificationData, notificationHandler }),
|
|
1003
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(user_default2, { userData, onLogout, hubIdChangeHandler, hubDetails, hubIdEnable })
|
|
937
1004
|
] })
|
|
938
1005
|
] }) });
|
|
939
1006
|
}
|
|
@@ -947,14 +1014,14 @@ var import_lucide_react8 = require("lucide-react");
|
|
|
947
1014
|
// src/components/ui/sheet.tsx
|
|
948
1015
|
var SheetPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
949
1016
|
var import_lucide_react7 = require("lucide-react");
|
|
950
|
-
var
|
|
1017
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
951
1018
|
function Sheet(_a) {
|
|
952
1019
|
var props = __objRest(_a, []);
|
|
953
|
-
return /* @__PURE__ */ (0,
|
|
1020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SheetPrimitive.Root, __spreadValues({ "data-slot": "sheet" }, props));
|
|
954
1021
|
}
|
|
955
1022
|
function SheetPortal(_a) {
|
|
956
1023
|
var props = __objRest(_a, []);
|
|
957
|
-
return /* @__PURE__ */ (0,
|
|
1024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SheetPrimitive.Portal, __spreadValues({ "data-slot": "sheet-portal" }, props));
|
|
958
1025
|
}
|
|
959
1026
|
function SheetOverlay(_a) {
|
|
960
1027
|
var _b = _a, {
|
|
@@ -962,7 +1029,7 @@ function SheetOverlay(_a) {
|
|
|
962
1029
|
} = _b, props = __objRest(_b, [
|
|
963
1030
|
"className"
|
|
964
1031
|
]);
|
|
965
|
-
return /* @__PURE__ */ (0,
|
|
1032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
966
1033
|
SheetPrimitive.Overlay,
|
|
967
1034
|
__spreadValues({
|
|
968
1035
|
"data-slot": "sheet-overlay",
|
|
@@ -983,9 +1050,9 @@ function SheetContent(_a) {
|
|
|
983
1050
|
"children",
|
|
984
1051
|
"side"
|
|
985
1052
|
]);
|
|
986
|
-
return /* @__PURE__ */ (0,
|
|
987
|
-
/* @__PURE__ */ (0,
|
|
988
|
-
/* @__PURE__ */ (0,
|
|
1053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(SheetPortal, { children: [
|
|
1054
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SheetOverlay, {}),
|
|
1055
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
989
1056
|
SheetPrimitive.Content,
|
|
990
1057
|
__spreadProps(__spreadValues({
|
|
991
1058
|
"data-slot": "sheet-content",
|
|
@@ -1000,9 +1067,9 @@ function SheetContent(_a) {
|
|
|
1000
1067
|
}, props), {
|
|
1001
1068
|
children: [
|
|
1002
1069
|
children,
|
|
1003
|
-
/* @__PURE__ */ (0,
|
|
1004
|
-
/* @__PURE__ */ (0,
|
|
1005
|
-
/* @__PURE__ */ (0,
|
|
1070
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(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: [
|
|
1071
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.XIcon, { className: "size-4" }),
|
|
1072
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sr-only", children: "Close" })
|
|
1006
1073
|
] })
|
|
1007
1074
|
]
|
|
1008
1075
|
})
|
|
@@ -1011,7 +1078,7 @@ function SheetContent(_a) {
|
|
|
1011
1078
|
}
|
|
1012
1079
|
function SheetHeader(_a) {
|
|
1013
1080
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1014
|
-
return /* @__PURE__ */ (0,
|
|
1081
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1015
1082
|
"div",
|
|
1016
1083
|
__spreadValues({
|
|
1017
1084
|
"data-slot": "sheet-header",
|
|
@@ -1025,7 +1092,7 @@ function SheetTitle(_a) {
|
|
|
1025
1092
|
} = _b, props = __objRest(_b, [
|
|
1026
1093
|
"className"
|
|
1027
1094
|
]);
|
|
1028
|
-
return /* @__PURE__ */ (0,
|
|
1095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1029
1096
|
SheetPrimitive.Title,
|
|
1030
1097
|
__spreadValues({
|
|
1031
1098
|
"data-slot": "sheet-title",
|
|
@@ -1039,7 +1106,7 @@ function SheetDescription(_a) {
|
|
|
1039
1106
|
} = _b, props = __objRest(_b, [
|
|
1040
1107
|
"className"
|
|
1041
1108
|
]);
|
|
1042
|
-
return /* @__PURE__ */ (0,
|
|
1109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1043
1110
|
SheetPrimitive.Description,
|
|
1044
1111
|
__spreadValues({
|
|
1045
1112
|
"data-slot": "sheet-description",
|
|
@@ -1050,14 +1117,14 @@ function SheetDescription(_a) {
|
|
|
1050
1117
|
|
|
1051
1118
|
// src/components/ui/tooltip.tsx
|
|
1052
1119
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
1053
|
-
var
|
|
1120
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1054
1121
|
function TooltipProvider(_a) {
|
|
1055
1122
|
var _b = _a, {
|
|
1056
1123
|
delayDuration = 0
|
|
1057
1124
|
} = _b, props = __objRest(_b, [
|
|
1058
1125
|
"delayDuration"
|
|
1059
1126
|
]);
|
|
1060
|
-
return /* @__PURE__ */ (0,
|
|
1127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1061
1128
|
TooltipPrimitive.Provider,
|
|
1062
1129
|
__spreadValues({
|
|
1063
1130
|
"data-slot": "tooltip-provider",
|
|
@@ -1067,11 +1134,11 @@ function TooltipProvider(_a) {
|
|
|
1067
1134
|
}
|
|
1068
1135
|
function Tooltip(_a) {
|
|
1069
1136
|
var props = __objRest(_a, []);
|
|
1070
|
-
return /* @__PURE__ */ (0,
|
|
1137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TooltipPrimitive.Root, __spreadValues({ "data-slot": "tooltip" }, props)) });
|
|
1071
1138
|
}
|
|
1072
1139
|
function TooltipTrigger(_a) {
|
|
1073
1140
|
var props = __objRest(_a, []);
|
|
1074
|
-
return /* @__PURE__ */ (0,
|
|
1141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TooltipPrimitive.Trigger, __spreadValues({ "data-slot": "tooltip-trigger" }, props));
|
|
1075
1142
|
}
|
|
1076
1143
|
function TooltipContent(_a) {
|
|
1077
1144
|
var _b = _a, {
|
|
@@ -1083,7 +1150,7 @@ function TooltipContent(_a) {
|
|
|
1083
1150
|
"sideOffset",
|
|
1084
1151
|
"children"
|
|
1085
1152
|
]);
|
|
1086
|
-
return /* @__PURE__ */ (0,
|
|
1153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1087
1154
|
TooltipPrimitive.Content,
|
|
1088
1155
|
__spreadProps(__spreadValues({
|
|
1089
1156
|
"data-slot": "tooltip-content",
|
|
@@ -1095,14 +1162,14 @@ function TooltipContent(_a) {
|
|
|
1095
1162
|
}, props), {
|
|
1096
1163
|
children: [
|
|
1097
1164
|
children,
|
|
1098
|
-
/* @__PURE__ */ (0,
|
|
1165
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TooltipPrimitive.Arrow, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
|
|
1099
1166
|
]
|
|
1100
1167
|
})
|
|
1101
1168
|
) });
|
|
1102
1169
|
}
|
|
1103
1170
|
|
|
1104
1171
|
// src/components/ui/sidebar.tsx
|
|
1105
|
-
var
|
|
1172
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1106
1173
|
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
1107
1174
|
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
1108
1175
|
var SIDEBAR_WIDTH = "16rem";
|
|
@@ -1183,7 +1250,7 @@ function SidebarProvider(_a) {
|
|
|
1183
1250
|
toggleSidebar
|
|
1184
1251
|
]
|
|
1185
1252
|
);
|
|
1186
|
-
return /* @__PURE__ */ (0,
|
|
1253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1187
1254
|
"div",
|
|
1188
1255
|
__spreadProps(__spreadValues({
|
|
1189
1256
|
"data-slot": "sidebar-wrapper",
|
|
@@ -1216,7 +1283,7 @@ function Sidebar(_a) {
|
|
|
1216
1283
|
]);
|
|
1217
1284
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
1218
1285
|
if (collapsible === "none") {
|
|
1219
|
-
return /* @__PURE__ */ (0,
|
|
1286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1220
1287
|
"div",
|
|
1221
1288
|
__spreadProps(__spreadValues({
|
|
1222
1289
|
"data-slot": "sidebar",
|
|
@@ -1230,7 +1297,7 @@ function Sidebar(_a) {
|
|
|
1230
1297
|
);
|
|
1231
1298
|
}
|
|
1232
1299
|
if (isMobile) {
|
|
1233
|
-
return /* @__PURE__ */ (0,
|
|
1300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Sheet, __spreadProps(__spreadValues({ open: openMobile, onOpenChange: setOpenMobile }, props), { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1234
1301
|
SheetContent,
|
|
1235
1302
|
{
|
|
1236
1303
|
"data-sidebar": "sidebar",
|
|
@@ -1242,16 +1309,16 @@ function Sidebar(_a) {
|
|
|
1242
1309
|
},
|
|
1243
1310
|
side,
|
|
1244
1311
|
children: [
|
|
1245
|
-
/* @__PURE__ */ (0,
|
|
1246
|
-
/* @__PURE__ */ (0,
|
|
1247
|
-
/* @__PURE__ */ (0,
|
|
1312
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(SheetHeader, { className: "sr-only", children: [
|
|
1313
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SheetTitle, { children: "Sidebar" }),
|
|
1314
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SheetDescription, { children: "Displays the mobile sidebar." })
|
|
1248
1315
|
] }),
|
|
1249
|
-
/* @__PURE__ */ (0,
|
|
1316
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex h-full w-full flex-col", children })
|
|
1250
1317
|
]
|
|
1251
1318
|
}
|
|
1252
1319
|
) }));
|
|
1253
1320
|
}
|
|
1254
|
-
return /* @__PURE__ */ (0,
|
|
1321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1255
1322
|
"div",
|
|
1256
1323
|
{
|
|
1257
1324
|
className: "group peer text-sidebar-foreground hidden md:block",
|
|
@@ -1261,7 +1328,7 @@ function Sidebar(_a) {
|
|
|
1261
1328
|
"data-side": side,
|
|
1262
1329
|
"data-slot": "sidebar",
|
|
1263
1330
|
children: [
|
|
1264
|
-
/* @__PURE__ */ (0,
|
|
1331
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1265
1332
|
"div",
|
|
1266
1333
|
{
|
|
1267
1334
|
"data-slot": "sidebar-gap",
|
|
@@ -1273,7 +1340,7 @@ function Sidebar(_a) {
|
|
|
1273
1340
|
)
|
|
1274
1341
|
}
|
|
1275
1342
|
),
|
|
1276
|
-
/* @__PURE__ */ (0,
|
|
1343
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1277
1344
|
"div",
|
|
1278
1345
|
__spreadProps(__spreadValues({
|
|
1279
1346
|
"data-slot": "sidebar-container",
|
|
@@ -1285,7 +1352,7 @@ function Sidebar(_a) {
|
|
|
1285
1352
|
className
|
|
1286
1353
|
)
|
|
1287
1354
|
}, props), {
|
|
1288
|
-
children: /* @__PURE__ */ (0,
|
|
1355
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1289
1356
|
"div",
|
|
1290
1357
|
{
|
|
1291
1358
|
"data-sidebar": "sidebar",
|
|
@@ -1309,7 +1376,7 @@ function SidebarTrigger(_a) {
|
|
|
1309
1376
|
"onClick"
|
|
1310
1377
|
]);
|
|
1311
1378
|
const { toggleSidebar, openMobile } = useSidebar();
|
|
1312
|
-
return /* @__PURE__ */ (0,
|
|
1379
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1313
1380
|
"button",
|
|
1314
1381
|
__spreadProps(__spreadValues({
|
|
1315
1382
|
"data-sidebar": "trigger",
|
|
@@ -1324,15 +1391,15 @@ function SidebarTrigger(_a) {
|
|
|
1324
1391
|
}
|
|
1325
1392
|
}, props), {
|
|
1326
1393
|
children: [
|
|
1327
|
-
openMobile ? /* @__PURE__ */ (0,
|
|
1328
|
-
/* @__PURE__ */ (0,
|
|
1394
|
+
openMobile ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react8.X, { className: "size-[clamp(1.5rem,1.5rem,1.5rem)]" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react8.Menu, { className: "size-[clamp(1.5rem,1.5rem,1.5rem)]" }),
|
|
1395
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
1329
1396
|
]
|
|
1330
1397
|
})
|
|
1331
1398
|
);
|
|
1332
1399
|
}
|
|
1333
1400
|
function SidebarInset(_a) {
|
|
1334
1401
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1335
|
-
return /* @__PURE__ */ (0,
|
|
1402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1336
1403
|
"main",
|
|
1337
1404
|
__spreadValues({
|
|
1338
1405
|
"data-slot": "sidebar-inset",
|
|
@@ -1346,7 +1413,7 @@ function SidebarInset(_a) {
|
|
|
1346
1413
|
}
|
|
1347
1414
|
function SidebarContent(_a) {
|
|
1348
1415
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1349
|
-
return /* @__PURE__ */ (0,
|
|
1416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1350
1417
|
"div",
|
|
1351
1418
|
__spreadValues({
|
|
1352
1419
|
"data-slot": "sidebar-content",
|
|
@@ -1360,7 +1427,7 @@ function SidebarContent(_a) {
|
|
|
1360
1427
|
}
|
|
1361
1428
|
function SidebarGroup(_a) {
|
|
1362
1429
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1363
|
-
return /* @__PURE__ */ (0,
|
|
1430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1364
1431
|
"div",
|
|
1365
1432
|
__spreadValues({
|
|
1366
1433
|
"data-slot": "sidebar-group",
|
|
@@ -1374,7 +1441,7 @@ function SidebarGroup(_a) {
|
|
|
1374
1441
|
}
|
|
1375
1442
|
function SidebarMenu(_a) {
|
|
1376
1443
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1377
|
-
return /* @__PURE__ */ (0,
|
|
1444
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1378
1445
|
"ul",
|
|
1379
1446
|
__spreadValues({
|
|
1380
1447
|
"data-slot": "sidebar-menu",
|
|
@@ -1385,7 +1452,7 @@ function SidebarMenu(_a) {
|
|
|
1385
1452
|
}
|
|
1386
1453
|
function SidebarMenuItem(_a) {
|
|
1387
1454
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1388
|
-
return /* @__PURE__ */ (0,
|
|
1455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1389
1456
|
"li",
|
|
1390
1457
|
__spreadValues({
|
|
1391
1458
|
"data-slot": "sidebar-menu-item",
|
|
@@ -1432,7 +1499,7 @@ function SidebarMenuButton(_a) {
|
|
|
1432
1499
|
]);
|
|
1433
1500
|
const Comp = asChild ? import_react_slot2.Slot : "button";
|
|
1434
1501
|
const { isMobile, state } = useSidebar();
|
|
1435
|
-
const button = /* @__PURE__ */ (0,
|
|
1502
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1436
1503
|
Comp,
|
|
1437
1504
|
__spreadValues({
|
|
1438
1505
|
"data-slot": "sidebar-menu-button",
|
|
@@ -1453,9 +1520,9 @@ function SidebarMenuButton(_a) {
|
|
|
1453
1520
|
children: tooltip
|
|
1454
1521
|
};
|
|
1455
1522
|
}
|
|
1456
|
-
return /* @__PURE__ */ (0,
|
|
1457
|
-
/* @__PURE__ */ (0,
|
|
1458
|
-
/* @__PURE__ */ (0,
|
|
1523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Tooltip, { children: [
|
|
1524
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TooltipTrigger, { asChild: true, children: button }),
|
|
1525
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1459
1526
|
TooltipContent,
|
|
1460
1527
|
__spreadValues({
|
|
1461
1528
|
side: "right",
|
|
@@ -1467,7 +1534,7 @@ function SidebarMenuButton(_a) {
|
|
|
1467
1534
|
}
|
|
1468
1535
|
function SidebarMenuSub(_a) {
|
|
1469
1536
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1470
|
-
return /* @__PURE__ */ (0,
|
|
1537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1471
1538
|
"ul",
|
|
1472
1539
|
__spreadValues({
|
|
1473
1540
|
"data-slot": "sidebar-menu-sub",
|
|
@@ -1486,7 +1553,7 @@ function SidebarMenuSubItem(_a) {
|
|
|
1486
1553
|
} = _b, props = __objRest(_b, [
|
|
1487
1554
|
"className"
|
|
1488
1555
|
]);
|
|
1489
|
-
return /* @__PURE__ */ (0,
|
|
1556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1490
1557
|
"li",
|
|
1491
1558
|
__spreadValues({
|
|
1492
1559
|
"data-slot": "sidebar-menu-sub-item",
|
|
@@ -1508,7 +1575,7 @@ function SidebarMenuSubButton(_a) {
|
|
|
1508
1575
|
"className"
|
|
1509
1576
|
]);
|
|
1510
1577
|
const Comp = asChild ? import_react_slot2.Slot : "a";
|
|
1511
|
-
return /* @__PURE__ */ (0,
|
|
1578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1512
1579
|
Comp,
|
|
1513
1580
|
__spreadValues({
|
|
1514
1581
|
"data-slot": "sidebar-menu-sub-button",
|
|
@@ -1532,14 +1599,14 @@ var import_lucide_react9 = require("lucide-react");
|
|
|
1532
1599
|
|
|
1533
1600
|
// src/components/ui/collapsible.tsx
|
|
1534
1601
|
var CollapsiblePrimitive = __toESM(require("@radix-ui/react-collapsible"));
|
|
1535
|
-
var
|
|
1602
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1536
1603
|
function Collapsible(_a) {
|
|
1537
1604
|
var props = __objRest(_a, []);
|
|
1538
|
-
return /* @__PURE__ */ (0,
|
|
1605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CollapsiblePrimitive.Root, __spreadValues({ "data-slot": "collapsible" }, props));
|
|
1539
1606
|
}
|
|
1540
1607
|
function CollapsibleTrigger2(_a) {
|
|
1541
1608
|
var props = __objRest(_a, []);
|
|
1542
|
-
return /* @__PURE__ */ (0,
|
|
1609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1543
1610
|
CollapsiblePrimitive.CollapsibleTrigger,
|
|
1544
1611
|
__spreadValues({
|
|
1545
1612
|
"data-slot": "collapsible-trigger"
|
|
@@ -1548,7 +1615,7 @@ function CollapsibleTrigger2(_a) {
|
|
|
1548
1615
|
}
|
|
1549
1616
|
function CollapsibleContent2(_a) {
|
|
1550
1617
|
var props = __objRest(_a, []);
|
|
1551
|
-
return /* @__PURE__ */ (0,
|
|
1618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1552
1619
|
CollapsiblePrimitive.CollapsibleContent,
|
|
1553
1620
|
__spreadValues({
|
|
1554
1621
|
"data-slot": "collapsible-content"
|
|
@@ -1557,36 +1624,36 @@ function CollapsibleContent2(_a) {
|
|
|
1557
1624
|
}
|
|
1558
1625
|
|
|
1559
1626
|
// src/components/custom/navbar/nav-main.tsx
|
|
1560
|
-
var
|
|
1627
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1561
1628
|
function NavMain({
|
|
1562
1629
|
items,
|
|
1563
1630
|
router
|
|
1564
1631
|
}) {
|
|
1565
|
-
return /* @__PURE__ */ (0,
|
|
1632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SidebarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SidebarMenu, { children: items.map((entry) => {
|
|
1566
1633
|
const isGroupActive = treeContainsPath({
|
|
1567
1634
|
data: entry.routes,
|
|
1568
1635
|
base: entry.url,
|
|
1569
1636
|
pathname: router.pathname
|
|
1570
1637
|
});
|
|
1571
|
-
return /* @__PURE__ */ (0,
|
|
1638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1572
1639
|
Collapsible,
|
|
1573
1640
|
{
|
|
1574
1641
|
asChild: true,
|
|
1575
1642
|
defaultOpen: isGroupActive,
|
|
1576
1643
|
className: "group/collapsible group-data-[state=open]:bg-sidebar-accent group-data-[state=open]:text-sidebar-accent-foreground",
|
|
1577
|
-
children: /* @__PURE__ */ (0,
|
|
1578
|
-
/* @__PURE__ */ (0,
|
|
1644
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(SidebarMenuItem, { children: [
|
|
1645
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1579
1646
|
SidebarMenuButton,
|
|
1580
1647
|
{
|
|
1581
1648
|
tooltip: entry.name,
|
|
1582
1649
|
className: isGroupActive ? "bg-sidebar-accent text-sidebar-accent-foreground" : void 0,
|
|
1583
1650
|
children: [
|
|
1584
|
-
/* @__PURE__ */ (0,
|
|
1585
|
-
/* @__PURE__ */ (0,
|
|
1651
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "font-medium text-lg", children: entry.name }),
|
|
1652
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react9.ChevronRight, { className: "ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })
|
|
1586
1653
|
]
|
|
1587
1654
|
}
|
|
1588
1655
|
) }),
|
|
1589
|
-
/* @__PURE__ */ (0,
|
|
1656
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CollapsibleContent2, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SidebarMenuSub, { children: renderMenu(
|
|
1590
1657
|
entry.routes,
|
|
1591
1658
|
entry.url,
|
|
1592
1659
|
router
|
|
@@ -1603,30 +1670,30 @@ function renderMenu(data, base, router) {
|
|
|
1603
1670
|
if (typeof routes === "string") {
|
|
1604
1671
|
const fullPath = buildFullHref(base, routes);
|
|
1605
1672
|
const active = isRouteActive(fullPath, router.pathname);
|
|
1606
|
-
return /* @__PURE__ */ (0,
|
|
1673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SidebarMenuSubItem, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1607
1674
|
SidebarMenuSubButton,
|
|
1608
1675
|
{
|
|
1609
1676
|
onClick: () => router.push(fullPath),
|
|
1610
1677
|
className: `cursor-pointer ${active ? "bg-sidebar-accent text-sidebar-accent-foreground" : ""}`,
|
|
1611
1678
|
children: [
|
|
1612
|
-
/* @__PURE__ */ (0,
|
|
1613
|
-
/* @__PURE__ */ (0,
|
|
1679
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react9.CornerDownRight, {}),
|
|
1680
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "font-light text-sm", children: label })
|
|
1614
1681
|
]
|
|
1615
1682
|
}
|
|
1616
1683
|
) }, label);
|
|
1617
1684
|
}
|
|
1618
|
-
return /* @__PURE__ */ (0,
|
|
1685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1619
1686
|
Collapsible,
|
|
1620
1687
|
{
|
|
1621
1688
|
asChild: true,
|
|
1622
1689
|
defaultOpen: false,
|
|
1623
1690
|
className: "group/collapsible group-data-[state=open]:bg-sidebar-accent group-data-[state=open]:text-sidebar-accent-foreground",
|
|
1624
|
-
children: /* @__PURE__ */ (0,
|
|
1625
|
-
/* @__PURE__ */ (0,
|
|
1626
|
-
/* @__PURE__ */ (0,
|
|
1627
|
-
/* @__PURE__ */ (0,
|
|
1691
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(SidebarMenuItem, { children: [
|
|
1692
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(SidebarMenuButton, { tooltip: label, children: [
|
|
1693
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "font-medium text-base", children: label }),
|
|
1694
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react9.ChevronRight, { className: "ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })
|
|
1628
1695
|
] }) }),
|
|
1629
|
-
/* @__PURE__ */ (0,
|
|
1696
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CollapsibleContent2, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SidebarMenuSub, { children: renderMenu(routes, base, router) }) })
|
|
1630
1697
|
] })
|
|
1631
1698
|
},
|
|
1632
1699
|
label
|
|
@@ -1635,14 +1702,14 @@ function renderMenu(data, base, router) {
|
|
|
1635
1702
|
}
|
|
1636
1703
|
|
|
1637
1704
|
// src/components/custom/navbar/app-sidebar.tsx
|
|
1638
|
-
var
|
|
1705
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1639
1706
|
function AppSidebar(_a) {
|
|
1640
1707
|
var _b = _a, { data, router } = _b, props = __objRest(_b, ["data", "router"]);
|
|
1641
|
-
return /* @__PURE__ */ (0,
|
|
1708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Sidebar, __spreadProps(__spreadValues({ collapsible: "icon" }, props), { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SidebarContent, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(NavMain, { items: data, router }) }) }));
|
|
1642
1709
|
}
|
|
1643
1710
|
|
|
1644
1711
|
// src/components/custom/navbar/mobileNavbar.tsx
|
|
1645
|
-
var
|
|
1712
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1646
1713
|
function MobileNavbar({
|
|
1647
1714
|
navbarData,
|
|
1648
1715
|
userData,
|
|
@@ -1656,10 +1723,10 @@ function MobileNavbar({
|
|
|
1656
1723
|
}) {
|
|
1657
1724
|
var _a;
|
|
1658
1725
|
const safeData = navbarData || {};
|
|
1659
|
-
return /* @__PURE__ */ (0,
|
|
1660
|
-
/* @__PURE__ */ (0,
|
|
1661
|
-
/* @__PURE__ */ (0,
|
|
1662
|
-
/* @__PURE__ */ (0,
|
|
1726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(SidebarProvider, { className: "relative w-full", children: [
|
|
1727
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("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: [
|
|
1728
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SidebarTrigger, {}),
|
|
1729
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1663
1730
|
"img",
|
|
1664
1731
|
{
|
|
1665
1732
|
src: ((_a = sidebarIcon_default) == null ? void 0 : _a.src) || sidebarIcon_default,
|
|
@@ -1668,17 +1735,17 @@ function MobileNavbar({
|
|
|
1668
1735
|
height: 18
|
|
1669
1736
|
}
|
|
1670
1737
|
),
|
|
1671
|
-
/* @__PURE__ */ (0,
|
|
1672
|
-
/* @__PURE__ */ (0,
|
|
1673
|
-
/* @__PURE__ */ (0,
|
|
1738
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex gap-4 items-center", children: [
|
|
1739
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(notifications_default, { notificationData, notificationHandler }),
|
|
1740
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(user_default2, { userData, onLogout, hubIdChangeHandler, hubDetails, hubIdEnable })
|
|
1674
1741
|
] })
|
|
1675
1742
|
] }),
|
|
1676
|
-
/* @__PURE__ */ (0,
|
|
1743
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SidebarInset, { className: "pt-12", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AppSidebar, { data: safeData, router }) })
|
|
1677
1744
|
] });
|
|
1678
1745
|
}
|
|
1679
1746
|
|
|
1680
1747
|
// src/components/custom/navbar/navbar.tsx
|
|
1681
|
-
var
|
|
1748
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1682
1749
|
function Navbar({
|
|
1683
1750
|
navbarData,
|
|
1684
1751
|
userData,
|
|
@@ -1696,7 +1763,7 @@ function Navbar({
|
|
|
1696
1763
|
setMounted(true);
|
|
1697
1764
|
}, []);
|
|
1698
1765
|
if (!mounted) return null;
|
|
1699
|
-
return /* @__PURE__ */ (0,
|
|
1766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "baaz-custom-components-navbar", children: isMobile ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1700
1767
|
MobileNavbar,
|
|
1701
1768
|
{
|
|
1702
1769
|
navbarData,
|
|
@@ -1709,7 +1776,7 @@ function Navbar({
|
|
|
1709
1776
|
hubIdChangeHandler,
|
|
1710
1777
|
notificationHandler
|
|
1711
1778
|
}
|
|
1712
|
-
) : /* @__PURE__ */ (0,
|
|
1779
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1713
1780
|
DesktopNavbar,
|
|
1714
1781
|
{
|
|
1715
1782
|
navbarData,
|
|
@@ -1731,14 +1798,14 @@ var import_lucide_react11 = require("lucide-react");
|
|
|
1731
1798
|
// src/components/ui/breadcrumb.tsx
|
|
1732
1799
|
var import_react_slot3 = require("@radix-ui/react-slot");
|
|
1733
1800
|
var import_lucide_react10 = require("lucide-react");
|
|
1734
|
-
var
|
|
1801
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1735
1802
|
function Breadcrumb(_a) {
|
|
1736
1803
|
var props = __objRest(_a, []);
|
|
1737
|
-
return /* @__PURE__ */ (0,
|
|
1804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("nav", __spreadValues({ "aria-label": "breadcrumb", "data-slot": "breadcrumb" }, props));
|
|
1738
1805
|
}
|
|
1739
1806
|
function BreadcrumbList(_a) {
|
|
1740
1807
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1741
|
-
return /* @__PURE__ */ (0,
|
|
1808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1742
1809
|
"ol",
|
|
1743
1810
|
__spreadValues({
|
|
1744
1811
|
"data-slot": "breadcrumb-list",
|
|
@@ -1751,7 +1818,7 @@ function BreadcrumbList(_a) {
|
|
|
1751
1818
|
}
|
|
1752
1819
|
function BreadcrumbItem(_a) {
|
|
1753
1820
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1754
|
-
return /* @__PURE__ */ (0,
|
|
1821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1755
1822
|
"li",
|
|
1756
1823
|
__spreadValues({
|
|
1757
1824
|
"data-slot": "breadcrumb-item",
|
|
@@ -1768,7 +1835,7 @@ function BreadcrumbLink(_a) {
|
|
|
1768
1835
|
"className"
|
|
1769
1836
|
]);
|
|
1770
1837
|
const Comp = asChild ? import_react_slot3.Slot : "a";
|
|
1771
|
-
return /* @__PURE__ */ (0,
|
|
1838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1772
1839
|
Comp,
|
|
1773
1840
|
__spreadValues({
|
|
1774
1841
|
"data-slot": "breadcrumb-link",
|
|
@@ -1784,7 +1851,7 @@ function BreadcrumbSeparator(_a) {
|
|
|
1784
1851
|
"children",
|
|
1785
1852
|
"className"
|
|
1786
1853
|
]);
|
|
1787
|
-
return /* @__PURE__ */ (0,
|
|
1854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1788
1855
|
"li",
|
|
1789
1856
|
__spreadProps(__spreadValues({
|
|
1790
1857
|
"data-slot": "breadcrumb-separator",
|
|
@@ -1792,13 +1859,13 @@ function BreadcrumbSeparator(_a) {
|
|
|
1792
1859
|
"aria-hidden": "true",
|
|
1793
1860
|
className: cn("[&>svg]:size-3.5", className)
|
|
1794
1861
|
}, props), {
|
|
1795
|
-
children: children != null ? children : /* @__PURE__ */ (0,
|
|
1862
|
+
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react10.ChevronRight, {})
|
|
1796
1863
|
})
|
|
1797
1864
|
);
|
|
1798
1865
|
}
|
|
1799
1866
|
|
|
1800
1867
|
// src/components/custom/breadcrumb/index.tsx
|
|
1801
|
-
var
|
|
1868
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1802
1869
|
var CustomBreadcrumb = ({
|
|
1803
1870
|
layoutName,
|
|
1804
1871
|
includeFrom = 0,
|
|
@@ -1807,16 +1874,16 @@ var CustomBreadcrumb = ({
|
|
|
1807
1874
|
const completeUrl = pathname.split("/").filter(Boolean);
|
|
1808
1875
|
const urls = pathname.split("/").filter(Boolean).slice(includeFrom);
|
|
1809
1876
|
const activeClassName = "text-primary";
|
|
1810
|
-
return /* @__PURE__ */ (0,
|
|
1811
|
-
/* @__PURE__ */ (0,
|
|
1812
|
-
urls.length > 0 && /* @__PURE__ */ (0,
|
|
1877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Breadcrumb, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(BreadcrumbList, { children: [
|
|
1878
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(BreadcrumbItem, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h2", { className: "text-base", children: capitalizeFirstLetter(layoutName) }) }),
|
|
1879
|
+
urls.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(BreadcrumbSeparator, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react11.Slash, { className: "!h-md !w-md" }) }),
|
|
1813
1880
|
urls.map((url, index) => {
|
|
1814
1881
|
const href = buildUrl(
|
|
1815
1882
|
completeUrl,
|
|
1816
1883
|
index + includeFrom
|
|
1817
1884
|
);
|
|
1818
|
-
return /* @__PURE__ */ (0,
|
|
1819
|
-
/* @__PURE__ */ (0,
|
|
1885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(BreadcrumbItem, { children: [
|
|
1886
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1820
1887
|
BreadcrumbLink,
|
|
1821
1888
|
{
|
|
1822
1889
|
href,
|
|
@@ -1824,7 +1891,7 @@ var CustomBreadcrumb = ({
|
|
|
1824
1891
|
children: capitalizeFirstLetter(url)
|
|
1825
1892
|
}
|
|
1826
1893
|
),
|
|
1827
|
-
index < urls.length - 1 && /* @__PURE__ */ (0,
|
|
1894
|
+
index < urls.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(BreadcrumbSeparator, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react11.Slash, { className: "!h-md !w-md" }) })
|
|
1828
1895
|
] }, index);
|
|
1829
1896
|
})
|
|
1830
1897
|
] }) });
|