@mohasinac/appkit 2.8.2 → 2.8.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 (430) hide show
  1. package/dist/_internal/client/features/classified/ClassifiedDetailView.js +7 -1
  2. package/dist/_internal/client/features/digital-code/CodeRevealPanel.js +4 -1
  3. package/dist/_internal/client/features/digital-code/DigitalCodeDetailView.js +7 -1
  4. package/dist/_internal/client/features/layout/DashboardLayoutClient.js +3 -2
  5. package/dist/_internal/client/features/live/LiveItemDetailView.js +11 -2
  6. package/dist/_internal/client/scaffolds/AppShell.js +2 -1
  7. package/dist/_internal/client/scaffolds/DashboardScaffold.js +2 -1
  8. package/dist/_internal/server/features/checkout/actions.js +40 -39
  9. package/dist/_internal/shared/actions/action-registry.js +6 -0
  10. package/dist/_internal/shared/config/index.d.ts +1 -1
  11. package/dist/_internal/shared/config/schema.d.ts +0 -8
  12. package/dist/client-entry.d.ts +1 -1
  13. package/dist/client.d.ts +1 -1
  14. package/dist/client.js +1 -1
  15. package/dist/configs/next.js +12 -22
  16. package/dist/constants/api-endpoints.d.ts +6 -0
  17. package/dist/constants/api-endpoints.js +2 -0
  18. package/dist/core/hooks/useSiteSettings.d.ts +1 -1
  19. package/dist/features/about/components/AboutView.js +5 -2
  20. package/dist/features/about/components/FAQPageView.js +3 -3
  21. package/dist/features/about/components/FeesView.js +13 -5
  22. package/dist/features/about/components/HelpPageView.js +9 -5
  23. package/dist/features/about/components/HowAuctionsWorkView.js +9 -5
  24. package/dist/features/about/components/HowCheckoutWorksView.js +9 -5
  25. package/dist/features/about/components/HowOffersWorkView.js +10 -5
  26. package/dist/features/about/components/HowOrdersWorkView.js +10 -5
  27. package/dist/features/about/components/HowPayoutsWorkView.js +9 -5
  28. package/dist/features/about/components/HowPreOrdersWorkView.js +9 -5
  29. package/dist/features/about/components/HowReviewsWorkView.js +9 -5
  30. package/dist/features/about/components/PolicyPageView.js +3 -3
  31. package/dist/features/about/components/PublicProfileView.js +11 -4
  32. package/dist/features/about/components/SecurityPrivacyView.js +8 -4
  33. package/dist/features/about/components/ShippingPolicyView.js +3 -2
  34. package/dist/features/about/components/TrackOrderView.js +2 -2
  35. package/dist/features/about/components/UnauthorizedView.js +3 -3
  36. package/dist/features/account/components/AddressBook.js +1 -1
  37. package/dist/features/account/components/AddressForm.js +2 -2
  38. package/dist/features/account/components/AddressInlineSelect.d.ts +24 -0
  39. package/dist/features/account/components/AddressInlineSelect.js +78 -0
  40. package/dist/features/account/components/AddressSelectorCreate.d.ts +2 -1
  41. package/dist/features/account/components/AddressSelectorCreate.js +5 -32
  42. package/dist/features/account/components/AddressesIndexListing.js +3 -3
  43. package/dist/features/account/components/ChatWindow.js +2 -1
  44. package/dist/features/account/components/NotificationBell.js +13 -7
  45. package/dist/features/account/components/NotificationPreferencesPanel.js +4 -1
  46. package/dist/features/account/components/UserOffersPanel.js +2 -1
  47. package/dist/features/account/components/UserSidebar.js +11 -7
  48. package/dist/features/account/components/UserSupportView.js +13 -4
  49. package/dist/features/account/components/index.d.ts +2 -0
  50. package/dist/features/account/components/index.js +1 -0
  51. package/dist/features/account/hooks/useAccount.d.ts +2 -2
  52. package/dist/features/account/hooks/useAddressSelector.d.ts +1 -1
  53. package/dist/features/account/hooks/useAddresses.d.ts +2 -2
  54. package/dist/features/account/hooks/useNotifications.d.ts +1 -1
  55. package/dist/features/account/hooks/useProfile.d.ts +1 -1
  56. package/dist/features/account/hooks/usePublicProfile.d.ts +2 -2
  57. package/dist/features/addresses/repository/addresses.repository.d.ts +1 -0
  58. package/dist/features/addresses/repository/addresses.repository.js +13 -0
  59. package/dist/features/admin/components/AdminAdEditorView.js +8 -5
  60. package/dist/features/admin/components/AdminAddressEditorView.js +5 -5
  61. package/dist/features/admin/components/AdminAdsView.js +10 -7
  62. package/dist/features/admin/components/AdminBlogEditorView.js +15 -9
  63. package/dist/features/admin/components/AdminBrandEditorView.js +10 -4
  64. package/dist/features/admin/components/AdminBrandsView.js +4 -4
  65. package/dist/features/admin/components/AdminBundleEditorView.js +4 -5
  66. package/dist/features/admin/components/AdminBundlesView.js +3 -3
  67. package/dist/features/admin/components/AdminCarouselEditorView.js +6 -3
  68. package/dist/features/admin/components/AdminCarouselView.js +6 -6
  69. package/dist/features/admin/components/AdminCatalogGuideView.js +2 -1
  70. package/dist/features/admin/components/AdminCategoriesView.js +5 -5
  71. package/dist/features/admin/components/AdminCategoryEditorView.js +11 -5
  72. package/dist/features/admin/components/AdminContactEditorView.js +8 -1
  73. package/dist/features/admin/components/AdminCouponEditorView.js +23 -5
  74. package/dist/features/admin/components/AdminEmployeeEditorView.js +7 -4
  75. package/dist/features/admin/components/AdminFaqEditorView.js +9 -3
  76. package/dist/features/admin/components/AdminFaqsView.js +4 -4
  77. package/dist/features/admin/components/AdminFeatureEditorView.js +7 -1
  78. package/dist/features/admin/components/AdminFeatureFlagsView.js +4 -1
  79. package/dist/features/admin/components/AdminFilterBar.js +4 -4
  80. package/dist/features/admin/components/AdminGroupedListingsView.js +65 -30
  81. package/dist/features/admin/components/AdminGuideHubView.js +4 -1
  82. package/dist/features/admin/components/AdminMediaView.js +4 -1
  83. package/dist/features/admin/components/AdminNavigationView.js +7 -4
  84. package/dist/features/admin/components/AdminNotificationsView.js +2 -2
  85. package/dist/features/admin/components/AdminOrderEditorView.js +2 -2
  86. package/dist/features/admin/components/AdminPageHeader.js +5 -2
  87. package/dist/features/admin/components/AdminPrizeDrawsView.js +5 -5
  88. package/dist/features/admin/components/AdminProductEditorView.js +12 -5
  89. package/dist/features/admin/components/AdminProductsView.js +4 -4
  90. package/dist/features/admin/components/AdminReviewsView.js +2 -2
  91. package/dist/features/admin/components/AdminScammerEditorView.js +6 -2
  92. package/dist/features/admin/components/AdminScammersView.js +3 -3
  93. package/dist/features/admin/components/AdminSectionsView.js +20 -22
  94. package/dist/features/admin/components/AdminSessionsManager.js +2 -1
  95. package/dist/features/admin/components/AdminSessionsView.js +2 -2
  96. package/dist/features/admin/components/AdminSidebar.js +11 -7
  97. package/dist/features/admin/components/AdminSiteConfigGuideView.js +2 -1
  98. package/dist/features/admin/components/AdminSiteSettingsView.js +5 -1
  99. package/dist/features/admin/components/AdminStoreAddressesView.js +2 -2
  100. package/dist/features/admin/components/AdminStoreEditorView.js +5 -5
  101. package/dist/features/admin/components/AdminSublistingCategoryEditorView.js +3 -3
  102. package/dist/features/admin/components/AdminSupportTicketDetailView.js +10 -3
  103. package/dist/features/admin/components/AdminSupportTicketsView.js +3 -3
  104. package/dist/features/admin/components/AdminTrustGuideView.js +3 -3
  105. package/dist/features/admin/components/AdminUsersGuideView.js +3 -3
  106. package/dist/features/admin/components/AdminViewCards.js +12 -6
  107. package/dist/features/admin/components/BrandQuickCreateForm.js +2 -2
  108. package/dist/features/admin/components/CategoryQuickCreateForm.js +2 -2
  109. package/dist/features/admin/components/DashboardStats.js +9 -3
  110. package/dist/features/admin/components/DataListingView.js +3 -3
  111. package/dist/features/admin/components/DataTable.js +11 -7
  112. package/dist/features/admin/components/DrawerFormFooter.js +2 -2
  113. package/dist/features/admin/components/QuickEditMenu.js +2 -1
  114. package/dist/features/admin/components/analytics/AdminAnalyticsCharts.js +5 -1
  115. package/dist/features/admin/hooks/useAdmin.d.ts +1 -1
  116. package/dist/features/admin/hooks/useAdminSectionsListing.d.ts +1 -1
  117. package/dist/features/admin/hooks/useChat.d.ts +1 -1
  118. package/dist/features/auctions/components/AuctionBidsTable.js +4 -1
  119. package/dist/features/auctions/components/AuctionDetailPageView.js +14 -6
  120. package/dist/features/auctions/components/CollapsibleBidHistory.js +5 -1
  121. package/dist/features/auctions/components/MarketplaceAuctionCard.js +9 -3
  122. package/dist/features/auctions/components/MarketplaceAuctionGrid.js +8 -2
  123. package/dist/features/auctions/components/PlaceBidFormClient.js +4 -1
  124. package/dist/features/auctions/hooks/useAuctions.d.ts +8 -8
  125. package/dist/features/auth/components/RegisterForm.js +2 -2
  126. package/dist/features/auth/components/VerifyEmailView.js +5 -2
  127. package/dist/features/auth/hooks/useAuth.d.ts +2 -2
  128. package/dist/features/before-after/components/BeforeAfterSlider.js +1 -1
  129. package/dist/features/blog/components/BlogFeaturedCard.js +8 -1
  130. package/dist/features/blog/components/BlogIndexListing.js +11 -5
  131. package/dist/features/blog/components/BlogListView.js +11 -3
  132. package/dist/features/blog/components/BlogPostView.js +10 -3
  133. package/dist/features/cart/components/CartDrawer.js +11 -3
  134. package/dist/features/cart/components/CartSummary.js +2 -2
  135. package/dist/features/cart/components/CheckoutOtpModal.js +2 -1
  136. package/dist/features/cart/hooks/useCart.d.ts +1 -1
  137. package/dist/features/cart/hooks/useCartQuery.d.ts +1 -1
  138. package/dist/features/cart/hooks/useCheckoutReadQueries.d.ts +2 -2
  139. package/dist/features/cart/hooks/useOrder.d.ts +2 -2
  140. package/dist/features/categories/components/BrandDetailPageView.js +5 -2
  141. package/dist/features/categories/components/BrandDetailTabs.js +5 -1
  142. package/dist/features/categories/components/BundleDetailView.js +6 -3
  143. package/dist/features/categories/components/BundleDynamicRuleEditor.js +3 -1
  144. package/dist/features/categories/components/BundleItemsPicker.js +10 -3
  145. package/dist/features/categories/components/CategoriesIndexListing.js +12 -6
  146. package/dist/features/categories/components/CategoryBundlesListing.js +5 -2
  147. package/dist/features/categories/components/CategoryDetailPageView.js +6 -2
  148. package/dist/features/categories/components/CategoryDetailTabs.js +5 -1
  149. package/dist/features/categories/components/CategoryForm.js +6 -3
  150. package/dist/features/categories/components/CategoryGrid.js +9 -2
  151. package/dist/features/categories/components/CategoryProductsListing.js +10 -4
  152. package/dist/features/categories/components/CategorySelectorCreate.js +3 -3
  153. package/dist/features/categories/components/CategorySortSelect.js +1 -1
  154. package/dist/features/categories/components/CategoryStoresListing.js +3 -3
  155. package/dist/features/categories/components/CategoryTableColumns.js +10 -6
  156. package/dist/features/categories/components/CategoryTree.js +1 -1
  157. package/dist/features/categories/hooks/useCategories.d.ts +3 -3
  158. package/dist/features/categories/hooks/useCategorySelector.d.ts +3 -3
  159. package/dist/features/categories/hooks/useCategoryTree.d.ts +1 -1
  160. package/dist/features/checkout/hooks/useCheckoutApi.d.ts +2 -2
  161. package/dist/features/classified/components/ClassifiedFilters.js +2 -2
  162. package/dist/features/classified/components/ClassifiedIndexListing.js +9 -3
  163. package/dist/features/collections/components/CollectionCard.js +2 -1
  164. package/dist/features/collections/hooks/useCollections.d.ts +2 -2
  165. package/dist/features/contact/components/ContactForm.js +4 -2
  166. package/dist/features/contact/components/ContactInfoSidebar.js +4 -1
  167. package/dist/features/copilot/components/AdminCopilotView.js +13 -5
  168. package/dist/features/digital-codes/components/DigitalCodesIndexListing.js +9 -3
  169. package/dist/features/events/components/AdminEventEditorView.js +62 -40
  170. package/dist/features/events/components/AdminEventEntriesView.js +9 -6
  171. package/dist/features/events/components/EventCard.js +7 -1
  172. package/dist/features/events/components/EventFormDrawer.js +2 -1
  173. package/dist/features/events/components/EventLeaderboard.js +4 -4
  174. package/dist/features/events/components/EventOfferCard.js +4 -1
  175. package/dist/features/events/components/EventParticipateView.js +3 -2
  176. package/dist/features/events/components/EventPollWidget.js +6 -5
  177. package/dist/features/events/components/EventRaffleEntryForm.js +5 -2
  178. package/dist/features/events/components/EventRaffleWinnerView.js +7 -1
  179. package/dist/features/events/components/EventRafflesSection.js +2 -2
  180. package/dist/features/events/components/EventSaleBanner.js +5 -2
  181. package/dist/features/events/components/EventsIndexListing.js +8 -2
  182. package/dist/features/events/components/EventsListView.js +4 -1
  183. package/dist/features/events/components/SpinWheelView.js +7 -2
  184. package/dist/features/events/hooks/useEvent.d.ts +3 -3
  185. package/dist/features/events/hooks/useEvents.d.ts +1 -1
  186. package/dist/features/events/schemas/firestore.d.ts +1 -0
  187. package/dist/features/events/types/index.d.ts +1 -0
  188. package/dist/features/faq/components/ContactCTA.js +4 -1
  189. package/dist/features/faq/components/FAQCategorySidebar.js +2 -2
  190. package/dist/features/faq/components/FAQHelpfulButtons.js +8 -5
  191. package/dist/features/faq/components/FAQPageContent.js +5 -5
  192. package/dist/features/faq/components/FAQSortDropdown.js +2 -2
  193. package/dist/features/faq/hooks/useFAQs.d.ts +1 -1
  194. package/dist/features/faq/hooks/useFaqList.d.ts +15 -15
  195. package/dist/features/filters/AsyncFacetSection.js +4 -2
  196. package/dist/features/filters/FilterFacetSection.js +14 -6
  197. package/dist/features/filters/RangeFilter.js +4 -2
  198. package/dist/features/filters/SwitchFilter.js +2 -1
  199. package/dist/features/forms/Checkbox.js +1 -1
  200. package/dist/features/forms/Radio.js +1 -1
  201. package/dist/features/forms/Slider.js +1 -1
  202. package/dist/features/homepage/components/AdSlot.js +4 -4
  203. package/dist/features/homepage/components/AdvertisementBanner.js +13 -4
  204. package/dist/features/homepage/components/AnnouncementBar.js +2 -1
  205. package/dist/features/homepage/components/BeforeAfterCard.js +8 -2
  206. package/dist/features/homepage/components/BrandsSection.js +6 -3
  207. package/dist/features/homepage/components/CTABannerSection.js +2 -2
  208. package/dist/features/homepage/components/CharacterHotspot.js +5 -2
  209. package/dist/features/homepage/components/CharacterHotspotForm.js +8 -4
  210. package/dist/features/homepage/components/CustomCardsSection.js +13 -7
  211. package/dist/features/homepage/components/CustomerReviewsSection.js +9 -3
  212. package/dist/features/homepage/components/FAQSection.js +7 -4
  213. package/dist/features/homepage/components/FeaturedBundlesSection.js +8 -2
  214. package/dist/features/homepage/components/FeaturedResultsSection.js +1 -1
  215. package/dist/features/homepage/components/GoogleReviewsSection.js +14 -8
  216. package/dist/features/homepage/components/HeroCarousel.js +1 -1
  217. package/dist/features/homepage/components/HomepageSkeleton.js +7 -1
  218. package/dist/features/homepage/components/HowItWorksInfoView.js +2 -2
  219. package/dist/features/homepage/components/HowItWorksSection.js +2 -2
  220. package/dist/features/homepage/components/NewsletterBanner.js +3 -2
  221. package/dist/features/homepage/components/NewsletterSection.js +5 -2
  222. package/dist/features/homepage/components/PromoGrid.js +4 -1
  223. package/dist/features/homepage/components/SectionCarousel.js +7 -4
  224. package/dist/features/homepage/components/SecurityHighlightsSection.js +3 -3
  225. package/dist/features/homepage/components/ShopByCategorySection.js +10 -4
  226. package/dist/features/homepage/components/SiteFeaturesSection.js +5 -2
  227. package/dist/features/homepage/components/SocialFeedSection.js +4 -4
  228. package/dist/features/homepage/components/SocialPostCard.js +6 -3
  229. package/dist/features/homepage/components/TrustFeaturesSection.js +5 -5
  230. package/dist/features/homepage/components/TrustIndicatorsSection.js +5 -2
  231. package/dist/features/homepage/components/WelcomeSection.js +1 -1
  232. package/dist/features/homepage/components/WhatsAppCommunitySection.js +3 -3
  233. package/dist/features/homepage/hooks/useBlogArticles.d.ts +1 -1
  234. package/dist/features/homepage/hooks/useFeaturedAuctions.d.ts +1 -1
  235. package/dist/features/homepage/hooks/useFeaturedPreOrders.d.ts +1 -1
  236. package/dist/features/homepage/hooks/useFeaturedProducts.d.ts +1 -1
  237. package/dist/features/homepage/hooks/useFeaturedStores.d.ts +1 -1
  238. package/dist/features/homepage/hooks/useHeroCarousel.d.ts +1 -1
  239. package/dist/features/homepage/hooks/useHomepageEvents.d.ts +1 -1
  240. package/dist/features/homepage/hooks/useHomepageReviews.d.ts +1 -1
  241. package/dist/features/homepage/hooks/useHomepageSections.d.ts +1 -1
  242. package/dist/features/homepage/hooks/useTopBrands.d.ts +1 -1
  243. package/dist/features/homepage/hooks/useTopCategories.d.ts +1 -1
  244. package/dist/features/layout/AppLayoutShell.js +2 -1
  245. package/dist/features/layout/BackToTop.js +1 -1
  246. package/dist/features/layout/BottomActions.js +4 -3
  247. package/dist/features/layout/BottomNavItem.js +1 -1
  248. package/dist/features/layout/BottomSheet.js +4 -1
  249. package/dist/features/layout/FooterLayout.js +1 -1
  250. package/dist/features/layout/NavbarLayout.js +4 -1
  251. package/dist/features/layout/SidebarLayout.js +5 -2
  252. package/dist/features/live/components/LiveItemFilters.js +2 -2
  253. package/dist/features/live/components/LiveItemsIndexListing.js +9 -3
  254. package/dist/features/loyalty/components/CoinsDisplay.js +4 -2
  255. package/dist/features/loyalty/hooks/useLoyaltyBalance.d.ts +1 -1
  256. package/dist/features/media/AvatarUpload.js +2 -2
  257. package/dist/features/media/MediaLightbox.js +3 -2
  258. package/dist/features/media/modals/VideoThumbnailSelector.js +4 -1
  259. package/dist/features/media/modals/VideoTrimModal.js +1 -1
  260. package/dist/features/media/upload/CameraCapture.js +1 -1
  261. package/dist/features/media/upload/ImageUpload.js +4 -1
  262. package/dist/features/media/upload/MediaUploadField.js +11 -2
  263. package/dist/features/media/upload/MediaUploadList.js +5 -1
  264. package/dist/features/orders/components/MarketplaceOrderCard.js +2 -2
  265. package/dist/features/orders/components/OrdersList.js +2 -1
  266. package/dist/features/orders/components/RefundHistoryTable.js +4 -1
  267. package/dist/features/orders/components/RefundRequestView.js +2 -1
  268. package/dist/features/orders/hooks/useOrders.d.ts +2 -2
  269. package/dist/features/payments/hooks/usePayments.d.ts +1 -1
  270. package/dist/features/pre-orders/components/MarketplacePreorderCard.js +5 -1
  271. package/dist/features/pre-orders/components/PreOrderActionsClient.js +3 -3
  272. package/dist/features/pre-orders/components/PreOrderBadge.js +2 -1
  273. package/dist/features/pre-orders/components/PreOrderDetailPageView.js +16 -7
  274. package/dist/features/pre-orders/components/PreOrdersIndexListing.js +32 -24
  275. package/dist/features/pre-orders/hooks/usePreOrders.d.ts +2 -2
  276. package/dist/features/products/columns/productTableColumns.js +9 -4
  277. package/dist/features/products/components/AuctionsIndexListing.js +9 -3
  278. package/dist/features/products/components/BidHistory.js +4 -4
  279. package/dist/features/products/components/CompareOverlay.js +10 -2
  280. package/dist/features/products/components/CustomFieldsEditor.js +2 -1
  281. package/dist/features/products/components/CustomSectionTabContent.js +2 -2
  282. package/dist/features/products/components/CustomSectionsEditor.js +3 -2
  283. package/dist/features/products/components/GroupSettingsPanel.js +34 -26
  284. package/dist/features/products/components/MakeOfferButton.js +6 -2
  285. package/dist/features/products/components/MakeOfferForm.js +2 -1
  286. package/dist/features/products/components/MarketplaceBundleCard.js +6 -3
  287. package/dist/features/products/components/MarketplacePrizeDrawCard.js +3 -2
  288. package/dist/features/products/components/PlaceBidForm.js +2 -1
  289. package/dist/features/products/components/PrizeDrawCollage.js +6 -2
  290. package/dist/features/products/components/PrizeDrawDetailPageView.js +6 -1
  291. package/dist/features/products/components/PrizeDrawItemsEditor.js +4 -2
  292. package/dist/features/products/components/PrizeDrawsIndexListing.js +6 -3
  293. package/dist/features/products/components/PrizeDrawsSection.js +2 -2
  294. package/dist/features/products/components/PrizeRevealModal.js +5 -1
  295. package/dist/features/products/components/ProductDetailPageView.js +32 -16
  296. package/dist/features/products/components/ProductFeatureBadges.js +9 -9
  297. package/dist/features/products/components/ProductForm.d.ts +11 -1
  298. package/dist/features/products/components/ProductForm.js +10 -5
  299. package/dist/features/products/components/ProductGalleryClient.js +8 -4
  300. package/dist/features/products/components/ProductGradingTab.js +4 -1
  301. package/dist/features/products/components/ProductGrid.js +35 -14
  302. package/dist/features/products/components/ProductInfo.js +2 -1
  303. package/dist/features/products/components/ProductTabs.js +2 -1
  304. package/dist/features/products/components/ProductTabsShell.js +5 -1
  305. package/dist/features/products/components/ProductsIndexListing.js +32 -24
  306. package/dist/features/products/components/ProductsIndexPageView.js +2 -2
  307. package/dist/features/products/components/RelatedProducts.js +3 -3
  308. package/dist/features/products/components/ShowGroupSection.js +10 -6
  309. package/dist/features/products/components/SublistingCarouselSection.js +7 -3
  310. package/dist/features/products/components/SublistingCategorySelect.d.ts +3 -1
  311. package/dist/features/products/components/SublistingCategorySelect.js +4 -37
  312. package/dist/features/products/constants/action-defs.js +3 -3
  313. package/dist/features/products/hooks/useProductDetail.d.ts +1 -1
  314. package/dist/features/products/hooks/useRelatedProducts.d.ts +1 -1
  315. package/dist/features/promotions/components/CouponCard.js +5 -3
  316. package/dist/features/promotions/components/CouponsIndexListing.js +7 -3
  317. package/dist/features/promotions/hooks/usePromotions.d.ts +2 -2
  318. package/dist/features/promotions/repository/coupons.repository.d.ts +8 -0
  319. package/dist/features/promotions/repository/coupons.repository.js +2 -0
  320. package/dist/features/reviews/components/ReviewDetailPageView.js +3 -3
  321. package/dist/features/reviews/components/ReviewDetailShell.js +15 -3
  322. package/dist/features/reviews/components/ReviewSummary.js +4 -2
  323. package/dist/features/reviews/components/ReviewsIndexListing.js +8 -2
  324. package/dist/features/reviews/components/ReviewsList.js +1 -1
  325. package/dist/features/reviews/hooks/useReviews.d.ts +2 -2
  326. package/dist/features/scams/components/ScamAwarenessModal.js +2 -2
  327. package/dist/features/scams/components/ScamProfileView.js +3 -3
  328. package/dist/features/scams/components/ScamRegistryView.js +6 -4
  329. package/dist/features/search/components/Search.js +9 -6
  330. package/dist/features/search/components/SearchFiltersRow.js +1 -1
  331. package/dist/features/search/components/SearchResultsSection.js +1 -1
  332. package/dist/features/search/hooks/useSearch.d.ts +2 -2
  333. package/dist/features/seller/components/CouponInlineSelect.d.ts +22 -0
  334. package/dist/features/seller/components/CouponInlineSelect.js +103 -0
  335. package/dist/features/seller/components/GroupInlineSelect.d.ts +23 -0
  336. package/dist/features/seller/components/GroupInlineSelect.js +80 -0
  337. package/dist/features/seller/components/PhysicalLocationModal.js +2 -1
  338. package/dist/features/seller/components/PrintCenterView.js +2 -1
  339. package/dist/features/seller/components/ProductInlineSelect.d.ts +24 -0
  340. package/dist/features/seller/components/ProductInlineSelect.js +42 -0
  341. package/dist/features/seller/components/QuickProductForm.js +4 -1
  342. package/dist/features/seller/components/SellerAddressesView.js +8 -3
  343. package/dist/features/seller/components/SellerAnalyticsAlertsView.js +6 -3
  344. package/dist/features/seller/components/SellerAnalyticsView.js +2 -2
  345. package/dist/features/seller/components/SellerBidsView.js +7 -7
  346. package/dist/features/seller/components/SellerBundlesView.js +2 -1
  347. package/dist/features/seller/components/SellerCouponEditorView.d.ts +2 -0
  348. package/dist/features/seller/components/SellerCouponEditorView.js +15 -3
  349. package/dist/features/seller/components/SellerCouponsView.js +1 -1
  350. package/dist/features/seller/components/SellerDashboardView.js +2 -2
  351. package/dist/features/seller/components/SellerDigitalCodesView.js +2 -2
  352. package/dist/features/seller/components/SellerGoogleReviewsView.js +2 -2
  353. package/dist/features/seller/components/SellerGroupedListingsView.js +5 -5
  354. package/dist/features/seller/components/SellerOrdersView.js +13 -10
  355. package/dist/features/seller/components/SellerPayoutMethodsView.js +5 -4
  356. package/dist/features/seller/components/SellerPayoutRequestView.js +5 -1
  357. package/dist/features/seller/components/SellerPayoutSettingsView.js +5 -2
  358. package/dist/features/seller/components/SellerPreOrdersView.js +6 -6
  359. package/dist/features/seller/components/SellerPrizeDrawsView.js +6 -6
  360. package/dist/features/seller/components/SellerProductShell.js +1 -1
  361. package/dist/features/seller/components/SellerProductsCards.js +4 -1
  362. package/dist/features/seller/components/SellerProductsView.js +5 -5
  363. package/dist/features/seller/components/SellerReviewsView.js +7 -3
  364. package/dist/features/seller/components/SellerShippingConfigsView.js +4 -4
  365. package/dist/features/seller/components/SellerShippingView.js +1 -1
  366. package/dist/features/seller/components/SellerSidebar.js +15 -8
  367. package/dist/features/seller/components/SellerStoreCategoriesView.js +1 -1
  368. package/dist/features/seller/components/SellerStorefrontView.js +2 -2
  369. package/dist/features/seller/components/SellerTemplatesView.js +7 -4
  370. package/dist/features/seller/components/SublistingInlineSelect.d.ts +19 -0
  371. package/dist/features/seller/components/SublistingInlineSelect.js +83 -0
  372. package/dist/features/seller/components/analytics/SellerTopProducts.js +1 -1
  373. package/dist/features/seller/components/index.d.ts +8 -0
  374. package/dist/features/seller/components/index.js +4 -0
  375. package/dist/features/seller/hooks/useSellerPayouts.d.ts +3 -3
  376. package/dist/features/seller/hooks/useSellerStore.d.ts +6 -6
  377. package/dist/features/seller/hooks/useSellerStorefront.d.ts +2 -2
  378. package/dist/features/shell/FormShell.js +10 -2
  379. package/dist/features/shell/QuickFormDrawer.js +5 -5
  380. package/dist/features/shell/StepForm.js +6 -6
  381. package/dist/features/site-settings/components/ActionPermissionsManager.js +8 -4
  382. package/dist/features/site-settings/components/NavPermissionsManager.js +7 -4
  383. package/dist/features/stores/components/InteractiveStoreCard.js +5 -1
  384. package/dist/features/stores/components/StoreAboutView.js +4 -1
  385. package/dist/features/stores/components/StoreAddressSelectorCreate.d.ts +2 -1
  386. package/dist/features/stores/components/StoreAddressSelectorCreate.js +5 -31
  387. package/dist/features/stores/components/StoreAuctionsListing.js +6 -3
  388. package/dist/features/stores/components/StoreGuideHubView.js +5 -2
  389. package/dist/features/stores/components/StoreHeader.js +8 -1
  390. package/dist/features/stores/components/StorePreOrdersListing.js +6 -3
  391. package/dist/features/stores/components/StoreProductsListing.js +6 -3
  392. package/dist/features/stores/components/StoreReviewsListing.js +8 -2
  393. package/dist/features/stores/components/StoresIndexListing.js +12 -6
  394. package/dist/features/stores/hooks/useStoreAddressSelector.d.ts +1 -1
  395. package/dist/features/stores/hooks/useStores.d.ts +6 -6
  396. package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +7 -1
  397. package/dist/features/whatsapp-bot/components/WhatsAppChatButton.js +2 -1
  398. package/dist/features/wishlist/components/WishlistPage.js +2 -1
  399. package/dist/features/wishlist/hooks/useUserWishlist.d.ts +15 -15
  400. package/dist/features/wishlist/hooks/useWishlist.d.ts +1 -1
  401. package/dist/features/wishlist/hooks/useWishlistWithGuest.d.ts +1 -1
  402. package/dist/index.d.ts +10 -0
  403. package/dist/index.js +13 -1
  404. package/dist/next/components/GlobalError.js +2 -2
  405. package/dist/next/routing/route-map.d.ts +2 -0
  406. package/dist/next/routing/route-map.js +1 -0
  407. package/dist/react/ErrorBoundary.js +2 -2
  408. package/dist/styles.css +2 -1
  409. package/dist/tailwind-utilities.css +1 -1
  410. package/dist/ui/DataTable.js +17 -16
  411. package/dist/ui/components/DateInput.js +2 -2
  412. package/dist/ui/components/DetailPageGallery.js +4 -1
  413. package/dist/ui/components/DetailPageTabs.js +6 -2
  414. package/dist/ui/components/ImageLightbox.js +5 -3
  415. package/dist/ui/components/Input.js +6 -3
  416. package/dist/ui/components/Layout.d.ts +4 -0
  417. package/dist/ui/components/Layout.js +1 -1
  418. package/dist/ui/components/Layout.style.css +1 -0
  419. package/dist/ui/components/ListingFilterDrawer.js +4 -1
  420. package/dist/ui/components/ListingLayout.js +9 -8
  421. package/dist/ui/components/ListingToolbar.js +5 -1
  422. package/dist/ui/components/PaginatedSelect.d.ts +1 -2
  423. package/dist/ui/components/PaginatedSelect.js +1 -2
  424. package/dist/ui/components/Radio.js +1 -1
  425. package/dist/ui/components/Select.js +2 -1
  426. package/dist/ui/components/Slider.js +1 -1
  427. package/dist/ui/components/VacationBanner.js +2 -1
  428. package/dist/ui/components/surface-tokens.d.ts +1 -0
  429. package/dist/ui/components/surface-tokens.js +1 -0
  430. package/package.json +11 -2
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import React from "react";
4
4
  import { useMutation, useQuery } from "@tanstack/react-query";
5
- import { Button, ConfirmDeleteModal, Form, Input, StackedViewShell, useToast, } from "../../../ui";
5
+ import { Button, ConfirmDeleteModal, Div, Form, Input, StackedViewShell, useToast, } from "../../../ui";
6
6
  import { FieldInput, FormShellContext, useFormShellState } from "../../../ui/forms";
7
7
  import { ImageUpload } from "../../media/upload/ImageUpload";
8
8
  import { useMediaUpload } from "../../media";
@@ -79,9 +79,9 @@ export function AdminSublistingCategoryEditorView({ categoryId, onSaved, onDelet
79
79
  return;
80
80
  }
81
81
  saveMutation.mutate();
82
- }, className: "space-y-4", children: [_jsxs("div", { className: "grid sm:grid-cols-2 gap-4", children: [_jsx(FieldInput, { name: "name", label: "Category name", value: name, onChange: (v) => setName(v), required: true, placeholder: "e.g. Base Set Charizard 108/120" }), _jsx(Input, { label: "Item code", value: itemCode, onChange: (e) => setItemCode(e.target.value), placeholder: "e.g. PSA 10, 108/120, STH", helperText: "Grade, card number, or series code. Optional." })] }), _jsx(Input, { label: "Description", value: description, onChange: (e) => setDescription(e.target.value), placeholder: "Brief description shown on the public category page" }), _jsx(ImageUpload, { label: "Cover image", currentImage: coverImage, onUpload: (file) => upload(file, "sublisting-categories", true, {
82
+ }, className: "space-y-4", children: [_jsxs(Div, { className: "grid sm:grid-cols-2 gap-4", children: [_jsx(FieldInput, { name: "name", label: "Category name", value: name, onChange: (v) => setName(v), required: true, placeholder: "e.g. Base Set Charizard 108/120" }), _jsx(Input, { label: "Item code", value: itemCode, onChange: (e) => setItemCode(e.target.value), placeholder: "e.g. PSA 10, 108/120, STH", helperText: "Grade, card number, or series code. Optional." })] }), _jsx(Input, { label: "Description", value: description, onChange: (e) => setDescription(e.target.value), placeholder: "Brief description shown on the public category page" }), _jsx(ImageUpload, { label: "Cover image", currentImage: coverImage, onUpload: (file) => upload(file, "sublisting-categories", true, {
83
83
  type: "category-image",
84
84
  name: name || "sublisting",
85
- }), onChange: setCoverImage }), _jsxs("div", { className: "flex gap-3 pt-2", children: [_jsx(Button, { type: "submit", isLoading: isSubmitting, disabled: !name || isSubmitting, children: isEdit ? "Save changes" : "Create category" }), isEdit && (_jsx(Button, { type: "button", variant: "danger", isLoading: deleteMutation.isPending, onClick: () => setDeleteConfirmOpen(true), children: "Delete" }))] })] }, "sc-editor-form") }, "sc-ctx"),
85
+ }), onChange: setCoverImage }), _jsxs(Div, { className: "flex gap-3 pt-2", children: [_jsx(Button, { type: "submit", isLoading: isSubmitting, disabled: !name || isSubmitting, children: isEdit ? "Save changes" : "Create category" }), isEdit && (_jsx(Button, { type: "button", variant: "danger", isLoading: deleteMutation.isPending, onClick: () => setDeleteConfirmOpen(true), children: "Delete" }))] })] }, "sc-editor-form") }, "sc-ctx"),
86
86
  ] }), deleteConfirmOpen && (_jsx(ConfirmDeleteModal, { isOpen: true, title: "Delete Sublisting Category", message: "Delete this category? All linked listings will be unlinked. This cannot be undone.", onConfirm: () => { deleteMutation.mutate(); setDeleteConfirmOpen(false); }, onClose: () => setDeleteConfirmOpen(false), isDeleting: deleteMutation.isPending }))] }));
87
87
  }
@@ -2,9 +2,16 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import React from "react";
4
4
  import { useMutation, useQueryClient } from "@tanstack/react-query";
5
- import { Button, Div, FormActions, Input, Row, Select, SideDrawer, Text, Toggle, useToast, } from "../../../ui";
5
+ import { Button, Div, FormActions, Input, Label, Row, Select, SideDrawer, Span, Text, Toggle, useToast, } from "../../../ui";
6
6
  import { apiClient } from "../../../http";
7
7
  import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
8
+ const __P = {
9
+ p3: "p-3",
10
+ p4: "p-4",
11
+ };
12
+ const __O = {
13
+ yAuto: "overflow-y-auto",
14
+ };
8
15
  const STATUS_OPTIONS = [
9
16
  { label: "Open", value: "open" },
10
17
  { label: "In Progress", value: "in_progress" },
@@ -233,9 +240,9 @@ export function AdminSupportTicketDetailView({ open, onClose, ticketId, subject,
233
240
  showToast(err?.message ?? "Failed to update order items.", "error");
234
241
  },
235
242
  });
236
- return (_jsx(SideDrawer, { isOpen: open, onClose: onClose, title: subject ?? "Support Ticket", children: _jsxs(Div, { className: "flex flex-col gap-4 p-4", children: [_jsxs(Div, { className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: `inline-flex rounded-full px-2.5 py-1 text-xs font-medium ${STATUS_COLOR[currentStatus ?? "open"] ?? STATUS_COLOR.open}`, children: (currentStatus ?? "open").replace(/_/g, " ") }), _jsx("span", { className: "rounded-full bg-zinc-100 px-2.5 py-1 text-xs text-zinc-600 dark:bg-zinc-800 dark:text-zinc-300", children: category }), orderId && (_jsxs("span", { className: "rounded-full bg-zinc-100 px-2.5 py-1 text-xs text-zinc-600 dark:bg-zinc-800 dark:text-zinc-300", children: ["Order: ", orderId] }))] }), _jsxs(Div, { className: "text-sm text-zinc-500 dark:text-zinc-400", children: ["From: ", _jsx("span", { className: "font-medium text-zinc-700 dark:text-zinc-200", children: userDisplayName })] }), description && (_jsxs(Div, { className: "rounded-lg border border-zinc-200 bg-zinc-50 p-3 dark:border-zinc-700 dark:bg-zinc-900/40", children: [_jsx(Text, { className: "mb-1 text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wide", children: "Description" }), _jsx(Text, { className: "whitespace-pre-wrap text-sm text-zinc-700 dark:text-zinc-200", children: description })] })), messages.length > 0 && (_jsxs(Div, { className: "space-y-2", children: [_jsxs(Text, { className: "text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wide", children: ["Messages (", messages.length, ")"] }), _jsx("div", { className: "space-y-2 max-h-64 overflow-y-auto", children: messages.map((msg, i) => (_jsxs("div", { className: `rounded-lg p-3 text-sm ${msg.authorRole === "user"
243
+ return (_jsx(SideDrawer, { isOpen: open, onClose: onClose, title: subject ?? "Support Ticket", children: _jsxs(Div, { className: `flex flex-col gap-4 ${__P.p4}`, children: [_jsxs(Div, { className: "flex flex-wrap items-center gap-2", children: [_jsx(Span, { size: "xs", weight: "medium", className: `inline-flex rounded-full px-2.5 py-1 ${STATUS_COLOR[currentStatus ?? "open"] ?? STATUS_COLOR.open}`, children: (currentStatus ?? "open").replace(/_/g, " ") }), _jsx(Span, { size: "xs", className: "rounded-full bg-zinc-100 px-2.5 py-1 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-300", children: category }), orderId && (_jsxs(Span, { size: "xs", className: "rounded-full bg-zinc-100 px-2.5 py-1 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-300", children: ["Order: ", orderId] }))] }), _jsxs(Div, { className: "text-sm text-zinc-500 dark:text-zinc-400", children: ["From: ", _jsx(Span, { weight: "medium", className: "text-zinc-700 dark:text-zinc-200", children: userDisplayName })] }), description && (_jsxs(Div, { className: `rounded-lg border border-zinc-200 bg-zinc-50 ${__P.p3} dark:border-zinc-700 dark:bg-zinc-900/40`, children: [_jsx(Text, { className: "mb-1 text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wide", children: "Description" }), _jsx(Text, { className: "whitespace-pre-wrap text-sm text-zinc-700 dark:text-zinc-200", children: description })] })), messages.length > 0 && (_jsxs(Div, { className: "space-y-2", children: [_jsxs(Text, { className: "text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wide", children: ["Messages (", messages.length, ")"] }), _jsx(Div, { className: `space-y-2 max-h-64 ${__O.yAuto}`, children: messages.map((msg, i) => (_jsxs(Div, { className: `rounded-lg p-3 text-sm ${msg.authorRole === "user"
237
244
  ? "bg-zinc-50 border border-zinc-200 dark:bg-zinc-900/40 dark:border-zinc-700"
238
- : "bg-info-surface border border-blue-200 dark:border-blue-800"}`, children: [_jsxs("div", { className: "mb-1 flex items-center gap-2 text-xs text-zinc-400 dark:text-zinc-400", children: [_jsx("span", { className: "font-medium text-zinc-600 dark:text-zinc-300", children: ROLE_LABEL[msg.authorRole ?? "user"] ?? msg.authorRole }), msg.createdAt && (_jsx("span", { children: new Date(msg.createdAt).toLocaleString() }))] }), _jsx(Text, { className: "whitespace-pre-wrap text-zinc-700 dark:text-zinc-200", children: msg.body })] }, msg.id ?? i))) })] })), _jsxs(Div, { className: "flex flex-col gap-1", children: [_jsx("label", { className: "text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wide", children: "Reply to user" }), _jsx("textarea", { value: replyBody, onChange: (e) => setReplyBody(e.target.value), rows: 3, placeholder: "Type a reply\u2026", className: "w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-white dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-900 dark:text-zinc-100 placeholder-zinc-400 focus:outline-none focus:ring-2 focus:ring-primary-500" }), _jsx(Button, { type: "button", variant: "primary", size: "sm", isLoading: replyMutation.isPending, disabled: !replyBody.trim() || !ticketId || replyMutation.isPending, onClick: () => replyMutation.mutate(), children: "Send reply" })] }), _jsx("hr", { className: "border-zinc-200 dark:border-zinc-700" }), _jsx(Select, { label: "Status", options: STATUS_OPTIONS, value: status, onValueChange: setStatus }), _jsx(Select, { label: "Priority", options: PRIORITY_OPTIONS, value: priority, onValueChange: setPriority }), _jsxs(Div, { className: "flex flex-col gap-1", children: [_jsx("label", { className: "text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wide", children: "Internal notes (staff only)" }), _jsx("textarea", { value: notes, onChange: (e) => setNotes(e.target.value), rows: 3, placeholder: "Notes visible only to admins and employees\u2026", className: "w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-white dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-900 dark:text-zinc-100 placeholder-zinc-400 focus:outline-none focus:ring-2 focus:ring-primary-500" })] }), _jsxs(Div, { padding: "sm", className: "flex flex-col gap-2 rounded-lg border border-zinc-200 dark:border-zinc-700", children: [_jsx(Text, { className: "text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wide", children: "Linked parties" }), _jsx(Text, { className: "text-xs text-zinc-500 dark:text-zinc-400", children: "Tag the buyer / store / order / product / bid this ticket concerns." }), [
245
+ : "bg-info-surface border border-blue-200 dark:border-blue-800"}`, children: [_jsxs(Div, { className: "mb-1 flex items-center gap-2 text-xs text-zinc-400 dark:text-zinc-400", children: [_jsx(Span, { weight: "medium", className: "text-zinc-600 dark:text-zinc-300", children: ROLE_LABEL[msg.authorRole ?? "user"] ?? msg.authorRole }), msg.createdAt && (_jsx(Span, { children: new Date(msg.createdAt).toLocaleString() }))] }), _jsx(Text, { className: "whitespace-pre-wrap text-zinc-700 dark:text-zinc-200", children: msg.body })] }, msg.id ?? i))) })] })), _jsxs(Div, { className: "flex flex-col gap-1", children: [_jsx(Label, { className: "text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wide", children: "Reply to user" }), _jsx("textarea", { value: replyBody, onChange: (e) => setReplyBody(e.target.value), rows: 3, placeholder: "Type a reply\u2026", className: "w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-white dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-900 dark:text-zinc-100 placeholder-zinc-400 focus:outline-none focus:ring-2 focus:ring-primary-500" }), _jsx(Button, { type: "button", variant: "primary", size: "sm", isLoading: replyMutation.isPending, disabled: !replyBody.trim() || !ticketId || replyMutation.isPending, onClick: () => replyMutation.mutate(), children: "Send reply" })] }), _jsx("hr", { className: "border-zinc-200 dark:border-zinc-700" }), _jsx(Select, { label: "Status", options: STATUS_OPTIONS, value: status, onValueChange: setStatus }), _jsx(Select, { label: "Priority", options: PRIORITY_OPTIONS, value: priority, onValueChange: setPriority }), _jsxs(Div, { className: "flex flex-col gap-1", children: [_jsx(Label, { className: "text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wide", children: "Internal notes (staff only)" }), _jsx("textarea", { value: notes, onChange: (e) => setNotes(e.target.value), rows: 3, placeholder: "Notes visible only to admins and employees\u2026", className: "w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-white dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-900 dark:text-zinc-100 placeholder-zinc-400 focus:outline-none focus:ring-2 focus:ring-primary-500" })] }), _jsxs(Div, { padding: "sm", className: "flex flex-col gap-2 rounded-lg border border-zinc-200 dark:border-zinc-700", children: [_jsx(Text, { className: "text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wide", children: "Linked parties" }), _jsx(Text, { className: "text-xs text-zinc-500 dark:text-zinc-400", children: "Tag the buyer / store / order / product / bid this ticket concerns." }), [
239
246
  ["userId", "User slug"],
240
247
  ["storeId", "Store slug"],
241
248
  ["orderId", "Order ID"],
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import React, { useState } from "react";
4
- import { FilterChipGroup, ListingLayout, RowActionMenu, Text } from "../../../ui";
4
+ import { Div, FilterChipGroup, ListingLayout, RowActionMenu, Span, Text } from "../../../ui";
5
5
  import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
6
6
  import { ROW_ACTION_META, ROW_ACTION_ID } from "../../../features/products/constants/action-defs";
7
7
  import { ADMIN_SUPPORT_TICKET_STATUS_TABS, ADMIN_SUPPORT_TICKET_PRIORITY_TABS, } from "../constants/filter-tabs";
@@ -27,7 +27,7 @@ const TICKET_COLUMNS = [
27
27
  header: "Subject",
28
28
  render: (row) => {
29
29
  const priority = toStringValue(row._raw?.priority, "normal");
30
- return (_jsxs("div", { className: "space-y-1", children: [_jsx(Text, { className: "font-medium text-zinc-900 dark:text-zinc-100", children: row.primary }), row.secondary ? (_jsx(Text, { className: "text-xs text-zinc-500 dark:text-zinc-400", children: row.secondary })) : null, _jsx("span", { className: `inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${PRIORITY_BADGE[priority] ?? PRIORITY_BADGE.normal}`, children: priority })] }));
30
+ return (_jsxs(Div, { className: "space-y-1", children: [_jsx(Text, { className: "font-medium text-zinc-900 dark:text-zinc-100", children: row.primary }), row.secondary ? (_jsx(Text, { className: "text-xs text-zinc-500 dark:text-zinc-400", children: row.secondary })) : null, _jsx("span", { className: `inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${PRIORITY_BADGE[priority] ?? PRIORITY_BADGE.normal}`, children: priority })] }));
31
31
  },
32
32
  },
33
33
  {
@@ -40,7 +40,7 @@ const TICKET_COLUMNS = [
40
40
  key: "updatedAt",
41
41
  header: "Updated",
42
42
  className: "w-32",
43
- render: (row) => (_jsx("span", { className: "text-sm text-zinc-500 dark:text-zinc-400", children: row.updatedAt })),
43
+ render: (row) => (_jsx(Span, { size: "sm", className: "text-zinc-500 dark:text-zinc-400", children: row.updatedAt })),
44
44
  },
45
45
  ];
46
46
  export function AdminSupportTicketsView({ children, ...props }) {
@@ -1,20 +1,20 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { Shield, Ban, AlertTriangle, Headphones, Flag, ClipboardList } from "lucide-react";
3
- import { Div, Heading, Span, Text, Section, Alert } from "../../../ui";
3
+ import { Div, Heading, Span, Text, Section, Alert, Table, Thead, Tbody, Tr, Th, Td } from "../../../ui";
4
4
  import { GC } from "../../_guide-cls";
5
5
  const STILL_ALLOWED = "✓ Still allowed";
6
6
  export function AdminTrustGuideView() {
7
7
  return (_jsxs(Div, { className: "space-y-8 pb-10 max-w-3xl mx-auto", children: [_jsxs(Section, { children: [_jsxs(Div, { className: "flex items-center gap-3 mb-2", children: [_jsx(Div, { className: "flex-shrink-0 w-10 h-10 rounded-xl flex items-center justify-center", style: { background: "linear-gradient(135deg,var(--appkit-color-primary-700,#4f46e5) 0%,var(--appkit-color-cobalt,#2563eb) 100%)" }, children: _jsx(Shield, { className: "w-5 h-5 text-white" }) }), _jsx(Text, { className: "text-sm font-semibold text-[var(--appkit-color-text-muted)] uppercase tracking-widest", children: "Admin Guide" })] }), _jsx(Heading, { level: 1, className: "text-2xl md:text-3xl font-bold text-[var(--appkit-color-text)] mb-2", children: "Trust & Safety" }), _jsx(Text, { className: "text-[var(--appkit-color-text-muted)]", children: "Bans, scam registry, support tickets, moderation, and reports on LetItRip." })] }), [
8
8
  {
9
9
  Icon: Ban, title: "Soft Ban vs Hard Ban",
10
- content: (_jsxs(_Fragment, { children: [_jsx(Div, { className: "overflow-x-auto", children: _jsxs("table", { className: "w-full text-sm border-collapse", children: [_jsx("thead", { children: _jsx("tr", { className: "border-b border-[var(--appkit-color-border)]", children: ["", "Soft Ban", "Hard Ban"].map((h) => (_jsx("th", { className: "text-left py-2 pr-4 font-semibold text-[var(--appkit-color-text)]", children: h }, h))) }) }), _jsx("tbody", { className: "text-[var(--appkit-color-text-muted)] text-sm", children: [
10
+ content: (_jsxs(_Fragment, { children: [_jsx(Div, { className: "overflow-x-auto", children: _jsxs(Table, { className: "w-full text-sm border-collapse", children: [_jsx(Thead, { children: _jsx(Tr, { className: "border-b border-[var(--appkit-color-border)]", children: ["", "Soft Ban", "Hard Ban"].map((h) => (_jsx(Th, { className: "text-left py-2 pr-4 font-semibold text-[var(--appkit-color-text)]", children: h }, h))) }) }), _jsx(Tbody, { className: "text-[var(--appkit-color-text-muted)] text-sm", children: [
11
11
  ["Login", STILL_ALLOWED, "✗ Blocked"],
12
12
  ["Browse", STILL_ALLOWED, STILL_ALLOWED],
13
13
  ["Buy", "Depends on scope", "✗ Blocked"],
14
14
  ["Sell", "Depends on scope", "✗ Blocked — store suspended"],
15
15
  ["Bid", "Can restrict with place_bids scope", "✗ Blocked"],
16
16
  ["Duration", "Set expiry date", "Permanent until admin lifts"],
17
- ].map(([action, soft, hard]) => (_jsxs("tr", { className: "border-b border-[var(--appkit-color-border)]/50", children: [_jsx("td", { className: "py-2 pr-4 font-medium text-[var(--appkit-color-text)]", children: action }), _jsx("td", { className: "py-2 pr-4", children: soft }), _jsx("td", { className: "py-2", children: hard })] }, action))) })] }) }), _jsxs(Text, { className: "text-sm text-[var(--appkit-color-text-muted)] mt-3", children: [_jsx(Span, { weight: "bold", className: "text-[var(--appkit-color-text)]", children: "Soft ban scopes" }), ": ", _jsx("code", { className: "text-xs bg-[var(--appkit-color-border)] px-1 rounded", children: "place_bids" }), ", ", _jsx("code", { className: "text-xs bg-[var(--appkit-color-border)] px-1 rounded", children: "write_reviews" }), ", ", _jsx("code", { className: "text-xs bg-[var(--appkit-color-border)] px-1 rounded", children: "create_listings" }), ", ", _jsx("code", { className: "text-xs bg-[var(--appkit-color-border)] px-1 rounded", children: "open_tickets" }), ", ", _jsx("code", { className: "text-xs bg-[var(--appkit-color-border)] px-1 rounded", children: "join_events" }), ". Multiple scopes can be combined."] })] })),
17
+ ].map(([action, soft, hard]) => (_jsxs(Tr, { className: "border-b border-[var(--appkit-color-border)]/50", children: [_jsx(Td, { className: "py-2 pr-4 font-medium text-[var(--appkit-color-text)]", children: action }), _jsx(Td, { className: "py-2 pr-4", children: soft }), _jsx(Td, { className: "py-2", children: hard })] }, action))) })] }) }), _jsxs(Text, { className: "text-sm text-[var(--appkit-color-text-muted)] mt-3", children: [_jsx(Span, { weight: "bold", className: "text-[var(--appkit-color-text)]", children: "Soft ban scopes" }), ": ", _jsx("code", { className: "text-xs bg-[var(--appkit-color-border)] px-1 rounded", children: "place_bids" }), ", ", _jsx("code", { className: "text-xs bg-[var(--appkit-color-border)] px-1 rounded", children: "write_reviews" }), ", ", _jsx("code", { className: "text-xs bg-[var(--appkit-color-border)] px-1 rounded", children: "create_listings" }), ", ", _jsx("code", { className: "text-xs bg-[var(--appkit-color-border)] px-1 rounded", children: "open_tickets" }), ", ", _jsx("code", { className: "text-xs bg-[var(--appkit-color-border)] px-1 rounded", children: "join_events" }), ". Multiple scopes can be combined."] })] })),
18
18
  },
19
19
  {
20
20
  Icon: AlertTriangle, title: "Scam Registry",
@@ -1,18 +1,18 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { Users, Search, Edit, Monitor, UserCog, AlertTriangle } from "lucide-react";
3
- import { Div, Heading, Span, Text, Section, Alert } from "../../../ui";
3
+ import { Div, Heading, Span, Text, Section, Alert, Table, Thead, Tbody, Tr, Th, Td } from "../../../ui";
4
4
  import { GC } from "../../_guide-cls";
5
5
  export function AdminUsersGuideView() {
6
6
  return (_jsxs(Div, { className: "space-y-8 pb-10 max-w-3xl mx-auto", children: [_jsxs(Section, { children: [_jsxs(Div, { className: "flex items-center gap-3 mb-2", children: [_jsx(Div, { className: "flex-shrink-0 w-10 h-10 rounded-xl flex items-center justify-center", style: { background: "linear-gradient(135deg,var(--appkit-color-primary-700,#4f46e5) 0%,var(--appkit-color-cobalt,#2563eb) 100%)" }, children: _jsx(Users, { className: "w-5 h-5 text-white" }) }), _jsx(Text, { className: "text-sm font-semibold text-[var(--appkit-color-text-muted)] uppercase tracking-widest", children: "Admin Guide" })] }), _jsx(Heading, { level: 1, className: "text-2xl md:text-3xl font-bold text-[var(--appkit-color-text)] mb-2", children: "Users & Accounts" }), _jsx(Text, { className: "text-[var(--appkit-color-text-muted)]", children: "Managing users, roles, sessions, and employee accounts on LetItRip." })] }), [
7
7
  {
8
8
  Icon: Users, title: "User Roles Overview",
9
- content: (_jsx(Div, { className: "overflow-x-auto", children: _jsxs("table", { className: "w-full text-sm border-collapse", children: [_jsx("thead", { children: _jsx("tr", { className: "border-b border-[var(--appkit-color-border)]", children: ["Role", "What they can do", "How assigned"].map((h) => (_jsx("th", { className: "text-left py-2 pr-4 font-semibold text-[var(--appkit-color-text)]", children: h }, h))) }) }), _jsx("tbody", { className: "text-[var(--appkit-color-text-muted)]", children: [
9
+ content: (_jsx(Div, { className: "overflow-x-auto", children: _jsxs(Table, { className: "w-full text-sm border-collapse", children: [_jsx(Thead, { children: _jsx(Tr, { className: "border-b border-[var(--appkit-color-border)]", children: ["Role", "What they can do", "How assigned"].map((h) => (_jsx(Th, { className: "text-left py-2 pr-4 font-semibold text-[var(--appkit-color-text)]", children: h }, h))) }) }), _jsx(Tbody, { className: "text-[var(--appkit-color-text-muted)]", children: [
10
10
  ["user", "Browse, buy, bid, wishlist, reviews, support tickets", "Auto on registration"],
11
11
  ["seller", "Everything above + store management + listings", "Auto when store is created"],
12
12
  ["moderator", "Review content, manage scam reports, FAQ moderation", "Admin team invite"],
13
13
  ["employee", "Assigned permission-group access to admin sections", "Admin team invite"],
14
14
  ["admin", "Full access to all admin sections, bypasses RBAC checks", "Manual via Firebase console"],
15
- ].map(([role, can, how]) => (_jsxs("tr", { className: "border-b border-[var(--appkit-color-border)]/50", children: [_jsx("td", { className: "py-2 pr-4 font-mono text-xs text-[var(--appkit-color-primary)]", children: role }), _jsx("td", { className: "py-2 pr-4", children: can }), _jsx("td", { className: "py-2", children: how })] }, role))) })] }) })),
15
+ ].map(([role, can, how]) => (_jsxs(Tr, { className: "border-b border-[var(--appkit-color-border)]/50", children: [_jsx(Td, { className: "py-2 pr-4 font-mono text-xs text-[var(--appkit-color-primary)]", children: role }), _jsx(Td, { className: "py-2 pr-4", children: can }), _jsx(Td, { className: "py-2", children: how })] }, role))) })] }) })),
16
16
  },
17
17
  {
18
18
  Icon: Search, title: "User List & Search",
@@ -1,6 +1,12 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { Div, Grid, Row, Span, Stack, Text } from "../../../ui";
4
+ const __P = {
5
+ p3: "p-3",
6
+ };
7
+ const __O = {
8
+ hidden: "overflow-hidden",
9
+ };
4
10
  const FLAG_BADGES = [
5
11
  { key: "featured", label: "Featured", color: "bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300" },
6
12
  { key: "isPromoted", label: "Promoted", color: "bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300" },
@@ -8,13 +14,13 @@ const FLAG_BADGES = [
8
14
  { key: "isSold", label: "Sold", color: "bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400" },
9
15
  ];
10
16
  function StatusBadge({ status }) {
11
- return (_jsx(Span, { className: "inline-flex rounded-full bg-primary-50 px-2 py-0.5 text-xs font-medium text-primary-800 dark:bg-secondary-900/30 dark:text-secondary-300 truncate max-w-[120px]", children: status }));
17
+ return (_jsx(Span, { size: "xs", weight: "medium", className: "inline-flex rounded-full bg-primary-50 px-2 py-0.5 text-primary-800 dark:bg-secondary-900/30 dark:text-secondary-300 truncate max-w-[120px]", children: status }));
12
18
  }
13
19
  function SkeletonCard({ view }) {
14
20
  if (view === "list") {
15
21
  return (_jsxs(Row, { gap: "sm", className: "px-4 py-3 animate-pulse", children: [_jsx(Div, { className: "h-4 w-4 rounded bg-zinc-200 dark:bg-slate-700 shrink-0" }), _jsxs(Stack, { gap: "xs", className: "flex-1", children: [_jsx(Div, { className: "h-3 bg-zinc-200 dark:bg-slate-700 rounded w-2/3" }), _jsx(Div, { className: "h-2.5 bg-zinc-200 dark:bg-slate-700 rounded w-1/3" })] }), _jsx(Div, { className: "h-5 w-16 bg-zinc-200 dark:bg-slate-700 rounded-full shrink-0" }), _jsx(Div, { className: "h-3 w-20 bg-zinc-200 dark:bg-slate-700 rounded shrink-0" })] }));
16
22
  }
17
- return (_jsx(Div, { rounded: "xl", border: "subtle", className: "overflow-hidden animate-pulse", children: _jsxs(Stack, { gap: "xs", padding: "md", children: [_jsx(Div, { className: "h-4 bg-zinc-200 dark:bg-slate-700 rounded w-3/4" }), _jsx(Div, { className: "h-3 bg-zinc-200 dark:bg-slate-700 rounded w-1/2" }), _jsx(Div, { className: "h-5 bg-zinc-200 dark:bg-slate-700 rounded-full w-20 mt-1" }), _jsx(Div, { className: "h-3 bg-zinc-200 dark:bg-slate-700 rounded w-1/3" })] }) }));
23
+ return (_jsx(Div, { rounded: "xl", border: "subtle", className: `${__O.hidden} animate-pulse`, children: _jsxs(Stack, { gap: "xs", padding: "md", children: [_jsx(Div, { className: "h-4 bg-zinc-200 dark:bg-slate-700 rounded w-3/4" }), _jsx(Div, { className: "h-3 bg-zinc-200 dark:bg-slate-700 rounded w-1/2" }), _jsx(Div, { className: "h-5 bg-zinc-200 dark:bg-slate-700 rounded-full w-20 mt-1" }), _jsx(Div, { className: "h-3 bg-zinc-200 dark:bg-slate-700 rounded w-1/3" })] }) }));
18
24
  }
19
25
  function AdminCardItem({ row, view, selected, onToggleSelect, onRowClick, }) {
20
26
  const flags = FLAG_BADGES.filter(({ key }) => Boolean(row[key]));
@@ -27,20 +33,20 @@ function AdminCardItem({ row, view, selected, onToggleSelect, onRowClick, }) {
27
33
  return (_jsxs(Row, { gap: "sm", className: [
28
34
  "px-4 py-3 cursor-pointer transition-colors hover:bg-zinc-50 dark:hover:bg-slate-800/50",
29
35
  selected ? "bg-primary-50/40 dark:bg-primary-900/10" : "",
30
- ].filter(Boolean).join(" "), onClick: handleClick, role: onRowClick ? "button" : undefined, children: [onToggleSelect && (_jsx(Div, { "data-checkbox": true, className: "shrink-0", onClick: (e) => { e.stopPropagation(); onToggleSelect(row.id); }, children: _jsx("input", { type: "checkbox", checked: selected, onChange: () => onToggleSelect(row.id), className: "h-4 w-4 rounded border-zinc-300 text-primary accent-primary cursor-pointer", "aria-label": `Select ${row.primary}` }) })), _jsxs(Stack, { gap: "none", className: "flex-1 min-w-0", children: [_jsx(Text, { size: "sm", weight: "semibold", className: "truncate text-zinc-900 dark:text-zinc-100", children: row.primary }), _jsx(Text, { size: "xs", color: "muted", className: "truncate", children: row.secondary })] }), flags.length > 0 && (_jsx(Row, { gap: "xs", className: "hidden sm:flex shrink-0", children: flags.map(({ key, label, color }) => (_jsx(Span, { className: `inline-flex rounded-full px-1.5 py-0.5 text-[10px] font-medium ${color}`, children: label }, key))) })), _jsx(StatusBadge, { status: row.status }), _jsx(Span, { size: "xs", color: "muted", className: "hidden sm:block shrink-0 w-24 text-right", children: row.updatedAt })] }));
36
+ ].filter(Boolean).join(" "), onClick: handleClick, role: onRowClick ? "button" : undefined, children: [onToggleSelect && (_jsx(Div, { "data-checkbox": true, className: "shrink-0", onClick: (e) => { e.stopPropagation(); onToggleSelect(row.id); }, children: _jsx("input", { type: "checkbox", checked: selected, onChange: () => onToggleSelect(row.id), className: "h-4 w-4 rounded border-zinc-300 text-primary accent-primary cursor-pointer", "aria-label": `Select ${row.primary}` }) })), _jsxs(Stack, { gap: "none", className: "flex-1 min-w-0", children: [_jsx(Text, { size: "sm", weight: "semibold", className: "truncate text-zinc-900 dark:text-zinc-100", children: row.primary }), _jsx(Text, { size: "xs", color: "muted", className: "truncate", children: row.secondary })] }), flags.length > 0 && (_jsx(Row, { gap: "xs", className: "hidden sm:flex shrink-0", children: flags.map(({ key, label, color }) => (_jsx(Span, { weight: "medium", className: `inline-flex rounded-full px-1.5 py-0.5 text-[10px] ${color}`, children: label }, key))) })), _jsx(StatusBadge, { status: row.status }), _jsx(Span, { size: "xs", color: "muted", className: "hidden sm:block shrink-0 w-24 text-right", children: row.updatedAt })] }));
31
37
  }
32
38
  return (_jsxs(Div, { rounded: "xl", className: [
33
39
  "border overflow-hidden cursor-pointer transition-all hover:shadow-md hover:-translate-y-0.5",
34
40
  selected
35
41
  ? "border-primary ring-1 ring-primary/20 bg-primary-50/30 dark:bg-primary-900/10"
36
42
  : "border-zinc-100 dark:border-slate-700 bg-white dark:bg-slate-900",
37
- ].filter(Boolean).join(" "), onClick: handleClick, role: onRowClick ? "button" : undefined, children: [onToggleSelect && (_jsxs(Row, { gap: "xs", "data-checkbox": true, className: "px-3 pt-3", onClick: (e) => { e.stopPropagation(); onToggleSelect(row.id); }, children: [_jsx("input", { type: "checkbox", checked: selected, onChange: () => onToggleSelect(row.id), className: "h-4 w-4 rounded border-zinc-300 text-primary accent-primary cursor-pointer", "aria-label": `Select ${row.primary}` }), flags.length > 0 && (_jsx(Row, { gap: "xs", wrap: true, children: flags.map(({ key, label, color }) => (_jsx(Span, { className: `inline-flex rounded-full px-1.5 py-0.5 text-[10px] font-medium ${color}`, children: label }, key))) }))] })), _jsxs(Stack, { gap: "xs", className: "p-3.5", children: [_jsxs(Stack, { gap: "none", children: [_jsx(Text, { size: "sm", weight: "semibold", className: "line-clamp-2 leading-snug text-zinc-900 dark:text-zinc-100", children: row.primary }), _jsx(Text, { size: "xs", color: "muted", className: "truncate", children: row.secondary })] }), _jsxs(Row, { justify: "between", gap: "xs", children: [_jsx(StatusBadge, { status: row.status }), _jsx(Span, { color: "muted", className: "text-[11px] shrink-0", children: row.updatedAt })] })] })] }));
43
+ ].filter(Boolean).join(" "), onClick: handleClick, role: onRowClick ? "button" : undefined, children: [onToggleSelect && (_jsxs(Row, { gap: "xs", "data-checkbox": true, className: "px-3 pt-3", onClick: (e) => { e.stopPropagation(); onToggleSelect(row.id); }, children: [_jsx("input", { type: "checkbox", checked: selected, onChange: () => onToggleSelect(row.id), className: "h-4 w-4 rounded border-zinc-300 text-primary accent-primary cursor-pointer", "aria-label": `Select ${row.primary}` }), flags.length > 0 && (_jsx(Row, { gap: "xs", wrap: true, children: flags.map(({ key, label, color }) => (_jsx(Span, { weight: "medium", className: `inline-flex rounded-full px-1.5 py-0.5 text-[10px] ${color}`, children: label }, key))) }))] })), _jsxs(Stack, { gap: "xs", className: `${__P.p3}.5`, children: [_jsxs(Stack, { gap: "none", children: [_jsx(Text, { size: "sm", weight: "semibold", className: "line-clamp-2 leading-snug text-zinc-900 dark:text-zinc-100", children: row.primary }), _jsx(Text, { size: "xs", color: "muted", className: "truncate", children: row.secondary })] }), _jsxs(Row, { justify: "between", gap: "xs", children: [_jsx(StatusBadge, { status: row.status }), _jsx(Span, { color: "muted", className: "text-[11px] shrink-0", children: row.updatedAt })] })] })] }));
38
44
  }
39
45
  export function AdminViewCards({ rows, view, isLoading, emptyLabel = "No items found", onRowClick, selectedIdSet, onToggleSelect, }) {
40
46
  if (isLoading) {
41
47
  const count = view === "grid" ? 12 : 8;
42
48
  if (view === "list") {
43
- return (_jsx(Div, { rounded: "xl", border: "subtle", className: "overflow-hidden divide-y divide-zinc-100 dark:divide-slate-700", children: Array.from({ length: count }).map((_, i) => _jsx(SkeletonCard, { view: "list" }, i)) }));
49
+ return (_jsx(Div, { rounded: "xl", border: "subtle", className: `${__O.hidden} divide-y divide-zinc-100 dark:divide-slate-700`, children: Array.from({ length: count }).map((_, i) => _jsx(SkeletonCard, { view: "list" }, i)) }));
44
50
  }
45
51
  return (_jsx(Grid, { gap: "md", className: "grid-cols-2 sm:grid-cols-3 lg:grid-cols-4", children: Array.from({ length: count }).map((_, i) => _jsx(SkeletonCard, { view: "grid" }, i)) }));
46
52
  }
@@ -48,7 +54,7 @@ export function AdminViewCards({ rows, view, isLoading, emptyLabel = "No items f
48
54
  return (_jsx(Text, { size: "sm", color: "muted", className: "py-12 text-center", children: emptyLabel }));
49
55
  }
50
56
  if (view === "list") {
51
- return (_jsx(Div, { rounded: "xl", border: "subtle", className: "overflow-hidden divide-y divide-zinc-100 dark:divide-slate-700", children: rows.map((row) => (_jsx(AdminCardItem, { row: row, view: "list", selected: selectedIdSet?.has(row.id) ?? false, onToggleSelect: onToggleSelect, onRowClick: onRowClick }, row.id))) }));
57
+ return (_jsx(Div, { rounded: "xl", border: "subtle", className: `${__O.hidden} divide-y divide-zinc-100 dark:divide-slate-700`, children: rows.map((row) => (_jsx(AdminCardItem, { row: row, view: "list", selected: selectedIdSet?.has(row.id) ?? false, onToggleSelect: onToggleSelect, onRowClick: onRowClick }, row.id))) }));
52
58
  }
53
59
  return (_jsx(Grid, { gap: "md", className: "grid-cols-2 sm:grid-cols-3 lg:grid-cols-4", children: rows.map((row) => (_jsx(AdminCardItem, { row: row, view: "grid", selected: selectedIdSet?.has(row.id) ?? false, onToggleSelect: onToggleSelect, onRowClick: onRowClick }, row.id))) }));
54
60
  }
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import React from "react";
4
4
  import { useMutation } from "@tanstack/react-query";
5
- import { Button, Form, Input, Toggle, useToast } from "../../../ui";
5
+ import { Button, Div, Form, Input, Toggle, useToast } from "../../../ui";
6
6
  import { apiClient } from "../../../http";
7
7
  import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
8
8
  function toBrandSlug(str) {
@@ -32,5 +32,5 @@ export function BrandQuickCreateForm({ onSaved, onCancel }) {
32
32
  return (_jsxs(Form, { onSubmit: (e) => {
33
33
  e.preventDefault();
34
34
  mutation.mutate();
35
- }, className: "space-y-4", children: [_jsx(Input, { label: "Brand name", value: name, onChange: (e) => setName(e.target.value), required: true, placeholder: "e.g. Hot Wheels", autoFocus: true }), _jsx(Input, { label: "Description", value: description, onChange: (e) => setDescription(e.target.value), placeholder: "Optional brief description" }), _jsx(Toggle, { label: "Active", checked: isActive, onChange: setIsActive }), _jsxs("div", { className: "flex gap-3 pt-2", children: [_jsx(Button, { type: "submit", isLoading: mutation.isPending, disabled: !name || mutation.isPending, children: "Create brand" }), _jsx(Button, { type: "button", variant: "ghost", onClick: onCancel, children: "Cancel" })] })] }));
35
+ }, className: "space-y-4", children: [_jsx(Input, { label: "Brand name", value: name, onChange: (e) => setName(e.target.value), required: true, placeholder: "e.g. Hot Wheels", autoFocus: true }), _jsx(Input, { label: "Description", value: description, onChange: (e) => setDescription(e.target.value), placeholder: "Optional brief description" }), _jsx(Toggle, { label: "Active", checked: isActive, onChange: setIsActive }), _jsxs(Div, { className: "flex gap-3 pt-2", children: [_jsx(Button, { type: "submit", isLoading: mutation.isPending, disabled: !name || mutation.isPending, children: "Create brand" }), _jsx(Button, { type: "button", variant: "ghost", onClick: onCancel, children: "Cancel" })] })] }));
36
36
  }
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import React from "react";
4
4
  import { useMutation } from "@tanstack/react-query";
5
- import { Button, Form, Input, Toggle, useToast } from "../../../ui";
5
+ import { Button, Div, Form, Input, Toggle, useToast } from "../../../ui";
6
6
  import { apiClient } from "../../../http";
7
7
  import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
8
8
  function toCategorySlug(str) {
@@ -31,5 +31,5 @@ export function CategoryQuickCreateForm({ onSaved, onCancel }) {
31
31
  return (_jsxs(Form, { onSubmit: (e) => {
32
32
  e.preventDefault();
33
33
  mutation.mutate();
34
- }, className: "space-y-4", children: [_jsx(Input, { label: "Category name", value: name, onChange: (e) => setName(e.target.value), required: true, placeholder: "e.g. Trading Cards", autoFocus: true }), _jsx(Input, { label: "Description", value: description, onChange: (e) => setDescription(e.target.value), placeholder: "Optional brief description" }), _jsx(Toggle, { label: "Active", checked: isActive, onChange: setIsActive }), _jsxs("div", { className: "flex gap-3 pt-2", children: [_jsx(Button, { type: "submit", isLoading: mutation.isPending, disabled: !name || mutation.isPending, children: "Create category" }), _jsx(Button, { type: "button", variant: "ghost", onClick: onCancel, children: "Cancel" })] })] }));
34
+ }, className: "space-y-4", children: [_jsx(Input, { label: "Category name", value: name, onChange: (e) => setName(e.target.value), required: true, placeholder: "e.g. Trading Cards", autoFocus: true }), _jsx(Input, { label: "Description", value: description, onChange: (e) => setDescription(e.target.value), placeholder: "Optional brief description" }), _jsx(Toggle, { label: "Active", checked: isActive, onChange: setIsActive }), _jsxs(Div, { className: "flex gap-3 pt-2", children: [_jsx(Button, { type: "submit", isLoading: mutation.isPending, disabled: !name || mutation.isPending, children: "Create category" }), _jsx(Button, { type: "button", variant: "ghost", onClick: onCancel, children: "Cancel" })] })] }));
35
35
  }
@@ -1,18 +1,24 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { TrendingUp, ShoppingBag, Users, Package, Clock, Star } from "lucide-react";
4
- import { Grid, Text } from "../../../ui";
4
+ import { Div, Grid, Text } from "../../../ui";
5
5
  import { formatCurrency } from "../../../utils/number.formatter";
6
6
  import { getDefaultCurrency } from "../../../core/baseline-resolver";
7
+ const __P = {
8
+ p5: "p-5",
9
+ };
10
+ const __O = {
11
+ hidden: "overflow-hidden",
12
+ };
7
13
  // Brand gradient stop colors (mirrors SiteLogo wordmark gradient)
8
14
  const BRAND_FROM = "var(--appkit-color-primary-700, #1343de)";
9
15
  const BRAND_MID = "var(--appkit-color-cobalt, #3570fc)";
10
16
  const BRAND_TO = "var(--appkit-color-secondary-400, #84e122)";
11
17
  function StatCard({ label, value, sub, icon: Icon, gradient, iconColor }) {
12
- return (_jsxs("div", { className: "relative rounded-xl border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)] overflow-hidden shadow-sm hover:shadow-md transition-shadow", children: [_jsx("div", { className: "absolute top-0 left-0 right-0 h-[3px]", style: { background: gradient }, "aria-hidden": "true" }), _jsxs("div", { className: "px-5 pb-5 pt-6 flex items-start justify-between gap-3", children: [_jsxs("div", { className: "min-w-0 flex-1 overflow-hidden", children: [_jsx(Text, { className: "text-[11px] font-semibold uppercase tracking-widest text-[var(--appkit-color-text-muted)] truncate", children: label }), _jsx(Text, { className: "mt-2 text-xl font-bold text-[var(--appkit-color-text)] tabular-nums leading-tight break-words", children: value }), sub && (_jsx(Text, { className: "mt-1.5 text-xs text-[var(--appkit-color-text-muted)]", children: sub }))] }), _jsx("div", { className: "flex-shrink-0 w-10 h-10 rounded-lg flex items-center justify-center", style: { background: gradient, opacity: 0.92 }, children: _jsx(Icon, { className: "w-5 h-5 text-white drop-shadow-sm" }) })] })] }));
18
+ return (_jsxs(Div, { className: `relative rounded-xl border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)] ${__O.hidden} shadow-sm hover:shadow-md transition-shadow`, children: [_jsx(Div, { className: "absolute top-0 left-0 right-0 h-[3px]", style: { background: gradient }, "aria-hidden": "true" }), _jsxs(Div, { className: "px-5 pb-5 pt-6 flex items-start justify-between gap-3", children: [_jsxs(Div, { className: `min-w-0 flex-1 ${__O.hidden}`, children: [_jsx(Text, { className: "text-[11px] font-semibold uppercase tracking-widest text-[var(--appkit-color-text-muted)] truncate", children: label }), _jsx(Text, { className: "mt-2 text-xl font-bold text-[var(--appkit-color-text)] tabular-nums leading-tight break-words", children: value }), sub && (_jsx(Text, { className: "mt-1.5 text-xs text-[var(--appkit-color-text-muted)]", children: sub }))] }), _jsx(Div, { className: "flex-shrink-0 w-10 h-10 rounded-lg flex items-center justify-center", style: { background: gradient, opacity: 0.92 }, children: _jsx(Icon, { className: "w-5 h-5 text-white drop-shadow-sm" }) })] })] }));
13
19
  }
14
20
  function SkeletonCard() {
15
- return (_jsxs("div", { className: "relative rounded-xl border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)] overflow-hidden p-5 animate-pulse", children: [_jsx("div", { className: "absolute top-0 left-0 right-0 h-[3px] bg-[var(--appkit-color-border)]" }), _jsxs("div", { className: "flex items-start justify-between gap-3 pt-1", children: [_jsxs("div", { className: "flex-1 space-y-2", children: [_jsx("div", { className: "h-2.5 w-20 rounded bg-[var(--appkit-color-border)]" }), _jsx("div", { className: "h-7 w-24 rounded bg-[var(--appkit-color-border)]" })] }), _jsx("div", { className: "w-10 h-10 rounded-lg bg-[var(--appkit-color-border)]" })] })] }));
21
+ return (_jsxs(Div, { className: `relative rounded-xl border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)] ${__O.hidden} ${__P.p5} animate-pulse`, children: [_jsx(Div, { className: "absolute top-0 left-0 right-0 h-[3px] bg-[var(--appkit-color-border)]" }), _jsxs(Div, { className: "flex items-start justify-between gap-3 pt-1", children: [_jsxs(Div, { className: "flex-1 space-y-2", children: [_jsx(Div, { className: "h-2.5 w-20 rounded bg-[var(--appkit-color-border)]" }), _jsx(Div, { className: "h-7 w-24 rounded bg-[var(--appkit-color-border)]" })] }), _jsx(Div, { className: "w-10 h-10 rounded-lg bg-[var(--appkit-color-border)]" })] })] }));
16
22
  }
17
23
  export function DashboardStatsGrid({ stats, isLoading, labels = {}, }) {
18
24
  if (isLoading) {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { Plus } from "lucide-react";
4
- import { BulkActionBar, Button, ListingFilterDrawer, ListingToolbar, Pagination, SideDrawer, } from "../../../ui";
4
+ import { BulkActionBar, Button, Div, ListingFilterDrawer, ListingToolbar, Pagination, SideDrawer, } from "../../../ui";
5
5
  import { useBottomActions } from "../../layout";
6
6
  import { useAdminListing } from "../hooks/useAdminListing";
7
7
  import { AdminViewCards } from "./AdminViewCards";
@@ -42,9 +42,9 @@ export function DataListingView({ config, }) {
42
42
  ? `Add ${config.title.replace(/s$/, "")}`
43
43
  : `Edit ${config.title.replace(/s$/, "")}`;
44
44
  const isEditorOpen = panel.isCreateOpen || panel.isEditOpen;
45
- return (_jsxs("div", { className: config.className ?? "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: config.searchPlaceholder, onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || config.defaultSort, sortOptions: config.sortOptions, onSortChange: (v) => table.set("sort", v), showTableView: !config.hideTableView, toggles: config.toggles, view: view, onViewChange: (v) => setView(v), onResetAll: resetAll, hasActiveState: hasActiveState, extra: config.primaryAction || config.toolbarExtra ? (_jsxs("div", { className: "flex items-center gap-2", children: [config.toolbarExtra, config.primaryAction && (_jsxs(Button, { size: "sm", onClick: () => config.primaryAction.onClick({
45
+ return (_jsxs(Div, { className: config.className ?? "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: config.searchPlaceholder, onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || config.defaultSort, sortOptions: config.sortOptions, onSortChange: (v) => table.set("sort", v), showTableView: !config.hideTableView, toggles: config.toggles, view: view, onViewChange: (v) => setView(v), onResetAll: resetAll, hasActiveState: hasActiveState, extra: config.primaryAction || config.toolbarExtra ? (_jsxs(Div, { className: "flex items-center gap-2", children: [config.toolbarExtra, config.primaryAction && (_jsxs(Button, { size: "sm", onClick: () => config.primaryAction.onClick({
46
46
  openCreatePanel: panel.openCreatePanel,
47
- }), className: "flex items-center gap-1.5", children: [config.primaryAction.icon ?? _jsx(Plus, { className: "h-4 w-4" }), config.primaryAction.label] }))] })) : undefined }), config.renderAboveContent?.(), bulkActionItems && (_jsx(BulkActionBar, { selectedCount: selection.selectedCount, onClearSelection: selection.clearSelection, actions: bulkActionItems })), totalPages > 1 && (_jsx("div", { className: "sticky top-[calc(var(--header-height,0px)+44px)] z-10 flex justify-center bg-white/95 dark:bg-slate-900/95 backdrop-blur-sm border-b border-zinc-200 dark:border-slate-700 px-3 py-1.5", children: _jsx(Pagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: (p) => table.setPage(p) }) })), _jsxs("div", { className: "py-4 px-3 sm:px-4", children: [errorMessage && (_jsx("div", { className: "mb-4 rounded-xl border border-error/20 bg-error-surface px-4 py-3 text-sm text-error", children: errorMessage })), view === "table" ? (_jsx(DataTable, { columns: config.columns, rows: rows, isLoading: isLoading, emptyLabel: config.emptyLabel ?? `No ${config.title.toLowerCase()} found`, selectedIds: selection.selectedIdSet, onToggleSelect: selection.toggle, onToggleSelectAll: (next) => next
47
+ }), className: "flex items-center gap-1.5", children: [config.primaryAction.icon ?? _jsx(Plus, { className: "h-4 w-4" }), config.primaryAction.label] }))] })) : undefined }), config.renderAboveContent?.(), bulkActionItems && (_jsx(BulkActionBar, { selectedCount: selection.selectedCount, onClearSelection: selection.clearSelection, actions: bulkActionItems })), totalPages > 1 && (_jsx(Div, { className: "sticky top-[calc(var(--header-height,0px)+44px)] z-10 flex justify-center bg-white/95 dark:bg-slate-900/95 backdrop-blur-sm border-b border-zinc-200 dark:border-slate-700 px-3 py-1.5", children: _jsx(Pagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: (p) => table.setPage(p) }) })), _jsxs(Div, { className: "py-4 px-3 sm:px-4", children: [errorMessage && (_jsx(Div, { className: "mb-4 rounded-xl border border-error/20 bg-error-surface px-4 py-3 text-sm text-error", children: errorMessage })), view === "table" ? (_jsx(DataTable, { columns: config.columns, rows: rows, isLoading: isLoading, emptyLabel: config.emptyLabel ?? `No ${config.title.toLowerCase()} found`, selectedIds: selection.selectedIdSet, onToggleSelect: selection.toggle, onToggleSelectAll: (next) => next
48
48
  ? selection.setSelectedIds(rows.map((r) => r.id))
49
49
  : selection.clearSelection(), getRowHref: config.getRowHref, onRowClick: config.onRowClick
50
50
  ? (row) => config.onRowClick(row, {
@@ -1,24 +1,28 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { BaseListingCard, Button, Div, Span, Text } from "../../../ui";
3
+ import { BaseListingCard, Button, Div, Span, Table, Thead, Tbody, Tr, Th, Td, Text } from "../../../ui";
4
4
  import { useLongPress } from "../../../react/hooks/useLongPress";
5
+ const __O = {
6
+ hidden: "overflow-hidden",
7
+ xAuto: "overflow-x-auto",
8
+ };
5
9
  const DEFAULT_COLUMNS = [
6
10
  {
7
11
  key: "primary",
8
12
  header: "Name",
9
- render: (row) => (_jsxs("div", { className: "space-y-0.5", children: [_jsx(Text, { className: "font-medium text-zinc-900 dark:text-zinc-100", children: String(row.primary ?? "") }), row.secondary ? _jsx(Text, { className: "text-xs text-zinc-500 dark:text-zinc-400", children: String(row.secondary) }) : null] })),
13
+ render: (row) => (_jsxs(Div, { className: "space-y-0.5", children: [_jsx(Text, { className: "font-medium text-zinc-900 dark:text-zinc-100", children: String(row.primary ?? "") }), row.secondary ? _jsx(Text, { className: "text-xs text-zinc-500 dark:text-zinc-400", children: String(row.secondary) }) : null] })),
10
14
  },
11
15
  {
12
16
  key: "status",
13
17
  header: "Status",
14
18
  className: "w-32",
15
- render: (row) => (_jsx("span", { className: "inline-flex rounded-full bg-primary-50 px-2.5 py-1 text-xs font-medium text-primary-800 dark:bg-secondary-900/30 dark:text-secondary-300", children: String(row.status ?? "—") })),
19
+ render: (row) => (_jsx(Span, { size: "xs", weight: "medium", className: "inline-flex rounded-full bg-primary-50 px-2.5 py-1 text-primary-800 dark:bg-secondary-900/30 dark:text-secondary-300", children: String(row.status ?? "—") })),
16
20
  },
17
21
  {
18
22
  key: "updatedAt",
19
23
  header: "Updated",
20
24
  className: "w-32",
21
- render: (row) => _jsx("span", { className: "text-sm text-zinc-500 dark:text-zinc-400", children: String(row.updatedAt ?? "") }),
25
+ render: (row) => _jsx(Span, { size: "sm", className: "text-zinc-500 dark:text-zinc-400", children: String(row.updatedAt ?? "") }),
22
26
  },
23
27
  ];
24
28
  function SelectableRow({ row, columns, isSelected, onToggle, renderRowActions, onRowClick, rowHref, selectionEnabled, }) {
@@ -35,13 +39,13 @@ function SelectableRow({ row, columns, isSelected, onToggle, renderRowActions, o
35
39
  }
36
40
  : undefined;
37
41
  const isInteractive = Boolean(onRowClick ?? rowHref);
38
- return (_jsxs("tr", { "data-testid": "data-table-row", onClick: handleClick, onKeyDown: handleKeyDown, role: isInteractive ? "link" : undefined, tabIndex: isInteractive ? 0 : undefined, onMouseDown: selectionEnabled && !isSelected ? longPress.onMouseDown : undefined, onMouseUp: selectionEnabled && !isSelected ? longPress.onMouseUp : undefined, onMouseLeave: selectionEnabled && !isSelected ? longPress.onMouseLeave : undefined, onTouchStart: selectionEnabled && !isSelected ? longPress.onTouchStart : undefined, onTouchEnd: selectionEnabled && !isSelected ? longPress.onTouchEnd : undefined, className: `border-b border-neutral-100 dark:border-slate-700 hover:bg-neutral-50 dark:hover:bg-slate-800 ${isInteractive ? "cursor-pointer" : ""} ${isSelected ? "bg-primary/5 dark:bg-primary/10" : ""}`, children: [selectionEnabled && (_jsx("td", { className: "relative w-10 px-2 py-3", onClick: (e) => e.stopPropagation(), children: _jsx(BaseListingCard.Checkbox, { selected: isSelected, onSelect: (e) => { e.preventDefault(); onToggle?.(row.id, !isSelected); }, label: isSelected ? "Deselect row" : "Select row", position: "top-1/2 left-2 -translate-y-1/2", "data-testid": "row-checkbox" }) })), columns.map((col) => (_jsx("td", { className: `px-4 py-3 text-neutral-700 dark:text-zinc-300 ${col.className ?? ""}`, children: col.render
42
+ return (_jsxs(Tr, { "data-testid": "data-table-row", onClick: handleClick, onKeyDown: handleKeyDown, role: isInteractive ? "link" : undefined, tabIndex: isInteractive ? 0 : undefined, onMouseDown: selectionEnabled && !isSelected ? longPress.onMouseDown : undefined, onMouseUp: selectionEnabled && !isSelected ? longPress.onMouseUp : undefined, onMouseLeave: selectionEnabled && !isSelected ? longPress.onMouseLeave : undefined, onTouchStart: selectionEnabled && !isSelected ? longPress.onTouchStart : undefined, onTouchEnd: selectionEnabled && !isSelected ? longPress.onTouchEnd : undefined, className: `border-b border-neutral-100 dark:border-slate-700 hover:bg-neutral-50 dark:hover:bg-slate-800 ${isInteractive ? "cursor-pointer" : ""} ${isSelected ? "bg-primary/5 dark:bg-primary/10" : ""}`, children: [selectionEnabled && (_jsx(Td, { className: "relative w-10 px-2 py-3", onClick: (e) => e.stopPropagation(), children: _jsx(BaseListingCard.Checkbox, { selected: isSelected, onSelect: (e) => { e.preventDefault(); onToggle?.(row.id, !isSelected); }, label: isSelected ? "Deselect row" : "Select row", position: "top-1/2 left-2 -translate-y-1/2", "data-testid": "row-checkbox" }) })), columns.map((col) => (_jsx(Td, { className: `px-4 py-3 text-neutral-700 dark:text-zinc-300 ${col.className ?? ""}`, children: col.render
39
43
  ? col.render(row)
40
- : String(row[col.key] ?? "") }, col.key))), renderRowActions && (_jsx("td", { className: "px-2 py-3", onClick: (e) => e.stopPropagation(), children: renderRowActions(row) }))] }));
44
+ : String(row[col.key] ?? "") }, col.key))), renderRowActions && (_jsx(Td, { className: "px-2 py-3", onClick: (e) => e.stopPropagation(), children: renderRowActions(row) }))] }));
41
45
  }
42
46
  export function DataTable({ columns: columnsProp, rows, isLoading, sortKey, sortDir, onSort, totalPages = 1, currentPage = 1, onPageChange, emptyLabel = "No records found", getRowHref, onRowClick, renderRowActions, selectedIds, onToggleSelect, onToggleSelectAll, }) {
43
47
  const columns = (columnsProp ?? DEFAULT_COLUMNS);
44
48
  const selectionEnabled = Boolean(onToggleSelect);
45
49
  const allRowsSelected = selectionEnabled && rows.length > 0 && rows.every((r) => selectedIds?.has(r.id));
46
- return (_jsxs(Div, { surface: "card", className: "overflow-hidden", children: [_jsx(Div, { className: "overflow-x-auto", children: _jsxs("table", { "data-testid": "data-table", className: "w-full text-sm", children: [_jsx("thead", { children: _jsxs("tr", { className: "border-b border-neutral-200 dark:border-slate-700 bg-neutral-50 dark:bg-slate-800", children: [selectionEnabled && (_jsx("th", { scope: "col", className: "w-10 px-2 py-3", children: onToggleSelectAll && (_jsx("input", { type: "checkbox", "data-testid": "select-all-checkbox", "aria-label": allRowsSelected ? "Deselect all" : "Select all", checked: allRowsSelected, onChange: () => onToggleSelectAll(!allRowsSelected), className: "h-4 w-4 rounded border-zinc-300 dark:border-slate-600 accent-zinc-900 dark:accent-zinc-100" })) })), columns.map((col) => (_jsxs("th", { scope: "col", onClick: col.sortable && onSort ? () => onSort(col.key) : undefined, className: `px-4 py-3 text-left font-semibold text-neutral-900 dark:text-zinc-100 ${col.sortable && onSort ? "cursor-pointer select-none hover:text-primary" : ""} ${col.className ?? ""}`, children: [col.header, col.sortable && sortKey === col.key && (_jsx(Span, { className: "ml-1", children: sortDir === "asc" ? "↑" : "↓" }))] }, col.key))), renderRowActions && _jsx("th", { scope: "col", className: "w-12 px-2 py-3" })] }) }), _jsx("tbody", { children: isLoading ? (Array.from({ length: 5 }).map((_, i) => (_jsxs("tr", { className: "border-b border-neutral-100 dark:border-slate-700", children: [selectionEnabled && _jsx("td", { className: "w-10 px-2 py-3" }), columns.map((col) => (_jsx("td", { className: "px-4 py-3", children: _jsx(Div, { className: "h-4 w-full animate-pulse rounded bg-neutral-200 dark:bg-slate-700" }) }, col.key)))] }, i)))) : rows.length === 0 ? (_jsx("tr", { children: _jsx("td", { colSpan: columns.length + (selectionEnabled ? 1 : 0) + (renderRowActions ? 1 : 0), className: "px-4 py-12 text-center text-neutral-500 dark:text-zinc-400", children: emptyLabel }) })) : (rows.map((row) => (_jsx(SelectableRow, { row: row, columns: columns, isSelected: selectedIds?.has(row.id) ?? false, onToggle: onToggleSelect, renderRowActions: renderRowActions, onRowClick: onRowClick, rowHref: getRowHref?.(row), selectionEnabled: selectionEnabled }, row.id)))) })] }) }), totalPages > 1 && onPageChange && (_jsx(Div, { className: "flex items-center justify-end gap-2 border-t border-neutral-200 dark:border-slate-700 px-4 py-3", children: Array.from({ length: totalPages }, (_, i) => i + 1).map((p) => (_jsx(Button, { onClick: () => onPageChange(p), variant: p === currentPage ? "primary" : "ghost", size: "sm", className: `h-8 w-8 rounded text-xs font-medium transition ${p === currentPage ? "bg-neutral-900 text-white" : "text-neutral-600 dark:text-zinc-300 hover:bg-neutral-100 dark:hover:bg-slate-800"}`, children: p }, p))) }))] }));
50
+ return (_jsxs(Div, { surface: "card", className: `${__O.hidden}`, children: [_jsx(Div, { className: `${__O.xAuto}`, children: _jsxs(Table, { "data-testid": "data-table", className: "w-full text-sm", children: [_jsx(Thead, { children: _jsxs(Tr, { className: "border-b border-neutral-200 dark:border-slate-700 bg-neutral-50 dark:bg-slate-800", children: [selectionEnabled && (_jsx(Th, { scope: "col", className: "w-10 px-2 py-3", children: onToggleSelectAll && (_jsx("input", { type: "checkbox", "data-testid": "select-all-checkbox", "aria-label": allRowsSelected ? "Deselect all" : "Select all", checked: allRowsSelected, onChange: () => onToggleSelectAll(!allRowsSelected), className: "h-4 w-4 rounded border-zinc-300 dark:border-slate-600 accent-zinc-900 dark:accent-zinc-100" })) })), columns.map((col) => (_jsxs(Th, { scope: "col", onClick: col.sortable && onSort ? () => onSort(col.key) : undefined, className: `px-4 py-3 text-left font-semibold text-neutral-900 dark:text-zinc-100 ${col.sortable && onSort ? "cursor-pointer select-none hover:text-primary" : ""} ${col.className ?? ""}`, children: [col.header, col.sortable && sortKey === col.key && (_jsx(Span, { className: "ml-1", children: sortDir === "asc" ? "↑" : "↓" }))] }, col.key))), renderRowActions && _jsx(Th, { scope: "col", className: "w-12 px-2 py-3" })] }) }), _jsx(Tbody, { children: isLoading ? (Array.from({ length: 5 }).map((_, i) => (_jsxs(Tr, { className: "border-b border-neutral-100 dark:border-slate-700", children: [selectionEnabled && _jsx(Td, { className: "w-10 px-2 py-3" }), columns.map((col) => (_jsx(Td, { className: "px-4 py-3", children: _jsx(Div, { className: "h-4 w-full animate-pulse rounded bg-neutral-200 dark:bg-slate-700" }) }, col.key)))] }, i)))) : rows.length === 0 ? (_jsx(Tr, { children: _jsx(Td, { colSpan: columns.length + (selectionEnabled ? 1 : 0) + (renderRowActions ? 1 : 0), className: "px-4 py-12 text-center text-neutral-500 dark:text-zinc-400", children: emptyLabel }) })) : (rows.map((row) => (_jsx(SelectableRow, { row: row, columns: columns, isSelected: selectedIds?.has(row.id) ?? false, onToggle: onToggleSelect, renderRowActions: renderRowActions, onRowClick: onRowClick, rowHref: getRowHref?.(row), selectionEnabled: selectionEnabled }, row.id)))) })] }) }), totalPages > 1 && onPageChange && (_jsx(Div, { className: "flex items-center justify-end gap-2 border-t border-neutral-200 dark:border-slate-700 px-4 py-3", children: Array.from({ length: totalPages }, (_, i) => i + 1).map((p) => (_jsx(Button, { onClick: () => onPageChange(p), variant: p === currentPage ? "primary" : "ghost", size: "sm", className: `h-8 w-8 rounded text-xs font-medium transition ${p === currentPage ? "bg-neutral-900 text-white" : "text-neutral-600 dark:text-zinc-300 hover:bg-neutral-100 dark:hover:bg-slate-800"}`, children: p }, p))) }))] }));
47
51
  }
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button } from "@mohasinac/appkit/ui";
2
+ import { Button, Div } from "@mohasinac/appkit/ui";
3
3
  import { FORM_ACTION_META, FORM_ACTION_ID } from "../../products/constants/action-defs";
4
4
  const DEFAULT_LABELS = {
5
5
  submit: FORM_ACTION_META[FORM_ACTION_ID.SUBMIT].label,
@@ -9,5 +9,5 @@ const DEFAULT_LABELS = {
9
9
  };
10
10
  export function DrawerFormFooter({ onCancel, onSubmit, onDelete, isLoading = false, isSubmitDisabled = false, className = "", labels, variant = "footer", themeConfig = { borderClass: "border-t border-zinc-200 dark:border-zinc-700" }, }) {
11
11
  const l = { ...DEFAULT_LABELS, ...labels };
12
- return (_jsxs("div", { className: `flex items-center gap-3${variant === "inline" ? ` pt-4 ${themeConfig.borderClass}` : ""} ${className}`, children: [onDelete && (_jsx(Button, { variant: FORM_ACTION_META[FORM_ACTION_ID.DELETE].variant, onClick: onDelete, disabled: isLoading, size: "md", children: l.delete })), _jsxs("div", { className: `flex items-center gap-3${!onDelete ? " ml-auto" : ""}`, children: [_jsx(Button, { variant: FORM_ACTION_META[FORM_ACTION_ID.CANCEL].variant, onClick: onCancel, disabled: isLoading, size: "md", children: l.cancel }), _jsx(Button, { variant: FORM_ACTION_META[FORM_ACTION_ID.SUBMIT].variant, onClick: onSubmit, disabled: isLoading || isSubmitDisabled, size: "md", children: isLoading ? l.saving : l.submit })] })] }));
12
+ return (_jsxs("div", { className: `flex items-center gap-3${variant === "inline" ? ` pt-4 ${themeConfig.borderClass}` : ""} ${className}`, children: [onDelete && (_jsx(Button, { variant: FORM_ACTION_META[FORM_ACTION_ID.DELETE].variant, onClick: onDelete, disabled: isLoading, size: "md", children: l.delete })), _jsxs(Div, { className: `flex items-center gap-3${!onDelete ? " ml-auto" : ""}`, children: [_jsx(Button, { variant: FORM_ACTION_META[FORM_ACTION_ID.CANCEL].variant, onClick: onCancel, disabled: isLoading, size: "md", children: l.cancel }), _jsx(Button, { variant: FORM_ACTION_META[FORM_ACTION_ID.SUBMIT].variant, onClick: onSubmit, disabled: isLoading || isSubmitDisabled, size: "md", children: isLoading ? l.saving : l.submit })] })] }));
13
13
  }
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
3
3
  import { useRef, useState } from "react";
4
4
  import { MoreHorizontal } from "lucide-react";
5
5
  import { Button } from "../../../ui/components/Button";
6
+ import { Div } from "../../../ui";
6
7
  import { useClickOutside, useKeyPress } from "../../../react";
7
8
  import { QuickFormDrawer } from "../../shell/QuickFormDrawer";
8
9
  export function QuickEditMenu({ actions, align = "right" }) {
@@ -24,7 +25,7 @@ export function QuickEditMenu({ actions, align = "right" }) {
24
25
  }
25
26
  };
26
27
  const activeAction = activeFormIndex !== null ? actions[activeFormIndex] : null;
27
- return (_jsxs(_Fragment, { children: [_jsxs("div", { ref: menuRef, className: "appkit-row-action-menu", onClick: (e) => e.stopPropagation(), children: [_jsx(Button, { type: "button", variant: "ghost", "aria-label": "Row actions", "aria-haspopup": "menu", "aria-expanded": menuOpen, onClick: () => setMenuOpen((v) => !v), className: "appkit-row-action-menu__trigger", children: _jsx(MoreHorizontal, { className: "h-4 w-4", strokeWidth: 1.5 }) }), menuOpen && (_jsx("div", { role: "menu", className: `appkit-row-action-menu__dropdown ${align === "right" ? "appkit-row-action-menu__dropdown--right" : "appkit-row-action-menu__dropdown--left"}`, children: actions.map((action, idx) => (_jsxs("div", { children: [action.separator && idx > 0 && (_jsx("div", { className: "appkit-row-action-menu__separator" })), _jsxs(Button, { type: "button", role: "menuitem", variant: "ghost", disabled: action.disabled, onClick: () => handleActionClick(idx), className: `appkit-row-action-menu__item ${action.destructive ? "appkit-row-action-menu__item--destructive" : ""} ${action.disabled ? "opacity-40 cursor-not-allowed" : ""}`, children: [action.icon && (_jsx("span", { className: "appkit-row-action-menu__icon", children: action.icon })), action.label] })] }, `${action.label}-${idx}`))) }))] }), activeAction?.fields && (_jsx(QuickFormDrawer, { isOpen: activeFormIndex !== null, onClose: () => setActiveFormIndex(null), title: activeAction.formTitle ?? activeAction.label, fields: activeAction.fields, defaultValues: activeAction.defaultValues, onSubmit: async (vals) => {
28
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { ref: menuRef, className: "appkit-row-action-menu", onClick: (e) => e.stopPropagation(), children: [_jsx(Button, { type: "button", variant: "ghost", "aria-label": "Row actions", "aria-haspopup": "menu", "aria-expanded": menuOpen, onClick: () => setMenuOpen((v) => !v), className: "appkit-row-action-menu__trigger", children: _jsx(MoreHorizontal, { className: "h-4 w-4", strokeWidth: 1.5 }) }), menuOpen && (_jsx("div", { role: "menu", className: `appkit-row-action-menu__dropdown ${align === "right" ? "appkit-row-action-menu__dropdown--right" : "appkit-row-action-menu__dropdown--left"}`, children: actions.map((action, idx) => (_jsxs(Div, { children: [action.separator && idx > 0 && (_jsx(Div, { className: "appkit-row-action-menu__separator" })), _jsxs(Button, { type: "button", role: "menuitem", variant: "ghost", disabled: action.disabled, onClick: () => handleActionClick(idx), className: `appkit-row-action-menu__item ${action.destructive ? "appkit-row-action-menu__item--destructive" : ""} ${action.disabled ? "opacity-40 cursor-not-allowed" : ""}`, children: [action.icon && (_jsx("span", { className: "appkit-row-action-menu__icon", children: action.icon })), action.label] })] }, `${action.label}-${idx}`))) }))] }), activeAction?.fields && (_jsx(QuickFormDrawer, { isOpen: activeFormIndex !== null, onClose: () => setActiveFormIndex(null), title: activeAction.formTitle ?? activeAction.label, fields: activeAction.fields, defaultValues: activeAction.defaultValues, onSubmit: async (vals) => {
28
29
  await activeAction.onSubmit?.(vals);
29
30
  setActiveFormIndex(null);
30
31
  }, submitLabel: activeAction.submitLabel ?? "Save" }))] }));
@@ -2,6 +2,10 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import dynamic from "next/dynamic";
4
4
  import { Div, Heading } from "../../../../ui";
5
+ const __P = {
6
+ p4: "p-4",
7
+ p6: "p-6",
8
+ };
5
9
  // recharts exports generic components (<DataPointType>) that don't satisfy
6
10
  // next/dynamic's ComponentType<P> constraint — cast each to ComponentType<any>.
7
11
  const ResponsiveContainer = dynamic(() => import("recharts").then((m) => m.ResponsiveContainer), { ssr: false });
@@ -17,7 +21,7 @@ const Tooltip = dynamic(() => import("recharts").then((m) => m.Tooltip), { ssr:
17
21
  function ChartCard({ title, children, className = "", }) {
18
22
  return (_jsxs(Div, { className: `relative rounded-xl border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)] overflow-hidden shadow-sm ${className}`, children: [_jsx("div", { className: "absolute top-0 left-0 right-0 h-[3px]", style: {
19
23
  background: "linear-gradient(to right, var(--appkit-color-primary-700,#1343de) 0%, var(--appkit-color-cobalt,#3570fc) 55%, var(--appkit-color-secondary-400,#84e122) 100%)",
20
- }, "aria-hidden": "true" }), _jsxs(Div, { className: "p-4 sm:p-6 pt-5 sm:pt-7", children: [title && (_jsx(Heading, { level: 3, className: "text-sm font-semibold text-[var(--appkit-color-text)] mb-4", children: title })), children] })] }));
24
+ }, "aria-hidden": "true" }), _jsxs(Div, { className: `${__P.p4} sm:${__P.p6} pt-5 sm:pt-7`, children: [title && (_jsx(Heading, { level: 3, className: "text-sm font-semibold text-[var(--appkit-color-text)] mb-4", children: title })), children] })] }));
21
25
  }
22
26
  export function AdminRevenueChart({ data, labels = {}, className = "", }) {
23
27
  return (_jsx(ChartCard, { title: labels.title, className: className, children: _jsx(ResponsiveContainer, { width: "100%", height: 280, children: _jsxs(AreaChart, { data: data, margin: { top: 4, right: 4, left: 0, bottom: 0 }, children: [_jsxs("defs", { children: [_jsxs("linearGradient", { id: "revenueGrad", x1: "0", y1: "0", x2: "1", y2: "0", children: [_jsx("stop", { offset: "0%", stopColor: "#1343de" }), _jsx("stop", { offset: "55%", stopColor: "#3570fc" }), _jsx("stop", { offset: "100%", stopColor: "#84e122" })] }), _jsxs("linearGradient", { id: "revenueAreaGrad", x1: "0", y1: "0", x2: "0", y2: "1", children: [_jsx("stop", { offset: "5%", stopColor: "#3570fc", stopOpacity: 0.25 }), _jsx("stop", { offset: "95%", stopColor: "#3570fc", stopOpacity: 0 })] })] }), _jsx(CartesianGrid, { strokeDasharray: "4 4", stroke: "var(--appkit-color-border)", vertical: false }), _jsx(XAxis, { dataKey: "month", tick: { fontSize: 11, fill: "var(--appkit-color-text-muted)" }, axisLine: false, tickLine: false }), _jsx(YAxis, { tick: { fontSize: 11, fill: "var(--appkit-color-text-muted)" }, axisLine: false, tickLine: false, width: 48 }), _jsx(Tooltip, { contentStyle: {
@@ -3,7 +3,7 @@ export declare function useDashboardStats(opts?: {
3
3
  initialData?: DashboardStats;
4
4
  enabled?: boolean;
5
5
  }): {
6
- stats: DashboardStats | undefined;
6
+ stats: NoInfer<DashboardStats> | undefined;
7
7
  isLoading: boolean;
8
8
  error: Error | null;
9
9
  };
@@ -23,6 +23,6 @@ export declare function useAdminSectionsListing({ page, pageSize, sorts, filters
23
23
  hasMore: boolean;
24
24
  isLoading: boolean;
25
25
  errorMessage: string | undefined;
26
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<AdminSectionsListingResponse, ApiClientError>>;
26
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<AdminSectionsListingResponse>, ApiClientError>>;
27
27
  };
28
28
  export {};
@@ -16,7 +16,7 @@ export interface UseChatReturn {
16
16
  export declare function useChat(chatId: string | null, options?: {
17
17
  realtimeProvider?: IClientRealtimeProvider;
18
18
  }): UseChatReturn;
19
- export declare function useChatRooms(): import("@tanstack/react-query").UseQueryResult<unknown[], Error>;
19
+ export declare function useChatRooms(): import("@tanstack/react-query").UseQueryResult<NoInfer<unknown[]>, Error>;
20
20
  export declare function useCreateChatRoom(): import("@tanstack/react-query").UseMutationResult<unknown, Error, {
21
21
  orderId: string;
22
22
  ownerId: string;
@@ -3,6 +3,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useMemo, useState } from "react";
4
4
  import { ChevronRight } from "lucide-react";
5
5
  import { Div, Row, Text, Badge } from "../../../ui";
6
+ const __O = {
7
+ hidden: "overflow-hidden",
8
+ };
6
9
  function paise(amount) {
7
10
  return new Intl.NumberFormat("en-IN", {
8
11
  style: "currency",
@@ -51,7 +54,7 @@ function AuctionRow({ auction, portal, }) {
51
54
  const sorted = useMemo(() => [...auction.bids].sort((a, b) => b.bidAmount - a.bidAmount), [auction.bids]);
52
55
  const highest = sorted[0]?.bidAmount ?? 0;
53
56
  const isWinning = auction.bids.some((b) => b.isWinning);
54
- return (_jsxs(Div, { className: "border border-[var(--appkit-color-border)] rounded-xl overflow-hidden bg-[var(--appkit-color-surface)] shadow-sm", children: [_jsxs("button", { type: "button", onClick: () => setExpanded((v) => !v), className: "w-full flex items-center gap-3 px-4 py-3 hover:bg-[var(--appkit-color-border-subtle)] transition-colors text-left", "aria-expanded": expanded, children: [_jsx(ChevronRight, { className: `shrink-0 text-[var(--appkit-color-text-muted)] transition-transform ${expanded ? "rotate-90" : ""}`, size: 16 }), _jsx(Div, { className: "flex-1 min-w-0", children: _jsx(Text, { className: "text-sm font-semibold text-[var(--appkit-color-text)] line-clamp-1", children: auction.productTitle }) }), _jsxs(Row, { gap: "sm", className: "shrink-0", children: [isWinning && (_jsx(Badge, { variant: "active", children: "Winning" })), _jsxs(Text, { variant: "secondary", className: "text-xs", children: [auction.bids.length, " bid", auction.bids.length !== 1 ? "s" : ""] }), _jsx(Text, { className: "text-sm font-semibold text-[var(--appkit-color-text)]", children: paise(highest) })] })] }), expanded && (_jsxs(Div, { className: "border-t border-[var(--appkit-color-border)]", children: [_jsxs("div", { className: "grid text-xs font-medium text-[var(--appkit-color-text-muted)] uppercase tracking-wide px-4 py-2 border-b border-[var(--appkit-color-border-subtle)]", style: { gridTemplateColumns: portal === "buyer" ? "1fr auto auto" : "1fr 1fr auto auto" }, children: [_jsx("span", { children: portal === "buyer" ? "Amount" : "Bidder" }), portal !== "buyer" && _jsx("span", { children: "Amount" }), _jsx("span", { children: "Status" }), _jsx("span", { className: "text-right", children: "Time" })] }), sorted.map((bid) => (_jsxs("div", { className: "grid items-center px-4 py-2.5 border-b border-[var(--appkit-color-border-subtle)] last:border-0 hover:bg-[var(--appkit-color-border-subtle)] transition-colors", style: { gridTemplateColumns: portal === "buyer" ? "1fr auto auto" : "1fr 1fr auto auto" }, children: [portal !== "buyer" && (_jsx(Text, { className: "text-sm text-[var(--appkit-color-text)] truncate pr-3", children: bid.userName || bid.userId })), _jsx(Text, { className: "text-sm font-medium text-[var(--appkit-color-text)]", children: paise(bid.bidAmount) }), _jsx(Badge, { variant: STATUS_VARIANT[bid.status] ?? "pending", className: "capitalize", children: bid.status }), _jsx(Text, { variant: "secondary", className: "text-xs text-right", children: relDate(bid.bidDate) })] }, bid.id)))] }))] }));
57
+ return (_jsxs(Div, { className: `border border-[var(--appkit-color-border)] rounded-xl ${__O.hidden} bg-[var(--appkit-color-surface)] shadow-sm`, children: [_jsxs("button", { type: "button", onClick: () => setExpanded((v) => !v), className: "w-full flex items-center gap-3 px-4 py-3 hover:bg-[var(--appkit-color-border-subtle)] transition-colors text-left", "aria-expanded": expanded, children: [_jsx(ChevronRight, { className: `shrink-0 text-[var(--appkit-color-text-muted)] transition-transform ${expanded ? "rotate-90" : ""}`, size: 16 }), _jsx(Div, { className: "flex-1 min-w-0", children: _jsx(Text, { className: "text-sm font-semibold text-[var(--appkit-color-text)] line-clamp-1", children: auction.productTitle }) }), _jsxs(Row, { gap: "sm", className: "shrink-0", children: [isWinning && (_jsx(Badge, { variant: "active", children: "Winning" })), _jsxs(Text, { variant: "secondary", className: "text-xs", children: [auction.bids.length, " bid", auction.bids.length !== 1 ? "s" : ""] }), _jsx(Text, { className: "text-sm font-semibold text-[var(--appkit-color-text)]", children: paise(highest) })] })] }), expanded && (_jsxs(Div, { className: "border-t border-[var(--appkit-color-border)]", children: [_jsxs("div", { className: "grid text-xs font-medium text-[var(--appkit-color-text-muted)] uppercase tracking-wide px-4 py-2 border-b border-[var(--appkit-color-border-subtle)]", style: { gridTemplateColumns: portal === "buyer" ? "1fr auto auto" : "1fr 1fr auto auto" }, children: [_jsx("span", { children: portal === "buyer" ? "Amount" : "Bidder" }), portal !== "buyer" && _jsx("span", { children: "Amount" }), _jsx("span", { children: "Status" }), _jsx("span", { className: "text-right", children: "Time" })] }), sorted.map((bid) => (_jsxs("div", { className: "grid items-center px-4 py-2.5 border-b border-[var(--appkit-color-border-subtle)] last:border-0 hover:bg-[var(--appkit-color-border-subtle)] transition-colors", style: { gridTemplateColumns: portal === "buyer" ? "1fr auto auto" : "1fr 1fr auto auto" }, children: [portal !== "buyer" && (_jsx(Text, { className: "text-sm text-[var(--appkit-color-text)] truncate pr-3", children: bid.userName || bid.userId })), _jsx(Text, { className: "text-sm font-medium text-[var(--appkit-color-text)]", children: paise(bid.bidAmount) }), _jsx(Badge, { variant: STATUS_VARIANT[bid.status] ?? "pending", className: "capitalize", children: bid.status }), _jsx(Text, { variant: "secondary", className: "text-xs text-right", children: relDate(bid.bidDate) })] }, bid.id)))] }))] }));
55
58
  }
56
59
  export function AuctionBidsTable({ bids, portal = "buyer", emptyLabel = "No bids found.", }) {
57
60
  const auctions = useMemo(() => groupByAuction(bids), [bids]);