@widergy/energy-ui 3.98.2 → 3.98.3
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
|
+
## [3.98.3](https://github.com/widergy/energy-ui/compare/v3.98.2...v3.98.3) (2025-08-13)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* [SFPE-497] ut button group sizes ([#665](https://github.com/widergy/energy-ui/issues/665)) ([229392a](https://github.com/widergy/energy-ui/commit/229392ab614ab45ae3861e0e9130007be67f6645))
|
|
7
|
+
|
|
1
8
|
## [3.98.2](https://github.com/widergy/energy-ui/compare/v3.98.1...v3.98.2) (2025-08-12)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -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);
|