@mohasinac/appkit 2.7.56 → 2.7.58

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 (364) hide show
  1. package/dist/_internal/client/features/layout/DashboardLayoutClient.d.ts +7 -1
  2. package/dist/_internal/client/features/layout/DashboardLayoutClient.js +8 -2
  3. package/dist/_internal/shared/actions/action-registry.js +31 -5
  4. package/dist/client.d.ts +2 -4
  5. package/dist/client.js +2 -3
  6. package/dist/configs/tailwind.d.ts +16 -3
  7. package/dist/configs/tailwind.js +18 -5
  8. package/dist/constants/field-names.d.ts +3 -0
  9. package/dist/constants/field-names.js +3 -0
  10. package/dist/features/about/components/FAQPageView.js +2 -2
  11. package/dist/features/about/components/FeesView.js +1 -1
  12. package/dist/features/about/components/PolicyPageView.js +1 -1
  13. package/dist/features/about/components/PublicProfileView.js +1 -1
  14. package/dist/features/account/components/AddressBook.js +1 -1
  15. package/dist/features/account/components/AddressesIndexListing.js +1 -1
  16. package/dist/features/account/components/BuyerAccountGuideView.js +7 -7
  17. package/dist/features/account/components/BuyerAuctionsGuideView.js +7 -7
  18. package/dist/features/account/components/BuyerOrdersGuideView.js +6 -6
  19. package/dist/features/account/components/BuyerShoppingGuideView.js +7 -7
  20. package/dist/features/account/components/MessagesView.js +1 -1
  21. package/dist/features/account/components/NotificationPreferencesPanel.js +12 -3
  22. package/dist/features/account/components/UserOffersPanel.js +2 -2
  23. package/dist/features/account/components/UserSidebar.js +3 -3
  24. package/dist/features/account/components/UserSupportView.js +5 -5
  25. package/dist/features/admin/components/AdminAdsView.js +1 -1
  26. package/dist/features/admin/components/AdminAllEventEntriesView.js +2 -2
  27. package/dist/features/admin/components/AdminAnalyticsGuideView.js +3 -3
  28. package/dist/features/admin/components/AdminBidsView.js +6 -2
  29. package/dist/features/admin/components/AdminBlogView.js +7 -2
  30. package/dist/features/admin/components/AdminBrandsView.js +7 -2
  31. package/dist/features/admin/components/AdminBundleEditorView.js +13 -9
  32. package/dist/features/admin/components/AdminBundlesView.js +4 -2
  33. package/dist/features/admin/components/AdminCarouselEditorView.js +7 -8
  34. package/dist/features/admin/components/AdminCarouselView.js +6 -4
  35. package/dist/features/admin/components/AdminCartsView.js +1 -1
  36. package/dist/features/admin/components/AdminCatalogGuideView.js +5 -5
  37. package/dist/features/admin/components/AdminCategoriesView.js +7 -2
  38. package/dist/features/admin/components/AdminContactEditorView.js +2 -2
  39. package/dist/features/admin/components/AdminContactView.js +4 -2
  40. package/dist/features/admin/components/AdminContentGuideView.js +6 -6
  41. package/dist/features/admin/components/AdminCouponsView.js +4 -2
  42. package/dist/features/admin/components/AdminEmployeeEditorView.js +1 -1
  43. package/dist/features/admin/components/AdminFaqsView.js +4 -2
  44. package/dist/features/admin/components/AdminFeatureFlagsView.js +1 -1
  45. package/dist/features/admin/components/AdminFeaturesView.js +5 -1
  46. package/dist/features/admin/components/AdminGuideHubView.js +1 -1
  47. package/dist/features/admin/components/AdminHistoryView.js +1 -1
  48. package/dist/features/admin/components/AdminListingScaffold.js +1 -1
  49. package/dist/features/admin/components/AdminMediaView.js +10 -5
  50. package/dist/features/admin/components/AdminNavigationView.js +1 -1
  51. package/dist/features/admin/components/AdminNewsletterView.js +4 -2
  52. package/dist/features/admin/components/AdminNotificationsView.js +7 -2
  53. package/dist/features/admin/components/AdminOrdersGuideView.js +5 -5
  54. package/dist/features/admin/components/AdminOrdersView.js +11 -2
  55. package/dist/features/admin/components/AdminPayoutsView.js +6 -2
  56. package/dist/features/admin/components/AdminPrizeDrawsView.js +4 -0
  57. package/dist/features/admin/components/AdminProductsView.js +14 -2
  58. package/dist/features/admin/components/AdminReturnRequestsView.js +1 -1
  59. package/dist/features/admin/components/AdminReviewsView.js +7 -2
  60. package/dist/features/admin/components/AdminScammerEditorView.js +3 -3
  61. package/dist/features/admin/components/AdminScammersView.js +5 -5
  62. package/dist/features/admin/components/AdminSectionsView.js +2 -2
  63. package/dist/features/admin/components/AdminSessionsView.js +6 -2
  64. package/dist/features/admin/components/AdminSidebar.js +3 -3
  65. package/dist/features/admin/components/AdminSiteSettingsView.js +1 -1
  66. package/dist/features/admin/components/AdminStoreAddressesView.js +1 -1
  67. package/dist/features/admin/components/AdminStoreEditorView.js +1 -1
  68. package/dist/features/admin/components/AdminStoresGuideView.js +6 -6
  69. package/dist/features/admin/components/AdminStoresView.js +7 -2
  70. package/dist/features/admin/components/AdminSublistingCategoriesView.js +3 -1
  71. package/dist/features/admin/components/AdminSupportTicketDetailView.js +4 -4
  72. package/dist/features/admin/components/AdminSupportTicketsView.js +8 -8
  73. package/dist/features/admin/components/AdminTeamGuideView.js +4 -4
  74. package/dist/features/admin/components/AdminTeamView.js +4 -2
  75. package/dist/features/admin/components/AdminTrustGuideView.js +5 -5
  76. package/dist/features/admin/components/AdminUserEditorView.js +2 -2
  77. package/dist/features/admin/components/AdminUsersGuideView.js +5 -5
  78. package/dist/features/admin/components/AdminUsersView.js +6 -2
  79. package/dist/features/admin/components/AdminViewCards.js +3 -3
  80. package/dist/features/admin/components/AdminWishlistsView.js +1 -1
  81. package/dist/features/admin/components/DataTable.js +1 -1
  82. package/dist/features/admin/constants/filter-tabs.d.ts +9 -0
  83. package/dist/features/admin/constants/filter-tabs.js +3 -0
  84. package/dist/features/auctions/components/AuctionBidsTable.js +1 -1
  85. package/dist/features/auctions/components/AuctionBottomActions.d.ts +7 -0
  86. package/dist/features/auctions/components/AuctionBottomActions.js +24 -0
  87. package/dist/features/auctions/components/AuctionDetailPageView.js +7 -7
  88. package/dist/features/auctions/components/AuctionsListView.js +1 -1
  89. package/dist/features/auctions/components/MarketplaceAuctionCard.js +2 -2
  90. package/dist/features/auctions/components/MarketplaceAuctionGrid.js +1 -1
  91. package/dist/features/auctions/components/PlaceBidFormClient.js +1 -1
  92. package/dist/features/auth/components/LoginForm.js +1 -1
  93. package/dist/features/auth/components/VerifyEmailView.js +2 -2
  94. package/dist/features/before-after/components/BeforeAfterGallery.js +1 -1
  95. package/dist/features/blog/components/BlogFeaturedCard.js +1 -1
  96. package/dist/features/blog/components/BlogIndexListing.js +1 -1
  97. package/dist/features/blog/components/BlogListView.js +2 -2
  98. package/dist/features/blog/components/BlogPostView.js +8 -8
  99. package/dist/features/cart/components/CartDrawer.js +2 -2
  100. package/dist/features/cart/repository/cart.repository.js +11 -4
  101. package/dist/features/cart/schemas/firestore.d.ts +3 -0
  102. package/dist/features/categories/components/BrandDetailPageView.js +1 -1
  103. package/dist/features/categories/components/CategoriesIndexListing.js +1 -1
  104. package/dist/features/categories/components/CategoryDetailPageView.js +39 -3
  105. package/dist/features/categories/components/CategoryDetailTabs.d.ts +4 -1
  106. package/dist/features/categories/components/CategoryDetailTabs.js +7 -2
  107. package/dist/features/categories/components/CategoryGrid.js +1 -1
  108. package/dist/features/categories/components/CategoryProductsView.js +1 -1
  109. package/dist/features/categories/components/CategoryStoresListing.d.ts +5 -0
  110. package/dist/features/categories/components/CategoryStoresListing.js +11 -0
  111. package/dist/features/categories/components/CategoryTableColumns.js +2 -2
  112. package/dist/features/categories/components/CategoryTree.js +1 -1
  113. package/dist/features/categories/components/index.d.ts +2 -0
  114. package/dist/features/categories/components/index.js +1 -0
  115. package/dist/features/checkout/components/CheckoutStepper.js +2 -2
  116. package/dist/features/classified/components/ClassifiedIndexListing.js +2 -0
  117. package/dist/features/classified/components/ClassifiedListView.js +1 -1
  118. package/dist/features/collections/components/CollectionCard.js +1 -1
  119. package/dist/features/contact/components/ContactInfoSidebar.js +1 -1
  120. package/dist/features/copilot/components/AdminCopilotView.js +2 -2
  121. package/dist/features/digital-codes/components/DigitalCodesIndexListing.js +2 -0
  122. package/dist/features/digital-codes/components/DigitalCodesListView.js +1 -1
  123. package/dist/features/events/components/AdminEventsView.js +5 -1
  124. package/dist/features/events/components/EventCard.js +1 -1
  125. package/dist/features/events/components/EventPollWidget.js +3 -3
  126. package/dist/features/events/components/EventStatusBadge.js +5 -5
  127. package/dist/features/events/components/EventsIndexListing.js +1 -1
  128. package/dist/features/events/components/EventsListView.js +2 -2
  129. package/dist/features/events/components/SpinWheelView.js +5 -3
  130. package/dist/features/faq/components/FAQAccordion.js +2 -2
  131. package/dist/features/filters/AsyncFacetSection.js +3 -3
  132. package/dist/features/filters/FilterFacetSection.js +5 -5
  133. package/dist/features/filters/RangeFilter.js +1 -1
  134. package/dist/features/forms/Input.js +5 -5
  135. package/dist/features/forms/Select.js +3 -3
  136. package/dist/features/forms/Slider.js +1 -1
  137. package/dist/features/forms/Textarea.js +3 -3
  138. package/dist/features/forms/utils.d.ts +2 -2
  139. package/dist/features/forms/utils.js +2 -2
  140. package/dist/features/history/hooks/useHistory.js +23 -10
  141. package/dist/features/homepage/components/AdvertisementBanner.js +2 -2
  142. package/dist/features/homepage/components/CharacterHotspotForm.js +2 -2
  143. package/dist/features/homepage/components/FeaturedResultsSection.js +1 -1
  144. package/dist/features/homepage/components/HeroSection.js +1 -1
  145. package/dist/features/homepage/components/NewsletterSection.js +1 -1
  146. package/dist/features/homepage/components/SectionCarousel.js +1 -1
  147. package/dist/features/layout/BottomActions.js +2 -2
  148. package/dist/features/layout/ListingLayout.js +3 -3
  149. package/dist/features/layout/TitleBarLayout.js +1 -1
  150. package/dist/features/live/components/LiveItemsIndexListing.js +2 -0
  151. package/dist/features/live/components/LiveItemsListView.js +1 -1
  152. package/dist/features/media/index.d.ts +2 -0
  153. package/dist/features/media/index.js +1 -0
  154. package/dist/features/media/modals/ImageCropModal.js +1 -1
  155. package/dist/features/media/modals/ImageEditor.d.ts +12 -0
  156. package/dist/features/media/modals/ImageEditor.js +73 -0
  157. package/dist/features/media/upload/ImageUpload.d.ts +5 -1
  158. package/dist/features/media/upload/ImageUpload.js +33 -8
  159. package/dist/features/media/upload/MediaUploadField.d.ts +5 -1
  160. package/dist/features/media/upload/MediaUploadField.js +26 -12
  161. package/dist/features/orders/components/OrdersList.js +12 -12
  162. package/dist/features/orders/components/RefundHistoryTable.js +2 -2
  163. package/dist/features/orders/components/RefundRequestView.js +3 -3
  164. package/dist/features/pre-orders/components/MarketplacePreorderCard.js +1 -1
  165. package/dist/features/pre-orders/components/PreOrderActionsClient.js +1 -1
  166. package/dist/features/pre-orders/components/PreOrderBadge.js +5 -5
  167. package/dist/features/pre-orders/components/PreOrderBottomActions.d.ts +5 -0
  168. package/dist/features/pre-orders/components/PreOrderBottomActions.js +22 -0
  169. package/dist/features/pre-orders/components/PreOrderDetailPageView.js +5 -5
  170. package/dist/features/pre-orders/components/PreOrdersIndexListing.js +47 -0
  171. package/dist/features/pre-orders/components/PreOrdersListView.js +1 -1
  172. package/dist/features/pre-orders/components/PreorderCard.js +3 -3
  173. package/dist/features/products/components/AuctionsIndexListing.js +23 -0
  174. package/dist/features/products/components/BidHistory.js +2 -2
  175. package/dist/features/products/components/CompareOverlay.js +1 -1
  176. package/dist/features/products/components/CustomFieldsEditor.js +1 -1
  177. package/dist/features/products/components/CustomSectionTabContent.js +1 -1
  178. package/dist/features/products/components/CustomSectionsEditor.js +1 -1
  179. package/dist/features/products/components/GroupSettingsPanel.js +2 -2
  180. package/dist/features/products/components/MakeOfferButton.js +2 -2
  181. package/dist/features/products/components/PrizeDrawBottomActions.d.ts +6 -0
  182. package/dist/features/products/components/PrizeDrawBottomActions.js +24 -0
  183. package/dist/features/products/components/PrizeDrawDetailPageView.js +5 -7
  184. package/dist/features/products/components/PrizeDrawEntryActions.js +5 -18
  185. package/dist/features/products/components/PrizeDrawItemsEditor.js +3 -3
  186. package/dist/features/products/components/PrizeRevealModal.js +7 -4
  187. package/dist/features/products/components/ProductDetailActions.d.ts +6 -1
  188. package/dist/features/products/components/ProductDetailActions.js +36 -6
  189. package/dist/features/products/components/ProductDetailPageView.js +19 -18
  190. package/dist/features/products/components/ProductFeaturesSelector.js +1 -1
  191. package/dist/features/products/components/ProductGalleryClient.js +1 -1
  192. package/dist/features/products/components/ProductGrid.js +8 -8
  193. package/dist/features/products/components/ProductTabs.js +1 -1
  194. package/dist/features/products/components/ProductTabsShell.js +1 -1
  195. package/dist/features/products/components/ProductsIndexListing.js +47 -0
  196. package/dist/features/products/components/RelatedProducts.js +1 -1
  197. package/dist/features/products/components/ShowGroupSection.js +1 -1
  198. package/dist/features/products/components/SublistingCarouselSection.js +1 -1
  199. package/dist/features/products/components/SublistingCategorySelect.js +1 -1
  200. package/dist/features/products/components/index.d.ts +0 -2
  201. package/dist/features/products/components/index.js +0 -1
  202. package/dist/features/products/constants/action-defs.d.ts +7 -0
  203. package/dist/features/products/constants/action-defs.js +14 -0
  204. package/dist/features/products/constants/listing-tabs.d.ts +6 -0
  205. package/dist/features/products/constants/listing-tabs.js +1 -0
  206. package/dist/features/promotions/components/CouponCard.js +3 -3
  207. package/dist/features/promotions/components/CouponsIndexListing.js +2 -2
  208. package/dist/features/promotions/components/PromotionsView.js +1 -1
  209. package/dist/features/reviews/components/ReviewDetailPageView.js +1 -1
  210. package/dist/features/reviews/components/ReviewDetailShell.js +4 -4
  211. package/dist/features/reviews/components/ReviewModal.js +2 -2
  212. package/dist/features/reviews/components/ReviewSummary.js +1 -1
  213. package/dist/features/reviews/components/ReviewsIndexListing.js +1 -1
  214. package/dist/features/reviews/components/ReviewsList.js +1 -1
  215. package/dist/features/seller/components/SellerAddressesView.js +4 -3
  216. package/dist/features/seller/components/SellerAnalyticsAlertsView.js +2 -2
  217. package/dist/features/seller/components/SellerAuctionsView.js +11 -4
  218. package/dist/features/seller/components/SellerBidsView.js +22 -7
  219. package/dist/features/seller/components/SellerBundlesView.js +11 -4
  220. package/dist/features/seller/components/SellerClassifiedView.js +12 -5
  221. package/dist/features/seller/components/SellerCouponEditorView.js +2 -2
  222. package/dist/features/seller/components/SellerCouponsView.js +13 -4
  223. package/dist/features/seller/components/SellerDigitalCodesView.js +11 -4
  224. package/dist/features/seller/components/SellerFeaturesView.js +1 -1
  225. package/dist/features/seller/components/SellerGoogleReviewsView.js +10 -5
  226. package/dist/features/seller/components/SellerGroupedListingsView.js +2 -0
  227. package/dist/features/seller/components/SellerLiveView.js +13 -6
  228. package/dist/features/seller/components/SellerOffersPanel.js +2 -2
  229. package/dist/features/seller/components/SellerOffersView.js +2 -2
  230. package/dist/features/seller/components/SellerOrdersView.js +41 -18
  231. package/dist/features/seller/components/SellerPayoutMethodsView.js +14 -5
  232. package/dist/features/seller/components/SellerPayoutsView.js +2 -2
  233. package/dist/features/seller/components/SellerPreOrdersView.js +7 -2
  234. package/dist/features/seller/components/SellerPrizeDrawsView.js +7 -2
  235. package/dist/features/seller/components/SellerProductShell.js +27 -9
  236. package/dist/features/seller/components/SellerProductsCards.js +2 -1
  237. package/dist/features/seller/components/SellerProductsView.js +22 -9
  238. package/dist/features/seller/components/SellerReviewsView.js +9 -1
  239. package/dist/features/seller/components/SellerShippingConfigsView.js +15 -6
  240. package/dist/features/seller/components/SellerSidebar.js +2 -2
  241. package/dist/features/seller/components/SellerStoreCategoriesView.js +11 -4
  242. package/dist/features/seller/components/SellerTemplatesView.js +20 -7
  243. package/dist/features/seller/components/analytics/SellerTopProducts.js +1 -1
  244. package/dist/features/shell/StepForm.js +9 -3
  245. package/dist/features/site-settings/components/ActionPermissionsManager.js +1 -1
  246. package/dist/features/site-settings/components/NavPermissionsManager.js +1 -1
  247. package/dist/features/stores/components/InteractiveStoreCard.js +1 -1
  248. package/dist/features/stores/components/StoreDetailLayoutView.js +1 -1
  249. package/dist/features/stores/components/StoreFinanceGuideView.js +2 -2
  250. package/dist/features/stores/components/StoreHeader.js +1 -1
  251. package/dist/features/stores/components/StoreListingsGuideView.js +3 -3
  252. package/dist/features/stores/components/StoreOrdersGuideView.js +4 -4
  253. package/dist/features/stores/components/StoreReviewsListing.js +1 -1
  254. package/dist/features/stores/components/StoreSettingsGuideView.js +2 -2
  255. package/dist/features/stores/components/StoresIndexListing.js +17 -1
  256. package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +4 -4
  257. package/dist/features/wishlist/components/WishlistPage.js +3 -3
  258. package/dist/features/wishlist/hooks/useWishlistToggle.js +6 -1
  259. package/dist/index.d.ts +5 -2
  260. package/dist/index.js +9 -3
  261. package/dist/react/hooks/use-action-dispatch.d.ts +5 -0
  262. package/dist/react/hooks/use-action-dispatch.js +10 -0
  263. package/dist/seed/cart-seed-data.js +50 -3
  264. package/dist/seed/categories-seed-data.js +80 -16
  265. package/dist/seed/index.d.ts +3 -0
  266. package/dist/seed/index.js +3 -0
  267. package/dist/seed/manifest.js +15 -1
  268. package/dist/seed/products-classifieds-seed-data.d.ts +10 -0
  269. package/dist/seed/products-classifieds-seed-data.js +197 -0
  270. package/dist/seed/products-digital-codes-seed-data.d.ts +10 -0
  271. package/dist/seed/products-digital-codes-seed-data.js +204 -0
  272. package/dist/seed/products-live-items-seed-data.d.ts +13 -0
  273. package/dist/seed/products-live-items-seed-data.js +190 -0
  274. package/dist/styles.css +301 -3
  275. package/dist/tailwind-utilities.css +1 -1
  276. package/dist/tokens/index.d.ts +3 -3
  277. package/dist/tokens/index.js +3 -3
  278. package/dist/tokens/motion.d.ts +162 -0
  279. package/dist/tokens/motion.js +89 -0
  280. package/dist/ui/DataTable.js +6 -5
  281. package/dist/ui/components/Accordion.js +2 -1
  282. package/dist/ui/components/Button.style.css +15 -0
  283. package/dist/ui/components/Card.d.ts +5 -2
  284. package/dist/ui/components/Card.js +29 -11
  285. package/dist/ui/components/Div.d.ts +2 -16
  286. package/dist/ui/components/Div.js +2 -16
  287. package/dist/ui/components/Input.js +1 -1
  288. package/dist/ui/components/Layout.d.ts +9 -19
  289. package/dist/ui/components/Layout.js +9 -7
  290. package/dist/ui/components/ListingToolbar.js +1 -1
  291. package/dist/ui/components/Modal.js +7 -4
  292. package/dist/ui/components/Motion.d.ts +75 -0
  293. package/dist/ui/components/Motion.js +122 -0
  294. package/dist/ui/components/Select.js +1 -1
  295. package/dist/ui/components/Semantic.d.ts +81 -14
  296. package/dist/ui/components/Semantic.js +75 -10
  297. package/dist/ui/components/Semantic.style.css +261 -2
  298. package/dist/ui/components/SideDrawer.d.ts +1 -1
  299. package/dist/ui/components/SideDrawer.js +8 -6
  300. package/dist/ui/components/SideModal.d.ts +1 -1
  301. package/dist/ui/components/SideModal.js +11 -9
  302. package/dist/ui/components/StackedViewShell.js +6 -1
  303. package/dist/ui/components/StatsGrid.js +1 -1
  304. package/dist/ui/components/Toast.js +5 -2
  305. package/dist/ui/components/Typography.d.ts +44 -3
  306. package/dist/ui/components/Typography.js +15 -30
  307. package/dist/ui/components/Typography.style.css +24 -0
  308. package/dist/ui/components/VacationBanner.js +2 -1
  309. package/dist/ui/components/surface-tokens.d.ts +70 -0
  310. package/dist/ui/components/surface-tokens.js +68 -0
  311. package/dist/ui/forms/FormShell.d.ts +6 -1
  312. package/dist/ui/forms/FormShell.js +32 -4
  313. package/dist/ui/index.d.ts +9 -6
  314. package/dist/ui/index.js +4 -4
  315. package/dist/validation/schemas.d.ts +28 -28
  316. package/package.json +3 -1
  317. package/dist/_internal/client/features/seller/print-center/InventoryLabel.d.ts +0 -12
  318. package/dist/_internal/client/features/seller/print-center/InventoryLabel.js +0 -49
  319. package/dist/_internal/client/features/seller/print-center/LabelDesignPicker.d.ts +0 -7
  320. package/dist/_internal/client/features/seller/print-center/LabelDesignPicker.js +0 -32
  321. package/dist/_internal/client/features/seller/print-center/OrderPackingLabel.d.ts +0 -28
  322. package/dist/_internal/client/features/seller/print-center/OrderPackingLabel.js +0 -33
  323. package/dist/_internal/client/features/seller/print-center/PhysicalLocationModal.d.ts +0 -12
  324. package/dist/_internal/client/features/seller/print-center/PhysicalLocationModal.js +0 -30
  325. package/dist/_internal/client/features/seller/print-center/PrintCenterView.d.ts +0 -12
  326. package/dist/_internal/client/features/seller/print-center/PrintCenterView.js +0 -102
  327. package/dist/_internal/client/features/seller/print-center/PrintGrid.d.ts +0 -12
  328. package/dist/_internal/client/features/seller/print-center/PrintGrid.js +0 -13
  329. package/dist/_internal/client/features/seller/print-center/StoreCard.d.ts +0 -19
  330. package/dist/_internal/client/features/seller/print-center/StoreCard.js +0 -30
  331. package/dist/_internal/client/features/seller/print-center/WebsiteCard.d.ts +0 -11
  332. package/dist/_internal/client/features/seller/print-center/WebsiteCard.js +0 -25
  333. package/dist/_internal/client/features/seller/print-center/index.d.ts +0 -11
  334. package/dist/_internal/client/features/seller/print-center/index.js +0 -10
  335. package/dist/_internal/client/features/seller/print-center/types.d.ts +0 -20
  336. package/dist/_internal/client/features/seller/print-center/types.js +0 -20
  337. package/dist/_internal/client/features/seller/print-center/useInventoryPdf.d.ts +0 -18
  338. package/dist/_internal/client/features/seller/print-center/useInventoryPdf.js +0 -76
  339. package/dist/features/account/repository/address.repository.d.ts +0 -17
  340. package/dist/features/account/repository/address.repository.js +0 -184
  341. package/dist/features/auctions/components/AuctionCard.d.ts +0 -29
  342. package/dist/features/auctions/components/AuctionCard.js +0 -38
  343. package/dist/features/categories/components/BundleAddToCartCta.d.ts +0 -16
  344. package/dist/features/categories/components/BundleAddToCartCta.js +0 -54
  345. package/dist/features/categories/components/CategoriesListView.d.ts +0 -31
  346. package/dist/features/categories/components/CategoriesListView.js +0 -27
  347. package/dist/features/products/components/AuctionsView.d.ts +0 -6
  348. package/dist/features/products/components/AuctionsView.js +0 -5
  349. package/dist/features/products/components/BuyBar.d.ts +0 -21
  350. package/dist/features/products/components/BuyBar.js +0 -19
  351. package/dist/features/products/components/PreOrdersView.d.ts +0 -6
  352. package/dist/features/products/components/PreOrdersView.js +0 -5
  353. package/dist/features/reviews/components/ReviewsListView.d.ts +0 -31
  354. package/dist/features/reviews/components/ReviewsListView.js +0 -16
  355. package/dist/features/stores/components/StoresListView.d.ts +0 -19
  356. package/dist/features/stores/components/StoresListView.js +0 -25
  357. package/dist/features/stores/repository/store-address.repository.d.ts +0 -55
  358. package/dist/features/stores/repository/store-address.repository.js +0 -187
  359. package/dist/ui/components/BulkActionsBar.d.ts +0 -18
  360. package/dist/ui/components/BulkActionsBar.js +0 -25
  361. package/dist/ui/components/CollageLightbox.d.ts +0 -18
  362. package/dist/ui/components/CollageLightbox.js +0 -41
  363. package/dist/ui/components/StickyBottomBar.d.ts +0 -22
  364. package/dist/ui/components/StickyBottomBar.js +0 -20
@@ -1,23 +1,23 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { ShoppingBag, ShoppingCart, CreditCard, Tag, CheckCircle, UserX } from "lucide-react";
3
- import { Div, Heading, Text, Section, Alert } from "../../../ui";
3
+ import { Div, Heading, Span, Text, Section, Alert } from "../../../ui";
4
4
  import { GC } from "../../_guide-cls";
5
5
  const SECTIONS = [
6
6
  {
7
7
  Icon: ShoppingBag, title: "Browsing & Search",
8
- content: (_jsxs(_Fragment, { children: [_jsx(Text, { className: `${GC.textMuted} mb-3`, children: "Use the search bar at the top of any page to find items by keyword \u2014 e.g. \"Charizard Base Set\", \"Hot Wheels Redline\", or \"Beyblade Burst\". Combine keywords for best results." }), _jsx(Text, { className: "text-sm font-semibold text-[var(--appkit-color-text)] mb-2", children: "Available filters:" }), _jsxs("ul", { className: GC.listDiscMuted, children: [_jsxs("li", { children: [_jsx("strong", { children: "Category" }), " \u2014 Trading Cards, Action Figures, Diecast, Spinning Tops, Model Kits, Vintage & Rare"] }), _jsxs("li", { children: [_jsx("strong", { children: "Brand" }), " \u2014 Pok\u00E9mon Company, Bandai, Hot Wheels, Hasbro, Funko, and more"] }), _jsxs("li", { children: [_jsx("strong", { children: "Price range" }), " \u2014 set a minimum and maximum in rupees"] }), _jsxs("li", { children: [_jsx("strong", { children: "Condition" }), " \u2014 grades 1\u201310 (10 = Gem Mint, 1 = Poor)"] }), _jsxs("li", { children: [_jsx("strong", { children: "Listing type" }), " \u2014 Standard / Auction / Pre-order"] })] }), _jsx(Text, { className: `${GC.textMuted} mt-3`, children: "Sort options: Relevance, Price (Low to High), Price (High to Low), Newest First. On mobile, tap the Filter icon to open the filter drawer." })] })),
8
+ content: (_jsxs(_Fragment, { children: [_jsx(Text, { className: `${GC.textMuted} mb-3`, children: "Use the search bar at the top of any page to find items by keyword \u2014 e.g. \"Charizard Base Set\", \"Hot Wheels Redline\", or \"Beyblade Burst\". Combine keywords for best results." }), _jsx(Text, { className: "text-sm font-semibold text-[var(--appkit-color-text)] mb-2", children: "Available filters:" }), _jsxs("ul", { className: GC.listDiscMuted, children: [_jsxs("li", { children: [_jsx(Span, { weight: "bold", children: "Category" }), " \u2014 Trading Cards, Action Figures, Diecast, Spinning Tops, Model Kits, Vintage & Rare"] }), _jsxs("li", { children: [_jsx(Span, { weight: "bold", children: "Brand" }), " \u2014 Pok\u00E9mon Company, Bandai, Hot Wheels, Hasbro, Funko, and more"] }), _jsxs("li", { children: [_jsx(Span, { weight: "bold", children: "Price range" }), " \u2014 set a minimum and maximum in rupees"] }), _jsxs("li", { children: [_jsx(Span, { weight: "bold", children: "Condition" }), " \u2014 grades 1\u201310 (10 = Gem Mint, 1 = Poor)"] }), _jsxs("li", { children: [_jsx(Span, { weight: "bold", children: "Listing type" }), " \u2014 Standard / Auction / Pre-order"] })] }), _jsx(Text, { className: `${GC.textMuted} mt-3`, children: "Sort options: Relevance, Price (Low to High), Price (High to Low), Newest First. On mobile, tap the Filter icon to open the filter drawer." })] })),
9
9
  },
10
10
  {
11
11
  Icon: ShoppingBag, title: "Reading a Product Page",
12
- content: (_jsxs("ul", { className: GC.listMuted, children: [_jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Images" }), " \u2014 tap or click to zoom; swipe left/right to browse all photos."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Condition grade" }), " \u2014 rated 1\u201310: 10 = PSA 10 Gem Mint (flawless), 9 = Mint, 8 = Near Mint\u2013Mint, 7 = Near Mint, 5 = Heavily Played, 3 = Damaged, 1 = Poor."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Seller card" }), " \u2014 shows store name, rating, and total orders delivered. Click the store name to browse all their listings."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Reviews tab" }), " \u2014 verified buyer reviews with star ratings, photos, and seller responses."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Questions?" }), " \u2014 if listing details are unclear, open a support ticket and reference the product URL."] })] })),
12
+ content: (_jsxs("ul", { className: GC.listMuted, children: [_jsxs("li", { children: [_jsx(Span, { weight: "bold", className: GC.textStrong, children: "Images" }), " \u2014 tap or click to zoom; swipe left/right to browse all photos."] }), _jsxs("li", { children: [_jsx(Span, { weight: "bold", className: GC.textStrong, children: "Condition grade" }), " \u2014 rated 1\u201310: 10 = PSA 10 Gem Mint (flawless), 9 = Mint, 8 = Near Mint\u2013Mint, 7 = Near Mint, 5 = Heavily Played, 3 = Damaged, 1 = Poor."] }), _jsxs("li", { children: [_jsx(Span, { weight: "bold", className: GC.textStrong, children: "Seller card" }), " \u2014 shows store name, rating, and total orders delivered. Click the store name to browse all their listings."] }), _jsxs("li", { children: [_jsx(Span, { weight: "bold", className: GC.textStrong, children: "Reviews tab" }), " \u2014 verified buyer reviews with star ratings, photos, and seller responses."] }), _jsxs("li", { children: [_jsx(Span, { weight: "bold", className: GC.textStrong, children: "Questions?" }), " \u2014 if listing details are unclear, open a support ticket and reference the product URL."] })] })),
13
13
  },
14
14
  {
15
15
  Icon: ShoppingCart, title: "Cart",
16
- content: (_jsxs("ul", { className: GC.listMuted, children: [_jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Adding items" }), " \u2014 click \"Add to Cart\" on any standard product or pre-order. Auctions have a \"Place Bid\" flow instead."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Guest cart" }), " \u2014 saved in your browser (localStorage); cleared after 30 days of inactivity."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Logged-in cart" }), " \u2014 synced to your account via Firestore; persists across all your devices."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Item limit" }), " \u2014 up to 20 items per cart. Remove items before adding more."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Updating" }), " \u2014 use the quantity selector or click the trash icon to remove. Changes sync instantly."] })] })),
16
+ content: (_jsxs("ul", { className: GC.listMuted, children: [_jsxs("li", { children: [_jsx(Span, { weight: "bold", className: GC.textStrong, children: "Adding items" }), " \u2014 click \"Add to Cart\" on any standard product or pre-order. Auctions have a \"Place Bid\" flow instead."] }), _jsxs("li", { children: [_jsx(Span, { weight: "bold", className: GC.textStrong, children: "Guest cart" }), " \u2014 saved in your browser (localStorage); cleared after 30 days of inactivity."] }), _jsxs("li", { children: [_jsx(Span, { weight: "bold", className: GC.textStrong, children: "Logged-in cart" }), " \u2014 synced to your account via Firestore; persists across all your devices."] }), _jsxs("li", { children: [_jsx(Span, { weight: "bold", className: GC.textStrong, children: "Item limit" }), " \u2014 up to 20 items per cart. Remove items before adding more."] }), _jsxs("li", { children: [_jsx(Span, { weight: "bold", className: GC.textStrong, children: "Updating" }), " \u2014 use the quantity selector or click the trash icon to remove. Changes sync instantly."] })] })),
17
17
  },
18
18
  {
19
19
  Icon: CreditCard, title: "Checkout",
20
- content: (_jsxs("ul", { className: GC.listMuted, children: [_jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Shipping address" }), " \u2014 enter or select a saved address. All fields required: full name, phone, address line, city, state, pin code."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Payment methods" }), " \u2014 UPI, credit/debit card (Visa, Mastercard, Rupay), net banking \u2014 all processed via Razorpay."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Secure checkout" }), " \u2014 LetItRip never stores your card details. All payment data is handled by Razorpay's PCI-DSS compliant gateway."] })] })),
20
+ content: (_jsxs("ul", { className: GC.listMuted, children: [_jsxs("li", { children: [_jsx(Span, { weight: "bold", className: GC.textStrong, children: "Shipping address" }), " \u2014 enter or select a saved address. All fields required: full name, phone, address line, city, state, pin code."] }), _jsxs("li", { children: [_jsx(Span, { weight: "bold", className: GC.textStrong, children: "Payment methods" }), " \u2014 UPI, credit/debit card (Visa, Mastercard, Rupay), net banking \u2014 all processed via Razorpay."] }), _jsxs("li", { children: [_jsx(Span, { weight: "bold", className: GC.textStrong, children: "Secure checkout" }), " \u2014 LetItRip never stores your card details. All payment data is handled by Razorpay's PCI-DSS compliant gateway."] })] })),
21
21
  },
22
22
  {
23
23
  Icon: Tag, title: "Coupons",
@@ -25,11 +25,11 @@ const SECTIONS = [
25
25
  },
26
26
  {
27
27
  Icon: CheckCircle, title: "Order Confirmation",
28
- content: (_jsxs(_Fragment, { children: [_jsx(Text, { className: GC.textMuted, children: "After a successful payment you'll see an on-screen confirmation with your order ID. You'll also receive:" }), _jsxs("ul", { className: `${GC.listDiscMuted} mt-3`, children: [_jsx("li", { children: "An email confirmation to your registered address" }), _jsx("li", { children: "A WhatsApp message if you've added and verified your phone number" })] }), _jsxs(Text, { className: `${GC.textMuted} mt-3`, children: ["View all your orders at any time under ", _jsx("strong", { children: "My Account \u2192 My Orders" }), "."] })] })),
28
+ content: (_jsxs(_Fragment, { children: [_jsx(Text, { className: GC.textMuted, children: "After a successful payment you'll see an on-screen confirmation with your order ID. You'll also receive:" }), _jsxs("ul", { className: `${GC.listDiscMuted} mt-3`, children: [_jsx("li", { children: "An email confirmation to your registered address" }), _jsx("li", { children: "A WhatsApp message if you've added and verified your phone number" })] }), _jsxs(Text, { className: `${GC.textMuted} mt-3`, children: ["View all your orders at any time under ", _jsx(Span, { weight: "bold", children: "My Account \u2192 My Orders" }), "."] })] })),
29
29
  },
30
30
  {
31
31
  Icon: UserX, title: "Guest Limitations",
32
- content: (_jsxs(Alert, { variant: "info", title: "Browsing as a guest?", children: ["You can browse listings and add items to your cart as a guest. However, to ", _jsx("strong", { children: "complete checkout" }), ", save your wishlist, or contact support you must be signed in. Creating an account takes under 30 seconds \u2014 just an email and a password."] })),
32
+ content: (_jsxs(Alert, { variant: "info", title: "Browsing as a guest?", children: ["You can browse listings and add items to your cart as a guest. However, to ", _jsx(Span, { weight: "bold", children: "complete checkout" }), ", save your wishlist, or contact support you must be signed in. Creating an account takes under 30 seconds \u2014 just an email and a password."] })),
33
33
  },
34
34
  ];
35
35
  // ─── Component ────────────────────────────────────────────────────────────────
@@ -2,5 +2,5 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Div, Heading, Span } from "../../../ui";
3
3
  import { THEME_CONSTANTS } from "../../../tokens";
4
4
  export function MessagesView({ labels = {}, chatId, renderChatList, renderChatWindow, renderMobileBack, renderEmptyState, className = "", }) {
5
- return (_jsxs(Div, { className: `grid grid-cols-1 md:grid-cols-[280px_1fr] xl:grid-cols-[320px_1fr] 2xl:grid-cols-[360px_1fr] gap-4 h-full min-h-[600px] ${className}`, children: [_jsxs(Div, { className: chatId ? "hidden md:block" : "block", children: [labels.title && (_jsx(Heading, { level: 3, className: "mb-3 font-semibold", children: labels.title })), renderChatList?.()] }), chatId ? (_jsxs(Div, { className: `flex flex-col ${THEME_CONSTANTS.spacing.gap.xs}`, children: [renderMobileBack?.(), renderChatWindow?.()] })) : (_jsx(Div, { className: "hidden md:flex items-center justify-center text-neutral-400 dark:text-neutral-600 border border-dashed border-neutral-200 dark:border-neutral-700 rounded-xl", children: renderEmptyState?.() ?? (_jsx(Span, { children: labels.selectRoom ?? "Select a conversation" })) }))] }));
5
+ return (_jsxs(Div, { className: `grid grid-cols-1 md:grid-cols-[280px_1fr] xl:grid-cols-[320px_1fr] 2xl:grid-cols-[360px_1fr] gap-4 h-full min-h-[600px] ${className}`, children: [_jsxs(Div, { className: chatId ? "hidden md:block" : "block", children: [labels.title && (_jsx(Heading, { level: 3, className: "mb-3 font-semibold", children: labels.title })), renderChatList?.()] }), chatId ? (_jsxs(Div, { className: `flex flex-col ${THEME_CONSTANTS.spacing.gap.xs}`, children: [renderMobileBack?.(), renderChatWindow?.()] })) : (_jsx(Div, { className: "hidden md:flex items-center justify-center text-zinc-400 dark:text-zinc-400 border border-dashed border-neutral-200 dark:border-neutral-700 rounded-xl", children: renderEmptyState?.() ?? (_jsx(Span, { children: labels.selectRoom ?? "Select a conversation" })) }))] }));
6
6
  }
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useState, useEffect, useCallback } from "react";
4
- import { Stack, Row, Text, Button, Div } from "../../../ui";
4
+ import { Stack, Row, Text, Button, Div, useToast } from "../../../ui";
5
5
  import { useSiteSettings } from "../../../core/hooks/useSiteSettings";
6
6
  // ─── type-row config ────────────────────────────────────────────────────────
7
7
  const TYPE_ROWS = [
@@ -31,6 +31,7 @@ function SectionCard({ title, children }) {
31
31
  return (_jsxs(Div, { className: "rounded-xl border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)] overflow-hidden", children: [_jsx(Div, { className: "px-4 py-3 border-b border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface-alt,var(--appkit-color-surface))]", children: _jsx(Text, { className: "text-xs font-semibold uppercase tracking-widest text-[var(--appkit-color-text-muted)]", children: title }) }), _jsx(Div, { className: "px-4", children: children })] }));
32
32
  }
33
33
  export function NotificationPreferencesPanel({ fetchUrl = "/api/user/notification-preferences", saveUrl = "/api/user/notification-preferences", onSave, }) {
34
+ const { showToast } = useToast();
34
35
  const { data: settings } = useSiteSettings();
35
36
  const adminChannels = settings?.notificationChannels;
36
37
  const [channels, setChannels] = useState({ email: true, whatsapp: true, sms: true });
@@ -66,19 +67,27 @@ export function NotificationPreferencesPanel({ fetchUrl = "/api/user/notificatio
66
67
  setSaving(true);
67
68
  try {
68
69
  const prefs = { channels, types };
69
- await fetch(saveUrl, {
70
+ const res = await fetch(saveUrl, {
70
71
  method: "PUT",
71
72
  credentials: "include",
72
73
  headers: { "Content-Type": "application/json" },
73
74
  body: JSON.stringify(prefs),
74
75
  });
76
+ if (!res.ok) {
77
+ const body = await res.json().catch(() => null);
78
+ throw new Error(body?.error ?? "Failed to save preferences");
79
+ }
75
80
  setSaved(true);
81
+ showToast("Preferences saved.", "success");
76
82
  onSave?.(prefs);
77
83
  }
84
+ catch (err) {
85
+ showToast(err instanceof Error ? err.message : "Failed to save preferences.", "error");
86
+ }
78
87
  finally {
79
88
  setSaving(false);
80
89
  }
81
- }, [channels, types, saveUrl, onSave]);
90
+ }, [channels, types, saveUrl, onSave, showToast]);
82
91
  if (loading) {
83
92
  return (_jsx(Div, { className: "py-8 text-center", children: _jsx(Text, { variant: "secondary", className: "text-sm", children: "Loading preferences\u2026" }) }));
84
93
  }
@@ -56,7 +56,7 @@ function BuyerOfferCard({ offer, onAcceptCounter, onWithdraw, onCheckout, onUpda
56
56
  }
57
57
  });
58
58
  }
59
- return (_jsxs(Div, { className: "rounded-xl border border-zinc-200 dark:border-zinc-700 bg-white dark:bg-zinc-900 p-4 space-y-3", children: [_jsxs(Div, { className: "flex items-start justify-between gap-2 flex-wrap", children: [_jsxs(Div, { className: "min-w-0", children: [_jsx(Text, { className: "font-semibold text-sm text-zinc-900 dark:text-zinc-100 truncate", children: offer.productTitle ?? "Unknown Product" }), _jsx(Text, { className: "text-xs text-zinc-500 dark:text-zinc-400 mt-0.5", children: relativeTime(offer.createdAt) })] }), _jsx(Badge, { variant: statusVariant(offer.status), className: "shrink-0 capitalize text-xs", children: offer.status })] }), _jsxs(Div, { className: "flex gap-4 flex-wrap", children: [_jsxs(Div, { children: [_jsx(Text, { className: "text-xs text-zinc-400 dark:text-zinc-500 uppercase tracking-wide", children: "Listed" }), _jsx(Text, { className: "text-sm font-medium text-zinc-700 dark:text-zinc-300", children: formatRupees(offer.listedPrice) })] }), _jsxs(Div, { children: [_jsx(Text, { className: "text-xs text-zinc-400 dark:text-zinc-500 uppercase tracking-wide", children: "Your Offer" }), _jsx(Text, { className: "text-sm font-semibold text-zinc-900 dark:text-zinc-100", children: formatRupees(offer.offerAmount) })] }), offer.counterAmount != null && (_jsxs(Div, { children: [_jsx(Text, { className: "text-xs text-zinc-400 dark:text-zinc-500 uppercase tracking-wide", children: "Seller Counter" }), _jsx(Text, { className: "text-sm font-semibold text-blue-600 dark:text-blue-400", children: formatRupees(offer.counterAmount) })] })), offer.lockedPrice != null && (_jsxs(Div, { children: [_jsx(Text, { className: "text-xs text-zinc-400 dark:text-zinc-500 uppercase tracking-wide", children: "Agreed Price" }), _jsx(Text, { className: "text-sm font-semibold text-emerald-600 dark:text-emerald-400", children: formatRupees(offer.lockedPrice) })] }))] }), offer.sellerNote && (_jsxs(Text, { className: "text-xs text-zinc-500 dark:text-zinc-400 italic", children: ["Seller note: \"", offer.sellerNote, "\""] })), offer.status === "countered" && (_jsxs(Div, { className: "space-y-2", children: [_jsxs(Text, { className: "text-xs text-blue-600 dark:text-blue-400 font-medium", children: ["Seller countered at ", formatRupees(offer.counterAmount), ". Accept or withdraw your offer."] }), _jsxs(Div, { className: "flex gap-2 flex-wrap", children: [_jsx(Button, { size: "sm", variant: "primary", onClick: () => act(() => onAcceptCounter(offer.id), { status: "accepted", lockedPrice: offer.counterAmount }), disabled: isPending, children: isPending ? "Accepting…" : `Accept ${formatRupees(offer.counterAmount)}` }), _jsx(Button, { size: "sm", variant: "ghost", onClick: () => setConfirming("withdraw"), disabled: isPending, className: "text-red-600 dark:text-red-400 border border-red-200 dark:border-red-800", children: "Withdraw" })] })] })), offer.status === "accepted" && onCheckout && (_jsx(Button, { size: "sm", variant: "primary", onClick: () => act(() => onCheckout(offer.id), { status: "paid" }), disabled: isPending, children: isPending ? "Processing…" : "Checkout at Agreed Price" })), offer.status === "pending" && (_jsx(Button, { size: "sm", variant: "ghost", onClick: () => setConfirming("withdraw"), disabled: isPending, className: "text-red-600 dark:text-red-400 border border-red-200 dark:border-red-800 text-xs", children: "Withdraw Offer" })), confirming === "withdraw" && (_jsxs(Div, { className: "flex gap-2", children: [_jsx(Button, { size: "sm", variant: "ghost", onClick: () => act(() => onWithdraw(offer.id), { status: "withdrawn" }), disabled: isPending, className: "text-red-600 dark:text-red-400 border border-red-200 dark:border-red-800", children: isPending ? "Withdrawing…" : "Confirm Withdraw" }), _jsx(Button, { size: "sm", variant: "ghost", onClick: () => setConfirming(null), disabled: isPending, children: "Cancel" })] })), error && _jsx(Alert, { variant: "error", children: _jsx(Text, { className: "text-xs", children: error }) })] }));
59
+ return (_jsxs(Div, { surface: "card", padding: "sm", className: "space-y-3", children: [_jsxs(Div, { className: "flex items-start justify-between gap-2 flex-wrap", children: [_jsxs(Div, { className: "min-w-0", children: [_jsx(Text, { className: "font-semibold text-sm text-zinc-900 dark:text-zinc-100 truncate", children: offer.productTitle ?? "Unknown Product" }), _jsx(Text, { className: "text-xs text-zinc-500 dark:text-zinc-400 mt-0.5", children: relativeTime(offer.createdAt) })] }), _jsx(Badge, { variant: statusVariant(offer.status), className: "shrink-0 capitalize text-xs", children: offer.status })] }), _jsxs(Div, { className: "flex gap-4 flex-wrap", children: [_jsxs(Div, { children: [_jsx(Text, { className: "text-xs text-zinc-400 dark:text-zinc-400 uppercase tracking-wide", children: "Listed" }), _jsx(Text, { className: "text-sm font-medium text-zinc-700 dark:text-zinc-300", children: formatRupees(offer.listedPrice) })] }), _jsxs(Div, { children: [_jsx(Text, { className: "text-xs text-zinc-400 dark:text-zinc-400 uppercase tracking-wide", children: "Your Offer" }), _jsx(Text, { className: "text-sm font-semibold text-zinc-900 dark:text-zinc-100", children: formatRupees(offer.offerAmount) })] }), offer.counterAmount != null && (_jsxs(Div, { children: [_jsx(Text, { className: "text-xs text-zinc-400 dark:text-zinc-400 uppercase tracking-wide", children: "Seller Counter" }), _jsx(Text, { className: "text-sm font-semibold text-blue-600 dark:text-blue-400", children: formatRupees(offer.counterAmount) })] })), offer.lockedPrice != null && (_jsxs(Div, { children: [_jsx(Text, { className: "text-xs text-zinc-400 dark:text-zinc-400 uppercase tracking-wide", children: "Agreed Price" }), _jsx(Text, { className: "text-sm font-semibold text-success", children: formatRupees(offer.lockedPrice) })] }))] }), offer.sellerNote && (_jsxs(Text, { className: "text-xs text-zinc-500 dark:text-zinc-400 italic", children: ["Seller note: \"", offer.sellerNote, "\""] })), offer.status === "countered" && (_jsxs(Div, { className: "space-y-2", children: [_jsxs(Text, { className: "text-xs text-info font-medium", children: ["Seller countered at ", formatRupees(offer.counterAmount), ". Accept or withdraw your offer."] }), _jsxs(Div, { className: "flex gap-2 flex-wrap", children: [_jsx(Button, { size: "sm", variant: "primary", onClick: () => act(() => onAcceptCounter(offer.id), { status: "accepted", lockedPrice: offer.counterAmount }), disabled: isPending, children: isPending ? "Accepting…" : `Accept ${formatRupees(offer.counterAmount)}` }), _jsx(Button, { size: "sm", variant: "ghost", onClick: () => setConfirming("withdraw"), disabled: isPending, className: "text-error border border-red-200 dark:border-red-800", children: "Withdraw" })] })] })), offer.status === "accepted" && onCheckout && (_jsx(Button, { size: "sm", variant: "primary", onClick: () => act(() => onCheckout(offer.id), { status: "paid" }), disabled: isPending, children: isPending ? "Processing…" : "Checkout at Agreed Price" })), offer.status === "pending" && (_jsx(Button, { size: "sm", variant: "ghost", onClick: () => setConfirming("withdraw"), disabled: isPending, className: "text-error border border-red-200 dark:border-red-800 text-xs", children: "Withdraw Offer" })), confirming === "withdraw" && (_jsxs(Div, { className: "flex gap-2", children: [_jsx(Button, { size: "sm", variant: "ghost", onClick: () => act(() => onWithdraw(offer.id), { status: "withdrawn" }), disabled: isPending, className: "text-error border border-red-200 dark:border-red-800", children: isPending ? "Withdrawing…" : "Confirm Withdraw" }), _jsx(Button, { size: "sm", variant: "ghost", onClick: () => setConfirming(null), disabled: isPending, children: "Cancel" })] })), error && _jsx(Alert, { variant: "error", children: _jsx(Text, { className: "text-xs", children: error }) })] }));
60
60
  }
61
61
  export function UserOffersPanel({ fetchEndpoint = "/api/user/offers", onAcceptCounter, onWithdraw, onCheckout, className = "", }) {
62
62
  const [offers, setOffers] = useState([]);
@@ -90,5 +90,5 @@ export function UserOffersPanel({ fetchEndpoint = "/api/user/offers", onAcceptCo
90
90
  function handleUpdate(id, patch) {
91
91
  setOffers((prev) => prev.map((o) => (o.id === id ? { ...o, ...patch } : o)));
92
92
  }
93
- return (_jsxs(Div, { className: `space-y-4 ${className}`, children: [_jsx(LoginRequiredModal, { isOpen: showLoginModal, onClose: () => setShowLoginModal(false), message: "You need to be signed in to manage your offers. Please log in or create an account to continue." }), _jsxs(Div, { className: "flex items-center justify-between", children: [_jsx(Heading, { level: 2, className: "text-lg font-semibold text-zinc-900 dark:text-zinc-100", children: "My Offers" }), _jsx(Button, { size: "sm", variant: "ghost", onClick: loadOffers, disabled: loading, className: "border border-zinc-300 dark:border-zinc-600 text-xs", children: loading ? "Refreshing…" : ACTIONS.USER["refresh-offers"].label })] }), fetchError && _jsx(Alert, { variant: "error", children: _jsx(Text, { className: "text-sm", children: fetchError }) }), loading && (_jsx(Div, { className: "flex justify-center py-12", children: _jsx(Spinner, { size: "lg" }) })), !loading && offers.length === 0 && (_jsx(Div, { className: "text-center py-12", children: _jsx(Text, { className: "text-zinc-400 dark:text-zinc-500 text-sm", children: "No offers yet" }) })), !loading && offers.length > 0 && (_jsx(Div, { className: "space-y-3", children: offers.map((offer) => (_jsx(BuyerOfferCard, { offer: offer, onAcceptCounter: onAcceptCounter, onWithdraw: onWithdraw, onCheckout: onCheckout, onUpdate: handleUpdate, onNeedsLogin: () => setShowLoginModal(true) }, offer.id))) }))] }));
93
+ return (_jsxs(Div, { className: `space-y-4 ${className}`, children: [_jsx(LoginRequiredModal, { isOpen: showLoginModal, onClose: () => setShowLoginModal(false), message: "You need to be signed in to manage your offers. Please log in or create an account to continue." }), _jsxs(Div, { className: "flex items-center justify-between", children: [_jsx(Heading, { level: 2, className: "text-lg font-semibold text-zinc-900 dark:text-zinc-100", children: "My Offers" }), _jsx(Button, { size: "sm", variant: "ghost", onClick: loadOffers, disabled: loading, className: "border border-zinc-300 dark:border-zinc-600 text-xs", children: loading ? "Refreshing…" : ACTIONS.USER["refresh-offers"].label })] }), fetchError && _jsx(Alert, { variant: "error", children: _jsx(Text, { className: "text-sm", children: fetchError }) }), loading && (_jsx(Div, { className: "flex justify-center py-12", children: _jsx(Spinner, { size: "lg" }) })), !loading && offers.length === 0 && (_jsx(Div, { className: "text-center py-12", children: _jsx(Text, { className: "text-zinc-400 dark:text-zinc-400 text-sm", children: "No offers yet" }) })), !loading && offers.length > 0 && (_jsx(Div, { className: "space-y-3", children: offers.map((offer) => (_jsx(BuyerOfferCard, { offer: offer, onAcceptCounter: onAcceptCounter, onWithdraw: onWithdraw, onCheckout: onCheckout, onUpdate: handleUpdate, onNeedsLogin: () => setShowLoginModal(true) }, offer.id))) }))] }));
94
94
  }
@@ -49,11 +49,11 @@ function DrawerContent({ groups, items, activeHref, onItemClick, }) {
49
49
  const hasActive = group.items.some((i) => activeHref === i.href || activeHref.startsWith(i.href + "/"));
50
50
  return (_jsxs("div", { className: "mb-0.5", children: [_jsxs("button", { type: "button", onClick: () => toggle(group.title), className: `flex w-full items-center justify-between px-4 py-2 text-[0.6875rem] font-semibold uppercase tracking-widest transition-colors ${hasActive && !isOpen
51
51
  ? "text-primary-600 dark:text-primary-400"
52
- : "text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300"}`, children: [_jsx("span", { children: group.title }), _jsx("svg", { className: `w-3 h-3 transition-transform duration-150 ${isOpen ? "rotate-180" : ""}`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.5, d: "M19 9l-7 7-7-7" }) })] }), isOpen && (_jsx(Ul, { className: "space-y-0.5 px-3 pb-1", children: group.items.map((item) => (_jsx(Li, { children: _jsx(NavLink, { item: item, isActive: isNavItemActive(item, activeHref), onClick: onItemClick }) }, item.href))) }))] }, group.title));
52
+ : "text-zinc-400 dark:text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300"}`, children: [_jsx("span", { children: group.title }), _jsx("svg", { className: `w-3 h-3 transition-transform duration-150 ${isOpen ? "rotate-180" : ""}`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.5, d: "M19 9l-7 7-7-7" }) })] }), isOpen && (_jsx(Ul, { className: "space-y-0.5 px-3 pb-1", children: group.items.map((item) => (_jsx(Li, { children: _jsx(NavLink, { item: item, isActive: isNavItemActive(item, activeHref), onClick: onItemClick }) }, item.href))) }))] }, group.title));
53
53
  }) }));
54
54
  }
55
55
  function DrawerPanel({ title, onClose, children, }) {
56
- return (_jsxs("div", { className: "hidden md:block", children: [_jsx("div", { className: "fixed inset-0 z-40 bg-black/40 backdrop-blur-sm", onClick: onClose, "aria-hidden": "true" }), _jsxs("div", { role: "dialog", "aria-modal": "true", "aria-label": title, className: "fixed top-0 right-0 z-50 h-full w-64 bg-white dark:bg-slate-900 border-l border-zinc-200 dark:border-slate-700 flex flex-col shadow-2xl", children: [_jsxs("div", { className: "flex items-center justify-between px-4 py-3.5 border-b border-zinc-100 dark:border-slate-800 shrink-0", children: [_jsx("span", { className: "text-xs font-semibold uppercase tracking-widest text-zinc-400 dark:text-zinc-500", children: title }), _jsx("button", { type: "button", onClick: onClose, "aria-label": "Close", className: "flex items-center justify-center w-7 h-7 rounded-md text-zinc-400 hover:bg-zinc-100 dark:hover:bg-slate-800 hover:text-zinc-700 dark:hover:text-zinc-200 transition-colors", children: _jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })] }), _jsx("div", { className: "flex-1 overflow-y-auto", children: children })] })] }));
56
+ return (_jsxs("div", { className: "hidden md:block", children: [_jsx("div", { className: "fixed inset-0 z-40 bg-black/40 backdrop-blur-sm", onClick: onClose, "aria-hidden": "true" }), _jsxs("div", { role: "dialog", "aria-modal": "true", "aria-label": title, className: "fixed top-0 right-0 z-50 h-full w-64 bg-white dark:bg-slate-900 border-l border-zinc-200 dark:border-slate-700 flex flex-col shadow-2xl", children: [_jsxs("div", { className: "flex items-center justify-between px-4 py-3.5 border-b border-zinc-100 dark:border-slate-800 shrink-0", children: [_jsx("span", { className: "text-xs font-semibold uppercase tracking-widest text-zinc-400 dark:text-zinc-400", children: title }), _jsx("button", { type: "button", onClick: onClose, "aria-label": "Close", className: "flex items-center justify-center w-7 h-7 rounded-md text-zinc-400 hover:bg-zinc-100 dark:hover:bg-slate-800 hover:text-zinc-700 dark:hover:text-zinc-200 transition-colors", children: _jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })] }), _jsx("div", { className: "flex-1 overflow-y-auto", children: children })] })] }));
57
57
  }
58
58
  export function UserSidebar({ items, groups, mobileOpen = false, onCloseMobile, desktopOpen = false, onToggle, variant = "overlay" }) {
59
59
  const pathname = usePathname();
@@ -74,7 +74,7 @@ export function UserSidebar({ items, groups, mobileOpen = false, onCloseMobile,
74
74
  height: "calc(100vh - var(--header-height, 3.5rem))",
75
75
  width: "13rem",
76
76
  transform: desktopOpen ? "translateX(0)" : "translateX(calc(-100% + 1.25rem))",
77
- }, children: [_jsxs("div", { className: "flex-1 bg-white dark:bg-slate-900 border-r border-zinc-200 dark:border-slate-800 flex flex-col overflow-hidden shadow-xl", children: [_jsx("div", { className: "px-4 py-3.5 border-b border-zinc-100 dark:border-slate-800 shrink-0", children: _jsx("span", { className: "text-xs font-semibold uppercase tracking-widest text-zinc-400 dark:text-zinc-500", children: "My Account" }) }), _jsx("div", { className: "flex-1 overflow-y-auto", children: _jsx(DrawerContent, { groups: groups, items: items, activeHref: pathname }) })] }), _jsx(SidebarCollapseToggle, { expanded: desktopOpen, onToggle: handleToggle })] }), _jsx("div", { className: "md:hidden", children: _jsx(BottomSheet, { open: mobileOpen, onClose: close, title: "My Account", children: _jsx(DrawerContent, { groups: groups, items: items, activeHref: pathname, onItemClick: close }) }) })] }));
77
+ }, children: [_jsxs("div", { className: "flex-1 bg-white dark:bg-slate-900 border-r border-zinc-200 dark:border-slate-800 flex flex-col overflow-hidden shadow-xl", children: [_jsx("div", { className: "px-4 py-3.5 border-b border-zinc-100 dark:border-slate-800 shrink-0", children: _jsx("span", { className: "text-xs font-semibold uppercase tracking-widest text-zinc-400 dark:text-zinc-400", children: "My Account" }) }), _jsx("div", { className: "flex-1 overflow-y-auto", children: _jsx(DrawerContent, { groups: groups, items: items, activeHref: pathname }) })] }), _jsx(SidebarCollapseToggle, { expanded: desktopOpen, onToggle: handleToggle })] }), _jsx("div", { className: "md:hidden", children: _jsx(BottomSheet, { open: mobileOpen, onClose: close, title: "My Account", children: _jsx(DrawerContent, { groups: groups, items: items, activeHref: pathname, onItemClick: close }) }) })] }));
78
78
  }
79
79
  // ── Overlay variant (default) — portal on desktop, bottom-sheet on mobile ─
80
80
  const content = (_jsx(DrawerContent, { groups: groups, items: items, activeHref: pathname, onItemClick: close }));
@@ -17,10 +17,10 @@ const CATEGORY_OPTIONS = [
17
17
  { label: "General", value: "general" },
18
18
  ];
19
19
  const STATUS_BADGE = {
20
- open: "bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300",
21
- in_progress: "bg-yellow-100 text-yellow-700 dark:bg-yellow-900/40 dark:text-yellow-300",
20
+ open: "bg-info-surface text-info",
21
+ in_progress: "bg-warning-surface text-warning",
22
22
  waiting_on_user: "bg-purple-100 text-purple-700 dark:bg-purple-900/40 dark:text-purple-300",
23
- resolved: "bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300",
23
+ resolved: "bg-success-surface text-success",
24
24
  closed: "bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400",
25
25
  };
26
26
  const ROLE_LABEL = {
@@ -86,7 +86,7 @@ export function UserSupportView(_props) {
86
86
  }
87
87
  function renderTicketListArea(props) {
88
88
  const { isLoading, error, tickets, setSelectedTicket, setDetailOpen } = props;
89
- return (_jsxs(_Fragment, { children: [isLoading && (_jsx(Div, { className: "space-y-3", children: [1, 2, 3].map((i) => _jsx("div", { className: "h-16 animate-pulse rounded-lg bg-zinc-100 dark:bg-zinc-800" }, i)) })), error && (_jsx(Div, { className: "rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/40 dark:text-red-200", children: "Failed to load support tickets." })), !isLoading && tickets.length === 0 && (_jsx(Div, { className: "rounded-xl border border-zinc-200 bg-zinc-50 px-6 py-10 text-center dark:border-zinc-700 dark:bg-zinc-900/40", children: _jsx(Text, { className: "text-sm text-zinc-500 dark:text-zinc-400", children: "You haven't opened any support tickets yet." }) })), _jsx("ul", { className: "space-y-3", children: tickets.map((ticket) => (_jsx("li", { children: _jsx("button", { type: "button", className: "w-full rounded-xl border border-zinc-200 bg-white p-4 text-left shadow-sm hover:border-primary-300 transition-colors dark:border-zinc-700 dark:bg-zinc-900", onClick: () => { setSelectedTicket(ticket); setDetailOpen(true); }, children: _jsxs("div", { className: "flex items-start justify-between gap-2", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsx(Text, { className: "font-medium text-zinc-900 dark:text-zinc-100 truncate", children: ticket.subject }), _jsxs(Text, { className: "text-xs text-zinc-500 dark:text-zinc-400", children: [ticket.category.replace(/_/g, " "), ticket.orderId ? ` · Order: ${ticket.orderId}` : ""] })] }), _jsx("span", { className: `shrink-0 inline-flex rounded-full px-2.5 py-0.5 text-xs font-medium ${STATUS_BADGE[ticket.status] ?? STATUS_BADGE.open}`, children: ticket.status.replace(/_/g, " ") })] }) }) }, ticket.id))) })] }));
89
+ return (_jsxs(_Fragment, { children: [isLoading && (_jsx(Div, { className: "space-y-3", children: [1, 2, 3].map((i) => _jsx("div", { className: "h-16 animate-pulse rounded-lg bg-zinc-100 dark:bg-zinc-800" }, i)) })), error && (_jsx(Div, { className: "rounded-xl border border-red-200 bg-error-surface px-4 py-3 text-sm text-error dark:border-red-900/60", children: "Failed to load support tickets." })), !isLoading && tickets.length === 0 && (_jsx(Div, { className: "rounded-xl border border-zinc-200 bg-zinc-50 px-6 py-10 text-center dark:border-zinc-700 dark:bg-zinc-900/40", children: _jsx(Text, { className: "text-sm text-zinc-500 dark:text-zinc-400", children: "You haven't opened any support tickets yet." }) })), _jsx("ul", { className: "space-y-3", children: tickets.map((ticket) => (_jsx("li", { children: _jsx("button", { type: "button", className: "w-full rounded-xl border border-zinc-200 bg-white p-4 text-left shadow-sm hover:border-primary-300 transition-colors dark:border-zinc-700 dark:bg-zinc-900", onClick: () => { setSelectedTicket(ticket); setDetailOpen(true); }, children: _jsxs("div", { className: "flex items-start justify-between gap-2", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsx(Text, { className: "font-medium text-zinc-900 dark:text-zinc-100 truncate", children: ticket.subject }), _jsxs(Text, { className: "text-xs text-zinc-500 dark:text-zinc-400", children: [ticket.category.replace(/_/g, " "), ticket.orderId ? ` · Order: ${ticket.orderId}` : ""] })] }), _jsx("span", { className: `shrink-0 inline-flex rounded-full px-2.5 py-0.5 text-xs font-medium ${STATUS_BADGE[ticket.status] ?? STATUS_BADGE.open}`, children: ticket.status.replace(/_/g, " ") })] }) }) }, ticket.id))) })] }));
90
90
  }
91
91
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
92
92
  function renderNewTicketDrawer(props) {
@@ -96,5 +96,5 @@ function renderNewTicketDrawer(props) {
96
96
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
97
97
  function renderTicketDetailDrawer(props) {
98
98
  const { detailOpen, setDetailOpen, selectedTicket, replyBody, setReplyBody, replyMutation } = props;
99
- return (_jsx(SideDrawer, { isOpen: detailOpen, onClose: () => setDetailOpen(false), title: selectedTicket?.subject ?? "Ticket", children: selectedTicket && (_jsxs(Div, { className: "flex flex-col gap-4 p-4", children: [_jsxs(Div, { className: "flex flex-wrap gap-2", children: [_jsx("span", { className: `inline-flex rounded-full px-2.5 py-1 text-xs font-medium ${STATUS_BADGE[selectedTicket.status] ?? STATUS_BADGE.open}`, children: selectedTicket.status.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: selectedTicket.category.replace(/_/g, " ") }), selectedTicket.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: ", selectedTicket.orderId] })] }), selectedTicket.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 uppercase tracking-wide", children: "Your description" }), _jsx(Text, { className: "whitespace-pre-wrap text-sm text-zinc-700 dark:text-zinc-200", children: selectedTicket.description })] })), (selectedTicket.messages ?? []).length > 0 && (_jsxs(Div, { className: "space-y-2", children: [_jsx(Text, { className: "text-xs font-semibold text-zinc-500 uppercase tracking-wide", children: "Messages" }), _jsx("div", { className: "space-y-2 max-h-72 overflow-y-auto", children: (selectedTicket.messages ?? []).map((msg, i) => (_jsxs("div", { className: `rounded-lg p-3 text-sm ${msg.authorRole === "user" ? "bg-zinc-50 border border-zinc-200 dark:bg-zinc-900/40 dark:border-zinc-700" : "bg-blue-50 border border-blue-200 dark:bg-blue-900/20 dark:border-blue-800"}`, children: [_jsxs("div", { className: "mb-1 flex items-center gap-2 text-xs text-zinc-400 dark:text-zinc-500", 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))) })] })), selectedTicket.status !== "closed" && selectedTicket.status !== "resolved" && (_jsxs(Div, { className: "flex flex-col gap-1", children: [_jsx("label", { className: "text-sm font-medium text-zinc-700 dark:text-zinc-300", children: "Reply" }), _jsx("textarea", { value: replyBody, onChange: (e) => setReplyBody(e.target.value), rows: 3, placeholder: "Add a message to your ticket\u2026", className: CLS_INPUT }), _jsx(Button, { type: "button", variant: "primary", size: "sm", isLoading: replyMutation.isPending, disabled: !replyBody.trim() || replyMutation.isPending, onClick: () => replyMutation.mutate(), children: "Send reply" })] }))] })) }));
99
+ return (_jsx(SideDrawer, { isOpen: detailOpen, onClose: () => setDetailOpen(false), title: selectedTicket?.subject ?? "Ticket", children: selectedTicket && (_jsxs(Div, { className: "flex flex-col gap-4 p-4", children: [_jsxs(Div, { className: "flex flex-wrap gap-2", children: [_jsx("span", { className: `inline-flex rounded-full px-2.5 py-1 text-xs font-medium ${STATUS_BADGE[selectedTicket.status] ?? STATUS_BADGE.open}`, children: selectedTicket.status.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: selectedTicket.category.replace(/_/g, " ") }), selectedTicket.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: ", selectedTicket.orderId] })] }), selectedTicket.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 uppercase tracking-wide", children: "Your description" }), _jsx(Text, { className: "whitespace-pre-wrap text-sm text-zinc-700 dark:text-zinc-200", children: selectedTicket.description })] })), (selectedTicket.messages ?? []).length > 0 && (_jsxs(Div, { className: "space-y-2", children: [_jsx(Text, { className: "text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wide", children: "Messages" }), _jsx("div", { className: "space-y-2 max-h-72 overflow-y-auto", children: (selectedTicket.messages ?? []).map((msg, i) => (_jsxs("div", { className: `rounded-lg p-3 text-sm ${msg.authorRole === "user" ? "bg-zinc-50 border border-zinc-200 dark:bg-zinc-900/40 dark:border-zinc-700" : "bg-blue-50 border border-blue-200 dark:bg-blue-900/20 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))) })] })), selectedTicket.status !== "closed" && selectedTicket.status !== "resolved" && (_jsxs(Div, { className: "flex flex-col gap-1", children: [_jsx("label", { className: "text-sm font-medium text-zinc-700 dark:text-zinc-300", children: "Reply" }), _jsx("textarea", { value: replyBody, onChange: (e) => setReplyBody(e.target.value), rows: 3, placeholder: "Add a message to your ticket\u2026", className: CLS_INPUT }), _jsx(Button, { type: "button", variant: "primary", size: "sm", isLoading: replyMutation.isPending, disabled: !replyBody.trim() || replyMutation.isPending, onClick: () => replyMutation.mutate(), children: "Send reply" })] }))] })) }));
100
100
  }
@@ -99,7 +99,7 @@ export function AdminAdsView({ endpoint = ADMIN_ENDPOINTS.ADS, labels = {}, crea
99
99
  {
100
100
  key: "status",
101
101
  header: "Status",
102
- render: (row) => (_jsxs("div", { "data-section": "adminadsview-div-242", children: [_jsx(Text, { className: "text-xs uppercase tracking-wide", children: row.status }), row.publishReady === false ? (_jsx(Text, { className: "text-[11px] text-red-600 dark:text-red-300", children: "Publish blocked" })) : null] })),
102
+ render: (row) => (_jsxs("div", { "data-section": "adminadsview-div-242", children: [_jsx(Text, { className: "text-xs uppercase tracking-wide", children: row.status }), row.publishReady === false ? (_jsx(Text, { className: "text-[11px] text-error", children: "Publish blocked" })) : null] })),
103
103
  },
104
104
  {
105
105
  key: "placementIds",
@@ -23,7 +23,7 @@ const STATUS_OPTIONS = ADMIN_EVENT_ENTRY_STATUS_TABS;
23
23
  function EntriesFilterDrawer({ filterOpen, setFilterOpen, activeFilterCount, clearFilters, pendingFilters, setPendingFilters, applyFilters, }) {
24
24
  if (!filterOpen)
25
25
  return null;
26
- return (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40 bg-black/40", "aria-hidden": "true", onClick: () => setFilterOpen(false) }), _jsxs("div", { className: "fixed inset-y-0 left-0 z-50 flex w-80 flex-col bg-white dark:bg-slate-900 shadow-2xl", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: [_jsx("span", { className: "text-base font-semibold text-zinc-900 dark:text-zinc-100", children: "Filters" }), _jsxs("div", { className: "flex items-center gap-2", children: [activeFilterCount > 0 && (_jsx("button", { type: "button", onClick: clearFilters, className: "text-xs text-zinc-500 hover:text-rose-500 dark:text-zinc-400 transition-colors", children: "Clear all" })), _jsx("button", { type: "button", onClick: () => setFilterOpen(false), "aria-label": "Close", className: "rounded-lg p-1.5 text-zinc-500 hover:bg-zinc-100 dark:hover:bg-slate-800 transition-colors", children: _jsx(X, { className: "h-5 w-5" }) })] })] }), _jsx("div", { className: "flex-1 overflow-y-auto px-4 py-4 space-y-5", children: _jsx(FilterChipGroup, { label: "Status", tabs: STATUS_OPTIONS, value: pendingFilters.status ?? "", onChange: (id) => setPendingFilters((p) => ({ ...p, status: id })) }) }), _jsx("div", { className: "border-t border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: _jsxs("button", { type: "button", onClick: applyFilters, className: "w-full rounded-lg bg-primary py-2.5 text-sm font-semibold text-white hover:bg-primary-600 transition-colors active:scale-[0.98]", children: ["Apply Filters", activeFilterCount > 0 ? ` (${activeFilterCount})` : ""] }) })] })] }));
26
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40 bg-black/40", "aria-hidden": "true", onClick: () => setFilterOpen(false) }), _jsxs("div", { className: "fixed inset-y-0 left-0 z-50 flex w-80 flex-col bg-white dark:bg-slate-900 shadow-2xl", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: [_jsx("span", { className: "text-base font-semibold text-zinc-900 dark:text-zinc-100", children: "Filters" }), _jsxs("div", { className: "flex items-center gap-2", children: [activeFilterCount > 0 && (_jsx("button", { type: "button", onClick: clearFilters, className: "text-xs text-zinc-500 hover:text-rose-500 dark:text-zinc-400 transition-colors", children: "Clear all" })), _jsx("button", { type: "button", onClick: () => setFilterOpen(false), "aria-label": "Close", className: "rounded-lg p-1.5 text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors", children: _jsx(X, { className: "h-5 w-5" }) })] })] }), _jsx("div", { className: "flex-1 overflow-y-auto px-4 py-4 space-y-5", children: _jsx(FilterChipGroup, { label: "Status", tabs: STATUS_OPTIONS, value: pendingFilters.status ?? "", onChange: (id) => setPendingFilters((p) => ({ ...p, status: id })) }) }), _jsx("div", { className: "border-t border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: _jsxs("button", { type: "button", onClick: applyFilters, className: "w-full rounded-lg bg-primary py-2.5 text-sm font-semibold text-white hover:bg-primary-600 transition-colors active:scale-[0.98]", children: ["Apply Filters", activeFilterCount > 0 ? ` (${activeFilterCount})` : ""] }) })] })] }));
27
27
  }
28
28
  export function AdminAllEventEntriesView({ children, ...props }) {
29
29
  const hasChildren = React.Children.count(children) > 0;
@@ -101,7 +101,7 @@ export function AdminAllEventEntriesView({ children, ...props }) {
101
101
  if (hasChildren) {
102
102
  return _jsx(ListingViewShell, { portal: "admin", ...props, children: children });
103
103
  }
104
- return (_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search by user name or event ID", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => { table.set("sort", v); }, showTableView: true, view: view, onViewChange: (v) => setView(v), onResetAll: resetAll, hasActiveState: hasActiveState }), 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-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/40 dark:text-red-200", children: errorMessage })), _jsx(DataTable, { rows: rows, isLoading: isLoading, emptyLabel: "No entries found", renderRowActions: (row) => {
104
+ return (_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search by user name or event ID", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => { table.set("sort", v); }, showTableView: true, view: view, onViewChange: (v) => setView(v), onResetAll: resetAll, hasActiveState: hasActiveState }), 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-red-200 bg-error-surface px-4 py-3 text-sm text-error dark:border-red-900/60", children: errorMessage })), _jsx(DataTable, { rows: rows, isLoading: isLoading, emptyLabel: "No entries found", renderRowActions: (row) => {
105
105
  const er = row;
106
106
  return (_jsx(RowActionMenu, { actions: [
107
107
  { label: ACTIONS.ADMIN["confirm-entry"].label, onClick: () => updateMutation.mutate({ id: er.id, status: "CONFIRMED" }) },
@@ -1,12 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { BarChart2 } from "lucide-react";
3
- import { Div, Heading, Text, Section, Alert } from "../../../ui";
3
+ import { Div, Heading, Span, Text, Section, Alert } from "../../../ui";
4
4
  import { GC } from "../../_guide-cls";
5
5
  export function AdminAnalyticsGuideView() {
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(BarChart2, { 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: "Analytics" }), _jsx(Text, { className: "text-[var(--appkit-color-text-muted)]", children: "Revenue, order funnel, product performance, and store metrics on LetItRip." })] }), [
7
7
  {
8
8
  title: "Revenue Dashboard",
9
- content: (_jsxs("ul", { className: GC.listMuted, children: [_jsxs("li", { children: [_jsx("strong", { className: "text-[var(--appkit-color-text)]", children: "GMV (Gross Merchandise Value)" }), ": Total order subtotals across all stores. Does not deduct platform commission or refunds."] }), _jsxs("li", { children: [_jsx("strong", { className: "text-[var(--appkit-color-text)]", children: "Net Revenue" }), ": GMV \u00D7 platformFee \u2014 refunded orders excluded."] }), _jsxs("li", { children: [_jsx("strong", { className: "text-[var(--appkit-color-text)]", children: "Period filter" }), ": Last 7 / 30 / 90 days, or custom date range. All monetary values shown in INR."] }), _jsxs("li", { children: [_jsx("strong", { className: "text-[var(--appkit-color-text)]", children: "Payout total" }), ": Total disbursed to sellers in the same period. Revenue - Payout = Platform earnings."] })] })),
9
+ content: (_jsxs("ul", { className: GC.listMuted, children: [_jsxs("li", { children: [_jsx(Span, { weight: "bold", className: "text-[var(--appkit-color-text)]", children: "GMV (Gross Merchandise Value)" }), ": Total order subtotals across all stores. Does not deduct platform commission or refunds."] }), _jsxs("li", { children: [_jsx(Span, { weight: "bold", className: "text-[var(--appkit-color-text)]", children: "Net Revenue" }), ": GMV \u00D7 platformFee \u2014 refunded orders excluded."] }), _jsxs("li", { children: [_jsx(Span, { weight: "bold", className: "text-[var(--appkit-color-text)]", children: "Period filter" }), ": Last 7 / 30 / 90 days, or custom date range. All monetary values shown in INR."] }), _jsxs("li", { children: [_jsx(Span, { weight: "bold", className: "text-[var(--appkit-color-text)]", children: "Payout total" }), ": Total disbursed to sellers in the same period. Revenue - Payout = Platform earnings."] })] })),
10
10
  },
11
11
  {
12
12
  title: "Order Funnel",
@@ -14,7 +14,7 @@ export function AdminAnalyticsGuideView() {
14
14
  },
15
15
  {
16
16
  title: "Product Performance",
17
- content: (_jsxs("ul", { className: GC.listMuted, children: [_jsxs("li", { children: [_jsx("strong", { className: "text-[var(--appkit-color-text)]", children: "Top products by orders" }), ": Which products drive the most completed transactions."] }), _jsxs("li", { children: [_jsx("strong", { className: "text-[var(--appkit-color-text)]", children: "Top products by views" }), ": High views but low orders may indicate pricing, photos, or description issues."] }), _jsxs("li", { children: [_jsx("strong", { className: "text-[var(--appkit-color-text)]", children: "Return rate" }), ": Products with >10% return rate need review \u2014 usually a condition description or photo quality issue."] })] })),
17
+ content: (_jsxs("ul", { className: GC.listMuted, children: [_jsxs("li", { children: [_jsx(Span, { weight: "bold", className: "text-[var(--appkit-color-text)]", children: "Top products by orders" }), ": Which products drive the most completed transactions."] }), _jsxs("li", { children: [_jsx(Span, { weight: "bold", className: "text-[var(--appkit-color-text)]", children: "Top products by views" }), ": High views but low orders may indicate pricing, photos, or description issues."] }), _jsxs("li", { children: [_jsx(Span, { weight: "bold", className: "text-[var(--appkit-color-text)]", children: "Return rate" }), ": Products with >10% return rate need review \u2014 usually a condition description or photo quality issue."] })] })),
18
18
  },
19
19
  {
20
20
  title: "Store-Level Metrics",
@@ -13,6 +13,7 @@ import { ROW_ACTION_META, ROW_ACTION_ID } from "../../products/constants/action-
13
13
  import { toRecordArray, toRelativeDate, toRupees, toStringValue, useAdminListingData, } from "../hooks/useAdminListingData";
14
14
  import { DataTable } from "./DataTable";
15
15
  import { apiClient } from "../../../http";
16
+ import { useBottomActions } from "../../layout";
16
17
  const PAGE_SIZE = 25;
17
18
  const FILTER_KEYS = ["status"];
18
19
  const DEFAULT_SORT = "-bidTime";
@@ -25,7 +26,7 @@ const STATUS_OPTIONS = ADMIN_BID_STATUS_TABS;
25
26
  function BidsFilterDrawer({ filterOpen, setFilterOpen, activeFilterCount, clearFilters, pendingFilters, setPendingFilters, applyFilters, }) {
26
27
  if (!filterOpen)
27
28
  return null;
28
- return (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40 bg-black/40", "aria-hidden": "true", onClick: () => setFilterOpen(false) }), _jsxs("div", { className: "fixed inset-y-0 left-0 z-50 flex w-80 flex-col bg-white dark:bg-slate-900 shadow-2xl", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: [_jsx("span", { className: "text-base font-semibold text-zinc-900 dark:text-zinc-100", children: "Filters" }), _jsxs("div", { className: "flex items-center gap-2", children: [activeFilterCount > 0 && (_jsx("button", { type: "button", onClick: clearFilters, className: "text-xs text-zinc-500 hover:text-rose-500 dark:text-zinc-400 transition-colors", children: "Clear all" })), _jsx("button", { type: "button", onClick: () => setFilterOpen(false), "aria-label": "Close", className: "rounded-lg p-1.5 text-zinc-500 hover:bg-zinc-100 dark:hover:bg-slate-800 transition-colors", children: _jsx(X, { className: "h-5 w-5" }) })] })] }), _jsx("div", { className: "flex-1 overflow-y-auto px-4 py-4 space-y-5", children: _jsx(FilterChipGroup, { label: "Status", tabs: STATUS_OPTIONS, value: pendingFilters.status ?? "", onChange: (id) => setPendingFilters((p) => ({ ...p, status: id })) }) }), _jsx("div", { className: "border-t border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: _jsxs("button", { type: "button", onClick: applyFilters, className: "w-full rounded-lg bg-primary py-2.5 text-sm font-semibold text-white hover:bg-primary-600 transition-colors active:scale-[0.98]", children: ["Apply Filters", activeFilterCount > 0 ? ` (${activeFilterCount})` : ""] }) })] })] }));
29
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40 bg-black/40", "aria-hidden": "true", onClick: () => setFilterOpen(false) }), _jsxs("div", { className: "fixed inset-y-0 left-0 z-50 flex w-80 flex-col bg-white dark:bg-slate-900 shadow-2xl", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: [_jsx("span", { className: "text-base font-semibold text-zinc-900 dark:text-zinc-100", children: "Filters" }), _jsxs("div", { className: "flex items-center gap-2", children: [activeFilterCount > 0 && (_jsx("button", { type: "button", onClick: clearFilters, className: "text-xs text-zinc-500 hover:text-rose-500 dark:text-zinc-400 transition-colors", children: "Clear all" })), _jsx("button", { type: "button", onClick: () => setFilterOpen(false), "aria-label": "Close", className: "rounded-lg p-1.5 text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors", children: _jsx(X, { className: "h-5 w-5" }) })] })] }), _jsx("div", { className: "flex-1 overflow-y-auto px-4 py-4 space-y-5", children: _jsx(FilterChipGroup, { label: "Status", tabs: STATUS_OPTIONS, value: pendingFilters.status ?? "", onChange: (id) => setPendingFilters((p) => ({ ...p, status: id })) }) }), _jsx("div", { className: "border-t border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: _jsxs("button", { type: "button", onClick: applyFilters, className: "w-full rounded-lg bg-primary py-2.5 text-sm font-semibold text-white hover:bg-primary-600 transition-colors active:scale-[0.98]", children: ["Apply Filters", activeFilterCount > 0 ? ` (${activeFilterCount})` : ""] }) })] })] }));
29
30
  }
30
31
  export function AdminBidsView({ children, ...props }) {
31
32
  const hasChildren = React.Children.count(children) > 0;
@@ -109,9 +110,12 @@ export function AdminBidsView({ children, ...props }) {
109
110
  }
110
111
  return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search bids, products, or bidder IDs", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => { table.set("sort", v); }, showTableView: true, view: view, onViewChange: (v) => setView(v), onResetAll: resetAll, hasActiveState: hasActiveState }), _jsx(BulkActionBar, { selectedCount: selection.selectedCount, onClearSelection: selection.clearSelection, actions: [
111
112
  { id: ROW_ACTION_ID.CANCEL, label: ACTIONS.ADMIN["cancel-bid"].label, variant: "secondary", onClick: () => { selection.clearSelection(); } },
112
- ] }), 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-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/40 dark:text-red-200", children: errorMessage })), _jsx(DataTable, { rows: rows, isLoading: isLoading, emptyLabel: "No bids found", renderRowActions: (row) => {
113
+ ] }), 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-red-200 bg-error-surface px-4 py-3 text-sm text-error dark:border-red-900/60", children: errorMessage })), _jsx(DataTable, { rows: rows, isLoading: isLoading, emptyLabel: "No bids found", renderRowActions: (row) => {
113
114
  const bidRow = row;
114
115
  const isCancelled = bidRow.status === "cancelled" || bidRow.status === "voided";
116
+ useBottomActions(selection.selectedCount > 0 ? { bulk: { selectedCount: selection.selectedCount, onClearSelection: selection.clearSelection, actions: [
117
+ { id: ROW_ACTION_ID.CANCEL, label: ACTIONS.ADMIN["cancel-bid"].label, variant: "secondary", onClick: () => { selection.clearSelection(); } },
118
+ ] } } : {});
115
119
  return (_jsx(RowActionMenu, { actions: [
116
120
  {
117
121
  label: ROW_ACTION_META[ROW_ACTION_ID.CANCEL].label,
@@ -13,6 +13,7 @@ import { ACTIONS } from "../../../_internal/shared/actions/action-registry";
13
13
  import { toRecordArray, toRelativeDate, toStringValue, useAdminListingData, } from "../hooks/useAdminListingData";
14
14
  import { DataTable } from "./DataTable";
15
15
  import { AdminBlogEditorView } from "./AdminBlogEditorView";
16
+ import { useBottomActions } from "../../layout";
16
17
  const PAGE_SIZE = 25;
17
18
  const FILTER_KEYS = ["status", "isFeatured"];
18
19
  const DEFAULT_SORT = "-publishedAt";
@@ -30,7 +31,7 @@ const FEATURED_TABS = [
30
31
  function BlogFilterDrawer({ filterOpen, setFilterOpen, activeFilterCount, clearFilters, pendingFilters, setPendingFilters, applyFilters, }) {
31
32
  if (!filterOpen)
32
33
  return null;
33
- return (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40 bg-black/40", "aria-hidden": "true", onClick: () => setFilterOpen(false) }), _jsxs("div", { className: "fixed inset-y-0 left-0 z-50 flex w-80 flex-col bg-white dark:bg-slate-900 shadow-2xl", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: [_jsx("span", { className: "text-base font-semibold text-zinc-900 dark:text-zinc-100", children: "Filters" }), _jsxs("div", { className: "flex items-center gap-2", children: [activeFilterCount > 0 && (_jsx("button", { type: "button", onClick: clearFilters, className: "text-xs text-zinc-500 hover:text-rose-500 dark:text-zinc-400 transition-colors", children: "Clear all" })), _jsx("button", { type: "button", onClick: () => setFilterOpen(false), "aria-label": "Close", className: "rounded-lg p-1.5 text-zinc-500 hover:bg-zinc-100 dark:hover:bg-slate-800 transition-colors", children: _jsx(X, { className: "h-5 w-5" }) })] })] }), _jsxs("div", { className: "flex-1 overflow-y-auto px-4 py-4 space-y-5", children: [_jsx(FilterChipGroup, { label: "Status", tabs: STATUS_OPTIONS, value: pendingFilters.status ?? "", onChange: (id) => setPendingFilters((p) => ({ ...p, status: id })) }), _jsx(FilterChipGroup, { label: "Featured", tabs: FEATURED_TABS, value: pendingFilters.isFeatured ?? "", onChange: (id) => setPendingFilters((p) => ({ ...p, isFeatured: id })), allId: "" })] }), _jsx("div", { className: "border-t border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: _jsxs("button", { type: "button", onClick: applyFilters, className: "w-full rounded-lg bg-primary py-2.5 text-sm font-semibold text-white hover:bg-primary-600 transition-colors active:scale-[0.98]", children: ["Apply Filters", activeFilterCount > 0 ? ` (${activeFilterCount})` : ""] }) })] })] }));
34
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40 bg-black/40", "aria-hidden": "true", onClick: () => setFilterOpen(false) }), _jsxs("div", { className: "fixed inset-y-0 left-0 z-50 flex w-80 flex-col bg-white dark:bg-slate-900 shadow-2xl", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: [_jsx("span", { className: "text-base font-semibold text-zinc-900 dark:text-zinc-100", children: "Filters" }), _jsxs("div", { className: "flex items-center gap-2", children: [activeFilterCount > 0 && (_jsx("button", { type: "button", onClick: clearFilters, className: "text-xs text-zinc-500 hover:text-rose-500 dark:text-zinc-400 transition-colors", children: "Clear all" })), _jsx("button", { type: "button", onClick: () => setFilterOpen(false), "aria-label": "Close", className: "rounded-lg p-1.5 text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors", children: _jsx(X, { className: "h-5 w-5" }) })] })] }), _jsxs("div", { className: "flex-1 overflow-y-auto px-4 py-4 space-y-5", children: [_jsx(FilterChipGroup, { label: "Status", tabs: STATUS_OPTIONS, value: pendingFilters.status ?? "", onChange: (id) => setPendingFilters((p) => ({ ...p, status: id })) }), _jsx(FilterChipGroup, { label: "Featured", tabs: FEATURED_TABS, value: pendingFilters.isFeatured ?? "", onChange: (id) => setPendingFilters((p) => ({ ...p, isFeatured: id })), allId: "" })] }), _jsx("div", { className: "border-t border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: _jsxs("button", { type: "button", onClick: applyFilters, className: "w-full rounded-lg bg-primary py-2.5 text-sm font-semibold text-white hover:bg-primary-600 transition-colors active:scale-[0.98]", children: ["Apply Filters", activeFilterCount > 0 ? ` (${activeFilterCount})` : ""] }) })] })] }));
34
35
  }
35
36
  export function AdminBlogView({ children, getRowHref, ...props }) {
36
37
  const hasChildren = React.Children.count(children) > 0;
@@ -105,8 +106,12 @@ export function AdminBlogView({ children, getRowHref, ...props }) {
105
106
  if (hasChildren) {
106
107
  return _jsx(ListingViewShell, { portal: "admin", ...props, children: children });
107
108
  }
109
+ useBottomActions(selection.selectedCount > 0 ? { bulk: { selectedCount: selection.selectedCount, onClearSelection: selection.clearSelection, actions: [
110
+ { id: "publish", label: ACTIONS.ADMIN["publish-blog"].label, variant: "primary", onClick: () => { selection.clearSelection(); } },
111
+ { id: "draft", label: ACTIONS.ADMIN["draft-blog"].label, variant: "secondary", onClick: () => { selection.clearSelection(); } },
112
+ ] } } : {});
108
113
  return (_jsxs("div", { className: "min-h-screen", children: [_jsx(Heading, { level: 1, className: "sr-only", children: "Blog Posts" }), _jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search articles, authors, or tags", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => { table.set("sort", v); }, showTableView: true, view: view, onViewChange: (v) => setView(v), onResetAll: resetAll, hasActiveState: hasActiveState, extra: _jsxs(Button, { size: "sm", onClick: openCreatePanel, className: "flex items-center gap-1.5", children: [_jsx(Plus, { className: "h-4 w-4" }), "New Post"] }) }), _jsx(BulkActionBar, { selectedCount: selection.selectedCount, onClearSelection: selection.clearSelection, actions: [
109
114
  { id: "publish", label: ACTIONS.ADMIN["publish-blog"].label, variant: "primary", onClick: () => { selection.clearSelection(); } },
110
115
  { id: "draft", label: ACTIONS.ADMIN["draft-blog"].label, variant: "secondary", onClick: () => { selection.clearSelection(); } },
111
- ] }), 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-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/40 dark:text-red-200", children: errorMessage })), view === "table" ? (_jsx(DataTable, { rows: rows, isLoading: isLoading, emptyLabel: "No blog posts found", selectedIds: selection.selectedIdSet, onToggleSelect: selection.toggle, onToggleSelectAll: (next) => next ? selection.setSelectedIds(rows.map(r => r.id)) : selection.clearSelection(), onRowClick: (row) => openEditPanel(row.id) })) : (_jsx(AdminViewCards, { rows: rows, view: view, isLoading: isLoading, emptyLabel: "No blog posts found", onRowClick: (row) => openEditPanel(row.id), selectedIdSet: selection.selectedIdSet, onToggleSelect: selection.toggle }))] }), _jsx(BlogFilterDrawer, { filterOpen: filterOpen, setFilterOpen: setFilterOpen, activeFilterCount: activeFilterCount, clearFilters: clearFilters, pendingFilters: pendingFilters, setPendingFilters: setPendingFilters, applyFilters: applyFilters }), _jsx(SideDrawer, { isOpen: isCreateOpen || isEditOpen, onClose: closePanel, title: isCreateOpen ? "New Post" : "Edit Post", mode: isCreateOpen ? "create" : "edit", children: (isCreateOpen || isEditOpen) && (_jsx(AdminBlogEditorView, { postId: editId ?? undefined, onSaved: closePanel, onDeleted: closePanel, embedded: true })) })] }));
116
+ ] }), 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-red-200 bg-error-surface px-4 py-3 text-sm text-error dark:border-red-900/60", children: errorMessage })), view === "table" ? (_jsx(DataTable, { rows: rows, isLoading: isLoading, emptyLabel: "No blog posts found", selectedIds: selection.selectedIdSet, onToggleSelect: selection.toggle, onToggleSelectAll: (next) => next ? selection.setSelectedIds(rows.map(r => r.id)) : selection.clearSelection(), onRowClick: (row) => openEditPanel(row.id) })) : (_jsx(AdminViewCards, { rows: rows, view: view, isLoading: isLoading, emptyLabel: "No blog posts found", onRowClick: (row) => openEditPanel(row.id), selectedIdSet: selection.selectedIdSet, onToggleSelect: selection.toggle }))] }), _jsx(BlogFilterDrawer, { filterOpen: filterOpen, setFilterOpen: setFilterOpen, activeFilterCount: activeFilterCount, clearFilters: clearFilters, pendingFilters: pendingFilters, setPendingFilters: setPendingFilters, applyFilters: applyFilters }), _jsx(SideDrawer, { isOpen: isCreateOpen || isEditOpen, onClose: closePanel, title: isCreateOpen ? "New Post" : "Edit Post", mode: isCreateOpen ? "create" : "edit", children: (isCreateOpen || isEditOpen) && (_jsx(AdminBlogEditorView, { postId: editId ?? undefined, onSaved: closePanel, onDeleted: closePanel, embedded: true })) })] }));
112
117
  }
@@ -12,6 +12,7 @@ import { ACTIONS } from "../../../_internal/shared/actions/action-registry";
12
12
  import { toRecordArray, toRelativeDate, toStringValue, useAdminListingData, } from "../hooks/useAdminListingData";
13
13
  import { DataTable } from "./DataTable";
14
14
  import { AdminBrandEditorView } from "./AdminBrandEditorView";
15
+ import { useBottomActions } from "../../layout";
15
16
  const PAGE_SIZE = 25;
16
17
  const FILTER_KEYS = ["isActive"];
17
18
  const DEFAULT_SORT = "displayOrder";
@@ -24,7 +25,7 @@ const SORT_OPTIONS = [
24
25
  function BrandsFilterDrawer({ filterOpen, setFilterOpen, activeFilterCount, clearFilters, pendingFilters, setPendingFilters, applyFilters, }) {
25
26
  if (!filterOpen)
26
27
  return null;
27
- return (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40 bg-black/40", "aria-hidden": "true", onClick: () => setFilterOpen(false) }), _jsxs("div", { className: "fixed inset-y-0 left-0 z-50 flex w-80 flex-col bg-white dark:bg-slate-900 shadow-2xl", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: [_jsx("span", { className: "text-base font-semibold text-zinc-900 dark:text-zinc-100", children: "Filters" }), _jsxs("div", { className: "flex items-center gap-2", children: [activeFilterCount > 0 && (_jsx("button", { type: "button", onClick: clearFilters, className: "text-xs text-zinc-500 hover:text-rose-500 dark:text-zinc-400 transition-colors", children: "Clear all" })), _jsx("button", { type: "button", onClick: () => setFilterOpen(false), "aria-label": "Close", className: "rounded-lg p-1.5 text-zinc-500 hover:bg-zinc-100 dark:hover:bg-slate-800 transition-colors", children: _jsx(X, { className: "h-5 w-5" }) })] })] }), _jsx("div", { className: "flex-1 overflow-y-auto px-4 py-4 space-y-5", children: _jsxs("div", { className: "space-y-2", children: [_jsx(Text, { className: "text-xs font-semibold uppercase tracking-widest text-zinc-500 dark:text-zinc-400", children: "Status" }), _jsx("div", { className: "flex flex-wrap gap-2", children: [{ label: "All", value: "" }, { label: "Active", value: "true" }, { label: "Inactive", value: "false" }].map((opt) => (_jsx("button", { type: "button", onClick: () => setPendingFilters((p) => ({ ...p, isActive: opt.value })), className: `rounded-full px-3 py-1 text-xs font-medium border transition-colors ${(pendingFilters.isActive || "") === opt.value ? "bg-primary text-white border-primary" : "border-zinc-300 dark:border-slate-600 text-zinc-700 dark:text-zinc-300 hover:bg-zinc-50 dark:hover:bg-slate-800"}`, children: opt.label }, opt.label))) })] }) }), _jsx("div", { className: "border-t border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: _jsxs("button", { type: "button", onClick: applyFilters, className: "w-full rounded-lg bg-primary py-2.5 text-sm font-semibold text-white hover:bg-primary-600 transition-colors active:scale-[0.98]", children: ["Apply Filters", activeFilterCount > 0 ? ` (${activeFilterCount})` : ""] }) })] })] }));
28
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40 bg-black/40", "aria-hidden": "true", onClick: () => setFilterOpen(false) }), _jsxs("div", { className: "fixed inset-y-0 left-0 z-50 flex w-80 flex-col bg-white dark:bg-slate-900 shadow-2xl", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: [_jsx("span", { className: "text-base font-semibold text-zinc-900 dark:text-zinc-100", children: "Filters" }), _jsxs("div", { className: "flex items-center gap-2", children: [activeFilterCount > 0 && (_jsx("button", { type: "button", onClick: clearFilters, className: "text-xs text-zinc-500 hover:text-rose-500 dark:text-zinc-400 transition-colors", children: "Clear all" })), _jsx("button", { type: "button", onClick: () => setFilterOpen(false), "aria-label": "Close", className: "rounded-lg p-1.5 text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors", children: _jsx(X, { className: "h-5 w-5" }) })] })] }), _jsx("div", { className: "flex-1 overflow-y-auto px-4 py-4 space-y-5", children: _jsxs("div", { className: "space-y-2", children: [_jsx(Text, { className: "text-xs font-semibold uppercase tracking-widest text-zinc-500 dark:text-zinc-400", children: "Status" }), _jsx("div", { className: "flex flex-wrap gap-2", children: [{ label: "All", value: "" }, { label: "Active", value: "true" }, { label: "Inactive", value: "false" }].map((opt) => (_jsx("button", { type: "button", onClick: () => setPendingFilters((p) => ({ ...p, isActive: opt.value })), className: `rounded-full px-3 py-1 text-xs font-medium border transition-colors ${(pendingFilters.isActive || "") === opt.value ? "bg-primary text-white border-primary" : "border-zinc-300 dark:border-slate-600 text-zinc-700 dark:text-zinc-300 hover:bg-zinc-50 dark:hover:bg-slate-800"}`, children: opt.label }, opt.label))) })] }) }), _jsx("div", { className: "border-t border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: _jsxs("button", { type: "button", onClick: applyFilters, className: "w-full rounded-lg bg-primary py-2.5 text-sm font-semibold text-white hover:bg-primary-600 transition-colors active:scale-[0.98]", children: ["Apply Filters", activeFilterCount > 0 ? ` (${activeFilterCount})` : ""] }) })] })] }));
28
29
  }
29
30
  export function AdminBrandsView({ children, ...props }) {
30
31
  const hasChildren = React.Children.count(children) > 0;
@@ -85,8 +86,12 @@ export function AdminBrandsView({ children, ...props }) {
85
86
  if (hasChildren) {
86
87
  return _jsx(ListingViewShell, { portal: "admin", ...props, children: children });
87
88
  }
89
+ useBottomActions(selection.selectedCount > 0 ? { bulk: { selectedCount: selection.selectedCount, onClearSelection: selection.clearSelection, actions: [
90
+ { id: "edit", label: ACTIONS.ADMIN["edit-brand"].label, variant: "primary", onClick: () => { const id = selection.selectedIds[0]; if (id)
91
+ openEditPanel(id); selection.clearSelection(); } },
92
+ ] } } : {});
88
93
  return (_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search brands by name or slug", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => { table.set("sort", v); }, showTableView: true, view: view, onViewChange: (v) => setView(v), onResetAll: resetAll, hasActiveState: hasActiveState, extra: _jsxs(Button, { size: "sm", onClick: openCreatePanel, className: "flex items-center gap-1.5", children: [_jsx(Plus, { className: "h-4 w-4" }), "Add Brand"] }) }), _jsx(BulkActionBar, { selectedCount: selection.selectedCount, onClearSelection: selection.clearSelection, actions: [
89
94
  { id: "edit", label: ACTIONS.ADMIN["edit-brand"].label, variant: "primary", onClick: () => { const id = selection.selectedIds[0]; if (id)
90
95
  openEditPanel(id); selection.clearSelection(); } },
91
- ] }), 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-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/40 dark:text-red-200", children: errorMessage })), view === "table" ? (_jsx(DataTable, { rows: rows, isLoading: isLoading, emptyLabel: "No brands found", selectedIds: selection.selectedIdSet, onToggleSelect: selection.toggle, onToggleSelectAll: (next) => next ? selection.setSelectedIds(rows.map(r => r.id)) : selection.clearSelection(), onRowClick: (row) => openEditPanel(row.id) })) : (_jsx(AdminViewCards, { rows: rows, view: view, isLoading: isLoading, emptyLabel: "No brands found", onRowClick: (row) => openEditPanel(row.id), selectedIdSet: selection.selectedIdSet, onToggleSelect: selection.toggle }))] }), _jsx(BrandsFilterDrawer, { filterOpen: filterOpen, setFilterOpen: setFilterOpen, activeFilterCount: activeFilterCount, clearFilters: clearFilters, pendingFilters: pendingFilters, setPendingFilters: setPendingFilters, applyFilters: applyFilters }), _jsx(SideDrawer, { isOpen: isCreateOpen || isEditOpen, onClose: closePanel, title: isCreateOpen ? "Add Brand" : "Edit Brand", mode: isCreateOpen ? "create" : "edit", children: (isCreateOpen || isEditOpen) && (_jsx(AdminBrandEditorView, { brandId: editId ?? undefined, onSaved: closePanel, onDeleted: closePanel, embedded: true })) })] }));
96
+ ] }), 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-red-200 bg-error-surface px-4 py-3 text-sm text-error dark:border-red-900/60", children: errorMessage })), view === "table" ? (_jsx(DataTable, { rows: rows, isLoading: isLoading, emptyLabel: "No brands found", selectedIds: selection.selectedIdSet, onToggleSelect: selection.toggle, onToggleSelectAll: (next) => next ? selection.setSelectedIds(rows.map(r => r.id)) : selection.clearSelection(), onRowClick: (row) => openEditPanel(row.id) })) : (_jsx(AdminViewCards, { rows: rows, view: view, isLoading: isLoading, emptyLabel: "No brands found", onRowClick: (row) => openEditPanel(row.id), selectedIdSet: selection.selectedIdSet, onToggleSelect: selection.toggle }))] }), _jsx(BrandsFilterDrawer, { filterOpen: filterOpen, setFilterOpen: setFilterOpen, activeFilterCount: activeFilterCount, clearFilters: clearFilters, pendingFilters: pendingFilters, setPendingFilters: setPendingFilters, applyFilters: applyFilters }), _jsx(SideDrawer, { isOpen: isCreateOpen || isEditOpen, onClose: closePanel, title: isCreateOpen ? "Add Brand" : "Edit Brand", mode: isCreateOpen ? "create" : "edit", children: (isCreateOpen || isEditOpen) && (_jsx(AdminBrandEditorView, { brandId: editId ?? undefined, onSaved: closePanel, onDeleted: closePanel, embedded: true })) })] }));
92
97
  }
@@ -13,7 +13,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  * static).
14
14
  */
15
15
  import { useCallback, useEffect, useMemo, useState } from "react";
16
- import { Button, Checkbox, ConfirmDeleteModal, Container, Heading, Input, Row, Section, Select, Stack, Text, Textarea, } from "../../../ui";
16
+ import { Button, Checkbox, ConfirmDeleteModal, Container, Heading, Input, Row, Section, Select, Stack, Text, Textarea, useToast, } from "../../../ui";
17
17
  import { FieldInput, FormShellContext, useFormShellState } from "../../../ui/forms";
18
18
  import { BundleItemsPicker, defaultBundleItemsFetch, } from "../../categories/components/BundleItemsPicker";
19
19
  import { BundleDynamicRuleEditor } from "../../categories/components/BundleDynamicRuleEditor";
@@ -81,6 +81,7 @@ export function AdminBundleEditorView({ bundleId, onSaved, onDeleted, }) {
81
81
  const [apiError, setApiError] = useState(null);
82
82
  const [metadata, setMetadata] = useState({});
83
83
  const { shellCtx, setFieldError, clearErrors } = useFormShellState();
84
+ const { showToast } = useToast();
84
85
  // Load existing bundle on mount when editing
85
86
  useEffect(() => {
86
87
  if (!bundleId)
@@ -160,6 +161,7 @@ export function AdminBundleEditorView({ bundleId, onSaved, onDeleted, }) {
160
161
  });
161
162
  if (!res.ok)
162
163
  throw new Error(`Update failed: ${res.status}`);
164
+ showToast("Bundle saved.", "success");
163
165
  onSaved?.(bundleId);
164
166
  }
165
167
  else {
@@ -173,19 +175,20 @@ export function AdminBundleEditorView({ bundleId, onSaved, onDeleted, }) {
173
175
  }
174
176
  const json = (await res.json());
175
177
  const newId = json?.data?.id;
178
+ showToast("Bundle created.", "success");
176
179
  if (newId)
177
180
  onSaved?.(newId);
178
181
  }
179
182
  }
180
183
  catch (err) {
181
- setApiError(err instanceof Error
182
- ? err.message
183
- : BUNDLE_COPY.adminEditor.errors.saveFailed);
184
+ const msg = err instanceof Error ? err.message : BUNDLE_COPY.adminEditor.errors.saveFailed;
185
+ setApiError(msg);
186
+ showToast(msg, "error");
184
187
  }
185
188
  finally {
186
189
  setSaving(false);
187
190
  }
188
- }, [form, bundleId, isEdit, onSaved, clearErrors, setFieldError]);
191
+ }, [form, bundleId, isEdit, onSaved, clearErrors, setFieldError, showToast]);
189
192
  const handleDelete = useCallback(async () => {
190
193
  if (!bundleId)
191
194
  return;
@@ -195,18 +198,19 @@ export function AdminBundleEditorView({ bundleId, onSaved, onDeleted, }) {
195
198
  const res = await fetch(`/api/admin/bundles/${encodeURIComponent(bundleId)}`, { method: "DELETE" });
196
199
  if (!res.ok)
197
200
  throw new Error(`Delete failed: ${res.status}`);
201
+ showToast("Bundle deleted.", "success");
198
202
  setDeleteConfirmOpen(false);
199
203
  onDeleted?.();
200
204
  }
201
205
  catch (err) {
202
- setApiError(err instanceof Error
203
- ? err.message
204
- : BUNDLE_COPY.adminEditor.errors.deleteFailed);
206
+ const msg = err instanceof Error ? err.message : BUNDLE_COPY.adminEditor.errors.deleteFailed;
207
+ setApiError(msg);
208
+ showToast(msg, "error");
205
209
  }
206
210
  finally {
207
211
  setDeleting(false);
208
212
  }
209
- }, [bundleId, onDeleted]);
213
+ }, [bundleId, onDeleted, showToast]);
210
214
  const fetchProducts = useMemo(() => defaultBundleItemsFetch, []);
211
215
  if (loading) {
212
216
  return (_jsx(Section, { className: "py-10", children: _jsx(Container, { size: "lg", children: _jsx(Text, { children: BUNDLE_COPY.adminEditor.loading }) }) }));