@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,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 };
@@ -1,110 +1,77 @@
1
- import { Alert as e, AlertDescription as t, AlertTitle as n, Button as r, Separator as i, Sheet as a, SheetContent as o, SheetHeader as s, SheetTitle as c, Typography as l, cn as u } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { TransferStatusBadge as d } from "./TransferStatusBadge.js";
3
- import { TransferAccountTile as f } from "./TransferAccountTile.js";
4
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
1
+ import { Alert as e, AlertDescription as t, AlertTitle as n, Badge as r, Button as i, DescriptionList as a, DisplayAmount as o, FormSheet as s, cn as c } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { maskLabels as l } from "./maskLabels.js";
3
+ import { TransferAccountValue as u } from "./TransferAccountValue.js";
4
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
5
+ import { CircleAlert as p } from "lucide-react";
5
6
  // ../../libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransferDetailSheet.js
6
- function h({ label: e, account: t }) {
7
- return /* @__PURE__ */ m("div", {
8
- className: "ttw:flex ttw:flex-col ttw:gap-2",
9
- children: [/* @__PURE__ */ p(l, {
10
- variant: "body2",
11
- color: "muted",
12
- component: "p",
13
- children: e
14
- }), /* @__PURE__ */ m("div", {
15
- className: "ttw:flex ttw:items-center ttw:gap-3",
16
- children: [/* @__PURE__ */ p(f, { kind: t.kind }), /* @__PURE__ */ m("div", {
17
- className: "ttw:min-w-0",
18
- children: [/* @__PURE__ */ m("p", {
19
- className: "ttw:m-0 ttw:flex ttw:gap-1 ttw:text-sm ttw:font-medium",
20
- children: [/* @__PURE__ */ p("span", {
21
- className: "ttw:truncate",
22
- children: t.name
23
- }), t.maskLabel ? /* @__PURE__ */ p("span", {
24
- className: "ttw:shrink-0",
25
- children: t.maskLabel
26
- }) : null]
27
- }), /* @__PURE__ */ p(l, {
28
- variant: "body2",
29
- color: "muted",
30
- component: "p",
31
- children: t.kindLabel
32
- })]
33
- })]
34
- })]
35
- });
36
- }
37
- function g({ detail: f, onClose: g, onLinkAccountClick: _, labels: v, testIds: y }) {
38
- let b = f?.returnedBanner;
39
- return /* @__PURE__ */ p(a, {
40
- open: !!f,
7
+ var m = (e, t) => /* @__PURE__ */ d(u, {
8
+ numberLabels: l(t),
9
+ name: e.name,
10
+ number: e.number,
11
+ secondaryLabel: e.kindLabel
12
+ });
13
+ function h({ detail: l, onClose: u, onLinkAccountClick: h, labels: g, testIds: _ }) {
14
+ let v = l?.returnedBanner;
15
+ return /* @__PURE__ */ d(s, {
16
+ open: !!l,
41
17
  onOpenChange: (e) => {
42
- e || g?.();
18
+ e || u?.();
43
19
  },
44
- children: /* @__PURE__ */ m(o, {
45
- labels: { close: v.detailClose },
46
- "data-testid": y?.root,
47
- "aria-describedby": void 0,
48
- children: [/* @__PURE__ */ p(s, { children: /* @__PURE__ */ p(c, { children: v.detailTitle }) }), f ? /* @__PURE__ */ m("div", {
49
- className: "ttw:flex ttw:flex-col ttw:gap-6 ttw:overflow-y-auto ttw:px-4 ttw:pb-4",
50
- children: [
51
- /* @__PURE__ */ m("div", {
52
- className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-3",
53
- children: [/* @__PURE__ */ p(l, {
54
- variant: "h4",
55
- component: "p",
56
- className: u("ttw:font-semibold ttw:tabular-nums", f.isAmountStruckThrough && "ttw:line-through"),
57
- children: f.amountLabel
58
- }), /* @__PURE__ */ p(d, {
59
- label: f.statusLabel,
60
- tone: f.statusTone
61
- })]
62
- }),
63
- b ? /* @__PURE__ */ m(e, {
64
- variant: "destructive",
65
- "data-testid": y?.returnedBanner,
66
- children: [/* @__PURE__ */ p(n, { children: b.title }), /* @__PURE__ */ m(t, { children: [
67
- /* @__PURE__ */ p("p", { children: b.description }),
68
- /* @__PURE__ */ p("p", { children: b.nextStep }),
69
- _ ? /* @__PURE__ */ p(r, {
20
+ title: g.detailTitle,
21
+ labels: { close: g.detailClose },
22
+ testIds: { content: _?.root },
23
+ children: l ? /* @__PURE__ */ f("div", {
24
+ className: "ttw:flex ttw:flex-col ttw:gap-6 ttw:pb-6",
25
+ children: [
26
+ /* @__PURE__ */ f("div", {
27
+ className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-3",
28
+ children: [/* @__PURE__ */ d(o, {
29
+ className: c(l.isAmountStruckThrough && "ttw:line-through"),
30
+ children: l.amountLabel
31
+ }), /* @__PURE__ */ d(r, {
32
+ tone: l.statusTone,
33
+ children: l.statusLabel
34
+ })]
35
+ }),
36
+ v ? /* @__PURE__ */ f(e, {
37
+ variant: "destructive",
38
+ "data-testid": _?.returnedBanner,
39
+ children: [
40
+ /* @__PURE__ */ d(p, { "aria-hidden": !0 }),
41
+ /* @__PURE__ */ d(n, { children: v.title }),
42
+ /* @__PURE__ */ f(t, { children: [
43
+ /* @__PURE__ */ d("p", { children: v.description }),
44
+ /* @__PURE__ */ d("p", { children: v.nextStep }),
45
+ h ? /* @__PURE__ */ d(i, {
70
46
  type: "button",
71
47
  size: "sm",
72
48
  className: "ttw:mt-2",
73
- onClick: _,
74
- children: v.returnedLinkAccountCta
49
+ onClick: h,
50
+ children: g.returnedLinkAccountCta
75
51
  }) : null
76
- ] })]
77
- }) : null,
78
- /* @__PURE__ */ m("div", {
79
- className: "ttw:flex ttw:flex-col ttw:gap-4",
80
- children: [
81
- /* @__PURE__ */ p(h, {
82
- label: v.transferFromLabel,
83
- account: f.from
84
- }),
85
- /* @__PURE__ */ p(i, {}),
86
- /* @__PURE__ */ p(h, {
87
- label: v.transferToLabel,
88
- account: f.to
89
- })
90
- ]
91
- }),
92
- [[v.detailInitiatedByLabel, f.initiatedByLabel], [v.detailInitiatedOnLabel, f.initiatedOnLabel]].map(([e, t]) => /* @__PURE__ */ m("div", {
93
- className: "ttw:flex ttw:flex-col ttw:gap-1",
94
- children: [/* @__PURE__ */ p(l, {
95
- variant: "body2",
96
- color: "muted",
97
- component: "p",
98
- children: e
99
- }), /* @__PURE__ */ p(l, {
100
- variant: "body2",
101
- component: "p",
102
- children: t
103
- })]
104
- }, e))
105
- ]
106
- }) : null]
107
- })
52
+ ] })
53
+ ]
54
+ }) : null,
55
+ /* @__PURE__ */ d(a, { items: [
56
+ {
57
+ label: g.transferFromLabel,
58
+ value: m(l.from, g)
59
+ },
60
+ {
61
+ label: g.transferToLabel,
62
+ value: m(l.to, g)
63
+ },
64
+ {
65
+ label: g.detailInitiatedByLabel,
66
+ value: l.initiatedByLabel
67
+ },
68
+ {
69
+ label: g.detailInitiatedOnLabel,
70
+ value: l.initiatedOnLabel
71
+ }
72
+ ] })
73
+ ]
74
+ }) : null
108
75
  });
109
76
  }
110
- export { g as TransferDetailSheet };
77
+ export { h as TransferDetailSheet };