@mohasinac/appkit 3.2.7 → 3.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/client/features/filters/filter-load-options.js +11 -9
- package/dist/_internal/client/theme/ThemeProvider.js +14 -4
- package/dist/_internal/server/features/auth/firebase-identity.d.ts +12 -0
- package/dist/_internal/server/features/auth/firebase-identity.js +25 -0
- package/dist/_internal/server/features/site-settings/safe-settings.d.ts +12 -0
- package/dist/_internal/server/features/site-settings/safe-settings.js +25 -0
- package/dist/_internal/shared/features/layout/config.js +7 -7
- package/dist/_internal/shared/styles/skeleton.d.ts +8 -8
- package/dist/_internal/shared/styles/skeleton.js +10 -10
- package/dist/_internal/shared/styles/themed.d.ts +12 -12
- package/dist/_internal/shared/styles/themed.js +12 -12
- package/dist/features/about/components/AboutView.js +1 -1
- package/dist/features/about/components/FAQPageView.js +1 -1
- package/dist/features/about/components/FeesView.js +2 -2
- package/dist/features/about/components/HowAuctionsWorkView.js +2 -2
- package/dist/features/about/components/HowCheckoutWorksView.js +2 -2
- package/dist/features/about/components/HowOffersWorkView.js +2 -2
- package/dist/features/about/components/HowOrdersWorkView.js +2 -2
- package/dist/features/about/components/HowPayoutsWorkView.js +2 -2
- package/dist/features/about/components/HowPreOrdersWorkView.js +2 -2
- package/dist/features/about/components/HowReviewsWorkView.js +2 -2
- package/dist/features/about/components/PublicProfileView.js +3 -3
- package/dist/features/about/components/SecurityPrivacyView.js +2 -2
- package/dist/features/account/components/AddressBook.js +2 -2
- package/dist/features/account/components/AddressesIndexListing.js +1 -1
- package/dist/features/account/components/ChatWindow.js +1 -1
- package/dist/features/account/components/MessagesView.js +1 -1
- package/dist/features/account/components/NotificationBell.js +2 -2
- package/dist/features/account/components/NotificationPreferencesPanel.js +1 -1
- package/dist/features/account/components/UserSidebar.js +3 -3
- package/dist/features/account/components/UserSupportView.js +3 -3
- package/dist/features/admin/components/AdminAdEditorView.js +1 -1
- package/dist/features/admin/components/AdminAdsView.js +5 -5
- package/dist/features/admin/components/AdminAnalyticsView.js +1 -1
- package/dist/features/admin/components/AdminBrandsView.js +1 -1
- package/dist/features/admin/components/AdminBundlesView.js +2 -2
- package/dist/features/admin/components/AdminCarouselEditorView.js +4 -4
- package/dist/features/admin/components/AdminCarouselView.js +2 -2
- package/dist/features/admin/components/AdminCategoriesView.js +2 -2
- package/dist/features/admin/components/AdminContactEditorView.js +1 -1
- package/dist/features/admin/components/AdminCouponEditorView.js +1 -1
- package/dist/features/admin/components/AdminEmployeeEditorView.js +3 -3
- package/dist/features/admin/components/AdminFaqsView.js +1 -1
- package/dist/features/admin/components/AdminFeatureEditorView.js +2 -2
- package/dist/features/admin/components/AdminFeatureFlagsView.js +1 -1
- package/dist/features/admin/components/AdminFeaturesView.js +2 -2
- package/dist/features/admin/components/AdminNavigationView.js +2 -2
- package/dist/features/admin/components/AdminNotificationsView.js +1 -1
- package/dist/features/admin/components/AdminOrderEditorView.js +1 -1
- package/dist/features/admin/components/AdminPageHeader.d.ts +1 -1
- package/dist/features/admin/components/AdminPageHeader.js +1 -1
- package/dist/features/admin/components/AdminReviewsView.js +1 -1
- package/dist/features/admin/components/AdminScammerEditorView.js +3 -3
- package/dist/features/admin/components/AdminScammersView.js +1 -1
- package/dist/features/admin/components/AdminSectionsView.js +1 -1
- package/dist/features/admin/components/AdminSessionsView.js +1 -1
- package/dist/features/admin/components/AdminSidebar.js +5 -5
- package/dist/features/admin/components/AdminSiteSettingsView.js +3 -3
- package/dist/features/admin/components/AdminStoreEditorView.js +3 -3
- package/dist/features/admin/components/AdminSupportTicketDetailView.js +3 -3
- package/dist/features/admin/components/AdminSupportTicketsView.js +2 -2
- package/dist/features/admin/components/AdminViewCards.js +5 -5
- package/dist/features/admin/components/DataTable.js +1 -1
- package/dist/features/admin/components/DrawerFormFooter.js +1 -1
- package/dist/features/admin/components/QuickActionsPanel.js +1 -1
- package/dist/features/admin/components/analytics/AdminTopProductsTable.js +1 -1
- package/dist/features/auctions/components/AuctionDetailPageView.js +2 -2
- package/dist/features/auctions/components/CollapsibleBidHistory.js +1 -1
- package/dist/features/auctions/components/MarketplaceAuctionCard.js +1 -1
- package/dist/features/auth/components/ForgotPasswordView.js +1 -1
- package/dist/features/auth/components/Guards.js +1 -1
- package/dist/features/auth/components/RegisterForm.js +1 -1
- package/dist/features/auth/components/ResetPasswordView.js +1 -1
- package/dist/features/auth/components/SocialAuthButtons.js +1 -1
- package/dist/features/blog/components/BlogIndexListing.js +1 -1
- package/dist/features/blog/components/BlogListView.js +3 -3
- package/dist/features/blog/components/BlogPostView.js +1 -1
- package/dist/features/cart/components/CartDrawer.js +5 -5
- package/dist/features/categories/components/BrandDetailPageView.js +1 -1
- package/dist/features/categories/components/BrandDetailTabs.js +1 -1
- package/dist/features/categories/components/CategoriesIndexListing.js +2 -2
- package/dist/features/categories/components/CategoryDetailPageView.js +1 -1
- package/dist/features/categories/components/CategoryDetailTabs.js +1 -1
- package/dist/features/categories/components/CategoryGrid.js +3 -3
- package/dist/features/categories/components/CategoryTree.js +2 -2
- package/dist/features/categories/components/ConcernCard.js +1 -1
- package/dist/features/checkout/components/CheckoutStepper.js +1 -1
- package/dist/features/classified/components/ClassifiedIndexListing.js +1 -1
- package/dist/features/collections/components/CollectionCard.js +1 -1
- package/dist/features/collections/hooks/useCollections.js +12 -12
- package/dist/features/contact/components/ContactForm.js +1 -1
- package/dist/features/copilot/components/AdminCopilotView.js +5 -5
- package/dist/features/digital-codes/components/DigitalCodesIndexListing.js +1 -1
- package/dist/features/events/components/AdminEventEntriesView.js +1 -1
- package/dist/features/events/components/EventCard.js +1 -1
- package/dist/features/events/components/EventPollWidget.js +1 -1
- package/dist/features/events/components/EventStatusBadge.js +1 -1
- package/dist/features/events/components/EventsIndexListing.js +1 -1
- package/dist/features/faq/components/ContactCTA.js +2 -2
- package/dist/features/faq/components/FAQAccordion.js +4 -4
- package/dist/features/faq/components/FAQCategorySidebar.js +2 -2
- package/dist/features/faq/components/FAQHelpfulButtons.js +4 -4
- package/dist/features/faq/components/RelatedFAQs.js +1 -1
- package/dist/features/filters/AsyncFacetSection.js +3 -3
- package/dist/features/filters/FilterFacetSection.js +5 -5
- package/dist/features/filters/RangeFilter.js +3 -3
- package/dist/features/filters/SwitchFilter.js +2 -2
- package/dist/features/forms/Checkbox.js +1 -1
- package/dist/features/forms/Input.js +2 -2
- package/dist/features/forms/Radio.js +2 -2
- package/dist/features/forms/Select.js +1 -1
- package/dist/features/forms/Slider.js +1 -1
- package/dist/features/forms/Textarea.js +1 -1
- package/dist/features/forms/Toggle.js +3 -3
- package/dist/features/forms/utils.d.ts +4 -4
- package/dist/features/forms/utils.js +4 -4
- package/dist/features/homepage/components/AdSlot.js +1 -1
- package/dist/features/homepage/components/AdvertisementBanner.js +3 -3
- package/dist/features/homepage/components/BrandsSection.js +2 -2
- package/dist/features/homepage/components/GoogleReviewsSection.js +1 -1
- package/dist/features/homepage/components/HeroSection.js +1 -1
- package/dist/features/homepage/components/HomepageCustomerReviewsSection.js +1 -1
- package/dist/features/homepage/components/HowItWorksSection.js +1 -1
- package/dist/features/homepage/components/ShopByCategorySection.js +2 -2
- package/dist/features/homepage/components/SiteFeaturesSection.js +1 -1
- package/dist/features/homepage/components/SocialPostCard.js +1 -1
- package/dist/features/homepage/components/StatsCounterSection.js +1 -1
- package/dist/features/homepage/components/TrustIndicatorsSection.js +1 -1
- package/dist/features/homepage/constants/hero-carousel-styles.d.ts +3 -3
- package/dist/features/homepage/constants/hero-carousel-styles.js +3 -3
- package/dist/features/homepage/hooks/useActiveAd.d.ts +1 -3
- package/dist/features/homepage/hooks/useActiveAd.js +9 -17
- package/dist/features/layout/AppLayoutShell.js +12 -12
- package/dist/features/layout/AutoBreadcrumbs.js +1 -1
- package/dist/features/layout/BackToTop.js +2 -2
- package/dist/features/layout/BottomActions.js +8 -8
- package/dist/features/layout/BottomNavItem.js +1 -1
- package/dist/features/layout/BottomNavLayout.js +1 -1
- package/dist/features/layout/BottomNavbar.d.ts +1 -1
- package/dist/features/layout/BottomNavbar.js +2 -2
- package/dist/features/layout/BottomSheet.js +1 -1
- package/dist/features/layout/Breadcrumbs.js +2 -2
- package/dist/features/layout/FooterLayout.js +2 -2
- package/dist/features/layout/MainNavbar.js +1 -1
- package/dist/features/layout/NavItem.js +1 -1
- package/dist/features/layout/NavbarLayout.js +3 -3
- package/dist/features/layout/SidebarLayout.js +1 -1
- package/dist/features/layout/TitleBarLayout.js +3 -3
- package/dist/features/live/components/LiveItemsIndexListing.js +1 -1
- package/dist/features/loyalty/components/CoinsDisplay.js +1 -1
- package/dist/features/loyalty/hooks/useLoyaltyBalance.js +11 -3
- package/dist/features/media/AvatarUpload.js +1 -1
- package/dist/features/media/MediaPickerModal.js +1 -1
- package/dist/features/media/components/MediaSlider.js +1 -1
- package/dist/features/media/finalize.d.ts +12 -1
- package/dist/features/media/finalize.js +64 -11
- package/dist/features/media/modals/ImageCropModal.js +1 -1
- package/dist/features/media/modals/ImageEditor.js +1 -1
- package/dist/features/media/repository/media-assets.repository.d.ts +33 -0
- package/dist/features/media/repository/media-assets.repository.js +43 -0
- package/dist/features/media/upload/MediaUploadField.js +1 -1
- package/dist/features/messages/hooks/useConversation.js +12 -17
- package/dist/features/messages/hooks/useConversations.js +3 -5
- package/dist/features/orders/components/MarketplaceOrderCard.js +1 -1
- package/dist/features/orders/components/OrdersList.js +3 -3
- package/dist/features/pre-orders/components/MarketplacePreorderCard.js +1 -1
- package/dist/features/pre-orders/components/PreOrderBadge.js +1 -1
- package/dist/features/pre-orders/components/PreOrderDetailPageView.js +2 -2
- package/dist/features/pre-orders/components/PreOrdersIndexListing.js +1 -1
- package/dist/features/pre-orders/hooks/usePreOrders.js +12 -12
- package/dist/features/products/columns/productTableColumns.js +3 -3
- package/dist/features/products/components/BidHistory.js +1 -1
- package/dist/features/products/components/CompareOverlay.js +9 -9
- package/dist/features/products/components/CustomSectionTabContent.js +1 -1
- package/dist/features/products/components/CustomSectionsEditor.js +1 -1
- package/dist/features/products/components/FeatureBadge.js +2 -2
- package/dist/features/products/components/GroupSettingsPanel.js +2 -2
- package/dist/features/products/components/PrizeDrawDetailPageView.js +2 -2
- package/dist/features/products/components/PrizeDrawsIndexListing.js +1 -1
- package/dist/features/products/components/ProductDetailPageView.js +4 -4
- package/dist/features/products/components/ProductFeatureBadges.js +2 -2
- package/dist/features/products/components/ProductFeaturesSelector.js +4 -4
- package/dist/features/products/components/ProductGalleryClient.js +1 -1
- package/dist/features/products/components/ProductGrid.js +8 -8
- package/dist/features/products/components/ProductTabs.js +1 -1
- package/dist/features/products/components/ProductTabsShell.js +1 -1
- package/dist/features/products/components/ShareButton.js +1 -1
- package/dist/features/products/components/ShowGroupSection.js +2 -2
- package/dist/features/products/components/SublistingCarouselSection.js +2 -2
- package/dist/features/promotions/components/CouponCard.js +2 -2
- package/dist/features/promotions/components/CouponsIndexListing.js +2 -2
- package/dist/features/reviews/components/ReviewDetailPageView.js +1 -1
- package/dist/features/reviews/components/ReviewDetailShell.js +5 -5
- package/dist/features/reviews/components/ReviewModal.js +1 -1
- package/dist/features/reviews/components/ReviewSummary.js +2 -2
- package/dist/features/reviews/components/ReviewsIndexListing.js +1 -1
- package/dist/features/reviews/components/ReviewsList.js +2 -2
- package/dist/features/scams/components/ScamRegistryView.js +2 -2
- package/dist/features/search/components/Search.js +11 -11
- package/dist/features/search/components/SearchFiltersRow.js +1 -1
- package/dist/features/search/components/SearchResultsSection.js +2 -2
- package/dist/features/seller/components/SellerAddressesView.js +4 -4
- package/dist/features/seller/components/SellerAnalyticsAlertsView.js +1 -1
- package/dist/features/seller/components/SellerCouponEditorView.js +1 -1
- package/dist/features/seller/components/SellerCouponsView.js +1 -1
- package/dist/features/seller/components/SellerFeaturesView.js +2 -2
- package/dist/features/seller/components/SellerGoogleReviewsView.js +1 -1
- package/dist/features/seller/components/SellerOrdersView.js +1 -1
- package/dist/features/seller/components/SellerPayoutMethodsView.js +1 -1
- package/dist/features/seller/components/SellerSidebar.js +4 -4
- package/dist/features/seller/components/analytics/SellerRevenueChart.js +1 -1
- package/dist/features/seller/components/analytics/SellerTopProducts.js +1 -1
- package/dist/features/site-settings/components/ActionPermissionsManager.js +2 -2
- package/dist/features/site-settings/components/NavPermissionsManager.js +1 -1
- package/dist/features/stores/components/InteractiveStoreCard.js +3 -3
- package/dist/features/stores/components/StoreHeader.js +2 -2
- package/dist/features/stores/components/StoreNavTabs.js +2 -2
- package/dist/features/stores/components/StorePreOrdersListing.js +1 -1
- package/dist/features/stores/components/StoreReviewsListing.js +1 -1
- package/dist/features/stores/components/StoresIndexListing.js +1 -1
- package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +2 -2
- package/dist/features/wishlist/components/WishlistPage.js +2 -2
- package/dist/features/wishlist/hooks/useWishlistCount.js +5 -13
- package/dist/http/index.d.ts +1 -0
- package/dist/http/index.js +1 -0
- package/dist/http/retry.d.ts +1 -0
- package/dist/http/retry.js +26 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +8 -0
- package/dist/next/ErrorBoundary.js +1 -1
- package/dist/repositories/index.d.ts +2 -0
- package/dist/repositories/index.js +2 -0
- package/dist/seed/site-settings-seed-data.js +476 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.js +9 -0
- package/dist/styles.css +1 -1
- package/dist/tailwind-utilities.css +1 -1
- package/dist/tokens/index.d.ts +6 -6
- package/dist/tokens/index.js +59 -59
- package/dist/ui/DataTable.js +3 -3
- package/dist/ui/components/Avatar.js +1 -1
- package/dist/ui/components/BaseListingCard.js +7 -7
- package/dist/ui/components/Button.js +3 -3
- package/dist/ui/components/DetailPageGallery.js +3 -3
- package/dist/ui/components/DetailPageHero.js +1 -1
- package/dist/ui/components/DetailPageTabs.js +4 -4
- package/dist/ui/components/FilterChipGroup.js +2 -2
- package/dist/ui/components/Input.js +1 -1
- package/dist/ui/components/Layout.d.ts +2 -2
- package/dist/ui/components/ListingFilterDrawer.js +2 -2
- package/dist/ui/components/ListingToolbar.js +6 -6
- package/dist/ui/components/LoginRequiredModal.js +1 -1
- package/dist/ui/components/Modal.js +1 -1
- package/dist/ui/components/NavbarChevron.js +1 -1
- package/dist/ui/components/PageLoader.js +3 -3
- package/dist/ui/components/Radio.js +1 -1
- package/dist/ui/components/RichTextEditor.js +1 -1
- package/dist/ui/components/Select.js +1 -1
- package/dist/ui/components/SettingsSection.js +3 -3
- package/dist/ui/components/SideModal.js +1 -1
- package/dist/ui/components/Slider.js +2 -2
- package/dist/ui/components/StatsGrid.js +1 -1
- package/dist/ui/components/Typography.js +3 -3
- package/dist/ui/components/surface-tokens.d.ts +11 -11
- package/dist/ui/components/surface-tokens.js +12 -12
- package/dist/utils/safe-fire-forget.d.ts +14 -0
- package/dist/utils/safe-fire-forget.js +23 -0
- package/package.json +1 -1
|
@@ -73,7 +73,7 @@ export function Modal({ isOpen, open, onClose, title, children, size = "md", sho
|
|
|
73
73
|
}
|
|
74
74
|
export function ModalFooter({ children, className = "", }) {
|
|
75
75
|
return (_jsx("div", { className: [
|
|
76
|
-
"flex items-center justify-end gap-3 border-t border-zinc-100 px-6 py-4
|
|
76
|
+
"flex items-center justify-end gap-3 border-t border-zinc-100 px-6 py-4 border-[var(--appkit-color-border-subtle)]",
|
|
77
77
|
className,
|
|
78
78
|
]
|
|
79
79
|
.filter(Boolean)
|
|
@@ -7,7 +7,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
7
7
|
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
8
8
|
// navbar's overflow-scroll fade — the gradient classes implement the
|
|
9
9
|
// edge-fade affordance, not consumer styling.
|
|
10
|
-
const BASE_CLS = "absolute top-0 bottom-0 z-10 flex items-center justify-center w-8 text-
|
|
10
|
+
const BASE_CLS = "absolute top-0 bottom-0 z-10 flex items-center justify-center w-8 text-[var(--appkit-color-text-muted)] hover:text-zinc-900 dark:hover:text-white transition-colors";
|
|
11
11
|
const FADE_LEFT = "bg-gradient-to-r from-white/95 dark:from-slate-950/95 to-transparent";
|
|
12
12
|
const FADE_RIGHT = "bg-gradient-to-l from-white/95 dark:from-slate-950/95 to-transparent";
|
|
13
13
|
export function NavbarChevron({ direction, onClick }) {
|
|
@@ -13,10 +13,10 @@ export function PageLoader({ children }) {
|
|
|
13
13
|
if (!children) {
|
|
14
14
|
// No skeleton — simple centred spinner / timeout message
|
|
15
15
|
if (timedOut) {
|
|
16
|
-
return (_jsxs("div", { className: "flex min-h-[60vh] flex-col items-center justify-center gap-4 p-8 text-center", children: [_jsx(Text, { className: "text-base font-medium text-
|
|
16
|
+
return (_jsxs("div", { className: "flex min-h-[60vh] flex-col items-center justify-center gap-4 p-8 text-center", children: [_jsx(Text, { className: "text-base font-medium text-[var(--appkit-color-text-muted)]", children: "Something went wrong. Please refresh the page." }), _jsx(Button, { variant: "secondary", onClick: () => window.location.reload(), children: "Refresh" })] }));
|
|
17
17
|
}
|
|
18
|
-
return (_jsxs("div", { className: "flex min-h-[60vh] flex-col items-center justify-center gap-3", children: [_jsx(Spinner, { size: "lg" }), _jsx(Text, { className: "text-sm text-
|
|
18
|
+
return (_jsxs("div", { className: "flex min-h-[60vh] flex-col items-center justify-center gap-3", children: [_jsx(Spinner, { size: "lg" }), _jsx(Text, { className: "text-sm text-[var(--appkit-color-text-muted)]", children: "Loading\u2026" })] }));
|
|
19
19
|
}
|
|
20
20
|
// Skeleton provided — render it behind a floating overlay
|
|
21
|
-
return (_jsxs("div", { className: "relative", children: [_jsx("div", { "aria-hidden": "true", children: children }), _jsx("div", { className: "pointer-events-none fixed inset-0 z-50 flex flex-col items-center justify-center gap-4 bg-white/60 p-8 text-center backdrop-blur-sm
|
|
21
|
+
return (_jsxs("div", { className: "relative", children: [_jsx("div", { "aria-hidden": "true", children: children }), _jsx("div", { className: "pointer-events-none fixed inset-0 z-50 flex flex-col items-center justify-center gap-4 bg-white/60 p-8 text-center backdrop-blur-sm bg-[var(--appkit-color-surface)]/60", children: timedOut ? (_jsxs(_Fragment, { children: [_jsx(Text, { className: "text-base font-medium text-[var(--appkit-color-text-muted)]", children: "Something went wrong. Please refresh the page." }), _jsx("div", { className: "pointer-events-auto", children: _jsx(Button, { variant: "secondary", onClick: () => window.location.reload(), children: "Refresh" }) })] })) : (_jsxs(_Fragment, { children: [_jsx(Spinner, { size: "lg" }), _jsx(Text, { className: "text-sm text-[var(--appkit-color-text-muted)]", children: "Loading\u2026" })] })) })] }));
|
|
22
22
|
}
|
|
@@ -44,7 +44,7 @@ export function RadioGroup({ name, options, value, onChange, label, error, orien
|
|
|
44
44
|
].join(" ") }), _jsx("span", { className: [
|
|
45
45
|
UI_RADIO.classic.dot,
|
|
46
46
|
selected ? UI_RADIO.classic.dotSelected : "",
|
|
47
|
-
].join(" ") })] }), _jsx(Span, { size: "sm", className: "text-
|
|
47
|
+
].join(" ") })] }), _jsx(Span, { size: "sm", className: "text-[var(--appkit-color-text-muted)]", children: option.label })] }, option.value));
|
|
48
48
|
}
|
|
49
49
|
return (_jsxs("label", { className: [
|
|
50
50
|
UI_RADIO.toggle.base,
|
|
@@ -55,5 +55,5 @@ export function RichTextEditor({ value, onChange, disabled = false, className =
|
|
|
55
55
|
editor.innerHTML = value;
|
|
56
56
|
}
|
|
57
57
|
}, [value]);
|
|
58
|
-
return (_jsxs("div", { className: `appkit-rich-text-editor rounded-lg border border-zinc-200 bg-
|
|
58
|
+
return (_jsxs("div", { className: `appkit-rich-text-editor rounded-lg border border-zinc-200 bg-[var(--appkit-color-surface)] border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)] ${className}`, "data-section": "richtexteditor-div-582", children: [_jsx("div", { className: "appkit-rich-text-editor__toolbar flex flex-wrap gap-1 border-b border-zinc-200 p-2 border-[var(--appkit-color-border)]", "data-section": "richtexteditor-div-583", children: toolbarActions.map((action) => (_jsx("button", { type: "button", title: action.title, onClick: action.run, disabled: disabled, className: "appkit-rich-text-editor__btn rounded px-2 py-1 text-xs font-medium text-zinc-700 transition hover:bg-zinc-50 disabled:cursor-not-allowed disabled:opacity-50 text-[var(--appkit-color-text-muted)] hover:bg-[var(--appkit-color-surface-elevated)]", children: action.label }, action.title))) }), _jsx("div", { ref: editorRef, role: "textbox", "aria-label": "Rich text editor", contentEditable: !disabled, suppressContentEditableWarning: true, "data-placeholder": placeholder, onInput: emitChange, onBlur: emitChange, className: `prose prose-sm max-w-none p-3 focus:outline-none dark:prose-invert ${minHeightClassName} ${disabled ? "cursor-not-allowed opacity-70" : ""}` })] }));
|
|
59
59
|
}
|
|
@@ -24,5 +24,5 @@ export function Select({ options, value, onChange, onValueChange, placeholder, l
|
|
|
24
24
|
className,
|
|
25
25
|
]
|
|
26
26
|
.filter(Boolean)
|
|
27
|
-
.join(" "), children: [placeholder ? (_jsx("option", { value: "", disabled: true, children: placeholder })) : null, options.map((option) => (_jsx("option", { value: option.value, disabled: option.disabled, children: option.label }, String(option.value))))] }), _jsx(Div, { className: "pointer-events-none absolute inset-y-0 right-3 flex items-center text-
|
|
27
|
+
.join(" "), children: [placeholder ? (_jsx("option", { value: "", disabled: true, children: placeholder })) : null, options.map((option) => (_jsx("option", { value: option.value, disabled: option.disabled, children: option.label }, String(option.value))))] }), _jsx(Div, { className: "pointer-events-none absolute inset-y-0 right-3 flex items-center text-[var(--appkit-color-text-faint)]", "data-section": "select-div-594", children: _jsx("svg", { className: "h-4 w-4", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: _jsx("path", { fillRule: "evenodd", d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z", clipRule: "evenodd" }) }) })] }), error ? (_jsx(Text, { size: "sm", variant: "error", className: "appkit-select__error", role: "alert", children: error })) : helperText ? (_jsx(Text, { size: "sm", variant: "secondary", className: "appkit-select__error", children: helperText })) : null] }));
|
|
28
28
|
}
|
|
@@ -13,11 +13,11 @@ import { Toggle } from "./Toggle";
|
|
|
13
13
|
export function SettingsSection({ title, description, action, children, className, }) {
|
|
14
14
|
return (_jsxs("section", { className: [
|
|
15
15
|
"appkit-settings-section",
|
|
16
|
-
"space-y-3 rounded-lg border border-
|
|
16
|
+
"space-y-3 rounded-lg border border-[var(--appkit-color-border)] p-4",
|
|
17
17
|
className,
|
|
18
18
|
]
|
|
19
19
|
.filter(Boolean)
|
|
20
|
-
.join(" "), children: [_jsxs("header", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "flex-1 min-w-0", children: [_jsx(Heading, { level: 3, className: "text-base font-semibold text-
|
|
20
|
+
.join(" "), children: [_jsxs("header", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "flex-1 min-w-0", children: [_jsx(Heading, { level: 3, className: "text-base font-semibold text-[var(--appkit-color-text)]", children: title }), description ? (_jsx(Text, { className: "mt-1 text-sm text-[var(--appkit-color-text-muted)]", children: description })) : null] }), action ? _jsx("div", { className: "flex-shrink-0", children: action }) : null] }), _jsx("div", { className: "space-y-3", children: children })] }));
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* `ToggleRow` — a labelled toggle with optional description, used wherever a
|
|
@@ -34,5 +34,5 @@ export function ToggleRow({ label, description, checked, onChange, disabled = fa
|
|
|
34
34
|
className,
|
|
35
35
|
]
|
|
36
36
|
.filter(Boolean)
|
|
37
|
-
.join(" "), children: [_jsxs("div", { className: "flex-1 min-w-0", children: [_jsx(Text, { className: "text-sm font-medium text-
|
|
37
|
+
.join(" "), children: [_jsxs("div", { className: "flex-1 min-w-0", children: [_jsx(Text, { className: "text-sm font-medium text-[var(--appkit-color-text)]", children: label }), description ? (_jsx(Text, { className: "mt-0.5 text-xs text-[var(--appkit-color-text-muted)]", children: description })) : null] }), _jsx("div", { className: "flex-shrink-0 pt-0.5", children: _jsx(Toggle, { checked: checked, onChange: onChange, disabled: disabled, size: size }) })] }));
|
|
38
38
|
}
|
|
@@ -58,5 +58,5 @@ export function SideModal({ isOpen, onClose, title, side = "right", children, cl
|
|
|
58
58
|
className,
|
|
59
59
|
]
|
|
60
60
|
.filter(Boolean)
|
|
61
|
-
.join(" "), initial: reduced ? false : { x: slideX }, animate: { x: 0 }, exit: { x: slideX }, transition: SPRING_SNAPPY, children: [title && (_jsxs(Div, { className: "appkit-side-modal__header", children: [_jsx(Heading, { level: 2, id: titleId.current, className: "text-base font-semibold text-
|
|
61
|
+
.join(" "), initial: reduced ? false : { x: slideX }, animate: { x: 0 }, exit: { x: slideX }, transition: SPRING_SNAPPY, children: [title && (_jsxs(Div, { className: "appkit-side-modal__header", children: [_jsx(Heading, { level: 2, id: titleId.current, className: "text-base font-semibold text-[var(--appkit-color-text)] dark:text-white truncate", children: title }), _jsx(Button, { variant: "ghost", size: "sm", onClick: onClose, "aria-label": "Close panel", className: "ml-2 flex-shrink-0", children: "\u2715" })] })), _jsx(Div, { className: "appkit-side-modal__body", children: children })] })] })) }));
|
|
62
62
|
}
|
|
@@ -24,8 +24,8 @@ export function Slider({ value: controlledValue, defaultValue = 0, min = 0, max
|
|
|
24
24
|
const handleChangeEnd = () => {
|
|
25
25
|
onChangeEnd?.(value);
|
|
26
26
|
};
|
|
27
|
-
return (_jsxs("div", { className: ["w-full", className].filter(Boolean).join(" "), "data-section": "slider-div-607", children: [(label || showValue) && (_jsxs("div", { className: "mb-2 flex items-center justify-between gap-3", "data-section": "slider-div-608", children: [label ? _jsx(Label, { htmlFor: inputId, children: label }) : _jsx("span", {}), showValue ? (_jsx(Span, { size: "sm", className: "tabular-nums text-
|
|
28
|
-
"pointer-events-none absolute inset-x-0 top-1/2 -translate-y-1/2 overflow-hidden rounded-full bg-zinc-200
|
|
27
|
+
return (_jsxs("div", { className: ["w-full", className].filter(Boolean).join(" "), "data-section": "slider-div-607", children: [(label || showValue) && (_jsxs("div", { className: "mb-2 flex items-center justify-between gap-3", "data-section": "slider-div-608", children: [label ? _jsx(Label, { htmlFor: inputId, children: label }) : _jsx("span", {}), showValue ? (_jsx(Span, { size: "sm", className: "tabular-nums text-[var(--appkit-color-text-muted)]", children: value })) : null] })), _jsxs("div", { className: "relative", "data-section": "slider-div-609", children: [_jsx("div", { "aria-hidden": "true", className: [
|
|
28
|
+
"pointer-events-none absolute inset-x-0 top-1/2 -translate-y-1/2 overflow-hidden rounded-full bg-zinc-200 bg-[var(--appkit-color-border)]",
|
|
29
29
|
SIZE_CLASSES[size],
|
|
30
30
|
].join(" "), "data-section": "slider-div-610", children: _jsx("div", { className: [
|
|
31
31
|
"h-full rounded-full bg-lime-600 dark:bg-pink-500",
|
|
@@ -12,5 +12,5 @@ const variantClass = {
|
|
|
12
12
|
flat: "appkit-stats-grid--flat",
|
|
13
13
|
};
|
|
14
14
|
export function StatsGrid({ stats, columns = 3, variant = "elevated", className, }) {
|
|
15
|
-
return (_jsx(Div, { className: classNames("appkit-stats-grid", columnsClass[columns], variantClass[variant], className), children: stats.map((stat, i) => (_jsx(Div, { className: "appkit-stats-grid__item", children: _jsxs(Div, { className: "appkit-stats-grid__item-inner", children: [_jsxs(Div, { children: [_jsx(Text, { className: "appkit-stats-grid__label", children: stat.label }), _jsx(Text, { className: "appkit-stats-grid__value", children: stat.value })] }), stat.icon && (_jsx(Div, { className: classNames("appkit-stats-grid__icon", stat.colorClass ?? "text-
|
|
15
|
+
return (_jsx(Div, { className: classNames("appkit-stats-grid", columnsClass[columns], variantClass[variant], className), children: stats.map((stat, i) => (_jsx(Div, { className: "appkit-stats-grid__item", children: _jsxs(Div, { className: "appkit-stats-grid__item-inner", children: [_jsxs(Div, { children: [_jsx(Text, { className: "appkit-stats-grid__label", children: stat.label }), _jsx(Text, { className: "appkit-stats-grid__value", children: stat.value })] }), stat.icon && (_jsx(Div, { className: classNames("appkit-stats-grid__icon", stat.colorClass ?? "text-[var(--appkit-color-text-faint)]"), children: stat.icon }))] }) }, `${stat.label}-${i}`))) }));
|
|
16
16
|
}
|
|
@@ -215,9 +215,9 @@ export function Caption({ variant = "default", color, weight, className = "", ch
|
|
|
215
215
|
}
|
|
216
216
|
const SPAN_BORDER_MAP = {
|
|
217
217
|
none: "",
|
|
218
|
-
default: "border border-
|
|
219
|
-
subtle: "border border-
|
|
220
|
-
strong: "border border-
|
|
218
|
+
default: "border border-[var(--appkit-color-border)]",
|
|
219
|
+
subtle: "border border-[var(--appkit-color-border-subtle)]",
|
|
220
|
+
strong: "border border-[var(--appkit-color-border)]",
|
|
221
221
|
};
|
|
222
222
|
const SPAN_ROUNDED_MAP = {
|
|
223
223
|
none: "",
|
|
@@ -26,8 +26,8 @@ export declare const SURFACE_MAP: {
|
|
|
26
26
|
readonly "overlay-md": "bg-black/55";
|
|
27
27
|
readonly "overlay-lg": "bg-black/60";
|
|
28
28
|
readonly "overlay-xl": "bg-black/70";
|
|
29
|
-
readonly skeleton: "bg-
|
|
30
|
-
readonly "skeleton-light": "bg-
|
|
29
|
+
readonly skeleton: "bg-[var(--appkit-color-border)]";
|
|
30
|
+
readonly "skeleton-light": "bg-[var(--appkit-color-border-subtle)]";
|
|
31
31
|
};
|
|
32
32
|
export type SurfaceKey = keyof typeof SURFACE_MAP;
|
|
33
33
|
export declare const PADDING_MAP: {
|
|
@@ -100,16 +100,16 @@ export declare const ROUNDED_MAP: {
|
|
|
100
100
|
export type RoundedKey = keyof typeof ROUNDED_MAP;
|
|
101
101
|
export declare const BORDER_MAP: {
|
|
102
102
|
readonly none: "";
|
|
103
|
-
readonly default: "border border-
|
|
104
|
-
readonly subtle: "border border-
|
|
105
|
-
readonly strong: "border border-
|
|
106
|
-
readonly dashed: "border border-dashed border-
|
|
107
|
-
readonly bottom: "border-b border-
|
|
108
|
-
readonly "bottom-subtle": "border-b border-
|
|
109
|
-
readonly top: "border-t border-
|
|
110
|
-
readonly "top-subtle": "border-t border-
|
|
103
|
+
readonly default: "border border-[var(--appkit-color-border)]";
|
|
104
|
+
readonly subtle: "border border-[var(--appkit-color-border-subtle)]";
|
|
105
|
+
readonly strong: "border border-[var(--appkit-color-border)]";
|
|
106
|
+
readonly dashed: "border border-dashed border-[var(--appkit-color-border)]";
|
|
107
|
+
readonly bottom: "border-b border-[var(--appkit-color-border)]";
|
|
108
|
+
readonly "bottom-subtle": "border-b border-[var(--appkit-color-border-subtle)]";
|
|
109
|
+
readonly top: "border-t border-[var(--appkit-color-border)]";
|
|
110
|
+
readonly "top-subtle": "border-t border-[var(--appkit-color-border-subtle)]";
|
|
111
111
|
/** 2px border for skeleton placeholder cards. */
|
|
112
|
-
readonly skeleton: "border-2 border-
|
|
112
|
+
readonly skeleton: "border-2 border-[var(--appkit-color-border-subtle)]";
|
|
113
113
|
};
|
|
114
114
|
export type BorderKey = keyof typeof BORDER_MAP;
|
|
115
115
|
export declare const SHADOW_MAP: {
|
|
@@ -31,9 +31,9 @@ export const SURFACE_MAP = {
|
|
|
31
31
|
"overlay-md": "bg-black/55",
|
|
32
32
|
"overlay-lg": "bg-black/60",
|
|
33
33
|
"overlay-xl": "bg-black/70",
|
|
34
|
-
// Skeleton loader presets —
|
|
35
|
-
skeleton: "bg-
|
|
36
|
-
"skeleton-light": "bg-
|
|
34
|
+
// Skeleton loader presets — theme-adaptive via CSS variables.
|
|
35
|
+
skeleton: "bg-[var(--appkit-color-border)]",
|
|
36
|
+
"skeleton-light": "bg-[var(--appkit-color-border-subtle)]",
|
|
37
37
|
};
|
|
38
38
|
export const PADDING_MAP = {
|
|
39
39
|
none: "",
|
|
@@ -132,16 +132,16 @@ const ROUNDED_BOTTOM_MAP = {
|
|
|
132
132
|
};
|
|
133
133
|
export const BORDER_MAP = {
|
|
134
134
|
none: "",
|
|
135
|
-
default: "border border-
|
|
136
|
-
subtle: "border border-
|
|
137
|
-
strong: "border border-
|
|
138
|
-
dashed: "border border-dashed border-
|
|
139
|
-
bottom: "border-b border-
|
|
140
|
-
"bottom-subtle": "border-b border-
|
|
141
|
-
top: "border-t border-
|
|
142
|
-
"top-subtle": "border-t border-
|
|
135
|
+
default: "border border-[var(--appkit-color-border)]",
|
|
136
|
+
subtle: "border border-[var(--appkit-color-border-subtle)]",
|
|
137
|
+
strong: "border border-[var(--appkit-color-border)]",
|
|
138
|
+
dashed: "border border-dashed border-[var(--appkit-color-border)]",
|
|
139
|
+
bottom: "border-b border-[var(--appkit-color-border)]",
|
|
140
|
+
"bottom-subtle": "border-b border-[var(--appkit-color-border-subtle)]",
|
|
141
|
+
top: "border-t border-[var(--appkit-color-border)]",
|
|
142
|
+
"top-subtle": "border-t border-[var(--appkit-color-border-subtle)]",
|
|
143
143
|
/** 2px border for skeleton placeholder cards. */
|
|
144
|
-
"skeleton": "border-2 border-
|
|
144
|
+
"skeleton": "border-2 border-[var(--appkit-color-border-subtle)]",
|
|
145
145
|
};
|
|
146
146
|
export const SHADOW_MAP = {
|
|
147
147
|
none: "",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs a non-critical promise in the background without blocking the caller.
|
|
3
|
+
*
|
|
4
|
+
* Use instead of `.catch(console.error)` for fire-and-forget operations
|
|
5
|
+
* (view counters, audit logs, cache invalidations, RTDB cleanup) where the
|
|
6
|
+
* caller must not fail even if the operation does.
|
|
7
|
+
*
|
|
8
|
+
* The operation's failure is logged at WARN level with the provided context
|
|
9
|
+
* label so on-call engineers can find it in structured logs.
|
|
10
|
+
*
|
|
11
|
+
* @param promise Already-started async operation.
|
|
12
|
+
* @param context Short label identifying the operation for log search (e.g. "blog: incrementViews").
|
|
13
|
+
*/
|
|
14
|
+
export declare function safeFireAndForget(promise: Promise<unknown>, context: string): void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { normalizeError } from "../errors/normalize";
|
|
2
|
+
import { serverLogger } from "../monitoring/server-logger";
|
|
3
|
+
/**
|
|
4
|
+
* Runs a non-critical promise in the background without blocking the caller.
|
|
5
|
+
*
|
|
6
|
+
* Use instead of `.catch(console.error)` for fire-and-forget operations
|
|
7
|
+
* (view counters, audit logs, cache invalidations, RTDB cleanup) where the
|
|
8
|
+
* caller must not fail even if the operation does.
|
|
9
|
+
*
|
|
10
|
+
* The operation's failure is logged at WARN level with the provided context
|
|
11
|
+
* label so on-call engineers can find it in structured logs.
|
|
12
|
+
*
|
|
13
|
+
* @param promise Already-started async operation.
|
|
14
|
+
* @param context Short label identifying the operation for log search (e.g. "blog: incrementViews").
|
|
15
|
+
*/
|
|
16
|
+
export function safeFireAndForget(promise, context) {
|
|
17
|
+
promise.catch((err) => {
|
|
18
|
+
void normalizeError(err);
|
|
19
|
+
serverLogger.warn(`safeFireAndForget: ${context} failed (non-critical, caller unaffected)`, {
|
|
20
|
+
error: err instanceof Error ? err.message : String(err),
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
}
|