xertica-ui 2.5.0 → 2.5.2

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 (536) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +56 -17
  3. package/assets/xertica-logo.svg +37 -37
  4. package/assets/xertica-x-logo.svg +20 -20
  5. package/bin/cli.ts +14 -2
  6. package/bin/generate-tokens.ts +262 -262
  7. package/bin/language-config.ts +359 -358
  8. package/components/assistant/code-block/CodeBlock.tsx +268 -268
  9. package/components/assistant/formatted-document/FormattedDocument.tsx +147 -147
  10. package/components/assistant/modern-chat-input/ModernChatInput.tsx +564 -564
  11. package/components/assistant/xertica-assistant/parts/AssistantCollapsedView.tsx +99 -99
  12. package/components/assistant/xertica-assistant/parts/AssistantConversationList.tsx +104 -104
  13. package/components/assistant/xertica-assistant/parts/AssistantDocumentEditor.tsx +81 -81
  14. package/components/assistant/xertica-assistant/parts/AssistantFeedbackDialog.tsx +88 -88
  15. package/components/assistant/xertica-assistant/parts/AssistantHeader.tsx +75 -75
  16. package/components/assistant/xertica-assistant/parts/AssistantMessageBubble.tsx +564 -564
  17. package/components/assistant/xertica-assistant/parts/AssistantTabBar.tsx +67 -67
  18. package/components/assistant/xertica-assistant/parts/AssistantWelcomeScreen.tsx +103 -103
  19. package/components/assistant/xertica-assistant/use-assistant.ts +615 -615
  20. package/components/assistant/xertica-assistant/xertica-assistant.tsx +611 -611
  21. package/components/blocks/card-patterns/ActivityCard.tsx +100 -100
  22. package/components/blocks/card-patterns/ActivityCardSkeleton.tsx +56 -56
  23. package/components/blocks/card-patterns/FeatureCardSkeleton.tsx +58 -58
  24. package/components/blocks/card-patterns/NotificationCard.tsx +140 -140
  25. package/components/blocks/card-patterns/NotificationCardSkeleton.tsx +81 -81
  26. package/components/blocks/card-patterns/ProfileCard.tsx +112 -112
  27. package/components/blocks/card-patterns/ProfileCardSkeleton.tsx +69 -69
  28. package/components/blocks/card-patterns/ProjectCard.tsx +123 -123
  29. package/components/blocks/card-patterns/ProjectCardSkeleton.tsx +67 -67
  30. package/components/blocks/card-patterns/QuickActionCardSkeleton.tsx +44 -44
  31. package/components/blocks/card-patterns/card-patterns.stories.tsx +594 -594
  32. package/components/blocks/card-patterns/index.ts +29 -29
  33. package/components/brand/language-selector/LanguageSelector.tsx +102 -102
  34. package/components/brand/language-selector/language-selector.stories.tsx +111 -111
  35. package/components/brand/language-selector/language-selector.test.tsx +101 -101
  36. package/components/brand/theme-toggle/ThemeToggle.tsx +74 -74
  37. package/components/brand/xertica-provider/xertica-provider.mdx +61 -61
  38. package/components/index.ts +86 -86
  39. package/components/layout/sidebar/sidebar.mdx +1 -1
  40. package/components/layout/sidebar/sidebar.stories.tsx +1033 -787
  41. package/components/layout/sidebar/sidebar.tsx +338 -1
  42. package/components/media/FloatingMediaWrapper.tsx +371 -371
  43. package/components/media/audio-player/AudioPlayer.tsx +768 -768
  44. package/components/media/video-player/VideoPlayer.tsx +310 -310
  45. package/components/pages/home-content/HomeContent.tsx +120 -120
  46. package/components/pages/home-content/home-content.mdx +62 -62
  47. package/components/pages/home-page/HomePage.tsx +78 -78
  48. package/components/pages/home-page/home-page.mdx +53 -53
  49. package/components/pages/template-content/TemplateContent.tsx +1354 -1354
  50. package/components/pages/template-content/template-content.mdx +61 -61
  51. package/components/pages/template-page/TemplatePage.stories.tsx +32 -32
  52. package/components/pages/template-page/template-page.mdx +53 -53
  53. package/components/shared/error-boundary.stories.tsx +114 -114
  54. package/components/shared/error-boundary.tsx +150 -150
  55. package/components/shared/error-fallbacks.tsx +222 -222
  56. package/components/ui/accordion/accordion.mdx +8 -8
  57. package/components/ui/alert/alert.mdx +8 -8
  58. package/components/ui/alert-dialog/alert-dialog.mdx +8 -8
  59. package/components/ui/aspect-ratio/aspect-ratio.mdx +8 -8
  60. package/components/ui/assistant-chart/assistant-chart.mdx +8 -8
  61. package/components/ui/avatar/avatar.mdx +8 -8
  62. package/components/ui/badge/badge.mdx +8 -8
  63. package/components/ui/breadcrumb/breadcrumb.mdx +8 -8
  64. package/components/ui/button/button.mdx +8 -8
  65. package/components/ui/calendar/calendar.mdx +8 -8
  66. package/components/ui/card/card.mdx +8 -8
  67. package/components/ui/carousel/carousel.mdx +8 -8
  68. package/components/ui/chart/chart.mdx +8 -8
  69. package/components/ui/chart/chart.test.tsx +178 -178
  70. package/components/ui/chart/chart.tsx +2245 -2239
  71. package/components/ui/checkbox/checkbox.mdx +8 -8
  72. package/components/ui/collapsible/collapsible.mdx +8 -8
  73. package/components/ui/command/command.mdx +8 -8
  74. package/components/ui/context-menu/context-menu.mdx +8 -8
  75. package/components/ui/dialog/dialog.mdx +8 -8
  76. package/components/ui/drawer/drawer.mdx +8 -8
  77. package/components/ui/dropdown-menu/dropdown-menu.mdx +8 -8
  78. package/components/ui/empty/empty.mdx +8 -8
  79. package/components/ui/file-upload/file-upload.mdx +8 -8
  80. package/components/ui/hover-card/hover-card.mdx +8 -8
  81. package/components/ui/input/input.mdx +8 -8
  82. package/components/ui/input-otp/input-otp.mdx +8 -8
  83. package/components/ui/label/label.mdx +8 -8
  84. package/components/ui/map/map.mdx +8 -8
  85. package/components/ui/menubar/menubar.mdx +8 -8
  86. package/components/ui/navigation-menu/navigation-menu.mdx +8 -8
  87. package/components/ui/notification-badge/notification-badge.mdx +8 -8
  88. package/components/ui/pagination/pagination.mdx +8 -8
  89. package/components/ui/popover/popover.mdx +8 -8
  90. package/components/ui/progress/progress.mdx +8 -8
  91. package/components/ui/radio-group/radio-group.mdx +8 -8
  92. package/components/ui/rating/rating.mdx +8 -8
  93. package/components/ui/resizable/resizable.mdx +8 -8
  94. package/components/ui/route-map/route-map.mdx +8 -8
  95. package/components/ui/scroll-area/scroll-area.mdx +8 -8
  96. package/components/ui/search/search.mdx +8 -8
  97. package/components/ui/select/select.mdx +8 -8
  98. package/components/ui/separator/separator.mdx +8 -8
  99. package/components/ui/sheet/sheet.mdx +8 -8
  100. package/components/ui/simple-map/simple-map.mdx +8 -8
  101. package/components/ui/skeleton/skeleton.mdx +8 -8
  102. package/components/ui/slider/slider.mdx +8 -8
  103. package/components/ui/sonner/sonner.mdx +8 -8
  104. package/components/ui/stats-card/index.ts +2 -2
  105. package/components/ui/stats-card/stats-card-skeleton.tsx +60 -60
  106. package/components/ui/stats-card/stats-card.mdx +8 -8
  107. package/components/ui/stats-card/stats-card.tsx +109 -109
  108. package/components/ui/stepper/stepper.mdx +8 -8
  109. package/components/ui/switch/switch.mdx +8 -8
  110. package/components/ui/table/table.mdx +8 -8
  111. package/components/ui/tabs/tabs.mdx +8 -8
  112. package/components/ui/textarea/textarea.mdx +8 -8
  113. package/components/ui/timeline/timeline.mdx +8 -8
  114. package/components/ui/toggle/toggle.mdx +8 -8
  115. package/components/ui/toggle-group/toggle-group.mdx +8 -8
  116. package/components/ui/tooltip/tooltip.mdx +8 -8
  117. package/components/ui/tree-view/tree-view.mdx +8 -8
  118. package/components.json +511 -511
  119. package/contexts/AuthContext.tsx +121 -121
  120. package/contexts/BrandColorsContext.tsx +282 -282
  121. package/contexts/LanguageContext.test.tsx +121 -121
  122. package/contexts/LanguageContext.tsx +250 -250
  123. package/contexts/theme-data.ts +391 -391
  124. package/dist/{AssistantChart-DoZCyS5r.cjs → AssistantChart-9w31gdAb.cjs} +4 -4
  125. package/dist/{AssistantChart-CldVCVDe.cjs → AssistantChart-BAudAfne.cjs} +5 -5
  126. package/dist/{AssistantChart-Bdd44uBn.cjs → AssistantChart-BAx9VQvb.cjs} +127 -388
  127. package/dist/{AssistantChart-Cu3m7RBo.js → AssistantChart-BP8upjMk.js} +5 -5
  128. package/dist/{AssistantChart-CFhDdGyU.js → AssistantChart-CVko2A1W.js} +130 -391
  129. package/dist/{AssistantChart-C_hwFRRr.js → AssistantChart-CVzmmhx4.js} +4 -4
  130. package/dist/{AudioPlayer-IAU5q5T1.cjs → AudioPlayer-1ypwE2Wh.cjs} +1 -1
  131. package/dist/{AudioPlayer-CGRUtUdN.js → AudioPlayer-DuKXrCfy.js} +1 -1
  132. package/dist/{LanguageContext-CS14yCpi.js → LanguageContext-BwhwC3G2.js} +2 -2
  133. package/dist/{LanguageContext-B_KFTCzT.cjs → LanguageContext-DvUt5jBg.cjs} +2 -2
  134. package/dist/{ThemeContext-C2EwAPDt.js → ThemeContext-BbBNoFTG.js} +2 -2
  135. package/dist/{ThemeContext-Bmod0Cg2.cjs → ThemeContext-BblcjQup.cjs} +13 -8
  136. package/dist/{ThemeContext-BWq9ACPo.js → ThemeContext-Bo-W2WZH.js} +13 -8
  137. package/dist/{ThemeContext-j5aGtPky.cjs → ThemeContext-CP3a0jxy.cjs} +193 -262
  138. package/dist/{ThemeContext-vTjumZeM.cjs → ThemeContext-Cmr8Ex8H.cjs} +2 -2
  139. package/dist/ThemeContext-CpqYShLq.cjs +324 -0
  140. package/dist/{ThemeContext-CQSo4Iwc.js → ThemeContext-D3LzacmG.js} +8 -1
  141. package/dist/ThemeContext-Du2nE1PL.js +325 -0
  142. package/dist/ThemeContext-GeEBTJ3q.cjs +1621 -0
  143. package/dist/ThemeContext-JyLK9B1o.js +1622 -0
  144. package/dist/{ThemeContext-CGk3KK0k.cjs → ThemeContext-U4dEYc6C.cjs} +8 -1
  145. package/dist/{ThemeContext-BXjrgUjW.js → ThemeContext-ept8jhXI.js} +200 -261
  146. package/dist/{VerifyEmailPage-CGIwmWrm.js → VerifyEmailPage-B31mCrMc.js} +1 -1
  147. package/dist/{VerifyEmailPage-C0c2e5n0.js → VerifyEmailPage-BE-L9mB7.js} +7 -7
  148. package/dist/{VerifyEmailPage-DSBMRHtl.js → VerifyEmailPage-BIBOKV7Z.js} +41 -36
  149. package/dist/{VerifyEmailPage-DgIid028.js → VerifyEmailPage-BJjAMUTW.js} +4 -4
  150. package/dist/{VerifyEmailPage--1Vurewl.cjs → VerifyEmailPage-BRSP-Pwt.cjs} +3 -3
  151. package/dist/{VerifyEmailPage-Cwi3kbol.cjs → VerifyEmailPage-Bae2cBXT.cjs} +7 -7
  152. package/dist/{VerifyEmailPage-De6bQjrz.cjs → VerifyEmailPage-BiRm7Nh4.cjs} +41 -36
  153. package/dist/{VerifyEmailPage-ByerOcm4.cjs → VerifyEmailPage-Bv8Ah_TK.cjs} +23 -20
  154. package/dist/VerifyEmailPage-Bvfv8HVQ.js +3214 -0
  155. package/dist/{VerifyEmailPage-BComraR7.cjs → VerifyEmailPage-CR7kb5df.cjs} +22 -12
  156. package/dist/{VerifyEmailPage-CpqqpLpo.cjs → VerifyEmailPage-C_Zk6Gen.cjs} +1 -1
  157. package/dist/{VerifyEmailPage-MTD7AG1Z.js → VerifyEmailPage-C_ihbcth.js} +4 -4
  158. package/dist/{VerifyEmailPage-1WwWczAn.js → VerifyEmailPage-CbgjOF0v.js} +22 -12
  159. package/dist/{VerifyEmailPage-DvMLZgFt.js → VerifyEmailPage-CdYPSJoO.js} +1 -1
  160. package/dist/{VerifyEmailPage-By3Jf__L.cjs → VerifyEmailPage-CkBYfsNy.cjs} +4 -4
  161. package/dist/{VerifyEmailPage-CJLz3jrn.js → VerifyEmailPage-Cyl55sJb.js} +23 -20
  162. package/dist/VerifyEmailPage-D-FRj5TU.cjs +3213 -0
  163. package/dist/{VerifyEmailPage-B4peJjAT.cjs → VerifyEmailPage-DF2ilhum.cjs} +334 -356
  164. package/dist/{VerifyEmailPage-CYXtbKi3.cjs → VerifyEmailPage-DMBh4NM9.cjs} +1 -1
  165. package/dist/{VerifyEmailPage-CgMxRb4z.js → VerifyEmailPage-DTtFfC-J.js} +3 -3
  166. package/dist/{VerifyEmailPage-CFLMls1p.cjs → VerifyEmailPage-Dt7zgA4w.cjs} +4 -4
  167. package/dist/{VerifyEmailPage-C5TNQTBa.js → VerifyEmailPage-EhudUdqF.js} +343 -355
  168. package/dist/{VerifyEmailPage-DGhuIqkb.js → VerifyEmailPage-X14vhdyl.js} +4 -4
  169. package/dist/VerifyEmailPage-hdB8JQGv.cjs +3213 -0
  170. package/dist/{VerifyEmailPage-Bp1XXl3H.cjs → VerifyEmailPage-u_Dn7t1U.cjs} +4 -4
  171. package/dist/VerifyEmailPage-vYHbYK3q.js +3214 -0
  172. package/dist/{XerticaProvider-CBGc4EMA.cjs → XerticaProvider-AChwphCO.cjs} +4 -4
  173. package/dist/{XerticaProvider-BIrqfZ-i.cjs → XerticaProvider-AbWlr7Af.cjs} +8 -11
  174. package/dist/{XerticaProvider-D-yNhF94.cjs → XerticaProvider-B8CaV7xu.cjs} +1 -1
  175. package/dist/{XerticaProvider-CEoWMTxu.js → XerticaProvider-BITjgC5p.js} +2 -2
  176. package/dist/{XerticaProvider-CllrbMEJ.cjs → XerticaProvider-By8q3Roe.cjs} +2 -2
  177. package/dist/{XerticaProvider-C1DKnvLh.js → XerticaProvider-CUYJZc32.js} +4 -4
  178. package/dist/{XerticaProvider-ET0ihewn.cjs → XerticaProvider-CW9hpCdF.cjs} +2 -2
  179. package/dist/{XerticaProvider-Dt5HEzbQ.js → XerticaProvider-CWgby5mY.js} +10 -10
  180. package/dist/XerticaProvider-CWs6EwNa.js +49 -0
  181. package/dist/XerticaProvider-CjQAQPcn.cjs +48 -0
  182. package/dist/XerticaProvider-D5lLumH-.js +49 -0
  183. package/dist/{XerticaProvider-DYq4JWtg.js → XerticaProvider-DQtvJU7m.js} +1 -1
  184. package/dist/XerticaProvider-qQUDop71.cjs +48 -0
  185. package/dist/{XerticaProvider-B7EVH-NF.js → XerticaProvider-siSt9uG2.js} +2 -2
  186. package/dist/{XerticaXLogo-Zw2B276b.cjs → XerticaXLogo-8TTzBjHw.cjs} +1 -1
  187. package/dist/{XerticaXLogo-B7xQ5dhi.js → XerticaXLogo-BWaag64t.js} +1 -1
  188. package/dist/{XerticaXLogo-DZbo4vOE.js → XerticaXLogo-CFuIlYFH.js} +12 -12
  189. package/dist/{XerticaXLogo-bvZSgwGF.cjs → XerticaXLogo-CU-U-GP4.cjs} +7 -13
  190. package/dist/XerticaXLogo-ChryA6xj.js +252 -0
  191. package/dist/{XerticaXLogo-CQUUjXoH.cjs → XerticaXLogo-CziKMQil.cjs} +8 -8
  192. package/dist/XerticaXLogo-DHz5SugF.js +252 -0
  193. package/dist/XerticaXLogo-DTee_y8X.cjs +251 -0
  194. package/dist/{XerticaXLogo-Cmsp-Eey.js → XerticaXLogo-DfUvz-lD.js} +9 -9
  195. package/dist/XerticaXLogo-kslQ8Tk_.cjs +251 -0
  196. package/dist/{alert-dialog-s-vmNkJ_.js → alert-dialog-iDe5VE5o.js} +3 -3
  197. package/dist/{alert-dialog-DSKByiKZ.cjs → alert-dialog-yckpaOpy.cjs} +3 -3
  198. package/dist/cli.js +16 -6
  199. package/dist/components/ui/chart/chart.d.ts +7 -5
  200. package/dist/{google-maps-loader-Y-QkD-Li.cjs → google-maps-loader-BqsYL48U.cjs} +0 -5
  201. package/dist/{google-maps-loader-CTYySAun.js → google-maps-loader-t2IlYBzw.js} +0 -4
  202. package/dist/index-CkTUgOwX.js +8 -0
  203. package/dist/{index-COtD8bRW.cjs → index-D3RLKRAs.cjs} +1 -1
  204. package/dist/index.cjs.js +2 -2
  205. package/dist/index.es.js +2 -2
  206. package/dist/index.umd.js +454 -1027
  207. package/dist/layout.cjs.js +1 -1
  208. package/dist/layout.es.js +1 -1
  209. package/dist/pages.cjs.js +1 -1
  210. package/dist/pages.es.js +1 -1
  211. package/dist/{sidebar-DAaY8bRU.cjs → sidebar-B3EYhli0.cjs} +33 -24
  212. package/dist/{sidebar-nzPoVHBQ.cjs → sidebar-B9NR0lCe.cjs} +46 -41
  213. package/dist/{sidebar-CeTMuzOx.cjs → sidebar-BvF5I2Ue.cjs} +47 -128
  214. package/dist/{sidebar-q7P2Godd.cjs → sidebar-C5B_LHek.cjs} +1 -1
  215. package/dist/{sidebar-CrQDDdcz.js → sidebar-CA6_ek3f.js} +33 -24
  216. package/dist/sidebar-CLmIjgNd.cjs +1136 -0
  217. package/dist/{sidebar-BxGXsDAd.cjs → sidebar-CVUGHOS_.cjs} +8 -16
  218. package/dist/{sidebar-BViy8Eeu.js → sidebar-CmvwjnVb.js} +9 -17
  219. package/dist/{sidebar-B6SlKZYN.js → sidebar-CplprZpM.js} +49 -40
  220. package/dist/sidebar-Duermn32.js +1133 -0
  221. package/dist/{sidebar-BbVIQvlP.js → sidebar-Dz7bd3zP.js} +1 -1
  222. package/dist/{sidebar-0ocFLSks.js → sidebar-KIS0C2JH.js} +50 -127
  223. package/dist/sidebar-OTO_up7Z.js +801 -0
  224. package/dist/sidebar-zowjejT2.cjs +800 -0
  225. package/dist/{use-audio-player-nv8ZSGa1.js → use-audio-player-Bkh23vQ3.js} +3 -7
  226. package/dist/{use-audio-player-NKsWyjWu.cjs → use-audio-player-Dn1NR9xN.cjs} +3 -7
  227. package/dist/{xertica-assistant-dyP7KHM5.cjs → xertica-assistant-B1IaHXnB.cjs} +388 -529
  228. package/dist/{xertica-assistant-ciJaWqm1.js → xertica-assistant-BMqdyRVi.js} +10 -28
  229. package/dist/{xertica-assistant-V_IdW4WF.cjs → xertica-assistant-Bj3vBCq_.cjs} +9 -27
  230. package/dist/{xertica-assistant-yX1CFBBo.js → xertica-assistant-DPsESB6t.js} +390 -531
  231. package/dist/{CodeBlock-7TTgmdGG.cjs → xertica-assistant-Qp3ydksa.cjs} +51 -263
  232. package/dist/{CodeBlock-BeSt1h5P.js → xertica-assistant-gnCJdcZY.js} +7 -219
  233. package/dist/xertica-ui.css +2 -2
  234. package/docs/architecture-improvements.md +456 -456
  235. package/docs/architecture.md +312 -312
  236. package/docs/components/assistant.md +428 -428
  237. package/docs/components/branding.md +252 -252
  238. package/docs/components/card-patterns.md +447 -447
  239. package/docs/components/error-boundary.md +201 -201
  240. package/docs/components/hooks.md +432 -432
  241. package/docs/components/language-selector.md +176 -176
  242. package/docs/components/pages.md +323 -323
  243. package/docs/components/sidebar.md +331 -331
  244. package/docs/components/stats-card.md +138 -138
  245. package/docs/doc-audit.md +244 -244
  246. package/docs/getting-started.md +616 -616
  247. package/docs/guidelines.md +330 -330
  248. package/docs/i18n.md +480 -480
  249. package/docs/installation.md +268 -268
  250. package/docs/llms.md +295 -295
  251. package/docs/state-management.md +289 -289
  252. package/guidelines/Guidelines.md +409 -409
  253. package/llms-compact.txt +1 -1
  254. package/llms-full.txt +10688 -10688
  255. package/llms.txt +1 -1
  256. package/package.json +1 -1
  257. package/styles/xertica/base.css +90 -90
  258. package/styles/xertica/tokens.css +240 -240
  259. package/templates/.prettierignore +4 -4
  260. package/templates/.prettierrc +10 -10
  261. package/templates/CLAUDE.md +180 -180
  262. package/templates/package.json +2 -2
  263. package/templates/src/app/App.tsx +46 -46
  264. package/templates/src/app/components/AuthGuard.tsx +131 -131
  265. package/templates/src/features/assistant/data/mock.ts +75 -75
  266. package/templates/src/features/assistant/hooks/useAssistantConfig.ts +20 -20
  267. package/templates/src/features/assistant/index.ts +5 -5
  268. package/templates/src/features/auth/ui/ForgotPasswordContent.tsx +70 -70
  269. package/templates/src/features/auth/ui/LoginContent.tsx +92 -92
  270. package/templates/src/features/auth/ui/ResetPasswordContent.tsx +183 -183
  271. package/templates/src/features/auth/ui/SocialLoginButtons.tsx +78 -78
  272. package/templates/src/features/auth/ui/VerifyEmailContent.tsx +80 -80
  273. package/templates/src/features/home/data/mock.ts +41 -41
  274. package/templates/src/features/home/hooks/useFeatureCards.ts +20 -20
  275. package/templates/src/features/home/index.ts +11 -11
  276. package/templates/src/features/home/ui/HomeContent.tsx +117 -117
  277. package/templates/src/features/template/ui/CrudTemplate.tsx +112 -112
  278. package/templates/src/features/template/ui/DashboardTemplate.tsx +110 -110
  279. package/templates/src/features/template/ui/FormTemplate.tsx +117 -117
  280. package/templates/src/features/template/ui/LoginTemplate.tsx +59 -59
  281. package/templates/src/features/template/ui/TemplateContent.tsx +1322 -1322
  282. package/templates/src/i18n.ts +124 -124
  283. package/templates/src/locales/en/common.json +21 -21
  284. package/templates/src/locales/en/components/activityCard.json +10 -10
  285. package/templates/src/locales/en/components/assistant.json +119 -119
  286. package/templates/src/locales/en/components/media.json +29 -29
  287. package/templates/src/locales/en/components/notificationCard.json +5 -5
  288. package/templates/src/locales/en/components/profileCard.json +8 -8
  289. package/templates/src/locales/en/components/projectCard.json +10 -10
  290. package/templates/src/locales/en/components/sidebar.json +14 -14
  291. package/templates/src/locales/en/components/stats.json +8 -8
  292. package/templates/src/locales/en/components/team.json +14 -14
  293. package/templates/src/locales/en/errors.json +9 -9
  294. package/templates/src/locales/en/languageSelector.json +7 -7
  295. package/templates/src/locales/en/nav.json +6 -6
  296. package/templates/src/locales/en/pages/crudTemplate.json +25 -25
  297. package/templates/src/locales/en/pages/dashboardTemplate.json +20 -20
  298. package/templates/src/locales/en/pages/forgotPassword.json +10 -10
  299. package/templates/src/locales/en/pages/formTemplate.json +16 -16
  300. package/templates/src/locales/en/pages/home.json +7 -7
  301. package/templates/src/locales/en/pages/login.json +15 -15
  302. package/templates/src/locales/en/pages/loginTemplate.json +9 -9
  303. package/templates/src/locales/en/pages/resetPassword.json +18 -18
  304. package/templates/src/locales/en/pages/templates.json +317 -317
  305. package/templates/src/locales/en/pages/verifyEmail.json +12 -12
  306. package/templates/src/locales/en/themeToggle.json +6 -6
  307. package/templates/src/locales/es/common.json +21 -21
  308. package/templates/src/locales/es/components/activityCard.json +10 -10
  309. package/templates/src/locales/es/components/assistant.json +119 -119
  310. package/templates/src/locales/es/components/media.json +29 -29
  311. package/templates/src/locales/es/components/notificationCard.json +5 -5
  312. package/templates/src/locales/es/components/profileCard.json +8 -8
  313. package/templates/src/locales/es/components/projectCard.json +10 -10
  314. package/templates/src/locales/es/components/sidebar.json +14 -14
  315. package/templates/src/locales/es/components/stats.json +8 -8
  316. package/templates/src/locales/es/components/team.json +14 -14
  317. package/templates/src/locales/es/errors.json +9 -9
  318. package/templates/src/locales/es/languageSelector.json +7 -7
  319. package/templates/src/locales/es/nav.json +6 -6
  320. package/templates/src/locales/es/pages/crudTemplate.json +25 -25
  321. package/templates/src/locales/es/pages/dashboardTemplate.json +20 -20
  322. package/templates/src/locales/es/pages/forgotPassword.json +10 -10
  323. package/templates/src/locales/es/pages/formTemplate.json +16 -16
  324. package/templates/src/locales/es/pages/home.json +7 -7
  325. package/templates/src/locales/es/pages/login.json +15 -15
  326. package/templates/src/locales/es/pages/loginTemplate.json +9 -9
  327. package/templates/src/locales/es/pages/resetPassword.json +18 -18
  328. package/templates/src/locales/es/pages/templates.json +317 -317
  329. package/templates/src/locales/es/pages/verifyEmail.json +12 -12
  330. package/templates/src/locales/es/themeToggle.json +6 -6
  331. package/templates/src/locales/pt-BR/common.json +21 -21
  332. package/templates/src/locales/pt-BR/components/activityCard.json +10 -10
  333. package/templates/src/locales/pt-BR/components/assistant.json +119 -119
  334. package/templates/src/locales/pt-BR/components/media.json +29 -29
  335. package/templates/src/locales/pt-BR/components/notificationCard.json +5 -5
  336. package/templates/src/locales/pt-BR/components/profileCard.json +8 -8
  337. package/templates/src/locales/pt-BR/components/projectCard.json +10 -10
  338. package/templates/src/locales/pt-BR/components/sidebar.json +14 -14
  339. package/templates/src/locales/pt-BR/components/stats.json +8 -8
  340. package/templates/src/locales/pt-BR/components/team.json +14 -14
  341. package/templates/src/locales/pt-BR/errors.json +9 -9
  342. package/templates/src/locales/pt-BR/languageSelector.json +7 -7
  343. package/templates/src/locales/pt-BR/nav.json +6 -6
  344. package/templates/src/locales/pt-BR/pages/crudTemplate.json +25 -25
  345. package/templates/src/locales/pt-BR/pages/dashboardTemplate.json +20 -20
  346. package/templates/src/locales/pt-BR/pages/forgotPassword.json +10 -10
  347. package/templates/src/locales/pt-BR/pages/formTemplate.json +16 -16
  348. package/templates/src/locales/pt-BR/pages/home.json +7 -7
  349. package/templates/src/locales/pt-BR/pages/login.json +15 -15
  350. package/templates/src/locales/pt-BR/pages/loginTemplate.json +9 -9
  351. package/templates/src/locales/pt-BR/pages/resetPassword.json +18 -18
  352. package/templates/src/locales/pt-BR/pages/templates.json +317 -317
  353. package/templates/src/locales/pt-BR/pages/verifyEmail.json +12 -12
  354. package/templates/src/locales/pt-BR/themeToggle.json +6 -6
  355. package/templates/src/pages/AssistantPage.tsx +470 -470
  356. package/templates/src/pages/HomePage.tsx +53 -53
  357. package/templates/src/shared/error-boundary.tsx +150 -150
  358. package/templates/src/shared/error-fallbacks.tsx +222 -222
  359. package/templates/src/styles/xertica/tokens.css +240 -240
  360. package/templates/vite.config.js +20 -20
  361. package/templates/vite.config.ts +55 -55
  362. package/dist/AssistantChart-BKVtGUKF.js +0 -3383
  363. package/dist/AssistantChart-CxGjH7Qk.js +0 -3477
  364. package/dist/AssistantChart-DIpshm3i.js +0 -4784
  365. package/dist/AssistantChart-D_PTeu8P.cjs +0 -3503
  366. package/dist/AssistantChart-WeycT5Pd.cjs +0 -3551
  367. package/dist/AssistantChart-zjsy2GaZ.cjs +0 -4810
  368. package/dist/AudioPlayer-B1lt5cPl.cjs +0 -989
  369. package/dist/AudioPlayer-BZ7bibzU.cjs +0 -982
  370. package/dist/AudioPlayer-BpRPS4-1.cjs +0 -1277
  371. package/dist/AudioPlayer-C12BjQBV.cjs +0 -997
  372. package/dist/AudioPlayer-CFeV8t-5.cjs +0 -936
  373. package/dist/AudioPlayer-Coly3q5R.js +0 -1278
  374. package/dist/AudioPlayer-CySJIyvL.js +0 -937
  375. package/dist/AudioPlayer-DMcG_c7L.js +0 -990
  376. package/dist/AudioPlayer-DcFKRJE_.js +0 -998
  377. package/dist/AudioPlayer-e8LfNoqO.js +0 -983
  378. package/dist/BrandColorsContext-565dDHd5.js +0 -660
  379. package/dist/BrandColorsContext-BcJbtkqn.cjs +0 -659
  380. package/dist/CodeBlock-BgfYL_rD.cjs +0 -2094
  381. package/dist/CodeBlock-BlcqlA9M.cjs +0 -2094
  382. package/dist/CodeBlock-Bnmeu5ez.cjs +0 -2094
  383. package/dist/CodeBlock-BtfPlbAI.js +0 -2078
  384. package/dist/CodeBlock-CIySIuYr.js +0 -2078
  385. package/dist/CodeBlock-CuPtUM-7.cjs +0 -2094
  386. package/dist/CodeBlock-D6ffWXgc.js +0 -2078
  387. package/dist/CodeBlock-D8dcwbit.cjs +0 -2094
  388. package/dist/CodeBlock-DMZrFnlw.cjs +0 -2094
  389. package/dist/CodeBlock-DlBehYN8.js +0 -2078
  390. package/dist/CodeBlock-DnYNI8rQ.js +0 -2078
  391. package/dist/CodeBlock-DvKWbSnE.cjs +0 -2094
  392. package/dist/CodeBlock-DwMCfkFY.js +0 -2078
  393. package/dist/CodeBlock-Dy6CNYyj.js +0 -2078
  394. package/dist/CodeBlock-U1pPOQI7.cjs +0 -2094
  395. package/dist/CodeBlock-f_GpNhEB.js +0 -2078
  396. package/dist/CodeBlock-oB6u8nI1.js +0 -2078
  397. package/dist/CodeBlock-tZC31B73.cjs +0 -2094
  398. package/dist/FeatureCard-CxC-7C-C.cjs +0 -300
  399. package/dist/FeatureCard-DbHWCb4E.js +0 -301
  400. package/dist/ImageWithFallback-CGtidP6B.cjs +0 -4542
  401. package/dist/ImageWithFallback-lsg3pdFg.js +0 -4508
  402. package/dist/LanguageSelector-B5YfbHra.js +0 -231
  403. package/dist/LanguageSelector-D6uacAIM.cjs +0 -230
  404. package/dist/LayoutContext-B45-e9DI.cjs +0 -93
  405. package/dist/LayoutContext-BAql6ZRY.js +0 -97
  406. package/dist/LayoutContext-Bav3UMEA.js +0 -94
  407. package/dist/LayoutContext-BvK-ggDa.cjs +0 -96
  408. package/dist/ThemeContext-BoH4NLfN.js +0 -734
  409. package/dist/ThemeContext-r69W20Xg.cjs +0 -733
  410. package/dist/VerifyEmailPage-COiyNl1y.js +0 -2825
  411. package/dist/VerifyEmailPage-CqKsR2v8.js +0 -2827
  412. package/dist/VerifyEmailPage-DjQKRlUS.cjs +0 -2824
  413. package/dist/VerifyEmailPage-s-1X3LDJ.cjs +0 -2826
  414. package/dist/XerticaOrbe-KL1RBHzw.cjs +0 -1354
  415. package/dist/XerticaOrbe-zwS1p2a8.js +0 -1355
  416. package/dist/XerticaProvider-6btlAlzc.js +0 -17
  417. package/dist/XerticaProvider-BNoNOxQ5.cjs +0 -16
  418. package/dist/XerticaProvider-BlY2limY.cjs +0 -38
  419. package/dist/XerticaProvider-DDuiIcKo.js +0 -39
  420. package/dist/XerticaProvider-cI9hSs27.cjs +0 -38
  421. package/dist/XerticaProvider-hSwhNQex.js +0 -39
  422. package/dist/alert-dialog-BOje--vD.js +0 -847
  423. package/dist/alert-dialog-BtEuQqrg.cjs +0 -870
  424. package/dist/breadcrumb-CqJ7bHY5.js +0 -161
  425. package/dist/breadcrumb-m9Hb2_XN.cjs +0 -177
  426. package/dist/components/assistant/xertica-assistant/hooks/index.d.ts +0 -6
  427. package/dist/components/assistant/xertica-assistant/hooks/use-assistant-conversations.d.ts +0 -21
  428. package/dist/components/assistant/xertica-assistant/hooks/use-assistant-messages.d.ts +0 -49
  429. package/dist/components/assistant/xertica-assistant/hooks/use-assistant-suggestions.d.ts +0 -16
  430. package/dist/components/blocks/audio-player/AudioPlayer.d.ts +0 -35
  431. package/dist/components/blocks/audio-player/index.d.ts +0 -1
  432. package/dist/components/blocks/document-editor/DocumentEditor.d.ts +0 -26
  433. package/dist/components/blocks/document-editor/index.d.ts +0 -1
  434. package/dist/components/blocks/podcast-player/PodcastPlayer.d.ts +0 -41
  435. package/dist/components/blocks/podcast-player/index.d.ts +0 -1
  436. package/dist/components/ui/chart/parts/chart-dashboard.d.ts +0 -113
  437. package/dist/components/ui/chart/parts/chart-metric.d.ts +0 -118
  438. package/dist/components/ui/chart/parts/chart-primitives.d.ts +0 -101
  439. package/dist/components/ui/chart/parts/chart-shared.d.ts +0 -20
  440. package/dist/components/ui/chart/parts/chart-utils.d.ts +0 -12
  441. package/dist/components/ui/chart/parts/index.d.ts +0 -5
  442. package/dist/dropdown-menu-BDB5CmQs.cjs +0 -247
  443. package/dist/dropdown-menu-DQidbKBD.js +0 -231
  444. package/dist/google-maps-loader-BFWp6VPd.js +0 -287
  445. package/dist/google-maps-loader-BKcdgFbu.cjs +0 -312
  446. package/dist/google-maps-loader-CumCNXeG.js +0 -312
  447. package/dist/google-maps-loader-eS3uQ5TA.cjs +0 -287
  448. package/dist/header-Cgy6vYPk.cjs +0 -731
  449. package/dist/header-DRlT4jgI.js +0 -715
  450. package/dist/header-Dux00SI4.cjs +0 -731
  451. package/dist/header-EkGKXPsD.js +0 -715
  452. package/dist/header-WfEywpyc.cjs +0 -731
  453. package/dist/header-tifNQn2U.js +0 -715
  454. package/dist/index-BhapVLVj.js +0 -8
  455. package/dist/index-D6fxYEY8.cjs +0 -7
  456. package/dist/index-DAIp0_HK.js +0 -8
  457. package/dist/index-DW5tYe26.js +0 -8
  458. package/dist/index-GA__GvnG.cjs +0 -7
  459. package/dist/input-2R4loU86.js +0 -127
  460. package/dist/input-DWANSKGb.cjs +0 -145
  461. package/dist/progress-DPtzoVV8.js +0 -175
  462. package/dist/progress-EeaoqqUs.cjs +0 -191
  463. package/dist/rich-text-editor-0mraWT5y.cjs +0 -2376
  464. package/dist/rich-text-editor-B-IkcPD0.js +0 -2874
  465. package/dist/rich-text-editor-B6jMRLzk.cjs +0 -1939
  466. package/dist/rich-text-editor-B8_oYcIR.js +0 -1730
  467. package/dist/rich-text-editor-B9UbSXNb.js +0 -1203
  468. package/dist/rich-text-editor-BYuRBNBU.js +0 -2373
  469. package/dist/rich-text-editor-Bb9pySTs.cjs +0 -2374
  470. package/dist/rich-text-editor-BcL6L3cm.cjs +0 -2374
  471. package/dist/rich-text-editor-BoVZYtTs.cjs +0 -2391
  472. package/dist/rich-text-editor-Bp3zQqMC.js +0 -2954
  473. package/dist/rich-text-editor-CMgSN_w2.js +0 -1189
  474. package/dist/rich-text-editor-CPV1lEPH.cjs +0 -1748
  475. package/dist/rich-text-editor-CeucBdIv.cjs +0 -2971
  476. package/dist/rich-text-editor-CoKqbCtu.cjs +0 -1799
  477. package/dist/rich-text-editor-Cw56T_mB.js +0 -2356
  478. package/dist/rich-text-editor-Cyt8qs2b.js +0 -1921
  479. package/dist/rich-text-editor-D6H84OcX.cjs +0 -1220
  480. package/dist/rich-text-editor-D76gD-QI.js +0 -2328
  481. package/dist/rich-text-editor-DKkokOnA.js +0 -1781
  482. package/dist/rich-text-editor-DNsdpN64.cjs +0 -2359
  483. package/dist/rich-text-editor-DfG8bCyY.js +0 -2358
  484. package/dist/rich-text-editor-Dxjw31Z4.js +0 -2341
  485. package/dist/rich-text-editor-DzP0Epmb.js +0 -2356
  486. package/dist/rich-text-editor-bRkNoeZY.cjs +0 -2891
  487. package/dist/rich-text-editor-lyYE2ZG5.cjs +0 -1207
  488. package/dist/rich-text-editor-skplNlBM.cjs +0 -2345
  489. package/dist/select-Bkbr0f-Z.cjs +0 -162
  490. package/dist/select-CvIVdX2n.js +0 -145
  491. package/dist/sidebar-CK_0ZQHj.cjs +0 -803
  492. package/dist/sidebar-CUuOvYhK.js +0 -787
  493. package/dist/sidebar-DQj1z3jG.cjs +0 -758
  494. package/dist/sidebar-Djn5syhi.cjs +0 -786
  495. package/dist/sidebar-LluMXfam.js +0 -759
  496. package/dist/sidebar-_rT7rBMk.js +0 -787
  497. package/dist/slider-Bc5Hd0y1.js +0 -56
  498. package/dist/slider-N7hFFj6X.cjs +0 -73
  499. package/dist/tooltip-Ded96neP.cjs +0 -137
  500. package/dist/tooltip-HDOoD2-0.js +0 -120
  501. package/dist/use-audio-player-B31J-aqh.cjs +0 -187
  502. package/dist/use-audio-player-BkmEmj8Q.js +0 -185
  503. package/dist/use-audio-player-CLFTWFW1.cjs +0 -184
  504. package/dist/use-audio-player-CLLn00I6.js +0 -188
  505. package/dist/use-file-upload-BcjEo2S5.js +0 -404
  506. package/dist/use-file-upload-CRJR68Tj.cjs +0 -403
  507. package/dist/use-mobile-B0hNy_Y6.cjs +0 -4303
  508. package/dist/use-mobile-BXuYROXM.js +0 -4202
  509. package/dist/use-mobile-Bbd51ASU.cjs +0 -4392
  510. package/dist/use-mobile-Bk6CX-TC.js +0 -4359
  511. package/dist/use-mobile-BvYdisLP.js +0 -4202
  512. package/dist/use-mobile-BzuxjzNX.cjs +0 -4392
  513. package/dist/use-mobile-CG2-SdXV.cjs +0 -4235
  514. package/dist/use-mobile-CKb5pqTs.js +0 -4269
  515. package/dist/use-mobile-CYuAuGDl.js +0 -4202
  516. package/dist/use-mobile-CaENcqm-.js +0 -4508
  517. package/dist/use-mobile-CbrYgJGJ.js +0 -4203
  518. package/dist/use-mobile-Cd4xPrKq.cjs +0 -46
  519. package/dist/use-mobile-DMOvImGQ.cjs +0 -4542
  520. package/dist/use-mobile-DRB3BQgD.cjs +0 -4235
  521. package/dist/use-mobile-DZvv7QMR.js +0 -4359
  522. package/dist/use-mobile-DdI_TXam.cjs +0 -4235
  523. package/dist/use-mobile-DlceKf8a.js +0 -4359
  524. package/dist/use-mobile-DsOnow1o.cjs +0 -4236
  525. package/dist/use-mobile-Kcj6jSnK.cjs +0 -4392
  526. package/dist/use-mobile-bnKcua_i.js +0 -4202
  527. package/dist/use-mobile-j4w2Jrf1.js +0 -30
  528. package/dist/use-mobile-ncXBeE2z.cjs +0 -4235
  529. package/dist/use-rich-text-editor-DjiddBGv.js +0 -282
  530. package/dist/use-rich-text-editor-lpeswbCs.cjs +0 -281
  531. package/dist/xertica-assistant-BdiZag0h.js +0 -2187
  532. package/dist/xertica-assistant-CrgTb6Hs.cjs +0 -2155
  533. package/dist/xertica-assistant-DCsnQyi5.js +0 -2156
  534. package/dist/xertica-assistant-DUBpmEgo.cjs +0 -2186
  535. package/dist/{rich-text-editor-DgF8s7xW.js → rich-text-editor-BmsjY03B.js} +26 -26
  536. package/dist/{rich-text-editor-mWoaSCE4.cjs → rich-text-editor-GS2kpTAK.cjs} +26 -26
@@ -0,0 +1,1133 @@
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-DZHzN1Gd.js';
5
+ import { L as LanguageSelector, T as ThemeToggle, X as XerticaLogo, a as XerticaXLogo } from './XerticaXLogo-BX3ueACh.js';
6
+ import { B as Breadcrumb, d as BreadcrumbList, b as BreadcrumbItem, c as BreadcrumbLink, e as BreadcrumbPage, f as BreadcrumbSeparator } from './breadcrumb-ifNsA7Zl.js';
7
+ 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-Dn_eV2Xb.js';
8
+ import { A as Avatar, b as AvatarImage, a as AvatarFallback } from './avatar-3kO2Anrp.js';
9
+ import { a as useOptionalLayout } from './LayoutContext-DNl1xSoX.js';
10
+ import { AnimatePresence, motion } from 'framer-motion';
11
+ import { useTranslation } from 'react-i18next';
12
+ import { I as Input, S as ScrollArea, P as Popover, c as PopoverTrigger, b as PopoverContent } from './input-cc-PTD4R.js';
13
+ import { b as TooltipProvider, T as Tooltip, c as TooltipTrigger } from './tooltip-RtbSmPYJ.js';
14
+ import { C as CustomTooltipContent } from './CustomTooltipContent-CNbVB2NS.js';
15
+
16
+ function Header({
17
+ title,
18
+ breadcrumbs,
19
+ showLanguageSelector = true,
20
+ showThemeToggle = true,
21
+ className,
22
+ user,
23
+ actions,
24
+ showSettings,
25
+ onSettingsClick,
26
+ showLogout,
27
+ onLogoutClick,
28
+ renderLink,
29
+ breadcrumbSlot
30
+ }) {
31
+ const layout = useOptionalLayout();
32
+ const toggleSidebar = layout?.toggleSidebar ?? (() => {
33
+ });
34
+ return /* @__PURE__ */ jsx(
35
+ "header",
36
+ {
37
+ className: `bg-card text-foreground shadow-sm border-b border-border px-[24px] h-[64px] flex-shrink-0 flex items-center ${className || ""}`,
38
+ children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full p-[0px]", children: [
39
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-muted-foreground w-full overflow-x-auto", children: [
40
+ /* @__PURE__ */ jsx(
41
+ Button,
42
+ {
43
+ variant: "ghost",
44
+ size: "sm",
45
+ onClick: toggleSidebar,
46
+ className: "md:hidden mr-2 p-2 shrink-0",
47
+ "aria-label": "Abrir menu lateral",
48
+ children: /* @__PURE__ */ jsx(Menu, { className: "w-5 h-5" })
49
+ }
50
+ ),
51
+ 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: [
52
+ /* @__PURE__ */ jsx(BreadcrumbItem, { children: item.href ? renderLink ? /* @__PURE__ */ jsx(BreadcrumbLink, { asChild: true, className: "flex items-center gap-1.5", children: renderLink(item.href, {
53
+ className: "flex items-center gap-1.5",
54
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [
55
+ item.icon,
56
+ item.label
57
+ ] })
58
+ }) }) : /* @__PURE__ */ jsxs(BreadcrumbLink, { href: item.href, className: "flex items-center gap-1.5", children: [
59
+ item.icon,
60
+ item.label
61
+ ] }) : /* @__PURE__ */ jsxs(BreadcrumbPage, { className: "flex items-center gap-1.5", children: [
62
+ item.icon,
63
+ item.label
64
+ ] }) }),
65
+ index < breadcrumbs.length - 1 && /* @__PURE__ */ jsx(BreadcrumbSeparator, {})
66
+ ] }, 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" }) }) }) }),
67
+ breadcrumbSlot && /* @__PURE__ */ jsx("div", { className: "flex items-center shrink-0", children: breadcrumbSlot })
68
+ ] }),
69
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 shrink-0 ml-4", children: [
70
+ showLanguageSelector && /* @__PURE__ */ jsx(LanguageSelector, { variant: "minimal", showIcon: false, className: "hidden sm:flex" }),
71
+ showThemeToggle && /* @__PURE__ */ jsx(ThemeToggle, { className: "hover:bg-accent" }),
72
+ actions?.map((action) => /* @__PURE__ */ jsxs(
73
+ Button,
74
+ {
75
+ variant: "ghost",
76
+ size: action.label ? "sm" : "icon",
77
+ onClick: action.onClick,
78
+ className: `hover:bg-accent ${action.className || ""}`,
79
+ "aria-label": action.label || action.id,
80
+ children: [
81
+ action.icon,
82
+ action.label && /* @__PURE__ */ jsx("span", { className: "ml-2 hidden md:inline", children: action.label })
83
+ ]
84
+ },
85
+ action.id
86
+ )),
87
+ showSettings && /* @__PURE__ */ jsx(
88
+ Button,
89
+ {
90
+ variant: "ghost",
91
+ size: "icon",
92
+ onClick: onSettingsClick,
93
+ className: "hover:bg-accent",
94
+ "aria-label": "Configurações",
95
+ children: /* @__PURE__ */ jsx(Settings, { className: "w-5 h-5" })
96
+ }
97
+ ),
98
+ user && /* @__PURE__ */ jsxs(DropdownMenu, { children: [
99
+ /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
100
+ Button,
101
+ {
102
+ variant: "ghost",
103
+ className: "relative h-8 w-8 rounded-full p-0 overflow-hidden border border-border/50 hover:border-primary/30 transition-colors",
104
+ "aria-label": "Menu do usuário",
105
+ children: /* @__PURE__ */ jsxs(Avatar, { className: "h-8 w-8", children: [
106
+ /* @__PURE__ */ jsx(AvatarImage, { src: user.avatar, alt: user.name || "User" }),
107
+ /* @__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" }) })
108
+ ] })
109
+ }
110
+ ) }),
111
+ /* @__PURE__ */ jsxs(DropdownMenuContent, { className: "w-56", align: "end", forceMount: true, children: [
112
+ /* @__PURE__ */ jsx(DropdownMenuLabel, { className: "font-normal", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col space-y-1", children: [
113
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium leading-none", children: user.name || "User" }),
114
+ /* @__PURE__ */ jsx("p", { className: "text-xs leading-none text-muted-foreground", children: user.email || "user@example.com" })
115
+ ] }) }),
116
+ /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
117
+ user.menuItems?.map((item) => /* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: item.onClick, className: item.className, children: [
118
+ item.icon && /* @__PURE__ */ jsx("span", { className: "mr-2", children: item.icon }),
119
+ item.label
120
+ ] }, item.id)),
121
+ !user.menuItems && /* @__PURE__ */ jsxs(Fragment, { children: [
122
+ /* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: onSettingsClick, children: [
123
+ /* @__PURE__ */ jsx(Settings, { className: "mr-2 h-4 w-4" }),
124
+ /* @__PURE__ */ jsx("span", { children: "Settings" })
125
+ ] }),
126
+ /* @__PURE__ */ jsxs(
127
+ DropdownMenuItem,
128
+ {
129
+ onClick: onLogoutClick,
130
+ className: "text-destructive focus:text-destructive",
131
+ children: [
132
+ /* @__PURE__ */ jsx(LogOut, { className: "mr-2 h-4 w-4" }),
133
+ /* @__PURE__ */ jsx("span", { children: "Logout" })
134
+ ]
135
+ }
136
+ )
137
+ ] })
138
+ ] })
139
+ ] }),
140
+ showLogout && /* @__PURE__ */ jsx(
141
+ Button,
142
+ {
143
+ variant: "ghost",
144
+ size: "icon",
145
+ onClick: onLogoutClick,
146
+ className: "hover:bg-accent text-muted-foreground hover:text-foreground",
147
+ "aria-label": "Sair",
148
+ children: /* @__PURE__ */ jsx(LogOut, { className: "w-5 h-5" })
149
+ }
150
+ )
151
+ ] })
152
+ ] })
153
+ }
154
+ );
155
+ }
156
+
157
+ const SidebarContext = createContext(null);
158
+ function useSidebarContext() {
159
+ const ctx = useContext(SidebarContext);
160
+ if (!ctx) {
161
+ throw new Error("Sidebar compound components must be used within <Sidebar.Root>");
162
+ }
163
+ return ctx;
164
+ }
165
+ function SidebarRoot({
166
+ expanded: expandedProp,
167
+ onToggle: onToggleProp,
168
+ navigate: navigateProp,
169
+ location: locationProp,
170
+ width: widthProp,
171
+ children,
172
+ className
173
+ }) {
174
+ const layoutContext = useOptionalLayout();
175
+ const [localExpanded, setLocalExpanded] = useState(false);
176
+ const [isMobileViewport, setIsMobileViewport] = useState(false);
177
+ const expanded = expandedProp !== void 0 ? expandedProp : layoutContext?.sidebarExpanded ?? localExpanded;
178
+ const onToggle = onToggleProp || layoutContext?.toggleSidebar || (() => setLocalExpanded((prev) => !prev));
179
+ const width = widthProp !== void 0 ? widthProp : layoutContext?.sidebarWidth ?? 280;
180
+ const navigate = navigateProp || ((path) => {
181
+ if (typeof window !== "undefined") window.location.href = path;
182
+ });
183
+ const location = locationProp || (typeof window !== "undefined" ? window.location : { pathname: "/" });
184
+ useEffect(() => {
185
+ const checkViewport = () => setIsMobileViewport(window.innerWidth < 768);
186
+ checkViewport();
187
+ window.addEventListener("resize", checkViewport);
188
+ return () => window.removeEventListener("resize", checkViewport);
189
+ }, []);
190
+ return /* @__PURE__ */ jsx(
191
+ SidebarContext.Provider,
192
+ {
193
+ value: { expanded, isMobileViewport, onToggle, navigate, location, width },
194
+ children: /* @__PURE__ */ jsxs(TooltipProvider, { delayDuration: 300, children: [
195
+ /* @__PURE__ */ jsx("style", { children: `
196
+ @media (max-width: 767px) {
197
+ [style*="padding-left"].flex-1,
198
+ [style*="paddingLeft"].flex-1 {
199
+ padding-left: 0 !important;
200
+ }
201
+ }
202
+ ` }),
203
+ /* @__PURE__ */ jsx(
204
+ "div",
205
+ {
206
+ className: cn(
207
+ "bg-sidebar text-sidebar-foreground transition-all duration-300 ease-in-out flex flex-col z-50",
208
+ 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",
209
+ className
210
+ ),
211
+ style: expanded && !isMobileViewport ? { width: `${width}px` } : void 0,
212
+ children
213
+ }
214
+ )
215
+ ] })
216
+ }
217
+ );
218
+ }
219
+ function SidebarHeader({
220
+ logo,
221
+ logoCollapsed
222
+ }) {
223
+ const { expanded, onToggle } = useSidebarContext();
224
+ const { t } = useTranslation();
225
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
226
+ /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 p-[14px] pt-[13px] pr-[14px] pb-[12px] pl-[14px]", children: /* @__PURE__ */ jsx(
227
+ "button",
228
+ {
229
+ onClick: onToggle,
230
+ 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",
231
+ "aria-label": expanded ? t("sidebar.collapse") : t("sidebar.expand"),
232
+ "aria-expanded": expanded,
233
+ "aria-controls": "sidebar-nav",
234
+ children: expanded ? /* @__PURE__ */ jsx(ArrowLeft, { className: "w-5 h-5" }) : /* @__PURE__ */ jsx(Menu, { className: "w-5 h-5" })
235
+ }
236
+ ) }),
237
+ /* @__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" }) }) }) })
238
+ ] });
239
+ }
240
+ function OverflowGroupsAccordion({
241
+ expanded,
242
+ overflowGroups,
243
+ location,
244
+ handleNavigate,
245
+ moreOptionsLabel,
246
+ onOpenChange
247
+ }) {
248
+ const [isOpen, setIsOpen] = useState(false);
249
+ const toggle = () => {
250
+ const next = !isOpen;
251
+ setIsOpen(next);
252
+ onOpenChange?.(next);
253
+ };
254
+ return /* @__PURE__ */ jsxs("div", { children: [
255
+ /* @__PURE__ */ jsxs(
256
+ "button",
257
+ {
258
+ onClick: toggle,
259
+ className: cn(
260
+ "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",
261
+ expanded ? "gap-3 px-3 justify-start" : "justify-center px-0"
262
+ ),
263
+ "aria-expanded": isOpen,
264
+ "aria-label": moreOptionsLabel,
265
+ children: [
266
+ /* @__PURE__ */ jsx(MoreVertical, { className: "w-5 h-5 flex-shrink-0" }),
267
+ expanded && /* @__PURE__ */ jsxs(Fragment, { children: [
268
+ /* @__PURE__ */ jsx("span", { className: "truncate flex-1 text-sidebar-foreground text-left", children: moreOptionsLabel }),
269
+ /* @__PURE__ */ jsx(
270
+ ChevronRight,
271
+ {
272
+ className: cn("w-4 h-4 flex-shrink-0 transition-transform duration-200", isOpen && "rotate-90")
273
+ }
274
+ )
275
+ ] })
276
+ ]
277
+ }
278
+ ),
279
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: isOpen && /* @__PURE__ */ jsx(
280
+ motion.div,
281
+ {
282
+ initial: { height: 0, opacity: 0 },
283
+ animate: { height: "auto", opacity: 1 },
284
+ exit: { height: 0, opacity: 0 },
285
+ transition: { duration: 0.2 },
286
+ className: "overflow-hidden",
287
+ children: /* @__PURE__ */ jsx("div", { className: "mt-1 space-y-3", children: overflowGroups.map((group) => {
288
+ const GroupIcon = group.icon;
289
+ return /* @__PURE__ */ jsxs("div", { children: [
290
+ (group.label || GroupIcon) && expanded && /* @__PURE__ */ jsxs("div", { className: "px-3 mb-1 flex items-center gap-2", children: [
291
+ GroupIcon && (React__default.isValidElement(GroupIcon) ? GroupIcon : /* @__PURE__ */ jsx(GroupIcon, { className: "h-3 w-3 text-sidebar-foreground/60" })),
292
+ group.label && /* @__PURE__ */ jsx("span", { className: "text-xs font-semibold uppercase tracking-wider text-sidebar-foreground/60", children: group.label })
293
+ ] }),
294
+ /* @__PURE__ */ jsx("div", { className: "space-y-0.5", children: group.items.map((item) => {
295
+ const Icon = item.icon;
296
+ const isActive = location.pathname === item.path || location.pathname.startsWith(item.path + "/");
297
+ return /* @__PURE__ */ jsxs(
298
+ "button",
299
+ {
300
+ onClick: () => handleNavigate(item.path),
301
+ className: cn(
302
+ "w-full h-9 flex items-center gap-2.5 rounded-[var(--radius-button)] transition-all duration-200 text-left text-sm",
303
+ expanded ? "px-3" : "justify-center px-0",
304
+ isActive ? "bg-sidebar-foreground/15 text-sidebar-foreground" : "text-sidebar-foreground/70 hover:bg-sidebar-foreground/10 hover:text-sidebar-foreground"
305
+ ),
306
+ children: [
307
+ Icon && /* @__PURE__ */ jsx(Icon, { className: "w-4 h-4 flex-shrink-0" }),
308
+ expanded && /* @__PURE__ */ jsx("span", { className: "truncate", children: item.label })
309
+ ]
310
+ },
311
+ item.path
312
+ );
313
+ }) })
314
+ ] }, group.id);
315
+ }) })
316
+ }
317
+ ) })
318
+ ] });
319
+ }
320
+ function SidebarNav({
321
+ navigationGroups = [],
322
+ routes = [],
323
+ variant = "default"
324
+ }) {
325
+ const { expanded, isMobileViewport, navigate, location, onToggle } = useSidebarContext();
326
+ const { t } = useTranslation();
327
+ const navRef = useRef(null);
328
+ const [localActiveItem, setLocalActiveItem] = useState(null);
329
+ const [hasOverflow, setHasOverflow] = useState(false);
330
+ const [visibleItems, setVisibleItems] = useState([]);
331
+ const [overflowItems, setOverflowItems] = useState([]);
332
+ const [openSubmenus, setOpenSubmenus] = useState(/* @__PURE__ */ new Set());
333
+ const [hasGroupOverflow, setHasGroupOverflow] = useState(false);
334
+ const [visibleGroups, setVisibleGroups] = useState([]);
335
+ const [overflowGroups, setOverflowGroups] = useState([]);
336
+ const [isOverflowAccordionOpen, setIsOverflowAccordionOpen] = useState(false);
337
+ const toggleSubmenu = (path) => {
338
+ setOpenSubmenus((prev) => {
339
+ const next = new Set(prev);
340
+ if (next.has(path)) {
341
+ next.delete(path);
342
+ } else {
343
+ next.add(path);
344
+ }
345
+ return next;
346
+ });
347
+ };
348
+ const labelTranslations = useMemo(
349
+ () => ({
350
+ home: "Início",
351
+ dashboard: "Painel",
352
+ components: "Componentes"
353
+ }),
354
+ []
355
+ );
356
+ const navigationItems = useMemo(
357
+ () => (routes || []).map((route) => ({
358
+ ...route,
359
+ label: labelTranslations[route.label.toLowerCase()] || route.label,
360
+ active: location.pathname === route.path || location.pathname.startsWith(route.path + "/"),
361
+ children: route.children
362
+ })),
363
+ [routes, location.pathname, labelTranslations]
364
+ );
365
+ useEffect(() => {
366
+ if (typeof window === "undefined") return;
367
+ const checkOverflow = () => {
368
+ if (!navRef.current) return;
369
+ if (variant === "assistant") return;
370
+ const navHeight = navRef.current.clientHeight;
371
+ const itemHeight = 44;
372
+ const maxVisibleItems = Math.floor(navHeight / itemHeight);
373
+ if (navigationItems.length > maxVisibleItems) {
374
+ setHasOverflow(true);
375
+ setVisibleItems(navigationItems.slice(0, maxVisibleItems - 1));
376
+ setOverflowItems(navigationItems.slice(maxVisibleItems - 1));
377
+ } else {
378
+ setHasOverflow(false);
379
+ setVisibleItems(navigationItems);
380
+ setOverflowItems([]);
381
+ }
382
+ };
383
+ checkOverflow();
384
+ window.addEventListener("resize", checkOverflow);
385
+ return () => window.removeEventListener("resize", checkOverflow);
386
+ }, [navigationItems.length, variant]);
387
+ useEffect(() => {
388
+ if (typeof window === "undefined") return;
389
+ if (variant === "assistant") return;
390
+ if (!navigationGroups || navigationGroups.length === 0) return;
391
+ const checkGroupOverflow = () => {
392
+ if (!navRef.current) return;
393
+ const containerHeight = navRef.current.clientHeight;
394
+ const itemHeight = 40;
395
+ const groupHeaderHeight = 32;
396
+ const groupSpacing = 12;
397
+ const moreButtonHeight = 44;
398
+ const padding = 32;
399
+ let currentHeight = padding;
400
+ let visibleCount = 0;
401
+ for (let i = 0; i < navigationGroups.length; i++) {
402
+ const group = navigationGroups[i];
403
+ let groupHeight = 0;
404
+ if (group.label) groupHeight += groupHeaderHeight;
405
+ groupHeight += group.items.length * itemHeight;
406
+ if (i > 0) groupHeight += groupSpacing;
407
+ const wouldExceed = currentHeight + groupHeight + (visibleCount < navigationGroups.length - 1 ? moreButtonHeight : 0) > containerHeight;
408
+ if (wouldExceed && visibleCount > 0) break;
409
+ currentHeight += groupHeight;
410
+ visibleCount++;
411
+ }
412
+ if (visibleCount < navigationGroups.length) {
413
+ setHasGroupOverflow(true);
414
+ setVisibleGroups(navigationGroups.slice(0, visibleCount));
415
+ setOverflowGroups(navigationGroups.slice(visibleCount));
416
+ } else {
417
+ setHasGroupOverflow(false);
418
+ setVisibleGroups(navigationGroups);
419
+ setOverflowGroups([]);
420
+ }
421
+ };
422
+ checkGroupOverflow();
423
+ window.addEventListener("resize", checkGroupOverflow);
424
+ return () => window.removeEventListener("resize", checkGroupOverflow);
425
+ }, [navigationGroups, expanded, variant]);
426
+ const handleNavigate = (path) => {
427
+ setLocalActiveItem(path);
428
+ navigate(path);
429
+ if (typeof window !== "undefined" && window.innerWidth < 768) {
430
+ onToggle();
431
+ }
432
+ };
433
+ const toNavItem = (route) => ({
434
+ path: route.path,
435
+ label: labelTranslations[route.label.toLowerCase()] || route.label,
436
+ icon: route.icon,
437
+ active: location.pathname === route.path || location.pathname.startsWith(route.path + "/"),
438
+ children: route.children,
439
+ actions: route.actions
440
+ });
441
+ const renderActionItems = (actions) => {
442
+ return actions.map((action, idx) => {
443
+ const Icon = action.icon;
444
+ if (action.children && action.children.length > 0) {
445
+ return /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [
446
+ /* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { children: [
447
+ Icon && /* @__PURE__ */ jsx(Icon, { className: "mr-2 h-4 w-4" }),
448
+ /* @__PURE__ */ jsx("span", { children: action.label })
449
+ ] }),
450
+ /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(DropdownMenuSubContent, { className: "w-48 bg-popover border-border", children: renderActionItems(action.children) }) })
451
+ ] }, idx);
452
+ }
453
+ return /* @__PURE__ */ jsxs(
454
+ DropdownMenuItem,
455
+ {
456
+ className: cn(
457
+ "flex items-center gap-2",
458
+ action.variant === "destructive" ? "text-destructive focus:text-destructive" : ""
459
+ ),
460
+ onClick: (e) => {
461
+ e.stopPropagation();
462
+ action.onClick?.(null);
463
+ },
464
+ children: [
465
+ Icon && /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4 flex-shrink-0" }),
466
+ /* @__PURE__ */ jsx("span", { children: action.label })
467
+ ]
468
+ },
469
+ idx
470
+ );
471
+ });
472
+ };
473
+ const renderAssistantActionMenu = (actions, isHeader = false) => {
474
+ if (!actions || actions.length === 0) return null;
475
+ return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
476
+ /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
477
+ Button,
478
+ {
479
+ variant: "ghost",
480
+ size: "icon",
481
+ className: cn(
482
+ "h-8 w-8 text-sidebar-foreground/80 hover:bg-sidebar-foreground/20 hover:text-sidebar-foreground rounded-full transition-all",
483
+ !isHeader && "opacity-0 group-hover/item:opacity-100"
484
+ ),
485
+ "aria-label": t("sidebar.moreOptions"),
486
+ children: /* @__PURE__ */ jsx(MoreVertical, { className: "h-4 w-4" })
487
+ }
488
+ ) }),
489
+ /* @__PURE__ */ jsx(DropdownMenuContent, { align: "end", className: "w-48 bg-popover border-border p-1", children: renderActionItems(actions) })
490
+ ] });
491
+ };
492
+ const renderDefaultItem = (item) => {
493
+ const Icon = item.icon;
494
+ const hasChildren = item.children && item.children.length > 0;
495
+ 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";
496
+ if (!expanded) {
497
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [
498
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
499
+ "button",
500
+ {
501
+ onClick: () => handleNavigate(item.path),
502
+ className: cn(
503
+ "w-full h-10 flex items-center justify-center px-0 rounded-[var(--radius-button)] transition-all duration-200",
504
+ activeClass
505
+ ),
506
+ "aria-label": item.label,
507
+ children: Icon && /* @__PURE__ */ jsx(Icon, { className: "w-5 h-5 flex-shrink-0" })
508
+ }
509
+ ) }),
510
+ /* @__PURE__ */ jsx(CustomTooltipContent, { side: "right", sideOffset: 0, children: /* @__PURE__ */ jsx("p", { children: item.label }) })
511
+ ] }, item.path);
512
+ }
513
+ if (isMobileViewport && hasChildren) {
514
+ const isOpen = openSubmenus.has(item.path);
515
+ return /* @__PURE__ */ jsxs("div", { children: [
516
+ /* @__PURE__ */ jsxs(
517
+ "div",
518
+ {
519
+ className: cn(
520
+ "group/item flex items-center w-full h-10 rounded-[var(--radius-button)] transition-all duration-200",
521
+ activeClass
522
+ ),
523
+ children: [
524
+ /* @__PURE__ */ jsxs(
525
+ "button",
526
+ {
527
+ onClick: () => handleNavigate(item.path),
528
+ className: "flex items-center gap-3 px-3 flex-1 h-full min-w-0 text-left",
529
+ children: [
530
+ Icon && /* @__PURE__ */ jsx(Icon, { className: "w-5 h-5 flex-shrink-0" }),
531
+ /* @__PURE__ */ jsx("span", { className: "truncate flex-1", children: item.label })
532
+ ]
533
+ }
534
+ ),
535
+ /* @__PURE__ */ jsx(
536
+ "button",
537
+ {
538
+ onClick: (e) => {
539
+ e.stopPropagation();
540
+ toggleSubmenu(item.path);
541
+ },
542
+ className: "h-full px-2 pr-2.5 flex items-center justify-center text-sidebar-foreground/40 hover:text-sidebar-foreground transition-colors",
543
+ "aria-label": t("sidebar.submenu", { label: item.label }),
544
+ "aria-expanded": isOpen,
545
+ children: /* @__PURE__ */ jsx(
546
+ ChevronRight,
547
+ {
548
+ className: cn("w-4 h-4 transition-transform duration-200", isOpen && "rotate-90")
549
+ }
550
+ )
551
+ }
552
+ )
553
+ ]
554
+ }
555
+ ),
556
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: isOpen && /* @__PURE__ */ jsx(
557
+ motion.div,
558
+ {
559
+ initial: { height: 0, opacity: 0 },
560
+ animate: { height: "auto", opacity: 1 },
561
+ exit: { height: 0, opacity: 0 },
562
+ transition: { duration: 0.2 },
563
+ className: "overflow-hidden",
564
+ children: /* @__PURE__ */ jsx("div", { className: "ml-4 mt-0.5 mb-0.5 space-y-0.5", children: item.children.map((child) => {
565
+ const ChildIcon = child.icon;
566
+ const isChildActive = location.pathname === child.path || location.pathname.startsWith(child.path + "/");
567
+ return /* @__PURE__ */ jsxs(
568
+ "button",
569
+ {
570
+ onClick: () => handleNavigate(child.path),
571
+ className: cn(
572
+ "w-full h-9 flex items-center gap-2.5 px-3 rounded-[var(--radius-button)] transition-all duration-200 text-left",
573
+ isChildActive ? "bg-sidebar-foreground/15 text-sidebar-foreground" : "text-sidebar-foreground/70 hover:bg-sidebar-foreground/10 hover:text-sidebar-foreground"
574
+ ),
575
+ children: [
576
+ ChildIcon && /* @__PURE__ */ jsx(ChildIcon, { className: "h-4 w-4 flex-shrink-0" }),
577
+ /* @__PURE__ */ jsx("span", { className: "truncate text-sm", children: child.label })
578
+ ]
579
+ },
580
+ child.path
581
+ );
582
+ }) })
583
+ }
584
+ ) })
585
+ ] }, item.path);
586
+ }
587
+ return /* @__PURE__ */ jsxs(
588
+ "div",
589
+ {
590
+ className: cn(
591
+ "group/item flex items-center w-full h-10 rounded-[var(--radius-button)] transition-all duration-200",
592
+ activeClass
593
+ ),
594
+ children: [
595
+ /* @__PURE__ */ jsxs(
596
+ "button",
597
+ {
598
+ onClick: () => handleNavigate(item.path),
599
+ className: "flex items-center gap-3 px-3 flex-1 h-full min-w-0 text-left",
600
+ children: [
601
+ Icon && /* @__PURE__ */ jsx(Icon, { className: "w-5 h-5 flex-shrink-0" }),
602
+ /* @__PURE__ */ jsx("span", { className: "truncate flex-1", children: item.label })
603
+ ]
604
+ }
605
+ ),
606
+ hasChildren && /* @__PURE__ */ jsxs(DropdownMenu, { children: [
607
+ /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
608
+ "button",
609
+ {
610
+ onClick: (e) => e.stopPropagation(),
611
+ className: "h-full px-2 pr-2.5 flex items-center justify-center text-sidebar-foreground/40 hover:text-sidebar-foreground transition-colors",
612
+ "aria-label": t("sidebar.submenu", { label: item.label }),
613
+ children: /* @__PURE__ */ jsx(ChevronRight, { className: "w-4 h-4" })
614
+ }
615
+ ) }),
616
+ /* @__PURE__ */ jsx(
617
+ DropdownMenuContent,
618
+ {
619
+ side: "right",
620
+ align: "start",
621
+ className: "w-48 bg-popover border-border p-1",
622
+ children: item.children.map((child) => {
623
+ const ChildIcon = child.icon;
624
+ const isChildActive = location.pathname === child.path || location.pathname.startsWith(child.path + "/");
625
+ return /* @__PURE__ */ jsxs(
626
+ DropdownMenuItem,
627
+ {
628
+ onClick: () => handleNavigate(child.path),
629
+ className: cn(
630
+ "flex items-center gap-2 cursor-pointer",
631
+ isChildActive && "bg-accent text-accent-foreground"
632
+ ),
633
+ children: [
634
+ ChildIcon && /* @__PURE__ */ jsx(ChildIcon, { className: "h-4 w-4 flex-shrink-0" }),
635
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: child.label })
636
+ ]
637
+ },
638
+ child.path
639
+ );
640
+ })
641
+ }
642
+ )
643
+ ] })
644
+ ]
645
+ },
646
+ item.path
647
+ );
648
+ };
649
+ const renderDefaultGroup = (group) => {
650
+ const GroupIcon = group.icon;
651
+ if (!expanded) {
652
+ return /* @__PURE__ */ jsx("div", { className: "space-y-1", children: group.items.map((item) => renderDefaultItem(toNavItem(item))) }, group.id);
653
+ }
654
+ return /* @__PURE__ */ jsxs("div", { children: [
655
+ (group.label || GroupIcon) && /* @__PURE__ */ jsxs("div", { className: "px-3 mb-1 flex items-center gap-2", children: [
656
+ GroupIcon && (React__default.isValidElement(GroupIcon) ? GroupIcon : /* @__PURE__ */ jsx(GroupIcon, { className: "h-3 w-3 text-sidebar-foreground/80" })),
657
+ group.label && /* @__PURE__ */ jsx("span", { className: "text-xs font-semibold uppercase tracking-wider text-sidebar-foreground/80", children: group.label })
658
+ ] }),
659
+ /* @__PURE__ */ jsx("div", { className: "space-y-1", children: group.items.map((item) => renderDefaultItem(toNavItem(item))) })
660
+ ] }, group.id);
661
+ };
662
+ const renderAssistantGroup = (group) => {
663
+ const isAnyItemActive = group.items.some(
664
+ (item) => location.pathname === item.path || location.pathname.startsWith(item.path + "/")
665
+ );
666
+ const GroupIcon = group.icon;
667
+ if (!expanded) {
668
+ if (!GroupIcon) return null;
669
+ return /* @__PURE__ */ jsx("div", { className: "py-2 flex justify-center", children: /* @__PURE__ */ jsxs(Tooltip, { children: [
670
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
671
+ "button",
672
+ {
673
+ onClick: () => onToggle(),
674
+ "aria-label": group.label,
675
+ className: cn(
676
+ "h-10 w-10 flex items-center justify-center rounded-[var(--radius-button)] transition-all duration-200",
677
+ isAnyItemActive ? "bg-sidebar-foreground/15 text-sidebar-foreground shadow-sm" : "text-sidebar-foreground/80 hover:bg-sidebar-foreground/15 hover:text-sidebar-foreground"
678
+ ),
679
+ children: React__default.isValidElement(GroupIcon) ? GroupIcon : /* @__PURE__ */ jsx(GroupIcon, { className: "h-5 w-5" })
680
+ }
681
+ ) }),
682
+ /* @__PURE__ */ jsx(CustomTooltipContent, { side: "right", children: /* @__PURE__ */ jsx("p", { children: group.label }) })
683
+ ] }) }, group.id);
684
+ }
685
+ return /* @__PURE__ */ jsxs("div", { className: "py-2 group", children: [
686
+ (group.label || group.icon) && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-3 mb-1", children: [
687
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sidebar-foreground/80 text-xs font-semibold uppercase tracking-wider", children: [
688
+ GroupIcon && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: React__default.isValidElement(GroupIcon) ? GroupIcon : /* @__PURE__ */ jsx(GroupIcon, { className: "h-4 w-4" }) }),
689
+ group.label && /* @__PURE__ */ jsx("span", { children: group.label })
690
+ ] }),
691
+ renderAssistantActionMenu(group.actions, true)
692
+ ] }),
693
+ /* @__PURE__ */ jsx("div", { className: "space-y-1", children: group.items.map((item) => {
694
+ const isRouteActive = location.pathname === item.path || location.pathname.startsWith(item.path + "/");
695
+ const isActive = isRouteActive || localActiveItem === item.path;
696
+ const Icon = item.icon;
697
+ return /* @__PURE__ */ jsxs(
698
+ "div",
699
+ {
700
+ 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"}`,
701
+ onClick: () => handleNavigate(item.path),
702
+ children: [
703
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col min-w-0 flex-1", children: [
704
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 overflow-hidden h-5", children: [
705
+ 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" }) }),
706
+ /* @__PURE__ */ jsx("span", { className: "truncate text-sm font-medium leading-none", children: item.label })
707
+ ] }),
708
+ 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 })
709
+ ] }),
710
+ /* @__PURE__ */ jsx("div", { className: "h-5 flex items-center ml-1", children: renderAssistantActionMenu(item.actions) })
711
+ ]
712
+ },
713
+ item.path
714
+ );
715
+ }) })
716
+ ] }, group.id);
717
+ };
718
+ if (variant === "assistant") {
719
+ return /* @__PURE__ */ jsx("div", { className: "flex-1 min-h-0 overflow-hidden", children: /* @__PURE__ */ jsx(ScrollArea, { className: "h-full px-4", children: navigationGroups.map((group) => renderAssistantGroup(group)) }) });
720
+ }
721
+ if (isMobileViewport && isOverflowAccordionOpen) {
722
+ return /* @__PURE__ */ jsx("div", { className: "flex-1 min-h-0 overflow-hidden", children: /* @__PURE__ */ jsx(ScrollArea, { className: "h-full", children: /* @__PURE__ */ jsx(
723
+ "nav",
724
+ {
725
+ id: "sidebar-nav",
726
+ "aria-label": t("sidebar.mainNavigation"),
727
+ className: "px-4 py-4",
728
+ ref: navRef,
729
+ children: navigationGroups && navigationGroups.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
730
+ (hasGroupOverflow ? visibleGroups : navigationGroups).map((group) => /* @__PURE__ */ jsx(React__default.Fragment, { children: renderDefaultGroup(group) }, group.id)),
731
+ hasGroupOverflow && /* @__PURE__ */ jsx(
732
+ OverflowGroupsAccordion,
733
+ {
734
+ expanded,
735
+ overflowGroups,
736
+ location,
737
+ handleNavigate,
738
+ moreOptionsLabel: t("sidebar.moreOptions"),
739
+ onOpenChange: setIsOverflowAccordionOpen
740
+ }
741
+ )
742
+ ] }) : /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
743
+ (hasOverflow ? visibleItems : navigationItems).map((item) => renderDefaultItem(item)),
744
+ hasOverflow && /* @__PURE__ */ jsxs(Popover, { children: [
745
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
746
+ "button",
747
+ {
748
+ 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",
749
+ "aria-label": t("sidebar.moreOptions"),
750
+ children: [
751
+ /* @__PURE__ */ jsx(MoreVertical, { className: "w-5 h-5 flex-shrink-0" }),
752
+ expanded && /* @__PURE__ */ jsx("span", { className: "truncate text-sidebar-foreground", children: t("sidebar.moreOptions") })
753
+ ]
754
+ }
755
+ ) }),
756
+ /* @__PURE__ */ jsx(
757
+ PopoverContent,
758
+ {
759
+ side: "right",
760
+ align: "start",
761
+ className: "w-56 p-2 bg-popover border border-border rounded-[var(--radius-card)] shadow-lg",
762
+ sideOffset: 8,
763
+ children: /* @__PURE__ */ jsx("div", { className: "space-y-1", children: overflowItems.map((item) => {
764
+ const Icon = item.icon;
765
+ return /* @__PURE__ */ jsxs(
766
+ "button",
767
+ {
768
+ onClick: () => handleNavigate(item.path),
769
+ 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",
770
+ children: [
771
+ Icon && /* @__PURE__ */ jsx(Icon, { className: "w-4 h-4 flex-shrink-0" }),
772
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: item.label })
773
+ ]
774
+ },
775
+ item.path
776
+ );
777
+ }) })
778
+ }
779
+ )
780
+ ] })
781
+ ] })
782
+ }
783
+ ) }) });
784
+ }
785
+ return /* @__PURE__ */ jsx("div", { className: "flex-1 min-h-0 overflow-hidden", children: /* @__PURE__ */ jsx(
786
+ "nav",
787
+ {
788
+ id: "sidebar-nav",
789
+ "aria-label": t("sidebar.mainNavigation"),
790
+ className: "h-full px-4 py-4 overflow-hidden",
791
+ ref: navRef,
792
+ children: navigationGroups && navigationGroups.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
793
+ (hasGroupOverflow ? visibleGroups : navigationGroups).map((group) => /* @__PURE__ */ jsx(React__default.Fragment, { children: renderDefaultGroup(group) }, group.id)),
794
+ hasGroupOverflow && (isMobileViewport ? (
795
+ // Mobile: accordion inline abre abaixo, igual aos subitens
796
+ /* @__PURE__ */ jsx(
797
+ OverflowGroupsAccordion,
798
+ {
799
+ expanded,
800
+ overflowGroups,
801
+ location,
802
+ handleNavigate,
803
+ moreOptionsLabel: t("sidebar.moreOptions"),
804
+ onOpenChange: setIsOverflowAccordionOpen
805
+ }
806
+ )
807
+ ) : (
808
+ // Desktop: popover lateral direito
809
+ /* @__PURE__ */ jsxs(Popover, { children: [
810
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
811
+ "button",
812
+ {
813
+ 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",
814
+ "aria-label": t("sidebar.moreOptions"),
815
+ children: [
816
+ /* @__PURE__ */ jsx(MoreVertical, { className: "w-5 h-5 flex-shrink-0" }),
817
+ expanded && /* @__PURE__ */ jsx("span", { className: "truncate text-sidebar-foreground", children: t("sidebar.moreOptions") })
818
+ ]
819
+ }
820
+ ) }),
821
+ /* @__PURE__ */ jsx(
822
+ PopoverContent,
823
+ {
824
+ side: "right",
825
+ align: "start",
826
+ className: "w-56 p-2 bg-popover border border-border rounded-[var(--radius-card)] shadow-lg",
827
+ sideOffset: 8,
828
+ children: /* @__PURE__ */ jsx("div", { className: "space-y-3", children: overflowGroups.map((group) => {
829
+ const GroupIcon = group.icon;
830
+ return /* @__PURE__ */ jsxs("div", { children: [
831
+ (group.label || GroupIcon) && /* @__PURE__ */ jsxs("div", { className: "px-2 mb-1 flex items-center gap-2", children: [
832
+ GroupIcon && (React__default.isValidElement(GroupIcon) ? GroupIcon : /* @__PURE__ */ jsx(GroupIcon, { className: "h-3 w-3 text-popover-foreground/60" })),
833
+ group.label && /* @__PURE__ */ jsx("span", { className: "text-xs font-semibold uppercase tracking-wider text-popover-foreground/60", children: group.label })
834
+ ] }),
835
+ /* @__PURE__ */ jsx("div", { className: "space-y-1", children: group.items.map((item) => {
836
+ const Icon = item.icon;
837
+ const isActive = location.pathname === item.path || location.pathname.startsWith(item.path + "/");
838
+ return /* @__PURE__ */ jsxs(
839
+ "button",
840
+ {
841
+ onClick: () => handleNavigate(item.path),
842
+ className: cn(
843
+ "w-full h-9 flex items-center gap-2 px-2 rounded-[var(--radius-button)] transition-all duration-200 text-left text-sm",
844
+ isActive ? "bg-accent text-accent-foreground font-medium" : "text-popover-foreground/80 hover:bg-accent hover:text-accent-foreground"
845
+ ),
846
+ children: [
847
+ Icon && /* @__PURE__ */ jsx(Icon, { className: "w-4 h-4 flex-shrink-0" }),
848
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: item.label })
849
+ ]
850
+ },
851
+ item.path
852
+ );
853
+ }) })
854
+ ] }, group.id);
855
+ }) })
856
+ }
857
+ )
858
+ ] })
859
+ ))
860
+ ] }) : /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
861
+ (hasOverflow ? visibleItems : navigationItems).map((item) => renderDefaultItem(item)),
862
+ hasOverflow && /* @__PURE__ */ jsxs(Popover, { children: [
863
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
864
+ "button",
865
+ {
866
+ 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",
867
+ "aria-label": t("sidebar.moreOptions"),
868
+ children: [
869
+ /* @__PURE__ */ jsx(MoreVertical, { className: "w-5 h-5 flex-shrink-0" }),
870
+ expanded && /* @__PURE__ */ jsx("span", { className: "truncate text-sidebar-foreground", children: t("sidebar.moreOptions") })
871
+ ]
872
+ }
873
+ ) }),
874
+ /* @__PURE__ */ jsx(
875
+ PopoverContent,
876
+ {
877
+ side: "right",
878
+ align: "start",
879
+ className: "w-56 p-2 bg-popover border border-border rounded-[var(--radius-card)] shadow-lg",
880
+ sideOffset: 8,
881
+ children: /* @__PURE__ */ jsx("div", { className: "space-y-1", children: overflowItems.map((item) => {
882
+ const Icon = item.icon;
883
+ return /* @__PURE__ */ jsxs(
884
+ "button",
885
+ {
886
+ onClick: () => handleNavigate(item.path),
887
+ 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",
888
+ children: [
889
+ Icon && /* @__PURE__ */ jsx(Icon, { className: "w-4 h-4 flex-shrink-0" }),
890
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: item.label })
891
+ ]
892
+ },
893
+ item.path
894
+ );
895
+ }) })
896
+ }
897
+ )
898
+ ] })
899
+ ] })
900
+ }
901
+ ) });
902
+ }
903
+ function SidebarSearch({
904
+ fixedArea,
905
+ search
906
+ }) {
907
+ const { expanded } = useSidebarContext();
908
+ const { t } = useTranslation();
909
+ const [isFilterOpen, setIsFilterOpen] = useState(false);
910
+ if (!(fixedArea && fixedArea.show || search && search.show)) return null;
911
+ return /* @__PURE__ */ jsxs("div", { className: "flex-shrink-0 px-4 pb-4 space-y-4 border-b border-sidebar-border/30 mb-2", children: [
912
+ fixedArea?.show && fixedArea.content && expanded && /* @__PURE__ */ jsx("div", { className: "animate-in fade-in slide-in-from-top-1 duration-300", children: fixedArea.content }),
913
+ search?.show && expanded && /* @__PURE__ */ jsxs(Fragment, { children: [
914
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
915
+ /* @__PURE__ */ jsxs("div", { className: "relative flex-1", children: [
916
+ /* @__PURE__ */ jsx(Search, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-sidebar-foreground/50" }),
917
+ /* @__PURE__ */ jsx(
918
+ Input,
919
+ {
920
+ type: "text",
921
+ placeholder: search.placeholder || t("sidebar.searchPlaceholder"),
922
+ "aria-label": search.placeholder || t("sidebar.searchPlaceholder"),
923
+ value: search.value,
924
+ onChange: (e) => search.onChange?.(e.target.value),
925
+ 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"
926
+ }
927
+ )
928
+ ] }),
929
+ search.filter?.show && search.filter.content && /* @__PURE__ */ jsx(
930
+ Button,
931
+ {
932
+ variant: "ghost",
933
+ size: "icon",
934
+ onClick: () => setIsFilterOpen(!isFilterOpen),
935
+ className: cn(
936
+ "h-9 w-9 text-sidebar-foreground transition-all duration-200",
937
+ isFilterOpen ? "bg-sidebar-foreground/20" : "hover:bg-sidebar-foreground/15"
938
+ ),
939
+ "aria-label": isFilterOpen ? t("sidebar.closeFilters") : t("sidebar.openFilters"),
940
+ children: search.filter.icon || /* @__PURE__ */ jsx(Filter, { className: "h-4 w-4" })
941
+ }
942
+ )
943
+ ] }),
944
+ /* @__PURE__ */ jsx(AnimatePresence, { children: isFilterOpen && search.filter?.show && search.filter.content && /* @__PURE__ */ jsx(
945
+ motion.div,
946
+ {
947
+ initial: { height: 0, opacity: 0 },
948
+ animate: { height: "auto", opacity: 1 },
949
+ exit: { height: 0, opacity: 0 },
950
+ transition: { duration: 0.2 },
951
+ className: "overflow-hidden",
952
+ children: /* @__PURE__ */ jsx("div", { className: "pt-2 border-t border-sidebar-border/20", children: search.filter.content })
953
+ }
954
+ ) })
955
+ ] }),
956
+ !expanded && (fixedArea?.show || search?.show) && /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-4 py-2", children: [
957
+ fixedArea?.show && fixedArea.icon && /* @__PURE__ */ jsxs(Tooltip, { children: [
958
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
959
+ "button",
960
+ {
961
+ onClick: () => fixedArea.onClick?.(),
962
+ 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",
963
+ "aria-label": t("assistant.newConversation"),
964
+ children: React__default.isValidElement(fixedArea.icon) ? fixedArea.icon : /* @__PURE__ */ jsx(fixedArea.icon, { className: "h-5 w-5" })
965
+ }
966
+ ) }),
967
+ /* @__PURE__ */ jsx(CustomTooltipContent, { side: "right", children: t("assistant.newConversation") })
968
+ ] }),
969
+ search?.show && /* @__PURE__ */ jsxs(Tooltip, { children: [
970
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
971
+ "button",
972
+ {
973
+ 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",
974
+ "aria-label": t("sidebar.search"),
975
+ children: /* @__PURE__ */ jsx(Search, { className: "h-5 w-5" })
976
+ }
977
+ ) }),
978
+ /* @__PURE__ */ jsx(CustomTooltipContent, { side: "right", children: t("sidebar.search") })
979
+ ] })
980
+ ] })
981
+ ] });
982
+ }
983
+ function SidebarFooter({
984
+ user,
985
+ onLogout = () => {
986
+ },
987
+ onSettingsClick,
988
+ showUser = true,
989
+ showSettings = true,
990
+ showLogout = true
991
+ }) {
992
+ const { expanded, navigate, location, onToggle } = useSidebarContext();
993
+ const { t } = useTranslation();
994
+ const isSettingsActive = location.pathname === "/settings";
995
+ const handleSettingsClick = () => {
996
+ if (onSettingsClick) {
997
+ onSettingsClick();
998
+ } else {
999
+ navigate("/settings");
1000
+ }
1001
+ if (typeof window !== "undefined" && window.innerWidth < 768) {
1002
+ onToggle();
1003
+ }
1004
+ };
1005
+ return /* @__PURE__ */ jsxs("div", { className: "flex-shrink-0 p-4 space-y-2", children: [
1006
+ showUser && (!expanded ? /* @__PURE__ */ jsxs(Tooltip, { children: [
1007
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
1008
+ "button",
1009
+ {
1010
+ 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",
1011
+ "aria-label": t("sidebar.userProfile"),
1012
+ children: /* @__PURE__ */ jsxs(Avatar, { className: "w-7 h-7 flex-shrink-0", children: [
1013
+ /* @__PURE__ */ jsx(AvatarImage, { src: user?.avatar, alt: user?.name || "User" }),
1014
+ /* @__PURE__ */ jsx(AvatarFallback, { className: "bg-sidebar-foreground/15 text-sidebar-foreground text-xs", children: user?.name ? user.name.charAt(0).toUpperCase() : "U" })
1015
+ ] })
1016
+ }
1017
+ ) }),
1018
+ /* @__PURE__ */ jsx(CustomTooltipContent, { side: "right", sideOffset: 0, children: /* @__PURE__ */ jsx("p", { children: user?.name || t("sidebar.profile") }) })
1019
+ ] }) : /* @__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: [
1020
+ /* @__PURE__ */ jsxs(Avatar, { className: "w-7 h-7 flex-shrink-0", children: [
1021
+ /* @__PURE__ */ jsx(AvatarImage, { src: user?.avatar, alt: user?.name || "User" }),
1022
+ /* @__PURE__ */ jsx(AvatarFallback, { className: "bg-sidebar-foreground/15 text-sidebar-foreground text-xs", children: user?.name ? user.name.charAt(0).toUpperCase() : "U" })
1023
+ ] }),
1024
+ /* @__PURE__ */ jsx("span", { className: "text-sidebar-foreground truncate", children: user?.name || t("sidebar.profile") })
1025
+ ] })),
1026
+ showSettings && (!expanded ? /* @__PURE__ */ jsxs(Tooltip, { children: [
1027
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
1028
+ "button",
1029
+ {
1030
+ onClick: handleSettingsClick,
1031
+ className: cn(
1032
+ "w-full h-10 flex items-center justify-center px-0 rounded-[var(--radius-button)] transition-all duration-200",
1033
+ isSettingsActive ? "bg-sidebar-foreground/15 text-sidebar-foreground shadow-sm" : "text-sidebar-foreground/80 hover:bg-sidebar-foreground/15 hover:text-sidebar-foreground"
1034
+ ),
1035
+ "aria-label": t("nav.settings"),
1036
+ children: /* @__PURE__ */ jsx(Settings, { className: "w-5 h-5 flex-shrink-0" })
1037
+ }
1038
+ ) }),
1039
+ /* @__PURE__ */ jsx(CustomTooltipContent, { side: "right", sideOffset: 0, children: /* @__PURE__ */ jsx("p", { children: t("nav.settings") }) })
1040
+ ] }) : /* @__PURE__ */ jsxs(
1041
+ "button",
1042
+ {
1043
+ onClick: handleSettingsClick,
1044
+ className: cn(
1045
+ "w-full h-10 flex items-center gap-3 px-3 justify-start rounded-[var(--radius-button)] transition-all duration-200",
1046
+ isSettingsActive ? "bg-sidebar-foreground/15 text-sidebar-foreground shadow-sm" : "text-sidebar-foreground/80 hover:bg-sidebar-foreground/15 hover:text-sidebar-foreground"
1047
+ ),
1048
+ children: [
1049
+ /* @__PURE__ */ jsx(Settings, { className: "w-5 h-5 flex-shrink-0" }),
1050
+ /* @__PURE__ */ jsx("span", { className: "truncate text-sidebar-foreground", children: t("nav.settings") })
1051
+ ]
1052
+ }
1053
+ )),
1054
+ showLogout && (!expanded ? /* @__PURE__ */ jsxs(Tooltip, { children: [
1055
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
1056
+ "button",
1057
+ {
1058
+ onClick: onLogout,
1059
+ 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",
1060
+ "aria-label": t("sidebar.logout"),
1061
+ children: /* @__PURE__ */ jsx(LogOut, { className: "w-5 h-5 flex-shrink-0" })
1062
+ }
1063
+ ) }),
1064
+ /* @__PURE__ */ jsx(CustomTooltipContent, { side: "right", sideOffset: 0, children: /* @__PURE__ */ jsx("p", { children: t("sidebar.logout") }) })
1065
+ ] }) : /* @__PURE__ */ jsxs(
1066
+ "button",
1067
+ {
1068
+ onClick: onLogout,
1069
+ 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",
1070
+ children: [
1071
+ /* @__PURE__ */ jsx(LogOut, { className: "w-5 h-5 flex-shrink-0" }),
1072
+ /* @__PURE__ */ jsx("span", { className: "truncate text-sidebar-foreground", children: t("sidebar.logout") })
1073
+ ]
1074
+ }
1075
+ ))
1076
+ ] });
1077
+ }
1078
+ function Sidebar({
1079
+ expanded: expandedProp,
1080
+ onToggle: onToggleProp,
1081
+ user,
1082
+ onLogout = () => {
1083
+ },
1084
+ onSettingsClick,
1085
+ location: locationProp,
1086
+ navigate: navigateProp,
1087
+ routes,
1088
+ logo,
1089
+ logoCollapsed,
1090
+ variant = "default",
1091
+ fixedArea,
1092
+ search,
1093
+ navigationGroups = [],
1094
+ footer,
1095
+ showFooter,
1096
+ width: widthProp
1097
+ }) {
1098
+ const { showUser = true, showSettings = true, showLogout = true } = footer || {};
1099
+ const displayFooter = showFooter !== void 0 ? showFooter : variant === "default";
1100
+ return /* @__PURE__ */ jsxs(
1101
+ SidebarRoot,
1102
+ {
1103
+ expanded: expandedProp,
1104
+ onToggle: onToggleProp,
1105
+ navigate: navigateProp,
1106
+ location: locationProp,
1107
+ width: widthProp,
1108
+ children: [
1109
+ /* @__PURE__ */ jsx(SidebarHeader, { logo, logoCollapsed }),
1110
+ variant === "assistant" && /* @__PURE__ */ jsx(SidebarSearch, { fixedArea, search }),
1111
+ /* @__PURE__ */ jsx(SidebarNav, { navigationGroups, routes, variant }),
1112
+ displayFooter && (showUser || showSettings || showLogout) && /* @__PURE__ */ jsx(
1113
+ SidebarFooter,
1114
+ {
1115
+ user,
1116
+ onLogout,
1117
+ onSettingsClick,
1118
+ showUser,
1119
+ showSettings,
1120
+ showLogout
1121
+ }
1122
+ )
1123
+ ]
1124
+ }
1125
+ );
1126
+ }
1127
+ Sidebar.Root = SidebarRoot;
1128
+ Sidebar.Header = SidebarHeader;
1129
+ Sidebar.Search = SidebarSearch;
1130
+ Sidebar.Nav = SidebarNav;
1131
+ Sidebar.Footer = SidebarFooter;
1132
+
1133
+ export { Header as H, Sidebar as S };