@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
@@ -1,160 +0,0 @@
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 /* @__PURE__ */ jsxs(
84
- "div",
85
- {
86
- className: clx(
87
- "shadow-borders-base flex min-h-8 flex-wrap items-center gap-1 rounded-md px-2 py-1.5",
88
- "transition-fg focus-within:shadow-borders-interactive-with-active",
89
- "has-[input:disabled]:bg-ui-bg-disabled has-[input:disabled]:text-ui-fg-disabled has-[input:disabled]:cursor-not-allowed",
90
- {
91
- "bg-ui-bg-field-component hover:bg-ui-bg-field-component-hover": variant === "contrast",
92
- "bg-ui-bg-field hover:bg-ui-bg-field-hover": variant === "base"
93
- },
94
- className
95
- ),
96
- tabIndex: -1,
97
- onClick: () => innerRef.current?.focus(),
98
- children: [
99
- chips.map((v, index) => {
100
- return /* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsx(
101
- Badge,
102
- {
103
- size: "2xsmall",
104
- className: clx("gap-x-0.5 pl-1.5 pr-1.5", {
105
- "transition-fg pr-1": showRemove,
106
- "shadow-borders-focus": index === duplicateIndex
107
- }),
108
- asChild: true,
109
- children: /* @__PURE__ */ jsxs(
110
- motion.div,
111
- {
112
- animate: index === duplicateIndex ? shake : void 0,
113
- children: [
114
- v,
115
- showRemove && /* @__PURE__ */ jsx(
116
- "button",
117
- {
118
- tabIndex: -1,
119
- type: "button",
120
- onClick: () => handleRemoveChip(v),
121
- className: clx(
122
- "text-ui-fg-subtle transition-fg outline-none"
123
- ),
124
- children: /* @__PURE__ */ jsx(XMarkMini, {})
125
- }
126
- )
127
- ]
128
- }
129
- )
130
- }
131
- ) }, `${v}-${index}`);
132
- }),
133
- /* @__PURE__ */ jsx(
134
- "input",
135
- {
136
- className: clx(
137
- "caret-ui-fg-base text-ui-fg-base txt-compact-small flex-1 appearance-none bg-transparent",
138
- "disabled:text-ui-fg-disabled disabled:cursor-not-allowed",
139
- "focus:outline-none",
140
- "placeholder:text-ui-fg-muted"
141
- ),
142
- onKeyDown: handleKeyDown,
143
- onBlur: handleBlur,
144
- disabled,
145
- name,
146
- ref: innerRef,
147
- placeholder: chips.length === 0 ? placeholder : void 0,
148
- autoComplete: "off"
149
- }
150
- )
151
- ]
152
- }
153
- );
154
- }
155
- );
156
- ChipInput.displayName = "ChipInput";
157
-
158
- export {
159
- ChipInput
160
- };