@comicrelief/component-library 8.42.0 → 8.44.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/dist/components/Atoms/Checkbox/Checkbox.test.js +50 -10
- package/dist/components/Atoms/ErrorText/__snapshots__/ErrorText.test.js.snap +27 -4
- package/dist/components/Atoms/Input/Input.js +4 -9
- package/dist/components/Atoms/Input/input.test.js +92 -14
- package/dist/components/Atoms/Label/Label.js +14 -7
- package/dist/components/Atoms/RadioButton/RadioButton.test.js +50 -10
- package/dist/components/Atoms/Select/__snapshots__/Select.test.js.snap +45 -6
- package/dist/components/Atoms/Text/Text.js +60 -75
- package/dist/components/Atoms/Text/Text.md +84 -87
- package/dist/components/Atoms/Text/__snapshots__/Text.test.js.snap +130 -21
- package/dist/components/Atoms/TextArea/TextArea.test.js +45 -6
- package/dist/components/Atoms/TextInputWithDropdown/__snapshots__/TextInputWithDropdown.test.js.snap +138 -25
- package/dist/components/Molecules/Accordion/__snapshots__/Accordion.test.js.snap +48 -7
- package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.test.js +110 -20
- package/dist/components/Molecules/Banner/__snapshots__/Banner.test.js.snap +26 -6
- package/dist/components/Molecules/Descriptor/Descriptor.test.js +85 -15
- package/dist/components/Molecules/InfoBanner/__snapshots__/InfoBanner.test.js.snap +53 -3
- package/dist/components/Molecules/PartnerLink/PartnerLink.test.js +27 -4
- package/dist/components/Molecules/Promo/__snapshots__/Promo.test.js.snap +112 -28
- package/dist/components/Molecules/SchoolLookup/__snapshots__/SchoolLookup.test.js.snap +46 -7
- package/dist/components/Molecules/SearchInput/SearchInput.test.js +23 -6
- package/dist/components/Molecules/SearchResult/__snapshots__/SearchResult.test.js.snap +232 -20
- package/dist/components/Molecules/SingleMessage/__snapshots__/SingleMessage.test.js.snap +187 -30
- package/dist/components/Molecules/SingleMessageDS/__snapshots__/SingleMessageDs.test.js.snap +50 -9
- package/dist/components/Molecules/Typeahead/__snapshots__/Typeahead.test.js.snap +46 -7
- package/dist/components/Organisms/CookieBanner/CookieBanner.test.js +26 -7
- package/dist/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +544 -101
- package/dist/components/Organisms/EmailSignUp/__snapshots__/EmailSignUp.test.js.snap +75 -19
- package/dist/components/Organisms/Footer/Nav/Nav.style.js +1 -1
- package/dist/components/Organisms/Footer/__snapshots__/Footer.test.js.snap +100 -47
- package/dist/components/Organisms/Membership/Membership.test.js +122 -22
- package/dist/components/Organisms/Membership/MoneyBox/MoneyBox.js +1 -1
- package/dist/components/Organisms/WYMDCarousel/__snapshots__/WYMDCarousel.test.js.snap +75 -19
- package/dist/theme/crTheme/fontConfig.js +217 -0
- package/dist/theme/crTheme/fontHelper.js +38 -0
- package/dist/theme/shared/breakpoints2026.js +11 -2
- package/dist/theme/shared/global.css +3 -1
- package/package.json +1 -1
- package/src/components/Atoms/Checkbox/Checkbox.test.js +50 -10
- package/src/components/Atoms/ErrorText/__snapshots__/ErrorText.test.js.snap +27 -4
- package/src/components/Atoms/Input/Input.js +2 -2
- package/src/components/Atoms/Input/input.test.js +92 -14
- package/src/components/Atoms/Label/Label.js +7 -3
- package/src/components/Atoms/RadioButton/RadioButton.test.js +50 -10
- package/src/components/Atoms/Select/__snapshots__/Select.test.js.snap +45 -6
- package/src/components/Atoms/Text/Text.js +55 -54
- package/src/components/Atoms/Text/Text.md +84 -87
- package/src/components/Atoms/Text/__snapshots__/Text.test.js.snap +130 -21
- package/src/components/Atoms/TextArea/TextArea.test.js +45 -6
- package/src/components/Atoms/TextInputWithDropdown/__snapshots__/TextInputWithDropdown.test.js.snap +138 -25
- package/src/components/Molecules/Accordion/__snapshots__/Accordion.test.js.snap +48 -7
- package/src/components/Molecules/ArticleTeaser/ArticleTeaser.test.js +110 -20
- package/src/components/Molecules/Banner/__snapshots__/Banner.test.js.snap +26 -6
- package/src/components/Molecules/Descriptor/Descriptor.test.js +85 -15
- package/src/components/Molecules/InfoBanner/__snapshots__/InfoBanner.test.js.snap +53 -3
- package/src/components/Molecules/PartnerLink/PartnerLink.test.js +27 -4
- package/src/components/Molecules/Promo/__snapshots__/Promo.test.js.snap +112 -28
- package/src/components/Molecules/SchoolLookup/__snapshots__/SchoolLookup.test.js.snap +46 -7
- package/src/components/Molecules/SearchInput/SearchInput.test.js +23 -6
- package/src/components/Molecules/SearchResult/__snapshots__/SearchResult.test.js.snap +232 -20
- package/src/components/Molecules/SingleMessage/__snapshots__/SingleMessage.test.js.snap +187 -30
- package/src/components/Molecules/SingleMessageDS/__snapshots__/SingleMessageDs.test.js.snap +50 -9
- package/src/components/Molecules/Typeahead/__snapshots__/Typeahead.test.js.snap +46 -7
- package/src/components/Organisms/CookieBanner/CookieBanner.test.js +26 -7
- package/src/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +544 -101
- package/src/components/Organisms/EmailSignUp/__snapshots__/EmailSignUp.test.js.snap +75 -19
- package/src/components/Organisms/Footer/Nav/Nav.style.js +1 -1
- package/src/components/Organisms/Footer/__snapshots__/Footer.test.js.snap +100 -47
- package/src/components/Organisms/Membership/Membership.test.js +122 -22
- package/src/components/Organisms/Membership/MoneyBox/MoneyBox.js +1 -1
- package/src/components/Organisms/WYMDCarousel/__snapshots__/WYMDCarousel.test.js.snap +75 -19
- package/src/theme/crTheme/fontConfig.js +211 -0
- package/src/theme/crTheme/fontHelper.js +31 -0
- package/src/theme/shared/breakpoints2026.js +11 -2
- package/src/theme/shared/global.css +3 -1
|
@@ -18,12 +18,19 @@ it('renders correctly', () => {
|
|
|
18
18
|
expect(tree).toMatchInlineSnapshot(`
|
|
19
19
|
Array [
|
|
20
20
|
.c2 {
|
|
21
|
-
font-
|
|
22
|
-
|
|
21
|
+
font-family: 'Montserrat',Helvetica,Arial,sans-serif;
|
|
22
|
+
font-weight: 400;
|
|
23
23
|
text-transform: inherit;
|
|
24
|
+
-webkit-letter-spacing: 0;
|
|
25
|
+
-moz-letter-spacing: 0;
|
|
26
|
+
-ms-letter-spacing: 0;
|
|
27
|
+
letter-spacing: 0;
|
|
28
|
+
font-size: 1rem;
|
|
29
|
+
line-height: 1.25rem;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.c2 {
|
|
24
33
|
font-weight: bold;
|
|
25
|
-
line-height: normal;
|
|
26
|
-
font-family: 'Montserrat',Helvetica,Arial,sans-serif;
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
.c0 {
|
|
@@ -75,6 +82,20 @@ it('renders correctly', () => {
|
|
|
75
82
|
border: 1px solid #E52630;
|
|
76
83
|
}
|
|
77
84
|
|
|
85
|
+
@media (min-width:740px) {
|
|
86
|
+
.c2 {
|
|
87
|
+
font-size: 1rem;
|
|
88
|
+
line-height: 1.25rem;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@media (min-width:1024px) {
|
|
93
|
+
.c2 {
|
|
94
|
+
font-size: 1.125rem;
|
|
95
|
+
line-height: 1.375rem;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
78
99
|
<label
|
|
79
100
|
className="c0"
|
|
80
101
|
htmlFor="sport1"
|
|
@@ -90,18 +111,24 @@ it('renders correctly', () => {
|
|
|
90
111
|
<span
|
|
91
112
|
className="c2"
|
|
92
113
|
color="inherit"
|
|
93
|
-
size="s"
|
|
94
114
|
>
|
|
95
115
|
Tennis
|
|
96
116
|
</span>
|
|
97
117
|
</label>,
|
|
98
118
|
.c2 {
|
|
99
|
-
font-
|
|
100
|
-
|
|
119
|
+
font-family: 'Montserrat',Helvetica,Arial,sans-serif;
|
|
120
|
+
font-weight: 400;
|
|
101
121
|
text-transform: inherit;
|
|
122
|
+
-webkit-letter-spacing: 0;
|
|
123
|
+
-moz-letter-spacing: 0;
|
|
124
|
+
-ms-letter-spacing: 0;
|
|
125
|
+
letter-spacing: 0;
|
|
126
|
+
font-size: 1rem;
|
|
127
|
+
line-height: 1.25rem;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.c2 {
|
|
102
131
|
font-weight: bold;
|
|
103
|
-
line-height: normal;
|
|
104
|
-
font-family: 'Montserrat',Helvetica,Arial,sans-serif;
|
|
105
132
|
}
|
|
106
133
|
|
|
107
134
|
.c0 {
|
|
@@ -153,6 +180,20 @@ it('renders correctly', () => {
|
|
|
153
180
|
border: 1px solid #E52630;
|
|
154
181
|
}
|
|
155
182
|
|
|
183
|
+
@media (min-width:740px) {
|
|
184
|
+
.c2 {
|
|
185
|
+
font-size: 1rem;
|
|
186
|
+
line-height: 1.25rem;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
@media (min-width:1024px) {
|
|
191
|
+
.c2 {
|
|
192
|
+
font-size: 1.125rem;
|
|
193
|
+
line-height: 1.375rem;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
156
197
|
<label
|
|
157
198
|
className="c0"
|
|
158
199
|
htmlFor="sport2"
|
|
@@ -168,7 +209,6 @@ it('renders correctly', () => {
|
|
|
168
209
|
<span
|
|
169
210
|
className="c2"
|
|
170
211
|
color="inherit"
|
|
171
|
-
size="s"
|
|
172
212
|
>
|
|
173
213
|
Handball
|
|
174
214
|
</span>
|
|
@@ -2,12 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`renders correctly 1`] = `
|
|
4
4
|
.c0 {
|
|
5
|
-
|
|
6
|
-
font-
|
|
7
|
-
line-height: 0.875rem;
|
|
5
|
+
font-family: 'Montserrat',Helvetica,Arial,sans-serif;
|
|
6
|
+
font-weight: 400;
|
|
8
7
|
text-transform: inherit;
|
|
8
|
+
-webkit-letter-spacing: 0;
|
|
9
|
+
-moz-letter-spacing: 0;
|
|
10
|
+
-ms-letter-spacing: 0;
|
|
11
|
+
letter-spacing: 0;
|
|
12
|
+
font-size: 1rem;
|
|
13
|
+
line-height: 1.25rem;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.c0 {
|
|
17
|
+
font-size: 0.875rem;
|
|
9
18
|
line-height: normal;
|
|
10
|
-
|
|
19
|
+
color: #E52630;
|
|
11
20
|
}
|
|
12
21
|
|
|
13
22
|
.c1 {
|
|
@@ -18,6 +27,20 @@ exports[`renders correctly 1`] = `
|
|
|
18
27
|
margin-top: 0.6rem;
|
|
19
28
|
}
|
|
20
29
|
|
|
30
|
+
@media (min-width:740px) {
|
|
31
|
+
.c0 {
|
|
32
|
+
font-size: 1rem;
|
|
33
|
+
line-height: 1.25rem;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@media (min-width:1024px) {
|
|
38
|
+
.c0 {
|
|
39
|
+
font-size: 1.125rem;
|
|
40
|
+
line-height: 1.375rem;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
21
44
|
<span
|
|
22
45
|
className="c0"
|
|
23
46
|
color="red"
|
|
@@ -50,7 +50,7 @@ const InputField = _styledComponents.default.input.withConfig({
|
|
|
50
50
|
error,
|
|
51
51
|
prefixLength
|
|
52
52
|
} = _ref4;
|
|
53
|
-
return (0, _styledComponents.css)(["position:relative;box-sizing:border-box;width:100%;height:48px;padding:1rem 2.4rem 1rem 1.5rem;", " background-color:", ";border:1px solid;border-color:", ";box-shadow:none;appearance:none;color:", ";border-radius:0.5rem;font-size:inherit;z-index:2;font-family:
|
|
53
|
+
return (0, _styledComponents.css)(["position:relative;box-sizing:border-box;width:100%;height:48px;padding:1rem 2.4rem 1rem 1.5rem;", " background-color:", ";border:1px solid;border-color:", ";box-shadow:none;appearance:none;color:", ";border-radius:0.5rem;font-size:inherit;z-index:2;font-family:inherit;:focus{border:1px solid ", ";}"], prefixLength > 0 ? `padding-left: ${getPrefixWidth(prefixLength)};` : '', theme.color('grey_light'), error ? theme.color('red') : theme.color('grey'), theme.color('black'), theme.color('grey_for_forms'));
|
|
54
54
|
});
|
|
55
55
|
const ErrorIconWrapper = _styledComponents.default.div.withConfig({
|
|
56
56
|
displayName: "Input__ErrorIconWrapper",
|
|
@@ -73,13 +73,8 @@ const Prefix = _styledComponents.default.div.withConfig({
|
|
|
73
73
|
const DescriptionWrapper = _styledComponents.default.div.withConfig({
|
|
74
74
|
displayName: "Input__DescriptionWrapper",
|
|
75
75
|
componentId: "sc-bcqy1o-5"
|
|
76
|
-
})(["margin-bottom:0.5rem;*{font-size:
|
|
77
|
-
|
|
78
|
-
theme
|
|
79
|
-
} = _ref7;
|
|
80
|
-
return theme.fontSize('xs');
|
|
81
|
-
});
|
|
82
|
-
const Input = /*#__PURE__*/_react.default.forwardRef((_ref8, ref) => {
|
|
76
|
+
})(["margin-bottom:0.5rem;*{font-size:0.875rem;}"]);
|
|
77
|
+
const Input = /*#__PURE__*/_react.default.forwardRef((_ref7, ref) => {
|
|
83
78
|
let {
|
|
84
79
|
errorMsg = '',
|
|
85
80
|
id,
|
|
@@ -95,7 +90,7 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref8, ref) => {
|
|
|
95
90
|
maxPxWidthLargeBreakpoint,
|
|
96
91
|
description = null,
|
|
97
92
|
...rest
|
|
98
|
-
} =
|
|
93
|
+
} = _ref7;
|
|
99
94
|
return /*#__PURE__*/_react.default.createElement(_Label.default, Object.assign({
|
|
100
95
|
className: className,
|
|
101
96
|
htmlFor: id,
|
|
@@ -16,11 +16,15 @@ it('renders correctly', () => {
|
|
|
16
16
|
})).toJSON();
|
|
17
17
|
expect(tree).toMatchInlineSnapshot(`
|
|
18
18
|
.c1 {
|
|
19
|
-
font-size: 1rem;
|
|
20
|
-
line-height: 1rem;
|
|
21
|
-
text-transform: inherit;
|
|
22
|
-
line-height: normal;
|
|
23
19
|
font-family: 'Montserrat',Helvetica,Arial,sans-serif;
|
|
20
|
+
font-weight: 400;
|
|
21
|
+
text-transform: inherit;
|
|
22
|
+
-webkit-letter-spacing: 0;
|
|
23
|
+
-moz-letter-spacing: 0;
|
|
24
|
+
-ms-letter-spacing: 0;
|
|
25
|
+
letter-spacing: 0;
|
|
26
|
+
font-size: 1rem;
|
|
27
|
+
line-height: 1.25rem;
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
.c0 {
|
|
@@ -38,7 +42,15 @@ it('renders correctly', () => {
|
|
|
38
42
|
|
|
39
43
|
.c2 {
|
|
40
44
|
margin-bottom: 0.5rem;
|
|
41
|
-
font-
|
|
45
|
+
font-family: 'Montserrat',Helvetica,Arial,sans-serif;
|
|
46
|
+
font-weight: 400;
|
|
47
|
+
text-transform: inherit;
|
|
48
|
+
-webkit-letter-spacing: 0;
|
|
49
|
+
-moz-letter-spacing: 0;
|
|
50
|
+
-ms-letter-spacing: 0;
|
|
51
|
+
letter-spacing: 0;
|
|
52
|
+
font-size: 1rem;
|
|
53
|
+
line-height: 1.25rem;
|
|
42
54
|
}
|
|
43
55
|
|
|
44
56
|
.c3 {
|
|
@@ -80,13 +92,41 @@ it('renders correctly', () => {
|
|
|
80
92
|
border-radius: 0.5rem;
|
|
81
93
|
font-size: inherit;
|
|
82
94
|
z-index: 2;
|
|
83
|
-
font-family:
|
|
95
|
+
font-family: inherit;
|
|
84
96
|
}
|
|
85
97
|
|
|
86
98
|
.c5:focus {
|
|
87
99
|
border: 1px solid #666;
|
|
88
100
|
}
|
|
89
101
|
|
|
102
|
+
@media (min-width:740px) {
|
|
103
|
+
.c1 {
|
|
104
|
+
font-size: 1rem;
|
|
105
|
+
line-height: 1.25rem;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@media (min-width:1024px) {
|
|
110
|
+
.c1 {
|
|
111
|
+
font-size: 1.125rem;
|
|
112
|
+
line-height: 1.375rem;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@media (min-width:740px) {
|
|
117
|
+
.c2 {
|
|
118
|
+
font-size: 1rem;
|
|
119
|
+
line-height: 1.25rem;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@media (min-width:1024px) {
|
|
124
|
+
.c2 {
|
|
125
|
+
font-size: 1rem;
|
|
126
|
+
line-height: 1.25rem;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
90
130
|
@media (min-width:740px) {
|
|
91
131
|
|
|
92
132
|
}
|
|
@@ -107,7 +147,6 @@ it('renders correctly', () => {
|
|
|
107
147
|
"__html": "Label",
|
|
108
148
|
}
|
|
109
149
|
}
|
|
110
|
-
size="s"
|
|
111
150
|
/>
|
|
112
151
|
<div
|
|
113
152
|
className="c3"
|
|
@@ -144,11 +183,15 @@ it('renders with responsive max widths correctly', () => {
|
|
|
144
183
|
})).toJSON();
|
|
145
184
|
expect(tree).toMatchInlineSnapshot(`
|
|
146
185
|
.c1 {
|
|
147
|
-
font-size: 1rem;
|
|
148
|
-
line-height: 1rem;
|
|
149
|
-
text-transform: inherit;
|
|
150
|
-
line-height: normal;
|
|
151
186
|
font-family: 'Montserrat',Helvetica,Arial,sans-serif;
|
|
187
|
+
font-weight: 400;
|
|
188
|
+
text-transform: inherit;
|
|
189
|
+
-webkit-letter-spacing: 0;
|
|
190
|
+
-moz-letter-spacing: 0;
|
|
191
|
+
-ms-letter-spacing: 0;
|
|
192
|
+
letter-spacing: 0;
|
|
193
|
+
font-size: 1rem;
|
|
194
|
+
line-height: 1.25rem;
|
|
152
195
|
}
|
|
153
196
|
|
|
154
197
|
.c0 {
|
|
@@ -166,7 +209,15 @@ it('renders with responsive max widths correctly', () => {
|
|
|
166
209
|
|
|
167
210
|
.c2 {
|
|
168
211
|
margin-bottom: 0.5rem;
|
|
169
|
-
font-
|
|
212
|
+
font-family: 'Montserrat',Helvetica,Arial,sans-serif;
|
|
213
|
+
font-weight: 400;
|
|
214
|
+
text-transform: inherit;
|
|
215
|
+
-webkit-letter-spacing: 0;
|
|
216
|
+
-moz-letter-spacing: 0;
|
|
217
|
+
-ms-letter-spacing: 0;
|
|
218
|
+
letter-spacing: 0;
|
|
219
|
+
font-size: 1rem;
|
|
220
|
+
line-height: 1.25rem;
|
|
170
221
|
}
|
|
171
222
|
|
|
172
223
|
.c3 {
|
|
@@ -208,13 +259,41 @@ it('renders with responsive max widths correctly', () => {
|
|
|
208
259
|
border-radius: 0.5rem;
|
|
209
260
|
font-size: inherit;
|
|
210
261
|
z-index: 2;
|
|
211
|
-
font-family:
|
|
262
|
+
font-family: inherit;
|
|
212
263
|
}
|
|
213
264
|
|
|
214
265
|
.c5:focus {
|
|
215
266
|
border: 1px solid #666;
|
|
216
267
|
}
|
|
217
268
|
|
|
269
|
+
@media (min-width:740px) {
|
|
270
|
+
.c1 {
|
|
271
|
+
font-size: 1rem;
|
|
272
|
+
line-height: 1.25rem;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
@media (min-width:1024px) {
|
|
277
|
+
.c1 {
|
|
278
|
+
font-size: 1.125rem;
|
|
279
|
+
line-height: 1.375rem;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
@media (min-width:740px) {
|
|
284
|
+
.c2 {
|
|
285
|
+
font-size: 1rem;
|
|
286
|
+
line-height: 1.25rem;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
@media (min-width:1024px) {
|
|
291
|
+
.c2 {
|
|
292
|
+
font-size: 1rem;
|
|
293
|
+
line-height: 1.25rem;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
218
297
|
@media (min-width:740px) {
|
|
219
298
|
.c4 {
|
|
220
299
|
max-width: 150px;
|
|
@@ -239,7 +318,6 @@ it('renders with responsive max widths correctly', () => {
|
|
|
239
318
|
"__html": "Responsive Width Input",
|
|
240
319
|
}
|
|
241
320
|
}
|
|
242
|
-
size="s"
|
|
243
321
|
/>
|
|
244
322
|
<div
|
|
245
323
|
className="c3"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
@@ -7,10 +8,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
8
|
exports.default = void 0;
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
-
var _styledComponents =
|
|
11
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
12
|
var _Text = _interopRequireDefault(require("../Text/Text"));
|
|
12
13
|
var _spacing = _interopRequireDefault(require("../../../theme/shared/spacing"));
|
|
13
14
|
var _hideVisually = _interopRequireDefault(require("../../../theme/shared/hideVisually"));
|
|
15
|
+
var _fontHelper = _interopRequireDefault(require("../../../theme/crTheme/fontHelper"));
|
|
14
16
|
const getLabelColor = _ref => {
|
|
15
17
|
let {
|
|
16
18
|
theme,
|
|
@@ -35,26 +37,31 @@ const LabelElement = _styledComponents.default.label.withConfig({
|
|
|
35
37
|
top: 0;
|
|
36
38
|
right: 0;
|
|
37
39
|
content: 'Optional';
|
|
38
|
-
font-family:
|
|
40
|
+
font-family: inherit;
|
|
39
41
|
font-size: ${theme.fontSize('s')};
|
|
40
42
|
}`;
|
|
41
43
|
});
|
|
42
44
|
const VisibleText = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
43
45
|
displayName: "Label__VisibleText",
|
|
44
46
|
componentId: "sc-2nrw50-1"
|
|
45
|
-
})(["margin-bottom:", ";
|
|
47
|
+
})(["margin-bottom:", ";", ";"], (0, _spacing.default)('sm'), _ref3 => {
|
|
48
|
+
let {
|
|
49
|
+
theme
|
|
50
|
+
} = _ref3;
|
|
51
|
+
return (0, _styledComponents.css)(["", ""], (0, _fontHelper.default)(theme, 'formFieldLabel'));
|
|
52
|
+
});
|
|
46
53
|
const HiddenText = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
47
54
|
displayName: "Label__HiddenText",
|
|
48
55
|
componentId: "sc-2nrw50-2"
|
|
49
56
|
})(["", ""], _hideVisually.default);
|
|
50
57
|
|
|
51
58
|
// eslint-disable-next-line react/prop-types
|
|
52
|
-
const LabelText =
|
|
59
|
+
const LabelText = _ref4 => {
|
|
53
60
|
let {
|
|
54
61
|
label,
|
|
55
62
|
hideLabel,
|
|
56
63
|
...rest
|
|
57
|
-
} =
|
|
64
|
+
} = _ref4;
|
|
58
65
|
const Component = hideLabel ? HiddenText : VisibleText;
|
|
59
66
|
return /*#__PURE__*/_react.default.isValidElement(label) ? /*#__PURE__*/_react.default.createElement(Component, rest, label) : /*#__PURE__*/_react.default.createElement(Component, Object.assign({}, rest, {
|
|
60
67
|
dangerouslySetInnerHTML: {
|
|
@@ -71,7 +78,7 @@ const LabelText = _ref3 => {
|
|
|
71
78
|
* @returns {JSX.Element}
|
|
72
79
|
* @constructor
|
|
73
80
|
*/
|
|
74
|
-
const Label =
|
|
81
|
+
const Label = _ref5 => {
|
|
75
82
|
let {
|
|
76
83
|
children = null,
|
|
77
84
|
label,
|
|
@@ -79,7 +86,7 @@ const Label = _ref4 => {
|
|
|
79
86
|
optional = null,
|
|
80
87
|
errorMsg = '',
|
|
81
88
|
...rest
|
|
82
|
-
} =
|
|
89
|
+
} = _ref5;
|
|
83
90
|
return /*#__PURE__*/_react.default.createElement(LabelElement, Object.assign({
|
|
84
91
|
optional: optional,
|
|
85
92
|
errorMsg: errorMsg
|
|
@@ -20,12 +20,19 @@ it('renders correctly', () => {
|
|
|
20
20
|
expect(tree).toMatchInlineSnapshot(`
|
|
21
21
|
Array [
|
|
22
22
|
.c2 {
|
|
23
|
-
font-
|
|
24
|
-
|
|
23
|
+
font-family: 'Montserrat',Helvetica,Arial,sans-serif;
|
|
24
|
+
font-weight: 400;
|
|
25
25
|
text-transform: inherit;
|
|
26
|
+
-webkit-letter-spacing: 0;
|
|
27
|
+
-moz-letter-spacing: 0;
|
|
28
|
+
-ms-letter-spacing: 0;
|
|
29
|
+
letter-spacing: 0;
|
|
30
|
+
font-size: 1rem;
|
|
31
|
+
line-height: 1.25rem;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.c2 {
|
|
26
35
|
font-weight: bold;
|
|
27
|
-
line-height: normal;
|
|
28
|
-
font-family: 'Montserrat',Helvetica,Arial,sans-serif;
|
|
29
36
|
}
|
|
30
37
|
|
|
31
38
|
.c1 {
|
|
@@ -86,6 +93,20 @@ it('renders correctly', () => {
|
|
|
86
93
|
position: relative;
|
|
87
94
|
}
|
|
88
95
|
|
|
96
|
+
@media (min-width:740px) {
|
|
97
|
+
.c2 {
|
|
98
|
+
font-size: 1rem;
|
|
99
|
+
line-height: 1.25rem;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@media (min-width:1024px) {
|
|
104
|
+
.c2 {
|
|
105
|
+
font-size: 1.125rem;
|
|
106
|
+
line-height: 1.375rem;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
89
110
|
<label
|
|
90
111
|
className="c0"
|
|
91
112
|
htmlFor="male"
|
|
@@ -101,18 +122,24 @@ it('renders correctly', () => {
|
|
|
101
122
|
<span
|
|
102
123
|
className="c2"
|
|
103
124
|
color="inherit"
|
|
104
|
-
size="s"
|
|
105
125
|
>
|
|
106
126
|
Male
|
|
107
127
|
</span>
|
|
108
128
|
</label>,
|
|
109
129
|
.c2 {
|
|
110
|
-
font-
|
|
111
|
-
|
|
130
|
+
font-family: 'Montserrat',Helvetica,Arial,sans-serif;
|
|
131
|
+
font-weight: 400;
|
|
112
132
|
text-transform: inherit;
|
|
133
|
+
-webkit-letter-spacing: 0;
|
|
134
|
+
-moz-letter-spacing: 0;
|
|
135
|
+
-ms-letter-spacing: 0;
|
|
136
|
+
letter-spacing: 0;
|
|
137
|
+
font-size: 1rem;
|
|
138
|
+
line-height: 1.25rem;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.c2 {
|
|
113
142
|
font-weight: bold;
|
|
114
|
-
line-height: normal;
|
|
115
|
-
font-family: 'Montserrat',Helvetica,Arial,sans-serif;
|
|
116
143
|
}
|
|
117
144
|
|
|
118
145
|
.c1 {
|
|
@@ -173,6 +200,20 @@ it('renders correctly', () => {
|
|
|
173
200
|
position: relative;
|
|
174
201
|
}
|
|
175
202
|
|
|
203
|
+
@media (min-width:740px) {
|
|
204
|
+
.c2 {
|
|
205
|
+
font-size: 1rem;
|
|
206
|
+
line-height: 1.25rem;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
@media (min-width:1024px) {
|
|
211
|
+
.c2 {
|
|
212
|
+
font-size: 1.125rem;
|
|
213
|
+
line-height: 1.375rem;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
176
217
|
<label
|
|
177
218
|
className="c0"
|
|
178
219
|
htmlFor="female"
|
|
@@ -188,7 +229,6 @@ it('renders correctly', () => {
|
|
|
188
229
|
<span
|
|
189
230
|
className="c2"
|
|
190
231
|
color="inherit"
|
|
191
|
-
size="s"
|
|
192
232
|
>
|
|
193
233
|
Female
|
|
194
234
|
</span>
|
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`renders correctly 1`] = `
|
|
4
4
|
.c1 {
|
|
5
|
-
font-size: 1rem;
|
|
6
|
-
line-height: 1rem;
|
|
7
|
-
text-transform: inherit;
|
|
8
|
-
line-height: normal;
|
|
9
5
|
font-family: 'Montserrat',Helvetica,Arial,sans-serif;
|
|
6
|
+
font-weight: 400;
|
|
7
|
+
text-transform: inherit;
|
|
8
|
+
-webkit-letter-spacing: 0;
|
|
9
|
+
-moz-letter-spacing: 0;
|
|
10
|
+
-ms-letter-spacing: 0;
|
|
11
|
+
letter-spacing: 0;
|
|
12
|
+
font-size: 1rem;
|
|
13
|
+
line-height: 1.25rem;
|
|
10
14
|
}
|
|
11
15
|
|
|
12
16
|
.c0 {
|
|
@@ -24,7 +28,15 @@ exports[`renders correctly 1`] = `
|
|
|
24
28
|
|
|
25
29
|
.c2 {
|
|
26
30
|
margin-bottom: 0.5rem;
|
|
27
|
-
font-
|
|
31
|
+
font-family: 'Montserrat',Helvetica,Arial,sans-serif;
|
|
32
|
+
font-weight: 400;
|
|
33
|
+
text-transform: inherit;
|
|
34
|
+
-webkit-letter-spacing: 0;
|
|
35
|
+
-moz-letter-spacing: 0;
|
|
36
|
+
-ms-letter-spacing: 0;
|
|
37
|
+
letter-spacing: 0;
|
|
38
|
+
font-size: 1rem;
|
|
39
|
+
line-height: 1.25rem;
|
|
28
40
|
}
|
|
29
41
|
|
|
30
42
|
.c3 {
|
|
@@ -55,6 +67,34 @@ exports[`renders correctly 1`] = `
|
|
|
55
67
|
border: 1px solid #666;
|
|
56
68
|
}
|
|
57
69
|
|
|
70
|
+
@media (min-width:740px) {
|
|
71
|
+
.c1 {
|
|
72
|
+
font-size: 1rem;
|
|
73
|
+
line-height: 1.25rem;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@media (min-width:1024px) {
|
|
78
|
+
.c1 {
|
|
79
|
+
font-size: 1.125rem;
|
|
80
|
+
line-height: 1.375rem;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@media (min-width:740px) {
|
|
85
|
+
.c2 {
|
|
86
|
+
font-size: 1rem;
|
|
87
|
+
line-height: 1.25rem;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@media (min-width:1024px) {
|
|
92
|
+
.c2 {
|
|
93
|
+
font-size: 1rem;
|
|
94
|
+
line-height: 1.25rem;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
58
98
|
@media (min-width:740px) {
|
|
59
99
|
.c3 {
|
|
60
100
|
max-width: 290px;
|
|
@@ -72,7 +112,6 @@ exports[`renders correctly 1`] = `
|
|
|
72
112
|
"__html": "Label",
|
|
73
113
|
}
|
|
74
114
|
}
|
|
75
|
-
size="s"
|
|
76
115
|
/>
|
|
77
116
|
<select
|
|
78
117
|
aria-required={true}
|