@comicrelief/component-library 8.79.0 → 8.80.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/index.cjs.js +77 -72
- package/dist/index.es.js +976 -960
- package/package.json +1 -1
- package/src/components/Atoms/Logos/Logo.js +5 -24
- package/src/components/Atoms/Logos/Logo.style.js +29 -0
- package/src/components/Atoms/Logos/Logo.test.js +6 -0
- package/src/components/Atoms/Logos/LogoExample.jsx +2 -3
- package/src/components/Molecules/LogoLinked/LogoLinked.js +8 -1
- package/src/components/Molecules/LogoLinked/LogoLinkedExample.jsx +8 -4
- package/src/components/Organisms/Footer/Footer.js +1 -1
- package/src/components/Organisms/Footer/__snapshots__/Footer.test.js.snap +6 -0
- package/src/components/Organisms/FooterNew/FooterNew.js +3 -3
- package/src/components/Organisms/FooterNew/__snapshots__/FooterNew.test.js.snap +24 -0
- package/src/components/Organisms/Header2025/Header2025.js +2 -1
package/package.json
CHANGED
|
@@ -1,33 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
|
|
5
|
-
import
|
|
6
|
-
|
|
4
|
+
import { Image, LogoWrapper } from './Logo.style';
|
|
5
|
+
|
|
7
6
|
import crLogo from './assets/cr-logo.svg';
|
|
8
7
|
import srLogo from './assets/sr-logo.svg';
|
|
9
8
|
import crLogoPride from './assets/CR_LOGO_PRIDE_KEY_RGB.svg';
|
|
10
9
|
import crLogoWide from './assets/cr-logo--wide.svg';
|
|
11
10
|
|
|
12
|
-
const Image = styled.img`
|
|
13
|
-
object-fit: cover;
|
|
14
|
-
width: 100%;
|
|
15
|
-
display: block;
|
|
16
|
-
height: auto;
|
|
17
|
-
margin-right: ${spacing('md')};
|
|
18
|
-
`;
|
|
19
|
-
|
|
20
|
-
const LogoWrapper = styled.div`
|
|
21
|
-
display: inline-block;
|
|
22
|
-
${zIndex('high')}
|
|
23
|
-
width: ${props => props.$sizeSm};
|
|
24
|
-
transform: ${props => (props.$rotate ? 'rotate(-14deg)' : 'inherit')};
|
|
25
|
-
vertical-align: bottom; // height fix
|
|
26
|
-
@media ${({ theme }) => theme.allBreakpoints('Nav')} {
|
|
27
|
-
width: ${props => props.$sizeMd};
|
|
28
|
-
}
|
|
29
|
-
`;
|
|
30
|
-
|
|
31
11
|
const themeSwitcher = theme => {
|
|
32
12
|
switch (theme) {
|
|
33
13
|
case 'Sport Relief':
|
|
@@ -42,9 +22,9 @@ const themeSwitcher = theme => {
|
|
|
42
22
|
};
|
|
43
23
|
|
|
44
24
|
const Logo = ({
|
|
45
|
-
rotate = false, sizeSm = '51px', sizeMd = '70px', campaign = 'Comic Relief'
|
|
25
|
+
rotate = false, sizeSm = '51px', sizeMd = '51px', sizeLg = '70px', campaign = 'Comic Relief'
|
|
46
26
|
}) => (
|
|
47
|
-
<LogoWrapper $rotate={rotate ? 1 : 0} $sizeSm={sizeSm} $sizeMd={sizeMd}>
|
|
27
|
+
<LogoWrapper $rotate={rotate ? 1 : 0} $sizeSm={sizeSm} $sizeMd={sizeMd} $sizeLg={sizeLg}>
|
|
48
28
|
<Image
|
|
49
29
|
src={themeSwitcher(campaign)}
|
|
50
30
|
alt={
|
|
@@ -61,6 +41,7 @@ Logo.propTypes = {
|
|
|
61
41
|
rotate: PropTypes.bool,
|
|
62
42
|
sizeSm: PropTypes.string,
|
|
63
43
|
sizeMd: PropTypes.string,
|
|
44
|
+
sizeLg: PropTypes.string,
|
|
64
45
|
campaign: PropTypes.string
|
|
65
46
|
};
|
|
66
47
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import zIndex from '../../../theme/shared/zIndex';
|
|
3
|
+
import spacing from '../../../theme/shared/spacing';
|
|
4
|
+
|
|
5
|
+
const Image = styled.img`
|
|
6
|
+
object-fit: cover;
|
|
7
|
+
width: 100%;
|
|
8
|
+
display: block;
|
|
9
|
+
height: auto;
|
|
10
|
+
margin-right: ${spacing('md')};
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
const LogoWrapper = styled.div`
|
|
14
|
+
display: inline-block;
|
|
15
|
+
${zIndex('high')}
|
|
16
|
+
width: ${props => props.$sizeSm};
|
|
17
|
+
transform: ${props => (props.$rotate ? 'rotate(-14deg)' : 'inherit')};
|
|
18
|
+
vertical-align: bottom; // height fix
|
|
19
|
+
|
|
20
|
+
@media ${({ theme }) => theme.allBreakpoints('M')} {
|
|
21
|
+
width: ${props => props.$sizeMd};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@media ${({ theme }) => theme.allBreakpoints('Nav')} {
|
|
25
|
+
width: ${props => props.$sizeLg};
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
export { Image, LogoWrapper };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
2
|
import Logo from './Logo';
|
|
4
3
|
import LogoNav2026 from '../LogoNav2026/_LogoNav2026';
|
|
5
4
|
import { ExampleContainer } from '../../../demos/SharedStyles';
|
|
@@ -9,12 +8,12 @@ export default function LogoExample() {
|
|
|
9
8
|
<>
|
|
10
9
|
<ExampleContainer>
|
|
11
10
|
<h3>Comic Relief Logo</h3>
|
|
12
|
-
<Logo rotate={false} sizeSm="50px" sizeMd="60px" />
|
|
11
|
+
<Logo rotate={false} sizeSm="50px" sizeMd="50px" sizeLg="60px" />
|
|
13
12
|
</ExampleContainer>
|
|
14
13
|
|
|
15
14
|
<ExampleContainer>
|
|
16
15
|
<h3>Sport Relief Logo</h3>
|
|
17
|
-
<Logo rotate={false} sizeSm="50px" sizeMd="60px" campaign="Sport Relief" />
|
|
16
|
+
<Logo rotate={false} sizeSm="50px" sizeMd="50px" sizeLg="60px" campaign="Sport Relief" />
|
|
18
17
|
</ExampleContainer>
|
|
19
18
|
|
|
20
19
|
<ExampleContainer>
|
|
@@ -5,7 +5,7 @@ import Logo from '../../Atoms/Logos/Logo';
|
|
|
5
5
|
import { TitleLabel, LogoLink } from './LogoLinked.style';
|
|
6
6
|
|
|
7
7
|
const LogoLinked = ({
|
|
8
|
-
sizeSm, sizeMd,
|
|
8
|
+
sizeSm, sizeMd, sizeLg,
|
|
9
9
|
campaign = 'Comic Relief',
|
|
10
10
|
title = 'Go to Comic Relief homepage',
|
|
11
11
|
url = '/',
|
|
@@ -25,6 +25,9 @@ const LogoLinked = ({
|
|
|
25
25
|
rotate={false}
|
|
26
26
|
campaign="Sport Relief"
|
|
27
27
|
title="Sport Relief in homepage"
|
|
28
|
+
sizeSm={sizeSm}
|
|
29
|
+
sizeMd={sizeMd}
|
|
30
|
+
sizeLg={sizeLg}
|
|
28
31
|
/>
|
|
29
32
|
<TitleLabel>Go to Sport Relief homepage</TitleLabel>
|
|
30
33
|
</LogoLink>
|
|
@@ -45,6 +48,7 @@ const LogoLinked = ({
|
|
|
45
48
|
title="Go to Comic Relief homepage"
|
|
46
49
|
sizeSm={sizeSm}
|
|
47
50
|
sizeMd={sizeMd}
|
|
51
|
+
sizeLg={sizeLg}
|
|
48
52
|
/>
|
|
49
53
|
<TitleLabel>Go to Comic Relief homepage</TitleLabel>
|
|
50
54
|
</LogoLink>
|
|
@@ -67,6 +71,7 @@ const LogoLinked = ({
|
|
|
67
71
|
title="Go to Comic Relief homepage"
|
|
68
72
|
sizeSm={sizeSm}
|
|
69
73
|
sizeMd={sizeMd}
|
|
74
|
+
sizeLg={sizeLg}
|
|
70
75
|
/>
|
|
71
76
|
<TitleLabel>Go to Comic Relief homepage</TitleLabel>
|
|
72
77
|
</LogoLink>
|
|
@@ -86,6 +91,7 @@ const LogoLinked = ({
|
|
|
86
91
|
title={title}
|
|
87
92
|
sizeSm={sizeSm}
|
|
88
93
|
sizeMd={sizeMd}
|
|
94
|
+
sizeLg={sizeLg}
|
|
89
95
|
/>
|
|
90
96
|
<TitleLabel>{title}</TitleLabel>
|
|
91
97
|
</LogoLink>
|
|
@@ -100,6 +106,7 @@ LogoLinked.propTypes = {
|
|
|
100
106
|
url: PropTypes.string,
|
|
101
107
|
sizeSm: PropTypes.string,
|
|
102
108
|
sizeMd: PropTypes.string,
|
|
109
|
+
sizeLg: PropTypes.string,
|
|
103
110
|
newTab: PropTypes.bool
|
|
104
111
|
};
|
|
105
112
|
|
|
@@ -7,7 +7,7 @@ export default function LogoLinkedExample() {
|
|
|
7
7
|
<>
|
|
8
8
|
<ExampleContainer>
|
|
9
9
|
<h3>Comic Relief (default)</h3>
|
|
10
|
-
<LogoLinked sizeSm="50px" sizeMd="60px" />
|
|
10
|
+
<LogoLinked sizeSm="50px" sizeMd="50px" sizeLg="60px" />
|
|
11
11
|
</ExampleContainer>
|
|
12
12
|
|
|
13
13
|
<ExampleContainer>
|
|
@@ -16,6 +16,7 @@ export default function LogoLinkedExample() {
|
|
|
16
16
|
campaign="Comic Relief wide"
|
|
17
17
|
sizeSm="150px"
|
|
18
18
|
sizeMd="150px"
|
|
19
|
+
sizeLg="150px"
|
|
19
20
|
url="https://www.comicrelief.com"
|
|
20
21
|
newTab
|
|
21
22
|
animatePulse
|
|
@@ -27,7 +28,8 @@ export default function LogoLinkedExample() {
|
|
|
27
28
|
<LogoLinked
|
|
28
29
|
campaign="Sport Relief"
|
|
29
30
|
sizeSm="50px"
|
|
30
|
-
sizeMd="
|
|
31
|
+
sizeMd="50px"
|
|
32
|
+
sizeLg="60px"
|
|
31
33
|
/>
|
|
32
34
|
</ExampleContainer>
|
|
33
35
|
|
|
@@ -36,7 +38,8 @@ export default function LogoLinkedExample() {
|
|
|
36
38
|
<LogoLinked
|
|
37
39
|
campaign="Pride"
|
|
38
40
|
sizeSm="50px"
|
|
39
|
-
sizeMd="
|
|
41
|
+
sizeMd="50px"
|
|
42
|
+
sizeLg="60px"
|
|
40
43
|
/>
|
|
41
44
|
</ExampleContainer>
|
|
42
45
|
|
|
@@ -44,7 +47,8 @@ export default function LogoLinkedExample() {
|
|
|
44
47
|
<h3>Comic Relief (default) w/rotation animation</h3>
|
|
45
48
|
<LogoLinked
|
|
46
49
|
sizeSm="50px"
|
|
47
|
-
sizeMd="
|
|
50
|
+
sizeMd="50px"
|
|
51
|
+
sizeLg="60px"
|
|
48
52
|
animateRotate
|
|
49
53
|
/>
|
|
50
54
|
</ExampleContainer>
|
|
@@ -35,7 +35,7 @@ const Footer = ({
|
|
|
35
35
|
</SocialIconWrapper>
|
|
36
36
|
|
|
37
37
|
<Brand href="/" title={`Go to ${campaign} homepage`} data-test="footer-logo">
|
|
38
|
-
<Logo sizeSm="48px" sizeMd="72px" rotate={false} campaign={campaign} />
|
|
38
|
+
<Logo sizeSm="48px" sizeMd="48px" sizeLg="72px" rotate={false} campaign={campaign} />
|
|
39
39
|
</Brand>
|
|
40
40
|
</FooterBranding>
|
|
41
41
|
<FooterNav navItems={navItems} overrideallowList={overrideallowList} {...rest} />
|
|
@@ -80,7 +80,7 @@ const FooterNew = ({
|
|
|
80
80
|
|
|
81
81
|
<LogosContainer $mobileOnly>
|
|
82
82
|
<Brand href="/" title={`Go to ${campaign} homepage`} $animateRotate={animateRotate}>
|
|
83
|
-
<Logo sizeSm="59px" sizeMd="72px" rotate={false} campaign={campaign} />
|
|
83
|
+
<Logo sizeSm="59px" sizeMd="59px" sizeLg="72px" rotate={false} campaign={campaign} />
|
|
84
84
|
</Brand>
|
|
85
85
|
</LogosContainer>
|
|
86
86
|
|
|
@@ -110,12 +110,12 @@ const FooterNew = ({
|
|
|
110
110
|
</TopSectionLeft>
|
|
111
111
|
<LogosContainer $desktopOnly $showCRLogoOnly>
|
|
112
112
|
<Brand href="/" title={`Go to ${campaign} homepage`} $animateRotate={animateRotate}>
|
|
113
|
-
<Logo sizeSm="59px" sizeMd="59px" rotate={false} campaign={campaign} />
|
|
113
|
+
<Logo sizeSm="59px" sizeMd="59px" sizeLg="59px" rotate={false} campaign={campaign} />
|
|
114
114
|
</Brand>
|
|
115
115
|
</LogosContainer>
|
|
116
116
|
<LogosContainer $desktopOnly $showPairedLogos>
|
|
117
117
|
<Brand href="/" title={`Go to ${campaign} homepage`} $animateRotate={animateRotate}>
|
|
118
|
-
<Logo sizeSm="59px" sizeMd="59px" rotate={false} campaign={campaign} />
|
|
118
|
+
<Logo sizeSm="59px" sizeMd="59px" sizeLg="59px" rotate={false} campaign={campaign} />
|
|
119
119
|
</Brand>
|
|
120
120
|
{showFundraisingRegulatorLogo && <FundraisingRegulatorLogo animateOnHover noMargin />}
|
|
121
121
|
</LogosContainer>
|
|
@@ -625,12 +625,24 @@ exports[`does not render copyright text when not supplied 1`] = `
|
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
627
|
|
|
628
|
+
@media (min-width: 740px) {
|
|
629
|
+
.c5 {
|
|
630
|
+
width: 59px;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
|
|
628
634
|
@media (min-width: 1150px) {
|
|
629
635
|
.c5 {
|
|
630
636
|
width: 72px;
|
|
631
637
|
}
|
|
632
638
|
}
|
|
633
639
|
|
|
640
|
+
@media (min-width: 740px) {
|
|
641
|
+
.c33 {
|
|
642
|
+
width: 59px;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
|
|
634
646
|
@media (min-width: 1150px) {
|
|
635
647
|
.c33 {
|
|
636
648
|
width: 59px;
|
|
@@ -1953,12 +1965,24 @@ exports[`renders correctly 1`] = `
|
|
|
1953
1965
|
}
|
|
1954
1966
|
}
|
|
1955
1967
|
|
|
1968
|
+
@media (min-width: 740px) {
|
|
1969
|
+
.c5 {
|
|
1970
|
+
width: 59px;
|
|
1971
|
+
}
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1956
1974
|
@media (min-width: 1150px) {
|
|
1957
1975
|
.c5 {
|
|
1958
1976
|
width: 72px;
|
|
1959
1977
|
}
|
|
1960
1978
|
}
|
|
1961
1979
|
|
|
1980
|
+
@media (min-width: 740px) {
|
|
1981
|
+
.c33 {
|
|
1982
|
+
width: 59px;
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
|
|
1962
1986
|
@media (min-width: 1150px) {
|
|
1963
1987
|
.c33 {
|
|
1964
1988
|
width: 59px;
|