@tesouro/embedded-components-react 0.3.16 → 0.3.17

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 (111) hide show
  1. package/dist/index.d.ts +22 -1
  2. package/dist/index.js +10 -10
  3. package/dist/lib/AcceptDisclosuresWidget.d.ts +11 -1
  4. package/dist/lib/AcceptDisclosuresWidget.js +1 -1
  5. package/dist/lib/BalancesWidget.js +1 -1
  6. package/dist/lib/BankAccountOnboardingWidget.d.ts +21 -21
  7. package/dist/lib/BankAccountOnboardingWidget.js +1 -1
  8. package/dist/lib/CardsWidget.js +1 -1
  9. package/dist/lib/ExpenseApprovalPoliciesWidget.js +1 -1
  10. package/dist/lib/ExpenseManagementWidget.js +1 -1
  11. package/dist/lib/InsightsWidget.js +1 -1
  12. package/dist/lib/ReceiptMatchWidget.js +1 -1
  13. package/dist/lib/TransfersWidget.js +1 -1
  14. package/dist/lib/UploadReceiptWidget.js +1 -1
  15. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index.js +1 -1
  16. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index4.js +10 -140
  17. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index5.js +152 -0
  18. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +19 -19
  19. package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/index.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/index4.js +10 -11
  21. package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/index5.js +15 -64
  22. package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/index6.js +75 -0
  23. package/dist/libs/tesouro-embedded-components-react/balances-widget/ui/dist/lib/BalancesWidget/BalancesWidget.js +16 -16
  24. package/dist/libs/tesouro-embedded-components-react/balances-widget/ui/dist/lib/BalancesWidget/SingleBalance/SingleBalance.js +7 -7
  25. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index.js +1 -1
  26. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index10.js +109 -169
  27. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index11.js +170 -63
  28. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index12.js +73 -81
  29. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index13.js +77 -101
  30. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index14.js +110 -83
  31. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index15.js +91 -7
  32. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index16.js +7 -28
  33. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js +26 -320
  34. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index18.js +341 -0
  35. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index9.js +29 -100
  36. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +0 -1
  37. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index11.js +3 -3
  38. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index15.js +32 -32
  39. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index16.js +2 -2
  40. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index18.js +14 -10
  41. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index19.js +42 -42
  42. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index2.js +80 -77
  43. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index20.js +2 -2
  44. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index22.js +14 -10
  45. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index23.js +16 -16
  46. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index27.js +5 -5
  47. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index3.js +7 -6
  48. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index5.js +23 -18
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +0 -1
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +28 -28
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +0 -1
  52. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/index.js +0 -1
  53. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsHeader.js +5 -5
  54. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index.js +3 -3
  55. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index3.js +4 -23
  56. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index4.js +23 -24
  57. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index5.js +24 -30
  58. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index6.js +28 -55
  59. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index7.js +54 -209
  60. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index8.js +206 -81
  61. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +95 -0
  62. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardFaceSwatch.js +2 -2
  63. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +31 -30
  64. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListRow.js +11 -10
  65. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index.js +5 -5
  66. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index10.js +1 -255
  67. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index11.js +253 -2
  68. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index12.js +2 -71
  69. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index13.js +73 -0
  70. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index5.js +7 -218
  71. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index6.js +219 -79
  72. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index7.js +89 -2
  73. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index8.js +2 -47
  74. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index9.js +49 -1
  75. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ApprovalRuleCard.js +2 -2
  76. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ApprovalRuleForm.js +32 -32
  77. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ExpenseApprovalsPage.js +11 -8
  78. package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index.js +1 -1
  79. package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index10.js +12 -14
  80. package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index11.js +21 -62
  81. package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index12.js +73 -0
  82. package/dist/libs/tesouro-embedded-components-react/insights-widget/ui/dist/lib/InsightsWidget/InsightsWidget.js +6 -6
  83. package/dist/libs/tesouro-embedded-components-react/insights-widget/ui/dist/lib/InsightsWidget/SingleInsight/SingleInsight.js +10 -10
  84. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index5.js +1 -1
  85. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/ApprovalPoliciesSettings.js +67 -46
  86. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/testIds.js +26 -0
  87. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/useApprovalPolicyRules.js +151 -135
  88. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index11.js +11 -11
  89. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index14.js +17 -17
  90. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index16.js +17 -15
  91. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index18.js +9 -9
  92. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index20.js +16 -13
  93. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index3.js +13 -13
  94. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index5.js +11 -11
  95. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index7.js +5 -5
  96. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index9.js +6 -6
  97. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  98. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShell.js +21 -20
  99. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShellOverlayPortal.js +10 -10
  100. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShellScrollRegion.js +17 -17
  101. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index.js +1 -1
  102. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index5.js +18 -99
  103. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index6.js +116 -19
  104. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index7.js +28 -0
  105. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/ReviewTransferStep.js +9 -9
  106. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/TransferMoneyModal.js +13 -11
  107. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/TransferResultStep.js +7 -7
  108. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransfersWidget.js +19 -19
  109. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +4 -4
  110. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  111. package/package.json +1 -1
@@ -3,23 +3,23 @@ import { Button as t, Checkbox as n } from "../../../../../../../packages/shared
3
3
  import { useId as r } from "react";
4
4
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
5
  //#region ../../libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js
6
- function o({ providerAttribution: o, agreementText: s, disclosureLinks: c, isAgreed: l, onAgreedChange: u, onAccept: d, isSubmitting: f = !1, isAccepted: p = !1, errorMessage: m, labels: h }) {
7
- let g = f || p, _ = e(h), v = r(), y = `${v}-agree`, b = `${v}-agree-description`, x = `${v}-accept-error`;
6
+ function o({ providerAttribution: o, agreementText: s, disclosureLinks: c, isAgreed: l, onAgreedChange: u, onAccept: d, isSubmitting: f = !1, isAccepted: p = !1, errorMessage: m, labels: h, testIds: g }) {
7
+ let _ = f || p, v = e(h), y = r(), b = `${y}-agree`, x = `${y}-agree-description`, S = `${y}-accept-error`;
8
8
  return /* @__PURE__ */ a("div", {
9
- "data-testid": "accept-disclosures-widget-root",
9
+ "data-testid": g?.root,
10
10
  className: "ttw:block ttw:w-full ttw:rounded-lg ttw:border ttw:border-border ttw:bg-background ttw:p-6",
11
11
  children: [
12
12
  /* @__PURE__ */ i("h2", {
13
13
  className: "ttw:mb-2 ttw:text-lg ttw:font-semibold ttw:text-foreground",
14
- children: _.title
14
+ children: v.title
15
15
  }),
16
16
  /* @__PURE__ */ i("p", {
17
- "data-testid": "accept-disclosures-provider-attribution",
17
+ "data-testid": g?.providerAttribution,
18
18
  className: "ttw:mb-4 ttw:text-sm ttw:text-foreground",
19
19
  children: o
20
20
  }),
21
21
  c.length > 0 ? /* @__PURE__ */ i("ul", {
22
- "data-testid": "accept-disclosures-links",
22
+ "data-testid": g?.disclosureLinks,
23
23
  className: "ttw:mb-4 ttw:list-disc ttw:space-y-2 ttw:pl-5",
24
24
  children: c.map((e) => /* @__PURE__ */ i("li", {
25
25
  className: "ttw:marker:text-primary",
@@ -35,33 +35,33 @@ function o({ providerAttribution: o, agreementText: s, disclosureLinks: c, isAgr
35
35
  /* @__PURE__ */ a("div", {
36
36
  className: "ttw:mb-4 ttw:flex ttw:items-start ttw:gap-3",
37
37
  children: [/* @__PURE__ */ i(n, {
38
- id: y,
39
- "data-testid": "accept-disclosures-agree-checkbox",
38
+ id: b,
39
+ "data-testid": g?.agreeCheckbox,
40
40
  checked: l,
41
- disabled: g,
41
+ disabled: _,
42
42
  onCheckedChange: (e) => u(e === !0),
43
- "aria-label": _.agreementCheckboxAriaLabel,
44
- "aria-describedby": b,
43
+ "aria-label": v.agreementCheckboxAriaLabel,
44
+ "aria-describedby": x,
45
45
  className: "ttw:mt-1 ttw:shrink-0"
46
46
  }), /* @__PURE__ */ i("p", {
47
- id: b,
48
- "data-testid": "accept-disclosures-agreement-text",
47
+ id: x,
48
+ "data-testid": g?.agreementText,
49
49
  className: "ttw:text-sm ttw:font-normal ttw:leading-relaxed ttw:text-foreground",
50
50
  children: s
51
51
  })]
52
52
  }),
53
53
  /* @__PURE__ */ i(t, {
54
54
  type: "button",
55
- "data-testid": "accept-disclosures-accept-button",
56
- disabled: !l || g,
55
+ "data-testid": g?.acceptButton,
56
+ disabled: !l || _,
57
57
  "aria-busy": f || void 0,
58
- "aria-describedby": m ? x : void 0,
58
+ "aria-describedby": m ? S : void 0,
59
59
  onClick: d,
60
- children: _.acceptButton
60
+ children: v.acceptButton
61
61
  }),
62
62
  m ? /* @__PURE__ */ i("p", {
63
- id: x,
64
- "data-testid": "accept-disclosures-error",
63
+ id: S,
64
+ "data-testid": g?.error,
65
65
  role: "alert",
66
66
  className: "ttw:mt-3 ttw:text-sm ttw:text-destructive",
67
67
  children: m
@@ -1,2 +1,2 @@
1
- import { BalancesWidget as e } from "./index5.js";
1
+ import { BalancesWidget as e } from "./index6.js";
2
2
  export { e as BalancesWidget };
@@ -1,13 +1,12 @@
1
- import { SingleBalance as e } from "../../ui/dist/lib/BalancesWidget/SingleBalance/SingleBalance.js";
2
- import "../../ui/dist/index.js";
3
- import { jsx as t } from "react/jsx-runtime";
4
1
  //#region ../../libs/tesouro-embedded-components-react/balances-widget/feature/dist/index4.js
5
- var n = ({ accountId: n, row: r, isRowClickable: i, onBalanceRowClick: a }) => /* @__PURE__ */ t(e, {
6
- row: r,
7
- isRowClickable: i,
8
- onRowClick: a ? () => {
9
- a(n);
10
- } : void 0
11
- });
2
+ var e = {
3
+ skeleton: "balances-widget-skeleton",
4
+ error: "balances-widget-error",
5
+ retry: "balances-widget-retry",
6
+ totalBalanceInfo: "balances-widget-total-balance-info",
7
+ totalAvailableLabel: "balances-widget-total-available-label",
8
+ accountRow: "balances-widget-account-row",
9
+ accountNumber: "balances-widget-account-number"
10
+ };
12
11
  //#endregion
13
- export { n as SingleBalance };
12
+ export { e as balancesWidgetTestIds };
@@ -1,67 +1,18 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
6
- import { WidgetProvider as t } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
7
- import "../../../shared/feature/dist/index.js";
8
- import { BalancesWidgetAnalyticsEvent as n, WIDGET_NAME as r } from "./index2.js";
9
- import { BalancesWidgetContextProvider as i, useBalancesWidgetContext as a } from "./index3.js";
10
- import { BalancesWidget as o } from "../../ui/dist/lib/BalancesWidget/BalancesWidget.js";
1
+ import { balancesWidgetTestIds as e } from "./index4.js";
2
+ import { SingleBalance as t } from "../../ui/dist/lib/BalancesWidget/SingleBalance/SingleBalance.js";
11
3
  import "../../ui/dist/index.js";
12
- import { SingleBalance as s } from "./index4.js";
13
- import { useEffect as c, useMemo as l } from "react";
14
- import { jsx as u } from "react/jsx-runtime";
4
+ import { jsx as n } from "react/jsx-runtime";
15
5
  //#region ../../libs/tesouro-embedded-components-react/balances-widget/feature/dist/index5.js
16
- var d = 5;
17
- function f({ maxAccounts: t, labels: r, onBalanceRowClick: i }) {
18
- let d = e();
19
- c(() => {
20
- d(n.Mounted);
21
- }, [d]);
22
- let { accountRows: f, isLoading: p, isError: m, refetch: h, totalBalance: g, shouldTotalBalanceDisplay: _, shouldShowViewAllAccounts: v, isRowClickable: y, onViewAllAccountsClicked: b } = a(), x = l(() => f.slice(0, t), [f, t]), S = l(() => f.map((e) => e.view), [f]);
23
- return /* @__PURE__ */ u(o, {
24
- accountRows: S,
25
- isLoading: p,
26
- isError: m,
27
- onRetry: m ? () => void h() : void 0,
28
- totalBalance: g,
29
- shouldTotalBalanceDisplay: _,
30
- shouldShowViewAllAccounts: v,
31
- onViewAllAccountsClicked: b,
32
- labels: r,
33
- children: x.map((e) => /* @__PURE__ */ u(s, {
34
- accountId: e.accountId,
35
- row: e.view,
36
- onBalanceRowClick: i,
37
- isRowClickable: y
38
- }, e.accountId))
39
- });
40
- }
41
- var p = ({ maxAccounts: e = d, labels: t, onBalanceRowClick: n, onViewAllAccountsClick: r }) => {
42
- let a = Math.max(0, e);
43
- return /* @__PURE__ */ u(i, {
44
- maxAccounts: a,
45
- onBalanceRowClick: n,
46
- onViewAllAccountsClick: r,
47
- children: /* @__PURE__ */ u(f, {
48
- maxAccounts: a,
49
- labels: t,
50
- onBalanceRowClick: n
51
- })
52
- });
53
- };
54
- function m({ maxAccounts: e, labels: n, onBalanceRowClick: i, onViewAllAccountsClick: a, ...o }) {
55
- return /* @__PURE__ */ u(t, {
56
- ...o,
57
- widgetName: r,
58
- children: /* @__PURE__ */ u(p, {
59
- maxAccounts: e,
60
- labels: n,
61
- onBalanceRowClick: i,
62
- onViewAllAccountsClick: a
63
- })
64
- });
65
- }
6
+ var r = ({ accountId: r, row: i, isRowClickable: a, onBalanceRowClick: o }) => /* @__PURE__ */ n(t, {
7
+ row: i,
8
+ isRowClickable: a,
9
+ testIds: {
10
+ root: e.accountRow,
11
+ accountNumber: e.accountNumber
12
+ },
13
+ onRowClick: o ? () => {
14
+ o(r);
15
+ } : void 0
16
+ });
66
17
  //#endregion
67
- export { m as BalancesWidget, f as BalancesWidgetInternal, p as BalancesWidgetWithContext };
18
+ export { r as SingleBalance };
@@ -0,0 +1,75 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
6
+ import { WidgetProvider as t } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
7
+ import "../../../shared/feature/dist/index.js";
8
+ import { BalancesWidgetAnalyticsEvent as n, WIDGET_NAME as r } from "./index2.js";
9
+ import { BalancesWidgetContextProvider as i, useBalancesWidgetContext as a } from "./index3.js";
10
+ import { balancesWidgetTestIds as o } from "./index4.js";
11
+ import { BalancesWidget as s } from "../../ui/dist/lib/BalancesWidget/BalancesWidget.js";
12
+ import "../../ui/dist/index.js";
13
+ import { SingleBalance as c } from "./index5.js";
14
+ import { useEffect as l, useMemo as u } from "react";
15
+ import { jsx as d } from "react/jsx-runtime";
16
+ //#region ../../libs/tesouro-embedded-components-react/balances-widget/feature/dist/index6.js
17
+ var f = 5;
18
+ function p({ maxAccounts: t, labels: r, onBalanceRowClick: i }) {
19
+ let f = e();
20
+ l(() => {
21
+ f(n.Mounted);
22
+ }, [f]);
23
+ let { accountRows: p, isLoading: m, isError: h, refetch: g, totalBalance: _, shouldTotalBalanceDisplay: v, shouldShowViewAllAccounts: y, isRowClickable: b, onViewAllAccountsClicked: x } = a(), S = u(() => p.slice(0, t), [p, t]), C = u(() => p.map((e) => e.view), [p]);
24
+ return /* @__PURE__ */ d(s, {
25
+ accountRows: C,
26
+ isLoading: m,
27
+ isError: h,
28
+ onRetry: h ? () => void g() : void 0,
29
+ totalBalance: _,
30
+ shouldTotalBalanceDisplay: v,
31
+ shouldShowViewAllAccounts: y,
32
+ onViewAllAccountsClicked: x,
33
+ labels: r,
34
+ testIds: {
35
+ skeleton: o.skeleton,
36
+ error: o.error,
37
+ retry: o.retry,
38
+ totalBalanceInfo: o.totalBalanceInfo,
39
+ totalAvailableLabel: o.totalAvailableLabel
40
+ },
41
+ children: S.map((e) => /* @__PURE__ */ d(c, {
42
+ accountId: e.accountId,
43
+ row: e.view,
44
+ onBalanceRowClick: i,
45
+ isRowClickable: b
46
+ }, e.accountId))
47
+ });
48
+ }
49
+ var m = ({ maxAccounts: e = f, labels: t, onBalanceRowClick: n, onViewAllAccountsClick: r }) => {
50
+ let a = Math.max(0, e);
51
+ return /* @__PURE__ */ d(i, {
52
+ maxAccounts: a,
53
+ onBalanceRowClick: n,
54
+ onViewAllAccountsClick: r,
55
+ children: /* @__PURE__ */ d(p, {
56
+ maxAccounts: a,
57
+ labels: t,
58
+ onBalanceRowClick: n
59
+ })
60
+ });
61
+ };
62
+ function h({ maxAccounts: e, labels: n, onBalanceRowClick: i, onViewAllAccountsClick: a, ...o }) {
63
+ return /* @__PURE__ */ d(t, {
64
+ ...o,
65
+ widgetName: r,
66
+ children: /* @__PURE__ */ d(m, {
67
+ maxAccounts: e,
68
+ labels: n,
69
+ onBalanceRowClick: i,
70
+ onViewAllAccountsClick: a
71
+ })
72
+ });
73
+ }
74
+ //#endregion
75
+ export { h as BalancesWidget, p as BalancesWidgetInternal, m as BalancesWidgetWithContext };
@@ -5,34 +5,34 @@ import { BALANCES_WIDGET_LABELS_EN as c } from "./labels.js";
5
5
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
6
6
  import { ArrowRight as d, CircleHelp as f } from "lucide-react";
7
7
  //#region ../../libs/tesouro-embedded-components-react/balances-widget/ui/dist/lib/BalancesWidget/BalancesWidget.js
8
- var p = ({ accountRows: p, children: m, isLoading: h, isError: g, onRetry: _, totalBalance: v, shouldTotalBalanceDisplay: y, shouldShowViewAllAccounts: b, onViewAllAccountsClicked: x, labels: S }) => {
9
- let C = {
8
+ var p = ({ accountRows: p, children: m, isLoading: h, isError: g, onRetry: _, totalBalance: v, shouldTotalBalanceDisplay: y, shouldShowViewAllAccounts: b, onViewAllAccountsClicked: x, labels: S, testIds: C }) => {
9
+ let w = {
10
10
  ...c,
11
11
  ...S
12
12
  };
13
13
  return /* @__PURE__ */ l(s, {
14
- title: C.widgetTitle,
14
+ title: w.widgetTitle,
15
15
  showHeaderDivider: !1,
16
16
  children: h ? /* @__PURE__ */ l(t, {
17
- "data-testid": "balances-widget-skeleton",
17
+ "data-testid": C?.skeleton,
18
18
  height: 80,
19
19
  width: "100%",
20
20
  className: "ttw:rounded-md"
21
21
  }) : g ? /* @__PURE__ */ u("div", {
22
22
  className: "ttw:flex ttw:flex-col ttw:gap-3",
23
- "data-testid": "balances-widget-error",
23
+ "data-testid": C?.error,
24
24
  children: [
25
25
  /* @__PURE__ */ l(o, {
26
26
  component: "p",
27
27
  variant: "body1",
28
28
  className: "ttw:font-semibold",
29
- children: C.loadErrorTitle
29
+ children: w.loadErrorTitle
30
30
  }),
31
31
  /* @__PURE__ */ l(o, {
32
32
  component: "p",
33
33
  variant: "body2",
34
34
  color: "muted",
35
- children: C.loadErrorDescription
35
+ children: w.loadErrorDescription
36
36
  }),
37
37
  _ ? /* @__PURE__ */ l(e, {
38
38
  type: "button",
@@ -40,8 +40,8 @@ var p = ({ accountRows: p, children: m, isLoading: h, isError: g, onRetry: _, to
40
40
  size: "sm",
41
41
  className: "ttw:self-start ttw:cursor-pointer",
42
42
  onClick: _,
43
- "data-testid": "balances-widget-retry",
44
- children: C.loadErrorRetry
43
+ "data-testid": C?.retry,
44
+ children: w.loadErrorRetry
45
45
  }) : null
46
46
  ]
47
47
  }) : p.length > 0 ? /* @__PURE__ */ u("div", {
@@ -63,8 +63,8 @@ var p = ({ accountRows: p, children: m, isLoading: h, isError: g, onRetry: _, to
63
63
  type: "button",
64
64
  variant: "ghost",
65
65
  size: "icon-sm",
66
- "aria-label": C.totalAvailableBalanceInfoAriaLabel,
67
- "data-testid": "balances-widget-total-balance-info",
66
+ "aria-label": w.totalAvailableBalanceInfoAriaLabel,
67
+ "data-testid": C?.totalBalanceInfo,
68
68
  className: "ttw:size-8 ttw:shrink-0 ttw:text-muted-foreground",
69
69
  children: /* @__PURE__ */ l(f, {
70
70
  className: "ttw:size-[18px]",
@@ -74,15 +74,15 @@ var p = ({ accountRows: p, children: m, isLoading: h, isError: g, onRetry: _, to
74
74
  }), /* @__PURE__ */ l(r, {
75
75
  sideOffset: 4,
76
76
  className: "ttw:max-w-sm ttw:text-left",
77
- children: C.totalAvailableBalanceTooltip
77
+ children: w.totalAvailableBalanceTooltip
78
78
  })] }) })]
79
79
  }), /* @__PURE__ */ l(o, {
80
80
  variant: "body2",
81
81
  color: "muted",
82
82
  component: "span",
83
- "data-testid": "balances-widget-total-available-label",
83
+ "data-testid": C?.totalAvailableLabel,
84
84
  className: "ttw:block ttw:text-sm ttw:leading-tight",
85
- children: C.totalAvailableBalance
85
+ children: w.totalAvailableBalance
86
86
  })]
87
87
  }), /* @__PURE__ */ l("div", {
88
88
  className: "ttw:flex ttw:min-w-0 ttw:flex-col",
@@ -93,14 +93,14 @@ var p = ({ accountRows: p, children: m, isLoading: h, isError: g, onRetry: _, to
93
93
  variant: "link",
94
94
  onClick: x,
95
95
  className: "ttw:h-auto ttw:min-w-0 ttw:justify-start ttw:self-start ttw:border-none ttw:bg-transparent ttw:px-0 ttw:py-0 ttw:font-inherit ttw:normal-case ttw:text-primary ttw:shadow-none ttw:hover:bg-transparent ttw:hover:text-primary/90 ttw:hover:underline",
96
- children: [C.viewAllAccounts, /* @__PURE__ */ l(d, {
96
+ children: [w.viewAllAccounts, /* @__PURE__ */ l(d, {
97
97
  className: "ttw:size-4 ttw:shrink-0",
98
98
  "aria-hidden": !0
99
99
  })]
100
100
  })]
101
101
  }) : /* @__PURE__ */ l(o, {
102
102
  color: "muted",
103
- children: C.noBalancesFound
103
+ children: w.noBalancesFound
104
104
  })
105
105
  });
106
106
  };
@@ -15,8 +15,8 @@ var o = (e) => [
15
15
  "ttw:cursor-pointer!",
16
16
  "ttw:focus-visible:outline-none ttw:focus-visible:ring-2 ttw:focus-visible:ring-primary ttw:focus-visible:ring-offset-0"
17
17
  ].join(" ") : "ttw:cursor-default"
18
- ].join(" "), s = ({ row: s, isRowClickable: c, onRowClick: l }) => {
19
- let u = /* @__PURE__ */ r(t, { children: [
18
+ ].join(" "), s = ({ row: s, isRowClickable: c, onRowClick: l, testIds: u }) => {
19
+ let d = /* @__PURE__ */ r(t, { children: [
20
20
  /* @__PURE__ */ n("span", {
21
21
  className: "ttw:flex ttw:size-10 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-lg ttw:bg-primary/10",
22
22
  "aria-hidden": !0,
@@ -32,7 +32,7 @@ var o = (e) => [
32
32
  }), /* @__PURE__ */ n(e, {
33
33
  component: "span",
34
34
  variant: "body1",
35
- "data-testid": "balances-widget-account-number",
35
+ "data-testid": u?.accountNumber,
36
36
  className: "ttw:shrink-0 ttw:font-normal ttw:text-[#667085]",
37
37
  children: s.suffixLabel
38
38
  })]
@@ -50,14 +50,14 @@ var o = (e) => [
50
50
  ] });
51
51
  return c && l ? /* @__PURE__ */ n("button", {
52
52
  type: "button",
53
- "data-testid": "balances-widget-account-row",
53
+ "data-testid": u?.root,
54
54
  className: o(!0),
55
55
  onClick: () => l(),
56
- children: u
56
+ children: d
57
57
  }) : /* @__PURE__ */ n("div", {
58
- "data-testid": "balances-widget-account-row",
58
+ "data-testid": u?.root,
59
59
  className: o(!1),
60
- children: u
60
+ children: d
61
61
  });
62
62
  };
63
63
  //#endregion
@@ -1,2 +1,2 @@
1
- import { BankAccountOnboardingWidget as e } from "./index17.js";
1
+ import { BankAccountOnboardingWidget as e } from "./index18.js";
2
2
  export { e as BankAccountOnboardingWidget };