@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.cjs CHANGED
@@ -5161,7 +5161,8 @@ function ControlSidebar({
5161
5161
  logoUrl = "/lovable-uploads/632ebc32-3ae3-4944-8e70-0e9c2539494a.png",
5162
5162
  faviconUrl,
5163
5163
  appName = "App",
5164
- appSubtitle = "Sistema"
5164
+ appSubtitle = "Sistema",
5165
+ menuItems: menuItemsProp
5165
5166
  }) {
5166
5167
  const {
5167
5168
  toggleSubmenu,
@@ -5184,7 +5185,7 @@ function ControlSidebar({
5184
5185
  }
5185
5186
  }
5186
5187
  };
5187
- const menuItems = [
5188
+ const defaultMenuItems = [
5188
5189
  {
5189
5190
  title: "Dashboard",
5190
5191
  url: routePaths.DASHBOARD,
@@ -5322,8 +5323,9 @@ function ControlSidebar({
5322
5323
  return () => clearInterval(timer);
5323
5324
  }
5324
5325
  }, [currentTime]);
5326
+ const resolvedMenuItems = menuItemsProp ?? defaultMenuItems;
5325
5327
  const displayTime = currentTime || internalTime;
5326
- const filteredMenuItems = filterMenuItems(menuItems, user);
5328
+ const filteredMenuItems = filterMenuItems(resolvedMenuItems, user);
5327
5329
  return /* @__PURE__ */ jsxRuntime.jsxs(Sidebar, { className: "border-r border-gray-200", collapsible: "icon", children: [
5328
5330
  /* @__PURE__ */ jsxRuntime.jsxs(SidebarHeader, { className: "border-b border-gray-200", children: [
5329
5331
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-between px-2 py-2", children: /* @__PURE__ */ jsxRuntime.jsx(SidebarTrigger, { className: "ml-auto" }) }),
@@ -5509,7 +5511,8 @@ function MainLayout({
5509
5511
  appSubtitle,
5510
5512
  logoUrl,
5511
5513
  faviconUrl,
5512
- sidebarDefaultOpen
5514
+ sidebarDefaultOpen,
5515
+ menuItems
5513
5516
  }) {
5514
5517
  return /* @__PURE__ */ jsxRuntime.jsx(SidebarProvider, { defaultOpen: sidebarDefaultOpen, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "h-screen w-full flex", children: [
5515
5518
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -5526,13 +5529,14 @@ function MainLayout({
5526
5529
  appName,
5527
5530
  appSubtitle,
5528
5531
  logoUrl,
5529
- faviconUrl
5532
+ faviconUrl,
5533
+ menuItems
5530
5534
  }
5531
5535
  ),
5532
5536
  /* @__PURE__ */ jsxRuntime.jsx("main", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-full overflow-y-auto", children }) })
5533
5537
  ] }) });
5534
5538
  }
5535
- function ProtectedRoute({ children, useAuthContext, tenantId, useSSO, routePaths, useTenant, tenantService, onResetPassword, resetPasswordLoading, resetPasswordError, appName, appSubtitle, logoUrl, faviconUrl, sidebarDefaultOpen }) {
5539
+ function ProtectedRoute({ children, useAuthContext, tenantId, useSSO, routePaths, useTenant, tenantService, onResetPassword, resetPasswordLoading, resetPasswordError, appName, appSubtitle, logoUrl, faviconUrl, sidebarDefaultOpen, menuItems }) {
5536
5540
  const { isAuthenticated, isLoading, logout, user, getCurrentTenantId } = useAuthContext();
5537
5541
  const location = reactRouterDom.useLocation();
5538
5542
  const sso = useSSO(tenantId || void 0);
@@ -5581,6 +5585,7 @@ function ProtectedRoute({ children, useAuthContext, tenantId, useSSO, routePaths
5581
5585
  logoUrl,
5582
5586
  faviconUrl,
5583
5587
  sidebarDefaultOpen,
5588
+ menuItems,
5584
5589
  children: /* @__PURE__ */ jsxRuntime.jsx(EnsureTenant, { useTenant, tenantService, children })
5585
5590
  }
5586
5591
  );