@mohasinac/appkit 3.8.2 → 3.9.0

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 (479) hide show
  1. package/dist/_internal/client/features/live/LiveItemDetailView.js +2 -2
  2. package/dist/_internal/client/features/lottery/LotteryAdminEditView.d.ts +4 -4
  3. package/dist/_internal/client/features/lottery/LotteryAdminEditView.js +8 -8
  4. package/dist/_internal/client/features/lottery/LotteryAdminSlotView.d.ts +1 -1
  5. package/dist/_internal/client/features/lottery/LotteryAdminSlotView.js +2 -2
  6. package/dist/_internal/server/features/bundles/actions.js +2 -2
  7. package/dist/_internal/server/features/bundles/og.d.ts +1 -1
  8. package/dist/_internal/server/features/bundles/og.js +4 -5
  9. package/dist/_internal/server/features/checkout/actions.js +57 -21
  10. package/dist/_internal/server/features/checkout/stock-restore.d.ts +19 -0
  11. package/dist/_internal/server/features/checkout/stock-restore.js +80 -0
  12. package/dist/_internal/server/features/checkout/upi-resolution.d.ts +11 -0
  13. package/dist/_internal/server/features/checkout/upi-resolution.js +28 -0
  14. package/dist/_internal/server/features/classified/og.js +1 -1
  15. package/dist/_internal/server/features/digital-code/og.js +1 -1
  16. package/dist/_internal/server/features/item-requests/og.d.ts +2 -2
  17. package/dist/_internal/server/features/item-requests/og.js +4 -5
  18. package/dist/_internal/server/features/live/og.js +1 -1
  19. package/dist/_internal/server/features/lottery/adapters.d.ts +2 -2
  20. package/dist/_internal/server/features/lottery/adapters.js +1 -1
  21. package/dist/_internal/server/features/orders/actions.d.ts +28 -0
  22. package/dist/_internal/server/features/orders/actions.js +239 -4
  23. package/dist/_internal/server/features/orders/adapters.js +3 -0
  24. package/dist/_internal/server/features/payments/data.js +3 -2
  25. package/dist/_internal/server/features/payouts/actions.d.ts +2 -2
  26. package/dist/_internal/server/features/payouts/actions.js +4 -3
  27. package/dist/_internal/server/features/pre-orders/service.d.ts +1 -1
  28. package/dist/_internal/server/features/pre-orders/service.js +3 -2
  29. package/dist/_internal/server/features/prize-draws/og.js +5 -5
  30. package/dist/_internal/server/features/products/og.js +1 -1
  31. package/dist/_internal/server/features/promotions/service.js +3 -1
  32. package/dist/_internal/server/features/refunds/actions.d.ts +2 -2
  33. package/dist/_internal/server/features/refunds/actions.js +7 -6
  34. package/dist/_internal/server/functions/firestore.js +1 -1
  35. package/dist/_internal/server/functions/scheduled.d.ts +4 -1
  36. package/dist/_internal/server/functions/scheduled.js +26 -2
  37. package/dist/_internal/server/jobs/core/emiInstallmentReminder.js +1 -1
  38. package/dist/_internal/server/jobs/core/hardBanCascade.d.ts +4 -0
  39. package/dist/_internal/server/jobs/core/hardBanCascade.js +15 -4
  40. package/dist/_internal/server/jobs/core/hardBanReinstatement.d.ts +16 -0
  41. package/dist/_internal/server/jobs/core/hardBanReinstatement.js +63 -0
  42. package/dist/_internal/server/jobs/core/jobRunners.js +3 -1
  43. package/dist/_internal/server/jobs/core/onScamReportCreate.js +1 -1
  44. package/dist/_internal/server/jobs/core/paymentReviewAutoApprove.d.ts +10 -0
  45. package/dist/_internal/server/jobs/core/paymentReviewAutoApprove.js +60 -0
  46. package/dist/_internal/server/jobs/core/paymentWindowTimeout.d.ts +15 -0
  47. package/dist/_internal/server/jobs/core/paymentWindowTimeout.js +59 -0
  48. package/dist/_internal/server/jobs/core/pendingOrderTimeout.d.ts +7 -0
  49. package/dist/_internal/server/jobs/core/pendingOrderTimeout.js +32 -6
  50. package/dist/_internal/server/jobs/handlers/hardBanReinstatement.d.ts +2 -0
  51. package/dist/_internal/server/jobs/handlers/hardBanReinstatement.js +2 -0
  52. package/dist/_internal/server/jobs/handlers/index.d.ts +3 -0
  53. package/dist/_internal/server/jobs/handlers/index.js +3 -0
  54. package/dist/_internal/server/jobs/handlers/messages.d.ts +4 -0
  55. package/dist/_internal/server/jobs/handlers/messages.js +4 -0
  56. package/dist/_internal/server/jobs/handlers/onShipmentAllocationSync.d.ts +3 -3
  57. package/dist/_internal/server/jobs/handlers/onShipmentAllocationSync.js +12 -12
  58. package/dist/_internal/server/jobs/handlers/onShipmentItemWrite.d.ts +1 -1
  59. package/dist/_internal/server/jobs/handlers/onShipmentItemWrite.js +5 -5
  60. package/dist/_internal/server/jobs/handlers/paymentReviewAutoApprove.d.ts +2 -0
  61. package/dist/_internal/server/jobs/handlers/paymentReviewAutoApprove.js +2 -0
  62. package/dist/_internal/server/jobs/handlers/paymentWindowTimeout.d.ts +2 -0
  63. package/dist/_internal/server/jobs/handlers/paymentWindowTimeout.js +2 -0
  64. package/dist/_internal/shared/actions/action-registry.js +27 -0
  65. package/dist/_internal/shared/checkout/order-math.js +3 -2
  66. package/dist/_internal/shared/checkout/rules/_defaults.js +1 -0
  67. package/dist/_internal/shared/checkout/rules/preorder.rule.js +7 -0
  68. package/dist/_internal/shared/checkout/rules/prize-draw.rule.js +7 -0
  69. package/dist/_internal/shared/checkout/rules/types.d.ts +11 -0
  70. package/dist/_internal/shared/features/auctions/errors.js +1 -1
  71. package/dist/_internal/shared/features/categories/bundle-copy.d.ts +0 -1
  72. package/dist/_internal/shared/features/categories/bundle-copy.js +0 -1
  73. package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +6 -6
  74. package/dist/_internal/shared/features/categories/bundle-schemas.js +2 -2
  75. package/dist/_internal/shared/features/checkout/config.d.ts +3 -3
  76. package/dist/_internal/shared/features/checkout/config.js +3 -3
  77. package/dist/_internal/shared/features/emi/schedule.d.ts +6 -6
  78. package/dist/_internal/shared/features/emi/schedule.js +10 -9
  79. package/dist/_internal/shared/features/promotions/errors.js +1 -1
  80. package/dist/_internal/shared/fees/calculator.d.ts +5 -5
  81. package/dist/_internal/shared/fees/calculator.js +19 -19
  82. package/dist/client.d.ts +1 -1
  83. package/dist/client.js +1 -1
  84. package/dist/constants/api-endpoints.d.ts +9 -0
  85. package/dist/constants/api-endpoints.js +3 -0
  86. package/dist/constants/field-names.d.ts +4 -0
  87. package/dist/constants/field-names.js +4 -0
  88. package/dist/features/admin/components/AdminArtView.js +2 -2
  89. package/dist/features/admin/components/AdminBidsView.js +2 -2
  90. package/dist/features/admin/components/AdminBundleEditorView.d.ts +1 -1
  91. package/dist/features/admin/components/AdminBundleEditorView.js +8 -8
  92. package/dist/features/admin/components/AdminBundlesView.js +6 -6
  93. package/dist/features/admin/components/AdminClassifiedView.js +2 -2
  94. package/dist/features/admin/components/AdminDigitalCodesView.js +2 -2
  95. package/dist/features/admin/components/AdminLiveView.js +2 -2
  96. package/dist/features/admin/components/AdminOrderEditorView.d.ts +6 -1
  97. package/dist/features/admin/components/AdminOrderEditorView.js +45 -5
  98. package/dist/features/admin/components/AdminOrdersView.js +8 -3
  99. package/dist/features/admin/components/AdminPayoutsView.js +2 -2
  100. package/dist/features/admin/components/AdminPrizeDrawsView.js +2 -2
  101. package/dist/features/admin/components/AdminReturnRequestsView.js +2 -2
  102. package/dist/features/admin/components/AdminSiteSettingsView.js +11 -11
  103. package/dist/features/admin/components/AdminStickersView.js +2 -2
  104. package/dist/features/admin/components/AdminSupportTicketDetailView.js +1 -1
  105. package/dist/features/admin/hooks/useAdminListingData.d.ts +1 -1
  106. package/dist/features/admin/hooks/useAdminListingData.js +3 -2
  107. package/dist/features/admin/schemas/firestore.d.ts +9 -7
  108. package/dist/features/admin/schemas/firestore.js +4 -3
  109. package/dist/features/auctions/components/AuctionBidsTable.js +3 -3
  110. package/dist/features/auth/checkout-value-otp.d.ts +46 -0
  111. package/dist/features/auth/checkout-value-otp.js +73 -0
  112. package/dist/features/auth/repository/user.repository.d.ts +6 -0
  113. package/dist/features/auth/repository/user.repository.js +19 -0
  114. package/dist/features/auth/schemas/firestore.d.ts +10 -0
  115. package/dist/features/auth/schemas/firestore.js +2 -0
  116. package/dist/features/cart/actions/cart-actions.d.ts +1 -1
  117. package/dist/features/cart/actions/cart-actions.js +4 -4
  118. package/dist/features/cart/components/CartView.d.ts +2 -2
  119. package/dist/features/cart/components/ShippingPicker.d.ts +4 -4
  120. package/dist/features/cart/components/ShippingPicker.js +11 -11
  121. package/dist/features/cart/repository/cart.repository.d.ts +1 -1
  122. package/dist/features/cart/repository/cart.repository.js +2 -2
  123. package/dist/features/cart/schemas/firestore.d.ts +2 -2
  124. package/dist/features/catalogue/components/CatalogueItemEditorView.js +3 -3
  125. package/dist/features/catalogue/components/PublicCatalogueView.js +2 -2
  126. package/dist/features/catalogue/schemas/validation.js +1 -1
  127. package/dist/features/categories/components/BundleCollage.js +2 -2
  128. package/dist/features/categories/components/BundleDetailView.js +2 -2
  129. package/dist/features/categories/components/BundleItemsPicker.d.ts +1 -1
  130. package/dist/features/categories/components/BundleItemsPicker.js +2 -2
  131. package/dist/features/categories/components/CategoryBundlesListing.js +2 -2
  132. package/dist/features/categories/schemas/firestore.d.ts +1 -1
  133. package/dist/features/categories/schemas/index.d.ts +3 -3
  134. package/dist/features/categories/schemas/index.js +2 -2
  135. package/dist/features/checkout/actions/checkout-value-otp-actions.d.ts +16 -0
  136. package/dist/features/checkout/actions/checkout-value-otp-actions.js +83 -0
  137. package/dist/features/checkout/actions/index.d.ts +1 -0
  138. package/dist/features/checkout/actions/index.js +1 -0
  139. package/dist/features/checkout/schemas/firestore.d.ts +1 -1
  140. package/dist/features/classified/components/index.d.ts +0 -4
  141. package/dist/features/classified/components/index.js +0 -2
  142. package/dist/features/digital-codes/components/index.d.ts +0 -4
  143. package/dist/features/digital-codes/components/index.js +0 -2
  144. package/dist/features/events/schemas/index.d.ts +1 -1
  145. package/dist/features/events/schemas/index.js +1 -1
  146. package/dist/features/homepage/components/FeaturedBundlesSection.js +2 -2
  147. package/dist/features/live/components/index.d.ts +0 -4
  148. package/dist/features/live/components/index.js +0 -2
  149. package/dist/features/lottery/types/index.d.ts +3 -3
  150. package/dist/features/lottery/types/index.js +5 -5
  151. package/dist/features/orders/components/OrderPaymentSummary.js +2 -2
  152. package/dist/features/orders/components/OrderSiblingPayments.js +1 -1
  153. package/dist/features/orders/components/RefundHistoryTable.js +1 -1
  154. package/dist/features/orders/components/RefundRequestView.js +1 -1
  155. package/dist/features/orders/constants/payment-window.d.ts +10 -0
  156. package/dist/features/orders/constants/payment-window.js +10 -0
  157. package/dist/features/orders/repository/orders.repository.d.ts +25 -0
  158. package/dist/features/orders/repository/orders.repository.js +50 -1
  159. package/dist/features/orders/schemas/firestore.d.ts +50 -2
  160. package/dist/features/orders/schemas/index.d.ts +24 -24
  161. package/dist/features/orders/schemas/index.js +20 -20
  162. package/dist/features/orders/types/index.d.ts +4 -0
  163. package/dist/features/orders/utils/bundle-grouping.d.ts +1 -1
  164. package/dist/features/orders/utils/bundle-grouping.js +1 -1
  165. package/dist/features/payments/schemas/index.d.ts +10 -10
  166. package/dist/features/payments/schemas/index.js +9 -9
  167. package/dist/features/pre-orders/components/PreOrderDetailPageView.js +2 -2
  168. package/dist/features/products/components/ArtStickersListView.d.ts +7 -0
  169. package/dist/features/products/components/ArtStickersListView.js +57 -0
  170. package/dist/features/products/components/GroupSettingsPanel.js +1 -1
  171. package/dist/features/products/components/MakeOfferButton.js +3 -3
  172. package/dist/features/products/components/MarketplaceBundleCard.d.ts +1 -1
  173. package/dist/features/products/components/MarketplaceBundleCard.js +2 -2
  174. package/dist/features/products/components/PrizeDrawCollage.js +2 -2
  175. package/dist/features/products/components/PrizeDrawItemsEditor.js +2 -2
  176. package/dist/features/products/components/PrizeRevealModal.js +1 -1
  177. package/dist/features/products/components/ProductDetailPageView.js +2 -9
  178. package/dist/features/products/components/ProductForm.js +2 -2
  179. package/dist/features/products/components/ProductGrid.js +2 -2
  180. package/dist/features/products/components/ProductsIndexListing.d.ts +13 -1
  181. package/dist/features/products/components/ProductsIndexListing.js +7 -5
  182. package/dist/features/products/components/ProductsIndexPageView.js +6 -1
  183. package/dist/features/products/constants/listing-tabs.d.ts +42 -17
  184. package/dist/features/products/constants/listing-tabs.js +25 -6
  185. package/dist/features/products/schemas/catalog-product.d.ts +5 -5
  186. package/dist/features/products/schemas/catalog-product.js +1 -1
  187. package/dist/features/products/schemas/firestore.d.ts +5 -5
  188. package/dist/features/products/schemas/firestore.js +2 -2
  189. package/dist/features/products/types/index.d.ts +5 -2
  190. package/dist/features/promotions/components/CouponCard.js +2 -2
  191. package/dist/features/promotions/schemas/firestore.d.ts +2 -0
  192. package/dist/features/promotions/schemas/firestore.js +1 -0
  193. package/dist/features/promotions/schemas/index.d.ts +14 -14
  194. package/dist/features/promotions/schemas/index.js +6 -6
  195. package/dist/features/scams/components/ScamProfileView.js +3 -7
  196. package/dist/features/scams/components/ScamRegistryView.js +2 -6
  197. package/dist/features/scams/schemas/firestore.d.ts +1 -1
  198. package/dist/features/search/components/Search.d.ts +1 -1
  199. package/dist/features/seller/actions/offer-actions.js +1 -1
  200. package/dist/features/seller/components/PrintCenterView.js +2 -2
  201. package/dist/features/seller/components/QuickProductForm.js +5 -5
  202. package/dist/features/seller/components/SellerArtView.js +2 -2
  203. package/dist/features/seller/components/SellerAuctionsView.js +2 -2
  204. package/dist/features/seller/components/SellerBidsView.js +2 -2
  205. package/dist/features/seller/components/SellerBundlesView.js +6 -6
  206. package/dist/features/seller/components/SellerClassifiedView.js +2 -2
  207. package/dist/features/seller/components/SellerDigitalCodesView.js +2 -2
  208. package/dist/features/seller/components/SellerLiveView.js +2 -2
  209. package/dist/features/seller/components/SellerOffersView.js +2 -2
  210. package/dist/features/seller/components/SellerOrdersView.js +3 -3
  211. package/dist/features/seller/components/SellerPayoutRequestView.js +2 -2
  212. package/dist/features/seller/components/SellerPayoutSettingsView.js +2 -2
  213. package/dist/features/seller/components/SellerPayoutsView.js +2 -2
  214. package/dist/features/seller/components/SellerPreOrdersView.js +2 -2
  215. package/dist/features/seller/components/SellerPrizeDrawsView.js +2 -2
  216. package/dist/features/seller/components/SellerProductShell.js +8 -8
  217. package/dist/features/seller/components/SellerProductsView.js +1 -1
  218. package/dist/features/seller/components/SellerShippingView.js +6 -6
  219. package/dist/features/seller/components/SellerStickersView.js +2 -2
  220. package/dist/features/seller/hooks/useSellerListingData.d.ts +1 -1
  221. package/dist/features/seller/hooks/useSellerListingData.js +3 -2
  222. package/dist/features/shipments/components/AdminShipmentEditorView.js +10 -10
  223. package/dist/features/shipments/components/AdminShipmentLotItemsView.js +4 -4
  224. package/dist/features/shipments/components/AdminShipmentProjectionsView.js +5 -5
  225. package/dist/features/shipments/components/AdminShipmentsView.js +4 -4
  226. package/dist/features/shipments/repository/shipment-lots.repository.d.ts +2 -2
  227. package/dist/features/shipments/repository/shipment-lots.repository.js +8 -8
  228. package/dist/features/shipments/schemas/firestore.d.ts +21 -21
  229. package/dist/features/shipments/schemas/firestore.js +9 -9
  230. package/dist/features/shipments/schemas/validation.d.ts +30 -30
  231. package/dist/features/shipments/schemas/validation.js +6 -6
  232. package/dist/features/shipments/utils/cost-allocation.d.ts +5 -5
  233. package/dist/features/shipments/utils/cost-allocation.js +39 -38
  234. package/dist/features/store-extensions/schemas/firestore.d.ts +5 -5
  235. package/dist/features/stores/components/StoreDetailLayoutView.js +9 -13
  236. package/dist/features/stores/schemas/firestore.d.ts +7 -7
  237. package/dist/features/stores/schemas/index.d.ts +84 -84
  238. package/dist/features/stores/schemas/index.js +5 -5
  239. package/dist/features/tester/seed-data/categories-tester-seed-data.js +1 -1
  240. package/dist/features/tester/seed-data/products-tester-seed-data.js +6 -6
  241. package/dist/features/tester/seed-data/tester-checklist-seed-data.js +9 -2
  242. package/dist/features/whatsapp-bot/helpers/whatsapp.d.ts +8 -1
  243. package/dist/features/whatsapp-bot/helpers/whatsapp.js +13 -2
  244. package/dist/features/whatsapp-bot/types/index.d.ts +9 -1
  245. package/dist/index.d.ts +3 -7
  246. package/dist/index.js +7 -5
  247. package/dist/next/routing/route-map.d.ts +2 -0
  248. package/dist/next/routing/route-map.js +6 -0
  249. package/dist/schemas/firestore-helpers.d.ts +2 -2
  250. package/dist/schemas/firestore-helpers.js +2 -2
  251. package/dist/schemas/registry.d.ts +73 -73
  252. package/dist/seed/bids-seed-data.js +6 -6
  253. package/dist/seed/blog-posts-seed-data.js +1 -0
  254. package/dist/seed/cart-seed-data.js +13 -13
  255. package/dist/seed/catalogue-seed-data.js +6 -6
  256. package/dist/seed/categories-seed-data.js +5 -5
  257. package/dist/seed/claimed-coupons-seed-data.js +3 -3
  258. package/dist/seed/coupons-seed-data.js +20 -20
  259. package/dist/seed/events-seed-data.js +27 -27
  260. package/dist/seed/factories/bid.factory.js +1 -1
  261. package/dist/seed/faq-seed-data.js +20 -1
  262. package/dist/seed/grouped-listings-seed-data.d.ts +2 -2
  263. package/dist/seed/grouped-listings-seed-data.js +3 -3
  264. package/dist/seed/offers-seed-data.js +19 -19
  265. package/dist/seed/orders-seed-data.js +29 -29
  266. package/dist/seed/payouts-seed-data.js +7 -7
  267. package/dist/seed/products-auctions-seed-data.js +6 -6
  268. package/dist/seed/products-preorders-seed-data.d.ts +2 -2
  269. package/dist/seed/products-preorders-seed-data.js +1 -1
  270. package/dist/seed/products-standard-seed-data.js +8 -8
  271. package/dist/seed/scammers-seed-data.js +2 -2
  272. package/dist/seed/shipments-seed-data.js +29 -29
  273. package/dist/seed/site-settings-seed-data.js +3 -2
  274. package/dist/seed/store-extensions-seed-data.js +8 -8
  275. package/dist/seed/stores-seed-data.js +37 -8
  276. package/dist/seed/users-seed-data.js +38 -1
  277. package/dist/server-entry.d.ts +1 -3
  278. package/dist/server-entry.js +1 -3
  279. package/dist/server.d.ts +2 -1
  280. package/dist/server.js +3 -1
  281. package/dist/ui/components/PriceDisplay.js +3 -12
  282. package/dist/utils/number.formatter.d.ts +2 -7
  283. package/dist/utils/number.formatter.js +3 -8
  284. package/package.json +1 -1
  285. package/scripts/seed-cli.mjs +8 -3
  286. package/dist/_internal/client/scaffolds/DashboardScaffold.d.ts +0 -34
  287. package/dist/_internal/client/scaffolds/DashboardScaffold.js +0 -26
  288. package/dist/_internal/client/theme/__tests__/ThemeProvider.test.d.ts +0 -1
  289. package/dist/_internal/client/theme/__tests__/ThemeProvider.test.js +0 -109
  290. package/dist/_internal/server/features/auctions/__tests__/service.test.d.ts +0 -1
  291. package/dist/_internal/server/features/auctions/__tests__/service.test.js +0 -140
  292. package/dist/_internal/server/features/checkout/__tests__/actions.test.d.ts +0 -1
  293. package/dist/_internal/server/features/checkout/__tests__/actions.test.js +0 -600
  294. package/dist/_internal/server/features/refunds/__tests__/actions.test.d.ts +0 -1
  295. package/dist/_internal/server/features/refunds/__tests__/actions.test.js +0 -263
  296. package/dist/_internal/server/jobs/core/__tests__/auctionSettlement.test.d.ts +0 -1
  297. package/dist/_internal/server/jobs/core/__tests__/auctionSettlement.test.js +0 -249
  298. package/dist/_internal/server/jobs/core/__tests__/couponExpiry.test.d.ts +0 -1
  299. package/dist/_internal/server/jobs/core/__tests__/couponExpiry.test.js +0 -65
  300. package/dist/_internal/server/jobs/core/__tests__/listingProcessor.test.d.ts +0 -1
  301. package/dist/_internal/server/jobs/core/__tests__/listingProcessor.test.js +0 -163
  302. package/dist/_internal/server/jobs/core/__tests__/mediaTmpCleanup.test.d.ts +0 -1
  303. package/dist/_internal/server/jobs/core/__tests__/mediaTmpCleanup.test.js +0 -115
  304. package/dist/_internal/server/jobs/core/__tests__/onBidPlaced.test.d.ts +0 -1
  305. package/dist/_internal/server/jobs/core/__tests__/onBidPlaced.test.js +0 -201
  306. package/dist/_internal/server/jobs/core/__tests__/onOrderCreate.test.d.ts +0 -1
  307. package/dist/_internal/server/jobs/core/__tests__/onOrderCreate.test.js +0 -169
  308. package/dist/_internal/server/jobs/core/__tests__/onOrderStatusChange.test.d.ts +0 -1
  309. package/dist/_internal/server/jobs/core/__tests__/onOrderStatusChange.test.js +0 -148
  310. package/dist/_internal/server/jobs/core/__tests__/onProductStockChange.test.d.ts +0 -1
  311. package/dist/_internal/server/jobs/core/__tests__/onProductStockChange.test.js +0 -210
  312. package/dist/_internal/server/jobs/core/__tests__/onReviewWrite.test.d.ts +0 -1
  313. package/dist/_internal/server/jobs/core/__tests__/onReviewWrite.test.js +0 -190
  314. package/dist/_internal/server/jobs/core/__tests__/onUserBanChange.test.d.ts +0 -1
  315. package/dist/_internal/server/jobs/core/__tests__/onUserBanChange.test.js +0 -161
  316. package/dist/_internal/server/jobs/core/__tests__/payoutBatch.test.d.ts +0 -1
  317. package/dist/_internal/server/jobs/core/__tests__/payoutBatch.test.js +0 -302
  318. package/dist/_internal/server/jobs/core/__tests__/pendingOrderTimeout.test.d.ts +0 -1
  319. package/dist/_internal/server/jobs/core/__tests__/pendingOrderTimeout.test.js +0 -96
  320. package/dist/_internal/server/jobs/core/__tests__/triggerEventRaffle.test.d.ts +0 -1
  321. package/dist/_internal/server/jobs/core/__tests__/triggerEventRaffle.test.js +0 -252
  322. package/dist/_internal/server/jobs/core/__tests__/wrapJobHandler.test.d.ts +0 -1
  323. package/dist/_internal/server/jobs/core/__tests__/wrapJobHandler.test.js +0 -129
  324. package/dist/_internal/server/jobs/core/onCatalogueSubmittedForApproval.d.ts +0 -15
  325. package/dist/_internal/server/jobs/core/onCatalogueSubmittedForApproval.js +0 -38
  326. package/dist/_internal/server/providers/index.d.ts +0 -11
  327. package/dist/_internal/server/providers/index.js +0 -11
  328. package/dist/_internal/server/providers/payment/razorpay-mock.d.ts +0 -52
  329. package/dist/_internal/server/providers/payment/razorpay-mock.js +0 -118
  330. package/dist/_internal/server/providers/resolve.d.ts +0 -36
  331. package/dist/_internal/server/providers/resolve.js +0 -31
  332. package/dist/_internal/server/providers/shipping/shiprocket-mock.d.ts +0 -29
  333. package/dist/_internal/server/providers/shipping/shiprocket-mock.js +0 -152
  334. package/dist/_internal/shared/types/__tests__/action-result.test.d.ts +0 -1
  335. package/dist/_internal/shared/types/__tests__/action-result.test.js +0 -65
  336. package/dist/errors/__tests__/error-mapping.test.d.ts +0 -1
  337. package/dist/errors/__tests__/error-mapping.test.js +0 -122
  338. package/dist/errors/__tests__/safe-read.test.d.ts +0 -1
  339. package/dist/errors/__tests__/safe-read.test.js +0 -39
  340. package/dist/features/addresses/repository/__tests__/addresses.repository.test.d.ts +0 -1
  341. package/dist/features/addresses/repository/__tests__/addresses.repository.test.js +0 -386
  342. package/dist/features/admin/components/AdminListingScaffold.d.ts +0 -41
  343. package/dist/features/admin/components/AdminListingScaffold.js +0 -68
  344. package/dist/features/admin/components/QuickActionsPanel.d.ts +0 -15
  345. package/dist/features/admin/components/QuickActionsPanel.js +0 -5
  346. package/dist/features/admin/repository/__tests__/notification.repository.test.d.ts +0 -1
  347. package/dist/features/admin/repository/__tests__/notification.repository.test.js +0 -356
  348. package/dist/features/admin/repository/__tests__/site-settings.repository.test.d.ts +0 -1
  349. package/dist/features/admin/repository/__tests__/site-settings.repository.test.js +0 -298
  350. package/dist/features/auctions/repository/__tests__/bid.repository.test.d.ts +0 -1
  351. package/dist/features/auctions/repository/__tests__/bid.repository.test.js +0 -290
  352. package/dist/features/auctions/repository/auctions.repository.d.ts +0 -12
  353. package/dist/features/auctions/repository/auctions.repository.js +0 -42
  354. package/dist/features/auth/repository/__tests__/session.repository.test.d.ts +0 -1
  355. package/dist/features/auth/repository/__tests__/session.repository.test.js +0 -310
  356. package/dist/features/auth/repository/__tests__/session.test.d.ts +0 -1
  357. package/dist/features/auth/repository/__tests__/session.test.js +0 -146
  358. package/dist/features/auth/repository/__tests__/sms-counter.repository.test.d.ts +0 -1
  359. package/dist/features/auth/repository/__tests__/sms-counter.repository.test.js +0 -171
  360. package/dist/features/auth/repository/__tests__/sms-counter.test.d.ts +0 -1
  361. package/dist/features/auth/repository/__tests__/sms-counter.test.js +0 -88
  362. package/dist/features/auth/repository/__tests__/token.repository.test.d.ts +0 -1
  363. package/dist/features/auth/repository/__tests__/token.repository.test.js +0 -260
  364. package/dist/features/auth/repository/__tests__/token.test.d.ts +0 -1
  365. package/dist/features/auth/repository/__tests__/token.test.js +0 -140
  366. package/dist/features/auth/repository/__tests__/user.repository.test.d.ts +0 -1
  367. package/dist/features/auth/repository/__tests__/user.repository.test.js +0 -352
  368. package/dist/features/auth/repository/__tests__/user.test.d.ts +0 -1
  369. package/dist/features/auth/repository/__tests__/user.test.js +0 -226
  370. package/dist/features/before-after/repository/before-after.repository.d.ts +0 -13
  371. package/dist/features/before-after/repository/before-after.repository.js +0 -36
  372. package/dist/features/before-after/server.d.ts +0 -6
  373. package/dist/features/before-after/server.js +0 -6
  374. package/dist/features/cart/repository/__tests__/cart.repository.test.d.ts +0 -1
  375. package/dist/features/cart/repository/__tests__/cart.repository.test.js +0 -371
  376. package/dist/features/categories/repository/__tests__/categories.repository.test.d.ts +0 -1
  377. package/dist/features/categories/repository/__tests__/categories.repository.test.js +0 -813
  378. package/dist/features/collections/repository/collections.repository.d.ts +0 -8
  379. package/dist/features/collections/repository/collections.repository.js +0 -16
  380. package/dist/features/collections/server.d.ts +0 -6
  381. package/dist/features/collections/server.js +0 -6
  382. package/dist/features/events/repository/__tests__/event.repository.test.d.ts +0 -1
  383. package/dist/features/events/repository/__tests__/event.repository.test.js +0 -299
  384. package/dist/features/faq/repository/__tests__/faqs.repository.test.d.ts +0 -1
  385. package/dist/features/faq/repository/__tests__/faqs.repository.test.js +0 -311
  386. package/dist/features/forms/Form.d.ts +0 -25
  387. package/dist/features/forms/Form.js +0 -37
  388. package/dist/features/history/repository/__tests__/user-history.repository.test.d.ts +0 -1
  389. package/dist/features/history/repository/__tests__/user-history.repository.test.js +0 -180
  390. package/dist/features/homepage/repository/__tests__/carousel.repository.test.d.ts +0 -1
  391. package/dist/features/homepage/repository/__tests__/carousel.repository.test.js +0 -182
  392. package/dist/features/homepage/repository/__tests__/homepage-sections.repository.test.d.ts +0 -1
  393. package/dist/features/homepage/repository/__tests__/homepage-sections.repository.test.js +0 -185
  394. package/dist/features/layout/ListingLayout.d.ts +0 -34
  395. package/dist/features/layout/ListingLayout.js +0 -103
  396. package/dist/features/messages/repository/__tests__/conversations.repository.test.d.ts +0 -1
  397. package/dist/features/messages/repository/__tests__/conversations.repository.test.js +0 -257
  398. package/dist/features/orders/repository/__tests__/orders.repository.test.d.ts +0 -1
  399. package/dist/features/orders/repository/__tests__/orders.repository.test.js +0 -211
  400. package/dist/features/payments/repository/__tests__/payout.repository.test.d.ts +0 -1
  401. package/dist/features/payments/repository/__tests__/payout.repository.test.js +0 -292
  402. package/dist/features/pre-orders/repository/preorders.repository.d.ts +0 -8
  403. package/dist/features/pre-orders/repository/preorders.repository.js +0 -25
  404. package/dist/features/products/repository/__tests__/product-features.repository.test.d.ts +0 -1
  405. package/dist/features/products/repository/__tests__/product-features.repository.test.js +0 -329
  406. package/dist/features/products/repository/__tests__/products.repository.test.d.ts +0 -1
  407. package/dist/features/products/repository/__tests__/products.repository.test.js +0 -607
  408. package/dist/features/promotions/repository/__tests__/claimed-coupons.repository.test.d.ts +0 -1
  409. package/dist/features/promotions/repository/__tests__/claimed-coupons.repository.test.js +0 -219
  410. package/dist/features/promotions/repository/__tests__/coupons.repository.test.d.ts +0 -1
  411. package/dist/features/promotions/repository/__tests__/coupons.repository.test.js +0 -480
  412. package/dist/features/promotions/repository/promotions.repository.d.ts +0 -14
  413. package/dist/features/promotions/repository/promotions.repository.js +0 -43
  414. package/dist/features/reviews/repository/__tests__/reviews.repository.test.d.ts +0 -1
  415. package/dist/features/reviews/repository/__tests__/reviews.repository.test.js +0 -327
  416. package/dist/features/scams/repository/__tests__/scammer.repository.test.d.ts +0 -1
  417. package/dist/features/scams/repository/__tests__/scammer.repository.test.js +0 -385
  418. package/dist/features/search/repository/__tests__/search.repository.test.d.ts +0 -1
  419. package/dist/features/search/repository/__tests__/search.repository.test.js +0 -369
  420. package/dist/features/seller/components/SellerStatCard.d.ts +0 -14
  421. package/dist/features/seller/components/SellerStatCard.js +0 -6
  422. package/dist/features/seller/components/seller-products-styles.d.ts +0 -7
  423. package/dist/features/seller/components/seller-products-styles.js +0 -14
  424. package/dist/features/seller/repository/__tests__/offer.repository.test.d.ts +0 -1
  425. package/dist/features/seller/repository/__tests__/offer.repository.test.js +0 -458
  426. package/dist/features/seller/repository/seller.repository.d.ts +0 -22
  427. package/dist/features/seller/repository/seller.repository.js +0 -72
  428. package/dist/features/site-settings/components/__tests__/ThemeManagerView.test.d.ts +0 -1
  429. package/dist/features/site-settings/components/__tests__/ThemeManagerView.test.js +0 -37
  430. package/dist/features/stores/repository/__tests__/store.repository.test.d.ts +0 -1
  431. package/dist/features/stores/repository/__tests__/store.repository.test.js +0 -261
  432. package/dist/features/stores/repository/stores.repository.d.ts +0 -11
  433. package/dist/features/stores/repository/stores.repository.js +0 -37
  434. package/dist/features/support/repository/__tests__/support.repository.test.d.ts +0 -1
  435. package/dist/features/support/repository/__tests__/support.repository.test.js +0 -312
  436. package/dist/features/wishlist/repository/__tests__/user-wishlist.repository.test.d.ts +0 -1
  437. package/dist/features/wishlist/repository/__tests__/user-wishlist.repository.test.js +0 -139
  438. package/dist/features/wishlist/repository/wishlist.repository.d.ts +0 -13
  439. package/dist/features/wishlist/repository/wishlist.repository.js +0 -31
  440. package/dist/providers/db-firebase/__tests__/filter-aliases.test.d.ts +0 -1
  441. package/dist/providers/db-firebase/__tests__/filter-aliases.test.js +0 -93
  442. package/dist/providers/shipping-shiprocket/index.d.ts +0 -297
  443. package/dist/providers/shipping-shiprocket/index.js +0 -194
  444. package/dist/providers/shipping-shiprocket/shiprocket-provider.d.ts +0 -45
  445. package/dist/providers/shipping-shiprocket/shiprocket-provider.js +0 -168
  446. package/dist/react/contexts/ThemeContext.d.ts +0 -13
  447. package/dist/react/contexts/ThemeContext.js +0 -64
  448. package/dist/schemas/webhooks/shiprocket.d.ts +0 -30
  449. package/dist/schemas/webhooks/shiprocket.js +0 -22
  450. package/dist/seed/actions/demo-seed-actions.d.ts +0 -42
  451. package/dist/seed/actions/demo-seed-actions.js +0 -36
  452. package/dist/seed/actions/index.d.ts +0 -1
  453. package/dist/seed/actions/index.js +0 -1
  454. package/dist/seed/sub-listings-seed-data.d.ts +0 -123
  455. package/dist/seed/sub-listings-seed-data.js +0 -447
  456. package/dist/seed/tester-checklist-seed-data.d.ts +0 -2
  457. package/dist/seed/tester-checklist-seed-data.js +0 -248
  458. package/dist/ui/components/DashboardStatsCard.d.ts +0 -15
  459. package/dist/ui/components/DashboardStatsCard.js +0 -27
  460. package/dist/ui/components/DashboardStatsCard.style.css +0 -68
  461. package/dist/ui/components/DynamicSelect.d.ts +0 -23
  462. package/dist/ui/components/DynamicSelect.js +0 -77
  463. package/dist/ui/components/DynamicSelect.style.css +0 -101
  464. package/dist/ui/components/InlineCreateSelect.d.ts +0 -48
  465. package/dist/ui/components/InlineCreateSelect.js +0 -75
  466. package/dist/ui/components/ListingViewShell.d.ts +0 -37
  467. package/dist/ui/components/ListingViewShell.js +0 -9
  468. package/dist/ui/components/PaginatedMultiSelect.d.ts +0 -28
  469. package/dist/ui/components/PaginatedMultiSelect.js +0 -141
  470. package/dist/ui/components/PaginatedMultiSelect.style.css +0 -272
  471. package/dist/ui/components/SectionTabs.d.ts +0 -19
  472. package/dist/ui/components/SectionTabs.js +0 -66
  473. package/dist/ui/components/SectionTabs.style.css +0 -164
  474. package/dist/ui/components/__tests__/BulkActionBar.test.d.ts +0 -1
  475. package/dist/ui/components/__tests__/BulkActionBar.test.js +0 -96
  476. package/dist/ui/components/__tests__/ListingToolbar.test.d.ts +0 -1
  477. package/dist/ui/components/__tests__/ListingToolbar.test.js +0 -125
  478. package/dist/ui/components/__tests__/new-primitives.test.d.ts +0 -1
  479. package/dist/ui/components/__tests__/new-primitives.test.js +0 -187
@@ -1,164 +0,0 @@
1
- .appkit-section-tabs {
2
- position: sticky;
3
- top: var(--header-height, 0px);
4
- z-index: var(--appkit-z-raised);
5
- background: var(--appkit-color-surface);
6
- border-bottom: 1px solid var(--appkit-color-border);
7
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
8
- }
9
-
10
- .dark .appkit-section-tabs {
11
- background: var(--appkit-color-bg);
12
- border-bottom-color: var(--appkit-color-border);
13
- }
14
-
15
- .appkit-section-tabs--admin {
16
- background-image: linear-gradient(to right, rgba(250, 245, 255, 0.75), transparent, rgba(238, 242, 255, 0.45));
17
- }
18
-
19
- .appkit-section-tabs--user {
20
- background-image: linear-gradient(to right, rgba(238, 242, 255, 0.75), transparent, rgba(240, 253, 250, 0.45));
21
- }
22
-
23
- .dark .appkit-section-tabs--admin {
24
- background-image: linear-gradient(to right, rgba(88, 28, 135, 0.2), transparent, rgba(49, 46, 129, 0.12));
25
- }
26
-
27
- .dark .appkit-section-tabs--user {
28
- background-image: linear-gradient(to right, rgba(30, 58, 138, 0.2), transparent, rgba(19, 78, 74, 0.12));
29
- }
30
-
31
- .appkit-section-tabs__container {
32
- width: min(80rem, 100%);
33
- margin: 0 auto;
34
- }
35
-
36
- .appkit-section-tabs__scroll {
37
- overflow-x: auto;
38
- -ms-overflow-style: none;
39
- scrollbar-width: none;
40
- touch-action: pan-x;
41
- padding-bottom: 0.125rem;
42
- }
43
-
44
- .appkit-section-tabs__scroll::-webkit-scrollbar {
45
- display: none;
46
- }
47
-
48
- .appkit-section-tabs__scroll--padded {
49
- padding-left: 0.5rem;
50
- padding-right: 0.5rem;
51
- }
52
-
53
- @media (min-width: 768px) {
54
- .appkit-section-tabs__scroll--padded {
55
- padding-left: 1rem;
56
- padding-right: 1rem;
57
- }
58
- }
59
-
60
- .appkit-section-tabs__track {
61
- display: flex;
62
- min-width: max-content;
63
- }
64
-
65
- @media (min-width: 1024px) {
66
- .appkit-section-tabs__track--full {
67
- min-width: 0;
68
- width: 100%;
69
- }
70
- }
71
-
72
- .appkit-section-tabs__tab {
73
- display: inline-flex;
74
- align-items: center;
75
- justify-content: center;
76
- gap: 0.375rem;
77
- flex: 1;
78
- min-width: fit-content;
79
- flex-shrink: 0;
80
- white-space: nowrap;
81
- font-size: 0.875rem;
82
- font-weight: 500;
83
- border: 1px solid transparent;
84
- border-radius: 9999px;
85
- padding: 0.625rem 1rem;
86
- transition: all 0.2s ease;
87
- }
88
-
89
- @media (min-width: 640px) {
90
- .appkit-section-tabs__tab {
91
- padding-left: 1.25rem;
92
- padding-right: 1.25rem;
93
- }
94
- }
95
-
96
- .appkit-section-tabs__tab:focus-visible {
97
- outline: none;
98
- box-shadow: 0 0 0 2px rgba(101, 196, 8, 0.55);
99
- }
100
-
101
- .dark .appkit-section-tabs__tab:focus-visible {
102
- box-shadow: 0 0 0 2px rgba(240, 99, 185, 0.6);
103
- }
104
-
105
- .appkit-section-tabs__tab--active {
106
- border-color: rgba(80, 156, 2, 0.35);
107
- background: var(--appkit-color-secondary-600);
108
- color: var(--appkit-color-text-on-primary);
109
- box-shadow: 0 10px 24px -12px rgba(34, 197, 94, 0.7);
110
- }
111
-
112
- .dark .appkit-section-tabs__tab--active {
113
- border-color: rgba(233, 30, 140, 0.4);
114
- background: var(--appkit-color-primary);
115
- color: var(--appkit-color-text-on-primary);
116
- box-shadow: 0 10px 24px -12px rgba(236, 72, 153, 0.9);
117
- }
118
-
119
- .appkit-section-tabs__tab--inactive {
120
- border-color: rgba(80, 156, 2, 0.2);
121
- background: rgba(80, 156, 2, 0.1);
122
- color: var(--appkit-color-secondary-600);
123
- }
124
-
125
- .appkit-section-tabs__tab--inactive:hover {
126
- background: rgba(80, 156, 2, 0.18);
127
- }
128
-
129
- .dark .appkit-section-tabs__tab--inactive {
130
- border-color: var(--appkit-color-border);
131
- background: rgba(30, 41, 59, 0.8);
132
- color: var(--appkit-color-primary-300);
133
- }
134
-
135
- .dark .appkit-section-tabs__tab--inactive:hover {
136
- background: rgba(51, 65, 85, 0.9);
137
- color: var(--appkit-color-primary-100);
138
- }
139
-
140
- .appkit-section-tabs__icon {
141
- flex-shrink: 0;
142
- }
143
-
144
- .appkit-section-tabs__count {
145
- flex-shrink: 0;
146
- font-size: 0.75rem;
147
- padding: 0.125rem 0.375rem;
148
- border-radius: 9999px;
149
- }
150
-
151
- .appkit-section-tabs__count--active {
152
- background: rgba(255, 255, 255, 0.2);
153
- color: var(--appkit-color-text-on-primary);
154
- }
155
-
156
- .appkit-section-tabs__count--inactive {
157
- background: var(--appkit-color-zinc-100);
158
- color: var(--appkit-color-zinc-500);
159
- }
160
-
161
- .dark .appkit-section-tabs__count--inactive {
162
- background: var(--appkit-color-slate-700);
163
- color: var(--appkit-color-slate-300);
164
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,96 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { render, screen, fireEvent } from "@testing-library/react";
3
- import { describe, it, expect, vi } from "vitest";
4
- import { BulkActionBar } from "../BulkActionBar";
5
- const actions = [
6
- { id: "publish", label: "Publish", onClick: vi.fn() },
7
- { id: "delete", label: "Delete", variant: "danger", onClick: vi.fn() },
8
- ];
9
- describe("BulkActionBar", () => {
10
- it("renders nothing when selectedCount is 0", () => {
11
- render(_jsx(BulkActionBar, { selectedCount: 0, actions: actions }));
12
- expect(screen.queryByTestId("bulk-action-bar")).toBeNull();
13
- });
14
- it("renders the bar when selectedCount > 0", () => {
15
- render(_jsx(BulkActionBar, { selectedCount: 3, actions: actions }));
16
- expect(screen.getByTestId("bulk-action-bar")).toBeTruthy();
17
- });
18
- it("shows the selected count in the count pill", () => {
19
- render(_jsx(BulkActionBar, { selectedCount: 5, actions: actions }));
20
- expect(screen.getByTestId("bulk-selected-count").textContent).toContain("5");
21
- });
22
- it("calls onClearSelection when the count pill button is clicked", () => {
23
- const onClear = vi.fn();
24
- render(_jsx(BulkActionBar, { selectedCount: 2, actions: actions, onClearSelection: onClear }));
25
- fireEvent.click(screen.getByRole("button", { name: /clear selection/i }));
26
- expect(onClear).toHaveBeenCalledOnce();
27
- });
28
- it("renders no action buttons when actions array is empty", () => {
29
- render(_jsx(BulkActionBar, { selectedCount: 1, actions: [] }));
30
- expect(screen.queryByRole("button", { name: /apply/i })).toBeNull();
31
- });
32
- it("renders the picker trigger and apply button when actions are provided", () => {
33
- render(_jsx(BulkActionBar, { selectedCount: 1, actions: actions }));
34
- // Apply button must exist
35
- expect(screen.getByRole("button", { name: /apply/i })).toBeTruthy();
36
- // Picker trigger has aria-haspopup="listbox"
37
- expect(screen.getByRole("button", { expanded: false })).toBeTruthy();
38
- });
39
- it("opens the action picker on trigger click", () => {
40
- render(_jsx(BulkActionBar, { selectedCount: 1, actions: actions }));
41
- const trigger = screen.getByRole("button", { expanded: false });
42
- fireEvent.click(trigger);
43
- // Trigger now has aria-expanded="true"
44
- expect(screen.getByRole("button", { expanded: true })).toBeTruthy();
45
- });
46
- it("selects an action when an option is clicked and closes the picker", () => {
47
- render(_jsx(BulkActionBar, { selectedCount: 1, actions: actions }));
48
- // Open picker
49
- const trigger = screen.getByRole("button", { expanded: false });
50
- fireEvent.click(trigger);
51
- // Trigger is expanded
52
- expect(trigger.getAttribute("aria-expanded")).toBe("true");
53
- // Click Delete option
54
- fireEvent.click(screen.getByRole("option", { name: /delete/i }));
55
- // Picker should close — aria-expanded returns to false
56
- expect(trigger.getAttribute("aria-expanded")).toBe("false");
57
- });
58
- it("calls the selected action's onClick when Apply is clicked", () => {
59
- const publishFn = vi.fn();
60
- const actionsWithFns = [
61
- { id: "publish", label: "Publish", onClick: publishFn },
62
- ];
63
- render(_jsx(BulkActionBar, { selectedCount: 1, actions: actionsWithFns }));
64
- fireEvent.click(screen.getByRole("button", { name: /apply/i }));
65
- expect(publishFn).toHaveBeenCalledOnce();
66
- });
67
- it("executes the newly selected action when a different option is chosen then Apply clicked", () => {
68
- const publishFn = vi.fn();
69
- const deleteFn = vi.fn();
70
- const actionsWithFns = [
71
- { id: "publish", label: "Publish", onClick: publishFn },
72
- { id: "delete", label: "Delete", variant: "danger", onClick: deleteFn },
73
- ];
74
- render(_jsx(BulkActionBar, { selectedCount: 1, actions: actionsWithFns }));
75
- // Select Delete via picker
76
- fireEvent.click(screen.getByRole("button", { expanded: false }));
77
- fireEvent.click(screen.getByRole("option", { name: /delete/i }));
78
- // Apply
79
- fireEvent.click(screen.getByRole("button", { name: /apply/i }));
80
- expect(deleteFn).toHaveBeenCalledOnce();
81
- expect(publishFn).not.toHaveBeenCalled();
82
- });
83
- it("disables the apply button when the selected action is disabled", () => {
84
- const disabledActions = [
85
- { id: "archive", label: "Archive", onClick: vi.fn(), disabled: true },
86
- ];
87
- render(_jsx(BulkActionBar, { selectedCount: 1, actions: disabledActions }));
88
- const applyBtn = screen.getByRole("button", { name: /apply/i });
89
- expect(applyBtn.disabled).toBe(true);
90
- });
91
- it("uses custom labels", () => {
92
- render(_jsx(BulkActionBar, { selectedCount: 2, actions: actions, labels: { apply: "Run", selected: "chosen" } }));
93
- expect(screen.getByRole("button", { name: /run/i })).toBeTruthy();
94
- expect(screen.getByTestId("bulk-selected-count").textContent).toContain("chosen");
95
- });
96
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,125 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { render, screen, fireEvent } from "@testing-library/react";
3
- import { describe, it, expect, vi } from "vitest";
4
- import { ListingToolbar } from "../ListingToolbar";
5
- describe("ListingToolbar", () => {
6
- it("renders the toolbar container", () => {
7
- render(_jsx(ListingToolbar, {}));
8
- expect(screen.getByTestId("listing-toolbar")).toBeTruthy();
9
- });
10
- it("renders search input when onSearchChange is provided", () => {
11
- render(_jsx(ListingToolbar, { onSearchChange: vi.fn(), searchValue: "", searchPlaceholder: "Find\u2026" }));
12
- expect(screen.getByPlaceholderText("Find…")).toBeTruthy();
13
- });
14
- it("does not render search input when onSearchChange is absent", () => {
15
- render(_jsx(ListingToolbar, {}));
16
- expect(screen.queryByRole("textbox")).toBeNull();
17
- });
18
- it("calls onSearchChange when typing in the search input", () => {
19
- const onChange = vi.fn();
20
- render(_jsx(ListingToolbar, { onSearchChange: onChange, searchValue: "" }));
21
- fireEvent.change(screen.getByRole("textbox"), { target: { value: "pokemon" } });
22
- expect(onChange).toHaveBeenCalledWith("pokemon");
23
- });
24
- it("calls onSearchCommit when Enter is pressed in the search input", () => {
25
- const onCommit = vi.fn();
26
- render(_jsx(ListingToolbar, { onSearchChange: vi.fn(), onSearchCommit: onCommit, searchValue: "" }));
27
- fireEvent.keyDown(screen.getByRole("textbox"), { key: "Enter" });
28
- expect(onCommit).toHaveBeenCalledOnce();
29
- });
30
- it("calls onSearchCommit when the search button is clicked", () => {
31
- const onCommit = vi.fn();
32
- render(_jsx(ListingToolbar, { onSearchChange: vi.fn(), onSearchCommit: onCommit, searchValue: "" }));
33
- fireEvent.click(screen.getByRole("button", { name: /search/i }));
34
- expect(onCommit).toHaveBeenCalledOnce();
35
- });
36
- it("renders filters button when onFiltersClick is provided", () => {
37
- const onClick = vi.fn();
38
- render(_jsx(ListingToolbar, { onFiltersClick: onClick }));
39
- const btn = screen.getByRole("button", { name: /filters/i });
40
- expect(btn).toBeTruthy();
41
- fireEvent.click(btn);
42
- expect(onClick).toHaveBeenCalledOnce();
43
- });
44
- it("does not render filters button when onFiltersClick is absent", () => {
45
- render(_jsx(ListingToolbar, {}));
46
- expect(screen.queryByRole("button", { name: /filters/i })).toBeNull();
47
- });
48
- it("shows filter count badge when filterCount > 0", () => {
49
- render(_jsx(ListingToolbar, { onFiltersClick: vi.fn(), filterCount: 3 }));
50
- expect(screen.getByText("3")).toBeTruthy();
51
- });
52
- it("renders grid and list view buttons when onViewChange is provided", () => {
53
- render(_jsx(ListingToolbar, { onViewChange: vi.fn(), view: "grid" }));
54
- expect(screen.getByRole("button", { name: /grid view/i })).toBeTruthy();
55
- expect(screen.getByRole("button", { name: /list view/i })).toBeTruthy();
56
- });
57
- it("does not render view buttons when hideViewToggle is true", () => {
58
- render(_jsx(ListingToolbar, { onViewChange: vi.fn(), hideViewToggle: true, view: "grid" }));
59
- expect(screen.queryByRole("button", { name: /grid view/i })).toBeNull();
60
- });
61
- it("calls onViewChange with 'list' when list button is clicked", () => {
62
- const onViewChange = vi.fn();
63
- render(_jsx(ListingToolbar, { onViewChange: onViewChange, view: "grid" }));
64
- fireEvent.click(screen.getByRole("button", { name: /list view/i }));
65
- expect(onViewChange).toHaveBeenCalledWith("list");
66
- });
67
- it("renders table view button only when showTableView is true", () => {
68
- const { rerender } = render(_jsx(ListingToolbar, { onViewChange: vi.fn(), view: "grid" }));
69
- expect(screen.queryByRole("button", { name: /table view/i })).toBeNull();
70
- rerender(_jsx(ListingToolbar, { onViewChange: vi.fn(), view: "grid", showTableView: true }));
71
- expect(screen.getByRole("button", { name: /table view/i })).toBeTruthy();
72
- });
73
- it("shows reset-all button only when onResetAll + hasActiveState are both truthy", () => {
74
- const onReset = vi.fn();
75
- const { rerender } = render(_jsx(ListingToolbar, { onResetAll: onReset, hasActiveState: false }));
76
- expect(screen.queryByRole("button", { name: /reset all/i })).toBeNull();
77
- rerender(_jsx(ListingToolbar, { onResetAll: onReset, hasActiveState: true }));
78
- expect(screen.getByRole("button", { name: /reset all/i })).toBeTruthy();
79
- fireEvent.click(screen.getByRole("button", { name: /reset all/i }));
80
- expect(onReset).toHaveBeenCalledOnce();
81
- });
82
- it("renders bulk-mode controls when bulkMode is true", () => {
83
- render(_jsx(ListingToolbar, { bulkMode: true, bulkSelectedCount: 2, bulkTotalCount: 10, onBulkSelectAll: vi.fn(), onBulkClear: vi.fn() }));
84
- expect(screen.getByText(/select all/i)).toBeTruthy();
85
- expect(screen.getByText(/2 selected/i)).toBeTruthy();
86
- expect(screen.getByText(/clear/i)).toBeTruthy();
87
- });
88
- it("calls onBulkSelectAll when Select All is clicked", () => {
89
- const onSelectAll = vi.fn();
90
- render(_jsx(ListingToolbar, { bulkMode: true, bulkSelectedCount: 0, bulkTotalCount: 5, onBulkSelectAll: onSelectAll }));
91
- fireEvent.click(screen.getByText(/select all/i));
92
- expect(onSelectAll).toHaveBeenCalledOnce();
93
- });
94
- it("calls onBulkClear when Clear button is clicked", () => {
95
- const onClear = vi.fn();
96
- render(_jsx(ListingToolbar, { bulkMode: true, bulkSelectedCount: 2, bulkTotalCount: 5, onBulkClear: onClear }));
97
- fireEvent.click(screen.getByText(/clear/i));
98
- expect(onClear).toHaveBeenCalledOnce();
99
- });
100
- it("shows 'Deselect All' label when all items are selected", () => {
101
- render(_jsx(ListingToolbar, { bulkMode: true, bulkSelectedCount: 5, bulkTotalCount: 5, onBulkSelectAll: vi.fn() }));
102
- expect(screen.getByText(/deselect all/i)).toBeTruthy();
103
- });
104
- it("renders pill toggle buttons from the toggles prop", () => {
105
- const onToggle = vi.fn();
106
- const toggles = [
107
- { label: "In Stock", active: false, onChange: onToggle },
108
- { label: "Featured", active: true, onChange: vi.fn() },
109
- ];
110
- render(_jsx(ListingToolbar, { toggles: toggles }));
111
- expect(screen.getByRole("switch", { name: "In Stock" })).toBeTruthy();
112
- expect(screen.getByRole("switch", { name: "Featured" })).toBeTruthy();
113
- });
114
- it("calls toggle onChange with flipped value when a pill toggle is clicked", () => {
115
- const onChange = vi.fn();
116
- const toggles = [{ label: "In Stock", active: false, onChange }];
117
- render(_jsx(ListingToolbar, { toggles: toggles }));
118
- fireEvent.click(screen.getByRole("switch", { name: "In Stock" }));
119
- expect(onChange).toHaveBeenCalledWith(true);
120
- });
121
- it("uses custom labels from the labels prop", () => {
122
- render(_jsx(ListingToolbar, { onFiltersClick: vi.fn(), labels: { filters: "Refine" } }));
123
- expect(screen.getByRole("button", { name: /refine/i })).toBeTruthy();
124
- });
125
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,187 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { render, screen } from "@testing-library/react";
3
- import { describe, it, expect } from "vitest";
4
- import { Anchor } from "../Anchor";
5
- import { Details, Summary } from "../Details";
6
- import { FallbackShell } from "../FallbackShell";
7
- import { Fieldset, Legend } from "../Fieldset";
8
- import { Hide, Show } from "../Responsive";
9
- import { HorizontalRule } from "../HorizontalRule";
10
- import { HotspotMarker } from "../HotspotMarker";
11
- import { IconBox } from "../IconBox";
12
- import { Iframe } from "../Iframe";
13
- import { Kbd } from "../Kbd";
14
- import { Quote } from "../Quote";
15
- import { SiteLogo } from "../SiteLogo";
16
- import { StickyToolbar } from "../StickyToolbar";
17
- describe("variant-catalogue primitives", () => {
18
- describe("Anchor", () => {
19
- it("auto-applies target/rel for external https URLs", () => {
20
- render(_jsx(Anchor, { href: "https://example.com", children: "Example" }));
21
- const link = screen.getByRole("link", { name: "Example" });
22
- expect(link.getAttribute("target")).toBe("_blank");
23
- expect(link.getAttribute("rel")).toBe("noopener noreferrer");
24
- });
25
- it("does not target=_blank for mailto: links", () => {
26
- render(_jsx(Anchor, { href: "mailto:hi@example.com", children: "Email" }));
27
- const link = screen.getByRole("link", { name: "Email" });
28
- expect(link.getAttribute("target")).toBeNull();
29
- });
30
- it("applies the tone class", () => {
31
- render(_jsx(Anchor, { href: "https://example.com", tone: "danger", children: "Danger" }));
32
- const link = screen.getByRole("link", { name: "Danger" });
33
- expect(link.className).toContain("var(--appkit-color-error)");
34
- });
35
- });
36
- describe("Iframe", () => {
37
- it("renders aspect + rounded classes from typed enums", () => {
38
- const { container } = render(_jsx(Iframe, { src: "https://example.com/embed", title: "Embed", aspect: "square", rounded: "2xl" }));
39
- const iframe = container.querySelector("iframe");
40
- expect(iframe).not.toBeNull();
41
- expect(iframe?.className).toContain("aspect-square");
42
- expect(iframe?.className).toContain("rounded-2xl");
43
- });
44
- it("applies the default sandbox", () => {
45
- const { container } = render(_jsx(Iframe, { src: "https://example.com/embed", title: "Embed" }));
46
- const iframe = container.querySelector("iframe");
47
- expect(iframe?.getAttribute("sandbox")).toMatch(/allow-same-origin/);
48
- });
49
- });
50
- describe("HorizontalRule", () => {
51
- it("renders an <hr> with separator role", () => {
52
- render(_jsx(HorizontalRule, {}));
53
- const hr = screen.getByRole("separator");
54
- expect(hr.tagName).toBe("HR");
55
- });
56
- it("renders the accent gradient class for tone=accent", () => {
57
- const { container } = render(_jsx(HorizontalRule, { tone: "accent" }));
58
- const hr = container.querySelector("hr");
59
- expect(hr?.className).toContain("appkit-gradient-accent-divider");
60
- });
61
- });
62
- describe("Kbd", () => {
63
- it("renders a <kbd> with size + tone classes", () => {
64
- render(_jsx(Kbd, { size: "sm", tone: "brand", children: "Ctrl" }));
65
- const kbd = screen.getByText("Ctrl");
66
- expect(kbd.tagName).toBe("KBD");
67
- expect(kbd.className).toContain("appkit-color-primary");
68
- });
69
- });
70
- describe("Quote", () => {
71
- it("renders inline <q> by default", () => {
72
- const { container } = render(_jsx(Quote, { children: "hi" }));
73
- expect(container.querySelector("q")).not.toBeNull();
74
- });
75
- it("renders <blockquote> when block is set", () => {
76
- const { container } = render(_jsx(Quote, { block: true, children: "longer text" }));
77
- expect(container.querySelector("blockquote")).not.toBeNull();
78
- });
79
- });
80
- describe("IconBox", () => {
81
- it("renders a <div> by default with size+tone+rounded classes", () => {
82
- const { container } = render(_jsx(IconBox, { tone: "brand", children: "\uD83C\uDFF7\uFE0F" }));
83
- const box = container.firstElementChild;
84
- expect(box.tagName).toBe("DIV");
85
- expect(box.className).toContain("w-10");
86
- expect(box.className).toContain("rounded-xl");
87
- expect(box.className).toContain("appkit-color-primary");
88
- });
89
- it("renders a <span> when as=span", () => {
90
- const { container } = render(_jsx(IconBox, { as: "span", children: "\uD83C\uDFF7\uFE0F" }));
91
- expect(container.firstElementChild?.tagName).toBe("SPAN");
92
- });
93
- });
94
- describe("StickyToolbar", () => {
95
- it("composes header offset by default", () => {
96
- const { container } = render(_jsx(StickyToolbar, { children: _jsx("span", { children: "Toolbar" }) }));
97
- const root = container.firstElementChild;
98
- expect(root.className).toContain("top-[var(--header-height,0px)]");
99
- });
100
- it("composes header+nav offset", () => {
101
- const { container } = render(_jsx(StickyToolbar, { offset: "header+nav", children: _jsx("span", { children: "Toolbar" }) }));
102
- const root = container.firstElementChild;
103
- expect(root.className).toContain("top-[calc(var(--header-height,0px)+44px)]");
104
- });
105
- it("accepts a numeric offset", () => {
106
- const { container } = render(_jsx(StickyToolbar, { offset: 56, children: _jsx("span", { children: "Toolbar" }) }));
107
- const root = container.firstElementChild;
108
- expect(root.className).toContain("top-[56px]");
109
- });
110
- });
111
- describe("Fieldset + Legend", () => {
112
- it("renders the field group with a legend", () => {
113
- const { container } = render(_jsxs(Fieldset, { tone: "success", children: [_jsx(Legend, { children: "Group" }), _jsx("span", { children: "body" })] }));
114
- expect(container.querySelector("fieldset")?.className).toContain("appkit-color-success");
115
- expect(container.querySelector("legend")?.textContent).toBe("Group");
116
- });
117
- it("hides the legend visually when srOnly", () => {
118
- render(_jsx(Legend, { srOnly: true, children: "Hidden" }));
119
- expect(screen.getByText("Hidden").className).toContain("sr-only");
120
- });
121
- });
122
- describe("Details + Summary", () => {
123
- it("renders the disclosure with summary", () => {
124
- const { container } = render(_jsxs(Details, { defaultOpen: true, children: [_jsx(Summary, { children: "Click" }), _jsx("span", { children: "body" })] }));
125
- const details = container.querySelector("details");
126
- expect(details).not.toBeNull();
127
- expect(details?.open).toBe(true);
128
- expect(container.querySelector("summary")?.textContent).toBe("Click");
129
- });
130
- });
131
- describe("Show / Hide", () => {
132
- it("Show above=md uses hidden md:block", () => {
133
- const { container } = render(_jsx(Show, { above: "md", children: "visible" }));
134
- const root = container.firstElementChild;
135
- expect(root.className).toBe("hidden md:block");
136
- });
137
- it("Hide below=md hides below md and shows at md+", () => {
138
- // Hide(below=md) = inverse of Show(below=md). Show(below=md) is
139
- // visible at < md and hidden at >= md (`block md:hidden`); Hide(below=md)
140
- // is therefore hidden at < md and visible at >= md (`hidden md:block`).
141
- const { container } = render(_jsx(Hide, { below: "md", children: "hidden" }));
142
- const root = container.firstElementChild;
143
- expect(root.className).toBe("hidden md:block");
144
- });
145
- it("inline render uses span", () => {
146
- const { container } = render(_jsx(Show, { above: "md", inline: true, children: "inline-show" }));
147
- expect(container.firstElementChild?.tagName).toBe("SPAN");
148
- });
149
- });
150
- describe("FallbackShell", () => {
151
- it("renders the title with role=alert", () => {
152
- render(_jsx(FallbackShell, { title: "Boom", description: "Crashed" }));
153
- const alert = screen.getByRole("alert");
154
- expect(alert).not.toBeNull();
155
- expect(screen.getByText("Boom")).not.toBeNull();
156
- expect(screen.getByText("Crashed")).not.toBeNull();
157
- });
158
- });
159
- describe("HotspotMarker", () => {
160
- it("renders an interactive button with inline position style", () => {
161
- const { container } = render(_jsx(HotspotMarker, { xPct: 25, yPct: 75, size: "md", tone: "brand", children: "1" }));
162
- const button = container.querySelector("button");
163
- expect(button).not.toBeNull();
164
- expect(button?.style.left).toBe("25%");
165
- expect(button?.style.top).toBe("75%");
166
- });
167
- it("clamps out-of-range coordinates", () => {
168
- const { container } = render(_jsx(HotspotMarker, { xPct: -5, yPct: 120, size: "md", tone: "brand", children: "x" }));
169
- const button = container.querySelector("button");
170
- expect(button?.style.left).toBe("0%");
171
- expect(button?.style.top).toBe("100%");
172
- });
173
- });
174
- describe("SiteLogo", () => {
175
- it("renders the SVG wordmark by default at size=md", () => {
176
- const { container } = render(_jsx(SiteLogo, {}));
177
- const svg = container.querySelector("svg");
178
- expect(svg).not.toBeNull();
179
- expect(svg?.getAttribute("class")).toContain("h-7");
180
- });
181
- it("renders a solid fill when tone=mono", () => {
182
- const { container } = render(_jsx(SiteLogo, { tone: "mono" }));
183
- const text = container.querySelector("svg text");
184
- expect(text?.getAttribute("fill")).toBe("currentColor");
185
- });
186
- });
187
- });