@mercurjs/admin 2.2.0-canary.20 → 2.2.0-canary.21

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 (144) hide show
  1. package/dist/{add-campaign-promotions-BNLH6QN5.js → add-campaign-promotions-EB2MYHMZ.js} +3 -3
  2. package/dist/{adjust-inventory-2LHBQAWK.js → adjust-inventory-KNHM7QEV.js} +6 -6
  3. package/dist/{api-key-management-detail-R5QQPNOD.js → api-key-management-detail-ELMPBXEB.js} +7 -7
  4. package/dist/{attribute-create-JW7OXOK2.js → attribute-create-Q3IEGYRG.js} +6 -6
  5. package/dist/{attribute-detail-3Z6MTMJT.js → attribute-detail-SDYWELHS.js} +6 -6
  6. package/dist/{attribute-list-WRTXTFED.js → attribute-list-HW3R6764.js} +6 -6
  7. package/dist/{campaign-detail-ROTJ4SWD.js → campaign-detail-EAARQB3E.js} +10 -10
  8. package/dist/{categories-metadata-EPKUI3R4.js → categories-metadata-INVMU224.js} +6 -6
  9. package/dist/{category-detail-ICACLNJ3.js → category-detail-ABK4MEZP.js} +6 -6
  10. package/dist/{category-products-V4H3B6ML.js → category-products-HTNBFHSW.js} +6 -6
  11. package/dist/{chunk-AGXO2H4E.js → chunk-2KPITPB7.js} +1 -1
  12. package/dist/{chunk-A7RM5JXC.js → chunk-3LYOKDUA.js} +1 -1
  13. package/dist/{chunk-VKOE5J66.js → chunk-3XOE4NV5.js} +11 -2
  14. package/dist/{chunk-SNCZQATG.js → chunk-4GRFDNQQ.js} +2 -2
  15. package/dist/{chunk-4Q5JHL4V.js → chunk-4O7GPTNJ.js} +1 -1
  16. package/dist/{chunk-2NA54XKC.js → chunk-5NQUJQXX.js} +57 -0
  17. package/dist/{chunk-2HMWS5UW.js → chunk-67RX3M6X.js} +154 -23
  18. package/dist/{chunk-IER5BQNC.js → chunk-6YPV4T3R.js} +1 -1
  19. package/dist/{chunk-2MYHGOPY.js → chunk-7IVRL4AF.js} +1 -1
  20. package/dist/{chunk-HR7TFO2X.js → chunk-A3IFGUDD.js} +3 -3
  21. package/dist/{chunk-7VPJ4C6F.js → chunk-AH3KBVKC.js} +1 -1
  22. package/dist/{chunk-CMHI2RPL.js → chunk-AKSUGT5I.js} +21 -0
  23. package/dist/{chunk-7JZVZ5EX.js → chunk-ARN66CDK.js} +1 -1
  24. package/dist/chunk-BN6OOLJA.js +358 -0
  25. package/dist/{chunk-WETV577Q.js → chunk-CPWOVYZE.js} +1 -1
  26. package/dist/{chunk-JQV7CXEC.js → chunk-EDDKIVMF.js} +17 -2
  27. package/dist/{chunk-HI6L7DXI.js → chunk-G66KMUI5.js} +1 -1
  28. package/dist/{chunk-SJKLYS3R.js → chunk-IO5S4RFO.js} +3 -3
  29. package/dist/{chunk-PWFZCT6H.js → chunk-JAPKOO4T.js} +1 -1
  30. package/dist/{chunk-FFNSWUDC.js → chunk-LNPJFQWA.js} +11 -4
  31. package/dist/{chunk-KXIA66EJ.js → chunk-PAEKCYFU.js} +7 -3
  32. package/dist/{chunk-MHVZVF6O.js → chunk-PT3DTHQK.js} +1 -1
  33. package/dist/{chunk-PRBE5CM3.js → chunk-QYDWMBEX.js} +31 -0
  34. package/dist/{chunk-Z3SUMFDT.js → chunk-R2UDZINP.js} +214 -38
  35. package/dist/{chunk-Z2UBJXTU.js → chunk-RDTFLHYO.js} +1 -1
  36. package/dist/{chunk-BGQ7H2KL.js → chunk-SMQM5N45.js} +2 -2
  37. package/dist/{chunk-I5THQVYP.js → chunk-XIFE4VUR.js} +1 -1
  38. package/dist/{chunk-7XBB24GO.js → chunk-YUECTKEY.js} +1 -1
  39. package/dist/{chunk-4VXYPZMT.js → chunk-Z7AXFQPD.js} +2 -2
  40. package/dist/{collection-add-products-PBCIG33C.js → collection-add-products-CKF2VFVK.js} +6 -6
  41. package/dist/{collection-create-7G3MHBVQ.js → collection-create-UNGPKT7H.js} +83 -12
  42. package/dist/{collection-detail-3OLBOV24.js → collection-detail-36QTD3ZU.js} +9 -7
  43. package/dist/collection-icon-edit-V4SNBMD5.js +117 -0
  44. package/dist/{collection-list-S4ICG5T6.js → collection-list-UN7C36DU.js} +15 -12
  45. package/dist/collection-media-ESJUYVF7.js +654 -0
  46. package/dist/{collection-metadata-VUOECEP4.js → collection-metadata-6SD67JUV.js} +6 -6
  47. package/dist/{customer-create-RW63XPQ6.js → customer-create-HZXLOIZH.js} +1 -1
  48. package/dist/{customer-create-address-SZCOIGDP.js → customer-create-address-AEZNVQOG.js} +1 -1
  49. package/dist/{customer-detail-MT2R7DFI.js → customer-detail-3OQ7RSDN.js} +9 -13
  50. package/dist/{customer-edit-ZBIZ4FKT.js → customer-edit-MMRTWOAF.js} +1 -1
  51. package/dist/customer-edit-address-AEYX2LMP.js +302 -0
  52. package/dist/{customer-group-add-customers-SG7EU4D7.js → customer-group-add-customers-4OAYSXWK.js} +2 -2
  53. package/dist/{customer-group-create-LFGY5HR6.js → customer-group-create-25JT74S3.js} +1 -1
  54. package/dist/{customer-group-detail-MCAEXZYM.js → customer-group-detail-CH4UIK3X.js} +8 -8
  55. package/dist/{customer-group-edit-CXWQSMDZ.js → customer-group-edit-AAI47MUL.js} +1 -1
  56. package/dist/{customer-group-list-V4PW33M5.js → customer-group-list-777C2B57.js} +9 -9
  57. package/dist/{customer-group-metadata-J622TR4I.js → customer-group-metadata-ELFKJMYK.js} +6 -6
  58. package/dist/{customer-list-MB6WZFMA.js → customer-list-U7VFBV7E.js} +3 -3
  59. package/dist/{customer-metadata-SFS5VRK5.js → customer-metadata-4H6ADARR.js} +6 -6
  60. package/dist/{customers-add-customer-group-G6FIKKUP.js → customers-add-customer-group-AZ3ILZMA.js} +8 -8
  61. package/dist/{edit-inventory-item-OFPVTJ4I.js → edit-inventory-item-NL5WNNI3.js} +6 -6
  62. package/dist/{edit-inventory-item-attributes-Z37AFIYM.js → edit-inventory-item-attributes-2JEH72WW.js} +6 -6
  63. package/dist/{edit-rules-JG62MLUS.js → edit-rules-XYTK7DQ2.js} +6 -6
  64. package/dist/index.js +156 -144
  65. package/dist/{inventory-create-3IM54ZO3.js → inventory-create-7RQSCNCQ.js} +6 -6
  66. package/dist/{inventory-detail-POKYZVLA.js → inventory-detail-W7BGKWKL.js} +6 -6
  67. package/dist/{inventory-metadata-XXYKRUNP.js → inventory-metadata-ZGLTDSQB.js} +6 -6
  68. package/dist/{inventory-stock-CXPPGARO.js → inventory-stock-US7LGBC4.js} +6 -6
  69. package/dist/{location-detail-PHT367V5.js → location-detail-GAINHCV5.js} +6 -6
  70. package/dist/{location-fulfillment-providers-EZOVLJWL.js → location-fulfillment-providers-6DFBFALS.js} +8 -8
  71. package/dist/{location-list-HVSRDHOW.js → location-list-QXIHD6NJ.js} +6 -6
  72. package/dist/{location-service-zone-shipping-option-create-VZBL7MK6.js → location-service-zone-shipping-option-create-AUNZVIGU.js} +6 -6
  73. package/dist/{login-LJMTSRAG.js → login-NFPUZDAL.js} +6 -6
  74. package/dist/{marketplace-detail-WINAJJDB.js → marketplace-detail-M7DWNMIH.js} +6 -6
  75. package/dist/{marketplace-metadata-CCUK2B4Q.js → marketplace-metadata-FYJ7TJLZ.js} +6 -6
  76. package/dist/{offers-5LSNWJ6B.js → offers-PYM6LQSX.js} +6 -6
  77. package/dist/{order-create-exchange-6IQJFYUK.js → order-create-exchange-4PWNGE6U.js} +6 -6
  78. package/dist/{order-create-refund-DUVGD54U.js → order-create-refund-A4AXOFZC.js} +6 -6
  79. package/dist/{order-detail-Y6SFV44C.js → order-detail-HPYAUA2N.js} +7 -7
  80. package/dist/{order-edit-billing-address-IW6UIARN.js → order-edit-billing-address-R7DOKCV5.js} +7 -7
  81. package/dist/{order-edit-email-D5XIYASI.js → order-edit-email-44O3ARQ4.js} +6 -6
  82. package/dist/{order-edit-shipping-address-4VJDVGKJ.js → order-edit-shipping-address-UI2AHBXW.js} +6 -6
  83. package/dist/{order-list-KWHMMX2M.js → order-list-IVXCYRGB.js} +4 -4
  84. package/dist/{order-metadata-QSTGFW66.js → order-metadata-3U5KT3MW.js} +6 -6
  85. package/dist/{order-request-transfer-GYBTSHU4.js → order-request-transfer-OM3BPIWZ.js} +6 -6
  86. package/dist/pages/index.d.ts +33 -9
  87. package/dist/pages/index.js +91 -90
  88. package/dist/{price-list-configuration-SNL2LNV2.js → price-list-configuration-6LD6DTEQ.js} +6 -5
  89. package/dist/{price-list-create-LPJWSOBP.js → price-list-create-SR24HYH3.js} +11 -11
  90. package/dist/{price-list-detail-7AUDNRSM.js → price-list-detail-QIMJQ6DD.js} +9 -9
  91. package/dist/{price-list-edit-BOEBNVGM.js → price-list-edit-MEM47NGY.js} +2 -2
  92. package/dist/{price-list-list-AX7ZW6LL.js → price-list-list-GIVZGIYW.js} +4 -4
  93. package/dist/{price-list-prices-add-5IOYBCXV.js → price-list-prices-add-VE5RTT5O.js} +7 -7
  94. package/dist/{price-list-prices-edit-DT2DLFTO.js → price-list-prices-edit-R52K4MBL.js} +7 -7
  95. package/dist/{product-add-existing-attributes-LNZK2LHX.js → product-add-existing-attributes-AC4643LI.js} +6 -6
  96. package/dist/{product-create-QYEZHBTC.js → product-create-R5HJ2GYT.js} +9 -9
  97. package/dist/{product-detail-Q6YF7IYX.js → product-detail-77DV4TAW.js} +6 -6
  98. package/dist/{product-list-IDRT4WUK.js → product-list-4JGMM4AF.js} +6 -6
  99. package/dist/{product-media-6H34CVXJ.js → product-media-OL4ETNFW.js} +2 -2
  100. package/dist/{product-metadata-VJMZL753.js → product-metadata-H53ZIWBS.js} +6 -6
  101. package/dist/{product-tag-create-4FYE46PE.js → product-tag-create-4OT4PMCG.js} +6 -6
  102. package/dist/{product-tag-detail-WF34TUQR.js → product-tag-detail-NVTDW7BR.js} +15 -13
  103. package/dist/{product-tag-edit-HRWMMCUC.js → product-tag-edit-RXF6ZZ6E.js} +6 -6
  104. package/dist/{product-tag-list-PK43EMMH.js → product-tag-list-T6BDTH24.js} +15 -13
  105. package/dist/{product-tag-metadata-ONSEQTEW.js → product-tag-metadata-HN5QRCYY.js} +6 -6
  106. package/dist/{product-type-detail-J466AJUQ.js → product-type-detail-KOGHJIMG.js} +6 -6
  107. package/dist/{product-type-metadata-CXYKP2OF.js → product-type-metadata-QUCMB3ZJ.js} +6 -6
  108. package/dist/{product-variant-detail-FXQZLB7Q.js → product-variant-detail-6XBLXEXQ.js} +6 -6
  109. package/dist/{product-variant-edit-CYEISGII.js → product-variant-edit-3KAFS4OC.js} +6 -6
  110. package/dist/{product-variant-metadata-YQ2GKWW7.js → product-variant-metadata-N5H2VPGQ.js} +6 -6
  111. package/dist/{promotion-create-KNK57JWD.js → promotion-create-Y2XVWGAT.js} +6 -6
  112. package/dist/{promotion-detail-EUQ5LK2V.js → promotion-detail-SCS7MWD7.js} +9 -9
  113. package/dist/{promotion-list-M5SAE7A3.js → promotion-list-ZFF4E4ZW.js} +4 -4
  114. package/dist/{refund-reason-create-ANAVZO2N.js → refund-reason-create-CIXYHBRC.js} +6 -6
  115. package/dist/{refund-reason-edit-HKEVJ6A5.js → refund-reason-edit-AXMEDPRT.js} +6 -6
  116. package/dist/{refund-reason-list-FBH43XVP.js → refund-reason-list-F56TJAGR.js} +13 -11
  117. package/dist/{region-metadata-XHT3A6D7.js → region-metadata-QGH7IBQU.js} +6 -6
  118. package/dist/{reservation-detail-T3VHDWP6.js → reservation-detail-7TL2OFEM.js} +6 -6
  119. package/dist/{reservation-metadata-4LVLM4UW.js → reservation-metadata-UXACXYO6.js} +6 -6
  120. package/dist/{reset-password-RF5J4RIU.js → reset-password-Y7HXY2NX.js} +1 -1
  121. package/dist/{return-reason-list-4JWWSFOS.js → return-reason-list-EJ5DLDR2.js} +7 -5
  122. package/dist/{sales-channel-add-products-FNJQKCQQ.js → sales-channel-add-products-7ERGMGJ7.js} +6 -6
  123. package/dist/{sales-channel-detail-HXJAR6M4.js → sales-channel-detail-LWVBJCJQ.js} +6 -6
  124. package/dist/{sales-channel-list-YYIH254X.js → sales-channel-list-I72W2XTH.js} +6 -6
  125. package/dist/{sales-channel-metadata-YF5AV2XX.js → sales-channel-metadata-RD6QDHRW.js} +6 -6
  126. package/dist/{shipping-option-type-create-TOONS7EC.js → shipping-option-type-create-LXYYXNSQ.js} +6 -6
  127. package/dist/{shipping-option-type-detail-VXZ4UQQI.js → shipping-option-type-detail-2IQSQ5BQ.js} +6 -6
  128. package/dist/{shipping-option-type-edit-6WO2XRLE.js → shipping-option-type-edit-4XKXWCN3.js} +6 -6
  129. package/dist/{shipping-option-type-list-S7TW7Q3R.js → shipping-option-type-list-QA2TA7XQ.js} +6 -6
  130. package/dist/{shipping-profile-metadata-SVD3WK7H.js → shipping-profile-metadata-PVNYV7DY.js} +6 -6
  131. package/dist/{store-create-7A5OSRIV.js → store-create-F6W5CSH2.js} +6 -6
  132. package/dist/{store-details-LSGSI4QU.js → store-details-CSHIHCVO.js} +10 -10
  133. package/dist/{store-edit-TP5CQHV7.js → store-edit-YEWQFHHM.js} +2 -2
  134. package/dist/{store-list-KQGPNQQ4.js → store-list-FGLLHZPD.js} +10 -10
  135. package/dist/{tax-region-create-JR7OHOJ5.js → tax-region-create-YQ5YBOC3.js} +7 -7
  136. package/dist/{tax-region-detail-2E56T5C2.js → tax-region-detail-EU5U3SFN.js} +6 -6
  137. package/dist/{tax-region-edit-7SBQFGPY.js → tax-region-edit-XHO3ELVD.js} +6 -6
  138. package/dist/{tax-region-metadata-4NUEQV3N.js → tax-region-metadata-NYTCYO6D.js} +6 -6
  139. package/dist/{tax-region-province-detail-5Q5E5OP7.js → tax-region-province-detail-U4RULBEK.js} +6 -6
  140. package/dist/{tax-region-tax-override-create-S5S5JZEJ.js → tax-region-tax-override-create-5MIAKHY6.js} +15 -13
  141. package/dist/{tax-region-tax-override-edit-JBG3MRNC.js → tax-region-tax-override-edit-EHLIO56A.js} +15 -13
  142. package/dist/{user-metadata-2D552EAR.js → user-metadata-VCWUSKHV.js} +6 -6
  143. package/package.json +1 -1
  144. package/dist/{chunk-WTPWO7KS.js → chunk-KAAUSK5T.js} +3 -3
@@ -1,21 +1,32 @@
1
- import {
2
- useOrderTableColumns
3
- } from "./chunk-DBYUB2YI.js";
4
- import {
5
- useOrderTableFilters
6
- } from "./chunk-J3AMUGGZ.js";
7
1
  import {
8
2
  useCustomerGroupTableColumns
9
3
  } from "./chunk-54EPH67T.js";
10
4
  import {
11
5
  useCustomerGroupTableFilters
12
- } from "./chunk-CMHI2RPL.js";
6
+ } from "./chunk-AKSUGT5I.js";
13
7
  import {
14
8
  useOrderTableQuery
15
9
  } from "./chunk-QUHSHIAC.js";
16
10
  import {
17
11
  useCustomerGroupTableQuery
18
- } from "./chunk-VKOE5J66.js";
12
+ } from "./chunk-3XOE4NV5.js";
13
+ import {
14
+ FulfillmentStatusCell,
15
+ FulfillmentStatusHeader,
16
+ PaymentStatusCell,
17
+ PaymentStatusHeader
18
+ } from "./chunk-TZSOL34K.js";
19
+ import {
20
+ DateCell,
21
+ DateHeader
22
+ } from "./chunk-25LYVP3C.js";
23
+ import {
24
+ getStylizedAmount
25
+ } from "./chunk-PXYDR7WQ.js";
26
+ import {
27
+ TextCell,
28
+ TextHeader
29
+ } from "./chunk-JHIMVLB2.js";
19
30
  import {
20
31
  _DataTable,
21
32
  useDataTable
@@ -27,8 +38,8 @@ import {
27
38
  TwoColumnPage
28
39
  } from "./chunk-E74OUNA3.js";
29
40
  import {
30
- useOrders
31
- } from "./chunk-RMAQKNBA.js";
41
+ useOrderGroups
42
+ } from "./chunk-VYMODH6P.js";
32
43
  import {
33
44
  useBatchCustomerCustomerGroups,
34
45
  useCustomer,
@@ -36,7 +47,7 @@ import {
36
47
  useDeleteCustomer,
37
48
  useDeleteCustomerAddress,
38
49
  useRemoveCustomersFromGroup
39
- } from "./chunk-PRBE5CM3.js";
50
+ } from "./chunk-QYDWMBEX.js";
40
51
  import {
41
52
  ActionMenu
42
53
  } from "./chunk-BDGZ4EQO.js";
@@ -49,9 +60,9 @@ import { Children } from "react";
49
60
  import { useLoaderData, useParams } from "react-router-dom";
50
61
 
51
62
  // src/pages/customers/customer-detail/components/customer-address-section/customer-address-section.tsx
52
- import { clx, Container, Heading, toast, usePrompt } from "@medusajs/ui";
63
+ import { Button, clx, Container, Heading, toast, usePrompt } from "@medusajs/ui";
53
64
  import { useTranslation } from "react-i18next";
54
- import { Trash } from "@medusajs/icons";
65
+ import { PencilSquare, Trash } from "@medusajs/icons";
55
66
  import { Link, useNavigate } from "react-router-dom";
56
67
 
57
68
  // src/components/common/listicle/listicle.tsx
@@ -111,7 +122,7 @@ var CustomerAddressSection = ({
111
122
  return /* @__PURE__ */ jsxs2(Container, { className: "p-0", "data-testid": "customer-address-section", children: [
112
123
  /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between px-6 py-4", "data-testid": "customer-address-section-header", children: [
113
124
  /* @__PURE__ */ jsx2(Heading, { level: "h2", "data-testid": "customer-address-section-heading", children: t2("addresses.title") }),
114
- /* @__PURE__ */ jsx2(Link, { to: `create-address`, className: "text-ui-fg-muted text-xs", "data-testid": "customer-address-section-add-link", children: "Add" })
125
+ /* @__PURE__ */ jsx2(Link, { to: `create-address`, "data-testid": "customer-address-section-add-link", children: /* @__PURE__ */ jsx2(Button, { variant: "secondary", size: "small", "data-testid": "customer-address-section-create-button", children: t2("actions.create") }) })
115
126
  ] }),
116
127
  addresses.length === 0 && /* @__PURE__ */ jsx2("div", { "data-testid": "customer-address-section-no-records", children: /* @__PURE__ */ jsx2(
117
128
  NoRecords,
@@ -135,6 +146,15 @@ var CustomerAddressSection = ({
135
146
  {
136
147
  "data-testid": `customer-address-section-address-${address.id}-actions`,
137
148
  groups: [
149
+ {
150
+ actions: [
151
+ {
152
+ icon: /* @__PURE__ */ jsx2(PencilSquare, {}),
153
+ label: t2("actions.edit"),
154
+ to: `edit-address/${address.id}`
155
+ }
156
+ ]
157
+ },
138
158
  {
139
159
  actions: [
140
160
  {
@@ -156,7 +176,7 @@ var CustomerAddressSection = ({
156
176
  };
157
177
 
158
178
  // src/pages/customers/customer-detail/components/customer-general-section/customer-general-section.tsx
159
- import { PencilSquare, Trash as Trash2 } from "@medusajs/icons";
179
+ import { PencilSquare as PencilSquare2, Trash as Trash2 } from "@medusajs/icons";
160
180
  import {
161
181
  Container as Container2,
162
182
  Heading as Heading2,
@@ -220,7 +240,7 @@ var CustomerGeneralSection = ({
220
240
  actions: [
221
241
  {
222
242
  label: t2("actions.edit"),
223
- icon: /* @__PURE__ */ jsx3(PencilSquare, {}),
243
+ icon: /* @__PURE__ */ jsx3(PencilSquare2, {}),
224
244
  to: "edit"
225
245
  }
226
246
  ]
@@ -256,7 +276,7 @@ var CustomerGeneralSection = ({
256
276
 
257
277
  // src/pages/customers/customer-detail/components/customer-group-section/customer-group-section.tsx
258
278
  import {
259
- Button,
279
+ Button as Button2,
260
280
  Checkbox,
261
281
  Container as Container3,
262
282
  Heading as Heading3,
@@ -266,7 +286,7 @@ import {
266
286
  import { createColumnHelper } from "@tanstack/react-table";
267
287
  import { t } from "i18next";
268
288
  import { useMemo, useState } from "react";
269
- import { PencilSquare as PencilSquare2, Trash as Trash3 } from "@medusajs/icons";
289
+ import { PencilSquare as PencilSquare3, Trash as Trash3 } from "@medusajs/icons";
270
290
  import { keepPreviousData } from "@tanstack/react-query";
271
291
  import { useTranslation as useTranslation3 } from "react-i18next";
272
292
  import { Link as Link2 } from "react-router-dom";
@@ -285,7 +305,7 @@ var CustomerGroupSection = ({
285
305
  const { customer_groups, count, isLoading, isError, error } = useCustomerGroups(
286
306
  {
287
307
  ...searchParams,
288
- fields: "+customers.id",
308
+ fields: "+customers.id,+seller.id,+seller.name",
289
309
  customers: { id: customer.id }
290
310
  },
291
311
  {
@@ -344,7 +364,7 @@ var CustomerGroupSection = ({
344
364
  return /* @__PURE__ */ jsxs4(Container3, { className: "divide-y p-0", "data-testid": "customer-group-section", children: [
345
365
  /* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between px-6 py-4", "data-testid": "customer-group-section-header", children: [
346
366
  /* @__PURE__ */ jsx4(Heading3, { level: "h2", "data-testid": "customer-group-section-heading", children: t("customerGroups.domain") }),
347
- /* @__PURE__ */ jsx4(Link2, { to: `/customers/${customer.id}/add-customer-groups`, "data-testid": "customer-group-section-add-link", children: /* @__PURE__ */ jsx4(Button, { variant: "secondary", size: "small", "data-testid": "customer-group-section-add-button", children: t("general.add") }) })
367
+ /* @__PURE__ */ jsx4(Link2, { to: `/customers/${customer.id}/add-customer-groups`, "data-testid": "customer-group-section-add-link", children: /* @__PURE__ */ jsx4(Button2, { variant: "secondary", size: "small", "data-testid": "customer-group-section-add-button", children: t("general.add") }) })
348
368
  ] }),
349
369
  /* @__PURE__ */ jsx4(
350
370
  _DataTable,
@@ -413,7 +433,7 @@ var CustomerGroupRowActions = ({
413
433
  actions: [
414
434
  {
415
435
  label: t2("actions.edit"),
416
- icon: /* @__PURE__ */ jsx4(PencilSquare2, {}),
436
+ icon: /* @__PURE__ */ jsx4(PencilSquare3, {}),
417
437
  to: `/customer-groups/${group.id}/edit`
418
438
  },
419
439
  {
@@ -457,6 +477,14 @@ var useColumns = (customerId) => {
457
477
  }
458
478
  }),
459
479
  ...columns,
480
+ columnHelper.display({
481
+ id: "owner",
482
+ header: t("fields.owner"),
483
+ cell: ({ row }) => {
484
+ const seller = row.original.seller;
485
+ return /* @__PURE__ */ jsx4("span", { "data-testid": `customer-group-section-owner-${row.original.id}`, children: seller?.name ?? "-" });
486
+ }
487
+ }),
460
488
  columnHelper.display({
461
489
  id: "actions",
462
490
  cell: ({ row }) => /* @__PURE__ */ jsx4(
@@ -473,8 +501,8 @@ var useColumns = (customerId) => {
473
501
  };
474
502
 
475
503
  // src/pages/customers/customer-detail/components/customer-order-section/customer-order-section.tsx
476
- import { ArrowPath } from "@medusajs/icons";
477
- import { Container as Container4, Heading as Heading4 } from "@medusajs/ui";
504
+ import { ArrowPath, TriangleRightMini } from "@medusajs/icons";
505
+ import { Container as Container4, Heading as Heading4, IconButton, clx as clx2 } from "@medusajs/ui";
478
506
  import { keepPreviousData as keepPreviousData2 } from "@tanstack/react-query";
479
507
  import { createColumnHelper as createColumnHelper2 } from "@tanstack/react-table";
480
508
  import { useMemo as useMemo2 } from "react";
@@ -482,8 +510,59 @@ import { useTranslation as useTranslation4 } from "react-i18next";
482
510
  import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
483
511
  var PREFIX2 = "cusord";
484
512
  var PAGE_SIZE2 = 10;
485
- var DEFAULT_RELATIONS = "*customer,*items,*sales_channel";
486
- var DEFAULT_FIELDS = "id,status,display_id,created_at,email,fulfillment_status,payment_status,total,currency_code";
513
+ var DEFAULT_FIELDS = [
514
+ "id",
515
+ "display_id",
516
+ "customer_id",
517
+ "seller_count",
518
+ "total",
519
+ "created_at",
520
+ "updated_at",
521
+ "orders.id",
522
+ "orders.display_id",
523
+ "orders.created_at",
524
+ "orders.updated_at",
525
+ "orders.payment_status",
526
+ "orders.fulfillment_status",
527
+ "orders.total",
528
+ "orders.currency_code",
529
+ "*orders.seller"
530
+ ].join(",");
531
+ function transformOrderGroups(orderGroups, t2) {
532
+ return orderGroups.map((group) => {
533
+ const orders = group.orders ?? [];
534
+ const orderIds = orders.map((o) => `#${o.display_id}`).join(", ");
535
+ const currencyCode = orders[0]?.currency_code ?? "usd";
536
+ const children = orders.map((order) => ({
537
+ _type: "order",
538
+ id: order.id,
539
+ display_id: `#${order.display_id}`,
540
+ order_ids: "",
541
+ store: order.seller?.name ?? "-",
542
+ created_at: new Date(order.created_at),
543
+ updated_at: new Date(order.updated_at),
544
+ payment_status: order.payment_status ?? null,
545
+ fulfillment_status: order.fulfillment_status ?? null,
546
+ total: order.total ?? null,
547
+ currency_code: order.currency_code ?? "usd",
548
+ children: []
549
+ }));
550
+ return {
551
+ _type: "group",
552
+ id: group.id,
553
+ display_id: `#G${group.display_id}`,
554
+ order_ids: orderIds,
555
+ store: t2("orders.fields.vendorsCount", { count: group.seller_count }),
556
+ created_at: new Date(group.created_at),
557
+ updated_at: new Date(group.updated_at),
558
+ payment_status: null,
559
+ fulfillment_status: null,
560
+ total: group.total ?? null,
561
+ currency_code: currencyCode,
562
+ children
563
+ };
564
+ });
565
+ }
487
566
  var CustomerOrderSection = ({
488
567
  customer
489
568
  }) => {
@@ -492,22 +571,28 @@ var CustomerOrderSection = ({
492
571
  pageSize: PAGE_SIZE2,
493
572
  prefix: PREFIX2
494
573
  });
495
- const { orders, count, isLoading, isError, error } = useOrders(
574
+ const { order_groups, count, isLoading, isError, error } = useOrderGroups(
496
575
  {
497
576
  ...searchParams,
498
577
  customer_id: customer.id,
499
- fields: DEFAULT_FIELDS + "," + DEFAULT_RELATIONS
578
+ fields: DEFAULT_FIELDS
500
579
  },
501
580
  {
502
581
  placeholderData: keepPreviousData2
503
582
  }
504
583
  );
584
+ const rows = useMemo2(
585
+ () => transformOrderGroups(order_groups ?? [], t2),
586
+ [order_groups, t2]
587
+ );
505
588
  const columns = useColumns2();
506
- const filters = useOrderTableFilters();
507
589
  const { table } = useDataTable({
508
- data: orders ?? [],
590
+ data: rows,
509
591
  columns,
510
592
  enablePagination: true,
593
+ enableExpandableRows: true,
594
+ getSubRows: (row) => row.children,
595
+ getRowId: (row) => row.id,
511
596
  count,
512
597
  pageSize: PAGE_SIZE2,
513
598
  prefix: PREFIX2
@@ -523,8 +608,7 @@ var CustomerOrderSection = ({
523
608
  columns,
524
609
  table,
525
610
  pagination: true,
526
- navigateTo: (row) => `/orders/${row.original.id}`,
527
- filters,
611
+ navigateTo: (row) => row.original._type === "order" ? `/orders/${row.original.id}` : "",
528
612
  count,
529
613
  isLoading,
530
614
  pageSize: PAGE_SIZE2,
@@ -540,18 +624,18 @@ var CustomerOrderSection = ({
540
624
  )
541
625
  ] });
542
626
  };
543
- var CustomerOrderActions = ({ order }) => {
627
+ var CustomerOrderActions = ({ orderId }) => {
544
628
  const { t: t2 } = useTranslation4();
545
629
  return /* @__PURE__ */ jsx5(
546
630
  ActionMenu,
547
631
  {
548
- "data-testid": `customer-order-section-row-actions-${order.id}`,
632
+ "data-testid": `customer-order-section-row-actions-${orderId}`,
549
633
  groups: [
550
634
  {
551
635
  actions: [
552
636
  {
553
637
  label: t2("transferOwnership.label"),
554
- to: `${order.id}/transfer`,
638
+ to: `${orderId}/transfer`,
555
639
  icon: /* @__PURE__ */ jsx5(ArrowPath, {})
556
640
  }
557
641
  ]
@@ -562,16 +646,108 @@ var CustomerOrderActions = ({ order }) => {
562
646
  };
563
647
  var columnHelper2 = createColumnHelper2();
564
648
  var useColumns2 = () => {
565
- const base = useOrderTableColumns({ exclude: ["customer"] });
649
+ const { t: t2 } = useTranslation4();
566
650
  return useMemo2(
567
651
  () => [
568
- ...base,
652
+ columnHelper2.accessor("display_id", {
653
+ header: () => /* @__PURE__ */ jsx5(TextHeader, { text: t2("orders.fields.groupId") }),
654
+ cell: ({ row, getValue }) => {
655
+ if (row.original._type === "order") {
656
+ return null;
657
+ }
658
+ const expandHandler = row.getToggleExpandedHandler();
659
+ return /* @__PURE__ */ jsxs5("div", { className: "flex size-full items-center gap-x-2 overflow-hidden", children: [
660
+ /* @__PURE__ */ jsx5("div", { className: "flex size-7 items-center justify-center", children: row.getCanExpand() ? /* @__PURE__ */ jsx5(
661
+ IconButton,
662
+ {
663
+ type: "button",
664
+ onClick: (e) => {
665
+ e.stopPropagation();
666
+ e.preventDefault();
667
+ expandHandler();
668
+ },
669
+ size: "small",
670
+ variant: "transparent",
671
+ className: "text-ui-fg-subtle",
672
+ "data-testid": `customer-order-group-expand-${row.original.id}`,
673
+ children: /* @__PURE__ */ jsx5(
674
+ TriangleRightMini,
675
+ {
676
+ className: clx2({
677
+ "rotate-90 transition-transform will-change-transform": row.getIsExpanded()
678
+ })
679
+ }
680
+ )
681
+ }
682
+ ) : null }),
683
+ /* @__PURE__ */ jsx5("span", { className: "truncate", children: getValue() })
684
+ ] });
685
+ }
686
+ }),
687
+ columnHelper2.accessor("order_ids", {
688
+ header: () => /* @__PURE__ */ jsx5(TextHeader, { text: t2("orders.fields.orderIds") }),
689
+ cell: ({ row, getValue }) => {
690
+ if (row.original._type === "group") {
691
+ return /* @__PURE__ */ jsx5(TextCell, { text: getValue() });
692
+ }
693
+ return /* @__PURE__ */ jsx5(TextCell, { text: row.original.display_id });
694
+ }
695
+ }),
696
+ columnHelper2.accessor("store", {
697
+ header: () => /* @__PURE__ */ jsx5(TextHeader, { text: t2("fields.store") }),
698
+ cell: ({ getValue }) => /* @__PURE__ */ jsx5(TextCell, { text: getValue() })
699
+ }),
700
+ columnHelper2.accessor("created_at", {
701
+ header: () => /* @__PURE__ */ jsx5(DateHeader, {}),
702
+ cell: ({ getValue }) => /* @__PURE__ */ jsx5(DateCell, { date: getValue() })
703
+ }),
704
+ columnHelper2.accessor("payment_status", {
705
+ header: () => /* @__PURE__ */ jsx5(PaymentStatusHeader, {}),
706
+ cell: ({ row, getValue }) => {
707
+ if (row.original._type === "group") {
708
+ return null;
709
+ }
710
+ const status = getValue();
711
+ if (!status) {
712
+ return "-";
713
+ }
714
+ return /* @__PURE__ */ jsx5(PaymentStatusCell, { status });
715
+ }
716
+ }),
717
+ columnHelper2.accessor("fulfillment_status", {
718
+ header: () => /* @__PURE__ */ jsx5(FulfillmentStatusHeader, {}),
719
+ cell: ({ row, getValue }) => {
720
+ if (row.original._type === "group") {
721
+ return null;
722
+ }
723
+ const status = getValue();
724
+ if (!status) {
725
+ return "-";
726
+ }
727
+ return /* @__PURE__ */ jsx5(FulfillmentStatusCell, { status });
728
+ }
729
+ }),
730
+ columnHelper2.accessor("total", {
731
+ header: () => /* @__PURE__ */ jsx5(TextHeader, { text: t2("fields.total") }),
732
+ cell: ({ row, getValue }) => {
733
+ const total = getValue();
734
+ if (total == null) {
735
+ return "-";
736
+ }
737
+ return /* @__PURE__ */ jsx5(
738
+ TextCell,
739
+ {
740
+ text: getStylizedAmount(total, row.original.currency_code)
741
+ }
742
+ );
743
+ }
744
+ }),
569
745
  columnHelper2.display({
570
746
  id: "actions",
571
- cell: ({ row }) => /* @__PURE__ */ jsx5(CustomerOrderActions, { order: row.original })
747
+ cell: ({ row }) => row.original._type === "order" ? /* @__PURE__ */ jsx5(CustomerOrderActions, { orderId: row.original.id }) : null
572
748
  })
573
749
  ],
574
- [base]
750
+ [t2]
575
751
  );
576
752
  };
577
753
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  customerGroupsQueryKeys
3
- } from "./chunk-PRBE5CM3.js";
3
+ } from "./chunk-QYDWMBEX.js";
4
4
  import {
5
5
  productsQueryKeys
6
6
  } from "./chunk-M2E3PKA4.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-QG6PLWNH.js";
4
4
  import {
5
5
  useCustomerTableFilters
6
- } from "./chunk-I5THQVYP.js";
6
+ } from "./chunk-XIFE4VUR.js";
7
7
  import {
8
8
  useCustomerTableQuery
9
9
  } from "./chunk-PVZBDWLK.js";
@@ -16,7 +16,7 @@ import {
16
16
  } from "./chunk-H6MYB7GB.js";
17
17
  import {
18
18
  useCustomers
19
- } from "./chunk-PRBE5CM3.js";
19
+ } from "./chunk-QYDWMBEX.js";
20
20
  import {
21
21
  ActionMenu
22
22
  } from "./chunk-BDGZ4EQO.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useCustomerGroups
3
- } from "./chunk-PRBE5CM3.js";
3
+ } from "./chunk-QYDWMBEX.js";
4
4
 
5
5
  // src/hooks/table/filters/use-customer-table-filters.tsx
6
6
  import { useTranslation } from "react-i18next";
@@ -10,7 +10,7 @@ import {
10
10
  decorateVariantsWithDefaultValues,
11
11
  generateVariantsFromAttributes,
12
12
  normalizeProductFormValues
13
- } from "./chunk-AGXO2H4E.js";
13
+ } from "./chunk-2KPITPB7.js";
14
14
  import {
15
15
  HandleInput
16
16
  } from "./chunk-HJ56YXBU.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PriceListCustomerGroupRuleForm
3
- } from "./chunk-HR7TFO2X.js";
3
+ } from "./chunk-A3IFGUDD.js";
4
4
  import {
5
5
  PriceListCreateProductsSchema,
6
6
  PriceListRulesSchema,
@@ -43,7 +43,7 @@ import {
43
43
  } from "./chunk-3QSRE5LS.js";
44
44
  import {
45
45
  useCreatePriceList
46
- } from "./chunk-Z2UBJXTU.js";
46
+ } from "./chunk-RDTFLHYO.js";
47
47
  import {
48
48
  useDocumentDirection
49
49
  } from "./chunk-Y7QKP6QU.js";
@@ -33,25 +33,25 @@ import "./chunk-THHRRYRS.js";
33
33
  import "./chunk-6FLSBL4Q.js";
34
34
  import "./chunk-PJR6W35H.js";
35
35
  import "./chunk-OH4AABUT.js";
36
+ import "./chunk-FJHAAROU.js";
36
37
  import "./chunk-AEMDNTW5.js";
37
38
  import "./chunk-LYD3C73Z.js";
38
- import "./chunk-FJHAAROU.js";
39
39
  import "./chunk-533GMKEG.js";
40
40
  import "./chunk-YFRC6GEN.js";
41
41
  import "./chunk-N6SI4IIT.js";
42
- import "./chunk-46M463BR.js";
43
- import "./chunk-ZIFHQXP3.js";
44
42
  import "./chunk-JPNPTILP.js";
45
43
  import "./chunk-DAXXLQKB.js";
46
- import "./chunk-GKGLVDDV.js";
44
+ import "./chunk-46M463BR.js";
45
+ import "./chunk-ZIFHQXP3.js";
47
46
  import "./chunk-ESPLVOFC.js";
47
+ import "./chunk-GKGLVDDV.js";
48
48
  import "./chunk-WJJXUXSO.js";
49
49
  import "./chunk-LAPEZATU.js";
50
+ import "./chunk-RDTFLHYO.js";
50
51
  import {
51
52
  useCollection,
52
53
  useUpdateCollectionProducts
53
54
  } from "./chunk-QKJGSZI2.js";
54
- import "./chunk-Z2UBJXTU.js";
55
55
  import "./chunk-FXWKGNRV.js";
56
56
  import "./chunk-VDKOJ5WD.js";
57
57
  import "./chunk-ZN7LWXVC.js";
@@ -61,7 +61,7 @@ import "./chunk-XGUUM3S6.js";
61
61
  import "./chunk-RMAQKNBA.js";
62
62
  import "./chunk-VYMODH6P.js";
63
63
  import "./chunk-LEG67A2R.js";
64
- import "./chunk-PRBE5CM3.js";
64
+ import "./chunk-QYDWMBEX.js";
65
65
  import "./chunk-OKWGPKVK.js";
66
66
  import "./chunk-KYFWVLWO.js";
67
67
  import "./chunk-Y7QKP6QU.js";
@@ -1,6 +1,13 @@
1
+ import {
2
+ CollectionIconInput,
3
+ CollectionIconTip,
4
+ CollectionMediaInput,
5
+ uploadCollectionImages
6
+ } from "./chunk-BN6OOLJA.js";
1
7
  import {
2
8
  HandleInput
3
9
  } from "./chunk-HJ56YXBU.js";
10
+ import "./chunk-VSLHL2AZ.js";
4
11
  import "./chunk-TKGWSUEI.js";
5
12
  import {
6
13
  KeyboundForm
@@ -28,9 +35,22 @@ import { useForm } from "react-hook-form";
28
35
  import { useTranslation } from "react-i18next";
29
36
  import * as zod from "zod";
30
37
  import { jsx, jsxs } from "react/jsx-runtime";
38
+ var CollectionMediaSchema = zod.object({
39
+ url: zod.string(),
40
+ file: zod.any().nullable(),
41
+ is_thumbnail: zod.boolean(),
42
+ is_banner: zod.boolean(),
43
+ field_id: zod.string().optional()
44
+ });
45
+ var CollectionIconSchema = zod.object({
46
+ url: zod.string(),
47
+ file: zod.any().nullable()
48
+ });
31
49
  var CreateCollectionSchema = zod.object({
32
50
  title: zod.string().min(1),
33
- handle: zod.string().optional()
51
+ handle: zod.string().optional(),
52
+ media: zod.array(CollectionMediaSchema).optional(),
53
+ icon: CollectionIconSchema.nullable().optional()
34
54
  });
35
55
  var CreateCollectionForm = () => {
36
56
  const { t } = useTranslation();
@@ -38,21 +58,31 @@ var CreateCollectionForm = () => {
38
58
  const form = useForm({
39
59
  defaultValues: {
40
60
  title: "",
41
- handle: ""
61
+ handle: "",
62
+ media: [],
63
+ icon: null
42
64
  },
43
65
  resolver: zodResolver(CreateCollectionSchema)
44
66
  });
45
67
  const { mutateAsync, isPending } = useCreateCollection();
46
68
  const handleSubmit = form.handleSubmit(async (data) => {
47
- await mutateAsync(data, {
48
- onSuccess: ({ collection }) => {
49
- handleSuccess(`/collections/${collection.id}`);
50
- toast.success(t("collections.createSuccess"));
51
- },
52
- onError: (error) => {
53
- toast.error(error.message);
54
- }
69
+ const { media, icon, ...rest } = data;
70
+ const images = await uploadCollectionImages({
71
+ media: media ?? [],
72
+ icon: icon ?? null
55
73
  });
74
+ await mutateAsync(
75
+ { ...rest, ...images },
76
+ {
77
+ onSuccess: ({ collection }) => {
78
+ handleSuccess(`/collections/${collection.id}`);
79
+ toast.success(t("collections.createSuccess"));
80
+ },
81
+ onError: (error) => {
82
+ toast.error(error.message);
83
+ }
84
+ }
85
+ );
56
86
  });
57
87
  return /* @__PURE__ */ jsx(RouteFocusModal.Form, { form, "data-testid": "collection-create-form", children: /* @__PURE__ */ jsxs(
58
88
  KeyboundForm,
@@ -61,7 +91,7 @@ var CreateCollectionForm = () => {
61
91
  className: "flex h-full flex-col overflow-hidden",
62
92
  children: [
63
93
  /* @__PURE__ */ jsx(RouteFocusModal.Header, {}),
64
- /* @__PURE__ */ jsx(RouteFocusModal.Body, { className: "flex size-full flex-col items-center p-16", "data-testid": "collection-create-form-body", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", "data-testid": "collection-create-form-content", children: [
94
+ /* @__PURE__ */ jsx(RouteFocusModal.Body, { className: "flex size-full flex-col items-center overflow-auto p-16", "data-testid": "collection-create-form-body", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", "data-testid": "collection-create-form-content", children: [
65
95
  /* @__PURE__ */ jsxs("div", { "data-testid": "collection-create-form-header", children: [
66
96
  /* @__PURE__ */ jsx(Heading, { "data-testid": "collection-create-form-heading", children: t("collections.createCollection") }),
67
97
  /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", "data-testid": "collection-create-form-hint", children: t("collections.createCollectionHint") })
@@ -103,7 +133,48 @@ var CreateCollectionForm = () => {
103
133
  }
104
134
  }
105
135
  )
106
- ] })
136
+ ] }),
137
+ /* @__PURE__ */ jsx(
138
+ Form.Field,
139
+ {
140
+ control: form.control,
141
+ name: "media",
142
+ render: ({ field: { value, onChange } }) => /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "collection-create-form-media-item", children: [
143
+ /* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("collections.media.label") }),
144
+ /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
145
+ CollectionMediaInput,
146
+ {
147
+ value: value ?? [],
148
+ onChange,
149
+ hasError: !!form.formState.errors.media
150
+ }
151
+ ) }),
152
+ /* @__PURE__ */ jsx(Form.ErrorMessage, {})
153
+ ] })
154
+ }
155
+ ),
156
+ /* @__PURE__ */ jsx(
157
+ Form.Field,
158
+ {
159
+ control: form.control,
160
+ name: "icon",
161
+ render: ({ field: { value, onChange } }) => /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "collection-create-form-icon-item", children: [
162
+ /* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("collections.icon.label") }),
163
+ /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-2", children: [
164
+ /* @__PURE__ */ jsx(
165
+ CollectionIconInput,
166
+ {
167
+ value: value ?? null,
168
+ onChange,
169
+ hasError: !!form.formState.errors.icon
170
+ }
171
+ ),
172
+ /* @__PURE__ */ jsx(CollectionIconTip, {})
173
+ ] }) }),
174
+ /* @__PURE__ */ jsx(Form.ErrorMessage, {})
175
+ ] })
176
+ }
177
+ )
107
178
  ] }) }),
108
179
  /* @__PURE__ */ jsxs(RouteFocusModal.Footer, { "data-testid": "collection-create-form-footer", children: [
109
180
  /* @__PURE__ */ jsx(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", "data-testid": "collection-create-form-cancel-button", children: t("actions.cancel") }) }),