@comicrelief/component-library 8.77.7 → 8.79.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.
Files changed (40) hide show
  1. package/dist/index.cjs.js +921 -848
  2. package/dist/index.es.js +10828 -10653
  3. package/package.json +1 -1
  4. package/src/components/Atoms/Button/Button.js +48 -6
  5. package/src/components/Atoms/Button/Button.style.js +46 -3
  6. package/src/components/Atoms/Button/Button.test.js +5 -2
  7. package/src/components/Atoms/Button/ButtonExample.jsx +263 -0
  8. package/src/components/Atoms/Icons/Cross.js +10 -3
  9. package/src/components/Atoms/Link/Link.style.js +2 -1
  10. package/src/components/Atoms/Link/Link.test.js +3 -1
  11. package/src/components/Atoms/Logos/Logo.js +4 -4
  12. package/src/components/Atoms/Logos/LogoExample.jsx +2 -7
  13. package/src/components/Atoms/Logos/assets/cr-logo--wide.svg +14 -0
  14. package/src/components/Molecules/ArticleTeaser/ArticleTeaser.test.js +28 -28
  15. package/src/components/Molecules/CTA/CTAMultiCard/__snapshots__/CTAMultiCard.test.js.snap +56 -56
  16. package/src/components/Molecules/CTA/CTASingleCard/__snapshots__/CTASingleCard.test.js.snap +14 -14
  17. package/src/components/Molecules/CardDs/__snapshots__/CardDs.test.js.snap +34 -30
  18. package/src/components/Molecules/EmailSignUp/EmailSignUp.style.js +2 -0
  19. package/src/components/Molecules/HeroBanner/__snapshots__/HeroBanner.test.js.snap +56 -56
  20. package/src/components/Molecules/LogoLinked/LogoLinked.js +68 -34
  21. package/src/components/Molecules/LogoLinked/LogoLinked.style.js +27 -0
  22. package/src/components/Molecules/LogoLinked/LogoLinkedExample.jsx +26 -7
  23. package/src/components/Molecules/PartnerLink/PartnerLink.test.js +14 -14
  24. package/src/components/Molecules/Promo/__snapshots__/Promo.test.js.snap +34 -30
  25. package/src/components/Molecules/QuoteSlice/__snapshots__/QuoteSlice.test.js.snap +3 -1
  26. package/src/components/Molecules/SearchResult/__snapshots__/SearchResult.test.js.snap +56 -56
  27. package/src/components/Molecules/SingleMessage/__snapshots__/SingleMessage.test.js.snap +62 -58
  28. package/src/components/Molecules/SingleMessageDS/__snapshots__/SingleMessageDs.test.js.snap +17 -15
  29. package/src/components/Organisms/CookieBanner/CookieBanner.test.js +3 -1
  30. package/src/components/Organisms/DonateBanner/DonateBanner.style.js +4 -1
  31. package/src/components/Organisms/DonateBanner/__snapshots__/DonateBanner.test.js.snap +12 -4
  32. package/src/components/Organisms/DynamicGallery/__snapshots__/DynamicGallery.test.js.snap +12 -4
  33. package/src/components/Organisms/EmailBanner/EmailBanner.style.js +0 -7
  34. package/src/components/Organisms/EmailBanner/__snapshots__/EmailBanner.test.js.snap +20 -36
  35. package/src/components/Organisms/EmailSignUp/__snapshots__/EmailSignUp.test.js.snap +5 -2
  36. package/src/components/Organisms/FooterNew/__snapshots__/FooterNew.test.js.snap +12 -4
  37. package/src/components/Organisms/Membership/Membership.test.js +14 -14
  38. package/src/data/data.js +6 -1
  39. package/src/theme/crTheme/buttonColors.js +21 -4
  40. package/src/components/Atoms/Logos/assets/sr-gameon-logo.svg +0 -1
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.77.7",
4
+ "version": "8.79.0",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
7
7
  "files": [
@@ -1,26 +1,68 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import StyledButton from './Button.style';
3
+ import { StyledButton, IconWrapper, Copywrapper } from './Button.style';
4
4
  import buttonTypes from '../../../theme/crTheme/buttonTypes';
5
+ import Picture from '../Picture/Picture';
5
6
 
6
7
  const Button = React.forwardRef(({
7
8
  children,
8
9
  color = 'red',
10
+ icon = null,
11
+ iconDescription = 'Icon',
9
12
  wrapper = false,
10
13
  fullWidth = false,
11
14
  buttonType = buttonTypes.PRIMARY,
12
15
  ...rest
13
- }, ref) => (
14
- <StyledButton {...rest} as={wrapper ? 'span' : 'button'} ref={ref} $fullWidth={fullWidth} $color={color} $buttonType={buttonType} data-testid="Button">
15
- {children}
16
- </StyledButton>
17
- ));
16
+ }, ref) => {
17
+ const hasIcon = Boolean(icon);
18
+ const hasIconPath = hasIcon && (typeof icon === 'string' || icon instanceof String);
19
+
20
+ return (
21
+ <StyledButton
22
+ {...rest}
23
+ as={wrapper ? 'span' : 'button'}
24
+ ref={ref}
25
+ $fullWidth={fullWidth}
26
+ $color={color}
27
+ $buttonType={buttonType}
28
+ data-testid="Button"
29
+ $hasIcon={hasIcon}
30
+ >
31
+
32
+ {hasIcon
33
+ // Wrapping span to allow for grid positioning alongside icon
34
+ ? <Copywrapper>{children}</Copywrapper>
35
+ : children
36
+ }
37
+
38
+ {hasIcon && (
39
+ <IconWrapper className="icon-wrapper">
40
+ {hasIconPath ? (
41
+ <Picture
42
+ image={icon}
43
+ objectFit="contain"
44
+ alt={iconDescription}
45
+ />
46
+ ) : (icon)}
47
+ </IconWrapper>
48
+ )}
49
+
50
+ </StyledButton>
51
+ );
52
+ });
18
53
 
19
54
  Button.propTypes = {
20
55
  children: PropTypes.node.isRequired,
21
56
  wrapper: PropTypes.bool, // Buttons as span
22
57
  fullWidth: PropTypes.bool,
23
58
  color: PropTypes.string,
59
+ icon: PropTypes.oneOfType([
60
+ // SVG / React component wrapping SVG code:
61
+ PropTypes.node,
62
+ // Icon URL
63
+ PropTypes.string
64
+ ]),
65
+ iconDescription: PropTypes.string,
24
66
  // Primary will the default for the vast majority of contexts; with
25
67
  // Secondary and Tertirary being manually set by developers where required
26
68
  buttonType: PropTypes.oneOf([
@@ -1,18 +1,36 @@
1
1
  import styled, { css } from 'styled-components';
2
2
  import fontHelper from '../../../theme/crTheme/fontHelper';
3
3
 
4
+ const Copywrapper = styled.span`
5
+ // Purely for some cleaner markup :)
6
+ `;
7
+
8
+ const IconWrapper = styled.div`
9
+ width: auto;
10
+ height: 100%;
11
+ margin-left: auto;
12
+ transition: filter 0.2s;
13
+
14
+ * {
15
+ width: inherit;
16
+ height: inherit;
17
+ }
18
+ `;
19
+
4
20
  const StyledButton = styled.button`
21
+ --padding-top-and-bottom: 0.6rem;
5
22
  display: inline-flex;
6
23
  position: relative;
7
24
  text-decoration: none;
8
25
  transition: all 0.2s;
9
- height: 2.5rem;
26
+ height: auto;
27
+ min-height: 3rem;
10
28
  width: 100%;
11
29
  justify-content: center;
12
30
  align-items: center;
13
31
  border: none;
14
32
  cursor: pointer;
15
- padding: 0.6rem 1rem;
33
+ padding: var(--padding-top-and-bottom) 1rem;
16
34
  border-radius: 0.5rem;
17
35
 
18
36
  > a {
@@ -32,6 +50,31 @@ const StyledButton = styled.button`
32
50
  // place for now, just to avoid breaking anything downstream...
33
51
  width: ${({ $fullWidth }) => ($fullWidth ? '100%' : 'auto')};
34
52
  }
53
+
54
+ ${({ $hasIcon }) => $hasIcon && css`
55
+ display: inline-grid;
56
+ grid-template-columns: 1fr repeat(1, auto) 1fr;
57
+ grid-column-gap: 0.6rem;
58
+ grid-template-rows: auto;
59
+ justify-items: center;
60
+
61
+ > ${Copywrapper} {
62
+ grid-column-start: 2;
63
+
64
+ // Request from Curtis to aesthetically rebalance these smaller buttons:
65
+ ${({ $fullWidth }) => (!$fullWidth && css`
66
+ padding-right: 1.5rem;
67
+ `)};
68
+ }
69
+
70
+ > ${IconWrapper} {
71
+ margin-left: auto;
72
+ // While Button heights now scale to fit content (important for lots
73
+ // of copy on a small breakpoint), we so still need to constrain the
74
+ // icon, to prevent silliness:
75
+ height: calc(3rem - (var(--padding-top-and-bottom) * 2));
76
+ }
77
+ `}
35
78
  `;
36
79
 
37
- export default StyledButton;
80
+ export { StyledButton, IconWrapper, Copywrapper };
@@ -10,17 +10,19 @@ it('renders a standard styled link correctly', () => {
10
10
 
11
11
  expect(tree).toMatchInlineSnapshot(`
12
12
  .c0 {
13
+ --padding-top-and-bottom: 0.6rem;
13
14
  display: inline-flex;
14
15
  position: relative;
15
16
  text-decoration: none;
16
17
  transition: all 0.2s;
17
- height: 2.5rem;
18
+ height: auto;
19
+ min-height: 3rem;
18
20
  width: 100%;
19
21
  justify-content: center;
20
22
  align-items: center;
21
23
  border: none;
22
24
  cursor: pointer;
23
- padding: 0.6rem 1rem;
25
+ padding: var(--padding-top-and-bottom) 1rem;
24
26
  border-radius: 0.5rem;
25
27
  background-color: #E52630;
26
28
  color: #FFFFFF;
@@ -41,6 +43,7 @@ it('renders a standard styled link correctly', () => {
41
43
  .c0:focus-within,
42
44
  .c0:focus-visible {
43
45
  background-color: #890B11;
46
+ color: #FFFFFF;
44
47
  outline-offset: 3px;
45
48
  }
46
49
 
@@ -2,8 +2,41 @@ import React from 'react';
2
2
  import Button from './Button';
3
3
  import buttonTypes from '../../../theme/crTheme/buttonTypes';
4
4
  import { ExampleContainer } from '../../../demos/SharedStyles';
5
+ import Cross from '../Icons/Cross';
6
+ import { ButtonIconImgPath, ButtonIconSvgPath } from '../../../data/data';
5
7
 
6
8
  export default function ButtonExample() {
9
+ // Covering all of the use cases:
10
+ const blackCrossIcon = <Cross />;
11
+ const whiteCrossIcon = <Cross colour="white" />;
12
+ const redCrossIcon = <Cross colour="red" />;
13
+
14
+ const testImage = (
15
+ <img
16
+ src={ButtonIconImgPath}
17
+ alt="Test img tag"
18
+ />
19
+ );
20
+
21
+ const testSvgImg = (
22
+ <img
23
+ src={ButtonIconSvgPath}
24
+ alt="Test svg in img tag"
25
+ />
26
+ );
27
+
28
+ const whiteInlineSvg = (
29
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
30
+ <path d="M23.404 5.91909C23.439 5.84409 23.4635 5.76309 23.479 5.67859C23.4825 5.65859 23.4875 5.63909 23.4895 5.61909C23.4915 5.60459 23.496 5.59109 23.497 5.57659C23.503 5.49709 23.497 5.41959 23.4855 5.34359C23.483 5.32809 23.4785 5.31409 23.475 5.29859C23.456 5.20659 23.4265 5.11859 23.3835 5.03709C23.381 5.03209 23.381 5.02659 23.378 5.02159C23.377 5.02009 23.3755 5.01859 23.3745 5.01709C23.3275 4.93259 23.267 4.85759 23.198 4.79009C23.185 4.77709 23.1725 4.76459 23.159 4.75259C23.0895 4.69109 23.013 4.63909 22.928 4.59859C22.916 4.59309 22.9035 4.58909 22.8915 4.58409C22.812 4.55009 22.7275 4.52609 22.6385 4.51359C22.626 4.51159 22.6145 4.50809 22.602 4.50709C22.593 4.50609 22.585 4.50309 22.576 4.50259L3.07601 3.00259C2.67651 2.97059 2.28551 3.19009 2.10401 3.55559C1.92301 3.92059 1.98201 4.35959 2.25251 4.66409L5.35251 8.15159L1.29051 9.02209C0.881009 9.11009 0.569009 9.44409 0.509509 9.85909C0.450509 10.2741 0.656509 10.6816 1.02551 10.8801L7.10151 14.1521L8.01551 19.1786C8.08201 19.5446 8.34601 19.8431 8.70101 19.9541C8.80001 19.9851 8.90051 20.0001 9.00001 20.0001C9.26101 20.0001 9.51651 19.8976 9.70701 19.7071L23.207 6.20709C23.2175 6.19659 23.2225 6.18209 23.233 6.17109C23.294 6.10509 23.349 6.03309 23.391 5.95159C23.396 5.94109 23.399 5.93009 23.404 5.91909ZM5.39301 5.18709L15.544 5.96809L7.60051 7.67009L5.39301 5.18709ZM9.64251 16.9436L8.98401 13.3211C8.93001 13.0221 8.74201 12.7636 8.47401 12.6196L4.36751 10.4081L19.3985 7.18709L9.64251 16.9436ZM3.00101 18.0001C2.63401 18.0001 2.28101 17.7976 2.10551 17.4471C1.85851 16.9531 2.05851 16.3526 2.55301 16.1051L4.55301 15.1051C5.04801 14.8571 5.64801 15.0586 5.89501 15.5526C6.14201 16.0466 5.94201 16.6471 5.44751 16.8946L3.44751 17.8946C3.30351 17.9666 3.15101 18.0001 3.00101 18.0001ZM6.70701 18.2931C7.09751 18.6836 7.09751 19.3166 6.70701 19.7071L4.70701 21.7071C4.51151 21.9026 4.25601 22.0001 4.00001 22.0001C3.74401 22.0001 3.48851 21.9026 3.29301 21.7071C2.90251 21.3166 2.90251 20.6836 3.29301 20.2931L5.29301 18.2931C5.68351 17.9026 6.31651 17.9026 6.70701 18.2931Z" fill="#fff" />
31
+ </svg>
32
+ );
33
+
34
+ const blackInlineSvg = (
35
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
36
+ <path d="M23.404 5.91909C23.439 5.84409 23.4635 5.76309 23.479 5.67859C23.4825 5.65859 23.4875 5.63909 23.4895 5.61909C23.4915 5.60459 23.496 5.59109 23.497 5.57659C23.503 5.49709 23.497 5.41959 23.4855 5.34359C23.483 5.32809 23.4785 5.31409 23.475 5.29859C23.456 5.20659 23.4265 5.11859 23.3835 5.03709C23.381 5.03209 23.381 5.02659 23.378 5.02159C23.377 5.02009 23.3755 5.01859 23.3745 5.01709C23.3275 4.93259 23.267 4.85759 23.198 4.79009C23.185 4.77709 23.1725 4.76459 23.159 4.75259C23.0895 4.69109 23.013 4.63909 22.928 4.59859C22.916 4.59309 22.9035 4.58909 22.8915 4.58409C22.812 4.55009 22.7275 4.52609 22.6385 4.51359C22.626 4.51159 22.6145 4.50809 22.602 4.50709C22.593 4.50609 22.585 4.50309 22.576 4.50259L3.07601 3.00259C2.67651 2.97059 2.28551 3.19009 2.10401 3.55559C1.92301 3.92059 1.98201 4.35959 2.25251 4.66409L5.35251 8.15159L1.29051 9.02209C0.881009 9.11009 0.569009 9.44409 0.509509 9.85909C0.450509 10.2741 0.656509 10.6816 1.02551 10.8801L7.10151 14.1521L8.01551 19.1786C8.08201 19.5446 8.34601 19.8431 8.70101 19.9541C8.80001 19.9851 8.90051 20.0001 9.00001 20.0001C9.26101 20.0001 9.51651 19.8976 9.70701 19.7071L23.207 6.20709C23.2175 6.19659 23.2225 6.18209 23.233 6.17109C23.294 6.10509 23.349 6.03309 23.391 5.95159C23.396 5.94109 23.399 5.93009 23.404 5.91909ZM5.39301 5.18709L15.544 5.96809L7.60051 7.67009L5.39301 5.18709ZM9.64251 16.9436L8.98401 13.3211C8.93001 13.0221 8.74201 12.7636 8.47401 12.6196L4.36751 10.4081L19.3985 7.18709L9.64251 16.9436ZM3.00101 18.0001C2.63401 18.0001 2.28101 17.7976 2.10551 17.4471C1.85851 16.9531 2.05851 16.3526 2.55301 16.1051L4.55301 15.1051C5.04801 14.8571 5.64801 15.0586 5.89501 15.5526C6.14201 16.0466 5.94201 16.6471 5.44751 16.8946L3.44751 17.8946C3.30351 17.9666 3.15101 18.0001 3.00101 18.0001ZM6.70701 18.2931C7.09751 18.6836 7.09751 19.3166 6.70701 19.7071L4.70701 21.7071C4.51151 21.9026 4.25601 22.0001 4.00001 22.0001C3.74401 22.0001 3.48851 21.9026 3.29301 21.7071C2.90251 21.3166 2.90251 20.6836 3.29301 20.2931L5.29301 18.2931C5.68351 17.9026 6.31651 17.9026 6.70701 18.2931Z" fill="#222" />
37
+ </svg>
38
+ );
39
+
7
40
  return (
8
41
  <>
9
42
  <h3>Primary</h3>
@@ -100,6 +133,236 @@ export default function ButtonExample() {
100
133
  <ExampleContainer>
101
134
  <Button type="button" fullWidth>Full-width button</Button>
102
135
  </ExampleContainer>
136
+
137
+ <ExampleContainer>
138
+ <Button>
139
+ Button with loads and loads and loads of copy
140
+ to illustrate new min-height sizing
141
+ </Button>
142
+ </ExampleContainer>
143
+
144
+ <br />
145
+ <h3>Buttons with Icons</h3>
146
+
147
+ <ExampleContainer>
148
+ <Button
149
+ type="button"
150
+ icon={whiteCrossIcon}
151
+ wrapper
152
+ >
153
+ Button with an Icon component - rendered as span
154
+ </Button>
155
+ </ExampleContainer>
156
+
157
+ <ExampleContainer>
158
+ <Button
159
+ type="button"
160
+ icon={ButtonIconImgPath}
161
+ iconDescription="House with a heart-shaped window"
162
+ >
163
+ Button w/image URL for icon
164
+ </Button>
165
+ </ExampleContainer>
166
+
167
+ <ExampleContainer>
168
+ <Button
169
+ type="button"
170
+ icon={testImage}
171
+ >
172
+ Button w/image tag passed in directly
173
+ </Button>
174
+ </ExampleContainer>
175
+
176
+ <ExampleContainer>
177
+ <Button
178
+ type="button"
179
+ icon={ButtonIconSvgPath}
180
+ >
181
+ Button w/svg URL (rendered as img) for icon
182
+ </Button>
183
+ </ExampleContainer>
184
+
185
+ <ExampleContainer>
186
+ <Button
187
+ type="button"
188
+ icon={whiteInlineSvg}
189
+ >
190
+ Button w/inline svg code passed directly
191
+ </Button>
192
+ </ExampleContainer>
193
+
194
+ <ExampleContainer>
195
+ <Button
196
+ type="button"
197
+ icon={whiteCrossIcon}
198
+ fullWidth
199
+ color="black"
200
+ >
201
+ Black full-width Button with an Icon component
202
+ </Button>
203
+ </ExampleContainer>
204
+
205
+ <ExampleContainer $bg="teal">
206
+ <Button
207
+ type="button"
208
+ icon={ButtonIconImgPath}
209
+ fullWidth
210
+ color="white"
211
+ >
212
+ White full-width Button w/image URL for icon
213
+ </Button>
214
+ </ExampleContainer>
215
+
216
+ <ExampleContainer>
217
+ <Button
218
+ type="button"
219
+ icon={testSvgImg}
220
+ fullWidth
221
+ iconDescription="Phone icon"
222
+ >
223
+ Red full-width Button w/svg URL, rendered as img
224
+ </Button>
225
+ </ExampleContainer>
226
+
227
+ <br />
228
+ <h3>Button variants with Icons</h3>
229
+
230
+ <h4>Primary</h4>
231
+
232
+ <ExampleContainer>
233
+ <Button
234
+ type="button"
235
+ icon={whiteCrossIcon}
236
+ >
237
+ Primary red button (default)
238
+ </Button>
239
+ </ExampleContainer>
240
+
241
+ <ExampleContainer>
242
+ <Button
243
+ type="button"
244
+ color="black"
245
+ icon={whiteCrossIcon}
246
+ >
247
+ Primary black button
248
+ </Button>
249
+ </ExampleContainer>
250
+
251
+ <ExampleContainer $bg="#222222">
252
+ <Button
253
+ type="button"
254
+ color="white"
255
+ icon={blackCrossIcon}
256
+ >
257
+ Primary white button
258
+ </Button>
259
+ </ExampleContainer>
260
+
261
+ <br />
262
+ <h4>Secondary</h4>
263
+
264
+ <ExampleContainer>
265
+ <Button
266
+ type="button"
267
+ buttonType={buttonTypes.SECONDARY}
268
+ icon={redCrossIcon}
269
+ >
270
+ Secondary red button
271
+ </Button>
272
+ </ExampleContainer>
273
+
274
+ <ExampleContainer>
275
+ <Button
276
+ type="button"
277
+ color="black"
278
+ buttonType={buttonTypes.SECONDARY}
279
+ icon={blackCrossIcon}
280
+ >
281
+ Secondary black button
282
+ </Button>
283
+ </ExampleContainer>
284
+
285
+ <ExampleContainer $bg="#222222">
286
+ <Button
287
+ type="button"
288
+ color="white"
289
+ buttonType={buttonTypes.SECONDARY}
290
+ icon={whiteCrossIcon}
291
+ >
292
+ Secondary white button
293
+ </Button>
294
+ </ExampleContainer>
295
+
296
+ <br />
297
+ <h4>Tertiary</h4>
298
+
299
+ <ExampleContainer>
300
+ <Button
301
+ type="button"
302
+ buttonType={buttonTypes.TERTIARY}
303
+ icon={redCrossIcon}
304
+ >
305
+ Tertiary red button
306
+ </Button>
307
+ </ExampleContainer>
308
+
309
+ <ExampleContainer>
310
+ <Button
311
+ type="button"
312
+ color="black"
313
+ buttonType={buttonTypes.TERTIARY}
314
+ icon={blackCrossIcon}
315
+ >
316
+ Tertiary black button
317
+ </Button>
318
+ </ExampleContainer>
319
+
320
+ <ExampleContainer $bg="#222222">
321
+ <Button
322
+ type="button"
323
+ color="white"
324
+ buttonType={buttonTypes.TERTIARY}
325
+ icon={whiteCrossIcon}
326
+ >
327
+ Tertiary white button
328
+ </Button>
329
+ </ExampleContainer>
330
+
331
+ <br />
332
+ <h4>
333
+ A few additional funky offerings:
334
+ </h4>
335
+
336
+ <ExampleContainer>
337
+ <Button
338
+ type="button"
339
+ color="blue_light"
340
+ icon={blackCrossIcon}
341
+ >
342
+ blue_light button using React component
343
+ </Button>
344
+ </ExampleContainer>
345
+
346
+ <ExampleContainer>
347
+ <Button
348
+ type="button"
349
+ color="yellow_light"
350
+ icon={blackInlineSvg}
351
+ >
352
+ yellow_light button using inline SVG code
353
+ </Button>
354
+ </ExampleContainer>
355
+
356
+ <ExampleContainer>
357
+ <Button
358
+ type="button"
359
+ color="teal_dark"
360
+ icon={whiteCrossIcon}
361
+ wrapper
362
+ >
363
+ teal_dark button (as span) using React component
364
+ </Button>
365
+ </ExampleContainer>
103
366
  </>
104
367
  );
105
368
  }
@@ -3,7 +3,14 @@ import PropTypes from 'prop-types';
3
3
  import styled, { withTheme } from 'styled-components';
4
4
 
5
5
  const Icon = styled.svg`
6
- fill: ${({ colour, theme }) => theme.color(colour)};
6
+ // Mobile-colour if available, else use standard prop
7
+ fill: ${({ $mobileColour, $colour, theme }) => ($mobileColour ? theme.color($mobileColour) : theme.color($colour))};
8
+
9
+ // Reinstate standard styles for 'desktop', adding a fallback for good measure:
10
+ @media ${({ theme }) => theme.allBreakpoints('L')} {
11
+ fill: ${({ $colour, theme }) => ($colour ? theme.color($colour) : theme.color('white'))};
12
+ }
13
+
7
14
  `;
8
15
 
9
16
  const Cross = ({
@@ -16,8 +23,8 @@ const Cross = ({
16
23
  <Icon
17
24
  width={size}
18
25
  height={size}
19
- colour={colour}
20
- mobileColour={mobileColour}
26
+ $colour={colour}
27
+ $mobileColour={mobileColour}
21
28
  xmlns="http://www.w3.org/2000/svg"
22
29
  viewBox="0 0 96 96"
23
30
  {...rest}
@@ -8,7 +8,8 @@ const buttonStyle = () => css`
8
8
  position: relative;
9
9
  text-decoration: none;
10
10
  transition: all 0.2s;
11
- height: 2.5rem;
11
+ height: auto;
12
+ min-height: 3rem;
12
13
  width: 100%;
13
14
  justify-content: center;
14
15
  align-items: center;
@@ -188,7 +188,8 @@ it('renders link styled as button correctly', () => {
188
188
  position: relative;
189
189
  text-decoration: none;
190
190
  transition: all 0.2s;
191
- height: 2.5rem;
191
+ height: auto;
192
+ min-height: 3rem;
192
193
  width: 100%;
193
194
  justify-content: center;
194
195
  align-items: center;
@@ -211,6 +212,7 @@ it('renders link styled as button correctly', () => {
211
212
  .c0:focus-within,
212
213
  .c0:focus-visible {
213
214
  background-color: #FEFD5A;
215
+ color: #000000;
214
216
  outline-offset: 3px;
215
217
  }
216
218
 
@@ -6,8 +6,8 @@ import zIndex from '../../../theme/shared/zIndex';
6
6
  import spacing from '../../../theme/shared/spacing';
7
7
  import crLogo from './assets/cr-logo.svg';
8
8
  import srLogo from './assets/sr-logo.svg';
9
- import srLogoGameOn from './assets/sr-gameon-logo.svg';
10
9
  import crLogoPride from './assets/CR_LOGO_PRIDE_KEY_RGB.svg';
10
+ import crLogoWide from './assets/cr-logo--wide.svg';
11
11
 
12
12
  const Image = styled.img`
13
13
  object-fit: cover;
@@ -32,10 +32,10 @@ const themeSwitcher = theme => {
32
32
  switch (theme) {
33
33
  case 'Sport Relief':
34
34
  return srLogo;
35
- case 'Sport Relief Gameon':
36
- return srLogoGameOn;
37
35
  case 'Pride':
38
36
  return crLogoPride;
37
+ case 'Comic Relief wide':
38
+ return crLogoWide;
39
39
  default:
40
40
  return crLogo;
41
41
  }
@@ -48,7 +48,7 @@ const Logo = ({
48
48
  <Image
49
49
  src={themeSwitcher(campaign)}
50
50
  alt={
51
- campaign === 'Comic Relief' || campaign === 'Pride'
51
+ campaign === 'Comic Relief' || campaign === 'Pride' || campaign === 'Comic Relief wide'
52
52
  ? 'Comic Relief logo'
53
53
  : 'Sport Relief logo'
54
54
  }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import Logo from './Logo';
3
2
  import styled from 'styled-components';
3
+ import Logo from './Logo';
4
4
  import LogoNav2026 from '../LogoNav2026/_LogoNav2026';
5
5
  import { ExampleContainer } from '../../../demos/SharedStyles';
6
6
 
@@ -17,14 +17,9 @@ export default function LogoExample() {
17
17
  <Logo rotate={false} sizeSm="50px" sizeMd="60px" campaign="Sport Relief" />
18
18
  </ExampleContainer>
19
19
 
20
- <ExampleContainer>
21
- <h3>Sport Relief Game On Logo</h3>
22
- <Logo rotate={false} sizeSm="50px" sizeMd="60px" campaign="Sport Relief Gameon" />
23
- </ExampleContainer>
24
-
25
20
  <ExampleContainer>
26
21
  <h3>Logo for Nav 2026 rebuild</h3>
27
- <LogoNav2026/>
22
+ <LogoNav2026 />
28
23
  </ExampleContainer>
29
24
  </>
30
25
  );
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <svg viewBox="0 0 813 124" fill="none" xmlns="http://www.w3.org/2000/svg">
3
+ <path d="M28.9 83.3C28.9 94 30.2 100.9 38.5 100.9C46.8 100.9 48.1 94 48.1 83.3V70.3H75.5V75.9C75.5 104.1 66.5 123.8 39.1 123.8C10.9 123.8 0 104.8 0 70.2V53.7C0 19 10.9 0.0999756 39.1 0.0999756C66.5 0.0999756 75.5 19.8 75.5 48V53.6H48.1V40.6C48.1 29.9 46.8 23 38.5 23C30.2 23 28.9 29.9 28.9 40.6V83.3Z" fill="#E52630"/>
4
+ <path d="M160 69.3C160 104 149.1 123.7 120.9 123.7C92.6998 123.7 81.7998 104 81.7998 69.3V54.4C81.7998 19.7 92.6998 0 120.9 0C149.1 0 160 19.7 160 54.4V69.3ZM111 82.9C111 93.6 112.7 100.9 121 100.9C129.2 100.9 131 93.6 131 82.9V40.8C131 30.1 129.3 22.8 121 22.8C112.8 22.8 111 30.1 111 40.8V82.9Z" fill="#E52630"/>
5
+ <path d="M217.7 62.8H218.5L230 1.5H265.4V122.2H239.3V53.4H238.5L225.3 122.2H207.7L194.1 53.4H193.3V122.2H168.6V1.5H204.8L217.7 62.8Z" fill="#E52630"/>
6
+ <path d="M304.3 1.5V122.2H276.1V1.5H304.3Z" fill="#E52630"/>
7
+ <path d="M342.1 83.3C342.1 94 343.4 100.9 351.7 100.9C359.9 100.9 361.3 94 361.3 83.3V70.3H388.7V75.9C388.7 104.1 379.7 123.8 352.3 123.8C324.1 123.8 313.2 104.8 313.2 70.2V53.7C313.2 19 324.1 0.0999756 352.3 0.0999756C379.7 0.0999756 388.7 19.8 388.7 48V53.6H361.3V40.6C361.3 29.9 360 23 351.7 23C343.5 23 342.1 29.9 342.1 40.6V83.3Z" fill="#E52630"/>
8
+ <path d="M472.2 122.2C470.7 117.6 470.3 110.5 469.5 96C468.9 84.5 466.1 78.6 457.2 78.6H453.6V122.3H425.8V1.5H460.5C487.5 1.5 499.6 15.7 499.6 37.1C499.6 56.1 491 65.5 478.7 67.6C491.3 70.5 495.6 79.5 496.5 94.6C497.5 110.5 497.3 116.6 499.9 122.2H472.2ZM456.3 56.3C467.6 56.3 472 52.7 472 40.4C472 29.5 467.6 24.1 456.3 24.1H453.6V56.3H456.3Z" fill="#E52630"/>
9
+ <path d="M569 122.2H507.9V1.5H569V24.7H535.5V49.4H560.4V72.4H535.5V99H569V122.2Z" fill="#E52630"/>
10
+ <path d="M605.6 1.5V99H638.2V122.2H577.5V1.5H605.6Z" fill="#E52630"/>
11
+ <path d="M673.5 1.5V122.2H645.4V1.5H673.5Z" fill="#E52630"/>
12
+ <path d="M745.2 122.2H684.1V1.5H745.2V24.7H711.7V49.4H736.6V72.4H711.7V99H745.2V122.2Z" fill="#E52630"/>
13
+ <path d="M753.7 122.2V1.5H812.5V24.7H781.9V52.7H804.3V75.5H781.9V122.2H753.7Z" fill="#E52630"/>
14
+ </svg>
@@ -19,6 +19,20 @@ it('renders article teaser correctly', () => {
19
19
  ).toJSON();
20
20
 
21
21
  expect(tree).toMatchInlineSnapshot(`
22
+ .c6 {
23
+ display: block;
24
+ width: 100%;
25
+ height: 100%;
26
+ position: relative;
27
+ }
28
+
29
+ .c9 {
30
+ width: 100%;
31
+ height: 100%;
32
+ display: block;
33
+ object-fit: cover;
34
+ }
35
+
22
36
  .c11 {
23
37
  font-family: 'Montserrat',Helvetica,Arial,sans-serif;
24
38
  font-weight: 400;
@@ -80,20 +94,6 @@ it('renders article teaser correctly', () => {
80
94
  text-decoration: none;
81
95
  }
82
96
 
83
- .c6 {
84
- display: block;
85
- width: 100%;
86
- height: 100%;
87
- position: relative;
88
- }
89
-
90
- .c9 {
91
- width: 100%;
92
- height: 100%;
93
- display: block;
94
- object-fit: cover;
95
- }
96
-
97
97
  .c21 {
98
98
  height: 4px;
99
99
  width: 100%;
@@ -475,6 +475,20 @@ it('renders press realese correctly', () => {
475
475
  ).toJSON();
476
476
 
477
477
  expect(tree).toMatchInlineSnapshot(`
478
+ .c6 {
479
+ display: block;
480
+ width: 80px;
481
+ height: auto;
482
+ position: relative;
483
+ }
484
+
485
+ .c9 {
486
+ width: 80px;
487
+ height: auto;
488
+ display: block;
489
+ object-fit: cover;
490
+ }
491
+
478
492
  .c11 {
479
493
  font-family: 'Montserrat',Helvetica,Arial,sans-serif;
480
494
  font-weight: 400;
@@ -536,20 +550,6 @@ it('renders press realese correctly', () => {
536
550
  text-decoration: none;
537
551
  }
538
552
 
539
- .c6 {
540
- display: block;
541
- width: 80px;
542
- height: auto;
543
- position: relative;
544
- }
545
-
546
- .c9 {
547
- width: 80px;
548
- height: auto;
549
- display: block;
550
- object-fit: cover;
551
- }
552
-
553
553
  .c21 {
554
554
  height: 4px;
555
555
  width: 100%;