carbon-react 104.55.0 → 104.56.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.
@@ -1,5 +1,5 @@
1
1
  declare var _default: React.MemoExoticComponent<{
2
- ({ name, checked, type, value, inputRef, onChange, autoFocus, ...props }: {
2
+ ({ name, checked, type, value, inputRef, onChange, autoFocus, role, ...props }: {
3
3
  [x: string]: any;
4
4
  name: any;
5
5
  checked: any;
@@ -8,6 +8,7 @@ declare var _default: React.MemoExoticComponent<{
8
8
  inputRef: any;
9
9
  onChange: any;
10
10
  autoFocus: any;
11
+ role: any;
11
12
  }): JSX.Element;
12
13
  propTypes: {
13
14
  /** Allows component to be focused on page load */
@@ -28,6 +29,8 @@ declare var _default: React.MemoExoticComponent<{
28
29
  onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
29
30
  /** HTML type attribute of the input */
30
31
  type: PropTypes.Validator<string>;
32
+ /** Role attribute of the input */
33
+ role: PropTypes.Requireable<string>;
31
34
  /** Value of the input */
32
35
  value: PropTypes.Requireable<string>;
33
36
  /** A callback to retrieve the input reference */
@@ -13,6 +13,7 @@ const HiddenCheckableInput = ({
13
13
  inputRef,
14
14
  onChange,
15
15
  autoFocus,
16
+ role,
16
17
  ...props
17
18
  }) => {
18
19
  const {
@@ -57,7 +58,7 @@ const HiddenCheckableInput = ({
57
58
  "aria-checked": checked,
58
59
  checked: checked,
59
60
  name: name,
60
- role: type,
61
+ role: role || type,
61
62
  type: type,
62
63
  value: value
63
64
  }, props, {
@@ -98,6 +99,9 @@ HiddenCheckableInput.propTypes = {
98
99
  /** HTML type attribute of the input */
99
100
  type: PropTypes.string.isRequired,
100
101
 
102
+ /** Role attribute of the input */
103
+ role: PropTypes.string,
104
+
101
105
  /** Value of the input */
102
106
  value: PropTypes.string,
103
107
 
@@ -31,6 +31,8 @@ export interface HiddenCheckableInputProps
31
31
  extends CommonHiddenCheckableInputProps {
32
32
  /** HTML type attribute of the input */
33
33
  type: string;
34
+ /** Role attribute of the input */
35
+ role?: string;
34
36
  }
35
37
 
36
38
  declare function HiddenCheckableInput(
@@ -96,6 +96,7 @@ const Switch = ({
96
96
  labelHelp,
97
97
  value,
98
98
  type: "checkbox",
99
+ role: "switch",
99
100
  reverse: !reverse,
100
101
  // switched to preserve backward compatibility
101
102
  validationOnLabel: shouldValidationBeOnLabel && !disabled,
@@ -1,5 +1,5 @@
1
1
  declare var _default: React.MemoExoticComponent<{
2
- ({ name, checked, type, value, inputRef, onChange, autoFocus, ...props }: {
2
+ ({ name, checked, type, value, inputRef, onChange, autoFocus, role, ...props }: {
3
3
  [x: string]: any;
4
4
  name: any;
5
5
  checked: any;
@@ -8,6 +8,7 @@ declare var _default: React.MemoExoticComponent<{
8
8
  inputRef: any;
9
9
  onChange: any;
10
10
  autoFocus: any;
11
+ role: any;
11
12
  }): JSX.Element;
12
13
  propTypes: {
13
14
  /** Allows component to be focused on page load */
@@ -28,6 +29,8 @@ declare var _default: React.MemoExoticComponent<{
28
29
  onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
29
30
  /** HTML type attribute of the input */
30
31
  type: PropTypes.Validator<string>;
32
+ /** Role attribute of the input */
33
+ role: PropTypes.Requireable<string>;
31
34
  /** Value of the input */
32
35
  value: PropTypes.Requireable<string>;
33
36
  /** A callback to retrieve the input reference */
@@ -29,6 +29,7 @@ const HiddenCheckableInput = ({
29
29
  inputRef,
30
30
  onChange,
31
31
  autoFocus,
32
+ role,
32
33
  ...props
33
34
  }) => {
34
35
  const {
@@ -73,7 +74,7 @@ const HiddenCheckableInput = ({
73
74
  "aria-checked": checked,
74
75
  checked: checked,
75
76
  name: name,
76
- role: type,
77
+ role: role || type,
77
78
  type: type,
78
79
  value: value
79
80
  }, props, {
@@ -114,6 +115,9 @@ HiddenCheckableInput.propTypes = {
114
115
  /** HTML type attribute of the input */
115
116
  type: _propTypes.default.string.isRequired,
116
117
 
118
+ /** Role attribute of the input */
119
+ role: _propTypes.default.string,
120
+
117
121
  /** Value of the input */
118
122
  value: _propTypes.default.string,
119
123
 
@@ -31,6 +31,8 @@ export interface HiddenCheckableInputProps
31
31
  extends CommonHiddenCheckableInputProps {
32
32
  /** HTML type attribute of the input */
33
33
  type: string;
34
+ /** Role attribute of the input */
35
+ role?: string;
34
36
  }
35
37
 
36
38
  declare function HiddenCheckableInput(
@@ -118,6 +118,7 @@ const Switch = ({
118
118
  labelHelp,
119
119
  value,
120
120
  type: "checkbox",
121
+ role: "switch",
121
122
  reverse: !reverse,
122
123
  // switched to preserve backward compatibility
123
124
  validationOnLabel: shouldValidationBeOnLabel && !disabled,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "104.55.0",
3
+ "version": "104.56.0",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "engineStrict": true,
6
6
  "engines": {