xertica-ui 2.1.2 → 2.1.3
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 +31 -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/bin/generate-tokens.ts +13 -7
- package/components/assistant/index.ts +6 -6
- package/components/assistant/xertica-assistant/index.ts +2 -0
- package/components/assistant/xertica-assistant/use-assistant.ts +564 -0
- package/components/assistant/xertica-assistant/xertica-assistant.stories.tsx +200 -0
- package/components/assistant/xertica-assistant/xertica-assistant.tsx +183 -474
- 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/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 +7 -7
- 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/index.ts +2 -0
- package/components/layout/sidebar/sidebar.mdx +1 -1
- package/components/layout/sidebar/sidebar.stories.tsx +160 -8
- package/components/layout/sidebar/sidebar.test.tsx +11 -11
- package/components/layout/sidebar/sidebar.tsx +610 -471
- package/components/layout/sidebar/use-sidebar.ts +113 -0
- package/components/media/FloatingMediaWrapper.tsx +11 -11
- package/components/media/audio-player/AudioPlayer.tsx +22 -22
- 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/HomePage.tsx +1 -1
- package/components/pages/home-page/home-page.mdx +53 -53
- package/components/pages/index.ts +8 -8
- package/components/pages/template-content/TemplateContent.tsx +5 -5
- 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/TemplatePage.tsx +5 -5
- 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/shared/layout-constants.ts +1 -1
- 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 -344
- package/components/ui/chart/chart.test.tsx +154 -154
- package/components/ui/chart/chart.tsx +2367 -1494
- 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.stories.tsx +100 -0
- package/components/ui/file-upload/file-upload.tsx +14 -74
- package/components/ui/file-upload/index.ts +1 -0
- package/components/ui/file-upload/use-file-upload.ts +181 -0
- 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/index.ts +2 -0
- package/components/ui/pagination/pagination.mdx +8 -8
- package/components/ui/pagination/pagination.stories.tsx +94 -0
- package/components/ui/pagination/use-pagination.ts +194 -0
- 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/index.ts +2 -0
- package/components/ui/rich-text-editor/rich-text-editor.stories.tsx +129 -1
- package/components/ui/rich-text-editor/rich-text-editor.tsx +86 -305
- package/components/ui/rich-text-editor/use-rich-text-editor.ts +439 -0
- 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/index.ts +3 -1
- package/components/ui/stepper/stepper.mdx +8 -8
- package/components/ui/stepper/stepper.stories.tsx +116 -0
- package/components/ui/stepper/stepper.tsx +4 -4
- package/components/ui/stepper/use-stepper.ts +137 -0
- 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/index.ts +4 -1
- package/components/ui/tree-view/tree-view.mdx +8 -8
- package/components/ui/tree-view/tree-view.stories.tsx +110 -4
- package/components/ui/tree-view/tree-view.tsx +17 -125
- package/components/ui/tree-view/use-tree-view.ts +229 -0
- package/components.json +1512 -1512
- package/contexts/ApiKeyContext.tsx +72 -72
- package/contexts/BrandColorsContext.tsx +26 -26
- package/contexts/LanguageContext.tsx +13 -13
- package/contexts/LayoutContext.test.tsx +11 -11
- package/contexts/LayoutContext.tsx +29 -29
- 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-BAx9VQvb.cjs → AssistantChart-CldVCVDe.cjs} +311 -94
- package/dist/{AssistantChart-CVko2A1W.js → AssistantChart-Cu3m7RBo.js} +314 -97
- package/dist/{AssistantChart-9w31gdAb.cjs → AssistantChart-DoZCyS5r.cjs} +4 -4
- package/dist/AudioPlayer-B1lt5cPl.cjs +989 -0
- package/dist/AudioPlayer-BZ7bibzU.cjs +982 -0
- package/dist/AudioPlayer-C12BjQBV.cjs +997 -0
- package/dist/AudioPlayer-DMcG_c7L.js +990 -0
- package/dist/AudioPlayer-DcFKRJE_.js +998 -0
- 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/ImageWithFallback-CGtidP6B.cjs +4542 -0
- package/dist/ImageWithFallback-lsg3pdFg.js +4508 -0
- 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-BE-L9mB7.js → VerifyEmailPage-C0c2e5n0.js} +7 -7
- package/dist/{VerifyEmailPage-DMBh4NM9.cjs → VerifyEmailPage-CYXtbKi3.cjs} +1 -1
- package/dist/{VerifyEmailPage-CR7kb5df.cjs → VerifyEmailPage-Cwi3kbol.cjs} +7 -7
- package/dist/{VerifyEmailPage-CdYPSJoO.js → VerifyEmailPage-DvMLZgFt.js} +1 -1
- package/dist/XerticaOrbe-KL1RBHzw.cjs +1354 -0
- package/dist/XerticaOrbe-zwS1p2a8.js +1355 -0
- package/dist/XerticaProvider-6btlAlzc.js +17 -0
- 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-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 +2 -1
- package/dist/assistant.es.js +3 -2
- 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 +14 -8
- package/dist/components/assistant/xertica-assistant/index.d.ts +2 -0
- package/dist/components/assistant/xertica-assistant/use-assistant.d.ts +126 -0
- package/dist/components/assistant/xertica-assistant/xertica-assistant.d.ts +7 -2
- 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/layout/sidebar/index.d.ts +2 -0
- package/dist/components/layout/sidebar/sidebar.d.ts +80 -0
- package/dist/components/layout/sidebar/use-sidebar.d.ts +22 -0
- package/dist/components/shared/layout-constants.d.ts +1 -1
- package/dist/components/ui/button/button.d.ts +1 -1
- package/dist/components/ui/chart/chart.d.ts +162 -5
- package/dist/components/ui/file-upload/file-upload.d.ts +2 -0
- package/dist/components/ui/file-upload/index.d.ts +1 -0
- package/dist/components/ui/file-upload/use-file-upload.d.ts +49 -0
- package/dist/components/ui/pagination/index.d.ts +2 -0
- package/dist/components/ui/pagination/use-pagination.d.ts +78 -0
- package/dist/components/ui/rich-text-editor/index.d.ts +2 -0
- package/dist/components/ui/rich-text-editor/use-rich-text-editor.d.ts +107 -0
- package/dist/components/ui/stepper/index.d.ts +3 -1
- package/dist/components/ui/stepper/stepper.d.ts +2 -2
- package/dist/components/ui/stepper/use-stepper.d.ts +60 -0
- package/dist/components/ui/tree-view/index.d.ts +4 -1
- package/dist/components/ui/tree-view/tree-view.d.ts +4 -6
- package/dist/components/ui/tree-view/use-tree-view.d.ts +60 -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 +1 -1
- package/dist/hooks.es.js +1 -1
- 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 +19 -8
- package/dist/index.es.js +39 -28
- 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 +89 -1
- package/dist/layout.es.js +90 -2
- package/dist/pages.cjs.js +1 -1
- package/dist/pages.es.js +1 -1
- 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-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-DgF8s7xW.js +2949 -0
- package/dist/rich-text-editor-Dxjw31Z4.js +2341 -0
- package/dist/rich-text-editor-DzP0Epmb.js +2356 -0
- package/dist/rich-text-editor-mWoaSCE4.cjs +2966 -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-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 +14 -4
- package/dist/ui.es.js +26 -16
- package/dist/use-mobile-B0hNy_Y6.cjs +4303 -0
- package/dist/use-mobile-BXuYROXM.js +4202 -0
- 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/use-mobile-CG2-SdXV.cjs +4235 -0
- 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/{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/ai-usage.md +28 -10
- package/docs/architecture.md +76 -0
- package/docs/components/assistant.md +159 -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/chart.md +354 -39
- package/docs/components/file-upload.md +119 -2
- package/docs/components/map.md +84 -84
- package/docs/components/pagination.md +187 -0
- package/docs/components/rich-text-editor.md +164 -0
- package/docs/components/sidebar.md +153 -4
- package/docs/components/stepper.md +157 -12
- package/docs/components/tree-view.md +164 -6
- package/docs/components/xertica-provider.md +24 -24
- package/docs/decision-tree.md +287 -287
- package/docs/getting-started.md +1 -1
- package/docs/guidelines.md +14 -8
- package/docs/layout.md +2 -2
- package/docs/llms.md +4 -4
- package/guidelines/Guidelines.md +252 -250
- 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/styles/xertica/tokens.css +41 -12
- package/templates/CLAUDE.md +182 -172
- package/templates/guidelines/Guidelines.md +325 -313
- package/templates/package.json +3 -3
- 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/src/styles/xertica/tokens.css +39 -10
- package/templates/tsconfig.json +5 -5
- package/utils/gemini.ts +140 -140
- package/dist/VerifyEmailPage-Bae2cBXT.cjs +0 -2827
- package/dist/VerifyEmailPage-CbgjOF0v.js +0 -2828
- package/dist/index-CkTUgOwX.js +0 -8
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { useState, useEffect, useCallback, useRef } from "react";
|
|
2
|
+
import { RouteGroup } from "./sidebar";
|
|
3
|
+
|
|
4
|
+
export interface UseSidebarProps {
|
|
5
|
+
defaultExpanded?: boolean;
|
|
6
|
+
expanded?: boolean;
|
|
7
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
8
|
+
navigationGroups?: RouteGroup[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function useSidebar({
|
|
12
|
+
defaultExpanded = true,
|
|
13
|
+
expanded: controlledExpanded,
|
|
14
|
+
onExpandedChange,
|
|
15
|
+
navigationGroups = [],
|
|
16
|
+
}: UseSidebarProps = {}) {
|
|
17
|
+
const [localExpanded, setLocalExpanded] = useState(defaultExpanded);
|
|
18
|
+
const isControlled = controlledExpanded !== undefined;
|
|
19
|
+
const expanded = isControlled ? controlledExpanded : localExpanded;
|
|
20
|
+
|
|
21
|
+
const [isMobileViewport, setIsMobileViewport] = useState(false);
|
|
22
|
+
const [hasOverflow, setHasOverflow] = useState(false);
|
|
23
|
+
const [visibleItems, setVisibleItems] = useState<RouteGroup[]>([]);
|
|
24
|
+
const [overflowItems, setOverflowItems] = useState<RouteGroup[]>([]);
|
|
25
|
+
const [openSubmenu, setOpenSubmenu] = useState<string | null>(null);
|
|
26
|
+
const [isFilterOpen, setIsFilterOpen] = useState(false);
|
|
27
|
+
|
|
28
|
+
const navRef = useRef<HTMLElement>(null);
|
|
29
|
+
|
|
30
|
+
const setExpanded = useCallback(
|
|
31
|
+
(value: boolean | ((prev: boolean) => boolean)) => {
|
|
32
|
+
const newValue = typeof value === "function" ? value(expanded) : value;
|
|
33
|
+
if (!isControlled) {
|
|
34
|
+
setLocalExpanded(newValue);
|
|
35
|
+
}
|
|
36
|
+
onExpandedChange?.(newValue);
|
|
37
|
+
},
|
|
38
|
+
[expanded, isControlled, onExpandedChange]
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const toggleExpanded = useCallback(() => {
|
|
42
|
+
setExpanded((prev) => !prev);
|
|
43
|
+
}, [setExpanded]);
|
|
44
|
+
|
|
45
|
+
// Mobile viewport detection
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
const checkViewport = () => {
|
|
48
|
+
setIsMobileViewport(window.innerWidth < 768);
|
|
49
|
+
};
|
|
50
|
+
checkViewport();
|
|
51
|
+
window.addEventListener("resize", checkViewport);
|
|
52
|
+
return () => window.removeEventListener("resize", checkViewport);
|
|
53
|
+
}, []);
|
|
54
|
+
|
|
55
|
+
// Overflow detection
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
const checkOverflow = () => {
|
|
58
|
+
if (!navRef.current || navigationGroups.length === 0) return;
|
|
59
|
+
|
|
60
|
+
const containerHeight = navRef.current.clientHeight;
|
|
61
|
+
let currentHeight = 0;
|
|
62
|
+
let visibleCount = 0;
|
|
63
|
+
|
|
64
|
+
// Approximate heights
|
|
65
|
+
const itemHeight = 40;
|
|
66
|
+
const groupHeaderHeight = 32;
|
|
67
|
+
const padding = 32;
|
|
68
|
+
|
|
69
|
+
currentHeight += padding;
|
|
70
|
+
|
|
71
|
+
for (let i = 0; i < navigationGroups.length; i++) {
|
|
72
|
+
const group = navigationGroups[i];
|
|
73
|
+
if (group.label) currentHeight += groupHeaderHeight;
|
|
74
|
+
currentHeight += group.items.length * itemHeight;
|
|
75
|
+
|
|
76
|
+
if (currentHeight > containerHeight) {
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
visibleCount++;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (visibleCount < navigationGroups.length) {
|
|
83
|
+
setHasOverflow(true);
|
|
84
|
+
setVisibleItems(navigationGroups.slice(0, visibleCount));
|
|
85
|
+
setOverflowItems(navigationGroups.slice(visibleCount));
|
|
86
|
+
} else {
|
|
87
|
+
setHasOverflow(false);
|
|
88
|
+
setVisibleItems(navigationGroups);
|
|
89
|
+
setOverflowItems([]);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
checkOverflow();
|
|
94
|
+
window.addEventListener("resize", checkOverflow);
|
|
95
|
+
return () => window.removeEventListener("resize", checkOverflow);
|
|
96
|
+
}, [navigationGroups, expanded]);
|
|
97
|
+
|
|
98
|
+
return {
|
|
99
|
+
expanded,
|
|
100
|
+
setExpanded,
|
|
101
|
+
toggleExpanded,
|
|
102
|
+
isMobileViewport,
|
|
103
|
+
hasOverflow,
|
|
104
|
+
visibleItems,
|
|
105
|
+
overflowItems,
|
|
106
|
+
openSubmenu,
|
|
107
|
+
setOpenSubmenu,
|
|
108
|
+
isFilterOpen,
|
|
109
|
+
setIsFilterOpen,
|
|
110
|
+
navRef,
|
|
111
|
+
navigationGroups,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
@@ -118,11 +118,11 @@ function FloatingContainer({
|
|
|
118
118
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
119
119
|
const resizeHandleRef = useRef<string | null>(null);
|
|
120
120
|
|
|
121
|
-
const getInitialState = useCallback(() => {
|
|
122
|
-
const storageKey = `xertica-media-player-${playerId}`;
|
|
123
|
-
const stored = typeof window !== 'undefined'
|
|
124
|
-
? window.localStorage?.getItem(storageKey)
|
|
125
|
-
: null;
|
|
121
|
+
const getInitialState = useCallback(() => {
|
|
122
|
+
const storageKey = `xertica-media-player-${playerId}`;
|
|
123
|
+
const stored = typeof window !== 'undefined'
|
|
124
|
+
? window.localStorage?.getItem(storageKey)
|
|
125
|
+
: null;
|
|
126
126
|
if (stored) {
|
|
127
127
|
try {
|
|
128
128
|
return JSON.parse(stored);
|
|
@@ -155,11 +155,11 @@ function FloatingContainer({
|
|
|
155
155
|
const dragStartOffset = useRef({ x: 0, y: 0 });
|
|
156
156
|
const resizeStartState = useRef({ position: { x: 0, y: 0 }, size: { width: 0, height: 0 } });
|
|
157
157
|
|
|
158
|
-
const saveState = useCallback((newPosition: { x: number; y: number }, newSize: { width: number; height: number }) => {
|
|
159
|
-
if (typeof window === 'undefined') return;
|
|
160
|
-
const storageKey = `xertica-media-player-${playerId}`;
|
|
161
|
-
window.localStorage?.setItem(storageKey, JSON.stringify({ position: newPosition, size: newSize }));
|
|
162
|
-
}, [playerId]);
|
|
158
|
+
const saveState = useCallback((newPosition: { x: number; y: number }, newSize: { width: number; height: number }) => {
|
|
159
|
+
if (typeof window === 'undefined') return;
|
|
160
|
+
const storageKey = `xertica-media-player-${playerId}`;
|
|
161
|
+
window.localStorage?.setItem(storageKey, JSON.stringify({ position: newPosition, size: newSize }));
|
|
162
|
+
}, [playerId]);
|
|
163
163
|
|
|
164
164
|
const handleMouseDown = (e: React.MouseEvent) => {
|
|
165
165
|
setIsDragging(true);
|
|
@@ -313,4 +313,4 @@ function FloatingContainer({
|
|
|
313
313
|
</div>
|
|
314
314
|
</div>
|
|
315
315
|
);
|
|
316
|
-
}
|
|
316
|
+
}
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
} from "../../ui/dropdown-menu";
|
|
37
37
|
import { FloatingMediaWrapper } from '../FloatingMediaWrapper';
|
|
38
38
|
import { cn } from '../../shared/utils';
|
|
39
|
-
import { useOptionalLayout } from '../../../contexts/LayoutContext';
|
|
39
|
+
import { useOptionalLayout } from '../../../contexts/LayoutContext';
|
|
40
40
|
|
|
41
41
|
export interface AudioPlayerProps {
|
|
42
42
|
/** Source URL of the audio file */
|
|
@@ -90,12 +90,12 @@ export function AudioPlayer({
|
|
|
90
90
|
enableAutoFloat = true,
|
|
91
91
|
onCloseFloating
|
|
92
92
|
}: AudioPlayerProps) {
|
|
93
|
-
const audioRef = useRef<HTMLAudioElement>(null);
|
|
94
|
-
const containerRef = useRef<HTMLDivElement>(null);
|
|
95
|
-
const layout = useOptionalLayout();
|
|
96
|
-
const sidebarExpanded = layout?.sidebarExpanded ?? false;
|
|
97
|
-
const sidebarWidth = layout?.sidebarWidth ?? 256;
|
|
98
|
-
const assistenteExpanded = layout?.assistenteExpanded ?? false;
|
|
93
|
+
const audioRef = useRef<HTMLAudioElement>(null);
|
|
94
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
95
|
+
const layout = useOptionalLayout();
|
|
96
|
+
const sidebarExpanded = layout?.sidebarExpanded ?? false;
|
|
97
|
+
const sidebarWidth = layout?.sidebarWidth ?? 256;
|
|
98
|
+
const assistenteExpanded = layout?.assistenteExpanded ?? false;
|
|
99
99
|
|
|
100
100
|
const [isPlaying, setIsPlaying] = useState(false);
|
|
101
101
|
const [volume, setVolume] = useState(0.8);
|
|
@@ -109,10 +109,10 @@ export function AudioPlayer({
|
|
|
109
109
|
const [isMobile, setIsMobile] = useState(false);
|
|
110
110
|
const [playbackSpeed, setPlaybackSpeed] = useState(1);
|
|
111
111
|
|
|
112
|
-
// Mobile detection
|
|
113
|
-
useEffect(() => {
|
|
114
|
-
if (typeof window === 'undefined') return;
|
|
115
|
-
const checkMobile = () => setIsMobile(window.innerWidth < 768);
|
|
112
|
+
// Mobile detection
|
|
113
|
+
useEffect(() => {
|
|
114
|
+
if (typeof window === 'undefined') return;
|
|
115
|
+
const checkMobile = () => setIsMobile(window.innerWidth < 768);
|
|
116
116
|
checkMobile();
|
|
117
117
|
window.addEventListener('resize', checkMobile);
|
|
118
118
|
return () => window.removeEventListener('resize', checkMobile);
|
|
@@ -290,11 +290,11 @@ export function AudioPlayer({
|
|
|
290
290
|
{/* Right: Actions */}
|
|
291
291
|
<div className="flex items-center gap-2 shrink-0 relative z-10">
|
|
292
292
|
<div className="hidden lg:flex items-center gap-2 w-28 mr-2 group">
|
|
293
|
-
<button
|
|
294
|
-
onClick={toggleMute}
|
|
295
|
-
className="text-muted-foreground hover:text-foreground"
|
|
296
|
-
aria-label={isMuted || volume === 0 ? "Ativar som" : "Desativar som"}
|
|
297
|
-
>
|
|
293
|
+
<button
|
|
294
|
+
onClick={toggleMute}
|
|
295
|
+
className="text-muted-foreground hover:text-foreground"
|
|
296
|
+
aria-label={isMuted || volume === 0 ? "Ativar som" : "Desativar som"}
|
|
297
|
+
>
|
|
298
298
|
{isMuted || volume === 0 ? <VolumeX className="w-5 h-5" /> : <Volume2 className="w-5 h-5" />}
|
|
299
299
|
</button>
|
|
300
300
|
<Slider
|
|
@@ -310,7 +310,7 @@ export function AudioPlayer({
|
|
|
310
310
|
<TooltipProvider>
|
|
311
311
|
<Tooltip>
|
|
312
312
|
<TooltipTrigger asChild>
|
|
313
|
-
<Button variant="ghost" size="icon" className="rounded-full h-9 w-9" onClick={() => { if (audioRef.current) audioRef.current.currentTime = 0; }} aria-label="Recomecar audio">
|
|
313
|
+
<Button variant="ghost" size="icon" className="rounded-full h-9 w-9" onClick={() => { if (audioRef.current) audioRef.current.currentTime = 0; }} aria-label="Recomecar audio">
|
|
314
314
|
<RotateCcw className="w-4 h-4" />
|
|
315
315
|
</Button>
|
|
316
316
|
</TooltipTrigger>
|
|
@@ -321,7 +321,7 @@ export function AudioPlayer({
|
|
|
321
321
|
<TooltipProvider>
|
|
322
322
|
<Tooltip>
|
|
323
323
|
<TooltipTrigger asChild>
|
|
324
|
-
<Button variant="ghost" size="icon" className="text-[var(--chart-3)] hover:bg-accent rounded-full h-9 w-9" aria-label="Informacoes do audio">
|
|
324
|
+
<Button variant="ghost" size="icon" className="text-[var(--chart-3)] hover:bg-accent rounded-full h-9 w-9" aria-label="Informacoes do audio">
|
|
325
325
|
<Info className="w-4 h-4 fill-current" />
|
|
326
326
|
</Button>
|
|
327
327
|
</TooltipTrigger>
|
|
@@ -333,7 +333,7 @@ export function AudioPlayer({
|
|
|
333
333
|
<div className="hidden xl:flex items-center gap-1">
|
|
334
334
|
<DropdownMenu>
|
|
335
335
|
<DropdownMenuTrigger asChild>
|
|
336
|
-
<Button variant="ghost" size="icon" className="rounded-full h-9 w-9" aria-label="Selecionar velocidade">
|
|
336
|
+
<Button variant="ghost" size="icon" className="rounded-full h-9 w-9" aria-label="Selecionar velocidade">
|
|
337
337
|
<Gauge className="w-4 h-4" />
|
|
338
338
|
</Button>
|
|
339
339
|
</DropdownMenuTrigger>
|
|
@@ -353,7 +353,7 @@ export function AudioPlayer({
|
|
|
353
353
|
<TooltipProvider>
|
|
354
354
|
<Tooltip>
|
|
355
355
|
<TooltipTrigger asChild>
|
|
356
|
-
<Button variant="ghost" size="icon" className="rounded-full h-9 w-9" aria-label="Baixar audio">
|
|
356
|
+
<Button variant="ghost" size="icon" className="rounded-full h-9 w-9" aria-label="Baixar audio">
|
|
357
357
|
<Download className="w-4 h-4" />
|
|
358
358
|
</Button>
|
|
359
359
|
</TooltipTrigger>
|
|
@@ -365,7 +365,7 @@ export function AudioPlayer({
|
|
|
365
365
|
<div className="xl:hidden">
|
|
366
366
|
<DropdownMenu>
|
|
367
367
|
<DropdownMenuTrigger asChild>
|
|
368
|
-
<Button variant="ghost" size="icon" className="rounded-full h-9 w-9" aria-label="Mais opcoes">
|
|
368
|
+
<Button variant="ghost" size="icon" className="rounded-full h-9 w-9" aria-label="Mais opcoes">
|
|
369
369
|
<MoreHorizontal className="w-5 h-5" />
|
|
370
370
|
</Button>
|
|
371
371
|
</DropdownMenuTrigger>
|
|
@@ -475,7 +475,7 @@ export function AudioPlayer({
|
|
|
475
475
|
|
|
476
476
|
<DropdownMenu>
|
|
477
477
|
<DropdownMenuTrigger asChild>
|
|
478
|
-
<Button variant="ghost" size="icon" className="h-9 w-9 rounded-full" aria-label="Mais opcoes">
|
|
478
|
+
<Button variant="ghost" size="icon" className="h-9 w-9 rounded-full" aria-label="Mais opcoes">
|
|
479
479
|
<MoreVertical className="w-5 h-5" />
|
|
480
480
|
</Button>
|
|
481
481
|
</DropdownMenuTrigger>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './video-player';
|
|
2
|
-
export * from './audio-player';
|
|
3
|
-
export { FloatingMediaWrapper } from './FloatingMediaWrapper';
|
|
1
|
+
export * from './video-player';
|
|
2
|
+
export * from './audio-player';
|
|
3
|
+
export { FloatingMediaWrapper } from './FloatingMediaWrapper';
|
|
@@ -11,7 +11,7 @@ import { LanguageSelector } from '../../brand/language-selector';
|
|
|
11
11
|
import { Badge } from '../../ui/badge';
|
|
12
12
|
import { PageHeader } from '../../ui/page-header';
|
|
13
13
|
|
|
14
|
-
import { useOptionalLayout } from '../../../contexts/LayoutContext';
|
|
14
|
+
import { useOptionalLayout } from '../../../contexts/LayoutContext';
|
|
15
15
|
import {
|
|
16
16
|
SIDEBAR_EXPANDED_WIDTH,
|
|
17
17
|
SIDEBAR_COLLAPSED_WIDTH
|
|
@@ -39,11 +39,11 @@ interface HomeContentProps {
|
|
|
39
39
|
* 2. Navigation: Use the `navigate` function for routing between dashboard features.
|
|
40
40
|
* 3. i18n: Currently uses a local `labelTranslations` map for breadcrumbs.
|
|
41
41
|
*/
|
|
42
|
-
export function HomeContent({ user, onLogout, onSettings }: HomeContentProps) {
|
|
43
|
-
const layout = useOptionalLayout();
|
|
44
|
-
const sidebarExpanded = layout?.sidebarExpanded ?? false;
|
|
45
|
-
const sidebarWidth = layout?.sidebarWidth ?? 256;
|
|
46
|
-
const location = useLocation();
|
|
42
|
+
export function HomeContent({ user, onLogout, onSettings }: HomeContentProps) {
|
|
43
|
+
const layout = useOptionalLayout();
|
|
44
|
+
const sidebarExpanded = layout?.sidebarExpanded ?? false;
|
|
45
|
+
const sidebarWidth = layout?.sidebarWidth ?? 256;
|
|
46
|
+
const location = useLocation();
|
|
47
47
|
const navigate = useNavigate();
|
|
48
48
|
|
|
49
49
|
// Direct translation for interface labels
|
|
@@ -124,4 +124,4 @@ export function HomeContent({ user, onLogout, onSettings }: HomeContentProps) {
|
|
|
124
124
|
</main>
|
|
125
125
|
</div>
|
|
126
126
|
);
|
|
127
|
-
}
|
|
127
|
+
}
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import { Meta, Title, Subtitle } from '@storybook/addon-docs/blocks';
|
|
2
|
-
|
|
3
|
-
<Meta title="Pages/HomeContent" />
|
|
4
|
-
|
|
5
|
-
<Title>HomeContent</Title>
|
|
6
|
-
<Subtitle>Main dashboard landing area with breadcrumb header and feature card grid.</Subtitle>
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## Overview
|
|
11
|
-
|
|
12
|
-
`HomeContent` is the top-level content component for the application's home/dashboard route. It renders:
|
|
13
|
-
|
|
14
|
-
- A sticky `Header` with breadcrumbs and optional theme/language controls.
|
|
15
|
-
- A `PageHeader` welcoming the user.
|
|
16
|
-
- A responsive card grid for navigating to application features.
|
|
17
|
-
|
|
18
|
-
It reads sidebar state from `LayoutContext` when available and falls back to safe local defaults when rendered outside `XerticaProvider`.
|
|
19
|
-
|
|
20
|
-
**Requires:** React Router v6. `XerticaProvider` is recommended for synchronized layout state, but no longer required for rendering.
|
|
21
|
-
|
|
22
|
-
```tsx
|
|
23
|
-
import { HomeContent } from 'xertica-ui';
|
|
24
|
-
|
|
25
|
-
<HomeContent user={currentUser} onLogout={handleLogout} />
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## Props
|
|
31
|
-
|
|
32
|
-
| Prop | Type | Default | Description |
|
|
33
|
-
|---|---|---|---|
|
|
34
|
-
| `user` | `{ name?: string; email?: string; avatar?: string } \| null` | - | Currently authenticated user. Passed to the header for display. |
|
|
35
|
-
| `onLogout` | `() => void` | - | Called when the user triggers logout from the header. |
|
|
36
|
-
| `onSettings` | `() => void` | - | Called when the user opens account settings from the header. |
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## Layout Dependency
|
|
41
|
-
|
|
42
|
-
`HomeContent` uses optional layout state. When wrapped in `XerticaProvider`, it synchronizes with the global sidebar width and expanded state. Without the provider, it renders using collapsed-sidebar defaults.
|
|
43
|
-
|
|
44
|
-
```tsx
|
|
45
|
-
// Recommended - synchronized app layout
|
|
46
|
-
<XerticaProvider>
|
|
47
|
-
<HomeContent />
|
|
48
|
-
</XerticaProvider>
|
|
49
|
-
|
|
50
|
-
// Also safe - uses local fallback layout values
|
|
51
|
-
<HomeContent />
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
---
|
|
55
|
-
|
|
56
|
-
## AI Best Practices
|
|
57
|
-
|
|
58
|
-
> [!IMPORTANT]
|
|
59
|
-
> - **Provider fallback** - `HomeContent` renders without `XerticaProvider`, but the provider is recommended for synchronized sidebar state.
|
|
60
|
-
> - **Feature cards** - The card grid is currently hardcoded to the "Template CLI" feature. To add cards, fork the component and extend the grid section.
|
|
61
|
-
> - **Breadcrumbs** - Breadcrumb labels are resolved via a local `labelTranslations` map and `getRouteByPath`. Ensure your route definitions include a `label` field for correct breadcrumb rendering.
|
|
62
|
-
> - **Background color** - The outer container uses `bg-muted` from the design system tokens. Override with `className` if a different background is needed.
|
|
1
|
+
import { Meta, Title, Subtitle } from '@storybook/addon-docs/blocks';
|
|
2
|
+
|
|
3
|
+
<Meta title="Pages/HomeContent" />
|
|
4
|
+
|
|
5
|
+
<Title>HomeContent</Title>
|
|
6
|
+
<Subtitle>Main dashboard landing area with breadcrumb header and feature card grid.</Subtitle>
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
`HomeContent` is the top-level content component for the application's home/dashboard route. It renders:
|
|
13
|
+
|
|
14
|
+
- A sticky `Header` with breadcrumbs and optional theme/language controls.
|
|
15
|
+
- A `PageHeader` welcoming the user.
|
|
16
|
+
- A responsive card grid for navigating to application features.
|
|
17
|
+
|
|
18
|
+
It reads sidebar state from `LayoutContext` when available and falls back to safe local defaults when rendered outside `XerticaProvider`.
|
|
19
|
+
|
|
20
|
+
**Requires:** React Router v6. `XerticaProvider` is recommended for synchronized layout state, but no longer required for rendering.
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import { HomeContent } from 'xertica-ui';
|
|
24
|
+
|
|
25
|
+
<HomeContent user={currentUser} onLogout={handleLogout} />
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Props
|
|
31
|
+
|
|
32
|
+
| Prop | Type | Default | Description |
|
|
33
|
+
|---|---|---|---|
|
|
34
|
+
| `user` | `{ name?: string; email?: string; avatar?: string } \| null` | - | Currently authenticated user. Passed to the header for display. |
|
|
35
|
+
| `onLogout` | `() => void` | - | Called when the user triggers logout from the header. |
|
|
36
|
+
| `onSettings` | `() => void` | - | Called when the user opens account settings from the header. |
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Layout Dependency
|
|
41
|
+
|
|
42
|
+
`HomeContent` uses optional layout state. When wrapped in `XerticaProvider`, it synchronizes with the global sidebar width and expanded state. Without the provider, it renders using collapsed-sidebar defaults.
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
// Recommended - synchronized app layout
|
|
46
|
+
<XerticaProvider>
|
|
47
|
+
<HomeContent />
|
|
48
|
+
</XerticaProvider>
|
|
49
|
+
|
|
50
|
+
// Also safe - uses local fallback layout values
|
|
51
|
+
<HomeContent />
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## AI Best Practices
|
|
57
|
+
|
|
58
|
+
> [!IMPORTANT]
|
|
59
|
+
> - **Provider fallback** - `HomeContent` renders without `XerticaProvider`, but the provider is recommended for synchronized sidebar state.
|
|
60
|
+
> - **Feature cards** - The card grid is currently hardcoded to the "Template CLI" feature. To add cards, fork the component and extend the grid section.
|
|
61
|
+
> - **Breadcrumbs** - Breadcrumb labels are resolved via a local `labelTranslations` map and `getRouteByPath`. Ensure your route definitions include a `label` field for correct breadcrumb rendering.
|
|
62
|
+
> - **Background color** - The outer container uses `bg-muted` from the design system tokens. Override with `className` if a different background is needed.
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { HomePage } from './HomePage';
|
|
3
|
-
import { MemoryRouter } from 'react-router-dom';
|
|
4
|
-
import { LayoutProvider } from '../../../contexts/LayoutContext';
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
const meta: Meta<typeof HomePage> = {
|
|
8
|
-
title: 'Pages/HomePage',
|
|
9
|
-
component: HomePage,
|
|
10
|
-
decorators: [
|
|
11
|
-
(Story) => (
|
|
12
|
-
<MemoryRouter initialEntries={['/home']}>
|
|
13
|
-
<LayoutProvider>
|
|
14
|
-
<Story />
|
|
15
|
-
</LayoutProvider>
|
|
16
|
-
</MemoryRouter>
|
|
17
|
-
),
|
|
18
|
-
],
|
|
19
|
-
parameters: {
|
|
20
|
-
layout: 'fullscreen',
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default meta;
|
|
25
|
-
type Story = StoryObj<typeof HomePage>;
|
|
26
|
-
|
|
27
|
-
export const Default: Story = {
|
|
28
|
-
args: {
|
|
29
|
-
user: { email: 'ariel@xertica.com' },
|
|
30
|
-
onLogout: () => {},
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const NoUser: Story = {
|
|
35
|
-
args: {
|
|
36
|
-
user: null,
|
|
37
|
-
onLogout: () => {},
|
|
38
|
-
},
|
|
39
|
-
};
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { HomePage } from './HomePage';
|
|
3
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
4
|
+
import { LayoutProvider } from '../../../contexts/LayoutContext';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof HomePage> = {
|
|
8
|
+
title: 'Pages/HomePage',
|
|
9
|
+
component: HomePage,
|
|
10
|
+
decorators: [
|
|
11
|
+
(Story) => (
|
|
12
|
+
<MemoryRouter initialEntries={['/home']}>
|
|
13
|
+
<LayoutProvider>
|
|
14
|
+
<Story />
|
|
15
|
+
</LayoutProvider>
|
|
16
|
+
</MemoryRouter>
|
|
17
|
+
),
|
|
18
|
+
],
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: 'fullscreen',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default meta;
|
|
25
|
+
type Story = StoryObj<typeof HomePage>;
|
|
26
|
+
|
|
27
|
+
export const Default: Story = {
|
|
28
|
+
args: {
|
|
29
|
+
user: { email: 'ariel@xertica.com' },
|
|
30
|
+
onLogout: () => {},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const NoUser: Story = {
|
|
35
|
+
args: {
|
|
36
|
+
user: null,
|
|
37
|
+
onLogout: () => {},
|
|
38
|
+
},
|
|
39
|
+
};
|
|
@@ -48,7 +48,7 @@ export function HomePage({ user, onLogout }: HomePageProps) {
|
|
|
48
48
|
const [localSidebarExpanded, setLocalSidebarExpanded] = React.useState(false);
|
|
49
49
|
const [localAssistantExpanded, setLocalAssistantExpanded] = React.useState(false);
|
|
50
50
|
const sidebarExpanded = layout?.sidebarExpanded ?? localSidebarExpanded;
|
|
51
|
-
const sidebarWidth = layout?.sidebarWidth ??
|
|
51
|
+
const sidebarWidth = layout?.sidebarWidth ?? 280;
|
|
52
52
|
const assistenteExpanded = layout?.assistenteExpanded ?? localAssistantExpanded;
|
|
53
53
|
const toggleSidebar = layout?.toggleSidebar ?? (() => setLocalSidebarExpanded((value) => !value));
|
|
54
54
|
const toggleAssistente = layout?.toggleAssistente ?? (() => setLocalAssistantExpanded((value) => !value));
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { Meta, Title, Subtitle } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import * as HomePageStories from './HomePage.stories';
|
|
3
|
-
|
|
4
|
-
<Meta of={HomePageStories} />
|
|
5
|
-
|
|
6
|
-
<Title>HomePage</Title>
|
|
7
|
-
<Subtitle>Full application shell composed from Sidebar, HomeContent, and XerticaAssistant.</Subtitle>
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## Overview
|
|
12
|
-
|
|
13
|
-
`HomePage` is the root authenticated page. It assembles the three major layout pillars:
|
|
14
|
-
|
|
15
|
-
- **Sidebar** - Primary navigation.
|
|
16
|
-
- **HomeContent** - Dashboard area with breadcrumb header and feature card grid.
|
|
17
|
-
- **XerticaAssistant** - Floating AI assistant panel.
|
|
18
|
-
|
|
19
|
-
When `XerticaProvider` is present, the page synchronizes sidebar width, sidebar expansion, and assistant visibility through `LayoutContext`. Without the provider, it renders with local fallback layout state.
|
|
20
|
-
|
|
21
|
-
**Requires:** React Router v6. `XerticaProvider` is recommended for app-level synchronization.
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Props
|
|
26
|
-
|
|
27
|
-
| Prop | Type | Required | Description |
|
|
28
|
-
|---|---|---|---|
|
|
29
|
-
| `user` | `{ email: string } \| null` | Yes | Currently authenticated user. Passed to Sidebar and HomeContent for display. |
|
|
30
|
-
| `onLogout` | `() => void` | Yes | Called when the user triggers logout from the Sidebar or Header. |
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## Composition
|
|
35
|
-
|
|
36
|
-
```tsx
|
|
37
|
-
import { HomePage } from 'xertica-ui';
|
|
38
|
-
|
|
39
|
-
<Route
|
|
40
|
-
path="/home"
|
|
41
|
-
element={<HomePage user={currentUser} onLogout={handleLogout} />}
|
|
42
|
-
/>
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## AI Best Practices
|
|
48
|
-
|
|
49
|
-
> [!IMPORTANT]
|
|
50
|
-
> - **Top-level only** - `HomePage` is a full-screen layout component. Do not nest it inside other layouts.
|
|
51
|
-
> - **No logic here** - Keep business logic in `HomeContent` or lower-level components.
|
|
52
|
-
> - **Provider fallback** - The page renders without `XerticaProvider`, but the provider is recommended for synchronized app layout.
|
|
53
|
-
> - **Extend via HomeContent** - To add dashboard sections, edit `HomeContent`, not `HomePage`.
|
|
1
|
+
import { Meta, Title, Subtitle } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import * as HomePageStories from './HomePage.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={HomePageStories} />
|
|
5
|
+
|
|
6
|
+
<Title>HomePage</Title>
|
|
7
|
+
<Subtitle>Full application shell composed from Sidebar, HomeContent, and XerticaAssistant.</Subtitle>
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
`HomePage` is the root authenticated page. It assembles the three major layout pillars:
|
|
14
|
+
|
|
15
|
+
- **Sidebar** - Primary navigation.
|
|
16
|
+
- **HomeContent** - Dashboard area with breadcrumb header and feature card grid.
|
|
17
|
+
- **XerticaAssistant** - Floating AI assistant panel.
|
|
18
|
+
|
|
19
|
+
When `XerticaProvider` is present, the page synchronizes sidebar width, sidebar expansion, and assistant visibility through `LayoutContext`. Without the provider, it renders with local fallback layout state.
|
|
20
|
+
|
|
21
|
+
**Requires:** React Router v6. `XerticaProvider` is recommended for app-level synchronization.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| Prop | Type | Required | Description |
|
|
28
|
+
|---|---|---|---|
|
|
29
|
+
| `user` | `{ email: string } \| null` | Yes | Currently authenticated user. Passed to Sidebar and HomeContent for display. |
|
|
30
|
+
| `onLogout` | `() => void` | Yes | Called when the user triggers logout from the Sidebar or Header. |
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Composition
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { HomePage } from 'xertica-ui';
|
|
38
|
+
|
|
39
|
+
<Route
|
|
40
|
+
path="/home"
|
|
41
|
+
element={<HomePage user={currentUser} onLogout={handleLogout} />}
|
|
42
|
+
/>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## AI Best Practices
|
|
48
|
+
|
|
49
|
+
> [!IMPORTANT]
|
|
50
|
+
> - **Top-level only** - `HomePage` is a full-screen layout component. Do not nest it inside other layouts.
|
|
51
|
+
> - **No logic here** - Keep business logic in `HomeContent` or lower-level components.
|
|
52
|
+
> - **Provider fallback** - The page renders without `XerticaProvider`, but the provider is recommended for synchronized app layout.
|
|
53
|
+
> - **Extend via HomeContent** - To add dashboard sections, edit `HomeContent`, not `HomePage`.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from './forgot-password-page';
|
|
2
|
-
export * from './home-content';
|
|
3
|
-
export * from './home-page';
|
|
4
|
-
export * from './login-page';
|
|
5
|
-
export * from './reset-password-page';
|
|
6
|
-
export * from './template-content';
|
|
7
|
-
export * from './template-page';
|
|
8
|
-
export * from './verify-email-page';
|
|
1
|
+
export * from './forgot-password-page';
|
|
2
|
+
export * from './home-content';
|
|
3
|
+
export * from './home-page';
|
|
4
|
+
export * from './login-page';
|
|
5
|
+
export * from './reset-password-page';
|
|
6
|
+
export * from './template-content';
|
|
7
|
+
export * from './template-page';
|
|
8
|
+
export * from './verify-email-page';
|