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