@layerfi/components 0.1.8 → 0.1.10

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
@@ -87,18 +87,33 @@ declare module '@layerfi/components/api/layer/categories' {
87
87
  }>;
88
88
 
89
89
  }
90
- declare module '@layerfi/components/api/layer/chart_of_accounts' {
91
- import { AccountAlternate, ChartOfAccounts, NewAccount } from '@layerfi/components/types';
92
- export const getChartOfAccounts: (baseUrl: string, accessToken: string | undefined, options?: {
90
+ declare module '@layerfi/components/api/layer/ledger_accounts' {
91
+ import { Account, LedgerAccounts, NewAccount, EditAccount } from '@layerfi/components/types';
92
+ export const getLedgerAccounts: (baseUrl: string, accessToken: string | undefined, options?: {
93
93
  params?: Record<string, string | undefined> | undefined;
94
94
  } | undefined) => () => Promise<{
95
- data: ChartOfAccounts;
95
+ data: LedgerAccounts;
96
96
  }>;
97
97
  export const createAccount: (baseUrl: string, accessToken: string | undefined, options?: {
98
98
  params?: Record<string, string | undefined> | undefined;
99
99
  body?: NewAccount | undefined;
100
100
  } | undefined) => Promise<{
101
- data: AccountAlternate;
101
+ data: Account;
102
+ }>;
103
+ export const updateAccount: (baseUrl: string, accessToken: string | undefined, options?: {
104
+ params?: Record<string, string | undefined> | undefined;
105
+ body?: EditAccount | undefined;
106
+ } | undefined) => Promise<{
107
+ data: Account;
108
+ }>;
109
+
110
+ }
111
+ declare module '@layerfi/components/api/layer/linked_accounts' {
112
+ import { LinkedAccounts } from '@layerfi/components/types/linked_accounts';
113
+ export const getLinkedAccounts: (baseUrl: string, accessToken: string | undefined, options?: {
114
+ params?: Record<string, string | undefined> | undefined;
115
+ } | undefined) => () => Promise<{
116
+ data: LinkedAccounts;
102
117
  }>;
103
118
 
104
119
  }
@@ -141,7 +156,13 @@ declare module '@layerfi/components/api/layer' {
141
156
  params?: Record<string, string | undefined> | undefined;
142
157
  body?: import("@layerfi/components/types").NewAccount | undefined;
143
158
  } | undefined) => Promise<{
144
- data: import("@layerfi/components/types").AccountAlternate;
159
+ data: import("@layerfi/components/types").Account;
160
+ }>;
161
+ updateAccount: (baseUrl: string, accessToken: string | undefined, options?: {
162
+ params?: Record<string, string | undefined> | undefined;
163
+ body?: import("@layerfi/components/types").EditAccount | undefined;
164
+ } | undefined) => Promise<{
165
+ data: import("@layerfi/components/types").Account;
145
166
  }>;
146
167
  getBalanceSheet: (_token: string, _params: {
147
168
  params: import("@layerfi/components/api/layer/balance_sheet").GetBalanceSheetParams;
@@ -157,10 +178,10 @@ declare module '@layerfi/components/api/layer' {
157
178
  categories: import("@layerfi/components/types").Category[];
158
179
  };
159
180
  }>;
160
- getChartOfAccounts: (baseUrl: string, accessToken: string | undefined, options?: {
181
+ getLedgerAccounts: (baseUrl: string, accessToken: string | undefined, options?: {
161
182
  params?: Record<string, string | undefined> | undefined;
162
183
  } | undefined) => () => Promise<{
163
- data: import("@layerfi/components/types").ChartOfAccounts;
184
+ data: import("@layerfi/components/types").LedgerAccounts;
164
185
  }>;
165
186
  getProfitAndLoss: (baseUrl: string, accessToken: string | undefined, options?: {
166
187
  params?: Record<string, string | undefined> | undefined;
@@ -168,12 +189,26 @@ declare module '@layerfi/components/api/layer' {
168
189
  data?: import("@layerfi/components/types").ProfitAndLoss | undefined;
169
190
  error?: unknown;
170
191
  }>;
192
+ getLinkedAccounts: (baseUrl: string, accessToken: string | undefined, options?: {
193
+ params?: Record<string, string | undefined> | undefined;
194
+ } | undefined) => () => Promise<{
195
+ data: import("@layerfi/components/types/linked_accounts").LinkedAccounts;
196
+ }>;
171
197
  };
172
198
 
173
199
  }
174
200
  declare module '@layerfi/components/api/util' {
175
201
  export const formStringFromObject: (object: Record<string, string | number | boolean>) => string;
176
202
 
203
+ }
204
+ declare module '@layerfi/components/components/AccountsReceivable/AccountsReceivableIndex' {
205
+ import React from 'react';
206
+ export const AccountsReceivable: () => React.JSX.Element;
207
+
208
+ }
209
+ declare module '@layerfi/components/components/AccountsReceivable/index' {
210
+ export { AccountsReceivable } from '@layerfi/components/components/AccountsReceivable/AccountsReceivableIndex';
211
+
177
212
  }
178
213
  declare module '@layerfi/components/components/Badge/Badge' {
179
214
  import React, { ReactNode } from 'react';
@@ -275,11 +310,12 @@ declare module '@layerfi/components/components/BankTransactionRow/BankTransactio
275
310
  editable: boolean;
276
311
  removeTransaction: (id: string) => void;
277
312
  containerWidth?: number;
313
+ initialLoad?: boolean;
278
314
  };
279
315
  export type LastSubmittedForm = 'simple' | 'match' | 'split' | undefined;
280
316
  export const extractDescriptionForSplit: (category: Category) => string;
281
317
  export const getDefaultSelectedCategory: (bankTransaction: BankTransaction) => import("@layerfi/components/components/CategorySelect/CategorySelect").CategoryOption | undefined;
282
- export const BankTransactionRow: ({ index, dateFormat, bankTransaction, editable, removeTransaction, containerWidth, }: Props) => React.JSX.Element | null;
318
+ export const BankTransactionRow: ({ index, dateFormat, bankTransaction, editable, removeTransaction, containerWidth, initialLoad, }: Props) => React.JSX.Element | null;
283
319
  export {};
284
320
 
285
321
  }
@@ -313,13 +349,22 @@ declare module '@layerfi/components/components/BankTransactions/BankTransactions
313
349
  export interface BankTransactionsProps {
314
350
  asWidget?: boolean;
315
351
  pageSize?: number;
352
+ categorizedOnly?: boolean;
316
353
  }
317
- export const BankTransactions: ({ asWidget, pageSize, }: BankTransactionsProps) => React.JSX.Element;
354
+ export const BankTransactions: ({ asWidget, pageSize, categorizedOnly, }: BankTransactionsProps) => React.JSX.Element;
318
355
 
319
356
  }
320
357
  declare module '@layerfi/components/components/BankTransactions/index' {
321
358
  export { BankTransactions } from '@layerfi/components/components/BankTransactions/BankTransactions';
322
359
 
360
+ }
361
+ declare module '@layerfi/components/components/Button/BackButton' {
362
+ import React, { ButtonHTMLAttributes } from 'react';
363
+ export interface BackButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
364
+ textOnly?: boolean;
365
+ }
366
+ export const BackButton: ({ className, children, textOnly, ...props }: BackButtonProps) => React.JSX.Element;
367
+
323
368
  }
324
369
  declare module '@layerfi/components/components/Button/Button' {
325
370
  import React, { ButtonHTMLAttributes, ReactNode } from 'react';
@@ -367,12 +412,13 @@ declare module '@layerfi/components/components/Button/SubmitButton' {
367
412
  active?: boolean;
368
413
  iconOnly?: boolean;
369
414
  action?: SubmitAction;
415
+ noIcon?: boolean;
370
416
  }
371
417
  export enum SubmitAction {
372
418
  SAVE = "save",
373
419
  UPDATE = "update"
374
420
  }
375
- export const SubmitButton: ({ active, className, processing, disabled, error, children, action, ...props }: SubmitButtonProps) => React.JSX.Element;
421
+ export const SubmitButton: ({ active, className, processing, disabled, error, children, action, noIcon, ...props }: SubmitButtonProps) => React.JSX.Element;
376
422
 
377
423
  }
378
424
  declare module '@layerfi/components/components/Button/TextButton' {
@@ -387,25 +433,7 @@ declare module '@layerfi/components/components/Button/index' {
387
433
  export { RetryButton } from '@layerfi/components/components/Button/RetryButton';
388
434
  export { SubmitButton } from '@layerfi/components/components/Button/SubmitButton';
389
435
  export { TextButton } from '@layerfi/components/components/Button/TextButton';
390
-
391
- }
392
- declare module '@layerfi/components/components/CategoryMenu/CategoryMenu' {
393
- import React from 'react';
394
- import { BankTransaction, Category } from '@layerfi/components/types';
395
- type Props = {
396
- name?: string;
397
- bankTransaction: BankTransaction;
398
- value: Category | undefined;
399
- onChange: (newValue: Category) => void;
400
- disabled?: boolean;
401
- className?: string;
402
- };
403
- export const CategoryMenu: ({ bankTransaction, name, value, onChange, disabled, className, }: Props) => React.JSX.Element;
404
- export {};
405
-
406
- }
407
- declare module '@layerfi/components/components/CategoryMenu/index' {
408
- export { CategoryMenu } from '@layerfi/components/components/CategoryMenu/CategoryMenu';
436
+ export { BackButton } from '@layerfi/components/components/Button/BackButton';
409
437
 
410
438
  }
411
439
  declare module '@layerfi/components/components/CategorySelect/CategorySelect' {
@@ -451,39 +479,6 @@ declare module '@layerfi/components/components/CategorySelect/CategorySelect' {
451
479
  declare module '@layerfi/components/components/CategorySelect/index' {
452
480
  export { CategorySelect } from '@layerfi/components/components/CategorySelect/CategorySelect';
453
481
 
454
- }
455
- declare module '@layerfi/components/components/ChartOfAccounts/ChartOfAccounts' {
456
- import React from 'react';
457
- export const ChartOfAccounts: () => React.JSX.Element;
458
-
459
- }
460
- declare module '@layerfi/components/components/ChartOfAccounts/index' {
461
- export { ChartOfAccounts } from '@layerfi/components/components/ChartOfAccounts/ChartOfAccounts';
462
-
463
- }
464
- declare module '@layerfi/components/components/ChartOfAccountsNewForm/ChartOfAccountsNewForm' {
465
- import React from 'react';
466
- export const ChartOfAccountsNewForm: () => React.JSX.Element;
467
-
468
- }
469
- declare module '@layerfi/components/components/ChartOfAccountsNewForm/index' {
470
- export { ChartOfAccountsNewForm } from '@layerfi/components/components/ChartOfAccountsNewForm/ChartOfAccountsNewForm';
471
-
472
- }
473
- declare module '@layerfi/components/components/ChartOfAccountsRow/ChartOfAccountsRow' {
474
- import React from 'react';
475
- import { Account } from '@layerfi/components/types';
476
- type Props = {
477
- account: Account;
478
- depth?: number;
479
- };
480
- export const ChartOfAccountsRow: ({ account, depth }: Props) => React.JSX.Element;
481
- export {};
482
-
483
- }
484
- declare module '@layerfi/components/components/ChartOfAccountsRow/index' {
485
- export { ChartOfAccountsRow } from '@layerfi/components/components/ChartOfAccountsRow/ChartOfAccountsRow';
486
-
487
482
  }
488
483
  declare module '@layerfi/components/components/Container/Container' {
489
484
  import React, { ReactNode } from 'react';
@@ -515,7 +510,8 @@ declare module '@layerfi/components/components/DataState/DataState' {
515
510
  import React from 'react';
516
511
  export enum DataStateStatus {
517
512
  allDone = "allDone",
518
- failed = "failed"
513
+ failed = "failed",
514
+ info = "info"
519
515
  }
520
516
  export interface DataStateProps {
521
517
  status: DataStateStatus;
@@ -548,6 +544,7 @@ declare module '@layerfi/components/components/ExpandedBankTransactionRow/Expand
548
544
  type Props = {
549
545
  bankTransaction: BankTransaction;
550
546
  isOpen?: boolean;
547
+ close: () => void;
551
548
  asListItem?: boolean;
552
549
  submitBtnText?: string;
553
550
  containerWidth?: number;
@@ -576,6 +573,22 @@ declare module '@layerfi/components/components/Hello/Hello' {
576
573
  declare module '@layerfi/components/components/Hello/index' {
577
574
  export { Hello } from '@layerfi/components/components/Hello/Hello';
578
575
 
576
+ }
577
+ declare module '@layerfi/components/components/HoverMenu/HoverMenu' {
578
+ import React, { ReactNode } from 'react';
579
+ export interface HoverMenuProps {
580
+ children: ReactNode;
581
+ config: {
582
+ name: string;
583
+ action: () => void;
584
+ }[];
585
+ }
586
+ export const HoverMenu: ({ children, config }: HoverMenuProps) => React.JSX.Element;
587
+
588
+ }
589
+ declare module '@layerfi/components/components/HoverMenu/index' {
590
+ export { HoverMenu, HoverMenuProps } from '@layerfi/components/components/HoverMenu/HoverMenu';
591
+
579
592
  }
580
593
  declare module '@layerfi/components/components/Input/FileInput' {
581
594
  import React from 'react';
@@ -603,28 +616,132 @@ declare module '@layerfi/components/components/Input/InputGroup' {
603
616
  name?: string;
604
617
  className?: string;
605
618
  children?: ReactNode;
619
+ inline?: boolean;
620
+ }
621
+ export const InputGroup: ({ label, name, className, inline, children, }: InputGroupProps) => React.JSX.Element;
622
+
623
+ }
624
+ declare module '@layerfi/components/components/Input/Select' {
625
+ import React from 'react';
626
+ import { GroupBase, OptionsOrGroups } from 'react-select';
627
+ export interface SelectProps<T> {
628
+ name?: string;
629
+ options?: OptionsOrGroups<T, GroupBase<T>>;
630
+ className?: string;
631
+ classNamePrefix?: string;
632
+ value?: T;
633
+ onChange: (selected: T) => void;
634
+ disabled?: boolean;
606
635
  }
607
- export const InputGroup: ({ label, name, className, children, }: InputGroupProps) => React.JSX.Element;
636
+ export const Select: <T>({ name, options, className, classNamePrefix, value, onChange, disabled, }: SelectProps<T>) => React.JSX.Element;
608
637
 
609
638
  }
610
639
  declare module '@layerfi/components/components/Input/index' {
611
640
  export { Input } from '@layerfi/components/components/Input/Input';
612
641
  export { InputGroup } from '@layerfi/components/components/Input/InputGroup';
613
642
  export { FileInput } from '@layerfi/components/components/Input/FileInput';
643
+ export { Select } from '@layerfi/components/components/Input/Select';
614
644
 
615
645
  }
616
- declare module '@layerfi/components/components/LinkedAccounts/LinkedAccountThumb' {
646
+ declare module '@layerfi/components/components/LedgerAccounts/LedgerAccounts' {
647
+ import React from 'react';
648
+ import { useLedgerAccounts } from '@layerfi/components/hooks/useLedgerAccounts/index';
649
+ export type LedgerAccountsContextType = ReturnType<typeof useLedgerAccounts>;
650
+ export const LedgerAccountsContext: React.Context<{
651
+ data: import("@layerfi/components/types").LedgerAccounts | undefined;
652
+ isLoading?: boolean | undefined;
653
+ isValidating?: boolean | undefined;
654
+ error?: unknown;
655
+ refetch: () => void;
656
+ create: (newAccount: import("@layerfi/components/types").NewAccount) => void;
657
+ form?: import("@layerfi/components/hooks/useLedgerAccounts/useLedgerAccounts").LedgerAccountsForm | undefined;
658
+ sendingForm?: boolean | undefined;
659
+ apiError?: string | undefined;
660
+ addAccount: () => void;
661
+ editAccount: (id: string) => void;
662
+ cancelForm: () => void;
663
+ changeFormData: (name: string, value: string | import("@layerfi/components/types/general").BaseSelectOption | undefined) => void;
664
+ submitForm: () => void;
665
+ showARForAccountId?: string | undefined;
666
+ setShowARForAccountId: (id?: string | undefined) => void;
667
+ }>;
668
+ export const LedgerAccounts: () => React.JSX.Element;
669
+
670
+ }
671
+ declare module '@layerfi/components/components/LedgerAccounts/index' {
672
+ export { LedgerAccounts } from '@layerfi/components/components/LedgerAccounts/LedgerAccounts';
673
+
674
+ }
675
+ declare module '@layerfi/components/components/LedgerAccountsForm/LedgerAccountsForm' {
676
+ import React from 'react';
677
+ export const LedgerAccountsForm: () => React.JSX.Element | undefined;
678
+
679
+ }
680
+ declare module '@layerfi/components/components/LedgerAccountsForm/index' {
681
+ export { LedgerAccountsForm } from '@layerfi/components/components/LedgerAccountsForm/LedgerAccountsForm';
682
+
683
+ }
684
+ declare module '@layerfi/components/components/LedgerAccountsRow/LedgerAccountsRow' {
685
+ import React from 'react';
686
+ import { Account } from '@layerfi/components/types';
687
+ type LedgerAccountsRowProps = {
688
+ account: Account;
689
+ depth?: number;
690
+ index: number;
691
+ cumulativeIndex?: number;
692
+ expanded: boolean;
693
+ acountsLength: number;
694
+ defaultOpen?: boolean;
695
+ };
696
+ export const LedgerAccountsRow: ({ account, depth, index, cumulativeIndex, expanded, defaultOpen, acountsLength, }: LedgerAccountsRowProps) => React.JSX.Element;
697
+ export {};
698
+
699
+ }
700
+ declare module '@layerfi/components/components/LedgerAccountsRow/index' {
701
+ export { LedgerAccountsRow } from '@layerfi/components/components/LedgerAccountsRow/LedgerAccountsRow';
702
+
703
+ }
704
+ declare module '@layerfi/components/components/LedgerAccountsSidebar/LedgerAccountsSidebar' {
705
+ import React from 'react';
706
+ export const LedgerAccountsSidebar: () => React.JSX.Element;
707
+
708
+ }
709
+ declare module '@layerfi/components/components/LedgerAccountsSidebar/index' {
710
+ export { LedgerAccountsSidebar } from '@layerfi/components/components/LedgerAccountsSidebar/LedgerAccountsSidebar';
711
+
712
+ }
713
+ declare module '@layerfi/components/components/LinkedAccountOptions/LinkedAccountOptions' {
714
+ import React from 'react';
715
+ import { HoverMenuProps } from '@layerfi/components/components/HoverMenu/index';
716
+ interface LinkedAccountOptionsProps extends HoverMenuProps {
717
+ }
718
+ export const LinkedAccountOptions: ({ children, config, }: LinkedAccountOptionsProps) => React.JSX.Element;
719
+ export {};
720
+
721
+ }
722
+ declare module '@layerfi/components/components/LinkedAccountOptions/index' {
723
+ export { LinkedAccountOptions } from '@layerfi/components/components/LinkedAccountOptions/LinkedAccountOptions';
724
+
725
+ }
726
+ declare module '@layerfi/components/components/LinkedAccountThumb/LinkedAccountThumb' {
617
727
  import React from 'react';
618
728
  import { LinkedAccount } from '@layerfi/components/types/linked_accounts';
619
729
  export interface LinkedAccountThumbProps {
620
730
  account: LinkedAccount;
731
+ asWidget?: boolean;
621
732
  }
622
- export const LinkedAccountThumb: ({ account }: LinkedAccountThumbProps) => React.JSX.Element;
733
+ export const LinkedAccountThumb: ({ account, asWidget, }: LinkedAccountThumbProps) => React.JSX.Element;
734
+
735
+ }
736
+ declare module '@layerfi/components/components/LinkedAccountThumb/index' {
737
+ export { LinkedAccountThumb } from '@layerfi/components/components/LinkedAccountThumb/LinkedAccountThumb';
623
738
 
624
739
  }
625
740
  declare module '@layerfi/components/components/LinkedAccounts/LinkedAccounts' {
626
741
  import React from 'react';
627
- export const LinkedAccounts: () => React.JSX.Element;
742
+ export const LinkedAccounts: ({ asWidget }: {
743
+ asWidget?: boolean | undefined;
744
+ }) => React.JSX.Element;
628
745
 
629
746
  }
630
747
  declare module '@layerfi/components/components/LinkedAccounts/index' {
@@ -701,18 +818,7 @@ declare module '@layerfi/components/components/ProfitAndLoss/ProfitAndLoss' {
701
818
  refetch: () => void;
702
819
  sidebarScope: import("@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss").SidebarScope;
703
820
  setSidebarScope: (view: import("@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss").SidebarScope) => void;
704
- filters: {
705
- expenses: {
706
- sortBy?: string | undefined;
707
- sortDirection?: import("@layerfi/components/types").SortDirection | undefined;
708
- types?: string[] | undefined;
709
- } | undefined;
710
- revenue: {
711
- sortBy?: string | undefined;
712
- sortDirection?: import("@layerfi/components/types").SortDirection | undefined;
713
- types?: string[] | undefined;
714
- } | undefined;
715
- };
821
+ filters: import("@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss").ProfitAndLossFilters;
716
822
  sortBy: (scope: import("@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss").Scope, field: string, direction?: import("../../types").SortDirection | undefined) => void;
717
823
  setFilterTypes: (scope: import("@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss").Scope, types: string[]) => void;
718
824
  }>;
@@ -760,6 +866,51 @@ declare module '@layerfi/components/components/ProfitAndLossDatePicker/ProfitAnd
760
866
  declare module '@layerfi/components/components/ProfitAndLossDatePicker/index' {
761
867
  export { ProfitAndLossDatePicker } from '@layerfi/components/components/ProfitAndLossDatePicker/ProfitAndLossDatePicker';
762
868
 
869
+ }
870
+ declare module '@layerfi/components/components/ProfitAndLossDetailedCharts/DetailedChart' {
871
+ import React from 'react';
872
+ import { SidebarScope } from '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss';
873
+ import { LineBaseItem } from '@layerfi/components/types/line_item';
874
+ interface DetailedChartProps {
875
+ filteredData: LineBaseItem[];
876
+ filteredTotal?: number;
877
+ hoveredItem?: string;
878
+ setHoveredItem: (name?: string) => void;
879
+ sidebarScope?: SidebarScope;
880
+ date: number | Date;
881
+ }
882
+ export const DetailedChart: ({ filteredData, filteredTotal, hoveredItem, setHoveredItem, sidebarScope, date, }: DetailedChartProps) => React.JSX.Element;
883
+ export {};
884
+
885
+ }
886
+ declare module '@layerfi/components/components/ProfitAndLossDetailedCharts/DetailedTable' {
887
+ import React from 'react';
888
+ import { Scope, SidebarScope, ProfitAndLossFilters } from '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss';
889
+ import { SortDirection } from '@layerfi/components/types';
890
+ import { LineBaseItem } from '@layerfi/components/types/line_item';
891
+ export interface DetailedTableProps {
892
+ filteredData: LineBaseItem[];
893
+ hoveredItem?: string;
894
+ setHoveredItem: (name?: string) => void;
895
+ sidebarScope: SidebarScope;
896
+ filters: ProfitAndLossFilters;
897
+ sortBy: (scope: Scope, field: string, direction?: SortDirection) => void;
898
+ }
899
+ export const DetailedTable: ({ filteredData, sidebarScope, filters, sortBy, hoveredItem, setHoveredItem, }: DetailedTableProps) => React.JSX.Element;
900
+
901
+ }
902
+ declare module '@layerfi/components/components/ProfitAndLossDetailedCharts/Filters' {
903
+ import React from 'react';
904
+ import { Scope, SidebarScope, ProfitAndLossFilters } from '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss';
905
+ import { LineBaseItem } from '@layerfi/components/types/line_item';
906
+ export interface FiltersProps {
907
+ filteredData: LineBaseItem[];
908
+ sidebarScope: SidebarScope;
909
+ filters: ProfitAndLossFilters;
910
+ setFilterTypes: (scope: Scope, types: string[]) => void;
911
+ }
912
+ export const Filters: ({ filteredData, sidebarScope, filters, setFilterTypes, }: FiltersProps) => React.JSX.Element;
913
+
763
914
  }
764
915
  declare module '@layerfi/components/components/ProfitAndLossDetailedCharts/ProfitAndLossDetailedCharts' {
765
916
  import React from 'react';
@@ -772,6 +923,7 @@ declare module '@layerfi/components/components/ProfitAndLossDetailedCharts/index
772
923
  }
773
924
  declare module '@layerfi/components/components/ProfitAndLossRow/ProfitAndLossRow' {
774
925
  import React from 'react';
926
+ import { SidebarScope } from '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss';
775
927
  import { Direction, LineItem } from '@layerfi/components/types';
776
928
  type Props = {
777
929
  variant?: string;
@@ -779,15 +931,26 @@ declare module '@layerfi/components/components/ProfitAndLossRow/ProfitAndLossRow
779
931
  maxDepth?: number;
780
932
  lineItem?: LineItem | null;
781
933
  direction?: Direction;
934
+ scope?: SidebarScope;
935
+ setSidebarScope?: (name: SidebarScope) => void;
782
936
  lockExpanded?: boolean;
783
937
  };
784
- export const ProfitAndLossRow: ({ variant, lineItem, depth, maxDepth, direction, lockExpanded, }: Props) => React.JSX.Element | null;
938
+ export const ProfitAndLossRow: ({ variant, lineItem, depth, maxDepth, direction, lockExpanded, scope, setSidebarScope, }: Props) => React.JSX.Element | null;
785
939
  export {};
786
940
 
787
941
  }
788
942
  declare module '@layerfi/components/components/ProfitAndLossRow/index' {
789
943
  export { ProfitAndLossRow } from '@layerfi/components/components/ProfitAndLossRow/ProfitAndLossRow';
790
944
 
945
+ }
946
+ declare module '@layerfi/components/components/ProfitAndLossSummaries/MiniChart' {
947
+ import React from 'react';
948
+ import { LineBaseItem } from '@layerfi/components/types/line_item';
949
+ export interface MiniChartProps {
950
+ data: LineBaseItem[];
951
+ }
952
+ export const MiniChart: ({ data }: MiniChartProps) => React.JSX.Element;
953
+
791
954
  }
792
955
  declare module '@layerfi/components/components/ProfitAndLossSummaries/ProfitAndLossSummaries' {
793
956
  import React from 'react';
@@ -1092,6 +1255,14 @@ declare module '@layerfi/components/components/Typography/index' {
1092
1255
  export { Heading, HeadingSize } from '@layerfi/components/components/Typography/Heading';
1093
1256
  export { ErrorText } from '@layerfi/components/components/Typography/ErrorText';
1094
1257
 
1258
+ }
1259
+ declare module '@layerfi/components/config/charts' {
1260
+ export const INACTIVE_OPACITY_LEVELS: number[];
1261
+ export const DEFAULT_CHART_COLORS: {
1262
+ color: string;
1263
+ opacity: number;
1264
+ }[];
1265
+
1095
1266
  }
1096
1267
  declare module '@layerfi/components/config/general' {
1097
1268
  export const DATE_FORMAT = "LLL d, yyyy";
@@ -1198,22 +1369,6 @@ declare module '@layerfi/components/hooks/useBankTransactions/useBankTransaction
1198
1369
  export const useBankTransactions: UseBankTransactions;
1199
1370
  export {};
1200
1371
 
1201
- }
1202
- declare module '@layerfi/components/hooks/useChartOfAccounts/index' {
1203
- export { useChartOfAccounts } from '@layerfi/components/hooks/useChartOfAccounts/useChartOfAccounts';
1204
-
1205
- }
1206
- declare module '@layerfi/components/hooks/useChartOfAccounts/useChartOfAccounts' {
1207
- import { AccountAlternate, ChartOfAccounts, NewAccount } from '@layerfi/components/types';
1208
- type UseChartOfAccounts = () => {
1209
- data: ChartOfAccounts | undefined;
1210
- isLoading: boolean;
1211
- error: unknown;
1212
- create: (newAccount: NewAccount) => Promise<AccountAlternate>;
1213
- };
1214
- export const useChartOfAccounts: UseChartOfAccounts;
1215
- export {};
1216
-
1217
1372
  }
1218
1373
  declare module '@layerfi/components/hooks/useElementSize/index' {
1219
1374
  export { useElementSize } from '@layerfi/components/hooks/useElementSize/useElementSize';
@@ -1236,21 +1391,68 @@ declare module '@layerfi/components/hooks/useLayerContext/useLayerContext' {
1236
1391
  setTheme: (theme: import("@layerfi/components/types/layer_context").LayerThemeConfig) => void;
1237
1392
  };
1238
1393
 
1394
+ }
1395
+ declare module '@layerfi/components/hooks/useLedgerAccounts/index' {
1396
+ export { useLedgerAccounts } from '@layerfi/components/hooks/useLedgerAccounts/useLedgerAccounts';
1397
+
1398
+ }
1399
+ declare module '@layerfi/components/hooks/useLedgerAccounts/useLedgerAccounts' {
1400
+ import { Account, LedgerAccounts, NewAccount } from '@layerfi/components/types';
1401
+ import { BaseSelectOption } from '@layerfi/components/types/general';
1402
+ interface FormError {
1403
+ field: string;
1404
+ message: string;
1405
+ }
1406
+ export interface LedgerAccountsForm {
1407
+ action: 'new' | 'edit';
1408
+ accountId?: string;
1409
+ data: {
1410
+ parent?: BaseSelectOption;
1411
+ name?: string;
1412
+ type?: BaseSelectOption;
1413
+ subType?: BaseSelectOption;
1414
+ category?: BaseSelectOption;
1415
+ };
1416
+ errors?: FormError[];
1417
+ }
1418
+ type UseLedgerAccounts = () => {
1419
+ data: LedgerAccounts | undefined;
1420
+ isLoading?: boolean;
1421
+ isValidating?: boolean;
1422
+ error?: unknown;
1423
+ refetch: () => void;
1424
+ create: (newAccount: NewAccount) => void;
1425
+ form?: LedgerAccountsForm;
1426
+ sendingForm?: boolean;
1427
+ apiError?: string;
1428
+ addAccount: () => void;
1429
+ editAccount: (id: string) => void;
1430
+ cancelForm: () => void;
1431
+ changeFormData: (name: string, value: string | BaseSelectOption | undefined) => void;
1432
+ submitForm: () => void;
1433
+ showARForAccountId?: string;
1434
+ setShowARForAccountId: (id?: string) => void;
1435
+ };
1436
+ export const flattenAccounts: (accounts: Account[]) => Account[];
1437
+ export const useLedgerAccounts: UseLedgerAccounts;
1438
+ export {};
1439
+
1239
1440
  }
1240
1441
  declare module '@layerfi/components/hooks/useLinkedAccounts/index' {
1241
1442
  export { useLinkedAccounts } from '@layerfi/components/hooks/useLinkedAccounts/useLinkedAccounts';
1242
1443
 
1243
1444
  }
1244
1445
  declare module '@layerfi/components/hooks/useLinkedAccounts/useLinkedAccounts' {
1245
- import { Metadata } from '@layerfi/components/types';
1246
1446
  import { LinkedAccount } from '@layerfi/components/types/linked_accounts';
1247
1447
  type UseLinkedAccounts = () => {
1248
1448
  data?: LinkedAccount[];
1249
- metadata: Metadata;
1250
1449
  isLoading: boolean;
1251
1450
  isValidating: boolean;
1252
1451
  error: unknown;
1253
1452
  refetch: () => void;
1453
+ addAccount: () => void;
1454
+ unlinkAccount: () => void;
1455
+ renewLinkAccount: () => void;
1254
1456
  };
1255
1457
  export const useLinkedAccounts: UseLinkedAccounts;
1256
1458
  export {};
@@ -1295,7 +1497,7 @@ declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss' {
1295
1497
  sortDirection?: SortDirection;
1296
1498
  types?: string[];
1297
1499
  };
1298
- type ProfitAndLossFilters = Record<Scope, ProfitAndLossFilter | undefined>;
1500
+ export type ProfitAndLossFilters = Record<Scope, ProfitAndLossFilter | undefined>;
1299
1501
  type UseProfitAndLoss = (props?: Props) => {
1300
1502
  data: ProfitAndLoss | undefined;
1301
1503
  filteredData: LineBaseItem[];
@@ -1329,6 +1531,20 @@ declare module '@layerfi/components/icons/AlertOctagon' {
1329
1531
  const AlertOctagon: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1330
1532
  export default AlertOctagon;
1331
1533
 
1534
+ }
1535
+ declare module '@layerfi/components/icons/ArrowRightCircle' {
1536
+ import * as React from 'react';
1537
+ import { IconSvgProps } from '@layerfi/components/icons/types';
1538
+ const ArrowRightCircle: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1539
+ export default ArrowRightCircle;
1540
+
1541
+ }
1542
+ declare module '@layerfi/components/icons/BackArrow' {
1543
+ import * as React from 'react';
1544
+ import { IconSvgProps } from '@layerfi/components/icons/types';
1545
+ const BackArrow: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1546
+ export default BackArrow;
1547
+
1332
1548
  }
1333
1549
  declare module '@layerfi/components/icons/Calendar' {
1334
1550
  import * as React from 'react';
@@ -1381,10 +1597,24 @@ declare module '@layerfi/components/icons/ChevronRight' {
1381
1597
  }
1382
1598
  declare module '@layerfi/components/icons/DownloadCloud' {
1383
1599
  import * as React from 'react';
1384
- import { SVGProps } from 'react';
1385
- const DownloadCloud: (props: SVGProps<SVGSVGElement>) => React.JSX.Element;
1600
+ import { IconSvgProps } from '@layerfi/components/icons/types';
1601
+ const DownloadCloud: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1386
1602
  export default DownloadCloud;
1387
1603
 
1604
+ }
1605
+ declare module '@layerfi/components/icons/Edit2' {
1606
+ import * as React from 'react';
1607
+ import { IconSvgProps } from '@layerfi/components/icons/types';
1608
+ const Edit2: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1609
+ export default Edit2;
1610
+
1611
+ }
1612
+ declare module '@layerfi/components/icons/InstitutionIcon' {
1613
+ import * as React from 'react';
1614
+ import { IconSvgProps } from '@layerfi/components/icons/types';
1615
+ const InstitutionIcon: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1616
+ export default InstitutionIcon;
1617
+
1388
1618
  }
1389
1619
  declare module '@layerfi/components/icons/Loader' {
1390
1620
  import * as React from 'react';
@@ -1399,6 +1629,27 @@ declare module '@layerfi/components/icons/MinimizeTwo' {
1399
1629
  const MinimizeTwo: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1400
1630
  export default MinimizeTwo;
1401
1631
 
1632
+ }
1633
+ declare module '@layerfi/components/icons/MoreVertical' {
1634
+ import React from 'react';
1635
+ import { IconSvgProps } from '@layerfi/components/icons/types';
1636
+ const MoreVertical: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1637
+ export default MoreVertical;
1638
+
1639
+ }
1640
+ declare module '@layerfi/components/icons/PieChart' {
1641
+ import * as React from 'react';
1642
+ import { IconSvgProps } from '@layerfi/components/icons/types';
1643
+ const PieChart: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1644
+ export default PieChart;
1645
+
1646
+ }
1647
+ declare module '@layerfi/components/icons/PlusIcon' {
1648
+ import * as React from 'react';
1649
+ import { IconSvgProps } from '@layerfi/components/icons/types';
1650
+ const PlusIcon: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1651
+ export default PlusIcon;
1652
+
1402
1653
  }
1403
1654
  declare module '@layerfi/components/icons/RefreshCcw' {
1404
1655
  import * as React from 'react';
@@ -1470,8 +1721,8 @@ declare module '@layerfi/components/index' {
1470
1721
  export { LinkedAccounts } from '@layerfi/components/components/LinkedAccounts/index';
1471
1722
  export { ProfitAndLoss } from '@layerfi/components/components/ProfitAndLoss/index';
1472
1723
  export { ProfitAndLossView } from '@layerfi/components/components/ProfitAndLossView/index';
1724
+ export { LedgerAccounts } from '@layerfi/components/components/LedgerAccounts/index';
1473
1725
  export { LayerProvider } from '@layerfi/components/providers/LayerProvider/index';
1474
- export { ChartOfAccounts } from '@layerfi/components/components/ChartOfAccounts/index';
1475
1726
 
1476
1727
  }
1477
1728
  declare module '@layerfi/components/models/APIError' {
@@ -1673,52 +1924,13 @@ declare module '@layerfi/components/types/categories' {
1673
1924
  export type CategoryUpdate = SingleCategoryUpdate | SplitCategoryUpdate;
1674
1925
  export function hasSuggestions(categorization: Categorization): categorization is SuggestedCategorization;
1675
1926
 
1676
- }
1677
- declare module '@layerfi/components/types/chart_of_accounts' {
1678
- import { Direction } from '@layerfi/components/types/bank_transactions';
1679
- import { Category } from '@layerfi/components/types/categories';
1680
- export interface ChartOfAccounts {
1681
- name: string;
1682
- accounts: Account[];
1683
- }
1684
- export interface Account {
1685
- id: string;
1686
- number: number;
1687
- pnlCategory?: Category;
1688
- headerForPnlCategory?: Category;
1689
- name: string;
1690
- accountStableName?: string;
1691
- description?: string;
1692
- scheduleCLine?: string;
1693
- scheduleCLineDescription?: string;
1694
- subAccounts?: Account[];
1695
- hidePnl: boolean;
1696
- showInPnlIfEmpty: boolean;
1697
- normality: Direction;
1698
- balance: number;
1699
- selfOnlyBalance: number;
1700
- }
1701
- export interface AccountAlternate {
1702
- type: 'Ledger_Account';
1703
- id: string;
1704
- name: string;
1705
- stable_name: string | null;
1706
- normality: Direction;
1707
- pnl_category: string | null;
1708
- }
1709
- export type NewAccount = {
1710
- name: string;
1711
- normality: Direction;
1712
- parent_id: {
1713
- type: 'AccountId';
1714
- id: string;
1715
- };
1716
- description: string;
1717
- };
1718
-
1719
1927
  }
1720
1928
  declare module '@layerfi/components/types/general' {
1721
1929
  export type SortDirection = 'asc' | 'desc';
1930
+ export interface BaseSelectOption {
1931
+ label: string;
1932
+ value: string | number;
1933
+ }
1722
1934
 
1723
1935
  }
1724
1936
  declare module '@layerfi/components/types/layer_context' {
@@ -1793,6 +2005,62 @@ declare module '@layerfi/components/types/layer_context' {
1793
2005
  };
1794
2006
  };
1795
2007
 
2008
+ }
2009
+ declare module '@layerfi/components/types/ledger_accounts' {
2010
+ import { Direction } from '@layerfi/components/types/bank_transactions';
2011
+ import { Category } from '@layerfi/components/types/categories';
2012
+ export interface LedgerAccounts {
2013
+ type: string;
2014
+ accounts: Account[];
2015
+ entries?: any[];
2016
+ }
2017
+ export interface AccountEntry {
2018
+ account: Account;
2019
+ amount?: number;
2020
+ createdAt?: string;
2021
+ direction: Direction;
2022
+ entry_at?: string;
2023
+ entry_id?: string;
2024
+ id?: string;
2025
+ }
2026
+ export interface Account {
2027
+ id: string;
2028
+ number: number;
2029
+ pnlCategory?: Category;
2030
+ headerForPnlCategory?: Category;
2031
+ name: string;
2032
+ accountStableName?: string;
2033
+ description?: string;
2034
+ scheduleCLine?: string;
2035
+ scheduleCLineDescription?: string;
2036
+ sub_accounts?: Account[];
2037
+ hidePnl: boolean;
2038
+ showInPnlIfEmpty: boolean;
2039
+ normality: Direction;
2040
+ balance: number;
2041
+ selfOnlyBalance: number;
2042
+ entries?: AccountEntry[];
2043
+ }
2044
+ export type NewAccount = {
2045
+ name: string;
2046
+ normality: Direction;
2047
+ parent_id?: {
2048
+ type: 'AccountId';
2049
+ id: string;
2050
+ };
2051
+ description: string;
2052
+ };
2053
+ export type EditAccount = {
2054
+ name: string;
2055
+ stable_name: string;
2056
+ normality: Direction;
2057
+ parent_id?: {
2058
+ type: 'AccountId';
2059
+ id: string;
2060
+ };
2061
+ description: string;
2062
+ };
2063
+
1796
2064
  }
1797
2065
  declare module '@layerfi/components/types/line_item' {
1798
2066
  export interface LineItem {
@@ -1813,10 +2081,24 @@ declare module '@layerfi/components/types/line_item' {
1813
2081
 
1814
2082
  }
1815
2083
  declare module '@layerfi/components/types/linked_accounts' {
2084
+ export interface LinkedAccounts {
2085
+ type: string;
2086
+ external_accounts: LinkedAccount[];
2087
+ }
1816
2088
  export interface LinkedAccount {
1817
- name: string;
1818
- account: string;
1819
- amount: number;
2089
+ id: string;
2090
+ external_account_name: string;
2091
+ external_account_number: string;
2092
+ latest_balance_timestamp: {
2093
+ external_account_external_id: string;
2094
+ external_account_source: string;
2095
+ balance: number;
2096
+ at: string;
2097
+ created_at: string;
2098
+ };
2099
+ current_ledger_balance: number;
2100
+ institution: string;
2101
+ institutionLogo: string;
1820
2102
  }
1821
2103
 
1822
2104
  }
@@ -1849,7 +2131,7 @@ declare module '@layerfi/components/types' {
1849
2131
  export { BalanceSheet } from '@layerfi/components/types/balance_sheet';
1850
2132
  export { Direction, BankTransaction } from '@layerfi/components/types/bank_transactions';
1851
2133
  export { CategorizationStatus, Category, CategorizationType, AutoCategorization, SuggestedCategorization, SingleCategoryUpdate, SplitCategoryUpdate, CategoryUpdate, } from '@layerfi/components/types/categories';
1852
- export { AccountAlternate, ChartOfAccounts, Account, NewAccount, } from '@layerfi/components/types/chart_of_accounts';
2134
+ export { LedgerAccounts, Account, NewAccount, EditAccount, } from '@layerfi/components/types/ledger_accounts';
1853
2135
  export { SortDirection } from '@layerfi/components/types/general';
1854
2136
  export type DateRange<T = Date> = {
1855
2137
  startDate: T;
@@ -1892,6 +2174,10 @@ declare module '@layerfi/components/utils/helpers' {
1892
2174
  export const range: (start: number, end: number) => number[];
1893
2175
  export const debounce: <F extends (...args: Parameters<F>) => ReturnType<F>>(fnc: F, timeout?: number) => (...args: Parameters<F>) => void;
1894
2176
  export const sleep: (time: number) => Promise<unknown>;
2177
+ /**
2178
+ * Convert the account name into stable_name
2179
+ */
2180
+ export const convertToStableName: (name: string) => string;
1895
2181
 
1896
2182
  }
1897
2183
  declare module '@layerfi/components/utils/profitAndLossUtils' {