@layerfi/components 0.1.4 → 0.1.6

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
@@ -42,6 +42,7 @@ declare module '@layerfi/components/api/layer/balance_sheet' {
42
42
  }
43
43
  declare module '@layerfi/components/api/layer/bankTransactions' {
44
44
  import { CategoryUpdate, BankTransaction, Metadata } from '@layerfi/components/types';
45
+ import { BankTransactionMatch, BankTransactionMatchType } from '@layerfi/components/types/bank_transactions';
45
46
  export type GetBankTransactionsReturn = {
46
47
  data?: BankTransaction[];
47
48
  meta?: Metadata;
@@ -62,6 +63,16 @@ declare module '@layerfi/components/api/layer/bankTransactions' {
62
63
  data: BankTransaction;
63
64
  errors: unknown;
64
65
  }>;
66
+ export const matchBankTransaction: (baseUrl: string, accessToken: string | undefined, options?: {
67
+ params?: Record<string, string | undefined> | undefined;
68
+ body?: {
69
+ match_id: string;
70
+ type: BankTransactionMatchType;
71
+ } | undefined;
72
+ } | undefined) => Promise<{
73
+ data: BankTransactionMatch;
74
+ errors: unknown;
75
+ }>;
65
76
 
66
77
  }
67
78
  declare module '@layerfi/components/api/layer/categories' {
@@ -116,6 +127,16 @@ declare module '@layerfi/components/api/layer' {
116
127
  data: import("@layerfi/components/types").BankTransaction;
117
128
  errors: unknown;
118
129
  }>;
130
+ matchBankTransaction: (baseUrl: string, accessToken: string | undefined, options?: {
131
+ params?: Record<string, string | undefined> | undefined;
132
+ body?: {
133
+ match_id: string;
134
+ type: import("@layerfi/components/types/bank_transactions").BankTransactionMatchType;
135
+ } | undefined;
136
+ } | undefined) => Promise<{
137
+ data: import("@layerfi/components/types/bank_transactions").BankTransactionMatch;
138
+ errors: unknown;
139
+ }>;
119
140
  createAccount: (baseUrl: string, accessToken: string | undefined, options?: {
120
141
  params?: Record<string, string | undefined> | undefined;
121
142
  body?: import("@layerfi/components/types").NewAccount | undefined;
@@ -153,6 +174,27 @@ declare module '@layerfi/components/api/layer' {
153
174
  declare module '@layerfi/components/api/util' {
154
175
  export const formStringFromObject: (object: Record<string, string | number | boolean>) => string;
155
176
 
177
+ }
178
+ declare module '@layerfi/components/components/Badge/Badge' {
179
+ import React, { ReactNode } from 'react';
180
+ import { ButtonProps } from '@layerfi/components/components/Button/Button';
181
+ export enum BadgeSize {
182
+ SMALL = "small",
183
+ MEDIUM = "medium"
184
+ }
185
+ export interface BadgeProps {
186
+ children: ReactNode;
187
+ icon?: ReactNode;
188
+ onClick?: ButtonProps['onClick'];
189
+ tooltip?: ReactNode;
190
+ size?: BadgeSize;
191
+ }
192
+ export const Badge: ({ icon, onClick, children, tooltip, size, }: BadgeProps) => React.JSX.Element;
193
+
194
+ }
195
+ declare module '@layerfi/components/components/Badge/index' {
196
+ export { Badge } from '@layerfi/components/components/Badge/Badge';
197
+
156
198
  }
157
199
  declare module '@layerfi/components/components/BalanceSheet/BalanceSheet' {
158
200
  import React from 'react';
@@ -194,18 +236,28 @@ declare module '@layerfi/components/components/BalanceSheetRow/BalanceSheetRow'
194
236
  declare module '@layerfi/components/components/BalanceSheetRow/index' {
195
237
  export { BalanceSheetRow } from '@layerfi/components/components/BalanceSheetRow/BalanceSheetRow';
196
238
 
239
+ }
240
+ declare module '@layerfi/components/components/BankTransactionListItem/Assignment' {
241
+ import React from 'react';
242
+ import { BankTransaction } from '@layerfi/components/types';
243
+ export interface AssignmentProps {
244
+ bankTransaction: BankTransaction;
245
+ }
246
+ export const Assignment: ({ bankTransaction }: AssignmentProps) => React.JSX.Element;
247
+
197
248
  }
198
249
  declare module '@layerfi/components/components/BankTransactionListItem/BankTransactionListItem' {
199
250
  import React from 'react';
200
251
  import { BankTransaction } from '@layerfi/components/types';
201
252
  type Props = {
253
+ index: number;
202
254
  dateFormat: string;
203
255
  bankTransaction: BankTransaction;
204
- isOpen: boolean;
205
- toggleOpen: (id: string) => void;
206
256
  editable: boolean;
257
+ removeTransaction: (id: string) => void;
258
+ containerWidth?: number;
207
259
  };
208
- export const BankTransactionListItem: ({ dateFormat, bankTransaction, isOpen, toggleOpen, editable, }: Props) => React.JSX.Element | null;
260
+ export const BankTransactionListItem: ({ index, dateFormat, bankTransaction, editable, containerWidth, }: Props) => React.JSX.Element | null;
209
261
  export {};
210
262
 
211
263
  }
@@ -215,17 +267,42 @@ declare module '@layerfi/components/components/BankTransactionListItem/index' {
215
267
  }
216
268
  declare module '@layerfi/components/components/BankTransactionRow/BankTransactionRow' {
217
269
  import React from 'react';
218
- import { BankTransaction } from '@layerfi/components/types';
270
+ import { BankTransaction, Category } from '@layerfi/components/types';
219
271
  type Props = {
272
+ index: number;
220
273
  dateFormat: string;
221
274
  bankTransaction: BankTransaction;
222
- isOpen: boolean;
223
- toggleOpen: (id: string) => void;
224
275
  editable: boolean;
276
+ removeTransaction: (id: string) => void;
277
+ containerWidth?: number;
225
278
  };
226
- export const BankTransactionRow: ({ dateFormat, bankTransaction, isOpen, toggleOpen, editable, }: Props) => React.JSX.Element | null;
279
+ export type LastSubmittedForm = 'simple' | 'match' | 'split' | undefined;
280
+ export const extractDescriptionForSplit: (category: Category) => string;
281
+ 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;
227
283
  export {};
228
284
 
285
+ }
286
+ declare module '@layerfi/components/components/BankTransactionRow/MatchBadge' {
287
+ import React from 'react';
288
+ import { BankTransaction } from '@layerfi/components/types';
289
+ export interface MatchBadgeProps {
290
+ bankTransaction: BankTransaction;
291
+ classNamePrefix: string;
292
+ dateFormat: string;
293
+ text?: string;
294
+ }
295
+ export const MatchBadge: ({ bankTransaction, classNamePrefix, dateFormat, text, }: MatchBadgeProps) => React.JSX.Element | undefined;
296
+
297
+ }
298
+ declare module '@layerfi/components/components/BankTransactionRow/SplitTooltipDetails' {
299
+ import React from 'react';
300
+ import { Category } from '@layerfi/components/types';
301
+ export const SplitTooltipDetails: ({ classNamePrefix, category, }: {
302
+ classNamePrefix: string;
303
+ category: Category;
304
+ }) => React.JSX.Element | undefined;
305
+
229
306
  }
230
307
  declare module '@layerfi/components/components/BankTransactionRow/index' {
231
308
  export { BankTransactionRow } from '@layerfi/components/components/BankTransactionRow/BankTransactionRow';
@@ -235,8 +312,9 @@ declare module '@layerfi/components/components/BankTransactions/BankTransactions
235
312
  import React from 'react';
236
313
  export interface BankTransactionsProps {
237
314
  asWidget?: boolean;
315
+ pageSize?: number;
238
316
  }
239
- export const BankTransactions: ({ asWidget, }: BankTransactionsProps) => React.JSX.Element;
317
+ export const BankTransactions: ({ asWidget, pageSize, }: BankTransactionsProps) => React.JSX.Element;
240
318
 
241
319
  }
242
320
  declare module '@layerfi/components/components/BankTransactions/index' {
@@ -249,13 +327,35 @@ declare module '@layerfi/components/components/Button/Button' {
249
327
  primary = "primary",
250
328
  secondary = "secondary"
251
329
  }
330
+ export type ButtonJustify = 'center' | 'space-between' | 'start';
252
331
  export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
253
332
  variant?: ButtonVariant;
254
333
  leftIcon?: ReactNode;
255
334
  rightIcon?: ReactNode;
256
335
  iconOnly?: ReactNode;
336
+ iconAsPrimary?: boolean;
337
+ justify?: ButtonJustify;
257
338
  }
258
- export const Button: ({ className, children, variant, leftIcon, rightIcon, iconOnly, ...props }: ButtonProps) => React.JSX.Element;
339
+ export const Button: ({ className, children, variant, leftIcon, rightIcon, iconOnly, iconAsPrimary, justify, ...props }: ButtonProps) => React.JSX.Element;
340
+
341
+ }
342
+ declare module '@layerfi/components/components/Button/IconButton' {
343
+ import React, { ButtonHTMLAttributes, ReactNode } from 'react';
344
+ export interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
345
+ icon: ReactNode;
346
+ active?: boolean;
347
+ }
348
+ export const IconButton: ({ className, children, icon, active, ...props }: IconButtonProps) => React.JSX.Element;
349
+
350
+ }
351
+ declare module '@layerfi/components/components/Button/RetryButton' {
352
+ import React, { ButtonHTMLAttributes } from 'react';
353
+ export interface RetryButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
354
+ processing?: boolean;
355
+ disabled?: boolean;
356
+ error: string;
357
+ }
358
+ export const RetryButton: ({ className, processing, disabled, error, children, ...props }: RetryButtonProps) => React.JSX.Element;
259
359
 
260
360
  }
261
361
  declare module '@layerfi/components/components/Button/SubmitButton' {
@@ -266,13 +366,27 @@ declare module '@layerfi/components/components/Button/SubmitButton' {
266
366
  error?: boolean | string;
267
367
  active?: boolean;
268
368
  iconOnly?: boolean;
369
+ action?: SubmitAction;
269
370
  }
270
- export const SubmitButton: ({ active, className, processing, disabled, error, children, ...props }: SubmitButtonProps) => React.JSX.Element;
371
+ export enum SubmitAction {
372
+ SAVE = "save",
373
+ UPDATE = "update"
374
+ }
375
+ export const SubmitButton: ({ active, className, processing, disabled, error, children, action, ...props }: SubmitButtonProps) => React.JSX.Element;
376
+
377
+ }
378
+ declare module '@layerfi/components/components/Button/TextButton' {
379
+ import React, { ButtonHTMLAttributes } from 'react';
380
+ export type TextButtonProps = ButtonHTMLAttributes<HTMLButtonElement>;
381
+ export const TextButton: ({ className, children, ...props }: TextButtonProps) => React.JSX.Element;
271
382
 
272
383
  }
273
384
  declare module '@layerfi/components/components/Button/index' {
274
385
  export { Button, ButtonVariant } from '@layerfi/components/components/Button/Button';
386
+ export { IconButton } from '@layerfi/components/components/Button/IconButton';
387
+ export { RetryButton } from '@layerfi/components/components/Button/RetryButton';
275
388
  export { SubmitButton } from '@layerfi/components/components/Button/SubmitButton';
389
+ export { TextButton } from '@layerfi/components/components/Button/TextButton';
276
390
 
277
391
  }
278
392
  declare module '@layerfi/components/components/CategoryMenu/CategoryMenu' {
@@ -293,6 +407,50 @@ declare module '@layerfi/components/components/CategoryMenu/CategoryMenu' {
293
407
  declare module '@layerfi/components/components/CategoryMenu/index' {
294
408
  export { CategoryMenu } from '@layerfi/components/components/CategoryMenu/CategoryMenu';
295
409
 
410
+ }
411
+ declare module '@layerfi/components/components/CategorySelect/CategorySelect' {
412
+ import React from 'react';
413
+ import { BankTransaction, Category } from '@layerfi/components/types';
414
+ import { SuggestedMatch } from '@layerfi/components/types/bank_transactions';
415
+ import { CategoryEntry } from '@layerfi/components/types/categories';
416
+ type Props = {
417
+ name?: string;
418
+ bankTransaction: BankTransaction;
419
+ value: CategoryOption | undefined;
420
+ onChange: (newValue: CategoryOption) => void;
421
+ disabled?: boolean;
422
+ className?: string;
423
+ };
424
+ export enum OptionActionType {
425
+ CATEGORY = "category",
426
+ MATCH = "match",
427
+ HIDDEN = "hidden"
428
+ }
429
+ export interface CategoryOptionPayload {
430
+ id: string;
431
+ option_type: OptionActionType;
432
+ display_name: string;
433
+ date?: string;
434
+ amount?: number;
435
+ type?: string;
436
+ stable_name?: string;
437
+ entries?: CategoryEntry[];
438
+ subCategories?: Category[];
439
+ }
440
+ export interface CategoryOption {
441
+ type: string;
442
+ disabled?: boolean;
443
+ payload: CategoryOptionPayload;
444
+ }
445
+ export const mapCategoryToOption: (category: Category) => CategoryOption;
446
+ export const mapSuggestedMatchToOption: (record: SuggestedMatch) => CategoryOption;
447
+ export const CategorySelect: ({ bankTransaction, name, value, onChange, disabled, className, }: Props) => React.JSX.Element;
448
+ export {};
449
+
450
+ }
451
+ declare module '@layerfi/components/components/CategorySelect/index' {
452
+ export { CategorySelect } from '@layerfi/components/components/CategorySelect/CategorySelect';
453
+
296
454
  }
297
455
  declare module '@layerfi/components/components/ChartOfAccounts/ChartOfAccounts' {
298
456
  import React from 'react';
@@ -335,7 +493,7 @@ declare module '@layerfi/components/components/Container/Container' {
335
493
  asWidget?: boolean;
336
494
  children: ReactNode;
337
495
  }
338
- export const Container: ({ name, className, children, asWidget, }: ContainerProps) => React.JSX.Element;
496
+ export const Container: React.ForwardRefExoticComponent<ContainerProps & React.RefAttributes<HTMLDivElement>>;
339
497
 
340
498
  }
341
499
  declare module '@layerfi/components/components/Container/Header' {
@@ -372,16 +530,28 @@ declare module '@layerfi/components/components/DataState/DataState' {
372
530
  declare module '@layerfi/components/components/DataState/index' {
373
531
  export { DataState, DataStateStatus } from '@layerfi/components/components/DataState/DataState';
374
532
 
533
+ }
534
+ declare module '@layerfi/components/components/ExpandedBankTransactionRow/APIErrorNotifications' {
535
+ import React from 'react';
536
+ import { BankTransaction } from '@layerfi/components/types';
537
+ interface APIErrorNotificationsProps {
538
+ bankTransaction: BankTransaction;
539
+ containerWidth?: number;
540
+ }
541
+ export const APIErrorNotifications: ({ bankTransaction, containerWidth, }: APIErrorNotificationsProps) => React.JSX.Element;
542
+ export {};
543
+
375
544
  }
376
545
  declare module '@layerfi/components/components/ExpandedBankTransactionRow/ExpandedBankTransactionRow' {
377
546
  import React from 'react';
378
547
  import { BankTransaction } from '@layerfi/components/types';
379
548
  type Props = {
380
549
  bankTransaction: BankTransaction;
381
- close?: () => void;
382
550
  isOpen?: boolean;
383
551
  asListItem?: boolean;
384
552
  submitBtnText?: string;
553
+ containerWidth?: number;
554
+ editable?: boolean;
385
555
  };
386
556
  export type SaveHandle = {
387
557
  save: () => void;
@@ -418,7 +588,12 @@ declare module '@layerfi/components/components/Input/FileInput' {
418
588
  }
419
589
  declare module '@layerfi/components/components/Input/Input' {
420
590
  import React, { HTMLProps } from 'react';
421
- export const Input: ({ className, ...props }: HTMLProps<HTMLInputElement>) => React.JSX.Element;
591
+ export interface InputProps extends HTMLProps<HTMLInputElement> {
592
+ isInvalid?: boolean;
593
+ errorMessage?: string;
594
+ leftText?: string;
595
+ }
596
+ export const Input: ({ className, isInvalid, errorMessage, leftText, ...props }: InputProps) => React.JSX.Element;
422
597
 
423
598
  }
424
599
  declare module '@layerfi/components/components/Input/InputGroup' {
@@ -437,6 +612,24 @@ declare module '@layerfi/components/components/Input/index' {
437
612
  export { InputGroup } from '@layerfi/components/components/Input/InputGroup';
438
613
  export { FileInput } from '@layerfi/components/components/Input/FileInput';
439
614
 
615
+ }
616
+ declare module '@layerfi/components/components/LinkedAccounts/LinkedAccountThumb' {
617
+ import React from 'react';
618
+ import { LinkedAccount } from '@layerfi/components/types/linked_accounts';
619
+ export interface LinkedAccountThumbProps {
620
+ account: LinkedAccount;
621
+ }
622
+ export const LinkedAccountThumb: ({ account }: LinkedAccountThumbProps) => React.JSX.Element;
623
+
624
+ }
625
+ declare module '@layerfi/components/components/LinkedAccounts/LinkedAccounts' {
626
+ import React from 'react';
627
+ export const LinkedAccounts: () => React.JSX.Element;
628
+
629
+ }
630
+ declare module '@layerfi/components/components/LinkedAccounts/index' {
631
+ export { LinkedAccounts } from '@layerfi/components/components/LinkedAccounts/LinkedAccounts';
632
+
440
633
  }
441
634
  declare module '@layerfi/components/components/Loader/Loader' {
442
635
  import React, { ReactNode } from 'react';
@@ -450,30 +643,69 @@ declare module '@layerfi/components/components/Loader/index' {
450
643
  export { Loader } from '@layerfi/components/components/Loader/Loader';
451
644
 
452
645
  }
453
- declare module '@layerfi/components/components/Pill/Pill' {
454
- import React, { PropsWithChildren } from 'react';
455
- export const Pill: ({ children }: PropsWithChildren) => React.JSX.Element;
646
+ declare module '@layerfi/components/components/MatchForm/MatchForm' {
647
+ import React from 'react';
648
+ import { BankTransaction } from '@layerfi/components/types';
649
+ export interface MatchFormProps {
650
+ classNamePrefix: string;
651
+ bankTransaction: BankTransaction;
652
+ selectedMatchId?: string;
653
+ setSelectedMatchId: (val?: string) => void;
654
+ matchFormError?: string;
655
+ }
656
+ export const MatchForm: ({ classNamePrefix, bankTransaction, selectedMatchId, setSelectedMatchId, matchFormError, }: MatchFormProps) => React.JSX.Element;
657
+
658
+ }
659
+ declare module '@layerfi/components/components/MatchForm/index' {
660
+ export { MatchForm } from '@layerfi/components/components/MatchForm/MatchForm';
661
+
662
+ }
663
+ declare module '@layerfi/components/components/Pagination/Pagination' {
664
+ import React from 'react';
665
+ export interface PaginationProps {
666
+ currentPage: number;
667
+ pageSize: number;
668
+ onPageChange: (page: number) => void;
669
+ totalCount: number;
670
+ siblingCount?: number;
671
+ }
672
+ export const Pagination: ({ onPageChange, totalCount, siblingCount, currentPage, pageSize, }: PaginationProps) => React.JSX.Element | undefined;
456
673
 
457
674
  }
458
- declare module '@layerfi/components/components/Pill/index' {
459
- export { Pill } from '@layerfi/components/components/Pill/Pill';
675
+ declare module '@layerfi/components/components/Pagination/index' {
676
+ export { Pagination } from '@layerfi/components/components/Pagination/Pagination';
460
677
 
461
678
  }
462
679
  declare module '@layerfi/components/components/ProfitAndLoss/ProfitAndLoss' {
463
680
  import React, { PropsWithChildren } from 'react';
681
+ import { ReportingBasis } from '@layerfi/components/types';
682
+ type Props = PropsWithChildren & {
683
+ tagFilter?: {
684
+ key: string;
685
+ values: string[];
686
+ };
687
+ reportingBasis?: ReportingBasis;
688
+ };
464
689
  const ProfitAndLoss: {
465
- ({ children }: PropsWithChildren): React.JSX.Element;
690
+ ({ children, tagFilter, reportingBasis }: Props): React.JSX.Element;
466
691
  Chart: () => React.JSX.Element;
467
692
  Context: React.Context<{
468
693
  data: import("@layerfi/components/types").ProfitAndLoss | undefined;
469
694
  isLoading: boolean;
695
+ isValidating: boolean;
470
696
  error: unknown;
471
697
  dateRange: import("@layerfi/components/types").DateRange;
472
698
  changeDateRange: (dateRange: Partial<import("@layerfi/components/types").DateRange>) => void;
699
+ refetch: () => void;
473
700
  }>;
474
701
  DatePicker: () => React.JSX.Element;
475
- Summaries: () => React.JSX.Element;
476
- Table: () => React.JSX.Element;
702
+ Summaries: ({ vertical, revenueLabel, }: {
703
+ revenueLabel?: string | undefined;
704
+ vertical?: boolean | undefined;
705
+ }) => React.JSX.Element;
706
+ Table: ({ lockExpanded }: {
707
+ lockExpanded?: boolean | undefined;
708
+ }) => React.JSX.Element;
477
709
  };
478
710
  export { ProfitAndLoss };
479
711
 
@@ -520,9 +752,9 @@ declare module '@layerfi/components/components/ProfitAndLossRow/ProfitAndLossRow
520
752
  maxDepth?: number;
521
753
  lineItem?: LineItem | null;
522
754
  direction?: Direction;
523
- summarize?: boolean;
755
+ lockExpanded?: boolean;
524
756
  };
525
- export const ProfitAndLossRow: ({ variant, lineItem, depth, maxDepth, direction, summarize, }: Props) => React.JSX.Element | null;
757
+ export const ProfitAndLossRow: ({ variant, lineItem, depth, maxDepth, direction, lockExpanded, }: Props) => React.JSX.Element | null;
526
758
  export {};
527
759
 
528
760
  }
@@ -532,7 +764,12 @@ declare module '@layerfi/components/components/ProfitAndLossRow/index' {
532
764
  }
533
765
  declare module '@layerfi/components/components/ProfitAndLossSummaries/ProfitAndLossSummaries' {
534
766
  import React from 'react';
535
- export const ProfitAndLossSummaries: () => React.JSX.Element;
767
+ type Props = {
768
+ revenueLabel?: string;
769
+ vertical?: boolean;
770
+ };
771
+ export const ProfitAndLossSummaries: ({ vertical, revenueLabel, }: Props) => React.JSX.Element;
772
+ export {};
536
773
 
537
774
  }
538
775
  declare module '@layerfi/components/components/ProfitAndLossSummaries/index' {
@@ -541,7 +778,11 @@ declare module '@layerfi/components/components/ProfitAndLossSummaries/index' {
541
778
  }
542
779
  declare module '@layerfi/components/components/ProfitAndLossTable/ProfitAndLossTable' {
543
780
  import React from 'react';
544
- export const ProfitAndLossTable: () => React.JSX.Element;
781
+ type Props = {
782
+ lockExpanded?: boolean;
783
+ };
784
+ export const ProfitAndLossTable: ({ lockExpanded }: Props) => React.JSX.Element;
785
+ export {};
545
786
 
546
787
  }
547
788
  declare module '@layerfi/components/components/ProfitAndLossTable/empty_profit_and_loss_report' {
@@ -553,6 +794,19 @@ declare module '@layerfi/components/components/ProfitAndLossTable/empty_profit_a
553
794
  declare module '@layerfi/components/components/ProfitAndLossTable/index' {
554
795
  export { ProfitAndLossTable } from '@layerfi/components/components/ProfitAndLossTable/ProfitAndLossTable';
555
796
 
797
+ }
798
+ declare module '@layerfi/components/components/ProfitAndLossView/ProfitAndLossView' {
799
+ import React from 'react';
800
+ export interface ProfitAndLossViewProps {
801
+ hideTable?: boolean;
802
+ hideChart?: boolean;
803
+ }
804
+ export const ProfitAndLossView: (props: ProfitAndLossViewProps) => React.JSX.Element;
805
+
806
+ }
807
+ declare module '@layerfi/components/components/ProfitAndLossView/index' {
808
+ export { ProfitAndLossView } from '@layerfi/components/components/ProfitAndLossView/ProfitAndLossView';
809
+
556
810
  }
557
811
  declare module '@layerfi/components/components/SkeletonBalanceSheetRow/SkeletonBalanceSheetRow' {
558
812
  import React, { PropsWithChildren } from 'react';
@@ -564,6 +818,20 @@ declare module '@layerfi/components/components/SkeletonBalanceSheetRow/SkeletonB
564
818
  declare module '@layerfi/components/components/SkeletonBalanceSheetRow/index' {
565
819
  export { SkeletonBalanceSheetRow } from '@layerfi/components/components/SkeletonBalanceSheetRow/SkeletonBalanceSheetRow';
566
820
 
821
+ }
822
+ declare module '@layerfi/components/components/SkeletonLoader/SkeletonLoader' {
823
+ import React from 'react';
824
+ export interface SkeletonLoaderProps {
825
+ width?: string;
826
+ height?: string;
827
+ className?: string;
828
+ }
829
+ export const SkeletonLoader: ({ height, width, className, }: SkeletonLoaderProps) => React.JSX.Element;
830
+
831
+ }
832
+ declare module '@layerfi/components/components/SkeletonLoader/index' {
833
+ export { SkeletonLoader } from '@layerfi/components/components/SkeletonLoader/SkeletonLoader';
834
+
567
835
  }
568
836
  declare module '@layerfi/components/components/Textarea/Textarea' {
569
837
  import React, { HTMLProps } from 'react';
@@ -732,6 +1000,13 @@ declare module '@layerfi/components/components/Tooltip/useTooltip' {
732
1000
  disabled: boolean | undefined;
733
1001
  };
734
1002
 
1003
+ }
1004
+ declare module '@layerfi/components/components/Typography/ErrorText' {
1005
+ import React from 'react';
1006
+ import { TextProps } from '@layerfi/components/components/Typography/Text';
1007
+ export type ErrorTextProps = TextProps;
1008
+ export const ErrorText: ({ className, ...props }: ErrorTextProps) => React.JSX.Element;
1009
+
735
1010
  }
736
1011
  declare module '@layerfi/components/components/Typography/Heading' {
737
1012
  import React, { ReactNode } from 'react';
@@ -785,15 +1060,73 @@ declare module '@layerfi/components/components/Typography/Text' {
785
1060
 
786
1061
  }
787
1062
  declare module '@layerfi/components/components/Typography/index' {
788
- export { Text, TextSize, TextWeight } from '@layerfi/components/components/Typography/Text';
1063
+ export { Text, TextSize, TextWeight, TextUseTooltip } from '@layerfi/components/components/Typography/Text';
789
1064
  export { Heading, HeadingSize } from '@layerfi/components/components/Typography/Heading';
1065
+ export { ErrorText } from '@layerfi/components/components/Typography/ErrorText';
1066
+
1067
+ }
1068
+ declare module '@layerfi/components/config/general' {
1069
+ export const DATE_FORMAT = "LLL d, yyyy";
1070
+
1071
+ }
1072
+ declare module '@layerfi/components/config/theme' {
1073
+ export const SHADES: {
1074
+ 50: {
1075
+ s: number;
1076
+ l: number;
1077
+ };
1078
+ 100: {
1079
+ s: number;
1080
+ l: number;
1081
+ };
1082
+ 200: {
1083
+ s: number;
1084
+ l: number;
1085
+ };
1086
+ 300: {
1087
+ s: number;
1088
+ l: number;
1089
+ };
1090
+ 500: {
1091
+ s: number;
1092
+ l: number;
1093
+ };
1094
+ 600: {
1095
+ s: number;
1096
+ l: number;
1097
+ };
1098
+ 700: {
1099
+ s: number;
1100
+ l: number;
1101
+ };
1102
+ 800: {
1103
+ s: number;
1104
+ l: number;
1105
+ };
1106
+ 1000: {
1107
+ s: number;
1108
+ l: number;
1109
+ };
1110
+ };
1111
+ export const COLORS: {
1112
+ dark: {
1113
+ h: number;
1114
+ s: number;
1115
+ l: number;
1116
+ };
1117
+ light: {
1118
+ h: number;
1119
+ s: number;
1120
+ l: number;
1121
+ };
1122
+ };
790
1123
 
791
1124
  }
792
1125
  declare module '@layerfi/components/contexts/LayerContext/LayerContext' {
793
1126
  /// <reference types="react" />
794
1127
  import { LayerContextValues } from '@layerfi/components/types';
795
- import { LayerThemeConfig } from '@layerfi/components/types/layer_context';
796
- export const LayerContext: import("react").Context<LayerContextValues & {
1128
+ import { LayerContextHelpers, LayerThemeConfig } from '@layerfi/components/types/layer_context';
1129
+ export const LayerContext: import("react").Context<LayerContextValues & LayerContextHelpers & {
797
1130
  setTheme: (theme: LayerThemeConfig) => void;
798
1131
  }>;
799
1132
 
@@ -830,6 +1163,7 @@ declare module '@layerfi/components/hooks/useBankTransactions/useBankTransaction
830
1163
  isValidating: boolean;
831
1164
  error: unknown;
832
1165
  categorize: (id: BankTransaction['id'], newCategory: CategoryUpdate) => Promise<void>;
1166
+ match: (id: BankTransaction['id'], matchId: BankTransaction['id']) => Promise<void>;
833
1167
  updateOneLocal: (bankTransaction: BankTransaction) => void;
834
1168
  refetch: () => void;
835
1169
  };
@@ -870,24 +1204,69 @@ declare module '@layerfi/components/hooks/useLayerContext/index' {
870
1204
 
871
1205
  }
872
1206
  declare module '@layerfi/components/hooks/useLayerContext/useLayerContext' {
873
- export const useLayerContext: () => import("@layerfi/components/types").LayerContextValues & {
1207
+ export const useLayerContext: () => import("@layerfi/components/types").LayerContextValues & import("../../types").LayerContextHelpers & {
874
1208
  setTheme: (theme: import("@layerfi/components/types/layer_context").LayerThemeConfig) => void;
875
1209
  };
876
1210
 
1211
+ }
1212
+ declare module '@layerfi/components/hooks/useLinkedAccounts/index' {
1213
+ export { useLinkedAccounts } from '@layerfi/components/hooks/useLinkedAccounts/useLinkedAccounts';
1214
+
1215
+ }
1216
+ declare module '@layerfi/components/hooks/useLinkedAccounts/useLinkedAccounts' {
1217
+ import { Metadata } from '@layerfi/components/types';
1218
+ import { LinkedAccount } from '@layerfi/components/types/linked_accounts';
1219
+ type UseLinkedAccounts = () => {
1220
+ data?: LinkedAccount[];
1221
+ metadata: Metadata;
1222
+ isLoading: boolean;
1223
+ isValidating: boolean;
1224
+ error: unknown;
1225
+ refetch: () => void;
1226
+ };
1227
+ export const useLinkedAccounts: UseLinkedAccounts;
1228
+ export {};
1229
+
1230
+ }
1231
+ declare module '@layerfi/components/hooks/usePagination/index' {
1232
+ export { usePagination, DOTS } from '@layerfi/components/hooks/usePagination/usePagination';
1233
+
1234
+ }
1235
+ declare module '@layerfi/components/hooks/usePagination/usePagination' {
1236
+ export const DOTS = "...";
1237
+ export interface UsePaginationProps {
1238
+ totalCount: number;
1239
+ pageSize: number;
1240
+ siblingCount?: number;
1241
+ currentPage: number;
1242
+ }
1243
+ export type UsePaginationReturn = (string | number)[] | undefined;
1244
+ export const usePagination: ({ totalCount, pageSize, siblingCount, currentPage, }: UsePaginationProps) => UsePaginationReturn;
1245
+
877
1246
  }
878
1247
  declare module '@layerfi/components/hooks/useProfitAndLoss/index' {
879
1248
  export { useProfitAndLoss } from '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss';
880
1249
 
881
1250
  }
882
1251
  declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss' {
883
- import { ProfitAndLoss, DateRange } from '@layerfi/components/types';
884
- type Props = DateRange;
1252
+ import { ProfitAndLoss, DateRange, ReportingBasis } from '@layerfi/components/types';
1253
+ type Props = {
1254
+ startDate?: Date;
1255
+ endDate?: Date;
1256
+ tagFilter?: {
1257
+ key: string;
1258
+ values: string[];
1259
+ };
1260
+ reportingBasis?: ReportingBasis;
1261
+ };
885
1262
  type UseProfitAndLoss = (props?: Props) => {
886
1263
  data: ProfitAndLoss | undefined;
887
1264
  isLoading: boolean;
1265
+ isValidating: boolean;
888
1266
  error: unknown;
889
1267
  dateRange: DateRange;
890
1268
  changeDateRange: (dateRange: Partial<DateRange>) => void;
1269
+ refetch: () => void;
891
1270
  };
892
1271
  export const useProfitAndLoss: UseProfitAndLoss;
893
1272
  export {};
@@ -934,25 +1313,25 @@ declare module '@layerfi/components/icons/ChevronDown' {
934
1313
  const ChevronDown: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
935
1314
  export default ChevronDown;
936
1315
 
1316
+ }
1317
+ declare module '@layerfi/components/icons/ChevronDownFill' {
1318
+ import * as React from 'react';
1319
+ import { IconSvgProps } from '@layerfi/components/icons/types';
1320
+ const ChevronDownFill: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1321
+ export default ChevronDownFill;
1322
+
937
1323
  }
938
1324
  declare module '@layerfi/components/icons/ChevronLeft' {
939
1325
  import * as React from 'react';
940
- import { SVGProps } from 'react';
941
- type Props = {
942
- strokeColor?: string;
943
- size?: number;
944
- };
945
- const ChevronLeft: ({ strokeColor, size, ...props }: Props & SVGProps<SVGSVGElement>) => React.JSX.Element;
1326
+ import { IconSvgProps } from '@layerfi/components/icons/types';
1327
+ const ChevronLeft: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
946
1328
  export default ChevronLeft;
947
1329
 
948
1330
  }
949
1331
  declare module '@layerfi/components/icons/ChevronRight' {
950
1332
  import * as React from 'react';
951
- import { SVGProps } from 'react';
952
- type Props = SVGProps<SVGSVGElement> & {
953
- size: SVGProps<SVGSVGElement>['width'];
954
- };
955
- const ChavronRight: ({ size, ...props }: Props) => React.JSX.Element;
1333
+ import { IconSvgProps } from '@layerfi/components/icons/types';
1334
+ const ChavronRight: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
956
1335
  export default ChavronRight;
957
1336
 
958
1337
  }
@@ -963,32 +1342,32 @@ declare module '@layerfi/components/icons/DownloadCloud' {
963
1342
  export default DownloadCloud;
964
1343
 
965
1344
  }
966
- declare module '@layerfi/components/icons/FolderPlus' {
1345
+ declare module '@layerfi/components/icons/Loader' {
967
1346
  import * as React from 'react';
968
1347
  import { IconSvgProps } from '@layerfi/components/icons/types';
969
- const FolderPlus: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
970
- export default FolderPlus;
1348
+ const Loader: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1349
+ export default Loader;
971
1350
 
972
1351
  }
973
- declare module '@layerfi/components/icons/Link' {
1352
+ declare module '@layerfi/components/icons/MinimizeTwo' {
974
1353
  import * as React from 'react';
975
1354
  import { IconSvgProps } from '@layerfi/components/icons/types';
976
- const Link: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
977
- export default Link;
1355
+ const MinimizeTwo: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1356
+ export default MinimizeTwo;
978
1357
 
979
1358
  }
980
- declare module '@layerfi/components/icons/Loader' {
1359
+ declare module '@layerfi/components/icons/RefreshCcw' {
981
1360
  import * as React from 'react';
982
1361
  import { IconSvgProps } from '@layerfi/components/icons/types';
983
- const Loader: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
984
- export default Loader;
1362
+ const RefreshCcw: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1363
+ export default RefreshCcw;
985
1364
 
986
1365
  }
987
- declare module '@layerfi/components/icons/RefreshCcw' {
1366
+ declare module '@layerfi/components/icons/Save' {
988
1367
  import * as React from 'react';
989
1368
  import { IconSvgProps } from '@layerfi/components/icons/types';
990
- const RefreshCcw: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
991
- export default RefreshCcw;
1369
+ const Save: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1370
+ export default Save;
992
1371
 
993
1372
  }
994
1373
  declare module '@layerfi/components/icons/Scissors' {
@@ -997,6 +1376,20 @@ declare module '@layerfi/components/icons/Scissors' {
997
1376
  const Scissors: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
998
1377
  export default Scissors;
999
1378
 
1379
+ }
1380
+ declare module '@layerfi/components/icons/ScissorsFullOpen' {
1381
+ import * as React from 'react';
1382
+ import { IconSvgProps } from '@layerfi/components/icons/types';
1383
+ const ScissorsFullOpen: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1384
+ export default ScissorsFullOpen;
1385
+
1386
+ }
1387
+ declare module '@layerfi/components/icons/Trash' {
1388
+ import * as React from 'react';
1389
+ import { IconSvgProps } from '@layerfi/components/icons/types';
1390
+ const Trash: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1391
+ export default Trash;
1392
+
1000
1393
  }
1001
1394
  declare module '@layerfi/components/icons/UploadCloud' {
1002
1395
  import * as React from 'react';
@@ -1016,7 +1409,9 @@ declare module '@layerfi/components/index' {
1016
1409
  export { BalanceSheet } from '@layerfi/components/components/BalanceSheet/index';
1017
1410
  export { BankTransactions } from '@layerfi/components/components/BankTransactions/index';
1018
1411
  export { Hello } from '@layerfi/components/components/Hello/index';
1412
+ export { LinkedAccounts } from '@layerfi/components/components/LinkedAccounts/index';
1019
1413
  export { ProfitAndLoss } from '@layerfi/components/components/ProfitAndLoss/index';
1414
+ export { ProfitAndLossView } from '@layerfi/components/components/ProfitAndLossView/index';
1020
1415
  export { LayerProvider } from '@layerfi/components/providers/LayerProvider/index';
1021
1416
  export { ChartOfAccounts } from '@layerfi/components/components/ChartOfAccounts/index';
1022
1417
 
@@ -1113,6 +1508,9 @@ declare module '@layerfi/components/types/bank_transactions' {
1113
1508
  CREDIT = "CREDIT",
1114
1509
  DEBIT = "DEBIT"
1115
1510
  }
1511
+ export enum BankTransactionMatchType {
1512
+ CONFIRM_MATCH = "Confirm_Match"
1513
+ }
1116
1514
  export interface BankTransaction extends Record<string, unknown> {
1117
1515
  type: 'Bank_Transaction';
1118
1516
  account_name?: string;
@@ -1134,6 +1532,31 @@ declare module '@layerfi/components/types/bank_transactions' {
1134
1532
  categorization_method: string;
1135
1533
  error?: string;
1136
1534
  processing?: boolean;
1535
+ suggested_matches?: SuggestedMatch[];
1536
+ match?: BankTransactionMatch;
1537
+ }
1538
+ export interface SuggestedMatch {
1539
+ id: string;
1540
+ matchType: string;
1541
+ details: {
1542
+ amount: number;
1543
+ date: string;
1544
+ description: string;
1545
+ id: string;
1546
+ type: string;
1547
+ };
1548
+ }
1549
+ export interface BankTransactionMatch {
1550
+ bank_transaction: BankTransaction;
1551
+ id: string;
1552
+ match_type?: string;
1553
+ details: {
1554
+ amount: number;
1555
+ date: string;
1556
+ description: string;
1557
+ id: string;
1558
+ type: string;
1559
+ };
1137
1560
  }
1138
1561
 
1139
1562
  }
@@ -1144,7 +1567,12 @@ declare module '@layerfi/components/types/categories' {
1144
1567
  LAYER_REVIEW = "LAYER_REVIEW",
1145
1568
  CATEGORIZED = "CATEGORIZED",
1146
1569
  SPLIT = "SPLIT",
1147
- JOURNALING = "JOURNALING"
1570
+ JOURNALING = "JOURNALING",
1571
+ MATCHED = "MATCHED"
1572
+ }
1573
+ export interface CategoryEntry {
1574
+ amount?: number;
1575
+ category: Category;
1148
1576
  }
1149
1577
  export interface Category {
1150
1578
  id: string;
@@ -1153,6 +1581,7 @@ declare module '@layerfi/components/types/categories' {
1153
1581
  category: string;
1154
1582
  stable_name?: string;
1155
1583
  subCategories?: Category[];
1584
+ entries?: CategoryEntry[];
1156
1585
  }
1157
1586
  export enum CategorizationType {
1158
1587
  AUTO = "AUTO",
@@ -1239,21 +1668,41 @@ declare module '@layerfi/components/types/layer_context' {
1239
1668
  categories: Category[];
1240
1669
  apiUrl: string;
1241
1670
  theme?: LayerThemeConfig;
1671
+ colors: ColorsPalette;
1672
+ };
1673
+ export type LayerContextHelpers = {
1674
+ getColor: (shade: number) => ColorsPaletteOption | undefined;
1242
1675
  };
1243
1676
  export interface ColorHSLConfig {
1244
1677
  h: string;
1245
1678
  s: string;
1246
1679
  l: string;
1247
1680
  }
1681
+ export interface ColorHSLNumberConfig {
1682
+ h: number;
1683
+ s: number;
1684
+ l: number;
1685
+ }
1248
1686
  export interface ColorRGBConfig {
1249
1687
  r: string;
1250
1688
  g: string;
1251
1689
  b: string;
1252
1690
  }
1691
+ export interface ColorRGBNumberConfig {
1692
+ r: number;
1693
+ g: number;
1694
+ b: number;
1695
+ }
1253
1696
  export interface ColorHexConfig {
1254
1697
  hex: string;
1255
1698
  }
1256
1699
  export type ColorConfig = ColorHSLConfig | ColorRGBConfig | ColorHexConfig;
1700
+ export interface ColorsPaletteOption {
1701
+ hsl: ColorHSLNumberConfig;
1702
+ rgb: ColorRGBNumberConfig;
1703
+ hex: string;
1704
+ }
1705
+ export type ColorsPalette = Record<number, ColorsPaletteOption>;
1257
1706
  export interface LayerThemeConfig {
1258
1707
  colors?: {
1259
1708
  dark?: ColorConfig;
@@ -1291,6 +1740,14 @@ declare module '@layerfi/components/types/line_item' {
1291
1740
  line_items?: LineItem[] | null;
1292
1741
  }
1293
1742
 
1743
+ }
1744
+ declare module '@layerfi/components/types/linked_accounts' {
1745
+ export interface LinkedAccount {
1746
+ name: string;
1747
+ account: string;
1748
+ amount: number;
1749
+ }
1750
+
1294
1751
  }
1295
1752
  declare module '@layerfi/components/types/profit_and_loss' {
1296
1753
  import { LineItem } from '@layerfi/components/types/line_item';
@@ -1314,7 +1771,7 @@ declare module '@layerfi/components/types/profit_and_loss' {
1314
1771
  }
1315
1772
  declare module '@layerfi/components/types' {
1316
1773
  export { OAuthResponse } from '@layerfi/components/types/authentication';
1317
- export { LayerContextValues, LayerContextActionName, LayerContextAction, } from '@layerfi/components/types/layer_context';
1774
+ export { LayerContextValues, LayerContextActionName, LayerContextAction, LayerContextHelpers, } from '@layerfi/components/types/layer_context';
1318
1775
  export { Metadata } from '@layerfi/components/types/api';
1319
1776
  export { ProfitAndLoss } from '@layerfi/components/types/profit_and_loss';
1320
1777
  export { LineItem } from '@layerfi/components/types/line_item';
@@ -1326,16 +1783,34 @@ declare module '@layerfi/components/types' {
1326
1783
  startDate: T;
1327
1784
  endDate: T;
1328
1785
  };
1786
+ export type ReportingBasis = 'CASH' | 'ACCRUAL';
1329
1787
 
1330
1788
  }
1331
1789
  declare module '@layerfi/components/utils/colors' {
1332
- import { LayerThemeConfig } from '@layerfi/components/types/layer_context';
1790
+ import { LayerThemeConfig, ColorsPalette } from '@layerfi/components/types/layer_context';
1333
1791
  /**
1334
1792
  * Convert `theme` config set in Provider into component styles.
1335
1793
  *
1336
1794
  * @param {LayerThemeConfig} theme - the theme set with provider
1337
1795
  */
1338
1796
  export const parseStylesFromThemeConfig: (theme?: LayerThemeConfig) => {};
1797
+ /**
1798
+ * Build same color palette in RGB, HSL and HEX as CSS variables.
1799
+ */
1800
+ export const buildColorsPalette: (theme?: LayerThemeConfig) => ColorsPalette;
1801
+
1802
+ }
1803
+ declare module '@layerfi/components/utils/format' {
1804
+ /**
1805
+ * Capitalize first letter of the given text.
1806
+ */
1807
+ export const capitalizeFirstLetter: (text: string) => string;
1808
+
1809
+ }
1810
+ declare module '@layerfi/components/utils/helpers' {
1811
+ export const range: (start: number, end: number) => number[];
1812
+ export const debounce: <F extends (...args: Parameters<F>) => ReturnType<F>>(fnc: F, timeout?: number) => (...args: Parameters<F>) => void;
1813
+ export const sleep: (time: number) => Promise<unknown>;
1339
1814
 
1340
1815
  }
1341
1816
  declare module '@layerfi/components' {