@mohasinac/appkit 3.0.0 → 3.0.1
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 +1 -2
- 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.js +0 -1
- 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 +81 -0
|
@@ -101,7 +101,6 @@ export async function CategoryDetailPageView({ slug }) {
|
|
|
101
101
|
itemsSold: s.stats?.itemsSold,
|
|
102
102
|
totalReviews: s.stats?.totalReviews,
|
|
103
103
|
averageRating: s.stats?.averageRating,
|
|
104
|
-
// audit-unknown-ok: TS structural escape — primitive cast
|
|
105
104
|
createdAt: s.createdAt,
|
|
106
105
|
}));
|
|
107
106
|
const productCount = productsResult?.total ?? category?.metrics?.productCount ?? 0;
|
|
@@ -113,21 +112,7 @@ export async function CategoryDetailPageView({ slug }) {
|
|
|
113
112
|
const totalCount = productCount + auctionCount + preOrderCount + prizeDrawCount + bundleCount + storeCount;
|
|
114
113
|
const coverImage = category?.display?.coverImage;
|
|
115
114
|
const hasCover = Boolean(coverImage);
|
|
116
|
-
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",
|
|
117
|
-
// audit-inline-style-ok: dynamic image URL
|
|
118
|
-
style: { backgroundImage: `url(${coverImage})` } }), _jsx(Div, { surface: "overlay-md", className: "absolute inset-0" })] })), _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.CATEGORIES), className: hasCover ? "text-white/70 hover:text-white transition-colors" : "text-zinc-500 dark:text-zinc-400 hover:text-primary-600 transition-colors", children: "Categories" }), _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: category?.name ?? slug })] }), _jsx(Heading, { color: "inverse", level: 1, className: `mb-2 ${hasCover ? "" : "text-zinc-900 dark:text-zinc-50"}`, size: "3xl", mdSize: "4xl", weight: "bold", children: category?.name ?? slug }), category?.description && typeof category.description === "string" && !category.description.startsWith("{") && (
|
|
119
|
-
// audit-variant-ok: category description — conditional muted-zinc fallback when no cover; inverse default keeps over-image legibility
|
|
120
|
-
_jsx(Text, { color: "inverse", className: `max-w-2xl mb-4 ${hasCover ? "/80" : "text-zinc-600 dark:text-zinc-400"}`, size: "base", children: category.description })), _jsxs(Row, { wrap: true, gap: "sm", children: [productCount > 0 && (
|
|
121
|
-
// audit-variant-ok: count chip — conditional translucent-white (cover) OR tinted primary (no cover); no white-overlay surface variant
|
|
122
|
-
_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: [productCount.toLocaleString(), " ", productCount === 1 ? "product" : "products"] })), auctionCount > 0 && (
|
|
123
|
-
// audit-variant-ok: count chip — conditional translucent-white (cover) OR warning surface (no cover); compound bg cannot use Span.surface
|
|
124
|
-
_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: [auctionCount.toLocaleString(), " ", auctionCount === 1 ? "auction" : "auctions"] })), preOrderCount > 0 && (
|
|
125
|
-
// audit-variant-ok: count chip — conditional translucent-white (cover) OR info surface (no cover); compound bg cannot use Span.surface
|
|
126
|
-
_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: [preOrderCount.toLocaleString(), " ", preOrderCount === 1 ? "pre-order" : "pre-orders"] })), storeCount > 0 && (
|
|
127
|
-
// audit-variant-ok: count chip — conditional translucent-white (cover) OR success surface (no cover); compound bg cannot use Span.surface
|
|
128
|
-
_jsxs(Span, { layout: "inline-flex", gap: "xs", color: "inverse", size: "xs", weight: "medium", className: `${hasCover ? "bg-white/20 backdrop-blur-sm" : "bg-success-surface text-success dark:bg-success-surface dark:text-success"}`, rounded: "full", padding: "pill-sm-tall", children: [storeCount.toLocaleString(), " ", storeCount === 1 ? "store" : "stores"] }))] })] })] }), childCategories.length > 0 && (_jsx(Section, { border: "subtle", surface: "default", className: "border-b", children: _jsx(Div, { className: "max-w-7xl mx-auto", padding: "inline", children: _jsx(Div, { layout: "flex", gap: "2", className: `.5 ${__O.xAuto}`, padding: "b-2xs",
|
|
129
|
-
// audit-inline-style-ok: dynamic CSS
|
|
130
|
-
style: { scrollbarWidth: "none" }, children: childCategories.map((child) => (_jsxs(Link, { href: String(ROUTES.PUBLIC.CATEGORY_DETAIL(child.slug)), className: "flex-shrink-0 flex items-center gap-1.5 rounded-full border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 px-4 py-1.5 text-sm font-medium text-zinc-700 dark:text-zinc-200 hover:border-primary hover:text-primary transition-colors whitespace-nowrap", children: [child.display?.icon && (_jsx(Span, { className: "leading-none", children: child.display.icon })), child.name, (child.metrics?.productCount ?? 0) > 0 && (_jsx(Span, { size: "xs", color: "muted", children: (child.metrics?.productCount ?? 0).toLocaleString() }))] }, child.id))) }) }) })), _jsx(Section, { padding: "y-lg", children: _jsx(Container, { size: "xl", children: _jsx(CategoryDetailTabs, { categorySlug: slug, categoryId: category?.id, initialProductsData: productsResult ?? undefined, initialBundles: bundlesResult ?? [], initialStores: categoryStores, counts: {
|
|
115
|
+
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" })] })), _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.CATEGORIES), className: hasCover ? "text-white/70 hover:text-white transition-colors" : "text-zinc-500 dark:text-zinc-400 hover:text-primary-600 transition-colors", children: "Categories" }), _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: category?.name ?? slug })] }), _jsx(Heading, { color: "inverse", level: 1, className: `mb-2 ${hasCover ? "" : "text-zinc-900 dark:text-zinc-50"}`, size: "3xl", mdSize: "4xl", weight: "bold", children: category?.name ?? slug }), category?.description && typeof category.description === "string" && !category.description.startsWith("{") && (_jsx(Text, { color: "inverse", className: `max-w-2xl mb-4 ${hasCover ? "/80" : "text-zinc-600 dark:text-zinc-400"}`, size: "base", children: category.description })), _jsxs(Row, { wrap: true, gap: "sm", children: [productCount > 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: [productCount.toLocaleString(), " ", productCount === 1 ? "product" : "products"] })), auctionCount > 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: [auctionCount.toLocaleString(), " ", auctionCount === 1 ? "auction" : "auctions"] })), preOrderCount > 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: [preOrderCount.toLocaleString(), " ", preOrderCount === 1 ? "pre-order" : "pre-orders"] })), storeCount > 0 && (_jsxs(Span, { layout: "inline-flex", gap: "xs", color: "inverse", size: "xs", weight: "medium", className: `${hasCover ? "bg-white/20 backdrop-blur-sm" : "bg-success-surface text-success dark:bg-success-surface dark:text-success"}`, rounded: "full", padding: "pill-sm-tall", children: [storeCount.toLocaleString(), " ", storeCount === 1 ? "store" : "stores"] }))] })] })] }), childCategories.length > 0 && (_jsx(Section, { border: "subtle", surface: "default", className: "border-b", children: _jsx(Div, { className: "max-w-7xl mx-auto", padding: "inline", children: _jsx(Div, { layout: "flex", gap: "2", className: `.5 ${__O.xAuto}`, padding: "b-2xs", style: { scrollbarWidth: "none" }, children: childCategories.map((child) => (_jsxs(Link, { href: String(ROUTES.PUBLIC.CATEGORY_DETAIL(child.slug)), className: "flex-shrink-0 flex items-center gap-1.5 rounded-full border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 px-4 py-1.5 text-sm font-medium text-zinc-700 dark:text-zinc-200 hover:border-primary hover:text-primary transition-colors whitespace-nowrap", children: [child.display?.icon && (_jsx(Span, { className: "leading-none", children: child.display.icon })), child.name, (child.metrics?.productCount ?? 0) > 0 && (_jsx(Span, { size: "xs", color: "muted", children: (child.metrics?.productCount ?? 0).toLocaleString() }))] }, child.id))) }) }) })), _jsx(Section, { padding: "y-lg", children: _jsx(Container, { size: "xl", children: _jsx(CategoryDetailTabs, { categorySlug: slug, categoryId: category?.id, initialProductsData: productsResult ?? undefined, initialBundles: bundlesResult ?? [], initialStores: categoryStores, counts: {
|
|
131
116
|
products: productCount,
|
|
132
117
|
auctions: auctionCount,
|
|
133
118
|
preOrders: preOrderCount,
|
|
@@ -11,11 +11,7 @@ const __O = {
|
|
|
11
11
|
const CLS_FEATURED_DOT = "absolute left-2 top-2 rounded-full bg-warning-surface p-1 leading-none";
|
|
12
12
|
export function CategoryCard({ category, href, onClick, className = "", }) {
|
|
13
13
|
const productCount = category.metrics?.productCount ?? category.productCount ?? 0;
|
|
14
|
-
const inner = (_jsxs(Stack, { className: "h-full", children: [_jsxs(Div, { surface: "muted", className: `relative aspect-[4/3] w-full ${__O.hidden} flex-shrink-0`, children: [category.display?.coverImage ? (_jsx(Div, { role: "img", "aria-label": category.name, className: "h-full w-full bg-center bg-cover transition-transform duration-300 group-hover:scale-105",
|
|
15
|
-
// audit-inline-style-ok: dynamic image URL
|
|
16
|
-
style: { backgroundImage: `url(${category.display.coverImage})` } })) : category.display?.color ? (_jsx(Div, { className: "h-full w-full opacity-80",
|
|
17
|
-
// audit-inline-style-ok: runtime theme color
|
|
18
|
-
style: { backgroundColor: category.display.color } })) : null, category.display?.icon && (_jsx(Row, { textSize: "4xl", className: "absolute inset-0", align: "center", justify: "center", children: category.display.icon })), category.isFeatured && (_jsx(Span, { size: "xs", className: CLS_FEATURED_DOT, children: "\u2605" }))] }), _jsxs(Stack, { className: `flex-1 ${__P.p3}.5`, children: [_jsx(Text, { color: "inverse", className: `leading-snug text-neutral-900 dark:text-neutral-100 dark:`, truncate: 2, size: "sm", weight: "semibold", children: category.name }), category.description && (_jsx(Text, { className: `mt-1 flex-1`, color: "muted", truncate: 2, size: "xs", children: category.description })), _jsxs(Row, { className: "mt-2", align: "center", justify: "between", gap: "sm", children: [_jsxs(Text, { size: "xs", color: "faint", children: [productCount.toLocaleString(), " ", productCount === 1 ? "item" : "items"] }), _jsxs(Span, { layout: "inline-flex", gap: "xs", size: "xs", weight: "medium", border: "default", className: "group-hover:bg-primary group-hover:border-primary group-hover:text-white transition-colors", rounded: "md", padding: "pill-sm-tall", color: "muted", children: ["Browse ", _jsx(ArrowRight, { className: "h-3 w-3" })] })] })] })] }));
|
|
14
|
+
const inner = (_jsxs(Stack, { className: "h-full", children: [_jsxs(Div, { surface: "muted", className: `relative aspect-[4/3] w-full ${__O.hidden} flex-shrink-0`, children: [category.display?.coverImage ? (_jsx(Div, { role: "img", "aria-label": category.name, className: "h-full w-full bg-center bg-cover transition-transform duration-300 group-hover:scale-105", style: { backgroundImage: `url(${category.display.coverImage})` } })) : category.display?.color ? (_jsx(Div, { className: "h-full w-full opacity-80", style: { backgroundColor: category.display.color } })) : null, category.display?.icon && (_jsx(Row, { textSize: "4xl", className: "absolute inset-0", align: "center", justify: "center", children: category.display.icon })), category.isFeatured && (_jsx(Span, { size: "xs", className: CLS_FEATURED_DOT, children: "\u2605" }))] }), _jsxs(Stack, { className: `flex-1 ${__P.p3}.5`, children: [_jsx(Text, { color: "inverse", className: `leading-snug text-neutral-900 dark:text-neutral-100 dark:`, truncate: 2, size: "sm", weight: "semibold", children: category.name }), category.description && (_jsx(Text, { className: `mt-1 flex-1`, color: "muted", truncate: 2, size: "xs", children: category.description })), _jsxs(Row, { className: "mt-2", align: "center", justify: "between", gap: "sm", children: [_jsxs(Text, { size: "xs", color: "faint", children: [productCount.toLocaleString(), " ", productCount === 1 ? "item" : "items"] }), _jsxs(Span, { layout: "inline-flex", gap: "xs", size: "xs", weight: "medium", border: "default", className: "group-hover:bg-primary group-hover:border-primary group-hover:text-white transition-colors", rounded: "md", padding: "pill-sm-tall", color: "muted", children: ["Browse ", _jsx(ArrowRight, { className: "h-3 w-3" })] })] })] })] }));
|
|
19
15
|
const cardClass = `group relative flex flex-col overflow-hidden rounded-xl border border-neutral-200 bg-white dark:border-zinc-700 dark:bg-zinc-900 shadow-sm transition hover:shadow-md h-full ${className}`;
|
|
20
16
|
if (href) {
|
|
21
17
|
return (_jsx(Link, { href: href, className: cardClass, children: inner }));
|
|
@@ -39,7 +39,6 @@ export function CategorySelectorCreate({ value, onChange, disabled = false, labe
|
|
|
39
39
|
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
40
40
|
const L = { ...DEFAULT_LABELS, ...labels };
|
|
41
41
|
const { categories: rawCategories, isLoading, refetch } = useCategories();
|
|
42
|
-
// audit-unknown-ok: TS structural escape — Category
|
|
43
42
|
const categories = rawCategories;
|
|
44
43
|
const flat = flattenCategories(categories);
|
|
45
44
|
const handleSuccess = useCallback((newId) => {
|
|
@@ -22,17 +22,13 @@ export function getCategoryTableColumns(onEdit, onDelete, labels = {}) {
|
|
|
22
22
|
{
|
|
23
23
|
key: "image",
|
|
24
24
|
header: "",
|
|
25
|
-
render: (cat) => (_jsx(Div, { className: `relative w-9 h-9 ${__O.hidden} flex-shrink-0`, rounded: "default", children: cat.display?.coverImage ? (_jsx(MediaImage, { src: cat.display.coverImage, alt: "", size: "thumbnail", className: "w-full h-full object-cover" })) : (_jsx(Row, { textSize: "base", className: "w-full h-full", align: "center", justify: "center",
|
|
26
|
-
// audit-inline-style-ok: runtime theme color
|
|
27
|
-
style: { backgroundColor: cat.display?.color ?? "var(--appkit-color-text-faint)", color: "var(--appkit-color-text-on-primary)" }, children: cat.display?.icon ?? "🗂️" })) })),
|
|
25
|
+
render: (cat) => (_jsx(Div, { className: `relative w-9 h-9 ${__O.hidden} flex-shrink-0`, rounded: "default", children: cat.display?.coverImage ? (_jsx(MediaImage, { src: cat.display.coverImage, alt: "", size: "thumbnail", className: "w-full h-full object-cover" })) : (_jsx(Row, { textSize: "base", className: "w-full h-full", align: "center", justify: "center", style: { backgroundColor: cat.display?.color ?? "var(--appkit-color-text-faint)", color: "var(--appkit-color-text-on-primary)" }, children: cat.display?.icon ?? "🗂️" })) })),
|
|
28
26
|
},
|
|
29
27
|
{
|
|
30
28
|
key: "name",
|
|
31
29
|
header: L.colName,
|
|
32
30
|
sortable: true,
|
|
33
|
-
render: (cat) => (
|
|
34
|
-
// audit-inline-style-ok: computed pixel offset
|
|
35
|
-
_jsxs(Div, { style: { paddingLeft: `${cat.tier * 20}px` }, children: [cat.name, cat.tier > 0 && (_jsxs(Span, { size: "xs", className: "ml-2", color: "faint", children: ["(Tier ", cat.tier, ")"] }))] })),
|
|
31
|
+
render: (cat) => (_jsxs(Div, { style: { paddingLeft: `${cat.tier * 20}px` }, children: [cat.name, cat.tier > 0 && (_jsxs(Span, { size: "xs", className: "ml-2", color: "faint", children: ["(Tier ", cat.tier, ")"] }))] })),
|
|
36
32
|
},
|
|
37
33
|
{
|
|
38
34
|
key: "slug",
|
|
@@ -19,9 +19,7 @@ function CategoryTreeNode({ item, children = [], activeId, onSelect, depth = 0,
|
|
|
19
19
|
if (hasChildren)
|
|
20
20
|
setExpanded((p) => !p);
|
|
21
21
|
onSelect?.(item);
|
|
22
|
-
}, className: `cursor-pointer py-1.5 transition select-none ${isActive ? "bg-primary-50 text-primary-700 dark:bg-primary-900/30 dark:text-primary-400" : "text-neutral-700 hover:bg-neutral-50 dark:text-zinc-300 dark:hover:bg-zinc-800"}`, align: "center", gap: "xs", padding: "x-xs", rounded: "md",
|
|
23
|
-
// audit-inline-style-ok: computed pixel offset
|
|
24
|
-
style: { paddingLeft: `${8 + indent}px` }, children: [hasChildren && (_jsx(Span, { size: "xs", "aria-hidden": "true", className: `transition-transform duration-150 ${expanded ? "rotate-90" : ""}`, color: "faint", children: "\u25B6" })), !hasChildren && _jsx(Span, { className: "w-3" }), item.display?.icon && (_jsx(Span, { size: "base", "aria-hidden": "true", className: "flex-shrink-0", children: item.display.icon })), _jsx(Text, { className: "flex-1 truncate", children: item.name }), item.metrics && (_jsx(Span, { size: "xs", className: "ml-auto flex-shrink-0 tabular-nums", color: "faint", children: item.metrics.productCount }))] }), hasChildren && expanded && (_jsx(Div, { role: "group", children: children.map((child) => (_jsx(CategoryTreeNode, { item: child, activeId: activeId, onSelect: onSelect, depth: depth + 1 }, child.id))) }))] }));
|
|
22
|
+
}, className: `cursor-pointer py-1.5 transition select-none ${isActive ? "bg-primary-50 text-primary-700 dark:bg-primary-900/30 dark:text-primary-400" : "text-neutral-700 hover:bg-neutral-50 dark:text-zinc-300 dark:hover:bg-zinc-800"}`, align: "center", gap: "xs", padding: "x-xs", rounded: "md", style: { paddingLeft: `${8 + indent}px` }, children: [hasChildren && (_jsx(Span, { size: "xs", "aria-hidden": "true", className: `transition-transform duration-150 ${expanded ? "rotate-90" : ""}`, color: "faint", children: "\u25B6" })), !hasChildren && _jsx(Span, { className: "w-3" }), item.display?.icon && (_jsx(Span, { size: "base", "aria-hidden": "true", className: "flex-shrink-0", children: item.display.icon })), _jsx(Text, { className: "flex-1 truncate", children: item.name }), item.metrics && (_jsx(Span, { size: "xs", className: "ml-auto flex-shrink-0 tabular-nums", color: "faint", children: item.metrics.productCount }))] }), hasChildren && expanded && (_jsx(Div, { role: "group", children: children.map((child) => (_jsx(CategoryTreeNode, { item: child, activeId: activeId, onSelect: onSelect, depth: depth + 1 }, child.id))) }))] }));
|
|
25
23
|
}
|
|
26
24
|
/**
|
|
27
25
|
* CategoryTree — hierarchical expandable navigation for categories.
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button, Div, Heading, Text } from "../../../ui";
|
|
3
3
|
export function ConcernCard({ concern, onClick, className = "", }) {
|
|
4
|
-
return (_jsxs(Button, { type: "button", variant: "outline", onClick: () => onClick?.(concern), className: `group flex flex-col items-center gap-3 rounded-xl border border-neutral-200 dark:border-slate-700 bg-white dark:bg-slate-900 p-4 text-center shadow-sm transition hover:border-primary dark:hover:border-primary-400 hover:shadow-md ${className}`, children: [concern.display?.coverImage && (_jsx(Div, { role: "img", "aria-label": concern.name, className: "h-16 w-16 bg-center bg-cover", rounded: "full",
|
|
5
|
-
// audit-inline-style-ok: dynamic image URL
|
|
6
|
-
style: { backgroundImage: `url(${concern.display.coverImage})` } })), _jsxs(Div, { children: [_jsx(Heading, { level: 3, className: "text-neutral-900 dark:text-neutral-100 group-hover:text-primary dark:group-hover:text-primary-400", size: "sm", weight: "semibold", children: concern.name }), concern.description && (_jsx(Text, { className: `mt-1`, color: "muted", truncate: 2, size: "xs", children: concern.description }))] })] }));
|
|
4
|
+
return (_jsxs(Button, { type: "button", variant: "outline", onClick: () => onClick?.(concern), className: `group flex flex-col items-center gap-3 rounded-xl border border-neutral-200 dark:border-slate-700 bg-white dark:bg-slate-900 p-4 text-center shadow-sm transition hover:border-primary dark:hover:border-primary-400 hover:shadow-md ${className}`, children: [concern.display?.coverImage && (_jsx(Div, { role: "img", "aria-label": concern.name, className: "h-16 w-16 bg-center bg-cover", rounded: "full", style: { backgroundImage: `url(${concern.display.coverImage})` } })), _jsxs(Div, { children: [_jsx(Heading, { level: 3, className: "text-neutral-900 dark:text-neutral-100 group-hover:text-primary dark:group-hover:text-primary-400", size: "sm", weight: "semibold", children: concern.name }), concern.description && (_jsx(Text, { className: `mt-1`, color: "muted", truncate: 2, size: "xs", children: concern.description }))] })] }));
|
|
7
5
|
}
|
|
@@ -3,11 +3,7 @@ import { Div, Heading, Text, TextLink } from "../../../ui";
|
|
|
3
3
|
import { LAYOUT } from "../../../tokens";
|
|
4
4
|
const CLS_PLACEHOLDER = "w-full";
|
|
5
5
|
export function CollectionCard({ collection, href }) {
|
|
6
|
-
return (
|
|
7
|
-
// audit-variant-ok: collection card TextLink — bg-gray-100 placeholder + hover:shadow-lg card composition
|
|
8
|
-
_jsxs(TextLink, { rounded: "xl", href: href, className: "group relative block overflow-hidden bg-gray-100 dark:bg-slate-800 transition-shadow hover:shadow-lg", children: [collection.image ? (_jsx(Div, { role: "img", "aria-label": collection.title, className: `${LAYOUT.cardHeight.md} w-full bg-cover bg-center transition-transform duration-300 group-hover:scale-105`,
|
|
9
|
-
// audit-inline-style-ok: dynamic image URL
|
|
10
|
-
style: { backgroundImage: `url(${collection.image})` } })) : (_jsx(Div, { surface: "muted", className: `${LAYOUT.cardHeight.md} ${CLS_PLACEHOLDER}` })), _jsxs(Div, { surface: "default", padding: "sm", children: [_jsx(Heading, { level: 3, className: "text-gray-900", weight: "semibold", children: collection.title }), collection.subtitle && (_jsx(Text, { className: "mt-1 text-gray-500", size: "sm", children: collection.subtitle })), collection.productCount !== undefined && (_jsxs(Text, { className: "mt-2 text-gray-400", size: "xs", children: [collection.productCount, " ", collection.productCount === 1 ? "item" : "items"] }))] })] }));
|
|
6
|
+
return (_jsxs(TextLink, { rounded: "xl", href: href, className: "group relative block overflow-hidden bg-gray-100 dark:bg-slate-800 transition-shadow hover:shadow-lg", children: [collection.image ? (_jsx(Div, { role: "img", "aria-label": collection.title, className: `${LAYOUT.cardHeight.md} w-full bg-cover bg-center transition-transform duration-300 group-hover:scale-105`, style: { backgroundImage: `url(${collection.image})` } })) : (_jsx(Div, { surface: "muted", className: `${LAYOUT.cardHeight.md} ${CLS_PLACEHOLDER}` })), _jsxs(Div, { surface: "default", padding: "sm", children: [_jsx(Heading, { level: 3, className: "text-gray-900", weight: "semibold", children: collection.title }), collection.subtitle && (_jsx(Text, { className: "mt-1 text-gray-500", size: "sm", children: collection.subtitle })), collection.productCount !== undefined && (_jsxs(Text, { className: "mt-2 text-gray-400", size: "xs", children: [collection.productCount, " ", collection.productCount === 1 ? "item" : "items"] }))] })] }));
|
|
11
7
|
}
|
|
12
8
|
export function CollectionGrid({ collections, getHref }) {
|
|
13
9
|
return (_jsx(Div, { layout: "grid", gap: "6", className: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3", children: collections.map((c) => (_jsx(CollectionCard, { collection: c, href: getHref(c.slug) }, c.slug))) }));
|
|
@@ -30,7 +30,6 @@ export async function createEvent(adminId, input) {
|
|
|
30
30
|
winnerImages: finalizedWinnerImages,
|
|
31
31
|
additionalImages: finalizedAdditionalImages,
|
|
32
32
|
createdBy: adminId,
|
|
33
|
-
// audit-unknown-ok: TS structural escape — EventCreateInput
|
|
34
33
|
});
|
|
35
34
|
serverLogger.info("createEvent", { adminId, eventId: event.id });
|
|
36
35
|
return event;
|
|
@@ -59,7 +59,6 @@ export async function GET(_request, context) {
|
|
|
59
59
|
}));
|
|
60
60
|
}
|
|
61
61
|
// For survey events with leaderboard: top-10 approved entries, PII stripped
|
|
62
|
-
// audit-unknown-ok: event leaderboard cache items
|
|
63
62
|
let leaderboard = [];
|
|
64
63
|
if (event.type === "survey" && event.surveyConfig?.hasLeaderboard) {
|
|
65
64
|
const leaderboardResult = await entriesRepo.findAll({
|
|
@@ -53,7 +53,7 @@ const FORM_FIELD_TYPE_OPTIONS = [
|
|
|
53
53
|
{ label: "Checkbox", value: "checkbox" },
|
|
54
54
|
{ label: "Radio", value: "radio" },
|
|
55
55
|
{ label: "Date", value: "date" },
|
|
56
|
-
{ label: "Rating (1–5)", value: "rating" },
|
|
56
|
+
{ label: "Rating (1–5)", value: "rating" },
|
|
57
57
|
{ label: "File upload", value: "file" },
|
|
58
58
|
];
|
|
59
59
|
const FIELD_TYPES_WITH_OPTIONS = ["select", "multiselect", "radio", "checkbox"];
|
|
@@ -171,7 +171,6 @@ function buildEventRaffleFields(draft) {
|
|
|
171
171
|
if (draft.rafflePrizeProductIds.length > 0)
|
|
172
172
|
fields.rafflePrizeProductIds = draft.rafflePrizeProductIds;
|
|
173
173
|
if (draft.raffleType === "spin_wheel" || draft.type === "spin_wheel") {
|
|
174
|
-
// audit-unknown-ok: TS structural escape — JsonObjectWithUndefined
|
|
175
174
|
fields.spinPrizes = draft.spinPrizes;
|
|
176
175
|
if (Number(draft.spinMaxPerUser) > 0)
|
|
177
176
|
fields.spinMaxPerUser = Number(draft.spinMaxPerUser);
|
|
@@ -31,12 +31,6 @@ export function EventCard({ event, labels = {}, onParticipate, className = "", s
|
|
|
31
31
|
const msLeft = endsAt.getTime() - now.getTime();
|
|
32
32
|
const daysLeft = Math.max(0, Math.ceil(msLeft / (1000 * 60 * 60 * 24)));
|
|
33
33
|
const detailHref = String(ROUTES.PUBLIC.EVENT_DETAIL(event.slug ?? event.id));
|
|
34
|
-
return (
|
|
35
|
-
|
|
36
|
-
_jsxs(Article, { border: "default", className: `group relative flex h-full ${LAYOUT.cardHeight.event} flex-col overflow-hidden rounded-xl bg-white shadow-sm transition-shadow hover:shadow-md dark:bg-slate-900 ${isSelected ? "border-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(event.id, !isSelected); }, label: isSelected ? "Deselect event" : "Select event", position: "top-2 left-2", className: selectable || isSelected ? "opacity-100" : "opacity-0 group-hover:opacity-100 transition-opacity" })), _jsx(Link, { href: detailHref, className: "block flex-shrink-0", children: event.coverImageUrl ? (_jsx(Div, { className: `aspect-video ${__O.hidden}`, children: _jsx(Div, { role: "img", "aria-label": safeTitle, className: "h-full w-full bg-cover bg-center transition-transform duration-300 group-hover:scale-105",
|
|
37
|
-
// audit-inline-style-ok: dynamic image URL
|
|
38
|
-
style: { backgroundImage: `url(${event.coverImageUrl})` } }) })) : (_jsx(Row, { surface: "muted", className: "aspect-video", align: "center", justify: "center", children: _jsx(Span, { className: "opacity-40", size: "5xl", "aria-hidden": "true", children: TYPE_ICONS[event.type] }) })) }), _jsxs(Stack, { className: `flex-1 ${__P.p4}`, children: [_jsxs(Row, { className: "mb-2", align: "start", justify: "between", gap: "sm", children: [_jsx(Span, { size: "lg", "aria-hidden": "true", children: TYPE_ICONS[event.type] }), _jsx(EventStatusBadge, { status: event.status })] }), _jsx(Link, { href: detailHref, className: "block", children: _jsx(Heading, { level: 3, className: "text-gray-900 leading-snug mb-1 group-hover:text-primary transition-colors", size: "base", weight: "semibold", children: safeTitle }) }), _jsx(RichText, { html: normalizeRichTextHtml(event.description ?? ""), proseClass: "prose prose-sm max-w-none dark:prose-invert prose-p:my-0", className: "mb-3 line-clamp-3 text-sm text-zinc-600 dark:text-zinc-400" }), _jsxs(Row, { color: "muted", textSize: "xs", className: "mb-3 mt-auto", align: "center", justify: "between", children: [event.status === EVENT_FIELDS.STATUS_VALUES.ACTIVE &&
|
|
39
|
-
daysLeft > 0 && _jsxs(Span, { children: ["\u23F1 ", daysLeft, "d remaining"] }), _jsxs(Span, { children: ["\uD83D\uDC65 ", event.stats.totalEntries, " ", labels.entries ?? "entries"] })] }), event.status === EVENT_FIELDS.STATUS_VALUES.ACTIVE && onParticipate ? (_jsx(Button, { rounded: "lg", type: "button", onClick: () => onParticipate(event), className: "w-full bg-primary py-2 text-sm font-medium text-white transition-colors hover:bg-primary-600", children: labels.participate ?? "Participate" })) : (
|
|
40
|
-
// audit-variant-ok: details TextLink — border+hover bg-zinc-100 transition + inline-flex full-width centered CTA
|
|
41
|
-
_jsxs(TextLink, { rounded: "lg", paddingX: "sm", paddingY: "xs", href: detailHref, className: "inline-flex w-full items-center justify-center gap-1.5 border border-zinc-300 transition-colors hover:bg-zinc-100 dark:border-slate-600 dark:hover:bg-slate-800", color: "primary", size: "sm", weight: "medium", children: [labels.viewDetails ?? "View details", " \u2192"] }))] })] }));
|
|
34
|
+
return (_jsxs(Article, { border: "default", className: `group relative flex h-full ${LAYOUT.cardHeight.event} flex-col overflow-hidden rounded-xl bg-white shadow-sm transition-shadow hover:shadow-md dark:bg-slate-900 ${isSelected ? "border-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(event.id, !isSelected); }, label: isSelected ? "Deselect event" : "Select event", position: "top-2 left-2", className: selectable || isSelected ? "opacity-100" : "opacity-0 group-hover:opacity-100 transition-opacity" })), _jsx(Link, { href: detailHref, className: "block flex-shrink-0", children: event.coverImageUrl ? (_jsx(Div, { className: `aspect-video ${__O.hidden}`, children: _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(${event.coverImageUrl})` } }) })) : (_jsx(Row, { surface: "muted", className: "aspect-video", align: "center", justify: "center", children: _jsx(Span, { className: "opacity-40", size: "5xl", "aria-hidden": "true", children: TYPE_ICONS[event.type] }) })) }), _jsxs(Stack, { className: `flex-1 ${__P.p4}`, children: [_jsxs(Row, { className: "mb-2", align: "start", justify: "between", gap: "sm", children: [_jsx(Span, { size: "lg", "aria-hidden": "true", children: TYPE_ICONS[event.type] }), _jsx(EventStatusBadge, { status: event.status })] }), _jsx(Link, { href: detailHref, className: "block", children: _jsx(Heading, { level: 3, className: "text-gray-900 leading-snug mb-1 group-hover:text-primary transition-colors", size: "base", weight: "semibold", children: safeTitle }) }), _jsx(RichText, { html: normalizeRichTextHtml(event.description ?? ""), proseClass: "prose prose-sm max-w-none dark:prose-invert prose-p:my-0", className: "mb-3 line-clamp-3 text-sm text-zinc-600 dark:text-zinc-400" }), _jsxs(Row, { color: "muted", textSize: "xs", className: "mb-3 mt-auto", align: "center", justify: "between", children: [event.status === EVENT_FIELDS.STATUS_VALUES.ACTIVE &&
|
|
35
|
+
daysLeft > 0 && _jsxs(Span, { children: ["\u23F1 ", daysLeft, "d remaining"] }), _jsxs(Span, { children: ["\uD83D\uDC65 ", event.stats.totalEntries, " ", labels.entries ?? "entries"] })] }), event.status === EVENT_FIELDS.STATUS_VALUES.ACTIVE && onParticipate ? (_jsx(Button, { rounded: "lg", type: "button", onClick: () => onParticipate(event), className: "w-full bg-primary py-2 text-sm font-medium text-white transition-colors hover:bg-primary-600", children: labels.participate ?? "Participate" })) : (_jsxs(TextLink, { rounded: "lg", paddingX: "sm", paddingY: "xs", href: detailHref, className: "inline-flex w-full items-center justify-center gap-1.5 border border-zinc-300 transition-colors hover:bg-zinc-100 dark:border-slate-600 dark:hover:bg-slate-800", color: "primary", size: "sm", weight: "medium", children: [labels.viewDetails ?? "View details", " \u2192"] }))] })] }));
|
|
42
36
|
}
|
|
@@ -38,7 +38,5 @@ export function EventRaffleEntryForm({ eventId: _eventId, prizeLabel, raffleType
|
|
|
38
38
|
: raffleType === "top_n_participants"
|
|
39
39
|
? `Earliest ${topN ?? "N"} entries qualify.`
|
|
40
40
|
: "Spin the wheel to claim your prize.";
|
|
41
|
-
return (_jsxs(Stack, { className: `${__P.p6}`, gap: "md", rounded: "2xl", border: "default", children: [prizeLabel ? (_jsxs(Stack, { gap: "xs", children: [_jsx(Badge, { variant: "warning", children: "Prize" }), _jsx(Heading, { level: 2, weight: "bold", size: "2xl", children: prizeLabel })] })) : null, _jsx(Text, { size: "sm", color: "muted", children: eligibilityCopy }), submitted ? (_jsx(Div, { textSize: "sm", color: "success", surface: "success-surface", padding: "inline", rounded: "lg", children: "You're in. Check the leaderboard for results." })) : overLimit ? (_jsxs(Div, { textSize: "sm", color: "warning", surface: "warning-surface", padding: "inline", rounded: "lg", children: ["You've used all ", maxEntriesPerUser, " entry slot", maxEntriesPerUser === 1 ? "" : "s", " for this raffle."] })) : (
|
|
42
|
-
// audit-variant-ok: entry Form — space-y-3 vertical rhythm; Form lacks spacing variant
|
|
43
|
-
_jsxs(Form, { onSubmit: handleSubmit, className: "space-y-3", children: [_jsx(FieldTextarea, { name: "message", label: "Message", hint: "optional \u2014 share why you'd like to win", value: message, onChange: setMessage, rows: 3, maxLength: 500, placeholder: "Share why you'd like to win", disabled: busy }), _jsx(Button, { type: "submit", variant: "primary", disabled: busy, children: busy ? "Submitting…" : "Enter raffle" })] }))] }));
|
|
41
|
+
return (_jsxs(Stack, { className: `${__P.p6}`, gap: "md", rounded: "2xl", border: "default", children: [prizeLabel ? (_jsxs(Stack, { gap: "xs", children: [_jsx(Badge, { variant: "warning", children: "Prize" }), _jsx(Heading, { level: 2, weight: "bold", size: "2xl", children: prizeLabel })] })) : null, _jsx(Text, { size: "sm", color: "muted", children: eligibilityCopy }), submitted ? (_jsx(Div, { textSize: "sm", color: "success", surface: "success-surface", padding: "inline", rounded: "lg", children: "You're in. Check the leaderboard for results." })) : overLimit ? (_jsxs(Div, { textSize: "sm", color: "warning", surface: "warning-surface", padding: "inline", rounded: "lg", children: ["You've used all ", maxEntriesPerUser, " entry slot", maxEntriesPerUser === 1 ? "" : "s", " for this raffle."] })) : (_jsxs(Form, { onSubmit: handleSubmit, className: "space-y-3", children: [_jsx(FieldTextarea, { name: "message", label: "Message", hint: "optional \u2014 share why you'd like to win", value: message, onChange: setMessage, rows: 3, maxLength: 500, placeholder: "Share why you'd like to win", disabled: busy }), _jsx(Button, { type: "submit", variant: "primary", disabled: busy, children: busy ? "Submitting…" : "Enter raffle" })] }))] }));
|
|
44
42
|
}
|
|
@@ -20,7 +20,5 @@ export function EventRaffleWinnerView({ event, currentUserIsWinner, labels }) {
|
|
|
20
20
|
if (!event.raffleWinnerUserId) {
|
|
21
21
|
return (_jsx(Div, { className: "border-dashed text-center", border: "strong", paddingY: "y-2xl", paddingX: "x-lg", rounded: "xl", children: _jsx(Text, { color: "muted", children: l.notDrawnYet }) }));
|
|
22
22
|
}
|
|
23
|
-
return (
|
|
24
|
-
// audit-variant-ok: raffle winner Article — space-y-4 vertical rhythm between children; Article lacks spacing variant
|
|
25
|
-
_jsxs(Article, { className: "space-y-4", children: [_jsxs(Heading, { level: 2, size: "xl", weight: "semibold", color: "primary", children: ["\uD83C\uDF9F\uFE0F ", l.heading] }), _jsxs(Div, { className: CLS_PANEL, children: [_jsxs(Div, { children: [_jsx(Text, { className: CLS_LABEL, children: l.winnerLabel }), _jsx(Text, { className: CLS_WINNER_NAME, children: event.raffleWinnerDisplayName?.trim() || l.anonymous })] }), event.rafflePrize ? (_jsxs(Div, { children: [_jsx(Text, { className: CLS_LABEL, children: l.prizeLabel }), _jsx(Text, { className: "mt-1", color: "primary", size: "base", children: event.rafflePrize })] })) : null, currentUserIsWinner && event.rafflePrizeCouponCode ? (_jsx(Div, { padding: "t-xs", children: _jsx(ClaimCouponButton, { couponCode: event.rafflePrizeCouponCode, source: "raffle", size: "sm" }) })) : null, _jsxs(Div, { layout: "flex", textSize: "sm", className: "flex-wrap gap-x-6 gap-y-2", color: "muted", padding: "t-xs", children: [typeof event.raffleEntryCount === "number" ? (_jsxs(Span, { children: [l.poolLabel, ":", " ", _jsx(Span, { weight: "medium", color: "primary", children: event.raffleEntryCount })] })) : null, event.raffleTriggeredAt ? (_jsx(Span, { children: new Date(event.raffleTriggeredAt).toLocaleString() })) : null] })] }), event.raffleGithubFunctionUrl ? (_jsxs(Div, { textSize: "sm", className: `${__P.p4}`, rounded: "lg", border: "default", children: [_jsx(Text, { weight: "medium", color: "primary", children: l.fairnessLabel }), _jsx(TextLink, { href: event.raffleGithubFunctionUrl, className: "mt-1 block break-all text-primary-600 dark:text-primary-400 hover:underline", children: event.raffleGithubFunctionUrl })] })) : null] }));
|
|
23
|
+
return (_jsxs(Article, { className: "space-y-4", children: [_jsxs(Heading, { level: 2, size: "xl", weight: "semibold", color: "primary", children: ["\uD83C\uDF9F\uFE0F ", l.heading] }), _jsxs(Div, { className: CLS_PANEL, children: [_jsxs(Div, { children: [_jsx(Text, { className: CLS_LABEL, children: l.winnerLabel }), _jsx(Text, { className: CLS_WINNER_NAME, children: event.raffleWinnerDisplayName?.trim() || l.anonymous })] }), event.rafflePrize ? (_jsxs(Div, { children: [_jsx(Text, { className: CLS_LABEL, children: l.prizeLabel }), _jsx(Text, { className: "mt-1", color: "primary", size: "base", children: event.rafflePrize })] })) : null, currentUserIsWinner && event.rafflePrizeCouponCode ? (_jsx(Div, { padding: "t-xs", children: _jsx(ClaimCouponButton, { couponCode: event.rafflePrizeCouponCode, source: "raffle", size: "sm" }) })) : null, _jsxs(Div, { layout: "flex", textSize: "sm", className: "flex-wrap gap-x-6 gap-y-2", color: "muted", padding: "t-xs", children: [typeof event.raffleEntryCount === "number" ? (_jsxs(Span, { children: [l.poolLabel, ":", " ", _jsx(Span, { weight: "medium", color: "primary", children: event.raffleEntryCount })] })) : null, event.raffleTriggeredAt ? (_jsx(Span, { children: new Date(event.raffleTriggeredAt).toLocaleString() })) : null] })] }), event.raffleGithubFunctionUrl ? (_jsxs(Div, { textSize: "sm", className: `${__P.p4}`, rounded: "lg", border: "default", children: [_jsx(Text, { weight: "medium", color: "primary", children: l.fairnessLabel }), _jsx(TextLink, { href: event.raffleGithubFunctionUrl, className: "mt-1 block break-all text-primary-600 dark:text-primary-400 hover:underline", children: event.raffleGithubFunctionUrl })] })) : null] }));
|
|
26
24
|
}
|
|
@@ -55,7 +55,6 @@ export function EventsIndexListing({ initialData }) {
|
|
|
55
55
|
buildSieveParams: () => "",
|
|
56
56
|
buildSearchParams: () => "",
|
|
57
57
|
params: new URLSearchParams(),
|
|
58
|
-
// audit-unknown-ok: TS structural escape — table-state type
|
|
59
58
|
}), [pendingFilters]);
|
|
60
59
|
const openFilters = useCallback(() => {
|
|
61
60
|
setPendingFilters(Object.fromEntries(FILTER_KEYS.map((k) => [k, table.get(k)])));
|
|
@@ -12,7 +12,6 @@ class EventEntryRepository extends BaseRepository {
|
|
|
12
12
|
const raw = super.mapDoc(snap);
|
|
13
13
|
return decryptPiiFields(raw, [
|
|
14
14
|
...EVENT_ENTRY_PII_FIELDS,
|
|
15
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
16
15
|
]);
|
|
17
16
|
}
|
|
18
17
|
async listForEvent(eventId, model) {
|
|
@@ -6,7 +6,5 @@ const __P = {
|
|
|
6
6
|
const CLS_CONTACT_CARD = "flex items-center gap-3 rounded-lg border border-zinc-100 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 px-4 py-3 hover:border-primary/40 transition-colors";
|
|
7
7
|
const CLS_CONTACT_LABEL = "text-xs text-zinc-500 dark:text-zinc-400";
|
|
8
8
|
export function ContactCTA({ email, phone, contactHref, labels, }) {
|
|
9
|
-
return (
|
|
10
|
-
// audit-variant-ok: contact CTA Card — text-center + dark:bg-slate-800/60 explicit dark tint over Card.variant outlined
|
|
11
|
-
_jsxs(Card, { variant: "outlined", padding: "lg", className: "text-center dark:bg-slate-800/60", children: [_jsx(Row, { className: "mb-6", justify: "center", children: _jsx(Div, { className: `bg-primary/10 ${__P.p8}`, rounded: "full", children: _jsx("svg", { className: "h-12 w-12 text-primary", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }) }) }), _jsx(Heading, { level: 2, className: "mb-3", size: "2xl", weight: "semibold", children: labels?.title ?? "Need More Help?" }), _jsx(Text, { className: "mx-auto mb-6 max-w-2xl", color: "muted", children: labels?.description ?? "Our support team is here to help you." }), _jsxs(Div, { layout: "grid", gap: "4", className: "mb-8 grid-cols-1 md:grid-cols-3", children: [_jsxs(TextLink, { href: `mailto:${email}`, variant: "none", className: CLS_CONTACT_CARD, children: [_jsx(Text, { className: CLS_CONTACT_LABEL, children: labels?.emailUs ?? "Email Us" }), _jsx(Text, { size: "xs", color: "muted", children: email })] }), _jsxs(TextLink, { href: `tel:${phone}`, variant: "none", className: CLS_CONTACT_CARD, children: [_jsx(Text, { className: CLS_CONTACT_LABEL, children: labels?.callUs ?? "Call Us" }), _jsx(Text, { size: "xs", color: "muted", children: phone })] }), _jsxs(TextLink, { href: contactHref, className: CLS_CONTACT_CARD, children: [_jsx(Text, { className: CLS_CONTACT_LABEL, children: labels?.contactForm ?? "Contact Form" }), _jsx(Text, { size: "xs", color: "muted", children: labels?.submitRequest ?? "Submit a request" })] })] }), _jsxs(TextLink, { rounded: "xl", href: contactHref, className: "inline-flex items-center gap-2 bg-primary p-6 text-white transition-colors hover:bg-primary/90", weight: "medium", children: [_jsx(Span, { children: labels?.contactTeam ?? "Contact Team" }), _jsx("svg", { className: "h-5 w-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) })] })] }));
|
|
9
|
+
return (_jsxs(Card, { variant: "outlined", padding: "lg", className: "text-center dark:bg-slate-800/60", children: [_jsx(Row, { className: "mb-6", justify: "center", children: _jsx(Div, { className: `bg-primary/10 ${__P.p8}`, rounded: "full", children: _jsx("svg", { className: "h-12 w-12 text-primary", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }) }) }), _jsx(Heading, { level: 2, className: "mb-3", size: "2xl", weight: "semibold", children: labels?.title ?? "Need More Help?" }), _jsx(Text, { className: "mx-auto mb-6 max-w-2xl", color: "muted", children: labels?.description ?? "Our support team is here to help you." }), _jsxs(Div, { layout: "grid", gap: "4", className: "mb-8 grid-cols-1 md:grid-cols-3", children: [_jsxs(TextLink, { href: `mailto:${email}`, variant: "none", className: CLS_CONTACT_CARD, children: [_jsx(Text, { className: CLS_CONTACT_LABEL, children: labels?.emailUs ?? "Email Us" }), _jsx(Text, { size: "xs", color: "muted", children: email })] }), _jsxs(TextLink, { href: `tel:${phone}`, variant: "none", className: CLS_CONTACT_CARD, children: [_jsx(Text, { className: CLS_CONTACT_LABEL, children: labels?.callUs ?? "Call Us" }), _jsx(Text, { size: "xs", color: "muted", children: phone })] }), _jsxs(TextLink, { href: contactHref, className: CLS_CONTACT_CARD, children: [_jsx(Text, { className: CLS_CONTACT_LABEL, children: labels?.contactForm ?? "Contact Form" }), _jsx(Text, { size: "xs", color: "muted", children: labels?.submitRequest ?? "Submit a request" })] })] }), _jsxs(TextLink, { rounded: "xl", href: contactHref, className: "inline-flex items-center gap-2 bg-primary p-6 text-white transition-colors hover:bg-primary/90", weight: "medium", children: [_jsx(Span, { children: labels?.contactTeam ?? "Contact Team" }), _jsx("svg", { className: "h-5 w-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) })] })] }));
|
|
12
10
|
}
|
|
@@ -3,9 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { Button, Div, RichText, Row, Span, Text } from "../../../ui";
|
|
5
5
|
function FAQAccordionItem({ faq, isOpen, onToggle, renderExpandedFooter, }) {
|
|
6
|
-
return (_jsxs(Div, { className: "border-b border-neutral-200 last:border-0", children: [_jsxs(Button, { variant: "ghost", onClick: onToggle, "aria-expanded": isOpen, className: "w-full justify-between gap-4 py-4 text-left text-sm font-medium text-neutral-900 dark:text-zinc-100 transition hover:text-primary", children: [_jsx(Span, { children: faq.question }), _jsx(Span, { className: `flex-shrink-0 transition-transform ${isOpen ? "rotate-180" : ""}`, children: _jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M4 6l4 4 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) })] }), isOpen && (_jsxs(Div, { textSize: "sm", className: "text-neutral-600 dark:text-neutral-400", padding: "b-md", children: [faq.tags && faq.tags.length > 0 && (_jsx(Row, { wrap: true, gap: "sm", className: "mb-3", children: faq.tags.map((tag) => (
|
|
7
|
-
// audit-variant-ok: tag chip — bg-neutral-100/800 + py-1 (between Span padding map keys)
|
|
8
|
-
_jsx(Span, { className: "bg-neutral-100 dark:bg-neutral-800 py-1 text-neutral-600 dark:text-neutral-400", rounded: "md", padding: "x-xs", size: "xs", children: tag }, tag))) })), faq.answer.format === "html" ? (_jsx(RichText, { html: faq.answer.text, className: "prose-sm" })) : (_jsx(Text, { className: "whitespace-pre-line", children: faq.answer.text })), renderExpandedFooter?.(faq)] }))] }));
|
|
6
|
+
return (_jsxs(Div, { className: "border-b border-neutral-200 last:border-0", children: [_jsxs(Button, { variant: "ghost", onClick: onToggle, "aria-expanded": isOpen, className: "w-full justify-between gap-4 py-4 text-left text-sm font-medium text-neutral-900 dark:text-zinc-100 transition hover:text-primary", children: [_jsx(Span, { children: faq.question }), _jsx(Span, { className: `flex-shrink-0 transition-transform ${isOpen ? "rotate-180" : ""}`, children: _jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M4 6l4 4 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) })] }), isOpen && (_jsxs(Div, { textSize: "sm", className: "text-neutral-600 dark:text-neutral-400", padding: "b-md", children: [faq.tags && faq.tags.length > 0 && (_jsx(Row, { wrap: true, gap: "sm", className: "mb-3", children: faq.tags.map((tag) => (_jsx(Span, { className: "bg-neutral-100 dark:bg-neutral-800 py-1 text-neutral-600 dark:text-neutral-400", rounded: "md", padding: "x-xs", size: "xs", children: tag }, tag))) })), faq.answer.format === "html" ? (_jsx(RichText, { html: faq.answer.text, className: "prose-sm" })) : (_jsx(Text, { className: "whitespace-pre-line", children: faq.answer.text })), renderExpandedFooter?.(faq)] }))] }));
|
|
9
7
|
}
|
|
10
8
|
export function FAQAccordion({ faqs, className = "", renderExpandedFooter, labels, }) {
|
|
11
9
|
const [openId, setOpenId] = useState(null);
|
|
@@ -2,9 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Card, Div, Heading, Row, Span, Text, TextLink } from "../../../ui";
|
|
3
3
|
export function FAQCategorySidebar({ selectedCategory, onCategorySelect, categoryCounts, categories, allFaqsHref = "/faqs", categoryHref, contactHref, labels, }) {
|
|
4
4
|
const totalCount = Object.values(categoryCounts).reduce((sum, count) => sum + count, 0);
|
|
5
|
-
return (
|
|
6
|
-
// audit-variant-ok: sidebar Card — dark:bg-slate-800/60 explicit dark tint over Card.variant outlined
|
|
7
|
-
_jsxs(Card, { variant: "outlined", padding: "lg", className: "dark:bg-slate-800/60", children: [_jsx(Heading, { level: 2, className: "mb-6", size: "lg", weight: "semibold", children: labels?.title ?? "Categories" }), _jsx(TextLink, { rounded: "lg", href: allFaqsHref, onClick: () => onCategorySelect?.("all"), className: `mb-3 block w-full p-4 text-left transition-colors ${selectedCategory === "all" ? "bg-primary/10 text-zinc-900 dark:text-zinc-100" : "text-zinc-600 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-slate-700"}`, children: _jsxs(Row, { justify: "between", children: [_jsxs(Row, { gap: "3", children: [_jsx(Span, { size: "2xl", children: "FAQ" }), _jsx(Span, { size: "sm", weight: "medium", children: labels?.allFaqs ?? "All FAQs" })] }), _jsx(Span, { size: "xs", color: "muted", children: totalCount })] }) }), _jsx(Div, { border: "default", className: "mt-4 border-t", padding: "t-md", children: categories.map((category) => {
|
|
5
|
+
return (_jsxs(Card, { variant: "outlined", padding: "lg", className: "dark:bg-slate-800/60", children: [_jsx(Heading, { level: 2, className: "mb-6", size: "lg", weight: "semibold", children: labels?.title ?? "Categories" }), _jsx(TextLink, { rounded: "lg", href: allFaqsHref, onClick: () => onCategorySelect?.("all"), className: `mb-3 block w-full p-4 text-left transition-colors ${selectedCategory === "all" ? "bg-primary/10 text-zinc-900 dark:text-zinc-100" : "text-zinc-600 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-slate-700"}`, children: _jsxs(Row, { justify: "between", children: [_jsxs(Row, { gap: "3", children: [_jsx(Span, { size: "2xl", children: "FAQ" }), _jsx(Span, { size: "sm", weight: "medium", children: labels?.allFaqs ?? "All FAQs" })] }), _jsx(Span, { size: "xs", color: "muted", children: totalCount })] }) }), _jsx(Div, { border: "default", className: "mt-4 border-t", padding: "t-md", children: categories.map((category) => {
|
|
8
6
|
const isSelected = selectedCategory === category.key;
|
|
9
7
|
const count = categoryCounts[category.key] || 0;
|
|
10
8
|
return (_jsxs(TextLink, { rounded: "lg", href: categoryHref(category.key), onClick: () => onCategorySelect?.(category.key), className: `mb-3 block w-full p-4 text-left transition-colors ${isSelected ? "bg-primary/10 text-zinc-900 dark:text-zinc-100" : "text-zinc-600 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-slate-700"}`, children: [_jsxs(Row, { justify: "between", className: "mb-1", children: [_jsxs(Row, { gap: "3", children: [category.icon ? (_jsx(Span, { size: "2xl", children: category.icon })) : null, _jsx(Span, { size: "sm", children: category.label })] }), _jsx(Span, { size: "xs", color: "muted", children: count })] }), isSelected && category.description ? (_jsx(Text, { className: "ml-11", color: "muted", size: "xs", children: category.description })) : null] }, category.key));
|
|
@@ -4,9 +4,5 @@ export function RelatedFAQs({ relatedFAQs, hrefForFaq, labels, }) {
|
|
|
4
4
|
if (!relatedFAQs || relatedFAQs.length === 0) {
|
|
5
5
|
return null;
|
|
6
6
|
}
|
|
7
|
-
return (
|
|
8
|
-
// audit-variant-ok: related FAQs Card — dark:bg-slate-800/60 explicit dark tint over Card.variant outlined
|
|
9
|
-
_jsxs(Card, { variant: "outlined", padding: "lg", className: "dark:bg-slate-800/60", children: [_jsx(Heading, { level: 3, className: "mb-4", size: "lg", weight: "semibold", children: labels?.title ?? "Related Questions" }), _jsx(Stack, { gap: "3", children: relatedFAQs.map((faq) => (
|
|
10
|
-
// audit-variant-ok: related FAQ TextLink — block + bg-zinc-100 + p-4 + hover-bg-zinc-200
|
|
11
|
-
_jsx(TextLink, { rounded: "lg", href: hrefForFaq ? hrefForFaq(faq) : `/faqs#${faq.id}`, className: "group block bg-zinc-100 p-4 transition-colors hover:bg-zinc-200 dark:bg-slate-700 dark:hover:bg-slate-600", children: _jsxs(Row, { align: "start", gap: "3", children: [_jsx("svg", { className: "mt-0.5 h-5 w-5 flex-shrink-0 text-zinc-500 dark:text-zinc-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), _jsx(Text, { className: "transition-colors group-hover:text-primary", color: "primary", size: "sm", children: faq.question }), _jsx("svg", { className: "ml-auto mt-0.5 h-4 w-4 flex-shrink-0 text-zinc-500 opacity-0 transition-opacity group-hover:opacity-100 dark:text-zinc-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) })] }) }, faq.id))) })] }));
|
|
7
|
+
return (_jsxs(Card, { variant: "outlined", padding: "lg", className: "dark:bg-slate-800/60", children: [_jsx(Heading, { level: 3, className: "mb-4", size: "lg", weight: "semibold", children: labels?.title ?? "Related Questions" }), _jsx(Stack, { gap: "3", children: relatedFAQs.map((faq) => (_jsx(TextLink, { rounded: "lg", href: hrefForFaq ? hrefForFaq(faq) : `/faqs#${faq.id}`, className: "group block bg-zinc-100 p-4 transition-colors hover:bg-zinc-200 dark:bg-slate-700 dark:hover:bg-slate-600", children: _jsxs(Row, { align: "start", gap: "3", children: [_jsx("svg", { className: "mt-0.5 h-5 w-5 flex-shrink-0 text-zinc-500 dark:text-zinc-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), _jsx(Text, { className: "transition-colors group-hover:text-primary", color: "primary", size: "sm", children: faq.question }), _jsx("svg", { className: "ml-auto mt-0.5 h-4 w-4 flex-shrink-0 text-zinc-500 opacity-0 transition-opacity group-hover:opacity-100 dark:text-zinc-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) })] }) }, faq.id))) })] }));
|
|
12
8
|
}
|
|
@@ -63,7 +63,5 @@ export function AsyncFacetSection({ title, selected, onChange, loadOptions, sele
|
|
|
63
63
|
return (_jsxs(Div, { className: cn("p-4 border-b border-zinc-200 dark:border-slate-700 last:border-b-0", className), children: [_jsxs(Row, { gap: "xs", children: [_jsxs(Button, { type: "button", onClick: () => setCollapsed((c) => !c), variant: "ghost", size: "sm", className: "flex-1 justify-between text-sm font-semibold text-zinc-900 dark:text-zinc-50 py-1 hover:opacity-80 transition-opacity", "aria-expanded": !collapsed, children: [_jsxs(Row, { as: Span, gap: "xs", children: [title, hasValue && (_jsx(Span, { size: "xs", className: CLS_BADGE_COUNT, children: selected.length }))] }), _jsx("svg", { className: cn("w-4 h-4 text-zinc-500 dark:text-zinc-400 transition-transform duration-200", collapsed ? "" : "rotate-180"), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) })] }), onClear && hasValue && (_jsx(Button, { type: "button", onClick: onClear, variant: "ghost", size: "sm", className: CLS_CLEAR_ICON, "aria-label": "Clear filter", children: _jsx("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, "aria-hidden": "true", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }))] }), collapsed && hasValue && (_jsxs(Row, { wrap: true, gap: "xs", className: "mt-2", children: [selectedLabels.map((label) => (_jsx(Span, { layout: "inline-flex", size: "xs", border: "default", rounded: "full", padding: "pill-xs", surface: "subtle", color: "muted", children: label }, label))), selected.length > 3 && (_jsxs(Span, { layout: "inline-flex", size: "xs", rounded: "full", padding: "pill-xs", color: "faint", children: ["+", selected.length - 3, " more"] }))] })), _jsx(Div, { className: "mt-2", children: _jsx(Input, { type: "search", placeholder: "Search\u2026", value: query, onChange: (e) => handleQueryChange(e.target.value), className: "w-full rounded-md border border-zinc-200 dark:border-slate-700 bg-white dark:bg-slate-800/60 px-2.5 py-1.5 text-xs text-zinc-900 dark:text-zinc-100 focus:outline-none focus:ring-2 focus:ring-primary-500/20" }) }), !collapsed && (_jsxs(Stack, { className: "mt-3", gap: "xs", children: [options.map((opt) => {
|
|
64
64
|
const isSelected = selected.includes(opt.value);
|
|
65
65
|
return (_jsxs(Row, { gap: "2.5", className: "cursor-pointer group", padding: "y-2xs", children: [_jsx("input", { type: selectionMode === "single" ? "radio" : "checkbox", checked: isSelected, onChange: () => toggle(opt.value), "aria-label": opt.label, className: "flex-shrink-0 w-4 h-4 rounded border-zinc-300 dark:border-slate-600 cursor-pointer text-primary-600 dark:text-secondary-500" }), _jsx(Span, { size: "sm", className: "flex-1 group-hover:text-zinc-900 dark:group-hover:text-zinc-100 transition-colors truncate", color: "muted", children: opt.label }), opt.count !== undefined && (_jsx(Span, { size: "xs", className: "tabular-nums flex-shrink-0", color: "faint", children: opt.count }))] }, opt.value));
|
|
66
|
-
}), options.length === 0 && !loading && (_jsx(Text, { paddingY: "2xs", color: "faint", size: "xs", children: "No results" })), loading && (_jsx(Text, { paddingY: "2xs", className: "animate-pulse", color: "faint", size: "xs", children: "Loading\u2026" })), hasMore && !loading && (
|
|
67
|
-
// audit-variant-ok: facet load-more button — text-left + group-hover state override; Button lacks text-left / hover-shade variants
|
|
68
|
-
_jsx(Button, { type: "button", variant: "ghost", size: "sm", textSize: "xs", textColor: "faint", className: "w-full text-left hover:text-zinc-600 dark:hover:text-zinc-300 py-1", onClick: () => void load(query, page + 1), children: "Load more\u2026" }))] }))] }));
|
|
66
|
+
}), options.length === 0 && !loading && (_jsx(Text, { paddingY: "2xs", color: "faint", size: "xs", children: "No results" })), loading && (_jsx(Text, { paddingY: "2xs", className: "animate-pulse", color: "faint", size: "xs", children: "Loading\u2026" })), hasMore && !loading && (_jsx(Button, { type: "button", variant: "ghost", size: "sm", textSize: "xs", textColor: "faint", className: "w-full text-left hover:text-zinc-600 dark:hover:text-zinc-300 py-1", onClick: () => void load(query, page + 1), children: "Load more\u2026" }))] }))] }));
|
|
69
67
|
}
|
|
@@ -71,22 +71,12 @@ export function FilterFacetSection({ title, options, selected, onChange, selecti
|
|
|
71
71
|
? CLS_OPTION_SELECTED
|
|
72
72
|
: "border-zinc-200 bg-white text-zinc-700 hover:border-zinc-400 dark:border-slate-700 dark:bg-slate-900 dark:text-zinc-200 dark:hover:border-slate-500"), children: [title, hasValue && (_jsx(Span, { weight: "bold", className: CLS_OPTION_DOT, children: selected.length })), _jsx("svg", { className: cn("h-3.5 w-3.5 text-zinc-400 transition-transform", dropdownOpen ? "rotate-180" : ""), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) })] }), dropdownOpen && (_jsxs(Div, { className: "absolute left-0 top-full z-[var(--appkit-z-dropdown,50)] mt-1 min-w-[180px] max-w-[260px]", surface: "default", rounded: "xl", shadow: "lg", border: "default", children: [searchable && (_jsx(Div, { border: "subtle", className: "border-b", padding: "xs", children: _jsx(Input, { type: "search", placeholder: "Search\u2026", value: search, onChange: (e) => handleSearch(e.target.value), className: "w-full rounded-md border border-zinc-200 bg-white px-2 py-1 text-xs text-zinc-900 focus:outline-none dark:border-slate-700 dark:bg-slate-800/60 dark:text-zinc-100" }) })), _jsxs(Div, { className: `max-h-56 ${__O.yAuto}`, padding: "y-2xs", children: [filtered.map((option) => {
|
|
73
73
|
const isSelected = selected.includes(option.value);
|
|
74
|
-
return (
|
|
75
|
-
|
|
76
|
-
_jsxs(Row, { gap: "xs", className: "cursor-pointer py-1.5 hover:bg-zinc-50 dark:hover:bg-slate-800 mx-1", padding: "x-sm", rounded: "lg", onClick: () => toggle(option.value), children: [_jsx("input", { type: selectionMode === "single" ? "radio" : "checkbox", checked: isSelected, onChange: () => toggle(option.value), "aria-label": option.label, className: "h-3.5 w-3.5 flex-shrink-0 cursor-pointer rounded border-zinc-300 text-primary-600 dark:border-slate-600 dark:text-secondary-500" }), _jsx(Span, { size: "xs", className: "flex-1 truncate", color: "muted", children: option.label }), option.count !== undefined && (_jsx(Span, { className: "flex-shrink-0 text-[10px] tabular-nums", color: "faint", children: option.count }))] }, option.value));
|
|
77
|
-
}), filtered.length === 0 && (
|
|
78
|
-
// audit-variant-ok: empty-state Text — px-3 to mirror dropdown content padding
|
|
79
|
-
_jsx(Text, { paddingY: "xs", className: "px-3", color: "faint", size: "xs", children: "No results" }))] }), hasValue && (
|
|
80
|
-
// audit-variant-ok: dropdown footer — top divider + tight p-1 padding below PADDING_MAP scale
|
|
81
|
-
_jsx(Div, { border: "subtle", className: "border-t p-1", children: _jsx(Button, { type: "button", variant: "ghost", size: "sm", className: CLS_CLEAR_BTN, onClick: () => { onChange([]); onClear?.(); setDropdownOpen(false); }, children: "Clear" }) }))] }))] }));
|
|
74
|
+
return (_jsxs(Row, { gap: "xs", className: "cursor-pointer py-1.5 hover:bg-zinc-50 dark:hover:bg-slate-800 mx-1", padding: "x-sm", rounded: "lg", onClick: () => toggle(option.value), children: [_jsx("input", { type: selectionMode === "single" ? "radio" : "checkbox", checked: isSelected, onChange: () => toggle(option.value), "aria-label": option.label, className: "h-3.5 w-3.5 flex-shrink-0 cursor-pointer rounded border-zinc-300 text-primary-600 dark:border-slate-600 dark:text-secondary-500" }), _jsx(Span, { size: "xs", className: "flex-1 truncate", color: "muted", children: option.label }), option.count !== undefined && (_jsx(Span, { className: "flex-shrink-0 text-[10px] tabular-nums", color: "faint", children: option.count }))] }, option.value));
|
|
75
|
+
}), filtered.length === 0 && (_jsx(Text, { paddingY: "xs", className: "px-3", color: "faint", size: "xs", children: "No results" }))] }), hasValue && (_jsx(Div, { border: "subtle", className: "border-t p-1", children: _jsx(Button, { type: "button", variant: "ghost", size: "sm", className: CLS_CLEAR_BTN, onClick: () => { onChange([]); onClear?.(); setDropdownOpen(false); }, children: "Clear" }) }))] }))] }));
|
|
82
76
|
}
|
|
83
77
|
// ── Accordion variant (default) ─────────────────────────────────────────
|
|
84
|
-
return (_jsxs(Div, { className: cn("p-4 border-b border-zinc-200 dark:border-slate-700 last:border-b-0", className), children: [_jsxs(Row, { gap: "xs", children: [_jsxs(Button, { type: "button", onClick: handleToggle, variant: "ghost", size: "sm", className: "flex-1 justify-between text-sm font-semibold text-zinc-900 dark:text-zinc-50 py-1 hover:opacity-80 transition-opacity", "aria-expanded": !isCollapsed, children: [_jsxs(Row, { as: Span, gap: "xs", children: [title, hasValue && (_jsx(Span, { size: "xs", className: CLS_BADGE_COUNT, children: selected.length }))] }), _jsx("svg", { className: cn("w-4 h-4 text-zinc-500 dark:text-zinc-400 transition-transform duration-200", isCollapsed ? "" : "rotate-180"), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) })] }), onClear && hasValue && (_jsx(Button, { type: "button", onClick: onClear, variant: "ghost", size: "sm", className: CLS_CLEAR_ICON, "aria-label": "Clear filter", children: _jsx("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, "aria-hidden": "true", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }))] }), isCollapsed && hasValue && (_jsxs(Row, { wrap: true, gap: "xs", className: "mt-2", children: [selectedLabels.map((label) => (
|
|
85
|
-
// audit-variant-ok: selected chip — explicit zinc/slate border tokens for theme contrast against surface=subtle
|
|
86
|
-
_jsx(Span, { layout: "inline-flex", size: "xs", className: "border border-zinc-200 dark:border-slate-600", rounded: "full", padding: "pill-xs", surface: "subtle", color: "muted", children: label }, label))), selected.length > 3 && (_jsxs(Span, { layout: "inline-flex", size: "xs", rounded: "full", padding: "pill-xs", color: "faint", children: ["+", selected.length - 3, " more"] }))] })), searchable && (_jsx(Div, { className: "mt-2", children: _jsx(Input, { type: "search", placeholder: "Search\u2026", value: search, onChange: (e) => handleSearch(e.target.value), className: "w-full rounded-md border border-zinc-200 dark:border-slate-700 bg-white dark:bg-slate-800/60 px-2.5 py-1.5 text-xs text-zinc-900 dark:text-zinc-100 focus:outline-none focus:ring-2 focus:ring-primary-500/20 dark:focus:ring-secondary-400/20" }) })), !isCollapsed && (_jsxs(Stack, { className: "mt-3", gap: "xs", children: [filtered.map((option) => {
|
|
78
|
+
return (_jsxs(Div, { className: cn("p-4 border-b border-zinc-200 dark:border-slate-700 last:border-b-0", className), children: [_jsxs(Row, { gap: "xs", children: [_jsxs(Button, { type: "button", onClick: handleToggle, variant: "ghost", size: "sm", className: "flex-1 justify-between text-sm font-semibold text-zinc-900 dark:text-zinc-50 py-1 hover:opacity-80 transition-opacity", "aria-expanded": !isCollapsed, children: [_jsxs(Row, { as: Span, gap: "xs", children: [title, hasValue && (_jsx(Span, { size: "xs", className: CLS_BADGE_COUNT, children: selected.length }))] }), _jsx("svg", { className: cn("w-4 h-4 text-zinc-500 dark:text-zinc-400 transition-transform duration-200", isCollapsed ? "" : "rotate-180"), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) })] }), onClear && hasValue && (_jsx(Button, { type: "button", onClick: onClear, variant: "ghost", size: "sm", className: CLS_CLEAR_ICON, "aria-label": "Clear filter", children: _jsx("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, "aria-hidden": "true", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }))] }), isCollapsed && hasValue && (_jsxs(Row, { wrap: true, gap: "xs", className: "mt-2", children: [selectedLabels.map((label) => (_jsx(Span, { layout: "inline-flex", size: "xs", className: "border border-zinc-200 dark:border-slate-600", rounded: "full", padding: "pill-xs", surface: "subtle", color: "muted", children: label }, label))), selected.length > 3 && (_jsxs(Span, { layout: "inline-flex", size: "xs", rounded: "full", padding: "pill-xs", color: "faint", children: ["+", selected.length - 3, " more"] }))] })), searchable && (_jsx(Div, { className: "mt-2", children: _jsx(Input, { type: "search", placeholder: "Search\u2026", value: search, onChange: (e) => handleSearch(e.target.value), className: "w-full rounded-md border border-zinc-200 dark:border-slate-700 bg-white dark:bg-slate-800/60 px-2.5 py-1.5 text-xs text-zinc-900 dark:text-zinc-100 focus:outline-none focus:ring-2 focus:ring-primary-500/20 dark:focus:ring-secondary-400/20" }) })), !isCollapsed && (_jsxs(Stack, { className: "mt-3", gap: "xs", children: [filtered.map((option) => {
|
|
87
79
|
const isSelected = selected.includes(option.value);
|
|
88
80
|
return (_jsxs(Row, { gap: "2.5", className: "cursor-pointer group", padding: "y-2xs", children: [selectionMode === "single" ? (_jsx("input", { type: "radio", checked: isSelected, onChange: () => toggle(option.value), "aria-label": option.label, className: cn("flex-shrink-0 border-zinc-300 dark:border-slate-600 cursor-pointer", "w-4 h-4 rounded-full text-primary-600 dark:text-secondary-500", "focus:ring-primary-500/30 dark:focus:ring-secondary-400/30") })) : (_jsx("input", { type: "checkbox", checked: isSelected, onChange: () => toggle(option.value), "aria-label": option.label, className: cn("flex-shrink-0 border-zinc-300 dark:border-slate-600 cursor-pointer", "w-4 h-4 rounded text-primary-600 dark:text-secondary-500 checked:bg-primary-600 dark:checked:bg-secondary-500", "focus:ring-primary-500/30 dark:focus:ring-secondary-400/30") })), _jsx(Span, { size: "sm", className: "flex-1 group-hover:text-zinc-900 dark:group-hover:text-zinc-100 transition-colors truncate", color: "muted", children: option.label }), option.count !== undefined && (_jsx(Span, { size: "xs", className: "tabular-nums flex-shrink-0", color: "faint", children: option.count }))] }, option.value));
|
|
89
|
-
}), filtered.length === 0 && (
|
|
90
|
-
// audit-variant-ok: accordion empty-state Text — py-1 below PADDING_MAP scale
|
|
91
|
-
_jsx(Text, { className: "py-1", color: "faint", size: "xs", children: "No results" }))] }))] }));
|
|
81
|
+
}), filtered.length === 0 && (_jsx(Text, { className: "py-1", color: "faint", size: "xs", children: "No results" }))] }))] }));
|
|
92
82
|
}
|
|
@@ -12,7 +12,5 @@ export function Checkbox({ label, suffix, error, indeterminate, className = "",
|
|
|
12
12
|
}, [indeterminate]);
|
|
13
13
|
return (_jsxs(Div, { className: "w-full", children: [_jsxs("label", { className: "flex flex-row items-center gap-3 cursor-pointer group", children: [_jsxs(Row, { className: "relative flex-shrink-0", align: "center", justify: "center", children: [_jsx("input", { ref: inputRef, type: "checkbox", checked: checked, className: cn("peer w-5 h-5 rounded-md border-2 cursor-pointer", "transition-all duration-200 appearance-none", error
|
|
14
14
|
? "border-error dark:border-error"
|
|
15
|
-
: "border-zinc-300 dark:border-slate-600", "checked:bg-primary-600 checked:border-primary-600", "dark:checked:bg-secondary-500 dark:checked:border-secondary-500", "hover:border-primary-400 dark:hover:border-secondary-400", "focus:outline-none focus:ring-2 focus:ring-primary-500/30 focus:ring-offset-1", "dark:focus:ring-secondary-400/30 dark:focus:ring-offset-slate-900", "disabled:opacity-50 disabled:cursor-not-allowed", className), ...props }), _jsx("svg", { className: "absolute w-3 h-3 text-white pointer-events-none opacity-0 peer-checked:opacity-100 transition-opacity duration-150", viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: indeterminate ? (_jsx("line", { x1: "2", y1: "6", x2: "10", y2: "6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })) : (_jsx("path", { d: "M2 6L5 9L10 3", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })) })] }), (label || suffix) && (
|
|
16
|
-
// audit-variant-ok: checkbox label Span — group-hover state override; Span lacks group-hover variant
|
|
17
|
-
_jsxs(Span, { layout: "flex", gap: "md", size: "sm", className: "group-hover:text-zinc-900 dark:group-hover:text-zinc-100 transition-colors", color: "muted", children: [label, suffix] }))] }), error && (_jsx(Text, { className: cn(ERROR_BASE, "mt-1.5"), role: "alert", children: error }))] }));
|
|
15
|
+
: "border-zinc-300 dark:border-slate-600", "checked:bg-primary-600 checked:border-primary-600", "dark:checked:bg-secondary-500 dark:checked:border-secondary-500", "hover:border-primary-400 dark:hover:border-secondary-400", "focus:outline-none focus:ring-2 focus:ring-primary-500/30 focus:ring-offset-1", "dark:focus:ring-secondary-400/30 dark:focus:ring-offset-slate-900", "disabled:opacity-50 disabled:cursor-not-allowed", className), ...props }), _jsx("svg", { className: "absolute w-3 h-3 text-white pointer-events-none opacity-0 peer-checked:opacity-100 transition-opacity duration-150", viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: indeterminate ? (_jsx("line", { x1: "2", y1: "6", x2: "10", y2: "6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })) : (_jsx("path", { d: "M2 6L5 9L10 3", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })) })] }), (label || suffix) && (_jsxs(Span, { layout: "flex", gap: "md", size: "sm", className: "group-hover:text-zinc-900 dark:group-hover:text-zinc-100 transition-colors", color: "muted", children: [label, suffix] }))] }), error && (_jsx(Text, { className: cn(ERROR_BASE, "mt-1.5"), role: "alert", children: error }))] }));
|
|
18
16
|
}
|
|
@@ -18,7 +18,5 @@ export function Slider({ value: controlledValue, defaultValue = 0, min = 0, max
|
|
|
18
18
|
onChange?.(newVal);
|
|
19
19
|
};
|
|
20
20
|
const displayValue = formatValue ? formatValue(value) : String(value);
|
|
21
|
-
return (_jsxs(Div, { className: cn("w-full space-y-2", className), children: [(label || showValue) && (_jsxs(Row, { justify: "between", children: [label && (_jsx("label", { htmlFor: sliderId, className: LABEL_BASE, children: label })), showValue && (_jsx(Span, { size: "sm", weight: "semibold", className: "tabular-nums", color: "primary", children: displayValue }))] })), _jsxs(Row, { className: "relative h-5", children: [_jsx(Row, { className: "absolute inset-y-0 w-full", align: "center", children: _jsx(Div, { className: "w-full h-1.5", surface: "subtle", rounded: "full", children: _jsx(Div, { className: "h-full bg-primary-500 dark:bg-secondary-500 transition-all", rounded: "full",
|
|
22
|
-
// audit-inline-style-ok: computed percentage
|
|
23
|
-
style: { width: `${pct}%` } }) }) }), _jsx("input", { type: "range", id: sliderId, min: min, max: max, step: step, value: value, disabled: disabled, onChange: handleChange, className: cn("relative w-full appearance-none bg-transparent cursor-pointer", "focus:outline-none", "[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4", "[&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-white", "[&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-primary-500 dark:[&::-webkit-slider-thumb]:border-secondary-500", "[&::-webkit-slider-thumb]:shadow-sm", "[&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:h-4", "[&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:bg-white", "[&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-primary-500 dark:[&::-moz-range-thumb]:border-secondary-500", disabled && "opacity-50 cursor-not-allowed") })] }), _jsxs(Row, { color: "muted", textSize: "xs", justify: "between", children: [_jsx(Span, { children: formatValue ? formatValue(min) : min }), _jsx(Span, { children: formatValue ? formatValue(max) : max })] }), error && (_jsx(Text, { className: ERROR_BASE, role: "alert", children: error }))] }));
|
|
21
|
+
return (_jsxs(Div, { className: cn("w-full space-y-2", className), children: [(label || showValue) && (_jsxs(Row, { justify: "between", children: [label && (_jsx("label", { htmlFor: sliderId, className: LABEL_BASE, children: label })), showValue && (_jsx(Span, { size: "sm", weight: "semibold", className: "tabular-nums", color: "primary", children: displayValue }))] })), _jsxs(Row, { className: "relative h-5", children: [_jsx(Row, { className: "absolute inset-y-0 w-full", align: "center", children: _jsx(Div, { className: "w-full h-1.5", surface: "subtle", rounded: "full", children: _jsx(Div, { className: "h-full bg-primary-500 dark:bg-secondary-500 transition-all", rounded: "full", style: { width: `${pct}%` } }) }) }), _jsx("input", { type: "range", id: sliderId, min: min, max: max, step: step, value: value, disabled: disabled, onChange: handleChange, className: cn("relative w-full appearance-none bg-transparent cursor-pointer", "focus:outline-none", "[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4", "[&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-white", "[&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-primary-500 dark:[&::-webkit-slider-thumb]:border-secondary-500", "[&::-webkit-slider-thumb]:shadow-sm", "[&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:h-4", "[&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:bg-white", "[&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-primary-500 dark:[&::-moz-range-thumb]:border-secondary-500", disabled && "opacity-50 cursor-not-allowed") })] }), _jsxs(Row, { color: "muted", textSize: "xs", justify: "between", children: [_jsx(Span, { children: formatValue ? formatValue(min) : min }), _jsx(Span, { children: formatValue ? formatValue(max) : max })] }), error && (_jsx(Text, { className: ERROR_BASE, role: "alert", children: error }))] }));
|
|
24
22
|
}
|
|
@@ -69,7 +69,6 @@ export function useHistory(userId) {
|
|
|
69
69
|
const [items, setItems] = useState([]);
|
|
70
70
|
const trackTimers = useRef(new Map());
|
|
71
71
|
const loadItems = useCallback(async () => {
|
|
72
|
-
// toast-intentionally-silent — silent fallback to empty list on error
|
|
73
72
|
try {
|
|
74
73
|
if (isAuth) {
|
|
75
74
|
setItems(await fetchAuthHistory());
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
import { getAdminDb } from "../../../providers/db-firebase";
|
|
13
13
|
import { serverLogger } from "../../../monitoring";
|
|
14
14
|
import { HISTORY_COLLECTION, HISTORY_DOC_ID, HISTORY_MAX, } from "../../../constants/limits";
|
|
15
|
-
// audit-unknown-ok: type-narrowing entry point — accepts any value, narrows by typeof/Array.isArray
|
|
16
15
|
function toDate(raw) {
|
|
17
16
|
if (raw instanceof Date)
|
|
18
17
|
return raw;
|
|
@@ -23,7 +22,6 @@ function toDate(raw) {
|
|
|
23
22
|
return new Date(raw);
|
|
24
23
|
return new Date();
|
|
25
24
|
}
|
|
26
|
-
// audit-unknown-ok: type-narrowing entry point — accepts any value, narrows by typeof/Array.isArray
|
|
27
25
|
function normaliseItems(raw) {
|
|
28
26
|
if (!Array.isArray(raw))
|
|
29
27
|
return [];
|
|
@@ -11,7 +11,6 @@ export async function createCarouselSlide(adminId, input) {
|
|
|
11
11
|
const slide = await carouselRepository.create({
|
|
12
12
|
...input,
|
|
13
13
|
createdBy: adminId,
|
|
14
|
-
// audit-unknown-ok: TS structural escape — CarouselSlideCreateInput
|
|
15
14
|
});
|
|
16
15
|
serverLogger.info("createCarouselSlide", { adminId, slideId: slide.id });
|
|
17
16
|
return slide;
|
|
@@ -15,9 +15,7 @@ export const updateSectionSchema = z.object({
|
|
|
15
15
|
});
|
|
16
16
|
// --- Actions --------------------------------------------------------------
|
|
17
17
|
export async function createHomepageSection(input, createdBy) {
|
|
18
|
-
const section = await homepageSectionsRepository.create(
|
|
19
|
-
// audit-unknown-ok: TS structural escape — HomepageSectionCreateInput
|
|
20
|
-
input);
|
|
18
|
+
const section = await homepageSectionsRepository.create(input);
|
|
21
19
|
serverLogger.info("createHomepageSection", {
|
|
22
20
|
createdBy,
|
|
23
21
|
sectionId: section.id,
|
|
@@ -150,7 +150,6 @@ export const carouselPOST = createRouteHandler({
|
|
|
150
150
|
cards: body.cards ?? [],
|
|
151
151
|
createdAt: now,
|
|
152
152
|
updatedAt: now,
|
|
153
|
-
// audit-unknown-ok: TS structural escape — CarouselSlide
|
|
154
153
|
});
|
|
155
154
|
return NextResponse.json({ success: true, data: created }, { status: 201 });
|
|
156
155
|
},
|
|
@@ -132,7 +132,6 @@ export const POST = createRouteHandler({
|
|
|
132
132
|
enabled: body.enabled ?? true,
|
|
133
133
|
createdAt: now,
|
|
134
134
|
updatedAt: now,
|
|
135
|
-
// audit-unknown-ok: TS structural escape — HomepageSection
|
|
136
135
|
});
|
|
137
136
|
return NextResponse.json({ success: true, data: created }, { status: 201 });
|
|
138
137
|
},
|