carbon-react 123.4.3 → 123.4.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.
@@ -49,7 +49,7 @@ const InputIconToggle = ({
49
49
  tooltipPosition: align === "right" ? "left" : "right"
50
50
  }));
51
51
  }
52
- if (type && !(disabled || readOnly)) {
52
+ if (type) {
53
53
  return /*#__PURE__*/React.createElement(InputIconToggleStyle, {
54
54
  size: size,
55
55
  onClick: onClick,
@@ -57,8 +57,11 @@ const InputIconToggle = ({
57
57
  onBlur: onBlur,
58
58
  onMouseDown: onMouseDown,
59
59
  tabIndex: iconTabIndex,
60
- "data-element": "input-icon-toggle"
60
+ "data-element": "input-icon-toggle",
61
+ disabled: disabled,
62
+ readOnly: readOnly
61
63
  }, /*#__PURE__*/React.createElement(Icon, {
64
+ disabled: disabled || readOnly,
62
65
  type: type
63
66
  }));
64
67
  }
@@ -2,6 +2,8 @@
2
2
  import { ValidationProps } from "../validations";
3
3
  export interface InputIconToggleStyleProps extends ValidationProps {
4
4
  size?: "small" | "medium" | "large";
5
+ disabled?: boolean;
6
+ readOnly?: boolean;
5
7
  onClick?: (event: React.MouseEvent<HTMLSpanElement> | React.KeyboardEvent<HTMLSpanElement>) => void;
6
8
  }
7
9
  declare const InputIconToggleStyle: import("styled-components").StyledComponent<"span", any, {
@@ -26,6 +26,18 @@ const InputIconToggleStyle = styled.span.attrs(({
26
26
  width: ${sizes[size].height};
27
27
  `}
28
28
 
29
+ ${({
30
+ disabled
31
+ }) => disabled && css`
32
+ cursor: not-allowed;
33
+ `}
34
+
35
+ ${({
36
+ readOnly
37
+ }) => readOnly && css`
38
+ cursor: default;
39
+ `}
40
+
29
41
  ${({
30
42
  theme
31
43
  }) => `
@@ -56,7 +56,7 @@ const InputIconToggle = ({
56
56
  tooltipPosition: align === "right" ? "left" : "right"
57
57
  }));
58
58
  }
59
- if (type && !(disabled || readOnly)) {
59
+ if (type) {
60
60
  return /*#__PURE__*/_react.default.createElement(_inputIconToggle.default, {
61
61
  size: size,
62
62
  onClick: onClick,
@@ -64,8 +64,11 @@ const InputIconToggle = ({
64
64
  onBlur: onBlur,
65
65
  onMouseDown: onMouseDown,
66
66
  tabIndex: iconTabIndex,
67
- "data-element": "input-icon-toggle"
67
+ "data-element": "input-icon-toggle",
68
+ disabled: disabled,
69
+ readOnly: readOnly
68
70
  }, /*#__PURE__*/_react.default.createElement(_icon.default, {
71
+ disabled: disabled || readOnly,
69
72
  type: type
70
73
  }));
71
74
  }
@@ -2,6 +2,8 @@
2
2
  import { ValidationProps } from "../validations";
3
3
  export interface InputIconToggleStyleProps extends ValidationProps {
4
4
  size?: "small" | "medium" | "large";
5
+ disabled?: boolean;
6
+ readOnly?: boolean;
5
7
  onClick?: (event: React.MouseEvent<HTMLSpanElement> | React.KeyboardEvent<HTMLSpanElement>) => void;
6
8
  }
7
9
  declare const InputIconToggleStyle: import("styled-components").StyledComponent<"span", any, {
@@ -35,6 +35,18 @@ const InputIconToggleStyle = _styledComponents.default.span.attrs(({
35
35
  width: ${_inputSizes.default[size].height};
36
36
  `}
37
37
 
38
+ ${({
39
+ disabled
40
+ }) => disabled && (0, _styledComponents.css)`
41
+ cursor: not-allowed;
42
+ `}
43
+
44
+ ${({
45
+ readOnly
46
+ }) => readOnly && (0, _styledComponents.css)`
47
+ cursor: default;
48
+ `}
49
+
38
50
  ${({
39
51
  theme
40
52
  }) => `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "123.4.3",
3
+ "version": "123.4.4",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",