@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
 
@@ -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;
@@ -43,7 +43,6 @@ const ImpactSlider = _ref => {
43
43
  }, /*#__PURE__*/_react.default.createElement(_ImpactSlider.InnerWrapper, null, /*#__PURE__*/_react.default.createElement(_Text.default, {
44
44
  tag: "h1",
45
45
  family: "Anton",
46
- uppercase: true,
47
46
  weight: "normal",
48
47
  size: "xl"
49
48
  }, heading), /*#__PURE__*/_react.default.createElement(_ImpactSlider.Copy, null, children), /*#__PURE__*/_react.default.createElement(_ImpactSlider.CurrentAmountCopy, {
@@ -26,7 +26,6 @@ const Moneybuys = _ref => {
26
26
  }), /*#__PURE__*/_react.default.createElement(_ImpactMoneybuys.MoneybuyAmount, {
27
27
  tag: "p",
28
28
  family: "Anton",
29
- uppercase: true,
30
29
  weight: "normal",
31
30
  size: "xl",
32
31
  "data-testid": "moneybuy-amount"
@@ -69,7 +69,6 @@ const WYMDCarousel = _ref => {
69
69
  }, data.headerCopy), /*#__PURE__*/_react.default.createElement(_WYMDCarousel.PeopleHelpedText, {
70
70
  tag: "h1",
71
71
  family: "Anton",
72
- uppercase: true,
73
72
  weight: "normal",
74
73
  color: "red"
75
74
  }, data.peopleHelpedText), /*#__PURE__*/_react.default.createElement(_WYMDCarousel.Including, {
@@ -108,7 +107,6 @@ const WYMDCarousel = _ref => {
108
107
  }, /*#__PURE__*/_react.default.createElement(_WYMDCarousel.AmountWrapper, null, /*#__PURE__*/_react.default.createElement(_Text.default, {
109
108
  tag: "h1",
110
109
  family: "Anton",
111
- uppercase: true,
112
110
  weight: "normal",
113
111
  size: "s"
114
112
  }, theseItems[key].amount)), /*#__PURE__*/_react.default.createElement(_WYMDCarousel.CopyWrapper, null, /*#__PURE__*/_react.default.createElement(_Text.default, {
@@ -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
 
@@ -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.2",
4
+ "version": "8.49.1",
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
  });