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

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.
@@ -9560,196 +9560,6 @@ const ID = () => {
9560
9560
  /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Outlet, {})
9561
9561
  ] });
9562
9562
  };
9563
- const BillingAddress = () => {
9564
- const { id } = reactRouterDom.useParams();
9565
- const { order, isPending, isError, error } = useOrder(id, {
9566
- fields: "+billing_address"
9567
- });
9568
- if (isError) {
9569
- throw error;
9570
- }
9571
- const isReady = !isPending && !!order;
9572
- return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
9573
- /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
9574
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Billing Address" }) }),
9575
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
9576
- ] }),
9577
- isReady && /* @__PURE__ */ jsxRuntime.jsx(BillingAddressForm, { order })
9578
- ] });
9579
- };
9580
- const BillingAddressForm = ({ order }) => {
9581
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
9582
- const form = reactHookForm.useForm({
9583
- defaultValues: {
9584
- first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
9585
- last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
9586
- company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
9587
- address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
9588
- address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
9589
- city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
9590
- province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
9591
- country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
9592
- postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
9593
- phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
9594
- },
9595
- resolver: zod.zodResolver(schema$5)
9596
- });
9597
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9598
- const { handleSuccess } = useRouteModal();
9599
- const onSubmit = form.handleSubmit(async (data) => {
9600
- await mutateAsync(
9601
- { billing_address: data },
9602
- {
9603
- onSuccess: () => {
9604
- handleSuccess();
9605
- },
9606
- onError: (error) => {
9607
- ui.toast.error(error.message);
9608
- }
9609
- }
9610
- );
9611
- });
9612
- return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
9613
- KeyboundForm,
9614
- {
9615
- className: "flex flex-1 flex-col overflow-hidden",
9616
- onSubmit,
9617
- children: [
9618
- /* @__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: [
9619
- /* @__PURE__ */ jsxRuntime.jsx(
9620
- Form$2.Field,
9621
- {
9622
- control: form.control,
9623
- name: "country_code",
9624
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9625
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Country" }),
9626
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(CountrySelect, { ...field }) }),
9627
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9628
- ] })
9629
- }
9630
- ),
9631
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
9632
- /* @__PURE__ */ jsxRuntime.jsx(
9633
- Form$2.Field,
9634
- {
9635
- control: form.control,
9636
- name: "first_name",
9637
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9638
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "First name" }),
9639
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9640
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9641
- ] })
9642
- }
9643
- ),
9644
- /* @__PURE__ */ jsxRuntime.jsx(
9645
- Form$2.Field,
9646
- {
9647
- control: form.control,
9648
- name: "last_name",
9649
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9650
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Last 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
- ] }),
9657
- /* @__PURE__ */ jsxRuntime.jsx(
9658
- Form$2.Field,
9659
- {
9660
- control: form.control,
9661
- name: "company",
9662
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9663
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Company" }),
9664
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9665
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9666
- ] })
9667
- }
9668
- ),
9669
- /* @__PURE__ */ jsxRuntime.jsx(
9670
- Form$2.Field,
9671
- {
9672
- control: form.control,
9673
- name: "address_1",
9674
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9675
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Address" }),
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_2",
9686
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9687
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
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.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
9694
- /* @__PURE__ */ jsxRuntime.jsx(
9695
- Form$2.Field,
9696
- {
9697
- control: form.control,
9698
- name: "postal_code",
9699
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9700
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Postal code" }),
9701
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9702
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9703
- ] })
9704
- }
9705
- ),
9706
- /* @__PURE__ */ jsxRuntime.jsx(
9707
- Form$2.Field,
9708
- {
9709
- control: form.control,
9710
- name: "city",
9711
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9712
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "City" }),
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
- ] }),
9719
- /* @__PURE__ */ jsxRuntime.jsx(
9720
- Form$2.Field,
9721
- {
9722
- control: form.control,
9723
- name: "province",
9724
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9725
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Province / State" }),
9726
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9727
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9728
- ] })
9729
- }
9730
- ),
9731
- /* @__PURE__ */ jsxRuntime.jsx(
9732
- Form$2.Field,
9733
- {
9734
- control: form.control,
9735
- name: "phone",
9736
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9737
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Phone" }),
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
- ] }) }),
9744
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
9745
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9746
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
9747
- ] }) })
9748
- ]
9749
- }
9750
- ) });
9751
- };
9752
- const schema$5 = addressSchema;
9753
9563
  const CustomItems = () => {
9754
9564
  return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
9755
9565
  /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Custom Items" }) }) }),
@@ -9758,7 +9568,7 @@ const CustomItems = () => {
9758
9568
  };
9759
9569
  const CustomItemsForm = () => {
9760
9570
  const form = reactHookForm.useForm({
9761
- resolver: zod.zodResolver(schema$4)
9571
+ resolver: zod.zodResolver(schema$5)
9762
9572
  });
9763
9573
  return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
9764
9574
  /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, {}),
@@ -9768,7 +9578,7 @@ const CustomItemsForm = () => {
9768
9578
  ] }) })
9769
9579
  ] }) });
9770
9580
  };
9771
- const schema$4 = objectType({
9581
+ const schema$5 = objectType({
9772
9582
  email: stringType().email()
9773
9583
  });
9774
9584
  const Email = () => {
@@ -9793,7 +9603,7 @@ const EmailForm = ({ order }) => {
9793
9603
  defaultValues: {
9794
9604
  email: order.email ?? ""
9795
9605
  },
9796
- resolver: zod.zodResolver(schema$3)
9606
+ resolver: zod.zodResolver(schema$4)
9797
9607
  });
9798
9608
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9799
9609
  const { handleSuccess } = useRouteModal();
@@ -9836,7 +9646,7 @@ const EmailForm = ({ order }) => {
9836
9646
  }
9837
9647
  ) });
9838
9648
  };
9839
- const schema$3 = objectType({
9649
+ const schema$4 = objectType({
9840
9650
  email: stringType().email()
9841
9651
  });
9842
9652
  const NumberInput = React.forwardRef(
@@ -11440,6 +11250,196 @@ function getPromotionCodes(items, shippingMethods) {
11440
11250
  }
11441
11251
  return Array.from(codes);
11442
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
11443
  const SalesChannel = () => {
11444
11444
  const { id } = reactRouterDom.useParams();
11445
11445
  const { draft_order, isPending, isError, error } = useDraftOrder(
@@ -13052,10 +13052,6 @@ const routeModule = {
13052
13052
  handle,
13053
13053
  loader,
13054
13054
  children: [
13055
- {
13056
- Component: BillingAddress,
13057
- path: "/draft-orders/:id/billing-address"
13058
- },
13059
13055
  {
13060
13056
  Component: CustomItems,
13061
13057
  path: "/draft-orders/:id/custom-items"
@@ -13076,6 +13072,10 @@ const routeModule = {
13076
13072
  Component: Promotions,
13077
13073
  path: "/draft-orders/:id/promotions"
13078
13074
  },
13075
+ {
13076
+ Component: BillingAddress,
13077
+ path: "/draft-orders/:id/billing-address"
13078
+ },
13079
13079
  {
13080
13080
  Component: SalesChannel,
13081
13081
  path: "/draft-orders/:id/sales-channel"
@@ -9554,196 +9554,6 @@ const ID = () => {
9554
9554
  /* @__PURE__ */ jsx(Outlet, {})
9555
9555
  ] });
9556
9556
  };
9557
- const BillingAddress = () => {
9558
- const { id } = useParams();
9559
- const { order, isPending, isError, error } = useOrder(id, {
9560
- fields: "+billing_address"
9561
- });
9562
- if (isError) {
9563
- throw error;
9564
- }
9565
- const isReady = !isPending && !!order;
9566
- return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
9567
- /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
9568
- /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Billing Address" }) }),
9569
- /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
9570
- ] }),
9571
- isReady && /* @__PURE__ */ jsx(BillingAddressForm, { order })
9572
- ] });
9573
- };
9574
- const BillingAddressForm = ({ order }) => {
9575
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
9576
- const form = useForm({
9577
- defaultValues: {
9578
- first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
9579
- last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
9580
- company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
9581
- address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
9582
- address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
9583
- city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
9584
- province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
9585
- country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
9586
- postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
9587
- phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
9588
- },
9589
- resolver: zodResolver(schema$5)
9590
- });
9591
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9592
- const { handleSuccess } = useRouteModal();
9593
- const onSubmit = form.handleSubmit(async (data) => {
9594
- await mutateAsync(
9595
- { billing_address: data },
9596
- {
9597
- onSuccess: () => {
9598
- handleSuccess();
9599
- },
9600
- onError: (error) => {
9601
- toast.error(error.message);
9602
- }
9603
- }
9604
- );
9605
- });
9606
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
9607
- KeyboundForm,
9608
- {
9609
- className: "flex flex-1 flex-col overflow-hidden",
9610
- onSubmit,
9611
- children: [
9612
- /* @__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: [
9613
- /* @__PURE__ */ jsx(
9614
- Form$2.Field,
9615
- {
9616
- control: form.control,
9617
- name: "country_code",
9618
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9619
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Country" }),
9620
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
9621
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9622
- ] })
9623
- }
9624
- ),
9625
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
9626
- /* @__PURE__ */ jsx(
9627
- Form$2.Field,
9628
- {
9629
- control: form.control,
9630
- name: "first_name",
9631
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9632
- /* @__PURE__ */ jsx(Form$2.Label, { children: "First name" }),
9633
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9634
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9635
- ] })
9636
- }
9637
- ),
9638
- /* @__PURE__ */ jsx(
9639
- Form$2.Field,
9640
- {
9641
- control: form.control,
9642
- name: "last_name",
9643
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9644
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Last name" }),
9645
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9646
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9647
- ] })
9648
- }
9649
- )
9650
- ] }),
9651
- /* @__PURE__ */ jsx(
9652
- Form$2.Field,
9653
- {
9654
- control: form.control,
9655
- name: "company",
9656
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9657
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Company" }),
9658
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9659
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9660
- ] })
9661
- }
9662
- ),
9663
- /* @__PURE__ */ jsx(
9664
- Form$2.Field,
9665
- {
9666
- control: form.control,
9667
- name: "address_1",
9668
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9669
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Address" }),
9670
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9671
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9672
- ] })
9673
- }
9674
- ),
9675
- /* @__PURE__ */ jsx(
9676
- Form$2.Field,
9677
- {
9678
- control: form.control,
9679
- name: "address_2",
9680
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9681
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
9682
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9683
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9684
- ] })
9685
- }
9686
- ),
9687
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
9688
- /* @__PURE__ */ jsx(
9689
- Form$2.Field,
9690
- {
9691
- control: form.control,
9692
- name: "postal_code",
9693
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9694
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Postal code" }),
9695
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9696
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9697
- ] })
9698
- }
9699
- ),
9700
- /* @__PURE__ */ jsx(
9701
- Form$2.Field,
9702
- {
9703
- control: form.control,
9704
- name: "city",
9705
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9706
- /* @__PURE__ */ jsx(Form$2.Label, { children: "City" }),
9707
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9708
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9709
- ] })
9710
- }
9711
- )
9712
- ] }),
9713
- /* @__PURE__ */ jsx(
9714
- Form$2.Field,
9715
- {
9716
- control: form.control,
9717
- name: "province",
9718
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9719
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Province / State" }),
9720
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9721
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9722
- ] })
9723
- }
9724
- ),
9725
- /* @__PURE__ */ jsx(
9726
- Form$2.Field,
9727
- {
9728
- control: form.control,
9729
- name: "phone",
9730
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9731
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Phone" }),
9732
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9733
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9734
- ] })
9735
- }
9736
- )
9737
- ] }) }),
9738
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
9739
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9740
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
9741
- ] }) })
9742
- ]
9743
- }
9744
- ) });
9745
- };
9746
- const schema$5 = addressSchema;
9747
9557
  const CustomItems = () => {
9748
9558
  return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
9749
9559
  /* @__PURE__ */ jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Custom Items" }) }) }),
@@ -9752,7 +9562,7 @@ const CustomItems = () => {
9752
9562
  };
9753
9563
  const CustomItemsForm = () => {
9754
9564
  const form = useForm({
9755
- resolver: zodResolver(schema$4)
9565
+ resolver: zodResolver(schema$5)
9756
9566
  });
9757
9567
  return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
9758
9568
  /* @__PURE__ */ jsx(RouteDrawer.Body, {}),
@@ -9762,7 +9572,7 @@ const CustomItemsForm = () => {
9762
9572
  ] }) })
9763
9573
  ] }) });
9764
9574
  };
9765
- const schema$4 = objectType({
9575
+ const schema$5 = objectType({
9766
9576
  email: stringType().email()
9767
9577
  });
9768
9578
  const Email = () => {
@@ -9787,7 +9597,7 @@ const EmailForm = ({ order }) => {
9787
9597
  defaultValues: {
9788
9598
  email: order.email ?? ""
9789
9599
  },
9790
- resolver: zodResolver(schema$3)
9600
+ resolver: zodResolver(schema$4)
9791
9601
  });
9792
9602
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9793
9603
  const { handleSuccess } = useRouteModal();
@@ -9830,7 +9640,7 @@ const EmailForm = ({ order }) => {
9830
9640
  }
9831
9641
  ) });
9832
9642
  };
9833
- const schema$3 = objectType({
9643
+ const schema$4 = objectType({
9834
9644
  email: stringType().email()
9835
9645
  });
9836
9646
  const NumberInput = forwardRef(
@@ -11434,6 +11244,196 @@ function getPromotionCodes(items, shippingMethods) {
11434
11244
  }
11435
11245
  return Array.from(codes);
11436
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
11437
  const SalesChannel = () => {
11438
11438
  const { id } = useParams();
11439
11439
  const { draft_order, isPending, isError, error } = useDraftOrder(
@@ -13046,10 +13046,6 @@ const routeModule = {
13046
13046
  handle,
13047
13047
  loader,
13048
13048
  children: [
13049
- {
13050
- Component: BillingAddress,
13051
- path: "/draft-orders/:id/billing-address"
13052
- },
13053
13049
  {
13054
13050
  Component: CustomItems,
13055
13051
  path: "/draft-orders/:id/custom-items"
@@ -13070,6 +13066,10 @@ const routeModule = {
13070
13066
  Component: Promotions,
13071
13067
  path: "/draft-orders/:id/promotions"
13072
13068
  },
13069
+ {
13070
+ Component: BillingAddress,
13071
+ path: "/draft-orders/:id/billing-address"
13072
+ },
13073
13073
  {
13074
13074
  Component: SalesChannel,
13075
13075
  path: "/draft-orders/:id/sales-channel"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/draft-order",
3
- "version": "2.10.2-preview-20250903150153",
3
+ "version": "2.10.2-preview-20250903180151",
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-20250903150153",
39
+ "@medusajs/js-sdk": "2.10.2-preview-20250903180151",
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-20250903150153",
49
- "@medusajs/cli": "2.10.2-preview-20250903150153",
50
- "@medusajs/framework": "2.10.2-preview-20250903150153",
51
- "@medusajs/icons": "2.10.2-preview-20250903150153",
52
- "@medusajs/test-utils": "2.10.2-preview-20250903150153",
53
- "@medusajs/types": "2.10.2-preview-20250903150153",
54
- "@medusajs/ui": "4.0.22-preview-20250903150153",
55
- "@medusajs/ui-preset": "2.10.2-preview-20250903150153",
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",
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-20250903150153",
80
- "@medusajs/cli": "2.10.2-preview-20250903150153",
81
- "@medusajs/framework": "2.10.2-preview-20250903150153",
82
- "@medusajs/icons": "2.10.2-preview-20250903150153",
83
- "@medusajs/test-utils": "2.10.2-preview-20250903150153",
84
- "@medusajs/ui": "4.0.22-preview-20250903150153",
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",
85
85
  "@mikro-orm/cli": "6.4.3",
86
86
  "@mikro-orm/core": "6.4.3",
87
87
  "@mikro-orm/knex": "6.4.3",