@comicrelief/component-library 7.21.0 → 7.22.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 (29) hide show
  1. package/dist/components/Molecules/Promo/Promo.js +95 -13
  2. package/dist/components/Molecules/Promo/Promo.md +252 -8
  3. package/dist/components/Molecules/Promo/Promo.style.js +31 -6
  4. package/dist/components/Molecules/Promo/Promo.test.js +2 -2
  5. package/dist/components/Molecules/Promo/_ProgressRing.js +57 -0
  6. package/dist/components/Molecules/Promo/_PromoVideo.js +118 -0
  7. package/dist/components/Molecules/Promo/_PromoVideoButton.js +33 -0
  8. package/dist/components/Molecules/Promo/_PromoVideoButton.style.js +110 -0
  9. package/dist/components/Molecules/Promo/__snapshots__/Promo.test.js.snap +116 -72
  10. package/dist/components/Molecules/Promo/assets/Pause--black.svg +3 -0
  11. package/dist/components/Molecules/Promo/assets/Pause--white.svg +3 -0
  12. package/dist/components/Molecules/Promo/assets/Play--black.svg +3 -0
  13. package/dist/components/Molecules/Promo/assets/Play--white.svg +3 -0
  14. package/dist/styleguide/assets/mobileVideoPosterImage.png +0 -0
  15. package/package.json +1 -1
  16. package/src/components/Molecules/Promo/Promo.js +96 -14
  17. package/src/components/Molecules/Promo/Promo.md +252 -8
  18. package/src/components/Molecules/Promo/Promo.style.js +40 -7
  19. package/src/components/Molecules/Promo/Promo.test.js +2 -2
  20. package/src/components/Molecules/Promo/_ProgressRing.js +43 -0
  21. package/src/components/Molecules/Promo/_PromoVideo.js +108 -0
  22. package/src/components/Molecules/Promo/_PromoVideoButton.js +26 -0
  23. package/src/components/Molecules/Promo/_PromoVideoButton.style.js +126 -0
  24. package/src/components/Molecules/Promo/__snapshots__/Promo.test.js.snap +116 -72
  25. package/src/components/Molecules/Promo/assets/Pause--black.svg +3 -0
  26. package/src/components/Molecules/Promo/assets/Pause--white.svg +3 -0
  27. package/src/components/Molecules/Promo/assets/Play--black.svg +3 -0
  28. package/src/components/Molecules/Promo/assets/Play--white.svg +3 -0
  29. package/src/styleguide/assets/mobileVideoPosterImage.png +0 -0
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
11
+
12
+ var _react = _interopRequireWildcard(require("react"));
13
+
14
+ var _Promo = require("./Promo.style");
15
+
16
+ var _PromoVideoButton = _interopRequireDefault(require("./_PromoVideoButton"));
17
+
18
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
+
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+
22
+ var PromoVideo = function PromoVideo(_ref) {
23
+ var behindTextGradient = _ref.behindTextGradient,
24
+ copyLeft = _ref.copyLeft,
25
+ thisVideoSrc = _ref.thisVideoSrc,
26
+ thisPoster = _ref.thisPoster,
27
+ autoPlay = _ref.autoPlay,
28
+ loop = _ref.loop,
29
+ showPosterAfterPlaying = _ref.showPosterAfterPlaying,
30
+ blackPlayButton = _ref.blackPlayButton;
31
+
32
+ var _useState = (0, _react.useState)(false),
33
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
34
+ isPlaying = _useState2[0],
35
+ setIsPlaying = _useState2[1];
36
+
37
+ var _useState3 = (0, _react.useState)(false),
38
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
39
+ isRestarting = _useState4[0],
40
+ setIsRestarting = _useState4[1];
41
+
42
+ var _useState5 = (0, _react.useState)(0),
43
+ _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
44
+ videoProgress = _useState6[0],
45
+ setVideoProgress = _useState6[1];
46
+
47
+ var videoEl = (0, _react.useRef)(null);
48
+
49
+ var togglePlay = function togglePlay() {
50
+ if (isPlaying) videoEl.current.pause();else videoEl.current.play();
51
+ setIsPlaying(!isPlaying);
52
+ };
53
+
54
+ var updateTime = function updateTime() {
55
+ if (videoEl.current.duration) {
56
+ // Calculate the percentage of the video played:
57
+ var percentage = Math.round(videoEl.current.currentTime / videoEl.current.duration * 100); // Because a completely smooth animation is impossible with the 250ms-ish frequency of
58
+ // the 'timeupdate' event, we're electing to just update the ring every 25%.
59
+
60
+ var nearest = 25;
61
+ var roundedPercentage = percentage + nearest / 2 - (percentage + nearest / 2) % nearest;
62
+ setVideoProgress(roundedPercentage);
63
+ }
64
+ }; // Only loads once the initial screensize check is complete
65
+
66
+
67
+ (0, _react.useEffect)(function () {
68
+ // Use truthy comparison so either a null OR undefined value won't work
69
+ if (thisVideoSrc != null) {
70
+ videoEl.current.addEventListener('timeupdate', updateTime); // Trigger on-load autoplay if apppropriate
71
+
72
+ if (autoPlay && !isPlaying) {
73
+ togglePlay();
74
+ }
75
+
76
+ videoEl.current.addEventListener('ended', function () {
77
+ // Used purely to halt the CSS animation:
78
+ setIsRestarting(true); // If this is a non-looping video, add a listener to update our local state
79
+ // once the video's ended, to let the user retrigger it manually:
80
+
81
+ if (!loop) {
82
+ setIsPlaying(false);
83
+ setVideoProgress(0); // Reload the video to show the poster image:
84
+
85
+ if (showPosterAfterPlaying) videoEl.current.load();
86
+ } else {
87
+ // Rather than using the Video 'loop' property, we retrigger
88
+ // it in *code* as there's no 'restarted' to hook into:
89
+ togglePlay();
90
+ } // Grace period to allow the animation to reset
91
+
92
+
93
+ setTimeout(function () {
94
+ setIsRestarting(false);
95
+ }, 100);
96
+ });
97
+ } // CERTAINLY don't want this re-running for EACH of these variable updates, sorry Lint...
98
+ // eslint-disable-next-line react-hooks/exhaustive-deps
99
+
100
+ }, [thisVideoSrc]);
101
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Promo.Video, {
102
+ ref: videoEl,
103
+ src: thisVideoSrc,
104
+ poster: thisPoster,
105
+ muted: true
106
+ }, "Your browser does not support this video filetype."), /*#__PURE__*/_react.default.createElement(_PromoVideoButton.default, {
107
+ copyLeft: copyLeft,
108
+ videoProgress: videoProgress,
109
+ togglePlay: togglePlay,
110
+ isPlaying: isPlaying,
111
+ behindTextGradient: behindTextGradient,
112
+ blackPlayButton: blackPlayButton,
113
+ isRestarting: isRestarting
114
+ }));
115
+ };
116
+
117
+ var _default = PromoVideo;
118
+ exports.default = _default;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
11
+
12
+ var _react = _interopRequireDefault(require("react"));
13
+
14
+ var _ProgressRing = _interopRequireDefault(require("./_ProgressRing"));
15
+
16
+ var _PromoVideoButton = require("./_PromoVideoButton.style");
17
+
18
+ var _excluded = ["togglePlay"];
19
+
20
+ var PromoVideoButton = function PromoVideoButton(_ref) {
21
+ var togglePlay = _ref.togglePlay,
22
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
23
+ return /*#__PURE__*/_react.default.createElement(_PromoVideoButton.PlayButtonWrapper, {
24
+ className: "weewee"
25
+ }, /*#__PURE__*/_react.default.createElement(_PromoVideoButton.PlayButton, Object.assign({
26
+ onClick: function onClick() {
27
+ togglePlay();
28
+ }
29
+ }, rest), /*#__PURE__*/_react.default.createElement(_PromoVideoButton.Icon, rest), /*#__PURE__*/_react.default.createElement(_ProgressRing.default, rest)));
30
+ };
31
+
32
+ var _default = PromoVideoButton;
33
+ exports.default = _default;
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.Icon = exports.PlayButtonWrapper = exports.PlayButton = exports.ProgressRingCircle = exports.ProgressRingSVG = exports.ProgressRingWrapper = void 0;
9
+
10
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
11
+
12
+ var _PlayWhite = _interopRequireDefault(require("./assets/Play--white.svg"));
13
+
14
+ var _PauseWhite = _interopRequireDefault(require("./assets/Pause--white.svg"));
15
+
16
+ var _PlayBlack = _interopRequireDefault(require("./assets/Play--black.svg"));
17
+
18
+ var _PauseBlack = _interopRequireDefault(require("./assets/Pause--black.svg"));
19
+
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
+
22
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+
24
+ var PlayButtonWrapper = _styledComponents.default.div.withConfig({
25
+ displayName: "_PromoVideoButtonstyle__PlayButtonWrapper",
26
+ componentId: "sc-17cm3uc-0"
27
+ })(["width:100%;height:100%;position:absolute;top:0;left:0;z-index:1;&:after{content:\"\";background-image:url(", "),url(", "),url(", "),url(", "),none;}"], _PlayWhite.default, _PauseWhite.default, _PlayBlack.default, _PauseBlack.default);
28
+
29
+ exports.PlayButtonWrapper = PlayButtonWrapper;
30
+
31
+ var PlayButton = _styledComponents.default.button.withConfig({
32
+ displayName: "_PromoVideoButtonstyle__PlayButton",
33
+ componentId: "sc-17cm3uc-1"
34
+ })(["display:flex;width:50px;height:50px;position:absolute;top:10px;right:10px;align-items:center;justify-content:center;border:0;padding:0;margin:0;border-radius:50%;background:", ";opacity:0.8;transition:opacity 0.2s;&:hover,&:focus{opacity:1.0;}&:focus-visible{outline-style:outset;outline-width:medium;}", " ", " @media ", "{top:20px;right:20px;", "}"], function (_ref) {
35
+ var theme = _ref.theme;
36
+ return theme.color('white');
37
+ }, function (_ref2) {
38
+ var blackPlayButton = _ref2.blackPlayButton;
39
+ return blackPlayButton && (0, _styledComponents.css)(["background:", ";"], function (_ref3) {
40
+ var theme = _ref3.theme;
41
+ return theme.color('black');
42
+ });
43
+ }, function (_ref4) {
44
+ var copyLeft = _ref4.copyLeft;
45
+ return !copyLeft && (0, _styledComponents.css)(["right:auto;left:10px;"]);
46
+ }, function (_ref5) {
47
+ var theme = _ref5.theme;
48
+ return theme.breakpoint('medium');
49
+ }, function (_ref6) {
50
+ var copyLeft = _ref6.copyLeft;
51
+ return !copyLeft && (0, _styledComponents.css)(["right:auto;left:20px;"]);
52
+ });
53
+
54
+ exports.PlayButton = PlayButton;
55
+
56
+ var ProgressRingWrapper = _styledComponents.default.span.withConfig({
57
+ displayName: "_PromoVideoButtonstyle__ProgressRingWrapper",
58
+ componentId: "sc-17cm3uc-2"
59
+ })(["position:absolute;width:100%;height:100%;display:flex;"]);
60
+
61
+ exports.ProgressRingWrapper = ProgressRingWrapper;
62
+
63
+ var ProgressRingSVG = _styledComponents.default.svg.withConfig({
64
+ displayName: "_PromoVideoButtonstyle__ProgressRingSVG",
65
+ componentId: "sc-17cm3uc-3"
66
+ })([""]);
67
+
68
+ exports.ProgressRingSVG = ProgressRingSVG;
69
+
70
+ var ProgressRingCircle = _styledComponents.default.circle.withConfig({
71
+ displayName: "_PromoVideoButtonstyle__ProgressRingCircle",
72
+ componentId: "sc-17cm3uc-4"
73
+ })(["z-index:100;transition:stroke-dashoffset 0.5s;transform:rotate(-90deg);transform-origin:50% 50%;stroke-dashoffset:", ";stroke:white;fill:transparent;", " ", ""], function (_ref7) {
74
+ var strokeDashOffsetStyle = _ref7.strokeDashOffsetStyle;
75
+ return strokeDashOffsetStyle;
76
+ }, function (_ref8) {
77
+ var blackPlayButton = _ref8.blackPlayButton;
78
+ return !blackPlayButton && (0, _styledComponents.css)(["stroke:", ";"], function (_ref9) {
79
+ var theme = _ref9.theme;
80
+ return theme.color('black');
81
+ });
82
+ }, function (_ref10) {
83
+ var isRestarting = _ref10.isRestarting;
84
+ return isRestarting && (0, _styledComponents.css)(["transition:none;"]);
85
+ });
86
+
87
+ exports.ProgressRingCircle = ProgressRingCircle;
88
+
89
+ var Icon = _styledComponents.default.span.withConfig({
90
+ displayName: "_PromoVideoButtonstyle__Icon",
91
+ componentId: "sc-17cm3uc-5"
92
+ })(["height:50px;width:50px;background:no-repeat center/50% url(", ") transparent;", " ", " ", " ", ""], _PlayWhite.default, function (_ref11) {
93
+ var blackPlayButton = _ref11.blackPlayButton,
94
+ isPlaying = _ref11.isPlaying;
95
+ return blackPlayButton && !isPlaying && (0, _styledComponents.css)(["background-image:url(", ");"], _PlayWhite.default);
96
+ }, function (_ref12) {
97
+ var blackPlayButton = _ref12.blackPlayButton,
98
+ isPlaying = _ref12.isPlaying;
99
+ return blackPlayButton && isPlaying && (0, _styledComponents.css)(["background-image:url(", ");"], _PauseWhite.default);
100
+ }, function (_ref13) {
101
+ var blackPlayButton = _ref13.blackPlayButton,
102
+ isPlaying = _ref13.isPlaying;
103
+ return !blackPlayButton && !isPlaying && (0, _styledComponents.css)(["background-image:url(", ");"], _PlayBlack.default);
104
+ }, function (_ref14) {
105
+ var blackPlayButton = _ref14.blackPlayButton,
106
+ isPlaying = _ref14.isPlaying;
107
+ return !blackPlayButton && isPlaying && (0, _styledComponents.css)(["background-image:url(", ");"], _PauseBlack.default);
108
+ });
109
+
110
+ exports.Icon = Icon;
@@ -1,7 +1,7 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`renders Promo correctly 1`] = `
4
- .c6 {
4
+ .c7 {
5
5
  color: #FFFFFF;
6
6
  font-size: 5rem;
7
7
  line-height: 5rem;
@@ -16,7 +16,7 @@ exports[`renders Promo correctly 1`] = `
16
16
  line-height: 3rem;
17
17
  }
18
18
 
19
- .c7 {
19
+ .c8 {
20
20
  color: #FFFFFF;
21
21
  font-size: 1rem;
22
22
  line-height: 1rem;
@@ -39,7 +39,7 @@ exports[`renders Promo correctly 1`] = `
39
39
  object-fit: cover;
40
40
  }
41
41
 
42
- .c8 {
42
+ .c9 {
43
43
  display: -webkit-inline-box;
44
44
  display: -webkit-inline-flex;
45
45
  display: -ms-inline-flexbox;
@@ -68,7 +68,7 @@ exports[`renders Promo correctly 1`] = `
68
68
  color: #000000;
69
69
  }
70
70
 
71
- .c8:hover {
71
+ .c9:hover {
72
72
  background-color: #969598;
73
73
  color: #000000;
74
74
  }
@@ -102,13 +102,14 @@ exports[`renders Promo correctly 1`] = `
102
102
  -webkit-box-align: center;
103
103
  -ms-flex-align: center;
104
104
  align-items: center;
105
+ position: relative;
105
106
  -webkit-box-pack: end;
106
107
  -webkit-justify-content: flex-end;
107
108
  -ms-flex-pack: end;
108
109
  justify-content: flex-end;
109
110
  }
110
111
 
111
- .c5 {
112
+ .c6 {
112
113
  width: 100%;
113
114
  padding: 1.5rem 1.5rem 4rem;
114
115
  z-index: 1;
@@ -123,8 +124,21 @@ exports[`renders Promo correctly 1`] = `
123
124
  object-position: center;
124
125
  }
125
126
 
127
+ .c5 {
128
+ width: 100%;
129
+ height: 100%;
130
+ display: -webkit-box;
131
+ display: -webkit-flex;
132
+ display: -ms-flexbox;
133
+ display: flex;
134
+ -webkit-align-items: center;
135
+ -webkit-box-align: center;
136
+ -ms-flex-align: center;
137
+ align-items: center;
138
+ }
139
+
126
140
  @media (min-width:740px) {
127
- .c6 {
141
+ .c7 {
128
142
  font-size: 4rem;
129
143
  line-height: 4rem;
130
144
  margin-bottom: 2rem;
@@ -132,7 +146,7 @@ exports[`renders Promo correctly 1`] = `
132
146
  }
133
147
 
134
148
  @media (min-width:1024px) {
135
- .c6 {
149
+ .c7 {
136
150
  font-size: 5rem;
137
151
  line-height: 5rem;
138
152
  margin-bottom: 2rem;
@@ -140,7 +154,7 @@ exports[`renders Promo correctly 1`] = `
140
154
  }
141
155
 
142
156
  @media (min-width:740px) {
143
- .c8 {
157
+ .c9 {
144
158
  width: auto;
145
159
  }
146
160
  }
@@ -160,23 +174,27 @@ exports[`renders Promo correctly 1`] = `
160
174
  }
161
175
 
162
176
  @media (min-width:1024px) {
163
- .c5 {
164
- width: 70%;
165
- padding: 4rem 1.5rem;
177
+ .c6 {
178
+ width: 100%;
179
+ padding: 8rem 1.5rem;
166
180
  }
167
181
  }
168
182
 
169
183
  @media (min-width:1024px) {
170
- .c5 {
171
- width: 50%;
172
- padding: 8rem 1.5rem;
184
+ .c1 {
185
+ height: 100%;
186
+ position: absolute;
173
187
  }
174
188
  }
175
189
 
176
190
  @media (min-width:1024px) {
177
- .c1 {
178
- height: 100%;
191
+ .c5 {
192
+ width: 50%;
179
193
  position: absolute;
194
+ top: 0;
195
+ left: 0;
196
+ left: auto;
197
+ right: 0;
180
198
  }
181
199
  }
182
200
 
@@ -211,38 +229,42 @@ exports[`renders Promo correctly 1`] = `
211
229
  <div
212
230
  className="c5"
213
231
  >
214
- <h1
232
+ <div
215
233
  className="c6"
216
- color="white"
217
- size="super"
218
- >
219
- Curabitur pretium tincidunt lacus
220
- </h1>
221
- <p
222
- className="c7"
223
- color="white"
224
- size="s"
225
234
  >
226
- Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo, est eros bibendum elit, nec luctus magna sollicitudin.
227
- </p>
228
- <span>
229
- <a
235
+ <h1
236
+ className="c7"
237
+ color="white"
238
+ size="super"
239
+ >
240
+ Curabitur pretium tincidunt lacus
241
+ </h1>
242
+ <p
230
243
  className="c8"
231
244
  color="white"
232
- href="/"
233
- target="_self"
234
- type="button"
245
+ size="s"
235
246
  >
236
- Show me this
237
- </a>
238
- </span>
247
+ Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo, est eros bibendum elit, nec luctus magna sollicitudin.
248
+ </p>
249
+ <span>
250
+ <a
251
+ className="c9"
252
+ color="white"
253
+ href="/"
254
+ target="_self"
255
+ type="button"
256
+ >
257
+ Show me this
258
+ </a>
259
+ </span>
260
+ </div>
239
261
  </div>
240
262
  </div>
241
263
  </div>
242
264
  `;
243
265
 
244
266
  exports[`renders Promo correctly end position 1`] = `
245
- .c6 {
267
+ .c7 {
246
268
  color: #FFFFFF;
247
269
  font-size: 5rem;
248
270
  line-height: 5rem;
@@ -257,7 +279,7 @@ exports[`renders Promo correctly end position 1`] = `
257
279
  line-height: 3rem;
258
280
  }
259
281
 
260
- .c7 {
282
+ .c8 {
261
283
  color: #FFFFFF;
262
284
  font-size: 1rem;
263
285
  line-height: 1rem;
@@ -280,7 +302,7 @@ exports[`renders Promo correctly end position 1`] = `
280
302
  object-fit: cover;
281
303
  }
282
304
 
283
- .c8 {
305
+ .c9 {
284
306
  display: -webkit-inline-box;
285
307
  display: -webkit-inline-flex;
286
308
  display: -ms-inline-flexbox;
@@ -309,7 +331,7 @@ exports[`renders Promo correctly end position 1`] = `
309
331
  color: #000000;
310
332
  }
311
333
 
312
- .c8:hover {
334
+ .c9:hover {
313
335
  background-color: #969598;
314
336
  color: #000000;
315
337
  }
@@ -346,13 +368,14 @@ exports[`renders Promo correctly end position 1`] = `
346
368
  -webkit-box-align: center;
347
369
  -ms-flex-align: center;
348
370
  align-items: center;
371
+ position: relative;
349
372
  -webkit-box-pack: end;
350
373
  -webkit-justify-content: flex-end;
351
374
  -ms-flex-pack: end;
352
375
  justify-content: flex-end;
353
376
  }
354
377
 
355
- .c5 {
378
+ .c6 {
356
379
  width: 100%;
357
380
  padding: 1.5rem 1.5rem 4rem;
358
381
  z-index: 1;
@@ -367,8 +390,21 @@ exports[`renders Promo correctly end position 1`] = `
367
390
  object-position: center;
368
391
  }
369
392
 
393
+ .c5 {
394
+ width: 100%;
395
+ height: 100%;
396
+ display: -webkit-box;
397
+ display: -webkit-flex;
398
+ display: -ms-flexbox;
399
+ display: flex;
400
+ -webkit-align-items: center;
401
+ -webkit-box-align: center;
402
+ -ms-flex-align: center;
403
+ align-items: center;
404
+ }
405
+
370
406
  @media (min-width:740px) {
371
- .c6 {
407
+ .c7 {
372
408
  font-size: 4rem;
373
409
  line-height: 4rem;
374
410
  margin-bottom: 2rem;
@@ -376,7 +412,7 @@ exports[`renders Promo correctly end position 1`] = `
376
412
  }
377
413
 
378
414
  @media (min-width:1024px) {
379
- .c6 {
415
+ .c7 {
380
416
  font-size: 5rem;
381
417
  line-height: 5rem;
382
418
  margin-bottom: 2rem;
@@ -384,7 +420,7 @@ exports[`renders Promo correctly end position 1`] = `
384
420
  }
385
421
 
386
422
  @media (min-width:740px) {
387
- .c8 {
423
+ .c9 {
388
424
  width: auto;
389
425
  }
390
426
  }
@@ -412,23 +448,27 @@ exports[`renders Promo correctly end position 1`] = `
412
448
  }
413
449
 
414
450
  @media (min-width:1024px) {
415
- .c5 {
416
- width: 70%;
417
- padding: 4rem 1.5rem;
451
+ .c6 {
452
+ width: 100%;
453
+ padding: 8rem 1.5rem;
418
454
  }
419
455
  }
420
456
 
421
457
  @media (min-width:1024px) {
422
- .c5 {
423
- width: 50%;
424
- padding: 8rem 1.5rem;
458
+ .c1 {
459
+ height: 100%;
460
+ position: absolute;
425
461
  }
426
462
  }
427
463
 
428
464
  @media (min-width:1024px) {
429
- .c1 {
430
- height: 100%;
465
+ .c5 {
466
+ width: 50%;
431
467
  position: absolute;
468
+ top: 0;
469
+ left: 0;
470
+ left: auto;
471
+ right: 0;
432
472
  }
433
473
  }
434
474
 
@@ -463,31 +503,35 @@ exports[`renders Promo correctly end position 1`] = `
463
503
  <div
464
504
  className="c5"
465
505
  >
466
- <h1
506
+ <div
467
507
  className="c6"
468
- color="white"
469
- size="super"
470
- >
471
- Curabitur pretium tincidunt lacus
472
- </h1>
473
- <p
474
- className="c7"
475
- color="white"
476
- size="s"
477
508
  >
478
- Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo, est eros bibendum elit, nec luctus magna sollicitudin.
479
- </p>
480
- <span>
481
- <a
509
+ <h1
510
+ className="c7"
511
+ color="white"
512
+ size="super"
513
+ >
514
+ Curabitur pretium tincidunt lacus
515
+ </h1>
516
+ <p
482
517
  className="c8"
483
518
  color="white"
484
- href="/"
485
- target="_self"
486
- type="button"
519
+ size="s"
487
520
  >
488
- Show me this
489
- </a>
490
- </span>
521
+ Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo, est eros bibendum elit, nec luctus magna sollicitudin.
522
+ </p>
523
+ <span>
524
+ <a
525
+ className="c9"
526
+ color="white"
527
+ href="/"
528
+ target="_self"
529
+ type="button"
530
+ >
531
+ Show me this
532
+ </a>
533
+ </span>
534
+ </div>
491
535
  </div>
492
536
  </div>
493
537
  </div>
@@ -0,0 +1,3 @@
1
+ <svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M12 6C10.8954 6 10 6.89543 10 8V40C10 41.1046 10.8954 42 12 42H17C18.1046 42 19 41.1046 19 40V8C19 6.89543 18.1046 6 17 6H12ZM31 6C29.8954 6 29 6.89543 29 8V40C29 41.1046 29.8954 42 31 42H36C37.1046 42 38 41.1046 38 40V8C38 6.89543 37.1046 6 36 6H31Z" fill="#222222"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M12 6C10.8954 6 10 6.89543 10 8V40C10 41.1046 10.8954 42 12 42H17C18.1046 42 19 41.1046 19 40V8C19 6.89543 18.1046 6 17 6H12ZM31 6C29.8954 6 29 6.89543 29 8V40C29 41.1046 29.8954 42 31 42H36C37.1046 42 38 41.1046 38 40V8C38 6.89543 37.1046 6 36 6H31Z" fill="#FFFFFF"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M39.6845 22.5846L11.457 6.22056C10.9505 5.92706 10.326 5.92656 9.819 6.21856C9.3125 6.51056 9 7.05156 9 7.63656V40.3641C9 40.9491 9.3125 41.4901 9.8195 41.7821C10.0725 41.9276 10.3545 42.0001 10.6365 42.0001C10.92 42.0001 11.2035 41.9266 11.4575 41.7796L39.685 25.4161C40.189 25.1231 40.5 24.5836 40.5 24.0001C40.5 23.4166 40.189 22.8771 39.6845 22.5846Z" fill="#222222"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M39.6845 22.5846L11.457 6.22056C10.9505 5.92706 10.326 5.92656 9.819 6.21856C9.3125 6.51056 9 7.05156 9 7.63656V40.3641C9 40.9491 9.3125 41.4901 9.8195 41.7821C10.0725 41.9276 10.3545 42.0001 10.6365 42.0001C10.92 42.0001 11.2035 41.9266 11.4575 41.7796L39.685 25.4161C40.189 25.1231 40.5 24.5836 40.5 24.0001C40.5 23.4166 40.189 22.8771 39.6845 22.5846Z" fill="#FFFFFF"/>
3
+ </svg>
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": "7.21.0",
4
+ "version": "7.22.1",
5
5
  "main": "dist/index.js",
6
6
  "license": "ISC",
7
7
  "jest": {