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
|
@@ -12,110 +12,110 @@ interface ApiKeyContextType {
|
|
|
12
12
|
reloadMapsApi: () => Promise<void>;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const ApiKeyContext = createContext<ApiKeyContextType | undefined>(undefined);
|
|
16
|
-
|
|
17
|
-
const readStorage = (key: string) =>
|
|
18
|
-
typeof window !== 'undefined' ? window.localStorage?.getItem(key) : null;
|
|
19
|
-
|
|
20
|
-
const writeStorage = (key: string, value: string) => {
|
|
21
|
-
if (typeof window === 'undefined') return;
|
|
22
|
-
window.localStorage?.setItem(key, value);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const removeStorage = (key: string) => {
|
|
26
|
-
if (typeof window === 'undefined') return;
|
|
27
|
-
window.localStorage?.removeItem(key);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
interface ApiKeyProviderProps {
|
|
31
|
-
children: ReactNode;
|
|
32
|
-
initialApiKey?: string;
|
|
33
|
-
initialGeminiApiKey?: string;
|
|
34
|
-
initialGoogleMapsApiKey?: string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function ApiKeyProvider({
|
|
38
|
-
children,
|
|
39
|
-
initialApiKey,
|
|
40
|
-
initialGeminiApiKey,
|
|
41
|
-
initialGoogleMapsApiKey,
|
|
42
|
-
}: ApiKeyProviderProps) {
|
|
15
|
+
const ApiKeyContext = createContext<ApiKeyContextType | undefined>(undefined);
|
|
16
|
+
|
|
17
|
+
const readStorage = (key: string) =>
|
|
18
|
+
typeof window !== 'undefined' ? window.localStorage?.getItem(key) : null;
|
|
19
|
+
|
|
20
|
+
const writeStorage = (key: string, value: string) => {
|
|
21
|
+
if (typeof window === 'undefined') return;
|
|
22
|
+
window.localStorage?.setItem(key, value);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const removeStorage = (key: string) => {
|
|
26
|
+
if (typeof window === 'undefined') return;
|
|
27
|
+
window.localStorage?.removeItem(key);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
interface ApiKeyProviderProps {
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
initialApiKey?: string;
|
|
33
|
+
initialGeminiApiKey?: string;
|
|
34
|
+
initialGoogleMapsApiKey?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function ApiKeyProvider({
|
|
38
|
+
children,
|
|
39
|
+
initialApiKey,
|
|
40
|
+
initialGeminiApiKey,
|
|
41
|
+
initialGoogleMapsApiKey,
|
|
42
|
+
}: ApiKeyProviderProps) {
|
|
43
43
|
// Lista de chaves conhecidas como vazadas (para limpeza automática)
|
|
44
44
|
const LEAKED_KEYS = [
|
|
45
45
|
'AIzaSyCMsAMytBeOK0Qd7RKFyA5IW9eWt2WTJg',
|
|
46
46
|
'AIzaSyAiYWEIEmx212Up9zfM8kqyMXB4jLs8gq0'
|
|
47
47
|
];
|
|
48
48
|
|
|
49
|
-
const [apiKey, setApiKeyState] = useState<string>(() => {
|
|
50
|
-
if (initialApiKey) return initialApiKey;
|
|
51
|
-
const saved = readStorage('xertica-api-key');
|
|
52
|
-
return saved || '';
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
const [geminiApiKey, setGeminiApiKeyState] = useState<string>(() => {
|
|
56
|
-
if (initialGeminiApiKey) return initialGeminiApiKey;
|
|
57
|
-
const saved = readStorage('xertica-gemini-api-key');
|
|
49
|
+
const [apiKey, setApiKeyState] = useState<string>(() => {
|
|
50
|
+
if (initialApiKey) return initialApiKey;
|
|
51
|
+
const saved = readStorage('xertica-api-key');
|
|
52
|
+
return saved || '';
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const [geminiApiKey, setGeminiApiKeyState] = useState<string>(() => {
|
|
56
|
+
if (initialGeminiApiKey) return initialGeminiApiKey;
|
|
57
|
+
const saved = readStorage('xertica-gemini-api-key');
|
|
58
58
|
|
|
59
59
|
// Se a chave salva estiver na lista de vazadas, removê-la
|
|
60
60
|
if (saved && LEAKED_KEYS.includes(saved)) {
|
|
61
|
-
removeStorage('xertica-gemini-api-key');
|
|
61
|
+
removeStorage('xertica-gemini-api-key');
|
|
62
62
|
return '';
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
return saved || '';
|
|
66
66
|
});
|
|
67
|
-
|
|
68
|
-
const [googleMapsApiKey, setGoogleMapsApiKeyState] = useState<string>(() => {
|
|
69
|
-
if (initialGoogleMapsApiKey) return initialGoogleMapsApiKey;
|
|
70
|
-
const saved = readStorage('xertica-googlemaps-api-key');
|
|
71
|
-
return saved || '';
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
const [isApiKeyValid, setIsApiKeyValid] = useState(false);
|
|
75
|
-
const [isGoogleMapsKeyValid, setIsGoogleMapsKeyValid] = useState(false);
|
|
76
|
-
|
|
77
|
-
useEffect(() => {
|
|
78
|
-
if (initialApiKey !== undefined) {
|
|
79
|
-
setApiKeyState(initialApiKey.trim());
|
|
80
|
-
}
|
|
81
|
-
}, [initialApiKey]);
|
|
82
|
-
|
|
83
|
-
useEffect(() => {
|
|
84
|
-
if (initialGeminiApiKey !== undefined) {
|
|
85
|
-
setGeminiApiKeyState(initialGeminiApiKey.trim());
|
|
86
|
-
}
|
|
87
|
-
}, [initialGeminiApiKey]);
|
|
88
|
-
|
|
89
|
-
useEffect(() => {
|
|
90
|
-
if (initialGoogleMapsApiKey !== undefined) {
|
|
91
|
-
setGoogleMapsApiKeyState(initialGoogleMapsApiKey.trim());
|
|
92
|
-
}
|
|
93
|
-
}, [initialGoogleMapsApiKey]);
|
|
67
|
+
|
|
68
|
+
const [googleMapsApiKey, setGoogleMapsApiKeyState] = useState<string>(() => {
|
|
69
|
+
if (initialGoogleMapsApiKey) return initialGoogleMapsApiKey;
|
|
70
|
+
const saved = readStorage('xertica-googlemaps-api-key');
|
|
71
|
+
return saved || '';
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const [isApiKeyValid, setIsApiKeyValid] = useState(false);
|
|
75
|
+
const [isGoogleMapsKeyValid, setIsGoogleMapsKeyValid] = useState(false);
|
|
76
|
+
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
if (initialApiKey !== undefined) {
|
|
79
|
+
setApiKeyState(initialApiKey.trim());
|
|
80
|
+
}
|
|
81
|
+
}, [initialApiKey]);
|
|
82
|
+
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
if (initialGeminiApiKey !== undefined) {
|
|
85
|
+
setGeminiApiKeyState(initialGeminiApiKey.trim());
|
|
86
|
+
}
|
|
87
|
+
}, [initialGeminiApiKey]);
|
|
88
|
+
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
if (initialGoogleMapsApiKey !== undefined) {
|
|
91
|
+
setGoogleMapsApiKeyState(initialGoogleMapsApiKey.trim());
|
|
92
|
+
}
|
|
93
|
+
}, [initialGoogleMapsApiKey]);
|
|
94
94
|
|
|
95
95
|
useEffect(() => {
|
|
96
96
|
if (apiKey) {
|
|
97
|
-
writeStorage('xertica-api-key', apiKey);
|
|
97
|
+
writeStorage('xertica-api-key', apiKey);
|
|
98
98
|
setIsApiKeyValid(apiKey.length > 0);
|
|
99
99
|
} else {
|
|
100
|
-
removeStorage('xertica-api-key');
|
|
100
|
+
removeStorage('xertica-api-key');
|
|
101
101
|
setIsApiKeyValid(false);
|
|
102
102
|
}
|
|
103
103
|
}, [apiKey]);
|
|
104
104
|
|
|
105
105
|
useEffect(() => {
|
|
106
106
|
if (geminiApiKey) {
|
|
107
|
-
writeStorage('xertica-gemini-api-key', geminiApiKey);
|
|
107
|
+
writeStorage('xertica-gemini-api-key', geminiApiKey);
|
|
108
108
|
// Validação básica do formato da chave
|
|
109
109
|
setIsApiKeyValid(geminiApiKey.startsWith('AIzaSy') && geminiApiKey.length > 20);
|
|
110
110
|
} else {
|
|
111
|
-
removeStorage('xertica-gemini-api-key');
|
|
111
|
+
removeStorage('xertica-gemini-api-key');
|
|
112
112
|
setIsApiKeyValid(false);
|
|
113
113
|
}
|
|
114
114
|
}, [geminiApiKey]);
|
|
115
115
|
|
|
116
116
|
useEffect(() => {
|
|
117
117
|
if (googleMapsApiKey) {
|
|
118
|
-
writeStorage('xertica-googlemaps-api-key', googleMapsApiKey);
|
|
118
|
+
writeStorage('xertica-googlemaps-api-key', googleMapsApiKey);
|
|
119
119
|
// Validação básica do formato da chave do Google Maps
|
|
120
120
|
setIsGoogleMapsKeyValid(googleMapsApiKey.startsWith('AIzaSy') && googleMapsApiKey.length > 20);
|
|
121
121
|
|
|
@@ -134,7 +134,7 @@ export function ApiKeyProvider({
|
|
|
134
134
|
|
|
135
135
|
reloadMaps();
|
|
136
136
|
} else {
|
|
137
|
-
removeStorage('xertica-googlemaps-api-key');
|
|
137
|
+
removeStorage('xertica-googlemaps-api-key');
|
|
138
138
|
setIsGoogleMapsKeyValid(false);
|
|
139
139
|
}
|
|
140
140
|
}, [googleMapsApiKey]);
|
|
@@ -189,4 +189,4 @@ export function useApiKey() {
|
|
|
189
189
|
throw new Error('useApiKey must be used within ApiKeyProvider');
|
|
190
190
|
}
|
|
191
191
|
return context;
|
|
192
|
-
}
|
|
192
|
+
}
|
|
@@ -88,11 +88,11 @@ export const BrandColorsProvider: React.FC<BrandColorsProviderProps> = ({
|
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
// Função para aplicar as cores baseadas no modo atual e tema
|
|
91
|
-
const applyColors = React.useCallback(() => {
|
|
92
|
-
if (useCustomTokens) return; // Skip if user wants to use local tokens.css
|
|
93
|
-
if (typeof document === 'undefined') return;
|
|
94
|
-
|
|
95
|
-
const root = document.documentElement;
|
|
91
|
+
const applyColors = React.useCallback(() => {
|
|
92
|
+
if (useCustomTokens) return; // Skip if user wants to use local tokens.css
|
|
93
|
+
if (typeof document === 'undefined') return;
|
|
94
|
+
|
|
95
|
+
const root = document.documentElement;
|
|
96
96
|
const isDark = root.classList.contains('dark');
|
|
97
97
|
|
|
98
98
|
// --- Determine Colors based on Mode ---
|
|
@@ -105,13 +105,13 @@ export const BrandColorsProvider: React.FC<BrandColorsProviderProps> = ({
|
|
|
105
105
|
|
|
106
106
|
// --- Semantic Colors (Fixed Standard) ---
|
|
107
107
|
// Success (Green), Warning (Amber/Yellow), Info (Blue), Destructive (Red)
|
|
108
|
-
const semantic = {
|
|
109
|
-
success: isDark ? '#4ade80' : '#047857', // Green 400 / 700
|
|
110
|
-
warning: isDark ? '#fbbf24' : '#b45309', // Amber 400 / 700
|
|
111
|
-
info: isDark ? '#60a5fa' : '#1d4ed8', // Blue 400 / 700
|
|
112
|
-
destructive: isDark ? '#f87171' : '#b91c1c', // Red 400 / 700
|
|
113
|
-
foreground: isDark ? '#050505' : '#ffffff',
|
|
114
|
-
};
|
|
108
|
+
const semantic = {
|
|
109
|
+
success: isDark ? '#4ade80' : '#047857', // Green 400 / 700
|
|
110
|
+
warning: isDark ? '#fbbf24' : '#b45309', // Amber 400 / 700
|
|
111
|
+
info: isDark ? '#60a5fa' : '#1d4ed8', // Blue 400 / 700
|
|
112
|
+
destructive: isDark ? '#f87171' : '#b91c1c', // Red 400 / 700
|
|
113
|
+
foreground: isDark ? '#050505' : '#ffffff',
|
|
114
|
+
};
|
|
115
115
|
|
|
116
116
|
// --- Apply CSS Variables ---
|
|
117
117
|
const cssVars: string[] = [];
|
|
@@ -120,15 +120,15 @@ export const BrandColorsProvider: React.FC<BrandColorsProviderProps> = ({
|
|
|
120
120
|
cssVars.push(`--primary: ${primary}`);
|
|
121
121
|
cssVars.push(`--primary-foreground: ${primaryForeground}`);
|
|
122
122
|
|
|
123
|
-
// 2. Semantic Colors
|
|
124
|
-
cssVars.push(`--success: ${semantic.success}`);
|
|
125
|
-
cssVars.push(`--success-foreground: ${semantic.foreground}`);
|
|
126
|
-
cssVars.push(`--warning: ${semantic.warning}`);
|
|
127
|
-
cssVars.push(`--warning-foreground: ${semantic.foreground}`);
|
|
128
|
-
cssVars.push(`--info: ${semantic.info}`);
|
|
129
|
-
cssVars.push(`--info-foreground: ${semantic.foreground}`);
|
|
130
|
-
cssVars.push(`--destructive: ${semantic.destructive}`);
|
|
131
|
-
cssVars.push(`--destructive-foreground: ${semantic.foreground}`);
|
|
123
|
+
// 2. Semantic Colors
|
|
124
|
+
cssVars.push(`--success: ${semantic.success}`);
|
|
125
|
+
cssVars.push(`--success-foreground: ${semantic.foreground}`);
|
|
126
|
+
cssVars.push(`--warning: ${semantic.warning}`);
|
|
127
|
+
cssVars.push(`--warning-foreground: ${semantic.foreground}`);
|
|
128
|
+
cssVars.push(`--info: ${semantic.info}`);
|
|
129
|
+
cssVars.push(`--info-foreground: ${semantic.foreground}`);
|
|
130
|
+
cssVars.push(`--destructive: ${semantic.destructive}`);
|
|
131
|
+
cssVars.push(`--destructive-foreground: ${semantic.foreground}`);
|
|
132
132
|
|
|
133
133
|
// 3. Secondary & Accents (Derived or Specific)
|
|
134
134
|
const primaryRGB = hexToRgb(primary);
|
|
@@ -205,10 +205,10 @@ export const BrandColorsProvider: React.FC<BrandColorsProviderProps> = ({
|
|
|
205
205
|
applyColors();
|
|
206
206
|
}, [applyColors]);
|
|
207
207
|
|
|
208
|
-
// Observar mudanças na classe 'dark' do documento
|
|
209
|
-
useEffect(() => {
|
|
210
|
-
if (typeof document === 'undefined' || typeof MutationObserver === 'undefined') return;
|
|
211
|
-
const root = document.documentElement;
|
|
208
|
+
// Observar mudanças na classe 'dark' do documento
|
|
209
|
+
useEffect(() => {
|
|
210
|
+
if (typeof document === 'undefined' || typeof MutationObserver === 'undefined') return;
|
|
211
|
+
const root = document.documentElement;
|
|
212
212
|
const observer = new MutationObserver((mutations) => {
|
|
213
213
|
mutations.forEach((mutation) => {
|
|
214
214
|
if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
|
|
@@ -244,4 +244,4 @@ export const useBrandColors = () => {
|
|
|
244
244
|
throw new Error('useBrandColors must be used within a BrandColorsProvider');
|
|
245
245
|
}
|
|
246
246
|
return context;
|
|
247
|
-
};
|
|
247
|
+
};
|
|
@@ -10,18 +10,18 @@ interface LanguageContextType {
|
|
|
10
10
|
const LanguageContext = createContext<LanguageContextType | undefined>(undefined);
|
|
11
11
|
|
|
12
12
|
// Provider simplificado - mantém seletor visual mas funciona apenas em português
|
|
13
|
-
export function LanguageProvider({ children }: { children: ReactNode }) {
|
|
14
|
-
const [language, setLanguage] = useState<Language>(() => {
|
|
15
|
-
const saved = typeof window !== 'undefined'
|
|
16
|
-
? window.localStorage?.getItem('xertica_language')
|
|
17
|
-
: null;
|
|
18
|
-
return (saved as Language) || 'pt-BR';
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
if (typeof window === 'undefined') return;
|
|
23
|
-
window.localStorage?.setItem('xertica_language', language);
|
|
24
|
-
}, [language]);
|
|
13
|
+
export function LanguageProvider({ children }: { children: ReactNode }) {
|
|
14
|
+
const [language, setLanguage] = useState<Language>(() => {
|
|
15
|
+
const saved = typeof window !== 'undefined'
|
|
16
|
+
? window.localStorage?.getItem('xertica_language')
|
|
17
|
+
: null;
|
|
18
|
+
return (saved as Language) || 'pt-BR';
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (typeof window === 'undefined') return;
|
|
23
|
+
window.localStorage?.setItem('xertica_language', language);
|
|
24
|
+
}, [language]);
|
|
25
25
|
|
|
26
26
|
return (
|
|
27
27
|
<LanguageContext.Provider value={{ language, setLanguage }}>
|
|
@@ -36,4 +36,4 @@ export function useLanguage() {
|
|
|
36
36
|
throw new Error('useLanguage must be used within a LanguageProvider');
|
|
37
37
|
}
|
|
38
38
|
return context;
|
|
39
|
-
}
|
|
39
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { renderHook, act } from '@testing-library/react';
|
|
2
2
|
import { describe, it, expect } from 'vitest';
|
|
3
|
-
import { LayoutProvider, useLayout, useOptionalLayout } from './LayoutContext';
|
|
3
|
+
import { LayoutProvider, useLayout, useOptionalLayout } from './LayoutContext';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
|
|
6
6
|
describe('LayoutContext', () => {
|
|
7
|
-
it('toggles sidebar', () => {
|
|
7
|
+
it('toggles sidebar', () => {
|
|
8
8
|
const wrapper = ({ children }: { children: React.ReactNode }) => (
|
|
9
9
|
<LayoutProvider>{children}</LayoutProvider>
|
|
10
10
|
);
|
|
@@ -18,12 +18,12 @@ describe('LayoutContext', () => {
|
|
|
18
18
|
result.current.toggleSidebar();
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
-
expect(result.current.sidebarExpanded).toBe(!initial);
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it('returns null for optional layout outside the provider', () => {
|
|
25
|
-
const { result } = renderHook(() => useOptionalLayout());
|
|
26
|
-
|
|
27
|
-
expect(result.current).toBeNull();
|
|
28
|
-
});
|
|
29
|
-
});
|
|
21
|
+
expect(result.current.sidebarExpanded).toBe(!initial);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('returns null for optional layout outside the provider', () => {
|
|
25
|
+
const { result } = renderHook(() => useOptionalLayout());
|
|
26
|
+
|
|
27
|
+
expect(result.current).toBeNull();
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -22,10 +22,10 @@ const LayoutContext = createContext<LayoutContextType | undefined>(undefined);
|
|
|
22
22
|
/**
|
|
23
23
|
* Helper to get cookie value
|
|
24
24
|
*/
|
|
25
|
-
function getCookie(name: string): string | null {
|
|
26
|
-
if (typeof document === 'undefined') return null;
|
|
27
|
-
const nameLenPlus = (name.length + 1);
|
|
28
|
-
return document.cookie
|
|
25
|
+
function getCookie(name: string): string | null {
|
|
26
|
+
if (typeof document === 'undefined') return null;
|
|
27
|
+
const nameLenPlus = (name.length + 1);
|
|
28
|
+
return document.cookie
|
|
29
29
|
.split(';')
|
|
30
30
|
.map(c => c.trim())
|
|
31
31
|
.filter(cookie => {
|
|
@@ -39,10 +39,10 @@ function getCookie(name: string): string | null {
|
|
|
39
39
|
/**
|
|
40
40
|
* Helper to set cookie
|
|
41
41
|
*/
|
|
42
|
-
function setCookie(name: string, value: string) {
|
|
43
|
-
if (typeof document === 'undefined') return;
|
|
44
|
-
document.cookie = `${name}=${value}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}; SameSite=Lax`;
|
|
45
|
-
}
|
|
42
|
+
function setCookie(name: string, value: string) {
|
|
43
|
+
if (typeof document === 'undefined') return;
|
|
44
|
+
document.cookie = `${name}=${value}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}; SameSite=Lax`;
|
|
45
|
+
}
|
|
46
46
|
|
|
47
47
|
export function LayoutProvider({ children }: { children: ReactNode }) {
|
|
48
48
|
// Initialize from cookie if available
|
|
@@ -56,12 +56,12 @@ export function LayoutProvider({ children }: { children: ReactNode }) {
|
|
|
56
56
|
const [sidebarWidth, setSidebarWidth] = useState(256);
|
|
57
57
|
const [isMobile, setIsMobile] = useState(false);
|
|
58
58
|
|
|
59
|
-
// Detect mobile
|
|
60
|
-
useEffect(() => {
|
|
61
|
-
if (typeof window === 'undefined') return;
|
|
62
|
-
const checkMobile = () => {
|
|
63
|
-
setIsMobile(window.innerWidth < 768);
|
|
64
|
-
};
|
|
59
|
+
// Detect mobile
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (typeof window === 'undefined') return;
|
|
62
|
+
const checkMobile = () => {
|
|
63
|
+
setIsMobile(window.innerWidth < 768);
|
|
64
|
+
};
|
|
65
65
|
checkMobile();
|
|
66
66
|
window.addEventListener('resize', checkMobile);
|
|
67
67
|
return () => window.removeEventListener('resize', checkMobile);
|
|
@@ -72,10 +72,10 @@ export function LayoutProvider({ children }: { children: ReactNode }) {
|
|
|
72
72
|
setCookie(SIDEBAR_COOKIE_NAME, sidebarExpanded.toString());
|
|
73
73
|
}, [sidebarExpanded]);
|
|
74
74
|
|
|
75
|
-
// Keyboard shortcuts
|
|
76
|
-
useEffect(() => {
|
|
77
|
-
if (typeof window === 'undefined') return;
|
|
78
|
-
const handleKeyDown = (event: KeyboardEvent) => {
|
|
75
|
+
// Keyboard shortcuts
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
if (typeof window === 'undefined') return;
|
|
78
|
+
const handleKeyDown = (event: KeyboardEvent) => {
|
|
79
79
|
if (
|
|
80
80
|
event.key === SIDEBAR_KEYBOARD_SHORTCUT &&
|
|
81
81
|
(event.metaKey || event.ctrlKey)
|
|
@@ -139,14 +139,14 @@ export function LayoutProvider({ children }: { children: ReactNode }) {
|
|
|
139
139
|
);
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
export function useLayout() {
|
|
143
|
-
const context = useContext(LayoutContext);
|
|
144
|
-
if (context === undefined) {
|
|
145
|
-
throw new Error('useLayout must be used within a LayoutProvider');
|
|
146
|
-
}
|
|
147
|
-
return context;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export function useOptionalLayout() {
|
|
151
|
-
return useContext(LayoutContext) ?? null;
|
|
152
|
-
}
|
|
142
|
+
export function useLayout() {
|
|
143
|
+
const context = useContext(LayoutContext);
|
|
144
|
+
if (context === undefined) {
|
|
145
|
+
throw new Error('useLayout must be used within a LayoutProvider');
|
|
146
|
+
}
|
|
147
|
+
return context;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export function useOptionalLayout() {
|
|
151
|
+
return useContext(LayoutContext) ?? null;
|
|
152
|
+
}
|
|
@@ -20,15 +20,15 @@ interface ThemeProviderProps {
|
|
|
20
20
|
storageKey?: string;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export function ThemeProvider({ children, disableDarkMode = false, defaultTheme, storageKey = 'xertica-theme' }: ThemeProviderProps) {
|
|
24
|
-
const getInitialTheme = (): Theme => {
|
|
25
|
-
if (disableDarkMode) return 'light';
|
|
26
|
-
if (defaultTheme) return defaultTheme;
|
|
27
|
-
if (typeof window !== 'undefined') {
|
|
28
|
-
const savedTheme = window.localStorage?.getItem(storageKey) as Theme;
|
|
29
|
-
if (savedTheme && (savedTheme === 'light' || savedTheme === 'dark')) {
|
|
30
|
-
return savedTheme;
|
|
31
|
-
}
|
|
23
|
+
export function ThemeProvider({ children, disableDarkMode = false, defaultTheme, storageKey = 'xertica-theme' }: ThemeProviderProps) {
|
|
24
|
+
const getInitialTheme = (): Theme => {
|
|
25
|
+
if (disableDarkMode) return 'light';
|
|
26
|
+
if (defaultTheme) return defaultTheme;
|
|
27
|
+
if (typeof window !== 'undefined') {
|
|
28
|
+
const savedTheme = window.localStorage?.getItem(storageKey) as Theme;
|
|
29
|
+
if (savedTheme && (savedTheme === 'light' || savedTheme === 'dark')) {
|
|
30
|
+
return savedTheme;
|
|
31
|
+
}
|
|
32
32
|
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
33
33
|
return 'dark';
|
|
34
34
|
}
|
|
@@ -42,12 +42,12 @@ export function ThemeProvider({ children, disableDarkMode = false, defaultTheme,
|
|
|
42
42
|
if (disableDarkMode && theme === 'dark') {
|
|
43
43
|
setThemeState('light');
|
|
44
44
|
}
|
|
45
|
-
}, [disableDarkMode, theme]);
|
|
46
|
-
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
if (typeof document === 'undefined') return;
|
|
49
|
-
const root = document.documentElement;
|
|
50
|
-
root.classList.remove('light', 'dark');
|
|
45
|
+
}, [disableDarkMode, theme]);
|
|
46
|
+
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (typeof document === 'undefined') return;
|
|
49
|
+
const root = document.documentElement;
|
|
50
|
+
root.classList.remove('light', 'dark');
|
|
51
51
|
|
|
52
52
|
if (theme === 'dark') {
|
|
53
53
|
root.classList.add('dark');
|
|
@@ -55,16 +55,16 @@ export function ThemeProvider({ children, disableDarkMode = false, defaultTheme,
|
|
|
55
55
|
root.classList.add('light');
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
if (typeof window !== 'undefined') {
|
|
59
|
-
window.localStorage?.setItem(storageKey, theme);
|
|
60
|
-
}
|
|
61
|
-
}, [theme, storageKey]);
|
|
62
|
-
|
|
63
|
-
useEffect(() => {
|
|
64
|
-
if (disableDarkMode) return;
|
|
65
|
-
if (typeof window === 'undefined' || !window.matchMedia) return;
|
|
66
|
-
if (!window.localStorage?.getItem(storageKey)) {
|
|
67
|
-
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
58
|
+
if (typeof window !== 'undefined') {
|
|
59
|
+
window.localStorage?.setItem(storageKey, theme);
|
|
60
|
+
}
|
|
61
|
+
}, [theme, storageKey]);
|
|
62
|
+
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (disableDarkMode) return;
|
|
65
|
+
if (typeof window === 'undefined' || !window.matchMedia) return;
|
|
66
|
+
if (!window.localStorage?.getItem(storageKey)) {
|
|
67
|
+
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
68
68
|
const handleChange = (e: MediaQueryListEvent) => {
|
|
69
69
|
setThemeState(e.matches ? 'dark' : 'light');
|
|
70
70
|
};
|
|
@@ -107,4 +107,4 @@ export function useTheme() {
|
|
|
107
107
|
throw new Error('useTheme must be used within a ThemeProvider');
|
|
108
108
|
}
|
|
109
109
|
return context;
|
|
110
|
-
}
|
|
110
|
+
}
|
package/contexts/theme-data.ts
CHANGED
|
@@ -78,10 +78,10 @@ export const colorThemes: ColorTheme[] = [
|
|
|
78
78
|
gradientEndDark: '#3A5C7D',
|
|
79
79
|
|
|
80
80
|
chart1: '#2C275B',
|
|
81
|
-
chart2: '#047857',
|
|
82
|
-
chart3: '#B45309',
|
|
83
|
-
chart4: '#1D4ED8',
|
|
84
|
-
chart5: '#B91C1C',
|
|
81
|
+
chart2: '#047857',
|
|
82
|
+
chart3: '#B45309',
|
|
83
|
+
chart4: '#1D4ED8',
|
|
84
|
+
chart5: '#B91C1C',
|
|
85
85
|
},
|
|
86
86
|
preview: {
|
|
87
87
|
primary: '#2C275B',
|
|
@@ -11,7 +11,7 @@ import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
|
11
11
|
import { OTPInput, OTPInputContext } from "input-otp";
|
|
12
12
|
import { Slot } from "@radix-ui/react-slot";
|
|
13
13
|
import { FormProvider, Controller, useFormContext, useFormState } from "react-hook-form";
|
|
14
|
-
import { L as Label, M as Map$1 } from "./alert-dialog-
|
|
14
|
+
import { L as Label, M as Map$1 } from "./alert-dialog-s-vmNkJ_.js";
|
|
15
15
|
import { getDefaultClassNames, DayPicker } from "react-day-picker";
|
|
16
16
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
17
17
|
import { Drawer as Drawer$1 } from "vaul";
|
|
@@ -24,7 +24,7 @@ import { C as Card, b as CardContent } from "./card-fi8zAN-I.js";
|
|
|
24
24
|
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
25
25
|
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
26
26
|
import useEmblaCarousel from "embla-carousel-react";
|
|
27
|
-
import { u as useGoogleMapsLoader } from "./google-maps-loader-
|
|
27
|
+
import { u as useGoogleMapsLoader } from "./google-maps-loader-CTYySAun.js";
|
|
28
28
|
import { BarChart, CartesianGrid, XAxis, Bar } from "recharts";
|
|
29
29
|
function AspectRatio({
|
|
30
30
|
...props
|
|
@@ -2911,7 +2911,7 @@ const Search = React.forwardRef(
|
|
|
2911
2911
|
}
|
|
2912
2912
|
);
|
|
2913
2913
|
Search.displayName = "Search";
|
|
2914
|
-
const __vite_import_meta_env__ = { "BASE_URL": "/", "DEV": false, "MODE": "production", "PROD": true, "SSR": false };
|
|
2914
|
+
const __vite_import_meta_env__ = { "BASE_URL": "/", "DEV": false, "MODE": "production", "PROD": true, "SSR": false, "VITE_GEMINI_API_KEY": "AIzaSyBnoWKe4LjQzlIklON_dVXMXNUl2gvfH6U", "VITE_GOOGLE_MAPS_API_KEY": "AIzaSyCj19NndSgZOb8057q24UbJtSsfVJiyVdo" };
|
|
2915
2915
|
const RouteMapContent = React__default.forwardRef(
|
|
2916
2916
|
({ apiKey, ...props }, ref) => {
|
|
2917
2917
|
const { isLoaded, loadError, load } = useGoogleMapsLoader();
|
|
@@ -3088,7 +3088,7 @@ RouteMapContent.displayName = "RouteMapContent";
|
|
|
3088
3088
|
const RouteMap = React__default.forwardRef(
|
|
3089
3089
|
(props, ref) => {
|
|
3090
3090
|
const { isLoaded, loadError } = useGoogleMapsLoader();
|
|
3091
|
-
const effectiveApiKey = props.apiKey || typeof import.meta !== "undefined" && __vite_import_meta_env__ &&
|
|
3091
|
+
const effectiveApiKey = props.apiKey || typeof import.meta !== "undefined" && __vite_import_meta_env__ && "AIzaSyCj19NndSgZOb8057q24UbJtSsfVJiyVdo" || "";
|
|
3092
3092
|
const isValidKey = effectiveApiKey && effectiveApiKey !== "YOUR_GOOGLE_MAPS_API_KEY_HERE" && effectiveApiKey.startsWith("AIza");
|
|
3093
3093
|
if (isLoaded || isValidKey || loadError) {
|
|
3094
3094
|
return /* @__PURE__ */ jsx(RouteMapContent, { ref, ...props, apiKey: effectiveApiKey });
|