@tesouro/embedded-components-react 0.11.111 → 0.11.113

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 (28) hide show
  1. package/dist/experimental/BalanceHistoryWidget.d.ts +702 -0
  2. package/dist/experimental/BalanceHistoryWidget.js +5 -0
  3. package/dist/experimental/index.d.ts +93 -2
  4. package/dist/experimental/index.js +7 -4
  5. package/dist/index.css +9 -0
  6. package/dist/index.d.ts +84 -2
  7. package/dist/lib/WidgetSuite.d.ts +84 -2
  8. package/dist/libs/tesouro-embedded-components-react/balance-history-widget/data-access/dist/index.js +3 -0
  9. package/dist/libs/tesouro-embedded-components-react/balance-history-widget/data-access/dist/index2.js +89 -0
  10. package/dist/libs/tesouro-embedded-components-react/balance-history-widget/data-access/dist/index3.js +19 -0
  11. package/dist/libs/tesouro-embedded-components-react/balance-history-widget/feature/dist/index.js +4 -0
  12. package/dist/libs/tesouro-embedded-components-react/balance-history-widget/feature/dist/lib/BalanceHistoryWidget/BalanceHistoryWidgetFeature.js +159 -0
  13. package/dist/libs/tesouro-embedded-components-react/balance-history-widget/feature/dist/lib/BalanceHistoryWidget/labels.js +31 -0
  14. package/dist/libs/tesouro-embedded-components-react/balance-history-widget/feature/dist/lib/BalanceHistoryWidget/testIds.js +12 -0
  15. package/dist/libs/tesouro-embedded-components-react/balance-history-widget/feature/dist/lib/analytics/events.js +3 -0
  16. package/dist/libs/tesouro-embedded-components-react/balance-history-widget/feature/dist/lib/balanceHistoryView/balanceHistoryRange.js +39 -0
  17. package/dist/libs/tesouro-embedded-components-react/balance-history-widget/feature/dist/lib/balanceHistoryView/buildBalanceHistoryView.js +70 -0
  18. package/dist/libs/tesouro-embedded-components-react/balance-history-widget/ui/dist/index.js +3 -0
  19. package/dist/libs/tesouro-embedded-components-react/balance-history-widget/ui/dist/index2.js +93 -0
  20. package/dist/libs/tesouro-embedded-components-react/balance-history-widget/ui/dist/index3.js +19 -0
  21. package/dist/libs/tesouro-embedded-components-react/balance-history-widget/ui/dist/index4.js +176 -0
  22. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +43 -43
  23. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +115 -115
  24. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +199 -175
  25. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  26. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/WidgetFrame/WidgetFrame.js +2 -2
  27. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/lib/WidgetSuite/sections/DashboardSection.js +28 -19
  28. package/package.json +2 -1
@@ -0,0 +1,5 @@
1
+ import { BALANCE_HISTORY_RANGES as e, BalanceHistoryRange as t } from "../libs/tesouro-embedded-components-react/balance-history-widget/feature/dist/lib/balanceHistoryView/balanceHistoryRange.js";
2
+ import { BALANCE_HISTORY_WIDGET_LABELS_EN as n } from "../libs/tesouro-embedded-components-react/balance-history-widget/feature/dist/lib/BalanceHistoryWidget/labels.js";
3
+ import { BalanceHistoryWidget as r } from "../libs/tesouro-embedded-components-react/balance-history-widget/feature/dist/lib/BalanceHistoryWidget/BalanceHistoryWidgetFeature.js";
4
+ import "../libs/tesouro-embedded-components-react/balance-history-widget/feature/dist/index.js";
5
+ export { e as BALANCE_HISTORY_RANGES, n as BALANCE_HISTORY_WIDGET_LABELS_EN, t as BalanceHistoryRange, r as BalanceHistoryWidget };
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { ComponentType, AnchorHTMLAttributes, ReactNode, ErrorInfo, CSSProperties } from 'react';
3
+ import { PartialDeep } from 'type-fest';
3
4
  import { RowData } from '@tanstack/react-table';
4
5
  import { FallbackProps } from 'react-error-boundary';
5
6
 
@@ -607,6 +608,96 @@ interface WidgetProviderProps extends WidgetProviderBaseProps {
607
608
  providerLabels?: Partial<WidgetProviderLabels>;
608
609
  }
609
610
 
611
+ /** The range buttons, in display order. */
612
+ declare const BalanceHistoryRange: {
613
+ readonly Days30: "30d";
614
+ readonly Days90: "90d";
615
+ readonly Year: "1y";
616
+ };
617
+ type BalanceHistoryRange = (typeof BalanceHistoryRange)[keyof typeof BalanceHistoryRange];
618
+ declare const BALANCE_HISTORY_RANGES: readonly BalanceHistoryRange[];
619
+
620
+ interface BalanceHistoryCardLabels {
621
+ title: string;
622
+ /** Accessible name of the account picker. */
623
+ accountSelect: string;
624
+ /** Placeholder of the account search, used once there are more than ten accounts. */
625
+ accountSearchPlaceholder: string;
626
+ /** Shown when the account search matches nothing. */
627
+ accountSearchEmpty: string;
628
+ /** Accessible name of the account search's clear button. */
629
+ accountSearchClear: string;
630
+ /** Accessible name of the range buttons. */
631
+ rangeTabs: string;
632
+ /** Accessible name of the chart. */
633
+ chart: string;
634
+ /** Name of the plotted series, shown in the tooltip and as the data table's value column. */
635
+ seriesName: string;
636
+ /** Between the series name and the value in the tooltip, e.g. "Balance: $34,054.35". */
637
+ tooltipSeparator: string;
638
+ /** Caption of the chart's data table, read to screen readers only. */
639
+ dataTable: string;
640
+ /** Heading of the data table's date column. */
641
+ dateColumn: string;
642
+ loading: string;
643
+ errorTitle: string;
644
+ errorDescription: string;
645
+ retry: string;
646
+ }
647
+
648
+ interface BalanceHistoryWidgetLabels extends BalanceHistoryCardLabels {
649
+ /** The picker's first option, the sum of every account. */
650
+ allAccounts: string;
651
+ /** A picker option, e.g. "Business Checking - 0578". */
652
+ accountOption: (name: string, last4: string) => string;
653
+ /** Range button text, e.g. "30D". */
654
+ ranges: Record<BalanceHistoryRange, string>;
655
+ /** The span a full range covers, e.g. "in the last 30 days". */
656
+ rangeSpans: Record<BalanceHistoryRange, string>;
657
+ /** Read to screen readers on a range the account is too young for. */
658
+ rangeTooYoung: Record<BalanceHistoryRange, string>;
659
+ /** Read to screen readers on a range an unfunded account cannot show. */
660
+ rangeNeedsMoney: string;
661
+ /** The span when the window starts on the opening day, e.g. "since account opened Oct 30". */
662
+ sinceOpened: (date: string) => string;
663
+ /** Line beside the change, e.g. "in the last 30 days · $1.00 → $2.00". */
664
+ changeDescription: (span: string, from: string, to: string) => string;
665
+ /** Notice over the chart while a new account has no money yet. */
666
+ accountReady: string;
667
+ /** Notice over the chart once an unfunded account is past 30 days. */
668
+ addMoney: string;
669
+ /** Notice link, shown when the host passes `onTransferFromExternalClick`. */
670
+ transferFromExternal: string;
671
+ /** Read in place of a fall's parentheses, e.g. "negative $25.00". */
672
+ negativeAmount: (amount: string) => string;
673
+ }
674
+ declare const BALANCE_HISTORY_WIDGET_LABELS_EN: BalanceHistoryWidgetLabels;
675
+
676
+ interface BalanceHistoryWidgetWithContextProps {
677
+ /** Merged with BALANCE_HISTORY_WIDGET_LABELS_EN — only override what you need. */
678
+ labels?: PartialDeep<BalanceHistoryWidgetLabels>;
679
+ /** The range shown first. Defaults to 30 days. */
680
+ defaultRange?: BalanceHistoryRange;
681
+ /**
682
+ * Shows "Transfer from an external account" on the notice over an
683
+ * unfunded account's chart. The host routes it, usually to its transfers
684
+ * page; without it the notice has no link.
685
+ */
686
+ onTransferFromExternalClick?: () => void;
687
+ className?: string;
688
+ style?: CSSProperties;
689
+ }
690
+ interface BalanceHistoryWidgetProps extends WidgetProviderProps, BalanceHistoryWidgetWithContextProps {
691
+ }
692
+ /**
693
+ * Dashboard card: the org's balance over 30 days, 90 days or a year, for
694
+ * every account summed or one picked from a list, as a line chart with the
695
+ * change over the range. Ranges longer than the account's history stay
696
+ * disabled, and an account that has never held money gets a notice over its
697
+ * chart. Renders nothing when the token lacks `bank_account:read:org`.
698
+ */
699
+ declare function BalanceHistoryWidget({ labels, defaultRange, onTransferFromExternalClick, className, style, ...widgetProviderProps }: BalanceHistoryWidgetProps): React.JSX.Element;
700
+
610
701
  interface AccountsQuickViewTileLabels {
611
702
  /** Tile heading above the total. */
612
703
  title: string;
@@ -1001,5 +1092,5 @@ interface RemoteCheckCaptureWidgetProps extends WidgetProviderProps {
1001
1092
  }
1002
1093
  declare function RemoteCheckCaptureWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, providerLabels, labels, onDepositComplete, }: RemoteCheckCaptureWidgetProps): React.JSX.Element;
1003
1094
 
1004
- export { QUICK_VIEW_CLICK_HANDLERS, QUICK_VIEW_WIDGET_LABELS_EN, QuickViewType, QuickViewWidget, RemoteCheckCaptureWidget };
1005
- export type { AccountsQuickViewWidgetLabels, BillsQuickViewWidgetLabels, CardsQuickViewWidgetLabels, InvoicesQuickViewWidgetLabels, QuickViewWidgetClickHandlers, QuickViewWidgetLabelOverrides, QuickViewWidgetLabels, QuickViewWidgetProps, RemoteCheckCaptureWidgetProps };
1095
+ export { BALANCE_HISTORY_RANGES, BALANCE_HISTORY_WIDGET_LABELS_EN, BalanceHistoryRange, BalanceHistoryWidget, QUICK_VIEW_CLICK_HANDLERS, QUICK_VIEW_WIDGET_LABELS_EN, QuickViewType, QuickViewWidget, RemoteCheckCaptureWidget };
1096
+ export type { AccountsQuickViewWidgetLabels, BalanceHistoryWidgetLabels, BalanceHistoryWidgetProps, BillsQuickViewWidgetLabels, CardsQuickViewWidgetLabels, InvoicesQuickViewWidgetLabels, QuickViewWidgetClickHandlers, QuickViewWidgetLabelOverrides, QuickViewWidgetLabels, QuickViewWidgetProps, RemoteCheckCaptureWidgetProps };
@@ -1,4 +1,7 @@
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 };
1
+ import { BALANCE_HISTORY_RANGES as e, BalanceHistoryRange as t } from "../libs/tesouro-embedded-components-react/balance-history-widget/feature/dist/lib/balanceHistoryView/balanceHistoryRange.js";
2
+ import { BALANCE_HISTORY_WIDGET_LABELS_EN as n } from "../libs/tesouro-embedded-components-react/balance-history-widget/feature/dist/lib/BalanceHistoryWidget/labels.js";
3
+ import { BalanceHistoryWidget as r } from "../libs/tesouro-embedded-components-react/balance-history-widget/feature/dist/lib/BalanceHistoryWidget/BalanceHistoryWidgetFeature.js";
4
+ import { QUICK_VIEW_CLICK_HANDLERS as i, QuickViewType as a, QuickViewWidget as o } from "../libs/tesouro-embedded-components-react/quick-view-widget/feature/dist/lib/QuickViewWidget/QuickViewWidget.js";
5
+ import { QUICK_VIEW_WIDGET_LABELS_EN as s } from "../libs/tesouro-embedded-components-react/quick-view-widget/feature/dist/lib/QuickViewWidget/labels.js";
6
+ import { RemoteCheckCaptureWidget as c } from "../libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/RemoteCheckCaptureWidget.js";
7
+ export { e as BALANCE_HISTORY_RANGES, n as BALANCE_HISTORY_WIDGET_LABELS_EN, t as BalanceHistoryRange, r as BalanceHistoryWidget, i as QUICK_VIEW_CLICK_HANDLERS, s as QUICK_VIEW_WIDGET_LABELS_EN, a as QuickViewType, o as QuickViewWidget, c as RemoteCheckCaptureWidget };
package/dist/index.css CHANGED
@@ -704,6 +704,9 @@
704
704
  .ttw\:h-52 {
705
705
  height: calc(var(--ttw-spacing) * 52);
706
706
  }
707
+ .ttw\:h-56 {
708
+ height: calc(var(--ttw-spacing) * 56);
709
+ }
707
710
  .ttw\:h-60 {
708
711
  height: calc(var(--ttw-spacing) * 60);
709
712
  }
@@ -1085,6 +1088,9 @@
1085
1088
  .ttw\:w-\[616px\] {
1086
1089
  width: 616px;
1087
1090
  }
1091
+ .ttw\:w-\[640px\] {
1092
+ width: 640px;
1093
+ }
1088
1094
  .ttw\:w-\[672px\] {
1089
1095
  width: 672px;
1090
1096
  }
@@ -3903,6 +3909,9 @@
3903
3909
  .ttw\:pl-9\! {
3904
3910
  padding-left: calc(var(--ttw-spacing) * 9) !important;
3905
3911
  }
3912
+ .ttw\:pl-14 {
3913
+ padding-left: calc(var(--ttw-spacing) * 14);
3914
+ }
3906
3915
  .ttw\:pl-20 {
3907
3916
  padding-left: calc(var(--ttw-spacing) * 20);
3908
3917
  }
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ComponentType, AnchorHTMLAttributes, ReactNode, PropsWithChildren, ErrorInfo, ReactElement } from 'react';
2
+ import { ComponentType, AnchorHTMLAttributes, ReactNode, PropsWithChildren, ErrorInfo, CSSProperties, ReactElement } from 'react';
3
3
  import { RowData } from '@tanstack/react-table';
4
4
  import { FallbackProps } from 'react-error-boundary';
5
5
  import { PartialDeep } from 'type-fest';
@@ -2417,6 +2417,86 @@ interface WrittenSections {
2417
2417
  }
2418
2418
  declare function BankAccountOnboardingWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, providerLabels, ...innerProps }: BankAccountOnboardingWidgetProps): React.JSX.Element;
2419
2419
 
2420
+ /** The range buttons, in display order. */
2421
+ declare const BalanceHistoryRange: {
2422
+ readonly Days30: "30d";
2423
+ readonly Days90: "90d";
2424
+ readonly Year: "1y";
2425
+ };
2426
+ type BalanceHistoryRange = (typeof BalanceHistoryRange)[keyof typeof BalanceHistoryRange];
2427
+
2428
+ interface BalanceHistoryCardLabels {
2429
+ title: string;
2430
+ /** Accessible name of the account picker. */
2431
+ accountSelect: string;
2432
+ /** Placeholder of the account search, used once there are more than ten accounts. */
2433
+ accountSearchPlaceholder: string;
2434
+ /** Shown when the account search matches nothing. */
2435
+ accountSearchEmpty: string;
2436
+ /** Accessible name of the account search's clear button. */
2437
+ accountSearchClear: string;
2438
+ /** Accessible name of the range buttons. */
2439
+ rangeTabs: string;
2440
+ /** Accessible name of the chart. */
2441
+ chart: string;
2442
+ /** Name of the plotted series, shown in the tooltip and as the data table's value column. */
2443
+ seriesName: string;
2444
+ /** Between the series name and the value in the tooltip, e.g. "Balance: $34,054.35". */
2445
+ tooltipSeparator: string;
2446
+ /** Caption of the chart's data table, read to screen readers only. */
2447
+ dataTable: string;
2448
+ /** Heading of the data table's date column. */
2449
+ dateColumn: string;
2450
+ loading: string;
2451
+ errorTitle: string;
2452
+ errorDescription: string;
2453
+ retry: string;
2454
+ }
2455
+
2456
+ interface BalanceHistoryWidgetLabels extends BalanceHistoryCardLabels {
2457
+ /** The picker's first option, the sum of every account. */
2458
+ allAccounts: string;
2459
+ /** A picker option, e.g. "Business Checking - 0578". */
2460
+ accountOption: (name: string, last4: string) => string;
2461
+ /** Range button text, e.g. "30D". */
2462
+ ranges: Record<BalanceHistoryRange, string>;
2463
+ /** The span a full range covers, e.g. "in the last 30 days". */
2464
+ rangeSpans: Record<BalanceHistoryRange, string>;
2465
+ /** Read to screen readers on a range the account is too young for. */
2466
+ rangeTooYoung: Record<BalanceHistoryRange, string>;
2467
+ /** Read to screen readers on a range an unfunded account cannot show. */
2468
+ rangeNeedsMoney: string;
2469
+ /** The span when the window starts on the opening day, e.g. "since account opened Oct 30". */
2470
+ sinceOpened: (date: string) => string;
2471
+ /** Line beside the change, e.g. "in the last 30 days · $1.00 → $2.00". */
2472
+ changeDescription: (span: string, from: string, to: string) => string;
2473
+ /** Notice over the chart while a new account has no money yet. */
2474
+ accountReady: string;
2475
+ /** Notice over the chart once an unfunded account is past 30 days. */
2476
+ addMoney: string;
2477
+ /** Notice link, shown when the host passes `onTransferFromExternalClick`. */
2478
+ transferFromExternal: string;
2479
+ /** Read in place of a fall's parentheses, e.g. "negative $25.00". */
2480
+ negativeAmount: (amount: string) => string;
2481
+ }
2482
+
2483
+ interface BalanceHistoryWidgetWithContextProps {
2484
+ /** Merged with BALANCE_HISTORY_WIDGET_LABELS_EN — only override what you need. */
2485
+ labels?: PartialDeep<BalanceHistoryWidgetLabels>;
2486
+ /** The range shown first. Defaults to 30 days. */
2487
+ defaultRange?: BalanceHistoryRange;
2488
+ /**
2489
+ * Shows "Transfer from an external account" on the notice over an
2490
+ * unfunded account's chart. The host routes it, usually to its transfers
2491
+ * page; without it the notice has no link.
2492
+ */
2493
+ onTransferFromExternalClick?: () => void;
2494
+ className?: string;
2495
+ style?: CSSProperties;
2496
+ }
2497
+ interface BalanceHistoryWidgetProps extends WidgetProviderProps, BalanceHistoryWidgetWithContextProps {
2498
+ }
2499
+
2420
2500
  interface BalancesWidgetLabels {
2421
2501
  /** Card header title, beside the bank icon */
2422
2502
  widgetTitle: string;
@@ -4502,6 +4582,7 @@ interface WidgetSuiteOnboardingGateLabels {
4502
4582
  * is excluded because the suite addresses the provider once, at the top level.
4503
4583
  */
4504
4584
  type WidgetLabelProps<T> = Omit<Pick<T, Extract<keyof T, 'labels' | `${string}Labels`>>, 'providerLabels'>;
4585
+ type WidgetSuiteBalanceHistoryLabels = WidgetLabelProps<BalanceHistoryWidgetProps>;
4505
4586
  type WidgetSuiteBalancesLabels = WidgetLabelProps<BalancesWidgetProps>;
4506
4587
  type WidgetSuiteInsightsLabels = WidgetLabelProps<InsightsWidgetProps>;
4507
4588
  type WidgetSuiteAccountsLabels = WidgetLabelProps<BankAccountsWidgetProps>;
@@ -4512,8 +4593,9 @@ type WidgetSuiteTransfersLabels = WidgetLabelProps<TransfersWidgetProps>;
4512
4593
  type WidgetSuiteLinkedAccountsLabels = WidgetLabelProps<LinkedAccountsWidgetProps>;
4513
4594
  type WidgetSuiteSettingsLabels = WidgetLabelProps<SettingsWidgetProps>;
4514
4595
  type WidgetSuiteExpensesLabels = WidgetLabelProps<ExpenseManagementWidgetProps>;
4515
- /** The two widgets the Dashboard section pairs, each taking its own copy. */
4596
+ /** The widgets the Dashboard section holds, each taking its own copy. */
4516
4597
  interface WidgetSuiteDashboardLabels {
4598
+ balanceHistory?: WidgetSuiteBalanceHistoryLabels;
4517
4599
  balances?: WidgetSuiteBalancesLabels;
4518
4600
  insights?: WidgetSuiteInsightsLabels;
4519
4601
  }
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ComponentType, AnchorHTMLAttributes, ReactNode, ErrorInfo } from 'react';
2
+ import { ComponentType, AnchorHTMLAttributes, ReactNode, ErrorInfo, CSSProperties } from 'react';
3
3
  import { RowData } from '@tanstack/react-table';
4
4
  import { FallbackProps } from 'react-error-boundary';
5
5
  import { PartialDeep } from 'type-fest';
@@ -1417,6 +1417,86 @@ interface WrittenSections {
1417
1417
  owners: boolean;
1418
1418
  }
1419
1419
 
1420
+ /** The range buttons, in display order. */
1421
+ declare const BalanceHistoryRange: {
1422
+ readonly Days30: "30d";
1423
+ readonly Days90: "90d";
1424
+ readonly Year: "1y";
1425
+ };
1426
+ type BalanceHistoryRange = (typeof BalanceHistoryRange)[keyof typeof BalanceHistoryRange];
1427
+
1428
+ interface BalanceHistoryCardLabels {
1429
+ title: string;
1430
+ /** Accessible name of the account picker. */
1431
+ accountSelect: string;
1432
+ /** Placeholder of the account search, used once there are more than ten accounts. */
1433
+ accountSearchPlaceholder: string;
1434
+ /** Shown when the account search matches nothing. */
1435
+ accountSearchEmpty: string;
1436
+ /** Accessible name of the account search's clear button. */
1437
+ accountSearchClear: string;
1438
+ /** Accessible name of the range buttons. */
1439
+ rangeTabs: string;
1440
+ /** Accessible name of the chart. */
1441
+ chart: string;
1442
+ /** Name of the plotted series, shown in the tooltip and as the data table's value column. */
1443
+ seriesName: string;
1444
+ /** Between the series name and the value in the tooltip, e.g. "Balance: $34,054.35". */
1445
+ tooltipSeparator: string;
1446
+ /** Caption of the chart's data table, read to screen readers only. */
1447
+ dataTable: string;
1448
+ /** Heading of the data table's date column. */
1449
+ dateColumn: string;
1450
+ loading: string;
1451
+ errorTitle: string;
1452
+ errorDescription: string;
1453
+ retry: string;
1454
+ }
1455
+
1456
+ interface BalanceHistoryWidgetLabels extends BalanceHistoryCardLabels {
1457
+ /** The picker's first option, the sum of every account. */
1458
+ allAccounts: string;
1459
+ /** A picker option, e.g. "Business Checking - 0578". */
1460
+ accountOption: (name: string, last4: string) => string;
1461
+ /** Range button text, e.g. "30D". */
1462
+ ranges: Record<BalanceHistoryRange, string>;
1463
+ /** The span a full range covers, e.g. "in the last 30 days". */
1464
+ rangeSpans: Record<BalanceHistoryRange, string>;
1465
+ /** Read to screen readers on a range the account is too young for. */
1466
+ rangeTooYoung: Record<BalanceHistoryRange, string>;
1467
+ /** Read to screen readers on a range an unfunded account cannot show. */
1468
+ rangeNeedsMoney: string;
1469
+ /** The span when the window starts on the opening day, e.g. "since account opened Oct 30". */
1470
+ sinceOpened: (date: string) => string;
1471
+ /** Line beside the change, e.g. "in the last 30 days · $1.00 → $2.00". */
1472
+ changeDescription: (span: string, from: string, to: string) => string;
1473
+ /** Notice over the chart while a new account has no money yet. */
1474
+ accountReady: string;
1475
+ /** Notice over the chart once an unfunded account is past 30 days. */
1476
+ addMoney: string;
1477
+ /** Notice link, shown when the host passes `onTransferFromExternalClick`. */
1478
+ transferFromExternal: string;
1479
+ /** Read in place of a fall's parentheses, e.g. "negative $25.00". */
1480
+ negativeAmount: (amount: string) => string;
1481
+ }
1482
+
1483
+ interface BalanceHistoryWidgetWithContextProps {
1484
+ /** Merged with BALANCE_HISTORY_WIDGET_LABELS_EN — only override what you need. */
1485
+ labels?: PartialDeep<BalanceHistoryWidgetLabels>;
1486
+ /** The range shown first. Defaults to 30 days. */
1487
+ defaultRange?: BalanceHistoryRange;
1488
+ /**
1489
+ * Shows "Transfer from an external account" on the notice over an
1490
+ * unfunded account's chart. The host routes it, usually to its transfers
1491
+ * page; without it the notice has no link.
1492
+ */
1493
+ onTransferFromExternalClick?: () => void;
1494
+ className?: string;
1495
+ style?: CSSProperties;
1496
+ }
1497
+ interface BalanceHistoryWidgetProps extends WidgetProviderProps, BalanceHistoryWidgetWithContextProps {
1498
+ }
1499
+
1420
1500
  interface BalancesWidgetLabels {
1421
1501
  /** Card header title, beside the bank icon */
1422
1502
  widgetTitle: string;
@@ -3350,6 +3430,7 @@ interface WidgetSuiteOnboardingGateLabels {
3350
3430
  * is excluded because the suite addresses the provider once, at the top level.
3351
3431
  */
3352
3432
  type WidgetLabelProps<T> = Omit<Pick<T, Extract<keyof T, 'labels' | `${string}Labels`>>, 'providerLabels'>;
3433
+ type WidgetSuiteBalanceHistoryLabels = WidgetLabelProps<BalanceHistoryWidgetProps>;
3353
3434
  type WidgetSuiteBalancesLabels = WidgetLabelProps<BalancesWidgetProps>;
3354
3435
  type WidgetSuiteInsightsLabels = WidgetLabelProps<InsightsWidgetProps>;
3355
3436
  type WidgetSuiteAccountsLabels = WidgetLabelProps<BankAccountsWidgetProps>;
@@ -3360,8 +3441,9 @@ type WidgetSuiteTransfersLabels = WidgetLabelProps<TransfersWidgetProps>;
3360
3441
  type WidgetSuiteLinkedAccountsLabels = WidgetLabelProps<LinkedAccountsWidgetProps>;
3361
3442
  type WidgetSuiteSettingsLabels = WidgetLabelProps<SettingsWidgetProps>;
3362
3443
  type WidgetSuiteExpensesLabels = WidgetLabelProps<ExpenseManagementWidgetProps>;
3363
- /** The two widgets the Dashboard section pairs, each taking its own copy. */
3444
+ /** The widgets the Dashboard section holds, each taking its own copy. */
3364
3445
  interface WidgetSuiteDashboardLabels {
3446
+ balanceHistory?: WidgetSuiteBalanceHistoryLabels;
3365
3447
  balances?: WidgetSuiteBalancesLabels;
3366
3448
  insights?: WidgetSuiteInsightsLabels;
3367
3449
  }
@@ -0,0 +1,3 @@
1
+ import { useBalanceHistoryQuery as e } from "./index2.js";
2
+ import { useBalanceHistoryAccountsQuery as t } from "./index3.js";
3
+ export { t as useBalanceHistoryAccountsQuery, e as useBalanceHistoryQuery };
@@ -0,0 +1,89 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { getAggregateHistoricalBalances as e, getBankAccountHistoricalBalances as t } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
6
+ import { getAggregateHistoricalBalancesQueryKey as n, getBankAccountHistoricalBalancesQueryKey as r } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
7
+ import { withAuthEpochInfinite as i } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
8
+ import { useEmbedApi as a } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
9
+ import { organizationHeaders as o } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
10
+ import { getAllPagesNextPageParam as s, isAllPagesResolving as c, useAutoFetchNextPage as l } from "../../../shared/data-access/dist/lib/allPages.js";
11
+ import "../../../shared/data-access/dist/index.js";
12
+ import { useMemo as u } from "react";
13
+ import { useInfiniteQuery as d } from "@tanstack/react-query";
14
+ // ../../libs/tesouro-embedded-components-react/balance-history-widget/data-access/dist/index2.js
15
+ var f = 100;
16
+ function p({ accountId: p, startDate: m, endDate: h, enabled: g }) {
17
+ let { client: _, organizationId: v, widgetToken: y, authEpoch: b, organizationStatus: x } = a(), S = o(v), C = !!(v && y) && (g === !0 || g === void 0), w = {
18
+ startDate: m,
19
+ endDate: h,
20
+ limit: f
21
+ }, T = d({
22
+ ...i(n({
23
+ client: _,
24
+ headers: S,
25
+ query: w
26
+ }), {
27
+ authEpoch: b,
28
+ organizationStatus: x
29
+ }, { suffix: ["all"] }),
30
+ enabled: C && !p,
31
+ initialPageParam: void 0,
32
+ queryFn: async ({ signal: t, pageParam: n }) => {
33
+ let { data: r } = await e({
34
+ client: _,
35
+ headers: S,
36
+ query: {
37
+ ...w,
38
+ ...n ? { pagination_token: n } : {}
39
+ },
40
+ signal: t,
41
+ throwOnError: !0
42
+ });
43
+ return r;
44
+ },
45
+ getNextPageParam: s
46
+ }), E = d({
47
+ ...i(r({
48
+ client: _,
49
+ headers: S,
50
+ path: { id: p ?? "" },
51
+ query: w
52
+ }), {
53
+ authEpoch: b,
54
+ organizationStatus: x
55
+ }, { suffix: ["all"] }),
56
+ enabled: C && !!p,
57
+ initialPageParam: void 0,
58
+ queryFn: async ({ signal: e, pageParam: n }) => {
59
+ let { data: r } = await t({
60
+ client: _,
61
+ headers: S,
62
+ path: { id: p ?? "" },
63
+ query: {
64
+ ...w,
65
+ ...n ? { pagination_token: n } : {}
66
+ },
67
+ signal: e,
68
+ throwOnError: !0
69
+ });
70
+ return r;
71
+ },
72
+ getNextPageParam: s
73
+ });
74
+ l(T, C && !p), l(E, C && !!p);
75
+ let D = p ? E : T;
76
+ return {
77
+ rows: u(() => {
78
+ if (D.data) return D.data.pages.flatMap((e) => e.data.map(({ asOfDate: e, balance: t }) => ({
79
+ asOfDate: e,
80
+ balance: t
81
+ }))).sort((e, t) => e.asOfDate.localeCompare(t.asOfDate));
82
+ }, [D.data]),
83
+ isLoading: D.isLoading,
84
+ isError: D.isError,
85
+ isResolving: c(D),
86
+ refetch: D.refetch
87
+ };
88
+ }
89
+ export { p as useBalanceHistoryQuery };
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { isAllPagesResolving as e } from "../../../shared/data-access/dist/lib/allPages.js";
6
+ import { useAllBankAccountsQuery as t } from "../../../shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js";
7
+ import "../../../shared/data-access/dist/index.js";
8
+ // ../../libs/tesouro-embedded-components-react/balance-history-widget/data-access/dist/index3.js
9
+ function n({ enabled: n } = {}) {
10
+ let r = t({ enabled: n }), { data: i, isLoading: a, isError: o, refetch: s } = r;
11
+ return {
12
+ accounts: i?.data,
13
+ isLoading: a,
14
+ isError: o,
15
+ isResolving: e(r),
16
+ refetch: s
17
+ };
18
+ }
19
+ export { n as useBalanceHistoryAccountsQuery };
@@ -0,0 +1,4 @@
1
+ import { BALANCE_HISTORY_RANGES as e, BalanceHistoryRange as t } from "./lib/balanceHistoryView/balanceHistoryRange.js";
2
+ import { BALANCE_HISTORY_WIDGET_LABELS_EN as n } from "./lib/BalanceHistoryWidget/labels.js";
3
+ import { BalanceHistoryWidget as r } from "./lib/BalanceHistoryWidget/BalanceHistoryWidgetFeature.js";
4
+ export { e as BALANCE_HISTORY_RANGES, n as BALANCE_HISTORY_WIDGET_LABELS_EN, t as BalanceHistoryRange, r as BalanceHistoryWidget };