@tesouro/embedded-components-react 0.5.293 → 0.5.294

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 (48) hide show
  1. package/README.md +1 -1
  2. package/dist/index.d.ts +26 -1
  3. package/dist/lib/CounterpartsWidget.d.ts +2 -0
  4. package/dist/lib/CounterpartsWidgetPublic.d.ts +2 -0
  5. package/dist/lib/CustomersWidget.d.ts +2 -0
  6. package/dist/lib/ReceivablesWidget.d.ts +26 -1
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +4 -4
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +3 -2
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index14.js +5 -88
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index15.js +70 -173
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index16.js +210 -17
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index17.js +29 -0
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +6 -7
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +142 -141
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +84 -54
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +21 -3
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/paymentTerms.js +27 -27
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurrence.js +2 -1
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/reminders.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/totals.js +13 -10
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +84 -80
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActionsModal.js +1 -1
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +32 -30
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +417 -414
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableIssuePreflight.js +1 -1
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableReminders.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableStatusCards.js +1 -1
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +83 -66
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +133 -129
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useSendReceivableWithPaymentLink.js +26 -22
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useUtcDayStart.js +16 -0
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +0 -1
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +20 -22
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +2 -2
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +1 -1
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +91 -85
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +1 -0
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +119 -88
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +19 -16
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +130 -96
  41. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +24 -8
  42. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +2 -0
  43. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +101 -98
  44. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js +34 -20
  45. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  46. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index6.js +4 -3
  47. package/dist/packages/shared-ui-shadcn/dist/index.js +15 -10
  48. package/package.json +1 -1
@@ -2,7 +2,6 @@
2
2
  var e = {
3
3
  recurrenceRepeatLabel: "Repeat this invoice",
4
4
  recurrenceMonthDayLead: "on the",
5
- recurrenceMonthDayTrail: "day of every month",
6
5
  recurrenceWeekdayLead: "on",
7
6
  recurrenceStartOnLabel: "Start on",
8
7
  recurrenceEndChoiceLead: "and end",
@@ -3,11 +3,11 @@ import { RECEIVABLE_ACTION_DIALOG_LABELS_EN as l } from "./index14.js";
3
3
  import { useId as u } from "react";
4
4
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
5
5
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js
6
- function p({ open: p, onOpenChange: m, title: h, description: g, confirmLabel: _, cancelLabel: v, cancelVariant: y = "ghost", destructive: b, error: x, inProgress: S, comment: C, onCommentChange: w, onConfirm: T, onCancel: E, labels: D }) {
7
- let O = {
6
+ function p({ open: p, onOpenChange: m, title: h, description: g, confirmLabel: _, cancelLabel: v, cancelVariant: y = "ghost", destructive: b, inProgress: x, comment: S, onCommentChange: C, onConfirm: w, onCancel: T, labels: E }) {
7
+ let D = {
8
8
  ...l,
9
- ...D
10
- }, k = u();
9
+ ...E
10
+ }, O = u();
11
11
  return /* @__PURE__ */ d(t, {
12
12
  open: p,
13
13
  onOpenChange: m,
@@ -16,35 +16,33 @@ function p({ open: p, onOpenChange: m, title: h, description: g, confirmLabel: _
16
16
  children: [
17
17
  /* @__PURE__ */ f(a, { children: [/* @__PURE__ */ d(o, { children: h }), /* @__PURE__ */ d(r, {
18
18
  className: "ttw:whitespace-pre-line",
19
- children: g
19
+ children: Array.isArray(g) ? g.map((e) => /* @__PURE__ */ d("span", {
20
+ className: "ttw:block",
21
+ children: e
22
+ }, e)) : g
20
23
  })] }),
21
- C !== void 0 && /* @__PURE__ */ f("div", {
24
+ S !== void 0 && /* @__PURE__ */ f("div", {
22
25
  className: "ttw:flex ttw:flex-col ttw:gap-2",
23
26
  children: [/* @__PURE__ */ d(s, {
24
- htmlFor: k,
25
- children: O.commentLabel
27
+ htmlFor: O,
28
+ children: D.commentLabel
26
29
  }), /* @__PURE__ */ d(c, {
27
- id: k,
30
+ id: O,
28
31
  rows: 3,
29
- placeholder: O.commentPlaceholder,
30
- value: C,
31
- onChange: (e) => w?.(e.target.value)
32
+ placeholder: D.commentPlaceholder,
33
+ value: S,
34
+ onChange: (e) => C?.(e.target.value)
32
35
  })]
33
36
  }),
34
- x && /* @__PURE__ */ d("p", {
35
- role: "alert",
36
- className: "ttw:rounded-md ttw:bg-destructive/10 ttw:px-3 ttw:py-2 ttw:text-sm ttw:text-destructive",
37
- children: x
38
- }),
39
37
  /* @__PURE__ */ f(i, { children: [/* @__PURE__ */ d(e, {
40
38
  variant: y,
41
- onClick: E,
42
- children: v ?? O.cancelButton
39
+ onClick: T,
40
+ children: v ?? D.cancelButton
43
41
  }), /* @__PURE__ */ d(e, {
44
42
  variant: b ? "destructive" : "default",
45
- loading: S,
46
- onClick: T,
47
- children: _ ?? O.confirmButton
43
+ loading: x,
44
+ onClick: w,
45
+ children: _ ?? D.confirmButton
48
46
  })] })
49
47
  ]
50
48
  })
@@ -135,8 +135,8 @@ function b({ idPrefix: b, card: x, picker: S, create: C, disabled: w, inputRef:
135
135
  ]
136
136
  }), S.open && !w ? /* @__PURE__ */ m("div", {
137
137
  role: "presentation",
138
- className: "ttw:absolute ttw:top-full ttw:left-0 ttw:z-50 ttw:mt-1.5 ttw:w-full ttw:overflow-hidden ttw:rounded-md ttw:bg-popover ttw:text-popover-foreground ttw:shadow-md ttw:ring-1 ttw:ring-foreground/10",
139
- onMouseDown: (e) => e.preventDefault(),
138
+ className: d("ttw:absolute ttw:top-full ttw:left-0 ttw:z-50 ttw:mt-1.5 ttw:w-full ttw:overflow-hidden ttw:rounded-md ttw:bg-popover ttw:text-popover-foreground ttw:shadow-md ttw:ring-1 ttw:ring-foreground/10", !S.options.length && "ttw:pointer-events-none"),
139
+ onMouseDown: S.options.length ? (e) => e.preventDefault() : void 0,
140
140
  children: /* @__PURE__ */ h("ul", {
141
141
  id: S.listId,
142
142
  role: "listbox",
@@ -21,7 +21,7 @@ function z({ open: z, onOpenChange: B, details: V, message: H, isLoading: U, onA
21
21
  let q = {
22
22
  ...ne,
23
23
  ...pe
24
- }, J = V?.panel, Y = !U && !H && !!(V && J), me = J?.amountTone === "danger", X = (e) => q[g[e]], Z = V ? _[V.status] : void 0, Q = J?.recurringSeries, $ = V && J && J.primaryActions.length > 0 ? /* @__PURE__ */ N("div", {
24
+ }, J = V?.panel, Y = !U && !H && !!(V && J), me = J?.amountTone === "danger", X = (e) => J?.actionLabels?.[e] ?? q[g[e]], Z = V ? _[V.status] : void 0, Q = J?.recurringSeries, $ = V && J && J.primaryActions.length > 0 ? /* @__PURE__ */ N("div", {
25
25
  className: "ttw:flex ttw:items-center ttw:gap-2 ttw:border-t ttw:border-border ttw:pt-3",
26
26
  children: J.primaryActions.map((e, t) => {
27
27
  let n = ie[e], r = t === J.primaryActions.length - 1;
@@ -4,16 +4,16 @@ import { ReceivableFormTotals as te } from "./index42.js";
4
4
  import { ReceivableNotesSection as T } from "./index43.js";
5
5
  import { useId as ne } from "react";
6
6
  import { jsx as E, jsxs as D } from "react/jsx-runtime";
7
- import { MinusIcon as O, PlusIcon as k, Trash2Icon as A, XIcon as j } from "lucide-react";
7
+ import { CircleAlertIcon as O, MinusIcon as k, PlusIcon as A, Trash2Icon as j, XIcon as M } from "lucide-react";
8
8
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js
9
- var M = "__none__", N = "__manage__", P = "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", F = "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", I = "ttw:flex ttw:items-center ttw:text-sm ttw:font-medium ttw:text-muted-foreground ttw:select-none", L = "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 R({ message: e }) {
9
+ var N = "__none__", P = "__manage__", F = "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", I = "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", L = "ttw:flex ttw:items-center ttw:text-sm ttw:font-medium ttw:text-muted-foreground ttw:select-none", R = "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 re({ message: e }) {
11
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 re({ 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 }) {
16
+ function ie({ 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
17
  let S = `${e}-line-${t.id}`;
18
18
  return /* @__PURE__ */ D("li", {
19
19
  className: "ttw:flex ttw:h-9 ttw:items-center ttw:gap-2.5",
@@ -27,15 +27,15 @@ function re({ formId: e, lineItem: t, errors: i, controls: a, focusOnMount: o, c
27
27
  })
28
28
  }),
29
29
  /* @__PURE__ */ D("div", {
30
- className: w(P, "ttw:w-26 ttw:min-w-26 ttw:px-[0.3rem]"),
30
+ className: w(F, "ttw:w-26 ttw:min-w-26 ttw:px-[0.3rem]"),
31
31
  children: [
32
32
  /* @__PURE__ */ E("button", {
33
33
  type: "button",
34
34
  "aria-label": u.decreaseQuantityButton,
35
35
  disabled: a ? !a.canDecreaseQuantity : !1,
36
- className: L,
36
+ className: R,
37
37
  onClick: () => m(-1),
38
- children: /* @__PURE__ */ E(O, { className: "ttw:size-3.5" })
38
+ children: /* @__PURE__ */ E(k, { className: "ttw:size-3.5" })
39
39
  }),
40
40
  /* @__PURE__ */ E("input", {
41
41
  id: `${S}-quantity`,
@@ -52,20 +52,20 @@ function re({ formId: e, lineItem: t, errors: i, controls: a, focusOnMount: o, c
52
52
  type: "button",
53
53
  "aria-label": u.increaseQuantityButton,
54
54
  disabled: a ? !a.canIncreaseQuantity : !1,
55
- className: L,
55
+ className: R,
56
56
  onClick: () => m(1),
57
- children: /* @__PURE__ */ E(k, { className: "ttw:size-3.5" })
57
+ children: /* @__PURE__ */ E(A, { className: "ttw:size-3.5" })
58
58
  })
59
59
  ]
60
60
  }),
61
- /* @__PURE__ */ D(g, {
62
- value: t.unit || M,
61
+ /* @__PURE__ */ E("div", { children: /* @__PURE__ */ D(g, {
62
+ value: t.unit || N,
63
63
  onValueChange: (e) => {
64
- if (e === N) {
64
+ if (e === P) {
65
65
  h?.();
66
66
  return;
67
67
  }
68
- f({ unit: e === M ? "" : e });
68
+ f({ unit: e === N ? "" : e });
69
69
  },
70
70
  children: [/* @__PURE__ */ E(y, {
71
71
  id: `${S}-unit`,
@@ -78,12 +78,12 @@ function re({ formId: e, lineItem: t, errors: i, controls: a, focusOnMount: o, c
78
78
  })
79
79
  }), /* @__PURE__ */ D(_, { children: [
80
80
  h && /* @__PURE__ */ D(v, {
81
- value: N,
81
+ value: P,
82
82
  className: "ttw:font-semibold ttw:text-primary ttw:hover:text-primary ttw:focus:text-primary",
83
- children: [/* @__PURE__ */ E(k, { className: "ttw:text-primary" }), u.manageUnitsOption]
83
+ children: [/* @__PURE__ */ E(A, { className: "ttw:text-primary" }), u.manageUnitsOption]
84
84
  }),
85
85
  /* @__PURE__ */ E(v, {
86
- value: M,
86
+ value: N,
87
87
  children: u.unitNone
88
88
  }),
89
89
  c.map((e) => /* @__PURE__ */ E(v, {
@@ -91,11 +91,11 @@ function re({ formId: e, lineItem: t, errors: i, controls: a, focusOnMount: o, c
91
91
  children: e.label
92
92
  }, e.value))
93
93
  ] })]
94
- }),
94
+ }) }),
95
95
  /* @__PURE__ */ D("div", {
96
- className: w(P, "ttw:w-full ttw:max-w-41 ttw:min-w-29"),
96
+ className: w(F, "ttw:w-full ttw:max-w-41 ttw:min-w-29"),
97
97
  children: [/* @__PURE__ */ E("span", {
98
- className: w(I, "ttw:pl-3"),
98
+ className: w(L, "ttw:pl-3"),
99
99
  children: l
100
100
  }), /* @__PURE__ */ E("input", {
101
101
  id: `${S}-price`,
@@ -103,7 +103,7 @@ function re({ formId: e, lineItem: t, errors: i, controls: a, focusOnMount: o, c
103
103
  "aria-invalid": !!i?.price || void 0,
104
104
  type: "text",
105
105
  inputMode: "decimal",
106
- className: w(F, "ttw:pr-3 ttw:pl-2"),
106
+ className: w(I, "ttw:pr-3 ttw:pl-2"),
107
107
  value: t.price,
108
108
  onChange: (e) => f({ price: e.target.value }),
109
109
  onBlur: () => p("price")
@@ -125,12 +125,12 @@ function re({ formId: e, lineItem: t, errors: i, controls: a, focusOnMount: o, c
125
125
  "aria-label": u.removeLineItemButton,
126
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",
127
127
  onClick: x,
128
- children: /* @__PURE__ */ E(A, {})
128
+ children: /* @__PURE__ */ E(j, {})
129
129
  })
130
130
  ]
131
131
  });
132
132
  }
133
- function z({ inputId: e, discountType: t, value: n, error: r, currencySymbol: i, disabled: a, labels: o, onChange: s, onTypeChange: c, onFocus: l, onBlur: m }) {
133
+ function ae({ inputId: e, discountType: t, value: n, error: r, currencySymbol: i, disabled: a, labels: o, onChange: s, onTypeChange: c, onFocus: l, onBlur: m }) {
134
134
  let h = `${e}-error`, g = [{
135
135
  type: "amount",
136
136
  label: i,
@@ -149,9 +149,9 @@ function z({ inputId: e, discountType: t, value: n, error: r, currencySymbol: i,
149
149
  className: w(r && "ttw:text-destructive"),
150
150
  children: o.discountLabel
151
151
  }), /* @__PURE__ */ D("div", {
152
- className: w(P, "ttw:w-40 ttw:overflow-hidden"),
152
+ className: w(F, "ttw:w-40 ttw:overflow-hidden"),
153
153
  children: [/* @__PURE__ */ E("div", {
154
- className: w(I, "ttw:items-stretch ttw:self-stretch"),
154
+ className: w(L, "ttw:items-stretch ttw:self-stretch"),
155
155
  children: g.map((e) => /* @__PURE__ */ E("button", {
156
156
  type: "button",
157
157
  "aria-label": e.ariaLabel,
@@ -165,7 +165,7 @@ function z({ inputId: e, discountType: t, value: n, error: r, currencySymbol: i,
165
165
  id: e,
166
166
  type: "text",
167
167
  inputMode: "decimal",
168
- className: w(F, "ttw:pr-3 ttw:pl-2"),
168
+ className: w(I, "ttw:pr-3 ttw:pl-2"),
169
169
  "aria-invalid": !!r || void 0,
170
170
  "aria-describedby": r ? h : void 0,
171
171
  disabled: a,
@@ -182,10 +182,10 @@ function z({ inputId: e, discountType: t, value: n, error: r, currencySymbol: i,
182
182
  })]
183
183
  });
184
184
  }
185
- function B({ open: r, onRequestClose: g, mode: _ = "create", values: v, errors: y, unitOptions: b, currencySymbol: O, lineItemControls: A, autoFocusLineItemId: M, lineItemsLoading: N, inProgress: L, customerSection: B, renderProductSelector: V, onChange: H, onLineItemChange: U, onLineItemCommit: W, onLineItemQuantityStep: G, onTaxRateCommit: K, onDiscountFocus: q, onDiscountCommit: J, totals: Y, onManageUnits: X, onAddLineItem: ie, onRemoveLineItem: ae, showDueDateField: oe, billingSection: se, bankAccountSection: ce, attachmentsSection: le, preview: ue, closeDisabled: de, cancelDisabled: fe, draftButtonLabel: Z, draftDisabled: pe, draftLoading: me, primaryButtonLabel: he, primaryDisabled: ge, primaryLoading: _e, scrollContainerRef: ve, onSubmit: ye, onDraftClick: be, onPrimaryClick: xe, labels: Se }) {
185
+ function z({ open: r, onRequestClose: g, mode: _ = "create", values: v, errors: y, unitOptions: b, currencySymbol: k, lineItemControls: j, autoFocusLineItemId: N, lineItemsLoading: P, inProgress: R, customerSection: z, renderProductSelector: B, onChange: V, onLineItemChange: H, onLineItemCommit: U, onLineItemQuantityStep: W, onTaxRateCommit: G, onDiscountFocus: K, onDiscountCommit: q, totals: J, onManageUnits: oe, onAddLineItem: se, onRemoveLineItem: ce, showDueDateField: le, billingSection: ue, bankAccountSection: de, attachmentsSection: fe, preview: pe, closeDisabled: me, cancelDisabled: he, draftButtonLabel: Y, draftDisabled: X, draftLoading: ge, primaryButtonLabel: _e, primaryDisabled: ve, primaryLoading: ye, scrollContainerRef: be, onSubmit: xe, onDraftClick: Z, onPrimaryClick: Se, labels: Ce }) {
186
186
  let Q = {
187
187
  ...ee,
188
- ...Se
188
+ ...Ce
189
189
  }, $ = ne();
190
190
  return /* @__PURE__ */ E(i, {
191
191
  open: r,
@@ -197,6 +197,10 @@ function B({ open: r, onRequestClose: g, mode: _ = "create", values: v, errors:
197
197
  fullScreen: !0,
198
198
  className: "ttw:flex ttw:flex-col ttw:gap-0 ttw:overflow-hidden ttw:p-0",
199
199
  onInteractOutside: (e) => e.preventDefault(),
200
+ onEscapeKeyDown: (e) => {
201
+ let t = e.target;
202
+ t instanceof Element && t.closest("[role=\"combobox\"][aria-expanded=\"true\"]") && e.preventDefault();
203
+ },
200
204
  children: [/* @__PURE__ */ D(c, {
201
205
  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
206
  children: [/* @__PURE__ */ D("div", {
@@ -213,32 +217,34 @@ function B({ open: r, onRequestClose: g, mode: _ = "create", values: v, errors:
213
217
  variant: "ghost",
214
218
  className: "ttw:p-2 ttw:has-[>svg]:px-2",
215
219
  "aria-label": Q.closeButton,
216
- disabled: de,
220
+ disabled: me,
217
221
  onClick: g,
218
- children: /* @__PURE__ */ E(j, { className: "ttw:size-6.5" })
222
+ children: /* @__PURE__ */ E(M, { className: "ttw:size-6.5" })
219
223
  })]
220
224
  }), /* @__PURE__ */ D("div", {
221
225
  className: "ttw:flex ttw:min-h-0 ttw:flex-1",
222
226
  children: [/* @__PURE__ */ D("div", {
223
- ref: ve,
227
+ ref: be,
224
228
  className: "ttw:h-full ttw:min-h-0 ttw:w-1/2 ttw:overflow-auto ttw:px-8 ttw:pt-6",
225
229
  children: [/* @__PURE__ */ D("form", {
226
230
  id: $,
227
231
  noValidate: !0,
228
232
  className: "ttw:pb-10",
229
233
  onSubmit: (e) => {
230
- e.preventDefault(), e.stopPropagation(), ye();
234
+ e.preventDefault(), e.stopPropagation(), xe();
231
235
  },
232
236
  children: [/* @__PURE__ */ E("button", {
233
237
  type: "submit",
234
238
  className: "ttw:sr-only",
235
239
  tabIndex: -1,
236
- "aria-hidden": "true"
240
+ "aria-hidden": "true",
241
+ disabled: X,
242
+ onClick: Z
237
243
  }), /* @__PURE__ */ D("div", {
238
244
  className: "ttw:flex ttw:flex-col ttw:gap-8",
239
245
  children: [
240
- B,
241
- oe && /* @__PURE__ */ E("div", {
246
+ z,
247
+ le && /* @__PURE__ */ E("div", {
242
248
  className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
243
249
  children: /* @__PURE__ */ D("div", {
244
250
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
@@ -251,13 +257,13 @@ function B({ open: r, onRequestClose: g, mode: _ = "create", values: v, errors:
251
257
  id: `${$}-due-date`,
252
258
  type: "date",
253
259
  value: v.dueDate,
254
- onChange: (e) => H({ dueDate: e.target.value })
260
+ onChange: (e) => V({ dueDate: e.target.value })
255
261
  }),
256
- /* @__PURE__ */ E(R, { message: y?.dueDate })
262
+ /* @__PURE__ */ E(re, { message: y?.dueDate })
257
263
  ]
258
264
  })
259
265
  }),
260
- se,
266
+ ue,
261
267
  /* @__PURE__ */ D("div", {
262
268
  className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:rounded-xl ttw:border ttw:border-border ttw:p-6",
263
269
  children: [
@@ -273,10 +279,10 @@ function B({ open: r, onRequestClose: g, mode: _ = "create", values: v, errors:
273
279
  children: Q.lineItemsDescription
274
280
  })]
275
281
  }),
276
- y?.lineItemsSummary?.length ? /* @__PURE__ */ E(e, {
282
+ y?.lineItemsSummary?.length ? /* @__PURE__ */ D(e, {
277
283
  variant: "destructive",
278
- className: "ttw:mb-2",
279
- children: /* @__PURE__ */ E(t, { children: /* @__PURE__ */ E("ul", { children: y.lineItemsSummary.map((e) => /* @__PURE__ */ E("li", { children: e }, e)) }) })
284
+ className: "ttw:flex ttw:mb-2",
285
+ children: [/* @__PURE__ */ E(O, {}), /* @__PURE__ */ E(t, { children: /* @__PURE__ */ E("ul", { children: y.lineItemsSummary.map((e) => /* @__PURE__ */ E("li", { children: e }, e)) }) })]
280
286
  }) : null,
281
287
  /* @__PURE__ */ D("ul", {
282
288
  className: "ttw:flex ttw:flex-col ttw:gap-2.5",
@@ -306,46 +312,46 @@ function B({ open: r, onRequestClose: g, mode: _ = "create", values: v, errors:
306
312
  }),
307
313
  v.lineItems.length > 1 && /* @__PURE__ */ E("span", { className: "ttw:w-10 ttw:min-w-10" })
308
314
  ]
309
- }), N ? /* @__PURE__ */ E("li", {
315
+ }), P ? /* @__PURE__ */ E("li", {
310
316
  className: "ttw:flex ttw:h-9 ttw:items-center ttw:justify-center",
311
317
  children: /* @__PURE__ */ E(S, { className: "ttw:size-5" })
312
- }) : v.lineItems.map((e) => /* @__PURE__ */ E(re, {
318
+ }) : v.lineItems.map((e) => /* @__PURE__ */ E(ie, {
313
319
  formId: $,
314
320
  lineItem: e,
315
321
  errors: y?.lineItems?.[e.id],
316
- controls: A?.[e.id],
317
- focusOnMount: e.id === M,
322
+ controls: j?.[e.id],
323
+ focusOnMount: e.id === N,
318
324
  canRemove: v.lineItems.length > 1,
319
325
  unitOptions: b,
320
- currencySymbol: O,
326
+ currencySymbol: k,
321
327
  labels: Q,
322
- renderProductSelector: V,
323
- onChange: (t) => U(e.id, t),
324
- onCommit: (t) => W(e.id, t),
325
- onQuantityStep: (t) => G(e.id, t),
326
- onManageUnits: X,
327
- onRemove: () => ae(e.id)
328
+ renderProductSelector: B,
329
+ onChange: (t) => H(e.id, t),
330
+ onCommit: (t) => U(e.id, t),
331
+ onQuantityStep: (t) => W(e.id, t),
332
+ onManageUnits: oe,
333
+ onRemove: () => ce(e.id)
328
334
  }, e.id))]
329
335
  }),
330
336
  /* @__PURE__ */ D(n, {
331
337
  type: "button",
332
338
  variant: "ghost",
333
339
  className: "ttw:w-fit ttw:text-primary ttw:hover:text-primary",
334
- onClick: ie,
335
- children: [/* @__PURE__ */ E(k, { className: "ttw:size-5 ttw:text-primary" }), Q.addLineItemButton]
340
+ onClick: se,
341
+ children: [/* @__PURE__ */ E(A, { className: "ttw:size-5 ttw:text-primary" }), Q.addLineItemButton]
336
342
  }),
337
- /* @__PURE__ */ E(z, {
343
+ /* @__PURE__ */ E(ae, {
338
344
  inputId: `${$}-discount`,
339
345
  discountType: v.discountType,
340
346
  value: v.discount,
341
347
  error: y?.discount,
342
- currencySymbol: O,
343
- disabled: L,
348
+ currencySymbol: k,
349
+ disabled: R,
344
350
  labels: Q,
345
- onChange: (e) => H({ discount: e }),
346
- onTypeChange: (e) => H({ discountType: e }),
347
- onFocus: q,
348
- onBlur: J
351
+ onChange: (e) => V({ discount: e }),
352
+ onTypeChange: (e) => V({ discountType: e }),
353
+ onFocus: K,
354
+ onBlur: q
349
355
  }),
350
356
  /* @__PURE__ */ D(u, {
351
357
  className: "ttw:flex-col",
@@ -356,20 +362,20 @@ function B({ open: r, onRequestClose: g, mode: _ = "create", values: v, errors:
356
362
  className: w(y?.taxRate && "ttw:text-destructive"),
357
363
  children: Q.taxRateLabel
358
364
  }), /* @__PURE__ */ D("div", {
359
- className: w(P, "ttw:w-40"),
365
+ className: w(F, "ttw:w-40"),
360
366
  children: [/* @__PURE__ */ E("input", {
361
367
  id: `${$}-tax-rate`,
362
- className: w(F, "ttw:pl-3"),
368
+ className: w(I, "ttw:pl-3"),
363
369
  placeholder: Q.taxRatePlaceholder,
364
370
  type: "text",
365
371
  inputMode: "decimal",
366
372
  "aria-invalid": !!y?.taxRate || void 0,
367
373
  "aria-describedby": y?.taxRate ? `${$}-tax-rate-error` : void 0,
368
374
  value: v.taxRate,
369
- onChange: (e) => H({ taxRate: e.target.value }),
370
- onBlur: K
375
+ onChange: (e) => V({ taxRate: e.target.value }),
376
+ onBlur: G
371
377
  }), /* @__PURE__ */ E("span", {
372
- className: w(I, "ttw:pr-3"),
378
+ className: w(L, "ttw:pr-3"),
373
379
  children: Q.taxRateSuffix
374
380
  })]
375
381
  })]
@@ -381,24 +387,24 @@ function B({ open: r, onRequestClose: g, mode: _ = "create", values: v, errors:
381
387
  }),
382
388
  /* @__PURE__ */ E(x, {}),
383
389
  /* @__PURE__ */ E(te, {
384
- totals: Y,
390
+ totals: J,
385
391
  labels: Q
386
392
  })
387
393
  ]
388
394
  }),
389
- ce,
395
+ de,
390
396
  /* @__PURE__ */ E(T, {
391
397
  idPrefix: $,
392
398
  openingNote: v.openingNote,
393
399
  closingNote: v.closingNote,
394
400
  openingNoteError: y?.openingNote,
395
401
  closingNoteError: y?.closingNote,
396
- disabled: L,
397
- onOpeningNoteChange: (e) => H({ openingNote: e }),
398
- onClosingNoteChange: (e) => H({ closingNote: e }),
402
+ disabled: R,
403
+ onOpeningNoteChange: (e) => V({ openingNote: e }),
404
+ onClosingNoteChange: (e) => V({ closingNote: e }),
399
405
  labels: Q
400
406
  }),
401
- le
407
+ fe
402
408
  ]
403
409
  })]
404
410
  }), /* @__PURE__ */ D(s, {
@@ -406,38 +412,38 @@ function B({ open: r, onRequestClose: g, mode: _ = "create", values: v, errors:
406
412
  children: [
407
413
  /* @__PURE__ */ E(n, {
408
414
  type: "button",
409
- variant: "outline",
415
+ variant: "secondary",
410
416
  className: "ttw:border-border",
411
- disabled: fe,
417
+ disabled: he,
412
418
  onClick: g,
413
419
  children: Q.cancelButton
414
420
  }),
415
- Z && /* @__PURE__ */ E(n, {
421
+ Y && /* @__PURE__ */ E(n, {
416
422
  type: "submit",
417
423
  form: $,
418
- variant: "secondary",
419
- loading: me,
420
- disabled: pe,
421
- onClick: be,
422
- children: Z
424
+ variant: "outline",
425
+ loading: ge,
426
+ disabled: X,
427
+ onClick: Z,
428
+ children: Y
423
429
  }),
424
430
  /* @__PURE__ */ E(n, {
425
431
  type: "submit",
426
432
  form: $,
427
- loading: _e,
428
- disabled: ge,
429
- onClick: xe,
430
- children: he
433
+ loading: ye,
434
+ disabled: ve,
435
+ onClick: Se,
436
+ children: _e
431
437
  })
432
438
  ]
433
439
  })]
434
440
  }), /* @__PURE__ */ E("div", {
435
441
  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]",
436
- children: ue
442
+ children: pe
437
443
  })]
438
444
  })]
439
445
  })
440
446
  });
441
447
  }
442
448
  //#endregion
443
- export { B as ReceivableFormDialog, B as default };
449
+ export { z as ReceivableFormDialog, z as default };
@@ -169,6 +169,7 @@ function C({ open: C, onOpenChange: w, step: T, values: E, errors: D, currencySy
169
169
  value: E.paymentDate,
170
170
  onChange: (e) => M({ paymentDate: e }),
171
171
  placeholder: z.datePlaceholder,
172
+ iconPosition: "end",
172
173
  "aria-invalid": !!D?.paymentDate || void 0,
173
174
  "aria-describedby": D?.paymentDate ? `${b.date}-error` : void 0
174
175
  }),