@widergy/energy-ui 3.26.0 → 3.28.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.28.0](https://github.com/widergy/energy-ui/compare/v3.27.0...v3.28.0) (2024-10-10)
2
+
3
+
4
+ ### Features
5
+
6
+ * [AUT-406] breadcrumbs ids ([#505](https://github.com/widergy/energy-ui/issues/505)) ([ceb97d1](https://github.com/widergy/energy-ui/commit/ceb97d16967e310c2efb0d52fad317755e47086c))
7
+
8
+ # [3.27.0](https://github.com/widergy/energy-ui/compare/v3.26.0...v3.27.0) (2024-10-09)
9
+
10
+
11
+ ### Features
12
+
13
+ * change password ids ([#506](https://github.com/widergy/energy-ui/issues/506)) ([8110486](https://github.com/widergy/energy-ui/commit/8110486088ba2fc5a5858d1766da5b33a54caab5))
14
+
1
15
  # [3.26.0](https://github.com/widergy/energy-ui/compare/v3.25.0...v3.26.0) (2024-10-08)
2
16
 
3
17
 
@@ -113,6 +113,7 @@ const UTBreadcrumbs = _ref => {
113
113
  }, content.map((_ref3, index) => {
114
114
  let {
115
115
  buttonColorTheme,
116
+ dataTestId,
116
117
  itemClassName,
117
118
  label,
118
119
  menuItems,
@@ -149,6 +150,7 @@ const UTBreadcrumbs = _ref => {
149
150
  key: "".concat(route, "-").concat(label)
150
151
  }, !route && !menuItems || disableMenu ? /*#__PURE__*/_react.default.createElement(_UTLabel.default, _extends({
151
152
  className: _stylesModule.default.label,
153
+ dataTestId: dataTestId,
152
154
  variant: "small",
153
155
  weight: "medium"
154
156
  }, colorThemesDefinition.label), label) : /*#__PURE__*/_react.default.createElement(_UTButton.default, _extends({
@@ -157,11 +159,13 @@ const UTBreadcrumbs = _ref => {
157
159
  childrenContainer: overflowControl ? _stylesModule.default.buttonContainer : null,
158
160
  text: overflowControl ? _stylesModule.default.ellipsis : null
159
161
  },
162
+ dataTestId: dataTestId,
160
163
  onClick: handleClick,
161
164
  size: "small",
162
165
  variant: "text"
163
166
  }, colorThemesDefinition.button), "".concat(label)), !isLast && /*#__PURE__*/_react.default.createElement(_UTLabel.default, _extends({
164
167
  className: classes.separator,
168
+ dataTestId: dataTestId,
165
169
  variant: "small",
166
170
  weight: "medium"
167
171
  }, colorThemesDefinition.label), separator));
@@ -18,6 +18,7 @@ const UTCBUInput = _ref => {
18
18
  classes,
19
19
  dataTestId,
20
20
  field,
21
+ helperTextDataTestId,
21
22
  input,
22
23
  meta
23
24
  } = _ref;
@@ -54,6 +55,7 @@ const UTCBUInput = _ref => {
54
55
  root: classes.helper
55
56
  }
56
57
  },
58
+ helperTextDataTestId: helperTextDataTestId,
57
59
  input: {
58
60
  onChange: onChangeText,
59
61
  value: {
@@ -79,6 +81,7 @@ UTCBUInput.propTypes = {
79
81
  cbu_number_key: _propTypes.string,
80
82
  cbu_entity_key: _propTypes.string
81
83
  }),
84
+ helperTextDataTestId: _propTypes.string,
82
85
  input: (0, _propTypes.shape)({
83
86
  onChange: _propTypes.func,
84
87
  value: (0, _propTypes.shape)({
@@ -27,6 +27,7 @@ const UTGoogleAutocomplete = _ref => {
27
27
  classes,
28
28
  dataTestId,
29
29
  detailErrorLabel = 'Hubo un error al intentar recuperar el detalle de la dirección seleccionada',
30
+ helperTextDataTestId,
30
31
  inputProps,
31
32
  minChar = 3,
32
33
  noResultsLabel = 'No se encuentran resultados. Ingresa una dirección valida.',
@@ -92,6 +93,7 @@ const UTGoogleAutocomplete = _ref => {
92
93
  content: alert
93
94
  }), /*#__PURE__*/_react.default.createElement(_UTTextInput.default, _extends({
94
95
  dataTestId: dataTestId,
96
+ helperTextDataTestId: helperTextDataTestId,
95
97
  input: {
96
98
  value: searchInputValue,
97
99
  onChange: handleInputChange
@@ -13,8 +13,9 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
13
13
  const ErrorMessage = _ref => {
14
14
  let {
15
15
  assertion,
16
- ErrorIcon,
17
16
  classes,
17
+ dataTestId,
18
+ ErrorIcon,
18
19
  error
19
20
  } = _ref;
20
21
  const {
@@ -23,7 +24,8 @@ const ErrorMessage = _ref => {
23
24
  } = classes;
24
25
  const Icon = ErrorIcon || _Info.default;
25
26
  return !assertion && /*#__PURE__*/_react.default.createElement("div", {
26
- className: _stylesModule.default.container
27
+ className: _stylesModule.default.container,
28
+ "data-testid": dataTestId
27
29
  }, /*#__PURE__*/_react.default.createElement(Icon, {
28
30
  className: "".concat(iconStyle, " ").concat(failedIconStyle)
29
31
  }), /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
@@ -35,8 +37,9 @@ const ErrorMessage = _ref => {
35
37
  };
36
38
  ErrorMessage.propTypes = {
37
39
  assertion: _propTypes.bool,
38
- ErrorIcon: _propTypes.elementType,
39
40
  classes: (0, _propTypes.objectOf)(_propTypes.string),
41
+ dataTestId: _propTypes.string,
42
+ ErrorIcon: _propTypes.elementType,
40
43
  error: _propTypes.string
41
44
  };
42
45
  var _default = exports.default = ErrorMessage;
@@ -16,6 +16,7 @@ const Validation = _ref => {
16
16
  let {
17
17
  assertion,
18
18
  classes,
19
+ dataTestId,
19
20
  disabled,
20
21
  NoValueIcon,
21
22
  requirement,
@@ -34,7 +35,8 @@ const Validation = _ref => {
34
35
  const NoValue = NoValueIcon || _FiberManualRecord.default;
35
36
  const labelColor = !value && !shouldShowError ? 'gray' : assertion ? 'success' : 'error';
36
37
  return /*#__PURE__*/_react.default.createElement("div", {
37
- className: _stylesModule.default.container
38
+ className: _stylesModule.default.container,
39
+ "data-testid": dataTestId
38
40
  }, value || shouldShowError && !disabled ? assertion ? /*#__PURE__*/_react.default.createElement(PassedIcon, {
39
41
  className: "".concat(_stylesModule.default.passedIcon, " ").concat(iconStyle, " ").concat(passedIconStyle)
40
42
  }) : /*#__PURE__*/_react.default.createElement(FailedIcon, {
@@ -51,6 +53,7 @@ const Validation = _ref => {
51
53
  Validation.propTypes = {
52
54
  assertion: _propTypes.bool,
53
55
  classes: (0, _propTypes.objectOf)(_propTypes.string),
56
+ dataTestId: _propTypes.string,
54
57
  disabled: _propTypes.bool,
55
58
  NoValueIcon: _propTypes.elementType,
56
59
  requirement: _propTypes.string,
@@ -23,7 +23,9 @@ const PasswordValidations = _ref => {
23
23
  NoValueIcon,
24
24
  meta,
25
25
  disabled,
26
- passwordValidationsWarning
26
+ passwordValidationsWarning,
27
+ errorDataTestId,
28
+ validationDataTestId
27
29
  } = _ref;
28
30
  const validatedRegExps = passwordValidations.map(_ref2 => {
29
31
  let {
@@ -74,7 +76,7 @@ const PasswordValidations = _ref => {
74
76
  return error === warningError;
75
77
  }));
76
78
  });
77
- return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, validations.map(_ref8 => {
79
+ return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, validations.map((_ref8, index) => {
78
80
  let {
79
81
  requirement,
80
82
  assertion
@@ -89,16 +91,18 @@ const PasswordValidations = _ref => {
89
91
  shouldShowError: submitFailed,
90
92
  ValidationFailedIcon: ValidationFailedIcon,
91
93
  ValidationPassedIcon: ValidationPassedIcon,
92
- value: value
94
+ value: value,
95
+ dataTestId: "".concat(validationDataTestId, ".").concat(index)
93
96
  });
94
97
  }), submitFailed && showErrors && /*#__PURE__*/_react.default.createElement("div", {
95
98
  className: errorsContainerStyle
96
- }, errors.map(_ref9 => {
99
+ }, errors.map((_ref9, index) => {
97
100
  let {
98
101
  error,
99
102
  assertion
100
103
  } = _ref9;
101
104
  return /*#__PURE__*/_react.default.createElement(_Error.default, {
105
+ dataTestId: "".concat(errorDataTestId, ".").concat(index),
102
106
  ErrorIcon: ErrorIcon,
103
107
  classes: classes,
104
108
  assertion: assertion,
@@ -125,6 +129,8 @@ PasswordValidations.propTypes = {
125
129
  ErrorIcon: _propTypes.elementType,
126
130
  NoValueIcon: _propTypes.elementType,
127
131
  meta: _formTypes.metaPropTypes,
128
- disabled: _propTypes.bool
132
+ disabled: _propTypes.bool,
133
+ errorDataTestId: _propTypes.string,
134
+ validationDataTestId: _propTypes.string
129
135
  };
130
136
  var _default = exports.default = PasswordValidations;
@@ -13,6 +13,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
13
13
  const PasswordWarning = _ref => {
14
14
  let {
15
15
  classes,
16
+ dataTestId,
16
17
  passwordValidationsWarning,
17
18
  value,
18
19
  WarningIcon
@@ -30,13 +31,14 @@ const PasswordWarning = _ref => {
30
31
  ...regex
31
32
  };
32
33
  });
33
- return validatedRegExps.map(_ref3 => {
34
+ return validatedRegExps.map((_ref3, index) => {
34
35
  let {
35
36
  error,
36
37
  assertion
37
38
  } = _ref3;
38
39
  return /*#__PURE__*/_react.default.createElement("div", {
39
- className: assertion ? _stylesModule.default.hide : _stylesModule.default.warningContainer
40
+ className: assertion ? _stylesModule.default.hide : _stylesModule.default.warningContainer,
41
+ "data-testid": "".concat(dataTestId, ".").concat(index)
40
42
  }, /*#__PURE__*/_react.default.createElement(_Divider.default, {
41
43
  className: warningDivider
42
44
  }), /*#__PURE__*/_react.default.createElement("div", {
@@ -16,16 +16,20 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
16
16
  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); }
17
17
  const UTPasswordField = _ref => {
18
18
  let {
19
- field,
20
- input,
21
19
  classes = {},
22
20
  dataTestId,
23
- ValidationPassedIcon,
24
- ValidationFailedIcon,
25
- NoValueIcon,
21
+ disabled,
22
+ errorDataTestId,
26
23
  ErrorIcon,
24
+ field,
25
+ helperTextDataTestId,
26
+ input,
27
27
  meta,
28
- disabled,
28
+ NoValueIcon,
29
+ validationDataTestId,
30
+ ValidationFailedIcon,
31
+ ValidationPassedIcon,
32
+ warningDataTestId,
29
33
  WarningIcon,
30
34
  ...otherProps
31
35
  } = _ref;
@@ -42,48 +46,55 @@ const UTPasswordField = _ref => {
42
46
  } = classes;
43
47
  return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_UTTextInput.default, _extends({
44
48
  dataTestId: dataTestId,
49
+ disabled: disabled,
45
50
  field: field,
51
+ helperTextDataTestId: helperTextDataTestId,
46
52
  input: input,
47
53
  meta: !showValidations ? meta : undefined,
48
- disabled: disabled
49
- }, otherProps, {
50
54
  type: "password"
51
- })), showValidations && passwordValidations && /*#__PURE__*/_react.default.createElement("div", {
55
+ }, otherProps)), showValidations && passwordValidations && /*#__PURE__*/_react.default.createElement("div", {
52
56
  className: validationContainer
53
57
  }, /*#__PURE__*/_react.default.createElement(_PasswordValidations.default, {
58
+ classes: classes,
54
59
  disabled: disabled,
60
+ errorDataTestId: errorDataTestId,
55
61
  ErrorIcon: ErrorIcon,
56
- ValidationFailedIcon: ValidationFailedIcon,
57
- ValidationPassedIcon: ValidationPassedIcon,
58
- NoValueIcon: NoValueIcon,
59
- value: value,
60
- classes: classes,
61
62
  meta: meta,
63
+ NoValueIcon: NoValueIcon,
62
64
  passwordValidations: passwordValidations,
63
- passwordValidationsWarning: passwordValidationsWarning
65
+ passwordValidationsWarning: passwordValidationsWarning,
66
+ validationDataTestId: validationDataTestId,
67
+ ValidationFailedIcon: ValidationFailedIcon,
68
+ ValidationPassedIcon: ValidationPassedIcon,
69
+ value: value
64
70
  })), showValidations && passwordValidationsWarning && /*#__PURE__*/_react.default.createElement(_PasswordWarning.default, {
65
71
  classes: classes,
72
+ dataTestId: warningDataTestId,
66
73
  passwordValidationsWarning: passwordValidationsWarning,
67
74
  value: value,
68
75
  WarningIcon: WarningIcon
69
76
  }));
70
77
  };
71
78
  UTPasswordField.propTypes = {
72
- field: _formTypes.fieldType,
73
- input: _formTypes.inputPropTypes,
74
79
  classes: (0, _propTypes.objectOf)(_propTypes.string),
75
80
  dataTestId: _propTypes.string,
76
- variant: _propTypes.string,
77
- ValidationPassedIcon: _propTypes.elementType,
78
- ValidationFailedIcon: _propTypes.elementType,
79
- NoValueIcon: _propTypes.elementType,
80
- PasswordVisibleIcon: _propTypes.elementType,
81
- PasswordInvisibleIcon: _propTypes.elementType,
81
+ disabled: _propTypes.bool,
82
+ errorDataTestId: _propTypes.string,
82
83
  ErrorIcon: _propTypes.elementType,
83
- placeholder: _propTypes.string,
84
+ field: _formTypes.fieldType,
85
+ helperTextDataTestId: _propTypes.string,
86
+ input: _formTypes.inputPropTypes,
84
87
  label: _propTypes.string,
85
88
  meta: _formTypes.metaPropTypes,
86
- disabled: _propTypes.bool,
89
+ NoValueIcon: _propTypes.elementType,
90
+ PasswordInvisibleIcon: _propTypes.elementType,
91
+ PasswordVisibleIcon: _propTypes.elementType,
92
+ placeholder: _propTypes.string,
93
+ validationDataTestId: _propTypes.string,
94
+ ValidationFailedIcon: _propTypes.elementType,
95
+ ValidationPassedIcon: _propTypes.elementType,
96
+ variant: _propTypes.string,
97
+ warningDataTestId: _propTypes.string,
87
98
  WarningIcon: _propTypes.elementType
88
99
  };
89
100
  var _default = exports.default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTPasswordField);
@@ -55,6 +55,7 @@ class UTTextInput extends _react.PureComponent {
55
55
  dataTestId,
56
56
  disabled,
57
57
  field,
58
+ helperTextDataTestId,
58
59
  id,
59
60
  input,
60
61
  inputClassName,
@@ -129,6 +130,7 @@ class UTTextInput extends _react.PureComponent {
129
130
  helperText: errorMessage || helperText ? /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
130
131
  className: _stylesModule.default.helperText,
131
132
  colorTheme: errorMessage ? 'error' : 'gray',
133
+ dataTestId: helperTextDataTestId,
132
134
  variant: "small",
133
135
  withMarkdown: true
134
136
  }, errorMessage || helperText) : undefined,
@@ -185,6 +187,7 @@ UTTextInput.propTypes = {
185
187
  dataTestId: _propTypes.string,
186
188
  disabled: _propTypes.bool,
187
189
  field: _propTypes.object,
190
+ helperTextDataTestId: _propTypes.string,
188
191
  id: _propTypes.string,
189
192
  input: _formTypes.inputPropTypes.isRequired,
190
193
  inputClassName: _propTypes.string,
@@ -24,6 +24,7 @@ const UTTextInput = _ref => {
24
24
  dataTestId,
25
25
  disabled,
26
26
  error,
27
+ helperTextDataTestId,
27
28
  helpText,
28
29
  id,
29
30
  inputSize,
@@ -81,6 +82,7 @@ const UTTextInput = _ref => {
81
82
  value: value
82
83
  }), helpText && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
83
84
  colorTheme: "gray",
85
+ dataTestId: helperTextDataTestId,
84
86
  variant: "small"
85
87
  }, helpText), validationData && /*#__PURE__*/_react.default.createElement(_UTValidation.default, {
86
88
  validationData: validationData
@@ -93,6 +95,7 @@ const propTypes = exports.propTypes = {
93
95
  dataTestId: _propTypes.string,
94
96
  disabled: _propTypes.bool,
95
97
  error: _propTypes.bool,
98
+ helperTextDataTestId: _propTypes.string,
96
99
  helpText: _propTypes.string,
97
100
  id: _propTypes.string,
98
101
  inputSize: _propTypes.string,
@@ -43,6 +43,7 @@ const UTGoogleAutocompletePropTypes = exports.UTGoogleAutocompletePropTypes = {
43
43
  classes: (0, _propTypes.objectOf)(_propTypes.string),
44
44
  dataTestId: _propTypes.string,
45
45
  detailErrorLabel: _propTypes.string,
46
+ helperTextDataTestId: _propTypes.string,
46
47
  inputProps: _propTypes.object,
47
48
  minChar: _propTypes.number,
48
49
  noResultsLabel: _propTypes.string,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/energy-ui",
3
- "version": "3.26.0",
3
+ "version": "3.28.0",
4
4
  "description": "Widergy Web Components",
5
5
  "author": "widergy",
6
6
  "license": "MIT",