@mohasinac/appkit 3.2.8 → 3.2.10
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 +12 -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/providers/storage-firebase/provider.js +109 -55
- 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
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
* const load = makeCategoryLoadOptions();
|
|
10
10
|
* <AsyncFacetSection loadOptions={load} ... />
|
|
11
11
|
*/
|
|
12
|
+
import { apiClient } from "../../../../http/ApiClient";
|
|
13
|
+
import { normalizeError } from "../../../../errors/normalize";
|
|
12
14
|
const PAGE_SIZE = 25;
|
|
13
15
|
function buildUrl(base, q, page, extra) {
|
|
14
16
|
const params = new URLSearchParams({
|
|
@@ -20,16 +22,17 @@ function buildUrl(base, q, page, extra) {
|
|
|
20
22
|
return `${base}?${params.toString()}`;
|
|
21
23
|
}
|
|
22
24
|
async function fetchPage(url, mapItem) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
try {
|
|
26
|
+
const data = await apiClient.get(url);
|
|
27
|
+
return {
|
|
28
|
+
items: (data?.items ?? []).map(mapItem),
|
|
29
|
+
hasMore: data?.hasMore ?? false,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
catch (_err) {
|
|
33
|
+
void normalizeError(_err); // PaginatedSelect degrades to empty page; caller can retry by re-typing
|
|
25
34
|
return { items: [], hasMore: false };
|
|
26
|
-
|
|
27
|
-
const raw = json.data?.items ?? [];
|
|
28
|
-
const hasMore = json.data?.hasMore ?? false;
|
|
29
|
-
return {
|
|
30
|
-
items: raw.map(mapItem),
|
|
31
|
-
hasMore,
|
|
32
|
-
};
|
|
35
|
+
}
|
|
33
36
|
}
|
|
34
37
|
// ── Categories ────────────────────────────────────────────────────────────────
|
|
35
38
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { normalizeError } from "../../../errors/normalize";
|
|
3
4
|
import { createContext, useCallback, useContext, useEffect, useMemo, useState, } from "react";
|
|
4
5
|
import { BUILT_IN_THEMES, DEFAULT_DARK_THEME, DEFAULT_LIGHT_THEME, } from "../../../tokens/themes";
|
|
5
6
|
// Brand-neutral localStorage namespace so consumers other than letitrip can
|
|
@@ -16,8 +17,8 @@ function readModePreference() {
|
|
|
16
17
|
if (stored === "light" || stored === "dark" || stored === "auto")
|
|
17
18
|
return stored;
|
|
18
19
|
}
|
|
19
|
-
catch {
|
|
20
|
-
/* localStorage
|
|
20
|
+
catch (_err) {
|
|
21
|
+
void normalizeError(_err); /* localStorage unavailable in privacy/iframe context */
|
|
21
22
|
}
|
|
22
23
|
return "auto";
|
|
23
24
|
}
|
|
@@ -37,6 +38,7 @@ function pickTheme(registry, mode) {
|
|
|
37
38
|
// its mode mismatches (e.g. admin pointed defaultLightThemeId at a dark theme).
|
|
38
39
|
return mode === "dark" ? DEFAULT_DARK_THEME : DEFAULT_LIGHT_THEME;
|
|
39
40
|
}
|
|
41
|
+
const THEME_ID_STORAGE_KEY = "appkit:theme-id";
|
|
40
42
|
/** Apply a theme record to `<html>` by setting `data-theme` and inline CSS variables. */
|
|
41
43
|
function applyTheme(theme) {
|
|
42
44
|
if (typeof document === "undefined")
|
|
@@ -48,6 +50,14 @@ function applyTheme(theme) {
|
|
|
48
50
|
root.classList.add("dark");
|
|
49
51
|
else
|
|
50
52
|
root.classList.remove("dark");
|
|
53
|
+
// Persist active theme ID so the anti-FOUC script can restore it on return visits,
|
|
54
|
+
// preventing a flash to the built-in cobalt/hot-pink colors on page load.
|
|
55
|
+
try {
|
|
56
|
+
window.localStorage.setItem(THEME_ID_STORAGE_KEY, theme.id);
|
|
57
|
+
}
|
|
58
|
+
catch (_err) {
|
|
59
|
+
void normalizeError(_err); /* localStorage unavailable in this context */
|
|
60
|
+
}
|
|
51
61
|
for (const [name, value] of Object.entries(theme.tokens)) {
|
|
52
62
|
root.style.setProperty(`--${name}`, value);
|
|
53
63
|
}
|
|
@@ -87,8 +97,8 @@ export function ThemeProvider({ registry, children }) {
|
|
|
87
97
|
try {
|
|
88
98
|
window.localStorage.setItem(MODE_STORAGE_KEY, next);
|
|
89
99
|
}
|
|
90
|
-
catch {
|
|
91
|
-
/*
|
|
100
|
+
catch (_err) {
|
|
101
|
+
void normalizeError(_err); /* localStorage unavailable; preference applies for this session */
|
|
92
102
|
}
|
|
93
103
|
}, []);
|
|
94
104
|
const setTheme = useCallback((mode) => setPreference(mode), [setPreference]);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type IdentityOperation = "signInWithPassword" | "signInWithCustomToken";
|
|
2
|
+
/**
|
|
3
|
+
* Calls the Firebase Identity Toolkit REST API with one retry for transient
|
|
4
|
+
* network failures. Throws a plain Error (message from the API) on non-2xx.
|
|
5
|
+
*
|
|
6
|
+
* Both auth routes (login + register) hit this endpoint to exchange
|
|
7
|
+
* credentials / custom tokens for a Firebase ID token that can be converted
|
|
8
|
+
* into a session cookie. Centralised here so the URL, Content-Type, and retry
|
|
9
|
+
* config are in one place.
|
|
10
|
+
*/
|
|
11
|
+
export declare function callFirebaseIdentityToolkit<T extends Record<string, unknown>>(operation: IdentityOperation, body: Record<string, unknown>, apiKey: string): Promise<T>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { withRetry } from "../../../../http/retry";
|
|
2
|
+
const IDENTITY_TOOLKIT_BASE = "https://identitytoolkit.googleapis.com/v1/accounts";
|
|
3
|
+
/**
|
|
4
|
+
* Calls the Firebase Identity Toolkit REST API with one retry for transient
|
|
5
|
+
* network failures. Throws a plain Error (message from the API) on non-2xx.
|
|
6
|
+
*
|
|
7
|
+
* Both auth routes (login + register) hit this endpoint to exchange
|
|
8
|
+
* credentials / custom tokens for a Firebase ID token that can be converted
|
|
9
|
+
* into a session cookie. Centralised here so the URL, Content-Type, and retry
|
|
10
|
+
* config are in one place.
|
|
11
|
+
*/
|
|
12
|
+
export async function callFirebaseIdentityToolkit(operation, body, apiKey) {
|
|
13
|
+
const url = `${IDENTITY_TOOLKIT_BASE}:${operation}?key=${encodeURIComponent(apiKey)}`;
|
|
14
|
+
const res = await withRetry(() => fetch(url, {
|
|
15
|
+
method: "POST",
|
|
16
|
+
headers: { "Content-Type": "application/json" },
|
|
17
|
+
body: JSON.stringify(body),
|
|
18
|
+
}), 1, 500);
|
|
19
|
+
const data = (await res.json());
|
|
20
|
+
if (!res.ok) {
|
|
21
|
+
throw new Error(data.error?.message ??
|
|
22
|
+
`Firebase Identity Toolkit ${operation} failed (${res.status})`);
|
|
23
|
+
}
|
|
24
|
+
return data;
|
|
25
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SiteSettingsDocument } from "../../../../features/admin/schemas/firestore";
|
|
2
|
+
/**
|
|
3
|
+
* Null-safe wrapper around getSiteSettingsGlobal().
|
|
4
|
+
*
|
|
5
|
+
* Use in API routes and server actions that can degrade gracefully when
|
|
6
|
+
* site settings are unavailable (feature flags, watermark config, etc.).
|
|
7
|
+
* Returns null on Firestore failure; the caller decides the fallback.
|
|
8
|
+
*
|
|
9
|
+
* For paths where missing settings are a hard error (e.g. billing config),
|
|
10
|
+
* call getSiteSettingsGlobal() directly so the 500 propagates naturally.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getSiteSettingsSafe(): Promise<SiteSettingsDocument | null>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { normalizeError } from "../../../../errors/normalize";
|
|
2
|
+
import { serverLogger } from "../../../../monitoring/server-logger";
|
|
3
|
+
import { getSiteSettingsGlobal } from "../../../../features/admin/utils/getSiteSettingsGlobal";
|
|
4
|
+
/**
|
|
5
|
+
* Null-safe wrapper around getSiteSettingsGlobal().
|
|
6
|
+
*
|
|
7
|
+
* Use in API routes and server actions that can degrade gracefully when
|
|
8
|
+
* site settings are unavailable (feature flags, watermark config, etc.).
|
|
9
|
+
* Returns null on Firestore failure; the caller decides the fallback.
|
|
10
|
+
*
|
|
11
|
+
* For paths where missing settings are a hard error (e.g. billing config),
|
|
12
|
+
* call getSiteSettingsGlobal() directly so the 500 propagates naturally.
|
|
13
|
+
*/
|
|
14
|
+
export async function getSiteSettingsSafe() {
|
|
15
|
+
try {
|
|
16
|
+
return await getSiteSettingsGlobal();
|
|
17
|
+
}
|
|
18
|
+
catch (err) {
|
|
19
|
+
void normalizeError(err);
|
|
20
|
+
serverLogger.warn("getSiteSettingsSafe: Firestore read failed — degrading to null", {
|
|
21
|
+
error: err instanceof Error ? err.message : String(err),
|
|
22
|
+
});
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -18,19 +18,19 @@ export const DASHBOARD_SIDEBAR_WIDTH = {
|
|
|
18
18
|
/** Per-variant accent token map. Drives DashboardSidebar active-item styling. */
|
|
19
19
|
export const DASHBOARD_ACCENT_CLASSES = {
|
|
20
20
|
admin: {
|
|
21
|
-
activeBg: "bg-
|
|
22
|
-
activeText: "text-
|
|
23
|
-
hoverBg: "hover:bg-
|
|
21
|
+
activeBg: "bg-[var(--appkit-color-surface-elevated)]",
|
|
22
|
+
activeText: "text-[var(--appkit-color-text)]",
|
|
23
|
+
hoverBg: "hover:bg-[var(--appkit-color-surface)]",
|
|
24
24
|
},
|
|
25
25
|
store: {
|
|
26
|
-
activeBg: "bg-warning-surface
|
|
27
|
-
activeText: "text-warning
|
|
28
|
-
hoverBg: "hover:bg-
|
|
26
|
+
activeBg: "bg-warning-surface",
|
|
27
|
+
activeText: "text-warning",
|
|
28
|
+
hoverBg: "hover:bg-[var(--appkit-color-surface)]",
|
|
29
29
|
},
|
|
30
30
|
user: {
|
|
31
31
|
activeBg: "bg-primary-50 dark:bg-primary-900/25",
|
|
32
32
|
activeText: "text-primary-700 dark:text-primary-300",
|
|
33
|
-
hoverBg: "hover:bg-
|
|
33
|
+
hoverBg: "hover:bg-[var(--appkit-color-surface)]",
|
|
34
34
|
},
|
|
35
35
|
};
|
|
36
36
|
/** hideAt → Tailwind class. `md:hidden` etc. */
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* shimmer (animate-shimmer + gradient).
|
|
6
6
|
*/
|
|
7
7
|
export declare const SKELETON: {
|
|
8
|
-
readonly base: "animate-pulse rounded bg-
|
|
9
|
-
readonly text: "animate-pulse rounded bg-
|
|
10
|
-
readonly heading: "animate-pulse rounded bg-
|
|
11
|
-
readonly image: "animate-pulse rounded-xl bg-
|
|
12
|
-
readonly card: "animate-pulse rounded-2xl bg-
|
|
13
|
-
readonly shimmer: "animate-shimmer bg-[length:400%_100%] rounded bg-gradient-to-r from-
|
|
14
|
-
readonly shimmerText: "animate-shimmer bg-[length:400%_100%] h-4 rounded bg-gradient-to-r from-
|
|
15
|
-
readonly shimmerCard: "animate-shimmer bg-[length:400%_100%] rounded-2xl bg-gradient-to-r from-
|
|
8
|
+
readonly base: "animate-pulse rounded bg-[var(--appkit-color-border-subtle)]";
|
|
9
|
+
readonly text: "animate-pulse rounded bg-[var(--appkit-color-border-subtle)] h-4";
|
|
10
|
+
readonly heading: "animate-pulse rounded bg-[var(--appkit-color-border-subtle)] h-7";
|
|
11
|
+
readonly image: "animate-pulse rounded-xl bg-[var(--appkit-color-border-subtle)]";
|
|
12
|
+
readonly card: "animate-pulse rounded-2xl bg-[var(--appkit-color-border-subtle)]";
|
|
13
|
+
readonly shimmer: "animate-shimmer bg-[length:400%_100%] rounded bg-gradient-to-r from-[var(--appkit-color-border-subtle)] via-[var(--appkit-color-bg)] to-[var(--appkit-color-border-subtle)]";
|
|
14
|
+
readonly shimmerText: "animate-shimmer bg-[length:400%_100%] h-4 rounded bg-gradient-to-r from-[var(--appkit-color-border-subtle)] via-[var(--appkit-color-bg)] to-[var(--appkit-color-border-subtle)]";
|
|
15
|
+
readonly shimmerCard: "animate-shimmer bg-[length:400%_100%] rounded-2xl bg-gradient-to-r from-[var(--appkit-color-border-subtle)] via-[var(--appkit-color-bg)] to-[var(--appkit-color-border-subtle)]";
|
|
16
16
|
};
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* shimmer (animate-shimmer + gradient).
|
|
6
6
|
*/
|
|
7
7
|
export const SKELETON = {
|
|
8
|
-
// Pulse (fade) variant
|
|
9
|
-
base: "animate-pulse rounded bg-
|
|
10
|
-
text: "animate-pulse rounded bg-
|
|
11
|
-
heading: "animate-pulse rounded bg-
|
|
12
|
-
image: "animate-pulse rounded-xl bg-
|
|
13
|
-
card: "animate-pulse rounded-2xl bg-
|
|
14
|
-
// Shimmer (sweep) variant
|
|
15
|
-
shimmer: "animate-shimmer bg-[length:400%_100%] rounded bg-gradient-to-r from-
|
|
16
|
-
shimmerText: "animate-shimmer bg-[length:400%_100%] h-4 rounded bg-gradient-to-r from-
|
|
17
|
-
shimmerCard: "animate-shimmer bg-[length:400%_100%] rounded-2xl bg-gradient-to-r from-
|
|
8
|
+
// Pulse (fade) variant — bg adapts to active theme
|
|
9
|
+
base: "animate-pulse rounded bg-[var(--appkit-color-border-subtle)]",
|
|
10
|
+
text: "animate-pulse rounded bg-[var(--appkit-color-border-subtle)] h-4",
|
|
11
|
+
heading: "animate-pulse rounded bg-[var(--appkit-color-border-subtle)] h-7",
|
|
12
|
+
image: "animate-pulse rounded-xl bg-[var(--appkit-color-border-subtle)]",
|
|
13
|
+
card: "animate-pulse rounded-2xl bg-[var(--appkit-color-border-subtle)]",
|
|
14
|
+
// Shimmer (sweep) variant — gradient from border-subtle → bg → border-subtle
|
|
15
|
+
shimmer: "animate-shimmer bg-[length:400%_100%] rounded bg-gradient-to-r from-[var(--appkit-color-border-subtle)] via-[var(--appkit-color-bg)] to-[var(--appkit-color-border-subtle)]",
|
|
16
|
+
shimmerText: "animate-shimmer bg-[length:400%_100%] h-4 rounded bg-gradient-to-r from-[var(--appkit-color-border-subtle)] via-[var(--appkit-color-bg)] to-[var(--appkit-color-border-subtle)]",
|
|
17
|
+
shimmerCard: "animate-shimmer bg-[length:400%_100%] rounded-2xl bg-gradient-to-r from-[var(--appkit-color-border-subtle)] via-[var(--appkit-color-bg)] to-[var(--appkit-color-border-subtle)]",
|
|
18
18
|
};
|
|
@@ -6,18 +6,18 @@
|
|
|
6
6
|
* subsequent sweep migrates each callsite to a primitive `surface` /
|
|
7
7
|
* `color` / `border` variant.
|
|
8
8
|
*/
|
|
9
|
-
export declare const THEMED_BG_PRIMARY = "bg-
|
|
10
|
-
export declare const THEMED_BG_SECONDARY = "bg-
|
|
11
|
-
export declare const THEMED_BG_TERTIARY = "bg-
|
|
12
|
-
export declare const THEMED_BORDER = "border-
|
|
13
|
-
export declare const THEMED_BORDER_STRONG = "border-
|
|
14
|
-
export declare const THEMED_TEXT_PRIMARY = "text-
|
|
15
|
-
export declare const THEMED_TEXT_SECONDARY = "text-
|
|
16
|
-
export declare const THEMED_TEXT_TERTIARY = "text-
|
|
17
|
-
export declare const THEMED_TEXT_MUTED = "text-
|
|
18
|
-
export declare const THEMED_TEXT_SUCCESS = "text-
|
|
19
|
-
export declare const THEMED_TEXT_WARNING = "text-
|
|
20
|
-
export declare const THEMED_TEXT_ERROR = "text-
|
|
9
|
+
export declare const THEMED_BG_PRIMARY = "bg-[var(--appkit-color-bg)]";
|
|
10
|
+
export declare const THEMED_BG_SECONDARY = "bg-[var(--appkit-color-surface)]";
|
|
11
|
+
export declare const THEMED_BG_TERTIARY = "bg-[var(--appkit-color-surface-elevated)]";
|
|
12
|
+
export declare const THEMED_BORDER = "border-[var(--appkit-color-border)]";
|
|
13
|
+
export declare const THEMED_BORDER_STRONG = "border-[var(--appkit-color-border)]";
|
|
14
|
+
export declare const THEMED_TEXT_PRIMARY = "text-[var(--appkit-color-text)]";
|
|
15
|
+
export declare const THEMED_TEXT_SECONDARY = "text-[var(--appkit-color-text-muted)]";
|
|
16
|
+
export declare const THEMED_TEXT_TERTIARY = "text-[var(--appkit-color-text-faint)]";
|
|
17
|
+
export declare const THEMED_TEXT_MUTED = "text-[var(--appkit-color-text-faint)]";
|
|
18
|
+
export declare const THEMED_TEXT_SUCCESS = "text-success";
|
|
19
|
+
export declare const THEMED_TEXT_WARNING = "text-warning";
|
|
20
|
+
export declare const THEMED_TEXT_ERROR = "text-error";
|
|
21
21
|
export declare const FLEX_CENTER = "flex items-center justify-center";
|
|
22
22
|
export declare const FLEX_BETWEEN = "flex items-center justify-between";
|
|
23
23
|
export declare const FLEX_START = "flex items-center justify-start";
|
|
@@ -6,18 +6,18 @@
|
|
|
6
6
|
* subsequent sweep migrates each callsite to a primitive `surface` /
|
|
7
7
|
* `color` / `border` variant.
|
|
8
8
|
*/
|
|
9
|
-
export const THEMED_BG_PRIMARY = "bg-
|
|
10
|
-
export const THEMED_BG_SECONDARY = "bg-
|
|
11
|
-
export const THEMED_BG_TERTIARY = "bg-
|
|
12
|
-
export const THEMED_BORDER = "border-
|
|
13
|
-
export const THEMED_BORDER_STRONG = "border-
|
|
14
|
-
export const THEMED_TEXT_PRIMARY = "text-
|
|
15
|
-
export const THEMED_TEXT_SECONDARY = "text-
|
|
16
|
-
export const THEMED_TEXT_TERTIARY = "text-
|
|
17
|
-
export const THEMED_TEXT_MUTED = "text-
|
|
18
|
-
export const THEMED_TEXT_SUCCESS = "text-
|
|
19
|
-
export const THEMED_TEXT_WARNING = "text-
|
|
20
|
-
export const THEMED_TEXT_ERROR = "text-
|
|
9
|
+
export const THEMED_BG_PRIMARY = "bg-[var(--appkit-color-bg)]";
|
|
10
|
+
export const THEMED_BG_SECONDARY = "bg-[var(--appkit-color-surface)]";
|
|
11
|
+
export const THEMED_BG_TERTIARY = "bg-[var(--appkit-color-surface-elevated)]";
|
|
12
|
+
export const THEMED_BORDER = "border-[var(--appkit-color-border)]";
|
|
13
|
+
export const THEMED_BORDER_STRONG = "border-[var(--appkit-color-border)]";
|
|
14
|
+
export const THEMED_TEXT_PRIMARY = "text-[var(--appkit-color-text)]";
|
|
15
|
+
export const THEMED_TEXT_SECONDARY = "text-[var(--appkit-color-text-muted)]";
|
|
16
|
+
export const THEMED_TEXT_TERTIARY = "text-[var(--appkit-color-text-faint)]";
|
|
17
|
+
export const THEMED_TEXT_MUTED = "text-[var(--appkit-color-text-faint)]";
|
|
18
|
+
export const THEMED_TEXT_SUCCESS = "text-success";
|
|
19
|
+
export const THEMED_TEXT_WARNING = "text-warning";
|
|
20
|
+
export const THEMED_TEXT_ERROR = "text-error";
|
|
21
21
|
export const FLEX_CENTER = "flex items-center justify-center";
|
|
22
22
|
export const FLEX_BETWEEN = "flex items-center justify-between";
|
|
23
23
|
export const FLEX_START = "flex items-center justify-start";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Card, Div, Heading, Row, Section, Span, Stack, Text } from "../../../ui";
|
|
3
3
|
export function AboutView({ labels = {}, howItems = [], valueItems = [], milestones = [], ctaBannerClass = "", renderCtaButtons, }) {
|
|
4
|
-
return (_jsxs(Div, { className: "-mx-4 md:-mx-6 lg:-mx-8 -mt-6 sm:-mt-8 lg:-mt-10", children: [_jsx(Section, { color: "inverse", tone: "accent-banner", padding: "y-4xl", children: _jsxs(Div, { paddingX: "x-page", className: "max-w-4xl mx-auto text-center", children: [_jsx(Heading, { color: "inverse", level: 1, variant: "none", className: "mb-6", mdSize: "5xl", size: "4xl", weight: "bold", children: labels.title }), _jsx(Text, { color: "inverse", variant: "none", className: "/80 max-w-2xl mx-auto", size: "xl", children: labels.subtitle })] }) }), _jsxs(Div, { paddingX: "x-page", className: "max-w-5xl mx-auto", padding: "y-4xl", children: [_jsxs(Section, { className: "text-center max-w-3xl mx-auto", children: [_jsx(Heading, { level: 2, className: "mb-4", children: labels.missionTitle }), _jsx(Text, { size: "lg", variant: "secondary", className: "leading-relaxed", children: labels.missionText })] }), _jsxs(Section, { children: [_jsx(Heading, { level: 2, className: "mb-12", align: "center", children: labels.howItWorksTitle }), _jsx(Div, { className: "grid md:grid-cols-3", gap: "6", children: howItems.map(({ title, text, icon, tone }) => (_jsxs(Card, { variant: `gradient-${tone ?? "indigo"}`, padding: "md", spacing: "sm", children: [_jsx(Div, { children: _jsx(Span, { size: "4xl", children: icon }) }), _jsx(Heading, { level: 3, children: title }), _jsx(Text, { size: "sm", variant: "secondary", className: "leading-relaxed", children: text })] }, title))) })] }), _jsxs(Section, { children: [_jsx(Heading, { level: 2, className: "mb-12", align: "center", children: labels.valuesTitle }), _jsx(Div, { className: "grid md:grid-cols-3", gap: "5", children: valueItems.map(({ title, text, icon }) => (_jsxs("div", { className: "bg-
|
|
4
|
+
return (_jsxs(Div, { className: "-mx-4 md:-mx-6 lg:-mx-8 -mt-6 sm:-mt-8 lg:-mt-10", children: [_jsx(Section, { color: "inverse", tone: "accent-banner", padding: "y-4xl", children: _jsxs(Div, { paddingX: "x-page", className: "max-w-4xl mx-auto text-center", children: [_jsx(Heading, { color: "inverse", level: 1, variant: "none", className: "mb-6", mdSize: "5xl", size: "4xl", weight: "bold", children: labels.title }), _jsx(Text, { color: "inverse", variant: "none", className: "/80 max-w-2xl mx-auto", size: "xl", children: labels.subtitle })] }) }), _jsxs(Div, { paddingX: "x-page", className: "max-w-5xl mx-auto", padding: "y-4xl", children: [_jsxs(Section, { className: "text-center max-w-3xl mx-auto", children: [_jsx(Heading, { level: 2, className: "mb-4", children: labels.missionTitle }), _jsx(Text, { size: "lg", variant: "secondary", className: "leading-relaxed", children: labels.missionText })] }), _jsxs(Section, { children: [_jsx(Heading, { level: 2, className: "mb-12", align: "center", children: labels.howItWorksTitle }), _jsx(Div, { className: "grid md:grid-cols-3", gap: "6", children: howItems.map(({ title, text, icon, tone }) => (_jsxs(Card, { variant: `gradient-${tone ?? "indigo"}`, padding: "md", spacing: "sm", children: [_jsx(Div, { children: _jsx(Span, { size: "4xl", children: icon }) }), _jsx(Heading, { level: 3, children: title }), _jsx(Text, { size: "sm", variant: "secondary", className: "leading-relaxed", children: text })] }, title))) })] }), _jsxs(Section, { children: [_jsx(Heading, { level: 2, className: "mb-12", align: "center", children: labels.valuesTitle }), _jsx(Div, { className: "grid md:grid-cols-3", gap: "5", children: valueItems.map(({ title, text, icon }) => (_jsxs("div", { className: "bg-[var(--appkit-color-surface)] rounded-xl p-6 space-y-3 border border-[var(--appkit-color-border)]", children: [_jsx(Div, { children: _jsx(Span, { size: "3xl", children: icon }) }), _jsx(Heading, { level: 3, children: title }), _jsx(Text, { size: "sm", variant: "secondary", className: "leading-relaxed", children: text })] }, title))) })] }), _jsxs(Section, { children: [_jsx(Heading, { level: 2, className: "mb-10", align: "center", children: labels.milestonesTitle }), _jsx(Stack, { className: "relative border-l-2 border-primary/30 max-w-2xl mx-auto pl-[2rem]", gap: "xl", children: milestones.map(({ year, text }) => (_jsxs(Div, { className: "relative", children: [_jsx(Div, { className: "absolute -left-10 top-1 w-4 h-4 bg-primary border-2 border-white", rounded: "full" }), _jsx(Span, { size: "xs", weight: "bold", className: "text-primary tracking-wide", transform: "uppercase", children: year }), _jsx(Text, { className: "mt-1", children: text })] }, year))) })] }), _jsxs(Section, { color: "inverse", tone: "accent-banner", className: `text-center ${ctaBannerClass}`, padding: "xl", rounded: "2xl", children: [_jsx(Heading, { color: "inverse", level: 2, variant: "none", className: "mb-8", size: "3xl", weight: "bold", children: labels.ctaTitle }), renderCtaButtons ? (renderCtaButtons()) : (_jsx(Row, { justify: "center", gap: "3", wrap: true, children: _jsxs(Span, { color: "inverse", size: "sm", className: "/70", children: [labels.ctaSell, " \u00B7 ", labels.ctaShop] }) }))] })] })] }));
|
|
5
5
|
}
|
|
@@ -20,5 +20,5 @@ export async function FAQPageView({ category, } = {}) {
|
|
|
20
20
|
? allItems.filter((item) => item.category === category)
|
|
21
21
|
: allItems;
|
|
22
22
|
const activeCategory = categories.find((c) => c.slug === category);
|
|
23
|
-
return (_jsxs(Div, { className: "-mx-4 md:-mx-6 lg:-mx-8 -mt-6 sm:-mt-8 lg:-mt-10", children: [_jsx(Section, { color: "inverse", tone: "accent-banner", padding: "banner", children: _jsxs(Container, { size: "md", className: "text-center", children: [_jsx(Heading, { color: "inverse", level: 1, variant: "none", className: "mb-3", children: activeCategory ? activeCategory.label : t("title") }), _jsx(Text, { color: "inverse", variant: "none", className: "/80 max-w-2xl mx-auto", children: t("subtitle") })] }) }), _jsx(Container, { size: "md", padding: "content-banner", children: _jsxs(Stack, { direction: "md-row", gap: "xl", children: [categories.length > 0 && (_jsxs(Aside, { className: "md:w-56 flex-shrink-0", children: [_jsx(Heading, { level: 3, className: "uppercase tracking-wide mb-3", color: "muted", size: "sm", weight: "semibold", children: t("categoriesLabel") }), _jsxs(Nav, { "aria-label": "FAQ categories", spacing: "xs", children: [_jsxs(TextLink, { rounded: "lg", href: String(ROUTES.PUBLIC.FAQS), paddingX: "sm", paddingY: "xs", layout: "flex", align: "center", justify: "between", weight: !category ? "semibold" : undefined, className: `transition-colors ${!category ? "bg-primary/10 text-primary" : "hover:bg-
|
|
23
|
+
return (_jsxs(Div, { className: "-mx-4 md:-mx-6 lg:-mx-8 -mt-6 sm:-mt-8 lg:-mt-10", children: [_jsx(Section, { color: "inverse", tone: "accent-banner", padding: "banner", children: _jsxs(Container, { size: "md", className: "text-center", children: [_jsx(Heading, { color: "inverse", level: 1, variant: "none", className: "mb-3", children: activeCategory ? activeCategory.label : t("title") }), _jsx(Text, { color: "inverse", variant: "none", className: "/80 max-w-2xl mx-auto", children: t("subtitle") })] }) }), _jsx(Container, { size: "md", padding: "content-banner", children: _jsxs(Stack, { direction: "md-row", gap: "xl", children: [categories.length > 0 && (_jsxs(Aside, { className: "md:w-56 flex-shrink-0", children: [_jsx(Heading, { level: 3, className: "uppercase tracking-wide mb-3", color: "muted", size: "sm", weight: "semibold", children: t("categoriesLabel") }), _jsxs(Nav, { "aria-label": "FAQ categories", spacing: "xs", children: [_jsxs(TextLink, { rounded: "lg", href: String(ROUTES.PUBLIC.FAQS), paddingX: "sm", paddingY: "xs", layout: "flex", align: "center", justify: "between", weight: !category ? "semibold" : undefined, className: `transition-colors ${!category ? "bg-primary/10 text-primary" : "hover:bg-[var(--appkit-color-surface)] hover:bg-[var(--appkit-color-surface-elevated)]"}`, size: "sm", children: [_jsxs(Span, { className: `${flex.row}`, gap: "md", children: [_jsx(HelpCircle, { className: "w-4 h-4" }), t("allCategories")] }), _jsx(ChevronRight, { className: "w-3.5 h-3.5 opacity-50" })] }), categories.map((cat) => (_jsxs(TextLink, { rounded: "lg", href: String(ROUTES.PUBLIC.FAQ_CATEGORY(cat.slug)), paddingX: "sm", paddingY: "xs", layout: "flex", align: "center", justify: "between", weight: category === cat.slug ? "semibold" : undefined, className: `transition-colors ${category === cat.slug ? "bg-primary/10 text-primary" : "hover:bg-[var(--appkit-color-surface)] hover:bg-[var(--appkit-color-surface-elevated)]"}`, size: "sm", children: [_jsxs(Span, { className: `${flex.row}`, gap: "md", children: [_jsx(Span, { children: cat.icon }), cat.label] }), _jsx(ChevronRight, { className: "w-3.5 h-3.5 opacity-50" })] }, cat.slug)))] })] })), _jsxs(Div, { className: "flex-1 min-w-0", children: [visibleItems.length === 0 ? (_jsxs(Section, { className: `text-center`, border: "default", surface: "subtle", rounded: "2xl", padding: "y-4xl", children: [_jsx(HelpCircle, { className: "w-10 h-10 mx-auto mb-3 text-zinc-300 dark:text-[var(--appkit-color-text-muted)]" }), _jsx(Heading, { level: 3, className: "mb-2", size: "base", children: t("emptyTitle") }), _jsx(Text, { variant: "secondary", size: "sm", children: t("emptyText") })] })) : (_jsx(Stack, { gap: "sm", children: visibleItems.map((item, i) => (_jsxs(Details, { tone: "card", className: "group overflow-hidden", children: [_jsxs(Summary, { paddingX: "x-5", paddingY: "y-md", size: "sm", weight: "medium", layout: "flex", align: "center", justify: "between", className: "hover:bg-neutral-50 hover:bg-[var(--appkit-color-surface-elevated)]/50 transition-colors", children: [_jsx(Span, { children: item.question }), _jsx(ChevronRight, { className: "w-4 h-4 flex-shrink-0 ml-3 transition-transform group-open:rotate-90" })] }), _jsx(Div, { padding: "x-md", paddingY: "b-md-lg", className: "pt-[0.25rem]", children: _jsx(RichTextRenderer, { html: item.answer, proseClass: "prose prose-sm max-w-none dark:prose-invert" }) })] }, i))) })), _jsxs(Section, { className: `mt-10 text-center`, border: "default", surface: "subtle", rounded: "2xl", padding: "lg", children: [_jsx(Heading, { level: 3, className: "mb-2", size: "base", children: t("stillNeedHelpTitle") }), _jsx(Text, { variant: "secondary", className: "mb-4", size: "sm", children: t("stillNeedHelpText") }), _jsxs(Row, { align: "center", justify: "center", gap: "md", wrap: true, children: [_jsx(TextLink, { href: String(ROUTES.PUBLIC.HELP), children: t("helpCenter") }), _jsx(TextLink, { href: String(ROUTES.PUBLIC.CONTACT), variant: "muted", children: t("contactUs") })] })] })] })] }) })] }));
|
|
24
24
|
}
|
|
@@ -65,10 +65,10 @@ export async function FeesView({} = {}) {
|
|
|
65
65
|
return (_jsxs(Div, { className: "-mx-4 md:-mx-6 lg:-mx-8 -mt-6 sm:-mt-8 lg:-mt-10", children: [_jsx(Section, { color: "inverse", tone: "accent-banner", padding: "banner", children: _jsxs(Div, { className: `${page.container.sm} text-center`, children: [_jsx(Heading, { color: "inverse", level: 1, variant: "none", className: "mb-4", children: t("title") }), _jsx(Text, { color: "inverse", variant: "none", className: "/80 max-w-2xl mx-auto", children: t("subtitle") })] }) }), _jsxs(Stack, { gap: "section", className: `${page.container.sm}`, padding: "content-banner", children: [renderFeeTableSection(t, themed, FEE_ROWS), renderPayoutExampleSection(t, themed, OFFER_PAYOUT_ROWS), renderDisclaimerSection(t, themed)] })] }));
|
|
66
66
|
}
|
|
67
67
|
function renderFeeTableSection(t, themed, rows) {
|
|
68
|
-
return (_jsxs(Section, { children: [_jsx(Heading, { level: 2, className: "mb-6", children: t("tableTitle") }), _jsx(Div, { className: `${__O.xAuto}`, border: "default", rounded: "xl", children: _jsxs(Table, { size: "sm", children: [_jsx(Thead, { className: themed.bgSecondary, children: _jsxs(Tr, { children: [_jsx(Th, { className: "text-left", padding: "md", weight: "semibold", children: t("colFeeType") }), _jsx(Th, { className: "text-left", padding: "md", weight: "semibold", children: t("colRate") }), _jsx(Th, { className: "text-left", padding: "md", weight: "semibold", children: t("colPaidBy") }), _jsx(Th, { className: "text-left hidden md:table-cell", padding: "md", weight: "semibold", children: t("colNote") })] }) }), _jsx(Tbody, { className: "divide-y divide-neutral-100
|
|
68
|
+
return (_jsxs(Section, { children: [_jsx(Heading, { level: 2, className: "mb-6", children: t("tableTitle") }), _jsx(Div, { className: `${__O.xAuto}`, border: "default", rounded: "xl", children: _jsxs(Table, { size: "sm", children: [_jsx(Thead, { className: themed.bgSecondary, children: _jsxs(Tr, { children: [_jsx(Th, { className: "text-left", padding: "md", weight: "semibold", children: t("colFeeType") }), _jsx(Th, { className: "text-left", padding: "md", weight: "semibold", children: t("colRate") }), _jsx(Th, { className: "text-left", padding: "md", weight: "semibold", children: t("colPaidBy") }), _jsx(Th, { className: "text-left hidden md:table-cell", padding: "md", weight: "semibold", children: t("colNote") })] }) }), _jsx(Tbody, { className: "divide-y divide-neutral-100 divide-[var(--appkit-color-border)]", children: rows.map((row) => (_jsxs(Tr, { className: `${themed.bgPrimary} hover:bg-neutral-50 hover:bg-[var(--appkit-color-surface-elevated)]/50`, children: [_jsx(Td, { weight: "medium", padding: "md", children: row.category }), _jsx(Td, { className: CLS_RATE_CELL, children: row.rate }), _jsx(Td, { padding: "md", children: _jsx(Caption, { children: row.who }) }), _jsx(Td, { className: "text-[var(--appkit-color-text-muted)] hidden md:table-cell", padding: "md", size: "xs", children: row.note })] }, row.category))) })] }) }), _jsx(Caption, { className: "mt-3 block", color: "muted", children: t("tableNote") })] }));
|
|
69
69
|
}
|
|
70
70
|
function renderPayoutExampleSection(t, themed, rows) {
|
|
71
|
-
return (_jsxs(Section, { children: [_jsx(Heading, { level: 2, className: "mb-3", children: t("payoutExampleTitle") }), _jsx(Text, { variant: "secondary", className: "mb-6", children: t("payoutExampleSubtitle") }), _jsxs(Div, { className: `${__P.p5} max-w-sm`, border: "default", surface: "muted", rounded: "xl", children: [_jsx(Heading, { level: 3, className: "mb-4", size: "base", children: t("payoutExampleProduct") }), _jsx(Stack, { gap: "sm", children: rows.map((row, i) => (_jsxs(Row, { textWeight: "bold", textSize: "sm", className: `${row.highlight ? "border-t border-
|
|
71
|
+
return (_jsxs(Section, { children: [_jsx(Heading, { level: 2, className: "mb-3", children: t("payoutExampleTitle") }), _jsx(Text, { variant: "secondary", className: "mb-6", children: t("payoutExampleSubtitle") }), _jsxs(Div, { className: `${__P.p5} max-w-sm`, border: "default", surface: "muted", rounded: "xl", children: [_jsx(Heading, { level: 3, className: "mb-4", size: "base", children: t("payoutExampleProduct") }), _jsx(Stack, { gap: "sm", children: rows.map((row, i) => (_jsxs(Row, { textWeight: "bold", textSize: "sm", className: `${row.highlight ? "border-t border-[var(--appkit-color-border)] mt-2" : ""}`, paddingY: row.highlight ? "t-xs" : undefined, justify: "between", children: [_jsx(Text, { className: row.highlight ? "font-bold" : "text-[var(--appkit-color-text-muted)]", children: row.label }), _jsx(Text, { className: row.highlight ? CLS_HIGHLIGHT : "", children: row.example })] }, i))) })] })] }));
|
|
72
72
|
}
|
|
73
73
|
function renderDisclaimerSection(t, themed) {
|
|
74
74
|
return (_jsxs(Section, { className: `${__P.p5}`, border: "default", surface: "subtle", rounded: "xl", children: [_jsx(Heading, { level: 3, className: "mb-2", size: "base", children: t("disclaimerTitle") }), _jsx(Caption, { className: "leading-relaxed", children: t("disclaimerText") })] }));
|
|
@@ -52,9 +52,9 @@ export async function HowAuctionsWorkView({} = {}) {
|
|
|
52
52
|
const DIAGRAM_STEPS = [
|
|
53
53
|
{
|
|
54
54
|
emoji: "🔍",
|
|
55
|
-
circleClass: "bg-
|
|
55
|
+
circleClass: "bg-[var(--appkit-color-border-subtle)] border-2 border-[var(--appkit-color-border)]",
|
|
56
56
|
badge: t("step1Title"),
|
|
57
|
-
badgeClass: "bg-
|
|
57
|
+
badgeClass: "bg-[var(--appkit-color-border-subtle)] text-[var(--appkit-color-text-muted)]",
|
|
58
58
|
desc: t("diagramStep1Desc"),
|
|
59
59
|
},
|
|
60
60
|
{
|
|
@@ -38,9 +38,9 @@ export async function HowCheckoutWorksView({} = {}) {
|
|
|
38
38
|
const DIAGRAM_STEPS = [
|
|
39
39
|
{
|
|
40
40
|
emoji: "🛒",
|
|
41
|
-
circleClass: "bg-
|
|
41
|
+
circleClass: "bg-[var(--appkit-color-border-subtle)] border-2 border-[var(--appkit-color-border)]",
|
|
42
42
|
badge: t("step1Title"),
|
|
43
|
-
badgeClass: "bg-
|
|
43
|
+
badgeClass: "bg-[var(--appkit-color-border-subtle)] text-[var(--appkit-color-text-muted)]",
|
|
44
44
|
desc: t("diagramStep1Desc"),
|
|
45
45
|
},
|
|
46
46
|
{
|
|
@@ -24,9 +24,9 @@ export async function HowOffersWorkView({} = {}) {
|
|
|
24
24
|
const DIAGRAM_STEPS = [
|
|
25
25
|
{
|
|
26
26
|
emoji: "💬",
|
|
27
|
-
circleClass: "bg-
|
|
27
|
+
circleClass: "bg-[var(--appkit-color-border-subtle)] border-2 border-[var(--appkit-color-border)]",
|
|
28
28
|
badge: t("diagramStep1Badge"),
|
|
29
|
-
badgeClass: "bg-
|
|
29
|
+
badgeClass: "bg-[var(--appkit-color-border-subtle)] text-[var(--appkit-color-text-muted)]",
|
|
30
30
|
desc: t("diagramStep1Desc"),
|
|
31
31
|
},
|
|
32
32
|
{
|
|
@@ -90,9 +90,9 @@ export async function HowOrdersWorkView({} = {}) {
|
|
|
90
90
|
const DIAGRAM_STEPS = [
|
|
91
91
|
{
|
|
92
92
|
emoji: "🛒",
|
|
93
|
-
circleClass: "bg-
|
|
93
|
+
circleClass: "bg-[var(--appkit-color-border-subtle)] border-2 border-[var(--appkit-color-border)]",
|
|
94
94
|
badge: t("diagramStep1Badge"),
|
|
95
|
-
badgeClass: "bg-
|
|
95
|
+
badgeClass: "bg-[var(--appkit-color-border-subtle)] text-[var(--appkit-color-text-muted)]",
|
|
96
96
|
desc: t("diagramStep1Desc"),
|
|
97
97
|
},
|
|
98
98
|
{
|
|
@@ -52,9 +52,9 @@ export async function HowPayoutsWorkView({} = {}) {
|
|
|
52
52
|
const DIAGRAM_STEPS = [
|
|
53
53
|
{
|
|
54
54
|
emoji: "✅",
|
|
55
|
-
circleClass: "bg-
|
|
55
|
+
circleClass: "bg-[var(--appkit-color-border-subtle)] border-2 border-[var(--appkit-color-border)]",
|
|
56
56
|
badge: t("step1Title"),
|
|
57
|
-
badgeClass: "bg-
|
|
57
|
+
badgeClass: "bg-[var(--appkit-color-border-subtle)] text-[var(--appkit-color-text-muted)]",
|
|
58
58
|
desc: t("diagramStep1Desc"),
|
|
59
59
|
},
|
|
60
60
|
{
|
|
@@ -52,9 +52,9 @@ export async function HowPreOrdersWorkView({} = {}) {
|
|
|
52
52
|
const DIAGRAM_STEPS = [
|
|
53
53
|
{
|
|
54
54
|
emoji: "🔍",
|
|
55
|
-
circleClass: "bg-
|
|
55
|
+
circleClass: "bg-[var(--appkit-color-border-subtle)] border-2 border-[var(--appkit-color-border)]",
|
|
56
56
|
badge: t("step1Title"),
|
|
57
|
-
badgeClass: "bg-
|
|
57
|
+
badgeClass: "bg-[var(--appkit-color-border-subtle)] text-[var(--appkit-color-text-muted)]",
|
|
58
58
|
desc: t("diagramStep1Desc"),
|
|
59
59
|
},
|
|
60
60
|
{
|
|
@@ -44,9 +44,9 @@ export async function HowReviewsWorkView({} = {}) {
|
|
|
44
44
|
const DIAGRAM_STEPS = [
|
|
45
45
|
{
|
|
46
46
|
emoji: "📦",
|
|
47
|
-
circleClass: "bg-
|
|
47
|
+
circleClass: "bg-[var(--appkit-color-border-subtle)] border-2 border-[var(--appkit-color-border)]",
|
|
48
48
|
badge: t("diagramStep1Badge"),
|
|
49
|
-
badgeClass: "bg-
|
|
49
|
+
badgeClass: "bg-[var(--appkit-color-border-subtle)] text-[var(--appkit-color-text-muted)]",
|
|
50
50
|
desc: t("diagramStep1Desc"),
|
|
51
51
|
},
|
|
52
52
|
{
|
|
@@ -16,7 +16,7 @@ const __P = {
|
|
|
16
16
|
p4: "p-4",
|
|
17
17
|
p6: "p-6",
|
|
18
18
|
};
|
|
19
|
-
const CLS_EMPTY_ICON = "w-10 h-10 mx-auto mb-3 text-neutral-300 dark:text-
|
|
19
|
+
const CLS_EMPTY_ICON = "w-10 h-10 mx-auto mb-3 text-neutral-300 dark:text-[var(--appkit-color-text-muted)] ";
|
|
20
20
|
const __O = {
|
|
21
21
|
hidden: "overflow-hidden",
|
|
22
22
|
};
|
|
@@ -92,7 +92,7 @@ export async function PublicProfileView({ userId, }) {
|
|
|
92
92
|
const storeDescription = store?.storeDescription ?? pub?.storeDescription;
|
|
93
93
|
const profileHeroCtx = { displayName, photoURL, memberSince, isSeller, storeSlug, flex, page };
|
|
94
94
|
const statItems = buildProfileStatItems(t, { listingCount, reviewCount, itemsSold, auctionsWon, totalOrders, isSeller });
|
|
95
|
-
return (_jsxs(Div, { className: "-mx-4 md:-mx-6 lg:-mx-8 -mt-6 sm:-mt-8 lg:-mt-10", children: [renderProfileHero(t, profileHeroCtx), _jsxs(Stack, { gap: "2xl", className: `${page.container.md}`, paddingY: "y-3xl", children: [renderProfileStatsRow(flex, statItems), renderProfileBioSection(pub), renderStoreDescriptionSection(isSeller, storeSlug ?? null, storeDescription ?? null, storeName, t), renderProfileListingsSection(t, products, storeSlug ?? null), renderAuthoredReviewsSection(t, reviewsAuthored, displayName), reviewsReceivedAsBuyer.length > 0 && renderBuyerReceivedReviewsSection(t, reviewsReceivedAsBuyer), _jsx(Row, { justify: "center", padding: "t-xs", children: _jsxs(Link, { href: String(ROUTES.HOME), className: "text-sm text-
|
|
95
|
+
return (_jsxs(Div, { className: "-mx-4 md:-mx-6 lg:-mx-8 -mt-6 sm:-mt-8 lg:-mt-10", children: [renderProfileHero(t, profileHeroCtx), _jsxs(Stack, { gap: "2xl", className: `${page.container.md}`, paddingY: "y-3xl", children: [renderProfileStatsRow(flex, statItems), renderProfileBioSection(pub), renderStoreDescriptionSection(isSeller, storeSlug ?? null, storeDescription ?? null, storeName, t), renderProfileListingsSection(t, products, storeSlug ?? null), renderAuthoredReviewsSection(t, reviewsAuthored, displayName), reviewsReceivedAsBuyer.length > 0 && renderBuyerReceivedReviewsSection(t, reviewsReceivedAsBuyer), _jsx(Row, { justify: "center", padding: "t-xs", children: _jsxs(Link, { href: String(ROUTES.HOME), className: "text-sm text-[var(--appkit-color-text-faint)] hover:text-[var(--appkit-color-text-muted)]", children: ["\u2190 ", t("backHome")] }) })] })] }));
|
|
96
96
|
}
|
|
97
97
|
function buildProfileStatItems(t, ctx) {
|
|
98
98
|
const { listingCount, reviewCount, itemsSold, auctionsWon, totalOrders, isSeller } = ctx;
|
|
@@ -120,7 +120,7 @@ function renderProfileStatsRow(flex, statItems) {
|
|
|
120
120
|
function renderProfileBioSection(pub) {
|
|
121
121
|
if (!pub?.bio && !pub?.location && !pub?.website)
|
|
122
122
|
return null;
|
|
123
|
-
return (_jsx(Section, { children: _jsxs(Stack, { gap: "sm", className: `${__P.p6}`, border: "default", surface: "muted", rounded: "2xl", children: [pub.bio && _jsx(Text, { className: "leading-relaxed text-neutral-700", size: "sm", children: pub.bio }), _jsxs(Row, { gap: "md", wrap: true, children: [pub.location && _jsxs(Span, { layout: "flex", gap: "xs", size: "sm", className: "text-
|
|
123
|
+
return (_jsx(Section, { children: _jsxs(Stack, { gap: "sm", className: `${__P.p6}`, border: "default", surface: "muted", rounded: "2xl", children: [pub.bio && _jsx(Text, { className: "leading-relaxed text-neutral-700", size: "sm", children: pub.bio }), _jsxs(Row, { gap: "md", wrap: true, children: [pub.location && _jsxs(Span, { layout: "flex", gap: "xs", size: "sm", className: "text-[var(--appkit-color-text-muted)]", children: [_jsx(MapPin, { className: "w-4 h-4" }), pub.location] }), pub.website && _jsxs(Anchor, { href: pub.website, layout: "inline-flex", className: "gap-[0.375rem]", children: [_jsx(Globe, { className: "w-4 h-4" }), _jsx(Span, { size: "sm", children: pub.website.replace(/^https?:\/\//, "") })] })] })] }) }));
|
|
124
124
|
}
|
|
125
125
|
function renderStoreDescriptionSection(isSeller, storeSlug, storeDescription, storeName, t) {
|
|
126
126
|
if (!isSeller || !storeSlug || !storeDescription)
|
|
@@ -87,9 +87,9 @@ export async function SecurityPrivacyView({} = {}) {
|
|
|
87
87
|
const DIAGRAM_STEPS = [
|
|
88
88
|
{
|
|
89
89
|
emoji: "🖥️",
|
|
90
|
-
circleClass: "bg-
|
|
90
|
+
circleClass: "bg-[var(--appkit-color-border-subtle)] border-2 border-[var(--appkit-color-border)]",
|
|
91
91
|
badge: t("diagramStep1Badge"),
|
|
92
|
-
badgeClass: "bg-
|
|
92
|
+
badgeClass: "bg-[var(--appkit-color-border-subtle)] text-[var(--appkit-color-text-muted)]",
|
|
93
93
|
desc: t("diagramStep1Desc"),
|
|
94
94
|
},
|
|
95
95
|
{
|
|
@@ -7,8 +7,8 @@ export function AddressCard({ address, onEdit, onDelete, onSetDefault, labels =
|
|
|
7
7
|
const line2 = "line2" in address && address.line2
|
|
8
8
|
? address.line2
|
|
9
9
|
: address.addressLine2;
|
|
10
|
-
return (_jsxs(Div, { surface: "card", padding: "sm", className: "relative", children: [address.isDefault && (_jsx(Span, { color: "success", surface: "success-surface", size: "xs", weight: "medium", className: "absolute right-3 top-3", rounded: "full", padding: "pill-xs", children: labels.defaultBadge ?? "Default" })), address.label && (_jsx(Text, { className: "mb-1 tracking-wide text-
|
|
10
|
+
return (_jsxs(Div, { surface: "card", padding: "sm", className: "relative", children: [address.isDefault && (_jsx(Span, { color: "success", surface: "success-surface", size: "xs", weight: "medium", className: "absolute right-3 top-3", rounded: "full", padding: "pill-xs", children: labels.defaultBadge ?? "Default" })), address.label && (_jsx(Text, { className: "mb-1 tracking-wide text-[var(--appkit-color-text-muted)]", size: "xs", weight: "semibold", transform: "uppercase", children: address.label })), _jsx(Text, { className: "text-[var(--appkit-color-text)]", size: "sm", children: line1 }), line2 && _jsx(Text, { className: "text-[var(--appkit-color-text)]", size: "sm", children: line2 }), _jsxs(Text, { className: "text-[var(--appkit-color-text)]", size: "sm", children: [address.city, ", ", address.state, " ", address.postalCode] }), _jsx(Text, { className: "text-[var(--appkit-color-text)]", size: "sm", children: address.country }), address.phone && (_jsx(Text, { className: "mt-1 text-[var(--appkit-color-text-muted)]", size: "sm", children: address.phone })), _jsxs(Div, { layout: "flex", gap: "1", className: "mt-3", children: [onEdit && (_jsx(Button, { onClick: () => onEdit(address), variant: "ghost", size: "sm", className: "text-xs font-medium text-primary hover:underline", children: labels.edit ?? "Edit" })), onDelete && (_jsx(Button, { onClick: () => onDelete(address.id), variant: "ghost", size: "sm", className: "text-xs font-medium text-error hover:underline", children: labels.delete ?? "Delete" })), !address.isDefault && onSetDefault && (_jsx(Button, { onClick: () => onSetDefault(address.id), variant: "outline", size: "sm", className: "ml-auto text-xs font-medium", children: labels.setDefault ?? "Set default" }))] })] }));
|
|
11
11
|
}
|
|
12
12
|
export function AddressBook({ addresses, onEdit, onDelete, onSetDefault, onAdd, emptyLabel = "No saved addresses", addLabel = "Add Address", }) {
|
|
13
|
-
return (_jsxs(Stack, { gap: "md", children: [addresses.length === 0 && (_jsx(Text, { className: "text-
|
|
13
|
+
return (_jsxs(Stack, { gap: "md", children: [addresses.length === 0 && (_jsx(Text, { className: "text-[var(--appkit-color-text-muted)]", size: "sm", children: emptyLabel })), _jsx(Div, { layout: "grid", gap: "4", className: "sm:grid-cols-2", children: addresses.map((addr) => (_jsx(AddressCard, { address: addr, onEdit: onEdit, onDelete: onDelete, onSetDefault: onSetDefault }, addr.id))) }), onAdd && (_jsxs(Button, { rounded: "lg", onClick: onAdd, variant: "outline", paddingX: "md", paddingY: "md", textSize: "sm", weight: "medium", className: "mt-2 border border-dashed border-neutral-300 dark:border-[var(--appkit-color-border)] text-[var(--appkit-color-text-muted)] dark:text-[var(--appkit-color-text-muted)] transition hover:border-neutral-400 dark:hover:border-[var(--appkit-color-border-subtle)] hover:text-neutral-700 dark:hover:text-[var(--appkit-color-text)]", children: ["+ ", addLabel] }))] }));
|
|
14
14
|
}
|
|
@@ -74,5 +74,5 @@ export function AddressesIndexListing({ onAdd, onEdit, onDelete, }) {
|
|
|
74
74
|
},
|
|
75
75
|
});
|
|
76
76
|
return (_jsxs(Stack, { gap: "md", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search by address, postcode or label...", onSearchChange: setSearchInput, onSearchCommit: commitSearch, view: view, onViewChange: (v) => { if (v === "table")
|
|
77
|
-
return; setView(v); }, onResetAll: resetAll, hasActiveState: hasActiveState }), _jsx(Div, { className: "sm:px-[1rem]", padding: "x-sm", children: isLoading ? (_jsx(Div, { layout: "grid", gap: "4", className: "sm:grid-cols-2", children: Array.from({ length: 4 }).map((_, i) => (_jsxs("div", { className: "rounded-xl border border-
|
|
77
|
+
return; setView(v); }, onResetAll: resetAll, hasActiveState: hasActiveState }), _jsx(Div, { className: "sm:px-[1rem]", padding: "x-sm", children: isLoading ? (_jsx(Div, { layout: "grid", gap: "4", className: "sm:grid-cols-2", children: Array.from({ length: 4 }).map((_, i) => (_jsxs("div", { className: "rounded-xl border border-[var(--appkit-color-border)] animate-pulse p-4 space-y-2", children: [_jsx(Div, { className: "h-4 w-1/3", surface: "subtle", rounded: "default" }), _jsx(Div, { className: "h-3 w-3/4", surface: "subtle", rounded: "default" }), _jsx(Div, { className: "h-3 w-1/2", surface: "subtle", rounded: "default" })] }, i))) })) : addresses.length === 0 ? (_jsx(Text, { paddingY: "xl", color: "muted", size: "sm", align: "center", children: table.get(TABLE_KEYS.QUERY) ? `No addresses matching "${table.get(TABLE_KEYS.QUERY)}"` : "No saved addresses." })) : (_jsx(AddressBook, { addresses: addresses, onEdit: onEdit, onDelete: onDelete, onAdd: onAdd })) }), _jsx(ListingFilterDrawer, { open: filterOpen, onClose: () => setFilterOpen(false), onApply: applyFilters, onClear: clearFilters, activeCount: activeFilterCount, children: _jsx(AddressFilters, { table: pendingTable }) })] }));
|
|
78
78
|
}
|
|
@@ -2,5 +2,5 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Div, Heading, Row, Span } from "../../../ui";
|
|
3
3
|
const CLS_DOT_ON = "bg-success-surface";
|
|
4
4
|
export function ChatWindow({ labels = {}, isConnected = true, isLoading = false, error, renderLoadingIndicator, renderMessages, renderInput, className = "", }) {
|
|
5
|
-
return (_jsxs(Div, { className: className, children: [_jsxs(Row, { justify: "between", className: "border-b border-
|
|
5
|
+
return (_jsxs(Div, { className: className, children: [_jsxs(Row, { justify: "between", className: "border-b border-[var(--appkit-color-border)] mb-3", padding: "b-sm", children: [_jsxs(Row, { gap: "xs", children: [labels.title && _jsx(Heading, { level: 4, children: labels.title }), _jsx(Span, { className: `w-2 h-2 ${isConnected ? CLS_DOT_ON : "bg-[var(--appkit-color-text-faint)]"}`, rounded: "full", "aria-label": isConnected ? labels.connected : labels.disconnected })] }), isLoading && (renderLoadingIndicator?.() ?? null)] }), error ?? null, renderMessages(), renderInput()] }));
|
|
6
6
|
}
|