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
|
@@ -11,7 +11,7 @@ const TogglePrimitive = require("@radix-ui/react-toggle");
|
|
|
11
11
|
const inputOtp = require("input-otp");
|
|
12
12
|
const reactSlot = require("@radix-ui/react-slot");
|
|
13
13
|
const reactHookForm = require("react-hook-form");
|
|
14
|
-
const alertDialog = require("./alert-dialog-
|
|
14
|
+
const alertDialog = require("./alert-dialog-DSKByiKZ.cjs");
|
|
15
15
|
const reactDayPicker = require("react-day-picker");
|
|
16
16
|
const DialogPrimitive = require("@radix-ui/react-dialog");
|
|
17
17
|
const vaul = require("vaul");
|
|
@@ -19,12 +19,12 @@ const HoverCardPrimitive = require("@radix-ui/react-hover-card");
|
|
|
19
19
|
const ContextMenuPrimitive = require("@radix-ui/react-context-menu");
|
|
20
20
|
const MenubarPrimitive = require("@radix-ui/react-menubar");
|
|
21
21
|
const cmdk = require("cmdk");
|
|
22
|
-
const richTextEditor = require("./rich-text-editor-
|
|
22
|
+
const richTextEditor = require("./rich-text-editor-mWoaSCE4.cjs");
|
|
23
23
|
const card = require("./card-DJTsYhLL.cjs");
|
|
24
24
|
const CollapsiblePrimitive = require("@radix-ui/react-collapsible");
|
|
25
25
|
const AccordionPrimitive = require("@radix-ui/react-accordion");
|
|
26
26
|
const useEmblaCarousel = require("embla-carousel-react");
|
|
27
|
-
const googleMapsLoader = require("./google-maps-loader-
|
|
27
|
+
const googleMapsLoader = require("./google-maps-loader-Y-QkD-Li.cjs");
|
|
28
28
|
const RechartsPrimitive = require("recharts");
|
|
29
29
|
var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;
|
|
30
30
|
function _interopNamespaceDefault(e) {
|
|
@@ -585,6 +585,80 @@ function PaginationEllipsis({
|
|
|
585
585
|
}
|
|
586
586
|
);
|
|
587
587
|
}
|
|
588
|
+
function usePagination({
|
|
589
|
+
totalItems,
|
|
590
|
+
pageSize = 10,
|
|
591
|
+
initialPage = 1,
|
|
592
|
+
page: controlledPage,
|
|
593
|
+
onPageChange,
|
|
594
|
+
siblingCount = 1
|
|
595
|
+
}) {
|
|
596
|
+
const [internalPage, setInternalPage] = React.useState(initialPage);
|
|
597
|
+
const isControlled = controlledPage !== void 0;
|
|
598
|
+
const currentPage = isControlled ? controlledPage : internalPage;
|
|
599
|
+
const totalPages = Math.max(1, Math.ceil(totalItems / pageSize));
|
|
600
|
+
const setPage = React.useCallback(
|
|
601
|
+
(p) => {
|
|
602
|
+
const clamped = Math.min(Math.max(1, p), totalPages);
|
|
603
|
+
if (!isControlled) setInternalPage(clamped);
|
|
604
|
+
onPageChange == null ? void 0 : onPageChange(clamped);
|
|
605
|
+
},
|
|
606
|
+
[isControlled, onPageChange, totalPages]
|
|
607
|
+
);
|
|
608
|
+
const startIndex = (currentPage - 1) * pageSize;
|
|
609
|
+
const endIndex = Math.min(startIndex + pageSize, totalItems);
|
|
610
|
+
const canGoPrev = currentPage > 1;
|
|
611
|
+
const canGoNext = currentPage < totalPages;
|
|
612
|
+
const isFirstPage = currentPage === 1;
|
|
613
|
+
const isLastPage = currentPage === totalPages;
|
|
614
|
+
const items = React.useMemo(() => {
|
|
615
|
+
const range = (start, end) => Array.from({ length: end - start + 1 }, (_, i) => start + i);
|
|
616
|
+
const leftSibling = Math.max(currentPage - siblingCount, 1);
|
|
617
|
+
const rightSibling = Math.min(currentPage + siblingCount, totalPages);
|
|
618
|
+
const showLeftEllipsis = leftSibling > 2;
|
|
619
|
+
const showRightEllipsis = rightSibling < totalPages - 1;
|
|
620
|
+
const result = [];
|
|
621
|
+
result.push({ type: "page", page: 1 });
|
|
622
|
+
if (showLeftEllipsis) {
|
|
623
|
+
result.push({ type: "ellipsis", key: "ellipsis-left" });
|
|
624
|
+
} else if (leftSibling === 2) {
|
|
625
|
+
result.push({ type: "page", page: 2 });
|
|
626
|
+
}
|
|
627
|
+
for (const p of range(Math.max(leftSibling, 2), Math.min(rightSibling, totalPages - 1))) {
|
|
628
|
+
result.push({ type: "page", page: p });
|
|
629
|
+
}
|
|
630
|
+
if (showRightEllipsis) {
|
|
631
|
+
result.push({ type: "ellipsis", key: "ellipsis-right" });
|
|
632
|
+
} else if (rightSibling === totalPages - 1) {
|
|
633
|
+
result.push({ type: "page", page: totalPages - 1 });
|
|
634
|
+
}
|
|
635
|
+
if (totalPages > 1) {
|
|
636
|
+
result.push({ type: "page", page: totalPages });
|
|
637
|
+
}
|
|
638
|
+
return result;
|
|
639
|
+
}, [currentPage, siblingCount, totalPages]);
|
|
640
|
+
const goTo = React.useCallback((p) => setPage(p), [setPage]);
|
|
641
|
+
const next = React.useCallback(() => setPage(currentPage + 1), [currentPage, setPage]);
|
|
642
|
+
const prev = React.useCallback(() => setPage(currentPage - 1), [currentPage, setPage]);
|
|
643
|
+
const first = React.useCallback(() => setPage(1), [setPage]);
|
|
644
|
+
const last = React.useCallback(() => setPage(totalPages), [setPage, totalPages]);
|
|
645
|
+
return {
|
|
646
|
+
currentPage,
|
|
647
|
+
totalPages,
|
|
648
|
+
startIndex,
|
|
649
|
+
endIndex,
|
|
650
|
+
canGoPrev,
|
|
651
|
+
canGoNext,
|
|
652
|
+
isFirstPage,
|
|
653
|
+
isLastPage,
|
|
654
|
+
items,
|
|
655
|
+
goTo,
|
|
656
|
+
next,
|
|
657
|
+
prev,
|
|
658
|
+
first,
|
|
659
|
+
last
|
|
660
|
+
};
|
|
661
|
+
}
|
|
588
662
|
const toggleVariants = classVarianceAuthority.cva(
|
|
589
663
|
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",
|
|
590
664
|
{
|
|
@@ -2083,33 +2157,39 @@ const TimelineDescription = React__namespace.forwardRef(({ className, ...props }
|
|
|
2083
2157
|
}
|
|
2084
2158
|
));
|
|
2085
2159
|
TimelineDescription.displayName = "TimelineDescription";
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2160
|
+
function useTreeView({
|
|
2161
|
+
data,
|
|
2162
|
+
defaultExpanded = [],
|
|
2163
|
+
selectedNodeId,
|
|
2164
|
+
onNodeClick,
|
|
2165
|
+
onNodeSelect
|
|
2166
|
+
}) {
|
|
2167
|
+
const [expanded, setExpanded] = React.useState(new Set(defaultExpanded));
|
|
2168
|
+
const [internalSelectedId, setInternalSelectedId] = React.useState(void 0);
|
|
2169
|
+
const nodeRefs = React.useRef(/* @__PURE__ */ new Map());
|
|
2170
|
+
const isControlled = selectedNodeId !== void 0;
|
|
2171
|
+
const effectiveSelectedId = isControlled ? selectedNodeId : internalSelectedId;
|
|
2172
|
+
const getNodeRef = React.useCallback(
|
|
2173
|
+
(nodeId) => (el) => {
|
|
2174
|
+
if (el) nodeRefs.current.set(nodeId, el);
|
|
2175
|
+
else nodeRefs.current.delete(nodeId);
|
|
2176
|
+
},
|
|
2177
|
+
[]
|
|
2178
|
+
);
|
|
2179
|
+
const getVisibleNodes = React.useCallback(() => {
|
|
2180
|
+
const result = [];
|
|
2181
|
+
const traverse = (nodes) => {
|
|
2182
|
+
var _a;
|
|
2183
|
+
for (const node of nodes) {
|
|
2184
|
+
result.push(node);
|
|
2185
|
+
if (((_a = node.children) == null ? void 0 : _a.length) && expanded.has(node.id)) traverse(node.children);
|
|
2186
|
+
}
|
|
2099
2187
|
};
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
result.push(node);
|
|
2106
|
-
if (((_a = node.children) == null ? void 0 : _a.length) && expanded.has(node.id)) traverse(node.children);
|
|
2107
|
-
}
|
|
2108
|
-
};
|
|
2109
|
-
traverse(data);
|
|
2110
|
-
return result;
|
|
2111
|
-
}, [data, expanded]);
|
|
2112
|
-
const findParent = (nodes, targetId) => {
|
|
2188
|
+
traverse(data);
|
|
2189
|
+
return result;
|
|
2190
|
+
}, [data, expanded]);
|
|
2191
|
+
const findParent = React.useCallback(
|
|
2192
|
+
(nodes, targetId) => {
|
|
2113
2193
|
var _a;
|
|
2114
2194
|
for (const n of nodes) {
|
|
2115
2195
|
if ((_a = n.children) == null ? void 0 : _a.some((c) => c.id === targetId)) return n;
|
|
@@ -2119,13 +2199,28 @@ const TreeView = React__namespace.forwardRef(
|
|
|
2119
2199
|
}
|
|
2120
2200
|
}
|
|
2121
2201
|
return null;
|
|
2122
|
-
}
|
|
2123
|
-
|
|
2202
|
+
},
|
|
2203
|
+
// findParent is a pure recursive function over `data` — no reactive deps needed
|
|
2204
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2205
|
+
[]
|
|
2206
|
+
);
|
|
2207
|
+
const toggleExpand = React.useCallback((nodeId) => {
|
|
2208
|
+
setExpanded((prev) => {
|
|
2209
|
+
const next = new Set(prev);
|
|
2210
|
+
next.has(nodeId) ? next.delete(nodeId) : next.add(nodeId);
|
|
2211
|
+
return next;
|
|
2212
|
+
});
|
|
2213
|
+
}, []);
|
|
2214
|
+
const handleSelect = React.useCallback(
|
|
2215
|
+
(node) => {
|
|
2124
2216
|
if (!isControlled) setInternalSelectedId(node.id);
|
|
2125
2217
|
onNodeSelect == null ? void 0 : onNodeSelect(node);
|
|
2126
2218
|
onNodeClick == null ? void 0 : onNodeClick(node);
|
|
2127
|
-
}
|
|
2128
|
-
|
|
2219
|
+
},
|
|
2220
|
+
[isControlled, onNodeClick, onNodeSelect]
|
|
2221
|
+
);
|
|
2222
|
+
const handleKeyDown = React.useCallback(
|
|
2223
|
+
(e, node) => {
|
|
2129
2224
|
var _a, _b;
|
|
2130
2225
|
const visibleNodes = getVisibleNodes();
|
|
2131
2226
|
const idx = visibleNodes.findIndex((n) => n.id === node.id);
|
|
@@ -2186,7 +2281,30 @@ const TreeView = React__namespace.forwardRef(
|
|
|
2186
2281
|
break;
|
|
2187
2282
|
}
|
|
2188
2283
|
}
|
|
2189
|
-
}
|
|
2284
|
+
},
|
|
2285
|
+
[data, expanded, findParent, getVisibleNodes, handleSelect, toggleExpand]
|
|
2286
|
+
);
|
|
2287
|
+
return {
|
|
2288
|
+
expanded,
|
|
2289
|
+
effectiveSelectedId,
|
|
2290
|
+
nodeRefs,
|
|
2291
|
+
getNodeRef,
|
|
2292
|
+
toggleExpand,
|
|
2293
|
+
handleSelect,
|
|
2294
|
+
handleKeyDown,
|
|
2295
|
+
getVisibleNodes
|
|
2296
|
+
};
|
|
2297
|
+
}
|
|
2298
|
+
const TreeView = React__namespace.forwardRef(
|
|
2299
|
+
({ className, data, onNodeClick, onNodeSelect, defaultExpanded = [], selectedNodeId, ...props }, ref) => {
|
|
2300
|
+
const {
|
|
2301
|
+
expanded,
|
|
2302
|
+
effectiveSelectedId,
|
|
2303
|
+
getNodeRef,
|
|
2304
|
+
toggleExpand,
|
|
2305
|
+
handleSelect,
|
|
2306
|
+
handleKeyDown
|
|
2307
|
+
} = useTreeView({ data, defaultExpanded, selectedNodeId, onNodeClick, onNodeSelect });
|
|
2190
2308
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: button.cn("w-full", className), role: "tree", ...props, children: data.map((node) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2191
2309
|
TreeNodeComponent,
|
|
2192
2310
|
{
|
|
@@ -2197,7 +2315,7 @@ const TreeView = React__namespace.forwardRef(
|
|
|
2197
2315
|
onToggle: toggleExpand,
|
|
2198
2316
|
onSelect: handleSelect,
|
|
2199
2317
|
onKeyDown: handleKeyDown,
|
|
2200
|
-
|
|
2318
|
+
getNodeRef
|
|
2201
2319
|
},
|
|
2202
2320
|
node.id
|
|
2203
2321
|
)) });
|
|
@@ -2212,7 +2330,7 @@ const TreeNodeComponent = ({
|
|
|
2212
2330
|
onToggle,
|
|
2213
2331
|
onSelect,
|
|
2214
2332
|
onKeyDown,
|
|
2215
|
-
|
|
2333
|
+
getNodeRef
|
|
2216
2334
|
}) => {
|
|
2217
2335
|
var _a;
|
|
2218
2336
|
const hasChildren = !!((_a = node.children) == null ? void 0 : _a.length);
|
|
@@ -2222,15 +2340,11 @@ const TreeNodeComponent = ({
|
|
|
2222
2340
|
if (hasChildren) onToggle(node.id);
|
|
2223
2341
|
onSelect(node);
|
|
2224
2342
|
};
|
|
2225
|
-
const setRef = (el) => {
|
|
2226
|
-
if (el) nodeRefs.current.set(node.id, el);
|
|
2227
|
-
else nodeRefs.current.delete(node.id);
|
|
2228
|
-
};
|
|
2229
2343
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "none", children: [
|
|
2230
2344
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2231
2345
|
"button",
|
|
2232
2346
|
{
|
|
2233
|
-
ref:
|
|
2347
|
+
ref: getNodeRef(node.id),
|
|
2234
2348
|
role: "treeitem",
|
|
2235
2349
|
"aria-expanded": hasChildren ? isExpanded : void 0,
|
|
2236
2350
|
"aria-selected": isSelected,
|
|
@@ -2260,7 +2374,7 @@ const TreeNodeComponent = ({
|
|
|
2260
2374
|
onToggle,
|
|
2261
2375
|
onSelect,
|
|
2262
2376
|
onKeyDown,
|
|
2263
|
-
|
|
2377
|
+
getNodeRef
|
|
2264
2378
|
},
|
|
2265
2379
|
child.id
|
|
2266
2380
|
)) })
|
|
@@ -2533,9 +2647,9 @@ function CarouselNext({
|
|
|
2533
2647
|
);
|
|
2534
2648
|
}
|
|
2535
2649
|
const StepperContext = React__namespace.createContext(void 0);
|
|
2536
|
-
const
|
|
2650
|
+
const useStepperContext = () => {
|
|
2537
2651
|
const context = React__namespace.useContext(StepperContext);
|
|
2538
|
-
if (!context) throw new Error("
|
|
2652
|
+
if (!context) throw new Error("useStepperContext must be used within a Stepper");
|
|
2539
2653
|
return context;
|
|
2540
2654
|
};
|
|
2541
2655
|
const Stepper = React__namespace.forwardRef(
|
|
@@ -2557,7 +2671,7 @@ const Stepper = React__namespace.forwardRef(
|
|
|
2557
2671
|
Stepper.displayName = "Stepper";
|
|
2558
2672
|
const Step = React__namespace.forwardRef(
|
|
2559
2673
|
({ step, label, description, error = false, className, ...props }, ref) => {
|
|
2560
|
-
const { currentStep, totalSteps, orientation } =
|
|
2674
|
+
const { currentStep, totalSteps, orientation } = useStepperContext();
|
|
2561
2675
|
const isActive = step === currentStep;
|
|
2562
2676
|
const isCompleted = step < currentStep && !error;
|
|
2563
2677
|
const isFirst = step === 1;
|
|
@@ -2601,24 +2715,68 @@ const Step = React__namespace.forwardRef(
|
|
|
2601
2715
|
}
|
|
2602
2716
|
);
|
|
2603
2717
|
Step.displayName = "Step";
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2718
|
+
function useStepper({
|
|
2719
|
+
totalSteps,
|
|
2720
|
+
initialStep = 1,
|
|
2721
|
+
step: controlledStep,
|
|
2722
|
+
onStepChange,
|
|
2723
|
+
onBeforeNext
|
|
2724
|
+
}) {
|
|
2725
|
+
const [internalStep, setInternalStep] = React.useState(initialStep);
|
|
2726
|
+
const isControlled = controlledStep !== void 0;
|
|
2727
|
+
const currentStep = isControlled ? controlledStep : internalStep;
|
|
2728
|
+
const setStep = React.useCallback(
|
|
2729
|
+
(s) => {
|
|
2730
|
+
const clamped = Math.min(Math.max(1, s), totalSteps);
|
|
2731
|
+
if (!isControlled) setInternalStep(clamped);
|
|
2732
|
+
onStepChange == null ? void 0 : onStepChange(clamped);
|
|
2733
|
+
},
|
|
2734
|
+
[isControlled, onStepChange, totalSteps]
|
|
2735
|
+
);
|
|
2736
|
+
const isFirstStep = currentStep === 1;
|
|
2737
|
+
const isLastStep = currentStep === totalSteps;
|
|
2738
|
+
const canGoPrev = currentStep > 1;
|
|
2739
|
+
const canGoNext = currentStep < totalSteps;
|
|
2740
|
+
const next = React.useCallback(async () => {
|
|
2741
|
+
if (!canGoNext) return;
|
|
2742
|
+
if (onBeforeNext) {
|
|
2743
|
+
const allowed = await onBeforeNext(currentStep);
|
|
2744
|
+
if (!allowed) return;
|
|
2745
|
+
}
|
|
2746
|
+
setStep(currentStep + 1);
|
|
2747
|
+
}, [canGoNext, currentStep, onBeforeNext, setStep]);
|
|
2748
|
+
const prev = React.useCallback(() => {
|
|
2749
|
+
if (!canGoPrev) return;
|
|
2750
|
+
setStep(currentStep - 1);
|
|
2751
|
+
}, [canGoPrev, currentStep, setStep]);
|
|
2752
|
+
const goTo = React.useCallback((s) => setStep(s), [setStep]);
|
|
2753
|
+
const reset = React.useCallback(() => setStep(1), [setStep]);
|
|
2754
|
+
return {
|
|
2755
|
+
currentStep,
|
|
2756
|
+
totalSteps,
|
|
2757
|
+
isFirstStep,
|
|
2758
|
+
isLastStep,
|
|
2759
|
+
canGoPrev,
|
|
2760
|
+
canGoNext,
|
|
2761
|
+
next,
|
|
2762
|
+
prev,
|
|
2763
|
+
goTo,
|
|
2764
|
+
reset
|
|
2765
|
+
};
|
|
2766
|
+
}
|
|
2767
|
+
function useFileUpload({
|
|
2768
|
+
maxFiles = 1,
|
|
2769
|
+
maxSize = 5 * 1024 * 1024,
|
|
2770
|
+
onFilesChange,
|
|
2771
|
+
onError,
|
|
2772
|
+
disabled = false
|
|
2773
|
+
} = {}) {
|
|
2774
|
+
const [files, setFiles] = React.useState([]);
|
|
2775
|
+
const [dragActive, setDragActive] = React.useState(false);
|
|
2776
|
+
const [errorMessage, setErrorMessage] = React.useState(null);
|
|
2777
|
+
const inputRef = React.useRef(null);
|
|
2778
|
+
const handleFiles = React.useCallback(
|
|
2779
|
+
(newFiles) => {
|
|
2622
2780
|
if (!newFiles) return;
|
|
2623
2781
|
setErrorMessage(null);
|
|
2624
2782
|
const filesArray = Array.from(newFiles);
|
|
@@ -2626,52 +2784,107 @@ const FileUpload = React__namespace.forwardRef(
|
|
|
2626
2784
|
const validFiles = filesArray.filter((f) => f.size <= maxSize);
|
|
2627
2785
|
if (oversized.length > 0) {
|
|
2628
2786
|
const limitMB = (maxSize / 1024 / 1024).toFixed(0);
|
|
2629
|
-
setErrorMessage(
|
|
2787
|
+
setErrorMessage(
|
|
2788
|
+
`${oversized.length} file(s) exceed the ${limitMB}MB limit and were not added.`
|
|
2789
|
+
);
|
|
2630
2790
|
onError == null ? void 0 : onError(oversized, "size");
|
|
2631
2791
|
}
|
|
2632
2792
|
const merged = maxFiles === 1 ? validFiles.slice(0, 1) : [...files, ...validFiles].slice(0, maxFiles);
|
|
2633
2793
|
const countRejected = maxFiles === 1 ? validFiles.slice(1) : [...files, ...validFiles].slice(maxFiles);
|
|
2634
2794
|
if (countRejected.length > 0) {
|
|
2635
|
-
setErrorMessage(
|
|
2795
|
+
setErrorMessage(
|
|
2796
|
+
`Only ${maxFiles} file(s) allowed. ${countRejected.length} file(s) were not added.`
|
|
2797
|
+
);
|
|
2636
2798
|
onError == null ? void 0 : onError(countRejected, "count");
|
|
2637
2799
|
}
|
|
2638
2800
|
setFiles(merged);
|
|
2639
2801
|
onFilesChange == null ? void 0 : onFilesChange(merged);
|
|
2640
|
-
}
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
}
|
|
2650
|
-
|
|
2802
|
+
},
|
|
2803
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2804
|
+
[files, maxFiles, maxSize, onError, onFilesChange]
|
|
2805
|
+
);
|
|
2806
|
+
const handleDrag = React.useCallback((e) => {
|
|
2807
|
+
e.preventDefault();
|
|
2808
|
+
e.stopPropagation();
|
|
2809
|
+
if (e.type === "dragenter" || e.type === "dragover") {
|
|
2810
|
+
setDragActive(true);
|
|
2811
|
+
} else if (e.type === "dragleave") {
|
|
2812
|
+
setDragActive(false);
|
|
2813
|
+
}
|
|
2814
|
+
}, []);
|
|
2815
|
+
const handleDrop = React.useCallback(
|
|
2816
|
+
(e) => {
|
|
2651
2817
|
e.preventDefault();
|
|
2652
2818
|
e.stopPropagation();
|
|
2653
2819
|
setDragActive(false);
|
|
2654
2820
|
if (disabled) return;
|
|
2655
2821
|
handleFiles(e.dataTransfer.files);
|
|
2656
|
-
}
|
|
2657
|
-
|
|
2822
|
+
},
|
|
2823
|
+
[disabled, handleFiles]
|
|
2824
|
+
);
|
|
2825
|
+
const handleChange = React.useCallback(
|
|
2826
|
+
(e) => {
|
|
2658
2827
|
e.preventDefault();
|
|
2659
2828
|
if (disabled) return;
|
|
2660
2829
|
handleFiles(e.target.files);
|
|
2661
|
-
}
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2830
|
+
},
|
|
2831
|
+
[disabled, handleFiles]
|
|
2832
|
+
);
|
|
2833
|
+
const removeFile = React.useCallback(
|
|
2834
|
+
(index) => {
|
|
2835
|
+
setFiles((prev) => {
|
|
2836
|
+
const updated = prev.filter((_, i) => i !== index);
|
|
2837
|
+
onFilesChange == null ? void 0 : onFilesChange(updated);
|
|
2838
|
+
if (updated.length === 0) setErrorMessage(null);
|
|
2839
|
+
return updated;
|
|
2840
|
+
});
|
|
2841
|
+
},
|
|
2842
|
+
[onFilesChange]
|
|
2843
|
+
);
|
|
2844
|
+
const openFileDialog = React.useCallback(() => {
|
|
2845
|
+
var _a;
|
|
2846
|
+
if (!disabled) {
|
|
2847
|
+
setErrorMessage(null);
|
|
2848
|
+
(_a = inputRef.current) == null ? void 0 : _a.click();
|
|
2849
|
+
}
|
|
2850
|
+
}, [disabled]);
|
|
2851
|
+
return {
|
|
2852
|
+
files,
|
|
2853
|
+
dragActive,
|
|
2854
|
+
errorMessage,
|
|
2855
|
+
inputRef,
|
|
2856
|
+
handleFiles,
|
|
2857
|
+
handleDrag,
|
|
2858
|
+
handleDrop,
|
|
2859
|
+
handleChange,
|
|
2860
|
+
removeFile,
|
|
2861
|
+
openFileDialog
|
|
2862
|
+
};
|
|
2863
|
+
}
|
|
2864
|
+
const FileUpload = React__namespace.forwardRef(
|
|
2865
|
+
({
|
|
2866
|
+
className,
|
|
2867
|
+
onFilesChange,
|
|
2868
|
+
maxFiles = 1,
|
|
2869
|
+
maxSize = 5 * 1024 * 1024,
|
|
2870
|
+
// 5MB default
|
|
2871
|
+
showPreview = true,
|
|
2872
|
+
onError,
|
|
2873
|
+
accept,
|
|
2874
|
+
disabled,
|
|
2875
|
+
...props
|
|
2876
|
+
}, ref) => {
|
|
2877
|
+
const {
|
|
2878
|
+
files,
|
|
2879
|
+
dragActive,
|
|
2880
|
+
errorMessage,
|
|
2881
|
+
inputRef,
|
|
2882
|
+
handleDrag,
|
|
2883
|
+
handleDrop,
|
|
2884
|
+
handleChange,
|
|
2885
|
+
removeFile,
|
|
2886
|
+
openFileDialog
|
|
2887
|
+
} = useFileUpload({ maxFiles, maxSize, onFilesChange, onError, disabled });
|
|
2675
2888
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: button.cn("w-full", className), children: [
|
|
2676
2889
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2677
2890
|
"div",
|
|
@@ -2949,7 +3162,7 @@ const Search = React__namespace.forwardRef(
|
|
|
2949
3162
|
}
|
|
2950
3163
|
);
|
|
2951
3164
|
Search.displayName = "Search";
|
|
2952
|
-
const __vite_import_meta_env__ = { "BASE_URL": "/", "DEV": false, "MODE": "production", "PROD": true, "SSR": false };
|
|
3165
|
+
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" };
|
|
2953
3166
|
const RouteMapContent = React.forwardRef(
|
|
2954
3167
|
({ apiKey, ...props }, ref) => {
|
|
2955
3168
|
const { isLoaded, loadError, load } = googleMapsLoader.useGoogleMapsLoader();
|
|
@@ -3126,7 +3339,7 @@ RouteMapContent.displayName = "RouteMapContent";
|
|
|
3126
3339
|
const RouteMap = React.forwardRef(
|
|
3127
3340
|
(props, ref) => {
|
|
3128
3341
|
const { isLoaded, loadError } = googleMapsLoader.useGoogleMapsLoader();
|
|
3129
|
-
const effectiveApiKey = props.apiKey || typeof { url: typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("AssistantChart-
|
|
3342
|
+
const effectiveApiKey = props.apiKey || typeof { url: typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("AssistantChart-CldVCVDe.cjs", document.baseURI).href } !== "undefined" && __vite_import_meta_env__ && "AIzaSyCj19NndSgZOb8057q24UbJtSsfVJiyVdo" || "";
|
|
3130
3343
|
const isValidKey = effectiveApiKey && effectiveApiKey !== "YOUR_GOOGLE_MAPS_API_KEY_HERE" && effectiveApiKey.startsWith("AIza");
|
|
3131
3344
|
if (isLoaded || isValidKey || loadError) {
|
|
3132
3345
|
return /* @__PURE__ */ jsxRuntime.jsx(RouteMapContent, { ref, ...props, apiKey: effectiveApiKey });
|
|
@@ -3370,5 +3583,9 @@ exports.ToggleGroupItem = ToggleGroupItem;
|
|
|
3370
3583
|
exports.TreeView = TreeView;
|
|
3371
3584
|
exports.navigationMenuTriggerStyle = navigationMenuTriggerStyle;
|
|
3372
3585
|
exports.toggleVariants = toggleVariants;
|
|
3586
|
+
exports.useFileUpload = useFileUpload;
|
|
3373
3587
|
exports.useFormField = useFormField;
|
|
3588
|
+
exports.usePagination = usePagination;
|
|
3374
3589
|
exports.useStepper = useStepper;
|
|
3590
|
+
exports.useStepperContext = useStepperContext;
|
|
3591
|
+
exports.useTreeView = useTreeView;
|