@comicrelief/component-library 8.48.2 → 8.49.1

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 (88) hide show
  1. package/dist/components/Atoms/Button/Button.js +15 -42
  2. package/dist/components/Atoms/Button/Button.md +91 -1
  3. package/dist/components/Atoms/Button/Button.style.js +47 -0
  4. package/dist/components/Atoms/Button/Button.test.js +40 -12
  5. package/dist/components/Atoms/ButtonWithStates/ButtonWithStates.js +1 -1
  6. package/dist/components/Atoms/Link/Link.js +8 -5
  7. package/dist/components/Atoms/Link/Link.md +81 -78
  8. package/dist/components/Atoms/Link/Link.style.js +22 -18
  9. package/dist/components/Atoms/Link/Link.test.js +20 -19
  10. package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.js +0 -1
  11. package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.test.js +0 -2
  12. package/dist/components/Molecules/CardDs/CardDs.md +3 -3
  13. package/dist/components/Molecules/CardDs/CardDs.test.js +1 -1
  14. package/dist/components/Molecules/CardDs/__snapshots__/CardDs.test.js.snap +43 -41
  15. package/dist/components/Molecules/Countdown/Countdown.js +4 -8
  16. package/dist/components/Molecules/Descriptor/Descriptor.js +1 -2
  17. package/dist/components/Molecules/Descriptor/Descriptor.test.js +0 -2
  18. package/dist/components/Molecules/InfoBanner/InfoBanner.js +6 -12
  19. package/dist/components/Molecules/InfoBanner/__snapshots__/InfoBanner.test.js.snap +0 -1
  20. package/dist/components/Molecules/Lookup/Lookup.js +9 -16
  21. package/dist/components/Molecules/Promo/__snapshots__/Promo.test.js.snap +42 -40
  22. package/dist/components/Molecules/SearchResult/SearchResult.js +2 -4
  23. package/dist/components/Molecules/SearchResult/__snapshots__/SearchResult.test.js.snap +0 -8
  24. package/dist/components/Molecules/SingleMessage/__snapshots__/SingleMessage.test.js.snap +42 -40
  25. package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.style.js +1 -1
  26. package/dist/components/Molecules/SingleMessageDS/__snapshots__/SingleMessageDs.test.js.snap +20 -20
  27. package/dist/components/Organisms/CookieBanner/CookieBanner.test.js +21 -20
  28. package/dist/components/Organisms/Donate/Donate.js +1 -2
  29. package/dist/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +0 -4
  30. package/dist/components/Organisms/EmailSignUp/_EmailSignUp.js +2 -3
  31. package/dist/components/Organisms/EmailSignUp/__snapshots__/EmailSignUp.test.js.snap +41 -18
  32. package/dist/components/Organisms/FooterNew/__snapshots__/FooterNew.test.js.snap +39 -12
  33. package/dist/components/Organisms/Header2025/Header2025.style.js +1 -1
  34. package/dist/components/Organisms/Header2025/HeaderNav2025/HeaderNav2025.style.js +1 -1
  35. package/dist/components/Organisms/ImpactSlider/ImpactSlider.js +0 -1
  36. package/dist/components/Organisms/ImpactSlider/_ImpactMoneybuys.js +0 -1
  37. package/dist/components/Organisms/WYMDCarousel/WYMDCarousel.js +0 -2
  38. package/dist/components/Organisms/WYMDCarousel/__snapshots__/WYMDCarousel.test.js.snap +0 -1
  39. package/dist/theme/crTheme/buttonColors.js +84 -72
  40. package/dist/theme/crTheme/buttonTypes.js +12 -0
  41. package/dist/theme/crTheme/colors.js +13 -1
  42. package/dist/theme/crTheme/fontConfig.js +3 -4
  43. package/dist/theme/crTheme/theme.js +2 -0
  44. package/package.json +1 -1
  45. package/playwright/components/organisms/emailSignUpForm.spec.js +1 -1
  46. package/src/components/Atoms/Button/Button.js +18 -36
  47. package/src/components/Atoms/Button/Button.md +91 -1
  48. package/src/components/Atoms/Button/Button.style.js +37 -0
  49. package/src/components/Atoms/Button/Button.test.js +44 -16
  50. package/src/components/Atoms/ButtonWithStates/ButtonWithStates.js +1 -1
  51. package/src/components/Atoms/Link/Link.js +15 -5
  52. package/src/components/Atoms/Link/Link.md +81 -78
  53. package/src/components/Atoms/Link/Link.style.js +32 -27
  54. package/src/components/Atoms/Link/Link.test.js +20 -19
  55. package/src/components/Molecules/ArticleTeaser/ArticleTeaser.js +0 -1
  56. package/src/components/Molecules/ArticleTeaser/ArticleTeaser.test.js +0 -2
  57. package/src/components/Molecules/CardDs/CardDs.md +3 -3
  58. package/src/components/Molecules/CardDs/CardDs.test.js +1 -1
  59. package/src/components/Molecules/CardDs/__snapshots__/CardDs.test.js.snap +43 -41
  60. package/src/components/Molecules/Countdown/Countdown.js +4 -4
  61. package/src/components/Molecules/Descriptor/Descriptor.js +0 -2
  62. package/src/components/Molecules/Descriptor/Descriptor.test.js +0 -2
  63. package/src/components/Molecules/InfoBanner/InfoBanner.js +6 -6
  64. package/src/components/Molecules/InfoBanner/__snapshots__/InfoBanner.test.js.snap +0 -1
  65. package/src/components/Molecules/Lookup/Lookup.js +4 -15
  66. package/src/components/Molecules/Promo/__snapshots__/Promo.test.js.snap +42 -40
  67. package/src/components/Molecules/SearchResult/SearchResult.js +2 -2
  68. package/src/components/Molecules/SearchResult/__snapshots__/SearchResult.test.js.snap +0 -8
  69. package/src/components/Molecules/SingleMessage/__snapshots__/SingleMessage.test.js.snap +42 -40
  70. package/src/components/Molecules/SingleMessageDS/SingleMessageDs.style.js +0 -1
  71. package/src/components/Molecules/SingleMessageDS/__snapshots__/SingleMessageDs.test.js.snap +20 -20
  72. package/src/components/Organisms/CookieBanner/CookieBanner.test.js +21 -20
  73. package/src/components/Organisms/Donate/Donate.js +1 -1
  74. package/src/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +0 -4
  75. package/src/components/Organisms/EmailSignUp/_EmailSignUp.js +2 -2
  76. package/src/components/Organisms/EmailSignUp/__snapshots__/EmailSignUp.test.js.snap +41 -18
  77. package/src/components/Organisms/FooterNew/__snapshots__/FooterNew.test.js.snap +39 -12
  78. package/src/components/Organisms/Header2025/Header2025.style.js +2 -1
  79. package/src/components/Organisms/Header2025/HeaderNav2025/HeaderNav2025.style.js +1 -1
  80. package/src/components/Organisms/ImpactSlider/ImpactSlider.js +1 -1
  81. package/src/components/Organisms/ImpactSlider/_ImpactMoneybuys.js +1 -1
  82. package/src/components/Organisms/WYMDCarousel/WYMDCarousel.js +2 -2
  83. package/src/components/Organisms/WYMDCarousel/__snapshots__/WYMDCarousel.test.js.snap +0 -1
  84. package/src/theme/crTheme/buttonColors.js +116 -76
  85. package/src/theme/crTheme/buttonTypes.js +7 -0
  86. package/src/theme/crTheme/colors.js +14 -1
  87. package/src/theme/crTheme/fontConfig.js +3 -4
  88. package/src/theme/crTheme/theme.js +3 -0
@@ -18,7 +18,6 @@ exports[`renders correctly 1`] = `
18
18
  line-height: normal;
19
19
  font-family: 'Anton',Impact,sans-serif;
20
20
  font-weight: 400;
21
- text-transform: uppercase;
22
21
  }
23
22
 
24
23
  .c1 span {
@@ -49,15 +48,11 @@ exports[`renders correctly 1`] = `
49
48
  display: -ms-inline-flexbox;
50
49
  display: inline-flex;
51
50
  position: relative;
52
- padding: 0.5rem 1.25rem;
53
51
  -webkit-text-decoration: none;
54
52
  text-decoration: none;
55
- font-weight: 700;
56
- font-size: 1rem;
57
- border-radius: 2rem;
58
- -webkit-transition: all 0.3s;
59
- transition: all 0.3s;
60
- height: 3.125rem;
53
+ -webkit-transition: all 0.2s;
54
+ transition: all 0.2s;
55
+ height: 2.5rem;
61
56
  width: 100%;
62
57
  -webkit-box-pack: center;
63
58
  -webkit-justify-content: center;
@@ -69,8 +64,19 @@ exports[`renders correctly 1`] = `
69
64
  align-items: center;
70
65
  border: none;
71
66
  cursor: pointer;
67
+ padding: 0.6rem 1rem;
68
+ border-radius: 0.5rem;
72
69
  background-color: #E52630;
73
70
  color: #FFFFFF;
71
+ font-family: 'Montserrat',Helvetica,Arial,sans-serif;
72
+ font-weight: 700;
73
+ text-transform: inherit;
74
+ -webkit-letter-spacing: 0;
75
+ -moz-letter-spacing: 0;
76
+ -ms-letter-spacing: 0;
77
+ letter-spacing: 0;
78
+ font-size: 1rem;
79
+ line-height: 1.25rem;
74
80
  }
75
81
 
76
82
  .c15 > a {
@@ -78,9 +84,17 @@ exports[`renders correctly 1`] = `
78
84
  text-decoration: none;
79
85
  }
80
86
 
81
- .c15:hover {
87
+ .c15:hover,
88
+ .c15:focus,
89
+ .c15:focus-within,
90
+ .c15:focus-visible {
82
91
  background-color: #890B11;
83
- color: #FFFFFF;
92
+ outline-offset: 3px;
93
+ }
94
+
95
+ .c15:disabled {
96
+ cursor: not-allowed;
97
+ opacity: 0.5;
84
98
  }
85
99
 
86
100
  .c8 {
@@ -161,7 +175,7 @@ exports[`renders correctly 1`] = `
161
175
 
162
176
  .c16:disabled {
163
177
  cursor: not-allowed;
164
- opacity: 0.75;
178
+ opacity: 0.5;
165
179
  }
166
180
 
167
181
  .c0 {
@@ -278,6 +292,20 @@ exports[`renders correctly 1`] = `
278
292
  }
279
293
  }
280
294
 
295
+ @media (min-width:740px) {
296
+ .c15 {
297
+ font-size: 1rem;
298
+ line-height: 1.25rem;
299
+ }
300
+ }
301
+
302
+ @media (min-width:1024px) {
303
+ .c15 {
304
+ font-size: 1.125rem;
305
+ line-height: 1.375rem;
306
+ }
307
+ }
308
+
281
309
  @media (min-width:740px) {
282
310
  .c15 {
283
311
  width: auto;
@@ -287,8 +315,6 @@ exports[`renders correctly 1`] = `
287
315
  @media (min-width:1024px) {
288
316
  .c15 {
289
317
  width: auto;
290
- padding: 1rem 2rem;
291
- margin: 0 auto 2rem;
292
318
  }
293
319
  }
294
320
 
@@ -478,15 +504,12 @@ exports[`renders correctly 1`] = `
478
504
  >
479
505
  <button
480
506
  className="c15 c16"
507
+ color="red"
481
508
  data-test="subscribe-button"
482
509
  disabled={true}
483
510
  type="submit"
484
511
  >
485
- <span
486
- className="c4"
487
- >
488
- Subscribe
489
- </span>
512
+ Subscribe
490
513
  <div
491
514
  className=""
492
515
  />
@@ -66,15 +66,11 @@ exports[`renders correctly 1`] = `
66
66
  display: -ms-inline-flexbox;
67
67
  display: inline-flex;
68
68
  position: relative;
69
- padding: 0.5rem 1.25rem;
70
69
  -webkit-text-decoration: none;
71
70
  text-decoration: none;
72
- font-weight: 700;
73
- font-size: 1rem;
74
- border-radius: 2rem;
75
- -webkit-transition: all 0.3s;
76
- transition: all 0.3s;
77
- height: 3.125rem;
71
+ -webkit-transition: all 0.2s;
72
+ transition: all 0.2s;
73
+ height: 2.5rem;
78
74
  width: 100%;
79
75
  -webkit-box-pack: center;
80
76
  -webkit-justify-content: center;
@@ -86,8 +82,19 @@ exports[`renders correctly 1`] = `
86
82
  align-items: center;
87
83
  border: none;
88
84
  cursor: pointer;
85
+ padding: 0.6rem 1rem;
86
+ border-radius: 0.5rem;
89
87
  background-color: #FFFFFF;
90
88
  color: #000000;
89
+ font-family: 'Montserrat',Helvetica,Arial,sans-serif;
90
+ font-weight: 700;
91
+ text-transform: inherit;
92
+ -webkit-letter-spacing: 0;
93
+ -moz-letter-spacing: 0;
94
+ -ms-letter-spacing: 0;
95
+ letter-spacing: 0;
96
+ font-size: 1rem;
97
+ line-height: 1.25rem;
91
98
  }
92
99
 
93
100
  .c23 > a {
@@ -95,9 +102,17 @@ exports[`renders correctly 1`] = `
95
102
  text-decoration: none;
96
103
  }
97
104
 
98
- .c23:hover {
99
- background-color: #969598;
100
- color: #000000;
105
+ .c23:hover,
106
+ .c23:focus,
107
+ .c23:focus-within,
108
+ .c23:focus-visible {
109
+ background-color: #E1E2E3;
110
+ outline-offset: 3px;
111
+ }
112
+
113
+ .c23:disabled {
114
+ cursor: not-allowed;
115
+ opacity: 0.5;
101
116
  }
102
117
 
103
118
  .c15 {
@@ -788,6 +803,20 @@ exports[`renders correctly 1`] = `
788
803
  }
789
804
  }
790
805
 
806
+ @media (min-width:740px) {
807
+ .c23 {
808
+ font-size: 1rem;
809
+ line-height: 1.25rem;
810
+ }
811
+ }
812
+
813
+ @media (min-width:1024px) {
814
+ .c23 {
815
+ font-size: 1.125rem;
816
+ line-height: 1.375rem;
817
+ }
818
+ }
819
+
791
820
  @media (min-width:740px) {
792
821
  .c23 {
793
822
  width: auto;
@@ -797,8 +826,6 @@ exports[`renders correctly 1`] = `
797
826
  @media (min-width:1024px) {
798
827
  .c23 {
799
828
  width: auto;
800
- padding: 1rem 2rem;
801
- margin: 0 auto 2rem;
802
829
  }
803
830
  }
804
831
 
@@ -70,7 +70,8 @@ const DonateButtonWrapperTop = styled.div`
70
70
  a {
71
71
  width: 100%;
72
72
  height: inherit;
73
- transition: width 0.4s cubic-bezier(0.5, 1.5, 0.5, 0.80);
73
+ transition: all 0.3s cubic-bezier(0.5, 1.5, 0.5, 0.80);
74
+
74
75
  &:hover,
75
76
  &:focus {
76
77
  width: 100%;
@@ -436,7 +436,7 @@ const DonateButtonWrapperBottom = styled.div`
436
436
  // Donate button
437
437
  a {
438
438
  width: calc(100% - 10px);
439
- transition: width 0.35s cubic-bezier(0.5, 1.5, 0.5, 0.9);
439
+ transition: all 0.3s cubic-bezier(0.5, 1.5, 0.5, 0.9);
440
440
 
441
441
  &:hover,
442
442
  &:focus {
@@ -30,7 +30,7 @@ const ImpactSlider = ({
30
30
  return (
31
31
  <OuterWrapper backgroundColour={backgroundColour} id={rowID}>
32
32
  <InnerWrapper>
33
- <Text tag="h1" family="Anton" uppercase weight="normal" size="xl">{heading}</Text>
33
+ <Text tag="h1" family="Anton" weight="normal" size="xl">{heading}</Text>
34
34
  <Copy>
35
35
  {children}
36
36
  </Copy>
@@ -15,7 +15,7 @@ const Moneybuys = ({ items, currentAmount, opacityAnimation }) => (
15
15
  <Fragment key={item.poundsPerItem}>
16
16
  <Moneybuy isInactive={isInactive} data-testid={`impact-slider--moneybuy-${index + 1}`}>
17
17
  <MoneybuyImage imageURL={item.imageURL} />
18
- <MoneybuyAmount tag="p" family="Anton" uppercase weight="normal" size="xl" data-testid="moneybuy-amount">{thisAmount}</MoneybuyAmount>
18
+ <MoneybuyAmount tag="p" family="Anton" weight="normal" size="xl" data-testid="moneybuy-amount">{thisAmount}</MoneybuyAmount>
19
19
  <MoneybuyDescription tag="p" size="s" data-testid="moneybuy-description">{item.description}</MoneybuyDescription>
20
20
  </Moneybuy>
21
21
  { index < (items.length - 1) && (
@@ -67,7 +67,7 @@ const WYMDCarousel = ({ data, data: { autoPlay, contentful_id: thisID } }) => {
67
67
  { data.headerCopy}
68
68
  </Heading>
69
69
 
70
- <PeopleHelpedText tag="h1" family="Anton" uppercase weight="normal" color="red">
70
+ <PeopleHelpedText tag="h1" family="Anton" weight="normal" color="red">
71
71
  { data.peopleHelpedText}
72
72
  </PeopleHelpedText>
73
73
 
@@ -111,7 +111,7 @@ const WYMDCarousel = ({ data, data: { autoPlay, contentful_id: thisID } }) => {
111
111
 
112
112
  <div className="all-text-wrapper">
113
113
  <AmountWrapper>
114
- <Text tag="h1" family="Anton" uppercase weight="normal" size="s">
114
+ <Text tag="h1" family="Anton" weight="normal" size="s">
115
115
  {theseItems[key].amount}
116
116
  </Text>
117
117
  </AmountWrapper>
@@ -377,7 +377,6 @@ exports[`renders correctly:
377
377
  .c3 {
378
378
  font-family: 'Anton',Impact,sans-serif;
379
379
  font-weight: normal;
380
- text-transform: uppercase;
381
380
  color: #E52630;
382
381
  }
383
382
 
@@ -2,161 +2,171 @@ import { css } from 'styled-components';
2
2
  import color from './colors';
3
3
 
4
4
  const buttonColors = {
5
+ // "Primary - red"
6
+ red: {
7
+ background: color('red'),
8
+ textColour: color('white'),
9
+ hoverBackground: color('red_dark'),
10
+ hovertextColour: color('white')
11
+ },
12
+ // "Primary - black"
5
13
  black: {
6
- background: color('black'),
7
- color: color('white'),
8
- hoverBackground: color('grey'),
9
- hoverColor: color('white')
14
+ background: color('grey_dark'),
15
+ textColour: color('white'),
16
+ hoverBackground: color('black'),
17
+ hovertextColour: color('white')
10
18
  },
19
+ // "Primary - white"
20
+ white: {
21
+ background: color('white'),
22
+ textColour: color('black'),
23
+ hoverBackground: color('grey_medium'),
24
+ hovertextColour: color('black')
25
+ },
26
+ // To be phased out:
11
27
  blue: {
12
28
  background: color('blue'),
13
- color: color('white'),
29
+ textColour: color('white'),
14
30
  hoverBackground: color('blue_dark'),
15
- hoverColor: color('white')
31
+ hovertextColour: color('white')
16
32
  },
17
33
  blue_dark: {
18
34
  background: '#2042AD',
19
- color: color('white'),
35
+ textColour: color('white'),
20
36
  hoverBackground: color('blue_dark'),
21
- hoverColor: color('white')
37
+ hovertextColour: color('white')
22
38
  },
23
39
  blue_light: {
24
40
  background: color('blue_light'),
25
- color: color('black'),
41
+ textColour: color('black'),
26
42
  hoverBackground: color('blue_dark'),
27
- hoverColor: color('white')
43
+ hovertextColour: color('white')
28
44
  },
29
45
  coral: {
30
46
  background: color('coral'),
31
- color: color('black'),
47
+ textColour: color('black'),
32
48
  hoverBackground: color('coral_light'),
33
- hoverColor: color('black')
49
+ hovertextColour: color('black')
34
50
  },
35
51
  coral_dark: {
36
52
  background: color('coral_dark'),
37
- color: color('white'),
53
+ textColour: color('white'),
38
54
  hoverBackground: color('coral'),
39
- hoverColor: color('black')
55
+ hovertextColour: color('black')
40
56
  },
41
57
  coral_light: {
42
58
  background: color('coral_light'),
43
- color: color('black'),
59
+ textColour: color('black'),
44
60
  hoverBackground: color('coral_dark'),
45
- hoverColor: color('white')
61
+ hovertextColour: color('white')
46
62
  },
47
63
  green: {
48
64
  background: color('green'),
49
- color: color('black'),
65
+ textColour: color('black'),
50
66
  hoverBackground: color('green_light'),
51
- hoverColor: color('black')
67
+ hovertextColour: color('black')
52
68
  },
53
69
  green_dark: {
54
70
  background: color('green_dark'),
55
- color: color('white'),
71
+ textColour: color('white'),
56
72
  hoverBackground: color('green'),
57
- hoverColor: color('black')
73
+ hovertextColour: color('black')
58
74
  },
59
75
  green_light: {
60
76
  background: color('green_light'),
61
- color: color('black'),
77
+ textColour: color('black'),
62
78
  hoverBackground: color('green_dark'),
63
- hoverColor: color('white')
79
+ hovertextColour: color('white')
64
80
  },
65
81
  grey: {
66
82
  background: color('grey'),
67
- color: color('black'),
83
+ textColour: color('black'),
68
84
  hoverBackground: color('grey_light'),
69
- hoverColor: color('black')
85
+ hovertextColour: color('black')
70
86
  },
71
87
  grey_dark: {
72
88
  background: color('grey_dark'),
73
- color: color('white'),
89
+ textColour: color('white'),
74
90
  hoverBackground: color('grey'),
75
- hoverColor: color('black')
91
+ hovertextColour: color('black')
76
92
  },
77
93
  grey_light: {
78
94
  background: color('grey_light'),
79
- color: color('black'),
95
+ textColour: color('black'),
80
96
  hoverBackground: color('grey_dark'),
81
- hoverColor: color('white')
97
+ hovertextColour: color('white')
82
98
  },
83
99
  magenta: {
84
100
  background: color('magenta'),
85
- color: color('black'),
101
+ textColour: color('black'),
86
102
  hoverBackground: color('magenta_light'),
87
- hoverColor: color('black')
103
+ hovertextColour: color('black')
88
104
  },
89
105
  magenta_dark: {
90
106
  background: color('magenta_dark'),
91
- color: color('white'),
107
+ textColour: color('white'),
92
108
  hoverBackground: color('magenta'),
93
- hoverColor: color('black')
109
+ hovertextColour: color('black')
94
110
  },
95
111
  magenta_light: {
96
112
  background: color('magenta_light'),
97
- color: color('black'),
113
+ textColour: color('black'),
98
114
  hoverBackground: color('magenta_dark'),
99
- hoverColor: color('white')
115
+ hovertextColour: color('white')
100
116
  },
101
117
  orange: {
102
118
  background: color('orange'),
103
- color: color('black'),
119
+ textColour: color('black'),
104
120
  hoverBackground: color('orange_light'),
105
- hoverColor: color('black')
121
+ hovertextColour: color('black')
106
122
  },
107
123
  orange_dark: {
108
124
  background: color('orange_dark'),
109
- color: color('white'),
125
+ textColour: color('white'),
110
126
  hoverBackground: color('orange'),
111
- hoverColor: color('black')
127
+ hovertextColour: color('black')
112
128
  },
113
129
  orange_light: {
114
130
  background: color('orange_light'),
115
- color: color('black'),
131
+ textColour: color('black'),
116
132
  hoverBackground: color('orange_dark'),
117
- hoverColor: color('white')
133
+ hovertextColour: color('white')
118
134
  },
119
135
  purple: {
120
136
  background: color('purple'),
121
- color: color('white'),
137
+ textColour: color('white'),
122
138
  hoverBackground: color('purple_dark'),
123
- hoverColor: color('white')
139
+ hovertextColour: color('white')
124
140
  },
125
141
  purple_dark: {
126
142
  background: color('purple_dark'),
127
- color: color('white'),
143
+ textColour: color('white'),
128
144
  hoverBackground: color('purple'),
129
- hoverColor: color('white')
145
+ hovertextColour: color('white')
130
146
  },
131
147
  purple_light: {
132
148
  background: color('purple_light'),
133
- color: color('black'),
149
+ textColour: color('black'),
134
150
  hoverBackground: color('purple_dark'),
135
- hoverColor: color('white')
136
- },
137
- red: {
138
- background: color('red'),
139
- color: color('white'),
140
- hoverBackground: color('red_dark'),
141
- hoverColor: color('white')
151
+ hovertextColour: color('white')
142
152
  },
143
153
  teal: {
144
154
  background: color('teal'),
145
- color: color('black'),
155
+ textColour: color('black'),
146
156
  hoverBackground: color('teal_light'),
147
- hoverColor: color('black')
157
+ hovertextColour: color('black')
148
158
  },
149
159
  teal_dark: {
150
160
  background: color('teal_dark'),
151
- color: color('white'),
161
+ textColour: color('white'),
152
162
  hoverBackground: color('teal'),
153
- hoverColor: color('black')
163
+ hovertextColour: color('black')
154
164
  },
155
165
  teal_light: {
156
166
  background: color('teal_light'),
157
- color: color('black'),
167
+ textColour: color('black'),
158
168
  hoverBackground: color('teal_dark'),
159
- hoverColor: color('white')
169
+ hovertextColour: color('white')
160
170
  },
161
171
  transparent: {
162
172
  background: 'rgba(255, 255, 255, 0.5)',
@@ -164,42 +174,72 @@ const buttonColors = {
164
174
  hoverBackground: 'rgba(255, 255, 255, 0.7)',
165
175
  hoverColor: 'inherit'
166
176
  },
167
- white: {
168
- background: color('white'),
169
- color: color('black'),
170
- hoverBackground: color('grey'),
171
- hoverColor: color('black')
172
- },
173
177
  yellow: {
174
178
  background: color('yellow'),
175
- color: color('black'),
179
+ textColour: color('black'),
176
180
  hoverBackground: color('yellow_light'),
177
- hoverColor: color('black')
181
+ hovertextColour: color('black')
178
182
  },
179
183
  yellow_dark: {
180
184
  background: color('yellow_dark'),
181
- color: color('white'),
185
+ textColour: color('white'),
182
186
  hoverBackground: color('yellow'),
183
- hoverColor: color('black')
187
+ hovertextColour: color('black')
184
188
  },
185
189
  yellow_light: {
186
190
  background: color('yellow_light'),
187
- color: color('black'),
191
+ textColour: color('black'),
188
192
  hoverBackground: color('yellow_dark'),
189
- hoverColor: color('white')
193
+ hovertextColour: color('white')
190
194
  }
191
195
  };
192
196
 
193
- export default colorName => {
197
+ export default (colorName, buttonType) => {
194
198
  let style = 'inherit';
199
+
200
+ // Add a fallback, just in case someone is trying to use a non-existent colour:
201
+ const thisColourName = buttonColors[colorName] ? colorName : 'red';
202
+
195
203
  if (colorName) {
196
204
  style = css`
197
- background-color: ${buttonColors[colorName].background};
198
- color: ${buttonColors[colorName].color};
199
- :hover {
200
- background-color: ${buttonColors[colorName].hoverBackground};
201
- color: ${buttonColors[colorName].hoverColor};
205
+ background-color: ${buttonColors[thisColourName].background};
206
+ color: ${buttonColors[thisColourName].textColour};
207
+
208
+ &:hover,
209
+ &:focus,
210
+ &:focus-within,
211
+ &:focus-visible {
212
+ background-color: ${buttonColors[thisColourName].hoverBackground};
213
+ color: ${buttonColors[thisColourName].hoverColor};
214
+ outline-offset: 3px;
202
215
  }
216
+
217
+ &:disabled {
218
+ cursor: not-allowed;
219
+ opacity: 0.5;
220
+ }
221
+
222
+ // 'Secondary' and 'Tertiary' buttonType tweaks
223
+ ${({ theme }) => ((buttonType === theme.buttonTypes.SECONDARY || buttonType === theme.buttonTypes.TERTIARY) && css`
224
+ background-color: transparent;
225
+ color: ${buttonColors[thisColourName].background};
226
+
227
+ ${buttonType === theme.buttonTypes.SECONDARY && css`
228
+ box-shadow: 0px 0px 0px 2px ${buttonColors[thisColourName].background} inset;
229
+ `};
230
+
231
+ &:hover,
232
+ &:focus,
233
+ &:focus-within,
234
+ &:focus-visible {
235
+ color: ${buttonColors[thisColourName].hoverBackground};
236
+ background-color: transparent;
237
+
238
+ ${buttonType === theme.buttonTypes.SECONDARY && css`
239
+ box-shadow: 0px 0px 0px 2px ${buttonColors[thisColourName].hoverBackground} inset;
240
+ `};
241
+ }
242
+ `)};
203
243
  `;
204
244
  }
205
245
  return style;
@@ -0,0 +1,7 @@
1
+ const buttonTypes = {
2
+ PRIMARY: 'primary',
3
+ SECONDARY: 'secondary',
4
+ TERTIARY: 'tertiary'
5
+ };
6
+
7
+ export default buttonTypes;
@@ -10,7 +10,7 @@
10
10
 
11
11
  const colors = {
12
12
 
13
- /* CAMPAIGN COLOURS */
13
+ /* RND25 CAMPAIGN COLOURS */
14
14
  rnd_25_ruby_red: '#AE001B',
15
15
  rnd_25_glitzy_grape: '#A20C51',
16
16
  rnd_25_glitzy_blue: '#0F1953',
@@ -20,6 +20,19 @@ const colors = {
20
20
  rnd_25_party_blue: '#004EFF',
21
21
  rnd_25_party_lilac: '#B07FEA',
22
22
 
23
+ /* RND26 CAMPAIGN COLOURS */
24
+ rnd_26_dark_purple: '#7953E8',
25
+ rnd_26_deep_indigo: '#341A7E',
26
+ rnd_26_light_purple: '#BA9DFC',
27
+ rnd_26_teal: '#036D7C',
28
+ rnd_26_deep_teal: '#024042',
29
+ rnd_26_green: '#7FFB73',
30
+ rnd_26_magenta: '#A7268C',
31
+ rnd_26_deep_magenta: '#601151',
32
+ rnd_26_yellow: '#F8F440',
33
+ rnd_26_vibrant_pink: '#E948D5',
34
+ rnd_26_light_pink: '#FE80EB',
35
+
23
36
  /* GREYSCALE COLOURS */
24
37
  black: '#000000',
25
38
  white: '#FFFFFF',
@@ -137,10 +137,9 @@ export default {
137
137
  lineHeight: '1.375rem'
138
138
  }
139
139
  },
140
- // To be used directly (not via fontHelper), but makes sense to keep here:
141
140
  button: {
142
141
  family: 'Montserrat',
143
- weight: 400,
142
+ weight: 700,
144
143
  transform: 'inherit',
145
144
  small: {
146
145
  fontSize: '1rem',
@@ -155,8 +154,8 @@ export default {
155
154
  lineHeight: '1.375rem'
156
155
  }
157
156
  },
158
- // Admittedly, while the same for each breakpoint, these 2
159
- // config objects made sense to keep it here all the same.
157
+ // Admittedly, while these values are identical for each breakpoint,
158
+ // it still made sense to keep it here all here for parity:
160
159
  formFieldLabel: {
161
160
  family: 'Montserrat',
162
161
  weight: 400,
@@ -1,5 +1,7 @@
1
1
  import color from './colors';
2
2
  import buttonColors from './buttonColors';
3
+ import buttonTypes from './buttonTypes';
4
+
3
5
  import linkStyles from './linkStyles';
4
6
  import fontSize from './fontSizes';
5
7
  import allBreakpoints from '../shared/allBreakpoints';
@@ -10,6 +12,7 @@ import fontFamilies from '../shared/fontFamilies';
10
12
  export default {
11
13
  color,
12
14
  buttonColors,
15
+ buttonTypes,
13
16
  linkStyles,
14
17
  fontSize,
15
18
  allBreakpoints,