@layerfi/components 0.1.1 → 0.1.2
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/esm/index.js +20 -10
- package/dist/esm/index.js.map +2 -2
- package/dist/index.d.ts +6 -8
- package/dist/index.js +20 -10
- package/dist/index.js.map +2 -2
- package/index.d.ts +296 -75
- package/package.json +1 -1
- package/.vim_backups/%Users%danieloneel%repos%components%package.json +0 -0
- package/.vim_backups/%Users%danieloneel%repos%components%src%providers%LayerProvider%LayerProvider.tsx +0 -0
package/index.d.ts
CHANGED
|
@@ -4,10 +4,9 @@ declare module '@layerfi/components/api/layer/authenticate' {
|
|
|
4
4
|
appId: string;
|
|
5
5
|
appSecret: string;
|
|
6
6
|
authenticationUrl?: string;
|
|
7
|
-
clientId: string;
|
|
8
7
|
scope: string;
|
|
9
8
|
};
|
|
10
|
-
export const authenticate: ({ appId, appSecret, authenticationUrl,
|
|
9
|
+
export const authenticate: ({ appId, appSecret, authenticationUrl, scope, }: AuthenticationArguments) => () => Promise<OAuthResponse>;
|
|
11
10
|
export {};
|
|
12
11
|
|
|
13
12
|
}
|
|
@@ -104,11 +103,10 @@ declare module '@layerfi/components/api/layer/profit_and_loss' {
|
|
|
104
103
|
}
|
|
105
104
|
declare module '@layerfi/components/api/layer' {
|
|
106
105
|
export const Layer: {
|
|
107
|
-
authenticate: ({ appId, appSecret, authenticationUrl,
|
|
106
|
+
authenticate: ({ appId, appSecret, authenticationUrl, scope, }: {
|
|
108
107
|
appId: string;
|
|
109
108
|
appSecret: string;
|
|
110
109
|
authenticationUrl?: string | undefined;
|
|
111
|
-
clientId: string;
|
|
112
110
|
scope: string;
|
|
113
111
|
}) => () => Promise<import("@layerfi/components/types").OAuthResponse>;
|
|
114
112
|
categorizeBankTransaction: (baseUrl: string, accessToken: string | undefined, options?: {
|
|
@@ -196,6 +194,24 @@ declare module '@layerfi/components/components/BalanceSheetRow/BalanceSheetRow'
|
|
|
196
194
|
declare module '@layerfi/components/components/BalanceSheetRow/index' {
|
|
197
195
|
export { BalanceSheetRow } from '@layerfi/components/components/BalanceSheetRow/BalanceSheetRow';
|
|
198
196
|
|
|
197
|
+
}
|
|
198
|
+
declare module '@layerfi/components/components/BankTransactionListItem/BankTransactionListItem' {
|
|
199
|
+
import React from 'react';
|
|
200
|
+
import { BankTransaction } from '@layerfi/components/types';
|
|
201
|
+
type Props = {
|
|
202
|
+
dateFormat: string;
|
|
203
|
+
bankTransaction: BankTransaction;
|
|
204
|
+
isOpen: boolean;
|
|
205
|
+
toggleOpen: (id: string) => void;
|
|
206
|
+
editable: boolean;
|
|
207
|
+
};
|
|
208
|
+
export const BankTransactionListItem: ({ dateFormat, bankTransaction, isOpen, toggleOpen, editable, }: Props) => React.JSX.Element | null;
|
|
209
|
+
export {};
|
|
210
|
+
|
|
211
|
+
}
|
|
212
|
+
declare module '@layerfi/components/components/BankTransactionListItem/index' {
|
|
213
|
+
export { BankTransactionListItem } from '@layerfi/components/components/BankTransactionListItem/BankTransactionListItem';
|
|
214
|
+
|
|
199
215
|
}
|
|
200
216
|
declare module '@layerfi/components/components/BankTransactionRow/BankTransactionRow' {
|
|
201
217
|
import React from 'react';
|
|
@@ -234,12 +250,26 @@ declare module '@layerfi/components/components/Button/Button' {
|
|
|
234
250
|
variant?: ButtonVariant;
|
|
235
251
|
leftIcon?: ReactNode;
|
|
236
252
|
rightIcon?: ReactNode;
|
|
253
|
+
iconOnly?: ReactNode;
|
|
237
254
|
}
|
|
238
|
-
export const Button: ({ className, children, variant, leftIcon, rightIcon, ...props }: ButtonProps) => React.JSX.Element;
|
|
255
|
+
export const Button: ({ className, children, variant, leftIcon, rightIcon, iconOnly, ...props }: ButtonProps) => React.JSX.Element;
|
|
256
|
+
|
|
257
|
+
}
|
|
258
|
+
declare module '@layerfi/components/components/Button/SubmitButton' {
|
|
259
|
+
import React, { ButtonHTMLAttributes } from 'react';
|
|
260
|
+
export interface SubmitButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
261
|
+
processing?: boolean;
|
|
262
|
+
disabled?: boolean;
|
|
263
|
+
error?: boolean | string;
|
|
264
|
+
active?: boolean;
|
|
265
|
+
iconOnly?: boolean;
|
|
266
|
+
}
|
|
267
|
+
export const SubmitButton: ({ active, className, processing, disabled, error, children, ...props }: SubmitButtonProps) => React.JSX.Element;
|
|
239
268
|
|
|
240
269
|
}
|
|
241
270
|
declare module '@layerfi/components/components/Button/index' {
|
|
242
|
-
export { Button } from '@layerfi/components/components/Button/Button';
|
|
271
|
+
export { Button, ButtonVariant } from '@layerfi/components/components/Button/Button';
|
|
272
|
+
export { SubmitButton } from '@layerfi/components/components/Button/SubmitButton';
|
|
243
273
|
|
|
244
274
|
}
|
|
245
275
|
declare module '@layerfi/components/components/CategoryMenu/CategoryMenu' {
|
|
@@ -305,12 +335,13 @@ declare module '@layerfi/components/components/Container/Container' {
|
|
|
305
335
|
|
|
306
336
|
}
|
|
307
337
|
declare module '@layerfi/components/components/Container/Header' {
|
|
308
|
-
import React, { ReactNode } from 'react';
|
|
338
|
+
import React, { CSSProperties, ReactNode } from 'react';
|
|
309
339
|
export interface HeaderProps {
|
|
310
340
|
className?: string;
|
|
341
|
+
style?: CSSProperties;
|
|
311
342
|
children: ReactNode;
|
|
312
343
|
}
|
|
313
|
-
export const Header:
|
|
344
|
+
export const Header: React.ForwardRefExoticComponent<HeaderProps & React.RefAttributes<HTMLElement>>;
|
|
314
345
|
|
|
315
346
|
}
|
|
316
347
|
declare module '@layerfi/components/components/Container/index' {
|
|
@@ -325,6 +356,8 @@ declare module '@layerfi/components/components/ExpandedBankTransactionRow/Expand
|
|
|
325
356
|
bankTransaction: BankTransaction;
|
|
326
357
|
close?: () => void;
|
|
327
358
|
isOpen?: boolean;
|
|
359
|
+
asListItem?: boolean;
|
|
360
|
+
showSubmitButton?: boolean;
|
|
328
361
|
};
|
|
329
362
|
export type SaveHandle = {
|
|
330
363
|
save: () => void;
|
|
@@ -380,6 +413,18 @@ declare module '@layerfi/components/components/Input/index' {
|
|
|
380
413
|
export { InputGroup } from '@layerfi/components/components/Input/InputGroup';
|
|
381
414
|
export { FileInput } from '@layerfi/components/components/Input/FileInput';
|
|
382
415
|
|
|
416
|
+
}
|
|
417
|
+
declare module '@layerfi/components/components/Loader/Loader' {
|
|
418
|
+
import React, { ReactNode } from 'react';
|
|
419
|
+
export interface LoaderProps {
|
|
420
|
+
children?: ReactNode;
|
|
421
|
+
}
|
|
422
|
+
export const Loader: ({ children }: LoaderProps) => React.JSX.Element;
|
|
423
|
+
|
|
424
|
+
}
|
|
425
|
+
declare module '@layerfi/components/components/Loader/index' {
|
|
426
|
+
export { Loader } from '@layerfi/components/components/Loader/Loader';
|
|
427
|
+
|
|
383
428
|
}
|
|
384
429
|
declare module '@layerfi/components/components/Pill/Pill' {
|
|
385
430
|
import React, { PropsWithChildren } from 'react';
|
|
@@ -484,43 +529,6 @@ declare module '@layerfi/components/components/ProfitAndLossTable/empty_profit_a
|
|
|
484
529
|
declare module '@layerfi/components/components/ProfitAndLossTable/index' {
|
|
485
530
|
export { ProfitAndLossTable } from '@layerfi/components/components/ProfitAndLossTable/ProfitAndLossTable';
|
|
486
531
|
|
|
487
|
-
}
|
|
488
|
-
declare module '@layerfi/components/components/RadioButtonGroup/RadioButton' {
|
|
489
|
-
import React from 'react';
|
|
490
|
-
type Props = {
|
|
491
|
-
checked: boolean;
|
|
492
|
-
label: string;
|
|
493
|
-
name: string;
|
|
494
|
-
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
495
|
-
value: string;
|
|
496
|
-
disabled?: boolean;
|
|
497
|
-
size: 'small' | 'large';
|
|
498
|
-
};
|
|
499
|
-
export const RadioButton: ({ checked, label, name, onChange, value, disabled, size, }: Props) => React.JSX.Element;
|
|
500
|
-
export {};
|
|
501
|
-
|
|
502
|
-
}
|
|
503
|
-
declare module '@layerfi/components/components/RadioButtonGroup/RadioButtonGroup' {
|
|
504
|
-
import React from 'react';
|
|
505
|
-
export type RadioButtonLabel = {
|
|
506
|
-
label: string;
|
|
507
|
-
value: string;
|
|
508
|
-
disabled?: boolean;
|
|
509
|
-
};
|
|
510
|
-
type Props = {
|
|
511
|
-
name: string;
|
|
512
|
-
size?: 'small' | 'large';
|
|
513
|
-
buttons: RadioButtonLabel[];
|
|
514
|
-
selected?: RadioButtonLabel['value'];
|
|
515
|
-
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
516
|
-
};
|
|
517
|
-
export const RadioButtonGroup: ({ name, size, buttons, onChange, selected, }: Props) => React.JSX.Element;
|
|
518
|
-
export {};
|
|
519
|
-
|
|
520
|
-
}
|
|
521
|
-
declare module '@layerfi/components/components/RadioButtonGroup/index' {
|
|
522
|
-
export { RadioButtonGroup } from '@layerfi/components/components/RadioButtonGroup/RadioButtonGroup';
|
|
523
|
-
|
|
524
532
|
}
|
|
525
533
|
declare module '@layerfi/components/components/SkeletonBalanceSheetRow/SkeletonBalanceSheetRow' {
|
|
526
534
|
import React, { PropsWithChildren } from 'react';
|
|
@@ -567,6 +575,139 @@ declare module '@layerfi/components/components/Toggle/Toggle' {
|
|
|
567
575
|
declare module '@layerfi/components/components/Toggle/index' {
|
|
568
576
|
export { Toggle } from '@layerfi/components/components/Toggle/Toggle';
|
|
569
577
|
|
|
578
|
+
}
|
|
579
|
+
declare module '@layerfi/components/components/Tooltip/Tooltip' {
|
|
580
|
+
import React, { ReactNode } from 'react';
|
|
581
|
+
import type { Placement } from '@floating-ui/react';
|
|
582
|
+
export interface TooltipOptions {
|
|
583
|
+
initialOpen?: boolean;
|
|
584
|
+
placement?: Placement;
|
|
585
|
+
open?: boolean;
|
|
586
|
+
disabled?: boolean;
|
|
587
|
+
onOpenChange?: (open: boolean) => void;
|
|
588
|
+
offset?: number;
|
|
589
|
+
shift?: {
|
|
590
|
+
padding?: number;
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
export const Tooltip: ({ children, ...options }: {
|
|
594
|
+
children: ReactNode;
|
|
595
|
+
} & TooltipOptions) => React.JSX.Element;
|
|
596
|
+
export const TooltipTrigger: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLElement> & {
|
|
597
|
+
asChild?: boolean | undefined;
|
|
598
|
+
}, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
599
|
+
export const TooltipContent: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
600
|
+
|
|
601
|
+
}
|
|
602
|
+
declare module '@layerfi/components/components/Tooltip/index' {
|
|
603
|
+
export { Tooltip, TooltipTrigger, TooltipContent } from '@layerfi/components/components/Tooltip/Tooltip';
|
|
604
|
+
export { useTooltip } from '@layerfi/components/components/Tooltip/useTooltip';
|
|
605
|
+
|
|
606
|
+
}
|
|
607
|
+
declare module '@layerfi/components/components/Tooltip/useTooltip' {
|
|
608
|
+
import React from 'react';
|
|
609
|
+
import { TooltipOptions } from '@layerfi/components/components/Tooltip/Tooltip';
|
|
610
|
+
export type ContextType = ReturnType<typeof useTooltip> | null;
|
|
611
|
+
export const TooltipContext: React.Context<ContextType>;
|
|
612
|
+
export const useTooltipContext: () => {
|
|
613
|
+
placement: import("@floating-ui/utils").Placement;
|
|
614
|
+
strategy: import("@floating-ui/utils").Strategy;
|
|
615
|
+
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
616
|
+
x: number;
|
|
617
|
+
y: number;
|
|
618
|
+
isPositioned: boolean;
|
|
619
|
+
update: () => void;
|
|
620
|
+
floatingStyles: React.CSSProperties;
|
|
621
|
+
refs: {
|
|
622
|
+
reference: React.MutableRefObject<import("@floating-ui/react-dom").ReferenceType | null>;
|
|
623
|
+
floating: React.MutableRefObject<HTMLElement | null>;
|
|
624
|
+
setReference: (node: import("@floating-ui/react-dom").ReferenceType | null) => void;
|
|
625
|
+
setFloating: (node: HTMLElement | null) => void;
|
|
626
|
+
} & import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
|
|
627
|
+
elements: {
|
|
628
|
+
reference: import("@floating-ui/react-dom").ReferenceType | null;
|
|
629
|
+
floating: HTMLElement | null;
|
|
630
|
+
} & import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
|
|
631
|
+
context: {
|
|
632
|
+
x: number;
|
|
633
|
+
y: number;
|
|
634
|
+
placement: import("@floating-ui/utils").Placement;
|
|
635
|
+
strategy: import("@floating-ui/utils").Strategy;
|
|
636
|
+
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
637
|
+
isPositioned: boolean;
|
|
638
|
+
update: () => void;
|
|
639
|
+
floatingStyles: React.CSSProperties;
|
|
640
|
+
open: boolean;
|
|
641
|
+
onOpenChange: (open: boolean, event?: Event | undefined, reason?: import("@floating-ui/react").OpenChangeReason | undefined) => void;
|
|
642
|
+
events: import("@floating-ui/react").FloatingEvents;
|
|
643
|
+
dataRef: React.MutableRefObject<import("@floating-ui/react").ContextData>;
|
|
644
|
+
nodeId: string | undefined;
|
|
645
|
+
floatingId: string;
|
|
646
|
+
refs: import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
|
|
647
|
+
elements: import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
|
|
648
|
+
};
|
|
649
|
+
getReferenceProps: (userProps?: React.HTMLProps<Element> | undefined) => Record<string, unknown>;
|
|
650
|
+
getFloatingProps: (userProps?: React.HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
|
|
651
|
+
getItemProps: (userProps?: (Omit<React.HTMLProps<HTMLElement>, "active" | "selected"> & {
|
|
652
|
+
active?: boolean | undefined;
|
|
653
|
+
selected?: boolean | undefined;
|
|
654
|
+
}) | undefined) => Record<string, unknown>;
|
|
655
|
+
open: boolean;
|
|
656
|
+
setOpen: (open: boolean) => void;
|
|
657
|
+
isMounted: boolean;
|
|
658
|
+
styles: React.CSSProperties;
|
|
659
|
+
disabled: boolean | undefined;
|
|
660
|
+
};
|
|
661
|
+
export const useTooltip: ({ initialOpen, placement, open: controlledOpen, onOpenChange: setControlledOpen, disabled, offset: offsetProp, shift: shiftProp, }?: TooltipOptions) => {
|
|
662
|
+
placement: import("@floating-ui/utils").Placement;
|
|
663
|
+
strategy: import("@floating-ui/utils").Strategy;
|
|
664
|
+
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
665
|
+
x: number;
|
|
666
|
+
y: number;
|
|
667
|
+
isPositioned: boolean;
|
|
668
|
+
update: () => void;
|
|
669
|
+
floatingStyles: React.CSSProperties;
|
|
670
|
+
refs: {
|
|
671
|
+
reference: React.MutableRefObject<import("@floating-ui/react-dom").ReferenceType | null>;
|
|
672
|
+
floating: React.MutableRefObject<HTMLElement | null>;
|
|
673
|
+
setReference: (node: import("@floating-ui/react-dom").ReferenceType | null) => void;
|
|
674
|
+
setFloating: (node: HTMLElement | null) => void;
|
|
675
|
+
} & import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
|
|
676
|
+
elements: {
|
|
677
|
+
reference: import("@floating-ui/react-dom").ReferenceType | null;
|
|
678
|
+
floating: HTMLElement | null;
|
|
679
|
+
} & import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
|
|
680
|
+
context: {
|
|
681
|
+
x: number;
|
|
682
|
+
y: number;
|
|
683
|
+
placement: import("@floating-ui/utils").Placement;
|
|
684
|
+
strategy: import("@floating-ui/utils").Strategy;
|
|
685
|
+
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
686
|
+
isPositioned: boolean;
|
|
687
|
+
update: () => void;
|
|
688
|
+
floatingStyles: React.CSSProperties;
|
|
689
|
+
open: boolean;
|
|
690
|
+
onOpenChange: (open: boolean, event?: Event | undefined, reason?: import("@floating-ui/react").OpenChangeReason | undefined) => void;
|
|
691
|
+
events: import("@floating-ui/react").FloatingEvents;
|
|
692
|
+
dataRef: React.MutableRefObject<import("@floating-ui/react").ContextData>;
|
|
693
|
+
nodeId: string | undefined;
|
|
694
|
+
floatingId: string;
|
|
695
|
+
refs: import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
|
|
696
|
+
elements: import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
|
|
697
|
+
};
|
|
698
|
+
getReferenceProps: (userProps?: React.HTMLProps<Element> | undefined) => Record<string, unknown>;
|
|
699
|
+
getFloatingProps: (userProps?: React.HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
|
|
700
|
+
getItemProps: (userProps?: (Omit<React.HTMLProps<HTMLElement>, "active" | "selected"> & {
|
|
701
|
+
active?: boolean | undefined;
|
|
702
|
+
selected?: boolean | undefined;
|
|
703
|
+
}) | undefined) => Record<string, unknown>;
|
|
704
|
+
open: boolean;
|
|
705
|
+
setOpen: (open: boolean) => void;
|
|
706
|
+
isMounted: boolean;
|
|
707
|
+
styles: React.CSSProperties;
|
|
708
|
+
disabled: boolean | undefined;
|
|
709
|
+
};
|
|
710
|
+
|
|
570
711
|
}
|
|
571
712
|
declare module '@layerfi/components/components/Typography/Heading' {
|
|
572
713
|
import React, { ReactNode } from 'react';
|
|
@@ -593,6 +734,17 @@ declare module '@layerfi/components/components/Typography/Text' {
|
|
|
593
734
|
normal = "normal",
|
|
594
735
|
bold = "bold"
|
|
595
736
|
}
|
|
737
|
+
export enum TextUseTooltip {
|
|
738
|
+
whenTruncated = "whenTruncated",
|
|
739
|
+
always = "always"
|
|
740
|
+
}
|
|
741
|
+
export interface TextTooltipOptions {
|
|
742
|
+
contentClassName?: string;
|
|
743
|
+
offset?: number;
|
|
744
|
+
shift?: {
|
|
745
|
+
padding?: number;
|
|
746
|
+
};
|
|
747
|
+
}
|
|
596
748
|
export interface TextProps {
|
|
597
749
|
as?: React.ElementType;
|
|
598
750
|
className?: string;
|
|
@@ -600,8 +752,11 @@ declare module '@layerfi/components/components/Typography/Text' {
|
|
|
600
752
|
size?: TextSize;
|
|
601
753
|
weight?: TextWeight;
|
|
602
754
|
htmlFor?: string;
|
|
755
|
+
withTooltip?: TextUseTooltip;
|
|
756
|
+
tooltipOptions?: TextTooltipOptions;
|
|
603
757
|
}
|
|
604
|
-
export const Text: ({ as: Component, className, children, size, weight, ...props }: TextProps) => React.JSX.Element;
|
|
758
|
+
export const Text: ({ as: Component, className, children, size, weight, withTooltip, ...props }: TextProps) => React.JSX.Element;
|
|
759
|
+
export const TextWithTooltip: ({ as: Component, className, children, size, weight, withTooltip, tooltipOptions, ...props }: TextProps) => React.JSX.Element;
|
|
605
760
|
|
|
606
761
|
}
|
|
607
762
|
declare module '@layerfi/components/components/Typography/index' {
|
|
@@ -612,7 +767,10 @@ declare module '@layerfi/components/components/Typography/index' {
|
|
|
612
767
|
declare module '@layerfi/components/contexts/LayerContext/LayerContext' {
|
|
613
768
|
/// <reference types="react" />
|
|
614
769
|
import { LayerContextValues } from '@layerfi/components/types';
|
|
615
|
-
|
|
770
|
+
import { LayerThemeConfig } from '@layerfi/components/types/layer_context';
|
|
771
|
+
export const LayerContext: import("react").Context<LayerContextValues & {
|
|
772
|
+
setTheme: (theme: LayerThemeConfig) => void;
|
|
773
|
+
}>;
|
|
616
774
|
|
|
617
775
|
}
|
|
618
776
|
declare module '@layerfi/components/contexts/LayerContext/index' {
|
|
@@ -667,13 +825,27 @@ declare module '@layerfi/components/hooks/useChartOfAccounts/useChartOfAccounts'
|
|
|
667
825
|
export const useChartOfAccounts: UseChartOfAccounts;
|
|
668
826
|
export {};
|
|
669
827
|
|
|
828
|
+
}
|
|
829
|
+
declare module '@layerfi/components/hooks/useElementSize/index' {
|
|
830
|
+
export { useElementSize } from '@layerfi/components/hooks/useElementSize/useElementSize';
|
|
831
|
+
|
|
832
|
+
}
|
|
833
|
+
declare module '@layerfi/components/hooks/useElementSize/useElementSize' {
|
|
834
|
+
/// <reference types="react" />
|
|
835
|
+
export const useElementSize: <T extends HTMLElement>(callback: (target: T, entry: ResizeObserverEntry, size: {
|
|
836
|
+
width: number;
|
|
837
|
+
height: number;
|
|
838
|
+
}) => void) => import("react").RefObject<T>;
|
|
839
|
+
|
|
670
840
|
}
|
|
671
841
|
declare module '@layerfi/components/hooks/useLayerContext/index' {
|
|
672
842
|
export { useLayerContext } from '@layerfi/components/hooks/useLayerContext/useLayerContext';
|
|
673
843
|
|
|
674
844
|
}
|
|
675
845
|
declare module '@layerfi/components/hooks/useLayerContext/useLayerContext' {
|
|
676
|
-
export const useLayerContext: () => import("@layerfi/components/types").LayerContextValues
|
|
846
|
+
export const useLayerContext: () => import("@layerfi/components/types").LayerContextValues & {
|
|
847
|
+
setTheme: (theme: import("@layerfi/components/types/layer_context").LayerThemeConfig) => void;
|
|
848
|
+
};
|
|
677
849
|
|
|
678
850
|
}
|
|
679
851
|
declare module '@layerfi/components/hooks/useProfitAndLoss/index' {
|
|
@@ -693,6 +865,13 @@ declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss' {
|
|
|
693
865
|
export const useProfitAndLoss: UseProfitAndLoss;
|
|
694
866
|
export {};
|
|
695
867
|
|
|
868
|
+
}
|
|
869
|
+
declare module '@layerfi/components/icons/AlertCircle' {
|
|
870
|
+
import * as React from 'react';
|
|
871
|
+
import { IconSvgProps } from '@layerfi/components/icons/types';
|
|
872
|
+
const AlertCircle: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
|
|
873
|
+
export default AlertCircle;
|
|
874
|
+
|
|
696
875
|
}
|
|
697
876
|
declare module '@layerfi/components/icons/Calendar' {
|
|
698
877
|
import * as React from 'react';
|
|
@@ -701,16 +880,18 @@ declare module '@layerfi/components/icons/Calendar' {
|
|
|
701
880
|
export default Calendar;
|
|
702
881
|
|
|
703
882
|
}
|
|
704
|
-
declare module '@layerfi/components/icons/
|
|
883
|
+
declare module '@layerfi/components/icons/Check' {
|
|
705
884
|
import * as React from 'react';
|
|
706
|
-
import {
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
885
|
+
import { IconSvgProps } from '@layerfi/components/icons/types';
|
|
886
|
+
const Check: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
|
|
887
|
+
export default Check;
|
|
888
|
+
|
|
889
|
+
}
|
|
890
|
+
declare module '@layerfi/components/icons/CheckCircle' {
|
|
891
|
+
import * as React from 'react';
|
|
892
|
+
import { IconSvgProps } from '@layerfi/components/icons/types';
|
|
893
|
+
const CheckCircle: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
|
|
894
|
+
export default CheckCircle;
|
|
714
895
|
|
|
715
896
|
}
|
|
716
897
|
declare module '@layerfi/components/icons/ChevronDown' {
|
|
@@ -757,22 +938,16 @@ declare module '@layerfi/components/icons/FolderPlus' {
|
|
|
757
938
|
}
|
|
758
939
|
declare module '@layerfi/components/icons/Link' {
|
|
759
940
|
import * as React from 'react';
|
|
760
|
-
import {
|
|
761
|
-
|
|
762
|
-
size: SVGProps<SVGSVGElement>['width'];
|
|
763
|
-
};
|
|
764
|
-
const Link: ({ size, ...props }: Props) => React.JSX.Element;
|
|
941
|
+
import { IconSvgProps } from '@layerfi/components/icons/types';
|
|
942
|
+
const Link: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
|
|
765
943
|
export default Link;
|
|
766
944
|
|
|
767
945
|
}
|
|
768
|
-
declare module '@layerfi/components/icons/
|
|
946
|
+
declare module '@layerfi/components/icons/Loader' {
|
|
769
947
|
import * as React from 'react';
|
|
770
|
-
import {
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
};
|
|
774
|
-
const LinkBroken: ({ size, ...props }: Props) => React.JSX.Element;
|
|
775
|
-
export default LinkBroken;
|
|
948
|
+
import { IconSvgProps } from '@layerfi/components/icons/types';
|
|
949
|
+
const Loader: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
|
|
950
|
+
export default Loader;
|
|
776
951
|
|
|
777
952
|
}
|
|
778
953
|
declare module '@layerfi/components/icons/RefreshCcw' {
|
|
@@ -781,6 +956,13 @@ declare module '@layerfi/components/icons/RefreshCcw' {
|
|
|
781
956
|
const RefreshCcw: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
|
|
782
957
|
export default RefreshCcw;
|
|
783
958
|
|
|
959
|
+
}
|
|
960
|
+
declare module '@layerfi/components/icons/ScissorsFullOpen' {
|
|
961
|
+
import * as React from 'react';
|
|
962
|
+
import { IconSvgProps } from '@layerfi/components/icons/types';
|
|
963
|
+
const ScissorsFullOpen: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
|
|
964
|
+
export default ScissorsFullOpen;
|
|
965
|
+
|
|
784
966
|
}
|
|
785
967
|
declare module '@layerfi/components/icons/UploadCloud' {
|
|
786
968
|
import * as React from 'react';
|
|
@@ -832,20 +1014,22 @@ declare module '@layerfi/components/models/Money' {
|
|
|
832
1014
|
}
|
|
833
1015
|
declare module '@layerfi/components/providers/LayerProvider/LayerProvider' {
|
|
834
1016
|
import React, { PropsWithChildren } from 'react';
|
|
1017
|
+
import { LayerThemeConfig } from '@layerfi/components/types/layer_context';
|
|
835
1018
|
type LayerEnvironmentConfig = {
|
|
836
1019
|
url: string;
|
|
837
1020
|
scope: string;
|
|
838
1021
|
apiUrl: string;
|
|
839
1022
|
};
|
|
840
1023
|
export const LayerEnvironment: Record<string, LayerEnvironmentConfig>;
|
|
841
|
-
type Props = {
|
|
1024
|
+
export type Props = {
|
|
842
1025
|
businessId: string;
|
|
843
|
-
appId
|
|
844
|
-
appSecret
|
|
845
|
-
|
|
1026
|
+
appId?: string;
|
|
1027
|
+
appSecret?: string;
|
|
1028
|
+
businessAccessToken?: string;
|
|
846
1029
|
environment?: keyof typeof LayerEnvironment;
|
|
1030
|
+
theme?: LayerThemeConfig;
|
|
847
1031
|
};
|
|
848
|
-
export const LayerProvider: ({ appId, appSecret, businessId, children,
|
|
1032
|
+
export const LayerProvider: ({ appId, appSecret, businessId, children, businessAccessToken, environment, theme, }: PropsWithChildren<Props>) => React.JSX.Element;
|
|
849
1033
|
export {};
|
|
850
1034
|
|
|
851
1035
|
}
|
|
@@ -1019,10 +1203,32 @@ declare module '@layerfi/components/types/layer_context' {
|
|
|
1019
1203
|
businessId: string;
|
|
1020
1204
|
categories: Category[];
|
|
1021
1205
|
apiUrl: string;
|
|
1206
|
+
theme?: LayerThemeConfig;
|
|
1022
1207
|
};
|
|
1208
|
+
export interface ColorHSLConfig {
|
|
1209
|
+
h: string;
|
|
1210
|
+
s: string;
|
|
1211
|
+
l: string;
|
|
1212
|
+
}
|
|
1213
|
+
export interface ColorRGBConfig {
|
|
1214
|
+
r: string;
|
|
1215
|
+
g: string;
|
|
1216
|
+
b: string;
|
|
1217
|
+
}
|
|
1218
|
+
export interface ColorHexConfig {
|
|
1219
|
+
hex: string;
|
|
1220
|
+
}
|
|
1221
|
+
export type ColorConfig = ColorHSLConfig | ColorRGBConfig | ColorHexConfig;
|
|
1222
|
+
export interface LayerThemeConfig {
|
|
1223
|
+
colors?: {
|
|
1224
|
+
dark?: ColorConfig;
|
|
1225
|
+
light?: ColorConfig;
|
|
1226
|
+
};
|
|
1227
|
+
}
|
|
1023
1228
|
export enum LayerContextActionName {
|
|
1024
1229
|
setAuth = "LayerContext.setAuth",
|
|
1025
|
-
setCategories = "LayerContext.setCategories"
|
|
1230
|
+
setCategories = "LayerContext.setCategories",
|
|
1231
|
+
setTheme = "LayerContext.setTheme"
|
|
1026
1232
|
}
|
|
1027
1233
|
export type LayerContextAction = {
|
|
1028
1234
|
type: LayerContextActionName.setAuth;
|
|
@@ -1034,6 +1240,11 @@ declare module '@layerfi/components/types/layer_context' {
|
|
|
1034
1240
|
payload: {
|
|
1035
1241
|
categories: LayerContextValues['categories'];
|
|
1036
1242
|
};
|
|
1243
|
+
} | {
|
|
1244
|
+
type: LayerContextActionName.setTheme;
|
|
1245
|
+
payload: {
|
|
1246
|
+
theme: LayerContextValues['theme'];
|
|
1247
|
+
};
|
|
1037
1248
|
};
|
|
1038
1249
|
|
|
1039
1250
|
}
|
|
@@ -1081,6 +1292,16 @@ declare module '@layerfi/components/types' {
|
|
|
1081
1292
|
endDate: T;
|
|
1082
1293
|
};
|
|
1083
1294
|
|
|
1295
|
+
}
|
|
1296
|
+
declare module '@layerfi/components/utils/colors' {
|
|
1297
|
+
import { LayerThemeConfig } from '@layerfi/components/types/layer_context';
|
|
1298
|
+
/**
|
|
1299
|
+
* Convert `theme` config set in Provider into component styles.
|
|
1300
|
+
*
|
|
1301
|
+
* @param {LayerThemeConfig} theme - the theme set with provider
|
|
1302
|
+
*/
|
|
1303
|
+
export const parseStylesFromThemeConfig: (theme?: LayerThemeConfig) => {};
|
|
1304
|
+
|
|
1084
1305
|
}
|
|
1085
1306
|
declare module '@layerfi/components' {
|
|
1086
1307
|
import main = require('@layerfi/components/index');
|
package/package.json
CHANGED
|
Binary file
|