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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/{[id]-26KNXVZ3.js → [id]-3JICOSAI.js} +111 -20
  2. package/dist/{[id]-7MPUE2JE.js → [id]-CR76L5TG.js} +4 -13
  3. package/dist/{[id]-45QR6M3C.js → [id]-E7DYRMMO.js} +141 -51
  4. package/dist/{[id]-W4ARB473.js → [id]-PD3ISUL5.js} +3 -3
  5. package/dist/{[id]-ZB25Z6NK.js → [id]-XUKQKCDN.js} +2 -2
  6. package/dist/{[id]-E76GYCHF.js → [id]-ZEFQ7FQQ.js} +2 -1
  7. package/dist/{add-TFZ5CKSA.js → add-GYXNRUAE.js} +2 -1
  8. package/dist/{add-promotions-3KKONG7D.js → add-promotions-EQ5MMQKG.js} +3 -3
  9. package/dist/{allocate-items-UOSOCC6N.js → allocate-items-URVRAFPS.js} +36 -5
  10. package/dist/{categories-VYVQ5G3H.js → categories-3P2DRH5V.js} +4 -2
  11. package/dist/{chunk-YXJYCCIU.js → chunk-3L2DVCOC.js} +1 -1
  12. package/dist/chunk-42R54Z2X.js +8 -0
  13. package/dist/{chunk-AJREJFHL.js → chunk-4EQIJMQT.js} +1 -1
  14. package/dist/{chunk-6XO5XJJX.js → chunk-4RFPRO2W.js} +1 -1
  15. package/dist/{chunk-GMIN5OB5.js → chunk-AKKIZD2P.js} +30 -32
  16. package/dist/chunk-EEBJYXWA.js +15 -0
  17. package/dist/{chunk-4XSO2NKC.js → chunk-HZCSJLGH.js} +1 -1
  18. package/dist/{chunk-JQV7CXEC.js → chunk-II3ACSV2.js} +17 -2
  19. package/dist/{chunk-GLOEJSV4.js → chunk-LRMWYKSF.js} +1 -1
  20. package/dist/chunk-LYYM7H7H.js +59 -0
  21. package/dist/{chunk-VKMNSMCS.js → chunk-N6MGVXXQ.js} +1 -1
  22. package/dist/{chunk-VDH3AG7D.js → chunk-R4JLYNUA.js} +2 -2
  23. package/dist/{chunk-M2JP43HN.js → chunk-RT3G3GEK.js} +1 -1
  24. package/dist/{chunk-WBFAUHKO.js → chunk-ZZIJSTXN.js} +44 -9
  25. package/dist/{collections-A5GNFU6H.js → collections-7M7O23NO.js} +4 -2
  26. package/dist/{create-KV4S6DA2.js → create-NR7ULWQS.js} +3 -2
  27. package/dist/{create-HU3EIJO6.js → create-SJSLOXOW.js} +4 -4
  28. package/dist/{edit-VPU333HQ.js → edit-3EN2H52W.js} +3 -2
  29. package/dist/{edit-HOIS3BEW.js → edit-6K3NSVI7.js} +1 -1
  30. package/dist/{edit-RXDAL7SX.js → edit-YTS77SJS.js} +2 -2
  31. package/dist/{fulfillment-6I3ERWZW.js → fulfillment-VEF6HG6D.js} +9 -22
  32. package/dist/index.js +37 -37
  33. package/dist/{media-Q3AN34MZ.js → media-KIIJ6WSZ.js} +3 -3
  34. package/dist/{offer-create-page-ZRPBFHZO.js → offer-create-page-DV4JCIL2.js} +4 -6
  35. package/dist/{offer-variant-detail-page-LYG62KTY.js → offer-variant-detail-page-ORH56HZI.js} +1 -1
  36. package/dist/pages/index.js +12 -11
  37. package/dist/{product-tags-RNK4N72O.js → product-tags-MW2JMRFY.js} +2 -1
  38. package/dist/{products-P5DGEYTS.js → products-TZS2OPK3.js} +4 -4
  39. package/dist/{promotions-SY4DKTT5.js → promotions-JYO23G6N.js} +4 -4
  40. package/dist/{register-JZK5LFZU.js → register-SR2SYX4Q.js} +1 -1
  41. package/dist/{reset-password-HGLJ75PJ.js → reset-password-N22YRMR3.js} +1 -1
  42. package/dist/{return-reasons-2TMOZGMV.js → return-reasons-POR5YPTF.js} +2 -1
  43. package/dist/{settings-QEARGBMK.js → settings-MHBYIZ2I.js} +2 -1
  44. package/dist/{shipping-UBQAPPM4.js → shipping-W4SPR3JO.js} +19 -10
  45. package/package.json +1 -1
  46. package/dist/chunk-BDZOSMAX.js +0 -23
@@ -19,9 +19,6 @@ import {
19
19
  useOffer,
20
20
  useUpdateOffer
21
21
  } from "./chunk-4R5GESED.js";
22
- import {
23
- useDocumentDirection
24
- } from "./chunk-Y7QKP6QU.js";
25
22
  import "./chunk-TSTUAL6N.js";
26
23
  import "./chunk-A5DJIOHN.js";
27
24
  import "./chunk-RHKRREUU.js";
@@ -31,7 +28,7 @@ import "./chunk-NBMM2TZK.js";
31
28
 
32
29
  // src/pages/offers/[id]/variants/[offer_id]/shipping/index.tsx
33
30
  import { zodResolver } from "@hookform/resolvers/zod";
34
- import { Button, Heading, Select, toast } from "@medusajs/ui";
31
+ import { Button, Heading, RadioGroup, toast } from "@medusajs/ui";
35
32
  import { useForm } from "react-hook-form";
36
33
  import { useTranslation } from "react-i18next";
37
34
  import { useParams } from "react-router-dom";
@@ -40,7 +37,6 @@ import { jsx, jsxs } from "react/jsx-runtime";
40
37
  var Schema = z.object({ shipping_profile_id: z.string().min(1) });
41
38
  var EditShippingForm = ({ offer }) => {
42
39
  const { t } = useTranslation();
43
- const dir = useDocumentDirection();
44
40
  const { handleSuccess } = useRouteModal();
45
41
  const { shipping_profiles } = useShippingProfiles({ limit: 1e3 });
46
42
  const form = useForm({
@@ -53,7 +49,7 @@ var EditShippingForm = ({ offer }) => {
53
49
  { shipping_profile_id: values.shipping_profile_id },
54
50
  {
55
51
  onSuccess: () => {
56
- toast.success(t("offers.edit.successToast"));
52
+ toast.success(t("offers.variant.shipping.successToast"));
57
53
  handleSuccess();
58
54
  },
59
55
  onError: (error) => toast.error(error.message)
@@ -74,10 +70,23 @@ var EditShippingForm = ({ offer }) => {
74
70
  name: "shipping_profile_id",
75
71
  render: ({ field: { ref: _r, onChange, ...f } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
76
72
  /* @__PURE__ */ jsx(Form.Label, { children: t("offers.fields.shippingProfile") }),
77
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsxs(Select, { ...f, onValueChange: onChange, dir, children: [
78
- /* @__PURE__ */ jsx(Select.Trigger, { ref: _r, children: /* @__PURE__ */ jsx(Select.Value, {}) }),
79
- /* @__PURE__ */ jsx(Select.Content, { children: (shipping_profiles ?? []).map((p) => /* @__PURE__ */ jsx(Select.Item, { value: p.id, children: p.name }, p.id)) })
80
- ] }) }),
73
+ /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
74
+ RadioGroup,
75
+ {
76
+ ...f,
77
+ onValueChange: onChange,
78
+ className: "flex flex-col gap-3",
79
+ children: (shipping_profiles ?? []).map((p) => /* @__PURE__ */ jsx(
80
+ RadioGroup.ChoiceBox,
81
+ {
82
+ value: p.id,
83
+ label: p.name ?? "",
84
+ description: p.type ?? ""
85
+ },
86
+ p.id
87
+ ))
88
+ }
89
+ ) }),
81
90
  /* @__PURE__ */ jsx(Form.ErrorMessage, {})
82
91
  ] })
83
92
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mercurjs/vendor",
3
- "version": "2.2.0-canary.20",
3
+ "version": "2.2.0-canary.21",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/mercurjs/mercur",
@@ -1,23 +0,0 @@
1
- // src/pages/categories/common/utils.ts
2
- function getCategoryPath(category) {
3
- if (!category) {
4
- return [];
5
- }
6
- const path = category.parent_category ? getCategoryPath(category.parent_category) : [];
7
- path.push({ id: category.id, name: category.name });
8
- return path;
9
- }
10
- function getCategoryChildren(category) {
11
- if (!category || !category.category_children) {
12
- return [];
13
- }
14
- return category.category_children.map((child) => ({
15
- id: child.id,
16
- name: child.name
17
- }));
18
- }
19
-
20
- export {
21
- getCategoryPath,
22
- getCategoryChildren
23
- };