@comicrelief/component-library 8.86.0 → 8.86.2
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
CHANGED
|
@@ -610,7 +610,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
610
610
|
}
|
|
611
611
|
|
|
612
612
|
// 'isHeader' is only set and passed in Header2025, so the pre-existing Header isn't affected:
|
|
613
|
-
${({$isHeader:e})=>e&&g.css`
|
|
613
|
+
${({$isHeader:e,theme:t})=>e&&g.css`
|
|
614
614
|
overflow: hidden;
|
|
615
615
|
padding-right: 0px;
|
|
616
616
|
transition: padding-right ${iL}s cubic-bezier(0.5, 1.5, 0.5, 0.75);
|
|
@@ -621,7 +621,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
621
621
|
}
|
|
622
622
|
|
|
623
623
|
// No hover state for mobile, so targetting Medium+:
|
|
624
|
-
@media ${
|
|
624
|
+
@media ${t.breakpoints2026("M")} {
|
|
625
625
|
&:hover,
|
|
626
626
|
&:focus {
|
|
627
627
|
img {
|
|
@@ -630,7 +630,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
632
|
|
|
633
|
-
@media ${
|
|
633
|
+
@media ${t.allBreakpoints("NavWide")} {
|
|
634
634
|
&:hover,
|
|
635
635
|
&:focus {
|
|
636
636
|
// Default
|
|
@@ -668,14 +668,17 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
668
668
|
width: 100%;
|
|
669
669
|
height: 100%;
|
|
670
670
|
|
|
671
|
-
${Q1(!0,1.15,2)}
|
|
672
|
-
|
|
673
671
|
&:hover,
|
|
674
672
|
&:focus {
|
|
675
673
|
background-color: ${t.color("grey_4_hover")};
|
|
676
674
|
opacity: 1;
|
|
677
675
|
}
|
|
678
676
|
`}
|
|
677
|
+
|
|
678
|
+
// springScaleAnimation must stay a sibling — nesting it inside the $newStyle css block
|
|
679
|
+
// breaks flattening so rules, it bugs out and compiles as global :hover, :focus
|
|
680
|
+
// when you try to combine them
|
|
681
|
+
${({$newStyle:e})=>e&&Q1(!0,1.15,2)}
|
|
679
682
|
`,aL=g(fe)`
|
|
680
683
|
width: auto;
|
|
681
684
|
color: ${({theme:e})=>e.color("black")};
|
|
@@ -5217,7 +5220,7 @@ gap: ${T("md")};
|
|
|
5217
5220
|
opacity: 0.8;
|
|
5218
5221
|
font-size: 0.875rem;
|
|
5219
5222
|
margin-bottom: ${T("sm")};
|
|
5220
|
-
`,Q7=({navItems:e=[],...t})=>!e||e.length===0?null:f.jsx(uU,{"aria-label":"Primary footer navigation",role:"navigation",children:e.map(r=>{const n=Gi(Ji(r));return f.jsx(dU,{children:f.jsx(fU,{href:n,...t,children:f.jsx(hU,{children:r.title})})},`primary-${n}-${r.title}`)})});Q7.propTypes={navItems:l.arrayOf(l.shape({title:l.string.isRequired,path:l.string,url:l.string,reference:l.shape({path:l.string}),internal:l.shape({type:l.string})}))};const ev=({navItems:e=[],...t})=>!e||e.length===0?null:f.jsx(pU,{"aria-label":"Secondary footer navigation",role:"navigation",children:e.map(r=>{const n=Gi(Ji(r));return f.jsx(gU,{children:f.jsx(mU,{href:n,...t,children:f.jsx(vU,{children:r.title})})},`secondary-${n}-${r.title}`)})});ev.propTypes={navItems:l.arrayOf(l.shape({title:l.string.isRequired,path:l.string,url:l.string,reference:l.shape({path:l.string}),internal:l.shape({type:l.string})}))};const tv=({legalText:e,copyrightText:t,showFacebookSocialIcon:r,showInstagramSocialIcon:n,showXSocialIcon:o,showTikTokSocialIcon:s,showYouTubeSocialIcon:c,onNewsletterSubmit:u,primaryLinksList:p=[],secondaryLinksList:m=[],campaign:h="Comic Relief",additionalLegalLine:v="",showFundraisingRegulatorLogo:b=!1,showEmailSignup:C=!0,animateRotate:x=!0,...$})=>{const w=h.replace(/\s/g,"").toLowerCase(),M=typeof t=="string"?t.trim():"",O=yc({email:_r().nullable().transform(ee=>ee===""?null:ee).email("Please provide a valid email address")}),A=qW({mode:"onBlur",resolver:ZW(O)}),{handleSubmit:F}=A,D=ee=>{u&&u(ee.email)};return f.jsx("div",{children:f.jsx(iU,{...$,children:f.jsxs(oU,{children:[v&&f.jsx(aU,{children:v}),f.jsx(Sl,{$mobileOnly:!0,children:f.jsx(ud,{href:"/",title:`Go to ${h} homepage`,$animateRotate:x,children:f.jsx(Wn,{sizeSm:"59px",sizeMd:"59px",sizeLg:"72px",rotate:!1,campaign:h})})}),f.jsxs(sU,{$hasEmailSignup:C,children:[f.jsxs(lU,{children:[C&&f.jsx(cU,{children:f.jsx(TW,{...A,children:f.jsx("form",{onSubmit:F(D),noValidate:!0,children:f.jsx(J7,{formContext:A})})})}),f.jsx(i5,{$desktopOnly:!0,$inTopSection:!0,children:f.jsx(Ms,{campaign:w,newStyle:!0,invertColor:!0,showFacebookSocialIcon:r,showInstagramSocialIcon:n,showXSocialIcon:o,showTikTokSocialIcon:s,showYouTubeSocialIcon:c})})]}),f.jsx(Sl,{$desktopOnly:!0,$showCRLogoOnly:!0,children:f.jsx(ud,{href:"/",title:`Go to ${h} homepage`,$animateRotate:x,children:f.jsx(Wn,{sizeSm:"59px",sizeMd:"59px",sizeLg:"59px",rotate:!1,campaign:h})})}),f.jsxs(Sl,{$desktopOnly:!0,$showPairedLogos:!0,children:[f.jsx(ud,{href:"/",title:`Go to ${h} homepage`,$animateRotate:x,children:f.jsx(Wn,{sizeSm:"59px",sizeMd:"59px",sizeLg:"59px",rotate:!1,campaign:h})}),b&&f.jsx(M2,{animateOnHover:!0,noMargin:!0})]})]}),f.jsx(Q7,{navItems:p,...$}),f.jsx(i5,{$mobileOnly:!0,children:f.jsx(Ms,{campaign:w,newStyle:!0,invertColor:!0,showFacebookSocialIcon:r,showInstagramSocialIcon:n,showXSocialIcon:o,showTikTokSocialIcon:s,showYouTubeSocialIcon:c})}),f.jsx(ev,{navItems:m,...$}),f.jsxs(yU,{children:[M.length>0&&f.jsx(o5,{children:M}),e&&f.jsx(o5,{children:e})]}),f.jsx(Sl,{$mobileOnly:!0,$showFundraiserAtBottom:!0,children:b&&f.jsx(M2,{noMargin:!0})})]})})})};tv.propTypes={primaryLinksList:l.arrayOf(l.shape({title:l.string,path:l.string,url:l.string,reference:l.shape({path:l.string}),internal:l.shape({type:l.string})})),secondaryLinksList:l.arrayOf(l.shape({title:l.string,path:l.string,url:l.string,reference:l.shape({path:l.string}),internal:l.shape({type:l.string})})),legalText:l.string,copyrightText:l.string,campaign:l.string,additionalLegalLine:l.string,showFundraisingRegulatorLogo:l.bool,showEmailSignup:l.bool,showFacebookSocialIcon:l.bool,showInstagramSocialIcon:l.bool,showXSocialIcon:l.bool,showTikTokSocialIcon:l.bool,showYouTubeSocialIcon:l.bool,animateRotate:l.bool,onNewsletterSubmit:l.func};const bU=g(fe)`
|
|
5223
|
+
`,Q7=({navItems:e=[],...t})=>!e||e.length===0?null:f.jsx(uU,{"aria-label":"Primary footer navigation",role:"navigation",children:e.map(r=>{const n=Gi(Ji(r));return f.jsx(dU,{children:f.jsx(fU,{href:n,...t,children:f.jsx(hU,{children:r.title})})},`primary-${n}-${r.title}`)})});Q7.propTypes={navItems:l.arrayOf(l.shape({title:l.string.isRequired,path:l.string,url:l.string,reference:l.shape({path:l.string}),internal:l.shape({type:l.string})}))};const ev=({navItems:e=[],...t})=>!e||e.length===0?null:f.jsx(pU,{"aria-label":"Secondary footer navigation",role:"navigation",children:e.map(r=>{const n=Gi(Ji(r));return f.jsx(gU,{children:f.jsx(mU,{href:n,...t,children:f.jsx(vU,{children:r.title})})},`secondary-${n}-${r.title}`)})});ev.propTypes={navItems:l.arrayOf(l.shape({title:l.string.isRequired,path:l.string,url:l.string,reference:l.shape({path:l.string}),internal:l.shape({type:l.string})}))};const tv=({legalText:e,copyrightText:t,showFacebookSocialIcon:r,showInstagramSocialIcon:n,showXSocialIcon:o,showTikTokSocialIcon:s,showYouTubeSocialIcon:c,onNewsletterSubmit:u,primaryLinksList:p=[],secondaryLinksList:m=[],campaign:h="Comic Relief",additionalLegalLine:v="",showFundraisingRegulatorLogo:b=!1,showEmailSignup:C=!0,animateRotate:x=!0,...$})=>{const w=h.replace(/\s/g,"").toLowerCase(),M=typeof t=="string"?t.trim():"",O=yc({email:_r().nullable().transform(ee=>ee===""?null:ee).email("Please provide a valid email address")}),A=qW({mode:"onBlur",resolver:ZW(O)}),{handleSubmit:F}=A,D=ee=>{u&&u(ee.email)};return f.jsx("div",{children:f.jsx(iU,{...$,children:f.jsxs(oU,{children:[v&&f.jsx(aU,{children:v}),f.jsx(Sl,{$mobileOnly:!0,children:f.jsx(ud,{href:"/",title:`Go to ${h} homepage`,$animateRotate:x,children:f.jsx(Wn,{sizeSm:"59px",sizeMd:"59px",sizeLg:"72px",rotate:!1,campaign:h})})}),f.jsxs(sU,{$hasEmailSignup:C,children:[f.jsxs(lU,{children:[C&&f.jsx(cU,{children:f.jsx(TW,{...A,children:f.jsx("form",{onSubmit:F(D),noValidate:!0,children:f.jsx(J7,{formContext:A})})})}),f.jsx(i5,{$desktopOnly:!0,$inTopSection:!0,children:f.jsx(Ms,{campaign:w,newStyle:!0,invertColor:!0,showFacebookSocialIcon:r,showInstagramSocialIcon:n,showXSocialIcon:o,showTikTokSocialIcon:s,showYouTubeSocialIcon:c})})]}),f.jsx(Sl,{$desktopOnly:!0,$showCRLogoOnly:!0,children:f.jsx(ud,{href:"/",title:`Go to ${h} homepage`,$animateRotate:x,children:f.jsx(Wn,{sizeSm:"59px",sizeMd:"59px",sizeLg:"59px",rotate:!1,campaign:h})})}),f.jsxs(Sl,{$desktopOnly:!0,$showPairedLogos:!0,children:[f.jsx(ud,{href:"/",title:`Go to ${h} homepage`,$animateRotate:x,children:f.jsx(Wn,{sizeSm:"59px",sizeMd:"59px",sizeLg:"59px",rotate:!1,campaign:h})}),b&&f.jsx(M2,{animateOnHover:!0,noMargin:!0})]})]}),f.jsx(Q7,{navItems:p,...$}),f.jsx(i5,{$mobileOnly:!0,children:f.jsx(Ms,{campaign:w,newStyle:!0,invertColor:!0,showFacebookSocialIcon:r,showInstagramSocialIcon:n,showXSocialIcon:o,showTikTokSocialIcon:s,showYouTubeSocialIcon:c})}),f.jsx(ev,{navItems:m,...$}),f.jsxs(yU,{"data-testid":"footer-copyright",children:[M.length>0&&f.jsx(o5,{children:M}),e&&f.jsx(o5,{children:e})]}),f.jsx(Sl,{$mobileOnly:!0,$showFundraiserAtBottom:!0,children:b&&f.jsx(M2,{noMargin:!0})})]})})})};tv.propTypes={primaryLinksList:l.arrayOf(l.shape({title:l.string,path:l.string,url:l.string,reference:l.shape({path:l.string}),internal:l.shape({type:l.string})})),secondaryLinksList:l.arrayOf(l.shape({title:l.string,path:l.string,url:l.string,reference:l.shape({path:l.string}),internal:l.shape({type:l.string})})),legalText:l.string,copyrightText:l.string,campaign:l.string,additionalLegalLine:l.string,showFundraisingRegulatorLogo:l.bool,showEmailSignup:l.bool,showFacebookSocialIcon:l.bool,showInstagramSocialIcon:l.bool,showXSocialIcon:l.bool,showTikTokSocialIcon:l.bool,showYouTubeSocialIcon:l.bool,animateRotate:l.bool,onNewsletterSubmit:l.func};const bU=g(fe)`
|
|
5221
5224
|
${sn};
|
|
5222
5225
|
`,I1=g.span`
|
|
5223
5226
|
background-color: ${({theme:e})=>e.color("deep_violet_dark")};
|
package/dist/index.es.js
CHANGED
|
@@ -7025,7 +7025,7 @@ const xE = /* @__PURE__ */ Go(wr), CE = 55, $E = 0.35, _E = b.a`
|
|
|
7025
7025
|
}
|
|
7026
7026
|
|
|
7027
7027
|
// 'isHeader' is only set and passed in Header2025, so the pre-existing Header isn't affected:
|
|
7028
|
-
${({ $isHeader: e }) => e && X`
|
|
7028
|
+
${({ $isHeader: e, theme: t }) => e && X`
|
|
7029
7029
|
overflow: hidden;
|
|
7030
7030
|
padding-right: 0px;
|
|
7031
7031
|
transition: padding-right ${$E}s cubic-bezier(0.5, 1.5, 0.5, 0.75);
|
|
@@ -7036,7 +7036,7 @@ const xE = /* @__PURE__ */ Go(wr), CE = 55, $E = 0.35, _E = b.a`
|
|
|
7036
7036
|
}
|
|
7037
7037
|
|
|
7038
7038
|
// No hover state for mobile, so targetting Medium+:
|
|
7039
|
-
@media ${
|
|
7039
|
+
@media ${t.breakpoints2026("M")} {
|
|
7040
7040
|
&:hover,
|
|
7041
7041
|
&:focus {
|
|
7042
7042
|
img {
|
|
@@ -7045,7 +7045,7 @@ const xE = /* @__PURE__ */ Go(wr), CE = 55, $E = 0.35, _E = b.a`
|
|
|
7045
7045
|
}
|
|
7046
7046
|
}
|
|
7047
7047
|
|
|
7048
|
-
@media ${
|
|
7048
|
+
@media ${t.allBreakpoints("NavWide")} {
|
|
7049
7049
|
&:hover,
|
|
7050
7050
|
&:focus {
|
|
7051
7051
|
// Default
|
|
@@ -7083,14 +7083,17 @@ const xE = /* @__PURE__ */ Go(wr), CE = 55, $E = 0.35, _E = b.a`
|
|
|
7083
7083
|
width: 100%;
|
|
7084
7084
|
height: 100%;
|
|
7085
7085
|
|
|
7086
|
-
${g4(!0, 1.15, 2)}
|
|
7087
|
-
|
|
7088
7086
|
&:hover,
|
|
7089
7087
|
&:focus {
|
|
7090
7088
|
background-color: ${t.color("grey_4_hover")};
|
|
7091
7089
|
opacity: 1;
|
|
7092
7090
|
}
|
|
7093
7091
|
`}
|
|
7092
|
+
|
|
7093
|
+
// springScaleAnimation must stay a sibling — nesting it inside the $newStyle css block
|
|
7094
|
+
// breaks flattening so rules, it bugs out and compiles as global :hover, :focus
|
|
7095
|
+
// when you try to combine them
|
|
7096
|
+
${({ $newStyle: e }) => e && g4(!0, 1.15, 2)}
|
|
7094
7097
|
`, kE = b(he)`
|
|
7095
7098
|
width: auto;
|
|
7096
7099
|
color: ${({ theme: e }) => e.color("black")};
|
|
@@ -28435,7 +28438,7 @@ const xq = ({
|
|
|
28435
28438
|
}
|
|
28436
28439
|
) }),
|
|
28437
28440
|
/* @__PURE__ */ g(_7, { navItems: p, ...$ }),
|
|
28438
|
-
/* @__PURE__ */ z(wq, { children: [
|
|
28441
|
+
/* @__PURE__ */ z(wq, { "data-testid": "footer-copyright", children: [
|
|
28439
28442
|
M.length > 0 && /* @__PURE__ */ g(c5, { children: M }),
|
|
28440
28443
|
e && /* @__PURE__ */ g(c5, { children: e })
|
|
28441
28444
|
] }),
|
package/package.json
CHANGED
|
@@ -22,7 +22,7 @@ const StyledLink = styled.a`
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
// 'isHeader' is only set and passed in Header2025, so the pre-existing Header isn't affected:
|
|
25
|
-
${({ $isHeader }) => $isHeader && css`
|
|
25
|
+
${({ $isHeader, theme }) => $isHeader && css`
|
|
26
26
|
overflow: hidden;
|
|
27
27
|
padding-right: 0px;
|
|
28
28
|
transition: padding-right ${RevealTextSpeed}s cubic-bezier(0.5, 1.5, 0.5, 0.75);
|
|
@@ -33,7 +33,7 @@ const StyledLink = styled.a`
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
// No hover state for mobile, so targetting Medium+:
|
|
36
|
-
@media ${
|
|
36
|
+
@media ${theme.breakpoints2026('M')} {
|
|
37
37
|
&:hover,
|
|
38
38
|
&:focus {
|
|
39
39
|
img {
|
|
@@ -42,7 +42,7 @@ const StyledLink = styled.a`
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
@media ${
|
|
45
|
+
@media ${theme.allBreakpoints('NavWide')} {
|
|
46
46
|
&:hover,
|
|
47
47
|
&:focus {
|
|
48
48
|
// Default
|
|
@@ -80,14 +80,17 @@ const StyledLink = styled.a`
|
|
|
80
80
|
width: 100%;
|
|
81
81
|
height: 100%;
|
|
82
82
|
|
|
83
|
-
${springScaleAnimation(true, 1.15, 2)}
|
|
84
|
-
|
|
85
83
|
&:hover,
|
|
86
84
|
&:focus {
|
|
87
85
|
background-color: ${theme.color('grey_4_hover')};
|
|
88
86
|
opacity: 1;
|
|
89
87
|
}
|
|
90
88
|
`}
|
|
89
|
+
|
|
90
|
+
// springScaleAnimation must stay a sibling — nesting it inside the $newStyle css block
|
|
91
|
+
// breaks flattening so rules, it bugs out and compiles as global :hover, :focus
|
|
92
|
+
// when you try to combine them
|
|
93
|
+
${({ $newStyle }) => $newStyle && springScaleAnimation(true, 1.15, 2)}
|
|
91
94
|
`;
|
|
92
95
|
|
|
93
96
|
const RevealText = styled(Text)`
|
|
@@ -138,7 +138,7 @@ const FooterNew = ({
|
|
|
138
138
|
|
|
139
139
|
<SecondaryNav navItems={secondaryLinksList} {...rest} />
|
|
140
140
|
|
|
141
|
-
<FooterCopyright>
|
|
141
|
+
<FooterCopyright data-testid="footer-copyright">
|
|
142
142
|
{displayCopyrightText.length > 0 && (
|
|
143
143
|
<FooterCopyrightText>
|
|
144
144
|
{displayCopyrightText}
|
|
@@ -89,13 +89,13 @@ exports[`does not render copyright text when not supplied 1`] = `
|
|
|
89
89
|
|
|
90
90
|
.c29:hover,
|
|
91
91
|
.c29:focus {
|
|
92
|
-
|
|
92
|
+
background-color: #3A3A3A;
|
|
93
|
+
opacity: 1;
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
.c29:hover,
|
|
96
97
|
.c29:focus {
|
|
97
|
-
|
|
98
|
-
opacity: 1;
|
|
98
|
+
transform: scale(1.15);
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
.c31 {
|
|
@@ -1325,6 +1325,7 @@ exports[`does not render copyright text when not supplied 1`] = `
|
|
|
1325
1325
|
</nav>
|
|
1326
1326
|
<div
|
|
1327
1327
|
className="c44"
|
|
1328
|
+
data-testid="footer-copyright"
|
|
1328
1329
|
>
|
|
1329
1330
|
<p
|
|
1330
1331
|
className="c17 c45"
|
|
@@ -1429,13 +1430,13 @@ exports[`renders correctly 1`] = `
|
|
|
1429
1430
|
|
|
1430
1431
|
.c29:hover,
|
|
1431
1432
|
.c29:focus {
|
|
1432
|
-
|
|
1433
|
+
background-color: #3A3A3A;
|
|
1434
|
+
opacity: 1;
|
|
1433
1435
|
}
|
|
1434
1436
|
|
|
1435
1437
|
.c29:hover,
|
|
1436
1438
|
.c29:focus {
|
|
1437
|
-
|
|
1438
|
-
opacity: 1;
|
|
1439
|
+
transform: scale(1.15);
|
|
1439
1440
|
}
|
|
1440
1441
|
|
|
1441
1442
|
.c31 {
|
|
@@ -2665,6 +2666,7 @@ exports[`renders correctly 1`] = `
|
|
|
2665
2666
|
</nav>
|
|
2666
2667
|
<div
|
|
2667
2668
|
className="c44"
|
|
2669
|
+
data-testid="footer-copyright"
|
|
2668
2670
|
>
|
|
2669
2671
|
<p
|
|
2670
2672
|
className="c17 c45"
|