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
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { Card, CardHeader, CardTitle, CardContent, CardAction } from "../../ui/card"
|
|
5
|
-
import { Avatar, AvatarFallback, AvatarImage } from "../../ui/avatar"
|
|
6
|
-
import { Badge } from "../../ui/badge"
|
|
7
|
-
import { cn } from "../../shared/utils"
|
|
8
|
-
|
|
9
|
-
export interface ActivityItem {
|
|
10
|
-
id: string
|
|
11
|
-
user: { name: string; avatar?: string; initials: string }
|
|
12
|
-
action: string
|
|
13
|
-
target: string
|
|
14
|
-
time: string
|
|
15
|
-
type?: "create" | "update" | "delete" | "comment" | "deploy"
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface ActivityCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
19
|
-
title?: string
|
|
20
|
-
items: ActivityItem[]
|
|
21
|
-
action?: React.ReactNode
|
|
22
|
-
maxItems?: number
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const activityTypeBadge: Record<NonNullable<ActivityItem["type"]>, { label: string; variant: React.ComponentProps<typeof Badge>["variant"] }> = {
|
|
26
|
-
create: { label: "Criado", variant: "success" },
|
|
27
|
-
update: { label: "Atualizado", variant: "info" },
|
|
28
|
-
delete: { label: "Removido", variant: "destructive" },
|
|
29
|
-
comment: { label: "Comentou", variant: "secondary" },
|
|
30
|
-
deploy: { label: "Deploy", variant: "default" },
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export function ActivityCard({ title = "Atividade Recente", items, action, maxItems = 5, className, ...props }: ActivityCardProps) {
|
|
34
|
-
const visible = items.slice(0, maxItems)
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<Card className={cn("w-full", className)} {...props}>
|
|
38
|
-
<CardHeader>
|
|
39
|
-
<CardTitle>{title}</CardTitle>
|
|
40
|
-
{action && <CardAction>{action}</CardAction>}
|
|
41
|
-
</CardHeader>
|
|
42
|
-
<CardContent className="px-6 pb-6">
|
|
43
|
-
<ul className="space-y-4">
|
|
44
|
-
{visible.map((item) => {
|
|
45
|
-
const badge = item.type ? activityTypeBadge[item.type] : null
|
|
46
|
-
return (
|
|
47
|
-
<li key={item.id} className="flex items-start gap-3">
|
|
48
|
-
<Avatar className="size-8 shrink-0">
|
|
49
|
-
{item.user.avatar && <AvatarImage src={item.user.avatar} alt={item.user.name} />}
|
|
50
|
-
<AvatarFallback className="text-xs">{item.user.initials}</AvatarFallback>
|
|
51
|
-
</Avatar>
|
|
52
|
-
<div className="flex-1 min-w-0">
|
|
53
|
-
<p className="text-sm leading-snug">
|
|
54
|
-
<span className="font-medium">{item.user.name}</span>
|
|
55
|
-
{" "}{item.action}{" "}
|
|
56
|
-
<span className="font-medium">{item.target}</span>
|
|
57
|
-
</p>
|
|
58
|
-
<p className="text-xs text-muted-foreground mt-0.5">{item.time}</p>
|
|
59
|
-
</div>
|
|
60
|
-
{badge && (
|
|
61
|
-
<Badge variant={badge.variant} className="shrink-0 text-xs">
|
|
62
|
-
{badge.label}
|
|
63
|
-
</Badge>
|
|
64
|
-
)}
|
|
65
|
-
</li>
|
|
66
|
-
)
|
|
67
|
-
})}
|
|
68
|
-
</ul>
|
|
69
|
-
</CardContent>
|
|
70
|
-
</Card>
|
|
71
|
-
)
|
|
72
|
-
}
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Card, CardHeader, CardTitle, CardContent, CardAction } from "../../ui/card"
|
|
5
|
+
import { Avatar, AvatarFallback, AvatarImage } from "../../ui/avatar"
|
|
6
|
+
import { Badge } from "../../ui/badge"
|
|
7
|
+
import { cn } from "../../shared/utils"
|
|
8
|
+
|
|
9
|
+
export interface ActivityItem {
|
|
10
|
+
id: string
|
|
11
|
+
user: { name: string; avatar?: string; initials: string }
|
|
12
|
+
action: string
|
|
13
|
+
target: string
|
|
14
|
+
time: string
|
|
15
|
+
type?: "create" | "update" | "delete" | "comment" | "deploy"
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ActivityCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
19
|
+
title?: string
|
|
20
|
+
items: ActivityItem[]
|
|
21
|
+
action?: React.ReactNode
|
|
22
|
+
maxItems?: number
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const activityTypeBadge: Record<NonNullable<ActivityItem["type"]>, { label: string; variant: React.ComponentProps<typeof Badge>["variant"] }> = {
|
|
26
|
+
create: { label: "Criado", variant: "success" },
|
|
27
|
+
update: { label: "Atualizado", variant: "info" },
|
|
28
|
+
delete: { label: "Removido", variant: "destructive" },
|
|
29
|
+
comment: { label: "Comentou", variant: "secondary" },
|
|
30
|
+
deploy: { label: "Deploy", variant: "default" },
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function ActivityCard({ title = "Atividade Recente", items, action, maxItems = 5, className, ...props }: ActivityCardProps) {
|
|
34
|
+
const visible = items.slice(0, maxItems)
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Card className={cn("w-full", className)} {...props}>
|
|
38
|
+
<CardHeader>
|
|
39
|
+
<CardTitle>{title}</CardTitle>
|
|
40
|
+
{action && <CardAction>{action}</CardAction>}
|
|
41
|
+
</CardHeader>
|
|
42
|
+
<CardContent className="px-6 pb-6">
|
|
43
|
+
<ul className="space-y-4">
|
|
44
|
+
{visible.map((item) => {
|
|
45
|
+
const badge = item.type ? activityTypeBadge[item.type] : null
|
|
46
|
+
return (
|
|
47
|
+
<li key={item.id} className="flex items-start gap-3">
|
|
48
|
+
<Avatar className="size-8 shrink-0">
|
|
49
|
+
{item.user.avatar && <AvatarImage src={item.user.avatar} alt={item.user.name} />}
|
|
50
|
+
<AvatarFallback className="text-xs">{item.user.initials}</AvatarFallback>
|
|
51
|
+
</Avatar>
|
|
52
|
+
<div className="flex-1 min-w-0">
|
|
53
|
+
<p className="text-sm leading-snug">
|
|
54
|
+
<span className="font-medium">{item.user.name}</span>
|
|
55
|
+
{" "}{item.action}{" "}
|
|
56
|
+
<span className="font-medium">{item.target}</span>
|
|
57
|
+
</p>
|
|
58
|
+
<p className="text-xs text-muted-foreground mt-0.5">{item.time}</p>
|
|
59
|
+
</div>
|
|
60
|
+
{badge && (
|
|
61
|
+
<Badge variant={badge.variant} className="shrink-0 text-xs">
|
|
62
|
+
{badge.label}
|
|
63
|
+
</Badge>
|
|
64
|
+
)}
|
|
65
|
+
</li>
|
|
66
|
+
)
|
|
67
|
+
})}
|
|
68
|
+
</ul>
|
|
69
|
+
</CardContent>
|
|
70
|
+
</Card>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from "../../ui/card"
|
|
5
|
-
import { Button } from "../../ui/button"
|
|
6
|
-
import { Badge } from "../../ui/badge"
|
|
7
|
-
import { cn } from "../../shared/utils"
|
|
8
|
-
|
|
9
|
-
export type FeatureCardColor =
|
|
10
|
-
| "primary"
|
|
11
|
-
| "chart-1"
|
|
12
|
-
| "chart-2"
|
|
13
|
-
| "chart-3"
|
|
14
|
-
| "chart-4"
|
|
15
|
-
| "chart-5"
|
|
16
|
-
| "success"
|
|
17
|
-
| "info"
|
|
18
|
-
| "warning"
|
|
19
|
-
| "destructive"
|
|
20
|
-
|
|
21
|
-
const colorTokens: Record<FeatureCardColor, { bg: string; icon: string }> = {
|
|
22
|
-
primary: { bg: "bg-primary/10", icon: "text-primary" },
|
|
23
|
-
"chart-1": { bg: "bg-[var(--chart-1)]/15", icon: "text-[var(--chart-1)]" },
|
|
24
|
-
"chart-2": { bg: "bg-[var(--chart-2)]/15", icon: "text-[var(--chart-2)]" },
|
|
25
|
-
"chart-3": { bg: "bg-[var(--chart-3)]/15", icon: "text-[var(--chart-3)]" },
|
|
26
|
-
"chart-4": { bg: "bg-[var(--chart-4)]/15", icon: "text-[var(--chart-4)]" },
|
|
27
|
-
"chart-5": { bg: "bg-[var(--chart-5)]/15", icon: "text-[var(--chart-5)]" },
|
|
28
|
-
success: { bg: "bg-success/10", icon: "text-success" },
|
|
29
|
-
info: { bg: "bg-info/10", icon: "text-info" },
|
|
30
|
-
warning: { bg: "bg-warning/10", icon: "text-warning" },
|
|
31
|
-
destructive: { bg: "bg-destructive/10", icon: "text-destructive" },
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface FeatureCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
35
|
-
title: string
|
|
36
|
-
description: string
|
|
37
|
-
icon: React.ReactNode
|
|
38
|
-
color?: FeatureCardColor
|
|
39
|
-
badge?: string
|
|
40
|
-
badgeVariant?: React.ComponentProps<typeof Badge>["variant"]
|
|
41
|
-
actionLabel?: string
|
|
42
|
-
actionVariant?: React.ComponentProps<typeof Button>["variant"]
|
|
43
|
-
onAction?: () => void
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export function FeatureCard({
|
|
47
|
-
title,
|
|
48
|
-
description,
|
|
49
|
-
icon,
|
|
50
|
-
color = "primary",
|
|
51
|
-
badge,
|
|
52
|
-
badgeVariant = "default",
|
|
53
|
-
actionLabel,
|
|
54
|
-
actionVariant = "outline",
|
|
55
|
-
onAction,
|
|
56
|
-
className,
|
|
57
|
-
...props
|
|
58
|
-
}: FeatureCardProps) {
|
|
59
|
-
const { bg, icon: iconColor } = colorTokens[color]
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<Card
|
|
63
|
-
className={cn(
|
|
64
|
-
"flex flex-col h-full hover:shadow-md transition-shadow duration-200",
|
|
65
|
-
className,
|
|
66
|
-
)}
|
|
67
|
-
{...props}
|
|
68
|
-
>
|
|
69
|
-
<CardHeader>
|
|
70
|
-
<div className="flex items-center gap-3">
|
|
71
|
-
<div className={cn("p-2 rounded-[var(--radius)] shrink-0", bg)}>
|
|
72
|
-
<div className={cn("size-6 flex items-center justify-center [&>svg]:size-6", iconColor)}>
|
|
73
|
-
{icon}
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
<div className="flex flex-wrap items-center gap-x-2 gap-y-1 min-w-0">
|
|
77
|
-
<CardTitle className="text-sm">{title}</CardTitle>
|
|
78
|
-
{badge && (
|
|
79
|
-
<Badge variant={badgeVariant} className="text-xs">
|
|
80
|
-
{badge}
|
|
81
|
-
</Badge>
|
|
82
|
-
)}
|
|
83
|
-
</div>
|
|
84
|
-
</div>
|
|
85
|
-
</CardHeader>
|
|
86
|
-
|
|
87
|
-
<CardContent className="flex-1">
|
|
88
|
-
<CardDescription className="text-sm leading-relaxed">{description}</CardDescription>
|
|
89
|
-
</CardContent>
|
|
90
|
-
|
|
91
|
-
{actionLabel && (
|
|
92
|
-
<CardFooter>
|
|
93
|
-
<Button variant={actionVariant} className="w-full" onClick={onAction}>
|
|
94
|
-
{actionLabel}
|
|
95
|
-
</Button>
|
|
96
|
-
</CardFooter>
|
|
97
|
-
)}
|
|
98
|
-
</Card>
|
|
99
|
-
)
|
|
100
|
-
}
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from "../../ui/card"
|
|
5
|
+
import { Button } from "../../ui/button"
|
|
6
|
+
import { Badge } from "../../ui/badge"
|
|
7
|
+
import { cn } from "../../shared/utils"
|
|
8
|
+
|
|
9
|
+
export type FeatureCardColor =
|
|
10
|
+
| "primary"
|
|
11
|
+
| "chart-1"
|
|
12
|
+
| "chart-2"
|
|
13
|
+
| "chart-3"
|
|
14
|
+
| "chart-4"
|
|
15
|
+
| "chart-5"
|
|
16
|
+
| "success"
|
|
17
|
+
| "info"
|
|
18
|
+
| "warning"
|
|
19
|
+
| "destructive"
|
|
20
|
+
|
|
21
|
+
const colorTokens: Record<FeatureCardColor, { bg: string; icon: string }> = {
|
|
22
|
+
primary: { bg: "bg-primary/10", icon: "text-primary" },
|
|
23
|
+
"chart-1": { bg: "bg-[var(--chart-1)]/15", icon: "text-[var(--chart-1)]" },
|
|
24
|
+
"chart-2": { bg: "bg-[var(--chart-2)]/15", icon: "text-[var(--chart-2)]" },
|
|
25
|
+
"chart-3": { bg: "bg-[var(--chart-3)]/15", icon: "text-[var(--chart-3)]" },
|
|
26
|
+
"chart-4": { bg: "bg-[var(--chart-4)]/15", icon: "text-[var(--chart-4)]" },
|
|
27
|
+
"chart-5": { bg: "bg-[var(--chart-5)]/15", icon: "text-[var(--chart-5)]" },
|
|
28
|
+
success: { bg: "bg-success/10", icon: "text-success" },
|
|
29
|
+
info: { bg: "bg-info/10", icon: "text-info" },
|
|
30
|
+
warning: { bg: "bg-warning/10", icon: "text-warning" },
|
|
31
|
+
destructive: { bg: "bg-destructive/10", icon: "text-destructive" },
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface FeatureCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
35
|
+
title: string
|
|
36
|
+
description: string
|
|
37
|
+
icon: React.ReactNode
|
|
38
|
+
color?: FeatureCardColor
|
|
39
|
+
badge?: string
|
|
40
|
+
badgeVariant?: React.ComponentProps<typeof Badge>["variant"]
|
|
41
|
+
actionLabel?: string
|
|
42
|
+
actionVariant?: React.ComponentProps<typeof Button>["variant"]
|
|
43
|
+
onAction?: () => void
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function FeatureCard({
|
|
47
|
+
title,
|
|
48
|
+
description,
|
|
49
|
+
icon,
|
|
50
|
+
color = "primary",
|
|
51
|
+
badge,
|
|
52
|
+
badgeVariant = "default",
|
|
53
|
+
actionLabel,
|
|
54
|
+
actionVariant = "outline",
|
|
55
|
+
onAction,
|
|
56
|
+
className,
|
|
57
|
+
...props
|
|
58
|
+
}: FeatureCardProps) {
|
|
59
|
+
const { bg, icon: iconColor } = colorTokens[color]
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<Card
|
|
63
|
+
className={cn(
|
|
64
|
+
"flex flex-col h-full hover:shadow-md transition-shadow duration-200",
|
|
65
|
+
className,
|
|
66
|
+
)}
|
|
67
|
+
{...props}
|
|
68
|
+
>
|
|
69
|
+
<CardHeader>
|
|
70
|
+
<div className="flex items-center gap-3">
|
|
71
|
+
<div className={cn("p-2 rounded-[var(--radius)] shrink-0", bg)}>
|
|
72
|
+
<div className={cn("size-6 flex items-center justify-center [&>svg]:size-6", iconColor)}>
|
|
73
|
+
{icon}
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
<div className="flex flex-wrap items-center gap-x-2 gap-y-1 min-w-0">
|
|
77
|
+
<CardTitle className="text-sm">{title}</CardTitle>
|
|
78
|
+
{badge && (
|
|
79
|
+
<Badge variant={badgeVariant} className="text-xs">
|
|
80
|
+
{badge}
|
|
81
|
+
</Badge>
|
|
82
|
+
)}
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</CardHeader>
|
|
86
|
+
|
|
87
|
+
<CardContent className="flex-1">
|
|
88
|
+
<CardDescription className="text-sm leading-relaxed">{description}</CardDescription>
|
|
89
|
+
</CardContent>
|
|
90
|
+
|
|
91
|
+
{actionLabel && (
|
|
92
|
+
<CardFooter>
|
|
93
|
+
<Button variant={actionVariant} className="w-full" onClick={onAction}>
|
|
94
|
+
{actionLabel}
|
|
95
|
+
</Button>
|
|
96
|
+
</CardFooter>
|
|
97
|
+
)}
|
|
98
|
+
</Card>
|
|
99
|
+
)
|
|
100
|
+
}
|
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { Card, CardHeader, CardTitle, CardContent, CardFooter, CardAction } from "../../ui/card"
|
|
5
|
-
import { Avatar, AvatarFallback, AvatarImage } from "../../ui/avatar"
|
|
6
|
-
import { Badge } from "../../ui/badge"
|
|
7
|
-
import { Button } from "../../ui/button"
|
|
8
|
-
import { cn } from "../../shared/utils"
|
|
9
|
-
|
|
10
|
-
export type NotificationType = "info" | "warning" | "success" | "error" | "default"
|
|
11
|
-
|
|
12
|
-
export interface NotificationItem {
|
|
13
|
-
id: string
|
|
14
|
-
title: string
|
|
15
|
-
message: string
|
|
16
|
-
time: string
|
|
17
|
-
read?: boolean
|
|
18
|
-
type?: NotificationType
|
|
19
|
-
user?: { name: string; initials: string; avatar?: string }
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface NotificationCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
23
|
-
title?: string
|
|
24
|
-
items: NotificationItem[]
|
|
25
|
-
unreadCount?: number
|
|
26
|
-
onMarkAllRead?: () => void
|
|
27
|
-
onViewAll?: () => void
|
|
28
|
-
maxItems?: number
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const typeVariant: Record<NotificationType, React.ComponentProps<typeof Badge>["variant"]> = {
|
|
32
|
-
info: "info",
|
|
33
|
-
warning: "warning",
|
|
34
|
-
success: "success",
|
|
35
|
-
error: "destructive",
|
|
36
|
-
default: "secondary",
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function NotificationCard({
|
|
40
|
-
title = "Notificações",
|
|
41
|
-
items,
|
|
42
|
-
unreadCount,
|
|
43
|
-
onMarkAllRead,
|
|
44
|
-
onViewAll,
|
|
45
|
-
maxItems = 4,
|
|
46
|
-
className,
|
|
47
|
-
...props
|
|
48
|
-
}: NotificationCardProps) {
|
|
49
|
-
const visible = items.slice(0, maxItems)
|
|
50
|
-
const count = unreadCount ?? items.filter((i) => !i.read).length
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<Card className={cn("w-full", className)} {...props}>
|
|
54
|
-
<CardHeader>
|
|
55
|
-
<div className="flex items-center gap-2">
|
|
56
|
-
<CardTitle>{title}</CardTitle>
|
|
57
|
-
{count > 0 && (
|
|
58
|
-
<Badge variant="destructive" className="h-5 text-[11px] px-1.5">{count}</Badge>
|
|
59
|
-
)}
|
|
60
|
-
</div>
|
|
61
|
-
{onMarkAllRead && count > 0 && (
|
|
62
|
-
<CardAction>
|
|
63
|
-
<Button variant="ghost" size="sm" className="text-xs h-7" onClick={onMarkAllRead}>
|
|
64
|
-
Marcar todas como lidas
|
|
65
|
-
</Button>
|
|
66
|
-
</CardAction>
|
|
67
|
-
)}
|
|
68
|
-
</CardHeader>
|
|
69
|
-
|
|
70
|
-
<CardContent className="px-0 pb-0">
|
|
71
|
-
<ul className="divide-y divide-border">
|
|
72
|
-
{visible.map((item) => (
|
|
73
|
-
<li
|
|
74
|
-
key={item.id}
|
|
75
|
-
className={cn(
|
|
76
|
-
"flex items-start gap-3 px-6 py-3 transition-colors",
|
|
77
|
-
!item.read && "bg-muted/40",
|
|
78
|
-
)}
|
|
79
|
-
>
|
|
80
|
-
{item.user ? (
|
|
81
|
-
<Avatar className="size-8 shrink-0 mt-0.5">
|
|
82
|
-
{item.user.avatar && <AvatarImage src={item.user.avatar} alt={item.user.name} />}
|
|
83
|
-
<AvatarFallback className="text-xs">{item.user.initials}</AvatarFallback>
|
|
84
|
-
</Avatar>
|
|
85
|
-
) : (
|
|
86
|
-
<div className="size-8 shrink-0 mt-0.5 rounded-full bg-muted flex items-center justify-center">
|
|
87
|
-
<div className={cn(
|
|
88
|
-
"size-2 rounded-full",
|
|
89
|
-
item.type === "error" ? "bg-destructive" :
|
|
90
|
-
item.type === "warning" ? "bg-warning" :
|
|
91
|
-
item.type === "success" ? "bg-success" :
|
|
92
|
-
item.type === "info" ? "bg-info" : "bg-muted-foreground",
|
|
93
|
-
)} />
|
|
94
|
-
</div>
|
|
95
|
-
)}
|
|
96
|
-
|
|
97
|
-
<div className="flex-1 min-w-0">
|
|
98
|
-
<div className="flex items-center justify-between gap-2">
|
|
99
|
-
<p className="text-sm font-medium truncate">{item.title}</p>
|
|
100
|
-
{item.type && item.type !== "default" && (
|
|
101
|
-
<Badge variant={typeVariant[item.type]} className="text-[10px] px-1.5 h-4 shrink-0">
|
|
102
|
-
{item.type}
|
|
103
|
-
</Badge>
|
|
104
|
-
)}
|
|
105
|
-
</div>
|
|
106
|
-
<p className="text-xs text-muted-foreground line-clamp-2 mt-0.5">{item.message}</p>
|
|
107
|
-
<p className="text-[11px] text-muted-foreground/70 mt-1">{item.time}</p>
|
|
108
|
-
</div>
|
|
109
|
-
|
|
110
|
-
{!item.read && (
|
|
111
|
-
<div className="size-2 rounded-full bg-primary shrink-0 mt-2" />
|
|
112
|
-
)}
|
|
113
|
-
</li>
|
|
114
|
-
))}
|
|
115
|
-
</ul>
|
|
116
|
-
</CardContent>
|
|
117
|
-
|
|
118
|
-
{onViewAll && (
|
|
119
|
-
<CardFooter className="pt-2">
|
|
120
|
-
<Button variant="ghost" size="sm" className="w-full text-xs" onClick={onViewAll}>
|
|
121
|
-
Ver todas as notificações
|
|
122
|
-
</Button>
|
|
123
|
-
</CardFooter>
|
|
124
|
-
)}
|
|
125
|
-
</Card>
|
|
126
|
-
)
|
|
127
|
-
}
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Card, CardHeader, CardTitle, CardContent, CardFooter, CardAction } from "../../ui/card"
|
|
5
|
+
import { Avatar, AvatarFallback, AvatarImage } from "../../ui/avatar"
|
|
6
|
+
import { Badge } from "../../ui/badge"
|
|
7
|
+
import { Button } from "../../ui/button"
|
|
8
|
+
import { cn } from "../../shared/utils"
|
|
9
|
+
|
|
10
|
+
export type NotificationType = "info" | "warning" | "success" | "error" | "default"
|
|
11
|
+
|
|
12
|
+
export interface NotificationItem {
|
|
13
|
+
id: string
|
|
14
|
+
title: string
|
|
15
|
+
message: string
|
|
16
|
+
time: string
|
|
17
|
+
read?: boolean
|
|
18
|
+
type?: NotificationType
|
|
19
|
+
user?: { name: string; initials: string; avatar?: string }
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface NotificationCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
23
|
+
title?: string
|
|
24
|
+
items: NotificationItem[]
|
|
25
|
+
unreadCount?: number
|
|
26
|
+
onMarkAllRead?: () => void
|
|
27
|
+
onViewAll?: () => void
|
|
28
|
+
maxItems?: number
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const typeVariant: Record<NotificationType, React.ComponentProps<typeof Badge>["variant"]> = {
|
|
32
|
+
info: "info",
|
|
33
|
+
warning: "warning",
|
|
34
|
+
success: "success",
|
|
35
|
+
error: "destructive",
|
|
36
|
+
default: "secondary",
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function NotificationCard({
|
|
40
|
+
title = "Notificações",
|
|
41
|
+
items,
|
|
42
|
+
unreadCount,
|
|
43
|
+
onMarkAllRead,
|
|
44
|
+
onViewAll,
|
|
45
|
+
maxItems = 4,
|
|
46
|
+
className,
|
|
47
|
+
...props
|
|
48
|
+
}: NotificationCardProps) {
|
|
49
|
+
const visible = items.slice(0, maxItems)
|
|
50
|
+
const count = unreadCount ?? items.filter((i) => !i.read).length
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<Card className={cn("w-full", className)} {...props}>
|
|
54
|
+
<CardHeader>
|
|
55
|
+
<div className="flex items-center gap-2">
|
|
56
|
+
<CardTitle>{title}</CardTitle>
|
|
57
|
+
{count > 0 && (
|
|
58
|
+
<Badge variant="destructive" className="h-5 text-[11px] px-1.5">{count}</Badge>
|
|
59
|
+
)}
|
|
60
|
+
</div>
|
|
61
|
+
{onMarkAllRead && count > 0 && (
|
|
62
|
+
<CardAction>
|
|
63
|
+
<Button variant="ghost" size="sm" className="text-xs h-7" onClick={onMarkAllRead}>
|
|
64
|
+
Marcar todas como lidas
|
|
65
|
+
</Button>
|
|
66
|
+
</CardAction>
|
|
67
|
+
)}
|
|
68
|
+
</CardHeader>
|
|
69
|
+
|
|
70
|
+
<CardContent className="px-0 pb-0">
|
|
71
|
+
<ul className="divide-y divide-border">
|
|
72
|
+
{visible.map((item) => (
|
|
73
|
+
<li
|
|
74
|
+
key={item.id}
|
|
75
|
+
className={cn(
|
|
76
|
+
"flex items-start gap-3 px-6 py-3 transition-colors",
|
|
77
|
+
!item.read && "bg-muted/40",
|
|
78
|
+
)}
|
|
79
|
+
>
|
|
80
|
+
{item.user ? (
|
|
81
|
+
<Avatar className="size-8 shrink-0 mt-0.5">
|
|
82
|
+
{item.user.avatar && <AvatarImage src={item.user.avatar} alt={item.user.name} />}
|
|
83
|
+
<AvatarFallback className="text-xs">{item.user.initials}</AvatarFallback>
|
|
84
|
+
</Avatar>
|
|
85
|
+
) : (
|
|
86
|
+
<div className="size-8 shrink-0 mt-0.5 rounded-full bg-muted flex items-center justify-center">
|
|
87
|
+
<div className={cn(
|
|
88
|
+
"size-2 rounded-full",
|
|
89
|
+
item.type === "error" ? "bg-destructive" :
|
|
90
|
+
item.type === "warning" ? "bg-warning" :
|
|
91
|
+
item.type === "success" ? "bg-success" :
|
|
92
|
+
item.type === "info" ? "bg-info" : "bg-muted-foreground",
|
|
93
|
+
)} />
|
|
94
|
+
</div>
|
|
95
|
+
)}
|
|
96
|
+
|
|
97
|
+
<div className="flex-1 min-w-0">
|
|
98
|
+
<div className="flex items-center justify-between gap-2">
|
|
99
|
+
<p className="text-sm font-medium truncate">{item.title}</p>
|
|
100
|
+
{item.type && item.type !== "default" && (
|
|
101
|
+
<Badge variant={typeVariant[item.type]} className="text-[10px] px-1.5 h-4 shrink-0">
|
|
102
|
+
{item.type}
|
|
103
|
+
</Badge>
|
|
104
|
+
)}
|
|
105
|
+
</div>
|
|
106
|
+
<p className="text-xs text-muted-foreground line-clamp-2 mt-0.5">{item.message}</p>
|
|
107
|
+
<p className="text-[11px] text-muted-foreground/70 mt-1">{item.time}</p>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
{!item.read && (
|
|
111
|
+
<div className="size-2 rounded-full bg-primary shrink-0 mt-2" />
|
|
112
|
+
)}
|
|
113
|
+
</li>
|
|
114
|
+
))}
|
|
115
|
+
</ul>
|
|
116
|
+
</CardContent>
|
|
117
|
+
|
|
118
|
+
{onViewAll && (
|
|
119
|
+
<CardFooter className="pt-2">
|
|
120
|
+
<Button variant="ghost" size="sm" className="w-full text-xs" onClick={onViewAll}>
|
|
121
|
+
Ver todas as notificações
|
|
122
|
+
</Button>
|
|
123
|
+
</CardFooter>
|
|
124
|
+
)}
|
|
125
|
+
</Card>
|
|
126
|
+
)
|
|
127
|
+
}
|