@commercetools-uikit/number-input 13.0.2 → 14.0.1

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/README.md CHANGED
@@ -52,6 +52,8 @@ export default Example;
52
52
  | ---------------------- | ----------------------------------------------------------------------------------------------------------- | :------: | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
53
53
  | `id` | `string` | | | Used as HTML id property. An id is auto-generated when it is not specified. |
54
54
  | `name` | `string` | | | Used as HTML name of the input component. property |
55
+ | `aria-invalid` | `boolean` | | | Indicate if the value entered in the input is invalid. |
56
+ | `aria-errormessage` | `string` | | | HTML ID of an element containing an error message related to the input. |
55
57
  | `autoComplete` | `string` | | | Used as HTML `autocomplete` of the input component. property |
56
58
  | `placeholder` | `string` | | | Placeholder text for the input |
57
59
  | `value` | `union`<br/>Possible values:<br/>`string , number` | ✅ | | Value of the input component. |
@@ -70,7 +70,9 @@ var NumberInput = function NumberInput(props) {
70
70
  }, utils.filterDataAttributes(props)), {}, {
71
71
  /* ARIA */
72
72
  "aria-readonly": props.isReadOnly,
73
- contentEditable: !props.isReadOnly
73
+ contentEditable: !props.isReadOnly,
74
+ "aria-invalid": props['aria-invalid'],
75
+ "aria-errormessage": props['aria-errormessage']
74
76
  }))
75
77
  });
76
78
  };
@@ -78,6 +80,8 @@ var NumberInput = function NumberInput(props) {
78
80
  NumberInput.propTypes = process.env.NODE_ENV !== "production" ? {
79
81
  id: _pt__default["default"].string,
80
82
  name: _pt__default["default"].string,
83
+ 'aria-invalid': _pt__default["default"].bool,
84
+ 'aria-errormessage': _pt__default["default"].string,
81
85
  autoComplete: _pt__default["default"].string,
82
86
  placeholder: _pt__default["default"].string,
83
87
  value: _pt__default["default"].oneOfType([_pt__default["default"].string, _pt__default["default"].number]).isRequired,
@@ -120,7 +124,7 @@ NumberInput.hasFractionDigits = function (number) {
120
124
  var NumberInput$1 = NumberInput;
121
125
 
122
126
  // NOTE: This string will be replaced on build time with the package version.
123
- var version = "13.0.2";
127
+ var version = "14.0.1";
124
128
 
125
129
  exports["default"] = NumberInput$1;
126
130
  exports.version = version;
@@ -67,7 +67,9 @@ var NumberInput = function NumberInput(props) {
67
67
  }, utils.filterDataAttributes(props)), {}, {
68
68
  /* ARIA */
69
69
  "aria-readonly": props.isReadOnly,
70
- contentEditable: !props.isReadOnly
70
+ contentEditable: !props.isReadOnly,
71
+ "aria-invalid": props['aria-invalid'],
72
+ "aria-errormessage": props['aria-errormessage']
71
73
  }))
72
74
  });
73
75
  };
@@ -98,7 +100,7 @@ NumberInput.hasFractionDigits = function (number) {
98
100
  var NumberInput$1 = NumberInput;
99
101
 
100
102
  // NOTE: This string will be replaced on build time with the package version.
101
- var version = "13.0.2";
103
+ var version = "14.0.1";
102
104
 
103
105
  exports["default"] = NumberInput$1;
104
106
  exports.version = version;
@@ -52,7 +52,9 @@ var NumberInput = function NumberInput(props) {
52
52
  }, filterDataAttributes(props)), {}, {
53
53
  /* ARIA */
54
54
  "aria-readonly": props.isReadOnly,
55
- contentEditable: !props.isReadOnly
55
+ contentEditable: !props.isReadOnly,
56
+ "aria-invalid": props['aria-invalid'],
57
+ "aria-errormessage": props['aria-errormessage']
56
58
  }))
57
59
  });
58
60
  };
@@ -60,6 +62,8 @@ var NumberInput = function NumberInput(props) {
60
62
  NumberInput.propTypes = process.env.NODE_ENV !== "production" ? {
61
63
  id: _pt.string,
62
64
  name: _pt.string,
65
+ 'aria-invalid': _pt.bool,
66
+ 'aria-errormessage': _pt.string,
63
67
  autoComplete: _pt.string,
64
68
  placeholder: _pt.string,
65
69
  value: _pt.oneOfType([_pt.string, _pt.number]).isRequired,
@@ -102,6 +106,6 @@ NumberInput.hasFractionDigits = function (number) {
102
106
  var NumberInput$1 = NumberInput;
103
107
 
104
108
  // NOTE: This string will be replaced on build time with the package version.
105
- var version = "13.0.2";
109
+ var version = "14.0.1";
106
110
 
107
111
  export { NumberInput$1 as default, version };
@@ -2,6 +2,8 @@ import { ChangeEventHandler, FocusEventHandler } from 'react';
2
2
  export declare type TNumberInputProps = {
3
3
  id?: string;
4
4
  name?: string;
5
+ 'aria-invalid'?: boolean;
6
+ 'aria-errormessage'?: string;
5
7
  autoComplete?: string;
6
8
  placeholder?: string;
7
9
  value: string | number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-uikit/number-input",
3
3
  "description": "A controlled input component for numbers with validation states.",
4
- "version": "13.0.2",
4
+ "version": "14.0.1",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -9,7 +9,7 @@
9
9
  "directory": "packages/components/inputs/number-input"
10
10
  },
11
11
  "homepage": "https://uikit.commercetools.com",
12
- "keywords": ["javascript", "design system", "react", "uikit"],
12
+ "keywords": ["javascript", "typescript", "design-system", "react", "uikit"],
13
13
  "license": "MIT",
14
14
  "publishConfig": {
15
15
  "access": "public"
@@ -19,12 +19,12 @@
19
19
  "module": "dist/commercetools-uikit-number-input.esm.js",
20
20
  "files": ["dist"],
21
21
  "dependencies": {
22
- "@babel/runtime": "7.17.2",
23
- "@babel/runtime-corejs3": "7.17.2",
24
- "@commercetools-uikit/constraints": "13.0.2",
25
- "@commercetools-uikit/design-system": "13.0.0",
26
- "@commercetools-uikit/input-utils": "13.0.2",
27
- "@commercetools-uikit/utils": "13.0.2",
22
+ "@babel/runtime": "^7.17.2",
23
+ "@babel/runtime-corejs3": "^7.17.2",
24
+ "@commercetools-uikit/constraints": "14.0.1",
25
+ "@commercetools-uikit/design-system": "14.0.0",
26
+ "@commercetools-uikit/input-utils": "14.0.1",
27
+ "@commercetools-uikit/utils": "14.0.1",
28
28
  "@emotion/react": "^11.4.0",
29
29
  "@emotion/styled": "^11.3.0",
30
30
  "prop-types": "15.8.1"