@layerfi/components 0.1.5 → 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
@@ -250,11 +250,14 @@ declare module '@layerfi/components/components/BankTransactionListItem/BankTrans
250
250
  import React from 'react';
251
251
  import { BankTransaction } from '@layerfi/components/types';
252
252
  type Props = {
253
+ index: number;
253
254
  dateFormat: string;
254
255
  bankTransaction: BankTransaction;
255
256
  editable: boolean;
257
+ removeTransaction: (id: string) => void;
258
+ containerWidth?: number;
256
259
  };
257
- export const BankTransactionListItem: ({ dateFormat, bankTransaction, editable, }: Props) => React.JSX.Element | null;
260
+ export const BankTransactionListItem: ({ index, dateFormat, bankTransaction, editable, containerWidth, }: Props) => React.JSX.Element | null;
258
261
  export {};
259
262
 
260
263
  }
@@ -266,13 +269,17 @@ declare module '@layerfi/components/components/BankTransactionRow/BankTransactio
266
269
  import React from 'react';
267
270
  import { BankTransaction, Category } from '@layerfi/components/types';
268
271
  type Props = {
272
+ index: number;
269
273
  dateFormat: string;
270
274
  bankTransaction: BankTransaction;
271
275
  editable: boolean;
276
+ removeTransaction: (id: string) => void;
277
+ containerWidth?: number;
272
278
  };
279
+ export type LastSubmittedForm = 'simple' | 'match' | 'split' | undefined;
273
280
  export const extractDescriptionForSplit: (category: Category) => string;
274
281
  export const getDefaultSelectedCategory: (bankTransaction: BankTransaction) => import("@layerfi/components/components/CategorySelect/CategorySelect").CategoryOption | undefined;
275
- export const BankTransactionRow: ({ dateFormat, bankTransaction, editable, }: Props) => React.JSX.Element | null;
282
+ export const BankTransactionRow: ({ index, dateFormat, bankTransaction, editable, removeTransaction, containerWidth, }: Props) => React.JSX.Element | null;
276
283
  export {};
277
284
 
278
285
  }
@@ -320,14 +327,16 @@ declare module '@layerfi/components/components/Button/Button' {
320
327
  primary = "primary",
321
328
  secondary = "secondary"
322
329
  }
330
+ export type ButtonJustify = 'center' | 'space-between' | 'start';
323
331
  export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
324
332
  variant?: ButtonVariant;
325
333
  leftIcon?: ReactNode;
326
334
  rightIcon?: ReactNode;
327
335
  iconOnly?: ReactNode;
328
336
  iconAsPrimary?: boolean;
337
+ justify?: ButtonJustify;
329
338
  }
330
- export const Button: ({ className, children, variant, leftIcon, rightIcon, iconOnly, iconAsPrimary, ...props }: ButtonProps) => React.JSX.Element;
339
+ export const Button: ({ className, children, variant, leftIcon, rightIcon, iconOnly, iconAsPrimary, justify, ...props }: ButtonProps) => React.JSX.Element;
331
340
 
332
341
  }
333
342
  declare module '@layerfi/components/components/Button/IconButton' {
@@ -338,6 +347,16 @@ declare module '@layerfi/components/components/Button/IconButton' {
338
347
  }
339
348
  export const IconButton: ({ className, children, icon, active, ...props }: IconButtonProps) => React.JSX.Element;
340
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;
359
+
341
360
  }
342
361
  declare module '@layerfi/components/components/Button/SubmitButton' {
343
362
  import React, { ButtonHTMLAttributes } from 'react';
@@ -364,8 +383,9 @@ declare module '@layerfi/components/components/Button/TextButton' {
364
383
  }
365
384
  declare module '@layerfi/components/components/Button/index' {
366
385
  export { Button, ButtonVariant } from '@layerfi/components/components/Button/Button';
367
- export { SubmitButton } from '@layerfi/components/components/Button/SubmitButton';
368
386
  export { IconButton } from '@layerfi/components/components/Button/IconButton';
387
+ export { RetryButton } from '@layerfi/components/components/Button/RetryButton';
388
+ export { SubmitButton } from '@layerfi/components/components/Button/SubmitButton';
369
389
  export { TextButton } from '@layerfi/components/components/Button/TextButton';
370
390
 
371
391
  }
@@ -510,6 +530,17 @@ declare module '@layerfi/components/components/DataState/DataState' {
510
530
  declare module '@layerfi/components/components/DataState/index' {
511
531
  export { DataState, DataStateStatus } from '@layerfi/components/components/DataState/DataState';
512
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
+
513
544
  }
514
545
  declare module '@layerfi/components/components/ExpandedBankTransactionRow/ExpandedBankTransactionRow' {
515
546
  import React from 'react';
@@ -519,7 +550,8 @@ declare module '@layerfi/components/components/ExpandedBankTransactionRow/Expand
519
550
  isOpen?: boolean;
520
551
  asListItem?: boolean;
521
552
  submitBtnText?: string;
522
- close?: () => void;
553
+ containerWidth?: number;
554
+ editable?: boolean;
523
555
  };
524
556
  export type SaveHandle = {
525
557
  save: () => void;
@@ -559,8 +591,9 @@ declare module '@layerfi/components/components/Input/Input' {
559
591
  export interface InputProps extends HTMLProps<HTMLInputElement> {
560
592
  isInvalid?: boolean;
561
593
  errorMessage?: string;
594
+ leftText?: string;
562
595
  }
563
- export const Input: ({ className, isInvalid, errorMessage, ...props }: InputProps) => React.JSX.Element;
596
+ export const Input: ({ className, isInvalid, errorMessage, leftText, ...props }: InputProps) => React.JSX.Element;
564
597
 
565
598
  }
566
599
  declare module '@layerfi/components/components/Input/InputGroup' {
@@ -579,6 +612,24 @@ declare module '@layerfi/components/components/Input/index' {
579
612
  export { InputGroup } from '@layerfi/components/components/Input/InputGroup';
580
613
  export { FileInput } from '@layerfi/components/components/Input/FileInput';
581
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
+
582
633
  }
583
634
  declare module '@layerfi/components/components/Loader/Loader' {
584
635
  import React, { ReactNode } from 'react';
@@ -600,8 +651,9 @@ declare module '@layerfi/components/components/MatchForm/MatchForm' {
600
651
  bankTransaction: BankTransaction;
601
652
  selectedMatchId?: string;
602
653
  setSelectedMatchId: (val?: string) => void;
654
+ matchFormError?: string;
603
655
  }
604
- export const MatchForm: ({ classNamePrefix, bankTransaction, selectedMatchId, setSelectedMatchId, }: MatchFormProps) => React.JSX.Element;
656
+ export const MatchForm: ({ classNamePrefix, bankTransaction, selectedMatchId, setSelectedMatchId, matchFormError, }: MatchFormProps) => React.JSX.Element;
605
657
 
606
658
  }
607
659
  declare module '@layerfi/components/components/MatchForm/index' {
@@ -745,7 +797,11 @@ declare module '@layerfi/components/components/ProfitAndLossTable/index' {
745
797
  }
746
798
  declare module '@layerfi/components/components/ProfitAndLossView/ProfitAndLossView' {
747
799
  import React from 'react';
748
- export const ProfitAndLossView: () => React.JSX.Element;
800
+ export interface ProfitAndLossViewProps {
801
+ hideTable?: boolean;
802
+ hideChart?: boolean;
803
+ }
804
+ export const ProfitAndLossView: (props: ProfitAndLossViewProps) => React.JSX.Element;
749
805
 
750
806
  }
751
807
  declare module '@layerfi/components/components/ProfitAndLossView/index' {
@@ -944,6 +1000,13 @@ declare module '@layerfi/components/components/Tooltip/useTooltip' {
944
1000
  disabled: boolean | undefined;
945
1001
  };
946
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
+
947
1010
  }
948
1011
  declare module '@layerfi/components/components/Typography/Heading' {
949
1012
  import React, { ReactNode } from 'react';
@@ -997,8 +1060,9 @@ declare module '@layerfi/components/components/Typography/Text' {
997
1060
 
998
1061
  }
999
1062
  declare module '@layerfi/components/components/Typography/index' {
1000
- export { Text, TextSize, TextWeight } from '@layerfi/components/components/Typography/Text';
1063
+ export { Text, TextSize, TextWeight, TextUseTooltip } from '@layerfi/components/components/Typography/Text';
1001
1064
  export { Heading, HeadingSize } from '@layerfi/components/components/Typography/Heading';
1065
+ export { ErrorText } from '@layerfi/components/components/Typography/ErrorText';
1002
1066
 
1003
1067
  }
1004
1068
  declare module '@layerfi/components/config/general' {
@@ -1144,6 +1208,25 @@ declare module '@layerfi/components/hooks/useLayerContext/useLayerContext' {
1144
1208
  setTheme: (theme: import("@layerfi/components/types/layer_context").LayerThemeConfig) => void;
1145
1209
  };
1146
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
+
1147
1230
  }
1148
1231
  declare module '@layerfi/components/hooks/usePagination/index' {
1149
1232
  export { usePagination, DOTS } from '@layerfi/components/hooks/usePagination/usePagination';
@@ -1230,6 +1313,13 @@ declare module '@layerfi/components/icons/ChevronDown' {
1230
1313
  const ChevronDown: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1231
1314
  export default ChevronDown;
1232
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
+
1233
1323
  }
1234
1324
  declare module '@layerfi/components/icons/ChevronLeft' {
1235
1325
  import * as React from 'react';
@@ -1251,13 +1341,6 @@ declare module '@layerfi/components/icons/DownloadCloud' {
1251
1341
  const DownloadCloud: (props: SVGProps<SVGSVGElement>) => React.JSX.Element;
1252
1342
  export default DownloadCloud;
1253
1343
 
1254
- }
1255
- declare module '@layerfi/components/icons/Link' {
1256
- import * as React from 'react';
1257
- import { IconSvgProps } from '@layerfi/components/icons/types';
1258
- const Link: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1259
- export default Link;
1260
-
1261
1344
  }
1262
1345
  declare module '@layerfi/components/icons/Loader' {
1263
1346
  import * as React from 'react';
@@ -1294,18 +1377,25 @@ declare module '@layerfi/components/icons/Scissors' {
1294
1377
  export default Scissors;
1295
1378
 
1296
1379
  }
1297
- declare module '@layerfi/components/icons/UploadCloud' {
1380
+ declare module '@layerfi/components/icons/ScissorsFullOpen' {
1298
1381
  import * as React from 'react';
1299
1382
  import { IconSvgProps } from '@layerfi/components/icons/types';
1300
- const UploadCloud: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1301
- export default UploadCloud;
1383
+ const ScissorsFullOpen: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1384
+ export default ScissorsFullOpen;
1302
1385
 
1303
1386
  }
1304
- declare module '@layerfi/components/icons/X' {
1387
+ declare module '@layerfi/components/icons/Trash' {
1305
1388
  import * as React from 'react';
1306
1389
  import { IconSvgProps } from '@layerfi/components/icons/types';
1307
- const X: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1308
- export default X;
1390
+ const Trash: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1391
+ export default Trash;
1392
+
1393
+ }
1394
+ declare module '@layerfi/components/icons/UploadCloud' {
1395
+ import * as React from 'react';
1396
+ import { IconSvgProps } from '@layerfi/components/icons/types';
1397
+ const UploadCloud: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
1398
+ export default UploadCloud;
1309
1399
 
1310
1400
  }
1311
1401
  declare module '@layerfi/components/icons/types' {
@@ -1319,6 +1409,7 @@ declare module '@layerfi/components/index' {
1319
1409
  export { BalanceSheet } from '@layerfi/components/components/BalanceSheet/index';
1320
1410
  export { BankTransactions } from '@layerfi/components/components/BankTransactions/index';
1321
1411
  export { Hello } from '@layerfi/components/components/Hello/index';
1412
+ export { LinkedAccounts } from '@layerfi/components/components/LinkedAccounts/index';
1322
1413
  export { ProfitAndLoss } from '@layerfi/components/components/ProfitAndLoss/index';
1323
1414
  export { ProfitAndLossView } from '@layerfi/components/components/ProfitAndLossView/index';
1324
1415
  export { LayerProvider } from '@layerfi/components/providers/LayerProvider/index';
@@ -1649,6 +1740,14 @@ declare module '@layerfi/components/types/line_item' {
1649
1740
  line_items?: LineItem[] | null;
1650
1741
  }
1651
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
+
1652
1751
  }
1653
1752
  declare module '@layerfi/components/types/profit_and_loss' {
1654
1753
  import { LineItem } from '@layerfi/components/types/line_item';
@@ -1710,6 +1809,8 @@ declare module '@layerfi/components/utils/format' {
1710
1809
  }
1711
1810
  declare module '@layerfi/components/utils/helpers' {
1712
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>;
1713
1814
 
1714
1815
  }
1715
1816
  declare module '@layerfi/components' {