@layerfi/components 0.1.9 → 0.1.11

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
@@ -27,6 +27,10 @@ declare module '@layerfi/components/api/layer/authenticated_http' {
27
27
  params?: Params | undefined;
28
28
  body?: Body_1 | undefined;
29
29
  } | undefined) => Promise<Return>;
30
+ export const deleteRequest: <Return extends Record<string, unknown> = Record<string, unknown>, Body_1 extends Record<string, unknown> = Record<string, unknown>, Params extends Record<string, string | undefined> = Record<string, string | undefined>>(url: (params: Params) => string) => (baseUrl: string, accessToken: string | undefined, options?: {
31
+ params?: Params | undefined;
32
+ body?: Body_1 | undefined;
33
+ } | undefined) => Promise<Return>;
30
34
 
31
35
  }
32
36
  declare module '@layerfi/components/api/layer/balance_sheet' {
@@ -87,20 +91,75 @@ declare module '@layerfi/components/api/layer/categories' {
87
91
  }>;
88
92
 
89
93
  }
90
- declare module '@layerfi/components/api/layer/ledger_accounts' {
91
- import { AccountAlternate, LedgerAccounts, NewAccount } from '@layerfi/components/types';
92
- export const getLedgerAccounts: (baseUrl: string, accessToken: string | undefined, options?: {
94
+ declare module '@layerfi/components/api/layer/chart_of_accounts' {
95
+ import { Account, ChartOfAccounts, NewAccount, EditAccount, LedgerAccounts, LedgerAccountsEntry } from '@layerfi/components/types';
96
+ export const getChartOfAccounts: (baseUrl: string, accessToken: string | undefined, options?: {
93
97
  params?: Record<string, string | undefined> | undefined;
94
98
  } | undefined) => () => Promise<{
95
- data: LedgerAccounts;
99
+ data: ChartOfAccounts;
96
100
  }>;
97
101
  export const createAccount: (baseUrl: string, accessToken: string | undefined, options?: {
98
102
  params?: Record<string, string | undefined> | undefined;
99
103
  body?: NewAccount | undefined;
100
104
  } | undefined) => Promise<{
101
- data: AccountAlternate;
105
+ data: Account;
106
+ }>;
107
+ export const updateAccount: (baseUrl: string, accessToken: string | undefined, options?: {
108
+ params?: Record<string, string | undefined> | undefined;
109
+ body?: EditAccount | undefined;
110
+ } | undefined) => Promise<{
111
+ data: Account;
112
+ }>;
113
+ export const getLedgerAccountsLines: (baseUrl: string, accessToken: string | undefined, options?: {
114
+ params?: Record<string, string | undefined> | undefined;
115
+ } | undefined) => () => Promise<{
116
+ data: LedgerAccounts;
117
+ }>;
118
+ export const getLedgerAccountsEntry: (baseUrl: string, accessToken: string | undefined, options?: {
119
+ params?: Record<string, string | undefined> | undefined;
120
+ } | undefined) => () => Promise<{
121
+ data: LedgerAccountsEntry;
102
122
  }>;
103
123
 
124
+ }
125
+ declare module '@layerfi/components/api/layer/linked_accounts' {
126
+ import { LinkedAccounts, PublicToken } from '@layerfi/components/types/linked_accounts';
127
+ export const getLinkedAccounts: (baseUrl: string, accessToken: string | undefined, options?: {
128
+ params?: Record<string, string | undefined> | undefined;
129
+ } | undefined) => () => Promise<{
130
+ data: LinkedAccounts;
131
+ }>;
132
+ export const getPlaidLinkToken: (baseUrl: string, accessToken: string | undefined, options?: {
133
+ params?: Record<string, string | undefined> | undefined;
134
+ body?: Record<string, unknown> | undefined;
135
+ } | undefined) => Promise<{
136
+ data: {
137
+ type: 'Link_Token';
138
+ link_token: string;
139
+ };
140
+ }>;
141
+ export const exchangePlaidPublicToken: (baseUrl: string, accessToken: string | undefined, options?: {
142
+ params?: Record<string, string | undefined> | undefined;
143
+ body?: PublicToken | undefined;
144
+ } | undefined) => Promise<Record<string, unknown>>;
145
+ /**
146
+ * This is named per plaid terminology. It means unlinking an institution
147
+ */
148
+ export const unlinkPlaidItem: (baseUrl: string, accessToken: string | undefined, options?: {
149
+ params?: {
150
+ businessId: string;
151
+ plaidItemId: string;
152
+ } | undefined;
153
+ body?: Record<string, unknown> | undefined;
154
+ } | undefined) => Promise<Record<string, unknown>>;
155
+ export const unlinkPlaidAccount: (baseUrl: string, accessToken: string | undefined, options?: {
156
+ params?: {
157
+ businessId: string;
158
+ accountId: string;
159
+ } | undefined;
160
+ body?: Record<string, unknown> | undefined;
161
+ } | undefined) => Promise<Record<string, unknown>>;
162
+
104
163
  }
105
164
  declare module '@layerfi/components/api/layer/profit_and_loss' {
106
165
  import { ProfitAndLoss } from '@layerfi/components/types';
@@ -141,7 +200,13 @@ declare module '@layerfi/components/api/layer' {
141
200
  params?: Record<string, string | undefined> | undefined;
142
201
  body?: import("@layerfi/components/types").NewAccount | undefined;
143
202
  } | undefined) => Promise<{
144
- data: import("@layerfi/components/types").AccountAlternate;
203
+ data: import("@layerfi/components/types").Account;
204
+ }>;
205
+ updateAccount: (baseUrl: string, accessToken: string | undefined, options?: {
206
+ params?: Record<string, string | undefined> | undefined;
207
+ body?: import("@layerfi/components/types").EditAccount | undefined;
208
+ } | undefined) => Promise<{
209
+ data: import("@layerfi/components/types").Account;
145
210
  }>;
146
211
  getBalanceSheet: (_token: string, _params: {
147
212
  params: import("@layerfi/components/api/layer/balance_sheet").GetBalanceSheetParams;
@@ -157,32 +222,65 @@ declare module '@layerfi/components/api/layer' {
157
222
  categories: import("@layerfi/components/types").Category[];
158
223
  };
159
224
  }>;
160
- getLedgerAccounts: (baseUrl: string, accessToken: string | undefined, options?: {
225
+ getChartOfAccounts: (baseUrl: string, accessToken: string | undefined, options?: {
226
+ params?: Record<string, string | undefined> | undefined;
227
+ } | undefined) => () => Promise<{
228
+ data: import("@layerfi/components/types").ChartOfAccounts;
229
+ }>;
230
+ getLedgerAccountsLines: (baseUrl: string, accessToken: string | undefined, options?: {
161
231
  params?: Record<string, string | undefined> | undefined;
162
232
  } | undefined) => () => Promise<{
163
233
  data: import("@layerfi/components/types").LedgerAccounts;
164
234
  }>;
235
+ getLedgerAccountsEntry: (baseUrl: string, accessToken: string | undefined, options?: {
236
+ params?: Record<string, string | undefined> | undefined;
237
+ } | undefined) => () => Promise<{
238
+ data: import("@layerfi/components/types").LedgerAccountsEntry;
239
+ }>;
165
240
  getProfitAndLoss: (baseUrl: string, accessToken: string | undefined, options?: {
166
241
  params?: Record<string, string | undefined> | undefined;
167
242
  } | undefined) => () => Promise<{
168
243
  data?: import("@layerfi/components/types").ProfitAndLoss | undefined;
169
244
  error?: unknown;
170
245
  }>;
246
+ getLinkedAccounts: (baseUrl: string, accessToken: string | undefined, options?: {
247
+ params?: Record<string, string | undefined> | undefined;
248
+ } | undefined) => () => Promise<{
249
+ data: import("@layerfi/components/types/linked_accounts").LinkedAccounts;
250
+ }>;
251
+ getPlaidLinkToken: (baseUrl: string, accessToken: string | undefined, options?: {
252
+ params?: Record<string, string | undefined> | undefined;
253
+ body?: Record<string, unknown> | undefined;
254
+ } | undefined) => Promise<{
255
+ data: {
256
+ type: "Link_Token";
257
+ link_token: string;
258
+ };
259
+ }>;
260
+ exchangePlaidPublicToken: (baseUrl: string, accessToken: string | undefined, options?: {
261
+ params?: Record<string, string | undefined> | undefined;
262
+ body?: import("@layerfi/components/types/linked_accounts").PublicToken | undefined;
263
+ } | undefined) => Promise<Record<string, unknown>>;
264
+ unlinkPlaidAccount: (baseUrl: string, accessToken: string | undefined, options?: {
265
+ params?: {
266
+ businessId: string;
267
+ accountId: string;
268
+ } | undefined;
269
+ body?: Record<string, unknown> | undefined;
270
+ } | undefined) => Promise<Record<string, unknown>>;
271
+ unlinkPlaidItem: (baseUrl: string, accessToken: string | undefined, options?: {
272
+ params?: {
273
+ businessId: string;
274
+ plaidItemId: string;
275
+ } | undefined;
276
+ body?: Record<string, unknown> | undefined;
277
+ } | undefined) => Promise<Record<string, unknown>>;
171
278
  };
172
279
 
173
280
  }
174
281
  declare module '@layerfi/components/api/util' {
175
282
  export const formStringFromObject: (object: Record<string, string | number | boolean>) => string;
176
283
 
177
- }
178
- declare module '@layerfi/components/components/AccountsReceivable/AccountsReceivableIndex' {
179
- import React from 'react';
180
- export const AccountsReceivable: () => React.JSX.Element;
181
-
182
- }
183
- declare module '@layerfi/components/components/AccountsReceivable/index' {
184
- export { AccountsReceivable } from '@layerfi/components/components/AccountsReceivable/AccountsReceivableIndex';
185
-
186
284
  }
187
285
  declare module '@layerfi/components/components/Badge/Badge' {
188
286
  import React, { ReactNode } from 'react';
@@ -191,18 +289,27 @@ declare module '@layerfi/components/components/Badge/Badge' {
191
289
  SMALL = "small",
192
290
  MEDIUM = "medium"
193
291
  }
292
+ export enum BadgeVariant {
293
+ DEFAULT = "default",
294
+ SUCCESS = "success",
295
+ WARNING = "warning",
296
+ ERROR = "error"
297
+ }
194
298
  export interface BadgeProps {
195
299
  children: ReactNode;
196
300
  icon?: ReactNode;
197
301
  onClick?: ButtonProps['onClick'];
198
302
  tooltip?: ReactNode;
199
303
  size?: BadgeSize;
304
+ variant?: BadgeVariant;
305
+ hoverable?: boolean;
200
306
  }
201
- export const Badge: ({ icon, onClick, children, tooltip, size, }: BadgeProps) => React.JSX.Element;
307
+ export const Badge: ({ icon, onClick, children, tooltip, size, variant, hoverable, }: BadgeProps) => React.JSX.Element;
202
308
 
203
309
  }
204
310
  declare module '@layerfi/components/components/Badge/index' {
205
311
  export { Badge } from '@layerfi/components/components/Badge/Badge';
312
+ export { BadgeVariant } from '@layerfi/components/components/Badge/Badge';
206
313
 
207
314
  }
208
315
  declare module '@layerfi/components/components/BalanceSheet/BalanceSheet' {
@@ -284,11 +391,12 @@ declare module '@layerfi/components/components/BankTransactionRow/BankTransactio
284
391
  editable: boolean;
285
392
  removeTransaction: (id: string) => void;
286
393
  containerWidth?: number;
394
+ initialLoad?: boolean;
287
395
  };
288
396
  export type LastSubmittedForm = 'simple' | 'match' | 'split' | undefined;
289
397
  export const extractDescriptionForSplit: (category: Category) => string;
290
398
  export const getDefaultSelectedCategory: (bankTransaction: BankTransaction) => import("@layerfi/components/components/CategorySelect/CategorySelect").CategoryOption | undefined;
291
- export const BankTransactionRow: ({ index, dateFormat, bankTransaction, editable, removeTransaction, containerWidth, }: Props) => React.JSX.Element | null;
399
+ export const BankTransactionRow: ({ index, dateFormat, bankTransaction, editable, removeTransaction, containerWidth, initialLoad, }: Props) => React.JSX.Element | null;
292
400
  export {};
293
401
 
294
402
  }
@@ -322,13 +430,22 @@ declare module '@layerfi/components/components/BankTransactions/BankTransactions
322
430
  export interface BankTransactionsProps {
323
431
  asWidget?: boolean;
324
432
  pageSize?: number;
433
+ categorizedOnly?: boolean;
325
434
  }
326
- export const BankTransactions: ({ asWidget, pageSize, }: BankTransactionsProps) => React.JSX.Element;
435
+ export const BankTransactions: ({ asWidget, pageSize, categorizedOnly, }: BankTransactionsProps) => React.JSX.Element;
327
436
 
328
437
  }
329
438
  declare module '@layerfi/components/components/BankTransactions/index' {
330
439
  export { BankTransactions } from '@layerfi/components/components/BankTransactions/BankTransactions';
331
440
 
441
+ }
442
+ declare module '@layerfi/components/components/Button/BackButton' {
443
+ import React, { ButtonHTMLAttributes } from 'react';
444
+ export interface BackButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
445
+ textOnly?: boolean;
446
+ }
447
+ export const BackButton: ({ className, children, textOnly, ...props }: BackButtonProps) => React.JSX.Element;
448
+
332
449
  }
333
450
  declare module '@layerfi/components/components/Button/Button' {
334
451
  import React, { ButtonHTMLAttributes, ReactNode } from 'react';
@@ -397,25 +514,20 @@ declare module '@layerfi/components/components/Button/index' {
397
514
  export { RetryButton } from '@layerfi/components/components/Button/RetryButton';
398
515
  export { SubmitButton } from '@layerfi/components/components/Button/SubmitButton';
399
516
  export { TextButton } from '@layerfi/components/components/Button/TextButton';
517
+ export { BackButton } from '@layerfi/components/components/Button/BackButton';
400
518
 
401
519
  }
402
- declare module '@layerfi/components/components/CategoryMenu/CategoryMenu' {
403
- import React from 'react';
404
- import { BankTransaction, Category } from '@layerfi/components/types';
405
- type Props = {
406
- name?: string;
407
- bankTransaction: BankTransaction;
408
- value: Category | undefined;
409
- onChange: (newValue: Category) => void;
410
- disabled?: boolean;
520
+ declare module '@layerfi/components/components/Card/Card' {
521
+ import React, { ReactNode } from 'react';
522
+ export interface CardProps {
523
+ children: ReactNode;
411
524
  className?: string;
412
- };
413
- export const CategoryMenu: ({ bankTransaction, name, value, onChange, disabled, className, }: Props) => React.JSX.Element;
414
- export {};
525
+ }
526
+ export const Card: ({ children, className }: CardProps) => React.JSX.Element;
415
527
 
416
528
  }
417
- declare module '@layerfi/components/components/CategoryMenu/index' {
418
- export { CategoryMenu } from '@layerfi/components/components/CategoryMenu/CategoryMenu';
529
+ declare module '@layerfi/components/components/Card/index' {
530
+ export { Card } from '@layerfi/components/components/Card/Card';
419
531
 
420
532
  }
421
533
  declare module '@layerfi/components/components/CategorySelect/CategorySelect' {
@@ -461,6 +573,121 @@ declare module '@layerfi/components/components/CategorySelect/CategorySelect' {
461
573
  declare module '@layerfi/components/components/CategorySelect/index' {
462
574
  export { CategorySelect } from '@layerfi/components/components/CategorySelect/CategorySelect';
463
575
 
576
+ }
577
+ declare module '@layerfi/components/components/ChartOfAccounts/ChartOfAccounts' {
578
+ import React from 'react';
579
+ import { useChartOfAccounts } from '@layerfi/components/hooks/useChartOfAccounts/index';
580
+ import { useLedgerAccounts } from '@layerfi/components/hooks/useLedgerAccounts/index';
581
+ export type View = 'mobile' | 'tablet' | 'desktop';
582
+ export interface ChartOfAccountsProps {
583
+ asWidget?: boolean;
584
+ }
585
+ export type ChartOfAccountsContextType = ReturnType<typeof useChartOfAccounts>;
586
+ export const ChartOfAccountsContext: React.Context<{
587
+ data: import("@layerfi/components/types").ChartOfAccounts | undefined;
588
+ isLoading?: boolean | undefined;
589
+ isValidating?: boolean | undefined;
590
+ error?: unknown;
591
+ refetch: () => void;
592
+ create: (newAccount: import("@layerfi/components/types").NewAccount) => void;
593
+ form?: import("@layerfi/components/hooks/useChartOfAccounts/useChartOfAccounts").ChartOfAccountsForm | undefined;
594
+ sendingForm?: boolean | undefined;
595
+ apiError?: string | undefined;
596
+ addAccount: () => void;
597
+ editAccount: (id: string) => void;
598
+ cancelForm: () => void;
599
+ changeFormData: (name: string, value: string | import("@layerfi/components/types/general").BaseSelectOption | undefined) => void;
600
+ submitForm: () => void;
601
+ }>;
602
+ export type LedgerAccountsContextType = ReturnType<typeof useLedgerAccounts>;
603
+ export const LedgerAccountsContext: React.Context<{
604
+ data?: import("@layerfi/components/types").LedgerAccounts | undefined;
605
+ entryData?: import("@layerfi/components/types").LedgerAccountsEntry | undefined;
606
+ isLoading?: boolean | undefined;
607
+ isLoadingEntry?: boolean | undefined;
608
+ isValidating?: boolean | undefined;
609
+ isValidatingEntry?: boolean | undefined;
610
+ error?: unknown;
611
+ errorEntry?: unknown;
612
+ refetch: () => void;
613
+ accountId?: string | undefined;
614
+ setAccountId: (id?: string | undefined) => void;
615
+ selectedEntryId?: string | undefined;
616
+ setSelectedEntryId: (id?: string | undefined) => void;
617
+ closeSelectedEntry: () => void;
618
+ }>;
619
+ export const ChartOfAccounts: (props: ChartOfAccountsProps) => React.JSX.Element;
620
+
621
+ }
622
+ declare module '@layerfi/components/components/ChartOfAccounts/index' {
623
+ export { ChartOfAccounts, ChartOfAccountsContext, LedgerAccountsContext, View, } from '@layerfi/components/components/ChartOfAccounts/ChartOfAccounts';
624
+
625
+ }
626
+ declare module '@layerfi/components/components/ChartOfAccountsForm/ChartOfAccountsForm' {
627
+ import React from 'react';
628
+ export const ChartOfAccountsForm: () => React.JSX.Element | undefined;
629
+
630
+ }
631
+ declare module '@layerfi/components/components/ChartOfAccountsForm/constants' {
632
+ import { BaseSelectOption } from '@layerfi/components/types/general';
633
+ export const SUB_TYPE_OPTIONS: BaseSelectOption[];
634
+
635
+ }
636
+ declare module '@layerfi/components/components/ChartOfAccountsForm/index' {
637
+ export { ChartOfAccountsForm } from '@layerfi/components/components/ChartOfAccountsForm/ChartOfAccountsForm';
638
+
639
+ }
640
+ declare module '@layerfi/components/components/ChartOfAccountsForm/useParentOptions' {
641
+ import { ChartOfAccounts } from '@layerfi/components/types';
642
+ import { BaseSelectOption } from '@layerfi/components/types/general';
643
+ export const useParentOptions: (data?: ChartOfAccounts) => BaseSelectOption[];
644
+
645
+ }
646
+ declare module '@layerfi/components/components/ChartOfAccountsRow/ChartOfAccountsRow' {
647
+ import React from 'react';
648
+ import { Account } from '@layerfi/components/types';
649
+ import { View } from '@layerfi/components/components/ChartOfAccounts/ChartOfAccounts';
650
+ type ChartOfAccountsRowProps = {
651
+ account: Account;
652
+ depth?: number;
653
+ index: number;
654
+ cumulativeIndex?: number;
655
+ expanded: boolean;
656
+ acountsLength: number;
657
+ defaultOpen?: boolean;
658
+ view?: View;
659
+ };
660
+ export const ChartOfAccountsRow: ({ account, depth, index, cumulativeIndex, expanded, defaultOpen, acountsLength, view, }: ChartOfAccountsRowProps) => React.JSX.Element;
661
+ export {};
662
+
663
+ }
664
+ declare module '@layerfi/components/components/ChartOfAccountsRow/index' {
665
+ export { ChartOfAccountsRow } from '@layerfi/components/components/ChartOfAccountsRow/ChartOfAccountsRow';
666
+
667
+ }
668
+ declare module '@layerfi/components/components/ChartOfAccountsSidebar/ChartOfAccountsSidebar' {
669
+ import React, { RefObject } from 'react';
670
+ export const ChartOfAccountsSidebar: ({ parentRef: _parentRef, }: {
671
+ parentRef?: RefObject<HTMLDivElement>;
672
+ }) => React.JSX.Element;
673
+
674
+ }
675
+ declare module '@layerfi/components/components/ChartOfAccountsSidebar/index' {
676
+ export { ChartOfAccountsSidebar } from '@layerfi/components/components/ChartOfAccountsSidebar/ChartOfAccountsSidebar';
677
+
678
+ }
679
+ declare module '@layerfi/components/components/ChartOfAccountsTable/ChartOfAccountsTable' {
680
+ import React, { RefObject } from 'react';
681
+ import { View } from '@layerfi/components/components/ChartOfAccounts/index';
682
+ export const ChartOfAccountsTable: ({ view, containerRef, }: {
683
+ view: View;
684
+ containerRef: RefObject<HTMLDivElement>;
685
+ }) => React.JSX.Element;
686
+
687
+ }
688
+ declare module '@layerfi/components/components/ChartOfAccountsTable/index' {
689
+ export { ChartOfAccountsTable } from '@layerfi/components/components/ChartOfAccountsTable/ChartOfAccountsTable';
690
+
464
691
  }
465
692
  declare module '@layerfi/components/components/Container/Container' {
466
693
  import React, { ReactNode } from 'react';
@@ -468,6 +695,7 @@ declare module '@layerfi/components/components/Container/Container' {
468
695
  name: string;
469
696
  className?: string;
470
697
  asWidget?: boolean;
698
+ elevated?: boolean;
471
699
  children: ReactNode;
472
700
  }
473
701
  export const Container: React.ForwardRefExoticComponent<ContainerProps & React.RefAttributes<HTMLDivElement>>;
@@ -508,6 +736,50 @@ declare module '@layerfi/components/components/DataState/DataState' {
508
736
  declare module '@layerfi/components/components/DataState/index' {
509
737
  export { DataState, DataStateStatus } from '@layerfi/components/components/DataState/DataState';
510
738
 
739
+ }
740
+ declare module '@layerfi/components/components/DateTime/DateTime' {
741
+ import React from 'react';
742
+ interface DateTimeProps {
743
+ value: string;
744
+ format?: string;
745
+ dateFormat?: string;
746
+ timeFormat?: string;
747
+ onlyDate?: boolean;
748
+ onlyTime?: boolean;
749
+ }
750
+ export const DateTime: ({ value, format, dateFormat, timeFormat, onlyDate, onlyTime, }: DateTimeProps) => React.JSX.Element;
751
+ export {};
752
+
753
+ }
754
+ declare module '@layerfi/components/components/DateTime/index' {
755
+ export { DateTime } from '@layerfi/components/components/DateTime/DateTime';
756
+
757
+ }
758
+ declare module '@layerfi/components/components/DetailsList/DetailsList' {
759
+ import React, { ReactNode } from 'react';
760
+ export interface DetailsListProps {
761
+ title?: string;
762
+ className?: string;
763
+ children: ReactNode;
764
+ actions?: ReactNode;
765
+ }
766
+ export const DetailsList: ({ title, children, className, actions, }: DetailsListProps) => React.JSX.Element;
767
+
768
+ }
769
+ declare module '@layerfi/components/components/DetailsList/DetailsListItem' {
770
+ import React, { ReactNode } from 'react';
771
+ export interface DetailsListItemProps {
772
+ label: string;
773
+ children: ReactNode | string;
774
+ isLoading?: boolean;
775
+ }
776
+ export const DetailsListItem: ({ label, children, isLoading, }: DetailsListItemProps) => React.JSX.Element;
777
+
778
+ }
779
+ declare module '@layerfi/components/components/DetailsList/index' {
780
+ export { DetailsList } from '@layerfi/components/components/DetailsList/DetailsList';
781
+ export { DetailsListItem } from '@layerfi/components/components/DetailsList/DetailsListItem';
782
+
511
783
  }
512
784
  declare module '@layerfi/components/components/ExpandedBankTransactionRow/APIErrorNotifications' {
513
785
  import React from 'react';
@@ -526,6 +798,7 @@ declare module '@layerfi/components/components/ExpandedBankTransactionRow/Expand
526
798
  type Props = {
527
799
  bankTransaction: BankTransaction;
528
800
  isOpen?: boolean;
801
+ close: () => void;
529
802
  asListItem?: boolean;
530
803
  submitBtnText?: string;
531
804
  containerWidth?: number;
@@ -554,6 +827,24 @@ declare module '@layerfi/components/components/Hello/Hello' {
554
827
  declare module '@layerfi/components/components/Hello/index' {
555
828
  export { Hello } from '@layerfi/components/components/Hello/Hello';
556
829
 
830
+ }
831
+ declare module '@layerfi/components/components/HoverMenu/HoverMenu' {
832
+ import React, { ReactNode } from 'react';
833
+ export interface HoverMenuProps {
834
+ children: ReactNode;
835
+ config: {
836
+ name: string;
837
+ action: (plaidItemId: string, accountId: string) => void;
838
+ }[];
839
+ plaidItemId: string;
840
+ accountId: string;
841
+ }
842
+ export const HoverMenu: ({ children, config, plaidItemId, accountId, }: HoverMenuProps) => React.JSX.Element;
843
+
844
+ }
845
+ declare module '@layerfi/components/components/HoverMenu/index' {
846
+ export { HoverMenu, HoverMenuProps } from '@layerfi/components/components/HoverMenu/HoverMenu';
847
+
557
848
  }
558
849
  declare module '@layerfi/components/components/Input/FileInput' {
559
850
  import React from 'react';
@@ -597,8 +888,9 @@ declare module '@layerfi/components/components/Input/Select' {
597
888
  value?: T;
598
889
  onChange: (selected: T) => void;
599
890
  disabled?: boolean;
891
+ placeholder?: string;
600
892
  }
601
- export const Select: <T>({ name, options, className, classNamePrefix, value, onChange, disabled, }: SelectProps<T>) => React.JSX.Element;
893
+ export const Select: <T>({ name, options, className, classNamePrefix, value, onChange, disabled, placeholder, }: SelectProps<T>) => React.JSX.Element;
602
894
 
603
895
  }
604
896
  declare module '@layerfi/components/components/Input/index' {
@@ -608,78 +900,77 @@ declare module '@layerfi/components/components/Input/index' {
608
900
  export { Select } from '@layerfi/components/components/Input/Select';
609
901
 
610
902
  }
611
- declare module '@layerfi/components/components/LedgerAccounts/LedgerAccounts' {
612
- import React from 'react';
613
- import { useLedgerAccounts } from '@layerfi/components/hooks/useLedgerAccounts/index';
614
- export type LedgerAccountsContextType = ReturnType<typeof useLedgerAccounts>;
615
- export const LedgerAccountsContext: React.Context<{
616
- data: import("@layerfi/components/types").LedgerAccounts | undefined;
617
- isLoading?: boolean | undefined;
618
- isValidating?: boolean | undefined;
619
- error?: unknown;
620
- refetch: () => void;
621
- create: (newAccount: import("@layerfi/components/types").NewAccount) => void;
622
- form?: import("@layerfi/components/hooks/useLedgerAccounts/useLedgerAccounts").LedgerAccountsForm | undefined;
623
- addAccount: () => void;
624
- editAccount: (id: string) => void;
625
- cancelForm: () => void;
626
- changeFormData: (name: string, value: string | import("@layerfi/components/types/general").BaseSelectOption | undefined) => void;
627
- submitForm: () => void;
628
- showARForAccountId?: string | undefined;
629
- setShowARForAccountId: (id?: string | undefined) => void;
630
- }>;
631
- export const LedgerAccounts: () => React.JSX.Element;
632
-
633
- }
634
- declare module '@layerfi/components/components/LedgerAccounts/index' {
635
- export { LedgerAccounts } from '@layerfi/components/components/LedgerAccounts/LedgerAccounts';
903
+ declare module '@layerfi/components/components/LedgerAccount/LedgerAccountIndex' {
904
+ import React, { RefObject } from 'react';
905
+ import { View } from '@layerfi/components/components/ChartOfAccounts/ChartOfAccounts';
906
+ export interface LedgerAccountProps {
907
+ view: View;
908
+ containerRef: RefObject<HTMLDivElement>;
909
+ pageSize?: number;
910
+ }
911
+ export const LedgerAccount: ({ containerRef, pageSize, view, }: LedgerAccountProps) => React.JSX.Element;
636
912
 
637
913
  }
638
- declare module '@layerfi/components/components/LedgerAccountsForm/LedgerAccountsForm' {
914
+ declare module '@layerfi/components/components/LedgerAccount/LedgerAccountRow' {
639
915
  import React from 'react';
640
- export const LedgerAccountsForm: () => React.JSX.Element | undefined;
916
+ import { LedgerAccountsLine } from '@layerfi/components/types';
917
+ import { View } from '@layerfi/components/components/ChartOfAccounts/ChartOfAccounts';
918
+ export interface LedgerAccountRowProps {
919
+ row: LedgerAccountsLine;
920
+ index: number;
921
+ initialLoad?: boolean;
922
+ view: View;
923
+ }
924
+ export const LedgerAccountRow: ({ row, index, initialLoad, view, }: LedgerAccountRowProps) => React.JSX.Element;
641
925
 
642
926
  }
643
- declare module '@layerfi/components/components/LedgerAccountsForm/index' {
644
- export { LedgerAccountsForm } from '@layerfi/components/components/LedgerAccountsForm/LedgerAccountsForm';
927
+ declare module '@layerfi/components/components/LedgerAccount/index' {
928
+ export { LedgerAccount } from '@layerfi/components/components/LedgerAccount/LedgerAccountIndex';
645
929
 
646
930
  }
647
- declare module '@layerfi/components/components/LedgerAccountsRow/LedgerAccountsRow' {
931
+ declare module '@layerfi/components/components/LedgerAccountEntryDetails/LedgerAccountEntryDetails' {
648
932
  import React from 'react';
649
- import { Account } from '@layerfi/components/types';
650
- type LedgerAccountsRowProps = {
651
- account: Account;
652
- depth?: number;
653
- };
654
- export const LedgerAccountsRow: ({ account, depth, }: LedgerAccountsRowProps) => React.JSX.Element;
655
- export {};
933
+ export const LedgerAccountEntryDetails: () => React.JSX.Element;
656
934
 
657
935
  }
658
- declare module '@layerfi/components/components/LedgerAccountsRow/index' {
659
- export { LedgerAccountsRow } from '@layerfi/components/components/LedgerAccountsRow/LedgerAccountsRow';
936
+ declare module '@layerfi/components/components/LedgerAccountEntryDetails/index' {
937
+ export { LedgerAccountEntryDetails } from '@layerfi/components/components/LedgerAccountEntryDetails/LedgerAccountEntryDetails';
660
938
 
661
939
  }
662
- declare module '@layerfi/components/components/LedgerAccountsSidebar/LedgerAccountsSidebar' {
940
+ declare module '@layerfi/components/components/LinkedAccountOptions/LinkedAccountOptions' {
663
941
  import React from 'react';
664
- export const LedgerAccountsSidebar: () => React.JSX.Element;
942
+ import { HoverMenuProps } from '@layerfi/components/components/HoverMenu/index';
943
+ interface LinkedAccountOptionsProps extends HoverMenuProps {
944
+ }
945
+ export const LinkedAccountOptions: ({ children, config, accountId, plaidItemId, }: LinkedAccountOptionsProps) => React.JSX.Element;
946
+ export {};
665
947
 
666
948
  }
667
- declare module '@layerfi/components/components/LedgerAccountsSidebar/index' {
668
- export { LedgerAccountsSidebar } from '@layerfi/components/components/LedgerAccountsSidebar/LedgerAccountsSidebar';
949
+ declare module '@layerfi/components/components/LinkedAccountOptions/index' {
950
+ export { LinkedAccountOptions } from '@layerfi/components/components/LinkedAccountOptions/LinkedAccountOptions';
669
951
 
670
952
  }
671
- declare module '@layerfi/components/components/LinkedAccounts/LinkedAccountThumb' {
953
+ declare module '@layerfi/components/components/LinkedAccountThumb/LinkedAccountThumb' {
672
954
  import React from 'react';
673
955
  import { LinkedAccount } from '@layerfi/components/types/linked_accounts';
674
956
  export interface LinkedAccountThumbProps {
675
957
  account: LinkedAccount;
958
+ asWidget?: boolean;
676
959
  }
677
- export const LinkedAccountThumb: ({ account }: LinkedAccountThumbProps) => React.JSX.Element;
960
+ export const LinkedAccountThumb: ({ account, asWidget, }: LinkedAccountThumbProps) => React.JSX.Element;
961
+
962
+ }
963
+ declare module '@layerfi/components/components/LinkedAccountThumb/index' {
964
+ export { LinkedAccountThumb } from '@layerfi/components/components/LinkedAccountThumb/LinkedAccountThumb';
678
965
 
679
966
  }
680
967
  declare module '@layerfi/components/components/LinkedAccounts/LinkedAccounts' {
681
968
  import React from 'react';
682
- export const LinkedAccounts: () => React.JSX.Element;
969
+ export interface LinkedAccountsProps {
970
+ asWidget?: boolean;
971
+ elevated?: boolean;
972
+ }
973
+ export const LinkedAccounts: ({ asWidget, elevated }: LinkedAccountsProps) => React.JSX.Element;
683
974
 
684
975
  }
685
976
  declare module '@layerfi/components/components/LinkedAccounts/index' {
@@ -730,6 +1021,23 @@ declare module '@layerfi/components/components/Pagination/Pagination' {
730
1021
  declare module '@layerfi/components/components/Pagination/index' {
731
1022
  export { Pagination } from '@layerfi/components/components/Pagination/Pagination';
732
1023
 
1024
+ }
1025
+ declare module '@layerfi/components/components/Panel/Panel' {
1026
+ import React, { ReactNode, RefObject } from 'react';
1027
+ export interface PanelProps {
1028
+ children: ReactNode;
1029
+ className?: string;
1030
+ sidebar?: ReactNode;
1031
+ sidebarIsOpen?: boolean;
1032
+ header?: ReactNode;
1033
+ parentRef?: RefObject<HTMLDivElement>;
1034
+ }
1035
+ export const Panel: ({ children, className, sidebar, header, sidebarIsOpen, parentRef, }: PanelProps) => React.JSX.Element;
1036
+
1037
+ }
1038
+ declare module '@layerfi/components/components/Panel/index' {
1039
+ export { Panel } from '@layerfi/components/components/Panel/Panel';
1040
+
733
1041
  }
734
1042
  declare module '@layerfi/components/components/ProfitAndLoss/ProfitAndLoss' {
735
1043
  import React, { PropsWithChildren } from 'react';
@@ -740,14 +1048,17 @@ declare module '@layerfi/components/components/ProfitAndLoss/ProfitAndLoss' {
740
1048
  values: string[];
741
1049
  };
742
1050
  reportingBasis?: ReportingBasis;
1051
+ asContainer?: boolean;
743
1052
  };
744
1053
  const ProfitAndLoss: {
745
- ({ children, tagFilter, reportingBasis }: Props): React.JSX.Element;
1054
+ ({ children, tagFilter, reportingBasis, asContainer, }: Props): React.JSX.Element;
746
1055
  Chart: () => React.JSX.Element;
747
1056
  Context: React.Context<{
748
1057
  data: import("@layerfi/components/types").ProfitAndLoss | undefined;
749
- filteredData: import("@layerfi/components/types/line_item").LineBaseItem[];
750
- filteredTotal?: number | undefined;
1058
+ filteredDataRevenue: import("@layerfi/components/types/line_item").LineBaseItem[];
1059
+ filteredTotalRevenue?: number | undefined;
1060
+ filteredDataExpenses: import("@layerfi/components/types/line_item").LineBaseItem[];
1061
+ filteredTotalExpenses?: number | undefined;
751
1062
  isLoading: boolean;
752
1063
  isValidating: boolean;
753
1064
  error: unknown;
@@ -761,12 +1072,19 @@ declare module '@layerfi/components/components/ProfitAndLoss/ProfitAndLoss' {
761
1072
  setFilterTypes: (scope: import("@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss").Scope, types: string[]) => void;
762
1073
  }>;
763
1074
  DatePicker: () => React.JSX.Element;
764
- Summaries: ({ vertical, revenueLabel, }: {
1075
+ Summaries: ({ vertical, revenueLabel, actionable, }: {
765
1076
  revenueLabel?: string | undefined;
766
1077
  vertical?: boolean | undefined;
1078
+ actionable?: boolean | undefined;
767
1079
  }) => React.JSX.Element;
768
- Table: ({ lockExpanded }: {
1080
+ Table: ({ lockExpanded, asContainer }: {
769
1081
  lockExpanded?: boolean | undefined;
1082
+ asContainer?: boolean | undefined;
1083
+ }) => React.JSX.Element;
1084
+ DetailedCharts: ({ scope, hideClose, showDatePicker, }: {
1085
+ scope?: import("@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss").SidebarScope;
1086
+ hideClose?: boolean | undefined;
1087
+ showDatePicker?: boolean | undefined;
770
1088
  }) => React.JSX.Element;
771
1089
  };
772
1090
  export { ProfitAndLoss };
@@ -816,8 +1134,9 @@ declare module '@layerfi/components/components/ProfitAndLossDetailedCharts/Detai
816
1134
  setHoveredItem: (name?: string) => void;
817
1135
  sidebarScope?: SidebarScope;
818
1136
  date: number | Date;
1137
+ isLoading?: boolean;
819
1138
  }
820
- export const DetailedChart: ({ filteredData, filteredTotal, hoveredItem, setHoveredItem, sidebarScope, date, }: DetailedChartProps) => React.JSX.Element;
1139
+ export const DetailedChart: ({ filteredData, filteredTotal, hoveredItem, setHoveredItem, sidebarScope, date, isLoading, }: DetailedChartProps) => React.JSX.Element;
821
1140
  export {};
822
1141
 
823
1142
  }
@@ -852,7 +1171,12 @@ declare module '@layerfi/components/components/ProfitAndLossDetailedCharts/Filte
852
1171
  }
853
1172
  declare module '@layerfi/components/components/ProfitAndLossDetailedCharts/ProfitAndLossDetailedCharts' {
854
1173
  import React from 'react';
855
- export const ProfitAndLossDetailedCharts: () => React.JSX.Element;
1174
+ import { SidebarScope } from '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss';
1175
+ export const ProfitAndLossDetailedCharts: ({ scope, hideClose, showDatePicker, }: {
1176
+ scope?: SidebarScope;
1177
+ hideClose?: boolean | undefined;
1178
+ showDatePicker?: boolean | undefined;
1179
+ }) => React.JSX.Element;
856
1180
 
857
1181
  }
858
1182
  declare module '@layerfi/components/components/ProfitAndLossDetailedCharts/index' {
@@ -895,8 +1219,9 @@ declare module '@layerfi/components/components/ProfitAndLossSummaries/ProfitAndL
895
1219
  type Props = {
896
1220
  revenueLabel?: string;
897
1221
  vertical?: boolean;
1222
+ actionable?: boolean;
898
1223
  };
899
- export const ProfitAndLossSummaries: ({ vertical, revenueLabel, }: Props) => React.JSX.Element;
1224
+ export const ProfitAndLossSummaries: ({ vertical, revenueLabel, actionable, }: Props) => React.JSX.Element;
900
1225
  export {};
901
1226
 
902
1227
  }
@@ -908,8 +1233,9 @@ declare module '@layerfi/components/components/ProfitAndLossTable/ProfitAndLossT
908
1233
  import React from 'react';
909
1234
  type Props = {
910
1235
  lockExpanded?: boolean;
1236
+ asContainer?: boolean;
911
1237
  };
912
- export const ProfitAndLossTable: ({ lockExpanded }: Props) => React.JSX.Element;
1238
+ export const ProfitAndLossTable: ({ lockExpanded, asContainer }: Props) => React.JSX.Element;
913
1239
  export {};
914
1240
 
915
1241
  }
@@ -924,12 +1250,15 @@ declare module '@layerfi/components/components/ProfitAndLossTable/index' {
924
1250
 
925
1251
  }
926
1252
  declare module '@layerfi/components/components/ProfitAndLossView/ProfitAndLossView' {
927
- import React from 'react';
1253
+ import React, { RefObject } from 'react';
928
1254
  export interface ProfitAndLossViewProps {
929
1255
  hideTable?: boolean;
930
1256
  hideChart?: boolean;
931
1257
  showDetailedCharts?: boolean;
932
1258
  }
1259
+ export interface ProfitAndLossViewPanelProps extends ProfitAndLossViewProps {
1260
+ containerRef: RefObject<HTMLDivElement>;
1261
+ }
933
1262
  export const ProfitAndLossView: (props: ProfitAndLossViewProps) => React.JSX.Element;
934
1263
 
935
1264
  }
@@ -977,6 +1306,7 @@ declare module '@layerfi/components/components/Toggle/Toggle' {
977
1306
  label: string;
978
1307
  value: string;
979
1308
  disabled?: boolean;
1309
+ disabledMessage?: string;
980
1310
  leftIcon?: ReactNode;
981
1311
  }
982
1312
  export enum ToggleSize {
@@ -1193,6 +1523,33 @@ declare module '@layerfi/components/components/Typography/index' {
1193
1523
  export { Heading, HeadingSize } from '@layerfi/components/components/Typography/Heading';
1194
1524
  export { ErrorText } from '@layerfi/components/components/Typography/ErrorText';
1195
1525
 
1526
+ }
1527
+ declare module '@layerfi/components/components/View/View' {
1528
+ import React, { ReactNode } from 'react';
1529
+ export interface ViewProps {
1530
+ children: ReactNode;
1531
+ title?: string;
1532
+ headerControls?: ReactNode;
1533
+ }
1534
+ export const View: ({ title, children, headerControls }: ViewProps) => React.JSX.Element;
1535
+
1536
+ }
1537
+ declare module '@layerfi/components/components/View/index' {
1538
+ export { View } from '@layerfi/components/components/View/View';
1539
+
1540
+ }
1541
+ declare module '@layerfi/components/components/ViewHeader/ViewHeader' {
1542
+ import React, { ReactNode } from 'react';
1543
+ export interface ViewHeaderProps {
1544
+ title?: string;
1545
+ controls?: ReactNode;
1546
+ }
1547
+ export const ViewHeader: ({ title, controls }: ViewHeaderProps) => React.JSX.Element;
1548
+
1549
+ }
1550
+ declare module '@layerfi/components/components/ViewHeader/index' {
1551
+ export { ViewHeader } from '@layerfi/components/components/ViewHeader/ViewHeader';
1552
+
1196
1553
  }
1197
1554
  declare module '@layerfi/components/config/charts' {
1198
1555
  export const INACTIVE_OPACITY_LEVELS: number[];
@@ -1204,6 +1561,11 @@ declare module '@layerfi/components/config/charts' {
1204
1561
  }
1205
1562
  declare module '@layerfi/components/config/general' {
1206
1563
  export const DATE_FORMAT = "LLL d, yyyy";
1564
+ export const TIME_FORMAT = "p";
1565
+ export const BREAKPOINTS: {
1566
+ TABLET: number;
1567
+ MOBILE: number;
1568
+ };
1207
1569
 
1208
1570
  }
1209
1571
  declare module '@layerfi/components/config/theme' {
@@ -1307,6 +1669,50 @@ declare module '@layerfi/components/hooks/useBankTransactions/useBankTransaction
1307
1669
  export const useBankTransactions: UseBankTransactions;
1308
1670
  export {};
1309
1671
 
1672
+ }
1673
+ declare module '@layerfi/components/hooks/useChartOfAccounts/index' {
1674
+ export { useChartOfAccounts } from '@layerfi/components/hooks/useChartOfAccounts/useChartOfAccounts';
1675
+
1676
+ }
1677
+ declare module '@layerfi/components/hooks/useChartOfAccounts/useChartOfAccounts' {
1678
+ import { Account, ChartOfAccounts, NewAccount } from '@layerfi/components/types';
1679
+ import { BaseSelectOption } from '@layerfi/components/types/general';
1680
+ interface FormError {
1681
+ field: string;
1682
+ message: string;
1683
+ }
1684
+ export interface ChartOfAccountsForm {
1685
+ action: 'new' | 'edit';
1686
+ accountId?: string;
1687
+ data: {
1688
+ parent?: BaseSelectOption;
1689
+ name?: string;
1690
+ type?: BaseSelectOption;
1691
+ subType?: BaseSelectOption;
1692
+ category?: BaseSelectOption;
1693
+ };
1694
+ errors?: FormError[];
1695
+ }
1696
+ type UseChartOfAccounts = () => {
1697
+ data: ChartOfAccounts | undefined;
1698
+ isLoading?: boolean;
1699
+ isValidating?: boolean;
1700
+ error?: unknown;
1701
+ refetch: () => void;
1702
+ create: (newAccount: NewAccount) => void;
1703
+ form?: ChartOfAccountsForm;
1704
+ sendingForm?: boolean;
1705
+ apiError?: string;
1706
+ addAccount: () => void;
1707
+ editAccount: (id: string) => void;
1708
+ cancelForm: () => void;
1709
+ changeFormData: (name: string, value: string | BaseSelectOption | undefined) => void;
1710
+ submitForm: () => void;
1711
+ };
1712
+ export const flattenAccounts: (accounts: Account[]) => Account[];
1713
+ export const useChartOfAccounts: UseChartOfAccounts;
1714
+ export {};
1715
+
1310
1716
  }
1311
1717
  declare module '@layerfi/components/hooks/useElementSize/index' {
1312
1718
  export { useElementSize } from '@layerfi/components/hooks/useElementSize/useElementSize';
@@ -1317,6 +1723,8 @@ declare module '@layerfi/components/hooks/useElementSize/useElementSize' {
1317
1723
  export const useElementSize: <T extends HTMLElement>(callback: (target: T, entry: ResizeObserverEntry, size: {
1318
1724
  width: number;
1319
1725
  height: number;
1726
+ clientWidth: number;
1727
+ clientHeight: number;
1320
1728
  }) => void) => import("react").RefObject<T>;
1321
1729
 
1322
1730
  }
@@ -1335,36 +1743,23 @@ declare module '@layerfi/components/hooks/useLedgerAccounts/index' {
1335
1743
 
1336
1744
  }
1337
1745
  declare module '@layerfi/components/hooks/useLedgerAccounts/useLedgerAccounts' {
1338
- import { Account, LedgerAccounts, NewAccount } from '@layerfi/components/types';
1339
- import { BaseSelectOption } from '@layerfi/components/types/general';
1340
- export interface LedgerAccountsForm {
1341
- action: 'new' | 'edit';
1342
- accountId?: string;
1343
- data: {
1344
- parent?: BaseSelectOption;
1345
- name?: string;
1346
- type?: BaseSelectOption;
1347
- subType?: BaseSelectOption;
1348
- category?: BaseSelectOption;
1349
- };
1350
- }
1746
+ import { LedgerAccounts, LedgerAccountsEntry } from '@layerfi/components/types';
1351
1747
  type UseLedgerAccounts = () => {
1352
- data: LedgerAccounts | undefined;
1748
+ data?: LedgerAccounts;
1749
+ entryData?: LedgerAccountsEntry;
1353
1750
  isLoading?: boolean;
1751
+ isLoadingEntry?: boolean;
1354
1752
  isValidating?: boolean;
1753
+ isValidatingEntry?: boolean;
1355
1754
  error?: unknown;
1755
+ errorEntry?: unknown;
1356
1756
  refetch: () => void;
1357
- create: (newAccount: NewAccount) => void;
1358
- form?: LedgerAccountsForm;
1359
- addAccount: () => void;
1360
- editAccount: (id: string) => void;
1361
- cancelForm: () => void;
1362
- changeFormData: (name: string, value: string | BaseSelectOption | undefined) => void;
1363
- submitForm: () => void;
1364
- showARForAccountId?: string;
1365
- setShowARForAccountId: (id?: string) => void;
1757
+ accountId?: string;
1758
+ setAccountId: (id?: string) => void;
1759
+ selectedEntryId?: string;
1760
+ setSelectedEntryId: (id?: string) => void;
1761
+ closeSelectedEntry: () => void;
1366
1762
  };
1367
- export const flattenAccounts: (accounts: Account[]) => Account[];
1368
1763
  export const useLedgerAccounts: UseLedgerAccounts;
1369
1764
  export {};
1370
1765
 
@@ -1372,17 +1767,25 @@ declare module '@layerfi/components/hooks/useLedgerAccounts/useLedgerAccounts' {
1372
1767
  declare module '@layerfi/components/hooks/useLinkedAccounts/index' {
1373
1768
  export { useLinkedAccounts } from '@layerfi/components/hooks/useLinkedAccounts/useLinkedAccounts';
1374
1769
 
1770
+ }
1771
+ declare module '@layerfi/components/hooks/useLinkedAccounts/mockData' {
1772
+ import { LinkedAccount } from '@layerfi/components/types/linked_accounts';
1773
+ export const LINKED_ACCOUNTS_MOCK_DATA: LinkedAccount[];
1774
+
1375
1775
  }
1376
1776
  declare module '@layerfi/components/hooks/useLinkedAccounts/useLinkedAccounts' {
1377
- import { Metadata } from '@layerfi/components/types';
1378
1777
  import { LinkedAccount } from '@layerfi/components/types/linked_accounts';
1778
+ type Source = 'PLAID' | 'STRIPE';
1379
1779
  type UseLinkedAccounts = () => {
1380
1780
  data?: LinkedAccount[];
1381
- metadata: Metadata;
1382
1781
  isLoading: boolean;
1383
1782
  isValidating: boolean;
1384
1783
  error: unknown;
1385
- refetch: () => void;
1784
+ addConnection: (source: Source) => void;
1785
+ removeConnection: (source: Source, sourceId: string) => void;
1786
+ refetchAccounts: () => void;
1787
+ unlinkAccount: (plaidAccountId: string) => void;
1788
+ renewLinkAccount: () => void;
1386
1789
  };
1387
1790
  export const useLinkedAccounts: UseLinkedAccounts;
1388
1791
  export {};
@@ -1430,8 +1833,10 @@ declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss' {
1430
1833
  export type ProfitAndLossFilters = Record<Scope, ProfitAndLossFilter | undefined>;
1431
1834
  type UseProfitAndLoss = (props?: Props) => {
1432
1835
  data: ProfitAndLoss | undefined;
1433
- filteredData: LineBaseItem[];
1434
- filteredTotal?: number;
1836
+ filteredDataRevenue: LineBaseItem[];
1837
+ filteredTotalRevenue?: number;
1838
+ filteredDataExpenses: LineBaseItem[];
1839
+ filteredTotalExpenses?: number;
1435
1840
  isLoading: boolean;
1436
1841
  isValidating: boolean;
1437
1842
  error: unknown;
@@ -1462,11 +1867,11 @@ declare module '@layerfi/components/icons/AlertOctagon' {
1462
1867
  export default AlertOctagon;
1463
1868
 
1464
1869
  }
1465
- declare module '@layerfi/components/icons/ArrowRightCircle' {
1870
+ declare module '@layerfi/components/icons/BackArrow' {
1466
1871
  import * as React from 'react';
1467
1872
  import { IconSvgProps } from '@layerfi/components/icons/types';
1468
- const ArrowRightCircle: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1469
- export default ArrowRightCircle;
1873
+ const BackArrow: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1874
+ export default BackArrow;
1470
1875
 
1471
1876
  }
1472
1877
  declare module '@layerfi/components/icons/Calendar' {
@@ -1531,6 +1936,13 @@ declare module '@layerfi/components/icons/Edit2' {
1531
1936
  const Edit2: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1532
1937
  export default Edit2;
1533
1938
 
1939
+ }
1940
+ declare module '@layerfi/components/icons/InstitutionIcon' {
1941
+ import * as React from 'react';
1942
+ import { IconSvgProps } from '@layerfi/components/icons/types';
1943
+ const InstitutionIcon: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1944
+ export default InstitutionIcon;
1945
+
1534
1946
  }
1535
1947
  declare module '@layerfi/components/icons/Loader' {
1536
1948
  import * as React from 'react';
@@ -1545,6 +1957,13 @@ declare module '@layerfi/components/icons/MinimizeTwo' {
1545
1957
  const MinimizeTwo: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1546
1958
  export default MinimizeTwo;
1547
1959
 
1960
+ }
1961
+ declare module '@layerfi/components/icons/MoreVertical' {
1962
+ import React from 'react';
1963
+ import { IconSvgProps } from '@layerfi/components/icons/types';
1964
+ const MoreVertical: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1965
+ export default MoreVertical;
1966
+
1548
1967
  }
1549
1968
  declare module '@layerfi/components/icons/PieChart' {
1550
1969
  import * as React from 'react';
@@ -1552,6 +1971,13 @@ declare module '@layerfi/components/icons/PieChart' {
1552
1971
  const PieChart: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1553
1972
  export default PieChart;
1554
1973
 
1974
+ }
1975
+ declare module '@layerfi/components/icons/PlusIcon' {
1976
+ import * as React from 'react';
1977
+ import { IconSvgProps } from '@layerfi/components/icons/types';
1978
+ const PlusIcon: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1979
+ export default PlusIcon;
1980
+
1555
1981
  }
1556
1982
  declare module '@layerfi/components/icons/RefreshCcw' {
1557
1983
  import * as React from 'react';
@@ -1623,8 +2049,12 @@ declare module '@layerfi/components/index' {
1623
2049
  export { LinkedAccounts } from '@layerfi/components/components/LinkedAccounts/index';
1624
2050
  export { ProfitAndLoss } from '@layerfi/components/components/ProfitAndLoss/index';
1625
2051
  export { ProfitAndLossView } from '@layerfi/components/components/ProfitAndLossView/index';
1626
- export { LedgerAccounts } from '@layerfi/components/components/LedgerAccounts/index';
2052
+ export { ChartOfAccounts } from '@layerfi/components/components/ChartOfAccounts/index';
1627
2053
  export { LayerProvider } from '@layerfi/components/providers/LayerProvider/index';
2054
+ export { useLayerContext } from '@layerfi/components/hooks/useLayerContext/index';
2055
+ export { AccountingOverview } from '@layerfi/components/views/AccountingOverview/index';
2056
+ export { BankTransactionsWithLinkedAccounts } from '@layerfi/components/views/BankTransactionsWithLinkedAccounts/index';
2057
+ export { Reports } from '@layerfi/components/views/Reports/index';
1628
2058
 
1629
2059
  }
1630
2060
  declare module '@layerfi/components/models/APIError' {
@@ -1826,6 +2256,62 @@ declare module '@layerfi/components/types/categories' {
1826
2256
  export type CategoryUpdate = SingleCategoryUpdate | SplitCategoryUpdate;
1827
2257
  export function hasSuggestions(categorization: Categorization): categorization is SuggestedCategorization;
1828
2258
 
2259
+ }
2260
+ declare module '@layerfi/components/types/chart_of_accounts' {
2261
+ import { Direction } from '@layerfi/components/types/bank_transactions';
2262
+ import { Category } from '@layerfi/components/types/categories';
2263
+ export interface ChartOfAccounts {
2264
+ type: string;
2265
+ accounts: Account[];
2266
+ entries?: any[];
2267
+ }
2268
+ export interface AccountEntry {
2269
+ account: Account;
2270
+ amount?: number;
2271
+ createdAt?: string;
2272
+ direction: Direction;
2273
+ entry_at?: string;
2274
+ entry_id?: string;
2275
+ id?: string;
2276
+ }
2277
+ export interface Account {
2278
+ id: string;
2279
+ number: number;
2280
+ pnlCategory?: Category;
2281
+ headerForPnlCategory?: Category;
2282
+ name: string;
2283
+ accountStableName?: string;
2284
+ description?: string;
2285
+ scheduleCLine?: string;
2286
+ scheduleCLineDescription?: string;
2287
+ sub_accounts?: Account[];
2288
+ hidePnl: boolean;
2289
+ showInPnlIfEmpty: boolean;
2290
+ normality: Direction;
2291
+ balance: number;
2292
+ selfOnlyBalance: number;
2293
+ entries?: AccountEntry[];
2294
+ }
2295
+ export type NewAccount = {
2296
+ name: string;
2297
+ normality: Direction;
2298
+ parent_id?: {
2299
+ type: 'AccountId';
2300
+ id: string;
2301
+ };
2302
+ description: string;
2303
+ };
2304
+ export type EditAccount = {
2305
+ name: string;
2306
+ stable_name: string;
2307
+ normality: Direction;
2308
+ parent_id?: {
2309
+ type: 'AccountId';
2310
+ id: string;
2311
+ };
2312
+ description: string;
2313
+ };
2314
+
1829
2315
  }
1830
2316
  declare module '@layerfi/components/types/general' {
1831
2317
  export type SortDirection = 'asc' | 'desc';
@@ -1848,6 +2334,9 @@ declare module '@layerfi/components/types/layer_context' {
1848
2334
  };
1849
2335
  export type LayerContextHelpers = {
1850
2336
  getColor: (shade: number) => ColorsPaletteOption | undefined;
2337
+ setLightColor: (color?: ColorConfig) => void;
2338
+ setDarkColor: (color?: ColorConfig) => void;
2339
+ setColors: (colors?: LayerThemeConfigColors) => void;
1851
2340
  };
1852
2341
  export interface ColorHSLConfig {
1853
2342
  h: string;
@@ -1879,11 +2368,12 @@ declare module '@layerfi/components/types/layer_context' {
1879
2368
  hex: string;
1880
2369
  }
1881
2370
  export type ColorsPalette = Record<number, ColorsPaletteOption>;
2371
+ export interface LayerThemeConfigColors {
2372
+ dark?: ColorConfig;
2373
+ light?: ColorConfig;
2374
+ }
1882
2375
  export interface LayerThemeConfig {
1883
- colors?: {
1884
- dark?: ColorConfig;
1885
- light?: ColorConfig;
1886
- };
2376
+ colors?: LayerThemeConfigColors;
1887
2377
  }
1888
2378
  export enum LayerContextActionName {
1889
2379
  setAuth = "LayerContext.setAuth",
@@ -1909,56 +2399,52 @@ declare module '@layerfi/components/types/layer_context' {
1909
2399
 
1910
2400
  }
1911
2401
  declare module '@layerfi/components/types/ledger_accounts' {
1912
- import { Direction } from '@layerfi/components/types/bank_transactions';
1913
- import { Category } from '@layerfi/components/types/categories';
1914
- export interface LedgerAccounts {
1915
- name: string;
1916
- accounts: Account[];
2402
+ import { BankTransaction, Direction } from '@layerfi/components/types/bank_transactions';
2403
+ export type LedgerAccounts = LedgerAccountsLine[];
2404
+ export interface LedgerAccountsEntry {
2405
+ agent?: string;
2406
+ business_id: string;
2407
+ date: string;
2408
+ entry_at: string;
2409
+ entry_type: string;
2410
+ id: string;
2411
+ invoice?: Record<string, string>;
2412
+ ledger_id: string;
2413
+ line_items: LedgerAccountLineItem[];
2414
+ manual_entry?: boolean;
2415
+ reversal_id?: string;
2416
+ reversal_of_id?: string;
2417
+ type: string;
2418
+ transaction?: BankTransaction;
1917
2419
  }
1918
- export interface AccountEntry {
1919
- account: Account;
1920
- amount?: number;
1921
- createdAt?: string;
2420
+ export interface LedgerAccountsLine {
2421
+ type: string;
2422
+ id: string;
2423
+ entry_id: string;
2424
+ account: LedgerAccountsAccount;
2425
+ amount: number;
1922
2426
  direction: Direction;
1923
- entry_at?: string;
1924
- entry_id?: string;
1925
- id?: string;
2427
+ date: string;
2428
+ transaction?: BankTransaction;
2429
+ invoice: string | null;
1926
2430
  }
1927
- export interface Account {
2431
+ export interface LedgerAccountsAccount {
2432
+ always_show_in_pnl?: boolean;
1928
2433
  id: string;
1929
- number: number;
1930
- pnlCategory?: Category;
1931
- headerForPnlCategory?: Category;
1932
2434
  name: string;
1933
- accountStableName?: string;
1934
- description?: string;
1935
- scheduleCLine?: string;
1936
- scheduleCLineDescription?: string;
1937
- sub_accounts?: Account[];
1938
- hidePnl: boolean;
1939
- showInPnlIfEmpty: boolean;
1940
- normality: Direction;
1941
- balance: number;
1942
- selfOnlyBalance: number;
1943
- entries?: AccountEntry[];
2435
+ normality: string;
2436
+ pnl_category?: string;
2437
+ stable_name: string;
1944
2438
  }
1945
- export interface AccountAlternate {
1946
- type: 'Ledger_Account';
2439
+ export interface LedgerAccountLineItem {
2440
+ account?: LedgerAccountsAccount;
2441
+ amount: number;
2442
+ createdAt: string;
2443
+ direction: Direction;
2444
+ entry_at: string;
2445
+ entry_id: string;
1947
2446
  id: string;
1948
- name: string;
1949
- stable_name: string | null;
1950
- normality: Direction;
1951
- pnl_category: string | null;
1952
2447
  }
1953
- export type NewAccount = {
1954
- name: string;
1955
- normality: Direction;
1956
- parent_id?: {
1957
- type: 'AccountId';
1958
- id: string;
1959
- };
1960
- description: string;
1961
- };
1962
2448
 
1963
2449
  }
1964
2450
  declare module '@layerfi/components/types/line_item' {
@@ -1980,11 +2466,33 @@ declare module '@layerfi/components/types/line_item' {
1980
2466
 
1981
2467
  }
1982
2468
  declare module '@layerfi/components/types/linked_accounts' {
2469
+ import { PlaidInstitution } from 'react-plaid-link';
2470
+ export interface LinkedAccounts {
2471
+ type: string;
2472
+ external_accounts: LinkedAccount[];
2473
+ }
1983
2474
  export interface LinkedAccount {
1984
- name: string;
1985
- account: string;
1986
- amount: number;
2475
+ id: string;
2476
+ external_account_external_id: string;
2477
+ external_account_source: string;
2478
+ external_account_name: string;
2479
+ latest_balance_timestamp: {
2480
+ external_account_external_id: string;
2481
+ external_account_source: string;
2482
+ balance: number;
2483
+ at: string;
2484
+ created_at: string;
2485
+ };
2486
+ current_ledger_balance: number;
2487
+ institution: {
2488
+ name: string;
2489
+ logo: string;
2490
+ };
1987
2491
  }
2492
+ export type PublicToken = {
2493
+ public_token: string;
2494
+ institution_id: PlaidInstitution | null;
2495
+ };
1988
2496
 
1989
2497
  }
1990
2498
  declare module '@layerfi/components/types/profit_and_loss' {
@@ -2016,7 +2524,8 @@ declare module '@layerfi/components/types' {
2016
2524
  export { BalanceSheet } from '@layerfi/components/types/balance_sheet';
2017
2525
  export { Direction, BankTransaction } from '@layerfi/components/types/bank_transactions';
2018
2526
  export { CategorizationStatus, Category, CategorizationType, AutoCategorization, SuggestedCategorization, SingleCategoryUpdate, SplitCategoryUpdate, CategoryUpdate, } from '@layerfi/components/types/categories';
2019
- export { AccountAlternate, LedgerAccounts, Account, NewAccount, } from '@layerfi/components/types/ledger_accounts';
2527
+ export { ChartOfAccounts, Account, NewAccount, EditAccount, } from '@layerfi/components/types/chart_of_accounts';
2528
+ export { LedgerAccounts, LedgerAccountsLine, LedgerAccountsAccount, LedgerAccountsEntry, } from '@layerfi/components/types/ledger_accounts';
2020
2529
  export { SortDirection } from '@layerfi/components/types/general';
2021
2530
  export type DateRange<T = Date> = {
2022
2531
  startDate: T;
@@ -2053,12 +2562,20 @@ declare module '@layerfi/components/utils/format' {
2053
2562
  * 0.00123 -> 0.12%
2054
2563
  */
2055
2564
  export const formatPercent: (value?: number, options?: Intl.NumberFormatOptions) => string | undefined;
2565
+ /**
2566
+ * Convert Enum-like (upper snakecase) text into human friendly format.
2567
+ */
2568
+ export const humanizeEnum: (text: string) => string;
2056
2569
 
2057
2570
  }
2058
2571
  declare module '@layerfi/components/utils/helpers' {
2059
2572
  export const range: (start: number, end: number) => number[];
2060
2573
  export const debounce: <F extends (...args: Parameters<F>) => ReturnType<F>>(fnc: F, timeout?: number) => (...args: Parameters<F>) => void;
2061
2574
  export const sleep: (time: number) => Promise<unknown>;
2575
+ /**
2576
+ * Convert the account name into stable_name
2577
+ */
2578
+ export const convertToStableName: (name: string) => string;
2062
2579
 
2063
2580
  }
2064
2581
  declare module '@layerfi/components/utils/profitAndLossUtils' {
@@ -2070,6 +2587,45 @@ declare module '@layerfi/components/utils/profitAndLossUtils' {
2070
2587
  export const humanizeTitle: (sidebarView: SidebarScope) => "Expenses" | "Revenue" | "Profit & Loss";
2071
2588
  export const applyShare: (items: LineBaseItem[], total: number) => LineBaseItem[];
2072
2589
 
2590
+ }
2591
+ declare module '@layerfi/components/views/AccountingOverview/AccountingOverview' {
2592
+ import React from 'react';
2593
+ export interface AccountingOverviewProps {
2594
+ title?: string;
2595
+ }
2596
+ export const AccountingOverview: ({ title, }: AccountingOverviewProps) => React.JSX.Element;
2597
+
2598
+ }
2599
+ declare module '@layerfi/components/views/AccountingOverview/index' {
2600
+ export { AccountingOverview } from '@layerfi/components/views/AccountingOverview/AccountingOverview';
2601
+
2602
+ }
2603
+ declare module '@layerfi/components/views/BankTransactionsWithLinkedAccounts/BankTransactionsWithLinkedAccounts' {
2604
+ import React from 'react';
2605
+ export interface BankTransactionsWithLinkedAccountsProps {
2606
+ title?: string;
2607
+ }
2608
+ export const BankTransactionsWithLinkedAccounts: ({ title, }: BankTransactionsWithLinkedAccountsProps) => React.JSX.Element;
2609
+
2610
+ }
2611
+ declare module '@layerfi/components/views/BankTransactionsWithLinkedAccounts/index' {
2612
+ export { BankTransactionsWithLinkedAccounts } from '@layerfi/components/views/BankTransactionsWithLinkedAccounts/BankTransactionsWithLinkedAccounts';
2613
+
2614
+ }
2615
+ declare module '@layerfi/components/views/Reports/Reports' {
2616
+ import React, { RefObject } from 'react';
2617
+ export interface ReportsProps {
2618
+ title?: string;
2619
+ }
2620
+ export interface ReportsPanelProps {
2621
+ containerRef: RefObject<HTMLDivElement>;
2622
+ }
2623
+ export const Reports: ({ title }: ReportsProps) => React.JSX.Element;
2624
+
2625
+ }
2626
+ declare module '@layerfi/components/views/Reports/index' {
2627
+ export { Reports } from '@layerfi/components/views/Reports/Reports';
2628
+
2073
2629
  }
2074
2630
  declare module '@layerfi/components' {
2075
2631
  import main = require('@layerfi/components/index');