@commercetools-uikit/number-field 19.12.1 → 19.13.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.
@@ -70,8 +70,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
70
70
  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)); }
71
71
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
72
72
  const sequentialId = utils.createSequentialId('number-field-');
73
- const sequentialErrorsId = utils.createSequentialId('number-field-error-')();
74
- const sequentialWarningsId = utils.createSequentialId('number-field-warning-')();
75
73
 
76
74
  // Similar shape of `FormikErrors` but values are `TFieldErrors` objects.
77
75
 
@@ -135,6 +133,8 @@ let NumberField = /*#__PURE__*/function (_Component) {
135
133
  }
136
134
  const hasError = this.props.touched && hasErrors(this.props.errors);
137
135
  const hasWarning = this.props.touched && hasWarnings(this.props.warnings);
136
+ const errorsContainerId = `${this.state.id}-errors`;
137
+ const warningsContainerId = `${this.state.id}-warnings`;
138
138
  return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
139
139
  max: this.props.horizontalConstraint,
140
140
  children: jsxRuntime.jsxs(Stack__default["default"], {
@@ -169,16 +169,16 @@ let NumberField = /*#__PURE__*/function (_Component) {
169
169
  }, utils.filterDataAttributes(this.props)), {}, {
170
170
  /* ARIA */
171
171
  "aria-invalid": hasError,
172
- "aria-errormessage": sequentialErrorsId
172
+ "aria-errormessage": errorsContainerId
173
173
  })), jsxRuntime.jsx(FieldErrors__default["default"], {
174
- id: sequentialErrorsId,
174
+ id: errorsContainerId,
175
175
  errors: this.props.errors,
176
176
  isVisible: hasError,
177
177
  renderError: (key, error) =>
178
178
  // Custom errors take precedence over the default errors
179
179
  this.props.renderError?.(key, error) || this.renderError(key)
180
180
  }), jsxRuntime.jsx(FieldWarnings__default["default"], {
181
- id: sequentialWarningsId,
181
+ id: warningsContainerId,
182
182
  warnings: this.props.warnings,
183
183
  isVisible: hasWarning,
184
184
  renderWarning: this.props.renderWarning
@@ -236,7 +236,7 @@ NumberField.propTypes = process.env.NODE_ENV !== "production" ? {
236
236
  var NumberField$1 = NumberField;
237
237
 
238
238
  // NOTE: This string will be replaced on build time with the package version.
239
- var version = "19.12.1";
239
+ var version = "19.13.0";
240
240
 
241
241
  exports["default"] = NumberField$1;
242
242
  exports.version = version;
@@ -69,8 +69,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
69
69
  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)); }
70
70
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
71
71
  const sequentialId = utils.createSequentialId('number-field-');
72
- const sequentialErrorsId = utils.createSequentialId('number-field-error-')();
73
- const sequentialWarningsId = utils.createSequentialId('number-field-warning-')();
74
72
 
75
73
  // Similar shape of `FormikErrors` but values are `TFieldErrors` objects.
76
74
 
@@ -130,6 +128,8 @@ let NumberField = /*#__PURE__*/function (_Component) {
130
128
  if (this.props.hintIcon) ;
131
129
  const hasError = this.props.touched && hasErrors(this.props.errors);
132
130
  const hasWarning = this.props.touched && hasWarnings(this.props.warnings);
131
+ const errorsContainerId = `${this.state.id}-errors`;
132
+ const warningsContainerId = `${this.state.id}-warnings`;
133
133
  return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
134
134
  max: this.props.horizontalConstraint,
135
135
  children: jsxRuntime.jsxs(Stack__default["default"], {
@@ -164,16 +164,16 @@ let NumberField = /*#__PURE__*/function (_Component) {
164
164
  }, utils.filterDataAttributes(this.props)), {}, {
165
165
  /* ARIA */
166
166
  "aria-invalid": hasError,
167
- "aria-errormessage": sequentialErrorsId
167
+ "aria-errormessage": errorsContainerId
168
168
  })), jsxRuntime.jsx(FieldErrors__default["default"], {
169
- id: sequentialErrorsId,
169
+ id: errorsContainerId,
170
170
  errors: this.props.errors,
171
171
  isVisible: hasError,
172
172
  renderError: (key, error) =>
173
173
  // Custom errors take precedence over the default errors
174
174
  this.props.renderError?.(key, error) || this.renderError(key)
175
175
  }), jsxRuntime.jsx(FieldWarnings__default["default"], {
176
- id: sequentialWarningsId,
176
+ id: warningsContainerId,
177
177
  warnings: this.props.warnings,
178
178
  isVisible: hasWarning,
179
179
  renderWarning: this.props.renderWarning
@@ -205,7 +205,7 @@ NumberField.propTypes = {};
205
205
  var NumberField$1 = NumberField;
206
206
 
207
207
  // NOTE: This string will be replaced on build time with the package version.
208
- var version = "19.12.1";
208
+ var version = "19.13.0";
209
209
 
210
210
  exports["default"] = NumberField$1;
211
211
  exports.version = version;
@@ -45,8 +45,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
45
45
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
46
46
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
47
47
  const sequentialId = createSequentialId('number-field-');
48
- const sequentialErrorsId = createSequentialId('number-field-error-')();
49
- const sequentialWarningsId = createSequentialId('number-field-warning-')();
50
48
 
51
49
  // Similar shape of `FormikErrors` but values are `TFieldErrors` objects.
52
50
 
@@ -110,6 +108,8 @@ let NumberField = /*#__PURE__*/function (_Component) {
110
108
  }
111
109
  const hasError = this.props.touched && hasErrors(this.props.errors);
112
110
  const hasWarning = this.props.touched && hasWarnings(this.props.warnings);
111
+ const errorsContainerId = `${this.state.id}-errors`;
112
+ const warningsContainerId = `${this.state.id}-warnings`;
113
113
  return jsx(Constraints.Horizontal, {
114
114
  max: this.props.horizontalConstraint,
115
115
  children: jsxs(Stack, {
@@ -144,16 +144,16 @@ let NumberField = /*#__PURE__*/function (_Component) {
144
144
  }, filterDataAttributes(this.props)), {}, {
145
145
  /* ARIA */
146
146
  "aria-invalid": hasError,
147
- "aria-errormessage": sequentialErrorsId
147
+ "aria-errormessage": errorsContainerId
148
148
  })), jsx(FieldErrors, {
149
- id: sequentialErrorsId,
149
+ id: errorsContainerId,
150
150
  errors: this.props.errors,
151
151
  isVisible: hasError,
152
152
  renderError: (key, error) =>
153
153
  // Custom errors take precedence over the default errors
154
154
  this.props.renderError?.(key, error) || this.renderError(key)
155
155
  }), jsx(FieldWarnings, {
156
- id: sequentialWarningsId,
156
+ id: warningsContainerId,
157
157
  warnings: this.props.warnings,
158
158
  isVisible: hasWarning,
159
159
  renderWarning: this.props.renderWarning
@@ -211,6 +211,6 @@ NumberField.propTypes = process.env.NODE_ENV !== "production" ? {
211
211
  var NumberField$1 = NumberField;
212
212
 
213
213
  // NOTE: This string will be replaced on build time with the package version.
214
- var version = "19.12.1";
214
+ var version = "19.13.0";
215
215
 
216
216
  export { NumberField$1 as default, version };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-uikit/number-field",
3
3
  "description": "A controlled input component for numbers with validation states and a label.",
4
- "version": "19.12.1",
4
+ "version": "19.13.0",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -21,14 +21,14 @@
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/number-input": "19.12.1",
30
- "@commercetools-uikit/spacings-stack": "19.12.1",
31
- "@commercetools-uikit/utils": "19.12.1",
24
+ "@commercetools-uikit/constraints": "19.13.0",
25
+ "@commercetools-uikit/design-system": "19.13.0",
26
+ "@commercetools-uikit/field-errors": "19.13.0",
27
+ "@commercetools-uikit/field-label": "19.13.0",
28
+ "@commercetools-uikit/field-warnings": "19.13.0",
29
+ "@commercetools-uikit/number-input": "19.13.0",
30
+ "@commercetools-uikit/spacings-stack": "19.13.0",
31
+ "@commercetools-uikit/utils": "19.13.0",
32
32
  "@emotion/react": "^11.10.5",
33
33
  "@emotion/styled": "^11.10.5",
34
34
  "prop-types": "15.8.1",