@lincros-ui/components 0.2.19 → 0.2.20

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.js CHANGED
@@ -5104,7 +5104,8 @@ function ControlSidebar({
5104
5104
  logoUrl = "/lovable-uploads/632ebc32-3ae3-4944-8e70-0e9c2539494a.png",
5105
5105
  faviconUrl,
5106
5106
  appName = "App",
5107
- appSubtitle = "Sistema"
5107
+ appSubtitle = "Sistema",
5108
+ menuItems: menuItemsProp
5108
5109
  }) {
5109
5110
  const {
5110
5111
  toggleSubmenu,
@@ -5127,7 +5128,7 @@ function ControlSidebar({
5127
5128
  }
5128
5129
  }
5129
5130
  };
5130
- const menuItems = [
5131
+ const defaultMenuItems = [
5131
5132
  {
5132
5133
  title: "Dashboard",
5133
5134
  url: routePaths.DASHBOARD,
@@ -5265,8 +5266,9 @@ function ControlSidebar({
5265
5266
  return () => clearInterval(timer);
5266
5267
  }
5267
5268
  }, [currentTime]);
5269
+ const resolvedMenuItems = menuItemsProp ?? defaultMenuItems;
5268
5270
  const displayTime = currentTime || internalTime;
5269
- const filteredMenuItems = filterMenuItems(menuItems, user);
5271
+ const filteredMenuItems = filterMenuItems(resolvedMenuItems, user);
5270
5272
  return /* @__PURE__ */ jsxs(Sidebar, { className: "border-r border-gray-200", collapsible: "icon", children: [
5271
5273
  /* @__PURE__ */ jsxs(SidebarHeader, { className: "border-b border-gray-200", children: [
5272
5274
  /* @__PURE__ */ jsx("div", { className: "flex items-center justify-between px-2 py-2", children: /* @__PURE__ */ jsx(SidebarTrigger, { className: "ml-auto" }) }),
@@ -5452,7 +5454,8 @@ function MainLayout({
5452
5454
  appSubtitle,
5453
5455
  logoUrl,
5454
5456
  faviconUrl,
5455
- sidebarDefaultOpen
5457
+ sidebarDefaultOpen,
5458
+ menuItems
5456
5459
  }) {
5457
5460
  return /* @__PURE__ */ jsx(SidebarProvider, { defaultOpen: sidebarDefaultOpen, children: /* @__PURE__ */ jsxs("div", { className: "h-screen w-full flex", children: [
5458
5461
  /* @__PURE__ */ jsx(
@@ -5469,13 +5472,14 @@ function MainLayout({
5469
5472
  appName,
5470
5473
  appSubtitle,
5471
5474
  logoUrl,
5472
- faviconUrl
5475
+ faviconUrl,
5476
+ menuItems
5473
5477
  }
5474
5478
  ),
5475
5479
  /* @__PURE__ */ jsx("main", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "h-full overflow-y-auto", children }) })
5476
5480
  ] }) });
5477
5481
  }
5478
- function ProtectedRoute({ children, useAuthContext, tenantId, useSSO, routePaths, useTenant, tenantService, onResetPassword, resetPasswordLoading, resetPasswordError, appName, appSubtitle, logoUrl, faviconUrl, sidebarDefaultOpen }) {
5482
+ function ProtectedRoute({ children, useAuthContext, tenantId, useSSO, routePaths, useTenant, tenantService, onResetPassword, resetPasswordLoading, resetPasswordError, appName, appSubtitle, logoUrl, faviconUrl, sidebarDefaultOpen, menuItems }) {
5479
5483
  const { isAuthenticated, isLoading, logout, user, getCurrentTenantId } = useAuthContext();
5480
5484
  const location = useLocation();
5481
5485
  const sso = useSSO(tenantId || void 0);
@@ -5524,6 +5528,7 @@ function ProtectedRoute({ children, useAuthContext, tenantId, useSSO, routePaths
5524
5528
  logoUrl,
5525
5529
  faviconUrl,
5526
5530
  sidebarDefaultOpen,
5531
+ menuItems,
5527
5532
  children: /* @__PURE__ */ jsx(EnsureTenant, { useTenant, tenantService, children })
5528
5533
  }
5529
5534
  );