@paybutton/react 1.0.6 → 1.2.1
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/assets/edit-pencil.d.ts +3 -0
- package/dist/components/BarChart/BarChart.d.ts +13 -0
- package/dist/components/BarChart/BarChart.stories.d.ts +25 -0
- package/dist/components/BarChart/index.d.ts +1 -0
- package/dist/components/Button/Button.d.ts +2 -0
- package/dist/components/Button/Button.stories.d.ts +5 -5
- package/dist/components/PayButton/PayButton.d.ts +9 -3
- package/dist/components/PayButton/PayButton.stories.d.ts +11 -6
- package/dist/components/PaymentDialog/PaymentDialog.d.ts +37 -0
- package/dist/components/PaymentDialog/PaymentDialog.stories.d.ts +49 -0
- package/dist/components/PaymentDialog/index.d.ts +1 -0
- package/dist/components/Widget/Widget.d.ts +13 -1
- package/dist/components/Widget/Widget.stories.d.ts +7 -7
- package/dist/components/Widget/WidgetContainer.d.ts +12 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/index.d.ts +18 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/util/address.d.ts +5 -0
- package/dist/util/api-client.d.ts +198 -49
- package/dist/util/format.d.ts +9 -0
- package/dist/util/satoshis.d.ts +12 -0
- package/package.json +55 -49
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface BarChartProps {
|
|
3
|
+
value: number;
|
|
4
|
+
color: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const BarChart: {
|
|
7
|
+
(props: BarChartProps): React.ReactElement;
|
|
8
|
+
defaultProps: {
|
|
9
|
+
value: number;
|
|
10
|
+
color: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export default BarChart;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BarChartProps } from './BarChart';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: {
|
|
6
|
+
(props: BarChartProps): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
|
|
7
|
+
defaultProps: {
|
|
8
|
+
value: number;
|
|
9
|
+
color: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
decorators: ((Story: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, import("@storybook/react").Args>) => React.ReactNode)[];
|
|
13
|
+
argTypes: {
|
|
14
|
+
onClick: {
|
|
15
|
+
table: {
|
|
16
|
+
disable: boolean;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
parameters: {
|
|
21
|
+
jest: string[];
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export default _default;
|
|
25
|
+
export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, BarChartProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './BarChart';
|
|
@@ -6,6 +6,7 @@ export interface ButtonProps {
|
|
|
6
6
|
text?: string;
|
|
7
7
|
hoverText?: string;
|
|
8
8
|
theme?: ThemeName | Theme;
|
|
9
|
+
disabled?: boolean;
|
|
9
10
|
onClick?: () => void;
|
|
10
11
|
}
|
|
11
12
|
export declare const Button: {
|
|
@@ -14,6 +15,7 @@ export declare const Button: {
|
|
|
14
15
|
animation: string;
|
|
15
16
|
text: string;
|
|
16
17
|
hoverText: string;
|
|
18
|
+
disabled: boolean;
|
|
17
19
|
};
|
|
18
20
|
};
|
|
19
21
|
export default Button;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { Story } from '@storybook/react';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { ButtonProps } from './Button';
|
|
4
3
|
declare const _default: {
|
|
5
4
|
title: string;
|
|
6
5
|
component: {
|
|
7
|
-
(props: ButtonProps): React.ReactElement<any, string | ((props: any) => React.ReactElement<any,
|
|
6
|
+
(props: ButtonProps): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
|
|
8
7
|
defaultProps: {
|
|
9
8
|
animation: string;
|
|
10
9
|
text: string;
|
|
11
10
|
hoverText: string;
|
|
11
|
+
disabled: boolean;
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
|
-
decorators: ((Story:
|
|
14
|
+
decorators: ((Story: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, import("@storybook/react").Args>) => React.ReactNode)[];
|
|
15
15
|
argTypes: {
|
|
16
16
|
onClick: {
|
|
17
17
|
table: {
|
|
@@ -24,5 +24,5 @@ declare const _default: {
|
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
export default _default;
|
|
27
|
-
export declare const Default:
|
|
28
|
-
export declare const OrangeTheme:
|
|
27
|
+
export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, ButtonProps>;
|
|
28
|
+
export declare const OrangeTheme: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, ButtonProps>;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Theme, ThemeName } from '../../themes';
|
|
3
3
|
import { ButtonProps } from '../Button/Button';
|
|
4
|
-
import {
|
|
4
|
+
import { currency } from '../Widget/WidgetContainer';
|
|
5
5
|
export interface PayButtonProps extends ButtonProps {
|
|
6
6
|
to: string;
|
|
7
|
-
amount?: number;
|
|
7
|
+
amount?: number | string;
|
|
8
8
|
currency?: currency;
|
|
9
9
|
theme?: ThemeName | Theme;
|
|
10
10
|
text?: string;
|
|
11
11
|
hoverText?: string;
|
|
12
12
|
successText?: string;
|
|
13
|
-
displayCurrency?: cryptoCurrency;
|
|
14
13
|
randomSatoshis?: boolean;
|
|
15
14
|
hideToasts?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
goalAmount?: number | string;
|
|
17
|
+
disableEnforceFocus?: boolean;
|
|
18
|
+
editable?: boolean;
|
|
16
19
|
onSuccess?: (txid: string, amount: number) => void;
|
|
17
20
|
onTransaction?: (txid: string, amount: number) => void;
|
|
18
21
|
}
|
|
@@ -23,6 +26,9 @@ export declare const PayButton: {
|
|
|
23
26
|
hideToasts: boolean;
|
|
24
27
|
randomSatoshis: boolean;
|
|
25
28
|
successText: string;
|
|
29
|
+
disableEnforceFocus: boolean;
|
|
30
|
+
disabled: boolean;
|
|
31
|
+
editable: boolean;
|
|
26
32
|
};
|
|
27
33
|
};
|
|
28
34
|
export default PayButton;
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { Story } from '@storybook/react';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { PayButtonProps } from './PayButton';
|
|
4
3
|
declare const _default: {
|
|
5
4
|
title: string;
|
|
6
5
|
component: {
|
|
7
|
-
(props: PayButtonProps): React.ReactElement<any, string | ((props: any) => React.ReactElement<any,
|
|
6
|
+
(props: PayButtonProps): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
|
|
8
7
|
defaultProps: {
|
|
9
8
|
animation: string;
|
|
10
9
|
hideToasts: boolean;
|
|
11
10
|
randomSatoshis: boolean;
|
|
12
11
|
successText: string;
|
|
12
|
+
disableEnforceFocus: boolean;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
editable: boolean;
|
|
13
15
|
};
|
|
14
16
|
};
|
|
15
|
-
decorators: ((Story:
|
|
17
|
+
decorators: ((Story: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, import("@storybook/react").Args>) => JSX.Element)[];
|
|
16
18
|
argTypes: {
|
|
17
19
|
onClick: {
|
|
18
20
|
table: {
|
|
@@ -38,6 +40,9 @@ declare const _default: {
|
|
|
38
40
|
};
|
|
39
41
|
};
|
|
40
42
|
export default _default;
|
|
41
|
-
export declare const Default:
|
|
42
|
-
export declare const OrangeTheme:
|
|
43
|
-
export declare const UsdAmount:
|
|
43
|
+
export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PayButtonProps>;
|
|
44
|
+
export declare const OrangeTheme: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PayButtonProps>;
|
|
45
|
+
export declare const UsdAmount: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PayButtonProps>;
|
|
46
|
+
export declare const withGoal: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PayButtonProps>;
|
|
47
|
+
export declare const withUSDGoalCurrency: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PayButtonProps>;
|
|
48
|
+
export declare const withEURGoalCurrency: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PayButtonProps>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Theme, ThemeName } from '../../themes';
|
|
3
|
+
import { ButtonProps } from '../Button/Button';
|
|
4
|
+
import { currency } from '../Widget/WidgetContainer';
|
|
5
|
+
export interface PaymentDialogProps extends ButtonProps {
|
|
6
|
+
to: string;
|
|
7
|
+
amount?: number | string;
|
|
8
|
+
currency?: currency;
|
|
9
|
+
theme?: ThemeName | Theme;
|
|
10
|
+
successText?: string;
|
|
11
|
+
randomSatoshis?: boolean;
|
|
12
|
+
hideToasts?: boolean;
|
|
13
|
+
goalAmount?: number | string;
|
|
14
|
+
disableEnforceFocus?: boolean;
|
|
15
|
+
editable?: boolean;
|
|
16
|
+
dialogOpen: boolean;
|
|
17
|
+
disableScrollLock?: boolean;
|
|
18
|
+
active?: boolean;
|
|
19
|
+
container?: HTMLElement;
|
|
20
|
+
onClose?: () => void;
|
|
21
|
+
onSuccess?: (txid: string, amount: number) => void;
|
|
22
|
+
onTransaction?: (txid: string, amount: number) => void;
|
|
23
|
+
}
|
|
24
|
+
export declare const PaymentDialog: {
|
|
25
|
+
(props: PaymentDialogProps): React.ReactElement;
|
|
26
|
+
defaultProps: {
|
|
27
|
+
animation: string;
|
|
28
|
+
hideToasts: boolean;
|
|
29
|
+
randomSatoshis: boolean;
|
|
30
|
+
successText: string;
|
|
31
|
+
disableEnforceFocus: boolean;
|
|
32
|
+
disabled: boolean;
|
|
33
|
+
editable: boolean;
|
|
34
|
+
dialogOpen: boolean;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export default PaymentDialog;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PaymentDialogProps } from './PaymentDialog';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: {
|
|
6
|
+
(props: PaymentDialogProps): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
|
|
7
|
+
defaultProps: {
|
|
8
|
+
animation: string;
|
|
9
|
+
hideToasts: boolean;
|
|
10
|
+
randomSatoshis: boolean;
|
|
11
|
+
successText: string;
|
|
12
|
+
disableEnforceFocus: boolean;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
editable: boolean;
|
|
15
|
+
dialogOpen: boolean;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
decorators: ((Story: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, import("@storybook/react").Args>) => JSX.Element)[];
|
|
19
|
+
argTypes: {
|
|
20
|
+
onClick: {
|
|
21
|
+
table: {
|
|
22
|
+
disable: boolean;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
onSuccess: {
|
|
26
|
+
table: {
|
|
27
|
+
disable: boolean;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
onTransaction: {
|
|
31
|
+
table: {
|
|
32
|
+
disable: boolean;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
args: {
|
|
37
|
+
to: string;
|
|
38
|
+
};
|
|
39
|
+
parameters: {
|
|
40
|
+
jest: string[];
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export default _default;
|
|
44
|
+
export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PaymentDialogProps>;
|
|
45
|
+
export declare const OrangeTheme: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PaymentDialogProps>;
|
|
46
|
+
export declare const UsdAmount: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PaymentDialogProps>;
|
|
47
|
+
export declare const withGoal: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PaymentDialogProps>;
|
|
48
|
+
export declare const withUSDGoalCurrency: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PaymentDialogProps>;
|
|
49
|
+
export declare const withEURGoalCurrency: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PaymentDialogProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PaymentDialog';
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Theme, ThemeName } from '../../themes';
|
|
3
|
+
import { currencyObject } from '../../util/satoshis';
|
|
4
|
+
import { fiatCurrency } from '../../util/api-client';
|
|
5
|
+
export declare type cryptoCurrency = 'BCH' | 'SAT' | 'bits';
|
|
6
|
+
export declare type currency = cryptoCurrency | fiatCurrency;
|
|
3
7
|
export interface WidgetProps {
|
|
4
8
|
to: string;
|
|
5
|
-
amount?: number | null;
|
|
9
|
+
amount?: number | null | string;
|
|
6
10
|
text?: string;
|
|
7
11
|
ButtonComponent?: React.ComponentType;
|
|
8
12
|
loading: boolean;
|
|
@@ -10,6 +14,14 @@ export interface WidgetProps {
|
|
|
10
14
|
successText?: string;
|
|
11
15
|
theme?: ThemeName | Theme;
|
|
12
16
|
foot?: React.ReactNode;
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
totalReceived?: number | null;
|
|
19
|
+
goalAmount?: number | string | null;
|
|
20
|
+
currency?: currency;
|
|
21
|
+
currencyObject?: currencyObject | undefined;
|
|
22
|
+
randomSatoshis?: boolean;
|
|
23
|
+
price?: number;
|
|
24
|
+
editable?: boolean;
|
|
13
25
|
}
|
|
14
26
|
export declare const Widget: React.FC<WidgetProps>;
|
|
15
27
|
export default Widget;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { Story } from '@storybook/react';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { WidgetProps } from './Widget';
|
|
4
3
|
declare const _default: {
|
|
5
4
|
title: string;
|
|
6
5
|
component: React.FC<WidgetProps>;
|
|
7
|
-
decorators: ((Story:
|
|
6
|
+
decorators: ((Story: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, import("@storybook/react").Args>) => React.ReactNode)[];
|
|
8
7
|
argTypes: {
|
|
9
8
|
success: {
|
|
10
9
|
control: string;
|
|
@@ -27,8 +26,9 @@ declare const _default: {
|
|
|
27
26
|
};
|
|
28
27
|
};
|
|
29
28
|
export default _default;
|
|
30
|
-
export declare const Default:
|
|
31
|
-
export declare const Success:
|
|
32
|
-
export declare const Loading:
|
|
33
|
-
export declare const OrangeTheme:
|
|
34
|
-
export declare const CustomTheme:
|
|
29
|
+
export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, WidgetProps>;
|
|
30
|
+
export declare const Success: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, WidgetProps>;
|
|
31
|
+
export declare const Loading: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, WidgetProps>;
|
|
32
|
+
export declare const OrangeTheme: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, WidgetProps>;
|
|
33
|
+
export declare const CustomTheme: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, WidgetProps>;
|
|
34
|
+
export declare const WithGoal: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, WidgetProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { fiatCurrency } from '../../util/api-client';
|
|
3
3
|
import { WidgetProps } from './Widget';
|
|
4
|
-
export declare type cryptoCurrency = 'BCH' | 'SAT';
|
|
4
|
+
export declare type cryptoCurrency = 'BCH' | 'SAT' | 'bits';
|
|
5
5
|
export declare type currency = cryptoCurrency | fiatCurrency;
|
|
6
6
|
export interface WidgetContainerProps extends Omit<Omit<WidgetProps, 'loading'>, 'success'> {
|
|
7
7
|
active?: boolean;
|
|
@@ -13,6 +13,17 @@ export interface WidgetContainerProps extends Omit<Omit<WidgetProps, 'loading'>,
|
|
|
13
13
|
onSuccess?: (txid: string, amount: number) => void;
|
|
14
14
|
onTransaction?: (txid: string, amount: number) => void;
|
|
15
15
|
sound?: boolean;
|
|
16
|
+
goalAmount?: number | string;
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
editable: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface Output {
|
|
21
|
+
index: number;
|
|
22
|
+
value: number;
|
|
23
|
+
pubkeyScript: string;
|
|
24
|
+
address: string;
|
|
25
|
+
scriptClass: string;
|
|
26
|
+
disassembledScript: string;
|
|
16
27
|
}
|
|
17
28
|
export declare const WidgetContainer: React.FC<WidgetContainerProps>;
|
|
18
29
|
export default WidgetContainer;
|
|
@@ -2,5 +2,7 @@ export { Button } from './Button/Button';
|
|
|
2
2
|
export type { ButtonProps } from './Button/Button';
|
|
3
3
|
export { PayButton } from './PayButton/PayButton';
|
|
4
4
|
export type { PayButtonProps } from './PayButton/PayButton';
|
|
5
|
+
export { PaymentDialog } from './PaymentDialog/PaymentDialog';
|
|
6
|
+
export type { PaymentDialogProps } from './PaymentDialog/PaymentDialog';
|
|
5
7
|
export { WidgetContainer as Widget } from './Widget/WidgetContainer';
|
|
6
8
|
export type { WidgetContainerProps as WidgetProps } from './Widget/WidgetContainer';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,31 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import * as Components from './components';
|
|
3
3
|
export declare const PayButton: {
|
|
4
|
-
(props: Components.PayButtonProps): import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any,
|
|
4
|
+
(props: Components.PayButtonProps): import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
|
|
5
5
|
defaultProps: {
|
|
6
6
|
animation: string;
|
|
7
7
|
hideToasts: boolean;
|
|
8
8
|
randomSatoshis: boolean;
|
|
9
9
|
successText: string;
|
|
10
|
+
disableEnforceFocus: boolean;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
editable: boolean;
|
|
10
13
|
};
|
|
11
14
|
};
|
|
12
15
|
export declare type PayButtonProps = Components.PayButtonProps;
|
|
16
|
+
export declare const PaymentDialog: {
|
|
17
|
+
(props: Components.PaymentDialogProps): import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
|
|
18
|
+
defaultProps: {
|
|
19
|
+
animation: string;
|
|
20
|
+
hideToasts: boolean;
|
|
21
|
+
randomSatoshis: boolean;
|
|
22
|
+
successText: string;
|
|
23
|
+
disableEnforceFocus: boolean;
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
editable: boolean;
|
|
26
|
+
dialogOpen: boolean;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export declare type PaymentDialogProps = Components.PaymentDialogProps;
|
|
13
30
|
export declare const Widget: import("react").FC<Components.WidgetProps>;
|
|
14
31
|
export declare type WidgetProps = Components.WidgetProps;
|