carbon-react 104.29.0 → 104.30.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.
|
@@ -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 _icon = _interopRequireDefault(require("../../icon/icon.style"));
|
|
15
13
|
|
|
16
14
|
var _button = _interopRequireDefault(require("../../button/button.style"));
|
|
@@ -31,10 +29,9 @@ const StyledFormSummary = _styledComponents.default.div`
|
|
|
31
29
|
white-space: nowrap;
|
|
32
30
|
|
|
33
31
|
${({
|
|
34
|
-
showSummary
|
|
35
|
-
theme
|
|
32
|
+
showSummary
|
|
36
33
|
}) => showSummary && (0, _styledComponents.css)`
|
|
37
|
-
background-color:
|
|
34
|
+
background-color: var(--colorsUtilityMajor025);
|
|
38
35
|
`}
|
|
39
36
|
|
|
40
37
|
${_button.default} {
|
|
@@ -57,46 +54,34 @@ const StyledInternalSummary = _styledComponents.default.div`
|
|
|
57
54
|
margin-right: 16px;
|
|
58
55
|
}
|
|
59
56
|
${({
|
|
60
|
-
type
|
|
61
|
-
theme
|
|
57
|
+
type
|
|
62
58
|
}) => type === "warnings" && (0, _styledComponents.css)`
|
|
63
|
-
color:
|
|
59
|
+
color: var(--colorsSemanticCaution650);
|
|
64
60
|
`}
|
|
65
61
|
${({
|
|
66
|
-
type
|
|
67
|
-
theme
|
|
62
|
+
type
|
|
68
63
|
}) => type === "errors" && (0, _styledComponents.css)`
|
|
69
|
-
color:
|
|
64
|
+
color: var(--colorsSemanticNegative600);
|
|
70
65
|
`}
|
|
71
66
|
|
|
72
67
|
${_icon.default} {
|
|
73
68
|
margin-right: 4px;
|
|
74
69
|
${({
|
|
75
|
-
type
|
|
76
|
-
theme
|
|
70
|
+
type
|
|
77
71
|
}) => type === "warnings" && (0, _styledComponents.css)`
|
|
78
|
-
color:
|
|
72
|
+
color: var(--colorsSemanticCaution650);
|
|
79
73
|
`}
|
|
80
74
|
${({
|
|
81
|
-
type
|
|
82
|
-
theme
|
|
75
|
+
type
|
|
83
76
|
}) => type === "errors" && (0, _styledComponents.css)`
|
|
84
|
-
color:
|
|
77
|
+
color: var(--colorsSemanticNegative600);
|
|
85
78
|
`}
|
|
86
79
|
}
|
|
87
80
|
`;
|
|
88
81
|
exports.StyledInternalSummary = StyledInternalSummary;
|
|
89
82
|
StyledFormSummary.propTypes = {
|
|
90
|
-
theme: _propTypes.default.object,
|
|
91
83
|
showSummary: _propTypes.default.bool
|
|
92
84
|
};
|
|
93
|
-
StyledFormSummary.defaultProps = {
|
|
94
|
-
theme: _base.default
|
|
95
|
-
};
|
|
96
85
|
StyledInternalSummary.propTypes = {
|
|
97
|
-
theme: _propTypes.default.object,
|
|
98
86
|
type: _propTypes.default.oneOf(["errors", "warnings"])
|
|
99
|
-
};
|
|
100
|
-
StyledInternalSummary.defaultProps = {
|
|
101
|
-
theme: _base.default
|
|
102
87
|
};
|
|
@@ -55,15 +55,14 @@ const StyledFormFooter = _styledComponents.default.div`
|
|
|
55
55
|
`}
|
|
56
56
|
|
|
57
57
|
${({
|
|
58
|
-
stickyFooter
|
|
59
|
-
theme
|
|
58
|
+
stickyFooter
|
|
60
59
|
}) => (0, _styledComponents.css)`
|
|
61
60
|
${!stickyFooter && (0, _styledComponents.css)`
|
|
62
61
|
margin-top: 48px;
|
|
63
62
|
`}
|
|
64
63
|
|
|
65
64
|
${stickyFooter && (0, _styledComponents.css)`
|
|
66
|
-
background-color:
|
|
65
|
+
background-color: var(--colorsUtilityYang100);
|
|
67
66
|
box-shadow: 0 -4px 12px 0 rgba(0, 0, 0, 0.05);
|
|
68
67
|
box-sizing: border-box;
|
|
69
68
|
padding: 16px 32px;
|
|
@@ -75,6 +74,17 @@ const StyledFormFooter = _styledComponents.default.div`
|
|
|
75
74
|
`}
|
|
76
75
|
`;
|
|
77
76
|
exports.StyledFormFooter = StyledFormFooter;
|
|
77
|
+
|
|
78
|
+
const formBottomMargins = fieldSpacing => ({
|
|
79
|
+
0: "var(--spacing000)",
|
|
80
|
+
1: "var(--spacing100)",
|
|
81
|
+
2: "var(--spacing200)",
|
|
82
|
+
3: "var(--spacing300)",
|
|
83
|
+
4: "var(--spacing400)",
|
|
84
|
+
5: "var(--spacing500)",
|
|
85
|
+
7: "var(--spacing700)"
|
|
86
|
+
})[fieldSpacing];
|
|
87
|
+
|
|
78
88
|
const StyledForm = _styledComponents.default.form`
|
|
79
89
|
${_styledSystem.space}
|
|
80
90
|
|
|
@@ -84,24 +94,26 @@ const StyledForm = _styledComponents.default.form`
|
|
|
84
94
|
height: ${height};
|
|
85
95
|
`}
|
|
86
96
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
${({
|
|
98
|
+
fieldSpacing
|
|
99
|
+
}) => (0, _styledComponents.css)`
|
|
100
|
+
&
|
|
101
|
+
${_formField.default},
|
|
102
|
+
${_fieldset.StyledFieldset},
|
|
103
|
+
${_fieldset2.FieldsetStyle},
|
|
104
|
+
> ${_button.default} {
|
|
105
|
+
margin-top: 0;
|
|
106
|
+
margin-bottom: ${formBottomMargins(fieldSpacing)};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
${_inlineInputs.default} {
|
|
110
|
+
${_formField.default} {
|
|
111
|
+
margin-bottom: 0;
|
|
112
|
+
}
|
|
99
113
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}) => theme.spacing * fieldSpacing}px;
|
|
104
|
-
}
|
|
114
|
+
margin-bottom: ${formBottomMargins(fieldSpacing)};
|
|
115
|
+
}
|
|
116
|
+
`}
|
|
105
117
|
|
|
106
118
|
${_search.default} ${_formField.default} {
|
|
107
119
|
margin-bottom: 0px;
|
|
@@ -109,8 +121,7 @@ const StyledForm = _styledComponents.default.form`
|
|
|
109
121
|
|
|
110
122
|
${({
|
|
111
123
|
stickyFooter,
|
|
112
|
-
isInSidebar
|
|
113
|
-
theme
|
|
124
|
+
isInSidebar
|
|
114
125
|
}) => stickyFooter && (0, _styledComponents.css)`
|
|
115
126
|
display: flex;
|
|
116
127
|
flex-direction: column;
|
|
@@ -119,20 +130,20 @@ const StyledForm = _styledComponents.default.form`
|
|
|
119
130
|
${isInSidebar && (0, _styledComponents.css)`
|
|
120
131
|
min-height: 100%;
|
|
121
132
|
${StyledFormContent}.sticky {
|
|
122
|
-
padding-right:
|
|
123
|
-
padding-left:
|
|
133
|
+
padding-right: var(--spacing400);
|
|
134
|
+
padding-left: var(--spacing400);
|
|
124
135
|
padding-top: 27px;
|
|
125
|
-
margin-right:
|
|
126
|
-
margin-left:
|
|
136
|
+
margin-right: calc(-1 * var(--spacing400));
|
|
137
|
+
margin-left: calc(-1 * var(--spacing400));
|
|
127
138
|
margin-top: -27px;
|
|
128
139
|
}
|
|
129
140
|
|
|
130
141
|
${StyledFormFooter}.sticky {
|
|
131
|
-
margin-left:
|
|
132
|
-
margin-bottom:
|
|
133
|
-
width: calc(100% +
|
|
134
|
-
padding-left:
|
|
135
|
-
padding-right:
|
|
142
|
+
margin-left: calc(-1 * var(--spacing400));
|
|
143
|
+
margin-bottom: calc(-1 * var(--spacing400));
|
|
144
|
+
width: calc(100% + var(--spacing800));
|
|
145
|
+
padding-left: var(--spacing400);
|
|
146
|
+
padding-right: var(--spacing400);
|
|
136
147
|
bottom: -32px;
|
|
137
148
|
}
|
|
138
149
|
`}
|
|
@@ -179,10 +190,6 @@ StyledRightButtons.propTypes = {
|
|
|
179
190
|
buttonAlignment: _propTypes.default.oneOf(_form.FORM_BUTTON_ALIGNMENTS)
|
|
180
191
|
};
|
|
181
192
|
StyledFormFooter.propTypes = {
|
|
182
|
-
theme: _propTypes.default.object,
|
|
183
193
|
buttonAlignment: _propTypes.default.oneOf(_form.FORM_BUTTON_ALIGNMENTS),
|
|
184
194
|
stickyFooter: _propTypes.default.bool
|
|
185
|
-
};
|
|
186
|
-
StyledFormFooter.defaultProps = {
|
|
187
|
-
theme: _base.default
|
|
188
195
|
};
|