@tesouro/embedded-components-react 0.10.0 → 0.10.5

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 (41) hide show
  1. package/dist/experimental/index.d.ts +2 -108
  2. package/dist/experimental/index.js +4 -5
  3. package/dist/index.d.ts +3 -0
  4. package/dist/lib/BankAccountsWidget.d.ts +3 -0
  5. package/dist/lib/WidgetSuite.d.ts +3 -0
  6. package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/lib/BalancesWidget/BalancesWidgetContext.js +39 -36
  7. package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/lib/BalancesWidget/BalancesWidgetFeature.js +6 -6
  8. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index9.js +31 -22
  9. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index6.js +44 -31
  10. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index7.js +3 -0
  11. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index8.js +59 -56
  12. package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/lib/InsightsWidget/useDismissedInsightIds.js +77 -38
  13. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  14. package/dist/packages/shared-ui-shadcn/dist/index.js +3374 -3474
  15. package/package.json +1 -1
  16. package/dist/experimental/ApprovalRequests.d.ts +0 -706
  17. package/dist/experimental/ApprovalRequests.js +0 -2
  18. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index.js +0 -9
  19. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index2.js +0 -9
  20. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index3.js +0 -71
  21. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index4.js +0 -33
  22. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index5.js +0 -34
  23. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index6.js +0 -26
  24. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index7.js +0 -30
  25. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/index.js +0 -1
  26. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/ApprovalRequestsWidget.js +0 -89
  27. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/buildApprovalRequestRows.js +0 -44
  28. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/canDecideApprovalRequest.js +0 -7
  29. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/constants.js +0 -18
  30. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/labels.js +0 -28
  31. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/permissions.js +0 -8
  32. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/useApprovalRequestDecisions.js +0 -93
  33. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/useApprovalRequestNames.js +0 -65
  34. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/useApprovalRequestsFilters.js +0 -148
  35. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/useApprovalRequestsTable.js +0 -73
  36. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/analytics/events.js +0 -3
  37. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index.js +0 -5
  38. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index2.js +0 -47
  39. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index3.js +0 -142
  40. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index4.js +0 -136
  41. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index5.js +0 -43
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import { ComponentType, AnchorHTMLAttributes, ReactNode, ErrorInfo, CSSProperties } from 'react';
3
- import { PartialDeep } from 'type-fest';
4
3
  import { FallbackProps } from 'react-error-boundary';
5
4
 
6
5
  type AuthToken = string | undefined;
@@ -327,27 +326,11 @@ type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean
327
326
  type ClientOptions = {
328
327
  baseUrl: 'https://api.stage.tesouro.com' | 'https://api.sandbox.stage.tesouro.com' | 'https://api.stage.business-banking.app' | 'https://api.tesouro.com' | 'https://api.sandbox.tesouro.com' | 'https://api.business-banking.app' | (string & {});
329
328
  };
330
- type ApprovalRequestStatus = 'waiting' | 'approved' | 'rejected' | 'canceled';
331
329
 
332
330
  type EmbeddedClient = Client;
333
331
  type ExtractLiterals<T> = T extends string ? string extends T ? never : T : never;
334
332
  type BaseUrl = ExtractLiterals<ClientOptions['baseUrl']>;
335
333
 
336
- interface FilterMenuButtonLabels {
337
- /** Button text, followed by "(N)" when `activeCount` is set. */
338
- filters: string;
339
- }
340
-
341
- interface FilterTagLabels {
342
- /**
343
- * Accessible name for the editable tag body. `{label}` is substituted with
344
- * the tag's own text; keep the placeholder when overriding.
345
- */
346
- edit: string;
347
- /** Accessible name for the × dismiss button. `{label}` is substituted. */
348
- remove: string;
349
- }
350
-
351
334
  type LinkComponentProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
352
335
  children?: ReactNode;
353
336
  };
@@ -613,95 +596,6 @@ interface WidgetProviderProps extends WidgetProviderBaseProps {
613
596
  providerLabels?: Partial<WidgetProviderLabels>;
614
597
  }
615
598
 
616
- interface ApprovalRequestsFilterBarLabels {
617
- fields: {
618
- status: string;
619
- addedBy: string;
620
- requestedOn: string;
621
- };
622
- fieldMenuLabel: string;
623
- onlyMine: string;
624
- userSearchLabel: string;
625
- userSearchPlaceholder: string;
626
- userEmpty: string;
627
- userLoading: string;
628
- userError: string;
629
- clearAll: string;
630
- filterMenuButton: FilterMenuButtonLabels;
631
- filterTag: FilterTagLabels;
632
- }
633
- interface ApprovalRequestsScreenLabels {
634
- columnInvoiceNumber: string;
635
- columnVendor: string;
636
- columnIssueDate: string;
637
- columnDueDate: string;
638
- columnStatus: string;
639
- columnAmount: string;
640
- columnAddedBy: string;
641
- columnActions: string;
642
- rowActions: string;
643
- approve: string;
644
- reject: string;
645
- /** Read by screen readers in a cell whose name is still loading. */
646
- loadingValue: string;
647
- errorTitle: string;
648
- errorDescription: string;
649
- errorRetry: string;
650
- filterBar: ApprovalRequestsFilterBarLabels;
651
- accessRestrictedTitle: string;
652
- accessRestrictedDescription: string;
653
- }
654
- interface RejectApprovalRequestDialogLabels {
655
- title: string;
656
- description: string;
657
- reason: string;
658
- optionalNote: string;
659
- confirm: string;
660
- cancel: string;
661
- close: string;
662
- }
663
-
664
- interface ApprovalRequestsFilterLabels {
665
- statusChip: (value: string) => string;
666
- addedByChip: (name: string) => string;
667
- requestedOnChip: (range: string) => string;
668
- moreSelected: (first: string, count: number) => string;
669
- dateRange: (from: string, to: string) => string;
670
- }
671
- interface ApprovalRequestsListLabels {
672
- emptyTitle: string;
673
- emptyDescription: string;
674
- filterEmptyTitle: string;
675
- filterEmptyDescription: string;
676
- /** Shown in a cell whose value the request's payable does not carry. */
677
- missingValue: string;
678
- /** Shown for a vendor or creator this session may not read, or whose lookup failed. */
679
- unavailableValue: string;
680
- status: Record<ApprovalRequestStatus, string>;
681
- filters: ApprovalRequestsFilterLabels;
682
- }
683
- /** Toast copy for approve and reject; the error copy is the fallback when the API gives no reason. */
684
- interface ApprovalRequestsMessageLabels {
685
- approved: string;
686
- rejected: string;
687
- approveError: string;
688
- rejectError: string;
689
- }
690
-
691
- interface ApprovalRequestsWidgetOwnProps {
692
- screenLabels?: PartialDeep<ApprovalRequestsScreenLabels>;
693
- listLabels?: PartialDeep<ApprovalRequestsListLabels>;
694
- rejectDialogLabels?: PartialDeep<RejectApprovalRequestDialogLabels>;
695
- messageLabels?: PartialDeep<ApprovalRequestsMessageLabels>;
696
- }
697
- /** Public props for {@link ApprovalRequestsWidget}. */
698
- type ApprovalRequestsWidgetProps = WidgetProviderProps & ApprovalRequestsWidgetOwnProps;
699
- /**
700
- * Self-contained approval requests widget, a native port of Monite's approval
701
- * requests (FOPS-97). Exported only from the package's `/experimental` entry.
702
- */
703
- declare function ApprovalRequestsWidget({ screenLabels, listLabels, rejectDialogLabels, messageLabels, ...widgetProviderProps }: ApprovalRequestsWidgetProps): React.JSX.Element;
704
-
705
599
  interface AccountsQuickViewTileLabels {
706
600
  /** Tile heading above the total. */
707
601
  title: string;
@@ -959,5 +853,5 @@ interface RemoteCheckCaptureWidgetProps extends WidgetProviderProps {
959
853
  }
960
854
  declare function RemoteCheckCaptureWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, providerLabels, labels, onDepositComplete, }: RemoteCheckCaptureWidgetProps): React.JSX.Element;
961
855
 
962
- export { ApprovalRequestsWidget, QUICK_VIEW_CLICK_HANDLERS, QUICK_VIEW_WIDGET_LABELS_EN, QuickViewType, QuickViewWidget, RemoteCheckCaptureWidget };
963
- export type { AccountsQuickViewWidgetLabels, ApprovalRequestsWidgetProps, InvoicesQuickViewWidgetLabels, QuickViewWidgetClickHandlers, QuickViewWidgetLabelOverrides, QuickViewWidgetLabels, QuickViewWidgetProps, RemoteCheckCaptureWidgetProps };
856
+ export { QUICK_VIEW_CLICK_HANDLERS, QUICK_VIEW_WIDGET_LABELS_EN, QuickViewType, QuickViewWidget, RemoteCheckCaptureWidget };
857
+ export type { AccountsQuickViewWidgetLabels, InvoicesQuickViewWidgetLabels, QuickViewWidgetClickHandlers, QuickViewWidgetLabelOverrides, QuickViewWidgetLabels, QuickViewWidgetProps, RemoteCheckCaptureWidgetProps };
@@ -1,5 +1,4 @@
1
- import { ApprovalRequestsWidget as e } from "../libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/ApprovalRequestsWidget.js";
2
- import { QUICK_VIEW_CLICK_HANDLERS as t, QuickViewType as n, QuickViewWidget as r } from "../libs/tesouro-embedded-components-react/quick-view-widget/feature/dist/lib/QuickViewWidget/QuickViewWidget.js";
3
- import { QUICK_VIEW_WIDGET_LABELS_EN as i } from "../libs/tesouro-embedded-components-react/quick-view-widget/feature/dist/lib/QuickViewWidget/labels.js";
4
- import { RemoteCheckCaptureWidget as a } from "../libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/RemoteCheckCaptureWidget.js";
5
- export { e as ApprovalRequestsWidget, t as QUICK_VIEW_CLICK_HANDLERS, i as QUICK_VIEW_WIDGET_LABELS_EN, n as QuickViewType, r as QuickViewWidget, a as RemoteCheckCaptureWidget };
1
+ import { QUICK_VIEW_CLICK_HANDLERS as e, QuickViewType as t, QuickViewWidget as n } from "../libs/tesouro-embedded-components-react/quick-view-widget/feature/dist/lib/QuickViewWidget/QuickViewWidget.js";
2
+ import { QUICK_VIEW_WIDGET_LABELS_EN as r } from "../libs/tesouro-embedded-components-react/quick-view-widget/feature/dist/lib/QuickViewWidget/labels.js";
3
+ import { RemoteCheckCaptureWidget as i } from "../libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/RemoteCheckCaptureWidget.js";
4
+ export { e as QUICK_VIEW_CLICK_HANDLERS, r as QUICK_VIEW_WIDGET_LABELS_EN, t as QuickViewType, n as QuickViewWidget, i as RemoteCheckCaptureWidget };
package/dist/index.d.ts CHANGED
@@ -2415,6 +2415,9 @@ interface Labels$3 {
2415
2415
  statementsTab: string;
2416
2416
  detailsTab: string;
2417
2417
  noTransactionsLabel: string;
2418
+ transactionsErrorTitle: string;
2419
+ transactionsErrorRetry: string;
2420
+ transactionsLoadingLabel: string;
2418
2421
  transactionDateColumn: string;
2419
2422
  transactionDescriptionColumn: string;
2420
2423
  transactionAmountColumn: string;
@@ -643,6 +643,9 @@ interface Labels {
643
643
  statementsTab: string;
644
644
  detailsTab: string;
645
645
  noTransactionsLabel: string;
646
+ transactionsErrorTitle: string;
647
+ transactionsErrorRetry: string;
648
+ transactionsLoadingLabel: string;
646
649
  transactionDateColumn: string;
647
650
  transactionDescriptionColumn: string;
648
651
  transactionAmountColumn: string;
@@ -1439,6 +1439,9 @@ interface Labels$3 {
1439
1439
  statementsTab: string;
1440
1440
  detailsTab: string;
1441
1441
  noTransactionsLabel: string;
1442
+ transactionsErrorTitle: string;
1443
+ transactionsErrorRetry: string;
1444
+ transactionsLoadingLabel: string;
1442
1445
  transactionDateColumn: string;
1443
1446
  transactionDescriptionColumn: string;
1444
1447
  transactionAmountColumn: string;
@@ -12,12 +12,12 @@ import { useEmbedApi as a } from "../../../../../shared/data-access/dist/lib/Emb
12
12
  import { Scope as o } from "../../../../../shared/data-access/dist/lib/scopes.js";
13
13
  import { useAllBankAccountsQuery as s } from "../../../../../shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js";
14
14
  import "../../../../../shared/data-access/dist/index.js";
15
- import { useRefetchWidget as c, useWidgetConfig as l, useWidgetError as u, useWidgetLoading as d } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
15
+ import { useRefetchWidget as c, useWidgetConfig as l, useWidgetError as u, useWidgetInitStaleForToken as d, useWidgetLoading as f } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
16
16
  import "../../../../../shared/feature/dist/index.js";
17
- import { createContext as f, useCallback as p, useContext as m, useMemo as h } from "react";
18
- import { jsx as g } from "react/jsx-runtime";
17
+ import { createContext as p, useCallback as m, useContext as h, useMemo as g } from "react";
18
+ import { jsx as _ } from "react/jsx-runtime";
19
19
  // ../../libs/tesouro-embedded-components-react/balances-widget/feature/dist/lib/BalancesWidget/BalancesWidgetContext.js
20
- var _ = f({
20
+ var v = p({
21
21
  accountRows: [],
22
22
  isLoading: !1,
23
23
  isError: !1,
@@ -26,15 +26,17 @@ var _ = f({
26
26
  shouldTotalBalanceDisplay: !1,
27
27
  shouldShowViewAllAccounts: !1,
28
28
  isRowClickable: !1,
29
+ isVisible: !1,
29
30
  onViewAllAccountsClicked: () => {}
30
- }), v = () => m(_), y = ({ children: f, maxAccounts: m, onBalanceRowClick: v, onViewAllAccountsClick: y }) => {
31
- let { data: b, isLoading: x, isError: S, refetch: C, hasNextPage: w, isFetchingNextPage: T } = s(), { initResponse: E } = l(), D = d(), O = i(a().organizationStatus), k = u(), A = c(), j = D && !E || O && !b || x, M = !!k || S, N = p(() => {
32
- A(), k || C();
31
+ }), y = () => h(v), b = ({ children: p, maxAccounts: h, onBalanceRowClick: y, onViewAllAccountsClick: b }) => {
32
+ let { initResponse: x } = l(), S = d(), C = !S && (x?.scopes?.includes(o.BankAccountReadOrg) ?? !1), { data: w, isLoading: T, isError: E, refetch: D, hasNextPage: O, isFetchingNextPage: k } = s({ enabled: C }), A = f(), j = i(a().organizationStatus), M = u(), N = c(), P = A && !x || j && !w || T, F = !!M || E, I = m(() => {
33
+ N(), !M && C && D();
33
34
  }, [
34
- A,
35
35
  C,
36
- k
37
- ]), P = b?.data ?? [], F = h(() => P.map((t) => {
36
+ N,
37
+ D,
38
+ M
39
+ ]), L = w?.data ?? [], R = g(() => L.map((t) => {
38
40
  let r = t.accountNumber.slice(-4), i = n(t.balance);
39
41
  return {
40
42
  accountId: t.id,
@@ -47,37 +49,38 @@ var _ = f({
47
49
  })
48
50
  }
49
51
  };
50
- }), [P]), I = h(() => {
51
- let n = t(P[0]?.balance?.currencyCode), i = r(P.map((e) => e.balance), n);
52
+ }), [L]), z = g(() => {
53
+ let n = t(L[0]?.balance?.currencyCode), i = r(L.map((e) => e.balance), n);
52
54
  return e(i, {
53
55
  currencyCode: n,
54
56
  includeSpaceAfterCurrencySymbol: !1
55
57
  });
56
- }, [P]), L = h(() => P.length > 1 && (E?.scopes?.includes(o.BankAccountReadOrg) ?? !1) && !w && !T, [
57
- P.length,
58
- E?.scopes,
59
- w,
60
- T
61
- ]), R = h(() => P.length > m && !!y, [
62
- P.length,
63
- m,
64
- y
65
- ]), z = p(() => {
66
- y?.();
67
- }, [y]), B = h(() => !!v, [v]);
68
- return /* @__PURE__ */ g(_.Provider, {
58
+ }, [L]), B = g(() => L.length > 1 && (x?.scopes?.includes(o.BankAccountReadOrg) ?? !1) && !O && !k, [
59
+ L.length,
60
+ x?.scopes,
61
+ O,
62
+ k
63
+ ]), V = g(() => L.length > h && !!b, [
64
+ L.length,
65
+ h,
66
+ b
67
+ ]), H = m(() => {
68
+ b?.();
69
+ }, [b]), U = g(() => !!y, [y]);
70
+ return /* @__PURE__ */ _(v.Provider, {
69
71
  value: {
70
- accountRows: F,
71
- isLoading: j,
72
- isError: M,
73
- refetch: N,
74
- totalBalance: I,
75
- shouldTotalBalanceDisplay: L,
76
- shouldShowViewAllAccounts: R,
77
- isRowClickable: B,
78
- onViewAllAccountsClicked: z
72
+ accountRows: R,
73
+ isLoading: P,
74
+ isError: F,
75
+ refetch: I,
76
+ totalBalance: z,
77
+ shouldTotalBalanceDisplay: B,
78
+ shouldShowViewAllAccounts: V,
79
+ isRowClickable: U,
80
+ isVisible: !x || S || C || !!M,
81
+ onViewAllAccountsClicked: H
79
82
  },
80
- children: f
83
+ children: p
81
84
  });
82
85
  };
83
- export { y as BalancesWidgetContextProvider, v as useBalancesWidgetContext };
86
+ export { b as BalancesWidgetContextProvider, y as useBalancesWidgetContext };
@@ -20,16 +20,16 @@ function p({ maxAccounts: t, labels: r, onBalanceRowClick: i }) {
20
20
  l(() => {
21
21
  f(n.Mounted);
22
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,
23
+ let { accountRows: p, isLoading: m, isError: h, refetch: g, totalBalance: _, shouldTotalBalanceDisplay: v, shouldShowViewAllAccounts: y, isRowClickable: b, isVisible: x, onViewAllAccountsClicked: S } = a(), C = u(() => p.slice(0, t), [p, t]), w = u(() => p.map((e) => e.view), [p]);
24
+ return x ? /* @__PURE__ */ d(s, {
25
+ accountRows: w,
26
26
  isLoading: m,
27
27
  isError: h,
28
28
  onRetry: h ? () => void g() : void 0,
29
29
  totalBalance: _,
30
30
  shouldTotalBalanceDisplay: v,
31
31
  shouldShowViewAllAccounts: y,
32
- onViewAllAccountsClicked: x,
32
+ onViewAllAccountsClicked: S,
33
33
  labels: r,
34
34
  testIds: {
35
35
  skeleton: o.skeleton,
@@ -38,13 +38,13 @@ function p({ maxAccounts: t, labels: r, onBalanceRowClick: i }) {
38
38
  totalBalanceInfo: o.totalBalanceInfo,
39
39
  totalAvailableLabel: o.totalAvailableLabel
40
40
  },
41
- children: S.map((e) => /* @__PURE__ */ d(c, {
41
+ children: C.map((e) => /* @__PURE__ */ d(c, {
42
42
  accountId: e.accountId,
43
43
  row: e.view,
44
44
  onBalanceRowClick: i,
45
45
  isRowClickable: b
46
46
  }, e.accountId))
47
- });
47
+ }) : null;
48
48
  }
49
49
  var m = ({ maxAccounts: e = f, labels: t, onBalanceRowClick: n, onViewAllAccountsClick: r }) => {
50
50
  let a = Math.max(0, e);
@@ -121,27 +121,33 @@ function m({ accountId: m, onBack: Ae, labels: je, featureLabels: Me, isBankingT
121
121
  h.viewStatementButtonAriaLabel,
122
122
  B,
123
123
  gt
124
- ]), X = W.data?.nextPaginationToken ?? void 0, Z = W.data?.prevPaginationToken ?? void 0, vt = C && T === "statements" && !!W.data && !W.isError, yt = C && T === "statements" && W.isLoading, bt = C && T === "statements" && W.isError && !r(W.error), xt = d(() => {
124
+ ]), X = W.data?.nextPaginationToken ?? void 0, Z = W.data?.prevPaginationToken ?? void 0, vt = C && T === "transactions" && U.isLoading, yt = C && T === "transactions" && U.isError, bt = d(() => {
125
+ C && T === "transactions" && U.refetch();
126
+ }, [
127
+ T,
128
+ C,
129
+ U.refetch
130
+ ]), xt = C && T === "statements" && !!W.data && !W.isError, St = C && T === "statements" && W.isLoading, Ct = C && T === "statements" && W.isError && !r(W.error), wt = d(() => {
125
131
  W.refetch();
126
- }, [W.refetch]), St = d((e) => {
132
+ }, [W.refetch]), Tt = d((e) => {
127
133
  Ze(e), z(void 0);
128
- }, []), Ct = d(() => {
134
+ }, []), Et = d(() => {
129
135
  z(Z);
130
- }, [Z]), wt = d(() => {
136
+ }, [Z]), Dt = d(() => {
131
137
  z(X);
132
- }, [X]), Tt = w || !o(M, P), Et = f(() => {
138
+ }, [X]), Ot = w || !o(M, P), kt = f(() => {
133
139
  let e = [{ after: c() }];
134
140
  return P && e.push({ after: s(P) }), e;
135
- }, [P]), Dt = f(() => {
141
+ }, [P]), At = f(() => {
136
142
  let e = [{ after: c() }];
137
143
  return M && e.push({ before: s(M) }), e;
138
- }, [M]), Ot = d((e) => {
144
+ }, [M]), jt = d((e) => {
139
145
  if (e) {
140
146
  let { startDate: e, endDate: t } = ie();
141
147
  N(e), F(t);
142
148
  }
143
149
  j(e);
144
- }, []), kt = d(async () => {
150
+ }, []), Mt = d(async () => {
145
151
  if (!b || !x.canRead || !M || !P || !o(M, P)) return;
146
152
  j(!1);
147
153
  let t = e.loading(g.exportLoadingToast);
@@ -199,26 +205,29 @@ function m({ accountId: m, onBack: Ae, labels: je, featureLabels: Me, isBankingT
199
205
  isBankingTaglineVisible: Ne,
200
206
  activeTab: T,
201
207
  transactionRows: mt,
208
+ isTransactionsError: yt,
209
+ isTransactionsLoading: vt,
210
+ onTransactionsRetry: bt,
202
211
  statementRows: _t,
203
- isStatementsLoading: yt,
204
- isStatementsError: bt,
205
- onStatementsRetry: xt,
206
- isStatementsPaginationVisible: vt,
212
+ isStatementsLoading: St,
213
+ isStatementsError: Ct,
214
+ onStatementsRetry: wt,
215
+ isStatementsPaginationVisible: xt,
207
216
  statementsPageSize: I,
208
217
  statementsPageSizeOptions: Ee,
209
218
  isStatementsPreviousPageDisabled: !Z,
210
219
  isStatementsNextPageDisabled: !X,
211
- onStatementsPageSizeChange: St,
212
- onStatementsPreviousPageClick: Ct,
213
- onStatementsNextPageClick: wt,
220
+ onStatementsPageSizeChange: Tt,
221
+ onStatementsPreviousPageClick: Et,
222
+ onStatementsNextPageClick: Dt,
214
223
  showExport: ht,
215
224
  isExportOpen: Xe,
216
225
  exportStartDate: M,
217
226
  exportEndDate: P,
218
227
  isExportDownloading: ot,
219
- isExportDownloadDisabled: Tt,
220
- disabledExportStartDates: Et,
221
- disabledExportEndDates: Dt,
228
+ isExportDownloadDisabled: Ot,
229
+ disabledExportStartDates: kt,
230
+ disabledExportEndDates: At,
222
231
  accountNumberLabel: q?.accountNumber ?? "",
223
232
  maskedAccountNumberLabel: ue(q?.accountNumber ?? ""),
224
233
  accountNumberTestId: "bank-accounts-widget-detail-account-number",
@@ -233,8 +242,8 @@ function m({ accountId: m, onBack: Ae, labels: je, featureLabels: Me, isBankingT
233
242
  isAccountNumberCopied: Ke,
234
243
  isRoutingNumberCopied: qe,
235
244
  isDomesticWireExpanded: Je,
236
- isLoading: !y && (Ve && !q || Be && !v || C && (H.isLoading || T === "transactions" && U.isLoading)),
237
- isError: y || C && (H.isError || T === "transactions" && U.isError),
245
+ isLoading: !y && (Ve && !q || Be && !v || C && H.isLoading),
246
+ isError: y || C && H.isError,
238
247
  isEditOpen: Ue,
239
248
  isEditDisabled: !x.canWrite,
240
249
  isEditError: G,
@@ -270,11 +279,11 @@ function m({ accountId: m, onBack: Ae, labels: je, featureLabels: Me, isBankingT
270
279
  });
271
280
  },
272
281
  onEditNicknameClick: () => $(!0),
273
- onExportOpenChange: Ot,
282
+ onExportOpenChange: jt,
274
283
  onExportStartDateChange: N,
275
284
  onExportEndDateChange: F,
276
285
  onExportDownload: () => {
277
- kt();
286
+ Mt();
278
287
  }
279
288
  });
280
289
  }
@@ -2,73 +2,86 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { Button as e, Table as t, TableBody as n, TableCell as r, TableHead as i, TableHeader as a, TableRow as o } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
- import { DownloadIcon as l } from "lucide-react";
5
+ import { Button as e, Skeleton as t, Table as n, TableBody as r, TableCell as i, TableHead as a, TableHeader as o, TableRow as s } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { ErrorState as c } from "../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
7
+ import "../../../../shared/ui/dist/index.js";
8
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
9
+ import { DownloadIcon as d } from "lucide-react";
8
10
  // ../../libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index6.js
9
- function u({ labels: u, rows: d, showExport: f = !1, onExportClick: p }) {
10
- return d.length === 0 ? /* @__PURE__ */ s("div", {
11
+ function f({ labels: f, rows: p, showExport: m = !1, onExportClick: h, isError: g = !1, onRetry: _, isLoading: v = !1 }) {
12
+ return g ? /* @__PURE__ */ l("div", {
13
+ className: "ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card",
14
+ children: /* @__PURE__ */ l(c, {
15
+ title: f.transactionsErrorTitle,
16
+ retryLabel: _ ? f.transactionsErrorRetry : void 0,
17
+ onRetry: _
18
+ })
19
+ }) : v ? /* @__PURE__ */ l("div", {
20
+ className: "ttw:space-y-3 ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:p-6",
21
+ "aria-label": f.transactionsLoadingLabel,
22
+ children: Array.from({ length: 3 }).map((e, n) => /* @__PURE__ */ l(t, { className: "ttw:h-5 ttw:w-full" }, n))
23
+ }) : p.length === 0 ? /* @__PURE__ */ l("div", {
11
24
  className: "ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:p-6",
12
- children: /* @__PURE__ */ s("p", {
25
+ children: /* @__PURE__ */ l("p", {
13
26
  className: "ttw:text-muted-foreground",
14
- children: u.noTransactionsLabel
27
+ children: f.noTransactionsLabel
15
28
  })
16
- }) : /* @__PURE__ */ s("div", {
29
+ }) : /* @__PURE__ */ l("div", {
17
30
  className: "ttw:overflow-hidden ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card",
18
- children: /* @__PURE__ */ c(t, { children: [/* @__PURE__ */ c(a, {
19
- className: f ? "ttw:[&_tr:first-child]:border-b-0" : void 0,
20
- children: [f ? /* @__PURE__ */ s(o, {
31
+ children: /* @__PURE__ */ u(n, { children: [/* @__PURE__ */ u(o, {
32
+ className: m ? "ttw:[&_tr:first-child]:border-b-0" : void 0,
33
+ children: [m ? /* @__PURE__ */ l(s, {
21
34
  className: "ttw:border-b-0 ttw:bg-card ttw:hover:bg-card",
22
- children: /* @__PURE__ */ s(i, {
35
+ children: /* @__PURE__ */ l(a, {
23
36
  colSpan: 4,
24
37
  className: "ttw:h-auto ttw:px-4 ttw:py-3 ttw:text-right",
25
- children: /* @__PURE__ */ c(e, {
38
+ children: /* @__PURE__ */ u(e, {
26
39
  type: "button",
27
40
  variant: "outline",
28
41
  size: "sm",
29
- onClick: p,
30
- children: [/* @__PURE__ */ s(l, { className: "ttw:size-4" }), u.exportButton]
42
+ onClick: h,
43
+ children: [/* @__PURE__ */ l(d, { className: "ttw:size-4" }), f.exportButton]
31
44
  })
32
45
  })
33
- }) : null, /* @__PURE__ */ c(o, {
46
+ }) : null, /* @__PURE__ */ u(s, {
34
47
  className: "ttw:border-border ttw:bg-card ttw:hover:bg-card",
35
48
  children: [
36
- /* @__PURE__ */ s(i, {
49
+ /* @__PURE__ */ l(a, {
37
50
  className: "ttw:h-auto ttw:w-[15%] ttw:px-4 ttw:py-3 ttw:font-semibold",
38
- children: u.transactionDateColumn
51
+ children: f.transactionDateColumn
39
52
  }),
40
- /* @__PURE__ */ s(i, {
53
+ /* @__PURE__ */ l(a, {
41
54
  className: "ttw:h-auto ttw:w-[60%] ttw:px-4 ttw:py-3 ttw:font-semibold",
42
- children: u.transactionDescriptionColumn
55
+ children: f.transactionDescriptionColumn
43
56
  }),
44
- /* @__PURE__ */ s(i, {
57
+ /* @__PURE__ */ l(a, {
45
58
  className: "ttw:h-auto ttw:w-[12%] ttw:px-4 ttw:py-3 ttw:text-right ttw:font-semibold",
46
- children: u.transactionAmountColumn
59
+ children: f.transactionAmountColumn
47
60
  }),
48
- /* @__PURE__ */ s(i, {
61
+ /* @__PURE__ */ l(a, {
49
62
  className: "ttw:h-auto ttw:w-[13%] ttw:px-4 ttw:py-3 ttw:text-right ttw:font-semibold",
50
- children: u.transactionBalanceColumn
63
+ children: f.transactionBalanceColumn
51
64
  })
52
65
  ]
53
66
  })]
54
- }), /* @__PURE__ */ s(n, {
67
+ }), /* @__PURE__ */ l(r, {
55
68
  className: "ttw:bg-card",
56
- children: d.map((e) => /* @__PURE__ */ c(o, {
69
+ children: p.map((e) => /* @__PURE__ */ u(s, {
57
70
  className: "ttw:bg-card ttw:hover:bg-transparent",
58
71
  children: [
59
- /* @__PURE__ */ s(r, {
72
+ /* @__PURE__ */ l(i, {
60
73
  className: "ttw:px-4 ttw:py-3 ttw:align-top",
61
74
  children: e.dateLabel
62
75
  }),
63
- /* @__PURE__ */ s(r, {
76
+ /* @__PURE__ */ l(i, {
64
77
  className: "ttw:px-4 ttw:py-3 ttw:align-top ttw:font-medium",
65
78
  children: e.descriptionLabel
66
79
  }),
67
- /* @__PURE__ */ s(r, {
80
+ /* @__PURE__ */ l(i, {
68
81
  className: `ttw:px-4 ttw:py-3 ttw:text-right ttw:align-top ttw:whitespace-nowrap ${e.amountVariant === "positive" ? "ttw:text-green-700" : "ttw:text-foreground"}`,
69
82
  children: e.amountLabel
70
83
  }),
71
- /* @__PURE__ */ s(r, {
84
+ /* @__PURE__ */ l(i, {
72
85
  className: "ttw:px-4 ttw:py-3 ttw:text-right ttw:align-top ttw:whitespace-nowrap",
73
86
  children: e.balanceLabel
74
87
  })
@@ -77,4 +90,4 @@ function u({ labels: u, rows: d, showExport: f = !1, onExportClick: p }) {
77
90
  })] })
78
91
  });
79
92
  }
80
- export { u as TransactionsTable };
93
+ export { f as TransactionsTable };
@@ -8,6 +8,9 @@ var e = {
8
8
  statementsTab: "Statements",
9
9
  detailsTab: "Details",
10
10
  noTransactionsLabel: "No transactions found",
11
+ transactionsErrorTitle: "Unable to load transactions.",
12
+ transactionsErrorRetry: "Retry",
13
+ transactionsLoadingLabel: "Loading transactions",
11
14
  transactionDateColumn: "Date",
12
15
  transactionDescriptionColumn: "Description",
13
16
  transactionAmountColumn: "Amount",