@m5kdev/web-ui 0.7.0 → 0.8.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/dist/src/animations/card.motion.d.ts +7 -2
- package/dist/src/animations/card.motion.js +25 -6
- package/dist/src/animations/card.motion.js.map +1 -0
- package/dist/src/components/AvatarUpload.d.ts +14 -5
- package/dist/src/components/AvatarUpload.js +105 -63
- package/dist/src/components/AvatarUpload.js.map +1 -0
- package/dist/src/components/Button.d.ts +14 -4
- package/dist/src/components/Button.js +13 -4
- package/dist/src/components/Button.js.map +1 -0
- package/dist/src/components/Calendar.d.ts +33 -31
- package/dist/src/components/Calendar.js +14 -6
- package/dist/src/components/Calendar.js.map +1 -0
- package/dist/src/components/{Calendar.css → Calendar2.css} +757 -684
- package/dist/src/components/CardsSelect.d.ts +25 -21
- package/dist/src/components/CardsSelect.js +75 -42
- package/dist/src/components/CardsSelect.js.map +1 -0
- package/dist/src/components/CollapsibleSidebarMenuItem.d.ts +22 -9
- package/dist/src/components/CollapsibleSidebarMenuItem.js +31 -8
- package/dist/src/components/CollapsibleSidebarMenuItem.js.map +1 -0
- package/dist/src/components/ColorPicker.d.ts +15 -4
- package/dist/src/components/ColorPicker.js +46 -16
- package/dist/src/components/ColorPicker.js.map +1 -0
- package/dist/src/components/CopyButton.d.ts +18 -6
- package/dist/src/components/CopyButton.js +28 -19
- package/dist/src/components/CopyButton.js.map +1 -0
- package/dist/src/components/CropDialog.d.ts +20 -8
- package/dist/src/components/CropDialog.js +108 -62
- package/dist/src/components/CropDialog.js.map +1 -0
- package/dist/src/components/DialogProvider.d.ts +22 -14
- package/dist/src/components/DialogProvider.js +67 -45
- package/dist/src/components/DialogProvider.js.map +1 -0
- package/dist/src/components/ErrorFallback.d.ts +13 -4
- package/dist/src/components/ErrorFallback.js +29 -4
- package/dist/src/components/ErrorFallback.js.map +1 -0
- package/dist/src/components/FileDropzone.d.ts +12 -4
- package/dist/src/components/FileDropzone.js +98 -60
- package/dist/src/components/FileDropzone.js.map +1 -0
- package/dist/src/components/MultiSelectDropdown.d.ts +25 -22
- package/dist/src/components/MultiSelectDropdown.js +99 -49
- package/dist/src/components/MultiSelectDropdown.js.map +1 -0
- package/dist/src/components/Orb.d.ts +17 -6
- package/dist/src/components/Orb.js +263 -255
- package/dist/src/components/Orb.js.map +1 -0
- package/dist/src/components/PageAlert.d.ts +20 -15
- package/dist/src/components/PageAlert.js +67 -39
- package/dist/src/components/PageAlert.js.map +1 -0
- package/dist/src/components/SelectChips.d.ts +21 -10
- package/dist/src/components/SelectChips.js +21 -9
- package/dist/src/components/SelectChips.js.map +1 -0
- package/dist/src/components/SidebarItem.d.ts +18 -7
- package/dist/src/components/SidebarItem.js +16 -4
- package/dist/src/components/SidebarItem.js.map +1 -0
- package/dist/src/components/Steps.d.ts +21 -16
- package/dist/src/components/Steps.js +193 -27
- package/dist/src/components/Steps.js.map +1 -0
- package/dist/src/components/TablerIconPicker.d.ts +13 -2
- package/dist/src/components/TablerIconPicker.js +4254 -4234
- package/dist/src/components/TablerIconPicker.js.map +1 -0
- package/dist/src/components/app-header.d.ts +14 -6
- package/dist/src/components/app-header.js +27 -6
- package/dist/src/components/app-header.js.map +1 -0
- package/dist/src/components/blur-card.d.ts +25 -11
- package/dist/src/components/blur-card.js +134 -31
- package/dist/src/components/blur-card.js.map +1 -0
- package/dist/src/components/features-section-demo-1.d.ts +22 -6
- package/dist/src/components/features-section-demo-1.js +119 -47
- package/dist/src/components/features-section-demo-1.js.map +1 -0
- package/dist/src/components/features-section-demo-2.d.ts +7 -1
- package/dist/src/components/features-section-demo-2.js +80 -49
- package/dist/src/components/features-section-demo-2.js.map +1 -0
- package/dist/src/components/features-section-demo-3.d.ts +16 -8
- package/dist/src/components/features-section-demo-3.js +239 -103
- package/dist/src/components/features-section-demo-3.js.map +1 -0
- package/dist/src/components/mode-toggle.d.ts +7 -1
- package/dist/src/components/mode-toggle.js +42 -7
- package/dist/src/components/mode-toggle.js.map +1 -0
- package/dist/src/components/nav-main.d.ts +20 -12
- package/dist/src/components/nav-main.js +31 -5
- package/dist/src/components/nav-main.js.map +1 -0
- package/dist/src/components/pricing-cards.d.ts +7 -1
- package/dist/src/components/pricing-cards.js +125 -24
- package/dist/src/components/pricing-cards.js.map +1 -0
- package/dist/src/components/shared/ButtonCopy.d.ts +17 -6
- package/dist/src/components/shared/ButtonCopy.js +31 -20
- package/dist/src/components/shared/ButtonCopy.js.map +1 -0
- package/dist/src/components/team-switcher.d.ts +16 -8
- package/dist/src/components/team-switcher.js +70 -8
- package/dist/src/components/team-switcher.js.map +1 -0
- package/dist/src/components/theme-provider.d.ts +18 -8
- package/dist/src/components/theme-provider.js +42 -38
- package/dist/src/components/theme-provider.js.map +1 -0
- package/dist/src/components/typewriter.d.ts +35 -14
- package/dist/src/components/typewriter.js +45 -36
- package/dist/src/components/typewriter.js.map +1 -0
- package/dist/src/components/ui/alert-dialog.d.ts +48 -13
- package/dist/src/components/ui/alert-dialog.js +58 -15
- package/dist/src/components/ui/alert-dialog.js.map +1 -0
- package/dist/src/components/ui/alert.d.ts +24 -8
- package/dist/src/components/ui/alert.js +28 -15
- package/dist/src/components/ui/alert.js.map +1 -0
- package/dist/src/components/ui/avatar.d.ts +9 -5
- package/dist/src/components/ui/avatar.js +23 -7
- package/dist/src/components/ui/avatar.js.map +1 -0
- package/dist/src/components/ui/badge.d.ts +17 -8
- package/dist/src/components/ui/badge.js +17 -14
- package/dist/src/components/ui/badge.js.map +1 -0
- package/dist/src/components/ui/bento-grid.d.ts +26 -11
- package/dist/src/components/ui/bento-grid.js +30 -6
- package/dist/src/components/ui/bento-grid.js.map +1 -0
- package/dist/src/components/ui/bento-grid2.d.ts +30 -14
- package/dist/src/components/ui/bento-grid2.js +45 -9
- package/dist/src/components/ui/bento-grid2.js.map +1 -0
- package/dist/src/components/ui/breadcrumb.d.ts +27 -15
- package/dist/src/components/ui/breadcrumb.js +54 -14
- package/dist/src/components/ui/breadcrumb.js.map +1 -0
- package/dist/src/components/ui/button.d.ts +14 -9
- package/dist/src/components/ui/button.js +37 -26
- package/dist/src/components/ui/button.js.map +1 -0
- package/dist/src/components/ui/card.d.ts +12 -8
- package/dist/src/components/ui/card.js +38 -10
- package/dist/src/components/ui/card.js.map +1 -0
- package/dist/src/components/ui/checkbox.d.ts +6 -2
- package/dist/src/components/ui/checkbox.js +17 -5
- package/dist/src/components/ui/checkbox.js.map +1 -0
- package/dist/src/components/ui/collapsible.d.ts +9 -4
- package/dist/src/components/ui/collapsible.js +5 -1
- package/dist/src/components/ui/collapsible.js.map +1 -0
- package/dist/src/components/ui/dialog.d.ts +44 -12
- package/dist/src/components/ui/dialog.js +64 -14
- package/dist/src/components/ui/dialog.js.map +1 -0
- package/dist/src/components/ui/dropdown-menu.d.ts +32 -24
- package/dist/src/components/ui/dropdown-menu.js +64 -14
- package/dist/src/components/ui/dropdown-menu.js.map +1 -0
- package/dist/src/components/ui/floating-navbar.d.ts +18 -9
- package/dist/src/components/ui/floating-navbar.js +49 -35
- package/dist/src/components/ui/floating-navbar.js.map +1 -0
- package/dist/src/components/ui/form.d.ts +30 -21
- package/dist/src/components/ui/form.js +76 -44
- package/dist/src/components/ui/form.js.map +1 -0
- package/dist/src/components/ui/image.d.ts +6 -2
- package/dist/src/components/ui/image.js +51 -11
- package/dist/src/components/ui/image.js.map +1 -0
- package/dist/src/components/ui/input.d.ts +6 -2
- package/dist/src/components/ui/input.js +14 -5
- package/dist/src/components/ui/input.js.map +1 -0
- package/dist/src/components/ui/label.d.ts +8 -3
- package/dist/src/components/ui/label.js +13 -5
- package/dist/src/components/ui/label.js.map +1 -0
- package/dist/src/components/ui/pagination.d.ts +39 -12
- package/dist/src/components/ui/pagination.js +64 -14
- package/dist/src/components/ui/pagination.js.map +1 -0
- package/dist/src/components/ui/progress.d.ts +6 -2
- package/dist/src/components/ui/progress.js +16 -4
- package/dist/src/components/ui/progress.js.map +1 -0
- package/dist/src/components/ui/resizable-navbar.d.ts +84 -43
- package/dist/src/components/ui/resizable-navbar.js +126 -74
- package/dist/src/components/ui/resizable-navbar.js.map +1 -0
- package/dist/src/components/ui/segment-control.d.ts +10 -7
- package/dist/src/components/ui/segment-control.js +83 -38
- package/dist/src/components/ui/segment-control.js.map +1 -0
- package/dist/src/components/ui/select.d.ts +16 -12
- package/dist/src/components/ui/select.js +63 -14
- package/dist/src/components/ui/select.js.map +1 -0
- package/dist/src/components/ui/separator.d.ts +6 -2
- package/dist/src/components/ui/separator.js +14 -4
- package/dist/src/components/ui/separator.js.map +1 -0
- package/dist/src/components/ui/sheet.d.ts +30 -19
- package/dist/src/components/ui/sheet.js +52 -23
- package/dist/src/components/ui/sheet.js.map +1 -0
- package/dist/src/components/ui/sidebar.d.ts +69 -62
- package/dist/src/components/ui/sidebar.js +326 -171
- package/dist/src/components/ui/sidebar.js.map +1 -0
- package/dist/src/components/ui/skeleton.d.ts +9 -1
- package/dist/src/components/ui/skeleton.js +10 -3
- package/dist/src/components/ui/skeleton.js.map +1 -0
- package/dist/src/components/ui/slider.d.ts +6 -2
- package/dist/src/components/ui/slider.js +16 -4
- package/dist/src/components/ui/slider.js.map +1 -0
- package/dist/src/components/ui/sonner.d.ts +10 -3
- package/dist/src/components/ui/sonner.js +18 -11
- package/dist/src/components/ui/sonner.js.map +1 -0
- package/dist/src/components/ui/spinner.d.ts +21 -10
- package/dist/src/components/ui/spinner.js +24 -24
- package/dist/src/components/ui/spinner.js.map +1 -0
- package/dist/src/components/ui/switch.d.ts +6 -2
- package/dist/src/components/ui/switch.js +13 -4
- package/dist/src/components/ui/switch.js.map +1 -0
- package/dist/src/components/ui/table.d.ts +39 -10
- package/dist/src/components/ui/table.js +51 -11
- package/dist/src/components/ui/table.js.map +1 -0
- package/dist/src/components/ui/tabs.d.ts +23 -6
- package/dist/src/components/ui/tabs.js +27 -7
- package/dist/src/components/ui/tabs.js.map +1 -0
- package/dist/src/components/ui/textarea.d.ts +10 -2
- package/dist/src/components/ui/textarea.js +11 -3
- package/dist/src/components/ui/textarea.js.map +1 -0
- package/dist/src/components/ui/timeline.d.ts +16 -9
- package/dist/src/components/ui/timeline.js +87 -24
- package/dist/src/components/ui/timeline.js.map +1 -0
- package/dist/src/components/ui/toast.d.ts +19 -14
- package/dist/src/components/ui/toast.js +48 -22
- package/dist/src/components/ui/toast.js.map +1 -0
- package/dist/src/components/ui/tooltip.d.ts +23 -6
- package/dist/src/components/ui/tooltip.js +27 -7
- package/dist/src/components/ui/tooltip.js.map +1 -0
- package/dist/src/components/ui/typewriter-effect.d.ts +28 -14
- package/dist/src/components/ui/typewriter-effect.js +102 -72
- package/dist/src/components/ui/typewriter-effect.js.map +1 -0
- package/dist/src/hooks/use-mobile.d.ts +5 -1
- package/dist/src/hooks/use-mobile.js +18 -13
- package/dist/src/hooks/use-mobile.js.map +1 -0
- package/dist/src/hooks/useDialog.d.ts +8 -4
- package/dist/src/hooks/useDialog.js +24 -20
- package/dist/src/hooks/useDialog.js.map +1 -0
- package/dist/src/icons/GoogleIcon.d.ts +9 -5
- package/dist/src/icons/GoogleIcon.js +32 -3
- package/dist/src/icons/GoogleIcon.js.map +1 -0
- package/dist/src/icons/LinkedInIcon.d.ts +9 -5
- package/dist/src/icons/LinkedInIcon.js +27 -3
- package/dist/src/icons/LinkedInIcon.js.map +1 -0
- package/dist/src/icons/MicrosoftIcon.d.ts +9 -5
- package/dist/src/icons/MicrosoftIcon.js +31 -3
- package/dist/src/icons/MicrosoftIcon.js.map +1 -0
- package/dist/src/lib/chatwoot.d.ts +19 -10
- package/dist/src/lib/chatwoot.js +25 -27
- package/dist/src/lib/chatwoot.js.map +1 -0
- package/dist/src/lib/utils.d.ts +7 -2
- package/dist/src/lib/utils.js +7 -2
- package/dist/src/lib/utils.js.map +1 -0
- package/dist/src/modules/app/components/AppLoader.d.ts +8 -2
- package/dist/src/modules/app/components/AppLoader.js +14 -3
- package/dist/src/modules/app/components/AppLoader.js.map +1 -0
- package/dist/src/modules/app/components/AppShell.d.ts +15 -6
- package/dist/src/modules/app/components/AppShell.js +14 -5
- package/dist/src/modules/app/components/AppShell.js.map +1 -0
- package/dist/src/modules/app/components/AppSidebar.d.ts +16 -6
- package/dist/src/modules/app/components/AppSidebar.js +17 -4
- package/dist/src/modules/app/components/AppSidebar.js.map +1 -0
- package/dist/src/modules/app/components/AppSidebarContent.d.ts +22 -13
- package/dist/src/modules/app/components/AppSidebarContent.js +34 -5
- package/dist/src/modules/app/components/AppSidebarContent.js.map +1 -0
- package/dist/src/modules/app/components/AppSidebarHeader.d.ts +18 -8
- package/dist/src/modules/app/components/AppSidebarHeader.js +37 -6
- package/dist/src/modules/app/components/AppSidebarHeader.js.map +1 -0
- package/dist/src/modules/app/components/AppSidebarInvites.d.ts +11 -3
- package/dist/src/modules/app/components/AppSidebarInvites.js +39 -8
- package/dist/src/modules/app/components/AppSidebarInvites.js.map +1 -0
- package/dist/src/modules/app/components/AppSidebarUser.d.ts +20 -10
- package/dist/src/modules/app/components/AppSidebarUser.js +121 -12
- package/dist/src/modules/app/components/AppSidebarUser.js.map +1 -0
- package/dist/src/modules/auth/components/AdminUserManagement.d.ts +11 -4
- package/dist/src/modules/auth/components/AdminUserManagement.js +970 -418
- package/dist/src/modules/auth/components/AdminUserManagement.js.map +1 -0
- package/dist/src/modules/auth/components/AdminWaitlist.d.ts +11 -4
- package/dist/src/modules/auth/components/AdminWaitlist.js +284 -115
- package/dist/src/modules/auth/components/AdminWaitlist.js.map +1 -0
- package/dist/src/modules/auth/components/AuthLayout.d.ts +12 -4
- package/dist/src/modules/auth/components/AuthLayout.js +17 -3
- package/dist/src/modules/auth/components/AuthLayout.js.map +1 -0
- package/dist/src/modules/auth/components/AuthProviders.d.ts +17 -6
- package/dist/src/modules/auth/components/AuthProviders.js +80 -41
- package/dist/src/modules/auth/components/AuthProviders.js.map +1 -0
- package/dist/src/modules/auth/components/AuthRouter.d.ts +16 -7
- package/dist/src/modules/auth/components/AuthRouter.js +46 -10
- package/dist/src/modules/auth/components/AuthRouter.js.map +1 -0
- package/dist/src/modules/auth/components/ClaimAccountRoute.d.ts +12 -4
- package/dist/src/modules/auth/components/ClaimAccountRoute.js +202 -139
- package/dist/src/modules/auth/components/ClaimAccountRoute.js.map +1 -0
- package/dist/src/modules/auth/components/ErrorAuthRoute.d.ts +7 -1
- package/dist/src/modules/auth/components/ErrorAuthRoute.js +125 -89
- package/dist/src/modules/auth/components/ErrorAuthRoute.js.map +1 -0
- package/dist/src/modules/auth/components/ForgotPasswordForm.d.ts +7 -1
- package/dist/src/modules/auth/components/ForgotPasswordForm.js +49 -23
- package/dist/src/modules/auth/components/ForgotPasswordForm.js.map +1 -0
- package/dist/src/modules/auth/components/ForgotPasswordRoute.d.ts +7 -1
- package/dist/src/modules/auth/components/ForgotPasswordRoute.js +34 -6
- package/dist/src/modules/auth/components/ForgotPasswordRoute.js.map +1 -0
- package/dist/src/modules/auth/components/InviteFriends.d.ts +12 -4
- package/dist/src/modules/auth/components/InviteFriends.js +275 -69
- package/dist/src/modules/auth/components/InviteFriends.js.map +1 -0
- package/dist/src/modules/auth/components/LastUsedBadge.d.ts +17 -5
- package/dist/src/modules/auth/components/LastUsedBadge.js +16 -6
- package/dist/src/modules/auth/components/LastUsedBadge.js.map +1 -0
- package/dist/src/modules/auth/components/LoginForm.d.ts +11 -3
- package/dist/src/modules/auth/components/LoginForm.js +107 -40
- package/dist/src/modules/auth/components/LoginForm.js.map +1 -0
- package/dist/src/modules/auth/components/LoginRoute.d.ts +11 -3
- package/dist/src/modules/auth/components/LoginRoute.js +41 -8
- package/dist/src/modules/auth/components/LoginRoute.js.map +1 -0
- package/dist/src/modules/auth/components/LogoutRoute.d.ts +7 -1
- package/dist/src/modules/auth/components/LogoutRoute.js +18 -12
- package/dist/src/modules/auth/components/LogoutRoute.js.map +1 -0
- package/dist/src/modules/auth/components/OrganizationAcceptInvitationRoute.d.ts +21 -8
- package/dist/src/modules/auth/components/OrganizationAcceptInvitationRoute.js +107 -97
- package/dist/src/modules/auth/components/OrganizationAcceptInvitationRoute.js.map +1 -0
- package/dist/src/modules/auth/components/OrganizationMembersRoute.d.ts +58 -48
- package/dist/src/modules/auth/components/OrganizationMembersRoute.js +448 -349
- package/dist/src/modules/auth/components/OrganizationMembersRoute.js.map +1 -0
- package/dist/src/modules/auth/components/OrganizationPreferences.d.ts +27 -16
- package/dist/src/modules/auth/components/OrganizationPreferences.js +129 -124
- package/dist/src/modules/auth/components/OrganizationPreferences.js.map +1 -0
- package/dist/src/modules/auth/components/OrganizationSettingsRoute.d.ts +27 -18
- package/dist/src/modules/auth/components/OrganizationSettingsRoute.js +184 -144
- package/dist/src/modules/auth/components/OrganizationSettingsRoute.js.map +1 -0
- package/dist/src/modules/auth/components/OrganizationSwitcher.d.ts +17 -6
- package/dist/src/modules/auth/components/OrganizationSwitcher.js +91 -69
- package/dist/src/modules/auth/components/OrganizationSwitcher.js.map +1 -0
- package/dist/src/modules/auth/components/PreferencesEditor.d.ts +44 -33
- package/dist/src/modules/auth/components/PreferencesEditor.js +82 -58
- package/dist/src/modules/auth/components/PreferencesEditor.js.map +1 -0
- package/dist/src/modules/auth/components/ProfileRoute.d.ts +7 -1
- package/dist/src/modules/auth/components/ProfileRoute.js +79 -36
- package/dist/src/modules/auth/components/ProfileRoute.js.map +1 -0
- package/dist/src/modules/auth/components/RangeNuqsDatePicker.d.ts +44 -30
- package/dist/src/modules/auth/components/RangeNuqsDatePicker.js +234 -242
- package/dist/src/modules/auth/components/RangeNuqsDatePicker.js.map +1 -0
- package/dist/src/modules/auth/components/ResetPasswordForm.d.ts +7 -1
- package/dist/src/modules/auth/components/ResetPasswordForm.js +97 -35
- package/dist/src/modules/auth/components/ResetPasswordForm.js.map +1 -0
- package/dist/src/modules/auth/components/ResetPasswordRoute.d.ts +7 -1
- package/dist/src/modules/auth/components/ResetPasswordRoute.js +34 -6
- package/dist/src/modules/auth/components/ResetPasswordRoute.js.map +1 -0
- package/dist/src/modules/auth/components/SignupFormRoute.d.ts +15 -5
- package/dist/src/modules/auth/components/SignupFormRoute.js +142 -99
- package/dist/src/modules/auth/components/SignupFormRoute.js.map +1 -0
- package/dist/src/modules/auth/components/SignupRoute.d.ts +13 -5
- package/dist/src/modules/auth/components/SignupRoute.js +59 -13
- package/dist/src/modules/auth/components/SignupRoute.js.map +1 -0
- package/dist/src/modules/auth/components/UserPreferences.d.ts +22 -11
- package/dist/src/modules/auth/components/UserPreferences.js +24 -12
- package/dist/src/modules/auth/components/UserPreferences.js.map +1 -0
- package/dist/src/modules/auth/components/WaitlistCard.d.ts +11 -4
- package/dist/src/modules/auth/components/WaitlistCard.js +63 -28
- package/dist/src/modules/auth/components/WaitlistCard.js.map +1 -0
- package/dist/src/modules/auth/components/WaitlistCodeValidation.d.ts +13 -5
- package/dist/src/modules/auth/components/WaitlistCodeValidation.js +42 -40
- package/dist/src/modules/auth/components/WaitlistCodeValidation.js.map +1 -0
- package/dist/src/modules/billing/components/BillingBetaPage.d.ts +15 -6
- package/dist/src/modules/billing/components/BillingBetaPage.js +155 -8
- package/dist/src/modules/billing/components/BillingBetaPage.js.map +1 -0
- package/dist/src/modules/billing/components/BillingInvoicePage.d.ts +13 -5
- package/dist/src/modules/billing/components/BillingInvoicePage.js +160 -30
- package/dist/src/modules/billing/components/BillingInvoicePage.js.map +1 -0
- package/dist/src/modules/billing/components/BillingPlanSelect.d.ts +11 -4
- package/dist/src/modules/billing/components/BillingPlanSelect.js +10 -7
- package/dist/src/modules/billing/components/BillingPlanSelect.js.map +1 -0
- package/dist/src/modules/billing/components/BillingRouter.d.ts +15 -7
- package/dist/src/modules/billing/components/BillingRouter.js +19 -6
- package/dist/src/modules/billing/components/BillingRouter.js.map +1 -0
- package/dist/src/modules/billing/components/BillingSinglePlanSelect.d.ts +17 -7
- package/dist/src/modules/billing/components/BillingSinglePlanSelect.js +163 -42
- package/dist/src/modules/billing/components/BillingSinglePlanSelect.js.map +1 -0
- package/dist/src/modules/table/components/ColumnOrderAndVisibility.d.ts +18 -8
- package/dist/src/modules/table/components/ColumnOrderAndVisibility.js +81 -38
- package/dist/src/modules/table/components/ColumnOrderAndVisibility.js.map +1 -0
- package/dist/src/modules/table/components/NuqsTable.d.ts +33 -21
- package/dist/src/modules/table/components/NuqsTable.js +295 -221
- package/dist/src/modules/table/components/NuqsTable.js.map +1 -0
- package/dist/src/modules/table/components/TableFiltering.d.ts +33 -21
- package/dist/src/modules/table/components/TableFiltering.js +408 -226
- package/dist/src/modules/table/components/TableFiltering.js.map +1 -0
- package/dist/src/modules/table/components/TableGroupBy.d.ts +18 -8
- package/dist/src/modules/table/components/TableGroupBy.js +56 -16
- package/dist/src/modules/table/components/TableGroupBy.js.map +1 -0
- package/dist/src/modules/table/components/TablePagination.d.ts +17 -7
- package/dist/src/modules/table/components/TablePagination.js +64 -32
- package/dist/src/modules/table/components/TablePagination.js.map +1 -0
- package/dist/src/modules/table/components/table.types.d.ts +15 -10
- package/dist/src/modules/table/components/table.types.js +0 -1
- package/dist/src/modules/table/filterTransformers.d.ts +35 -30
- package/dist/src/modules/table/filterTransformers.js +198 -261
- package/dist/src/modules/table/filterTransformers.js.map +1 -0
- package/dist/src/types.d.ts +8 -3
- package/dist/src/types.js +0 -1
- package/package.json +8 -6
- package/dist/translations/en/web-ui.json +0 -209
- package/dist/tsconfig.lib.tsbuildinfo +0 -1
|
@@ -1,39 +1,101 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import { Button, Card, CardBody, CardHeader, Input } from "@heroui/react";
|
|
3
|
-
import {
|
|
4
|
-
import { useForm } from "react-hook-form";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
3
|
import { useTranslation } from "react-i18next";
|
|
6
|
-
import { Link, useSearchParams } from "react-router";
|
|
4
|
+
import { Link as Link$1, useSearchParams } from "react-router";
|
|
7
5
|
import { toast } from "sonner";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
6
|
+
import { useForm } from "react-hook-form";
|
|
7
|
+
import { authClient } from "@m5kdev/frontend/modules/auth/auth.lib";
|
|
8
|
+
//#region src/modules/auth/components/ResetPasswordForm.tsx
|
|
9
|
+
function ResetPasswordForm() {
|
|
10
|
+
const { t } = useTranslation();
|
|
11
|
+
const { register, handleSubmit, setError, formState: { errors } } = useForm();
|
|
12
|
+
const [searchParams] = useSearchParams();
|
|
13
|
+
const token = searchParams.get("token");
|
|
14
|
+
const onSubmit = (data) => {
|
|
15
|
+
if (data.password !== data.confirmPassword) {
|
|
16
|
+
setError("confirmPassword", { message: t("web-ui:auth.resetPassword.passwordMismatch") });
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (!token) throw new Error(t("web-ui:auth.resetPassword.tokenRequired"));
|
|
20
|
+
authClient.resetPassword({
|
|
21
|
+
newPassword: data.password,
|
|
22
|
+
token
|
|
23
|
+
}).then(() => {
|
|
24
|
+
toast.success(t("web-ui:auth.resetPassword.success"));
|
|
25
|
+
}).catch(() => {
|
|
26
|
+
toast.error(t("web-ui:auth.resetPassword.error"));
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
30
|
+
className: "flex flex-col gap-6",
|
|
31
|
+
children: [/* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsxs(CardHeader, {
|
|
32
|
+
className: "text-center flex flex-col gap-1",
|
|
33
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
34
|
+
className: "text-xl font-semibold",
|
|
35
|
+
children: t("web-ui:auth.resetPassword.title")
|
|
36
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
37
|
+
className: "text-sm text-default-600",
|
|
38
|
+
children: t("web-ui:auth.resetPassword.description")
|
|
39
|
+
})]
|
|
40
|
+
}), /* @__PURE__ */ jsx(CardBody, {
|
|
41
|
+
className: "gap-6",
|
|
42
|
+
children: /* @__PURE__ */ jsxs("form", {
|
|
43
|
+
onSubmit: handleSubmit(onSubmit),
|
|
44
|
+
className: "grid gap-6",
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ jsxs("div", {
|
|
47
|
+
className: "grid gap-2",
|
|
48
|
+
children: [/* @__PURE__ */ jsx(Input, {
|
|
49
|
+
labelPlacement: "outside",
|
|
50
|
+
label: t("web-ui:auth.resetPassword.newPassword"),
|
|
51
|
+
placeholder: t("web-ui:auth.resetPassword.newPassword"),
|
|
52
|
+
type: "password",
|
|
53
|
+
variant: "bordered",
|
|
54
|
+
isRequired: true,
|
|
55
|
+
...register("password", { required: t("web-ui:auth.resetPassword.passwordRequired") })
|
|
56
|
+
}), errors.password && /* @__PURE__ */ jsx("span", {
|
|
57
|
+
className: "text-red-500 text-xs",
|
|
58
|
+
children: errors.password.message
|
|
59
|
+
})]
|
|
60
|
+
}),
|
|
61
|
+
/* @__PURE__ */ jsxs("div", {
|
|
62
|
+
className: "grid gap-2",
|
|
63
|
+
children: [/* @__PURE__ */ jsx(Input, {
|
|
64
|
+
labelPlacement: "outside",
|
|
65
|
+
label: t("web-ui:auth.resetPassword.confirmPassword"),
|
|
66
|
+
placeholder: t("web-ui:auth.resetPassword.confirmPassword"),
|
|
67
|
+
type: "password",
|
|
68
|
+
variant: "bordered",
|
|
69
|
+
isRequired: true,
|
|
70
|
+
...register("confirmPassword", { required: t("web-ui:auth.resetPassword.confirmPasswordRequired") })
|
|
71
|
+
}), errors.confirmPassword && /* @__PURE__ */ jsx("span", {
|
|
72
|
+
className: "text-red-500 text-xs",
|
|
73
|
+
children: errors.confirmPassword.message
|
|
74
|
+
})]
|
|
75
|
+
}),
|
|
76
|
+
/* @__PURE__ */ jsx(Button, {
|
|
77
|
+
type: "submit",
|
|
78
|
+
className: "w-full",
|
|
79
|
+
color: "primary",
|
|
80
|
+
children: t("web-ui:auth.resetPassword.button")
|
|
81
|
+
})
|
|
82
|
+
]
|
|
83
|
+
})
|
|
84
|
+
})] }), /* @__PURE__ */ jsxs("div", {
|
|
85
|
+
className: "text-center text-xs text-muted-foreground",
|
|
86
|
+
children: [
|
|
87
|
+
t("web-ui:auth.forgotPassword.rememberPassword"),
|
|
88
|
+
" ",
|
|
89
|
+
/* @__PURE__ */ jsx(Link$1, {
|
|
90
|
+
to: "/login",
|
|
91
|
+
className: "underline underline-offset-4 hover:text-primary",
|
|
92
|
+
children: t("web-ui:auth.login.button")
|
|
93
|
+
})
|
|
94
|
+
]
|
|
95
|
+
})]
|
|
96
|
+
});
|
|
39
97
|
}
|
|
98
|
+
//#endregion
|
|
99
|
+
export { ResetPasswordForm };
|
|
100
|
+
|
|
101
|
+
//# sourceMappingURL=ResetPasswordForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResetPasswordForm.js","names":["Link"],"sources":["../../../../../src/modules/auth/components/ResetPasswordForm.tsx"],"sourcesContent":["import { Button, Card, CardBody, CardHeader, Input } from \"@heroui/react\";\r\nimport { authClient } from \"@m5kdev/frontend/modules/auth/auth.lib\";\r\nimport { type SubmitHandler, useForm } from \"react-hook-form\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { Link, useSearchParams } from \"react-router\";\r\nimport { toast } from \"sonner\";\r\n\r\ntype Inputs = {\r\n password: string;\r\n confirmPassword: string;\r\n};\r\n\r\nexport function ResetPasswordForm() {\r\n const { t } = useTranslation();\r\n const {\r\n register,\r\n handleSubmit,\r\n setError,\r\n formState: { errors },\r\n } = useForm<Inputs>();\r\n const [searchParams] = useSearchParams();\r\n const token = searchParams.get(\"token\");\r\n\r\n const onSubmit: SubmitHandler<Inputs> = (data) => {\r\n if (data.password !== data.confirmPassword) {\r\n setError(\"confirmPassword\", { message: t(\"web-ui:auth.resetPassword.passwordMismatch\") });\r\n return;\r\n }\r\n\r\n if (!token) {\r\n throw new Error(t(\"web-ui:auth.resetPassword.tokenRequired\"));\r\n }\r\n\r\n authClient\r\n .resetPassword({\r\n newPassword: data.password,\r\n token,\r\n })\r\n .then(() => {\r\n toast.success(t(\"web-ui:auth.resetPassword.success\"));\r\n // Optionally, redirect\r\n })\r\n .catch(() => {\r\n toast.error(t(\"web-ui:auth.resetPassword.error\"));\r\n });\r\n };\r\n\r\n return (\r\n <div className=\"flex flex-col gap-6\">\r\n <Card>\r\n <CardHeader className=\"text-center flex flex-col gap-1\">\r\n <h2 className=\"text-xl font-semibold\">{t(\"web-ui:auth.resetPassword.title\")}</h2>\r\n <p className=\"text-sm text-default-600\">{t(\"web-ui:auth.resetPassword.description\")}</p>\r\n </CardHeader>\r\n <CardBody className=\"gap-6\">\r\n <form onSubmit={handleSubmit(onSubmit)} className=\"grid gap-6\">\r\n <div className=\"grid gap-2\">\r\n <Input\r\n labelPlacement=\"outside\"\r\n label={t(\"web-ui:auth.resetPassword.newPassword\")}\r\n placeholder={t(\"web-ui:auth.resetPassword.newPassword\")}\r\n type=\"password\"\r\n variant=\"bordered\"\r\n isRequired\r\n {...register(\"password\", {\r\n required: t(\"web-ui:auth.resetPassword.passwordRequired\"),\r\n })}\r\n />\r\n {errors.password && (\r\n <span className=\"text-red-500 text-xs\">{errors.password.message}</span>\r\n )}\r\n </div>\r\n <div className=\"grid gap-2\">\r\n <Input\r\n labelPlacement=\"outside\"\r\n label={t(\"web-ui:auth.resetPassword.confirmPassword\")}\r\n placeholder={t(\"web-ui:auth.resetPassword.confirmPassword\")}\r\n type=\"password\"\r\n variant=\"bordered\"\r\n isRequired\r\n {...register(\"confirmPassword\", {\r\n required: t(\"web-ui:auth.resetPassword.confirmPasswordRequired\"),\r\n })}\r\n />\r\n {errors.confirmPassword && (\r\n <span className=\"text-red-500 text-xs\">{errors.confirmPassword.message}</span>\r\n )}\r\n </div>\r\n <Button type=\"submit\" className=\"w-full\" color=\"primary\">\r\n {t(\"web-ui:auth.resetPassword.button\")}\r\n </Button>\r\n </form>\r\n </CardBody>\r\n </Card>\r\n <div className=\"text-center text-xs text-muted-foreground\">\r\n {t(\"web-ui:auth.forgotPassword.rememberPassword\")}{\" \"}\r\n <Link to=\"/login\" className=\"underline underline-offset-4 hover:text-primary\">\r\n {t(\"web-ui:auth.login.button\")}\r\n </Link>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"mappings":";;;;;;;;AAYA,SAAgB,oBAAoB;CAClC,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,EACJ,UACA,cACA,UACA,WAAW,EAAE,aACX,SAAiB;CACrB,MAAM,CAAC,gBAAgB,iBAAiB;CACxC,MAAM,QAAQ,aAAa,IAAI,QAAQ;CAEvC,MAAM,YAAmC,SAAS;AAChD,MAAI,KAAK,aAAa,KAAK,iBAAiB;AAC1C,YAAS,mBAAmB,EAAE,SAAS,EAAE,6CAA6C,EAAE,CAAC;AACzF;;AAGF,MAAI,CAAC,MACH,OAAM,IAAI,MAAM,EAAE,0CAA0C,CAAC;AAG/D,aACG,cAAc;GACb,aAAa,KAAK;GAClB;GACD,CAAC,CACD,WAAW;AACV,SAAM,QAAQ,EAAE,oCAAoC,CAAC;IAErD,CACD,YAAY;AACX,SAAM,MAAM,EAAE,kCAAkC,CAAC;IACjD;;AAGN,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,qBAAC,MAAD,EAAA,UAAA,CACE,qBAAC,YAAD;GAAY,WAAU;aAAtB,CACE,oBAAC,MAAD;IAAI,WAAU;cAAyB,EAAE,kCAAkC;IAAM,CAAA,EACjF,oBAAC,KAAD;IAAG,WAAU;cAA4B,EAAE,wCAAwC;IAAK,CAAA,CAC7E;MACb,oBAAC,UAAD;GAAU,WAAU;aAClB,qBAAC,QAAD;IAAM,UAAU,aAAa,SAAS;IAAE,WAAU;cAAlD;KACE,qBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,oBAAC,OAAD;OACE,gBAAe;OACf,OAAO,EAAE,wCAAwC;OACjD,aAAa,EAAE,wCAAwC;OACvD,MAAK;OACL,SAAQ;OACR,YAAA;OACA,GAAI,SAAS,YAAY,EACvB,UAAU,EAAE,6CAA6C,EAC1D,CAAC;OACF,CAAA,EACD,OAAO,YACN,oBAAC,QAAD;OAAM,WAAU;iBAAwB,OAAO,SAAS;OAAe,CAAA,CAErE;;KACN,qBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,oBAAC,OAAD;OACE,gBAAe;OACf,OAAO,EAAE,4CAA4C;OACrD,aAAa,EAAE,4CAA4C;OAC3D,MAAK;OACL,SAAQ;OACR,YAAA;OACA,GAAI,SAAS,mBAAmB,EAC9B,UAAU,EAAE,oDAAoD,EACjE,CAAC;OACF,CAAA,EACD,OAAO,mBACN,oBAAC,QAAD;OAAM,WAAU;iBAAwB,OAAO,gBAAgB;OAAe,CAAA,CAE5E;;KACN,oBAAC,QAAD;MAAQ,MAAK;MAAS,WAAU;MAAS,OAAM;gBAC5C,EAAE,mCAAmC;MAC/B,CAAA;KACJ;;GACE,CAAA,CACN,EAAA,CAAA,EACP,qBAAC,OAAD;GAAK,WAAU;aAAf;IACG,EAAE,8CAA8C;IAAE;IACnD,oBAACA,QAAD;KAAM,IAAG;KAAS,WAAU;eACzB,EAAE,2BAA2B;KACzB,CAAA;IACH;KACF"}
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/modules/auth/components/ResetPasswordRoute.d.ts
|
|
4
|
+
declare function ResetPasswordRoute(): _$react_jsx_runtime0.JSX.Element;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { ResetPasswordRoute };
|
|
7
|
+
//# sourceMappingURL=ResetPasswordRoute.d.ts.map
|
|
@@ -1,9 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ResetPasswordForm } from "./ResetPasswordForm.js";
|
|
2
2
|
import { Card, CardBody, CardHeader } from "@heroui/react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
import { useTranslation } from "react-i18next";
|
|
4
|
-
import { Link } from "react-router";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
import { Link as Link$1 } from "react-router";
|
|
6
|
+
//#region src/modules/auth/components/ResetPasswordRoute.tsx
|
|
7
|
+
function ResetPasswordRoute() {
|
|
8
|
+
const { t } = useTranslation();
|
|
9
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
10
|
+
className: "flex flex-col gap-6",
|
|
11
|
+
children: [/* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsxs(CardHeader, {
|
|
12
|
+
className: "text-center flex flex-col gap-1",
|
|
13
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
14
|
+
className: "text-xl font-semibold",
|
|
15
|
+
children: t("web-ui:auth.resetPassword.title")
|
|
16
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
17
|
+
className: "text-sm text-default-600",
|
|
18
|
+
children: t("web-ui:auth.resetPassword.description")
|
|
19
|
+
})]
|
|
20
|
+
}), /* @__PURE__ */ jsx(CardBody, { children: /* @__PURE__ */ jsx(ResetPasswordForm, {}) })] }), /* @__PURE__ */ jsxs("div", {
|
|
21
|
+
className: "text-center text-xs text-muted-foreground",
|
|
22
|
+
children: [
|
|
23
|
+
t("web-ui:auth.forgotPassword.rememberPassword"),
|
|
24
|
+
" ",
|
|
25
|
+
/* @__PURE__ */ jsx(Link$1, {
|
|
26
|
+
to: "/login",
|
|
27
|
+
className: "underline underline-offset-4 hover:text-primary",
|
|
28
|
+
children: t("web-ui:auth.login.button")
|
|
29
|
+
})
|
|
30
|
+
]
|
|
31
|
+
})]
|
|
32
|
+
});
|
|
9
33
|
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { ResetPasswordRoute };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=ResetPasswordRoute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResetPasswordRoute.js","names":["Link"],"sources":["../../../../../src/modules/auth/components/ResetPasswordRoute.tsx"],"sourcesContent":["import { Card, CardBody, CardHeader } from \"@heroui/react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { Link } from \"react-router\";\r\nimport { ResetPasswordForm } from \"./ResetPasswordForm\";\r\n\r\nexport function ResetPasswordRoute() {\r\n const { t } = useTranslation();\r\n return (\r\n <div className=\"flex flex-col gap-6\">\r\n <Card>\r\n <CardHeader className=\"text-center flex flex-col gap-1\">\r\n <h2 className=\"text-xl font-semibold\">{t(\"web-ui:auth.resetPassword.title\")}</h2>\r\n <p className=\"text-sm text-default-600\">{t(\"web-ui:auth.resetPassword.description\")}</p>\r\n </CardHeader>\r\n <CardBody>\r\n <ResetPasswordForm />\r\n </CardBody>\r\n </Card>\r\n <div className=\"text-center text-xs text-muted-foreground\">\r\n {t(\"web-ui:auth.forgotPassword.rememberPassword\")}{\" \"}\r\n <Link to=\"/login\" className=\"underline underline-offset-4 hover:text-primary\">\r\n {t(\"web-ui:auth.login.button\")}\r\n </Link>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"mappings":";;;;;;AAKA,SAAgB,qBAAqB;CACnC,MAAM,EAAE,MAAM,gBAAgB;AAC9B,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,qBAAC,MAAD,EAAA,UAAA,CACE,qBAAC,YAAD;GAAY,WAAU;aAAtB,CACE,oBAAC,MAAD;IAAI,WAAU;cAAyB,EAAE,kCAAkC;IAAM,CAAA,EACjF,oBAAC,KAAD;IAAG,WAAU;cAA4B,EAAE,wCAAwC;IAAK,CAAA,CAC7E;MACb,oBAAC,UAAD,EAAA,UACE,oBAAC,mBAAD,EAAqB,CAAA,EACZ,CAAA,CACN,EAAA,CAAA,EACP,qBAAC,OAAD;GAAK,WAAU;aAAf;IACG,EAAE,8CAA8C;IAAE;IACnD,oBAACA,QAAD;KAAM,IAAG;KAAS,WAAU;eACzB,EAAE,2BAA2B;KACzB,CAAA;IACH;KACF"}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/modules/auth/components/SignupFormRoute.d.ts
|
|
4
|
+
declare function SignupForm({
|
|
5
|
+
code,
|
|
6
|
+
email,
|
|
7
|
+
waitlist
|
|
8
|
+
}: {
|
|
9
|
+
code?: string | null;
|
|
10
|
+
email?: string | null;
|
|
11
|
+
waitlist?: boolean;
|
|
12
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { SignupForm };
|
|
15
|
+
//# sourceMappingURL=SignupFormRoute.d.ts.map
|
|
@@ -1,106 +1,149 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Alert, Button, Input } from "@heroui/react";
|
|
3
|
-
import { authClient } from "@m5kdev/frontend/modules/auth/auth.lib";
|
|
4
|
-
import { useSession } from "@m5kdev/frontend/modules/auth/hooks/useSession";
|
|
5
1
|
import { useState } from "react";
|
|
6
|
-
import {
|
|
2
|
+
import { Alert, Button, Input } from "@heroui/react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
4
|
import { useTranslation } from "react-i18next";
|
|
8
5
|
import { useNavigate } from "react-router";
|
|
9
6
|
import { toast } from "sonner";
|
|
7
|
+
import { useForm } from "react-hook-form";
|
|
8
|
+
import { authClient } from "@m5kdev/frontend/modules/auth/auth.lib";
|
|
9
|
+
import { useSession } from "@m5kdev/frontend/modules/auth/hooks/useSession";
|
|
10
|
+
//#region src/modules/auth/components/SignupFormRoute.tsx
|
|
10
11
|
function getEmailProviderUrl(email) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
};
|
|
38
|
-
return domainMap[domain] || null;
|
|
12
|
+
const domain = email.split("@")[1]?.toLowerCase();
|
|
13
|
+
if (!domain) return null;
|
|
14
|
+
const EMAIL_URLS = {
|
|
15
|
+
GMAIL: "https://mail.google.com/mail/u/0/#inbox",
|
|
16
|
+
OUTLOOK: "https://outlook.live.com/mail/0/inbox",
|
|
17
|
+
YAHOO: "https://mail.yahoo.com",
|
|
18
|
+
ICLOUD: "https://www.icloud.com/mail",
|
|
19
|
+
PROTON: "https://mail.proton.me"
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
"gmail.com": EMAIL_URLS.GMAIL,
|
|
23
|
+
"googlemail.com": EMAIL_URLS.GMAIL,
|
|
24
|
+
"outlook.com": EMAIL_URLS.OUTLOOK,
|
|
25
|
+
"hotmail.com": EMAIL_URLS.OUTLOOK,
|
|
26
|
+
"live.com": EMAIL_URLS.OUTLOOK,
|
|
27
|
+
"msn.com": EMAIL_URLS.OUTLOOK,
|
|
28
|
+
"yahoo.com": EMAIL_URLS.YAHOO,
|
|
29
|
+
"yahoo.co.uk": EMAIL_URLS.YAHOO,
|
|
30
|
+
"yahoo.fr": EMAIL_URLS.YAHOO,
|
|
31
|
+
"ymail.com": EMAIL_URLS.YAHOO,
|
|
32
|
+
"icloud.com": EMAIL_URLS.ICLOUD,
|
|
33
|
+
"me.com": EMAIL_URLS.ICLOUD,
|
|
34
|
+
"mac.com": EMAIL_URLS.ICLOUD,
|
|
35
|
+
"protonmail.com": EMAIL_URLS.PROTON,
|
|
36
|
+
"proton.me": EMAIL_URLS.PROTON
|
|
37
|
+
}[domain] || null;
|
|
39
38
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
39
|
+
function SignupForm({ code, email, waitlist }) {
|
|
40
|
+
const { t } = useTranslation();
|
|
41
|
+
const [status, setStatus] = useState("start");
|
|
42
|
+
const [userEmail, setUserEmail] = useState(email || "");
|
|
43
|
+
const { registerSession } = useSession();
|
|
44
|
+
const navigate = useNavigate();
|
|
45
|
+
const { register, handleSubmit, formState: { errors } } = useForm();
|
|
46
|
+
const onSubmit = (data) => {
|
|
47
|
+
console.log(data);
|
|
48
|
+
setStatus("busy");
|
|
49
|
+
setUserEmail(data.email);
|
|
50
|
+
authClient.signUp.email({
|
|
51
|
+
name: data.email,
|
|
52
|
+
email: data.email,
|
|
53
|
+
password: data.password
|
|
54
|
+
}, { headers: { "Waitlist-Invitation-Code": code || "" } }).then((result) => {
|
|
55
|
+
console.log(result);
|
|
56
|
+
if (result.error) {
|
|
57
|
+
toast.error(t("web-ui:auth.errors.invitationCodeInvalid"));
|
|
58
|
+
setStatus("start");
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (waitlist) authClient.signIn.email({
|
|
62
|
+
email: data.email,
|
|
63
|
+
password: data.password
|
|
64
|
+
}).then((res) => {
|
|
65
|
+
console.log(res);
|
|
66
|
+
if (res.data?.user) registerSession(() => {
|
|
67
|
+
navigate("/");
|
|
68
|
+
});
|
|
69
|
+
else if (res.error) toast.error(t("web-ui:auth.errors.authentication"), { description: res.error.message });
|
|
70
|
+
}).catch((error) => {
|
|
71
|
+
toast.error(t("web-ui:auth.errors.server"), { description: error.message });
|
|
72
|
+
});
|
|
73
|
+
else setStatus("done");
|
|
74
|
+
}).catch((error) => {
|
|
75
|
+
toast.error(error.message);
|
|
76
|
+
setStatus("start");
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
if (status === "done") {
|
|
80
|
+
const emailProviderUrl = userEmail ? getEmailProviderUrl(userEmail) : null;
|
|
81
|
+
return /* @__PURE__ */ jsx(Alert, {
|
|
82
|
+
color: "primary",
|
|
83
|
+
variant: "faded",
|
|
84
|
+
title: t("web-ui:auth.signup.verificationEmailSent.title"),
|
|
85
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
86
|
+
className: "mt-2",
|
|
87
|
+
children: [t("web-ui:auth.signup.verificationEmailSent.description"), emailProviderUrl && /* @__PURE__ */ jsx("div", {
|
|
88
|
+
className: "mt-3",
|
|
89
|
+
children: /* @__PURE__ */ jsx("a", {
|
|
90
|
+
href: emailProviderUrl,
|
|
91
|
+
target: "_blank",
|
|
92
|
+
rel: "noopener noreferrer",
|
|
93
|
+
className: "font-medium underline underline-offset-4 hover:opacity-80 transition-opacity",
|
|
94
|
+
children: t("web-ui:auth.signup.verificationEmailSent.openEmail")
|
|
95
|
+
})
|
|
96
|
+
})]
|
|
97
|
+
})
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return /* @__PURE__ */ jsxs("form", {
|
|
101
|
+
onSubmit: handleSubmit(onSubmit),
|
|
102
|
+
className: "grid gap-6",
|
|
103
|
+
children: [
|
|
104
|
+
/* @__PURE__ */ jsxs("div", {
|
|
105
|
+
className: "grid gap-2",
|
|
106
|
+
children: [/* @__PURE__ */ jsx(Input, {
|
|
107
|
+
labelPlacement: "outside",
|
|
108
|
+
label: t("web-ui:auth.login.email"),
|
|
109
|
+
type: "email",
|
|
110
|
+
placeholder: t("web-ui:auth.login.placeholder.email"),
|
|
111
|
+
variant: "bordered",
|
|
112
|
+
isRequired: true,
|
|
113
|
+
isDisabled: !!email,
|
|
114
|
+
defaultValue: email ?? "",
|
|
115
|
+
...register("email", { required: true })
|
|
116
|
+
}), errors.email && /* @__PURE__ */ jsx("span", {
|
|
117
|
+
className: "text-red-500 text-xs",
|
|
118
|
+
children: t("web-ui:auth.signup.emailRequired")
|
|
119
|
+
})]
|
|
120
|
+
}),
|
|
121
|
+
/* @__PURE__ */ jsxs("div", {
|
|
122
|
+
className: "grid gap-2",
|
|
123
|
+
children: [/* @__PURE__ */ jsx(Input, {
|
|
124
|
+
labelPlacement: "outside",
|
|
125
|
+
label: t("web-ui:auth.login.password"),
|
|
126
|
+
placeholder: t("web-ui:auth.login.password"),
|
|
127
|
+
type: "password",
|
|
128
|
+
variant: "bordered",
|
|
129
|
+
isRequired: true,
|
|
130
|
+
...register("password", { required: true })
|
|
131
|
+
}), errors.password && /* @__PURE__ */ jsx("span", {
|
|
132
|
+
className: "text-red-500 text-xs",
|
|
133
|
+
children: t("web-ui:auth.signup.passwordRequired")
|
|
134
|
+
})]
|
|
135
|
+
}),
|
|
136
|
+
/* @__PURE__ */ jsx(Button, {
|
|
137
|
+
type: "submit",
|
|
138
|
+
className: "w-full",
|
|
139
|
+
color: "primary",
|
|
140
|
+
isDisabled: status === "busy",
|
|
141
|
+
children: status === "busy" ? t("web-ui:auth.signup.signingUp") : t("web-ui:auth.signup.button")
|
|
142
|
+
})
|
|
143
|
+
]
|
|
144
|
+
});
|
|
106
145
|
}
|
|
146
|
+
//#endregion
|
|
147
|
+
export { SignupForm };
|
|
148
|
+
|
|
149
|
+
//# sourceMappingURL=SignupFormRoute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignupFormRoute.js","names":[],"sources":["../../../../../src/modules/auth/components/SignupFormRoute.tsx"],"sourcesContent":["import { Alert, Button, Input } from \"@heroui/react\";\r\nimport { authClient } from \"@m5kdev/frontend/modules/auth/auth.lib\";\r\nimport { useSession } from \"@m5kdev/frontend/modules/auth/hooks/useSession\";\r\nimport { useState } from \"react\";\r\nimport { type SubmitHandler, useForm } from \"react-hook-form\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { useNavigate } from \"react-router\";\r\nimport { toast } from \"sonner\";\r\n\r\ntype Inputs = {\r\n email: string;\r\n password: string;\r\n};\r\n\r\nfunction getEmailProviderUrl(email: string): string | null {\r\n const domain = email.split(\"@\")[1]?.toLowerCase();\r\n if (!domain) return null;\r\n\r\n const EMAIL_URLS = {\r\n GMAIL: \"https://mail.google.com/mail/u/0/#inbox\",\r\n OUTLOOK: \"https://outlook.live.com/mail/0/inbox\",\r\n YAHOO: \"https://mail.yahoo.com\",\r\n ICLOUD: \"https://www.icloud.com/mail\",\r\n PROTON: \"https://mail.proton.me\",\r\n } as const;\r\n\r\n const domainMap: Record<string, string> = {\r\n \"gmail.com\": EMAIL_URLS.GMAIL,\r\n \"googlemail.com\": EMAIL_URLS.GMAIL,\r\n \"outlook.com\": EMAIL_URLS.OUTLOOK,\r\n \"hotmail.com\": EMAIL_URLS.OUTLOOK,\r\n \"live.com\": EMAIL_URLS.OUTLOOK,\r\n \"msn.com\": EMAIL_URLS.OUTLOOK,\r\n \"yahoo.com\": EMAIL_URLS.YAHOO,\r\n \"yahoo.co.uk\": EMAIL_URLS.YAHOO,\r\n \"yahoo.fr\": EMAIL_URLS.YAHOO,\r\n \"ymail.com\": EMAIL_URLS.YAHOO,\r\n \"icloud.com\": EMAIL_URLS.ICLOUD,\r\n \"me.com\": EMAIL_URLS.ICLOUD,\r\n \"mac.com\": EMAIL_URLS.ICLOUD,\r\n \"protonmail.com\": EMAIL_URLS.PROTON,\r\n \"proton.me\": EMAIL_URLS.PROTON,\r\n };\r\n\r\n return domainMap[domain] || null;\r\n}\r\n\r\nexport function SignupForm({\r\n code,\r\n email,\r\n waitlist,\r\n}: {\r\n code?: string | null;\r\n email?: string | null;\r\n waitlist?: boolean;\r\n}) {\r\n const { t } = useTranslation();\r\n const [status, setStatus] = useState(\"start\");\r\n const [userEmail, setUserEmail] = useState<string>(email || \"\");\r\n const { registerSession } = useSession();\r\n const navigate = useNavigate();\r\n const {\r\n register,\r\n handleSubmit,\r\n formState: { errors },\r\n } = useForm<Inputs>();\r\n\r\n const onSubmit: SubmitHandler<Inputs> = (data) => {\r\n console.log(data);\r\n setStatus(\"busy\");\r\n setUserEmail(data.email);\r\n\r\n authClient.signUp\r\n .email(\r\n {\r\n name: data.email,\r\n email: data.email,\r\n password: data.password,\r\n },\r\n {\r\n headers: {\r\n \"Waitlist-Invitation-Code\": code || \"\",\r\n },\r\n }\r\n )\r\n .then((result) => {\r\n console.log(result);\r\n if (result.error) {\r\n toast.error(t(\"web-ui:auth.errors.invitationCodeInvalid\"));\r\n setStatus(\"start\");\r\n return;\r\n }\r\n if (waitlist) {\r\n authClient.signIn\r\n .email({\r\n email: data.email,\r\n password: data.password,\r\n })\r\n .then((res) => {\r\n console.log(res);\r\n if (res.data?.user) {\r\n registerSession(() => {\r\n navigate(\"/\");\r\n });\r\n } else if (res.error) {\r\n toast.error(t(\"web-ui:auth.errors.authentication\"), {\r\n description: res.error.message,\r\n });\r\n }\r\n })\r\n .catch((error) => {\r\n toast.error(t(\"web-ui:auth.errors.server\"), {\r\n description: error.message,\r\n });\r\n });\r\n } else setStatus(\"done\");\r\n })\r\n .catch((error) => {\r\n toast.error(error.message);\r\n setStatus(\"start\");\r\n });\r\n };\r\n\r\n if (status === \"done\") {\r\n const emailProviderUrl = userEmail ? getEmailProviderUrl(userEmail) : null;\r\n\r\n return (\r\n <Alert\r\n color=\"primary\"\r\n variant=\"faded\"\r\n title={t(\"web-ui:auth.signup.verificationEmailSent.title\")}\r\n >\r\n <div className=\"mt-2\">\r\n {t(\"web-ui:auth.signup.verificationEmailSent.description\")}\r\n {emailProviderUrl && (\r\n <div className=\"mt-3\">\r\n <a\r\n href={emailProviderUrl}\r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n className=\"font-medium underline underline-offset-4 hover:opacity-80 transition-opacity\"\r\n >\r\n {t(\"web-ui:auth.signup.verificationEmailSent.openEmail\")}\r\n </a>\r\n </div>\r\n )}\r\n </div>\r\n </Alert>\r\n );\r\n }\r\n\r\n return (\r\n <form onSubmit={handleSubmit(onSubmit)} className=\"grid gap-6\">\r\n <div className=\"grid gap-2\">\r\n <Input\r\n labelPlacement=\"outside\"\r\n label={t(\"web-ui:auth.login.email\")}\r\n type=\"email\"\r\n placeholder={t(\"web-ui:auth.login.placeholder.email\")}\r\n variant=\"bordered\"\r\n isRequired\r\n isDisabled={!!email}\r\n defaultValue={email ?? \"\"}\r\n {...register(\"email\", { required: true })}\r\n />\r\n {errors.email && (\r\n <span className=\"text-red-500 text-xs\">{t(\"web-ui:auth.signup.emailRequired\")}</span>\r\n )}\r\n </div>\r\n <div className=\"grid gap-2\">\r\n <Input\r\n labelPlacement=\"outside\"\r\n label={t(\"web-ui:auth.login.password\")}\r\n placeholder={t(\"web-ui:auth.login.password\")}\r\n type=\"password\"\r\n variant=\"bordered\"\r\n isRequired\r\n {...register(\"password\", { required: true })}\r\n />\r\n {errors.password && (\r\n <span className=\"text-red-500 text-xs\">{t(\"web-ui:auth.signup.passwordRequired\")}</span>\r\n )}\r\n </div>\r\n <Button type=\"submit\" className=\"w-full\" color=\"primary\" isDisabled={status === \"busy\"}>\r\n {status === \"busy\" ? t(\"web-ui:auth.signup.signingUp\") : t(\"web-ui:auth.signup.button\")}\r\n </Button>\r\n </form>\r\n );\r\n}\r\n"],"mappings":"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"}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { UseBackendTRPC } from "../../../types.js";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/modules/auth/components/SignupRoute.d.ts
|
|
2
5
|
interface SignupRouteProps {
|
|
3
|
-
|
|
4
|
-
|
|
6
|
+
providers?: string[];
|
|
7
|
+
useTRPC?: UseBackendTRPC;
|
|
5
8
|
}
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
declare function SignupRoute({
|
|
10
|
+
providers,
|
|
11
|
+
useTRPC
|
|
12
|
+
}: SignupRouteProps): _$react_jsx_runtime0.JSX.Element;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { SignupRoute };
|
|
15
|
+
//# sourceMappingURL=SignupRoute.d.ts.map
|
|
@@ -1,16 +1,62 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AuthProviders } from "./AuthProviders.js";
|
|
2
|
+
import { SignupForm } from "./SignupFormRoute.js";
|
|
3
|
+
import { WaitlistCard } from "./WaitlistCard.js";
|
|
4
|
+
import { WaitlistCodeValidation } from "./WaitlistCodeValidation.js";
|
|
2
5
|
import { Card, CardBody, CardHeader } from "@heroui/react";
|
|
3
|
-
import {
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
7
|
import { useTranslation } from "react-i18next";
|
|
5
|
-
import { Link } from "react-router";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
import { Link as Link$1 } from "react-router";
|
|
9
|
+
import { useQueryState } from "nuqs";
|
|
10
|
+
//#region src/modules/auth/components/SignupRoute.tsx
|
|
11
|
+
function SignupRoute({ providers, useTRPC }) {
|
|
12
|
+
const { t } = useTranslation();
|
|
13
|
+
const [code] = useQueryState("code");
|
|
14
|
+
const [email] = useQueryState("email");
|
|
15
|
+
const hasWaitlist = !!useTRPC;
|
|
16
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
17
|
+
className: "flex flex-col gap-6",
|
|
18
|
+
children: [hasWaitlist && !code ? /* @__PURE__ */ jsx(WaitlistCard, { useTRPC }) : /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsxs(CardHeader, {
|
|
19
|
+
className: "text-center flex flex-col gap-1",
|
|
20
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
21
|
+
className: "text-xl font-semibold",
|
|
22
|
+
children: t("web-ui:auth.signup.createAccount")
|
|
23
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
24
|
+
className: "text-sm text-default-600",
|
|
25
|
+
children: t("web-ui:auth.signup.description")
|
|
26
|
+
})]
|
|
27
|
+
}), /* @__PURE__ */ jsx(CardBody, { children: /* @__PURE__ */ jsxs("div", {
|
|
28
|
+
className: "grid gap-6",
|
|
29
|
+
children: [
|
|
30
|
+
hasWaitlist && code && useTRPC && /* @__PURE__ */ jsx(WaitlistCodeValidation, {
|
|
31
|
+
code,
|
|
32
|
+
useTRPC
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ jsx(AuthProviders, {
|
|
35
|
+
providers,
|
|
36
|
+
code,
|
|
37
|
+
requestSignUp: true
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ jsx(SignupForm, {
|
|
40
|
+
code,
|
|
41
|
+
email,
|
|
42
|
+
waitlist: hasWaitlist
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
}) })] }), /* @__PURE__ */ jsxs("div", {
|
|
46
|
+
className: "text-center text-xs text-muted-foreground",
|
|
47
|
+
children: [
|
|
48
|
+
t("web-ui:auth.signup.alreadyHaveAccount"),
|
|
49
|
+
" ",
|
|
50
|
+
/* @__PURE__ */ jsx(Link$1, {
|
|
51
|
+
to: "/login",
|
|
52
|
+
className: "underline underline-offset-4 hover:text-primary",
|
|
53
|
+
children: t("web-ui:auth.login.button")
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
})]
|
|
57
|
+
});
|
|
16
58
|
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { SignupRoute };
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=SignupRoute.js.map
|