xertica-ui 2.1.3 → 2.1.4
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 +15 -0
- package/README.md +1 -1
- package/assets/xertica-logo.svg +37 -37
- package/assets/xertica-x-logo.svg +20 -20
- package/components/assistant/index.ts +6 -6
- package/components/assistant/xertica-assistant/parts/AssistantCollapsedView.tsx +97 -0
- package/components/assistant/xertica-assistant/parts/AssistantConversationList.tsx +104 -0
- package/components/assistant/xertica-assistant/parts/AssistantDocumentEditor.tsx +81 -0
- package/components/assistant/xertica-assistant/parts/AssistantFeedbackDialog.tsx +86 -0
- package/components/assistant/xertica-assistant/parts/AssistantHeader.tsx +77 -0
- package/components/assistant/xertica-assistant/parts/AssistantMessageBubble.tsx +573 -0
- package/components/assistant/xertica-assistant/parts/AssistantTabBar.tsx +65 -0
- package/components/assistant/xertica-assistant/parts/AssistantTypingIndicator.tsx +41 -0
- package/components/assistant/xertica-assistant/parts/AssistantWelcomeScreen.tsx +98 -0
- package/components/assistant/xertica-assistant/parts/index.ts +16 -0
- package/components/assistant/xertica-assistant/types.ts +139 -0
- package/components/assistant/xertica-assistant/use-assistant.ts +5 -10
- package/components/assistant/xertica-assistant/xertica-assistant.tsx +125 -1096
- 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/index.ts +17 -17
- package/components/blocks/index.ts +1 -1
- package/components/brand/index.ts +6 -6
- package/components/brand/theme-toggle/ThemeToggle.tsx +8 -27
- 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 +10 -7
- package/components/hooks/use-layout-shortcuts.ts +46 -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 +1 -31
- package/components/layout/sidebar/use-sidebar.ts +2 -11
- package/components/media/FloatingMediaWrapper.tsx +11 -11
- package/components/media/audio-player/AudioPlayer.tsx +140 -215
- package/components/media/audio-player/use-audio-player.ts +298 -0
- 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/CustomTooltipContent.tsx +52 -0
- 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 +154 -154
- package/components/ui/chart/chart.tsx +2367 -2367
- 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/google-maps-loader/google-maps-loader.tsx +2 -2
- package/components/ui/hover-card/hover-card.mdx +8 -8
- 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/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/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/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.json +1512 -1512
- package/contexts/ApiKeyContext.tsx +72 -72
- package/contexts/AssistenteContext.tsx +17 -54
- package/contexts/BrandColorsContext.tsx +32 -43
- package/contexts/LanguageContext.tsx +13 -13
- package/contexts/LayoutContext.test.tsx +11 -11
- package/contexts/LayoutContext.tsx +24 -50
- package/contexts/ThemeContext.tsx +26 -26
- package/contexts/theme-data.ts +4 -4
- package/dist/{AssistantChart-DoZCyS5r.cjs → AssistantChart-9w31gdAb.cjs} +4 -4
- package/dist/{AssistantChart-CldVCVDe.cjs → AssistantChart-BAudAfne.cjs} +5 -5
- package/dist/{use-mobile-DRB3BQgD.cjs → AssistantChart-BAx9VQvb.cjs} +209 -1070
- package/dist/{AssistantChart-Cu3m7RBo.js → AssistantChart-BP8upjMk.js} +5 -5
- package/dist/{use-mobile-BvYdisLP.js → AssistantChart-CVko2A1W.js} +171 -1025
- package/dist/{AssistantChart-C_hwFRRr.js → AssistantChart-CVzmmhx4.js} +4 -4
- package/dist/{AudioPlayer-C12BjQBV.cjs → AudioPlayer-1ypwE2Wh.cjs} +126 -187
- package/dist/{AudioPlayer-DcFKRJE_.js → AudioPlayer-DuKXrCfy.js} +80 -141
- package/dist/CustomTooltipContent-DHjkY0ww.js +40 -0
- package/dist/CustomTooltipContent-c_K-DWRr.cjs +56 -0
- package/dist/{ThemeContext-BoH4NLfN.js → LanguageContext-BwhwC3G2.js} +27 -104
- package/dist/{ThemeContext-r69W20Xg.cjs → LanguageContext-DvUt5jBg.cjs} +27 -104
- package/dist/{LayoutContext-BvK-ggDa.cjs → LayoutContext-BDmcZfMH.cjs} +8 -20
- package/dist/{LayoutContext-BAql6ZRY.js → LayoutContext-dbQvdC4O.js} +8 -20
- package/dist/{ThemeContext-C2EwAPDt.js → ThemeContext-BbBNoFTG.js} +2 -2
- package/dist/{ThemeContext-vTjumZeM.cjs → ThemeContext-Cmr8Ex8H.cjs} +2 -2
- package/dist/ThemeContext-RTy1m2Uq.js +82 -0
- package/dist/ThemeContext-bSzuOit2.cjs +81 -0
- package/dist/VerifyEmailPage-BE-L9mB7.js +2828 -0
- package/dist/{VerifyEmailPage-Cwi3kbol.cjs → VerifyEmailPage-Bae2cBXT.cjs} +7 -7
- package/dist/VerifyEmailPage-CR7kb5df.cjs +2827 -0
- package/dist/{VerifyEmailPage-C0c2e5n0.js → VerifyEmailPage-C_ihbcth.js} +6 -6
- package/dist/VerifyEmailPage-CbgjOF0v.js +2828 -0
- package/dist/{VerifyEmailPage-DvMLZgFt.js → VerifyEmailPage-CdYPSJoO.js} +1 -1
- package/dist/{VerifyEmailPage-CYXtbKi3.cjs → VerifyEmailPage-DMBh4NM9.cjs} +1 -1
- package/dist/VerifyEmailPage-Dt7zgA4w.cjs +2827 -0
- package/dist/{XerticaProvider-CEoWMTxu.js → XerticaProvider-BITjgC5p.js} +2 -2
- package/dist/{XerticaProvider-CllrbMEJ.cjs → XerticaProvider-By8q3Roe.cjs} +2 -2
- package/dist/{XerticaProvider-cI9hSs27.cjs → XerticaProvider-CW9hpCdF.cjs} +9 -8
- package/dist/{XerticaProvider-DDuiIcKo.js → XerticaProvider-siSt9uG2.js} +5 -4
- package/dist/{LanguageSelector-D6uacAIM.cjs → XerticaXLogo-D8jf0SNv.cjs} +86 -102
- package/dist/{LanguageSelector-B5YfbHra.js → XerticaXLogo-fAJMy3H4.js} +87 -103
- package/dist/{alert-dialog-s-vmNkJ_.js → alert-dialog-iDe5VE5o.js} +3 -3
- package/dist/{alert-dialog-DSKByiKZ.cjs → alert-dialog-yckpaOpy.cjs} +3 -3
- package/dist/assistant.cjs.js +1 -1
- package/dist/assistant.es.js +1 -1
- package/dist/brand.cjs.js +2 -2
- package/dist/brand.es.js +2 -2
- package/dist/components/assistant/xertica-assistant/parts/AssistantCollapsedView.d.ts +13 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantConversationList.d.ts +16 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantDocumentEditor.d.ts +17 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantFeedbackDialog.d.ts +19 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantHeader.d.ts +11 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantMessageBubble.d.ts +29 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantTabBar.d.ts +13 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantTypingIndicator.d.ts +4 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantWelcomeScreen.d.ts +17 -0
- package/dist/components/assistant/xertica-assistant/parts/index.d.ts +16 -0
- package/dist/components/assistant/xertica-assistant/types.d.ts +106 -0
- package/dist/components/assistant/xertica-assistant/use-assistant.d.ts +1 -2
- package/dist/components/assistant/xertica-assistant/xertica-assistant.d.ts +2 -96
- package/dist/components/hooks/index.d.ts +3 -0
- package/dist/components/hooks/use-layout-shortcuts.d.ts +22 -0
- package/dist/components/media/audio-player/AudioPlayer.d.ts +4 -1
- package/dist/components/media/audio-player/use-audio-player.d.ts +72 -0
- package/dist/components/shared/CustomTooltipContent.d.ts +20 -0
- package/dist/components/ui/alert/alert.d.ts +1 -1
- package/dist/components/ui/badge/badge.d.ts +1 -1
- package/dist/components/ui/button/button.d.ts +2 -2
- package/dist/contexts/AssistenteContext.d.ts +10 -49
- package/dist/{google-maps-loader-Y-QkD-Li.cjs → google-maps-loader-BqsYL48U.cjs} +0 -5
- package/dist/{google-maps-loader-CTYySAun.js → google-maps-loader-t2IlYBzw.js} +0 -4
- package/dist/hooks.cjs.js +30 -10
- package/dist/hooks.es.js +25 -4
- package/dist/index-CkTUgOwX.js +8 -0
- package/dist/{index-COtD8bRW.cjs → index-D3RLKRAs.cjs} +1 -1
- package/dist/index.cjs.js +11 -11
- package/dist/index.es.js +11 -11
- package/dist/index.umd.js +454 -1027
- package/dist/layout.cjs.js +3 -10
- package/dist/layout.es.js +3 -10
- 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/{sidebar-CK_0ZQHj.cjs → sidebar-CVUGHOS_.cjs} +10 -57
- package/dist/{sidebar-CUuOvYhK.js → sidebar-CmvwjnVb.js} +10 -40
- package/dist/ui.cjs.js +4 -4
- package/dist/ui.es.js +4 -4
- package/dist/use-audio-player-Bkh23vQ3.js +177 -0
- package/dist/use-audio-player-Dn1NR9xN.cjs +176 -0
- package/dist/utils/color-utils.d.ts +51 -0
- package/dist/{xertica-assistant-dyP7KHM5.cjs → xertica-assistant-B1IaHXnB.cjs} +388 -529
- package/dist/xertica-assistant-BMqdyRVi.js +2082 -0
- package/dist/xertica-assistant-Bj3vBCq_.cjs +2081 -0
- package/dist/{xertica-assistant-yX1CFBBo.js → xertica-assistant-DPsESB6t.js} +390 -531
- package/dist/{CodeBlock-BgfYL_rD.cjs → xertica-assistant-Qp3ydksa.cjs} +51 -263
- package/dist/{CodeBlock-DnYNI8rQ.js → xertica-assistant-gnCJdcZY.js} +7 -219
- package/dist/xertica-ui.css +2 -2
- package/docs/architecture-improvements.md +463 -0
- package/docs/architecture.md +1 -1
- package/docs/components/assistant-chart.md +1 -1
- package/docs/components/audio-player.md +46 -0
- package/docs/components/branding.md +251 -0
- 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/code-block.md +108 -0
- package/docs/components/formatted-document.md +113 -0
- package/docs/components/hooks.md +430 -0
- package/docs/components/image-with-fallback.md +106 -0
- package/docs/components/map-layers.md +140 -0
- package/docs/components/map.md +84 -84
- package/docs/components/modern-chat-input.md +163 -0
- package/docs/components/pages.md +351 -0
- package/docs/components/xertica-provider.md +24 -24
- package/docs/decision-tree.md +287 -287
- package/docs/doc-audit.md +223 -0
- package/docs/getting-started.md +154 -0
- package/docs/llms.md +25 -5
- package/docs/patterns/detail-page.md +276 -0
- package/docs/patterns/settings.md +346 -0
- package/docs/patterns/wizard.md +217 -0
- 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 +327 -327
- 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 +182 -182
- package/templates/guidelines/Guidelines.md +325 -325
- package/templates/package.json +2 -2
- 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 +70 -70
- package/templates/src/features/auth/ui/LoginContent.tsx +90 -90
- package/templates/src/features/auth/ui/ResetPasswordContent.tsx +151 -151
- package/templates/src/features/auth/ui/SocialLoginButtons.tsx +59 -59
- package/templates/src/features/auth/ui/VerifyEmailContent.tsx +82 -82
- package/templates/src/features/home/index.ts +1 -1
- package/templates/src/features/home/ui/HomeContent.tsx +100 -100
- package/templates/src/features/template/index.ts +5 -5
- package/templates/src/features/template/ui/CrudTemplate.tsx +3 -3
- package/templates/src/features/template/ui/DashboardTemplate.tsx +3 -3
- package/templates/src/features/template/ui/FormTemplate.tsx +120 -120
- package/templates/src/features/template/ui/LoginTemplate.tsx +3 -3
- package/templates/src/pages/AssistantPage.tsx +328 -328
- package/templates/src/pages/ForgotPasswordPage.tsx +6 -6
- package/templates/src/pages/HomePage.tsx +57 -57
- package/templates/src/pages/LoginPage.tsx +10 -10
- package/templates/src/pages/ResetPasswordPage.tsx +6 -6
- package/templates/src/pages/TemplatePage.tsx +30 -30
- package/templates/src/pages/VerifyEmailPage.tsx +6 -6
- package/templates/src/shared/config/navigation.ts +20 -20
- package/templates/src/shared/lib/auth.ts +20 -20
- package/templates/src/shared/types/auth.ts +3 -3
- package/templates/tsconfig.json +5 -5
- package/utils/color-utils.ts +72 -0
- package/utils/gemini.ts +140 -140
- package/dist/AudioPlayer-B1lt5cPl.cjs +0 -989
- package/dist/AudioPlayer-BZ7bibzU.cjs +0 -982
- package/dist/AudioPlayer-DMcG_c7L.js +0 -990
- package/dist/AudioPlayer-e8LfNoqO.js +0 -983
- package/dist/CodeBlock-7TTgmdGG.cjs +0 -2094
- package/dist/CodeBlock-BeSt1h5P.js +0 -2078
- package/dist/CodeBlock-BlcqlA9M.cjs +0 -2094
- package/dist/CodeBlock-Bnmeu5ez.cjs +0 -2094
- package/dist/CodeBlock-BtfPlbAI.js +0 -2078
- package/dist/CodeBlock-CIySIuYr.js +0 -2078
- package/dist/CodeBlock-CuPtUM-7.cjs +0 -2094
- package/dist/CodeBlock-D6ffWXgc.js +0 -2078
- package/dist/CodeBlock-D8dcwbit.cjs +0 -2094
- package/dist/CodeBlock-DMZrFnlw.cjs +0 -2094
- package/dist/CodeBlock-DlBehYN8.js +0 -2078
- package/dist/CodeBlock-DvKWbSnE.cjs +0 -2094
- package/dist/CodeBlock-DwMCfkFY.js +0 -2078
- package/dist/CodeBlock-Dy6CNYyj.js +0 -2078
- package/dist/CodeBlock-U1pPOQI7.cjs +0 -2094
- package/dist/CodeBlock-f_GpNhEB.js +0 -2078
- package/dist/CodeBlock-oB6u8nI1.js +0 -2078
- package/dist/CodeBlock-tZC31B73.cjs +0 -2094
- package/dist/ImageWithFallback-CGtidP6B.cjs +0 -4542
- package/dist/ImageWithFallback-lsg3pdFg.js +0 -4508
- package/dist/XerticaOrbe-KL1RBHzw.cjs +0 -1354
- package/dist/XerticaOrbe-zwS1p2a8.js +0 -1355
- package/dist/XerticaProvider-6btlAlzc.js +0 -17
- package/dist/XerticaProvider-BNoNOxQ5.cjs +0 -16
- package/dist/XerticaProvider-BlY2limY.cjs +0 -38
- package/dist/XerticaProvider-hSwhNQex.js +0 -39
- package/dist/breadcrumb-CqJ7bHY5.js +0 -161
- package/dist/breadcrumb-m9Hb2_XN.cjs +0 -177
- package/dist/components/blocks/audio-player/AudioPlayer.d.ts +0 -35
- package/dist/components/blocks/audio-player/index.d.ts +0 -1
- package/dist/components/blocks/document-editor/DocumentEditor.d.ts +0 -26
- package/dist/components/blocks/document-editor/index.d.ts +0 -1
- package/dist/components/blocks/podcast-player/PodcastPlayer.d.ts +0 -41
- package/dist/components/blocks/podcast-player/index.d.ts +0 -1
- package/dist/dropdown-menu-BDB5CmQs.cjs +0 -247
- package/dist/dropdown-menu-DQidbKBD.js +0 -231
- package/dist/google-maps-loader-BFWp6VPd.js +0 -287
- package/dist/google-maps-loader-eS3uQ5TA.cjs +0 -287
- package/dist/header-Cgy6vYPk.cjs +0 -731
- package/dist/header-DRlT4jgI.js +0 -715
- package/dist/header-Dux00SI4.cjs +0 -731
- package/dist/header-EkGKXPsD.js +0 -715
- package/dist/header-WfEywpyc.cjs +0 -731
- package/dist/header-tifNQn2U.js +0 -715
- package/dist/index-BhapVLVj.js +0 -8
- package/dist/index-D6fxYEY8.cjs +0 -7
- package/dist/index-DW5tYe26.js +0 -8
- package/dist/input-2R4loU86.js +0 -127
- package/dist/input-DWANSKGb.cjs +0 -145
- package/dist/rich-text-editor-0mraWT5y.cjs +0 -2376
- package/dist/rich-text-editor-B6jMRLzk.cjs +0 -1939
- package/dist/rich-text-editor-B8_oYcIR.js +0 -1730
- package/dist/rich-text-editor-B9UbSXNb.js +0 -1203
- package/dist/rich-text-editor-BYuRBNBU.js +0 -2373
- package/dist/rich-text-editor-Bb9pySTs.cjs +0 -2374
- package/dist/rich-text-editor-BcL6L3cm.cjs +0 -2374
- package/dist/rich-text-editor-BoVZYtTs.cjs +0 -2391
- package/dist/rich-text-editor-CPV1lEPH.cjs +0 -1748
- package/dist/rich-text-editor-CoKqbCtu.cjs +0 -1799
- package/dist/rich-text-editor-Cw56T_mB.js +0 -2356
- package/dist/rich-text-editor-Cyt8qs2b.js +0 -1921
- package/dist/rich-text-editor-D6H84OcX.cjs +0 -1220
- package/dist/rich-text-editor-D76gD-QI.js +0 -2328
- package/dist/rich-text-editor-DKkokOnA.js +0 -1781
- package/dist/rich-text-editor-DNsdpN64.cjs +0 -2359
- package/dist/rich-text-editor-DfG8bCyY.js +0 -2358
- package/dist/rich-text-editor-Dxjw31Z4.js +0 -2341
- package/dist/rich-text-editor-DzP0Epmb.js +0 -2356
- package/dist/rich-text-editor-skplNlBM.cjs +0 -2345
- package/dist/select-Bkbr0f-Z.cjs +0 -162
- package/dist/select-CvIVdX2n.js +0 -145
- package/dist/slider-Bc5Hd0y1.js +0 -56
- package/dist/slider-N7hFFj6X.cjs +0 -73
- package/dist/tooltip-Ded96neP.cjs +0 -137
- package/dist/tooltip-HDOoD2-0.js +0 -120
- package/dist/use-mobile-B0hNy_Y6.cjs +0 -4303
- package/dist/use-mobile-BXuYROXM.js +0 -4202
- package/dist/use-mobile-Bbd51ASU.cjs +0 -4392
- package/dist/use-mobile-Bk6CX-TC.js +0 -4359
- package/dist/use-mobile-BzuxjzNX.cjs +0 -4392
- package/dist/use-mobile-CG2-SdXV.cjs +0 -4235
- package/dist/use-mobile-CKb5pqTs.js +0 -4269
- package/dist/use-mobile-CYuAuGDl.js +0 -4202
- package/dist/use-mobile-CaENcqm-.js +0 -4508
- package/dist/use-mobile-CbrYgJGJ.js +0 -4203
- package/dist/use-mobile-DMOvImGQ.cjs +0 -4542
- package/dist/use-mobile-DZvv7QMR.js +0 -4359
- package/dist/use-mobile-DdI_TXam.cjs +0 -4235
- package/dist/use-mobile-DlceKf8a.js +0 -4359
- package/dist/use-mobile-DsOnow1o.cjs +0 -4236
- package/dist/use-mobile-Kcj6jSnK.cjs +0 -4392
- package/dist/use-mobile-bnKcua_i.js +0 -4202
- package/dist/use-mobile-ncXBeE2z.cjs +0 -4235
- package/dist/{rich-text-editor-DgF8s7xW.js → rich-text-editor-BmsjY03B.js} +26 -26
- package/dist/{rich-text-editor-mWoaSCE4.cjs → rich-text-editor-GS2kpTAK.cjs} +26 -26
|
@@ -1,325 +1,325 @@
|
|
|
1
|
-
# Project Guidelines — Xertica UI App
|
|
2
|
-
|
|
3
|
-
> **Scope**: These guidelines apply to React applications scaffolded with `npx xertica-ui@latest init`. They define the FSD/FDA architecture, import conventions, component rules, and AI agent behavior for this project.
|
|
4
|
-
>
|
|
5
|
-
> **AI agents**: Read this file first. Then read `node_modules/xertica-ui/llms-compact.txt` for component reference, and `node_modules/xertica-ui/docs/decision-tree.md` before choosing between similar components.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## 1. Architecture — Feature-Sliced Design + Feature-Driven Architecture
|
|
10
|
-
|
|
11
|
-
This project follows **FSD (Feature-Sliced Design)** layered architecture combined with **FDA (Feature-Driven Architecture)** vertical slicing. Layers can only import from layers below them.
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
src/
|
|
15
|
-
├── app/ # Layer 1 — Application shell (imports from all layers)
|
|
16
|
-
│ ├── App.tsx # XerticaProvider + BrowserRouter + AuthGuard
|
|
17
|
-
│ └── components/
|
|
18
|
-
│ ├── AppLayout.tsx # Sidebar + children + optional XerticaAssistant
|
|
19
|
-
│ └── AuthGuard.tsx # Auth state management + all route definitions
|
|
20
|
-
│
|
|
21
|
-
├── shared/ # Layer 2 — Shared utilities (no business domain)
|
|
22
|
-
│ ├── config/
|
|
23
|
-
│ │ └── navigation.ts # RouteConfig type, routes[], getRouteByPath()
|
|
24
|
-
│ ├── lib/
|
|
25
|
-
│ │ └── auth.ts # getStoredUser, storeUser, clearStoredUser
|
|
26
|
-
│ └── types/
|
|
27
|
-
│ └── auth.ts # User interface
|
|
28
|
-
│
|
|
29
|
-
├── features/ # Layer 3 — Vertical slices by business capability
|
|
30
|
-
│ ├── auth/
|
|
31
|
-
│ │ ├── index.ts # Public barrel — import from here, never from /ui/*
|
|
32
|
-
│ │ └── ui/
|
|
33
|
-
│ │ ├── AuthPageShell.tsx # Split-screen layout for auth pages
|
|
34
|
-
│ │ ├── SocialLoginButtons.tsx # Google / MT Login / gov.br buttons
|
|
35
|
-
│ │ ├── LoginContent.tsx
|
|
36
|
-
│ │ ├── ForgotPasswordContent.tsx
|
|
37
|
-
│ │ ├── VerifyEmailContent.tsx
|
|
38
|
-
│ │ └── ResetPasswordContent.tsx
|
|
39
|
-
│ ├── home/
|
|
40
|
-
│ │ ├── index.ts
|
|
41
|
-
│ │ └── ui/
|
|
42
|
-
│ │ └── HomeContent.tsx
|
|
43
|
-
│ └── template/
|
|
44
|
-
│ ├── index.ts
|
|
45
|
-
│ └── ui/
|
|
46
|
-
│ ├── TemplateContent.tsx
|
|
47
|
-
│ └── FormTemplate.tsx
|
|
48
|
-
│
|
|
49
|
-
├── pages/ # Layer 4 — Route entrypoints (thin wrappers only)
|
|
50
|
-
│ ├── LoginPage.tsx
|
|
51
|
-
│ ├── ForgotPasswordPage.tsx
|
|
52
|
-
│ ├── VerifyEmailPage.tsx
|
|
53
|
-
│ ├── ResetPasswordPage.tsx
|
|
54
|
-
│ ├── HomePage.tsx # AppLayout + HomeContent + XerticaAssistant
|
|
55
|
-
│ └── TemplatePage.tsx # AppLayout + TemplateContent + XerticaAssistant
|
|
56
|
-
│
|
|
57
|
-
└── styles/ # Visual tokens and Tailwind entry
|
|
58
|
-
├── index.css # Imports: xertica-ui/style.css, tokens.css, @source
|
|
59
|
-
└── xertica/
|
|
60
|
-
└── tokens.css # Brand CSS variables — edit here to customize theme
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
## 2. Layer Responsibilities
|
|
66
|
-
|
|
67
|
-
### `app/`
|
|
68
|
-
Initializes the application. Contains only providers, the router, `AuthGuard` (auth state + routes), and `AppLayout` (layout shell). No business logic here.
|
|
69
|
-
|
|
70
|
-
### `shared/`
|
|
71
|
-
Framework-agnostic code with no business domain: primitive types, localStorage helpers, navigation config. Importable by any layer. Must not import from `features/` or `pages/`.
|
|
72
|
-
|
|
73
|
-
### `features/`
|
|
74
|
-
Each feature is a self-contained vertical slice. The `index.ts` is the only public interface — always import from the barrel, never from internal paths:
|
|
75
|
-
|
|
76
|
-
```tsx
|
|
77
|
-
// ✅ Correct
|
|
78
|
-
import { LoginContent } from '../features/auth';
|
|
79
|
-
|
|
80
|
-
// ❌ Wrong — never import from internal feature paths
|
|
81
|
-
import { LoginContent } from '../features/auth/ui/LoginContent';
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
Features must not import from each other. If two features share code, extract it to `shared/`.
|
|
85
|
-
|
|
86
|
-
### `pages/`
|
|
87
|
-
Thin route wrappers that compose `AppLayout` + feature content + optional `XerticaAssistant`. No logic, no state, no API calls here:
|
|
88
|
-
|
|
89
|
-
```tsx
|
|
90
|
-
// ✅ Correct — thin wrapper
|
|
91
|
-
export function HomePage({ user, onLogout }: PageProps) {
|
|
92
|
-
const { assistenteExpanded, toggleAssistente } = useLayout();
|
|
93
|
-
return (
|
|
94
|
-
<AppLayout user={user} onLogout={onLogout} assistant={<XerticaAssistant ... />}>
|
|
95
|
-
<HomeContent user={user} onLogout={onLogout} />
|
|
96
|
-
</AppLayout>
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
---
|
|
102
|
-
|
|
103
|
-
## 3. Import Rules
|
|
104
|
-
|
|
105
|
-
Always use the correct `xertica-ui` subpath for the layer you are in:
|
|
106
|
-
|
|
107
|
-
```tsx
|
|
108
|
-
// shared/ui → UI primitives
|
|
109
|
-
import { Button, Card, Input, Badge, Table, Dialog, Select } from 'xertica-ui/ui';
|
|
110
|
-
|
|
111
|
-
// app layer → providers and brand
|
|
112
|
-
import { XerticaProvider, XerticaLogo, ThemeToggle } from 'xertica-ui/brand';
|
|
113
|
-
|
|
114
|
-
// features/layout → navigation shell
|
|
115
|
-
import { Sidebar, Header } from 'xertica-ui/layout';
|
|
116
|
-
|
|
117
|
-
// features/assistant → AI assistant
|
|
118
|
-
import { XerticaAssistant, generateDemoResponse } from 'xertica-ui/assistant';
|
|
119
|
-
|
|
120
|
-
// features/media → media players
|
|
121
|
-
import { VideoPlayer, AudioPlayer } from 'xertica-ui/media';
|
|
122
|
-
|
|
123
|
-
// shared/lib → hooks and contexts
|
|
124
|
-
import { useLayout, useOptionalLayout, useTheme } from 'xertica-ui/hooks';
|
|
125
|
-
|
|
126
|
-
// styles → imported once by src/styles/index.css
|
|
127
|
-
import 'xertica-ui/style.css';
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
Icons always come from `lucide-react` — never from `xertica-ui`:
|
|
131
|
-
|
|
132
|
-
```tsx
|
|
133
|
-
import { Home, Settings, Plus, Trash2, ChevronRight } from 'lucide-react';
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
---
|
|
137
|
-
|
|
138
|
-
## 4. Adding a New Route (Step-by-Step)
|
|
139
|
-
|
|
140
|
-
1. **Create the feature content** — `src/features/<name>/ui/<NameContent>.tsx`
|
|
141
|
-
2. **Export from the barrel** — add to `src/features/<name>/index.ts`
|
|
142
|
-
3. **Create the page** — `src/pages/<NamePage>.tsx` (thin AppLayout wrapper)
|
|
143
|
-
4. **Register the route** — add to `routes` array in `src/shared/config/navigation.ts`:
|
|
144
|
-
|
|
145
|
-
```ts
|
|
146
|
-
import { MyIcon } from 'lucide-react';
|
|
147
|
-
|
|
148
|
-
export const routes: RouteConfig[] = [
|
|
149
|
-
{ path: '/home', label: 'Home', icon: Home },
|
|
150
|
-
{ path: '/my-feature', label: 'My Feature', icon: MyIcon }, // ← add here
|
|
151
|
-
];
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
5. **Register the `<Route>`** — add to `src/app/components/AuthGuard.tsx`:
|
|
155
|
-
|
|
156
|
-
```tsx
|
|
157
|
-
import { MyFeaturePage } from '../../pages/MyFeaturePage';
|
|
158
|
-
|
|
159
|
-
// inside <Routes>:
|
|
160
|
-
<Route path="/my-feature" element={
|
|
161
|
-
<ProtectedRoute user={user}>
|
|
162
|
-
<MyFeaturePage user={user} onLogout={handleLogout} />
|
|
163
|
-
</ProtectedRoute>
|
|
164
|
-
} />
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
6. **Add a navigation card** to `HomeContent.tsx` if it's a primary module.
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
## 5. Non-Negotiable Rules
|
|
172
|
-
|
|
173
|
-
### HTML — never use raw elements for UI
|
|
174
|
-
|
|
175
|
-
| ❌ Never | ✅ Always |
|
|
176
|
-
|---|---|
|
|
177
|
-
| `<button>` | `<Button>` from `xertica-ui/ui` |
|
|
178
|
-
| `<input>` | `<Input>` from `xertica-ui/ui` |
|
|
179
|
-
| `<select>` | `<Select>` from `xertica-ui/ui` |
|
|
180
|
-
| `<h1>` / `<h2>` for page headers | `<PageHeader><PageHeaderHeading>` from `xertica-ui/ui` |
|
|
181
|
-
| `<div class="card ...">` | `<Card>` from `xertica-ui/ui` |
|
|
182
|
-
| custom scrollable div | `<ScrollArea>` from `xertica-ui/ui` |
|
|
183
|
-
|
|
184
|
-
### Colors — context-dependent rules
|
|
185
|
-
|
|
186
|
-
| ❌ Never (any context) | Reason |
|
|
187
|
-
|---|---|
|
|
188
|
-
| `#3b82f6`, `rgb(59, 130, 246)`, `hsl(...)` | Raw values — non-themeable |
|
|
189
|
-
| `style={{ color: '#...' }}` for theming | Non-themeable inline style |
|
|
190
|
-
|
|
191
|
-
| ❌ Wrong for semantic/status contexts | ✅ Required instead |
|
|
192
|
-
|---|---|
|
|
193
|
-
| `bg-red-500` / `text-red-500` for errors | `bg-destructive` / `text-destructive` |
|
|
194
|
-
| `bg-green-500` for success states | `bg-success` |
|
|
195
|
-
| `bg-yellow-500` for warnings | `bg-warning` |
|
|
196
|
-
|
|
197
|
-
> For **layout, spacing, and general non-semantic UI** (custom components, decorative elements where no semantic token applies), standard Tailwind color utilities like `bg-blue-500` or `text-gray-700` are acceptable.
|
|
198
|
-
|
|
199
|
-
| ❌ Never | ✅ Always |
|
|
200
|
-
|---|---|
|
|
201
|
-
| `rounded-lg`, `rounded-xl` | `rounded-[var(--radius)]` |
|
|
202
|
-
|
|
203
|
-
### Layout state — never hardcode
|
|
204
|
-
|
|
205
|
-
```tsx
|
|
206
|
-
// ✅ Correct
|
|
207
|
-
const { sidebarExpanded, sidebarWidth } = useLayout();
|
|
208
|
-
<div style={{ paddingLeft: sidebarExpanded ? `${sidebarWidth}px` : '80px' }}>
|
|
209
|
-
|
|
210
|
-
// ✅ Correct for reusable components that may render outside XerticaProvider
|
|
211
|
-
const layout = useOptionalLayout();
|
|
212
|
-
const fallbackSidebarWidth = layout?.sidebarWidth ?? 80;
|
|
213
|
-
|
|
214
|
-
// ❌ Wrong
|
|
215
|
-
<div style={{ paddingLeft: '256px' }}>
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
### Destructive actions — always confirm
|
|
219
|
-
|
|
220
|
-
```tsx
|
|
221
|
-
// ✅ Always wrap in AlertDialog
|
|
222
|
-
<AlertDialog>
|
|
223
|
-
<AlertDialogTrigger asChild>
|
|
224
|
-
<Button variant="destructive">Delete</Button>
|
|
225
|
-
</AlertDialogTrigger>
|
|
226
|
-
<AlertDialogContent>
|
|
227
|
-
<AlertDialogHeader>
|
|
228
|
-
<AlertDialogTitle>Are you sure?</AlertDialogTitle>
|
|
229
|
-
<AlertDialogDescription>This action cannot be undone.</AlertDialogDescription>
|
|
230
|
-
</AlertDialogHeader>
|
|
231
|
-
<AlertDialogFooter>
|
|
232
|
-
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
233
|
-
<AlertDialogAction onClick={handleDelete}>Delete</AlertDialogAction>
|
|
234
|
-
</AlertDialogFooter>
|
|
235
|
-
</AlertDialogContent>
|
|
236
|
-
</AlertDialog>
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
### Page structure — always use PageHeader
|
|
240
|
-
|
|
241
|
-
Every page must use `<PageHeader>` for its title and primary actions. Never use raw `<h1>` or `<h2>`:
|
|
242
|
-
|
|
243
|
-
```tsx
|
|
244
|
-
<PageHeader>
|
|
245
|
-
<PageHeaderHeading>Users</PageHeaderHeading>
|
|
246
|
-
<PageHeaderDescription>Manage your team members.</PageHeaderDescription>
|
|
247
|
-
<Button><Plus className="size-4 mr-2" />New User</Button>
|
|
248
|
-
</PageHeader>
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
### Toast notifications
|
|
252
|
-
|
|
253
|
-
```tsx
|
|
254
|
-
import { toast } from 'sonner';
|
|
255
|
-
|
|
256
|
-
toast.success('User created successfully');
|
|
257
|
-
toast.error('Failed to save changes');
|
|
258
|
-
toast.warning('Session expires in 5 minutes');
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
Never render `<Toaster>` manually — it is auto-injected by `<XerticaProvider>` in `App.tsx`.
|
|
262
|
-
|
|
263
|
-
---
|
|
264
|
-
|
|
265
|
-
## 6. Theme & Token Customization
|
|
266
|
-
|
|
267
|
-
To change the color scheme, edit `src/styles/xertica/tokens.css`. To switch themes via CLI:
|
|
268
|
-
|
|
269
|
-
```bash
|
|
270
|
-
npx xertica-ui update
|
|
271
|
-
# → select "Theme only"
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
The token file uses HSL values and supports both light and dark modes via the `.dark` class on `<html>`.
|
|
275
|
-
|
|
276
|
-
Never import or modify anything inside `node_modules/xertica-ui/styles/` — override via `tokens.css` only.
|
|
277
|
-
|
|
278
|
-
---
|
|
279
|
-
|
|
280
|
-
## 7. Authentication Pattern
|
|
281
|
-
|
|
282
|
-
The auth flow is managed in `src/app/components/AuthGuard.tsx`:
|
|
283
|
-
|
|
284
|
-
- `getStoredUser()` / `storeUser()` / `clearStoredUser()` — from `src/shared/lib/auth.ts`
|
|
285
|
-
- Auth pages (`/login`, `/forgot-password`, etc.) redirect to `/home` when user is already logged in
|
|
286
|
-
- Protected routes use `<ProtectedRoute user={user}>` wrapper that redirects to `/login` if user is null
|
|
287
|
-
- `handleLogin(email, password)` stores the user and navigates to the first protected route
|
|
288
|
-
- `handleLogout()` clears storage and navigates to `/login`
|
|
289
|
-
|
|
290
|
-
To add social login, extend `handleLogin` logic in `AuthGuard.tsx` and wire the provider button in `SocialLoginButtons.tsx`.
|
|
291
|
-
|
|
292
|
-
---
|
|
293
|
-
|
|
294
|
-
## 8. AI Agent Documentation Reference
|
|
295
|
-
|
|
296
|
-
| What you need | Where to read |
|
|
297
|
-
|---|---|
|
|
298
|
-
| Quick import + rules reference | `node_modules/xertica-ui/llms-compact.txt` |
|
|
299
|
-
| Full component API | `node_modules/xertica-ui/llms-full.txt` |
|
|
300
|
-
| "Should I use Dialog or Sheet?" | `node_modules/xertica-ui/docs/decision-tree.md` |
|
|
301
|
-
| Specific component props | `node_modules/xertica-ui/docs/components/[name].md` |
|
|
302
|
-
| All components + their imports | `node_modules/xertica-ui/components.json` |
|
|
303
|
-
| Mandatory AI rules | `node_modules/xertica-ui/docs/ai-usage.md` |
|
|
304
|
-
| This project's rules (you are here) | `CLAUDE.md` at project root |
|
|
305
|
-
|
|
306
|
-
---
|
|
307
|
-
|
|
308
|
-
## 9. Development Checklist
|
|
309
|
-
|
|
310
|
-
Before completing any feature:
|
|
311
|
-
|
|
312
|
-
- [ ] Feature content is in `src/features/<name>/ui/`
|
|
313
|
-
- [ ] Feature exports via `src/features/<name>/index.ts`
|
|
314
|
-
- [ ] Page is a thin wrapper in `src/pages/`
|
|
315
|
-
- [ ] Route registered in `src/shared/config/navigation.ts`
|
|
316
|
-
- [ ] Route registered in `src/app/components/AuthGuard.tsx`
|
|
317
|
-
- [ ] Home navigation card added (if primary module)
|
|
318
|
-
- [ ] Only `xertica-ui` components used — no raw HTML elements
|
|
319
|
-
- [ ] No raw hex/rgb values — semantic tokens for semantic/status contexts; Tailwind utilities acceptable for non-semantic layout
|
|
320
|
-
- [ ] No hardcoded radii — use `rounded-[var(--radius)]`
|
|
321
|
-
- [ ] Icons from `lucide-react` only
|
|
322
|
-
- [ ] Destructive actions wrapped in `<AlertDialog>`
|
|
323
|
-
- [ ] Layout state from `useLayout()` — no hardcoded widths
|
|
324
|
-
- [ ] Toast used for action feedback (`toast.success`, `toast.error`)
|
|
325
|
-
- [ ] Responsive on mobile, tablet, and desktop
|
|
1
|
+
# Project Guidelines — Xertica UI App
|
|
2
|
+
|
|
3
|
+
> **Scope**: These guidelines apply to React applications scaffolded with `npx xertica-ui@latest init`. They define the FSD/FDA architecture, import conventions, component rules, and AI agent behavior for this project.
|
|
4
|
+
>
|
|
5
|
+
> **AI agents**: Read this file first. Then read `node_modules/xertica-ui/llms-compact.txt` for component reference, and `node_modules/xertica-ui/docs/decision-tree.md` before choosing between similar components.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Architecture — Feature-Sliced Design + Feature-Driven Architecture
|
|
10
|
+
|
|
11
|
+
This project follows **FSD (Feature-Sliced Design)** layered architecture combined with **FDA (Feature-Driven Architecture)** vertical slicing. Layers can only import from layers below them.
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
src/
|
|
15
|
+
├── app/ # Layer 1 — Application shell (imports from all layers)
|
|
16
|
+
│ ├── App.tsx # XerticaProvider + BrowserRouter + AuthGuard
|
|
17
|
+
│ └── components/
|
|
18
|
+
│ ├── AppLayout.tsx # Sidebar + children + optional XerticaAssistant
|
|
19
|
+
│ └── AuthGuard.tsx # Auth state management + all route definitions
|
|
20
|
+
│
|
|
21
|
+
├── shared/ # Layer 2 — Shared utilities (no business domain)
|
|
22
|
+
│ ├── config/
|
|
23
|
+
│ │ └── navigation.ts # RouteConfig type, routes[], getRouteByPath()
|
|
24
|
+
│ ├── lib/
|
|
25
|
+
│ │ └── auth.ts # getStoredUser, storeUser, clearStoredUser
|
|
26
|
+
│ └── types/
|
|
27
|
+
│ └── auth.ts # User interface
|
|
28
|
+
│
|
|
29
|
+
├── features/ # Layer 3 — Vertical slices by business capability
|
|
30
|
+
│ ├── auth/
|
|
31
|
+
│ │ ├── index.ts # Public barrel — import from here, never from /ui/*
|
|
32
|
+
│ │ └── ui/
|
|
33
|
+
│ │ ├── AuthPageShell.tsx # Split-screen layout for auth pages
|
|
34
|
+
│ │ ├── SocialLoginButtons.tsx # Google / MT Login / gov.br buttons
|
|
35
|
+
│ │ ├── LoginContent.tsx
|
|
36
|
+
│ │ ├── ForgotPasswordContent.tsx
|
|
37
|
+
│ │ ├── VerifyEmailContent.tsx
|
|
38
|
+
│ │ └── ResetPasswordContent.tsx
|
|
39
|
+
│ ├── home/
|
|
40
|
+
│ │ ├── index.ts
|
|
41
|
+
│ │ └── ui/
|
|
42
|
+
│ │ └── HomeContent.tsx
|
|
43
|
+
│ └── template/
|
|
44
|
+
│ ├── index.ts
|
|
45
|
+
│ └── ui/
|
|
46
|
+
│ ├── TemplateContent.tsx
|
|
47
|
+
│ └── FormTemplate.tsx
|
|
48
|
+
│
|
|
49
|
+
├── pages/ # Layer 4 — Route entrypoints (thin wrappers only)
|
|
50
|
+
│ ├── LoginPage.tsx
|
|
51
|
+
│ ├── ForgotPasswordPage.tsx
|
|
52
|
+
│ ├── VerifyEmailPage.tsx
|
|
53
|
+
│ ├── ResetPasswordPage.tsx
|
|
54
|
+
│ ├── HomePage.tsx # AppLayout + HomeContent + XerticaAssistant
|
|
55
|
+
│ └── TemplatePage.tsx # AppLayout + TemplateContent + XerticaAssistant
|
|
56
|
+
│
|
|
57
|
+
└── styles/ # Visual tokens and Tailwind entry
|
|
58
|
+
├── index.css # Imports: xertica-ui/style.css, tokens.css, @source
|
|
59
|
+
└── xertica/
|
|
60
|
+
└── tokens.css # Brand CSS variables — edit here to customize theme
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 2. Layer Responsibilities
|
|
66
|
+
|
|
67
|
+
### `app/`
|
|
68
|
+
Initializes the application. Contains only providers, the router, `AuthGuard` (auth state + routes), and `AppLayout` (layout shell). No business logic here.
|
|
69
|
+
|
|
70
|
+
### `shared/`
|
|
71
|
+
Framework-agnostic code with no business domain: primitive types, localStorage helpers, navigation config. Importable by any layer. Must not import from `features/` or `pages/`.
|
|
72
|
+
|
|
73
|
+
### `features/`
|
|
74
|
+
Each feature is a self-contained vertical slice. The `index.ts` is the only public interface — always import from the barrel, never from internal paths:
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
// ✅ Correct
|
|
78
|
+
import { LoginContent } from '../features/auth';
|
|
79
|
+
|
|
80
|
+
// ❌ Wrong — never import from internal feature paths
|
|
81
|
+
import { LoginContent } from '../features/auth/ui/LoginContent';
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Features must not import from each other. If two features share code, extract it to `shared/`.
|
|
85
|
+
|
|
86
|
+
### `pages/`
|
|
87
|
+
Thin route wrappers that compose `AppLayout` + feature content + optional `XerticaAssistant`. No logic, no state, no API calls here:
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
// ✅ Correct — thin wrapper
|
|
91
|
+
export function HomePage({ user, onLogout }: PageProps) {
|
|
92
|
+
const { assistenteExpanded, toggleAssistente } = useLayout();
|
|
93
|
+
return (
|
|
94
|
+
<AppLayout user={user} onLogout={onLogout} assistant={<XerticaAssistant ... />}>
|
|
95
|
+
<HomeContent user={user} onLogout={onLogout} />
|
|
96
|
+
</AppLayout>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## 3. Import Rules
|
|
104
|
+
|
|
105
|
+
Always use the correct `xertica-ui` subpath for the layer you are in:
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
// shared/ui → UI primitives
|
|
109
|
+
import { Button, Card, Input, Badge, Table, Dialog, Select } from 'xertica-ui/ui';
|
|
110
|
+
|
|
111
|
+
// app layer → providers and brand
|
|
112
|
+
import { XerticaProvider, XerticaLogo, ThemeToggle } from 'xertica-ui/brand';
|
|
113
|
+
|
|
114
|
+
// features/layout → navigation shell
|
|
115
|
+
import { Sidebar, Header } from 'xertica-ui/layout';
|
|
116
|
+
|
|
117
|
+
// features/assistant → AI assistant
|
|
118
|
+
import { XerticaAssistant, generateDemoResponse } from 'xertica-ui/assistant';
|
|
119
|
+
|
|
120
|
+
// features/media → media players
|
|
121
|
+
import { VideoPlayer, AudioPlayer } from 'xertica-ui/media';
|
|
122
|
+
|
|
123
|
+
// shared/lib → hooks and contexts
|
|
124
|
+
import { useLayout, useOptionalLayout, useTheme } from 'xertica-ui/hooks';
|
|
125
|
+
|
|
126
|
+
// styles → imported once by src/styles/index.css
|
|
127
|
+
import 'xertica-ui/style.css';
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Icons always come from `lucide-react` — never from `xertica-ui`:
|
|
131
|
+
|
|
132
|
+
```tsx
|
|
133
|
+
import { Home, Settings, Plus, Trash2, ChevronRight } from 'lucide-react';
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## 4. Adding a New Route (Step-by-Step)
|
|
139
|
+
|
|
140
|
+
1. **Create the feature content** — `src/features/<name>/ui/<NameContent>.tsx`
|
|
141
|
+
2. **Export from the barrel** — add to `src/features/<name>/index.ts`
|
|
142
|
+
3. **Create the page** — `src/pages/<NamePage>.tsx` (thin AppLayout wrapper)
|
|
143
|
+
4. **Register the route** — add to `routes` array in `src/shared/config/navigation.ts`:
|
|
144
|
+
|
|
145
|
+
```ts
|
|
146
|
+
import { MyIcon } from 'lucide-react';
|
|
147
|
+
|
|
148
|
+
export const routes: RouteConfig[] = [
|
|
149
|
+
{ path: '/home', label: 'Home', icon: Home },
|
|
150
|
+
{ path: '/my-feature', label: 'My Feature', icon: MyIcon }, // ← add here
|
|
151
|
+
];
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
5. **Register the `<Route>`** — add to `src/app/components/AuthGuard.tsx`:
|
|
155
|
+
|
|
156
|
+
```tsx
|
|
157
|
+
import { MyFeaturePage } from '../../pages/MyFeaturePage';
|
|
158
|
+
|
|
159
|
+
// inside <Routes>:
|
|
160
|
+
<Route path="/my-feature" element={
|
|
161
|
+
<ProtectedRoute user={user}>
|
|
162
|
+
<MyFeaturePage user={user} onLogout={handleLogout} />
|
|
163
|
+
</ProtectedRoute>
|
|
164
|
+
} />
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
6. **Add a navigation card** to `HomeContent.tsx` if it's a primary module.
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## 5. Non-Negotiable Rules
|
|
172
|
+
|
|
173
|
+
### HTML — never use raw elements for UI
|
|
174
|
+
|
|
175
|
+
| ❌ Never | ✅ Always |
|
|
176
|
+
|---|---|
|
|
177
|
+
| `<button>` | `<Button>` from `xertica-ui/ui` |
|
|
178
|
+
| `<input>` | `<Input>` from `xertica-ui/ui` |
|
|
179
|
+
| `<select>` | `<Select>` from `xertica-ui/ui` |
|
|
180
|
+
| `<h1>` / `<h2>` for page headers | `<PageHeader><PageHeaderHeading>` from `xertica-ui/ui` |
|
|
181
|
+
| `<div class="card ...">` | `<Card>` from `xertica-ui/ui` |
|
|
182
|
+
| custom scrollable div | `<ScrollArea>` from `xertica-ui/ui` |
|
|
183
|
+
|
|
184
|
+
### Colors — context-dependent rules
|
|
185
|
+
|
|
186
|
+
| ❌ Never (any context) | Reason |
|
|
187
|
+
|---|---|
|
|
188
|
+
| `#3b82f6`, `rgb(59, 130, 246)`, `hsl(...)` | Raw values — non-themeable |
|
|
189
|
+
| `style={{ color: '#...' }}` for theming | Non-themeable inline style |
|
|
190
|
+
|
|
191
|
+
| ❌ Wrong for semantic/status contexts | ✅ Required instead |
|
|
192
|
+
|---|---|
|
|
193
|
+
| `bg-red-500` / `text-red-500` for errors | `bg-destructive` / `text-destructive` |
|
|
194
|
+
| `bg-green-500` for success states | `bg-success` |
|
|
195
|
+
| `bg-yellow-500` for warnings | `bg-warning` |
|
|
196
|
+
|
|
197
|
+
> For **layout, spacing, and general non-semantic UI** (custom components, decorative elements where no semantic token applies), standard Tailwind color utilities like `bg-blue-500` or `text-gray-700` are acceptable.
|
|
198
|
+
|
|
199
|
+
| ❌ Never | ✅ Always |
|
|
200
|
+
|---|---|
|
|
201
|
+
| `rounded-lg`, `rounded-xl` | `rounded-[var(--radius)]` |
|
|
202
|
+
|
|
203
|
+
### Layout state — never hardcode
|
|
204
|
+
|
|
205
|
+
```tsx
|
|
206
|
+
// ✅ Correct
|
|
207
|
+
const { sidebarExpanded, sidebarWidth } = useLayout();
|
|
208
|
+
<div style={{ paddingLeft: sidebarExpanded ? `${sidebarWidth}px` : '80px' }}>
|
|
209
|
+
|
|
210
|
+
// ✅ Correct for reusable components that may render outside XerticaProvider
|
|
211
|
+
const layout = useOptionalLayout();
|
|
212
|
+
const fallbackSidebarWidth = layout?.sidebarWidth ?? 80;
|
|
213
|
+
|
|
214
|
+
// ❌ Wrong
|
|
215
|
+
<div style={{ paddingLeft: '256px' }}>
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Destructive actions — always confirm
|
|
219
|
+
|
|
220
|
+
```tsx
|
|
221
|
+
// ✅ Always wrap in AlertDialog
|
|
222
|
+
<AlertDialog>
|
|
223
|
+
<AlertDialogTrigger asChild>
|
|
224
|
+
<Button variant="destructive">Delete</Button>
|
|
225
|
+
</AlertDialogTrigger>
|
|
226
|
+
<AlertDialogContent>
|
|
227
|
+
<AlertDialogHeader>
|
|
228
|
+
<AlertDialogTitle>Are you sure?</AlertDialogTitle>
|
|
229
|
+
<AlertDialogDescription>This action cannot be undone.</AlertDialogDescription>
|
|
230
|
+
</AlertDialogHeader>
|
|
231
|
+
<AlertDialogFooter>
|
|
232
|
+
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
233
|
+
<AlertDialogAction onClick={handleDelete}>Delete</AlertDialogAction>
|
|
234
|
+
</AlertDialogFooter>
|
|
235
|
+
</AlertDialogContent>
|
|
236
|
+
</AlertDialog>
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Page structure — always use PageHeader
|
|
240
|
+
|
|
241
|
+
Every page must use `<PageHeader>` for its title and primary actions. Never use raw `<h1>` or `<h2>`:
|
|
242
|
+
|
|
243
|
+
```tsx
|
|
244
|
+
<PageHeader>
|
|
245
|
+
<PageHeaderHeading>Users</PageHeaderHeading>
|
|
246
|
+
<PageHeaderDescription>Manage your team members.</PageHeaderDescription>
|
|
247
|
+
<Button><Plus className="size-4 mr-2" />New User</Button>
|
|
248
|
+
</PageHeader>
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Toast notifications
|
|
252
|
+
|
|
253
|
+
```tsx
|
|
254
|
+
import { toast } from 'sonner';
|
|
255
|
+
|
|
256
|
+
toast.success('User created successfully');
|
|
257
|
+
toast.error('Failed to save changes');
|
|
258
|
+
toast.warning('Session expires in 5 minutes');
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Never render `<Toaster>` manually — it is auto-injected by `<XerticaProvider>` in `App.tsx`.
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## 6. Theme & Token Customization
|
|
266
|
+
|
|
267
|
+
To change the color scheme, edit `src/styles/xertica/tokens.css`. To switch themes via CLI:
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
npx xertica-ui update
|
|
271
|
+
# → select "Theme only"
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
The token file uses HSL values and supports both light and dark modes via the `.dark` class on `<html>`.
|
|
275
|
+
|
|
276
|
+
Never import or modify anything inside `node_modules/xertica-ui/styles/` — override via `tokens.css` only.
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## 7. Authentication Pattern
|
|
281
|
+
|
|
282
|
+
The auth flow is managed in `src/app/components/AuthGuard.tsx`:
|
|
283
|
+
|
|
284
|
+
- `getStoredUser()` / `storeUser()` / `clearStoredUser()` — from `src/shared/lib/auth.ts`
|
|
285
|
+
- Auth pages (`/login`, `/forgot-password`, etc.) redirect to `/home` when user is already logged in
|
|
286
|
+
- Protected routes use `<ProtectedRoute user={user}>` wrapper that redirects to `/login` if user is null
|
|
287
|
+
- `handleLogin(email, password)` stores the user and navigates to the first protected route
|
|
288
|
+
- `handleLogout()` clears storage and navigates to `/login`
|
|
289
|
+
|
|
290
|
+
To add social login, extend `handleLogin` logic in `AuthGuard.tsx` and wire the provider button in `SocialLoginButtons.tsx`.
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## 8. AI Agent Documentation Reference
|
|
295
|
+
|
|
296
|
+
| What you need | Where to read |
|
|
297
|
+
|---|---|
|
|
298
|
+
| Quick import + rules reference | `node_modules/xertica-ui/llms-compact.txt` |
|
|
299
|
+
| Full component API | `node_modules/xertica-ui/llms-full.txt` |
|
|
300
|
+
| "Should I use Dialog or Sheet?" | `node_modules/xertica-ui/docs/decision-tree.md` |
|
|
301
|
+
| Specific component props | `node_modules/xertica-ui/docs/components/[name].md` |
|
|
302
|
+
| All components + their imports | `node_modules/xertica-ui/components.json` |
|
|
303
|
+
| Mandatory AI rules | `node_modules/xertica-ui/docs/ai-usage.md` |
|
|
304
|
+
| This project's rules (you are here) | `CLAUDE.md` at project root |
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
## 9. Development Checklist
|
|
309
|
+
|
|
310
|
+
Before completing any feature:
|
|
311
|
+
|
|
312
|
+
- [ ] Feature content is in `src/features/<name>/ui/`
|
|
313
|
+
- [ ] Feature exports via `src/features/<name>/index.ts`
|
|
314
|
+
- [ ] Page is a thin wrapper in `src/pages/`
|
|
315
|
+
- [ ] Route registered in `src/shared/config/navigation.ts`
|
|
316
|
+
- [ ] Route registered in `src/app/components/AuthGuard.tsx`
|
|
317
|
+
- [ ] Home navigation card added (if primary module)
|
|
318
|
+
- [ ] Only `xertica-ui` components used — no raw HTML elements
|
|
319
|
+
- [ ] No raw hex/rgb values — semantic tokens for semantic/status contexts; Tailwind utilities acceptable for non-semantic layout
|
|
320
|
+
- [ ] No hardcoded radii — use `rounded-[var(--radius)]`
|
|
321
|
+
- [ ] Icons from `lucide-react` only
|
|
322
|
+
- [ ] Destructive actions wrapped in `<AlertDialog>`
|
|
323
|
+
- [ ] Layout state from `useLayout()` — no hardcoded widths
|
|
324
|
+
- [ ] Toast used for action feedback (`toast.success`, `toast.error`)
|
|
325
|
+
- [ ] Responsive on mobile, tablet, and desktop
|