@comicrelief/component-library 8.44.4 → 8.45.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 (67) hide show
  1. package/dist/components/Atoms/SocialIcons/Icon/Icon.js +39 -14
  2. package/dist/components/Atoms/SocialIcons/SocialIcons.js +91 -22
  3. package/dist/components/Atoms/SocialIcons/Utils/Icons.js +26 -7
  4. package/dist/components/Atoms/SocialIcons/Utils/Links.js +10 -0
  5. package/dist/components/Atoms/SocialIcons/__snapshots__/SocialIcons.test.js.snap +63 -48
  6. package/{src/components/Atoms/SocialIcons/assets → dist/components/Atoms/SocialIcons/assets/circled}/facebook.svg +1 -1
  7. package/{src/components/Atoms/SocialIcons/assets → dist/components/Atoms/SocialIcons/assets/circled}/twitter.svg +1 -1
  8. package/dist/components/Atoms/SocialIcons/assets/{youtube.svg → circled/youtube.svg} +1 -1
  9. package/dist/components/Atoms/SocialIcons/assets/standard/facebook.svg +3 -0
  10. package/dist/components/Atoms/SocialIcons/assets/standard/instagram.svg +3 -0
  11. package/dist/components/Atoms/SocialIcons/assets/standard/tiktok.svg +3 -0
  12. package/dist/components/Atoms/SocialIcons/assets/standard/x.svg +3 -0
  13. package/dist/components/Atoms/SocialIcons/assets/standard/youtube.svg +3 -0
  14. package/dist/components/Molecules/EmailSignUp/EmailSignUp.js +38 -0
  15. package/dist/components/Molecules/EmailSignUp/EmailSignUp.style.js +113 -0
  16. package/dist/components/Molecules/LogoLinked/LogoLinked.js +6 -6
  17. package/dist/components/Organisms/Footer/Footer.md +12 -11
  18. package/dist/components/Organisms/Footer/FundraisingRegulatorLogo/FundraisingRegulatorLogo.js +36 -16
  19. package/dist/components/Organisms/Footer/Nav/Nav.style.js +8 -8
  20. package/dist/components/Organisms/Footer/__snapshots__/Footer.test.js.snap +188 -183
  21. package/dist/components/Organisms/FooterNew/FooterNew.js +136 -0
  22. package/dist/components/Organisms/FooterNew/FooterNew.md +47 -0
  23. package/dist/components/Organisms/FooterNew/FooterNew.style.js +312 -0
  24. package/dist/components/Organisms/FooterNew/FooterNew.test.js +20 -0
  25. package/dist/components/Organisms/FooterNew/Nav/PrimaryNav.js +32 -0
  26. package/dist/components/Organisms/FooterNew/Nav/SecondaryNav.js +32 -0
  27. package/dist/components/Organisms/FooterNew/__snapshots__/FooterNew.test.js.snap +1490 -0
  28. package/dist/components/Organisms/FooterNew/dev-data/data.js +106 -0
  29. package/dist/index.js +20 -0
  30. package/dist/theme/crTheme/colors.js +12 -7
  31. package/dist/theme/shared/animations.js +46 -0
  32. package/package.json +1 -1
  33. package/src/components/Atoms/SocialIcons/Icon/Icon.js +47 -11
  34. package/src/components/Atoms/SocialIcons/SocialIcons.js +99 -25
  35. package/src/components/Atoms/SocialIcons/Utils/Icons.js +29 -10
  36. package/src/components/Atoms/SocialIcons/Utils/Links.js +10 -0
  37. package/src/components/Atoms/SocialIcons/__snapshots__/SocialIcons.test.js.snap +63 -48
  38. package/{dist/components/Atoms/SocialIcons/assets → src/components/Atoms/SocialIcons/assets/circled}/facebook.svg +1 -1
  39. package/{dist/components/Atoms/SocialIcons/assets → src/components/Atoms/SocialIcons/assets/circled}/twitter.svg +1 -1
  40. package/src/components/Atoms/SocialIcons/assets/{youtube.svg → circled/youtube.svg} +1 -1
  41. package/src/components/Atoms/SocialIcons/assets/standard/facebook.svg +3 -0
  42. package/src/components/Atoms/SocialIcons/assets/standard/instagram.svg +3 -0
  43. package/src/components/Atoms/SocialIcons/assets/standard/tiktok.svg +3 -0
  44. package/src/components/Atoms/SocialIcons/assets/standard/x.svg +3 -0
  45. package/src/components/Atoms/SocialIcons/assets/standard/youtube.svg +3 -0
  46. package/src/components/Molecules/EmailSignUp/EmailSignUp.js +55 -0
  47. package/src/components/Molecules/EmailSignUp/EmailSignUp.style.js +107 -0
  48. package/src/components/Molecules/LogoLinked/LogoLinked.js +5 -14
  49. package/src/components/Organisms/Footer/Footer.md +12 -11
  50. package/src/components/Organisms/Footer/FundraisingRegulatorLogo/FundraisingRegulatorLogo.js +14 -3
  51. package/src/components/Organisms/Footer/Nav/Nav.style.js +8 -8
  52. package/src/components/Organisms/Footer/__snapshots__/Footer.test.js.snap +188 -183
  53. package/src/components/Organisms/FooterNew/FooterNew.js +211 -0
  54. package/src/components/Organisms/FooterNew/FooterNew.md +47 -0
  55. package/src/components/Organisms/FooterNew/FooterNew.style.js +294 -0
  56. package/src/components/Organisms/FooterNew/FooterNew.test.js +24 -0
  57. package/src/components/Organisms/FooterNew/Nav/PrimaryNav.js +54 -0
  58. package/src/components/Organisms/FooterNew/Nav/SecondaryNav.js +54 -0
  59. package/src/components/Organisms/FooterNew/__snapshots__/FooterNew.test.js.snap +1490 -0
  60. package/src/components/Organisms/FooterNew/dev-data/data.js +123 -0
  61. package/src/index.js +2 -0
  62. package/src/theme/crTheme/colors.js +13 -7
  63. package/src/theme/shared/animations.js +60 -0
  64. /package/dist/components/Atoms/SocialIcons/assets/{X-white-Subtract.svg → circled/X-white-Subtract.svg} +0 -0
  65. /package/dist/components/Atoms/SocialIcons/assets/{instagram.svg → circled/instagram.svg} +0 -0
  66. /package/src/components/Atoms/SocialIcons/assets/{X-white-Subtract.svg → circled/X-white-Subtract.svg} +0 -0
  67. /package/src/components/Atoms/SocialIcons/assets/{instagram.svg → circled/instagram.svg} +0 -0
@@ -0,0 +1,123 @@
1
+ export const primaryLinksList = [
2
+ {
3
+ title: 'Contact us',
4
+ path: 'contact-us',
5
+ internal: {
6
+ type: 'ContentfulPageLandingPage'
7
+ }
8
+ },
9
+ {
10
+ title: 'Update your preferences',
11
+ path: 'https://www.comicrelief.com/update-your-preferences',
12
+ internal: {
13
+ type: 'ContentfulPageLandingPage'
14
+ }
15
+ },
16
+ {
17
+ title: 'Your Gift Aid',
18
+ path: 'https://giftaid.comicrelief.com/update',
19
+ internal: {
20
+ type: 'ContentfulPageLandingPage'
21
+ }
22
+ },
23
+ {
24
+ title: 'Reporting complaints and concerns',
25
+ path: 'https://www.comicrelief.com/reporting-complaints',
26
+ internal: {
27
+ type: 'ContentfulPageLandingPage'
28
+ }
29
+ },
30
+ {
31
+ title: 'FAQs',
32
+ path: 'https://www.comicrelief.com/frequently-asked-questions',
33
+ internal: {
34
+ type: 'ContentfulPageLandingPage'
35
+ }
36
+ }
37
+ ];
38
+
39
+ export const secondaryLinksList = [
40
+ {
41
+ title: 'Terms of use',
42
+ path: 'https://www.comicrelief.com/terms-of-use',
43
+ internal: {
44
+ type: 'ContentfulPageLandingPage'
45
+ }
46
+ },
47
+ {
48
+ title: 'Privacy notice',
49
+ path: 'https://www.comicrelief.com/privacy-notice',
50
+ internal: {
51
+ type: 'ContentfulPageLandingPage'
52
+ }
53
+ },
54
+ {
55
+ title: 'Cookies',
56
+ path: 'https://www.comicrelief.com/cookies',
57
+ internal: {
58
+ type: 'ContentfulPageLandingPage'
59
+ }
60
+ },
61
+ {
62
+ title: 'Text to donate terms',
63
+ path: 'https://www.comicrelief.com/text-to-donate-terms',
64
+ internal: {
65
+ type: 'ContentfulPageLandingPage'
66
+ }
67
+ },
68
+ {
69
+ title: 'Prize draw terms',
70
+ path: 'https://www.comicrelief.com/prize-draw-terms',
71
+ internal: {
72
+ type: 'ContentfulPageLandingPage'
73
+ }
74
+ },
75
+ {
76
+ title: 'Modern Slavery and Human Trafficking Statement',
77
+ path: 'https://www.comicrelief.com/modern-slavery-statement',
78
+ internal: {
79
+ type: 'ContentfulPageLandingPage'
80
+ }
81
+ },
82
+ {
83
+ title: 'Positive Practices',
84
+ path: 'https://www.comicrelief.com/positive-practices',
85
+ internal: {
86
+ type: 'ContentfulPageLandingPage'
87
+ }
88
+ }
89
+ ];
90
+
91
+ export const testPrimaryLinksList = [
92
+ {
93
+ title: 'Contact us',
94
+ path: 'contact-us',
95
+ internal: {
96
+ type: 'ContentfulPageLandingPage'
97
+ }
98
+ },
99
+ {
100
+ title: 'FAQs',
101
+ path: 'https://www.comicrelief.com/frequently-asked-questions',
102
+ internal: {
103
+ type: 'ContentfulPageLandingPage'
104
+ }
105
+ }
106
+ ];
107
+
108
+ export const testSecondaryLinksList = [
109
+ {
110
+ title: 'Terms of use',
111
+ path: 'https://www.comicrelief.com/terms-of-use',
112
+ internal: {
113
+ type: 'ContentfulPageLandingPage'
114
+ }
115
+ },
116
+ {
117
+ title: 'Privacy notice',
118
+ path: 'https://www.comicrelief.com/privacy-notice',
119
+ internal: {
120
+ type: 'ContentfulPageLandingPage'
121
+ }
122
+ }
123
+ ];
package/src/index.js CHANGED
@@ -9,6 +9,7 @@ export { default as allowListed } from './utils/allowListed';
9
9
  export { default as spacing } from './theme/shared/spacing';
10
10
  export { default as allBreakpoints } from './theme/shared/allBreakpoints';
11
11
  export { default as containers } from './theme/shared/containers';
12
+ export { logoRotateAnimation, springScaleAnimation } from './theme/shared/animations';
12
13
 
13
14
  /* Atoms */
14
15
  export { default as Text } from './components/Atoms/Text/Text';
@@ -46,6 +47,7 @@ export { default as Donate } from './components/Organisms/Donate/Donate';
46
47
  export { default as DoubleCopy } from './components/Molecules/DoubleCopy/DoubleCopy';
47
48
  export { default as PartnerLink } from './components/Molecules/PartnerLink/PartnerLink';
48
49
  export { default as Footer } from './components/Organisms/Footer/Footer';
50
+ export { default as FooterNew } from './components/Organisms/FooterNew/FooterNew';
49
51
  export { default as SearchResult } from './components/Molecules/SearchResult/SearchResult';
50
52
  export { default as SearchInput } from './components/Molecules/SearchInput/SearchInput';
51
53
  export { default as ShareButton } from './components/Molecules/ShareButton/ShareButton';
@@ -30,17 +30,23 @@ const colors = {
30
30
  grey_extra_light: '#f0f0f0',
31
31
  grey_for_forms: '#666',
32
32
  grey_label: '#5C5C5E',
33
- // this is the Curtis approved list of 5 greys that will be later numbered grey_1 thru grey_5
34
- // grey_1
33
+
34
+ grey_1: '#FFFFFF',
35
35
  grey_light: '#F4F3F5',
36
- // grey_2
37
36
  grey_medium: '#E1E2E3',
38
- // grey_3
37
+ grey_2: '#E1E2E3',
38
+ // TODO: 'grey' is actually 'grey_3'. It is referenced in many places.
39
+ // We need to rename it to 'grey_3' across all references.
40
+ // Until then, we need to keep both names for backwards compatibility.
41
+ // Same story with 'grey_medium' - it should be grey_2, and
42
+ // grey_dark, should be grey_4.
43
+ // For the time being we need both of each. I will provision a separate PR.
39
44
  grey: '#969598',
40
- // grey_4
41
- grey_4: '#6E6E6E',
42
- // grey_5
45
+ grey_3: '#969598',
43
46
  grey_dark: '#222222',
47
+ grey_4: '#222222',
48
+ grey_4_hover: '#3A3A3A',
49
+ grey_5: '#18181A',
44
50
 
45
51
  /* GENERAL COLOURS */
46
52
  blue: '#0565D1',
@@ -0,0 +1,60 @@
1
+ import { css } from 'styled-components';
2
+
3
+ /**
4
+ * Logo rotation animation on hover
5
+ * Applies a rotation transition that rotates the logo (or whatever else)
6
+ * -14deg on hover/focus
7
+ * @param {boolean} animateRotate - Whether to enable the rotation animation
8
+ * @returns {css} template literal for the animation
9
+ */
10
+ const logoRotateAnimation = animateRotate => {
11
+ if (!animateRotate) {
12
+ return css``;
13
+ }
14
+
15
+ return css`
16
+ img {
17
+ transition: transform 0.6s cubic-bezier(0.41, 1.64, 0.41, 0.8);
18
+ }
19
+
20
+ &:hover,
21
+ &:focus {
22
+ img {
23
+ transform: rotate(-14deg);
24
+ }
25
+ }
26
+ `;
27
+ };
28
+
29
+ /**
30
+ * Spring scale animation on hover
31
+ * Applies a smooth spring-like scale transition that expands the element on hover/focus
32
+ * @param {boolean} animateScale - Whether to enable the scale animation
33
+ * @param {number} scaleFactor - Scale factor to apply on hover (default 8%)
34
+ * @param {number} bounceIntensity - Intensity of the springy bounce effect (0-3, default: 1)
35
+ * @returns {css} template literal for the animation
36
+ */
37
+ const springScaleAnimation = (animateScale, scaleFactor = 1.08, bounceIntensity = 1) => {
38
+ if (!animateScale) {
39
+ return css``;
40
+ }
41
+
42
+ // More negative pull-back and higher overshoot = more bounce
43
+ // Default intensity (1) gives: cubic-bezier(0.68, -0.85, 0.265, 1.95)
44
+ // Higher intensity = more pronounced bounce effect
45
+ const pullBack = -0.55 - (bounceIntensity * 0.3);
46
+ const overshoot = 1.55 + (bounceIntensity * 0.4);
47
+ const duration = 0.2 + (bounceIntensity * 0.1);
48
+
49
+ return css`
50
+ transition: transform ${duration}s cubic-bezier(0.68, ${pullBack}, 0.265, ${overshoot});
51
+ transform-origin: center;
52
+
53
+ &:hover,
54
+ &:focus {
55
+ transform: scale(${scaleFactor});
56
+ }
57
+ `;
58
+ };
59
+
60
+ export { logoRotateAnimation, springScaleAnimation };