xertica-ui 2.1.4 → 2.1.6
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.
- package/CHANGELOG.md +56 -0
- package/README.md +1 -1
- package/assets/xertica-logo.svg +37 -37
- package/assets/xertica-x-logo.svg +20 -20
- package/bin/cli.ts +1 -1
- package/components/assistant/index.ts +6 -6
- package/components/assistant/xertica-assistant/hooks/index.ts +8 -0
- package/components/assistant/xertica-assistant/hooks/use-assistant-conversations.ts +119 -0
- package/components/assistant/xertica-assistant/hooks/use-assistant-messages.ts +323 -0
- package/components/assistant/xertica-assistant/hooks/use-assistant-suggestions.ts +64 -0
- package/components/assistant/xertica-assistant/use-assistant.ts +294 -559
- package/components/assistant/xertica-assistant/xertica-assistant.tsx +5 -13
- package/components/blocks/card-patterns/ActivityCard.tsx +72 -72
- package/components/blocks/card-patterns/FeatureCard.tsx +100 -100
- package/components/blocks/card-patterns/NotificationCard.tsx +127 -127
- package/components/blocks/card-patterns/ProfileCard.tsx +84 -84
- package/components/blocks/card-patterns/ProjectCard.tsx +89 -89
- package/components/blocks/card-patterns/QuickActionCard.tsx +62 -62
- package/components/blocks/card-patterns/card-patterns.stories.tsx +445 -445
- package/components/blocks/card-patterns/card-patterns.test.tsx +448 -0
- package/components/blocks/card-patterns/index.ts +17 -17
- package/components/blocks/index.ts +1 -1
- package/components/brand/index.ts +6 -6
- package/components/brand/xertica-provider/XerticaProvider.tsx +48 -48
- package/components/brand/xertica-provider/xertica-provider.mdx +61 -61
- package/components/brand/xertica-provider/xertica-provider.test.tsx +52 -52
- package/components/examples/MapExamples.tsx +282 -282
- package/components/examples/SimpleFilterableMap.tsx +191 -191
- package/components/examples/index.ts +51 -51
- package/components/figma/ImageWithFallback.tsx +27 -27
- package/components/hooks/index.ts +12 -0
- package/components/index.ts +5 -5
- package/components/layout/header/header.test.tsx +8 -8
- package/components/layout/header/header.tsx +4 -4
- package/components/layout/index.ts +2 -2
- package/components/layout/sidebar/sidebar.mdx +1 -1
- package/components/layout/sidebar/sidebar.test.tsx +11 -11
- package/components/layout/sidebar/sidebar.tsx +25 -10
- package/components/media/FloatingMediaWrapper.tsx +11 -11
- package/components/media/audio-player/use-audio-player.ts +15 -5
- package/components/media/index.ts +3 -3
- package/components/pages/home-content/HomeContent.tsx +7 -7
- package/components/pages/home-content/home-content.mdx +62 -62
- package/components/pages/home-page/HomePage.stories.tsx +39 -39
- package/components/pages/home-page/home-page.mdx +53 -53
- package/components/pages/index.ts +8 -8
- package/components/pages/template-content/template-content.mdx +61 -61
- package/components/pages/template-page/TemplatePage.stories.tsx +39 -39
- package/components/pages/template-page/template-page.mdx +53 -53
- package/components/public-api-smoke.test.tsx +52 -52
- package/components/shared/assistant-utils.ts +43 -43
- package/components/ui/accordion/accordion.mdx +8 -8
- package/components/ui/accordion/accordion.stories.tsx +53 -53
- package/components/ui/alert/alert.mdx +8 -8
- package/components/ui/alert-dialog/alert-dialog.mdx +8 -8
- package/components/ui/aspect-ratio/aspect-ratio.mdx +8 -8
- package/components/ui/assistant-chart/assistant-chart.mdx +8 -8
- package/components/ui/avatar/avatar.mdx +8 -8
- package/components/ui/badge/badge.mdx +8 -8
- package/components/ui/badge/badge.tsx +9 -9
- package/components/ui/breadcrumb/breadcrumb.mdx +8 -8
- package/components/ui/button/button.mdx +8 -8
- package/components/ui/calendar/calendar.mdx +8 -8
- package/components/ui/calendar/calendar.tsx +258 -258
- package/components/ui/card/card.mdx +8 -8
- package/components/ui/card/card.stories.tsx +245 -245
- package/components/ui/carousel/carousel.mdx +8 -8
- package/components/ui/chart/chart.mdx +8 -8
- package/components/ui/chart/chart.stories.tsx +1303 -1303
- package/components/ui/chart/chart.test.tsx +254 -83
- package/components/ui/chart/chart.tsx +79 -2367
- package/components/ui/chart/parts/chart-dashboard.tsx +1025 -0
- package/components/ui/chart/parts/chart-metric.tsx +622 -0
- package/components/ui/chart/parts/chart-primitives.tsx +432 -0
- package/components/ui/chart/parts/chart-shared.tsx +201 -0
- package/components/ui/chart/parts/chart-utils.ts +145 -0
- package/components/ui/chart/parts/index.ts +5 -0
- package/components/ui/checkbox/checkbox.mdx +8 -8
- package/components/ui/checkbox/checkbox.stories.tsx +20 -20
- package/components/ui/collapsible/collapsible.mdx +8 -8
- package/components/ui/command/command.mdx +8 -8
- package/components/ui/context-menu/context-menu.mdx +8 -8
- package/components/ui/dialog/dialog.mdx +8 -8
- package/components/ui/drawer/drawer.mdx +8 -8
- package/components/ui/dropdown-menu/dropdown-menu.mdx +8 -8
- package/components/ui/empty/empty.mdx +8 -8
- package/components/ui/file-upload/file-upload.mdx +8 -8
- package/components/ui/file-upload/file-upload.test.tsx +6 -2
- package/components/ui/file-upload/file-upload.tsx +17 -5
- package/components/ui/file-upload/use-file-upload.test.ts +173 -0
- package/components/ui/file-upload/use-file-upload.ts +76 -25
- package/components/ui/google-maps-loader/google-maps-loader.tsx +2 -2
- package/components/ui/hover-card/hover-card.mdx +8 -8
- package/components/ui/index.ts +1 -1
- package/components/ui/input/input.mdx +8 -8
- package/components/ui/input-otp/input-otp.mdx +8 -8
- package/components/ui/input-otp/input-otp.stories.tsx +6 -6
- package/components/ui/label/label.mdx +8 -8
- package/components/ui/map/map.mdx +8 -8
- package/components/ui/map/map.stories.tsx +51 -51
- package/components/ui/map/map.tsx +2 -2
- package/components/ui/menubar/menubar.mdx +8 -8
- package/components/ui/navigation-menu/navigation-menu.mdx +8 -8
- package/components/ui/notification-badge/notification-badge.mdx +8 -8
- package/components/ui/pagination/pagination.mdx +8 -8
- package/components/ui/pagination/pagination.tsx +17 -0
- package/components/ui/pagination/use-pagination.test.ts +104 -0
- package/components/ui/pagination/use-pagination.ts +33 -16
- package/components/ui/popover/popover.mdx +8 -8
- package/components/ui/progress/progress.mdx +8 -8
- package/components/ui/progress/progress.tsx +68 -68
- package/components/ui/radio-group/radio-group.mdx +8 -8
- package/components/ui/rating/rating.mdx +8 -8
- package/components/ui/resizable/resizable.mdx +8 -8
- package/components/ui/rich-text-editor/rich-text-editor.tsx +9 -3
- package/components/ui/rich-text-editor/use-rich-text-editor.test.ts +110 -0
- package/components/ui/rich-text-editor/use-rich-text-editor.ts +42 -15
- package/components/ui/route-map/route-map.mdx +8 -8
- package/components/ui/route-map/route-map.stories.tsx +54 -54
- package/components/ui/route-map/route-map.tsx +2 -2
- package/components/ui/scroll-area/scroll-area.mdx +8 -8
- package/components/ui/search/search.mdx +8 -8
- package/components/ui/select/select.mdx +8 -8
- package/components/ui/select/select.stories.tsx +9 -9
- package/components/ui/separator/separator.mdx +8 -8
- package/components/ui/sheet/sheet.mdx +8 -8
- package/components/ui/sheet/sheet.stories.tsx +95 -95
- package/components/ui/simple-map/simple-map.mdx +8 -8
- package/components/ui/simple-map/simple-map.stories.tsx +48 -48
- package/components/ui/skeleton/skeleton.mdx +8 -8
- package/components/ui/slider/slider.mdx +8 -8
- package/components/ui/sonner/sonner.mdx +8 -8
- package/components/ui/stats-card/stats-card.mdx +8 -8
- package/components/ui/stepper/stepper.mdx +8 -8
- package/components/ui/stepper/stepper.tsx +21 -2
- package/components/ui/stepper/use-stepper.test.ts +109 -0
- package/components/ui/stepper/use-stepper.ts +4 -1
- package/components/ui/switch/switch.mdx +8 -8
- package/components/ui/switch/switch.stories.tsx +20 -20
- package/components/ui/table/table.mdx +8 -8
- package/components/ui/tabs/tabs.mdx +8 -8
- package/components/ui/tabs/tabs.stories.tsx +26 -26
- package/components/ui/textarea/textarea.mdx +8 -8
- package/components/ui/timeline/timeline.mdx +8 -8
- package/components/ui/toggle/toggle.mdx +8 -8
- package/components/ui/toggle-group/toggle-group.mdx +8 -8
- package/components/ui/tooltip/tooltip.mdx +8 -8
- package/components/ui/tree-view/tree-view.mdx +8 -8
- package/components/ui/tree-view/tree-view.tsx +29 -4
- package/components/ui/tree-view/use-tree-view.test.ts +91 -0
- package/components/ui/tree-view/use-tree-view.ts +38 -19
- package/components.json +1512 -1512
- package/contexts/ApiKeyContext.tsx +72 -72
- package/contexts/LanguageContext.tsx +13 -13
- package/contexts/LayoutContext.test.tsx +11 -11
- package/contexts/ThemeContext.tsx +26 -26
- package/contexts/theme-data.ts +4 -4
- package/dist/{AssistantChart-CVzmmhx4.js → AssistantChart-C_hwFRRr.js} +4 -4
- package/dist/{AssistantChart-BAudAfne.cjs → AssistantChart-CldVCVDe.cjs} +5 -5
- package/dist/{AssistantChart-BP8upjMk.js → AssistantChart-Cu3m7RBo.js} +5 -5
- package/dist/AssistantChart-DIpshm3i.js +4784 -0
- package/dist/{AssistantChart-9w31gdAb.cjs → AssistantChart-DoZCyS5r.cjs} +4 -4
- package/dist/AssistantChart-zjsy2GaZ.cjs +4810 -0
- package/dist/AudioPlayer-B1lt5cPl.cjs +989 -0
- package/dist/AudioPlayer-BZ7bibzU.cjs +982 -0
- package/dist/AudioPlayer-C12BjQBV.cjs +997 -0
- package/dist/{AudioPlayer-DuKXrCfy.js → AudioPlayer-CGRUtUdN.js} +1 -1
- package/dist/AudioPlayer-DMcG_c7L.js +990 -0
- package/dist/AudioPlayer-DcFKRJE_.js +998 -0
- package/dist/{AudioPlayer-1ypwE2Wh.cjs → AudioPlayer-IAU5q5T1.cjs} +1 -1
- package/dist/AudioPlayer-e8LfNoqO.js +983 -0
- package/dist/{xertica-assistant-Qp3ydksa.cjs → CodeBlock-7TTgmdGG.cjs} +263 -51
- package/dist/{xertica-assistant-gnCJdcZY.js → CodeBlock-BeSt1h5P.js} +219 -7
- package/dist/CodeBlock-BgfYL_rD.cjs +2094 -0
- package/dist/CodeBlock-BlcqlA9M.cjs +2094 -0
- package/dist/CodeBlock-Bnmeu5ez.cjs +2094 -0
- package/dist/CodeBlock-BtfPlbAI.js +2078 -0
- package/dist/CodeBlock-CIySIuYr.js +2078 -0
- package/dist/CodeBlock-CuPtUM-7.cjs +2094 -0
- package/dist/CodeBlock-D6ffWXgc.js +2078 -0
- package/dist/CodeBlock-D8dcwbit.cjs +2094 -0
- package/dist/CodeBlock-DMZrFnlw.cjs +2094 -0
- package/dist/CodeBlock-DlBehYN8.js +2078 -0
- package/dist/CodeBlock-DnYNI8rQ.js +2078 -0
- package/dist/CodeBlock-DvKWbSnE.cjs +2094 -0
- package/dist/CodeBlock-DwMCfkFY.js +2078 -0
- package/dist/CodeBlock-Dy6CNYyj.js +2078 -0
- package/dist/CodeBlock-U1pPOQI7.cjs +2094 -0
- package/dist/CodeBlock-f_GpNhEB.js +2078 -0
- package/dist/CodeBlock-oB6u8nI1.js +2078 -0
- package/dist/CodeBlock-tZC31B73.cjs +2094 -0
- package/dist/FeatureCard-CxC-7C-C.cjs +300 -0
- package/dist/FeatureCard-DbHWCb4E.js +301 -0
- package/dist/ImageWithFallback-CGtidP6B.cjs +4542 -0
- package/dist/ImageWithFallback-lsg3pdFg.js +4508 -0
- package/dist/{LanguageContext-DvUt5jBg.cjs → LanguageContext-B_KFTCzT.cjs} +2 -2
- package/dist/{LanguageContext-BwhwC3G2.js → LanguageContext-CS14yCpi.js} +2 -2
- package/dist/LanguageSelector-B5YfbHra.js +231 -0
- package/dist/LanguageSelector-D6uacAIM.cjs +230 -0
- package/dist/LayoutContext-BAql6ZRY.js +97 -0
- package/dist/LayoutContext-BvK-ggDa.cjs +96 -0
- package/dist/ThemeContext-BoH4NLfN.js +734 -0
- package/dist/{ThemeContext-BbBNoFTG.js → ThemeContext-C2EwAPDt.js} +2 -2
- package/dist/ThemeContext-r69W20Xg.cjs +733 -0
- package/dist/{ThemeContext-Cmr8Ex8H.cjs → ThemeContext-vTjumZeM.cjs} +2 -2
- package/dist/{VerifyEmailPage-C_ihbcth.js → VerifyEmailPage-C0c2e5n0.js} +6 -6
- package/dist/{VerifyEmailPage-DMBh4NM9.cjs → VerifyEmailPage-CYXtbKi3.cjs} +1 -1
- package/dist/{VerifyEmailPage-CbgjOF0v.js → VerifyEmailPage-CqKsR2v8.js} +10 -11
- package/dist/{VerifyEmailPage-Bae2cBXT.cjs → VerifyEmailPage-Cwi3kbol.cjs} +7 -7
- package/dist/{VerifyEmailPage-CdYPSJoO.js → VerifyEmailPage-DvMLZgFt.js} +1 -1
- package/dist/{VerifyEmailPage-Dt7zgA4w.cjs → VerifyEmailPage-s-1X3LDJ.cjs} +142 -143
- package/dist/XerticaOrbe-KL1RBHzw.cjs +1354 -0
- package/dist/XerticaOrbe-zwS1p2a8.js +1355 -0
- package/dist/XerticaProvider-6btlAlzc.js +17 -0
- package/dist/{XerticaProvider-siSt9uG2.js → XerticaProvider-B7EVH-NF.js} +2 -2
- package/dist/XerticaProvider-BNoNOxQ5.cjs +16 -0
- package/dist/XerticaProvider-BlY2limY.cjs +38 -0
- package/dist/{XerticaProvider-BITjgC5p.js → XerticaProvider-CEoWMTxu.js} +2 -2
- package/dist/{XerticaProvider-By8q3Roe.cjs → XerticaProvider-CllrbMEJ.cjs} +2 -2
- package/dist/XerticaProvider-DDuiIcKo.js +39 -0
- package/dist/{XerticaProvider-CW9hpCdF.cjs → XerticaProvider-ET0ihewn.cjs} +2 -2
- package/dist/XerticaProvider-cI9hSs27.cjs +38 -0
- package/dist/XerticaProvider-hSwhNQex.js +39 -0
- package/dist/{alert-dialog-yckpaOpy.cjs → alert-dialog-DSKByiKZ.cjs} +3 -3
- package/dist/{alert-dialog-iDe5VE5o.js → alert-dialog-s-vmNkJ_.js} +3 -3
- package/dist/assistant.cjs.js +1 -1
- package/dist/assistant.es.js +1 -1
- package/dist/blocks.cjs.js +1 -1
- package/dist/blocks.es.js +1 -1
- package/dist/brand.cjs.js +1 -1
- package/dist/brand.es.js +1 -1
- package/dist/breadcrumb-CqJ7bHY5.js +161 -0
- package/dist/breadcrumb-m9Hb2_XN.cjs +177 -0
- package/dist/cli.js +1 -1
- package/dist/components/assistant/xertica-assistant/hooks/index.d.ts +6 -0
- package/dist/components/assistant/xertica-assistant/hooks/use-assistant-conversations.d.ts +21 -0
- package/dist/components/assistant/xertica-assistant/hooks/use-assistant-messages.d.ts +49 -0
- package/dist/components/assistant/xertica-assistant/hooks/use-assistant-suggestions.d.ts +16 -0
- package/dist/components/assistant/xertica-assistant/xertica-assistant.d.ts +5 -13
- package/dist/components/blocks/audio-player/AudioPlayer.d.ts +35 -0
- package/dist/components/blocks/audio-player/index.d.ts +1 -0
- package/dist/components/blocks/document-editor/DocumentEditor.d.ts +26 -0
- package/dist/components/blocks/document-editor/index.d.ts +1 -0
- package/dist/components/blocks/podcast-player/PodcastPlayer.d.ts +41 -0
- package/dist/components/blocks/podcast-player/index.d.ts +1 -0
- package/dist/components/hooks/index.d.ts +10 -0
- package/dist/components/ui/chart/chart.d.ts +9 -324
- package/dist/components/ui/chart/parts/chart-dashboard.d.ts +113 -0
- package/dist/components/ui/chart/parts/chart-metric.d.ts +118 -0
- package/dist/components/ui/chart/parts/chart-primitives.d.ts +101 -0
- package/dist/components/ui/chart/parts/chart-shared.d.ts +20 -0
- package/dist/components/ui/chart/parts/chart-utils.d.ts +12 -0
- package/dist/components/ui/chart/parts/index.d.ts +5 -0
- package/dist/components/ui/file-upload/use-file-upload.d.ts +9 -15
- package/dist/components/ui/index.d.ts +1 -1
- package/dist/components/ui/pagination/pagination.d.ts +5 -3
- package/dist/components/ui/tree-view/tree-view.d.ts +2 -0
- package/dist/dropdown-menu-BDB5CmQs.cjs +247 -0
- package/dist/dropdown-menu-DQidbKBD.js +231 -0
- package/dist/google-maps-loader-BFWp6VPd.js +287 -0
- package/dist/{google-maps-loader-t2IlYBzw.js → google-maps-loader-CTYySAun.js} +4 -0
- package/dist/{google-maps-loader-BqsYL48U.cjs → google-maps-loader-Y-QkD-Li.cjs} +5 -0
- package/dist/google-maps-loader-eS3uQ5TA.cjs +287 -0
- package/dist/header-Cgy6vYPk.cjs +731 -0
- package/dist/header-DRlT4jgI.js +715 -0
- package/dist/header-Dux00SI4.cjs +731 -0
- package/dist/header-EkGKXPsD.js +715 -0
- package/dist/header-WfEywpyc.cjs +731 -0
- package/dist/header-tifNQn2U.js +715 -0
- package/dist/hooks.cjs.js +9 -2
- package/dist/hooks.es.js +10 -3
- package/dist/index-BhapVLVj.js +8 -0
- package/dist/{index-D3RLKRAs.cjs → index-COtD8bRW.cjs} +1 -1
- package/dist/index-D6fxYEY8.cjs +7 -0
- package/dist/index-DW5tYe26.js +8 -0
- package/dist/index.cjs.js +54 -40
- package/dist/index.es.js +259 -245
- package/dist/index.umd.js +1043 -470
- package/dist/input-2R4loU86.js +127 -0
- package/dist/input-DWANSKGb.cjs +145 -0
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +1 -1
- package/dist/media.cjs.js +1 -1
- package/dist/media.es.js +1 -1
- package/dist/pages.cjs.js +1 -1
- package/dist/pages.es.js +1 -1
- package/dist/progress-DPtzoVV8.js +175 -0
- package/dist/progress-EeaoqqUs.cjs +191 -0
- package/dist/rich-text-editor-0mraWT5y.cjs +2376 -0
- package/dist/rich-text-editor-B6jMRLzk.cjs +1939 -0
- package/dist/rich-text-editor-B8_oYcIR.js +1730 -0
- package/dist/rich-text-editor-B9UbSXNb.js +1203 -0
- package/dist/rich-text-editor-BYuRBNBU.js +2373 -0
- package/dist/rich-text-editor-Bb9pySTs.cjs +2374 -0
- package/dist/rich-text-editor-BcL6L3cm.cjs +2374 -0
- package/dist/rich-text-editor-BoVZYtTs.cjs +2391 -0
- package/dist/rich-text-editor-CMgSN_w2.js +1189 -0
- package/dist/rich-text-editor-CPV1lEPH.cjs +1748 -0
- package/dist/rich-text-editor-CoKqbCtu.cjs +1799 -0
- package/dist/rich-text-editor-Cw56T_mB.js +2356 -0
- package/dist/rich-text-editor-Cyt8qs2b.js +1921 -0
- package/dist/rich-text-editor-D6H84OcX.cjs +1220 -0
- package/dist/rich-text-editor-D76gD-QI.js +2328 -0
- package/dist/rich-text-editor-DKkokOnA.js +1781 -0
- package/dist/rich-text-editor-DNsdpN64.cjs +2359 -0
- package/dist/rich-text-editor-DfG8bCyY.js +2358 -0
- package/dist/rich-text-editor-Dxjw31Z4.js +2341 -0
- package/dist/rich-text-editor-DzP0Epmb.js +2356 -0
- package/dist/rich-text-editor-lyYE2ZG5.cjs +1207 -0
- package/dist/rich-text-editor-skplNlBM.cjs +2345 -0
- package/dist/select-Bkbr0f-Z.cjs +162 -0
- package/dist/select-CvIVdX2n.js +145 -0
- package/dist/{sidebar-CmvwjnVb.js → sidebar-BViy8Eeu.js} +17 -9
- package/dist/{sidebar-CVUGHOS_.cjs → sidebar-BxGXsDAd.cjs} +16 -8
- package/dist/sidebar-CK_0ZQHj.cjs +803 -0
- package/dist/sidebar-CUuOvYhK.js +787 -0
- package/dist/slider-Bc5Hd0y1.js +56 -0
- package/dist/slider-N7hFFj6X.cjs +73 -0
- package/dist/tooltip-Ded96neP.cjs +137 -0
- package/dist/tooltip-HDOoD2-0.js +120 -0
- package/dist/ui.cjs.js +48 -34
- package/dist/ui.es.js +237 -223
- package/dist/{use-audio-player-Dn1NR9xN.cjs → use-audio-player-NKsWyjWu.cjs} +7 -3
- package/dist/{use-audio-player-Bkh23vQ3.js → use-audio-player-nv8ZSGa1.js} +7 -3
- package/dist/use-file-upload-BcjEo2S5.js +404 -0
- package/dist/use-file-upload-CRJR68Tj.cjs +403 -0
- package/dist/use-mobile-B0hNy_Y6.cjs +4303 -0
- package/dist/{AssistantChart-CVko2A1W.js → use-mobile-BXuYROXM.js} +1025 -171
- package/dist/use-mobile-Bbd51ASU.cjs +4392 -0
- package/dist/use-mobile-Bk6CX-TC.js +4359 -0
- package/dist/use-mobile-BvYdisLP.js +4202 -0
- package/dist/use-mobile-BzuxjzNX.cjs +4392 -0
- package/dist/{AssistantChart-BAx9VQvb.cjs → use-mobile-CG2-SdXV.cjs} +1070 -209
- package/dist/use-mobile-CKb5pqTs.js +4269 -0
- package/dist/use-mobile-CYuAuGDl.js +4202 -0
- package/dist/use-mobile-CaENcqm-.js +4508 -0
- package/dist/use-mobile-CbrYgJGJ.js +4203 -0
- package/dist/use-mobile-DMOvImGQ.cjs +4542 -0
- package/dist/use-mobile-DRB3BQgD.cjs +4235 -0
- package/dist/use-mobile-DZvv7QMR.js +4359 -0
- package/dist/use-mobile-DdI_TXam.cjs +4235 -0
- package/dist/use-mobile-DlceKf8a.js +4359 -0
- package/dist/use-mobile-DsOnow1o.cjs +4236 -0
- package/dist/use-mobile-Kcj6jSnK.cjs +4392 -0
- package/dist/use-mobile-bnKcua_i.js +4202 -0
- package/dist/use-mobile-ncXBeE2z.cjs +4235 -0
- package/dist/use-rich-text-editor-DjiddBGv.js +282 -0
- package/dist/use-rich-text-editor-lpeswbCs.cjs +281 -0
- package/dist/{xertica-assistant-BMqdyRVi.js → xertica-assistant-BdiZag0h.js} +232 -127
- package/dist/{xertica-assistant-Bj3vBCq_.cjs → xertica-assistant-DUBpmEgo.cjs} +231 -126
- package/dist/{xertica-assistant-B1IaHXnB.cjs → xertica-assistant-dyP7KHM5.cjs} +533 -392
- package/dist/{xertica-assistant-DPsESB6t.js → xertica-assistant-yX1CFBBo.js} +535 -394
- package/dist/xertica-ui.css +2 -2
- package/docs/components/calendar.md +154 -154
- package/docs/components/card-patterns.md +337 -337
- package/docs/components/card.md +235 -235
- package/docs/components/chart.md +11 -0
- package/docs/components/file-upload.md +15 -9
- package/docs/components/hooks.md +479 -0
- package/docs/components/map.md +84 -84
- package/docs/components/pagination.md +16 -5
- package/docs/components/rich-text-editor.md +2 -1
- package/docs/components/sidebar.md +43 -11
- package/docs/components/stepper.md +1 -0
- package/docs/components/tree-view.md +3 -2
- package/docs/components/xertica-provider.md +24 -24
- package/docs/decision-tree.md +287 -287
- package/guidelines/Guidelines.md +252 -252
- package/hooks/useTheme.ts +3 -3
- package/imports/Podcast.tsx +388 -388
- package/imports/XerticaAi.tsx +45 -45
- package/imports/XerticaX.tsx +19 -19
- package/imports/svg-aueiaqngck.ts +11 -11
- package/imports/svg-v9krss1ozd.ts +16 -16
- package/imports/svg-vhrdofe3qe.ts +5 -5
- package/llms-compact.txt +376 -327
- package/llms-full.txt +8 -3
- package/llms.txt +160 -160
- package/package.json +203 -203
- package/styles/xertica/app-overrides/chat.css +61 -61
- package/styles/xertica/app-overrides/scrollbar.css +33 -33
- package/styles/xertica/integrations/google-maps.css +76 -76
- package/styles/xertica/integrations/sonner.css +73 -73
- package/templates/CLAUDE.md +231 -182
- package/templates/README.md +152 -0
- package/templates/guidelines/Guidelines.md +560 -325
- package/templates/package.json +5 -2
- package/templates/src/app/App.tsx +6 -1
- package/templates/src/app/components/AppLayout.tsx +7 -5
- package/templates/src/app/components/AuthGuard.tsx +53 -30
- package/templates/src/features/auth/index.ts +4 -4
- package/templates/src/features/auth/ui/AuthPageShell.tsx +34 -34
- package/templates/src/features/auth/ui/ForgotPasswordContent.tsx +68 -70
- package/templates/src/features/auth/ui/LoginContent.tsx +91 -90
- package/templates/src/features/auth/ui/ResetPasswordContent.tsx +152 -151
- package/templates/src/features/auth/ui/SocialLoginButtons.tsx +59 -59
- package/templates/src/features/auth/ui/VerifyEmailContent.tsx +80 -82
- package/templates/src/features/home/index.ts +1 -1
- package/templates/src/features/home/ui/HomeContent.tsx +119 -100
- package/templates/src/features/settings/index.ts +1 -0
- package/templates/src/features/settings/ui/SettingsContent.tsx +210 -0
- package/templates/src/features/template/index.ts +5 -5
- package/templates/src/features/template/ui/CrudTemplate.tsx +268 -106
- package/templates/src/features/template/ui/DashboardTemplate.tsx +201 -101
- package/templates/src/features/template/ui/FormTemplate.tsx +227 -120
- package/templates/src/features/template/ui/LoginTemplate.tsx +4 -6
- package/templates/src/pages/AssistantPage.tsx +333 -328
- package/templates/src/pages/ForgotPasswordPage.tsx +6 -6
- package/templates/src/pages/HomePage.tsx +47 -57
- package/templates/src/pages/LoginPage.tsx +10 -10
- package/templates/src/pages/NotFoundPage.tsx +29 -0
- package/templates/src/pages/ResetPasswordPage.tsx +6 -6
- package/templates/src/pages/SettingsPage.tsx +21 -0
- package/templates/src/pages/TemplatePage.tsx +30 -30
- package/templates/src/pages/VerifyEmailPage.tsx +6 -6
- package/templates/src/shared/config/assistant.ts +20 -0
- package/templates/src/shared/config/navigation.ts +21 -20
- package/templates/src/shared/lib/api.ts +79 -0
- package/templates/src/shared/lib/auth.ts +31 -20
- package/templates/src/shared/types/auth.ts +9 -3
- package/templates/src/shared/ui/PageContent.tsx +35 -0
- package/templates/src/styles/index.css +2 -2
- package/templates/src/vite-env.d.ts +12 -0
- package/templates/tsconfig.json +5 -5
- package/utils/gemini.ts +140 -140
- package/dist/VerifyEmailPage-BE-L9mB7.js +0 -2828
- package/dist/VerifyEmailPage-CR7kb5df.cjs +0 -2827
- package/dist/index-CkTUgOwX.js +0 -8
- package/dist/{rich-text-editor-BmsjY03B.js → rich-text-editor-DgF8s7xW.js} +26 -26
- package/dist/{rich-text-editor-GS2kpTAK.cjs → rich-text-editor-mWoaSCE4.cjs} +26 -26
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,62 @@ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## [2.1.6] — 2026-05-19
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **`templates/HomeContent.tsx` — JSX malformado causava crash da página** — tags `</div>`, `</ScrollArea>` e `</main>` estavam faltando após refatoração para `<PageContent>`, fazendo a página Home quebrar completamente ao renderizar.
|
|
15
|
+
- **`templates/DashboardTemplate.tsx` — `StatsCard.trend` com tipo errado** — `trend` recebia um `number` primitivo (`trend={20.1}`) mas o prop exige um objeto `{ value: number; label?: string }`. Corrigido para `trend={{ value: 20.1, label: 'vs mês anterior' }}` em todos os 4 cards.
|
|
16
|
+
- **`templates/DashboardTemplate.tsx` — `DonutBreakdownChart` com chaves acentuadas** — o `channelConfig` usava chaves como `Orgânico` que falhavam no lookup interno do chart. Renomeadas para ASCII (`organico`, `pago`, `social`, `direto`) com labels legíveis mantidas via `label:`.
|
|
17
|
+
- **`templates/DashboardTemplate.tsx` — cast de `Badge.variant` sem type safety** — `event.status as 'default' | ...` foi substituído por um mapa `EVENT_BADGE_VARIANT` com tipagem `EventStatus` explícita.
|
|
18
|
+
- **`templates/SettingsContent.tsx` — imports duplicados de `xertica-ui/hooks`** — `useTheme` e `useLayout` eram importados em duas linhas separadas do mesmo módulo. Unificados em um único import.
|
|
19
|
+
- **`templates/SettingsContent.tsx` — `Separator`, `Badge` e `useNavigate` importados mas nunca usados** — removidos para evitar erros de lint/build.
|
|
20
|
+
- **`templates/SettingsContent.tsx` — `Switch.onCheckedChange` com tipo incompatível** — `toggleTheme` é `() => void` mas `onCheckedChange` exige `(checked: boolean) => void`. Corrigido com wrapper arrow `() => toggleTheme()`.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## [2.1.5] — 2026-05-19
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- **`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.
|
|
29
|
+
- **`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`.
|
|
30
|
+
- **`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).
|
|
31
|
+
- **`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.
|
|
32
|
+
- **`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.
|
|
33
|
+
- **`use-assistant-conversations` — `setTimeout` do comando não limpo no unmount** — `commandTimerRef` + cleanup `useEffect` adicionados para cancelar o timer ao desmontar.
|
|
34
|
+
- **`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`.
|
|
35
|
+
- **`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).
|
|
36
|
+
- **`use-assistant-conversations` — `conversasFiltradas` não memoizado** — recalculado em todo re-render do componente pai. Substituído por `useMemo([conversas, abaSelecionada])`.
|
|
37
|
+
- **`use-assistant-messages` — `handleEnviarMensagem` tipado como `string | any`** — tipo colapsado para `any`. Corrigido para `(arg?: string) => Promise<void>`.
|
|
38
|
+
- **`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.
|
|
39
|
+
- **`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.
|
|
40
|
+
- **`FileUpload` — tamanho de arquivo sempre em KB** — arquivos grandes exibiam `102400.00 KB`. Corrigido para exibição adaptativa KB/MB.
|
|
41
|
+
- **`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)`.
|
|
42
|
+
- **`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.
|
|
43
|
+
- **`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`.
|
|
44
|
+
- **`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.
|
|
45
|
+
- **`use-assistant-conversations` — magic string `'5'` como command ID hardcoded** — comentário de TODO mantido; o timer cleanup foi aplicado independentemente.
|
|
46
|
+
|
|
47
|
+
### Added
|
|
48
|
+
|
|
49
|
+
- **`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.
|
|
50
|
+
- **`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).
|
|
51
|
+
|
|
52
|
+
### Changed
|
|
53
|
+
|
|
54
|
+
- **`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.
|
|
55
|
+
- **`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.
|
|
56
|
+
- **`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.
|
|
57
|
+
- **`RichTextEditor` — ARIA no `contentEditable`** — adicionados `role="textbox"`, `aria-multiline="true"`, `aria-label`, `aria-readonly` e `aria-disabled` ao div editável.
|
|
58
|
+
- **`RichTextEditor` — removido "Auto-save ativo"** — texto no rodapé que indicava auto-save não implementado. Removido para não enganar o usuário.
|
|
59
|
+
- **`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).
|
|
60
|
+
- **`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`.
|
|
61
|
+
- **`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.
|
|
62
|
+
- **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.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
10
66
|
## [2.1.4] — 2026-05-19
|
|
11
67
|
|
|
12
68
|
### 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
|
-
[](https://www.npmjs.com/package/xertica-ui)
|
|
6
6
|
[](./LICENSE)
|
|
7
7
|
|
|
8
8
|
---
|
package/assets/xertica-logo.svg
CHANGED
|
@@ -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
|
@@ -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
|
+
}
|