@medusajs/draft-order 2.11.2-preview-20251028100508 → 2.11.2-preview-20251028120204

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.
@@ -10634,196 +10634,6 @@ const customItemSchema = objectType({
10634
10634
  quantity: numberType(),
10635
10635
  unit_price: unionType([numberType(), stringType()])
10636
10636
  });
10637
- const BillingAddress = () => {
10638
- const { id } = reactRouterDom.useParams();
10639
- const { order, isPending, isError, error } = useOrder(id, {
10640
- fields: "+billing_address"
10641
- });
10642
- if (isError) {
10643
- throw error;
10644
- }
10645
- const isReady = !isPending && !!order;
10646
- return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
10647
- /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
10648
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Billing Address" }) }),
10649
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
10650
- ] }),
10651
- isReady && /* @__PURE__ */ jsxRuntime.jsx(BillingAddressForm, { order })
10652
- ] });
10653
- };
10654
- const BillingAddressForm = ({ order }) => {
10655
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
10656
- const form = reactHookForm.useForm({
10657
- defaultValues: {
10658
- first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
10659
- last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
10660
- company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
10661
- address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
10662
- address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
10663
- city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
10664
- province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
10665
- country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
10666
- postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
10667
- phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
10668
- },
10669
- resolver: zod.zodResolver(schema$3)
10670
- });
10671
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
10672
- const { handleSuccess } = useRouteModal();
10673
- const onSubmit = form.handleSubmit(async (data) => {
10674
- await mutateAsync(
10675
- { billing_address: data },
10676
- {
10677
- onSuccess: () => {
10678
- handleSuccess();
10679
- },
10680
- onError: (error) => {
10681
- ui.toast.error(error.message);
10682
- }
10683
- }
10684
- );
10685
- });
10686
- return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
10687
- KeyboundForm,
10688
- {
10689
- className: "flex flex-1 flex-col overflow-hidden",
10690
- onSubmit,
10691
- children: [
10692
- /* @__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: [
10693
- /* @__PURE__ */ jsxRuntime.jsx(
10694
- Form$2.Field,
10695
- {
10696
- control: form.control,
10697
- name: "country_code",
10698
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10699
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Country" }),
10700
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(CountrySelect, { ...field }) }),
10701
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10702
- ] })
10703
- }
10704
- ),
10705
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
10706
- /* @__PURE__ */ jsxRuntime.jsx(
10707
- Form$2.Field,
10708
- {
10709
- control: form.control,
10710
- name: "first_name",
10711
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10712
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "First name" }),
10713
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10714
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10715
- ] })
10716
- }
10717
- ),
10718
- /* @__PURE__ */ jsxRuntime.jsx(
10719
- Form$2.Field,
10720
- {
10721
- control: form.control,
10722
- name: "last_name",
10723
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10724
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Last name" }),
10725
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10726
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10727
- ] })
10728
- }
10729
- )
10730
- ] }),
10731
- /* @__PURE__ */ jsxRuntime.jsx(
10732
- Form$2.Field,
10733
- {
10734
- control: form.control,
10735
- name: "company",
10736
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10737
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Company" }),
10738
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10739
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10740
- ] })
10741
- }
10742
- ),
10743
- /* @__PURE__ */ jsxRuntime.jsx(
10744
- Form$2.Field,
10745
- {
10746
- control: form.control,
10747
- name: "address_1",
10748
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10749
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Address" }),
10750
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10751
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10752
- ] })
10753
- }
10754
- ),
10755
- /* @__PURE__ */ jsxRuntime.jsx(
10756
- Form$2.Field,
10757
- {
10758
- control: form.control,
10759
- name: "address_2",
10760
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10761
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
10762
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10763
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10764
- ] })
10765
- }
10766
- ),
10767
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
10768
- /* @__PURE__ */ jsxRuntime.jsx(
10769
- Form$2.Field,
10770
- {
10771
- control: form.control,
10772
- name: "postal_code",
10773
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10774
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Postal code" }),
10775
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10776
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10777
- ] })
10778
- }
10779
- ),
10780
- /* @__PURE__ */ jsxRuntime.jsx(
10781
- Form$2.Field,
10782
- {
10783
- control: form.control,
10784
- name: "city",
10785
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10786
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "City" }),
10787
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10788
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10789
- ] })
10790
- }
10791
- )
10792
- ] }),
10793
- /* @__PURE__ */ jsxRuntime.jsx(
10794
- Form$2.Field,
10795
- {
10796
- control: form.control,
10797
- name: "province",
10798
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10799
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Province / State" }),
10800
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10801
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10802
- ] })
10803
- }
10804
- ),
10805
- /* @__PURE__ */ jsxRuntime.jsx(
10806
- Form$2.Field,
10807
- {
10808
- control: form.control,
10809
- name: "phone",
10810
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10811
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Phone" }),
10812
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10813
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10814
- ] })
10815
- }
10816
- )
10817
- ] }) }),
10818
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
10819
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
10820
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
10821
- ] }) })
10822
- ]
10823
- }
10824
- ) });
10825
- };
10826
- const schema$3 = addressSchema;
10827
10637
  const InlineTip = React.forwardRef(
10828
10638
  ({ variant = "tip", label, className, children, ...props }, ref) => {
10829
10639
  const labelValue = label || (variant === "warning" ? "Warning" : "Tip");
@@ -11479,7 +11289,7 @@ const SalesChannelForm = ({ order }) => {
11479
11289
  defaultValues: {
11480
11290
  sales_channel_id: order.sales_channel_id || ""
11481
11291
  },
11482
- resolver: zod.zodResolver(schema$2)
11292
+ resolver: zod.zodResolver(schema$3)
11483
11293
  });
11484
11294
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11485
11295
  const { handleSuccess } = useRouteModal();
@@ -11554,7 +11364,7 @@ const SalesChannelField = ({ control, order }) => {
11554
11364
  }
11555
11365
  );
11556
11366
  };
11557
- const schema$2 = objectType({
11367
+ const schema$3 = objectType({
11558
11368
  sales_channel_id: stringType().min(1)
11559
11369
  });
11560
11370
  const STACKED_FOCUS_MODAL_ID = "shipping-form";
@@ -12396,7 +12206,7 @@ const ShippingAddressForm = ({ order }) => {
12396
12206
  postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
12397
12207
  phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
12398
12208
  },
12399
- resolver: zod.zodResolver(schema$1)
12209
+ resolver: zod.zodResolver(schema$2)
12400
12210
  });
12401
12211
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12402
12212
  const { handleSuccess } = useRouteModal();
@@ -12566,7 +12376,7 @@ const ShippingAddressForm = ({ order }) => {
12566
12376
  }
12567
12377
  ) });
12568
12378
  };
12569
- const schema$1 = addressSchema;
12379
+ const schema$2 = addressSchema;
12570
12380
  const TransferOwnership = () => {
12571
12381
  const { id } = reactRouterDom.useParams();
12572
12382
  const { draft_order, isPending, isError, error } = useDraftOrder(id, {
@@ -12590,7 +12400,7 @@ const TransferOwnershipForm = ({ order }) => {
12590
12400
  defaultValues: {
12591
12401
  customer_id: order.customer_id || ""
12592
12402
  },
12593
- resolver: zod.zodResolver(schema)
12403
+ resolver: zod.zodResolver(schema$1)
12594
12404
  });
12595
12405
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12596
12406
  const { handleSuccess } = useRouteModal();
@@ -13040,9 +12850,199 @@ const Illustration = () => {
13040
12850
  }
13041
12851
  );
13042
12852
  };
13043
- const schema = objectType({
12853
+ const schema$1 = objectType({
13044
12854
  customer_id: stringType().min(1)
13045
12855
  });
12856
+ const BillingAddress = () => {
12857
+ const { id } = reactRouterDom.useParams();
12858
+ const { order, isPending, isError, error } = useOrder(id, {
12859
+ fields: "+billing_address"
12860
+ });
12861
+ if (isError) {
12862
+ throw error;
12863
+ }
12864
+ const isReady = !isPending && !!order;
12865
+ return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
12866
+ /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
12867
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Billing Address" }) }),
12868
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
12869
+ ] }),
12870
+ isReady && /* @__PURE__ */ jsxRuntime.jsx(BillingAddressForm, { order })
12871
+ ] });
12872
+ };
12873
+ const BillingAddressForm = ({ order }) => {
12874
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
12875
+ const form = reactHookForm.useForm({
12876
+ defaultValues: {
12877
+ first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
12878
+ last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
12879
+ company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
12880
+ address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
12881
+ address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
12882
+ city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
12883
+ province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
12884
+ country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
12885
+ postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
12886
+ phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
12887
+ },
12888
+ resolver: zod.zodResolver(schema)
12889
+ });
12890
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12891
+ const { handleSuccess } = useRouteModal();
12892
+ const onSubmit = form.handleSubmit(async (data) => {
12893
+ await mutateAsync(
12894
+ { billing_address: data },
12895
+ {
12896
+ onSuccess: () => {
12897
+ handleSuccess();
12898
+ },
12899
+ onError: (error) => {
12900
+ ui.toast.error(error.message);
12901
+ }
12902
+ }
12903
+ );
12904
+ });
12905
+ return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
12906
+ KeyboundForm,
12907
+ {
12908
+ className: "flex flex-1 flex-col overflow-hidden",
12909
+ onSubmit,
12910
+ children: [
12911
+ /* @__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: [
12912
+ /* @__PURE__ */ jsxRuntime.jsx(
12913
+ Form$2.Field,
12914
+ {
12915
+ control: form.control,
12916
+ name: "country_code",
12917
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12918
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Country" }),
12919
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(CountrySelect, { ...field }) }),
12920
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12921
+ ] })
12922
+ }
12923
+ ),
12924
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12925
+ /* @__PURE__ */ jsxRuntime.jsx(
12926
+ Form$2.Field,
12927
+ {
12928
+ control: form.control,
12929
+ name: "first_name",
12930
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12931
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "First name" }),
12932
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12933
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12934
+ ] })
12935
+ }
12936
+ ),
12937
+ /* @__PURE__ */ jsxRuntime.jsx(
12938
+ Form$2.Field,
12939
+ {
12940
+ control: form.control,
12941
+ name: "last_name",
12942
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12943
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Last name" }),
12944
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12945
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12946
+ ] })
12947
+ }
12948
+ )
12949
+ ] }),
12950
+ /* @__PURE__ */ jsxRuntime.jsx(
12951
+ Form$2.Field,
12952
+ {
12953
+ control: form.control,
12954
+ name: "company",
12955
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12956
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Company" }),
12957
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12958
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12959
+ ] })
12960
+ }
12961
+ ),
12962
+ /* @__PURE__ */ jsxRuntime.jsx(
12963
+ Form$2.Field,
12964
+ {
12965
+ control: form.control,
12966
+ name: "address_1",
12967
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12968
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Address" }),
12969
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12970
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12971
+ ] })
12972
+ }
12973
+ ),
12974
+ /* @__PURE__ */ jsxRuntime.jsx(
12975
+ Form$2.Field,
12976
+ {
12977
+ control: form.control,
12978
+ name: "address_2",
12979
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12980
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
12981
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12982
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12983
+ ] })
12984
+ }
12985
+ ),
12986
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12987
+ /* @__PURE__ */ jsxRuntime.jsx(
12988
+ Form$2.Field,
12989
+ {
12990
+ control: form.control,
12991
+ name: "postal_code",
12992
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12993
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Postal code" }),
12994
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12995
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12996
+ ] })
12997
+ }
12998
+ ),
12999
+ /* @__PURE__ */ jsxRuntime.jsx(
13000
+ Form$2.Field,
13001
+ {
13002
+ control: form.control,
13003
+ name: "city",
13004
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
13005
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "City" }),
13006
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
13007
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
13008
+ ] })
13009
+ }
13010
+ )
13011
+ ] }),
13012
+ /* @__PURE__ */ jsxRuntime.jsx(
13013
+ Form$2.Field,
13014
+ {
13015
+ control: form.control,
13016
+ name: "province",
13017
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
13018
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Province / State" }),
13019
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
13020
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
13021
+ ] })
13022
+ }
13023
+ ),
13024
+ /* @__PURE__ */ jsxRuntime.jsx(
13025
+ Form$2.Field,
13026
+ {
13027
+ control: form.control,
13028
+ name: "phone",
13029
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
13030
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Phone" }),
13031
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
13032
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
13033
+ ] })
13034
+ }
13035
+ )
13036
+ ] }) }),
13037
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
13038
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
13039
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
13040
+ ] }) })
13041
+ ]
13042
+ }
13043
+ ) });
13044
+ };
13045
+ const schema = addressSchema;
13046
13046
  const widgetModule = { widgets: [] };
13047
13047
  const routeModule = {
13048
13048
  routes: [
@@ -13075,10 +13075,6 @@ const routeModule = {
13075
13075
  Component: Items,
13076
13076
  path: "/draft-orders/:id/items"
13077
13077
  },
13078
- {
13079
- Component: BillingAddress,
13080
- path: "/draft-orders/:id/billing-address"
13081
- },
13082
13078
  {
13083
13079
  Component: Metadata,
13084
13080
  path: "/draft-orders/:id/metadata"
@@ -13102,6 +13098,10 @@ const routeModule = {
13102
13098
  {
13103
13099
  Component: TransferOwnership,
13104
13100
  path: "/draft-orders/:id/transfer-ownership"
13101
+ },
13102
+ {
13103
+ Component: BillingAddress,
13104
+ path: "/draft-orders/:id/billing-address"
13105
13105
  }
13106
13106
  ]
13107
13107
  }
@@ -10628,196 +10628,6 @@ const customItemSchema = objectType({
10628
10628
  quantity: numberType(),
10629
10629
  unit_price: unionType([numberType(), stringType()])
10630
10630
  });
10631
- const BillingAddress = () => {
10632
- const { id } = useParams();
10633
- const { order, isPending, isError, error } = useOrder(id, {
10634
- fields: "+billing_address"
10635
- });
10636
- if (isError) {
10637
- throw error;
10638
- }
10639
- const isReady = !isPending && !!order;
10640
- return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
10641
- /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
10642
- /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Billing Address" }) }),
10643
- /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
10644
- ] }),
10645
- isReady && /* @__PURE__ */ jsx(BillingAddressForm, { order })
10646
- ] });
10647
- };
10648
- const BillingAddressForm = ({ order }) => {
10649
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
10650
- const form = useForm({
10651
- defaultValues: {
10652
- first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
10653
- last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
10654
- company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
10655
- address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
10656
- address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
10657
- city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
10658
- province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
10659
- country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
10660
- postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
10661
- phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
10662
- },
10663
- resolver: zodResolver(schema$3)
10664
- });
10665
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
10666
- const { handleSuccess } = useRouteModal();
10667
- const onSubmit = form.handleSubmit(async (data) => {
10668
- await mutateAsync(
10669
- { billing_address: data },
10670
- {
10671
- onSuccess: () => {
10672
- handleSuccess();
10673
- },
10674
- onError: (error) => {
10675
- toast.error(error.message);
10676
- }
10677
- }
10678
- );
10679
- });
10680
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
10681
- KeyboundForm,
10682
- {
10683
- className: "flex flex-1 flex-col overflow-hidden",
10684
- onSubmit,
10685
- children: [
10686
- /* @__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: [
10687
- /* @__PURE__ */ jsx(
10688
- Form$2.Field,
10689
- {
10690
- control: form.control,
10691
- name: "country_code",
10692
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
10693
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Country" }),
10694
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
10695
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
10696
- ] })
10697
- }
10698
- ),
10699
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
10700
- /* @__PURE__ */ jsx(
10701
- Form$2.Field,
10702
- {
10703
- control: form.control,
10704
- name: "first_name",
10705
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
10706
- /* @__PURE__ */ jsx(Form$2.Label, { children: "First name" }),
10707
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
10708
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
10709
- ] })
10710
- }
10711
- ),
10712
- /* @__PURE__ */ jsx(
10713
- Form$2.Field,
10714
- {
10715
- control: form.control,
10716
- name: "last_name",
10717
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
10718
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Last name" }),
10719
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
10720
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
10721
- ] })
10722
- }
10723
- )
10724
- ] }),
10725
- /* @__PURE__ */ jsx(
10726
- Form$2.Field,
10727
- {
10728
- control: form.control,
10729
- name: "company",
10730
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
10731
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Company" }),
10732
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
10733
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
10734
- ] })
10735
- }
10736
- ),
10737
- /* @__PURE__ */ jsx(
10738
- Form$2.Field,
10739
- {
10740
- control: form.control,
10741
- name: "address_1",
10742
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
10743
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Address" }),
10744
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
10745
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
10746
- ] })
10747
- }
10748
- ),
10749
- /* @__PURE__ */ jsx(
10750
- Form$2.Field,
10751
- {
10752
- control: form.control,
10753
- name: "address_2",
10754
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
10755
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
10756
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
10757
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
10758
- ] })
10759
- }
10760
- ),
10761
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
10762
- /* @__PURE__ */ jsx(
10763
- Form$2.Field,
10764
- {
10765
- control: form.control,
10766
- name: "postal_code",
10767
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
10768
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Postal code" }),
10769
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
10770
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
10771
- ] })
10772
- }
10773
- ),
10774
- /* @__PURE__ */ jsx(
10775
- Form$2.Field,
10776
- {
10777
- control: form.control,
10778
- name: "city",
10779
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
10780
- /* @__PURE__ */ jsx(Form$2.Label, { children: "City" }),
10781
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
10782
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
10783
- ] })
10784
- }
10785
- )
10786
- ] }),
10787
- /* @__PURE__ */ jsx(
10788
- Form$2.Field,
10789
- {
10790
- control: form.control,
10791
- name: "province",
10792
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
10793
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Province / State" }),
10794
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
10795
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
10796
- ] })
10797
- }
10798
- ),
10799
- /* @__PURE__ */ jsx(
10800
- Form$2.Field,
10801
- {
10802
- control: form.control,
10803
- name: "phone",
10804
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
10805
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Phone" }),
10806
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
10807
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
10808
- ] })
10809
- }
10810
- )
10811
- ] }) }),
10812
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
10813
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
10814
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
10815
- ] }) })
10816
- ]
10817
- }
10818
- ) });
10819
- };
10820
- const schema$3 = addressSchema;
10821
10631
  const InlineTip = forwardRef(
10822
10632
  ({ variant = "tip", label, className, children, ...props }, ref) => {
10823
10633
  const labelValue = label || (variant === "warning" ? "Warning" : "Tip");
@@ -11473,7 +11283,7 @@ const SalesChannelForm = ({ order }) => {
11473
11283
  defaultValues: {
11474
11284
  sales_channel_id: order.sales_channel_id || ""
11475
11285
  },
11476
- resolver: zodResolver(schema$2)
11286
+ resolver: zodResolver(schema$3)
11477
11287
  });
11478
11288
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11479
11289
  const { handleSuccess } = useRouteModal();
@@ -11548,7 +11358,7 @@ const SalesChannelField = ({ control, order }) => {
11548
11358
  }
11549
11359
  );
11550
11360
  };
11551
- const schema$2 = objectType({
11361
+ const schema$3 = objectType({
11552
11362
  sales_channel_id: stringType().min(1)
11553
11363
  });
11554
11364
  const STACKED_FOCUS_MODAL_ID = "shipping-form";
@@ -12390,7 +12200,7 @@ const ShippingAddressForm = ({ order }) => {
12390
12200
  postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
12391
12201
  phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
12392
12202
  },
12393
- resolver: zodResolver(schema$1)
12203
+ resolver: zodResolver(schema$2)
12394
12204
  });
12395
12205
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12396
12206
  const { handleSuccess } = useRouteModal();
@@ -12560,7 +12370,7 @@ const ShippingAddressForm = ({ order }) => {
12560
12370
  }
12561
12371
  ) });
12562
12372
  };
12563
- const schema$1 = addressSchema;
12373
+ const schema$2 = addressSchema;
12564
12374
  const TransferOwnership = () => {
12565
12375
  const { id } = useParams();
12566
12376
  const { draft_order, isPending, isError, error } = useDraftOrder(id, {
@@ -12584,7 +12394,7 @@ const TransferOwnershipForm = ({ order }) => {
12584
12394
  defaultValues: {
12585
12395
  customer_id: order.customer_id || ""
12586
12396
  },
12587
- resolver: zodResolver(schema)
12397
+ resolver: zodResolver(schema$1)
12588
12398
  });
12589
12399
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12590
12400
  const { handleSuccess } = useRouteModal();
@@ -13034,9 +12844,199 @@ const Illustration = () => {
13034
12844
  }
13035
12845
  );
13036
12846
  };
13037
- const schema = objectType({
12847
+ const schema$1 = objectType({
13038
12848
  customer_id: stringType().min(1)
13039
12849
  });
12850
+ const BillingAddress = () => {
12851
+ const { id } = useParams();
12852
+ const { order, isPending, isError, error } = useOrder(id, {
12853
+ fields: "+billing_address"
12854
+ });
12855
+ if (isError) {
12856
+ throw error;
12857
+ }
12858
+ const isReady = !isPending && !!order;
12859
+ return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
12860
+ /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
12861
+ /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Billing Address" }) }),
12862
+ /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
12863
+ ] }),
12864
+ isReady && /* @__PURE__ */ jsx(BillingAddressForm, { order })
12865
+ ] });
12866
+ };
12867
+ const BillingAddressForm = ({ order }) => {
12868
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
12869
+ const form = useForm({
12870
+ defaultValues: {
12871
+ first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
12872
+ last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
12873
+ company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
12874
+ address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
12875
+ address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
12876
+ city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
12877
+ province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
12878
+ country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
12879
+ postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
12880
+ phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
12881
+ },
12882
+ resolver: zodResolver(schema)
12883
+ });
12884
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12885
+ const { handleSuccess } = useRouteModal();
12886
+ const onSubmit = form.handleSubmit(async (data) => {
12887
+ await mutateAsync(
12888
+ { billing_address: data },
12889
+ {
12890
+ onSuccess: () => {
12891
+ handleSuccess();
12892
+ },
12893
+ onError: (error) => {
12894
+ toast.error(error.message);
12895
+ }
12896
+ }
12897
+ );
12898
+ });
12899
+ return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
12900
+ KeyboundForm,
12901
+ {
12902
+ className: "flex flex-1 flex-col overflow-hidden",
12903
+ onSubmit,
12904
+ children: [
12905
+ /* @__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: [
12906
+ /* @__PURE__ */ jsx(
12907
+ Form$2.Field,
12908
+ {
12909
+ control: form.control,
12910
+ name: "country_code",
12911
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12912
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Country" }),
12913
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
12914
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12915
+ ] })
12916
+ }
12917
+ ),
12918
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12919
+ /* @__PURE__ */ jsx(
12920
+ Form$2.Field,
12921
+ {
12922
+ control: form.control,
12923
+ name: "first_name",
12924
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12925
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "First name" }),
12926
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12927
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12928
+ ] })
12929
+ }
12930
+ ),
12931
+ /* @__PURE__ */ jsx(
12932
+ Form$2.Field,
12933
+ {
12934
+ control: form.control,
12935
+ name: "last_name",
12936
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12937
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Last name" }),
12938
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12939
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12940
+ ] })
12941
+ }
12942
+ )
12943
+ ] }),
12944
+ /* @__PURE__ */ jsx(
12945
+ Form$2.Field,
12946
+ {
12947
+ control: form.control,
12948
+ name: "company",
12949
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12950
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Company" }),
12951
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12952
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12953
+ ] })
12954
+ }
12955
+ ),
12956
+ /* @__PURE__ */ jsx(
12957
+ Form$2.Field,
12958
+ {
12959
+ control: form.control,
12960
+ name: "address_1",
12961
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12962
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Address" }),
12963
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12964
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12965
+ ] })
12966
+ }
12967
+ ),
12968
+ /* @__PURE__ */ jsx(
12969
+ Form$2.Field,
12970
+ {
12971
+ control: form.control,
12972
+ name: "address_2",
12973
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12974
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
12975
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12976
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12977
+ ] })
12978
+ }
12979
+ ),
12980
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12981
+ /* @__PURE__ */ jsx(
12982
+ Form$2.Field,
12983
+ {
12984
+ control: form.control,
12985
+ name: "postal_code",
12986
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12987
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Postal code" }),
12988
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12989
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12990
+ ] })
12991
+ }
12992
+ ),
12993
+ /* @__PURE__ */ jsx(
12994
+ Form$2.Field,
12995
+ {
12996
+ control: form.control,
12997
+ name: "city",
12998
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12999
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "City" }),
13000
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
13001
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
13002
+ ] })
13003
+ }
13004
+ )
13005
+ ] }),
13006
+ /* @__PURE__ */ jsx(
13007
+ Form$2.Field,
13008
+ {
13009
+ control: form.control,
13010
+ name: "province",
13011
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
13012
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Province / State" }),
13013
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
13014
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
13015
+ ] })
13016
+ }
13017
+ ),
13018
+ /* @__PURE__ */ jsx(
13019
+ Form$2.Field,
13020
+ {
13021
+ control: form.control,
13022
+ name: "phone",
13023
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
13024
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Phone" }),
13025
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
13026
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
13027
+ ] })
13028
+ }
13029
+ )
13030
+ ] }) }),
13031
+ /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
13032
+ /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
13033
+ /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
13034
+ ] }) })
13035
+ ]
13036
+ }
13037
+ ) });
13038
+ };
13039
+ const schema = addressSchema;
13040
13040
  const widgetModule = { widgets: [] };
13041
13041
  const routeModule = {
13042
13042
  routes: [
@@ -13069,10 +13069,6 @@ const routeModule = {
13069
13069
  Component: Items,
13070
13070
  path: "/draft-orders/:id/items"
13071
13071
  },
13072
- {
13073
- Component: BillingAddress,
13074
- path: "/draft-orders/:id/billing-address"
13075
- },
13076
13072
  {
13077
13073
  Component: Metadata,
13078
13074
  path: "/draft-orders/:id/metadata"
@@ -13096,6 +13092,10 @@ const routeModule = {
13096
13092
  {
13097
13093
  Component: TransferOwnership,
13098
13094
  path: "/draft-orders/:id/transfer-ownership"
13095
+ },
13096
+ {
13097
+ Component: BillingAddress,
13098
+ path: "/draft-orders/:id/billing-address"
13099
13099
  }
13100
13100
  ]
13101
13101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/draft-order",
3
- "version": "2.11.2-preview-20251028100508",
3
+ "version": "2.11.2-preview-20251028120204",
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.11.2-preview-20251028100508",
39
+ "@medusajs/js-sdk": "2.11.2-preview-20251028120204",
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.11.2-preview-20251028100508",
49
- "@medusajs/cli": "2.11.2-preview-20251028100508",
50
- "@medusajs/framework": "2.11.2-preview-20251028100508",
51
- "@medusajs/icons": "2.11.2-preview-20251028100508",
52
- "@medusajs/test-utils": "2.11.2-preview-20251028100508",
53
- "@medusajs/types": "2.11.2-preview-20251028100508",
54
- "@medusajs/ui": "4.0.26-preview-20251028100508",
55
- "@medusajs/ui-preset": "2.11.2-preview-20251028100508",
48
+ "@medusajs/admin-sdk": "2.11.2-preview-20251028120204",
49
+ "@medusajs/cli": "2.11.2-preview-20251028120204",
50
+ "@medusajs/framework": "2.11.2-preview-20251028120204",
51
+ "@medusajs/icons": "2.11.2-preview-20251028120204",
52
+ "@medusajs/test-utils": "2.11.2-preview-20251028120204",
53
+ "@medusajs/types": "2.11.2-preview-20251028120204",
54
+ "@medusajs/ui": "4.0.26-preview-20251028120204",
55
+ "@medusajs/ui-preset": "2.11.2-preview-20251028120204",
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.11.2-preview-20251028100508",
73
- "@medusajs/cli": "2.11.2-preview-20251028100508",
74
- "@medusajs/framework": "2.11.2-preview-20251028100508",
75
- "@medusajs/icons": "2.11.2-preview-20251028100508",
76
- "@medusajs/test-utils": "2.11.2-preview-20251028100508",
77
- "@medusajs/ui": "4.0.26-preview-20251028100508",
72
+ "@medusajs/admin-sdk": "2.11.2-preview-20251028120204",
73
+ "@medusajs/cli": "2.11.2-preview-20251028120204",
74
+ "@medusajs/framework": "2.11.2-preview-20251028120204",
75
+ "@medusajs/icons": "2.11.2-preview-20251028120204",
76
+ "@medusajs/test-utils": "2.11.2-preview-20251028120204",
77
+ "@medusajs/ui": "4.0.26-preview-20251028120204",
78
78
  "lodash": "^4.17.21",
79
79
  "react-router-dom": "6.20.1"
80
80
  },