@m5kdev/web-ui 0.1.3 → 0.1.5
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 +2 -0
- package/dist/src/animations/card.motion.js +7 -0
- package/dist/src/components/AvatarUpload.d.ts +7 -0
- package/dist/src/components/AvatarUpload.js +67 -0
- package/dist/src/components/Button.d.ts +5 -0
- package/dist/src/components/Button.js +5 -0
- package/dist/src/components/Calendar.d.ts +35 -0
- package/dist/src/components/Calendar.js +10 -0
- package/dist/src/components/CardsSelect.d.ts +23 -0
- package/dist/src/components/CardsSelect.js +46 -0
- package/dist/src/components/CollapsibleSidebarMenuItem.d.ts +9 -0
- package/dist/src/components/CollapsibleSidebarMenuItem.js +11 -0
- package/dist/src/components/ColorPicker.d.ts +4 -0
- package/dist/src/components/ColorPicker.js +21 -0
- package/dist/src/components/CopyButton.d.ts +6 -0
- package/dist/src/components/CopyButton.js +24 -0
- package/dist/src/components/CropDialog.d.ts +10 -0
- package/dist/src/components/CropDialog.js +67 -0
- package/dist/src/components/DialogProvider.d.ts +15 -0
- package/dist/src/components/DialogProvider.js +50 -0
- package/dist/src/components/ErrorFallback.d.ts +4 -0
- package/dist/src/components/ErrorFallback.js +5 -0
- package/dist/src/components/FileDropzone.d.ts +6 -0
- package/dist/src/components/FileDropzone.js +63 -0
- package/dist/src/components/MultiSelectDropdown.d.ts +26 -0
- package/dist/src/components/MultiSelectDropdown.js +53 -0
- package/dist/src/components/Orb.d.ts +6 -0
- package/{src/components/Orb.tsx → dist/src/components/Orb.js} +107 -136
- package/dist/src/components/PageAlert.d.ts +18 -0
- package/dist/src/components/PageAlert.js +48 -0
- package/dist/src/components/SelectChips.d.ts +10 -0
- package/dist/src/components/SelectChips.js +11 -0
- package/dist/src/components/SidebarItem.d.ts +7 -0
- package/dist/src/components/SidebarItem.js +6 -0
- package/dist/src/components/Steps.d.ts +19 -0
- package/dist/src/components/Steps.js +34 -0
- package/dist/src/components/TablerIconPicker.d.ts +2 -0
- package/dist/src/components/TablerIconPicker.js +4238 -0
- package/dist/src/components/app-header.d.ts +6 -0
- package/dist/src/components/app-header.js +8 -0
- package/dist/src/components/blur-card.d.ts +13 -0
- package/dist/src/components/blur-card.js +34 -0
- package/dist/src/components/features-section-demo-1.d.ts +6 -0
- package/dist/src/components/features-section-demo-1.js +53 -0
- package/dist/src/components/features-section-demo-2.d.ts +1 -0
- package/dist/src/components/features-section-demo-2.js +51 -0
- package/dist/src/components/features-section-demo-3.d.ts +8 -0
- package/dist/src/components/features-section-demo-3.js +116 -0
- package/dist/src/components/mode-toggle.d.ts +1 -0
- package/dist/src/components/mode-toggle.js +9 -0
- package/dist/src/components/nav-main.d.ts +13 -0
- package/dist/src/components/nav-main.js +9 -0
- package/dist/src/components/pricing-cards.d.ts +1 -0
- package/dist/src/components/pricing-cards.js +27 -0
- package/dist/src/components/shared/ButtonCopy.d.ts +6 -0
- package/dist/src/components/shared/ButtonCopy.js +24 -0
- package/dist/src/components/team-switcher.d.ts +8 -0
- package/dist/src/components/team-switcher.js +10 -0
- package/dist/src/components/theme-provider.d.ts +13 -0
- package/dist/src/components/theme-provider.js +41 -0
- package/dist/src/components/typewriter.d.ts +18 -0
- package/dist/src/components/typewriter.js +38 -0
- package/dist/src/components/ui/alert-dialog.d.ts +14 -0
- package/dist/src/components/ui/alert-dialog.js +38 -0
- package/dist/src/components/ui/alert.d.ts +9 -0
- package/dist/src/components/ui/alert.js +24 -0
- package/dist/src/components/ui/avatar.d.ts +6 -0
- package/dist/src/components/ui/avatar.js +12 -0
- package/dist/src/components/ui/badge.d.ts +9 -0
- package/dist/src/components/ui/badge.js +20 -0
- package/dist/src/components/ui/bento-grid.d.ts +11 -0
- package/dist/src/components/ui/bento-grid.js +8 -0
- package/dist/src/components/ui/bento-grid2.d.ts +15 -0
- package/dist/src/components/ui/bento-grid2.js +13 -0
- package/dist/src/components/ui/breadcrumb.d.ts +19 -0
- package/dist/src/components/ui/breadcrumb.js +23 -0
- package/dist/src/components/ui/button.d.ts +11 -0
- package/dist/src/components/ui/button.js +33 -0
- package/dist/src/components/ui/card.d.ts +8 -0
- package/dist/src/components/ui/card.js +16 -0
- package/dist/src/components/ui/checkbox.d.ts +4 -0
- package/dist/src/components/ui/checkbox.js +8 -0
- package/dist/src/components/ui/collapsible.d.ts +5 -0
- package/{src/components/ui/collapsible.tsx → dist/src/components/ui/collapsible.js} +5 -9
- package/dist/src/components/ui/dialog.d.ts +13 -0
- package/dist/src/components/ui/dialog.js +35 -0
- package/dist/src/components/ui/dropdown-menu.d.ts +27 -0
- package/dist/src/components/ui/dropdown-menu.js +32 -0
- package/dist/src/components/ui/floating-navbar.d.ts +9 -0
- package/dist/src/components/ui/floating-navbar.js +38 -0
- package/dist/src/components/ui/form.d.ts +23 -0
- package/dist/src/components/ui/form.js +60 -0
- package/dist/src/components/ui/image.d.ts +6 -0
- package/dist/src/components/ui/image.js +15 -0
- package/dist/src/components/ui/input.d.ts +3 -0
- package/dist/src/components/ui/input.js +8 -0
- package/dist/src/components/ui/label.d.ts +5 -0
- package/dist/src/components/ui/label.js +9 -0
- package/dist/src/components/ui/pagination.d.ts +13 -0
- package/dist/src/components/ui/pagination.js +29 -0
- package/dist/src/components/ui/progress.d.ts +4 -0
- package/dist/src/components/ui/progress.js +7 -0
- package/dist/src/components/ui/resizable-navbar.d.ts +56 -0
- package/dist/src/components/ui/resizable-navbar.js +86 -0
- package/dist/src/components/ui/segment-control.d.ts +9 -0
- package/dist/src/components/ui/segment-control.js +42 -0
- package/dist/src/components/ui/select.d.ts +13 -0
- package/dist/src/components/ui/select.js +26 -0
- package/dist/src/components/ui/separator.d.ts +4 -0
- package/dist/src/components/ui/separator.js +7 -0
- package/dist/src/components/ui/sheet.d.ts +25 -0
- package/dist/src/components/ui/sheet.js +37 -0
- package/dist/src/components/ui/sidebar.d.ts +66 -0
- package/dist/src/components/ui/sidebar.js +222 -0
- package/dist/src/components/ui/skeleton.d.ts +2 -0
- package/dist/src/components/ui/skeleton.js +6 -0
- package/dist/src/components/ui/slider.d.ts +4 -0
- package/dist/src/components/ui/slider.js +7 -0
- package/dist/src/components/ui/sonner.d.ts +4 -0
- package/dist/src/components/ui/sonner.js +15 -0
- package/dist/src/components/ui/spinner.d.ts +14 -0
- package/dist/src/components/ui/spinner.js +30 -0
- package/dist/src/components/ui/switch.d.ts +4 -0
- package/dist/src/components/ui/switch.js +7 -0
- package/dist/src/components/ui/table.d.ts +10 -0
- package/dist/src/components/ui/table.js +27 -0
- package/dist/src/components/ui/tabs.d.ts +7 -0
- package/dist/src/components/ui/tabs.js +16 -0
- package/dist/src/components/ui/textarea.d.ts +3 -0
- package/dist/src/components/ui/textarea.js +6 -0
- package/dist/src/components/ui/timeline.d.ts +11 -0
- package/dist/src/components/ui/timeline.js +27 -0
- package/dist/src/components/ui/toast.d.ts +15 -0
- package/dist/src/components/ui/toast.js +33 -0
- package/dist/src/components/ui/tooltip.d.ts +7 -0
- package/dist/src/components/ui/tooltip.js +16 -0
- package/dist/src/components/ui/typewriter-effect.d.ts +16 -0
- package/dist/src/components/ui/typewriter-effect.js +76 -0
- package/dist/src/hooks/use-mobile.d.ts +1 -0
- package/dist/src/hooks/use-mobile.js +15 -0
- package/dist/src/hooks/useDialog.d.ts +4 -0
- package/dist/src/hooks/useDialog.js +22 -0
- package/dist/src/icons/GoogleIcon.d.ts +5 -0
- package/dist/src/icons/GoogleIcon.js +4 -0
- package/dist/src/icons/LinkedInIcon.d.ts +5 -0
- package/dist/src/icons/LinkedInIcon.js +4 -0
- package/dist/src/icons/MicrosoftIcon.d.ts +5 -0
- package/dist/src/icons/MicrosoftIcon.js +4 -0
- package/dist/src/lib/chatwoot.d.ts +11 -0
- package/dist/src/lib/chatwoot.js +28 -0
- package/dist/src/lib/utils.d.ts +2 -0
- package/dist/src/lib/utils.js +5 -0
- package/dist/src/modules/app/components/AppLoader.d.ts +2 -0
- package/dist/src/modules/app/components/AppLoader.js +5 -0
- package/dist/src/modules/app/components/AppShell.d.ts +7 -0
- package/dist/src/modules/app/components/AppShell.js +7 -0
- package/dist/src/modules/app/components/AppSidebar.d.ts +7 -0
- package/dist/src/modules/app/components/AppSidebar.js +5 -0
- package/dist/src/modules/app/components/AppSidebarContent.d.ts +16 -0
- package/dist/src/modules/app/components/AppSidebarContent.js +7 -0
- package/dist/src/modules/app/components/AppSidebarHeader.d.ts +8 -0
- package/dist/src/modules/app/components/AppSidebarHeader.js +10 -0
- package/dist/src/modules/app/components/AppSidebarInvites.d.ts +3 -0
- package/dist/src/modules/app/components/AppSidebarInvites.js +12 -0
- package/dist/src/modules/app/components/AppSidebarUser.d.ts +11 -0
- package/dist/src/modules/app/components/AppSidebarUser.js +16 -0
- package/dist/src/modules/auth/components/AdminUserManagement.d.ts +6 -0
- package/dist/src/modules/auth/components/AdminUserManagement.js +422 -0
- package/dist/src/modules/auth/components/AdminWaitlist.d.ts +6 -0
- package/dist/src/modules/auth/components/AdminWaitlist.js +118 -0
- package/dist/src/modules/auth/components/AuthLayout.d.ts +4 -0
- package/dist/src/modules/auth/components/AuthLayout.js +5 -0
- package/dist/src/modules/auth/components/AuthProviders.d.ts +6 -0
- package/dist/src/modules/auth/components/AuthProviders.js +45 -0
- package/dist/src/modules/auth/components/AuthRouter.d.ts +9 -0
- package/dist/src/modules/auth/components/AuthRouter.js +12 -0
- package/dist/src/modules/auth/components/ClaimAccountRoute.d.ts +4 -0
- package/dist/src/modules/auth/components/ClaimAccountRoute.js +143 -0
- package/dist/src/modules/auth/components/ErrorAuthRoute.d.ts +1 -0
- package/dist/src/modules/auth/components/ErrorAuthRoute.js +93 -0
- package/dist/src/modules/auth/components/ForgotPasswordForm.d.ts +1 -0
- package/dist/src/modules/auth/components/ForgotPasswordForm.js +27 -0
- package/dist/src/modules/auth/components/ForgotPasswordRoute.d.ts +1 -0
- package/dist/src/modules/auth/components/ForgotPasswordRoute.js +9 -0
- package/dist/src/modules/auth/components/InviteFriends.d.ts +5 -0
- package/dist/src/modules/auth/components/InviteFriends.js +74 -0
- package/dist/src/modules/auth/components/LastUsedBadge.d.ts +5 -0
- package/dist/src/modules/auth/components/LastUsedBadge.js +9 -0
- package/dist/src/modules/auth/components/LoginForm.d.ts +3 -0
- package/dist/src/modules/auth/components/LoginForm.js +44 -0
- package/dist/src/modules/auth/components/LoginRoute.d.ts +3 -0
- package/dist/src/modules/auth/components/LoginRoute.js +11 -0
- package/dist/src/modules/auth/components/LogoutRoute.d.ts +1 -0
- package/dist/src/modules/auth/components/LogoutRoute.js +15 -0
- package/dist/src/modules/auth/components/OrganizationAcceptInvitationRoute.d.ts +9 -0
- package/dist/src/modules/auth/components/OrganizationAcceptInvitationRoute.js +102 -0
- package/dist/src/modules/auth/components/OrganizationMembersRoute.d.ts +51 -0
- package/dist/src/modules/auth/components/OrganizationMembersRoute.js +359 -0
- package/dist/src/modules/auth/components/OrganizationSettingsRoute.d.ts +20 -0
- package/dist/src/modules/auth/components/OrganizationSettingsRoute.js +153 -0
- package/dist/src/modules/auth/components/OrganizationSwitcher.d.ts +7 -0
- package/dist/src/modules/auth/components/OrganizationSwitcher.js +74 -0
- package/dist/src/modules/auth/components/ProfileRoute.d.ts +1 -0
- package/dist/src/modules/auth/components/ProfileRoute.js +42 -0
- package/dist/src/modules/auth/components/RangeNuqsDatePicker.d.ts +31 -0
- package/dist/src/modules/auth/components/RangeNuqsDatePicker.js +236 -0
- package/dist/src/modules/auth/components/ResetPasswordForm.d.ts +1 -0
- package/dist/src/modules/auth/components/ResetPasswordForm.js +39 -0
- package/dist/src/modules/auth/components/ResetPasswordRoute.d.ts +1 -0
- package/dist/src/modules/auth/components/ResetPasswordRoute.js +9 -0
- package/dist/src/modules/auth/components/SignupFormRoute.d.ts +5 -0
- package/dist/src/modules/auth/components/SignupFormRoute.js +106 -0
- package/dist/src/modules/auth/components/SignupRoute.d.ts +7 -0
- package/dist/src/modules/auth/components/SignupRoute.js +16 -0
- package/dist/src/modules/auth/components/UserPreferences.d.ts +30 -0
- package/dist/src/modules/auth/components/UserPreferences.js +60 -0
- package/dist/src/modules/auth/components/WaitlistCard.d.ts +6 -0
- package/dist/src/modules/auth/components/WaitlistCard.js +32 -0
- package/dist/src/modules/auth/components/WaitlistCodeValidation.d.ts +7 -0
- package/dist/src/modules/auth/components/WaitlistCodeValidation.js +43 -0
- package/dist/src/modules/billing/components/BillingBetaPage.d.ts +8 -0
- package/dist/src/modules/billing/components/BillingBetaPage.js +11 -0
- package/dist/src/modules/billing/components/BillingInvoicePage.d.ts +7 -0
- package/dist/src/modules/billing/components/BillingInvoicePage.js +32 -0
- package/dist/src/modules/billing/components/BillingPlanSelect.d.ts +6 -0
- package/dist/src/modules/billing/components/BillingPlanSelect.js +8 -0
- package/dist/src/modules/billing/components/BillingRouter.d.ts +9 -0
- package/dist/src/modules/billing/components/BillingRouter.js +8 -0
- package/dist/src/modules/billing/components/BillingSinglePlanSelect.d.ts +8 -0
- package/dist/src/modules/billing/components/BillingSinglePlanSelect.js +46 -0
- package/dist/src/modules/table/components/ColumnOrderAndVisibility.d.ts +10 -0
- package/dist/src/modules/table/components/ColumnOrderAndVisibility.js +42 -0
- package/dist/src/modules/table/components/NuqsTable.d.ts +23 -0
- package/dist/src/modules/table/components/NuqsTable.js +198 -0
- package/dist/src/modules/table/components/TableFiltering.d.ts +23 -0
- package/dist/src/modules/table/components/TableFiltering.js +236 -0
- package/dist/src/modules/table/components/TablePagination.d.ts +9 -0
- package/dist/src/modules/table/components/TablePagination.js +21 -0
- package/{src/modules/table/components/table.types.ts → dist/src/modules/table/components/table.types.d.ts} +12 -11
- package/dist/src/modules/table/components/table.types.js +1 -0
- package/dist/src/modules/table/filterTransformers.d.ts +53 -0
- package/dist/src/modules/table/filterTransformers.js +276 -0
- package/{src/types.ts → dist/src/types.d.ts} +3 -4
- package/dist/src/types.js +1 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +8 -5
- package/.cursor/rules/web-ui.mdc +0 -126
- package/.turbo/turbo-build.log +0 -5
- package/.turbo/turbo-check-types.log +0 -5
- package/.turbo/turbo-lint$colon$fix.log +0 -381
- package/.turbo/turbo-lint.log +0 -361
- package/CHANGELOG.md +0 -19
- package/components.json +0 -21
- package/src/animations/card.motion.ts +0 -9
- package/src/components/AvatarUpload.tsx +0 -133
- package/src/components/Button.tsx +0 -14
- package/src/components/Calendar.css +0 -684
- package/src/components/Calendar.tsx +0 -32
- package/src/components/CardsSelect.tsx +0 -155
- package/src/components/CollapsibleSidebarMenuItem.tsx +0 -57
- package/src/components/ColorPicker.tsx +0 -56
- package/src/components/CopyButton.tsx +0 -45
- package/src/components/CropDialog.tsx +0 -154
- package/src/components/DialogProvider.tsx +0 -105
- package/src/components/ErrorFallback.tsx +0 -17
- package/src/components/FileDropzone.tsx +0 -120
- package/src/components/MultiSelectDropdown.tsx +0 -233
- package/src/components/PageAlert.tsx +0 -121
- package/src/components/SelectChips.tsx +0 -40
- package/src/components/SidebarItem.tsx +0 -26
- package/src/components/Steps.tsx +0 -340
- package/src/components/TablerIconPicker.tsx +0 -4260
- package/src/components/app-header.tsx +0 -40
- package/src/components/blur-card.tsx +0 -132
- package/src/components/features-section-demo-1.tsx +0 -127
- package/src/components/features-section-demo-2.tsx +0 -102
- package/src/components/features-section-demo-3.tsx +0 -272
- package/src/components/mode-toggle.tsx +0 -31
- package/src/components/nav-main.tsx +0 -69
- package/src/components/pricing-cards.tsx +0 -133
- package/src/components/shared/ButtonCopy.tsx +0 -50
- package/src/components/team-switcher.tsx +0 -83
- package/src/components/theme-provider.tsx +0 -74
- package/src/components/typewriter.tsx +0 -90
- package/src/components/ui/alert-dialog.tsx +0 -133
- package/src/components/ui/alert.tsx +0 -60
- package/src/components/ui/avatar.tsx +0 -47
- package/src/components/ui/badge.tsx +0 -33
- package/src/components/ui/bento-grid.tsx +0 -54
- package/src/components/ui/bento-grid2.tsx +0 -66
- package/src/components/ui/breadcrumb.tsx +0 -101
- package/src/components/ui/button.tsx +0 -50
- package/src/components/ui/card.tsx +0 -55
- package/src/components/ui/checkbox.tsx +0 -26
- package/src/components/ui/dialog.tsx +0 -119
- package/src/components/ui/dropdown-menu.tsx +0 -186
- package/src/components/ui/floating-navbar.tsx +0 -78
- package/src/components/ui/form.tsx +0 -167
- package/src/components/ui/image.tsx +0 -55
- package/src/components/ui/input.tsx +0 -22
- package/src/components/ui/label.tsx +0 -19
- package/src/components/ui/pagination.tsx +0 -105
- package/src/components/ui/progress.tsx +0 -23
- package/src/components/ui/resizable-navbar.tsx +0 -260
- package/src/components/ui/segment-control.tsx +0 -143
- package/src/components/ui/select.tsx +0 -153
- package/src/components/ui/separator.tsx +0 -24
- package/src/components/ui/sheet.tsx +0 -121
- package/src/components/ui/sidebar.tsx +0 -736
- package/src/components/ui/skeleton.tsx +0 -7
- package/src/components/ui/slider.tsx +0 -23
- package/src/components/ui/sonner.tsx +0 -27
- package/src/components/ui/spinner.tsx +0 -45
- package/src/components/ui/switch.tsx +0 -27
- package/src/components/ui/table.tsx +0 -90
- package/src/components/ui/tabs.tsx +0 -52
- package/src/components/ui/textarea.tsx +0 -18
- package/src/components/ui/timeline.tsx +0 -95
- package/src/components/ui/toast.tsx +0 -126
- package/src/components/ui/tooltip.tsx +0 -55
- package/src/components/ui/typewriter-effect.tsx +0 -181
- package/src/hooks/use-mobile.ts +0 -19
- package/src/hooks/useDialog.ts +0 -25
- package/src/icons/GoogleIcon.tsx +0 -32
- package/src/icons/LinkedInIcon.tsx +0 -30
- package/src/icons/MicrosoftIcon.tsx +0 -21
- package/src/lib/chatwoot.ts +0 -51
- package/src/lib/utils.ts +0 -6
- package/src/modules/app/components/AppLoader.tsx +0 -9
- package/src/modules/app/components/AppShell.tsx +0 -21
- package/src/modules/app/components/AppSidebar.tsx +0 -26
- package/src/modules/app/components/AppSidebarContent.tsx +0 -73
- package/src/modules/app/components/AppSidebarHeader.tsx +0 -57
- package/src/modules/app/components/AppSidebarInvites.tsx +0 -32
- package/src/modules/app/components/AppSidebarUser.tsx +0 -128
- package/src/modules/auth/components/AdminUserManagement.tsx +0 -1136
- package/src/modules/auth/components/AdminWaitlist.tsx +0 -358
- package/src/modules/auth/components/AuthLayout.tsx +0 -13
- package/src/modules/auth/components/AuthProviders.tsx +0 -105
- package/src/modules/auth/components/AuthRouter.tsx +0 -29
- package/src/modules/auth/components/ClaimAccountRoute.tsx +0 -242
- package/src/modules/auth/components/ErrorAuthRoute.tsx +0 -121
- package/src/modules/auth/components/ForgotPasswordForm.tsx +0 -58
- package/src/modules/auth/components/ForgotPasswordRoute.tsx +0 -27
- package/src/modules/auth/components/InviteFriends.tsx +0 -273
- package/src/modules/auth/components/LastUsedBadge.tsx +0 -22
- package/src/modules/auth/components/LoginForm.tsx +0 -104
- package/src/modules/auth/components/LoginRoute.tsx +0 -31
- package/src/modules/auth/components/LogoutRoute.tsx +0 -21
- package/src/modules/auth/components/OrganizationAcceptInvitationRoute.tsx +0 -161
- package/src/modules/auth/components/OrganizationMembersRoute.tsx +0 -730
- package/src/modules/auth/components/OrganizationSettingsRoute.tsx +0 -280
- package/src/modules/auth/components/OrganizationSwitcher.tsx +0 -148
- package/src/modules/auth/components/ProfileRoute.tsx +0 -104
- package/src/modules/auth/components/RangeNuqsDatePicker.tsx +0 -365
- package/src/modules/auth/components/ResetPasswordForm.tsx +0 -103
- package/src/modules/auth/components/ResetPasswordRoute.tsx +0 -27
- package/src/modules/auth/components/SignupFormRoute.tsx +0 -189
- package/src/modules/auth/components/SignupRoute.tsx +0 -53
- package/src/modules/auth/components/UserPreferences.tsx +0 -144
- package/src/modules/auth/components/WaitlistCard.tsx +0 -78
- package/src/modules/auth/components/WaitlistCodeValidation.tsx +0 -79
- package/src/modules/billing/components/BillingBetaPage.tsx +0 -124
- package/src/modules/billing/components/BillingInvoicePage.tsx +0 -180
- package/src/modules/billing/components/BillingPlanSelect.tsx +0 -14
- package/src/modules/billing/components/BillingRouter.tsx +0 -20
- package/src/modules/billing/components/BillingSinglePlanSelect.tsx +0 -172
- package/src/modules/table/components/ColumnOrderAndVisibility.tsx +0 -127
- package/src/modules/table/components/NuqsTable.tsx +0 -396
- package/src/modules/table/components/TableFiltering.tsx +0 -520
- package/src/modules/table/components/TablePagination.tsx +0 -59
- package/src/modules/table/filterTransformers.ts +0 -323
- package/src/vite-env.d.ts +0 -1
- package/translations/en/web-ui.json +0 -192
- package/tsconfig.json +0 -30
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface AvatarUploadProps {
|
|
2
|
+
currentAvatarUrl?: string | null;
|
|
3
|
+
onUploadComplete?: (avatarUrl: string) => void;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function AvatarUpload({ currentAvatarUrl, onUploadComplete, className }: AvatarUploadProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useFileUpload } from "@m5kdev/frontend/modules/file/hooks/useUpload";
|
|
3
|
+
import { Edit2, User } from "lucide-react";
|
|
4
|
+
import { useRef, useState } from "react";
|
|
5
|
+
import { useTranslation } from "react-i18next";
|
|
6
|
+
import { CropDialog } from "#components/CropDialog";
|
|
7
|
+
import { Avatar, AvatarFallback, AvatarImage } from "#components/ui/avatar";
|
|
8
|
+
import { Progress } from "#components/ui/progress";
|
|
9
|
+
import { cn } from "#utils";
|
|
10
|
+
export function AvatarUpload({ currentAvatarUrl, onUploadComplete, className }) {
|
|
11
|
+
const { t } = useTranslation();
|
|
12
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
13
|
+
const [selectedFile, setSelectedFile] = useState(null);
|
|
14
|
+
const [previewUrl, setPreviewUrl] = useState(currentAvatarUrl || null);
|
|
15
|
+
const [showCropDialog, setShowCropDialog] = useState(false);
|
|
16
|
+
const fileInputRef = useRef(null);
|
|
17
|
+
const { upload, status, progress, errorMessage, reset } = useFileUpload();
|
|
18
|
+
const handleFileSelect = (event) => {
|
|
19
|
+
const file = event.target.files?.[0];
|
|
20
|
+
if (file) {
|
|
21
|
+
// Validate file type
|
|
22
|
+
if (!["image/jpeg", "image/png", "image/webp", "image/jpg"].includes(file.type)) {
|
|
23
|
+
alert(t("web-ui:upload.errors.invalidType"));
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
// Validate file size (5MB)
|
|
27
|
+
if (file.size > 5 * 1024 * 1024) {
|
|
28
|
+
alert(t("web-ui:upload.errors.tooLarge"));
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
setSelectedFile(file);
|
|
32
|
+
const objectUrl = URL.createObjectURL(file);
|
|
33
|
+
setPreviewUrl(objectUrl);
|
|
34
|
+
setShowCropDialog(true);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const handleCropComplete = async (croppedBlob) => {
|
|
38
|
+
const croppedFile = new File([croppedBlob], selectedFile?.name || "cropped-image.jpg", {
|
|
39
|
+
type: "image/jpeg",
|
|
40
|
+
});
|
|
41
|
+
setSelectedFile(croppedFile);
|
|
42
|
+
const croppedObjectUrl = URL.createObjectURL(croppedFile);
|
|
43
|
+
setPreviewUrl(croppedObjectUrl);
|
|
44
|
+
setShowCropDialog(false);
|
|
45
|
+
try {
|
|
46
|
+
const res = await upload("image", croppedFile);
|
|
47
|
+
console.log({ res });
|
|
48
|
+
onUploadComplete?.(res.url);
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
console.error("Error uploading image:", error);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const removeFile = () => {
|
|
55
|
+
if (previewUrl && previewUrl !== currentAvatarUrl) {
|
|
56
|
+
URL.revokeObjectURL(previewUrl);
|
|
57
|
+
}
|
|
58
|
+
setSelectedFile(null);
|
|
59
|
+
setPreviewUrl(currentAvatarUrl || null);
|
|
60
|
+
setShowCropDialog(false);
|
|
61
|
+
reset();
|
|
62
|
+
if (fileInputRef.current) {
|
|
63
|
+
fileInputRef.current.value = "";
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { role: "dialog", className: cn("relative inline-block", className), onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: [_jsxs(Avatar, { className: "h-24 w-24 cursor-pointer", onClick: () => fileInputRef.current?.click(), children: [previewUrl ? (_jsx(AvatarImage, { src: previewUrl, alt: t("web-ui:avatar.preview.alt") })) : (_jsx(AvatarFallback, { children: _jsx(User, { className: "h-12 w-12" }) })), isHovered && (_jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black/50 rounded-full", children: _jsx(Edit2, { className: "h-6 w-6 text-white" }) }))] }), _jsx("input", { ref: fileInputRef, type: "file", className: "hidden", accept: "image/jpeg,image/png,image/webp", onChange: handleFileSelect }), status === "uploading" && (_jsx("div", { className: "mt-2 w-full", children: _jsx(Progress, { value: progress, className: "h-2" }) })), status === "error" && _jsx("p", { className: "mt-2 text-sm text-red-500", children: errorMessage })] }), previewUrl && (_jsx(CropDialog, { open: showCropDialog, onOpenChange: setShowCropDialog, imageUrl: previewUrl, onCropComplete: handleCropComplete, onCancel: removeFile, isLoading: status === "uploading" }))] }));
|
|
67
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ButtonProps as ButtonPrimitiveProps } from "./ui/button";
|
|
2
|
+
export interface ButtonProps extends ButtonPrimitiveProps {
|
|
3
|
+
loading?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function Button({ loading, children, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button as ButtonPrimitive } from "./ui/button";
|
|
3
|
+
export function Button({ loading, children, ...props }) {
|
|
4
|
+
return (_jsxs(ButtonPrimitive, { ...props, disabled: loading || props.disabled, children: [loading && _jsx("i", { className: "ti ti-refresh animate-spin" }), children] }));
|
|
5
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import { type CalendarProps } from "react-big-calendar";
|
|
3
|
+
import "react-big-calendar/lib/addons/dragAndDrop/styles.css";
|
|
4
|
+
import "./Calendar.css";
|
|
5
|
+
type CalendarComponents = NonNullable<CalendarProps["components"]>;
|
|
6
|
+
export type CalendarEventRenderer = CalendarComponents extends {
|
|
7
|
+
event?: infer T;
|
|
8
|
+
} ? Exclude<T, undefined> : never;
|
|
9
|
+
interface DragAndDropCalendarProps extends Omit<CalendarProps, "localizer"> {
|
|
10
|
+
onEventDrop?: (args: {
|
|
11
|
+
event: unknown;
|
|
12
|
+
start: Date;
|
|
13
|
+
end: Date;
|
|
14
|
+
}) => void;
|
|
15
|
+
onEventResize?: (args: {
|
|
16
|
+
event: unknown;
|
|
17
|
+
start: Date;
|
|
18
|
+
end: Date;
|
|
19
|
+
}) => void;
|
|
20
|
+
onDragStart?: (args: {
|
|
21
|
+
event: unknown;
|
|
22
|
+
action: "move" | "resize";
|
|
23
|
+
direction?: unknown;
|
|
24
|
+
}) => void;
|
|
25
|
+
dragFromOutsideItem?: () => unknown;
|
|
26
|
+
onDropFromOutside?: (args: {
|
|
27
|
+
start: Date;
|
|
28
|
+
end: Date;
|
|
29
|
+
allDay?: boolean;
|
|
30
|
+
}) => void;
|
|
31
|
+
onDragOverFromOutside?: (event: React.DragEvent) => void;
|
|
32
|
+
resizable?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare const Calendar: (props: DragAndDropCalendarProps) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import dayjs from "dayjs";
|
|
3
|
+
import { Calendar as BigCalendar, dayjsLocalizer } from "react-big-calendar";
|
|
4
|
+
import withDragAndDrop from "react-big-calendar/lib/addons/dragAndDrop";
|
|
5
|
+
import "react-big-calendar/lib/addons/dragAndDrop/styles.css";
|
|
6
|
+
import "./Calendar.css";
|
|
7
|
+
const DnDCalendar = withDragAndDrop(BigCalendar);
|
|
8
|
+
const localizer = dayjsLocalizer(dayjs);
|
|
9
|
+
const TypedDnDCalendar = DnDCalendar;
|
|
10
|
+
export const Calendar = (props) => (_jsx(TypedDnDCalendar, { ...props, localizer: localizer }));
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface CardSelectItem {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
content?: React.ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
onEdit?: (id: string) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface CardsSelectProps {
|
|
12
|
+
items: CardSelectItem[];
|
|
13
|
+
selectedIds: string[];
|
|
14
|
+
onSelectionChange: (selectedIds: string[]) => void;
|
|
15
|
+
maxSelections?: number;
|
|
16
|
+
className?: string;
|
|
17
|
+
cardClassName?: string;
|
|
18
|
+
showCheckbox?: boolean;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
reversed?: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare const CardsSelect: React.ForwardRefExoticComponent<CardsSelectProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
export { CardsSelect };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Check, Edit } from "lucide-react";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "#components/ui/card";
|
|
5
|
+
import { cn } from "#utils";
|
|
6
|
+
const CardsSelect = React.forwardRef(({ items, selectedIds, onSelectionChange, maxSelections, className, cardClassName, showCheckbox = true, disabled = false, reversed = false, ...props }, ref) => {
|
|
7
|
+
const handleCardClick = (itemId) => {
|
|
8
|
+
if (disabled)
|
|
9
|
+
return;
|
|
10
|
+
const item = items.find((item) => item.id === itemId);
|
|
11
|
+
if (item?.disabled)
|
|
12
|
+
return;
|
|
13
|
+
const isSelected = selectedIds.includes(itemId);
|
|
14
|
+
if (isSelected) {
|
|
15
|
+
// Remove from selection
|
|
16
|
+
onSelectionChange(selectedIds.filter((id) => id !== itemId));
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
// Add to selection
|
|
20
|
+
if (maxSelections && selectedIds.length >= maxSelections) {
|
|
21
|
+
// If max selections reached, replace the first selection
|
|
22
|
+
onSelectionChange([...selectedIds.slice(1), itemId]);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
onSelectionChange([...selectedIds, itemId]);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const getGridClasses = () => {
|
|
30
|
+
return "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 gap-4 justify-items-center";
|
|
31
|
+
};
|
|
32
|
+
return (_jsx("div", { ref: ref, className: cn(getGridClasses(), className), ...props, children: items.map((item) => {
|
|
33
|
+
const isSelected = reversed
|
|
34
|
+
? !selectedIds.includes(item.id)
|
|
35
|
+
: selectedIds.includes(item.id);
|
|
36
|
+
const isDisabled = disabled || item.disabled;
|
|
37
|
+
return (_jsxs(Card, { className: cn("relative cursor-pointer transition-all duration-200 hover:shadow-md w-full", isSelected && "ring-2 ring-primary bg-primary/5 border-primary", isDisabled && "opacity-50 cursor-not-allowed", !isDisabled && "hover:bg-accent/50", cardClassName), onClick: () => handleCardClick(item.id), children: [item.onEdit && (_jsx("div", { className: "absolute top-3 left-3 z-10", children: _jsx("button", { type: "button", className: cn("flex h-6 w-6 items-center justify-center rounded-md transition-colors hover:bg-accent", "text-muted-foreground hover:text-foreground"), onClick: (e) => {
|
|
38
|
+
e.stopPropagation();
|
|
39
|
+
item.onEdit?.(item.id);
|
|
40
|
+
}, "aria-label": "Edit", children: _jsx(Edit, { className: "h-3.5 w-3.5" }) }) })), showCheckbox && (_jsx("div", { className: "absolute top-3 right-3 z-10", children: _jsx("div", { className: cn("flex h-5 w-5 items-center justify-center rounded-full border-2 transition-colors", isSelected
|
|
41
|
+
? "bg-primary border-primary text-primary-foreground"
|
|
42
|
+
: "border-muted-foreground/30 bg-background"), children: isSelected && _jsx(Check, { className: "h-3 w-3" }) }) })), item.icon && (_jsx("div", { className: "flex items-center justify-center pt-6 pb-4", children: _jsx("div", { className: "text-5xl text-primary", children: _jsx("i", { className: `ti ${item.icon}` }) }) })), _jsxs(CardHeader, { className: cn("pb-3 text-center", item.icon && "pt-2"), children: [_jsx(CardTitle, { className: "text-lg leading-tight", children: item.title }), item.description && (_jsx(CardDescription, { className: "text-sm", children: item.description }))] }), item.content && (_jsx(CardContent, { className: "pt-0 text-center", children: item.content }))] }, item.id));
|
|
43
|
+
}) }));
|
|
44
|
+
});
|
|
45
|
+
CardsSelect.displayName = "CardsSelect";
|
|
46
|
+
export { CardsSelect };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CollapsibleProps } from "@radix-ui/react-collapsible";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
export declare function CollapsibleSidebarMenuItem({ children, label, icon, link, badge, ...props }: {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
label: string;
|
|
6
|
+
icon: ReactNode;
|
|
7
|
+
link: string;
|
|
8
|
+
badge?: ReactNode;
|
|
9
|
+
} & CollapsibleProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronRight } from "lucide-react";
|
|
3
|
+
import { Link } from "react-router";
|
|
4
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "#components/ui/collapsible";
|
|
5
|
+
import { SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, useSidebar, } from "#components/ui/sidebar";
|
|
6
|
+
export function CollapsibleSidebarMenuItem({ children, label, icon, link, badge, ...props }) {
|
|
7
|
+
const { open } = useSidebar();
|
|
8
|
+
if (!open)
|
|
9
|
+
return (_jsx(SidebarMenuItem, { children: _jsx(SidebarMenuButton, { asChild: true, tooltip: label, children: _jsxs(Link, { to: link, children: [icon, _jsx("span", { children: label })] }) }) }));
|
|
10
|
+
return (_jsx(Collapsible, { asChild: true, className: "group/collapsible", ...props, children: _jsxs(SidebarMenuItem, { children: [_jsx(CollapsibleTrigger, { asChild: true, children: _jsxs(SidebarMenuButton, { children: [icon, badge ? badge : _jsx("span", { children: label }), _jsx(ChevronRight, { className: "ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })] }) }), _jsx(CollapsibleContent, { children: _jsx(SidebarMenuSub, { children: children }) })] }) }));
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Input, Popover, PopoverContent, PopoverTrigger, } from "@heroui/react";
|
|
3
|
+
import { hexToHsva } from "@uiw/color-convert";
|
|
4
|
+
import Colorful from "@uiw/react-color-colorful";
|
|
5
|
+
import { PipetteIcon } from "lucide-react";
|
|
6
|
+
import { useState } from "react";
|
|
7
|
+
function safeHexToHsva(hex) {
|
|
8
|
+
try {
|
|
9
|
+
return hexToHsva(hex);
|
|
10
|
+
}
|
|
11
|
+
catch (err) {
|
|
12
|
+
return { h: 0, s: 0, v: 0, a: 1 };
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export function ColorPicker({ disableAlpha = true, value, onValueChange, ...props }) {
|
|
16
|
+
const [hsva, setHsva] = useState(safeHexToHsva(value || ""));
|
|
17
|
+
return (_jsx(Input, { onValueChange: onValueChange, value: value, endContent: _jsxs(Popover, { placement: "bottom", children: [_jsx(PopoverTrigger, { children: _jsx(Button, { isIconOnly: true, "aria-label": "Pick color", size: "sm", variant: "light", children: _jsx(PipetteIcon, { className: "h-4 w-4 text-foreground" }) }) }), _jsx(PopoverContent, { "aria-label": "Color picker", children: _jsx(Colorful, { color: hsva, disableAlpha: disableAlpha, onChange: (color) => {
|
|
18
|
+
setHsva(color.hsva);
|
|
19
|
+
onValueChange?.(color.hex);
|
|
20
|
+
} }) })] }), ...props }));
|
|
21
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ButtonProps } from "@heroui/react";
|
|
2
|
+
export declare function CopyButton({ text, notificationTimeout, isIconOnly, onCopy, ...props }: ButtonProps & {
|
|
3
|
+
text: string;
|
|
4
|
+
notificationTimeout?: number;
|
|
5
|
+
onCopy?: () => void;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "@heroui/react";
|
|
3
|
+
import { CheckCircle, Copy } from "lucide-react";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { useTranslation } from "react-i18next";
|
|
6
|
+
import { toast } from "sonner";
|
|
7
|
+
export function CopyButton({ text, notificationTimeout = 1000, isIconOnly, onCopy, ...props }) {
|
|
8
|
+
const { t } = useTranslation();
|
|
9
|
+
const [isCopied, setIsCopied] = useState(false);
|
|
10
|
+
const handleCopy = async (text) => {
|
|
11
|
+
try {
|
|
12
|
+
await window.navigator.clipboard.writeText(text);
|
|
13
|
+
setIsCopied(true);
|
|
14
|
+
onCopy?.();
|
|
15
|
+
toast.success(t("web-ui:common.copySuccess"));
|
|
16
|
+
setTimeout(() => setIsCopied(false), notificationTimeout);
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
toast.error(t("web-ui:common.copyError"));
|
|
20
|
+
console.error(error);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
return (_jsx(Button, { isIconOnly: isIconOnly, onPress: () => handleCopy(text), ...props, children: isCopied ? (_jsxs(_Fragment, { children: [_jsx(CheckCircle, { className: "h-4 w-4" }), !isIconOnly && t("web-ui:common.copied")] })) : (_jsxs(_Fragment, { children: [_jsx(Copy, { className: "h-4 w-4" }), !isIconOnly && t("web-ui:common.copy")] })) }));
|
|
24
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface CropDialogProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
onOpenChange: (open: boolean) => void;
|
|
4
|
+
imageUrl: string;
|
|
5
|
+
onCropComplete: (croppedBlob: Blob) => void;
|
|
6
|
+
onCancel: () => void;
|
|
7
|
+
isLoading?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function CropDialog({ open, onOpenChange, imageUrl, onCropComplete, onCancel, isLoading, }: CropDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ZoomIn, ZoomOut } from "lucide-react";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import Cropper, {} from "react-easy-crop";
|
|
5
|
+
import { useTranslation } from "react-i18next";
|
|
6
|
+
import { Button } from "#components/ui/button";
|
|
7
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "#components/ui/dialog";
|
|
8
|
+
import { Slider } from "#components/ui/slider";
|
|
9
|
+
async function getCroppedImg(imageSrc, pixelCrop, t) {
|
|
10
|
+
const image = new Image();
|
|
11
|
+
image.src = imageSrc;
|
|
12
|
+
// Create canvas
|
|
13
|
+
const canvas = document.createElement("canvas");
|
|
14
|
+
const ctx = canvas.getContext("2d");
|
|
15
|
+
if (!ctx) {
|
|
16
|
+
throw new Error(t("web-ui:image.crop.failedContext"));
|
|
17
|
+
}
|
|
18
|
+
// Set canvas size to the crop size
|
|
19
|
+
canvas.width = pixelCrop.width;
|
|
20
|
+
canvas.height = pixelCrop.height;
|
|
21
|
+
// Draw the cropped image
|
|
22
|
+
ctx.drawImage(image, pixelCrop.x, pixelCrop.y, pixelCrop.width, pixelCrop.height, 0, 0, pixelCrop.width, pixelCrop.height);
|
|
23
|
+
// Get the cropped image as blob
|
|
24
|
+
return new Promise((resolve, reject) => {
|
|
25
|
+
canvas.toBlob((blob) => {
|
|
26
|
+
if (!blob)
|
|
27
|
+
reject(new Error(t("web-ui:image.crop.failedCrop")));
|
|
28
|
+
else
|
|
29
|
+
resolve(blob);
|
|
30
|
+
}, "image/jpeg");
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export function CropDialog({ open, onOpenChange, imageUrl, onCropComplete, onCancel, isLoading = false, }) {
|
|
34
|
+
const { t } = useTranslation();
|
|
35
|
+
const [crop, setCrop] = useState({ x: 0, y: 0 });
|
|
36
|
+
const [zoom, setZoom] = useState(1);
|
|
37
|
+
const [croppedAreaPixels, setCroppedAreaPixels] = useState(null);
|
|
38
|
+
const handleCropComplete = (_croppedArea, croppedAreaPixels) => {
|
|
39
|
+
setCroppedAreaPixels(croppedAreaPixels);
|
|
40
|
+
};
|
|
41
|
+
const handleSave = async () => {
|
|
42
|
+
if (!croppedAreaPixels)
|
|
43
|
+
return;
|
|
44
|
+
try {
|
|
45
|
+
const croppedImageBlob = await getCroppedImg(imageUrl, croppedAreaPixels, t);
|
|
46
|
+
onCropComplete(croppedImageBlob);
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
console.error(t("web-ui:image.crop.error"), error);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { className: "sm:max-w-[600px]", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: t("web-ui:image.crop.title") }) }), _jsx("div", { className: "relative h-[400px] w-full", children: _jsx(Cropper, { image: imageUrl, crop: crop, zoom: zoom, aspect: 1, onCropChange: setCrop, onZoomChange: setZoom, onCropComplete: handleCropComplete, objectFit: "contain", showGrid: true, style: {
|
|
53
|
+
containerStyle: {
|
|
54
|
+
position: "relative",
|
|
55
|
+
width: "100%",
|
|
56
|
+
height: "100%",
|
|
57
|
+
backgroundColor: "#262626",
|
|
58
|
+
},
|
|
59
|
+
cropAreaStyle: {
|
|
60
|
+
border: "2px solid #fff",
|
|
61
|
+
color: "rgba(255, 255, 255, 0.9)",
|
|
62
|
+
},
|
|
63
|
+
mediaStyle: {
|
|
64
|
+
backgroundColor: "#262626",
|
|
65
|
+
},
|
|
66
|
+
} }) }), _jsxs("div", { className: "flex items-center gap-4 px-1", children: [_jsx(ZoomOut, { className: "h-4 w-4" }), _jsx(Slider, { value: [zoom], onValueChange: (values) => setZoom(values[0]), min: 1, max: 3, step: 0.1, className: "flex-1" }), _jsx(ZoomIn, { className: "h-4 w-4" })] }), _jsxs("div", { className: "mt-4 flex justify-end space-x-2", children: [_jsx(Button, { variant: "outline", onClick: onCancel, children: t("web-ui:common.cancel") }), _jsx(Button, { onClick: handleSave, disabled: isLoading, children: isLoading ? t("web-ui:common.saving") : t("web-ui:common.save") })] })] }) }));
|
|
67
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ButtonProps } from "@heroui/react";
|
|
2
|
+
export type DialogProps = {
|
|
3
|
+
title: React.ReactNode;
|
|
4
|
+
description: React.ReactNode;
|
|
5
|
+
color?: ButtonProps["color"];
|
|
6
|
+
cancelable?: boolean;
|
|
7
|
+
onCancel?: () => void;
|
|
8
|
+
onConfirm?: () => void;
|
|
9
|
+
cancelLabel?: string;
|
|
10
|
+
confirmLabel?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function useDialog(): (dialog: DialogProps) => void;
|
|
13
|
+
export declare function DialogProvider({ children }: {
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, } from "@heroui/react";
|
|
3
|
+
import { semanticColors } from "@heroui/theme";
|
|
4
|
+
import { createContext, useContext, useRef, useState } from "react";
|
|
5
|
+
const DialogContext = createContext(() => {
|
|
6
|
+
console.warn("DialogProvider is not initialized");
|
|
7
|
+
});
|
|
8
|
+
export function useDialog() {
|
|
9
|
+
const context = useContext(DialogContext);
|
|
10
|
+
if (!context) {
|
|
11
|
+
throw new Error("useDialog must be used within a DialogProvider");
|
|
12
|
+
}
|
|
13
|
+
return context;
|
|
14
|
+
}
|
|
15
|
+
export function DialogProvider({ children }) {
|
|
16
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
17
|
+
const [dialog, setDialog] = useState(null);
|
|
18
|
+
const timeoutRef = useRef(null);
|
|
19
|
+
const handleSetDialog = (dialog) => {
|
|
20
|
+
if (timeoutRef.current) {
|
|
21
|
+
clearTimeout(timeoutRef.current);
|
|
22
|
+
timeoutRef.current = null;
|
|
23
|
+
}
|
|
24
|
+
setDialog(dialog);
|
|
25
|
+
setIsOpen(true);
|
|
26
|
+
};
|
|
27
|
+
const handleUnsetDialog = () => {
|
|
28
|
+
setIsOpen(false);
|
|
29
|
+
if (timeoutRef.current) {
|
|
30
|
+
clearTimeout(timeoutRef.current);
|
|
31
|
+
timeoutRef.current = null;
|
|
32
|
+
}
|
|
33
|
+
timeoutRef.current = setTimeout(() => {
|
|
34
|
+
setDialog(null);
|
|
35
|
+
}, 500);
|
|
36
|
+
};
|
|
37
|
+
const handleCancel = () => {
|
|
38
|
+
dialog?.onCancel?.();
|
|
39
|
+
handleUnsetDialog();
|
|
40
|
+
};
|
|
41
|
+
const handleConfirm = () => {
|
|
42
|
+
dialog?.onConfirm?.();
|
|
43
|
+
handleUnsetDialog();
|
|
44
|
+
};
|
|
45
|
+
return (_jsx(DialogContext.Provider, { value: handleSetDialog, children: _jsxs(_Fragment, { children: [children, dialog && (_jsx(Modal, { isOpen: isOpen, onOpenChange: handleUnsetDialog, style: {
|
|
46
|
+
borderColor: semanticColors.light[dialog.color || "danger"][600],
|
|
47
|
+
}, classNames: {
|
|
48
|
+
base: "border-1",
|
|
49
|
+
}, children: _jsxs(ModalContent, { children: [_jsx(ModalHeader, { children: dialog.title }), _jsx(ModalBody, { children: dialog.description }), _jsx(ModalFooter, { children: _jsxs("div", { className: "flex flex-row gap-2", children: [(dialog.cancelable || dialog.onCancel) && (_jsx(Button, { onPress: handleCancel, children: dialog.cancelLabel ?? "Cancel" })), _jsx(Button, { color: dialog.color, onPress: handleConfirm, children: dialog.confirmLabel ?? "Confirm" })] }) })] }) }))] }) }));
|
|
50
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export function ErrorFallback({ error, componentStack, }) {
|
|
3
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
4
|
+
return (_jsxs("div", { className: "flex flex-grow-1 flex-col items-center justify-center h-[100vh]", children: [_jsx("h1", { className: "text-3xl font-bold", children: "Something went wrong." }), _jsx("h1", { className: "text-2xl text-gray-700 font-bold mb-5", children: "Please try again later." }), _jsx("div", { className: "text-lg text-gray-700 mb-5", children: errorMessage }), _jsx("div", { className: "text-sm text-gray-500 px-10", children: componentStack })] }));
|
|
5
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { File, Upload, X } from "lucide-react";
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
|
+
import { useDropzone } from "react-dropzone";
|
|
5
|
+
import { Button } from "#components/ui/button";
|
|
6
|
+
import { Progress } from "#components/ui/progress";
|
|
7
|
+
import { cn } from "#utils";
|
|
8
|
+
export function FileDropzone({ onUploadComplete, className }) {
|
|
9
|
+
const [uploadProgress, setUploadProgress] = useState(0);
|
|
10
|
+
const [selectedFile, setSelectedFile] = useState(null);
|
|
11
|
+
const [isUploading, setIsUploading] = useState(false);
|
|
12
|
+
const onDrop = useCallback((acceptedFiles) => {
|
|
13
|
+
if (acceptedFiles.length > 0) {
|
|
14
|
+
setSelectedFile(acceptedFiles[0]);
|
|
15
|
+
}
|
|
16
|
+
}, []);
|
|
17
|
+
const { getRootProps, getInputProps, isDragActive } = useDropzone({
|
|
18
|
+
onDrop,
|
|
19
|
+
accept: {
|
|
20
|
+
"image/jpeg": [],
|
|
21
|
+
"image/png": [],
|
|
22
|
+
"image/webp": [],
|
|
23
|
+
"image/jpg": [],
|
|
24
|
+
},
|
|
25
|
+
maxFiles: 1,
|
|
26
|
+
});
|
|
27
|
+
const uploadFile = async () => {
|
|
28
|
+
if (!selectedFile)
|
|
29
|
+
return;
|
|
30
|
+
setIsUploading(true);
|
|
31
|
+
setUploadProgress(0);
|
|
32
|
+
const formData = new FormData();
|
|
33
|
+
formData.append("file", selectedFile);
|
|
34
|
+
try {
|
|
35
|
+
const response = await fetch("/api/upload/image", {
|
|
36
|
+
method: "POST",
|
|
37
|
+
body: formData,
|
|
38
|
+
// Note: Content-Type is automatically set for FormData
|
|
39
|
+
});
|
|
40
|
+
if (!response.ok) {
|
|
41
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
42
|
+
}
|
|
43
|
+
const data = await response.json();
|
|
44
|
+
onUploadComplete?.(data.filePath);
|
|
45
|
+
setSelectedFile(null);
|
|
46
|
+
setUploadProgress(0);
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
console.error("Upload error:", error);
|
|
50
|
+
}
|
|
51
|
+
finally {
|
|
52
|
+
setIsUploading(false);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const removeFile = () => {
|
|
56
|
+
setSelectedFile(null);
|
|
57
|
+
setUploadProgress(0);
|
|
58
|
+
};
|
|
59
|
+
return (_jsxs("div", { className: cn("w-full max-w-xl", className), children: [_jsxs("div", { ...getRootProps(), className: cn("border-2 border-dashed rounded-lg p-6 cursor-pointer transition-colors", isDragActive ? "border-primary bg-primary/5" : "border-gray-300 hover:border-primary", selectedFile && "border-primary"), children: [_jsx("input", { ...getInputProps() }), _jsx("div", { className: "flex flex-col items-center justify-center space-y-2 text-center", children: selectedFile ? (_jsxs(_Fragment, { children: [_jsx(File, { className: "h-8 w-8 text-primary" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-sm text-gray-600", children: selectedFile.name }), _jsx("button", { type: "button", onClick: (e) => {
|
|
60
|
+
e.stopPropagation();
|
|
61
|
+
removeFile();
|
|
62
|
+
}, className: "p-1 hover:bg-gray-100 rounded-full", children: _jsx(X, { className: "h-4 w-4 text-gray-500" }) })] })] })) : (_jsxs(_Fragment, { children: [_jsx(Upload, { className: "h-8 w-8 text-gray-400" }), _jsx("p", { className: "text-sm text-gray-600", children: "Drag & drop an image here, or click to select" }), _jsx("p", { className: "text-xs text-gray-500", children: "Supports JPG, PNG, and WebP" })] })) })] }), selectedFile && (_jsxs("div", { className: "mt-4 space-y-4", children: [isUploading && _jsx(Progress, { value: uploadProgress, className: "h-2 w-full" }), _jsx(Button, { onClick: uploadFile, disabled: isUploading, className: "w-full", children: isUploading ? "Uploading..." : "Upload File" })] }))] }));
|
|
63
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface MultiSelectOption {
|
|
3
|
+
label: string;
|
|
4
|
+
icon?: React.ReactNode;
|
|
5
|
+
value: string;
|
|
6
|
+
group?: string;
|
|
7
|
+
}
|
|
8
|
+
interface MultiSelectDropdownProps {
|
|
9
|
+
options: MultiSelectOption[];
|
|
10
|
+
selectedValues: string[];
|
|
11
|
+
onValueChange: (selectedValues: string[]) => void;
|
|
12
|
+
placeholder?: React.ReactNode;
|
|
13
|
+
label?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
triggerClassName?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
maxDisplayCount?: number;
|
|
18
|
+
multiSelectLabel?: string;
|
|
19
|
+
trigger?: React.ReactNode;
|
|
20
|
+
resetButton?: "bottom" | "top";
|
|
21
|
+
resetLabel?: React.ReactNode;
|
|
22
|
+
separateGroups?: boolean;
|
|
23
|
+
}
|
|
24
|
+
declare const MultiSelectDropdown: React.ForwardRefExoticComponent<MultiSelectDropdownProps & React.RefAttributes<HTMLButtonElement>>;
|
|
25
|
+
export { MultiSelectDropdown };
|
|
26
|
+
export type { MultiSelectOption, MultiSelectDropdownProps };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronDown, RotateCcw } from "lucide-react";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Button } from "#components/ui/button";
|
|
5
|
+
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "#components/ui/dropdown-menu";
|
|
6
|
+
import { cn } from "#utils";
|
|
7
|
+
const MultiSelectDropdown = React.forwardRef(({ options, selectedValues, onValueChange, placeholder = "Select items...", label, className, triggerClassName, trigger, multiSelectLabel, disabled = false, maxDisplayCount = 3, resetButton = "bottom", resetLabel = "Reset", separateGroups = false, ...props }, ref) => {
|
|
8
|
+
const handleValueChange = (value, checked) => {
|
|
9
|
+
if (checked) {
|
|
10
|
+
onValueChange([...selectedValues, value]);
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
onValueChange(selectedValues.filter((v) => v !== value));
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
const handleReset = () => {
|
|
17
|
+
onValueChange([]);
|
|
18
|
+
};
|
|
19
|
+
const getDisplayText = () => {
|
|
20
|
+
if (selectedValues.length === 0) {
|
|
21
|
+
return placeholder;
|
|
22
|
+
}
|
|
23
|
+
const selectedLabels = options
|
|
24
|
+
.filter((option) => selectedValues.includes(option.value))
|
|
25
|
+
.map((option) => option.label);
|
|
26
|
+
if (multiSelectLabel && selectedLabels.length > 1) {
|
|
27
|
+
return multiSelectLabel;
|
|
28
|
+
}
|
|
29
|
+
if (selectedLabels.length <= maxDisplayCount) {
|
|
30
|
+
return selectedLabels.join(", ");
|
|
31
|
+
}
|
|
32
|
+
return `${selectedLabels.slice(0, maxDisplayCount).join(", ")} (+${selectedLabels.length - maxDisplayCount} more)`;
|
|
33
|
+
};
|
|
34
|
+
const groupedOptions = React.useMemo(() => {
|
|
35
|
+
const groups = {};
|
|
36
|
+
const ungrouped = [];
|
|
37
|
+
options.forEach((option) => {
|
|
38
|
+
if (option.group) {
|
|
39
|
+
if (!groups[option.group]) {
|
|
40
|
+
groups[option.group] = [];
|
|
41
|
+
}
|
|
42
|
+
groups[option.group].push(option);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
ungrouped.push(option);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return { groups, ungrouped };
|
|
49
|
+
}, [options]);
|
|
50
|
+
return (_jsx("div", { className: cn("w-full", className), children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { ref: ref, variant: "outline", className: cn("w-full justify-between text-left font-normal", selectedValues.length === 0 && "text-muted-foreground", triggerClassName), disabled: disabled, ...props, children: trigger || (_jsxs(_Fragment, { children: [_jsx("span", { className: "truncate", children: getDisplayText() }), _jsx(ChevronDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })] })) }) }), _jsxs(DropdownMenuContent, { className: "w-full min-w-[var(--radix-dropdown-menu-trigger-width)]", align: "start", children: [resetButton && resetButton === "top" && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuItem, { onClick: handleReset, disabled: selectedValues.length === 0, onSelect: (event) => event.preventDefault(), className: "cursor-pointer text-muted-foreground hover:text-foreground", children: resetLabel || (_jsxs(_Fragment, { children: [_jsx(RotateCcw, { className: "mr-2 h-4 w-4" }), "Reset"] })) }), _jsx(DropdownMenuSeparator, {})] })), label && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuLabel, { children: label }), _jsx(DropdownMenuSeparator, {})] })), Object.entries(groupedOptions.groups).map(([groupName, groupOptions], groupIndex) => (_jsxs(DropdownMenuGroup, { children: [groupIndex > 0 && separateGroups && _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuLabel, { className: "text-xs font-semibold text-muted-foreground px-2 py-1.5", children: groupName }), groupOptions.map((option) => (_jsxs(DropdownMenuCheckboxItem, { checked: selectedValues.includes(option.value), onCheckedChange: (checked) => handleValueChange(option.value, checked), onSelect: (event) => event.preventDefault(), className: "cursor-pointer", children: [option.icon && _jsx("span", { className: "mr-2", children: option.icon }), option.label] }, option.value)))] }, groupName))), groupedOptions.ungrouped.length > 0 && (_jsxs(DropdownMenuGroup, { children: [Object.keys(groupedOptions.groups).length > 0 && _jsx(DropdownMenuSeparator, {}), groupedOptions.ungrouped.map((option) => (_jsx(DropdownMenuCheckboxItem, { checked: selectedValues.includes(option.value), onCheckedChange: (checked) => handleValueChange(option.value, checked), onSelect: (event) => event.preventDefault(), className: "cursor-pointer", children: option.label }, option.value)))] })), resetButton && resetButton === "bottom" && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { onClick: handleReset, disabled: selectedValues.length === 0, onSelect: (event) => event.preventDefault(), className: "cursor-pointer text-muted-foreground hover:text-foreground", children: resetLabel || (_jsxs(_Fragment, { children: [_jsx(RotateCcw, { className: "mr-2 h-4 w-4" }), "Reset"] })) })] }))] })] }) }));
|
|
51
|
+
});
|
|
52
|
+
MultiSelectDropdown.displayName = "MultiSelectDropdown";
|
|
53
|
+
export { MultiSelectDropdown };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export default function Orb({ hue, hoverIntensity, rotateOnHover, forceHoverState, }: {
|
|
2
|
+
hue?: number | undefined;
|
|
3
|
+
hoverIntensity?: number | undefined;
|
|
4
|
+
rotateOnHover?: boolean | undefined;
|
|
5
|
+
forceHoverState?: boolean | undefined;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|