@layerfi/components 0.1.100 → 0.1.102-alpha

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
@@ -1879,7 +1879,8 @@ declare module '@layerfi/components/components/Button/SubmitButton' {
1879
1879
  }
1880
1880
  export enum SubmitAction {
1881
1881
  SAVE = "save",
1882
- UPDATE = "update"
1882
+ UPDATE = "update",
1883
+ UPLOAD = "upload"
1883
1884
  }
1884
1885
  export const SubmitButton: ({ active, className, processing, disabled, error, children, action, noIcon, variant, withRetry, ...props }: SubmitButtonProps) => import("react/jsx-runtime").JSX.Element;
1885
1886
 
@@ -2203,6 +2204,109 @@ declare module '@layerfi/components/components/Container/index' {
2203
2204
  export { Container } from '@layerfi/components/components/Container/Container';
2204
2205
  export { Header } from '@layerfi/components/components/Container/Header';
2205
2206
 
2207
+ }
2208
+ declare module '@layerfi/components/components/CsvUpload/CopyTemplateHeadersButtonGroup' {
2209
+ interface CopyTemplateHeadersButtonGroupProps {
2210
+ headers: Record<string, string>;
2211
+ }
2212
+ export const CopyTemplateHeadersButtonGroup: ({ headers }: CopyTemplateHeadersButtonGroupProps) => import("react/jsx-runtime").JSX.Element;
2213
+ export {};
2214
+
2215
+ }
2216
+ declare module '@layerfi/components/components/CsvUpload/CsvUpload' {
2217
+ type CsvUploadProps = {
2218
+ file: File | null;
2219
+ onFileSelected: (file: File | null) => void;
2220
+ replaceDropTarget?: boolean;
2221
+ };
2222
+ export const CsvUpload: ({ file, onFileSelected, replaceDropTarget }: CsvUploadProps) => import("react/jsx-runtime").JSX.Element;
2223
+ export {};
2224
+
2225
+ }
2226
+ declare module '@layerfi/components/components/CsvUpload/DownloadCsvTemplateButton' {
2227
+ import { type PropsWithChildren } from 'react';
2228
+ interface DownloadCsvTemplateButtonProps<T> {
2229
+ csvProps: {
2230
+ headers: {
2231
+ [K in keyof T]: string;
2232
+ };
2233
+ rows?: T[];
2234
+ };
2235
+ fileName?: string;
2236
+ className?: string;
2237
+ }
2238
+ export const DownloadCsvTemplateButton: <T extends { [K in keyof T]: string | number; }>({ children, className, csvProps, fileName }: PropsWithChildren<DownloadCsvTemplateButtonProps<T>>) => import("react/jsx-runtime").JSX.Element;
2239
+ export {};
2240
+
2241
+ }
2242
+ declare module '@layerfi/components/components/CsvUpload/ValidateCsvTable' {
2243
+ import { PreviewCsv } from '@layerfi/components/components/CsvUpload/types';
2244
+ interface ValidateCsvTableProps<T extends {
2245
+ [K in keyof T]: string | number;
2246
+ }> {
2247
+ data: PreviewCsv<T>;
2248
+ headers: {
2249
+ [K in keyof T]: string;
2250
+ };
2251
+ formatters?: Partial<{
2252
+ [K in keyof T]: (parsed: T[K]) => string;
2253
+ }>;
2254
+ className?: string;
2255
+ }
2256
+ export function ValidateCsvTable<T extends {
2257
+ [K in keyof T]: string | number;
2258
+ }>({ data, headers, formatters, className }: ValidateCsvTableProps<T>): import("react/jsx-runtime").JSX.Element;
2259
+ export {};
2260
+
2261
+ }
2262
+ declare module '@layerfi/components/components/CsvUpload/types' {
2263
+ export type PreviewCell<T> = {
2264
+ raw: string;
2265
+ parsed: T;
2266
+ is_valid: boolean;
2267
+ };
2268
+ export type PreviewRow<T extends {
2269
+ [K in keyof T]: string | number;
2270
+ }> = {
2271
+ [K in keyof T]: PreviewCell<T[K]>;
2272
+ } & {
2273
+ index: number;
2274
+ is_valid: boolean;
2275
+ };
2276
+ export type PreviewCsv<T extends {
2277
+ [K in keyof T]: string | number;
2278
+ }> = PreviewRow<T>[];
2279
+
2280
+ }
2281
+ declare module '@layerfi/components/components/CustomAccountForm/CustomAccountForm' {
2282
+ import { type CustomAccount } from '@layerfi/components/hooks/customAccounts/types';
2283
+ export type CustomAccountsFormProps = {
2284
+ initialAccountName: string;
2285
+ onCancel?: () => void;
2286
+ onSuccess?: (account: CustomAccount) => void;
2287
+ };
2288
+ export const CustomAccountForm: ({ initialAccountName, onCancel, onSuccess }: CustomAccountsFormProps) => import("react/jsx-runtime").JSX.Element;
2289
+
2290
+ }
2291
+ declare module '@layerfi/components/components/CustomAccountForm/useCustomAccountForm' {
2292
+ import { FormValidateOrFn, FormAsyncValidateOrFn } from '@tanstack/react-form';
2293
+ import { CustomAccount, CustomAccountSubtype, CustomAccountType } from '@layerfi/components/hooks/customAccounts/types';
2294
+ export const getCustomAccountTypeFromSubtype: (subtype: CustomAccountSubtype) => CustomAccountType;
2295
+ type CustomAccountFormData = {
2296
+ account_name?: string;
2297
+ institution_name?: string;
2298
+ account_type?: CustomAccountSubtype;
2299
+ };
2300
+ type UseCustomAccountFormProps = {
2301
+ onSuccess?: (account: CustomAccount) => void;
2302
+ };
2303
+ export const useCustomAccountForm: ({ onSuccess }: UseCustomAccountFormProps) => {
2304
+ form: import("@tanstack/react-form").ReactFormExtendedApi<CustomAccountFormData, FormValidateOrFn<CustomAccountFormData>, FormValidateOrFn<CustomAccountFormData>, FormValidateOrFn<CustomAccountFormData>, FormValidateOrFn<CustomAccountFormData>, FormAsyncValidateOrFn<CustomAccountFormData>, FormValidateOrFn<CustomAccountFormData>, FormAsyncValidateOrFn<CustomAccountFormData>, FormAsyncValidateOrFn<CustomAccountFormData>, FormAsyncValidateOrFn<CustomAccountFormData>>;
2305
+ submitError: string | undefined;
2306
+ isFormValid: boolean;
2307
+ };
2308
+ export {};
2309
+
2206
2310
  }
2207
2311
  declare module '@layerfi/components/components/DataState/DataState' {
2208
2312
  import { ReactNode } from 'react';
@@ -2220,8 +2324,10 @@ declare module '@layerfi/components/components/DataState/DataState' {
2220
2324
  onRefresh?: () => void;
2221
2325
  isLoading?: boolean;
2222
2326
  spacing?: boolean;
2327
+ inline?: boolean;
2328
+ className?: string;
2223
2329
  }
2224
- export const DataState: ({ status, title, description, onRefresh, isLoading, icon, spacing, }: DataStateProps) => import("react/jsx-runtime").JSX.Element;
2330
+ export const DataState: ({ status, title, description, onRefresh, isLoading, icon, spacing, inline, className, }: DataStateProps) => import("react/jsx-runtime").JSX.Element;
2225
2331
 
2226
2332
  }
2227
2333
  declare module '@layerfi/components/components/DataState/index' {
@@ -2567,6 +2673,22 @@ declare module '@layerfi/components/components/Input/BusinessTypeSelect' {
2567
2673
  };
2568
2674
  export const BusinessTypeSelect: ({ value, onChange }: BusinessTypeSelectProps) => import("react/jsx-runtime").JSX.Element;
2569
2675
 
2676
+ }
2677
+ declare module '@layerfi/components/components/Input/CreatableSelect' {
2678
+ import { ReactNode } from 'react';
2679
+ import { GroupBase } from 'react-select';
2680
+ import { type CreatableProps } from 'react-select/creatable';
2681
+ import { type SelectProps } from '@layerfi/components/components/Input/Select';
2682
+ export interface CreatableSelectProps<T> extends Omit<SelectProps<T>, 'value' | 'onChange'> {
2683
+ value?: T | null;
2684
+ onChange: (selected: T | null) => void;
2685
+ isClearable?: boolean;
2686
+ onCreateOption?: (inputValue: string) => void;
2687
+ isValidNewOption?: CreatableProps<T, false, GroupBase<T>>['isValidNewOption'];
2688
+ formatCreateLabel?: (inputValue: string) => ReactNode;
2689
+ }
2690
+ export const CreatableSelect: <T>({ name, options, className, classNamePrefix, value, onChange, disabled, placeholder, isInvalid, errorMessage, onCreateOption, isValidNewOption, formatCreateLabel, inputId, isLoading, isClearable, }: CreatableSelectProps<T>) => import("react/jsx-runtime").JSX.Element;
2691
+
2570
2692
  }
2571
2693
  declare module '@layerfi/components/components/Input/FileInput' {
2572
2694
  export interface FileInputProps {
@@ -2641,8 +2763,10 @@ declare module '@layerfi/components/components/Input/MultiSelect' {
2641
2763
  isInvalid?: boolean;
2642
2764
  errorMessage?: string;
2643
2765
  styles?: StylesConfig<T, true, GroupBase<T>>;
2766
+ inputId?: string;
2767
+ isLoading?: boolean;
2644
2768
  }
2645
- export const MultiSelect: <T>({ name, options, className, classNamePrefix, value, defaultValue, onChange, disabled, placeholder, isInvalid, errorMessage, styles, }: SelectProps<T>) => import("react/jsx-runtime").JSX.Element;
2769
+ export const MultiSelect: <T>({ name, options, className, classNamePrefix, value, defaultValue, onChange, disabled, placeholder, isInvalid, errorMessage, styles, inputId, isLoading, }: SelectProps<T>) => import("react/jsx-runtime").JSX.Element;
2646
2770
 
2647
2771
  }
2648
2772
  declare module '@layerfi/components/components/Input/PhoneInput' {
@@ -2668,8 +2792,10 @@ declare module '@layerfi/components/components/Input/Select' {
2668
2792
  placeholder?: string;
2669
2793
  isInvalid?: boolean;
2670
2794
  errorMessage?: string;
2795
+ inputId?: string;
2796
+ isLoading?: boolean;
2671
2797
  }
2672
- export const Select: <T>({ name, options, className, classNamePrefix, value, onChange, disabled, placeholder, isInvalid, errorMessage, }: SelectProps<T>) => import("react/jsx-runtime").JSX.Element;
2798
+ export const Select: <T>({ name, options, className, classNamePrefix, value, onChange, disabled, placeholder, isInvalid, errorMessage, inputId, isLoading, }: SelectProps<T>) => import("react/jsx-runtime").JSX.Element;
2673
2799
 
2674
2800
  }
2675
2801
  declare module '@layerfi/components/components/Input/StaticValue' {
@@ -4513,6 +4639,53 @@ declare module '@layerfi/components/components/Typography/index' {
4513
4639
  export { Heading, HeadingSize } from '@layerfi/components/components/Typography/Heading';
4514
4640
  export { ErrorText } from '@layerfi/components/components/Typography/ErrorText';
4515
4641
 
4642
+ }
4643
+ declare module '@layerfi/components/components/UploadTransactions/UploadTransactions' {
4644
+ import type { Awaitable } from '@layerfi/components/types/utility/promises';
4645
+ type UploadTransactionsProps = {
4646
+ onComplete?: () => Awaitable<void>;
4647
+ };
4648
+ export function UploadTransactions({ onComplete }: UploadTransactionsProps): import("react/jsx-runtime").JSX.Element;
4649
+ export {};
4650
+
4651
+ }
4652
+ declare module '@layerfi/components/components/UploadTransactions/UploadTransactionsUploadCsvStep' {
4653
+ import { type CustomAccountParseCsvResponse } from '@layerfi/components/hooks/customAccounts/useCustomAccountParseCsv';
4654
+ type AccountOption = {
4655
+ value: string;
4656
+ label: string;
4657
+ createdAccountName?: string;
4658
+ };
4659
+ interface UploadTransactionsUploadCsvStepProps {
4660
+ selectedAccount: AccountOption | null;
4661
+ onSelectAccount: (account: AccountOption | null) => void;
4662
+ selectedFile: File | null;
4663
+ onSelectFile: (file: File | null) => void;
4664
+ onParseCsv: (parseCsvResponse: CustomAccountParseCsvResponse) => void;
4665
+ }
4666
+ export function UploadTransactionsUploadCsvStep({ selectedAccount, onSelectAccount, selectedFile, onSelectFile, onParseCsv }: UploadTransactionsUploadCsvStepProps): import("react/jsx-runtime").JSX.Element;
4667
+ export {};
4668
+
4669
+ }
4670
+ declare module '@layerfi/components/components/UploadTransactions/UploadTransactionsValidateCsvStep' {
4671
+ import type { CustomAccountParseCsvResponse } from '@layerfi/components/hooks/customAccounts/useCustomAccountParseCsv';
4672
+ interface UploadTransactionsValidateCsvStepProps {
4673
+ parseCsvResponse: CustomAccountParseCsvResponse;
4674
+ selectedAccountId: string;
4675
+ onGoBack: () => void;
4676
+ onReupload: () => void;
4677
+ }
4678
+ export function UploadTransactionsValidateCsvStep({ parseCsvResponse, selectedAccountId, onGoBack, onReupload }: UploadTransactionsValidateCsvStepProps): import("react/jsx-runtime").JSX.Element;
4679
+ export {};
4680
+
4681
+ }
4682
+ declare module '@layerfi/components/components/UploadTransactions/template' {
4683
+ import { CustomAccountTransactionRow } from '@layerfi/components/hooks/customAccounts/types';
4684
+ export const templateHeaders: {
4685
+ [K in keyof CustomAccountTransactionRow]: string;
4686
+ };
4687
+ export const templateExampleTransactions: CustomAccountTransactionRow[];
4688
+
4516
4689
  }
4517
4690
  declare module '@layerfi/components/components/UpsellBanner/BookkeepingUpsellBar' {
4518
4691
  interface BookkeepingUpsellBarProps {
@@ -4791,7 +4964,7 @@ declare module '@layerfi/components/components/ui/Typography/Text' {
4791
4964
  } & {
4792
4965
  children?: import("react").ReactNode | undefined;
4793
4966
  } & import("react").RefAttributes<HTMLSpanElement>>;
4794
- type LabelProps = Pick<ComponentPropsWithoutRef<'label'>, 'slot'>;
4967
+ type LabelProps = Pick<ComponentPropsWithoutRef<'label'>, 'slot' | 'htmlFor'>;
4795
4968
  export const Label: import("react").ForwardRefExoticComponent<LabelProps & TextStyleProps & {
4796
4969
  children?: import("react").ReactNode | undefined;
4797
4970
  } & import("react").RefAttributes<HTMLLabelElement>>;
@@ -5573,6 +5746,114 @@ declare module '@layerfi/components/hooks/categories/useCategories' {
5573
5746
  export function useCategories({ mode }?: UseCategoriesOptions): import("swr").SWRResponse<import("../../types").Category[], any, any>;
5574
5747
  export {};
5575
5748
 
5749
+ }
5750
+ declare module '@layerfi/components/hooks/customAccounts/types' {
5751
+ import { Direction } from '@layerfi/components/types/bank_transactions';
5752
+ export enum CustomAccountSubtype {
5753
+ CHECKING = "CHECKING",
5754
+ SAVINGS = "SAVINGS",
5755
+ CREDIT_CARD = "CREDIT_CARD"
5756
+ }
5757
+ export enum CustomAccountType {
5758
+ DEPOSITORY = "DEPOSITORY",
5759
+ CREDIT = "CREDIT"
5760
+ }
5761
+ export type RawCustomAccount = {
5762
+ id: string;
5763
+ external_id: string | null;
5764
+ mask: string | null;
5765
+ account_name: string;
5766
+ institution_name: string | null;
5767
+ account_type: string;
5768
+ account_subtype: string;
5769
+ created_at: string | null;
5770
+ updated_at: string | null;
5771
+ archived_at: string | null;
5772
+ ledger_account_id: string;
5773
+ };
5774
+ export type CustomAccount = Pick<RawCustomAccount, 'id'> & {
5775
+ externalId: RawCustomAccount['external_id'];
5776
+ mask: RawCustomAccount['mask'];
5777
+ accountName: RawCustomAccount['account_name'];
5778
+ institutionName: RawCustomAccount['institution_name'];
5779
+ accountType: RawCustomAccount['account_type'];
5780
+ accountSubtype: RawCustomAccount['account_subtype'];
5781
+ createdAt: RawCustomAccount['created_at'];
5782
+ updatedAt: RawCustomAccount['updated_at'];
5783
+ archivedAt: RawCustomAccount['archived_at'];
5784
+ ledgerAccountId: RawCustomAccount['ledger_account_id'];
5785
+ };
5786
+ export const mapRawCustomAccountToCustomAccount: (raw: RawCustomAccount) => CustomAccount;
5787
+ export type RawCustomTransaction = {
5788
+ external_id?: string | null;
5789
+ amount: number;
5790
+ direction: Direction;
5791
+ date: string;
5792
+ description: string;
5793
+ };
5794
+ export interface CustomAccountTransactionRow {
5795
+ date: string;
5796
+ description: string;
5797
+ amount: number;
5798
+ }
5799
+
5800
+ }
5801
+ declare module '@layerfi/components/hooks/customAccounts/useCreateCustomAccount' {
5802
+ import { type RawCustomAccount } from '@layerfi/components/hooks/customAccounts/types';
5803
+ type CreateCustomAccountBody = Pick<RawCustomAccount, 'account_name' | 'account_type' | 'account_subtype' | 'institution_name' | 'external_id' | 'mask'>;
5804
+ export function useCreateCustomAccount(): import("swr/mutation").SWRMutationResponse<import("./types").CustomAccount, any, () => {
5805
+ readonly accessToken: string;
5806
+ readonly apiUrl: string;
5807
+ readonly businessId: string;
5808
+ readonly tags: readonly ["#custom-accounts:create"];
5809
+ } | undefined, CreateCustomAccountBody>;
5810
+ export {};
5811
+
5812
+ }
5813
+ declare module '@layerfi/components/hooks/customAccounts/useCreateCustomAccountTransactions' {
5814
+ import type { RawCustomTransaction } from '@layerfi/components/hooks/customAccounts/types';
5815
+ type CreateCustomAccountTransactionsBody = {
5816
+ transactions: RawCustomTransaction[];
5817
+ };
5818
+ type CreateCustomAccountTransactionsArgs = CreateCustomAccountTransactionsBody & {
5819
+ customAccountId: string;
5820
+ };
5821
+ export function useCreateCustomAccountTransactions(): import("swr/mutation").SWRMutationResponse<unknown, any, () => {
5822
+ readonly accessToken: string;
5823
+ readonly apiUrl: string;
5824
+ readonly businessId: string;
5825
+ readonly tags: readonly ["#custom-accounts:create-transactions"];
5826
+ } | undefined, CreateCustomAccountTransactionsArgs>;
5827
+ export {};
5828
+
5829
+ }
5830
+ declare module '@layerfi/components/hooks/customAccounts/useCustomAccountParseCsv' {
5831
+ import type { CustomAccountTransactionRow, RawCustomTransaction } from '@layerfi/components/hooks/customAccounts/types';
5832
+ import type { PreviewCsv } from '@layerfi/components/components/CsvUpload/types';
5833
+ type CustomAccountParseCsvArgs = {
5834
+ file: File;
5835
+ customAccountId: string;
5836
+ };
5837
+ export type CustomAccountParseCsvResponse = {
5838
+ is_valid: boolean;
5839
+ new_transactions_request: {
5840
+ transactions: RawCustomTransaction[];
5841
+ };
5842
+ new_transactions_preview: PreviewCsv<CustomAccountTransactionRow>;
5843
+ };
5844
+ export function useCustomAccountParseCsv(): import("swr/mutation").SWRMutationResponse<CustomAccountParseCsvResponse, any, () => {
5845
+ readonly accessToken: string;
5846
+ readonly apiUrl: string;
5847
+ readonly businessId: string;
5848
+ readonly tags: readonly ["#custom-accounts:parse-csv"];
5849
+ } | undefined, CustomAccountParseCsvArgs>;
5850
+ export {};
5851
+
5852
+ }
5853
+ declare module '@layerfi/components/hooks/customAccounts/useCustomAccounts' {
5854
+ export const CUSTOM_ACCOUNTS_TAG_KEY = "#custom-accounts";
5855
+ export function useCustomAccounts(): import("swr").SWRResponse<import("./types").CustomAccount[], any, any>;
5856
+
5576
5857
  }
5577
5858
  declare module '@layerfi/components/hooks/useAuth' {
5578
5859
  export function useAuth(): import("swr").SWRResponse<{
@@ -6687,6 +6968,7 @@ declare module '@layerfi/components/index' {
6687
6968
  export { LayerProvider } from '@layerfi/components/providers/LayerProvider/index';
6688
6969
  export { Onboarding } from '@layerfi/components/components/Onboarding/index';
6689
6970
  export { LinkedAccounts } from '@layerfi/components/components/LinkedAccounts/index';
6971
+ export { UploadTransactions as unstable_UploadTransactions } from '@layerfi/components/components/UploadTransactions/UploadTransactions';
6690
6972
  export { BankTransactions } from '@layerfi/components/components/BankTransactions/index';
6691
6973
  export { Integrations } from '@layerfi/components/components/Integrations/Integrations';
6692
6974
  export { ProfitAndLoss } from '@layerfi/components/components/ProfitAndLoss/index';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layerfi/components",
3
- "version": "0.1.100",
3
+ "version": "0.1.102-alpha",
4
4
  "description": "Layer React Components",
5
5
  "main": "dist/cjs/index.cjs",
6
6
  "module": "dist/esm/index.mjs",
@@ -76,6 +76,8 @@
76
76
  "dependencies": {
77
77
  "@floating-ui/react": "^0.27.8",
78
78
  "@tanstack/react-form": "^1.9.1",
79
+ "@tanstack/react-table": "^8.21.3",
80
+ "@tanstack/react-virtual": "^3.13.9",
79
81
  "classnames": "^2.5.1",
80
82
  "date-fns": "^4.1.0",
81
83
  "libphonenumber-js": "^1.12.7",
@@ -84,6 +86,7 @@
84
86
  "react-aria-components": "^1.8.0",
85
87
  "react-currency-input-field": "^3.10.0",
86
88
  "react-datepicker": "^6.9.0",
89
+ "react-dropzone": "^14.3.8",
87
90
  "react-plaid-link": "^4.0.1",
88
91
  "react-select": "^5.10.1",
89
92
  "recharts": "^2.15.3",