@mohasinac/appkit 2.8.3 → 2.8.5

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 (249) hide show
  1. package/dist/_internal/client/features/layout/SidebarCollapseToggle.js +2 -0
  2. package/dist/_internal/shared/listing-types/action-tracker.js +0 -2
  3. package/dist/client.d.ts +2 -0
  4. package/dist/client.js +2 -0
  5. package/dist/core/hooks/useSiteSettings.d.ts +1 -1
  6. package/dist/core/unit-of-work.js +0 -1
  7. package/dist/features/account/components/NotificationBell.js +1 -0
  8. package/dist/features/account/components/UserOffersPanel.js +1 -0
  9. package/dist/features/account/components/UserSidebar.js +3 -1
  10. package/dist/features/account/hooks/useAccount.d.ts +2 -2
  11. package/dist/features/account/hooks/useAddressSelector.d.ts +1 -1
  12. package/dist/features/account/hooks/useAddresses.d.ts +2 -2
  13. package/dist/features/account/hooks/useNotifications.d.ts +1 -1
  14. package/dist/features/account/hooks/useProfile.d.ts +1 -1
  15. package/dist/features/account/hooks/usePublicProfile.d.ts +2 -2
  16. package/dist/features/admin/components/AdminAllEventEntriesView.js +5 -3
  17. package/dist/features/admin/components/AdminBidsView.js +6 -4
  18. package/dist/features/admin/components/AdminBlogView.js +6 -4
  19. package/dist/features/admin/components/AdminBrandsView.js +8 -6
  20. package/dist/features/admin/components/AdminBundlesView.js +10 -8
  21. package/dist/features/admin/components/AdminCarouselEditorView.js +3 -1
  22. package/dist/features/admin/components/AdminCartsView.js +6 -4
  23. package/dist/features/admin/components/AdminCategoriesView.js +7 -5
  24. package/dist/features/admin/components/AdminClassifiedView.js +4 -3
  25. package/dist/features/admin/components/AdminContactView.js +6 -4
  26. package/dist/features/admin/components/AdminCouponsView.js +6 -4
  27. package/dist/features/admin/components/AdminDigitalCodesView.js +4 -3
  28. package/dist/features/admin/components/AdminFaqsView.js +5 -3
  29. package/dist/features/admin/components/AdminFeaturesView.js +5 -4
  30. package/dist/features/admin/components/AdminGroupedListingsView.js +4 -3
  31. package/dist/features/admin/components/AdminHistoryView.js +4 -3
  32. package/dist/features/admin/components/AdminLiveView.js +4 -3
  33. package/dist/features/admin/components/AdminNewsletterView.js +5 -3
  34. package/dist/features/admin/components/AdminNotificationsView.js +6 -4
  35. package/dist/features/admin/components/AdminOrdersView.js +6 -4
  36. package/dist/features/admin/components/AdminPayoutsView.js +7 -5
  37. package/dist/features/admin/components/AdminPrizeDrawsView.js +6 -4
  38. package/dist/features/admin/components/AdminProductsView.js +7 -5
  39. package/dist/features/admin/components/AdminReturnRequestsView.js +4 -3
  40. package/dist/features/admin/components/AdminReviewsView.js +8 -6
  41. package/dist/features/admin/components/AdminScammersView.js +8 -6
  42. package/dist/features/admin/components/AdminSessionsView.js +6 -4
  43. package/dist/features/admin/components/AdminSidebar.js +3 -1
  44. package/dist/features/admin/components/AdminSiteSettingsView.js +3 -1
  45. package/dist/features/admin/components/AdminStoreAddressesView.js +2 -1
  46. package/dist/features/admin/components/AdminStoresView.js +6 -4
  47. package/dist/features/admin/components/AdminSublistingCategoriesView.js +6 -5
  48. package/dist/features/admin/components/AdminSupportTicketDetailView.js +0 -3
  49. package/dist/features/admin/components/AdminSupportTicketsView.js +8 -6
  50. package/dist/features/admin/components/AdminTeamView.js +6 -4
  51. package/dist/features/admin/components/AdminUsersView.js +6 -4
  52. package/dist/features/admin/components/AdminWishlistsView.js +4 -3
  53. package/dist/features/admin/components/DashboardStats.js +5 -1
  54. package/dist/features/admin/components/analytics/AdminAnalyticsCharts.js +3 -1
  55. package/dist/features/admin/components/analytics/AdminStatCard.js +5 -1
  56. package/dist/features/admin/constants/filter-tabs.d.ts +1 -1
  57. package/dist/features/admin/constants/filter-tabs.js +0 -11
  58. package/dist/features/admin/hooks/useAdmin.d.ts +1 -1
  59. package/dist/features/admin/hooks/useAdminSectionsListing.d.ts +1 -1
  60. package/dist/features/admin/hooks/useChat.d.ts +1 -1
  61. package/dist/features/admin/hooks/useChat.js +1 -0
  62. package/dist/features/admin/types/index.d.ts +1 -1
  63. package/dist/features/auctions/actions/bid-actions.js +4 -2
  64. package/dist/features/auctions/components/AuctionBidsTable.js +5 -1
  65. package/dist/features/auctions/components/AuctionsListView.js +7 -6
  66. package/dist/features/auctions/hooks/useAuctions.d.ts +8 -8
  67. package/dist/features/auth/hooks/useAuth.d.ts +2 -2
  68. package/dist/features/auth/hooks/useAuth.js +1 -0
  69. package/dist/features/blog/actions/blog-actions.js +3 -2
  70. package/dist/features/blog/components/BlogFeaturedCard.js +3 -1
  71. package/dist/features/blog/components/BlogListView.js +5 -1
  72. package/dist/features/blog/components/BlogPostView.js +3 -1
  73. package/dist/features/cart/components/CartDrawer.js +3 -1
  74. package/dist/features/cart/hooks/useCart.d.ts +1 -1
  75. package/dist/features/cart/hooks/useCartQuery.d.ts +1 -1
  76. package/dist/features/cart/hooks/useCheckoutReadQueries.d.ts +2 -2
  77. package/dist/features/cart/hooks/useOrder.d.ts +2 -2
  78. package/dist/features/categories/components/BrandDetailPageView.js +15 -9
  79. package/dist/features/categories/components/CategoriesIndexListing.js +1 -1
  80. package/dist/features/categories/components/CategoriesIndexPageView.js +5 -4
  81. package/dist/features/categories/components/CategoryBundlesListing.js +5 -4
  82. package/dist/features/categories/components/CategoryDetailPageView.js +15 -11
  83. package/dist/features/categories/components/CategoryFilters.d.ts +12 -12
  84. package/dist/features/categories/components/CategoryFilters.js +13 -12
  85. package/dist/features/categories/components/CategoryGrid.js +5 -1
  86. package/dist/features/categories/components/CategoryTableColumns.js +6 -2
  87. package/dist/features/categories/components/CategoryTree.d.ts +1 -1
  88. package/dist/features/categories/components/CategoryTree.js +4 -2
  89. package/dist/features/categories/components/ConcernCard.js +3 -1
  90. package/dist/features/categories/hooks/useCategories.d.ts +3 -3
  91. package/dist/features/categories/hooks/useCategorySelector.d.ts +3 -3
  92. package/dist/features/categories/hooks/useCategoryTree.d.ts +1 -1
  93. package/dist/features/categories/schemas/firestore.d.ts +2 -2
  94. package/dist/features/checkout/actions/checkout-actions.d.ts +1 -1
  95. package/dist/features/checkout/actions/checkout-actions.js +1 -1
  96. package/dist/features/checkout/hooks/useCheckoutApi.d.ts +2 -2
  97. package/dist/features/classified/components/ClassifiedListView.js +6 -5
  98. package/dist/features/collections/components/CollectionCard.js +3 -1
  99. package/dist/features/collections/hooks/useCollections.d.ts +2 -2
  100. package/dist/features/cron/jobs/auction-expiry.job.d.ts +2 -2
  101. package/dist/features/cron/jobs/auction-expiry.job.js +2 -1
  102. package/dist/features/cron/jobs/preorder-reminder.job.d.ts +1 -1
  103. package/dist/features/cron/jobs/preorder-reminder.job.js +2 -1
  104. package/dist/features/digital-codes/components/DigitalCodesListView.js +4 -3
  105. package/dist/features/events/actions/event-actions.js +6 -4
  106. package/dist/features/events/components/AdminEventEditorView.js +1 -1
  107. package/dist/features/events/components/AdminEventsView.js +7 -5
  108. package/dist/features/events/components/EventCard.js +3 -1
  109. package/dist/features/events/components/EventFilters.d.ts +4 -4
  110. package/dist/features/events/components/EventFilters.js +2 -2
  111. package/dist/features/events/components/EventRafflesSection.js +4 -2
  112. package/dist/features/events/hooks/useEvent.d.ts +3 -3
  113. package/dist/features/events/hooks/useEvents.d.ts +1 -1
  114. package/dist/features/faq/actions/faq-actions.js +4 -2
  115. package/dist/features/faq/components/FAQPageContent.js +2 -1
  116. package/dist/features/faq/hooks/useFAQs.d.ts +1 -1
  117. package/dist/features/faq/hooks/useFaqList.d.ts +15 -15
  118. package/dist/features/forms/Slider.js +3 -1
  119. package/dist/features/history/hooks/useHistory.js +1 -0
  120. package/dist/features/homepage/components/AdSlot.js +6 -2
  121. package/dist/features/homepage/components/AdvertisementBanner.js +3 -1
  122. package/dist/features/homepage/components/BeforeAfterCard.js +5 -1
  123. package/dist/features/homepage/components/CustomCardsSection.js +5 -1
  124. package/dist/features/homepage/components/HowItWorksSection.js +3 -1
  125. package/dist/features/homepage/components/MarketplaceHomepageView.js +4 -2
  126. package/dist/features/homepage/components/NewsletterBanner.js +6 -2
  127. package/dist/features/homepage/components/SecurityHighlightsSection.js +3 -1
  128. package/dist/features/homepage/components/StatsCounterSection.js +3 -1
  129. package/dist/features/homepage/components/TrustFeaturesSection.js +3 -1
  130. package/dist/features/homepage/hooks/useBlogArticles.d.ts +1 -1
  131. package/dist/features/homepage/hooks/useFeaturedAuctions.d.ts +1 -1
  132. package/dist/features/homepage/hooks/useFeaturedPreOrders.d.ts +1 -1
  133. package/dist/features/homepage/hooks/useFeaturedProducts.d.ts +1 -1
  134. package/dist/features/homepage/hooks/useFeaturedStores.d.ts +1 -1
  135. package/dist/features/homepage/hooks/useHeroCarousel.d.ts +1 -1
  136. package/dist/features/homepage/hooks/useHomepageEvents.d.ts +1 -1
  137. package/dist/features/homepage/hooks/useHomepageReviews.d.ts +1 -1
  138. package/dist/features/homepage/hooks/useHomepageSections.d.ts +1 -1
  139. package/dist/features/homepage/hooks/useTopBrands.d.ts +1 -1
  140. package/dist/features/homepage/hooks/useTopCategories.d.ts +1 -1
  141. package/dist/features/layout/AppLayoutShell.js +3 -1
  142. package/dist/features/layout/BottomActions.js +0 -27
  143. package/dist/features/layout/BottomActionsContext.d.ts +0 -36
  144. package/dist/features/layout/BottomActionsContext.js +1 -39
  145. package/dist/features/layout/BottomNavbar.js +1 -1
  146. package/dist/features/live/components/LiveItemsListView.js +6 -5
  147. package/dist/features/loyalty/hooks/useLoyaltyBalance.d.ts +1 -1
  148. package/dist/features/media/MediaLightbox.js +9 -3
  149. package/dist/features/media/modals/ImageEditor.js +6 -2
  150. package/dist/features/media/upload/MediaUploadField.js +1 -1
  151. package/dist/features/messages/hooks/useConversation.js +2 -0
  152. package/dist/features/messages/hooks/useConversations.js +1 -0
  153. package/dist/features/orders/components/OrdersList.js +3 -1
  154. package/dist/features/orders/hooks/useOrders.d.ts +2 -2
  155. package/dist/features/payments/hooks/usePayments.d.ts +1 -1
  156. package/dist/features/pre-orders/components/PreOrderDetailPageView.js +1 -1
  157. package/dist/features/pre-orders/components/PreOrdersListView.js +5 -4
  158. package/dist/features/pre-orders/hooks/usePreOrders.d.ts +2 -2
  159. package/dist/features/products/actions/product-actions.js +17 -15
  160. package/dist/features/products/columns/index.d.ts +1 -1
  161. package/dist/features/products/columns/index.js +1 -1
  162. package/dist/features/products/components/CompareOverlay.js +5 -1
  163. package/dist/features/products/components/FeatureBadge.js +3 -1
  164. package/dist/features/products/components/MarketplacePrizeDrawCard.js +1 -1
  165. package/dist/features/products/components/PrizeDrawCollage.js +0 -14
  166. package/dist/features/products/components/PrizeDrawsListingView.js +5 -4
  167. package/dist/features/products/components/PrizeDrawsSection.js +4 -2
  168. package/dist/features/products/components/ProductGrid.js +3 -1
  169. package/dist/features/products/constants/sieve.d.ts +2 -2
  170. package/dist/features/products/constants/sieve.js +2 -2
  171. package/dist/features/products/hooks/useProductDetail.d.ts +1 -1
  172. package/dist/features/products/hooks/useRelatedProducts.d.ts +1 -1
  173. package/dist/features/products/hooks/useRelatedProducts.js +5 -4
  174. package/dist/features/promotions/hooks/usePromotions.d.ts +2 -2
  175. package/dist/features/reviews/actions/review-actions.js +2 -1
  176. package/dist/features/reviews/components/ReviewDetailShell.js +8 -2
  177. package/dist/features/reviews/components/ReviewModal.js +5 -1
  178. package/dist/features/reviews/components/ReviewSummary.js +3 -1
  179. package/dist/features/reviews/components/ReviewsIndexPageView.js +7 -6
  180. package/dist/features/reviews/components/ReviewsList.js +5 -1
  181. package/dist/features/reviews/hooks/useReviews.d.ts +2 -2
  182. package/dist/features/scams/actions/scam-actions.js +3 -2
  183. package/dist/features/scams/components/ScamRegistryView.js +5 -4
  184. package/dist/features/search/actions/search-actions.js +7 -6
  185. package/dist/features/search/components/Search.js +3 -1
  186. package/dist/features/search/hooks/useSearch.d.ts +2 -2
  187. package/dist/features/seller/components/CouponInlineSelect.js +2 -1
  188. package/dist/features/seller/components/PhysicalLocationModal.js +1 -1
  189. package/dist/features/seller/components/SellerAddressesView.js +2 -1
  190. package/dist/features/seller/components/SellerAuctionsView.js +7 -5
  191. package/dist/features/seller/components/SellerBidsView.js +8 -4
  192. package/dist/features/seller/components/SellerBundlesView.js +7 -6
  193. package/dist/features/seller/components/SellerClassifiedView.js +6 -5
  194. package/dist/features/seller/components/SellerCouponEditorView.js +3 -1
  195. package/dist/features/seller/components/SellerCouponsView.js +6 -4
  196. package/dist/features/seller/components/SellerDigitalCodesView.js +5 -4
  197. package/dist/features/seller/components/SellerGroupedListingsView.js +5 -4
  198. package/dist/features/seller/components/SellerLiveView.js +6 -5
  199. package/dist/features/seller/components/SellerOffersPanel.js +1 -0
  200. package/dist/features/seller/components/SellerOffersView.js +6 -4
  201. package/dist/features/seller/components/SellerOrdersView.js +5 -3
  202. package/dist/features/seller/components/SellerPayoutMethodsView.js +4 -2
  203. package/dist/features/seller/components/SellerPayoutsView.js +6 -4
  204. package/dist/features/seller/components/SellerPreOrdersView.js +6 -4
  205. package/dist/features/seller/components/SellerPrizeDrawsView.js +6 -4
  206. package/dist/features/seller/components/SellerProductsView.js +14 -8
  207. package/dist/features/seller/components/SellerReviewsView.js +1 -0
  208. package/dist/features/seller/components/SellerShippingConfigsView.js +4 -2
  209. package/dist/features/seller/components/SellerSidebar.js +12 -4
  210. package/dist/features/seller/components/SellerStoreCategoriesView.js +5 -3
  211. package/dist/features/seller/components/SellerTemplatesView.js +5 -3
  212. package/dist/features/seller/components/SublistingInlineSelect.js +2 -1
  213. package/dist/features/seller/hooks/useSellerPayouts.d.ts +3 -3
  214. package/dist/features/seller/hooks/useSellerStore.d.ts +6 -6
  215. package/dist/features/seller/hooks/useSellerStorefront.d.ts +2 -2
  216. package/dist/features/shell/FormShell.js +10 -2
  217. package/dist/features/shell/QuickFormDrawer.js +5 -2
  218. package/dist/features/stores/actions/store-query-actions.js +3 -2
  219. package/dist/features/stores/components/StoreAuctionsPageView.js +4 -2
  220. package/dist/features/stores/components/StoreDetailLayoutView.d.ts +1 -1
  221. package/dist/features/stores/components/StoreDetailLayoutView.js +7 -6
  222. package/dist/features/stores/components/StoreHeader.js +5 -1
  223. package/dist/features/stores/components/StorePreOrdersPageView.js +4 -2
  224. package/dist/features/stores/components/StorePrizeDrawsPageView.js +4 -2
  225. package/dist/features/stores/components/StoreProductsPageView.js +2 -1
  226. package/dist/features/stores/components/StoreProductsView.js +5 -4
  227. package/dist/features/stores/components/StoresIndexListing.js +4 -3
  228. package/dist/features/stores/hooks/useStoreAddressSelector.d.ts +1 -1
  229. package/dist/features/stores/hooks/useStores.d.ts +6 -6
  230. package/dist/features/wishlist/components/WishlistPage.js +3 -1
  231. package/dist/features/wishlist/components/WishlistView.js +4 -3
  232. package/dist/features/wishlist/hooks/useUserWishlist.d.ts +15 -15
  233. package/dist/features/wishlist/hooks/useWishlist.d.ts +1 -1
  234. package/dist/features/wishlist/hooks/useWishlistWithGuest.d.ts +1 -1
  235. package/dist/providers/db-firebase/admin.js +0 -1
  236. package/dist/ui/DataTable.js +6 -2
  237. package/dist/ui/components/AvatarDisplay.js +3 -1
  238. package/dist/ui/components/BackgroundRenderer.js +4 -2
  239. package/dist/ui/components/Card.js +6 -2
  240. package/dist/ui/components/ImageGallery.js +3 -1
  241. package/dist/ui/components/ImageLightbox.js +3 -1
  242. package/dist/ui/components/PasswordStrengthIndicator.js +3 -1
  243. package/dist/ui/components/Progress.js +6 -2
  244. package/dist/ui/components/RowActionMenu.js +3 -1
  245. package/dist/ui/components/SiteLogo.js +7 -1
  246. package/dist/ui/components/Skeleton.js +3 -1
  247. package/dist/ui/components/Slider.js +3 -1
  248. package/dist/ui/components/TabStrip.js +3 -1
  249. package/package.json +1 -1
@@ -9,7 +9,9 @@ const CHEVRON_STYLE = {
9
9
  export function SidebarCollapseToggle({ expanded, onToggle, expandedLabel = "Collapse sidebar", collapsedLabel = "Expand sidebar", }) {
10
10
  return (_jsx("button", { type: "button", onClick: onToggle, "aria-label": expanded ? expandedLabel : collapsedLabel, "aria-expanded": expanded,
11
11
  // eslint-disable-next-line lir/no-inline-static-style
12
+ // audit-inline-style-ok: pass-through style prop
12
13
  style: HANDLE_STYLE, className: "w-9 shrink-0 flex items-center justify-center cursor-pointer rounded-r-[1.25rem] shadow-lg transition-all duration-200 hover:shadow-xl hover:brightness-110 active:scale-[0.96]", children: _jsx("svg", { className: `w-4 h-4 drop-shadow-sm transition-transform duration-300 ${expanded ? "" : "rotate-180"}`,
13
14
  // eslint-disable-next-line lir/no-inline-static-style
15
+ // audit-inline-style-ok: pass-through style prop
14
16
  style: CHEVRON_STYLE, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.5, d: "M15 19l-7-7 7-7" }) }) }));
15
17
  }
@@ -20,7 +20,6 @@ function defaultSink(event) {
20
20
  if (typeof window === "undefined") {
21
21
  // SSR / Node — best-effort console log; production servers can swap
22
22
  // the sink to a real logger via `setActionTrackerSink`.
23
- // eslint-disable-next-line no-console
24
23
  if (process.env.NODE_ENV !== "production") {
25
24
  console.debug("[action-tracker]", event);
26
25
  }
@@ -30,7 +29,6 @@ function defaultSink(event) {
30
29
  // deployed; for now stay silent in prod to avoid 404 noise + dev-mode
31
30
  // logs surface the events.
32
31
  if (process.env.NODE_ENV !== "production") {
33
- // eslint-disable-next-line no-console
34
32
  console.debug("[action-tracker]", event);
35
33
  }
36
34
  }
package/dist/client.d.ts CHANGED
@@ -62,6 +62,8 @@ export type { UseBulkSelectionOptions, UseBulkSelectionReturn } from "./react/ho
62
62
  export { useEntityDelete } from "./react/hooks/useEntityDelete";
63
63
  export type { UseEntityDeleteOptions, UseEntityDeleteReturn } from "./react/hooks/useEntityDelete";
64
64
  export { ROUTES, PUBLIC_ROUTES, PROTECTED_ROUTES, AUTH_ROUTES } from "./constants/index";
65
+ export { SORT_DIR, sortBy } from "./constants/sort";
66
+ export { SIEVE_OP, sieveFilter, sieveAnd, sieveMultiEq } from "./utils/sieve-builder";
65
67
  export { Container, Grid, Row, Stack } from "./ui/components/Layout";
66
68
  export { Div } from "./ui/components/Div";
67
69
  export { Main, Section, Nav, Ul, Ol, Li, Table, Thead, Tbody, Tr, Th, Td } from "./ui/components/Semantic";
package/dist/client.js CHANGED
@@ -125,6 +125,8 @@ export { useBulkSelection } from "./react/hooks/useBulkSelection";
125
125
  export { useEntityDelete } from "./react/hooks/useEntityDelete";
126
126
  // Client-safe constants, UI primitives, and views
127
127
  export { ROUTES, PUBLIC_ROUTES, PROTECTED_ROUTES, AUTH_ROUTES } from "./constants/index";
128
+ export { SORT_DIR, sortBy } from "./constants/sort";
129
+ export { SIEVE_OP, sieveFilter, sieveAnd, sieveMultiEq } from "./utils/sieve-builder";
128
130
  export { Container, Grid, Row, Stack } from "./ui/components/Layout";
129
131
  export { Div } from "./ui/components/Div";
130
132
  export { Main, Section, Nav, Ul, Ol, Li, Table, Thead, Tbody, Tr, Th, Td } from "./ui/components/Semantic";
@@ -1 +1 @@
1
- export declare function useSiteSettings<T = unknown>(endpoint?: "/api/site-settings", staleTime?: number): import("@tanstack/react-query").UseQueryResult<NoInfer<T>, Error>;
1
+ export declare function useSiteSettings<T = unknown>(endpoint?: "/api/site-settings", staleTime?: number): import("@tanstack/react-query").UseQueryResult<import("@tanstack/query-core").NoInfer<T>, Error>;
@@ -1,4 +1,3 @@
1
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-require-imports
2
1
  const getAdminDb = () => module.require("../providers/db-firebase").getAdminDb();
3
2
  import { DatabaseError } from "../errors";
4
3
  import { serverLogger } from "../monitoring";
@@ -50,6 +50,7 @@ export function NotificationBell({ limit = 10, viewAllHref, labels, icons, rende
50
50
  const emitSuccess = onMarkAllReadSuccess ?? showSuccess;
51
51
  const emitError = onMarkAllReadError ?? showError;
52
52
  const handleMarkAllRead = useCallback(async () => {
53
+ // toast-intentionally-silent — uses emitError(labels.error) callback for feedback
53
54
  try {
54
55
  await markAllRead(undefined);
55
56
  refetch();
@@ -65,6 +65,7 @@ export function UserOffersPanel({ fetchEndpoint = "/api/user/offers", onAcceptCo
65
65
  const [fetchError, setFetchError] = useState("");
66
66
  const [showLoginModal, setShowLoginModal] = useState(false);
67
67
  const loadOffers = useCallback(async () => {
68
+ // toast-intentionally-silent — error rendered inline via setFetchError()
68
69
  setLoading(true);
69
70
  setFetchError("");
70
71
  try {
@@ -77,7 +77,9 @@ export function UserSidebar({ items, groups, mobileOpen = false, onCloseMobile,
77
77
  // ── Persistent sidebar variant (desktop left slide-over, mobile bottom-sheet) ──────
78
78
  if (variant === "sidebar") {
79
79
  const handleToggle = onToggle ?? close;
80
- return (_jsxs(_Fragment, { children: [desktopOpen && (_jsx(Div, { className: "hidden md:block fixed inset-0 bg-black/40 backdrop-blur-[2px] z-30", onClick: handleToggle, "aria-hidden": "true" })), _jsxs(Div, { className: "hidden md:flex fixed left-0 z-40 transition-transform duration-300", style: {
80
+ return (_jsxs(_Fragment, { children: [desktopOpen && (_jsx(Div, { className: "hidden md:block fixed inset-0 bg-black/40 backdrop-blur-[2px] z-30", onClick: handleToggle, "aria-hidden": "true" })), _jsxs(Div, { className: "hidden md:flex fixed left-0 z-40 transition-transform duration-300",
81
+ // audit-inline-style-ok: dynamic CSS
82
+ style: {
81
83
  top: "var(--header-height, 3.5rem)",
82
84
  height: "calc(100vh - var(--header-height, 3.5rem))",
83
85
  width: "13rem",
@@ -5,9 +5,9 @@ interface UseProfileOptions {
5
5
  endpoint?: string;
6
6
  }
7
7
  export declare function useProfile(userId: string, opts?: UseProfileOptions): {
8
- profile: NoInfer<UserProfile> | undefined;
8
+ profile: UserProfile | undefined;
9
9
  isLoading: boolean;
10
10
  error: Error | null;
11
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<UserProfile>, Error>>;
11
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<UserProfile, Error>>;
12
12
  };
13
13
  export {};
@@ -18,7 +18,7 @@ export declare function useAddressSelector(options?: {
18
18
  }): {
19
19
  addresses: SavedAddress[];
20
20
  isLoading: boolean;
21
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<SavedAddress[]>, Error>>;
21
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<SavedAddress[], Error>>;
22
22
  createAddress: import("@tanstack/react-query").UseMutateFunction<CreateAddressApiResponse, Error, AddressFormData, unknown>;
23
23
  isSaving: boolean;
24
24
  };
@@ -36,11 +36,11 @@ export declare function useAddresses(options?: {
36
36
  enabled?: boolean;
37
37
  listEndpoint?: string;
38
38
  filters?: AddressFilterParams;
39
- }): import("@tanstack/react-query").UseQueryResult<NoInfer<Address[]>, Error>;
39
+ }): import("@tanstack/react-query").UseQueryResult<Address[], Error>;
40
40
  export declare function useAddress(id: string, options?: {
41
41
  enabled?: boolean;
42
42
  byIdEndpoint?: (id: string) => string;
43
- }): import("@tanstack/react-query").UseQueryResult<NoInfer<Address>, Error>;
43
+ }): import("@tanstack/react-query").UseQueryResult<Address, Error>;
44
44
  export declare function useCreateAddress(options?: {
45
45
  listEndpoint?: string;
46
46
  onSuccess?: (data: Address) => void;
@@ -16,7 +16,7 @@ export declare function useNotifications<TNotification = any>(limit?: number, op
16
16
  notifications: TNotification[];
17
17
  unreadCount: number;
18
18
  isLoading: boolean;
19
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<NotificationsResponse<TNotification>>, Error>>;
19
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NotificationsResponse<TNotification>, Error>>;
20
20
  markRead: import("@tanstack/react-query").UseMutateFunction<unknown, Error, string, unknown>;
21
21
  markAllRead: import("@tanstack/react-query").UseMutateFunction<unknown, Error, void, unknown>;
22
22
  isMarkingAll: boolean;
@@ -19,7 +19,7 @@ export interface UpdateCurrentProfileInput {
19
19
  export declare function useCurrentProfile(options?: {
20
20
  enabled?: boolean;
21
21
  endpoint?: string;
22
- }): import("@tanstack/react-query").UseQueryResult<NoInfer<UserProfile>, Error>;
22
+ }): import("@tanstack/react-query").UseQueryResult<UserProfile, Error>;
23
23
  export declare function useUpdateCurrentProfile(options?: {
24
24
  onSuccess?: (data: unknown) => void;
25
25
  onError?: (error: Error) => void;
@@ -71,8 +71,8 @@ export declare function usePublicProfile(userId: string, options?: PublicProfile
71
71
  loading: boolean;
72
72
  profileError: string;
73
73
  isSeller: boolean;
74
- productsData: NoInfer<ProductsApiResponse> | undefined;
74
+ productsData: ProductsApiResponse | undefined;
75
75
  productsLoading: boolean;
76
- reviewsData: NoInfer<SellerReviewsData> | undefined;
76
+ reviewsData: SellerReviewsData | undefined;
77
77
  reviewsLoading: boolean;
78
78
  };
@@ -1,5 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
4
+ import { sortBy } from "@mohasinac/appkit";
3
5
  import React from "react";
4
6
  import { useMutation, useQueryClient } from "@tanstack/react-query";
5
7
  import { FilterChipGroup, ListingLayout, RowActionMenu, useToast } from "../../../ui";
@@ -33,11 +35,11 @@ export function AdminAllEventEntriesView({ children, ...props }) {
33
35
  searchPlaceholder: "Search by user name or event ID",
34
36
  emptyLabel: "No entries found",
35
37
  filterKeys: ["status"],
36
- defaultSort: "-submittedAt",
38
+ defaultSort: sortBy("submittedAt", "DESC"),
37
39
  queryKey: ["admin", "event-entries", "listing"],
38
40
  endpoint: ADMIN_ENDPOINTS.ADMIN_EVENT_ENTRIES,
39
41
  sortOptions: [
40
- { value: "-submittedAt", label: "Newest" },
42
+ { value: sortBy("submittedAt", "DESC"), label: "Newest" },
41
43
  { value: "submittedAt", label: "Oldest" },
42
44
  ],
43
45
  mapRows: (response) => toRecordArray(response.items).map((item, index) => ({
@@ -51,7 +53,7 @@ export function AdminAllEventEntriesView({ children, ...props }) {
51
53
  eventId: toStringValue(item.eventId, ""),
52
54
  })),
53
55
  getTotal: (response, mappedRows) => typeof response.total === "number" ? response.total : mappedRows.length,
54
- buildFilters: (state) => state.status && state.status !== "All" ? `status==${state.status}` : undefined,
56
+ buildFilters: (state) => state.status && state.status !== "All" ? sieveFilter("status", SIEVE_OP.EQ, state.status) : undefined,
55
57
  renderRowActions: (row) => (_jsx(RowActionMenu, { actions: [
56
58
  {
57
59
  label: ACTIONS.ADMIN["confirm-entry"].label,
@@ -1,5 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
4
+ import { sortBy } from "@mohasinac/appkit";
3
5
  import React, { useState } from "react";
4
6
  import { useMutation, useQueryClient } from "@tanstack/react-query";
5
7
  import { ConfirmDeleteModal, FilterChipGroup, ListingLayout, RowActionMenu, useToast } from "../../../ui";
@@ -38,13 +40,13 @@ export function AdminBidsView({ children, ...props }) {
38
40
  searchPlaceholder: "Search bids, products, or bidder IDs",
39
41
  emptyLabel: "No bids found",
40
42
  filterKeys: ["status"],
41
- defaultSort: "-bidTime",
43
+ defaultSort: sortBy("bidTime", "DESC"),
42
44
  queryKey: ["admin", "bids", "listing"],
43
45
  endpoint: ADMIN_ENDPOINTS.BIDS,
44
46
  sortOptions: [
45
- { value: "-bidTime", label: "Newest" },
47
+ { value: sortBy("bidTime", "DESC"), label: "Newest" },
46
48
  { value: "bidTime", label: "Oldest" },
47
- { value: "-amount", label: "Highest amount" },
49
+ { value: sortBy("amount", "DESC"), label: "Highest amount" },
48
50
  ],
49
51
  mapRows: (response) => toRecordArray(response.items).map((item, index) => ({
50
52
  id: toStringValue(item.id, `bid-${index}`),
@@ -57,7 +59,7 @@ export function AdminBidsView({ children, ...props }) {
57
59
  updatedAt: toRelativeDate(item.bidTime ?? item.bidDate ?? item.updatedAt ?? item.createdAt),
58
60
  })),
59
61
  getTotal: (response, mappedRows) => typeof response.total === "number" ? response.total : mappedRows.length,
60
- buildFilters: (state) => state.status && state.status !== "All" ? `status==${state.status}` : undefined,
62
+ buildFilters: (state) => state.status && state.status !== "All" ? sieveFilter("status", SIEVE_OP.EQ, state.status) : undefined,
61
63
  buildBulkActions: (selection) => [
62
64
  {
63
65
  id: ROW_ACTION_ID.CANCEL,
@@ -1,5 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
4
+ import { sortBy } from "@mohasinac/appkit";
3
5
  import React from "react";
4
6
  import { FilterChipGroup, ListingLayout } from "../../../ui";
5
7
  import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
@@ -22,13 +24,13 @@ export function AdminBlogView({ children, ...props }) {
22
24
  searchPlaceholder: "Search articles, authors, or tags",
23
25
  emptyLabel: "No blog posts found",
24
26
  filterKeys: ["status", "isFeatured"],
25
- defaultSort: "-publishedAt",
27
+ defaultSort: sortBy("publishedAt", "DESC"),
26
28
  queryKey: ["admin", "blog", "listing"],
27
29
  endpoint: ADMIN_ENDPOINTS.BLOG,
28
30
  sortOptions: [
29
- { value: "-publishedAt", label: "Latest" },
31
+ { value: sortBy("publishedAt", "DESC"), label: "Latest" },
30
32
  { value: "publishedAt", label: "Oldest" },
31
- { value: "-createdAt", label: "Newest draft" },
33
+ { value: sortBy("createdAt", "DESC"), label: "Newest draft" },
32
34
  { value: "title", label: "Title A–Z" },
33
35
  ],
34
36
  mapRows: (response) => toRecordArray(response.posts).map((item, index) => ({
@@ -51,7 +53,7 @@ export function AdminBlogView({ children, ...props }) {
51
53
  buildFilters: (state) => {
52
54
  const filterParts = [];
53
55
  if (state.status && state.status !== "All")
54
- filterParts.push(`status==${state.status}`);
56
+ filterParts.push(sieveFilter("status", SIEVE_OP.EQ, state.status));
55
57
  if (state.isFeatured === "true")
56
58
  filterParts.push("isFeatured==true");
57
59
  return filterParts.join(",") || undefined;
@@ -1,5 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
4
+ import { sortBy } from "@mohasinac/appkit";
3
5
  import React from "react";
4
6
  import { Div, ListingLayout, Text } from "../../../ui";
5
7
  import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
@@ -34,14 +36,14 @@ const ADMIN_BRANDS_CONFIG = {
34
36
  searchPlaceholder: "Search brands by name or slug",
35
37
  emptyLabel: "No brands found",
36
38
  filterKeys: ["isActive"],
37
- defaultSort: "displayOrder",
39
+ defaultSort: sortBy("displayOrder", "ASC"),
38
40
  queryKey: ["admin", "brands", "listing"],
39
41
  endpoint: ADMIN_ENDPOINTS.BRANDS,
40
42
  sortOptions: [
41
- { value: "displayOrder", label: "Display order" },
42
- { value: "name", label: "Name A–Z" },
43
- { value: "-name", label: "Name Z–A" },
44
- { value: "-createdAt", label: "Newest" },
43
+ { value: sortBy("displayOrder", "ASC"), label: "Display order" },
44
+ { value: sortBy("name", "ASC"), label: "Name A–Z" },
45
+ { value: sortBy("name", "DESC"), label: "Name Z–A" },
46
+ { value: sortBy("createdAt", "DESC"), label: "Newest" },
45
47
  ],
46
48
  columns: COLUMNS,
47
49
  mapRows: (response) => toRecordArray(response.items).map((item, index) => ({
@@ -56,7 +58,7 @@ const ADMIN_BRANDS_CONFIG = {
56
58
  updatedAt: toRelativeDate(item.updatedAt ?? item.createdAt),
57
59
  })),
58
60
  getTotal: (response, mappedRows) => typeof response.total === "number" ? response.total : mappedRows.length,
59
- buildFilters: (state) => state.isActive ? `isActive==${state.isActive}` : undefined,
61
+ buildFilters: (state) => state.isActive ? sieveFilter("isActive", SIEVE_OP.EQ, state.isActive) : undefined,
60
62
  primaryAction: {
61
63
  label: "Add Brand",
62
64
  onClick: ({ openCreatePanel }) => openCreatePanel(),
@@ -1,5 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
4
+ import { sortBy } from "@mohasinac/appkit";
3
5
  import { useState, useCallback } from "react";
4
6
  import { Badge, Button, Div, Stack, Text, useToast } from "../../../ui";
5
7
  import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
@@ -61,16 +63,16 @@ export function AdminBundlesView({ getEditHref, newHref }) {
61
63
  searchPlaceholder: "Search bundles by name or slug…",
62
64
  emptyLabel: BUNDLE_COPY.adminList.empty,
63
65
  filterKeys: ["isActive", "bundleStockStatus"],
64
- defaultSort: "name",
66
+ defaultSort: sortBy("name", "ASC"),
65
67
  queryKey: ["admin", "bundles", "listing"],
66
68
  endpoint: ADMIN_ENDPOINTS.BUNDLES,
67
69
  sortOptions: [
68
- { value: "name", label: "Name A–Z" },
69
- { value: "-name", label: "Name Z–A" },
70
- { value: "-bundlePriceInPaise", label: "Price high→low" },
70
+ { value: sortBy("name", "ASC"), label: "Name A–Z" },
71
+ { value: sortBy("name", "DESC"), label: "Name Z–A" },
72
+ { value: sortBy("bundlePriceInPaise", "DESC"), label: "Price high→low" },
71
73
  { value: "bundlePriceInPaise", label: "Price low→high" },
72
- { value: "-createdAt", label: "Newest" },
73
- { value: "createdAt", label: "Oldest" },
74
+ { value: sortBy("createdAt", "DESC"), label: "Newest" },
75
+ { value: sortBy("createdAt", "ASC"), label: "Oldest" },
74
76
  ],
75
77
  columns: COLUMNS,
76
78
  mapRows: (response) => toRecordArray(response.items).map((item, index) => ({
@@ -90,9 +92,9 @@ export function AdminBundlesView({ getEditHref, newHref }) {
90
92
  buildFilters: (filterState) => {
91
93
  const parts = [];
92
94
  if (filterState.isActive)
93
- parts.push(`isActive==${filterState.isActive}`);
95
+ parts.push(sieveFilter("isActive", SIEVE_OP.EQ, filterState.isActive));
94
96
  if (filterState.bundleStockStatus)
95
- parts.push(`bundleStockStatus==${filterState.bundleStockStatus}`);
97
+ parts.push(sieveFilter("bundleStockStatus", SIEVE_OP.EQ, filterState.bundleStockStatus));
96
98
  return parts.join(",") || undefined;
97
99
  },
98
100
  getRowHref: getEditHref,
@@ -59,7 +59,9 @@ const TEXT_ALIGN_OPTIONS = [
59
59
  // ── Zone Picker ──────────────────────────────────────────────────────────────
60
60
  function ZonePicker({ selected, onChange, disabled, }) {
61
61
  const zones = [1, 2, 3, 4, 5, 6];
62
- return (_jsxs(Div, { children: [_jsx(Text, { className: "text-xs text-zinc-500 dark:text-zinc-400 mb-1", children: "Zone (row \u00D7 col grid)" }), _jsx("div", { className: "grid gap-1", style: { gridTemplateRows: "repeat(2, 1fr)", gridTemplateColumns: "repeat(3, 1fr)", width: 150 }, children: zones.map((z) => {
62
+ return (_jsxs(Div, { children: [_jsx(Text, { className: "text-xs text-zinc-500 dark:text-zinc-400 mb-1", children: "Zone (row \u00D7 col grid)" }), _jsx("div", { className: "grid gap-1",
63
+ // audit-inline-style-ok: dynamic CSS
64
+ style: { gridTemplateRows: "repeat(2, 1fr)", gridTemplateColumns: "repeat(3, 1fr)", width: 150 }, children: zones.map((z) => {
63
65
  const isDisabled = disabled?.(z) ?? false;
64
66
  return (_jsx("button", { type: "button", disabled: isDisabled, onClick: () => !isDisabled && onChange(z), className: `rounded text-xs font-mono py-2 border transition-colors ${selected === z
65
67
  ? "bg-primary text-white border-primary"
@@ -1,5 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
4
+ import { sortBy } from "@mohasinac/appkit";
3
5
  import React from "react";
4
6
  import { FilterChipGroup, ListingLayout } from "../../../ui";
5
7
  import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
@@ -12,12 +14,12 @@ const ADMIN_CARTS_CONFIG = {
12
14
  searchPlaceholder: "Search by user ID or session",
13
15
  emptyLabel: "No carts found",
14
16
  filterKeys: ["type"],
15
- defaultSort: "-updatedAt",
17
+ defaultSort: sortBy("updatedAt", "DESC"),
16
18
  queryKey: ["admin", "carts", "listing"],
17
19
  endpoint: ADMIN_ENDPOINTS.ADMIN_CARTS,
18
20
  sortOptions: [
19
- { value: "-updatedAt", label: "Recently updated" },
20
- { value: "updatedAt", label: "Oldest" },
21
+ { value: sortBy("updatedAt", "DESC"), label: "Recently updated" },
22
+ { value: sortBy("updatedAt", "ASC"), label: "Oldest" },
21
23
  ],
22
24
  mapRows: (response) => toRecordArray(response.items).map((item, index) => {
23
25
  const isGuest = !item.userId;
@@ -34,7 +36,7 @@ const ADMIN_CARTS_CONFIG = {
34
36
  };
35
37
  }),
36
38
  getTotal: (response, mappedRows) => typeof response.total === "number" ? response.total : mappedRows.length,
37
- buildFilters: (state) => state.type && state.type !== "All" ? `type==${state.type}` : undefined,
39
+ buildFilters: (state) => state.type && state.type !== "All" ? sieveFilter("type", SIEVE_OP.EQ, state.type) : undefined,
38
40
  renderFilterPanel: ({ pendingFilters, setPendingFilters }) => (_jsx(FilterChipGroup, { label: "Type", tabs: ADMIN_CART_OWNERSHIP_TABS, value: pendingFilters.type ?? "", onChange: (id) => setPendingFilters((p) => ({ ...p, type: id })) })),
39
41
  };
40
42
  export function AdminCartsView({ children, ...props }) {
@@ -1,5 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
4
+ import { sortBy } from "@mohasinac/appkit";
3
5
  import React from "react";
4
6
  import { Div, Heading, ListingLayout, Span, Text } from "../../../ui";
5
7
  import { CATEGORY_ENDPOINTS } from "../../../constants/api-endpoints";
@@ -33,14 +35,14 @@ const ADMIN_CATEGORIES_CONFIG = {
33
35
  searchPlaceholder: "Search categories, slugs, or parent category",
34
36
  emptyLabel: "No categories found",
35
37
  filterKeys: ["isActive", "isFeatured"],
36
- defaultSort: "name",
38
+ defaultSort: sortBy("name", "ASC"),
37
39
  pageSize: 50,
38
40
  queryKey: ["admin", "categories", "listing"],
39
41
  endpoint: `${CATEGORY_ENDPOINTS.LIST}?flat=true`,
40
42
  sortOptions: [
41
- { value: "name", label: "Name A–Z" },
42
- { value: "-name", label: "Name Z–A" },
43
- { value: "-createdAt", label: "Newest" },
43
+ { value: sortBy("name", "ASC"), label: "Name A–Z" },
44
+ { value: sortBy("name", "DESC"), label: "Name Z–A" },
45
+ { value: sortBy("createdAt", "DESC"), label: "Newest" },
44
46
  ],
45
47
  columns: COLUMNS,
46
48
  mapRows: (response) => {
@@ -61,7 +63,7 @@ const ADMIN_CATEGORIES_CONFIG = {
61
63
  buildFilters: (state) => {
62
64
  const parts = [];
63
65
  if (state.isActive)
64
- parts.push(`isActive==${state.isActive}`);
66
+ parts.push(sieveFilter("isActive", SIEVE_OP.EQ, state.isActive));
65
67
  if (state.isFeatured === "true")
66
68
  parts.push("isFeatured==true");
67
69
  return parts.join(",") || undefined;
@@ -4,6 +4,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
4
4
  * AdminClassifiedView — admin browse of classified listings (W1-29).
5
5
  * Read-only summary with edit-handoff to the seller-portal edit route.
6
6
  */
7
+ import { sortBy } from "@mohasinac/appkit";
7
8
  import React from "react";
8
9
  import { ListingLayout } from "../../../ui";
9
10
  import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
@@ -15,12 +16,12 @@ const ADMIN_CLASSIFIED_CONFIG = {
15
16
  searchPlaceholder: "Search classified by name or seller",
16
17
  emptyLabel: "No classified listings",
17
18
  filterKeys: [],
18
- defaultSort: "-createdAt",
19
+ defaultSort: sortBy("createdAt", "DESC"),
19
20
  queryKey: ["admin", "classified", "listing"],
20
21
  endpoint: ADMIN_ENDPOINTS.PRODUCTS,
21
22
  sortOptions: [
22
- { value: "-createdAt", label: "Newest" },
23
- { value: "createdAt", label: "Oldest" },
23
+ { value: sortBy("createdAt", "DESC"), label: "Newest" },
24
+ { value: sortBy("createdAt", "ASC"), label: "Oldest" },
24
25
  { value: "title", label: "Title A–Z" },
25
26
  ],
26
27
  mapRows: (response) => toRecordArray(response.items).map((item, index) => ({
@@ -1,5 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
4
+ import { sortBy } from "@mohasinac/appkit";
3
5
  import React, { useState } from "react";
4
6
  import { useMutation, useQueryClient } from "@tanstack/react-query";
5
7
  import { ConfirmDeleteModal, FilterChipGroup, ListingLayout, RowActionMenu, useToast } from "../../../ui";
@@ -53,12 +55,12 @@ export function AdminContactView({ children, onBulkMarkRead, onBulkArchive, onBu
53
55
  searchPlaceholder: "Search by subject, name, or email",
54
56
  emptyLabel: "No contact submissions found",
55
57
  filterKeys: ["status"],
56
- defaultSort: "-createdAt",
58
+ defaultSort: sortBy("createdAt", "DESC"),
57
59
  queryKey: ["admin", "contact", "listing"],
58
60
  endpoint: ADMIN_ENDPOINTS.CONTACT_SUBMISSIONS,
59
61
  sortOptions: [
60
- { value: "-createdAt", label: "Newest" },
61
- { value: "createdAt", label: "Oldest" },
62
+ { value: sortBy("createdAt", "DESC"), label: "Newest" },
63
+ { value: sortBy("createdAt", "ASC"), label: "Oldest" },
62
64
  ],
63
65
  mapRows: (response) => toRecordArray(response.submissions).map((item, index) => ({
64
66
  id: toStringValue(item.id, `msg-${index}`),
@@ -77,7 +79,7 @@ export function AdminContactView({ children, onBulkMarkRead, onBulkArchive, onBu
77
79
  return response.meta.total;
78
80
  return mappedRows.length;
79
81
  },
80
- buildFilters: (f) => (f.status && f.status !== "All" ? `status==${f.status}` : undefined),
82
+ buildFilters: (f) => (f.status && f.status !== "All" ? sieveFilter("status", SIEVE_OP.EQ, f.status) : undefined),
81
83
  buildBulkActions: (selection) => [
82
84
  ...(onBulkMarkRead
83
85
  ? [
@@ -1,5 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
4
+ import { sortBy } from "@mohasinac/appkit";
3
5
  import React, { useCallback } from "react";
4
6
  import { useQueryClient } from "@tanstack/react-query";
5
7
  import { Div, FilterChipGroup, ListingLayout, Text, useToast } from "../../../ui";
@@ -47,12 +49,12 @@ export function AdminCouponsView({ children, onBulkArchive, onBulkDelete, ...pro
47
49
  searchPlaceholder: "Search codes, campaigns, or seller scopes",
48
50
  emptyLabel: "No coupons found",
49
51
  filterKeys: ["type"],
50
- defaultSort: "-createdAt",
52
+ defaultSort: sortBy("createdAt", "DESC"),
51
53
  queryKey: ["admin", "coupons", "listing"],
52
54
  endpoint: ADMIN_ENDPOINTS.COUPONS,
53
55
  sortOptions: [
54
- { value: "-createdAt", label: "Newest" },
55
- { value: "createdAt", label: "Oldest" },
56
+ { value: sortBy("createdAt", "DESC"), label: "Newest" },
57
+ { value: sortBy("createdAt", "ASC"), label: "Oldest" },
56
58
  { value: "code", label: "Code A–Z" },
57
59
  ],
58
60
  hideTableView: true,
@@ -61,7 +63,7 @@ export function AdminCouponsView({ children, onBulkArchive, onBulkDelete, ...pro
61
63
  raw: item,
62
64
  })),
63
65
  getTotal: (response, mappedRows) => typeof response.total === "number" ? response.total : mappedRows.length,
64
- buildFilters: (state) => state.type && state.type !== "All" ? `type==${state.type}` : undefined,
66
+ buildFilters: (state) => state.type && state.type !== "All" ? sieveFilter("type", SIEVE_OP.EQ, state.type) : undefined,
65
67
  primaryAction: {
66
68
  label: "Add Coupon",
67
69
  onClick: ({ openCreatePanel }) => openCreatePanel(),
@@ -3,6 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  /**
4
4
  * AdminDigitalCodesView — admin browse of digital-code listings (W1-29).
5
5
  */
6
+ import { sortBy } from "@mohasinac/appkit";
6
7
  import React from "react";
7
8
  import { ListingLayout } from "../../../ui";
8
9
  import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
@@ -14,12 +15,12 @@ const ADMIN_DIGITAL_CODES_CONFIG = {
14
15
  searchPlaceholder: "Search digital code listings",
15
16
  emptyLabel: "No digital code listings",
16
17
  filterKeys: [],
17
- defaultSort: "-createdAt",
18
+ defaultSort: sortBy("createdAt", "DESC"),
18
19
  queryKey: ["admin", "digital-codes", "listing"],
19
20
  endpoint: ADMIN_ENDPOINTS.PRODUCTS,
20
21
  sortOptions: [
21
- { value: "-createdAt", label: "Newest" },
22
- { value: "createdAt", label: "Oldest" },
22
+ { value: sortBy("createdAt", "DESC"), label: "Newest" },
23
+ { value: sortBy("createdAt", "ASC"), label: "Oldest" },
23
24
  { value: "title", label: "Title A–Z" },
24
25
  ],
25
26
  mapRows: (response) => toRecordArray(response.items).map((item, index) => {
@@ -1,5 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
4
+ import { sortBy } from "@mohasinac/appkit";
3
5
  import React, { useMemo } from "react";
4
6
  import { Div, Heading, ListingLayout, Span, Text } from "../../../ui";
5
7
  import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
@@ -35,12 +37,12 @@ export function AdminFaqsView({ children, onBulkArchive, onBulkDelete, ...props
35
37
  searchPlaceholder: "Search questions, categories, or tokens",
36
38
  emptyLabel: "No FAQs found",
37
39
  filterKeys: ["isActive"],
38
- defaultSort: "priority",
40
+ defaultSort: sortBy("priority", "ASC"),
39
41
  queryKey: ["admin", "faqs", "listing"],
40
42
  endpoint: ADMIN_ENDPOINTS.FAQS,
41
43
  sortOptions: [
42
44
  { value: "priority", label: "Priority" },
43
- { value: "-createdAt", label: "Newest" },
45
+ { value: sortBy("createdAt", "DESC"), label: "Newest" },
44
46
  { value: "question", label: "Question A–Z" },
45
47
  ],
46
48
  columns: COLUMNS,
@@ -56,7 +58,7 @@ export function AdminFaqsView({ children, onBulkArchive, onBulkDelete, ...props
56
58
  updatedAt: toRelativeDate(item.updatedAt ?? item.createdAt),
57
59
  })),
58
60
  getTotal: (response, mappedRows) => typeof response.total === "number" ? response.total : mappedRows.length,
59
- buildFilters: (state) => state.isActive ? `isActive==${state.isActive}` : undefined,
61
+ buildFilters: (state) => state.isActive ? sieveFilter("isActive", SIEVE_OP.EQ, state.isActive) : undefined,
60
62
  primaryAction: {
61
63
  label: "Add FAQ",
62
64
  onClick: ({ openCreatePanel }) => openCreatePanel(),
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { sortBy } from "@mohasinac/appkit";
3
4
  import React from "react";
4
5
  import { useRouter, useSearchParams, usePathname } from "next/navigation";
5
6
  import { ListingLayout, Row } from "../../../ui";
@@ -44,15 +45,15 @@ export function AdminFeaturesView({ children, ...props }) {
44
45
  searchPlaceholder: "Search features by label",
45
46
  emptyLabel: "No features found",
46
47
  filterKeys: [],
47
- defaultSort: "displayOrder",
48
+ defaultSort: sortBy("displayOrder", "ASC"),
48
49
  pageSize: PAGE_SIZE,
49
50
  queryKey: ["admin", "features", "listing", scopeFilter],
50
51
  endpoint: `${ADMIN_ENDPOINTS.PRODUCT_FEATURES}?scope=${scopeFilter}`,
51
52
  sortOptions: [
52
- { value: "displayOrder", label: "Display order" },
53
+ { value: sortBy("displayOrder", "ASC"), label: "Display order" },
53
54
  { value: "label", label: "Label A–Z" },
54
- { value: "-label", label: "Label Z–A" },
55
- { value: "-createdAt", label: "Newest" },
55
+ { value: sortBy("label", "DESC"), label: "Label Z–A" },
56
+ { value: sortBy("createdAt", "DESC"), label: "Newest" },
56
57
  ],
57
58
  mapRows: (response) => toRecordArray(response.items).map(mapFeatureRow),
58
59
  getTotal: (response, mappedRows) => typeof response.total === "number" ? response.total : mappedRows.length,