@medusajs/draft-order 2.11.3-preview-20251103060142 → 2.11.3-preview-20251103090143

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.
@@ -9572,196 +9572,6 @@ const ID = () => {
9572
9572
  /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Outlet, {})
9573
9573
  ] });
9574
9574
  };
9575
- const BillingAddress = () => {
9576
- const { id } = reactRouterDom.useParams();
9577
- const { order, isPending, isError, error } = useOrder(id, {
9578
- fields: "+billing_address"
9579
- });
9580
- if (isError) {
9581
- throw error;
9582
- }
9583
- const isReady = !isPending && !!order;
9584
- return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
9585
- /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
9586
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Billing Address" }) }),
9587
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
9588
- ] }),
9589
- isReady && /* @__PURE__ */ jsxRuntime.jsx(BillingAddressForm, { order })
9590
- ] });
9591
- };
9592
- const BillingAddressForm = ({ order }) => {
9593
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
9594
- const form = reactHookForm.useForm({
9595
- defaultValues: {
9596
- first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
9597
- last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
9598
- company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
9599
- address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
9600
- address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
9601
- city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
9602
- province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
9603
- country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
9604
- postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
9605
- phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
9606
- },
9607
- resolver: zod.zodResolver(schema$5)
9608
- });
9609
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9610
- const { handleSuccess } = useRouteModal();
9611
- const onSubmit = form.handleSubmit(async (data) => {
9612
- await mutateAsync(
9613
- { billing_address: data },
9614
- {
9615
- onSuccess: () => {
9616
- handleSuccess();
9617
- },
9618
- onError: (error) => {
9619
- ui.toast.error(error.message);
9620
- }
9621
- }
9622
- );
9623
- });
9624
- return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
9625
- KeyboundForm,
9626
- {
9627
- className: "flex flex-1 flex-col overflow-hidden",
9628
- onSubmit,
9629
- children: [
9630
- /* @__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: [
9631
- /* @__PURE__ */ jsxRuntime.jsx(
9632
- Form$2.Field,
9633
- {
9634
- control: form.control,
9635
- name: "country_code",
9636
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9637
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Country" }),
9638
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(CountrySelect, { ...field }) }),
9639
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9640
- ] })
9641
- }
9642
- ),
9643
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
9644
- /* @__PURE__ */ jsxRuntime.jsx(
9645
- Form$2.Field,
9646
- {
9647
- control: form.control,
9648
- name: "first_name",
9649
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9650
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "First name" }),
9651
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9652
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9653
- ] })
9654
- }
9655
- ),
9656
- /* @__PURE__ */ jsxRuntime.jsx(
9657
- Form$2.Field,
9658
- {
9659
- control: form.control,
9660
- name: "last_name",
9661
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9662
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Last name" }),
9663
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9664
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9665
- ] })
9666
- }
9667
- )
9668
- ] }),
9669
- /* @__PURE__ */ jsxRuntime.jsx(
9670
- Form$2.Field,
9671
- {
9672
- control: form.control,
9673
- name: "company",
9674
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9675
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Company" }),
9676
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9677
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9678
- ] })
9679
- }
9680
- ),
9681
- /* @__PURE__ */ jsxRuntime.jsx(
9682
- Form$2.Field,
9683
- {
9684
- control: form.control,
9685
- name: "address_1",
9686
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9687
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Address" }),
9688
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9689
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9690
- ] })
9691
- }
9692
- ),
9693
- /* @__PURE__ */ jsxRuntime.jsx(
9694
- Form$2.Field,
9695
- {
9696
- control: form.control,
9697
- name: "address_2",
9698
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9699
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
9700
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9701
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9702
- ] })
9703
- }
9704
- ),
9705
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
9706
- /* @__PURE__ */ jsxRuntime.jsx(
9707
- Form$2.Field,
9708
- {
9709
- control: form.control,
9710
- name: "postal_code",
9711
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9712
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Postal code" }),
9713
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9714
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9715
- ] })
9716
- }
9717
- ),
9718
- /* @__PURE__ */ jsxRuntime.jsx(
9719
- Form$2.Field,
9720
- {
9721
- control: form.control,
9722
- name: "city",
9723
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9724
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "City" }),
9725
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9726
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9727
- ] })
9728
- }
9729
- )
9730
- ] }),
9731
- /* @__PURE__ */ jsxRuntime.jsx(
9732
- Form$2.Field,
9733
- {
9734
- control: form.control,
9735
- name: "province",
9736
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9737
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Province / State" }),
9738
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9739
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9740
- ] })
9741
- }
9742
- ),
9743
- /* @__PURE__ */ jsxRuntime.jsx(
9744
- Form$2.Field,
9745
- {
9746
- control: form.control,
9747
- name: "phone",
9748
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9749
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Phone" }),
9750
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9751
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9752
- ] })
9753
- }
9754
- )
9755
- ] }) }),
9756
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
9757
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9758
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
9759
- ] }) })
9760
- ]
9761
- }
9762
- ) });
9763
- };
9764
- const schema$5 = addressSchema;
9765
9575
  const CustomItems = () => {
9766
9576
  return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
9767
9577
  /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Custom Items" }) }) }),
@@ -9770,7 +9580,7 @@ const CustomItems = () => {
9770
9580
  };
9771
9581
  const CustomItemsForm = () => {
9772
9582
  const form = reactHookForm.useForm({
9773
- resolver: zod.zodResolver(schema$4)
9583
+ resolver: zod.zodResolver(schema$5)
9774
9584
  });
9775
9585
  return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
9776
9586
  /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, {}),
@@ -9780,7 +9590,7 @@ const CustomItemsForm = () => {
9780
9590
  ] }) })
9781
9591
  ] }) });
9782
9592
  };
9783
- const schema$4 = objectType({
9593
+ const schema$5 = objectType({
9784
9594
  email: stringType().email()
9785
9595
  });
9786
9596
  const Email = () => {
@@ -9805,7 +9615,7 @@ const EmailForm = ({ order }) => {
9805
9615
  defaultValues: {
9806
9616
  email: order.email ?? ""
9807
9617
  },
9808
- resolver: zod.zodResolver(schema$3)
9618
+ resolver: zod.zodResolver(schema$4)
9809
9619
  });
9810
9620
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9811
9621
  const { handleSuccess } = useRouteModal();
@@ -9848,7 +9658,7 @@ const EmailForm = ({ order }) => {
9848
9658
  }
9849
9659
  ) });
9850
9660
  };
9851
- const schema$3 = objectType({
9661
+ const schema$4 = objectType({
9852
9662
  email: stringType().email()
9853
9663
  });
9854
9664
  const NumberInput = React.forwardRef(
@@ -10825,6 +10635,196 @@ const customItemSchema = objectType({
10825
10635
  quantity: numberType(),
10826
10636
  unit_price: unionType([numberType(), stringType()])
10827
10637
  });
10638
+ const BillingAddress = () => {
10639
+ const { id } = reactRouterDom.useParams();
10640
+ const { order, isPending, isError, error } = useOrder(id, {
10641
+ fields: "+billing_address"
10642
+ });
10643
+ if (isError) {
10644
+ throw error;
10645
+ }
10646
+ const isReady = !isPending && !!order;
10647
+ return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
10648
+ /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
10649
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Billing Address" }) }),
10650
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
10651
+ ] }),
10652
+ isReady && /* @__PURE__ */ jsxRuntime.jsx(BillingAddressForm, { order })
10653
+ ] });
10654
+ };
10655
+ const BillingAddressForm = ({ order }) => {
10656
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
10657
+ const form = reactHookForm.useForm({
10658
+ defaultValues: {
10659
+ first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
10660
+ last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
10661
+ company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
10662
+ address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
10663
+ address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
10664
+ city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
10665
+ province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
10666
+ country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
10667
+ postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
10668
+ phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
10669
+ },
10670
+ resolver: zod.zodResolver(schema$3)
10671
+ });
10672
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
10673
+ const { handleSuccess } = useRouteModal();
10674
+ const onSubmit = form.handleSubmit(async (data) => {
10675
+ await mutateAsync(
10676
+ { billing_address: data },
10677
+ {
10678
+ onSuccess: () => {
10679
+ handleSuccess();
10680
+ },
10681
+ onError: (error) => {
10682
+ ui.toast.error(error.message);
10683
+ }
10684
+ }
10685
+ );
10686
+ });
10687
+ return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
10688
+ KeyboundForm,
10689
+ {
10690
+ className: "flex flex-1 flex-col overflow-hidden",
10691
+ onSubmit,
10692
+ children: [
10693
+ /* @__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: [
10694
+ /* @__PURE__ */ jsxRuntime.jsx(
10695
+ Form$2.Field,
10696
+ {
10697
+ control: form.control,
10698
+ name: "country_code",
10699
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10700
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Country" }),
10701
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(CountrySelect, { ...field }) }),
10702
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10703
+ ] })
10704
+ }
10705
+ ),
10706
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
10707
+ /* @__PURE__ */ jsxRuntime.jsx(
10708
+ Form$2.Field,
10709
+ {
10710
+ control: form.control,
10711
+ name: "first_name",
10712
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10713
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "First name" }),
10714
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10715
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10716
+ ] })
10717
+ }
10718
+ ),
10719
+ /* @__PURE__ */ jsxRuntime.jsx(
10720
+ Form$2.Field,
10721
+ {
10722
+ control: form.control,
10723
+ name: "last_name",
10724
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10725
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Last name" }),
10726
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10727
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10728
+ ] })
10729
+ }
10730
+ )
10731
+ ] }),
10732
+ /* @__PURE__ */ jsxRuntime.jsx(
10733
+ Form$2.Field,
10734
+ {
10735
+ control: form.control,
10736
+ name: "company",
10737
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10738
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Company" }),
10739
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10740
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10741
+ ] })
10742
+ }
10743
+ ),
10744
+ /* @__PURE__ */ jsxRuntime.jsx(
10745
+ Form$2.Field,
10746
+ {
10747
+ control: form.control,
10748
+ name: "address_1",
10749
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10750
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Address" }),
10751
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10752
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10753
+ ] })
10754
+ }
10755
+ ),
10756
+ /* @__PURE__ */ jsxRuntime.jsx(
10757
+ Form$2.Field,
10758
+ {
10759
+ control: form.control,
10760
+ name: "address_2",
10761
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10762
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
10763
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10764
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10765
+ ] })
10766
+ }
10767
+ ),
10768
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
10769
+ /* @__PURE__ */ jsxRuntime.jsx(
10770
+ Form$2.Field,
10771
+ {
10772
+ control: form.control,
10773
+ name: "postal_code",
10774
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10775
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Postal code" }),
10776
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10777
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10778
+ ] })
10779
+ }
10780
+ ),
10781
+ /* @__PURE__ */ jsxRuntime.jsx(
10782
+ Form$2.Field,
10783
+ {
10784
+ control: form.control,
10785
+ name: "city",
10786
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10787
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "City" }),
10788
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10789
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10790
+ ] })
10791
+ }
10792
+ )
10793
+ ] }),
10794
+ /* @__PURE__ */ jsxRuntime.jsx(
10795
+ Form$2.Field,
10796
+ {
10797
+ control: form.control,
10798
+ name: "province",
10799
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10800
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Province / State" }),
10801
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10802
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10803
+ ] })
10804
+ }
10805
+ ),
10806
+ /* @__PURE__ */ jsxRuntime.jsx(
10807
+ Form$2.Field,
10808
+ {
10809
+ control: form.control,
10810
+ name: "phone",
10811
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10812
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Phone" }),
10813
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10814
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10815
+ ] })
10816
+ }
10817
+ )
10818
+ ] }) }),
10819
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
10820
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
10821
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
10822
+ ] }) })
10823
+ ]
10824
+ }
10825
+ ) });
10826
+ };
10827
+ const schema$3 = addressSchema;
10828
10828
  const InlineTip = React.forwardRef(
10829
10829
  ({ variant = "tip", label, className, children, ...props }, ref) => {
10830
10830
  const labelValue = label || (variant === "warning" ? "Warning" : "Tip");
@@ -13064,10 +13064,6 @@ const routeModule = {
13064
13064
  handle,
13065
13065
  loader,
13066
13066
  children: [
13067
- {
13068
- Component: BillingAddress,
13069
- path: "/draft-orders/:id/billing-address"
13070
- },
13071
13067
  {
13072
13068
  Component: CustomItems,
13073
13069
  path: "/draft-orders/:id/custom-items"
@@ -13080,6 +13076,10 @@ const routeModule = {
13080
13076
  Component: Items,
13081
13077
  path: "/draft-orders/:id/items"
13082
13078
  },
13079
+ {
13080
+ Component: BillingAddress,
13081
+ path: "/draft-orders/:id/billing-address"
13082
+ },
13083
13083
  {
13084
13084
  Component: Metadata,
13085
13085
  path: "/draft-orders/:id/metadata"
@@ -9565,196 +9565,6 @@ const ID = () => {
9565
9565
  /* @__PURE__ */ jsx(Outlet, {})
9566
9566
  ] });
9567
9567
  };
9568
- const BillingAddress = () => {
9569
- const { id } = useParams();
9570
- const { order, isPending, isError, error } = useOrder(id, {
9571
- fields: "+billing_address"
9572
- });
9573
- if (isError) {
9574
- throw error;
9575
- }
9576
- const isReady = !isPending && !!order;
9577
- return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
9578
- /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
9579
- /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Billing Address" }) }),
9580
- /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
9581
- ] }),
9582
- isReady && /* @__PURE__ */ jsx(BillingAddressForm, { order })
9583
- ] });
9584
- };
9585
- const BillingAddressForm = ({ order }) => {
9586
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
9587
- const form = useForm({
9588
- defaultValues: {
9589
- first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
9590
- last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
9591
- company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
9592
- address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
9593
- address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
9594
- city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
9595
- province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
9596
- country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
9597
- postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
9598
- phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
9599
- },
9600
- resolver: zodResolver(schema$5)
9601
- });
9602
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9603
- const { handleSuccess } = useRouteModal();
9604
- const onSubmit = form.handleSubmit(async (data) => {
9605
- await mutateAsync(
9606
- { billing_address: data },
9607
- {
9608
- onSuccess: () => {
9609
- handleSuccess();
9610
- },
9611
- onError: (error) => {
9612
- toast.error(error.message);
9613
- }
9614
- }
9615
- );
9616
- });
9617
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
9618
- KeyboundForm,
9619
- {
9620
- className: "flex flex-1 flex-col overflow-hidden",
9621
- onSubmit,
9622
- children: [
9623
- /* @__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: [
9624
- /* @__PURE__ */ jsx(
9625
- Form$2.Field,
9626
- {
9627
- control: form.control,
9628
- name: "country_code",
9629
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9630
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Country" }),
9631
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
9632
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9633
- ] })
9634
- }
9635
- ),
9636
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
9637
- /* @__PURE__ */ jsx(
9638
- Form$2.Field,
9639
- {
9640
- control: form.control,
9641
- name: "first_name",
9642
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9643
- /* @__PURE__ */ jsx(Form$2.Label, { children: "First name" }),
9644
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9645
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9646
- ] })
9647
- }
9648
- ),
9649
- /* @__PURE__ */ jsx(
9650
- Form$2.Field,
9651
- {
9652
- control: form.control,
9653
- name: "last_name",
9654
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9655
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Last name" }),
9656
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9657
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9658
- ] })
9659
- }
9660
- )
9661
- ] }),
9662
- /* @__PURE__ */ jsx(
9663
- Form$2.Field,
9664
- {
9665
- control: form.control,
9666
- name: "company",
9667
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9668
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Company" }),
9669
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9670
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9671
- ] })
9672
- }
9673
- ),
9674
- /* @__PURE__ */ jsx(
9675
- Form$2.Field,
9676
- {
9677
- control: form.control,
9678
- name: "address_1",
9679
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9680
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Address" }),
9681
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9682
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9683
- ] })
9684
- }
9685
- ),
9686
- /* @__PURE__ */ jsx(
9687
- Form$2.Field,
9688
- {
9689
- control: form.control,
9690
- name: "address_2",
9691
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9692
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
9693
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9694
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9695
- ] })
9696
- }
9697
- ),
9698
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
9699
- /* @__PURE__ */ jsx(
9700
- Form$2.Field,
9701
- {
9702
- control: form.control,
9703
- name: "postal_code",
9704
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9705
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Postal code" }),
9706
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9707
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9708
- ] })
9709
- }
9710
- ),
9711
- /* @__PURE__ */ jsx(
9712
- Form$2.Field,
9713
- {
9714
- control: form.control,
9715
- name: "city",
9716
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9717
- /* @__PURE__ */ jsx(Form$2.Label, { children: "City" }),
9718
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9719
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9720
- ] })
9721
- }
9722
- )
9723
- ] }),
9724
- /* @__PURE__ */ jsx(
9725
- Form$2.Field,
9726
- {
9727
- control: form.control,
9728
- name: "province",
9729
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9730
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Province / State" }),
9731
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9732
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9733
- ] })
9734
- }
9735
- ),
9736
- /* @__PURE__ */ jsx(
9737
- Form$2.Field,
9738
- {
9739
- control: form.control,
9740
- name: "phone",
9741
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9742
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Phone" }),
9743
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9744
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9745
- ] })
9746
- }
9747
- )
9748
- ] }) }),
9749
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
9750
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9751
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
9752
- ] }) })
9753
- ]
9754
- }
9755
- ) });
9756
- };
9757
- const schema$5 = addressSchema;
9758
9568
  const CustomItems = () => {
9759
9569
  return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
9760
9570
  /* @__PURE__ */ jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Custom Items" }) }) }),
@@ -9763,7 +9573,7 @@ const CustomItems = () => {
9763
9573
  };
9764
9574
  const CustomItemsForm = () => {
9765
9575
  const form = useForm({
9766
- resolver: zodResolver(schema$4)
9576
+ resolver: zodResolver(schema$5)
9767
9577
  });
9768
9578
  return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
9769
9579
  /* @__PURE__ */ jsx(RouteDrawer.Body, {}),
@@ -9773,7 +9583,7 @@ const CustomItemsForm = () => {
9773
9583
  ] }) })
9774
9584
  ] }) });
9775
9585
  };
9776
- const schema$4 = objectType({
9586
+ const schema$5 = objectType({
9777
9587
  email: stringType().email()
9778
9588
  });
9779
9589
  const Email = () => {
@@ -9798,7 +9608,7 @@ const EmailForm = ({ order }) => {
9798
9608
  defaultValues: {
9799
9609
  email: order.email ?? ""
9800
9610
  },
9801
- resolver: zodResolver(schema$3)
9611
+ resolver: zodResolver(schema$4)
9802
9612
  });
9803
9613
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9804
9614
  const { handleSuccess } = useRouteModal();
@@ -9841,7 +9651,7 @@ const EmailForm = ({ order }) => {
9841
9651
  }
9842
9652
  ) });
9843
9653
  };
9844
- const schema$3 = objectType({
9654
+ const schema$4 = objectType({
9845
9655
  email: stringType().email()
9846
9656
  });
9847
9657
  const NumberInput = forwardRef(
@@ -10818,6 +10628,196 @@ const customItemSchema = objectType({
10818
10628
  quantity: numberType(),
10819
10629
  unit_price: unionType([numberType(), stringType()])
10820
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
10821
  const InlineTip = forwardRef(
10822
10822
  ({ variant = "tip", label, className, children, ...props }, ref) => {
10823
10823
  const labelValue = label || (variant === "warning" ? "Warning" : "Tip");
@@ -13057,10 +13057,6 @@ const routeModule = {
13057
13057
  handle,
13058
13058
  loader,
13059
13059
  children: [
13060
- {
13061
- Component: BillingAddress,
13062
- path: "/draft-orders/:id/billing-address"
13063
- },
13064
13060
  {
13065
13061
  Component: CustomItems,
13066
13062
  path: "/draft-orders/:id/custom-items"
@@ -13073,6 +13069,10 @@ const routeModule = {
13073
13069
  Component: Items,
13074
13070
  path: "/draft-orders/:id/items"
13075
13071
  },
13072
+ {
13073
+ Component: BillingAddress,
13074
+ path: "/draft-orders/:id/billing-address"
13075
+ },
13076
13076
  {
13077
13077
  Component: Metadata,
13078
13078
  path: "/draft-orders/:id/metadata"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/draft-order",
3
- "version": "2.11.3-preview-20251103060142",
3
+ "version": "2.11.3-preview-20251103090143",
4
4
  "description": "A starter for Medusa plugins.",
5
5
  "author": "Medusa (https://medusajs.com)",
6
6
  "license": "MIT",
@@ -37,7 +37,7 @@
37
37
  "@ariakit/react": "^0.4.15",
38
38
  "@babel/runtime": "^7.26.10",
39
39
  "@hookform/resolvers": "3.4.2",
40
- "@medusajs/js-sdk": "2.11.3-preview-20251103060142",
40
+ "@medusajs/js-sdk": "2.11.3-preview-20251103090143",
41
41
  "@tanstack/react-query": "5.64.2",
42
42
  "@uiw/react-json-view": "^2.0.0-alpha.17",
43
43
  "date-fns": "^3.6.0",
@@ -48,14 +48,14 @@
48
48
  "react-hook-form": "7.49.1"
49
49
  },
50
50
  "devDependencies": {
51
- "@medusajs/admin-sdk": "2.11.3-preview-20251103060142",
52
- "@medusajs/cli": "2.11.3-preview-20251103060142",
53
- "@medusajs/framework": "2.11.3-preview-20251103060142",
54
- "@medusajs/icons": "2.11.3-preview-20251103060142",
55
- "@medusajs/test-utils": "2.11.3-preview-20251103060142",
56
- "@medusajs/types": "2.11.3-preview-20251103060142",
57
- "@medusajs/ui": "4.0.27-preview-20251103060142",
58
- "@medusajs/ui-preset": "2.11.3-preview-20251103060142",
51
+ "@medusajs/admin-sdk": "2.11.3-preview-20251103090143",
52
+ "@medusajs/cli": "2.11.3-preview-20251103090143",
53
+ "@medusajs/framework": "2.11.3-preview-20251103090143",
54
+ "@medusajs/icons": "2.11.3-preview-20251103090143",
55
+ "@medusajs/test-utils": "2.11.3-preview-20251103090143",
56
+ "@medusajs/types": "2.11.3-preview-20251103090143",
57
+ "@medusajs/ui": "4.0.27-preview-20251103090143",
58
+ "@medusajs/ui-preset": "2.11.3-preview-20251103090143",
59
59
  "@swc/core": "^1.7.28",
60
60
  "@types/lodash": "^4.17.15",
61
61
  "@types/lodash.debounce": "^4.0.9",
@@ -73,12 +73,12 @@
73
73
  "yalc": "^1.0.0-pre.53"
74
74
  },
75
75
  "peerDependencies": {
76
- "@medusajs/admin-sdk": "2.11.3-preview-20251103060142",
77
- "@medusajs/cli": "2.11.3-preview-20251103060142",
78
- "@medusajs/framework": "2.11.3-preview-20251103060142",
79
- "@medusajs/icons": "2.11.3-preview-20251103060142",
80
- "@medusajs/test-utils": "2.11.3-preview-20251103060142",
81
- "@medusajs/ui": "4.0.27-preview-20251103060142",
76
+ "@medusajs/admin-sdk": "2.11.3-preview-20251103090143",
77
+ "@medusajs/cli": "2.11.3-preview-20251103090143",
78
+ "@medusajs/framework": "2.11.3-preview-20251103090143",
79
+ "@medusajs/icons": "2.11.3-preview-20251103090143",
80
+ "@medusajs/test-utils": "2.11.3-preview-20251103090143",
81
+ "@medusajs/ui": "4.0.27-preview-20251103090143",
82
82
  "react": "^18.3.1",
83
83
  "react-dom": "^18.3.1",
84
84
  "react-router-dom": "6.20.1"