@comicrelief/component-library 8.50.0 → 8.51.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.
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.default = void 0;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
10
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
11
+ var _Text = _interopRequireDefault(require("../../Atoms/Text/Text"));
11
12
  var _spacing = _interopRequireDefault(require("../../../theme/shared/spacing"));
12
13
  var _index = require("../../Atoms/Icons/index");
13
14
  const Container = _styledComponents.default.div.withConfig({
@@ -53,6 +54,10 @@ const Copy = _styledComponents.default.div.withConfig({
53
54
  return theme.allBreakpoints('M');
54
55
  }, (0, _spacing.default)('lg'), contentBottomPadding || (0, _spacing.default)('l'));
55
56
  });
57
+ const StyledText = (0, _styledComponents.default)(_Text.default).withConfig({
58
+ displayName: "Accordion__StyledText",
59
+ componentId: "sc-19u0s0h-4"
60
+ })(["margin-bottom:0;"]);
56
61
  const Accordion = _ref6 => {
57
62
  let {
58
63
  children,
@@ -69,7 +74,9 @@ const Accordion = _ref6 => {
69
74
  "aria-expanded": isOpen ? 'true' : 'false',
70
75
  ChevronKeyframes: ChevronKeyframes,
71
76
  type: "button"
72
- }, title, /*#__PURE__*/_react.default.createElement(Icon, null, /*#__PURE__*/_react.default.createElement(_index.Chevron, {
77
+ }, /*#__PURE__*/_react.default.createElement(StyledText, {
78
+ tag: "h3"
79
+ }, title), /*#__PURE__*/_react.default.createElement(Icon, null, /*#__PURE__*/_react.default.createElement(_index.Chevron, {
73
80
  colour: "black",
74
81
  direction: isOpen ? 'up' : 'down'
75
82
  }))), /*#__PURE__*/_react.default.createElement(Copy, {
@@ -2,6 +2,23 @@
2
2
 
3
3
  exports[`renders correctly 1`] = `
4
4
  .c2 {
5
+ font-family: 'Montserrat',Helvetica,Arial,sans-serif;
6
+ font-weight: 700;
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: 1.25rem;
13
+ line-height: 1.5rem;
14
+ }
15
+
16
+ .c2 span {
17
+ font-size: inherit;
18
+ line-height: inherit;
19
+ }
20
+
21
+ .c4 {
5
22
  font-family: 'Anton',Impact,sans-serif;
6
23
  font-weight: 400;
7
24
  text-transform: uppercase;
@@ -13,17 +30,17 @@ exports[`renders correctly 1`] = `
13
30
  line-height: 1.5rem;
14
31
  }
15
32
 
16
- .c2 {
33
+ .c4 {
17
34
  font-size: 1.5rem;
18
35
  line-height: normal;
19
36
  }
20
37
 
21
- .c2 span {
38
+ .c4 span {
22
39
  font-size: inherit;
23
40
  line-height: inherit;
24
41
  }
25
42
 
26
- .c6 {
43
+ .c8 {
27
44
  font-family: 'Montserrat',Helvetica,Arial,sans-serif;
28
45
  font-weight: 400;
29
46
  text-transform: inherit;
@@ -35,17 +52,17 @@ exports[`renders correctly 1`] = `
35
52
  line-height: 1.25rem;
36
53
  }
37
54
 
38
- .c6 {
55
+ .c8 {
39
56
  font-size: 1rem;
40
57
  line-height: normal;
41
58
  }
42
59
 
43
- .c6 span {
60
+ .c8 span {
44
61
  font-size: inherit;
45
62
  line-height: inherit;
46
63
  }
47
64
 
48
- .c4 {
65
+ .c6 {
49
66
  -webkit-transform: rotate(180deg);
50
67
  -ms-transform: rotate(180deg);
51
68
  transform: rotate(180deg);
@@ -95,7 +112,7 @@ exports[`renders correctly 1`] = `
95
112
  animation-duration: 0.4s;
96
113
  }
97
114
 
98
- .c3 {
115
+ .c5 {
99
116
  display: -webkit-box;
100
117
  display: -webkit-flex;
101
118
  display: -ms-flexbox;
@@ -109,7 +126,7 @@ exports[`renders correctly 1`] = `
109
126
  align-content: center;
110
127
  }
111
128
 
112
- .c5 {
129
+ .c7 {
113
130
  overflow: hidden;
114
131
  height: 0;
115
132
  visibility: none;
@@ -118,36 +135,54 @@ exports[`renders correctly 1`] = `
118
135
  padding: 0 2rem;
119
136
  }
120
137
 
138
+ .c3 {
139
+ margin-bottom: 0;
140
+ }
141
+
121
142
  @media (min-width:740px) {
122
143
  .c2 {
144
+ font-size: 1.25rem;
145
+ line-height: 1.5rem;
146
+ }
147
+ }
148
+
149
+ @media (min-width:1024px) {
150
+ .c2 {
151
+ font-size: 1.375rem;
152
+ line-height: 1.625rem;
153
+ }
154
+ }
155
+
156
+ @media (min-width:740px) {
157
+ .c4 {
123
158
  font-size: 1.875rem;
124
159
  line-height: 1.875rem;
125
160
  }
126
161
  }
127
162
 
128
163
  @media (min-width:1024px) {
129
- .c2 {
164
+ .c4 {
130
165
  font-size: 2rem;
131
166
  line-height: 2rem;
132
167
  }
133
168
  }
134
169
 
135
170
  @media (min-width:740px) {
136
- .c6 {
171
+ .c8 {
137
172
  font-size: 1rem;
138
173
  line-height: 1.25rem;
139
174
  }
140
175
  }
141
176
 
142
177
  @media (min-width:1024px) {
143
- .c6 {
178
+ .c8 {
144
179
  font-size: 1.125rem;
145
180
  line-height: 1.375rem;
146
181
  }
147
182
  }
148
183
 
149
184
  @media (min-width:1024px) {
150
- .c4 {
185
+ .c6 {
151
186
  fill: #000000;
152
187
  }
153
188
  }
@@ -159,7 +194,7 @@ exports[`renders correctly 1`] = `
159
194
  }
160
195
 
161
196
  @media (min-width:740px) {
162
- .c5 {
197
+ .c7 {
163
198
  padding: 0 3rem;
164
199
  }
165
200
  }
@@ -173,16 +208,20 @@ exports[`renders correctly 1`] = `
173
208
  onClick={[Function]}
174
209
  type="button"
175
210
  >
176
- <h2
177
- className="c2"
211
+ <h3
212
+ className="c2 c3"
178
213
  >
179
- I am the title
180
- </h2>
214
+ <h2
215
+ className="c4"
216
+ >
217
+ I am the title
218
+ </h2>
219
+ </h3>
181
220
  <div
182
- className="c3"
221
+ className="c5"
183
222
  >
184
223
  <svg
185
- className="c4"
224
+ className="c6"
186
225
  direction="down"
187
226
  fill="#000000"
188
227
  height={24}
@@ -197,10 +236,10 @@ exports[`renders correctly 1`] = `
197
236
  </div>
198
237
  </button>
199
238
  <div
200
- className="c5"
239
+ className="c7"
201
240
  >
202
241
  <p
203
- className="c6"
242
+ className="c8"
204
243
  >
205
244
  Name, surname, email and billing address We need these to process your payment, create a receipt and send it to you. Establishment information We use this information to understand which institutions (e.g. schools, companies) raise money for us. Your details will be kept safe and never shared with other organisations; see our Privacy Policy for more information
206
245
  </p>
@@ -147,7 +147,6 @@ const ArticleTeaser = _ref15 => {
147
147
  alt = '',
148
148
  category = null,
149
149
  logoSize = null,
150
- family = 'Anton',
151
150
  time = null
152
151
  } = _ref15;
153
152
  return /*#__PURE__*/_react.default.createElement(Wrapper, null, /*#__PURE__*/_react.default.createElement(Link, {
@@ -172,11 +171,7 @@ const ArticleTeaser = _ref15 => {
172
171
  weight: "bold"
173
172
  }, date), /*#__PURE__*/_react.default.createElement(Title, {
174
173
  time: time,
175
- size: "xl",
176
- tag: "h3",
177
- height: "2rem",
178
- weight: "normal",
179
- family: family
174
+ tag: "h3"
180
175
  }, title), time && /*#__PURE__*/_react.default.createElement(Time, {
181
176
  size: "xs",
182
177
  weight: "400",
@@ -54,14 +54,6 @@ it('renders article teaser correctly', () => {
54
54
  line-height: 1.5rem;
55
55
  }
56
56
 
57
- .c10 {
58
- font-size: 2rem;
59
- line-height: normal;
60
- font-family: 'Anton',Impact,sans-serif;
61
- font-weight: normal;
62
- line-height: 2rem;
63
- }
64
-
65
57
  .c10 span {
66
58
  font-size: inherit;
67
59
  line-height: inherit;
@@ -351,14 +343,6 @@ it('renders press realese correctly', () => {
351
343
  line-height: 1.5rem;
352
344
  }
353
345
 
354
- .c10 {
355
- font-size: 2rem;
356
- line-height: normal;
357
- font-family: 'Anton',Impact,sans-serif;
358
- font-weight: normal;
359
- line-height: 2rem;
360
- }
361
-
362
346
  .c10 span {
363
347
  font-size: inherit;
364
348
  line-height: inherit;
@@ -141,11 +141,7 @@ const Descriptor = _ref3 => {
141
141
  color: "grey_dark",
142
142
  family: "Montserrat"
143
143
  }, date), /*#__PURE__*/_react.default.createElement(IconWrapper, null, icons)), /*#__PURE__*/_react.default.createElement(Title, {
144
- size: "xl",
145
- tag: "h3",
146
- height: "2rem",
147
- weight: "normal",
148
- family: "Anton"
144
+ tag: "h3"
149
145
  }, title), /*#__PURE__*/_react.default.createElement(TagWrapper, null, tagItems), /*#__PURE__*/_react.default.createElement(Description, null, children)));
150
146
  };
151
147
  var _default = exports.default = Descriptor;
@@ -52,14 +52,6 @@ it('renders article teaser correctly', () => {
52
52
  line-height: 1.5rem;
53
53
  }
54
54
 
55
- .c7 {
56
- font-size: 2rem;
57
- line-height: normal;
58
- font-family: 'Anton',Impact,sans-serif;
59
- font-weight: normal;
60
- line-height: 2rem;
61
- }
62
-
63
55
  .c7 span {
64
56
  font-size: inherit;
65
57
  line-height: inherit;
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- const allowList = ['https://giftaid.comicrelief.com', 'https://donation.comicrelief.com', 'https://www.comicrelief.com', 'https://www.sportrelief.com', 'https://app.beapplied.com/org/comic-relief', 'stories.comicrelief.com', 'https://form.typeform.com'];
7
+ const allowList = ['https://giftaid.comicrelief.com', 'https://donation.comicrelief.com', 'https://www.comicrelief.com', 'https://www.sportrelief.com', 'https://app.beapplied.com/org/comic-relief', 'stories.comicrelief.com', 'https://form.typeform.com',
8
+ // Required for the HHoF form:
9
+ 'https://interfaces.zapier.com/assets/web-components/zapier-interfaces/zapier-interfaces.esm.js'];
8
10
  const allowListed = url => {
9
11
  if (url !== undefined && url !== null && allowList.some(v => url.indexOf(v) >= 0)) {
10
12
  return true;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@comicrelief/component-library",
3
3
  "author": "Comic Relief Engineering Team",
4
- "version": "8.50.0",
4
+ "version": "8.51.0",
5
5
  "main": "dist/index.js",
6
6
  "license": "ISC",
7
7
  "jest": {
@@ -1,6 +1,7 @@
1
1
  import React, { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled, { css, keyframes } from 'styled-components';
4
+ import Text from '../../Atoms/Text/Text';
4
5
 
5
6
  import spacing from '../../../theme/shared/spacing';
6
7
  import { Chevron } from '../../Atoms/Icons/index';
@@ -72,6 +73,10 @@ const Copy = styled.div`
72
73
  `)}
73
74
  `;
74
75
 
76
+ const StyledText = styled(Text)`
77
+ margin-bottom: 0;
78
+ `;
79
+
75
80
  const Accordion = ({
76
81
  children, title, contentBottomPadding, ...rest
77
82
  }) => {
@@ -84,7 +89,9 @@ const Accordion = ({
84
89
  return (
85
90
  <Container {...rest}>
86
91
  <Button onClick={handleOpen} aria-expanded={isOpen ? 'true' : 'false'} ChevronKeyframes={ChevronKeyframes} type="button">
87
- {title}
92
+ <StyledText tag="h3">
93
+ {title}
94
+ </StyledText>
88
95
  <Icon>
89
96
  <Chevron colour="black" direction={isOpen ? 'up' : 'down'} />
90
97
  </Icon>
@@ -2,6 +2,23 @@
2
2
 
3
3
  exports[`renders correctly 1`] = `
4
4
  .c2 {
5
+ font-family: 'Montserrat',Helvetica,Arial,sans-serif;
6
+ font-weight: 700;
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: 1.25rem;
13
+ line-height: 1.5rem;
14
+ }
15
+
16
+ .c2 span {
17
+ font-size: inherit;
18
+ line-height: inherit;
19
+ }
20
+
21
+ .c4 {
5
22
  font-family: 'Anton',Impact,sans-serif;
6
23
  font-weight: 400;
7
24
  text-transform: uppercase;
@@ -13,17 +30,17 @@ exports[`renders correctly 1`] = `
13
30
  line-height: 1.5rem;
14
31
  }
15
32
 
16
- .c2 {
33
+ .c4 {
17
34
  font-size: 1.5rem;
18
35
  line-height: normal;
19
36
  }
20
37
 
21
- .c2 span {
38
+ .c4 span {
22
39
  font-size: inherit;
23
40
  line-height: inherit;
24
41
  }
25
42
 
26
- .c6 {
43
+ .c8 {
27
44
  font-family: 'Montserrat',Helvetica,Arial,sans-serif;
28
45
  font-weight: 400;
29
46
  text-transform: inherit;
@@ -35,17 +52,17 @@ exports[`renders correctly 1`] = `
35
52
  line-height: 1.25rem;
36
53
  }
37
54
 
38
- .c6 {
55
+ .c8 {
39
56
  font-size: 1rem;
40
57
  line-height: normal;
41
58
  }
42
59
 
43
- .c6 span {
60
+ .c8 span {
44
61
  font-size: inherit;
45
62
  line-height: inherit;
46
63
  }
47
64
 
48
- .c4 {
65
+ .c6 {
49
66
  -webkit-transform: rotate(180deg);
50
67
  -ms-transform: rotate(180deg);
51
68
  transform: rotate(180deg);
@@ -95,7 +112,7 @@ exports[`renders correctly 1`] = `
95
112
  animation-duration: 0.4s;
96
113
  }
97
114
 
98
- .c3 {
115
+ .c5 {
99
116
  display: -webkit-box;
100
117
  display: -webkit-flex;
101
118
  display: -ms-flexbox;
@@ -109,7 +126,7 @@ exports[`renders correctly 1`] = `
109
126
  align-content: center;
110
127
  }
111
128
 
112
- .c5 {
129
+ .c7 {
113
130
  overflow: hidden;
114
131
  height: 0;
115
132
  visibility: none;
@@ -118,36 +135,54 @@ exports[`renders correctly 1`] = `
118
135
  padding: 0 2rem;
119
136
  }
120
137
 
138
+ .c3 {
139
+ margin-bottom: 0;
140
+ }
141
+
121
142
  @media (min-width:740px) {
122
143
  .c2 {
144
+ font-size: 1.25rem;
145
+ line-height: 1.5rem;
146
+ }
147
+ }
148
+
149
+ @media (min-width:1024px) {
150
+ .c2 {
151
+ font-size: 1.375rem;
152
+ line-height: 1.625rem;
153
+ }
154
+ }
155
+
156
+ @media (min-width:740px) {
157
+ .c4 {
123
158
  font-size: 1.875rem;
124
159
  line-height: 1.875rem;
125
160
  }
126
161
  }
127
162
 
128
163
  @media (min-width:1024px) {
129
- .c2 {
164
+ .c4 {
130
165
  font-size: 2rem;
131
166
  line-height: 2rem;
132
167
  }
133
168
  }
134
169
 
135
170
  @media (min-width:740px) {
136
- .c6 {
171
+ .c8 {
137
172
  font-size: 1rem;
138
173
  line-height: 1.25rem;
139
174
  }
140
175
  }
141
176
 
142
177
  @media (min-width:1024px) {
143
- .c6 {
178
+ .c8 {
144
179
  font-size: 1.125rem;
145
180
  line-height: 1.375rem;
146
181
  }
147
182
  }
148
183
 
149
184
  @media (min-width:1024px) {
150
- .c4 {
185
+ .c6 {
151
186
  fill: #000000;
152
187
  }
153
188
  }
@@ -159,7 +194,7 @@ exports[`renders correctly 1`] = `
159
194
  }
160
195
 
161
196
  @media (min-width:740px) {
162
- .c5 {
197
+ .c7 {
163
198
  padding: 0 3rem;
164
199
  }
165
200
  }
@@ -173,16 +208,20 @@ exports[`renders correctly 1`] = `
173
208
  onClick={[Function]}
174
209
  type="button"
175
210
  >
176
- <h2
177
- className="c2"
211
+ <h3
212
+ className="c2 c3"
178
213
  >
179
- I am the title
180
- </h2>
214
+ <h2
215
+ className="c4"
216
+ >
217
+ I am the title
218
+ </h2>
219
+ </h3>
181
220
  <div
182
- className="c3"
221
+ className="c5"
183
222
  >
184
223
  <svg
185
- className="c4"
224
+ className="c6"
186
225
  direction="down"
187
226
  fill="#000000"
188
227
  height={24}
@@ -197,10 +236,10 @@ exports[`renders correctly 1`] = `
197
236
  </div>
198
237
  </button>
199
238
  <div
200
- className="c5"
239
+ className="c7"
201
240
  >
202
241
  <p
203
- className="c6"
242
+ className="c8"
204
243
  >
205
244
  Name, surname, email and billing address We need these to process your payment, create a receipt and send it to you. Establishment information We use this information to understand which institutions (e.g. schools, companies) raise money for us. Your details will be kept safe and never shared with other organisations; see our Privacy Policy for more information
206
245
  </p>
@@ -141,7 +141,6 @@ const ArticleTeaser = ({
141
141
  alt = '',
142
142
  category = null,
143
143
  logoSize = null,
144
- family = 'Anton',
145
144
  time = null
146
145
  }) => (
147
146
  <Wrapper>
@@ -175,11 +174,7 @@ const ArticleTeaser = ({
175
174
  </Date>
176
175
  <Title
177
176
  time={time}
178
- size="xl"
179
177
  tag="h3"
180
- height="2rem"
181
- weight="normal"
182
- family={family}
183
178
  >
184
179
  {title}
185
180
  </Title>
@@ -198,7 +193,6 @@ ArticleTeaser.propTypes = {
198
193
  image: PropTypes.string,
199
194
  imageLow: PropTypes.string,
200
195
  logoSize: PropTypes.string,
201
- family: PropTypes.string,
202
196
  category: PropTypes.string,
203
197
  alt: PropTypes.string,
204
198
  date: PropTypes.string.isRequired,
@@ -54,14 +54,6 @@ it('renders article teaser correctly', () => {
54
54
  line-height: 1.5rem;
55
55
  }
56
56
 
57
- .c10 {
58
- font-size: 2rem;
59
- line-height: normal;
60
- font-family: 'Anton',Impact,sans-serif;
61
- font-weight: normal;
62
- line-height: 2rem;
63
- }
64
-
65
57
  .c10 span {
66
58
  font-size: inherit;
67
59
  line-height: inherit;
@@ -355,14 +347,6 @@ it('renders press realese correctly', () => {
355
347
  line-height: 1.5rem;
356
348
  }
357
349
 
358
- .c10 {
359
- font-size: 2rem;
360
- line-height: normal;
361
- font-family: 'Anton',Impact,sans-serif;
362
- font-weight: normal;
363
- line-height: 2rem;
364
- }
365
-
366
350
  .c10 span {
367
351
  font-size: inherit;
368
352
  line-height: inherit;
@@ -167,11 +167,7 @@ const Descriptor = ({
167
167
  <IconWrapper>{icons}</IconWrapper>
168
168
  </Header>
169
169
  <Title
170
- size="xl"
171
170
  tag="h3"
172
- height="2rem"
173
- weight="normal"
174
- family="Anton"
175
171
  >
176
172
  {title}
177
173
  </Title>
@@ -61,14 +61,6 @@ it('renders article teaser correctly', () => {
61
61
  line-height: 1.5rem;
62
62
  }
63
63
 
64
- .c7 {
65
- font-size: 2rem;
66
- line-height: normal;
67
- font-family: 'Anton',Impact,sans-serif;
68
- font-weight: normal;
69
- line-height: 2rem;
70
- }
71
-
72
64
  .c7 span {
73
65
  font-size: inherit;
74
66
  line-height: inherit;
@@ -5,7 +5,9 @@ const allowList = [
5
5
  'https://www.sportrelief.com',
6
6
  'https://app.beapplied.com/org/comic-relief',
7
7
  'stories.comicrelief.com',
8
- 'https://form.typeform.com'
8
+ 'https://form.typeform.com',
9
+ // Required for the HHoF form:
10
+ 'https://interfaces.zapier.com/assets/web-components/zapier-interfaces/zapier-interfaces.esm.js'
9
11
  ];
10
12
 
11
13
  const allowListed = url => {