@comicrelief/component-library 8.86.1 → 8.86.3

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
@@ -4806,8 +4806,8 @@ attempted value: ${c}
4806
4806
  display: block;
4807
4807
  }
4808
4808
 
4809
- ${({animateOnHover:e})=>e&&Q1(!0,1.03,1)}
4810
- `,M2=({animateOnHover:e=!1,noMargin:t=!1})=>f.jsx(vW,{animateOnHover:e,$noMargin:t,children:f.jsx("a",{href:"https://www.fundraisingregulator.org.uk/validate?registrant=COMIC+RELIEF",className:"fr-digital-badge",style:{height:"auto",width:"150px",textDecoration:"none"},target:"_blank",children:f.jsx("img",{src:"https://www.fundraisingregulator.org.uk/fr-badge/80983ed7-ea80-40db-8e52-4a3351d9e77d/en/white",width:"100%",alt:"Fundraising Regulator badge with validation link",loading:"lazy"})})});M2.propTypes={animateOnHover:l.bool,noMargin:l.bool};const yW=g.footer.attrs(()=>({role:"banner"}))`
4809
+ ${({$animateOnHover:e})=>e&&Q1(!0,1.03,1)}
4810
+ `,M2=({animateOnHover:e=!1,noMargin:t=!1})=>f.jsx(vW,{$animateOnHover:e,$noMargin:t,children:f.jsx("a",{href:"https://www.fundraisingregulator.org.uk/validate?registrant=COMIC+RELIEF",className:"fr-digital-badge",style:{height:"auto",width:"150px",textDecoration:"none"},target:"_blank",children:f.jsx("img",{src:"https://www.fundraisingregulator.org.uk/fr-badge/80983ed7-ea80-40db-8e52-4a3351d9e77d/en/white",width:"100%",alt:"Fundraising Regulator badge with validation link",loading:"lazy"})})});M2.propTypes={animateOnHover:l.bool,noMargin:l.bool};const yW=g.footer.attrs(()=>({role:"banner"}))`
4811
4811
  text-align: center;
4812
4812
  line-height: initial;
4813
4813
  background: #222;
@@ -5191,9 +5191,6 @@ gap: ${T("md")};
5191
5191
  justify-content: ${({$desktopOnly:e,$showCRLogoOnly:t,$showFundraiserAtBottom:r})=>r?"flex-start":e&&t||e?"flex-end":"center"};
5192
5192
  }
5193
5193
 
5194
-
5195
- }
5196
-
5197
5194
  @media ${({theme:e})=>e.breakpoints2026("L")} {
5198
5195
  display: ${({$desktopOnly:e,$mobileOnly:t,$showCRLogoOnly:r,$showPairedLogos:n,$showFundraiserAtBottom:o})=>t&&o||t||e&&r?"none":e&&n?"flex":e?"none":"flex"};
5199
5196
  }
@@ -5220,7 +5217,7 @@ gap: ${T("md")};
5220
5217
  opacity: 0.8;
5221
5218
  font-size: 0.875rem;
5222
5219
  margin-bottom: ${T("sm")};
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,{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)`
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,{"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)`
5224
5221
  ${sn};
5225
5222
  `,I1=g.span`
5226
5223
  background-color: ${({theme:e})=>e.color("deep_violet_dark")};
package/dist/index.es.js CHANGED
@@ -26604,8 +26604,8 @@ const yU = b.div`
26604
26604
  display: block;
26605
26605
  }
26606
26606
 
26607
- ${({ animateOnHover: e }) => e && g4(!0, 1.03, 1)}
26608
- `, R2 = ({ animateOnHover: e = !1, noMargin: t = !1 }) => /* @__PURE__ */ g(yU, { animateOnHover: e, $noMargin: t, children: /* @__PURE__ */ g("a", { href: "https://www.fundraisingregulator.org.uk/validate?registrant=COMIC+RELIEF", className: "fr-digital-badge", style: { height: "auto", width: "150px", textDecoration: "none" }, target: "_blank", children: /* @__PURE__ */ g("img", { src: "https://www.fundraisingregulator.org.uk/fr-badge/80983ed7-ea80-40db-8e52-4a3351d9e77d/en/white", width: "100%", alt: "Fundraising Regulator badge with validation link", loading: "lazy" }) }) });
26607
+ ${({ $animateOnHover: e }) => e && g4(!0, 1.03, 1)}
26608
+ `, R2 = ({ animateOnHover: e = !1, noMargin: t = !1 }) => /* @__PURE__ */ g(yU, { $animateOnHover: e, $noMargin: t, children: /* @__PURE__ */ g("a", { href: "https://www.fundraisingregulator.org.uk/validate?registrant=COMIC+RELIEF", className: "fr-digital-badge", style: { height: "auto", width: "150px", textDecoration: "none" }, target: "_blank", children: /* @__PURE__ */ g("img", { src: "https://www.fundraisingregulator.org.uk/fr-badge/80983ed7-ea80-40db-8e52-4a3351d9e77d/en/white", width: "100%", alt: "Fundraising Regulator badge with validation link", loading: "lazy" }) }) });
26609
26609
  R2.propTypes = {
26610
26610
  /** Animate the logo on hover with spring scale animation */
26611
26611
  animateOnHover: l.bool,
@@ -28284,9 +28284,6 @@ gap: ${O("md")};
28284
28284
  justify-content: ${({ $desktopOnly: e, $showCRLogoOnly: t, $showFundraiserAtBottom: r }) => r ? "flex-start" : e && t || e ? "flex-end" : "center"};
28285
28285
  }
28286
28286
 
28287
-
28288
- }
28289
-
28290
28287
  @media ${({ theme: e }) => e.breakpoints2026("L")} {
28291
28288
  display: ${({
28292
28289
  $desktopOnly: e,
@@ -28438,7 +28435,7 @@ const xq = ({
28438
28435
  }
28439
28436
  ) }),
28440
28437
  /* @__PURE__ */ g(_7, { navItems: p, ...$ }),
28441
- /* @__PURE__ */ z(wq, { children: [
28438
+ /* @__PURE__ */ z(wq, { "data-testid": "footer-copyright", children: [
28442
28439
  M.length > 0 && /* @__PURE__ */ g(c5, { children: M }),
28443
28440
  e && /* @__PURE__ */ g(c5, { children: e })
28444
28441
  ] }),
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.86.1",
4
+ "version": "8.86.3",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
7
7
  "files": [
@@ -14,11 +14,11 @@ const FundraisingRegulatorWrapper = styled.div`
14
14
  display: block;
15
15
  }
16
16
 
17
- ${({ animateOnHover }) => animateOnHover && springScaleAnimation(true, 1.03, 1)}
17
+ ${({ $animateOnHover }) => $animateOnHover && springScaleAnimation(true, 1.03, 1)}
18
18
  `;
19
19
 
20
20
  const FundraisingRegulatorLogo = ({ animateOnHover = false, noMargin = false }) => (
21
- <FundraisingRegulatorWrapper animateOnHover={animateOnHover} $noMargin={noMargin}>
21
+ <FundraisingRegulatorWrapper $animateOnHover={animateOnHover} $noMargin={noMargin}>
22
22
  {/* Code from https://www.fundraisingregulator.org.uk/ */}
23
23
  {/* eslint-disable-next-line react/jsx-no-target-blank */}
24
24
  <a href="https://www.fundraisingregulator.org.uk/validate?registrant=COMIC+RELIEF" className="fr-digital-badge" style={{ height: 'auto', width: '150px', textDecoration: 'none' }} target="_blank">
@@ -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}
@@ -236,9 +236,6 @@ const LogosContainer = styled.div`
236
236
  }};
237
237
  }
238
238
 
239
-
240
- }
241
-
242
239
  @media ${({ theme }) => theme.breakpoints2026('L')} {
243
240
  display: ${({
244
241
  $desktopOnly, $mobileOnly, $showCRLogoOnly, $showPairedLogos, $showFundraiserAtBottom
@@ -817,6 +817,12 @@ exports[`does not render copyright text when not supplied 1`] = `
817
817
  }
818
818
  }
819
819
 
820
+ @media (min-width: 1024px) {
821
+ .c2 {
822
+ display: none;
823
+ }
824
+ }
825
+
820
826
  @media (min-width: 740px) {
821
827
  .c32 {
822
828
  flex: 0 0 auto;
@@ -828,6 +834,12 @@ exports[`does not render copyright text when not supplied 1`] = `
828
834
  }
829
835
  }
830
836
 
837
+ @media (min-width: 1024px) {
838
+ .c32 {
839
+ display: none;
840
+ }
841
+ }
842
+
831
843
  @media (min-width: 740px) {
832
844
  .c34 {
833
845
  flex: 0 0 auto;
@@ -839,6 +851,12 @@ exports[`does not render copyright text when not supplied 1`] = `
839
851
  }
840
852
  }
841
853
 
854
+ @media (min-width: 1024px) {
855
+ .c34 {
856
+ display: flex;
857
+ }
858
+ }
859
+
842
860
  @media (min-width: 740px) {
843
861
  .c46 {
844
862
  flex: 0 0 auto;
@@ -850,6 +868,12 @@ exports[`does not render copyright text when not supplied 1`] = `
850
868
  }
851
869
  }
852
870
 
871
+ @media (min-width: 1024px) {
872
+ .c46 {
873
+ display: none;
874
+ }
875
+ }
876
+
853
877
  @media (min-width: 1024px) {
854
878
  .c44 {
855
879
  margin-bottom: 0;
@@ -1325,6 +1349,7 @@ exports[`does not render copyright text when not supplied 1`] = `
1325
1349
  </nav>
1326
1350
  <div
1327
1351
  className="c44"
1352
+ data-testid="footer-copyright"
1328
1353
  >
1329
1354
  <p
1330
1355
  className="c17 c45"
@@ -2157,6 +2182,12 @@ exports[`renders correctly 1`] = `
2157
2182
  }
2158
2183
  }
2159
2184
 
2185
+ @media (min-width: 1024px) {
2186
+ .c2 {
2187
+ display: none;
2188
+ }
2189
+ }
2190
+
2160
2191
  @media (min-width: 740px) {
2161
2192
  .c32 {
2162
2193
  flex: 0 0 auto;
@@ -2168,6 +2199,12 @@ exports[`renders correctly 1`] = `
2168
2199
  }
2169
2200
  }
2170
2201
 
2202
+ @media (min-width: 1024px) {
2203
+ .c32 {
2204
+ display: none;
2205
+ }
2206
+ }
2207
+
2171
2208
  @media (min-width: 740px) {
2172
2209
  .c34 {
2173
2210
  flex: 0 0 auto;
@@ -2179,6 +2216,12 @@ exports[`renders correctly 1`] = `
2179
2216
  }
2180
2217
  }
2181
2218
 
2219
+ @media (min-width: 1024px) {
2220
+ .c34 {
2221
+ display: flex;
2222
+ }
2223
+ }
2224
+
2182
2225
  @media (min-width: 740px) {
2183
2226
  .c46 {
2184
2227
  flex: 0 0 auto;
@@ -2190,6 +2233,12 @@ exports[`renders correctly 1`] = `
2190
2233
  }
2191
2234
  }
2192
2235
 
2236
+ @media (min-width: 1024px) {
2237
+ .c46 {
2238
+ display: none;
2239
+ }
2240
+ }
2241
+
2193
2242
  @media (min-width: 1024px) {
2194
2243
  .c44 {
2195
2244
  margin-bottom: 0;
@@ -2665,6 +2714,7 @@ exports[`renders correctly 1`] = `
2665
2714
  </nav>
2666
2715
  <div
2667
2716
  className="c44"
2717
+ data-testid="footer-copyright"
2668
2718
  >
2669
2719
  <p
2670
2720
  className="c17 c45"