@layerfi/components 0.1.79 → 0.1.81

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
@@ -20,17 +20,24 @@ declare module '@layerfi/components/api/layer/authenticated_http' {
20
20
  }
21
21
  declare module '@layerfi/components/api/layer/balance_sheet' {
22
22
  import { BalanceSheet } from '@layerfi/components/types';
23
- export const getBalanceSheet: (baseUrl: string, accessToken: string | undefined, options?: {
24
- params?: GetBalanceSheetParams | undefined;
25
- } | undefined) => () => Promise<GetBalanceSheetReturn>;
26
- export type GetBalanceSheetReturn = {
23
+ import type { S3PresignedUrl } from '@layerfi/components/types/general';
24
+ type GetBalanceSheetParams = {
25
+ businessId: string;
26
+ effectiveDate: string;
27
+ };
28
+ type GetBalanceSheetReturn = {
27
29
  data?: BalanceSheet;
28
30
  error?: unknown;
29
31
  };
30
- export interface GetBalanceSheetParams extends Record<string, string | undefined> {
31
- businessId: string;
32
- effectiveDate: string;
33
- }
32
+ export const getBalanceSheet: (baseUrl: string, accessToken: string | undefined, options?: {
33
+ params?: GetBalanceSheetParams | undefined;
34
+ } | undefined) => () => Promise<GetBalanceSheetReturn>;
35
+ export const getBalanceSheetCSV: (baseUrl: string, accessToken: string | undefined, options?: {
36
+ params?: GetBalanceSheetParams | undefined;
37
+ } | undefined) => () => Promise<{
38
+ data: S3PresignedUrl;
39
+ }>;
40
+ export {};
34
41
 
35
42
  }
36
43
  declare module '@layerfi/components/api/layer/bankTransactions' {
@@ -414,18 +421,25 @@ declare module '@layerfi/components/api/layer/quickbooks' {
414
421
  }
415
422
  declare module '@layerfi/components/api/layer/statement-of-cash-flow' {
416
423
  import { StatementOfCashFlow } from '@layerfi/components/types';
417
- export const getStatementOfCashFlow: (baseUrl: string, accessToken: string | undefined, options?: {
418
- params?: GetStatementOfCashFlowParams | undefined;
419
- } | undefined) => () => Promise<GetStatementOfCashFlowReturn>;
420
- export type GetStatementOfCashFlowReturn = {
421
- data?: StatementOfCashFlow;
422
- error?: unknown;
423
- };
424
- export interface GetStatementOfCashFlowParams extends Record<string, string | undefined> {
424
+ import type { S3PresignedUrl } from '@layerfi/components/types/general';
425
+ type GetStatementOfCashFlowParams = {
425
426
  businessId: string;
426
427
  startDate: string;
427
428
  endDate: string;
428
- }
429
+ };
430
+ type GetStatementOfCashFlowReturn = {
431
+ data?: StatementOfCashFlow;
432
+ error?: unknown;
433
+ };
434
+ export const getStatementOfCashFlow: (baseUrl: string, accessToken: string | undefined, options?: {
435
+ params?: GetStatementOfCashFlowParams | undefined;
436
+ } | undefined) => () => Promise<GetStatementOfCashFlowReturn>;
437
+ export const getCashflowStatementCSV: (baseUrl: string, accessToken: string | undefined, options?: {
438
+ params?: GetStatementOfCashFlowParams | undefined;
439
+ } | undefined) => () => Promise<{
440
+ data: S3PresignedUrl;
441
+ }>;
442
+ export {};
429
443
 
430
444
  }
431
445
  declare module '@layerfi/components/api/layer/tasks' {
@@ -495,8 +509,14 @@ declare module '@layerfi/components/api/layer' {
495
509
  data: import("@layerfi/components/types").Account;
496
510
  }>;
497
511
  getBalanceSheet: (baseUrl: string, accessToken: string | undefined, options?: {
498
- params?: import("@layerfi/components/api/layer/balance_sheet").GetBalanceSheetParams | undefined;
499
- } | undefined) => () => Promise<import("@layerfi/components/api/layer/balance_sheet").GetBalanceSheetReturn>;
512
+ params?: {
513
+ businessId: string;
514
+ effectiveDate: string;
515
+ } | undefined;
516
+ } | undefined) => () => Promise<{
517
+ data?: import("@layerfi/components/types").BalanceSheet;
518
+ error?: unknown;
519
+ }>;
500
520
  getBankTransactions: (baseUrl: string, accessToken: string | undefined, options?: {
501
521
  params?: import("@layerfi/components/api/layer/bankTransactions").GetBankTransactionsParams | undefined;
502
522
  } | undefined) => () => Promise<import("@layerfi/components/api/layer/bankTransactions").GetBankTransactionsReturn>;
@@ -746,8 +766,15 @@ declare module '@layerfi/components/api/layer' {
746
766
  body?: Record<string, unknown> | undefined;
747
767
  } | undefined) => Promise<Record<string, unknown>>;
748
768
  getStatementOfCashFlow: (baseUrl: string, accessToken: string | undefined, options?: {
749
- params?: import("@layerfi/components/api/layer/statement-of-cash-flow").GetStatementOfCashFlowParams | undefined;
750
- } | undefined) => () => Promise<import("@layerfi/components/api/layer/statement-of-cash-flow").GetStatementOfCashFlowReturn>;
769
+ params?: {
770
+ businessId: string;
771
+ startDate: string;
772
+ endDate: string;
773
+ } | undefined;
774
+ } | undefined) => () => Promise<{
775
+ data?: import("@layerfi/components/types").StatementOfCashFlow;
776
+ error?: unknown;
777
+ }>;
751
778
  syncFromQuickbooks: (baseUrl: string, accessToken: string | undefined, options?: {
752
779
  params?: {
753
780
  businessId: string;
@@ -902,6 +929,33 @@ declare module '@layerfi/components/components/BalanceSheet/constants' {
902
929
  lineItem: string;
903
930
  }[];
904
931
 
932
+ }
933
+ declare module '@layerfi/components/components/BalanceSheet/download/BalanceSheetDownloadButton' {
934
+ import React from 'react';
935
+ type BalanceSheetDownloadButtonProps = {
936
+ effectiveDate: Date;
937
+ iconOnly?: boolean;
938
+ };
939
+ export function BalanceSheetDownloadButton({ effectiveDate, iconOnly, }: BalanceSheetDownloadButtonProps): React.JSX.Element;
940
+ export {};
941
+
942
+ }
943
+ declare module '@layerfi/components/components/BalanceSheet/download/useBalanceSheetDownload' {
944
+ import type { S3PresignedUrl } from '@layerfi/components/types/general';
945
+ import type { Awaitable } from '@layerfi/components/types/utility/promises';
946
+ type UseBalanceSheetOptions = {
947
+ effectiveDate: Date;
948
+ onSuccess?: (url: S3PresignedUrl) => Awaitable<unknown>;
949
+ };
950
+ export function useBalanceSheetDownload({ effectiveDate, onSuccess, }: UseBalanceSheetOptions): import("swr/mutation").SWRMutationResponse<unknown, any, () => {
951
+ accessToken: string;
952
+ apiUrl: string;
953
+ businessId: string;
954
+ effectiveDate: Date;
955
+ tags: string[];
956
+ } | undefined, never>;
957
+ export {};
958
+
905
959
  }
906
960
  declare module '@layerfi/components/components/BalanceSheet/index' {
907
961
  export { BalanceSheet } from '@layerfi/components/components/BalanceSheet/BalanceSheet';
@@ -1018,11 +1072,12 @@ declare module '@layerfi/components/components/BankTransactionMobileList/BankTra
1018
1072
  purpose: Purpose;
1019
1073
  bankTransaction: BankTransaction;
1020
1074
  showTooltips: boolean;
1075
+ showCategorization?: boolean;
1021
1076
  showReceiptUploads?: boolean;
1022
1077
  showDescriptions?: boolean;
1023
1078
  isOpen?: boolean;
1024
1079
  }
1025
- export const BankTransactionMobileForms: ({ purpose, bankTransaction, showTooltips, showReceiptUploads, showDescriptions, isOpen, }: BankTransactionMobileFormsProps) => React.JSX.Element;
1080
+ export const BankTransactionMobileForms: ({ purpose, bankTransaction, showTooltips, showCategorization, showReceiptUploads, showDescriptions, isOpen, }: BankTransactionMobileFormsProps) => React.JSX.Element;
1026
1081
  export {};
1027
1082
 
1028
1083
  }
@@ -1084,10 +1139,11 @@ declare module '@layerfi/components/components/BankTransactionMobileList/Busines
1084
1139
  interface BusinessFormProps {
1085
1140
  bankTransaction: BankTransaction;
1086
1141
  showTooltips: boolean;
1142
+ showCategorization?: boolean;
1087
1143
  showReceiptUploads?: boolean;
1088
1144
  showDescriptions?: boolean;
1089
1145
  }
1090
- export const BusinessForm: ({ bankTransaction, showTooltips, showReceiptUploads, showDescriptions, }: BusinessFormProps) => React.JSX.Element;
1146
+ export const BusinessForm: ({ bankTransaction, showTooltips, showCategorization, showReceiptUploads, showDescriptions, }: BusinessFormProps) => React.JSX.Element;
1091
1147
  export {};
1092
1148
 
1093
1149
  }
@@ -1119,6 +1175,7 @@ declare module '@layerfi/components/components/BankTransactionMobileList/SplitAn
1119
1175
  interface SplitAndMatchFormProps {
1120
1176
  bankTransaction: BankTransaction;
1121
1177
  showTooltips: boolean;
1178
+ showCategorization?: boolean;
1122
1179
  showReceiptUploads?: boolean;
1123
1180
  showDescriptions?: boolean;
1124
1181
  }
@@ -1129,9 +1186,10 @@ declare module '@layerfi/components/components/BankTransactionMobileList/SplitAn
1129
1186
  declare module '@layerfi/components/components/BankTransactionMobileList/SplitForm' {
1130
1187
  import React from 'react';
1131
1188
  import { BankTransaction } from '@layerfi/components/types';
1132
- export const SplitForm: ({ bankTransaction, showTooltips, showReceiptUploads, showDescriptions, }: {
1189
+ export const SplitForm: ({ bankTransaction, showTooltips, showCategorization, showReceiptUploads, showDescriptions, }: {
1133
1190
  bankTransaction: BankTransaction;
1134
1191
  showTooltips: boolean;
1192
+ showCategorization?: boolean;
1135
1193
  showReceiptUploads?: boolean;
1136
1194
  showDescriptions?: boolean;
1137
1195
  }) => React.JSX.Element;
@@ -3309,6 +3367,36 @@ declare module '@layerfi/components/components/StatementOfCashFlow/constants' {
3309
3367
  }[];
3310
3368
  export const ADJUSTMENTS_ROW_NAME = "Adjustments to Net Income";
3311
3369
 
3370
+ }
3371
+ declare module '@layerfi/components/components/StatementOfCashFlow/download/CashflowStatementDownloadButton' {
3372
+ import React from 'react';
3373
+ type CashflowStatementDownloadButtonProps = {
3374
+ startDate: Date;
3375
+ endDate: Date;
3376
+ iconOnly?: boolean;
3377
+ };
3378
+ export function CashflowStatementDownloadButton({ startDate, endDate, iconOnly, }: CashflowStatementDownloadButtonProps): React.JSX.Element;
3379
+ export {};
3380
+
3381
+ }
3382
+ declare module '@layerfi/components/components/StatementOfCashFlow/download/useCashflowStatementDownload' {
3383
+ import type { S3PresignedUrl } from '@layerfi/components/types/general';
3384
+ import type { Awaitable } from '@layerfi/components/types/utility/promises';
3385
+ type UseCashflowStatementDownloadOptions = {
3386
+ startDate: Date;
3387
+ endDate: Date;
3388
+ onSuccess?: (url: S3PresignedUrl) => Awaitable<unknown>;
3389
+ };
3390
+ export function useCashflowStatementDownload({ startDate, endDate, onSuccess, }: UseCashflowStatementDownloadOptions): import("swr/mutation").SWRMutationResponse<unknown, any, () => {
3391
+ accessToken: string;
3392
+ apiUrl: string;
3393
+ businessId: string;
3394
+ startDate: Date;
3395
+ endDate: Date;
3396
+ tags: string[];
3397
+ } | undefined, never>;
3398
+ export {};
3399
+
3312
3400
  }
3313
3401
  declare module '@layerfi/components/components/StatementOfCashFlow/index' {
3314
3402
  export { StatementOfCashFlow } from '@layerfi/components/components/StatementOfCashFlow/StatementOfCashFlow';
@@ -3910,7 +3998,8 @@ declare module '@layerfi/components/components/ui/Stack/Stack' {
3910
3998
  justify?: 'center';
3911
3999
  slot?: string;
3912
4000
  }>;
3913
- export function VStack({ align, children, gap, justify, ...restProps }: StackProps): React.JSX.Element;
4001
+ export function VStack(props: StackProps): React.JSX.Element;
4002
+ export function HStack(props: StackProps): React.JSX.Element;
3914
4003
 
3915
4004
  }
3916
4005
  declare module '@layerfi/components/components/ui/Typography/Heading' {
@@ -3956,6 +4045,23 @@ declare module '@layerfi/components/components/utility/ConditionalList' {
3956
4045
  export function ConditionalList<T>({ list, isLoading, Empty, Container, Loading, children }: ConditionalListProps<T>): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
3957
4046
  export {};
3958
4047
 
4048
+ }
4049
+ declare module '@layerfi/components/components/utility/InvisibleDownload' {
4050
+ import React from 'react';
4051
+ type InvisibleDownloadHandle = {
4052
+ trigger: (options: {
4053
+ url: string;
4054
+ }) => Promise<void>;
4055
+ };
4056
+ export function useInvisibleDownload(): {
4057
+ invisibleDownloadRef: React.RefObject<InvisibleDownloadHandle>;
4058
+ triggerInvisibleDownload: (options: {
4059
+ url: string;
4060
+ }) => void;
4061
+ };
4062
+ const InvisibleDownload: React.ForwardRefExoticComponent<React.RefAttributes<InvisibleDownloadHandle>>;
4063
+ export default InvisibleDownload;
4064
+
3959
4065
  }
3960
4066
  declare module '@layerfi/components/config/charts' {
3961
4067
  export const INACTIVE_OPACITY_LEVELS: number[];
@@ -4542,14 +4648,13 @@ declare module '@layerfi/components/hooks/useElementSize/useElementSize' {
4542
4648
  clientHeight: number;
4543
4649
  }) => void) => import("react").RefObject<T>;
4544
4650
 
4545
- }
4546
- declare module '@layerfi/components/hooks/useElementViewSize/index' {
4547
- export { useElementViewSize } from '@layerfi/components/hooks/useElementViewSize/useElementViewSize';
4548
-
4549
4651
  }
4550
4652
  declare module '@layerfi/components/hooks/useElementViewSize/useElementViewSize' {
4551
4653
  import { View } from '@layerfi/components/types/general';
4552
- export const useElementViewSize: <T extends HTMLElement>(callback: (view: View) => void) => import("react").RefObject<T>;
4654
+ export const useElementViewSize: <T extends HTMLElement>() => {
4655
+ view: View;
4656
+ containerRef: import("react").RefObject<T>;
4657
+ };
4553
4658
 
4554
4659
  }
4555
4660
  declare module '@layerfi/components/hooks/useIsVisible/index' {
@@ -6429,6 +6534,10 @@ declare module '@layerfi/components/utils/colors' {
6429
6534
  */
6430
6535
  export const buildColorsPalette: (theme?: LayerThemeConfig) => ColorsPalette;
6431
6536
 
6537
+ }
6538
+ declare module '@layerfi/components/utils/delay/runDelayed' {
6539
+ export function runDelayedSync<T>(block: () => T, delayMs?: number): Promise<T>;
6540
+
6432
6541
  }
6433
6542
  declare module '@layerfi/components/utils/format' {
6434
6543
  /**
@@ -6486,6 +6595,12 @@ declare module '@layerfi/components/utils/profitAndLossUtils' {
6486
6595
  export const humanizeTitle: (sidebarView: SidebarScope) => "Expenses" | "Revenue" | "Profit & Loss";
6487
6596
  export const applyShare: (items: LineBaseItem[], total: number) => LineBaseItem[];
6488
6597
 
6598
+ }
6599
+ declare module '@layerfi/components/utils/request/toDefinedSearchParameters' {
6600
+ type ParameterValues = Date | string | number | boolean;
6601
+ export function toDefinedSearchParameters(input: Record<string, ParameterValues | null | undefined>): URLSearchParams;
6602
+ export {};
6603
+
6489
6604
  }
6490
6605
  declare module '@layerfi/components/utils/styleUtils/sizeVariants' {
6491
6606
  const SIZE_VARIANTS: readonly ["sm", "lg"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layerfi/components",
3
- "version": "0.1.79",
3
+ "version": "0.1.81",
4
4
  "description": "Layer React Components",
5
5
  "main": "dist/cjs/index.cjs",
6
6
  "module": "dist/esm/index.mjs",
@@ -12,7 +12,8 @@
12
12
  "import": "./dist/esm/index.mjs",
13
13
  "require": "./dist/cjs/index.cjs"
14
14
  },
15
- "./index.css": "./dist/index.css"
15
+ "./index.css": "./dist/index.css",
16
+ "./dist/styles/index.css": "./dist/index.css"
16
17
  },
17
18
  "scripts": {
18
19
  "test": "jest",