@mohasinac/appkit 2.1.3 → 2.3.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/README.md +80 -30
- package/dist/index.d.ts +3124 -0
- package/dist/index.js +5836 -0
- package/package.json +67 -383
- package/src/cli/index.ts +0 -221
- package/src/contracts/auth.ts +0 -63
- package/src/contracts/config.ts +0 -58
- package/src/contracts/email.ts +0 -37
- package/src/contracts/extend.ts +0 -195
- package/src/contracts/feature.ts +0 -60
- package/src/contracts/index.ts +0 -122
- package/src/contracts/infra.ts +0 -50
- package/src/contracts/payment.ts +0 -50
- package/src/contracts/registry.ts +0 -44
- package/src/contracts/repository.ts +0 -87
- package/src/contracts/search.ts +0 -49
- package/src/contracts/shipping.ts +0 -77
- package/src/contracts/storage.ts +0 -37
- package/src/contracts/style.ts +0 -25
- package/src/contracts/table.ts +0 -148
- package/src/core/CacheManager.ts +0 -85
- package/src/core/EventBus.ts +0 -89
- package/src/core/Logger.ts +0 -209
- package/src/core/Queue.ts +0 -126
- package/src/core/StorageManager.ts +0 -167
- package/src/core/copilot-log.repository.ts +0 -106
- package/src/core/index.ts +0 -39
- package/src/core/newsletter.repository.ts +0 -193
- package/src/core/site-config.ts +0 -109
- package/src/errors/api-error.ts +0 -7
- package/src/errors/authentication-error.ts +0 -7
- package/src/errors/authorization-error.ts +0 -7
- package/src/errors/base-error.ts +0 -30
- package/src/errors/database-error.ts +0 -7
- package/src/errors/error-codes.ts +0 -106
- package/src/errors/error-handler.ts +0 -74
- package/src/errors/index.ts +0 -11
- package/src/errors/not-found-error.ts +0 -7
- package/src/errors/validation-error.ts +0 -7
- package/src/features/about/components/AboutView.tsx +0 -142
- package/src/features/about/components/index.ts +0 -7
- package/src/features/about/index.ts +0 -7
- package/src/features/account/api/[userId]/addresses/route.ts +0 -131
- package/src/features/account/api/[userId]/route.ts +0 -107
- package/src/features/account/columns/index.ts +0 -61
- package/src/features/account/components/AddressBook.tsx +0 -109
- package/src/features/account/components/BecomeSellerView.tsx +0 -44
- package/src/features/account/components/ChatList.tsx +0 -43
- package/src/features/account/components/ChatWindow.tsx +0 -52
- package/src/features/account/components/MessagesView.tsx +0 -60
- package/src/features/account/components/OrderDetailView.tsx +0 -50
- package/src/features/account/components/ProfileView.tsx +0 -40
- package/src/features/account/components/UserAccountHubView.tsx +0 -40
- package/src/features/account/components/UserAddressesView.tsx +0 -44
- package/src/features/account/components/UserNotificationsView.tsx +0 -52
- package/src/features/account/components/UserOffersView.tsx +0 -37
- package/src/features/account/components/UserOrderTrackView.tsx +0 -36
- package/src/features/account/components/UserOrdersView.tsx +0 -45
- package/src/features/account/components/UserSettingsView.tsx +0 -48
- package/src/features/account/components/index.ts +0 -54
- package/src/features/account/hooks/useAccount.ts +0 -25
- package/src/features/account/index.ts +0 -7
- package/src/features/account/manifest.ts +0 -29
- package/src/features/account/messages/en.json +0 -12
- package/src/features/account/repository/account.repository.ts +0 -28
- package/src/features/account/schemas/index.ts +0 -56
- package/src/features/account/types/index.ts +0 -124
- package/src/features/admin/api/bids/route.ts +0 -63
- package/src/features/admin/api/coupons/route.ts +0 -63
- package/src/features/admin/api/products/route.ts +0 -64
- package/src/features/admin/api/reviews/route.ts +0 -63
- package/src/features/admin/components/AdminAnalyticsView.tsx +0 -124
- package/src/features/admin/components/AdminBidsView.tsx +0 -29
- package/src/features/admin/components/AdminBlogView.tsx +0 -32
- package/src/features/admin/components/AdminCarouselView.tsx +0 -57
- package/src/features/admin/components/AdminCategoriesView.tsx +0 -57
- package/src/features/admin/components/AdminCouponsView.tsx +0 -32
- package/src/features/admin/components/AdminDashboardView.tsx +0 -50
- package/src/features/admin/components/AdminFaqsView.tsx +0 -29
- package/src/features/admin/components/AdminFeatureFlagsView.tsx +0 -33
- package/src/features/admin/components/AdminMediaView.tsx +0 -57
- package/src/features/admin/components/AdminNavigationView.tsx +0 -57
- package/src/features/admin/components/AdminOrdersView.tsx +0 -29
- package/src/features/admin/components/AdminPayoutsView.tsx +0 -29
- package/src/features/admin/components/AdminProductsView.tsx +0 -32
- package/src/features/admin/components/AdminReviewsView.tsx +0 -38
- package/src/features/admin/components/AdminSectionsView.tsx +0 -57
- package/src/features/admin/components/AdminSessionsManager.tsx +0 -28
- package/src/features/admin/components/AdminSidebar.tsx +0 -28
- package/src/features/admin/components/AdminSiteView.tsx +0 -34
- package/src/features/admin/components/AdminStoresView.tsx +0 -29
- package/src/features/admin/components/AdminTopBar.tsx +0 -22
- package/src/features/admin/components/AdminUsersView.tsx +0 -32
- package/src/features/admin/components/DashboardStats.tsx +0 -95
- package/src/features/admin/components/DataTable.tsx +0 -115
- package/src/features/admin/components/DemoSeedView.tsx +0 -22
- package/src/features/admin/components/QuickActionsPanel.tsx +0 -62
- package/src/features/admin/components/analytics/AdminAnalyticsCharts.tsx +0 -114
- package/src/features/admin/components/analytics/AdminStatCard.tsx +0 -36
- package/src/features/admin/components/analytics/AdminTopProductsTable.tsx +0 -61
- package/src/features/admin/components/analytics/index.ts +0 -3
- package/src/features/admin/components/index.ts +0 -71
- package/src/features/admin/hooks/useAdmin.ts +0 -19
- package/src/features/admin/index.ts +0 -5
- package/src/features/admin/manifest.ts +0 -15
- package/src/features/admin/messages/en.json +0 -13
- package/src/features/admin/permission-map.ts +0 -27
- package/src/features/admin/server.ts +0 -10
- package/src/features/admin/types/index.ts +0 -75
- package/src/features/auctions/api/route.ts +0 -83
- package/src/features/auctions/columns/index.ts +0 -91
- package/src/features/auctions/components/AuctionCard.tsx +0 -149
- package/src/features/auctions/components/index.ts +0 -1
- package/src/features/auctions/hooks/useAuctions.ts +0 -145
- package/src/features/auctions/hooks/usePlaceBid.ts +0 -48
- package/src/features/auctions/hooks/useRealtimeBids.ts +0 -100
- package/src/features/auctions/index.ts +0 -9
- package/src/features/auctions/manifest.ts +0 -19
- package/src/features/auctions/messages/en.json +0 -18
- package/src/features/auctions/repository/auctions.repository.ts +0 -57
- package/src/features/auctions/schemas/index.ts +0 -69
- package/src/features/auctions/server.ts +0 -7
- package/src/features/auctions/types/index.ts +0 -90
- package/src/features/auth/api/route.ts +0 -63
- package/src/features/auth/components/AuthStatusPanel.tsx +0 -67
- package/src/features/auth/components/ForgotPasswordView.tsx +0 -114
- package/src/features/auth/components/Guards.tsx +0 -60
- package/src/features/auth/components/LoginForm.tsx +0 -180
- package/src/features/auth/components/RegisterForm.tsx +0 -232
- package/src/features/auth/components/ResetPasswordView.tsx +0 -144
- package/src/features/auth/components/SocialAuthButtons.tsx +0 -60
- package/src/features/auth/components/VerifyEmailView.tsx +0 -118
- package/src/features/auth/components/index.ts +0 -13
- package/src/features/auth/hooks/useAuth.ts +0 -33
- package/src/features/auth/index.ts +0 -5
- package/src/features/auth/manifest.ts +0 -23
- package/src/features/auth/messages/en.json +0 -13
- package/src/features/auth/schemas/index.ts +0 -48
- package/src/features/auth/server.ts +0 -17
- package/src/features/auth/types/index.ts +0 -36
- package/src/features/before-after/api/[id]/route.ts +0 -143
- package/src/features/before-after/api/route.ts +0 -104
- package/src/features/before-after/columns/index.ts +0 -72
- package/src/features/before-after/components/BeforeAfterGallery.tsx +0 -41
- package/src/features/before-after/components/BeforeAfterSlider.tsx +0 -89
- package/src/features/before-after/components/index.ts +0 -2
- package/src/features/before-after/hooks/useBeforeAfter.ts +0 -33
- package/src/features/before-after/index.ts +0 -7
- package/src/features/before-after/manifest.ts +0 -12
- package/src/features/before-after/messages/en.json +0 -8
- package/src/features/before-after/repository/before-after.repository.ts +0 -44
- package/src/features/before-after/schemas/index.ts +0 -25
- package/src/features/before-after/types/index.ts +0 -19
- package/src/features/blog/api/[slug]/route.ts +0 -73
- package/src/features/blog/api/route.ts +0 -81
- package/src/features/blog/columns/index.ts +0 -68
- package/src/features/blog/components/BlogFeaturedCard.tsx +0 -108
- package/src/features/blog/components/BlogListView.tsx +0 -219
- package/src/features/blog/components/BlogPostForm.tsx +0 -254
- package/src/features/blog/components/BlogPostView.tsx +0 -221
- package/src/features/blog/components/index.ts +0 -12
- package/src/features/blog/hooks/useBlog.ts +0 -67
- package/src/features/blog/index.ts +0 -7
- package/src/features/blog/manifest.ts +0 -16
- package/src/features/blog/messages/en.json +0 -14
- package/src/features/blog/repository/blog.repository.ts +0 -73
- package/src/features/blog/schemas/index.ts +0 -74
- package/src/features/blog/server.ts +0 -9
- package/src/features/blog/types/index.ts +0 -58
- package/src/features/cart/api/[id]/route.ts +0 -98
- package/src/features/cart/api/route.ts +0 -104
- package/src/features/cart/columns/index.ts +0 -73
- package/src/features/cart/components/CartDrawer.tsx +0 -183
- package/src/features/cart/components/CartSummary.tsx +0 -43
- package/src/features/cart/components/CartView.tsx +0 -47
- package/src/features/cart/components/CheckoutAddressStep.tsx +0 -68
- package/src/features/cart/components/CheckoutOtpModal.tsx +0 -39
- package/src/features/cart/components/CheckoutSuccessView.tsx +0 -31
- package/src/features/cart/components/CheckoutView.tsx +0 -70
- package/src/features/cart/components/index.ts +0 -16
- package/src/features/cart/hooks/useCart.ts +0 -30
- package/src/features/cart/hooks/useCartQuery.ts +0 -22
- package/src/features/cart/hooks/useCheckoutReadQueries.ts +0 -34
- package/src/features/cart/hooks/useOrder.ts +0 -35
- package/src/features/cart/index.ts +0 -11
- package/src/features/cart/manifest.ts +0 -12
- package/src/features/cart/messages/en.json +0 -10
- package/src/features/cart/repository/cart.repository.ts +0 -50
- package/src/features/cart/schemas/index.ts +0 -36
- package/src/features/cart/types/index.ts +0 -29
- package/src/features/cart/utils/guest-cart.ts +0 -149
- package/src/features/categories/api/[id]/route.ts +0 -144
- package/src/features/categories/api/route.ts +0 -253
- package/src/features/categories/columns/index.ts +0 -51
- package/src/features/categories/components/BreadcrumbTrail.tsx +0 -80
- package/src/features/categories/components/CategoriesListView.tsx +0 -77
- package/src/features/categories/components/CategoryGrid.tsx +0 -93
- package/src/features/categories/components/CategoryProductsView.tsx +0 -116
- package/src/features/categories/components/CategoryTree.tsx +0 -156
- package/src/features/categories/components/ConcernCard.tsx +0 -45
- package/src/features/categories/components/ConcernGrid.tsx +0 -25
- package/src/features/categories/components/index.ts +0 -17
- package/src/features/categories/hooks/useCategories.ts +0 -72
- package/src/features/categories/index.ts +0 -7
- package/src/features/categories/manifest.ts +0 -22
- package/src/features/categories/messages/en.json +0 -14
- package/src/features/categories/repository/categories.repository.ts +0 -76
- package/src/features/categories/schemas/index.ts +0 -74
- package/src/features/categories/server.ts +0 -12
- package/src/features/categories/types/index.ts +0 -60
- package/src/features/checkout/components/CheckoutStepper.tsx +0 -45
- package/src/features/checkout/components/index.ts +0 -1
- package/src/features/checkout/hooks/useCheckout.ts +0 -38
- package/src/features/checkout/index.ts +0 -4
- package/src/features/checkout/manifest.ts +0 -19
- package/src/features/checkout/messages/en.json +0 -10
- package/src/features/checkout/types/index.ts +0 -62
- package/src/features/cms/index.ts +0 -6
- package/src/features/collections/api/[slug]/route.ts +0 -167
- package/src/features/collections/api/route.ts +0 -104
- package/src/features/collections/columns/index.ts +0 -77
- package/src/features/collections/components/CollectionCard.tsx +0 -61
- package/src/features/collections/components/index.ts +0 -1
- package/src/features/collections/hooks/useCollections.ts +0 -31
- package/src/features/collections/index.ts +0 -7
- package/src/features/collections/manifest.ts +0 -18
- package/src/features/collections/messages/en.json +0 -10
- package/src/features/collections/repository/collections.repository.ts +0 -19
- package/src/features/collections/schemas/index.ts +0 -36
- package/src/features/collections/types/index.ts +0 -26
- package/src/features/consultation/api/[id]/route.ts +0 -143
- package/src/features/consultation/api/route.ts +0 -104
- package/src/features/consultation/columns/index.ts +0 -76
- package/src/features/consultation/components/ConsultationForm.tsx +0 -161
- package/src/features/consultation/components/index.ts +0 -1
- package/src/features/consultation/hooks/useBookConsultation.ts +0 -19
- package/src/features/consultation/index.ts +0 -7
- package/src/features/consultation/manifest.ts +0 -14
- package/src/features/consultation/messages/en.json +0 -25
- package/src/features/consultation/repository/consultations.repository.ts +0 -35
- package/src/features/consultation/schemas/index.ts +0 -51
- package/src/features/consultation/types/index.ts +0 -36
- package/src/features/contact/components/ContactForm.tsx +0 -202
- package/src/features/contact/components/ContactInfoSidebar.tsx +0 -85
- package/src/features/contact/components/index.ts +0 -7
- package/src/features/contact/index.ts +0 -1
- package/src/features/copilot/components/AdminCopilotView.tsx +0 -157
- package/src/features/copilot/components/index.ts +0 -2
- package/src/features/copilot/hooks/useCopilotChat.ts +0 -86
- package/src/features/copilot/index.ts +0 -2
- package/src/features/corporate/api/[id]/route.ts +0 -149
- package/src/features/corporate/api/route.ts +0 -108
- package/src/features/corporate/columns/index.ts +0 -76
- package/src/features/corporate/components/CorporateInquiryForm.tsx +0 -155
- package/src/features/corporate/components/index.ts +0 -1
- package/src/features/corporate/hooks/useSubmitCorporateInquiry.ts +0 -19
- package/src/features/corporate/index.ts +0 -7
- package/src/features/corporate/manifest.ts +0 -14
- package/src/features/corporate/messages/en.json +0 -26
- package/src/features/corporate/repository/corporate.repository.ts +0 -39
- package/src/features/corporate/schemas/index.ts +0 -53
- package/src/features/corporate/types/index.ts +0 -40
- package/src/features/cron/firebase-adapters.ts +0 -117
- package/src/features/cron/index.ts +0 -28
- package/src/features/cron/jobs/auction-expiry.job.ts +0 -76
- package/src/features/cron/jobs/preorder-reminder.job.ts +0 -64
- package/src/features/cron/registry.ts +0 -115
- package/src/features/cron/types.ts +0 -83
- package/src/features/events/api/[id]/route.ts +0 -123
- package/src/features/events/api/route.ts +0 -110
- package/src/features/events/columns/index.ts +0 -54
- package/src/features/events/components/AdminEventEntriesView.tsx +0 -39
- package/src/features/events/components/AdminEventsView.tsx +0 -47
- package/src/features/events/components/EventCard.tsx +0 -88
- package/src/features/events/components/EventDetailView.tsx +0 -51
- package/src/features/events/components/EventFormDrawer.tsx +0 -47
- package/src/features/events/components/EventLeaderboard.tsx +0 -76
- package/src/features/events/components/EventParticipateView.tsx +0 -48
- package/src/features/events/components/EventStatusBadge.tsx +0 -28
- package/src/features/events/components/EventsListView.tsx +0 -100
- package/src/features/events/components/index.ts +0 -15
- package/src/features/events/hooks/useEvent.ts +0 -94
- package/src/features/events/hooks/useEvents.ts +0 -59
- package/src/features/events/index.ts +0 -11
- package/src/features/events/manifest.ts +0 -26
- package/src/features/events/messages/en.json +0 -28
- package/src/features/events/repository/events.repository.ts +0 -110
- package/src/features/events/schemas/index.ts +0 -98
- package/src/features/events/server.ts +0 -8
- package/src/features/events/types/index.ts +0 -185
- package/src/features/faq/api/route.ts +0 -61
- package/src/features/faq/columns/index.ts +0 -60
- package/src/features/faq/components/ContactCTA.tsx +0 -115
- package/src/features/faq/components/FAQAccordion.tsx +0 -150
- package/src/features/faq/components/FAQCategorySidebar.tsx +0 -124
- package/src/features/faq/components/FAQHelpfulButtons.tsx +0 -110
- package/src/features/faq/components/FAQPageContent.tsx +0 -217
- package/src/features/faq/components/FAQSortDropdown.tsx +0 -43
- package/src/features/faq/components/RelatedFAQs.tsx +0 -74
- package/src/features/faq/components/index.ts +0 -9
- package/src/features/faq/hooks/useFAQs.ts +0 -50
- package/src/features/faq/hooks/useFaqList.ts +0 -53
- package/src/features/faq/index.ts +0 -8
- package/src/features/faq/manifest.ts +0 -12
- package/src/features/faq/messages/en.json +0 -14
- package/src/features/faq/repository/faqs.repository.ts +0 -61
- package/src/features/faq/schemas/index.ts +0 -69
- package/src/features/faq/server.ts +0 -7
- package/src/features/faq/types/index.ts +0 -63
- package/src/features/filters/FilterFacetSection.tsx +0 -205
- package/src/features/filters/FilterPanel.tsx +0 -227
- package/src/features/filters/RangeFilter.tsx +0 -291
- package/src/features/filters/SwitchFilter.tsx +0 -143
- package/src/features/filters/filterUtils.ts +0 -24
- package/src/features/filters/index.ts +0 -28
- package/src/features/forms/Checkbox.tsx +0 -100
- package/src/features/forms/Form.tsx +0 -105
- package/src/features/forms/Input.tsx +0 -127
- package/src/features/forms/Radio.tsx +0 -126
- package/src/features/forms/Select.tsx +0 -101
- package/src/features/forms/Slider.tsx +0 -119
- package/src/features/forms/Textarea.tsx +0 -99
- package/src/features/forms/Toggle.tsx +0 -110
- package/src/features/forms/index.ts +0 -34
- package/src/features/forms/utils.ts +0 -25
- package/src/features/homepage/api/[id]/route.ts +0 -145
- package/src/features/homepage/api/carousel/[id]/route.ts +0 -169
- package/src/features/homepage/api/carousel/route.ts +0 -188
- package/src/features/homepage/api/route.ts +0 -167
- package/src/features/homepage/api/sections/[id]/route.ts +0 -143
- package/src/features/homepage/api/sections/route.ts +0 -104
- package/src/features/homepage/components/AdvertisementBanner.tsx +0 -202
- package/src/features/homepage/components/BeforeAfterCard.tsx +0 -147
- package/src/features/homepage/components/CharacterHotspot.tsx +0 -742
- package/src/features/homepage/components/CharacterHotspotForm.tsx +0 -1002
- package/src/features/homepage/components/CustomerReviewsSection.tsx +0 -108
- package/src/features/homepage/components/FAQSection.tsx +0 -154
- package/src/features/homepage/components/FeaturedResultsSection.tsx +0 -97
- package/src/features/homepage/components/HeroBanner.tsx +0 -283
- package/src/features/homepage/components/HeroCarousel.tsx +0 -442
- package/src/features/homepage/components/HeroSection.tsx +0 -50
- package/src/features/homepage/components/HomepageSkeleton.tsx +0 -88
- package/src/features/homepage/components/HomepageView.tsx +0 -77
- package/src/features/homepage/components/HowItWorksInfoView.tsx +0 -161
- package/src/features/homepage/components/HowItWorksSection.tsx +0 -194
- package/src/features/homepage/components/NewsletterBanner.tsx +0 -130
- package/src/features/homepage/components/NewsletterSection.tsx +0 -85
- package/src/features/homepage/components/PromoGrid.tsx +0 -130
- package/src/features/homepage/components/SectionCarousel.tsx +0 -284
- package/src/features/homepage/components/SecurityHighlightsSection.tsx +0 -149
- package/src/features/homepage/components/SiteFeaturesSection.tsx +0 -86
- package/src/features/homepage/components/StatsCounterSection.tsx +0 -118
- package/src/features/homepage/components/TestimonialsCarousel.tsx +0 -96
- package/src/features/homepage/components/TrustBadges.tsx +0 -155
- package/src/features/homepage/components/TrustFeaturesSection.tsx +0 -168
- package/src/features/homepage/components/TrustIndicatorsSection.tsx +0 -59
- package/src/features/homepage/components/WelcomeSection.tsx +0 -178
- package/src/features/homepage/components/WhatsAppCommunitySection.tsx +0 -187
- package/src/features/homepage/components/index.ts +0 -91
- package/src/features/homepage/hooks/useBlogArticles.ts +0 -46
- package/src/features/homepage/hooks/useFeaturedAuctions.ts +0 -39
- package/src/features/homepage/hooks/useFeaturedPreOrders.ts +0 -39
- package/src/features/homepage/hooks/useFeaturedProducts.ts +0 -44
- package/src/features/homepage/hooks/useHeroCarousel.ts +0 -19
- package/src/features/homepage/hooks/useHomepage.ts +0 -25
- package/src/features/homepage/hooks/useTopBrands.ts +0 -17
- package/src/features/homepage/hooks/useTopCategories.ts +0 -19
- package/src/features/homepage/index.ts +0 -10
- package/src/features/homepage/manifest.ts +0 -16
- package/src/features/homepage/messages/en.json +0 -6
- package/src/features/homepage/repository/homepage.repository.ts +0 -38
- package/src/features/homepage/server.ts +0 -14
- package/src/features/homepage/types/index.ts +0 -183
- package/src/features/layout/AutoBreadcrumbs.tsx +0 -143
- package/src/features/layout/BackToTop.tsx +0 -58
- package/src/features/layout/BottomNavItem.tsx +0 -71
- package/src/features/layout/BottomNavLayout.tsx +0 -34
- package/src/features/layout/BottomSheet.tsx +0 -120
- package/src/features/layout/Breadcrumbs.tsx +0 -83
- package/src/features/layout/FooterLayout.tsx +0 -215
- package/src/features/layout/ListingLayout.tsx +0 -383
- package/src/features/layout/LocaleSwitcher.tsx +0 -44
- package/src/features/layout/NavbarLayout.tsx +0 -108
- package/src/features/layout/SidebarLayout.tsx +0 -75
- package/src/features/layout/TitleBarLayout.tsx +0 -285
- package/src/features/layout/index.ts +0 -46
- package/src/features/loyalty/api/admin/loyalty/grant/route.ts +0 -51
- package/src/features/loyalty/api/balance/route.ts +0 -53
- package/src/features/loyalty/api/earn/route.ts +0 -51
- package/src/features/loyalty/api/history/route.ts +0 -74
- package/src/features/loyalty/api/redeem/route.ts +0 -51
- package/src/features/loyalty/columns/index.ts +0 -61
- package/src/features/loyalty/components/CoinsDisplay.tsx +0 -36
- package/src/features/loyalty/components/index.ts +0 -1
- package/src/features/loyalty/hooks/useLoyaltyBalance.ts +0 -17
- package/src/features/loyalty/index.ts +0 -7
- package/src/features/loyalty/manifest.ts +0 -18
- package/src/features/loyalty/messages/en.json +0 -19
- package/src/features/loyalty/repository/loyalty.repository.ts +0 -29
- package/src/features/loyalty/schemas/index.ts +0 -44
- package/src/features/loyalty/types/index.ts +0 -43
- package/src/features/loyalty/types/loyalty-math.ts +0 -36
- package/src/features/media/MediaAvatar.tsx +0 -37
- package/src/features/media/MediaImage.tsx +0 -119
- package/src/features/media/MediaLightbox.tsx +0 -520
- package/src/features/media/MediaVideo.tsx +0 -94
- package/src/features/media/components/MediaSlider.tsx +0 -53
- package/src/features/media/hooks/useMedia.ts +0 -118
- package/src/features/media/index.ts +0 -74
- package/src/features/media/messages/en.json +0 -63
- package/src/features/media/modals/ImageCropModal.tsx +0 -270
- package/src/features/media/modals/VideoThumbnailSelector.tsx +0 -117
- package/src/features/media/modals/VideoTrimModal.tsx +0 -193
- package/src/features/media/types/index.ts +0 -69
- package/src/features/media/upload/CameraCapture.tsx +0 -150
- package/src/features/media/upload/ImageUpload.tsx +0 -358
- package/src/features/media/upload/MediaUploadField.tsx +0 -442
- package/src/features/media/upload/MediaUploadList.tsx +0 -255
- package/src/features/orders/columns/index.ts +0 -47
- package/src/features/orders/components/OrdersList.tsx +0 -168
- package/src/features/orders/components/index.ts +0 -1
- package/src/features/orders/hooks/useOrders.ts +0 -53
- package/src/features/orders/index.ts +0 -8
- package/src/features/orders/manifest.ts +0 -20
- package/src/features/orders/messages/en.json +0 -15
- package/src/features/orders/repository/orders.repository.ts +0 -47
- package/src/features/orders/schemas/index.ts +0 -82
- package/src/features/orders/types/index.ts +0 -97
- package/src/features/orders/utils/order-splitter.ts +0 -48
- package/src/features/payments/columns/index.ts +0 -67
- package/src/features/payments/components/index.ts +0 -1
- package/src/features/payments/hooks/usePayments.ts +0 -23
- package/src/features/payments/index.ts +0 -6
- package/src/features/payments/manifest.ts +0 -14
- package/src/features/payments/messages/en.json +0 -11
- package/src/features/payments/repository/payments.repository.ts +0 -57
- package/src/features/payments/schemas/index.ts +0 -47
- package/src/features/payments/types/index.ts +0 -50
- package/src/features/pre-orders/api/[id]/route.ts +0 -143
- package/src/features/pre-orders/api/[slug]/route.ts +0 -61
- package/src/features/pre-orders/api/admin/[id]/route.ts +0 -105
- package/src/features/pre-orders/api/admin/route.ts +0 -69
- package/src/features/pre-orders/api/route.ts +0 -96
- package/src/features/pre-orders/columns/index.ts +0 -90
- package/src/features/pre-orders/components/PreOrderBadge.tsx +0 -52
- package/src/features/pre-orders/components/PreorderCard.tsx +0 -90
- package/src/features/pre-orders/components/index.ts +0 -1
- package/src/features/pre-orders/hooks/usePreOrders.ts +0 -31
- package/src/features/pre-orders/index.ts +0 -7
- package/src/features/pre-orders/manifest.ts +0 -19
- package/src/features/pre-orders/messages/en.json +0 -13
- package/src/features/pre-orders/repository/pre-orders.repository.ts +0 -75
- package/src/features/pre-orders/repository/preorders.repository.ts +0 -24
- package/src/features/pre-orders/schemas/index.ts +0 -28
- package/src/features/pre-orders/server.ts +0 -12
- package/src/features/pre-orders/types/index.ts +0 -49
- package/src/features/products/api/[id]/route.ts +0 -200
- package/src/features/products/api/route.ts +0 -242
- package/src/features/products/columns/index.ts +0 -90
- package/src/features/products/components/AuctionDetailView.tsx +0 -58
- package/src/features/products/components/AuctionsView.tsx +0 -48
- package/src/features/products/components/BidHistory.tsx +0 -83
- package/src/features/products/components/BuyBar.tsx +0 -36
- package/src/features/products/components/MakeOfferForm.tsx +0 -43
- package/src/features/products/components/PlaceBidForm.tsx +0 -42
- package/src/features/products/components/PreOrderDetailView.tsx +0 -50
- package/src/features/products/components/PreOrdersView.tsx +0 -39
- package/src/features/products/components/ProductDetailView.tsx +0 -52
- package/src/features/products/components/ProductFeatureBadges.tsx +0 -192
- package/src/features/products/components/ProductGrid.tsx +0 -424
- package/src/features/products/components/ProductInfo.tsx +0 -44
- package/src/features/products/components/ProductTabs.tsx +0 -84
- package/src/features/products/components/ProductsView.tsx +0 -48
- package/src/features/products/components/RelatedProducts.tsx +0 -51
- package/src/features/products/components/index.ts +0 -28
- package/src/features/products/hooks/useProductDetail.ts +0 -44
- package/src/features/products/hooks/useProducts.ts +0 -112
- package/src/features/products/index.ts +0 -9
- package/src/features/products/manifest.ts +0 -18
- package/src/features/products/messages/en.json +0 -11
- package/src/features/products/repository/products.repository.ts +0 -83
- package/src/features/products/schemas/index.ts +0 -185
- package/src/features/products/server.ts +0 -12
- package/src/features/products/types/index.ts +0 -142
- package/src/features/products/utils/listing-type.ts +0 -12
- package/src/features/promotions/api/route.ts +0 -105
- package/src/features/promotions/columns/index.ts +0 -60
- package/src/features/promotions/components/CouponCard.tsx +0 -79
- package/src/features/promotions/components/PromotionsView.tsx +0 -129
- package/src/features/promotions/components/index.ts +0 -7
- package/src/features/promotions/hooks/usePromotions.ts +0 -59
- package/src/features/promotions/index.ts +0 -7
- package/src/features/promotions/manifest.ts +0 -16
- package/src/features/promotions/messages/en.json +0 -20
- package/src/features/promotions/repository/promotions.repository.ts +0 -62
- package/src/features/promotions/schemas/index.ts +0 -63
- package/src/features/promotions/server.ts +0 -7
- package/src/features/promotions/types/index.ts +0 -65
- package/src/features/reviews/api/[id]/route.ts +0 -163
- package/src/features/reviews/api/route.ts +0 -216
- package/src/features/reviews/columns/index.ts +0 -57
- package/src/features/reviews/components/ReviewModal.tsx +0 -133
- package/src/features/reviews/components/ReviewSummary.tsx +0 -82
- package/src/features/reviews/components/ReviewsList.tsx +0 -182
- package/src/features/reviews/components/ReviewsListView.tsx +0 -100
- package/src/features/reviews/components/index.ts +0 -11
- package/src/features/reviews/hooks/useReviews.ts +0 -67
- package/src/features/reviews/index.ts +0 -7
- package/src/features/reviews/manifest.ts +0 -12
- package/src/features/reviews/messages/en.json +0 -10
- package/src/features/reviews/repository/reviews.repository.ts +0 -69
- package/src/features/reviews/schemas/index.ts +0 -74
- package/src/features/reviews/server.ts +0 -12
- package/src/features/reviews/types/index.ts +0 -68
- package/src/features/search/api/route.ts +0 -100
- package/src/features/search/columns/index.ts +0 -70
- package/src/features/search/components/SearchFiltersRow.tsx +0 -118
- package/src/features/search/components/SearchResultsSection.tsx +0 -195
- package/src/features/search/components/SearchView.tsx +0 -99
- package/src/features/search/components/index.ts +0 -6
- package/src/features/search/hooks/useSearch.ts +0 -41
- package/src/features/search/index.ts +0 -7
- package/src/features/search/manifest.ts +0 -12
- package/src/features/search/messages/en.json +0 -15
- package/src/features/search/repository/search.repository.ts +0 -64
- package/src/features/search/schemas/index.ts +0 -36
- package/src/features/search/server.ts +0 -3
- package/src/features/search/types/index.ts +0 -59
- package/src/features/seller/api/coupons/route.ts +0 -57
- package/src/features/seller/api/offers/route.ts +0 -73
- package/src/features/seller/api/products/route.ts +0 -75
- package/src/features/seller/api/store/route.ts +0 -41
- package/src/features/seller/columns/index.ts +0 -103
- package/src/features/seller/components/SellerAddressesView.tsx +0 -32
- package/src/features/seller/components/SellerAnalyticsView.tsx +0 -38
- package/src/features/seller/components/SellerAuctionsView.tsx +0 -48
- package/src/features/seller/components/SellerCouponsView.tsx +0 -48
- package/src/features/seller/components/SellerCreateProductView.tsx +0 -27
- package/src/features/seller/components/SellerDashboardView.tsx +0 -41
- package/src/features/seller/components/SellerEditProductView.tsx +0 -27
- package/src/features/seller/components/SellerGuideView.tsx +0 -34
- package/src/features/seller/components/SellerOffersView.tsx +0 -46
- package/src/features/seller/components/SellerOrdersView.tsx +0 -46
- package/src/features/seller/components/SellerPayoutHistoryTable.tsx +0 -44
- package/src/features/seller/components/SellerPayoutSettingsView.tsx +0 -27
- package/src/features/seller/components/SellerPayoutStats.tsx +0 -24
- package/src/features/seller/components/SellerPayoutsView.tsx +0 -46
- package/src/features/seller/components/SellerProductsView.tsx +0 -51
- package/src/features/seller/components/SellerShippingView.tsx +0 -30
- package/src/features/seller/components/SellerSidebar.tsx +0 -84
- package/src/features/seller/components/SellerStatCard.tsx +0 -44
- package/src/features/seller/components/SellerStoreSetupView.tsx +0 -31
- package/src/features/seller/components/SellerStoreView.tsx +0 -27
- package/src/features/seller/components/SellerStorefrontView.tsx +0 -49
- package/src/features/seller/components/SellersListView.tsx +0 -43
- package/src/features/seller/components/analytics/SellerAnalyticsStats.tsx +0 -87
- package/src/features/seller/components/analytics/SellerRevenueChart.tsx +0 -99
- package/src/features/seller/components/analytics/SellerTopProducts.tsx +0 -76
- package/src/features/seller/components/analytics/index.ts +0 -3
- package/src/features/seller/components/index.ts +0 -47
- package/src/features/seller/hooks/useSellerPayouts.ts +0 -51
- package/src/features/seller/hooks/useSellerStore.ts +0 -60
- package/src/features/seller/index.ts +0 -12
- package/src/features/seller/manifest.ts +0 -76
- package/src/features/seller/messages/en.json +0 -32
- package/src/features/seller/permission-map.ts +0 -18
- package/src/features/seller/repository/seller.repository.ts +0 -100
- package/src/features/seller/schemas/index.ts +0 -113
- package/src/features/seller/server.ts +0 -10
- package/src/features/seller/types/index.ts +0 -185
- package/src/features/stores/api/[storeSlug]/auctions/route.ts +0 -134
- package/src/features/stores/api/[storeSlug]/products/route.ts +0 -139
- package/src/features/stores/api/[storeSlug]/reviews/route.ts +0 -155
- package/src/features/stores/api/[storeSlug]/route.ts +0 -120
- package/src/features/stores/api/route.ts +0 -128
- package/src/features/stores/columns/index.ts +0 -58
- package/src/features/stores/components/StoreAboutView.tsx +0 -134
- package/src/features/stores/components/StoreAuctionsView.tsx +0 -46
- package/src/features/stores/components/StoreHeader.tsx +0 -115
- package/src/features/stores/components/StoreNavTabs.tsx +0 -77
- package/src/features/stores/components/StoreProductsView.tsx +0 -77
- package/src/features/stores/components/StoreReviewsView.tsx +0 -45
- package/src/features/stores/components/StoresListView.tsx +0 -142
- package/src/features/stores/components/index.ts +0 -12
- package/src/features/stores/hooks/useStores.ts +0 -130
- package/src/features/stores/index.ts +0 -7
- package/src/features/stores/manifest.ts +0 -37
- package/src/features/stores/messages/en.json +0 -21
- package/src/features/stores/repository/stores.repository.ts +0 -51
- package/src/features/stores/schemas/index.ts +0 -42
- package/src/features/stores/server.ts +0 -11
- package/src/features/stores/types/index.ts +0 -123
- package/src/features/user/components/BecomeSellerView.tsx +0 -36
- package/src/features/user/components/MessagesView.tsx +0 -37
- package/src/features/user/components/OrderDetailView.tsx +0 -36
- package/src/features/user/components/ProfileView.tsx +0 -33
- package/src/features/user/components/UserAccountHub.tsx +0 -30
- package/src/features/user/components/UserAddressesView.tsx +0 -32
- package/src/features/user/components/UserNotificationsView.tsx +0 -38
- package/src/features/user/components/UserOffersView.tsx +0 -35
- package/src/features/user/components/UserOrdersView.tsx +0 -39
- package/src/features/user/components/UserSettingsView.tsx +0 -31
- package/src/features/user/components/UserSidebar.tsx +0 -27
- package/src/features/user/components/index.ts +0 -22
- package/src/features/user/index.ts +0 -1
- package/src/features/whatsapp-bot/api/send-status/route.ts +0 -48
- package/src/features/whatsapp-bot/api/webhook/route.ts +0 -55
- package/src/features/whatsapp-bot/components/WhatsAppChatButton.tsx +0 -38
- package/src/features/whatsapp-bot/components/index.ts +0 -1
- package/src/features/whatsapp-bot/helpers/whatsapp.ts +0 -137
- package/src/features/whatsapp-bot/index.ts +0 -4
- package/src/features/whatsapp-bot/manifest.ts +0 -15
- package/src/features/whatsapp-bot/messages/en.json +0 -7
- package/src/features/whatsapp-bot/types/index.ts +0 -61
- package/src/features/wishlist/columns/index.ts +0 -65
- package/src/features/wishlist/components/WishlistPage.tsx +0 -118
- package/src/features/wishlist/components/WishlistToggleButton.tsx +0 -68
- package/src/features/wishlist/components/WishlistView.tsx +0 -150
- package/src/features/wishlist/components/index.ts +0 -4
- package/src/features/wishlist/hooks/useUserWishlist.ts +0 -39
- package/src/features/wishlist/hooks/useWishlist.ts +0 -31
- package/src/features/wishlist/index.ts +0 -8
- package/src/features/wishlist/manifest.ts +0 -14
- package/src/features/wishlist/messages/en.json +0 -7
- package/src/features/wishlist/repository/wishlist.repository.ts +0 -43
- package/src/features/wishlist/schemas/index.ts +0 -25
- package/src/features/wishlist/types/index.ts +0 -17
- package/src/http/ApiClient.ts +0 -247
- package/src/http/index.ts +0 -10
- package/src/index.ts +0 -22
- package/src/instrumentation/index.ts +0 -77
- package/src/monitoring/cache-metrics.ts +0 -105
- package/src/monitoring/client-logger.ts +0 -83
- package/src/monitoring/error-tracking.ts +0 -115
- package/src/monitoring/index.ts +0 -52
- package/src/monitoring/performance.ts +0 -64
- package/src/monitoring/runtime.ts +0 -33
- package/src/monitoring/server-logger.ts +0 -93
- package/src/next/IAuthVerifier.ts +0 -56
- package/src/next/api/api-response.ts +0 -72
- package/src/next/api/apiHandler.ts +0 -178
- package/src/next/api/errorHandler.ts +0 -125
- package/src/next/api/routeHandler.ts +0 -175
- package/src/next/cache-middleware.ts +0 -112
- package/src/next/components/ErrorView.tsx +0 -73
- package/src/next/components/GlobalError.tsx +0 -75
- package/src/next/components/NotFoundView.tsx +0 -56
- package/src/next/components/UnauthorizedView.tsx +0 -61
- package/src/next/index.ts +0 -82
- package/src/next/middleware/chain.ts +0 -117
- package/src/next/middleware/index.ts +0 -14
- package/src/next/middleware/pii-redactor.ts +0 -112
- package/src/next/middleware/pii-scrubber.ts +0 -56
- package/src/next/middleware/types.ts +0 -26
- package/src/next/request-helpers.ts +0 -76
- package/src/next/routing/route-map.ts +0 -221
- package/src/providers/auth-firebase/browser-stub.ts +0 -32
- package/src/providers/auth-firebase/helpers.ts +0 -150
- package/src/providers/auth-firebase/index.ts +0 -26
- package/src/providers/auth-firebase/provider.ts +0 -163
- package/src/providers/auth-firebase/session.ts +0 -111
- package/src/providers/db-firebase/admin-app-lite.ts +0 -66
- package/src/providers/db-firebase/admin-auth-lite.ts +0 -16
- package/src/providers/db-firebase/admin-storage-lite.ts +0 -19
- package/src/providers/db-firebase/admin.ts +0 -217
- package/src/providers/db-firebase/base.ts +0 -243
- package/src/providers/db-firebase/browser-stub.ts +0 -47
- package/src/providers/db-firebase/helpers.ts +0 -88
- package/src/providers/db-firebase/index.ts +0 -60
- package/src/providers/db-firebase/realtime.ts +0 -185
- package/src/providers/db-firebase/sieve.ts +0 -136
- package/src/providers/email-resend/index.ts +0 -16
- package/src/providers/email-resend/provider.ts +0 -103
- package/src/providers/payment-razorpay/index.ts +0 -165
- package/src/providers/shipping-shiprocket/index.ts +0 -402
- package/src/providers/storage-firebase/index.ts +0 -17
- package/src/providers/storage-firebase/provider.ts +0 -131
- package/src/react/ErrorBoundary.tsx +0 -130
- package/src/react/hooks/useBreakpoint.ts +0 -41
- package/src/react/hooks/useBulkAction.ts +0 -161
- package/src/react/hooks/useBulkSelection.ts +0 -119
- package/src/react/hooks/useCamera.ts +0 -191
- package/src/react/hooks/useClickOutside.ts +0 -87
- package/src/react/hooks/useContainerGrid.ts +0 -77
- package/src/react/hooks/useCountdown.ts +0 -73
- package/src/react/hooks/useGesture.ts +0 -255
- package/src/react/hooks/useKeyPress.ts +0 -113
- package/src/react/hooks/useLongPress.ts +0 -62
- package/src/react/hooks/useMediaQuery.ts +0 -40
- package/src/react/hooks/usePendingFilters.ts +0 -138
- package/src/react/hooks/usePendingTable.ts +0 -84
- package/src/react/hooks/usePullToRefresh.ts +0 -111
- package/src/react/hooks/useSwipe.ts +0 -240
- package/src/react/hooks/useUnsavedChanges.ts +0 -104
- package/src/react/hooks/useUrlTable.ts +0 -189
- package/src/react/hooks/useVisibleItems.ts +0 -110
- package/src/react/index.ts +0 -99
- package/src/react/useModalStack.ts +0 -86
- package/src/security/authorization.ts +0 -92
- package/src/security/csp.ts +0 -44
- package/src/security/index.ts +0 -50
- package/src/security/pii-encrypt.ts +0 -117
- package/src/security/pii-redact.ts +0 -133
- package/src/security/rate-limit.ts +0 -170
- package/src/security/rbac/Can.tsx +0 -50
- package/src/security/rbac/default-roles.ts +0 -86
- package/src/security/rbac/hook.ts +0 -55
- package/src/security/rbac/index.ts +0 -14
- package/src/security/rbac/middleware.ts +0 -103
- package/src/security/rbac/resolver.ts +0 -69
- package/src/security/rbac/server.ts +0 -52
- package/src/security/rbac/types.ts +0 -27
- package/src/seed/defaults/categories.ts +0 -13
- package/src/seed/defaults/faqs.ts +0 -40
- package/src/seed/defaults/homepage-sections.ts +0 -63
- package/src/seed/factories/address.factory.ts +0 -106
- package/src/seed/factories/bid.factory.ts +0 -50
- package/src/seed/factories/blog-post.factory.ts +0 -40
- package/src/seed/factories/carousel.factory.ts +0 -30
- package/src/seed/factories/cart.factory.ts +0 -66
- package/src/seed/factories/category.factory.ts +0 -30
- package/src/seed/factories/coupon.factory.ts +0 -67
- package/src/seed/factories/faq.factory.ts +0 -28
- package/src/seed/factories/homepage-section.factory.ts +0 -35
- package/src/seed/factories/notification.factory.ts +0 -68
- package/src/seed/factories/order.factory.ts +0 -43
- package/src/seed/factories/payout.factory.ts +0 -62
- package/src/seed/factories/product.factory.ts +0 -120
- package/src/seed/factories/review.factory.ts +0 -67
- package/src/seed/factories/session.factory.ts +0 -49
- package/src/seed/factories/store.factory.ts +0 -69
- package/src/seed/factories/user.factory.ts +0 -88
- package/src/seed/index.ts +0 -84
- package/src/seed/runner.ts +0 -57
- package/src/seed/test-utils.ts +0 -155
- package/src/seed/types.ts +0 -40
- package/src/seo/index.ts +0 -2
- package/src/seo/json-ld.ts +0 -241
- package/src/seo/metadata.ts +0 -302
- package/src/style/tailwind/index.ts +0 -66
- package/src/style/vanilla/index.ts +0 -57
- package/src/tokens/index.ts +0 -864
- package/src/tokens/tokens.css +0 -221
- package/src/ui/DataTable.tsx +0 -655
- package/src/ui/animation.helper.ts +0 -20
- package/src/ui/color.helper.ts +0 -37
- package/src/ui/components/Accordion.tsx +0 -189
- package/src/ui/components/ActiveFilterChips.tsx +0 -81
- package/src/ui/components/Alert.tsx +0 -167
- package/src/ui/components/Badge.tsx +0 -65
- package/src/ui/components/Breadcrumb.tsx +0 -61
- package/src/ui/components/BulkActionBar.tsx +0 -246
- package/src/ui/components/Button.tsx +0 -75
- package/src/ui/components/CountdownDisplay.tsx +0 -87
- package/src/ui/components/DescriptionField.tsx +0 -55
- package/src/ui/components/Div.tsx +0 -29
- package/src/ui/components/Divider.tsx +0 -52
- package/src/ui/components/Drawer.tsx +0 -178
- package/src/ui/components/Form.tsx +0 -25
- package/src/ui/components/FormGrid.tsx +0 -82
- package/src/ui/components/HorizontalScroller.tsx +0 -183
- package/src/ui/components/IconButton.tsx +0 -71
- package/src/ui/components/ImageLightbox.tsx +0 -187
- package/src/ui/components/Input.tsx +0 -17
- package/src/ui/components/ItemRow.tsx +0 -38
- package/src/ui/components/Layout.tsx +0 -391
- package/src/ui/components/ListingLayout.tsx +0 -514
- package/src/ui/components/Modal.tsx +0 -162
- package/src/ui/components/Pagination.tsx +0 -182
- package/src/ui/components/PriceDisplay.tsx +0 -63
- package/src/ui/components/Progress.tsx +0 -154
- package/src/ui/components/RatingDisplay.tsx +0 -56
- package/src/ui/components/Select.tsx +0 -221
- package/src/ui/components/Semantic.tsx +0 -257
- package/src/ui/components/SideModal.tsx +0 -137
- package/src/ui/components/Skeleton.tsx +0 -82
- package/src/ui/components/Slider.tsx +0 -35
- package/src/ui/components/SortDropdown.tsx +0 -43
- package/src/ui/components/Spinner.tsx +0 -48
- package/src/ui/components/StarRating.tsx +0 -85
- package/src/ui/components/StatsGrid.tsx +0 -56
- package/src/ui/components/StatusBadge.tsx +0 -130
- package/src/ui/components/StepperNav.tsx +0 -89
- package/src/ui/components/SummaryCard.tsx +0 -66
- package/src/ui/components/TabStrip.tsx +0 -142
- package/src/ui/components/TablePagination.tsx +0 -134
- package/src/ui/components/TagInput.tsx +0 -133
- package/src/ui/components/TextLink.tsx +0 -68
- package/src/ui/components/Textarea.tsx +0 -17
- package/src/ui/components/Tooltip.tsx +0 -190
- package/src/ui/components/Typography.tsx +0 -270
- package/src/ui/components/ViewToggle.tsx +0 -133
- package/src/ui/index.ts +0 -248
- package/src/ui/rich-text/RichText.tsx +0 -243
- package/src/ui/rich-text/index.ts +0 -2
- package/src/ui/style.helper.ts +0 -18
- package/src/utils/animation.helper.ts +0 -22
- package/src/utils/array.helper.ts +0 -73
- package/src/utils/color.helper.ts +0 -57
- package/src/utils/cookie.converter.ts +0 -32
- package/src/utils/date.formatter.ts +0 -228
- package/src/utils/event-manager.ts +0 -168
- package/src/utils/filter.helper.ts +0 -24
- package/src/utils/id-generators.ts +0 -629
- package/src/utils/index.ts +0 -31
- package/src/utils/media-field.ts +0 -13
- package/src/utils/number.formatter.ts +0 -107
- package/src/utils/object.helper.ts +0 -111
- package/src/utils/pagination.helper.ts +0 -46
- package/src/utils/sorting.helper.ts +0 -21
- package/src/utils/string.formatter.ts +0 -178
- package/src/utils/type.converter.ts +0 -86
- package/src/validation/email.validator.ts +0 -37
- package/src/validation/index.ts +0 -17
- package/src/validation/input.validator.ts +0 -38
- package/src/validation/password.validator.ts +0 -97
- package/src/validation/phone.validator.ts +0 -38
- package/src/validation/schemas.ts +0 -106
- package/src/validation/url.validator.ts +0 -46
- package/src/validation/zod-error-map.ts +0 -96
package/src/ui/DataTable.tsx
DELETED
|
@@ -1,655 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { ReactNode, useState, useMemo } from "react";
|
|
4
|
-
import { Button } from "./components/Button";
|
|
5
|
-
import { Spinner } from "./components/Spinner";
|
|
6
|
-
import { Pagination } from "./components/Pagination";
|
|
7
|
-
import { Text } from "./components/Typography";
|
|
8
|
-
import { GRID_MAP } from "./components/Layout";
|
|
9
|
-
import type { GridCols } from "./components/Layout";
|
|
10
|
-
import type {
|
|
11
|
-
TableColumn,
|
|
12
|
-
TableConfig,
|
|
13
|
-
PaginationConfig,
|
|
14
|
-
} from "../contracts";
|
|
15
|
-
import {
|
|
16
|
-
mergeTableConfig,
|
|
17
|
-
DEFAULT_PAGINATION_CONFIG,
|
|
18
|
-
} from "../contracts";
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* DataTable — generic sortable + paginated table promoted to @mohasinac/ui.
|
|
22
|
-
*
|
|
23
|
-
* Accepts `tableConfig` and `paginationConfig` for composable configuration.
|
|
24
|
-
* Apps can spread-merge DEFAULT_TABLE_CONFIG / DEFAULT_PAGINATION_CONFIG and
|
|
25
|
-
* override only the values they need, then pass the result once.
|
|
26
|
-
*
|
|
27
|
-
* Individual flat props (pageSize, stickyHeader, striped, …) still work and
|
|
28
|
-
* take precedence over anything in tableConfig when explicitly provided.
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
type ViewMode = "table" | "grid" | "list";
|
|
32
|
-
type SortDirection = "asc" | "desc" | null;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Column descriptor for the DataTable component.
|
|
36
|
-
* Narrows `render` to return `ReactNode` (TableColumn uses `unknown` so
|
|
37
|
-
* contracts stays React-free). Fully compatible with `TableColumn<T>`.
|
|
38
|
-
*/
|
|
39
|
-
export type DataTableColumn<T> = Omit<TableColumn<T>, "render"> & {
|
|
40
|
-
render?: (item: T) => ReactNode;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export interface DataTableProps<T> {
|
|
44
|
-
data: T[];
|
|
45
|
-
columns: DataTableColumn<T>[];
|
|
46
|
-
/** Derives a stable key per row. Defaults to `(item) => (item as Record<string,string>).id`. */
|
|
47
|
-
keyExtractor?: (item: T) => string;
|
|
48
|
-
onRowClick?: (item: T) => void;
|
|
49
|
-
loading?: boolean;
|
|
50
|
-
emptyMessage?: string;
|
|
51
|
-
actions?: (item: T) => ReactNode;
|
|
52
|
-
/** When true, disables internal pagination — render your own externally. Default: false */
|
|
53
|
-
externalPagination?: boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Composable table configuration.
|
|
56
|
-
* Deep-merged with DEFAULT_TABLE_CONFIG. Individual flat props (pageSize,
|
|
57
|
-
* stickyHeader, etc.) override this when explicitly provided.
|
|
58
|
-
*/
|
|
59
|
-
tableConfig?: Partial<TableConfig>;
|
|
60
|
-
/**
|
|
61
|
-
* Composable pagination configuration.
|
|
62
|
-
* Merged with DEFAULT_PAGINATION_CONFIG. Individual flat props override this.
|
|
63
|
-
*/
|
|
64
|
-
paginationConfig?: Partial<PaginationConfig>;
|
|
65
|
-
/** Items per page. Explicit value overrides tableConfig.pageSize. Default: 20 */
|
|
66
|
-
pageSize?: number;
|
|
67
|
-
// Mobile view
|
|
68
|
-
mobileCardRender?: (item: T) => ReactNode;
|
|
69
|
-
// Custom empty state
|
|
70
|
-
emptyState?: ReactNode;
|
|
71
|
-
emptyIcon?: ReactNode;
|
|
72
|
-
emptyTitle?: string;
|
|
73
|
-
// Table enhancements — explicit values override tableConfig values
|
|
74
|
-
stickyHeader?: boolean;
|
|
75
|
-
striped?: boolean;
|
|
76
|
-
// View toggle
|
|
77
|
-
showViewToggle?: boolean;
|
|
78
|
-
showTableView?: boolean;
|
|
79
|
-
viewMode?: ViewMode;
|
|
80
|
-
defaultViewMode?: ViewMode;
|
|
81
|
-
onViewModeChange?: (mode: ViewMode) => void;
|
|
82
|
-
// Row selection
|
|
83
|
-
selectable?: boolean;
|
|
84
|
-
selectedIds?: string[];
|
|
85
|
-
onSelectionChange?: (ids: string[]) => void;
|
|
86
|
-
/**
|
|
87
|
-
* Number of grid columns for card grid view.
|
|
88
|
-
* Matches Layout GRID_MAP keys: 1–6, "autoSm", "autoMd", "autoLg".
|
|
89
|
-
* Default: 6 (2→3→4→5→6 across breakpoints).
|
|
90
|
-
*/
|
|
91
|
-
gridCols?: GridCols;
|
|
92
|
-
// Labels (override defaults for i18n)
|
|
93
|
-
labels?: {
|
|
94
|
-
loading?: string;
|
|
95
|
-
noDataTitle?: string;
|
|
96
|
-
noDataDescription?: string;
|
|
97
|
-
actions?: string;
|
|
98
|
-
tableView?: string;
|
|
99
|
-
gridView?: string;
|
|
100
|
-
listView?: string;
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export function DataTable<T extends object>({
|
|
105
|
-
data,
|
|
106
|
-
columns,
|
|
107
|
-
keyExtractor: keyExtractorProp,
|
|
108
|
-
onRowClick,
|
|
109
|
-
loading = false,
|
|
110
|
-
emptyMessage,
|
|
111
|
-
actions,
|
|
112
|
-
mobileCardRender,
|
|
113
|
-
emptyState,
|
|
114
|
-
emptyIcon,
|
|
115
|
-
emptyTitle,
|
|
116
|
-
tableConfig,
|
|
117
|
-
paginationConfig,
|
|
118
|
-
externalPagination = false,
|
|
119
|
-
// Explicit flat props — override tableConfig when provided
|
|
120
|
-
pageSize: pageSizeProp,
|
|
121
|
-
stickyHeader: stickyHeaderProp,
|
|
122
|
-
striped: stripedProp,
|
|
123
|
-
showViewToggle: showViewToggleProp,
|
|
124
|
-
showTableView = true,
|
|
125
|
-
viewMode: controlledViewMode,
|
|
126
|
-
defaultViewMode: defaultViewModeProp,
|
|
127
|
-
onViewModeChange,
|
|
128
|
-
selectable: selectableProp,
|
|
129
|
-
selectedIds = [],
|
|
130
|
-
onSelectionChange,
|
|
131
|
-
gridCols = "cards",
|
|
132
|
-
labels = {},
|
|
133
|
-
}: DataTableProps<T>) {
|
|
134
|
-
// Merge tableConfig + paginationConfig with defaults; explicit flat props win
|
|
135
|
-
const resolvedTable = mergeTableConfig(tableConfig);
|
|
136
|
-
const resolvedPag = {
|
|
137
|
-
...DEFAULT_PAGINATION_CONFIG,
|
|
138
|
-
...tableConfig?.pagination,
|
|
139
|
-
...paginationConfig,
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
const keyExtractor: (item: T) => string =
|
|
143
|
-
keyExtractorProp ??
|
|
144
|
-
((item) => (item as Record<string, string>).id ?? JSON.stringify(item));
|
|
145
|
-
|
|
146
|
-
const pageSize = pageSizeProp ?? resolvedTable.pageSize;
|
|
147
|
-
const stickyHeader = stickyHeaderProp ?? resolvedTable.sticky.enabled;
|
|
148
|
-
const striped = stripedProp ?? resolvedTable.striped;
|
|
149
|
-
const showViewToggle = showViewToggleProp ?? resolvedTable.showViewToggle;
|
|
150
|
-
const selectable = selectableProp ?? resolvedTable.selectable;
|
|
151
|
-
const defaultViewMode: ViewMode =
|
|
152
|
-
defaultViewModeProp ?? resolvedTable.defaultViewMode;
|
|
153
|
-
|
|
154
|
-
const [sortKey, setSortKey] = useState<string | null>(null);
|
|
155
|
-
const [sortDirection, setSortDirection] = useState<SortDirection>(null);
|
|
156
|
-
const [currentPage, setCurrentPage] = useState(1);
|
|
157
|
-
const [internalViewMode, setInternalViewMode] =
|
|
158
|
-
useState<ViewMode>(defaultViewMode);
|
|
159
|
-
|
|
160
|
-
const activeViewMode: ViewMode = controlledViewMode ?? internalViewMode;
|
|
161
|
-
|
|
162
|
-
const {
|
|
163
|
-
loading: labelLoading = "Loading…",
|
|
164
|
-
noDataTitle = "No data found",
|
|
165
|
-
noDataDescription = "There are no items to display.",
|
|
166
|
-
actions: labelActions = "Actions",
|
|
167
|
-
tableView = "Table view",
|
|
168
|
-
gridView = "Grid view",
|
|
169
|
-
listView = "List view",
|
|
170
|
-
} = labels;
|
|
171
|
-
|
|
172
|
-
const handleViewModeChange = (mode: ViewMode) => {
|
|
173
|
-
if (controlledViewMode === undefined) setInternalViewMode(mode);
|
|
174
|
-
onViewModeChange?.(mode);
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
const handleSort = (key: string) => {
|
|
178
|
-
const col = columns.find((c) => c.key === key);
|
|
179
|
-
if (!col?.sortable) return;
|
|
180
|
-
if (sortKey === key) {
|
|
181
|
-
if (sortDirection === "asc") setSortDirection("desc");
|
|
182
|
-
else {
|
|
183
|
-
setSortKey(null);
|
|
184
|
-
setSortDirection(null);
|
|
185
|
-
}
|
|
186
|
-
} else {
|
|
187
|
-
setSortKey(key);
|
|
188
|
-
setSortDirection("asc");
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
const sortedData = useMemo(() => {
|
|
193
|
-
const sorted = [...data];
|
|
194
|
-
if (sortKey && sortDirection) {
|
|
195
|
-
sorted.sort((a, b) => {
|
|
196
|
-
const aVal = (a as Record<string, unknown>)[sortKey];
|
|
197
|
-
const bVal = (b as Record<string, unknown>)[sortKey];
|
|
198
|
-
if (aVal == null) return 1;
|
|
199
|
-
if (bVal == null) return -1;
|
|
200
|
-
if (typeof aVal === "string" && typeof bVal === "string") {
|
|
201
|
-
return sortDirection === "asc"
|
|
202
|
-
? aVal.localeCompare(bVal)
|
|
203
|
-
: bVal.localeCompare(aVal);
|
|
204
|
-
}
|
|
205
|
-
if (aVal < bVal) return sortDirection === "asc" ? -1 : 1;
|
|
206
|
-
if (aVal > bVal) return sortDirection === "asc" ? 1 : -1;
|
|
207
|
-
return 0;
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
return sorted;
|
|
211
|
-
}, [data, sortKey, sortDirection]);
|
|
212
|
-
|
|
213
|
-
const paginatedData = useMemo(() => {
|
|
214
|
-
if (externalPagination) return sortedData;
|
|
215
|
-
const start = (currentPage - 1) * pageSize;
|
|
216
|
-
return sortedData.slice(start, start + pageSize);
|
|
217
|
-
}, [sortedData, currentPage, externalPagination, pageSize]);
|
|
218
|
-
|
|
219
|
-
const totalPages = Math.ceil(sortedData.length / pageSize);
|
|
220
|
-
|
|
221
|
-
// ─── Loading state ──────────────────────────────────────────────────────────
|
|
222
|
-
if (loading) {
|
|
223
|
-
return (
|
|
224
|
-
<div className="rounded-2xl border border-zinc-200 dark:border-slate-700 overflow-hidden">
|
|
225
|
-
<div className="flex items-center justify-center h-64">
|
|
226
|
-
<Spinner size="lg" label={labelLoading} />
|
|
227
|
-
</div>
|
|
228
|
-
</div>
|
|
229
|
-
);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
// ─── Empty state ────────────────────────────────────────────────────────────
|
|
233
|
-
if (data.length === 0) {
|
|
234
|
-
if (emptyState) return <>{emptyState}</>;
|
|
235
|
-
return (
|
|
236
|
-
<div className="rounded-2xl border border-zinc-200 dark:border-slate-700 overflow-hidden">
|
|
237
|
-
<div className="flex items-center justify-center h-64">
|
|
238
|
-
<div className="text-center px-4">
|
|
239
|
-
{emptyIcon ?? (
|
|
240
|
-
<svg
|
|
241
|
-
className="mx-auto h-12 w-12 text-zinc-400"
|
|
242
|
-
fill="none"
|
|
243
|
-
viewBox="0 0 24 24"
|
|
244
|
-
stroke="currentColor"
|
|
245
|
-
aria-hidden="true"
|
|
246
|
-
>
|
|
247
|
-
<path
|
|
248
|
-
strokeLinecap="round"
|
|
249
|
-
strokeLinejoin="round"
|
|
250
|
-
strokeWidth={1.5}
|
|
251
|
-
d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"
|
|
252
|
-
/>
|
|
253
|
-
</svg>
|
|
254
|
-
)}
|
|
255
|
-
<Text size="sm" weight="semibold" className="mt-4">
|
|
256
|
-
{emptyTitle ?? noDataTitle}
|
|
257
|
-
</Text>
|
|
258
|
-
<Text size="sm" variant="secondary" className="mt-1">
|
|
259
|
-
{emptyMessage ?? noDataDescription}
|
|
260
|
-
</Text>
|
|
261
|
-
</div>
|
|
262
|
-
</div>
|
|
263
|
-
</div>
|
|
264
|
-
);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
const renderViewToggle = () => {
|
|
268
|
-
if (!showViewToggle) return null;
|
|
269
|
-
return (
|
|
270
|
-
<div
|
|
271
|
-
className="flex justify-end gap-1"
|
|
272
|
-
role="toolbar"
|
|
273
|
-
aria-label="View mode"
|
|
274
|
-
>
|
|
275
|
-
{showTableView && (
|
|
276
|
-
<Button
|
|
277
|
-
type="button"
|
|
278
|
-
variant="ghost"
|
|
279
|
-
size="sm"
|
|
280
|
-
onClick={() => handleViewModeChange("table")}
|
|
281
|
-
aria-label={tableView}
|
|
282
|
-
aria-pressed={activeViewMode === "table"}
|
|
283
|
-
className={`hidden sm:flex items-center justify-center p-2 rounded-lg ring-1 transition-colors ${activeViewMode === "table" ? "bg-primary/5 text-primary dark:bg-primary/10 ring-primary/30" : "text-zinc-500 dark:text-zinc-400 ring-zinc-200 dark:ring-slate-700 hover:bg-zinc-100 dark:hover:bg-slate-800"}`}
|
|
284
|
-
>
|
|
285
|
-
<svg
|
|
286
|
-
className="w-4 h-4"
|
|
287
|
-
fill="none"
|
|
288
|
-
viewBox="0 0 24 24"
|
|
289
|
-
stroke="currentColor"
|
|
290
|
-
strokeWidth={1.5}
|
|
291
|
-
aria-hidden="true"
|
|
292
|
-
>
|
|
293
|
-
<path
|
|
294
|
-
strokeLinecap="round"
|
|
295
|
-
strokeLinejoin="round"
|
|
296
|
-
d="M3 10h18M3 6h18M3 14h18M3 18h18"
|
|
297
|
-
/>
|
|
298
|
-
</svg>
|
|
299
|
-
</Button>
|
|
300
|
-
)}
|
|
301
|
-
<Button
|
|
302
|
-
type="button"
|
|
303
|
-
variant="ghost"
|
|
304
|
-
size="sm"
|
|
305
|
-
onClick={() => handleViewModeChange("grid")}
|
|
306
|
-
aria-label={gridView}
|
|
307
|
-
aria-pressed={activeViewMode === "grid"}
|
|
308
|
-
className={`flex items-center justify-center p-2 rounded-lg ring-1 transition-colors ${activeViewMode === "grid" ? "bg-primary/5 text-primary dark:bg-primary/10 ring-primary/30" : "text-zinc-500 dark:text-zinc-400 ring-zinc-200 dark:ring-slate-700 hover:bg-zinc-100 dark:hover:bg-slate-800"}`}
|
|
309
|
-
>
|
|
310
|
-
<svg
|
|
311
|
-
className="w-4 h-4"
|
|
312
|
-
fill="none"
|
|
313
|
-
viewBox="0 0 24 24"
|
|
314
|
-
stroke="currentColor"
|
|
315
|
-
strokeWidth={1.5}
|
|
316
|
-
aria-hidden="true"
|
|
317
|
-
>
|
|
318
|
-
<path
|
|
319
|
-
strokeLinecap="round"
|
|
320
|
-
strokeLinejoin="round"
|
|
321
|
-
d="M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6zM3.75 15.75A2.25 2.25 0 016 13.5h2.25a2.25 2.25 0 012.25 2.25V18a2.25 2.25 0 01-2.25 2.25H6A2.25 2.25 0 013.75 18v-2.25zM13.5 6a2.25 2.25 0 012.25-2.25H18A2.25 2.25 0 0120.25 6v2.25A2.25 2.25 0 0118 10.5h-2.25a2.25 2.25 0 01-2.25-2.25V6zM13.5 15.75a2.25 2.25 0 012.25-2.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-2.25A2.25 2.25 0 0113.5 18v-2.25z"
|
|
322
|
-
/>
|
|
323
|
-
</svg>
|
|
324
|
-
</Button>
|
|
325
|
-
<Button
|
|
326
|
-
type="button"
|
|
327
|
-
variant="ghost"
|
|
328
|
-
size="sm"
|
|
329
|
-
onClick={() => handleViewModeChange("list")}
|
|
330
|
-
aria-label={listView}
|
|
331
|
-
aria-pressed={activeViewMode === "list"}
|
|
332
|
-
className={`flex items-center justify-center p-2 rounded-lg ring-1 transition-colors ${activeViewMode === "list" ? "bg-primary/5 text-primary dark:bg-primary/10 ring-primary/30" : "text-zinc-500 dark:text-zinc-400 ring-zinc-200 dark:ring-slate-700 hover:bg-zinc-100 dark:hover:bg-slate-800"}`}
|
|
333
|
-
>
|
|
334
|
-
<svg
|
|
335
|
-
className="w-4 h-4"
|
|
336
|
-
fill="none"
|
|
337
|
-
viewBox="0 0 24 24"
|
|
338
|
-
stroke="currentColor"
|
|
339
|
-
strokeWidth={1.5}
|
|
340
|
-
aria-hidden="true"
|
|
341
|
-
>
|
|
342
|
-
<path
|
|
343
|
-
strokeLinecap="round"
|
|
344
|
-
strokeLinejoin="round"
|
|
345
|
-
d="M8.25 6.75h12M8.25 12h12m-12 5.25h12M3.75 6.75h.007v.008H3.75V6.75zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zM3.75 12h.007v.008H3.75V12zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm-.375 5.25h.007v.008H3.75v-.008zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"
|
|
346
|
-
/>
|
|
347
|
-
</svg>
|
|
348
|
-
</Button>
|
|
349
|
-
</div>
|
|
350
|
-
);
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
// ─── Card views (grid / list) ────────────────────────────────────────────────
|
|
354
|
-
const renderCardGrid = (mode: "grid" | "list") => {
|
|
355
|
-
if (!mobileCardRender) return null;
|
|
356
|
-
return (
|
|
357
|
-
<div
|
|
358
|
-
className={
|
|
359
|
-
mode === "grid"
|
|
360
|
-
? `${GRID_MAP[gridCols]} gap-6`
|
|
361
|
-
: "flex flex-col gap-4"
|
|
362
|
-
}
|
|
363
|
-
>
|
|
364
|
-
{paginatedData.map((item) => (
|
|
365
|
-
<SelectableCard
|
|
366
|
-
key={keyExtractor(item)}
|
|
367
|
-
id={keyExtractor(item)}
|
|
368
|
-
selectable={selectable}
|
|
369
|
-
selected={selectedIds.includes(keyExtractor(item))}
|
|
370
|
-
listMode={mode === "list"}
|
|
371
|
-
onToggle={(id, checked) =>
|
|
372
|
-
onSelectionChange?.(
|
|
373
|
-
checked
|
|
374
|
-
? [...selectedIds, id]
|
|
375
|
-
: selectedIds.filter((s) => s !== id),
|
|
376
|
-
)
|
|
377
|
-
}
|
|
378
|
-
>
|
|
379
|
-
{mobileCardRender(item)}
|
|
380
|
-
</SelectableCard>
|
|
381
|
-
))}
|
|
382
|
-
</div>
|
|
383
|
-
);
|
|
384
|
-
};
|
|
385
|
-
|
|
386
|
-
// ─── Main render ─────────────────────────────────────────────────────────────
|
|
387
|
-
return (
|
|
388
|
-
<div className="space-y-4">
|
|
389
|
-
{renderViewToggle()}
|
|
390
|
-
|
|
391
|
-
{/* Non-table views */}
|
|
392
|
-
{activeViewMode !== "table" &&
|
|
393
|
-
mobileCardRender &&
|
|
394
|
-
renderCardGrid(activeViewMode as "grid" | "list")}
|
|
395
|
-
|
|
396
|
-
{/* Mobile cards in table mode */}
|
|
397
|
-
{activeViewMode === "table" && mobileCardRender && (
|
|
398
|
-
<div className="md:hidden space-y-6">
|
|
399
|
-
{paginatedData.map((item) => (
|
|
400
|
-
<SelectableCard
|
|
401
|
-
key={keyExtractor(item)}
|
|
402
|
-
id={keyExtractor(item)}
|
|
403
|
-
selectable={selectable}
|
|
404
|
-
selected={selectedIds.includes(keyExtractor(item))}
|
|
405
|
-
onToggle={(id, checked) =>
|
|
406
|
-
onSelectionChange?.(
|
|
407
|
-
checked
|
|
408
|
-
? [...selectedIds, id]
|
|
409
|
-
: selectedIds.filter((s) => s !== id),
|
|
410
|
-
)
|
|
411
|
-
}
|
|
412
|
-
>
|
|
413
|
-
{mobileCardRender(item)}
|
|
414
|
-
</SelectableCard>
|
|
415
|
-
))}
|
|
416
|
-
</div>
|
|
417
|
-
)}
|
|
418
|
-
|
|
419
|
-
{/* Desktop table */}
|
|
420
|
-
{activeViewMode === "table" && (
|
|
421
|
-
<div className="rounded-2xl border border-zinc-200 dark:border-slate-700 overflow-hidden">
|
|
422
|
-
<div
|
|
423
|
-
className={`overflow-x-auto ${stickyHeader ? "max-h-[600px] overflow-y-auto" : ""}`}
|
|
424
|
-
>
|
|
425
|
-
<table className="min-w-full divide-y divide-zinc-200 dark:divide-slate-700">
|
|
426
|
-
<thead
|
|
427
|
-
className={`bg-zinc-50 dark:bg-slate-800 ${stickyHeader ? "sticky top-0 z-10" : ""}`}
|
|
428
|
-
>
|
|
429
|
-
<tr>
|
|
430
|
-
{selectable && (
|
|
431
|
-
<th scope="col" className="px-4 py-3 w-8">
|
|
432
|
-
<input
|
|
433
|
-
type="checkbox"
|
|
434
|
-
className="rounded border-zinc-300"
|
|
435
|
-
aria-label="Select all on page"
|
|
436
|
-
checked={
|
|
437
|
-
paginatedData.length > 0 &&
|
|
438
|
-
paginatedData.every((item) =>
|
|
439
|
-
selectedIds.includes(keyExtractor(item)),
|
|
440
|
-
)
|
|
441
|
-
}
|
|
442
|
-
onChange={(e) => {
|
|
443
|
-
const pageIds = paginatedData.map(keyExtractor);
|
|
444
|
-
onSelectionChange?.(
|
|
445
|
-
e.target.checked
|
|
446
|
-
? [...new Set([...selectedIds, ...pageIds])]
|
|
447
|
-
: selectedIds.filter(
|
|
448
|
-
(id) => !pageIds.includes(id),
|
|
449
|
-
),
|
|
450
|
-
);
|
|
451
|
-
}}
|
|
452
|
-
/>
|
|
453
|
-
</th>
|
|
454
|
-
)}
|
|
455
|
-
{columns.map((col) => (
|
|
456
|
-
<th
|
|
457
|
-
key={col.key}
|
|
458
|
-
scope="col"
|
|
459
|
-
aria-sort={
|
|
460
|
-
col.sortable
|
|
461
|
-
? sortKey === col.key
|
|
462
|
-
? sortDirection === "asc"
|
|
463
|
-
? "ascending"
|
|
464
|
-
: "descending"
|
|
465
|
-
: "none"
|
|
466
|
-
: undefined
|
|
467
|
-
}
|
|
468
|
-
className={`px-6 py-3 text-left text-xs font-medium text-zinc-500 dark:text-zinc-400 uppercase tracking-wider ${col.sortable ? "cursor-pointer select-none hover:bg-zinc-100 dark:hover:bg-slate-700" : ""}`}
|
|
469
|
-
style={{ width: col.width }}
|
|
470
|
-
onClick={() => col.sortable && handleSort(col.key)}
|
|
471
|
-
>
|
|
472
|
-
<div className="flex items-center gap-2">
|
|
473
|
-
{col.header}
|
|
474
|
-
{col.sortable && (
|
|
475
|
-
<span className="text-zinc-400" aria-hidden="true">
|
|
476
|
-
{sortKey === col.key ? (
|
|
477
|
-
sortDirection === "asc" ? (
|
|
478
|
-
"↑"
|
|
479
|
-
) : (
|
|
480
|
-
"↓"
|
|
481
|
-
)
|
|
482
|
-
) : (
|
|
483
|
-
<span className="opacity-30">↕</span>
|
|
484
|
-
)}
|
|
485
|
-
</span>
|
|
486
|
-
)}
|
|
487
|
-
</div>
|
|
488
|
-
</th>
|
|
489
|
-
))}
|
|
490
|
-
{actions && (
|
|
491
|
-
<th
|
|
492
|
-
scope="col"
|
|
493
|
-
className="px-6 py-3 text-right text-xs font-medium text-zinc-500 dark:text-zinc-400 uppercase tracking-wider"
|
|
494
|
-
>
|
|
495
|
-
{labelActions}
|
|
496
|
-
</th>
|
|
497
|
-
)}
|
|
498
|
-
</tr>
|
|
499
|
-
</thead>
|
|
500
|
-
<tbody className="bg-white dark:bg-slate-900 divide-y divide-zinc-200 dark:divide-slate-700">
|
|
501
|
-
{paginatedData.map((item, index) => (
|
|
502
|
-
<tr
|
|
503
|
-
key={keyExtractor(item)}
|
|
504
|
-
className={[
|
|
505
|
-
striped && index % 2 === 1
|
|
506
|
-
? "bg-zinc-50 dark:bg-slate-800"
|
|
507
|
-
: "",
|
|
508
|
-
onRowClick
|
|
509
|
-
? "cursor-pointer hover:bg-zinc-50 dark:hover:bg-slate-800/60"
|
|
510
|
-
: "",
|
|
511
|
-
"transition-colors duration-150",
|
|
512
|
-
].join(" ")}
|
|
513
|
-
onClick={() => onRowClick?.(item)}
|
|
514
|
-
>
|
|
515
|
-
{selectable && (
|
|
516
|
-
<td
|
|
517
|
-
className="px-4 py-4 w-8"
|
|
518
|
-
onClick={(e) => e.stopPropagation()}
|
|
519
|
-
>
|
|
520
|
-
<input
|
|
521
|
-
type="checkbox"
|
|
522
|
-
className="rounded border-zinc-300"
|
|
523
|
-
aria-label="Select row"
|
|
524
|
-
checked={selectedIds.includes(keyExtractor(item))}
|
|
525
|
-
onChange={(e) => {
|
|
526
|
-
const id = keyExtractor(item);
|
|
527
|
-
onSelectionChange?.(
|
|
528
|
-
e.target.checked
|
|
529
|
-
? [...selectedIds, id]
|
|
530
|
-
: selectedIds.filter((s) => s !== id),
|
|
531
|
-
);
|
|
532
|
-
}}
|
|
533
|
-
/>
|
|
534
|
-
</td>
|
|
535
|
-
)}
|
|
536
|
-
{columns.map((col) => (
|
|
537
|
-
<td
|
|
538
|
-
key={col.key}
|
|
539
|
-
className="px-6 py-4 whitespace-nowrap text-sm text-zinc-900 dark:text-zinc-100"
|
|
540
|
-
>
|
|
541
|
-
{col.render
|
|
542
|
-
? col.render(item)
|
|
543
|
-
: (((item as Record<string, unknown>)[
|
|
544
|
-
col.key
|
|
545
|
-
] as string) ?? "-")}
|
|
546
|
-
</td>
|
|
547
|
-
))}
|
|
548
|
-
{actions && (
|
|
549
|
-
<td
|
|
550
|
-
className="px-6 py-4 whitespace-nowrap text-right text-sm font-medium"
|
|
551
|
-
onClick={(e) => e.stopPropagation()}
|
|
552
|
-
>
|
|
553
|
-
{actions(item)}
|
|
554
|
-
</td>
|
|
555
|
-
)}
|
|
556
|
-
</tr>
|
|
557
|
-
))}
|
|
558
|
-
</tbody>
|
|
559
|
-
</table>
|
|
560
|
-
</div>
|
|
561
|
-
</div>
|
|
562
|
-
)}
|
|
563
|
-
|
|
564
|
-
{/* Pagination */}
|
|
565
|
-
{!externalPagination && totalPages > 1 && (
|
|
566
|
-
<div className="flex justify-center">
|
|
567
|
-
<Pagination
|
|
568
|
-
currentPage={currentPage}
|
|
569
|
-
totalPages={totalPages}
|
|
570
|
-
onPageChange={setCurrentPage}
|
|
571
|
-
maxVisible={resolvedPag.maxVisible}
|
|
572
|
-
showFirstLast={resolvedPag.showFirstLast}
|
|
573
|
-
showPrevNext={resolvedPag.showPrevNext}
|
|
574
|
-
size={resolvedPag.size}
|
|
575
|
-
/>
|
|
576
|
-
</div>
|
|
577
|
-
)}
|
|
578
|
-
</div>
|
|
579
|
-
);
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
// ─── SelectableCard (internal) ───────────────────────────────────────────────
|
|
583
|
-
|
|
584
|
-
interface SelectableCardProps {
|
|
585
|
-
id: string;
|
|
586
|
-
selectable: boolean;
|
|
587
|
-
selected: boolean;
|
|
588
|
-
onToggle: (id: string, checked: boolean) => void;
|
|
589
|
-
children: ReactNode;
|
|
590
|
-
listMode?: boolean;
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
function SelectableCard({
|
|
594
|
-
id,
|
|
595
|
-
selectable,
|
|
596
|
-
selected,
|
|
597
|
-
onToggle,
|
|
598
|
-
children,
|
|
599
|
-
listMode = false,
|
|
600
|
-
}: SelectableCardProps) {
|
|
601
|
-
if (!selectable) return <div className="h-full">{children}</div>;
|
|
602
|
-
return (
|
|
603
|
-
<div className="relative group h-full">
|
|
604
|
-
{/* Checkbox overlay — always visible, bg/shadow ensures contrast over any card background */}
|
|
605
|
-
<div
|
|
606
|
-
className={[
|
|
607
|
-
"absolute z-10",
|
|
608
|
-
listMode ? "left-2 top-1/2 -translate-y-1/2" : "top-2 left-2",
|
|
609
|
-
].join(" ")}
|
|
610
|
-
onClick={(e) => e.stopPropagation()}
|
|
611
|
-
>
|
|
612
|
-
<div className="w-6 h-6 rounded-md bg-white/95 dark:bg-slate-800/95 shadow-md flex items-center justify-center">
|
|
613
|
-
{/* relative wrapper ensures checkmark SVG centers over the input */}
|
|
614
|
-
<div className="relative flex items-center justify-center">
|
|
615
|
-
<input
|
|
616
|
-
type="checkbox"
|
|
617
|
-
className={[
|
|
618
|
-
"w-4 h-4 rounded cursor-pointer transition-all appearance-none",
|
|
619
|
-
selected
|
|
620
|
-
? "border-2 border-primary bg-primary"
|
|
621
|
-
: "border-2 border-zinc-500 dark:border-slate-400 bg-transparent group-hover:border-primary",
|
|
622
|
-
].join(" ")}
|
|
623
|
-
checked={selected}
|
|
624
|
-
onChange={(e) => onToggle(id, e.target.checked)}
|
|
625
|
-
aria-label="Select item"
|
|
626
|
-
/>
|
|
627
|
-
{selected && (
|
|
628
|
-
<svg
|
|
629
|
-
className="absolute inset-0 m-auto w-2.5 h-2.5 text-white pointer-events-none"
|
|
630
|
-
fill="none"
|
|
631
|
-
stroke="currentColor"
|
|
632
|
-
viewBox="0 0 24 24"
|
|
633
|
-
aria-hidden="true"
|
|
634
|
-
>
|
|
635
|
-
<path
|
|
636
|
-
strokeLinecap="round"
|
|
637
|
-
strokeLinejoin="round"
|
|
638
|
-
strokeWidth={3}
|
|
639
|
-
d="M5 13l4 4L19 7"
|
|
640
|
-
/>
|
|
641
|
-
</svg>
|
|
642
|
-
)}
|
|
643
|
-
</div>
|
|
644
|
-
</div>
|
|
645
|
-
</div>
|
|
646
|
-
{selected && (
|
|
647
|
-
<div
|
|
648
|
-
className="absolute inset-0 z-[5] rounded-xl ring-2 ring-primary ring-offset-0 pointer-events-none"
|
|
649
|
-
aria-hidden="true"
|
|
650
|
-
/>
|
|
651
|
-
)}
|
|
652
|
-
{children}
|
|
653
|
-
</div>
|
|
654
|
-
);
|
|
655
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Animation Helpers
|
|
3
|
-
*
|
|
4
|
-
* Easing functions for animations and transitions.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export const easings = {
|
|
8
|
-
linear: (t: number) => t,
|
|
9
|
-
easeInQuad: (t: number) => t * t,
|
|
10
|
-
easeOutQuad: (t: number) => t * (2 - t),
|
|
11
|
-
easeInOutQuad: (t: number) => (t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t),
|
|
12
|
-
easeInCubic: (t: number) => t * t * t,
|
|
13
|
-
easeOutCubic: (t: number) => --t * t * t + 1,
|
|
14
|
-
easeInOutCubic: (t: number) =>
|
|
15
|
-
t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1,
|
|
16
|
-
easeInQuart: (t: number) => t * t * t * t,
|
|
17
|
-
easeOutQuart: (t: number) => 1 - --t * t * t * t,
|
|
18
|
-
easeInOutQuart: (t: number) =>
|
|
19
|
-
t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t,
|
|
20
|
-
};
|