@paybutton/react 1.1.0 → 1.2.0
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/PayButton/PayButton.d.ts +3 -2
- package/dist/components/PayButton/PayButton.stories.d.ts +1 -0
- package/dist/components/PaymentDialog/PaymentDialog.d.ts +37 -0
- package/dist/components/PaymentDialog/PaymentDialog.stories.d.ts +50 -0
- package/dist/components/PaymentDialog/index.d.ts +1 -0
- package/dist/components/Widget/Widget.d.ts +6 -1
- package/dist/components/Widget/WidgetContainer.d.ts +10 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/index.d.ts +15 -0
- 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/api-client.d.ts +198 -49
- package/dist/util/format.d.ts +9 -3
- package/dist/util/satoshis.d.ts +12 -0
- package/package.json +3 -1
|
@@ -1,7 +1,7 @@
|
|
|
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
7
|
amount?: number | string;
|
|
@@ -10,12 +10,12 @@ export interface PayButtonProps extends ButtonProps {
|
|
|
10
10
|
text?: string;
|
|
11
11
|
hoverText?: string;
|
|
12
12
|
successText?: string;
|
|
13
|
-
displayCurrency?: cryptoCurrency;
|
|
14
13
|
randomSatoshis?: boolean;
|
|
15
14
|
hideToasts?: boolean;
|
|
16
15
|
disabled?: boolean;
|
|
17
16
|
goalAmount?: number | string;
|
|
18
17
|
disableEnforceFocus?: boolean;
|
|
18
|
+
editable?: boolean;
|
|
19
19
|
onSuccess?: (txid: string, amount: number) => void;
|
|
20
20
|
onTransaction?: (txid: string, amount: number) => void;
|
|
21
21
|
}
|
|
@@ -28,6 +28,7 @@ export declare const PayButton: {
|
|
|
28
28
|
successText: string;
|
|
29
29
|
disableEnforceFocus: boolean;
|
|
30
30
|
disabled: boolean;
|
|
31
|
+
editable: boolean;
|
|
31
32
|
};
|
|
32
33
|
};
|
|
33
34
|
export default PayButton;
|
|
@@ -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,50 @@
|
|
|
1
|
+
import { Story } from '@storybook/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { PaymentDialogProps } from './PaymentDialog';
|
|
4
|
+
declare const _default: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: {
|
|
7
|
+
(props: PaymentDialogProps): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
|
|
8
|
+
defaultProps: {
|
|
9
|
+
animation: string;
|
|
10
|
+
hideToasts: boolean;
|
|
11
|
+
randomSatoshis: boolean;
|
|
12
|
+
successText: string;
|
|
13
|
+
disableEnforceFocus: boolean;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
editable: boolean;
|
|
16
|
+
dialogOpen: boolean;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
decorators: ((Story: Story<import("@storybook/react").Args>) => JSX.Element)[];
|
|
20
|
+
argTypes: {
|
|
21
|
+
onClick: {
|
|
22
|
+
table: {
|
|
23
|
+
disable: boolean;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
onSuccess: {
|
|
27
|
+
table: {
|
|
28
|
+
disable: boolean;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
onTransaction: {
|
|
32
|
+
table: {
|
|
33
|
+
disable: boolean;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
args: {
|
|
38
|
+
to: string;
|
|
39
|
+
};
|
|
40
|
+
parameters: {
|
|
41
|
+
jest: string[];
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export default _default;
|
|
45
|
+
export declare const Default: Story<PaymentDialogProps>;
|
|
46
|
+
export declare const OrangeTheme: Story<PaymentDialogProps>;
|
|
47
|
+
export declare const UsdAmount: Story<PaymentDialogProps>;
|
|
48
|
+
export declare const withGoal: Story<PaymentDialogProps>;
|
|
49
|
+
export declare const withUSDGoalCurrency: Story<PaymentDialogProps>;
|
|
50
|
+
export declare const withEURGoalCurrency: Story<PaymentDialogProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PaymentDialog';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Theme, ThemeName } from '../../themes';
|
|
3
|
+
import { currencyObject } from '../../util/satoshis';
|
|
3
4
|
import { fiatCurrency } from '../../util/api-client';
|
|
4
|
-
export declare type cryptoCurrency = 'BCH' | 'SAT';
|
|
5
|
+
export declare type cryptoCurrency = 'BCH' | 'SAT' | 'bits';
|
|
5
6
|
export declare type currency = cryptoCurrency | fiatCurrency;
|
|
6
7
|
export interface WidgetProps {
|
|
7
8
|
to: string;
|
|
@@ -17,6 +18,10 @@ export interface WidgetProps {
|
|
|
17
18
|
totalReceived?: number | null;
|
|
18
19
|
goalAmount?: number | string | null;
|
|
19
20
|
currency?: currency;
|
|
21
|
+
currencyObject?: currencyObject | undefined;
|
|
22
|
+
randomSatoshis?: boolean;
|
|
23
|
+
price?: number;
|
|
24
|
+
editable?: boolean;
|
|
20
25
|
}
|
|
21
26
|
export declare const Widget: React.FC<WidgetProps>;
|
|
22
27
|
export default Widget;
|
|
@@ -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;
|
|
@@ -15,6 +15,15 @@ export interface WidgetContainerProps extends Omit<Omit<WidgetProps, 'loading'>,
|
|
|
15
15
|
sound?: boolean;
|
|
16
16
|
goalAmount?: number | string;
|
|
17
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;
|
|
18
27
|
}
|
|
19
28
|
export declare const WidgetContainer: React.FC<WidgetContainerProps>;
|
|
20
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
|
@@ -9,8 +9,23 @@ export declare const PayButton: {
|
|
|
9
9
|
successText: string;
|
|
10
10
|
disableEnforceFocus: boolean;
|
|
11
11
|
disabled: boolean;
|
|
12
|
+
editable: boolean;
|
|
12
13
|
};
|
|
13
14
|
};
|
|
14
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;
|
|
15
30
|
export declare const Widget: import("react").FC<Components.WidgetProps>;
|
|
16
31
|
export declare type WidgetProps = Components.WidgetProps;
|