@mohasinac/appkit 2.7.58 → 2.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/_internal/client/features/filters/filter-load-options.d.ts +4 -5
- package/dist/_internal/server/features/auctions/og.js +8 -32
- package/dist/_internal/server/features/blog/og.js +10 -49
- package/dist/_internal/server/features/checkout/actions.js +6 -0
- package/dist/_internal/server/features/classified/og.js +9 -51
- package/dist/_internal/server/features/digital-code/actions.d.ts +11 -0
- package/dist/_internal/server/features/digital-code/actions.js +30 -0
- package/dist/_internal/server/features/digital-code/index.d.ts +1 -0
- package/dist/_internal/server/features/digital-code/index.js +1 -0
- package/dist/_internal/server/features/digital-code/og.js +9 -51
- package/dist/_internal/server/features/events/og.js +10 -49
- package/dist/_internal/server/features/item-requests/data.d.ts +17 -0
- package/dist/_internal/server/features/item-requests/data.js +20 -0
- package/dist/_internal/server/features/item-requests/index.d.ts +2 -0
- package/dist/_internal/server/features/item-requests/index.js +2 -0
- package/dist/_internal/server/features/item-requests/og.d.ts +40 -0
- package/dist/_internal/server/features/item-requests/og.js +136 -0
- package/dist/_internal/server/features/live/actions.d.ts +5 -0
- package/dist/_internal/server/features/live/actions.js +24 -0
- package/dist/_internal/server/features/live/index.d.ts +1 -0
- package/dist/_internal/server/features/live/index.js +1 -0
- package/dist/_internal/server/features/live/og.js +9 -51
- package/dist/_internal/server/features/media/contextGuards.js +19 -8
- package/dist/_internal/server/features/pre-orders/og.js +8 -32
- package/dist/_internal/server/features/prize-draws/data.d.ts +17 -0
- package/dist/_internal/server/features/prize-draws/data.js +20 -0
- package/dist/_internal/server/features/prize-draws/index.d.ts +2 -0
- package/dist/_internal/server/features/prize-draws/index.js +2 -0
- package/dist/_internal/server/features/prize-draws/og.d.ts +30 -0
- package/dist/_internal/server/features/prize-draws/og.js +50 -0
- package/dist/_internal/server/features/products/og.js +8 -33
- package/dist/_internal/server/features/scams/og.js +1 -1
- package/dist/_internal/server/features/seo/og-layout.d.ts +42 -0
- package/dist/_internal/server/features/seo/og-layout.js +69 -0
- package/dist/_internal/server/features/stores/og.js +8 -41
- package/dist/_internal/server/features/sublisting-categories/og.js +11 -42
- package/dist/_internal/shared/actions/bulk-helpers.d.ts +3 -0
- package/dist/_internal/shared/actions/bulk-helpers.js +19 -0
- package/dist/_internal/shared/config/schema.d.ts +4 -4
- package/dist/client.d.ts +13 -6
- package/dist/client.js +9 -3
- package/dist/configs/next.js +11 -0
- package/dist/constants/index.d.ts +4 -0
- package/dist/constants/index.js +2 -0
- package/dist/constants/notification-types.d.ts +20 -0
- package/dist/constants/notification-types.js +37 -0
- package/dist/constants/pagination-presets.d.ts +39 -0
- package/dist/constants/pagination-presets.js +38 -0
- package/dist/errors/messages.d.ts +0 -4
- package/dist/errors/messages.js +0 -4
- package/dist/features/account/components/AddressesIndexListing.js +3 -4
- package/dist/features/account/components/UserOffersPanel.js +1 -1
- package/dist/features/account/components/UserSidebar.js +14 -10
- package/dist/features/account/components/UserSupportView.d.ts +1 -2
- package/dist/features/account/components/UserSupportView.js +9 -1
- package/dist/features/admin/actions/admin-actions.js +16 -1
- package/dist/features/admin/components/AdminAllEventEntriesView.d.ts +2 -3
- package/dist/features/admin/components/AdminAllEventEntriesView.js +50 -89
- package/dist/features/admin/components/AdminBidsView.d.ts +2 -3
- package/dist/features/admin/components/AdminBidsView.js +64 -104
- package/dist/features/admin/components/AdminBlogView.d.ts +3 -7
- package/dist/features/admin/components/AdminBlogView.js +53 -88
- package/dist/features/admin/components/AdminBrandEditorView.js +14 -17
- package/dist/features/admin/components/AdminBrandsView.d.ts +2 -3
- package/dist/features/admin/components/AdminBrandsView.js +85 -89
- package/dist/features/admin/components/AdminBundlesView.js +68 -130
- package/dist/features/admin/components/AdminCarouselView.d.ts +2 -2
- package/dist/features/admin/components/AdminCarouselView.js +22 -70
- package/dist/features/admin/components/AdminCartsView.d.ts +2 -3
- package/dist/features/admin/components/AdminCartsView.js +39 -89
- package/dist/features/admin/components/AdminCategoriesView.d.ts +3 -3
- package/dist/features/admin/components/AdminCategoriesView.js +97 -96
- package/dist/features/admin/components/AdminCategoryEditorView.js +2 -6
- package/dist/features/admin/components/AdminClassifiedView.d.ts +3 -0
- package/dist/features/admin/components/AdminClassifiedView.js +44 -0
- package/dist/features/admin/components/AdminContactView.d.ts +2 -2
- package/dist/features/admin/components/AdminContactView.js +105 -130
- package/dist/features/admin/components/AdminCouponEditorView.js +14 -17
- package/dist/features/admin/components/AdminCouponsView.d.ts +3 -6
- package/dist/features/admin/components/AdminCouponsView.js +69 -97
- package/dist/features/admin/components/AdminDigitalCodesView.d.ts +3 -0
- package/dist/features/admin/components/AdminDigitalCodesView.js +51 -0
- package/dist/features/admin/components/AdminFaqEditorView.js +14 -17
- package/dist/features/admin/components/AdminFaqsView.d.ts +4 -4
- package/dist/features/admin/components/AdminFaqsView.js +79 -86
- package/dist/features/admin/components/AdminFeatureEditorView.js +7 -9
- package/dist/features/admin/components/AdminFeaturesView.d.ts +2 -3
- package/dist/features/admin/components/AdminFeaturesView.js +57 -70
- package/dist/features/admin/components/AdminGroupedListingsView.d.ts +3 -0
- package/dist/features/admin/components/AdminGroupedListingsView.js +43 -0
- package/dist/features/admin/components/AdminHistoryView.d.ts +2 -3
- package/dist/features/admin/components/AdminHistoryView.js +35 -52
- package/dist/features/admin/components/AdminListingScaffold.d.ts +2 -2
- package/dist/features/admin/components/AdminListingScaffold.js +3 -3
- package/dist/features/admin/components/AdminLiveView.d.ts +3 -0
- package/dist/features/admin/components/AdminLiveView.js +50 -0
- package/dist/features/admin/components/AdminNewsletterView.d.ts +2 -2
- package/dist/features/admin/components/AdminNewsletterView.js +68 -108
- package/dist/features/admin/components/AdminNotificationsView.d.ts +2 -3
- package/dist/features/admin/components/AdminNotificationsView.js +67 -99
- package/dist/features/admin/components/AdminOrderEditorView.js +10 -10
- package/dist/features/admin/components/AdminOrdersView.d.ts +2 -3
- package/dist/features/admin/components/AdminOrdersView.js +93 -113
- package/dist/features/admin/components/AdminPayoutsView.d.ts +2 -3
- package/dist/features/admin/components/AdminPayoutsView.js +51 -97
- package/dist/features/admin/components/AdminPrizeDrawsView.d.ts +2 -3
- package/dist/features/admin/components/AdminPrizeDrawsView.js +41 -83
- package/dist/features/admin/components/AdminProductEditorView.js +3 -7
- package/dist/features/admin/components/AdminProductsView.d.ts +4 -4
- package/dist/features/admin/components/AdminProductsView.js +166 -167
- package/dist/features/admin/components/AdminReturnRequestsView.d.ts +1 -1
- package/dist/features/admin/components/AdminReturnRequestsView.js +64 -66
- package/dist/features/admin/components/AdminReviewsView.d.ts +3 -7
- package/dist/features/admin/components/AdminReviewsView.js +94 -116
- package/dist/features/admin/components/AdminScammersView.d.ts +2 -3
- package/dist/features/admin/components/AdminScammersView.js +53 -103
- package/dist/features/admin/components/AdminSectionsView.js +1 -1
- package/dist/features/admin/components/AdminSessionsView.d.ts +2 -3
- package/dist/features/admin/components/AdminSessionsView.js +62 -95
- package/dist/features/admin/components/AdminStoreAddressesView.d.ts +1 -1
- package/dist/features/admin/components/AdminStoreAddressesView.js +39 -53
- package/dist/features/admin/components/AdminStoreEditorView.js +21 -8
- package/dist/features/admin/components/AdminStoresView.d.ts +2 -3
- package/dist/features/admin/components/AdminStoresView.js +67 -105
- package/dist/features/admin/components/AdminSublistingCategoriesView.d.ts +1 -1
- package/dist/features/admin/components/AdminSublistingCategoriesView.js +29 -49
- package/dist/features/admin/components/AdminSublistingCategoryEditorView.js +17 -20
- package/dist/features/admin/components/AdminSupportTicketDetailView.d.ts +10 -1
- package/dist/features/admin/components/AdminSupportTicketDetailView.js +191 -5
- package/dist/features/admin/components/AdminSupportTicketsView.d.ts +2 -3
- package/dist/features/admin/components/AdminSupportTicketsView.js +65 -102
- package/dist/features/admin/components/AdminTeamView.d.ts +2 -2
- package/dist/features/admin/components/AdminTeamView.js +42 -85
- package/dist/features/admin/components/AdminUserEditorView.d.ts +11 -1
- package/dist/features/admin/components/AdminUserEditorView.js +80 -6
- package/dist/features/admin/components/AdminUsersView.d.ts +2 -3
- package/dist/features/admin/components/AdminUsersView.js +108 -106
- package/dist/features/admin/components/AdminViewCards.d.ts +1 -1
- package/dist/features/admin/components/AdminWishlistsView.d.ts +2 -3
- package/dist/features/admin/components/AdminWishlistsView.js +36 -62
- package/dist/features/admin/components/DataListingView.d.ts +122 -0
- package/dist/features/admin/components/DataListingView.js +66 -0
- package/dist/features/admin/components/index.d.ts +10 -4
- package/dist/features/admin/components/index.js +6 -2
- package/dist/features/admin/constants/filter-tabs.d.ts +23 -17
- package/dist/features/admin/constants/filter-tabs.js +21 -17
- package/dist/features/admin/hooks/useAdminListing.d.ts +59 -0
- package/dist/features/admin/hooks/useAdminListing.js +71 -0
- package/dist/features/admin/schemas/firestore.js +6 -7
- package/dist/features/auctions/server.d.ts +0 -1
- package/dist/features/auctions/server.js +0 -1
- package/dist/features/auth/actions/realtime-token-actions.js +1 -1
- package/dist/features/auth/repository/user.repository.js +1 -1
- package/dist/features/auth/schemas/firestore.d.ts +1 -0
- package/dist/features/blog/components/BlogIndexListing.js +3 -6
- package/dist/features/cart/repository/cart.repository.d.ts +4 -1
- package/dist/features/cart/repository/cart.repository.js +12 -0
- package/dist/features/categories/components/CategoriesIndexListing.js +3 -6
- package/dist/features/checkout/hooks/useCheckoutApi.d.ts +0 -2
- package/dist/features/checkout/index.d.ts +1 -1
- package/dist/features/events/components/AdminEventsView.d.ts +3 -3
- package/dist/features/events/components/AdminEventsView.js +50 -86
- package/dist/features/events/components/EventOfferCard.d.ts +19 -0
- package/dist/features/events/components/EventOfferCard.js +29 -0
- package/dist/features/events/components/EventRaffleEntryForm.d.ts +25 -0
- package/dist/features/events/components/EventRaffleEntryForm.js +37 -0
- package/dist/features/events/components/EventRafflesSection.d.ts +1 -4
- package/dist/features/events/components/EventRafflesSection.js +17 -6
- package/dist/features/events/components/EventSaleBanner.d.ts +21 -0
- package/dist/features/events/components/EventSaleBanner.js +18 -0
- package/dist/features/events/components/EventsIndexListing.js +3 -4
- package/dist/features/events/components/index.d.ts +6 -0
- package/dist/features/events/components/index.js +4 -0
- package/dist/features/events/repository/event-entry.repository.d.ts +5 -0
- package/dist/features/events/repository/event-entry.repository.js +7 -0
- package/dist/features/filters/AsyncFacetSection.d.ts +1 -1
- package/dist/features/homepage/components/AnnouncementBar.d.ts +4 -1
- package/dist/features/homepage/components/AnnouncementBar.js +51 -4
- package/dist/features/homepage/components/FAQSection.d.ts +0 -5
- package/dist/features/homepage/components/MarketplaceHomepageView.d.ts +3 -1
- package/dist/features/homepage/components/MarketplaceHomepageView.js +2 -2
- package/dist/features/homepage/components/index.d.ts +1 -1
- package/dist/features/homepage/components/index.js +1 -1
- package/dist/features/homepage/lib/live-stats.js +1 -1
- package/dist/features/homepage/lib/section-renderer.d.ts +2 -2
- package/dist/features/homepage/lib/section-renderer.js +2 -2
- package/dist/features/homepage/schemas/firestore.d.ts +0 -2
- package/dist/features/layout/index.d.ts +0 -2
- package/dist/features/layout/index.js +0 -1
- package/dist/features/orders/repository/orders.repository.d.ts +0 -1
- package/dist/features/orders/repository/orders.repository.js +0 -1
- package/dist/features/orders/server.d.ts +1 -1
- package/dist/features/orders/server.js +1 -1
- package/dist/features/pre-orders/server.d.ts +0 -1
- package/dist/features/pre-orders/server.js +0 -1
- package/dist/features/products/components/GroupSettingsPanel.js +65 -49
- package/dist/features/products/components/PrizeDrawItemsEditor.js +2 -2
- package/dist/features/products/components/PrizeDrawsSection.d.ts +1 -4
- package/dist/features/products/components/PrizeDrawsSection.js +17 -6
- package/dist/features/products/components/PrizeRevealModal.js +1 -1
- package/dist/features/products/components/ProductCardMetadataSection.d.ts +11 -0
- package/dist/features/products/components/ProductCardMetadataSection.js +25 -0
- package/dist/features/products/components/ProductDetailPageView.js +3 -1
- package/dist/features/products/components/ProductFeaturesSelector.js +1 -1
- package/dist/features/products/components/ProductGradingTab.d.ts +13 -0
- package/dist/features/products/components/ProductGradingTab.js +25 -0
- package/dist/features/products/components/ProductGrid.js +14 -2
- package/dist/features/products/components/ProductTabsShell.d.ts +5 -1
- package/dist/features/products/components/ProductTabsShell.js +6 -1
- package/dist/features/products/components/index.d.ts +4 -0
- package/dist/features/products/components/index.js +3 -0
- package/dist/features/products/constants/action-defs.d.ts +5 -0
- package/dist/features/products/constants/action-defs.js +52 -32
- package/dist/features/products/constants/sieve.d.ts +24 -4
- package/dist/features/products/constants/sieve.js +20 -11
- package/dist/features/products/repository/products.repository.d.ts +0 -2
- package/dist/features/products/repository/products.repository.js +0 -2
- package/dist/features/products/schemas/firestore.d.ts +17 -0
- package/dist/features/products/schemas/product-features.validators.d.ts +2 -2
- package/dist/features/products/schemas/product-templates.d.ts +2 -4
- package/dist/features/products/server.d.ts +1 -1
- package/dist/features/products/server.js +1 -1
- package/dist/features/products/types/index.d.ts +4 -0
- package/dist/features/promotions/components/CouponCard.js +5 -5
- package/dist/features/promotions/components/CouponsIndexListing.js +3 -2
- package/dist/features/promotions/server.d.ts +0 -1
- package/dist/features/promotions/server.js +0 -1
- package/dist/features/reviews/components/ReviewsIndexListing.js +3 -4
- package/dist/features/reviews/repository/reviews.repository.d.ts +0 -1
- package/dist/features/reviews/repository/reviews.repository.js +0 -1
- package/dist/features/reviews/server.d.ts +1 -1
- package/dist/features/reviews/server.js +1 -1
- package/dist/features/search/api/route.js +44 -1
- package/dist/features/search/components/Search.js +2 -0
- package/dist/features/search/hooks/useNavSuggestions.d.ts +5 -1
- package/dist/features/search/hooks/useNavSuggestions.js +31 -4
- package/dist/features/seller/components/BrandInlineSelect.js +2 -2
- package/dist/features/seller/components/CategoryInlineSelect.js +2 -2
- package/dist/features/seller/components/SellerAddressesView.js +10 -20
- package/dist/features/seller/components/SellerAuctionsView.d.ts +3 -3
- package/dist/features/seller/components/SellerAuctionsView.js +67 -106
- package/dist/features/seller/components/SellerBidsView.js +6 -6
- package/dist/features/seller/components/SellerBundlesView.js +72 -105
- package/dist/features/seller/components/SellerClassifiedView.js +74 -105
- package/dist/features/seller/components/SellerCouponEditorView.js +1 -1
- package/dist/features/seller/components/SellerCouponsView.d.ts +2 -2
- package/dist/features/seller/components/SellerCouponsView.js +51 -96
- package/dist/features/seller/components/SellerDigitalCodesView.js +70 -103
- package/dist/features/seller/components/SellerGroupedListingsView.js +34 -54
- package/dist/features/seller/components/SellerLiveView.js +70 -99
- package/dist/features/seller/components/SellerOffersPanel.js +1 -1
- package/dist/features/seller/components/SellerOffersView.d.ts +2 -2
- package/dist/features/seller/components/SellerOffersView.js +37 -70
- package/dist/features/seller/components/SellerOrdersView.d.ts +2 -2
- package/dist/features/seller/components/SellerOrdersView.js +10 -24
- package/dist/features/seller/components/SellerPayoutMethodsView.js +12 -24
- package/dist/features/seller/components/SellerPayoutsView.d.ts +2 -2
- package/dist/features/seller/components/SellerPayoutsView.js +34 -69
- package/dist/features/seller/components/SellerPreOrdersView.d.ts +2 -2
- package/dist/features/seller/components/SellerPreOrdersView.js +55 -97
- package/dist/features/seller/components/SellerPrizeDrawsView.d.ts +2 -2
- package/dist/features/seller/components/SellerPrizeDrawsView.js +55 -97
- package/dist/features/seller/components/SellerProductShell.d.ts +1 -1
- package/dist/features/seller/components/SellerProductsFilterDrawer.d.ts +1 -1
- package/dist/features/seller/components/SellerProductsFilterDrawer.js +3 -6
- package/dist/features/seller/components/SellerProductsView.d.ts +2 -2
- package/dist/features/seller/components/SellerProductsView.js +24 -32
- package/dist/features/seller/components/SellerShippingConfigsView.js +12 -24
- package/dist/features/seller/components/SellerSidebar.d.ts +0 -4
- package/dist/features/seller/components/SellerSidebar.js +0 -2
- package/dist/features/seller/components/SellerStoreCategoriesView.js +15 -34
- package/dist/features/seller/components/SellerTemplatesView.js +27 -43
- package/dist/features/seller/components/SellersListView.d.ts +1 -2
- package/dist/features/seller/components/analytics/SellerAnalyticsStats.d.ts +5 -0
- package/dist/features/seller/components/analytics/SellerAnalyticsStats.js +2 -8
- package/dist/features/seller/components/index.d.ts +0 -3
- package/dist/features/seller/components/index.js +0 -2
- package/dist/features/seller/server.d.ts +0 -1
- package/dist/features/seller/server.js +0 -1
- package/dist/features/shell/FormShell.d.ts +1 -1
- package/dist/features/shell/FormShell.js +4 -1
- package/dist/features/shell/field-groups/ImageFieldGroup.d.ts +18 -0
- package/dist/features/shell/field-groups/ImageFieldGroup.js +15 -0
- package/dist/features/shell/field-groups/SeoFieldGroup.d.ts +22 -0
- package/dist/features/shell/field-groups/SeoFieldGroup.js +16 -0
- package/dist/features/shell/field-groups/StatusFieldGroup.d.ts +35 -0
- package/dist/features/shell/field-groups/StatusFieldGroup.js +16 -0
- package/dist/features/shell/field-groups/TitleDescriptionGroup.d.ts +40 -0
- package/dist/features/shell/field-groups/TitleDescriptionGroup.js +16 -0
- package/dist/features/shell/field-groups/index.d.ts +13 -0
- package/dist/features/shell/field-groups/index.js +9 -0
- package/dist/features/shell/index.d.ts +2 -0
- package/dist/features/shell/index.js +1 -0
- package/dist/features/stores/components/StoreCapabilitiesGuideView.d.ts +1 -2
- package/dist/features/stores/components/StoreFinanceGuideView.d.ts +1 -2
- package/dist/features/stores/components/StoreHeader.js +2 -1
- package/dist/features/stores/components/StoreListingsGuideView.d.ts +1 -2
- package/dist/features/stores/components/StoreOrdersGuideView.d.ts +1 -2
- package/dist/features/stores/components/StoreReviewsListing.js +3 -4
- package/dist/features/stores/components/StoreScopedSearch.d.ts +16 -0
- package/dist/features/stores/components/StoreScopedSearch.js +27 -0
- package/dist/features/stores/components/StoreSettingsGuideView.d.ts +1 -2
- package/dist/features/stores/components/StoresIndexListing.js +3 -4
- package/dist/features/stores/server.d.ts +0 -1
- package/dist/features/stores/server.js +0 -1
- package/dist/features/support/schemas/firestore.d.ts +22 -1
- package/dist/features/support/schemas/firestore.js +10 -0
- package/dist/features/wishlist/server.d.ts +0 -1
- package/dist/features/wishlist/server.js +0 -1
- package/dist/index.d.ts +11 -33
- package/dist/index.js +17 -62
- package/dist/next/routing/route-map.d.ts +8 -0
- package/dist/next/routing/route-map.js +4 -0
- package/dist/react/contexts/SessionContext.d.ts +2 -0
- package/dist/react/contexts/SessionContext.js +2 -0
- package/dist/react/hooks/useEntityDelete.d.ts +15 -0
- package/dist/react/hooks/useEntityDelete.js +39 -0
- package/dist/react/hooks/useListingTypeFlags.d.ts +32 -0
- package/dist/react/hooks/useListingTypeFlags.js +19 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +2 -0
- package/dist/repositories/index.d.ts +3 -3
- package/dist/repositories/index.js +3 -3
- package/dist/security/index.d.ts +1 -1
- package/dist/security/index.js +1 -1
- package/dist/security/pii-redact.d.ts +8 -0
- package/dist/security/pii-redact.js +10 -1
- package/dist/seed/grouped-listings-seed-data.d.ts +4 -0
- package/dist/seed/products-preorders-seed-data.d.ts +4 -0
- package/dist/seed/products-prize-draws-seed-data.js +3 -0
- package/dist/seed/site-settings-seed-data.js +5 -5
- package/dist/seed/sub-listings-seed-data.d.ts +4 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +4 -0
- package/dist/styles.css +54 -395
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/components/BaseListingCard.d.ts +10 -0
- package/dist/ui/components/BaseListingCard.js +17 -1
- package/dist/ui/components/DetailPageGallery.d.ts +32 -0
- package/dist/ui/components/DetailPageGallery.js +47 -0
- package/dist/ui/components/DetailPageHero.d.ts +30 -0
- package/dist/ui/components/DetailPageHero.js +22 -0
- package/dist/ui/components/DetailPageTabs.d.ts +34 -0
- package/dist/ui/components/DetailPageTabs.js +38 -0
- package/dist/ui/components/HorizontalScroller.style.css +15 -2
- package/dist/ui/components/ListingFilterDrawer.d.ts +10 -0
- package/dist/ui/components/ListingFilterDrawer.js +8 -0
- package/dist/ui/components/ListingLayout.d.ts +11 -2
- package/dist/ui/components/ListingLayout.js +12 -6
- package/dist/ui/components/PaginatedSelect.d.ts +66 -0
- package/dist/ui/components/PaginatedSelect.js +201 -0
- package/dist/ui/components/PaginatedSelect.style.css +254 -0
- package/dist/ui/components/Semantic.d.ts +0 -4
- package/dist/ui/components/Semantic.js +0 -2
- package/dist/ui/components/SettingsSection.d.ts +47 -0
- package/dist/ui/components/SettingsSection.js +38 -0
- package/dist/ui/components/index.style.css +1 -4
- package/dist/ui/index.d.ts +14 -14
- package/dist/ui/index.js +7 -7
- package/dist/utils/id-generators.d.ts +1 -18
- package/dist/utils/id-generators.js +51 -18
- package/dist/validation/schemas.d.ts +25 -0
- package/dist/validation/schemas.js +28 -0
- package/package.json +1 -1
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import type { ReactNode, MouseEvent } from "react";
|
|
2
|
+
export interface BaseListingCardIconOverlayProps {
|
|
3
|
+
/** Single icon (emoji or `/media/<slug>` URL) — typically `product.groupIcon`. */
|
|
4
|
+
groupIcon?: string;
|
|
5
|
+
/** Second icon — typically `product.sublistingIcon`. */
|
|
6
|
+
sublistingIcon?: string;
|
|
7
|
+
/** Where the overlay sits inside the hero. */
|
|
8
|
+
position?: string;
|
|
9
|
+
}
|
|
2
10
|
export interface BaseListingCardRootProps {
|
|
3
11
|
className?: string;
|
|
4
12
|
isSelected?: boolean;
|
|
@@ -36,9 +44,11 @@ declare function BaseListingCardRoot({ className, isSelected, isDisabled, varian
|
|
|
36
44
|
declare function BaseListingCardHero({ aspect, variant, className, children, onMouseEnter, onMouseLeave, }: BaseListingCardHeroProps): import("react/jsx-runtime").JSX.Element;
|
|
37
45
|
declare function BaseListingCardInfo({ variant, className, children, }: BaseListingCardInfoProps): import("react/jsx-runtime").JSX.Element;
|
|
38
46
|
declare function BaseListingCardCheckbox({ selected, onSelect, label, position, className, }: BaseListingCardCheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
declare function BaseListingCardIconOverlay({ groupIcon, sublistingIcon, position, }: BaseListingCardIconOverlayProps): import("react/jsx-runtime").JSX.Element | null;
|
|
39
48
|
export declare const BaseListingCard: typeof BaseListingCardRoot & {
|
|
40
49
|
Hero: typeof BaseListingCardHero;
|
|
41
50
|
Info: typeof BaseListingCardInfo;
|
|
42
51
|
Checkbox: typeof BaseListingCardCheckbox;
|
|
52
|
+
IconOverlay: typeof BaseListingCardIconOverlay;
|
|
43
53
|
};
|
|
44
54
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Span } from "./Typography";
|
|
2
3
|
function BaseListingCardRoot({ className = "", isSelected, isDisabled, variant = "grid", onClick, onMouseDown, onMouseUp, onMouseLeave, onTouchStart, onTouchEnd, children, }) {
|
|
3
4
|
return (_jsx("div", { onClick: onClick, onMouseDown: onMouseDown, onMouseUp: onMouseUp, onMouseLeave: onMouseLeave, onTouchStart: onTouchStart, onTouchEnd: onTouchEnd, className: [
|
|
4
5
|
"group relative w-full min-w-0 overflow-hidden rounded-xl border bg-white dark:bg-zinc-900 transition-shadow",
|
|
@@ -62,8 +63,23 @@ function BaseListingCardCheckbox({ selected, onSelect, label, position = "top-2
|
|
|
62
63
|
.filter(Boolean)
|
|
63
64
|
.join(" "), children: selected && (_jsx("svg", { className: "w-2.5 h-2.5 text-white", viewBox: "0 0 10 10", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M1.5 5L4 7.5L8.5 2.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })) }));
|
|
64
65
|
}
|
|
66
|
+
function BaseListingCardIconOverlay({ groupIcon, sublistingIcon, position = "top-2 right-2", }) {
|
|
67
|
+
if (!groupIcon && !sublistingIcon)
|
|
68
|
+
return null;
|
|
69
|
+
const renderOne = (icon, key) => {
|
|
70
|
+
const isMediaUrl = icon.startsWith("/media/") || icon.startsWith("http");
|
|
71
|
+
if (isMediaUrl) {
|
|
72
|
+
return (
|
|
73
|
+
// eslint-disable-next-line @next/next/no-img-element, lir/no-raw-media-elements
|
|
74
|
+
_jsx("img", { src: icon, alt: "", className: "w-5 h-5 rounded-full border border-white/80 shadow-sm bg-white dark:bg-zinc-900 object-cover" }, key));
|
|
75
|
+
}
|
|
76
|
+
return (_jsx(Span, { size: "sm", className: "inline-flex items-center justify-center w-5 h-5 rounded-full border border-white/80 bg-white/95 dark:bg-zinc-900/95 shadow-sm leading-none", children: icon }, key));
|
|
77
|
+
};
|
|
78
|
+
return (_jsxs("div", { className: `absolute z-10 flex items-center gap-1 ${position}`, "aria-hidden": "true", children: [groupIcon && renderOne(groupIcon, "group"), sublistingIcon && renderOne(sublistingIcon, "sublisting")] }));
|
|
79
|
+
}
|
|
65
80
|
export const BaseListingCard = Object.assign(BaseListingCardRoot, {
|
|
66
81
|
Hero: BaseListingCardHero,
|
|
67
82
|
Info: BaseListingCardInfo,
|
|
68
83
|
Checkbox: BaseListingCardCheckbox,
|
|
84
|
+
IconOverlay: BaseListingCardIconOverlay,
|
|
69
85
|
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface DetailPageGalleryImage {
|
|
3
|
+
/** Public URL (resolved to `/media/<slug>` already). */
|
|
4
|
+
url: string;
|
|
5
|
+
/** Alt text — falls back to the gallery title if omitted. */
|
|
6
|
+
alt?: string;
|
|
7
|
+
/** Optional caption rendered beneath the image. */
|
|
8
|
+
caption?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export interface DetailPageGalleryProps {
|
|
11
|
+
/** Image list. Empty array renders the fallback. */
|
|
12
|
+
images: DetailPageGalleryImage[];
|
|
13
|
+
/** Default title used as alt-text fallback. */
|
|
14
|
+
title?: string;
|
|
15
|
+
/** Aspect ratio for the main image — defaults to `square`. */
|
|
16
|
+
aspect?: "square" | "video" | "portrait" | "wide";
|
|
17
|
+
/** Optional fallback slot rendered when `images` is empty. */
|
|
18
|
+
fallback?: ReactNode;
|
|
19
|
+
/** Initial selected index. */
|
|
20
|
+
initialIndex?: number;
|
|
21
|
+
/** Additional classes appended to the outer wrapper. */
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* `DetailPageGallery` — main image + thumbnail strip used by Product, Auction
|
|
26
|
+
* and PreOrder detail pages. Lightweight presentational component — domain
|
|
27
|
+
* logic (zoom, hover-preview, image-cycling-on-tap) is opt-in by the consumer
|
|
28
|
+
* via overlays.
|
|
29
|
+
*
|
|
30
|
+
* W1-14 — extracted 2026-05-23.
|
|
31
|
+
*/
|
|
32
|
+
export declare function DetailPageGallery({ images, title, aspect, fallback, initialIndex, className, }: DetailPageGalleryProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Div } from "./Div";
|
|
5
|
+
const ASPECT_CLASS = {
|
|
6
|
+
square: "aspect-square",
|
|
7
|
+
video: "aspect-video",
|
|
8
|
+
portrait: "aspect-[3/4]",
|
|
9
|
+
wide: "aspect-[16/9]",
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* `DetailPageGallery` — main image + thumbnail strip used by Product, Auction
|
|
13
|
+
* and PreOrder detail pages. Lightweight presentational component — domain
|
|
14
|
+
* logic (zoom, hover-preview, image-cycling-on-tap) is opt-in by the consumer
|
|
15
|
+
* via overlays.
|
|
16
|
+
*
|
|
17
|
+
* W1-14 — extracted 2026-05-23.
|
|
18
|
+
*/
|
|
19
|
+
export function DetailPageGallery({ images, title, aspect = "square", fallback, initialIndex = 0, className, }) {
|
|
20
|
+
const [activeIndex, setActiveIndex] = useState(Math.min(Math.max(initialIndex, 0), Math.max(images.length - 1, 0)));
|
|
21
|
+
if (!images.length) {
|
|
22
|
+
return (_jsx(Div, { className: [
|
|
23
|
+
"appkit-detail-gallery",
|
|
24
|
+
"w-full overflow-hidden rounded-2xl bg-zinc-100 dark:bg-zinc-800",
|
|
25
|
+
ASPECT_CLASS[aspect],
|
|
26
|
+
className,
|
|
27
|
+
]
|
|
28
|
+
.filter(Boolean)
|
|
29
|
+
.join(" "), children: fallback }));
|
|
30
|
+
}
|
|
31
|
+
const active = images[activeIndex] ?? images[0];
|
|
32
|
+
return (_jsxs(Div, { className: [
|
|
33
|
+
"appkit-detail-gallery",
|
|
34
|
+
"w-full space-y-2",
|
|
35
|
+
className,
|
|
36
|
+
]
|
|
37
|
+
.filter(Boolean)
|
|
38
|
+
.join(" "), children: [_jsx(Div, { className: [
|
|
39
|
+
"w-full overflow-hidden rounded-2xl bg-zinc-100 dark:bg-zinc-800",
|
|
40
|
+
ASPECT_CLASS[aspect],
|
|
41
|
+
].join(" "), children: _jsx("img", { src: active.url, alt: active.alt ?? title ?? "", className: "h-full w-full object-cover" }) }), images.length > 1 ? (_jsx(Div, { className: "flex gap-2 overflow-x-auto pb-1", children: images.map((img, idx) => (_jsx("button", { type: "button", "aria-label": `View image ${idx + 1}`, onClick: () => setActiveIndex(idx), className: [
|
|
42
|
+
"flex-shrink-0 h-16 w-16 overflow-hidden rounded-md border-2 transition-colors",
|
|
43
|
+
idx === activeIndex
|
|
44
|
+
? "border-[var(--appkit-color-primary)]"
|
|
45
|
+
: "border-transparent hover:border-zinc-300 dark:hover:border-zinc-600",
|
|
46
|
+
].join(" "), children: _jsx("img", { src: img.url, alt: img.alt ?? `${title ?? ""} ${idx + 1}`, className: "h-full w-full object-cover" }) }, img.url + idx))) })) : null, active.caption ? (_jsx(Div, { className: "text-xs text-zinc-500 dark:text-zinc-400", children: active.caption })) : null] }));
|
|
47
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface DetailPageHeroProps {
|
|
3
|
+
/** Page H1. */
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
/** Optional eyebrow (breadcrumb / pre-title chip). */
|
|
6
|
+
eyebrow?: ReactNode;
|
|
7
|
+
/** Optional secondary heading (subtitle). */
|
|
8
|
+
subtitle?: ReactNode;
|
|
9
|
+
/** Inline meta row directly below title — typically price + counts + badges. */
|
|
10
|
+
metaRow?: ReactNode;
|
|
11
|
+
/** Long-form description (markdown / plain text). */
|
|
12
|
+
description?: ReactNode;
|
|
13
|
+
/** Slot rendered to the left of the hero text — typically gallery / collage / hero image. */
|
|
14
|
+
mediaSlot?: ReactNode;
|
|
15
|
+
/** Primary CTA(s) rendered at the bottom of the text column. */
|
|
16
|
+
actionsSlot?: ReactNode;
|
|
17
|
+
/** Additional content rendered below `actionsSlot` (e.g. stock indicator, fine print). */
|
|
18
|
+
belowActions?: ReactNode;
|
|
19
|
+
/** Additional classes appended to the outer wrapper. */
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* `DetailPageHero` — the top hero region shared by every listing detail page
|
|
24
|
+
* (Product, Auction, PreOrder, Bundle, PrizeDraw). Renders a 2-column layout:
|
|
25
|
+
* media on the left (~40%), title + meta + description + actions on the right.
|
|
26
|
+
*
|
|
27
|
+
* Slots stay open so domain-specific badges, price components, and CTAs flow
|
|
28
|
+
* through unchanged. W1-14 — extracted 2026-05-23.
|
|
29
|
+
*/
|
|
30
|
+
export declare function DetailPageHero({ title, eyebrow, subtitle, metaRow, description, mediaSlot, actionsSlot, belowActions, className, }: DetailPageHeroProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Div } from "./Div";
|
|
4
|
+
import { Row, Stack } from "./Layout";
|
|
5
|
+
import { Heading, Text } from "./Typography";
|
|
6
|
+
/**
|
|
7
|
+
* `DetailPageHero` — the top hero region shared by every listing detail page
|
|
8
|
+
* (Product, Auction, PreOrder, Bundle, PrizeDraw). Renders a 2-column layout:
|
|
9
|
+
* media on the left (~40%), title + meta + description + actions on the right.
|
|
10
|
+
*
|
|
11
|
+
* Slots stay open so domain-specific badges, price components, and CTAs flow
|
|
12
|
+
* through unchanged. W1-14 — extracted 2026-05-23.
|
|
13
|
+
*/
|
|
14
|
+
export function DetailPageHero({ title, eyebrow, subtitle, metaRow, description, mediaSlot, actionsSlot, belowActions, className, }) {
|
|
15
|
+
return (_jsxs(Row, { gap: "lg", align: "start", className: [
|
|
16
|
+
"appkit-detail-hero",
|
|
17
|
+
"flex-col md:flex-row",
|
|
18
|
+
className,
|
|
19
|
+
]
|
|
20
|
+
.filter(Boolean)
|
|
21
|
+
.join(" "), children: [mediaSlot ? _jsx(Div, { className: "w-full md:w-2/5", children: mediaSlot }) : null, _jsxs(Stack, { gap: "md", className: "flex-1 min-w-0", children: [eyebrow ? (_jsx(Div, { className: "text-sm text-zinc-500 dark:text-zinc-400", children: eyebrow })) : null, _jsx(Heading, { level: 1, className: "text-3xl font-semibold text-zinc-900 dark:text-zinc-100", children: title }), subtitle ? (_jsx(Text, { size: "lg", color: "muted", children: subtitle })) : null, metaRow ? _jsx(Row, { gap: "sm", align: "center", className: "flex-wrap", children: metaRow }) : null, description ? (_jsx(Text, { className: "whitespace-pre-line", children: description })) : null, actionsSlot, belowActions] })] }));
|
|
22
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface DetailPageTab {
|
|
3
|
+
/** Stable tab id used for the URL `tab=` param and ARIA wiring. */
|
|
4
|
+
id: string;
|
|
5
|
+
/** Tab trigger label. */
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
/** Optional count chip rendered next to the label. */
|
|
8
|
+
count?: number;
|
|
9
|
+
/** Tab panel content. */
|
|
10
|
+
content: ReactNode;
|
|
11
|
+
/** When true, the tab is rendered but disabled. */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface DetailPageTabsProps {
|
|
15
|
+
/** Tab definitions. */
|
|
16
|
+
tabs: DetailPageTab[];
|
|
17
|
+
/** Controlled active tab id (omit for uncontrolled). */
|
|
18
|
+
activeTab?: string;
|
|
19
|
+
/** Default tab id (uncontrolled). */
|
|
20
|
+
defaultTab?: string;
|
|
21
|
+
/** Change callback. */
|
|
22
|
+
onTabChange?: (tabId: string) => void;
|
|
23
|
+
/** Additional classes appended to the outer wrapper. */
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* `DetailPageTabs` — tab shell used by Product, Auction and Event detail
|
|
28
|
+
* pages. Renders an accessible trigger strip + a single visible panel.
|
|
29
|
+
* Animation and URL sync are intentionally not baked in so consumers can
|
|
30
|
+
* wire those via the standard `useUrlTable` / `usePanelUrlSync` hooks.
|
|
31
|
+
*
|
|
32
|
+
* W1-14 — extracted 2026-05-23.
|
|
33
|
+
*/
|
|
34
|
+
export declare function DetailPageTabs({ tabs, activeTab: activeTabProp, defaultTab, onTabChange, className, }: DetailPageTabsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Div } from "./Div";
|
|
5
|
+
/**
|
|
6
|
+
* `DetailPageTabs` — tab shell used by Product, Auction and Event detail
|
|
7
|
+
* pages. Renders an accessible trigger strip + a single visible panel.
|
|
8
|
+
* Animation and URL sync are intentionally not baked in so consumers can
|
|
9
|
+
* wire those via the standard `useUrlTable` / `usePanelUrlSync` hooks.
|
|
10
|
+
*
|
|
11
|
+
* W1-14 — extracted 2026-05-23.
|
|
12
|
+
*/
|
|
13
|
+
export function DetailPageTabs({ tabs, activeTab: activeTabProp, defaultTab, onTabChange, className, }) {
|
|
14
|
+
const [internalActive, setInternalActive] = useState(defaultTab ?? tabs[0]?.id ?? "");
|
|
15
|
+
const activeTab = activeTabProp ?? internalActive;
|
|
16
|
+
const active = tabs.find((t) => t.id === activeTab) ?? tabs[0];
|
|
17
|
+
const handleChange = (id) => {
|
|
18
|
+
if (activeTabProp === undefined)
|
|
19
|
+
setInternalActive(id);
|
|
20
|
+
onTabChange?.(id);
|
|
21
|
+
};
|
|
22
|
+
return (_jsxs(Div, { className: [
|
|
23
|
+
"appkit-detail-tabs",
|
|
24
|
+
"space-y-4",
|
|
25
|
+
className,
|
|
26
|
+
]
|
|
27
|
+
.filter(Boolean)
|
|
28
|
+
.join(" "), children: [_jsx(Div, { role: "tablist", "aria-orientation": "horizontal", className: "flex gap-2 border-b border-zinc-200 dark:border-zinc-700 overflow-x-auto", children: tabs.map((tab) => {
|
|
29
|
+
const isActive = tab.id === active?.id;
|
|
30
|
+
return (_jsxs("button", { type: "button", role: "tab", "aria-selected": isActive, "aria-controls": `detail-tab-panel-${tab.id}`, id: `detail-tab-trigger-${tab.id}`, disabled: tab.disabled, onClick: () => handleChange(tab.id), className: [
|
|
31
|
+
"flex-shrink-0 px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",
|
|
32
|
+
isActive
|
|
33
|
+
? "border-[var(--appkit-color-primary)] text-zinc-900 dark:text-zinc-100"
|
|
34
|
+
: "border-transparent text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200",
|
|
35
|
+
tab.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer",
|
|
36
|
+
].join(" "), children: [tab.label, typeof tab.count === "number" ? (_jsx("span", { className: "ml-2 inline-flex items-center justify-center rounded-full bg-zinc-100 dark:bg-zinc-800 px-2 py-0.5 text-xs", children: tab.count })) : null] }, tab.id));
|
|
37
|
+
}) }), active ? (_jsx(Div, { role: "tabpanel", id: `detail-tab-panel-${active.id}`, "aria-labelledby": `detail-tab-trigger-${active.id}`, children: active.content })) : null] }));
|
|
38
|
+
}
|
|
@@ -18,11 +18,24 @@
|
|
|
18
18
|
scroll-snap-type: x mandatory;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
/* W1-47 — show a slim themed scrollbar instead of hiding it, so users can
|
|
22
|
+
* manually drag through the strip during auto-rotation. */
|
|
21
23
|
.appkit-hscroller__track--no-scrollbar {
|
|
22
|
-
scrollbar-width:
|
|
24
|
+
scrollbar-width: thin;
|
|
25
|
+
scrollbar-color: var(--appkit-color-border) transparent;
|
|
23
26
|
}
|
|
24
27
|
.appkit-hscroller__track--no-scrollbar::-webkit-scrollbar {
|
|
25
|
-
|
|
28
|
+
height: 6px;
|
|
29
|
+
}
|
|
30
|
+
.appkit-hscroller__track--no-scrollbar::-webkit-scrollbar-track {
|
|
31
|
+
background: transparent;
|
|
32
|
+
}
|
|
33
|
+
.appkit-hscroller__track--no-scrollbar::-webkit-scrollbar-thumb {
|
|
34
|
+
background: var(--appkit-color-border);
|
|
35
|
+
border-radius: 3px;
|
|
36
|
+
}
|
|
37
|
+
.appkit-hscroller__track--no-scrollbar::-webkit-scrollbar-thumb:hover {
|
|
38
|
+
background: var(--appkit-color-text-muted);
|
|
26
39
|
}
|
|
27
40
|
|
|
28
41
|
/* -- Items ------------------------------------------- */
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface ListingFilterDrawerProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
onApply: () => void;
|
|
6
|
+
onClear: () => void;
|
|
7
|
+
activeCount: number;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare function ListingFilterDrawer({ open, onClose, onApply, onClear, activeCount, children, }: ListingFilterDrawerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { X } from "lucide-react";
|
|
4
|
+
export function ListingFilterDrawer({ open, onClose, onApply, onClear, activeCount, children, }) {
|
|
5
|
+
if (!open)
|
|
6
|
+
return null;
|
|
7
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40 bg-black/40", "aria-hidden": "true", onClick: onClose }), _jsxs("div", { className: "fixed inset-y-0 left-0 z-50 flex w-80 flex-col bg-white dark:bg-slate-900 shadow-2xl", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: [_jsx("span", { className: "text-base font-semibold text-zinc-900 dark:text-zinc-100", children: "Filters" }), _jsxs("div", { className: "flex items-center gap-2", children: [activeCount > 0 && (_jsx("button", { type: "button", onClick: onClear, className: "text-xs text-zinc-500 hover:text-rose-500 dark:text-zinc-400 transition-colors", children: "Clear all" })), _jsx("button", { type: "button", onClick: onClose, "aria-label": "Close", className: "rounded-lg p-1.5 text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors", children: _jsx(X, { className: "h-5 w-5" }) })] })] }), _jsx("div", { className: "flex-1 overflow-y-auto px-4 py-4 space-y-5", children: children }), _jsx("div", { className: "border-t border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: _jsxs("button", { type: "button", onClick: onApply, className: "w-full rounded-lg bg-primary py-2.5 text-sm font-semibold text-white hover:bg-primary-600 transition-colors active:scale-[0.98]", children: ["Apply Filters", activeCount > 0 ? ` (${activeCount})` : ""] }) })] })] }));
|
|
8
|
+
}
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { ReactNode } from "react";
|
|
21
21
|
import type { BulkActionItem } from "./BulkActionBar";
|
|
22
|
+
import type { ViewPortal } from "./Layout";
|
|
22
23
|
export interface ListingLayoutLabels {
|
|
23
24
|
filtersTitle?: string;
|
|
24
25
|
clearAll?: string;
|
|
@@ -48,7 +49,9 @@ export interface ListingLayoutProps {
|
|
|
48
49
|
resultCountSlot?: ReactNode;
|
|
49
50
|
toolbarPaginationSlot?: ReactNode;
|
|
50
51
|
paginationSlot?: ReactNode;
|
|
51
|
-
children
|
|
52
|
+
/** Optional — when `detailView` is provided, children are bypassed; when `overlays`-only,
|
|
53
|
+
* the layout still renders empty toolbar + sidebar around no content. */
|
|
54
|
+
children?: ReactNode;
|
|
52
55
|
/** When true, sticky toolbar sits at top-0 (inside overflow-y-auto container).
|
|
53
56
|
* When false, accounts for a top navbar above (top-14/top-[120px]). */
|
|
54
57
|
isDashboard?: boolean;
|
|
@@ -59,5 +62,11 @@ export interface ListingLayoutProps {
|
|
|
59
62
|
loading?: boolean;
|
|
60
63
|
errorSlot?: ReactNode;
|
|
61
64
|
labels?: ListingLayoutLabels;
|
|
65
|
+
/** Portal context — sets `isDashboard` default (admin/seller=true, user/public=false). */
|
|
66
|
+
portal?: ViewPortal;
|
|
67
|
+
/** Overlay elements rendered after the layout (drawers, modals, confirm dialogs). */
|
|
68
|
+
overlays?: ReactNode;
|
|
69
|
+
/** When provided, the entire layout is replaced with this view (detail/edit mode). */
|
|
70
|
+
detailView?: ReactNode;
|
|
62
71
|
}
|
|
63
|
-
export declare function ListingLayout({ headerSlot, statusTabsSlot, filterContent, filterActiveCount, onFilterApply, onFilterClear, filterTitle, activeFiltersSlot, resultCountSlot, searchSlot, sortSlot, viewToggleSlot, actionsSlot, selectedCount, onClearSelection, bulkActionItems, toolbarPaginationSlot, paginationSlot, children, isDashboard, defaultSidebarOpen, filterPendingCount, className, loading, errorSlot, labels, }: ListingLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
72
|
+
export declare function ListingLayout({ headerSlot, statusTabsSlot, filterContent, filterActiveCount, onFilterApply, onFilterClear, filterTitle, activeFiltersSlot, resultCountSlot, searchSlot, sortSlot, viewToggleSlot, actionsSlot, selectedCount, onClearSelection, bulkActionItems, toolbarPaginationSlot, paginationSlot, children, isDashboard, defaultSidebarOpen, filterPendingCount, className, loading, errorSlot, labels, portal, overlays, detailView, }: ListingLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
/**
|
|
4
4
|
* ListingLayout
|
|
5
5
|
*
|
|
@@ -34,7 +34,13 @@ const DEFAULT_LABELS = {
|
|
|
34
34
|
hideFilters: "Hide filters",
|
|
35
35
|
filterActiveCount: (count) => `${count} active`,
|
|
36
36
|
};
|
|
37
|
-
export function ListingLayout({ headerSlot, statusTabsSlot, filterContent, filterActiveCount = 0, onFilterApply, onFilterClear, filterTitle, activeFiltersSlot, resultCountSlot, searchSlot, sortSlot, viewToggleSlot, actionsSlot, selectedCount = 0, onClearSelection, bulkActionItems, toolbarPaginationSlot, paginationSlot, children, isDashboard
|
|
37
|
+
export function ListingLayout({ headerSlot, statusTabsSlot, filterContent, filterActiveCount = 0, onFilterApply, onFilterClear, filterTitle, activeFiltersSlot, resultCountSlot, searchSlot, sortSlot, viewToggleSlot, actionsSlot, selectedCount = 0, onClearSelection, bulkActionItems, toolbarPaginationSlot, paginationSlot, children, isDashboard, defaultSidebarOpen = false, filterPendingCount, className = "", loading = false, errorSlot, labels, portal, overlays, detailView, }) {
|
|
38
|
+
// Detail view short-circuit (folded from ListingViewShell)
|
|
39
|
+
if (detailView) {
|
|
40
|
+
return _jsx(_Fragment, { children: detailView });
|
|
41
|
+
}
|
|
42
|
+
// Portal-derived isDashboard default (folded from ListingViewShell)
|
|
43
|
+
const effectiveIsDashboard = isDashboard ?? (portal === "admin" || portal === "seller");
|
|
38
44
|
const l = { ...DEFAULT_LABELS, ...labels };
|
|
39
45
|
const [sidebarOpen, setSidebarOpen] = useState(defaultSidebarOpen);
|
|
40
46
|
const [mobileFilterOpen, setMobileFilterOpen] = useState(false);
|
|
@@ -56,7 +62,7 @@ export function ListingLayout({ headerSlot, statusTabsSlot, filterContent, filte
|
|
|
56
62
|
.filter(Boolean)
|
|
57
63
|
.join(" "), children: [headerSlot, statusTabsSlot && (_jsx("div", { className: "appkit-listing-layout__status-tabs", "data-section": "listinglayout-div-539", children: statusTabsSlot })), _jsxs("div", { className: [
|
|
58
64
|
"appkit-listing-layout__toolbar",
|
|
59
|
-
|
|
65
|
+
effectiveIsDashboard
|
|
60
66
|
? "appkit-listing-layout__toolbar--dashboard"
|
|
61
67
|
: "appkit-listing-layout__toolbar--page",
|
|
62
68
|
].join(" "), "data-section": "listinglayout-div-540", children: [_jsxs("div", { className: "appkit-listing-layout__toolbar-row appkit-listing-layout__toolbar-row--desktop", "data-section": "listinglayout-div-541", children: [hasFilter && (_jsxs(Button, { type: "button", variant: "outline", size: "sm", onClick: () => setSidebarOpen((prev) => !prev), "aria-label": sidebarOpen ? l.hideFilters : l.showFilters, "aria-expanded": sidebarOpen, className: [
|
|
@@ -73,7 +79,7 @@ export function ListingLayout({ headerSlot, statusTabsSlot, filterContent, filte
|
|
|
73
79
|
clearSelection: l.clearAll,
|
|
74
80
|
} }) }))] }), _jsxs("div", { className: "appkit-listing-layout__body", "data-section": "listinglayout-div-552", children: [hasFilter && (_jsx(Aside, { "aria-label": panelTitle, className: [
|
|
75
81
|
"appkit-listing-layout__sidebar",
|
|
76
|
-
|
|
82
|
+
effectiveIsDashboard
|
|
77
83
|
? "appkit-listing-layout__sidebar--dashboard"
|
|
78
84
|
: "appkit-listing-layout__sidebar--page",
|
|
79
85
|
sidebarOpen
|
|
@@ -83,7 +89,7 @@ export function ListingLayout({ headerSlot, statusTabsSlot, filterContent, filte
|
|
|
83
89
|
? `${l.applyFilters} (${filterPendingCount})`
|
|
84
90
|
: l.applyFilters }) })] }) })), _jsxs("div", { className: "appkit-listing-layout__content", "data-section": "listinglayout-div-557", children: [activeFiltersSlot, resultCountSlot && (_jsx("div", { className: "appkit-listing-layout__result-count", "data-section": "listinglayout-div-558", children: resultCountSlot })), errorSlot ? (errorSlot) : (_jsxs(_Fragment, { children: [children, paginationSlot && (_jsx("div", { className: "appkit-listing-layout__pagination", "data-section": "listinglayout-div-559", children: paginationSlot }))] }))] })] }), toolbarPaginationSlot && (_jsx(Nav, { "aria-label": "Pagination", className: [
|
|
85
91
|
"appkit-listing-layout__mobile-pagination",
|
|
86
|
-
|
|
92
|
+
effectiveIsDashboard
|
|
87
93
|
? "appkit-listing-layout__mobile-pagination--dashboard"
|
|
88
94
|
: selectedCount > 0
|
|
89
95
|
? "appkit-listing-layout__mobile-pagination--bulk"
|
|
@@ -92,7 +98,7 @@ export function ListingLayout({ headerSlot, statusTabsSlot, filterContent, filte
|
|
|
92
98
|
? `${panelTitle} (${filterActiveCount})`
|
|
93
99
|
: panelTitle, footer: _jsxs("div", { className: "appkit-listing-layout__mobile-overlay-footer", "data-section": "listinglayout-div-560", children: [_jsx(Button, { type: "button", variant: "secondary", className: "flex-1 rounded-xl", onClick: () => onFilterClear?.(), children: l.clearAll }), _jsx(Button, { type: "button", variant: "primary", className: "flex-1 rounded-xl", onClick: handleMobileApply, children: filterPendingCount != null && filterPendingCount > 0
|
|
94
100
|
? `${l.applyFilters} (${filterPendingCount})`
|
|
95
|
-
: l.applyFilters })] }), children: filterContent }))] }));
|
|
101
|
+
: l.applyFilters })] }), children: filterContent })), overlays] }));
|
|
96
102
|
}
|
|
97
103
|
function FilterIcon() {
|
|
98
104
|
return (_jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 4a1 1 0 011-1h16a1 1 0 011 1v2a1 1 0 01-.293.707L13 13.414V19a1 1 0 01-.553.894l-4 2A1 1 0 017 21v-7.586L3.293 6.707A1 1 0 013 6V4z" }) }));
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import type { QuickFieldDef } from "../../features/shell/QuickFormDrawer";
|
|
3
|
+
export interface PaginatedSelectOption<V = string> {
|
|
4
|
+
value: V;
|
|
5
|
+
label: string;
|
|
6
|
+
meta?: Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
export interface AsyncPage<T> {
|
|
9
|
+
items: T[];
|
|
10
|
+
hasMore: boolean;
|
|
11
|
+
nextPage?: number;
|
|
12
|
+
}
|
|
13
|
+
interface BaseProps<V> {
|
|
14
|
+
options?: PaginatedSelectOption<V>[];
|
|
15
|
+
loadOptions?: (query: string, page: number) => Promise<AsyncPage<PaginatedSelectOption<V>>>;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
searchPlaceholder?: string;
|
|
18
|
+
noResultsText?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
className?: string;
|
|
21
|
+
ariaLabel?: string;
|
|
22
|
+
/** "+ Create new …" button. Provide `renderCreateForm` OR (`createFields` + `onCreateSubmit`). */
|
|
23
|
+
createLabel?: string;
|
|
24
|
+
drawerTitle?: string;
|
|
25
|
+
renderCreateForm?: (props: {
|
|
26
|
+
onCreated: (option: PaginatedSelectOption<V>) => void;
|
|
27
|
+
onCancel: () => void;
|
|
28
|
+
}) => ReactNode;
|
|
29
|
+
createFields?: QuickFieldDef[];
|
|
30
|
+
onCreateSubmit?: (values: Record<string, unknown>) => Promise<PaginatedSelectOption<V>>;
|
|
31
|
+
createSubmitLabel?: string;
|
|
32
|
+
}
|
|
33
|
+
interface SingleProps<V> extends BaseProps<V> {
|
|
34
|
+
multiple?: false;
|
|
35
|
+
value?: V | null;
|
|
36
|
+
onChange?: (value: V | null, option: PaginatedSelectOption<V> | null) => void;
|
|
37
|
+
}
|
|
38
|
+
interface MultiProps<V> extends BaseProps<V> {
|
|
39
|
+
multiple: true;
|
|
40
|
+
value: V[];
|
|
41
|
+
onChange: (values: V[], options: PaginatedSelectOption<V>[]) => void;
|
|
42
|
+
maxChipsVisible?: number;
|
|
43
|
+
}
|
|
44
|
+
export type PaginatedSelectProps<V = string> = SingleProps<V> | MultiProps<V>;
|
|
45
|
+
/**
|
|
46
|
+
* PaginatedSelect — searchable, async-paginated select with optional multi-mode
|
|
47
|
+
* and optional inline create-new drawer. Replaces DynamicSelect, InlineCreateSelect,
|
|
48
|
+
* and PaginatedMultiSelect.
|
|
49
|
+
*
|
|
50
|
+
* @example single-select
|
|
51
|
+
* <PaginatedSelect value={storeId} onChange={setStoreId} loadOptions={loadStores} />
|
|
52
|
+
*
|
|
53
|
+
* @example single-select with inline create
|
|
54
|
+
* <PaginatedSelect
|
|
55
|
+
* value={categoryId}
|
|
56
|
+
* onChange={(v) => setCategoryId(v ?? "")}
|
|
57
|
+
* loadOptions={loadCategories}
|
|
58
|
+
* createLabel="Category"
|
|
59
|
+
* renderCreateForm={({ onCreated, onCancel }) => <CategoryForm ... />}
|
|
60
|
+
* />
|
|
61
|
+
*
|
|
62
|
+
* @example multi-select
|
|
63
|
+
* <PaginatedSelect multiple value={tagIds} onChange={setTagIds} loadOptions={loadTags} />
|
|
64
|
+
*/
|
|
65
|
+
export declare function PaginatedSelect<V = string>(props: PaginatedSelectProps<V>): import("react/jsx-runtime").JSX.Element;
|
|
66
|
+
export {};
|