@layerfi/components 0.1.72 → 0.1.74

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
@@ -1004,8 +1004,11 @@ declare module '@layerfi/components/components/BankTransactionMobileList/BankTra
1004
1004
  purpose: Purpose;
1005
1005
  bankTransaction: BankTransaction;
1006
1006
  showTooltips: boolean;
1007
+ showReceiptUploads?: boolean;
1008
+ showDescriptions?: boolean;
1009
+ isOpen?: boolean;
1007
1010
  }
1008
- export const BankTransactionMobileForms: ({ purpose, bankTransaction, showTooltips, }: BankTransactionMobileFormsProps) => React.JSX.Element;
1011
+ export const BankTransactionMobileForms: ({ purpose, bankTransaction, showTooltips, showReceiptUploads, showDescriptions, isOpen, }: BankTransactionMobileFormsProps) => React.JSX.Element;
1009
1012
  export {};
1010
1013
 
1011
1014
  }
@@ -1020,8 +1023,10 @@ declare module '@layerfi/components/components/BankTransactionMobileList/BankTra
1020
1023
  initialLoad?: boolean;
1021
1024
  showTooltips: boolean;
1022
1025
  mode: BankTransactionsMode;
1026
+ showReceiptUploads?: boolean;
1027
+ showDescriptions?: boolean;
1023
1028
  }
1024
- export const BankTransactionMobileList: ({ bankTransactions, removeTransaction, editable, initialLoad, showTooltips, mode, }: BankTransactionMobileListProps) => React.JSX.Element;
1029
+ export const BankTransactionMobileList: ({ bankTransactions, removeTransaction, editable, initialLoad, showTooltips, mode, showReceiptUploads, showDescriptions, }: BankTransactionMobileListProps) => React.JSX.Element;
1025
1030
 
1026
1031
  }
1027
1032
  declare module '@layerfi/components/components/BankTransactionMobileList/BankTransactionMobileListItem' {
@@ -1036,6 +1041,8 @@ declare module '@layerfi/components/components/BankTransactionMobileList/BankTra
1036
1041
  initialLoad?: boolean;
1037
1042
  showTooltips: boolean;
1038
1043
  mode: BankTransactionsMode;
1044
+ showDescriptions?: boolean;
1045
+ showReceiptUploads?: boolean;
1039
1046
  isFirstItem?: boolean;
1040
1047
  }
1041
1048
  export enum Purpose {
@@ -1043,7 +1050,7 @@ declare module '@layerfi/components/components/BankTransactionMobileList/BankTra
1043
1050
  personal = "personal",
1044
1051
  more = "more"
1045
1052
  }
1046
- export const BankTransactionMobileListItem: ({ index, bankTransaction, removeTransaction, editable, mode, initialLoad, showTooltips, isFirstItem, }: BankTransactionMobileListItemProps) => React.JSX.Element;
1053
+ export const BankTransactionMobileListItem: ({ index, bankTransaction, removeTransaction, editable, mode, initialLoad, showTooltips, isFirstItem, showDescriptions, showReceiptUploads, }: BankTransactionMobileListItemProps) => React.JSX.Element;
1047
1054
 
1048
1055
  }
1049
1056
  declare module '@layerfi/components/components/BankTransactionMobileList/BusinessCategories' {
@@ -1063,16 +1070,20 @@ declare module '@layerfi/components/components/BankTransactionMobileList/Busines
1063
1070
  interface BusinessFormProps {
1064
1071
  bankTransaction: BankTransaction;
1065
1072
  showTooltips: boolean;
1073
+ showReceiptUploads?: boolean;
1074
+ showDescriptions?: boolean;
1066
1075
  }
1067
- export const BusinessForm: ({ bankTransaction, showTooltips, }: BusinessFormProps) => React.JSX.Element;
1076
+ export const BusinessForm: ({ bankTransaction, showTooltips, showReceiptUploads, showDescriptions, }: BusinessFormProps) => React.JSX.Element;
1068
1077
  export {};
1069
1078
 
1070
1079
  }
1071
1080
  declare module '@layerfi/components/components/BankTransactionMobileList/MatchForm' {
1072
1081
  import React from 'react';
1073
1082
  import { BankTransaction } from '@layerfi/components/types';
1074
- export const MatchForm: ({ bankTransaction, }: {
1083
+ export const MatchForm: ({ bankTransaction, showReceiptUploads, showDescriptions, }: {
1075
1084
  bankTransaction: BankTransaction;
1085
+ showReceiptUploads?: boolean | undefined;
1086
+ showDescriptions?: boolean | undefined;
1076
1087
  }) => React.JSX.Element;
1077
1088
 
1078
1089
  }
@@ -1081,8 +1092,11 @@ declare module '@layerfi/components/components/BankTransactionMobileList/Persona
1081
1092
  import { BankTransaction } from '@layerfi/components/types';
1082
1093
  interface PersonalFormProps {
1083
1094
  bankTransaction: BankTransaction;
1095
+ showReceiptUploads?: boolean;
1096
+ showDescriptions?: boolean;
1097
+ isOpen?: boolean;
1084
1098
  }
1085
- export const PersonalForm: ({ bankTransaction }: PersonalFormProps) => React.JSX.Element;
1099
+ export const PersonalForm: ({ bankTransaction, showReceiptUploads, isOpen, showDescriptions, }: PersonalFormProps) => React.JSX.Element;
1086
1100
  export {};
1087
1101
 
1088
1102
  }
@@ -1092,17 +1106,22 @@ declare module '@layerfi/components/components/BankTransactionMobileList/SplitAn
1092
1106
  interface SplitAndMatchFormProps {
1093
1107
  bankTransaction: BankTransaction;
1094
1108
  showTooltips: boolean;
1109
+ showReceiptUploads?: boolean;
1110
+ showDescriptions?: boolean;
1111
+ isOpen?: boolean;
1095
1112
  }
1096
- export const SplitAndMatchForm: ({ bankTransaction, showTooltips, }: SplitAndMatchFormProps) => React.JSX.Element;
1113
+ export const SplitAndMatchForm: ({ bankTransaction, showTooltips, showReceiptUploads, isOpen, showDescriptions, }: SplitAndMatchFormProps) => React.JSX.Element;
1097
1114
  export {};
1098
1115
 
1099
1116
  }
1100
1117
  declare module '@layerfi/components/components/BankTransactionMobileList/SplitForm' {
1101
1118
  import React from 'react';
1102
1119
  import { BankTransaction } from '@layerfi/components/types';
1103
- export const SplitForm: ({ bankTransaction, showTooltips, }: {
1120
+ export const SplitForm: ({ bankTransaction, showTooltips, showReceiptUploads, showDescriptions, }: {
1104
1121
  bankTransaction: BankTransaction;
1105
1122
  showTooltips: boolean;
1123
+ showReceiptUploads?: boolean | undefined;
1124
+ showDescriptions?: boolean | undefined;
1106
1125
  }) => React.JSX.Element;
1107
1126
 
1108
1127
  }
@@ -1133,6 +1152,36 @@ declare module '@layerfi/components/components/BankTransactionMobileList/constan
1133
1152
  declare module '@layerfi/components/components/BankTransactionMobileList/index' {
1134
1153
  export { BankTransactionMobileList } from '@layerfi/components/components/BankTransactionMobileList/BankTransactionMobileList';
1135
1154
 
1155
+ }
1156
+ declare module '@layerfi/components/components/BankTransactionMobileList/useMemoText' {
1157
+ import React, { ReactNode } from 'react';
1158
+ import { BankTransaction } from '@layerfi/components/types';
1159
+ interface MemoTextProps {
1160
+ bankTransaction: BankTransaction;
1161
+ isActive?: boolean;
1162
+ }
1163
+ interface MemoTextProviderProps extends MemoTextProps {
1164
+ children: ReactNode;
1165
+ }
1166
+ export type MemoTextContextType = ReturnType<typeof useMemoText>;
1167
+ export const MemoTextContext: React.Context<{
1168
+ memoText: string | undefined;
1169
+ setMemoText: React.Dispatch<React.SetStateAction<string | undefined>>;
1170
+ saveMemoText: () => Promise<void>;
1171
+ }>;
1172
+ export const useMemoTextContext: () => {
1173
+ memoText: string | undefined;
1174
+ setMemoText: React.Dispatch<React.SetStateAction<string | undefined>>;
1175
+ saveMemoText: () => Promise<void>;
1176
+ };
1177
+ const useMemoText: ({ bankTransaction, isActive }: MemoTextProps) => {
1178
+ memoText: string | undefined;
1179
+ setMemoText: React.Dispatch<React.SetStateAction<string | undefined>>;
1180
+ saveMemoText: () => Promise<void>;
1181
+ };
1182
+ export const MemoTextProvider: ({ children, bankTransaction, isActive, }: MemoTextProviderProps) => React.JSX.Element;
1183
+ export {};
1184
+
1136
1185
  }
1137
1186
  declare module '@layerfi/components/components/BankTransactionMobileList/utils' {
1138
1187
  import { BankTransaction, Category } from '@layerfi/components/types';
@@ -1153,6 +1202,39 @@ declare module '@layerfi/components/components/BankTransactionMobileList/utils'
1153
1202
  export const flattenCategories: (categories: Category[]) => Option[];
1154
1203
  export const getAssignedValue: (bankTransaction: BankTransaction) => Option | undefined;
1155
1204
 
1205
+ }
1206
+ declare module '@layerfi/components/components/BankTransactionReceipts/BankTransactionReceipts' {
1207
+ import React from 'react';
1208
+ import { BankTransaction } from '@layerfi/components/types';
1209
+ export interface DocumentWithStatus {
1210
+ id?: string;
1211
+ url?: string;
1212
+ status: 'pending' | 'uploaded' | 'failed' | 'deleting';
1213
+ type?: string;
1214
+ name?: string;
1215
+ date?: string;
1216
+ error?: string;
1217
+ }
1218
+ export interface BankTransactionReceiptsProps {
1219
+ classNamePrefix?: string;
1220
+ floatingActions?: boolean;
1221
+ hideUploadButtons?: boolean;
1222
+ label?: string;
1223
+ }
1224
+ export interface BankTransactionReceiptsWithProviderProps extends BankTransactionReceiptsProps {
1225
+ bankTransaction: BankTransaction;
1226
+ isActive?: boolean;
1227
+ }
1228
+ export interface BankTransactionReceiptsHandle {
1229
+ uploadReceipt: (file: File) => void;
1230
+ }
1231
+ export const BankTransactionReceiptsWithProvider: React.ForwardRefExoticComponent<BankTransactionReceiptsWithProviderProps & React.RefAttributes<BankTransactionReceiptsHandle>>;
1232
+ export const BankTransactionReceipts: React.ForwardRefExoticComponent<BankTransactionReceiptsProps & React.RefAttributes<BankTransactionReceiptsHandle>>;
1233
+
1234
+ }
1235
+ declare module '@layerfi/components/components/BankTransactionReceipts/index' {
1236
+ export { BankTransactionReceipts, BankTransactionReceiptsWithProvider, } from '@layerfi/components/components/BankTransactionReceipts/BankTransactionReceipts';
1237
+
1156
1238
  }
1157
1239
  declare module '@layerfi/components/components/BankTransactionRow/BankTransactionRow' {
1158
1240
  import React from 'react';
@@ -2006,6 +2088,7 @@ declare module '@layerfi/components/components/FileThumb/FileThumb' {
2006
2088
  export interface FileThumbProps {
2007
2089
  url?: string;
2008
2090
  type?: string;
2091
+ floatingActions?: boolean;
2009
2092
  uploadPending?: boolean;
2010
2093
  deletePending?: boolean;
2011
2094
  name?: string;
@@ -2016,7 +2099,7 @@ declare module '@layerfi/components/components/FileThumb/FileThumb' {
2016
2099
  enableDownload?: boolean;
2017
2100
  error?: string;
2018
2101
  }
2019
- export const FileThumb: ({ url, type, uploadPending, deletePending, name, date, onDelete, enableOpen, onOpen, enableDownload, error, }: FileThumbProps) => React.JSX.Element;
2102
+ export const FileThumb: ({ url, type, floatingActions, uploadPending, deletePending, name, date, onDelete, enableOpen, onOpen, enableDownload, error, }: FileThumbProps) => React.JSX.Element;
2020
2103
 
2021
2104
  }
2022
2105
  declare module '@layerfi/components/components/FileThumb/index' {
@@ -2109,8 +2192,10 @@ declare module '@layerfi/components/components/Input/FileInput' {
2109
2192
  onUpload?: (file: File) => void;
2110
2193
  disabled?: boolean;
2111
2194
  secondary?: boolean;
2195
+ iconOnly?: boolean;
2196
+ icon?: React.ReactNode;
2112
2197
  }
2113
- export const FileInput: ({ text, onUpload, disabled, secondary, }: FileInputProps) => React.JSX.Element;
2198
+ export const FileInput: ({ text, onUpload, disabled, secondary, iconOnly, icon, }: FileInputProps) => React.JSX.Element;
2114
2199
 
2115
2200
  }
2116
2201
  declare module '@layerfi/components/components/Input/Input' {
@@ -2728,11 +2813,12 @@ declare module '@layerfi/components/components/ProfitAndLoss/ProfitAndLoss' {
2728
2813
  }>;
2729
2814
  DatePicker: ({ allowedDatePickerModes, datePickerMode: deprecated_datePickerMode, defaultDatePickerMode, customDateRanges, }: import("@layerfi/components/views/Reports/reportTypes").TimeRangePickerConfig) => React.JSX.Element;
2730
2815
  CompareOptions: ({ tagComparisonOptions, defaultTagFilter: defaultOption, }: import("@layerfi/components/components/ProfitAndLossCompareOptions/index").ProfitAndLossCompareOptionsProps) => React.JSX.Element;
2731
- Summaries: ({ vertical, actionable, revenueLabel, stringOverrides, }: {
2816
+ Summaries: ({ vertical, actionable, revenueLabel, stringOverrides, chartColorsList, }: {
2732
2817
  vertical?: boolean | undefined;
2733
2818
  actionable?: boolean | undefined;
2734
2819
  revenueLabel?: string | undefined;
2735
2820
  stringOverrides?: import("@layerfi/components/components/ProfitAndLossSummaries/ProfitAndLossSummaries").ProfitAndLossSummariesStringOverrides | undefined;
2821
+ chartColorsList?: string[] | undefined;
2736
2822
  }) => React.JSX.Element;
2737
2823
  Table: (props: import("@layerfi/components/components/ProfitAndLossTable/ProfitAndLossTableComponent").ProfitAndLossTableProps) => React.JSX.Element;
2738
2824
  DetailedCharts: ({ scope, hideClose, showDatePicker, chartColorsList, stringOverrides, }: {
@@ -2866,10 +2952,11 @@ declare module '@layerfi/components/components/ProfitAndLossDetailedCharts/Detai
2866
2952
  chartColorsList?: string[];
2867
2953
  stringOverrides?: DetailedTableStringOverrides;
2868
2954
  }
2869
- export const mapTypesToColors: (data: any[], colorList?: string[]) => {
2870
- color: any;
2871
- opacity: any;
2872
- }[];
2955
+ export interface TypeColorMapping {
2956
+ color: string;
2957
+ opacity: number;
2958
+ }
2959
+ export const mapTypesToColors: (data: LineBaseItem[], colorList?: string[]) => TypeColorMapping[];
2873
2960
  export const DetailedTable: ({ filteredData, sidebarScope, filters, sortBy, hoveredItem, setHoveredItem, chartColorsList, stringOverrides, }: DetailedTableProps) => React.JSX.Element;
2874
2961
 
2875
2962
  }
@@ -2970,8 +3057,9 @@ declare module '@layerfi/components/components/ProfitAndLossSummaries/MiniChart'
2970
3057
  import { LineBaseItem } from '@layerfi/components/types/line_item';
2971
3058
  export interface MiniChartProps {
2972
3059
  data: LineBaseItem[];
3060
+ chartColorsList?: string[];
2973
3061
  }
2974
- export const MiniChart: ({ data }: MiniChartProps) => React.JSX.Element;
3062
+ export const MiniChart: ({ data, chartColorsList }: MiniChartProps) => React.JSX.Element;
2975
3063
 
2976
3064
  }
2977
3065
  declare module '@layerfi/components/components/ProfitAndLossSummaries/ProfitAndLossSummaries' {
@@ -2981,13 +3069,17 @@ declare module '@layerfi/components/components/ProfitAndLossSummaries/ProfitAndL
2981
3069
  expensesLabel?: string;
2982
3070
  netProfitLabel?: string;
2983
3071
  }
2984
- type Props = {
3072
+ type ProfitAndLossSummariesProps = {
2985
3073
  vertical?: boolean;
2986
3074
  actionable?: boolean;
3075
+ /**
3076
+ * @deprecated Use `stringOverrides.revenueLabel` instead
3077
+ */
2987
3078
  revenueLabel?: string;
2988
3079
  stringOverrides?: ProfitAndLossSummariesStringOverrides;
3080
+ chartColorsList?: string[];
2989
3081
  };
2990
- export const ProfitAndLossSummaries: ({ vertical, actionable, revenueLabel, stringOverrides, }: Props) => React.JSX.Element;
3082
+ export const ProfitAndLossSummaries: ({ vertical, actionable, revenueLabel, stringOverrides, chartColorsList, }: ProfitAndLossSummariesProps) => React.JSX.Element;
2991
3083
  export {};
2992
3084
 
2993
3085
  }
@@ -4003,6 +4095,26 @@ declare module '@layerfi/components/contexts/ProfitAndLossComparisonContext/Prof
4003
4095
  declare module '@layerfi/components/contexts/ProfitAndLossComparisonContext/index' {
4004
4096
  export { PNLComparisonContext } from '@layerfi/components/contexts/ProfitAndLossComparisonContext/ProfitAndLossComparisonContext';
4005
4097
 
4098
+ }
4099
+ declare module '@layerfi/components/contexts/ReceiptsContext/ReceiptsContext' {
4100
+ /// <reference types="react" />
4101
+ import { useReceipts } from '@layerfi/components/hooks/useReceipts/index';
4102
+ export type ReceiptsContextType = ReturnType<typeof useReceipts>;
4103
+ export const ReceiptsContext: import("react").Context<{
4104
+ receiptUrls: import("@layerfi/components/components/BankTransactionReceipts/BankTransactionReceipts").DocumentWithStatus[];
4105
+ uploadReceipt: (file: File) => void;
4106
+ archiveDocument: (document: import("@layerfi/components/components/BankTransactionReceipts/BankTransactionReceipts").DocumentWithStatus) => void;
4107
+ }>;
4108
+ export const useReceiptsContext: () => {
4109
+ receiptUrls: import("@layerfi/components/components/BankTransactionReceipts/BankTransactionReceipts").DocumentWithStatus[];
4110
+ uploadReceipt: (file: File) => void;
4111
+ archiveDocument: (document: import("@layerfi/components/components/BankTransactionReceipts/BankTransactionReceipts").DocumentWithStatus) => void;
4112
+ };
4113
+
4114
+ }
4115
+ declare module '@layerfi/components/contexts/ReceiptsContext/index' {
4116
+ export { ReceiptsContext } from '@layerfi/components/contexts/ReceiptsContext/ReceiptsContext';
4117
+
4006
4118
  }
4007
4119
  declare module '@layerfi/components/contexts/StatementOfCashContext/StatementOfCashFlowContext' {
4008
4120
  /// <reference types="react" />
@@ -4525,6 +4637,26 @@ declare module '@layerfi/components/hooks/useQuickbooks/useQuickbooks' {
4525
4637
  export const useQuickbooks: UseQuickbooks;
4526
4638
  export {};
4527
4639
 
4640
+ }
4641
+ declare module '@layerfi/components/hooks/useReceipts/index' {
4642
+ export { useReceipts } from '@layerfi/components/hooks/useReceipts/useReceipts';
4643
+
4644
+ }
4645
+ declare module '@layerfi/components/hooks/useReceipts/useReceipts' {
4646
+ import { DocumentWithStatus } from '@layerfi/components/components/BankTransactionReceipts/BankTransactionReceipts';
4647
+ import { BankTransaction } from '@layerfi/components/types';
4648
+ export interface UseReceiptsProps {
4649
+ bankTransaction: BankTransaction;
4650
+ isActive?: boolean;
4651
+ }
4652
+ type UseReceipts = (props: UseReceiptsProps) => {
4653
+ receiptUrls: DocumentWithStatus[];
4654
+ uploadReceipt: (file: File) => void;
4655
+ archiveDocument: (document: DocumentWithStatus) => void;
4656
+ };
4657
+ export const useReceipts: UseReceipts;
4658
+ export {};
4659
+
4528
4660
  }
4529
4661
  declare module '@layerfi/components/hooks/useStatementOfCashFlow/index' {
4530
4662
  export { useStatementOfCashFlow } from '@layerfi/components/hooks/useStatementOfCashFlow/useStatementOfCashFlow';
@@ -4793,6 +4925,13 @@ declare module '@layerfi/components/icons/MoreVertical' {
4793
4925
  const MoreVertical: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
4794
4926
  export default MoreVertical;
4795
4927
 
4928
+ }
4929
+ declare module '@layerfi/components/icons/Paperclip' {
4930
+ import React from 'react';
4931
+ import { IconSvgProps } from '@layerfi/components/icons/types';
4932
+ const Paperclip: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
4933
+ export default Paperclip;
4934
+
4796
4935
  }
4797
4936
  declare module '@layerfi/components/icons/PieChart' {
4798
4937
  import * as React from 'react';
@@ -5042,6 +5181,22 @@ declare module '@layerfi/components/providers/LinkedAccountsProvider/LinkedAccou
5042
5181
  declare module '@layerfi/components/providers/LinkedAccountsProvider/index' {
5043
5182
  export { LinkedAccountsProvider } from '@layerfi/components/providers/LinkedAccountsProvider/LinkedAccountsProvider';
5044
5183
 
5184
+ }
5185
+ declare module '@layerfi/components/providers/ReceiptsProvider/ReceiptsProvider' {
5186
+ import React, { ReactNode } from 'react';
5187
+ import { BankTransaction } from '@layerfi/components/types';
5188
+ interface ReceiptsProviderProps {
5189
+ children: ReactNode;
5190
+ bankTransaction: BankTransaction;
5191
+ isActive?: boolean;
5192
+ }
5193
+ export const ReceiptsProvider: ({ children, bankTransaction, isActive, }: ReceiptsProviderProps) => React.JSX.Element;
5194
+ export {};
5195
+
5196
+ }
5197
+ declare module '@layerfi/components/providers/ReceiptsProvider/index' {
5198
+ export { ReceiptsProvider } from '@layerfi/components/providers/ReceiptsProvider/ReceiptsProvider';
5199
+
5045
5200
  }
5046
5201
  declare module '@layerfi/components/types/api' {
5047
5202
  export interface PaginationMetadata {
@@ -5942,6 +6097,7 @@ declare module '@layerfi/components/utils/bankTransactions' {
5942
6097
  exclusion_type?: undefined;
5943
6098
  id?: undefined;
5944
6099
  };
6100
+ export const hasReceipts: (bankTransaction?: BankTransaction) => boolean | undefined;
5945
6101
 
5946
6102
  }
5947
6103
  declare module '@layerfi/components/utils/business' {