@medusajs/draft-order 2.10.2-preview-20250903180151 → 2.10.2-preview-20250904000308

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.
@@ -11250,196 +11250,6 @@ function getPromotionCodes(items, shippingMethods) {
11250
11250
  }
11251
11251
  return Array.from(codes);
11252
11252
  }
11253
- const BillingAddress = () => {
11254
- const { id } = reactRouterDom.useParams();
11255
- const { order, isPending, isError, error } = useOrder(id, {
11256
- fields: "+billing_address"
11257
- });
11258
- if (isError) {
11259
- throw error;
11260
- }
11261
- const isReady = !isPending && !!order;
11262
- return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
11263
- /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
11264
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Billing Address" }) }),
11265
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
11266
- ] }),
11267
- isReady && /* @__PURE__ */ jsxRuntime.jsx(BillingAddressForm, { order })
11268
- ] });
11269
- };
11270
- const BillingAddressForm = ({ order }) => {
11271
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
11272
- const form = reactHookForm.useForm({
11273
- defaultValues: {
11274
- first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
11275
- last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
11276
- company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
11277
- address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
11278
- address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
11279
- city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
11280
- province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
11281
- country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
11282
- postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
11283
- phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
11284
- },
11285
- resolver: zod.zodResolver(schema$3)
11286
- });
11287
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11288
- const { handleSuccess } = useRouteModal();
11289
- const onSubmit = form.handleSubmit(async (data) => {
11290
- await mutateAsync(
11291
- { billing_address: data },
11292
- {
11293
- onSuccess: () => {
11294
- handleSuccess();
11295
- },
11296
- onError: (error) => {
11297
- ui.toast.error(error.message);
11298
- }
11299
- }
11300
- );
11301
- });
11302
- return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
11303
- KeyboundForm,
11304
- {
11305
- className: "flex flex-1 flex-col overflow-hidden",
11306
- onSubmit,
11307
- children: [
11308
- /* @__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: [
11309
- /* @__PURE__ */ jsxRuntime.jsx(
11310
- Form$2.Field,
11311
- {
11312
- control: form.control,
11313
- name: "country_code",
11314
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11315
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Country" }),
11316
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(CountrySelect, { ...field }) }),
11317
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11318
- ] })
11319
- }
11320
- ),
11321
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11322
- /* @__PURE__ */ jsxRuntime.jsx(
11323
- Form$2.Field,
11324
- {
11325
- control: form.control,
11326
- name: "first_name",
11327
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11328
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "First name" }),
11329
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11330
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11331
- ] })
11332
- }
11333
- ),
11334
- /* @__PURE__ */ jsxRuntime.jsx(
11335
- Form$2.Field,
11336
- {
11337
- control: form.control,
11338
- name: "last_name",
11339
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11340
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Last name" }),
11341
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11342
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11343
- ] })
11344
- }
11345
- )
11346
- ] }),
11347
- /* @__PURE__ */ jsxRuntime.jsx(
11348
- Form$2.Field,
11349
- {
11350
- control: form.control,
11351
- name: "company",
11352
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11353
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Company" }),
11354
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11355
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11356
- ] })
11357
- }
11358
- ),
11359
- /* @__PURE__ */ jsxRuntime.jsx(
11360
- Form$2.Field,
11361
- {
11362
- control: form.control,
11363
- name: "address_1",
11364
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11365
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Address" }),
11366
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11367
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11368
- ] })
11369
- }
11370
- ),
11371
- /* @__PURE__ */ jsxRuntime.jsx(
11372
- Form$2.Field,
11373
- {
11374
- control: form.control,
11375
- name: "address_2",
11376
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11377
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
11378
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11379
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11380
- ] })
11381
- }
11382
- ),
11383
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11384
- /* @__PURE__ */ jsxRuntime.jsx(
11385
- Form$2.Field,
11386
- {
11387
- control: form.control,
11388
- name: "postal_code",
11389
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11390
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Postal code" }),
11391
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11392
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11393
- ] })
11394
- }
11395
- ),
11396
- /* @__PURE__ */ jsxRuntime.jsx(
11397
- Form$2.Field,
11398
- {
11399
- control: form.control,
11400
- name: "city",
11401
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11402
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "City" }),
11403
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11404
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11405
- ] })
11406
- }
11407
- )
11408
- ] }),
11409
- /* @__PURE__ */ jsxRuntime.jsx(
11410
- Form$2.Field,
11411
- {
11412
- control: form.control,
11413
- name: "province",
11414
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11415
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Province / State" }),
11416
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11417
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11418
- ] })
11419
- }
11420
- ),
11421
- /* @__PURE__ */ jsxRuntime.jsx(
11422
- Form$2.Field,
11423
- {
11424
- control: form.control,
11425
- name: "phone",
11426
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11427
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Phone" }),
11428
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11429
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11430
- ] })
11431
- }
11432
- )
11433
- ] }) }),
11434
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
11435
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
11436
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
11437
- ] }) })
11438
- ]
11439
- }
11440
- ) });
11441
- };
11442
- const schema$3 = addressSchema;
11443
11253
  const SalesChannel = () => {
11444
11254
  const { id } = reactRouterDom.useParams();
11445
11255
  const { draft_order, isPending, isError, error } = useDraftOrder(
@@ -11468,7 +11278,7 @@ const SalesChannelForm = ({ order }) => {
11468
11278
  defaultValues: {
11469
11279
  sales_channel_id: order.sales_channel_id || ""
11470
11280
  },
11471
- resolver: zod.zodResolver(schema$2)
11281
+ resolver: zod.zodResolver(schema$3)
11472
11282
  });
11473
11283
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11474
11284
  const { handleSuccess } = useRouteModal();
@@ -11543,7 +11353,7 @@ const SalesChannelField = ({ control, order }) => {
11543
11353
  }
11544
11354
  );
11545
11355
  };
11546
- const schema$2 = objectType({
11356
+ const schema$3 = objectType({
11547
11357
  sales_channel_id: stringType().min(1)
11548
11358
  });
11549
11359
  const STACKED_FOCUS_MODAL_ID = "shipping-form";
@@ -12385,7 +12195,7 @@ const ShippingAddressForm = ({ order }) => {
12385
12195
  postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
12386
12196
  phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
12387
12197
  },
12388
- resolver: zod.zodResolver(schema$1)
12198
+ resolver: zod.zodResolver(schema$2)
12389
12199
  });
12390
12200
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12391
12201
  const { handleSuccess } = useRouteModal();
@@ -12555,7 +12365,7 @@ const ShippingAddressForm = ({ order }) => {
12555
12365
  }
12556
12366
  ) });
12557
12367
  };
12558
- const schema$1 = addressSchema;
12368
+ const schema$2 = addressSchema;
12559
12369
  const TransferOwnership = () => {
12560
12370
  const { id } = reactRouterDom.useParams();
12561
12371
  const { draft_order, isPending, isError, error } = useDraftOrder(id, {
@@ -12579,7 +12389,7 @@ const TransferOwnershipForm = ({ order }) => {
12579
12389
  defaultValues: {
12580
12390
  customer_id: order.customer_id || ""
12581
12391
  },
12582
- resolver: zod.zodResolver(schema)
12392
+ resolver: zod.zodResolver(schema$1)
12583
12393
  });
12584
12394
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12585
12395
  const { handleSuccess } = useRouteModal();
@@ -13029,9 +12839,199 @@ const Illustration = () => {
13029
12839
  }
13030
12840
  );
13031
12841
  };
13032
- const schema = objectType({
12842
+ const schema$1 = objectType({
13033
12843
  customer_id: stringType().min(1)
13034
12844
  });
12845
+ const BillingAddress = () => {
12846
+ const { id } = reactRouterDom.useParams();
12847
+ const { order, isPending, isError, error } = useOrder(id, {
12848
+ fields: "+billing_address"
12849
+ });
12850
+ if (isError) {
12851
+ throw error;
12852
+ }
12853
+ const isReady = !isPending && !!order;
12854
+ return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
12855
+ /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
12856
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Billing Address" }) }),
12857
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
12858
+ ] }),
12859
+ isReady && /* @__PURE__ */ jsxRuntime.jsx(BillingAddressForm, { order })
12860
+ ] });
12861
+ };
12862
+ const BillingAddressForm = ({ order }) => {
12863
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
12864
+ const form = reactHookForm.useForm({
12865
+ defaultValues: {
12866
+ first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
12867
+ last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
12868
+ company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
12869
+ address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
12870
+ address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
12871
+ city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
12872
+ province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
12873
+ country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
12874
+ postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
12875
+ phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
12876
+ },
12877
+ resolver: zod.zodResolver(schema)
12878
+ });
12879
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12880
+ const { handleSuccess } = useRouteModal();
12881
+ const onSubmit = form.handleSubmit(async (data) => {
12882
+ await mutateAsync(
12883
+ { billing_address: data },
12884
+ {
12885
+ onSuccess: () => {
12886
+ handleSuccess();
12887
+ },
12888
+ onError: (error) => {
12889
+ ui.toast.error(error.message);
12890
+ }
12891
+ }
12892
+ );
12893
+ });
12894
+ return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
12895
+ KeyboundForm,
12896
+ {
12897
+ className: "flex flex-1 flex-col overflow-hidden",
12898
+ onSubmit,
12899
+ children: [
12900
+ /* @__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: [
12901
+ /* @__PURE__ */ jsxRuntime.jsx(
12902
+ Form$2.Field,
12903
+ {
12904
+ control: form.control,
12905
+ name: "country_code",
12906
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12907
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Country" }),
12908
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(CountrySelect, { ...field }) }),
12909
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12910
+ ] })
12911
+ }
12912
+ ),
12913
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12914
+ /* @__PURE__ */ jsxRuntime.jsx(
12915
+ Form$2.Field,
12916
+ {
12917
+ control: form.control,
12918
+ name: "first_name",
12919
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12920
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "First name" }),
12921
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12922
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12923
+ ] })
12924
+ }
12925
+ ),
12926
+ /* @__PURE__ */ jsxRuntime.jsx(
12927
+ Form$2.Field,
12928
+ {
12929
+ control: form.control,
12930
+ name: "last_name",
12931
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12932
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Last name" }),
12933
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12934
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12935
+ ] })
12936
+ }
12937
+ )
12938
+ ] }),
12939
+ /* @__PURE__ */ jsxRuntime.jsx(
12940
+ Form$2.Field,
12941
+ {
12942
+ control: form.control,
12943
+ name: "company",
12944
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12945
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Company" }),
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
+ /* @__PURE__ */ jsxRuntime.jsx(
12952
+ Form$2.Field,
12953
+ {
12954
+ control: form.control,
12955
+ name: "address_1",
12956
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12957
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Address" }),
12958
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12959
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12960
+ ] })
12961
+ }
12962
+ ),
12963
+ /* @__PURE__ */ jsxRuntime.jsx(
12964
+ Form$2.Field,
12965
+ {
12966
+ control: form.control,
12967
+ name: "address_2",
12968
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12969
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
12970
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12971
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12972
+ ] })
12973
+ }
12974
+ ),
12975
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12976
+ /* @__PURE__ */ jsxRuntime.jsx(
12977
+ Form$2.Field,
12978
+ {
12979
+ control: form.control,
12980
+ name: "postal_code",
12981
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12982
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Postal code" }),
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.jsx(
12989
+ Form$2.Field,
12990
+ {
12991
+ control: form.control,
12992
+ name: "city",
12993
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12994
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "City" }),
12995
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12996
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12997
+ ] })
12998
+ }
12999
+ )
13000
+ ] }),
13001
+ /* @__PURE__ */ jsxRuntime.jsx(
13002
+ Form$2.Field,
13003
+ {
13004
+ control: form.control,
13005
+ name: "province",
13006
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
13007
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Province / State" }),
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
+ /* @__PURE__ */ jsxRuntime.jsx(
13014
+ Form$2.Field,
13015
+ {
13016
+ control: form.control,
13017
+ name: "phone",
13018
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
13019
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Phone" }),
13020
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
13021
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
13022
+ ] })
13023
+ }
13024
+ )
13025
+ ] }) }),
13026
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
13027
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
13028
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
13029
+ ] }) })
13030
+ ]
13031
+ }
13032
+ ) });
13033
+ };
13034
+ const schema = addressSchema;
13035
13035
  const widgetModule = { widgets: [] };
13036
13036
  const routeModule = {
13037
13037
  routes: [
@@ -13072,10 +13072,6 @@ const routeModule = {
13072
13072
  Component: Promotions,
13073
13073
  path: "/draft-orders/:id/promotions"
13074
13074
  },
13075
- {
13076
- Component: BillingAddress,
13077
- path: "/draft-orders/:id/billing-address"
13078
- },
13079
13075
  {
13080
13076
  Component: SalesChannel,
13081
13077
  path: "/draft-orders/:id/sales-channel"
@@ -13091,6 +13087,10 @@ const routeModule = {
13091
13087
  {
13092
13088
  Component: TransferOwnership,
13093
13089
  path: "/draft-orders/:id/transfer-ownership"
13090
+ },
13091
+ {
13092
+ Component: BillingAddress,
13093
+ path: "/draft-orders/:id/billing-address"
13094
13094
  }
13095
13095
  ]
13096
13096
  }
@@ -11244,196 +11244,6 @@ function getPromotionCodes(items, shippingMethods) {
11244
11244
  }
11245
11245
  return Array.from(codes);
11246
11246
  }
11247
- const BillingAddress = () => {
11248
- const { id } = useParams();
11249
- const { order, isPending, isError, error } = useOrder(id, {
11250
- fields: "+billing_address"
11251
- });
11252
- if (isError) {
11253
- throw error;
11254
- }
11255
- const isReady = !isPending && !!order;
11256
- return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
11257
- /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
11258
- /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Billing Address" }) }),
11259
- /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
11260
- ] }),
11261
- isReady && /* @__PURE__ */ jsx(BillingAddressForm, { order })
11262
- ] });
11263
- };
11264
- const BillingAddressForm = ({ order }) => {
11265
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
11266
- const form = useForm({
11267
- defaultValues: {
11268
- first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
11269
- last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
11270
- company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
11271
- address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
11272
- address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
11273
- city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
11274
- province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
11275
- country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
11276
- postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
11277
- phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
11278
- },
11279
- resolver: zodResolver(schema$3)
11280
- });
11281
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11282
- const { handleSuccess } = useRouteModal();
11283
- const onSubmit = form.handleSubmit(async (data) => {
11284
- await mutateAsync(
11285
- { billing_address: data },
11286
- {
11287
- onSuccess: () => {
11288
- handleSuccess();
11289
- },
11290
- onError: (error) => {
11291
- toast.error(error.message);
11292
- }
11293
- }
11294
- );
11295
- });
11296
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
11297
- KeyboundForm,
11298
- {
11299
- className: "flex flex-1 flex-col overflow-hidden",
11300
- onSubmit,
11301
- children: [
11302
- /* @__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: [
11303
- /* @__PURE__ */ jsx(
11304
- Form$2.Field,
11305
- {
11306
- control: form.control,
11307
- name: "country_code",
11308
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11309
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Country" }),
11310
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
11311
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11312
- ] })
11313
- }
11314
- ),
11315
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11316
- /* @__PURE__ */ jsx(
11317
- Form$2.Field,
11318
- {
11319
- control: form.control,
11320
- name: "first_name",
11321
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11322
- /* @__PURE__ */ jsx(Form$2.Label, { children: "First name" }),
11323
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11324
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11325
- ] })
11326
- }
11327
- ),
11328
- /* @__PURE__ */ jsx(
11329
- Form$2.Field,
11330
- {
11331
- control: form.control,
11332
- name: "last_name",
11333
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11334
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Last name" }),
11335
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11336
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11337
- ] })
11338
- }
11339
- )
11340
- ] }),
11341
- /* @__PURE__ */ jsx(
11342
- Form$2.Field,
11343
- {
11344
- control: form.control,
11345
- name: "company",
11346
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11347
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Company" }),
11348
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11349
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11350
- ] })
11351
- }
11352
- ),
11353
- /* @__PURE__ */ jsx(
11354
- Form$2.Field,
11355
- {
11356
- control: form.control,
11357
- name: "address_1",
11358
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11359
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Address" }),
11360
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11361
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11362
- ] })
11363
- }
11364
- ),
11365
- /* @__PURE__ */ jsx(
11366
- Form$2.Field,
11367
- {
11368
- control: form.control,
11369
- name: "address_2",
11370
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11371
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
11372
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11373
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11374
- ] })
11375
- }
11376
- ),
11377
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11378
- /* @__PURE__ */ jsx(
11379
- Form$2.Field,
11380
- {
11381
- control: form.control,
11382
- name: "postal_code",
11383
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11384
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Postal code" }),
11385
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11386
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11387
- ] })
11388
- }
11389
- ),
11390
- /* @__PURE__ */ jsx(
11391
- Form$2.Field,
11392
- {
11393
- control: form.control,
11394
- name: "city",
11395
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11396
- /* @__PURE__ */ jsx(Form$2.Label, { children: "City" }),
11397
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11398
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11399
- ] })
11400
- }
11401
- )
11402
- ] }),
11403
- /* @__PURE__ */ jsx(
11404
- Form$2.Field,
11405
- {
11406
- control: form.control,
11407
- name: "province",
11408
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11409
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Province / State" }),
11410
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11411
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11412
- ] })
11413
- }
11414
- ),
11415
- /* @__PURE__ */ jsx(
11416
- Form$2.Field,
11417
- {
11418
- control: form.control,
11419
- name: "phone",
11420
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11421
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Phone" }),
11422
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11423
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11424
- ] })
11425
- }
11426
- )
11427
- ] }) }),
11428
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
11429
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
11430
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
11431
- ] }) })
11432
- ]
11433
- }
11434
- ) });
11435
- };
11436
- const schema$3 = addressSchema;
11437
11247
  const SalesChannel = () => {
11438
11248
  const { id } = useParams();
11439
11249
  const { draft_order, isPending, isError, error } = useDraftOrder(
@@ -11462,7 +11272,7 @@ const SalesChannelForm = ({ order }) => {
11462
11272
  defaultValues: {
11463
11273
  sales_channel_id: order.sales_channel_id || ""
11464
11274
  },
11465
- resolver: zodResolver(schema$2)
11275
+ resolver: zodResolver(schema$3)
11466
11276
  });
11467
11277
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11468
11278
  const { handleSuccess } = useRouteModal();
@@ -11537,7 +11347,7 @@ const SalesChannelField = ({ control, order }) => {
11537
11347
  }
11538
11348
  );
11539
11349
  };
11540
- const schema$2 = objectType({
11350
+ const schema$3 = objectType({
11541
11351
  sales_channel_id: stringType().min(1)
11542
11352
  });
11543
11353
  const STACKED_FOCUS_MODAL_ID = "shipping-form";
@@ -12379,7 +12189,7 @@ const ShippingAddressForm = ({ order }) => {
12379
12189
  postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
12380
12190
  phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
12381
12191
  },
12382
- resolver: zodResolver(schema$1)
12192
+ resolver: zodResolver(schema$2)
12383
12193
  });
12384
12194
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12385
12195
  const { handleSuccess } = useRouteModal();
@@ -12549,7 +12359,7 @@ const ShippingAddressForm = ({ order }) => {
12549
12359
  }
12550
12360
  ) });
12551
12361
  };
12552
- const schema$1 = addressSchema;
12362
+ const schema$2 = addressSchema;
12553
12363
  const TransferOwnership = () => {
12554
12364
  const { id } = useParams();
12555
12365
  const { draft_order, isPending, isError, error } = useDraftOrder(id, {
@@ -12573,7 +12383,7 @@ const TransferOwnershipForm = ({ order }) => {
12573
12383
  defaultValues: {
12574
12384
  customer_id: order.customer_id || ""
12575
12385
  },
12576
- resolver: zodResolver(schema)
12386
+ resolver: zodResolver(schema$1)
12577
12387
  });
12578
12388
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12579
12389
  const { handleSuccess } = useRouteModal();
@@ -13023,9 +12833,199 @@ const Illustration = () => {
13023
12833
  }
13024
12834
  );
13025
12835
  };
13026
- const schema = objectType({
12836
+ const schema$1 = objectType({
13027
12837
  customer_id: stringType().min(1)
13028
12838
  });
12839
+ const BillingAddress = () => {
12840
+ const { id } = useParams();
12841
+ const { order, isPending, isError, error } = useOrder(id, {
12842
+ fields: "+billing_address"
12843
+ });
12844
+ if (isError) {
12845
+ throw error;
12846
+ }
12847
+ const isReady = !isPending && !!order;
12848
+ return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
12849
+ /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
12850
+ /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Billing Address" }) }),
12851
+ /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
12852
+ ] }),
12853
+ isReady && /* @__PURE__ */ jsx(BillingAddressForm, { order })
12854
+ ] });
12855
+ };
12856
+ const BillingAddressForm = ({ order }) => {
12857
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
12858
+ const form = useForm({
12859
+ defaultValues: {
12860
+ first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
12861
+ last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
12862
+ company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
12863
+ address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
12864
+ address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
12865
+ city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
12866
+ province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
12867
+ country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
12868
+ postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
12869
+ phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
12870
+ },
12871
+ resolver: zodResolver(schema)
12872
+ });
12873
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12874
+ const { handleSuccess } = useRouteModal();
12875
+ const onSubmit = form.handleSubmit(async (data) => {
12876
+ await mutateAsync(
12877
+ { billing_address: data },
12878
+ {
12879
+ onSuccess: () => {
12880
+ handleSuccess();
12881
+ },
12882
+ onError: (error) => {
12883
+ toast.error(error.message);
12884
+ }
12885
+ }
12886
+ );
12887
+ });
12888
+ return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
12889
+ KeyboundForm,
12890
+ {
12891
+ className: "flex flex-1 flex-col overflow-hidden",
12892
+ onSubmit,
12893
+ children: [
12894
+ /* @__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: [
12895
+ /* @__PURE__ */ jsx(
12896
+ Form$2.Field,
12897
+ {
12898
+ control: form.control,
12899
+ name: "country_code",
12900
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12901
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Country" }),
12902
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
12903
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12904
+ ] })
12905
+ }
12906
+ ),
12907
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12908
+ /* @__PURE__ */ jsx(
12909
+ Form$2.Field,
12910
+ {
12911
+ control: form.control,
12912
+ name: "first_name",
12913
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12914
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "First name" }),
12915
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12916
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12917
+ ] })
12918
+ }
12919
+ ),
12920
+ /* @__PURE__ */ jsx(
12921
+ Form$2.Field,
12922
+ {
12923
+ control: form.control,
12924
+ name: "last_name",
12925
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12926
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Last name" }),
12927
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12928
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12929
+ ] })
12930
+ }
12931
+ )
12932
+ ] }),
12933
+ /* @__PURE__ */ jsx(
12934
+ Form$2.Field,
12935
+ {
12936
+ control: form.control,
12937
+ name: "company",
12938
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12939
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Company" }),
12940
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12941
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12942
+ ] })
12943
+ }
12944
+ ),
12945
+ /* @__PURE__ */ jsx(
12946
+ Form$2.Field,
12947
+ {
12948
+ control: form.control,
12949
+ name: "address_1",
12950
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12951
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Address" }),
12952
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12953
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12954
+ ] })
12955
+ }
12956
+ ),
12957
+ /* @__PURE__ */ jsx(
12958
+ Form$2.Field,
12959
+ {
12960
+ control: form.control,
12961
+ name: "address_2",
12962
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12963
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
12964
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12965
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12966
+ ] })
12967
+ }
12968
+ ),
12969
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12970
+ /* @__PURE__ */ jsx(
12971
+ Form$2.Field,
12972
+ {
12973
+ control: form.control,
12974
+ name: "postal_code",
12975
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12976
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Postal code" }),
12977
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12978
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12979
+ ] })
12980
+ }
12981
+ ),
12982
+ /* @__PURE__ */ jsx(
12983
+ Form$2.Field,
12984
+ {
12985
+ control: form.control,
12986
+ name: "city",
12987
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12988
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "City" }),
12989
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12990
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12991
+ ] })
12992
+ }
12993
+ )
12994
+ ] }),
12995
+ /* @__PURE__ */ jsx(
12996
+ Form$2.Field,
12997
+ {
12998
+ control: form.control,
12999
+ name: "province",
13000
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
13001
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Province / State" }),
13002
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
13003
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
13004
+ ] })
13005
+ }
13006
+ ),
13007
+ /* @__PURE__ */ jsx(
13008
+ Form$2.Field,
13009
+ {
13010
+ control: form.control,
13011
+ name: "phone",
13012
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
13013
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Phone" }),
13014
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
13015
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
13016
+ ] })
13017
+ }
13018
+ )
13019
+ ] }) }),
13020
+ /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
13021
+ /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
13022
+ /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
13023
+ ] }) })
13024
+ ]
13025
+ }
13026
+ ) });
13027
+ };
13028
+ const schema = addressSchema;
13029
13029
  const widgetModule = { widgets: [] };
13030
13030
  const routeModule = {
13031
13031
  routes: [
@@ -13066,10 +13066,6 @@ const routeModule = {
13066
13066
  Component: Promotions,
13067
13067
  path: "/draft-orders/:id/promotions"
13068
13068
  },
13069
- {
13070
- Component: BillingAddress,
13071
- path: "/draft-orders/:id/billing-address"
13072
- },
13073
13069
  {
13074
13070
  Component: SalesChannel,
13075
13071
  path: "/draft-orders/:id/sales-channel"
@@ -13085,6 +13081,10 @@ const routeModule = {
13085
13081
  {
13086
13082
  Component: TransferOwnership,
13087
13083
  path: "/draft-orders/:id/transfer-ownership"
13084
+ },
13085
+ {
13086
+ Component: BillingAddress,
13087
+ path: "/draft-orders/:id/billing-address"
13088
13088
  }
13089
13089
  ]
13090
13090
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/draft-order",
3
- "version": "2.10.2-preview-20250903180151",
3
+ "version": "2.10.2-preview-20250904000308",
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.2-preview-20250903180151",
39
+ "@medusajs/js-sdk": "2.10.2-preview-20250904000308",
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.2-preview-20250903180151",
49
- "@medusajs/cli": "2.10.2-preview-20250903180151",
50
- "@medusajs/framework": "2.10.2-preview-20250903180151",
51
- "@medusajs/icons": "2.10.2-preview-20250903180151",
52
- "@medusajs/test-utils": "2.10.2-preview-20250903180151",
53
- "@medusajs/types": "2.10.2-preview-20250903180151",
54
- "@medusajs/ui": "4.0.22-preview-20250903180151",
55
- "@medusajs/ui-preset": "2.10.2-preview-20250903180151",
48
+ "@medusajs/admin-sdk": "2.10.2-preview-20250904000308",
49
+ "@medusajs/cli": "2.10.2-preview-20250904000308",
50
+ "@medusajs/framework": "2.10.2-preview-20250904000308",
51
+ "@medusajs/icons": "2.10.2-preview-20250904000308",
52
+ "@medusajs/test-utils": "2.10.2-preview-20250904000308",
53
+ "@medusajs/types": "2.10.2-preview-20250904000308",
54
+ "@medusajs/ui": "4.0.22-preview-20250904000308",
55
+ "@medusajs/ui-preset": "2.10.2-preview-20250904000308",
56
56
  "@mikro-orm/cli": "6.4.3",
57
57
  "@mikro-orm/core": "6.4.3",
58
58
  "@mikro-orm/knex": "6.4.3",
@@ -76,12 +76,12 @@
76
76
  "yalc": "^1.0.0-pre.53"
77
77
  },
78
78
  "peerDependencies": {
79
- "@medusajs/admin-sdk": "2.10.2-preview-20250903180151",
80
- "@medusajs/cli": "2.10.2-preview-20250903180151",
81
- "@medusajs/framework": "2.10.2-preview-20250903180151",
82
- "@medusajs/icons": "2.10.2-preview-20250903180151",
83
- "@medusajs/test-utils": "2.10.2-preview-20250903180151",
84
- "@medusajs/ui": "4.0.22-preview-20250903180151",
79
+ "@medusajs/admin-sdk": "2.10.2-preview-20250904000308",
80
+ "@medusajs/cli": "2.10.2-preview-20250904000308",
81
+ "@medusajs/framework": "2.10.2-preview-20250904000308",
82
+ "@medusajs/icons": "2.10.2-preview-20250904000308",
83
+ "@medusajs/test-utils": "2.10.2-preview-20250904000308",
84
+ "@medusajs/ui": "4.0.22-preview-20250904000308",
85
85
  "@mikro-orm/cli": "6.4.3",
86
86
  "@mikro-orm/core": "6.4.3",
87
87
  "@mikro-orm/knex": "6.4.3",