@mercurjs/vendor 2.2.0-canary.11 → 2.2.0-canary.13

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 (121) hide show
  1. package/dist/{[id]-EKLRGVBA.js → [id]-ET35KT2M.js} +3 -3
  2. package/dist/{[id]-A55T2ORL.js → [id]-FALIOGXK.js} +3 -4
  3. package/dist/{[id]-GC3ZYPK4.js → [id]-GY5R652O.js} +5 -6
  4. package/dist/{[id]-GBT6VB4S.js → [id]-IGQTT3AM.js} +4 -5
  5. package/dist/{[id]-SHAJTJNZ.js → [id]-IW2AZE77.js} +5 -6
  6. package/dist/{[id]-FE5GYYVZ.js → [id]-OTK2NOXT.js} +3 -4
  7. package/dist/{[id]-U5KZEQDR.js → [id]-PEUI67SP.js} +2 -2
  8. package/dist/{[id]-T5ECVBPF.js → [id]-RFEYRBLI.js} +4 -5
  9. package/dist/{[id]-B4YZTANM.js → [id]-US6IULL2.js} +205 -484
  10. package/dist/{[id]-QOEO3JOV.js → [id]-YZSVSJWU.js} +3 -4
  11. package/dist/{[id]-QQU5HVFU.js → [id]-ZMLS73X5.js} +4 -5
  12. package/dist/{[province_id]-6GUA4PV5.js → [province_id]-J3OB2LZ4.js} +5 -6
  13. package/dist/{add-NTRYWOJF.js → add-XEUXK63F.js} +6 -7
  14. package/dist/{add-customer-groups-U5RZWW4B.js → add-customer-groups-HZNWWRVG.js} +3 -4
  15. package/dist/{add-products-Q4MMDQKT.js → add-products-E5GULF6B.js} +4 -5
  16. package/dist/{add-promotions-3AYXQXTP.js → add-promotions-KW5YZHLS.js} +3 -3
  17. package/dist/{address-77Y3AOQ3.js → address-6T4H6P7O.js} +3 -4
  18. package/dist/{breadcrumb-EVZIOB2G.js → breadcrumb-5HYIEPCL.js} +3 -4
  19. package/dist/{breadcrumb-TNJSGX4T.js → breadcrumb-HL7NKNX4.js} +3 -4
  20. package/dist/{breadcrumb-THJ2HPRB.js → breadcrumb-L3MFH4I2.js} +9 -8
  21. package/dist/{breadcrumb-5NP23D6X.js → breadcrumb-LKLWHB63.js} +4 -5
  22. package/dist/breadcrumb-ZMACILH3.js +28 -0
  23. package/dist/chunk-4WCPN4OA.js +315 -0
  24. package/dist/{chunk-LDZCCWJB.js → chunk-5YCDZ4AU.js} +1 -1
  25. package/dist/{chunk-OYKUQXJX.js → chunk-A6QH53CS.js} +21 -10
  26. package/dist/{chunk-GN6KB75Z.js → chunk-AQTEEQWX.js} +1 -1
  27. package/dist/{chunk-K6LOZ4S3.js → chunk-DEJIBIQZ.js} +1 -1
  28. package/dist/{chunk-4LVP635F.js → chunk-DNEPOMOX.js} +125 -125
  29. package/dist/{chunk-25E4KME5.js → chunk-J7ZU2HZZ.js} +1 -1
  30. package/dist/{chunk-OZ44ATGE.js → chunk-KJWVLGXG.js} +2 -2
  31. package/dist/{chunk-LKUW5SV4.js → chunk-LDX23XPT.js} +1 -1
  32. package/dist/{chunk-XP23ZVQT.js → chunk-MVYAN2RR.js} +4 -4
  33. package/dist/{chunk-TBYCZRZ7.js → chunk-R5QZO3QY.js} +14 -5
  34. package/dist/{chunk-UORPTGV2.js → chunk-SIEEMXNZ.js} +10 -14
  35. package/dist/chunk-SJT6A4AV.js +354 -0
  36. package/dist/{chunk-FWS4YJ4B.js → chunk-STWHJLVV.js} +1 -1
  37. package/dist/{chunk-TYESCFYW.js → chunk-UDOBGAP7.js} +1 -1
  38. package/dist/{chunk-6K6EQOJF.js → chunk-VAOJVT7R.js} +1 -1
  39. package/dist/{chunk-VCOQ7WQ2.js → chunk-VMFC2UDJ.js} +1 -1
  40. package/dist/chunk-XQUF3WIS.js +159 -0
  41. package/dist/{chunk-7IPCLQ5V.js → chunk-YPTJETJQ.js} +2 -2
  42. package/dist/{chunk-X4GWB6AT.js → chunk-ZBSFGCWY.js} +2 -2
  43. package/dist/{chunk-YGJCJBPM.js → chunk-ZPH3WXJ6.js} +1 -1
  44. package/dist/{collections-URH2TCWJ.js → collections-HO2F62RN.js} +4 -5
  45. package/dist/{create-FKRYB7ZS.js → create-7EVR4N6N.js} +1 -1
  46. package/dist/{create-JF2OUZQA.js → create-DB4EYPJ5.js} +3 -4
  47. package/dist/{create-JGYG5SBM.js → create-EFMCNOR5.js} +6 -7
  48. package/dist/{create-MS6KKFSV.js → create-FBPPNBLQ.js} +3 -4
  49. package/dist/{create-ODOFJF5N.js → create-J5OLH7OJ.js} +7 -8
  50. package/dist/{create-O35JRZEF.js → create-QAEOARJO.js} +4 -5
  51. package/dist/{create-HVZYJ3YC.js → create-QZBCYHHQ.js} +8 -9
  52. package/dist/{create-A7B3MLJX.js → create-SLJ2BMH7.js} +5 -6
  53. package/dist/{create-7R6CZU53.js → create-WBZJFMA7.js} +12 -3
  54. package/dist/{create-GGACODDN.js → create-WQ5TM5IZ.js} +1 -1
  55. package/dist/{edit-4G5D7TES.js → edit-3O6WVIMM.js} +5 -6
  56. package/dist/{edit-VVLITC2E.js → edit-G57GESSR.js} +1 -1
  57. package/dist/edit-PUZ23M7V.js +102 -0
  58. package/dist/{edit-G2E5SNGU.js → edit-PVJ3S4TW.js} +3 -4
  59. package/dist/{edit-2R5QCPTB.js → edit-RJE7L3PH.js} +3 -4
  60. package/dist/{edit-HTLLYECP.js → edit-TIRMXOLT.js} +6 -7
  61. package/dist/{edit-5CROKEJE.js → edit-W6WKYNOG.js} +5 -6
  62. package/dist/{edit-OKU6FMHJ.js → edit-WPX2ANVI.js} +3 -4
  63. package/dist/{edit-3E4ZO7HT.js → edit-YW4RBDPH.js} +6 -7
  64. package/dist/edit-price-5ICQPJ42.js +196 -0
  65. package/dist/edit-stock-KS2NFC2Z.js +229 -0
  66. package/dist/{fulfillment-76IVZ266.js → fulfillment-ZV2R43N2.js} +3 -4
  67. package/dist/{fulfillment-providers-G2L6LEVO.js → fulfillment-providers-KKCL25KA.js} +4 -5
  68. package/dist/index.css +6 -6
  69. package/dist/index.js +142 -106
  70. package/dist/{offer-inventory-batch-page-BD6PMDLW.js → inventory-5UNDKYDL.js} +12 -12
  71. package/dist/{invite-2673PU4I.js → invite-KKIJNMER.js} +6 -7
  72. package/dist/{invite-HRXZ5YBP.js → invite-P7I5BGOJ.js} +3 -4
  73. package/dist/loader-UZTTBKYF.js +33 -0
  74. package/dist/loader-WEJZTX5Q.js +34 -0
  75. package/dist/{login-TWUBU6I6.js → login-A65IAXSI.js} +4 -5
  76. package/dist/{media-Z4N5MKFG.js → media-EM3K4AWO.js} +6 -7
  77. package/dist/{metadata-Q74OJWUD.js → metadata-A5XZKPL4.js} +4 -5
  78. package/dist/{metadata-D6M66NQK.js → metadata-JFLFWXOS.js} +3 -4
  79. package/dist/{metadata-YVHJPDLD.js → metadata-SFO3J5O5.js} +3 -4
  80. package/dist/{metadata-NIDIBXJT.js → metadata-USXOQUIX.js} +3 -4
  81. package/dist/{metadata-REQIFWWH.js → metadata-WJ4CNB6I.js} +3 -4
  82. package/dist/{offer-create-page-E4FLSDJQ.js → offer-create-page-3PIJXHWZ.js} +169 -173
  83. package/dist/offer-detail-page-SPHP3XKC.js +580 -0
  84. package/dist/{offer-detail-page-6SIBQTLP.js → offer-variant-detail-page-KTHKV6WW.js} +144 -215
  85. package/dist/offers-GWMIEPCM.js +54 -0
  86. package/dist/{onboarding-MK2RIFD4.js → onboarding-JOGRNDPI.js} +3 -4
  87. package/dist/{orders-TVQDR4OJ.js → orders-Q2IKEJIM.js} +4 -5
  88. package/dist/{organization-XO3T2K2X.js → organization-HRYDC66D.js} +3 -4
  89. package/dist/pages/index.js +25 -27
  90. package/dist/{payment-details-CFTX3QDL.js → payment-details-YLPIR52N.js} +3 -4
  91. package/dist/{pricing-ECXV6K7G.js → pricing-ECJH4VXZ.js} +5 -6
  92. package/dist/{offer-pricing-edit-page-4TINK42V.js → pricing-EPNQ63NT.js} +15 -13
  93. package/dist/{product-tags-5O7ZG6SA.js → product-tags-WMC7G3C4.js} +5 -6
  94. package/dist/{product-variant-detail-PUWOMVHQ.js → product-variant-detail-BQL2NGVE.js} +3 -4
  95. package/dist/{product-variant-edit-WZNO4CQX.js → product-variant-edit-GACQHD46.js} +9 -20
  96. package/dist/{products-CPTRYL2Z.js → products-LGQMESEZ.js} +10 -11
  97. package/dist/{products-BM3IIH5P.js → products-PQ3FG5KC.js} +4 -5
  98. package/dist/{professional-details-ED4HNYXY.js → professional-details-AASVGTUO.js} +3 -4
  99. package/dist/{profile-6TGCNNUU.js → profile-ZNQEDSDM.js} +3 -4
  100. package/dist/{promotions-4336KI7E.js → promotions-MFAFFHF3.js} +4 -4
  101. package/dist/{register-OZ5CRANZ.js → register-3A6G6QNI.js} +5 -6
  102. package/dist/{reset-password-5UHZU4D3.js → reset-password-FV5762CA.js} +1 -1
  103. package/dist/{settings-2GCQQTO6.js → settings-OKNGWUKL.js} +12 -13
  104. package/dist/{shipment-HWQHMX2L.js → shipment-ZF7IRKKS.js} +3 -4
  105. package/dist/shipping-HWJPX34K.js +113 -0
  106. package/dist/{shipping-profile-ZP7M6VSS.js → shipping-profile-3QKTQI6L.js} +2 -6
  107. package/dist/{shipping-profiles-C5WBXWZ2.js → shipping-profiles-FZCKGCBU.js} +3 -4
  108. package/dist/{stock-MQA7PRO6.js → stock-FI5WXVWN.js} +4 -5
  109. package/dist/{store-5ZHZR4JI.js → store-VFRKJYMD.js} +3 -4
  110. package/dist/{store-closure-H5WHV3LA.js → store-closure-WZIWGESD.js} +3 -4
  111. package/dist/{store-select-PZS556FB.js → store-select-GKRDFGEY.js} +4 -5
  112. package/dist/{team-CLKJCZNH.js → team-CXEAYN7O.js} +3 -4
  113. package/package.json +1 -1
  114. package/dist/chunk-27KRIXMQ.js +0 -71
  115. package/dist/chunk-CFRWIQIZ.js +0 -43
  116. package/dist/chunk-RXV7INUV.js +0 -426
  117. package/dist/chunk-T6LHVNWO.js +0 -27
  118. package/dist/loader-VDYPD3RI.js +0 -31
  119. package/dist/offer-edit-page-3MO566RP.js +0 -151
  120. package/dist/offers-GVN5LCK6.js +0 -32
  121. package/dist/{chunk-SPOHNK4X.js → chunk-BPVMJN2D.js} +3 -3
@@ -1,3 +1,7 @@
1
+ import {
2
+ ProductGeneralSection,
3
+ ProductMediaSection
4
+ } from "./chunk-4WCPN4OA.js";
1
5
  import {
2
6
  SectionRow
3
7
  } from "./chunk-4TLP3TAA.js";
@@ -32,7 +36,7 @@ import {
32
36
  } from "./chunk-INNFZYX2.js";
33
37
  import {
34
38
  useProductTag
35
- } from "./chunk-TBYCZRZ7.js";
39
+ } from "./chunk-R5QZO3QY.js";
36
40
  import "./chunk-F4OJN2F2.js";
37
41
  import "./chunk-LRARA622.js";
38
42
  import "./chunk-M6N4ISXL.js";
@@ -42,10 +46,9 @@ import {
42
46
  } from "./chunk-VV6IKGCN.js";
43
47
  import "./chunk-BXRNZS5K.js";
44
48
  import "./chunk-BOZJOOGW.js";
45
- import "./chunk-T6LHVNWO.js";
49
+ import "./chunk-IQWK723D.js";
46
50
  import "./chunk-4S6XGIC6.js";
47
51
  import "./chunk-S23FD6FA.js";
48
- import "./chunk-IQWK723D.js";
49
52
  import {
50
53
  useCollection
51
54
  } from "./chunk-DDJQRV6E.js";
@@ -57,7 +60,7 @@ import {
57
60
  import "./chunk-VZUA5SRD.js";
58
61
  import "./chunk-VXMOPVRH.js";
59
62
  import "./chunk-NBPMNUKZ.js";
60
- import "./chunk-UORPTGV2.js";
63
+ import "./chunk-SIEEMXNZ.js";
61
64
  import "./chunk-Y2MQ5EMD.js";
62
65
  import {
63
66
  useSalesChannels
@@ -75,14 +78,12 @@ import {
75
78
  productAttributesQueryKeys,
76
79
  productsQueryKeys,
77
80
  useCancelProductEdit,
78
- useDeleteProduct,
79
81
  useDeleteVariantLazy,
80
82
  useProduct,
81
83
  useProductAttribute,
82
84
  useProductChange,
83
85
  useProductVariants,
84
- useRemoveProductAttribute,
85
- useUpdateProduct
86
+ useRemoveProductAttribute
86
87
  } from "./chunk-JAUZ73XE.js";
87
88
  import "./chunk-A5DJIOHN.js";
88
89
  import {
@@ -325,28 +326,57 @@ var VariantUpdateBlock = ({
325
326
  }) => {
326
327
  const { t } = useTranslation();
327
328
  const found = variantsById.get(variantId);
328
- const title = found?.title || found?.sku || variantId || t("fields.variant", { defaultValue: "Variant" });
329
+ const variantFallback = t("fields.variant", { defaultValue: "Variant" });
330
+ const title = found?.title || found?.sku || variantId || variantFallback;
331
+ const sku = found?.sku && title !== found.sku ? found.sku : void 0;
329
332
  const images = isImageList(found?.images) ? found?.images : void 0;
330
- return /* @__PURE__ */ jsxs(
331
- "div",
332
- {
333
- className: "flex flex-col gap-y-3",
334
- "data-testid": `product-active-edit-variant-${variantId}`,
335
- children: [
336
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
337
- images && images.length > 0 && /* @__PURE__ */ jsx(ImageStrip, { images }),
338
- /* @__PURE__ */ jsxs(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: [
339
- /* @__PURE__ */ jsx("span", { className: "font-medium text-ui-fg-base", children: t("products.edits.panel.variantUpdated", {
340
- defaultValue: "Variant updated"
341
- }) }),
342
- ": ",
343
- title
333
+ return /* @__PURE__ */ jsxs(Fragment2, { children: [
334
+ /* @__PURE__ */ jsxs(
335
+ "div",
336
+ {
337
+ className: "flex items-start gap-4 px-6 py-4",
338
+ "data-testid": `product-active-edit-variant-${variantId}`,
339
+ children: [
340
+ /* @__PURE__ */ jsx(
341
+ Text,
342
+ {
343
+ size: "small",
344
+ weight: "plus",
345
+ leading: "compact",
346
+ className: "text-ui-fg-subtle w-[160px] shrink-0",
347
+ children: variantFallback
348
+ }
349
+ ),
350
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-1 items-center gap-2", children: [
351
+ images && images.length > 0 && /* @__PURE__ */ jsx(ImageStrip, { images }),
352
+ /* @__PURE__ */ jsx(
353
+ Text,
354
+ {
355
+ size: "small",
356
+ leading: "compact",
357
+ className: "text-ui-fg-base font-medium",
358
+ children: title
359
+ }
360
+ ),
361
+ sku && /* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: `\xB7 ${sku}` })
344
362
  ] })
345
- ] }),
346
- /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-y-4 pl-1", children: diffs.map((diff, idx) => /* @__PURE__ */ jsx(FieldRow, { diff }, `${variantId}-${diff.field}-${idx}`)) })
347
- ]
348
- }
349
- );
363
+ ]
364
+ }
365
+ ),
366
+ diffs.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 px-6 py-4", children: [
367
+ /* @__PURE__ */ jsx(
368
+ Text,
369
+ {
370
+ size: "small",
371
+ weight: "plus",
372
+ leading: "compact",
373
+ className: "text-ui-fg-subtle w-[160px] shrink-0",
374
+ children: t("labels.updated")
375
+ }
376
+ ),
377
+ /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col gap-y-4", children: diffs.map((diff, idx) => /* @__PURE__ */ jsx(FieldRow, { diff }, `${variantId}-${diff.field}-${idx}`)) })
378
+ ] })
379
+ ] });
350
380
  };
351
381
  var ProductActiveEditSection = ({
352
382
  product
@@ -449,29 +479,15 @@ var ProductActiveEditSection = ({
449
479
  ),
450
480
  /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col gap-y-4", children: productUpdated.map((diff, idx) => /* @__PURE__ */ jsx(FieldRow, { diff }, `${diff.field}-${idx}`)) })
451
481
  ] }),
452
- variantsUpdated.size > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 px-6 py-4", children: [
453
- /* @__PURE__ */ jsx(
454
- Text,
455
- {
456
- size: "small",
457
- weight: "plus",
458
- leading: "compact",
459
- className: "text-ui-fg-subtle w-[160px] shrink-0",
460
- children: t("labels.updated")
461
- }
462
- ),
463
- /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col gap-y-6", children: Array.from(variantsUpdated.entries()).map(
464
- ([variantId, diffs]) => /* @__PURE__ */ jsx(
465
- VariantUpdateBlock,
466
- {
467
- variantId,
468
- diffs,
469
- variantsById
470
- },
471
- variantId
472
- )
473
- ) })
474
- ] }),
482
+ variantsUpdated.size > 0 && Array.from(variantsUpdated.entries()).map(([variantId, diffs]) => /* @__PURE__ */ jsx(
483
+ VariantUpdateBlock,
484
+ {
485
+ variantId,
486
+ diffs,
487
+ variantsById
488
+ },
489
+ variantId
490
+ )),
475
491
  added.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 px-6 py-4", children: [
476
492
  /* @__PURE__ */ jsx(
477
493
  Text,
@@ -558,325 +574,30 @@ var ProductActiveEditSection = ({
558
574
  );
559
575
  };
560
576
 
561
- // src/pages/products/[id]/_components/product-general-section/product-general-section.tsx
562
- import { PencilSquare, Trash } from "@medusajs/icons";
563
- import { Container as Container2, Heading as Heading2, StatusBadge, usePrompt as usePrompt2 } from "@medusajs/ui";
577
+ // src/pages/products/[id]/_components/product-organization-section/product-organization-section.tsx
578
+ import { PencilSquare } from "@medusajs/icons";
579
+ import { Badge, Container as Container2, Heading as Heading2, Tooltip } from "@medusajs/ui";
564
580
  import { useTranslation as useTranslation2 } from "react-i18next";
565
- import { useNavigate } from "react-router-dom";
566
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
567
- var productStatusColor = (status) => {
568
- switch (status) {
569
- case "draft":
570
- return "grey";
571
- case "proposed":
572
- return "orange";
573
- case "published":
574
- return "green";
575
- case "rejected":
576
- return "red";
577
- default:
578
- return "grey";
579
- }
580
- };
581
- var ProductGeneralSection = ({
582
- product
583
- }) => {
584
- const { t } = useTranslation2();
585
- const prompt = usePrompt2();
586
- const navigate = useNavigate();
587
- const { mutateAsync } = useDeleteProduct(product.id);
588
- const handleDelete = async () => {
589
- const res = await prompt({
590
- title: t("general.areYouSure"),
591
- description: t("products.deleteWarning", {
592
- title: product.title
593
- }),
594
- confirmText: t("actions.delete"),
595
- cancelText: t("actions.cancel")
596
- });
597
- if (!res) {
598
- return;
599
- }
600
- await mutateAsync(void 0, {
601
- onSuccess: () => {
602
- navigate("..");
603
- }
604
- });
605
- };
606
- return /* @__PURE__ */ jsxs2(Container2, { className: "divide-y p-0", children: [
607
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between px-6 py-4", children: [
608
- /* @__PURE__ */ jsx2(Heading2, { children: product.title }),
609
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-x-4", children: [
610
- /* @__PURE__ */ jsx2(StatusBadge, { color: productStatusColor(product.status), children: t(`products.productStatus.${product.status}`) }),
611
- /* @__PURE__ */ jsx2(
612
- ActionMenu,
613
- {
614
- groups: [
615
- {
616
- actions: [
617
- {
618
- label: t("actions.edit"),
619
- to: "edit",
620
- icon: /* @__PURE__ */ jsx2(PencilSquare, {})
621
- }
622
- ]
623
- },
624
- {
625
- actions: [
626
- {
627
- label: t("actions.delete"),
628
- onClick: handleDelete,
629
- icon: /* @__PURE__ */ jsx2(Trash, {})
630
- }
631
- ]
632
- }
633
- ]
634
- }
635
- )
636
- ] })
637
- ] }),
638
- /* @__PURE__ */ jsx2(
639
- SectionRow,
640
- {
641
- title: t("fields.description"),
642
- value: product.description || "-"
643
- }
644
- ),
645
- /* @__PURE__ */ jsx2(
646
- SectionRow,
647
- {
648
- title: t("fields.subtitle"),
649
- value: product.subtitle || "-"
650
- }
651
- ),
652
- /* @__PURE__ */ jsx2(SectionRow, { title: t("fields.handle"), value: `/${product.handle}` }),
653
- /* @__PURE__ */ jsx2(
654
- SectionRow,
655
- {
656
- title: t("fields.discountable"),
657
- value: product.discountable ? t("general.true") : t("general.false")
658
- }
659
- )
660
- ] });
661
- };
662
-
663
- // src/pages/products/[id]/_components/product-media-section/product-media-section.tsx
664
- import { useState } from "react";
665
- import { PencilSquare as PencilSquare2, ThumbnailBadge } from "@medusajs/icons";
666
- import {
667
- Button as Button2,
668
- Checkbox,
669
- clx,
670
- CommandBar,
671
- Container as Container3,
672
- Heading as Heading3,
673
- Text as Text2,
674
- Tooltip,
675
- usePrompt as usePrompt3
676
- } from "@medusajs/ui";
677
- import { useTranslation as useTranslation3 } from "react-i18next";
678
581
  import { Link } from "react-router-dom";
679
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
680
- var ProductMediaSection = ({
681
- product
682
- }) => {
683
- const { t } = useTranslation3();
684
- const prompt = usePrompt3();
685
- const [selection, setSelection] = useState({});
686
- const media = getMedia(product);
687
- const handleCheckedChange = (id) => {
688
- setSelection((prev) => {
689
- if (prev[id]) {
690
- const { [id]: _, ...rest } = prev;
691
- return rest;
692
- } else {
693
- return { ...prev, [id]: true };
694
- }
695
- });
696
- };
697
- const { mutateAsync } = useUpdateProduct(product.id);
698
- const handleDelete = async () => {
699
- const ids = Object.keys(selection);
700
- const includingThumbnail = ids.some((id) => media.find((m) => m.id === id)?.isThumbnail);
701
- const res = await prompt({
702
- title: t("general.areYouSure"),
703
- description: includingThumbnail ? t("products.media.deleteWarningWithThumbnail", {
704
- count: ids.length
705
- }) : t("products.media.deleteWarning", {
706
- count: ids.length
707
- }),
708
- confirmText: t("actions.delete"),
709
- cancelText: t("actions.cancel")
710
- });
711
- if (!res) {
712
- return;
713
- }
714
- const mediaToKeep = product.images?.filter((i) => !ids.includes(i.id)).map((i) => ({ url: i.url }));
715
- await mutateAsync(
716
- {
717
- images: mediaToKeep,
718
- thumbnail: includingThumbnail ? "" : void 0
719
- },
720
- {
721
- onSuccess: () => {
722
- setSelection({});
723
- }
724
- }
725
- );
726
- };
727
- return /* @__PURE__ */ jsxs3(Container3, { className: "divide-y p-0", children: [
728
- /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-6 py-4", children: [
729
- /* @__PURE__ */ jsx3(Heading3, { level: "h2", children: t("products.media.label") }),
730
- /* @__PURE__ */ jsx3(
731
- ActionMenu,
732
- {
733
- groups: [
734
- {
735
- actions: [
736
- {
737
- label: t("actions.edit"),
738
- to: "media?view=edit",
739
- icon: /* @__PURE__ */ jsx3(PencilSquare2, {})
740
- }
741
- ]
742
- }
743
- ]
744
- }
745
- )
746
- ] }),
747
- media.length > 0 ? /* @__PURE__ */ jsx3("div", { className: "grid grid-cols-[repeat(auto-fill,minmax(96px,1fr))] gap-4 px-6 py-4", children: media.map((i, index) => {
748
- const isSelected = selection[i.id];
749
- return /* @__PURE__ */ jsxs3(
750
- "div",
751
- {
752
- className: "group relative aspect-square size-full cursor-pointer overflow-hidden rounded-[8px] shadow-elevation-card-rest transition-fg hover:shadow-elevation-card-hover",
753
- children: [
754
- /* @__PURE__ */ jsx3(
755
- "div",
756
- {
757
- className: clx(
758
- "invisible absolute right-2 top-2 opacity-0 transition-fg group-hover:visible group-hover:opacity-100",
759
- {
760
- "visible opacity-100": isSelected
761
- }
762
- ),
763
- children: /* @__PURE__ */ jsx3(
764
- Checkbox,
765
- {
766
- checked: selection[i.id] || false,
767
- onCheckedChange: () => handleCheckedChange(i.id)
768
- }
769
- )
770
- }
771
- ),
772
- i.isThumbnail && /* @__PURE__ */ jsx3("div", { className: "absolute left-2 top-2", children: /* @__PURE__ */ jsx3(Tooltip, { content: t("fields.thumbnail"), children: /* @__PURE__ */ jsx3(ThumbnailBadge, {}) }) }),
773
- /* @__PURE__ */ jsx3(
774
- Link,
775
- {
776
- to: `media`,
777
- state: { curr: index },
778
- children: /* @__PURE__ */ jsx3(
779
- "img",
780
- {
781
- src: i.url,
782
- alt: product.title,
783
- className: "size-full object-cover"
784
- }
785
- )
786
- }
787
- )
788
- ]
789
- },
790
- i.id
791
- );
792
- }) }) : /* @__PURE__ */ jsxs3("div", { className: "flex flex-col items-center gap-y-4 pb-8 pt-6", children: [
793
- /* @__PURE__ */ jsxs3("div", { className: "flex flex-col items-center", children: [
794
- /* @__PURE__ */ jsx3(
795
- Text2,
796
- {
797
- size: "small",
798
- leading: "compact",
799
- weight: "plus",
800
- className: "text-ui-fg-subtle",
801
- children: t("products.media.emptyState.header")
802
- }
803
- ),
804
- /* @__PURE__ */ jsx3(
805
- Text2,
806
- {
807
- size: "small",
808
- className: "text-ui-fg-muted",
809
- children: t("products.media.emptyState.description")
810
- }
811
- )
812
- ] }),
813
- /* @__PURE__ */ jsx3(
814
- Button2,
815
- {
816
- size: "small",
817
- variant: "secondary",
818
- asChild: true,
819
- children: /* @__PURE__ */ jsx3(Link, { to: "media?view=edit", children: t("products.media.emptyState.action") })
820
- }
821
- )
822
- ] }),
823
- /* @__PURE__ */ jsx3(CommandBar, { open: !!Object.keys(selection).length, children: /* @__PURE__ */ jsxs3(CommandBar.Bar, { children: [
824
- /* @__PURE__ */ jsx3(CommandBar.Value, { children: t("general.countSelected", {
825
- count: Object.keys(selection).length
826
- }) }),
827
- /* @__PURE__ */ jsx3(CommandBar.Seperator, {}),
828
- /* @__PURE__ */ jsx3(
829
- CommandBar.Command,
830
- {
831
- action: handleDelete,
832
- label: t("actions.delete"),
833
- shortcut: "d"
834
- }
835
- )
836
- ] }) })
837
- ] });
838
- };
839
- var getMedia = (product) => {
840
- const { images = [], thumbnail } = product;
841
- const media = (images || []).map((image) => ({
842
- id: image.id,
843
- url: image.url,
844
- isThumbnail: image.url === thumbnail
845
- }));
846
- if (thumbnail && !media.some((mediaItem) => mediaItem.url === thumbnail)) {
847
- media.unshift({
848
- id: "img_thumbnail",
849
- url: thumbnail,
850
- isThumbnail: true
851
- });
852
- }
853
- return media;
854
- };
855
-
856
- // src/pages/products/[id]/_components/product-organization-section/product-organization-section.tsx
857
- import { PencilSquare as PencilSquare3 } from "@medusajs/icons";
858
- import { Badge, Container as Container4, Heading as Heading4, Tooltip as Tooltip2 } from "@medusajs/ui";
859
- import { useTranslation as useTranslation4 } from "react-i18next";
860
- import { Link as Link2 } from "react-router-dom";
861
- import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
582
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
862
583
  var ProductOrganizationSection = ({
863
584
  product
864
585
  }) => {
865
- const { t } = useTranslation4();
866
- return /* @__PURE__ */ jsxs4(
867
- Container4,
586
+ const { t } = useTranslation2();
587
+ return /* @__PURE__ */ jsxs2(
588
+ Container2,
868
589
  {
869
590
  className: "divide-y p-0",
870
591
  "data-testid": "product-organization-section",
871
592
  children: [
872
- /* @__PURE__ */ jsxs4(
593
+ /* @__PURE__ */ jsxs2(
873
594
  "div",
874
595
  {
875
596
  className: "flex items-center justify-between px-6 py-4",
876
597
  "data-testid": "product-organization-header",
877
598
  children: [
878
- /* @__PURE__ */ jsx4(Heading4, { level: "h2", "data-testid": "product-organization-title", children: t("products.organization.header") }),
879
- /* @__PURE__ */ jsx4(
599
+ /* @__PURE__ */ jsx2(Heading2, { level: "h2", "data-testid": "product-organization-title", children: t("products.organization.header") }),
600
+ /* @__PURE__ */ jsx2(
880
601
  ActionMenu,
881
602
  {
882
603
  groups: [
@@ -885,7 +606,7 @@ var ProductOrganizationSection = ({
885
606
  {
886
607
  label: t("actions.edit"),
887
608
  to: "organization",
888
- icon: /* @__PURE__ */ jsx4(PencilSquare3, {})
609
+ icon: /* @__PURE__ */ jsx2(PencilSquare, {})
889
610
  }
890
611
  ]
891
612
  }
@@ -896,11 +617,11 @@ var ProductOrganizationSection = ({
896
617
  ]
897
618
  }
898
619
  ),
899
- /* @__PURE__ */ jsx4(
620
+ /* @__PURE__ */ jsx2(
900
621
  SectionRow,
901
622
  {
902
623
  title: t("fields.category"),
903
- value: product.categories?.length ? product.categories.map((pcat) => /* @__PURE__ */ jsx4(
624
+ value: product.categories?.length ? product.categories.map((pcat) => /* @__PURE__ */ jsx2(
904
625
  OrganizationTag,
905
626
  {
906
627
  label: pcat.name,
@@ -911,11 +632,11 @@ var ProductOrganizationSection = ({
911
632
  "data-testid": "product-categories-row"
912
633
  }
913
634
  ),
914
- /* @__PURE__ */ jsx4(
635
+ /* @__PURE__ */ jsx2(
915
636
  SectionRow,
916
637
  {
917
638
  title: t("fields.collection"),
918
- value: product.collection ? /* @__PURE__ */ jsx4(
639
+ value: product.collection ? /* @__PURE__ */ jsx2(
919
640
  OrganizationTag,
920
641
  {
921
642
  label: product.collection.title,
@@ -925,11 +646,11 @@ var ProductOrganizationSection = ({
925
646
  "data-testid": "product-collection-row"
926
647
  }
927
648
  ),
928
- /* @__PURE__ */ jsx4(
649
+ /* @__PURE__ */ jsx2(
929
650
  SectionRow,
930
651
  {
931
652
  title: t("fields.tags"),
932
- value: product.tags?.length ? product.tags.map((tag) => /* @__PURE__ */ jsx4(
653
+ value: product.tags?.length ? product.tags.map((tag) => /* @__PURE__ */ jsx2(
933
654
  OrganizationTag,
934
655
  {
935
656
  label: tag.value,
@@ -940,11 +661,11 @@ var ProductOrganizationSection = ({
940
661
  "data-testid": "product-tags-row"
941
662
  }
942
663
  ),
943
- /* @__PURE__ */ jsx4(
664
+ /* @__PURE__ */ jsx2(
944
665
  SectionRow,
945
666
  {
946
667
  title: t("fields.type"),
947
- value: product.type ? /* @__PURE__ */ jsx4(
668
+ value: product.type ? /* @__PURE__ */ jsx2(
948
669
  OrganizationTag,
949
670
  {
950
671
  label: product.type.value,
@@ -959,8 +680,8 @@ var ProductOrganizationSection = ({
959
680
  );
960
681
  };
961
682
  var OrganizationTag = ({ label, to }) => {
962
- return /* @__PURE__ */ jsx4(Tooltip2, { content: label, children: /* @__PURE__ */ jsx4(Badge, { size: "2xsmall", className: "block w-fit truncate", asChild: true, children: /* @__PURE__ */ jsx4(
963
- Link2,
683
+ return /* @__PURE__ */ jsx2(Tooltip, { content: label, children: /* @__PURE__ */ jsx2(Badge, { size: "2xsmall", className: "block w-fit truncate", asChild: true, children: /* @__PURE__ */ jsx2(
684
+ Link,
964
685
  {
965
686
  to,
966
687
  "data-testid": `organization-tag-${label.toLowerCase().replace(/\s+/g, "-")}`,
@@ -971,27 +692,27 @@ var OrganizationTag = ({ label, to }) => {
971
692
 
972
693
  // src/pages/products/[id]/_components/product-variant-section/product-variant-section.tsx
973
694
  import { useCallback, useMemo as useMemo2 } from "react";
974
- import { PencilSquare as PencilSquare4, Trash as Trash2 } from "@medusajs/icons";
695
+ import { PencilSquare as PencilSquare2, Trash } from "@medusajs/icons";
975
696
  import {
976
697
  Badge as Badge2,
977
- Button as Button3,
978
- Container as Container5,
698
+ Button as Button2,
699
+ Container as Container3,
979
700
  createDataTableColumnHelper,
980
- Heading as Heading5,
701
+ Heading as Heading3,
981
702
  toast as toast2,
982
- Tooltip as Tooltip3,
983
- usePrompt as usePrompt4
703
+ Tooltip as Tooltip2,
704
+ usePrompt as usePrompt2
984
705
  } from "@medusajs/ui";
985
706
  import { keepPreviousData } from "@tanstack/react-query";
986
- import { useTranslation as useTranslation5 } from "react-i18next";
987
- import { Link as Link3, useNavigate as useNavigate2, useSearchParams } from "react-router-dom";
988
- import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
707
+ import { useTranslation as useTranslation3 } from "react-i18next";
708
+ import { Link as Link2, useNavigate, useSearchParams } from "react-router-dom";
709
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
989
710
  var PAGE_SIZE = 10;
990
711
  var PREFIX = "pv";
991
712
  var ProductVariantSection = ({
992
713
  product
993
714
  }) => {
994
- const { t } = useTranslation5();
715
+ const { t } = useTranslation3();
995
716
  const { q, order, offset, created_at, updated_at } = useQueryParams(
996
717
  ["q", "order", "offset", "created_at", "updated_at"],
997
718
  PREFIX
@@ -1016,21 +737,21 @@ var ProductVariantSection = ({
1016
737
  if (isError) {
1017
738
  throw error;
1018
739
  }
1019
- return /* @__PURE__ */ jsxs5(Container5, { className: "divide-y p-0", "data-testid": "product-variant-section", children: [
1020
- /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between px-6 py-4", children: [
1021
- /* @__PURE__ */ jsx5(Heading5, { level: "h2", children: t("products.variants.header") }),
1022
- /* @__PURE__ */ jsx5(
1023
- Button3,
740
+ return /* @__PURE__ */ jsxs3(Container3, { className: "divide-y p-0", "data-testid": "product-variant-section", children: [
741
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-6 py-4", children: [
742
+ /* @__PURE__ */ jsx3(Heading3, { level: "h2", children: t("products.variants.header") }),
743
+ /* @__PURE__ */ jsx3(
744
+ Button2,
1024
745
  {
1025
746
  size: "small",
1026
747
  variant: "secondary",
1027
748
  asChild: true,
1028
749
  "data-testid": "product-variants-create-button",
1029
- children: /* @__PURE__ */ jsx5(Link3, { to: "variants/create", children: t("actions.create") })
750
+ children: /* @__PURE__ */ jsx3(Link2, { to: "variants/create", children: t("actions.create") })
1030
751
  }
1031
752
  )
1032
753
  ] }),
1033
- /* @__PURE__ */ jsx5("div", { "data-testid": "product-variants-table-container", children: /* @__PURE__ */ jsx5(
754
+ /* @__PURE__ */ jsx3("div", { "data-testid": "product-variants-table-container", children: /* @__PURE__ */ jsx3(
1034
755
  DataTable,
1035
756
  {
1036
757
  data: variants,
@@ -1059,10 +780,10 @@ var ProductVariantSection = ({
1059
780
  };
1060
781
  var columnHelper = createDataTableColumnHelper();
1061
782
  var useColumns = (product) => {
1062
- const { t } = useTranslation5();
1063
- const navigate = useNavigate2();
783
+ const { t } = useTranslation3();
784
+ const navigate = useNavigate();
1064
785
  const { mutateAsync } = useDeleteVariantLazy(product.id);
1065
- const prompt = usePrompt4();
786
+ const prompt = usePrompt2();
1066
787
  const [searchParams] = useSearchParams();
1067
788
  const tableSearchParams = useMemo2(() => {
1068
789
  const filtered = new URLSearchParams();
@@ -1112,14 +833,14 @@ var useColumns = (product) => {
1112
833
  (opt) => opt.option?.title === attribute.name
1113
834
  );
1114
835
  if (!variantOpt?.value) {
1115
- return /* @__PURE__ */ jsx5("span", { className: "text-ui-fg-muted", children: "-" });
836
+ return /* @__PURE__ */ jsx3("span", { className: "text-ui-fg-muted", children: "-" });
1116
837
  }
1117
- return /* @__PURE__ */ jsx5(
838
+ return /* @__PURE__ */ jsx3(
1118
839
  "div",
1119
840
  {
1120
841
  className: "flex flex-wrap items-center gap-1",
1121
842
  "data-testid": `product-variant-attribute-${attribute.id}-${row.original.id}`,
1122
- children: /* @__PURE__ */ jsx5(Tooltip3, { content: variantOpt.value, children: /* @__PURE__ */ jsx5(
843
+ children: /* @__PURE__ */ jsx3(Tooltip2, { content: variantOpt.value, children: /* @__PURE__ */ jsx3(
1123
844
  Badge2,
1124
845
  {
1125
846
  size: "2xsmall",
@@ -1140,7 +861,7 @@ var useColumns = (product) => {
1140
861
  const variant = _ctx.row.original;
1141
862
  const mainActions = [
1142
863
  {
1143
- icon: /* @__PURE__ */ jsx5(PencilSquare4, {}),
864
+ icon: /* @__PURE__ */ jsx3(PencilSquare2, {}),
1144
865
  label: t("actions.edit"),
1145
866
  onClick: (row) => {
1146
867
  navigate(
@@ -1156,7 +877,7 @@ var useColumns = (product) => {
1156
877
  ];
1157
878
  const secondaryActions = [
1158
879
  {
1159
- icon: /* @__PURE__ */ jsx5(Trash2, {}),
880
+ icon: /* @__PURE__ */ jsx3(Trash, {}),
1160
881
  label: t("actions.delete"),
1161
882
  onClick: () => handleDelete(variant.id, variant.title)
1162
883
  }
@@ -1177,7 +898,7 @@ var useColumns = (product) => {
1177
898
  header: t("fields.sku"),
1178
899
  cell: ({ getValue }) => {
1179
900
  const value = getValue();
1180
- return value ? value : /* @__PURE__ */ jsx5("span", { className: "text-ui-fg-muted", children: "-" });
901
+ return value ? value : /* @__PURE__ */ jsx3("span", { className: "text-ui-fg-muted", children: "-" });
1181
902
  }
1182
903
  }),
1183
904
  ...attributeColumns,
@@ -1199,29 +920,29 @@ var useFilters = () => {
1199
920
  import {
1200
921
  ListBullet,
1201
922
  Plus,
1202
- Trash as Trash3,
923
+ Trash as Trash2,
1203
924
  Swatch,
1204
925
  DropCap,
1205
926
  InformationCircleSolid,
1206
- PencilSquare as PencilSquare5
927
+ PencilSquare as PencilSquare3
1207
928
  } from "@medusajs/icons";
1208
929
  import {
1209
930
  Badge as Badge3,
1210
- Container as Container6,
1211
- Heading as Heading6,
1212
- Text as Text3,
931
+ Container as Container4,
932
+ Heading as Heading4,
933
+ Text as Text2,
1213
934
  toast as toast3,
1214
- Tooltip as Tooltip4,
1215
- usePrompt as usePrompt5
935
+ Tooltip as Tooltip3,
936
+ usePrompt as usePrompt3
1216
937
  } from "@medusajs/ui";
1217
- import { useTranslation as useTranslation6 } from "react-i18next";
1218
- import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
938
+ import { useTranslation as useTranslation4 } from "react-i18next";
939
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
1219
940
  var AttributeActions = ({
1220
941
  productId,
1221
942
  attribute
1222
943
  }) => {
1223
- const { t } = useTranslation6();
1224
- const prompt = usePrompt5();
944
+ const { t } = useTranslation4();
945
+ const prompt = usePrompt3();
1225
946
  const { mutateAsync } = useRemoveProductAttribute(productId, attribute.id);
1226
947
  const handleDelete = async () => {
1227
948
  const res = await prompt({
@@ -1241,7 +962,7 @@ var AttributeActions = ({
1241
962
  }
1242
963
  });
1243
964
  };
1244
- return /* @__PURE__ */ jsx6(
965
+ return /* @__PURE__ */ jsx4(
1245
966
  ActionMenu,
1246
967
  {
1247
968
  groups: [
@@ -1250,7 +971,7 @@ var AttributeActions = ({
1250
971
  {
1251
972
  label: t("actions.edit"),
1252
973
  to: `attributes/${attribute.id}/edit`,
1253
- icon: /* @__PURE__ */ jsx6(PencilSquare5, {})
974
+ icon: /* @__PURE__ */ jsx4(PencilSquare3, {})
1254
975
  }
1255
976
  ]
1256
977
  },
@@ -1259,7 +980,7 @@ var AttributeActions = ({
1259
980
  {
1260
981
  label: t("actions.delete"),
1261
982
  onClick: handleDelete,
1262
- icon: /* @__PURE__ */ jsx6(Trash3, {}),
983
+ icon: /* @__PURE__ */ jsx4(Trash2, {}),
1263
984
  disabled: attribute.is_required,
1264
985
  disabledTooltip: attribute.is_required ? t("products.attributeRequiredDeleteDisabledTooltip") : void 0
1265
986
  }
@@ -1276,37 +997,37 @@ var AttributeGroup = ({
1276
997
  attributes,
1277
998
  productId
1278
999
  }) => {
1279
- const { t } = useTranslation6();
1000
+ const { t } = useTranslation4();
1280
1001
  if (!attributes.length) {
1281
1002
  return null;
1282
1003
  }
1283
- return /* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-y-4 px-3 py-4", children: [
1284
- /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-x-3 px-3", children: [
1285
- /* @__PURE__ */ jsx6("div", { className: "text-ui-fg-muted flex h-8 w-8 items-center justify-center rounded-lg border border-ui-border-base bg-ui-bg-component", children: icon }),
1286
- /* @__PURE__ */ jsxs6("div", { children: [
1287
- /* @__PURE__ */ jsx6(Text3, { size: "small", weight: "plus", leading: "compact", children: title }),
1288
- /* @__PURE__ */ jsx6(Text3, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: description })
1004
+ return /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-y-4 px-3 py-4", children: [
1005
+ /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-x-3 px-3", children: [
1006
+ /* @__PURE__ */ jsx4("div", { className: "text-ui-fg-muted flex h-8 w-8 items-center justify-center rounded-lg border border-ui-border-base bg-ui-bg-component", children: icon }),
1007
+ /* @__PURE__ */ jsxs4("div", { children: [
1008
+ /* @__PURE__ */ jsx4(Text2, { size: "small", weight: "plus", leading: "compact", children: title }),
1009
+ /* @__PURE__ */ jsx4(Text2, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: description })
1289
1010
  ] })
1290
1011
  ] }),
1291
- /* @__PURE__ */ jsx6("div", { className: "flex flex-col gap-y-0", children: /* @__PURE__ */ jsx6("div", { className: "overflow-hidden rounded-xl border border-ui-border-base", children: attributes.map((attr, index) => {
1012
+ /* @__PURE__ */ jsx4("div", { className: "flex flex-col gap-y-0", children: /* @__PURE__ */ jsx4("div", { className: "overflow-hidden rounded-xl border border-ui-border-base", children: attributes.map((attr, index) => {
1292
1013
  const values = attr.values?.map((v) => v.name) ?? [];
1293
- return /* @__PURE__ */ jsx6(
1014
+ return /* @__PURE__ */ jsx4(
1294
1015
  "div",
1295
1016
  {
1296
1017
  className: index < attributes.length - 1 ? "border-b border-ui-border-base" : "",
1297
- children: /* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-[1fr_1fr_28px] items-center gap-4 bg-ui-bg-component px-4 py-3", children: [
1298
- /* @__PURE__ */ jsxs6("div", { className: "text-ui-fg-subtle flex items-center gap-x-2", children: [
1299
- /* @__PURE__ */ jsx6(Text3, { size: "small", weight: "plus", leading: "compact", children: attr.name }),
1300
- attr.description && /* @__PURE__ */ jsx6(Tooltip4, { content: attr.description, children: /* @__PURE__ */ jsx6("span", { className: "text-ui-fg-muted flex items-center", children: /* @__PURE__ */ jsx6(InformationCircleSolid, {}) }) }),
1301
- attr.is_required && /* @__PURE__ */ jsx6(
1302
- Tooltip4,
1018
+ children: /* @__PURE__ */ jsxs4("div", { className: "grid grid-cols-[1fr_1fr_28px] items-center gap-4 bg-ui-bg-component px-4 py-3", children: [
1019
+ /* @__PURE__ */ jsxs4("div", { className: "text-ui-fg-subtle flex items-center gap-x-2", children: [
1020
+ /* @__PURE__ */ jsx4(Text2, { size: "small", weight: "plus", leading: "compact", children: attr.name }),
1021
+ attr.description && /* @__PURE__ */ jsx4(Tooltip3, { content: attr.description, children: /* @__PURE__ */ jsx4("span", { className: "text-ui-fg-muted flex items-center", children: /* @__PURE__ */ jsx4(InformationCircleSolid, {}) }) }),
1022
+ attr.is_required && /* @__PURE__ */ jsx4(
1023
+ Tooltip3,
1303
1024
  {
1304
1025
  content: t("products.attributeRequiredByMarketplace"),
1305
- children: /* @__PURE__ */ jsx6("span", { className: "text-ui-fg-muted flex items-center", children: /* @__PURE__ */ jsx6(InformationCircleSolid, {}) })
1026
+ children: /* @__PURE__ */ jsx4("span", { className: "text-ui-fg-muted flex items-center", children: /* @__PURE__ */ jsx4(InformationCircleSolid, {}) })
1306
1027
  }
1307
1028
  )
1308
1029
  ] }),
1309
- /* @__PURE__ */ jsx6("div", { className: "flex flex-wrap gap-1", children: ["single_select", "multi_select"].includes(attr.type) ? values.map((val) => /* @__PURE__ */ jsx6(
1030
+ /* @__PURE__ */ jsx4("div", { className: "flex flex-wrap gap-1", children: ["single_select", "multi_select"].includes(attr.type) ? values.map((val) => /* @__PURE__ */ jsx4(
1310
1031
  Badge3,
1311
1032
  {
1312
1033
  size: "2xsmall",
@@ -1314,8 +1035,8 @@ var AttributeGroup = ({
1314
1035
  children: val
1315
1036
  },
1316
1037
  val
1317
- )) : /* @__PURE__ */ jsx6(
1318
- Text3,
1038
+ )) : /* @__PURE__ */ jsx4(
1039
+ Text2,
1319
1040
  {
1320
1041
  size: "small",
1321
1042
  leading: "compact",
@@ -1323,7 +1044,7 @@ var AttributeGroup = ({
1323
1044
  children: values.join(", ") || "-"
1324
1045
  }
1325
1046
  ) }),
1326
- /* @__PURE__ */ jsx6(AttributeActions, { productId, attribute: attr })
1047
+ /* @__PURE__ */ jsx4(AttributeActions, { productId, attribute: attr })
1327
1048
  ] })
1328
1049
  },
1329
1050
  attr.id
@@ -1334,19 +1055,19 @@ var AttributeGroup = ({
1334
1055
  var ProductAttributeSection = ({
1335
1056
  product
1336
1057
  }) => {
1337
- const { t } = useTranslation6();
1058
+ const { t } = useTranslation4();
1338
1059
  const allAttributes = product.attributes ?? [];
1339
1060
  const variantAttributes = allAttributes.filter((a) => a.is_variant_axis);
1340
1061
  const infoAttributes = allAttributes.filter((a) => !a.is_variant_axis);
1341
1062
  const isEmpty = !variantAttributes.length && !infoAttributes.length;
1342
- return /* @__PURE__ */ jsxs6(Container6, { className: "p-0", children: [
1343
- /* @__PURE__ */ jsxs6(
1063
+ return /* @__PURE__ */ jsxs4(Container4, { className: "p-0", children: [
1064
+ /* @__PURE__ */ jsxs4(
1344
1065
  "div",
1345
1066
  {
1346
1067
  className: `flex items-center justify-between px-6 py-4${isEmpty ? "" : " border-b border-ui-border-base"}`,
1347
1068
  children: [
1348
- /* @__PURE__ */ jsx6(Heading6, { level: "h2", children: t("products.attributes") }),
1349
- /* @__PURE__ */ jsx6(
1069
+ /* @__PURE__ */ jsx4(Heading4, { level: "h2", children: t("products.attributes") }),
1070
+ /* @__PURE__ */ jsx4(
1350
1071
  ActionMenu,
1351
1072
  {
1352
1073
  groups: [
@@ -1355,12 +1076,12 @@ var ProductAttributeSection = ({
1355
1076
  {
1356
1077
  label: t("products.create.attributes.addExisting"),
1357
1078
  to: "attributes/add",
1358
- icon: /* @__PURE__ */ jsx6(ListBullet, {})
1079
+ icon: /* @__PURE__ */ jsx4(ListBullet, {})
1359
1080
  },
1360
1081
  {
1361
1082
  label: t("products.create.attributes.createNew"),
1362
1083
  to: "attributes/create",
1363
- icon: /* @__PURE__ */ jsx6(Plus, {})
1084
+ icon: /* @__PURE__ */ jsx4(Plus, {})
1364
1085
  }
1365
1086
  ]
1366
1087
  }
@@ -1370,21 +1091,21 @@ var ProductAttributeSection = ({
1370
1091
  ]
1371
1092
  }
1372
1093
  ),
1373
- variantAttributes.length > 0 && /* @__PURE__ */ jsx6(
1094
+ variantAttributes.length > 0 && /* @__PURE__ */ jsx4(
1374
1095
  AttributeGroup,
1375
1096
  {
1376
- icon: /* @__PURE__ */ jsx6(Swatch, {}),
1097
+ icon: /* @__PURE__ */ jsx4(Swatch, {}),
1377
1098
  title: t("products.create.tabs.variants"),
1378
1099
  description: t("products.attributeVariantsDescription"),
1379
1100
  attributes: variantAttributes,
1380
1101
  productId: product.id
1381
1102
  }
1382
1103
  ),
1383
- variantAttributes.length > 0 && infoAttributes.length > 0 && /* @__PURE__ */ jsx6("div", { className: "border-t border-dashed border-ui-border-base" }),
1384
- infoAttributes.length > 0 && /* @__PURE__ */ jsx6(
1104
+ variantAttributes.length > 0 && infoAttributes.length > 0 && /* @__PURE__ */ jsx4("div", { className: "border-t border-dashed border-ui-border-base" }),
1105
+ infoAttributes.length > 0 && /* @__PURE__ */ jsx4(
1385
1106
  AttributeGroup,
1386
1107
  {
1387
- icon: /* @__PURE__ */ jsx6(DropCap, {}),
1108
+ icon: /* @__PURE__ */ jsx4(DropCap, {}),
1388
1109
  title: t("products.attributeProductInformation"),
1389
1110
  description: t("products.attributeProductInformationDescription"),
1390
1111
  attributes: infoAttributes,
@@ -1395,19 +1116,19 @@ var ProductAttributeSection = ({
1395
1116
  };
1396
1117
 
1397
1118
  // src/pages/products/[id]/_components/product-shipping-profile-section/product-shipping-profile-section.tsx
1398
- import { PencilSquare as PencilSquare6, ShoppingBag } from "@medusajs/icons";
1399
- import { Container as Container7, Heading as Heading7 } from "@medusajs/ui";
1400
- import { useTranslation as useTranslation7 } from "react-i18next";
1401
- import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
1119
+ import { PencilSquare as PencilSquare4, ShoppingBag } from "@medusajs/icons";
1120
+ import { Container as Container5, Heading as Heading5 } from "@medusajs/ui";
1121
+ import { useTranslation as useTranslation5 } from "react-i18next";
1122
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
1402
1123
  var ProductShippingProfileSection = ({
1403
1124
  product
1404
1125
  }) => {
1405
- const { t } = useTranslation7();
1126
+ const { t } = useTranslation5();
1406
1127
  const shippingProfile = product.shipping_profile;
1407
- return /* @__PURE__ */ jsxs7(Container7, { className: "p-0", children: [
1408
- /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between px-6 py-4", children: [
1409
- /* @__PURE__ */ jsx7(Heading7, { level: "h2", children: t("products.shippingProfile.header") }),
1410
- /* @__PURE__ */ jsx7(
1128
+ return /* @__PURE__ */ jsxs5(Container5, { className: "p-0", children: [
1129
+ /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between px-6 py-4", children: [
1130
+ /* @__PURE__ */ jsx5(Heading5, { level: "h2", children: t("products.shippingProfile.header") }),
1131
+ /* @__PURE__ */ jsx5(
1411
1132
  ActionMenu,
1412
1133
  {
1413
1134
  groups: [
@@ -1416,7 +1137,7 @@ var ProductShippingProfileSection = ({
1416
1137
  {
1417
1138
  label: t("actions.edit"),
1418
1139
  to: "shipping-profile",
1419
- icon: /* @__PURE__ */ jsx7(PencilSquare6, {})
1140
+ icon: /* @__PURE__ */ jsx5(PencilSquare4, {})
1420
1141
  }
1421
1142
  ]
1422
1143
  }
@@ -1424,38 +1145,38 @@ var ProductShippingProfileSection = ({
1424
1145
  }
1425
1146
  )
1426
1147
  ] }),
1427
- shippingProfile && /* @__PURE__ */ jsx7(
1148
+ shippingProfile && /* @__PURE__ */ jsx5(
1428
1149
  SidebarLink,
1429
1150
  {
1430
1151
  to: `/settings/locations/shipping-profiles/${shippingProfile.id}`,
1431
1152
  labelKey: shippingProfile.name,
1432
1153
  descriptionKey: shippingProfile.type,
1433
- icon: /* @__PURE__ */ jsx7(ShoppingBag, {})
1154
+ icon: /* @__PURE__ */ jsx5(ShoppingBag, {})
1434
1155
  }
1435
1156
  )
1436
1157
  ] });
1437
1158
  };
1438
1159
 
1439
1160
  // src/pages/products/[id]/_components/product-sales-channel-section/product-sales-channel-section.tsx
1440
- import { Channels, PencilSquare as PencilSquare7 } from "@medusajs/icons";
1441
- import { Container as Container8, Heading as Heading8, Text as Text4, Tooltip as Tooltip5 } from "@medusajs/ui";
1442
- import { Trans, useTranslation as useTranslation8 } from "react-i18next";
1443
- import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
1161
+ import { Channels, PencilSquare as PencilSquare5 } from "@medusajs/icons";
1162
+ import { Container as Container6, Heading as Heading6, Text as Text3, Tooltip as Tooltip4 } from "@medusajs/ui";
1163
+ import { Trans, useTranslation as useTranslation6 } from "react-i18next";
1164
+ import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
1444
1165
  var ProductSalesChannelSection = ({
1445
1166
  product
1446
1167
  }) => {
1447
1168
  const { count } = useSalesChannels();
1448
- const { t } = useTranslation8();
1169
+ const { t } = useTranslation6();
1449
1170
  const availableInSalesChannels = product.sales_channels?.map((sc) => ({
1450
1171
  id: sc.id,
1451
1172
  name: sc.name
1452
1173
  })) ?? [];
1453
1174
  const firstChannels = availableInSalesChannels.slice(0, 3);
1454
1175
  const restChannels = availableInSalesChannels.slice(3);
1455
- return /* @__PURE__ */ jsxs8(Container8, { className: "flex flex-col gap-y-4 px-6 py-4", children: [
1456
- /* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between", children: [
1457
- /* @__PURE__ */ jsx8(Heading8, { level: "h2", children: t("fields.sales_channels") }),
1458
- /* @__PURE__ */ jsx8(
1176
+ return /* @__PURE__ */ jsxs6(Container6, { className: "flex flex-col gap-y-4 px-6 py-4", children: [
1177
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between", children: [
1178
+ /* @__PURE__ */ jsx6(Heading6, { level: "h2", children: t("fields.sales_channels") }),
1179
+ /* @__PURE__ */ jsx6(
1459
1180
  ActionMenu,
1460
1181
  {
1461
1182
  groups: [
@@ -1464,7 +1185,7 @@ var ProductSalesChannelSection = ({
1464
1185
  {
1465
1186
  label: t("actions.edit"),
1466
1187
  to: "sales-channels",
1467
- icon: /* @__PURE__ */ jsx8(PencilSquare7, {})
1188
+ icon: /* @__PURE__ */ jsx6(PencilSquare5, {})
1468
1189
  }
1469
1190
  ]
1470
1191
  }
@@ -1472,16 +1193,16 @@ var ProductSalesChannelSection = ({
1472
1193
  }
1473
1194
  )
1474
1195
  ] }),
1475
- /* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-[28px_1fr] items-center gap-x-3", children: [
1476
- /* @__PURE__ */ jsx8("div", { className: "bg-ui-bg-base shadow-borders-base flex size-7 items-center justify-center rounded-md", children: /* @__PURE__ */ jsx8("div", { className: "bg-ui-bg-component flex size-6 items-center justify-center rounded-[4px]", children: /* @__PURE__ */ jsx8(Channels, { className: "text-ui-fg-subtle" }) }) }),
1477
- availableInSalesChannels.length > 0 ? /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-x-1", children: [
1478
- /* @__PURE__ */ jsx8(Text4, { size: "small", leading: "compact", children: firstChannels.map((sc) => sc.name).join(", ") }),
1479
- restChannels.length > 0 && /* @__PURE__ */ jsx8(
1480
- Tooltip5,
1196
+ /* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-[28px_1fr] items-center gap-x-3", children: [
1197
+ /* @__PURE__ */ jsx6("div", { className: "bg-ui-bg-base shadow-borders-base flex size-7 items-center justify-center rounded-md", children: /* @__PURE__ */ jsx6("div", { className: "bg-ui-bg-component flex size-6 items-center justify-center rounded-[4px]", children: /* @__PURE__ */ jsx6(Channels, { className: "text-ui-fg-subtle" }) }) }),
1198
+ availableInSalesChannels.length > 0 ? /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-x-1", children: [
1199
+ /* @__PURE__ */ jsx6(Text3, { size: "small", leading: "compact", children: firstChannels.map((sc) => sc.name).join(", ") }),
1200
+ restChannels.length > 0 && /* @__PURE__ */ jsx6(
1201
+ Tooltip4,
1481
1202
  {
1482
- content: /* @__PURE__ */ jsx8("ul", { children: restChannels.map((sc) => /* @__PURE__ */ jsx8("li", { children: sc.name }, sc.id)) }),
1483
- children: /* @__PURE__ */ jsx8(
1484
- Text4,
1203
+ content: /* @__PURE__ */ jsx6("ul", { children: restChannels.map((sc) => /* @__PURE__ */ jsx6("li", { children: sc.name }, sc.id)) }),
1204
+ children: /* @__PURE__ */ jsx6(
1205
+ Text3,
1485
1206
  {
1486
1207
  size: "small",
1487
1208
  leading: "compact",
@@ -1491,9 +1212,9 @@ var ProductSalesChannelSection = ({
1491
1212
  )
1492
1213
  }
1493
1214
  )
1494
- ] }) : /* @__PURE__ */ jsx8(Text4, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: t("products.noSalesChannels") })
1215
+ ] }) : /* @__PURE__ */ jsx6(Text3, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: t("products.noSalesChannels") })
1495
1216
  ] }),
1496
- /* @__PURE__ */ jsx8("div", { children: /* @__PURE__ */ jsx8(Text4, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: /* @__PURE__ */ jsx8(
1217
+ /* @__PURE__ */ jsx6("div", { children: /* @__PURE__ */ jsx6(Text3, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: /* @__PURE__ */ jsx6(
1497
1218
  Trans,
1498
1219
  {
1499
1220
  i18nKey: "sales_channels.availableIn",
@@ -1502,14 +1223,14 @@ var ProductSalesChannelSection = ({
1502
1223
  y: count ?? 0
1503
1224
  },
1504
1225
  components: [
1505
- /* @__PURE__ */ jsx8(
1226
+ /* @__PURE__ */ jsx6(
1506
1227
  "span",
1507
1228
  {
1508
1229
  className: "text-ui-fg-base txt-compact-medium-plus"
1509
1230
  },
1510
1231
  "x"
1511
1232
  ),
1512
- /* @__PURE__ */ jsx8(
1233
+ /* @__PURE__ */ jsx6(
1513
1234
  "span",
1514
1235
  {
1515
1236
  className: "text-ui-fg-base txt-compact-medium-plus"
@@ -1523,7 +1244,7 @@ var ProductSalesChannelSection = ({
1523
1244
  };
1524
1245
 
1525
1246
  // src/pages/products/[id]/product-detail-page.tsx
1526
- import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
1247
+ import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
1527
1248
  var Root = ({ children }) => {
1528
1249
  const initialData = useLoaderData();
1529
1250
  const { id } = useParams();
@@ -1535,21 +1256,21 @@ var Root = ({ children }) => {
1535
1256
  }
1536
1257
  );
1537
1258
  if (isLoading || !product) {
1538
- return /* @__PURE__ */ jsx9(TwoColumnPageSkeleton, { mainSections: 4, sidebarSections: 3 });
1259
+ return /* @__PURE__ */ jsx7(TwoColumnPageSkeleton, { mainSections: 4, sidebarSections: 3 });
1539
1260
  }
1540
1261
  if (isError) {
1541
1262
  throw error;
1542
1263
  }
1543
- return Children.count(children) > 0 ? /* @__PURE__ */ jsx9(TwoColumnPage, { data: product, "data-testid": "product-detail-page", children }) : /* @__PURE__ */ jsxs9(TwoColumnPage, { data: product, "data-testid": "product-detail-page", children: [
1544
- /* @__PURE__ */ jsxs9(TwoColumnPage.Main, { "data-testid": "product-detail-main", children: [
1545
- /* @__PURE__ */ jsx9(ProductActiveEditSection, { product }),
1546
- /* @__PURE__ */ jsx9(ProductGeneralSection, { product }),
1547
- /* @__PURE__ */ jsx9(ProductMediaSection, { product }),
1548
- /* @__PURE__ */ jsx9(ProductVariantSection, { product })
1264
+ return Children.count(children) > 0 ? /* @__PURE__ */ jsx7(TwoColumnPage, { data: product, "data-testid": "product-detail-page", children }) : /* @__PURE__ */ jsxs7(TwoColumnPage, { data: product, "data-testid": "product-detail-page", children: [
1265
+ /* @__PURE__ */ jsxs7(TwoColumnPage.Main, { "data-testid": "product-detail-main", children: [
1266
+ /* @__PURE__ */ jsx7(ProductActiveEditSection, { product }),
1267
+ /* @__PURE__ */ jsx7(ProductGeneralSection, { product }),
1268
+ /* @__PURE__ */ jsx7(ProductMediaSection, { product }),
1269
+ /* @__PURE__ */ jsx7(ProductVariantSection, { product })
1549
1270
  ] }),
1550
- /* @__PURE__ */ jsxs9(TwoColumnPage.Sidebar, { "data-testid": "product-detail-sidebar", children: [
1551
- /* @__PURE__ */ jsx9(ProductOrganizationSection, { product }),
1552
- /* @__PURE__ */ jsx9(ProductAttributeSection, { product })
1271
+ /* @__PURE__ */ jsxs7(TwoColumnPage.Sidebar, { "data-testid": "product-detail-sidebar", children: [
1272
+ /* @__PURE__ */ jsx7(ProductOrganizationSection, { product }),
1273
+ /* @__PURE__ */ jsx7(ProductAttributeSection, { product })
1553
1274
  ] })
1554
1275
  ] });
1555
1276
  };