carbon-react 102.13.2 → 102.14.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.
- package/lib/__internal__/input/input-presentation.style.d.ts +0 -1
- package/lib/__internal__/input/input-presentation.style.js +13 -22
- package/lib/__internal__/input/input-sizes.style.d.ts +0 -15
- package/lib/__internal__/input/input-sizes.style.js +6 -15
- package/lib/__internal__/input/input.style.js +7 -20
- package/lib/__internal__/input-icon-toggle/input-icon-toggle.style.js +2 -2
- package/package.json +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export const StyledInputPresentationContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
2
|
export default InputPresentationStyle;
|
|
3
3
|
declare const InputPresentationStyle: import("styled-components").StyledComponent<"div", any, {
|
|
4
|
-
theme: any;
|
|
5
4
|
error: any;
|
|
6
5
|
warning: any;
|
|
7
6
|
info: any;
|
|
@@ -9,8 +9,6 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
-
var _base = _interopRequireDefault(require("../../style/themes/base"));
|
|
13
|
-
|
|
14
12
|
var _inputSizes = _interopRequireDefault(require("./input-sizes.style"));
|
|
15
13
|
|
|
16
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -30,9 +28,7 @@ exports.StyledInputPresentationContainer = StyledInputPresentationContainer;
|
|
|
30
28
|
const InputPresentationStyle = _styledComponents.default.div`
|
|
31
29
|
align-items: stretch;
|
|
32
30
|
background: #fff;
|
|
33
|
-
border: 1px solid
|
|
34
|
-
theme
|
|
35
|
-
}) => theme.colors.border};
|
|
31
|
+
border: 1px solid var(--colorsUtilityMajor300);
|
|
36
32
|
box-sizing: border-box;
|
|
37
33
|
cursor: text;
|
|
38
34
|
display: flex;
|
|
@@ -50,21 +46,19 @@ const InputPresentationStyle = _styledComponents.default.div`
|
|
|
50
46
|
}) => _inputSizes.default[size].horizontalPadding};
|
|
51
47
|
|
|
52
48
|
${({
|
|
53
|
-
disabled
|
|
54
|
-
theme
|
|
49
|
+
disabled
|
|
55
50
|
}) => disabled && (0, _styledComponents.css)`
|
|
56
|
-
background:
|
|
57
|
-
border-color:
|
|
51
|
+
background: var(--colorsUtilityDisabled400);
|
|
52
|
+
border-color: var(--colorsUtilityDisabled600);
|
|
58
53
|
cursor: not-allowed;
|
|
59
54
|
`}
|
|
60
55
|
|
|
61
56
|
${({
|
|
62
57
|
hasFocus,
|
|
63
|
-
theme,
|
|
64
58
|
disabled
|
|
65
59
|
}) => hasFocus && !disabled && (0, _styledComponents.css)`
|
|
66
|
-
|
|
67
|
-
outline: 3px solid
|
|
60
|
+
& {
|
|
61
|
+
outline: 3px solid var(--colorsSemanticFocus500);
|
|
68
62
|
z-index: 2;
|
|
69
63
|
}
|
|
70
64
|
`}
|
|
@@ -72,11 +66,10 @@ const InputPresentationStyle = _styledComponents.default.div`
|
|
|
72
66
|
${stylingForValidations}
|
|
73
67
|
|
|
74
68
|
${({
|
|
75
|
-
readOnly
|
|
76
|
-
theme
|
|
69
|
+
readOnly
|
|
77
70
|
}) => readOnly && (0, _styledComponents.css)`
|
|
78
|
-
background-color:
|
|
79
|
-
border-color:
|
|
71
|
+
background-color: var(--colorsUtilityReadOnly400);
|
|
72
|
+
border-color: var(--colorsUtilityReadOnly600);
|
|
80
73
|
`}
|
|
81
74
|
|
|
82
75
|
${({
|
|
@@ -92,7 +85,6 @@ const InputPresentationStyle = _styledComponents.default.div`
|
|
|
92
85
|
`;
|
|
93
86
|
|
|
94
87
|
function stylingForValidations({
|
|
95
|
-
theme,
|
|
96
88
|
error,
|
|
97
89
|
warning,
|
|
98
90
|
info,
|
|
@@ -105,11 +97,11 @@ function stylingForValidations({
|
|
|
105
97
|
}
|
|
106
98
|
|
|
107
99
|
if (error) {
|
|
108
|
-
validationColor =
|
|
100
|
+
validationColor = "var(--colorsSemanticNegative500)";
|
|
109
101
|
} else if (warning) {
|
|
110
|
-
validationColor =
|
|
102
|
+
validationColor = "var(--colorsSemanticCaution500)";
|
|
111
103
|
} else if (info) {
|
|
112
|
-
validationColor =
|
|
104
|
+
validationColor = "var(--colorsSemanticInfo500)";
|
|
113
105
|
} else {
|
|
114
106
|
return "";
|
|
115
107
|
}
|
|
@@ -122,8 +114,7 @@ function stylingForValidations({
|
|
|
122
114
|
}
|
|
123
115
|
|
|
124
116
|
InputPresentationStyle.defaultProps = {
|
|
125
|
-
size: "medium"
|
|
126
|
-
theme: _base.default
|
|
117
|
+
size: "medium"
|
|
127
118
|
};
|
|
128
119
|
InputPresentationStyle.propTypes = {
|
|
129
120
|
align: _propTypes.default.string,
|
|
@@ -1,34 +1,19 @@
|
|
|
1
1
|
declare namespace _default {
|
|
2
2
|
namespace small {
|
|
3
3
|
const height: string;
|
|
4
|
-
const verticalPadding: string;
|
|
5
4
|
const horizontalPadding: string;
|
|
6
|
-
const tooltipVerticalOffset: number;
|
|
7
|
-
const tooltipHorizontalOffset: number;
|
|
8
5
|
}
|
|
9
6
|
namespace medium {
|
|
10
7
|
const height_1: string;
|
|
11
8
|
export { height_1 as height };
|
|
12
|
-
const verticalPadding_1: string;
|
|
13
|
-
export { verticalPadding_1 as verticalPadding };
|
|
14
9
|
const horizontalPadding_1: string;
|
|
15
10
|
export { horizontalPadding_1 as horizontalPadding };
|
|
16
|
-
const tooltipVerticalOffset_1: number;
|
|
17
|
-
export { tooltipVerticalOffset_1 as tooltipVerticalOffset };
|
|
18
|
-
const tooltipHorizontalOffset_1: number;
|
|
19
|
-
export { tooltipHorizontalOffset_1 as tooltipHorizontalOffset };
|
|
20
11
|
}
|
|
21
12
|
namespace large {
|
|
22
13
|
const height_2: string;
|
|
23
14
|
export { height_2 as height };
|
|
24
|
-
const verticalPadding_2: string;
|
|
25
|
-
export { verticalPadding_2 as verticalPadding };
|
|
26
15
|
const horizontalPadding_2: string;
|
|
27
16
|
export { horizontalPadding_2 as horizontalPadding };
|
|
28
|
-
const tooltipVerticalOffset_2: number;
|
|
29
|
-
export { tooltipVerticalOffset_2 as tooltipVerticalOffset };
|
|
30
|
-
const tooltipHorizontalOffset_2: number;
|
|
31
|
-
export { tooltipHorizontalOffset_2 as tooltipHorizontalOffset };
|
|
32
17
|
}
|
|
33
18
|
}
|
|
34
19
|
export default _default;
|
|
@@ -6,25 +6,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _default = {
|
|
8
8
|
small: {
|
|
9
|
-
height: "
|
|
10
|
-
|
|
11
|
-
horizontalPadding: "8px",
|
|
12
|
-
tooltipVerticalOffset: 3,
|
|
13
|
-
tooltipHorizontalOffset: 1
|
|
9
|
+
height: "var(--sizing400)",
|
|
10
|
+
horizontalPadding: "var(--spacing100)"
|
|
14
11
|
},
|
|
15
12
|
medium: {
|
|
16
|
-
height: "
|
|
17
|
-
|
|
18
|
-
horizontalPadding: "11px",
|
|
19
|
-
tooltipVerticalOffset: 6,
|
|
20
|
-
tooltipHorizontalOffset: 4
|
|
13
|
+
height: "var(--sizing500)",
|
|
14
|
+
horizontalPadding: "var(--spacing150)"
|
|
21
15
|
},
|
|
22
16
|
large: {
|
|
23
|
-
height: "
|
|
24
|
-
|
|
25
|
-
horizontalPadding: "13px",
|
|
26
|
-
tooltipVerticalOffset: 10,
|
|
27
|
-
tooltipHorizontalOffset: 6
|
|
17
|
+
height: "var(--sizing600)",
|
|
18
|
+
horizontalPadding: "var(--spacing200)"
|
|
28
19
|
}
|
|
29
20
|
};
|
|
30
21
|
exports.default = _default;
|
|
@@ -9,8 +9,6 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
-
var _base = _interopRequireDefault(require("../../style/themes/base"));
|
|
13
|
-
|
|
14
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
13
|
|
|
16
14
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
@@ -20,13 +18,9 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
20
18
|
const StyledInput = _styledComponents.default.input`
|
|
21
19
|
background: transparent;
|
|
22
20
|
border: none;
|
|
23
|
-
color:
|
|
24
|
-
theme
|
|
25
|
-
}) => theme.text.color};
|
|
21
|
+
color: var(--colorsUtilityYin090);
|
|
26
22
|
flex-grow: 1;
|
|
27
|
-
font-size:
|
|
28
|
-
theme
|
|
29
|
-
}) => theme.text.size};
|
|
23
|
+
font-size: var(--fontSizes100);
|
|
30
24
|
outline: none;
|
|
31
25
|
padding: 0;
|
|
32
26
|
margin: 0;
|
|
@@ -44,29 +38,22 @@ const StyledInput = _styledComponents.default.input`
|
|
|
44
38
|
`}
|
|
45
39
|
|
|
46
40
|
&::placeholder {
|
|
47
|
-
color:
|
|
48
|
-
theme
|
|
49
|
-
}) => theme.text.placeholder};
|
|
41
|
+
color: var(--colorsUtilityYin030);
|
|
50
42
|
}
|
|
51
43
|
|
|
52
44
|
${({
|
|
53
|
-
disabled
|
|
54
|
-
theme
|
|
45
|
+
disabled
|
|
55
46
|
}) => disabled && (0, _styledComponents.css)`
|
|
56
|
-
color:
|
|
47
|
+
color: var(--colorsUtilityYin030);
|
|
57
48
|
cursor: not-allowed;
|
|
58
49
|
`}
|
|
59
50
|
|
|
60
51
|
${({
|
|
61
|
-
readOnly
|
|
62
|
-
theme
|
|
52
|
+
readOnly
|
|
63
53
|
}) => readOnly && (0, _styledComponents.css)`
|
|
64
|
-
color:
|
|
54
|
+
color: var(--colorsActionMinorYin090);
|
|
65
55
|
`}
|
|
66
56
|
`;
|
|
67
|
-
StyledInput.defaultProps = {
|
|
68
|
-
theme: _base.default
|
|
69
|
-
};
|
|
70
57
|
StyledInput.propTypes = {
|
|
71
58
|
disabled: _propTypes.default.bool
|
|
72
59
|
};
|
|
@@ -39,8 +39,8 @@ const InputIconToggleStyle = _styledComponents.default.span.attrs(({
|
|
|
39
39
|
${({
|
|
40
40
|
size
|
|
41
41
|
}) => (0, _styledComponents.css)`
|
|
42
|
-
margin-right:
|
|
43
|
-
margin-left:
|
|
42
|
+
margin-right: calc(-1 * ${_inputSizes.default[size].horizontalPadding});
|
|
43
|
+
margin-left: calc(-1 * ${_inputSizes.default[size].horizontalPadding});
|
|
44
44
|
width: ${_inputSizes.default[size].height};
|
|
45
45
|
`}
|
|
46
46
|
|