@mohasinac/appkit 3.0.0 → 3.0.2
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/layout/SidebarCollapseToggle.js +1 -5
- package/dist/_internal/server/features/auctions/actions.js +0 -1
- package/dist/_internal/server/features/auctions/og.js +0 -1
- package/dist/_internal/server/features/auctions/service.js +0 -4
- package/dist/_internal/server/features/auth/capabilities.js +0 -1
- package/dist/_internal/server/features/blog/actions.js +0 -2
- package/dist/_internal/server/features/brands/actions.js +0 -2
- package/dist/_internal/server/features/cart/actions.js +0 -3
- package/dist/_internal/server/features/checkout/actions.js +11 -20
- package/dist/_internal/server/features/events/actions.js +0 -3
- package/dist/_internal/server/features/events/og.js +0 -1
- package/dist/_internal/server/features/events/service.js +0 -2
- package/dist/_internal/server/features/grouped/data.js +0 -2
- package/dist/_internal/server/features/orders/actions.js +0 -4
- package/dist/_internal/server/features/pre-orders/actions.js +0 -1
- package/dist/_internal/server/features/pre-orders/og.js +0 -1
- package/dist/_internal/server/features/pre-orders/service.js +0 -1
- package/dist/_internal/server/features/products/actions.js +0 -6
- package/dist/_internal/server/features/products/service.js +0 -1
- package/dist/_internal/server/features/promotions/actions.js +0 -3
- package/dist/_internal/server/features/reviews/actions.js +0 -3
- package/dist/_internal/server/functions/https.js +0 -6
- package/dist/_internal/server/functions/manifest.js +0 -1
- package/dist/_internal/server/jobs/core/cleanupRtdbEvents.js +1 -1
- package/dist/_internal/server/jobs/core/wrapJobHandler.js +0 -1
- package/dist/_internal/shared/listing-types/action-tracker.js +1 -1
- package/dist/_internal/shared/serialization/index.js +0 -4
- package/dist/_internal/shared/styles/themed.js +0 -3
- package/dist/client/api/ApiError.js +1 -4
- package/dist/client/api/surface-error.js +0 -1
- package/dist/client/api/useApiQuery.js +0 -1
- package/dist/configs/next.js +0 -1
- package/dist/configs/tailwind.js +0 -1
- package/dist/contracts/field-ops.js +0 -2
- package/dist/core/EventBus.js +0 -2
- package/dist/core/Logger.js +0 -6
- package/dist/core/Queue.js +0 -2
- package/dist/core/hooks/useSyncManager.js +4 -4
- package/dist/core/mutation-events.js +0 -1
- package/dist/core/newsletter.repository.js +2 -6
- package/dist/errors/api-error.js +0 -1
- package/dist/errors/authentication-error.js +0 -1
- package/dist/errors/authorization-error.js +0 -1
- package/dist/errors/base-error.js +1 -3
- package/dist/errors/database-error.js +0 -1
- package/dist/errors/error-handler.js +1 -5
- package/dist/errors/error-mapping.js +1 -6
- package/dist/errors/normalize.js +0 -4
- package/dist/errors/not-found-error.js +0 -1
- package/dist/errors/razorpay-unreachable.js +0 -1
- package/dist/errors/validation-error.js +0 -1
- package/dist/features/about/components/FAQPageView.js +1 -3
- package/dist/features/about/components/FeesView.js +1 -3
- package/dist/features/about/components/HelpPageView.js +1 -3
- package/dist/features/about/components/PublicProfileView.js +4 -4
- package/dist/features/account/components/AddressBook.js +1 -3
- package/dist/features/account/components/AddressForm.js +0 -1
- package/dist/features/account/components/AddressesIndexListing.js +0 -1
- package/dist/features/account/components/MessagesView.js +1 -3
- package/dist/features/account/components/NotificationBell.js +3 -14
- package/dist/features/account/components/NotificationPreferencesPanel.js +1 -1
- package/dist/features/account/components/UserOffersPanel.js +0 -2
- package/dist/features/account/components/UserSidebar.js +1 -3
- package/dist/features/admin/components/AdminBlogEditorView.js +0 -1
- package/dist/features/admin/components/AdminBundleEditorView.js +0 -1
- package/dist/features/admin/components/AdminBundlesView.js +0 -1
- package/dist/features/admin/components/AdminCarouselEditorView.js +1 -5
- package/dist/features/admin/components/AdminCarouselView.js +1 -4
- package/dist/features/admin/components/AdminCartsView.js +0 -1
- package/dist/features/admin/components/AdminMediaView.js +1 -3
- package/dist/features/admin/components/AdminPayoutsView.js +0 -1
- package/dist/features/admin/components/AdminProductsView.js +1 -3
- package/dist/features/admin/components/AdminSidebar.js +1 -3
- package/dist/features/admin/components/AdminSiteSettingsView.js +1 -5
- package/dist/features/admin/components/AdminSupportTicketDetailView.js +7 -13
- package/dist/features/admin/components/DashboardStats.js +1 -7
- package/dist/features/admin/components/DataListingView.js +1 -5
- package/dist/features/admin/components/DataTable.js +1 -3
- package/dist/features/admin/components/analytics/AdminAnalyticsCharts.js +1 -3
- package/dist/features/admin/components/analytics/AdminStatCard.js +1 -7
- package/dist/features/admin/components/analytics/AdminTopProductsTable.js +1 -3
- package/dist/features/admin/components/sections/adminSectionsBuildParse.js +0 -5
- package/dist/features/admin/hooks/useAdminListingData.js +0 -5
- package/dist/features/admin/hooks/useChat.js +0 -3
- package/dist/features/admin/repository/chat.repository.js +0 -1
- package/dist/features/admin/repository/notification.repository.js +1 -4
- package/dist/features/auctions/components/AuctionBidsTable.js +1 -7
- package/dist/features/auctions/components/AuctionDetailPageView.js +1 -6
- package/dist/features/auctions/components/MarketplaceAuctionCard.js +3 -15
- package/dist/features/auctions/components/PlaceBidFormClient.js +0 -3
- package/dist/features/auctions/repository/bid.repository.js +0 -1
- package/dist/features/auth/components/ForgotPasswordView.js +0 -1
- package/dist/features/auth/components/LoginForm.js +0 -1
- package/dist/features/auth/components/RegisterForm.js +0 -1
- package/dist/features/auth/components/ResetPasswordView.js +0 -1
- package/dist/features/auth/hooks/useAuth.js +0 -1
- package/dist/features/auth/repository/session.repository.js +0 -1
- package/dist/features/auth/repository/token.repository.js +0 -2
- package/dist/features/auth/repository/user.repository.js +0 -1
- package/dist/features/blog/api/[slug]/route.js +1 -1
- package/dist/features/blog/components/BlogFeaturedCard.js +1 -5
- package/dist/features/blog/components/BlogIndexListing.js +0 -1
- package/dist/features/blog/components/BlogListView.js +1 -5
- package/dist/features/blog/components/BlogPostView.js +1 -3
- package/dist/features/cart/components/CartDrawer.js +2 -6
- package/dist/features/cart/repository/cart.repository.js +0 -1
- package/dist/features/categories/api/route.js +0 -1
- package/dist/features/categories/components/BrandDetailPageView.js +1 -13
- package/dist/features/categories/components/BundleDetailView.js +1 -5
- package/dist/features/categories/components/BundleItemsPicker.js +1 -5
- package/dist/features/categories/components/CategoriesIndexListing.js +0 -1
- package/dist/features/categories/components/CategoriesIndexPageView.js +0 -1
- package/dist/features/categories/components/CategoryBundlesListing.js +1 -3
- package/dist/features/categories/components/CategoryDetailPageView.js +1 -16
- package/dist/features/categories/components/CategoryGrid.js +1 -5
- package/dist/features/categories/components/CategorySelectorCreate.js +0 -1
- package/dist/features/categories/components/CategoryTableColumns.js +2 -6
- package/dist/features/categories/components/CategoryTree.js +1 -3
- package/dist/features/categories/components/ConcernCard.js +1 -3
- package/dist/features/collections/components/CollectionCard.js +1 -5
- package/dist/features/contact/email.js +0 -1
- package/dist/features/events/actions/event-actions.js +0 -1
- package/dist/features/events/api/[id]/route.js +0 -1
- package/dist/features/events/components/AdminEventEditorView.js +13 -14
- package/dist/features/events/components/EventCard.js +2 -8
- package/dist/features/events/components/EventRaffleEntryForm.js +1 -3
- package/dist/features/events/components/EventRaffleWinnerView.js +1 -3
- package/dist/features/events/components/EventRafflesSection.js +0 -1
- package/dist/features/events/components/EventsIndexListing.js +0 -1
- package/dist/features/events/hooks/useBulkEvent.js +0 -1
- package/dist/features/events/repository/event-entry.repository.js +0 -1
- package/dist/features/faq/components/ContactCTA.js +1 -3
- package/dist/features/faq/components/FAQAccordion.js +1 -3
- package/dist/features/faq/components/FAQCategorySidebar.js +1 -3
- package/dist/features/faq/components/RelatedFAQs.js +1 -5
- package/dist/features/filters/AsyncFacetSection.js +1 -3
- package/dist/features/filters/FilterFacetSection.js +4 -14
- package/dist/features/forms/Checkbox.js +1 -3
- package/dist/features/forms/Slider.js +1 -3
- package/dist/features/history/hooks/useHistory.js +0 -1
- package/dist/features/history/repository/user-history.repository.js +0 -2
- package/dist/features/homepage/actions/carousel-actions.js +0 -1
- package/dist/features/homepage/actions/homepage-section-actions.js +1 -3
- package/dist/features/homepage/api/carousel/route.js +0 -1
- package/dist/features/homepage/api/route.js +0 -1
- package/dist/features/homepage/components/AdSlot.js +3 -9
- package/dist/features/homepage/components/AdvertisementBanner.js +2 -12
- package/dist/features/homepage/components/BeforeAfterCard.js +1 -5
- package/dist/features/homepage/components/CharacterHotspotForm.js +2 -10
- package/dist/features/homepage/components/CollectionCardsSection.js +1 -3
- package/dist/features/homepage/components/CustomCardsSection.js +1 -5
- package/dist/features/homepage/components/FeaturedResultsSection.js +1 -3
- package/dist/features/homepage/components/GoogleReviewsSection.js +1 -3
- package/dist/features/homepage/components/HeroCarousel.js +5 -26
- package/dist/features/homepage/components/HeroSection.js +2 -6
- package/dist/features/homepage/components/HowItWorksSection.js +2 -8
- package/dist/features/homepage/components/MarketplaceHomepageView.js +0 -8
- package/dist/features/homepage/components/NewsletterBanner.js +2 -10
- package/dist/features/homepage/components/PromoGrid.js +1 -3
- package/dist/features/homepage/components/SecurityHighlightsSection.js +2 -6
- package/dist/features/homepage/components/ShopByCategorySection.js +2 -6
- package/dist/features/homepage/components/SocialPostCard.js +1 -3
- package/dist/features/homepage/components/StatsCounterSection.js +1 -5
- package/dist/features/homepage/components/TrustBadges.js +1 -3
- package/dist/features/homepage/components/TrustFeaturesSection.js +1 -3
- package/dist/features/homepage/components/WelcomeSection.js +2 -16
- package/dist/features/homepage/components/WhatsAppCommunitySection.js +1 -5
- package/dist/features/homepage/lib/social-feed-fetcher.js +0 -8
- package/dist/features/layout/AppLayoutShell.js +1 -3
- package/dist/features/layout/BottomNavbar.js +1 -11
- package/dist/features/media/MediaAudio.js +2 -6
- package/dist/features/media/MediaImage.js +0 -1
- package/dist/features/media/MediaLightbox.js +3 -9
- package/dist/features/media/MediaVideo.js +2 -8
- package/dist/features/media/upload/MediaUploadField.js +1 -3
- package/dist/features/messages/hooks/useConversation.js +0 -2
- package/dist/features/messages/hooks/useConversations.js +0 -1
- package/dist/features/messages/repository/conversations.repository.js +0 -1
- package/dist/features/orders/api/track/[trackingId]/route.js +0 -1
- package/dist/features/orders/components/OrdersList.js +1 -3
- package/dist/features/orders/components/RefundHistoryTable.js +1 -3
- package/dist/features/orders/repository/orders.repository.js +0 -2
- package/dist/features/payments/repository/payout.repository.js +0 -1
- package/dist/features/pre-orders/components/MarketplacePreorderCard.js +2 -6
- package/dist/features/pre-orders/components/PreOrderActionsClient.js +0 -1
- package/dist/features/pre-orders/components/PreOrderBadge.js +1 -3
- package/dist/features/pre-orders/components/PreOrderDetailPageView.js +1 -5
- package/dist/features/products/api/route.js +1 -3
- package/dist/features/products/components/CompareOverlay.js +1 -6
- package/dist/features/products/components/FeatureBadge.js +1 -3
- package/dist/features/products/components/MakeOfferButton.js +0 -2
- package/dist/features/products/components/MarketplaceBundleCard.js +1 -3
- package/dist/features/products/components/MarketplacePrizeDrawCard.js +1 -3
- package/dist/features/products/components/PrizeDrawDetailPageView.js +0 -2
- package/dist/features/products/components/PrizeDrawItemsEditor.js +1 -3
- package/dist/features/products/components/PrizeDrawsSection.js +1 -3
- package/dist/features/products/components/ProductDetailPageView.js +0 -6
- package/dist/features/products/components/ProductFeatureBadges.js +1 -3
- package/dist/features/products/components/ProductFeaturesSelector.js +0 -1
- package/dist/features/products/components/ProductGrid.js +5 -15
- package/dist/features/products/components/ShareButton.js +1 -1
- package/dist/features/products/components/ShowGroupSection.js +3 -7
- package/dist/features/products/components/SublistingCarouselSection.js +2 -4
- package/dist/features/products/repository/product-features.repository.js +0 -1
- package/dist/features/products/repository/products.repository.js +0 -1
- package/dist/features/promotions/components/CouponCard.js +2 -5
- package/dist/features/promotions/repository/coupons.repository.js +0 -1
- package/dist/features/reviews/api/route.js +0 -1
- package/dist/features/reviews/components/ReviewDetailShell.js +3 -13
- package/dist/features/reviews/components/ReviewModal.js +1 -5
- package/dist/features/reviews/components/ReviewSummary.js +2 -6
- package/dist/features/reviews/components/ReviewsIndexListing.js +0 -1
- package/dist/features/reviews/components/ReviewsList.js +1 -7
- package/dist/features/reviews/repository/reviews.repository.js +0 -3
- package/dist/features/scams/actions/scam-actions.js +1 -1
- package/dist/features/scams/components/ScamProfileView.js +1 -3
- package/dist/features/search/components/Search.js +2 -8
- package/dist/features/search/components/SearchFiltersRow.js +1 -3
- package/dist/features/seller/components/PhysicalLocationModal.js +1 -5
- package/dist/features/seller/components/SellerAddressesView.js +1 -6
- package/dist/features/seller/components/SellerAnalyticsAlertsView.js +1 -4
- package/dist/features/seller/components/SellerBidsView.js +1 -3
- package/dist/features/seller/components/SellerBundlesView.js +0 -1
- package/dist/features/seller/components/SellerCouponEditorView.js +1 -3
- package/dist/features/seller/components/SellerFeaturesView.js +0 -1
- package/dist/features/seller/components/SellerGoogleReviewsView.js +1 -1
- package/dist/features/seller/components/SellerLiveView.js +1 -3
- package/dist/features/seller/components/SellerOffersPanel.js +0 -2
- package/dist/features/seller/components/SellerOrdersView.js +1 -6
- package/dist/features/seller/components/SellerPayoutMethodsView.js +0 -1
- package/dist/features/seller/components/SellerPayoutRequestView.js +1 -1
- package/dist/features/seller/components/SellerPayoutSettingsView.js +1 -1
- package/dist/features/seller/components/SellerProductShell.js +2 -4
- package/dist/features/seller/components/SellerProductsCards.js +1 -3
- package/dist/features/seller/components/SellerProductsView.js +1 -7
- package/dist/features/seller/components/SellerReviewsView.js +1 -4
- package/dist/features/seller/components/SellerShippingConfigsView.js +1 -4
- package/dist/features/seller/components/SellerShippingView.js +1 -1
- package/dist/features/seller/components/SellerSidebar.js +4 -12
- package/dist/features/seller/components/SellerStoreCategoriesView.js +0 -2
- package/dist/features/seller/components/SellerTemplatesView.js +0 -1
- package/dist/features/seller/components/analytics/SellerRevenueChart.js +1 -3
- package/dist/features/seller/components/analytics/SellerTopProducts.js +1 -3
- package/dist/features/seller/hooks/useSellerListingData.js +0 -5
- package/dist/features/seller/repository/offer.repository.js +0 -1
- package/dist/features/shell/FormShell.js +2 -15
- package/dist/features/shell/QuickFormDrawer.js +1 -5
- package/dist/features/site-settings/components/NavPermissionsManager.js +1 -3
- package/dist/features/site-settings/components/ThemeManagerView.js +0 -1
- package/dist/features/stores/api/[storeSlug]/reviews/route.js +0 -1
- package/dist/features/stores/components/StoreHeader.js +1 -7
- package/dist/features/stores/components/StoreReviewsListing.js +0 -1
- package/dist/features/stores/components/StoresIndexListing.js +0 -1
- package/dist/features/stores/repository/store.repository.js +0 -2
- package/dist/features/support/repository/support.repository.js +0 -1
- package/dist/features/wishlist/components/WishlistPage.js +1 -3
- package/dist/features/wishlist/hooks/useWishlistCount.js +1 -1
- package/dist/features/wishlist/repository/user-wishlist.repository.js +0 -2
- package/dist/http/ApiClient.js +4 -12
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -3
- package/dist/monitoring/client-logger.js +7 -22
- package/dist/monitoring/error-tracking.js +0 -1
- package/dist/monitoring/performance.js +0 -1
- package/dist/monitoring/server-logger.js +11 -33
- package/dist/next/api/api-response.js +1 -4
- package/dist/next/api/apiHandler.js +1 -5
- package/dist/next/api/errorHandler.js +0 -3
- package/dist/next/api/parseJsonBody.js +0 -1
- package/dist/next/api/routeHandler.js +1 -6
- package/dist/next/cache-middleware.js +1 -3
- package/dist/next/middleware/chain.js +0 -1
- package/dist/next/middleware/pii-scrubber.js +0 -2
- package/dist/providers/auth-firebase/provider.js +0 -1
- package/dist/providers/db-firebase/admin.js +0 -1
- package/dist/providers/db-firebase/base.js +0 -4
- package/dist/providers/db-firebase/base.repository.js +0 -3
- package/dist/providers/db-firebase/field-ops.js +0 -2
- package/dist/providers/db-firebase/helpers.js +0 -4
- package/dist/providers/db-firebase/realtime.js +3 -15
- package/dist/providers/db-firebase/sieve.js +2 -8
- package/dist/providers/payment-razorpay/index.js +0 -3
- package/dist/providers/shipping-shiprocket/index.js +0 -1
- package/dist/providers/storage-firebase/client.js +0 -4
- package/dist/react/contexts/SessionContext.js +0 -1
- package/dist/react/hooks/useCountdown.js +0 -1
- package/dist/security/authorization.js +0 -1
- package/dist/security/pii-encrypt.js +0 -4
- package/dist/security/pii-redact.js +0 -3
- package/dist/seed/manifest.js +1 -6
- package/dist/seed/runner.js +0 -2
- package/dist/ui/DataTable.js +2 -6
- package/dist/ui/components/Anchor.js +0 -1
- package/dist/ui/components/AvatarDisplay.js +1 -3
- package/dist/ui/components/BackgroundRenderer.js +2 -6
- package/dist/ui/components/BaseListingCard.js +0 -1
- package/dist/ui/components/Button.js +0 -3
- package/dist/ui/components/Card.js +2 -6
- package/dist/ui/components/Details.js +2 -8
- package/dist/ui/components/Dialog.js +0 -1
- package/dist/ui/components/FallbackShell.js +5 -17
- package/dist/ui/components/Fieldset.js +2 -6
- package/dist/ui/components/HorizontalRule.js +0 -1
- package/dist/ui/components/HotspotMarker.js +1 -3
- package/dist/ui/components/IconBox.js +0 -1
- package/dist/ui/components/Iframe.js +0 -1
- package/dist/ui/components/ImageGallery.js +1 -3
- package/dist/ui/components/ImageLightbox.js +1 -5
- package/dist/ui/components/Kbd.js +0 -1
- package/dist/ui/components/Motion.js +1 -3
- package/dist/ui/components/NavbarChevron.js +0 -1
- package/dist/ui/components/PasswordStrengthIndicator.js +1 -3
- package/dist/ui/components/Progress.js +2 -6
- package/dist/ui/components/Quote.js +1 -4
- package/dist/ui/components/Responsive.js +0 -4
- package/dist/ui/components/RowActionMenu.js +1 -3
- package/dist/ui/components/Scrim.js +0 -1
- package/dist/ui/components/SiteLogo.js +1 -9
- package/dist/ui/components/Skeleton.js +1 -3
- package/dist/ui/components/Slider.js +1 -3
- package/dist/ui/components/StickyToolbar.js +0 -1
- package/dist/ui/components/TabStrip.js +1 -3
- package/dist/ui/components/Toast.js +1 -3
- package/dist/ui/components/Tooltip.js +1 -4
- package/dist/ui/components/UnsavedChangesModal.js +1 -3
- package/dist/ui/rich-text/RichText.js +1 -1
- package/dist/utils/action-response.js +0 -1
- package/dist/utils/date.formatter.js +0 -1
- package/dist/utils/object.helper.js +0 -2
- package/dist/utils/schema-ui.js +1 -3
- package/dist/validation/input.validator.js +0 -1
- package/dist/validation/schemas.js +1 -3
- package/package.json +5 -2
- package/scripts/bundle-css.mjs +47 -0
- package/scripts/copy-assets.mjs +34 -0
- package/scripts/dedupe-peer-deps.mjs +92 -0
|
@@ -54,13 +54,7 @@ function AuctionRow({ auction, portal, }) {
|
|
|
54
54
|
const sorted = useMemo(() => [...auction.bids].sort((a, b) => b.bidAmount - a.bidAmount), [auction.bids]);
|
|
55
55
|
const highest = sorted[0]?.bidAmount ?? 0;
|
|
56
56
|
const isWinning = auction.bids.some((b) => b.isWinning);
|
|
57
|
-
return (_jsxs(Div, { className: `border border-[var(--appkit-color-border)] ${__O.hidden} bg-[var(--appkit-color-surface)]`, rounded: "xl", shadow: "sm", children: [_jsxs("button", { type: "button", onClick: () => setExpanded((v) => !v), className: "w-full flex items-center gap-3 px-4 py-3 hover:bg-[var(--appkit-color-border-subtle)] transition-colors text-left", "aria-expanded": expanded, children: [_jsx(ChevronRight, { className: `shrink-0 text-[var(--appkit-color-text-muted)] transition-transform ${expanded ? "rotate-90" : ""}`, size: 16 }), _jsx(Div, { className: "flex-1 min-w-0", children: _jsx(Text, { className: "text-[var(--appkit-color-text)] line-clamp-1", size: "sm", weight: "semibold", children: auction.productTitle }) }), _jsxs(Row, { gap: "sm", className: "shrink-0", children: [isWinning && (_jsx(Badge, { variant: "active", children: "Winning" })), _jsxs(Text, { variant: "secondary", size: "xs", children: [auction.bids.length, " bid", auction.bids.length !== 1 ? "s" : ""] }), _jsx(Text, { className: "text-[var(--appkit-color-text)]", size: "sm", weight: "semibold", children: paise(highest) })] })] }), expanded && (_jsxs(Div, { className: "border-t border-[var(--appkit-color-border)]", children: [_jsxs("div", { className: "grid text-xs font-medium text-[var(--appkit-color-text-muted)] uppercase tracking-wide px-4 py-2 border-b border-[var(--appkit-color-border-subtle)]",
|
|
58
|
-
// audit-inline-style-ok: runtime grid template
|
|
59
|
-
style: { gridTemplateColumns: portal === "buyer" ? "1fr auto auto" : "1fr 1fr auto auto" }, children: [_jsx(Span, { children: portal === "buyer" ? "Amount" : "Bidder" }), portal !== "buyer" && _jsx(Span, { children: "Amount" }), _jsx(Span, { children: "Status" }), _jsx(Span, { className: "text-right", children: "Time" })] }), sorted.map((bid) => (_jsxs("div", { className: "grid items-center px-4 py-2.5 border-b border-[var(--appkit-color-border-subtle)] last:border-0 hover:bg-[var(--appkit-color-border-subtle)] transition-colors",
|
|
60
|
-
// audit-inline-style-ok: runtime grid template
|
|
61
|
-
style: { gridTemplateColumns: portal === "buyer" ? "1fr auto auto" : "1fr 1fr auto auto" }, children: [portal !== "buyer" && (
|
|
62
|
-
// audit-variant-ok: bidder name Text — truncate + pr-3 right-only padding for column separation
|
|
63
|
-
_jsx(Text, { className: "text-[var(--appkit-color-text)] truncate pr-3", size: "sm", children: bid.userName || bid.userId })), _jsx(Text, { className: "text-[var(--appkit-color-text)]", size: "sm", weight: "medium", children: paise(bid.bidAmount) }), _jsx(Badge, { variant: STATUS_VARIANT[bid.status] ?? "pending", className: "capitalize", children: bid.status }), _jsx(Text, { variant: "secondary", size: "xs", align: "end", children: relDate(bid.bidDate) })] }, bid.id)))] }))] }));
|
|
57
|
+
return (_jsxs(Div, { className: `border border-[var(--appkit-color-border)] ${__O.hidden} bg-[var(--appkit-color-surface)]`, rounded: "xl", shadow: "sm", children: [_jsxs("button", { type: "button", onClick: () => setExpanded((v) => !v), className: "w-full flex items-center gap-3 px-4 py-3 hover:bg-[var(--appkit-color-border-subtle)] transition-colors text-left", "aria-expanded": expanded, children: [_jsx(ChevronRight, { className: `shrink-0 text-[var(--appkit-color-text-muted)] transition-transform ${expanded ? "rotate-90" : ""}`, size: 16 }), _jsx(Div, { className: "flex-1 min-w-0", children: _jsx(Text, { className: "text-[var(--appkit-color-text)] line-clamp-1", size: "sm", weight: "semibold", children: auction.productTitle }) }), _jsxs(Row, { gap: "sm", className: "shrink-0", children: [isWinning && (_jsx(Badge, { variant: "active", children: "Winning" })), _jsxs(Text, { variant: "secondary", size: "xs", children: [auction.bids.length, " bid", auction.bids.length !== 1 ? "s" : ""] }), _jsx(Text, { className: "text-[var(--appkit-color-text)]", size: "sm", weight: "semibold", children: paise(highest) })] })] }), expanded && (_jsxs(Div, { className: "border-t border-[var(--appkit-color-border)]", children: [_jsxs("div", { className: "grid text-xs font-medium text-[var(--appkit-color-text-muted)] uppercase tracking-wide px-4 py-2 border-b border-[var(--appkit-color-border-subtle)]", style: { gridTemplateColumns: portal === "buyer" ? "1fr auto auto" : "1fr 1fr auto auto" }, children: [_jsx(Span, { children: portal === "buyer" ? "Amount" : "Bidder" }), portal !== "buyer" && _jsx(Span, { children: "Amount" }), _jsx(Span, { children: "Status" }), _jsx(Span, { className: "text-right", children: "Time" })] }), sorted.map((bid) => (_jsxs("div", { className: "grid items-center px-4 py-2.5 border-b border-[var(--appkit-color-border-subtle)] last:border-0 hover:bg-[var(--appkit-color-border-subtle)] transition-colors", style: { gridTemplateColumns: portal === "buyer" ? "1fr auto auto" : "1fr 1fr auto auto" }, children: [portal !== "buyer" && (_jsx(Text, { className: "text-[var(--appkit-color-text)] truncate pr-3", size: "sm", children: bid.userName || bid.userId })), _jsx(Text, { className: "text-[var(--appkit-color-text)]", size: "sm", weight: "medium", children: paise(bid.bidAmount) }), _jsx(Badge, { variant: STATUS_VARIANT[bid.status] ?? "pending", className: "capitalize", children: bid.status }), _jsx(Text, { variant: "secondary", size: "xs", align: "end", children: relDate(bid.bidDate) })] }, bid.id)))] }))] }));
|
|
64
58
|
}
|
|
65
59
|
export function AuctionBidsTable({ bids, portal = "buyer", emptyLabel = "No bids found.", }) {
|
|
66
60
|
const auctions = useMemo(() => groupByAuction(bids), [bids]);
|
|
@@ -40,9 +40,7 @@ function toDescriptionHtml(raw) {
|
|
|
40
40
|
}
|
|
41
41
|
function renderAuctionInfoPanel(props) {
|
|
42
42
|
const { title, currentBid, currency, bidCount, isEnded, endDate, buyNowPrice, featured, freeShipping, condition, category, categoryName, brand, brandSlug, productFeatures, features, descriptionHtml, safeSeller, storeHref } = props;
|
|
43
|
-
return (_jsxs(Stack, { gap: "md", children: [_jsxs(Div, { children: [_jsxs(Row, { gap: "xs", wrap: true, className: "mb-2", children: [_jsx(Span, { size: "xs", weight: "semibold", className: CLS_LIVE_BADGE, children: "\uD83C\uDFF7\uFE0F Live Auction" }), isEnded ? (_jsx(Span, { color: "error", surface: "danger-surface", size: "xs", weight: "medium", className: "inline-block", padding: "pill-sm", rounded: "full", children: "Ended" })) : (_jsx(Span, { color: "success", surface: "success-surface", size: "xs", weight: "medium", className: "inline-block", padding: "pill-sm", rounded: "full", children: "Active" }))] }), _jsx(Heading, { level: 1, className: "leading-snug", smSize: "2xl", color: "primary", size: "xl", weight: "bold", children: title })] }), _jsxs(Div, { children: [_jsx(Text, { className: "mb-0.5", color: "muted", size: "xs", children: "Current bid" }), _jsxs(Row, { align: "center", gap: "sm", wrap: true, children: [_jsx(Span, { weight: "bold", className: "text-primary-600 dark:text-primary-400", size: "2xl", children: formatCurrency(currentBid, currency) }), _jsxs(Span, { size: "sm", weight: "medium", rounded: "full", padding: "pill-md", surface: "subtle", color: "muted", children: [bidCount, " ", bidCount === 1 ? "bid" : "bids"] })] }), endDate && _jsxs(Text, { className: "mt-1.5", color: "muted", size: "sm", children: [isEnded ? "Ended" : "Ends", " ", _jsx(Span, { weight: "medium", color: "muted", children: endDate.toLocaleString() })] })] }), buyNowPrice !== null && !isEnded && (
|
|
44
|
-
// audit-variant-ok: buy-now panel — primary-200/800 border + primary-50/900 bg; Row.surface lacks primary-tinted variant
|
|
45
|
-
_jsxs(Row, { align: "center", gap: "sm", className: "border border-primary-200 dark:border-primary-800 bg-primary-50 dark:bg-primary-900/20", padding: "inlineSm", rounded: "lg", children: [_jsx(Span, { size: "xs", color: "muted", children: "Buy Now:" }), _jsx(Span, { size: "base", weight: "bold", className: "text-primary-700 dark:text-primary-300", children: formatCurrency(buyNowPrice, currency) })] })), _jsx(ProductFeatureBadges, { featured: featured, freeShipping: freeShipping, condition: condition ?? undefined, labels: { featured: "Featured", fasterDelivery: "Faster Delivery", ratedSeller: "Rated Seller", condition: "Condition", conditionNew: "New", conditionUsed: "Used", conditionBroken: "For Parts", conditionRefurbished: "Refurbished", returnable: "Returnable", freeShipping: "Free Shipping", codAvailable: "Cash on Delivery", wishlistCount: (n) => `${n} wishlisted`, categoryProductCount: (n, cat) => `${n} in ${cat}` } }), (categoryName || category || brand) && (_jsxs(Row, { gap: "sm", wrap: true, children: [category && _jsx(Link, { href: String(ROUTES.PUBLIC.CATEGORY_DETAIL(category)), className: "inline-flex items-center rounded-full border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800/50 px-2.5 py-1 text-xs font-medium text-zinc-600 dark:text-zinc-300 transition-colors hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700 dark:hover:border-primary-700/60 dark:hover:bg-primary-900/20 dark:hover:text-primary-400", children: categoryName || category }), !category && categoryName && _jsx(Span, { layout: "inline-flex", size: "xs", weight: "medium", border: "subtle", rounded: "full", padding: "pill-sm-tall", surface: "muted", color: "muted", children: categoryName }), brand && brandSlug && _jsx(Link, { href: String(ROUTES.PUBLIC.BRAND_DETAIL(brandSlug)), className: "inline-flex items-center rounded-full border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800/50 px-2.5 py-1 text-xs font-medium text-zinc-600 dark:text-zinc-300 transition-colors hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700 dark:hover:border-primary-700/60 dark:hover:bg-primary-900/20 dark:hover:text-primary-400", children: brand }), brand && !brandSlug && _jsx(Span, { layout: "inline-flex", size: "xs", weight: "medium", border: "subtle", rounded: "full", padding: "pill-sm-tall", surface: "muted", color: "muted", children: brand })] })), productFeatures && features.length > 0 && _jsx(FeatureBadgeList, { productFeatureIds: features, features: productFeatures }), !productFeatures && features.length > 0 && (_jsxs(Div, { border: "subtle", surface: "muted", padding: "inline", rounded: "xl", children: [_jsx(Text, { className: "mb-2 tracking-wide", color: "muted", size: "xs", weight: "semibold", transform: "uppercase", children: "About this item" }), _jsx(Ul, { spacing: "comfortable", size: "sm", color: "primary", children: features.map((f, i) => _jsxs(Li, { layout: "flex-start", gap: "2", children: [_jsx(Span, { className: "mt-0.5 flex-shrink-0 text-primary-500", children: "\u2022" }), f] }, i)) })] })), descriptionHtml && _jsx(RichText, { html: descriptionHtml, proseClass: "prose prose-sm max-w-none dark:prose-invert prose-p:my-0", className: "text-sm leading-relaxed text-zinc-600 dark:text-zinc-400 line-clamp-4" }), safeSeller && (_jsx(Div, { className: `${__P.p3}`, border: "subtle", rounded: "xl", surface: "muted", children: _jsxs(Row, { justify: "between", align: "center", children: [_jsxs(Div, { children: [_jsx(Text, { className: "text-[10px] tracking-wide mb-0.5", color: "faint", transform: "uppercase", children: "Listed by" }), _jsx(Text, { size: "sm", weight: "semibold", color: "primary", children: safeSeller })] }), storeHref && _jsx(Link, { href: storeHref, className: "shrink-0 rounded-lg bg-primary/10 dark:bg-primary/20 px-3 py-1.5 text-xs font-semibold text-primary-700 dark:text-primary-300 hover:bg-primary/20 dark:hover:bg-primary/30 transition-colors", children: "Visit Store \u2192" })] }) }))] }));
|
|
43
|
+
return (_jsxs(Stack, { gap: "md", children: [_jsxs(Div, { children: [_jsxs(Row, { gap: "xs", wrap: true, className: "mb-2", children: [_jsx(Span, { size: "xs", weight: "semibold", className: CLS_LIVE_BADGE, children: "\uD83C\uDFF7\uFE0F Live Auction" }), isEnded ? (_jsx(Span, { color: "error", surface: "danger-surface", size: "xs", weight: "medium", className: "inline-block", padding: "pill-sm", rounded: "full", children: "Ended" })) : (_jsx(Span, { color: "success", surface: "success-surface", size: "xs", weight: "medium", className: "inline-block", padding: "pill-sm", rounded: "full", children: "Active" }))] }), _jsx(Heading, { level: 1, className: "leading-snug", smSize: "2xl", color: "primary", size: "xl", weight: "bold", children: title })] }), _jsxs(Div, { children: [_jsx(Text, { className: "mb-0.5", color: "muted", size: "xs", children: "Current bid" }), _jsxs(Row, { align: "center", gap: "sm", wrap: true, children: [_jsx(Span, { weight: "bold", className: "text-primary-600 dark:text-primary-400", size: "2xl", children: formatCurrency(currentBid, currency) }), _jsxs(Span, { size: "sm", weight: "medium", rounded: "full", padding: "pill-md", surface: "subtle", color: "muted", children: [bidCount, " ", bidCount === 1 ? "bid" : "bids"] })] }), endDate && _jsxs(Text, { className: "mt-1.5", color: "muted", size: "sm", children: [isEnded ? "Ended" : "Ends", " ", _jsx(Span, { weight: "medium", color: "muted", children: endDate.toLocaleString() })] })] }), buyNowPrice !== null && !isEnded && (_jsxs(Row, { align: "center", gap: "sm", className: "border border-primary-200 dark:border-primary-800 bg-primary-50 dark:bg-primary-900/20", padding: "inlineSm", rounded: "lg", children: [_jsx(Span, { size: "xs", color: "muted", children: "Buy Now:" }), _jsx(Span, { size: "base", weight: "bold", className: "text-primary-700 dark:text-primary-300", children: formatCurrency(buyNowPrice, currency) })] })), _jsx(ProductFeatureBadges, { featured: featured, freeShipping: freeShipping, condition: condition ?? undefined, labels: { featured: "Featured", fasterDelivery: "Faster Delivery", ratedSeller: "Rated Seller", condition: "Condition", conditionNew: "New", conditionUsed: "Used", conditionBroken: "For Parts", conditionRefurbished: "Refurbished", returnable: "Returnable", freeShipping: "Free Shipping", codAvailable: "Cash on Delivery", wishlistCount: (n) => `${n} wishlisted`, categoryProductCount: (n, cat) => `${n} in ${cat}` } }), (categoryName || category || brand) && (_jsxs(Row, { gap: "sm", wrap: true, children: [category && _jsx(Link, { href: String(ROUTES.PUBLIC.CATEGORY_DETAIL(category)), className: "inline-flex items-center rounded-full border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800/50 px-2.5 py-1 text-xs font-medium text-zinc-600 dark:text-zinc-300 transition-colors hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700 dark:hover:border-primary-700/60 dark:hover:bg-primary-900/20 dark:hover:text-primary-400", children: categoryName || category }), !category && categoryName && _jsx(Span, { layout: "inline-flex", size: "xs", weight: "medium", border: "subtle", rounded: "full", padding: "pill-sm-tall", surface: "muted", color: "muted", children: categoryName }), brand && brandSlug && _jsx(Link, { href: String(ROUTES.PUBLIC.BRAND_DETAIL(brandSlug)), className: "inline-flex items-center rounded-full border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800/50 px-2.5 py-1 text-xs font-medium text-zinc-600 dark:text-zinc-300 transition-colors hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700 dark:hover:border-primary-700/60 dark:hover:bg-primary-900/20 dark:hover:text-primary-400", children: brand }), brand && !brandSlug && _jsx(Span, { layout: "inline-flex", size: "xs", weight: "medium", border: "subtle", rounded: "full", padding: "pill-sm-tall", surface: "muted", color: "muted", children: brand })] })), productFeatures && features.length > 0 && _jsx(FeatureBadgeList, { productFeatureIds: features, features: productFeatures }), !productFeatures && features.length > 0 && (_jsxs(Div, { border: "subtle", surface: "muted", padding: "inline", rounded: "xl", children: [_jsx(Text, { className: "mb-2 tracking-wide", color: "muted", size: "xs", weight: "semibold", transform: "uppercase", children: "About this item" }), _jsx(Ul, { spacing: "comfortable", size: "sm", color: "primary", children: features.map((f, i) => _jsxs(Li, { layout: "flex-start", gap: "2", children: [_jsx(Span, { className: "mt-0.5 flex-shrink-0 text-primary-500", children: "\u2022" }), f] }, i)) })] })), descriptionHtml && _jsx(RichText, { html: descriptionHtml, proseClass: "prose prose-sm max-w-none dark:prose-invert prose-p:my-0", className: "text-sm leading-relaxed text-zinc-600 dark:text-zinc-400 line-clamp-4" }), safeSeller && (_jsx(Div, { className: `${__P.p3}`, border: "subtle", rounded: "xl", surface: "muted", children: _jsxs(Row, { justify: "between", align: "center", children: [_jsxs(Div, { children: [_jsx(Text, { className: "text-[10px] tracking-wide mb-0.5", color: "faint", transform: "uppercase", children: "Listed by" }), _jsx(Text, { size: "sm", weight: "semibold", color: "primary", children: safeSeller })] }), storeHref && _jsx(Link, { href: storeHref, className: "shrink-0 rounded-lg bg-primary/10 dark:bg-primary/20 px-3 py-1.5 text-xs font-semibold text-primary-700 dark:text-primary-300 hover:bg-primary/20 dark:hover:bg-primary/30 transition-colors", children: "Visit Store \u2192" })] }) }))] }));
|
|
46
44
|
}
|
|
47
45
|
function renderAuctionStoreReviews(storeReviews) {
|
|
48
46
|
if (storeReviews.length === 0)
|
|
@@ -57,7 +55,6 @@ export async function AuctionDetailPageView({ id, initialAuction, onPlaceBid, on
|
|
|
57
55
|
const bidsResult = product
|
|
58
56
|
? await listBidsByProduct(String(product.id), { pageSize: 20 }).catch(() => null)
|
|
59
57
|
: null;
|
|
60
|
-
// audit-unknown-ok: TS structural escape — domain document type lacks index signature
|
|
61
58
|
const storeId = product?.storeId;
|
|
62
59
|
const storeReviews = storeId
|
|
63
60
|
? await listReviewsBySeller(storeId).catch(() => [])
|
|
@@ -65,7 +62,6 @@ export async function AuctionDetailPageView({ id, initialAuction, onPlaceBid, on
|
|
|
65
62
|
if (!product) {
|
|
66
63
|
return (_jsx(Main, { children: _jsx(Section, { padding: "y-5xl", children: _jsx(Container, { size: "md", children: _jsxs(Stack, { align: "center", gap: "md", className: "text-center", children: [_jsx(Heading, { level: 1, size: "2xl", weight: "semibold", color: "primary", children: "Auction Not Found" }), _jsx(Text, { color: "muted", children: "This auction may have ended or the link is incorrect." }), _jsx(Link, { href: String(ROUTES.PUBLIC.AUCTIONS), className: "text-sm font-medium text-primary-600 hover:underline", children: "Browse Auctions" })] }) }) }) }));
|
|
67
64
|
}
|
|
68
|
-
// audit-unknown-ok: TS structural escape — domain document type lacks index signature
|
|
69
65
|
const p = product;
|
|
70
66
|
const currency = p.currency || getDefaultCurrency();
|
|
71
67
|
const title = String(p.title ?? p.name ?? "Auction Item");
|
|
@@ -161,7 +157,6 @@ export async function AuctionDetailPageView({ id, initialAuction, onPlaceBid, on
|
|
|
161
157
|
if (!end)
|
|
162
158
|
return true;
|
|
163
159
|
const endDate = typeof end.toDate === "function"
|
|
164
|
-
// audit-unknown-ok: TS structural escape
|
|
165
160
|
? end.toDate()
|
|
166
161
|
: end instanceof Date ? end : new Date(String(end));
|
|
167
162
|
return endDate > now;
|
|
@@ -19,27 +19,15 @@ const CLS_HEART_ON = "fill-error text-error";
|
|
|
19
19
|
const CLS_HEART_OFF = "text-zinc-400";
|
|
20
20
|
function renderAuctionCardHero(props) {
|
|
21
21
|
const { product, auctionHref, currentSrc, hovered, images, imageIndex, hasVideo, isEnded, isEndingSoon, isSelected, selectable, mergedLabels, onSelect, setHovered, handleSelect } = props;
|
|
22
|
-
return (_jsxs(BaseListingCard.Hero, { aspect: "square", variant: "grid", onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), children: [_jsx(TextLink, { href: auctionHref ?? "#", className: "absolute inset-0 block", children: _jsx(MediaImage, { src: currentSrc, alt: product.title, size: "card", fallback: "Auction image", className: `transition-transform duration-500 ${hovered && images.length > 1 ? "scale-105" : "scale-100"}` }) }), hasVideo && imageIndex === 0 ? (_jsx(Div, { className: "absolute right-2 top-2", children: _jsx(Span, { surface: "overlay-sm", layout: "flex-center", color: "inverse", className: "h-8 w-8", rounded: "full", children: _jsx(Play, { className: "h-4 w-4", "aria-label": mergedLabels.videoLabel }) }) })) : null, images.length > 1 ? (_jsx(Row, { gap: "xs", className: "pointer-events-none absolute bottom-2 left-1/2 -translate-x-1/2", children: images.map((_, index) => (
|
|
23
|
-
// audit-variant-ok: carousel page indicator — h-1.5 w-{1.5,3} sized dot; white-translucent has no surface variant
|
|
24
|
-
_jsx(Span, { className: `transition-all duration-200 ${index === imageIndex ? "h-1.5 w-3 bg-white" : "h-1.5 w-1.5 bg-white/60"}`, rounded: "full" }, `${product.id}-image-${index}`))) })) : null, product.featured ? (_jsx(Div, { className: "pointer-events-none absolute left-2 top-2 z-10", children: _jsx(Star, { className: CLS_STAR_ICON }) })) : null, onSelect && (_jsx(BaseListingCard.Checkbox, { selected: isSelected, onSelect: handleSelect, label: isSelected ? mergedLabels.deselectItem : mergedLabels.selectItem, className: selectable || isSelected ? "opacity-100" : "opacity-0 group-hover:opacity-100 transition-opacity" })), _jsxs(Stack, { className: `absolute left-2 z-10 ${product.featured ? "top-8" : "top-2"}`, gap: "xs", children: [!isEnded ? _jsx(Span, { size: "xs", weight: "bold", className: CLS_LIVE_BADGE, children: mergedLabels.liveBadge }) : null, isEndingSoon ? _jsx(Span, { size: "xs", weight: "bold", className: CLS_ENDING_BADGE, children: mergedLabels.endingSoon }) : null, isEnded ? _jsx(Span, { color: "inverse", size: "xs", weight: "bold", surface: "overlay-lg", rounded: "full", padding: "pill-xs", children: mergedLabels.ended }) : null, product.status === "sold" ? _jsx(Span, { color: "inverse", size: "xs", weight: "bold", surface: "overlay-xl", rounded: "full", padding: "pill-xs", children: mergedLabels.sold }) : null] }), _jsx(Div, { className: "pointer-events-none absolute bottom-2 right-2 z-10", children: _jsxs(Span, { size: "xs", weight: "semibold", className: CLS_RESERVE_BADGE, children: [_jsx(Gavel, { className: "h-3 w-3" }), mergedLabels.typeBadge] }) })] }));
|
|
22
|
+
return (_jsxs(BaseListingCard.Hero, { aspect: "square", variant: "grid", onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), children: [_jsx(TextLink, { href: auctionHref ?? "#", className: "absolute inset-0 block", children: _jsx(MediaImage, { src: currentSrc, alt: product.title, size: "card", fallback: "Auction image", className: `transition-transform duration-500 ${hovered && images.length > 1 ? "scale-105" : "scale-100"}` }) }), hasVideo && imageIndex === 0 ? (_jsx(Div, { className: "absolute right-2 top-2", children: _jsx(Span, { surface: "overlay-sm", layout: "flex-center", color: "inverse", className: "h-8 w-8", rounded: "full", children: _jsx(Play, { className: "h-4 w-4", "aria-label": mergedLabels.videoLabel }) }) })) : null, images.length > 1 ? (_jsx(Row, { gap: "xs", className: "pointer-events-none absolute bottom-2 left-1/2 -translate-x-1/2", children: images.map((_, index) => (_jsx(Span, { className: `transition-all duration-200 ${index === imageIndex ? "h-1.5 w-3 bg-white" : "h-1.5 w-1.5 bg-white/60"}`, rounded: "full" }, `${product.id}-image-${index}`))) })) : null, product.featured ? (_jsx(Div, { className: "pointer-events-none absolute left-2 top-2 z-10", children: _jsx(Star, { className: CLS_STAR_ICON }) })) : null, onSelect && (_jsx(BaseListingCard.Checkbox, { selected: isSelected, onSelect: handleSelect, label: isSelected ? mergedLabels.deselectItem : mergedLabels.selectItem, className: selectable || isSelected ? "opacity-100" : "opacity-0 group-hover:opacity-100 transition-opacity" })), _jsxs(Stack, { className: `absolute left-2 z-10 ${product.featured ? "top-8" : "top-2"}`, gap: "xs", children: [!isEnded ? _jsx(Span, { size: "xs", weight: "bold", className: CLS_LIVE_BADGE, children: mergedLabels.liveBadge }) : null, isEndingSoon ? _jsx(Span, { size: "xs", weight: "bold", className: CLS_ENDING_BADGE, children: mergedLabels.endingSoon }) : null, isEnded ? _jsx(Span, { color: "inverse", size: "xs", weight: "bold", surface: "overlay-lg", rounded: "full", padding: "pill-xs", children: mergedLabels.ended }) : null, product.status === "sold" ? _jsx(Span, { color: "inverse", size: "xs", weight: "bold", surface: "overlay-xl", rounded: "full", padding: "pill-xs", children: mergedLabels.sold }) : null] }), _jsx(Div, { className: "pointer-events-none absolute bottom-2 right-2 z-10", children: _jsxs(Span, { size: "xs", weight: "semibold", className: CLS_RESERVE_BADGE, children: [_jsx(Gavel, { className: "h-3 w-3" }), mergedLabels.typeBadge] }) })] }));
|
|
25
23
|
}
|
|
26
24
|
function renderAuctionCardInfoList(props) {
|
|
27
25
|
const { product, auctionHref, displayBid, bidCount, isEnded, remaining, inWishlist, wishlistLoading, wishlistActions, countdownClass, mergedLabels, handleWishlist, handleNavigate } = props;
|
|
28
|
-
return (_jsxs(_Fragment, { children: [_jsxs(Row, { className: "min-w-0", align: "start", justify: "between", gap: "sm", children: [_jsx(TextLink, { href: auctionHref ?? "#", className: `flex-1 leading-snug transition-colors hover:text-primary`, color: "primary", truncate: 2, size: "sm", weight: "medium", children: product.title }), wishlistActions ? (
|
|
29
|
-
// audit-variant-ok: compact heart icon button — p-1 outside PADDING_MAP scale, shrink-0 layout
|
|
30
|
-
_jsx(Button, { rounded: "full", type: "button", variant: "ghost", onClick: handleWishlist, disabled: wishlistLoading, "aria-label": inWishlist ? mergedLabels.removeFromWishlist : mergedLabels.addToWishlist, className: "shrink-0 p-1", children: _jsx(Heart, { className: `h-3.5 w-3.5 ${inWishlist ? CLS_HEART_ON : CLS_HEART_OFF}` }) })) : null] }), _jsxs(Row, { align: "center", gap: "sm", wrap: true, children: [_jsx(Text, { className: "text-primary", size: "sm", weight: "bold", children: formatCurrency(displayBid, getDefaultCurrency()) }), _jsxs(Div, { layout: "inline-flex", gap: "1", textWeight: "semibold", className: `items-center py-0.5 text-[11px] ${countdownClass}`, padding: "x-xs", rounded: "full", children: [_jsx(Clock, { className: "h-2.5 w-2.5" }), _jsx(Span, { children: formatCountdownLabel(remaining, mergedLabels.ended) })] }), bidCount > 0 && _jsx(Caption, { className: "text-[11px]", children: mergedLabels.totalBids(bidCount) })] }), !isEnded && (
|
|
31
|
-
// audit-variant-ok: compact place-bid button — px-2.5 outside PADDING_MAP scale + self-start alignment
|
|
32
|
-
_jsxs(Button, { gap: "xs", type: "button", variant: "warning", size: "sm", textSize: "xs", className: "self-start px-2.5 mt-0.5", onClick: handleNavigate, children: [_jsx(Gavel, { className: "h-3 w-3" }), _jsx(Span, { children: mergedLabels.placeBid })] }))] }));
|
|
26
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Row, { className: "min-w-0", align: "start", justify: "between", gap: "sm", children: [_jsx(TextLink, { href: auctionHref ?? "#", className: `flex-1 leading-snug transition-colors hover:text-primary`, color: "primary", truncate: 2, size: "sm", weight: "medium", children: product.title }), wishlistActions ? (_jsx(Button, { rounded: "full", type: "button", variant: "ghost", onClick: handleWishlist, disabled: wishlistLoading, "aria-label": inWishlist ? mergedLabels.removeFromWishlist : mergedLabels.addToWishlist, className: "shrink-0 p-1", children: _jsx(Heart, { className: `h-3.5 w-3.5 ${inWishlist ? CLS_HEART_ON : CLS_HEART_OFF}` }) })) : null] }), _jsxs(Row, { align: "center", gap: "sm", wrap: true, children: [_jsx(Text, { className: "text-primary", size: "sm", weight: "bold", children: formatCurrency(displayBid, getDefaultCurrency()) }), _jsxs(Div, { layout: "inline-flex", gap: "1", textWeight: "semibold", className: `items-center py-0.5 text-[11px] ${countdownClass}`, padding: "x-xs", rounded: "full", children: [_jsx(Clock, { className: "h-2.5 w-2.5" }), _jsx(Span, { children: formatCountdownLabel(remaining, mergedLabels.ended) })] }), bidCount > 0 && _jsx(Caption, { className: "text-[11px]", children: mergedLabels.totalBids(bidCount) })] }), !isEnded && (_jsxs(Button, { gap: "xs", type: "button", variant: "warning", size: "sm", textSize: "xs", className: "self-start px-2.5 mt-0.5", onClick: handleNavigate, children: [_jsx(Gavel, { className: "h-3 w-3" }), _jsx(Span, { children: mergedLabels.placeBid })] }))] }));
|
|
33
27
|
}
|
|
34
28
|
function renderAuctionCardInfoGrid(props) {
|
|
35
29
|
const { product, auctionHref, displayBid, bidCount, hasCurrentBid, isEnded, remaining, resolvedBuyoutPrice, inWishlist, wishlistLoading, wishlistActions, countdownClass, mergedLabels, handleWishlist, handleNavigate } = props;
|
|
36
|
-
return (_jsxs(_Fragment, { children: [_jsxs(Row, { align: "start", gap: "sm", children: [_jsx(TextLink, { href: auctionHref ?? "#", className: "min-w-0 flex-1 leading-snug transition-colors hover:text-primary", color: "primary", size: "sm", weight: "medium", children: product.title }), wishlistActions ? (
|
|
37
|
-
// audit-variant-ok: grid-mode heart icon button — p-1 outside PADDING_MAP scale + negative margin for alignment
|
|
38
|
-
_jsx(Button, { rounded: "full", type: "button", variant: "ghost", onClick: handleWishlist, disabled: wishlistLoading, "aria-label": inWishlist ? mergedLabels.removeFromWishlist : mergedLabels.addToWishlist, className: "-mt-0.5 p-1", children: _jsx(Heart, { className: `h-4 w-4 ${inWishlist ? CLS_HEART_ON : CLS_HEART_OFF}` }) })) : null] }), _jsxs(Div, { children: [_jsx(Caption, { children: isEnded && hasCurrentBid ? mergedLabels.winningBid : hasCurrentBid ? mergedLabels.currentBid : mergedLabels.startingBid }), _jsx(Text, { className: "leading-none text-primary", size: "base", weight: "bold", children: formatCurrency(displayBid, getDefaultCurrency()) }), isEnded && product.winnerDisplayName && (_jsxs(Caption, { className: "mt-0.5", color: "muted", children: [mergedLabels.wonBy, ": ", maskDisplayName(product.winnerDisplayName)] }))] }), _jsxs(Row, { wrap: true, justify: "between", gap: "sm", className: "gap-x-2 gap-y-1", children: [_jsxs(Div, { layout: "inline-flex", gap: "1", textWeight: "semibold", textSize: "xs", className: `items-center ${countdownClass}`, paddingY: "y-2xs", paddingX: "x-xs", rounded: "full", children: [_jsx(Clock, { className: "h-3 w-3" }), _jsx(Span, { children: formatCountdownLabel(remaining, mergedLabels.ended) })] }), _jsx(Caption, { children: mergedLabels.totalBids(bidCount) })] }), _jsx(Row, { wrap: true, gap: "xs", className: "mt-auto", children: isEnded ? (
|
|
39
|
-
// audit-variant-ok: ended-state full-width disabled button — flex-1 + px-2 + opacity dim
|
|
40
|
-
_jsx(Button, { gap: "xs", type: "button", variant: "ghost", size: "sm", textSize: "xs", className: "flex-1 cursor-not-allowed px-2 opacity-60", disabled: true, children: _jsx(Span, { children: mergedLabels.ended }) })) : (_jsxs(_Fragment, { children: [_jsxs(Button, { gap: "xs", type: "button", variant: "warning", size: "sm", textSize: "xs", className: "flex-1 px-2", onClick: handleNavigate, children: [_jsx(Gavel, { className: "h-3 w-3" }), _jsx(Span, { children: mergedLabels.placeBid })] }), resolvedBuyoutPrice ? (
|
|
41
|
-
// audit-variant-ok: flex-1 split-action button — px-2 to fit dual-button row
|
|
42
|
-
_jsxs(Button, { gap: "xs", type: "button", variant: "danger", size: "sm", textSize: "xs", className: "flex-1 px-2", onClick: handleNavigate, children: [_jsx(ShoppingBag, { className: "h-3 w-3" }), _jsx(Span, { children: mergedLabels.buyout })] })) : null] })) })] }));
|
|
30
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Row, { align: "start", gap: "sm", children: [_jsx(TextLink, { href: auctionHref ?? "#", className: "min-w-0 flex-1 leading-snug transition-colors hover:text-primary", color: "primary", size: "sm", weight: "medium", children: product.title }), wishlistActions ? (_jsx(Button, { rounded: "full", type: "button", variant: "ghost", onClick: handleWishlist, disabled: wishlistLoading, "aria-label": inWishlist ? mergedLabels.removeFromWishlist : mergedLabels.addToWishlist, className: "-mt-0.5 p-1", children: _jsx(Heart, { className: `h-4 w-4 ${inWishlist ? CLS_HEART_ON : CLS_HEART_OFF}` }) })) : null] }), _jsxs(Div, { children: [_jsx(Caption, { children: isEnded && hasCurrentBid ? mergedLabels.winningBid : hasCurrentBid ? mergedLabels.currentBid : mergedLabels.startingBid }), _jsx(Text, { className: "leading-none text-primary", size: "base", weight: "bold", children: formatCurrency(displayBid, getDefaultCurrency()) }), isEnded && product.winnerDisplayName && (_jsxs(Caption, { className: "mt-0.5", color: "muted", children: [mergedLabels.wonBy, ": ", maskDisplayName(product.winnerDisplayName)] }))] }), _jsxs(Row, { wrap: true, justify: "between", gap: "sm", className: "gap-x-2 gap-y-1", children: [_jsxs(Div, { layout: "inline-flex", gap: "1", textWeight: "semibold", textSize: "xs", className: `items-center ${countdownClass}`, paddingY: "y-2xs", paddingX: "x-xs", rounded: "full", children: [_jsx(Clock, { className: "h-3 w-3" }), _jsx(Span, { children: formatCountdownLabel(remaining, mergedLabels.ended) })] }), _jsx(Caption, { children: mergedLabels.totalBids(bidCount) })] }), _jsx(Row, { wrap: true, gap: "xs", className: "mt-auto", children: isEnded ? (_jsx(Button, { gap: "xs", type: "button", variant: "ghost", size: "sm", textSize: "xs", className: "flex-1 cursor-not-allowed px-2 opacity-60", disabled: true, children: _jsx(Span, { children: mergedLabels.ended }) })) : (_jsxs(_Fragment, { children: [_jsxs(Button, { gap: "xs", type: "button", variant: "warning", size: "sm", textSize: "xs", className: "flex-1 px-2", onClick: handleNavigate, children: [_jsx(Gavel, { className: "h-3 w-3" }), _jsx(Span, { children: mergedLabels.placeBid })] }), resolvedBuyoutPrice ? (_jsxs(Button, { gap: "xs", type: "button", variant: "danger", size: "sm", textSize: "xs", className: "flex-1 px-2", onClick: handleNavigate, children: [_jsx(ShoppingBag, { className: "h-3 w-3" }), _jsx(Span, { children: mergedLabels.buyout })] })) : null] })) })] }));
|
|
43
31
|
}
|
|
44
32
|
const DEFAULT_LABELS = {
|
|
45
33
|
selectItem: "Select item",
|
|
@@ -44,7 +44,6 @@ export function PlaceBidFormClient({ productId, currentBid, startingBid, minBidI
|
|
|
44
44
|
setSuccess(true);
|
|
45
45
|
setBidAmount(String(amount + minBidIncrement));
|
|
46
46
|
setStepMul(1);
|
|
47
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
48
47
|
}
|
|
49
48
|
catch (err) {
|
|
50
49
|
void normalizeError(err);
|
|
@@ -56,7 +55,6 @@ export function PlaceBidFormClient({ productId, currentBid, startingBid, minBidI
|
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
57
|
}
|
|
59
|
-
// audit-unknown-ok: type-narrowing entry point — accepts any value, narrows by typeof/Array.isArray
|
|
60
58
|
function bidErrorMessage(result) {
|
|
61
59
|
if (!result || typeof result !== "object" || !("ok" in result))
|
|
62
60
|
return null;
|
|
@@ -80,7 +78,6 @@ export function PlaceBidFormClient({ productId, currentBid, startingBid, minBidI
|
|
|
80
78
|
return;
|
|
81
79
|
}
|
|
82
80
|
setSuccess(true);
|
|
83
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
84
81
|
}
|
|
85
82
|
catch (err) {
|
|
86
83
|
void normalizeError(err);
|
|
@@ -10,7 +10,6 @@ export function ForgotPasswordView({ onSubmit, isLoading = false, error, success
|
|
|
10
10
|
const [email, setEmail] = useState("");
|
|
11
11
|
return (_jsx(Row, { className: `min-h-[60vh] ${className}`, align: "center", justify: "center", padding: "x-md", children: _jsxs(Stack, { className: "max-w-md w-full", gap: "lg", children: [_jsxs(Div, { className: "text-center", children: [_jsx(Heading, { level: 1, className: "font-extrabold", size: "3xl", children: labels.title ?? "Forgot Password" }), _jsx(Text, { className: "mt-2 text-neutral-600 dark:text-neutral-400", size: "sm", children: labels.description ??
|
|
12
12
|
"Enter your email and we'll send you a reset link." })] }), error && (_jsx(Alert, { variant: "error", compact: true, children: error })), success && (_jsx(Alert, { variant: "success", compact: true, children: success })), !success && (_jsx(Form, { noValidate: true, onSubmit: (e) => e.preventDefault(), spacing: "md", children: ({ setFieldError, clearErrors }) => (_jsxs(_Fragment, { children: [_jsx(FieldInput, { name: "email", label: labels.emailLabel ?? "Email address", type: "email", autoComplete: "username", required: true, placeholder: labels.emailPlaceholder ?? "you@example.com", value: email, onChange: setEmail }), _jsx(Button, { type: "submit", isLoading: isLoading, disabled: isLoading, className: "w-full", onClick: async () => {
|
|
13
|
-
// toast-handled-by-hook: onSubmit prop's mutation hook owns toast UX
|
|
14
13
|
clearErrors();
|
|
15
14
|
const parsed = forgotPasswordSchema.safeParse({ email });
|
|
16
15
|
if (!parsed.success)
|
|
@@ -15,7 +15,6 @@ export function LoginForm({ onSubmit, onGoogleLogin, isLoading = false, error, l
|
|
|
15
15
|
rememberMe: false,
|
|
16
16
|
});
|
|
17
17
|
return (_jsx(Row, { className: `min-h-[60vh] ${className}`, align: "center", justify: "center", padding: "x-md", children: _jsxs(Stack, { className: "max-w-md w-full", gap: "lg", children: [_jsxs(Div, { className: "text-center", children: [_jsx(Heading, { level: 1, className: "font-extrabold", size: "3xl", children: labels.title ?? "Sign In" }), (labels.subtitle || renderCreateAccountLink) && (_jsxs(Text, { className: "mt-2", color: "muted", size: "sm", children: [labels.subtitle ?? "Or", " ", renderCreateAccountLink?.()] }))] }), error && (_jsx(Alert, { variant: "error", compact: true, children: error })), _jsx(Form, { noValidate: true, onSubmit: (e) => e.preventDefault(), spacing: "md", children: ({ setFieldError, clearErrors }) => (_jsxs(_Fragment, { children: [_jsx(FieldInput, { name: "email", label: labels.emailLabel ?? "Email address", type: "email", autoComplete: "username", required: true, placeholder: labels.emailPlaceholder ?? "you@example.com", value: values.email, onChange: (v) => setValues({ ...values, email: v }) }), _jsx(FieldInput, { name: "password", label: labels.passwordLabel ?? "Password", type: "password", autoComplete: "current-password", required: true, placeholder: labels.passwordPlaceholder ?? "••••••••", value: values.password, onChange: (v) => setValues({ ...values, password: v }) }), _jsxs(Row, { justify: "between", children: [_jsx(FieldCheckbox, { name: "rememberMe", label: labels.rememberMe ?? "Remember me", checked: values.rememberMe ?? false, onChange: (c) => setValues({ ...values, rememberMe: c }) }), renderForgotPasswordLink?.()] }), _jsx(Button, { type: "submit", isLoading: isLoading, disabled: isLoading, className: "w-full", onClick: async () => {
|
|
18
|
-
// toast-handled-by-hook: onSubmit prop's mutation hook owns toast UX
|
|
19
18
|
clearErrors();
|
|
20
19
|
const parsed = loginSchema.safeParse(values);
|
|
21
20
|
if (!parsed.success)
|
|
@@ -27,7 +27,6 @@ export function RegisterForm({ onSubmit, isLoading = false, error, success, labe
|
|
|
27
27
|
acceptTerms: false,
|
|
28
28
|
});
|
|
29
29
|
return (_jsx(Row, { className: `min-h-[60vh] ${className}`, align: "center", justify: "center", padding: "x-md", children: _jsxs(Stack, { className: "max-w-md w-full", gap: "lg", children: [_jsxs(Div, { className: "text-center", children: [_jsx(Heading, { level: 1, className: "font-extrabold", size: "3xl", children: labels.title ?? "Create Account" }), (labels.subtitle || renderLoginLink) && (_jsxs(Text, { className: "mt-2 text-neutral-600 dark:text-neutral-400", size: "sm", children: [labels.subtitle ?? "Already have an account?", " ", renderLoginLink?.()] }))] }), success && (_jsx(Alert, { variant: "success", compact: true, children: success })), error && (_jsx(Alert, { variant: "error", compact: true, children: error })), _jsx(Form, { noValidate: true, onSubmit: (e) => e.preventDefault(), spacing: "md", children: ({ setFieldError, clearErrors }) => (_jsxs(_Fragment, { children: [_jsx(FieldInput, { name: "displayName", label: labels.displayNameLabel ?? "Full name", type: "text", autoComplete: "name", required: true, placeholder: labels.displayNamePlaceholder ?? "Your name", value: values.displayName, onChange: (v) => setValues({ ...values, displayName: v }) }), _jsx(FieldInput, { name: "email", label: labels.emailLabel ?? "Email address", type: "email", autoComplete: "username", required: true, placeholder: labels.emailPlaceholder ?? "you@example.com", value: values.email, onChange: (v) => setValues({ ...values, email: v }) }), _jsxs(Div, { children: [_jsx(FieldInput, { name: "password", label: labels.passwordLabel ?? "Password", type: "password", autoComplete: "new-password", required: true, placeholder: labels.passwordPlaceholder ?? "••••••••", value: values.password, onChange: (v) => setValues({ ...values, password: v }) }), renderPasswordStrength?.(values.password)] }), _jsx(FieldInput, { name: "confirmPassword", label: labels.confirmPasswordLabel ?? "Confirm password", type: "password", autoComplete: "new-password", required: true, placeholder: labels.confirmPasswordPlaceholder ?? "••••••••", value: values.confirmPassword, onChange: (v) => setValues({ ...values, confirmPassword: v }) }), _jsx(FieldCheckbox, { name: "acceptTerms", label: `${labels.acceptTermsLabel ?? "I accept the terms"}`, checked: values.acceptTerms, onChange: (c) => setValues({ ...values, acceptTerms: c }) }), renderTermsLink && (_jsx(Text, { size: "xs", variant: "secondary", children: renderTermsLink() })), _jsx(Button, { type: "submit", isLoading: isLoading, disabled: isLoading, className: "w-full", onClick: async () => {
|
|
30
|
-
// toast-handled-by-hook: onSubmit prop's mutation hook owns toast UX
|
|
31
30
|
clearErrors();
|
|
32
31
|
const parsed = registerClientSchema.safeParse(values);
|
|
33
32
|
if (!parsed.success)
|
|
@@ -17,7 +17,6 @@ export function ResetPasswordView({ oobCode, onSubmit, isLoading = false, error,
|
|
|
17
17
|
const [password, setPassword] = useState("");
|
|
18
18
|
const [confirmPassword, setConfirmPassword] = useState("");
|
|
19
19
|
return (_jsx(Row, { className: `min-h-[60vh] ${className}`, align: "center", justify: "center", padding: "x-md", children: _jsxs(Stack, { className: "max-w-md w-full", gap: "lg", children: [_jsxs(Div, { className: "text-center", children: [_jsx(Heading, { level: 1, className: "font-extrabold", size: "3xl", children: labels.title ?? "Reset Password" }), labels.description && (_jsx(Text, { className: "mt-2 text-neutral-600 dark:text-neutral-400", size: "sm", children: labels.description }))] }), error && (_jsx(Alert, { variant: "error", compact: true, children: error })), success ? (_jsxs(Alert, { variant: "success", compact: true, children: [success, renderLoginLink && _jsx(Div, { className: "mt-2", children: renderLoginLink() })] })) : (_jsx(Form, { noValidate: true, onSubmit: (e) => e.preventDefault(), spacing: "md", children: ({ setFieldError, clearErrors }) => (_jsxs(_Fragment, { children: [_jsx(FieldInput, { name: "password", label: labels.passwordLabel ?? "New password", type: "password", autoComplete: "new-password", required: true, placeholder: labels.passwordPlaceholder ?? "••••••••", value: password, onChange: setPassword }), _jsx(FieldInput, { name: "confirmPassword", label: labels.confirmPasswordLabel ?? "Confirm new password", type: "password", autoComplete: "new-password", required: true, placeholder: labels.confirmPasswordPlaceholder ?? "••••••••", value: confirmPassword, onChange: setConfirmPassword }), _jsx(Button, { type: "submit", variant: "primary", isLoading: isLoading, disabled: isLoading, className: "w-full", onClick: async () => {
|
|
20
|
-
// toast-handled-by-hook: onSubmit prop's mutation hook owns toast UX
|
|
21
20
|
clearErrors();
|
|
22
21
|
const parsed = resetClientSchema.safeParse({ password, confirmPassword });
|
|
23
22
|
if (!parsed.success)
|
|
@@ -120,7 +120,6 @@ export function useGoogleLogin(options) {
|
|
|
120
120
|
return () => window.removeEventListener("message", handleMessage);
|
|
121
121
|
}, []); // mount once — uses refs, no stale closure risk
|
|
122
122
|
const mutate = useCallback(async () => {
|
|
123
|
-
// toast-intentionally-silent — errors surfaced via onErrorRef.current() callback
|
|
124
123
|
calledRef.current = false; // reset for each new auth flow
|
|
125
124
|
const popup = window.open(`${window.location.origin}/auth.html`, "oauth_google", "width=500,height=660,left=400,top=100");
|
|
126
125
|
if (!popup) {
|
|
@@ -12,7 +12,6 @@ export class EmailVerificationTokenRepository extends BaseRepository {
|
|
|
12
12
|
const raw = super.mapDoc(snap);
|
|
13
13
|
return decryptPiiFields(raw, [
|
|
14
14
|
...TOKEN_PII_FIELDS,
|
|
15
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
16
15
|
]);
|
|
17
16
|
}
|
|
18
17
|
async create(data) {
|
|
@@ -86,7 +85,6 @@ export class PasswordResetTokenRepository extends BaseRepository {
|
|
|
86
85
|
const raw = super.mapDoc(snap);
|
|
87
86
|
return decryptPiiFields(raw, [
|
|
88
87
|
...TOKEN_PII_FIELDS,
|
|
89
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
90
88
|
]);
|
|
91
89
|
}
|
|
92
90
|
async create(data) {
|
|
@@ -28,7 +28,7 @@ export async function GET(_request, context) {
|
|
|
28
28
|
return NextResponse.json({ success: false, error: "Blog post not found" }, { status: 404 });
|
|
29
29
|
}
|
|
30
30
|
// Increment view count fire-and-forget — must not block response
|
|
31
|
-
blogRepository.incrementViews(post.id).catch(() => { });
|
|
31
|
+
blogRepository.incrementViews(post.id).catch(() => { });
|
|
32
32
|
// Related posts: same category, latest 3, excluding current
|
|
33
33
|
const related = (await blogRepository.findRelated(post.category, post.id, 3)).map(toBlogPost);
|
|
34
34
|
const body = { post: toBlogPost(post), related };
|
|
@@ -30,9 +30,5 @@ export function BlogFeaturedCard({ post, href, labels = {}, className = "", sele
|
|
|
30
30
|
day: "numeric",
|
|
31
31
|
})
|
|
32
32
|
: "";
|
|
33
|
-
return (
|
|
34
|
-
// audit-variant-ok: blog card Article — flex-col + hover-shadow-md transition + conditional ring-2 selected outline; Article lacks card-with-hover-state variant
|
|
35
|
-
_jsxs(Article, { className: `group relative flex h-full flex-col overflow-hidden rounded-xl border border-neutral-200 dark:border-slate-700 bg-white dark:bg-slate-900 shadow-sm hover:shadow-md transition-shadow duration-200 ${isSelected ? "ring-2 ring-primary outline outline-2 outline-primary" : ""} ${className}`, onMouseDown: onSelect && !isSelected ? longPress.onMouseDown : undefined, onMouseUp: onSelect && !isSelected ? longPress.onMouseUp : undefined, onMouseLeave: onSelect && !isSelected ? longPress.onMouseLeave : undefined, onTouchStart: onSelect && !isSelected ? longPress.onTouchStart : undefined, onTouchEnd: onSelect && !isSelected ? longPress.onTouchEnd : undefined, children: [onSelect && (_jsx(BaseListingCard.Checkbox, { selected: isSelected, onSelect: (e) => { e.preventDefault(); onSelect(post.id, !isSelected); }, label: isSelected ? "Deselect post" : "Select post", position: "top-2 left-2", className: selectable || isSelected ? "opacity-100" : "opacity-0 group-hover:opacity-100 transition-opacity" })), _jsxs(TextLink, { href: href, className: "flex h-full flex-col", children: [_jsx(Div, { className: `aspect-video ${__O.hidden} flex-shrink-0`, children: coverImageUrl ? (_jsx(Div, { role: "img", "aria-label": safeTitle, className: "h-full w-full bg-cover bg-center transition-transform duration-300 group-hover:scale-105",
|
|
36
|
-
// audit-inline-style-ok: dynamic image URL
|
|
37
|
-
style: { backgroundImage: `url(${coverImageUrl})` } })) : (_jsx(Div, { role: "img", "aria-label": safeTitle, surface: "muted", className: "h-full w-full" })) }), _jsxs(Stack, { className: `flex-1 ${__P.p4}`, children: [_jsxs(Row, { gap: "xs", className: "mb-2", wrap: true, children: [_jsx(Span, { size: "xs", weight: "medium", className: `inline-block capitalize ${CATEGORY_BADGE[post.category] ?? "bg-zinc-100 text-zinc-700 dark:bg-zinc-800 dark:text-zinc-300"}`, rounded: "full", padding: "pill-xs", children: post.category }), post.isFeatured && (_jsx(Span, { size: "xs", weight: "medium", className: CLS_FEATURED_BADGE, children: labels.featuredBadge ?? "Featured" }))] }), _jsx(Heading, { level: 3, className: `leading-snug mb-1`, color: "primary", truncate: 2, size: "base", weight: "semibold", children: safeTitle }), post.excerpt && (_jsx(Text, { className: `mb-3`, color: "muted", truncate: 2, size: "sm", children: post.excerpt })), _jsxs(Row, { color: "muted", textSize: "xs", className: "mt-auto", gap: "3", wrap: true, children: [post.authorName && (_jsx(Span, { children: safeDisplayName(post.authorName, "Author") })), post.readTimeMinutes != null && (_jsxs(Span, { children: [post.readTimeMinutes, " ", labels.readTime ?? "min read"] })), date && _jsx(Span, { children: date })] })] })] })] }));
|
|
33
|
+
return (_jsxs(Article, { className: `group relative flex h-full flex-col overflow-hidden rounded-xl border border-neutral-200 dark:border-slate-700 bg-white dark:bg-slate-900 shadow-sm hover:shadow-md transition-shadow duration-200 ${isSelected ? "ring-2 ring-primary outline outline-2 outline-primary" : ""} ${className}`, onMouseDown: onSelect && !isSelected ? longPress.onMouseDown : undefined, onMouseUp: onSelect && !isSelected ? longPress.onMouseUp : undefined, onMouseLeave: onSelect && !isSelected ? longPress.onMouseLeave : undefined, onTouchStart: onSelect && !isSelected ? longPress.onTouchStart : undefined, onTouchEnd: onSelect && !isSelected ? longPress.onTouchEnd : undefined, children: [onSelect && (_jsx(BaseListingCard.Checkbox, { selected: isSelected, onSelect: (e) => { e.preventDefault(); onSelect(post.id, !isSelected); }, label: isSelected ? "Deselect post" : "Select post", position: "top-2 left-2", className: selectable || isSelected ? "opacity-100" : "opacity-0 group-hover:opacity-100 transition-opacity" })), _jsxs(TextLink, { href: href, className: "flex h-full flex-col", children: [_jsx(Div, { className: `aspect-video ${__O.hidden} flex-shrink-0`, children: coverImageUrl ? (_jsx(Div, { role: "img", "aria-label": safeTitle, className: "h-full w-full bg-cover bg-center transition-transform duration-300 group-hover:scale-105", style: { backgroundImage: `url(${coverImageUrl})` } })) : (_jsx(Div, { role: "img", "aria-label": safeTitle, surface: "muted", className: "h-full w-full" })) }), _jsxs(Stack, { className: `flex-1 ${__P.p4}`, children: [_jsxs(Row, { gap: "xs", className: "mb-2", wrap: true, children: [_jsx(Span, { size: "xs", weight: "medium", className: `inline-block capitalize ${CATEGORY_BADGE[post.category] ?? "bg-zinc-100 text-zinc-700 dark:bg-zinc-800 dark:text-zinc-300"}`, rounded: "full", padding: "pill-xs", children: post.category }), post.isFeatured && (_jsx(Span, { size: "xs", weight: "medium", className: CLS_FEATURED_BADGE, children: labels.featuredBadge ?? "Featured" }))] }), _jsx(Heading, { level: 3, className: `leading-snug mb-1`, color: "primary", truncate: 2, size: "base", weight: "semibold", children: safeTitle }), post.excerpt && (_jsx(Text, { className: `mb-3`, color: "muted", truncate: 2, size: "sm", children: post.excerpt })), _jsxs(Row, { color: "muted", textSize: "xs", className: "mt-auto", gap: "3", wrap: true, children: [post.authorName && (_jsx(Span, { children: safeDisplayName(post.authorName, "Author") })), post.readTimeMinutes != null && (_jsxs(Span, { children: [post.readTimeMinutes, " ", labels.readTime ?? "min read"] })), date && _jsx(Span, { children: date })] })] })] })] }));
|
|
38
34
|
}
|
|
@@ -73,7 +73,6 @@ export function BlogIndexListing({ initialData }) {
|
|
|
73
73
|
buildSieveParams: () => "",
|
|
74
74
|
buildSearchParams: () => "",
|
|
75
75
|
params: new URLSearchParams(),
|
|
76
|
-
// audit-unknown-ok: TS structural escape — table-state type
|
|
77
76
|
}), [pendingFilters]);
|
|
78
77
|
const openFilters = useCallback(() => {
|
|
79
78
|
setPendingFilters(Object.fromEntries(FILTER_KEYS.map((k) => [k, table.get(k)])));
|
|
@@ -25,11 +25,7 @@ export function BlogCard({ post, href, onClick, className = "" }) {
|
|
|
25
25
|
const isInteractive = !!(href || onClick);
|
|
26
26
|
const card = (_jsxs(Article, { role: onClick && !href ? "button" : undefined, tabIndex: onClick && !href ? 0 : undefined, onKeyDown: onClick && !href
|
|
27
27
|
? (e) => (e.key === "Enter" || e.key === " ") && onClick(post)
|
|
28
|
-
: undefined, onClick: onClick && !href ? () => onClick(post) : undefined, className: `group flex flex-col h-full overflow-hidden rounded-xl border border-neutral-200 dark:border-slate-700 bg-white dark:bg-slate-900 shadow-sm transition hover:shadow-md ${isInteractive ? "cursor-pointer" : ""} ${className}`, children: [_jsx(Div, { className: `aspect-video w-full ${__O.hidden} bg-neutral-100 dark:bg-slate-800 flex-shrink-0`, children: coverImageUrl ? (_jsx(Div, { role: "img", "aria-label": post.title, className: "h-full w-full bg-center bg-cover transition-transform duration-300 group-hover:scale-105",
|
|
29
|
-
// audit-inline-style-ok: dynamic image URL
|
|
30
|
-
style: { backgroundImage: `url(${coverImageUrl})` } })) : (_jsx(Row, { surface: "muted", className: "h-full w-full", align: "center", justify: "center", children: _jsx(Span, { className: "opacity-30", size: "4xl", "aria-hidden": "true", children: "\u270D\uFE0F" }) })) }), _jsxs(Stack, { className: `flex-1 ${__P.p5}`, children: [_jsxs(Row, { className: "mb-2", gap: "sm", wrap: true, children: [_jsx(Span, { size: "xs", weight: "medium", className: "bg-primary/10 text-primary", rounded: "full", padding: "pill-xs", transform: "capitalize", children: post.category }), post.isFeatured && (_jsx(Span, { size: "xs", weight: "medium", className: CLS_FEATURED_BADGE, children: "Featured" })), post.readTimeMinutes && (_jsxs(Span, { size: "xs", color: "muted", children: [post.readTimeMinutes, " min read"] }))] }), _jsx(Heading, { level: 3, className: `group-hover:text-primary`, color: "primary", truncate: 2, size: "base", weight: "semibold", children: post.title }), post.excerpt && (_jsx(Text, { className: `mt-2 flex-1`, color: "muted", truncate: 3, size: "sm", children: post.excerpt })), _jsxs(Row, { className: "mt-auto", padding: "t-sm", gap: "3", children: [post.authorAvatar ? (_jsx(Div, { role: "img", "aria-label": post.authorName ?? "author", className: "h-7 w-7 flex-shrink-0 bg-center bg-cover", rounded: "full",
|
|
31
|
-
// audit-inline-style-ok: dynamic image URL
|
|
32
|
-
style: { backgroundImage: `url(${post.authorAvatar})` } })) : post.authorName ? (_jsx(Row, { textWeight: "bold", textSize: "xs", className: "h-7 w-7 flex-shrink-0 bg-primary/10 text-primary", align: "center", justify: "center", rounded: "full", children: post.authorName.charAt(0).toUpperCase() })) : null, _jsxs(Text, { className: "text-neutral-500 dark:text-neutral-400 min-w-0", size: "xs", children: [post.authorName && (_jsx(Span, { weight: "medium", className: "text-neutral-700", children: safeDisplayName(post.authorName, "Author") })), date && _jsxs(Span, { className: "ml-1 text-neutral-400", children: ["\u00B7 ", date] })] })] })] })] }));
|
|
28
|
+
: undefined, onClick: onClick && !href ? () => onClick(post) : undefined, className: `group flex flex-col h-full overflow-hidden rounded-xl border border-neutral-200 dark:border-slate-700 bg-white dark:bg-slate-900 shadow-sm transition hover:shadow-md ${isInteractive ? "cursor-pointer" : ""} ${className}`, children: [_jsx(Div, { className: `aspect-video w-full ${__O.hidden} bg-neutral-100 dark:bg-slate-800 flex-shrink-0`, children: coverImageUrl ? (_jsx(Div, { role: "img", "aria-label": post.title, className: "h-full w-full bg-center bg-cover transition-transform duration-300 group-hover:scale-105", style: { backgroundImage: `url(${coverImageUrl})` } })) : (_jsx(Row, { surface: "muted", className: "h-full w-full", align: "center", justify: "center", children: _jsx(Span, { className: "opacity-30", size: "4xl", "aria-hidden": "true", children: "\u270D\uFE0F" }) })) }), _jsxs(Stack, { className: `flex-1 ${__P.p5}`, children: [_jsxs(Row, { className: "mb-2", gap: "sm", wrap: true, children: [_jsx(Span, { size: "xs", weight: "medium", className: "bg-primary/10 text-primary", rounded: "full", padding: "pill-xs", transform: "capitalize", children: post.category }), post.isFeatured && (_jsx(Span, { size: "xs", weight: "medium", className: CLS_FEATURED_BADGE, children: "Featured" })), post.readTimeMinutes && (_jsxs(Span, { size: "xs", color: "muted", children: [post.readTimeMinutes, " min read"] }))] }), _jsx(Heading, { level: 3, className: `group-hover:text-primary`, color: "primary", truncate: 2, size: "base", weight: "semibold", children: post.title }), post.excerpt && (_jsx(Text, { className: `mt-2 flex-1`, color: "muted", truncate: 3, size: "sm", children: post.excerpt })), _jsxs(Row, { className: "mt-auto", padding: "t-sm", gap: "3", children: [post.authorAvatar ? (_jsx(Div, { role: "img", "aria-label": post.authorName ?? "author", className: "h-7 w-7 flex-shrink-0 bg-center bg-cover", rounded: "full", style: { backgroundImage: `url(${post.authorAvatar})` } })) : post.authorName ? (_jsx(Row, { textWeight: "bold", textSize: "xs", className: "h-7 w-7 flex-shrink-0 bg-primary/10 text-primary", align: "center", justify: "center", rounded: "full", children: post.authorName.charAt(0).toUpperCase() })) : null, _jsxs(Text, { className: "text-neutral-500 dark:text-neutral-400 min-w-0", size: "xs", children: [post.authorName && (_jsx(Span, { weight: "medium", className: "text-neutral-700", children: safeDisplayName(post.authorName, "Author") })), date && _jsxs(Span, { className: "ml-1 text-neutral-400", children: ["\u00B7 ", date] })] })] })] })] }));
|
|
33
29
|
if (href) {
|
|
34
30
|
return (_jsx(Link, { href: href, className: "block h-full", children: card }));
|
|
35
31
|
}
|
|
@@ -53,7 +53,5 @@ export function BlogPostView({ slug, initialData, labels = {}, renderImage, rend
|
|
|
53
53
|
})
|
|
54
54
|
: "";
|
|
55
55
|
const coverImageUrl = getMediaUrl(post.coverImage);
|
|
56
|
-
return (_jsxs(Div, { className: `min-h-screen ${className}`, children: [coverImageUrl && (_jsxs(Div, { className: `relative h-72 md:h-96 ${__O.hidden}`, children: [renderImage ? (renderImage(post)) : (_jsx(Div, { role: "img", "aria-label": post.title, className: "h-full w-full bg-cover bg-center",
|
|
57
|
-
// audit-inline-style-ok: dynamic image URL
|
|
58
|
-
style: { backgroundImage: `url(${coverImageUrl})` } })), _jsx(Scrim, { direction: "bottom-up", intensity: "subtle", className: "absolute inset-0" })] })), _jsxs(Div, { className: "max-w-3xl mx-auto", paddingY: "y-3xl", paddingX: "x-md", children: [renderBlogPostHeader(post, date, labels), post.tags && post.tags.length > 0 && (_jsx(Row, { wrap: true, gap: "sm", className: "mb-8", children: post.tags.map((tag) => (_jsxs(Link, { href: `${String(ROUTES.PUBLIC.BLOG)}?tags=${encodeURIComponent(tag)}`, className: "inline-block px-3 py-1 rounded-full bg-neutral-100 dark:bg-zinc-800 hover:bg-primary/10 text-zinc-600 dark:text-zinc-400 hover:text-primary text-xs font-medium transition-colors", children: ["#", tag] }, tag))) })), renderAuthorBio && _jsx(Div, { className: "mb-6", children: renderAuthorBio(post) }), _jsx(Div, { surface: "card", padding: "xl", className: "mb-12", children: renderContent ? renderContent(post) : (_jsx(RichText, { html: normalizeRichTextHtml(post.content ?? ""), proseClass: "prose max-w-none dark:prose-invert" })) }), renderBlogPostRelated(related, labels, renderRelatedCard), renderBackButton && _jsx(Div, { border: "default", className: "mt-10 border-t", padding: "t-xl", children: renderBackButton() })] })] }));
|
|
56
|
+
return (_jsxs(Div, { className: `min-h-screen ${className}`, children: [coverImageUrl && (_jsxs(Div, { className: `relative h-72 md:h-96 ${__O.hidden}`, children: [renderImage ? (renderImage(post)) : (_jsx(Div, { role: "img", "aria-label": post.title, className: "h-full w-full bg-cover bg-center", style: { backgroundImage: `url(${coverImageUrl})` } })), _jsx(Scrim, { direction: "bottom-up", intensity: "subtle", className: "absolute inset-0" })] })), _jsxs(Div, { className: "max-w-3xl mx-auto", paddingY: "y-3xl", paddingX: "x-md", children: [renderBlogPostHeader(post, date, labels), post.tags && post.tags.length > 0 && (_jsx(Row, { wrap: true, gap: "sm", className: "mb-8", children: post.tags.map((tag) => (_jsxs(Link, { href: `${String(ROUTES.PUBLIC.BLOG)}?tags=${encodeURIComponent(tag)}`, className: "inline-block px-3 py-1 rounded-full bg-neutral-100 dark:bg-zinc-800 hover:bg-primary/10 text-zinc-600 dark:text-zinc-400 hover:text-primary text-xs font-medium transition-colors", children: ["#", tag] }, tag))) })), renderAuthorBio && _jsx(Div, { className: "mb-6", children: renderAuthorBio(post) }), _jsx(Div, { surface: "card", padding: "xl", className: "mb-12", children: renderContent ? renderContent(post) : (_jsx(RichText, { html: normalizeRichTextHtml(post.content ?? ""), proseClass: "prose max-w-none dark:prose-invert" })) }), renderBlogPostRelated(related, labels, renderRelatedCard), renderBackButton && _jsx(Div, { border: "default", className: "mt-10 border-t", padding: "t-xl", children: renderBackButton() })] })] }));
|
|
59
57
|
}
|
|
@@ -11,9 +11,7 @@ const __O = {
|
|
|
11
11
|
};
|
|
12
12
|
const CLS_REMOVE_BTN = "self-start text-zinc-400 dark:text-zinc-400 transition hover:text-error";
|
|
13
13
|
export function CartItemRow({ item, onQtyChange, onRemove, href, isOutOfStock = false }) {
|
|
14
|
-
return (_jsxs(Div, { layout: "flex", gap: "4", surface: "card", padding: "sm", className: `transition-opacity ${isOutOfStock ? "opacity-60" : ""}`, children: [_jsx(Div, { surface: "muted", className: `h-20 w-20 flex-shrink-0 ${__O.hidden}`, rounded: "lg", children: item.meta.image && (_jsx(Div, { role: "img", "aria-label": item.meta.title, className: "h-full w-full bg-center bg-cover",
|
|
15
|
-
// audit-inline-style-ok: dynamic image URL
|
|
16
|
-
style: { backgroundImage: `url(${item.meta.image})` } })) }), _jsxs(Stack, { justify: "between", className: "flex-1", children: [_jsxs(Row, { gap: "xs", className: "", align: "start", children: [href ? (_jsx("a", { href: href, target: "_blank", rel: "noopener noreferrer", className: "font-medium text-neutral-900 dark:text-zinc-100 hover:underline underline-offset-2 line-clamp-2", children: item.meta.title })) : (_jsx(Text, { truncate: 2, weight: "medium", color: "primary", children: item.meta.title })), isOutOfStock && (_jsx(Span, { padding: "pill-2xs", color: "error", surface: "danger-surface", weight: "semibold", className: "flex-shrink-0 text-[10px] tracking-wide", rounded: "default", transform: "uppercase", children: "Out of Stock" }))] }), item.meta.attributes &&
|
|
14
|
+
return (_jsxs(Div, { layout: "flex", gap: "4", surface: "card", padding: "sm", className: `transition-opacity ${isOutOfStock ? "opacity-60" : ""}`, children: [_jsx(Div, { surface: "muted", className: `h-20 w-20 flex-shrink-0 ${__O.hidden}`, rounded: "lg", children: item.meta.image && (_jsx(Div, { role: "img", "aria-label": item.meta.title, className: "h-full w-full bg-center bg-cover", style: { backgroundImage: `url(${item.meta.image})` } })) }), _jsxs(Stack, { justify: "between", className: "flex-1", children: [_jsxs(Row, { gap: "xs", className: "", align: "start", children: [href ? (_jsx("a", { href: href, target: "_blank", rel: "noopener noreferrer", className: "font-medium text-neutral-900 dark:text-zinc-100 hover:underline underline-offset-2 line-clamp-2", children: item.meta.title })) : (_jsx(Text, { truncate: 2, weight: "medium", color: "primary", children: item.meta.title })), isOutOfStock && (_jsx(Span, { padding: "pill-2xs", color: "error", surface: "danger-surface", weight: "semibold", className: "flex-shrink-0 text-[10px] tracking-wide", rounded: "default", transform: "uppercase", children: "Out of Stock" }))] }), item.meta.attributes &&
|
|
17
15
|
Object.keys(item.meta.attributes).length > 0 && (_jsx(Text, { className: "text-neutral-500 dark:text-neutral-400", size: "xs", children: Object.entries(item.meta.attributes)
|
|
18
16
|
.map(([k, v]) => `${k}: ${v}`)
|
|
19
17
|
.join(", ") })), _jsxs(Row, { justify: "between", children: [_jsx(Text, { className: "text-neutral-900 dark:text-neutral-100", weight: "semibold", children: formatCurrency(item.meta.price * item.quantity, item.meta.currency) }), onQtyChange && !isOutOfStock && (_jsxs(Row, { gap: "sm", children: [_jsx(Button, { rounded: "full", onClick: () => onQtyChange(item.id, item.quantity - 1), disabled: item.quantity <= 1, variant: "outline", size: "sm", className: "h-7 w-7 justify-center border border-neutral-200 dark:border-slate-600 text-sm disabled:opacity-40", children: "\u2212" }), _jsx(Span, { size: "sm", className: "min-w-[1.5rem]", align: "center", children: item.quantity }), _jsx(Button, { rounded: "full", onClick: () => onQtyChange(item.id, item.quantity + 1), variant: "outline", size: "sm", className: "h-7 w-7 justify-center border border-neutral-200 dark:border-slate-600 text-sm", children: "+" })] })), isOutOfStock && (_jsxs(Span, { size: "xs", color: "muted", children: ["Qty: ", item.quantity] }))] })] }), onRemove && (_jsx(Button, { onClick: () => onRemove(item.id), variant: "ghost", size: "sm", "aria-label": ACTIONS.CART["remove-item"].ariaLabel, className: CLS_REMOVE_BTN, children: "\u2715" }))] }));
|
|
@@ -21,7 +19,5 @@ export function CartItemRow({ item, onQtyChange, onRemove, href, isOutOfStock =
|
|
|
21
19
|
export function CartDrawer({ isOpen, onClose, items, subtotal = 0, currency, isLoading, onQtyChange, onRemove, onCheckout, labels = {}, }) {
|
|
22
20
|
if (!isOpen)
|
|
23
21
|
return null;
|
|
24
|
-
return (_jsxs(_Fragment, { children: [_jsx(Div, { surface: "overlay-xs", role: "presentation", className: "fixed inset-0 z-40", onClick: onClose }), _jsxs(Aside, { className: "fixed inset-y-0 right-0 z-50 flex w-full max-w-sm flex-col bg-white dark:bg-slate-900 shadow-xl", children: [_jsxs(Row, { justify: "between", border: "bottom", className: __P.p4, children: [_jsx(Heading, { level: 2, size: "lg", weight: "semibold", children: labels.title ?? "Cart" }), _jsx(Button, { onClick: onClose, variant: "ghost", size: "sm", "aria-label": "Close cart", textColor: "faint", className: "hover:text-neutral-900 dark:hover:text-zinc-100", children: "\u2715" })] }), _jsx(Stack, { className: `flex-1 ${__O.yAuto} ${__P.p4}`, gap: "3", children: isLoading ? (_jsx(Row, { justify: "center", padding: "y-3xl", children: _jsx(Div, { className: "h-8 w-8 animate-spin border-2 border-neutral-300 border-t-neutral-800 dark:border-t-zinc-200", rounded: "full" }) })) : items.length === 0 ? (_jsx(Text, { paddingY: "3xl", className: "text-neutral-500 dark:text-neutral-400", size: "sm", align: "center", children: labels.empty ?? "Your cart is empty" })) : (items.map((item) => (_jsx(CartItemRow, { item: item, onQtyChange: onQtyChange, onRemove: onRemove }, item.id)))) }), items.length > 0 && (_jsxs(Stack, { border: "top", className: __P.p4, gap: "md", children: [_jsxs(Row, { textSize: "sm", justify: "between", children: [_jsx(Span, { className: "text-neutral-600 dark:text-neutral-400", children: labels.subtotal ?? "Subtotal" }), _jsx(Span, { weight: "semibold", children: formatCurrency(subtotal, currency) })] }), onCheckout && (
|
|
25
|
-
// audit-variant-ok: checkout CTA — bespoke dark surface bg-neutral-900 + py-3 + font-semibold; Button.variant lacks dark/charcoal tone
|
|
26
|
-
_jsx(Button, { rounded: "xl", onClick: onCheckout, variant: "primary", textSize: "sm", className: "w-full bg-neutral-900 py-3 font-semibold text-white transition hover:bg-neutral-800", children: labels.checkout ?? ACTIONS.CART["checkout"].label }))] }))] })] }));
|
|
22
|
+
return (_jsxs(_Fragment, { children: [_jsx(Div, { surface: "overlay-xs", role: "presentation", className: "fixed inset-0 z-40", onClick: onClose }), _jsxs(Aside, { className: "fixed inset-y-0 right-0 z-50 flex w-full max-w-sm flex-col bg-white dark:bg-slate-900 shadow-xl", children: [_jsxs(Row, { justify: "between", border: "bottom", className: __P.p4, children: [_jsx(Heading, { level: 2, size: "lg", weight: "semibold", children: labels.title ?? "Cart" }), _jsx(Button, { onClick: onClose, variant: "ghost", size: "sm", "aria-label": "Close cart", textColor: "faint", className: "hover:text-neutral-900 dark:hover:text-zinc-100", children: "\u2715" })] }), _jsx(Stack, { className: `flex-1 ${__O.yAuto} ${__P.p4}`, gap: "3", children: isLoading ? (_jsx(Row, { justify: "center", padding: "y-3xl", children: _jsx(Div, { className: "h-8 w-8 animate-spin border-2 border-neutral-300 border-t-neutral-800 dark:border-t-zinc-200", rounded: "full" }) })) : items.length === 0 ? (_jsx(Text, { paddingY: "3xl", className: "text-neutral-500 dark:text-neutral-400", size: "sm", align: "center", children: labels.empty ?? "Your cart is empty" })) : (items.map((item) => (_jsx(CartItemRow, { item: item, onQtyChange: onQtyChange, onRemove: onRemove }, item.id)))) }), items.length > 0 && (_jsxs(Stack, { border: "top", className: __P.p4, gap: "md", children: [_jsxs(Row, { textSize: "sm", justify: "between", children: [_jsx(Span, { className: "text-neutral-600 dark:text-neutral-400", children: labels.subtotal ?? "Subtotal" }), _jsx(Span, { weight: "semibold", children: formatCurrency(subtotal, currency) })] }), onCheckout && (_jsx(Button, { rounded: "xl", onClick: onCheckout, variant: "primary", textSize: "sm", className: "w-full bg-neutral-900 py-3 font-semibold text-white transition hover:bg-neutral-800", children: labels.checkout ?? ACTIONS.CART["checkout"].label }))] }))] })] }));
|
|
27
23
|
}
|
|
@@ -89,17 +89,5 @@ export async function BrandDetailPageView({ slug, initialBrand }) {
|
|
|
89
89
|
counts.preOrders +
|
|
90
90
|
counts.prizeDraws +
|
|
91
91
|
counts.bundles;
|
|
92
|
-
return (_jsxs(Main, { children: [_jsxs(Section, { className: `relative ${__O.hidden} ${hasCover ? "min-h-[220px] md:min-h-[280px]" : "bg-zinc-50 dark:bg-zinc-900"}`, children: [hasCover && (_jsxs(_Fragment, { children: [_jsx("div", { className: "absolute inset-0 bg-center bg-cover",
|
|
93
|
-
// audit-inline-style-ok: dynamic image URL
|
|
94
|
-
style: { backgroundImage: `url(${coverImage})` } }), _jsx(Div, { surface: "overlay-md", className: "absolute inset-0" })] })), !hasCover && (_jsx("div", { className: "absolute inset-0 opacity-10",
|
|
95
|
-
// audit-inline-style-ok: runtime theme color
|
|
96
|
-
style: { backgroundColor: brandColor } })), _jsxs(Div, { className: `relative z-10 max-w-7xl mx-auto ${hasCover ? "py-12" : "py-8"}`, padding: "x-md", children: [_jsxs(Nav, { className: "flex items-center gap-1.5 text-sm mb-4", "aria-label": "Breadcrumb", children: [_jsx(Link, { href: String(ROUTES.HOME), className: hasCover ? "text-white/70 hover:text-white transition-colors" : "text-zinc-500 dark:text-zinc-400 hover:text-primary-600 transition-colors", children: "Home" }), _jsx(Span, { className: hasCover ? "text-white/40" : "text-zinc-400", children: "/" }), _jsx(Link, { href: String(ROUTES.PUBLIC.BRANDS ?? "/brands"), className: hasCover ? "text-white/70 hover:text-white transition-colors" : "text-zinc-500 dark:text-zinc-400 hover:text-primary-600 transition-colors", children: "Brands" }), _jsx(Span, { className: hasCover ? "text-white/40" : "text-zinc-400", children: "/" }), _jsx(Span, { weight: "medium", className: hasCover ? "text-white" : "text-zinc-900 dark:text-zinc-100", children: brand?.name ?? slug })] }), _jsxs(Row, { className: "mb-3", align: "center", gap: "md", children: [brand?.display?.icon && (_jsx(Span, { className: "leading-none", size: "5xl", children: brand.display.icon })), _jsxs(_Fragment, { children: [_jsx(Heading, { color: "inverse", level: 1, className: `${hasCover ? "" : "text-zinc-900 dark:text-zinc-50"}`, size: "3xl", mdSize: "4xl", weight: "bold", children: brand?.name ?? slug }), brand?.description && typeof brand.description === "string" && !brand.description.startsWith("{") && (
|
|
97
|
-
// audit-variant-ok: brand description — conditional muted-zinc fallback when no cover; inverse default keeps over-image legibility
|
|
98
|
-
_jsx(Text, { color: "inverse", className: `max-w-2xl mt-1 ${hasCover ? "/80" : "text-zinc-600 dark:text-zinc-400"}`, size: "base", children: brand.description }))] })] }), _jsxs(Row, { gap: "sm", className: "flex-wrap mt-3", children: [counts.products > 0 && (
|
|
99
|
-
// audit-variant-ok: count chip — conditional translucent-white (cover) OR tinted primary (no cover); no white-overlay surface variant
|
|
100
|
-
_jsxs(Span, { layout: "inline-flex", gap: "xs", color: "inverse", size: "xs", weight: "medium", className: `${hasCover ? "bg-white/20 backdrop-blur-sm" : "bg-primary/10 text-primary-700 dark:text-primary-400"}`, rounded: "full", padding: "pill-sm-tall", children: [counts.products.toLocaleString(), " ", counts.products === 1 ? "product" : "products"] })), counts.auctions > 0 && (
|
|
101
|
-
// audit-variant-ok: count chip — conditional translucent-white (cover) OR warning surface (no cover); compound bg cannot use Span.surface
|
|
102
|
-
_jsxs(Span, { layout: "inline-flex", gap: "xs", color: "inverse", size: "xs", weight: "medium", className: `${hasCover ? "bg-white/20 backdrop-blur-sm" : "bg-warning-surface text-warning dark:bg-warning-surface dark:text-warning"}`, rounded: "full", padding: "pill-sm-tall", children: [counts.auctions.toLocaleString(), " ", counts.auctions === 1 ? "auction" : "auctions"] })), counts.preOrders > 0 && (
|
|
103
|
-
// audit-variant-ok: count chip — conditional translucent-white (cover) OR info surface (no cover); compound bg cannot use Span.surface
|
|
104
|
-
_jsxs(Span, { layout: "inline-flex", gap: "xs", color: "inverse", size: "xs", weight: "medium", className: `${hasCover ? "bg-white/20 backdrop-blur-sm" : "bg-info-surface text-info dark:bg-info-surface dark:text-info"}`, rounded: "full", padding: "pill-sm-tall", children: [counts.preOrders.toLocaleString(), " ", counts.preOrders === 1 ? "pre-order" : "pre-orders"] })), totalItems === 0 && (_jsx(Span, { size: "sm", className: hasCover ? "text-white/60" : "text-zinc-400", children: "No items listed yet" }))] })] })] }), _jsx(Section, { padding: "y-lg", children: _jsx(Container, { size: "xl", children: brandName ? (_jsx(BrandDetailTabs, { brandName: brandName, initialProductsData: productsResult ?? undefined, initialBundles: brandBundles, counts: counts })) : (_jsx(Text, { paddingY: "3xl", color: "muted", size: "sm", align: "center", children: "Brand not found." })) }) })] }));
|
|
92
|
+
return (_jsxs(Main, { children: [_jsxs(Section, { className: `relative ${__O.hidden} ${hasCover ? "min-h-[220px] md:min-h-[280px]" : "bg-zinc-50 dark:bg-zinc-900"}`, children: [hasCover && (_jsxs(_Fragment, { children: [_jsx("div", { className: "absolute inset-0 bg-center bg-cover", style: { backgroundImage: `url(${coverImage})` } }), _jsx(Div, { surface: "overlay-md", className: "absolute inset-0" })] })), !hasCover && (_jsx("div", { className: "absolute inset-0 opacity-10", style: { backgroundColor: brandColor } })), _jsxs(Div, { className: `relative z-10 max-w-7xl mx-auto ${hasCover ? "py-12" : "py-8"}`, padding: "x-md", children: [_jsxs(Nav, { className: "flex items-center gap-1.5 text-sm mb-4", "aria-label": "Breadcrumb", children: [_jsx(Link, { href: String(ROUTES.HOME), className: hasCover ? "text-white/70 hover:text-white transition-colors" : "text-zinc-500 dark:text-zinc-400 hover:text-primary-600 transition-colors", children: "Home" }), _jsx(Span, { className: hasCover ? "text-white/40" : "text-zinc-400", children: "/" }), _jsx(Link, { href: String(ROUTES.PUBLIC.BRANDS ?? "/brands"), className: hasCover ? "text-white/70 hover:text-white transition-colors" : "text-zinc-500 dark:text-zinc-400 hover:text-primary-600 transition-colors", children: "Brands" }), _jsx(Span, { className: hasCover ? "text-white/40" : "text-zinc-400", children: "/" }), _jsx(Span, { weight: "medium", className: hasCover ? "text-white" : "text-zinc-900 dark:text-zinc-100", children: brand?.name ?? slug })] }), _jsxs(Row, { className: "mb-3", align: "center", gap: "md", children: [brand?.display?.icon && (_jsx(Span, { className: "leading-none", size: "5xl", children: brand.display.icon })), _jsxs(_Fragment, { children: [_jsx(Heading, { color: "inverse", level: 1, className: `${hasCover ? "" : "text-zinc-900 dark:text-zinc-50"}`, size: "3xl", mdSize: "4xl", weight: "bold", children: brand?.name ?? slug }), brand?.description && typeof brand.description === "string" && !brand.description.startsWith("{") && (_jsx(Text, { color: "inverse", className: `max-w-2xl mt-1 ${hasCover ? "/80" : "text-zinc-600 dark:text-zinc-400"}`, size: "base", children: brand.description }))] })] }), _jsxs(Row, { gap: "sm", className: "flex-wrap mt-3", children: [counts.products > 0 && (_jsxs(Span, { layout: "inline-flex", gap: "xs", color: "inverse", size: "xs", weight: "medium", className: `${hasCover ? "bg-white/20 backdrop-blur-sm" : "bg-primary/10 text-primary-700 dark:text-primary-400"}`, rounded: "full", padding: "pill-sm-tall", children: [counts.products.toLocaleString(), " ", counts.products === 1 ? "product" : "products"] })), counts.auctions > 0 && (_jsxs(Span, { layout: "inline-flex", gap: "xs", color: "inverse", size: "xs", weight: "medium", className: `${hasCover ? "bg-white/20 backdrop-blur-sm" : "bg-warning-surface text-warning dark:bg-warning-surface dark:text-warning"}`, rounded: "full", padding: "pill-sm-tall", children: [counts.auctions.toLocaleString(), " ", counts.auctions === 1 ? "auction" : "auctions"] })), counts.preOrders > 0 && (_jsxs(Span, { layout: "inline-flex", gap: "xs", color: "inverse", size: "xs", weight: "medium", className: `${hasCover ? "bg-white/20 backdrop-blur-sm" : "bg-info-surface text-info dark:bg-info-surface dark:text-info"}`, rounded: "full", padding: "pill-sm-tall", children: [counts.preOrders.toLocaleString(), " ", counts.preOrders === 1 ? "pre-order" : "pre-orders"] })), totalItems === 0 && (_jsx(Span, { size: "sm", className: hasCover ? "text-white/60" : "text-zinc-400", children: "No items listed yet" }))] })] })] }), _jsx(Section, { padding: "y-lg", children: _jsx(Container, { size: "xl", children: brandName ? (_jsx(BrandDetailTabs, { brandName: brandName, initialProductsData: productsResult ?? undefined, initialBundles: brandBundles, counts: counts })) : (_jsx(Text, { paddingY: "3xl", color: "muted", size: "sm", align: "center", children: "Brand not found." })) }) })] }));
|
|
105
93
|
}
|
|
@@ -22,9 +22,5 @@ export function BundleDetailView({ bundle, members = [], onBuyNow, }) {
|
|
|
22
22
|
const priceLabel = bundle.bundlePriceInPaise
|
|
23
23
|
? formatCurrency(bundle.bundlePriceInPaise / 100, "INR")
|
|
24
24
|
: BUNDLE_COPY.detail.priceFallback;
|
|
25
|
-
return (_jsx(Main, { children: _jsx(Section, { padding: "y-2xl", children: _jsx(Container, { size: "xl", children: _jsxs(Stack, { gap: "lg", children: [_jsxs(Row, { gap: "lg", align: "start", className: "flex-col md:flex-row", children: [_jsx(Div, { className: "w-full md:w-2/5", children: members.length > 0 ? (_jsx(BundleCollage, { members: members })) : (_jsx(Div, { className: `aspect-video w-full ${__O.hidden}`, rounded: "2xl", surface: "subtle", children: _jsx(Div, { className: "h-full w-full", children: _jsx(MediaImage, { src: cover, alt: bundle.name, size: "hero", fallback: PLACEHOLDER_EMOJI }) }) })) }), _jsxs(Stack, { gap: "md", className: "flex-1", children: [_jsx(Heading, { level: 1, size: "3xl", weight: "semibold", color: "primary", children: bundle.name }), _jsxs(Row, { gap: "sm", align: "center", children: [_jsx(Text, { size: "lg", weight: "bold", children: priceLabel }), _jsxs(Text, { size: "sm", color: "muted", children: ["\u00B7 ", BUNDLE_COPY.detail.itemCount(memberCount)] }), _jsx(Badge, { variant: BUNDLE_STOCK_VARIANT[stock], children: STOCK_BADGE_TEXT[stock] })] }), bundle.description && (_jsxs(Stack, { gap: "xs", children: [_jsx(Heading, { level: 2, className: "text-[var(--appkit-color-text-muted)]", size: "sm", weight: "semibold", children: BUNDLE_COPY.detailDescriptionHeading }), _jsx(Text, { className: "whitespace-pre-line", children: bundle.description })] })), onBuyNow ? (_jsx(BundleBuyNowCta, { bundleSlug: bundle.slug, outOfStock: stock === "out_of_stock", onBuyNow: onBuyNow })) : (_jsxs(Div, { textSize: "sm", className: "border-dashed", border: "strong", surface: "muted", rounded: "xl", padding: "md", "aria-live": "polite", children: [_jsx(Text, { weight: "semibold", className: "mb-1 block", children: BUNDLE_COPY.detail.ctaDisabled }), _jsx(Text, { size: "sm", color: "muted", children: BUNDLE_COPY.detail.ctaHint })] }))] })] }), _jsxs(Stack, { gap: "md", children: [_jsx(Heading, { level: 2, size: "xl", weight: "semibold", color: "primary", children: BUNDLE_COPY.detailItemsHeading }), members.length === 0 ? (_jsx(Text, { color: "muted", children: BUNDLE_COPY.detail.emptyMembers })) : (
|
|
26
|
-
// audit-variant-ok: members grid Ul — grid grid-cols-1 sm:grid-cols-2 + gap-2 responsive grid layout; Ul lacks grid layout variant
|
|
27
|
-
_jsx(Ul, { className: "grid grid-cols-1 sm:grid-cols-2 gap-2", children: members.map((p, i) => (
|
|
28
|
-
// audit-variant-ok: bundle-member row — Li composite (flex+border+px+py+text-sm) is a Card pattern Li doesn't yet expose; defer to Li.surfaceProps extension
|
|
29
|
-
_jsxs(Li, { className: "flex items-center gap-2 rounded-lg border border-zinc-100 dark:border-zinc-800 px-3 py-2 text-sm", children: [_jsxs(Span, { size: "xs", weight: "semibold", className: "w-5", color: "faint", children: ["#", i + 1] }), _jsx(Link, { href: String(ROUTES.PUBLIC.PRODUCT_DETAIL?.(p.slug ?? p.id) ?? "#"), className: "flex-1 truncate font-medium hover:underline hover:text-primary", children: p.title })] }, p.id))) }))] })] }) }) }) }));
|
|
25
|
+
return (_jsx(Main, { children: _jsx(Section, { padding: "y-2xl", children: _jsx(Container, { size: "xl", children: _jsxs(Stack, { gap: "lg", children: [_jsxs(Row, { gap: "lg", align: "start", className: "flex-col md:flex-row", children: [_jsx(Div, { className: "w-full md:w-2/5", children: members.length > 0 ? (_jsx(BundleCollage, { members: members })) : (_jsx(Div, { className: `aspect-video w-full ${__O.hidden}`, rounded: "2xl", surface: "subtle", children: _jsx(Div, { className: "h-full w-full", children: _jsx(MediaImage, { src: cover, alt: bundle.name, size: "hero", fallback: PLACEHOLDER_EMOJI }) }) })) }), _jsxs(Stack, { gap: "md", className: "flex-1", children: [_jsx(Heading, { level: 1, size: "3xl", weight: "semibold", color: "primary", children: bundle.name }), _jsxs(Row, { gap: "sm", align: "center", children: [_jsx(Text, { size: "lg", weight: "bold", children: priceLabel }), _jsxs(Text, { size: "sm", color: "muted", children: ["\u00B7 ", BUNDLE_COPY.detail.itemCount(memberCount)] }), _jsx(Badge, { variant: BUNDLE_STOCK_VARIANT[stock], children: STOCK_BADGE_TEXT[stock] })] }), bundle.description && (_jsxs(Stack, { gap: "xs", children: [_jsx(Heading, { level: 2, className: "text-[var(--appkit-color-text-muted)]", size: "sm", weight: "semibold", children: BUNDLE_COPY.detailDescriptionHeading }), _jsx(Text, { className: "whitespace-pre-line", children: bundle.description })] })), onBuyNow ? (_jsx(BundleBuyNowCta, { bundleSlug: bundle.slug, outOfStock: stock === "out_of_stock", onBuyNow: onBuyNow })) : (_jsxs(Div, { textSize: "sm", className: "border-dashed", border: "strong", surface: "muted", rounded: "xl", padding: "md", "aria-live": "polite", children: [_jsx(Text, { weight: "semibold", className: "mb-1 block", children: BUNDLE_COPY.detail.ctaDisabled }), _jsx(Text, { size: "sm", color: "muted", children: BUNDLE_COPY.detail.ctaHint })] }))] })] }), _jsxs(Stack, { gap: "md", children: [_jsx(Heading, { level: 2, size: "xl", weight: "semibold", color: "primary", children: BUNDLE_COPY.detailItemsHeading }), members.length === 0 ? (_jsx(Text, { color: "muted", children: BUNDLE_COPY.detail.emptyMembers })) : (_jsx(Ul, { className: "grid grid-cols-1 sm:grid-cols-2 gap-2", children: members.map((p, i) => (_jsxs(Li, { className: "flex items-center gap-2 rounded-lg border border-zinc-100 dark:border-zinc-800 px-3 py-2 text-sm", children: [_jsxs(Span, { size: "xs", weight: "semibold", className: "w-5", color: "faint", children: ["#", i + 1] }), _jsx(Link, { href: String(ROUTES.PUBLIC.PRODUCT_DETAIL?.(p.slug ?? p.id) ?? "#"), className: "flex-1 truncate font-medium hover:underline hover:text-primary", children: p.title })] }, p.id))) }))] })] }) }) }) }));
|
|
30
26
|
}
|
|
@@ -29,9 +29,7 @@ function renderBundleSelectedChips(props) {
|
|
|
29
29
|
const { value, metadata, remove } = props;
|
|
30
30
|
if (value.length === 0)
|
|
31
31
|
return null;
|
|
32
|
-
return (
|
|
33
|
-
// audit-variant-ok: chips row — flex-wrap layout; Div.layout=flex doesn't auto-wrap
|
|
34
|
-
_jsx(Div, { layout: "flex", gap: "2", className: `flex-wrap ${__P.p3}`, rounded: "lg", surface: "muted", border: "default", children: value.map((id) => {
|
|
32
|
+
return (_jsx(Div, { layout: "flex", gap: "2", className: `flex-wrap ${__P.p3}`, rounded: "lg", surface: "muted", border: "default", children: value.map((id) => {
|
|
35
33
|
const meta = metadata[id];
|
|
36
34
|
const label = meta?.title ?? id;
|
|
37
35
|
return (_jsxs(Row, { textSize: "xs", gap: "xs", align: "center", paddingY: "y-2xs", border: "strong", padding: "x-sm", surface: "default", rounded: "full", children: [_jsx(Text, { size: "xs", className: "max-w-[200px] truncate", children: label }), _jsx(Button, { variant: "ghost", size: "sm", "aria-label": BUNDLE_COPY.picker.removeAria(label), onClick: () => remove(id), children: "\u00D7" })] }, id));
|
|
@@ -79,7 +77,6 @@ export function BundleItemsPicker({ value, onChange, fetchProducts, minItems = B
|
|
|
79
77
|
return next;
|
|
80
78
|
});
|
|
81
79
|
})
|
|
82
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
83
80
|
.catch((err) => {
|
|
84
81
|
if (cancelled)
|
|
85
82
|
return;
|
|
@@ -124,7 +121,6 @@ export async function defaultBundleItemsFetch(query) {
|
|
|
124
121
|
throw new Error(`Search failed: ${res.status}`);
|
|
125
122
|
}
|
|
126
123
|
const data = (await res.json());
|
|
127
|
-
// audit-unknown-ok: picker API response items
|
|
128
124
|
const rawItems = data?.data?.items ?? data?.items ?? [];
|
|
129
125
|
return rawItems
|
|
130
126
|
.map((r) => {
|
|
@@ -84,7 +84,6 @@ export function CategoriesIndexListing({ initialData: _, brandsOnly = false }) {
|
|
|
84
84
|
buildSieveParams: () => "",
|
|
85
85
|
buildSearchParams: () => "",
|
|
86
86
|
params: new URLSearchParams(),
|
|
87
|
-
// audit-unknown-ok: TS structural escape — table-state type
|
|
88
87
|
}), [pendingFilters]);
|
|
89
88
|
const openFilters = useCallback(() => {
|
|
90
89
|
setPendingFilters(Object.fromEntries(FILTER_KEYS.map((k) => [k, table.get(k)])));
|
|
@@ -47,7 +47,6 @@ export async function CategoriesIndexPageView({ searchParams = {} }) {
|
|
|
47
47
|
...(filters ? { filters } : {}),
|
|
48
48
|
})
|
|
49
49
|
.catch(() => null);
|
|
50
|
-
// audit-unknown-ok: TS structural escape — CategoryItem
|
|
51
50
|
const initialData = (result?.items ?? []);
|
|
52
51
|
return (_jsx(Main, { children: _jsx(Section, { padding: "y-2xl", children: _jsxs(Container, { size: "xl", children: [_jsx(Heading, { level: 1, className: "mb-8", color: "primary", size: "3xl", weight: "semibold", children: "Categories" }), _jsx(AdSlot, { id: "listing-sidebar-top", className: "mb-6" }), _jsx(CategoriesIndexListing, { initialData: initialData }), _jsx(AdSlot, { id: "listing-sidebar-bottom", className: "mt-8" })] }) }) }));
|
|
53
52
|
}
|
|
@@ -87,7 +87,5 @@ export function CategoryBundlesListing({ initialBundles, brandName, onBuyNow, })
|
|
|
87
87
|
return (_jsx(Div, { className: "border-dashed text-center", padding: "y-4xl", rounded: "2xl", border: "default", children: _jsxs(Text, { color: "muted", children: ["No bundles available", brandName ? ` for ${brandName}` : "", " yet."] }) }));
|
|
88
88
|
}
|
|
89
89
|
return (_jsxs(Div, { className: "min-h-[40vh]", children: [_jsx(ListingToolbar, { filterCount: filterActiveCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search bundles...", onSearchChange: setSearchInput, onSearchCommit: commitSearch, onSearchKeyDown: (e) => { if (e.key === "Enter")
|
|
90
|
-
commitSearch(); }, sortValue: sort, sortOptions: SORT_OPTIONS, onSortChange: (v) => { table.set(TABLE_KEYS.SORT, v); }, onResetAll: resetAll, hasActiveState: hasActiveState }), totalPages > 1 && (_jsx(Row, { border: "bottom", className: "sticky top-[calc(var(--header-height,0px)+44px)] z-10 backdrop-blur-sm", surface: "default", padding: "toolbar", justify: "center", children: _jsx(Pagination, { currentPage: safePage, totalPages: totalPages, onPageChange: (p) => table.setPage(p) }) })), _jsx(Div, { padding: "y-lg", children: pageItems.length === 0 ? (_jsxs(Text, { paddingY: "4xl", color: "muted", size: "sm", align: "center", children: ["No bundles match your search", brandName ? ` for ${brandName}` : "", "."] })) : (_jsx(Div, { layout: "grid", gap: "3", className: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3", children: pageItems.map((bundle) => (_jsxs(Stack, { children: [_jsx(MarketplaceBundleCard, { bundle: bundle }), onBuyNow && (
|
|
91
|
-
// audit-variant-ok: card footer CTA wrapper — explicit border-top reset + rounded-b-xl asymmetric corner; Div lacks asymmetric corner/border variants
|
|
92
|
-
_jsx(Div, { border: "default", surface: "default", className: "border-t border-zinc-100 pt-2 pb-3 -mt-px rounded-b-xl border-t-0 dark:border-zinc-800", padding: "x-sm", children: _jsx(BundleBuyNowCta, { bundleSlug: bundle.slug, outOfStock: bundle.bundleStockStatus === "out_of_stock", onBuyNow: onBuyNow, compact: true }) }))] }, bundle.id))) })) }), _jsx(FilterDrawer, { open: filterOpen, onOpen: openFilters, onClose: () => setFilterOpen(false), onApply: applyFilters, onReset: () => setPendingShowOutOfStock(false), activeCount: filterActiveCount, hideTrigger: true, children: _jsx(Stack, { className: `${__P.p4}`, gap: "md", children: _jsxs(Label, { layout: "flex", gap: "lg", className: "justify-between cursor-pointer", children: [_jsx(Span, { size: "sm", weight: "medium", color: "muted", children: "Show out-of-stock bundles" }), _jsx("button", { type: "button", role: "switch", "aria-checked": pendingShowOutOfStock, onClick: () => setPendingShowOutOfStock((v) => !v), className: `relative inline-flex h-5 w-9 flex-shrink-0 items-center rounded-full transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1 ${pendingShowOutOfStock ? "bg-primary" : "bg-zinc-300 dark:bg-slate-600"}`, children: _jsx(Span, { className: `inline-block h-3.5 w-3.5 transform shadow-sm transition-transform duration-200 ${pendingShowOutOfStock ? "translate-x-[19px]" : "translate-x-[3px]"}`, rounded: "full", surface: "default" }) })] }) }) })] }));
|
|
90
|
+
commitSearch(); }, sortValue: sort, sortOptions: SORT_OPTIONS, onSortChange: (v) => { table.set(TABLE_KEYS.SORT, v); }, onResetAll: resetAll, hasActiveState: hasActiveState }), totalPages > 1 && (_jsx(Row, { border: "bottom", className: "sticky top-[calc(var(--header-height,0px)+44px)] z-10 backdrop-blur-sm", surface: "default", padding: "toolbar", justify: "center", children: _jsx(Pagination, { currentPage: safePage, totalPages: totalPages, onPageChange: (p) => table.setPage(p) }) })), _jsx(Div, { padding: "y-lg", children: pageItems.length === 0 ? (_jsxs(Text, { paddingY: "4xl", color: "muted", size: "sm", align: "center", children: ["No bundles match your search", brandName ? ` for ${brandName}` : "", "."] })) : (_jsx(Div, { layout: "grid", gap: "3", className: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3", children: pageItems.map((bundle) => (_jsxs(Stack, { children: [_jsx(MarketplaceBundleCard, { bundle: bundle }), onBuyNow && (_jsx(Div, { border: "default", surface: "default", className: "border-t border-zinc-100 pt-2 pb-3 -mt-px rounded-b-xl border-t-0 dark:border-zinc-800", padding: "x-sm", children: _jsx(BundleBuyNowCta, { bundleSlug: bundle.slug, outOfStock: bundle.bundleStockStatus === "out_of_stock", onBuyNow: onBuyNow, compact: true }) }))] }, bundle.id))) })) }), _jsx(FilterDrawer, { open: filterOpen, onOpen: openFilters, onClose: () => setFilterOpen(false), onApply: applyFilters, onReset: () => setPendingShowOutOfStock(false), activeCount: filterActiveCount, hideTrigger: true, children: _jsx(Stack, { className: `${__P.p4}`, gap: "md", children: _jsxs(Label, { layout: "flex", gap: "lg", className: "justify-between cursor-pointer", children: [_jsx(Span, { size: "sm", weight: "medium", color: "muted", children: "Show out-of-stock bundles" }), _jsx("button", { type: "button", role: "switch", "aria-checked": pendingShowOutOfStock, onClick: () => setPendingShowOutOfStock((v) => !v), className: `relative inline-flex h-5 w-9 flex-shrink-0 items-center rounded-full transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1 ${pendingShowOutOfStock ? "bg-primary" : "bg-zinc-300 dark:bg-slate-600"}`, children: _jsx(Span, { className: `inline-block h-3.5 w-3.5 transform shadow-sm transition-transform duration-200 ${pendingShowOutOfStock ? "translate-x-[19px]" : "translate-x-[3px]"}`, rounded: "full", surface: "default" }) })] }) }) })] }));
|
|
93
91
|
}
|