@comicrelief/component-library 8.48.1 → 8.49.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 (68) 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/CTAMultiCard/CTAMultiCard.js +6 -2
  11. package/dist/components/Molecules/CTAMultiCard/CTAMultiCard.md +10 -6
  12. package/dist/components/Molecules/CTAMultiCard/CTAMultiCard.style.js +22 -21
  13. package/dist/components/Molecules/CTAMultiCard/SingleCard.js +1 -1
  14. package/dist/components/Molecules/CTAMultiCard/{ArrowIcon.js → _ArrowIcon.js} +2 -2
  15. package/dist/components/Molecules/CTAMultiCard/__snapshots__/CTAMultiCard.test.js.snap +64 -68
  16. package/dist/components/Molecules/CardDs/CardDs.md +3 -3
  17. package/dist/components/Molecules/CardDs/CardDs.test.js +1 -1
  18. package/dist/components/Molecules/CardDs/__snapshots__/CardDs.test.js.snap +43 -41
  19. package/dist/components/Molecules/Lookup/Lookup.js +9 -16
  20. package/dist/components/Molecules/Promo/__snapshots__/Promo.test.js.snap +42 -40
  21. package/dist/components/Molecules/SingleMessage/__snapshots__/SingleMessage.test.js.snap +42 -40
  22. package/dist/components/Molecules/SingleMessageDS/__snapshots__/SingleMessageDs.test.js.snap +20 -19
  23. package/dist/components/Organisms/CookieBanner/CookieBanner.test.js +21 -20
  24. package/dist/components/Organisms/EmailSignUp/_EmailSignUp.js +1 -1
  25. package/dist/components/Organisms/EmailSignUp/__snapshots__/EmailSignUp.test.js.snap +41 -17
  26. package/dist/components/Organisms/FooterNew/__snapshots__/FooterNew.test.js.snap +39 -12
  27. package/dist/components/Organisms/Header2025/Header2025.style.js +1 -1
  28. package/dist/components/Organisms/Header2025/HeaderNav2025/HeaderNav2025.style.js +1 -1
  29. package/dist/theme/crTheme/buttonColors.js +84 -72
  30. package/dist/theme/crTheme/buttonTypes.js +12 -0
  31. package/dist/theme/crTheme/colors.js +13 -1
  32. package/dist/theme/crTheme/fontConfig.js +3 -4
  33. package/dist/theme/crTheme/theme.js +2 -0
  34. package/package.json +1 -1
  35. package/playwright/components/organisms/emailSignUpForm.spec.js +1 -1
  36. package/src/components/Atoms/Button/Button.js +18 -36
  37. package/src/components/Atoms/Button/Button.md +91 -1
  38. package/src/components/Atoms/Button/Button.style.js +37 -0
  39. package/src/components/Atoms/Button/Button.test.js +44 -16
  40. package/src/components/Atoms/ButtonWithStates/ButtonWithStates.js +1 -1
  41. package/src/components/Atoms/Link/Link.js +15 -5
  42. package/src/components/Atoms/Link/Link.md +81 -78
  43. package/src/components/Atoms/Link/Link.style.js +32 -27
  44. package/src/components/Atoms/Link/Link.test.js +20 -19
  45. package/src/components/Molecules/CTAMultiCard/CTAMultiCard.js +8 -2
  46. package/src/components/Molecules/CTAMultiCard/CTAMultiCard.md +10 -6
  47. package/src/components/Molecules/CTAMultiCard/CTAMultiCard.style.js +49 -43
  48. package/src/components/Molecules/CTAMultiCard/SingleCard.js +1 -1
  49. package/src/components/Molecules/CTAMultiCard/__snapshots__/CTAMultiCard.test.js.snap +64 -68
  50. package/src/components/Molecules/CardDs/CardDs.md +3 -3
  51. package/src/components/Molecules/CardDs/CardDs.test.js +1 -1
  52. package/src/components/Molecules/CardDs/__snapshots__/CardDs.test.js.snap +43 -41
  53. package/src/components/Molecules/Lookup/Lookup.js +4 -15
  54. package/src/components/Molecules/Promo/__snapshots__/Promo.test.js.snap +42 -40
  55. package/src/components/Molecules/SingleMessage/__snapshots__/SingleMessage.test.js.snap +42 -40
  56. package/src/components/Molecules/SingleMessageDS/__snapshots__/SingleMessageDs.test.js.snap +20 -19
  57. package/src/components/Organisms/CookieBanner/CookieBanner.test.js +21 -20
  58. package/src/components/Organisms/EmailSignUp/_EmailSignUp.js +1 -1
  59. package/src/components/Organisms/EmailSignUp/__snapshots__/EmailSignUp.test.js.snap +41 -17
  60. package/src/components/Organisms/FooterNew/__snapshots__/FooterNew.test.js.snap +39 -12
  61. package/src/components/Organisms/Header2025/Header2025.style.js +2 -1
  62. package/src/components/Organisms/Header2025/HeaderNav2025/HeaderNav2025.style.js +1 -1
  63. package/src/theme/crTheme/buttonColors.js +116 -76
  64. package/src/theme/crTheme/buttonTypes.js +7 -0
  65. package/src/theme/crTheme/colors.js +14 -1
  66. package/src/theme/crTheme/fontConfig.js +3 -4
  67. package/src/theme/crTheme/theme.js +3 -0
  68. /package/src/components/Molecules/CTAMultiCard/{ArrowIcon.js → _ArrowIcon.js} +0 -0
@@ -49,15 +49,11 @@ exports[`renders correctly 1`] = `
49
49
  display: -ms-inline-flexbox;
50
50
  display: inline-flex;
51
51
  position: relative;
52
- padding: 0.5rem 1.25rem;
53
52
  -webkit-text-decoration: none;
54
53
  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;
54
+ -webkit-transition: all 0.2s;
55
+ transition: all 0.2s;
56
+ min-height: 2.5rem;
61
57
  width: 100%;
62
58
  -webkit-box-pack: center;
63
59
  -webkit-justify-content: center;
@@ -69,8 +65,19 @@ exports[`renders correctly 1`] = `
69
65
  align-items: center;
70
66
  border: none;
71
67
  cursor: pointer;
68
+ padding: 0.6rem 1rem;
69
+ border-radius: 0.5rem;
72
70
  background-color: #E52630;
73
71
  color: #FFFFFF;
72
+ font-family: 'Montserrat',Helvetica,Arial,sans-serif;
73
+ font-weight: 700;
74
+ text-transform: inherit;
75
+ -webkit-letter-spacing: 0;
76
+ -moz-letter-spacing: 0;
77
+ -ms-letter-spacing: 0;
78
+ letter-spacing: 0;
79
+ font-size: 1rem;
80
+ line-height: 1.25rem;
74
81
  }
75
82
 
76
83
  .c15 > a {
@@ -78,9 +85,17 @@ exports[`renders correctly 1`] = `
78
85
  text-decoration: none;
79
86
  }
80
87
 
81
- .c15:hover {
88
+ .c15:hover,
89
+ .c15:focus,
90
+ .c15:focus-within,
91
+ .c15:focus-visible {
82
92
  background-color: #890B11;
83
- color: #FFFFFF;
93
+ outline-offset: 3px;
94
+ }
95
+
96
+ .c15:disabled {
97
+ cursor: not-allowed;
98
+ opacity: 0.5;
84
99
  }
85
100
 
86
101
  .c8 {
@@ -161,7 +176,7 @@ exports[`renders correctly 1`] = `
161
176
 
162
177
  .c16:disabled {
163
178
  cursor: not-allowed;
164
- opacity: 0.75;
179
+ opacity: 0.5;
165
180
  }
166
181
 
167
182
  .c0 {
@@ -278,6 +293,20 @@ exports[`renders correctly 1`] = `
278
293
  }
279
294
  }
280
295
 
296
+ @media (min-width:740px) {
297
+ .c15 {
298
+ font-size: 1rem;
299
+ line-height: 1.25rem;
300
+ }
301
+ }
302
+
303
+ @media (min-width:1024px) {
304
+ .c15 {
305
+ font-size: 1.125rem;
306
+ line-height: 1.375rem;
307
+ }
308
+ }
309
+
281
310
  @media (min-width:740px) {
282
311
  .c15 {
283
312
  width: auto;
@@ -287,8 +316,6 @@ exports[`renders correctly 1`] = `
287
316
  @media (min-width:1024px) {
288
317
  .c15 {
289
318
  width: auto;
290
- padding: 1rem 2rem;
291
- margin: 0 auto 2rem;
292
319
  }
293
320
  }
294
321
 
@@ -478,15 +505,12 @@ exports[`renders correctly 1`] = `
478
505
  >
479
506
  <button
480
507
  className="c15 c16"
508
+ color="red"
481
509
  data-test="subscribe-button"
482
510
  disabled={true}
483
511
  type="submit"
484
512
  >
485
- <span
486
- className="c4"
487
- >
488
- Subscribe
489
- </span>
513
+ Subscribe
490
514
  <div
491
515
  className=""
492
516
  />
@@ -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
+ min-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
 
@@ -51,7 +51,7 @@ const Brand = exports.Brand = _styledComponents.default.div.withConfig({
51
51
  const DonateButtonWrapperTop = exports.DonateButtonWrapperTop = _styledComponents.default.div.withConfig({
52
52
  displayName: "Header2025style__DonateButtonWrapperTop",
53
53
  componentId: "sc-7gs40r-3"
54
- })(["width:100px;display:flex;justify-content:center;margin-left:5px;height:2.8rem;a{width:100%;height:inherit;transition:width 0.4s cubic-bezier(0.5,1.5,0.5,0.80);&:hover,&:focus{width:100%;box-shadow:rgba(0,0,0,0.1) 0 0 20px 0;}}"]);
54
+ })(["width:100px;display:flex;justify-content:center;margin-left:5px;height:2.8rem;a{width:100%;height:inherit;transition:all 0.3s cubic-bezier(0.5,1.5,0.5,0.80);&:hover,&:focus{width:100%;box-shadow:rgba(0,0,0,0.1) 0 0 20px 0;}}"]);
55
55
  const Header2025MetaIcons = exports.Header2025MetaIcons = _styledComponents.default.div.withConfig({
56
56
  displayName: "Header2025style__Header2025MetaIcons",
57
57
  componentId: "sc-7gs40r-4"
@@ -305,7 +305,7 @@ const StyledText = exports.StyledText = (0, _styledComponents.default)(_Text.def
305
305
  const DonateButtonWrapperBottom = exports.DonateButtonWrapperBottom = _styledComponents.default.div.withConfig({
306
306
  displayName: "HeaderNav2025style__DonateButtonWrapperBottom",
307
307
  componentId: "sc-xflhtq-12"
308
- })(["display:flex;justify-content:center;padding:35px 20px;background-color:inherit;a{width:calc(100% - 10px);transition:width 0.35s cubic-bezier(0.5,1.5,0.5,0.9);&:hover,&:focus{width:100%;box-shadow:rgba(0,0,0,0.1) 0 0 20px 0;}}@media ", "{display:none;}"], _ref43 => {
308
+ })(["display:flex;justify-content:center;padding:35px 20px;background-color:inherit;a{width:calc(100% - 10px);transition:all 0.3s cubic-bezier(0.5,1.5,0.5,0.9);&:hover,&:focus{width:100%;box-shadow:rgba(0,0,0,0.1) 0 0 20px 0;}}@media ", "{display:none;}"], _ref43 => {
309
309
  let {
310
310
  theme
311
311
  } = _ref43;
@@ -8,161 +8,171 @@ exports.default = void 0;
8
8
  var _styledComponents = require("styled-components");
9
9
  var _colors = _interopRequireDefault(require("./colors"));
10
10
  const buttonColors = {
11
+ // "Primary - red"
12
+ red: {
13
+ background: (0, _colors.default)('red'),
14
+ textColour: (0, _colors.default)('white'),
15
+ hoverBackground: (0, _colors.default)('red_dark'),
16
+ hovertextColour: (0, _colors.default)('white')
17
+ },
18
+ // "Primary - black"
11
19
  black: {
12
- background: (0, _colors.default)('black'),
13
- color: (0, _colors.default)('white'),
14
- hoverBackground: (0, _colors.default)('grey'),
15
- hoverColor: (0, _colors.default)('white')
20
+ background: (0, _colors.default)('grey_dark'),
21
+ textColour: (0, _colors.default)('white'),
22
+ hoverBackground: (0, _colors.default)('black'),
23
+ hovertextColour: (0, _colors.default)('white')
24
+ },
25
+ // "Primary - white"
26
+ white: {
27
+ background: (0, _colors.default)('white'),
28
+ textColour: (0, _colors.default)('black'),
29
+ hoverBackground: (0, _colors.default)('grey_medium'),
30
+ hovertextColour: (0, _colors.default)('black')
16
31
  },
32
+ // To be phased out:
17
33
  blue: {
18
34
  background: (0, _colors.default)('blue'),
19
- color: (0, _colors.default)('white'),
35
+ textColour: (0, _colors.default)('white'),
20
36
  hoverBackground: (0, _colors.default)('blue_dark'),
21
- hoverColor: (0, _colors.default)('white')
37
+ hovertextColour: (0, _colors.default)('white')
22
38
  },
23
39
  blue_dark: {
24
40
  background: '#2042AD',
25
- color: (0, _colors.default)('white'),
41
+ textColour: (0, _colors.default)('white'),
26
42
  hoverBackground: (0, _colors.default)('blue_dark'),
27
- hoverColor: (0, _colors.default)('white')
43
+ hovertextColour: (0, _colors.default)('white')
28
44
  },
29
45
  blue_light: {
30
46
  background: (0, _colors.default)('blue_light'),
31
- color: (0, _colors.default)('black'),
47
+ textColour: (0, _colors.default)('black'),
32
48
  hoverBackground: (0, _colors.default)('blue_dark'),
33
- hoverColor: (0, _colors.default)('white')
49
+ hovertextColour: (0, _colors.default)('white')
34
50
  },
35
51
  coral: {
36
52
  background: (0, _colors.default)('coral'),
37
- color: (0, _colors.default)('black'),
53
+ textColour: (0, _colors.default)('black'),
38
54
  hoverBackground: (0, _colors.default)('coral_light'),
39
- hoverColor: (0, _colors.default)('black')
55
+ hovertextColour: (0, _colors.default)('black')
40
56
  },
41
57
  coral_dark: {
42
58
  background: (0, _colors.default)('coral_dark'),
43
- color: (0, _colors.default)('white'),
59
+ textColour: (0, _colors.default)('white'),
44
60
  hoverBackground: (0, _colors.default)('coral'),
45
- hoverColor: (0, _colors.default)('black')
61
+ hovertextColour: (0, _colors.default)('black')
46
62
  },
47
63
  coral_light: {
48
64
  background: (0, _colors.default)('coral_light'),
49
- color: (0, _colors.default)('black'),
65
+ textColour: (0, _colors.default)('black'),
50
66
  hoverBackground: (0, _colors.default)('coral_dark'),
51
- hoverColor: (0, _colors.default)('white')
67
+ hovertextColour: (0, _colors.default)('white')
52
68
  },
53
69
  green: {
54
70
  background: (0, _colors.default)('green'),
55
- color: (0, _colors.default)('black'),
71
+ textColour: (0, _colors.default)('black'),
56
72
  hoverBackground: (0, _colors.default)('green_light'),
57
- hoverColor: (0, _colors.default)('black')
73
+ hovertextColour: (0, _colors.default)('black')
58
74
  },
59
75
  green_dark: {
60
76
  background: (0, _colors.default)('green_dark'),
61
- color: (0, _colors.default)('white'),
77
+ textColour: (0, _colors.default)('white'),
62
78
  hoverBackground: (0, _colors.default)('green'),
63
- hoverColor: (0, _colors.default)('black')
79
+ hovertextColour: (0, _colors.default)('black')
64
80
  },
65
81
  green_light: {
66
82
  background: (0, _colors.default)('green_light'),
67
- color: (0, _colors.default)('black'),
83
+ textColour: (0, _colors.default)('black'),
68
84
  hoverBackground: (0, _colors.default)('green_dark'),
69
- hoverColor: (0, _colors.default)('white')
85
+ hovertextColour: (0, _colors.default)('white')
70
86
  },
71
87
  grey: {
72
88
  background: (0, _colors.default)('grey'),
73
- color: (0, _colors.default)('black'),
89
+ textColour: (0, _colors.default)('black'),
74
90
  hoverBackground: (0, _colors.default)('grey_light'),
75
- hoverColor: (0, _colors.default)('black')
91
+ hovertextColour: (0, _colors.default)('black')
76
92
  },
77
93
  grey_dark: {
78
94
  background: (0, _colors.default)('grey_dark'),
79
- color: (0, _colors.default)('white'),
95
+ textColour: (0, _colors.default)('white'),
80
96
  hoverBackground: (0, _colors.default)('grey'),
81
- hoverColor: (0, _colors.default)('black')
97
+ hovertextColour: (0, _colors.default)('black')
82
98
  },
83
99
  grey_light: {
84
100
  background: (0, _colors.default)('grey_light'),
85
- color: (0, _colors.default)('black'),
101
+ textColour: (0, _colors.default)('black'),
86
102
  hoverBackground: (0, _colors.default)('grey_dark'),
87
- hoverColor: (0, _colors.default)('white')
103
+ hovertextColour: (0, _colors.default)('white')
88
104
  },
89
105
  magenta: {
90
106
  background: (0, _colors.default)('magenta'),
91
- color: (0, _colors.default)('black'),
107
+ textColour: (0, _colors.default)('black'),
92
108
  hoverBackground: (0, _colors.default)('magenta_light'),
93
- hoverColor: (0, _colors.default)('black')
109
+ hovertextColour: (0, _colors.default)('black')
94
110
  },
95
111
  magenta_dark: {
96
112
  background: (0, _colors.default)('magenta_dark'),
97
- color: (0, _colors.default)('white'),
113
+ textColour: (0, _colors.default)('white'),
98
114
  hoverBackground: (0, _colors.default)('magenta'),
99
- hoverColor: (0, _colors.default)('black')
115
+ hovertextColour: (0, _colors.default)('black')
100
116
  },
101
117
  magenta_light: {
102
118
  background: (0, _colors.default)('magenta_light'),
103
- color: (0, _colors.default)('black'),
119
+ textColour: (0, _colors.default)('black'),
104
120
  hoverBackground: (0, _colors.default)('magenta_dark'),
105
- hoverColor: (0, _colors.default)('white')
121
+ hovertextColour: (0, _colors.default)('white')
106
122
  },
107
123
  orange: {
108
124
  background: (0, _colors.default)('orange'),
109
- color: (0, _colors.default)('black'),
125
+ textColour: (0, _colors.default)('black'),
110
126
  hoverBackground: (0, _colors.default)('orange_light'),
111
- hoverColor: (0, _colors.default)('black')
127
+ hovertextColour: (0, _colors.default)('black')
112
128
  },
113
129
  orange_dark: {
114
130
  background: (0, _colors.default)('orange_dark'),
115
- color: (0, _colors.default)('white'),
131
+ textColour: (0, _colors.default)('white'),
116
132
  hoverBackground: (0, _colors.default)('orange'),
117
- hoverColor: (0, _colors.default)('black')
133
+ hovertextColour: (0, _colors.default)('black')
118
134
  },
119
135
  orange_light: {
120
136
  background: (0, _colors.default)('orange_light'),
121
- color: (0, _colors.default)('black'),
137
+ textColour: (0, _colors.default)('black'),
122
138
  hoverBackground: (0, _colors.default)('orange_dark'),
123
- hoverColor: (0, _colors.default)('white')
139
+ hovertextColour: (0, _colors.default)('white')
124
140
  },
125
141
  purple: {
126
142
  background: (0, _colors.default)('purple'),
127
- color: (0, _colors.default)('white'),
143
+ textColour: (0, _colors.default)('white'),
128
144
  hoverBackground: (0, _colors.default)('purple_dark'),
129
- hoverColor: (0, _colors.default)('white')
145
+ hovertextColour: (0, _colors.default)('white')
130
146
  },
131
147
  purple_dark: {
132
148
  background: (0, _colors.default)('purple_dark'),
133
- color: (0, _colors.default)('white'),
149
+ textColour: (0, _colors.default)('white'),
134
150
  hoverBackground: (0, _colors.default)('purple'),
135
- hoverColor: (0, _colors.default)('white')
151
+ hovertextColour: (0, _colors.default)('white')
136
152
  },
137
153
  purple_light: {
138
154
  background: (0, _colors.default)('purple_light'),
139
- color: (0, _colors.default)('black'),
155
+ textColour: (0, _colors.default)('black'),
140
156
  hoverBackground: (0, _colors.default)('purple_dark'),
141
- hoverColor: (0, _colors.default)('white')
142
- },
143
- red: {
144
- background: (0, _colors.default)('red'),
145
- color: (0, _colors.default)('white'),
146
- hoverBackground: (0, _colors.default)('red_dark'),
147
- hoverColor: (0, _colors.default)('white')
157
+ hovertextColour: (0, _colors.default)('white')
148
158
  },
149
159
  teal: {
150
160
  background: (0, _colors.default)('teal'),
151
- color: (0, _colors.default)('black'),
161
+ textColour: (0, _colors.default)('black'),
152
162
  hoverBackground: (0, _colors.default)('teal_light'),
153
- hoverColor: (0, _colors.default)('black')
163
+ hovertextColour: (0, _colors.default)('black')
154
164
  },
155
165
  teal_dark: {
156
166
  background: (0, _colors.default)('teal_dark'),
157
- color: (0, _colors.default)('white'),
167
+ textColour: (0, _colors.default)('white'),
158
168
  hoverBackground: (0, _colors.default)('teal'),
159
- hoverColor: (0, _colors.default)('black')
169
+ hovertextColour: (0, _colors.default)('black')
160
170
  },
161
171
  teal_light: {
162
172
  background: (0, _colors.default)('teal_light'),
163
- color: (0, _colors.default)('black'),
173
+ textColour: (0, _colors.default)('black'),
164
174
  hoverBackground: (0, _colors.default)('teal_dark'),
165
- hoverColor: (0, _colors.default)('white')
175
+ hovertextColour: (0, _colors.default)('white')
166
176
  },
167
177
  transparent: {
168
178
  background: 'rgba(255, 255, 255, 0.5)',
@@ -170,35 +180,37 @@ const buttonColors = {
170
180
  hoverBackground: 'rgba(255, 255, 255, 0.7)',
171
181
  hoverColor: 'inherit'
172
182
  },
173
- white: {
174
- background: (0, _colors.default)('white'),
175
- color: (0, _colors.default)('black'),
176
- hoverBackground: (0, _colors.default)('grey'),
177
- hoverColor: (0, _colors.default)('black')
178
- },
179
183
  yellow: {
180
184
  background: (0, _colors.default)('yellow'),
181
- color: (0, _colors.default)('black'),
185
+ textColour: (0, _colors.default)('black'),
182
186
  hoverBackground: (0, _colors.default)('yellow_light'),
183
- hoverColor: (0, _colors.default)('black')
187
+ hovertextColour: (0, _colors.default)('black')
184
188
  },
185
189
  yellow_dark: {
186
190
  background: (0, _colors.default)('yellow_dark'),
187
- color: (0, _colors.default)('white'),
191
+ textColour: (0, _colors.default)('white'),
188
192
  hoverBackground: (0, _colors.default)('yellow'),
189
- hoverColor: (0, _colors.default)('black')
193
+ hovertextColour: (0, _colors.default)('black')
190
194
  },
191
195
  yellow_light: {
192
196
  background: (0, _colors.default)('yellow_light'),
193
- color: (0, _colors.default)('black'),
197
+ textColour: (0, _colors.default)('black'),
194
198
  hoverBackground: (0, _colors.default)('yellow_dark'),
195
- hoverColor: (0, _colors.default)('white')
199
+ hovertextColour: (0, _colors.default)('white')
196
200
  }
197
201
  };
198
- var _default = colorName => {
202
+ var _default = (colorName, buttonType) => {
199
203
  let style = 'inherit';
204
+
205
+ // Add a fallback, just in case someone is trying to use a non-existent colour:
206
+ const thisColourName = buttonColors[colorName] ? colorName : 'red';
200
207
  if (colorName) {
201
- style = (0, _styledComponents.css)(["background-color:", ";color:", ";:hover{background-color:", ";color:", ";}"], buttonColors[colorName].background, buttonColors[colorName].color, buttonColors[colorName].hoverBackground, buttonColors[colorName].hoverColor);
208
+ style = (0, _styledComponents.css)(["background-color:", ";color:", ";&:hover,&:focus,&:focus-within,&:focus-visible{background-color:", ";color:", ";outline-offset:3px;}&:disabled{cursor:not-allowed;opacity:0.5;}", ";"], buttonColors[thisColourName].background, buttonColors[thisColourName].textColour, buttonColors[thisColourName].hoverBackground, buttonColors[thisColourName].hoverColor, _ref => {
209
+ let {
210
+ theme
211
+ } = _ref;
212
+ return (buttonType === theme.buttonTypes.SECONDARY || buttonType === theme.buttonTypes.TERTIARY) && (0, _styledComponents.css)(["background-color:transparent;color:", ";", ";&:hover,&:focus,&:focus-within,&:focus-visible{color:", ";background-color:transparent;", ";}"], buttonColors[thisColourName].background, buttonType === theme.buttonTypes.SECONDARY && (0, _styledComponents.css)(["box-shadow:0px 0px 0px 2px ", " inset;"], buttonColors[thisColourName].background), buttonColors[thisColourName].hoverBackground, buttonType === theme.buttonTypes.SECONDARY && (0, _styledComponents.css)(["box-shadow:0px 0px 0px 2px ", " inset;"], buttonColors[thisColourName].hoverBackground));
213
+ });
202
214
  }
203
215
  return style;
204
216
  };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ const buttonTypes = {
8
+ PRIMARY: 'primary',
9
+ SECONDARY: 'secondary',
10
+ TERTIARY: 'tertiary'
11
+ };
12
+ var _default = exports.default = buttonTypes;
@@ -15,7 +15,7 @@ exports.default = void 0;
15
15
  */
16
16
 
17
17
  const colors = {
18
- /* CAMPAIGN COLOURS */
18
+ /* RND25 CAMPAIGN COLOURS */
19
19
  rnd_25_ruby_red: '#AE001B',
20
20
  rnd_25_glitzy_grape: '#A20C51',
21
21
  rnd_25_glitzy_blue: '#0F1953',
@@ -24,6 +24,18 @@ const colors = {
24
24
  rnd_25_party_pink: '#FF9DEC',
25
25
  rnd_25_party_blue: '#004EFF',
26
26
  rnd_25_party_lilac: '#B07FEA',
27
+ /* RND26 CAMPAIGN COLOURS */
28
+ rnd_26_dark_purple: '#7953E8',
29
+ rnd_26_deep_indigo: '#341A7E',
30
+ rnd_26_light_purple: '#BA9DFC',
31
+ rnd_26_teal: '#036D7C',
32
+ rnd_26_deep_teal: '#024042',
33
+ rnd_26_green: '#7FFB73',
34
+ rnd_26_magenta: '#A7268C',
35
+ rnd_26_deep_magenta: '#601151',
36
+ rnd_26_yellow: '#F8F440',
37
+ rnd_26_vibrant_pink: '#E948D5',
38
+ rnd_26_light_pink: '#FE80EB',
27
39
  /* GREYSCALE COLOURS */
28
40
  black: '#000000',
29
41
  white: '#FFFFFF',
@@ -143,10 +143,9 @@ var _default = exports.default = {
143
143
  lineHeight: '1.375rem'
144
144
  }
145
145
  },
146
- // To be used directly (not via fontHelper), but makes sense to keep here:
147
146
  button: {
148
147
  family: 'Montserrat',
149
- weight: 400,
148
+ weight: 700,
150
149
  transform: 'inherit',
151
150
  small: {
152
151
  fontSize: '1rem',
@@ -161,8 +160,8 @@ var _default = exports.default = {
161
160
  lineHeight: '1.375rem'
162
161
  }
163
162
  },
164
- // Admittedly, while the same for each breakpoint, these 2
165
- // config objects made sense to keep it here all the same.
163
+ // Admittedly, while these values are identical for each breakpoint,
164
+ // it still made sense to keep it here all here for parity:
166
165
  formFieldLabel: {
167
166
  family: 'Montserrat',
168
167
  weight: 400,
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _colors = _interopRequireDefault(require("./colors"));
9
9
  var _buttonColors = _interopRequireDefault(require("./buttonColors"));
10
+ var _buttonTypes = _interopRequireDefault(require("./buttonTypes"));
10
11
  var _linkStyles = _interopRequireDefault(require("./linkStyles"));
11
12
  var _fontSizes = _interopRequireDefault(require("./fontSizes"));
12
13
  var _allBreakpoints = _interopRequireDefault(require("../shared/allBreakpoints"));
@@ -15,6 +16,7 @@ var _fontFamilies = _interopRequireDefault(require("../shared/fontFamilies"));
15
16
  var _default = exports.default = {
16
17
  color: _colors.default,
17
18
  buttonColors: _buttonColors.default,
19
+ buttonTypes: _buttonTypes.default,
18
20
  linkStyles: _linkStyles.default,
19
21
  fontSize: _fontSizes.default,
20
22
  allBreakpoints: _allBreakpoints.default,
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.48.1",
4
+ "version": "8.49.0",
5
5
  "main": "dist/index.js",
6
6
  "license": "ISC",
7
7
  "jest": {
@@ -101,7 +101,7 @@ test.describe('Email Signup Form component', () => {
101
101
  await page.locator('[data-testid="EmailSignUpForm-example-1"] #email').type('email-signup@email.sls.comicrelief.com');
102
102
 
103
103
  // submit the ESU form
104
- await page.locator('[data-testid="EmailSignUpForm-example-1"] button[type="submit"] > span').click();
104
+ await page.locator('[data-testid="EmailSignUpForm-example-1"] button[type="submit"]').click();
105
105
 
106
106
  await page.close();
107
107
  });