@widergy/energy-ui 3.64.0 → 3.66.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.66.0](https://github.com/widergy/energy-ui/compare/v3.65.0...v3.66.0) (2025-03-06)
2
+
3
+
4
+ ### Features
5
+
6
+ * [AUT-632/526] smart bil ids ([#588](https://github.com/widergy/energy-ui/issues/588)) ([1d0dfad](https://github.com/widergy/energy-ui/commit/1d0dfad858dcee97b4eb076dbf1a71fa2c52a1a8))
7
+
8
+ # [3.65.0](https://github.com/widergy/energy-ui/compare/v3.64.0...v3.65.0) (2025-02-25)
9
+
10
+
11
+ ### Features
12
+
13
+ * new icon added ([#585](https://github.com/widergy/energy-ui/issues/585)) ([84b0cb5](https://github.com/widergy/energy-ui/commit/84b0cb56e9c7091fc31ffdc35af05c97e89b7911))
14
+
1
15
  # [3.64.0](https://github.com/widergy/energy-ui/compare/v3.63.2...v3.64.0) (2025-02-24)
2
16
 
3
17
 
@@ -54,10 +54,16 @@ const UTCheckbox = _ref => {
54
54
  actions: actions,
55
55
  required: required
56
56
  }, title), /*#__PURE__*/_react.default.createElement(RootComponent, _extends({
57
- dataTestId: dataTestId,
58
57
  className: classes.container
58
+ }, variant === _constants.BUTTON_VARIANT ? {
59
+ dataTestId
60
+ } : {
61
+ 'data-testid': dataTestId
59
62
  }, rootComponentProps), /*#__PURE__*/_react.default.createElement(BoxContainerComponent, _extends({
60
- className: classes.boxContainer,
63
+ className: classes.boxContainer
64
+ }, variant === _constants.BUTTON_VARIANT ? {
65
+ 'data-testid': checkboxDataTestId
66
+ } : {
61
67
  dataTestId: checkboxDataTestId
62
68
  }, boxContainerProps), isSimple ? /*#__PURE__*/_react.default.createElement(_UTIcon.default, {
63
69
  name: "IconCheck",
@@ -12,16 +12,16 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
12
12
  const UTExternalLink = _ref => {
13
13
  let {
14
14
  children,
15
- classes,
16
15
  className,
16
+ classes,
17
+ dataTestId,
17
18
  openProps,
18
19
  url
19
20
  } = _ref;
20
21
  return /*#__PURE__*/_react.default.createElement("a", {
21
- href: url,
22
- target: "_blank",
23
- rel: "noopener noreferrer",
24
22
  className: "".concat(classes.root, " ").concat(className),
23
+ "data-testid": dataTestId,
24
+ href: url,
25
25
  onClick: openProps && (event => {
26
26
  event.preventDefault();
27
27
  const {
@@ -33,12 +33,15 @@ const UTExternalLink = _ref => {
33
33
  const win = window.open(openUrl || url, targetName || '_blank', options, replace);
34
34
  win.opener = null;
35
35
  win.location = openUrl || url;
36
- })
36
+ }),
37
+ rel: "noopener noreferrer",
38
+ target: "_blank"
37
39
  }, children);
38
40
  };
39
41
  UTExternalLink.propTypes = {
40
- classes: (0, _propTypes.objectOf)(_propTypes.string),
41
42
  className: _propTypes.string,
43
+ classes: (0, _propTypes.objectOf)(_propTypes.string),
44
+ dataTestId: _propTypes.string,
42
45
  openProps: (0, _propTypes.shape)({
43
46
  openUrl: _propTypes.string,
44
47
  targetName: _propTypes.string,
@@ -0,0 +1,4 @@
1
+ <svg width="100" height="100" viewBox="0 0 100 100" stroke="none" fill="currentColor" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M25 20.8333C22.6988 20.8333 20.8333 22.6988 20.8333 25V75C20.8333 77.3012 22.6988 79.1667 25 79.1667H75C77.3012 79.1667 79.1667 77.3012 79.1667 75V25C79.1667 22.6988 77.3012 20.8333 75 20.8333H25ZM12.5 25C12.5 18.0964 18.0964 12.5 25 12.5H75C81.9036 12.5 87.5 18.0964 87.5 25V75C87.5 81.9036 81.9036 87.5 75 87.5H25C18.0964 87.5 12.5 81.9036 12.5 75V25Z"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M50.1827 33.4577C51.8176 33.9132 52.7367 35.4876 52.2356 36.9741L48.9501 46.7207H55.2371C56.2544 46.7207 57.2067 47.175 57.7848 47.9361C58.3629 48.6971 58.4929 49.6677 58.1327 50.5327L52.1709 64.8477C51.5654 66.3017 49.7781 67.034 48.1789 66.4835C46.5798 65.9329 45.7743 64.3079 46.3798 62.8539L50.754 52.3509H44.7629C43.7809 52.3509 42.8572 51.9274 42.2733 51.2095C41.6895 50.4916 41.5149 49.5645 41.8026 48.7109L46.3151 35.3243C46.8162 33.8378 48.5477 33.0021 50.1827 33.4577Z"/>
4
+ </svg>
@@ -117,6 +117,24 @@ EnergyIconConsumption.defaultProps = {
117
117
  stroke: "currentColor",
118
118
  xmlns: "http://www.w3.org/2000/svg"
119
119
  };
120
+ var EnergyIconConsumptionBoxFilled = function EnergyIconConsumptionBoxFilled(props) {
121
+ return /*#__PURE__*/_react.default.createElement("svg", props, /*#__PURE__*/_react.default.createElement("path", {
122
+ fillRule: "evenodd",
123
+ clipRule: "evenodd",
124
+ d: "M25 20.833A4.167 4.167 0 0 0 20.833 25v50A4.167 4.167 0 0 0 25 79.167h50A4.167 4.167 0 0 0 79.167 75V25A4.167 4.167 0 0 0 75 20.833H25ZM12.5 25c0-6.904 5.596-12.5 12.5-12.5h50c6.904 0 12.5 5.596 12.5 12.5v50c0 6.904-5.596 12.5-12.5 12.5H25c-6.904 0-12.5-5.596-12.5-12.5V25Z"
125
+ }), /*#__PURE__*/_react.default.createElement("path", {
126
+ fillRule: "evenodd",
127
+ clipRule: "evenodd",
128
+ d: "M50.183 33.458c1.635.455 2.554 2.03 2.053 3.516l-3.286 9.747h6.287c1.017 0 1.97.454 2.548 1.215a2.6 2.6 0 0 1 .348 2.597L52.17 64.848c-.606 1.454-2.393 2.186-3.992 1.636-1.6-.551-2.405-2.176-1.8-3.63l4.375-10.503h-5.991c-.982 0-1.906-.424-2.49-1.142-.584-.717-.758-1.645-.47-2.498l4.512-13.387c.501-1.486 2.233-2.322 3.868-1.866Z"
129
+ }));
130
+ };
131
+ EnergyIconConsumptionBoxFilled.defaultProps = {
132
+ width: "100",
133
+ height: "100",
134
+ viewBox: "0 0 100 100",
135
+ fill: "currentColor",
136
+ xmlns: "http://www.w3.org/2000/svg"
137
+ };
120
138
  var EnergyIconHome = function EnergyIconHome(props) {
121
139
  return /*#__PURE__*/_react.default.createElement("svg", props, /*#__PURE__*/_react.default.createElement("path", {
122
140
  d: "m9.02 2.84-5.39 4.2C2.73 7.74 2 9.23 2 10.36v7.41c0 2.32 1.89 4.22 4.21 4.22h11.58c2.32 0 4.21-1.9 4.21-4.21V10.5c0-1.21-.81-2.76-1.8-3.45l-6.18-4.33c-1.4-.98-3.65-.93-5 .12Z",
@@ -219,6 +237,7 @@ const ENERGY_ICONS = exports.ENERGY_ICONS = {
219
237
  EnergyIconCarbonFootprint,
220
238
  EnergyIconCart,
221
239
  EnergyIconConsumption,
240
+ EnergyIconConsumptionBoxFilled,
222
241
  EnergyIconHome,
223
242
  EnergyIconMessageEdit,
224
243
  EnergyIconQuestionFilled,
@@ -18,10 +18,11 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
18
18
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
19
19
  const UTProgressBar = _ref => {
20
20
  let {
21
- classes: themeClasses,
22
21
  classNames,
22
+ classes: themeClasses,
23
23
  customLabel,
24
24
  customLabelStyle,
25
+ dataTestId,
25
26
  value,
26
27
  variant,
27
28
  withLabel
@@ -29,7 +30,8 @@ const UTProgressBar = _ref => {
29
30
  const clampedValue = (0, _clamp.default)(value, _constants.MIN_PERCENTAGE, _constants.MAX_PERCENTAGE);
30
31
  const classes = (0, _react.useMemo)(() => (0, _classesUtils.mergeClasses)(themeClasses, classNames), [classNames]);
31
32
  return /*#__PURE__*/_react.default.createElement("div", {
32
- className: classes.container
33
+ className: classes.container,
34
+ "data-testid": dataTestId
33
35
  }, /*#__PURE__*/_react.default.createElement(_core.LinearProgress, {
34
36
  classes: {
35
37
  barColorPrimary: classes.barColorPrimary,
@@ -52,10 +54,11 @@ UTProgressBar.defaultProps = {
52
54
  withLabel: false
53
55
  };
54
56
  UTProgressBar.propTypes = {
55
- classes: _types.classesType,
56
57
  classNames: _types.classesType,
58
+ classes: _types.classesType,
57
59
  customLabel: _propTypes.string,
58
60
  customLabelStyle: _propTypes.object,
61
+ dataTestId: _propTypes.string,
59
62
  value: _propTypes.number.isRequired,
60
63
  variant: _propTypes.string,
61
64
  withLabel: _propTypes.bool
@@ -11,16 +11,17 @@ var _UTLabel = _interopRequireDefault(require("../../../UTLabel"));
11
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
12
  const ToggleOption = _ref => {
13
13
  let {
14
- value,
15
- onChange,
16
- label,
17
- isSelected,
18
- Icon,
19
- SelectedIcon,
20
- keyName,
21
14
  className,
15
+ classes,
16
+ dataTestId,
17
+ Icon,
22
18
  iconClassName,
23
- classes
19
+ isSelected,
20
+ keyName,
21
+ label,
22
+ onChange,
23
+ SelectedIcon,
24
+ value
24
25
  } = _ref;
25
26
  const onHandleClick = () => onChange(value);
26
27
  const IconComponent = Icon && (SelectedIcon && isSelected ? /*#__PURE__*/_react.default.createElement(SelectedIcon, {
@@ -29,24 +30,26 @@ const ToggleOption = _ref => {
29
30
  className: "".concat(classes.icon, " ").concat(isSelected ? classes.selectedIcon : classes.unselectedIcon, " ").concat(iconClassName)
30
31
  }));
31
32
  return /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
32
- onClick: onHandleClick,
33
33
  className: "".concat(classes.option, " ").concat(isSelected && classes.selectedOption, " ").concat(className),
34
- keyName: keyName
34
+ dataTestId: dataTestId,
35
+ keyName: keyName,
36
+ onClick: onHandleClick
35
37
  }, Icon ? IconComponent : /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
36
38
  variant: "small",
37
39
  className: isSelected ? classes.selectedLabel : classes.unSelectedLabel
38
40
  }, label));
39
41
  };
40
42
  ToggleOption.propTypes = {
41
- value: _propTypes.string,
42
- onChange: _propTypes.func,
43
- label: _propTypes.string,
44
- SelectedIcon: _propTypes.elementType,
43
+ className: _propTypes.string,
44
+ classes: (0, _propTypes.objectOf)(_propTypes.string),
45
+ dataTestId: _propTypes.string,
45
46
  Icon: _propTypes.elementType,
47
+ iconClassName: _propTypes.string,
46
48
  isSelected: _propTypes.bool,
47
49
  keyName: _propTypes.string,
48
- className: _propTypes.string,
49
- iconClassName: _propTypes.string,
50
- classes: (0, _propTypes.objectOf)(_propTypes.string)
50
+ label: _propTypes.string,
51
+ onChange: _propTypes.func,
52
+ SelectedIcon: _propTypes.elementType,
53
+ value: _propTypes.string
51
54
  };
52
55
  var _default = exports.default = ToggleOption;
@@ -12,45 +12,48 @@ var _theme = require("./theme");
12
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
13
  const UTToggle = _ref => {
14
14
  let {
15
- options,
16
- selectedOption,
17
- onChangeOption,
18
15
  className,
16
+ classes,
17
+ dataTestId,
18
+ onChangeOption,
19
19
  optionClassName,
20
+ options,
20
21
  orientation,
21
- classes
22
+ selectedOption
22
23
  } = _ref;
23
24
  const containerStyle = "".concat(classes.container, " ").concat(orientation === 'horizontal' ? classes.horizontalContainer : classes.verticalContainer, " ").concat(className, " ");
24
25
  return /*#__PURE__*/_react.default.createElement("div", {
25
26
  className: containerStyle
26
- }, options.map(option => /*#__PURE__*/_react.default.createElement(_ToggleOption.default, {
27
+ }, options.map((option, index) => /*#__PURE__*/_react.default.createElement(_ToggleOption.default, {
28
+ className: optionClassName,
29
+ classes: classes,
30
+ dataTestId: "".concat(dataTestId).concat(index),
31
+ Icon: option.Icon,
32
+ iconClassName: option.iconClassName,
33
+ isSelected: option.value === selectedOption,
27
34
  key: option.key,
28
- value: option.value,
35
+ keyName: "toggle-option-".concat(option.value),
29
36
  label: option.label,
30
- Icon: option.Icon,
31
37
  SelectedIcon: option.SelectedIcon,
32
- isSelected: option.value === selectedOption,
33
38
  onChange: onChangeOption,
34
- keyName: "toggle-option-".concat(option.value),
35
- className: optionClassName,
36
- iconClassName: option.iconClassName,
37
- classes: classes
39
+ value: option.value
38
40
  })));
39
41
  };
40
42
  UTToggle.propTypes = {
43
+ className: _propTypes.string,
44
+ classes: (0, _propTypes.objectOf)(_propTypes.string),
45
+ dataTestId: _propTypes.string,
46
+ onChangeOption: _propTypes.func,
47
+ optionClassName: _propTypes.string,
41
48
  options: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
49
+ className: _propTypes.string,
50
+ Icon: _propTypes.elementType,
42
51
  key: (0, _propTypes.oneOfType)([_propTypes.string, _propTypes.number]),
43
- value: _propTypes.string,
44
52
  label: _propTypes.string,
45
- Icon: _propTypes.elementType,
46
53
  SelectedIcon: _propTypes.elementType,
47
- className: _propTypes.string
54
+ value: _propTypes.string
48
55
  })),
49
- classes: (0, _propTypes.objectOf)(_propTypes.string),
50
- selectedOption: _propTypes.string,
51
- onChangeOption: _propTypes.func,
52
- className: _propTypes.string,
53
- optionClassName: _propTypes.string,
54
- orientation: _propTypes.string
56
+ orientation: _propTypes.string,
57
+ selectedOption: _propTypes.string
55
58
  };
56
59
  var _default = exports.default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTToggle);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/energy-ui",
3
- "version": "3.64.0",
3
+ "version": "3.66.0",
4
4
  "description": "Widergy Web Components",
5
5
  "author": "widergy",
6
6
  "license": "MIT",