xertica-ui 2.3.0 → 2.4.0
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 +564 -552
- package/README.md +417 -406
- package/assets/xertica-logo.svg +37 -37
- package/assets/xertica-x-logo.svg +20 -20
- package/bin/cli.ts +1244 -1155
- package/bin/language-config.ts +358 -361
- package/components/assistant/code-block/CodeBlock.tsx +268 -268
- package/components/assistant/formatted-document/FormattedDocument.tsx +147 -147
- package/components/assistant/modern-chat-input/ModernChatInput.tsx +564 -554
- package/components/assistant/xertica-assistant/parts/AssistantCollapsedView.tsx +99 -99
- package/components/assistant/xertica-assistant/parts/AssistantConversationList.tsx +104 -106
- package/components/assistant/xertica-assistant/parts/AssistantDocumentEditor.tsx +81 -81
- package/components/assistant/xertica-assistant/parts/AssistantFeedbackDialog.tsx +88 -78
- package/components/assistant/xertica-assistant/parts/AssistantHeader.tsx +75 -75
- package/components/assistant/xertica-assistant/parts/AssistantMessageBubble.tsx +564 -560
- package/components/assistant/xertica-assistant/parts/AssistantTabBar.tsx +67 -67
- package/components/assistant/xertica-assistant/parts/AssistantWelcomeScreen.tsx +103 -103
- package/components/assistant/xertica-assistant/use-assistant.ts +615 -615
- package/components/assistant/xertica-assistant/xertica-assistant.tsx +611 -613
- package/components/blocks/card-patterns/ActivityCard.tsx +100 -100
- package/components/blocks/card-patterns/ActivityCardSkeleton.tsx +56 -56
- package/components/blocks/card-patterns/FeatureCardSkeleton.tsx +58 -63
- package/components/blocks/card-patterns/NotificationCard.tsx +140 -140
- package/components/blocks/card-patterns/NotificationCardSkeleton.tsx +81 -81
- package/components/blocks/card-patterns/ProfileCard.tsx +112 -114
- package/components/blocks/card-patterns/ProfileCardSkeleton.tsx +69 -69
- package/components/blocks/card-patterns/ProjectCard.tsx +123 -123
- package/components/blocks/card-patterns/ProjectCardSkeleton.tsx +67 -72
- package/components/blocks/card-patterns/QuickActionCardSkeleton.tsx +44 -44
- package/components/blocks/card-patterns/card-patterns.stories.tsx +594 -594
- package/components/blocks/card-patterns/index.ts +29 -29
- package/components/brand/language-selector/LanguageSelector.tsx +102 -102
- package/components/brand/language-selector/language-selector.stories.tsx +111 -114
- package/components/brand/language-selector/language-selector.test.tsx +101 -101
- package/components/brand/theme-toggle/ThemeToggle.tsx +74 -70
- package/components/brand/xertica-provider/XerticaProvider.tsx +109 -112
- package/components/brand/xertica-provider/xertica-provider.mdx +61 -61
- package/components/index.ts +86 -90
- package/components/layout/sidebar/sidebar.mdx +1 -1
- package/components/layout/sidebar/sidebar.tsx +1079 -1073
- package/components/media/FloatingMediaWrapper.tsx +371 -371
- package/components/media/audio-player/AudioPlayer.tsx +768 -766
- package/components/media/video-player/VideoPlayer.tsx +310 -310
- package/components/pages/forgot-password-page/ForgotPasswordPage.tsx +1 -1
- package/components/pages/home-content/HomeContent.tsx +120 -120
- package/components/pages/home-content/home-content.mdx +62 -62
- package/components/pages/home-page/HomePage.tsx +78 -74
- package/components/pages/home-page/home-page.mdx +53 -53
- package/components/pages/login-page/LoginPage.tsx +218 -216
- package/components/pages/reset-password-page/ResetPasswordPage.tsx +243 -239
- package/components/pages/template-content/TemplateContent.tsx +1354 -1235
- package/components/pages/template-content/template-content.mdx +61 -61
- package/components/pages/template-page/template-page.mdx +53 -53
- package/components/pages/verify-email-page/VerifyEmailPage.tsx +206 -206
- package/components/shared/error-boundary.stories.tsx +4 -22
- package/components/shared/error-boundary.tsx +1 -5
- package/components/shared/error-fallbacks.tsx +4 -8
- package/components/ui/accordion/accordion.mdx +8 -8
- 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/breadcrumb/breadcrumb.mdx +8 -8
- package/components/ui/button/button.mdx +8 -8
- package/components/ui/calendar/calendar.mdx +8 -8
- package/components/ui/card/card.mdx +8 -8
- package/components/ui/carousel/carousel.mdx +8 -8
- package/components/ui/chart/chart.mdx +8 -8
- package/components/ui/checkbox/checkbox.mdx +8 -8
- 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/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/label/label.mdx +8 -8
- package/components/ui/map/map.mdx +8 -8
- package/components/ui/menubar/menubar.mdx +8 -8
- package/components/ui/navigation-menu/navigation-menu.mdx +8 -8
- package/components/ui/notification-badge/notification-badge.mdx +8 -8
- package/components/ui/pagination/pagination.mdx +8 -8
- package/components/ui/popover/popover.mdx +8 -8
- package/components/ui/progress/progress.mdx +8 -8
- package/components/ui/radio-group/radio-group.mdx +8 -8
- package/components/ui/rating/rating.mdx +8 -8
- package/components/ui/resizable/resizable.mdx +8 -8
- package/components/ui/route-map/route-map.mdx +8 -8
- package/components/ui/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/separator/separator.mdx +8 -8
- package/components/ui/sheet/sheet.mdx +8 -8
- package/components/ui/simple-map/simple-map.mdx +8 -8
- 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/index.ts +2 -2
- package/components/ui/stats-card/stats-card-skeleton.tsx +60 -62
- package/components/ui/stats-card/stats-card.mdx +8 -8
- package/components/ui/stats-card/stats-card.stories.tsx +99 -99
- package/components/ui/stepper/stepper.mdx +8 -8
- package/components/ui/switch/switch.mdx +8 -8
- package/components/ui/table/table.mdx +8 -8
- package/components/ui/tabs/tabs.mdx +8 -8
- package/components/ui/textarea/textarea.mdx +8 -8
- package/components/ui/timeline/timeline.mdx +8 -8
- package/components/ui/toggle/toggle.mdx +8 -8
- package/components/ui/toggle-group/toggle-group.mdx +8 -8
- package/components/ui/tooltip/tooltip.mdx +8 -8
- package/components/ui/tree-view/tree-view.mdx +8 -8
- package/components.json +892 -892
- package/contexts/AuthContext.tsx +11 -8
- package/contexts/LanguageContext.test.tsx +121 -121
- package/contexts/LanguageContext.tsx +250 -251
- package/dist/{AssistantChart-DoZCyS5r.cjs → AssistantChart-9w31gdAb.cjs} +4 -4
- package/dist/{AssistantChart-CldVCVDe.cjs → AssistantChart-BAudAfne.cjs} +5 -5
- package/dist/{AssistantChart-Bdd44uBn.cjs → AssistantChart-BAx9VQvb.cjs} +127 -388
- package/dist/{AssistantChart-Cu3m7RBo.js → AssistantChart-BP8upjMk.js} +5 -5
- package/dist/{AssistantChart-CFhDdGyU.js → AssistantChart-CVko2A1W.js} +130 -391
- package/dist/{AssistantChart-C_hwFRRr.js → AssistantChart-CVzmmhx4.js} +4 -4
- package/dist/{AudioPlayer-IAU5q5T1.cjs → AudioPlayer-1ypwE2Wh.cjs} +1 -1
- package/dist/{AudioPlayer-CGRUtUdN.js → AudioPlayer-DuKXrCfy.js} +1 -1
- package/dist/{LanguageContext-CS14yCpi.js → LanguageContext-BwhwC3G2.js} +2 -2
- package/dist/{LanguageContext-B_KFTCzT.cjs → LanguageContext-DvUt5jBg.cjs} +2 -2
- package/dist/{ThemeContext-C2EwAPDt.js → ThemeContext-BbBNoFTG.js} +2 -2
- package/dist/{ThemeContext-Bmod0Cg2.cjs → ThemeContext-BblcjQup.cjs} +13 -8
- package/dist/{ThemeContext-BWq9ACPo.js → ThemeContext-Bo-W2WZH.js} +13 -8
- package/dist/{ThemeContext-j5aGtPky.cjs → ThemeContext-CP3a0jxy.cjs} +193 -262
- package/dist/{ThemeContext-vTjumZeM.cjs → ThemeContext-Cmr8Ex8H.cjs} +2 -2
- package/dist/ThemeContext-CpqYShLq.cjs +324 -0
- package/dist/{ThemeContext-CQSo4Iwc.js → ThemeContext-D3LzacmG.js} +8 -1
- package/dist/ThemeContext-Du2nE1PL.js +325 -0
- package/dist/ThemeContext-GeEBTJ3q.cjs +1621 -0
- package/dist/ThemeContext-JyLK9B1o.js +1622 -0
- package/dist/{ThemeContext-CGk3KK0k.cjs → ThemeContext-U4dEYc6C.cjs} +8 -1
- package/dist/{ThemeContext-BXjrgUjW.js → ThemeContext-ept8jhXI.js} +200 -261
- package/dist/{VerifyEmailPage-C0c2e5n0.js → VerifyEmailPage-BE-L9mB7.js} +7 -7
- package/dist/{VerifyEmailPage-DSBMRHtl.js → VerifyEmailPage-BIBOKV7Z.js} +41 -36
- package/dist/{VerifyEmailPage-DgIid028.js → VerifyEmailPage-BJjAMUTW.js} +4 -4
- package/dist/{VerifyEmailPage--1Vurewl.cjs → VerifyEmailPage-BRSP-Pwt.cjs} +3 -3
- package/dist/{VerifyEmailPage-Cwi3kbol.cjs → VerifyEmailPage-Bae2cBXT.cjs} +7 -7
- package/dist/{VerifyEmailPage-De6bQjrz.cjs → VerifyEmailPage-BiRm7Nh4.cjs} +41 -36
- package/dist/{VerifyEmailPage-ByerOcm4.cjs → VerifyEmailPage-Bv8Ah_TK.cjs} +23 -20
- package/dist/VerifyEmailPage-Bvfv8HVQ.js +3214 -0
- package/dist/{VerifyEmailPage-BComraR7.cjs → VerifyEmailPage-CR7kb5df.cjs} +22 -12
- package/dist/{VerifyEmailPage-MTD7AG1Z.js → VerifyEmailPage-C_ihbcth.js} +4 -4
- package/dist/{VerifyEmailPage-1WwWczAn.js → VerifyEmailPage-CbgjOF0v.js} +22 -12
- package/dist/{VerifyEmailPage-DvMLZgFt.js → VerifyEmailPage-CdYPSJoO.js} +1 -1
- package/dist/{VerifyEmailPage-By3Jf__L.cjs → VerifyEmailPage-CkBYfsNy.cjs} +4 -4
- package/dist/{VerifyEmailPage-CJLz3jrn.js → VerifyEmailPage-Cyl55sJb.js} +23 -20
- package/dist/VerifyEmailPage-D-FRj5TU.cjs +3213 -0
- package/dist/VerifyEmailPage-DF2ilhum.cjs +3210 -0
- package/dist/{VerifyEmailPage-CYXtbKi3.cjs → VerifyEmailPage-DMBh4NM9.cjs} +1 -1
- package/dist/{VerifyEmailPage-CgMxRb4z.js → VerifyEmailPage-DTtFfC-J.js} +3 -3
- package/dist/{VerifyEmailPage-CFLMls1p.cjs → VerifyEmailPage-Dt7zgA4w.cjs} +4 -4
- package/dist/VerifyEmailPage-EhudUdqF.js +3211 -0
- package/dist/{VerifyEmailPage-C5TNQTBa.js → VerifyEmailPage-X14vhdyl.js} +148 -75
- package/dist/VerifyEmailPage-hdB8JQGv.cjs +3213 -0
- package/dist/{VerifyEmailPage-B4peJjAT.cjs → VerifyEmailPage-u_Dn7t1U.cjs} +148 -75
- package/dist/VerifyEmailPage-vYHbYK3q.js +3214 -0
- package/dist/{XerticaProvider-CBGc4EMA.cjs → XerticaProvider-AChwphCO.cjs} +4 -4
- package/dist/{XerticaProvider-BIrqfZ-i.cjs → XerticaProvider-AbWlr7Af.cjs} +8 -11
- package/dist/{XerticaProvider-D-yNhF94.cjs → XerticaProvider-B8CaV7xu.cjs} +1 -1
- package/dist/{XerticaProvider-DDuiIcKo.js → XerticaProvider-BErr83Bg.js} +14 -11
- package/dist/{XerticaProvider-CEoWMTxu.js → XerticaProvider-BITjgC5p.js} +2 -2
- package/dist/{XerticaProvider-CllrbMEJ.cjs → XerticaProvider-By8q3Roe.cjs} +2 -2
- package/dist/{XerticaProvider-C1DKnvLh.js → XerticaProvider-CUYJZc32.js} +4 -4
- package/dist/{XerticaProvider-ET0ihewn.cjs → XerticaProvider-CW9hpCdF.cjs} +2 -2
- package/dist/{XerticaProvider-Dt5HEzbQ.js → XerticaProvider-CWgby5mY.js} +10 -10
- package/dist/XerticaProvider-CWs6EwNa.js +49 -0
- package/dist/XerticaProvider-CjQAQPcn.cjs +48 -0
- package/dist/XerticaProvider-CwOkHxiT.cjs +44 -0
- package/dist/XerticaProvider-D5lLumH-.js +49 -0
- package/dist/{XerticaProvider-DYq4JWtg.js → XerticaProvider-DQtvJU7m.js} +1 -1
- package/dist/XerticaProvider-qQUDop71.cjs +48 -0
- package/dist/{XerticaProvider-B7EVH-NF.js → XerticaProvider-siSt9uG2.js} +2 -2
- package/dist/{XerticaXLogo-Zw2B276b.cjs → XerticaXLogo-8TTzBjHw.cjs} +1 -1
- package/dist/{XerticaXLogo-B7xQ5dhi.js → XerticaXLogo-BWaag64t.js} +1 -1
- package/dist/{XerticaXLogo-DZbo4vOE.js → XerticaXLogo-BX3ueACh.js} +5 -2
- package/dist/XerticaXLogo-CFuIlYFH.js +252 -0
- package/dist/XerticaXLogo-CU-U-GP4.cjs +251 -0
- package/dist/XerticaXLogo-ChryA6xj.js +252 -0
- package/dist/{XerticaXLogo-CQUUjXoH.cjs → XerticaXLogo-CziKMQil.cjs} +8 -8
- package/dist/XerticaXLogo-DHz5SugF.js +252 -0
- package/dist/XerticaXLogo-DTee_y8X.cjs +251 -0
- package/dist/{XerticaXLogo-Cmsp-Eey.js → XerticaXLogo-DfUvz-lD.js} +9 -9
- package/dist/XerticaXLogo-kslQ8Tk_.cjs +251 -0
- package/dist/{XerticaXLogo-bvZSgwGF.cjs → XerticaXLogo-qBPhwK3g.cjs} +5 -2
- package/dist/{alert-dialog-s-vmNkJ_.js → alert-dialog-iDe5VE5o.js} +3 -3
- package/dist/{alert-dialog-DSKByiKZ.cjs → alert-dialog-yckpaOpy.cjs} +3 -3
- package/dist/assistant.cjs.js +1 -1
- package/dist/assistant.es.js +1 -1
- package/dist/brand.cjs.js +2 -2
- package/dist/brand.es.js +2 -2
- package/dist/cli.js +90 -37
- package/dist/components/brand/theme-toggle/ThemeToggle.d.ts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/{google-maps-loader-Y-QkD-Li.cjs → google-maps-loader-BqsYL48U.cjs} +0 -5
- package/dist/{google-maps-loader-CTYySAun.js → google-maps-loader-t2IlYBzw.js} +0 -4
- package/dist/index-CkTUgOwX.js +8 -0
- package/dist/{index-COtD8bRW.cjs → index-D3RLKRAs.cjs} +1 -1
- package/dist/index.cjs.js +5 -5
- package/dist/index.es.js +5 -5
- package/dist/index.umd.js +454 -1027
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +1 -1
- package/dist/pages.cjs.js +1 -1
- package/dist/pages.es.js +1 -1
- package/dist/{sidebar-DAaY8bRU.cjs → sidebar-B3EYhli0.cjs} +33 -24
- package/dist/{sidebar-B6SlKZYN.js → sidebar-B4ZWaMrE.js} +1 -1
- package/dist/{sidebar-DQj1z3jG.cjs → sidebar-B9NR0lCe.cjs} +269 -227
- package/dist/{sidebar-nzPoVHBQ.cjs → sidebar-BS1p2V7t.cjs} +1 -1
- package/dist/sidebar-BvF5I2Ue.cjs +800 -0
- package/dist/{sidebar-q7P2Godd.cjs → sidebar-C5B_LHek.cjs} +1 -1
- package/dist/{sidebar-CrQDDdcz.js → sidebar-CA6_ek3f.js} +33 -24
- package/dist/{sidebar-BxGXsDAd.cjs → sidebar-CVUGHOS_.cjs} +8 -16
- package/dist/{sidebar-BViy8Eeu.js → sidebar-CmvwjnVb.js} +9 -17
- package/dist/sidebar-CplprZpM.js +801 -0
- package/dist/{sidebar-BbVIQvlP.js → sidebar-Dz7bd3zP.js} +1 -1
- package/dist/sidebar-KIS0C2JH.js +801 -0
- package/dist/sidebar-OTO_up7Z.js +801 -0
- package/dist/sidebar-zowjejT2.cjs +800 -0
- package/dist/{use-audio-player-nv8ZSGa1.js → use-audio-player-Bkh23vQ3.js} +3 -7
- package/dist/{use-audio-player-NKsWyjWu.cjs → use-audio-player-Dn1NR9xN.cjs} +3 -7
- package/dist/{xertica-assistant-dyP7KHM5.cjs → xertica-assistant-B1IaHXnB.cjs} +388 -529
- package/dist/{xertica-assistant-DCsnQyi5.js → xertica-assistant-B1NaSFFj.js} +46 -29
- package/dist/{xertica-assistant-ciJaWqm1.js → xertica-assistant-BMqdyRVi.js} +10 -28
- package/dist/{xertica-assistant-V_IdW4WF.cjs → xertica-assistant-Bj3vBCq_.cjs} +9 -27
- package/dist/{xertica-assistant-CrgTb6Hs.cjs → xertica-assistant-CIaUlbIt.cjs} +47 -22
- package/dist/{xertica-assistant-yX1CFBBo.js → xertica-assistant-DPsESB6t.js} +390 -531
- package/dist/{CodeBlock-BgfYL_rD.cjs → xertica-assistant-Qp3ydksa.cjs} +51 -263
- package/dist/{CodeBlock-BeSt1h5P.js → xertica-assistant-gnCJdcZY.js} +7 -219
- package/dist/xertica-ui.css +2 -2
- package/docs/architecture-improvements.md +456 -456
- package/docs/architecture.md +312 -306
- package/docs/components/assistant.md +428 -428
- package/docs/components/branding.md +252 -252
- package/docs/components/card-patterns.md +447 -445
- package/docs/components/error-boundary.md +32 -22
- package/docs/components/hooks.md +432 -430
- package/docs/components/language-selector.md +176 -172
- package/docs/components/pages.md +20 -6
- package/docs/doc-audit.md +244 -243
- package/docs/getting-started.md +616 -603
- package/docs/guidelines.md +330 -328
- package/docs/i18n.md +480 -476
- package/docs/installation.md +7 -6
- package/docs/llms.md +295 -295
- package/docs/state-management.md +289 -289
- package/guidelines/Guidelines.md +409 -406
- package/llms-compact.txt +1 -1
- package/llms.txt +1 -1
- package/package.json +219 -219
- package/styles/xertica/base.css +6 -0
- package/templates/.prettierignore +4 -4
- package/templates/.prettierrc +10 -10
- package/templates/CLAUDE.md +180 -165
- package/templates/guidelines/Guidelines.md +577 -553
- package/templates/package.json +69 -69
- package/templates/src/app/App.tsx +46 -46
- package/templates/src/app/components/AuthGuard.tsx +57 -8
- package/templates/src/features/assistant/data/mock.ts +75 -75
- package/templates/src/features/assistant/hooks/useAssistantConfig.ts +20 -20
- package/templates/src/features/assistant/index.ts +5 -5
- package/templates/src/features/auth/ui/AuthPageShell.tsx +1 -1
- package/templates/src/features/auth/ui/ForgotPasswordContent.tsx +70 -72
- package/templates/src/features/auth/ui/LoginContent.tsx +92 -92
- package/templates/src/features/auth/ui/ResetPasswordContent.tsx +183 -179
- package/templates/src/features/auth/ui/SocialLoginButtons.tsx +78 -78
- package/templates/src/features/auth/ui/VerifyEmailContent.tsx +80 -84
- package/templates/src/features/home/data/mock.ts +6 -0
- package/templates/src/features/home/hooks/useFeatureCards.ts +20 -20
- package/templates/src/features/home/index.ts +11 -11
- package/templates/src/features/home/ui/HomeContent.tsx +117 -119
- package/templates/src/features/template/ui/CrudTemplate.tsx +112 -115
- package/templates/src/features/template/ui/DashboardTemplate.tsx +110 -110
- package/templates/src/features/template/ui/FormTemplate.tsx +117 -117
- package/templates/src/features/template/ui/LoginTemplate.tsx +59 -59
- package/templates/src/features/template/ui/TemplateContent.tsx +1322 -1314
- package/templates/src/i18n.ts +124 -124
- package/templates/src/locales/en/common.json +21 -21
- package/templates/src/locales/en/components/activityCard.json +10 -10
- package/templates/src/locales/en/components/assistant.json +119 -119
- package/templates/src/locales/en/components/media.json +29 -29
- package/templates/src/locales/en/components/notificationCard.json +5 -5
- package/templates/src/locales/en/components/profileCard.json +8 -8
- package/templates/src/locales/en/components/projectCard.json +10 -10
- package/templates/src/locales/en/components/sidebar.json +14 -14
- package/templates/src/locales/en/components/stats.json +8 -8
- package/templates/src/locales/en/components/team.json +14 -14
- package/templates/src/locales/en/errors.json +9 -9
- package/templates/src/locales/en/languageSelector.json +7 -7
- package/templates/src/locales/en/nav.json +6 -6
- package/templates/src/locales/en/pages/crudTemplate.json +25 -25
- package/templates/src/locales/en/pages/dashboardTemplate.json +20 -20
- package/templates/src/locales/en/pages/forgotPassword.json +10 -10
- package/templates/src/locales/en/pages/formTemplate.json +16 -16
- package/templates/src/locales/en/pages/home.json +7 -7
- package/templates/src/locales/en/pages/login.json +15 -15
- package/templates/src/locales/en/pages/loginTemplate.json +9 -9
- package/templates/src/locales/en/pages/resetPassword.json +18 -18
- package/templates/src/locales/en/pages/templates.json +317 -317
- package/templates/src/locales/en/pages/verifyEmail.json +12 -12
- package/templates/src/locales/en/themeToggle.json +6 -6
- package/templates/src/locales/es/common.json +21 -21
- package/templates/src/locales/es/components/activityCard.json +10 -10
- package/templates/src/locales/es/components/assistant.json +119 -119
- package/templates/src/locales/es/components/media.json +29 -29
- package/templates/src/locales/es/components/notificationCard.json +5 -5
- package/templates/src/locales/es/components/profileCard.json +8 -8
- package/templates/src/locales/es/components/projectCard.json +10 -10
- package/templates/src/locales/es/components/sidebar.json +14 -14
- package/templates/src/locales/es/components/stats.json +8 -8
- package/templates/src/locales/es/components/team.json +14 -14
- package/templates/src/locales/es/errors.json +9 -9
- package/templates/src/locales/es/languageSelector.json +7 -7
- package/templates/src/locales/es/nav.json +6 -6
- package/templates/src/locales/es/pages/crudTemplate.json +25 -25
- package/templates/src/locales/es/pages/dashboardTemplate.json +20 -20
- package/templates/src/locales/es/pages/forgotPassword.json +10 -10
- package/templates/src/locales/es/pages/formTemplate.json +16 -16
- package/templates/src/locales/es/pages/home.json +7 -7
- package/templates/src/locales/es/pages/login.json +15 -15
- package/templates/src/locales/es/pages/loginTemplate.json +9 -9
- package/templates/src/locales/es/pages/resetPassword.json +18 -18
- package/templates/src/locales/es/pages/templates.json +317 -317
- package/templates/src/locales/es/pages/verifyEmail.json +12 -12
- package/templates/src/locales/es/themeToggle.json +6 -6
- package/templates/src/locales/pt-BR/common.json +21 -21
- package/templates/src/locales/pt-BR/components/activityCard.json +10 -10
- package/templates/src/locales/pt-BR/components/assistant.json +119 -119
- package/templates/src/locales/pt-BR/components/media.json +29 -29
- package/templates/src/locales/pt-BR/components/notificationCard.json +5 -5
- package/templates/src/locales/pt-BR/components/profileCard.json +8 -8
- package/templates/src/locales/pt-BR/components/projectCard.json +10 -10
- package/templates/src/locales/pt-BR/components/sidebar.json +14 -14
- package/templates/src/locales/pt-BR/components/stats.json +8 -8
- package/templates/src/locales/pt-BR/components/team.json +14 -14
- package/templates/src/locales/pt-BR/errors.json +9 -9
- package/templates/src/locales/pt-BR/languageSelector.json +7 -7
- package/templates/src/locales/pt-BR/nav.json +6 -6
- package/templates/src/locales/pt-BR/pages/crudTemplate.json +25 -25
- package/templates/src/locales/pt-BR/pages/dashboardTemplate.json +20 -20
- package/templates/src/locales/pt-BR/pages/forgotPassword.json +10 -10
- package/templates/src/locales/pt-BR/pages/formTemplate.json +16 -16
- package/templates/src/locales/pt-BR/pages/home.json +7 -7
- package/templates/src/locales/pt-BR/pages/login.json +15 -15
- package/templates/src/locales/pt-BR/pages/loginTemplate.json +9 -9
- package/templates/src/locales/pt-BR/pages/resetPassword.json +18 -18
- package/templates/src/locales/pt-BR/pages/templates.json +317 -317
- package/templates/src/locales/pt-BR/pages/verifyEmail.json +12 -12
- package/templates/src/locales/pt-BR/themeToggle.json +6 -6
- package/templates/src/pages/AssistantPage.tsx +470 -464
- package/templates/src/pages/HomePage.tsx +53 -49
- package/templates/src/shared/error-boundary.tsx +1 -5
- package/templates/src/shared/error-fallbacks.tsx +4 -8
- package/templates/vite.config.js +20 -20
- package/templates/vite.config.ts +55 -52
- package/dist/AssistantChart-CxGjH7Qk.js +0 -3477
- package/dist/AssistantChart-DIpshm3i.js +0 -4784
- package/dist/AssistantChart-D_PTeu8P.cjs +0 -3503
- package/dist/AssistantChart-zjsy2GaZ.cjs +0 -4810
- package/dist/AudioPlayer-B1lt5cPl.cjs +0 -989
- package/dist/AudioPlayer-BZ7bibzU.cjs +0 -982
- package/dist/AudioPlayer-BpRPS4-1.cjs +0 -1277
- package/dist/AudioPlayer-C12BjQBV.cjs +0 -997
- package/dist/AudioPlayer-CFeV8t-5.cjs +0 -936
- package/dist/AudioPlayer-Coly3q5R.js +0 -1278
- package/dist/AudioPlayer-CySJIyvL.js +0 -937
- package/dist/AudioPlayer-DMcG_c7L.js +0 -990
- package/dist/AudioPlayer-DcFKRJE_.js +0 -998
- package/dist/AudioPlayer-e8LfNoqO.js +0 -983
- package/dist/BrandColorsContext-565dDHd5.js +0 -660
- package/dist/BrandColorsContext-BcJbtkqn.cjs +0 -659
- package/dist/CodeBlock-7TTgmdGG.cjs +0 -2094
- package/dist/CodeBlock-BlcqlA9M.cjs +0 -2094
- package/dist/CodeBlock-Bnmeu5ez.cjs +0 -2094
- package/dist/CodeBlock-BtfPlbAI.js +0 -2078
- package/dist/CodeBlock-CIySIuYr.js +0 -2078
- package/dist/CodeBlock-CuPtUM-7.cjs +0 -2094
- package/dist/CodeBlock-D6ffWXgc.js +0 -2078
- package/dist/CodeBlock-D8dcwbit.cjs +0 -2094
- package/dist/CodeBlock-DMZrFnlw.cjs +0 -2094
- package/dist/CodeBlock-DlBehYN8.js +0 -2078
- package/dist/CodeBlock-DnYNI8rQ.js +0 -2078
- package/dist/CodeBlock-DvKWbSnE.cjs +0 -2094
- package/dist/CodeBlock-DwMCfkFY.js +0 -2078
- package/dist/CodeBlock-Dy6CNYyj.js +0 -2078
- package/dist/CodeBlock-U1pPOQI7.cjs +0 -2094
- package/dist/CodeBlock-f_GpNhEB.js +0 -2078
- package/dist/CodeBlock-oB6u8nI1.js +0 -2078
- package/dist/CodeBlock-tZC31B73.cjs +0 -2094
- package/dist/FeatureCard-CxC-7C-C.cjs +0 -300
- package/dist/FeatureCard-DbHWCb4E.js +0 -301
- package/dist/ImageWithFallback-CGtidP6B.cjs +0 -4542
- package/dist/ImageWithFallback-lsg3pdFg.js +0 -4508
- package/dist/LanguageSelector-B5YfbHra.js +0 -231
- package/dist/LanguageSelector-D6uacAIM.cjs +0 -230
- package/dist/LayoutContext-B45-e9DI.cjs +0 -93
- package/dist/LayoutContext-BAql6ZRY.js +0 -97
- package/dist/LayoutContext-Bav3UMEA.js +0 -94
- package/dist/LayoutContext-BvK-ggDa.cjs +0 -96
- package/dist/ThemeContext-BoH4NLfN.js +0 -734
- package/dist/ThemeContext-r69W20Xg.cjs +0 -733
- package/dist/VerifyEmailPage-COiyNl1y.js +0 -2825
- package/dist/VerifyEmailPage-CqKsR2v8.js +0 -2827
- package/dist/VerifyEmailPage-DjQKRlUS.cjs +0 -2824
- package/dist/VerifyEmailPage-s-1X3LDJ.cjs +0 -2826
- package/dist/XerticaOrbe-KL1RBHzw.cjs +0 -1354
- package/dist/XerticaOrbe-zwS1p2a8.js +0 -1355
- package/dist/XerticaProvider-6btlAlzc.js +0 -17
- package/dist/XerticaProvider-BNoNOxQ5.cjs +0 -16
- package/dist/XerticaProvider-BlY2limY.cjs +0 -38
- package/dist/XerticaProvider-cI9hSs27.cjs +0 -38
- package/dist/XerticaProvider-hSwhNQex.js +0 -39
- package/dist/alert-dialog-BOje--vD.js +0 -847
- package/dist/alert-dialog-BtEuQqrg.cjs +0 -870
- package/dist/breadcrumb-CqJ7bHY5.js +0 -161
- package/dist/breadcrumb-m9Hb2_XN.cjs +0 -177
- package/dist/components/assistant/xertica-assistant/hooks/index.d.ts +0 -6
- package/dist/components/assistant/xertica-assistant/hooks/use-assistant-conversations.d.ts +0 -21
- package/dist/components/assistant/xertica-assistant/hooks/use-assistant-messages.d.ts +0 -49
- package/dist/components/assistant/xertica-assistant/hooks/use-assistant-suggestions.d.ts +0 -16
- package/dist/components/blocks/audio-player/AudioPlayer.d.ts +0 -35
- package/dist/components/blocks/audio-player/index.d.ts +0 -1
- package/dist/components/blocks/document-editor/DocumentEditor.d.ts +0 -26
- package/dist/components/blocks/document-editor/index.d.ts +0 -1
- package/dist/components/blocks/podcast-player/PodcastPlayer.d.ts +0 -41
- package/dist/components/blocks/podcast-player/index.d.ts +0 -1
- package/dist/components/ui/chart/parts/chart-dashboard.d.ts +0 -113
- package/dist/components/ui/chart/parts/chart-metric.d.ts +0 -118
- package/dist/components/ui/chart/parts/chart-primitives.d.ts +0 -101
- package/dist/components/ui/chart/parts/chart-shared.d.ts +0 -20
- package/dist/components/ui/chart/parts/chart-utils.d.ts +0 -12
- package/dist/components/ui/chart/parts/index.d.ts +0 -5
- package/dist/dropdown-menu-BDB5CmQs.cjs +0 -247
- package/dist/dropdown-menu-DQidbKBD.js +0 -231
- package/dist/google-maps-loader-BFWp6VPd.js +0 -287
- package/dist/google-maps-loader-BKcdgFbu.cjs +0 -312
- package/dist/google-maps-loader-CumCNXeG.js +0 -312
- package/dist/google-maps-loader-eS3uQ5TA.cjs +0 -287
- package/dist/header-Cgy6vYPk.cjs +0 -731
- package/dist/header-DRlT4jgI.js +0 -715
- package/dist/header-Dux00SI4.cjs +0 -731
- package/dist/header-EkGKXPsD.js +0 -715
- package/dist/header-WfEywpyc.cjs +0 -731
- package/dist/header-tifNQn2U.js +0 -715
- package/dist/index-BhapVLVj.js +0 -8
- package/dist/index-D6fxYEY8.cjs +0 -7
- package/dist/index-DAIp0_HK.js +0 -8
- package/dist/index-DW5tYe26.js +0 -8
- package/dist/index-GA__GvnG.cjs +0 -7
- package/dist/input-2R4loU86.js +0 -127
- package/dist/input-DWANSKGb.cjs +0 -145
- package/dist/progress-DPtzoVV8.js +0 -175
- package/dist/progress-EeaoqqUs.cjs +0 -191
- package/dist/rich-text-editor-0mraWT5y.cjs +0 -2376
- package/dist/rich-text-editor-B-IkcPD0.js +0 -2874
- package/dist/rich-text-editor-B6jMRLzk.cjs +0 -1939
- package/dist/rich-text-editor-B8_oYcIR.js +0 -1730
- package/dist/rich-text-editor-B9UbSXNb.js +0 -1203
- package/dist/rich-text-editor-BYuRBNBU.js +0 -2373
- package/dist/rich-text-editor-Bb9pySTs.cjs +0 -2374
- package/dist/rich-text-editor-BcL6L3cm.cjs +0 -2374
- package/dist/rich-text-editor-BoVZYtTs.cjs +0 -2391
- package/dist/rich-text-editor-Bp3zQqMC.js +0 -2954
- package/dist/rich-text-editor-CMgSN_w2.js +0 -1189
- package/dist/rich-text-editor-CPV1lEPH.cjs +0 -1748
- package/dist/rich-text-editor-CeucBdIv.cjs +0 -2971
- package/dist/rich-text-editor-CoKqbCtu.cjs +0 -1799
- package/dist/rich-text-editor-Cw56T_mB.js +0 -2356
- package/dist/rich-text-editor-Cyt8qs2b.js +0 -1921
- package/dist/rich-text-editor-D6H84OcX.cjs +0 -1220
- package/dist/rich-text-editor-D76gD-QI.js +0 -2328
- package/dist/rich-text-editor-DKkokOnA.js +0 -1781
- package/dist/rich-text-editor-DNsdpN64.cjs +0 -2359
- package/dist/rich-text-editor-DfG8bCyY.js +0 -2358
- package/dist/rich-text-editor-Dxjw31Z4.js +0 -2341
- package/dist/rich-text-editor-DzP0Epmb.js +0 -2356
- package/dist/rich-text-editor-bRkNoeZY.cjs +0 -2891
- package/dist/rich-text-editor-lyYE2ZG5.cjs +0 -1207
- package/dist/rich-text-editor-skplNlBM.cjs +0 -2345
- package/dist/select-Bkbr0f-Z.cjs +0 -162
- package/dist/select-CvIVdX2n.js +0 -145
- package/dist/sidebar-CK_0ZQHj.cjs +0 -803
- package/dist/sidebar-CUuOvYhK.js +0 -787
- package/dist/sidebar-Djn5syhi.cjs +0 -786
- package/dist/sidebar-LluMXfam.js +0 -759
- package/dist/sidebar-_rT7rBMk.js +0 -787
- package/dist/slider-Bc5Hd0y1.js +0 -56
- package/dist/slider-N7hFFj6X.cjs +0 -73
- package/dist/tooltip-Ded96neP.cjs +0 -137
- package/dist/tooltip-HDOoD2-0.js +0 -120
- package/dist/use-audio-player-B31J-aqh.cjs +0 -187
- package/dist/use-audio-player-BkmEmj8Q.js +0 -185
- package/dist/use-audio-player-CLFTWFW1.cjs +0 -184
- package/dist/use-audio-player-CLLn00I6.js +0 -188
- package/dist/use-file-upload-BcjEo2S5.js +0 -404
- package/dist/use-file-upload-CRJR68Tj.cjs +0 -403
- package/dist/use-mobile-B0hNy_Y6.cjs +0 -4303
- package/dist/use-mobile-BXuYROXM.js +0 -4202
- package/dist/use-mobile-Bbd51ASU.cjs +0 -4392
- package/dist/use-mobile-Bk6CX-TC.js +0 -4359
- package/dist/use-mobile-BvYdisLP.js +0 -4202
- package/dist/use-mobile-BzuxjzNX.cjs +0 -4392
- package/dist/use-mobile-CG2-SdXV.cjs +0 -4235
- package/dist/use-mobile-CKb5pqTs.js +0 -4269
- package/dist/use-mobile-CYuAuGDl.js +0 -4202
- package/dist/use-mobile-CaENcqm-.js +0 -4508
- package/dist/use-mobile-CbrYgJGJ.js +0 -4203
- package/dist/use-mobile-Cd4xPrKq.cjs +0 -46
- package/dist/use-mobile-DMOvImGQ.cjs +0 -4542
- package/dist/use-mobile-DRB3BQgD.cjs +0 -4235
- package/dist/use-mobile-DZvv7QMR.js +0 -4359
- package/dist/use-mobile-DdI_TXam.cjs +0 -4235
- package/dist/use-mobile-DlceKf8a.js +0 -4359
- package/dist/use-mobile-DsOnow1o.cjs +0 -4236
- package/dist/use-mobile-Kcj6jSnK.cjs +0 -4392
- package/dist/use-mobile-bnKcua_i.js +0 -4202
- package/dist/use-mobile-j4w2Jrf1.js +0 -30
- package/dist/use-mobile-ncXBeE2z.cjs +0 -4235
- package/dist/use-rich-text-editor-DjiddBGv.js +0 -282
- package/dist/use-rich-text-editor-lpeswbCs.cjs +0 -281
- package/dist/xertica-assistant-BdiZag0h.js +0 -2187
- package/dist/xertica-assistant-DUBpmEgo.cjs +0 -2186
- package/dist/{rich-text-editor-DgF8s7xW.js → rich-text-editor-BmsjY03B.js} +26 -26
- package/dist/{rich-text-editor-mWoaSCE4.cjs → rich-text-editor-GS2kpTAK.cjs} +26 -26
|
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
|
|
3
3
|
import { GripVerticalIcon, ChevronDownIcon, MoreHorizontalIcon, ChevronRightIcon, ChevronLeftIcon, MinusIcon, ChevronLeft, ChevronRight, ChevronDown, XIcon, CheckIcon, CircleIcon, SearchIcon, TrendingUp, TrendingDown, Minus, ArrowRight, ArrowLeft, X, Check, Upload, AlertCircle, FileIcon, Star, Search as Search$1 } from "lucide-react";
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
import React__default, {
|
|
5
|
+
import React__default, { useRef, useEffect } from "react";
|
|
6
6
|
import { c as cn, b as buttonVariants, B as Button } from "./button-qkz7Icqf.js";
|
|
7
7
|
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
8
8
|
import { cva } from "class-variance-authority";
|
|
@@ -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-iDe5VE5o.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";
|
|
@@ -19,12 +19,12 @@ import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
|
19
19
|
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
20
20
|
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
|
21
21
|
import { Command as Command$1 } from "cmdk";
|
|
22
|
-
import { k as Dialog, q as DialogHeader, t as DialogTitle, o as DialogDescription, n as DialogContent, c as ChartContainer, g as ChartTooltip, h as ChartTooltipContent } from "./rich-text-editor-
|
|
22
|
+
import { k as Dialog, q as DialogHeader, t as DialogTitle, o as DialogDescription, n as DialogContent, c as ChartContainer, g as ChartTooltip, h as ChartTooltipContent } from "./rich-text-editor-BrdC5evx.js";
|
|
23
23
|
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-t2IlYBzw.js";
|
|
28
28
|
import { BarChart, CartesianGrid, XAxis, Bar } from "recharts";
|
|
29
29
|
function AspectRatio({
|
|
30
30
|
...props
|
|
@@ -483,26 +483,20 @@ function PaginationItem({ ...props }) {
|
|
|
483
483
|
function PaginationLink({
|
|
484
484
|
className,
|
|
485
485
|
isActive,
|
|
486
|
-
disabled,
|
|
487
486
|
size = "icon",
|
|
488
|
-
href,
|
|
489
487
|
...props
|
|
490
488
|
}) {
|
|
491
489
|
return /* @__PURE__ */ jsx(
|
|
492
490
|
"a",
|
|
493
491
|
{
|
|
494
492
|
"aria-current": isActive ? "page" : void 0,
|
|
495
|
-
"aria-disabled": disabled || void 0,
|
|
496
|
-
tabIndex: disabled ? -1 : void 0,
|
|
497
493
|
"data-slot": "pagination-link",
|
|
498
494
|
"data-active": isActive,
|
|
499
|
-
href: disabled ? void 0 : href ?? "#",
|
|
500
495
|
className: cn(
|
|
501
496
|
buttonVariants({
|
|
502
497
|
variant: isActive ? "outline" : "ghost",
|
|
503
498
|
size
|
|
504
499
|
}),
|
|
505
|
-
disabled && "pointer-events-none opacity-50",
|
|
506
500
|
className
|
|
507
501
|
),
|
|
508
502
|
...props
|
|
@@ -511,7 +505,6 @@ function PaginationLink({
|
|
|
511
505
|
}
|
|
512
506
|
function PaginationPrevious({
|
|
513
507
|
className,
|
|
514
|
-
disabled,
|
|
515
508
|
...props
|
|
516
509
|
}) {
|
|
517
510
|
return /* @__PURE__ */ jsxs(
|
|
@@ -519,7 +512,6 @@ function PaginationPrevious({
|
|
|
519
512
|
{
|
|
520
513
|
"aria-label": "Go to previous page",
|
|
521
514
|
size: "default",
|
|
522
|
-
disabled,
|
|
523
515
|
className: cn("gap-1 px-2.5 sm:pl-2.5", className),
|
|
524
516
|
...props,
|
|
525
517
|
children: [
|
|
@@ -531,7 +523,6 @@ function PaginationPrevious({
|
|
|
531
523
|
}
|
|
532
524
|
function PaginationNext({
|
|
533
525
|
className,
|
|
534
|
-
disabled,
|
|
535
526
|
...props
|
|
536
527
|
}) {
|
|
537
528
|
return /* @__PURE__ */ jsxs(
|
|
@@ -539,7 +530,6 @@ function PaginationNext({
|
|
|
539
530
|
{
|
|
540
531
|
"aria-label": "Go to next page",
|
|
541
532
|
size: "default",
|
|
542
|
-
disabled,
|
|
543
533
|
className: cn("gap-1 px-2.5 sm:pr-2.5", className),
|
|
544
534
|
...props,
|
|
545
535
|
children: [
|
|
@@ -567,71 +557,6 @@ function PaginationEllipsis({
|
|
|
567
557
|
}
|
|
568
558
|
);
|
|
569
559
|
}
|
|
570
|
-
function usePagination({
|
|
571
|
-
totalItems,
|
|
572
|
-
pageSize = 10,
|
|
573
|
-
initialPage = 1,
|
|
574
|
-
page: controlledPage,
|
|
575
|
-
onPageChange,
|
|
576
|
-
siblingCount = 1
|
|
577
|
-
}) {
|
|
578
|
-
const [internalPage, setInternalPage] = useState(initialPage);
|
|
579
|
-
const isControlled = controlledPage !== void 0;
|
|
580
|
-
const currentPage = isControlled ? controlledPage : internalPage;
|
|
581
|
-
const totalPages = Math.max(1, Math.ceil(totalItems / pageSize));
|
|
582
|
-
const setPage = useCallback(
|
|
583
|
-
(p) => {
|
|
584
|
-
const clamped = Math.min(Math.max(1, p), totalPages);
|
|
585
|
-
if (!isControlled) setInternalPage(clamped);
|
|
586
|
-
onPageChange == null ? void 0 : onPageChange(clamped);
|
|
587
|
-
},
|
|
588
|
-
[isControlled, onPageChange, totalPages]
|
|
589
|
-
);
|
|
590
|
-
const startIndex = (currentPage - 1) * pageSize;
|
|
591
|
-
const endIndex = Math.min(startIndex + pageSize, totalItems);
|
|
592
|
-
const canGoPrev = currentPage > 1;
|
|
593
|
-
const canGoNext = currentPage < totalPages;
|
|
594
|
-
const isFirstPage = currentPage === 1;
|
|
595
|
-
const isLastPage = currentPage === totalPages;
|
|
596
|
-
const items = useMemo(() => {
|
|
597
|
-
const pageSet = /* @__PURE__ */ new Set();
|
|
598
|
-
pageSet.add(1);
|
|
599
|
-
if (totalPages > 1) pageSet.add(totalPages);
|
|
600
|
-
for (let p = Math.max(2, currentPage - siblingCount); p <= Math.min(totalPages - 1, currentPage + siblingCount); p++) {
|
|
601
|
-
pageSet.add(p);
|
|
602
|
-
}
|
|
603
|
-
const sorted = Array.from(pageSet).sort((a, b) => a - b);
|
|
604
|
-
const result = [];
|
|
605
|
-
for (let i = 0; i < sorted.length; i++) {
|
|
606
|
-
result.push({ type: "page", page: sorted[i] });
|
|
607
|
-
if (i < sorted.length - 1 && sorted[i + 1] - sorted[i] > 1) {
|
|
608
|
-
result.push({ type: "ellipsis", key: `ellipsis-${sorted[i]}` });
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
return result;
|
|
612
|
-
}, [currentPage, siblingCount, totalPages]);
|
|
613
|
-
const goTo = useCallback((p) => setPage(p), [setPage]);
|
|
614
|
-
const next = useCallback(() => setPage(currentPage + 1), [currentPage, setPage]);
|
|
615
|
-
const prev = useCallback(() => setPage(currentPage - 1), [currentPage, setPage]);
|
|
616
|
-
const first = useCallback(() => setPage(1), [setPage]);
|
|
617
|
-
const last = useCallback(() => setPage(totalPages), [setPage, totalPages]);
|
|
618
|
-
return {
|
|
619
|
-
currentPage,
|
|
620
|
-
totalPages,
|
|
621
|
-
startIndex,
|
|
622
|
-
endIndex,
|
|
623
|
-
canGoPrev,
|
|
624
|
-
canGoNext,
|
|
625
|
-
isFirstPage,
|
|
626
|
-
isLastPage,
|
|
627
|
-
items,
|
|
628
|
-
goTo,
|
|
629
|
-
next,
|
|
630
|
-
prev,
|
|
631
|
-
first,
|
|
632
|
-
last
|
|
633
|
-
};
|
|
634
|
-
}
|
|
635
560
|
const toggleVariants = cva(
|
|
636
561
|
"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",
|
|
637
562
|
{
|
|
@@ -2130,39 +2055,33 @@ const TimelineDescription = React.forwardRef(({ className, ...props }, ref) => /
|
|
|
2130
2055
|
}
|
|
2131
2056
|
));
|
|
2132
2057
|
TimelineDescription.displayName = "TimelineDescription";
|
|
2133
|
-
|
|
2134
|
-
data,
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
(nodeId) => (el) => {
|
|
2147
|
-
if (el) nodeRefs.current.set(nodeId, el);
|
|
2148
|
-
else nodeRefs.current.delete(nodeId);
|
|
2149
|
-
},
|
|
2150
|
-
[]
|
|
2151
|
-
);
|
|
2152
|
-
const getVisibleNodes = useCallback(() => {
|
|
2153
|
-
const result = [];
|
|
2154
|
-
const traverse = (nodes) => {
|
|
2155
|
-
var _a;
|
|
2156
|
-
for (const node of nodes) {
|
|
2157
|
-
result.push(node);
|
|
2158
|
-
if (((_a = node.children) == null ? void 0 : _a.length) && expanded.has(node.id)) traverse(node.children);
|
|
2159
|
-
}
|
|
2058
|
+
const TreeView = React.forwardRef(
|
|
2059
|
+
({ className, data, onNodeClick, onNodeSelect, defaultExpanded = [], selectedNodeId, ...props }, ref) => {
|
|
2060
|
+
const [expanded, setExpanded] = React.useState(new Set(defaultExpanded));
|
|
2061
|
+
const [internalSelectedId, setInternalSelectedId] = React.useState(void 0);
|
|
2062
|
+
const nodeRefs = React.useRef(/* @__PURE__ */ new Map());
|
|
2063
|
+
const isControlled = selectedNodeId !== void 0;
|
|
2064
|
+
const effectiveSelectedId = isControlled ? selectedNodeId : internalSelectedId;
|
|
2065
|
+
const toggleExpand = (nodeId) => {
|
|
2066
|
+
setExpanded((prev) => {
|
|
2067
|
+
const next = new Set(prev);
|
|
2068
|
+
next.has(nodeId) ? next.delete(nodeId) : next.add(nodeId);
|
|
2069
|
+
return next;
|
|
2070
|
+
});
|
|
2160
2071
|
};
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2072
|
+
const getVisibleNodes = React.useCallback(() => {
|
|
2073
|
+
const result = [];
|
|
2074
|
+
const traverse = (nodes) => {
|
|
2075
|
+
var _a;
|
|
2076
|
+
for (const node of nodes) {
|
|
2077
|
+
result.push(node);
|
|
2078
|
+
if (((_a = node.children) == null ? void 0 : _a.length) && expanded.has(node.id)) traverse(node.children);
|
|
2079
|
+
}
|
|
2080
|
+
};
|
|
2081
|
+
traverse(data);
|
|
2082
|
+
return result;
|
|
2083
|
+
}, [data, expanded]);
|
|
2084
|
+
const findParent = (nodes, targetId) => {
|
|
2166
2085
|
var _a;
|
|
2167
2086
|
for (const n of nodes) {
|
|
2168
2087
|
if ((_a = n.children) == null ? void 0 : _a.some((c) => c.id === targetId)) return n;
|
|
@@ -2172,28 +2091,13 @@ function useTreeView({
|
|
|
2172
2091
|
}
|
|
2173
2092
|
}
|
|
2174
2093
|
return null;
|
|
2175
|
-
}
|
|
2176
|
-
|
|
2177
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2178
|
-
[]
|
|
2179
|
-
);
|
|
2180
|
-
const toggleExpand = useCallback((nodeId) => {
|
|
2181
|
-
setExpanded((prev) => {
|
|
2182
|
-
const next = new Set(prev);
|
|
2183
|
-
next.has(nodeId) ? next.delete(nodeId) : next.add(nodeId);
|
|
2184
|
-
return next;
|
|
2185
|
-
});
|
|
2186
|
-
}, []);
|
|
2187
|
-
const handleSelect = useCallback(
|
|
2188
|
-
(node) => {
|
|
2094
|
+
};
|
|
2095
|
+
const handleSelect = (node) => {
|
|
2189
2096
|
if (!isControlled) setInternalSelectedId(node.id);
|
|
2190
2097
|
onNodeSelect == null ? void 0 : onNodeSelect(node);
|
|
2191
2098
|
onNodeClick == null ? void 0 : onNodeClick(node);
|
|
2192
|
-
}
|
|
2193
|
-
|
|
2194
|
-
);
|
|
2195
|
-
const handleKeyDown = useCallback(
|
|
2196
|
-
(e, node) => {
|
|
2099
|
+
};
|
|
2100
|
+
const handleKeyDown = (e, node) => {
|
|
2197
2101
|
var _a, _b;
|
|
2198
2102
|
const visibleNodes = getVisibleNodes();
|
|
2199
2103
|
const idx = visibleNodes.findIndex((n) => n.id === node.id);
|
|
@@ -2246,60 +2150,26 @@ function useTreeView({
|
|
|
2246
2150
|
if (last) focusNode(last.id);
|
|
2247
2151
|
break;
|
|
2248
2152
|
}
|
|
2153
|
+
case "Enter":
|
|
2249
2154
|
case " ": {
|
|
2250
|
-
e.preventDefault();
|
|
2251
|
-
if (hasChildren) {
|
|
2252
|
-
toggleExpand(node.id);
|
|
2253
|
-
} else {
|
|
2254
|
-
handleSelect(node);
|
|
2255
|
-
}
|
|
2256
|
-
break;
|
|
2257
|
-
}
|
|
2258
|
-
case "Enter": {
|
|
2259
2155
|
e.preventDefault();
|
|
2260
2156
|
if (hasChildren) toggleExpand(node.id);
|
|
2261
2157
|
handleSelect(node);
|
|
2262
2158
|
break;
|
|
2263
2159
|
}
|
|
2264
2160
|
}
|
|
2265
|
-
}
|
|
2266
|
-
|
|
2267
|
-
);
|
|
2268
|
-
return {
|
|
2269
|
-
expanded,
|
|
2270
|
-
effectiveSelectedId,
|
|
2271
|
-
nodeRefs,
|
|
2272
|
-
getNodeRef,
|
|
2273
|
-
toggleExpand,
|
|
2274
|
-
handleSelect,
|
|
2275
|
-
handleKeyDown,
|
|
2276
|
-
getVisibleNodes
|
|
2277
|
-
};
|
|
2278
|
-
}
|
|
2279
|
-
const TreeView = React.forwardRef(
|
|
2280
|
-
({ className, data, onNodeClick, onNodeSelect, defaultExpanded = [], selectedNodeId, ariaLabel, ...props }, ref) => {
|
|
2281
|
-
var _a;
|
|
2282
|
-
const {
|
|
2283
|
-
expanded,
|
|
2284
|
-
effectiveSelectedId,
|
|
2285
|
-
getNodeRef,
|
|
2286
|
-
toggleExpand,
|
|
2287
|
-
handleSelect,
|
|
2288
|
-
handleKeyDown
|
|
2289
|
-
} = useTreeView({ data, defaultExpanded, selectedNodeId, onNodeClick, onNodeSelect });
|
|
2290
|
-
const focusableId = effectiveSelectedId ?? ((_a = data[0]) == null ? void 0 : _a.id);
|
|
2291
|
-
return /* @__PURE__ */ jsx("div", { ref, className: cn("w-full", className), role: "tree", "aria-label": ariaLabel ?? "Navegação em árvore", ...props, children: data.map((node) => /* @__PURE__ */ jsx(
|
|
2161
|
+
};
|
|
2162
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn("w-full", className), role: "tree", ...props, children: data.map((node) => /* @__PURE__ */ jsx(
|
|
2292
2163
|
TreeNodeComponent,
|
|
2293
2164
|
{
|
|
2294
2165
|
node,
|
|
2295
2166
|
level: 0,
|
|
2296
2167
|
expanded,
|
|
2297
2168
|
selectedId: effectiveSelectedId,
|
|
2298
|
-
focusableId,
|
|
2299
2169
|
onToggle: toggleExpand,
|
|
2300
2170
|
onSelect: handleSelect,
|
|
2301
2171
|
onKeyDown: handleKeyDown,
|
|
2302
|
-
|
|
2172
|
+
nodeRefs
|
|
2303
2173
|
},
|
|
2304
2174
|
node.id
|
|
2305
2175
|
)) });
|
|
@@ -2311,11 +2181,10 @@ const TreeNodeComponent = ({
|
|
|
2311
2181
|
level,
|
|
2312
2182
|
expanded,
|
|
2313
2183
|
selectedId,
|
|
2314
|
-
focusableId,
|
|
2315
2184
|
onToggle,
|
|
2316
2185
|
onSelect,
|
|
2317
2186
|
onKeyDown,
|
|
2318
|
-
|
|
2187
|
+
nodeRefs
|
|
2319
2188
|
}) => {
|
|
2320
2189
|
var _a;
|
|
2321
2190
|
const hasChildren = !!((_a = node.children) == null ? void 0 : _a.length);
|
|
@@ -2325,15 +2194,19 @@ const TreeNodeComponent = ({
|
|
|
2325
2194
|
if (hasChildren) onToggle(node.id);
|
|
2326
2195
|
onSelect(node);
|
|
2327
2196
|
};
|
|
2197
|
+
const setRef = (el) => {
|
|
2198
|
+
if (el) nodeRefs.current.set(node.id, el);
|
|
2199
|
+
else nodeRefs.current.delete(node.id);
|
|
2200
|
+
};
|
|
2328
2201
|
return /* @__PURE__ */ jsxs("div", { role: "none", children: [
|
|
2329
2202
|
/* @__PURE__ */ jsxs(
|
|
2330
2203
|
"button",
|
|
2331
2204
|
{
|
|
2332
|
-
ref:
|
|
2205
|
+
ref: setRef,
|
|
2333
2206
|
role: "treeitem",
|
|
2334
2207
|
"aria-expanded": hasChildren ? isExpanded : void 0,
|
|
2335
2208
|
"aria-selected": isSelected,
|
|
2336
|
-
tabIndex:
|
|
2209
|
+
tabIndex: isSelected ? 0 : -1,
|
|
2337
2210
|
onClick: handleClick,
|
|
2338
2211
|
onKeyDown: (e) => onKeyDown(e, node),
|
|
2339
2212
|
className: cn(
|
|
@@ -2356,11 +2229,10 @@ const TreeNodeComponent = ({
|
|
|
2356
2229
|
level: level + 1,
|
|
2357
2230
|
expanded,
|
|
2358
2231
|
selectedId,
|
|
2359
|
-
focusableId,
|
|
2360
2232
|
onToggle,
|
|
2361
2233
|
onSelect,
|
|
2362
2234
|
onKeyDown,
|
|
2363
|
-
|
|
2235
|
+
nodeRefs
|
|
2364
2236
|
},
|
|
2365
2237
|
child.id
|
|
2366
2238
|
)) })
|
|
@@ -2633,9 +2505,9 @@ function CarouselNext({
|
|
|
2633
2505
|
);
|
|
2634
2506
|
}
|
|
2635
2507
|
const StepperContext = React.createContext(void 0);
|
|
2636
|
-
const
|
|
2508
|
+
const useStepper = () => {
|
|
2637
2509
|
const context = React.useContext(StepperContext);
|
|
2638
|
-
if (!context) throw new Error("
|
|
2510
|
+
if (!context) throw new Error("useStepper must be used within a Stepper");
|
|
2639
2511
|
return context;
|
|
2640
2512
|
};
|
|
2641
2513
|
const Stepper = React.forwardRef(
|
|
@@ -2647,17 +2519,9 @@ const Stepper = React.forwardRef(
|
|
|
2647
2519
|
ref,
|
|
2648
2520
|
className: cn("w-full", className),
|
|
2649
2521
|
...props,
|
|
2650
|
-
children: /* @__PURE__ */ jsx(
|
|
2651
|
-
"
|
|
2652
|
-
|
|
2653
|
-
className: cn(
|
|
2654
|
-
orientation === "horizontal" ? "flex items-start justify-between" : "flex flex-col gap-0"
|
|
2655
|
-
),
|
|
2656
|
-
role: "list",
|
|
2657
|
-
"aria-label": `Progresso: etapa ${currentStep} de ${totalSteps}`,
|
|
2658
|
-
children
|
|
2659
|
-
}
|
|
2660
|
-
)
|
|
2522
|
+
children: /* @__PURE__ */ jsx("div", { className: cn(
|
|
2523
|
+
orientation === "horizontal" ? "flex items-start justify-between" : "flex flex-col gap-0"
|
|
2524
|
+
), children })
|
|
2661
2525
|
}
|
|
2662
2526
|
) });
|
|
2663
2527
|
}
|
|
@@ -2665,7 +2529,7 @@ const Stepper = React.forwardRef(
|
|
|
2665
2529
|
Stepper.displayName = "Stepper";
|
|
2666
2530
|
const Step = React.forwardRef(
|
|
2667
2531
|
({ step, label, description, error = false, className, ...props }, ref) => {
|
|
2668
|
-
const { currentStep, totalSteps, orientation } =
|
|
2532
|
+
const { currentStep, totalSteps, orientation } = useStepper();
|
|
2669
2533
|
const isActive = step === currentStep;
|
|
2670
2534
|
const isCompleted = step < currentStep && !error;
|
|
2671
2535
|
const isFirst = step === 1;
|
|
@@ -2679,120 +2543,54 @@ const Step = React.forwardRef(
|
|
|
2679
2543
|
);
|
|
2680
2544
|
const connectorClasses = (filled) => cn("transition-colors", filled ? "bg-primary" : "bg-muted");
|
|
2681
2545
|
if (orientation === "vertical") {
|
|
2682
|
-
return /* @__PURE__ */ jsxs(
|
|
2683
|
-
"div",
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
"
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
role: "listitem",
|
|
2710
|
-
"aria-current": isActive ? "step" : void 0,
|
|
2711
|
-
"aria-label": `Etapa ${step}: ${label}${isCompleted ? ", concluída" : isActive ? ", atual" : ""}`,
|
|
2712
|
-
...props,
|
|
2713
|
-
children: [
|
|
2714
|
-
/* @__PURE__ */ jsxs("div", { className: "flex w-full items-start", children: [
|
|
2715
|
-
step > 1 && /* @__PURE__ */ jsx("div", { className: cn("h-0.5 flex-1 mt-[18px]", connectorClasses(step <= currentStep)) }),
|
|
2716
|
-
/* @__PURE__ */ jsx("div", { className: circleClasses, children: error ? /* @__PURE__ */ jsx(X, { className: "h-5 w-5" }) : isCompleted ? /* @__PURE__ */ jsx(Check, { className: "h-5 w-5" }) : /* @__PURE__ */ jsx("span", { children: step }) }),
|
|
2717
|
-
step < totalSteps && /* @__PURE__ */ jsx("div", { className: cn("h-0.5 flex-1 mt-[18px]", connectorClasses(step < currentStep)) })
|
|
2718
|
-
] }),
|
|
2719
|
-
/* @__PURE__ */ jsxs("div", { className: cn(
|
|
2720
|
-
"mt-2 px-1",
|
|
2721
|
-
isFirst && "text-left self-start",
|
|
2722
|
-
isLast && "text-right self-end",
|
|
2723
|
-
!isFirst && !isLast && "text-center w-full"
|
|
2724
|
-
), children: [
|
|
2725
|
-
/* @__PURE__ */ jsx("div", { className: cn("transition-colors", isActive || error ? "text-foreground" : "text-muted-foreground"), children: label }),
|
|
2726
|
-
description && /* @__PURE__ */ jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: description })
|
|
2727
|
-
] })
|
|
2728
|
-
]
|
|
2729
|
-
}
|
|
2730
|
-
);
|
|
2546
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: cn("flex gap-4", className), ...props, children: [
|
|
2547
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
|
|
2548
|
+
/* @__PURE__ */ jsx("div", { className: circleClasses, children: error ? /* @__PURE__ */ jsx(X, { className: "h-5 w-5" }) : isCompleted ? /* @__PURE__ */ jsx(Check, { className: "h-5 w-5" }) : /* @__PURE__ */ jsx("span", { children: step }) }),
|
|
2549
|
+
!isLast && /* @__PURE__ */ jsx("div", { className: cn("w-0.5 flex-1 min-h-[2rem] mt-1", connectorClasses(step < currentStep)) })
|
|
2550
|
+
] }),
|
|
2551
|
+
/* @__PURE__ */ jsxs("div", { className: cn("pb-6", isLast && "pb-0"), children: [
|
|
2552
|
+
/* @__PURE__ */ jsx("div", { className: cn("transition-colors", isActive || error ? "text-foreground" : "text-muted-foreground"), children: label }),
|
|
2553
|
+
description && /* @__PURE__ */ jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: description })
|
|
2554
|
+
] })
|
|
2555
|
+
] });
|
|
2556
|
+
}
|
|
2557
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: cn("flex flex-1 flex-col items-center", className), ...props, children: [
|
|
2558
|
+
/* @__PURE__ */ jsxs("div", { className: "flex w-full items-start", children: [
|
|
2559
|
+
step > 1 && /* @__PURE__ */ jsx("div", { className: cn("h-0.5 flex-1 mt-[18px]", connectorClasses(step <= currentStep)) }),
|
|
2560
|
+
/* @__PURE__ */ jsx("div", { className: circleClasses, children: error ? /* @__PURE__ */ jsx(X, { className: "h-5 w-5" }) : isCompleted ? /* @__PURE__ */ jsx(Check, { className: "h-5 w-5" }) : /* @__PURE__ */ jsx("span", { children: step }) }),
|
|
2561
|
+
step < totalSteps && /* @__PURE__ */ jsx("div", { className: cn("h-0.5 flex-1 mt-[18px]", connectorClasses(step < currentStep)) })
|
|
2562
|
+
] }),
|
|
2563
|
+
/* @__PURE__ */ jsxs("div", { className: cn(
|
|
2564
|
+
"mt-2 px-1",
|
|
2565
|
+
isFirst && "text-left self-start",
|
|
2566
|
+
isLast && "text-right self-end",
|
|
2567
|
+
!isFirst && !isLast && "text-center w-full"
|
|
2568
|
+
), children: [
|
|
2569
|
+
/* @__PURE__ */ jsx("div", { className: cn("transition-colors", isActive || error ? "text-foreground" : "text-muted-foreground"), children: label }),
|
|
2570
|
+
description && /* @__PURE__ */ jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: description })
|
|
2571
|
+
] })
|
|
2572
|
+
] });
|
|
2731
2573
|
}
|
|
2732
2574
|
);
|
|
2733
2575
|
Step.displayName = "Step";
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
const isFirstStep = currentStep === 1;
|
|
2753
|
-
const isLastStep = currentStep === totalSteps;
|
|
2754
|
-
const canGoPrev = currentStep > 1;
|
|
2755
|
-
const canGoNext = currentStep < totalSteps;
|
|
2756
|
-
const next = useCallback(async () => {
|
|
2757
|
-
if (!canGoNext) return;
|
|
2758
|
-
if (onBeforeNext) {
|
|
2759
|
-
const allowed = await onBeforeNext(currentStep);
|
|
2760
|
-
if (!allowed) return;
|
|
2761
|
-
}
|
|
2762
|
-
setStep(currentStep + 1);
|
|
2763
|
-
}, [canGoNext, currentStep, onBeforeNext, setStep]);
|
|
2764
|
-
const prev = useCallback(() => {
|
|
2765
|
-
if (!canGoPrev) return;
|
|
2766
|
-
setStep(currentStep - 1);
|
|
2767
|
-
}, [canGoPrev, currentStep, setStep]);
|
|
2768
|
-
const goTo = useCallback((s) => setStep(s), [setStep]);
|
|
2769
|
-
const reset = useCallback(() => setStep(1), [setStep]);
|
|
2770
|
-
return {
|
|
2771
|
-
currentStep,
|
|
2772
|
-
totalSteps,
|
|
2773
|
-
isFirstStep,
|
|
2774
|
-
isLastStep,
|
|
2775
|
-
canGoPrev,
|
|
2776
|
-
canGoNext,
|
|
2777
|
-
next,
|
|
2778
|
-
prev,
|
|
2779
|
-
goTo,
|
|
2780
|
-
reset
|
|
2781
|
-
};
|
|
2782
|
-
}
|
|
2783
|
-
function useFileUpload({
|
|
2784
|
-
maxFiles = 1,
|
|
2785
|
-
maxSize = 5 * 1024 * 1024,
|
|
2786
|
-
onFilesChange,
|
|
2787
|
-
onError,
|
|
2788
|
-
disabled = false
|
|
2789
|
-
} = {}) {
|
|
2790
|
-
const [files, setFiles] = useState([]);
|
|
2791
|
-
const [dragActive, setDragActive] = useState(false);
|
|
2792
|
-
const [errorMessage, setErrorMessage] = useState(null);
|
|
2793
|
-
const inputRef = useRef(null);
|
|
2794
|
-
const handleFiles = useCallback(
|
|
2795
|
-
(newFiles) => {
|
|
2576
|
+
const FileUpload = React.forwardRef(
|
|
2577
|
+
({
|
|
2578
|
+
className,
|
|
2579
|
+
onFilesChange,
|
|
2580
|
+
maxFiles = 1,
|
|
2581
|
+
maxSize = 5 * 1024 * 1024,
|
|
2582
|
+
// 5MB default
|
|
2583
|
+
showPreview = true,
|
|
2584
|
+
onError,
|
|
2585
|
+
accept,
|
|
2586
|
+
disabled,
|
|
2587
|
+
...props
|
|
2588
|
+
}, ref) => {
|
|
2589
|
+
const [files, setFiles] = React.useState([]);
|
|
2590
|
+
const [dragActive, setDragActive] = React.useState(false);
|
|
2591
|
+
const [errorMessage, setErrorMessage] = React.useState(null);
|
|
2592
|
+
const inputRef = React.useRef(null);
|
|
2593
|
+
const handleFiles = (newFiles) => {
|
|
2796
2594
|
if (!newFiles) return;
|
|
2797
2595
|
setErrorMessage(null);
|
|
2798
2596
|
const filesArray = Array.from(newFiles);
|
|
@@ -2800,107 +2598,52 @@ function useFileUpload({
|
|
|
2800
2598
|
const validFiles = filesArray.filter((f) => f.size <= maxSize);
|
|
2801
2599
|
if (oversized.length > 0) {
|
|
2802
2600
|
const limitMB = (maxSize / 1024 / 1024).toFixed(0);
|
|
2803
|
-
setErrorMessage(
|
|
2804
|
-
`${oversized.length} file(s) exceed the ${limitMB}MB limit and were not added.`
|
|
2805
|
-
);
|
|
2601
|
+
setErrorMessage(`${oversized.length} file(s) exceed the ${limitMB}MB limit and were not added.`);
|
|
2806
2602
|
onError == null ? void 0 : onError(oversized, "size");
|
|
2807
2603
|
}
|
|
2808
2604
|
const merged = maxFiles === 1 ? validFiles.slice(0, 1) : [...files, ...validFiles].slice(0, maxFiles);
|
|
2809
2605
|
const countRejected = maxFiles === 1 ? validFiles.slice(1) : [...files, ...validFiles].slice(maxFiles);
|
|
2810
2606
|
if (countRejected.length > 0) {
|
|
2811
|
-
setErrorMessage(
|
|
2812
|
-
`Only ${maxFiles} file(s) allowed. ${countRejected.length} file(s) were not added.`
|
|
2813
|
-
);
|
|
2607
|
+
setErrorMessage(`Only ${maxFiles} file(s) allowed. ${countRejected.length} file(s) were not added.`);
|
|
2814
2608
|
onError == null ? void 0 : onError(countRejected, "count");
|
|
2815
2609
|
}
|
|
2816
2610
|
setFiles(merged);
|
|
2817
2611
|
onFilesChange == null ? void 0 : onFilesChange(merged);
|
|
2818
|
-
}
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
}
|
|
2828
|
-
|
|
2829
|
-
}
|
|
2830
|
-
}, []);
|
|
2831
|
-
const handleDrop = useCallback(
|
|
2832
|
-
(e) => {
|
|
2612
|
+
};
|
|
2613
|
+
const handleDrag = (e) => {
|
|
2614
|
+
e.preventDefault();
|
|
2615
|
+
e.stopPropagation();
|
|
2616
|
+
if (e.type === "dragenter" || e.type === "dragover") {
|
|
2617
|
+
setDragActive(true);
|
|
2618
|
+
} else if (e.type === "dragleave") {
|
|
2619
|
+
setDragActive(false);
|
|
2620
|
+
}
|
|
2621
|
+
};
|
|
2622
|
+
const handleDrop = (e) => {
|
|
2833
2623
|
e.preventDefault();
|
|
2834
2624
|
e.stopPropagation();
|
|
2835
2625
|
setDragActive(false);
|
|
2836
2626
|
if (disabled) return;
|
|
2837
2627
|
handleFiles(e.dataTransfer.files);
|
|
2838
|
-
}
|
|
2839
|
-
|
|
2840
|
-
);
|
|
2841
|
-
const handleChange = useCallback(
|
|
2842
|
-
(e) => {
|
|
2628
|
+
};
|
|
2629
|
+
const handleChange = (e) => {
|
|
2843
2630
|
e.preventDefault();
|
|
2844
2631
|
if (disabled) return;
|
|
2845
2632
|
handleFiles(e.target.files);
|
|
2846
|
-
}
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
const openFileDialog = useCallback(() => {
|
|
2861
|
-
var _a;
|
|
2862
|
-
if (!disabled) {
|
|
2863
|
-
setErrorMessage(null);
|
|
2864
|
-
(_a = inputRef.current) == null ? void 0 : _a.click();
|
|
2865
|
-
}
|
|
2866
|
-
}, [disabled]);
|
|
2867
|
-
return {
|
|
2868
|
-
files,
|
|
2869
|
-
dragActive,
|
|
2870
|
-
errorMessage,
|
|
2871
|
-
inputRef,
|
|
2872
|
-
handleFiles,
|
|
2873
|
-
handleDrag,
|
|
2874
|
-
handleDrop,
|
|
2875
|
-
handleChange,
|
|
2876
|
-
removeFile,
|
|
2877
|
-
openFileDialog
|
|
2878
|
-
};
|
|
2879
|
-
}
|
|
2880
|
-
const FileUpload = React.forwardRef(
|
|
2881
|
-
({
|
|
2882
|
-
className,
|
|
2883
|
-
onFilesChange,
|
|
2884
|
-
maxFiles = 1,
|
|
2885
|
-
maxSize = 5 * 1024 * 1024,
|
|
2886
|
-
// 5MB default
|
|
2887
|
-
showPreview = true,
|
|
2888
|
-
onError,
|
|
2889
|
-
accept,
|
|
2890
|
-
disabled,
|
|
2891
|
-
...props
|
|
2892
|
-
}, ref) => {
|
|
2893
|
-
const {
|
|
2894
|
-
files,
|
|
2895
|
-
dragActive,
|
|
2896
|
-
errorMessage,
|
|
2897
|
-
inputRef,
|
|
2898
|
-
handleDrag,
|
|
2899
|
-
handleDrop,
|
|
2900
|
-
handleChange,
|
|
2901
|
-
removeFile,
|
|
2902
|
-
openFileDialog
|
|
2903
|
-
} = useFileUpload({ maxFiles, maxSize, onFilesChange, onError, disabled });
|
|
2633
|
+
};
|
|
2634
|
+
const removeFile = (index) => {
|
|
2635
|
+
const updatedFiles = files.filter((_, i) => i !== index);
|
|
2636
|
+
setFiles(updatedFiles);
|
|
2637
|
+
onFilesChange == null ? void 0 : onFilesChange(updatedFiles);
|
|
2638
|
+
if (updatedFiles.length === 0) setErrorMessage(null);
|
|
2639
|
+
};
|
|
2640
|
+
const openFileDialog = () => {
|
|
2641
|
+
var _a;
|
|
2642
|
+
if (!disabled) {
|
|
2643
|
+
setErrorMessage(null);
|
|
2644
|
+
(_a = inputRef.current) == null ? void 0 : _a.click();
|
|
2645
|
+
}
|
|
2646
|
+
};
|
|
2904
2647
|
return /* @__PURE__ */ jsxs("div", { ref, className: cn("w-full", className), children: [
|
|
2905
2648
|
/* @__PURE__ */ jsxs(
|
|
2906
2649
|
"div",
|
|
@@ -3178,7 +2921,7 @@ const Search = React.forwardRef(
|
|
|
3178
2921
|
}
|
|
3179
2922
|
);
|
|
3180
2923
|
Search.displayName = "Search";
|
|
3181
|
-
const __vite_import_meta_env__ = { "BASE_URL": "/", "DEV": false, "MODE": "production", "PROD": true, "SSR": false
|
|
2924
|
+
const __vite_import_meta_env__ = { "BASE_URL": "/", "DEV": false, "MODE": "production", "PROD": true, "SSR": false };
|
|
3182
2925
|
const RouteMapContent = React__default.forwardRef(
|
|
3183
2926
|
({ apiKey, ...props }, ref) => {
|
|
3184
2927
|
const { isLoaded, loadError, load } = useGoogleMapsLoader();
|
|
@@ -3355,7 +3098,7 @@ RouteMapContent.displayName = "RouteMapContent";
|
|
|
3355
3098
|
const RouteMap = React__default.forwardRef(
|
|
3356
3099
|
(props, ref) => {
|
|
3357
3100
|
const { isLoaded, loadError } = useGoogleMapsLoader();
|
|
3358
|
-
const effectiveApiKey = props.apiKey || typeof import.meta !== "undefined" && __vite_import_meta_env__ &&
|
|
3101
|
+
const effectiveApiKey = props.apiKey || typeof import.meta !== "undefined" && __vite_import_meta_env__ && void 0 || "";
|
|
3359
3102
|
const isValidKey = effectiveApiKey && effectiveApiKey !== "YOUR_GOOGLE_MAPS_API_KEY_HERE" && effectiveApiKey.startsWith("AIza");
|
|
3360
3103
|
if (isLoaded || isValidKey || loadError) {
|
|
3361
3104
|
return /* @__PURE__ */ jsx(RouteMapContent, { ref, ...props, apiKey: effectiveApiKey });
|
|
@@ -3576,12 +3319,8 @@ export {
|
|
|
3576
3319
|
TreeView as ba,
|
|
3577
3320
|
navigationMenuTriggerStyle as bb,
|
|
3578
3321
|
toggleVariants as bc,
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
usePagination as bf,
|
|
3582
|
-
useStepper as bg,
|
|
3583
|
-
useStepperContext as bh,
|
|
3584
|
-
useTreeView as bi,
|
|
3322
|
+
useFormField as bd,
|
|
3323
|
+
useStepper as be,
|
|
3585
3324
|
AccordionTrigger as c,
|
|
3586
3325
|
AspectRatio as d,
|
|
3587
3326
|
AssistantChart as e,
|