@comicrelief/component-library 7.24.1 → 7.25.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 (277) hide show
  1. package/.github/workflows/main.yml +22 -24
  2. package/dist/components/Atoms/Button/Button.js +21 -15
  3. package/dist/components/Atoms/Button/Button.test.js +3 -3
  4. package/dist/components/Atoms/ButtonWithStates/ButtonWithStates.js +19 -22
  5. package/dist/components/Atoms/Checkbox/Checkbox.js +42 -26
  6. package/dist/components/Atoms/Checkbox/Checkbox.test.js +3 -3
  7. package/dist/components/Atoms/Confetti/Confetti.js +20 -23
  8. package/dist/components/Atoms/Confetti/_TriggerConfetti.js +4 -11
  9. package/dist/components/Atoms/ErrorText/ErrorText.js +15 -11
  10. package/dist/components/Atoms/ErrorText/ErrorText.test.js +3 -3
  11. package/dist/components/Atoms/Icons/Arrow.js +16 -15
  12. package/dist/components/Atoms/Icons/AtSign.js +9 -9
  13. package/dist/components/Atoms/Icons/Chevron.js +16 -15
  14. package/dist/components/Atoms/Icons/Curve.js +16 -18
  15. package/dist/components/Atoms/Icons/Download.js +8 -8
  16. package/dist/components/Atoms/Icons/External.js +8 -8
  17. package/dist/components/Atoms/Icons/Favourite.js +8 -8
  18. package/dist/components/Atoms/Icons/Internal.js +8 -8
  19. package/dist/components/Atoms/Icons/index.js +8 -8
  20. package/dist/components/Atoms/Input/Input.js +38 -33
  21. package/dist/components/Atoms/Input/input.test.js +3 -3
  22. package/dist/components/Atoms/Label/Label.js +28 -23
  23. package/dist/components/Atoms/Link/Link.js +24 -29
  24. package/dist/components/Atoms/Link/Link.style.js +51 -40
  25. package/dist/components/Atoms/Link/Link.test.js +9 -9
  26. package/dist/components/Atoms/Logo/Logo.js +16 -18
  27. package/dist/components/Atoms/Logo/Logo.test.js +3 -3
  28. package/dist/components/Atoms/Pagination/Item/Item.js +7 -7
  29. package/dist/components/Atoms/Pagination/Item/Item.style.js +35 -28
  30. package/dist/components/Atoms/Pagination/List/List.js +21 -19
  31. package/dist/components/Atoms/Pagination/Pagination.js +41 -49
  32. package/dist/components/Atoms/Pagination/Pagination.test.js +54 -108
  33. package/dist/components/Atoms/Pagination/Utils/PaginationCalculator.js +15 -15
  34. package/dist/components/Atoms/Picture/Picture.js +34 -44
  35. package/dist/components/Atoms/Picture/Picture.test.js +5 -5
  36. package/dist/components/Atoms/RadioButton/RadioButton.js +35 -23
  37. package/dist/components/Atoms/RadioButton/RadioButton.test.js +3 -3
  38. package/dist/components/Atoms/RichText/RichText.js +9 -11
  39. package/dist/components/Atoms/RichText/RichText.test.js +4 -4
  40. package/dist/components/Atoms/Select/Select.js +56 -49
  41. package/dist/components/Atoms/Select/Select.test.js +3 -3
  42. package/dist/components/Atoms/SocialIcons/Icon/Icon.js +13 -13
  43. package/dist/components/Atoms/SocialIcons/SocialIcons.js +25 -23
  44. package/dist/components/Atoms/SocialIcons/SocialIcons.test.js +7 -7
  45. package/dist/components/Atoms/SocialIcons/Utils/Icons.js +1 -1
  46. package/dist/components/Atoms/SocialIcons/Utils/Links.js +19 -20
  47. package/dist/components/Atoms/Text/Text.js +62 -41
  48. package/dist/components/Atoms/Text/Text.test.js +11 -11
  49. package/dist/components/Atoms/TextArea/TextArea.js +18 -17
  50. package/dist/components/Atoms/TextArea/TextArea.test.js +3 -3
  51. package/dist/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.js +69 -86
  52. package/dist/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.style.js +23 -15
  53. package/dist/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.test.js +15 -19
  54. package/dist/components/Molecules/Accordion/Accordion.js +35 -32
  55. package/dist/components/Molecules/Accordion/Accordion.test.js +3 -3
  56. package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.js +81 -52
  57. package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.test.js +5 -5
  58. package/dist/components/Molecules/Banner/Banner.js +21 -13
  59. package/dist/components/Molecules/Banner/Banner.test.js +3 -3
  60. package/dist/components/Molecules/Box/Box.js +33 -27
  61. package/dist/components/Molecules/Box/Box.test.js +5 -5
  62. package/dist/components/Molecules/Card/Card.js +22 -22
  63. package/dist/components/Molecules/Card/Card.test.js +5 -5
  64. package/dist/components/Molecules/CardDs/CardDs.js +80 -55
  65. package/dist/components/Molecules/CardDs/CardDs.test.js +3 -3
  66. package/dist/components/Molecules/Chip/Chip.js +8 -6
  67. package/dist/components/Molecules/Chip/Chip.style.js +48 -28
  68. package/dist/components/Molecules/Chip/Chip.test.js +4 -6
  69. package/dist/components/Molecules/Countdown/Countdown.js +28 -36
  70. package/dist/components/Molecules/Countdown/Countdown.style.js +3 -3
  71. package/dist/components/Molecules/Descriptor/Descriptor.js +32 -26
  72. package/dist/components/Molecules/Descriptor/Descriptor.test.js +5 -5
  73. package/dist/components/Molecules/DoubleCopy/DoubleCopy.js +6 -4
  74. package/dist/components/Molecules/DoubleCopy/DoubleCopy.style.js +7 -5
  75. package/dist/components/Molecules/DoubleCopy/DoubleCopy.test.js +4 -4
  76. package/dist/components/Molecules/HeroBanner/HeroBanner.js +13 -17
  77. package/dist/components/Molecules/InfoBanner/InfoBanner.js +22 -18
  78. package/dist/components/Molecules/InfoBanner/InfoBanner.test.js +10 -10
  79. package/dist/components/Molecules/Logos/Logos.js +26 -14
  80. package/dist/components/Molecules/Logos/Logos.md +5 -0
  81. package/dist/components/Molecules/Lookup/Lookup.js +49 -84
  82. package/dist/components/Molecules/PartnerLink/PartnerLink.js +10 -11
  83. package/dist/components/Molecules/PartnerLink/PartnerLink.style.js +15 -9
  84. package/dist/components/Molecules/PartnerLink/PartnerLink.test.js +3 -3
  85. package/dist/components/Molecules/Promo/Promo.js +30 -36
  86. package/dist/components/Molecules/Promo/Promo.style.js +44 -31
  87. package/dist/components/Molecules/Promo/Promo.test.js +6 -6
  88. package/dist/components/Molecules/Promo/_ProgressRing.js +13 -19
  89. package/dist/components/Molecules/Promo/_PromoVideo.js +25 -34
  90. package/dist/components/Molecules/Promo/_PromoVideoButton.js +7 -7
  91. package/dist/components/Molecules/Promo/_PromoVideoButton.style.js +68 -41
  92. package/dist/components/Molecules/SchoolLookup/SchoolLookup.js +29 -52
  93. package/dist/components/Molecules/SchoolLookup/SchoolLookup.test.js +4 -4
  94. package/dist/components/Molecules/SearchInput/SearchInput.js +8 -8
  95. package/dist/components/Molecules/SearchInput/SearchInput.style.js +22 -14
  96. package/dist/components/Molecules/SearchInput/SearchInput.test.js +4 -4
  97. package/dist/components/Molecules/SearchResult/SearchResult.js +43 -29
  98. package/dist/components/Molecules/SearchResult/SearchResult.test.js +9 -9
  99. package/dist/components/Molecules/ShareButton/ShareButton.js +22 -26
  100. package/dist/components/Molecules/ShareButton/ShareButton.style.js +5 -5
  101. package/dist/components/Molecules/ShareButton/ShareButton.test.js +3 -3
  102. package/dist/components/Molecules/ShareButton/assets/ShareIcons.js +2 -2
  103. package/dist/components/Molecules/SimpleSchoolLookup/SimpleSchoolLookup.js +28 -55
  104. package/dist/components/Molecules/SingleMessage/SingleMessage.js +99 -123
  105. package/dist/components/Molecules/SingleMessage/SingleMessage.style.js +132 -81
  106. package/dist/components/Molecules/SingleMessage/SingleMessage.test.js +13 -13
  107. package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.js +31 -40
  108. package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.style.js +85 -49
  109. package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.test.js +3 -3
  110. package/dist/components/Molecules/Typeahead/Typeahead.js +47 -84
  111. package/dist/components/Molecules/Typeahead/Typeahead.test.js +12 -35
  112. package/dist/components/Molecules/VideoBanner/VideoBanner.js +20 -25
  113. package/dist/components/Molecules/VideoBanner/VideoBanner.test.js +4 -4
  114. package/dist/components/Organisms/CookieBanner/CookieBanner.js +7 -5
  115. package/dist/components/Organisms/CookieBanner/CookieBanner.style.js +21 -13
  116. package/dist/components/Organisms/CookieBanner/CookieBanner.test.js +5 -5
  117. package/dist/components/Organisms/Donate/Donate.js +42 -39
  118. package/dist/components/Organisms/Donate/Donate.md +85 -0
  119. package/dist/components/Organisms/Donate/Donate.style.js +85 -53
  120. package/dist/components/Organisms/Donate/Donate.test.js +10 -10
  121. package/dist/components/Organisms/Donate/Form/Form.js +64 -80
  122. package/dist/components/Organisms/Donate/Form/PopUpComponent.js +25 -30
  123. package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.js +11 -13
  124. package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.style.js +38 -22
  125. package/dist/components/Organisms/Donate/MoneyBuy/MoneyBuy.js +47 -30
  126. package/dist/components/Organisms/EmailSignUp/EmailSignUp.style.js +63 -37
  127. package/dist/components/Organisms/EmailSignUp/EmailSignUp.test.js +12 -12
  128. package/dist/components/Organisms/EmailSignUp/EmailSignUpForm.js +23 -43
  129. package/dist/components/Organisms/EmailSignUp/_EmailSignUp.js +25 -21
  130. package/dist/components/Organisms/EmailSignUp/_EmailSignUpConfig.js +10 -9
  131. package/dist/components/Organisms/EmailSignUp/_TextInput.js +20 -18
  132. package/dist/components/Organisms/Footer/Footer.js +10 -10
  133. package/dist/components/Organisms/Footer/Footer.style.js +27 -21
  134. package/dist/components/Organisms/Footer/Footer.test.js +3 -3
  135. package/dist/components/Organisms/Footer/Nav/Nav.js +59 -70
  136. package/dist/components/Organisms/Footer/Nav/Nav.style.js +77 -43
  137. package/dist/components/Organisms/Header/Burger/BurgerMenu.js +6 -4
  138. package/dist/components/Organisms/Header/Burger/BurgerMenu.style.js +37 -21
  139. package/dist/components/Organisms/Header/Header.js +8 -8
  140. package/dist/components/Organisms/Header/Header.style.js +27 -19
  141. package/dist/components/Organisms/Header/Nav/Nav.js +39 -50
  142. package/dist/components/Organisms/Header/Nav/Nav.style.js +103 -57
  143. package/dist/components/Organisms/Header/header.test.js +1 -1
  144. package/dist/components/Organisms/ImpactSlider/ImpactMoneybuys.style.js +32 -29
  145. package/dist/components/Organisms/ImpactSlider/ImpactSlider.js +19 -22
  146. package/dist/components/Organisms/ImpactSlider/ImpactSlider.style.js +38 -24
  147. package/dist/components/Organisms/ImpactSlider/Slider.style.js +8 -14
  148. package/dist/components/Organisms/ImpactSlider/_ImpactMoneybuys.js +11 -11
  149. package/dist/components/Organisms/ImpactSlider/_Slider.js +9 -7
  150. package/dist/components/Organisms/ImpactSlider/_utils.js +11 -11
  151. package/dist/components/Organisms/MarketingPreferencesDS/MarketingPreferencesDS.style.js +61 -38
  152. package/dist/components/Organisms/MarketingPreferencesDS/MarketingPreferencesDSForm.js +24 -16
  153. package/dist/components/Organisms/MarketingPreferencesDS/_AssociatedFields.js +1 -1
  154. package/dist/components/Organisms/MarketingPreferencesDS/_CheckAnswer.js +20 -16
  155. package/dist/components/Organisms/MarketingPreferencesDS/_DefaultCopy.js +3 -3
  156. package/dist/components/Organisms/MarketingPreferencesDS/_MarketingPreferencesDS.js +46 -36
  157. package/dist/components/Organisms/MarketingPreferencesDS/_MarketingPrefsConfig.js +21 -34
  158. package/dist/components/Organisms/MarketingPreferencesDS/_TextInput.js +20 -18
  159. package/dist/components/Organisms/Membership/Form/Form.js +48 -81
  160. package/dist/components/Organisms/Membership/Membership.js +17 -15
  161. package/dist/components/Organisms/Membership/Membership.style.js +81 -51
  162. package/dist/components/Organisms/Membership/Membership.test.js +4 -4
  163. package/dist/components/Organisms/Membership/MoneyBox/MoneyBox.js +37 -26
  164. package/dist/hoc/shallowWithTheme.js +1 -1
  165. package/dist/index.js +67 -67
  166. package/dist/styleguide/CRLogo.js +2 -2
  167. package/dist/styleguide/StyleGuideRenderer.js +9 -7
  168. package/dist/styleguide/ThemeWrapper.js +5 -3
  169. package/dist/styleguide/data/data.js +3 -3
  170. package/dist/theme/crTheme/buttonColors.js +6 -5
  171. package/dist/theme/crTheme/colors.js +4 -3
  172. package/dist/theme/crTheme/fontSizes.js +4 -3
  173. package/dist/theme/crTheme/linkStyles.js +6 -5
  174. package/dist/theme/crTheme/theme.js +1 -1
  175. package/dist/theme/shared/breakpoint.js +4 -3
  176. package/dist/theme/shared/fontFamilies.js +5 -4
  177. package/dist/theme/shared/hideVisually.js +1 -1
  178. package/dist/theme/shared/size.js +4 -3
  179. package/dist/theme/shared/spacing.js +2 -2
  180. package/dist/theme/shared/zIndex.js +3 -3
  181. package/dist/theme/srTheme/buttonColors.js +6 -5
  182. package/dist/theme/srTheme/colors.js +4 -3
  183. package/dist/theme/srTheme/fontSizes.js +4 -3
  184. package/dist/theme/srTheme/linkStyles.js +6 -5
  185. package/dist/theme/srTheme/theme.js +1 -1
  186. package/dist/utils/Membership.js +30 -27
  187. package/dist/utils/ShareButton/sharePopUpHelper.js +8 -8
  188. package/dist/utils/ShareButton/shareTracking.js +1 -1
  189. package/dist/utils/ShareButton/shareUrlHelper.js +3 -3
  190. package/dist/utils/allowListed.js +3 -5
  191. package/dist/utils/allowListed.test.js +3 -3
  192. package/dist/utils/internalLinkHelper.js +8 -10
  193. package/dist/utils/navHelper.js +2 -2
  194. package/package.json +12 -9
  195. package/playwright/components/atoms/checkbox.spec.js +64 -0
  196. package/playwright/components/atoms/input.spec.js +158 -0
  197. package/playwright/components/atoms/label.spec.js +29 -0
  198. package/playwright/components/atoms/link.spec.js +48 -0
  199. package/playwright/components/atoms/radioButton.spec.js +30 -0
  200. package/playwright/components/atoms/select.spec.js +36 -0
  201. package/playwright/components/atoms/textArea.spec.js +39 -0
  202. package/playwright/components/atoms/textInputWithDropdown.spec.js +23 -0
  203. package/playwright/components/molecules/accordian.spec.js +20 -0
  204. package/playwright/components/molecules/schoolLookup.spec.js +26 -0
  205. package/playwright/components/molecules/searchInput.spec.js +24 -0
  206. package/playwright/components/molecules/shareButton.spec.js +32 -0
  207. package/playwright/components/molecules/simpleSchoolLookUp.spec.js +35 -0
  208. package/playwright/components/molecules/typeahead.spec.js +27 -0
  209. package/playwright/components/organisms/donate.spec.js +293 -0
  210. package/playwright/components/organisms/emailSignUpForm.spec.js +109 -0
  211. package/playwright/components/organisms/footer.spec.js +67 -0
  212. package/playwright/components/organisms/header.spec.js +82 -0
  213. package/playwright/components/organisms/impactSlider.spec.js +292 -0
  214. package/playwright/components/organisms/marketingPreferences.spec.js +220 -0
  215. package/playwright/components/organisms/membership.spec.js +47 -0
  216. package/playwright.config.js +49 -0
  217. package/src/components/Molecules/Logos/Logos.js +18 -6
  218. package/src/components/Molecules/Logos/Logos.md +5 -0
  219. package/src/components/Organisms/Donate/Donate.js +11 -3
  220. package/src/components/Organisms/Donate/Donate.md +85 -0
  221. package/src/components/Organisms/Donate/Form/Form.js +20 -2
  222. package/src/components/Organisms/ImpactSlider/_ImpactMoneybuys.js +3 -4
  223. package/src/components/Organisms/Membership/Membership.test.js +1 -1
  224. package/cypress/e2e/components/atoms/button.cy.js +0 -102
  225. package/cypress/e2e/components/atoms/buttonWithStates.cy.js +0 -47
  226. package/cypress/e2e/components/atoms/checkbox.cy.js +0 -70
  227. package/cypress/e2e/components/atoms/confetti.cy.js +0 -46
  228. package/cypress/e2e/components/atoms/errorText.cy.js +0 -45
  229. package/cypress/e2e/components/atoms/input.cy.js +0 -157
  230. package/cypress/e2e/components/atoms/label.cy.js +0 -93
  231. package/cypress/e2e/components/atoms/link.cy.js +0 -190
  232. package/cypress/e2e/components/atoms/logo.cy.js +0 -132
  233. package/cypress/e2e/components/atoms/pagination.cy.js +0 -191
  234. package/cypress/e2e/components/atoms/picture.cy.js +0 -130
  235. package/cypress/e2e/components/atoms/radioButton.cy.js +0 -76
  236. package/cypress/e2e/components/atoms/richText.cy.js +0 -70
  237. package/cypress/e2e/components/atoms/select.cy.js +0 -84
  238. package/cypress/e2e/components/atoms/socialIcons.cy.js +0 -162
  239. package/cypress/e2e/components/atoms/text.cy.js +0 -169
  240. package/cypress/e2e/components/atoms/textArea.cy.js +0 -89
  241. package/cypress/e2e/components/atoms/textInputWithDrop.cy.js +0 -76
  242. package/cypress/e2e/components/molecules/accordion.cy.js +0 -67
  243. package/cypress/e2e/components/molecules/articleTeaser.cy.js +0 -105
  244. package/cypress/e2e/components/molecules/banner.cy.js +0 -67
  245. package/cypress/e2e/components/molecules/box.cy.js +0 -104
  246. package/cypress/e2e/components/molecules/card.cy.js +0 -105
  247. package/cypress/e2e/components/molecules/cardDs.cy.js +0 -198
  248. package/cypress/e2e/components/molecules/chip.cy.js +0 -68
  249. package/cypress/e2e/components/molecules/countdown.cy.js +0 -71
  250. package/cypress/e2e/components/molecules/descriptor.cy.js +0 -142
  251. package/cypress/e2e/components/molecules/doubleCopy.cy.js +0 -79
  252. package/cypress/e2e/components/molecules/heroBanner.cy.js +0 -69
  253. package/cypress/e2e/components/molecules/infoBanner.cy.js +0 -69
  254. package/cypress/e2e/components/molecules/partnerLink.cy.js +0 -68
  255. package/cypress/e2e/components/molecules/promo.cy.js +0 -74
  256. package/cypress/e2e/components/molecules/schoolLookup.cy.js +0 -83
  257. package/cypress/e2e/components/molecules/searchInput.cy.js +0 -72
  258. package/cypress/e2e/components/molecules/searchResult.cy.js +0 -191
  259. package/cypress/e2e/components/molecules/shareButton.cy.js +0 -76
  260. package/cypress/e2e/components/molecules/simpleSchoolLookup.cy.js +0 -83
  261. package/cypress/e2e/components/molecules/singleMessage.cy.js +0 -502
  262. package/cypress/e2e/components/molecules/singleMessageDs.cy.js +0 -234
  263. package/cypress/e2e/components/molecules/typeahead.cy.js +0 -97
  264. package/cypress/e2e/components/molecules/videoBanner.cy.js +0 -132
  265. package/cypress/e2e/components/organisms/cookieBanner.cy.js +0 -80
  266. package/cypress/e2e/components/organisms/donate.cy.js +0 -284
  267. package/cypress/e2e/components/organisms/emailSignUp.cy.js +0 -54
  268. package/cypress/e2e/components/organisms/footer.cy.js +0 -168
  269. package/cypress/e2e/components/organisms/header.cy.js +0 -138
  270. package/cypress/e2e/components/organisms/impactSlider.cy.js +0 -72
  271. package/cypress/e2e/components/organisms/marketingPreferencesDSForm.cy.js +0 -589
  272. package/cypress/e2e/components/organisms/membership.cy.js +0 -122
  273. package/cypress/fixtures/example.json +0 -5
  274. package/cypress/plugins/index.js +0 -21
  275. package/cypress/support/commands.js +0 -25
  276. package/cypress/support/e2e.js +0 -36
  277. package/cypress.config.js +0 -15
@@ -1,17 +1,26 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
+ import styled from 'styled-components';
3
4
 
4
5
  import Logo from '../../Atoms/Logo/Logo';
5
6
 
7
+ const TitleLabel = styled.span`
8
+ line-height: 0;
9
+ font-size: 0;
10
+ color: transparent;
11
+ `;
12
+
6
13
  const Logos = ({ campaign }) => {
7
14
  if (campaign === 'Sport Relief Gameon') {
8
15
  return (
9
16
  <>
10
17
  <a href="/" title="Go to Comic Relief homepage">
11
- <Logo rotate sizeSm="50px" sizeMd="60px" campaign="Comic Relief" />
18
+ <Logo rotate sizeSm="50px" sizeMd="60px" campaign="Comic Relief" title="Go to Comic Relief homepage" />
19
+ <TitleLabel>Go to Comic Relief homepage</TitleLabel>
12
20
  </a>
13
21
  <a href="/sportrelief/" title="Go to Sport Relief homepage">
14
- <Logo sizeSm="100px" sizeMd="120px" campaign="Sport Relief Gameon" />
22
+ <Logo sizeSm="100px" sizeMd="120px" campaign="Sport Relief Gameon" title="Go to Sport Relief homepage" />
23
+ <TitleLabel>Go to Sport Relief homepage</TitleLabel>
15
24
  </a>
16
25
  </>
17
26
  );
@@ -19,8 +28,9 @@ const Logos = ({ campaign }) => {
19
28
 
20
29
  if (campaign === 'Sport Relief') {
21
30
  return (
22
- <a href="/sportrelief" title="Sport Relief in homepage">
23
- <Logo rotate={false} campaign="Sport Relief" />
31
+ <a href="/sportrelief" title="Go to Sport Relief homepage">
32
+ <Logo rotate={false} campaign="Sport Relief" title="Sport Relief in homepage" />
33
+ <TitleLabel>Go to Sport Relief homepage</TitleLabel>
24
34
  </a>
25
35
  );
26
36
  }
@@ -28,14 +38,16 @@ const Logos = ({ campaign }) => {
28
38
  if (campaign === 'Pride') {
29
39
  return (
30
40
  <a href="/" title="Go to Comic Relief homepage">
31
- <Logo rotate={false} campaign="Pride" />
41
+ <Logo rotate={false} campaign="Pride" title="Go to Comic Relief homepage" />
42
+ <TitleLabel>Go to Comic Relief homepage</TitleLabel>
32
43
  </a>
33
44
  );
34
45
  }
35
46
 
36
47
  return (
37
48
  <a href="/" title="Go to Comic Relief homepage">
38
- <Logo rotate={false} campaign="Comic Relief" />
49
+ <Logo rotate={false} campaign="Comic Relief" title="Go to Comic Relief homepage" />
50
+ <TitleLabel>Go to Comic Relief homepage</TitleLabel>
39
51
  </a>
40
52
  );
41
53
  };
@@ -0,0 +1,5 @@
1
+ # Comic Relief Logo
2
+
3
+ ```js
4
+ <Logos rotate={false} sizeSm="50px" sizeMd="60px" />
5
+ ```
@@ -40,7 +40,9 @@ const Donate = ({
40
40
  PopUpText,
41
41
  chooseAmountText,
42
42
  isDesktopOverride,
43
- otherAmountValue
43
+ otherAmountValue,
44
+ additionalSingleCopy,
45
+ additionalMonthlyCopy
44
46
  }) => {
45
47
  let isDesktop = useMediaQuery({ query: `(min-width: ${screen.medium})` });
46
48
 
@@ -127,6 +129,8 @@ const Donate = ({
127
129
  chooseAmountText={chooseAmountText}
128
130
  submitButtonColor={submitButtonColor}
129
131
  otherAmountValue={otherAmountValue}
132
+ additionalSingleCopy={additionalSingleCopy}
133
+ additionalMonthlyCopy={additionalMonthlyCopy}
130
134
  />
131
135
  </Wrapper>
132
136
  </Container>
@@ -159,7 +163,9 @@ Donate.propTypes = {
159
163
  PopUpText: PropTypes.string,
160
164
  chooseAmountText: PropTypes.string,
161
165
  isDesktopOverride: PropTypes.bool,
162
- otherAmountValue: PropTypes.number
166
+ otherAmountValue: PropTypes.number,
167
+ additionalSingleCopy: PropTypes.string,
168
+ additionalMonthlyCopy: PropTypes.string
163
169
  };
164
170
 
165
171
  Donate.defaultProps = {
@@ -186,7 +192,9 @@ Donate.defaultProps = {
186
192
  chooseAmountText: '',
187
193
  isDesktopOverride: null,
188
194
  otherAmountValue: null,
189
- title: null
195
+ title: null,
196
+ additionalSingleCopy: null,
197
+ additionalMonthlyCopy: null
190
198
  };
191
199
 
192
200
  export default Donate;
@@ -354,3 +354,88 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
354
354
  isDesktopOverride={false}
355
355
  />;
356
356
  ```
357
+
358
+ ## Additional copy for BOTH giving types
359
+
360
+ ```js
361
+ import data from './dev-data/data';
362
+ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
363
+ const desktopPictures = require('../../../styleguide/data/data').defaultData;
364
+
365
+ <Donate
366
+ alt="Background image"
367
+ mobileBackgroundColor="deep_violet_dark"
368
+ desktopOverlayColor="red"
369
+ submitButtonColor="blue_dark"
370
+ formAlignRight={true}
371
+ imageLow={desktopPictures.imageLow}
372
+ images={desktopPictures.images}
373
+ mobileImageLow={mobilePictures.imageLow}
374
+ mobileImages={mobilePictures.images}
375
+ data={data}
376
+ mbshipID="mship-11"
377
+ donateLink="https://donation.comicrelief.com/"
378
+ clientID="donate"
379
+ cartID="default-comicrelief"
380
+ title="Donate Now"
381
+ subtitle="Please help us fund life-changing projects in the UK and around the world."
382
+ additionalSingleCopy="Some additional single giving copy - Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa."
383
+ additionalMonthlyCopy="Some additional regular giving copy! - Quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos."
384
+ />;
385
+ ```
386
+
387
+ ## Additional copy for monthly only
388
+
389
+ ```js
390
+ import data from './dev-data/data';
391
+ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
392
+ const desktopPictures = require('../../../styleguide/data/data').defaultData;
393
+
394
+ <Donate
395
+ alt="Background image"
396
+ mobileBackgroundColor="deep_violet_dark"
397
+ desktopOverlayColor="red"
398
+ submitButtonColor="blue_dark"
399
+ formAlignRight={true}
400
+ imageLow={desktopPictures.imageLow}
401
+ images={desktopPictures.images}
402
+ mobileImageLow={mobilePictures.imageLow}
403
+ mobileImages={mobilePictures.images}
404
+ data={data}
405
+ mbshipID="mship-12"
406
+ donateLink="https://donation.comicrelief.com/"
407
+ clientID="donate"
408
+ cartID="default-comicrelief"
409
+ title="Donate Now"
410
+ subtitle="Please help us fund life-changing projects in the UK and around the world."
411
+ additionalMonthlyCopy="Some additional regular giving copy! - Quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos."
412
+ />;
413
+ ```
414
+
415
+ ## Additional copy for single only
416
+
417
+ ```js
418
+ import data from './dev-data/data';
419
+ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
420
+ const desktopPictures = require('../../../styleguide/data/data').defaultData;
421
+
422
+ <Donate
423
+ alt="Background image"
424
+ mobileBackgroundColor="deep_violet_dark"
425
+ desktopOverlayColor="red"
426
+ submitButtonColor="blue_dark"
427
+ formAlignRight={true}
428
+ imageLow={desktopPictures.imageLow}
429
+ images={desktopPictures.images}
430
+ mobileImageLow={mobilePictures.imageLow}
431
+ mobileImages={mobilePictures.images}
432
+ data={data}
433
+ mbshipID="mship-13"
434
+ donateLink="https://donation.comicrelief.com/"
435
+ clientID="donate"
436
+ cartID="default-comicrelief"
437
+ title="Donate Now"
438
+ subtitle="Please help us fund life-changing projects in the UK and around the world."
439
+ additionalSingleCopy="Some additional single giving copy - Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa."
440
+ />;
441
+ ```
@@ -38,6 +38,8 @@ const Signup = ({
38
38
  chooseAmountText,
39
39
  submitButtonColor,
40
40
  otherAmountValue,
41
+ additionalSingleCopy,
42
+ additionalMonthlyCopy,
41
43
  ...rest
42
44
  }) => {
43
45
  const [givingType, setGivingType] = useState('single');
@@ -191,6 +193,10 @@ const Signup = ({
191
193
  return `Donate £${amountDonate} monthly`;
192
194
  };
193
195
 
196
+ const showAdditionalSingleCopy = givingType === 'single' && additionalSingleCopy;
197
+ const showAdditionalMonthlyCopy = givingType === 'monthly' && additionalMonthlyCopy;
198
+ const additionalCopy = showAdditionalSingleCopy || showAdditionalMonthlyCopy;
199
+
194
200
  return (
195
201
  <FormWrapper>
196
202
  {showGivingSelector && (
@@ -276,6 +282,14 @@ const Signup = ({
276
282
  </Error>
277
283
  )}
278
284
 
285
+ {additionalCopy && (
286
+ <p className="additional-copy">
287
+ <strong>
288
+ {additionalCopy}
289
+ </strong>
290
+ </p>
291
+ )}
292
+
279
293
  {noMoneyBuys ? (
280
294
  <Button
281
295
  type="submit"
@@ -313,13 +327,17 @@ Signup.propTypes = {
313
327
  PopUpText: PropTypes.string.isRequired,
314
328
  chooseAmountText: PropTypes.string.isRequired,
315
329
  submitButtonColor: PropTypes.string.isRequired,
316
- otherAmountValue: PropTypes.number
330
+ otherAmountValue: PropTypes.number,
331
+ additionalSingleCopy: PropTypes.string,
332
+ additionalMonthlyCopy: PropTypes.string
317
333
  };
318
334
 
319
335
  Signup.defaultProps = {
320
336
  noMoneyBuys: false,
321
337
  otherAmountValue: null,
322
- data: {}
338
+ data: {},
339
+ additionalSingleCopy: null,
340
+ additionalMonthlyCopy: null
323
341
  };
324
342
 
325
343
  export default Signup;
@@ -8,12 +8,11 @@ import {
8
8
  const Moneybuys = ({ items, currentAmount, opacityAnimation }) => (
9
9
  <MoneybuyWrapper>
10
10
  {items.map((item, index) => {
11
- const roundedPerPound = Math.floor(item.poundsPerItem);
12
- const thisAmount = Math.floor(currentAmount / roundedPerPound);
13
- const isInactive = !(!opacityAnimation || currentAmount >= roundedPerPound);
11
+ const thisAmount = Math.floor(currentAmount / item.poundsPerItem);
12
+ const isInactive = !(!opacityAnimation || currentAmount >= item.poundsPerItem);
14
13
 
15
14
  return (
16
- <Fragment key={roundedPerPound}>
15
+ <Fragment key={item.poundsPerItem}>
17
16
  <Moneybuy isInactive={isInactive} data-testid={`impact-slider--moneybuy-${index + 1}`}>
18
17
  <MoneybuyImage imageURL={item.imageURL} />
19
18
  <MoneybuyAmount tag="p" family="Anton" uppercase weight="normal" size="xl" data-testid="moneybuy-amount">{thisAmount}</MoneybuyAmount>
@@ -227,7 +227,7 @@ it("renders correctly", () => {
227
227
  border: none;
228
228
  }
229
229
 
230
- .c10 >:not(:last-child):not(legend) {
230
+ .c10 > :not(:last-child):not(legend) {
231
231
  margin-bottom: 2rem;
232
232
  }
233
233
 
@@ -1,102 +0,0 @@
1
- describe('Button component', () => {
2
- before(() => {
3
- // go to button component
4
- cy.visit('/#button');
5
- });
6
-
7
- describe('props and methods section', () => {
8
- beforeEach(() => {
9
- cy.visit('/#button');
10
- cy.get('[data-testid="Button-container"] button[name="rsg-usage"]')
11
- .contains('Props & methods')
12
- .as('propsBtn');
13
-
14
- cy.get('@propsBtn')
15
- .closest('[class^=rsg--tabs]')
16
- .as('container');
17
- });
18
-
19
- it('is present', () => {
20
- cy.get('@propsBtn').should('exist');
21
- });
22
-
23
- it('does not show table initially', () => {
24
- cy.get('@container')
25
- .find('table')
26
- .should('not.exist');
27
- });
28
-
29
- it('shows the table on button click', () => {
30
- cy.get('@propsBtn').click();
31
- cy.get('@container')
32
- .find('table')
33
- .should('contain', 'Prop name');
34
- });
35
- });
36
-
37
- describe('Plain Button: Button-example-0', () => {
38
- beforeEach(() => {
39
- cy.visit('/#button');
40
- cy.get('[data-testid="Button-example-0"')
41
- .as('container')
42
- .find('[class^=rsg--preview]')
43
- .as('preview');
44
-
45
- cy.get('@container')
46
- .find('button')
47
- .contains('View Code')
48
- .as('viewCodeBtn');
49
- });
50
-
51
- it('renders button as a span', () => {
52
- //verify button as a span
53
- cy.get('[data-testid="Button-example-0"]')
54
- .contains('My button')
55
- .should('exist');
56
- });
57
-
58
- it('has view code button', () => {
59
- cy.get('@viewCodeBtn').should('exist');
60
- });
61
-
62
- it('shows code on click', () => {
63
- cy.get('@viewCodeBtn').click();
64
- cy.get('@container')
65
- .find('textarea')
66
- .should('exist');
67
- });
68
- });
69
-
70
- describe('Button as a span: Button-example-1', () => {
71
- beforeEach(() => {
72
- cy.visit('/#button');
73
- cy.get('[data-testid="Button-example-1"]')
74
- .as('container')
75
- .find('[class^=rsg--preview]')
76
- .as('preview');
77
-
78
- cy.get('@container')
79
- .find('button')
80
- .contains('View Code')
81
- .as('viewCodeBtn');
82
- });
83
-
84
- it('renders button as a span', () => {
85
- // verify button as a span
86
- cy.get('[data-testid="Button-example-1"]')
87
- .contains('My button as a span')
88
- .should('exist');
89
- });
90
-
91
- it('has view code button', () => {
92
- cy.get('@viewCodeBtn').should('exist');
93
- });
94
-
95
- it('shows code on click', () => {
96
- cy.get('@viewCodeBtn').click();
97
- cy.get('@container')
98
- .find('textarea')
99
- .should('exist');
100
- });
101
- });
102
- });
@@ -1,47 +0,0 @@
1
- describe('Button With States component', () => {
2
- before(() => {
3
- // go to Button With States component
4
- cy.visit('/#button');
5
- });
6
-
7
- describe('props and methods section', () => {
8
- beforeEach(() => {
9
- cy.visit('/#button');
10
- cy.get('[data-testid="ButtonWithStates-container"]')
11
- .as('container')
12
- .find('[class^=rsg--preview]')
13
- .as('preview');
14
-
15
- cy.get('@container')
16
- .find('button')
17
- .contains('View Code')
18
- .as('viewCodeBtn');
19
- });
20
-
21
- // button with Disabled and loading
22
- it('renders button with states', () => {
23
- cy.get('[data-testid="ButtonWithStates-examples"]')
24
- .find('h2')
25
- .contains('Disabled and loading')
26
- .should('exist');
27
- });
28
-
29
- it('renders button as disabled', () => {
30
- // verify button as a span
31
- cy.get('[data-testid="ButtonWithStates-example-1"]')
32
- .contains('Loading')
33
- .should('be.disabled');
34
- });
35
-
36
- it('has view code button', () => {
37
- cy.get('@viewCodeBtn').should('exist');
38
- });
39
-
40
- it('shows code on click', () => {
41
- cy.get('@viewCodeBtn').click();
42
- cy.get('@container')
43
- .find('textarea')
44
- .should('exist');
45
- });
46
- });
47
- });
@@ -1,70 +0,0 @@
1
- describe('Checkbox component', () => {
2
- before(() => {
3
- // go to checkbox component
4
- cy.visit('/#checkbox');
5
- });
6
-
7
- describe('props and methods section', () => {
8
- beforeEach(() => {
9
- cy.visit('/#checkbox');
10
- cy.get('[data-testid="Checkbox-container"] button[name="rsg-usage"]')
11
- .contains('Props & methods')
12
- .as('propsBtn');
13
-
14
- cy.get('@propsBtn')
15
- .closest('[class^=rsg--tabs]')
16
- .as('container');
17
- });
18
-
19
- it('is present', () => {
20
- cy.get('@propsBtn').should('exist');
21
- });
22
-
23
- it('does not show table initially', () => {
24
- cy.get('@container')
25
- .find('table')
26
- .should('not.exist');
27
- });
28
-
29
- it('shows the table on button click', () => {
30
- cy.get('@propsBtn').click();
31
- cy.get('@container')
32
- .find('table')
33
- .should('contain', 'Prop name');
34
- });
35
- });
36
-
37
- describe('Checkbox section', () => {
38
- beforeEach(() => {
39
- cy.visit('/#checkbox');
40
- cy.get('[data-preview="Checkbox"]')
41
- .as('preview');
42
- });
43
-
44
- it('should click checkboxes', () => {
45
- cy.get('[data-preview="Checkbox"] p').contains('List of checkboxes');
46
- cy.get('[data-testid="Checkbox-example-1"] div > label:nth-child(2)')
47
- .contains('Tennis')
48
- .click();
49
- cy.get('[data-testid="Checkbox-example-1"] div > label:nth-child(3)')
50
- .contains('Basketball')
51
- .click();
52
- cy.get('[data-testid="Checkbox-example-1"] div > label:nth-child(4)')
53
- .contains('Cycling')
54
- .click();
55
- cy.get('[data-testid="Checkbox-example-1"] div > label:nth-child(5)')
56
- .contains('Football')
57
- .click();
58
- });
59
-
60
- it('has view code button', () => {
61
- cy.get('[data-testid="Checkbox-examples"] [name="rsg-code-editor"]').should('exist');
62
- });
63
-
64
- it('shows code on click', () => {
65
- cy.get('[data-testid="Checkbox-examples"] [name="rsg-code-editor"]').contains('View Code')
66
- .click();
67
- cy.get('[data-testid="Checkbox-examples"] div > textarea').should('be.visible');
68
- });
69
- });
70
- });
@@ -1,46 +0,0 @@
1
- describe('Confetti component', () => {
2
- before(() => {
3
- // go to confetti component
4
- cy.visit('/#confetti');
5
- });
6
-
7
- describe('props and methods section', () => {
8
- beforeEach(() => {
9
- cy.visit('/#confetti');
10
- cy.get('[data-testid="Confetti-container"]')
11
- .as('container')
12
- .find('[class^=rsg--preview]')
13
- .as('preview');
14
-
15
- cy.get('@container')
16
- .find('button')
17
- .contains('View Code')
18
- .as('viewCodeBtn');
19
- });
20
-
21
- it('renders button with states', () => {
22
- cy.get('[data-testid="Confetti-examples"]')
23
- .find('h1')
24
- .contains('Confetti')
25
- .should('exist');
26
- });
27
-
28
- it('renders confetti when "trigger confetti" is clicked', () => {
29
- // verify button as a span
30
- cy.get('[data-testid="Confetti-example-1"]')
31
- .contains('trigger confetti')
32
- .click()
33
- });
34
-
35
- it('has view code button', () => {
36
- cy.get('@viewCodeBtn').should('exist');
37
- });
38
-
39
- it('shows code on click', () => {
40
- cy.get('@viewCodeBtn').click();
41
- cy.get('@container')
42
- .find('textarea')
43
- .should('exist');
44
- });
45
- });
46
- });
@@ -1,45 +0,0 @@
1
- describe('ErrorText component', () => {
2
- before(() => {
3
- // go to errortext component
4
- cy.visit('/#errortext');
5
- });
6
-
7
- describe('props and methods section', () => {
8
- beforeEach(() => {
9
- cy.visit('/#errortext');
10
- cy.get('[data-testid="ErrorText-container"]')
11
- .as('container')
12
- .find('[class^=rsg--preview]')
13
- .as('preview');
14
-
15
- cy.get('@container')
16
- .find('button')
17
- .contains('View Code')
18
- .as('viewCodeBtn');
19
- });
20
-
21
- it('error message should exist', () => {
22
- cy.get('[data-testid="ErrorText-examples"]')
23
- .find('h1')
24
- .contains('ErrorText')
25
- .should('exist');
26
- });
27
-
28
- it('displays error message', () => {
29
- cy.get('[data-testid="ErrorText-example-1"] span')
30
- .contains('This is an error')
31
- .should('exist');
32
- });
33
-
34
- it('has view code button', () => {
35
- cy.get('@viewCodeBtn').should('exist');
36
- });
37
-
38
- it('shows code on click', () => {
39
- cy.get('@viewCodeBtn').click();
40
- cy.get('@container')
41
- .find('textarea')
42
- .should('exist');
43
- });
44
- });
45
- });