@medusajs/draft-order 3.0.0-snapshot-20260102125810 → 3.0.0-snapshot-20260102134455

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.
@@ -9574,6 +9574,196 @@ const ID = () => {
9574
9574
  /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Outlet, {})
9575
9575
  ] });
9576
9576
  };
9577
+ const BillingAddress = () => {
9578
+ const { id } = reactRouterDom.useParams();
9579
+ const { order, isPending, isError, error } = useOrder(id, {
9580
+ fields: "+billing_address"
9581
+ });
9582
+ if (isError) {
9583
+ throw error;
9584
+ }
9585
+ const isReady = !isPending && !!order;
9586
+ return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
9587
+ /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
9588
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Billing Address" }) }),
9589
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
9590
+ ] }),
9591
+ isReady && /* @__PURE__ */ jsxRuntime.jsx(BillingAddressForm, { order })
9592
+ ] });
9593
+ };
9594
+ const BillingAddressForm = ({ order }) => {
9595
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
9596
+ const form = reactHookForm.useForm({
9597
+ defaultValues: {
9598
+ first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
9599
+ last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
9600
+ company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
9601
+ address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
9602
+ address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
9603
+ city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
9604
+ province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
9605
+ country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
9606
+ postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
9607
+ phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
9608
+ },
9609
+ resolver: zod.zodResolver(schema$5)
9610
+ });
9611
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9612
+ const { handleSuccess } = useRouteModal();
9613
+ const onSubmit = form.handleSubmit(async (data) => {
9614
+ await mutateAsync(
9615
+ { billing_address: data },
9616
+ {
9617
+ onSuccess: () => {
9618
+ handleSuccess();
9619
+ },
9620
+ onError: (error) => {
9621
+ ui.toast.error(error.message);
9622
+ }
9623
+ }
9624
+ );
9625
+ });
9626
+ return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
9627
+ KeyboundForm,
9628
+ {
9629
+ className: "flex flex-1 flex-col overflow-hidden",
9630
+ onSubmit,
9631
+ children: [
9632
+ /* @__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: [
9633
+ /* @__PURE__ */ jsxRuntime.jsx(
9634
+ Form$2.Field,
9635
+ {
9636
+ control: form.control,
9637
+ name: "country_code",
9638
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9639
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Country" }),
9640
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(CountrySelect, { ...field }) }),
9641
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9642
+ ] })
9643
+ }
9644
+ ),
9645
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
9646
+ /* @__PURE__ */ jsxRuntime.jsx(
9647
+ Form$2.Field,
9648
+ {
9649
+ control: form.control,
9650
+ name: "first_name",
9651
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9652
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "First name" }),
9653
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9654
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9655
+ ] })
9656
+ }
9657
+ ),
9658
+ /* @__PURE__ */ jsxRuntime.jsx(
9659
+ Form$2.Field,
9660
+ {
9661
+ control: form.control,
9662
+ name: "last_name",
9663
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9664
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Last name" }),
9665
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9666
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9667
+ ] })
9668
+ }
9669
+ )
9670
+ ] }),
9671
+ /* @__PURE__ */ jsxRuntime.jsx(
9672
+ Form$2.Field,
9673
+ {
9674
+ control: form.control,
9675
+ name: "company",
9676
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9677
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Company" }),
9678
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9679
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9680
+ ] })
9681
+ }
9682
+ ),
9683
+ /* @__PURE__ */ jsxRuntime.jsx(
9684
+ Form$2.Field,
9685
+ {
9686
+ control: form.control,
9687
+ name: "address_1",
9688
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9689
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Address" }),
9690
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9691
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9692
+ ] })
9693
+ }
9694
+ ),
9695
+ /* @__PURE__ */ jsxRuntime.jsx(
9696
+ Form$2.Field,
9697
+ {
9698
+ control: form.control,
9699
+ name: "address_2",
9700
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9701
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
9702
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9703
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9704
+ ] })
9705
+ }
9706
+ ),
9707
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
9708
+ /* @__PURE__ */ jsxRuntime.jsx(
9709
+ Form$2.Field,
9710
+ {
9711
+ control: form.control,
9712
+ name: "postal_code",
9713
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9714
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Postal code" }),
9715
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9716
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9717
+ ] })
9718
+ }
9719
+ ),
9720
+ /* @__PURE__ */ jsxRuntime.jsx(
9721
+ Form$2.Field,
9722
+ {
9723
+ control: form.control,
9724
+ name: "city",
9725
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9726
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "City" }),
9727
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9728
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9729
+ ] })
9730
+ }
9731
+ )
9732
+ ] }),
9733
+ /* @__PURE__ */ jsxRuntime.jsx(
9734
+ Form$2.Field,
9735
+ {
9736
+ control: form.control,
9737
+ name: "province",
9738
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9739
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Province / State" }),
9740
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9741
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9742
+ ] })
9743
+ }
9744
+ ),
9745
+ /* @__PURE__ */ jsxRuntime.jsx(
9746
+ Form$2.Field,
9747
+ {
9748
+ control: form.control,
9749
+ name: "phone",
9750
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9751
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Phone" }),
9752
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9753
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9754
+ ] })
9755
+ }
9756
+ )
9757
+ ] }) }),
9758
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
9759
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9760
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
9761
+ ] }) })
9762
+ ]
9763
+ }
9764
+ ) });
9765
+ };
9766
+ const schema$5 = addressSchema;
9577
9767
  const CustomItems = () => {
9578
9768
  return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
9579
9769
  /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Custom Items" }) }) }),
@@ -9582,7 +9772,7 @@ const CustomItems = () => {
9582
9772
  };
9583
9773
  const CustomItemsForm = () => {
9584
9774
  const form = reactHookForm.useForm({
9585
- resolver: zod.zodResolver(schema$5)
9775
+ resolver: zod.zodResolver(schema$4)
9586
9776
  });
9587
9777
  return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
9588
9778
  /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, {}),
@@ -9592,7 +9782,75 @@ const CustomItemsForm = () => {
9592
9782
  ] }) })
9593
9783
  ] }) });
9594
9784
  };
9595
- const schema$5 = objectType({
9785
+ const schema$4 = objectType({
9786
+ email: stringType().email()
9787
+ });
9788
+ const Email = () => {
9789
+ const { id } = reactRouterDom.useParams();
9790
+ const { order, isPending, isError, error } = useOrder(id, {
9791
+ fields: "+email"
9792
+ });
9793
+ if (isError) {
9794
+ throw error;
9795
+ }
9796
+ const isReady = !isPending && !!order;
9797
+ return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
9798
+ /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
9799
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Email" }) }),
9800
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
9801
+ ] }),
9802
+ isReady && /* @__PURE__ */ jsxRuntime.jsx(EmailForm, { order })
9803
+ ] });
9804
+ };
9805
+ const EmailForm = ({ order }) => {
9806
+ const form = reactHookForm.useForm({
9807
+ defaultValues: {
9808
+ email: order.email ?? ""
9809
+ },
9810
+ resolver: zod.zodResolver(schema$3)
9811
+ });
9812
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9813
+ const { handleSuccess } = useRouteModal();
9814
+ const onSubmit = form.handleSubmit(async (data) => {
9815
+ await mutateAsync(
9816
+ { email: data.email },
9817
+ {
9818
+ onSuccess: () => {
9819
+ handleSuccess();
9820
+ },
9821
+ onError: (error) => {
9822
+ ui.toast.error(error.message);
9823
+ }
9824
+ }
9825
+ );
9826
+ });
9827
+ return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
9828
+ KeyboundForm,
9829
+ {
9830
+ className: "flex flex-1 flex-col overflow-hidden",
9831
+ onSubmit,
9832
+ children: [
9833
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
9834
+ Form$2.Field,
9835
+ {
9836
+ control: form.control,
9837
+ name: "email",
9838
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9839
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Email" }),
9840
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9841
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9842
+ ] })
9843
+ }
9844
+ ) }),
9845
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
9846
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9847
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
9848
+ ] }) })
9849
+ ]
9850
+ }
9851
+ ) });
9852
+ };
9853
+ const schema$3 = objectType({
9596
9854
  email: stringType().email()
9597
9855
  });
9598
9856
  const NumberInput = React.forwardRef(
@@ -10461,372 +10719,114 @@ const CustomItemForm = ({ orderId, currencyCode }) => {
10461
10719
  const { mutateAsync: addItems } = useDraftOrderAddItems(orderId);
10462
10720
  const form = reactHookForm.useForm({
10463
10721
  defaultValues: {
10464
- title: "",
10465
- quantity: 1,
10466
- unit_price: ""
10467
- },
10468
- resolver: zod.zodResolver(customItemSchema)
10469
- });
10470
- const onSubmit = form.handleSubmit(async (data) => {
10471
- await addItems(
10472
- {
10473
- items: [
10474
- {
10475
- title: data.title,
10476
- quantity: data.quantity,
10477
- unit_price: convertNumber(data.unit_price)
10478
- }
10479
- ]
10480
- },
10481
- {
10482
- onSuccess: () => {
10483
- setIsOpen(STACKED_MODAL_ID, false);
10484
- },
10485
- onError: (e) => {
10486
- ui.toast.error(e.message);
10487
- }
10488
- }
10489
- );
10490
- });
10491
- return /* @__PURE__ */ jsxRuntime.jsx(Form$2, { ...form, children: /* @__PURE__ */ jsxRuntime.jsx(KeyboundForm, { onSubmit, children: /* @__PURE__ */ jsxRuntime.jsxs(StackedFocusModal.Content, { children: [
10492
- /* @__PURE__ */ jsxRuntime.jsx(StackedFocusModal.Header, {}),
10493
- /* @__PURE__ */ jsxRuntime.jsx(StackedFocusModal.Body, { className: "flex flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 flex-col items-center overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-6 px-2 py-16", children: [
10494
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
10495
- /* @__PURE__ */ jsxRuntime.jsx(StackedFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Add custom item" }) }),
10496
- /* @__PURE__ */ jsxRuntime.jsx(StackedFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", className: "text-ui-fg-subtle", children: "Add a custom item to the order. This will add a new line item that is not associated with an existing product." }) })
10497
- ] }),
10498
- /* @__PURE__ */ jsxRuntime.jsx(ui.Divider, { variant: "dashed" }),
10499
- /* @__PURE__ */ jsxRuntime.jsx(
10500
- Form$2.Field,
10501
- {
10502
- control: form.control,
10503
- name: "title",
10504
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsx(Form$2.Item, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-x-3", children: [
10505
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
10506
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Title" }),
10507
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Hint, { children: "Enter the title of the item" })
10508
- ] }),
10509
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
10510
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10511
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10512
- ] })
10513
- ] }) })
10514
- }
10515
- ),
10516
- /* @__PURE__ */ jsxRuntime.jsx(ui.Divider, { variant: "dashed" }),
10517
- /* @__PURE__ */ jsxRuntime.jsx(
10518
- Form$2.Field,
10519
- {
10520
- control: form.control,
10521
- name: "unit_price",
10522
- render: ({ field: { onChange, ...field } }) => /* @__PURE__ */ jsxRuntime.jsx(Form$2.Item, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-x-3", children: [
10523
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
10524
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Unit price" }),
10525
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Hint, { children: "Enter the unit price of the item" })
10526
- ] }),
10527
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
10528
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(
10529
- ui.CurrencyInput,
10530
- {
10531
- symbol: getNativeSymbol(currencyCode),
10532
- code: currencyCode,
10533
- onValueChange: (_value, _name, values) => onChange(values == null ? void 0 : values.value),
10534
- ...field
10535
- }
10536
- ) }),
10537
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10538
- ] })
10539
- ] }) })
10540
- }
10541
- ),
10542
- /* @__PURE__ */ jsxRuntime.jsx(ui.Divider, { variant: "dashed" }),
10543
- /* @__PURE__ */ jsxRuntime.jsx(
10544
- Form$2.Field,
10545
- {
10546
- control: form.control,
10547
- name: "quantity",
10548
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsx(Form$2.Item, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-x-3", children: [
10549
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
10550
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Quantity" }),
10551
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Hint, { children: "Enter the quantity of the item" })
10552
- ] }),
10553
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full flex-1", children: [
10554
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(NumberInput, { ...field, className: "w-full" }) }) }),
10555
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10556
- ] })
10557
- ] }) })
10558
- }
10559
- )
10560
- ] }) }) }),
10561
- /* @__PURE__ */ jsxRuntime.jsx(StackedFocusModal.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
10562
- /* @__PURE__ */ jsxRuntime.jsx(StackedFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", type: "button", children: "Cancel" }) }),
10563
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "button", onClick: onSubmit, children: "Add item" })
10564
- ] }) })
10565
- ] }) }) });
10566
- };
10567
- const customItemSchema = objectType({
10568
- title: stringType().min(1),
10569
- quantity: numberType(),
10570
- unit_price: unionType([numberType(), stringType()])
10571
- });
10572
- const Email = () => {
10573
- const { id } = reactRouterDom.useParams();
10574
- const { order, isPending, isError, error } = useOrder(id, {
10575
- fields: "+email"
10576
- });
10577
- if (isError) {
10578
- throw error;
10579
- }
10580
- const isReady = !isPending && !!order;
10581
- return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
10582
- /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
10583
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Email" }) }),
10584
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
10585
- ] }),
10586
- isReady && /* @__PURE__ */ jsxRuntime.jsx(EmailForm, { order })
10587
- ] });
10588
- };
10589
- const EmailForm = ({ order }) => {
10590
- const form = reactHookForm.useForm({
10591
- defaultValues: {
10592
- email: order.email ?? ""
10593
- },
10594
- resolver: zod.zodResolver(schema$4)
10595
- });
10596
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
10597
- const { handleSuccess } = useRouteModal();
10598
- const onSubmit = form.handleSubmit(async (data) => {
10599
- await mutateAsync(
10600
- { email: data.email },
10601
- {
10602
- onSuccess: () => {
10603
- handleSuccess();
10604
- },
10605
- onError: (error) => {
10606
- ui.toast.error(error.message);
10607
- }
10608
- }
10609
- );
10610
- });
10611
- return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
10612
- KeyboundForm,
10613
- {
10614
- className: "flex flex-1 flex-col overflow-hidden",
10615
- onSubmit,
10616
- children: [
10617
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
10618
- Form$2.Field,
10619
- {
10620
- control: form.control,
10621
- name: "email",
10622
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10623
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Email" }),
10624
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10625
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10626
- ] })
10627
- }
10628
- ) }),
10629
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
10630
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
10631
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
10632
- ] }) })
10633
- ]
10634
- }
10635
- ) });
10636
- };
10637
- const schema$4 = objectType({
10638
- email: stringType().email()
10639
- });
10640
- const BillingAddress = () => {
10641
- const { id } = reactRouterDom.useParams();
10642
- const { order, isPending, isError, error } = useOrder(id, {
10643
- fields: "+billing_address"
10644
- });
10645
- if (isError) {
10646
- throw error;
10647
- }
10648
- const isReady = !isPending && !!order;
10649
- return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
10650
- /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
10651
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Billing Address" }) }),
10652
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
10653
- ] }),
10654
- isReady && /* @__PURE__ */ jsxRuntime.jsx(BillingAddressForm, { order })
10655
- ] });
10656
- };
10657
- const BillingAddressForm = ({ order }) => {
10658
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
10659
- const form = reactHookForm.useForm({
10660
- defaultValues: {
10661
- first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
10662
- last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
10663
- company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
10664
- address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
10665
- address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
10666
- city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
10667
- province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
10668
- country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
10669
- postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
10670
- phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
10722
+ title: "",
10723
+ quantity: 1,
10724
+ unit_price: ""
10671
10725
  },
10672
- resolver: zod.zodResolver(schema$3)
10726
+ resolver: zod.zodResolver(customItemSchema)
10673
10727
  });
10674
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
10675
- const { handleSuccess } = useRouteModal();
10676
10728
  const onSubmit = form.handleSubmit(async (data) => {
10677
- await mutateAsync(
10678
- { billing_address: data },
10729
+ await addItems(
10730
+ {
10731
+ items: [
10732
+ {
10733
+ title: data.title,
10734
+ quantity: data.quantity,
10735
+ unit_price: convertNumber(data.unit_price)
10736
+ }
10737
+ ]
10738
+ },
10679
10739
  {
10680
10740
  onSuccess: () => {
10681
- handleSuccess();
10741
+ setIsOpen(STACKED_MODAL_ID, false);
10682
10742
  },
10683
- onError: (error) => {
10684
- ui.toast.error(error.message);
10743
+ onError: (e) => {
10744
+ ui.toast.error(e.message);
10685
10745
  }
10686
10746
  }
10687
10747
  );
10688
10748
  });
10689
- return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
10690
- KeyboundForm,
10691
- {
10692
- className: "flex flex-1 flex-col overflow-hidden",
10693
- onSubmit,
10694
- children: [
10695
- /* @__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: [
10696
- /* @__PURE__ */ jsxRuntime.jsx(
10697
- Form$2.Field,
10698
- {
10699
- control: form.control,
10700
- name: "country_code",
10701
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10702
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Country" }),
10703
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(CountrySelect, { ...field }) }),
10704
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10705
- ] })
10706
- }
10707
- ),
10708
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
10709
- /* @__PURE__ */ jsxRuntime.jsx(
10710
- Form$2.Field,
10711
- {
10712
- control: form.control,
10713
- name: "first_name",
10714
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10715
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "First name" }),
10716
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10717
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10718
- ] })
10719
- }
10720
- ),
10721
- /* @__PURE__ */ jsxRuntime.jsx(
10722
- Form$2.Field,
10723
- {
10724
- control: form.control,
10725
- name: "last_name",
10726
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10727
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Last name" }),
10728
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10729
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10730
- ] })
10731
- }
10732
- )
10733
- ] }),
10734
- /* @__PURE__ */ jsxRuntime.jsx(
10735
- Form$2.Field,
10736
- {
10737
- control: form.control,
10738
- name: "company",
10739
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10740
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Company" }),
10741
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10742
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10743
- ] })
10744
- }
10745
- ),
10746
- /* @__PURE__ */ jsxRuntime.jsx(
10747
- Form$2.Field,
10748
- {
10749
- control: form.control,
10750
- name: "address_1",
10751
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10752
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Address" }),
10753
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10754
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10755
- ] })
10756
- }
10757
- ),
10758
- /* @__PURE__ */ jsxRuntime.jsx(
10759
- Form$2.Field,
10760
- {
10761
- control: form.control,
10762
- name: "address_2",
10763
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10764
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
10765
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10766
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10767
- ] })
10768
- }
10769
- ),
10770
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
10771
- /* @__PURE__ */ jsxRuntime.jsx(
10772
- Form$2.Field,
10773
- {
10774
- control: form.control,
10775
- name: "postal_code",
10776
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10777
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Postal code" }),
10778
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10779
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10780
- ] })
10781
- }
10782
- ),
10783
- /* @__PURE__ */ jsxRuntime.jsx(
10784
- Form$2.Field,
10785
- {
10786
- control: form.control,
10787
- name: "city",
10788
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10789
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "City" }),
10790
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10791
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10792
- ] })
10793
- }
10794
- )
10795
- ] }),
10796
- /* @__PURE__ */ jsxRuntime.jsx(
10797
- Form$2.Field,
10798
- {
10799
- control: form.control,
10800
- name: "province",
10801
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10802
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Province / State" }),
10803
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10804
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10805
- ] })
10806
- }
10807
- ),
10808
- /* @__PURE__ */ jsxRuntime.jsx(
10809
- Form$2.Field,
10810
- {
10811
- control: form.control,
10812
- name: "phone",
10813
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10814
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Phone" }),
10815
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10816
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10817
- ] })
10818
- }
10819
- )
10820
- ] }) }),
10821
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
10822
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
10823
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
10824
- ] }) })
10825
- ]
10826
- }
10827
- ) });
10749
+ return /* @__PURE__ */ jsxRuntime.jsx(Form$2, { ...form, children: /* @__PURE__ */ jsxRuntime.jsx(KeyboundForm, { onSubmit, children: /* @__PURE__ */ jsxRuntime.jsxs(StackedFocusModal.Content, { children: [
10750
+ /* @__PURE__ */ jsxRuntime.jsx(StackedFocusModal.Header, {}),
10751
+ /* @__PURE__ */ jsxRuntime.jsx(StackedFocusModal.Body, { className: "flex flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 flex-col items-center overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-6 px-2 py-16", children: [
10752
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
10753
+ /* @__PURE__ */ jsxRuntime.jsx(StackedFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Add custom item" }) }),
10754
+ /* @__PURE__ */ jsxRuntime.jsx(StackedFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", className: "text-ui-fg-subtle", children: "Add a custom item to the order. This will add a new line item that is not associated with an existing product." }) })
10755
+ ] }),
10756
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Divider, { variant: "dashed" }),
10757
+ /* @__PURE__ */ jsxRuntime.jsx(
10758
+ Form$2.Field,
10759
+ {
10760
+ control: form.control,
10761
+ name: "title",
10762
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsx(Form$2.Item, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-x-3", children: [
10763
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
10764
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Title" }),
10765
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Hint, { children: "Enter the title of the item" })
10766
+ ] }),
10767
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
10768
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10769
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10770
+ ] })
10771
+ ] }) })
10772
+ }
10773
+ ),
10774
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Divider, { variant: "dashed" }),
10775
+ /* @__PURE__ */ jsxRuntime.jsx(
10776
+ Form$2.Field,
10777
+ {
10778
+ control: form.control,
10779
+ name: "unit_price",
10780
+ render: ({ field: { onChange, ...field } }) => /* @__PURE__ */ jsxRuntime.jsx(Form$2.Item, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-x-3", children: [
10781
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
10782
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Unit price" }),
10783
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Hint, { children: "Enter the unit price of the item" })
10784
+ ] }),
10785
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
10786
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(
10787
+ ui.CurrencyInput,
10788
+ {
10789
+ symbol: getNativeSymbol(currencyCode),
10790
+ code: currencyCode,
10791
+ onValueChange: (_value, _name, values) => onChange(values == null ? void 0 : values.value),
10792
+ ...field
10793
+ }
10794
+ ) }),
10795
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10796
+ ] })
10797
+ ] }) })
10798
+ }
10799
+ ),
10800
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Divider, { variant: "dashed" }),
10801
+ /* @__PURE__ */ jsxRuntime.jsx(
10802
+ Form$2.Field,
10803
+ {
10804
+ control: form.control,
10805
+ name: "quantity",
10806
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsx(Form$2.Item, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-x-3", children: [
10807
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
10808
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Quantity" }),
10809
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Hint, { children: "Enter the quantity of the item" })
10810
+ ] }),
10811
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full flex-1", children: [
10812
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(NumberInput, { ...field, className: "w-full" }) }) }),
10813
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10814
+ ] })
10815
+ ] }) })
10816
+ }
10817
+ )
10818
+ ] }) }) }),
10819
+ /* @__PURE__ */ jsxRuntime.jsx(StackedFocusModal.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
10820
+ /* @__PURE__ */ jsxRuntime.jsx(StackedFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", type: "button", children: "Cancel" }) }),
10821
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "button", onClick: onSubmit, children: "Add item" })
10822
+ ] }) })
10823
+ ] }) }) });
10828
10824
  };
10829
- const schema$3 = addressSchema;
10825
+ const customItemSchema = objectType({
10826
+ title: stringType().min(1),
10827
+ quantity: numberType(),
10828
+ unit_price: unionType([numberType(), stringType()])
10829
+ });
10830
10830
  const InlineTip = React.forwardRef(
10831
10831
  ({ variant = "tip", label, className, children, ...props }, ref) => {
10832
10832
  const labelValue = label || (variant === "warning" ? "Warning" : "Tip");
@@ -13067,20 +13067,20 @@ const routeModule = {
13067
13067
  loader,
13068
13068
  children: [
13069
13069
  {
13070
- Component: CustomItems,
13071
- path: "/draft-orders/:id/custom-items"
13070
+ Component: BillingAddress,
13071
+ path: "/draft-orders/:id/billing-address"
13072
13072
  },
13073
13073
  {
13074
- Component: Items,
13075
- path: "/draft-orders/:id/items"
13074
+ Component: CustomItems,
13075
+ path: "/draft-orders/:id/custom-items"
13076
13076
  },
13077
13077
  {
13078
13078
  Component: Email,
13079
13079
  path: "/draft-orders/:id/email"
13080
13080
  },
13081
13081
  {
13082
- Component: BillingAddress,
13083
- path: "/draft-orders/:id/billing-address"
13082
+ Component: Items,
13083
+ path: "/draft-orders/:id/items"
13084
13084
  },
13085
13085
  {
13086
13086
  Component: Metadata,