@logickernel/bridge 0.9.6 → 0.9.8
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/next/components.cjs
CHANGED
|
@@ -757,6 +757,17 @@ function getIconComponent(icon) {
|
|
|
757
757
|
}
|
|
758
758
|
function NavMain({ items }) {
|
|
759
759
|
const pathname = navigation.usePathname();
|
|
760
|
+
if (typeof window !== "undefined" && process.env.NODE_ENV === "development") {
|
|
761
|
+
console.log("[NavMain] Received items:", {
|
|
762
|
+
itemsCount: items.length,
|
|
763
|
+
items: items.map((item) => ({
|
|
764
|
+
title: item.title,
|
|
765
|
+
url: item.url,
|
|
766
|
+
icon: item.icon,
|
|
767
|
+
hasSubItems: !!(item.items && item.items.length > 0)
|
|
768
|
+
}))
|
|
769
|
+
});
|
|
770
|
+
}
|
|
760
771
|
const groups = [];
|
|
761
772
|
let currentGroup = {
|
|
762
773
|
items: []
|
|
@@ -784,54 +795,88 @@ function NavMain({ items }) {
|
|
|
784
795
|
if (currentGroup.items.length > 0 || currentGroup.label) {
|
|
785
796
|
groups.push(currentGroup);
|
|
786
797
|
}
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
group
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
+
if (typeof window !== "undefined" && process.env.NODE_ENV === "development") {
|
|
799
|
+
console.log("[NavMain] Groups:", {
|
|
800
|
+
groupsCount: groups.length,
|
|
801
|
+
groups: groups.map((group) => ({
|
|
802
|
+
hasLabel: !!group.label,
|
|
803
|
+
labelTitle: group.label?.title,
|
|
804
|
+
itemsCount: group.items.length,
|
|
805
|
+
items: group.items.map((item) => item.title)
|
|
806
|
+
}))
|
|
807
|
+
});
|
|
808
|
+
const firstGroup = groups.length > 0 ? groups[0] : null;
|
|
809
|
+
console.log("[NavMain] Will render:", {
|
|
810
|
+
groupsLength: groups.length,
|
|
811
|
+
willRender: groups.length > 0,
|
|
812
|
+
firstGroupHasItems: firstGroup ? firstGroup.items.length > 0 : false,
|
|
813
|
+
firstGroupHasLabel: !!firstGroup?.label
|
|
814
|
+
});
|
|
815
|
+
}
|
|
816
|
+
if (groups.length === 0) {
|
|
817
|
+
if (typeof window !== "undefined" && process.env.NODE_ENV === "development") {
|
|
818
|
+
console.warn("[NavMain] No groups to render, returning null");
|
|
819
|
+
}
|
|
820
|
+
return null;
|
|
821
|
+
}
|
|
822
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: groups.map((group, groupIndex) => {
|
|
823
|
+
if (typeof window !== "undefined" && process.env.NODE_ENV === "development") {
|
|
824
|
+
console.log(`[NavMain] Rendering group ${groupIndex}:`, {
|
|
825
|
+
hasLabel: !!group.label,
|
|
826
|
+
itemsCount: group.items.length,
|
|
827
|
+
willRenderLabel: !!group.label,
|
|
828
|
+
willRenderItems: group.items.length > 0
|
|
829
|
+
});
|
|
830
|
+
}
|
|
831
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(SidebarGroup, { children: [
|
|
832
|
+
group.label && /* @__PURE__ */ jsxRuntime.jsxs(SidebarGroupLabel, { children: [
|
|
833
|
+
group.label.icon && /* @__PURE__ */ jsxRuntime.jsx(group.label.icon, { className: "mr-2" }),
|
|
834
|
+
group.label.title
|
|
835
|
+
] }),
|
|
836
|
+
group.items.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(SidebarMenu, { children: group.items.map((item) => {
|
|
837
|
+
const isActive = pathname === item.url || item.isActive;
|
|
838
|
+
const hasSubItems = item.items && item.items.length > 0;
|
|
839
|
+
if (hasSubItems) {
|
|
840
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
841
|
+
Collapsible,
|
|
842
|
+
{
|
|
843
|
+
asChild: true,
|
|
844
|
+
defaultOpen: isActive,
|
|
845
|
+
className: "group/collapsible",
|
|
846
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(SidebarMenuItem, { children: [
|
|
847
|
+
/* @__PURE__ */ jsxRuntime.jsx(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
848
|
+
SidebarMenuButton,
|
|
849
|
+
{
|
|
850
|
+
tooltip: item.title,
|
|
851
|
+
isActive,
|
|
852
|
+
children: [
|
|
853
|
+
item.icon && /* @__PURE__ */ jsxRuntime.jsx(item.icon, {}),
|
|
854
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: item.title }),
|
|
855
|
+
/* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ChevronRight, { className: "ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })
|
|
856
|
+
]
|
|
857
|
+
}
|
|
858
|
+
) }),
|
|
859
|
+
/* @__PURE__ */ jsxRuntime.jsx(CollapsibleContent2, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSub, { children: item.items?.map((subItem) => /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSubButton, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Link__default.default, { href: subItem.url, children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: subItem.title }) }) }) }, subItem.title)) }) })
|
|
860
|
+
] })
|
|
861
|
+
},
|
|
862
|
+
item.title
|
|
863
|
+
);
|
|
864
|
+
}
|
|
865
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
866
|
+
SidebarMenuButton,
|
|
798
867
|
{
|
|
799
868
|
asChild: true,
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
803
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
804
|
-
|
|
805
|
-
{
|
|
806
|
-
tooltip: item.title,
|
|
807
|
-
isActive,
|
|
808
|
-
children: [
|
|
809
|
-
item.icon && /* @__PURE__ */ jsxRuntime.jsx(item.icon, {}),
|
|
810
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: item.title }),
|
|
811
|
-
/* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ChevronRight, { className: "ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })
|
|
812
|
-
]
|
|
813
|
-
}
|
|
814
|
-
) }),
|
|
815
|
-
/* @__PURE__ */ jsxRuntime.jsx(CollapsibleContent2, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSub, { children: item.items?.map((subItem) => /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSubButton, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Link__default.default, { href: subItem.url, children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: subItem.title }) }) }) }, subItem.title)) }) })
|
|
869
|
+
tooltip: item.title,
|
|
870
|
+
isActive,
|
|
871
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(Link__default.default, { href: item.url, children: [
|
|
872
|
+
item.icon && /* @__PURE__ */ jsxRuntime.jsx(item.icon, {}),
|
|
873
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: item.title })
|
|
816
874
|
] })
|
|
817
|
-
}
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
SidebarMenuButton,
|
|
823
|
-
{
|
|
824
|
-
asChild: true,
|
|
825
|
-
tooltip: item.title,
|
|
826
|
-
isActive,
|
|
827
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(Link__default.default, { href: item.url, children: [
|
|
828
|
-
item.icon && /* @__PURE__ */ jsxRuntime.jsx(item.icon, {}),
|
|
829
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: item.title })
|
|
830
|
-
] })
|
|
831
|
-
}
|
|
832
|
-
) }, item.title);
|
|
833
|
-
}) })
|
|
834
|
-
] }, groupIndex)) });
|
|
875
|
+
}
|
|
876
|
+
) }, item.title);
|
|
877
|
+
}) })
|
|
878
|
+
] }, groupIndex);
|
|
879
|
+
}) });
|
|
835
880
|
}
|
|
836
881
|
function Avatar({
|
|
837
882
|
className,
|