@tesouro/embedded-components-react 0.11.0 → 0.11.2

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 (56) hide show
  1. package/dist/experimental/QuickViewWidget.d.ts +11 -0
  2. package/dist/experimental/RemoteCheckCapture.d.ts +11 -0
  3. package/dist/experimental/index.d.ts +11 -0
  4. package/dist/index.css +509 -61
  5. package/dist/index.d.ts +54 -13
  6. package/dist/lib/AcceptDisclosuresWidget.d.ts +11 -0
  7. package/dist/lib/BalancesWidget.d.ts +11 -0
  8. package/dist/lib/BankAccountOnboardingWidget.d.ts +11 -0
  9. package/dist/lib/BankAccountsWidget.d.ts +11 -0
  10. package/dist/lib/BankingComplianceBannerWidget.d.ts +11 -0
  11. package/dist/lib/BillPayWidget.d.ts +11 -0
  12. package/dist/lib/CardDetailsWidget.d.ts +11 -0
  13. package/dist/lib/CounterpartsWidget.d.ts +11 -0
  14. package/dist/lib/CounterpartsWidgetPublic.d.ts +11 -0
  15. package/dist/lib/CreditCardsWidget.d.ts +11 -0
  16. package/dist/lib/CustomersWidget.d.ts +11 -0
  17. package/dist/lib/DebitCardsWidget.d.ts +11 -0
  18. package/dist/lib/ExpenseManagementWidget.d.ts +11 -0
  19. package/dist/lib/InsightsWidget.d.ts +11 -0
  20. package/dist/lib/LinkedAccountsWidget.d.ts +11 -0
  21. package/dist/lib/OfferWidget.d.ts +11 -0
  22. package/dist/lib/ProductsWidget.d.ts +11 -0
  23. package/dist/lib/ReceivablesWidget.d.ts +11 -0
  24. package/dist/lib/SettingsWidget.d.ts +11 -0
  25. package/dist/lib/TransfersWidget.d.ts +54 -13
  26. package/dist/lib/WidgetProvider.d.ts +11 -0
  27. package/dist/lib/WidgetProviderPublic.d.ts +11 -0
  28. package/dist/lib/WidgetSuite.d.ts +54 -13
  29. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  30. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +15 -12
  31. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/AmountInput/AmountInput.js +30 -0
  32. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/LoadingRegion/LoadingRegion.js +14 -1
  33. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/MaskedAccountNumber/MaskedAccountNumber.js +57 -0
  34. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/MaskedAccountNumber/labels.js +7 -0
  35. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/TransfersWidgetInner.js +4 -2
  36. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/testIds.js +2 -2
  37. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/transferViews.js +10 -17
  38. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/useTransferMoneyModalController.js +159 -218
  39. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/mocks/labels.js +1 -1
  40. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/ReviewTransferStep.js +37 -88
  41. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/TransferMoneyModal.js +184 -245
  42. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/TransferResultStep.js +43 -58
  43. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/reviewTransferStepLabels.js +6 -5
  44. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/transferResultStepLabels.js +7 -6
  45. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/useFocusFirstInvalidField.js +9 -0
  46. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransferAccountValue.js +32 -0
  47. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransferDetailSheet.js +68 -101
  48. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransfersWidget.js +155 -153
  49. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/labels.js +20 -11
  50. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/maskLabels.js +7 -0
  51. package/dist/packages/shared-ui-shadcn/dist/index.js +1850 -1607
  52. package/package.json +1 -1
  53. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/TransferMoneyModalHeader.js +0 -29
  54. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/TransferReviewAccountCard.js +0 -64
  55. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransferAccountTile.js +0 -14
  56. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransferStatusBadge.js +0 -17
@@ -1,271 +1,210 @@
1
- import { Button as e, Dialog as t, DialogContent as n, DialogFooter as r, Input as i, Label as a, Select as o, SelectContent as s, SelectItem as c, SelectTrigger as l, Separator as u, Typography as d } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
1
+ import { Button as e, FieldError as t, FieldRequirement as n, FlowDialog as r, Label as i, Select as a, SelectContent as o, SelectItem as s, SelectTrigger as c } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { AmountInput as l } from "../../../../../shared/ui/dist/lib/AmountInput/AmountInput.js";
3
+ import { MaskedAccountNumber as u } from "../../../../../shared/ui/dist/lib/MaskedAccountNumber/MaskedAccountNumber.js";
4
+ import "../../../../../shared/ui/dist/index.js";
5
+ import { maskLabels as d } from "../TransfersWidget/maskLabels.js";
2
6
  import { ReviewTransferStep as f } from "./ReviewTransferStep.js";
3
- import { TransferMoneyModalHeader as p } from "./TransferMoneyModalHeader.js";
4
- import { TransferResultStep as m } from "./TransferResultStep.js";
5
- import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
6
- import { ArrowRight as v } from "lucide-react";
7
+ import { TransferResultStep as p } from "./TransferResultStep.js";
8
+ import { useFocusFirstInvalidField as m } from "./useFocusFirstInvalidField.js";
9
+ import { useId as h } from "react";
10
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
7
11
  // ../../libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/TransferMoneyModal.js
8
- var y = "ttw:flex ttw:h-auto ttw:min-h-14 ttw:w-full ttw:cursor-pointer ttw:items-center ttw:justify-start ttw:rounded-lg ttw:border-border ttw:px-5 ttw:py-3.5 ttw:text-left ttw:text-base ttw:font-normal ttw:text-foreground ttw:disabled:cursor-not-allowed ttw:[&_svg]:ml-auto ttw:[&_svg]:shrink-0", b = {
12
+ var v = {
9
13
  position: "popper",
10
14
  align: "start",
11
15
  sideOffset: 4
12
16
  };
13
- function x(e) {
17
+ function y(e) {
14
18
  return [
15
19
  e.primaryLabel,
16
- e.secondaryLabel,
20
+ e.number?.last4,
17
21
  e.balanceLabel
18
22
  ].filter(Boolean).join(" ");
19
23
  }
20
- function S({ opt: e, balanceInsetEnd: t }) {
21
- return /* @__PURE__ */ _("div", {
22
- className: "ttw:grid ttw:w-full ttw:min-w-0 ttw:grid-cols-[minmax(0,1fr)_auto] ttw:items-center ttw:gap-3",
23
- children: [/* @__PURE__ */ _("span", {
24
- className: "ttw:flex ttw:min-w-0 ttw:items-center ttw:gap-2 ttw:overflow-hidden",
25
- children: [/* @__PURE__ */ g("span", {
26
- className: "ttw:min-w-0 ttw:truncate ttw:rounded-full ttw:bg-primary/10 ttw:px-2.5 ttw:py-0.5 ttw:text-sm ttw:font-medium ttw:text-primary",
24
+ function b({ opt: e, numberLabels: t }) {
25
+ return /* @__PURE__ */ _("span", {
26
+ className: "ttw:flex ttw:w-full ttw:min-w-0 ttw:items-center ttw:gap-2",
27
+ children: [
28
+ /* @__PURE__ */ g("span", {
29
+ className: "ttw:min-w-0 ttw:truncate",
27
30
  children: e.primaryLabel
28
- }), e.secondaryLabel ? /* @__PURE__ */ g("span", {
29
- className: "ttw:shrink-0 ttw:text-sm ttw:text-foreground",
30
- children: e.secondaryLabel
31
- }) : null]
32
- }), e.balanceLabel ? /* @__PURE__ */ g("span", {
33
- className: t ? "ttw:justify-self-end ttw:shrink-0 ttw:pr-1.5 ttw:text-sm ttw:text-muted-foreground" : "ttw:justify-self-end ttw:shrink-0 ttw:text-sm ttw:text-muted-foreground",
34
- children: e.balanceLabel
35
- }) : null]
31
+ }),
32
+ e.number ? /* @__PURE__ */ g("span", {
33
+ className: "ttw:shrink-0 ttw:text-muted-foreground",
34
+ children: /* @__PURE__ */ g(u, {
35
+ last4: e.number.last4,
36
+ labels: t
37
+ })
38
+ }) : null,
39
+ e.balanceLabel ? /* @__PURE__ */ g("span", {
40
+ className: "ttw:ml-auto ttw:shrink-0 ttw:pl-2 ttw:text-muted-foreground ttw:tabular-nums",
41
+ children: e.balanceLabel
42
+ }) : null
43
+ ]
36
44
  });
37
45
  }
38
- function C({ value: e, options: t, placeholder: n }) {
39
- let r = t.find((t) => t.optionValue === e);
40
- return r ? /* @__PURE__ */ g(S, { opt: r }) : /* @__PURE__ */ g("span", {
41
- className: "ttw:block ttw:w-full ttw:text-left ttw:text-muted-foreground",
42
- children: n
46
+ function x({ label: e, placeholder: r, value: l, options: u, onValueChange: d, error: f, testId: p, numberLabels: m }) {
47
+ let x = h(), S = `${x}-label`, C = `${x}-value`, w = `${x}-error`, T = u.find((e) => e.optionValue === l);
48
+ return /* @__PURE__ */ _("div", {
49
+ className: "ttw:flex ttw:flex-col ttw:gap-2",
50
+ children: [
51
+ /* @__PURE__ */ g(i, {
52
+ id: S,
53
+ htmlFor: x,
54
+ requirement: n.Required,
55
+ children: e
56
+ }),
57
+ /* @__PURE__ */ _(a, {
58
+ value: l,
59
+ onValueChange: d,
60
+ children: [/* @__PURE__ */ g(c, {
61
+ id: x,
62
+ className: "ttw:w-full",
63
+ "data-testid": p,
64
+ "aria-labelledby": `${S} ${C}`,
65
+ "aria-required": !0,
66
+ "aria-invalid": f ? !0 : void 0,
67
+ "aria-describedby": f ? w : void 0,
68
+ children: /* @__PURE__ */ g("span", {
69
+ id: C,
70
+ className: "ttw:flex ttw:min-w-0 ttw:flex-1",
71
+ children: T ? /* @__PURE__ */ g(b, {
72
+ opt: T,
73
+ numberLabels: m
74
+ }) : /* @__PURE__ */ g("span", {
75
+ className: "ttw:text-muted-foreground",
76
+ children: r
77
+ })
78
+ })
79
+ }), /* @__PURE__ */ g(o, {
80
+ ...v,
81
+ children: u.map((e) => /* @__PURE__ */ g(s, {
82
+ value: e.optionValue,
83
+ textValue: y(e),
84
+ className: "ttw:[&>span:last-of-type]:w-full ttw:[&>span:last-of-type]:min-w-0",
85
+ "data-testid": `embedded-banking-transfer-money-account-option-${e.optionValue}`,
86
+ children: /* @__PURE__ */ g(b, {
87
+ opt: e,
88
+ numberLabels: m
89
+ })
90
+ }, e.optionValue))
91
+ })]
92
+ }),
93
+ f ? /* @__PURE__ */ g(t, {
94
+ id: w,
95
+ children: f
96
+ }) : null
97
+ ]
43
98
  });
44
99
  }
45
- function w(e) {
46
- return e.map((e) => /* @__PURE__ */ g(c, {
47
- value: e.optionValue,
48
- textValue: x(e),
49
- className: "ttw:cursor-pointer ttw:py-3 ttw:pr-6 ttw:[&>span:last-of-type]:min-w-0 ttw:[&>span:last-of-type]:w-full",
50
- "data-testid": `embedded-banking-transfer-money-account-option-${e.optionValue}`,
51
- children: /* @__PURE__ */ g(S, {
52
- opt: e,
53
- balanceInsetEnd: !0
54
- })
55
- }, e.optionValue));
56
- }
57
- function T(e, t, n) {
58
- if (!e) return n;
59
- let r = t.find((t) => t.optionValue === e);
60
- return r ? x(r) : n;
61
- }
62
- function E({ open: c, onOpenChange: x, step: S, labels: E, fromOptions: D, toOptions: O, fromValue: k, toValue: A, onFromValueChange: j, onToValueChange: M, amountValue: N, onAmountValueChange: P, amountError: F, amountInputPrefix: I, reviewFromAccount: L, reviewToAccount: R, reviewAmountLabel: z, isSubmitting: B, isSuccess: V, canContinueFromAccounts: H, canContinueFromAmount: U, onContinueFromAccounts: W, onContinueFromAmount: G, onBack: K, onSubmit: q, onClearSelections: J, testIds: Y }) {
63
- let X = /* @__PURE__ */ g(u, {
64
- decorative: !0,
65
- orientation: "horizontal",
66
- className: "ttw:-mx-6",
67
- style: { width: "calc(100% + 3rem)" }
68
- });
69
- return /* @__PURE__ */ g(t, {
70
- open: c,
71
- onOpenChange: x,
72
- children: /* @__PURE__ */ _(n, {
73
- showCloseButton: !0,
74
- closeButtonTestId: Y?.closeButton,
75
- labels: { close: E.modalClose },
76
- className: "ttw:max-w-md ttw:gap-0 ttw:p-6",
77
- "data-testid": Y?.root,
78
- children: [S === "result" ? null : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(p, {
79
- title: S === "review" ? E.modalReviewHeading : E.modalTitle,
80
- subtitle: E.modalAccountsSubtitle
81
- }), X] }), S === "accounts" ? /* @__PURE__ */ _(h, { children: [
100
+ function S({ open: a, onOpenChange: o, step: s, stepLabel: c, labels: u, fromOptions: v, toOptions: y, fromValue: b, toValue: S, onFromValueChange: C, onToValueChange: w, fromError: T, toError: E, amountValue: D, onAmountValueChange: O, amountError: k, amountInputPrefix: A, reviewFromAccount: j, reviewToAccount: M, reviewAmountLabel: N, isSubmitting: P, onContinueFromAccounts: F, onBack: I, onSubmit: L, onClearSelections: R, scrollToErrorToken: z, testIds: B }) {
101
+ let V = h(), H = `${V}-error`, U = s === "review", W = d(u), G = m(z);
102
+ return /* @__PURE__ */ g(r, {
103
+ open: a,
104
+ onOpenChange: o,
105
+ title: U ? u.modalReviewHeading : u.modalTitle,
106
+ stepLabel: c,
107
+ description: U ? void 0 : u.modalAccountsSubtitle,
108
+ onNext: U ? L : F,
109
+ onBack: U ? I : void 0,
110
+ nextLoading: P,
111
+ labels: {
112
+ back: u.modalBack,
113
+ next: U ? u.modalConfirmTransfer : u.modalContinue,
114
+ close: u.modalClose
115
+ },
116
+ testIds: {
117
+ content: B?.root,
118
+ close: B?.closeButton,
119
+ next: U ? B?.reviewStep?.confirm : B?.accountsConfirm,
120
+ back: B?.reviewStep?.goBack
121
+ },
122
+ result: s === "result" ? /* @__PURE__ */ g(p, {
123
+ fromAccount: j,
124
+ toAccount: M,
125
+ amountLabel: N,
126
+ onDone: () => o(!1),
127
+ testIds: B?.resultStep,
128
+ labels: {
129
+ title: u.modalResultSuccessTitle,
130
+ description: u.modalResultDescription,
131
+ from: u.modalFromLabel,
132
+ to: u.modalToLabel,
133
+ amount: u.modalAmountLabel,
134
+ endingIn: u.accountNumberEndingIn,
135
+ done: u.modalDone
136
+ }
137
+ }) : void 0,
138
+ children: U ? /* @__PURE__ */ g(f, {
139
+ fromAccount: j,
140
+ toAccount: M,
141
+ amountLabel: N,
142
+ labels: {
143
+ from: u.modalFromLabel,
144
+ to: u.modalToLabel,
145
+ amount: u.modalAmountLabel,
146
+ endingIn: u.accountNumberEndingIn,
147
+ showNumber: u.showAccountNumber,
148
+ hideNumber: u.hideAccountNumber
149
+ }
150
+ }) : /* @__PURE__ */ _("div", {
151
+ ref: G,
152
+ className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:pb-1",
153
+ children: [
154
+ /* @__PURE__ */ g(x, {
155
+ label: u.modalFromLabel,
156
+ placeholder: u.modalSelectPlaceholder,
157
+ value: b,
158
+ options: v,
159
+ onValueChange: C,
160
+ error: T,
161
+ numberLabels: W,
162
+ testId: B?.fromAccountTrigger
163
+ }),
164
+ /* @__PURE__ */ g(x, {
165
+ label: u.modalToLabel,
166
+ placeholder: u.modalSelectPlaceholder,
167
+ value: S,
168
+ options: y,
169
+ onValueChange: w,
170
+ error: E,
171
+ numberLabels: W,
172
+ testId: B?.toAccountTrigger
173
+ }),
82
174
  /* @__PURE__ */ _("div", {
83
- className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:py-5",
175
+ className: "ttw:flex ttw:flex-col ttw:gap-2",
84
176
  children: [
85
- /* @__PURE__ */ _(o, {
86
- value: k,
87
- onValueChange: j,
88
- children: [/* @__PURE__ */ g(l, {
89
- className: y,
90
- "data-testid": Y?.fromAccountTrigger,
91
- "aria-label": T(k, D, E.modalFromAccountPlaceholder),
92
- children: /* @__PURE__ */ g("span", {
93
- className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:items-center ttw:justify-start ttw:text-left",
94
- children: /* @__PURE__ */ g(C, {
95
- value: k,
96
- options: D,
97
- placeholder: E.modalFromAccountPlaceholder
98
- })
99
- })
100
- }), /* @__PURE__ */ g(s, {
101
- ...b,
102
- children: w(D)
103
- })]
104
- }),
105
- /* @__PURE__ */ _(o, {
106
- value: A,
107
- onValueChange: M,
108
- children: [/* @__PURE__ */ g(l, {
109
- className: y,
110
- "data-testid": Y?.toAccountTrigger,
111
- "aria-label": T(A, O, E.modalToAccountPlaceholder),
112
- children: /* @__PURE__ */ g("span", {
113
- className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:items-center ttw:justify-start ttw:text-left",
114
- children: /* @__PURE__ */ g(C, {
115
- value: A,
116
- options: O,
117
- placeholder: E.modalToAccountPlaceholder
118
- })
119
- })
120
- }), /* @__PURE__ */ g(s, {
121
- ...b,
122
- children: w(O)
123
- })]
177
+ /* @__PURE__ */ g(i, {
178
+ htmlFor: V,
179
+ requirement: n.Required,
180
+ children: u.modalAmountLabel
124
181
  }),
125
- /* @__PURE__ */ _("div", {
126
- className: "ttw:flex ttw:flex-col ttw:gap-2",
127
- children: [
128
- /* @__PURE__ */ g(a, {
129
- htmlFor: "transfer-money-modal-amount",
130
- className: F ? "ttw:text-destructive" : "ttw:text-muted-foreground",
131
- children: E.modalAmountLabel
132
- }),
133
- /* @__PURE__ */ _("div", {
134
- className: F ? "ttw:flex ttw:min-h-14 ttw:items-center ttw:gap-2 ttw:rounded-lg ttw:border ttw:border-destructive ttw:bg-transparent ttw:px-5 ttw:py-3.5" : "ttw:flex ttw:min-h-14 ttw:items-center ttw:gap-2 ttw:rounded-lg ttw:border ttw:border-input ttw:bg-transparent ttw:px-5 ttw:py-3.5",
135
- children: [/* @__PURE__ */ g("span", {
136
- className: "ttw:shrink-0 ttw:text-base ttw:text-muted-foreground",
137
- "aria-hidden": !0,
138
- children: I
139
- }), /* @__PURE__ */ g(i, {
140
- id: "transfer-money-modal-amount",
141
- className: "ttw:h-auto ttw:min-h-0 ttw:flex-1 ttw:border-0 ttw:bg-transparent ttw:px-0 ttw:py-0 ttw:text-base ttw:shadow-none ttw:focus-visible:ring-0",
142
- inputMode: "decimal",
143
- autoComplete: "off",
144
- value: N,
145
- onChange: (e) => P(e.target.value),
146
- placeholder: E.modalAmountPlaceholder,
147
- "aria-invalid": F ? !0 : void 0,
148
- "data-testid": Y?.amountInput
149
- })]
150
- }),
151
- F ? /* @__PURE__ */ g(d, {
152
- variant: "body2",
153
- color: "destructive",
154
- component: "p",
155
- className: "ttw:mt-0.5",
156
- children: F
157
- }) : null
158
- ]
182
+ /* @__PURE__ */ g(l, {
183
+ id: V,
184
+ required: !0,
185
+ currencySymbol: A,
186
+ value: D,
187
+ onValueChange: O,
188
+ placeholder: u.modalAmountPlaceholder,
189
+ "aria-invalid": k ? !0 : void 0,
190
+ "aria-describedby": k ? H : void 0,
191
+ "data-testid": B?.amountInput
159
192
  }),
160
- J ? /* @__PURE__ */ g("div", {
161
- className: "ttw:flex ttw:justify-start",
162
- children: /* @__PURE__ */ g(e, {
163
- type: "button",
164
- variant: "link",
165
- className: "ttw:h-auto ttw:cursor-pointer ttw:px-0 ttw:py-0 ttw:text-base ttw:font-normal",
166
- onClick: J,
167
- children: E.modalClearSelections
168
- })
193
+ k ? /* @__PURE__ */ g(t, {
194
+ id: H,
195
+ children: k
169
196
  }) : null
170
197
  ]
171
198
  }),
172
- X,
173
- /* @__PURE__ */ g("div", {
174
- className: "ttw:flex ttw:flex-col ttw:gap-2 ttw:pt-4",
175
- children: /* @__PURE__ */ _(e, {
176
- type: "button",
177
- variant: "default",
178
- className: "ttw:h-11 ttw:w-full ttw:cursor-pointer ttw:gap-2 ttw:rounded-lg ttw:font-medium ttw:disabled:pointer-events-none ttw:disabled:cursor-not-allowed ttw:disabled:bg-muted ttw:disabled:text-muted-foreground ttw:disabled:opacity-100",
179
- disabled: !H || !U || !!F,
180
- onClick: W,
181
- "data-testid": Y?.accountsConfirm,
182
- children: [E.modalAccountsConfirm, /* @__PURE__ */ g(v, {
183
- className: "ttw:size-4",
184
- "aria-hidden": !0
185
- })]
186
- })
187
- })
188
- ] }) : S === "review" ? /* @__PURE__ */ g(f, {
189
- fromAccount: L,
190
- toAccount: R,
191
- amountLabel: z,
192
- isSubmitting: B,
193
- onConfirm: q,
194
- onGoBack: K,
195
- testIds: Y?.reviewStep,
196
- labels: {
197
- fromAccountSection: E.modalReviewFromAccountLabel,
198
- toAccountSection: E.modalReviewToAccountLabel,
199
- amountSection: E.modalAmountLabel,
200
- confirmTransfer: E.modalConfirmTransfer,
201
- goBack: E.modalGoBack
202
- }
203
- }) : S === "result" ? /* @__PURE__ */ g(m, {
204
- amountLabel: z,
205
- isSuccess: V,
206
- onBackToTransfers: () => x(!1),
207
- testIds: Y?.resultStep,
208
- labels: {
209
- successTitle: E.modalResultSuccessTitle,
210
- errorTitle: E.modalResultErrorTitle,
211
- transferMessagePrefix: E.modalResultTransferMessagePrefix,
212
- successMessageSuffix: E.modalResultSuccessMessageSuffix,
213
- errorMessageSuffix: E.modalResultErrorMessageSuffix,
214
- backToTransfers: E.modalBackToTransfers
215
- }
216
- }) : /* @__PURE__ */ _(h, { children: [
217
- /* @__PURE__ */ g("div", {
218
- className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:py-5",
219
- children: /* @__PURE__ */ _("div", {
220
- className: "ttw:flex ttw:flex-col ttw:gap-2",
221
- children: [
222
- /* @__PURE__ */ g(d, {
223
- variant: "body2",
224
- className: "ttw:font-medium",
225
- children: E.modalAmountLabel
226
- }),
227
- /* @__PURE__ */ g(i, {
228
- className: "ttw:h-11 ttw:px-4 ttw:py-3",
229
- inputMode: "decimal",
230
- autoComplete: "off",
231
- value: N,
232
- onChange: (e) => P(e.target.value),
233
- placeholder: E.modalAmountPlaceholder,
234
- "aria-invalid": F ? !0 : void 0
235
- }),
236
- F ? /* @__PURE__ */ g(d, {
237
- variant: "body2",
238
- color: "destructive",
239
- component: "p",
240
- children: F
241
- }) : null
242
- ]
243
- })
244
- }),
245
- X,
246
- /* @__PURE__ */ _(r, {
247
- className: "ttw:flex ttw:flex-row ttw:flex-wrap ttw:gap-2 ttw:pt-4 ttw:sm:justify-between",
248
- children: [/* @__PURE__ */ g("div", {
249
- className: "ttw:flex ttw:flex-1 ttw:flex-wrap ttw:gap-2",
250
- children: /* @__PURE__ */ g(e, {
251
- type: "button",
252
- variant: "outline",
253
- onClick: K,
254
- disabled: B,
255
- children: E.modalBack
256
- })
257
- }), /* @__PURE__ */ g("div", {
258
- className: "ttw:flex ttw:flex-wrap ttw:gap-2",
259
- children: /* @__PURE__ */ g(e, {
260
- type: "button",
261
- onClick: G,
262
- disabled: !U,
263
- children: E.modalContinue
264
- })
265
- })]
266
- })
267
- ] })]
199
+ R ? /* @__PURE__ */ g(e, {
200
+ type: "button",
201
+ variant: "link",
202
+ className: "ttw:h-auto ttw:self-start ttw:p-0",
203
+ onClick: R,
204
+ children: u.modalClearSelections
205
+ }) : null
206
+ ]
268
207
  })
269
208
  });
270
209
  }
271
- export { E as TransferMoneyModal };
210
+ export { S as TransferMoneyModal };
@@ -1,65 +1,50 @@
1
- import { Button as e, Typography as t } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
1
+ import { ResultScreen as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { TransferAccountValue as t } from "../TransfersWidget/TransferAccountValue.js";
2
3
  import { DEFAULT_TRANSFER_RESULT_STEP_LABELS as n } from "./transferResultStepLabels.js";
3
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
- import { ArrowLeft as a, CheckCircle2 as o, X as s } from "lucide-react";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ import { CircleCheck as i } from "lucide-react";
5
6
  // ../../libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/TransferResultStep.js
6
- function c({ amountLabel: c, isSuccess: l, onBackToTransfers: u, labels: d, testIds: f }) {
7
- let p = {
7
+ function a({ fromAccount: a, toAccount: o, amountLabel: s, onDone: c, labels: l, testIds: u }) {
8
+ let d = {
8
9
  ...n,
9
- ...d
10
+ ...l
10
11
  };
11
- return /* @__PURE__ */ i("div", {
12
- className: "ttw:flex ttw:flex-col ttw:items-center ttw:px-2 ttw:py-8",
13
- children: [
14
- /* @__PURE__ */ r("div", {
15
- className: l ? "ttw:mb-4 ttw:flex ttw:size-14 ttw:items-center ttw:justify-center ttw:rounded-full ttw:bg-emerald-50" : "ttw:mb-4 ttw:flex ttw:size-14 ttw:items-center ttw:justify-center ttw:rounded-full ttw:bg-red-50",
16
- children: l ? /* @__PURE__ */ r("div", {
17
- className: "ttw:flex ttw:size-10 ttw:items-center ttw:justify-center ttw:rounded-full ttw:bg-emerald-100",
18
- children: /* @__PURE__ */ r(o, {
19
- className: "ttw:size-7 ttw:text-emerald-600",
20
- "aria-hidden": !0
21
- })
22
- }) : /* @__PURE__ */ r("div", {
23
- className: "ttw:flex ttw:size-10 ttw:items-center ttw:justify-center ttw:rounded-full ttw:bg-destructive",
24
- children: /* @__PURE__ */ r(s, {
25
- className: "ttw:size-6 ttw:text-destructive-foreground",
26
- "aria-hidden": !0
27
- })
12
+ return /* @__PURE__ */ r(e, {
13
+ icon: /* @__PURE__ */ r(i, {}),
14
+ tone: "success",
15
+ title: /* @__PURE__ */ r("span", {
16
+ "data-testid": u?.title,
17
+ children: d.title
18
+ }),
19
+ description: d.description,
20
+ details: [
21
+ {
22
+ label: d.from,
23
+ value: /* @__PURE__ */ r(t, {
24
+ name: a.name,
25
+ number: a.number && { last4: a.number.last4 },
26
+ numberLabels: { endingIn: d.endingIn }
28
27
  })
29
- }),
30
- /* @__PURE__ */ r(t, {
31
- component: "h2",
32
- className: "ttw:mb-2 ttw:text-center ttw:text-lg ttw:font-bold ttw:text-foreground",
33
- "data-testid": l ? "embedded-banking-transfer-money-result-success-title" : "embedded-banking-transfer-money-result-error-title",
34
- children: l ? p.successTitle : p.errorTitle
35
- }),
36
- /* @__PURE__ */ i(t, {
37
- variant: "body2",
38
- color: "muted",
39
- component: "p",
40
- className: "ttw:mb-8 ttw:max-w-sm ttw:text-center",
41
- children: [
42
- p.transferMessagePrefix,
43
- /* @__PURE__ */ r("span", {
44
- className: "ttw:font-semibold ttw:text-foreground",
45
- children: c
46
- }),
47
- " ",
48
- l ? p.successMessageSuffix : p.errorMessageSuffix
49
- ]
50
- }),
51
- /* @__PURE__ */ i(e, {
52
- type: "button",
53
- variant: "outline",
54
- className: "ttw:h-11 ttw:w-full ttw:cursor-pointer ttw:gap-2 ttw:rounded-lg ttw:font-semibold",
55
- onClick: u,
56
- "data-testid": f?.backToTransfers,
57
- children: [/* @__PURE__ */ r(a, {
58
- className: "ttw:size-4",
59
- "aria-hidden": !0
60
- }), p.backToTransfers]
61
- })
62
- ]
28
+ },
29
+ {
30
+ label: d.to,
31
+ value: /* @__PURE__ */ r(t, {
32
+ name: o.name,
33
+ number: o.number && { last4: o.number.last4 },
34
+ numberLabels: { endingIn: d.endingIn }
35
+ })
36
+ },
37
+ {
38
+ label: d.amount,
39
+ value: /* @__PURE__ */ r("span", {
40
+ className: "ttw:tabular-nums",
41
+ children: s
42
+ })
43
+ }
44
+ ],
45
+ onDone: c,
46
+ labels: { done: d.done },
47
+ testIds: { done: u?.done }
63
48
  });
64
49
  }
65
- export { c as TransferResultStep };
50
+ export { a as TransferResultStep };
@@ -1,9 +1,10 @@
1
1
  // ../../libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/reviewTransferStepLabels.js
2
2
  var e = {
3
- fromAccountSection: "From Account",
4
- toAccountSection: "To Account",
5
- amountSection: "Amount",
6
- confirmTransfer: "Confirm transfer",
7
- goBack: "Go back"
3
+ from: "From",
4
+ to: "To",
5
+ amount: "Amount",
6
+ endingIn: "ending in {last4}",
7
+ showNumber: "Show number",
8
+ hideNumber: "Hide number"
8
9
  };
9
10
  export { e as DEFAULT_REVIEW_TRANSFER_STEP_LABELS };
@@ -1,10 +1,11 @@
1
1
  // ../../libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/transferResultStepLabels.js
2
2
  var e = {
3
- successTitle: "Success!",
4
- errorTitle: "Error",
5
- transferMessagePrefix: "Your transfer of ",
6
- successMessageSuffix: "was sent!",
7
- errorMessageSuffix: "was not sent.",
8
- backToTransfers: "Back to Transfers"
3
+ title: "Transfer submitted",
4
+ description: "It can take 1–2 business days to arrive.",
5
+ from: "From",
6
+ to: "To",
7
+ amount: "Amount",
8
+ endingIn: "ending in {last4}",
9
+ done: "Done"
9
10
  };
10
11
  export { e as DEFAULT_TRANSFER_RESULT_STEP_LABELS };
@@ -0,0 +1,9 @@
1
+ import { useEffect as e, useRef as t } from "react";
2
+ // ../../libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/useFocusFirstInvalidField.js
3
+ function n(n) {
4
+ let r = t(null), i = t(n);
5
+ return e(() => {
6
+ n !== i.current && (i.current = n, r.current?.querySelector("[aria-invalid=\"true\"]")?.focus());
7
+ }, [n]), r;
8
+ }
9
+ export { n as useFocusFirstInvalidField };
@@ -0,0 +1,32 @@
1
+ import { MaskedAccountNumber as e } from "../../../../../shared/ui/dist/lib/MaskedAccountNumber/MaskedAccountNumber.js";
2
+ import "../../../../../shared/ui/dist/index.js";
3
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
4
+ // ../../libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransferAccountValue.js
5
+ function r({ name: r, number: i, secondaryLabel: a, numberLabels: o, singleLine: s = !1 }) {
6
+ return /* @__PURE__ */ n("div", {
7
+ className: "ttw:flex ttw:min-w-0 ttw:flex-col",
8
+ children: [
9
+ s ? /* @__PURE__ */ t("span", {
10
+ className: "ttw:block ttw:max-w-50 ttw:truncate",
11
+ title: r,
12
+ children: r
13
+ }) : /* @__PURE__ */ t("span", {
14
+ className: "ttw:min-w-0 ttw:break-words",
15
+ children: r
16
+ }),
17
+ i ? /* @__PURE__ */ t("span", {
18
+ className: "ttw:font-normal ttw:text-muted-foreground",
19
+ children: /* @__PURE__ */ t(e, {
20
+ last4: i.last4,
21
+ fullNumber: i.fullNumber,
22
+ labels: o
23
+ })
24
+ }) : null,
25
+ a ? /* @__PURE__ */ t("span", {
26
+ className: "ttw:text-sm ttw:font-normal ttw:text-muted-foreground",
27
+ children: a
28
+ }) : null
29
+ ]
30
+ });
31
+ }
32
+ export { r as TransferAccountValue };