@automattic/vip-design-system 0.18.4-0 → 0.18.5-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.
|
@@ -79,10 +79,6 @@ var NewConfirmationDialog = function NewConfirmationDialog(_ref2) {
|
|
|
79
79
|
body = _ref2$body === void 0 ? '' : _ref2$body,
|
|
80
80
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref2, _excluded);
|
|
81
81
|
|
|
82
|
-
var _React$useState = _react["default"].useState(false),
|
|
83
|
-
open = _React$useState[0],
|
|
84
|
-
setOpen = _React$useState[1];
|
|
85
|
-
|
|
86
82
|
var directTrigger = /*#__PURE__*/_react["default"].cloneElement(trigger, {
|
|
87
83
|
onClick: onConfirm
|
|
88
84
|
});
|
|
@@ -92,22 +88,21 @@ var NewConfirmationDialog = function NewConfirmationDialog(_ref2) {
|
|
|
92
88
|
}
|
|
93
89
|
|
|
94
90
|
return (0, _jsxRuntime.jsx)(_.NewDialog.Root, (0, _extends2["default"])({
|
|
95
|
-
open: open,
|
|
96
|
-
onOpenChange: setOpen,
|
|
97
91
|
sx: {
|
|
98
92
|
maxWidth: 680
|
|
99
93
|
},
|
|
100
94
|
title: title,
|
|
101
95
|
description: body,
|
|
102
|
-
content: (
|
|
103
|
-
onClose
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
96
|
+
content: function content(_ref3) {
|
|
97
|
+
var onClose = _ref3.onClose;
|
|
98
|
+
return (0, _jsxRuntime.jsx)(NewConfirmationDialogContent, {
|
|
99
|
+
onClose: onClose,
|
|
100
|
+
onConfirm: onConfirm,
|
|
101
|
+
body: body,
|
|
102
|
+
label: label,
|
|
103
|
+
buttonVariant: buttonVariant
|
|
104
|
+
});
|
|
105
|
+
},
|
|
111
106
|
trigger: trigger
|
|
112
107
|
}, props));
|
|
113
108
|
};
|
package/package.json
CHANGED
|
@@ -58,7 +58,6 @@ const NewConfirmationDialog = ( {
|
|
|
58
58
|
body = '',
|
|
59
59
|
...props
|
|
60
60
|
} ) => {
|
|
61
|
-
const [ open, setOpen ] = React.useState( false );
|
|
62
61
|
const directTrigger = React.cloneElement( trigger, { onClick: onConfirm } );
|
|
63
62
|
|
|
64
63
|
if ( ! needsConfirm ) {
|
|
@@ -67,20 +66,18 @@ const NewConfirmationDialog = ( {
|
|
|
67
66
|
|
|
68
67
|
return (
|
|
69
68
|
<NewDialog.Root
|
|
70
|
-
open={ open }
|
|
71
|
-
onOpenChange={ setOpen }
|
|
72
69
|
sx={ { maxWidth: 680 } }
|
|
73
70
|
title={ title }
|
|
74
71
|
description={ body }
|
|
75
|
-
content={
|
|
72
|
+
content={ ( { onClose } ) => (
|
|
76
73
|
<NewConfirmationDialogContent
|
|
77
|
-
onClose={
|
|
74
|
+
onClose={ onClose }
|
|
78
75
|
onConfirm={ onConfirm }
|
|
79
76
|
body={ body }
|
|
80
77
|
label={ label }
|
|
81
78
|
buttonVariant={ buttonVariant }
|
|
82
79
|
/>
|
|
83
|
-
}
|
|
80
|
+
) }
|
|
84
81
|
trigger={ trigger }
|
|
85
82
|
{ ...props }
|
|
86
83
|
/>
|