@tesouro/embedded-components-react 0.3.22 → 0.3.24

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 (94) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/lib/BillPayWidget.js +1 -1
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index10.js +10 -10
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +15 -15
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +31 -32
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +42 -1
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +158 -43
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +33 -4
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +1 -16
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +45 -12
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +4 -64
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +13 -26
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +14 -62
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +56 -123
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +18 -3
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +15 -10
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +61 -40
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +130 -50
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +20 -4
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +38 -69
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +48 -46
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +5 -93
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +71 -34
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +48 -139
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +91 -66
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index3.js +22 -5
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +34 -22
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +146 -210
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +72 -209
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +21 -103
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +209 -12
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +211 -44
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +104 -30
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +12 -165
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +47 -35
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +29 -99
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js +64 -5
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +181 -12
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +34 -243
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +104 -4
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +12 -27
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +267 -81
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +4 -145
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +33 -3
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +82 -2
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +155 -37
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +2 -0
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +2 -6
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +2 -6
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +43 -9
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +1 -94
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +8 -3
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +7 -5
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +85 -13
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +3 -59
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +9 -3
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +19 -120
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +56 -8
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +3 -32
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +3 -46
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +116 -15
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +8 -28
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +43 -83
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +19 -47
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +27 -249
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +82 -109
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +47 -206
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +253 -4
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +111 -6
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +6 -39
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +197 -102
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +3 -0
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +6 -23
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +114 -0
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +1 -0
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +25 -0
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +5 -24
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +3 -162
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +9 -6
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +10 -11
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +123 -8
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +2 -170
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +18 -2
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +7 -11
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +163 -82
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +1 -1
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +14 -0
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +108 -0
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +2 -0
  90. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +2 -2
  91. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +27 -27
  92. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  93. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -1
  94. package/package.json +1 -1
@@ -1,165 +1,6 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { useAllBankAccountsQuery as t } from "../../../shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js";
7
- import "../../../shared/data-access/dist/index.js";
8
- import "../../../shared/ui/dist/index.js";
9
- import { useAnalyticsCaptureException as n } from "../../../shared/feature/dist/lib/analytics/hooks.js";
10
- import { formatCalendarDate as r } from "../../../shared/util/dist/lib/formatCalendarDate.js";
11
- import { formatMoneyExact as i } from "../../../shared/util/dist/lib/formatMoneyExact.js";
12
- import { extractApiErrorMessage as a } from "../../../shared/util/dist/lib/apiErrors.js";
13
- import "../../../shared/feature/dist/index.js";
14
- import { maskAccountNumber as o } from "./index5.js";
15
- import { deriveSourceAccountFunds as s, mapSourceAccountOptions as c } from "./index6.js";
16
- import { mergePayBillFlowLabels as l } from "./index7.js";
17
- import { dateToCalendarKey as u, getDefaultPaymentDate as d, isPastEasternDate as f, isTodayInEastern as p } from "./index8.js";
18
- import { useSchedulePaymentMutation as m } from "../../data-access/dist/index9.js";
19
- import "../../data-access/dist/index.js";
20
- import { useMemo as h, useState as g } from "react";
21
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js
22
- function _(e) {
23
- return !!(e?.account_holder_name && e.routing_number && e.account_number);
24
- }
25
- function v({ selectedDate: e, selectedAccount: t, amountDueMinorUnits: n, labels: r }) {
26
- if (!e) return {
27
- ok: !1,
28
- error: r.selectDateError
29
- };
30
- if (f(e)) return {
31
- ok: !1,
32
- error: r.staleDateError
33
- };
34
- if (!t) return {
35
- ok: !1,
36
- error: r.selectAccountError
37
- };
38
- let i = s({
39
- selectedAccount: t,
40
- amountDueMinorUnits: n,
41
- isToday: p(e),
42
- labels: r
43
- });
44
- return i.state === "error" ? {
45
- ok: !1,
46
- error: i.message ?? r.todayInsufficientFunds
47
- } : {
48
- ok: !0,
49
- date: e,
50
- account: t
51
- };
52
- }
53
- function y({ payableId: f, amountDueMinorUnits: y, currencyCode: b = "USD", dueDate: x, vendorName: S, vendorEmail: C, vendorBankAccount: w, poweredByBankName: T, labels: E }) {
54
- let D = h(() => l(E), [E]), O = S ?? D.missingVendorName, [k, A] = g(!1), [j, M] = g(!1), [N, P] = g(() => d()), [F, I] = g(), L = t({ enabled: k || j }), R = m(), z = n(), B = h(() => c(L.data?.data ?? [], D), [L.data?.data, D]), V = B.find((e) => e.id === F), H = N ? p(N) : !1, U = { before: d() }, W = s({
55
- selectedAccount: V,
56
- amountDueMinorUnits: y,
57
- isToday: H,
58
- labels: D
59
- }), G = i(y / 100, { currencyCode: b }), K = N ? r(u(N)) : void 0, q = x ? D.dueDateSuffix(r(x)) : void 0, J = () => v({
60
- selectedDate: N,
61
- selectedAccount: V,
62
- amountDueMinorUnits: y,
63
- labels: D
64
- }), Y = () => {
65
- if (!_(w)) {
66
- e.error(D.missingPaymentInstructionsError);
67
- return;
68
- }
69
- A(!0);
70
- }, X = () => {
71
- M(!1), A(!1);
72
- };
73
- return {
74
- open: Y,
75
- dialogProps: {
76
- open: k,
77
- onOpenChange: A,
78
- amountDueLabel: D.amountDue,
79
- amountDue: G,
80
- dueDateSuffix: q,
81
- paymentAmountLabel: D.paymentAmount,
82
- paymentAmount: G,
83
- selectedDate: N,
84
- selectedDateLabel: K,
85
- calendarDisabled: U,
86
- isToday: H,
87
- selectedAccountId: F,
88
- accounts: B,
89
- poweredByBankName: T,
90
- funds: W,
91
- isAccountsLoading: L.isLoading,
92
- isAccountsError: L.isError,
93
- isSubmitting: R.isPending,
94
- onDateChange: P,
95
- onAccountChange: I,
96
- onReview: () => {
97
- let t = J();
98
- if (!t.ok) {
99
- e.error(t.error);
100
- return;
101
- }
102
- A(!1), M(!0);
103
- },
104
- onCancel: X,
105
- labels: D.scheduleDialog
106
- },
107
- reviewProps: {
108
- open: j,
109
- onOpenChange: M,
110
- amountLabel: D.paymentAmount,
111
- amount: G,
112
- rows: [{
113
- label: D.sourceAccount,
114
- value: V?.primaryLabel ?? ""
115
- }, {
116
- label: D.paymentDate,
117
- value: K ?? ""
118
- }],
119
- payTo: {
120
- name: O,
121
- email: C,
122
- methodLabel: D.achMethod,
123
- fields: _(w) ? [
124
- {
125
- label: D.routingNumber,
126
- value: w.routing_number
127
- },
128
- {
129
- label: D.accountNumber,
130
- value: w.account_number,
131
- maskedValue: o(w.account_number)
132
- },
133
- {
134
- label: D.accountHolder,
135
- value: w.account_holder_name
136
- }
137
- ] : []
138
- },
139
- isSubmitting: R.isPending,
140
- onBack: () => {
141
- M(!1), A(!0);
142
- },
143
- onCancel: X,
144
- onSubmit: async () => {
145
- let t = J();
146
- if (!t.ok) {
147
- M(!1), e.error(t.error), A(!0);
148
- return;
149
- }
150
- try {
151
- await R.mutateAsync({
152
- payableId: f,
153
- paymentDate: u(t.date),
154
- sourceBankAccountId: t.account.id
155
- }), X(), e.success(D.scheduledToast);
156
- } catch (t) {
157
- z(t, { payable_id: f }), e.error(a(t) ?? D.submitError);
158
- }
159
- },
160
- labels: D.reviewDialog
161
- }
162
- };
2
+ function e(e) {
3
+ return e ? `••••${e.slice(-4)}` : void 0;
163
4
  }
164
5
  //#endregion
165
- export { y as usePayBillFlow };
6
+ export { e as maskAccountNumber };
@@ -70,10 +70,13 @@ import "./index78.js";
70
70
  import { REVIEW_TRANSACTION_DIALOG_LABELS_EN as m } from "./index79.js";
71
71
  import { ReviewTransactionDialog as h } from "./index80.js";
72
72
  import "./index81.js";
73
- import { SCHEDULE_PAYMENT_DIALOG_LABELS_EN as g } from "./index82.js";
74
- import { SchedulePaymentDialog as _ } from "./index84.js";
75
- import "./index85.js";
76
- import "./index86.js";
77
- import { SourceDocumentPanel as v } from "./index87.js";
73
+ import { MARK_AS_PAID_DIALOG_LABELS_EN as g } from "./index82.js";
74
+ import { MarkAsPaidDialog as _ } from "./index83.js";
75
+ import "./index84.js";
76
+ import { SCHEDULE_PAYMENT_DIALOG_LABELS_EN as v } from "./index85.js";
77
+ import { SchedulePaymentDialog as y } from "./index87.js";
78
78
  import "./index88.js";
79
- export { e as AddBillDialog, a as BILL_DETAILS_SHEET_LABELS_EN, t as BILL_STATUS_BADGE_LABELS_EN, l as BillColumn, n as BillCreateScreen, i as BillDecisionDialog, o as BillDetailsSheet, s as BillDuplicateNotice, r as BillPayWidgetUi, d as BillUploadStatusTray, c as BillsFilterField, u as BillsScreen, f as DuplicateBillsDialog, p as ExtractionNotice, m as REVIEW_TRANSACTION_DIALOG_LABELS_EN, h as ReviewTransactionDialog, g as SCHEDULE_PAYMENT_DIALOG_LABELS_EN, _ as SchedulePaymentDialog, v as SourceDocumentPanel };
79
+ import "./index89.js";
80
+ import { SourceDocumentPanel as b } from "./index90.js";
81
+ import "./index91.js";
82
+ export { e as AddBillDialog, a as BILL_DETAILS_SHEET_LABELS_EN, t as BILL_STATUS_BADGE_LABELS_EN, l as BillColumn, n as BillCreateScreen, i as BillDecisionDialog, o as BillDetailsSheet, s as BillDuplicateNotice, r as BillPayWidgetUi, d as BillUploadStatusTray, c as BillsFilterField, u as BillsScreen, f as DuplicateBillsDialog, p as ExtractionNotice, g as MARK_AS_PAID_DIALOG_LABELS_EN, _ as MarkAsPaidDialog, m as REVIEW_TRANSACTION_DIALOG_LABELS_EN, h as ReviewTransactionDialog, v as SCHEDULE_PAYMENT_DIALOG_LABELS_EN, y as SchedulePaymentDialog, b as SourceDocumentPanel };
@@ -1,18 +1,17 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js
2
2
  var e = {
3
- title: "Schedule payment",
4
- hiddenDescription: "Choose the account to pay from and the payment date.",
5
- payFrom: "Pay from",
6
- payFromPlaceholder: "Select an account",
3
+ title: "Mark this bill as paid",
4
+ description: "You can't undo this action.",
5
+ amountDue: "Amount due",
6
+ paymentAmount: "Payment amount",
7
7
  paymentDate: "Payment date",
8
- paymentDatePlaceholder: "Choose a date",
8
+ paymentDatePlaceholder: "Select",
9
9
  today: "Today",
10
- noAccounts: "No accounts available",
11
- loadingAccounts: "Loading accounts",
12
- accountsError: "Couldn't load accounts. Try again.",
13
- poweredByBank: (e) => `Powered by ${e}`,
10
+ comments: "Comments",
11
+ commentsOptionalSuffix: "(optional)",
12
+ commentsPlaceholder: "Additional context for this payment.",
14
13
  cancelButton: "Cancel",
15
- reviewButton: "Review payment"
14
+ confirmButton: "Mark as paid"
16
15
  };
17
16
  //#endregion
18
- export { e as SCHEDULE_PAYMENT_DIALOG_LABELS_EN };
17
+ export { e as MARK_AS_PAID_DIALOG_LABELS_EN };
@@ -1,10 +1,125 @@
1
+ import { Badge as e, Button as t, Calendar as n, Dialog as r, DialogContent as i, DialogDescription as a, DialogFooter as o, DialogHeader as s, DialogTitle as c, Label as l, Popover as u, PopoverContent as d, PopoverTrigger as f, Textarea as p } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { MARK_AS_PAID_DIALOG_LABELS_EN as m } from "./index82.js";
3
+ import { useId as h } from "react";
4
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
5
+ import { CalendarIcon as v } from "lucide-react";
1
6
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js
2
- var e = {
3
- neutral: "ttw:text-foreground",
4
- muted: "ttw:text-muted-foreground",
5
- success: "ttw:text-emerald-700",
6
- warning: "ttw:text-amber-700",
7
- error: "ttw:text-destructive"
8
- };
7
+ function y({ open: y, amountDue: b, dueDateSuffix: x, paymentAmount: S, selectedDate: C, selectedDateLabel: w, isToday: T, comment: E, isSubmitting: D, onDateChange: O, onCommentChange: k, onConfirm: A, onCancel: j, testId: M, confirmTestId: N, labels: P }) {
8
+ let F = {
9
+ ...m,
10
+ ...P
11
+ }, I = h(), L = h(), R = h();
12
+ return /* @__PURE__ */ g(r, {
13
+ open: y,
14
+ onOpenChange: (e) => e ? void 0 : j(),
15
+ children: /* @__PURE__ */ _(i, {
16
+ "data-testid": M,
17
+ className: "ttw:flex ttw:max-w-lg ttw:flex-col ttw:gap-3",
18
+ children: [
19
+ /* @__PURE__ */ _(s, { children: [/* @__PURE__ */ g(c, { children: F.title }), /* @__PURE__ */ g(a, { children: F.description })] }),
20
+ /* @__PURE__ */ _("div", {
21
+ className: "ttw:flex ttw:flex-col ttw:gap-3",
22
+ children: [
23
+ /* @__PURE__ */ _("div", {
24
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
25
+ children: [/* @__PURE__ */ g("p", {
26
+ className: "ttw:text-base ttw:text-muted-foreground",
27
+ children: F.amountDue
28
+ }), /* @__PURE__ */ _("div", {
29
+ className: "ttw:flex ttw:flex-wrap ttw:items-end ttw:gap-2",
30
+ children: [/* @__PURE__ */ g("p", {
31
+ className: "ttw:text-4xl ttw:font-semibold ttw:text-foreground",
32
+ children: b
33
+ }), x ? /* @__PURE__ */ g("p", {
34
+ className: "ttw:pb-1 ttw:text-xs ttw:text-muted-foreground",
35
+ children: x
36
+ }) : null]
37
+ })]
38
+ }),
39
+ /* @__PURE__ */ _("div", {
40
+ className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
41
+ children: [/* @__PURE__ */ _("div", {
42
+ className: "ttw:grid ttw:gap-2.5",
43
+ children: [/* @__PURE__ */ g(l, { children: F.paymentAmount }), /* @__PURE__ */ g("div", {
44
+ "aria-disabled": !0,
45
+ className: "ttw:flex ttw:h-9 ttw:items-center ttw:rounded-md ttw:border ttw:border-border ttw:bg-muted ttw:px-3 ttw:text-sm ttw:font-medium ttw:text-muted-foreground",
46
+ children: S
47
+ })]
48
+ }), /* @__PURE__ */ _("div", {
49
+ className: "ttw:grid ttw:gap-2.5",
50
+ children: [/* @__PURE__ */ g(l, {
51
+ id: I,
52
+ children: F.paymentDate
53
+ }), /* @__PURE__ */ _(u, { children: [/* @__PURE__ */ g(f, {
54
+ asChild: !0,
55
+ children: /* @__PURE__ */ _(t, {
56
+ type: "button",
57
+ variant: "outline",
58
+ className: "ttw:justify-start ttw:gap-2",
59
+ "aria-labelledby": `${I} ${L}`,
60
+ children: [
61
+ /* @__PURE__ */ g(v, { className: "ttw:size-4" }),
62
+ /* @__PURE__ */ g("span", {
63
+ id: L,
64
+ children: w ?? F.paymentDatePlaceholder
65
+ }),
66
+ T ? /* @__PURE__ */ g(e, {
67
+ variant: "secondary",
68
+ children: F.today
69
+ }) : null
70
+ ]
71
+ })
72
+ }), /* @__PURE__ */ g(d, {
73
+ align: "start",
74
+ className: "ttw:w-auto ttw:p-0",
75
+ children: /* @__PURE__ */ g(n, {
76
+ mode: "single",
77
+ selected: C,
78
+ onSelect: O
79
+ })
80
+ })] })]
81
+ })]
82
+ }),
83
+ /* @__PURE__ */ _("div", {
84
+ className: "ttw:grid ttw:gap-2.5",
85
+ children: [/* @__PURE__ */ _(l, {
86
+ htmlFor: R,
87
+ children: [
88
+ F.comments,
89
+ " ",
90
+ /* @__PURE__ */ g("span", {
91
+ className: "ttw:font-normal ttw:text-muted-foreground",
92
+ children: F.commentsOptionalSuffix
93
+ })
94
+ ]
95
+ }), /* @__PURE__ */ g(p, {
96
+ id: R,
97
+ value: E,
98
+ placeholder: F.commentsPlaceholder,
99
+ onChange: (e) => k(e.target.value)
100
+ })]
101
+ })
102
+ ]
103
+ }),
104
+ /* @__PURE__ */ _(o, {
105
+ className: "ttw:pt-4 ttw:sm:gap-3",
106
+ children: [/* @__PURE__ */ g(t, {
107
+ type: "button",
108
+ variant: "outline",
109
+ onClick: j,
110
+ children: F.cancelButton
111
+ }), /* @__PURE__ */ g(t, {
112
+ type: "button",
113
+ "data-testid": N,
114
+ disabled: !C,
115
+ loading: D,
116
+ onClick: A,
117
+ children: F.confirmButton
118
+ })]
119
+ })
120
+ ]
121
+ })
122
+ });
123
+ }
9
124
  //#endregion
10
- export { e as TONE_TEXT_CLASS };
125
+ export { y as MarkAsPaidDialog, y as default };
@@ -1,170 +1,2 @@
1
- import { Badge as e, Button as t, Calendar as n, Dialog as r, DialogContent as i, DialogDescription as a, DialogFooter as o, DialogHeader as ee, DialogTitle as s, Label as c, Popover as l, PopoverContent as u, PopoverTrigger as d, Select as f, SelectContent as p, SelectItem as m, SelectTrigger as h, SelectValue as g, cn as _ } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { SCHEDULE_PAYMENT_DIALOG_LABELS_EN as v } from "./index82.js";
3
- import { TONE_TEXT_CLASS as y } from "./index83.js";
4
- import { useId as b } from "react";
5
- import { jsx as x, jsxs as S } from "react/jsx-runtime";
6
- import { CalendarIcon as C } from "lucide-react";
7
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js
8
- var w = {
9
- sufficient: y.muted,
10
- warning: y.warning,
11
- error: y.error
12
- };
13
- function T({ open: y, onOpenChange: T, amountDueLabel: E, amountDue: D, dueDateSuffix: O, paymentAmountLabel: k, paymentAmount: A, selectedDate: j, selectedDateLabel: M, calendarDisabled: N, isToday: P, selectedAccountId: F, accounts: I, poweredByBankName: L, funds: R, isAccountsLoading: z, isAccountsError: B, isSubmitting: V, onDateChange: H, onAccountChange: U, onReview: W, onCancel: G, testId: K, labels: q }) {
14
- let J = {
15
- ...v,
16
- ...q
17
- }, Y = b(), X = b(), Z = b(), Q = z || B || I.length === 0, $ = I.find((e) => e.id === F);
18
- return /* @__PURE__ */ x(r, {
19
- open: y,
20
- onOpenChange: (e) => e ? T(e) : G(),
21
- children: /* @__PURE__ */ S(i, {
22
- "data-testid": K,
23
- className: "ttw:flex ttw:max-w-lg ttw:flex-col ttw:gap-3",
24
- children: [
25
- /* @__PURE__ */ S(ee, { children: [/* @__PURE__ */ x(s, { children: J.title }), /* @__PURE__ */ x(a, {
26
- className: "ttw:sr-only",
27
- children: J.hiddenDescription
28
- })] }),
29
- /* @__PURE__ */ S("div", {
30
- className: "ttw:flex ttw:flex-col ttw:gap-3",
31
- children: [
32
- /* @__PURE__ */ S("div", {
33
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
34
- children: [/* @__PURE__ */ x("p", {
35
- className: "ttw:text-base ttw:text-muted-foreground",
36
- children: E
37
- }), /* @__PURE__ */ S("div", {
38
- className: "ttw:flex ttw:flex-wrap ttw:items-end ttw:gap-2",
39
- children: [/* @__PURE__ */ x("p", {
40
- className: "ttw:text-4xl ttw:font-semibold ttw:text-foreground",
41
- children: D
42
- }), O ? /* @__PURE__ */ x("p", {
43
- className: "ttw:pb-1 ttw:text-xs ttw:text-muted-foreground",
44
- children: O
45
- }) : null]
46
- })]
47
- }),
48
- /* @__PURE__ */ S("div", {
49
- className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
50
- children: [/* @__PURE__ */ S("div", {
51
- className: "ttw:grid ttw:gap-2.5",
52
- children: [/* @__PURE__ */ x(c, { children: k }), /* @__PURE__ */ x("div", {
53
- "aria-disabled": !0,
54
- className: "ttw:flex ttw:h-9 ttw:items-center ttw:rounded-md ttw:border ttw:border-border ttw:bg-muted ttw:px-3 ttw:text-sm ttw:font-medium ttw:text-muted-foreground",
55
- children: A
56
- })]
57
- }), /* @__PURE__ */ S("div", {
58
- className: "ttw:grid ttw:gap-2.5",
59
- children: [/* @__PURE__ */ x(c, {
60
- id: Y,
61
- children: J.paymentDate
62
- }), /* @__PURE__ */ S(l, { children: [/* @__PURE__ */ x(d, {
63
- asChild: !0,
64
- children: /* @__PURE__ */ S(t, {
65
- type: "button",
66
- variant: "outline",
67
- className: "ttw:justify-start ttw:gap-2",
68
- "aria-labelledby": `${Y} ${X}`,
69
- children: [
70
- /* @__PURE__ */ x(C, { className: "ttw:size-4" }),
71
- /* @__PURE__ */ x("span", {
72
- id: X,
73
- children: M ?? J.paymentDatePlaceholder
74
- }),
75
- P ? /* @__PURE__ */ x(e, {
76
- variant: "secondary",
77
- children: J.today
78
- }) : null
79
- ]
80
- })
81
- }), /* @__PURE__ */ x(u, {
82
- align: "start",
83
- className: "ttw:w-auto ttw:p-0",
84
- children: /* @__PURE__ */ x(n, {
85
- mode: "single",
86
- selected: j,
87
- onSelect: H,
88
- disabled: N
89
- })
90
- })] })]
91
- })]
92
- }),
93
- /* @__PURE__ */ S("div", {
94
- className: "ttw:grid ttw:gap-2.5",
95
- children: [
96
- /* @__PURE__ */ x(c, {
97
- id: Z,
98
- children: J.payFrom
99
- }),
100
- /* @__PURE__ */ S(f, {
101
- value: F,
102
- disabled: Q,
103
- onValueChange: U,
104
- children: [/* @__PURE__ */ x(h, {
105
- className: "ttw:w-full ttw:data-[size=default]:h-14",
106
- "aria-labelledby": Z,
107
- children: $ ? /* @__PURE__ */ S("span", {
108
- className: "ttw:flex ttw:w-full ttw:items-center ttw:gap-3",
109
- children: [/* @__PURE__ */ S("span", {
110
- className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:flex-col ttw:text-left",
111
- children: [/* @__PURE__ */ x("span", {
112
- className: "ttw:truncate",
113
- children: $.primaryLabel
114
- }), $.secondaryLabel ? /* @__PURE__ */ x("span", {
115
- className: "ttw:truncate ttw:text-xs ttw:text-muted-foreground",
116
- children: $.secondaryLabel
117
- }) : null]
118
- }), L ? /* @__PURE__ */ x(e, {
119
- variant: "secondary",
120
- className: "ttw:shrink-0",
121
- children: J.poweredByBank(L)
122
- }) : null]
123
- }) : /* @__PURE__ */ x(g, { placeholder: J.payFromPlaceholder })
124
- }), /* @__PURE__ */ x(p, { children: I.map((e) => /* @__PURE__ */ x(m, {
125
- value: e.id,
126
- children: /* @__PURE__ */ S("span", {
127
- className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:flex-col",
128
- children: [/* @__PURE__ */ x("span", {
129
- className: "ttw:truncate",
130
- children: e.primaryLabel
131
- }), e.secondaryLabel ? /* @__PURE__ */ x("span", {
132
- className: "ttw:truncate ttw:text-xs ttw:text-muted-foreground",
133
- children: e.secondaryLabel
134
- }) : null]
135
- })
136
- }, e.id)) })]
137
- }),
138
- Q ? /* @__PURE__ */ x("p", {
139
- className: _("ttw:text-sm", B ? "ttw:text-destructive" : "ttw:text-muted-foreground"),
140
- role: B ? "alert" : void 0,
141
- children: z ? J.loadingAccounts : B ? J.accountsError : J.noAccounts
142
- }) : null
143
- ]
144
- }),
145
- R.message ? /* @__PURE__ */ x("p", {
146
- className: _("ttw:text-sm", w[R.state]),
147
- children: R.message
148
- }) : null
149
- ]
150
- }),
151
- /* @__PURE__ */ S(o, {
152
- className: "ttw:pt-4 ttw:sm:gap-3",
153
- children: [/* @__PURE__ */ x(t, {
154
- type: "button",
155
- variant: "outline",
156
- onClick: G,
157
- children: J.cancelButton
158
- }), /* @__PURE__ */ x(t, {
159
- type: "button",
160
- loading: V,
161
- onClick: W,
162
- children: J.reviewButton
163
- })]
164
- })
165
- ]
166
- })
167
- });
168
- }
169
- //#endregion
170
- export { T as SchedulePaymentDialog, T as default };
1
+ import "./index82.js";
2
+ import "./index83.js";
@@ -1,2 +1,18 @@
1
- import "./index82.js";
2
- import "./index84.js";
1
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js
2
+ var e = {
3
+ title: "Schedule payment",
4
+ hiddenDescription: "Choose the account to pay from and the payment date.",
5
+ payFrom: "Pay from",
6
+ payFromPlaceholder: "Select an account",
7
+ paymentDate: "Payment date",
8
+ paymentDatePlaceholder: "Choose a date",
9
+ today: "Today",
10
+ noAccounts: "No accounts available",
11
+ loadingAccounts: "Loading accounts",
12
+ accountsError: "Couldn't load accounts. Try again.",
13
+ poweredByBank: (e) => `Powered by ${e}`,
14
+ cancelButton: "Cancel",
15
+ reviewButton: "Review payment"
16
+ };
17
+ //#endregion
18
+ export { e as SCHEDULE_PAYMENT_DIALOG_LABELS_EN };
@@ -1,14 +1,10 @@
1
- import { BILL_UPLOAD_DROPZONE_LABELS_EN as e } from "./index2.js";
2
- import "./index5.js";
3
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js
4
- var t = {
5
- uploadHeading: "Attach an invoice (optional)",
6
- scannedAttachment: (e) => `Scanned attachment: ${e}`,
7
- scanning: "Scanning attachment…",
8
- scanningAttachment: (e) => `Scanning attachment: ${e}`,
9
- download: "Download the scanned attachment",
10
- delete: "Delete the scanned attachment",
11
- dropzone: e
2
+ var e = {
3
+ neutral: "ttw:text-foreground",
4
+ muted: "ttw:text-muted-foreground",
5
+ success: "ttw:text-emerald-700",
6
+ warning: "ttw:text-amber-700",
7
+ error: "ttw:text-destructive"
12
8
  };
13
9
  //#endregion
14
- export { t as SOURCE_DOCUMENT_PANEL_LABELS_EN };
10
+ export { e as TONE_TEXT_CLASS };