@mohasinac/appkit 4.1.1 → 4.1.3

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.
Files changed (187) hide show
  1. package/dist/_internal/client/features/maintenance/index.d.ts +2 -0
  2. package/dist/_internal/client/features/maintenance/index.js +1 -0
  3. package/dist/_internal/client/features/maintenance/views/CloudLogsListView.d.ts +9 -0
  4. package/dist/_internal/client/features/maintenance/views/CloudLogsListView.js +55 -0
  5. package/dist/_internal/server/features/auctions/index.d.ts +1 -1
  6. package/dist/_internal/server/features/auctions/index.js +1 -1
  7. package/dist/_internal/server/features/auctions/service.js +2 -2
  8. package/dist/_internal/server/features/maintenance/cloud-logs-data.d.ts +50 -0
  9. package/dist/_internal/server/features/maintenance/cloud-logs-data.js +152 -0
  10. package/dist/_internal/server/jobs/core/onOrderCreate.d.ts +4 -12
  11. package/dist/_internal/server/jobs/core/onOrderCreate.js +3 -3
  12. package/dist/_internal/server/jobs/core/onProductWrite.js +14 -2
  13. package/dist/_internal/shared/features/auctions/config.d.ts +1 -1
  14. package/dist/_internal/shared/features/auctions/config.js +1 -1
  15. package/dist/_internal/shared/features/auctions/schema.js +1 -1
  16. package/dist/_internal/shared/features/cart/schema.js +2 -2
  17. package/dist/_internal/shared/features/events/schema.js +1 -1
  18. package/dist/_internal/shared/features/orders/schema.js +1 -1
  19. package/dist/_internal/shared/features/products/schema.js +3 -3
  20. package/dist/_internal/shared/features/promotions/schema.js +3 -3
  21. package/dist/_internal/shared/fees/calculator.d.ts +6 -7
  22. package/dist/client.d.ts +4 -4
  23. package/dist/client.js +4 -2
  24. package/dist/constants/api-endpoints.d.ts +9 -6
  25. package/dist/constants/api-endpoints.js +3 -2
  26. package/dist/contracts/client-payment-gateway.d.ts +1 -2
  27. package/dist/features/about/components/AboutView.d.ts +6 -16
  28. package/dist/features/about/components/AboutView.js +3 -3
  29. package/dist/features/about/index.d.ts +2 -1
  30. package/dist/features/about/schemas/firestore.d.ts +47 -0
  31. package/dist/features/about/schemas/firestore.js +6 -0
  32. package/dist/features/about/schemas/index.d.ts +210 -0
  33. package/dist/features/about/schemas/index.js +45 -0
  34. package/dist/features/account/hooks/useProfile.js +3 -0
  35. package/dist/features/admin/components/AdminCarouselGroupEditorView.d.ts +6 -0
  36. package/dist/features/admin/components/AdminCarouselGroupEditorView.js +50 -0
  37. package/dist/features/admin/components/AdminCartsView.js +16 -3
  38. package/dist/features/admin/components/AdminCouponEditorView.js +2 -2
  39. package/dist/features/admin/components/AdminCouponsView.js +14 -4
  40. package/dist/features/admin/components/AdminEmployeeEditorView.js +1 -42
  41. package/dist/features/admin/components/AdminMediaView.js +1 -1
  42. package/dist/features/admin/components/AdminNotificationsView.js +31 -19
  43. package/dist/features/admin/components/AdminOrdersView.js +7 -0
  44. package/dist/features/admin/components/AdminPayoutsView.js +18 -3
  45. package/dist/features/admin/components/AdminProductsView.js +17 -2
  46. package/dist/features/admin/components/AdminReviewsView.js +16 -2
  47. package/dist/features/admin/components/AdminScammersView.js +7 -0
  48. package/dist/features/admin/components/AdminSectionsView.js +4 -0
  49. package/dist/features/admin/components/AdminSiteConfigGuideView.js +1 -1
  50. package/dist/features/admin/components/AdminSiteSettingsView.js +44 -2
  51. package/dist/features/admin/components/AdminStoreEditorView.d.ts +2 -1
  52. package/dist/features/admin/components/AdminStoreEditorView.js +4 -4
  53. package/dist/features/admin/components/AdminStoresView.js +1 -1
  54. package/dist/features/admin/components/AdminSupportTicketDetailView.js +23 -5
  55. package/dist/features/admin/components/AdminSupportTicketsView.js +20 -2
  56. package/dist/features/admin/components/AdminTesterChecklistItemEditorView.js +4 -1
  57. package/dist/features/admin/components/AdminTesterChecklistView.js +8 -0
  58. package/dist/features/admin/components/index.d.ts +2 -0
  59. package/dist/features/admin/components/index.js +1 -0
  60. package/dist/features/admin/constants/filter-tabs.d.ts +55 -41
  61. package/dist/features/admin/constants/filter-tabs.js +55 -27
  62. package/dist/features/admin/schemas/firestore.d.ts +5 -0
  63. package/dist/features/auctions/actions/bid-actions.js +1 -1
  64. package/dist/features/auctions/components/AuctionDetailPageView.js +2 -2
  65. package/dist/features/auctions/components/AuctionsListView.js +8 -1
  66. package/dist/features/auth/components/LoginForm.js +2 -2
  67. package/dist/features/auth/components/RegisterForm.js +2 -2
  68. package/dist/features/auth/permissions/constants.d.ts +16 -0
  69. package/dist/features/auth/permissions/constants.js +53 -0
  70. package/dist/features/auth/schemas/firestore.js +1 -0
  71. package/dist/features/blog/components/BlogFilters.js +1 -1
  72. package/dist/features/cart/schemas/firestore.d.ts +1 -1
  73. package/dist/features/categories/schemas/firestore.d.ts +1 -1
  74. package/dist/features/consultation/components/ConsultationForm.js +1 -1
  75. package/dist/features/events/components/EventFilters.js +2 -0
  76. package/dist/features/homepage/components/WelcomeSection.js +2 -2
  77. package/dist/features/layout/TitleBarLayout.d.ts +2 -2
  78. package/dist/features/layout/TitleBarLayout.js +4 -4
  79. package/dist/features/media/AvatarUpload.js +7 -3
  80. package/dist/features/media/MediaVideo.js +1 -1
  81. package/dist/features/media/finalize.d.ts +9 -13
  82. package/dist/features/media/finalize.js +23 -74
  83. package/dist/features/media/server.d.ts +1 -1
  84. package/dist/features/media/server.js +1 -1
  85. package/dist/features/orders/hooks/useOrders.js +16 -4
  86. package/dist/features/orders/schemas/firestore.d.ts +5 -5
  87. package/dist/features/payments/schemas/firestore.d.ts +2 -2
  88. package/dist/features/pre-orders/components/PreOrdersListView.js +7 -0
  89. package/dist/features/products/components/ArtStickersListView.js +5 -0
  90. package/dist/features/products/components/ProductDetailPageView.d.ts +7 -1
  91. package/dist/features/products/components/ProductForm.js +14 -1
  92. package/dist/features/products/components/ProductsIndexPageView.js +7 -0
  93. package/dist/features/products/constants/action-defs.d.ts +1 -0
  94. package/dist/features/products/constants/action-defs.js +1 -0
  95. package/dist/features/products/schemas/firestore.d.ts +1 -1
  96. package/dist/features/products/schemas/product-templates.d.ts +1 -1
  97. package/dist/features/products/types/index.d.ts +4 -0
  98. package/dist/features/scams/schemas/index.js +2 -2
  99. package/dist/features/search/components/Search.js +3 -3
  100. package/dist/features/seller/components/SellerAuctionsView.js +27 -2
  101. package/dist/features/seller/components/SellerOrdersView.js +1 -1
  102. package/dist/features/seller/components/SellerPayoutsView.js +24 -10
  103. package/dist/features/seller/components/SellerPreOrdersView.js +12 -4
  104. package/dist/features/seller/components/SellerPrizeDrawsView.js +23 -5
  105. package/dist/features/seller/components/SellerProductShell.d.ts +2 -0
  106. package/dist/features/seller/components/SellerProductShell.js +1 -1
  107. package/dist/features/seller/components/SellerProductsView.js +8 -6
  108. package/dist/features/seller/components/SellerReviewsView.js +27 -6
  109. package/dist/features/seller/components/index.d.ts +0 -2
  110. package/dist/features/seller/components/index.js +0 -1
  111. package/dist/features/stores/components/StoreListingsGuideView.js +2 -1
  112. package/dist/features/stores/components/StoreProductsView.js +1 -1
  113. package/dist/features/stores/schemas/firestore.d.ts +11 -0
  114. package/dist/features/stores/schemas/firestore.js +5 -0
  115. package/dist/features/stores/schemas/index.d.ts +2 -2
  116. package/dist/features/tester/actions/checklist-item-actions.d.ts +6 -0
  117. package/dist/features/tester/actions/checklist-item-actions.js +2 -0
  118. package/dist/features/tester/components/AdminTesterFeedbackIssuesView.js +13 -2
  119. package/dist/features/tester/components/AdminTesterFeedbackListView.js +2 -1
  120. package/dist/features/tester/components/AdminTesterFeedbackReportView.js +9 -5
  121. package/dist/features/tester/components/TesterHubView.js +34 -21
  122. package/dist/features/tester/repository/tester-checklist-item.repository.js +1 -0
  123. package/dist/features/tester/repository/tester-checklist-response.repository.d.ts +18 -4
  124. package/dist/features/tester/repository/tester-checklist-response.repository.js +43 -8
  125. package/dist/features/tester/schemas/firestore.d.ts +8 -3
  126. package/dist/features/tester/schemas/firestore.js +6 -0
  127. package/dist/features/tester/seed-data/tester-checklist-seed-data.js +21 -9
  128. package/dist/features/tester/utils/phases.d.ts +31 -0
  129. package/dist/features/tester/utils/phases.js +46 -0
  130. package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +1 -1
  131. package/dist/features/whatsapp-bot/types/index.d.ts +1 -1
  132. package/dist/features/wishlist/types/index.d.ts +3 -0
  133. package/dist/index.d.ts +11 -4
  134. package/dist/index.js +15 -7
  135. package/dist/next/components/NotFoundView.js +2 -1
  136. package/dist/next/routing/route-map.d.ts +4 -12
  137. package/dist/next/routing/route-map.js +2 -4
  138. package/dist/providers/db-firebase/admin.d.ts +1 -0
  139. package/dist/providers/db-firebase/admin.js +1 -1
  140. package/dist/schemas/registry.d.ts +2 -2
  141. package/dist/seed/addresses-seed-data.js +18 -18
  142. package/dist/seed/bids-seed-data.js +4 -4
  143. package/dist/seed/blog-posts-seed-data.js +82 -82
  144. package/dist/seed/carousel-slides-seed-data.js +14 -10
  145. package/dist/seed/carousels-seed-data.js +3 -3
  146. package/dist/seed/cart-seed-data.js +92 -92
  147. package/dist/seed/claimed-coupons-seed-data.js +10 -10
  148. package/dist/seed/conversations-seed-data.js +75 -75
  149. package/dist/seed/coupon-usage-seed-data.js +12 -12
  150. package/dist/seed/coupons-seed-data.js +41 -41
  151. package/dist/seed/events-seed-data.js +105 -105
  152. package/dist/seed/grouped-listings-seed-data.d.ts +2 -137
  153. package/dist/seed/grouped-listings-seed-data.js +79 -143
  154. package/dist/seed/history-seed-data.js +38 -38
  155. package/dist/seed/homepage-sections-seed-data.js +9 -9
  156. package/dist/seed/notifications-seed-data.js +56 -56
  157. package/dist/seed/offers-seed-data.js +91 -91
  158. package/dist/seed/orders-seed-data.js +121 -106
  159. package/dist/seed/payouts-seed-data.js +42 -42
  160. package/dist/seed/products-auctions-seed-data.js +10 -2
  161. package/dist/seed/products-standard-seed-data.js +40 -8
  162. package/dist/seed/reviews-seed-data.js +42 -23
  163. package/dist/seed/scammers-seed-data.js +22 -22
  164. package/dist/seed/sessions-seed-data.js +7 -7
  165. package/dist/seed/shipments-seed-data.js +10 -10
  166. package/dist/seed/site-settings-seed-data.js +82 -0
  167. package/dist/seed/store-addresses-seed-data.js +2 -2
  168. package/dist/seed/store-extensions-seed-data.js +93 -93
  169. package/dist/seed/stores-seed-data.js +2 -0
  170. package/dist/seed/support-tickets-seed-data.js +47 -47
  171. package/dist/seed/users-seed-data.js +55 -89
  172. package/dist/seed/wishlists-seed-data.js +22 -22
  173. package/dist/server.d.ts +2 -1
  174. package/dist/server.js +5 -5
  175. package/dist/styles.css +1 -1
  176. package/dist/tailwind-utilities.css +1 -1
  177. package/dist/ui/components/PageLoader.js +8 -3
  178. package/dist/ui/components/Select.d.ts +8 -1
  179. package/dist/ui/components/Select.js +2 -2
  180. package/dist/ui/components/SiteMark.d.ts +23 -0
  181. package/dist/ui/components/SiteMark.js +76 -0
  182. package/dist/ui/index.d.ts +2 -0
  183. package/dist/ui/index.js +1 -0
  184. package/dist/validation/schemas.d.ts +0 -2
  185. package/dist/validation/schemas.js +0 -2
  186. package/package.json +1 -1
  187. package/scripts/seed-cli.mjs +17 -15
@@ -173,6 +173,8 @@ export declare const ADMIN_ENDPOINTS: {
173
173
  readonly CAROUSEL: "/api/admin/carousel";
174
174
  readonly CAROUSEL_BY_ID: (id: string) => string;
175
175
  readonly CAROUSEL_REORDER: "/api/admin/carousel/reorder";
176
+ readonly CAROUSELS: "/api/admin/carousels";
177
+ readonly CAROUSELS_BY_ID: (id: string) => string;
176
178
  readonly NAVIGATION: "/api/admin/navigation";
177
179
  readonly NAVIGATION_BY_ID: (id: string) => string;
178
180
  readonly ADMIN_SITE: "/api/admin/site";
@@ -201,6 +203,7 @@ export declare const ADMIN_ENDPOINTS: {
201
203
  readonly ADMIN_FULFILLMENT: (storeId: string) => string;
202
204
  readonly CHECKOUT_BYPASS: "/api/admin/checkout-bypass";
203
205
  readonly MAINTENANCE_ANALYSIS: "/api/admin/maintenance/analysis";
206
+ readonly MAINTENANCE_CLOUD_LOGS: "/api/admin/maintenance/cloud-logs";
204
207
  readonly MEDIA_LIST: "/api/admin/media";
205
208
  };
206
209
  export declare const CHAT_ENDPOINTS: {
@@ -383,8 +386,6 @@ export declare const SELLER_ENDPOINTS: {
383
386
  readonly ANALYTICS_ALERT_BY_ID: (id: string) => string;
384
387
  readonly STORE_CATEGORIES: "/api/store/categories";
385
388
  readonly STORE_CATEGORY_BY_ID: (id: string) => string;
386
- readonly TEMPLATES: "/api/store/templates";
387
- readonly TEMPLATE_BY_ID: (id: string) => string;
388
389
  readonly PAYOUT_METHODS: "/api/store/payout-methods";
389
390
  readonly PAYOUT_METHOD_BY_ID: (id: string) => string;
390
391
  readonly SHIPPING_CONFIGS: "/api/store/shipping-configs";
@@ -620,6 +621,8 @@ export declare const API_ENDPOINTS: {
620
621
  readonly CAROUSEL: "/api/admin/carousel";
621
622
  readonly CAROUSEL_BY_ID: (id: string) => string;
622
623
  readonly CAROUSEL_REORDER: "/api/admin/carousel/reorder";
624
+ readonly CAROUSELS: "/api/admin/carousels";
625
+ readonly CAROUSELS_BY_ID: (id: string) => string;
623
626
  readonly NAVIGATION: "/api/admin/navigation";
624
627
  readonly NAVIGATION_BY_ID: (id: string) => string;
625
628
  readonly ADMIN_SITE: "/api/admin/site";
@@ -648,6 +651,7 @@ export declare const API_ENDPOINTS: {
648
651
  readonly ADMIN_FULFILLMENT: (storeId: string) => string;
649
652
  readonly CHECKOUT_BYPASS: "/api/admin/checkout-bypass";
650
653
  readonly MAINTENANCE_ANALYSIS: "/api/admin/maintenance/analysis";
654
+ readonly MAINTENANCE_CLOUD_LOGS: "/api/admin/maintenance/cloud-logs";
651
655
  readonly MEDIA_LIST: "/api/admin/media";
652
656
  };
653
657
  readonly CHAT: {
@@ -830,8 +834,6 @@ export declare const API_ENDPOINTS: {
830
834
  readonly ANALYTICS_ALERT_BY_ID: (id: string) => string;
831
835
  readonly STORE_CATEGORIES: "/api/store/categories";
832
836
  readonly STORE_CATEGORY_BY_ID: (id: string) => string;
833
- readonly TEMPLATES: "/api/store/templates";
834
- readonly TEMPLATE_BY_ID: (id: string) => string;
835
837
  readonly PAYOUT_METHODS: "/api/store/payout-methods";
836
838
  readonly PAYOUT_METHOD_BY_ID: (id: string) => string;
837
839
  readonly SHIPPING_CONFIGS: "/api/store/shipping-configs";
@@ -1069,6 +1071,8 @@ export declare const API_ROUTES: {
1069
1071
  readonly CAROUSEL: "/api/admin/carousel";
1070
1072
  readonly CAROUSEL_BY_ID: (id: string) => string;
1071
1073
  readonly CAROUSEL_REORDER: "/api/admin/carousel/reorder";
1074
+ readonly CAROUSELS: "/api/admin/carousels";
1075
+ readonly CAROUSELS_BY_ID: (id: string) => string;
1072
1076
  readonly NAVIGATION: "/api/admin/navigation";
1073
1077
  readonly NAVIGATION_BY_ID: (id: string) => string;
1074
1078
  readonly ADMIN_SITE: "/api/admin/site";
@@ -1097,6 +1101,7 @@ export declare const API_ROUTES: {
1097
1101
  readonly ADMIN_FULFILLMENT: (storeId: string) => string;
1098
1102
  readonly CHECKOUT_BYPASS: "/api/admin/checkout-bypass";
1099
1103
  readonly MAINTENANCE_ANALYSIS: "/api/admin/maintenance/analysis";
1104
+ readonly MAINTENANCE_CLOUD_LOGS: "/api/admin/maintenance/cloud-logs";
1100
1105
  readonly MEDIA_LIST: "/api/admin/media";
1101
1106
  };
1102
1107
  readonly CHAT: {
@@ -1279,8 +1284,6 @@ export declare const API_ROUTES: {
1279
1284
  readonly ANALYTICS_ALERT_BY_ID: (id: string) => string;
1280
1285
  readonly STORE_CATEGORIES: "/api/store/categories";
1281
1286
  readonly STORE_CATEGORY_BY_ID: (id: string) => string;
1282
- readonly TEMPLATES: "/api/store/templates";
1283
- readonly TEMPLATE_BY_ID: (id: string) => string;
1284
1287
  readonly PAYOUT_METHODS: "/api/store/payout-methods";
1285
1288
  readonly PAYOUT_METHOD_BY_ID: (id: string) => string;
1286
1289
  readonly SHIPPING_CONFIGS: "/api/store/shipping-configs";
@@ -201,6 +201,8 @@ export const ADMIN_ENDPOINTS = {
201
201
  CAROUSEL: "/api/admin/carousel",
202
202
  CAROUSEL_BY_ID: (id) => `/api/admin/carousel/${id}`,
203
203
  CAROUSEL_REORDER: "/api/admin/carousel/reorder",
204
+ CAROUSELS: "/api/admin/carousels",
205
+ CAROUSELS_BY_ID: (id) => `/api/admin/carousels/${id}`,
204
206
  NAVIGATION: "/api/admin/navigation",
205
207
  NAVIGATION_BY_ID: (id) => `/api/admin/navigation/${id}`,
206
208
  ADMIN_SITE: "/api/admin/site",
@@ -229,6 +231,7 @@ export const ADMIN_ENDPOINTS = {
229
231
  ADMIN_FULFILLMENT: (storeId) => `/api/store/fulfillment?storeId=${encodeURIComponent(storeId)}`,
230
232
  CHECKOUT_BYPASS: "/api/admin/checkout-bypass",
231
233
  MAINTENANCE_ANALYSIS: "/api/admin/maintenance/analysis",
234
+ MAINTENANCE_CLOUD_LOGS: "/api/admin/maintenance/cloud-logs",
232
235
  MEDIA_LIST: "/api/admin/media",
233
236
  };
234
237
  // ---------------------------------------------------------------------------
@@ -501,8 +504,6 @@ export const SELLER_ENDPOINTS = {
501
504
  ANALYTICS_ALERT_BY_ID: (id) => `/api/store/analytics/alerts/${id}`,
502
505
  STORE_CATEGORIES: "/api/store/categories",
503
506
  STORE_CATEGORY_BY_ID: (id) => `/api/store/categories/${id}`,
504
- TEMPLATES: "/api/store/templates",
505
- TEMPLATE_BY_ID: (id) => `/api/store/templates/${id}`,
506
507
  PAYOUT_METHODS: "/api/store/payout-methods",
507
508
  PAYOUT_METHOD_BY_ID: (id) => `/api/store/payout-methods/${id}`,
508
509
  SHIPPING_CONFIGS: "/api/store/shipping-configs",
@@ -23,8 +23,7 @@ export interface OpenGatewayOptions {
23
23
  gatewayOrderId: string;
24
24
  /** Public key / publishable key for the gateway SDK. */
25
25
  publicKey: string;
26
- /** Amount in the gateway's smallest currency unit (e.g. paise, cents). */
27
- amount: number;
26
+ /** Amount in the gateway's smallest currency unit (e.g. paise, cents). */ amount: number;
28
27
  /** ISO 4217 currency code. */
29
28
  currency: string;
30
29
  /** Display name shown in the payment modal. */
@@ -1,19 +1,6 @@
1
1
  import React from "react";
2
- export interface AboutHowItem {
3
- title: string;
4
- text: string;
5
- icon: string;
6
- tone?: "indigo" | "teal" | "amber" | "rose";
7
- }
8
- export interface AboutValueItem {
9
- title: string;
10
- text: string;
11
- icon: string;
12
- }
13
- export interface AboutMilestone {
14
- year: string;
15
- text: string;
16
- }
2
+ import type { AboutHowItem, AboutValueItem, AboutMilestone, AboutTeamMember } from "../schemas/firestore";
3
+ export type { AboutHowItem, AboutValueItem, AboutMilestone, AboutTeamMember } from "../schemas/firestore";
17
4
  export interface AboutViewProps {
18
5
  labels?: {
19
6
  title?: string;
@@ -23,6 +10,8 @@ export interface AboutViewProps {
23
10
  howItWorksTitle?: string;
24
11
  valuesTitle?: string;
25
12
  milestonesTitle?: string;
13
+ teamTitle?: string;
14
+ teamSubtitle?: string;
26
15
  ctaTitle?: string;
27
16
  ctaSell?: string;
28
17
  ctaShop?: string;
@@ -30,8 +19,9 @@ export interface AboutViewProps {
30
19
  howItems?: AboutHowItem[];
31
20
  valueItems?: AboutValueItem[];
32
21
  milestones?: AboutMilestone[];
22
+ teamMembers?: AboutTeamMember[];
33
23
  ctaBannerClass?: string;
34
24
  /** Render the CTA action buttons */
35
25
  renderCtaButtons?: () => React.ReactNode;
36
26
  }
37
- export declare function AboutView({ labels, howItems, valueItems, milestones, ctaBannerClass, renderCtaButtons, }: AboutViewProps): React.JSX.Element;
27
+ export declare function AboutView({ labels, howItems, valueItems, milestones, teamMembers, ctaBannerClass, renderCtaButtons, }: AboutViewProps): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Card, Div, Heading, Row, Section, Span, Stack, Text } from "../../../ui";
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(Stack, { gap: "3", surface: "default", padding: "lg", rounded: "xl", border: "default", 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] }) }))] })] })] }));
2
+ import { Avatar, Badge, Card, Div, Heading, Row, Section, Span, Stack, Text } from "../../../ui";
3
+ export function AboutView({ labels = {}, howItems = [], valueItems = [], milestones = [], teamMembers = [], 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(Stack, { gap: "3", surface: "default", padding: "lg", rounded: "xl", border: "default", 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))) })] }), teamMembers.length > 0 && (_jsxs(Section, { children: [_jsx(Heading, { level: 2, className: "mb-2", align: "center", children: labels.teamTitle }), labels.teamSubtitle && (_jsx(Text, { size: "lg", variant: "secondary", align: "center", className: "mb-12 max-w-2xl mx-auto", children: labels.teamSubtitle })), _jsx(Div, { className: "grid md:grid-cols-3", gap: "6", children: teamMembers.map((member) => (_jsxs(Stack, { gap: "3", surface: "default", padding: "lg", rounded: "xl", border: "default", align: "center", className: "text-center", children: [_jsx(Avatar, { src: member.photoUrl, name: member.name, alt: member.name, size: "lg" }), _jsx(Heading, { level: 3, children: member.name }), _jsxs(Row, { gap: "xs", wrap: true, justify: "center", children: [_jsx(Span, { size: "xs", weight: "bold", className: "text-primary tracking-wide", transform: "uppercase", children: member.role }), member.isFounder && _jsx(Badge, { variant: "primary", size: "xs", children: "Founder" }), member.isDeveloper && _jsx(Badge, { variant: "secondary", size: "xs", children: "Developer" })] }), _jsx(Text, { size: "sm", variant: "secondary", className: "leading-relaxed", children: member.bio })] }, member.name))) })] })), _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
  }
@@ -1,5 +1,6 @@
1
1
  export { AboutView } from "./components/AboutView";
2
- export type { AboutViewProps, AboutHowItem, AboutValueItem, AboutMilestone, } from "./components/AboutView";
2
+ export type { AboutViewProps, AboutHowItem, AboutValueItem, AboutMilestone, AboutTeamMember, } from "./components/AboutView";
3
+ export type { AboutContentDocument } from "./schemas/firestore";
3
4
  export { TrackOrderView } from "./components/TrackOrderView";
4
5
  export type { TrackOrderViewProps } from "./components/TrackOrderView";
5
6
  export { FeesView } from "./components/FeesView";
@@ -0,0 +1,47 @@
1
+ /**
2
+ * About Us page content — stored at `siteSettings.aboutContent`
3
+ * (singleton doc, not its own collection). Replaces the previous untyped
4
+ * `Record<string, string>` shape that only covered 5 loose fields.
5
+ */
6
+ export interface AboutHowItem {
7
+ title: string;
8
+ text: string;
9
+ icon: string;
10
+ tone?: "indigo" | "teal" | "amber" | "rose";
11
+ }
12
+ export interface AboutValueItem {
13
+ title: string;
14
+ text: string;
15
+ icon: string;
16
+ }
17
+ export interface AboutMilestone {
18
+ year: string;
19
+ text: string;
20
+ }
21
+ export interface AboutTeamMember {
22
+ name: string;
23
+ role: string;
24
+ bio: string;
25
+ /** `/media/<slug>` proxy URL — never a raw Storage URL. */
26
+ photoUrl?: string;
27
+ isFounder?: boolean;
28
+ isDeveloper?: boolean;
29
+ }
30
+ export interface AboutContentDocument {
31
+ title: string;
32
+ subtitle: string;
33
+ missionTitle: string;
34
+ missionText: string;
35
+ howItWorksTitle: string;
36
+ howItems: AboutHowItem[];
37
+ valuesTitle: string;
38
+ valueItems: AboutValueItem[];
39
+ milestonesTitle: string;
40
+ milestones: AboutMilestone[];
41
+ teamTitle: string;
42
+ teamSubtitle: string;
43
+ teamMembers: AboutTeamMember[];
44
+ ctaTitle: string;
45
+ ctaSell: string;
46
+ ctaShop: string;
47
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * About Us page content — stored at `siteSettings.aboutContent`
3
+ * (singleton doc, not its own collection). Replaces the previous untyped
4
+ * `Record<string, string>` shape that only covered 5 loose fields.
5
+ */
6
+ export {};
@@ -0,0 +1,210 @@
1
+ export * from "./firestore";
2
+ import { z } from "zod";
3
+ export declare const aboutHowItemSchema: z.ZodObject<{
4
+ title: z.ZodString;
5
+ text: z.ZodString;
6
+ icon: z.ZodString;
7
+ tone: z.ZodOptional<z.ZodEnum<["indigo", "teal", "amber", "rose"]>>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ title: string;
10
+ text: string;
11
+ icon: string;
12
+ tone?: "indigo" | "teal" | "amber" | "rose" | undefined;
13
+ }, {
14
+ title: string;
15
+ text: string;
16
+ icon: string;
17
+ tone?: "indigo" | "teal" | "amber" | "rose" | undefined;
18
+ }>;
19
+ export declare const aboutValueItemSchema: z.ZodObject<{
20
+ title: z.ZodString;
21
+ text: z.ZodString;
22
+ icon: z.ZodString;
23
+ }, "strip", z.ZodTypeAny, {
24
+ title: string;
25
+ text: string;
26
+ icon: string;
27
+ }, {
28
+ title: string;
29
+ text: string;
30
+ icon: string;
31
+ }>;
32
+ export declare const aboutMilestoneSchema: z.ZodObject<{
33
+ year: z.ZodString;
34
+ text: z.ZodString;
35
+ }, "strip", z.ZodTypeAny, {
36
+ text: string;
37
+ year: string;
38
+ }, {
39
+ text: string;
40
+ year: string;
41
+ }>;
42
+ export declare const aboutTeamMemberSchema: z.ZodObject<{
43
+ name: z.ZodString;
44
+ role: z.ZodString;
45
+ bio: z.ZodString;
46
+ photoUrl: z.ZodOptional<z.ZodString>;
47
+ isFounder: z.ZodOptional<z.ZodBoolean>;
48
+ isDeveloper: z.ZodOptional<z.ZodBoolean>;
49
+ }, "strip", z.ZodTypeAny, {
50
+ role: string;
51
+ name: string;
52
+ bio: string;
53
+ photoUrl?: string | undefined;
54
+ isFounder?: boolean | undefined;
55
+ isDeveloper?: boolean | undefined;
56
+ }, {
57
+ role: string;
58
+ name: string;
59
+ bio: string;
60
+ photoUrl?: string | undefined;
61
+ isFounder?: boolean | undefined;
62
+ isDeveloper?: boolean | undefined;
63
+ }>;
64
+ export declare const aboutContentSchema: z.ZodObject<{
65
+ title: z.ZodString;
66
+ subtitle: z.ZodString;
67
+ missionTitle: z.ZodString;
68
+ missionText: z.ZodString;
69
+ howItWorksTitle: z.ZodString;
70
+ howItems: z.ZodArray<z.ZodObject<{
71
+ title: z.ZodString;
72
+ text: z.ZodString;
73
+ icon: z.ZodString;
74
+ tone: z.ZodOptional<z.ZodEnum<["indigo", "teal", "amber", "rose"]>>;
75
+ }, "strip", z.ZodTypeAny, {
76
+ title: string;
77
+ text: string;
78
+ icon: string;
79
+ tone?: "indigo" | "teal" | "amber" | "rose" | undefined;
80
+ }, {
81
+ title: string;
82
+ text: string;
83
+ icon: string;
84
+ tone?: "indigo" | "teal" | "amber" | "rose" | undefined;
85
+ }>, "many">;
86
+ valuesTitle: z.ZodString;
87
+ valueItems: z.ZodArray<z.ZodObject<{
88
+ title: z.ZodString;
89
+ text: z.ZodString;
90
+ icon: z.ZodString;
91
+ }, "strip", z.ZodTypeAny, {
92
+ title: string;
93
+ text: string;
94
+ icon: string;
95
+ }, {
96
+ title: string;
97
+ text: string;
98
+ icon: string;
99
+ }>, "many">;
100
+ milestonesTitle: z.ZodString;
101
+ milestones: z.ZodArray<z.ZodObject<{
102
+ year: z.ZodString;
103
+ text: z.ZodString;
104
+ }, "strip", z.ZodTypeAny, {
105
+ text: string;
106
+ year: string;
107
+ }, {
108
+ text: string;
109
+ year: string;
110
+ }>, "many">;
111
+ teamTitle: z.ZodString;
112
+ teamSubtitle: z.ZodString;
113
+ teamMembers: z.ZodArray<z.ZodObject<{
114
+ name: z.ZodString;
115
+ role: z.ZodString;
116
+ bio: z.ZodString;
117
+ photoUrl: z.ZodOptional<z.ZodString>;
118
+ isFounder: z.ZodOptional<z.ZodBoolean>;
119
+ isDeveloper: z.ZodOptional<z.ZodBoolean>;
120
+ }, "strip", z.ZodTypeAny, {
121
+ role: string;
122
+ name: string;
123
+ bio: string;
124
+ photoUrl?: string | undefined;
125
+ isFounder?: boolean | undefined;
126
+ isDeveloper?: boolean | undefined;
127
+ }, {
128
+ role: string;
129
+ name: string;
130
+ bio: string;
131
+ photoUrl?: string | undefined;
132
+ isFounder?: boolean | undefined;
133
+ isDeveloper?: boolean | undefined;
134
+ }>, "many">;
135
+ ctaTitle: z.ZodString;
136
+ ctaSell: z.ZodString;
137
+ ctaShop: z.ZodString;
138
+ }, "strip", z.ZodTypeAny, {
139
+ title: string;
140
+ subtitle: string;
141
+ missionTitle: string;
142
+ missionText: string;
143
+ howItWorksTitle: string;
144
+ valuesTitle: string;
145
+ milestonesTitle: string;
146
+ teamTitle: string;
147
+ teamSubtitle: string;
148
+ ctaTitle: string;
149
+ ctaSell: string;
150
+ ctaShop: string;
151
+ howItems: {
152
+ title: string;
153
+ text: string;
154
+ icon: string;
155
+ tone?: "indigo" | "teal" | "amber" | "rose" | undefined;
156
+ }[];
157
+ valueItems: {
158
+ title: string;
159
+ text: string;
160
+ icon: string;
161
+ }[];
162
+ milestones: {
163
+ text: string;
164
+ year: string;
165
+ }[];
166
+ teamMembers: {
167
+ role: string;
168
+ name: string;
169
+ bio: string;
170
+ photoUrl?: string | undefined;
171
+ isFounder?: boolean | undefined;
172
+ isDeveloper?: boolean | undefined;
173
+ }[];
174
+ }, {
175
+ title: string;
176
+ subtitle: string;
177
+ missionTitle: string;
178
+ missionText: string;
179
+ howItWorksTitle: string;
180
+ valuesTitle: string;
181
+ milestonesTitle: string;
182
+ teamTitle: string;
183
+ teamSubtitle: string;
184
+ ctaTitle: string;
185
+ ctaSell: string;
186
+ ctaShop: string;
187
+ howItems: {
188
+ title: string;
189
+ text: string;
190
+ icon: string;
191
+ tone?: "indigo" | "teal" | "amber" | "rose" | undefined;
192
+ }[];
193
+ valueItems: {
194
+ title: string;
195
+ text: string;
196
+ icon: string;
197
+ }[];
198
+ milestones: {
199
+ text: string;
200
+ year: string;
201
+ }[];
202
+ teamMembers: {
203
+ role: string;
204
+ name: string;
205
+ bio: string;
206
+ photoUrl?: string | undefined;
207
+ isFounder?: boolean | undefined;
208
+ isDeveloper?: boolean | undefined;
209
+ }[];
210
+ }>;
@@ -0,0 +1,45 @@
1
+ export * from "./firestore";
2
+ import { z } from "zod";
3
+ const REQUIRED_TITLE = "Title is required";
4
+ const REQUIRED_TEXT = "Text is required";
5
+ export const aboutHowItemSchema = z.object({
6
+ title: z.string().min(1, REQUIRED_TITLE),
7
+ text: z.string().min(1, REQUIRED_TEXT),
8
+ icon: z.string().min(1, "Icon is required"),
9
+ tone: z.enum(["indigo", "teal", "amber", "rose"]).optional(),
10
+ });
11
+ export const aboutValueItemSchema = z.object({
12
+ title: z.string().min(1, REQUIRED_TITLE),
13
+ text: z.string().min(1, REQUIRED_TEXT),
14
+ icon: z.string().min(1, "Icon is required"),
15
+ });
16
+ export const aboutMilestoneSchema = z.object({
17
+ year: z.string().min(1, "Year is required"),
18
+ text: z.string().min(1, REQUIRED_TEXT),
19
+ });
20
+ export const aboutTeamMemberSchema = z.object({
21
+ name: z.string().min(1, "Name is required"),
22
+ role: z.string().min(1, "Role is required"),
23
+ bio: z.string().min(1, "Bio is required"),
24
+ photoUrl: z.string().optional(),
25
+ isFounder: z.boolean().optional(),
26
+ isDeveloper: z.boolean().optional(),
27
+ });
28
+ export const aboutContentSchema = z.object({
29
+ title: z.string().min(1, REQUIRED_TITLE),
30
+ subtitle: z.string().min(1, "Subtitle is required"),
31
+ missionTitle: z.string().min(1, "Mission title is required"),
32
+ missionText: z.string().min(1, "Mission text is required"),
33
+ howItWorksTitle: z.string().min(1, "How it works title is required"),
34
+ howItems: z.array(aboutHowItemSchema),
35
+ valuesTitle: z.string().min(1, "Values title is required"),
36
+ valueItems: z.array(aboutValueItemSchema),
37
+ milestonesTitle: z.string().min(1, "Milestones title is required"),
38
+ milestones: z.array(aboutMilestoneSchema),
39
+ teamTitle: z.string().min(1, "Team title is required"),
40
+ teamSubtitle: z.string().min(1, "Team subtitle is required"),
41
+ teamMembers: z.array(aboutTeamMemberSchema),
42
+ ctaTitle: z.string().min(1, "CTA title is required"),
43
+ ctaSell: z.string().min(1, "Sell CTA copy is required"),
44
+ ctaShop: z.string().min(1, "Shop CTA copy is required"),
45
+ });
@@ -17,6 +17,9 @@ export function useUpdateCurrentProfile(options) {
17
17
  mutationFn: (data) => apiClient.patch(endpoint, data),
18
18
  onSuccess: async (data) => {
19
19
  await queryClient.invalidateQueries({ queryKey: ["profile"] });
20
+ // useCurrentUser()/useRBAC() read identity via a separate ["auth","me"]
21
+ // query — without this, displayName/photoURL stay stale for up to 5min.
22
+ await queryClient.invalidateQueries({ queryKey: ["auth", "me"] });
20
23
  options?.onSuccess?.(data);
21
24
  },
22
25
  onError: options?.onError,
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ import type { StackedViewShellProps } from "../../../ui";
3
+ export interface AdminCarouselGroupEditorViewProps extends Omit<StackedViewShellProps, "sections"> {
4
+ onCreated?: (id: string) => void;
5
+ }
6
+ export declare function AdminCarouselGroupEditorView({ onCreated, ...rest }: AdminCarouselGroupEditorViewProps): React.JSX.Element;
@@ -0,0 +1,50 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import React from "react";
4
+ import { z } from "zod";
5
+ import { useRouter } from "next/navigation";
6
+ import { Button, Form, Row, StackedViewShell, useToast } from "../../../ui";
7
+ import { FieldInput, FieldSelect } from "../../../ui/forms";
8
+ import { useApiMutation } from "@mohasinac/appkit/client";
9
+ import { apiClient } from "../../../http";
10
+ import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
11
+ import { ROUTES } from "../../../next/routing/route-map";
12
+ const carouselGroupFormSchema = z.object({
13
+ name: z.string().min(1, "Name is required").max(200),
14
+ status: z.enum(["active", "draft"]),
15
+ });
16
+ export function AdminCarouselGroupEditorView({ onCreated, ...rest }) {
17
+ const { showToast } = useToast();
18
+ const router = useRouter();
19
+ const [name, setName] = React.useState("");
20
+ const [status, setStatus] = React.useState("draft");
21
+ const createMutation = useApiMutation({
22
+ mutationFn: () => apiClient.post(ADMIN_ENDPOINTS.CAROUSELS, { name, status }),
23
+ onSuccess: (res) => {
24
+ const id = res?.data?.id;
25
+ showToast("Carousel created.", "success");
26
+ if (id) {
27
+ if (onCreated)
28
+ onCreated(id);
29
+ else
30
+ router.push(String(ROUTES.ADMIN.CAROUSEL_DETAIL(id)));
31
+ }
32
+ },
33
+ onError: (err) => {
34
+ showToast(err?.message ?? "Failed to create carousel.", "error");
35
+ },
36
+ });
37
+ return (_jsx(StackedViewShell, { portal: "admin", ...rest, title: "New Named Carousel", sections: [
38
+ _jsx(Form, { schema: carouselGroupFormSchema, onSubmit: (e) => e.preventDefault(), spacing: "md", children: ({ setFieldError, clearErrors }) => (_jsxs(_Fragment, { children: [_jsx(FieldInput, { name: "name", label: "Carousel name", value: name, onChange: (v) => setName(v), required: true, placeholder: "e.g. Homepage Hero" }), _jsx(FieldSelect, { name: "status", label: "Status", value: status, onChange: (v) => setStatus(v), options: [
39
+ { value: "draft", label: "Draft" },
40
+ { value: "active", label: "Active" },
41
+ ] }), _jsx(Row, { gap: "3", padding: "t-xs", children: _jsx(Button, { type: "submit", isLoading: createMutation.isPending, disabled: !name || createMutation.isPending, onClick: () => {
42
+ clearErrors();
43
+ if (!name.trim()) {
44
+ setFieldError("name", "Carousel name is required");
45
+ return;
46
+ }
47
+ createMutation.mutate();
48
+ }, children: "Create carousel" }) })] })) }, "carousel-group-form"),
49
+ ] }));
50
+ }
@@ -1,8 +1,9 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { SIEVE_OP, sieveFilter } from "@mohasinac/appkit";
3
4
  import { sortBy } from "@mohasinac/appkit";
4
5
  import React from "react";
5
- import { ListingLayout } from "../../../ui";
6
+ import { FilterChipGroup, ListingLayout } from "../../../ui";
6
7
  import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
7
8
  import { toRecordArray, toRelativeDate, toStringValue, } from "../hooks/useAdminListingData";
8
9
  import { DataListingView } from "./DataListingView";
@@ -11,7 +12,7 @@ const ADMIN_CARTS_CONFIG = {
11
12
  title: "Carts",
12
13
  searchPlaceholder: "Search by user ID or session",
13
14
  emptyLabel: "No carts found",
14
- filterKeys: [],
15
+ filterKeys: ["ownership"],
15
16
  defaultSort: sortBy("updatedAt", "DESC"),
16
17
  queryKey: ["admin", "carts", "listing"],
17
18
  endpoint: ADMIN_ENDPOINTS.ADMIN_CARTS,
@@ -34,7 +35,19 @@ const ADMIN_CARTS_CONFIG = {
34
35
  };
35
36
  }),
36
37
  getTotal: (response, mappedRows) => typeof response.total === "number" ? response.total : mappedRows.length,
37
- buildFilters: () => undefined,
38
+ buildFilters: (state) =>
39
+ // Guest carts store userId as an empty string (CartDocument.userId is a
40
+ // required string, not optional, see mapRows below). Only the guest-only
41
+ // direction is offered: an authenticated-only filter would need a NEQ
42
+ // on userId combined with the default updatedAt sort, which Firestore
43
+ // rejects (inequality filters require orderBy to match the same
44
+ // field), and CartRepository Sieve config marks userId as not
45
+ // sortable, so no safe workaround sort exists.
46
+ state.ownership === "guest" ? sieveFilter("userId", SIEVE_OP.EQ, "") : undefined,
47
+ renderFilterPanel: ({ pendingFilters, setPendingFilters }) => (_jsx(FilterChipGroup, { label: "Ownership", tabs: [
48
+ { id: "", label: "All" },
49
+ { id: "guest", label: "Guest only" },
50
+ ], value: pendingFilters.ownership ?? "", onChange: (id) => setPendingFilters((p) => ({ ...p, ownership: id })), allId: "" })),
38
51
  };
39
52
  export function AdminCartsView({ children, ...props }) {
40
53
  if (React.Children.count(children) > 0) {
@@ -50,7 +50,7 @@ function toDateInputValue(val) {
50
50
  }
51
51
  }
52
52
  function CouponDiscountFields({ type, discountValue, setDiscountValue, maxDiscount, setMaxDiscount, minPurchase, setMinPurchase, buyQty, setBuyQty, getQty, setGetQty, discountLabel, }) {
53
- return (_jsxs(_Fragment, { children: [type !== "free_shipping" && type !== "buy_x_get_y" && (_jsx(Input, { label: discountLabel, value: discountValue, onChange: (e) => setDiscountValue(e.target.value), type: "number", min: 0, required: true, placeholder: type === "percentage" ? "e.g. 20" : "e.g. 5000" })), type === "percentage" && (_jsx(Input, { label: "Max discount cap (paise, optional)", value: maxDiscount, onChange: (e) => setMaxDiscount(e.target.value), type: "number", min: 0, placeholder: "e.g. 20000", helperText: "Leave blank for no cap." })), (type === "percentage" || type === "fixed") && (_jsx(Input, { label: "Min order value (paise, optional)", value: minPurchase, onChange: (e) => setMinPurchase(e.target.value), type: "number", min: 0, placeholder: "e.g. 50000", helperText: "Leave blank for no minimum." })), type === "buy_x_get_y" && (_jsxs(Div, { layout: "grid", gap: "4", className: "grid-cols-2", children: [_jsx(Input, { label: "Buy quantity", value: buyQty, onChange: (e) => setBuyQty(e.target.value), type: "number", min: 1, required: true }), _jsx(Input, { label: "Get quantity", value: getQty, onChange: (e) => setGetQty(e.target.value), type: "number", min: 1, required: true })] }))] }));
53
+ return (_jsxs(_Fragment, { children: [type !== "free_shipping" && type !== "buy_x_get_y" && (_jsx(Input, { label: discountLabel, value: discountValue, onChange: (e) => setDiscountValue(e.target.value), type: "number", min: 0, required: true, placeholder: type === "percentage" ? "e.g. 20" : "e.g. 5000" })), type === "percentage" && (_jsx(Input, { label: "Max discount cap (\u20B9, optional)", value: maxDiscount, onChange: (e) => setMaxDiscount(e.target.value), type: "number", min: 0, placeholder: "e.g. 200", helperText: "Leave blank for no cap." })), (type === "percentage" || type === "fixed") && (_jsx(Input, { label: "Min order value (\u20B9, optional)", value: minPurchase, onChange: (e) => setMinPurchase(e.target.value), type: "number", min: 0, placeholder: "e.g. 500", helperText: "Leave blank for no minimum." })), type === "buy_x_get_y" && (_jsxs(Div, { layout: "grid", gap: "4", className: "grid-cols-2", children: [_jsx(Input, { label: "Buy quantity", value: buyQty, onChange: (e) => setBuyQty(e.target.value), type: "number", min: 1, required: true }), _jsx(Input, { label: "Get quantity", value: getQty, onChange: (e) => setGetQty(e.target.value), type: "number", min: 1, required: true })] }))] }));
54
54
  }
55
55
  function CouponValidityFields({ startDate, setStartDate, endDate, setEndDate, isActive, setIsActive, totalLimit, setTotalLimit, perUserLimit, setPerUserLimit, isEdit, currentUsage, }) {
56
56
  return (_jsxs(_Fragment, { children: [_jsxs(Div, { layout: "grid", gap: "4", className: "grid-cols-2", children: [_jsx(Input, { label: "Total usage limit (optional)", value: totalLimit, onChange: (e) => setTotalLimit(e.target.value), type: "number", min: 0, placeholder: "Unlimited" }), _jsx(Input, { label: "Per-user limit (optional)", value: perUserLimit, onChange: (e) => setPerUserLimit(e.target.value), type: "number", min: 0, placeholder: "Unlimited" })] }), isEdit && (_jsx(Input, { label: "Current usage", value: String(currentUsage), disabled: true, helperText: "Read-only \u2014 updated by orders." })), _jsxs(Div, { layout: "grid", gap: "4", className: "grid-cols-2", children: [_jsx(Input, { label: "Start date", value: startDate, onChange: (e) => setStartDate(e.target.value), type: "date", required: true }), _jsx(Input, { label: "End date (optional)", value: endDate, onChange: (e) => setEndDate(e.target.value), type: "date", helperText: "Leave blank for no expiry." })] }), _jsx(Toggle, { label: "Active", checked: isActive, onChange: setIsActive })] }));
@@ -203,7 +203,7 @@ export function AdminCouponEditorView({ couponId, onSaved, onDeleted, embedded,
203
203
  const discountLabel = type === "percentage"
204
204
  ? "Discount percentage (%)"
205
205
  : type === "fixed"
206
- ? "Discount amount (paise)"
206
+ ? "Discount amount ()"
207
207
  : "Discount value";
208
208
  const formSection = (_jsxs(_Fragment, { children: [_jsx(Form, { schema: couponFormSchema, onSubmit: (e) => e.preventDefault(), spacing: "md", children: ({ setFieldError, clearErrors }) => (_jsxs(_Fragment, { children: [_jsx(Select, { label: "Coupon type", options: TYPE_OPTIONS, value: type, onValueChange: (v) => setType(v), required: true }), _jsx(FieldInput, { name: "name", label: "Campaign name", value: name, onChange: (v) => handleNameChange(v), required: true, placeholder: "e.g. Summer Sale 20%" }), !isEdit && (_jsx(Input, { label: "Coupon code", value: code, onChange: (e) => {
209
209
  setCode(toCouponCode(e.target.value));