xertica-ui 2.1.4 → 2.1.5

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 (430) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +1 -1
  3. package/assets/xertica-logo.svg +37 -37
  4. package/assets/xertica-x-logo.svg +20 -20
  5. package/bin/cli.ts +1 -1
  6. package/components/assistant/index.ts +6 -6
  7. package/components/assistant/xertica-assistant/hooks/index.ts +8 -0
  8. package/components/assistant/xertica-assistant/hooks/use-assistant-conversations.ts +119 -0
  9. package/components/assistant/xertica-assistant/hooks/use-assistant-messages.ts +323 -0
  10. package/components/assistant/xertica-assistant/hooks/use-assistant-suggestions.ts +64 -0
  11. package/components/assistant/xertica-assistant/use-assistant.ts +294 -559
  12. package/components/assistant/xertica-assistant/xertica-assistant.tsx +5 -13
  13. package/components/blocks/card-patterns/ActivityCard.tsx +72 -72
  14. package/components/blocks/card-patterns/FeatureCard.tsx +100 -100
  15. package/components/blocks/card-patterns/NotificationCard.tsx +127 -127
  16. package/components/blocks/card-patterns/ProfileCard.tsx +84 -84
  17. package/components/blocks/card-patterns/ProjectCard.tsx +89 -89
  18. package/components/blocks/card-patterns/QuickActionCard.tsx +62 -62
  19. package/components/blocks/card-patterns/card-patterns.stories.tsx +445 -445
  20. package/components/blocks/card-patterns/card-patterns.test.tsx +448 -0
  21. package/components/blocks/card-patterns/index.ts +17 -17
  22. package/components/blocks/index.ts +1 -1
  23. package/components/brand/index.ts +6 -6
  24. package/components/brand/xertica-provider/XerticaProvider.tsx +48 -48
  25. package/components/brand/xertica-provider/xertica-provider.mdx +61 -61
  26. package/components/brand/xertica-provider/xertica-provider.test.tsx +52 -52
  27. package/components/examples/MapExamples.tsx +282 -282
  28. package/components/examples/SimpleFilterableMap.tsx +191 -191
  29. package/components/examples/index.ts +51 -51
  30. package/components/figma/ImageWithFallback.tsx +27 -27
  31. package/components/hooks/index.ts +12 -0
  32. package/components/index.ts +5 -5
  33. package/components/layout/header/header.test.tsx +8 -8
  34. package/components/layout/header/header.tsx +4 -4
  35. package/components/layout/index.ts +2 -2
  36. package/components/layout/sidebar/sidebar.mdx +1 -1
  37. package/components/layout/sidebar/sidebar.test.tsx +11 -11
  38. package/components/layout/sidebar/sidebar.tsx +25 -10
  39. package/components/media/FloatingMediaWrapper.tsx +11 -11
  40. package/components/media/audio-player/use-audio-player.ts +15 -5
  41. package/components/media/index.ts +3 -3
  42. package/components/pages/home-content/HomeContent.tsx +7 -7
  43. package/components/pages/home-content/home-content.mdx +62 -62
  44. package/components/pages/home-page/HomePage.stories.tsx +39 -39
  45. package/components/pages/home-page/home-page.mdx +53 -53
  46. package/components/pages/index.ts +8 -8
  47. package/components/pages/template-content/template-content.mdx +61 -61
  48. package/components/pages/template-page/TemplatePage.stories.tsx +39 -39
  49. package/components/pages/template-page/template-page.mdx +53 -53
  50. package/components/public-api-smoke.test.tsx +52 -52
  51. package/components/shared/assistant-utils.ts +43 -43
  52. package/components/ui/accordion/accordion.mdx +8 -8
  53. package/components/ui/accordion/accordion.stories.tsx +53 -53
  54. package/components/ui/alert/alert.mdx +8 -8
  55. package/components/ui/alert-dialog/alert-dialog.mdx +8 -8
  56. package/components/ui/aspect-ratio/aspect-ratio.mdx +8 -8
  57. package/components/ui/assistant-chart/assistant-chart.mdx +8 -8
  58. package/components/ui/avatar/avatar.mdx +8 -8
  59. package/components/ui/badge/badge.mdx +8 -8
  60. package/components/ui/badge/badge.tsx +9 -9
  61. package/components/ui/breadcrumb/breadcrumb.mdx +8 -8
  62. package/components/ui/button/button.mdx +8 -8
  63. package/components/ui/calendar/calendar.mdx +8 -8
  64. package/components/ui/calendar/calendar.tsx +258 -258
  65. package/components/ui/card/card.mdx +8 -8
  66. package/components/ui/card/card.stories.tsx +245 -245
  67. package/components/ui/carousel/carousel.mdx +8 -8
  68. package/components/ui/chart/chart.mdx +8 -8
  69. package/components/ui/chart/chart.stories.tsx +1303 -1303
  70. package/components/ui/chart/chart.test.tsx +254 -83
  71. package/components/ui/chart/chart.tsx +79 -2367
  72. package/components/ui/chart/parts/chart-dashboard.tsx +1025 -0
  73. package/components/ui/chart/parts/chart-metric.tsx +622 -0
  74. package/components/ui/chart/parts/chart-primitives.tsx +432 -0
  75. package/components/ui/chart/parts/chart-shared.tsx +201 -0
  76. package/components/ui/chart/parts/chart-utils.ts +145 -0
  77. package/components/ui/chart/parts/index.ts +5 -0
  78. package/components/ui/checkbox/checkbox.mdx +8 -8
  79. package/components/ui/checkbox/checkbox.stories.tsx +20 -20
  80. package/components/ui/collapsible/collapsible.mdx +8 -8
  81. package/components/ui/command/command.mdx +8 -8
  82. package/components/ui/context-menu/context-menu.mdx +8 -8
  83. package/components/ui/dialog/dialog.mdx +8 -8
  84. package/components/ui/drawer/drawer.mdx +8 -8
  85. package/components/ui/dropdown-menu/dropdown-menu.mdx +8 -8
  86. package/components/ui/empty/empty.mdx +8 -8
  87. package/components/ui/file-upload/file-upload.mdx +8 -8
  88. package/components/ui/file-upload/file-upload.test.tsx +6 -2
  89. package/components/ui/file-upload/file-upload.tsx +17 -5
  90. package/components/ui/file-upload/use-file-upload.test.ts +173 -0
  91. package/components/ui/file-upload/use-file-upload.ts +76 -25
  92. package/components/ui/google-maps-loader/google-maps-loader.tsx +2 -2
  93. package/components/ui/hover-card/hover-card.mdx +8 -8
  94. package/components/ui/index.ts +1 -1
  95. package/components/ui/input/input.mdx +8 -8
  96. package/components/ui/input-otp/input-otp.mdx +8 -8
  97. package/components/ui/input-otp/input-otp.stories.tsx +6 -6
  98. package/components/ui/label/label.mdx +8 -8
  99. package/components/ui/map/map.mdx +8 -8
  100. package/components/ui/map/map.stories.tsx +51 -51
  101. package/components/ui/map/map.tsx +2 -2
  102. package/components/ui/menubar/menubar.mdx +8 -8
  103. package/components/ui/navigation-menu/navigation-menu.mdx +8 -8
  104. package/components/ui/notification-badge/notification-badge.mdx +8 -8
  105. package/components/ui/pagination/pagination.mdx +8 -8
  106. package/components/ui/pagination/pagination.tsx +17 -0
  107. package/components/ui/pagination/use-pagination.test.ts +104 -0
  108. package/components/ui/pagination/use-pagination.ts +33 -16
  109. package/components/ui/popover/popover.mdx +8 -8
  110. package/components/ui/progress/progress.mdx +8 -8
  111. package/components/ui/progress/progress.tsx +68 -68
  112. package/components/ui/radio-group/radio-group.mdx +8 -8
  113. package/components/ui/rating/rating.mdx +8 -8
  114. package/components/ui/resizable/resizable.mdx +8 -8
  115. package/components/ui/rich-text-editor/rich-text-editor.tsx +9 -3
  116. package/components/ui/rich-text-editor/use-rich-text-editor.test.ts +110 -0
  117. package/components/ui/rich-text-editor/use-rich-text-editor.ts +42 -15
  118. package/components/ui/route-map/route-map.mdx +8 -8
  119. package/components/ui/route-map/route-map.stories.tsx +54 -54
  120. package/components/ui/route-map/route-map.tsx +2 -2
  121. package/components/ui/scroll-area/scroll-area.mdx +8 -8
  122. package/components/ui/search/search.mdx +8 -8
  123. package/components/ui/select/select.mdx +8 -8
  124. package/components/ui/select/select.stories.tsx +9 -9
  125. package/components/ui/separator/separator.mdx +8 -8
  126. package/components/ui/sheet/sheet.mdx +8 -8
  127. package/components/ui/sheet/sheet.stories.tsx +95 -95
  128. package/components/ui/simple-map/simple-map.mdx +8 -8
  129. package/components/ui/simple-map/simple-map.stories.tsx +48 -48
  130. package/components/ui/skeleton/skeleton.mdx +8 -8
  131. package/components/ui/slider/slider.mdx +8 -8
  132. package/components/ui/sonner/sonner.mdx +8 -8
  133. package/components/ui/stats-card/stats-card.mdx +8 -8
  134. package/components/ui/stepper/stepper.mdx +8 -8
  135. package/components/ui/stepper/stepper.tsx +21 -2
  136. package/components/ui/stepper/use-stepper.test.ts +109 -0
  137. package/components/ui/stepper/use-stepper.ts +4 -1
  138. package/components/ui/switch/switch.mdx +8 -8
  139. package/components/ui/switch/switch.stories.tsx +20 -20
  140. package/components/ui/table/table.mdx +8 -8
  141. package/components/ui/tabs/tabs.mdx +8 -8
  142. package/components/ui/tabs/tabs.stories.tsx +26 -26
  143. package/components/ui/textarea/textarea.mdx +8 -8
  144. package/components/ui/timeline/timeline.mdx +8 -8
  145. package/components/ui/toggle/toggle.mdx +8 -8
  146. package/components/ui/toggle-group/toggle-group.mdx +8 -8
  147. package/components/ui/tooltip/tooltip.mdx +8 -8
  148. package/components/ui/tree-view/tree-view.mdx +8 -8
  149. package/components/ui/tree-view/tree-view.tsx +29 -4
  150. package/components/ui/tree-view/use-tree-view.test.ts +91 -0
  151. package/components/ui/tree-view/use-tree-view.ts +38 -19
  152. package/components.json +1512 -1512
  153. package/contexts/ApiKeyContext.tsx +72 -72
  154. package/contexts/LanguageContext.tsx +13 -13
  155. package/contexts/LayoutContext.test.tsx +11 -11
  156. package/contexts/ThemeContext.tsx +26 -26
  157. package/contexts/theme-data.ts +4 -4
  158. package/dist/{AssistantChart-CVzmmhx4.js → AssistantChart-C_hwFRRr.js} +4 -4
  159. package/dist/{AssistantChart-BAudAfne.cjs → AssistantChart-CldVCVDe.cjs} +5 -5
  160. package/dist/{AssistantChart-BP8upjMk.js → AssistantChart-Cu3m7RBo.js} +5 -5
  161. package/dist/AssistantChart-DIpshm3i.js +4784 -0
  162. package/dist/{AssistantChart-9w31gdAb.cjs → AssistantChart-DoZCyS5r.cjs} +4 -4
  163. package/dist/AssistantChart-zjsy2GaZ.cjs +4810 -0
  164. package/dist/AudioPlayer-B1lt5cPl.cjs +989 -0
  165. package/dist/AudioPlayer-BZ7bibzU.cjs +982 -0
  166. package/dist/AudioPlayer-C12BjQBV.cjs +997 -0
  167. package/dist/{AudioPlayer-DuKXrCfy.js → AudioPlayer-CGRUtUdN.js} +1 -1
  168. package/dist/AudioPlayer-DMcG_c7L.js +990 -0
  169. package/dist/AudioPlayer-DcFKRJE_.js +998 -0
  170. package/dist/{AudioPlayer-1ypwE2Wh.cjs → AudioPlayer-IAU5q5T1.cjs} +1 -1
  171. package/dist/AudioPlayer-e8LfNoqO.js +983 -0
  172. package/dist/{xertica-assistant-Qp3ydksa.cjs → CodeBlock-7TTgmdGG.cjs} +263 -51
  173. package/dist/{xertica-assistant-gnCJdcZY.js → CodeBlock-BeSt1h5P.js} +219 -7
  174. package/dist/CodeBlock-BgfYL_rD.cjs +2094 -0
  175. package/dist/CodeBlock-BlcqlA9M.cjs +2094 -0
  176. package/dist/CodeBlock-Bnmeu5ez.cjs +2094 -0
  177. package/dist/CodeBlock-BtfPlbAI.js +2078 -0
  178. package/dist/CodeBlock-CIySIuYr.js +2078 -0
  179. package/dist/CodeBlock-CuPtUM-7.cjs +2094 -0
  180. package/dist/CodeBlock-D6ffWXgc.js +2078 -0
  181. package/dist/CodeBlock-D8dcwbit.cjs +2094 -0
  182. package/dist/CodeBlock-DMZrFnlw.cjs +2094 -0
  183. package/dist/CodeBlock-DlBehYN8.js +2078 -0
  184. package/dist/CodeBlock-DnYNI8rQ.js +2078 -0
  185. package/dist/CodeBlock-DvKWbSnE.cjs +2094 -0
  186. package/dist/CodeBlock-DwMCfkFY.js +2078 -0
  187. package/dist/CodeBlock-Dy6CNYyj.js +2078 -0
  188. package/dist/CodeBlock-U1pPOQI7.cjs +2094 -0
  189. package/dist/CodeBlock-f_GpNhEB.js +2078 -0
  190. package/dist/CodeBlock-oB6u8nI1.js +2078 -0
  191. package/dist/CodeBlock-tZC31B73.cjs +2094 -0
  192. package/dist/FeatureCard-CxC-7C-C.cjs +300 -0
  193. package/dist/FeatureCard-DbHWCb4E.js +301 -0
  194. package/dist/ImageWithFallback-CGtidP6B.cjs +4542 -0
  195. package/dist/ImageWithFallback-lsg3pdFg.js +4508 -0
  196. package/dist/{LanguageContext-DvUt5jBg.cjs → LanguageContext-B_KFTCzT.cjs} +2 -2
  197. package/dist/{LanguageContext-BwhwC3G2.js → LanguageContext-CS14yCpi.js} +2 -2
  198. package/dist/LanguageSelector-B5YfbHra.js +231 -0
  199. package/dist/LanguageSelector-D6uacAIM.cjs +230 -0
  200. package/dist/LayoutContext-BAql6ZRY.js +97 -0
  201. package/dist/LayoutContext-BvK-ggDa.cjs +96 -0
  202. package/dist/ThemeContext-BoH4NLfN.js +734 -0
  203. package/dist/{ThemeContext-BbBNoFTG.js → ThemeContext-C2EwAPDt.js} +2 -2
  204. package/dist/ThemeContext-r69W20Xg.cjs +733 -0
  205. package/dist/{ThemeContext-Cmr8Ex8H.cjs → ThemeContext-vTjumZeM.cjs} +2 -2
  206. package/dist/{VerifyEmailPage-C_ihbcth.js → VerifyEmailPage-C0c2e5n0.js} +6 -6
  207. package/dist/{VerifyEmailPage-DMBh4NM9.cjs → VerifyEmailPage-CYXtbKi3.cjs} +1 -1
  208. package/dist/{VerifyEmailPage-CbgjOF0v.js → VerifyEmailPage-CqKsR2v8.js} +10 -11
  209. package/dist/{VerifyEmailPage-Bae2cBXT.cjs → VerifyEmailPage-Cwi3kbol.cjs} +7 -7
  210. package/dist/{VerifyEmailPage-CdYPSJoO.js → VerifyEmailPage-DvMLZgFt.js} +1 -1
  211. package/dist/{VerifyEmailPage-Dt7zgA4w.cjs → VerifyEmailPage-s-1X3LDJ.cjs} +142 -143
  212. package/dist/XerticaOrbe-KL1RBHzw.cjs +1354 -0
  213. package/dist/XerticaOrbe-zwS1p2a8.js +1355 -0
  214. package/dist/XerticaProvider-6btlAlzc.js +17 -0
  215. package/dist/{XerticaProvider-siSt9uG2.js → XerticaProvider-B7EVH-NF.js} +2 -2
  216. package/dist/XerticaProvider-BNoNOxQ5.cjs +16 -0
  217. package/dist/XerticaProvider-BlY2limY.cjs +38 -0
  218. package/dist/{XerticaProvider-BITjgC5p.js → XerticaProvider-CEoWMTxu.js} +2 -2
  219. package/dist/{XerticaProvider-By8q3Roe.cjs → XerticaProvider-CllrbMEJ.cjs} +2 -2
  220. package/dist/XerticaProvider-DDuiIcKo.js +39 -0
  221. package/dist/{XerticaProvider-CW9hpCdF.cjs → XerticaProvider-ET0ihewn.cjs} +2 -2
  222. package/dist/XerticaProvider-cI9hSs27.cjs +38 -0
  223. package/dist/XerticaProvider-hSwhNQex.js +39 -0
  224. package/dist/{alert-dialog-yckpaOpy.cjs → alert-dialog-DSKByiKZ.cjs} +3 -3
  225. package/dist/{alert-dialog-iDe5VE5o.js → alert-dialog-s-vmNkJ_.js} +3 -3
  226. package/dist/assistant.cjs.js +1 -1
  227. package/dist/assistant.es.js +1 -1
  228. package/dist/blocks.cjs.js +1 -1
  229. package/dist/blocks.es.js +1 -1
  230. package/dist/brand.cjs.js +1 -1
  231. package/dist/brand.es.js +1 -1
  232. package/dist/breadcrumb-CqJ7bHY5.js +161 -0
  233. package/dist/breadcrumb-m9Hb2_XN.cjs +177 -0
  234. package/dist/cli.js +1 -1
  235. package/dist/components/assistant/xertica-assistant/hooks/index.d.ts +6 -0
  236. package/dist/components/assistant/xertica-assistant/hooks/use-assistant-conversations.d.ts +21 -0
  237. package/dist/components/assistant/xertica-assistant/hooks/use-assistant-messages.d.ts +49 -0
  238. package/dist/components/assistant/xertica-assistant/hooks/use-assistant-suggestions.d.ts +16 -0
  239. package/dist/components/assistant/xertica-assistant/xertica-assistant.d.ts +5 -13
  240. package/dist/components/blocks/audio-player/AudioPlayer.d.ts +35 -0
  241. package/dist/components/blocks/audio-player/index.d.ts +1 -0
  242. package/dist/components/blocks/document-editor/DocumentEditor.d.ts +26 -0
  243. package/dist/components/blocks/document-editor/index.d.ts +1 -0
  244. package/dist/components/blocks/podcast-player/PodcastPlayer.d.ts +41 -0
  245. package/dist/components/blocks/podcast-player/index.d.ts +1 -0
  246. package/dist/components/hooks/index.d.ts +10 -0
  247. package/dist/components/ui/chart/chart.d.ts +9 -324
  248. package/dist/components/ui/chart/parts/chart-dashboard.d.ts +113 -0
  249. package/dist/components/ui/chart/parts/chart-metric.d.ts +118 -0
  250. package/dist/components/ui/chart/parts/chart-primitives.d.ts +101 -0
  251. package/dist/components/ui/chart/parts/chart-shared.d.ts +20 -0
  252. package/dist/components/ui/chart/parts/chart-utils.d.ts +12 -0
  253. package/dist/components/ui/chart/parts/index.d.ts +5 -0
  254. package/dist/components/ui/file-upload/use-file-upload.d.ts +9 -15
  255. package/dist/components/ui/index.d.ts +1 -1
  256. package/dist/components/ui/pagination/pagination.d.ts +5 -3
  257. package/dist/components/ui/tree-view/tree-view.d.ts +2 -0
  258. package/dist/dropdown-menu-BDB5CmQs.cjs +247 -0
  259. package/dist/dropdown-menu-DQidbKBD.js +231 -0
  260. package/dist/google-maps-loader-BFWp6VPd.js +287 -0
  261. package/dist/{google-maps-loader-t2IlYBzw.js → google-maps-loader-CTYySAun.js} +4 -0
  262. package/dist/{google-maps-loader-BqsYL48U.cjs → google-maps-loader-Y-QkD-Li.cjs} +5 -0
  263. package/dist/google-maps-loader-eS3uQ5TA.cjs +287 -0
  264. package/dist/header-Cgy6vYPk.cjs +731 -0
  265. package/dist/header-DRlT4jgI.js +715 -0
  266. package/dist/header-Dux00SI4.cjs +731 -0
  267. package/dist/header-EkGKXPsD.js +715 -0
  268. package/dist/header-WfEywpyc.cjs +731 -0
  269. package/dist/header-tifNQn2U.js +715 -0
  270. package/dist/hooks.cjs.js +9 -2
  271. package/dist/hooks.es.js +10 -3
  272. package/dist/index-BhapVLVj.js +8 -0
  273. package/dist/{index-D3RLKRAs.cjs → index-COtD8bRW.cjs} +1 -1
  274. package/dist/index-D6fxYEY8.cjs +7 -0
  275. package/dist/index-DW5tYe26.js +8 -0
  276. package/dist/index.cjs.js +54 -40
  277. package/dist/index.es.js +259 -245
  278. package/dist/index.umd.js +1043 -470
  279. package/dist/input-2R4loU86.js +127 -0
  280. package/dist/input-DWANSKGb.cjs +145 -0
  281. package/dist/layout.cjs.js +1 -1
  282. package/dist/layout.es.js +1 -1
  283. package/dist/media.cjs.js +1 -1
  284. package/dist/media.es.js +1 -1
  285. package/dist/pages.cjs.js +1 -1
  286. package/dist/pages.es.js +1 -1
  287. package/dist/progress-DPtzoVV8.js +175 -0
  288. package/dist/progress-EeaoqqUs.cjs +191 -0
  289. package/dist/rich-text-editor-0mraWT5y.cjs +2376 -0
  290. package/dist/rich-text-editor-B6jMRLzk.cjs +1939 -0
  291. package/dist/rich-text-editor-B8_oYcIR.js +1730 -0
  292. package/dist/rich-text-editor-B9UbSXNb.js +1203 -0
  293. package/dist/rich-text-editor-BYuRBNBU.js +2373 -0
  294. package/dist/rich-text-editor-Bb9pySTs.cjs +2374 -0
  295. package/dist/rich-text-editor-BcL6L3cm.cjs +2374 -0
  296. package/dist/rich-text-editor-BoVZYtTs.cjs +2391 -0
  297. package/dist/rich-text-editor-CMgSN_w2.js +1189 -0
  298. package/dist/rich-text-editor-CPV1lEPH.cjs +1748 -0
  299. package/dist/rich-text-editor-CoKqbCtu.cjs +1799 -0
  300. package/dist/rich-text-editor-Cw56T_mB.js +2356 -0
  301. package/dist/rich-text-editor-Cyt8qs2b.js +1921 -0
  302. package/dist/rich-text-editor-D6H84OcX.cjs +1220 -0
  303. package/dist/rich-text-editor-D76gD-QI.js +2328 -0
  304. package/dist/rich-text-editor-DKkokOnA.js +1781 -0
  305. package/dist/rich-text-editor-DNsdpN64.cjs +2359 -0
  306. package/dist/rich-text-editor-DfG8bCyY.js +2358 -0
  307. package/dist/rich-text-editor-Dxjw31Z4.js +2341 -0
  308. package/dist/rich-text-editor-DzP0Epmb.js +2356 -0
  309. package/dist/rich-text-editor-lyYE2ZG5.cjs +1207 -0
  310. package/dist/rich-text-editor-skplNlBM.cjs +2345 -0
  311. package/dist/select-Bkbr0f-Z.cjs +162 -0
  312. package/dist/select-CvIVdX2n.js +145 -0
  313. package/dist/{sidebar-CmvwjnVb.js → sidebar-BViy8Eeu.js} +17 -9
  314. package/dist/{sidebar-CVUGHOS_.cjs → sidebar-BxGXsDAd.cjs} +16 -8
  315. package/dist/sidebar-CK_0ZQHj.cjs +803 -0
  316. package/dist/sidebar-CUuOvYhK.js +787 -0
  317. package/dist/slider-Bc5Hd0y1.js +56 -0
  318. package/dist/slider-N7hFFj6X.cjs +73 -0
  319. package/dist/tooltip-Ded96neP.cjs +137 -0
  320. package/dist/tooltip-HDOoD2-0.js +120 -0
  321. package/dist/ui.cjs.js +48 -34
  322. package/dist/ui.es.js +237 -223
  323. package/dist/{use-audio-player-Dn1NR9xN.cjs → use-audio-player-NKsWyjWu.cjs} +7 -3
  324. package/dist/{use-audio-player-Bkh23vQ3.js → use-audio-player-nv8ZSGa1.js} +7 -3
  325. package/dist/use-file-upload-BcjEo2S5.js +404 -0
  326. package/dist/use-file-upload-CRJR68Tj.cjs +403 -0
  327. package/dist/use-mobile-B0hNy_Y6.cjs +4303 -0
  328. package/dist/{AssistantChart-CVko2A1W.js → use-mobile-BXuYROXM.js} +1025 -171
  329. package/dist/use-mobile-Bbd51ASU.cjs +4392 -0
  330. package/dist/use-mobile-Bk6CX-TC.js +4359 -0
  331. package/dist/use-mobile-BvYdisLP.js +4202 -0
  332. package/dist/use-mobile-BzuxjzNX.cjs +4392 -0
  333. package/dist/{AssistantChart-BAx9VQvb.cjs → use-mobile-CG2-SdXV.cjs} +1070 -209
  334. package/dist/use-mobile-CKb5pqTs.js +4269 -0
  335. package/dist/use-mobile-CYuAuGDl.js +4202 -0
  336. package/dist/use-mobile-CaENcqm-.js +4508 -0
  337. package/dist/use-mobile-CbrYgJGJ.js +4203 -0
  338. package/dist/use-mobile-DMOvImGQ.cjs +4542 -0
  339. package/dist/use-mobile-DRB3BQgD.cjs +4235 -0
  340. package/dist/use-mobile-DZvv7QMR.js +4359 -0
  341. package/dist/use-mobile-DdI_TXam.cjs +4235 -0
  342. package/dist/use-mobile-DlceKf8a.js +4359 -0
  343. package/dist/use-mobile-DsOnow1o.cjs +4236 -0
  344. package/dist/use-mobile-Kcj6jSnK.cjs +4392 -0
  345. package/dist/use-mobile-bnKcua_i.js +4202 -0
  346. package/dist/use-mobile-ncXBeE2z.cjs +4235 -0
  347. package/dist/use-rich-text-editor-DjiddBGv.js +282 -0
  348. package/dist/use-rich-text-editor-lpeswbCs.cjs +281 -0
  349. package/dist/{xertica-assistant-BMqdyRVi.js → xertica-assistant-BdiZag0h.js} +232 -127
  350. package/dist/{xertica-assistant-Bj3vBCq_.cjs → xertica-assistant-DUBpmEgo.cjs} +231 -126
  351. package/dist/{xertica-assistant-B1IaHXnB.cjs → xertica-assistant-dyP7KHM5.cjs} +533 -392
  352. package/dist/{xertica-assistant-DPsESB6t.js → xertica-assistant-yX1CFBBo.js} +535 -394
  353. package/dist/xertica-ui.css +2 -2
  354. package/docs/components/calendar.md +154 -154
  355. package/docs/components/card-patterns.md +337 -337
  356. package/docs/components/card.md +235 -235
  357. package/docs/components/chart.md +11 -0
  358. package/docs/components/file-upload.md +15 -9
  359. package/docs/components/hooks.md +479 -0
  360. package/docs/components/map.md +84 -84
  361. package/docs/components/pagination.md +16 -5
  362. package/docs/components/rich-text-editor.md +2 -1
  363. package/docs/components/sidebar.md +43 -11
  364. package/docs/components/stepper.md +1 -0
  365. package/docs/components/tree-view.md +3 -2
  366. package/docs/components/xertica-provider.md +24 -24
  367. package/docs/decision-tree.md +287 -287
  368. package/guidelines/Guidelines.md +252 -252
  369. package/hooks/useTheme.ts +3 -3
  370. package/imports/Podcast.tsx +388 -388
  371. package/imports/XerticaAi.tsx +45 -45
  372. package/imports/XerticaX.tsx +19 -19
  373. package/imports/svg-aueiaqngck.ts +11 -11
  374. package/imports/svg-v9krss1ozd.ts +16 -16
  375. package/imports/svg-vhrdofe3qe.ts +5 -5
  376. package/llms-compact.txt +376 -327
  377. package/llms-full.txt +8 -3
  378. package/llms.txt +160 -160
  379. package/package.json +203 -203
  380. package/styles/xertica/app-overrides/chat.css +61 -61
  381. package/styles/xertica/app-overrides/scrollbar.css +33 -33
  382. package/styles/xertica/integrations/google-maps.css +76 -76
  383. package/styles/xertica/integrations/sonner.css +73 -73
  384. package/templates/CLAUDE.md +231 -182
  385. package/templates/README.md +152 -0
  386. package/templates/guidelines/Guidelines.md +560 -325
  387. package/templates/package.json +5 -2
  388. package/templates/src/app/App.tsx +6 -1
  389. package/templates/src/app/components/AppLayout.tsx +7 -5
  390. package/templates/src/app/components/AuthGuard.tsx +53 -30
  391. package/templates/src/features/auth/index.ts +4 -4
  392. package/templates/src/features/auth/ui/AuthPageShell.tsx +34 -34
  393. package/templates/src/features/auth/ui/ForgotPasswordContent.tsx +68 -70
  394. package/templates/src/features/auth/ui/LoginContent.tsx +91 -90
  395. package/templates/src/features/auth/ui/ResetPasswordContent.tsx +152 -151
  396. package/templates/src/features/auth/ui/SocialLoginButtons.tsx +59 -59
  397. package/templates/src/features/auth/ui/VerifyEmailContent.tsx +80 -82
  398. package/templates/src/features/home/index.ts +1 -1
  399. package/templates/src/features/home/ui/HomeContent.tsx +114 -100
  400. package/templates/src/features/settings/index.ts +1 -0
  401. package/templates/src/features/settings/ui/SettingsContent.tsx +214 -0
  402. package/templates/src/features/template/index.ts +5 -5
  403. package/templates/src/features/template/ui/CrudTemplate.tsx +268 -106
  404. package/templates/src/features/template/ui/DashboardTemplate.tsx +189 -101
  405. package/templates/src/features/template/ui/FormTemplate.tsx +227 -120
  406. package/templates/src/features/template/ui/LoginTemplate.tsx +4 -6
  407. package/templates/src/pages/AssistantPage.tsx +333 -328
  408. package/templates/src/pages/ForgotPasswordPage.tsx +6 -6
  409. package/templates/src/pages/HomePage.tsx +47 -57
  410. package/templates/src/pages/LoginPage.tsx +10 -10
  411. package/templates/src/pages/NotFoundPage.tsx +29 -0
  412. package/templates/src/pages/ResetPasswordPage.tsx +6 -6
  413. package/templates/src/pages/SettingsPage.tsx +21 -0
  414. package/templates/src/pages/TemplatePage.tsx +30 -30
  415. package/templates/src/pages/VerifyEmailPage.tsx +6 -6
  416. package/templates/src/shared/config/assistant.ts +20 -0
  417. package/templates/src/shared/config/navigation.ts +21 -20
  418. package/templates/src/shared/lib/api.ts +79 -0
  419. package/templates/src/shared/lib/auth.ts +31 -20
  420. package/templates/src/shared/types/auth.ts +9 -3
  421. package/templates/src/shared/ui/PageContent.tsx +35 -0
  422. package/templates/src/styles/index.css +2 -2
  423. package/templates/src/vite-env.d.ts +12 -0
  424. package/templates/tsconfig.json +5 -5
  425. package/utils/gemini.ts +140 -140
  426. package/dist/VerifyEmailPage-BE-L9mB7.js +0 -2828
  427. package/dist/VerifyEmailPage-CR7kb5df.cjs +0 -2827
  428. package/dist/index-CkTUgOwX.js +0 -8
  429. package/dist/{rich-text-editor-BmsjY03B.js → rich-text-editor-DgF8s7xW.js} +26 -26
  430. package/dist/{rich-text-editor-GS2kpTAK.cjs → rich-text-editor-mWoaSCE4.cjs} +26 -26
package/CHANGELOG.md CHANGED
@@ -7,6 +7,48 @@ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
8
  ---
9
9
 
10
+ ## [2.1.5] — 2026-05-19
11
+
12
+ ### Fixed
13
+
14
+ - **`use-rich-text-editor` — `wordCount`/`characterCount` não reativos** — os contadores eram lidos via `editorRef.current` no corpo do render (sem estado reativo), ficando stale após cada keystroke. Convertidos para `useState` e atualizados dentro de `handleInput`. Um segundo `useEffect([value])` foi adicionado para atualizar os contadores quando o valor externo é sincronizado ao editor.
15
+ - **`use-assistant-messages` — `setTimeout` da resposta AI nunca cancelado** — o timer da resposta simulada (1–2 s) não era cancelado ao desmontar o componente, causando chamadas de `setMensagens` em componente desmontado. Adicionado `responseTimerRef` + `useEffect` cleanup com `clearTimeout`.
16
+ - **`use-assistant-messages` — `initialMessages` resetava a conversa a cada re-render** — o `useEffect` que sincronizava `initialMessages` disparava toda vez que a referência do array mudava, sobrescrevendo mensagens digitadas pelo usuário. Corrigido com `hydratedRef` (hydration one-shot).
17
+ - **`use-assistant-messages` — auto-scroll forçado ignorava scroll do usuário** — `scrollIntoView` era chamado incondicionalmente em todo novo `mensagens`. Agora só rola se o usuário já está a menos de 120 px do final do container.
18
+ - **`use-assistant-conversations` — `conversas` não sincronizado quando `savedConversations` muda** — o estado era inicializado uma vez no mount; atualizações externas da prop eram ignoradas. Adicionado `useEffect([savedConversations])` para re-sincronizar.
19
+ - **`use-assistant-conversations` — `setTimeout` do comando não limpo no unmount** — `commandTimerRef` + cleanup `useEffect` adicionados para cancelar o timer ao desmontar.
20
+ - **`use-audio-player` — `eslint-disable` mascarando deps stale no modo-switch effect** — o efeito de restauração de estado ao trocar `isFloating`/`variant` lia `currentTime` e `isPlaying` de uma closure stale. Corrigido com `currentTimeRef` e `isPlayingRef` (padrão "latest ref"), eliminando o `eslint-disable`.
21
+ - **`use-rich-text-editor` — `eslint-disable` no `useEffect` de seleção** — o listener de `selectionchange` chamava `updateActiveFormats` via closure stale. Separado em dois effects: init (mount-only) e listener (via `updateActiveFormatsRef` para evitar re-registro a cada render).
22
+ - **`use-assistant-conversations` — `conversasFiltradas` não memoizado** — recalculado em todo re-render do componente pai. Substituído por `useMemo([conversas, abaSelecionada])`.
23
+ - **`use-assistant-messages` — `handleEnviarMensagem` tipado como `string | any`** — tipo colapsado para `any`. Corrigido para `(arg?: string) => Promise<void>`.
24
+ - **`FileUpload` / `useFileUpload` — drop-zone inacessível por teclado** — adicionados `role="button"`, `tabIndex`, `onKeyDown` (Enter/Space abre o file picker) e `focus-visible:ring` à drop-zone.
25
+ - **`useFileUpload` — `accept` não validado em drag-and-drop** — o browser só aplica `accept` nativamente no picker; arquivos de tipo diferente podiam ser soltos livremente. Adicionado helper `matchesAccept` que filtra por MIME type e extensão antes da validação de tamanho/contagem.
26
+ - **`FileUpload` — tamanho de arquivo sempre em KB** — arquivos grandes exibiam `102400.00 KB`. Corrigido para exibição adaptativa KB/MB.
27
+ - **`useStepper` — `initialStep` não clampado no mount** — valores fora de `[1, totalSteps]` vazavam diretamente para o estado. Corrigido com lazy initializer `Math.min(Math.max(1, initialStep), totalSteps)`.
28
+ - **`use-pagination` — páginas duplicadas quando `siblingCount` grande** — o algoritmo de construção do `items` array podia inserir a mesma página duas vezes quando o sibling range coincidia com os push explícitos de `page 2` / `page totalPages-1`. Reescrito com `Set` deduplicado; ellipsis inferido do gap entre páginas consecutivas.
29
+ - **`use-tree-view` — Space key disparava `handleSelect` em nós pai** — segundo a spec WAI-ARIA tree, Space em branch deve apenas expandir/colapsar; Select fica reservado para Enter e nós folha. Corrigido no `handleKeyDown`.
30
+ - **`chart-metric.tsx` — `stateClassName` passado duas vezes para `getChartState`** — em todas as 3 instâncias de `RadarMetricChart`, `PieMetricChart` e `RadialBarMetricChart`, `stateClassName` aparecia dentro do props object e novamente como 3º argumento separado. 3º argumento removido.
31
+ - **`use-assistant-conversations` — magic string `'5'` como command ID hardcoded** — comentário de TODO mantido; o timer cleanup foi aplicado independentemente.
32
+
33
+ ### Added
34
+
35
+ - **`useFileUpload` — `clearFiles()`** — nova função na API pública do hook que remove todos os arquivos aceitos e limpa o `errorMessage` em uma única chamada.
36
+ - **`useFileUpload` — prop `accept`** — o hook agora aceita e aplica o filtro `accept` tanto no drag-and-drop quanto no click-to-browse (anteriormente, `accept` era apenas passado ao `<input>` sem enforçar em drops).
37
+
38
+ ### Changed
39
+
40
+ - **`Stepper` — ARIA** — adicionados `role="list"` + `aria-label="Progresso: etapa X de Y"` no `<Stepper>` e `role="listitem"` + `aria-current="step"` + `aria-label` descritivo em cada `<Step>`, tornando o componente acessível a screen readers.
41
+ - **`PaginationLink` — `disabled` prop + `href` fallback** — `PaginationLink` agora aceita `disabled` (aplica `aria-disabled`, `tabIndex=-1` e `pointer-events-none`) e faz fallback para `href="#"` quando `href` não é passado, garantindo que o link permaneça focusável via Tab em SPAs. `PaginationPrevious` e `PaginationNext` receberam o `disabled` pass-through.
42
+ - **`TreeView` — ARIA e roving tabindex** — adicionado `aria-label` (padrão `"Navegação em árvore"`) no `role="tree"` (WCAG 4.1.2); implementado roving tabindex correto: `focusableId = selectedId ?? firstRootId` garante que sempre haja um nó focusável por Tab mesmo sem seleção ativa.
43
+ - **`RichTextEditor` — ARIA no `contentEditable`** — adicionados `role="textbox"`, `aria-multiline="true"`, `aria-label`, `aria-readonly` e `aria-disabled` ao div editável.
44
+ - **`RichTextEditor` — removido "Auto-save ativo"** — texto no rodapé que indicava auto-save não implementado. Removido para não enganar o usuário.
45
+ - **`RichTextEditor` — sync de `value` externo** — adicionado `useEffect([value])` que sincroniza o HTML do editor quando o valor muda externamente e o editor não está em foco (ex.: carregar dados da API após o mount).
46
+ - **`Sidebar` — `<nav>` landmark + `aria-expanded` + `useMemo`** — o root `<div>` foi substituído por `<nav aria-label="Navegação principal" id="sidebar-nav">`; o botão de toggle recebeu `aria-expanded` e `aria-controls`; `navigationItems` foi envolvido em `useMemo([routes, pathname])` e a dependency do effect de overflow foi atualizada de `navigationItems.length` para `navigationItems`.
47
+ - **`DashboardBarChart` — `topOfStack` com `useMemo`** — computação que determinava qual bar recebe radius no topo do stack foi extraída da IIFE inline para `React.useMemo([stacked, chartSeries])`, evitando recalcular a cada render.
48
+ - **Documentação** — corrigidas e atualizadas as docs de `file-upload.md`, `stepper.md`, `pagination.md`, `tree-view.md`, `rich-text-editor.md`, `sidebar.md`, `chart.md` e `hooks.md` para refletir todas as mudanças desta versão.
49
+
50
+ ---
51
+
10
52
  ## [2.1.4] — 2026-05-19
11
53
 
12
54
  ### Changed
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **Enterprise-grade React design system** built on Tailwind CSS v4, Radix UI, and Lucide Icons — with a robust AI-first documentation layer for precise LLM-driven composition and autonomous agent interaction.
4
4
 
5
- [![npm version](https://img.shields.io/badge/npm-2.1.4-blue)](https://www.npmjs.com/package/xertica-ui)
5
+ [![npm version](https://img.shields.io/badge/npm-2.1.5-blue)](https://www.npmjs.com/package/xertica-ui)
6
6
  [![license](https://img.shields.io/badge/license-proprietary-red)](./LICENSE)
7
7
 
8
8
  ---
@@ -1,38 +1,38 @@
1
- <svg
2
- fill="none"
3
- preserveAspectRatio="xMidYMid meet"
4
- viewBox="0 0 1543 289"
5
- xmlns="http://www.w3.org/2000/svg"
6
- >
7
- <g id="Xertica.ai">
8
- <path d="M1352.82 239.808V285.425H1304.73V239.808H1352.82Z" fill="#00BEFF" />
9
- <path d="M814.8 284.848H766.711V77.4971H814.8V284.848Z" fill="#00BEFF" />
10
- <path d="M1543 284.438H1514.2V160.28H1543V284.438Z" fill="#00BEFF" />
11
- <path
12
- clip-rule="evenodd"
13
- d="M1432.83 157.796C1446.98 157.796 1459.14 162.515 1468.58 170.709V160.28H1497.38V284.438H1468.58V274.01C1459.14 282.451 1446.98 286.921 1432.83 286.921C1395.1 286.921 1368.29 260.352 1368.29 222.359C1368.29 184.616 1395.1 157.796 1432.83 157.796ZM1432.83 183.778C1410.79 183.778 1396.27 199.061 1396.27 222.359C1396.27 245.658 1410.79 260.94 1432.83 260.94C1454.63 260.94 1468.9 245.658 1468.9 222.359C1468.9 199.06 1454.63 183.778 1432.83 183.778Z"
14
- fill="#00BEFF"
15
- fill-rule="evenodd"
16
- />
17
- <path d="M947.87 73.3516C1002.88 73.3516 1044.42 107.647 1053.57 159.234H1004.68C997.221 132.988 976.34 117.308 947.87 117.308C911.387 117.308 887.337 142.612 887.337 181.176C887.337 219.739 911.387 245.036 947.87 245.036C976.34 245.036 997.221 229.356 1004.68 203.109H1053.57C1044.47 254.701 1003.26 289 947.87 289C884.853 289 840.078 244.626 840.078 181.176C840.078 118.142 884.854 73.3516 947.87 73.3516Z" fill="#00BEFF" />
18
- <path d="M88.4971 39.8242L157.353 142.191L83.5371 251.524L60.9277 284.854H0L96.3154 142.191L5.37695 7H66.3047L88.4971 39.8242Z" fill="#00BEFF" />
19
- <path d="M254.314 284.855H193.387L151.914 223.71L182.548 178.551L254.314 284.855Z" fill="#00BEFF" />
20
- <path
21
- clip-rule="evenodd"
22
- d="M1179.14 73.3477C1202.77 73.3477 1223.08 81.2286 1238.84 94.9121V77.4971H1286.94V284.847H1238.84V267.431C1223.09 281.528 1202.77 288.992 1179.14 288.992C1116.12 288.992 1071.35 244.622 1071.35 181.172C1071.35 118.139 1116.12 73.3478 1179.14 73.3477ZM1179.14 117.308C1142.66 117.308 1118.61 142.604 1118.61 181.172C1118.61 219.739 1142.66 245.035 1179.14 245.035C1215.21 245.035 1238.84 219.739 1238.84 181.172C1238.84 142.605 1215.21 117.308 1179.14 117.308Z"
23
- fill="#00BEFF"
24
- fill-rule="evenodd"
25
- />
26
- <path d="M1543 145.383H1514.2V118.067H1543V145.383Z" fill="#00BEFF" />
27
- <path d="M672.466 77.501H736.31V121.457H672.466V211.448C672.466 230.939 682.415 240.891 702.313 240.891H736.309V284.852H698.999C649.246 284.851 625.203 259.968 625.203 211.449V7H672.466V77.501Z" fill="#00BEFF" />
28
- <path d="M814.8 52.6172H766.711V7H814.8V52.6172Z" fill="#00BEFF" />
29
- <path
30
- clip-rule="evenodd"
31
- d="M354.069 73.3516C417.086 73.3517 461.864 118.143 461.864 181.176C461.864 187.396 461.031 193.615 460.204 199.422H295.197C301.829 228.864 323.392 246.696 354.069 246.696C372.724 246.696 389.309 241.721 399.675 226.376H452.742C441.132 265.774 400.501 288.996 354.069 288.996C291.053 288.996 246.274 244.626 246.273 181.176C246.273 118.142 291.053 73.3516 354.069 73.3516ZM354.068 115.65C325.044 115.65 303.902 131.826 296.44 158.78H410.863C403.819 131.826 382.672 115.65 354.068 115.65Z"
32
- fill="#00BEFF"
33
- fill-rule="evenodd"
34
- />
35
- <path d="M596.957 121.453H562.962C543.064 121.453 533.114 131.409 533.114 150.899V284.847H485.852V150.899C485.852 102.38 509.894 77.4972 559.647 77.4971H596.957V121.453Z" fill="#00BEFF" />
36
- <path d="M182.552 98.6992L151.922 53.3906L188.014 0H248.941L182.552 98.6992Z" fill="#00BEFF" />
37
- </g>
1
+ <svg
2
+ fill="none"
3
+ preserveAspectRatio="xMidYMid meet"
4
+ viewBox="0 0 1543 289"
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ >
7
+ <g id="Xertica.ai">
8
+ <path d="M1352.82 239.808V285.425H1304.73V239.808H1352.82Z" fill="#00BEFF" />
9
+ <path d="M814.8 284.848H766.711V77.4971H814.8V284.848Z" fill="#00BEFF" />
10
+ <path d="M1543 284.438H1514.2V160.28H1543V284.438Z" fill="#00BEFF" />
11
+ <path
12
+ clip-rule="evenodd"
13
+ d="M1432.83 157.796C1446.98 157.796 1459.14 162.515 1468.58 170.709V160.28H1497.38V284.438H1468.58V274.01C1459.14 282.451 1446.98 286.921 1432.83 286.921C1395.1 286.921 1368.29 260.352 1368.29 222.359C1368.29 184.616 1395.1 157.796 1432.83 157.796ZM1432.83 183.778C1410.79 183.778 1396.27 199.061 1396.27 222.359C1396.27 245.658 1410.79 260.94 1432.83 260.94C1454.63 260.94 1468.9 245.658 1468.9 222.359C1468.9 199.06 1454.63 183.778 1432.83 183.778Z"
14
+ fill="#00BEFF"
15
+ fill-rule="evenodd"
16
+ />
17
+ <path d="M947.87 73.3516C1002.88 73.3516 1044.42 107.647 1053.57 159.234H1004.68C997.221 132.988 976.34 117.308 947.87 117.308C911.387 117.308 887.337 142.612 887.337 181.176C887.337 219.739 911.387 245.036 947.87 245.036C976.34 245.036 997.221 229.356 1004.68 203.109H1053.57C1044.47 254.701 1003.26 289 947.87 289C884.853 289 840.078 244.626 840.078 181.176C840.078 118.142 884.854 73.3516 947.87 73.3516Z" fill="#00BEFF" />
18
+ <path d="M88.4971 39.8242L157.353 142.191L83.5371 251.524L60.9277 284.854H0L96.3154 142.191L5.37695 7H66.3047L88.4971 39.8242Z" fill="#00BEFF" />
19
+ <path d="M254.314 284.855H193.387L151.914 223.71L182.548 178.551L254.314 284.855Z" fill="#00BEFF" />
20
+ <path
21
+ clip-rule="evenodd"
22
+ d="M1179.14 73.3477C1202.77 73.3477 1223.08 81.2286 1238.84 94.9121V77.4971H1286.94V284.847H1238.84V267.431C1223.09 281.528 1202.77 288.992 1179.14 288.992C1116.12 288.992 1071.35 244.622 1071.35 181.172C1071.35 118.139 1116.12 73.3478 1179.14 73.3477ZM1179.14 117.308C1142.66 117.308 1118.61 142.604 1118.61 181.172C1118.61 219.739 1142.66 245.035 1179.14 245.035C1215.21 245.035 1238.84 219.739 1238.84 181.172C1238.84 142.605 1215.21 117.308 1179.14 117.308Z"
23
+ fill="#00BEFF"
24
+ fill-rule="evenodd"
25
+ />
26
+ <path d="M1543 145.383H1514.2V118.067H1543V145.383Z" fill="#00BEFF" />
27
+ <path d="M672.466 77.501H736.31V121.457H672.466V211.448C672.466 230.939 682.415 240.891 702.313 240.891H736.309V284.852H698.999C649.246 284.851 625.203 259.968 625.203 211.449V7H672.466V77.501Z" fill="#00BEFF" />
28
+ <path d="M814.8 52.6172H766.711V7H814.8V52.6172Z" fill="#00BEFF" />
29
+ <path
30
+ clip-rule="evenodd"
31
+ d="M354.069 73.3516C417.086 73.3517 461.864 118.143 461.864 181.176C461.864 187.396 461.031 193.615 460.204 199.422H295.197C301.829 228.864 323.392 246.696 354.069 246.696C372.724 246.696 389.309 241.721 399.675 226.376H452.742C441.132 265.774 400.501 288.996 354.069 288.996C291.053 288.996 246.274 244.626 246.273 181.176C246.273 118.142 291.053 73.3516 354.069 73.3516ZM354.068 115.65C325.044 115.65 303.902 131.826 296.44 158.78H410.863C403.819 131.826 382.672 115.65 354.068 115.65Z"
32
+ fill="#00BEFF"
33
+ fill-rule="evenodd"
34
+ />
35
+ <path d="M596.957 121.453H562.962C543.064 121.453 533.114 131.409 533.114 150.899V284.847H485.852V150.899C485.852 102.38 509.894 77.4972 559.647 77.4971H596.957V121.453Z" fill="#00BEFF" />
36
+ <path d="M182.552 98.6992L151.922 53.3906L188.014 0H248.941L182.552 98.6992Z" fill="#00BEFF" />
37
+ </g>
38
38
  </svg>
@@ -1,21 +1,21 @@
1
- <svg
2
- fill="none"
3
- preserveAspectRatio="xMidYMid meet"
4
- viewBox="0 0 258 282"
5
- xmlns="http://www.w3.org/2000/svg"
6
- >
7
- <g id="Xertica X">
8
- <path
9
- d="M67.2666 0.0361328L89.7793 33.3447L159.63 137.228L84.7471 248.178L61.8115 282H0L97.7109 137.228L5.45508 0.0361328H67.2666Z"
10
- fill="#00BEFF"
11
- />
12
- <path
13
- d="M258 282H196.185L154.114 219.951L185.192 174.123L258 282Z"
14
- fill="#00BEFF"
15
- />
16
- <path
17
- d="M252.696 0.186523L185.042 100.142L154.106 54.0693L190.884 0L252.696 0.186523Z"
18
- fill="#00BEFF"
19
- />
20
- </g>
1
+ <svg
2
+ fill="none"
3
+ preserveAspectRatio="xMidYMid meet"
4
+ viewBox="0 0 258 282"
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ >
7
+ <g id="Xertica X">
8
+ <path
9
+ d="M67.2666 0.0361328L89.7793 33.3447L159.63 137.228L84.7471 248.178L61.8115 282H0L97.7109 137.228L5.45508 0.0361328H67.2666Z"
10
+ fill="#00BEFF"
11
+ />
12
+ <path
13
+ d="M258 282H196.185L154.114 219.951L185.192 174.123L258 282Z"
14
+ fill="#00BEFF"
15
+ />
16
+ <path
17
+ d="M252.696 0.186523L185.042 100.142L154.106 54.0693L190.884 0L252.696 0.186523Z"
18
+ fill="#00BEFF"
19
+ />
20
+ </g>
21
21
  </svg>
package/bin/cli.ts CHANGED
@@ -18,7 +18,7 @@ const program = new Command();
18
18
  program
19
19
  .name('xertica-ui')
20
20
  .description('CLI to initialize Xertica UI projects')
21
- .version('2.1.3');
21
+ .version('2.1.5');
22
22
 
23
23
  program
24
24
  .command('init')
@@ -1,6 +1,6 @@
1
- export * from './xertica-assistant';
2
- export { CodeBlock } from './code-block';
3
- export { MarkdownMessage } from './markdown-message';
4
- export { ModernChatInput } from './modern-chat-input';
5
- export { FormattedDocument } from './formatted-document';
6
- export { generateDemoResponse } from '../../utils/demo-responses';
1
+ export * from './xertica-assistant';
2
+ export { CodeBlock } from './code-block';
3
+ export { MarkdownMessage } from './markdown-message';
4
+ export { ModernChatInput } from './modern-chat-input';
5
+ export { FormattedDocument } from './formatted-document';
6
+ export { generateDemoResponse } from '../../utils/demo-responses';
@@ -0,0 +1,8 @@
1
+ export { useAssistantMessages } from './use-assistant-messages';
2
+ export type { UseAssistantMessagesProps, UseAssistantMessagesReturn, EvaluationState } from './use-assistant-messages';
3
+
4
+ export { useAssistantConversations } from './use-assistant-conversations';
5
+ export type { UseAssistantConversationsProps, UseAssistantConversationsReturn } from './use-assistant-conversations';
6
+
7
+ export { useAssistantSuggestions, DEFAULT_SUGGESTIONS } from './use-assistant-suggestions';
8
+ export type { UseAssistantSuggestionsProps, UseAssistantSuggestionsReturn } from './use-assistant-suggestions';
@@ -0,0 +1,119 @@
1
+ import { useState, useCallback, useEffect, useMemo, useRef } from 'react';
2
+ import type { Message, Conversation, SearchResult, AssistantTab } from '../types';
3
+
4
+ // ─────────────────────────────────────────────────────────────────────────────
5
+ // Props & Return types
6
+ // ─────────────────────────────────────────────────────────────────────────────
7
+
8
+ export interface UseAssistantConversationsProps {
9
+ savedConversations?: Conversation[];
10
+ /** Current tab — used to compute conversasFiltradas */
11
+ abaSelecionada: AssistantTab;
12
+ setAbaSelecionada: (tab: AssistantTab) => void;
13
+ setMensagens: React.Dispatch<React.SetStateAction<Message[]>>;
14
+ }
15
+
16
+ export interface UseAssistantConversationsReturn {
17
+ conversas: Conversation[];
18
+ conversaAtual: string | null;
19
+ conversasFiltradas: Conversation[];
20
+ savedSearches: string[];
21
+ executingCommand: string | null;
22
+ handleNovaConversa: () => void;
23
+ handleSelecionarConversa: (conversaId: string) => void;
24
+ handleToggleFavoritaConversa: (conversaId: string) => void;
25
+ handleOpenSearchResult: (result: SearchResult) => void;
26
+ handleExecuteSearchCommand: (
27
+ commandId: string,
28
+ searchTerm: string,
29
+ results: SearchResult[],
30
+ messageId: string,
31
+ ) => Promise<void>;
32
+ }
33
+
34
+ // ─────────────────────────────────────────────────────────────────────────────
35
+ // Hook
36
+ // ─────────────────────────────────────────────────────────────────────────────
37
+
38
+ export function useAssistantConversations({
39
+ savedConversations = [],
40
+ abaSelecionada,
41
+ setAbaSelecionada,
42
+ setMensagens,
43
+ }: UseAssistantConversationsProps): UseAssistantConversationsReturn {
44
+
45
+ const [conversas, setConversas] = useState<Conversation[]>(savedConversations);
46
+ const [conversaAtual, setConversaAtual] = useState<string | null>(null);
47
+ const [savedSearches, setSavedSearches] = useState<string[]>([]);
48
+ const [executingCommand, setExecutingCommand] = useState<string | null>(null);
49
+
50
+ // UC-2: re-sync when the parent updates savedConversations (e.g. after API fetch)
51
+ useEffect(() => {
52
+ setConversas(savedConversations);
53
+ }, [savedConversations]);
54
+
55
+ // UC-4: memoize so it isn't recomputed on every parent re-render
56
+ const conversasFiltradas = useMemo(
57
+ () => conversas.filter(conversa => abaSelecionada === 'favoritos' ? conversa.isFavorite : true),
58
+ [conversas, abaSelecionada]
59
+ );
60
+
61
+ // UC-5: ref to cancel the command timer if the component unmounts
62
+ const commandTimerRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);
63
+ useEffect(() => () => clearTimeout(commandTimerRef.current), []);
64
+
65
+ const handleNovaConversa = useCallback(() => {
66
+ setMensagens([]);
67
+ setConversaAtual(null);
68
+ setAbaSelecionada('chat');
69
+ }, [setMensagens, setAbaSelecionada]);
70
+
71
+ const handleSelecionarConversa = useCallback((conversaId: string) => {
72
+ const conversa = conversas.find(c => c.id === conversaId);
73
+ if (conversa) {
74
+ setMensagens(conversa.messages);
75
+ setConversaAtual(conversaId);
76
+ setAbaSelecionada('chat');
77
+ }
78
+ }, [conversas, setMensagens, setAbaSelecionada]);
79
+
80
+ const handleToggleFavoritaConversa = useCallback((conversaId: string) => {
81
+ setConversas(prev =>
82
+ prev.map(conv =>
83
+ conv.id === conversaId ? { ...conv, isFavorite: !conv.isFavorite } : conv
84
+ )
85
+ );
86
+ }, []);
87
+
88
+ const handleOpenSearchResult = useCallback((_result: SearchResult) => {
89
+ // TODO: implement navigation to search result when conversation routing is available
90
+ }, []);
91
+
92
+ const handleExecuteSearchCommand = useCallback(async (
93
+ commandId: string,
94
+ searchTerm: string,
95
+ results: SearchResult[],
96
+ messageId: string,
97
+ ) => {
98
+ setExecutingCommand(commandId);
99
+ commandTimerRef.current = setTimeout(() => {
100
+ if (commandId === '5') {
101
+ setSavedSearches(prev => [...prev, messageId]);
102
+ }
103
+ setExecutingCommand(null);
104
+ }, 1500);
105
+ }, []);
106
+
107
+ return {
108
+ conversas,
109
+ conversaAtual,
110
+ conversasFiltradas,
111
+ savedSearches,
112
+ executingCommand,
113
+ handleNovaConversa,
114
+ handleSelecionarConversa,
115
+ handleToggleFavoritaConversa,
116
+ handleOpenSearchResult,
117
+ handleExecuteSearchCommand,
118
+ };
119
+ }