@widergy/energy-ui 3.98.2 → 3.99.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/CHANGELOG.md +14 -0
- package/dist/components/UTActionCard/components/BottomActions/index.js +8 -4
- package/dist/components/UTActionCard/components/BottomActions/styles.module.scss +6 -1
- package/dist/components/UTActionCard/components/HeaderActions/index.js +2 -1
- package/dist/components/UTButtonGroup/README.md +10 -7
- package/dist/components/UTButtonGroup/constants.js +3 -2
- package/dist/components/UTButtonGroup/index.js +5 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [3.99.0](https://github.com/widergy/energy-ui/compare/v3.98.3...v3.99.0) (2025-08-13)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* [EVEP2-10] add label in button ([#657](https://github.com/widergy/energy-ui/issues/657)) ([88a8a74](https://github.com/widergy/energy-ui/commit/88a8a74ac492c9c334d49255b856361382036f42))
|
|
7
|
+
|
|
8
|
+
## [3.98.3](https://github.com/widergy/energy-ui/compare/v3.98.2...v3.98.3) (2025-08-13)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* [SFPE-497] ut button group sizes ([#665](https://github.com/widergy/energy-ui/issues/665)) ([229392a](https://github.com/widergy/energy-ui/commit/229392ab614ab45ae3861e0e9130007be67f6645))
|
|
14
|
+
|
|
1
15
|
## [3.98.2](https://github.com/widergy/energy-ui/compare/v3.98.1...v3.98.2) (2025-08-12)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
|
+
var _Divider = _interopRequireDefault(require("@material-ui/core/Divider"));
|
|
9
10
|
var _UTButton = _interopRequireDefault(require("../../../UTButton"));
|
|
10
11
|
var _constants = require("../../constants");
|
|
11
12
|
var _constants2 = require("./constants");
|
|
@@ -21,7 +22,7 @@ const BottomActions = _ref => {
|
|
|
21
22
|
const type = actions.length > 2 ? _constants.ACTION_TYPES.REDIRECTION : bottomActionsVariant || _constants.ACTION_TYPES.DEFAULT;
|
|
22
23
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
23
24
|
className: _stylesModule.default.actionsContainer
|
|
24
|
-
}, actions.map(_ref2 => {
|
|
25
|
+
}, actions.map((_ref2, index) => {
|
|
25
26
|
let {
|
|
26
27
|
colorTheme = 'primary',
|
|
27
28
|
dataTestId,
|
|
@@ -31,7 +32,9 @@ const BottomActions = _ref => {
|
|
|
31
32
|
loading,
|
|
32
33
|
onClick
|
|
33
34
|
} = _ref2;
|
|
34
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
35
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, {
|
|
36
|
+
key: label
|
|
37
|
+
}, /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
35
38
|
classNames: {
|
|
36
39
|
childrenContainer: "".concat(type === _constants.ACTION_TYPES.REDIRECTION && _stylesModule.default.redirectionChildrenContainer, " "),
|
|
37
40
|
root: "".concat(_stylesModule.default.actionButton, " ").concat(type === _constants.ACTION_TYPES.REDIRECTION && _stylesModule.default.fullWidth, " ").concat(size === _constants.SIZES.MEDIUM && _stylesModule.default.mediumPadding),
|
|
@@ -42,12 +45,13 @@ const BottomActions = _ref => {
|
|
|
42
45
|
disabled: disabled,
|
|
43
46
|
Icon: type === _constants.ACTION_TYPES.REDIRECTION ? Icon || _constants2.DEFAULT_REDIRECTION_ICON : Icon,
|
|
44
47
|
iconPlacement: type === _constants.ACTION_TYPES.REDIRECTION ? 'right' : 'left',
|
|
45
|
-
key: label,
|
|
46
48
|
loading: loading,
|
|
47
49
|
onClick: onClick,
|
|
48
50
|
size: "large",
|
|
49
51
|
variant: "text"
|
|
50
|
-
}, label)
|
|
52
|
+
}, label), actions.length > 1 && index < actions.length - 1 && /*#__PURE__*/_react.default.createElement(_Divider.default, {
|
|
53
|
+
className: _stylesModule.default.divider
|
|
54
|
+
}));
|
|
51
55
|
}));
|
|
52
56
|
};
|
|
53
57
|
BottomActions.propTypes = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
$default-border-color: #
|
|
1
|
+
$default-border-color: #e7e7e7;
|
|
2
2
|
|
|
3
3
|
.actionsContainer {
|
|
4
4
|
border-top: 1px solid var(--light04, $default-border-color);
|
|
@@ -18,6 +18,11 @@ $default-border-color: #E7E7E7;
|
|
|
18
18
|
width: 100%;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
.divider {
|
|
22
|
+
background-color: var(--light04, $default-border-color);
|
|
23
|
+
width: 100%;
|
|
24
|
+
}
|
|
25
|
+
|
|
21
26
|
.redirectionText {
|
|
22
27
|
align-items: center;
|
|
23
28
|
display: flex;
|
|
@@ -64,7 +64,7 @@ const HeaderActions = _ref => {
|
|
|
64
64
|
},
|
|
65
65
|
size: "medium",
|
|
66
66
|
variant: "text"
|
|
67
|
-
}))))), !(0, _isEmpty.default)(secondaryActions) && (!showButtonGroup ? /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_UTMenu.default, {
|
|
67
|
+
}), buttonProps.title)))), !(0, _isEmpty.default)(secondaryActions) && (!showButtonGroup ? /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_UTMenu.default, {
|
|
68
68
|
anchor: menu,
|
|
69
69
|
iconBefore: true,
|
|
70
70
|
items: secondaryActions,
|
|
@@ -109,6 +109,7 @@ HeaderActions.propTypes = {
|
|
|
109
109
|
Icon: (0, _propTypes.oneOfType)([_propTypes.elementType, _propTypes.string]),
|
|
110
110
|
id: (0, _propTypes.oneOfType)([_propTypes.number, _propTypes.string]),
|
|
111
111
|
isPrimary: _propTypes.bool,
|
|
112
|
+
title: _propTypes.string,
|
|
112
113
|
label: _propTypes.string,
|
|
113
114
|
loading: _propTypes.bool,
|
|
114
115
|
onClick: _propTypes.func,
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
#
|
|
1
|
+
# UTButtonGroup
|
|
2
|
+
|
|
3
|
+
A component that renders a group of buttons with consistent styling and behavior. The selected button is highlighted with a filled variant while others remain as text variants.
|
|
2
4
|
|
|
3
5
|
## Props
|
|
4
6
|
|
|
5
|
-
| Name | Type | Default | Description
|
|
6
|
-
| ---------- | :-------------- | --------- |
|
|
7
|
-
| actions | array |
|
|
8
|
-
| colorTheme | string | 'primary' | The color theme to use. One of
|
|
9
|
-
|
|
|
10
|
-
|
|
|
7
|
+
| Name | Type | Default | Required | Description |
|
|
8
|
+
| ---------- | :-------------- | --------- | -------- | ---------------------------------------------------------------------------------------------- |
|
|
9
|
+
| actions | array | - | Yes | Array of action objects to render. Each action must include `Icon`, `id`, and `onClick` props. |
|
|
10
|
+
| colorTheme | string | 'primary' | No | The color theme to use. One of: `primary`, `secondary`, `negative`, `neutral`. |
|
|
11
|
+
| selected | string / number | - | Yes | ID of the currently active/selected button. |
|
|
12
|
+
| shape | string | 'square' | No | Shape of the button group. One of: `square`, `circle`. |
|
|
13
|
+
| size | string | 'large' | No | Size of the buttons. One of: `small`, `medium`, `large`. |
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.SQUARE_TYPE = exports.DEFAULT_TYPE = exports.DEFAULT_COLOR_THEME = exports.CIRCLE_TYPE = exports.BACKGROUND_COLOR_MAPPER = void 0;
|
|
6
|
+
exports.SQUARE_TYPE = exports.DEFAULT_TYPE = exports.DEFAULT_SIZE = exports.DEFAULT_COLOR_THEME = exports.CIRCLE_TYPE = exports.BACKGROUND_COLOR_MAPPER = void 0;
|
|
7
7
|
const BACKGROUND_COLOR_MAPPER = theme => ({
|
|
8
8
|
primary: theme.lightBackground,
|
|
9
9
|
negative: theme.negativeBackground,
|
|
@@ -13,4 +13,5 @@ exports.BACKGROUND_COLOR_MAPPER = BACKGROUND_COLOR_MAPPER;
|
|
|
13
13
|
const CIRCLE_TYPE = exports.CIRCLE_TYPE = 'circle';
|
|
14
14
|
const SQUARE_TYPE = exports.SQUARE_TYPE = 'square';
|
|
15
15
|
const DEFAULT_TYPE = exports.DEFAULT_TYPE = SQUARE_TYPE;
|
|
16
|
-
const DEFAULT_COLOR_THEME = exports.DEFAULT_COLOR_THEME = 'primary';
|
|
16
|
+
const DEFAULT_COLOR_THEME = exports.DEFAULT_COLOR_THEME = 'primary';
|
|
17
|
+
const DEFAULT_SIZE = exports.DEFAULT_SIZE = 'large';
|
|
@@ -18,7 +18,8 @@ const UTButtonGroup = _ref => {
|
|
|
18
18
|
classes: theme,
|
|
19
19
|
colorTheme = _constants.DEFAULT_COLOR_THEME,
|
|
20
20
|
selected,
|
|
21
|
-
shape: type = _constants.DEFAULT_TYPE
|
|
21
|
+
shape: type = _constants.DEFAULT_TYPE,
|
|
22
|
+
size = _constants.DEFAULT_SIZE
|
|
22
23
|
} = _ref;
|
|
23
24
|
const backgroundColor = (0, _constants.BACKGROUND_COLOR_MAPPER)(theme)[colorTheme] || (0, _constants.BACKGROUND_COLOR_MAPPER)(theme).primary;
|
|
24
25
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -36,7 +37,7 @@ const UTButtonGroup = _ref => {
|
|
|
36
37
|
Icon: Icon,
|
|
37
38
|
key: id,
|
|
38
39
|
onClick: onClick,
|
|
39
|
-
size:
|
|
40
|
+
size: size,
|
|
40
41
|
variant: selected === id ? 'filled' : 'text'
|
|
41
42
|
});
|
|
42
43
|
}));
|
|
@@ -50,6 +51,7 @@ UTButtonGroup.propTypes = {
|
|
|
50
51
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
51
52
|
colorTheme: _propTypes.string,
|
|
52
53
|
selected: (0, _propTypes.oneOfType)([_propTypes.number, _propTypes.string]).isRequired,
|
|
53
|
-
shape: _propTypes.string
|
|
54
|
+
shape: _propTypes.string,
|
|
55
|
+
size: _propTypes.string
|
|
54
56
|
};
|
|
55
57
|
var _default = exports.default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTButtonGroup);
|