@medusajs/draft-order 2.10.4-snapshot-20251013091555 → 2.10.4-snapshot-20251013120621

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.
@@ -10986,196 +10986,6 @@ function getHasUneditableRows(metadata) {
10986
10986
  (value) => !EDITABLE_TYPES.includes(typeof value)
10987
10987
  );
10988
10988
  }
10989
- const BillingAddress = () => {
10990
- const { id } = reactRouterDom.useParams();
10991
- const { order, isPending, isError, error } = useOrder(id, {
10992
- fields: "+billing_address"
10993
- });
10994
- if (isError) {
10995
- throw error;
10996
- }
10997
- const isReady = !isPending && !!order;
10998
- return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
10999
- /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
11000
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Billing Address" }) }),
11001
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
11002
- ] }),
11003
- isReady && /* @__PURE__ */ jsxRuntime.jsx(BillingAddressForm, { order })
11004
- ] });
11005
- };
11006
- const BillingAddressForm = ({ order }) => {
11007
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
11008
- const form = reactHookForm.useForm({
11009
- defaultValues: {
11010
- first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
11011
- last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
11012
- company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
11013
- address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
11014
- address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
11015
- city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
11016
- province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
11017
- country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
11018
- postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
11019
- phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
11020
- },
11021
- resolver: zod.zodResolver(schema$3)
11022
- });
11023
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11024
- const { handleSuccess } = useRouteModal();
11025
- const onSubmit = form.handleSubmit(async (data) => {
11026
- await mutateAsync(
11027
- { billing_address: data },
11028
- {
11029
- onSuccess: () => {
11030
- handleSuccess();
11031
- },
11032
- onError: (error) => {
11033
- ui.toast.error(error.message);
11034
- }
11035
- }
11036
- );
11037
- });
11038
- return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
11039
- KeyboundForm,
11040
- {
11041
- className: "flex flex-1 flex-col overflow-hidden",
11042
- onSubmit,
11043
- children: [
11044
- /* @__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: [
11045
- /* @__PURE__ */ jsxRuntime.jsx(
11046
- Form$2.Field,
11047
- {
11048
- control: form.control,
11049
- name: "country_code",
11050
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11051
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Country" }),
11052
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(CountrySelect, { ...field }) }),
11053
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11054
- ] })
11055
- }
11056
- ),
11057
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11058
- /* @__PURE__ */ jsxRuntime.jsx(
11059
- Form$2.Field,
11060
- {
11061
- control: form.control,
11062
- name: "first_name",
11063
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11064
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "First name" }),
11065
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11066
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11067
- ] })
11068
- }
11069
- ),
11070
- /* @__PURE__ */ jsxRuntime.jsx(
11071
- Form$2.Field,
11072
- {
11073
- control: form.control,
11074
- name: "last_name",
11075
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11076
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Last name" }),
11077
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11078
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11079
- ] })
11080
- }
11081
- )
11082
- ] }),
11083
- /* @__PURE__ */ jsxRuntime.jsx(
11084
- Form$2.Field,
11085
- {
11086
- control: form.control,
11087
- name: "company",
11088
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11089
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Company" }),
11090
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11091
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11092
- ] })
11093
- }
11094
- ),
11095
- /* @__PURE__ */ jsxRuntime.jsx(
11096
- Form$2.Field,
11097
- {
11098
- control: form.control,
11099
- name: "address_1",
11100
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11101
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Address" }),
11102
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11103
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11104
- ] })
11105
- }
11106
- ),
11107
- /* @__PURE__ */ jsxRuntime.jsx(
11108
- Form$2.Field,
11109
- {
11110
- control: form.control,
11111
- name: "address_2",
11112
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11113
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
11114
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11115
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11116
- ] })
11117
- }
11118
- ),
11119
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11120
- /* @__PURE__ */ jsxRuntime.jsx(
11121
- Form$2.Field,
11122
- {
11123
- control: form.control,
11124
- name: "postal_code",
11125
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11126
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Postal code" }),
11127
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11128
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11129
- ] })
11130
- }
11131
- ),
11132
- /* @__PURE__ */ jsxRuntime.jsx(
11133
- Form$2.Field,
11134
- {
11135
- control: form.control,
11136
- name: "city",
11137
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11138
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "City" }),
11139
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11140
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11141
- ] })
11142
- }
11143
- )
11144
- ] }),
11145
- /* @__PURE__ */ jsxRuntime.jsx(
11146
- Form$2.Field,
11147
- {
11148
- control: form.control,
11149
- name: "province",
11150
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11151
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Province / State" }),
11152
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11153
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11154
- ] })
11155
- }
11156
- ),
11157
- /* @__PURE__ */ jsxRuntime.jsx(
11158
- Form$2.Field,
11159
- {
11160
- control: form.control,
11161
- name: "phone",
11162
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11163
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Phone" }),
11164
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11165
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11166
- ] })
11167
- }
11168
- )
11169
- ] }) }),
11170
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
11171
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
11172
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
11173
- ] }) })
11174
- ]
11175
- }
11176
- ) });
11177
- };
11178
- const schema$3 = addressSchema;
11179
10989
  const PROMOTION_QUERY_KEY = "promotions";
11180
10990
  const promotionsQueryKeys = {
11181
10991
  list: (query2) => [
@@ -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";
@@ -12398,7 +12208,7 @@ const ShippingAddressForm = ({ order }) => {
12398
12208
  postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
12399
12209
  phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
12400
12210
  },
12401
- resolver: zod.zodResolver(schema$1)
12211
+ resolver: zod.zodResolver(schema$2)
12402
12212
  });
12403
12213
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12404
12214
  const { handleSuccess } = useRouteModal();
@@ -12568,7 +12378,7 @@ const ShippingAddressForm = ({ order }) => {
12568
12378
  }
12569
12379
  ) });
12570
12380
  };
12571
- const schema$1 = addressSchema;
12381
+ const schema$2 = addressSchema;
12572
12382
  const TransferOwnership = () => {
12573
12383
  const { id } = reactRouterDom.useParams();
12574
12384
  const { draft_order, isPending, isError, error } = useDraftOrder(id, {
@@ -12592,7 +12402,7 @@ const TransferOwnershipForm = ({ order }) => {
12592
12402
  defaultValues: {
12593
12403
  customer_id: order.customer_id || ""
12594
12404
  },
12595
- resolver: zod.zodResolver(schema)
12405
+ resolver: zod.zodResolver(schema$1)
12596
12406
  });
12597
12407
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12598
12408
  const { handleSuccess } = useRouteModal();
@@ -13042,9 +12852,199 @@ const Illustration = () => {
13042
12852
  }
13043
12853
  );
13044
12854
  };
13045
- const schema = objectType({
12855
+ const schema$1 = objectType({
13046
12856
  customer_id: stringType().min(1)
13047
12857
  });
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
+ const schema = addressSchema;
13048
13048
  const widgetModule = { widgets: [] };
13049
13049
  const routeModule = {
13050
13050
  routes: [
@@ -13081,10 +13081,6 @@ const routeModule = {
13081
13081
  Component: Metadata,
13082
13082
  path: "/draft-orders/:id/metadata"
13083
13083
  },
13084
- {
13085
- Component: BillingAddress,
13086
- path: "/draft-orders/:id/billing-address"
13087
- },
13088
13084
  {
13089
13085
  Component: Promotions,
13090
13086
  path: "/draft-orders/:id/promotions"
@@ -13104,6 +13100,10 @@ const routeModule = {
13104
13100
  {
13105
13101
  Component: TransferOwnership,
13106
13102
  path: "/draft-orders/:id/transfer-ownership"
13103
+ },
13104
+ {
13105
+ Component: BillingAddress,
13106
+ path: "/draft-orders/:id/billing-address"
13107
13107
  }
13108
13108
  ]
13109
13109
  }
@@ -10980,196 +10980,6 @@ function getHasUneditableRows(metadata) {
10980
10980
  (value) => !EDITABLE_TYPES.includes(typeof value)
10981
10981
  );
10982
10982
  }
10983
- const BillingAddress = () => {
10984
- const { id } = useParams();
10985
- const { order, isPending, isError, error } = useOrder(id, {
10986
- fields: "+billing_address"
10987
- });
10988
- if (isError) {
10989
- throw error;
10990
- }
10991
- const isReady = !isPending && !!order;
10992
- return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
10993
- /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
10994
- /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Billing Address" }) }),
10995
- /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
10996
- ] }),
10997
- isReady && /* @__PURE__ */ jsx(BillingAddressForm, { order })
10998
- ] });
10999
- };
11000
- const BillingAddressForm = ({ order }) => {
11001
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
11002
- const form = useForm({
11003
- defaultValues: {
11004
- first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
11005
- last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
11006
- company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
11007
- address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
11008
- address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
11009
- city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
11010
- province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
11011
- country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
11012
- postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
11013
- phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
11014
- },
11015
- resolver: zodResolver(schema$3)
11016
- });
11017
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11018
- const { handleSuccess } = useRouteModal();
11019
- const onSubmit = form.handleSubmit(async (data) => {
11020
- await mutateAsync(
11021
- { billing_address: data },
11022
- {
11023
- onSuccess: () => {
11024
- handleSuccess();
11025
- },
11026
- onError: (error) => {
11027
- toast.error(error.message);
11028
- }
11029
- }
11030
- );
11031
- });
11032
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
11033
- KeyboundForm,
11034
- {
11035
- className: "flex flex-1 flex-col overflow-hidden",
11036
- onSubmit,
11037
- children: [
11038
- /* @__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: [
11039
- /* @__PURE__ */ jsx(
11040
- Form$2.Field,
11041
- {
11042
- control: form.control,
11043
- name: "country_code",
11044
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11045
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Country" }),
11046
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
11047
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11048
- ] })
11049
- }
11050
- ),
11051
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11052
- /* @__PURE__ */ jsx(
11053
- Form$2.Field,
11054
- {
11055
- control: form.control,
11056
- name: "first_name",
11057
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11058
- /* @__PURE__ */ jsx(Form$2.Label, { children: "First name" }),
11059
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11060
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11061
- ] })
11062
- }
11063
- ),
11064
- /* @__PURE__ */ jsx(
11065
- Form$2.Field,
11066
- {
11067
- control: form.control,
11068
- name: "last_name",
11069
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11070
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Last name" }),
11071
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11072
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11073
- ] })
11074
- }
11075
- )
11076
- ] }),
11077
- /* @__PURE__ */ jsx(
11078
- Form$2.Field,
11079
- {
11080
- control: form.control,
11081
- name: "company",
11082
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11083
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Company" }),
11084
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11085
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11086
- ] })
11087
- }
11088
- ),
11089
- /* @__PURE__ */ jsx(
11090
- Form$2.Field,
11091
- {
11092
- control: form.control,
11093
- name: "address_1",
11094
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11095
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Address" }),
11096
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11097
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11098
- ] })
11099
- }
11100
- ),
11101
- /* @__PURE__ */ jsx(
11102
- Form$2.Field,
11103
- {
11104
- control: form.control,
11105
- name: "address_2",
11106
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11107
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
11108
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11109
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11110
- ] })
11111
- }
11112
- ),
11113
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11114
- /* @__PURE__ */ jsx(
11115
- Form$2.Field,
11116
- {
11117
- control: form.control,
11118
- name: "postal_code",
11119
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11120
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Postal code" }),
11121
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11122
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11123
- ] })
11124
- }
11125
- ),
11126
- /* @__PURE__ */ jsx(
11127
- Form$2.Field,
11128
- {
11129
- control: form.control,
11130
- name: "city",
11131
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11132
- /* @__PURE__ */ jsx(Form$2.Label, { children: "City" }),
11133
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11134
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11135
- ] })
11136
- }
11137
- )
11138
- ] }),
11139
- /* @__PURE__ */ jsx(
11140
- Form$2.Field,
11141
- {
11142
- control: form.control,
11143
- name: "province",
11144
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11145
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Province / State" }),
11146
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11147
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11148
- ] })
11149
- }
11150
- ),
11151
- /* @__PURE__ */ jsx(
11152
- Form$2.Field,
11153
- {
11154
- control: form.control,
11155
- name: "phone",
11156
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11157
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Phone" }),
11158
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11159
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11160
- ] })
11161
- }
11162
- )
11163
- ] }) }),
11164
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
11165
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
11166
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
11167
- ] }) })
11168
- ]
11169
- }
11170
- ) });
11171
- };
11172
- const schema$3 = addressSchema;
11173
10983
  const PROMOTION_QUERY_KEY = "promotions";
11174
10984
  const promotionsQueryKeys = {
11175
10985
  list: (query2) => [
@@ -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";
@@ -12392,7 +12202,7 @@ const ShippingAddressForm = ({ order }) => {
12392
12202
  postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
12393
12203
  phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
12394
12204
  },
12395
- resolver: zodResolver(schema$1)
12205
+ resolver: zodResolver(schema$2)
12396
12206
  });
12397
12207
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12398
12208
  const { handleSuccess } = useRouteModal();
@@ -12562,7 +12372,7 @@ const ShippingAddressForm = ({ order }) => {
12562
12372
  }
12563
12373
  ) });
12564
12374
  };
12565
- const schema$1 = addressSchema;
12375
+ const schema$2 = addressSchema;
12566
12376
  const TransferOwnership = () => {
12567
12377
  const { id } = useParams();
12568
12378
  const { draft_order, isPending, isError, error } = useDraftOrder(id, {
@@ -12586,7 +12396,7 @@ const TransferOwnershipForm = ({ order }) => {
12586
12396
  defaultValues: {
12587
12397
  customer_id: order.customer_id || ""
12588
12398
  },
12589
- resolver: zodResolver(schema)
12399
+ resolver: zodResolver(schema$1)
12590
12400
  });
12591
12401
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12592
12402
  const { handleSuccess } = useRouteModal();
@@ -13036,9 +12846,199 @@ const Illustration = () => {
13036
12846
  }
13037
12847
  );
13038
12848
  };
13039
- const schema = objectType({
12849
+ const schema$1 = objectType({
13040
12850
  customer_id: stringType().min(1)
13041
12851
  });
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
+ const schema = addressSchema;
13042
13042
  const widgetModule = { widgets: [] };
13043
13043
  const routeModule = {
13044
13044
  routes: [
@@ -13075,10 +13075,6 @@ const routeModule = {
13075
13075
  Component: Metadata,
13076
13076
  path: "/draft-orders/:id/metadata"
13077
13077
  },
13078
- {
13079
- Component: BillingAddress,
13080
- path: "/draft-orders/:id/billing-address"
13081
- },
13082
13078
  {
13083
13079
  Component: Promotions,
13084
13080
  path: "/draft-orders/:id/promotions"
@@ -13098,6 +13094,10 @@ const routeModule = {
13098
13094
  {
13099
13095
  Component: TransferOwnership,
13100
13096
  path: "/draft-orders/:id/transfer-ownership"
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-snapshot-20251013091555",
3
+ "version": "2.10.4-snapshot-20251013120621",
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-snapshot-20251013091555",
39
+ "@medusajs/js-sdk": "2.10.4-snapshot-20251013120621",
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-snapshot-20251013091555",
49
- "@medusajs/cli": "2.10.4-snapshot-20251013091555",
50
- "@medusajs/framework": "2.10.4-snapshot-20251013091555",
51
- "@medusajs/icons": "2.10.4-snapshot-20251013091555",
52
- "@medusajs/test-utils": "2.10.4-snapshot-20251013091555",
53
- "@medusajs/types": "2.10.4-snapshot-20251013091555",
54
- "@medusajs/ui": "4.0.24-snapshot-20251013091555",
55
- "@medusajs/ui-preset": "2.10.4-snapshot-20251013091555",
48
+ "@medusajs/admin-sdk": "2.10.4-snapshot-20251013120621",
49
+ "@medusajs/cli": "2.10.4-snapshot-20251013120621",
50
+ "@medusajs/framework": "2.10.4-snapshot-20251013120621",
51
+ "@medusajs/icons": "2.10.4-snapshot-20251013120621",
52
+ "@medusajs/test-utils": "2.10.4-snapshot-20251013120621",
53
+ "@medusajs/types": "2.10.4-snapshot-20251013120621",
54
+ "@medusajs/ui": "4.0.24-snapshot-20251013120621",
55
+ "@medusajs/ui-preset": "2.10.4-snapshot-20251013120621",
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-snapshot-20251013091555",
73
- "@medusajs/cli": "2.10.4-snapshot-20251013091555",
74
- "@medusajs/framework": "2.10.4-snapshot-20251013091555",
75
- "@medusajs/icons": "2.10.4-snapshot-20251013091555",
76
- "@medusajs/test-utils": "2.10.4-snapshot-20251013091555",
77
- "@medusajs/ui": "4.0.24-snapshot-20251013091555",
72
+ "@medusajs/admin-sdk": "2.10.4-snapshot-20251013120621",
73
+ "@medusajs/cli": "2.10.4-snapshot-20251013120621",
74
+ "@medusajs/framework": "2.10.4-snapshot-20251013120621",
75
+ "@medusajs/icons": "2.10.4-snapshot-20251013120621",
76
+ "@medusajs/test-utils": "2.10.4-snapshot-20251013120621",
77
+ "@medusajs/ui": "4.0.24-snapshot-20251013120621",
78
78
  "lodash": "^4.17.21",
79
79
  "react-router-dom": "6.20.1"
80
80
  },