@layerfi/components 0.1.25 → 0.1.27

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
@@ -729,7 +729,16 @@ declare module '@layerfi/components/components/BankTransactionMobileList/BankTra
729
729
  personal = "personal",
730
730
  more = "more"
731
731
  }
732
- export const BankTransactionMobileListItem: ({ index, bankTransaction, editable, initialLoad, }: BankTransactionMobileListItemProps) => React.JSX.Element;
732
+ export const BankTransactionMobileListItem: ({ index, bankTransaction, removeTransaction, editable, initialLoad, }: BankTransactionMobileListItemProps) => React.JSX.Element;
733
+
734
+ }
735
+ declare module '@layerfi/components/components/BankTransactionMobileList/BusinessCategories' {
736
+ import React from 'react';
737
+ import { Option } from '@layerfi/components/components/BankTransactionMobileList/utils';
738
+ export interface BusinessCategoriesProps {
739
+ select: (category: Option) => void;
740
+ }
741
+ export const BusinessCategories: ({ select }: BusinessCategoriesProps) => React.JSX.Element;
733
742
 
734
743
  }
735
744
  declare module '@layerfi/components/components/BankTransactionMobileList/BusinessForm' {
@@ -777,6 +786,23 @@ declare module '@layerfi/components/components/BankTransactionMobileList/SplitFo
777
786
  bankTransaction: BankTransaction;
778
787
  }) => React.JSX.Element;
779
788
 
789
+ }
790
+ declare module '@layerfi/components/components/BankTransactionMobileList/TransactionToOpenContext' {
791
+ /// <reference types="react" />
792
+ type UseTransactionToOpen = () => {
793
+ transactionIdToOpen?: string;
794
+ setTransactionIdToOpen: (id: string) => void;
795
+ clearTransactionIdToOpen: () => void;
796
+ };
797
+ export const useTransactionToOpen: UseTransactionToOpen;
798
+ export type TransactionToOpenContextType = ReturnType<typeof useTransactionToOpen>;
799
+ export const TransactionToOpenContext: import("react").Context<{
800
+ transactionIdToOpen?: string | undefined;
801
+ setTransactionIdToOpen: (id: string) => void;
802
+ clearTransactionIdToOpen: () => void;
803
+ }>;
804
+ export {};
805
+
780
806
  }
781
807
  declare module '@layerfi/components/components/BankTransactionMobileList/constants' {
782
808
  export const PersonalCategories: string[];
@@ -822,7 +848,7 @@ declare module '@layerfi/components/components/BankTransactionRow/BankTransactio
822
848
  export type LastSubmittedForm = 'simple' | 'match' | 'split' | undefined;
823
849
  export const extractDescriptionForSplit: (category: Category) => string;
824
850
  export const getDefaultSelectedCategory: (bankTransaction: BankTransaction) => import("@layerfi/components/components/CategorySelect/CategorySelect").CategoryOption | undefined;
825
- export const BankTransactionRow: ({ index, dateFormat, bankTransaction, editable, removeTransaction, containerWidth, initialLoad, showDescriptions, showReceiptUploads }: Props) => React.JSX.Element | null;
851
+ export const BankTransactionRow: ({ index, dateFormat, bankTransaction, editable, removeTransaction, containerWidth, initialLoad, showDescriptions, showReceiptUploads, }: Props) => React.JSX.Element | null;
826
852
  export {};
827
853
 
828
854
  }
@@ -1314,6 +1340,19 @@ declare module '@layerfi/components/components/DetailsList/index' {
1314
1340
  export { DetailsList } from '@layerfi/components/components/DetailsList/DetailsList';
1315
1341
  export { DetailsListItem } from '@layerfi/components/components/DetailsList/DetailsListItem';
1316
1342
 
1343
+ }
1344
+ declare module '@layerfi/components/components/Drawer/Drawer' {
1345
+ import React from 'react';
1346
+ export const Drawer: ({ isOpen, onClose, children }: {
1347
+ isOpen: boolean;
1348
+ onClose: () => void;
1349
+ children: React.ReactNode;
1350
+ }) => React.JSX.Element;
1351
+
1352
+ }
1353
+ declare module '@layerfi/components/components/Drawer/index' {
1354
+ export { Drawer } from '@layerfi/components/components/Drawer/Drawer';
1355
+
1317
1356
  }
1318
1357
  declare module '@layerfi/components/components/ExpandedBankTransactionRow/APIErrorNotifications' {
1319
1358
  import React from 'react';
@@ -1350,6 +1389,15 @@ declare module '@layerfi/components/components/ExpandedBankTransactionRow/Expand
1350
1389
  declare module '@layerfi/components/components/ExpandedBankTransactionRow/index' {
1351
1390
  export { ExpandedBankTransactionRow } from '@layerfi/components/components/ExpandedBankTransactionRow/ExpandedBankTransactionRow';
1352
1391
 
1392
+ }
1393
+ declare module '@layerfi/components/components/GlobalWidgets/GlobalWidgets' {
1394
+ import React from 'react';
1395
+ export const GlobalWidgets: () => React.JSX.Element;
1396
+
1397
+ }
1398
+ declare module '@layerfi/components/components/GlobalWidgets/index' {
1399
+ export { GlobalWidgets } from '@layerfi/components/components/GlobalWidgets/GlobalWidgets';
1400
+
1353
1401
  }
1354
1402
  declare module '@layerfi/components/components/Hello/Hello' {
1355
1403
  import React from 'react';
@@ -1751,8 +1799,9 @@ declare module '@layerfi/components/components/Onboarding/ConnectAccount' {
1751
1799
  export interface ConnectAccountProps {
1752
1800
  onboardingStep: OnboardingStep;
1753
1801
  onTransactionsToReviewClick?: () => void;
1802
+ currentMonthOnly?: boolean;
1754
1803
  }
1755
- export const ConnectAccount: ({ onboardingStep, onTransactionsToReviewClick, }: ConnectAccountProps) => React.JSX.Element;
1804
+ export const ConnectAccount: ({ onboardingStep, onTransactionsToReviewClick, currentMonthOnly, }: ConnectAccountProps) => React.JSX.Element;
1756
1805
 
1757
1806
  }
1758
1807
  declare module '@layerfi/components/components/Onboarding/Onboarding' {
@@ -2351,8 +2400,9 @@ declare module '@layerfi/components/components/TransactionToReviewCard/Transacti
2351
2400
  import React from 'react';
2352
2401
  export interface TransactionToReviewCardProps {
2353
2402
  onClick?: () => void;
2403
+ currentMonthOnly?: true;
2354
2404
  }
2355
- export const TransactionToReviewCard: ({ onClick, }: TransactionToReviewCardProps) => React.JSX.Element;
2405
+ export const TransactionToReviewCard: ({ onClick, currentMonthOnly, }: TransactionToReviewCardProps) => React.JSX.Element;
2356
2406
 
2357
2407
  }
2358
2408
  declare module '@layerfi/components/components/TransactionToReviewCard/index' {
@@ -2557,6 +2607,21 @@ declare module '@layerfi/components/contexts/ChartOfAccountsContext/ChartOfAccou
2557
2607
  declare module '@layerfi/components/contexts/ChartOfAccountsContext/index' {
2558
2608
  export { ChartOfAccountsContext } from '@layerfi/components/contexts/ChartOfAccountsContext/ChartOfAccountsContext';
2559
2609
 
2610
+ }
2611
+ declare module '@layerfi/components/contexts/DrawerContext/DrawerContext' {
2612
+ /// <reference types="react" />
2613
+ import { useDrawer } from '@layerfi/components/hooks/useDrawer/index';
2614
+ export type DrawerContextType = ReturnType<typeof useDrawer>;
2615
+ export const DrawerContext: import("react").Context<{
2616
+ content?: import("react").ReactNode;
2617
+ setContent: (content: import("react").ReactNode) => void;
2618
+ close: () => void;
2619
+ }>;
2620
+
2621
+ }
2622
+ declare module '@layerfi/components/contexts/DrawerContext/index' {
2623
+ export { DrawerContext } from '@layerfi/components/contexts/DrawerContext/DrawerContext';
2624
+
2560
2625
  }
2561
2626
  declare module '@layerfi/components/contexts/JournalContext/JournalContext' {
2562
2627
  /// <reference types="react" />
@@ -2697,14 +2762,16 @@ declare module '@layerfi/components/hooks/useBankTransactions/index' {
2697
2762
  }
2698
2763
  declare module '@layerfi/components/hooks/useBankTransactions/useBankTransactions' {
2699
2764
  import { BankTransaction, CategoryUpdate, Metadata } from '@layerfi/components/types';
2765
+ import { LoadedStatus } from '@layerfi/components/types/general';
2700
2766
  type UseBankTransactions = () => {
2701
2767
  data?: BankTransaction[];
2702
2768
  metadata: Metadata;
2769
+ loadingStatus: LoadedStatus;
2703
2770
  isLoading: boolean;
2704
2771
  isValidating: boolean;
2705
2772
  error: unknown;
2706
- categorize: (id: BankTransaction['id'], newCategory: CategoryUpdate) => Promise<void>;
2707
- match: (id: BankTransaction['id'], matchId: BankTransaction['id']) => Promise<void>;
2773
+ categorize: (id: BankTransaction['id'], newCategory: CategoryUpdate, notify?: boolean) => Promise<void>;
2774
+ match: (id: BankTransaction['id'], matchId: BankTransaction['id'], notify?: boolean) => Promise<void>;
2708
2775
  updateOneLocal: (bankTransaction: BankTransaction) => void;
2709
2776
  refetch: () => void;
2710
2777
  };
@@ -2764,6 +2831,21 @@ declare module '@layerfi/components/hooks/useChartOfAccounts/useChartOfAccounts'
2764
2831
  };
2765
2832
  export {};
2766
2833
 
2834
+ }
2835
+ declare module '@layerfi/components/hooks/useDrawer/index' {
2836
+ export { useDrawer } from '@layerfi/components/hooks/useDrawer/useDrawer';
2837
+
2838
+ }
2839
+ declare module '@layerfi/components/hooks/useDrawer/useDrawer' {
2840
+ import { ReactNode } from 'react';
2841
+ type UseDrawer = () => {
2842
+ content?: ReactNode;
2843
+ setContent: (content: ReactNode) => void;
2844
+ close: () => void;
2845
+ };
2846
+ export const useDrawer: UseDrawer;
2847
+ export {};
2848
+
2767
2849
  }
2768
2850
  declare module '@layerfi/components/hooks/useElementSize/index' {
2769
2851
  export { useElementSize } from '@layerfi/components/hooks/useElementSize/useElementSize';
@@ -3537,17 +3619,21 @@ declare module '@layerfi/components/types/categories' {
3537
3619
  suggestions: Category[];
3538
3620
  }
3539
3621
  export type Categorization = AutoCategorization | SuggestedCategorization;
3622
+ export type CategoryPayloadObject = {
3623
+ type: 'StableName';
3624
+ stable_name: string;
3625
+ } | {
3626
+ type: 'AccountId';
3627
+ id: string;
3628
+ };
3540
3629
  export type SingleCategoryUpdate = {
3541
3630
  type: 'Category';
3542
- category: {
3543
- type: 'StableName';
3544
- stable_name: string;
3545
- };
3631
+ category: CategoryPayloadObject;
3546
3632
  };
3547
3633
  export type SplitCategoryUpdate = {
3548
3634
  type: 'Split';
3549
3635
  entries: {
3550
- category: string;
3636
+ category: string | CategoryPayloadObject;
3551
3637
  amount: number;
3552
3638
  }[];
3553
3639
  };
@@ -4048,10 +4134,24 @@ declare module '@layerfi/components/types' {
4048
4134
 
4049
4135
  }
4050
4136
  declare module '@layerfi/components/utils/bankTransactions' {
4137
+ import { CategoryOption } from '@layerfi/components/components/CategorySelect/CategorySelect';
4051
4138
  import { BankTransaction } from '@layerfi/components/types';
4052
4139
  export const hasMatch: (bankTransaction?: BankTransaction) => boolean;
4053
4140
  export const isCredit: ({ direction }: Pick<BankTransaction, 'direction'>) => boolean;
4054
4141
  export const isAlreadyMatched: (bankTransaction?: BankTransaction) => string | undefined;
4142
+ export const countTransactionsToReview: ({ transactions, currentMonthOnly, }: {
4143
+ transactions?: BankTransaction[] | undefined;
4144
+ currentMonthOnly?: boolean | undefined;
4145
+ }) => number;
4146
+ export const getCategorizePayload: (category: CategoryOption) => {
4147
+ type: "AccountId";
4148
+ id: string;
4149
+ stable_name?: undefined;
4150
+ } | {
4151
+ type: "StableName";
4152
+ stable_name: string;
4153
+ id?: undefined;
4154
+ };
4055
4155
 
4056
4156
  }
4057
4157
  declare module '@layerfi/components/utils/business' {
@@ -4134,14 +4234,16 @@ declare module '@layerfi/components/views/AccountingOverview/index' {
4134
4234
  }
4135
4235
  declare module '@layerfi/components/views/BankTransactionsWithLinkedAccounts/BankTransactionsWithLinkedAccounts' {
4136
4236
  import React from 'react';
4237
+ import { MobileComponentType } from "@layerfi/components/components/BankTransactions/constants";
4137
4238
  export interface BankTransactionsWithLinkedAccountsProps {
4138
4239
  title?: string;
4139
4240
  elevatedLinkedAccounts?: boolean;
4140
4241
  showLedgerBalance?: boolean;
4141
4242
  showDescriptions?: boolean;
4142
4243
  showReceiptUploads?: boolean;
4244
+ mobileComponent?: MobileComponentType;
4143
4245
  }
4144
- export const BankTransactionsWithLinkedAccounts: ({ title, elevatedLinkedAccounts, showLedgerBalance, showDescriptions, showReceiptUploads, }: BankTransactionsWithLinkedAccountsProps) => React.JSX.Element;
4246
+ export const BankTransactionsWithLinkedAccounts: ({ title, elevatedLinkedAccounts, showLedgerBalance, showDescriptions, showReceiptUploads, mobileComponent, }: BankTransactionsWithLinkedAccountsProps) => React.JSX.Element;
4145
4247
 
4146
4248
  }
4147
4249
  declare module '@layerfi/components/views/BankTransactionsWithLinkedAccounts/index' {