@logickernel/bridge 0.9.7 → 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.
@@ -75,7 +75,7 @@ declare function useNavigation({ organizationId, apiBaseUrl, enabled, }?: UseNav
75
75
  interface NavMainProps {
76
76
  items: NavigationItem[];
77
77
  }
78
- declare function NavMain({ items }: NavMainProps): react_jsx_runtime.JSX.Element;
78
+ declare function NavMain({ items }: NavMainProps): react_jsx_runtime.JSX.Element | null;
79
79
 
80
80
  interface NavUserProps {
81
81
  user: User;
@@ -75,7 +75,7 @@ declare function useNavigation({ organizationId, apiBaseUrl, enabled, }?: UseNav
75
75
  interface NavMainProps {
76
76
  items: NavigationItem[];
77
77
  }
78
- declare function NavMain({ items }: NavMainProps): react_jsx_runtime.JSX.Element;
78
+ declare function NavMain({ items }: NavMainProps): react_jsx_runtime.JSX.Element | null;
79
79
 
80
80
  interface NavUserProps {
81
81
  user: User;
@@ -771,59 +771,83 @@ function NavMain({ items }) {
771
771
  groupsCount: groups.length,
772
772
  groups: groups.map((group) => ({
773
773
  hasLabel: !!group.label,
774
+ labelTitle: group.label?.title,
774
775
  itemsCount: group.items.length,
775
776
  items: group.items.map((item) => item.title)
776
777
  }))
777
778
  });
779
+ const firstGroup = groups.length > 0 ? groups[0] : null;
780
+ console.log("[NavMain] Will render:", {
781
+ groupsLength: groups.length,
782
+ willRender: groups.length > 0,
783
+ firstGroupHasItems: firstGroup ? firstGroup.items.length > 0 : false,
784
+ firstGroupHasLabel: !!firstGroup?.label
785
+ });
786
+ }
787
+ if (groups.length === 0) {
788
+ if (typeof window !== "undefined" && process.env.NODE_ENV === "development") {
789
+ console.warn("[NavMain] No groups to render, returning null");
790
+ }
791
+ return null;
778
792
  }
779
- return /* @__PURE__ */ jsx(Fragment, { children: groups.map((group, groupIndex) => /* @__PURE__ */ jsxs(SidebarGroup, { children: [
780
- group.label && /* @__PURE__ */ jsxs(SidebarGroupLabel, { children: [
781
- group.label.icon && /* @__PURE__ */ jsx(group.label.icon, { className: "mr-2" }),
782
- group.label.title
783
- ] }),
784
- group.items.length > 0 && /* @__PURE__ */ jsx(SidebarMenu, { children: group.items.map((item) => {
785
- const isActive = pathname === item.url || item.isActive;
786
- const hasSubItems = item.items && item.items.length > 0;
787
- if (hasSubItems) {
788
- return /* @__PURE__ */ jsx(
789
- Collapsible,
793
+ return /* @__PURE__ */ jsx(Fragment, { children: groups.map((group, groupIndex) => {
794
+ if (typeof window !== "undefined" && process.env.NODE_ENV === "development") {
795
+ console.log(`[NavMain] Rendering group ${groupIndex}:`, {
796
+ hasLabel: !!group.label,
797
+ itemsCount: group.items.length,
798
+ willRenderLabel: !!group.label,
799
+ willRenderItems: group.items.length > 0
800
+ });
801
+ }
802
+ return /* @__PURE__ */ jsxs(SidebarGroup, { children: [
803
+ group.label && /* @__PURE__ */ jsxs(SidebarGroupLabel, { children: [
804
+ group.label.icon && /* @__PURE__ */ jsx(group.label.icon, { className: "mr-2" }),
805
+ group.label.title
806
+ ] }),
807
+ group.items.length > 0 && /* @__PURE__ */ jsx(SidebarMenu, { children: group.items.map((item) => {
808
+ const isActive = pathname === item.url || item.isActive;
809
+ const hasSubItems = item.items && item.items.length > 0;
810
+ if (hasSubItems) {
811
+ return /* @__PURE__ */ jsx(
812
+ Collapsible,
813
+ {
814
+ asChild: true,
815
+ defaultOpen: isActive,
816
+ className: "group/collapsible",
817
+ children: /* @__PURE__ */ jsxs(SidebarMenuItem, { children: [
818
+ /* @__PURE__ */ jsx(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs(
819
+ SidebarMenuButton,
820
+ {
821
+ tooltip: item.title,
822
+ isActive,
823
+ children: [
824
+ item.icon && /* @__PURE__ */ jsx(item.icon, {}),
825
+ /* @__PURE__ */ jsx("span", { children: item.title }),
826
+ /* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })
827
+ ]
828
+ }
829
+ ) }),
830
+ /* @__PURE__ */ jsx(CollapsibleContent2, { children: /* @__PURE__ */ jsx(SidebarMenuSub, { children: item.items?.map((subItem) => /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx(SidebarMenuSubButton, { asChild: true, children: /* @__PURE__ */ jsx(Link, { href: subItem.url, children: /* @__PURE__ */ jsx("span", { children: subItem.title }) }) }) }, subItem.title)) }) })
831
+ ] })
832
+ },
833
+ item.title
834
+ );
835
+ }
836
+ return /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(
837
+ SidebarMenuButton,
790
838
  {
791
839
  asChild: true,
792
- defaultOpen: isActive,
793
- className: "group/collapsible",
794
- children: /* @__PURE__ */ jsxs(SidebarMenuItem, { children: [
795
- /* @__PURE__ */ jsx(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs(
796
- SidebarMenuButton,
797
- {
798
- tooltip: item.title,
799
- isActive,
800
- children: [
801
- item.icon && /* @__PURE__ */ jsx(item.icon, {}),
802
- /* @__PURE__ */ jsx("span", { children: item.title }),
803
- /* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })
804
- ]
805
- }
806
- ) }),
807
- /* @__PURE__ */ jsx(CollapsibleContent2, { children: /* @__PURE__ */ jsx(SidebarMenuSub, { children: item.items?.map((subItem) => /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx(SidebarMenuSubButton, { asChild: true, children: /* @__PURE__ */ jsx(Link, { href: subItem.url, children: /* @__PURE__ */ jsx("span", { children: subItem.title }) }) }) }, subItem.title)) }) })
840
+ tooltip: item.title,
841
+ isActive,
842
+ children: /* @__PURE__ */ jsxs(Link, { href: item.url, children: [
843
+ item.icon && /* @__PURE__ */ jsx(item.icon, {}),
844
+ /* @__PURE__ */ jsx("span", { children: item.title })
808
845
  ] })
809
- },
810
- item.title
811
- );
812
- }
813
- return /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(
814
- SidebarMenuButton,
815
- {
816
- asChild: true,
817
- tooltip: item.title,
818
- isActive,
819
- children: /* @__PURE__ */ jsxs(Link, { href: item.url, children: [
820
- item.icon && /* @__PURE__ */ jsx(item.icon, {}),
821
- /* @__PURE__ */ jsx("span", { children: item.title })
822
- ] })
823
- }
824
- ) }, item.title);
825
- }) })
826
- ] }, groupIndex)) });
846
+ }
847
+ ) }, item.title);
848
+ }) })
849
+ ] }, groupIndex);
850
+ }) });
827
851
  }
828
852
  function Avatar({
829
853
  className,