@layerfi/components 0.1.55 → 0.1.57

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.
package/dist/index.d.ts CHANGED
@@ -308,13 +308,20 @@ declare module '@layerfi/components/api/layer/linked_accounts' {
308
308
  declare module '@layerfi/components/api/layer/profit_and_loss' {
309
309
  import { ProfitAndLoss } from '@layerfi/components/types';
310
310
  import { S3PresignedUrl } from '@layerfi/components/types/general';
311
- import { ProfitAndLossSummaries } from '@layerfi/components/types/profit_and_loss';
311
+ import { ProfitAndLossComparison, ProfitAndLossSummaries } from '@layerfi/components/types/profit_and_loss';
312
312
  export const getProfitAndLoss: (baseUrl: string, accessToken: string | undefined, options?: {
313
313
  params?: Record<string, string | undefined> | undefined;
314
314
  } | undefined) => () => Promise<{
315
315
  data?: ProfitAndLoss | undefined;
316
316
  error?: unknown;
317
317
  }>;
318
+ export const compareProfitAndLoss: (baseUrl: string, accessToken: string | undefined, options?: {
319
+ params?: Record<string, string | undefined> | undefined;
320
+ body?: Record<string, unknown> | undefined;
321
+ } | undefined) => Promise<{
322
+ data?: ProfitAndLossComparison | undefined;
323
+ error?: unknown;
324
+ }>;
318
325
  export const getProfitAndLossSummaries: (baseUrl: string, accessToken: string | undefined, options?: {
319
326
  params?: Record<string, string | undefined> | undefined;
320
327
  } | undefined) => () => Promise<{
@@ -554,6 +561,13 @@ declare module '@layerfi/components/api/layer' {
554
561
  } | undefined) => () => Promise<{
555
562
  data: import("@layerfi/components/types").JournalEntry[];
556
563
  }>;
564
+ compareProfitAndLoss: (baseUrl: string, accessToken: string | undefined, options?: {
565
+ params?: Record<string, string | undefined> | undefined;
566
+ body?: Record<string, unknown> | undefined;
567
+ } | undefined) => Promise<{
568
+ data?: import("@layerfi/components/types/profit_and_loss").ProfitAndLossComparison | undefined;
569
+ error?: unknown;
570
+ }>;
557
571
  createJournalEntries: (baseUrl: string, accessToken: string | undefined, options?: {
558
572
  params?: Record<string, string | undefined> | undefined;
559
573
  body?: Record<string, unknown> | undefined;
@@ -744,6 +758,7 @@ declare module '@layerfi/components/components/Badge/Badge' {
744
758
  }
745
759
  export enum BadgeVariant {
746
760
  DEFAULT = "default",
761
+ INFO = "info",
747
762
  SUCCESS = "success",
748
763
  WARNING = "warning",
749
764
  ERROR = "error"
@@ -1342,6 +1357,20 @@ declare module '@layerfi/components/components/Button/SubmitButton' {
1342
1357
  }
1343
1358
  export const SubmitButton: ({ active, className, processing, disabled, error, children, action, noIcon, ...props }: SubmitButtonProps) => React.JSX.Element;
1344
1359
 
1360
+ }
1361
+ declare module '@layerfi/components/components/Button/SwitchButton' {
1362
+ import React from 'react';
1363
+ interface SwitchButtonProps {
1364
+ children: string;
1365
+ labelPosition?: 'left' | 'right';
1366
+ checked?: boolean;
1367
+ defaultChecked?: boolean;
1368
+ onChange?: (checked: boolean) => void;
1369
+ disabled?: boolean;
1370
+ }
1371
+ export const SwitchButton: React.FC<SwitchButtonProps>;
1372
+ export {};
1373
+
1345
1374
  }
1346
1375
  declare module '@layerfi/components/components/Button/TextButton' {
1347
1376
  import React, { ButtonHTMLAttributes } from 'react';
@@ -1358,6 +1387,7 @@ declare module '@layerfi/components/components/Button/index' {
1358
1387
  export { BackButton } from '@layerfi/components/components/Button/BackButton';
1359
1388
  export { CloseButton } from '@layerfi/components/components/Button/CloseButton';
1360
1389
  export { ExpandButton } from '@layerfi/components/components/Button/ExpandButton';
1390
+ export { SwitchButton } from '@layerfi/components/components/Button/SwitchButton';
1361
1391
  export { Link } from '@layerfi/components/components/Button/Link';
1362
1392
 
1363
1393
  }
@@ -1411,6 +1441,7 @@ declare module '@layerfi/components/components/CategorySelect/CategorySelect' {
1411
1441
  payload: CategoryOptionPayload;
1412
1442
  }
1413
1443
  export const mapCategoryToOption: (category: Category) => CategoryOption;
1444
+ export const mapCategoryToExclusionOption: (category: Category) => CategoryOption;
1414
1445
  export const mapSuggestedMatchToOption: (record: SuggestedMatch) => CategoryOption;
1415
1446
  export const CategorySelect: ({ bankTransaction, name, value, onChange, disabled, className, excludeMatches, asDrawer, }: Props) => React.JSX.Element;
1416
1447
  export {};
@@ -1433,7 +1464,7 @@ declare module '@layerfi/components/components/CategorySelect/index' {
1433
1464
  }
1434
1465
  declare module '@layerfi/components/components/ChartOfAccounts/ChartOfAccounts' {
1435
1466
  import React from 'react';
1436
- import { ChartOfAccountsTableStringOverrides } from '@layerfi/components/components/ChartOfAccountsTable/ChartOfAccountsTable';
1467
+ import { ChartOfAccountsTableStringOverrides } from '@layerfi/components/components/ChartOfAccountsTable/ChartOfAccountsTableWithPanel';
1437
1468
  import { LedgerAccountStringOverrides } from '@layerfi/components/components/LedgerAccount/LedgerAccountIndex';
1438
1469
  export type View = 'mobile' | 'tablet' | 'desktop';
1439
1470
  export interface ChartOfAccountsStringOverrides {
@@ -1505,30 +1536,6 @@ declare module '@layerfi/components/components/ChartOfAccountsForm/useParentOpti
1505
1536
  import { BaseSelectOption } from '@layerfi/components/types/general';
1506
1537
  export const useParentOptions: (data?: ChartWithBalances) => BaseSelectOption[];
1507
1538
 
1508
- }
1509
- declare module '@layerfi/components/components/ChartOfAccountsRow/ChartOfAccountsRow' {
1510
- import React from 'react';
1511
- import { LedgerAccountBalance } from '@layerfi/components/types/chart_of_accounts';
1512
- import { View } from '@layerfi/components/components/ChartOfAccounts/ChartOfAccounts';
1513
- import { ExpandActionState } from '@layerfi/components/components/ChartOfAccountsTable/ChartOfAccountsTable';
1514
- type ChartOfAccountsRowProps = {
1515
- account: LedgerAccountBalance;
1516
- depth?: number;
1517
- index: number;
1518
- cumulativeIndex?: number;
1519
- expanded: boolean;
1520
- acountsLength: number;
1521
- defaultOpen?: boolean;
1522
- view?: View;
1523
- expandAll?: ExpandActionState;
1524
- };
1525
- export const ChartOfAccountsRow: ({ account, depth, index, cumulativeIndex, expanded, defaultOpen, acountsLength, view, expandAll, }: ChartOfAccountsRowProps) => React.JSX.Element;
1526
- export {};
1527
-
1528
- }
1529
- declare module '@layerfi/components/components/ChartOfAccountsRow/index' {
1530
- export { ChartOfAccountsRow } from '@layerfi/components/components/ChartOfAccountsRow/ChartOfAccountsRow';
1531
-
1532
1539
  }
1533
1540
  declare module '@layerfi/components/components/ChartOfAccountsSidebar/ChartOfAccountsSidebar' {
1534
1541
  import React, { RefObject } from 'react';
@@ -1544,6 +1551,31 @@ declare module '@layerfi/components/components/ChartOfAccountsSidebar/index' {
1544
1551
 
1545
1552
  }
1546
1553
  declare module '@layerfi/components/components/ChartOfAccountsTable/ChartOfAccountsTable' {
1554
+ import React from 'react';
1555
+ import { ChartWithBalances } from '@layerfi/components/types/chart_of_accounts';
1556
+ import { View } from '@layerfi/components/components/ChartOfAccounts/ChartOfAccounts';
1557
+ import { ChartOfAccountsTableStringOverrides, ExpandActionState } from '@layerfi/components/components/ChartOfAccountsTable/ChartOfAccountsTableWithPanel';
1558
+ export const ChartOfAccountsTable: ({ view, stringOverrides, data, error, expandAll, cumulativeIndex, accountsLength, }: {
1559
+ view: View;
1560
+ data: ChartWithBalances;
1561
+ stringOverrides?: ChartOfAccountsTableStringOverrides | undefined;
1562
+ error?: any;
1563
+ expandAll?: ExpandActionState;
1564
+ cumulativeIndex: number;
1565
+ accountsLength: number;
1566
+ }) => React.JSX.Element;
1567
+ export const ChartOfAccountsTableContent: ({ view, stringOverrides, data, error, expandAll, cumulativeIndex, accountsLength, }: {
1568
+ view: View;
1569
+ data: ChartWithBalances;
1570
+ stringOverrides?: ChartOfAccountsTableStringOverrides | undefined;
1571
+ error?: any;
1572
+ expandAll?: ExpandActionState;
1573
+ cumulativeIndex: number;
1574
+ accountsLength: number;
1575
+ }) => React.JSX.Element;
1576
+
1577
+ }
1578
+ declare module '@layerfi/components/components/ChartOfAccountsTable/ChartOfAccountsTableWithPanel' {
1547
1579
  import React, { RefObject } from 'react';
1548
1580
  import { View } from '@layerfi/components/components/ChartOfAccounts/ChartOfAccounts';
1549
1581
  import { ChartOfAccountsFormStringOverrides } from '@layerfi/components/components/ChartOfAccountsForm/ChartOfAccountsForm';
@@ -1557,7 +1589,7 @@ declare module '@layerfi/components/components/ChartOfAccountsTable/ChartOfAccou
1557
1589
  subtypeColumnHeader?: string;
1558
1590
  chartOfAccountsForm?: ChartOfAccountsFormStringOverrides;
1559
1591
  }
1560
- export const ChartOfAccountsTable: ({ view, containerRef, asWidget, withDateControl, withExpandAllButton, stringOverrides, }: {
1592
+ export const ChartOfAccountsTableWithPanel: ({ view, containerRef, asWidget, withDateControl, withExpandAllButton, stringOverrides, }: {
1561
1593
  view: View;
1562
1594
  containerRef: RefObject<HTMLDivElement>;
1563
1595
  asWidget?: boolean | undefined;
@@ -1568,7 +1600,7 @@ declare module '@layerfi/components/components/ChartOfAccountsTable/ChartOfAccou
1568
1600
 
1569
1601
  }
1570
1602
  declare module '@layerfi/components/components/ChartOfAccountsTable/index' {
1571
- export { ChartOfAccountsTable } from '@layerfi/components/components/ChartOfAccountsTable/ChartOfAccountsTable';
1603
+ export { ChartOfAccountsTableWithPanel as ChartOfAccountsTable } from '@layerfi/components/components/ChartOfAccountsTable/ChartOfAccountsTableWithPanel';
1572
1604
 
1573
1605
  }
1574
1606
  declare module '@layerfi/components/components/Container/Container' {
@@ -1869,6 +1901,25 @@ declare module '@layerfi/components/components/Input/InputWithBadge' {
1869
1901
  }
1870
1902
  export const InputWithBadge: ({ className, isInvalid, errorMessage, leftText, badge, variant, ...props }: InputWithBadgeProps) => React.JSX.Element;
1871
1903
 
1904
+ }
1905
+ declare module '@layerfi/components/components/Input/MultiSelect' {
1906
+ import React from 'react';
1907
+ import { GroupBase, MultiValue, OptionsOrGroups } from 'react-select';
1908
+ export interface SelectProps<T> {
1909
+ name?: string;
1910
+ options?: OptionsOrGroups<T, GroupBase<T>>;
1911
+ className?: string;
1912
+ classNamePrefix?: string;
1913
+ value?: T[];
1914
+ defaultValue?: T[];
1915
+ onChange: (selected: MultiValue<T>) => void;
1916
+ disabled?: boolean;
1917
+ placeholder?: string;
1918
+ isInvalid?: boolean;
1919
+ errorMessage?: string;
1920
+ }
1921
+ export const MultiSelect: <T>({ name, options, className, classNamePrefix, value, defaultValue, onChange, disabled, placeholder, isInvalid, errorMessage, }: SelectProps<T>) => React.JSX.Element;
1922
+
1872
1923
  }
1873
1924
  declare module '@layerfi/components/components/Input/Select' {
1874
1925
  import React from 'react';
@@ -1894,11 +1945,12 @@ declare module '@layerfi/components/components/Input/index' {
1894
1945
  export { FileInput } from '@layerfi/components/components/Input/FileInput';
1895
1946
  export { Select } from '@layerfi/components/components/Input/Select';
1896
1947
  export { InputWithBadge } from '@layerfi/components/components/Input/InputWithBadge';
1948
+ export { MultiSelect } from '@layerfi/components/components/Input/MultiSelect';
1897
1949
 
1898
1950
  }
1899
1951
  declare module '@layerfi/components/components/Journal/Journal' {
1900
1952
  import React from 'react';
1901
- import { JournalTableStringOverrides } from '@layerfi/components/components/JournalTable/JournalTable';
1953
+ import { JournalTableStringOverrides } from '@layerfi/components/components/JournalTable/JournalTableWithPanel';
1902
1954
  export type View = 'mobile' | 'tablet' | 'desktop';
1903
1955
  export interface JournalConfig {
1904
1956
  form: {
@@ -1964,29 +2016,6 @@ declare module '@layerfi/components/components/JournalForm/JournalFormEntryLines
1964
2016
  declare module '@layerfi/components/components/JournalForm/index' {
1965
2017
  export { JournalForm } from '@layerfi/components/components/JournalForm/JournalForm';
1966
2018
 
1967
- }
1968
- declare module '@layerfi/components/components/JournalRow/JournalRow' {
1969
- import React from 'react';
1970
- import { JournalEntry, JournalEntryLine, JournalEntryLineItem } from '@layerfi/components/types';
1971
- import { View } from '@layerfi/components/components/Journal/index';
1972
- export interface JournalRowProps {
1973
- row: JournalEntry | JournalEntryLine | JournalEntryLineItem;
1974
- index: number;
1975
- initialLoad?: boolean;
1976
- view: View;
1977
- lineItemsLength?: number;
1978
- defaultOpen?: boolean;
1979
- expanded?: boolean;
1980
- depth?: number;
1981
- cumulativeIndex?: number;
1982
- selectedEntries?: boolean;
1983
- }
1984
- export const JournalRow: ({ row, index, initialLoad, view, lineItemsLength, defaultOpen, expanded, depth, cumulativeIndex, selectedEntries, }: JournalRowProps) => React.JSX.Element;
1985
-
1986
- }
1987
- declare module '@layerfi/components/components/JournalRow/index' {
1988
- export { JournalRow } from '@layerfi/components/components/JournalRow/JournalRow';
1989
-
1990
2019
  }
1991
2020
  declare module '@layerfi/components/components/JournalSidebar/JournalSidebar' {
1992
2021
  import React, { RefObject } from 'react';
@@ -2004,6 +2033,18 @@ declare module '@layerfi/components/components/JournalSidebar/index' {
2004
2033
 
2005
2034
  }
2006
2035
  declare module '@layerfi/components/components/JournalTable/JournalTable' {
2036
+ import React from 'react';
2037
+ import { JournalEntry } from '@layerfi/components/types';
2038
+ import { View } from '@layerfi/components/components/Journal/index';
2039
+ import { JournalTableStringOverrides } from '@layerfi/components/components/JournalTable/JournalTableWithPanel';
2040
+ export const JournalTable: ({ view, data, stringOverrides, }: {
2041
+ view: View;
2042
+ data: JournalEntry[];
2043
+ stringOverrides?: JournalTableStringOverrides | undefined;
2044
+ }) => React.JSX.Element;
2045
+
2046
+ }
2047
+ declare module '@layerfi/components/components/JournalTable/JournalTableWithPanel' {
2007
2048
  import React, { RefObject } from 'react';
2008
2049
  import { View } from '@layerfi/components/components/Journal/index';
2009
2050
  import { JournalConfig } from '@layerfi/components/components/Journal/Journal';
@@ -2019,7 +2060,7 @@ declare module '@layerfi/components/components/JournalTable/JournalTable' {
2019
2060
  creditColumnHeader?: string;
2020
2061
  journalForm?: JournalFormStringOverrides;
2021
2062
  }
2022
- export const JournalTable: ({ view, containerRef, pageSize, config, stringOverrides, }: {
2063
+ export const JournalTableWithPanel: ({ containerRef, pageSize, config, stringOverrides, }: {
2023
2064
  view: View;
2024
2065
  containerRef: RefObject<HTMLDivElement>;
2025
2066
  pageSize?: number | undefined;
@@ -2029,7 +2070,7 @@ declare module '@layerfi/components/components/JournalTable/JournalTable' {
2029
2070
 
2030
2071
  }
2031
2072
  declare module '@layerfi/components/components/JournalTable/index' {
2032
- export { JournalTable } from '@layerfi/components/components/JournalTable/JournalTable';
2073
+ export { JournalTableWithPanel as JournalTable } from '@layerfi/components/components/JournalTable/JournalTableWithPanel';
2033
2074
 
2034
2075
  }
2035
2076
  declare module '@layerfi/components/components/LedgerAccount/LedgerAccountIndex' {
@@ -2378,7 +2419,21 @@ declare module '@layerfi/components/components/ProfitAndLoss/ProfitAndLoss' {
2378
2419
  sortBy: (scope: import("@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss").Scope, field: string, direction?: import("../../types").SortDirection | undefined) => void;
2379
2420
  setFilterTypes: (scope: import("@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss").Scope, types: string[]) => void;
2380
2421
  }>;
2422
+ ComparisonContext: React.Context<{
2423
+ data: import("@layerfi/components/types/profit_and_loss").ProfitAndLossComparisonItem[] | undefined;
2424
+ isLoading: boolean;
2425
+ isValidating: boolean;
2426
+ error: unknown;
2427
+ compareMode: boolean;
2428
+ setCompareMode: (mode: boolean) => void;
2429
+ compareMonths: number;
2430
+ setCompareMonths: (months: number) => void;
2431
+ compareOptions: import("@layerfi/components/components/ProfitAndLossCompareOptions/ProfitAndLossCompareOptions").TagComparisonOption[];
2432
+ setCompareOptions: (options: import("@layerfi/components/components/ProfitAndLossCompareOptions/ProfitAndLossCompareOptions").TagComparisonOption[]) => void;
2433
+ refetch: (dateRange: import("@layerfi/components/types").DateRange, actAsInitial?: boolean | undefined) => void;
2434
+ }>;
2381
2435
  DatePicker: () => React.JSX.Element;
2436
+ CompareOptions: ({ tagComparisonOptions, defaultTagFilter: defaultOption, }: import("@layerfi/components/components/ProfitAndLossCompareOptions/ProfitAndLossCompareOptions").ProfitAndLossCompareOptionsProps) => React.JSX.Element;
2382
2437
  Summaries: ({ vertical, actionable, revenueLabel, stringOverrides, }: {
2383
2438
  vertical?: boolean | undefined;
2384
2439
  actionable?: boolean | undefined;
@@ -2393,6 +2448,7 @@ declare module '@layerfi/components/components/ProfitAndLoss/ProfitAndLoss' {
2393
2448
  chartColorsList?: string[] | undefined;
2394
2449
  stringOverrides?: import("@layerfi/components/components/ProfitAndLossDetailedCharts/ProfitAndLossDetailedCharts").ProfitAndLossDetailedChartsStringOverrides | undefined;
2395
2450
  }) => React.JSX.Element;
2451
+ Header: ({ text, className, headingClassName, withDatePicker, }: import("@layerfi/components/components/ProfitAndLossHeader/ProfitAndLossHeader").ProfitAndLossHeaderProps) => React.JSX.Element;
2396
2452
  };
2397
2453
  export { ProfitAndLoss };
2398
2454
 
@@ -2400,6 +2456,11 @@ declare module '@layerfi/components/components/ProfitAndLoss/ProfitAndLoss' {
2400
2456
  declare module '@layerfi/components/components/ProfitAndLoss/index' {
2401
2457
  export { ProfitAndLoss } from '@layerfi/components/components/ProfitAndLoss/ProfitAndLoss';
2402
2458
 
2459
+ }
2460
+ declare module '@layerfi/components/components/ProfitAndLossChart/ChartStateCard' {
2461
+ import React from 'react';
2462
+ export const ChartStateCard: () => React.JSX.Element;
2463
+
2403
2464
  }
2404
2465
  declare module '@layerfi/components/components/ProfitAndLossChart/Indicator' {
2405
2466
  import React from 'react';
@@ -2428,6 +2489,31 @@ declare module '@layerfi/components/components/ProfitAndLossChart/ProfitAndLossC
2428
2489
  declare module '@layerfi/components/components/ProfitAndLossChart/index' {
2429
2490
  export { ProfitAndLossChart } from '@layerfi/components/components/ProfitAndLossChart/ProfitAndLossChart';
2430
2491
 
2492
+ }
2493
+ declare module '@layerfi/components/components/ProfitAndLossCompareOptions/ProfitAndLossCompareOptions' {
2494
+ import React from 'react';
2495
+ export interface ProfitAndLossCompareOptionsProps {
2496
+ tagComparisonOptions: TagComparisonOption[];
2497
+ defaultTagFilter: TagComparisonOption;
2498
+ }
2499
+ export interface TagComparisonOption {
2500
+ displayName: string;
2501
+ tagFilterConfig: TagViewConfig;
2502
+ }
2503
+ export type TagViewConfig = {
2504
+ structure?: string;
2505
+ tagFilters: TagFilterInput;
2506
+ };
2507
+ export type TagFilterInput = {
2508
+ tagKey: string;
2509
+ tagValues: string[];
2510
+ } | 'None';
2511
+ export const ProfitAndLossCompareOptions: ({ tagComparisonOptions, defaultTagFilter: defaultOption, }: ProfitAndLossCompareOptionsProps) => React.JSX.Element;
2512
+
2513
+ }
2514
+ declare module '@layerfi/components/components/ProfitAndLossCompareOptions/index' {
2515
+ export { ProfitAndLossCompareOptions } from '@layerfi/components/components/ProfitAndLossCompareOptions/ProfitAndLossCompareOptions';
2516
+
2431
2517
  }
2432
2518
  declare module '@layerfi/components/components/ProfitAndLossDatePicker/ProfitAndLossDatePicker' {
2433
2519
  import React from 'react';
@@ -2516,6 +2602,21 @@ declare module '@layerfi/components/components/ProfitAndLossDetailedCharts/Profi
2516
2602
  declare module '@layerfi/components/components/ProfitAndLossDetailedCharts/index' {
2517
2603
  export { ProfitAndLossDetailedCharts } from '@layerfi/components/components/ProfitAndLossDetailedCharts/ProfitAndLossDetailedCharts';
2518
2604
 
2605
+ }
2606
+ declare module '@layerfi/components/components/ProfitAndLossHeader/ProfitAndLossHeader' {
2607
+ import React from 'react';
2608
+ export interface ProfitAndLossHeaderProps {
2609
+ text?: string;
2610
+ className?: string;
2611
+ headingClassName?: string;
2612
+ withDatePicker?: boolean;
2613
+ }
2614
+ export const ProfitAndLossHeader: ({ text, className, headingClassName, withDatePicker, }: ProfitAndLossHeaderProps) => React.JSX.Element;
2615
+
2616
+ }
2617
+ declare module '@layerfi/components/components/ProfitAndLossHeader/index' {
2618
+ export { ProfitAndLossHeader } from '@layerfi/components/components/ProfitAndLossHeader/ProfitAndLossHeader';
2619
+
2519
2620
  }
2520
2621
  declare module '@layerfi/components/components/ProfitAndLossSummaries/MiniChart' {
2521
2622
  import React from 'react';
@@ -2546,6 +2647,16 @@ declare module '@layerfi/components/components/ProfitAndLossSummaries/ProfitAndL
2546
2647
  declare module '@layerfi/components/components/ProfitAndLossSummaries/index' {
2547
2648
  export { ProfitAndLossSummaries } from '@layerfi/components/components/ProfitAndLossSummaries/ProfitAndLossSummaries';
2548
2649
 
2650
+ }
2651
+ declare module '@layerfi/components/components/ProfitAndLossTable/ProfitAndLossCompareTable' {
2652
+ import React from 'react';
2653
+ import { ProfitAndLossTableStringOverrides } from '@layerfi/components/components/ProfitAndLossTable/ProfitAndLossTableComponent';
2654
+ interface ProfilAndLostCompareTableProps {
2655
+ stringOverrides?: ProfitAndLossTableStringOverrides;
2656
+ }
2657
+ export const ProfitAndLossCompareTable: ({ stringOverrides, }: ProfilAndLostCompareTableProps) => React.JSX.Element;
2658
+ export {};
2659
+
2549
2660
  }
2550
2661
  declare module '@layerfi/components/components/ProfitAndLossTable/ProfitAndLossTableComponent' {
2551
2662
  import React from 'react';
@@ -2701,6 +2812,15 @@ declare module '@layerfi/components/components/StatementOfCashFlowTable/Statemen
2701
2812
  declare module '@layerfi/components/components/StatementOfCashFlowTable/index' {
2702
2813
  export { StatementOfCashFlowTable } from '@layerfi/components/components/StatementOfCashFlowTable/StatementOfCashFlowTable';
2703
2814
 
2815
+ }
2816
+ declare module '@layerfi/components/components/SyncingBadge/SyncingBadge' {
2817
+ import React from 'react';
2818
+ export const SyncingBadge: () => React.JSX.Element;
2819
+
2820
+ }
2821
+ declare module '@layerfi/components/components/SyncingBadge/index' {
2822
+ export { SyncingBadge } from '@layerfi/components/components/SyncingBadge/SyncingBadge';
2823
+
2704
2824
  }
2705
2825
  declare module '@layerfi/components/components/SyncingComponent/SyncingComponent' {
2706
2826
  import React from 'react';
@@ -2767,7 +2887,7 @@ declare module '@layerfi/components/components/TableBody/index' {
2767
2887
  declare module '@layerfi/components/components/TableCell/TableCell' {
2768
2888
  import React from 'react';
2769
2889
  import { TableCellProps } from '@layerfi/components/types/table';
2770
- export const TableCell: ({ children, isHeaderCell, isCurrency, primary, withExpandIcon, fullWidth, }: TableCellProps) => React.JSX.Element;
2890
+ export const TableCell: ({ children, isHeaderCell, isCurrency, primary, withExpandIcon, fullWidth, colSpan, onClick, }: TableCellProps) => React.JSX.Element;
2771
2891
 
2772
2892
  }
2773
2893
  declare module '@layerfi/components/components/TableCell/index' {
@@ -3536,6 +3656,29 @@ declare module '@layerfi/components/contexts/LinkedAccountsContext/LinkedAccount
3536
3656
  declare module '@layerfi/components/contexts/LinkedAccountsContext/index' {
3537
3657
  export { LinkedAccountsContext } from '@layerfi/components/contexts/LinkedAccountsContext/LinkedAccountsContext';
3538
3658
 
3659
+ }
3660
+ declare module '@layerfi/components/contexts/ProfitAndLossComparisonContext/ProfitAndLossComparisonContext' {
3661
+ /// <reference types="react" />
3662
+ import { TagComparisonOption } from '@layerfi/components/components/ProfitAndLossCompareOptions/ProfitAndLossCompareOptions';
3663
+ import { DateRange } from '@layerfi/components/types';
3664
+ export const PNLComparisonContext: import("react").Context<{
3665
+ data: import("@layerfi/components/types/profit_and_loss").ProfitAndLossComparisonItem[] | undefined;
3666
+ isLoading: boolean;
3667
+ isValidating: boolean;
3668
+ error: unknown;
3669
+ compareMode: boolean;
3670
+ setCompareMode: (mode: boolean) => void;
3671
+ compareMonths: number;
3672
+ setCompareMonths: (months: number) => void;
3673
+ compareOptions: TagComparisonOption[];
3674
+ setCompareOptions: (options: TagComparisonOption[]) => void;
3675
+ refetch: (dateRange: DateRange, actAsInitial?: boolean | undefined) => void;
3676
+ }>;
3677
+
3678
+ }
3679
+ declare module '@layerfi/components/contexts/ProfitAndLossComparisonContext/index' {
3680
+ export { PNLComparisonContext } from '@layerfi/components/contexts/ProfitAndLossComparisonContext/ProfitAndLossComparisonContext';
3681
+
3539
3682
  }
3540
3683
  declare module '@layerfi/components/contexts/StatementOfCashContext/StatementOfCashFlowContext' {
3541
3684
  /// <reference types="react" />
@@ -3656,12 +3799,13 @@ declare module '@layerfi/components/hooks/useBankTransactions/useBankTransaction
3656
3799
 
3657
3800
  }
3658
3801
  declare module '@layerfi/components/hooks/useBankTransactions/utils' {
3659
- import { BankTransaction } from '@layerfi/components/types';
3802
+ import { BankTransaction, DisplayState } from '@layerfi/components/types';
3660
3803
  import { AccountItem, NumericRangeFilter } from '@layerfi/components/hooks/useBankTransactions/types';
3661
3804
  export const collectAccounts: (transactions?: BankTransaction[]) => AccountItem[];
3662
3805
  export const uniqAccountsList: (arr: AccountItem[], track?: Set<unknown>) => AccountItem[];
3663
3806
  export const applyAmountFilter: (data?: BankTransaction[], filter?: NumericRangeFilter) => BankTransaction[] | undefined;
3664
3807
  export const applyAccountFilter: (data?: BankTransaction[], filter?: string[]) => BankTransaction[] | undefined;
3808
+ export const applyCategorizationStatusFilter: (data?: BankTransaction[], filter?: DisplayState) => BankTransaction[] | undefined;
3665
3809
 
3666
3810
  }
3667
3811
  declare module '@layerfi/components/hooks/useChartOfAccounts/index' {
@@ -3989,6 +4133,36 @@ declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLossQuery
3989
4133
  export const useProfitAndLossQuery: UseProfitAndLossQueryReturn;
3990
4134
  export {};
3991
4135
 
4136
+ }
4137
+ declare module '@layerfi/components/hooks/useProfitAndLossComparison/index' {
4138
+ export { useProfitAndLossComparison } from '@layerfi/components/hooks/useProfitAndLossComparison/useProfitAndLossComparison';
4139
+
4140
+ }
4141
+ declare module '@layerfi/components/hooks/useProfitAndLossComparison/useProfitAndLossComparison' {
4142
+ import { TagComparisonOption } from '@layerfi/components/components/ProfitAndLossCompareOptions/ProfitAndLossCompareOptions';
4143
+ import { DateRange, ReportingBasis } from '@layerfi/components/types';
4144
+ import { ProfitAndLossComparisonItem } from '@layerfi/components/types/profit_and_loss';
4145
+ export type Scope = 'expenses' | 'revenue';
4146
+ export type SidebarScope = Scope | undefined;
4147
+ type Props = {
4148
+ reportingBasis?: ReportingBasis;
4149
+ };
4150
+ type UseProfitAndLossComparison = (props: Props) => {
4151
+ data: ProfitAndLossComparisonItem[] | undefined;
4152
+ isLoading: boolean;
4153
+ isValidating: boolean;
4154
+ error: unknown;
4155
+ compareMode: boolean;
4156
+ setCompareMode: (mode: boolean) => void;
4157
+ compareMonths: number;
4158
+ setCompareMonths: (months: number) => void;
4159
+ compareOptions: TagComparisonOption[];
4160
+ setCompareOptions: (options: TagComparisonOption[]) => void;
4161
+ refetch: (dateRange: DateRange, actAsInitial?: boolean) => void;
4162
+ };
4163
+ export const useProfitAndLossComparison: UseProfitAndLossComparison;
4164
+ export {};
4165
+
3992
4166
  }
3993
4167
  declare module '@layerfi/components/hooks/useQuickbooks/index' {
3994
4168
  export { useQuickbooks } from '@layerfi/components/hooks/useQuickbooks/useQuickbooks';
@@ -4092,6 +4266,13 @@ declare module '@layerfi/components/icons/BackArrow' {
4092
4266
  const BackArrow: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
4093
4267
  export default BackArrow;
4094
4268
 
4269
+ }
4270
+ declare module '@layerfi/components/icons/BarChart2' {
4271
+ import * as React from 'react';
4272
+ import { IconSvgProps } from '@layerfi/components/icons/types';
4273
+ const BarChart2: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
4274
+ export default BarChart2;
4275
+
4095
4276
  }
4096
4277
  declare module '@layerfi/components/icons/Bell' {
4097
4278
  import * as React from 'react';
@@ -4612,6 +4793,7 @@ declare module '@layerfi/components/types/categories' {
4612
4793
  MATCHED = "MATCHED"
4613
4794
  }
4614
4795
  export interface CategoryEntry {
4796
+ type?: string;
4615
4797
  amount?: number;
4616
4798
  category: Category;
4617
4799
  }
@@ -5131,6 +5313,39 @@ declare module '@layerfi/components/types/profit_and_loss' {
5131
5313
  personal_expenses?: LineItem | null;
5132
5314
  fully_categorized: boolean;
5133
5315
  }
5316
+ export interface ProfitAndLossComparison {
5317
+ type: string;
5318
+ pnls: ProfitAndLossComparisonItem[];
5319
+ }
5320
+ export interface ProfitAndLossComparisonPnl {
5321
+ business_id: string;
5322
+ start_date: string;
5323
+ end_date: string;
5324
+ income: LineItem;
5325
+ cost_of_goods_sold: LineItem;
5326
+ gross_profit: number;
5327
+ expenses: LineItem;
5328
+ profit_before_taxes: number;
5329
+ taxes: LineItem;
5330
+ net_profit: number;
5331
+ other_outflows?: LineItem | null;
5332
+ personal_expenses?: LineItem | null;
5333
+ fully_categorized: boolean;
5334
+ }
5335
+ export interface ProfitAndLossComparisonItem {
5336
+ period: {
5337
+ type: string;
5338
+ year?: number;
5339
+ month?: number;
5340
+ start_date?: string;
5341
+ end_date?: string;
5342
+ };
5343
+ tag_filter?: {
5344
+ key: string;
5345
+ values: string[];
5346
+ };
5347
+ pnl: ProfitAndLossComparisonPnl;
5348
+ }
5134
5349
  export interface ProfitAndLossSummary {
5135
5350
  year: number;
5136
5351
  month: number;
@@ -5207,7 +5422,9 @@ declare module '@layerfi/components/types/table' {
5207
5422
  withDividerPosition?: 'top' | 'bottom';
5208
5423
  isExpanded?: boolean;
5209
5424
  handleExpand?: () => void;
5425
+ onClick?: (e: React.MouseEvent<HTMLTableRowElement, MouseEvent>) => void;
5210
5426
  isHeadRow?: boolean;
5427
+ selected?: boolean;
5211
5428
  }
5212
5429
  export interface TableCellProps {
5213
5430
  children?: number | string | ReactNode;
@@ -5216,6 +5433,8 @@ declare module '@layerfi/components/types/table' {
5216
5433
  primary?: boolean;
5217
5434
  withExpandIcon?: boolean;
5218
5435
  fullWidth?: boolean;
5436
+ colSpan?: number;
5437
+ onClick?: (e: React.MouseEvent<HTMLTableCellElement, MouseEvent>) => void;
5219
5438
  }
5220
5439
 
5221
5440
  }
@@ -5355,6 +5574,13 @@ declare module '@layerfi/components/utils/journal' {
5355
5574
  import { JournalEntryLineItem } from '@layerfi/components/types/journal';
5356
5575
  export const getAccountIdentifierPayload: (journalLineItem: JournalEntryLineItem) => AccountIdentifierPayloadObject;
5357
5576
 
5577
+ }
5578
+ declare module '@layerfi/components/utils/profitAndLossComparisonUtils' {
5579
+ import { LineItem } from '@layerfi/components/types';
5580
+ export const generatComparisonMonths: (startDate: number | Date, numberOfMonths: number) => string[];
5581
+ export const getComparisonValue: (name: string, depth: number, cellData: string | number | LineItem) => string | number;
5582
+ export const mergeComparisonLineItemsAtDepth: (lineItems: LineItem[]) => LineItem[];
5583
+
5358
5584
  }
5359
5585
  declare module '@layerfi/components/utils/profitAndLossUtils' {
5360
5586
  import { SidebarScope } from '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss';
@@ -5471,6 +5697,7 @@ declare module '@layerfi/components/views/GeneralLedger/index' {
5471
5697
  declare module '@layerfi/components/views/Reports/Reports' {
5472
5698
  import React, { RefObject } from 'react';
5473
5699
  import { BalanceSheetStringOverrides } from '@layerfi/components/components/BalanceSheet/BalanceSheet';
5700
+ import { ProfitAndLossCompareOptionsProps } from '@layerfi/components/components/ProfitAndLossCompareOptions/ProfitAndLossCompareOptions';
5474
5701
  import { ProfitAndLossDetailedChartsStringOverrides } from '@layerfi/components/components/ProfitAndLossDetailedCharts/ProfitAndLossDetailedCharts';
5475
5702
  import { ProfitAndLossTableStringOverrides } from '@layerfi/components/components/ProfitAndLossTable/index';
5476
5703
  import { StatementOfCashFlowStringOverrides } from '@layerfi/components/components/StatementOfCashFlow/StatementOfCashFlow';
@@ -5488,18 +5715,20 @@ declare module '@layerfi/components/views/Reports/Reports' {
5488
5715
  title?: string;
5489
5716
  stringOverrides?: ReportsStringOverrides;
5490
5717
  enabledReports?: ReportType[];
5718
+ comparisonConfig?: ProfitAndLossCompareOptionsProps;
5491
5719
  }
5492
5720
  type ReportType = 'profitAndLoss' | 'balanceSheet' | 'statementOfCashFlow';
5493
5721
  export interface ReportsPanelProps {
5494
5722
  containerRef: RefObject<HTMLDivElement>;
5495
5723
  openReport: ReportType;
5496
5724
  stringOverrides?: ReportsStringOverrides;
5725
+ comparisonConfig?: ProfitAndLossCompareOptionsProps;
5497
5726
  }
5498
5727
  interface DownloadButtonStringOverrides {
5499
5728
  downloadButtonText?: string;
5500
5729
  retryButtonText?: string;
5501
5730
  }
5502
- export const Reports: ({ title, stringOverrides, enabledReports, }: ReportsProps) => React.JSX.Element;
5731
+ export const Reports: ({ title, stringOverrides, enabledReports, comparisonConfig, }: ReportsProps) => React.JSX.Element;
5503
5732
  export {};
5504
5733
 
5505
5734
  }