@widergy/energy-ui 1.133.1 → 1.133.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,17 @@
1
+ ## [1.133.3](https://github.com/widergy/energy-ui/compare/v1.133.2...v1.133.3) (2022-12-12)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * custom classes ([#329](https://github.com/widergy/energy-ui/issues/329)) ([82e44e2](https://github.com/widergy/energy-ui/commit/82e44e2cb2c877467c936efb4fb8c9e8e23dc3ec))
7
+
8
+ ## [1.133.2](https://github.com/widergy/energy-ui/compare/v1.133.1...v1.133.2) (2022-12-07)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * fixes ([#331](https://github.com/widergy/energy-ui/issues/331)) ([df5140d](https://github.com/widergy/energy-ui/commit/df5140d0057df3a7267cf0aca5166f720f32f37b))
14
+
1
15
  ## [1.133.1](https://github.com/widergy/energy-ui/compare/v1.133.0...v1.133.1) (2022-12-01)
2
16
 
3
17
 
@@ -15,16 +15,17 @@ var ConsumptionBarIndicator = function ConsumptionBarIndicator(_ref) {
15
15
  value = _ref.value,
16
16
  _ref$unit = _ref.unit,
17
17
  unit = _ref$unit === void 0 ? 'kWh' : _ref$unit,
18
- total = _ref.total;
18
+ total = _ref.total,
19
+ classes = _ref.classes;
19
20
  return /*#__PURE__*/_react.default.createElement("div", {
20
21
  className: _stylesModule.default.indicator,
21
22
  style: {
22
23
  left: "".concat(left, "%")
23
24
  }
24
25
  }, /*#__PURE__*/_react.default.createElement("div", {
25
- className: _stylesModule.default.indicatorMarker
26
+ className: "".concat(_stylesModule.default.indicatorMarker, " ").concat(classes === null || classes === void 0 ? void 0 : classes.indicatorMarker)
26
27
  }), /*#__PURE__*/_react.default.createElement("div", {
27
- className: _stylesModule.default.indicatorText
28
+ className: "".concat(_stylesModule.default.indicatorText, " ").concat(classes === null || classes === void 0 ? void 0 : classes.indicatorText)
28
29
  }, /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
29
30
  darkBlue: true,
30
31
  bold: true,
@@ -40,7 +41,8 @@ ConsumptionBarIndicator.propTypes = {
40
41
  left: _propTypes.number,
41
42
  value: _propTypes.number,
42
43
  unit: _propTypes.string,
43
- total: _propTypes.number
44
+ total: _propTypes.number,
45
+ classes: _propTypes.object
44
46
  };
45
47
  var _default = ConsumptionBarIndicator;
46
48
  exports.default = _default;
@@ -18,8 +18,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
18
18
  var UTConsumptionBar = function UTConsumptionBar(_ref) {
19
19
  var small = _ref.small,
20
20
  values = _ref.values,
21
- className = _ref.className,
22
- categoryLines = _ref.categoryLines;
21
+ categoryLines = _ref.categoryLines,
22
+ classes = _ref.classes;
23
23
  var downIndicators = values.filter(function (value) {
24
24
  return value.position === _constants.DOWN;
25
25
  });
@@ -70,13 +70,13 @@ var UTConsumptionBar = function UTConsumptionBar(_ref) {
70
70
  blue: true,
71
71
  xsmall: true,
72
72
  bold: true,
73
- className: _stylesModule.default.categoryLineText
73
+ className: "".concat(_stylesModule.default.categoryLineText, " ").concat(classes === null || classes === void 0 ? void 0 : classes.categoryLineText)
74
74
  }, "R", categoryLine.category))));
75
75
  };
76
76
  return /*#__PURE__*/_react.default.createElement("div", {
77
77
  className: _stylesModule.default.estimatedContainer
78
78
  }, /*#__PURE__*/_react.default.createElement("div", {
79
- className: "".concat(_stylesModule.default.container, " ").concat(className)
79
+ className: "".concat(_stylesModule.default.container, " ").concat(classes === null || classes === void 0 ? void 0 : classes.container)
80
80
  }, /*#__PURE__*/_react.default.createElement("div", {
81
81
  className: "".concat(_stylesModule.default.bar, " ").concat(downIndicators.length > 0 && _stylesModule.default.colorizedBar)
82
82
  }), categoryLines.map(renderCategoryLines), downIndicators.map(function (indicator) {
@@ -86,16 +86,17 @@ var UTConsumptionBar = function UTConsumptionBar(_ref) {
86
86
  value: indicator.value,
87
87
  unit: indicator.title,
88
88
  className: _stylesModule.default.indicator,
89
- total: indicator.total
89
+ total: indicator.total,
90
+ classes: classes
90
91
  });
91
92
  })), /*#__PURE__*/_react.default.createElement("div", {
92
93
  className: "".concat(_stylesModule.default.finishLine1, " ").concat(downIndicators.length > 0 && _stylesModule.default.colorizedLine)
93
94
  }));
94
95
  };
95
96
  UTConsumptionBar.propTypes = {
96
- small: _propTypes.bool,
97
- className: _propTypes.string,
98
97
  categoryLines: (0, _propTypes.arrayOf)(_propTypes.object),
98
+ classes: _propTypes.object,
99
+ small: _propTypes.bool,
99
100
  values: (0, _propTypes.arrayOf)(_propTypes.object)
100
101
  };
101
102
  var _default = UTConsumptionBar;
@@ -73,7 +73,8 @@
73
73
  .categoryLineText {
74
74
  cursor: default;
75
75
  @media #{$mobile} {
76
- display: none;
76
+ font-size: $small;
77
+ font-weight: 400;
77
78
  }
78
79
  }
79
80
 
@@ -17,10 +17,11 @@ var _form = require("@widergy/web-utils/lib/form");
17
17
  var _WithTheme = _interopRequireDefault(require("../WithTheme"));
18
18
  var _UTTooltip = _interopRequireDefault(require("../UTTooltip"));
19
19
  var _formTypes = require("../../types/formTypes");
20
+ var _UTLabel = _interopRequireDefault(require("../UTLabel"));
20
21
  var _constants = require("./constants");
21
22
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
22
23
  var _theme = require("./theme");
23
- var _excluded = ["classes", "input", "placeholder", "label", "meta", "disabled", "type", "bigInput", "inputClassName", "labelRootClassName", "containerClassName", "tooltip", "preventEnterSubmit", "id", "autofocus", "onChangeText", "field", "tippyProps", "variant", "PasswordVisibleIcon", "PasswordInvisibleIcon", "adornmentInside", "captionLabel", "inputObjectKey"],
24
+ var _excluded = ["adornmentInside", "autofocus", "bigInput", "captionLabel", "classes", "containerClassName", "disabled", "field", "id", "input", "inputClassName", "inputObjectKey", "label", "labelRootClassName", "meta", "onChangeText", "PasswordInvisibleIcon", "PasswordVisibleIcon", "placeholder", "preventEnterSubmit", "tippyProps", "tooltip", "type", "variant"],
24
25
  _excluded2 = ["base", "selectedOptionsIds", "retrieveStyle", "retrieveMuiTheme", "Component", "muiTheme"];
25
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26
27
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -70,30 +71,30 @@ var UTTextInput = /*#__PURE__*/function (_PureComponent) {
70
71
  key: "render",
71
72
  value: function render() {
72
73
  var _this$props = this.props,
74
+ adornmentInside = _this$props.adornmentInside,
75
+ autofocus = _this$props.autofocus,
76
+ bigInput = _this$props.bigInput,
77
+ captionLabel = _this$props.captionLabel,
73
78
  classes = _this$props.classes,
74
- input = _this$props.input,
75
- placeholder = _this$props.placeholder,
76
- label = _this$props.label,
77
- meta = _this$props.meta,
79
+ containerClassName = _this$props.containerClassName,
78
80
  disabled = _this$props.disabled,
79
- type = _this$props.type,
80
- bigInput = _this$props.bigInput,
81
+ field = _this$props.field,
82
+ id = _this$props.id,
83
+ input = _this$props.input,
81
84
  inputClassName = _this$props.inputClassName,
85
+ inputObjectKey = _this$props.inputObjectKey,
86
+ label = _this$props.label,
82
87
  labelRootClassName = _this$props.labelRootClassName,
83
- containerClassName = _this$props.containerClassName,
84
- tooltip = _this$props.tooltip,
85
- preventEnterSubmit = _this$props.preventEnterSubmit,
86
- id = _this$props.id,
87
- autofocus = _this$props.autofocus,
88
+ meta = _this$props.meta,
88
89
  onChangeText = _this$props.onChangeText,
89
- field = _this$props.field,
90
+ PasswordInvisibleIcon = _this$props.PasswordInvisibleIcon,
91
+ PasswordVisibleIcon = _this$props.PasswordVisibleIcon,
92
+ placeholder = _this$props.placeholder,
93
+ preventEnterSubmit = _this$props.preventEnterSubmit,
90
94
  tippyProps = _this$props.tippyProps,
95
+ tooltip = _this$props.tooltip,
96
+ type = _this$props.type,
91
97
  variant = _this$props.variant,
92
- PasswordVisibleIcon = _this$props.PasswordVisibleIcon,
93
- PasswordInvisibleIcon = _this$props.PasswordInvisibleIcon,
94
- adornmentInside = _this$props.adornmentInside,
95
- captionLabel = _this$props.captionLabel,
96
- inputObjectKey = _this$props.inputObjectKey,
97
98
  others = _objectWithoutProperties(_this$props, _excluded);
98
99
  var handleChange = function handleChange(event) {
99
100
  return input.onChange(onChangeText(event.target.value));
@@ -129,7 +130,9 @@ var UTTextInput = /*#__PURE__*/function (_PureComponent) {
129
130
  }), /*#__PURE__*/_react.default.createElement("div", null, label)) : label,
130
131
  onKeyPress: preventEnterSubmit ? preventDefault : undefined,
131
132
  error: (0, _form.shouldShowErrors)(meta),
132
- helperText: (0, _form.shouldShowErrors)(meta) && meta.error || captionLabel || '',
133
+ helperText: /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
134
+ className: _stylesModule.default.error
135
+ }, (0, _form.shouldShowErrors)(meta) && meta.error || captionLabel || ''),
133
136
  disabled: disabled,
134
137
  onChange: handleChange,
135
138
  value: value,
@@ -170,42 +173,42 @@ var UTTextInput = /*#__PURE__*/function (_PureComponent) {
170
173
  return UTTextInput;
171
174
  }(_react.PureComponent);
172
175
  UTTextInput.propTypes = {
173
- type: _propTypes.string,
174
- placeholder: _propTypes.string,
175
- containerClassName: _propTypes.string,
176
- input: _formTypes.inputPropTypes.isRequired,
177
- meta: _formTypes.metaPropTypes,
178
- disabled: _propTypes.bool,
179
- tooltip: _propTypes.string,
176
+ adornmentInside: _propTypes.bool,
177
+ autofocus: _propTypes.bool,
180
178
  bigInput: _propTypes.bool,
181
- labelRootClassName: _propTypes.string,
182
- inputClassName: _propTypes.string,
183
- label: _propTypes.string,
179
+ captionLabel: _propTypes.string,
184
180
  classes: (0, _propTypes.objectOf)(_propTypes.string),
181
+ containerClassName: _propTypes.string,
182
+ disabled: _propTypes.bool,
185
183
  field: _propTypes.object,
186
- preventEnterSubmit: _propTypes.bool,
187
184
  id: _propTypes.string,
188
- autofocus: _propTypes.bool,
185
+ input: _formTypes.inputPropTypes.isRequired,
186
+ inputClassName: _propTypes.string,
187
+ inputObjectKey: _propTypes.string,
188
+ label: _propTypes.string,
189
+ labelRootClassName: _propTypes.string,
190
+ meta: _formTypes.metaPropTypes,
189
191
  onChangeText: _propTypes.func,
190
- tippyProps: _propTypes.object,
191
- variant: _propTypes.string,
192
- PasswordVisibleIcon: _propTypes.elementType,
193
192
  PasswordInvisibleIcon: _propTypes.elementType,
194
- adornmentInside: _propTypes.bool,
195
- captionLabel: _propTypes.string,
196
- inputObjectKey: _propTypes.string
193
+ PasswordVisibleIcon: _propTypes.elementType,
194
+ placeholder: _propTypes.string,
195
+ preventEnterSubmit: _propTypes.bool,
196
+ tippyProps: _propTypes.object,
197
+ tooltip: _propTypes.string,
198
+ type: _propTypes.string,
199
+ variant: _propTypes.string
197
200
  };
198
201
  UTTextInput.defaultProps = {
202
+ adornmentInside: false,
203
+ autofocus: false,
199
204
  classes: {},
200
205
  meta: {},
201
- preventEnterSubmit: false,
202
- autofocus: false,
203
206
  onChangeText: function onChangeText(val) {
204
207
  return val;
205
208
  },
206
- PasswordVisibleIcon: _Visibility.default,
207
209
  PasswordInvisibleIcon: _VisibilityOff.default,
208
- adornmentInside: false
210
+ PasswordVisibleIcon: _Visibility.default,
211
+ preventEnterSubmit: false
209
212
  };
210
213
  var _default = (0, _WithTheme.default)(_theme.retrieveStyle, _theme.retrieveMuiTheme)(UTTextInput);
211
214
  exports.default = _default;
@@ -35,3 +35,7 @@
35
35
  .tooltipIcon {
36
36
  margin-bottom: -4px;
37
37
  }
38
+
39
+ .error {
40
+ color: inherit;
41
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/energy-ui",
3
- "version": "1.133.1",
3
+ "version": "1.133.3",
4
4
  "description": "Widergy Web Components",
5
5
  "author": "widergy",
6
6
  "license": "MIT",