@commercetools-uikit/number-field 13.0.0 → 13.0.4

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.
@@ -59,6 +59,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
59
59
 
60
60
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
61
61
  var sequentialId = utils.createSequentialId('number-field-');
62
+ var sequentialErrorsId = utils.createSequentialId('number-field-error-')();
62
63
 
63
64
  var hasErrors = function hasErrors(errors) {
64
65
  var _context;
@@ -99,7 +100,7 @@ var NumberField = /*#__PURE__*/function (_Component) {
99
100
  }
100
101
 
101
102
  if (this.props.hintIcon) {
102
- process.env.NODE_ENV !== "production" ? utils.warning(typeof this.props.hint === 'string' || /*#__PURE__*/react.isValidElement(typeof this.props.hint), 'NumberField: `hint` is required to be string or ReactNode if hintIcon is present') : void 0;
103
+ process.env.NODE_ENV !== "production" ? utils.warning(typeof this.props.hint === 'string' || /*#__PURE__*/react.isValidElement(this.props.hint), 'NumberField: `hint` is required to be string or ReactNode if hintIcon is present') : void 0;
103
104
  }
104
105
 
105
106
  var hasError = this.props.touched && hasErrors(this.props.errors);
@@ -116,7 +117,7 @@ var NumberField = /*#__PURE__*/function (_Component) {
116
117
  badge: this.props.badge,
117
118
  hasRequiredIndicator: this.props.isRequired,
118
119
  htmlFor: this.state.id
119
- }), jsxRuntime.jsx(NumberInput__default["default"], _objectSpread({
120
+ }), jsxRuntime.jsx(NumberInput__default["default"], _objectSpread(_objectSpread({
120
121
  id: this.state.id,
121
122
  name: this.props.name,
122
123
  autoComplete: this.props.autoComplete,
@@ -133,7 +134,12 @@ var NumberField = /*#__PURE__*/function (_Component) {
133
134
  min: this.props.min,
134
135
  max: this.props.max,
135
136
  step: this.props.step
136
- }, utils.filterDataAttributes(this.props))), jsxRuntime.jsx(FieldErrors__default["default"], {
137
+ }, utils.filterDataAttributes(this.props)), {}, {
138
+ /* ARIA */
139
+ "aria-invalid": hasError,
140
+ "aria-errormessage": sequentialErrorsId
141
+ })), jsxRuntime.jsx(FieldErrors__default["default"], {
142
+ id: sequentialErrorsId,
137
143
  errors: this.props.errors,
138
144
  isVisible: hasError,
139
145
  renderError: this.props.renderError
@@ -187,7 +193,7 @@ NumberField.propTypes = process.env.NODE_ENV !== "production" ? {
187
193
  var NumberField$1 = NumberField;
188
194
 
189
195
  // NOTE: This string will be replaced on build time with the package version.
190
- var version = "13.0.0";
196
+ var version = "13.0.4";
191
197
 
192
198
  exports["default"] = NumberField$1;
193
199
  exports.version = version;
@@ -58,6 +58,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
58
58
 
59
59
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
60
60
  var sequentialId = utils.createSequentialId('number-field-');
61
+ var sequentialErrorsId = utils.createSequentialId('number-field-error-')();
61
62
 
62
63
  var hasErrors = function hasErrors(errors) {
63
64
  var _context;
@@ -111,7 +112,7 @@ var NumberField = /*#__PURE__*/function (_Component) {
111
112
  badge: this.props.badge,
112
113
  hasRequiredIndicator: this.props.isRequired,
113
114
  htmlFor: this.state.id
114
- }), jsxRuntime.jsx(NumberInput__default["default"], _objectSpread({
115
+ }), jsxRuntime.jsx(NumberInput__default["default"], _objectSpread(_objectSpread({
115
116
  id: this.state.id,
116
117
  name: this.props.name,
117
118
  autoComplete: this.props.autoComplete,
@@ -128,7 +129,12 @@ var NumberField = /*#__PURE__*/function (_Component) {
128
129
  min: this.props.min,
129
130
  max: this.props.max,
130
131
  step: this.props.step
131
- }, utils.filterDataAttributes(this.props))), jsxRuntime.jsx(FieldErrors__default["default"], {
132
+ }, utils.filterDataAttributes(this.props)), {}, {
133
+ /* ARIA */
134
+ "aria-invalid": hasError,
135
+ "aria-errormessage": sequentialErrorsId
136
+ })), jsxRuntime.jsx(FieldErrors__default["default"], {
137
+ id: sequentialErrorsId,
132
138
  errors: this.props.errors,
133
139
  isVisible: hasError,
134
140
  renderError: this.props.renderError
@@ -156,7 +162,7 @@ NumberField.propTypes = {};
156
162
  var NumberField$1 = NumberField;
157
163
 
158
164
  // NOTE: This string will be replaced on build time with the package version.
159
- var version = "13.0.0";
165
+ var version = "13.0.4";
160
166
 
161
167
  exports["default"] = NumberField$1;
162
168
  exports.version = version;
@@ -34,6 +34,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
34
34
 
35
35
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
36
36
  var sequentialId = createSequentialId('number-field-');
37
+ var sequentialErrorsId = createSequentialId('number-field-error-')();
37
38
 
38
39
  var hasErrors = function hasErrors(errors) {
39
40
  var _context;
@@ -74,7 +75,7 @@ var NumberField = /*#__PURE__*/function (_Component) {
74
75
  }
75
76
 
76
77
  if (this.props.hintIcon) {
77
- process.env.NODE_ENV !== "production" ? warning(typeof this.props.hint === 'string' || /*#__PURE__*/isValidElement(typeof this.props.hint), 'NumberField: `hint` is required to be string or ReactNode if hintIcon is present') : void 0;
78
+ process.env.NODE_ENV !== "production" ? warning(typeof this.props.hint === 'string' || /*#__PURE__*/isValidElement(this.props.hint), 'NumberField: `hint` is required to be string or ReactNode if hintIcon is present') : void 0;
78
79
  }
79
80
 
80
81
  var hasError = this.props.touched && hasErrors(this.props.errors);
@@ -91,7 +92,7 @@ var NumberField = /*#__PURE__*/function (_Component) {
91
92
  badge: this.props.badge,
92
93
  hasRequiredIndicator: this.props.isRequired,
93
94
  htmlFor: this.state.id
94
- }), jsx(NumberInput, _objectSpread({
95
+ }), jsx(NumberInput, _objectSpread(_objectSpread({
95
96
  id: this.state.id,
96
97
  name: this.props.name,
97
98
  autoComplete: this.props.autoComplete,
@@ -108,7 +109,12 @@ var NumberField = /*#__PURE__*/function (_Component) {
108
109
  min: this.props.min,
109
110
  max: this.props.max,
110
111
  step: this.props.step
111
- }, filterDataAttributes(this.props))), jsx(FieldErrors, {
112
+ }, filterDataAttributes(this.props)), {}, {
113
+ /* ARIA */
114
+ "aria-invalid": hasError,
115
+ "aria-errormessage": sequentialErrorsId
116
+ })), jsx(FieldErrors, {
117
+ id: sequentialErrorsId,
112
118
  errors: this.props.errors,
113
119
  isVisible: hasError,
114
120
  renderError: this.props.renderError
@@ -162,6 +168,6 @@ NumberField.propTypes = process.env.NODE_ENV !== "production" ? {
162
168
  var NumberField$1 = NumberField;
163
169
 
164
170
  // NOTE: This string will be replaced on build time with the package version.
165
- var version = "13.0.0";
171
+ var version = "13.0.4";
166
172
 
167
173
  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": "13.0.0",
4
+ "version": "13.0.4",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -21,17 +21,17 @@
21
21
  "dependencies": {
22
22
  "@babel/runtime": "7.17.2",
23
23
  "@babel/runtime-corejs3": "7.17.2",
24
- "@commercetools-uikit/constraints": "13.0.0",
24
+ "@commercetools-uikit/constraints": "13.0.2",
25
25
  "@commercetools-uikit/design-system": "13.0.0",
26
- "@commercetools-uikit/field-errors": "13.0.0",
27
- "@commercetools-uikit/field-label": "13.0.0",
28
- "@commercetools-uikit/number-input": "13.0.0",
29
- "@commercetools-uikit/spacings-stack": "13.0.0",
30
- "@commercetools-uikit/utils": "12.2.9",
26
+ "@commercetools-uikit/field-errors": "13.0.4",
27
+ "@commercetools-uikit/field-label": "13.0.4",
28
+ "@commercetools-uikit/number-input": "13.0.4",
29
+ "@commercetools-uikit/spacings-stack": "13.0.2",
30
+ "@commercetools-uikit/utils": "13.0.2",
31
31
  "@emotion/react": "^11.4.0",
32
32
  "@emotion/styled": "^11.3.0",
33
33
  "prop-types": "15.8.1",
34
- "react-required-if": "1.0.3"
34
+ "react-intl": "^5.24.6"
35
35
  },
36
36
  "devDependencies": {
37
37
  "react": "17.0.2"