@widergy/energy-ui 3.52.0 → 3.53.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 CHANGED
@@ -1,3 +1,17 @@
1
+ # [3.53.0](https://github.com/widergy/energy-ui/compare/v3.52.1...v3.53.0) (2025-01-13)
2
+
3
+
4
+ ### Features
5
+
6
+ * [AUT-418] user data testids ([#558](https://github.com/widergy/energy-ui/issues/558)) ([9032627](https://github.com/widergy/energy-ui/commit/90326273dcbbbac210818d17f77427dc53590b75))
7
+
8
+ ## [3.52.1](https://github.com/widergy/energy-ui/compare/v3.52.0...v3.52.1) (2025-01-08)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * [EVE-4364] status message header ([#550](https://github.com/widergy/energy-ui/issues/550)) ([eff5b7b](https://github.com/widergy/energy-ui/commit/eff5b7b2535e8273a14cfce6b6cfc7e1f096de4d))
14
+
1
15
  # [3.52.0](https://github.com/widergy/energy-ui/compare/v3.51.3...v3.52.0) (2025-01-07)
2
16
 
3
17
 
@@ -163,13 +163,13 @@ const UTBreadcrumbs = _ref => {
163
163
  childrenContainer: overflowControl ? _stylesModule.default.buttonContainer : null,
164
164
  text: overflowControl ? _stylesModule.default.ellipsis : null
165
165
  },
166
- dataTestId: dataTestId ? "".concat(dataTestId, ".").concat(index) : "".concat(buttonId, "}.").concat(index),
166
+ dataTestId: dataTestId ? "".concat(dataTestId, ".").concat(index) : "".concat(buttonId, ".").concat(index),
167
167
  onClick: handleClick,
168
168
  size: "small",
169
169
  variant: "text"
170
170
  }, colorThemesDefinition.button), "".concat(label)), !isLast && /*#__PURE__*/_react.default.createElement(_UTLabel.default, _extends({
171
171
  className: classes.separator,
172
- dataTestId: dataTestId ? "".concat(dataTestId, ".").concat(index) : "".concat(buttonId, "}.").concat(index),
172
+ dataTestId: dataTestId ? "".concat(dataTestId, ".").concat(index) : "".concat(buttonId, ".").concat(index),
173
173
  variant: "small",
174
174
  weight: "medium"
175
175
  }, colorThemesDefinition.label), separator));
@@ -6,19 +6,21 @@
6
6
 
7
7
  ## Props
8
8
 
9
- | Name | Type | Default | Description |
10
- | ------------- | ---------------- | --------- | ------------------------------------------------------------------------------------- |
11
- | classNames | objectOf(string) | | Additional class names to apply for further styling. |
12
- | disabled | bool | false | Disables the checkbox, making it unclickable. |
13
- | indeterminate | bool | false | Indicates if the checkbox is in an indeterminate state. |
14
- | isSimple | bool | false | **Deprecated**: Please avoid using this property in future implementations. |
15
- | onChange | func | | Function to call when the checkbox state changes. |
16
- | required | bool | false | Indicates if the checkbox is required. |
17
- | spacing | string | 'medium' | Defines the spacing between the checkbox and the label. Can be 'small' or 'medium'. |
18
- | title | string | | Title to display next to the checkbox. Supports markdown when `withMarkdown` is true. |
19
- | value | bool | false | Indicates if the checkbox is checked. |
20
- | variant | string | 'default' | Defines the visual variant of the checkbox. |
21
- | withMarkdown | bool | false | Enables markdown formatting for the `title` prop. |
9
+ | Name | Type | Default | Description |
10
+ | ------------------ | ---------------- | --------- | ------------------------------------------------------------------------------------- |
11
+ | checkboxDataTestId | string | | Box `data-testid`. |
12
+ | classNames | objectOf(string) | | Additional class names to apply for further styling. |
13
+ | dataTestId | string | | Whole component `data-testid`. |
14
+ | disabled | bool | false | Disables the checkbox, making it unclickable. |
15
+ | indeterminate | bool | false | Indicates if the checkbox is in an indeterminate state. |
16
+ | isSimple | bool | false | **Deprecated**: Please avoid using this property in future implementations. |
17
+ | onChange | func | | Function to call when the checkbox state changes. |
18
+ | required | bool | false | Indicates if the checkbox is required. |
19
+ | spacing | string | 'medium' | Defines the spacing between the checkbox and the label. Can be 'small' or 'medium'. |
20
+ | title | string | | Title to display next to the checkbox. Supports markdown when `withMarkdown` is true. |
21
+ | value | bool | false | Indicates if the checkbox is checked. |
22
+ | variant | string | 'default' | Defines the visual variant of the checkbox. |
23
+ | withMarkdown | bool | false | Enables markdown formatting for the `title` prop. |
22
24
 
23
25
  ## Usage
24
26
 
@@ -20,6 +20,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
20
20
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
21
21
  const UTCheckbox = _ref => {
22
22
  let {
23
+ checkboxDataTestId,
23
24
  classes: theme,
24
25
  classNames,
25
26
  dataTestId,
@@ -51,7 +52,8 @@ const UTCheckbox = _ref => {
51
52
  dataTestId: dataTestId,
52
53
  className: classes.container
53
54
  }, rootComponentProps), /*#__PURE__*/_react.default.createElement(BoxContainerComponent, _extends({
54
- className: classes.boxContainer
55
+ className: classes.boxContainer,
56
+ dataTestId: checkboxDataTestId
55
57
  }, boxContainerProps), isSimple ? /*#__PURE__*/_react.default.createElement(_UTIcon.default, {
56
58
  name: "IconCheck",
57
59
  shade: "04",
@@ -73,6 +75,7 @@ const UTCheckbox = _ref => {
73
75
  }, title));
74
76
  };
75
77
  UTCheckbox.propTypes = {
78
+ checkboxDataTestId: _propTypes.string,
76
79
  classes: (0, _propTypes.objectOf)(_propTypes.string),
77
80
  classNames: (0, _propTypes.objectOf)(_propTypes.string),
78
81
  dataTestId: _propTypes.string,
@@ -15,7 +15,7 @@ The purpose of this component, as its name indicates, is to communicate a messag
15
15
  | helpTextProps | object | | Props to be applied to the help text UTLabel. |
16
16
  | icon | string | | Icon to be displayed in the header. |
17
17
  | iconProps | object | | Props to be applied to the UTIcon |
18
- | image | string | | URL of an image to be displayed in the header, replacing the icon. |
18
+ | HeaderComponent | element | | Component to be displayed in the header, replacing the icon. |
19
19
  | loading | bool | false | Indicates whether the component is in a loading state. Replaces the header. |
20
20
  | primaryAction | func | | Callback function for the primary action. |
21
21
  | primaryActionProps | object | | Props to be applied to the primary action UTButton. |
@@ -23,11 +23,11 @@ const UTStatusMessage = _ref => {
23
23
  colorTheme = _constants.COLOR_THEMES.DEFAULT,
24
24
  description,
25
25
  descriptionProps,
26
+ HeaderComponent,
26
27
  helpText,
27
28
  helpTextProps,
28
29
  icon = 'IconInfoCircle',
29
30
  iconProps = {},
30
- image,
31
31
  loading,
32
32
  primaryAction,
33
33
  primaryActionProps,
@@ -46,11 +46,7 @@ const UTStatusMessage = _ref => {
46
46
  text: null
47
47
  }) : showHeader ? /*#__PURE__*/_react.default.createElement("div", {
48
48
  className: classes.banner
49
- }, image ? /*#__PURE__*/_react.default.createElement("img", {
50
- src: image,
51
- className: "".concat(_stylesModule.default.image, " ").concat(classes.image),
52
- alt: ""
53
- }) : /*#__PURE__*/_react.default.createElement("div", {
49
+ }, HeaderComponent ? /*#__PURE__*/_react.default.createElement(HeaderComponent, null) : /*#__PURE__*/_react.default.createElement("div", {
54
50
  className: classes.iconContainer
55
51
  }, /*#__PURE__*/_react.default.createElement(_UTIcon.default, _extends({
56
52
  name: icon,
@@ -86,11 +82,11 @@ UTStatusMessage.propTypes = {
86
82
  colorTheme: _propTypes.string,
87
83
  description: _propTypes.string,
88
84
  descriptionProps: _propTypes.object,
85
+ HeaderComponent: _propTypes.element,
89
86
  helpText: _propTypes.string,
90
87
  helpTextProps: _propTypes.object,
91
88
  icon: _propTypes.string,
92
89
  iconProps: _propTypes.object,
93
- image: _propTypes.string,
94
90
  loading: _propTypes.bool,
95
91
  primaryAction: _propTypes.func,
96
92
  primaryActionProps: _propTypes.object,
@@ -9,6 +9,7 @@
9
9
  | Name | Type | Default | Description |
10
10
  | -------------- | ------ | ------- | -------------------------------------------------------------------------------------------- |
11
11
  | className | string | | Custom CSS class to apply to the root of the component. |
12
+ | dataTestId | string | | Component `data-testid` |
12
13
  | validationData | array | [] | Array of validation data objects to display messages, each with a status and optional icons. |
13
14
 
14
15
  ### validationData
@@ -26,8 +26,7 @@ const UTValidation = _ref => {
26
26
  if ((0, _lodash.isEmpty)(validationData)) return null;
27
27
  const showIcon = status => _constants.STATUSES_WITH_ICON.includes(status);
28
28
  return /*#__PURE__*/_react.default.createElement("div", {
29
- className: "".concat(className, " ").concat(_stylesModule.default.container),
30
- "data-testid": dataTestId
29
+ className: "".concat(className, " ").concat(_stylesModule.default.container)
31
30
  }, validationData.map((_ref2, index) => {
32
31
  let {
33
32
  items,
@@ -57,7 +56,8 @@ const UTValidation = _ref => {
57
56
  text,
58
57
  status: itemStatus
59
58
  }, itemIndex),
60
- className: _stylesModule.default.itemContainer
59
+ className: _stylesModule.default.itemContainer,
60
+ "data-testid": "".concat(dataTestId, ".").concat(index, ".").concat(itemIndex)
61
61
  }, withIcon && /*#__PURE__*/_react.default.createElement("div", {
62
62
  className: "".concat(_stylesModule.default.iconContainer, " ").concat(classes["icon".concat((0, _componentUtils.capitalize)(itemStatus))])
63
63
  }, showIcon(itemStatus) && /*#__PURE__*/_react.default.createElement(_UTIcon.default, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/energy-ui",
3
- "version": "3.52.0",
3
+ "version": "3.53.0",
4
4
  "description": "Widergy Web Components",
5
5
  "author": "widergy",
6
6
  "license": "MIT",