@medusajs/draft-order 2.10.4-preview-20250929060158 → 2.10.4-preview-20250929090207

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.
@@ -9594,196 +9594,6 @@ const CustomItemsForm = () => {
9594
9594
  const schema$5 = objectType({
9595
9595
  email: stringType().email()
9596
9596
  });
9597
- const BillingAddress = () => {
9598
- const { id } = reactRouterDom.useParams();
9599
- const { order, isPending, isError, error } = useOrder(id, {
9600
- fields: "+billing_address"
9601
- });
9602
- if (isError) {
9603
- throw error;
9604
- }
9605
- const isReady = !isPending && !!order;
9606
- return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
9607
- /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
9608
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Billing Address" }) }),
9609
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
9610
- ] }),
9611
- isReady && /* @__PURE__ */ jsxRuntime.jsx(BillingAddressForm, { order })
9612
- ] });
9613
- };
9614
- const BillingAddressForm = ({ order }) => {
9615
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
9616
- const form = reactHookForm.useForm({
9617
- defaultValues: {
9618
- first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
9619
- last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
9620
- company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
9621
- address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
9622
- address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
9623
- city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
9624
- province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
9625
- country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
9626
- postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
9627
- phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
9628
- },
9629
- resolver: zod.zodResolver(schema$4)
9630
- });
9631
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9632
- const { handleSuccess } = useRouteModal();
9633
- const onSubmit = form.handleSubmit(async (data) => {
9634
- await mutateAsync(
9635
- { billing_address: data },
9636
- {
9637
- onSuccess: () => {
9638
- handleSuccess();
9639
- },
9640
- onError: (error) => {
9641
- ui.toast.error(error.message);
9642
- }
9643
- }
9644
- );
9645
- });
9646
- return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
9647
- KeyboundForm,
9648
- {
9649
- className: "flex flex-1 flex-col overflow-hidden",
9650
- onSubmit,
9651
- children: [
9652
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-y-4", children: [
9653
- /* @__PURE__ */ jsxRuntime.jsx(
9654
- Form$2.Field,
9655
- {
9656
- control: form.control,
9657
- name: "country_code",
9658
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9659
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Country" }),
9660
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(CountrySelect, { ...field }) }),
9661
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9662
- ] })
9663
- }
9664
- ),
9665
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
9666
- /* @__PURE__ */ jsxRuntime.jsx(
9667
- Form$2.Field,
9668
- {
9669
- control: form.control,
9670
- name: "first_name",
9671
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9672
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "First name" }),
9673
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9674
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9675
- ] })
9676
- }
9677
- ),
9678
- /* @__PURE__ */ jsxRuntime.jsx(
9679
- Form$2.Field,
9680
- {
9681
- control: form.control,
9682
- name: "last_name",
9683
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9684
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Last name" }),
9685
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9686
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9687
- ] })
9688
- }
9689
- )
9690
- ] }),
9691
- /* @__PURE__ */ jsxRuntime.jsx(
9692
- Form$2.Field,
9693
- {
9694
- control: form.control,
9695
- name: "company",
9696
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9697
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Company" }),
9698
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9699
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9700
- ] })
9701
- }
9702
- ),
9703
- /* @__PURE__ */ jsxRuntime.jsx(
9704
- Form$2.Field,
9705
- {
9706
- control: form.control,
9707
- name: "address_1",
9708
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9709
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Address" }),
9710
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9711
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9712
- ] })
9713
- }
9714
- ),
9715
- /* @__PURE__ */ jsxRuntime.jsx(
9716
- Form$2.Field,
9717
- {
9718
- control: form.control,
9719
- name: "address_2",
9720
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9721
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
9722
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9723
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9724
- ] })
9725
- }
9726
- ),
9727
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
9728
- /* @__PURE__ */ jsxRuntime.jsx(
9729
- Form$2.Field,
9730
- {
9731
- control: form.control,
9732
- name: "postal_code",
9733
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9734
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Postal code" }),
9735
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9736
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9737
- ] })
9738
- }
9739
- ),
9740
- /* @__PURE__ */ jsxRuntime.jsx(
9741
- Form$2.Field,
9742
- {
9743
- control: form.control,
9744
- name: "city",
9745
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9746
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "City" }),
9747
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9748
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9749
- ] })
9750
- }
9751
- )
9752
- ] }),
9753
- /* @__PURE__ */ jsxRuntime.jsx(
9754
- Form$2.Field,
9755
- {
9756
- control: form.control,
9757
- name: "province",
9758
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9759
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Province / State" }),
9760
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9761
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9762
- ] })
9763
- }
9764
- ),
9765
- /* @__PURE__ */ jsxRuntime.jsx(
9766
- Form$2.Field,
9767
- {
9768
- control: form.control,
9769
- name: "phone",
9770
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9771
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Phone" }),
9772
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9773
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9774
- ] })
9775
- }
9776
- )
9777
- ] }) }),
9778
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
9779
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9780
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
9781
- ] }) })
9782
- ]
9783
- }
9784
- ) });
9785
- };
9786
- const schema$4 = addressSchema;
9787
9597
  const Email = () => {
9788
9598
  const { id } = reactRouterDom.useParams();
9789
9599
  const { order, isPending, isError, error } = useOrder(id, {
@@ -9806,7 +9616,7 @@ const EmailForm = ({ order }) => {
9806
9616
  defaultValues: {
9807
9617
  email: order.email ?? ""
9808
9618
  },
9809
- resolver: zod.zodResolver(schema$3)
9619
+ resolver: zod.zodResolver(schema$4)
9810
9620
  });
9811
9621
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9812
9622
  const { handleSuccess } = useRouteModal();
@@ -9849,7 +9659,7 @@ const EmailForm = ({ order }) => {
9849
9659
  }
9850
9660
  ) });
9851
9661
  };
9852
- const schema$3 = objectType({
9662
+ const schema$4 = objectType({
9853
9663
  email: stringType().email()
9854
9664
  });
9855
9665
  const NumberInput = React.forwardRef(
@@ -11481,7 +11291,7 @@ const SalesChannelForm = ({ order }) => {
11481
11291
  defaultValues: {
11482
11292
  sales_channel_id: order.sales_channel_id || ""
11483
11293
  },
11484
- resolver: zod.zodResolver(schema$2)
11294
+ resolver: zod.zodResolver(schema$3)
11485
11295
  });
11486
11296
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11487
11297
  const { handleSuccess } = useRouteModal();
@@ -11556,7 +11366,7 @@ const SalesChannelField = ({ control, order }) => {
11556
11366
  }
11557
11367
  );
11558
11368
  };
11559
- const schema$2 = objectType({
11369
+ const schema$3 = objectType({
11560
11370
  sales_channel_id: stringType().min(1)
11561
11371
  });
11562
11372
  const STACKED_FOCUS_MODAL_ID = "shipping-form";
@@ -12389,7 +12199,7 @@ const TransferOwnershipForm = ({ order }) => {
12389
12199
  defaultValues: {
12390
12200
  customer_id: order.customer_id || ""
12391
12201
  },
12392
- resolver: zod.zodResolver(schema$1)
12202
+ resolver: zod.zodResolver(schema$2)
12393
12203
  });
12394
12204
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12395
12205
  const { handleSuccess } = useRouteModal();
@@ -12839,7 +12649,7 @@ const Illustration = () => {
12839
12649
  }
12840
12650
  );
12841
12651
  };
12842
- const schema$1 = objectType({
12652
+ const schema$2 = objectType({
12843
12653
  customer_id: stringType().min(1)
12844
12654
  });
12845
12655
  const ShippingAddress = () => {
@@ -12874,7 +12684,7 @@ const ShippingAddressForm = ({ order }) => {
12874
12684
  postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
12875
12685
  phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
12876
12686
  },
12877
- resolver: zod.zodResolver(schema)
12687
+ resolver: zod.zodResolver(schema$1)
12878
12688
  });
12879
12689
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12880
12690
  const { handleSuccess } = useRouteModal();
@@ -13044,6 +12854,196 @@ const ShippingAddressForm = ({ order }) => {
13044
12854
  }
13045
12855
  ) });
13046
12856
  };
12857
+ const schema$1 = addressSchema;
12858
+ const BillingAddress = () => {
12859
+ const { id } = reactRouterDom.useParams();
12860
+ const { order, isPending, isError, error } = useOrder(id, {
12861
+ fields: "+billing_address"
12862
+ });
12863
+ if (isError) {
12864
+ throw error;
12865
+ }
12866
+ const isReady = !isPending && !!order;
12867
+ return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
12868
+ /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
12869
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Billing Address" }) }),
12870
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
12871
+ ] }),
12872
+ isReady && /* @__PURE__ */ jsxRuntime.jsx(BillingAddressForm, { order })
12873
+ ] });
12874
+ };
12875
+ const BillingAddressForm = ({ order }) => {
12876
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
12877
+ const form = reactHookForm.useForm({
12878
+ defaultValues: {
12879
+ first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
12880
+ last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
12881
+ company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
12882
+ address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
12883
+ address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
12884
+ city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
12885
+ province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
12886
+ country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
12887
+ postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
12888
+ phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
12889
+ },
12890
+ resolver: zod.zodResolver(schema)
12891
+ });
12892
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12893
+ const { handleSuccess } = useRouteModal();
12894
+ const onSubmit = form.handleSubmit(async (data) => {
12895
+ await mutateAsync(
12896
+ { billing_address: data },
12897
+ {
12898
+ onSuccess: () => {
12899
+ handleSuccess();
12900
+ },
12901
+ onError: (error) => {
12902
+ ui.toast.error(error.message);
12903
+ }
12904
+ }
12905
+ );
12906
+ });
12907
+ return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
12908
+ KeyboundForm,
12909
+ {
12910
+ className: "flex flex-1 flex-col overflow-hidden",
12911
+ onSubmit,
12912
+ children: [
12913
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-y-4", children: [
12914
+ /* @__PURE__ */ jsxRuntime.jsx(
12915
+ Form$2.Field,
12916
+ {
12917
+ control: form.control,
12918
+ name: "country_code",
12919
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12920
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Country" }),
12921
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(CountrySelect, { ...field }) }),
12922
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12923
+ ] })
12924
+ }
12925
+ ),
12926
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12927
+ /* @__PURE__ */ jsxRuntime.jsx(
12928
+ Form$2.Field,
12929
+ {
12930
+ control: form.control,
12931
+ name: "first_name",
12932
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12933
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "First name" }),
12934
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12935
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12936
+ ] })
12937
+ }
12938
+ ),
12939
+ /* @__PURE__ */ jsxRuntime.jsx(
12940
+ Form$2.Field,
12941
+ {
12942
+ control: form.control,
12943
+ name: "last_name",
12944
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12945
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Last name" }),
12946
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12947
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12948
+ ] })
12949
+ }
12950
+ )
12951
+ ] }),
12952
+ /* @__PURE__ */ jsxRuntime.jsx(
12953
+ Form$2.Field,
12954
+ {
12955
+ control: form.control,
12956
+ name: "company",
12957
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12958
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Company" }),
12959
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12960
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12961
+ ] })
12962
+ }
12963
+ ),
12964
+ /* @__PURE__ */ jsxRuntime.jsx(
12965
+ Form$2.Field,
12966
+ {
12967
+ control: form.control,
12968
+ name: "address_1",
12969
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12970
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Address" }),
12971
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12972
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12973
+ ] })
12974
+ }
12975
+ ),
12976
+ /* @__PURE__ */ jsxRuntime.jsx(
12977
+ Form$2.Field,
12978
+ {
12979
+ control: form.control,
12980
+ name: "address_2",
12981
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12982
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
12983
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12984
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12985
+ ] })
12986
+ }
12987
+ ),
12988
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12989
+ /* @__PURE__ */ jsxRuntime.jsx(
12990
+ Form$2.Field,
12991
+ {
12992
+ control: form.control,
12993
+ name: "postal_code",
12994
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12995
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Postal code" }),
12996
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12997
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12998
+ ] })
12999
+ }
13000
+ ),
13001
+ /* @__PURE__ */ jsxRuntime.jsx(
13002
+ Form$2.Field,
13003
+ {
13004
+ control: form.control,
13005
+ name: "city",
13006
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
13007
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "City" }),
13008
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
13009
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
13010
+ ] })
13011
+ }
13012
+ )
13013
+ ] }),
13014
+ /* @__PURE__ */ jsxRuntime.jsx(
13015
+ Form$2.Field,
13016
+ {
13017
+ control: form.control,
13018
+ name: "province",
13019
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
13020
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Province / State" }),
13021
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
13022
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
13023
+ ] })
13024
+ }
13025
+ ),
13026
+ /* @__PURE__ */ jsxRuntime.jsx(
13027
+ Form$2.Field,
13028
+ {
13029
+ control: form.control,
13030
+ name: "phone",
13031
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
13032
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Phone" }),
13033
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
13034
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
13035
+ ] })
13036
+ }
13037
+ )
13038
+ ] }) }),
13039
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
13040
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
13041
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
13042
+ ] }) })
13043
+ ]
13044
+ }
13045
+ ) });
13046
+ };
13047
13047
  const schema = addressSchema;
13048
13048
  const widgetModule = { widgets: [] };
13049
13049
  const routeModule = {
@@ -13069,10 +13069,6 @@ const routeModule = {
13069
13069
  Component: CustomItems,
13070
13070
  path: "/draft-orders/:id/custom-items"
13071
13071
  },
13072
- {
13073
- Component: BillingAddress,
13074
- path: "/draft-orders/:id/billing-address"
13075
- },
13076
13072
  {
13077
13073
  Component: Email,
13078
13074
  path: "/draft-orders/:id/email"
@@ -13104,6 +13100,10 @@ const routeModule = {
13104
13100
  {
13105
13101
  Component: ShippingAddress,
13106
13102
  path: "/draft-orders/:id/shipping-address"
13103
+ },
13104
+ {
13105
+ Component: BillingAddress,
13106
+ path: "/draft-orders/:id/billing-address"
13107
13107
  }
13108
13108
  ]
13109
13109
  }
@@ -9588,196 +9588,6 @@ const CustomItemsForm = () => {
9588
9588
  const schema$5 = objectType({
9589
9589
  email: stringType().email()
9590
9590
  });
9591
- const BillingAddress = () => {
9592
- const { id } = useParams();
9593
- const { order, isPending, isError, error } = useOrder(id, {
9594
- fields: "+billing_address"
9595
- });
9596
- if (isError) {
9597
- throw error;
9598
- }
9599
- const isReady = !isPending && !!order;
9600
- return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
9601
- /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
9602
- /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Billing Address" }) }),
9603
- /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
9604
- ] }),
9605
- isReady && /* @__PURE__ */ jsx(BillingAddressForm, { order })
9606
- ] });
9607
- };
9608
- const BillingAddressForm = ({ order }) => {
9609
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
9610
- const form = useForm({
9611
- defaultValues: {
9612
- first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
9613
- last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
9614
- company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
9615
- address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
9616
- address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
9617
- city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
9618
- province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
9619
- country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
9620
- postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
9621
- phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
9622
- },
9623
- resolver: zodResolver(schema$4)
9624
- });
9625
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9626
- const { handleSuccess } = useRouteModal();
9627
- const onSubmit = form.handleSubmit(async (data) => {
9628
- await mutateAsync(
9629
- { billing_address: data },
9630
- {
9631
- onSuccess: () => {
9632
- handleSuccess();
9633
- },
9634
- onError: (error) => {
9635
- toast.error(error.message);
9636
- }
9637
- }
9638
- );
9639
- });
9640
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
9641
- KeyboundForm,
9642
- {
9643
- className: "flex flex-1 flex-col overflow-hidden",
9644
- onSubmit,
9645
- children: [
9646
- /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
9647
- /* @__PURE__ */ jsx(
9648
- Form$2.Field,
9649
- {
9650
- control: form.control,
9651
- name: "country_code",
9652
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9653
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Country" }),
9654
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
9655
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9656
- ] })
9657
- }
9658
- ),
9659
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
9660
- /* @__PURE__ */ jsx(
9661
- Form$2.Field,
9662
- {
9663
- control: form.control,
9664
- name: "first_name",
9665
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9666
- /* @__PURE__ */ jsx(Form$2.Label, { children: "First name" }),
9667
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9668
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9669
- ] })
9670
- }
9671
- ),
9672
- /* @__PURE__ */ jsx(
9673
- Form$2.Field,
9674
- {
9675
- control: form.control,
9676
- name: "last_name",
9677
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9678
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Last name" }),
9679
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9680
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9681
- ] })
9682
- }
9683
- )
9684
- ] }),
9685
- /* @__PURE__ */ jsx(
9686
- Form$2.Field,
9687
- {
9688
- control: form.control,
9689
- name: "company",
9690
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9691
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Company" }),
9692
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9693
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9694
- ] })
9695
- }
9696
- ),
9697
- /* @__PURE__ */ jsx(
9698
- Form$2.Field,
9699
- {
9700
- control: form.control,
9701
- name: "address_1",
9702
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9703
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Address" }),
9704
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9705
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9706
- ] })
9707
- }
9708
- ),
9709
- /* @__PURE__ */ jsx(
9710
- Form$2.Field,
9711
- {
9712
- control: form.control,
9713
- name: "address_2",
9714
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9715
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
9716
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9717
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9718
- ] })
9719
- }
9720
- ),
9721
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
9722
- /* @__PURE__ */ jsx(
9723
- Form$2.Field,
9724
- {
9725
- control: form.control,
9726
- name: "postal_code",
9727
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9728
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Postal code" }),
9729
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9730
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9731
- ] })
9732
- }
9733
- ),
9734
- /* @__PURE__ */ jsx(
9735
- Form$2.Field,
9736
- {
9737
- control: form.control,
9738
- name: "city",
9739
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9740
- /* @__PURE__ */ jsx(Form$2.Label, { children: "City" }),
9741
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9742
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9743
- ] })
9744
- }
9745
- )
9746
- ] }),
9747
- /* @__PURE__ */ jsx(
9748
- Form$2.Field,
9749
- {
9750
- control: form.control,
9751
- name: "province",
9752
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9753
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Province / State" }),
9754
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9755
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9756
- ] })
9757
- }
9758
- ),
9759
- /* @__PURE__ */ jsx(
9760
- Form$2.Field,
9761
- {
9762
- control: form.control,
9763
- name: "phone",
9764
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9765
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Phone" }),
9766
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9767
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9768
- ] })
9769
- }
9770
- )
9771
- ] }) }),
9772
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
9773
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9774
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
9775
- ] }) })
9776
- ]
9777
- }
9778
- ) });
9779
- };
9780
- const schema$4 = addressSchema;
9781
9591
  const Email = () => {
9782
9592
  const { id } = useParams();
9783
9593
  const { order, isPending, isError, error } = useOrder(id, {
@@ -9800,7 +9610,7 @@ const EmailForm = ({ order }) => {
9800
9610
  defaultValues: {
9801
9611
  email: order.email ?? ""
9802
9612
  },
9803
- resolver: zodResolver(schema$3)
9613
+ resolver: zodResolver(schema$4)
9804
9614
  });
9805
9615
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9806
9616
  const { handleSuccess } = useRouteModal();
@@ -9843,7 +9653,7 @@ const EmailForm = ({ order }) => {
9843
9653
  }
9844
9654
  ) });
9845
9655
  };
9846
- const schema$3 = objectType({
9656
+ const schema$4 = objectType({
9847
9657
  email: stringType().email()
9848
9658
  });
9849
9659
  const NumberInput = forwardRef(
@@ -11475,7 +11285,7 @@ const SalesChannelForm = ({ order }) => {
11475
11285
  defaultValues: {
11476
11286
  sales_channel_id: order.sales_channel_id || ""
11477
11287
  },
11478
- resolver: zodResolver(schema$2)
11288
+ resolver: zodResolver(schema$3)
11479
11289
  });
11480
11290
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11481
11291
  const { handleSuccess } = useRouteModal();
@@ -11550,7 +11360,7 @@ const SalesChannelField = ({ control, order }) => {
11550
11360
  }
11551
11361
  );
11552
11362
  };
11553
- const schema$2 = objectType({
11363
+ const schema$3 = objectType({
11554
11364
  sales_channel_id: stringType().min(1)
11555
11365
  });
11556
11366
  const STACKED_FOCUS_MODAL_ID = "shipping-form";
@@ -12383,7 +12193,7 @@ const TransferOwnershipForm = ({ order }) => {
12383
12193
  defaultValues: {
12384
12194
  customer_id: order.customer_id || ""
12385
12195
  },
12386
- resolver: zodResolver(schema$1)
12196
+ resolver: zodResolver(schema$2)
12387
12197
  });
12388
12198
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12389
12199
  const { handleSuccess } = useRouteModal();
@@ -12833,7 +12643,7 @@ const Illustration = () => {
12833
12643
  }
12834
12644
  );
12835
12645
  };
12836
- const schema$1 = objectType({
12646
+ const schema$2 = objectType({
12837
12647
  customer_id: stringType().min(1)
12838
12648
  });
12839
12649
  const ShippingAddress = () => {
@@ -12868,7 +12678,7 @@ const ShippingAddressForm = ({ order }) => {
12868
12678
  postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
12869
12679
  phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
12870
12680
  },
12871
- resolver: zodResolver(schema)
12681
+ resolver: zodResolver(schema$1)
12872
12682
  });
12873
12683
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12874
12684
  const { handleSuccess } = useRouteModal();
@@ -13038,6 +12848,196 @@ const ShippingAddressForm = ({ order }) => {
13038
12848
  }
13039
12849
  ) });
13040
12850
  };
12851
+ const schema$1 = addressSchema;
12852
+ const BillingAddress = () => {
12853
+ const { id } = useParams();
12854
+ const { order, isPending, isError, error } = useOrder(id, {
12855
+ fields: "+billing_address"
12856
+ });
12857
+ if (isError) {
12858
+ throw error;
12859
+ }
12860
+ const isReady = !isPending && !!order;
12861
+ return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
12862
+ /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
12863
+ /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Billing Address" }) }),
12864
+ /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
12865
+ ] }),
12866
+ isReady && /* @__PURE__ */ jsx(BillingAddressForm, { order })
12867
+ ] });
12868
+ };
12869
+ const BillingAddressForm = ({ order }) => {
12870
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
12871
+ const form = useForm({
12872
+ defaultValues: {
12873
+ first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
12874
+ last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
12875
+ company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
12876
+ address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
12877
+ address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
12878
+ city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
12879
+ province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
12880
+ country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
12881
+ postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
12882
+ phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
12883
+ },
12884
+ resolver: zodResolver(schema)
12885
+ });
12886
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12887
+ const { handleSuccess } = useRouteModal();
12888
+ const onSubmit = form.handleSubmit(async (data) => {
12889
+ await mutateAsync(
12890
+ { billing_address: data },
12891
+ {
12892
+ onSuccess: () => {
12893
+ handleSuccess();
12894
+ },
12895
+ onError: (error) => {
12896
+ toast.error(error.message);
12897
+ }
12898
+ }
12899
+ );
12900
+ });
12901
+ return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
12902
+ KeyboundForm,
12903
+ {
12904
+ className: "flex flex-1 flex-col overflow-hidden",
12905
+ onSubmit,
12906
+ children: [
12907
+ /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
12908
+ /* @__PURE__ */ jsx(
12909
+ Form$2.Field,
12910
+ {
12911
+ control: form.control,
12912
+ name: "country_code",
12913
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12914
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Country" }),
12915
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
12916
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12917
+ ] })
12918
+ }
12919
+ ),
12920
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12921
+ /* @__PURE__ */ jsx(
12922
+ Form$2.Field,
12923
+ {
12924
+ control: form.control,
12925
+ name: "first_name",
12926
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12927
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "First name" }),
12928
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12929
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12930
+ ] })
12931
+ }
12932
+ ),
12933
+ /* @__PURE__ */ jsx(
12934
+ Form$2.Field,
12935
+ {
12936
+ control: form.control,
12937
+ name: "last_name",
12938
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12939
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Last name" }),
12940
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12941
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12942
+ ] })
12943
+ }
12944
+ )
12945
+ ] }),
12946
+ /* @__PURE__ */ jsx(
12947
+ Form$2.Field,
12948
+ {
12949
+ control: form.control,
12950
+ name: "company",
12951
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12952
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Company" }),
12953
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12954
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12955
+ ] })
12956
+ }
12957
+ ),
12958
+ /* @__PURE__ */ jsx(
12959
+ Form$2.Field,
12960
+ {
12961
+ control: form.control,
12962
+ name: "address_1",
12963
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12964
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Address" }),
12965
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12966
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12967
+ ] })
12968
+ }
12969
+ ),
12970
+ /* @__PURE__ */ jsx(
12971
+ Form$2.Field,
12972
+ {
12973
+ control: form.control,
12974
+ name: "address_2",
12975
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12976
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
12977
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12978
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12979
+ ] })
12980
+ }
12981
+ ),
12982
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12983
+ /* @__PURE__ */ jsx(
12984
+ Form$2.Field,
12985
+ {
12986
+ control: form.control,
12987
+ name: "postal_code",
12988
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12989
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Postal code" }),
12990
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12991
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12992
+ ] })
12993
+ }
12994
+ ),
12995
+ /* @__PURE__ */ jsx(
12996
+ Form$2.Field,
12997
+ {
12998
+ control: form.control,
12999
+ name: "city",
13000
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
13001
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "City" }),
13002
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
13003
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
13004
+ ] })
13005
+ }
13006
+ )
13007
+ ] }),
13008
+ /* @__PURE__ */ jsx(
13009
+ Form$2.Field,
13010
+ {
13011
+ control: form.control,
13012
+ name: "province",
13013
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
13014
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Province / State" }),
13015
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
13016
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
13017
+ ] })
13018
+ }
13019
+ ),
13020
+ /* @__PURE__ */ jsx(
13021
+ Form$2.Field,
13022
+ {
13023
+ control: form.control,
13024
+ name: "phone",
13025
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
13026
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Phone" }),
13027
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
13028
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
13029
+ ] })
13030
+ }
13031
+ )
13032
+ ] }) }),
13033
+ /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
13034
+ /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
13035
+ /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
13036
+ ] }) })
13037
+ ]
13038
+ }
13039
+ ) });
13040
+ };
13041
13041
  const schema = addressSchema;
13042
13042
  const widgetModule = { widgets: [] };
13043
13043
  const routeModule = {
@@ -13063,10 +13063,6 @@ const routeModule = {
13063
13063
  Component: CustomItems,
13064
13064
  path: "/draft-orders/:id/custom-items"
13065
13065
  },
13066
- {
13067
- Component: BillingAddress,
13068
- path: "/draft-orders/:id/billing-address"
13069
- },
13070
13066
  {
13071
13067
  Component: Email,
13072
13068
  path: "/draft-orders/:id/email"
@@ -13098,6 +13094,10 @@ const routeModule = {
13098
13094
  {
13099
13095
  Component: ShippingAddress,
13100
13096
  path: "/draft-orders/:id/shipping-address"
13097
+ },
13098
+ {
13099
+ Component: BillingAddress,
13100
+ path: "/draft-orders/:id/billing-address"
13101
13101
  }
13102
13102
  ]
13103
13103
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/draft-order",
3
- "version": "2.10.4-preview-20250929060158",
3
+ "version": "2.10.4-preview-20250929090207",
4
4
  "description": "A starter for Medusa plugins.",
5
5
  "author": "Medusa (https://medusajs.com)",
6
6
  "license": "MIT",
@@ -36,7 +36,7 @@
36
36
  "dependencies": {
37
37
  "@ariakit/react": "^0.4.15",
38
38
  "@hookform/resolvers": "3.4.2",
39
- "@medusajs/js-sdk": "2.10.4-preview-20250929060158",
39
+ "@medusajs/js-sdk": "2.10.4-preview-20250929090207",
40
40
  "@tanstack/react-query": "5.64.2",
41
41
  "@uiw/react-json-view": "^2.0.0-alpha.17",
42
42
  "date-fns": "^3.6.0",
@@ -45,14 +45,14 @@
45
45
  "react-hook-form": "7.49.1"
46
46
  },
47
47
  "devDependencies": {
48
- "@medusajs/admin-sdk": "2.10.4-preview-20250929060158",
49
- "@medusajs/cli": "2.10.4-preview-20250929060158",
50
- "@medusajs/framework": "2.10.4-preview-20250929060158",
51
- "@medusajs/icons": "2.10.4-preview-20250929060158",
52
- "@medusajs/test-utils": "2.10.4-preview-20250929060158",
53
- "@medusajs/types": "2.10.4-preview-20250929060158",
54
- "@medusajs/ui": "4.0.24-preview-20250929060158",
55
- "@medusajs/ui-preset": "2.10.4-preview-20250929060158",
48
+ "@medusajs/admin-sdk": "2.10.4-preview-20250929090207",
49
+ "@medusajs/cli": "2.10.4-preview-20250929090207",
50
+ "@medusajs/framework": "2.10.4-preview-20250929090207",
51
+ "@medusajs/icons": "2.10.4-preview-20250929090207",
52
+ "@medusajs/test-utils": "2.10.4-preview-20250929090207",
53
+ "@medusajs/types": "2.10.4-preview-20250929090207",
54
+ "@medusajs/ui": "4.0.24-preview-20250929090207",
55
+ "@medusajs/ui-preset": "2.10.4-preview-20250929090207",
56
56
  "@swc/core": "1.5.7",
57
57
  "@types/lodash": "^4.17.15",
58
58
  "@types/node": "^20.0.0",
@@ -69,12 +69,12 @@
69
69
  "yalc": "^1.0.0-pre.53"
70
70
  },
71
71
  "peerDependencies": {
72
- "@medusajs/admin-sdk": "2.10.4-preview-20250929060158",
73
- "@medusajs/cli": "2.10.4-preview-20250929060158",
74
- "@medusajs/framework": "2.10.4-preview-20250929060158",
75
- "@medusajs/icons": "2.10.4-preview-20250929060158",
76
- "@medusajs/test-utils": "2.10.4-preview-20250929060158",
77
- "@medusajs/ui": "4.0.24-preview-20250929060158",
72
+ "@medusajs/admin-sdk": "2.10.4-preview-20250929090207",
73
+ "@medusajs/cli": "2.10.4-preview-20250929090207",
74
+ "@medusajs/framework": "2.10.4-preview-20250929090207",
75
+ "@medusajs/icons": "2.10.4-preview-20250929090207",
76
+ "@medusajs/test-utils": "2.10.4-preview-20250929090207",
77
+ "@medusajs/ui": "4.0.24-preview-20250929090207",
78
78
  "lodash": "^4.17.21",
79
79
  "react-router-dom": "6.20.1"
80
80
  },