xertica-ui 2.6.0 → 2.7.0

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.
Files changed (100) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +1 -1
  3. package/components/assistant/xertica-assistant/use-assistant.ts +5 -6
  4. package/{templates/src/features/auth/ui → components/blocks/auth}/AuthPageShell.tsx +8 -3
  5. package/components/blocks/auth/PasswordStrengthMeter.tsx +41 -0
  6. package/components/blocks/auth/SocialLoginButtons.tsx +95 -0
  7. package/components/blocks/auth/index.ts +11 -0
  8. package/components/blocks/auth/usePasswordStrength.ts +13 -0
  9. package/components/blocks/index.ts +1 -0
  10. package/components/pages/forgot-password-page/ForgotPasswordPage.tsx +45 -139
  11. package/components/pages/login-page/LoginPage.tsx +52 -145
  12. package/components/pages/reset-password-page/ResetPasswordPage.tsx +79 -169
  13. package/components/pages/verify-email-page/VerifyEmailPage.tsx +48 -150
  14. package/dist/AssistantChart-CImCNLfD.cjs +3551 -0
  15. package/dist/AssistantChart-DfdIfmQr.js +3383 -0
  16. package/dist/FeatureCard-BhpfmPPx.js +485 -0
  17. package/dist/FeatureCard-D-5yS_OD.cjs +497 -0
  18. package/dist/ImageWithFallback-CfkAkctC.cjs +122 -0
  19. package/dist/ImageWithFallback-bw-CxxDc.js +98 -0
  20. package/dist/LanguageContext-CX_zdxre.js +1912 -0
  21. package/dist/LanguageContext-CjhSSqJT.cjs +1917 -0
  22. package/dist/LanguageSelector-BR3Ss0k_.js +46 -0
  23. package/dist/LanguageSelector-CHOLPmHr.cjs +48 -0
  24. package/dist/PasswordStrengthMeter-C8irs0G1.js +173 -0
  25. package/dist/PasswordStrengthMeter-MLzhax-d.cjs +179 -0
  26. package/dist/ThemeContext-CEY9pCn-.cjs +86 -0
  27. package/dist/ThemeContext-Dk3tH7Ym.js +83 -0
  28. package/dist/ThemeToggle-BpM_iHh8.js +215 -0
  29. package/dist/ThemeToggle-CZRlv0d4.cjs +219 -0
  30. package/dist/VerifyEmailPage-BKiaw2YK.js +2954 -0
  31. package/dist/VerifyEmailPage-Beaicc6V.cjs +2963 -0
  32. package/dist/VerifyEmailPage-BehPBp0F.cjs +2963 -0
  33. package/dist/VerifyEmailPage-Djb6hthM.js +2954 -0
  34. package/dist/XerticaProvider-BijpC_py.cjs +46 -0
  35. package/dist/XerticaProvider-C2wDRQhT.js +44 -0
  36. package/dist/alert-dialog-BzIcTKn_.cjs +872 -0
  37. package/dist/alert-dialog-kty5pxQp.js +819 -0
  38. package/dist/assistant.cjs.js +1 -1
  39. package/dist/assistant.es.js +1 -1
  40. package/dist/blocks.cjs.js +7 -3
  41. package/dist/blocks.es.js +2 -2
  42. package/dist/brand.cjs.js +7 -6
  43. package/dist/brand.es.js +3 -2
  44. package/dist/components/blocks/auth/AuthPageShell.d.ts +12 -0
  45. package/dist/components/blocks/auth/PasswordStrengthMeter.d.ts +7 -0
  46. package/dist/components/blocks/auth/SocialLoginButtons.d.ts +8 -0
  47. package/dist/components/blocks/auth/index.d.ts +8 -0
  48. package/dist/components/blocks/auth/usePasswordStrength.d.ts +3 -0
  49. package/dist/components/blocks/index.d.ts +1 -0
  50. package/dist/components/pages/reset-password-page/ResetPasswordPage.d.ts +1 -1
  51. package/dist/hooks.cjs.js +5 -4
  52. package/dist/hooks.es.js +2 -1
  53. package/dist/index.cjs.js +29 -24
  54. package/dist/index.es.js +12 -11
  55. package/dist/layout.cjs.js +1 -1
  56. package/dist/layout.es.js +1 -1
  57. package/dist/pages.cjs.js +1 -1
  58. package/dist/pages.es.js +1 -1
  59. package/dist/sidebar-B7YzwAp3.js +1151 -0
  60. package/dist/sidebar-Cb0U7NsV.cjs +1154 -0
  61. package/dist/ui.cjs.js +7 -7
  62. package/dist/ui.es.js +3 -3
  63. package/dist/xertica-assistant-8fh8KA2K.js +2173 -0
  64. package/dist/xertica-assistant-BjfG3zyL.cjs +2180 -0
  65. package/docs/i18n.md +2 -0
  66. package/package.json +1 -1
  67. package/templates/package.json +2 -2
  68. package/templates/src/features/auth/ui/ForgotPasswordContent.tsx +1 -2
  69. package/templates/src/features/auth/ui/LoginContent.tsx +1 -2
  70. package/templates/src/features/auth/ui/ResetPasswordContent.tsx +3 -57
  71. package/templates/src/features/auth/ui/VerifyEmailContent.tsx +1 -2
  72. package/templates/src/features/home/index.ts +0 -10
  73. package/templates/src/features/home/ui/HomeContent.tsx +21 -75
  74. package/templates/src/features/template/index.ts +0 -4
  75. package/templates/src/features/template/ui/TemplateContent.tsx +26 -1279
  76. package/templates/src/locales/en/pages/templates.json +5 -313
  77. package/templates/src/locales/es/pages/templates.json +5 -313
  78. package/templates/src/locales/pt-BR/pages/templates.json +5 -313
  79. package/templates/src/features/auth/ui/SocialLoginButtons.tsx +0 -78
  80. package/templates/src/features/home/data/mock.ts +0 -41
  81. package/templates/src/features/home/hooks/useFeatureCards.ts +0 -20
  82. package/templates/src/features/home/store/dashboardStore.ts +0 -25
  83. package/templates/src/features/template/ui/CrudTemplate.tsx +0 -112
  84. package/templates/src/features/template/ui/DashboardTemplate.tsx +0 -110
  85. package/templates/src/features/template/ui/FormTemplate.tsx +0 -117
  86. package/templates/src/features/template/ui/LoginTemplate.tsx +0 -59
  87. package/templates/src/locales/en/pages/crudTemplate.json +0 -25
  88. package/templates/src/locales/en/pages/dashboardTemplate.json +0 -20
  89. package/templates/src/locales/en/pages/formTemplate.json +0 -16
  90. package/templates/src/locales/en/pages/loginTemplate.json +0 -9
  91. package/templates/src/locales/es/pages/crudTemplate.json +0 -25
  92. package/templates/src/locales/es/pages/dashboardTemplate.json +0 -20
  93. package/templates/src/locales/es/pages/formTemplate.json +0 -16
  94. package/templates/src/locales/es/pages/loginTemplate.json +0 -9
  95. package/templates/src/locales/pt-BR/pages/crudTemplate.json +0 -25
  96. package/templates/src/locales/pt-BR/pages/dashboardTemplate.json +0 -20
  97. package/templates/src/locales/pt-BR/pages/formTemplate.json +0 -16
  98. package/templates/src/locales/pt-BR/pages/loginTemplate.json +0 -9
  99. package/templates/vite.config.d.ts +0 -2
  100. package/templates/vite.config.js +0 -20
@@ -0,0 +1,1154 @@
1
+ 'use strict';
2
+
3
+ const jsxRuntime = require('react/jsx-runtime');
4
+ const React = require('react');
5
+ const lucideReact = require('lucide-react');
6
+ const button = require('./button-0BlA47It.cjs');
7
+ const ThemeToggle = require('./ThemeToggle-CZRlv0d4.cjs');
8
+ const LanguageSelector = require('./LanguageSelector-CHOLPmHr.cjs');
9
+ const breadcrumb = require('./breadcrumb-BKtHF4gk.cjs');
10
+ const dropdownMenu = require('./dropdown-menu-BMcykFDf.cjs');
11
+ const avatar = require('./avatar-BCM7YQRC.cjs');
12
+ const LayoutContext = require('./LayoutContext-BEq_-n98.cjs');
13
+ const framerMotion = require('framer-motion');
14
+ const reactI18next = require('react-i18next');
15
+ const input = require('./input-ByYuOv8A.cjs');
16
+ const tooltip = require('./tooltip-D8n9UYoU.cjs');
17
+ const CustomTooltipContent = require('./CustomTooltipContent-BhdIeBEg.cjs');
18
+
19
+ function Header({
20
+ title,
21
+ breadcrumbs,
22
+ showLanguageSelector = true,
23
+ showThemeToggle = true,
24
+ className,
25
+ user,
26
+ actions,
27
+ showSettings,
28
+ onSettingsClick,
29
+ showLogout,
30
+ onLogoutClick,
31
+ renderLink,
32
+ breadcrumbSlot
33
+ }) {
34
+ const layout = LayoutContext.useOptionalLayout();
35
+ const toggleSidebar = layout?.toggleSidebar ?? (() => {
36
+ });
37
+ return /* @__PURE__ */ jsxRuntime.jsx(
38
+ "header",
39
+ {
40
+ className: `bg-card text-foreground shadow-sm border-b border-border px-[24px] h-[64px] flex-shrink-0 flex items-center ${className || ""}`,
41
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between w-full p-[0px]", children: [
42
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-muted-foreground w-full overflow-x-auto", children: [
43
+ /* @__PURE__ */ jsxRuntime.jsx(
44
+ button.Button,
45
+ {
46
+ variant: "ghost",
47
+ size: "sm",
48
+ onClick: toggleSidebar,
49
+ className: "md:hidden mr-2 p-2 shrink-0",
50
+ "aria-label": "Abrir menu lateral",
51
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Menu, { className: "w-5 h-5" })
52
+ }
53
+ ),
54
+ breadcrumbs && breadcrumbs.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(breadcrumb.Breadcrumb, { children: /* @__PURE__ */ jsxRuntime.jsx(breadcrumb.BreadcrumbList, { className: "flex-nowrap whitespace-nowrap", children: breadcrumbs.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(React.Fragment, { children: [
55
+ /* @__PURE__ */ jsxRuntime.jsx(breadcrumb.BreadcrumbItem, { children: item.href ? renderLink ? /* @__PURE__ */ jsxRuntime.jsx(breadcrumb.BreadcrumbLink, { asChild: true, className: "flex items-center gap-1.5", children: renderLink(item.href, {
56
+ className: "flex items-center gap-1.5",
57
+ children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
58
+ item.icon,
59
+ item.label
60
+ ] })
61
+ }) }) : /* @__PURE__ */ jsxRuntime.jsxs(breadcrumb.BreadcrumbLink, { href: item.href, className: "flex items-center gap-1.5", children: [
62
+ item.icon,
63
+ item.label
64
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(breadcrumb.BreadcrumbPage, { className: "flex items-center gap-1.5", children: [
65
+ item.icon,
66
+ item.label
67
+ ] }) }),
68
+ index < breadcrumbs.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(breadcrumb.BreadcrumbSeparator, {})
69
+ ] }, index)) }) }) : title ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground font-medium shrink-0", children: title }) : /* @__PURE__ */ jsxRuntime.jsx(breadcrumb.Breadcrumb, { children: /* @__PURE__ */ jsxRuntime.jsx(breadcrumb.BreadcrumbList, { className: "flex-nowrap whitespace-nowrap", children: /* @__PURE__ */ jsxRuntime.jsx(breadcrumb.BreadcrumbItem, { children: /* @__PURE__ */ jsxRuntime.jsx(breadcrumb.BreadcrumbPage, { className: "text-foreground font-medium shrink-0", children: "Xertica.ai" }) }) }) }),
70
+ breadcrumbSlot && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center shrink-0", children: breadcrumbSlot })
71
+ ] }),
72
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 shrink-0 ml-4", children: [
73
+ showLanguageSelector && /* @__PURE__ */ jsxRuntime.jsx(LanguageSelector.LanguageSelector, { variant: "minimal", showIcon: false, className: "hidden sm:flex" }),
74
+ showThemeToggle && /* @__PURE__ */ jsxRuntime.jsx(ThemeToggle.ThemeToggle, { className: "hover:bg-accent" }),
75
+ actions?.map((action) => /* @__PURE__ */ jsxRuntime.jsxs(
76
+ button.Button,
77
+ {
78
+ variant: "ghost",
79
+ size: action.label ? "sm" : "icon",
80
+ onClick: action.onClick,
81
+ className: `hover:bg-accent ${action.className || ""}`,
82
+ "aria-label": action.label || action.id,
83
+ children: [
84
+ action.icon,
85
+ action.label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2 hidden md:inline", children: action.label })
86
+ ]
87
+ },
88
+ action.id
89
+ )),
90
+ showSettings && /* @__PURE__ */ jsxRuntime.jsx(
91
+ button.Button,
92
+ {
93
+ variant: "ghost",
94
+ size: "icon",
95
+ onClick: onSettingsClick,
96
+ className: "hover:bg-accent",
97
+ "aria-label": "Configurações",
98
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { className: "w-5 h-5" })
99
+ }
100
+ ),
101
+ user && /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenu, { children: [
102
+ /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
103
+ button.Button,
104
+ {
105
+ variant: "ghost",
106
+ className: "relative h-8 w-8 rounded-full p-0 overflow-hidden border border-border/50 hover:border-primary/30 transition-colors",
107
+ "aria-label": "Menu do usuário",
108
+ children: /* @__PURE__ */ jsxRuntime.jsxs(avatar.Avatar, { className: "h-8 w-8", children: [
109
+ /* @__PURE__ */ jsxRuntime.jsx(avatar.AvatarImage, { src: user.avatar, alt: user.name || "User" }),
110
+ /* @__PURE__ */ jsxRuntime.jsx(avatar.AvatarFallback, { className: "bg-primary/10 text-primary text-xs font-medium", children: user.name ? user.name.charAt(0).toUpperCase() : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { className: "w-4 h-4" }) })
111
+ ] })
112
+ }
113
+ ) }),
114
+ /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenuContent, { className: "w-56", align: "end", forceMount: true, children: [
115
+ /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuLabel, { className: "font-normal", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col space-y-1", children: [
116
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium leading-none", children: user.name || "User" }),
117
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs leading-none text-muted-foreground", children: user.email || "user@example.com" })
118
+ ] }) }),
119
+ /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuSeparator, {}),
120
+ user.menuItems?.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenuItem, { onClick: item.onClick, className: item.className, children: [
121
+ item.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-2", children: item.icon }),
122
+ item.label
123
+ ] }, item.id)),
124
+ !user.menuItems && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
125
+ /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenuItem, { onClick: onSettingsClick, children: [
126
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { className: "mr-2 h-4 w-4" }),
127
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Settings" })
128
+ ] }),
129
+ /* @__PURE__ */ jsxRuntime.jsxs(
130
+ dropdownMenu.DropdownMenuItem,
131
+ {
132
+ onClick: onLogoutClick,
133
+ className: "text-destructive focus:text-destructive",
134
+ children: [
135
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogOut, { className: "mr-2 h-4 w-4" }),
136
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Logout" })
137
+ ]
138
+ }
139
+ )
140
+ ] })
141
+ ] })
142
+ ] }),
143
+ showLogout && /* @__PURE__ */ jsxRuntime.jsx(
144
+ button.Button,
145
+ {
146
+ variant: "ghost",
147
+ size: "icon",
148
+ onClick: onLogoutClick,
149
+ className: "hover:bg-accent text-muted-foreground hover:text-foreground",
150
+ "aria-label": "Sair",
151
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogOut, { className: "w-5 h-5" })
152
+ }
153
+ )
154
+ ] })
155
+ ] })
156
+ }
157
+ );
158
+ }
159
+
160
+ const SidebarContext = React.createContext(null);
161
+ function useSidebarContext() {
162
+ const ctx = React.useContext(SidebarContext);
163
+ if (!ctx) {
164
+ throw new Error("Sidebar compound components must be used within <Sidebar.Root>");
165
+ }
166
+ return ctx;
167
+ }
168
+ function SidebarRoot({
169
+ expanded: expandedProp,
170
+ onToggle: onToggleProp,
171
+ navigate: navigateProp,
172
+ location: locationProp,
173
+ width: widthProp,
174
+ children,
175
+ className
176
+ }) {
177
+ const layoutContext = LayoutContext.useOptionalLayout();
178
+ const [localExpanded, setLocalExpanded] = React.useState(false);
179
+ const [isMobileViewport, setIsMobileViewport] = React.useState(false);
180
+ const expanded = expandedProp !== void 0 ? expandedProp : layoutContext?.sidebarExpanded ?? localExpanded;
181
+ const onToggle = onToggleProp || layoutContext?.toggleSidebar || (() => setLocalExpanded((prev) => !prev));
182
+ const width = widthProp !== void 0 ? widthProp : layoutContext?.sidebarWidth ?? 280;
183
+ const navigate = navigateProp || ((path) => {
184
+ if (typeof window !== "undefined") window.location.href = path;
185
+ });
186
+ const location = locationProp || (typeof window !== "undefined" ? window.location : { pathname: "/" });
187
+ React.useEffect(() => {
188
+ const checkViewport = () => setIsMobileViewport(window.innerWidth < 768);
189
+ checkViewport();
190
+ window.addEventListener("resize", checkViewport);
191
+ return () => window.removeEventListener("resize", checkViewport);
192
+ }, []);
193
+ return /* @__PURE__ */ jsxRuntime.jsx(
194
+ SidebarContext.Provider,
195
+ {
196
+ value: { expanded, isMobileViewport, onToggle, navigate, location, width },
197
+ children: /* @__PURE__ */ jsxRuntime.jsxs(tooltip.TooltipProvider, { delayDuration: 300, children: [
198
+ /* @__PURE__ */ jsxRuntime.jsx("style", { children: `
199
+ @media (max-width: 767px) {
200
+ [style*="padding-left"].flex-1,
201
+ [style*="paddingLeft"].flex-1 {
202
+ padding-left: 0 !important;
203
+ }
204
+ }
205
+ ` }),
206
+ /* @__PURE__ */ jsxRuntime.jsx(
207
+ "div",
208
+ {
209
+ className: button.cn(
210
+ "bg-sidebar text-sidebar-foreground transition-all duration-300 ease-in-out flex flex-col z-50",
211
+ expanded ? "fixed inset-0 md:fixed md:inset-y-0 md:left-0" : "fixed inset-y-0 left-0 w-20 -translate-x-full md:translate-x-0",
212
+ className
213
+ ),
214
+ style: expanded && !isMobileViewport ? { width: `${width}px` } : void 0,
215
+ children
216
+ }
217
+ )
218
+ ] })
219
+ }
220
+ );
221
+ }
222
+ function SidebarHeader({
223
+ logo,
224
+ logoCollapsed
225
+ }) {
226
+ const { expanded, onToggle } = useSidebarContext();
227
+ const { t } = reactI18next.useTranslation();
228
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
229
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0 p-[14px] pt-[13px] pr-[14px] pb-[12px] pl-[14px]", children: /* @__PURE__ */ jsxRuntime.jsx(
230
+ "button",
231
+ {
232
+ onClick: onToggle,
233
+ className: "w-full h-10 flex items-center gap-3 px-3 justify-center rounded-[var(--radius-button)] transition-all duration-200 text-sidebar-foreground/80 hover:bg-sidebar-foreground/15 hover:text-sidebar-foreground",
234
+ "aria-label": expanded ? t("sidebar.collapse") : t("sidebar.expand"),
235
+ "aria-expanded": expanded,
236
+ "aria-controls": "sidebar-nav",
237
+ children: expanded ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeft, { className: "w-5 h-5" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Menu, { className: "w-5 h-5" })
238
+ }
239
+ ) }),
240
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0 px-4 py-4", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center h-10 justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center flex-shrink-0", children: expanded ? logo || /* @__PURE__ */ jsxRuntime.jsx(ThemeToggle.XerticaLogo, { className: "h-5 w-auto", variant: "white" }) : logoCollapsed || /* @__PURE__ */ jsxRuntime.jsx(ThemeToggle.XerticaXLogo, { className: "h-5 w-auto", variant: "white" }) }) }) })
241
+ ] });
242
+ }
243
+ function OverflowGroupsAccordion({
244
+ expanded,
245
+ overflowGroups,
246
+ location,
247
+ handleNavigate,
248
+ moreOptionsLabel,
249
+ onOpenChange
250
+ }) {
251
+ const [isOpen, setIsOpen] = React.useState(false);
252
+ const toggle = () => {
253
+ const next = !isOpen;
254
+ setIsOpen(next);
255
+ onOpenChange?.(next);
256
+ };
257
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
258
+ /* @__PURE__ */ jsxRuntime.jsxs(
259
+ "button",
260
+ {
261
+ onClick: toggle,
262
+ className: button.cn(
263
+ "w-full h-10 flex items-center rounded-[var(--radius-button)] transition-all duration-200 text-sidebar-foreground/80 hover:bg-sidebar-foreground/15 hover:text-sidebar-foreground",
264
+ expanded ? "gap-3 px-3 justify-start" : "justify-center px-0"
265
+ ),
266
+ "aria-expanded": isOpen,
267
+ "aria-label": moreOptionsLabel,
268
+ children: [
269
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreVertical, { className: "w-5 h-5 flex-shrink-0" }),
270
+ expanded && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
271
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate flex-1 text-sidebar-foreground text-left", children: moreOptionsLabel }),
272
+ /* @__PURE__ */ jsxRuntime.jsx(
273
+ lucideReact.ChevronRight,
274
+ {
275
+ className: button.cn("w-4 h-4 flex-shrink-0 transition-transform duration-200", isOpen && "rotate-90")
276
+ }
277
+ )
278
+ ] })
279
+ ]
280
+ }
281
+ ),
282
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { initial: false, children: isOpen && /* @__PURE__ */ jsxRuntime.jsx(
283
+ framerMotion.motion.div,
284
+ {
285
+ initial: { height: 0, opacity: 0 },
286
+ animate: { height: "auto", opacity: 1 },
287
+ exit: { height: 0, opacity: 0 },
288
+ transition: { duration: 0.2 },
289
+ className: "overflow-hidden",
290
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 space-y-3", children: overflowGroups.map((group) => {
291
+ const GroupIcon = group.icon;
292
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
293
+ (group.label || GroupIcon) && expanded && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 mb-1 flex items-center gap-2", children: [
294
+ GroupIcon && (React.isValidElement(GroupIcon) ? GroupIcon : /* @__PURE__ */ jsxRuntime.jsx(GroupIcon, { className: "h-3 w-3 text-sidebar-foreground/60" })),
295
+ group.label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-semibold uppercase tracking-wider text-sidebar-foreground/60", children: group.label })
296
+ ] }),
297
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-0.5", children: group.items.map((item) => {
298
+ const Icon = item.icon;
299
+ const isActive = location.pathname === item.path || location.pathname.startsWith(item.path + "/");
300
+ return /* @__PURE__ */ jsxRuntime.jsxs(
301
+ "button",
302
+ {
303
+ onClick: () => handleNavigate(item.path),
304
+ className: button.cn(
305
+ "w-full h-9 flex items-center gap-2.5 rounded-[var(--radius-button)] transition-all duration-200 text-left text-sm",
306
+ expanded ? "px-3" : "justify-center px-0",
307
+ isActive ? "bg-sidebar-foreground/15 text-sidebar-foreground" : "text-sidebar-foreground/70 hover:bg-sidebar-foreground/10 hover:text-sidebar-foreground"
308
+ ),
309
+ children: [
310
+ Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "w-4 h-4 flex-shrink-0" }),
311
+ expanded && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: item.label })
312
+ ]
313
+ },
314
+ item.path
315
+ );
316
+ }) })
317
+ ] }, group.id);
318
+ }) })
319
+ }
320
+ ) })
321
+ ] });
322
+ }
323
+ function SidebarNav({
324
+ navigationGroups = [],
325
+ routes = [],
326
+ variant = "default"
327
+ }) {
328
+ const { expanded, isMobileViewport, navigate, location, onToggle } = useSidebarContext();
329
+ const { t } = reactI18next.useTranslation();
330
+ const navRef = React.useRef(null);
331
+ const [localActiveItem, setLocalActiveItem] = React.useState(null);
332
+ const [hasOverflow, setHasOverflow] = React.useState(false);
333
+ const [visibleItems, setVisibleItems] = React.useState([]);
334
+ const [overflowItems, setOverflowItems] = React.useState([]);
335
+ const [openSubmenus, setOpenSubmenus] = React.useState(/* @__PURE__ */ new Set());
336
+ const [hasGroupOverflow, setHasGroupOverflow] = React.useState(false);
337
+ const [visibleGroups, setVisibleGroups] = React.useState([]);
338
+ const [overflowGroups, setOverflowGroups] = React.useState([]);
339
+ const [isOverflowAccordionOpen, setIsOverflowAccordionOpen] = React.useState(false);
340
+ const toggleSubmenu = (path) => {
341
+ setOpenSubmenus((prev) => {
342
+ const next = new Set(prev);
343
+ if (next.has(path)) {
344
+ next.delete(path);
345
+ } else {
346
+ next.add(path);
347
+ }
348
+ return next;
349
+ });
350
+ };
351
+ const labelTranslations = React.useMemo(
352
+ () => ({
353
+ home: "Início",
354
+ dashboard: "Painel",
355
+ components: "Componentes"
356
+ }),
357
+ []
358
+ );
359
+ const navigationItems = React.useMemo(
360
+ () => (routes || []).map((route) => ({
361
+ ...route,
362
+ label: labelTranslations[route.label.toLowerCase()] || route.label,
363
+ active: location.pathname === route.path || location.pathname.startsWith(route.path + "/"),
364
+ children: route.children
365
+ })),
366
+ [routes, location.pathname, labelTranslations]
367
+ );
368
+ React.useEffect(() => {
369
+ if (typeof window === "undefined") return;
370
+ const checkOverflow = () => {
371
+ if (!navRef.current) return;
372
+ if (variant === "assistant") return;
373
+ const navHeight = navRef.current.clientHeight;
374
+ const itemHeight = 44;
375
+ const maxVisibleItems = Math.floor(navHeight / itemHeight);
376
+ if (navigationItems.length > maxVisibleItems) {
377
+ setHasOverflow(true);
378
+ setVisibleItems(navigationItems.slice(0, maxVisibleItems - 1));
379
+ setOverflowItems(navigationItems.slice(maxVisibleItems - 1));
380
+ } else {
381
+ setHasOverflow(false);
382
+ setVisibleItems(navigationItems);
383
+ setOverflowItems([]);
384
+ }
385
+ };
386
+ checkOverflow();
387
+ window.addEventListener("resize", checkOverflow);
388
+ return () => window.removeEventListener("resize", checkOverflow);
389
+ }, [navigationItems.length, variant]);
390
+ React.useEffect(() => {
391
+ if (typeof window === "undefined") return;
392
+ if (variant === "assistant") return;
393
+ if (!navigationGroups || navigationGroups.length === 0) return;
394
+ const checkGroupOverflow = () => {
395
+ if (!navRef.current) return;
396
+ const containerHeight = navRef.current.clientHeight;
397
+ const itemHeight = 40;
398
+ const groupHeaderHeight = 32;
399
+ const groupSpacing = 12;
400
+ const moreButtonHeight = 44;
401
+ const padding = 32;
402
+ let currentHeight = padding;
403
+ let visibleCount = 0;
404
+ for (let i = 0; i < navigationGroups.length; i++) {
405
+ const group = navigationGroups[i];
406
+ let groupHeight = 0;
407
+ if (group.label) groupHeight += groupHeaderHeight;
408
+ groupHeight += group.items.length * itemHeight;
409
+ if (i > 0) groupHeight += groupSpacing;
410
+ const wouldExceed = currentHeight + groupHeight + (visibleCount < navigationGroups.length - 1 ? moreButtonHeight : 0) > containerHeight;
411
+ if (wouldExceed && visibleCount > 0) break;
412
+ currentHeight += groupHeight;
413
+ visibleCount++;
414
+ }
415
+ if (visibleCount < navigationGroups.length) {
416
+ setHasGroupOverflow(true);
417
+ setVisibleGroups(navigationGroups.slice(0, visibleCount));
418
+ setOverflowGroups(navigationGroups.slice(visibleCount));
419
+ } else {
420
+ setHasGroupOverflow(false);
421
+ setVisibleGroups(navigationGroups);
422
+ setOverflowGroups([]);
423
+ }
424
+ };
425
+ checkGroupOverflow();
426
+ window.addEventListener("resize", checkGroupOverflow);
427
+ return () => window.removeEventListener("resize", checkGroupOverflow);
428
+ }, [navigationGroups, expanded, variant]);
429
+ const handleNavigate = (path) => {
430
+ setLocalActiveItem(path);
431
+ navigate(path);
432
+ if (typeof window !== "undefined" && window.innerWidth < 768) {
433
+ onToggle();
434
+ }
435
+ };
436
+ const toNavItem = (route) => ({
437
+ path: route.path,
438
+ label: labelTranslations[route.label.toLowerCase()] || route.label,
439
+ icon: route.icon,
440
+ active: location.pathname === route.path || location.pathname.startsWith(route.path + "/"),
441
+ children: route.children,
442
+ actions: route.actions
443
+ });
444
+ const renderActionItems = (actions) => {
445
+ return actions.map((action, idx) => {
446
+ const Icon = action.icon;
447
+ if (action.children && action.children.length > 0) {
448
+ return /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenuSub, { children: [
449
+ /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenuSubTrigger, { children: [
450
+ Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "mr-2 h-4 w-4" }),
451
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: action.label })
452
+ ] }),
453
+ /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuPortal, { children: /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuSubContent, { className: "w-48 bg-popover border-border", children: renderActionItems(action.children) }) })
454
+ ] }, idx);
455
+ }
456
+ return /* @__PURE__ */ jsxRuntime.jsxs(
457
+ dropdownMenu.DropdownMenuItem,
458
+ {
459
+ className: button.cn(
460
+ "flex items-center gap-2",
461
+ action.variant === "destructive" ? "text-destructive focus:text-destructive" : ""
462
+ ),
463
+ onClick: (e) => {
464
+ e.stopPropagation();
465
+ action.onClick?.(null);
466
+ },
467
+ children: [
468
+ Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "h-4 w-4 flex-shrink-0" }),
469
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: action.label })
470
+ ]
471
+ },
472
+ idx
473
+ );
474
+ });
475
+ };
476
+ const renderAssistantActionMenu = (actions, isHeader = false) => {
477
+ if (!actions || actions.length === 0) return null;
478
+ return /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenu, { children: [
479
+ /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
480
+ button.Button,
481
+ {
482
+ variant: "ghost",
483
+ size: "icon",
484
+ className: button.cn(
485
+ "h-8 w-8 text-sidebar-foreground/80 hover:bg-sidebar-foreground/20 hover:text-sidebar-foreground rounded-full transition-all",
486
+ !isHeader && "opacity-0 group-hover/item:opacity-100"
487
+ ),
488
+ "aria-label": t("sidebar.moreOptions"),
489
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreVertical, { className: "h-4 w-4" })
490
+ }
491
+ ) }),
492
+ /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuContent, { align: "end", className: "w-48 bg-popover border-border p-1", children: renderActionItems(actions) })
493
+ ] });
494
+ };
495
+ const renderDefaultItem = (item) => {
496
+ const Icon = item.icon;
497
+ const hasChildren = item.children && item.children.length > 0;
498
+ const activeClass = item.active ? "bg-sidebar-foreground/15 text-sidebar-foreground shadow-sm" : "text-sidebar-foreground/80 hover:bg-sidebar-foreground/15 hover:text-sidebar-foreground";
499
+ if (!expanded) {
500
+ return /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
501
+ /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
502
+ "button",
503
+ {
504
+ onClick: () => handleNavigate(item.path),
505
+ className: button.cn(
506
+ "w-full h-10 flex items-center justify-center px-0 rounded-[var(--radius-button)] transition-all duration-200",
507
+ activeClass
508
+ ),
509
+ "aria-label": item.label,
510
+ children: Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "w-5 h-5 flex-shrink-0" })
511
+ }
512
+ ) }),
513
+ /* @__PURE__ */ jsxRuntime.jsx(CustomTooltipContent.CustomTooltipContent, { side: "right", sideOffset: 0, children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: item.label }) })
514
+ ] }, item.path);
515
+ }
516
+ if (isMobileViewport && hasChildren) {
517
+ const isOpen = openSubmenus.has(item.path);
518
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
519
+ /* @__PURE__ */ jsxRuntime.jsxs(
520
+ "div",
521
+ {
522
+ className: button.cn(
523
+ "group/item flex items-center w-full h-10 rounded-[var(--radius-button)] transition-all duration-200",
524
+ activeClass
525
+ ),
526
+ children: [
527
+ /* @__PURE__ */ jsxRuntime.jsxs(
528
+ "button",
529
+ {
530
+ onClick: () => handleNavigate(item.path),
531
+ className: "flex items-center gap-3 px-3 flex-1 h-full min-w-0 text-left",
532
+ children: [
533
+ Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "w-5 h-5 flex-shrink-0" }),
534
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate flex-1", children: item.label })
535
+ ]
536
+ }
537
+ ),
538
+ /* @__PURE__ */ jsxRuntime.jsx(
539
+ "button",
540
+ {
541
+ onClick: (e) => {
542
+ e.stopPropagation();
543
+ toggleSubmenu(item.path);
544
+ },
545
+ className: "h-full px-2 pr-2.5 flex items-center justify-center text-sidebar-foreground/40 hover:text-sidebar-foreground transition-colors",
546
+ "aria-label": t("sidebar.submenu", { label: item.label }),
547
+ "aria-expanded": isOpen,
548
+ children: /* @__PURE__ */ jsxRuntime.jsx(
549
+ lucideReact.ChevronRight,
550
+ {
551
+ className: button.cn("w-4 h-4 transition-transform duration-200", isOpen && "rotate-90")
552
+ }
553
+ )
554
+ }
555
+ )
556
+ ]
557
+ }
558
+ ),
559
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { initial: false, children: isOpen && /* @__PURE__ */ jsxRuntime.jsx(
560
+ framerMotion.motion.div,
561
+ {
562
+ initial: { height: 0, opacity: 0 },
563
+ animate: { height: "auto", opacity: 1 },
564
+ exit: { height: 0, opacity: 0 },
565
+ transition: { duration: 0.2 },
566
+ className: "overflow-hidden",
567
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-4 mt-0.5 mb-0.5 space-y-0.5", children: item.children.map((child) => {
568
+ const ChildIcon = child.icon;
569
+ const isChildActive = location.pathname === child.path || location.pathname.startsWith(child.path + "/");
570
+ return /* @__PURE__ */ jsxRuntime.jsxs(
571
+ "button",
572
+ {
573
+ onClick: () => handleNavigate(child.path),
574
+ className: button.cn(
575
+ "w-full h-9 flex items-center gap-2.5 px-3 rounded-[var(--radius-button)] transition-all duration-200 text-left",
576
+ isChildActive ? "bg-sidebar-foreground/15 text-sidebar-foreground" : "text-sidebar-foreground/70 hover:bg-sidebar-foreground/10 hover:text-sidebar-foreground"
577
+ ),
578
+ children: [
579
+ ChildIcon && /* @__PURE__ */ jsxRuntime.jsx(ChildIcon, { className: "h-4 w-4 flex-shrink-0" }),
580
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sm", children: child.label })
581
+ ]
582
+ },
583
+ child.path
584
+ );
585
+ }) })
586
+ }
587
+ ) })
588
+ ] }, item.path);
589
+ }
590
+ return /* @__PURE__ */ jsxRuntime.jsxs(
591
+ "div",
592
+ {
593
+ className: button.cn(
594
+ "group/item flex items-center w-full h-10 rounded-[var(--radius-button)] transition-all duration-200",
595
+ activeClass
596
+ ),
597
+ children: [
598
+ /* @__PURE__ */ jsxRuntime.jsxs(
599
+ "button",
600
+ {
601
+ onClick: () => handleNavigate(item.path),
602
+ className: "flex items-center gap-3 px-3 flex-1 h-full min-w-0 text-left",
603
+ children: [
604
+ Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "w-5 h-5 flex-shrink-0" }),
605
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate flex-1", children: item.label })
606
+ ]
607
+ }
608
+ ),
609
+ hasChildren && /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenu, { children: [
610
+ /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
611
+ "button",
612
+ {
613
+ onClick: (e) => e.stopPropagation(),
614
+ className: "h-full px-2 pr-2.5 flex items-center justify-center text-sidebar-foreground/40 hover:text-sidebar-foreground transition-colors",
615
+ "aria-label": t("sidebar.submenu", { label: item.label }),
616
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "w-4 h-4" })
617
+ }
618
+ ) }),
619
+ /* @__PURE__ */ jsxRuntime.jsx(
620
+ dropdownMenu.DropdownMenuContent,
621
+ {
622
+ side: "right",
623
+ align: "start",
624
+ className: "w-48 bg-popover border-border p-1",
625
+ children: item.children.map((child) => {
626
+ const ChildIcon = child.icon;
627
+ const isChildActive = location.pathname === child.path || location.pathname.startsWith(child.path + "/");
628
+ return /* @__PURE__ */ jsxRuntime.jsxs(
629
+ dropdownMenu.DropdownMenuItem,
630
+ {
631
+ onClick: () => handleNavigate(child.path),
632
+ className: button.cn(
633
+ "flex items-center gap-2 cursor-pointer",
634
+ isChildActive && "bg-accent text-accent-foreground"
635
+ ),
636
+ children: [
637
+ ChildIcon && /* @__PURE__ */ jsxRuntime.jsx(ChildIcon, { className: "h-4 w-4 flex-shrink-0" }),
638
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: child.label })
639
+ ]
640
+ },
641
+ child.path
642
+ );
643
+ })
644
+ }
645
+ )
646
+ ] })
647
+ ]
648
+ },
649
+ item.path
650
+ );
651
+ };
652
+ const renderDefaultGroup = (group) => {
653
+ const GroupIcon = group.icon;
654
+ if (!expanded) {
655
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: group.items.map((item) => renderDefaultItem(toNavItem(item))) }, group.id);
656
+ }
657
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
658
+ (group.label || GroupIcon) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 mb-1 flex items-center gap-2", children: [
659
+ GroupIcon && (React.isValidElement(GroupIcon) ? GroupIcon : /* @__PURE__ */ jsxRuntime.jsx(GroupIcon, { className: "h-3 w-3 text-sidebar-foreground/80" })),
660
+ group.label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-semibold uppercase tracking-wider text-sidebar-foreground/80", children: group.label })
661
+ ] }),
662
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: group.items.map((item) => renderDefaultItem(toNavItem(item))) })
663
+ ] }, group.id);
664
+ };
665
+ const renderAssistantGroup = (group) => {
666
+ const isAnyItemActive = group.items.some(
667
+ (item) => location.pathname === item.path || location.pathname.startsWith(item.path + "/")
668
+ );
669
+ const GroupIcon = group.icon;
670
+ if (!expanded) {
671
+ if (!GroupIcon) return null;
672
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-2 flex justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
673
+ /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
674
+ "button",
675
+ {
676
+ onClick: () => onToggle(),
677
+ "aria-label": group.label,
678
+ className: button.cn(
679
+ "h-10 w-10 flex items-center justify-center rounded-[var(--radius-button)] transition-all duration-200",
680
+ isAnyItemActive ? "bg-sidebar-foreground/15 text-sidebar-foreground shadow-sm" : "text-sidebar-foreground/80 hover:bg-sidebar-foreground/15 hover:text-sidebar-foreground"
681
+ ),
682
+ children: React.isValidElement(GroupIcon) ? GroupIcon : /* @__PURE__ */ jsxRuntime.jsx(GroupIcon, { className: "h-5 w-5" })
683
+ }
684
+ ) }),
685
+ /* @__PURE__ */ jsxRuntime.jsx(CustomTooltipContent.CustomTooltipContent, { side: "right", children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: group.label }) })
686
+ ] }) }, group.id);
687
+ }
688
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "py-2 group", children: [
689
+ (group.label || group.icon) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-3 mb-1", children: [
690
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-sidebar-foreground/80 text-xs font-semibold uppercase tracking-wider", children: [
691
+ GroupIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: React.isValidElement(GroupIcon) ? GroupIcon : /* @__PURE__ */ jsxRuntime.jsx(GroupIcon, { className: "h-4 w-4" }) }),
692
+ group.label && /* @__PURE__ */ jsxRuntime.jsx("span", { children: group.label })
693
+ ] }),
694
+ renderAssistantActionMenu(group.actions, true)
695
+ ] }),
696
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: group.items.map((item) => {
697
+ const isRouteActive = location.pathname === item.path || location.pathname.startsWith(item.path + "/");
698
+ const isActive = isRouteActive || localActiveItem === item.path;
699
+ const Icon = item.icon;
700
+ return /* @__PURE__ */ jsxRuntime.jsxs(
701
+ "div",
702
+ {
703
+ className: `group/item flex items-start justify-between px-3 min-h-[36px] py-2.5 rounded-[var(--radius-button)] cursor-pointer transition-all duration-200 ${isActive ? "bg-sidebar-foreground/15 text-sidebar-foreground" : "text-sidebar-foreground/80 hover:bg-sidebar-foreground/10 hover:text-sidebar-foreground"}`,
704
+ onClick: () => handleNavigate(item.path),
705
+ children: [
706
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col min-w-0 flex-1", children: [
707
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 overflow-hidden h-5", children: [
708
+ Icon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-4 h-4 flex-shrink-0 flex items-center justify-center", children: React.isValidElement(Icon) ? Icon : /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "w-4 h-4" }) }),
709
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sm font-medium leading-none", children: item.label })
710
+ ] }),
711
+ isActive && item.description && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[11px] text-sidebar-foreground/60 mt-1.5 animate-in fade-in slide-in-from-top-1 duration-200", children: item.description })
712
+ ] }),
713
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-5 flex items-center ml-1", children: renderAssistantActionMenu(item.actions) })
714
+ ]
715
+ },
716
+ item.path
717
+ );
718
+ }) })
719
+ ] }, group.id);
720
+ };
721
+ if (variant === "assistant") {
722
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-h-0 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
723
+ "div",
724
+ {
725
+ className: "h-full px-4",
726
+ style: { overflowY: "auto", overflowX: "hidden" },
727
+ children: navigationGroups.map((group) => renderAssistantGroup(group))
728
+ }
729
+ ) });
730
+ }
731
+ if (isMobileViewport && isOverflowAccordionOpen) {
732
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-h-0 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
733
+ "div",
734
+ {
735
+ className: "h-full",
736
+ style: { overflowY: "auto", overflowX: "hidden" },
737
+ children: /* @__PURE__ */ jsxRuntime.jsx(
738
+ "nav",
739
+ {
740
+ id: "sidebar-nav",
741
+ "aria-label": t("sidebar.mainNavigation"),
742
+ className: "px-4 py-4",
743
+ ref: navRef,
744
+ children: navigationGroups && navigationGroups.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
745
+ (hasGroupOverflow ? visibleGroups : navigationGroups).map((group) => /* @__PURE__ */ jsxRuntime.jsx(React.Fragment, { children: renderDefaultGroup(group) }, group.id)),
746
+ hasGroupOverflow && /* @__PURE__ */ jsxRuntime.jsx(
747
+ OverflowGroupsAccordion,
748
+ {
749
+ expanded,
750
+ overflowGroups,
751
+ location,
752
+ handleNavigate,
753
+ moreOptionsLabel: t("sidebar.moreOptions"),
754
+ onOpenChange: setIsOverflowAccordionOpen
755
+ }
756
+ )
757
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
758
+ (hasOverflow ? visibleItems : navigationItems).map((item) => renderDefaultItem(item)),
759
+ hasOverflow && /* @__PURE__ */ jsxRuntime.jsxs(input.Popover, { children: [
760
+ /* @__PURE__ */ jsxRuntime.jsx(input.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
761
+ "button",
762
+ {
763
+ className: expanded ? "w-full h-10 flex items-center gap-3 px-3 justify-start rounded-[var(--radius-button)] transition-all duration-200 text-sidebar-foreground/80 hover:bg-sidebar-foreground/15 hover:text-sidebar-foreground" : "w-full h-10 flex items-center justify-center px-0 rounded-[var(--radius-button)] transition-all duration-200 text-sidebar-foreground/80 hover:bg-sidebar-foreground/15 hover:text-sidebar-foreground",
764
+ "aria-label": t("sidebar.moreOptions"),
765
+ children: [
766
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreVertical, { className: "w-5 h-5 flex-shrink-0" }),
767
+ expanded && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sidebar-foreground", children: t("sidebar.moreOptions") })
768
+ ]
769
+ }
770
+ ) }),
771
+ /* @__PURE__ */ jsxRuntime.jsx(
772
+ input.PopoverContent,
773
+ {
774
+ side: "right",
775
+ align: "start",
776
+ className: "w-56 p-2 bg-popover border border-border rounded-[var(--radius-card)] shadow-lg",
777
+ sideOffset: 8,
778
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: overflowItems.map((item) => {
779
+ const Icon = item.icon;
780
+ return /* @__PURE__ */ jsxRuntime.jsxs(
781
+ "button",
782
+ {
783
+ onClick: () => handleNavigate(item.path),
784
+ className: "w-full h-9 flex items-center gap-2 px-3 rounded-[var(--radius-button)] transition-all duration-200 text-popover-foreground/80 hover:bg-accent hover:text-accent-foreground text-left",
785
+ children: [
786
+ Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "w-4 h-4 flex-shrink-0" }),
787
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: item.label })
788
+ ]
789
+ },
790
+ item.path
791
+ );
792
+ }) })
793
+ }
794
+ )
795
+ ] })
796
+ ] })
797
+ }
798
+ )
799
+ }
800
+ ) });
801
+ }
802
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-h-0 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
803
+ "nav",
804
+ {
805
+ id: "sidebar-nav",
806
+ "aria-label": t("sidebar.mainNavigation"),
807
+ className: "h-full px-4 py-4 overflow-hidden",
808
+ ref: navRef,
809
+ children: navigationGroups && navigationGroups.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
810
+ (hasGroupOverflow ? visibleGroups : navigationGroups).map((group) => /* @__PURE__ */ jsxRuntime.jsx(React.Fragment, { children: renderDefaultGroup(group) }, group.id)),
811
+ hasGroupOverflow && (isMobileViewport ? (
812
+ // Mobile: accordion inline abre abaixo, igual aos subitens
813
+ /* @__PURE__ */ jsxRuntime.jsx(
814
+ OverflowGroupsAccordion,
815
+ {
816
+ expanded,
817
+ overflowGroups,
818
+ location,
819
+ handleNavigate,
820
+ moreOptionsLabel: t("sidebar.moreOptions"),
821
+ onOpenChange: setIsOverflowAccordionOpen
822
+ }
823
+ )
824
+ ) : (
825
+ // Desktop: popover lateral direito
826
+ /* @__PURE__ */ jsxRuntime.jsxs(input.Popover, { children: [
827
+ /* @__PURE__ */ jsxRuntime.jsx(input.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
828
+ "button",
829
+ {
830
+ className: expanded ? "w-full h-10 flex items-center gap-3 px-3 justify-start rounded-[var(--radius-button)] transition-all duration-200 text-sidebar-foreground/80 hover:bg-sidebar-foreground/15 hover:text-sidebar-foreground" : "w-full h-10 flex items-center justify-center px-0 rounded-[var(--radius-button)] transition-all duration-200 text-sidebar-foreground/80 hover:bg-sidebar-foreground/15 hover:text-sidebar-foreground",
831
+ "aria-label": t("sidebar.moreOptions"),
832
+ children: [
833
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreVertical, { className: "w-5 h-5 flex-shrink-0" }),
834
+ expanded && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sidebar-foreground", children: t("sidebar.moreOptions") })
835
+ ]
836
+ }
837
+ ) }),
838
+ /* @__PURE__ */ jsxRuntime.jsx(
839
+ input.PopoverContent,
840
+ {
841
+ side: "right",
842
+ align: "start",
843
+ className: "w-56 p-2 bg-popover border border-border rounded-[var(--radius-card)] shadow-lg",
844
+ sideOffset: 8,
845
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: overflowGroups.map((group) => {
846
+ const GroupIcon = group.icon;
847
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
848
+ (group.label || GroupIcon) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-2 mb-1 flex items-center gap-2", children: [
849
+ GroupIcon && (React.isValidElement(GroupIcon) ? GroupIcon : /* @__PURE__ */ jsxRuntime.jsx(GroupIcon, { className: "h-3 w-3 text-popover-foreground/60" })),
850
+ group.label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-semibold uppercase tracking-wider text-popover-foreground/60", children: group.label })
851
+ ] }),
852
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: group.items.map((item) => {
853
+ const Icon = item.icon;
854
+ const isActive = location.pathname === item.path || location.pathname.startsWith(item.path + "/");
855
+ return /* @__PURE__ */ jsxRuntime.jsxs(
856
+ "button",
857
+ {
858
+ onClick: () => handleNavigate(item.path),
859
+ className: button.cn(
860
+ "w-full h-9 flex items-center gap-2 px-2 rounded-[var(--radius-button)] transition-all duration-200 text-left text-sm",
861
+ isActive ? "bg-accent text-accent-foreground font-medium" : "text-popover-foreground/80 hover:bg-accent hover:text-accent-foreground"
862
+ ),
863
+ children: [
864
+ Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "w-4 h-4 flex-shrink-0" }),
865
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: item.label })
866
+ ]
867
+ },
868
+ item.path
869
+ );
870
+ }) })
871
+ ] }, group.id);
872
+ }) })
873
+ }
874
+ )
875
+ ] })
876
+ ))
877
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
878
+ (hasOverflow ? visibleItems : navigationItems).map((item) => renderDefaultItem(item)),
879
+ hasOverflow && /* @__PURE__ */ jsxRuntime.jsxs(input.Popover, { children: [
880
+ /* @__PURE__ */ jsxRuntime.jsx(input.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
881
+ "button",
882
+ {
883
+ className: expanded ? "w-full h-10 flex items-center gap-3 px-3 justify-start rounded-[var(--radius-button)] transition-all duration-200 text-sidebar-foreground/80 hover:bg-sidebar-foreground/15 hover:text-sidebar-foreground" : "w-full h-10 flex items-center justify-center px-0 rounded-[var(--radius-button)] transition-all duration-200 text-sidebar-foreground/80 hover:bg-sidebar-foreground/15 hover:text-sidebar-foreground",
884
+ "aria-label": t("sidebar.moreOptions"),
885
+ children: [
886
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreVertical, { className: "w-5 h-5 flex-shrink-0" }),
887
+ expanded && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sidebar-foreground", children: t("sidebar.moreOptions") })
888
+ ]
889
+ }
890
+ ) }),
891
+ /* @__PURE__ */ jsxRuntime.jsx(
892
+ input.PopoverContent,
893
+ {
894
+ side: "right",
895
+ align: "start",
896
+ className: "w-56 p-2 bg-popover border border-border rounded-[var(--radius-card)] shadow-lg",
897
+ sideOffset: 8,
898
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: overflowItems.map((item) => {
899
+ const Icon = item.icon;
900
+ return /* @__PURE__ */ jsxRuntime.jsxs(
901
+ "button",
902
+ {
903
+ onClick: () => handleNavigate(item.path),
904
+ className: "w-full h-9 flex items-center gap-2 px-3 rounded-[var(--radius-button)] transition-all duration-200 text-popover-foreground/80 hover:bg-accent hover:text-accent-foreground text-left",
905
+ children: [
906
+ Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "w-4 h-4 flex-shrink-0" }),
907
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: item.label })
908
+ ]
909
+ },
910
+ item.path
911
+ );
912
+ }) })
913
+ }
914
+ )
915
+ ] })
916
+ ] })
917
+ }
918
+ ) });
919
+ }
920
+ function SidebarSearch({
921
+ fixedArea,
922
+ search
923
+ }) {
924
+ const { expanded } = useSidebarContext();
925
+ const { t } = reactI18next.useTranslation();
926
+ const [isFilterOpen, setIsFilterOpen] = React.useState(false);
927
+ if (!(fixedArea && fixedArea.show || search && search.show)) return null;
928
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-shrink-0 px-4 pb-4 space-y-4 border-b border-sidebar-border/30 mb-2", children: [
929
+ fixedArea?.show && fixedArea.content && expanded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-in fade-in slide-in-from-top-1 duration-300", children: fixedArea.content }),
930
+ search?.show && expanded && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
931
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
932
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-1", children: [
933
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-sidebar-foreground/50" }),
934
+ /* @__PURE__ */ jsxRuntime.jsx(
935
+ input.Input,
936
+ {
937
+ type: "text",
938
+ placeholder: search.placeholder || t("sidebar.searchPlaceholder"),
939
+ "aria-label": search.placeholder || t("sidebar.searchPlaceholder"),
940
+ value: search.value,
941
+ onChange: (e) => search.onChange?.(e.target.value),
942
+ className: "w-full h-9 bg-sidebar-foreground/10 border-sidebar-border text-sidebar-foreground placeholder:text-sidebar-foreground/50 pl-9 focus-visible:ring-1 focus-visible:ring-sidebar-foreground/30 focus-visible:ring-offset-0"
943
+ }
944
+ )
945
+ ] }),
946
+ search.filter?.show && search.filter.content && /* @__PURE__ */ jsxRuntime.jsx(
947
+ button.Button,
948
+ {
949
+ variant: "ghost",
950
+ size: "icon",
951
+ onClick: () => setIsFilterOpen(!isFilterOpen),
952
+ className: button.cn(
953
+ "h-9 w-9 text-sidebar-foreground transition-all duration-200",
954
+ isFilterOpen ? "bg-sidebar-foreground/20" : "hover:bg-sidebar-foreground/15"
955
+ ),
956
+ "aria-label": isFilterOpen ? t("sidebar.closeFilters") : t("sidebar.openFilters"),
957
+ children: search.filter.icon || /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Filter, { className: "h-4 w-4" })
958
+ }
959
+ )
960
+ ] }),
961
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: isFilterOpen && search.filter?.show && search.filter.content && /* @__PURE__ */ jsxRuntime.jsx(
962
+ framerMotion.motion.div,
963
+ {
964
+ initial: { height: 0, opacity: 0 },
965
+ animate: { height: "auto", opacity: 1 },
966
+ exit: { height: 0, opacity: 0 },
967
+ transition: { duration: 0.2 },
968
+ className: "overflow-hidden",
969
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pt-2 border-t border-sidebar-border/20", children: search.filter.content })
970
+ }
971
+ ) })
972
+ ] }),
973
+ !expanded && (fixedArea?.show || search?.show) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-4 py-2", children: [
974
+ fixedArea?.show && fixedArea.icon && /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
975
+ /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
976
+ "button",
977
+ {
978
+ onClick: () => fixedArea.onClick?.(),
979
+ className: "h-10 w-10 flex items-center justify-center rounded-[var(--radius-button)] bg-primary text-primary-foreground shadow-sm hover:bg-primary/90 transition-all",
980
+ "aria-label": t("assistant.newConversation"),
981
+ children: React.isValidElement(fixedArea.icon) ? fixedArea.icon : (() => {
982
+ const FixedAreaIcon = fixedArea.icon;
983
+ return /* @__PURE__ */ jsxRuntime.jsx(FixedAreaIcon, { className: "h-5 w-5" });
984
+ })()
985
+ }
986
+ ) }),
987
+ /* @__PURE__ */ jsxRuntime.jsx(CustomTooltipContent.CustomTooltipContent, { side: "right", children: t("assistant.newConversation") })
988
+ ] }),
989
+ search?.show && /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
990
+ /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
991
+ "button",
992
+ {
993
+ className: "h-10 w-10 flex items-center justify-center rounded-[var(--radius-button)] text-sidebar-foreground/80 hover:bg-sidebar-foreground/15 hover:text-sidebar-foreground",
994
+ "aria-label": t("sidebar.search"),
995
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "h-5 w-5" })
996
+ }
997
+ ) }),
998
+ /* @__PURE__ */ jsxRuntime.jsx(CustomTooltipContent.CustomTooltipContent, { side: "right", children: t("sidebar.search") })
999
+ ] })
1000
+ ] })
1001
+ ] });
1002
+ }
1003
+ function SidebarFooter({
1004
+ user,
1005
+ onLogout = () => {
1006
+ },
1007
+ onSettingsClick,
1008
+ showUser = true,
1009
+ showSettings = true,
1010
+ showLogout = true
1011
+ }) {
1012
+ const { expanded, navigate, location, onToggle } = useSidebarContext();
1013
+ const { t } = reactI18next.useTranslation();
1014
+ const isSettingsActive = location.pathname === "/settings";
1015
+ const handleSettingsClick = () => {
1016
+ if (onSettingsClick) {
1017
+ onSettingsClick();
1018
+ } else {
1019
+ navigate("/settings");
1020
+ }
1021
+ if (typeof window !== "undefined" && window.innerWidth < 768) {
1022
+ onToggle();
1023
+ }
1024
+ };
1025
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-shrink-0 p-4 space-y-2", children: [
1026
+ showUser && (!expanded ? /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
1027
+ /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1028
+ "button",
1029
+ {
1030
+ className: "w-full h-10 flex items-center justify-center px-0 rounded-[var(--radius-button)] transition-all duration-200 text-sidebar-foreground/80 hover:bg-sidebar-foreground/15 hover:text-sidebar-foreground",
1031
+ "aria-label": t("sidebar.userProfile"),
1032
+ children: /* @__PURE__ */ jsxRuntime.jsxs(avatar.Avatar, { className: "w-7 h-7 flex-shrink-0", children: [
1033
+ /* @__PURE__ */ jsxRuntime.jsx(avatar.AvatarImage, { src: user?.avatar, alt: user?.name || "User" }),
1034
+ /* @__PURE__ */ jsxRuntime.jsx(avatar.AvatarFallback, { className: "bg-sidebar-foreground/15 text-sidebar-foreground text-xs", children: user?.name ? user.name.charAt(0).toUpperCase() : "U" })
1035
+ ] })
1036
+ }
1037
+ ) }),
1038
+ /* @__PURE__ */ jsxRuntime.jsx(CustomTooltipContent.CustomTooltipContent, { side: "right", sideOffset: 0, children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: user?.name || t("sidebar.profile") }) })
1039
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs("button", { className: "w-full h-10 flex items-center gap-3 px-3 justify-start rounded-[var(--radius-button)] transition-all duration-200 text-sidebar-foreground/80 hover:bg-sidebar-foreground/15 hover:text-sidebar-foreground", children: [
1040
+ /* @__PURE__ */ jsxRuntime.jsxs(avatar.Avatar, { className: "w-7 h-7 flex-shrink-0", children: [
1041
+ /* @__PURE__ */ jsxRuntime.jsx(avatar.AvatarImage, { src: user?.avatar, alt: user?.name || "User" }),
1042
+ /* @__PURE__ */ jsxRuntime.jsx(avatar.AvatarFallback, { className: "bg-sidebar-foreground/15 text-sidebar-foreground text-xs", children: user?.name ? user.name.charAt(0).toUpperCase() : "U" })
1043
+ ] }),
1044
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sidebar-foreground truncate", children: user?.name || t("sidebar.profile") })
1045
+ ] })),
1046
+ showSettings && (!expanded ? /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
1047
+ /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1048
+ "button",
1049
+ {
1050
+ onClick: handleSettingsClick,
1051
+ className: button.cn(
1052
+ "w-full h-10 flex items-center justify-center px-0 rounded-[var(--radius-button)] transition-all duration-200",
1053
+ isSettingsActive ? "bg-sidebar-foreground/15 text-sidebar-foreground shadow-sm" : "text-sidebar-foreground/80 hover:bg-sidebar-foreground/15 hover:text-sidebar-foreground"
1054
+ ),
1055
+ "aria-label": t("nav.settings"),
1056
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { className: "w-5 h-5 flex-shrink-0" })
1057
+ }
1058
+ ) }),
1059
+ /* @__PURE__ */ jsxRuntime.jsx(CustomTooltipContent.CustomTooltipContent, { side: "right", sideOffset: 0, children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: t("nav.settings") }) })
1060
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(
1061
+ "button",
1062
+ {
1063
+ onClick: handleSettingsClick,
1064
+ className: button.cn(
1065
+ "w-full h-10 flex items-center gap-3 px-3 justify-start rounded-[var(--radius-button)] transition-all duration-200",
1066
+ isSettingsActive ? "bg-sidebar-foreground/15 text-sidebar-foreground shadow-sm" : "text-sidebar-foreground/80 hover:bg-sidebar-foreground/15 hover:text-sidebar-foreground"
1067
+ ),
1068
+ children: [
1069
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { className: "w-5 h-5 flex-shrink-0" }),
1070
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sidebar-foreground", children: t("nav.settings") })
1071
+ ]
1072
+ }
1073
+ )),
1074
+ showLogout && (!expanded ? /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
1075
+ /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1076
+ "button",
1077
+ {
1078
+ onClick: onLogout,
1079
+ className: "w-full h-10 flex items-center justify-center px-0 rounded-[var(--radius-button)] transition-all duration-200 text-sidebar-foreground/80 hover:bg-sidebar-foreground/15 hover:text-sidebar-foreground",
1080
+ "aria-label": t("sidebar.logout"),
1081
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogOut, { className: "w-5 h-5 flex-shrink-0" })
1082
+ }
1083
+ ) }),
1084
+ /* @__PURE__ */ jsxRuntime.jsx(CustomTooltipContent.CustomTooltipContent, { side: "right", sideOffset: 0, children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: t("sidebar.logout") }) })
1085
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(
1086
+ "button",
1087
+ {
1088
+ onClick: onLogout,
1089
+ className: "w-full h-10 flex items-center gap-3 px-3 justify-start rounded-[var(--radius-button)] transition-all duration-200 text-sidebar-foreground/80 hover:bg-sidebar-foreground/15 hover:text-sidebar-foreground",
1090
+ children: [
1091
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogOut, { className: "w-5 h-5 flex-shrink-0" }),
1092
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sidebar-foreground", children: t("sidebar.logout") })
1093
+ ]
1094
+ }
1095
+ ))
1096
+ ] });
1097
+ }
1098
+ function Sidebar({
1099
+ expanded: expandedProp,
1100
+ onToggle: onToggleProp,
1101
+ user,
1102
+ onLogout = () => {
1103
+ },
1104
+ onSettingsClick,
1105
+ location: locationProp,
1106
+ navigate: navigateProp,
1107
+ routes,
1108
+ logo,
1109
+ logoCollapsed,
1110
+ variant = "default",
1111
+ fixedArea,
1112
+ search,
1113
+ navigationGroups = [],
1114
+ footer,
1115
+ showFooter,
1116
+ width: widthProp
1117
+ }) {
1118
+ const { showUser = true, showSettings = true, showLogout = true } = footer || {};
1119
+ const displayFooter = showFooter !== void 0 ? showFooter : variant === "default";
1120
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1121
+ SidebarRoot,
1122
+ {
1123
+ expanded: expandedProp,
1124
+ onToggle: onToggleProp,
1125
+ navigate: navigateProp,
1126
+ location: locationProp,
1127
+ width: widthProp,
1128
+ children: [
1129
+ /* @__PURE__ */ jsxRuntime.jsx(SidebarHeader, { logo, logoCollapsed }),
1130
+ variant === "assistant" && /* @__PURE__ */ jsxRuntime.jsx(SidebarSearch, { fixedArea, search }),
1131
+ /* @__PURE__ */ jsxRuntime.jsx(SidebarNav, { navigationGroups, routes, variant }),
1132
+ displayFooter && (showUser || showSettings || showLogout) && /* @__PURE__ */ jsxRuntime.jsx(
1133
+ SidebarFooter,
1134
+ {
1135
+ user,
1136
+ onLogout,
1137
+ onSettingsClick,
1138
+ showUser,
1139
+ showSettings,
1140
+ showLogout
1141
+ }
1142
+ )
1143
+ ]
1144
+ }
1145
+ );
1146
+ }
1147
+ Sidebar.Root = SidebarRoot;
1148
+ Sidebar.Header = SidebarHeader;
1149
+ Sidebar.Search = SidebarSearch;
1150
+ Sidebar.Nav = SidebarNav;
1151
+ Sidebar.Footer = SidebarFooter;
1152
+
1153
+ exports.Header = Header;
1154
+ exports.Sidebar = Sidebar;