@tesouro/embedded-components-react 0.11.0 → 0.11.1

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 +15 -50
  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 +1846 -1603
  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,92 +1,41 @@
1
- import { Button as e, Separator as t, Typography as n } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { TransferReviewAccountCard as r } from "./TransferReviewAccountCard.js";
3
- import { DEFAULT_REVIEW_TRANSFER_STEP_LABELS as i } from "./reviewTransferStepLabels.js";
4
- import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
5
- import { ArrowLeft as c, ArrowRight as l } from "lucide-react";
1
+ import { DescriptionList as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { TransferAccountValue as t } from "../TransfersWidget/TransferAccountValue.js";
3
+ import { DEFAULT_REVIEW_TRANSFER_STEP_LABELS as n } from "./reviewTransferStepLabels.js";
4
+ import { jsx as r } from "react/jsx-runtime";
6
5
  // ../../libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/ReviewTransferStep.js
7
- function u({ fromAccount: u, toAccount: d, amountLabel: f, isSubmitting: p, onConfirm: m, onGoBack: h, labels: g, testIds: _ }) {
8
- let v = {
9
- ...i,
10
- ...g
6
+ function i({ fromAccount: i, toAccount: a, amountLabel: o, labels: s }) {
7
+ let c = {
8
+ ...n,
9
+ ...s
10
+ }, l = {
11
+ endingIn: c.endingIn,
12
+ showNumber: c.showNumber,
13
+ hideNumber: c.hideNumber
11
14
  };
12
- return /* @__PURE__ */ s(a, { children: [
13
- /* @__PURE__ */ s("div", {
14
- className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:py-5",
15
- children: [
16
- /* @__PURE__ */ s("div", {
17
- className: "ttw:flex ttw:flex-col ttw:gap-2",
18
- children: [/* @__PURE__ */ o(n, {
19
- variant: "body2",
20
- color: "muted",
21
- component: "p",
22
- className: "ttw:font-medium",
23
- children: v.fromAccountSection
24
- }), /* @__PURE__ */ o(r, { account: u })]
25
- }),
26
- /* @__PURE__ */ o("div", {
27
- className: "ttw:flex ttw:justify-center",
28
- "aria-hidden": !0,
29
- children: /* @__PURE__ */ o(n, {
30
- component: "p",
31
- className: "ttw:text-[30px] ttw:leading-none ttw:text-primary",
32
- children: "↓"
33
- })
34
- }),
35
- /* @__PURE__ */ s("div", {
36
- className: "ttw:flex ttw:flex-col ttw:gap-2",
37
- children: [/* @__PURE__ */ o(n, {
38
- variant: "body2",
39
- color: "muted",
40
- component: "p",
41
- className: "ttw:font-medium",
42
- children: v.toAccountSection
43
- }), /* @__PURE__ */ o(r, { account: d })]
44
- }),
45
- /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o(n, {
46
- variant: "body2",
47
- color: "muted",
48
- component: "p",
49
- className: "ttw:font-medium",
50
- children: v.amountSection
51
- }), /* @__PURE__ */ o(n, {
52
- component: "p",
53
- className: "ttw:text-2xl ttw:font-bold ttw:text-foreground",
54
- children: f
55
- })] })
56
- ]
57
- }),
58
- /* @__PURE__ */ o(t, {
59
- decorative: !0,
60
- orientation: "horizontal",
61
- className: "ttw:-mx-6",
62
- style: { width: "calc(100% + 3rem)" }
63
- }),
64
- /* @__PURE__ */ s("div", {
65
- className: "ttw:flex ttw:flex-col ttw:items-center ttw:gap-2 ttw:pt-4",
66
- children: [/* @__PURE__ */ s(e, {
67
- type: "button",
68
- variant: "default",
69
- className: "ttw:h-11 ttw:w-full ttw:cursor-pointer ttw:gap-2 ttw:rounded-lg ttw:font-medium",
70
- disabled: p,
71
- onClick: m,
72
- "data-testid": _?.confirm,
73
- children: [v.confirmTransfer, /* @__PURE__ */ o(l, {
74
- className: "ttw:size-4",
75
- "aria-hidden": !0
76
- })]
77
- }), /* @__PURE__ */ s(e, {
78
- type: "button",
79
- variant: "link",
80
- className: "ttw:h-auto ttw:cursor-pointer ttw:px-0 ttw:py-0 ttw:text-base ttw:font-medium",
81
- disabled: p,
82
- onClick: h,
83
- "data-testid": _?.goBack,
84
- children: [/* @__PURE__ */ o(c, {
85
- className: "ttw:size-4",
86
- "aria-hidden": !0
87
- }), v.goBack]
88
- })]
89
- })
15
+ return /* @__PURE__ */ r(e, { items: [
16
+ {
17
+ label: c.from,
18
+ value: /* @__PURE__ */ r(t, {
19
+ name: i.name,
20
+ number: i.number,
21
+ numberLabels: l
22
+ })
23
+ },
24
+ {
25
+ label: c.to,
26
+ value: /* @__PURE__ */ r(t, {
27
+ name: a.name,
28
+ number: a.number,
29
+ numberLabels: l
30
+ })
31
+ },
32
+ {
33
+ label: c.amount,
34
+ value: /* @__PURE__ */ r("span", {
35
+ className: "ttw:tabular-nums",
36
+ children: o
37
+ })
38
+ }
90
39
  ] });
91
40
  }
92
- export { u as ReviewTransferStep };
41
+ export { i as ReviewTransferStep };
@@ -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 };