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