@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
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
|
+
import { Input } from "./Input";
|
|
5
|
+
import { SideDrawer } from "./SideDrawer";
|
|
6
|
+
import { Button } from "./Button";
|
|
7
|
+
import { QuickFormDrawer } from "../../features/shell/QuickFormDrawer";
|
|
8
|
+
const C = {
|
|
9
|
+
root: "appkit-ps",
|
|
10
|
+
chips: "appkit-ps__chips",
|
|
11
|
+
chip: "appkit-ps__chip",
|
|
12
|
+
chipLabel: "appkit-ps__chip-label",
|
|
13
|
+
chipRemove: "appkit-ps__chip-remove",
|
|
14
|
+
overflowChip: "appkit-ps__overflow-chip",
|
|
15
|
+
trigger: "appkit-ps__trigger",
|
|
16
|
+
triggerDisabled: "appkit-ps__trigger--disabled",
|
|
17
|
+
placeholder: "appkit-ps__placeholder",
|
|
18
|
+
triggerLeft: "appkit-ps__trigger-left",
|
|
19
|
+
dropdown: "appkit-ps__dropdown",
|
|
20
|
+
search: "appkit-ps__search",
|
|
21
|
+
list: "appkit-ps__list",
|
|
22
|
+
option: "appkit-ps__option",
|
|
23
|
+
optionSelected: "appkit-ps__option--selected",
|
|
24
|
+
checkbox: "appkit-ps__checkbox",
|
|
25
|
+
checkmark: "appkit-ps__checkmark",
|
|
26
|
+
optionLabel: "appkit-ps__option-label",
|
|
27
|
+
empty: "appkit-ps__empty",
|
|
28
|
+
loading: "appkit-ps__loading",
|
|
29
|
+
loadMore: "appkit-ps__load-more",
|
|
30
|
+
createBtn: "appkit-ps__create-btn",
|
|
31
|
+
};
|
|
32
|
+
const CREATE_SENTINEL = "__paginated_select_create__";
|
|
33
|
+
/**
|
|
34
|
+
* PaginatedSelect — searchable, async-paginated select with optional multi-mode
|
|
35
|
+
* and optional inline create-new drawer. Replaces DynamicSelect, InlineCreateSelect,
|
|
36
|
+
* and PaginatedMultiSelect.
|
|
37
|
+
*
|
|
38
|
+
* @example single-select
|
|
39
|
+
* <PaginatedSelect value={storeId} onChange={setStoreId} loadOptions={loadStores} />
|
|
40
|
+
*
|
|
41
|
+
* @example single-select with inline create
|
|
42
|
+
* <PaginatedSelect
|
|
43
|
+
* value={categoryId}
|
|
44
|
+
* onChange={(v) => setCategoryId(v ?? "")}
|
|
45
|
+
* loadOptions={loadCategories}
|
|
46
|
+
* createLabel="Category"
|
|
47
|
+
* renderCreateForm={({ onCreated, onCancel }) => <CategoryForm ... />}
|
|
48
|
+
* />
|
|
49
|
+
*
|
|
50
|
+
* @example multi-select
|
|
51
|
+
* <PaginatedSelect multiple value={tagIds} onChange={setTagIds} loadOptions={loadTags} />
|
|
52
|
+
*/
|
|
53
|
+
export function PaginatedSelect(props) {
|
|
54
|
+
const { options, loadOptions, placeholder = "Select...", searchPlaceholder = "Search...", noResultsText = "No results", disabled, className = "", ariaLabel, createLabel, drawerTitle, renderCreateForm, createFields, onCreateSubmit, createSubmitLabel, } = props;
|
|
55
|
+
const isMulti = props.multiple === true;
|
|
56
|
+
const maxChipsVisible = isMulti ? props.maxChipsVisible ?? 3 : 0;
|
|
57
|
+
const [query, setQuery] = useState("");
|
|
58
|
+
const [open, setOpen] = useState(false);
|
|
59
|
+
const [asyncOptions, setAsyncOptions] = useState([]);
|
|
60
|
+
const [page, setPage] = useState(1);
|
|
61
|
+
const [hasMore, setHasMore] = useState(false);
|
|
62
|
+
const [loading, setLoading] = useState(false);
|
|
63
|
+
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
64
|
+
const containerRef = useRef(null);
|
|
65
|
+
const labelMap = useRef(new Map());
|
|
66
|
+
const hasCreate = Boolean(createLabel && (renderCreateForm ?? (createFields && onCreateSubmit)));
|
|
67
|
+
const resolvedOptions = options ?? asyncOptions;
|
|
68
|
+
resolvedOptions.forEach((o) => labelMap.current.set(o.value, o.label));
|
|
69
|
+
const load = useCallback(async (search, nextPage, reset = false) => {
|
|
70
|
+
if (!loadOptions)
|
|
71
|
+
return;
|
|
72
|
+
setLoading(true);
|
|
73
|
+
try {
|
|
74
|
+
const response = await loadOptions(search, nextPage);
|
|
75
|
+
setAsyncOptions((prev) => {
|
|
76
|
+
const merged = reset ? response.items : [...prev, ...response.items];
|
|
77
|
+
merged.forEach((o) => labelMap.current.set(o.value, o.label));
|
|
78
|
+
return merged;
|
|
79
|
+
});
|
|
80
|
+
setPage(nextPage);
|
|
81
|
+
setHasMore(response.hasMore);
|
|
82
|
+
}
|
|
83
|
+
finally {
|
|
84
|
+
setLoading(false);
|
|
85
|
+
}
|
|
86
|
+
}, [loadOptions]);
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (!open || !loadOptions)
|
|
89
|
+
return;
|
|
90
|
+
void load(query, 1, true);
|
|
91
|
+
}, [open, query, load, loadOptions]);
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
const onClickOutside = (e) => {
|
|
94
|
+
if (!containerRef.current?.contains(e.target))
|
|
95
|
+
setOpen(false);
|
|
96
|
+
};
|
|
97
|
+
const onKeydown = (e) => {
|
|
98
|
+
if (e.key === "Escape")
|
|
99
|
+
setOpen(false);
|
|
100
|
+
};
|
|
101
|
+
document.addEventListener("mousedown", onClickOutside);
|
|
102
|
+
document.addEventListener("keydown", onKeydown);
|
|
103
|
+
return () => {
|
|
104
|
+
document.removeEventListener("mousedown", onClickOutside);
|
|
105
|
+
document.removeEventListener("keydown", onKeydown);
|
|
106
|
+
};
|
|
107
|
+
}, []);
|
|
108
|
+
const filtered = options
|
|
109
|
+
? options.filter((o) => o.label.toLowerCase().includes(query.toLowerCase()))
|
|
110
|
+
: resolvedOptions;
|
|
111
|
+
function isSelected(value) {
|
|
112
|
+
if (isMulti)
|
|
113
|
+
return props.value.includes(value);
|
|
114
|
+
return props.value === value;
|
|
115
|
+
}
|
|
116
|
+
function handleSelect(opt) {
|
|
117
|
+
if (isMulti) {
|
|
118
|
+
const mp = props;
|
|
119
|
+
const selected = mp.value.includes(opt.value);
|
|
120
|
+
const nextValues = selected
|
|
121
|
+
? mp.value.filter((v) => v !== opt.value)
|
|
122
|
+
: [...mp.value, opt.value];
|
|
123
|
+
const nextOptions = nextValues.map((v) => {
|
|
124
|
+
const found = resolvedOptions.find((o) => o.value === v);
|
|
125
|
+
return found ?? { value: v, label: labelMap.current.get(v) ?? String(v) };
|
|
126
|
+
});
|
|
127
|
+
mp.onChange(nextValues, nextOptions);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
const sp = props;
|
|
131
|
+
sp.onChange?.(opt.value, opt);
|
|
132
|
+
setOpen(false);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
function removeChip(v) {
|
|
136
|
+
if (!isMulti)
|
|
137
|
+
return;
|
|
138
|
+
const mp = props;
|
|
139
|
+
const nextValues = mp.value.filter((x) => x !== v);
|
|
140
|
+
const nextOptions = nextValues.map((x) => {
|
|
141
|
+
const found = resolvedOptions.find((o) => o.value === x);
|
|
142
|
+
return found ?? { value: x, label: labelMap.current.get(x) ?? String(x) };
|
|
143
|
+
});
|
|
144
|
+
mp.onChange(nextValues, nextOptions);
|
|
145
|
+
}
|
|
146
|
+
function handleCreated(option) {
|
|
147
|
+
setDrawerOpen(false);
|
|
148
|
+
labelMap.current.set(option.value, option.label);
|
|
149
|
+
if (isMulti) {
|
|
150
|
+
const mp = props;
|
|
151
|
+
const nextValues = [...mp.value, option.value];
|
|
152
|
+
const nextOptions = nextValues.map((v) => {
|
|
153
|
+
const found = resolvedOptions.find((o) => o.value === v);
|
|
154
|
+
return found ?? { value: v, label: labelMap.current.get(v) ?? String(v) };
|
|
155
|
+
});
|
|
156
|
+
mp.onChange(nextValues, nextOptions);
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
const sp = props;
|
|
160
|
+
sp.onChange?.(option.value, option);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
const triggerLabel = (() => {
|
|
164
|
+
if (isMulti) {
|
|
165
|
+
const mp = props;
|
|
166
|
+
return mp.value.length === 0 ? placeholder : `${mp.value.length} selected`;
|
|
167
|
+
}
|
|
168
|
+
const sp = props;
|
|
169
|
+
if (sp.value == null)
|
|
170
|
+
return placeholder;
|
|
171
|
+
return (resolvedOptions.find((o) => o.value === sp.value)?.label ??
|
|
172
|
+
labelMap.current.get(sp.value) ??
|
|
173
|
+
String(sp.value));
|
|
174
|
+
})();
|
|
175
|
+
const triggerEmpty = isMulti
|
|
176
|
+
? props.value.length === 0
|
|
177
|
+
: props.value == null;
|
|
178
|
+
const multiValue = isMulti ? props.value : [];
|
|
179
|
+
const visibleChips = multiValue.slice(0, maxChipsVisible);
|
|
180
|
+
const overflowCount = multiValue.length - maxChipsVisible;
|
|
181
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { ref: containerRef, className: [C.root, className].filter(Boolean).join(" "), "aria-label": ariaLabel, children: [isMulti && multiValue.length > 0 && (_jsxs("div", { className: C.chips, children: [visibleChips.map((v) => (_jsxs("span", { className: C.chip, children: [_jsx("span", { className: C.chipLabel, children: labelMap.current.get(v) ?? String(v) }), !disabled && (_jsx("button", { type: "button", "aria-label": "Remove", className: C.chipRemove, onClick: (e) => {
|
|
182
|
+
e.stopPropagation();
|
|
183
|
+
removeChip(v);
|
|
184
|
+
}, children: "\u2715" }))] }, String(v)))), overflowCount > 0 && (_jsxs("span", { className: C.overflowChip, children: ["+", overflowCount, " more"] }))] })), _jsxs("button", { type: "button", disabled: disabled, onClick: () => setOpen((prev) => !prev), className: [C.trigger, disabled ? C.triggerDisabled : ""]
|
|
185
|
+
.filter(Boolean)
|
|
186
|
+
.join(" "), "aria-expanded": open, "aria-haspopup": "listbox", children: [_jsx("span", { className: C.triggerLeft, children: _jsx("span", { className: triggerEmpty ? C.placeholder : "", children: triggerLabel }) }), _jsx("span", { "aria-hidden": "true", children: "\u25BE" })] }), open && (_jsxs("div", { className: C.dropdown, role: "listbox", "aria-multiselectable": isMulti || undefined, children: [_jsx(Input, { autoFocus: true, value: query, onChange: (e) => setQuery(e.target.value), placeholder: searchPlaceholder, className: C.search }), _jsxs("ul", { className: C.list, children: [filtered.map((opt, idx) => {
|
|
187
|
+
const selected = isSelected(opt.value);
|
|
188
|
+
return (_jsx("li", { children: _jsxs("button", { type: "button", role: "option", "aria-selected": selected, className: [C.option, selected ? C.optionSelected : ""]
|
|
189
|
+
.filter(Boolean)
|
|
190
|
+
.join(" "), onClick: () => handleSelect(opt), children: [isMulti && (_jsx("span", { className: C.checkbox, "aria-hidden": "true", children: _jsx("span", { className: C.checkmark, children: "\u2713" }) })), _jsx("span", { className: C.optionLabel, children: opt.label })] }) }, `${String(opt.value)}-${idx}`));
|
|
191
|
+
}), filtered.length === 0 && !loading && (_jsx("li", { className: C.empty, children: noResultsText })), loading && _jsx("li", { className: C.loading, children: "Loading\u2026" }), hasMore && !loading && (_jsx("li", { children: _jsx("button", { type: "button", className: C.loadMore, onClick: () => void load(query, page + 1), children: "Load more" }) })), hasCreate && (_jsx("li", { children: _jsxs("button", { type: "button", className: C.createBtn, onClick: () => {
|
|
192
|
+
setOpen(false);
|
|
193
|
+
setDrawerOpen(true);
|
|
194
|
+
}, children: ["+ Create new ", createLabel] }) }, CREATE_SENTINEL))] })] }))] }), hasCreate && renderCreateForm ? (_jsx(SideDrawer, { isOpen: drawerOpen, onClose: () => setDrawerOpen(false), title: drawerTitle ?? `Create ${createLabel}`, mode: "create", footer: _jsx(Button, { variant: "ghost", onClick: () => setDrawerOpen(false), children: "Cancel" }), children: renderCreateForm({
|
|
195
|
+
onCreated: handleCreated,
|
|
196
|
+
onCancel: () => setDrawerOpen(false),
|
|
197
|
+
}) })) : hasCreate && createFields && onCreateSubmit ? (_jsx(QuickFormDrawer, { isOpen: drawerOpen, onClose: () => setDrawerOpen(false), title: drawerTitle ?? `Create ${createLabel}`, fields: createFields, submitLabel: createSubmitLabel ?? `Create ${createLabel}`, onSubmit: async (values) => {
|
|
198
|
+
const option = await onCreateSubmit(values);
|
|
199
|
+
handleCreated(option);
|
|
200
|
+
} })) : null] }));
|
|
201
|
+
}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/* PaginatedSelect — single + multi searchable, async-paginated select with optional inline create. */
|
|
2
|
+
|
|
3
|
+
.appkit-ps {
|
|
4
|
+
position: relative;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/* ── chips row (multi only) ── */
|
|
8
|
+
.appkit-ps__chips {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-wrap: wrap;
|
|
11
|
+
gap: 0.375rem;
|
|
12
|
+
margin-bottom: 0.375rem;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.appkit-ps__chip {
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
gap: 0.25rem;
|
|
19
|
+
border-radius: 9999px;
|
|
20
|
+
border: 1px solid var(--appkit-color-border);
|
|
21
|
+
background: var(--appkit-color-surface);
|
|
22
|
+
padding: 0.125rem 0.5rem 0.125rem 0.625rem;
|
|
23
|
+
font-size: 0.75rem;
|
|
24
|
+
font-weight: 500;
|
|
25
|
+
color: var(--appkit-color-text);
|
|
26
|
+
line-height: 1.5;
|
|
27
|
+
max-width: 12rem;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.appkit-ps__chip-label {
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
text-overflow: ellipsis;
|
|
33
|
+
white-space: nowrap;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.appkit-ps__chip-remove {
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
flex-shrink: 0;
|
|
41
|
+
width: 1rem;
|
|
42
|
+
height: 1rem;
|
|
43
|
+
border-radius: 9999px;
|
|
44
|
+
font-size: 0.7rem;
|
|
45
|
+
color: var(--appkit-color-text-muted);
|
|
46
|
+
transition: color 0.15s, background-color 0.15s;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.appkit-ps__chip-remove:hover {
|
|
50
|
+
color: var(--appkit-color-text);
|
|
51
|
+
background-color: var(--appkit-color-zinc-100);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:is(.dark) .appkit-ps__chip-remove:hover {
|
|
55
|
+
color: var(--appkit-color-text);
|
|
56
|
+
background-color: var(--appkit-color-slate-700);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.appkit-ps__overflow-chip {
|
|
60
|
+
display: inline-flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
border-radius: 9999px;
|
|
63
|
+
border: 1px dashed var(--appkit-color-border);
|
|
64
|
+
padding: 0.125rem 0.625rem;
|
|
65
|
+
font-size: 0.75rem;
|
|
66
|
+
font-weight: 500;
|
|
67
|
+
color: var(--appkit-color-text-muted);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* ── trigger ── */
|
|
71
|
+
.appkit-ps__trigger {
|
|
72
|
+
display: flex;
|
|
73
|
+
width: 100%;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: space-between;
|
|
76
|
+
border-radius: 0.5rem;
|
|
77
|
+
border: 1px solid var(--appkit-color-zinc-300);
|
|
78
|
+
padding: 0.5rem 0.75rem;
|
|
79
|
+
font-size: 0.875rem;
|
|
80
|
+
background: var(--appkit-color-surface);
|
|
81
|
+
color: var(--appkit-color-zinc-800);
|
|
82
|
+
transition: border-color 0.15s;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.appkit-ps__trigger:hover:not(:disabled) {
|
|
86
|
+
border-color: var(--appkit-color-zinc-400);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.appkit-ps__trigger:focus-visible {
|
|
90
|
+
outline: 2px solid var(--appkit-color-focus-ring, var(--appkit-color-primary));
|
|
91
|
+
outline-offset: 2px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:is(.dark) .appkit-ps__trigger {
|
|
95
|
+
border-color: var(--appkit-color-border);
|
|
96
|
+
background: var(--appkit-color-surface);
|
|
97
|
+
color: var(--appkit-color-slate-200);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.appkit-ps__trigger--disabled {
|
|
101
|
+
cursor: not-allowed;
|
|
102
|
+
opacity: 0.5;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.appkit-ps__placeholder {
|
|
106
|
+
color: var(--appkit-color-text-faint);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.appkit-ps__trigger-left {
|
|
110
|
+
display: flex;
|
|
111
|
+
align-items: center;
|
|
112
|
+
gap: 0.375rem;
|
|
113
|
+
overflow: hidden;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* ── dropdown ── */
|
|
117
|
+
.appkit-ps__dropdown {
|
|
118
|
+
position: absolute;
|
|
119
|
+
z-index: var(--appkit-z-dropdown);
|
|
120
|
+
margin-top: 0.25rem;
|
|
121
|
+
width: 100%;
|
|
122
|
+
min-width: 14rem;
|
|
123
|
+
overflow: hidden;
|
|
124
|
+
border-radius: 0.5rem;
|
|
125
|
+
border: 1px solid var(--appkit-color-border);
|
|
126
|
+
background: var(--appkit-color-surface);
|
|
127
|
+
box-shadow: var(--appkit-shadow-lg);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
:is(.dark) .appkit-ps__dropdown {
|
|
131
|
+
border-color: var(--appkit-color-border);
|
|
132
|
+
background: var(--appkit-color-surface);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.appkit-ps__search {
|
|
136
|
+
border-radius: 0;
|
|
137
|
+
border-left: 0;
|
|
138
|
+
border-right: 0;
|
|
139
|
+
border-top: 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* ── option list ── */
|
|
143
|
+
.appkit-ps__list {
|
|
144
|
+
max-height: 13rem;
|
|
145
|
+
overflow-y: auto;
|
|
146
|
+
padding: 0.25rem 0;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.appkit-ps__option {
|
|
150
|
+
display: flex;
|
|
151
|
+
align-items: center;
|
|
152
|
+
gap: 0.625rem;
|
|
153
|
+
width: 100%;
|
|
154
|
+
padding: 0.5rem 0.75rem;
|
|
155
|
+
font-size: 0.875rem;
|
|
156
|
+
text-align: left;
|
|
157
|
+
cursor: pointer;
|
|
158
|
+
transition: background-color 0.1s;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.appkit-ps__option:hover {
|
|
162
|
+
background-color: var(--appkit-color-zinc-100);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
:is(.dark) .appkit-ps__option:hover {
|
|
166
|
+
background-color: var(--appkit-color-slate-800);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.appkit-ps__option--selected {
|
|
170
|
+
font-weight: 500;
|
|
171
|
+
background-color: var(--appkit-color-zinc-50);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
:is(.dark) .appkit-ps__option--selected {
|
|
175
|
+
background-color: rgba(15, 23, 42, 0.6);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.appkit-ps__checkbox {
|
|
179
|
+
flex-shrink: 0;
|
|
180
|
+
width: 1rem;
|
|
181
|
+
height: 1rem;
|
|
182
|
+
border-radius: 0.25rem;
|
|
183
|
+
border: 1.5px solid var(--appkit-color-zinc-400);
|
|
184
|
+
background: var(--appkit-color-surface);
|
|
185
|
+
display: flex;
|
|
186
|
+
align-items: center;
|
|
187
|
+
justify-content: center;
|
|
188
|
+
transition: border-color 0.15s, background-color 0.15s;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.appkit-ps__option--selected .appkit-ps__checkbox {
|
|
192
|
+
border-color: var(--appkit-color-primary);
|
|
193
|
+
background: var(--appkit-color-primary);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.appkit-ps__checkmark {
|
|
197
|
+
display: none;
|
|
198
|
+
font-size: 0.6rem;
|
|
199
|
+
color: var(--appkit-color-text-on-primary, #fff);
|
|
200
|
+
font-weight: 700;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.appkit-ps__option--selected .appkit-ps__checkmark {
|
|
204
|
+
display: block;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.appkit-ps__option-label {
|
|
208
|
+
overflow: hidden;
|
|
209
|
+
text-overflow: ellipsis;
|
|
210
|
+
white-space: nowrap;
|
|
211
|
+
flex: 1;
|
|
212
|
+
color: var(--appkit-color-text);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* ── empty / loading / load-more / create ── */
|
|
216
|
+
.appkit-ps__empty,
|
|
217
|
+
.appkit-ps__loading {
|
|
218
|
+
padding: 0.5rem 0.75rem;
|
|
219
|
+
font-size: 0.75rem;
|
|
220
|
+
color: var(--appkit-color-text-muted);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.appkit-ps__load-more {
|
|
224
|
+
width: 100%;
|
|
225
|
+
padding: 0.5rem 0.75rem;
|
|
226
|
+
text-align: left;
|
|
227
|
+
font-size: 0.75rem;
|
|
228
|
+
color: var(--appkit-color-secondary-600);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.appkit-ps__load-more:hover {
|
|
232
|
+
text-decoration: underline;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.appkit-ps__create-btn {
|
|
236
|
+
display: flex;
|
|
237
|
+
align-items: center;
|
|
238
|
+
gap: 0.375rem;
|
|
239
|
+
width: 100%;
|
|
240
|
+
padding: 0.5rem 0.75rem;
|
|
241
|
+
font-size: 0.8125rem;
|
|
242
|
+
font-weight: 500;
|
|
243
|
+
color: var(--appkit-color-primary);
|
|
244
|
+
border-top: 1px solid var(--appkit-color-border-subtle);
|
|
245
|
+
transition: background-color 0.1s;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.appkit-ps__create-btn:hover {
|
|
249
|
+
background-color: var(--appkit-color-zinc-50);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
:is(.dark) .appkit-ps__create-btn:hover {
|
|
253
|
+
background-color: var(--appkit-color-slate-800);
|
|
254
|
+
}
|
|
@@ -145,10 +145,6 @@ export interface LiProps extends React.LiHTMLAttributes<HTMLLIElement> {
|
|
|
145
145
|
children: React.ReactNode;
|
|
146
146
|
}
|
|
147
147
|
export declare function Li({ className, children, ...props }: LiProps): import("react/jsx-runtime").JSX.Element;
|
|
148
|
-
export type HeaderProps = BlockHeaderProps;
|
|
149
|
-
export declare const Header: typeof BlockHeader;
|
|
150
|
-
export type FooterProps = BlockFooterProps;
|
|
151
|
-
export declare const Footer: typeof BlockFooter;
|
|
152
148
|
type TableVariant = "default" | "striped" | "bordered";
|
|
153
149
|
type TableSize = "sm" | "md" | "lg";
|
|
154
150
|
export interface TableProps extends Omit<React.TableHTMLAttributes<HTMLTableElement>, "border">, SurfaceProps {
|
|
@@ -29,8 +29,6 @@ export function Ol({ className = "", children, ...props }) {
|
|
|
29
29
|
export function Li({ className = "", children, ...props }) {
|
|
30
30
|
return (_jsx("li", { className: className, ...props, children: children }));
|
|
31
31
|
}
|
|
32
|
-
export const Header = BlockHeader;
|
|
33
|
-
export const Footer = BlockFooter;
|
|
34
32
|
const TABLE_VARIANT_MAP = {
|
|
35
33
|
default: "appkit-table--default",
|
|
36
34
|
striped: "appkit-table--striped",
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface SettingsSectionProps {
|
|
3
|
+
/** Section title rendered as an h3. */
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
/** Optional supporting copy below the title. */
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
/** Action slot rendered top-right (e.g. a "Reset" button). */
|
|
8
|
+
action?: ReactNode;
|
|
9
|
+
/** Section body. */
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
/** Additional classes appended to the outer wrapper. */
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* `SettingsSection` — a bordered card with a heading and optional description,
|
|
16
|
+
* used by admin/seller/user settings pages to group related controls.
|
|
17
|
+
*
|
|
18
|
+
* W1-31: extracted from inline `<div className="space-y-* rounded-lg border …">`
|
|
19
|
+
* blocks scattered across `AdminSiteSettingsView`, `SellerStoreSettingsView`,
|
|
20
|
+
* `UserSettingsView`, etc.
|
|
21
|
+
*/
|
|
22
|
+
export declare function SettingsSection({ title, description, action, children, className, }: SettingsSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export interface ToggleRowProps {
|
|
24
|
+
/** Row label (rendered next to the toggle). */
|
|
25
|
+
label: ReactNode;
|
|
26
|
+
/** Optional secondary description below the label. */
|
|
27
|
+
description?: ReactNode;
|
|
28
|
+
/** Controlled checked state. */
|
|
29
|
+
checked: boolean;
|
|
30
|
+
/** Change handler. */
|
|
31
|
+
onChange: (next: boolean) => void;
|
|
32
|
+
/** Disabled state. */
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/** Toggle size — defaults to `md`. */
|
|
35
|
+
size?: "sm" | "md" | "lg";
|
|
36
|
+
/** Additional classes appended to the outer wrapper. */
|
|
37
|
+
className?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* `ToggleRow` — a labelled toggle with optional description, used wherever a
|
|
41
|
+
* settings page needs a boolean control with explanatory copy. Pair with
|
|
42
|
+
* `SettingsSection` to group related rows.
|
|
43
|
+
*
|
|
44
|
+
* W1-31: replaces the inline `<Toggle label="…" />` + helper-text patterns
|
|
45
|
+
* across admin/seller/user settings views.
|
|
46
|
+
*/
|
|
47
|
+
export declare function ToggleRow({ label, description, checked, onChange, disabled, size, className, }: ToggleRowProps): 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 { Heading, Text } from "./Typography";
|
|
4
|
+
import { Toggle } from "./Toggle";
|
|
5
|
+
/**
|
|
6
|
+
* `SettingsSection` — a bordered card with a heading and optional description,
|
|
7
|
+
* used by admin/seller/user settings pages to group related controls.
|
|
8
|
+
*
|
|
9
|
+
* W1-31: extracted from inline `<div className="space-y-* rounded-lg border …">`
|
|
10
|
+
* blocks scattered across `AdminSiteSettingsView`, `SellerStoreSettingsView`,
|
|
11
|
+
* `UserSettingsView`, etc.
|
|
12
|
+
*/
|
|
13
|
+
export function SettingsSection({ title, description, action, children, className, }) {
|
|
14
|
+
return (_jsxs("section", { className: [
|
|
15
|
+
"appkit-settings-section",
|
|
16
|
+
"space-y-3 rounded-lg border border-zinc-200 dark:border-zinc-700 p-4",
|
|
17
|
+
className,
|
|
18
|
+
]
|
|
19
|
+
.filter(Boolean)
|
|
20
|
+
.join(" "), children: [_jsxs("header", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "flex-1 min-w-0", children: [_jsx(Heading, { level: 3, className: "text-base font-semibold text-zinc-900 dark:text-zinc-100", children: title }), description ? (_jsx(Text, { className: "mt-1 text-sm text-zinc-600 dark:text-zinc-400", children: description })) : null] }), action ? _jsx("div", { className: "flex-shrink-0", children: action }) : null] }), _jsx("div", { className: "space-y-3", children: children })] }));
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* `ToggleRow` — a labelled toggle with optional description, used wherever a
|
|
24
|
+
* settings page needs a boolean control with explanatory copy. Pair with
|
|
25
|
+
* `SettingsSection` to group related rows.
|
|
26
|
+
*
|
|
27
|
+
* W1-31: replaces the inline `<Toggle label="…" />` + helper-text patterns
|
|
28
|
+
* across admin/seller/user settings views.
|
|
29
|
+
*/
|
|
30
|
+
export function ToggleRow({ label, description, checked, onChange, disabled = false, size = "md", className, }) {
|
|
31
|
+
return (_jsxs("div", { className: [
|
|
32
|
+
"appkit-toggle-row",
|
|
33
|
+
"flex items-start justify-between gap-3 py-1",
|
|
34
|
+
className,
|
|
35
|
+
]
|
|
36
|
+
.filter(Boolean)
|
|
37
|
+
.join(" "), children: [_jsxs("div", { className: "flex-1 min-w-0", children: [_jsx(Text, { className: "text-sm font-medium text-zinc-900 dark:text-zinc-100", children: label }), description ? (_jsx(Text, { className: "mt-0.5 text-xs text-zinc-500 dark:text-zinc-400", children: description })) : null] }), _jsx("div", { className: "flex-shrink-0 pt-0.5", children: _jsx(Toggle, { checked: checked, onChange: onChange, disabled: disabled, size: size }) })] }));
|
|
38
|
+
}
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
@import "./ItemRow.style.css";
|
|
24
24
|
@import "./Tooltip.style.css";
|
|
25
25
|
@import "./TabStrip.style.css";
|
|
26
|
-
@import "./SectionTabs.style.css";
|
|
27
26
|
@import "./Layout.style.css";
|
|
28
27
|
@import "./SortDropdown.style.css";
|
|
29
28
|
@import "./TablePagination.style.css";
|
|
@@ -54,12 +53,10 @@
|
|
|
54
53
|
@import "./Tabs.style.css";
|
|
55
54
|
@import "./Radio.style.css";
|
|
56
55
|
@import "./Dropdown.style.css";
|
|
57
|
-
@import "./DashboardStatsCard.style.css";
|
|
58
56
|
@import "./AvatarDisplay.style.css";
|
|
59
57
|
@import "./BaseListingCard.style.css";
|
|
60
58
|
@import "./ConfirmDeleteModal.style.css";
|
|
61
|
-
@import "./
|
|
62
|
-
@import "./PaginatedMultiSelect.style.css";
|
|
59
|
+
@import "./PaginatedSelect.style.css";
|
|
63
60
|
@import "./SideDrawer.style.css";
|
|
64
61
|
@import "./FormActionBar.style.css";
|
|
65
62
|
@import "./BackgroundRenderer.style.css";
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ export type { FieldCheckboxProps } from "./forms";
|
|
|
10
10
|
export { FieldCheckbox } from "./forms";
|
|
11
11
|
export { buildColumns, createColumnBuilder, renderBoolean, renderCurrency, renderCurrencyCompact, renderCount, renderNullable, renderRating, } from "./columns";
|
|
12
12
|
export type { BooleanRenderOpts, RatingMode, RatingRenderOpts, } from "./columns";
|
|
13
|
-
export type { SectionProps, ArticleProps, MainProps, AsideProps, NavProps, BlockHeaderProps, BlockFooterProps,
|
|
14
|
-
export { Section, Article, Main, Aside, Nav, BlockHeader, BlockFooter,
|
|
13
|
+
export type { SectionProps, ArticleProps, MainProps, AsideProps, NavProps, BlockHeaderProps, BlockFooterProps, UlProps, OlProps, LiProps, TableProps, TheadProps, TbodyProps, TrProps, ThProps, TdProps, CodeProps, PreProps, BlockquoteProps, FigureProps, FigcaptionProps, DlProps, DtProps, DdProps, } from "./components/Semantic";
|
|
14
|
+
export { Section, Article, Main, Aside, Nav, BlockHeader, BlockFooter, Ul, Ol, Li, Table, Thead, Tbody, Tr, Th, Td, Code, Pre, Blockquote, Figure, Figcaption, Dl, Dt, Dd, } from "./components/Semantic";
|
|
15
15
|
export type { DivProps } from "./components/Div";
|
|
16
16
|
export { Div } from "./components/Div";
|
|
17
17
|
export type { ColorVariant } from "./components/Typography";
|
|
@@ -111,12 +111,18 @@ export type { ItemRowProps } from "./components/ItemRow";
|
|
|
111
111
|
export { ItemRow } from "./components/ItemRow";
|
|
112
112
|
export type { HorizontalScrollerProps, PerViewConfig, } from "./components/HorizontalScroller";
|
|
113
113
|
export { HorizontalScroller } from "./components/HorizontalScroller";
|
|
114
|
-
export type { SectionTabsProps, SectionTab } from "./components/SectionTabs";
|
|
115
|
-
export { SectionTabs } from "./components/SectionTabs";
|
|
116
114
|
export type { TabStripProps, TabStripTab } from "./components/TabStrip";
|
|
117
115
|
export { TabStrip } from "./components/TabStrip";
|
|
118
116
|
export type { FormGridProps, FormFieldProps } from "./components/FormGrid";
|
|
119
117
|
export { FormGrid, FormField as FormGridField } from "./components/FormGrid";
|
|
118
|
+
export type { SettingsSectionProps, ToggleRowProps } from "./components/SettingsSection";
|
|
119
|
+
export { SettingsSection, ToggleRow } from "./components/SettingsSection";
|
|
120
|
+
export type { DetailPageHeroProps } from "./components/DetailPageHero";
|
|
121
|
+
export { DetailPageHero } from "./components/DetailPageHero";
|
|
122
|
+
export type { DetailPageGalleryProps, DetailPageGalleryImage } from "./components/DetailPageGallery";
|
|
123
|
+
export { DetailPageGallery } from "./components/DetailPageGallery";
|
|
124
|
+
export type { DetailPageTabsProps, DetailPageTab } from "./components/DetailPageTabs";
|
|
125
|
+
export { DetailPageTabs } from "./components/DetailPageTabs";
|
|
120
126
|
export type { FormFieldProps as SmartFormFieldProps } from "./components/FormField";
|
|
121
127
|
export { FormField } from "./components/FormField";
|
|
122
128
|
export type { DescriptionFieldProps } from "./components/DescriptionField";
|
|
@@ -131,12 +137,8 @@ export type { DropdownProps, DropdownMenuItem } from "./components/Dropdown";
|
|
|
131
137
|
export { Dropdown, DropdownTrigger, DropdownMenu, DropdownItem, DropdownSeparator, } from "./components/Dropdown";
|
|
132
138
|
export type { MenuProps } from "./components/Menu";
|
|
133
139
|
export { Menu, MenuTrigger, MenuContent, MenuItem, MenuSeparator, } from "./components/Menu";
|
|
134
|
-
export type {
|
|
135
|
-
export {
|
|
136
|
-
export type { InlineCreateSelectProps } from "./components/InlineCreateSelect";
|
|
137
|
-
export { InlineCreateSelect } from "./components/InlineCreateSelect";
|
|
138
|
-
export type { PaginatedMultiSelectProps } from "./components/PaginatedMultiSelect";
|
|
139
|
-
export { PaginatedMultiSelect } from "./components/PaginatedMultiSelect";
|
|
140
|
+
export type { PaginatedSelectProps, PaginatedSelectOption, AsyncPage, } from "./components/PaginatedSelect";
|
|
141
|
+
export { PaginatedSelect } from "./components/PaginatedSelect";
|
|
140
142
|
export type { RoleBadgeProps } from "./components/RoleBadge";
|
|
141
143
|
export { RoleBadge } from "./components/RoleBadge";
|
|
142
144
|
export type { SkipToMainProps } from "./components/SkipToMain";
|
|
@@ -153,12 +155,12 @@ export type { PasswordStrengthIndicatorProps } from "./components/PasswordStreng
|
|
|
153
155
|
export { PasswordStrengthIndicator } from "./components/PasswordStrengthIndicator";
|
|
154
156
|
export type { AvatarDisplayProps } from "./components/AvatarDisplay";
|
|
155
157
|
export { AvatarDisplay } from "./components/AvatarDisplay";
|
|
156
|
-
export type { DashboardStatsCardProps } from "./components/DashboardStatsCard";
|
|
157
|
-
export { DashboardStatsCard } from "./components/DashboardStatsCard";
|
|
158
158
|
export type { ActiveFilter, ActiveFilterChipsProps, } from "./components/ActiveFilterChips";
|
|
159
159
|
export { ActiveFilterChips } from "./components/ActiveFilterChips";
|
|
160
160
|
export type { SortOption, SortDropdownProps } from "./components/SortDropdown";
|
|
161
161
|
export { SortDropdown } from "./components/SortDropdown";
|
|
162
|
+
export type { ListingFilterDrawerProps } from "./components/ListingFilterDrawer";
|
|
163
|
+
export { ListingFilterDrawer } from "./components/ListingFilterDrawer";
|
|
162
164
|
export type { ListingToolbarProps, ListingToolbarSortOption, ListingToolbarLabels, ListingToolbarToggle } from "./components/ListingToolbar";
|
|
163
165
|
export { ListingToolbar } from "./components/ListingToolbar";
|
|
164
166
|
export type { TablePaginationProps, TablePaginationLabels, } from "./components/TablePagination";
|
|
@@ -182,8 +184,6 @@ export type { RichTextEditorProps } from "./components/RichTextEditor";
|
|
|
182
184
|
export { RichTextEditor } from "./components/RichTextEditor";
|
|
183
185
|
export type { ListingLayoutProps, ListingLayoutLabels, } from "./components/ListingLayout";
|
|
184
186
|
export { ListingLayout } from "./components/ListingLayout";
|
|
185
|
-
export type { ListingViewShellProps } from "./components/ListingViewShell";
|
|
186
|
-
export { ListingViewShell } from "./components/ListingViewShell";
|
|
187
187
|
export type { SlottedListingViewProps, SlottedListingViewLabels, } from "./components/SlottedListingView";
|
|
188
188
|
export { SlottedListingView } from "./components/SlottedListingView";
|
|
189
189
|
export type { DetailViewShellProps, DetailViewLayout, } from "./components/DetailViewShell";
|