@widergy/energy-ui 2.7.1 → 2.7.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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [2.7.2](https://github.com/widergy/energy-ui/compare/v2.7.1...v2.7.2) (2023-09-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* secondary custom component ([#377](https://github.com/widergy/energy-ui/issues/377)) ([82bc519](https://github.com/widergy/energy-ui/commit/82bc519ba8bfc29c0c77e0947dad1c3bfdc4a0cd))
|
|
7
|
+
|
|
1
8
|
## [2.7.1](https://github.com/widergy/energy-ui/compare/v2.7.0...v2.7.1) (2023-09-12)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -31,6 +31,7 @@ var UTModal = function UTModal(_ref) {
|
|
|
31
31
|
primaryAction = _ref.primaryAction,
|
|
32
32
|
removeBodyPadding = _ref.removeBodyPadding,
|
|
33
33
|
secondaryAction = _ref.secondaryAction,
|
|
34
|
+
SecondaryActionComponent = _ref.SecondaryActionComponent,
|
|
34
35
|
size = _ref.size,
|
|
35
36
|
status = _ref.status,
|
|
36
37
|
title = _ref.title;
|
|
@@ -45,6 +46,7 @@ var UTModal = function UTModal(_ref) {
|
|
|
45
46
|
return (0, _classesUtils.mergeClasses)(themeClasses, classNames);
|
|
46
47
|
}, [classNames]);
|
|
47
48
|
var StatusIcon = _constants.STATUS_ICONS[status];
|
|
49
|
+
var withSecondaryActions = !(0, _object.objectIsEmpty)(secondaryAction) || SecondaryActionComponent;
|
|
48
50
|
return /*#__PURE__*/_react.default.createElement("dialog", {
|
|
49
51
|
className: "".concat(_stylesModule.default.container, " ").concat(classes.container, " ").concat(size ? _stylesModule.default["container".concat(size[0].toUpperCase()).concat(size.toLowerCase().slice(1))] : _stylesModule.default.containerM),
|
|
50
52
|
onClick: onClickDialog,
|
|
@@ -63,8 +65,8 @@ var UTModal = function UTModal(_ref) {
|
|
|
63
65
|
}, description)), children && /*#__PURE__*/_react.default.createElement("div", {
|
|
64
66
|
className: "".concat(_stylesModule.default.body, " ").concat(!removeBodyPadding && _stylesModule.default.bodyPadding)
|
|
65
67
|
}, children), /*#__PURE__*/_react.default.createElement("div", {
|
|
66
|
-
className: "\n ".concat(_stylesModule.default.actions, "\n ").concat(classes.actions, "\n ").concat(
|
|
67
|
-
},
|
|
68
|
+
className: "\n ".concat(_stylesModule.default.actions, "\n ").concat(classes.actions, "\n ").concat(withSecondaryActions && _stylesModule.default.withSecondaryActions, "\n ")
|
|
69
|
+
}, withSecondaryActions && /*#__PURE__*/_react.default.createElement("div", null, SecondaryActionComponent ? /*#__PURE__*/_react.default.createElement(SecondaryActionComponent, null) : /*#__PURE__*/_react.default.createElement(_UTButton.default, _extends({
|
|
68
70
|
colorTheme: "secondary",
|
|
69
71
|
variant: "semitransparent"
|
|
70
72
|
}, secondaryAction), secondaryAction.label)), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -96,6 +98,7 @@ UTModal.propTypes = {
|
|
|
96
98
|
label: _propTypes.string,
|
|
97
99
|
onClick: _propTypes.func
|
|
98
100
|
}),
|
|
101
|
+
SecondaryActionComponent: _propTypes.elementType,
|
|
99
102
|
size: _propTypes.string,
|
|
100
103
|
status: _propTypes.string,
|
|
101
104
|
title: _propTypes.string
|