@comicrelief/component-library 8.46.0 → 8.47.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.
- package/dist/components/Atoms/Icons/CtaArrow.js +74 -0
- package/dist/components/Atoms/Icons/index.js +8 -1
- package/dist/components/Atoms/Link/Link.style.js +27 -21
- package/dist/components/Atoms/Link/Link.test.js +24 -1
- package/dist/components/Molecules/CardDs/__snapshots__/CardDs.test.js.snap +48 -2
- package/dist/components/Molecules/HeroBanner/HeroBanner.js +75 -31
- package/dist/components/Molecules/HeroBanner/HeroBanner.md +176 -6
- package/dist/components/Molecules/HeroBanner/HeroBanner.style.js +232 -0
- package/dist/components/Molecules/HeroBanner/HeroBanner.test.js +67 -0
- package/dist/components/Molecules/HeroBanner/__snapshots__/HeroBanner.test.js.snap +882 -0
- package/dist/components/Molecules/HeroBanner/_variants.js +12 -0
- package/dist/components/Molecules/HeroBanner/assets/Pause--black.svg +3 -0
- package/dist/components/Molecules/HeroBanner/assets/Pause--white.svg +3 -0
- package/dist/components/Molecules/HeroBanner/assets/Play--black.svg +3 -0
- package/dist/components/Molecules/HeroBanner/assets/Play--white.svg +3 -0
- package/dist/components/Molecules/HeroBanner/assets/alt_cta_underline.svg +3 -0
- package/dist/components/Molecules/HeroBanner/assets/arrow-right.svg +3 -0
- package/dist/components/Molecules/HeroBanner/assets/loader.svg +1 -0
- package/dist/components/Molecules/HeroBanner/assets/video--play-icon.svg +1 -0
- package/dist/components/Molecules/HeroBanner/assets/video--play-icon__hover.svg +1 -0
- package/dist/components/Molecules/HeroBanner/local-preview-layout-fixes.css +6 -0
- package/dist/components/Molecules/Promo/__snapshots__/Promo.test.js.snap +48 -2
- package/dist/components/Molecules/SingleMessage/__snapshots__/SingleMessage.test.js.snap +64 -2
- package/dist/components/Molecules/SingleMessageDS/__snapshots__/SingleMessageDs.test.js.snap +24 -1
- package/dist/components/Organisms/CookieBanner/CookieBanner.test.js +24 -1
- package/dist/index.js +1 -1
- package/dist/styleguide/assets/PromoLW.jpg +0 -0
- package/dist/styleguide/data/data.js +1 -0
- package/dist/theme/shared/animations.js +23 -2
- package/package.json +1 -1
- package/src/components/Atoms/Icons/CtaArrow.js +55 -0
- package/src/components/Atoms/Icons/index.js +1 -0
- package/src/components/Atoms/Link/Link.js +1 -1
- package/src/components/Atoms/Link/Link.style.js +8 -1
- package/src/components/Atoms/Link/Link.test.js +24 -1
- package/src/components/Molecules/CardDs/__snapshots__/CardDs.test.js.snap +48 -2
- package/src/components/Molecules/HeroBanner/HeroBanner.js +145 -49
- package/src/components/Molecules/HeroBanner/HeroBanner.md +176 -6
- package/src/components/Molecules/HeroBanner/HeroBanner.style.js +239 -0
- package/src/components/Molecules/HeroBanner/HeroBanner.test.js +89 -0
- package/src/components/Molecules/HeroBanner/__snapshots__/HeroBanner.test.js.snap +882 -0
- package/src/components/Molecules/HeroBanner/_variants.js +7 -0
- package/src/components/Molecules/HeroBanner/assets/Pause--black.svg +3 -0
- package/src/components/Molecules/HeroBanner/assets/Pause--white.svg +3 -0
- package/src/components/Molecules/HeroBanner/assets/Play--black.svg +3 -0
- package/src/components/Molecules/HeroBanner/assets/Play--white.svg +3 -0
- package/src/components/Molecules/HeroBanner/assets/alt_cta_underline.svg +3 -0
- package/src/components/Molecules/HeroBanner/assets/arrow-right.svg +3 -0
- package/src/components/Molecules/HeroBanner/assets/loader.svg +1 -0
- package/src/components/Molecules/HeroBanner/assets/video--play-icon.svg +1 -0
- package/src/components/Molecules/HeroBanner/assets/video--play-icon__hover.svg +1 -0
- package/src/components/Molecules/HeroBanner/local-preview-layout-fixes.css +6 -0
- package/src/components/Molecules/Promo/__snapshots__/Promo.test.js.snap +48 -2
- package/src/components/Molecules/SingleMessage/__snapshots__/SingleMessage.test.js.snap +64 -2
- package/src/components/Molecules/SingleMessageDS/__snapshots__/SingleMessageDs.test.js.snap +24 -1
- package/src/components/Organisms/CookieBanner/CookieBanner.test.js +24 -1
- package/src/index.js +1 -1
- package/src/styleguide/assets/PromoLW.jpg +0 -0
- package/src/styleguide/data/data.js +1 -0
- package/src/theme/shared/animations.js +29 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
|
+
const angle = {
|
|
12
|
+
right: '0',
|
|
13
|
+
left: '180deg',
|
|
14
|
+
down: '90deg',
|
|
15
|
+
up: '-90deg'
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// The size the icon was rendered at, defining the path coordinates:
|
|
19
|
+
const defaultSize = 32;
|
|
20
|
+
const Icon = _styledComponents.default.svg.withConfig({
|
|
21
|
+
displayName: "CtaArrow__Icon",
|
|
22
|
+
componentId: "sc-4pwuvp-0"
|
|
23
|
+
})(["transform:", ";rect{fill:", ";}path{fill:", ";stroke:", ";transform:scale(", ");}"], _ref => {
|
|
24
|
+
let {
|
|
25
|
+
direction
|
|
26
|
+
} = _ref;
|
|
27
|
+
return `rotate(${angle[direction]})`;
|
|
28
|
+
}, _ref2 => {
|
|
29
|
+
let {
|
|
30
|
+
theme,
|
|
31
|
+
colour
|
|
32
|
+
} = _ref2;
|
|
33
|
+
return theme.color(colour);
|
|
34
|
+
}, _ref3 => {
|
|
35
|
+
let {
|
|
36
|
+
theme
|
|
37
|
+
} = _ref3;
|
|
38
|
+
return theme.color('white');
|
|
39
|
+
}, _ref4 => {
|
|
40
|
+
let {
|
|
41
|
+
theme
|
|
42
|
+
} = _ref4;
|
|
43
|
+
return theme.color('white');
|
|
44
|
+
}, _ref5 => {
|
|
45
|
+
let {
|
|
46
|
+
width
|
|
47
|
+
} = _ref5;
|
|
48
|
+
return width / defaultSize;
|
|
49
|
+
});
|
|
50
|
+
const CtaArrow = _ref6 => {
|
|
51
|
+
let {
|
|
52
|
+
colour = 'red',
|
|
53
|
+
theme,
|
|
54
|
+
size = defaultSize,
|
|
55
|
+
direction = 'right',
|
|
56
|
+
...rest
|
|
57
|
+
} = _ref6;
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement(Icon, Object.assign({
|
|
59
|
+
width: size,
|
|
60
|
+
height: size,
|
|
61
|
+
viewBox: `0 0 ${size} ${size}`,
|
|
62
|
+
direction: direction,
|
|
63
|
+
colour: colour,
|
|
64
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
65
|
+
defaultSize: defaultSize
|
|
66
|
+
}, rest), /*#__PURE__*/_react.default.createElement("rect", {
|
|
67
|
+
width: size,
|
|
68
|
+
height: size,
|
|
69
|
+
rx: size / 2
|
|
70
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
71
|
+
d: "M22.8208 16.4626C22.8183 16.4653 22.8167 16.4686 22.814 16.4713L17.7229 21.8047C17.5987 21.9348 17.4359 22 17.273 22C17.1101 22 16.9473 21.9348 16.8229 21.8048C16.5744 21.5445 16.5744 21.1223 16.8229 20.862L20.8277 16.6666H9.63638C9.28494 16.6666 9 16.3681 9 16C9 15.6318 9.28494 15.3333 9.63638 15.3333H20.8277L16.8229 11.1381C16.5744 10.8778 16.5744 10.4556 16.8229 10.1953C17.0714 9.93492 17.4744 9.93492 17.7229 10.1953L22.814 15.5286C22.8165 15.5313 22.8183 15.5346 22.8208 15.5373C22.8474 15.566 22.8719 15.5968 22.8932 15.6301C22.9042 15.6475 22.912 15.6661 22.9212 15.6843C22.9315 15.7045 22.9432 15.7236 22.9516 15.745C22.9607 15.7678 22.9659 15.7915 22.9723 15.815C22.9774 15.8331 22.9841 15.8506 22.9877 15.8695C23.0041 15.9558 23.0041 16.0446 22.9877 16.1308C22.9841 16.1496 22.9774 16.167 22.9723 16.1853C22.9658 16.2088 22.9605 16.2325 22.9516 16.2553C22.9432 16.2766 22.9315 16.2958 22.9212 16.316C22.9118 16.3341 22.9042 16.3528 22.8932 16.3701C22.8719 16.4033 22.8474 16.434 22.8208 16.4626Z"
|
|
72
|
+
}));
|
|
73
|
+
};
|
|
74
|
+
var _default = exports.default = (0, _styledComponents.withTheme)(CtaArrow);
|
|
@@ -22,6 +22,12 @@ Object.defineProperty(exports, "Chevron", {
|
|
|
22
22
|
return _Chevron.default;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
|
+
Object.defineProperty(exports, "CtaArrow", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _CtaArrow.default;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
25
31
|
Object.defineProperty(exports, "Download", {
|
|
26
32
|
enumerable: true,
|
|
27
33
|
get: function () {
|
|
@@ -52,4 +58,5 @@ var _Favourite = _interopRequireDefault(require("./Favourite"));
|
|
|
52
58
|
var _Internal = _interopRequireDefault(require("./Internal"));
|
|
53
59
|
var _Chevron = _interopRequireDefault(require("./Chevron"));
|
|
54
60
|
var _Arrow = _interopRequireDefault(require("./Arrow"));
|
|
55
|
-
var _AtSign = _interopRequireDefault(require("./AtSign"));
|
|
61
|
+
var _AtSign = _interopRequireDefault(require("./AtSign"));
|
|
62
|
+
var _CtaArrow = _interopRequireDefault(require("./CtaArrow"));
|
|
@@ -9,78 +9,84 @@ exports.default = exports.IconWrapper = exports.HelperText = void 0;
|
|
|
9
9
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
10
10
|
var _spacing = _interopRequireDefault(require("../../../theme/shared/spacing"));
|
|
11
11
|
var _hideVisually = _interopRequireDefault(require("../../../theme/shared/hideVisually"));
|
|
12
|
-
|
|
12
|
+
var _fontHelper = _interopRequireDefault(require("../../../theme/crTheme/fontHelper"));
|
|
13
|
+
const buttonStyle = () => (0, _styledComponents.css)(["display:inline-flex;position:relative;padding:0.5rem 1.25rem;text-decoration:none;font-size:", ";border-radius:2rem;transition:all 0.3s;height:3.125rem;width:100%;justify-content:center;align-items:center;cursor:pointer;", " font-weight:700;", ";", ";@media ", "{width:", ";}@media ", "{", ";}"], _ref => {
|
|
13
14
|
let {
|
|
14
15
|
theme
|
|
15
16
|
} = _ref;
|
|
16
17
|
return theme.fontSize('s');
|
|
17
18
|
}, _ref2 => {
|
|
18
19
|
let {
|
|
19
|
-
color,
|
|
20
20
|
theme
|
|
21
21
|
} = _ref2;
|
|
22
|
-
return
|
|
22
|
+
return (0, _styledComponents.css)(["", ""], (0, _fontHelper.default)(theme, 'button'));
|
|
23
23
|
}, _ref3 => {
|
|
24
24
|
let {
|
|
25
|
-
|
|
25
|
+
color,
|
|
26
26
|
theme
|
|
27
27
|
} = _ref3;
|
|
28
|
-
return
|
|
28
|
+
return color ? theme.buttonColors(color) : theme.buttonColors('red');
|
|
29
29
|
}, _ref4 => {
|
|
30
30
|
let {
|
|
31
|
+
mobileColour,
|
|
31
32
|
theme
|
|
32
33
|
} = _ref4;
|
|
33
|
-
return theme.
|
|
34
|
+
return mobileColour ? theme.buttonColors(mobileColour) : null;
|
|
34
35
|
}, _ref5 => {
|
|
35
36
|
let {
|
|
36
|
-
|
|
37
|
+
theme
|
|
37
38
|
} = _ref5;
|
|
38
|
-
return
|
|
39
|
+
return theme.allBreakpoints('M');
|
|
39
40
|
}, _ref6 => {
|
|
40
41
|
let {
|
|
41
|
-
|
|
42
|
+
fullWidth
|
|
42
43
|
} = _ref6;
|
|
43
|
-
return
|
|
44
|
+
return fullWidth ? '100%' : 'auto';
|
|
44
45
|
}, _ref7 => {
|
|
45
46
|
let {
|
|
46
|
-
color,
|
|
47
47
|
theme
|
|
48
48
|
} = _ref7;
|
|
49
|
+
return theme.allBreakpoints('L');
|
|
50
|
+
}, _ref8 => {
|
|
51
|
+
let {
|
|
52
|
+
color,
|
|
53
|
+
theme
|
|
54
|
+
} = _ref8;
|
|
49
55
|
return color ? theme.buttonColors(color) : theme.buttonColors('red');
|
|
50
56
|
});
|
|
51
|
-
const linkStyle = () => (0, _styledComponents.css)(["position:relative;display:inline;", ";"],
|
|
57
|
+
const linkStyle = () => (0, _styledComponents.css)(["position:relative;display:inline;", ";"], _ref9 => {
|
|
52
58
|
let {
|
|
53
59
|
type,
|
|
54
60
|
theme
|
|
55
|
-
} =
|
|
61
|
+
} = _ref9;
|
|
56
62
|
return type ? theme.linkStyles(type) : theme.linkStyles('standard');
|
|
57
63
|
});
|
|
58
64
|
const IconWrapper = exports.IconWrapper = _styledComponents.default.span.withConfig({
|
|
59
65
|
displayName: "Linkstyle__IconWrapper",
|
|
60
66
|
componentId: "sc-t360tr-0"
|
|
61
|
-
})(["display:inline-flex;margin-left:", ";align-self:center;right:", ";", ";@media ", "{width:auto;right:auto;position:relative;", ";}"], (0, _spacing.default)('md'), (0, _spacing.default)('m'),
|
|
67
|
+
})(["display:inline-flex;margin-left:", ";align-self:center;right:", ";", ";@media ", "{width:auto;right:auto;position:relative;", ";}"], (0, _spacing.default)('md'), (0, _spacing.default)('m'), _ref10 => {
|
|
62
68
|
let {
|
|
63
69
|
type
|
|
64
|
-
} =
|
|
70
|
+
} = _ref10;
|
|
65
71
|
return type === 'standard' && (0, _styledComponents.css)(["position:absolute;right:-2rem;top:0;bottom:0;"]);
|
|
66
|
-
},
|
|
72
|
+
}, _ref11 => {
|
|
67
73
|
let {
|
|
68
74
|
theme
|
|
69
|
-
} =
|
|
75
|
+
} = _ref11;
|
|
70
76
|
return theme.allBreakpoints('M');
|
|
71
|
-
},
|
|
77
|
+
}, _ref12 => {
|
|
72
78
|
let {
|
|
73
79
|
type
|
|
74
|
-
} =
|
|
80
|
+
} = _ref12;
|
|
75
81
|
return type === 'standard' && (0, _styledComponents.css)(["position:absolute;right:-2rem;top:0;bottom:0;"]);
|
|
76
82
|
});
|
|
77
83
|
const StyledLink = _styledComponents.default.a.withConfig({
|
|
78
84
|
displayName: "Linkstyle__StyledLink",
|
|
79
85
|
componentId: "sc-t360tr-1"
|
|
80
|
-
})(["", " ", ";"], props => props.type === 'button' ? buttonStyle : linkStyle,
|
|
86
|
+
})(["", " ", ";"], props => props.type === 'button' ? buttonStyle : linkStyle, _ref13 => {
|
|
81
87
|
let {
|
|
82
88
|
iconFirst
|
|
83
|
-
} =
|
|
89
|
+
} = _ref13;
|
|
84
90
|
return iconFirst && (0, _styledComponents.css)(["flex-direction:row-reverse;span[type=\"button\"]{margin-left:0;margin-right:1rem;}"]);
|
|
85
91
|
});
|
|
86
92
|
const HelperText = exports.HelperText = _styledComponents.default.span.withConfig({
|
|
@@ -195,7 +195,6 @@ it('renders link styled as button correctly', () => {
|
|
|
195
195
|
padding: 0.5rem 1.25rem;
|
|
196
196
|
-webkit-text-decoration: none;
|
|
197
197
|
text-decoration: none;
|
|
198
|
-
font-weight: 700;
|
|
199
198
|
font-size: 1rem;
|
|
200
199
|
border-radius: 2rem;
|
|
201
200
|
-webkit-transition: all 0.3s;
|
|
@@ -211,6 +210,16 @@ it('renders link styled as button correctly', () => {
|
|
|
211
210
|
-ms-flex-align: center;
|
|
212
211
|
align-items: center;
|
|
213
212
|
cursor: pointer;
|
|
213
|
+
font-family: 'Montserrat',Helvetica,Arial,sans-serif;
|
|
214
|
+
font-weight: 400;
|
|
215
|
+
text-transform: inherit;
|
|
216
|
+
-webkit-letter-spacing: 0;
|
|
217
|
+
-moz-letter-spacing: 0;
|
|
218
|
+
-ms-letter-spacing: 0;
|
|
219
|
+
letter-spacing: 0;
|
|
220
|
+
font-size: 1rem;
|
|
221
|
+
line-height: 1.25rem;
|
|
222
|
+
font-weight: 700;
|
|
214
223
|
background-color: #FFE400;
|
|
215
224
|
color: #000000;
|
|
216
225
|
}
|
|
@@ -220,6 +229,20 @@ it('renders link styled as button correctly', () => {
|
|
|
220
229
|
color: #000000;
|
|
221
230
|
}
|
|
222
231
|
|
|
232
|
+
@media (min-width:740px) {
|
|
233
|
+
.c0 {
|
|
234
|
+
font-size: 1rem;
|
|
235
|
+
line-height: 1.25rem;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
@media (min-width:1024px) {
|
|
240
|
+
.c0 {
|
|
241
|
+
font-size: 1.125rem;
|
|
242
|
+
line-height: 1.375rem;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
223
246
|
@media (min-width:740px) {
|
|
224
247
|
.c0 {
|
|
225
248
|
width: auto;
|
|
@@ -36,7 +36,6 @@ exports[`renders Column view correctly 1`] = `
|
|
|
36
36
|
padding: 0.5rem 1.25rem;
|
|
37
37
|
-webkit-text-decoration: none;
|
|
38
38
|
text-decoration: none;
|
|
39
|
-
font-weight: 700;
|
|
40
39
|
font-size: 1rem;
|
|
41
40
|
border-radius: 2rem;
|
|
42
41
|
-webkit-transition: all 0.3s;
|
|
@@ -52,6 +51,16 @@ exports[`renders Column view correctly 1`] = `
|
|
|
52
51
|
-ms-flex-align: center;
|
|
53
52
|
align-items: center;
|
|
54
53
|
cursor: pointer;
|
|
54
|
+
font-family: 'Montserrat',Helvetica,Arial,sans-serif;
|
|
55
|
+
font-weight: 400;
|
|
56
|
+
text-transform: inherit;
|
|
57
|
+
-webkit-letter-spacing: 0;
|
|
58
|
+
-moz-letter-spacing: 0;
|
|
59
|
+
-ms-letter-spacing: 0;
|
|
60
|
+
letter-spacing: 0;
|
|
61
|
+
font-size: 1rem;
|
|
62
|
+
line-height: 1.25rem;
|
|
63
|
+
font-weight: 700;
|
|
55
64
|
background-color: #E52630;
|
|
56
65
|
color: #FFFFFF;
|
|
57
66
|
}
|
|
@@ -127,6 +136,20 @@ exports[`renders Column view correctly 1`] = `
|
|
|
127
136
|
}
|
|
128
137
|
}
|
|
129
138
|
|
|
139
|
+
@media (min-width:740px) {
|
|
140
|
+
.c7 {
|
|
141
|
+
font-size: 1rem;
|
|
142
|
+
line-height: 1.25rem;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@media (min-width:1024px) {
|
|
147
|
+
.c7 {
|
|
148
|
+
font-size: 1.125rem;
|
|
149
|
+
line-height: 1.375rem;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
130
153
|
@media (min-width:740px) {
|
|
131
154
|
.c7 {
|
|
132
155
|
width: auto;
|
|
@@ -294,7 +317,6 @@ exports[`renders correctly 1`] = `
|
|
|
294
317
|
padding: 0.5rem 1.25rem;
|
|
295
318
|
-webkit-text-decoration: none;
|
|
296
319
|
text-decoration: none;
|
|
297
|
-
font-weight: 700;
|
|
298
320
|
font-size: 1rem;
|
|
299
321
|
border-radius: 2rem;
|
|
300
322
|
-webkit-transition: all 0.3s;
|
|
@@ -310,6 +332,16 @@ exports[`renders correctly 1`] = `
|
|
|
310
332
|
-ms-flex-align: center;
|
|
311
333
|
align-items: center;
|
|
312
334
|
cursor: pointer;
|
|
335
|
+
font-family: 'Montserrat',Helvetica,Arial,sans-serif;
|
|
336
|
+
font-weight: 400;
|
|
337
|
+
text-transform: inherit;
|
|
338
|
+
-webkit-letter-spacing: 0;
|
|
339
|
+
-moz-letter-spacing: 0;
|
|
340
|
+
-ms-letter-spacing: 0;
|
|
341
|
+
letter-spacing: 0;
|
|
342
|
+
font-size: 1rem;
|
|
343
|
+
line-height: 1.25rem;
|
|
344
|
+
font-weight: 700;
|
|
313
345
|
background-color: #E52630;
|
|
314
346
|
color: #FFFFFF;
|
|
315
347
|
}
|
|
@@ -385,6 +417,20 @@ exports[`renders correctly 1`] = `
|
|
|
385
417
|
}
|
|
386
418
|
}
|
|
387
419
|
|
|
420
|
+
@media (min-width:740px) {
|
|
421
|
+
.c7 {
|
|
422
|
+
font-size: 1rem;
|
|
423
|
+
line-height: 1.25rem;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
@media (min-width:1024px) {
|
|
428
|
+
.c7 {
|
|
429
|
+
font-size: 1.125rem;
|
|
430
|
+
line-height: 1.375rem;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
388
434
|
@media (min-width:740px) {
|
|
389
435
|
.c7 {
|
|
390
436
|
width: auto;
|
|
@@ -6,40 +6,84 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var
|
|
9
|
+
var _Picture = _interopRequireDefault(require("../../Atoms/Picture/Picture"));
|
|
10
10
|
var _Text = _interopRequireDefault(require("../../Atoms/Text/Text"));
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
})).withConfig({
|
|
18
|
-
displayName: "HeroBanner__Image",
|
|
19
|
-
componentId: "sc-c6z1hi-1"
|
|
20
|
-
})(["object-fit:cover;width:100%;display:block;height:100%;opacity:0.5;"]);
|
|
21
|
-
const Title = _styledComponents.default.h1.withConfig({
|
|
22
|
-
displayName: "HeroBanner__Title",
|
|
23
|
-
componentId: "sc-c6z1hi-2"
|
|
24
|
-
})(["position:absolute;margin:0 auto;top:50%;transform:translateY(-50%);left:0;right:0;text-align:center;"]);
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Hero Banner to be used as Header of landing pages.
|
|
28
|
-
*/
|
|
29
|
-
|
|
11
|
+
var _Link = _interopRequireDefault(require("../../Atoms/Link/Link"));
|
|
12
|
+
var _variants = _interopRequireDefault(require("./_variants"));
|
|
13
|
+
var _index = require("../../Atoms/Icons/index");
|
|
14
|
+
var _alt_cta_underline = _interopRequireDefault(require("./assets/alt_cta_underline.svg"));
|
|
15
|
+
require("./local-preview-layout-fixes.css");
|
|
16
|
+
var _HeroBanner = require("./HeroBanner.style");
|
|
30
17
|
const HeroBanner = _ref => {
|
|
31
18
|
let {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
19
|
+
// All variants:
|
|
20
|
+
copyColour = 'black',
|
|
21
|
+
pageBackgroundColour = 'grey_light',
|
|
22
|
+
variant = _variants.default.FULL_HEIGHT,
|
|
23
|
+
copyLeft = true,
|
|
24
|
+
imageAltText = '',
|
|
25
|
+
ctaNewTab = false,
|
|
26
|
+
paddingTop = '0rem',
|
|
27
|
+
paddingBottom = '2rem',
|
|
28
|
+
// Text Banner variant
|
|
29
|
+
textBannerCopyBackgroundColour = 'deep_violet',
|
|
30
|
+
textBannerCtaColour = 'white',
|
|
31
|
+
// 'Media' variants (fallbacks to be provided in the CRcom integration, just in case):
|
|
32
|
+
imageSet = null,
|
|
33
|
+
imageLow = null,
|
|
34
|
+
image = null,
|
|
35
|
+
// All variants:
|
|
36
|
+
children = null,
|
|
37
|
+
ctaUrl = null,
|
|
38
|
+
ctaText = null
|
|
35
39
|
} = _ref;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
const hasImage = Boolean(imageSet && variant !== _variants.default.TEXT_BANNER);
|
|
41
|
+
const hasCTA = Boolean(ctaUrl) && Boolean(ctaText);
|
|
42
|
+
const copySection = /*#__PURE__*/_react.default.createElement(_HeroBanner.Copy, {
|
|
43
|
+
variant: variant,
|
|
44
|
+
copyColour: copyColour,
|
|
45
|
+
textBannerCopyBackgroundColour: textBannerCopyBackgroundColour
|
|
46
|
+
}, children, hasCTA && /*#__PURE__*/_react.default.createElement(_HeroBanner.CTAWrapper, {
|
|
47
|
+
variant: variant
|
|
48
|
+
}, variant !== _variants.default.TEXT_BANNER ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_HeroBanner.CtaText, {
|
|
49
|
+
className: "cta"
|
|
50
|
+
}, ctaText, /*#__PURE__*/_react.default.createElement(_HeroBanner.CtaTextUnderline, {
|
|
51
|
+
src: _alt_cta_underline.default,
|
|
52
|
+
alt: ctaText,
|
|
53
|
+
className: "cta-text-underline"
|
|
54
|
+
})), /*#__PURE__*/_react.default.createElement(_HeroBanner.CtaIconWrapper, null, /*#__PURE__*/_react.default.createElement(_index.CtaArrow, null))) : /*#__PURE__*/_react.default.createElement(_Text.default, null, /*#__PURE__*/_react.default.createElement(_Link.default, {
|
|
55
|
+
href: ctaUrl,
|
|
56
|
+
type: "button",
|
|
57
|
+
color: textBannerCtaColour,
|
|
58
|
+
target: ctaNewTab ? 'blank' : 'self'
|
|
59
|
+
}, ctaText))));
|
|
60
|
+
return /*#__PURE__*/_react.default.createElement(_HeroBanner.Container, {
|
|
61
|
+
pageBackgroundColour: pageBackgroundColour,
|
|
62
|
+
paddingTop: paddingTop,
|
|
63
|
+
paddingBottom: paddingBottom
|
|
64
|
+
}, /*#__PURE__*/_react.default.createElement(_HeroBanner.OuterWrapper, {
|
|
65
|
+
variant: variant,
|
|
66
|
+
textBannerCopyBackgroundColour: textBannerCopyBackgroundColour
|
|
67
|
+
}, hasImage && /*#__PURE__*/_react.default.createElement(_HeroBanner.MediaWrapper, {
|
|
68
|
+
imageRight: copyLeft,
|
|
69
|
+
variant: variant
|
|
70
|
+
}, /*#__PURE__*/_react.default.createElement(_Picture.default, {
|
|
71
|
+
alt: imageAltText,
|
|
72
|
+
imageLow: imageLow,
|
|
73
|
+
images: imageSet,
|
|
74
|
+
image: image,
|
|
75
|
+
objectFit: "cover",
|
|
76
|
+
width: "100%",
|
|
77
|
+
height: "100%"
|
|
78
|
+
})), /*#__PURE__*/_react.default.createElement(_HeroBanner.CopyOuterWrapper, {
|
|
79
|
+
copyLeft: copyLeft,
|
|
80
|
+
variant: variant
|
|
81
|
+
}, /*#__PURE__*/_react.default.createElement(_HeroBanner.CopyInnerWrapper, {
|
|
82
|
+
copyLeft: copyLeft,
|
|
83
|
+
variant: variant
|
|
84
|
+
}, hasCTA && variant !== _variants.default.TEXT_BANNER ? /*#__PURE__*/_react.default.createElement(_HeroBanner.HeroBannerLink, {
|
|
85
|
+
href: ctaUrl,
|
|
86
|
+
target: ctaNewTab ? '_blank' : '_self'
|
|
87
|
+
}, copySection) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, copySection)))));
|
|
44
88
|
};
|
|
45
89
|
var _default = exports.default = HeroBanner;
|
|
@@ -1,9 +1,179 @@
|
|
|
1
|
-
|
|
1
|
+
HeroBanner
|
|
2
2
|
|
|
3
3
|
```js
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
const defaultData = require('../../../styleguide/data/data').defaultData;
|
|
5
|
+
import Text from '../../Atoms/Text/Text';
|
|
6
|
+
import Link from '../../Atoms/Link/Link';
|
|
7
|
+
import variants from './_variants';
|
|
8
|
+
|
|
9
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '4rem' }}>
|
|
10
|
+
|
|
11
|
+
<HeroBanner
|
|
12
|
+
pageBackgroundColour="teal_light"
|
|
13
|
+
imageSet={defaultData.heroBannerImage}
|
|
14
|
+
image={defaultData.heroBannerImage}
|
|
15
|
+
imageLow={defaultData.heroBannerImage}
|
|
16
|
+
imageAltText="Image alt text"
|
|
17
|
+
variant={variants.FULL_HEIGHT}
|
|
18
|
+
copyLeft
|
|
19
|
+
>
|
|
20
|
+
<Text tag="h1">
|
|
21
|
+
Full Height: Copy Left
|
|
22
|
+
</Text>
|
|
23
|
+
<Text tag="p">
|
|
24
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
25
|
+
</Text>
|
|
26
|
+
</HeroBanner>
|
|
27
|
+
|
|
28
|
+
<HeroBanner
|
|
29
|
+
pageBackgroundColour="teal_light"
|
|
30
|
+
imageSet={defaultData.heroBannerImage}
|
|
31
|
+
image={defaultData.heroBannerImage}
|
|
32
|
+
imageLow={defaultData.heroBannerImage}
|
|
33
|
+
imageAltText="Image alt text"
|
|
34
|
+
variant={variants.FULL_HEIGHT}
|
|
35
|
+
copyLeft={false}
|
|
36
|
+
ctaText="Register to fundraise"
|
|
37
|
+
ctaUrl="http://www.comicrelief.com/register"
|
|
38
|
+
paddingTop="2rem"
|
|
39
|
+
>
|
|
40
|
+
<Text tag="h1">
|
|
41
|
+
Full Height: Additional Top Padding, Copy Right w/CTA, Same Tab
|
|
42
|
+
</Text>
|
|
43
|
+
<Text tag="p">
|
|
44
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
45
|
+
</Text>
|
|
46
|
+
</HeroBanner>
|
|
47
|
+
|
|
48
|
+
<HeroBanner
|
|
49
|
+
pageBackgroundColour="teal_light"
|
|
50
|
+
imageSet={defaultData.heroBannerImage}
|
|
51
|
+
image={defaultData.heroBannerImage}
|
|
52
|
+
imageLow={defaultData.heroBannerImage}
|
|
53
|
+
imageAltText="Image alt text"
|
|
54
|
+
variant={variants.FULL_HEIGHT}
|
|
55
|
+
ctaText="Register to fundraise but longer"
|
|
56
|
+
ctaUrl="http://www.comicrelief.com/register"
|
|
57
|
+
ctaNewTab
|
|
58
|
+
copyLeft
|
|
59
|
+
>
|
|
60
|
+
<Text tag="h1">
|
|
61
|
+
Full Height: Copy Left w/CTA, New Tab
|
|
62
|
+
</Text>
|
|
63
|
+
<Text tag="p">
|
|
64
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
65
|
+
</Text>
|
|
66
|
+
</HeroBanner>
|
|
67
|
+
|
|
68
|
+
<HeroBanner
|
|
69
|
+
pageBackgroundColour="blue_dark"
|
|
70
|
+
imageSet={defaultData.heroBannerImage}
|
|
71
|
+
image={defaultData.heroBannerImage}
|
|
72
|
+
imageLow={defaultData.heroBannerImage}
|
|
73
|
+
imageAltText="Image alt text"
|
|
74
|
+
copyLeft={false}
|
|
75
|
+
>
|
|
76
|
+
<Text tag="h1">
|
|
77
|
+
Full Height: Copy Right (default variant prop value)
|
|
78
|
+
</Text>
|
|
79
|
+
<Text tag="p">
|
|
80
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
81
|
+
</Text>
|
|
82
|
+
</HeroBanner>
|
|
83
|
+
|
|
84
|
+
<HeroBanner
|
|
85
|
+
pageBackgroundColour="orange"
|
|
86
|
+
imageSet={defaultData.heroBannerImage}
|
|
87
|
+
image={defaultData.heroBannerImage}
|
|
88
|
+
imageLow={defaultData.heroBannerImage}
|
|
89
|
+
imageAltText="Image alt text"
|
|
90
|
+
variant={variants.HALF_HEIGHT}
|
|
91
|
+
>
|
|
92
|
+
<Text tag="h1">
|
|
93
|
+
Half Height: min height
|
|
94
|
+
</Text>
|
|
95
|
+
<Text tag="p">
|
|
96
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
|
|
97
|
+
</Text>
|
|
98
|
+
</HeroBanner>
|
|
99
|
+
|
|
100
|
+
<HeroBanner
|
|
101
|
+
pageBackgroundColour="teal"
|
|
102
|
+
imageSet={defaultData.heroBannerImage}
|
|
103
|
+
image={defaultData.heroBannerImage}
|
|
104
|
+
imageLow={defaultData.heroBannerImage}
|
|
105
|
+
imageAltText="Image alt text"
|
|
106
|
+
variant={variants.HALF_HEIGHT}
|
|
107
|
+
paddingBottom="0"
|
|
108
|
+
copyLeft={false}
|
|
109
|
+
>
|
|
110
|
+
<Text tag="h1">
|
|
111
|
+
Half Height: adapting to content, no bottom paddding
|
|
112
|
+
</Text>
|
|
113
|
+
<Text tag="p">
|
|
114
|
+
Lorem ipsum dolor sit amet consectetur adipiscing elit. Quisque faucibus ex sapien vitae pellentesque sem placerat. In id cursus mi pretium tellus duis convallis. Tempus leo eu aenean sed diam urna tempor. Pulvinar vivamus fringilla lacus nec metus bibendum egestas. Iaculis massa nisl malesuada lacinia integer nunc posuere. Ut hendrerit semper vel class aptent taciti sociosqu. Ad litora torquent per conubia nostra inceptos himenaeos.
|
|
115
|
+
</Text>
|
|
116
|
+
|
|
117
|
+
<Text tag="p">
|
|
118
|
+
Lorem ipsum dolor sit amet consectetur adipiscing elit. Quisque faucibus ex sapien vitae pellentesque sem placerat. In id cursus mi pretium tellus duis convallis. Tempus leo eu aenean sed diam urna tempor. Pulvinar vivamus fringilla lacus nec metus bibendum egestas. Iaculis massa nisl malesuada lacinia integer nunc posuere. Ut hendrerit semper vel class aptent taciti sociosqu. Ad litora torquent per conubia nostra inceptos himenaeos.
|
|
119
|
+
</Text>
|
|
120
|
+
</HeroBanner>
|
|
121
|
+
|
|
122
|
+
<HeroBanner
|
|
123
|
+
pageBackgroundColour="grey_light"
|
|
124
|
+
textBannerCopyBackgroundColour="deep_violet"
|
|
125
|
+
variant={variants.TEXT_BANNER}
|
|
126
|
+
copyColour="white"
|
|
127
|
+
>
|
|
128
|
+
<Text tag="h1">
|
|
129
|
+
Responsive Text Banner
|
|
130
|
+
</Text>
|
|
131
|
+
<Text tag="p">
|
|
132
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
|
|
133
|
+
</Text>
|
|
134
|
+
</HeroBanner>
|
|
135
|
+
|
|
136
|
+
<HeroBanner
|
|
137
|
+
pageBackgroundColour="grey_light"
|
|
138
|
+
textBannerCopyBackgroundColour="deep_violet"
|
|
139
|
+
variant={variants.TEXT_BANNER}
|
|
140
|
+
ctaUrl="http://www.comicrelief.com/register"
|
|
141
|
+
ctaText="Register"
|
|
142
|
+
copyColour="white"
|
|
143
|
+
paddingBottom="0"
|
|
144
|
+
ctaNewTab
|
|
145
|
+
>
|
|
146
|
+
<Text tag="h1">
|
|
147
|
+
Responsive Text Banner w/CTA, New Tab, no top and bottom padding
|
|
148
|
+
</Text>
|
|
149
|
+
<Text tag="p">
|
|
150
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
|
|
151
|
+
</Text>
|
|
152
|
+
</HeroBanner>
|
|
153
|
+
|
|
154
|
+
<HeroBanner
|
|
155
|
+
pageBackgroundColour="grey_light"
|
|
156
|
+
textBannerCopyBackgroundColour="blue_light"
|
|
157
|
+
variant={variants.TEXT_BANNER}
|
|
158
|
+
textBannerCtaColour="red"
|
|
159
|
+
ctaText="Register"
|
|
160
|
+
ctaUrl="http://www.comicrelief.com/register"
|
|
161
|
+
>
|
|
162
|
+
<Text tag="h1">
|
|
163
|
+
Responsive Text w/CTA, Same Tab
|
|
164
|
+
</Text>
|
|
165
|
+
<Text tag="p">
|
|
166
|
+
Lorem ipsum dolor sit amet consectetur adipiscing elit. Quisque faucibus ex sapien vitae pellentesque sem placerat. In id cursus mi pretium tellus duis convallis. Tempus leo eu aenean sed diam urna tempor. Pulvinar vivamus fringilla lacus nec metus bibendum egestas. Iaculis massa nisl malesuada lacinia integer nunc posuere. Ut hendrerit semper vel class aptent taciti sociosqu. Ad litora torquent per conubia nostra inceptos himenaeos.
|
|
167
|
+
</Text>
|
|
168
|
+
|
|
169
|
+
<Text tag="p">
|
|
170
|
+
Lorem ipsum dolor sit amet consectetur adipiscing elit. Quisque faucibus ex sapien vitae pellentesque sem placerat. In id cursus mi pretium tellus duis convallis. Tempus leo eu aenean sed diam urna tempor. Pulvinar vivamus fringilla lacus nec metus bibendum egestas. Iaculis massa nisl malesuada lacinia integer nunc posuere. Ut hendrerit semper vel class aptent taciti sociosqu. Ad litora torquent per conubia nostra inceptos himenaeos.
|
|
171
|
+
</Text>
|
|
172
|
+
|
|
173
|
+
<Text tag="p">
|
|
174
|
+
Lorem ipsum dolor sit amet consectetur adipiscing elit. Quisque faucibus ex sapien vitae pellentesque sem placerat. In id cursus mi pretium tellus duis convallis. Tempus leo eu aenean sed diam urna tempor. Pulvinar vivamus fringilla lacus nec metus bibendum egestas. Iaculis massa nisl malesuada lacinia integer nunc posuere. Ut hendrerit semper vel class aptent taciti sociosqu. Ad litora torquent per conubia nostra inceptos himenaeos.
|
|
175
|
+
</Text>
|
|
176
|
+
</HeroBanner>
|
|
177
|
+
|
|
178
|
+
</div>
|
|
9
179
|
```
|