@m5kdev/web-ui 0.6.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,67 +1,113 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Button } from "./ui/button.js";
|
|
2
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "./ui/dialog.js";
|
|
3
|
+
import { Slider } from "./ui/slider.js";
|
|
3
4
|
import { useState } from "react";
|
|
4
|
-
import
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { ZoomIn, ZoomOut } from "lucide-react";
|
|
5
7
|
import { useTranslation } from "react-i18next";
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
import { Slider } from "./ui/slider";
|
|
8
|
+
import Cropper from "react-easy-crop";
|
|
9
|
+
//#region src/components/CropDialog.tsx
|
|
9
10
|
async function getCroppedImg(imageSrc, pixelCrop, t) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
});
|
|
11
|
+
const image = new Image();
|
|
12
|
+
image.src = imageSrc;
|
|
13
|
+
const canvas = document.createElement("canvas");
|
|
14
|
+
const ctx = canvas.getContext("2d");
|
|
15
|
+
if (!ctx) throw new Error(t("web-ui:image.crop.failedContext"));
|
|
16
|
+
canvas.width = pixelCrop.width;
|
|
17
|
+
canvas.height = pixelCrop.height;
|
|
18
|
+
ctx.drawImage(image, pixelCrop.x, pixelCrop.y, pixelCrop.width, pixelCrop.height, 0, 0, pixelCrop.width, pixelCrop.height);
|
|
19
|
+
return new Promise((resolve, reject) => {
|
|
20
|
+
canvas.toBlob((blob) => {
|
|
21
|
+
if (!blob) reject(new Error(t("web-ui:image.crop.failedCrop")));
|
|
22
|
+
else resolve(blob);
|
|
23
|
+
}, "image/jpeg");
|
|
24
|
+
});
|
|
32
25
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
26
|
+
function CropDialog({ open, onOpenChange, imageUrl, onCropComplete, onCancel, isLoading = false }) {
|
|
27
|
+
const { t } = useTranslation();
|
|
28
|
+
const [crop, setCrop] = useState({
|
|
29
|
+
x: 0,
|
|
30
|
+
y: 0
|
|
31
|
+
});
|
|
32
|
+
const [zoom, setZoom] = useState(1);
|
|
33
|
+
const [croppedAreaPixels, setCroppedAreaPixels] = useState(null);
|
|
34
|
+
const handleCropComplete = (_croppedArea, croppedAreaPixels) => {
|
|
35
|
+
setCroppedAreaPixels(croppedAreaPixels);
|
|
36
|
+
};
|
|
37
|
+
const handleSave = async () => {
|
|
38
|
+
if (!croppedAreaPixels) return;
|
|
39
|
+
try {
|
|
40
|
+
onCropComplete(await getCroppedImg(imageUrl, croppedAreaPixels, t));
|
|
41
|
+
} catch (error) {
|
|
42
|
+
console.error(t("web-ui:image.crop.error"), error);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
return /* @__PURE__ */ jsx(Dialog, {
|
|
46
|
+
open,
|
|
47
|
+
onOpenChange,
|
|
48
|
+
children: /* @__PURE__ */ jsxs(DialogContent, {
|
|
49
|
+
className: "sm:max-w-[600px]",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t("web-ui:image.crop.title") }) }),
|
|
52
|
+
/* @__PURE__ */ jsx("div", {
|
|
53
|
+
className: "relative h-[400px] w-full",
|
|
54
|
+
children: /* @__PURE__ */ jsx(Cropper, {
|
|
55
|
+
image: imageUrl,
|
|
56
|
+
crop,
|
|
57
|
+
zoom,
|
|
58
|
+
aspect: 1,
|
|
59
|
+
onCropChange: setCrop,
|
|
60
|
+
onZoomChange: setZoom,
|
|
61
|
+
onCropComplete: handleCropComplete,
|
|
62
|
+
objectFit: "contain",
|
|
63
|
+
showGrid: true,
|
|
64
|
+
style: {
|
|
65
|
+
containerStyle: {
|
|
66
|
+
position: "relative",
|
|
67
|
+
width: "100%",
|
|
68
|
+
height: "100%",
|
|
69
|
+
backgroundColor: "#262626"
|
|
70
|
+
},
|
|
71
|
+
cropAreaStyle: {
|
|
72
|
+
border: "2px solid #fff",
|
|
73
|
+
color: "rgba(255, 255, 255, 0.9)"
|
|
74
|
+
},
|
|
75
|
+
mediaStyle: { backgroundColor: "#262626" }
|
|
76
|
+
}
|
|
77
|
+
})
|
|
78
|
+
}),
|
|
79
|
+
/* @__PURE__ */ jsxs("div", {
|
|
80
|
+
className: "flex items-center gap-4 px-1",
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ jsx(ZoomOut, { className: "h-4 w-4" }),
|
|
83
|
+
/* @__PURE__ */ jsx(Slider, {
|
|
84
|
+
value: [zoom],
|
|
85
|
+
onValueChange: (values) => setZoom(values[0]),
|
|
86
|
+
min: 1,
|
|
87
|
+
max: 3,
|
|
88
|
+
step: .1,
|
|
89
|
+
className: "flex-1"
|
|
90
|
+
}),
|
|
91
|
+
/* @__PURE__ */ jsx(ZoomIn, { className: "h-4 w-4" })
|
|
92
|
+
]
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ jsxs("div", {
|
|
95
|
+
className: "mt-4 flex justify-end space-x-2",
|
|
96
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
97
|
+
variant: "outline",
|
|
98
|
+
onClick: onCancel,
|
|
99
|
+
children: t("web-ui:common.cancel")
|
|
100
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
101
|
+
onClick: handleSave,
|
|
102
|
+
disabled: isLoading,
|
|
103
|
+
children: isLoading ? t("web-ui:common.saving") : t("web-ui:common.save")
|
|
104
|
+
})]
|
|
105
|
+
})
|
|
106
|
+
]
|
|
107
|
+
})
|
|
108
|
+
});
|
|
67
109
|
}
|
|
110
|
+
//#endregion
|
|
111
|
+
export { CropDialog };
|
|
112
|
+
|
|
113
|
+
//# sourceMappingURL=CropDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CropDialog.js","names":[],"sources":["../../../src/components/CropDialog.tsx"],"sourcesContent":["import { ZoomIn, ZoomOut } from \"lucide-react\";\r\nimport { useState } from \"react\";\r\nimport Cropper, { type Area } from \"react-easy-crop\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { Button } from \"./ui/button\";\r\nimport { Dialog, DialogContent, DialogHeader, DialogTitle } from \"./ui/dialog\";\r\nimport { Slider } from \"./ui/slider\";\r\n\r\ninterface CropArea {\r\n x: number;\r\n y: number;\r\n width: number;\r\n height: number;\r\n}\r\n\r\ninterface CropDialogProps {\r\n open: boolean;\r\n onOpenChange: (open: boolean) => void;\r\n imageUrl: string;\r\n onCropComplete: (croppedBlob: Blob) => void;\r\n onCancel: () => void;\r\n isLoading?: boolean;\r\n}\r\n\r\nasync function getCroppedImg(\r\n imageSrc: string,\r\n pixelCrop: CropArea,\r\n t: (key: string) => string\r\n): Promise<Blob> {\r\n const image = new Image();\r\n image.src = imageSrc;\r\n\r\n // Create canvas\r\n const canvas = document.createElement(\"canvas\");\r\n const ctx = canvas.getContext(\"2d\");\r\n\r\n if (!ctx) {\r\n throw new Error(t(\"web-ui:image.crop.failedContext\"));\r\n }\r\n\r\n // Set canvas size to the crop size\r\n canvas.width = pixelCrop.width;\r\n canvas.height = pixelCrop.height;\r\n\r\n // Draw the cropped image\r\n ctx.drawImage(\r\n image,\r\n pixelCrop.x,\r\n pixelCrop.y,\r\n pixelCrop.width,\r\n pixelCrop.height,\r\n 0,\r\n 0,\r\n pixelCrop.width,\r\n pixelCrop.height\r\n );\r\n\r\n // Get the cropped image as blob\r\n return new Promise((resolve, reject) => {\r\n canvas.toBlob((blob) => {\r\n if (!blob) reject(new Error(t(\"web-ui:image.crop.failedCrop\")));\r\n else resolve(blob);\r\n }, \"image/jpeg\");\r\n });\r\n}\r\n\r\nexport function CropDialog({\r\n open,\r\n onOpenChange,\r\n imageUrl,\r\n onCropComplete,\r\n onCancel,\r\n isLoading = false,\r\n}: CropDialogProps) {\r\n const { t } = useTranslation();\r\n const [crop, setCrop] = useState({ x: 0, y: 0 });\r\n const [zoom, setZoom] = useState(1);\r\n const [croppedAreaPixels, setCroppedAreaPixels] = useState<CropArea | null>(null);\r\n\r\n const handleCropComplete = (_croppedArea: Area, croppedAreaPixels: CropArea) => {\r\n setCroppedAreaPixels(croppedAreaPixels);\r\n };\r\n\r\n const handleSave = async () => {\r\n if (!croppedAreaPixels) return;\r\n\r\n try {\r\n const croppedImageBlob = await getCroppedImg(imageUrl, croppedAreaPixels, t);\r\n onCropComplete(croppedImageBlob);\r\n } catch (error) {\r\n console.error(t(\"web-ui:image.crop.error\"), error);\r\n }\r\n };\r\n\r\n return (\r\n <Dialog open={open} onOpenChange={onOpenChange}>\r\n <DialogContent className=\"sm:max-w-[600px]\">\r\n <DialogHeader>\r\n <DialogTitle>{t(\"web-ui:image.crop.title\")}</DialogTitle>\r\n </DialogHeader>\r\n <div className=\"relative h-[400px] w-full\">\r\n <Cropper\r\n image={imageUrl}\r\n crop={crop}\r\n zoom={zoom}\r\n aspect={1}\r\n onCropChange={setCrop}\r\n onZoomChange={setZoom}\r\n onCropComplete={handleCropComplete}\r\n objectFit=\"contain\"\r\n showGrid={true}\r\n style={{\r\n containerStyle: {\r\n position: \"relative\",\r\n width: \"100%\",\r\n height: \"100%\",\r\n backgroundColor: \"#262626\",\r\n },\r\n cropAreaStyle: {\r\n border: \"2px solid #fff\",\r\n color: \"rgba(255, 255, 255, 0.9)\",\r\n },\r\n mediaStyle: {\r\n backgroundColor: \"#262626\",\r\n },\r\n }}\r\n />\r\n </div>\r\n\r\n <div className=\"flex items-center gap-4 px-1\">\r\n <ZoomOut className=\"h-4 w-4\" />\r\n <Slider\r\n value={[zoom]}\r\n onValueChange={(values: number[]) => setZoom(values[0])}\r\n min={1}\r\n max={3}\r\n step={0.1}\r\n className=\"flex-1\"\r\n />\r\n <ZoomIn className=\"h-4 w-4\" />\r\n </div>\r\n\r\n <div className=\"mt-4 flex justify-end space-x-2\">\r\n <Button variant=\"outline\" onClick={onCancel}>\r\n {t(\"web-ui:common.cancel\")}\r\n </Button>\r\n <Button onClick={handleSave} disabled={isLoading}>\r\n {isLoading ? t(\"web-ui:common.saving\") : t(\"web-ui:common.save\")}\r\n </Button>\r\n </div>\r\n </DialogContent>\r\n </Dialog>\r\n );\r\n}\r\n"],"mappings":";;;;;;;;;AAwBA,eAAe,cACb,UACA,WACA,GACe;CACf,MAAM,QAAQ,IAAI,OAAO;AACzB,OAAM,MAAM;CAGZ,MAAM,SAAS,SAAS,cAAc,SAAS;CAC/C,MAAM,MAAM,OAAO,WAAW,KAAK;AAEnC,KAAI,CAAC,IACH,OAAM,IAAI,MAAM,EAAE,kCAAkC,CAAC;AAIvD,QAAO,QAAQ,UAAU;AACzB,QAAO,SAAS,UAAU;AAG1B,KAAI,UACF,OACA,UAAU,GACV,UAAU,GACV,UAAU,OACV,UAAU,QACV,GACA,GACA,UAAU,OACV,UAAU,OACX;AAGD,QAAO,IAAI,SAAS,SAAS,WAAW;AACtC,SAAO,QAAQ,SAAS;AACtB,OAAI,CAAC,KAAM,QAAO,IAAI,MAAM,EAAE,+BAA+B,CAAC,CAAC;OAC1D,SAAQ,KAAK;KACjB,aAAa;GAChB;;AAGJ,SAAgB,WAAW,EACzB,MACA,cACA,UACA,gBACA,UACA,YAAY,SACM;CAClB,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,CAAC,MAAM,WAAW,SAAS;EAAE,GAAG;EAAG,GAAG;EAAG,CAAC;CAChD,MAAM,CAAC,MAAM,WAAW,SAAS,EAAE;CACnC,MAAM,CAAC,mBAAmB,wBAAwB,SAA0B,KAAK;CAEjF,MAAM,sBAAsB,cAAoB,sBAAgC;AAC9E,uBAAqB,kBAAkB;;CAGzC,MAAM,aAAa,YAAY;AAC7B,MAAI,CAAC,kBAAmB;AAExB,MAAI;AAEF,kBADyB,MAAM,cAAc,UAAU,mBAAmB,EAAE,CAC5C;WACzB,OAAO;AACd,WAAQ,MAAM,EAAE,0BAA0B,EAAE,MAAM;;;AAItD,QACE,oBAAC,QAAD;EAAc;EAAoB;YAChC,qBAAC,eAAD;GAAe,WAAU;aAAzB;IACE,oBAAC,cAAD,EAAA,UACE,oBAAC,aAAD,EAAA,UAAc,EAAE,0BAA0B,EAAe,CAAA,EAC5C,CAAA;IACf,oBAAC,OAAD;KAAK,WAAU;eACb,oBAAC,SAAD;MACE,OAAO;MACD;MACA;MACN,QAAQ;MACR,cAAc;MACd,cAAc;MACd,gBAAgB;MAChB,WAAU;MACV,UAAU;MACV,OAAO;OACL,gBAAgB;QACd,UAAU;QACV,OAAO;QACP,QAAQ;QACR,iBAAiB;QAClB;OACD,eAAe;QACb,QAAQ;QACR,OAAO;QACR;OACD,YAAY,EACV,iBAAiB,WAClB;OACF;MACD,CAAA;KACE,CAAA;IAEN,qBAAC,OAAD;KAAK,WAAU;eAAf;MACE,oBAAC,SAAD,EAAS,WAAU,WAAY,CAAA;MAC/B,oBAAC,QAAD;OACE,OAAO,CAAC,KAAK;OACb,gBAAgB,WAAqB,QAAQ,OAAO,GAAG;OACvD,KAAK;OACL,KAAK;OACL,MAAM;OACN,WAAU;OACV,CAAA;MACF,oBAAC,QAAD,EAAQ,WAAU,WAAY,CAAA;MAC1B;;IAEN,qBAAC,OAAD;KAAK,WAAU;eAAf,CACE,oBAAC,QAAD;MAAQ,SAAQ;MAAU,SAAS;gBAChC,EAAE,uBAAuB;MACnB,CAAA,EACT,oBAAC,QAAD;MAAQ,SAAS;MAAY,UAAU;gBACpC,YAAY,EAAE,uBAAuB,GAAG,EAAE,qBAAqB;MACzD,CAAA,CACL;;IACQ;;EACT,CAAA"}
|
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { ButtonProps } from "@heroui/react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/DialogProvider.d.ts
|
|
5
|
+
type DialogProps = {
|
|
6
|
+
title: React.ReactNode;
|
|
7
|
+
description: React.ReactNode;
|
|
8
|
+
color?: ButtonProps["color"];
|
|
9
|
+
cancelable?: boolean;
|
|
10
|
+
onCancel?: () => void;
|
|
11
|
+
onConfirm?: () => void;
|
|
12
|
+
cancelLabel?: string;
|
|
13
|
+
confirmLabel?: string;
|
|
11
14
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
15
|
+
declare function useDialog(): (dialog: DialogProps) => void;
|
|
16
|
+
declare function DialogProvider({
|
|
17
|
+
children
|
|
18
|
+
}: {
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { DialogProps, DialogProvider, useDialog };
|
|
23
|
+
//# sourceMappingURL=DialogProvider.d.ts.map
|
|
@@ -1,50 +1,72 @@
|
|
|
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
1
|
import { createContext, useContext, useRef, useState } from "react";
|
|
2
|
+
import { Button, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader } from "@heroui/react";
|
|
3
|
+
import { semanticColors } from "@heroui/theme";
|
|
4
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/DialogProvider.tsx
|
|
5
6
|
const DialogContext = createContext(() => {
|
|
6
|
-
|
|
7
|
+
console.warn("DialogProvider is not initialized");
|
|
7
8
|
});
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
return context;
|
|
9
|
+
function useDialog() {
|
|
10
|
+
const context = useContext(DialogContext);
|
|
11
|
+
if (!context) throw new Error("useDialog must be used within a DialogProvider");
|
|
12
|
+
return context;
|
|
14
13
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
14
|
+
function DialogProvider({ children }) {
|
|
15
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
16
|
+
const [dialog, setDialog] = useState(null);
|
|
17
|
+
const timeoutRef = useRef(null);
|
|
18
|
+
const handleSetDialog = (dialog) => {
|
|
19
|
+
if (timeoutRef.current) {
|
|
20
|
+
clearTimeout(timeoutRef.current);
|
|
21
|
+
timeoutRef.current = null;
|
|
22
|
+
}
|
|
23
|
+
setDialog(dialog);
|
|
24
|
+
setIsOpen(true);
|
|
25
|
+
};
|
|
26
|
+
const handleUnsetDialog = () => {
|
|
27
|
+
setIsOpen(false);
|
|
28
|
+
if (timeoutRef.current) {
|
|
29
|
+
clearTimeout(timeoutRef.current);
|
|
30
|
+
timeoutRef.current = null;
|
|
31
|
+
}
|
|
32
|
+
timeoutRef.current = setTimeout(() => {
|
|
33
|
+
setDialog(null);
|
|
34
|
+
}, 500);
|
|
35
|
+
};
|
|
36
|
+
const handleCancel = () => {
|
|
37
|
+
dialog?.onCancel?.();
|
|
38
|
+
handleUnsetDialog();
|
|
39
|
+
};
|
|
40
|
+
const handleConfirm = () => {
|
|
41
|
+
dialog?.onConfirm?.();
|
|
42
|
+
handleUnsetDialog();
|
|
43
|
+
};
|
|
44
|
+
return /* @__PURE__ */ jsx(DialogContext.Provider, {
|
|
45
|
+
value: handleSetDialog,
|
|
46
|
+
children: /* @__PURE__ */ jsxs(Fragment$1, { children: [children, dialog && /* @__PURE__ */ jsx(Modal, {
|
|
47
|
+
isOpen,
|
|
48
|
+
onOpenChange: handleUnsetDialog,
|
|
49
|
+
style: { borderColor: semanticColors.light[dialog.color || "danger"][600] },
|
|
50
|
+
classNames: { base: "border-1" },
|
|
51
|
+
children: /* @__PURE__ */ jsxs(ModalContent, { children: [
|
|
52
|
+
/* @__PURE__ */ jsx(ModalHeader, { children: dialog.title }),
|
|
53
|
+
/* @__PURE__ */ jsx(ModalBody, { children: dialog.description }),
|
|
54
|
+
/* @__PURE__ */ jsx(ModalFooter, { children: /* @__PURE__ */ jsxs("div", {
|
|
55
|
+
className: "flex flex-row gap-2",
|
|
56
|
+
children: [(dialog.cancelable || dialog.onCancel) && /* @__PURE__ */ jsx(Button, {
|
|
57
|
+
onPress: handleCancel,
|
|
58
|
+
children: dialog.cancelLabel ?? "Cancel"
|
|
59
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
60
|
+
color: dialog.color,
|
|
61
|
+
onPress: handleConfirm,
|
|
62
|
+
children: dialog.confirmLabel ?? "Confirm"
|
|
63
|
+
})]
|
|
64
|
+
}) })
|
|
65
|
+
] })
|
|
66
|
+
})] })
|
|
67
|
+
});
|
|
50
68
|
}
|
|
69
|
+
//#endregion
|
|
70
|
+
export { DialogProvider, useDialog };
|
|
71
|
+
|
|
72
|
+
//# sourceMappingURL=DialogProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogProvider.js","names":[],"sources":["../../../src/components/DialogProvider.tsx"],"sourcesContent":["import {\r\n Button,\r\n type ButtonProps,\r\n Modal,\r\n ModalBody,\r\n ModalContent,\r\n ModalFooter,\r\n ModalHeader,\r\n} from \"@heroui/react\";\r\nimport { semanticColors } from \"@heroui/theme\";\r\nimport { createContext, useContext, useRef, useState } from \"react\";\r\n\r\nexport type DialogProps = {\r\n title: React.ReactNode;\r\n description: React.ReactNode;\r\n color?: ButtonProps[\"color\"];\r\n cancelable?: boolean;\r\n onCancel?: () => void;\r\n onConfirm?: () => void;\r\n cancelLabel?: string;\r\n confirmLabel?: string;\r\n};\r\n\r\nconst DialogContext = createContext<(dialog: DialogProps) => void>(() => {\r\n console.warn(\"DialogProvider is not initialized\");\r\n});\r\n\r\nexport function useDialog() {\r\n const context = useContext(DialogContext);\r\n if (!context) {\r\n throw new Error(\"useDialog must be used within a DialogProvider\");\r\n }\r\n return context;\r\n}\r\n\r\nexport function DialogProvider({ children }: { children: React.ReactNode }) {\r\n const [isOpen, setIsOpen] = useState(false);\r\n const [dialog, setDialog] = useState<DialogProps | null>(null);\r\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\r\n\r\n const handleSetDialog = (dialog: DialogProps) => {\r\n if (timeoutRef.current) {\r\n clearTimeout(timeoutRef.current);\r\n timeoutRef.current = null;\r\n }\r\n setDialog(dialog);\r\n setIsOpen(true);\r\n };\r\n\r\n const handleUnsetDialog = () => {\r\n setIsOpen(false);\r\n if (timeoutRef.current) {\r\n clearTimeout(timeoutRef.current);\r\n timeoutRef.current = null;\r\n }\r\n timeoutRef.current = setTimeout(() => {\r\n setDialog(null);\r\n }, 500);\r\n };\r\n\r\n const handleCancel = () => {\r\n dialog?.onCancel?.();\r\n handleUnsetDialog();\r\n };\r\n\r\n const handleConfirm = () => {\r\n dialog?.onConfirm?.();\r\n handleUnsetDialog();\r\n };\r\n\r\n return (\r\n <DialogContext.Provider value={handleSetDialog}>\r\n <>\r\n {children}\r\n {dialog && (\r\n <Modal\r\n isOpen={isOpen}\r\n onOpenChange={handleUnsetDialog}\r\n style={{\r\n borderColor: semanticColors.light[dialog.color || \"danger\"][600],\r\n }}\r\n classNames={{\r\n base: \"border-1\",\r\n }}\r\n >\r\n <ModalContent>\r\n <ModalHeader>{dialog.title}</ModalHeader>\r\n <ModalBody>{dialog.description}</ModalBody>\r\n <ModalFooter>\r\n <div className=\"flex flex-row gap-2\">\r\n {(dialog.cancelable || dialog.onCancel) && (\r\n <Button onPress={handleCancel}>{dialog.cancelLabel ?? \"Cancel\"}</Button>\r\n )}\r\n <Button color={dialog.color} onPress={handleConfirm}>\r\n {dialog.confirmLabel ?? \"Confirm\"}\r\n </Button>\r\n </div>\r\n </ModalFooter>\r\n </ModalContent>\r\n </Modal>\r\n )}\r\n </>\r\n </DialogContext.Provider>\r\n );\r\n}\r\n"],"mappings":";;;;;AAuBA,MAAM,gBAAgB,oBAAmD;AACvE,SAAQ,KAAK,oCAAoC;EACjD;AAEF,SAAgB,YAAY;CAC1B,MAAM,UAAU,WAAW,cAAc;AACzC,KAAI,CAAC,QACH,OAAM,IAAI,MAAM,iDAAiD;AAEnE,QAAO;;AAGT,SAAgB,eAAe,EAAE,YAA2C;CAC1E,MAAM,CAAC,QAAQ,aAAa,SAAS,MAAM;CAC3C,MAAM,CAAC,QAAQ,aAAa,SAA6B,KAAK;CAC9D,MAAM,aAAa,OAA6C,KAAK;CAErE,MAAM,mBAAmB,WAAwB;AAC/C,MAAI,WAAW,SAAS;AACtB,gBAAa,WAAW,QAAQ;AAChC,cAAW,UAAU;;AAEvB,YAAU,OAAO;AACjB,YAAU,KAAK;;CAGjB,MAAM,0BAA0B;AAC9B,YAAU,MAAM;AAChB,MAAI,WAAW,SAAS;AACtB,gBAAa,WAAW,QAAQ;AAChC,cAAW,UAAU;;AAEvB,aAAW,UAAU,iBAAiB;AACpC,aAAU,KAAK;KACd,IAAI;;CAGT,MAAM,qBAAqB;AACzB,UAAQ,YAAY;AACpB,qBAAmB;;CAGrB,MAAM,sBAAsB;AAC1B,UAAQ,aAAa;AACrB,qBAAmB;;AAGrB,QACE,oBAAC,cAAc,UAAf;EAAwB,OAAO;YAC7B,qBAAA,YAAA,EAAA,UAAA,CACG,UACA,UACC,oBAAC,OAAD;GACU;GACR,cAAc;GACd,OAAO,EACL,aAAa,eAAe,MAAM,OAAO,SAAS,UAAU,MAC7D;GACD,YAAY,EACV,MAAM,YACP;aAED,qBAAC,cAAD,EAAA,UAAA;IACE,oBAAC,aAAD,EAAA,UAAc,OAAO,OAAoB,CAAA;IACzC,oBAAC,WAAD,EAAA,UAAY,OAAO,aAAwB,CAAA;IAC3C,oBAAC,aAAD,EAAA,UACE,qBAAC,OAAD;KAAK,WAAU;eAAf,EACI,OAAO,cAAc,OAAO,aAC5B,oBAAC,QAAD;MAAQ,SAAS;gBAAe,OAAO,eAAe;MAAkB,CAAA,EAE1E,oBAAC,QAAD;MAAQ,OAAO,OAAO;MAAO,SAAS;gBACnC,OAAO,gBAAgB;MACjB,CAAA,CACL;QACM,CAAA;IACD,EAAA,CAAA;GACT,CAAA,CAET,EAAA,CAAA;EACoB,CAAA"}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/components/ErrorFallback.d.ts
|
|
4
|
+
declare function ErrorFallback({
|
|
5
|
+
error,
|
|
6
|
+
componentStack
|
|
7
|
+
}: {
|
|
8
|
+
error: unknown;
|
|
9
|
+
componentStack: string;
|
|
10
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { ErrorFallback };
|
|
13
|
+
//# sourceMappingURL=ErrorFallback.d.ts.map
|
|
@@ -1,5 +1,30 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/ErrorFallback.tsx
|
|
3
|
+
function ErrorFallback({ error, componentStack }) {
|
|
4
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
5
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
6
|
+
className: "flex flex-grow-1 flex-col items-center justify-center h-[100vh]",
|
|
7
|
+
children: [
|
|
8
|
+
/* @__PURE__ */ jsx("h1", {
|
|
9
|
+
className: "text-3xl font-bold",
|
|
10
|
+
children: "Something went wrong."
|
|
11
|
+
}),
|
|
12
|
+
/* @__PURE__ */ jsx("h1", {
|
|
13
|
+
className: "text-2xl text-gray-700 font-bold mb-5",
|
|
14
|
+
children: "Please try again later."
|
|
15
|
+
}),
|
|
16
|
+
/* @__PURE__ */ jsx("div", {
|
|
17
|
+
className: "text-lg text-gray-700 mb-5",
|
|
18
|
+
children: errorMessage
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ jsx("div", {
|
|
21
|
+
className: "text-sm text-gray-500 px-10",
|
|
22
|
+
children: componentStack
|
|
23
|
+
})
|
|
24
|
+
]
|
|
25
|
+
});
|
|
5
26
|
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { ErrorFallback };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=ErrorFallback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorFallback.js","names":[],"sources":["../../../src/components/ErrorFallback.tsx"],"sourcesContent":["export function ErrorFallback({\r\n error,\r\n componentStack,\r\n}: {\r\n error: unknown;\r\n componentStack: string;\r\n}) {\r\n const errorMessage = error instanceof Error ? error.message : \"Unknown error\";\r\n return (\r\n <div className=\"flex flex-grow-1 flex-col items-center justify-center h-[100vh]\">\r\n <h1 className=\"text-3xl font-bold\">Something went wrong.</h1>\r\n <h1 className=\"text-2xl text-gray-700 font-bold mb-5\">Please try again later.</h1>\r\n <div className=\"text-lg text-gray-700 mb-5\">{errorMessage}</div>\r\n <div className=\"text-sm text-gray-500 px-10\">{componentStack}</div>\r\n </div>\r\n );\r\n}\r\n"],"mappings":";;AAAA,SAAgB,cAAc,EAC5B,OACA,kBAIC;CACD,MAAM,eAAe,iBAAiB,QAAQ,MAAM,UAAU;AAC9D,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf;GACE,oBAAC,MAAD;IAAI,WAAU;cAAqB;IAA0B,CAAA;GAC7D,oBAAC,MAAD;IAAI,WAAU;cAAwC;IAA4B,CAAA;GAClF,oBAAC,OAAD;IAAK,WAAU;cAA8B;IAAmB,CAAA;GAChE,oBAAC,OAAD;IAAK,WAAU;cAA+B;IAAqB,CAAA;GAC/D"}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/components/FileDropzone.d.ts
|
|
1
4
|
interface FileDropzoneProps {
|
|
2
|
-
|
|
3
|
-
|
|
5
|
+
onUploadComplete?: (filePath: string) => void;
|
|
6
|
+
className?: string;
|
|
4
7
|
}
|
|
5
|
-
|
|
6
|
-
|
|
8
|
+
declare function FileDropzone({
|
|
9
|
+
onUploadComplete,
|
|
10
|
+
className
|
|
11
|
+
}: FileDropzoneProps): _$react_jsx_runtime0.JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { FileDropzone };
|
|
14
|
+
//# sourceMappingURL=FileDropzone.d.ts.map
|
|
@@ -1,63 +1,101 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { Button } from "./ui/button.js";
|
|
3
|
+
import { Progress } from "./ui/progress.js";
|
|
3
4
|
import { useCallback, useState } from "react";
|
|
5
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { File, Upload, X } from "lucide-react";
|
|
4
7
|
import { useDropzone } from "react-dropzone";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
8
|
+
//#region src/components/FileDropzone.tsx
|
|
9
|
+
function FileDropzone({ onUploadComplete, className }) {
|
|
10
|
+
const [uploadProgress, setUploadProgress] = useState(0);
|
|
11
|
+
const [selectedFile, setSelectedFile] = useState(null);
|
|
12
|
+
const [isUploading, setIsUploading] = useState(false);
|
|
13
|
+
const { getRootProps, getInputProps, isDragActive } = useDropzone({
|
|
14
|
+
onDrop: useCallback((acceptedFiles) => {
|
|
15
|
+
if (acceptedFiles.length > 0) setSelectedFile(acceptedFiles[0]);
|
|
16
|
+
}, []),
|
|
17
|
+
accept: {
|
|
18
|
+
"image/jpeg": [],
|
|
19
|
+
"image/png": [],
|
|
20
|
+
"image/webp": [],
|
|
21
|
+
"image/jpg": []
|
|
22
|
+
},
|
|
23
|
+
maxFiles: 1
|
|
24
|
+
});
|
|
25
|
+
const uploadFile = async () => {
|
|
26
|
+
if (!selectedFile) return;
|
|
27
|
+
setIsUploading(true);
|
|
28
|
+
setUploadProgress(0);
|
|
29
|
+
const formData = new FormData();
|
|
30
|
+
formData.append("file", selectedFile);
|
|
31
|
+
try {
|
|
32
|
+
const response = await fetch("/api/upload/image", {
|
|
33
|
+
method: "POST",
|
|
34
|
+
body: formData
|
|
35
|
+
});
|
|
36
|
+
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
|
|
37
|
+
const data = await response.json();
|
|
38
|
+
onUploadComplete?.(data.filePath);
|
|
39
|
+
setSelectedFile(null);
|
|
40
|
+
setUploadProgress(0);
|
|
41
|
+
} catch (error) {
|
|
42
|
+
console.error("Upload error:", error);
|
|
43
|
+
} finally {
|
|
44
|
+
setIsUploading(false);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const removeFile = () => {
|
|
48
|
+
setSelectedFile(null);
|
|
49
|
+
setUploadProgress(0);
|
|
50
|
+
};
|
|
51
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
52
|
+
className: cn("w-full max-w-xl", className),
|
|
53
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
54
|
+
...getRootProps(),
|
|
55
|
+
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"),
|
|
56
|
+
children: [/* @__PURE__ */ jsx("input", { ...getInputProps() }), /* @__PURE__ */ jsx("div", {
|
|
57
|
+
className: "flex flex-col items-center justify-center space-y-2 text-center",
|
|
58
|
+
children: selectedFile ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(File, { className: "h-8 w-8 text-primary" }), /* @__PURE__ */ jsxs("div", {
|
|
59
|
+
className: "flex items-center gap-2",
|
|
60
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
61
|
+
className: "text-sm text-gray-600",
|
|
62
|
+
children: selectedFile.name
|
|
63
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
64
|
+
type: "button",
|
|
65
|
+
onClick: (e) => {
|
|
66
|
+
e.stopPropagation();
|
|
67
|
+
removeFile();
|
|
68
|
+
},
|
|
69
|
+
className: "p-1 hover:bg-gray-100 rounded-full",
|
|
70
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4 text-gray-500" })
|
|
71
|
+
})]
|
|
72
|
+
})] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
73
|
+
/* @__PURE__ */ jsx(Upload, { className: "h-8 w-8 text-gray-400" }),
|
|
74
|
+
/* @__PURE__ */ jsx("p", {
|
|
75
|
+
className: "text-sm text-gray-600",
|
|
76
|
+
children: "Drag & drop an image here, or click to select"
|
|
77
|
+
}),
|
|
78
|
+
/* @__PURE__ */ jsx("p", {
|
|
79
|
+
className: "text-xs text-gray-500",
|
|
80
|
+
children: "Supports JPG, PNG, and WebP"
|
|
81
|
+
})
|
|
82
|
+
] })
|
|
83
|
+
})]
|
|
84
|
+
}), selectedFile && /* @__PURE__ */ jsxs("div", {
|
|
85
|
+
className: "mt-4 space-y-4",
|
|
86
|
+
children: [isUploading && /* @__PURE__ */ jsx(Progress, {
|
|
87
|
+
value: uploadProgress,
|
|
88
|
+
className: "h-2 w-full"
|
|
89
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
90
|
+
onClick: uploadFile,
|
|
91
|
+
disabled: isUploading,
|
|
92
|
+
className: "w-full",
|
|
93
|
+
children: isUploading ? "Uploading..." : "Upload File"
|
|
94
|
+
})]
|
|
95
|
+
})]
|
|
96
|
+
});
|
|
63
97
|
}
|
|
98
|
+
//#endregion
|
|
99
|
+
export { FileDropzone };
|
|
100
|
+
|
|
101
|
+
//# sourceMappingURL=FileDropzone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileDropzone.js","names":[],"sources":["../../../src/components/FileDropzone.tsx"],"sourcesContent":["import { File, Upload, X } from \"lucide-react\";\r\nimport { useCallback, useState } from \"react\";\r\nimport { useDropzone } from \"react-dropzone\";\r\nimport { Button } from \"./ui/button\";\r\nimport { Progress } from \"./ui/progress\";\r\nimport { cn } from \"../lib/utils\";\r\n\r\ninterface FileDropzoneProps {\r\n onUploadComplete?: (filePath: string) => void;\r\n className?: string;\r\n}\r\n\r\nexport function FileDropzone({ onUploadComplete, className }: FileDropzoneProps) {\r\n const [uploadProgress, setUploadProgress] = useState(0);\r\n const [selectedFile, setSelectedFile] = useState<File | null>(null);\r\n const [isUploading, setIsUploading] = useState(false);\r\n\r\n const onDrop = useCallback((acceptedFiles: File[]) => {\r\n if (acceptedFiles.length > 0) {\r\n setSelectedFile(acceptedFiles[0]);\r\n }\r\n }, []);\r\n\r\n const { getRootProps, getInputProps, isDragActive } = useDropzone({\r\n onDrop,\r\n accept: {\r\n \"image/jpeg\": [],\r\n \"image/png\": [],\r\n \"image/webp\": [],\r\n \"image/jpg\": [],\r\n },\r\n maxFiles: 1,\r\n });\r\n\r\n const uploadFile = async () => {\r\n if (!selectedFile) return;\r\n\r\n setIsUploading(true);\r\n setUploadProgress(0);\r\n\r\n const formData = new FormData();\r\n formData.append(\"file\", selectedFile);\r\n\r\n try {\r\n const response = await fetch(\"/api/upload/image\", {\r\n method: \"POST\",\r\n body: formData,\r\n // Note: Content-Type is automatically set for FormData\r\n });\r\n\r\n if (!response.ok) {\r\n throw new Error(`HTTP error! status: ${response.status}`);\r\n }\r\n\r\n const data = await response.json();\r\n onUploadComplete?.(data.filePath);\r\n setSelectedFile(null);\r\n setUploadProgress(0);\r\n } catch (error) {\r\n console.error(\"Upload error:\", error);\r\n } finally {\r\n setIsUploading(false);\r\n }\r\n };\r\n\r\n const removeFile = () => {\r\n setSelectedFile(null);\r\n setUploadProgress(0);\r\n };\r\n\r\n return (\r\n <div className={cn(\"w-full max-w-xl\", className)}>\r\n <div\r\n {...getRootProps()}\r\n className={cn(\r\n \"border-2 border-dashed rounded-lg p-6 cursor-pointer transition-colors\",\r\n isDragActive ? \"border-primary bg-primary/5\" : \"border-gray-300 hover:border-primary\",\r\n selectedFile && \"border-primary\"\r\n )}\r\n >\r\n <input {...getInputProps()} />\r\n <div className=\"flex flex-col items-center justify-center space-y-2 text-center\">\r\n {selectedFile ? (\r\n <>\r\n <File className=\"h-8 w-8 text-primary\" />\r\n <div className=\"flex items-center gap-2\">\r\n <span className=\"text-sm text-gray-600\">{selectedFile.name}</span>\r\n <button\r\n type=\"button\"\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n removeFile();\r\n }}\r\n className=\"p-1 hover:bg-gray-100 rounded-full\"\r\n >\r\n <X className=\"h-4 w-4 text-gray-500\" />\r\n </button>\r\n </div>\r\n </>\r\n ) : (\r\n <>\r\n <Upload className=\"h-8 w-8 text-gray-400\" />\r\n <p className=\"text-sm text-gray-600\">Drag & drop an image here, or click to select</p>\r\n <p className=\"text-xs text-gray-500\">Supports JPG, PNG, and WebP</p>\r\n </>\r\n )}\r\n </div>\r\n </div>\r\n\r\n {selectedFile && (\r\n <div className=\"mt-4 space-y-4\">\r\n {isUploading && <Progress value={uploadProgress} className=\"h-2 w-full\" />}\r\n <Button onClick={uploadFile} disabled={isUploading} className=\"w-full\">\r\n {isUploading ? \"Uploading...\" : \"Upload File\"}\r\n </Button>\r\n </div>\r\n )}\r\n </div>\r\n );\r\n}\r\n"],"mappings":";;;;;;;;AAYA,SAAgB,aAAa,EAAE,kBAAkB,aAAgC;CAC/E,MAAM,CAAC,gBAAgB,qBAAqB,SAAS,EAAE;CACvD,MAAM,CAAC,cAAc,mBAAmB,SAAsB,KAAK;CACnE,MAAM,CAAC,aAAa,kBAAkB,SAAS,MAAM;CAQrD,MAAM,EAAE,cAAc,eAAe,iBAAiB,YAAY;EAChE,QAPa,aAAa,kBAA0B;AACpD,OAAI,cAAc,SAAS,EACzB,iBAAgB,cAAc,GAAG;KAElC,EAAE,CAAC;EAIJ,QAAQ;GACN,cAAc,EAAE;GAChB,aAAa,EAAE;GACf,cAAc,EAAE;GAChB,aAAa,EAAE;GAChB;EACD,UAAU;EACX,CAAC;CAEF,MAAM,aAAa,YAAY;AAC7B,MAAI,CAAC,aAAc;AAEnB,iBAAe,KAAK;AACpB,oBAAkB,EAAE;EAEpB,MAAM,WAAW,IAAI,UAAU;AAC/B,WAAS,OAAO,QAAQ,aAAa;AAErC,MAAI;GACF,MAAM,WAAW,MAAM,MAAM,qBAAqB;IAChD,QAAQ;IACR,MAAM;IAEP,CAAC;AAEF,OAAI,CAAC,SAAS,GACZ,OAAM,IAAI,MAAM,uBAAuB,SAAS,SAAS;GAG3D,MAAM,OAAO,MAAM,SAAS,MAAM;AAClC,sBAAmB,KAAK,SAAS;AACjC,mBAAgB,KAAK;AACrB,qBAAkB,EAAE;WACb,OAAO;AACd,WAAQ,MAAM,iBAAiB,MAAM;YAC7B;AACR,kBAAe,MAAM;;;CAIzB,MAAM,mBAAmB;AACvB,kBAAgB,KAAK;AACrB,oBAAkB,EAAE;;AAGtB,QACE,qBAAC,OAAD;EAAK,WAAW,GAAG,mBAAmB,UAAU;YAAhD,CACE,qBAAC,OAAD;GACE,GAAI,cAAc;GAClB,WAAW,GACT,0EACA,eAAe,gCAAgC,wCAC/C,gBAAgB,iBACjB;aANH,CAQE,oBAAC,SAAD,EAAO,GAAI,eAAe,EAAI,CAAA,EAC9B,oBAAC,OAAD;IAAK,WAAU;cACZ,eACC,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,MAAD,EAAM,WAAU,wBAAyB,CAAA,EACzC,qBAAC,OAAD;KAAK,WAAU;eAAf,CACE,oBAAC,QAAD;MAAM,WAAU;gBAAyB,aAAa;MAAY,CAAA,EAClE,oBAAC,UAAD;MACE,MAAK;MACL,UAAU,MAAM;AACd,SAAE,iBAAiB;AACnB,mBAAY;;MAEd,WAAU;gBAEV,oBAAC,GAAD,EAAG,WAAU,yBAA0B,CAAA;MAChC,CAAA,CACL;OACL,EAAA,CAAA,GAEH,qBAAA,YAAA,EAAA,UAAA;KACE,oBAAC,QAAD,EAAQ,WAAU,yBAA0B,CAAA;KAC5C,oBAAC,KAAD;MAAG,WAAU;gBAAwB;MAAiD,CAAA;KACtF,oBAAC,KAAD;MAAG,WAAU;gBAAwB;MAA+B,CAAA;KACnE,EAAA,CAAA;IAED,CAAA,CACF;MAEL,gBACC,qBAAC,OAAD;GAAK,WAAU;aAAf,CACG,eAAe,oBAAC,UAAD;IAAU,OAAO;IAAgB,WAAU;IAAe,CAAA,EAC1E,oBAAC,QAAD;IAAQ,SAAS;IAAY,UAAU;IAAa,WAAU;cAC3D,cAAc,iBAAiB;IACzB,CAAA,CACL;KAEJ"}
|