@medusajs/dashboard 3.0.0-snapshot-20251202223100 → 3.0.0-snapshot-20251208164410

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 (241) hide show
  1. package/dist/{adjust-inventory-WZOCLB5V.mjs → adjust-inventory-ZB3AVET7.mjs} +1 -1
  2. package/dist/{api-key-management-create-W7NL2IYN.mjs → api-key-management-create-U6VGZK7R.mjs} +3 -3
  3. package/dist/{api-key-management-detail-LDBEO446.mjs → api-key-management-detail-OEAWWV5O.mjs} +13 -13
  4. package/dist/{api-key-management-edit-TLVLXAVK.mjs → api-key-management-edit-TJM737A7.mjs} +3 -3
  5. package/dist/{api-key-management-list-FTLC3ELT.mjs → api-key-management-list-ZRYMMTF5.mjs} +3 -3
  6. package/dist/{api-key-management-sales-channels-NYY3NZOE.mjs → api-key-management-sales-channels-D2RAHI7W.mjs} +4 -4
  7. package/dist/app.css +3 -3
  8. package/dist/app.js +17416 -15980
  9. package/dist/app.mjs +11 -11
  10. package/dist/{campaign-create-LHL7FKQK.mjs → campaign-create-IXOWJQ4L.mjs} +3 -3
  11. package/dist/{campaign-detail-T3V6M3XE.mjs → campaign-detail-TFQCDDIN.mjs} +10 -10
  12. package/dist/{categories-metadata-V6FDXGSN.mjs → categories-metadata-7JFVYYUN.mjs} +10 -10
  13. package/dist/{category-create-ELMCLH4J.mjs → category-create-BTMZYQ5R.mjs} +5 -5
  14. package/dist/{category-detail-DNWTF4FV.mjs → category-detail-UUEMLEVJ.mjs} +14 -14
  15. package/dist/{category-edit-TYKLEYGE.mjs → category-edit-Q3KEELHO.mjs} +2 -2
  16. package/dist/{category-list-IJ3DLPYQ.mjs → category-list-Z6HS6N75.mjs} +5 -5
  17. package/dist/{category-organize-PDLC54E2.mjs → category-organize-45NPSRNG.mjs} +2 -2
  18. package/dist/{category-products-ATK63QHB.mjs → category-products-KW6X3JDW.mjs} +13 -13
  19. package/dist/{chunk-WPXYFJEP.mjs → chunk-2WLOIS3L.mjs} +1 -1
  20. package/dist/{chunk-UHIPGDJZ.mjs → chunk-35G7IXTE.mjs} +15 -15
  21. package/dist/{chunk-DODQ3KJT.mjs → chunk-3RRA56WC.mjs} +8 -3
  22. package/dist/{chunk-DKIUGYWW.mjs → chunk-3ZJ55SFA.mjs} +2 -2
  23. package/dist/{chunk-OXPE5TAY.mjs → chunk-42TMWI76.mjs} +1 -1
  24. package/dist/{chunk-OFN7DIZA.mjs → chunk-5AM254NB.mjs} +83 -3
  25. package/dist/{chunk-56TDUOXV.mjs → chunk-5N33TBBX.mjs} +1 -1
  26. package/dist/{chunk-5LGRZSEH.mjs → chunk-67RC6SEX.mjs} +1 -1
  27. package/dist/{chunk-O4RZ3Y65.mjs → chunk-7H6DB666.mjs} +1 -1
  28. package/dist/{chunk-5EGFR4EO.mjs → chunk-AGBHQZZT.mjs} +318 -236
  29. package/dist/{chunk-E3AFVPLW.mjs → chunk-BWU3ZE4W.mjs} +1 -1
  30. package/dist/{chunk-IKTS7EHT.mjs → chunk-D55WNQYO.mjs} +1 -1
  31. package/dist/{chunk-XDLBQGST.mjs → chunk-EFRTOOI5.mjs} +1 -1
  32. package/dist/{chunk-ETOJCN3Q.mjs → chunk-FJHAGJ5G.mjs} +1 -1
  33. package/dist/{chunk-K5QWNI6V.mjs → chunk-FNQ227BC.mjs} +1 -1
  34. package/dist/{chunk-A6PWH2CK.mjs → chunk-GHBURGZC.mjs} +1 -1
  35. package/dist/{chunk-4MG5LND4.mjs → chunk-HEYM67GY.mjs} +1 -1
  36. package/dist/{chunk-QHRVYT5N.mjs → chunk-HRSO6H4F.mjs} +3 -3
  37. package/dist/{chunk-REUYEF7L.mjs → chunk-MB7M5THW.mjs} +1 -1
  38. package/dist/{chunk-KLNRCI3K.mjs → chunk-MOGV3UZD.mjs} +1 -1
  39. package/dist/{chunk-3C6WQ7NH.mjs → chunk-NFEW5CVI.mjs} +37 -3
  40. package/dist/{chunk-VGXF4DOW.mjs → chunk-NKGKWMUU.mjs} +5 -5
  41. package/dist/{chunk-RLDK4LY5.mjs → chunk-NTYLG6Y3.mjs} +1 -1
  42. package/dist/{chunk-AF7A24XI.mjs → chunk-O5DGX2NZ.mjs} +1 -1
  43. package/dist/{chunk-T2ANPJ36.mjs → chunk-OMRGW7JS.mjs} +3 -3
  44. package/dist/{chunk-7V2JZU2B.mjs → chunk-P23S5LDK.mjs} +2 -2
  45. package/dist/{chunk-OAW7KLET.mjs → chunk-PPRHEG37.mjs} +2 -2
  46. package/dist/{chunk-AENRV3N7.mjs → chunk-QW4SQVMT.mjs} +109 -50
  47. package/dist/{chunk-MWBKAP7W.mjs → chunk-RNYL6AXZ.mjs} +2 -2
  48. package/dist/{chunk-KWP436SM.mjs → chunk-S3MMZPMX.mjs} +2 -2
  49. package/dist/{chunk-ND5YSIPU.mjs → chunk-SAZHCRHS.mjs} +1 -1
  50. package/dist/{chunk-M3CKVBZC.mjs → chunk-YGEJFHC3.mjs} +1 -1
  51. package/dist/chunk-ZHH3W7CN.mjs +171 -0
  52. package/dist/{collection-add-products-7WSD7YU4.mjs → collection-add-products-YSTEEHMF.mjs} +14 -14
  53. package/dist/{collection-create-I2A2X4VK.mjs → collection-create-RIGJHEX5.mjs} +2 -2
  54. package/dist/{collection-detail-NVE55BPK.mjs → collection-detail-P5JWWFHH.mjs} +14 -14
  55. package/dist/{collection-edit-RGH7NCUE.mjs → collection-edit-WX5G3FHR.mjs} +2 -2
  56. package/dist/{collection-list-SXHRKTIU.mjs → collection-list-PU6SWYVL.mjs} +24 -23
  57. package/dist/{collection-metadata-ZREV7BND.mjs → collection-metadata-R55DUZSX.mjs} +11 -11
  58. package/dist/{customer-detail-O4L55RY6.mjs → customer-detail-HVGU3DRM.mjs} +14 -14
  59. package/dist/{customer-group-detail-LSZA4ARM.mjs → customer-group-detail-QKFWIFYH.mjs} +13 -13
  60. package/dist/{customer-group-list-6JTEUJAC.mjs → customer-group-list-WLG2ZMBD.mjs} +13 -13
  61. package/dist/{customers-add-customer-group-MHJ34FDF.mjs → customers-add-customer-group-KL5UXXOR.mjs} +13 -13
  62. package/dist/{edit-inventory-item-LMDNUI6M.mjs → edit-inventory-item-O6JLGZE4.mjs} +1 -1
  63. package/dist/{edit-inventory-item-attributes-DPJIHBP3.mjs → edit-inventory-item-attributes-AUVR3GYY.mjs} +1 -1
  64. package/dist/{edit-reservation-IOOZBJ2T.mjs → edit-reservation-GQ6R6GVA.mjs} +2 -2
  65. package/dist/{edit-rules-CEE2IKS6.mjs → edit-rules-PJWEWMM7.mjs} +12 -12
  66. package/dist/en.json +49 -3
  67. package/dist/{inventory-create-H62EOWR6.mjs → inventory-create-P3WYAGQZ.mjs} +10 -10
  68. package/dist/{inventory-detail-ALOIH3H7.mjs → inventory-detail-C2NU7GTA.mjs} +10 -10
  69. package/dist/{inventory-list-RQBI7UJX.mjs → inventory-list-ADJQDNX5.mjs} +1 -1
  70. package/dist/{inventory-metadata-ICOCEY75.mjs → inventory-metadata-V2N3HOPG.mjs} +10 -10
  71. package/dist/{inventory-stock-LDEZTKU4.mjs → inventory-stock-5DCIGKBI.mjs} +10 -10
  72. package/dist/{location-detail-UNXAQQSZ.mjs → location-detail-2CJWVT5M.mjs} +15 -15
  73. package/dist/{location-fulfillment-providers-XVFFAB6I.mjs → location-fulfillment-providers-PYPUR74W.mjs} +15 -14
  74. package/dist/{location-sales-channels-UVYT52SH.mjs → location-sales-channels-JPH5BTUY.mjs} +3 -3
  75. package/dist/{location-service-zone-shipping-option-create-THNTZX5P.mjs → location-service-zone-shipping-option-create-HLZLP422.mjs} +11 -11
  76. package/dist/{location-service-zone-shipping-option-edit-TQNTCYII.mjs → location-service-zone-shipping-option-edit-OYTEZGGC.mjs} +4 -4
  77. package/dist/{login-EMANCYJH.mjs → login-AKO3BIQT.mjs} +10 -10
  78. package/dist/{manage-locations-2VDQ3ILT.mjs → manage-locations-ATCDVTSR.mjs} +1 -1
  79. package/dist/{order-allocate-items-FCJTB2IB.mjs → order-allocate-items-2H25GRTK.mjs} +3 -3
  80. package/dist/{order-create-claim-P5ADYS5P.mjs → order-create-claim-CWGDAFFU.mjs} +17 -17
  81. package/dist/{order-create-edit-CVPRRPOA.mjs → order-create-edit-KJODOQXN.mjs} +11 -11
  82. package/dist/{order-create-exchange-IHV6VKO5.mjs → order-create-exchange-TM4FQLKM.mjs} +23 -23
  83. package/dist/{order-create-fulfillment-SY6UM3NJ.mjs → order-create-fulfillment-2WJZPAWX.mjs} +14 -14
  84. package/dist/{order-create-refund-AGKPMCF6.mjs → order-create-refund-A6WKCHX7.mjs} +15 -15
  85. package/dist/{order-create-return-5UH7FN3H.mjs → order-create-return-NDKTI4E5.mjs} +5 -5
  86. package/dist/{order-create-shipment-J34CYL32.mjs → order-create-shipment-3AVEAGAY.mjs} +10 -10
  87. package/dist/{order-detail-EVDCA6UP.mjs → order-detail-7HXZEBWJ.mjs} +31 -31
  88. package/dist/{order-edit-billing-address-JH3XNOCQ.mjs → order-edit-billing-address-DPK7HTLM.mjs} +10 -10
  89. package/dist/{order-edit-email-KV2IHQRT.mjs → order-edit-email-UJ2OUKHJ.mjs} +10 -10
  90. package/dist/{order-edit-shipping-address-WMNNU53B.mjs → order-edit-shipping-address-5ZCGHHZE.mjs} +10 -10
  91. package/dist/{order-list-26YQAIRH.mjs → order-list-5C4TVJRH.mjs} +4 -4
  92. package/dist/{order-metadata-F4LZ73LR.mjs → order-metadata-UKTGLYWR.mjs} +10 -10
  93. package/dist/{order-receive-return-LSMD7POH.mjs → order-receive-return-N7VLM2GX.mjs} +11 -11
  94. package/dist/{order-request-transfer-A3EBBZ5N.mjs → order-request-transfer-5ENT7IOT.mjs} +11 -11
  95. package/dist/{price-list-configuration-2G3WFC3J.mjs → price-list-configuration-SS2VMD4N.mjs} +4 -4
  96. package/dist/{price-list-create-RLT7G7KF.mjs → price-list-create-FF4F6M2A.mjs} +17 -17
  97. package/dist/{price-list-detail-TKRELOK2.mjs → price-list-detail-HQF4ZR2U.mjs} +17 -17
  98. package/dist/{price-list-edit-6URYI6AK.mjs → price-list-edit-VRI5T4W3.mjs} +2 -2
  99. package/dist/{price-list-list-FLINOQCK.mjs → price-list-list-S2HWTXKV.mjs} +3 -3
  100. package/dist/{price-list-prices-add-UPUY72HG.mjs → price-list-prices-add-JYZAHKAQ.mjs} +13 -13
  101. package/dist/{price-list-prices-edit-ZHAQDPWX.mjs → price-list-prices-edit-TRCLLGU4.mjs} +2 -2
  102. package/dist/{product-attributes-ZR63AQWA.mjs → product-attributes-NEXVST24.mjs} +12 -12
  103. package/dist/{product-create-EQ6SN5QT.mjs → product-create-WU4YFCMM.mjs} +377 -554
  104. package/dist/{product-create-variant-7C5PKKX7.mjs → product-create-variant-RDEE4IX7.mjs} +11 -11
  105. package/dist/{product-detail-ATPFDPI2.mjs → product-detail-J4JYWH2M.mjs} +38 -54
  106. package/dist/{product-edit-XPUNYMD7.mjs → product-edit-ZF2WYHPB.mjs} +12 -12
  107. package/dist/{product-export-GFLEIKIM.mjs → product-export-QDX6343F.mjs} +23 -22
  108. package/dist/{product-image-variants-edit-TC3M4PGX.mjs → product-image-variants-edit-5L5J32SO.mjs} +10 -10
  109. package/dist/{product-import-2Z5I7RXI.mjs → product-import-6TEVSKGQ.mjs} +10 -10
  110. package/dist/{product-list-33ANLONH.mjs → product-list-BHGGJX6B.mjs} +17 -17
  111. package/dist/{product-media-WCLPCVR3.mjs → product-media-EKXMOSO4.mjs} +2 -2
  112. package/dist/{product-metadata-GQU7EVZ3.mjs → product-metadata-BCJJNWAC.mjs} +10 -10
  113. package/dist/product-option-create-3Z73MSHD.mjs +336 -0
  114. package/dist/product-option-detail-4VRUA7KT.mjs +322 -0
  115. package/dist/product-option-edit-YIKFL6OY.mjs +324 -0
  116. package/dist/product-option-list-CR7NCCMH.mjs +267 -0
  117. package/dist/product-option-metadata-7CSZUQ7M.mjs +71 -0
  118. package/dist/product-options-manage-QOMXMPGW.mjs +304 -0
  119. package/dist/{product-organization-T2TQ5EH6.mjs → product-organization-IG54OB75.mjs} +14 -14
  120. package/dist/{product-prices-MKMKBH6P.mjs → product-prices-UMEIS5AZ.mjs} +1 -1
  121. package/dist/{product-sales-channels-5YIO22UW.mjs → product-sales-channels-2SALTLTF.mjs} +3 -3
  122. package/dist/{product-shipping-profile-PL76UMVZ.mjs → product-shipping-profile-VPHZLKDT.mjs} +13 -13
  123. package/dist/{product-stock-6QHBTDUQ.mjs → product-stock-3ILUPCVN.mjs} +10 -10
  124. package/dist/{product-tag-create-B6EOKDJT.mjs → product-tag-create-OOUTLHHD.mjs} +10 -10
  125. package/dist/{product-tag-detail-TQP7ZWSR.mjs → product-tag-detail-YVKJEAKT.mjs} +28 -27
  126. package/dist/{product-tag-edit-RPLWDG5A.mjs → product-tag-edit-RV5WITSN.mjs} +10 -10
  127. package/dist/{product-tag-list-PZTGHM7M.mjs → product-tag-list-ZSPFYZIL.mjs} +26 -25
  128. package/dist/{product-tag-metadata-FKKOT5CD.mjs → product-tag-metadata-S5YL3FUL.mjs} +10 -10
  129. package/dist/{product-type-detail-DDIBFR7O.mjs → product-type-detail-EFVZRETM.mjs} +13 -13
  130. package/dist/{product-type-metadata-EXCYTTQG.mjs → product-type-metadata-TNAASDKX.mjs} +10 -10
  131. package/dist/{product-variant-detail-GCESZH4H.mjs → product-variant-detail-CLP5FJP6.mjs} +10 -10
  132. package/dist/{product-variant-edit-JHOQJN6U.mjs → product-variant-edit-REMB77V7.mjs} +11 -11
  133. package/dist/{product-variant-manage-inventory-items-B7TUBSD5.mjs → product-variant-manage-inventory-items-IGDCLZQE.mjs} +2 -2
  134. package/dist/{product-variant-media-6WWLRINP.mjs → product-variant-media-EKI4BTEV.mjs} +1 -1
  135. package/dist/{product-variant-metadata-NEZIGTEP.mjs → product-variant-metadata-5JIY5KLN.mjs} +10 -10
  136. package/dist/{promotion-add-campaign-MKDYE7MW.mjs → promotion-add-campaign-DOALJUKJ.mjs} +3 -3
  137. package/dist/{promotion-create-CUAQY2NH.mjs → promotion-create-2PTB6NQI.mjs} +18 -18
  138. package/dist/{promotion-detail-2S7FWTXF.mjs → promotion-detail-RGXCA2XS.mjs} +10 -10
  139. package/dist/{refund-reason-create-4YAO4325.mjs → refund-reason-create-AGEFXEIZ.mjs} +10 -10
  140. package/dist/{refund-reason-edit-5J2VIRIL.mjs → refund-reason-edit-DL56EKBY.mjs} +10 -10
  141. package/dist/{refund-reason-list-453DXONV.mjs → refund-reason-list-RL2ZG7IJ.mjs} +13 -13
  142. package/dist/{region-create-QLPSK6TX.mjs → region-create-UVJICJRX.mjs} +1 -1
  143. package/dist/{region-edit-JCJHA6TY.mjs → region-edit-3NVXQECN.mjs} +1 -1
  144. package/dist/{region-metadata-C7DIBM35.mjs → region-metadata-2HO3SAPM.mjs} +10 -10
  145. package/dist/{reservation-create-BW4CDTWR.mjs → reservation-create-Z7TWUE2L.mjs} +3 -3
  146. package/dist/{reservation-detail-GFNWLSI2.mjs → reservation-detail-2AOBK5EY.mjs} +10 -10
  147. package/dist/{reservation-list-RGL67CIU.mjs → reservation-list-MN22JYAW.mjs} +2 -2
  148. package/dist/{reservation-metadata-OI2G4BDW.mjs → reservation-metadata-BFPJTXK6.mjs} +10 -10
  149. package/dist/{sales-channel-add-products-63NGB37Z.mjs → sales-channel-add-products-4LNP2TUM.mjs} +13 -13
  150. package/dist/{sales-channel-create-TOBEDYFD.mjs → sales-channel-create-UFFXX5HK.mjs} +2 -2
  151. package/dist/{sales-channel-detail-LJPQAJDT.mjs → sales-channel-detail-UMYMS2JA.mjs} +13 -13
  152. package/dist/{sales-channel-edit-XUTE5GB5.mjs → sales-channel-edit-SP2HF4E3.mjs} +2 -2
  153. package/dist/{sales-channel-list-TBAN7UT6.mjs → sales-channel-list-CV4V6R7H.mjs} +11 -11
  154. package/dist/{sales-channel-metadata-SE4TGSDB.mjs → sales-channel-metadata-REOQHHUT.mjs} +10 -10
  155. package/dist/{shipping-option-type-create-MB4ENYKV.mjs → shipping-option-type-create-XAWQO66M.mjs} +10 -10
  156. package/dist/{shipping-option-type-detail-IX4JGSTK.mjs → shipping-option-type-detail-G4WLGIAA.mjs} +11 -11
  157. package/dist/{shipping-option-type-edit-B5KU5LER.mjs → shipping-option-type-edit-OI6TBKGG.mjs} +10 -10
  158. package/dist/{shipping-option-type-list-TVR5OE2C.mjs → shipping-option-type-list-6GNCKAFB.mjs} +11 -11
  159. package/dist/{shipping-profile-metadata-Z35SYLBS.mjs → shipping-profile-metadata-MANQ7ZEI.mjs} +10 -10
  160. package/dist/{store-detail-VUJSSOKZ.mjs → store-detail-N2CP3MTB.mjs} +10 -10
  161. package/dist/{store-edit-3XS6IC2Z.mjs → store-edit-Q25HCMCQ.mjs} +1 -1
  162. package/dist/{store-metadata-TYFTDOEK.mjs → store-metadata-U22TVWK2.mjs} +10 -10
  163. package/dist/{tax-region-create-ZTCTKE4C.mjs → tax-region-create-JZB7NFIG.mjs} +11 -11
  164. package/dist/{tax-region-detail-MHM4MAOS.mjs → tax-region-detail-CBZ3ZJN2.mjs} +29 -28
  165. package/dist/{tax-region-edit-SFJGFTAV.mjs → tax-region-edit-E56XVHW2.mjs} +11 -11
  166. package/dist/{tax-region-province-detail-VMOV4JPV.mjs → tax-region-province-detail-2DC2U4EN.mjs} +29 -28
  167. package/dist/{tax-region-tax-override-create-GRXLTURD.mjs → tax-region-tax-override-create-JWGWGYB4.mjs} +28 -27
  168. package/dist/{tax-region-tax-override-edit-D2YBOBEI.mjs → tax-region-tax-override-edit-7DCU55AS.mjs} +27 -26
  169. package/dist/{user-detail-N6PT3KRP.mjs → user-detail-K5UMPO2L.mjs} +1 -1
  170. package/dist/{user-metadata-D5HNZWZY.mjs → user-metadata-EX5WDGCR.mjs} +10 -10
  171. package/dist/{workflow-execution-detail-GSUDCTN3.mjs → workflow-execution-detail-GBPFVG3O.mjs} +10 -10
  172. package/package.json +9 -9
  173. package/src/components/inputs/combobox/combobox.tsx +173 -92
  174. package/src/components/layout/main-layout/main-layout.tsx +7 -4
  175. package/src/dashboard-app/routes/get-route.map.tsx +64 -12
  176. package/src/hooks/api/index.ts +1 -0
  177. package/src/hooks/api/product-options.tsx +151 -0
  178. package/src/hooks/api/products.tsx +26 -66
  179. package/src/hooks/table/columns/use-product-option-table-columns.tsx +44 -0
  180. package/src/hooks/table/filters/index.ts +1 -0
  181. package/src/hooks/table/filters/use-product-option-table-filters.tsx +33 -0
  182. package/src/hooks/table/query/use-product-option-table-query.tsx +34 -0
  183. package/src/i18n/translations/$schema.json +171 -4
  184. package/src/i18n/translations/en.json +49 -3
  185. package/src/routes/product-options/common/hooks/use-delete-product-option-action.tsx +41 -0
  186. package/src/routes/product-options/product-option-create/components/create-product-option-form/create-product-option-details.tsx +71 -0
  187. package/src/routes/product-options/product-option-create/components/create-product-option-form/create-product-option-form.tsx +192 -0
  188. package/src/routes/product-options/product-option-create/components/create-product-option-form/create-product-option-organize.tsx +77 -0
  189. package/src/routes/product-options/product-option-create/components/create-product-option-form/index.ts +1 -0
  190. package/src/routes/product-options/product-option-create/components/create-product-option-form/schema.ts +15 -0
  191. package/src/routes/product-options/product-option-create/index.ts +1 -0
  192. package/src/routes/product-options/product-option-create/product-option-create.tsx +10 -0
  193. package/src/routes/product-options/product-option-detail/breadcrumb.tsx +14 -0
  194. package/src/routes/product-options/product-option-detail/components/product-option-general-section/index.ts +1 -0
  195. package/src/routes/product-options/product-option-detail/components/product-option-general-section/product-option-general-section.tsx +81 -0
  196. package/src/routes/product-options/product-option-detail/components/product-option-product-section/index.ts +1 -0
  197. package/src/routes/product-options/product-option-detail/components/product-option-product-section/product-option-product-section.tsx +74 -0
  198. package/src/routes/product-options/product-option-detail/index.ts +3 -0
  199. package/src/routes/product-options/product-option-detail/loader.ts +17 -0
  200. package/src/routes/product-options/product-option-detail/product-option-detail.tsx +50 -0
  201. package/src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-details.tsx +94 -0
  202. package/src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-form.tsx +116 -0
  203. package/src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-organize.tsx +77 -0
  204. package/src/routes/product-options/product-option-edit/components/edit-product-option-form/index.ts +1 -0
  205. package/src/routes/product-options/product-option-edit/components/edit-product-option-form/schema.ts +13 -0
  206. package/src/routes/product-options/product-option-edit/index.ts +1 -0
  207. package/src/routes/product-options/product-option-edit/product-option-edit.tsx +34 -0
  208. package/src/routes/product-options/product-option-list/components/product-option-list-table/index.ts +1 -0
  209. package/src/routes/product-options/product-option-list/components/product-option-list-table/product-option-list-table.tsx +140 -0
  210. package/src/routes/product-options/product-option-list/index.ts +1 -0
  211. package/src/routes/product-options/product-option-list/product-option-list.tsx +19 -0
  212. package/src/routes/product-options/product-option-metadata/index.ts +1 -0
  213. package/src/routes/product-options/product-option-metadata/product-option-metadata.tsx +27 -0
  214. package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-general-section/product-create-general-section.tsx +16 -4
  215. package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-variant-section/product-create-details-variant-section.tsx +220 -198
  216. package/src/routes/products/product-create/components/product-create-form/product-create-form.tsx +4 -7
  217. package/src/routes/products/product-create/constants.ts +2 -0
  218. package/src/routes/products/product-create/utils.ts +6 -1
  219. package/src/routes/products/product-detail/components/product-option-section/product-option-section.tsx +31 -49
  220. package/src/routes/products/product-options-manage/components/product-options-manage-form/index.ts +1 -0
  221. package/src/routes/products/product-options-manage/components/product-options-manage-form/product-options-manage-form.tsx +284 -0
  222. package/src/routes/products/product-options-manage/index.ts +1 -0
  223. package/src/routes/products/product-options-manage/product-options-manage.tsx +35 -0
  224. package/dist/product-create-option-GAEPSU6J.mjs +0 -145
  225. package/dist/product-edit-option-VIU3ZICO.mjs +0 -150
  226. package/src/routes/products/product-create-option/components/create-product-option-form/create-product-option-form.tsx +0 -122
  227. package/src/routes/products/product-create-option/components/create-product-option-form/index.ts +0 -1
  228. package/src/routes/products/product-create-option/index.ts +0 -1
  229. package/src/routes/products/product-create-option/product-create-option.tsx +0 -26
  230. package/src/routes/products/product-edit-option/components/edit-product-option-form/edit-product-option-form.tsx +0 -123
  231. package/src/routes/products/product-edit-option/components/edit-product-option-form/index.ts +0 -1
  232. package/src/routes/products/product-edit-option/index.ts +0 -1
  233. package/src/routes/products/product-edit-option/product-edit-option.tsx +0 -32
  234. package/dist/{chunk-ACJ3PPQJ.mjs → chunk-2QH2TBJ2.mjs} +3 -3
  235. package/dist/{customer-group-add-customers-QU4Q56SS.mjs → customer-group-add-customers-2Y2GVCDV.mjs} +3 -3
  236. package/dist/{customer-list-ZXCGIXJC.mjs → customer-list-TG4D4QOT.mjs} +3 -3
  237. package/dist/{location-list-OYBI7EGV.mjs → location-list-ZJMZZ6T3.mjs} +1 -1
  238. package/dist/{product-type-list-QX7QC6RI.mjs → product-type-list-7WQ5D2KV.mjs} +3 -3
  239. package/dist/{region-list-XQRIBDMF.mjs → region-list-JAQXIBYD.mjs} +3 -3
  240. package/dist/{return-reason-list-VYLLXDG4.mjs → return-reason-list-ATE2XU4H.mjs} +3 -3
  241. package/dist/{user-list-6KATHOTJ.mjs → user-list-KPI3BTOA.mjs} +3 -3
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  ChipGroup
3
3
  } from "./chunk-X5VECN6S.mjs";
4
+ import {
5
+ SortableList
6
+ } from "./chunk-ZHH3W7CN.mjs";
4
7
  import {
5
8
  HandleInput
6
9
  } from "./chunk-7OYLCEKK.mjs";
7
- import {
8
- ChipInput
9
- } from "./chunk-XDJ7OMBR.mjs";
10
10
  import {
11
11
  useSalesChannelTableColumns,
12
12
  useSalesChannelTableEmptyState,
@@ -16,20 +16,20 @@ import {
16
16
  import "./chunk-2X25XWOW.mjs";
17
17
  import {
18
18
  CategoryCombobox
19
- } from "./chunk-A6PWH2CK.mjs";
19
+ } from "./chunk-GHBURGZC.mjs";
20
20
  import {
21
21
  useComboboxData
22
22
  } from "./chunk-3TZOFKX2.mjs";
23
23
  import {
24
24
  Combobox
25
- } from "./chunk-OFN7DIZA.mjs";
25
+ } from "./chunk-5AM254NB.mjs";
26
26
  import {
27
27
  PRODUCT_CREATE_FORM_DEFAULTS,
28
28
  ProductCreateSchema,
29
29
  UploadMediaFormItem,
30
30
  decorateVariantsWithDefaultValues,
31
31
  normalizeProductFormValues
32
- } from "./chunk-DODQ3KJT.mjs";
32
+ } from "./chunk-3RRA56WC.mjs";
33
33
  import "./chunk-ZQRKUG6J.mjs";
34
34
  import {
35
35
  DataGrid,
@@ -38,10 +38,10 @@ import {
38
38
  } from "./chunk-W7SLPIO2.mjs";
39
39
  import "./chunk-DK4WIVY6.mjs";
40
40
  import "./chunk-BYOPZAGX.mjs";
41
- import "./chunk-2GWGNMAA.mjs";
42
41
  import {
43
42
  DataTable
44
43
  } from "./chunk-TBEGSDLQ.mjs";
44
+ import "./chunk-2GWGNMAA.mjs";
45
45
  import "./chunk-C76H5USB.mjs";
46
46
  import "./chunk-DZWH2RV6.mjs";
47
47
  import {
@@ -61,7 +61,7 @@ import {
61
61
  import {
62
62
  FormExtensionZone,
63
63
  useExtendableForm
64
- } from "./chunk-5EGFR4EO.mjs";
64
+ } from "./chunk-AGBHQZZT.mjs";
65
65
  import "./chunk-2SSUH2HJ.mjs";
66
66
  import "./chunk-ONB3JEHR.mjs";
67
67
  import "./chunk-YCDDT44O.mjs";
@@ -88,31 +88,31 @@ import "./chunk-SUYYSKCB.mjs";
88
88
  import {
89
89
  Form
90
90
  } from "./chunk-OBQI23QM.mjs";
91
- import "./chunk-RLDK4LY5.mjs";
91
+ import "./chunk-NTYLG6Y3.mjs";
92
92
  import "./chunk-I4OBEAOJ.mjs";
93
+ import "./chunk-YGEJFHC3.mjs";
93
94
  import "./chunk-HI6URQ7H.mjs";
94
95
  import "./chunk-6CLQKVAU.mjs";
95
- import "./chunk-HKIF5HVL.mjs";
96
- import "./chunk-M3CKVBZC.mjs";
97
96
  import "./chunk-KI7TOXBR.mjs";
97
+ import "./chunk-HKIF5HVL.mjs";
98
98
  import "./chunk-WAXMT4IY.mjs";
99
99
  import "./chunk-DYDGGABK.mjs";
100
100
  import "./chunk-LGNTHZ5Y.mjs";
101
101
  import "./chunk-CN7JXSGW.mjs";
102
102
  import "./chunk-5BQQRHQS.mjs";
103
- import "./chunk-WPXYFJEP.mjs";
103
+ import "./chunk-7H6DB666.mjs";
104
+ import "./chunk-2WLOIS3L.mjs";
104
105
  import "./chunk-5AFMB7XQ.mjs";
105
- import "./chunk-O4RZ3Y65.mjs";
106
106
  import "./chunk-A63RZVX6.mjs";
107
107
  import "./chunk-HBXV7ENS.mjs";
108
108
  import "./chunk-CDORR33H.mjs";
109
- import "./chunk-DKIUGYWW.mjs";
110
- import "./chunk-KLNRCI3K.mjs";
111
- import "./chunk-56TDUOXV.mjs";
109
+ import "./chunk-3ZJ55SFA.mjs";
110
+ import "./chunk-MOGV3UZD.mjs";
111
+ import "./chunk-5N33TBBX.mjs";
112
112
  import {
113
113
  useSalesChannel,
114
114
  useSalesChannels
115
- } from "./chunk-K5QWNI6V.mjs";
115
+ } from "./chunk-FNQ227BC.mjs";
116
116
  import "./chunk-3BF5SC66.mjs";
117
117
  import {
118
118
  useStore
@@ -124,8 +124,9 @@ import {
124
124
  usePricePreferences
125
125
  } from "./chunk-SQDIZZDW.mjs";
126
126
  import {
127
- useCreateProduct
128
- } from "./chunk-AENRV3N7.mjs";
127
+ useCreateProduct,
128
+ useProductOptions
129
+ } from "./chunk-QW4SQVMT.mjs";
129
130
  import "./chunk-FXYH54JP.mjs";
130
131
  import "./chunk-774WSTCC.mjs";
131
132
  import {
@@ -137,7 +138,7 @@ import "./chunk-QZ7TP4HQ.mjs";
137
138
  import { useTranslation as useTranslation10 } from "react-i18next";
138
139
 
139
140
  // src/routes/products/product-create/components/product-create-form/product-create-form.tsx
140
- import { Button as Button5, ProgressTabs, toast } from "@medusajs/ui";
141
+ import { Button as Button4, ProgressTabs, toast } from "@medusajs/ui";
141
142
  import { useEffect as useEffect2, useMemo as useMemo4, useState as useState4 } from "react";
142
143
  import { useWatch as useWatch4 } from "react-hook-form";
143
144
  import { useTranslation as useTranslation9 } from "react-i18next";
@@ -164,7 +165,13 @@ var ProductCreateGeneralSection = ({
164
165
  render: ({ field }) => {
165
166
  return /* @__PURE__ */ jsxs(Form.Item, { children: [
166
167
  /* @__PURE__ */ jsx(Form.Label, { children: t("products.fields.title.label") }),
167
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field, placeholder: t("products.fields.title.placeholder") }) })
168
+ /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
169
+ Input,
170
+ {
171
+ ...field,
172
+ placeholder: t("products.fields.title.placeholder")
173
+ }
174
+ ) })
168
175
  ] });
169
176
  }
170
177
  }
@@ -177,7 +184,13 @@ var ProductCreateGeneralSection = ({
177
184
  render: ({ field }) => {
178
185
  return /* @__PURE__ */ jsxs(Form.Item, { children: [
179
186
  /* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("products.fields.subtitle.label") }),
180
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field, placeholder: t("products.fields.subtitle.placeholder") }) })
187
+ /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
188
+ Input,
189
+ {
190
+ ...field,
191
+ placeholder: t("products.fields.subtitle.placeholder")
192
+ }
193
+ ) })
181
194
  ] });
182
195
  }
183
196
  }
@@ -197,7 +210,13 @@ var ProductCreateGeneralSection = ({
197
210
  children: t("fields.handle")
198
211
  }
199
212
  ),
200
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(HandleInput, { ...field, placeholder: t("products.fields.handle.placeholder") }) })
213
+ /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
214
+ HandleInput,
215
+ {
216
+ ...field,
217
+ placeholder: t("products.fields.handle.placeholder")
218
+ }
219
+ ) })
201
220
  ] });
202
221
  }
203
222
  }
@@ -211,7 +230,13 @@ var ProductCreateGeneralSection = ({
211
230
  render: ({ field }) => {
212
231
  return /* @__PURE__ */ jsxs(Form.Item, { children: [
213
232
  /* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("products.fields.description.label") }),
214
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Textarea, { ...field, placeholder: t("products.fields.description.placeholder") }) })
233
+ /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
234
+ Textarea,
235
+ {
236
+ ...field,
237
+ placeholder: t("products.fields.description.placeholder")
238
+ }
239
+ ) })
215
240
  ] });
216
241
  }
217
242
  }
@@ -512,197 +537,23 @@ function formatFileSize(bytes, decimalPlaces = 2) {
512
537
  }
513
538
 
514
539
  // src/routes/products/product-create/components/product-create-details-form/components/product-create-details-variant-section/product-create-details-variant-section.tsx
515
- import { XMarkMini } from "@medusajs/icons";
516
540
  import {
517
541
  Alert,
518
- Button,
519
542
  Checkbox,
520
- clx as clx2,
543
+ clx,
521
544
  Heading,
522
545
  Hint,
523
- IconButton as IconButton3,
524
546
  InlineTip,
525
- Input as Input2,
526
547
  Label,
527
548
  Text as Text2
528
549
  } from "@medusajs/ui";
529
550
  import {
530
- Controller,
531
551
  useFieldArray as useFieldArray2,
532
552
  useWatch
533
553
  } from "react-hook-form";
534
554
  import { useTranslation as useTranslation3 } from "react-i18next";
535
-
536
- // src/components/common/sortable-list/sortable-list.tsx
537
- import {
538
- DndContext as DndContext2,
539
- DragOverlay as DragOverlay2,
540
- KeyboardSensor as KeyboardSensor2,
541
- PointerSensor as PointerSensor2,
542
- defaultDropAnimationSideEffects as defaultDropAnimationSideEffects2,
543
- useSensor as useSensor2,
544
- useSensors as useSensors2
545
- } from "@dnd-kit/core";
546
- import {
547
- SortableContext as SortableContext2,
548
- arrayMove as arrayMove2,
549
- sortableKeyboardCoordinates as sortableKeyboardCoordinates2,
550
- useSortable as useSortable2
551
- } from "@dnd-kit/sortable";
552
- import { CSS as CSS2 } from "@dnd-kit/utilities";
553
- import { DotsSix as DotsSix2 } from "@medusajs/icons";
554
- import { IconButton as IconButton2, clx } from "@medusajs/ui";
555
- import {
556
- Fragment,
557
- createContext,
558
- useContext,
559
- useMemo,
560
- useState as useState2
561
- } from "react";
562
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
563
- var List = ({
564
- items,
565
- onChange,
566
- renderItem
567
- }) => {
568
- const [active, setActive] = useState2(null);
569
- const [activeItem, activeIndex] = useMemo(() => {
570
- if (active === null) {
571
- return [null, null];
572
- }
573
- const index = items.findIndex(({ id }) => id === active.id);
574
- return [items[index], index];
575
- }, [active, items]);
576
- const sensors = useSensors2(
577
- useSensor2(PointerSensor2),
578
- useSensor2(KeyboardSensor2, {
579
- coordinateGetter: sortableKeyboardCoordinates2
580
- })
581
- );
582
- const handleDragStart = ({ active: active2 }) => {
583
- setActive(active2);
584
- };
585
- const handleDragEnd = ({ active: active2, over }) => {
586
- if (over && active2.id !== over.id) {
587
- const activeIndex2 = items.findIndex(({ id }) => id === active2.id);
588
- const overIndex = items.findIndex(({ id }) => id === over.id);
589
- onChange(arrayMove2(items, activeIndex2, overIndex));
590
- }
591
- setActive(null);
592
- };
593
- const handleDragCancel = () => {
594
- setActive(null);
595
- };
596
- return /* @__PURE__ */ jsxs3(
597
- DndContext2,
598
- {
599
- sensors,
600
- onDragStart: handleDragStart,
601
- onDragEnd: handleDragEnd,
602
- onDragCancel: handleDragCancel,
603
- children: [
604
- /* @__PURE__ */ jsx3(Overlay, { children: activeItem && activeIndex !== null ? renderItem(activeItem, activeIndex) : null }),
605
- /* @__PURE__ */ jsx3(SortableContext2, { items, children: /* @__PURE__ */ jsx3(
606
- "ul",
607
- {
608
- role: "application",
609
- className: "flex list-inside list-none list-image-none flex-col p-0",
610
- children: items.map((item, index) => /* @__PURE__ */ jsx3(Fragment, { children: renderItem(item, index) }, item.id))
611
- }
612
- ) })
613
- ]
614
- }
615
- );
616
- };
617
- var dropAnimationConfig2 = {
618
- sideEffects: defaultDropAnimationSideEffects2({
619
- styles: {
620
- active: {
621
- opacity: "0.4"
622
- }
623
- }
624
- })
625
- };
626
- var Overlay = ({ children }) => {
627
- return /* @__PURE__ */ jsx3(
628
- DragOverlay2,
629
- {
630
- className: "shadow-elevation-card-hover overflow-hidden rounded-md [&>li]:border-b-0",
631
- dropAnimation: dropAnimationConfig2,
632
- children
633
- }
634
- );
635
- };
636
- var SortableItemContext = createContext(null);
637
- var useSortableItemContext = () => {
638
- const context = useContext(SortableItemContext);
639
- if (!context) {
640
- throw new Error(
641
- "useSortableItemContext must be used within a SortableItemContext"
642
- );
643
- }
644
- return context;
645
- };
646
- var Item = ({
647
- id,
648
- className,
649
- children
650
- }) => {
651
- const {
652
- attributes,
653
- isDragging,
654
- listeners,
655
- setNodeRef,
656
- setActivatorNodeRef,
657
- transform,
658
- transition
659
- } = useSortable2({ id });
660
- const context = useMemo(
661
- () => ({
662
- attributes,
663
- listeners,
664
- ref: setActivatorNodeRef,
665
- isDragging
666
- }),
667
- [attributes, listeners, setActivatorNodeRef, isDragging]
668
- );
669
- const style = {
670
- opacity: isDragging ? 0.4 : void 0,
671
- transform: CSS2.Translate.toString(transform),
672
- transition
673
- };
674
- return /* @__PURE__ */ jsx3(SortableItemContext.Provider, { value: context, children: /* @__PURE__ */ jsx3(
675
- "li",
676
- {
677
- className: clx("transition-fg flex flex-1 list-none", className),
678
- ref: setNodeRef,
679
- style,
680
- children
681
- }
682
- ) });
683
- };
684
- var DragHandle = () => {
685
- const { attributes, listeners, ref } = useSortableItemContext();
686
- return /* @__PURE__ */ jsx3(
687
- IconButton2,
688
- {
689
- variant: "transparent",
690
- size: "small",
691
- ...attributes,
692
- ...listeners,
693
- ref,
694
- className: "cursor-grab touch-none active:cursor-grabbing",
695
- children: /* @__PURE__ */ jsx3(DotsSix2, { className: "text-ui-fg-muted" })
696
- }
697
- );
698
- };
699
- var SortableList = Object.assign(List, {
700
- Item,
701
- DragHandle
702
- });
703
-
704
- // src/routes/products/product-create/components/product-create-details-form/components/product-create-details-variant-section/product-create-details-variant-section.tsx
705
- import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
555
+ import { useMemo, useState as useState2 } from "react";
556
+ import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
706
557
  var getPermutations = (data) => {
707
558
  if (data.length === 0) {
708
559
  return [];
@@ -728,10 +579,6 @@ var ProductCreateVariantsSection = ({
728
579
  form
729
580
  }) => {
730
581
  const { t } = useTranslation3();
731
- const options = useFieldArray2({
732
- control: form.control,
733
- name: "options"
734
- });
735
582
  const variants = useFieldArray2({
736
583
  control: form.control,
737
584
  name: "variants"
@@ -753,71 +600,117 @@ var ProductCreateVariantsSection = ({
753
600
  });
754
601
  const showInvalidOptionsMessage = !!form.formState.errors.options?.length;
755
602
  const showInvalidVariantsMessage = form.formState.errors.variants?.root?.message === "invalid_length";
756
- const handleOptionValueUpdate = (index, value) => {
757
- const { isTouched: hasUserSelectedVariants } = form.getFieldState("variants");
758
- const newOptions = [...watchedOptions];
759
- newOptions[index].values = value;
760
- const permutations = getPermutations(
761
- newOptions.filter(({ values }) => values.length)
603
+ const { product_options = [], isLoading } = useProductOptions({
604
+ is_exclusive: false
605
+ });
606
+ const productOptionChoices = useMemo(() => {
607
+ return product_options.map((option) => ({
608
+ value: option.id,
609
+ label: option.title
610
+ }));
611
+ }, [product_options]);
612
+ const [selectedOptionIds, setSelectedOptionIds] = useState2([]);
613
+ const [selectedOptionValues, setSelectedOptionValues] = useState2({});
614
+ const [customValues, setCustomValues] = useState2({});
615
+ const handleProductOptionSelect = (optionIds) => {
616
+ setSelectedOptionIds(optionIds);
617
+ const newSelectedValues = {};
618
+ const selectedProductOptions = product_options.filter(
619
+ (option) => optionIds.includes(option.id)
762
620
  );
763
- const oldVariants = [...watchedVariants];
764
- const findMatchingPermutation = (options2) => {
765
- return permutations.find(
766
- (permutation) => Object.keys(options2).every((key) => options2[key] === permutation[key])
767
- );
768
- };
769
- const newVariants = oldVariants.reduce((variants2, variant) => {
770
- const match = findMatchingPermutation(variant.options);
771
- if (match) {
772
- variants2.push({
773
- ...variant,
774
- title: getVariantName(match),
775
- options: match
776
- });
621
+ selectedProductOptions.forEach((option) => {
622
+ if (selectedOptionValues[option.id]) {
623
+ newSelectedValues[option.id] = selectedOptionValues[option.id];
624
+ } else {
625
+ newSelectedValues[option.id] = option.values?.map((v) => v.id) || [];
777
626
  }
778
- return variants2;
779
- }, []);
780
- const usedPermutations = new Set(
781
- newVariants.map((variant) => variant.options)
782
- );
783
- const unusedPermutations = permutations.filter(
784
- (permutation) => !usedPermutations.has(permutation)
785
- );
786
- unusedPermutations.forEach((permutation) => {
787
- newVariants.push({
788
- title: getVariantName(permutation),
789
- options: permutation,
790
- should_create: hasUserSelectedVariants ? false : true,
791
- variant_rank: newVariants.length,
792
- // NOTE - prepare inventory array here for now so we prevent rendering issue if we append the items later
793
- inventory: [{ inventory_item_id: "", required_quantity: "" }]
794
- });
795
627
  });
796
- form.setValue("variants", newVariants);
628
+ setSelectedOptionValues(newSelectedValues);
629
+ updateFormWithSelectedValues(selectedProductOptions, newSelectedValues);
797
630
  };
798
- const handleRemoveOption = (index) => {
799
- if (index === 0) {
631
+ const handleValueChange = (optionId, valueIds) => {
632
+ if (valueIds.length === 0) {
800
633
  return;
801
634
  }
802
- options.remove(index);
803
- const newOptions = [...watchedOptions];
804
- newOptions.splice(index, 1);
805
- const validOptionTitles = new Set(newOptions.map((option) => option.title));
806
- const permutations = getPermutations(newOptions);
807
- const oldVariants = [...watchedVariants];
808
- const newVariants = permutations.reduce((variants2, permutation) => {
809
- const variant = oldVariants.find(
810
- ({ options: options2 }) => Object.keys(options2).filter((option) => validOptionTitles.has(option)).every((key) => options2[key] === permutation[key])
811
- );
812
- if (variant) {
813
- variants2.push({
814
- ...variant,
815
- title: variant.title,
816
- options: permutation
817
- });
635
+ const allValues = getAllValuesForOption(optionId);
636
+ const existingValueIds = new Set(allValues.map((v) => v.id));
637
+ const validValueIds = [];
638
+ const newCustomValues = [];
639
+ valueIds.forEach((id) => {
640
+ if (existingValueIds.has(id)) {
641
+ validValueIds.push(id);
642
+ } else {
643
+ newCustomValues.push(id);
818
644
  }
819
- return variants2;
820
- }, []);
645
+ });
646
+ let updatedCustomValues = customValues;
647
+ const updatedValidValueIds = [...validValueIds];
648
+ newCustomValues.forEach((newValue) => {
649
+ const tempId = `custom-${Date.now()}-${Math.random()}-${newValue}`;
650
+ const existingCustom = updatedCustomValues[optionId] || [];
651
+ const option = product_options.find((opt) => opt.id === optionId);
652
+ const existingValuesCount = (option?.values?.length || 0) + existingCustom.length;
653
+ const newCustomValue = {
654
+ id: tempId,
655
+ value: newValue,
656
+ rank: existingValuesCount + newCustomValues.indexOf(newValue)
657
+ };
658
+ updatedCustomValues = {
659
+ ...updatedCustomValues,
660
+ [optionId]: [...updatedCustomValues[optionId] || [], newCustomValue]
661
+ };
662
+ updatedValidValueIds.push(tempId);
663
+ });
664
+ if (newCustomValues.length > 0) {
665
+ setCustomValues(updatedCustomValues);
666
+ }
667
+ const updatedSelectedValues = {
668
+ ...selectedOptionValues,
669
+ [optionId]: updatedValidValueIds
670
+ };
671
+ setSelectedOptionValues(updatedSelectedValues);
672
+ const selectedProductOptions = product_options.filter(
673
+ (option) => selectedOptionIds.includes(option.id)
674
+ );
675
+ updateFormWithSelectedValues(
676
+ selectedProductOptions,
677
+ updatedSelectedValues,
678
+ newCustomValues.length > 0 ? updatedCustomValues : void 0
679
+ );
680
+ };
681
+ const getAllValuesForOption = (optionId, customVals) => {
682
+ const option = product_options.find((opt) => opt.id === optionId);
683
+ const existingValues = option?.values || [];
684
+ const customForOption = (customVals || customValues)[optionId] || [];
685
+ return [...existingValues, ...customForOption];
686
+ };
687
+ const updateFormWithSelectedValues = (selectedProductOptions, valueSelections, customVals) => {
688
+ const newOptions = selectedProductOptions.map((option) => {
689
+ const selectedValueIds = valueSelections[option.id] || [];
690
+ const allValues = getAllValuesForOption(option.id, customVals);
691
+ const selectedValues = allValues.filter((v) => selectedValueIds.includes(v.id)).sort((a, b) => {
692
+ const rankA = a.rank ?? Number.MAX_VALUE;
693
+ const rankB = b.rank ?? Number.MAX_VALUE;
694
+ return rankA - rankB;
695
+ }).map((v) => v.value);
696
+ return {
697
+ id: option.id,
698
+ title: option.title,
699
+ values: selectedValues,
700
+ value_ids: selectedValueIds
701
+ };
702
+ });
703
+ form.setValue("options", newOptions);
704
+ const permutations = getPermutations(
705
+ newOptions.filter(({ values }) => values.length)
706
+ );
707
+ const newVariants = permutations.map((permutation, index) => ({
708
+ title: getVariantName(permutation),
709
+ options: permutation,
710
+ should_create: true,
711
+ variant_rank: index,
712
+ inventory: [{ inventory_item_id: "", required_quantity: "" }]
713
+ }));
821
714
  form.setValue("variants", newVariants);
822
715
  };
823
716
  const handleRankChange = (items) => {
@@ -889,10 +782,10 @@ var ProductCreateVariantsSection = ({
889
782
  ])
890
783
  );
891
784
  };
892
- return /* @__PURE__ */ jsxs4("div", { id: "variants", className: "flex flex-col gap-y-8", children: [
893
- /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-y-6", children: [
894
- /* @__PURE__ */ jsx4(Heading, { level: "h2", children: t("products.create.variants.header") }),
895
- /* @__PURE__ */ jsx4(
785
+ return /* @__PURE__ */ jsxs3("div", { id: "variants", className: "flex flex-col gap-y-8", children: [
786
+ /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-y-6", children: [
787
+ /* @__PURE__ */ jsx3(Heading, { level: "h2", children: t("products.create.variants.header") }),
788
+ /* @__PURE__ */ jsx3(
896
789
  SwitchBox,
897
790
  {
898
791
  control: form.control,
@@ -911,141 +804,74 @@ var ProductCreateVariantsSection = ({
911
804
  } else {
912
805
  createDefaultOptionAndVariant();
913
806
  }
807
+ setSelectedOptionIds([]);
808
+ setSelectedOptionValues({});
809
+ setCustomValues({});
914
810
  }
915
811
  }
916
812
  )
917
813
  ] }),
918
- watchedAreVariantsEnabled && /* @__PURE__ */ jsxs4(Fragment2, { children: [
919
- /* @__PURE__ */ jsx4("div", { className: "flex flex-col gap-y-6", children: /* @__PURE__ */ jsx4(
920
- Form.Field,
921
- {
922
- control: form.control,
923
- name: "options",
924
- render: () => {
925
- return /* @__PURE__ */ jsx4(Form.Item, { children: /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-y-6", children: [
926
- /* @__PURE__ */ jsxs4("div", { className: "flex items-start justify-between gap-x-4", children: [
927
- /* @__PURE__ */ jsxs4("div", { className: "flex flex-col", children: [
928
- /* @__PURE__ */ jsx4(Form.Label, { children: t("products.create.variants.productOptions.label") }),
929
- /* @__PURE__ */ jsx4(Form.Hint, { children: t("products.create.variants.productOptions.hint") })
930
- ] }),
931
- /* @__PURE__ */ jsx4(
932
- Button,
933
- {
934
- size: "small",
935
- variant: "secondary",
936
- type: "button",
937
- onClick: () => {
938
- options.append({
939
- title: "",
940
- values: []
941
- });
942
- },
943
- children: t("actions.add")
944
- }
945
- )
946
- ] }),
947
- showInvalidOptionsMessage && /* @__PURE__ */ jsx4(Alert, { dismissible: true, variant: "error", children: t("products.create.errors.options") }),
948
- /* @__PURE__ */ jsx4("ul", { className: "flex flex-col gap-y-4", children: options.fields.map((option, index) => {
949
- const hasError = !!form.formState.errors.options?.[index];
950
- return /* @__PURE__ */ jsxs4(
951
- "li",
952
- {
953
- className: clx2(
954
- "bg-ui-bg-component shadow-elevation-card-rest grid grid-cols-[1fr_28px] items-center gap-1.5 rounded-xl p-1.5",
955
- {
956
- "border-ui-border-error shadow-borders-error": hasError
957
- }
958
- ),
959
- children: [
960
- /* @__PURE__ */ jsxs4("div", { className: "grid grid-cols-[min-content,1fr] items-center gap-1.5", children: [
961
- /* @__PURE__ */ jsx4("div", { className: "flex items-center px-2 py-1.5", children: /* @__PURE__ */ jsx4(
962
- Label,
963
- {
964
- size: "xsmall",
965
- weight: "plus",
966
- className: "text-ui-fg-subtle",
967
- htmlFor: `options.${index}.title`,
968
- children: t("fields.title")
969
- }
970
- ) }),
971
- /* @__PURE__ */ jsx4(
972
- Input2,
973
- {
974
- className: "bg-ui-bg-field-component hover:bg-ui-bg-field-component-hover",
975
- ...form.register(
976
- `options.${index}.title`
977
- ),
978
- placeholder: t(
979
- "products.fields.options.optionTitlePlaceholder"
980
- )
981
- }
982
- ),
983
- /* @__PURE__ */ jsx4("div", { className: "flex items-center px-2 py-1.5", children: /* @__PURE__ */ jsx4(
984
- Label,
985
- {
986
- size: "xsmall",
987
- weight: "plus",
988
- className: "text-ui-fg-subtle",
989
- htmlFor: `options.${index}.values`,
990
- children: t("fields.values")
991
- }
992
- ) }),
993
- /* @__PURE__ */ jsx4(
994
- Controller,
995
- {
996
- control: form.control,
997
- name: `options.${index}.values`,
998
- render: ({
999
- field: { onChange, ...field }
1000
- }) => {
1001
- const handleValueChange = (value) => {
1002
- handleOptionValueUpdate(index, value);
1003
- onChange(value);
1004
- };
1005
- return /* @__PURE__ */ jsx4(
1006
- ChipInput,
1007
- {
1008
- ...field,
1009
- variant: "contrast",
1010
- onChange: handleValueChange,
1011
- placeholder: t(
1012
- "products.fields.options.variantionsPlaceholder"
1013
- )
1014
- }
1015
- );
1016
- }
1017
- }
1018
- )
1019
- ] }),
1020
- /* @__PURE__ */ jsx4(
1021
- IconButton3,
1022
- {
1023
- type: "button",
1024
- size: "small",
1025
- variant: "transparent",
1026
- className: "text-ui-fg-muted",
1027
- disabled: index === 0,
1028
- onClick: () => handleRemoveOption(index),
1029
- children: /* @__PURE__ */ jsx4(XMarkMini, {})
1030
- }
1031
- )
1032
- ]
1033
- },
1034
- option.id
1035
- );
1036
- }) })
1037
- ] }) });
814
+ watchedAreVariantsEnabled && /* @__PURE__ */ jsxs3(Fragment, { children: [
815
+ /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-y-6", children: [
816
+ /* @__PURE__ */ jsxs3("div", { className: "flex flex-col", children: [
817
+ /* @__PURE__ */ jsx3(Label, { weight: "plus", children: t("products.create.variants.productOptions.label") }),
818
+ /* @__PURE__ */ jsx3(Hint, { children: t("products.create.variants.productOptions.hint") })
819
+ ] }),
820
+ showInvalidOptionsMessage && /* @__PURE__ */ jsx3(Alert, { dismissible: true, variant: "error", children: t("products.create.errors.options") }),
821
+ /* @__PURE__ */ jsx3(
822
+ Combobox,
823
+ {
824
+ value: selectedOptionIds,
825
+ onChange: (value) => handleProductOptionSelect(value),
826
+ options: productOptionChoices,
827
+ placeholder: t("products.fields.options.optionTitlePlaceholder"),
828
+ disabled: isLoading,
829
+ displayMode: "chips"
1038
830
  }
1039
- }
1040
- ) }),
1041
- /* @__PURE__ */ jsx4("div", { className: "grid grid-cols-1 gap-x-4 gap-y-8", children: /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-y-6", children: [
1042
- /* @__PURE__ */ jsxs4("div", { className: "flex flex-col", children: [
1043
- /* @__PURE__ */ jsx4(Label, { weight: "plus", children: t("products.create.variants.productVariants.label") }),
1044
- /* @__PURE__ */ jsx4(Hint, { children: t("products.create.variants.productVariants.hint") })
831
+ )
832
+ ] }),
833
+ selectedOptionIds.length > 0 && /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-y-4", children: [
834
+ /* @__PURE__ */ jsxs3("div", { className: "flex flex-col", children: [
835
+ /* @__PURE__ */ jsx3(Label, { weight: "plus", children: t("fields.values") }),
836
+ /* @__PURE__ */ jsx3(Hint, { children: t("products.create.variants.selectValuesHint") })
837
+ ] }),
838
+ /* @__PURE__ */ jsx3("div", { className: "flex flex-col gap-y-3", children: product_options.filter((option) => selectedOptionIds.includes(option.id)).map((option) => {
839
+ const allValues = getAllValuesForOption(option.id);
840
+ const valueOptions = allValues.sort((a, b) => {
841
+ const rankA = a.rank ?? Number.MAX_VALUE;
842
+ const rankB = b.rank ?? Number.MAX_VALUE;
843
+ return rankA - rankB;
844
+ }).map((v) => ({
845
+ value: v.id,
846
+ label: v.value
847
+ }));
848
+ return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-y-2", children: [
849
+ /* @__PURE__ */ jsx3(Label, { size: "small", weight: "plus", children: option.title }),
850
+ /* @__PURE__ */ jsx3(
851
+ Combobox,
852
+ {
853
+ value: selectedOptionValues[option.id] || [],
854
+ onChange: (value) => handleValueChange(option.id, value),
855
+ onCreateOption: (_) => {
856
+ },
857
+ options: valueOptions,
858
+ placeholder: t(
859
+ "products.fields.options.variantionsPlaceholder"
860
+ ),
861
+ displayMode: "chips"
862
+ }
863
+ )
864
+ ] }, option.id);
865
+ }) })
866
+ ] }),
867
+ /* @__PURE__ */ jsx3("div", { className: "grid grid-cols-1 gap-x-4 gap-y-8", children: /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-y-6", children: [
868
+ /* @__PURE__ */ jsxs3("div", { className: "flex flex-col", children: [
869
+ /* @__PURE__ */ jsx3(Label, { weight: "plus", children: t("products.create.variants.productVariants.label") }),
870
+ /* @__PURE__ */ jsx3(Hint, { children: t("products.create.variants.productVariants.hint") })
1045
871
  ] }),
1046
- !showInvalidOptionsMessage && showInvalidVariantsMessage && /* @__PURE__ */ jsx4(Alert, { dismissible: true, variant: "error", children: t("products.create.errors.variants") }),
1047
- variants.fields.length > 0 ? /* @__PURE__ */ jsxs4("div", { className: "overflow-hidden rounded-xl border", children: [
1048
- /* @__PURE__ */ jsxs4(
872
+ !showInvalidOptionsMessage && showInvalidVariantsMessage && /* @__PURE__ */ jsx3(Alert, { dismissible: true, variant: "error", children: t("products.create.errors.variants") }),
873
+ variants.fields.length > 0 ? /* @__PURE__ */ jsxs3("div", { className: "overflow-hidden rounded-xl border", children: [
874
+ /* @__PURE__ */ jsxs3(
1049
875
  "div",
1050
876
  {
1051
877
  className: "bg-ui-bg-component text-ui-fg-subtle grid items-center gap-3 border-b px-6 py-2.5",
@@ -1053,7 +879,7 @@ var ProductCreateVariantsSection = ({
1053
879
  gridTemplateColumns: `20px 28px repeat(${watchedOptions.length}, 1fr)`
1054
880
  },
1055
881
  children: [
1056
- /* @__PURE__ */ jsx4("div", { children: /* @__PURE__ */ jsx4(
882
+ /* @__PURE__ */ jsx3("div", { children: /* @__PURE__ */ jsx3(
1057
883
  Checkbox,
1058
884
  {
1059
885
  className: "relative",
@@ -1061,25 +887,25 @@ var ProductCreateVariantsSection = ({
1061
887
  onCheckedChange: onCheckboxChange
1062
888
  }
1063
889
  ) }),
1064
- /* @__PURE__ */ jsx4("div", {}),
1065
- watchedOptions.map((option, index) => /* @__PURE__ */ jsx4("div", { children: /* @__PURE__ */ jsx4(Text2, { size: "small", leading: "compact", weight: "plus", children: option.title }) }, index))
890
+ /* @__PURE__ */ jsx3("div", {}),
891
+ watchedOptions.map((option, index) => /* @__PURE__ */ jsx3("div", { children: /* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", weight: "plus", children: option.title }) }, index))
1066
892
  ]
1067
893
  }
1068
894
  ),
1069
- /* @__PURE__ */ jsx4(
895
+ /* @__PURE__ */ jsx3(
1070
896
  SortableList,
1071
897
  {
1072
898
  items: variants.fields,
1073
899
  onChange: handleRankChange,
1074
900
  renderItem: (item, index) => {
1075
- return /* @__PURE__ */ jsx4(
901
+ return /* @__PURE__ */ jsx3(
1076
902
  SortableList.Item,
1077
903
  {
1078
904
  id: item.id,
1079
- className: clx2("bg-ui-bg-base border-b", {
905
+ className: clx("bg-ui-bg-base border-b", {
1080
906
  "border-b-0": index === variants.fields.length - 1
1081
907
  }),
1082
- children: /* @__PURE__ */ jsxs4(
908
+ children: /* @__PURE__ */ jsxs3(
1083
909
  "div",
1084
910
  {
1085
911
  className: "text-ui-fg-subtle grid w-full items-center gap-3 px-6 py-2.5",
@@ -1087,7 +913,7 @@ var ProductCreateVariantsSection = ({
1087
913
  gridTemplateColumns: `20px 28px repeat(${watchedOptions.length}, 1fr)`
1088
914
  },
1089
915
  children: [
1090
- /* @__PURE__ */ jsx4(
916
+ /* @__PURE__ */ jsx3(
1091
917
  Form.Field,
1092
918
  {
1093
919
  control: form.control,
@@ -1095,7 +921,7 @@ var ProductCreateVariantsSection = ({
1095
921
  render: ({
1096
922
  field: { value, onChange, ...field }
1097
923
  }) => {
1098
- return /* @__PURE__ */ jsx4(Form.Item, { children: /* @__PURE__ */ jsx4(Form.Control, { children: /* @__PURE__ */ jsx4(
924
+ return /* @__PURE__ */ jsx3(Form.Item, { children: /* @__PURE__ */ jsx3(Form.Control, { children: /* @__PURE__ */ jsx3(
1099
925
  Checkbox,
1100
926
  {
1101
927
  className: "relative",
@@ -1107,8 +933,8 @@ var ProductCreateVariantsSection = ({
1107
933
  }
1108
934
  }
1109
935
  ),
1110
- /* @__PURE__ */ jsx4(SortableList.DragHandle, {}),
1111
- Object.values(item.options).map((value, index2) => /* @__PURE__ */ jsx4(Text2, { size: "small", leading: "compact", children: value }, index2))
936
+ /* @__PURE__ */ jsx3(SortableList.DragHandle, {}),
937
+ Object.values(item.options).map((value, index2) => /* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", children: value }, index2))
1112
938
  ]
1113
939
  }
1114
940
  )
@@ -1117,40 +943,40 @@ var ProductCreateVariantsSection = ({
1117
943
  }
1118
944
  }
1119
945
  )
1120
- ] }) : /* @__PURE__ */ jsx4(Alert, { children: t("products.create.variants.productVariants.alert") }),
1121
- variants.fields.length > 0 && /* @__PURE__ */ jsx4(InlineTip, { label: t("general.tip"), children: t("products.create.variants.productVariants.tip") })
946
+ ] }) : /* @__PURE__ */ jsx3(Alert, { children: t("products.create.variants.productVariants.alert") }),
947
+ variants.fields.length > 0 && /* @__PURE__ */ jsx3(InlineTip, { label: t("general.tip"), children: t("products.create.variants.productVariants.tip") })
1122
948
  ] }) })
1123
949
  ] })
1124
950
  ] });
1125
951
  };
1126
952
 
1127
953
  // src/routes/products/product-create/components/product-create-details-form/product-create-details-form.tsx
1128
- import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
954
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
1129
955
  var ProductCreateDetailsForm = ({ form }) => {
1130
956
  const { getFormFields } = useExtension();
1131
957
  const fields = getFormFields("product", "create", "general");
1132
- return /* @__PURE__ */ jsx5("div", { className: "flex flex-col items-center p-16", children: /* @__PURE__ */ jsxs5("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: [
1133
- /* @__PURE__ */ jsx5(Header, {}),
1134
- /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-y-6", children: [
1135
- /* @__PURE__ */ jsx5(ProductCreateGeneralSection, { form }),
1136
- /* @__PURE__ */ jsx5(FormExtensionZone, { fields, form }),
1137
- /* @__PURE__ */ jsx5(ProductCreateMediaSection, { form })
958
+ return /* @__PURE__ */ jsx4("div", { className: "flex flex-col items-center p-16", children: /* @__PURE__ */ jsxs4("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: [
959
+ /* @__PURE__ */ jsx4(Header, {}),
960
+ /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-y-6", children: [
961
+ /* @__PURE__ */ jsx4(ProductCreateGeneralSection, { form }),
962
+ /* @__PURE__ */ jsx4(FormExtensionZone, { fields, form }),
963
+ /* @__PURE__ */ jsx4(ProductCreateMediaSection, { form })
1138
964
  ] }),
1139
- /* @__PURE__ */ jsx5(Divider, {}),
1140
- /* @__PURE__ */ jsx5(ProductCreateVariantsSection, { form })
965
+ /* @__PURE__ */ jsx4(Divider, {}),
966
+ /* @__PURE__ */ jsx4(ProductCreateVariantsSection, { form })
1141
967
  ] }) });
1142
968
  };
1143
969
  var Header = () => {
1144
970
  const { t } = useTranslation4();
1145
- return /* @__PURE__ */ jsx5("div", { className: "flex flex-col", children: /* @__PURE__ */ jsx5(Heading2, { children: t("products.create.header") }) });
971
+ return /* @__PURE__ */ jsx4("div", { className: "flex flex-col", children: /* @__PURE__ */ jsx4(Heading2, { children: t("products.create.header") }) });
1146
972
  };
1147
973
 
1148
974
  // src/routes/products/product-create/components/product-create-inventory-kit-form/components/product-create-inventory-kit-section/product-create-inventory-kit-section.tsx
1149
- import { Button as Button2, Heading as Heading3, IconButton as IconButton4, Input as Input3, Label as Label2 } from "@medusajs/ui";
975
+ import { Button, Heading as Heading3, IconButton as IconButton2, Input as Input2, Label as Label2 } from "@medusajs/ui";
1150
976
  import { useFieldArray as useFieldArray3, useWatch as useWatch2 } from "react-hook-form";
1151
- import { XMarkMini as XMarkMini2 } from "@medusajs/icons";
977
+ import { XMarkMini } from "@medusajs/icons";
1152
978
  import { useTranslation as useTranslation5 } from "react-i18next";
1153
- import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
979
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
1154
980
  function InventoryItemRow({
1155
981
  form,
1156
982
  variantIndex,
@@ -1174,13 +1000,13 @@ function InventoryItemRow({
1174
1000
  value: item.id
1175
1001
  }))
1176
1002
  });
1177
- return /* @__PURE__ */ jsxs6(
1003
+ return /* @__PURE__ */ jsxs5(
1178
1004
  "li",
1179
1005
  {
1180
1006
  className: "bg-ui-bg-component shadow-elevation-card-rest grid grid-cols-[1fr_28px] items-center gap-1.5 rounded-xl p-1.5",
1181
1007
  children: [
1182
- /* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-[min-content,1fr] items-center gap-1.5", children: [
1183
- /* @__PURE__ */ jsx6("div", { className: "flex items-center px-2 py-1.5", children: /* @__PURE__ */ jsx6(
1008
+ /* @__PURE__ */ jsxs5("div", { className: "grid grid-cols-[min-content,1fr] items-center gap-1.5", children: [
1009
+ /* @__PURE__ */ jsx5("div", { className: "flex items-center px-2 py-1.5", children: /* @__PURE__ */ jsx5(
1184
1010
  Label2,
1185
1011
  {
1186
1012
  size: "xsmall",
@@ -1190,13 +1016,13 @@ function InventoryItemRow({
1190
1016
  children: t("fields.item")
1191
1017
  }
1192
1018
  ) }),
1193
- /* @__PURE__ */ jsx6(
1019
+ /* @__PURE__ */ jsx5(
1194
1020
  Form.Field,
1195
1021
  {
1196
1022
  control: form.control,
1197
1023
  name: `variants.${variantIndex}.inventory.${inventoryIndex}.inventory_item_id`,
1198
1024
  render: ({ field }) => {
1199
- return /* @__PURE__ */ jsx6(Form.Item, { children: /* @__PURE__ */ jsx6(Form.Control, { children: /* @__PURE__ */ jsx6(
1025
+ return /* @__PURE__ */ jsx5(Form.Item, { children: /* @__PURE__ */ jsx5(Form.Control, { children: /* @__PURE__ */ jsx5(
1200
1026
  Combobox,
1201
1027
  {
1202
1028
  ...field,
@@ -1215,7 +1041,7 @@ function InventoryItemRow({
1215
1041
  }
1216
1042
  }
1217
1043
  ),
1218
- /* @__PURE__ */ jsx6("div", { className: "flex items-center px-2 py-1.5", children: /* @__PURE__ */ jsx6(
1044
+ /* @__PURE__ */ jsx5("div", { className: "flex items-center px-2 py-1.5", children: /* @__PURE__ */ jsx5(
1219
1045
  Label2,
1220
1046
  {
1221
1047
  size: "xsmall",
@@ -1225,15 +1051,15 @@ function InventoryItemRow({
1225
1051
  children: t("fields.quantity")
1226
1052
  }
1227
1053
  ) }),
1228
- /* @__PURE__ */ jsx6(
1054
+ /* @__PURE__ */ jsx5(
1229
1055
  Form.Field,
1230
1056
  {
1231
1057
  control: form.control,
1232
1058
  name: `variants.${variantIndex}.inventory.${inventoryIndex}.required_quantity`,
1233
1059
  render: ({ field: { onChange, value, ...field } }) => {
1234
- return /* @__PURE__ */ jsxs6(Form.Item, { children: [
1235
- /* @__PURE__ */ jsx6(Form.Control, { children: /* @__PURE__ */ jsx6(
1236
- Input3,
1060
+ return /* @__PURE__ */ jsxs5(Form.Item, { children: [
1061
+ /* @__PURE__ */ jsx5(Form.Control, { children: /* @__PURE__ */ jsx5(
1062
+ Input2,
1237
1063
  {
1238
1064
  type: "number",
1239
1065
  className: "bg-ui-bg-field-component",
@@ -1253,21 +1079,21 @@ function InventoryItemRow({
1253
1079
  )
1254
1080
  }
1255
1081
  ) }),
1256
- /* @__PURE__ */ jsx6(Form.ErrorMessage, {})
1082
+ /* @__PURE__ */ jsx5(Form.ErrorMessage, {})
1257
1083
  ] });
1258
1084
  }
1259
1085
  }
1260
1086
  )
1261
1087
  ] }),
1262
- /* @__PURE__ */ jsx6(
1263
- IconButton4,
1088
+ /* @__PURE__ */ jsx5(
1089
+ IconButton2,
1264
1090
  {
1265
1091
  type: "button",
1266
1092
  size: "small",
1267
1093
  variant: "transparent",
1268
1094
  className: "text-ui-fg-muted",
1269
1095
  onClick: onRemove,
1270
- children: /* @__PURE__ */ jsx6(XMarkMini2, {})
1096
+ children: /* @__PURE__ */ jsx5(XMarkMini, {})
1271
1097
  }
1272
1098
  )
1273
1099
  ]
@@ -1290,14 +1116,14 @@ function VariantSection({ form, variant, index }) {
1290
1116
  (i, index2) => index2 != inventoryIndex && i.inventory_item_id === option.value
1291
1117
  );
1292
1118
  };
1293
- return /* @__PURE__ */ jsxs6("div", { className: "grid gap-y-4", children: [
1294
- /* @__PURE__ */ jsxs6("div", { className: "flex items-start justify-between gap-x-4", children: [
1295
- /* @__PURE__ */ jsxs6("div", { className: "flex flex-col", children: [
1296
- /* @__PURE__ */ jsx6(Form.Label, { children: variant.title }),
1297
- /* @__PURE__ */ jsx6(Form.Hint, { children: t("products.create.inventory.label") })
1119
+ return /* @__PURE__ */ jsxs5("div", { className: "grid gap-y-4", children: [
1120
+ /* @__PURE__ */ jsxs5("div", { className: "flex items-start justify-between gap-x-4", children: [
1121
+ /* @__PURE__ */ jsxs5("div", { className: "flex flex-col", children: [
1122
+ /* @__PURE__ */ jsx5(Form.Label, { children: variant.title }),
1123
+ /* @__PURE__ */ jsx5(Form.Hint, { children: t("products.create.inventory.label") })
1298
1124
  ] }),
1299
- /* @__PURE__ */ jsx6(
1300
- Button2,
1125
+ /* @__PURE__ */ jsx5(
1126
+ Button,
1301
1127
  {
1302
1128
  size: "small",
1303
1129
  variant: "secondary",
@@ -1312,7 +1138,7 @@ function VariantSection({ form, variant, index }) {
1312
1138
  }
1313
1139
  )
1314
1140
  ] }),
1315
- inventory.fields.map((inventoryItem, inventoryIndex) => /* @__PURE__ */ jsx6(
1141
+ inventory.fields.map((inventoryItem, inventoryIndex) => /* @__PURE__ */ jsx5(
1316
1142
  InventoryItemRow,
1317
1143
  {
1318
1144
  form,
@@ -1334,9 +1160,9 @@ var ProductCreateInventoryKitSection = ({
1334
1160
  control: form.control,
1335
1161
  name: "variants"
1336
1162
  });
1337
- return /* @__PURE__ */ jsxs6("div", { id: "organize", className: "flex flex-col gap-y-8", children: [
1338
- /* @__PURE__ */ jsx6(Heading3, { children: t("products.create.inventory.heading") }),
1339
- variants.fields.filter((v) => v.inventory_kit).map((variant, variantIndex) => /* @__PURE__ */ jsx6(
1163
+ return /* @__PURE__ */ jsxs5("div", { id: "organize", className: "flex flex-col gap-y-8", children: [
1164
+ /* @__PURE__ */ jsx5(Heading3, { children: t("products.create.inventory.heading") }),
1165
+ variants.fields.filter((v) => v.inventory_kit).map((variant, variantIndex) => /* @__PURE__ */ jsx5(
1340
1166
  VariantSection,
1341
1167
  {
1342
1168
  form,
@@ -1349,18 +1175,18 @@ var ProductCreateInventoryKitSection = ({
1349
1175
  };
1350
1176
 
1351
1177
  // src/routes/products/product-create/components/product-create-inventory-kit-form/product-create-inventory-kit-form.tsx
1352
- import { jsx as jsx7 } from "react/jsx-runtime";
1178
+ import { jsx as jsx6 } from "react/jsx-runtime";
1353
1179
  var ProductCreateInventoryKitForm = ({
1354
1180
  form
1355
1181
  }) => {
1356
- return /* @__PURE__ */ jsx7("div", { className: "flex flex-col items-center p-16", children: /* @__PURE__ */ jsx7("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: /* @__PURE__ */ jsx7(ProductCreateInventoryKitSection, { form }) }) });
1182
+ return /* @__PURE__ */ jsx6("div", { className: "flex flex-col items-center p-16", children: /* @__PURE__ */ jsx6("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: /* @__PURE__ */ jsx6(ProductCreateInventoryKitSection, { form }) }) });
1357
1183
  };
1358
1184
 
1359
1185
  // src/routes/products/product-create/components/product-create-organize-form/components/product-create-organize-section/product-create-details-organize-section.tsx
1360
- import { Button as Button3, Heading as Heading4 } from "@medusajs/ui";
1186
+ import { Button as Button2, Heading as Heading4 } from "@medusajs/ui";
1361
1187
  import { useFieldArray as useFieldArray4 } from "react-hook-form";
1362
1188
  import { Trans, useTranslation as useTranslation6 } from "react-i18next";
1363
- import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
1189
+ import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
1364
1190
  var ProductCreateOrganizationSection = ({
1365
1191
  form
1366
1192
  }) => {
@@ -1405,9 +1231,9 @@ var ProductCreateOrganizationSection = ({
1405
1231
  const handleClearAllSalesChannels = () => {
1406
1232
  replace([]);
1407
1233
  };
1408
- return /* @__PURE__ */ jsxs7("div", { id: "organize", className: "flex flex-col gap-y-8", children: [
1409
- /* @__PURE__ */ jsx8(Heading4, { children: t("products.organization.header") }),
1410
- /* @__PURE__ */ jsx8(
1234
+ return /* @__PURE__ */ jsxs6("div", { id: "organize", className: "flex flex-col gap-y-8", children: [
1235
+ /* @__PURE__ */ jsx7(Heading4, { children: t("products.organization.header") }),
1236
+ /* @__PURE__ */ jsx7(
1411
1237
  SwitchBox,
1412
1238
  {
1413
1239
  control: form.control,
@@ -1417,16 +1243,16 @@ var ProductCreateOrganizationSection = ({
1417
1243
  optional: true
1418
1244
  }
1419
1245
  ),
1420
- /* @__PURE__ */ jsxs7("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
1421
- /* @__PURE__ */ jsx8(
1246
+ /* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
1247
+ /* @__PURE__ */ jsx7(
1422
1248
  Form.Field,
1423
1249
  {
1424
1250
  control: form.control,
1425
1251
  name: "type_id",
1426
1252
  render: ({ field }) => {
1427
- return /* @__PURE__ */ jsxs7(Form.Item, { children: [
1428
- /* @__PURE__ */ jsx8(Form.Label, { optional: true, children: t("products.fields.type.label") }),
1429
- /* @__PURE__ */ jsx8(Form.Control, { children: /* @__PURE__ */ jsx8(
1253
+ return /* @__PURE__ */ jsxs6(Form.Item, { children: [
1254
+ /* @__PURE__ */ jsx7(Form.Label, { optional: true, children: t("products.fields.type.label") }),
1255
+ /* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(
1430
1256
  Combobox,
1431
1257
  {
1432
1258
  ...field,
@@ -1436,20 +1262,20 @@ var ProductCreateOrganizationSection = ({
1436
1262
  fetchNextPage: types.fetchNextPage
1437
1263
  }
1438
1264
  ) }),
1439
- /* @__PURE__ */ jsx8(Form.ErrorMessage, {})
1265
+ /* @__PURE__ */ jsx7(Form.ErrorMessage, {})
1440
1266
  ] });
1441
1267
  }
1442
1268
  }
1443
1269
  ),
1444
- /* @__PURE__ */ jsx8(
1270
+ /* @__PURE__ */ jsx7(
1445
1271
  Form.Field,
1446
1272
  {
1447
1273
  control: form.control,
1448
1274
  name: "collection_id",
1449
1275
  render: ({ field }) => {
1450
- return /* @__PURE__ */ jsxs7(Form.Item, { children: [
1451
- /* @__PURE__ */ jsx8(Form.Label, { optional: true, children: t("products.fields.collection.label") }),
1452
- /* @__PURE__ */ jsx8(Form.Control, { children: /* @__PURE__ */ jsx8(
1276
+ return /* @__PURE__ */ jsxs6(Form.Item, { children: [
1277
+ /* @__PURE__ */ jsx7(Form.Label, { optional: true, children: t("products.fields.collection.label") }),
1278
+ /* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(
1453
1279
  Combobox,
1454
1280
  {
1455
1281
  ...field,
@@ -1459,36 +1285,36 @@ var ProductCreateOrganizationSection = ({
1459
1285
  fetchNextPage: collections.fetchNextPage
1460
1286
  }
1461
1287
  ) }),
1462
- /* @__PURE__ */ jsx8(Form.ErrorMessage, {})
1288
+ /* @__PURE__ */ jsx7(Form.ErrorMessage, {})
1463
1289
  ] });
1464
1290
  }
1465
1291
  }
1466
1292
  )
1467
1293
  ] }),
1468
- /* @__PURE__ */ jsxs7("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
1469
- /* @__PURE__ */ jsx8(
1294
+ /* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
1295
+ /* @__PURE__ */ jsx7(
1470
1296
  Form.Field,
1471
1297
  {
1472
1298
  control: form.control,
1473
1299
  name: "categories",
1474
1300
  render: ({ field }) => {
1475
- return /* @__PURE__ */ jsxs7(Form.Item, { children: [
1476
- /* @__PURE__ */ jsx8(Form.Label, { optional: true, children: t("products.fields.categories.label") }),
1477
- /* @__PURE__ */ jsx8(Form.Control, { children: /* @__PURE__ */ jsx8(CategoryCombobox, { ...field }) }),
1478
- /* @__PURE__ */ jsx8(Form.ErrorMessage, {})
1301
+ return /* @__PURE__ */ jsxs6(Form.Item, { children: [
1302
+ /* @__PURE__ */ jsx7(Form.Label, { optional: true, children: t("products.fields.categories.label") }),
1303
+ /* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(CategoryCombobox, { ...field }) }),
1304
+ /* @__PURE__ */ jsx7(Form.ErrorMessage, {})
1479
1305
  ] });
1480
1306
  }
1481
1307
  }
1482
1308
  ),
1483
- /* @__PURE__ */ jsx8(
1309
+ /* @__PURE__ */ jsx7(
1484
1310
  Form.Field,
1485
1311
  {
1486
1312
  control: form.control,
1487
1313
  name: "tags",
1488
1314
  render: ({ field }) => {
1489
- return /* @__PURE__ */ jsxs7(Form.Item, { children: [
1490
- /* @__PURE__ */ jsx8(Form.Label, { optional: true, children: t("products.fields.tags.label") }),
1491
- /* @__PURE__ */ jsx8(Form.Control, { children: /* @__PURE__ */ jsx8(
1315
+ return /* @__PURE__ */ jsxs6(Form.Item, { children: [
1316
+ /* @__PURE__ */ jsx7(Form.Label, { optional: true, children: t("products.fields.tags.label") }),
1317
+ /* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(
1492
1318
  Combobox,
1493
1319
  {
1494
1320
  ...field,
@@ -1498,25 +1324,25 @@ var ProductCreateOrganizationSection = ({
1498
1324
  fetchNextPage: tags.fetchNextPage
1499
1325
  }
1500
1326
  ) }),
1501
- /* @__PURE__ */ jsx8(Form.ErrorMessage, {})
1327
+ /* @__PURE__ */ jsx7(Form.ErrorMessage, {})
1502
1328
  ] });
1503
1329
  }
1504
1330
  }
1505
1331
  )
1506
1332
  ] }),
1507
- /* @__PURE__ */ jsxs7("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
1508
- /* @__PURE__ */ jsxs7("div", { children: [
1509
- /* @__PURE__ */ jsx8(Form.Label, { optional: true, children: t("products.fields.shipping_profile.label") }),
1510
- /* @__PURE__ */ jsx8(Form.Hint, { children: /* @__PURE__ */ jsx8(Trans, { i18nKey: "products.fields.shipping_profile.hint" }) })
1333
+ /* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
1334
+ /* @__PURE__ */ jsxs6("div", { children: [
1335
+ /* @__PURE__ */ jsx7(Form.Label, { optional: true, children: t("products.fields.shipping_profile.label") }),
1336
+ /* @__PURE__ */ jsx7(Form.Hint, { children: /* @__PURE__ */ jsx7(Trans, { i18nKey: "products.fields.shipping_profile.hint" }) })
1511
1337
  ] }),
1512
- /* @__PURE__ */ jsx8(
1338
+ /* @__PURE__ */ jsx7(
1513
1339
  Form.Field,
1514
1340
  {
1515
1341
  control: form.control,
1516
1342
  name: "shipping_profile_id",
1517
1343
  render: ({ field }) => {
1518
- return /* @__PURE__ */ jsxs7(Form.Item, { children: [
1519
- /* @__PURE__ */ jsx8(Form.Control, { children: /* @__PURE__ */ jsx8(
1344
+ return /* @__PURE__ */ jsxs6(Form.Item, { children: [
1345
+ /* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(
1520
1346
  Combobox,
1521
1347
  {
1522
1348
  ...field,
@@ -1526,33 +1352,33 @@ var ProductCreateOrganizationSection = ({
1526
1352
  fetchNextPage: shippingProfiles.fetchNextPage
1527
1353
  }
1528
1354
  ) }),
1529
- /* @__PURE__ */ jsx8(Form.ErrorMessage, {})
1355
+ /* @__PURE__ */ jsx7(Form.ErrorMessage, {})
1530
1356
  ] });
1531
1357
  }
1532
1358
  }
1533
1359
  )
1534
1360
  ] }),
1535
- /* @__PURE__ */ jsx8("div", { className: "grid grid-cols-1 gap-y-4", children: /* @__PURE__ */ jsx8(
1361
+ /* @__PURE__ */ jsx7("div", { className: "grid grid-cols-1 gap-y-4", children: /* @__PURE__ */ jsx7(
1536
1362
  Form.Field,
1537
1363
  {
1538
1364
  control: form.control,
1539
1365
  name: "sales_channels",
1540
1366
  render: () => {
1541
- return /* @__PURE__ */ jsxs7(Form.Item, { children: [
1542
- /* @__PURE__ */ jsxs7("div", { className: "flex items-start justify-between gap-x-4", children: [
1543
- /* @__PURE__ */ jsxs7("div", { children: [
1544
- /* @__PURE__ */ jsx8(Form.Label, { optional: true, children: t("products.fields.sales_channels.label") }),
1545
- /* @__PURE__ */ jsx8(Form.Hint, { children: /* @__PURE__ */ jsx8(Trans, { i18nKey: "products.fields.sales_channels.hint" }) })
1367
+ return /* @__PURE__ */ jsxs6(Form.Item, { children: [
1368
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-start justify-between gap-x-4", children: [
1369
+ /* @__PURE__ */ jsxs6("div", { children: [
1370
+ /* @__PURE__ */ jsx7(Form.Label, { optional: true, children: t("products.fields.sales_channels.label") }),
1371
+ /* @__PURE__ */ jsx7(Form.Hint, { children: /* @__PURE__ */ jsx7(Trans, { i18nKey: "products.fields.sales_channels.hint" }) })
1546
1372
  ] }),
1547
- /* @__PURE__ */ jsx8(StackedFocusModal.Trigger, { asChild: true, children: /* @__PURE__ */ jsx8(Button3, { size: "small", variant: "secondary", type: "button", children: t("actions.add") }) })
1373
+ /* @__PURE__ */ jsx7(StackedFocusModal.Trigger, { asChild: true, children: /* @__PURE__ */ jsx7(Button2, { size: "small", variant: "secondary", type: "button", children: t("actions.add") }) })
1548
1374
  ] }),
1549
- /* @__PURE__ */ jsx8(Form.Control, { className: "mt-0", children: fields.length > 0 && /* @__PURE__ */ jsx8(
1375
+ /* @__PURE__ */ jsx7(Form.Control, { className: "mt-0", children: fields.length > 0 && /* @__PURE__ */ jsx7(
1550
1376
  ChipGroup,
1551
1377
  {
1552
1378
  onClearAll: handleClearAllSalesChannels,
1553
1379
  onRemove: remove,
1554
1380
  className: "py-4",
1555
- children: fields.map((field, index) => /* @__PURE__ */ jsx8(ChipGroup.Chip, { index, children: field.name }, field.key))
1381
+ children: fields.map((field, index) => /* @__PURE__ */ jsx7(ChipGroup.Chip, { index, children: field.name }, field.key))
1556
1382
  }
1557
1383
  ) })
1558
1384
  ] });
@@ -1564,7 +1390,7 @@ var ProductCreateOrganizationSection = ({
1564
1390
 
1565
1391
  // src/routes/products/product-create/components/product-create-organize-form/components/product-create-sales-channel-stacked-modal/product-create-sales-channel-drawer.tsx
1566
1392
  import {
1567
- Button as Button4,
1393
+ Button as Button3,
1568
1394
  createDataTableColumnHelper
1569
1395
  } from "@medusajs/ui";
1570
1396
  import { useEffect, useMemo as useMemo2, useState as useState3 } from "react";
@@ -1575,7 +1401,7 @@ import { keepPreviousData } from "@tanstack/react-query";
1575
1401
  var SC_STACKED_MODAL_ID = "sc";
1576
1402
 
1577
1403
  // src/routes/products/product-create/components/product-create-organize-form/components/product-create-sales-channel-stacked-modal/product-create-sales-channel-drawer.tsx
1578
- import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
1404
+ import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
1579
1405
  var PAGE_SIZE = 20;
1580
1406
  var ProductCreateSalesChannelStackedModal = ({
1581
1407
  form
@@ -1649,9 +1475,9 @@ var ProductCreateSalesChannelStackedModal = ({
1649
1475
  if (isError) {
1650
1476
  throw error;
1651
1477
  }
1652
- return /* @__PURE__ */ jsxs8(StackedFocusModal.Content, { className: "flex flex-col overflow-hidden", children: [
1653
- /* @__PURE__ */ jsx9(StackedFocusModal.Header, {}),
1654
- /* @__PURE__ */ jsx9(StackedFocusModal.Body, { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsx9(
1478
+ return /* @__PURE__ */ jsxs7(StackedFocusModal.Content, { className: "flex flex-col overflow-hidden", children: [
1479
+ /* @__PURE__ */ jsx8(StackedFocusModal.Header, {}),
1480
+ /* @__PURE__ */ jsx8(StackedFocusModal.Body, { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsx8(
1655
1481
  DataTable,
1656
1482
  {
1657
1483
  data: sales_channels,
@@ -1670,9 +1496,9 @@ var ProductCreateSalesChannelStackedModal = ({
1670
1496
  prefix: SC_STACKED_MODAL_ID
1671
1497
  }
1672
1498
  ) }),
1673
- /* @__PURE__ */ jsx9(StackedFocusModal.Footer, { children: /* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-end gap-x-2", children: [
1674
- /* @__PURE__ */ jsx9(StackedFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx9(Button4, { size: "small", variant: "secondary", type: "button", children: t("actions.cancel") }) }),
1675
- /* @__PURE__ */ jsx9(Button4, { size: "small", onClick: handleAdd, type: "button", children: t("actions.save") })
1499
+ /* @__PURE__ */ jsx8(StackedFocusModal.Footer, { children: /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-end gap-x-2", children: [
1500
+ /* @__PURE__ */ jsx8(StackedFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx8(Button3, { size: "small", variant: "secondary", type: "button", children: t("actions.cancel") }) }),
1501
+ /* @__PURE__ */ jsx8(Button3, { size: "small", onClick: handleAdd, type: "button", children: t("actions.save") })
1676
1502
  ] }) })
1677
1503
  ] });
1678
1504
  };
@@ -1683,16 +1509,16 @@ var useColumns = () => {
1683
1509
  };
1684
1510
 
1685
1511
  // src/routes/products/product-create/components/product-create-organize-form/product-create-organize-form.tsx
1686
- import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
1512
+ import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
1687
1513
  var ProductCreateOrganizeForm = ({ form }) => {
1688
1514
  const { getFormFields } = useExtension();
1689
1515
  const fields = getFormFields("product", "create", "organize");
1690
- return /* @__PURE__ */ jsxs9(StackedFocusModal, { id: SC_STACKED_MODAL_ID, children: [
1691
- /* @__PURE__ */ jsx10("div", { className: "flex flex-col items-center p-16", children: /* @__PURE__ */ jsxs9("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: [
1692
- /* @__PURE__ */ jsx10(ProductCreateOrganizationSection, { form }),
1693
- /* @__PURE__ */ jsx10(FormExtensionZone, { fields, form })
1516
+ return /* @__PURE__ */ jsxs8(StackedFocusModal, { id: SC_STACKED_MODAL_ID, children: [
1517
+ /* @__PURE__ */ jsx9("div", { className: "flex flex-col items-center p-16", children: /* @__PURE__ */ jsxs8("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: [
1518
+ /* @__PURE__ */ jsx9(ProductCreateOrganizationSection, { form }),
1519
+ /* @__PURE__ */ jsx9(FormExtensionZone, { fields, form })
1694
1520
  ] }) }),
1695
- /* @__PURE__ */ jsx10(ProductCreateSalesChannelStackedModal, { form })
1521
+ /* @__PURE__ */ jsx9(ProductCreateSalesChannelStackedModal, { form })
1696
1522
  ] });
1697
1523
  };
1698
1524
 
@@ -1700,7 +1526,7 @@ var ProductCreateOrganizeForm = ({ form }) => {
1700
1526
  import { useMemo as useMemo3 } from "react";
1701
1527
  import { useWatch as useWatch3 } from "react-hook-form";
1702
1528
  import { useTranslation as useTranslation8 } from "react-i18next";
1703
- import { jsx as jsx11 } from "react/jsx-runtime";
1529
+ import { jsx as jsx10 } from "react/jsx-runtime";
1704
1530
  var ProductCreateVariantsForm = ({
1705
1531
  form,
1706
1532
  regions,
@@ -1737,7 +1563,7 @@ var ProductCreateVariantsForm = ({
1737
1563
  });
1738
1564
  return ret;
1739
1565
  }, [variants]);
1740
- return /* @__PURE__ */ jsx11("div", { className: "flex size-full flex-col divide-y overflow-hidden", children: /* @__PURE__ */ jsx11(
1566
+ return /* @__PURE__ */ jsx10("div", { className: "flex size-full flex-col divide-y overflow-hidden", children: /* @__PURE__ */ jsx10(
1741
1567
  DataGrid,
1742
1568
  {
1743
1569
  columns,
@@ -1759,9 +1585,9 @@ var useColumns2 = ({
1759
1585
  () => [
1760
1586
  columnHelper2.column({
1761
1587
  id: "options",
1762
- header: () => /* @__PURE__ */ jsx11("div", { className: "flex size-full items-center overflow-hidden", children: /* @__PURE__ */ jsx11("span", { className: "truncate", children: options.map((o) => o.title).join(" / ") }) }),
1588
+ header: () => /* @__PURE__ */ jsx10("div", { className: "flex size-full items-center overflow-hidden", children: /* @__PURE__ */ jsx10("span", { className: "truncate", children: options.map((o) => o.title).join(" / ") }) }),
1763
1589
  cell: (context) => {
1764
- return /* @__PURE__ */ jsx11(DataGrid.ReadonlyCell, { context, children: options.map((o) => context.row.original.options[o.title]).join(" / ") });
1590
+ return /* @__PURE__ */ jsx10(DataGrid.ReadonlyCell, { context, children: options.map((o) => context.row.original.options[o.title]).join(" / ") });
1765
1591
  },
1766
1592
  disableHiding: true
1767
1593
  }),
@@ -1772,7 +1598,7 @@ var useColumns2 = ({
1772
1598
  field: (context) => `variants.${context.row.original.originalIndex}.title`,
1773
1599
  type: "text",
1774
1600
  cell: (context) => {
1775
- return /* @__PURE__ */ jsx11(DataGrid.TextCell, { context });
1601
+ return /* @__PURE__ */ jsx10(DataGrid.TextCell, { context });
1776
1602
  }
1777
1603
  }),
1778
1604
  columnHelper2.column({
@@ -1782,7 +1608,7 @@ var useColumns2 = ({
1782
1608
  field: (context) => `variants.${context.row.original.originalIndex}.sku`,
1783
1609
  type: "text",
1784
1610
  cell: (context) => {
1785
- return /* @__PURE__ */ jsx11(DataGrid.TextCell, { context });
1611
+ return /* @__PURE__ */ jsx10(DataGrid.TextCell, { context });
1786
1612
  }
1787
1613
  }),
1788
1614
  columnHelper2.column({
@@ -1792,7 +1618,7 @@ var useColumns2 = ({
1792
1618
  field: (context) => `variants.${context.row.original.originalIndex}.manage_inventory`,
1793
1619
  type: "boolean",
1794
1620
  cell: (context) => {
1795
- return /* @__PURE__ */ jsx11(DataGrid.BooleanCell, { context });
1621
+ return /* @__PURE__ */ jsx10(DataGrid.BooleanCell, { context });
1796
1622
  }
1797
1623
  }),
1798
1624
  columnHelper2.column({
@@ -1802,7 +1628,7 @@ var useColumns2 = ({
1802
1628
  field: (context) => `variants.${context.row.original.originalIndex}.allow_backorder`,
1803
1629
  type: "boolean",
1804
1630
  cell: (context) => {
1805
- return /* @__PURE__ */ jsx11(DataGrid.BooleanCell, { context });
1631
+ return /* @__PURE__ */ jsx10(DataGrid.BooleanCell, { context });
1806
1632
  }
1807
1633
  }),
1808
1634
  columnHelper2.column({
@@ -1812,7 +1638,7 @@ var useColumns2 = ({
1812
1638
  field: (context) => `variants.${context.row.original.originalIndex}.inventory_kit`,
1813
1639
  type: "boolean",
1814
1640
  cell: (context) => {
1815
- return /* @__PURE__ */ jsx11(
1641
+ return /* @__PURE__ */ jsx10(
1816
1642
  DataGrid.BooleanCell,
1817
1643
  {
1818
1644
  context,
@@ -1839,7 +1665,7 @@ var useColumns2 = ({
1839
1665
  };
1840
1666
 
1841
1667
  // src/routes/products/product-create/components/product-create-form/product-create-form.tsx
1842
- import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
1668
+ import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
1843
1669
  var SAVE_DRAFT_BUTTON = "save-draft-button";
1844
1670
  var ProductCreateForm = ({
1845
1671
  defaultChannel,
@@ -1872,13 +1698,10 @@ var ProductCreateForm = ({
1872
1698
  if (!regions?.length) {
1873
1699
  return {};
1874
1700
  }
1875
- return regions.reduce(
1876
- (acc, reg) => {
1877
- acc[reg.id] = reg.currency_code;
1878
- return acc;
1879
- },
1880
- {}
1881
- );
1701
+ return regions.reduce((acc, reg) => {
1702
+ acc[reg.id] = reg.currency_code;
1703
+ return acc;
1704
+ }, {});
1882
1705
  }, [regions]);
1883
1706
  const watchedVariants = useWatch4({
1884
1707
  control: form.control,
@@ -1980,7 +1803,7 @@ var ProductCreateForm = ({
1980
1803
  }
1981
1804
  setTabState({ ...currentState });
1982
1805
  }, [tab]);
1983
- return /* @__PURE__ */ jsx12(RouteFocusModal.Form, { form, children: /* @__PURE__ */ jsxs10(
1806
+ return /* @__PURE__ */ jsx11(RouteFocusModal.Form, { form, children: /* @__PURE__ */ jsxs9(
1984
1807
  KeyboundForm,
1985
1808
  {
1986
1809
  onKeyDown: (e) => {
@@ -2003,7 +1826,7 @@ var ProductCreateForm = ({
2003
1826
  onSubmit: handleSubmit,
2004
1827
  className: "flex h-full flex-col",
2005
1828
  children: [
2006
- /* @__PURE__ */ jsxs10(
1829
+ /* @__PURE__ */ jsxs9(
2007
1830
  ProgressTabs,
2008
1831
  {
2009
1832
  dir: direction,
@@ -2017,8 +1840,8 @@ var ProductCreateForm = ({
2017
1840
  },
2018
1841
  className: "flex h-full flex-col overflow-hidden",
2019
1842
  children: [
2020
- /* @__PURE__ */ jsx12(RouteFocusModal.Header, { children: /* @__PURE__ */ jsx12("div", { className: "-my-2 w-full border-l", children: /* @__PURE__ */ jsxs10(ProgressTabs.List, { className: "justify-start-start flex w-full items-center", children: [
2021
- /* @__PURE__ */ jsx12(
1843
+ /* @__PURE__ */ jsx11(RouteFocusModal.Header, { children: /* @__PURE__ */ jsx11("div", { className: "-my-2 w-full border-l", children: /* @__PURE__ */ jsxs9(ProgressTabs.List, { className: "justify-start-start flex w-full items-center", children: [
1844
+ /* @__PURE__ */ jsx11(
2022
1845
  ProgressTabs.Trigger,
2023
1846
  {
2024
1847
  status: tabState["details" /* DETAILS */],
@@ -2027,7 +1850,7 @@ var ProductCreateForm = ({
2027
1850
  children: t("products.create.tabs.details")
2028
1851
  }
2029
1852
  ),
2030
- /* @__PURE__ */ jsx12(
1853
+ /* @__PURE__ */ jsx11(
2031
1854
  ProgressTabs.Trigger,
2032
1855
  {
2033
1856
  status: tabState["organize" /* ORGANIZE */],
@@ -2036,7 +1859,7 @@ var ProductCreateForm = ({
2036
1859
  children: t("products.create.tabs.organize")
2037
1860
  }
2038
1861
  ),
2039
- /* @__PURE__ */ jsx12(
1862
+ /* @__PURE__ */ jsx11(
2040
1863
  ProgressTabs.Trigger,
2041
1864
  {
2042
1865
  status: tabState["variants" /* VARIANTS */],
@@ -2045,7 +1868,7 @@ var ProductCreateForm = ({
2045
1868
  children: t("products.create.tabs.variants")
2046
1869
  }
2047
1870
  ),
2048
- showInventoryTab && /* @__PURE__ */ jsx12(
1871
+ showInventoryTab && /* @__PURE__ */ jsx11(
2049
1872
  ProgressTabs.Trigger,
2050
1873
  {
2051
1874
  status: tabState["inventory" /* INVENTORY */],
@@ -2055,29 +1878,29 @@ var ProductCreateForm = ({
2055
1878
  }
2056
1879
  )
2057
1880
  ] }) }) }),
2058
- /* @__PURE__ */ jsxs10(RouteFocusModal.Body, { className: "size-full overflow-hidden", children: [
2059
- /* @__PURE__ */ jsx12(
1881
+ /* @__PURE__ */ jsxs9(RouteFocusModal.Body, { className: "size-full overflow-hidden", children: [
1882
+ /* @__PURE__ */ jsx11(
2060
1883
  ProgressTabs.Content,
2061
1884
  {
2062
1885
  className: "size-full overflow-y-auto",
2063
1886
  value: "details" /* DETAILS */,
2064
- children: /* @__PURE__ */ jsx12(ProductCreateDetailsForm, { form })
1887
+ children: /* @__PURE__ */ jsx11(ProductCreateDetailsForm, { form })
2065
1888
  }
2066
1889
  ),
2067
- /* @__PURE__ */ jsx12(
1890
+ /* @__PURE__ */ jsx11(
2068
1891
  ProgressTabs.Content,
2069
1892
  {
2070
1893
  className: "size-full overflow-y-auto",
2071
1894
  value: "organize" /* ORGANIZE */,
2072
- children: /* @__PURE__ */ jsx12(ProductCreateOrganizeForm, { form })
1895
+ children: /* @__PURE__ */ jsx11(ProductCreateOrganizeForm, { form })
2073
1896
  }
2074
1897
  ),
2075
- /* @__PURE__ */ jsx12(
1898
+ /* @__PURE__ */ jsx11(
2076
1899
  ProgressTabs.Content,
2077
1900
  {
2078
1901
  className: "size-full overflow-y-auto",
2079
1902
  value: "variants" /* VARIANTS */,
2080
- children: /* @__PURE__ */ jsx12(
1903
+ children: /* @__PURE__ */ jsx11(
2081
1904
  ProductCreateVariantsForm,
2082
1905
  {
2083
1906
  form,
@@ -2088,22 +1911,22 @@ var ProductCreateForm = ({
2088
1911
  )
2089
1912
  }
2090
1913
  ),
2091
- showInventoryTab && /* @__PURE__ */ jsx12(
1914
+ showInventoryTab && /* @__PURE__ */ jsx11(
2092
1915
  ProgressTabs.Content,
2093
1916
  {
2094
1917
  className: "size-full overflow-y-auto",
2095
1918
  value: "inventory" /* INVENTORY */,
2096
- children: /* @__PURE__ */ jsx12(ProductCreateInventoryKitForm, { form })
1919
+ children: /* @__PURE__ */ jsx11(ProductCreateInventoryKitForm, { form })
2097
1920
  }
2098
1921
  )
2099
1922
  ] })
2100
1923
  ]
2101
1924
  }
2102
1925
  ),
2103
- /* @__PURE__ */ jsx12(RouteFocusModal.Footer, { children: /* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-end gap-x-2", children: [
2104
- /* @__PURE__ */ jsx12(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx12(Button5, { variant: "secondary", size: "small", children: t("actions.cancel") }) }),
2105
- /* @__PURE__ */ jsx12(
2106
- Button5,
1926
+ /* @__PURE__ */ jsx11(RouteFocusModal.Footer, { children: /* @__PURE__ */ jsxs9("div", { className: "flex items-center justify-end gap-x-2", children: [
1927
+ /* @__PURE__ */ jsx11(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx11(Button4, { variant: "secondary", size: "small", children: t("actions.cancel") }) }),
1928
+ /* @__PURE__ */ jsx11(
1929
+ Button4,
2107
1930
  {
2108
1931
  "data-name": SAVE_DRAFT_BUTTON,
2109
1932
  size: "small",
@@ -2113,7 +1936,7 @@ var ProductCreateForm = ({
2113
1936
  children: t("actions.saveAsDraft")
2114
1937
  }
2115
1938
  ),
2116
- /* @__PURE__ */ jsx12(
1939
+ /* @__PURE__ */ jsx11(
2117
1940
  PrimaryButton,
2118
1941
  {
2119
1942
  tab,
@@ -2135,8 +1958,8 @@ var PrimaryButton = ({
2135
1958
  }) => {
2136
1959
  const { t } = useTranslation9();
2137
1960
  if (tab === "variants" /* VARIANTS */ && !showInventoryTab || tab === "inventory" /* INVENTORY */ && showInventoryTab) {
2138
- return /* @__PURE__ */ jsx12(
2139
- Button5,
1961
+ return /* @__PURE__ */ jsx11(
1962
+ Button4,
2140
1963
  {
2141
1964
  "data-name": "publish-button",
2142
1965
  type: "submit",
@@ -2148,8 +1971,8 @@ var PrimaryButton = ({
2148
1971
  "submit-button"
2149
1972
  );
2150
1973
  }
2151
- return /* @__PURE__ */ jsx12(
2152
- Button5,
1974
+ return /* @__PURE__ */ jsx11(
1975
+ Button4,
2153
1976
  {
2154
1977
  type: "button",
2155
1978
  variant: "primary",
@@ -2162,7 +1985,7 @@ var PrimaryButton = ({
2162
1985
  };
2163
1986
 
2164
1987
  // src/routes/products/product-create/product-create.tsx
2165
- import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
1988
+ import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
2166
1989
  var ProductCreate = () => {
2167
1990
  const { t } = useTranslation10();
2168
1991
  const {
@@ -2208,10 +2031,10 @@ var ProductCreate = () => {
2208
2031
  if (isPricePreferencesError) {
2209
2032
  throw pricePreferencesError;
2210
2033
  }
2211
- return /* @__PURE__ */ jsxs11(RouteFocusModal, { children: [
2212
- /* @__PURE__ */ jsx13(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx13("span", { className: "sr-only", children: t("products.create.title") }) }),
2213
- /* @__PURE__ */ jsx13(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx13("span", { className: "sr-only", children: t("products.create.description") }) }),
2214
- ready && /* @__PURE__ */ jsx13(
2034
+ return /* @__PURE__ */ jsxs10(RouteFocusModal, { children: [
2035
+ /* @__PURE__ */ jsx12(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx12("span", { className: "sr-only", children: t("products.create.title") }) }),
2036
+ /* @__PURE__ */ jsx12(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx12("span", { className: "sr-only", children: t("products.create.description") }) }),
2037
+ ready && /* @__PURE__ */ jsx12(
2215
2038
  ProductCreateForm,
2216
2039
  {
2217
2040
  defaultChannel: sales_channel,