@tesouro/embedded-components-react 0.7.44 → 0.7.46

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 (108) hide show
  1. package/dist/index.d.ts +30 -39
  2. package/dist/lib/CounterpartsWidget.d.ts +29 -22
  3. package/dist/lib/CounterpartsWidgetPublic.d.ts +29 -22
  4. package/dist/lib/CustomersWidget.d.ts +29 -22
  5. package/dist/lib/LinkedAccountsWidget.d.ts +1 -0
  6. package/dist/lib/ReceivablesWidget.d.ts +1 -0
  7. package/dist/lib/WidgetSuite.d.ts +1 -0
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +12 -12
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +15 -15
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +9 -9
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index5.js +30 -30
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js +3 -2
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +7 -6
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index33.js +3 -2
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +9 -8
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index37.js +5 -4
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index48.js +1 -1
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index49.js +1 -1
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index5.js +3 -2
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +40 -40
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +3 -2
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index2.js +1 -1
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +8 -7
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index3.js +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index5.js +1 -1
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index6.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +9 -13
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +7 -10
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +76 -11
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +1 -1
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +27 -9
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +2 -76
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +30 -0
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +1 -1
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +5 -27
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +32 -2
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +2 -30
  38. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/data-access/dist/index.js +1 -2
  39. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index8.js +36 -36
  40. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +73 -77
  41. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +8 -25
  42. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index7.js +197 -208
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +9 -9
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/auditHistory/labels.js +2 -2
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +1 -1
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +2 -2
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +22 -23
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +10 -24
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +53 -37
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +21 -53
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +8 -21
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +77 -8
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +31 -69
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +17 -38
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +40 -17
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +26 -38
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +18 -27
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +8 -18
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +35 -9
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +14 -36
  61. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +26 -14
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +84 -23
  63. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +487 -80
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +2 -494
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +48 -2
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +62 -38
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +438 -61
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +207 -431
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +20 -222
  70. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +6 -21
  71. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +265 -0
  72. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +2 -265
  73. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +131 -2
  74. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +22 -125
  75. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +235 -23
  76. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +3 -240
  77. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +249 -3
  78. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +54 -242
  79. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +221 -51
  80. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +38 -222
  81. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/forms.js +2 -1
  82. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/permissions.js +8 -7
  83. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js +200 -191
  84. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/mocks/linkedAccounts.js +87 -79
  85. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index15.js +1 -0
  86. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index5.js +10 -0
  87. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +11 -10
  88. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/organization/useOrganizationQuery.js +24 -0
  89. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index.js +8 -0
  90. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index2.js +14 -0
  91. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index3.js +13 -0
  92. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index4.js +18 -0
  93. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index5.js +2 -0
  94. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index6.js +20 -0
  95. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index7.js +32 -0
  96. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index8.js +2 -0
  97. package/dist/libs/tesouro-embedded-components-react/{bill-pay-widget → shared/document-status}/util/dist/lib/derivePayableStatus.js +23 -10
  98. package/dist/libs/tesouro-embedded-components-react/shared/document-status/util/dist/lib/receivableFilledTone.js +22 -0
  99. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  100. package/package.json +1 -1
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +0 -18
  102. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +0 -2
  103. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +0 -7
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +0 -34
  105. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +0 -2
  106. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/data-access/dist/index7.js +0 -25
  107. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +0 -8
  108. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js +0 -45
@@ -1,449 +1,225 @@
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 "./index14.js";
3
- import { ReceivableFormTotals as te } from "./index42.js";
4
- import { ReceivableNotesSection as T } from "./index43.js";
5
- import { useId as ne } from "react";
6
- import { jsx as E, jsxs as D } from "react/jsx-runtime";
7
- import { CircleAlertIcon as O, MinusIcon as k, PlusIcon as A, Trash2Icon as j, XIcon as M } from "lucide-react";
1
+ import { Alert as e, AlertDescription as t, Button as n, DatePicker as r, Dialog as i, DialogContent as a, DialogFooter as o, DialogHeader as s, DialogTitle as c, FieldRequirement as l, InputGroup as u, InputGroupAddon as d, InputGroupInput as f, Label as p, Skeleton as m } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { RECEIVABLE_PAYMENT_DIALOG_LABELS_EN as h } from "./index14.js";
3
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
4
+ import { NotebookPen as y } from "lucide-react";
8
5
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js
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
- return e ? /* @__PURE__ */ E("p", {
6
+ var b = {
7
+ amount: "receivable-payment-amount",
8
+ date: "receivable-payment-date",
9
+ time: "receivable-payment-time"
10
+ };
11
+ function x({ id: e, message: t }) {
12
+ return t ? /* @__PURE__ */ _("p", {
13
+ id: e,
12
14
  className: "ttw:text-sm ttw:text-destructive",
13
- children: e
15
+ children: t
14
16
  }) : null;
15
17
  }
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
- let S = `${e}-line-${t.id}`;
18
- return /* @__PURE__ */ D("li", {
19
- className: "ttw:flex ttw:h-9 ttw:items-center ttw:gap-2.5",
20
- children: [
21
- /* @__PURE__ */ E("div", {
22
- className: "ttw:min-w-30 ttw:flex-1",
23
- children: d(t, {
24
- inputId: `${S}-name`,
25
- invalid: !!i?.name,
26
- focusOnMount: o
27
- })
28
- }),
29
- /* @__PURE__ */ D("div", {
30
- className: w(F, "ttw:w-26 ttw:min-w-26 ttw:px-[0.3rem]"),
31
- children: [
32
- /* @__PURE__ */ E("button", {
33
- type: "button",
34
- "aria-label": u.decreaseQuantityButton,
35
- disabled: a ? !a.canDecreaseQuantity : !1,
36
- className: R,
37
- onClick: () => m(-1),
38
- children: /* @__PURE__ */ E(k, { className: "ttw:size-3.5" })
39
- }),
40
- /* @__PURE__ */ E("input", {
41
- id: `${S}-quantity`,
42
- "aria-label": u.quantityLabel,
43
- "aria-invalid": !!i?.quantity || void 0,
44
- type: "text",
45
- inputMode: "decimal",
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
- value: t.quantity,
48
- onChange: (e) => f({ quantity: e.target.value }),
49
- onBlur: () => p("quantity")
50
- }),
51
- /* @__PURE__ */ E("button", {
52
- type: "button",
53
- "aria-label": u.increaseQuantityButton,
54
- disabled: a ? !a.canIncreaseQuantity : !1,
55
- className: R,
56
- onClick: () => m(1),
57
- children: /* @__PURE__ */ E(A, { className: "ttw:size-3.5" })
58
- })
59
- ]
60
- }),
61
- /* @__PURE__ */ E("div", { children: /* @__PURE__ */ D(g, {
62
- value: t.unit || N,
63
- onValueChange: (e) => {
64
- if (e === P) {
65
- h?.();
66
- return;
67
- }
68
- f({ unit: e === N ? "" : e });
69
- },
70
- children: [/* @__PURE__ */ E(y, {
71
- id: `${S}-unit`,
72
- "aria-label": u.unitLabel,
73
- "aria-invalid": !!i?.measureUnit || void 0,
74
- className: "ttw:w-22",
75
- children: /* @__PURE__ */ E(b, {
76
- className: "ttw:truncate",
77
- placeholder: u.unitPlaceholder
78
- })
79
- }), /* @__PURE__ */ D(_, { children: [
80
- h && /* @__PURE__ */ D(v, {
81
- value: P,
82
- className: "ttw:font-semibold ttw:text-primary ttw:hover:text-primary ttw:focus:text-primary",
83
- children: [/* @__PURE__ */ E(A, { className: "ttw:text-primary" }), u.manageUnitsOption]
84
- }),
85
- /* @__PURE__ */ E(v, {
86
- value: N,
87
- children: u.unitNone
88
- }),
89
- c.map((e) => /* @__PURE__ */ E(v, {
90
- value: e.value,
91
- children: e.label
92
- }, e.value))
93
- ] })]
94
- }) }),
95
- /* @__PURE__ */ D("div", {
96
- className: w(F, "ttw:w-full ttw:max-w-41 ttw:min-w-29"),
97
- children: [/* @__PURE__ */ E("span", {
98
- className: w(L, "ttw:pl-3"),
99
- children: l
100
- }), /* @__PURE__ */ E("input", {
101
- id: `${S}-price`,
102
- "aria-label": u.priceLabel,
103
- "aria-invalid": !!i?.price || void 0,
104
- type: "text",
105
- inputMode: "decimal",
106
- className: w(I, "ttw:pr-3 ttw:pl-2"),
107
- value: t.price,
108
- onChange: (e) => f({ price: e.target.value }),
109
- onBlur: () => p("price")
110
- })]
111
- }),
112
- /* @__PURE__ */ E("div", {
113
- className: "ttw:flex ttw:w-12 ttw:min-w-12 ttw:items-center ttw:justify-center",
114
- children: /* @__PURE__ */ E(r, {
115
- id: `${S}-taxable`,
116
- "aria-label": u.taxableLabel,
117
- checked: t.taxable,
118
- onCheckedChange: (e) => f({ taxable: e === !0 })
119
- })
120
- }),
121
- s && /* @__PURE__ */ E(n, {
122
- type: "button",
123
- variant: "ghost",
124
- size: "sm",
125
- "aria-label": u.removeLineItemButton,
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
- onClick: x,
128
- children: /* @__PURE__ */ E(j, {})
129
- })
130
- ]
131
- });
132
- }
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
- let h = `${e}-error`, g = [{
135
- type: "amount",
136
- label: i,
137
- ariaLabel: o.discountAmountOptionAriaLabel
138
- }, {
139
- type: "percentage",
140
- label: o.discountPercentageOption,
141
- ariaLabel: o.discountPercentageOptionAriaLabel
142
- }];
143
- return /* @__PURE__ */ D(u, {
144
- className: "ttw:flex-col",
145
- children: [/* @__PURE__ */ D(d, {
146
- className: "ttw:flex-row ttw:items-center ttw:justify-end",
147
- children: [/* @__PURE__ */ E(p, {
148
- htmlFor: e,
149
- className: w(r && "ttw:text-destructive"),
150
- children: o.discountLabel
151
- }), /* @__PURE__ */ D("div", {
152
- className: w(F, "ttw:w-40 ttw:overflow-hidden"),
153
- children: [/* @__PURE__ */ E("div", {
154
- className: w(L, "ttw:items-stretch ttw:self-stretch"),
155
- children: g.map((e) => /* @__PURE__ */ E("button", {
156
- type: "button",
157
- "aria-label": e.ariaLabel,
158
- "aria-pressed": t === 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),
162
- children: e.label
163
- }, e.type))
164
- }), /* @__PURE__ */ E("input", {
165
- id: e,
166
- type: "text",
167
- inputMode: "decimal",
168
- className: w(I, "ttw:pr-3 ttw:pl-2"),
169
- "aria-invalid": !!r || void 0,
170
- "aria-describedby": r ? h : void 0,
171
- disabled: a,
172
- value: n,
173
- onChange: (e) => s(e.target.value),
174
- onFocus: l,
175
- onBlur: m
176
- })]
177
- })]
178
- }), r && /* @__PURE__ */ E(f, {
179
- id: h,
180
- className: "ttw:text-right",
181
- children: r
18
+ function S({ label: e, children: t }) {
19
+ return /* @__PURE__ */ v("div", {
20
+ className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4 ttw:px-4 ttw:py-3",
21
+ children: [/* @__PURE__ */ _("dt", {
22
+ className: "ttw:text-sm ttw:text-muted-foreground",
23
+ children: e
24
+ }), /* @__PURE__ */ _("dd", {
25
+ className: "ttw:text-sm ttw:font-medium ttw:text-right ttw:break-all",
26
+ children: t
182
27
  })]
183
28
  });
184
29
  }
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
- let Q = {
187
- ...ee,
188
- ...Ce
189
- }, $ = ne();
190
- return /* @__PURE__ */ E(i, {
191
- open: r,
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
- onEscapeKeyDown: (e) => {
201
- let t = e.target;
202
- t instanceof Element && t.closest("[role=\"combobox\"][aria-expanded=\"true\"]") && e.preventDefault();
203
- },
204
- children: [/* @__PURE__ */ D(c, {
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",
206
- children: [/* @__PURE__ */ D("div", {
207
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
208
- children: [/* @__PURE__ */ E(l, {
209
- className: "ttw:text-3xl ttw:tracking-normal",
210
- children: _ === "edit" ? Q.editTitle : Q.createTitle
211
- }), /* @__PURE__ */ E(o, {
212
- className: w(_ === "edit" && "ttw:sr-only"),
213
- children: _ === "edit" ? Q.editDescription : Q.createDescription
30
+ function C({ open: C, onOpenChange: w, step: T, values: E, errors: D, currencySymbol: O, amountDueLabel: k, review: A, inProgress: j, onChange: M, onFillAmountDue: N, onSave: P, onEdit: F, onConfirm: I, onCancel: L, labels: R }) {
31
+ let z = {
32
+ ...h,
33
+ ...R
34
+ };
35
+ return /* @__PURE__ */ _(i, {
36
+ open: C,
37
+ onOpenChange: w,
38
+ children: /* @__PURE__ */ _(a, {
39
+ "aria-describedby": void 0,
40
+ className: "ttw:flex ttw:flex-col ttw:gap-6",
41
+ children: T === "review" && A ? /* @__PURE__ */ v(g, { children: [
42
+ /* @__PURE__ */ v(s, {
43
+ className: "ttw:items-center ttw:text-center",
44
+ children: [
45
+ /* @__PURE__ */ _("div", {
46
+ className: "ttw:flex ttw:size-11 ttw:items-center ttw:justify-center ttw:rounded-full ttw:bg-muted",
47
+ children: /* @__PURE__ */ _(y, { className: "ttw:size-5 ttw:text-muted-foreground" })
48
+ }),
49
+ /* @__PURE__ */ _(c, {
50
+ className: "ttw:text-base ttw:font-normal",
51
+ children: z.reviewTitle
52
+ }),
53
+ /* @__PURE__ */ _("p", {
54
+ className: "ttw:text-2xl ttw:font-semibold",
55
+ children: A.amountLabel
56
+ }),
57
+ /* @__PURE__ */ _("p", {
58
+ className: "ttw:text-sm",
59
+ children: A.fromLabel
60
+ })
61
+ ]
62
+ }),
63
+ /* @__PURE__ */ v("dl", {
64
+ className: "ttw:divide-y ttw:divide-border ttw:rounded-lg ttw:border ttw:border-border",
65
+ children: [
66
+ /* @__PURE__ */ _(S, {
67
+ label: z.receivedLabel,
68
+ children: A.receivedLabel
69
+ }),
70
+ /* @__PURE__ */ _(S, {
71
+ label: z.referenceLabel,
72
+ children: A.referenceLabel
73
+ }),
74
+ /* @__PURE__ */ _(S, {
75
+ label: z.createdByLabel,
76
+ children: A.isCreatedByLoading ? /* @__PURE__ */ _(m, { className: "ttw:h-4 ttw:w-24" }) : A.createdByLabel
77
+ })
78
+ ]
79
+ }),
80
+ /* @__PURE__ */ _(e, {
81
+ className: "ttw:border-amber-200 ttw:bg-amber-50 ttw:text-amber-800",
82
+ children: /* @__PURE__ */ _(t, {
83
+ className: "ttw:text-amber-800",
84
+ children: z.reviewWarning
85
+ })
86
+ }),
87
+ /* @__PURE__ */ v(o, {
88
+ className: "ttw:sm:justify-between",
89
+ children: [/* @__PURE__ */ _(n, {
90
+ variant: "ghost",
91
+ onClick: L,
92
+ children: z.cancelButton
93
+ }), /* @__PURE__ */ v("div", {
94
+ className: "ttw:flex ttw:gap-2",
95
+ children: [/* @__PURE__ */ _(n, {
96
+ variant: "outline",
97
+ disabled: j,
98
+ onClick: F,
99
+ children: z.editRecordButton
100
+ }), /* @__PURE__ */ _(n, {
101
+ disabled: j,
102
+ onClick: I,
103
+ children: z.confirmButton
104
+ })]
214
105
  })]
215
- }), /* @__PURE__ */ E(n, {
216
- type: "button",
217
- variant: "ghost",
218
- className: "ttw:p-2 ttw:has-[>svg]:px-2",
219
- "aria-label": Q.closeButton,
220
- disabled: me,
221
- onClick: g,
222
- children: /* @__PURE__ */ E(M, { className: "ttw:size-6.5" })
223
- })]
224
- }), /* @__PURE__ */ D("div", {
225
- className: "ttw:flex ttw:min-h-0 ttw:flex-1",
226
- children: [/* @__PURE__ */ D("div", {
227
- ref: be,
228
- className: "ttw:h-full ttw:min-h-0 ttw:w-1/2 ttw:overflow-auto ttw:px-8 ttw:pt-6",
229
- children: [/* @__PURE__ */ D("form", {
230
- id: $,
231
- noValidate: !0,
232
- className: "ttw:pb-10",
233
- onSubmit: (e) => {
234
- e.preventDefault(), e.stopPropagation(), xe();
235
- },
236
- children: [/* @__PURE__ */ E("button", {
237
- type: "submit",
238
- className: "ttw:sr-only",
239
- tabIndex: -1,
240
- "aria-hidden": "true",
241
- disabled: X,
242
- onClick: Z
243
- }), /* @__PURE__ */ D("div", {
244
- className: "ttw:flex ttw:flex-col ttw:gap-8",
245
- children: [
246
- z,
247
- le && /* @__PURE__ */ E("div", {
248
- className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
249
- children: /* @__PURE__ */ D("div", {
250
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
251
- children: [
252
- /* @__PURE__ */ E(h, {
253
- htmlFor: `${$}-due-date`,
254
- children: Q.dueDateLabel
255
- }),
256
- /* @__PURE__ */ E(m, {
257
- id: `${$}-due-date`,
258
- type: "date",
259
- value: v.dueDate,
260
- onChange: (e) => V({ dueDate: e.target.value })
261
- }),
262
- /* @__PURE__ */ E(re, { message: y?.dueDate })
263
- ]
106
+ })
107
+ ] }) : /* @__PURE__ */ v("form", {
108
+ className: "ttw:flex ttw:flex-col ttw:gap-6",
109
+ noValidate: !0,
110
+ onSubmit: (e) => {
111
+ e.preventDefault(), P();
112
+ },
113
+ children: [
114
+ /* @__PURE__ */ _(s, { children: /* @__PURE__ */ _(c, { children: z.title }) }),
115
+ /* @__PURE__ */ v("div", {
116
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
117
+ children: [
118
+ /* @__PURE__ */ _(p, {
119
+ htmlFor: b.amount,
120
+ requirement: l.Required,
121
+ children: z.amountLabel
122
+ }),
123
+ /* @__PURE__ */ v(u, { children: [/* @__PURE__ */ _(f, {
124
+ id: b.amount,
125
+ type: "number",
126
+ required: !0,
127
+ placeholder: z.amountPlaceholder,
128
+ "data-has-end-addon": !0,
129
+ "aria-invalid": !!D?.amount || void 0,
130
+ "aria-describedby": D?.amount ? `${b.amount}-error` : void 0,
131
+ value: E.amount,
132
+ onChange: (e) => M({ amount: e.target.value })
133
+ }), /* @__PURE__ */ _(d, {
134
+ align: "inline-end",
135
+ children: O
136
+ })] }),
137
+ /* @__PURE__ */ _(x, {
138
+ id: `${b.amount}-error`,
139
+ message: D?.amount
140
+ }),
141
+ /* @__PURE__ */ v("p", {
142
+ className: "ttw:text-sm ttw:text-muted-foreground",
143
+ children: [
144
+ z.fullAmountDuePrefix,
145
+ " ",
146
+ /* @__PURE__ */ _(n, {
147
+ type: "button",
148
+ variant: "link",
149
+ className: "ttw:h-auto ttw:p-0 ttw:underline",
150
+ onClick: N,
151
+ children: k
264
152
  })
153
+ ]
154
+ })
155
+ ]
156
+ }),
157
+ /* @__PURE__ */ v("div", {
158
+ className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
159
+ children: [/* @__PURE__ */ v("div", {
160
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
161
+ children: [
162
+ /* @__PURE__ */ _(p, {
163
+ htmlFor: b.date,
164
+ requirement: l.Required,
165
+ children: z.dateLabel
265
166
  }),
266
- ue,
267
- /* @__PURE__ */ D("div", {
268
- className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:rounded-xl ttw:border ttw:border-border ttw:p-6",
269
- children: [
270
- /* @__PURE__ */ D("div", {
271
- className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:pb-4",
272
- children: [/* @__PURE__ */ E(C, {
273
- variant: "h4",
274
- children: Q.lineItemsHeading
275
- }), /* @__PURE__ */ E(C, {
276
- variant: "body2",
277
- color: "muted",
278
- className: "ttw:font-medium",
279
- children: Q.lineItemsDescription
280
- })]
281
- }),
282
- y?.lineItemsSummary?.length ? /* @__PURE__ */ D(e, {
283
- variant: "destructive",
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)) }) })]
286
- }) : null,
287
- /* @__PURE__ */ D("ul", {
288
- className: "ttw:flex ttw:flex-col ttw:gap-2.5",
289
- children: [/* @__PURE__ */ D("li", {
290
- "aria-hidden": !0,
291
- className: "ttw:flex ttw:h-5 ttw:items-center ttw:gap-2.5 ttw:text-sm ttw:leading-5 ttw:font-medium",
292
- children: [
293
- /* @__PURE__ */ E("span", {
294
- className: "ttw:inline-flex ttw:min-w-30 ttw:flex-1 ttw:whitespace-nowrap",
295
- children: Q.productLabel
296
- }),
297
- /* @__PURE__ */ E("span", {
298
- className: "ttw:w-24 ttw:min-w-24",
299
- children: Q.quantityLabel
300
- }),
301
- /* @__PURE__ */ E("span", {
302
- className: "ttw:w-20.5 ttw:min-w-20.5",
303
- children: Q.unitLabel
304
- }),
305
- /* @__PURE__ */ E("span", {
306
- className: "ttw:w-full ttw:max-w-41 ttw:min-w-29",
307
- children: Q.priceLabel
308
- }),
309
- /* @__PURE__ */ E("span", {
310
- className: "ttw:w-12 ttw:min-w-12",
311
- children: Q.taxableLabel
312
- }),
313
- v.lineItems.length > 1 && /* @__PURE__ */ E("span", { className: "ttw:w-10 ttw:min-w-10" })
314
- ]
315
- }), P ? /* @__PURE__ */ E("li", {
316
- className: "ttw:flex ttw:h-9 ttw:items-center ttw:justify-center",
317
- children: /* @__PURE__ */ E(S, { className: "ttw:size-5" })
318
- }) : v.lineItems.map((e) => /* @__PURE__ */ E(ie, {
319
- formId: $,
320
- lineItem: e,
321
- errors: y?.lineItems?.[e.id],
322
- controls: j?.[e.id],
323
- focusOnMount: e.id === N,
324
- canRemove: v.lineItems.length > 1,
325
- unitOptions: b,
326
- currencySymbol: k,
327
- labels: Q,
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)
334
- }, e.id))]
335
- }),
336
- /* @__PURE__ */ D(n, {
337
- type: "button",
338
- variant: "ghost",
339
- className: "ttw:w-fit ttw:text-primary ttw:hover:text-primary",
340
- onClick: se,
341
- children: [/* @__PURE__ */ E(A, { className: "ttw:size-5 ttw:text-primary" }), Q.addLineItemButton]
342
- }),
343
- /* @__PURE__ */ E(ae, {
344
- inputId: `${$}-discount`,
345
- discountType: v.discountType,
346
- value: v.discount,
347
- error: y?.discount,
348
- currencySymbol: k,
349
- disabled: R,
350
- labels: Q,
351
- onChange: (e) => V({ discount: e }),
352
- onTypeChange: (e) => V({ discountType: e }),
353
- onFocus: K,
354
- onBlur: q
355
- }),
356
- /* @__PURE__ */ D(u, {
357
- className: "ttw:flex-col",
358
- children: [/* @__PURE__ */ D(d, {
359
- className: "ttw:flex-row ttw:justify-end",
360
- children: [/* @__PURE__ */ E(p, {
361
- htmlFor: `${$}-tax-rate`,
362
- className: w(y?.taxRate && "ttw:text-destructive"),
363
- children: Q.taxRateLabel
364
- }), /* @__PURE__ */ D("div", {
365
- className: w(F, "ttw:w-40"),
366
- children: [/* @__PURE__ */ E("input", {
367
- id: `${$}-tax-rate`,
368
- className: w(I, "ttw:pl-3"),
369
- placeholder: Q.taxRatePlaceholder,
370
- type: "text",
371
- inputMode: "decimal",
372
- "aria-invalid": !!y?.taxRate || void 0,
373
- "aria-describedby": y?.taxRate ? `${$}-tax-rate-error` : void 0,
374
- value: v.taxRate,
375
- onChange: (e) => V({ taxRate: e.target.value }),
376
- onBlur: G
377
- }), /* @__PURE__ */ E("span", {
378
- className: w(L, "ttw:pr-3"),
379
- children: Q.taxRateSuffix
380
- })]
381
- })]
382
- }), y?.taxRate && /* @__PURE__ */ E(f, {
383
- id: `${$}-tax-rate-error`,
384
- className: "ttw:text-right",
385
- children: y.taxRate
386
- })]
387
- }),
388
- /* @__PURE__ */ E(x, {}),
389
- /* @__PURE__ */ E(te, {
390
- totals: J,
391
- labels: Q
392
- })
393
- ]
167
+ /* @__PURE__ */ _(r, {
168
+ id: b.date,
169
+ value: E.paymentDate,
170
+ onChange: (e) => M({ paymentDate: e }),
171
+ placeholder: z.datePlaceholder,
172
+ iconPosition: "end",
173
+ "aria-invalid": !!D?.paymentDate || void 0,
174
+ "aria-describedby": D?.paymentDate ? `${b.date}-error` : void 0
394
175
  }),
395
- de,
396
- /* @__PURE__ */ E(T, {
397
- idPrefix: $,
398
- openingNote: v.openingNote,
399
- closingNote: v.closingNote,
400
- openingNoteError: y?.openingNote,
401
- closingNoteError: y?.closingNote,
402
- disabled: R,
403
- onOpeningNoteChange: (e) => V({ openingNote: e }),
404
- onClosingNoteChange: (e) => V({ closingNote: e }),
405
- labels: Q
176
+ /* @__PURE__ */ _(x, {
177
+ id: `${b.date}-error`,
178
+ message: D?.paymentDate
179
+ })
180
+ ]
181
+ }), /* @__PURE__ */ v("div", {
182
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
183
+ children: [
184
+ /* @__PURE__ */ _(p, {
185
+ htmlFor: b.time,
186
+ requirement: l.Required,
187
+ children: z.timeLabel
406
188
  }),
407
- fe
189
+ /* @__PURE__ */ v(u, { children: [/* @__PURE__ */ _(f, {
190
+ id: b.time,
191
+ type: "time",
192
+ required: !0,
193
+ "data-has-end-addon": !0,
194
+ "aria-invalid": !!D?.paymentTime || void 0,
195
+ "aria-describedby": D?.paymentTime ? `${b.time}-error` : void 0,
196
+ value: E.paymentTime,
197
+ onChange: (e) => M({ paymentTime: e.target.value })
198
+ }), /* @__PURE__ */ _(d, {
199
+ align: "inline-end",
200
+ children: z.timeZoneSuffix
201
+ })] }),
202
+ /* @__PURE__ */ _(x, {
203
+ id: `${b.time}-error`,
204
+ message: D?.paymentTime
205
+ })
408
206
  ]
409
207
  })]
410
- }), /* @__PURE__ */ D(s, {
411
- 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",
412
- children: [
413
- /* @__PURE__ */ E(n, {
414
- type: "button",
415
- variant: "secondary",
416
- className: "ttw:border-border",
417
- disabled: he,
418
- onClick: g,
419
- children: Q.cancelButton
420
- }),
421
- Y && /* @__PURE__ */ E(n, {
422
- type: "submit",
423
- form: $,
424
- variant: "outline",
425
- loading: ge,
426
- disabled: X,
427
- onClick: Z,
428
- children: Y
429
- }),
430
- /* @__PURE__ */ E(n, {
431
- type: "submit",
432
- form: $,
433
- loading: ye,
434
- disabled: ve,
435
- onClick: Se,
436
- children: _e
437
- })
438
- ]
439
- })]
440
- }), /* @__PURE__ */ E("div", {
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]",
442
- children: pe
443
- })]
444
- })]
208
+ }),
209
+ /* @__PURE__ */ v(o, { children: [/* @__PURE__ */ _(n, {
210
+ type: "button",
211
+ variant: "ghost",
212
+ onClick: L,
213
+ children: z.cancelButton
214
+ }), /* @__PURE__ */ _(n, {
215
+ type: "submit",
216
+ loading: j,
217
+ children: z.saveButton
218
+ })] })
219
+ ]
220
+ })
445
221
  })
446
222
  });
447
223
  }
448
224
  //#endregion
449
- export { z as ReceivableFormDialog, z as default };
225
+ export { C as ReceivablePaymentDialog, C as default };