@commercetools-uikit/text-field 19.12.1 → 19.14.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.
@@ -57,8 +57,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
57
57
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
58
58
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
59
59
  const sequentialId = utils.createSequentialId('text-field-');
60
- const sequentialErrorsId = utils.createSequentialId('text-field-error-')();
61
- const sequentialWarningsId = utils.createSequentialId('text-field-warning-')();
62
60
  const hasErrors = errors => {
63
61
  var _context;
64
62
  return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
@@ -96,6 +94,8 @@ let TextField = /*#__PURE__*/function (_Component) {
96
94
  }
97
95
  const hasError = this.props.touched && hasErrors(this.props.errors);
98
96
  const hasWarning = this.props.touched && hasWarnings(this.props.warnings);
97
+ const errorsContainerId = `${this.state.id}-errors`;
98
+ const warningsContainerId = `${this.state.id}-warnings`;
99
99
  return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
100
100
  max: this.props.horizontalConstraint,
101
101
  children: jsxRuntime.jsxs(Stack__default["default"], {
@@ -129,16 +129,16 @@ let TextField = /*#__PURE__*/function (_Component) {
129
129
  }, utils.filterDataAttributes(this.props)), {}, {
130
130
  /* ARIA */
131
131
  "aria-invalid": hasError,
132
- "aria-errormessage": sequentialErrorsId
132
+ "aria-errormessage": errorsContainerId
133
133
  })), this.props.additionalInfo && jsxRuntime.jsx(messages.AdditionalInfoMessage, {
134
134
  message: this.props.additionalInfo
135
135
  }), jsxRuntime.jsx(FieldErrors__default["default"], {
136
- id: sequentialErrorsId,
136
+ id: errorsContainerId,
137
137
  errors: this.props.errors,
138
138
  isVisible: hasError,
139
139
  renderError: this.props.renderError
140
140
  }), jsxRuntime.jsx(FieldWarnings__default["default"], {
141
- id: sequentialWarningsId,
141
+ id: warningsContainerId,
142
142
  warnings: this.props.warnings,
143
143
  isVisible: hasWarning,
144
144
  renderWarning: this.props.renderWarning
@@ -196,7 +196,7 @@ TextField.propTypes = process.env.NODE_ENV !== "production" ? {
196
196
  var TextField$1 = TextField;
197
197
 
198
198
  // NOTE: This string will be replaced on build time with the package version.
199
- var version = "19.12.1";
199
+ var version = "19.14.0";
200
200
 
201
201
  exports["default"] = TextField$1;
202
202
  exports.version = version;
@@ -56,8 +56,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
56
56
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
57
57
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
58
58
  const sequentialId = utils.createSequentialId('text-field-');
59
- const sequentialErrorsId = utils.createSequentialId('text-field-error-')();
60
- const sequentialWarningsId = utils.createSequentialId('text-field-warning-')();
61
59
  const hasErrors = errors => {
62
60
  var _context;
63
61
  return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
@@ -91,6 +89,8 @@ let TextField = /*#__PURE__*/function (_Component) {
91
89
  if (this.props.hintIcon) ;
92
90
  const hasError = this.props.touched && hasErrors(this.props.errors);
93
91
  const hasWarning = this.props.touched && hasWarnings(this.props.warnings);
92
+ const errorsContainerId = `${this.state.id}-errors`;
93
+ const warningsContainerId = `${this.state.id}-warnings`;
94
94
  return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
95
95
  max: this.props.horizontalConstraint,
96
96
  children: jsxRuntime.jsxs(Stack__default["default"], {
@@ -124,16 +124,16 @@ let TextField = /*#__PURE__*/function (_Component) {
124
124
  }, utils.filterDataAttributes(this.props)), {}, {
125
125
  /* ARIA */
126
126
  "aria-invalid": hasError,
127
- "aria-errormessage": sequentialErrorsId
127
+ "aria-errormessage": errorsContainerId
128
128
  })), this.props.additionalInfo && jsxRuntime.jsx(messages.AdditionalInfoMessage, {
129
129
  message: this.props.additionalInfo
130
130
  }), jsxRuntime.jsx(FieldErrors__default["default"], {
131
- id: sequentialErrorsId,
131
+ id: errorsContainerId,
132
132
  errors: this.props.errors,
133
133
  isVisible: hasError,
134
134
  renderError: this.props.renderError
135
135
  }), jsxRuntime.jsx(FieldWarnings__default["default"], {
136
- id: sequentialWarningsId,
136
+ id: warningsContainerId,
137
137
  warnings: this.props.warnings,
138
138
  isVisible: hasWarning,
139
139
  renderWarning: this.props.renderWarning
@@ -165,7 +165,7 @@ TextField.propTypes = {};
165
165
  var TextField$1 = TextField;
166
166
 
167
167
  // NOTE: This string will be replaced on build time with the package version.
168
- var version = "19.12.1";
168
+ var version = "19.14.0";
169
169
 
170
170
  exports["default"] = TextField$1;
171
171
  exports.version = version;
@@ -32,8 +32,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
32
32
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
33
33
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
34
34
  const sequentialId = createSequentialId('text-field-');
35
- const sequentialErrorsId = createSequentialId('text-field-error-')();
36
- const sequentialWarningsId = createSequentialId('text-field-warning-')();
37
35
  const hasErrors = errors => {
38
36
  var _context;
39
37
  return errors && _someInstanceProperty(_context = _Object$values(errors)).call(_context, Boolean);
@@ -71,6 +69,8 @@ let TextField = /*#__PURE__*/function (_Component) {
71
69
  }
72
70
  const hasError = this.props.touched && hasErrors(this.props.errors);
73
71
  const hasWarning = this.props.touched && hasWarnings(this.props.warnings);
72
+ const errorsContainerId = `${this.state.id}-errors`;
73
+ const warningsContainerId = `${this.state.id}-warnings`;
74
74
  return jsx(Constraints.Horizontal, {
75
75
  max: this.props.horizontalConstraint,
76
76
  children: jsxs(Stack, {
@@ -104,16 +104,16 @@ let TextField = /*#__PURE__*/function (_Component) {
104
104
  }, filterDataAttributes(this.props)), {}, {
105
105
  /* ARIA */
106
106
  "aria-invalid": hasError,
107
- "aria-errormessage": sequentialErrorsId
107
+ "aria-errormessage": errorsContainerId
108
108
  })), this.props.additionalInfo && jsx(AdditionalInfoMessage, {
109
109
  message: this.props.additionalInfo
110
110
  }), jsx(FieldErrors, {
111
- id: sequentialErrorsId,
111
+ id: errorsContainerId,
112
112
  errors: this.props.errors,
113
113
  isVisible: hasError,
114
114
  renderError: this.props.renderError
115
115
  }), jsx(FieldWarnings, {
116
- id: sequentialWarningsId,
116
+ id: warningsContainerId,
117
117
  warnings: this.props.warnings,
118
118
  isVisible: hasWarning,
119
119
  renderWarning: this.props.renderWarning
@@ -171,6 +171,6 @@ TextField.propTypes = process.env.NODE_ENV !== "production" ? {
171
171
  var TextField$1 = TextField;
172
172
 
173
173
  // NOTE: This string will be replaced on build time with the package version.
174
- var version = "19.12.1";
174
+ var version = "19.14.0";
175
175
 
176
176
  export { TextField$1 as default, version };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-uikit/text-field",
3
3
  "description": "A controlled text input component for single-line strings with validation states.",
4
- "version": "19.12.1",
4
+ "version": "19.14.0",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -21,15 +21,15 @@
21
21
  "dependencies": {
22
22
  "@babel/runtime": "^7.20.13",
23
23
  "@babel/runtime-corejs3": "^7.20.13",
24
- "@commercetools-uikit/constraints": "19.12.1",
25
- "@commercetools-uikit/design-system": "19.12.1",
26
- "@commercetools-uikit/field-errors": "19.12.1",
27
- "@commercetools-uikit/field-label": "19.12.1",
28
- "@commercetools-uikit/field-warnings": "19.12.1",
29
- "@commercetools-uikit/messages": "19.12.1",
30
- "@commercetools-uikit/spacings-stack": "19.12.1",
31
- "@commercetools-uikit/text-input": "19.12.1",
32
- "@commercetools-uikit/utils": "19.12.1",
24
+ "@commercetools-uikit/constraints": "19.14.0",
25
+ "@commercetools-uikit/design-system": "19.14.0",
26
+ "@commercetools-uikit/field-errors": "19.14.0",
27
+ "@commercetools-uikit/field-label": "19.14.0",
28
+ "@commercetools-uikit/field-warnings": "19.14.0",
29
+ "@commercetools-uikit/messages": "19.14.0",
30
+ "@commercetools-uikit/spacings-stack": "19.14.0",
31
+ "@commercetools-uikit/text-input": "19.14.0",
32
+ "@commercetools-uikit/utils": "19.14.0",
33
33
  "@emotion/react": "^11.10.5",
34
34
  "@emotion/styled": "^11.10.5",
35
35
  "prop-types": "15.8.1",