@mercurjs/vendor 2.1.2-canary.5 → 2.1.2

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 (119) hide show
  1. package/dist/{[id]-5M6VHH3W.js → [id]-3G5G7ZFV.js} +3 -3
  2. package/dist/{[id]-EGXWMHVQ.js → [id]-4VCL3MMM.js} +4 -4
  3. package/dist/{[id]-CLZ7BUYL.js → [id]-6PXEWRG7.js} +3 -3
  4. package/dist/{[id]-UO5NDM4O.js → [id]-7RUAH3TI.js} +1 -1
  5. package/dist/{[id]-I5ES5RW7.js → [id]-B3LHVQM5.js} +3 -3
  6. package/dist/{[id]-STUTFCFY.js → [id]-BYP37PU4.js} +31 -13
  7. package/dist/{[id]-MZU34PWO.js → [id]-H3C3ZSC6.js} +4 -4
  8. package/dist/{[id]-HD5OSKLX.js → [id]-INOFZHL7.js} +22 -19
  9. package/dist/{[id]-RHMPOA6V.js → [id]-PDGHF5J2.js} +5 -5
  10. package/dist/{[id]-QSE3P3LI.js → [id]-T2ROPEGY.js} +1 -1
  11. package/dist/{[id]-ZD26ACGU.js → [id]-TO6KT3ZE.js} +4 -4
  12. package/dist/{[id]-DZFTYO7U.js → [id]-UTKO3VG4.js} +3 -3
  13. package/dist/{[id]-5VUGXK2D.js → [id]-X4DDKOMQ.js} +4 -4
  14. package/dist/{[id]-XRGNT7CY.js → [id]-Y7GAMNC5.js} +1 -1
  15. package/dist/{[location_id]-7ZUB2TTU.js → [location_id]-D55RQOXT.js} +1 -1
  16. package/dist/{[province_id]-XGKNI5CN.js → [province_id]-OFH2ZOFQ.js} +3 -3
  17. package/dist/{add-O5M7AHMZ.js → add-C6OX5C54.js} +6 -6
  18. package/dist/{add-AYU5KCKP.js → add-KRAGFFBJ.js} +2 -2
  19. package/dist/{add-customer-groups-TJVGXKOA.js → add-customer-groups-PJRJUWS2.js} +2 -2
  20. package/dist/{add-products-NZ7TOIER.js → add-products-INOLNPO6.js} +3 -3
  21. package/dist/{add-promotions-FBRIMPCD.js → add-promotions-AHDOP52Q.js} +2 -2
  22. package/dist/{allocate-items-HUPFVTUR.js → allocate-items-SUCUZU4D.js} +7 -3
  23. package/dist/{areas-JO6L3M7Y.js → areas-UUMZDXLX.js} +3 -3
  24. package/dist/{bulk-edit-S7UU3C3C.js → bulk-edit-3SMBLIOA.js} +1 -1
  25. package/dist/{campaigns-SF2YDBID.js → campaigns-HS6MIO7X.js} +4 -4
  26. package/dist/{categories-IKMG6JX7.js → categories-PKWR3FM3.js} +4 -4
  27. package/dist/{chunk-AW4WN2EK.js → chunk-2RHAI7WK.js} +2 -2
  28. package/dist/{chunk-S2Q7PO7I.js → chunk-4KX6CBJ4.js} +1 -0
  29. package/dist/{chunk-DBTM52PI.js → chunk-4URLUCTD.js} +2 -2
  30. package/dist/{chunk-AIRJ4WZG.js → chunk-5M3SL4UZ.js} +4 -5
  31. package/dist/{chunk-5BONGICL.js → chunk-5UD4P6YL.js} +1 -1
  32. package/dist/{chunk-2SLAVXFY.js → chunk-6SBMVLJ2.js} +2 -2
  33. package/dist/{chunk-GWD2S44A.js → chunk-7Q5SDEK7.js} +3 -3
  34. package/dist/{chunk-QXUKJDZB.js → chunk-AIF2KTEE.js} +15 -12
  35. package/dist/{chunk-RM5RSDYP.js → chunk-CAS74NLJ.js} +4 -2
  36. package/dist/{chunk-3U63R3MT.js → chunk-CNLP35S7.js} +0 -2
  37. package/dist/{chunk-2UBZMAHM.js → chunk-CYTNBXWF.js} +2 -2
  38. package/dist/{chunk-DRLJXEDA.js → chunk-DKQ4XMSN.js} +2 -2
  39. package/dist/{chunk-A4LYFHPW.js → chunk-HGQTL7NX.js} +2 -2
  40. package/dist/{chunk-MXDS2AT4.js → chunk-I2IKYOZX.js} +3 -3
  41. package/dist/{chunk-KY5JBVSS.js → chunk-ITI54CII.js} +1 -1
  42. package/dist/{chunk-GL6V5Z6U.js → chunk-J6BRLL3F.js} +2 -2
  43. package/dist/{chunk-FEUCCLKR.js → chunk-JQP7MOFH.js} +2 -2
  44. package/dist/chunk-LQYMBSRQ.js +66 -0
  45. package/dist/{chunk-RXHRAJX6.js → chunk-OXXL4WQU.js} +1 -1
  46. package/dist/{chunk-DRAZNW7J.js → chunk-P3ZTO6T2.js} +2 -2
  47. package/dist/{chunk-3BZBEC3Y.js → chunk-PDQSPKG5.js} +6 -5
  48. package/dist/{chunk-3DXMZA7M.js → chunk-PEKANQ3T.js} +2 -2
  49. package/dist/{chunk-TZTKHOEK.js → chunk-PFU6FSXY.js} +3 -3
  50. package/dist/{chunk-5LKZCG77.js → chunk-PPLC4IKI.js} +6 -15
  51. package/dist/{chunk-SGT6QYWH.js → chunk-PTW7JNAP.js} +1 -1
  52. package/dist/{chunk-I5K5USJM.js → chunk-QJEOPT2P.js} +1 -1
  53. package/dist/{chunk-EFIF2GCZ.js → chunk-QX45GVAL.js} +10 -4
  54. package/dist/{chunk-W4727YRF.js → chunk-STR3NGWE.js} +39 -32
  55. package/dist/{chunk-M2RIKNDT.js → chunk-VQ5EKDA3.js} +2 -2
  56. package/dist/{chunk-RLETOWCM.js → chunk-WITQNQXN.js} +2 -2
  57. package/dist/{chunk-WQX4ASK4.js → chunk-WNVEMFIK.js} +2 -2
  58. package/dist/{chunk-FQTYHU6G.js → chunk-X4FLOQ45.js} +2 -2
  59. package/dist/{chunk-W3TUVTRK.js → chunk-Y2QI7KWS.js} +9 -8
  60. package/dist/chunk-YGRTRAWX.js +163 -0
  61. package/dist/{chunk-LYUCDASZ.js → chunk-YN3FGNJM.js} +11 -4
  62. package/dist/{collections-UJ4B6SLM.js → collections-DJZI2RM2.js} +6 -6
  63. package/dist/{configuration-O5GDANA7.js → configuration-GN3TO77H.js} +4 -25
  64. package/dist/{create-W7DMQS3H.js → create-3DOO3RNH.js} +8 -4
  65. package/dist/{create-HDINR4VV.js → create-3EK5CNNX.js} +5 -5
  66. package/dist/{create-P7DGM4QT.js → create-3ZVXEPX5.js} +11 -26
  67. package/dist/{create-WT6EYIQD.js → create-G4T2PAJH.js} +7 -2
  68. package/dist/{create-6CQ3HRIK.js → create-HKJVSFB7.js} +1 -1
  69. package/dist/{create-Q6ITSYJM.js → create-I7HV3RM6.js} +1 -1
  70. package/dist/{create-IOUKWPE4.js → create-OCFPLNNY.js} +3 -3
  71. package/dist/{create-6LLSQO2D.js → create-OGLPDVOI.js} +11 -3
  72. package/dist/{create-B25YUE35.js → create-YO55Z3YD.js} +8 -8
  73. package/dist/{customers-OXAD52MC.js → customers-6ZLE65UX.js} +4 -4
  74. package/dist/{edit-G5BAEVBL.js → edit-2KRJIPRK.js} +3 -3
  75. package/dist/{edit-A2TSQ7UD.js → edit-B75KK5ZX.js} +5 -5
  76. package/dist/{edit-PD56B3YH.js → edit-IR6V2IDN.js} +3 -3
  77. package/dist/{edit-PGXUW4QC.js → edit-QBISX7D3.js} +29 -23
  78. package/dist/{edit-MU726DI3.js → edit-VO5XLIEL.js} +1 -1
  79. package/dist/{edit-4RBKLEW5.js → edit-ZSOI56BQ.js} +1 -1
  80. package/dist/{edit-stocks-and-prices-ZXBXENLJ.js → edit-stocks-and-prices-MHHQFWFA.js} +3 -3
  81. package/dist/{fulfillment-R7LRV54N.js → fulfillment-DCS67LTK.js} +14 -2
  82. package/dist/{fulfillment-providers-2YQGSI7R.js → fulfillment-providers-GM5PO6N3.js} +7 -9
  83. package/dist/index.js +100 -100
  84. package/dist/{inventory-W6S2NIBI.js → inventory-OPZ2FSEE.js} +4 -4
  85. package/dist/{invite-TVMB7OZZ.js → invite-764K3TJS.js} +2 -2
  86. package/dist/{locations-7SQJ3O2F.js → locations-ZVPTQCQY.js} +2 -2
  87. package/dist/{manage-locations-R4T72DTA.js → manage-locations-YUKEFCBJ.js} +32 -29
  88. package/dist/{media-T5CVLOQY.js → media-4KYFHB5V.js} +2 -2
  89. package/dist/{onboarding-4HGCO3EK.js → onboarding-WXZHW62K.js} +3 -18
  90. package/dist/{orders-SSLTNL27.js → orders-LWJ472VM.js} +6 -6
  91. package/dist/{organization-QCSXE52A.js → organization-LPYQRTQC.js} +1 -1
  92. package/dist/{organize-5W5KNBM2.js → organize-OVKJ3HZO.js} +1 -1
  93. package/dist/{organize-U2LVYSOD.js → organize-RFOMQCBG.js} +1 -1
  94. package/dist/pages/index.js +27 -27
  95. package/dist/{payouts-MHAHAAFV.js → payouts-TR7K5I37.js} +4 -4
  96. package/dist/{price-lists-JX22K5EO.js → price-lists-S2WNELFZ.js} +4 -4
  97. package/dist/{prices-V25NS7PW.js → prices-3OXV5RGY.js} +3 -3
  98. package/dist/{pricing-WFBOYUSG.js → pricing-UF27DAXA.js} +2 -2
  99. package/dist/{product-tags-3UAZGIBS.js → product-tags-2CKH2M6D.js} +6 -6
  100. package/dist/{product-types-MBLFYJOA.js → product-types-FX43JEO2.js} +4 -4
  101. package/dist/{product-variant-detail-NQRHFOHY.js → product-variant-detail-WV4KXVXR.js} +4 -4
  102. package/dist/{products-SD7IIG4V.js → products-2LHGS7X3.js} +13 -13
  103. package/dist/{products-ZQY7KYGJ.js → products-H5EMRJYS.js} +3 -3
  104. package/dist/{profile-3DVJYKC3.js → profile-PB27WIRW.js} +1 -1
  105. package/dist/{promotions-Y3NDK3BZ.js → promotions-5EYPGHJP.js} +4 -4
  106. package/dist/{return-reasons-EMJMFU2L.js → return-reasons-LOKYRGMI.js} +3 -3
  107. package/dist/{sales-channels-2OVI6RTV.js → sales-channels-7R2IY3KG.js} +1 -1
  108. package/dist/{sales-channels-BKOYQXVC.js → sales-channels-Y4LRP7JC.js} +1 -1
  109. package/dist/{settings-XS2GTIVD.js → settings-2XDLFYMS.js} +9 -9
  110. package/dist/{shipping-profile-JJBIVZPM.js → shipping-profile-R3NABPQF.js} +1 -1
  111. package/dist/{shipping-profiles-UNNPBX5T.js → shipping-profiles-QVKNFLCW.js} +4 -4
  112. package/dist/{stock-JQG3Y67T.js → stock-5RXNUPUT.js} +1 -1
  113. package/dist/{stock-Z3CVQETI.js → stock-GPC3BCL6.js} +1 -1
  114. package/dist/{store-BGZ7YFQ5.js → store-DE2RGX7T.js} +37 -31
  115. package/dist/{tax-regions-FPMGLITT.js → tax-regions-UD6P5FVC.js} +1 -1
  116. package/dist/{team-UJ4ZSZPU.js → team-JXKAVRPU.js} +3 -3
  117. package/package.json +2 -2
  118. package/dist/chunk-4DYUQ3G5.js +0 -146
  119. package/dist/chunk-NCYTM57J.js +0 -160
@@ -9,19 +9,19 @@ import {
9
9
  } from "./chunk-WFE6CT6M.js";
10
10
  import {
11
11
  CategoryCombobox
12
- } from "./chunk-TZTKHOEK.js";
12
+ } from "./chunk-PFU6FSXY.js";
13
13
  import {
14
14
  useComboboxData
15
15
  } from "./chunk-OVPAOBZB.js";
16
16
  import {
17
17
  UploadMediaFormItem
18
- } from "./chunk-3BZBEC3Y.js";
18
+ } from "./chunk-PDQSPKG5.js";
19
19
  import {
20
20
  CountrySelect
21
21
  } from "./chunk-7CAFYKKA.js";
22
22
  import {
23
23
  UserCreatedOptionsList
24
- } from "./chunk-I5K5USJM.js";
24
+ } from "./chunk-QJEOPT2P.js";
25
25
  import {
26
26
  PRODUCT_CREATE_FORM_DEFAULTS,
27
27
  ProductCreateSchema,
@@ -46,7 +46,7 @@ import {
46
46
  DataGridMediaCell,
47
47
  createDataGridHelper,
48
48
  createDataGridPriceColumns
49
- } from "./chunk-W3TUVTRK.js";
49
+ } from "./chunk-Y2QI7KWS.js";
50
50
  import {
51
51
  KeyboundForm
52
52
  } from "./chunk-U2ZFCAPX.js";
@@ -61,7 +61,7 @@ import {
61
61
  } from "./chunk-3QSRE5LS.js";
62
62
  import {
63
63
  DataTable
64
- } from "./chunk-5LKZCG77.js";
64
+ } from "./chunk-PPLC4IKI.js";
65
65
  import {
66
66
  useStockLocations
67
67
  } from "./chunk-NBPMNUKZ.js";
@@ -379,6 +379,7 @@ var MultiSelect = forwardRef(
379
379
  onBlur,
380
380
  tabIndex: 0,
381
381
  role: "combobox",
382
+ "aria-controls": isOpen ? `${name}-listbox` : void 0,
382
383
  "aria-expanded": isOpen,
383
384
  "aria-haspopup": "listbox",
384
385
  "aria-invalid": ariaInvalid,
@@ -447,8 +448,7 @@ var MultiSelect = forwardRef(
447
448
  value: searchValue,
448
449
  onChange: handleSearchChange,
449
450
  placeholder: t("general.searchOptions"),
450
- className: "w-full bg-transparent pr-8 shadow-none focus:!shadow-none",
451
- autoFocus: true
451
+ className: "w-full bg-transparent pr-8 shadow-none focus:!shadow-none"
452
452
  }
453
453
  ),
454
454
  searchValue && /* @__PURE__ */ jsx(
@@ -469,17 +469,20 @@ var MultiSelect = forwardRef(
469
469
  children: filteredOptions.length === 0 ? /* @__PURE__ */ jsx("div", { className: "txt-compact-small-plus p-3 text-ui-fg-subtle", children: showSearch && searchValue.trim() ? t("general.noOptionsFound") : t("general.noOptionsAvailable") }) : filteredOptions.map((option) => {
470
470
  const currentValue = value || [];
471
471
  const isSelected = currentValue.includes(option.value);
472
- return /* @__PURE__ */ jsx(
473
- "div",
474
- {
475
- className: "flex cursor-pointer items-center px-1 py-1 hover:bg-ui-bg-base-hover",
476
- onClick: () => handleItemClick(option.value),
477
- children: /* @__PURE__ */ jsxs("div", { className: "flex flex-1 items-center gap-x-2 rounded-md px-2", children: [
478
- /* @__PURE__ */ jsx("div", { className: "flex size-5 shrink-0 items-center justify-center", children: isSelected && /* @__PURE__ */ jsx(CheckMini, {}) }),
479
- /* @__PURE__ */ jsx(Text, { className: "truncate", children: option.label })
480
- ] })
481
- },
482
- option.value
472
+ return (
473
+ // oxlint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
474
+ /* @__PURE__ */ jsx(
475
+ "div",
476
+ {
477
+ className: "flex cursor-pointer items-center px-1 py-1 hover:bg-ui-bg-base-hover",
478
+ onClick: () => handleItemClick(option.value),
479
+ children: /* @__PURE__ */ jsxs("div", { className: "flex flex-1 items-center gap-x-2 rounded-md px-2", children: [
480
+ /* @__PURE__ */ jsx("div", { className: "flex size-5 shrink-0 items-center justify-center", children: isSelected && /* @__PURE__ */ jsx(CheckMini, {}) }),
481
+ /* @__PURE__ */ jsx(Text, { className: "truncate", children: option.label })
482
+ ] })
483
+ },
484
+ option.value
485
+ )
483
486
  );
484
487
  })
485
488
  }
@@ -741,7 +744,12 @@ var ProductCreateAttributesForm = forwardRef2(({ form }, ref) => {
741
744
  validateAttributes,
742
745
  requiredFormFields
743
746
  }),
744
- [validateAttributes, requiredFormFields, form, t]
747
+ /* oxlint-disable react-hooks/exhaustive-deps */
748
+ [
749
+ requiredFormFields,
750
+ validateAttributes
751
+ ]
752
+ /* oxlint-enable react-hooks/exhaustive-deps */
745
753
  );
746
754
  useEffect2(() => {
747
755
  const subscription = form.watch((values, { name }) => {
@@ -2037,7 +2045,7 @@ var ProductCreateVariantsForm = ({
2037
2045
  }
2038
2046
  });
2039
2047
  return result;
2040
- }, [allAttributes, formValues]);
2048
+ }, [formValues, allAttributes]);
2041
2049
  const hasProductMedia = productMedia.length > 0;
2042
2050
  const columns = useColumns2({
2043
2051
  variantAttributes,
@@ -2189,7 +2197,12 @@ var ProductCreateVariantsForm = ({
2189
2197
  }
2190
2198
  }
2191
2199
  }
2192
- }, [variantStructureKey, form]);
2200
+ }, [
2201
+ variantStructureKey,
2202
+ form,
2203
+ variantAttributes,
2204
+ variantAttributes.length
2205
+ ]);
2193
2206
  return /* @__PURE__ */ jsx13("div", { className: "border-ui-border flex h-full flex-col justify-between divide-y", children: /* @__PURE__ */ jsx13(
2194
2207
  DataGrid,
2195
2208
  {
@@ -2208,9 +2221,9 @@ var columnHelper2 = createDataGridHelper();
2208
2221
  var useColumns2 = ({
2209
2222
  variantAttributes = [],
2210
2223
  store,
2211
- regions = [],
2224
+ regions: _regions = [],
2212
2225
  pricePreferences = [],
2213
- stockLocations = [],
2226
+ stockLocations: _stockLocations = [],
2214
2227
  onOpenMediaModal,
2215
2228
  form,
2216
2229
  productMedia = [],
@@ -2351,9 +2364,7 @@ var useColumns2 = ({
2351
2364
  variantAttributes,
2352
2365
  t,
2353
2366
  store,
2354
- regions,
2355
2367
  pricePreferences,
2356
- stockLocations,
2357
2368
  onOpenMediaModal,
2358
2369
  allSelected,
2359
2370
  someSelected,
@@ -2404,10 +2415,6 @@ var ProductCreateForm = ({
2404
2415
  const { attributes: allAttributes } = useAttributes({
2405
2416
  fields: "id,name,handle,description,ui_component,is_required,product_categories.*,possible_values.*"
2406
2417
  });
2407
- const { stock_locations = [] } = useStockLocations({
2408
- limit: 9999,
2409
- fields: "id,name"
2410
- });
2411
2418
  const dynamicAttributeSchema = useMemo4(() => {
2412
2419
  const attributeFields = {};
2413
2420
  allAttributes?.forEach((attr) => {
@@ -2538,7 +2545,7 @@ var ProductCreateForm = ({
2538
2545
  );
2539
2546
  }
2540
2547
  }
2541
- }, [tab]);
2548
+ }, [tab, form]);
2542
2549
  useEffect5(() => {
2543
2550
  if (onSaveVariantMediaRef) {
2544
2551
  onSaveVariantMediaRef.current = handleSaveVariantMedia;
@@ -3561,7 +3568,7 @@ var VariantMediaGallery = ({
3561
3568
  ] }) }) }),
3562
3569
  media.length > 1 && /* @__PURE__ */ jsxs14("div", { className: "flex shrink-0 items-center justify-center gap-x-2 border-t p-3", children: [
3563
3570
  /* @__PURE__ */ jsx16(IconButton3, { size: "small", variant: "transparent", className: "text-ui-fg-muted", type: "button", onClick: prev, children: /* @__PURE__ */ jsx16(TriangleLeftMini, {}) }),
3564
- /* @__PURE__ */ jsx16("div", { className: "flex items-center gap-x-2", children: media.slice(0, 8).map((item, idx) => {
3571
+ /* @__PURE__ */ jsx16("div", { className: "flex items-center gap-x-2", children: media.slice(0, 8).map((item, _idx) => {
3565
3572
  const isCurrentImage = item.id === media[curr]?.id;
3566
3573
  const originalIndex = media.findIndex((i) => i.id === item.id);
3567
3574
  return /* @__PURE__ */ jsx16(
@@ -3654,7 +3661,7 @@ var ProductCreateFormWithModal = ({
3654
3661
  setProductMedia(currentProductMedia || []);
3655
3662
  setIsOpen("variant-media-modal", true);
3656
3663
  },
3657
- []
3664
+ [setIsOpen]
3658
3665
  );
3659
3666
  const handleCloseModal = () => {
3660
3667
  setIsOpen("variant-media-modal", false);
@@ -10,10 +10,10 @@ import {
10
10
  import {
11
11
  _DataTable,
12
12
  useDataTable
13
- } from "./chunk-QXUKJDZB.js";
13
+ } from "./chunk-AIF2KTEE.js";
14
14
  import {
15
15
  SingleColumnPage
16
- } from "./chunk-RM5RSDYP.js";
16
+ } from "./chunk-CAS74NLJ.js";
17
17
  import {
18
18
  usePayouts
19
19
  } from "./chunk-VXWN37PT.js";
@@ -17,10 +17,10 @@ import {
17
17
  import {
18
18
  _DataTable,
19
19
  useDataTable
20
- } from "./chunk-QXUKJDZB.js";
20
+ } from "./chunk-AIF2KTEE.js";
21
21
  import {
22
22
  SingleColumnPage
23
- } from "./chunk-RM5RSDYP.js";
23
+ } from "./chunk-CAS74NLJ.js";
24
24
  import {
25
25
  useQueryParams
26
26
  } from "./chunk-THHRRYRS.js";
@@ -10,10 +10,10 @@ import {
10
10
  import {
11
11
  _DataTable,
12
12
  useDataTable
13
- } from "./chunk-QXUKJDZB.js";
13
+ } from "./chunk-AIF2KTEE.js";
14
14
  import {
15
15
  SingleColumnPage
16
- } from "./chunk-RM5RSDYP.js";
16
+ } from "./chunk-CAS74NLJ.js";
17
17
  import {
18
18
  useCollections
19
19
  } from "./chunk-RL7SFZOF.js";
@@ -4,10 +4,10 @@ import {
4
4
  import {
5
5
  _DataTable,
6
6
  useDataTable
7
- } from "./chunk-QXUKJDZB.js";
7
+ } from "./chunk-AIF2KTEE.js";
8
8
  import {
9
9
  SingleColumnPage
10
- } from "./chunk-RM5RSDYP.js";
10
+ } from "./chunk-CAS74NLJ.js";
11
11
  import {
12
12
  useQueryParams
13
13
  } from "./chunk-THHRRYRS.js";
@@ -987,7 +987,7 @@ var useDataGridClipboardEvents = ({
987
987
  if (typeof value === "object" && value !== null) {
988
988
  return JSON.stringify(value);
989
989
  }
990
- return `${value}` ?? "";
990
+ return value == null ? "" : `${value}`;
991
991
  }).join(" ");
992
992
  e.clipboardData?.setData("text/plain", text);
993
993
  },
@@ -1264,7 +1264,7 @@ function convertToggleableNumber(value) {
1264
1264
  try {
1265
1265
  obj = JSON.parse(obj);
1266
1266
  } catch (error) {
1267
- throw new Error(`String "${value}" cannot be converted to object.`);
1267
+ throw new Error(`String "${value}" cannot be converted to object.`, { cause: error });
1268
1268
  }
1269
1269
  }
1270
1270
  return obj;
@@ -3070,7 +3070,6 @@ var DataGridKeyboardShortcutModal = ({
3070
3070
  {
3071
3071
  type: "search",
3072
3072
  value: searchValue,
3073
- autoFocus: true,
3074
3073
  onChange: (e) => onSearchValueChange(e.target.value)
3075
3074
  }
3076
3075
  ) })
@@ -3244,10 +3243,13 @@ var DataGridRoot = ({
3244
3243
  }, 100);
3245
3244
  return () => {
3246
3245
  clearTimeout(timeoutId);
3247
- const scrollElement = containerRef.current;
3248
- scrollElement?.removeEventListener("scroll", handleScroll);
3246
+ container.removeEventListener("scroll", handleScroll);
3249
3247
  };
3250
- }, [isLazyMode, hasData]);
3248
+ }, [
3249
+ isLazyMode,
3250
+ hasData,
3251
+ handleScroll
3252
+ ]);
3251
3253
  const columnVirtualizer = useVirtualizer({
3252
3254
  count: visibleColumns.length,
3253
3255
  estimateSize: (index) => visibleColumns[index].getSize(),
@@ -3550,7 +3552,6 @@ var DataGridRoot = ({
3550
3552
  "div",
3551
3553
  {
3552
3554
  ref: containerRef,
3553
- autoFocus: true,
3554
3555
  tabIndex: 0,
3555
3556
  className: "relative h-full select-none overflow-auto outline-none",
3556
3557
  onFocus: handleRestoreGridFocus,
@@ -4412,7 +4413,7 @@ var OuterComponent2 = ({
4412
4413
  var Inner10 = ({
4413
4414
  field,
4414
4415
  inputProps,
4415
- placeholder,
4416
+ placeholder: _placeholder,
4416
4417
  hideInput,
4417
4418
  ...props
4418
4419
  }) => {
@@ -0,0 +1,163 @@
1
+ // src/components/inputs/chip-input/chip-input.tsx
2
+ import { XMarkMini } from "@medusajs/icons";
3
+ import { Badge, clx } from "@medusajs/ui";
4
+ import { AnimatePresence, motion } from "motion/react";
5
+ import {
6
+ forwardRef,
7
+ useImperativeHandle,
8
+ useRef,
9
+ useState
10
+ } from "react";
11
+ import { jsx, jsxs } from "react/jsx-runtime";
12
+ var ChipInput = forwardRef(
13
+ ({
14
+ value,
15
+ onChange,
16
+ onBlur,
17
+ disabled,
18
+ name,
19
+ showRemove = true,
20
+ variant = "base",
21
+ allowDuplicates = false,
22
+ placeholder,
23
+ className
24
+ }, ref) => {
25
+ const innerRef = useRef(null);
26
+ const isControlledRef = useRef(typeof value !== "undefined");
27
+ const isControlled = isControlledRef.current;
28
+ const [uncontrolledValue, setUncontrolledValue] = useState([]);
29
+ useImperativeHandle(
30
+ ref,
31
+ () => innerRef.current
32
+ );
33
+ const [duplicateIndex, setDuplicateIndex] = useState(null);
34
+ const chips = isControlled ? value : uncontrolledValue;
35
+ const handleAddChip = (chip) => {
36
+ const cleanValue = chip.trim();
37
+ if (!cleanValue) {
38
+ return;
39
+ }
40
+ if (!allowDuplicates && chips.includes(cleanValue)) {
41
+ setDuplicateIndex(chips.indexOf(cleanValue));
42
+ setTimeout(() => {
43
+ setDuplicateIndex(null);
44
+ }, 300);
45
+ return;
46
+ }
47
+ onChange?.([...chips, cleanValue]);
48
+ if (!isControlled) {
49
+ setUncontrolledValue([...chips, cleanValue]);
50
+ }
51
+ };
52
+ const handleRemoveChip = (chip) => {
53
+ onChange?.(chips.filter((v) => v !== chip));
54
+ if (!isControlled) {
55
+ setUncontrolledValue(chips.filter((v) => v !== chip));
56
+ }
57
+ };
58
+ const handleBlur = (e) => {
59
+ onBlur?.();
60
+ if (e.target.value) {
61
+ handleAddChip(e.target.value);
62
+ e.target.value = "";
63
+ }
64
+ };
65
+ const handleKeyDown = (e) => {
66
+ if (e.key === "Enter" || e.key === ",") {
67
+ e.preventDefault();
68
+ if (!innerRef.current?.value) {
69
+ return;
70
+ }
71
+ handleAddChip(innerRef.current?.value ?? "");
72
+ innerRef.current.value = "";
73
+ innerRef.current?.focus();
74
+ }
75
+ if (e.key === "Backspace" && innerRef.current?.value === "") {
76
+ handleRemoveChip(chips[chips.length - 1]);
77
+ }
78
+ };
79
+ const shake = {
80
+ x: [0, -2, 2, -2, 2, 0],
81
+ transition: { duration: 0.3 }
82
+ };
83
+ return (
84
+ // oxlint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
85
+ /* @__PURE__ */ jsxs(
86
+ "div",
87
+ {
88
+ className: clx(
89
+ "shadow-borders-base flex min-h-8 flex-wrap items-center gap-1 rounded-md px-2 py-1.5",
90
+ "transition-fg focus-within:shadow-borders-interactive-with-active",
91
+ "has-[input:disabled]:bg-ui-bg-disabled has-[input:disabled]:text-ui-fg-disabled has-[input:disabled]:cursor-not-allowed",
92
+ {
93
+ "bg-ui-bg-field-component hover:bg-ui-bg-field-component-hover": variant === "contrast",
94
+ "bg-ui-bg-field hover:bg-ui-bg-field-hover": variant === "base"
95
+ },
96
+ className
97
+ ),
98
+ tabIndex: -1,
99
+ onClick: () => innerRef.current?.focus(),
100
+ children: [
101
+ chips.map((v, index) => {
102
+ return /* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsx(
103
+ Badge,
104
+ {
105
+ size: "2xsmall",
106
+ className: clx("gap-x-0.5 pl-1.5 pr-1.5", {
107
+ "transition-fg pr-1": showRemove,
108
+ "shadow-borders-focus": index === duplicateIndex
109
+ }),
110
+ asChild: true,
111
+ children: /* @__PURE__ */ jsxs(
112
+ motion.div,
113
+ {
114
+ animate: index === duplicateIndex ? shake : void 0,
115
+ children: [
116
+ v,
117
+ showRemove && /* @__PURE__ */ jsx(
118
+ "button",
119
+ {
120
+ tabIndex: -1,
121
+ type: "button",
122
+ onClick: () => handleRemoveChip(v),
123
+ className: clx(
124
+ "text-ui-fg-subtle transition-fg outline-none"
125
+ ),
126
+ children: /* @__PURE__ */ jsx(XMarkMini, {})
127
+ }
128
+ )
129
+ ]
130
+ }
131
+ )
132
+ }
133
+ ) }, `${v}-${index}`);
134
+ }),
135
+ /* @__PURE__ */ jsx(
136
+ "input",
137
+ {
138
+ className: clx(
139
+ "caret-ui-fg-base text-ui-fg-base txt-compact-small flex-1 appearance-none bg-transparent",
140
+ "disabled:text-ui-fg-disabled disabled:cursor-not-allowed",
141
+ "focus:outline-none",
142
+ "placeholder:text-ui-fg-muted"
143
+ ),
144
+ onKeyDown: handleKeyDown,
145
+ onBlur: handleBlur,
146
+ disabled,
147
+ name,
148
+ ref: innerRef,
149
+ placeholder: chips.length === 0 ? placeholder : void 0,
150
+ autoComplete: "off"
151
+ }
152
+ )
153
+ ]
154
+ }
155
+ )
156
+ );
157
+ }
158
+ );
159
+ ChipInput.displayName = "ChipInput";
160
+
161
+ export {
162
+ ChipInput
163
+ };
@@ -27,7 +27,11 @@ var useSelectedParams = ({
27
27
  const updateSingleValue = () => {
28
28
  newValue.set(identifier, value);
29
29
  };
30
- multiple ? updateMultipleValues() : updateSingleValue();
30
+ if (multiple) {
31
+ updateMultipleValues();
32
+ } else {
33
+ updateSingleValue();
34
+ }
31
35
  newValue.delete(offsetKey);
32
36
  return newValue;
33
37
  });
@@ -46,7 +50,11 @@ var useSelectedParams = ({
46
50
  };
47
51
  setSearchParams((prev) => {
48
52
  if (value) {
49
- multiple ? deleteMultipleValues(prev) : deleteSingleValue(prev);
53
+ if (multiple) {
54
+ deleteMultipleValues(prev);
55
+ } else {
56
+ deleteSingleValue(prev);
57
+ }
50
58
  if (!prev.get(identifier)) {
51
59
  prev.delete(identifier);
52
60
  }
@@ -68,7 +76,7 @@ import { jsx } from "react/jsx-runtime";
68
76
  var DataTableSearch = ({
69
77
  placeholder,
70
78
  prefix,
71
- autofocus
79
+ autofocus: _autofocus
72
80
  }) => {
73
81
  const { t } = useTranslation();
74
82
  const placeholderText = placeholder || t("general.search");
@@ -101,7 +109,6 @@ var DataTableSearch = ({
101
109
  name: "q",
102
110
  type: "search",
103
111
  size: "small",
104
- autoFocus: autofocus,
105
112
  defaultValue: query?.[0] || void 0,
106
113
  onChange: debouncedOnChange,
107
114
  placeholder: placeholderText
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CollectionListPage
3
- } from "./chunk-WQX4ASK4.js";
3
+ } from "./chunk-WNVEMFIK.js";
4
4
  import "./chunk-JQV7CXEC.js";
5
5
  import "./chunk-BI2AYXZQ.js";
6
6
  import "./chunk-MG4GKUJW.js";
@@ -16,19 +16,19 @@ import "./chunk-26OOAKQ6.js";
16
16
  import "./chunk-S2WEYEQR.js";
17
17
  import "./chunk-X22KTLZ7.js";
18
18
  import "./chunk-6YA3C4NB.js";
19
- import "./chunk-4DYUQ3G5.js";
19
+ import "./chunk-LQYMBSRQ.js";
20
20
  import "./chunk-CMHI2RPL.js";
21
21
  import "./chunk-N3T24SEK.js";
22
22
  import "./chunk-UAE6XBYL.js";
23
23
  import "./chunk-4MFMCZEJ.js";
24
24
  import "./chunk-FQERBIVS.js";
25
- import "./chunk-3U63R3MT.js";
25
+ import "./chunk-CNLP35S7.js";
26
26
  import "./chunk-PHOCVOZ5.js";
27
- import "./chunk-QXUKJDZB.js";
28
- import "./chunk-LYUCDASZ.js";
27
+ import "./chunk-AIF2KTEE.js";
28
+ import "./chunk-YN3FGNJM.js";
29
29
  import "./chunk-KAZ5BYTQ.js";
30
30
  import "./chunk-3EF54XFY.js";
31
- import "./chunk-RM5RSDYP.js";
31
+ import "./chunk-CAS74NLJ.js";
32
32
  import "./chunk-THHRRYRS.js";
33
33
  import "./chunk-LRD242C7.js";
34
34
  import "./chunk-47SXTGLN.js";
@@ -4,8 +4,7 @@ import {
4
4
  } from "./chunk-U2ZFCAPX.js";
5
5
  import {
6
6
  RouteDrawer,
7
- useRouteModal,
8
- useStackedModal
7
+ useRouteModal
9
8
  } from "./chunk-3CK6OINO.js";
10
9
  import {
11
10
  Form
@@ -23,7 +22,7 @@ import "./chunk-RIN4CBRB.js";
23
22
  import "./chunk-NBMM2TZK.js";
24
23
 
25
24
  // src/pages/price-lists/[id]/configuration/index.tsx
26
- import { Heading as Heading2 } from "@medusajs/ui";
25
+ import { Heading } from "@medusajs/ui";
27
26
  import { useTranslation as useTranslation2 } from "react-i18next";
28
27
  import { useParams } from "react-router-dom";
29
28
 
@@ -49,14 +48,12 @@ var PriceListConfigurationSchema = z.object({
49
48
  })
50
49
  )
51
50
  });
52
- var STACKED_MODAL_ID = "cg";
53
51
  var PriceListConfigurationForm = ({
54
52
  priceList,
55
53
  customerGroups
56
54
  }) => {
57
55
  const { t } = useTranslation();
58
56
  const { handleSuccess } = useRouteModal();
59
- const { setIsOpen } = useStackedModal();
60
57
  const form = useForm({
61
58
  defaultValues: {
62
59
  ends_at: priceList.ends_at ? new Date(priceList.ends_at) : null,
@@ -65,29 +62,11 @@ var PriceListConfigurationForm = ({
65
62
  },
66
63
  resolver: zodResolver(PriceListConfigurationSchema)
67
64
  });
68
- const { fields, remove, append } = useFieldArray({
65
+ const { remove: _remove } = useFieldArray({
69
66
  control: form.control,
70
67
  name: "customer_group_id",
71
68
  keyName: "cg_id"
72
69
  });
73
- const handleAddCustomerGroup = (groups) => {
74
- if (!groups.length) {
75
- form.setValue("customer_group_id", []);
76
- setIsOpen(STACKED_MODAL_ID, false);
77
- return;
78
- }
79
- const newIds = groups.map((group) => group.id);
80
- const fieldsToAdd = groups.filter(
81
- (group) => !fields.some((field) => field.id === group.id)
82
- );
83
- for (const field of fields) {
84
- if (!newIds.includes(field.id)) {
85
- remove(fields.indexOf(field));
86
- }
87
- }
88
- append(fieldsToAdd);
89
- setIsOpen(STACKED_MODAL_ID, false);
90
- };
91
70
  const { mutateAsync } = useUpdatePriceList(priceList.id);
92
71
  const handleSubmit = form.handleSubmit(async (values) => {
93
72
  const rules = { ...priceList.rules };
@@ -190,7 +169,7 @@ var Component = () => {
190
169
  throw error;
191
170
  }
192
171
  return /* @__PURE__ */ jsxs2(RouteDrawer, { children: [
193
- /* @__PURE__ */ jsx2(RouteDrawer.Header, { children: /* @__PURE__ */ jsx2(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx2(Heading2, { children: t("priceLists.configuration.edit.header") }) }) }),
172
+ /* @__PURE__ */ jsx2(RouteDrawer.Header, { children: /* @__PURE__ */ jsx2(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx2(Heading, { children: t("priceLists.configuration.edit.header") }) }) }),
194
173
  ready && /* @__PURE__ */ jsx2(
195
174
  PriceListConfigurationForm,
196
175
  {
@@ -15,7 +15,7 @@ import {
15
15
  DataGrid,
16
16
  createDataGridHelper,
17
17
  createDataGridPriceColumns
18
- } from "./chunk-W3TUVTRK.js";
18
+ } from "./chunk-Y2QI7KWS.js";
19
19
  import "./chunk-IQPN4PZJ.js";
20
20
  import "./chunk-TKGWSUEI.js";
21
21
  import {
@@ -377,7 +377,7 @@ function PricingTab({ form }) {
377
377
  var columnHelper = createDataGridHelper();
378
378
  var useVariantPriceGridColumns = ({
379
379
  currencies = [],
380
- regions = [],
380
+ regions: _regions = [],
381
381
  pricePreferences = []
382
382
  }) => {
383
383
  const { t } = useTranslation3();
@@ -404,7 +404,7 @@ var useVariantPriceGridColumns = ({
404
404
  t
405
405
  })
406
406
  ];
407
- }, [t, currencies, regions, pricePreferences]);
407
+ }, [t, currencies, pricePreferences]);
408
408
  };
409
409
  var pricing_tab_default = PricingTab;
410
410
 
@@ -475,7 +475,11 @@ var CreateProductVariantForm = ({
475
475
  required_quantity: void 0
476
476
  });
477
477
  }
478
- }, [isInventoryKitEnabled]);
478
+ }, [
479
+ isInventoryKitEnabled,
480
+ inventoryField.fields.length,
481
+ inventoryField
482
+ ]);
479
483
  const handleChangeTab = (update) => {
480
484
  if (tab === update) {
481
485
  return;
@@ -3,7 +3,7 @@ import {
3
3
  TargetItem,
4
4
  TaxRateRuleReferenceSchema,
5
5
  createTaxRulePayload
6
- } from "./chunk-2UBZMAHM.js";
6
+ } from "./chunk-CYTNBXWF.js";
7
7
  import "./chunk-Q4UVXS46.js";
8
8
  import {
9
9
  PercentageInput
@@ -29,7 +29,7 @@ import "./chunk-S2WEYEQR.js";
29
29
  import "./chunk-X22KTLZ7.js";
30
30
  import "./chunk-6WY5X4PE.js";
31
31
  import "./chunk-6YA3C4NB.js";
32
- import "./chunk-4DYUQ3G5.js";
32
+ import "./chunk-LQYMBSRQ.js";
33
33
  import "./chunk-CMHI2RPL.js";
34
34
  import "./chunk-VW56KWO2.js";
35
35
  import "./chunk-LQSLDDPT.js";
@@ -42,11 +42,11 @@ import "./chunk-PXYDR7WQ.js";
42
42
  import "./chunk-GC33DBKG.js";
43
43
  import "./chunk-4MFMCZEJ.js";
44
44
  import "./chunk-FQERBIVS.js";
45
- import "./chunk-3U63R3MT.js";
45
+ import "./chunk-CNLP35S7.js";
46
46
  import "./chunk-DB6ANJBO.js";
47
47
  import "./chunk-PHOCVOZ5.js";
48
- import "./chunk-QXUKJDZB.js";
49
- import "./chunk-LYUCDASZ.js";
48
+ import "./chunk-AIF2KTEE.js";
49
+ import "./chunk-YN3FGNJM.js";
50
50
  import "./chunk-KAZ5BYTQ.js";
51
51
  import "./chunk-3EF54XFY.js";
52
52
  import {