@mercurjs/admin 2.0.0-canary.27 → 2.0.0-canary.30

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 (128) hide show
  1. package/dist/{add-campaign-promotions-TXOODRHB.js → add-campaign-promotions-UVEH25GZ.js} +3 -3
  2. package/dist/{adjust-inventory-6RA7MJEM.js → adjust-inventory-B7O6DYKO.js} +5 -4
  3. package/dist/{api-key-management-detail-24BNBQNS.js → api-key-management-detail-4LXV7JDA.js} +5 -4
  4. package/dist/{campaign-detail-FBUQQL2W.js → campaign-detail-5Z7GPFAK.js} +8 -7
  5. package/dist/{categories-metadata-7NJ5AUE7.js → categories-metadata-BZXXH7O2.js} +5 -4
  6. package/dist/{category-detail-IQ4PUZG7.js → category-detail-RUHIR23W.js} +9 -8
  7. package/dist/{category-products-FSVFQAE4.js → category-products-HCTOGNYC.js} +9 -8
  8. package/dist/{chunk-4XHMNG3H.js → chunk-5X5373EQ.js} +11 -20
  9. package/dist/{chunk-PASXA3UX.js → chunk-7J3HKFZC.js} +22 -1
  10. package/dist/chunk-A4X5VP3G.js +102 -0
  11. package/dist/{chunk-NKLW7RD6.js → chunk-DTDWXHUJ.js} +1 -1
  12. package/dist/{chunk-TO7KBKHJ.js → chunk-F5PEK3DA.js} +5 -2
  13. package/dist/{chunk-6KI3GDYH.js → chunk-FMOQNZFZ.js} +39 -3
  14. package/dist/{chunk-6NNBZIM7.js → chunk-GFZ7GOEU.js} +4 -1
  15. package/dist/{chunk-RILFAVKM.js → chunk-HOZHWCST.js} +1 -1
  16. package/dist/{chunk-QM2TMBP3.js → chunk-KCCJYRBN.js} +9 -19
  17. package/dist/{chunk-AAW22JWF.js → chunk-O5AT2SQW.js} +1 -1
  18. package/dist/chunk-SWL7ZCP3.js +11 -0
  19. package/dist/{chunk-ZGQV4I7U.js → chunk-SXC5ZMLI.js} +3 -3
  20. package/dist/{chunk-KW56S7WF.js → chunk-VVWB3GIK.js} +5 -2
  21. package/dist/chunk-VZEMURY7.js +35 -0
  22. package/dist/{chunk-SJKPESDA.js → chunk-XE6KSRKQ.js} +1 -1
  23. package/dist/{collection-add-products-4HTDHYXO.js → collection-add-products-RPYKLNNJ.js} +9 -8
  24. package/dist/{collection-detail-CWGP5ICA.js → collection-detail-GWMDEONO.js} +9 -8
  25. package/dist/{collection-list-6DZKMCB5.js → collection-list-7YAMMLFL.js} +17 -16
  26. package/dist/{collection-metadata-7BON4MGI.js → collection-metadata-H53GCXYR.js} +5 -4
  27. package/dist/commission-rate-create-MSQJGMDS.js +777 -0
  28. package/dist/commission-rate-detail-FR6JFGB4.js +440 -0
  29. package/dist/commission-rate-edit-KPZXPZE7.js +760 -0
  30. package/dist/commission-rate-list-FCQ3HXC7.js +196 -0
  31. package/dist/{customer-detail-46UYP6GW.js → customer-detail-M7QXH7SD.js} +10 -9
  32. package/dist/{customer-group-detail-3RD6DT7U.js → customer-group-detail-QULQ5ZIZ.js} +8 -7
  33. package/dist/{customer-group-list-TFM2WJ4X.js → customer-group-list-SGAMPEJD.js} +5 -4
  34. package/dist/{customer-group-metadata-P7QANREG.js → customer-group-metadata-J3FH457E.js} +5 -4
  35. package/dist/{customer-metadata-MBI3NDAU.js → customer-metadata-ZU6PXP7M.js} +5 -4
  36. package/dist/{customers-add-customer-group-IHI2A5OO.js → customers-add-customer-group-TGJ422S7.js} +8 -7
  37. package/dist/{edit-inventory-item-EULGCSM4.js → edit-inventory-item-6Q5W6WJ2.js} +5 -4
  38. package/dist/{edit-inventory-item-attributes-56QN6GHF.js → edit-inventory-item-attributes-MPZZJFDD.js} +5 -4
  39. package/dist/{edit-rules-3WAX7GEP.js → edit-rules-HKGBBMHG.js} +5 -4
  40. package/dist/index.js +206 -124
  41. package/dist/{inventory-create-WCI6KWDJ.js → inventory-create-R33QWQMU.js} +5 -4
  42. package/dist/{inventory-detail-WDI5KD2U.js → inventory-detail-GN5KKOGO.js} +5 -4
  43. package/dist/{inventory-metadata-S34DYKIW.js → inventory-metadata-DN6CK42E.js} +5 -4
  44. package/dist/{inventory-stock-ITSFGRAG.js → inventory-stock-BIV6VHGX.js} +5 -4
  45. package/dist/{location-detail-DIAY4ZPW.js → location-detail-BXACBEYM.js} +5 -4
  46. package/dist/{location-fulfillment-providers-EBFA6G7P.js → location-fulfillment-providers-TGTZNVTK.js} +7 -6
  47. package/dist/{location-list-ZWDA6NC3.js → location-list-M5DLUBHD.js} +5 -4
  48. package/dist/{location-service-zone-shipping-option-create-LNLXDZYF.js → location-service-zone-shipping-option-create-P44YZNQP.js} +5 -4
  49. package/dist/{login-FXV4BRJ2.js → login-EVOZGQN3.js} +5 -4
  50. package/dist/{marketplace-detail-GOA4HYOL.js → marketplace-detail-LMLLZFKR.js} +5 -4
  51. package/dist/{marketplace-metadata-GCD7VD34.js → marketplace-metadata-O24YYWMO.js} +5 -4
  52. package/dist/{order-create-claim-OT3YIYG7.js → order-create-claim-3H6Q6BOK.js} +5 -4
  53. package/dist/{order-create-edit-KF5V64D7.js → order-create-edit-2Q5WZDWV.js} +5 -4
  54. package/dist/{order-create-exchange-5PH2DDPB.js → order-create-exchange-EWAOCVAD.js} +5 -4
  55. package/dist/{order-create-fulfillment-MIJWDDL2.js → order-create-fulfillment-S4FLI7H4.js} +5 -4
  56. package/dist/{order-create-refund-56LLPYLA.js → order-create-refund-EZRAUHW5.js} +5 -4
  57. package/dist/{order-create-shipment-TCGKO67Z.js → order-create-shipment-P6W3MIUO.js} +5 -4
  58. package/dist/{order-detail-ZDPCS42E.js → order-detail-CSNUBXUB.js} +5 -4
  59. package/dist/{order-edit-billing-address-C7YX7626.js → order-edit-billing-address-7OTVEKSV.js} +6 -5
  60. package/dist/{order-edit-email-7NMGVKNJ.js → order-edit-email-YL7HUYWW.js} +5 -4
  61. package/dist/{order-edit-shipping-address-BSWGO3G3.js → order-edit-shipping-address-OD6Q2YJB.js} +5 -4
  62. package/dist/{order-list-Y3CNRMSU.js → order-list-MVWNUSCV.js} +35 -16
  63. package/dist/{order-metadata-XXEPKUFM.js → order-metadata-HIKCMASJ.js} +5 -4
  64. package/dist/{order-receive-return-JFIMIGGV.js → order-receive-return-FFS3UDIX.js} +5 -4
  65. package/dist/{order-request-transfer-TXC2FK4A.js → order-request-transfer-AJ7Y7O4M.js} +5 -4
  66. package/dist/{price-list-configuration-GK4MA3BE.js → price-list-configuration-LIE2Z77K.js} +2 -2
  67. package/dist/{price-list-create-L5KWHQIJ.js → price-list-create-CJDS5WL6.js} +11 -10
  68. package/dist/{price-list-detail-E3F63UB6.js → price-list-detail-EXSNCIVE.js} +9 -8
  69. package/dist/{price-list-prices-add-OHMQZH73.js → price-list-prices-add-CM6ZTB5H.js} +9 -8
  70. package/dist/{price-list-prices-edit-ORJ3VWX2.js → price-list-prices-edit-WJP5NDFZ.js} +5 -4
  71. package/dist/{product-create-FWHZORNL.js → product-create-JL6E6O4U.js} +38 -6
  72. package/dist/{product-create-variant-ZMSJOFSJ.js → product-create-variant-MPXN3APE.js} +5 -4
  73. package/dist/{product-detail-V24PBFTX.js → product-detail-5EKZ4LHH.js} +10 -5
  74. package/dist/{product-export-H5Z6JVW7.js → product-export-5ZUQERTW.js} +17 -16
  75. package/dist/{product-import-HYPRL63J.js → product-import-KKR33B54.js} +5 -4
  76. package/dist/{product-list-XWJ5JFO2.js → product-list-PO7KEKYD.js} +17 -8
  77. package/dist/{product-media-TGVTQNDO.js → product-media-Z2DCRZSU.js} +2 -2
  78. package/dist/{product-metadata-LP6ZZFCV.js → product-metadata-VJLPWS6G.js} +5 -4
  79. package/dist/{product-stock-S6XIQVMO.js → product-stock-WRLT45MY.js} +5 -4
  80. package/dist/{product-tag-create-WIROVJ3M.js → product-tag-create-OQ5GZSH2.js} +5 -4
  81. package/dist/{product-tag-detail-F27ML7MQ.js → product-tag-detail-SRNMX6IT.js} +18 -17
  82. package/dist/{product-tag-edit-7A2H7OW2.js → product-tag-edit-4NRAHR44.js} +5 -4
  83. package/dist/{product-tag-list-KMVTIS7O.js → product-tag-list-A73YMLOW.js} +18 -17
  84. package/dist/{product-tag-metadata-AZUT3RGE.js → product-tag-metadata-KGMZ2FM5.js} +5 -4
  85. package/dist/{product-type-detail-LHNEJ5V3.js → product-type-detail-VLW54AOG.js} +9 -8
  86. package/dist/{product-type-metadata-SB7Z6X6E.js → product-type-metadata-S4BQXNMD.js} +5 -4
  87. package/dist/{product-variant-detail-VA7DHMCF.js → product-variant-detail-5ZXWEHCR.js} +16 -5
  88. package/dist/{product-variant-edit-FCOJQ4E7.js → product-variant-edit-LI37UINW.js} +5 -4
  89. package/dist/{product-variant-metadata-TH6U2EQW.js → product-variant-metadata-QMG7QSRO.js} +5 -4
  90. package/dist/{promotion-create-7L5LWMEM.js → promotion-create-CBUVIGJJ.js} +5 -4
  91. package/dist/{promotion-detail-NGOQNJER.js → promotion-detail-T3XF7SQY.js} +7 -6
  92. package/dist/{promotion-list-CV35S2NN.js → promotion-list-SJYMXQXT.js} +3 -3
  93. package/dist/{refund-reason-create-V2VJFJQ2.js → refund-reason-create-3FFIHVIK.js} +5 -4
  94. package/dist/{refund-reason-edit-ZTSUQ7IF.js → refund-reason-edit-CUCFK6QT.js} +5 -4
  95. package/dist/{refund-reason-list-FYROEGE3.js → refund-reason-list-MWO4CGF3.js} +7 -6
  96. package/dist/{region-metadata-R4EIHSPF.js → region-metadata-L2ZFFSYU.js} +5 -4
  97. package/dist/{reservation-detail-MKH3WGNU.js → reservation-detail-PRFJ3DCG.js} +5 -4
  98. package/dist/{reservation-metadata-W3BBPRGI.js → reservation-metadata-4UKKCAQW.js} +5 -4
  99. package/dist/{reset-password-EEDB3CUC.js → reset-password-WNANNJDX.js} +1 -1
  100. package/dist/{return-reason-list-B32WYMI2.js → return-reason-list-NDRI73EJ.js} +2 -2
  101. package/dist/{sales-channel-add-products-LHMQAZUR.js → sales-channel-add-products-BMFVRAEH.js} +9 -8
  102. package/dist/{sales-channel-detail-MYCYNGWP.js → sales-channel-detail-3X2A3IU3.js} +9 -8
  103. package/dist/{sales-channel-list-UK62MLV6.js → sales-channel-list-TOHSZEWI.js} +5 -4
  104. package/dist/{sales-channel-metadata-YQG6HIJA.js → sales-channel-metadata-NNGECIDY.js} +5 -4
  105. package/dist/seller-address-edit-ZD3CYNHQ.js +223 -0
  106. package/dist/{seller-details-MSDVT5IO.js → seller-details-4TOSFX3P.js} +172 -231
  107. package/dist/{seller-edit-RUYGO7CB.js → seller-edit-DL7IFKVU.js} +5 -212
  108. package/dist/{seller-list-B45KDWT7.js → seller-list-IXZYLSWC.js} +42 -2
  109. package/dist/{shipping-option-type-create-MPIM2Y2U.js → shipping-option-type-create-V7NL6F5R.js} +5 -4
  110. package/dist/{shipping-option-type-detail-FTLW2VVA.js → shipping-option-type-detail-EFGMRTEM.js} +6 -5
  111. package/dist/{shipping-option-type-edit-AAKLLV23.js → shipping-option-type-edit-4AZ42T5Y.js} +5 -4
  112. package/dist/{shipping-option-type-list-UDGLHQWB.js → shipping-option-type-list-NK6K72MU.js} +6 -5
  113. package/dist/{shipping-profile-metadata-D74JJSCX.js → shipping-profile-metadata-KFVHD2O7.js} +5 -4
  114. package/dist/{tax-region-create-JNOTV4L4.js → tax-region-create-BZJTEBMQ.js} +6 -5
  115. package/dist/{tax-region-detail-EKF3UNHB.js → tax-region-detail-BXFEMVY5.js} +7 -6
  116. package/dist/{tax-region-edit-4RUDAWE6.js → tax-region-edit-44S4TJNT.js} +5 -4
  117. package/dist/{tax-region-metadata-7DE72RDE.js → tax-region-metadata-FHBJJJRJ.js} +5 -4
  118. package/dist/{tax-region-province-detail-ENOLU5SV.js → tax-region-province-detail-2F4YIIAJ.js} +7 -6
  119. package/dist/{tax-region-tax-override-create-EAUDM7RZ.js → tax-region-tax-override-create-IURFV4MN.js} +20 -17
  120. package/dist/{tax-region-tax-override-edit-H5I3E3AJ.js → tax-region-tax-override-edit-XIPVZQSN.js} +20 -17
  121. package/dist/{user-metadata-4EBEIV3V.js → user-metadata-JDY6236C.js} +5 -4
  122. package/package.json +1 -1
  123. package/dist/{chunk-QNGHZSK3.js → chunk-24CEDEWS.js} +3 -3
  124. package/dist/{chunk-O4E3MAKS.js → chunk-BGDOVLJF.js} +3 -3
  125. package/dist/{customer-group-add-customers-FTRCJHE7.js → customer-group-add-customers-KG6P27YA.js} +3 -3
  126. package/dist/{customer-list-DYQHKNJV.js → customer-list-RK3BEFV7.js} +3 -3
  127. package/dist/{product-type-list-T5KO5J3W.js → product-type-list-BYHYR2PL.js} +3 -3
  128. package/dist/{region-list-PGWUOULN.js → region-list-IBVQAMBQ.js} +3 -3
@@ -2,11 +2,12 @@ import {
2
2
  require_dist
3
3
  } from "./chunk-NWQRHWE5.js";
4
4
  import {
5
- DateCell
6
- } from "./chunk-25LYVP3C.js";
7
- import {
8
- getStylizedAmount
9
- } from "./chunk-PXYDR7WQ.js";
5
+ useOrderTableColumns
6
+ } from "./chunk-BRUOBAPY.js";
7
+ import "./chunk-25LYVP3C.js";
8
+ import "./chunk-LQSLDDPT.js";
9
+ import "./chunk-2Y3WMGN6.js";
10
+ import "./chunk-PXYDR7WQ.js";
10
11
  import {
11
12
  ProductStatusCell
12
13
  } from "./chunk-G5OVX555.js";
@@ -24,39 +25,39 @@ import {
24
25
  Thumbnail
25
26
  } from "./chunk-WIYFXWRI.js";
26
27
  import "./chunk-IQPN4PZJ.js";
27
- import "./chunk-6KI3GDYH.js";
28
- import "./chunk-2ZFELO2L.js";
29
- import "./chunk-26OOAKQ6.js";
30
- import "./chunk-ZQZHFMD7.js";
31
- import "./chunk-ZGQV4I7U.js";
28
+ import "./chunk-SXC5ZMLI.js";
32
29
  import "./chunk-MG4GKUJW.js";
33
30
  import "./chunk-AYVH6Q5O.js";
34
31
  import "./chunk-VOHEQ7B5.js";
32
+ import "./chunk-FMOQNZFZ.js";
33
+ import "./chunk-2ZFELO2L.js";
34
+ import "./chunk-26OOAKQ6.js";
35
35
  import "./chunk-N5IUYCUZ.js";
36
36
  import "./chunk-7SVLKK6Q.js";
37
+ import "./chunk-ZQZHFMD7.js";
37
38
  import "./chunk-GR6JUIRU.js";
38
- import "./chunk-K3GJ266Z.js";
39
39
  import "./chunk-PVZBDWLK.js";
40
- import {
41
- useOrderTableFilters
42
- } from "./chunk-GEVYE225.js";
40
+ import "./chunk-K3GJ266Z.js";
43
41
  import {
44
42
  useOrderTableQuery
45
43
  } from "./chunk-O5HZRJPB.js";
46
- import "./chunk-CMHI2RPL.js";
44
+ import {
45
+ useOrderTableFilters
46
+ } from "./chunk-GEVYE225.js";
47
47
  import "./chunk-VKOE5J66.js";
48
+ import "./chunk-CMHI2RPL.js";
48
49
  import "./chunk-DY3XQPHC.js";
49
50
  import "./chunk-S2WEYEQR.js";
50
- import {
51
- useProductTableFilters
52
- } from "./chunk-PASXA3UX.js";
53
51
  import {
54
52
  useProductTableQuery
55
- } from "./chunk-KW56S7WF.js";
53
+ } from "./chunk-VVWB3GIK.js";
54
+ import {
55
+ useProductTableFilters
56
+ } from "./chunk-7J3HKFZC.js";
56
57
  import "./chunk-KBYZLKI4.js";
57
58
  import "./chunk-YWWUOGJA.js";
58
59
  import {
59
- SingleColumnPage
60
+ TwoColumnPage
60
61
  } from "./chunk-U2UCL2VG.js";
61
62
  import {
62
63
  SingleColumnPageSkeleton
@@ -69,22 +70,23 @@ import "./chunk-Y7QKP6QU.js";
69
70
  import "./chunk-THHRRYRS.js";
70
71
  import "./chunk-UZWFZMOX.js";
71
72
  import "./chunk-XQNVC4Q7.js";
72
- import "./chunk-QM2TMBP3.js";
73
+ import "./chunk-KCCJYRBN.js";
73
74
  import "./chunk-ODBDAABQ.js";
74
75
  import "./chunk-CDQJKJMX.js";
75
76
  import "./chunk-JLATVDLM.js";
76
- import "./chunk-E7ZBQO6E.js";
77
77
  import "./chunk-GPRBBA7S.js";
78
+ import "./chunk-E7ZBQO6E.js";
78
79
  import "./chunk-XGHM75N2.js";
79
80
  import "./chunk-U2GCSKW3.js";
80
- import "./chunk-LW3UWYZU.js";
81
81
  import "./chunk-RTAIDSDS.js";
82
+ import "./chunk-LW3UWYZU.js";
83
+ import "./chunk-A4X5VP3G.js";
82
84
  import "./chunk-NNZP4PYP.js";
83
- import "./chunk-JOQ3RTF5.js";
84
85
  import {
85
86
  useSeller,
86
87
  useUpdateSeller
87
88
  } from "./chunk-GF4QHVX3.js";
89
+ import "./chunk-JOQ3RTF5.js";
88
90
  import "./chunk-V534K7G4.js";
89
91
  import "./chunk-A5XOYSDC.js";
90
92
  import "./chunk-TQI3DOQ5.js";
@@ -127,7 +129,7 @@ var SellerDetailBreadcrumb = (props) => {
127
129
  import { useParams } from "react-router-dom";
128
130
 
129
131
  // src/pages/sellers/seller-details/components/seller-general-section.tsx
130
- import { PencilSquare, User } from "@medusajs/icons";
132
+ import { CheckCircleSolid, PencilSquare, User, XCircleSolid } from "@medusajs/icons";
131
133
  import {
132
134
  Container,
133
135
  Heading,
@@ -157,11 +159,28 @@ var SellerGeneralSection = ({
157
159
  [import_types.SellerStatus.SUSPENDED]: t("sellers.status.suspended")
158
160
  };
159
161
  const statusText = statusTextMap[seller.status] ?? t("sellers.status.pending");
160
- const handleSuspend = async () => {
161
- const isSuspended = seller.status === import_types.SellerStatus.SUSPENDED;
162
+ const handleStatusChange = async (newStatus) => {
163
+ const labels = {
164
+ [import_types.SellerStatus.ACTIVE]: {
165
+ title: "Activate account",
166
+ description: "Are you sure you want to activate this seller account?",
167
+ success: "Seller account activated"
168
+ },
169
+ [import_types.SellerStatus.SUSPENDED]: {
170
+ title: "Suspend account",
171
+ description: "Are you sure you want to suspend this seller account?",
172
+ success: "Seller account suspended"
173
+ },
174
+ [import_types.SellerStatus.PENDING]: {
175
+ title: "Set as pending",
176
+ description: "Are you sure you want to set this seller account as pending?",
177
+ success: "Seller account set to pending"
178
+ }
179
+ };
180
+ const label = labels[newStatus];
162
181
  const res = await prompt({
163
- title: isSuspended ? t("sellers.status.active") : t("sellers.status.suspended"),
164
- description: isSuspended ? "Are you sure you want to activate this account?" : "Are you sure you want to suspend this account?",
182
+ title: label.title,
183
+ description: label.description,
165
184
  verificationText: seller.email || seller.name || "",
166
185
  confirmText: t("actions.confirm"),
167
186
  cancelText: t("actions.cancel")
@@ -170,14 +189,10 @@ var SellerGeneralSection = ({
170
189
  return;
171
190
  }
172
191
  await updateSeller(
173
- {
174
- status: isSuspended ? import_types.SellerStatus.ACTIVE : import_types.SellerStatus.SUSPENDED
175
- },
192
+ { status: newStatus },
176
193
  {
177
194
  onSuccess: () => {
178
- toast.success(
179
- isSuspended ? "Seller account activated" : "Seller account suspended"
180
- );
195
+ toast.success(label.success);
181
196
  },
182
197
  onError: (error) => {
183
198
  toast.error(error.message);
@@ -185,6 +200,24 @@ var SellerGeneralSection = ({
185
200
  }
186
201
  );
187
202
  };
203
+ const statusActions = (() => {
204
+ const actions = [];
205
+ if (seller.status !== import_types.SellerStatus.ACTIVE) {
206
+ actions.push({
207
+ label: "Activate account",
208
+ onClick: () => handleStatusChange(import_types.SellerStatus.ACTIVE),
209
+ icon: /* @__PURE__ */ jsx2(CheckCircleSolid, {})
210
+ });
211
+ }
212
+ if (seller.status !== import_types.SellerStatus.SUSPENDED) {
213
+ actions.push({
214
+ label: "Suspend account",
215
+ onClick: () => handleStatusChange(import_types.SellerStatus.SUSPENDED),
216
+ icon: /* @__PURE__ */ jsx2(XCircleSolid, {})
217
+ });
218
+ }
219
+ return actions;
220
+ })();
188
221
  return /* @__PURE__ */ jsxs(Container, { className: "divide-y p-0", children: [
189
222
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [
190
223
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-3", children: [
@@ -214,13 +247,7 @@ var SellerGeneralSection = ({
214
247
  ]
215
248
  },
216
249
  {
217
- actions: [
218
- {
219
- label: seller.status === import_types.SellerStatus.SUSPENDED ? "Activate account" : "Suspend account",
220
- onClick: handleSuspend,
221
- icon: /* @__PURE__ */ jsx2(User, {})
222
- }
223
- ]
250
+ actions: statusActions
224
251
  }
225
252
  ]
226
253
  }
@@ -242,99 +269,87 @@ var SellerGeneralSection = ({
242
269
  /* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
243
270
  /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", weight: "plus", children: t("sellers.fields.phone") }),
244
271
  /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", children: seller.phone || "-" })
272
+ ] })
273
+ ] });
274
+ };
275
+
276
+ // src/pages/sellers/seller-details/components/seller-address-section.tsx
277
+ import { PencilSquare as PencilSquare2 } from "@medusajs/icons";
278
+ import { Container as Container2, Heading as Heading2, Text as Text2 } from "@medusajs/ui";
279
+ import { useTranslation as useTranslation2 } from "react-i18next";
280
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
281
+ var SellerAddressSection = ({
282
+ seller
283
+ }) => {
284
+ const { t } = useTranslation2();
285
+ return /* @__PURE__ */ jsxs2(Container2, { className: "divide-y p-0", children: [
286
+ /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between px-6 py-4", children: [
287
+ /* @__PURE__ */ jsx3(Heading2, { level: "h2", children: t("addresses.title") }),
288
+ /* @__PURE__ */ jsx3(
289
+ ActionMenu,
290
+ {
291
+ groups: [
292
+ {
293
+ actions: [
294
+ {
295
+ label: t("actions.edit"),
296
+ to: `/sellers/${seller.id}/edit-address`,
297
+ icon: /* @__PURE__ */ jsx3(PencilSquare2, {})
298
+ }
299
+ ]
300
+ }
301
+ ]
302
+ }
303
+ )
245
304
  ] }),
246
- /* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
247
- /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", weight: "plus", children: t("sellers.fields.address_1") }),
248
- /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", children: seller.address_1 || "-" })
305
+ /* @__PURE__ */ jsxs2("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
306
+ /* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", weight: "plus", children: t("sellers.fields.address_1") }),
307
+ /* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", children: seller.address_1 || "-" })
249
308
  ] }),
250
- /* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
251
- /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", weight: "plus", children: t("sellers.fields.address_2") }),
252
- /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", children: seller.address_2 || "-" })
309
+ /* @__PURE__ */ jsxs2("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
310
+ /* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", weight: "plus", children: t("sellers.fields.address_2") }),
311
+ /* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", children: seller.address_2 || "-" })
253
312
  ] }),
254
- /* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
255
- /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", weight: "plus", children: t("sellers.fields.city") }),
256
- /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", children: seller.city || "-" })
313
+ /* @__PURE__ */ jsxs2("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
314
+ /* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", weight: "plus", children: t("sellers.fields.city") }),
315
+ /* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", children: seller.city || "-" })
257
316
  ] }),
258
- /* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
259
- /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", weight: "plus", children: t("sellers.fields.province") }),
260
- /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", children: seller.province || "-" })
317
+ /* @__PURE__ */ jsxs2("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
318
+ /* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", weight: "plus", children: t("sellers.fields.province") }),
319
+ /* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", children: seller.province || "-" })
261
320
  ] }),
262
- /* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
263
- /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", weight: "plus", children: t("sellers.fields.postal_code") }),
264
- /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", children: seller.postal_code || "-" })
321
+ /* @__PURE__ */ jsxs2("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
322
+ /* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", weight: "plus", children: t("sellers.fields.postal_code") }),
323
+ /* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", children: seller.postal_code || "-" })
265
324
  ] }),
266
- /* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
267
- /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", weight: "plus", children: t("sellers.fields.country_code") }),
268
- /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", children: seller.country_code || "-" })
325
+ /* @__PURE__ */ jsxs2("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
326
+ /* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", weight: "plus", children: t("sellers.fields.country_code") }),
327
+ /* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", children: seller.country_code || "-" })
269
328
  ] })
270
329
  ] });
271
330
  };
272
331
 
273
332
  // src/pages/sellers/seller-details/components/seller-order-section.tsx
274
- import { useMemo } from "react";
275
- import { Badge, Container as Container2, Heading as Heading2 } from "@medusajs/ui";
333
+ import { Container as Container3, Heading as Heading3 } from "@medusajs/ui";
276
334
  import { keepPreviousData } from "@tanstack/react-query";
277
- import { createColumnHelper } from "@tanstack/react-table";
278
- import { useTranslation as useTranslation2 } from "react-i18next";
279
- import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
335
+ import { useMemo } from "react";
336
+ import { useTranslation as useTranslation3 } from "react-i18next";
337
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
280
338
  var PAGE_SIZE = 10;
281
339
  var PREFIX = "selord";
282
- var DEFAULT_FIELDS = "id,status,display_id,created_at,email,fulfillment_status,payment_status,total,currency_code,*customer";
283
- var getOrderStatusBadgeColor = (status) => {
284
- const colors = {
285
- pending: "orange",
286
- completed: "green",
287
- canceled: "red",
288
- archived: "grey",
289
- requires_action: "orange",
290
- draft: "grey"
291
- };
292
- return colors[status] || "grey";
293
- };
294
- var getPaymentStatusBadgeColor = (status) => {
295
- const colors = {
296
- captured: "green",
297
- paid: "green",
298
- partially_captured: "orange",
299
- awaiting: "orange",
300
- authorized: "blue",
301
- partially_authorized: "blue",
302
- pending: "orange",
303
- refunded: "red",
304
- partially_refunded: "orange",
305
- canceled: "red",
306
- not_paid: "grey",
307
- requires_action: "orange"
308
- };
309
- return colors[status] || "grey";
310
- };
311
- var getFulfillmentStatusBadgeColor = (status) => {
312
- const colors = {
313
- fulfilled: "green",
314
- shipped: "green",
315
- delivered: "green",
316
- partially_fulfilled: "orange",
317
- partially_shipped: "orange",
318
- partially_delivered: "orange",
319
- not_fulfilled: "grey",
320
- canceled: "red",
321
- returned: "red",
322
- partially_returned: "orange",
323
- requires_action: "orange"
324
- };
325
- return colors[status] || "grey";
326
- };
327
- var formatStatus = (status) => status.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
328
- var SellerOrderSection = () => {
329
- const { t } = useTranslation2();
340
+ var DEFAULT_RELATIONS = "*customer,*items,*sales_channel";
341
+ var DEFAULT_FIELDS = "id,status,display_id,created_at,email,fulfillment_status,payment_status,total,currency_code";
342
+ var SellerOrderSection = ({ sellerId }) => {
343
+ const { t } = useTranslation3();
330
344
  const { searchParams, raw } = useOrderTableQuery({
331
345
  pageSize: PAGE_SIZE,
332
346
  prefix: PREFIX
333
347
  });
334
348
  const { orders, count, isLoading, isError, error } = useOrders(
335
349
  {
336
- fields: DEFAULT_FIELDS,
337
- ...searchParams
350
+ ...searchParams,
351
+ seller_id: sellerId,
352
+ fields: DEFAULT_FIELDS + "," + DEFAULT_RELATIONS
338
353
  },
339
354
  {
340
355
  placeholderData: keepPreviousData
@@ -353,9 +368,9 @@ var SellerOrderSection = () => {
353
368
  if (isError) {
354
369
  throw error;
355
370
  }
356
- return /* @__PURE__ */ jsxs2(Container2, { className: "divide-y p-0", children: [
357
- /* @__PURE__ */ jsx3("div", { className: "flex items-center justify-between px-6 py-4", children: /* @__PURE__ */ jsx3(Heading2, { level: "h2", children: t("orders.domain") }) }),
358
- /* @__PURE__ */ jsx3(
371
+ return /* @__PURE__ */ jsxs3(Container3, { className: "divide-y p-0", children: [
372
+ /* @__PURE__ */ jsx4("div", { className: "flex items-center justify-between px-6 py-4", children: /* @__PURE__ */ jsx4(Heading3, { level: "h2", children: t("orders.domain") }) }),
373
+ /* @__PURE__ */ jsx4(
359
374
  _DataTable,
360
375
  {
361
376
  columns,
@@ -378,111 +393,34 @@ var SellerOrderSection = () => {
378
393
  )
379
394
  ] });
380
395
  };
381
- var columnHelper = createColumnHelper();
382
396
  var useColumns = () => {
397
+ const base = useOrderTableColumns({ exclude: ["customer"] });
383
398
  return useMemo(
384
- () => [
385
- columnHelper.display({
386
- id: "display_id",
387
- header: "Order",
388
- cell: ({ row }) => `#${row.original.display_id}`
389
- }),
390
- columnHelper.display({
391
- id: "created_at",
392
- header: "Date",
393
- cell: ({ row }) => /* @__PURE__ */ jsx3(DateCell, { date: row.original.created_at })
394
- }),
395
- columnHelper.display({
396
- id: "customer",
397
- header: "Customer",
398
- cell: ({ row }) => {
399
- return row.original.customer?.first_name && row.original.customer?.last_name ? `${row.original.customer?.first_name} ${row.original.customer?.last_name}` : row.original.customer?.email;
400
- }
401
- }),
402
- columnHelper.display({
403
- id: "status",
404
- header: "Order Status",
405
- cell: ({ row }) => /* @__PURE__ */ jsx3(
406
- Badge,
407
- {
408
- size: "2xsmall",
409
- color: getOrderStatusBadgeColor(row.original.status),
410
- children: formatStatus(row.original.status)
411
- }
412
- )
413
- }),
414
- columnHelper.display({
415
- id: "payment_status",
416
- header: "Payment Status",
417
- cell: ({ row }) => {
418
- const status = row.original?.payment_status;
419
- if (!status) return "-";
420
- return /* @__PURE__ */ jsx3(
421
- Badge,
422
- {
423
- size: "2xsmall",
424
- color: getPaymentStatusBadgeColor(status),
425
- children: formatStatus(status)
426
- }
427
- );
428
- }
429
- }),
430
- columnHelper.display({
431
- id: "fulfillment_status",
432
- header: "Fulfillment Status",
433
- cell: ({ row }) => {
434
- const status = row.original.fulfillment_status;
435
- if (!status) return "-";
436
- return /* @__PURE__ */ jsx3(
437
- Badge,
438
- {
439
- size: "2xsmall",
440
- color: getFulfillmentStatusBadgeColor(status),
441
- children: formatStatus(status)
442
- }
443
- );
444
- }
445
- }),
446
- columnHelper.display({
447
- id: "total",
448
- header: "Order Total",
449
- cell: ({ row }) => {
450
- if (typeof row.original.total === "undefined" || row.original.total === null) {
451
- return "-";
452
- }
453
- const formatted = getStylizedAmount(
454
- row.original.total,
455
- row.original.currency_code
456
- );
457
- return /* @__PURE__ */ jsx3("div", { className: "flex h-full w-full items-center justify-start overflow-hidden text-left", children: /* @__PURE__ */ jsx3("span", { className: "truncate", children: formatted }) });
458
- }
459
- })
460
- ],
461
- []
399
+ () => [...base],
400
+ [base]
462
401
  );
463
402
  };
464
403
 
465
404
  // src/pages/sellers/seller-details/components/seller-product-section.tsx
466
405
  import { useMemo as useMemo2 } from "react";
467
- import { PencilSquare as PencilSquare2, Trash } from "@medusajs/icons";
468
- import { Container as Container3, Heading as Heading3, toast as toast2, usePrompt as usePrompt2 } from "@medusajs/ui";
406
+ import { PencilSquare as PencilSquare3, Trash } from "@medusajs/icons";
407
+ import { Container as Container4, Heading as Heading4, toast as toast2, usePrompt as usePrompt2 } from "@medusajs/ui";
469
408
  import { keepPreviousData as keepPreviousData2 } from "@tanstack/react-query";
470
- import { createColumnHelper as createColumnHelper2 } from "@tanstack/react-table";
471
- import { useTranslation as useTranslation3 } from "react-i18next";
472
- import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
409
+ import { createColumnHelper } from "@tanstack/react-table";
410
+ import { useTranslation as useTranslation4 } from "react-i18next";
411
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
473
412
  var PAGE_SIZE2 = 10;
474
413
  var PREFIX2 = "selprod";
475
- var DEFAULT_FIELDS2 = "*collection,+type_id,+tag_id,+sales_channel_id,+status,+created_at,+updated_at";
476
- var SellerProductSection = () => {
477
- const { t } = useTranslation3();
414
+ var SellerProductSection = ({ sellerId }) => {
415
+ const { t } = useTranslation4();
478
416
  const { searchParams, raw } = useProductTableQuery({
479
417
  pageSize: PAGE_SIZE2,
480
418
  prefix: PREFIX2
481
419
  });
482
420
  const { products, count, isLoading, isError, error } = useProducts(
483
421
  {
484
- fields: DEFAULT_FIELDS2,
485
- ...searchParams
422
+ ...searchParams,
423
+ seller_id: sellerId
486
424
  },
487
425
  {
488
426
  placeholderData: keepPreviousData2
@@ -501,9 +439,9 @@ var SellerProductSection = () => {
501
439
  if (isError) {
502
440
  throw error;
503
441
  }
504
- return /* @__PURE__ */ jsxs3(Container3, { className: "divide-y p-0", children: [
505
- /* @__PURE__ */ jsx4("div", { className: "flex items-center justify-between px-6 py-4", children: /* @__PURE__ */ jsx4(Heading3, { level: "h2", children: t("products.domain") }) }),
506
- /* @__PURE__ */ jsx4(
442
+ return /* @__PURE__ */ jsxs4(Container4, { className: "divide-y p-0", children: [
443
+ /* @__PURE__ */ jsx5("div", { className: "flex items-center justify-between px-6 py-4", children: /* @__PURE__ */ jsx5(Heading4, { level: "h2", children: t("products.domain") }) }),
444
+ /* @__PURE__ */ jsx5(
507
445
  _DataTable,
508
446
  {
509
447
  columns,
@@ -526,9 +464,9 @@ var SellerProductSection = () => {
526
464
  )
527
465
  ] });
528
466
  };
529
- var columnHelper2 = createColumnHelper2();
467
+ var columnHelper = createColumnHelper();
530
468
  var useColumns2 = () => {
531
- const { t } = useTranslation3();
469
+ const { t } = useTranslation4();
532
470
  const prompt = usePrompt2();
533
471
  const handleDelete = async (product) => {
534
472
  const res = await prompt({
@@ -562,24 +500,24 @@ var useColumns2 = () => {
562
500
  };
563
501
  return useMemo2(
564
502
  () => [
565
- columnHelper2.display({
503
+ columnHelper.display({
566
504
  id: "product",
567
505
  header: "Product",
568
506
  cell: ({ row }) => {
569
- return /* @__PURE__ */ jsxs3("div", { className: "flex h-full w-full max-w-[250px] items-center gap-x-3 overflow-hidden", children: [
570
- /* @__PURE__ */ jsx4("div", { className: "w-fit flex-shrink-0", children: /* @__PURE__ */ jsx4(Thumbnail, { src: row.original.thumbnail }) }),
571
- /* @__PURE__ */ jsx4("span", { title: row.original.title, className: "truncate", children: row.original.title })
507
+ return /* @__PURE__ */ jsxs4("div", { className: "flex h-full w-full max-w-[250px] items-center gap-x-3 overflow-hidden", children: [
508
+ /* @__PURE__ */ jsx5("div", { className: "w-fit flex-shrink-0", children: /* @__PURE__ */ jsx5(Thumbnail, { src: row.original.thumbnail }) }),
509
+ /* @__PURE__ */ jsx5("span", { title: row.original.title, className: "truncate", children: row.original.title })
572
510
  ] });
573
511
  }
574
512
  }),
575
- columnHelper2.display({
513
+ columnHelper.display({
576
514
  id: "collection",
577
515
  header: "Collection",
578
516
  cell: ({ row }) => {
579
517
  return row.original.collection?.title;
580
518
  }
581
519
  }),
582
- columnHelper2.display({
520
+ columnHelper.display({
583
521
  id: "variants",
584
522
  header: "Variants",
585
523
  cell: ({ row }) => {
@@ -588,15 +526,15 @@ var useColumns2 = () => {
588
526
  return `${variants} ${suffix}`;
589
527
  }
590
528
  }),
591
- columnHelper2.display({
529
+ columnHelper.display({
592
530
  id: "status",
593
531
  header: "Status",
594
- cell: ({ row }) => /* @__PURE__ */ jsx4(ProductStatusCell, { status: row.original.status })
532
+ cell: ({ row }) => /* @__PURE__ */ jsx5(ProductStatusCell, { status: row.original.status })
595
533
  }),
596
- columnHelper2.display({
534
+ columnHelper.display({
597
535
  id: "actions",
598
536
  header: "",
599
- cell: ({ row }) => /* @__PURE__ */ jsx4(
537
+ cell: ({ row }) => /* @__PURE__ */ jsx5(
600
538
  ActionMenu,
601
539
  {
602
540
  groups: [
@@ -605,7 +543,7 @@ var useColumns2 = () => {
605
543
  {
606
544
  label: t("actions.edit"),
607
545
  to: `/products/${row.original.id}/edit`,
608
- icon: /* @__PURE__ */ jsx4(PencilSquare2, {})
546
+ icon: /* @__PURE__ */ jsx5(PencilSquare3, {})
609
547
  }
610
548
  ]
611
549
  },
@@ -614,7 +552,7 @@ var useColumns2 = () => {
614
552
  {
615
553
  label: t("actions.delete"),
616
554
  onClick: () => handleDelete(row.original),
617
- icon: /* @__PURE__ */ jsx4(Trash, {})
555
+ icon: /* @__PURE__ */ jsx5(Trash, {})
618
556
  }
619
557
  ]
620
558
  }
@@ -628,27 +566,30 @@ var useColumns2 = () => {
628
566
  };
629
567
 
630
568
  // src/pages/sellers/seller-details/components/seller-details.tsx
631
- import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
569
+ import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
632
570
  var SellerDetails = () => {
633
571
  const { id } = useParams();
634
572
  const { seller, isLoading, isError, error } = useSeller(id);
635
573
  if (isLoading || !seller) {
636
- return /* @__PURE__ */ jsx5(SingleColumnPageSkeleton, { sections: 2, showJSON: true, showMetadata: true });
574
+ return /* @__PURE__ */ jsx6(SingleColumnPageSkeleton, { sections: 2, showJSON: true, showMetadata: true });
637
575
  }
638
576
  if (isError) {
639
577
  throw error;
640
578
  }
641
- return /* @__PURE__ */ jsxs4(
642
- SingleColumnPage,
579
+ return /* @__PURE__ */ jsxs5(
580
+ TwoColumnPage,
643
581
  {
644
582
  data: seller,
645
583
  hasOutlet: true,
646
584
  showJSON: true,
647
585
  showMetadata: true,
648
586
  children: [
649
- /* @__PURE__ */ jsx5(SellerGeneralSection, { seller }),
650
- /* @__PURE__ */ jsx5(SellerOrderSection, {}),
651
- /* @__PURE__ */ jsx5(SellerProductSection, {})
587
+ /* @__PURE__ */ jsxs5(TwoColumnPage.Main, { children: [
588
+ /* @__PURE__ */ jsx6(SellerGeneralSection, { seller }),
589
+ /* @__PURE__ */ jsx6(SellerOrderSection, { sellerId: seller.id }),
590
+ /* @__PURE__ */ jsx6(SellerProductSection, { sellerId: seller.id })
591
+ ] }),
592
+ /* @__PURE__ */ jsx6(TwoColumnPage.Sidebar, { children: /* @__PURE__ */ jsx6(SellerAddressSection, { seller }) })
652
593
  ]
653
594
  }
654
595
  );