@automattic/vip-design-system 2.12.2 → 2.12.4
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function NewConfirmationDialog({ trigger, onConfirm, needsConfirm, label, buttonVariant, title, body, ...props }: {
|
|
1
|
+
export function NewConfirmationDialog({ trigger, onConfirm, needsConfirm, label, buttonVariant, title, body, buttonDisabled, ...props }: {
|
|
2
2
|
[x: string]: any;
|
|
3
3
|
trigger: any;
|
|
4
4
|
onConfirm: any;
|
|
@@ -7,6 +7,7 @@ export function NewConfirmationDialog({ trigger, onConfirm, needsConfirm, label,
|
|
|
7
7
|
buttonVariant: any;
|
|
8
8
|
title: any;
|
|
9
9
|
body?: string | undefined;
|
|
10
|
+
buttonDisabled?: boolean | undefined;
|
|
10
11
|
}): React.JSX.Element;
|
|
11
12
|
export namespace NewConfirmationDialog {
|
|
12
13
|
namespace propTypes {
|
|
@@ -17,6 +18,7 @@ export namespace NewConfirmationDialog {
|
|
|
17
18
|
let body: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
18
19
|
let label: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
19
20
|
let buttonVariant: PropTypes.Requireable<string>;
|
|
21
|
+
let buttonDisabled: PropTypes.Requireable<boolean>;
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
24
|
import React from 'react';
|
|
@@ -18,6 +18,7 @@ const NewConfirmationDialogContent = ( {
|
|
|
18
18
|
onConfirm,
|
|
19
19
|
onClose,
|
|
20
20
|
className = null,
|
|
21
|
+
buttonDisabled = false,
|
|
21
22
|
} ) => (
|
|
22
23
|
<Box className={ classNames( 'vip-confirmation-dialog-component', className ) }>
|
|
23
24
|
<Flex sx={ { justifyContent: 'flex-end', mt: 4 } }>
|
|
@@ -31,6 +32,7 @@ const NewConfirmationDialogContent = ( {
|
|
|
31
32
|
onConfirm();
|
|
32
33
|
onClose();
|
|
33
34
|
} }
|
|
35
|
+
disabled={ buttonDisabled }
|
|
34
36
|
>
|
|
35
37
|
{ label }
|
|
36
38
|
</Button>
|
|
@@ -46,6 +48,7 @@ NewConfirmationDialogContent.propTypes = {
|
|
|
46
48
|
onClose: PropTypes.func,
|
|
47
49
|
onConfirm: PropTypes.func,
|
|
48
50
|
className: PropTypes.any,
|
|
51
|
+
buttonDisabled: PropTypes.bool,
|
|
49
52
|
};
|
|
50
53
|
|
|
51
54
|
const NewConfirmationDialog = ( {
|
|
@@ -56,6 +59,7 @@ const NewConfirmationDialog = ( {
|
|
|
56
59
|
buttonVariant,
|
|
57
60
|
title,
|
|
58
61
|
body = '',
|
|
62
|
+
buttonDisabled = false,
|
|
59
63
|
...props
|
|
60
64
|
} ) => {
|
|
61
65
|
const directTrigger = React.cloneElement( trigger, { onClick: onConfirm } );
|
|
@@ -76,6 +80,7 @@ const NewConfirmationDialog = ( {
|
|
|
76
80
|
body={ body }
|
|
77
81
|
label={ label }
|
|
78
82
|
buttonVariant={ buttonVariant }
|
|
83
|
+
buttonDisabled={ buttonDisabled }
|
|
79
84
|
/>
|
|
80
85
|
) }
|
|
81
86
|
trigger={ trigger }
|
|
@@ -92,6 +97,7 @@ NewConfirmationDialog.propTypes = {
|
|
|
92
97
|
body: PropTypes.node,
|
|
93
98
|
label: PropTypes.node,
|
|
94
99
|
buttonVariant: PropTypes.string,
|
|
100
|
+
buttonDisabled: PropTypes.bool,
|
|
95
101
|
};
|
|
96
102
|
|
|
97
103
|
export { NewConfirmationDialog };
|
package/package.json
CHANGED
|
@@ -18,6 +18,7 @@ const NewConfirmationDialogContent = ( {
|
|
|
18
18
|
onConfirm,
|
|
19
19
|
onClose,
|
|
20
20
|
className = null,
|
|
21
|
+
buttonDisabled = false,
|
|
21
22
|
} ) => (
|
|
22
23
|
<Box className={ classNames( 'vip-confirmation-dialog-component', className ) }>
|
|
23
24
|
<Flex sx={ { justifyContent: 'flex-end', mt: 4 } }>
|
|
@@ -31,6 +32,7 @@ const NewConfirmationDialogContent = ( {
|
|
|
31
32
|
onConfirm();
|
|
32
33
|
onClose();
|
|
33
34
|
} }
|
|
35
|
+
disabled={ buttonDisabled }
|
|
34
36
|
>
|
|
35
37
|
{ label }
|
|
36
38
|
</Button>
|
|
@@ -46,6 +48,7 @@ NewConfirmationDialogContent.propTypes = {
|
|
|
46
48
|
onClose: PropTypes.func,
|
|
47
49
|
onConfirm: PropTypes.func,
|
|
48
50
|
className: PropTypes.any,
|
|
51
|
+
buttonDisabled: PropTypes.bool,
|
|
49
52
|
};
|
|
50
53
|
|
|
51
54
|
const NewConfirmationDialog = ( {
|
|
@@ -56,6 +59,7 @@ const NewConfirmationDialog = ( {
|
|
|
56
59
|
buttonVariant,
|
|
57
60
|
title,
|
|
58
61
|
body = '',
|
|
62
|
+
buttonDisabled = false,
|
|
59
63
|
...props
|
|
60
64
|
} ) => {
|
|
61
65
|
const directTrigger = React.cloneElement( trigger, { onClick: onConfirm } );
|
|
@@ -76,6 +80,7 @@ const NewConfirmationDialog = ( {
|
|
|
76
80
|
body={ body }
|
|
77
81
|
label={ label }
|
|
78
82
|
buttonVariant={ buttonVariant }
|
|
83
|
+
buttonDisabled={ buttonDisabled }
|
|
79
84
|
/>
|
|
80
85
|
) }
|
|
81
86
|
trigger={ trigger }
|
|
@@ -92,6 +97,7 @@ NewConfirmationDialog.propTypes = {
|
|
|
92
97
|
body: PropTypes.node,
|
|
93
98
|
label: PropTypes.node,
|
|
94
99
|
buttonVariant: PropTypes.string,
|
|
100
|
+
buttonDisabled: PropTypes.bool,
|
|
95
101
|
};
|
|
96
102
|
|
|
97
103
|
export { NewConfirmationDialog };
|