@tesouro/embedded-components-react 0.5.258 → 0.5.260

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.
Files changed (62) hide show
  1. package/README.md +2 -1
  2. package/dist/index.css +109 -9
  3. package/dist/index.d.ts +41 -10
  4. package/dist/lib/ReceivablesWidget.d.ts +41 -10
  5. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +11 -10
  6. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +42 -94
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +91 -76
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js +67 -173
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index13.js +186 -17
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index14.js +27 -0
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index4.js +28 -72
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index5.js +128 -53
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js +66 -28
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index7.js +28 -34
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index8.js +24 -168
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index9.js +173 -44
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +274 -267
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +99 -95
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +1 -0
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/paymentTerms.js +28 -25
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/preview.js +49 -43
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/unsavedChanges.js +13 -0
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +4 -4
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActionsModal.js +2 -2
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableAttachmentUploads.js +1 -1
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableBankAccount.js +77 -72
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +4 -4
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +363 -295
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableIssuePreflight.js +1 -1
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentRecord.js +1 -1
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePreview.js +36 -21
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableReminders.js +1 -1
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableStatusCards.js +1 -1
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +1 -1
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +12 -10
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +21 -14
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +1 -1
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +1 -1
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +68 -64
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +383 -379
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +22 -0
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +8 -2
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +258 -1
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +2 -100
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +95 -23
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +23 -231
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +237 -3
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +3 -249
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +234 -78
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +87 -53
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +49 -349
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +359 -0
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +45 -0
  54. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +40 -40
  55. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +247 -214
  56. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +175 -147
  57. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  58. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/index.js +12 -12
  59. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index2.js +2 -1
  60. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index6.js +109 -89
  61. package/package.json +1 -1
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +0 -4
@@ -1,498 +1,502 @@
1
- import { Alert as e, AlertDescription as t, Button as n, Checkbox as r, Field as i, FieldContent as a, FieldError as o, FieldLabel as s, Input as c, InputGroup as l, InputGroupAddon as u, InputGroupInput as d, Label as f, RadioGroup as p, RadioGroupItem as m, Select as h, SelectContent as g, SelectItem as _, SelectTrigger as v, SelectValue as y, Separator as b, Sheet as x, SheetContent as S, SheetDescription as C, SheetFooter as w, SheetHeader as T, SheetTitle as ee, Spinner as te, Typography as E, cn as D } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { RECEIVABLE_FORM_SHEET_LABELS_EN as ne } from "./index13.js";
3
- import { ReceivableFormTotals as re } from "./index36.js";
4
- import { ReceivableNotesSection as O } from "./index37.js";
5
- import { useId as ie } from "react";
6
- import { jsx as k, jsxs as A } from "react/jsx-runtime";
7
- import { MinusIcon as j, PlusIcon as M, Trash2Icon as N } from "lucide-react";
1
+ import { Alert as e, AlertDescription as t, Button as n, Checkbox as r, Dialog as i, DialogContent as a, DialogDescription as o, DialogFooter as s, DialogHeader as c, DialogTitle as l, Field as u, FieldContent as d, FieldError as f, FieldLabel as p, Input as m, Label as h, Select as g, SelectContent as _, SelectItem as v, SelectTrigger as y, SelectValue as b, Separator as x, Spinner as S, Typography as C, cn as w } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { RECEIVABLE_FORM_DIALOG_LABELS_EN as ee } from "./index13.js";
3
+ import { ReceivableFormTotals as te } from "./index36.js";
4
+ import { ReceivableNotesSection as T } from "./index37.js";
5
+ import { useId as ne } from "react";
6
+ import { Fragment as re, jsx as E, jsxs as D } from "react/jsx-runtime";
7
+ import { MinusIcon as O, PlusIcon as k, Trash2Icon as A, XIcon as ie } from "lucide-react";
8
8
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js
9
- var P = "__none__", F = "__manage__";
10
- function I({ message: e }) {
11
- return e ? /* @__PURE__ */ k("p", {
9
+ var j = "__none__", M = "__manage__", N = "ttw:flex ttw:h-9 ttw:min-w-0 ttw:items-center ttw:rounded-md ttw:border ttw:border-input ttw:shadow-xs ttw:transition-[color,box-shadow] ttw:has-[input:focus-visible]:border-ring ttw:has-[input:focus-visible]:ring-[3px] ttw:has-[input:focus-visible]:ring-ring/50 ttw:has-[[aria-invalid=true]]:border-destructive", P = "ttw:h-full ttw:min-w-0 ttw:flex-1 ttw:bg-transparent ttw:text-right ttw:text-base ttw:outline-none ttw:placeholder:text-muted-foreground ttw:disabled:cursor-not-allowed ttw:disabled:opacity-50 ttw:md:text-sm", F = "ttw:flex ttw:items-center ttw:text-sm ttw:font-medium ttw:text-muted-foreground ttw:select-none", I = "ttw:flex ttw:size-6 ttw:shrink-0 ttw:cursor-pointer ttw:items-center ttw:justify-center ttw:rounded-[calc(var(--radius)-5px)] ttw:text-muted-foreground ttw:outline-none ttw:transition-all ttw:hover:bg-accent ttw:hover:text-accent-foreground ttw:focus-visible:ring-[3px] ttw:focus-visible:ring-ring/50 ttw:disabled:pointer-events-none ttw:disabled:opacity-50";
10
+ function L({ message: e }) {
11
+ return e ? /* @__PURE__ */ E("p", {
12
12
  className: "ttw:text-sm ttw:text-destructive",
13
13
  children: e
14
14
  }) : null;
15
15
  }
16
- function L({ formId: e, lineItem: t, errors: i, controls: a, focusOnMount: o, canRemove: s, unitOptions: c, currencySymbol: f, labels: p, renderProductSelector: m, onChange: b, onCommit: x, onQuantityStep: S, onManageUnits: C, onRemove: w }) {
17
- let T = `${e}-line-${t.id}`;
18
- return /* @__PURE__ */ A("li", {
16
+ function ae({ formId: e, lineItem: t, errors: i, controls: a, focusOnMount: o, canRemove: s, unitOptions: c, currencySymbol: l, labels: u, renderProductSelector: d, onChange: f, onCommit: p, onQuantityStep: m, onManageUnits: h, onRemove: x }) {
17
+ let S = `${e}-line-${t.id}`;
18
+ return /* @__PURE__ */ D("li", {
19
19
  className: "ttw:flex ttw:h-9 ttw:items-center ttw:gap-2.5",
20
20
  children: [
21
- /* @__PURE__ */ k("div", {
21
+ /* @__PURE__ */ E("div", {
22
22
  className: "ttw:min-w-30 ttw:flex-1",
23
- children: m(t, {
24
- inputId: `${T}-name`,
23
+ children: d(t, {
24
+ inputId: `${S}-name`,
25
25
  invalid: !!i?.name,
26
26
  focusOnMount: o
27
27
  })
28
28
  }),
29
- /* @__PURE__ */ A("div", {
30
- className: D("ttw:flex ttw:h-9 ttw:w-26 ttw:min-w-26 ttw:items-center ttw:rounded-md ttw:border ttw:border-input ttw:shadow-xs", i?.quantity && "ttw:border-destructive"),
29
+ /* @__PURE__ */ D("div", {
30
+ className: w(N, "ttw:w-26 ttw:min-w-26 ttw:px-[0.3rem]"),
31
31
  children: [
32
- /* @__PURE__ */ k("button", {
32
+ /* @__PURE__ */ E("button", {
33
33
  type: "button",
34
- "aria-label": p.decreaseQuantityButton,
34
+ "aria-label": u.decreaseQuantityButton,
35
35
  disabled: a ? !a.canDecreaseQuantity : !1,
36
- className: "ttw:flex ttw:size-6 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-sm ttw:text-muted-foreground ttw:hover:bg-accent ttw:disabled:pointer-events-none ttw:disabled:opacity-50",
37
- onClick: () => S(-1),
38
- children: /* @__PURE__ */ k(j, { className: "ttw:size-3.5" })
36
+ className: I,
37
+ onClick: () => m(-1),
38
+ children: /* @__PURE__ */ E(O, { className: "ttw:size-3.5" })
39
39
  }),
40
- /* @__PURE__ */ k("input", {
41
- id: `${T}-quantity`,
42
- "aria-label": p.quantityLabel,
40
+ /* @__PURE__ */ E("input", {
41
+ id: `${S}-quantity`,
42
+ "aria-label": u.quantityLabel,
43
43
  "aria-invalid": !!i?.quantity || void 0,
44
44
  type: "text",
45
45
  inputMode: "decimal",
46
46
  className: "ttw:h-full ttw:w-full ttw:min-w-0 ttw:bg-transparent ttw:px-0 ttw:text-center ttw:text-sm ttw:outline-none",
47
47
  value: t.quantity,
48
- onChange: (e) => b({ quantity: e.target.value }),
49
- onBlur: () => x("quantity")
48
+ onChange: (e) => f({ quantity: e.target.value }),
49
+ onBlur: () => p("quantity")
50
50
  }),
51
- /* @__PURE__ */ k("button", {
51
+ /* @__PURE__ */ E("button", {
52
52
  type: "button",
53
- "aria-label": p.increaseQuantityButton,
53
+ "aria-label": u.increaseQuantityButton,
54
54
  disabled: a ? !a.canIncreaseQuantity : !1,
55
- className: "ttw:flex ttw:size-6 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-sm ttw:text-muted-foreground ttw:hover:bg-accent ttw:disabled:pointer-events-none ttw:disabled:opacity-50",
56
- onClick: () => S(1),
57
- children: /* @__PURE__ */ k(M, { className: "ttw:size-3.5" })
55
+ className: I,
56
+ onClick: () => m(1),
57
+ children: /* @__PURE__ */ E(k, { className: "ttw:size-3.5" })
58
58
  })
59
59
  ]
60
60
  }),
61
- /* @__PURE__ */ A(h, {
62
- value: t.unit || P,
61
+ /* @__PURE__ */ D(g, {
62
+ value: t.unit || j,
63
63
  onValueChange: (e) => {
64
- if (e === F) {
65
- C?.();
64
+ if (e === M) {
65
+ h?.();
66
66
  return;
67
67
  }
68
- b({ unit: e === P ? "" : e });
68
+ f({ unit: e === j ? "" : e });
69
69
  },
70
- children: [/* @__PURE__ */ k(v, {
71
- id: `${T}-unit`,
72
- "aria-label": p.unitLabel,
70
+ children: [/* @__PURE__ */ E(y, {
71
+ id: `${S}-unit`,
72
+ "aria-label": u.unitLabel,
73
73
  "aria-invalid": !!i?.measureUnit || void 0,
74
74
  className: "ttw:w-22",
75
- children: /* @__PURE__ */ k(y, {
75
+ children: /* @__PURE__ */ E(b, {
76
76
  className: "ttw:truncate",
77
- placeholder: p.unitPlaceholder
77
+ placeholder: u.unitPlaceholder
78
78
  })
79
- }), /* @__PURE__ */ A(g, { children: [
80
- C && /* @__PURE__ */ A(_, {
81
- value: F,
79
+ }), /* @__PURE__ */ D(_, { children: [
80
+ h && /* @__PURE__ */ D(v, {
81
+ value: M,
82
82
  className: "ttw:font-semibold ttw:text-primary ttw:hover:text-primary ttw:focus:text-primary",
83
- children: [/* @__PURE__ */ k(M, { className: "ttw:text-primary" }), p.manageUnitsOption]
83
+ children: [/* @__PURE__ */ E(k, { className: "ttw:text-primary" }), u.manageUnitsOption]
84
84
  }),
85
- /* @__PURE__ */ k(_, {
86
- value: P,
87
- children: p.unitNone
85
+ /* @__PURE__ */ E(v, {
86
+ value: j,
87
+ children: u.unitNone
88
88
  }),
89
- c.map((e) => /* @__PURE__ */ k(_, {
89
+ c.map((e) => /* @__PURE__ */ E(v, {
90
90
  value: e.value,
91
91
  children: e.label
92
92
  }, e.value))
93
93
  ] })]
94
94
  }),
95
- /* @__PURE__ */ A(l, {
96
- className: "ttw:w-full ttw:max-w-41 ttw:min-w-29",
97
- children: [/* @__PURE__ */ k(u, {
98
- align: "inline-start",
99
- children: f
100
- }), /* @__PURE__ */ k(d, {
101
- id: `${T}-price`,
102
- "aria-label": p.priceLabel,
95
+ /* @__PURE__ */ D("div", {
96
+ className: w(N, "ttw:w-full ttw:max-w-41 ttw:min-w-29"),
97
+ children: [/* @__PURE__ */ E("span", {
98
+ className: w(F, "ttw:pl-3"),
99
+ children: l
100
+ }), /* @__PURE__ */ E("input", {
101
+ id: `${S}-price`,
102
+ "aria-label": u.priceLabel,
103
103
  "aria-invalid": !!i?.price || void 0,
104
- "data-has-start-addon": !0,
105
104
  type: "text",
106
105
  inputMode: "decimal",
107
- className: "ttw:text-right",
106
+ className: w(P, "ttw:pr-3 ttw:pl-2"),
108
107
  value: t.price,
109
- onChange: (e) => b({ price: e.target.value }),
110
- onBlur: () => x("price")
108
+ onChange: (e) => f({ price: e.target.value }),
109
+ onBlur: () => p("price")
111
110
  })]
112
111
  }),
113
- /* @__PURE__ */ k("div", {
112
+ /* @__PURE__ */ E("div", {
114
113
  className: "ttw:flex ttw:w-12 ttw:min-w-12 ttw:items-center ttw:justify-center",
115
- children: /* @__PURE__ */ k(r, {
116
- id: `${T}-taxable`,
117
- "aria-label": p.taxableLabel,
114
+ children: /* @__PURE__ */ E(r, {
115
+ id: `${S}-taxable`,
116
+ "aria-label": u.taxableLabel,
118
117
  checked: t.taxable,
119
- onCheckedChange: (e) => b({ taxable: e === !0 })
118
+ onCheckedChange: (e) => f({ taxable: e === !0 })
120
119
  })
121
120
  }),
122
- s && /* @__PURE__ */ k(n, {
121
+ s && /* @__PURE__ */ E(n, {
123
122
  type: "button",
124
123
  variant: "ghost",
125
124
  size: "sm",
126
- "aria-label": p.removeLineItemButton,
125
+ "aria-label": u.removeLineItemButton,
127
126
  className: "ttw:w-10 ttw:rounded-none ttw:border-l ttw:border-border ttw:pl-4 ttw:text-muted-foreground ttw:hover:bg-transparent ttw:hover:text-destructive ttw:has-[>svg]:pr-0",
128
- onClick: w,
129
- children: /* @__PURE__ */ k(N, {})
127
+ onClick: x,
128
+ children: /* @__PURE__ */ E(A, {})
130
129
  })
131
130
  ]
132
131
  });
133
132
  }
134
- function ae({ inputId: e, discountType: t, value: n, error: r, currencySymbol: c, disabled: f, labels: p, onChange: m, onTypeChange: h, onFocus: g, onBlur: _ }) {
135
- let v = `${e}-error`, y = [{
133
+ function oe({ inputId: e, discountType: t, value: n, error: r, currencySymbol: i, disabled: a, labels: o, onChange: s, onTypeChange: c, onFocus: l, onBlur: m }) {
134
+ let h = `${e}-error`, g = [{
136
135
  type: "amount",
137
- label: c,
138
- ariaLabel: p.discountAmountOptionAriaLabel
136
+ label: i,
137
+ ariaLabel: o.discountAmountOptionAriaLabel
139
138
  }, {
140
139
  type: "percentage",
141
- label: p.discountPercentageOption,
142
- ariaLabel: p.discountPercentageOptionAriaLabel
140
+ label: o.discountPercentageOption,
141
+ ariaLabel: o.discountPercentageOptionAriaLabel
143
142
  }];
144
- return /* @__PURE__ */ A(i, {
143
+ return /* @__PURE__ */ D(u, {
145
144
  className: "ttw:flex-col",
146
- children: [/* @__PURE__ */ A(a, {
145
+ children: [/* @__PURE__ */ D(d, {
147
146
  className: "ttw:flex-row ttw:items-center ttw:justify-end",
148
- children: [/* @__PURE__ */ k(s, {
147
+ children: [/* @__PURE__ */ E(p, {
149
148
  htmlFor: e,
150
- className: D(r && "ttw:text-destructive"),
151
- children: p.discountLabel
152
- }), /* @__PURE__ */ A(l, {
153
- className: "ttw:w-40 ttw:overflow-hidden",
154
- children: [/* @__PURE__ */ k(u, {
155
- align: "inline-start",
156
- className: "ttw:gap-0 ttw:self-stretch ttw:p-0 ttw:has-[>button]:ml-0",
157
- children: y.map((e) => /* @__PURE__ */ k("button", {
149
+ className: w(r && "ttw:text-destructive"),
150
+ children: o.discountLabel
151
+ }), /* @__PURE__ */ D("div", {
152
+ className: w(N, "ttw:w-40 ttw:overflow-hidden"),
153
+ children: [/* @__PURE__ */ E("div", {
154
+ className: w(F, "ttw:items-stretch ttw:self-stretch"),
155
+ children: g.map((e) => /* @__PURE__ */ E("button", {
158
156
  type: "button",
159
157
  "aria-label": e.ariaLabel,
160
158
  "aria-pressed": t === e.type,
161
- disabled: f,
162
- className: D("ttw:pointer-events-auto ttw:h-full ttw:w-9 ttw:cursor-pointer ttw:border-r ttw:border-input ttw:text-sm ttw:transition-colors ttw:disabled:pointer-events-none ttw:disabled:opacity-50", t === e.type ? "ttw:bg-primary ttw:text-primary-foreground" : "ttw:text-muted-foreground ttw:hover:bg-muted ttw:hover:text-foreground"),
163
- onClick: () => h(e.type),
159
+ disabled: a,
160
+ className: w("ttw:h-full ttw:w-9 ttw:cursor-pointer ttw:border-r ttw:border-input ttw:text-sm ttw:transition-colors ttw:disabled:pointer-events-none ttw:disabled:opacity-50", t === e.type ? "ttw:bg-primary ttw:text-primary-foreground" : "ttw:text-muted-foreground ttw:hover:bg-muted ttw:hover:text-foreground"),
161
+ onClick: () => c(e.type),
164
162
  children: e.label
165
163
  }, e.type))
166
- }), /* @__PURE__ */ k(d, {
164
+ }), /* @__PURE__ */ E("input", {
167
165
  id: e,
168
166
  type: "text",
169
167
  inputMode: "decimal",
170
- className: "ttw:text-right",
168
+ className: w(P, "ttw:pr-3 ttw:pl-2"),
171
169
  "aria-invalid": !!r || void 0,
172
- "aria-describedby": r ? v : void 0,
173
- disabled: f,
170
+ "aria-describedby": r ? h : void 0,
171
+ disabled: a,
174
172
  value: n,
175
- onChange: (e) => m(e.target.value),
176
- onFocus: g,
177
- onBlur: _
173
+ onChange: (e) => s(e.target.value),
174
+ onFocus: l,
175
+ onBlur: m
178
176
  })]
179
177
  })]
180
- }), r && /* @__PURE__ */ k(o, {
181
- id: v,
178
+ }), r && /* @__PURE__ */ E(f, {
179
+ id: h,
182
180
  className: "ttw:text-right",
183
181
  children: r
184
182
  })]
185
183
  });
186
184
  }
187
- function R({ open: r, onOpenChange: j, mode: N = "create", values: P, errors: F, currencyOptions: R, unitOptions: oe, currencySymbol: z, lineItemControls: B, autoFocusLineItemId: V, lineItemsLoading: H, inProgress: U, customerSelector: W, renderProductSelector: G, onChange: K, onLineItemChange: q, onLineItemCommit: se, onLineItemQuantityStep: ce, onTaxRateCommit: le, onDiscountFocus: ue, onDiscountCommit: de, totals: fe, onManageUnits: J, onAddLineItem: pe, onRemoveLineItem: me, showDueDateField: Y, billingSection: he, remindersSection: ge, bankAccountSection: _e, attachmentsSection: ve, cancelDisabled: ye, draftButtonLabel: X, draftDisabled: be, draftLoading: xe, primaryButtonLabel: Se, primaryDisabled: Ce, primaryLoading: we, scrollContainerRef: Te, onSubmit: Ee, onDraftClick: De, onPrimaryClick: Oe, onCancel: ke, labels: Ae }) {
185
+ function R({ open: r, onRequestClose: g, mode: _ = "create", values: v, errors: y, unitOptions: b, currencySymbol: O, lineItemControls: A, autoFocusLineItemId: j, lineItemsLoading: M, inProgress: I, customerSelector: R, renderProductSelector: se, onChange: z, onLineItemChange: B, onLineItemCommit: V, onLineItemQuantityStep: H, onTaxRateCommit: U, onDiscountFocus: W, onDiscountCommit: G, totals: K, onManageUnits: ce, onAddLineItem: le, onRemoveLineItem: ue, showDueDateField: q, onAddCustomerDetailsClick: J, billingSection: de, bankAccountSection: fe, attachmentsSection: pe, preview: me, closeDisabled: he, cancelDisabled: ge, draftButtonLabel: Y, draftDisabled: _e, draftLoading: ve, primaryButtonLabel: ye, primaryDisabled: be, primaryLoading: xe, scrollContainerRef: X, onSubmit: Se, onDraftClick: Ce, onPrimaryClick: we, labels: Te }) {
188
186
  let Z = {
189
- ...ne,
190
- ...Ae
191
- }, Q = ie(), $ = N === "edit", je = D("ttw:grid ttw:gap-4", $ && Y ? "ttw:grid-cols-3" : "ttw:grid-cols-2");
192
- return /* @__PURE__ */ k(x, {
187
+ ...ee,
188
+ ...Te
189
+ }, Q = ne(), $ = _ === "edit";
190
+ return /* @__PURE__ */ E(i, {
193
191
  open: r,
194
- onOpenChange: j,
195
- children: /* @__PURE__ */ A(S, {
196
- ref: Te,
197
- className: "ttw:w-180 ttw:overflow-y-auto ttw:sm:max-w-180",
198
- children: [
199
- /* @__PURE__ */ A(T, { children: [/* @__PURE__ */ k(ee, { children: N === "edit" ? Z.editTitle : Z.createTitle }), /* @__PURE__ */ k(C, {
200
- className: "ttw:sr-only",
201
- children: Z.hiddenDescription
202
- })] }),
203
- /* @__PURE__ */ A("form", {
204
- id: Q,
205
- onSubmit: (e) => {
206
- e.preventDefault(), e.stopPropagation(), Ee();
207
- },
208
- children: [/* @__PURE__ */ k("button", {
209
- type: "submit",
210
- className: "ttw:sr-only",
211
- tabIndex: -1,
212
- "aria-hidden": "true"
213
- }), /* @__PURE__ */ A("div", {
214
- className: "ttw:flex ttw:flex-col ttw:gap-5 ttw:px-6 ttw:pb-6",
215
- children: [
216
- /* @__PURE__ */ A("div", {
217
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
218
- children: [
219
- /* @__PURE__ */ k(f, { children: Z.documentTypeLabel }),
220
- /* @__PURE__ */ A(p, {
221
- className: "ttw:flex ttw:flex-row ttw:gap-6",
222
- disabled: N === "edit",
223
- value: P.type,
224
- onValueChange: (e) => K({ type: e }),
225
- children: [/* @__PURE__ */ A("div", {
226
- className: "ttw:flex ttw:items-center ttw:gap-2",
227
- children: [/* @__PURE__ */ k(m, {
228
- value: "invoice",
229
- id: `${Q}-invoice`
230
- }), /* @__PURE__ */ k(f, {
231
- htmlFor: `${Q}-invoice`,
232
- children: Z.typeInvoice
233
- })]
234
- }), /* @__PURE__ */ A("div", {
235
- className: "ttw:flex ttw:items-center ttw:gap-2",
236
- children: [/* @__PURE__ */ k(m, {
237
- value: "quote",
238
- id: `${Q}-quote`
239
- }), /* @__PURE__ */ k(f, {
240
- htmlFor: `${Q}-quote`,
241
- children: Z.typeQuote
192
+ onOpenChange: (e) => {
193
+ e || g();
194
+ },
195
+ modal: !1,
196
+ children: /* @__PURE__ */ D(a, {
197
+ fullScreen: !0,
198
+ className: "ttw:flex ttw:flex-col ttw:gap-0 ttw:overflow-hidden ttw:p-0",
199
+ onInteractOutside: (e) => e.preventDefault(),
200
+ children: [/* @__PURE__ */ D(c, {
201
+ className: "ttw:w-full ttw:flex-row ttw:items-center ttw:justify-between ttw:border-b ttw:border-border ttw:px-6 ttw:pt-6 ttw:pb-7",
202
+ children: [/* @__PURE__ */ D("div", {
203
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
204
+ children: [/* @__PURE__ */ E(l, {
205
+ className: "ttw:text-3xl ttw:tracking-normal",
206
+ children: _ === "edit" ? Z.editTitle : Z.createTitle
207
+ }), /* @__PURE__ */ E(o, {
208
+ className: w(_ === "edit" && "ttw:sr-only"),
209
+ children: _ === "edit" ? Z.editDescription : Z.createDescription
210
+ })]
211
+ }), /* @__PURE__ */ E(n, {
212
+ type: "button",
213
+ variant: "ghost",
214
+ className: "ttw:p-2 ttw:has-[>svg]:px-2",
215
+ "aria-label": Z.closeButton,
216
+ disabled: he,
217
+ onClick: g,
218
+ children: /* @__PURE__ */ E(ie, { className: "ttw:size-6.5" })
219
+ })]
220
+ }), /* @__PURE__ */ D("div", {
221
+ className: "ttw:flex ttw:min-h-0 ttw:flex-1",
222
+ children: [/* @__PURE__ */ D("div", {
223
+ ref: X,
224
+ className: "ttw:h-full ttw:min-h-0 ttw:w-1/2 ttw:overflow-auto ttw:px-8 ttw:pt-6",
225
+ children: [/* @__PURE__ */ D("form", {
226
+ id: Q,
227
+ noValidate: !0,
228
+ className: "ttw:pb-10",
229
+ onSubmit: (e) => {
230
+ e.preventDefault(), e.stopPropagation(), Se();
231
+ },
232
+ children: [/* @__PURE__ */ E("button", {
233
+ type: "submit",
234
+ className: "ttw:sr-only",
235
+ tabIndex: -1,
236
+ "aria-hidden": "true"
237
+ }), /* @__PURE__ */ D("div", {
238
+ className: "ttw:flex ttw:flex-col ttw:gap-8",
239
+ children: [
240
+ /* @__PURE__ */ D("div", {
241
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:rounded-xl ttw:border ttw:border-border ttw:p-6",
242
+ children: [
243
+ /* @__PURE__ */ D("div", {
244
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:pb-4",
245
+ children: [/* @__PURE__ */ E(C, {
246
+ variant: "h4",
247
+ children: Z.customerHeading
248
+ }), /* @__PURE__ */ E(C, {
249
+ variant: "body2",
250
+ color: "muted",
251
+ className: "ttw:font-medium",
252
+ children: Z.customerDescription
242
253
  })]
243
- })]
244
- }),
245
- /* @__PURE__ */ k(I, { message: F?.type })
246
- ]
247
- }),
248
- /* @__PURE__ */ A("div", {
249
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
250
- children: [
251
- /* @__PURE__ */ k(f, { children: Z.customerLabel }),
252
- W,
253
- /* @__PURE__ */ k("p", {
254
- className: "ttw:text-xs ttw:text-muted-foreground",
255
- children: Z.customerHint
256
- }),
257
- /* @__PURE__ */ k(I, { message: F?.customerId })
258
- ]
259
- }),
260
- /* @__PURE__ */ A("div", {
261
- className: je,
262
- children: [
263
- /* @__PURE__ */ A("div", {
264
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
265
- children: [
266
- /* @__PURE__ */ k(f, {
267
- htmlFor: `${Q}-currency`,
268
- children: Z.currencyLabel
254
+ }),
255
+ R,
256
+ /* @__PURE__ */ E(L, { message: y?.customerId }),
257
+ !v.customerId && /* @__PURE__ */ D(re, { children: [/* @__PURE__ */ E(u, { children: /* @__PURE__ */ D(d, { children: [
258
+ /* @__PURE__ */ E(p, {
259
+ htmlFor: `${Q}-customer-email`,
260
+ children: Z.customerEmailLabel
269
261
  }),
270
- /* @__PURE__ */ A(h, {
271
- value: P.currency,
272
- onValueChange: (e) => K({ currency: e }),
273
- children: [/* @__PURE__ */ k(v, {
274
- id: `${Q}-currency`,
275
- children: /* @__PURE__ */ k(y, {})
276
- }), /* @__PURE__ */ k(g, { children: R.map((e) => /* @__PURE__ */ k(_, {
277
- value: e.value,
278
- children: e.label
279
- }, e.value)) })]
262
+ /* @__PURE__ */ E(m, {
263
+ id: `${Q}-customer-email`,
264
+ type: "email",
265
+ disabled: I,
266
+ "aria-invalid": !!y?.customerEmail || void 0,
267
+ "aria-describedby": y?.customerEmail ? `${Q}-customer-email-error` : void 0,
268
+ value: v.customerEmail,
269
+ onChange: (e) => z({ customerEmail: e.target.value })
280
270
  }),
281
- /* @__PURE__ */ k(I, { message: F?.currency })
282
- ]
283
- }),
284
- $ && /* @__PURE__ */ A("div", {
271
+ y?.customerEmail && /* @__PURE__ */ E(f, {
272
+ id: `${Q}-customer-email-error`,
273
+ children: y.customerEmail
274
+ })
275
+ ] }) }), J && /* @__PURE__ */ D(n, {
276
+ type: "button",
277
+ variant: "ghost",
278
+ disabled: I,
279
+ className: "ttw:w-fit ttw:text-primary ttw:hover:text-primary",
280
+ onClick: J,
281
+ children: [/* @__PURE__ */ E(k, {}), Z.addCustomerDetailsButton]
282
+ })] })
283
+ ]
284
+ }),
285
+ ($ || q) && /* @__PURE__ */ D("div", {
286
+ className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
287
+ children: [$ && /* @__PURE__ */ D("div", {
285
288
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
286
289
  children: [
287
- /* @__PURE__ */ k(f, {
290
+ /* @__PURE__ */ E(h, {
288
291
  htmlFor: `${Q}-issue-date`,
289
292
  children: Z.issueDateLabel
290
293
  }),
291
- /* @__PURE__ */ k(c, {
294
+ /* @__PURE__ */ E(m, {
292
295
  id: `${Q}-issue-date`,
293
296
  type: "date",
294
- value: P.issueDate,
295
- onChange: (e) => K({ issueDate: e.target.value })
297
+ value: v.issueDate,
298
+ onChange: (e) => z({ issueDate: e.target.value })
296
299
  }),
297
- /* @__PURE__ */ k(I, { message: F?.issueDate })
300
+ /* @__PURE__ */ E(L, { message: y?.issueDate })
298
301
  ]
299
- }),
300
- Y && /* @__PURE__ */ A("div", {
302
+ }), q && /* @__PURE__ */ D("div", {
301
303
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
302
304
  children: [
303
- /* @__PURE__ */ k(f, {
305
+ /* @__PURE__ */ E(h, {
304
306
  htmlFor: `${Q}-due-date`,
305
307
  children: Z.dueDateLabel
306
308
  }),
307
- /* @__PURE__ */ k(c, {
309
+ /* @__PURE__ */ E(m, {
308
310
  id: `${Q}-due-date`,
309
311
  type: "date",
310
- value: P.dueDate,
311
- onChange: (e) => K({ dueDate: e.target.value })
312
+ value: v.dueDate,
313
+ onChange: (e) => z({ dueDate: e.target.value })
312
314
  }),
313
- /* @__PURE__ */ k(I, { message: F?.dueDate })
315
+ /* @__PURE__ */ E(L, { message: y?.dueDate })
314
316
  ]
315
- })
316
- ]
317
- }),
318
- he,
319
- ge,
320
- /* @__PURE__ */ A("div", {
321
- className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:rounded-xl ttw:border ttw:border-border ttw:p-6",
322
- children: [
323
- /* @__PURE__ */ A("div", {
324
- className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:pb-4",
325
- children: [/* @__PURE__ */ k(E, {
326
- variant: "h4",
327
- children: Z.lineItemsHeading
328
- }), /* @__PURE__ */ k(E, {
329
- variant: "body2",
330
- color: "muted",
331
- className: "ttw:font-medium",
332
- children: Z.lineItemsDescription
333
- })]
334
- }),
335
- F?.lineItemsSummary?.length ? /* @__PURE__ */ k(e, {
336
- variant: "destructive",
337
- className: "ttw:mb-2",
338
- children: /* @__PURE__ */ k(t, { children: /* @__PURE__ */ k("ul", { children: F.lineItemsSummary.map((e) => /* @__PURE__ */ k("li", { children: e }, e)) }) })
339
- }) : null,
340
- /* @__PURE__ */ A("ul", {
341
- className: "ttw:flex ttw:flex-col ttw:gap-2.5",
342
- children: [/* @__PURE__ */ A("li", {
343
- "aria-hidden": !0,
344
- className: "ttw:flex ttw:h-5 ttw:items-center ttw:gap-2.5 ttw:text-sm ttw:leading-5 ttw:font-medium",
345
- children: [
346
- /* @__PURE__ */ k("span", {
347
- className: "ttw:inline-flex ttw:min-w-30 ttw:flex-1 ttw:whitespace-nowrap",
348
- children: Z.productLabel
349
- }),
350
- /* @__PURE__ */ k("span", {
351
- className: "ttw:w-24 ttw:min-w-24",
352
- children: Z.quantityLabel
353
- }),
354
- /* @__PURE__ */ k("span", {
355
- className: "ttw:w-20.5 ttw:min-w-20.5",
356
- children: Z.unitLabel
357
- }),
358
- /* @__PURE__ */ k("span", {
359
- className: "ttw:w-full ttw:max-w-41 ttw:min-w-29",
360
- children: Z.priceLabel
361
- }),
362
- /* @__PURE__ */ k("span", {
363
- className: "ttw:w-12 ttw:min-w-12",
364
- children: Z.taxableLabel
365
- }),
366
- P.lineItems.length > 1 && /* @__PURE__ */ k("span", { className: "ttw:w-10 ttw:min-w-10" })
367
- ]
368
- }), H ? /* @__PURE__ */ k("li", {
369
- className: "ttw:flex ttw:h-9 ttw:items-center ttw:justify-center",
370
- children: /* @__PURE__ */ k(te, { className: "ttw:size-5" })
371
- }) : P.lineItems.map((e) => /* @__PURE__ */ k(L, {
372
- formId: Q,
373
- lineItem: e,
374
- errors: F?.lineItems?.[e.id],
375
- controls: B?.[e.id],
376
- focusOnMount: e.id === V,
377
- canRemove: P.lineItems.length > 1,
378
- unitOptions: oe,
379
- currencySymbol: z,
317
+ })]
318
+ }),
319
+ de,
320
+ /* @__PURE__ */ D("div", {
321
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:rounded-xl ttw:border ttw:border-border ttw:p-6",
322
+ children: [
323
+ /* @__PURE__ */ D("div", {
324
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:pb-4",
325
+ children: [/* @__PURE__ */ E(C, {
326
+ variant: "h4",
327
+ children: Z.lineItemsHeading
328
+ }), /* @__PURE__ */ E(C, {
329
+ variant: "body2",
330
+ color: "muted",
331
+ className: "ttw:font-medium",
332
+ children: Z.lineItemsDescription
333
+ })]
334
+ }),
335
+ y?.lineItemsSummary?.length ? /* @__PURE__ */ E(e, {
336
+ variant: "destructive",
337
+ className: "ttw:mb-2",
338
+ children: /* @__PURE__ */ E(t, { children: /* @__PURE__ */ E("ul", { children: y.lineItemsSummary.map((e) => /* @__PURE__ */ E("li", { children: e }, e)) }) })
339
+ }) : null,
340
+ /* @__PURE__ */ D("ul", {
341
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5",
342
+ children: [/* @__PURE__ */ D("li", {
343
+ "aria-hidden": !0,
344
+ className: "ttw:flex ttw:h-5 ttw:items-center ttw:gap-2.5 ttw:text-sm ttw:leading-5 ttw:font-medium",
345
+ children: [
346
+ /* @__PURE__ */ E("span", {
347
+ className: "ttw:inline-flex ttw:min-w-30 ttw:flex-1 ttw:whitespace-nowrap",
348
+ children: Z.productLabel
349
+ }),
350
+ /* @__PURE__ */ E("span", {
351
+ className: "ttw:w-24 ttw:min-w-24",
352
+ children: Z.quantityLabel
353
+ }),
354
+ /* @__PURE__ */ E("span", {
355
+ className: "ttw:w-20.5 ttw:min-w-20.5",
356
+ children: Z.unitLabel
357
+ }),
358
+ /* @__PURE__ */ E("span", {
359
+ className: "ttw:w-full ttw:max-w-41 ttw:min-w-29",
360
+ children: Z.priceLabel
361
+ }),
362
+ /* @__PURE__ */ E("span", {
363
+ className: "ttw:w-12 ttw:min-w-12",
364
+ children: Z.taxableLabel
365
+ }),
366
+ v.lineItems.length > 1 && /* @__PURE__ */ E("span", { className: "ttw:w-10 ttw:min-w-10" })
367
+ ]
368
+ }), M ? /* @__PURE__ */ E("li", {
369
+ className: "ttw:flex ttw:h-9 ttw:items-center ttw:justify-center",
370
+ children: /* @__PURE__ */ E(S, { className: "ttw:size-5" })
371
+ }) : v.lineItems.map((e) => /* @__PURE__ */ E(ae, {
372
+ formId: Q,
373
+ lineItem: e,
374
+ errors: y?.lineItems?.[e.id],
375
+ controls: A?.[e.id],
376
+ focusOnMount: e.id === j,
377
+ canRemove: v.lineItems.length > 1,
378
+ unitOptions: b,
379
+ currencySymbol: O,
380
+ labels: Z,
381
+ renderProductSelector: se,
382
+ onChange: (t) => B(e.id, t),
383
+ onCommit: (t) => V(e.id, t),
384
+ onQuantityStep: (t) => H(e.id, t),
385
+ onManageUnits: ce,
386
+ onRemove: () => ue(e.id)
387
+ }, e.id))]
388
+ }),
389
+ /* @__PURE__ */ D(n, {
390
+ type: "button",
391
+ variant: "ghost",
392
+ className: "ttw:w-fit ttw:text-primary ttw:hover:text-primary",
393
+ onClick: le,
394
+ children: [/* @__PURE__ */ E(k, { className: "ttw:size-5 ttw:text-primary" }), Z.addLineItemButton]
395
+ }),
396
+ /* @__PURE__ */ E(oe, {
397
+ inputId: `${Q}-discount`,
398
+ discountType: v.discountType,
399
+ value: v.discount,
400
+ error: y?.discount,
401
+ currencySymbol: O,
402
+ disabled: I,
380
403
  labels: Z,
381
- renderProductSelector: G,
382
- onChange: (t) => q(e.id, t),
383
- onCommit: (t) => se(e.id, t),
384
- onQuantityStep: (t) => ce(e.id, t),
385
- onManageUnits: J,
386
- onRemove: () => me(e.id)
387
- }, e.id))]
388
- }),
389
- /* @__PURE__ */ A(n, {
390
- type: "button",
391
- variant: "ghost",
392
- className: "ttw:w-fit ttw:text-primary ttw:hover:text-primary",
393
- onClick: pe,
394
- children: [/* @__PURE__ */ k(M, { className: "ttw:size-5 ttw:text-primary" }), Z.addLineItemButton]
395
- }),
396
- /* @__PURE__ */ k(ae, {
397
- inputId: `${Q}-discount`,
398
- discountType: P.discountType,
399
- value: P.discount,
400
- error: F?.discount,
401
- currencySymbol: z,
402
- disabled: U,
403
- labels: Z,
404
- onChange: (e) => K({ discount: e }),
405
- onTypeChange: (e) => K({ discountType: e }),
406
- onFocus: ue,
407
- onBlur: de
408
- }),
409
- /* @__PURE__ */ A(i, {
410
- className: "ttw:flex-col",
411
- children: [/* @__PURE__ */ A(a, {
412
- className: "ttw:flex-row ttw:justify-end",
413
- children: [/* @__PURE__ */ k(s, {
414
- htmlFor: `${Q}-tax-rate`,
415
- className: D(F?.taxRate && "ttw:text-destructive"),
416
- children: Z.taxRateLabel
417
- }), /* @__PURE__ */ A(l, {
418
- className: "ttw:w-40 ttw:has-[>[data-align=inline-end]]:[&>input]:pr-0",
419
- children: [/* @__PURE__ */ k(d, {
420
- id: `${Q}-tax-rate`,
421
- className: "ttw:text-right",
422
- placeholder: Z.taxRatePlaceholder,
423
- type: "text",
424
- inputMode: "decimal",
425
- "aria-invalid": !!F?.taxRate || void 0,
426
- "aria-describedby": F?.taxRate ? `${Q}-tax-rate-error` : void 0,
427
- value: P.taxRate,
428
- onChange: (e) => K({ taxRate: e.target.value }),
429
- onBlur: le
430
- }), /* @__PURE__ */ k(u, {
431
- align: "inline-end",
432
- children: Z.taxRateSuffix
404
+ onChange: (e) => z({ discount: e }),
405
+ onTypeChange: (e) => z({ discountType: e }),
406
+ onFocus: W,
407
+ onBlur: G
408
+ }),
409
+ /* @__PURE__ */ D(u, {
410
+ className: "ttw:flex-col",
411
+ children: [/* @__PURE__ */ D(d, {
412
+ className: "ttw:flex-row ttw:justify-end",
413
+ children: [/* @__PURE__ */ E(p, {
414
+ htmlFor: `${Q}-tax-rate`,
415
+ className: w(y?.taxRate && "ttw:text-destructive"),
416
+ children: Z.taxRateLabel
417
+ }), /* @__PURE__ */ D("div", {
418
+ className: w(N, "ttw:w-40"),
419
+ children: [/* @__PURE__ */ E("input", {
420
+ id: `${Q}-tax-rate`,
421
+ className: w(P, "ttw:pl-3"),
422
+ placeholder: Z.taxRatePlaceholder,
423
+ type: "text",
424
+ inputMode: "decimal",
425
+ "aria-invalid": !!y?.taxRate || void 0,
426
+ "aria-describedby": y?.taxRate ? `${Q}-tax-rate-error` : void 0,
427
+ value: v.taxRate,
428
+ onChange: (e) => z({ taxRate: e.target.value }),
429
+ onBlur: U
430
+ }), /* @__PURE__ */ E("span", {
431
+ className: w(F, "ttw:pr-3"),
432
+ children: Z.taxRateSuffix
433
+ })]
433
434
  })]
435
+ }), y?.taxRate && /* @__PURE__ */ E(f, {
436
+ id: `${Q}-tax-rate-error`,
437
+ className: "ttw:text-right",
438
+ children: y.taxRate
434
439
  })]
435
- }), F?.taxRate && /* @__PURE__ */ k(o, {
436
- id: `${Q}-tax-rate-error`,
437
- className: "ttw:text-right",
438
- children: F.taxRate
439
- })]
440
- }),
441
- /* @__PURE__ */ k(b, {}),
442
- /* @__PURE__ */ k(re, {
443
- totals: fe,
444
- labels: Z
445
- })
446
- ]
440
+ }),
441
+ /* @__PURE__ */ E(x, {}),
442
+ /* @__PURE__ */ E(te, {
443
+ totals: K,
444
+ labels: Z
445
+ })
446
+ ]
447
+ }),
448
+ fe,
449
+ /* @__PURE__ */ E(T, {
450
+ idPrefix: Q,
451
+ openingNote: v.openingNote,
452
+ closingNote: v.closingNote,
453
+ openingNoteError: y?.openingNote,
454
+ closingNoteError: y?.closingNote,
455
+ disabled: I,
456
+ onOpeningNoteChange: (e) => z({ openingNote: e }),
457
+ onClosingNoteChange: (e) => z({ closingNote: e }),
458
+ labels: Z
459
+ }),
460
+ pe
461
+ ]
462
+ })]
463
+ }), /* @__PURE__ */ D(s, {
464
+ className: "ttw:sticky ttw:bottom-0 ttw:z-10 ttw:flex-row ttw:items-center ttw:justify-end ttw:gap-4 ttw:bg-background ttw:px-6 ttw:pt-3 ttw:pb-6",
465
+ children: [
466
+ /* @__PURE__ */ E(n, {
467
+ type: "button",
468
+ variant: "outline",
469
+ className: "ttw:border-border",
470
+ disabled: ge,
471
+ onClick: g,
472
+ children: Z.cancelButton
447
473
  }),
448
- _e,
449
- /* @__PURE__ */ k(O, {
450
- idPrefix: Q,
451
- openingNote: P.openingNote,
452
- closingNote: P.closingNote,
453
- openingNoteError: F?.openingNote,
454
- closingNoteError: F?.closingNote,
455
- disabled: U,
456
- onOpeningNoteChange: (e) => K({ openingNote: e }),
457
- onClosingNoteChange: (e) => K({ closingNote: e }),
458
- labels: Z
474
+ Y && /* @__PURE__ */ E(n, {
475
+ type: "submit",
476
+ form: Q,
477
+ variant: "secondary",
478
+ loading: ve,
479
+ disabled: _e,
480
+ onClick: Ce,
481
+ children: Y
459
482
  }),
460
- ve
483
+ /* @__PURE__ */ E(n, {
484
+ type: "submit",
485
+ form: Q,
486
+ loading: xe,
487
+ disabled: be,
488
+ onClick: we,
489
+ children: ye
490
+ })
461
491
  ]
462
492
  })]
463
- }),
464
- /* @__PURE__ */ k(w, { children: /* @__PURE__ */ A("div", {
465
- className: "ttw:flex ttw:justify-end ttw:gap-2",
466
- children: [
467
- /* @__PURE__ */ k(n, {
468
- type: "button",
469
- variant: "ghost",
470
- disabled: ye,
471
- onClick: ke,
472
- children: Z.cancelButton
473
- }),
474
- X && /* @__PURE__ */ k(n, {
475
- type: "submit",
476
- form: Q,
477
- variant: "secondary",
478
- loading: xe,
479
- disabled: be,
480
- onClick: De,
481
- children: X
482
- }),
483
- /* @__PURE__ */ k(n, {
484
- type: "submit",
485
- form: Q,
486
- loading: we,
487
- disabled: Ce,
488
- onClick: Oe,
489
- children: Se
490
- })
491
- ]
492
- }) })
493
- ]
493
+ }), /* @__PURE__ */ E("div", {
494
+ className: "ttw:h-full ttw:min-h-0 ttw:w-1/2 ttw:overflow-auto ttw:bg-linear-to-b ttw:from-[#F6F6F6] ttw:to-[#E4E4FF]",
495
+ children: me
496
+ })]
497
+ })]
494
498
  })
495
499
  });
496
500
  }
497
501
  //#endregion
498
- export { R as ReceivableFormSheet, R as default };
502
+ export { R as ReceivableFormDialog, R as default };