@comicrelief/component-library 8.55.0 → 8.55.2
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/Molecules/HeroBanner/HeroBanner.style.js +68 -62
- package/dist/components/Molecules/HeroBanner/__snapshots__/HeroBanner.test.js.snap +7 -4
- package/dist/components/Organisms/DonateBanner/DonateBanner.js +12 -10
- package/dist/components/Organisms/DonateBanner/DonateBanner.md +24 -2
- package/dist/components/Organisms/DonateBanner/DonateBanner.style.js +34 -39
- package/dist/components/Organisms/DonateBanner/Form/Form.js +21 -26
- package/dist/components/Organisms/DonateBanner/GivingSelector/GivingSelector.js +1 -3
- package/dist/components/Organisms/DonateBanner/GivingSelector/GivingSelector.style.js +43 -7
- package/dist/components/Organisms/DonateBanner/MoneyBuy/MoneyBuy.js +20 -10
- package/dist/components/Organisms/DonateBanner/__snapshots__/DonateBanner.test.js.snap +355 -316
- package/dist/theme/shared/animations.js +9 -0
- package/package.json +1 -1
- package/src/components/Molecules/HeroBanner/HeroBanner.style.js +4 -3
- package/src/components/Molecules/HeroBanner/__snapshots__/HeroBanner.test.js.snap +7 -4
- package/src/components/Organisms/DonateBanner/DonateBanner.js +15 -11
- package/src/components/Organisms/DonateBanner/DonateBanner.md +24 -2
- package/src/components/Organisms/DonateBanner/DonateBanner.style.js +12 -12
- package/src/components/Organisms/DonateBanner/Form/Form.js +41 -32
- package/src/components/Organisms/DonateBanner/GivingSelector/GivingSelector.js +2 -4
- package/src/components/Organisms/DonateBanner/GivingSelector/GivingSelector.style.js +20 -3
- package/src/components/Organisms/DonateBanner/MoneyBuy/MoneyBuy.js +9 -1
- package/src/components/Organisms/DonateBanner/__snapshots__/DonateBanner.test.js.snap +355 -316
- package/src/theme/shared/animations.js +24 -1
|
@@ -31,7 +31,7 @@ const handleVariant = variant => {
|
|
|
31
31
|
const Container = exports.Container = _styledComponents.default.div.withConfig({
|
|
32
32
|
displayName: "HeroBannerstyle__Container",
|
|
33
33
|
componentId: "sc-2ch4eo-0"
|
|
34
|
-
})(["width:100%;height:auto;display:flex;position:relative;flex-direction:column;background:", ";justify-content:center;", ";@media ", "{", " align-items:center;}"], _ref => {
|
|
34
|
+
})(["width:100%;height:auto;display:flex;position:relative;flex-direction:column;background:", ";justify-content:center;", " ", ";@media ", "{", " align-items:center;}"], _ref => {
|
|
35
35
|
let {
|
|
36
36
|
theme,
|
|
37
37
|
pageBackgroundColour
|
|
@@ -39,185 +39,191 @@ const Container = exports.Container = _styledComponents.default.div.withConfig({
|
|
|
39
39
|
return theme.color(pageBackgroundColour);
|
|
40
40
|
}, _ref2 => {
|
|
41
41
|
let {
|
|
42
|
-
variant,
|
|
43
42
|
paddingTop,
|
|
44
43
|
paddingBottom
|
|
45
44
|
} = _ref2;
|
|
46
|
-
return
|
|
45
|
+
return (0, _styledComponents.css)(["padding:", " 0 ", ";"], paddingTop, paddingBottom);
|
|
46
|
+
}, _ref3 => {
|
|
47
|
+
let {
|
|
48
|
+
variant,
|
|
49
|
+
paddingTop,
|
|
50
|
+
paddingBottom
|
|
51
|
+
} = _ref3;
|
|
52
|
+
return variant === _variants.default.TEXT_BANNER && (0, _styledComponents.css)(["padding:", " 1rem ", ";@media ", "{padding-left:2rem;padding-right:2rem;}"], paddingTop, paddingBottom, _ref4 => {
|
|
47
53
|
let {
|
|
48
54
|
theme
|
|
49
|
-
} =
|
|
55
|
+
} = _ref4;
|
|
50
56
|
return theme.breakpoints2026('M');
|
|
51
57
|
});
|
|
52
|
-
},
|
|
58
|
+
}, _ref5 => {
|
|
53
59
|
let {
|
|
54
60
|
theme
|
|
55
|
-
} =
|
|
61
|
+
} = _ref5;
|
|
56
62
|
return theme.breakpoints2026('L');
|
|
57
|
-
},
|
|
63
|
+
}, _ref6 => {
|
|
58
64
|
let {
|
|
59
65
|
paddingTop,
|
|
60
66
|
paddingBottom
|
|
61
|
-
} =
|
|
67
|
+
} = _ref6;
|
|
62
68
|
return (0, _styledComponents.css)(["padding:", " 2rem ", ";"], paddingTop, paddingBottom);
|
|
63
69
|
});
|
|
64
70
|
const OuterWrapper = exports.OuterWrapper = _styledComponents.default.div.withConfig({
|
|
65
71
|
displayName: "HeroBannerstyle__OuterWrapper",
|
|
66
72
|
componentId: "sc-2ch4eo-1"
|
|
67
|
-
})(["width:100%;max-width:none;position:relative;display:flex;flex-direction:column;align-items:center;@media ", "{width:100%;max-width:1500px;border-radius:1rem;overflow:hidden;", ""],
|
|
73
|
+
})(["width:100%;max-width:none;position:relative;display:flex;flex-direction:column;align-items:center;@media ", "{width:100%;max-width:1500px;border-radius:1rem;overflow:hidden;", ""], _ref7 => {
|
|
68
74
|
let {
|
|
69
75
|
theme
|
|
70
|
-
} =
|
|
76
|
+
} = _ref7;
|
|
71
77
|
return theme.breakpoints2026('L');
|
|
72
|
-
},
|
|
78
|
+
}, _ref8 => {
|
|
73
79
|
let {
|
|
74
80
|
variant
|
|
75
|
-
} =
|
|
81
|
+
} = _ref8;
|
|
76
82
|
return variant && (0, _styledComponents.css)(["", ""], handleVariant(variant));
|
|
77
83
|
});
|
|
78
84
|
const MediaWrapper = exports.MediaWrapper = _styledComponents.default.div.withConfig({
|
|
79
85
|
displayName: "HeroBannerstyle__MediaWrapper",
|
|
80
86
|
componentId: "sc-2ch4eo-2"
|
|
81
|
-
})(["width:100%;height:100%;@media ", "{position:absolute;top:0;left:0;img{object-position:top center;height:100%;transform:scale(1.02);transition:transform ", "s cubic-bezier(0.68,", ",0.265,", ");", ";}&:has(+ div a:hover){> div > img{transform:scale(1.04);}}}"],
|
|
87
|
+
})(["width:100%;height:100%;@media ", "{position:absolute;top:0;left:0;img{object-position:top center;height:100%;transform:scale(1.02);transition:transform ", "s cubic-bezier(0.68,", ",0.265,", ");", ";}&:has(+ div a:hover){> div > img{transform:scale(1.04);}}}"], _ref9 => {
|
|
82
88
|
let {
|
|
83
89
|
theme
|
|
84
|
-
} =
|
|
90
|
+
} = _ref9;
|
|
85
91
|
return theme.breakpoints2026('L');
|
|
86
|
-
}, 0.4, -1.15, 2.35,
|
|
92
|
+
}, 0.4, -1.15, 2.35, _ref10 => {
|
|
87
93
|
let {
|
|
88
94
|
variant
|
|
89
|
-
} =
|
|
95
|
+
} = _ref10;
|
|
90
96
|
return variant === _variants.default.HALF_HEIGHT && 'min-height: 450px;';
|
|
91
97
|
});
|
|
92
98
|
const CopyOuterWrapper = exports.CopyOuterWrapper = _styledComponents.default.div.withConfig({
|
|
93
99
|
displayName: "HeroBannerstyle__CopyOuterWrapper",
|
|
94
100
|
componentId: "sc-2ch4eo-3"
|
|
95
|
-
})(["position:relative;height:100%;left:0;right:0;display:flex;width:calc(100% - (2 * 1rem));", " @media ", "{", "}@media ", "{position:relative;top:auto;left:auto;height:100%;width:100%;", " display:flex;align-items:center;margin:0 auto;justify-content:", ";", "}"],
|
|
101
|
+
})(["position:relative;height:100%;left:0;right:0;display:flex;width:calc(100% - (2 * 1rem));", " @media ", "{", "}@media ", "{position:relative;top:auto;left:auto;height:100%;width:100%;", " display:flex;align-items:center;margin:0 auto;justify-content:", ";", "}"], _ref11 => {
|
|
96
102
|
let {
|
|
97
103
|
variant
|
|
98
|
-
} = _ref10;
|
|
99
|
-
return variant !== _variants.default.TEXT_BANNER ? 'margin: -2rem 1rem 2rem;' : 'margin: 0; width: 100%;';
|
|
100
|
-
}, _ref11 => {
|
|
101
|
-
let {
|
|
102
|
-
theme
|
|
103
104
|
} = _ref11;
|
|
104
|
-
return
|
|
105
|
+
return variant !== _variants.default.TEXT_BANNER ? 'margin: -2rem 1rem 0;' : 'margin: 0; width: 100%;';
|
|
105
106
|
}, _ref12 => {
|
|
106
107
|
let {
|
|
107
|
-
|
|
108
|
+
theme
|
|
108
109
|
} = _ref12;
|
|
109
|
-
return
|
|
110
|
+
return theme.breakpoints2026('M');
|
|
110
111
|
}, _ref13 => {
|
|
111
112
|
let {
|
|
112
|
-
|
|
113
|
+
variant
|
|
113
114
|
} = _ref13;
|
|
114
|
-
return
|
|
115
|
+
return variant !== _variants.default.TEXT_BANNER ? 'margin: -2rem 2rem 0rem; width: calc(100% - (2 * 2rem));' : 'margin: 0; width: 100%;';
|
|
115
116
|
}, _ref14 => {
|
|
116
117
|
let {
|
|
117
|
-
|
|
118
|
+
theme
|
|
118
119
|
} = _ref14;
|
|
119
|
-
return
|
|
120
|
+
return theme.breakpoints2026('L');
|
|
120
121
|
}, _ref15 => {
|
|
122
|
+
let {
|
|
123
|
+
variant
|
|
124
|
+
} = _ref15;
|
|
125
|
+
return variant !== _variants.default.TEXT_BANNER && 'max-width: 1200px;';
|
|
126
|
+
}, _ref16 => {
|
|
121
127
|
let {
|
|
122
128
|
variant,
|
|
123
129
|
copyLeft
|
|
124
|
-
} =
|
|
130
|
+
} = _ref16;
|
|
125
131
|
if (variant === _variants.default.TEXT_BANNER) return 'center';
|
|
126
132
|
return copyLeft ? 'flex-start' : 'flex-end';
|
|
127
|
-
},
|
|
133
|
+
}, _ref17 => {
|
|
128
134
|
let {
|
|
129
135
|
variant
|
|
130
|
-
} =
|
|
136
|
+
} = _ref17;
|
|
131
137
|
return variant && (0, _styledComponents.css)(["", ""], handleVariant(variant));
|
|
132
138
|
});
|
|
133
139
|
const Copy = exports.Copy = _styledComponents.default.div.withConfig({
|
|
134
140
|
displayName: "HeroBannerstyle__Copy",
|
|
135
141
|
componentId: "sc-2ch4eo-4"
|
|
136
|
-
})(["width:100%;", ";border-radius:1rem;padding:", ";color:", ";box-shadow:rgba(0,0,0,0.15) 0px 0px 1.5rem;background-color:", ";", ";", ";@media ", "{width:", ";}"], (0, _zIndex.default)('low'),
|
|
142
|
+
})(["width:100%;", ";border-radius:1rem;padding:", ";color:", ";box-shadow:rgba(0,0,0,0.15) 0px 0px 1.5rem;background-color:", ";", ";", ";@media ", "{width:", ";}"], (0, _zIndex.default)('low'), _ref18 => {
|
|
137
143
|
let {
|
|
138
144
|
variant
|
|
139
|
-
} =
|
|
145
|
+
} = _ref18;
|
|
140
146
|
return variant === _variants.default.TEXT_BANNER ? '3rem 1.5rem' : '1.5rem';
|
|
141
|
-
},
|
|
147
|
+
}, _ref19 => {
|
|
142
148
|
let {
|
|
143
149
|
theme,
|
|
144
150
|
copyColour
|
|
145
|
-
} =
|
|
151
|
+
} = _ref19;
|
|
146
152
|
return theme.color(copyColour);
|
|
147
|
-
},
|
|
153
|
+
}, _ref20 => {
|
|
148
154
|
let {
|
|
149
155
|
theme,
|
|
150
156
|
variant,
|
|
151
157
|
textBannerCopyBackgroundColour
|
|
152
|
-
} =
|
|
158
|
+
} = _ref20;
|
|
153
159
|
return variant === _variants.default.TEXT_BANNER ? theme.color(textBannerCopyBackgroundColour) : theme.color('white');
|
|
154
|
-
},
|
|
160
|
+
}, _ref21 => {
|
|
155
161
|
let {
|
|
156
162
|
variant,
|
|
157
163
|
theme
|
|
158
|
-
} =
|
|
164
|
+
} = _ref21;
|
|
159
165
|
return variant !== _variants.default.TEXT_BANNER && `
|
|
160
166
|
@media ${theme.breakpoints2026('L')} {
|
|
161
167
|
padding: 2rem 2rem 1.75rem;
|
|
162
168
|
}
|
|
163
169
|
`;
|
|
164
|
-
},
|
|
170
|
+
}, _ref22 => {
|
|
165
171
|
let {
|
|
166
172
|
variant,
|
|
167
173
|
theme
|
|
168
|
-
} =
|
|
174
|
+
} = _ref22;
|
|
169
175
|
return variant === _variants.default.TEXT_BANNER && `
|
|
170
176
|
text-align: center;
|
|
171
177
|
@media ${theme.breakpoints2026('M')} {
|
|
172
178
|
padding: 4rem 11%;
|
|
173
179
|
}
|
|
174
180
|
`;
|
|
175
|
-
},
|
|
181
|
+
}, _ref23 => {
|
|
176
182
|
let {
|
|
177
183
|
theme
|
|
178
|
-
} =
|
|
184
|
+
} = _ref23;
|
|
179
185
|
return theme.breakpoints2026('L');
|
|
180
|
-
},
|
|
186
|
+
}, _ref24 => {
|
|
181
187
|
let {
|
|
182
188
|
variant
|
|
183
|
-
} =
|
|
189
|
+
} = _ref24;
|
|
184
190
|
return variant !== _variants.default.TEXT_BANNER ? '92%' : '100%';
|
|
185
191
|
});
|
|
186
192
|
const CopyInnerWrapper = exports.CopyInnerWrapper = _styledComponents.default.div.withConfig({
|
|
187
193
|
displayName: "HeroBannerstyle__CopyInnerWrapper",
|
|
188
194
|
componentId: "sc-2ch4eo-5"
|
|
189
|
-
})(["width:100%;height:100%;display:flex;align-items:center;border-radius:1rem;@media ", "{height:auto;", ";", ";justify-content:", ";}"],
|
|
195
|
+
})(["width:100%;height:100%;display:flex;align-items:center;border-radius:1rem;@media ", "{height:auto;", ";", ";justify-content:", ";}"], _ref25 => {
|
|
190
196
|
let {
|
|
191
197
|
theme
|
|
192
|
-
} =
|
|
198
|
+
} = _ref25;
|
|
193
199
|
return theme.breakpoints2026('L');
|
|
194
|
-
},
|
|
200
|
+
}, _ref26 => {
|
|
195
201
|
let {
|
|
196
202
|
variant
|
|
197
|
-
} =
|
|
203
|
+
} = _ref26;
|
|
198
204
|
return variant === _variants.default.TEXT_BANNER ? (0, _styledComponents.css)(["width:100%;"]) : (0, _styledComponents.css)(["width:50%;"]);
|
|
199
|
-
},
|
|
205
|
+
}, _ref27 => {
|
|
200
206
|
let {
|
|
201
207
|
variant
|
|
202
|
-
} =
|
|
208
|
+
} = _ref27;
|
|
203
209
|
return variant === _variants.default.TEXT_BANNER ? (0, _styledComponents.css)(["margin:0;"]) : (0, _styledComponents.css)(["margin:2rem 0;"]);
|
|
204
|
-
},
|
|
210
|
+
}, _ref28 => {
|
|
205
211
|
let {
|
|
206
212
|
copyLeft
|
|
207
|
-
} =
|
|
213
|
+
} = _ref28;
|
|
208
214
|
return copyLeft ? (0, _styledComponents.css)([" flex-end;"]) : (0, _styledComponents.css)([" flex-start;"]);
|
|
209
215
|
});
|
|
210
216
|
const CTAWrapper = exports.CTAWrapper = _styledComponents.default.div.withConfig({
|
|
211
217
|
displayName: "HeroBannerstyle__CTAWrapper",
|
|
212
218
|
componentId: "sc-2ch4eo-6"
|
|
213
|
-
})(["width:100%;height:auto;position:relative;padding:0.5rem 2.5rem 0 0;margin-top:1.25rem;", ""],
|
|
219
|
+
})(["width:100%;height:auto;position:relative;padding:0.5rem 2.5rem 0 0;margin-top:1.25rem;", ""], _ref29 => {
|
|
214
220
|
let {
|
|
215
221
|
variant
|
|
216
|
-
} =
|
|
217
|
-
return variant !== _variants.default.TEXT_BANNER && (0, _styledComponents.css)(["span{font-weight:bold;color:", ";}"],
|
|
222
|
+
} = _ref29;
|
|
223
|
+
return variant !== _variants.default.TEXT_BANNER && (0, _styledComponents.css)(["span{font-weight:bold;color:", ";}"], _ref30 => {
|
|
218
224
|
let {
|
|
219
225
|
theme
|
|
220
|
-
} =
|
|
226
|
+
} = _ref30;
|
|
221
227
|
return theme.color('red');
|
|
222
228
|
});
|
|
223
229
|
});
|
|
@@ -236,14 +242,14 @@ const CtaTextUnderline = exports.CtaTextUnderline = _styledComponents.default.im
|
|
|
236
242
|
const HeroBannerLink = exports.HeroBannerLink = _styledComponents.default.a.withConfig({
|
|
237
243
|
displayName: "HeroBannerstyle__HeroBannerLink",
|
|
238
244
|
componentId: "sc-2ch4eo-10"
|
|
239
|
-
})(["text-decoration:none;width:100%;> div{transition:box-shadow 0.35s;box-shadow:rgba(0,0,0,0.15) 0px 0px 1.5rem;}&:hover{> div{box-shadow:rgba(0,0,0,0.25) 0px 0px 1.5rem;}}@media ", "{", " width:", ";> div{width:100%;}&:hover{img.cta-text-underline{opacity:1;}}}"],
|
|
245
|
+
})(["text-decoration:none;width:100%;> div{transition:box-shadow 0.35s;box-shadow:rgba(0,0,0,0.15) 0px 0px 1.5rem;}&:hover{> div{box-shadow:rgba(0,0,0,0.25) 0px 0px 1.5rem;}}@media ", "{", " width:", ";> div{width:100%;}&:hover{img.cta-text-underline{opacity:1;}}}"], _ref31 => {
|
|
240
246
|
let {
|
|
241
247
|
theme
|
|
242
|
-
} =
|
|
248
|
+
} = _ref31;
|
|
243
249
|
return theme.breakpoints2026('L');
|
|
244
|
-
}, (0, _animations.bounceUpAnimation)(true, 10, 2),
|
|
250
|
+
}, (0, _animations.bounceUpAnimation)(true, 10, 2, true), _ref32 => {
|
|
245
251
|
let {
|
|
246
252
|
variant
|
|
247
|
-
} =
|
|
253
|
+
} = _ref32;
|
|
248
254
|
return variant !== _variants.default.TEXT_BANNER ? '92%' : '100%';
|
|
249
255
|
});
|
|
@@ -73,6 +73,7 @@ exports[`renders "Full Height Media" Hero Banner correctly 1`] = `
|
|
|
73
73
|
-webkit-justify-content: center;
|
|
74
74
|
-ms-flex-pack: center;
|
|
75
75
|
justify-content: center;
|
|
76
|
+
padding: 0rem 0 2rem;
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
.c1 {
|
|
@@ -107,7 +108,7 @@ exports[`renders "Full Height Media" Hero Banner correctly 1`] = `
|
|
|
107
108
|
display: -ms-flexbox;
|
|
108
109
|
display: flex;
|
|
109
110
|
width: calc(100% - (2 * 1rem));
|
|
110
|
-
margin: -2rem 1rem
|
|
111
|
+
margin: -2rem 1rem 0;
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
.c7 {
|
|
@@ -211,7 +212,7 @@ exports[`renders "Full Height Media" Hero Banner correctly 1`] = `
|
|
|
211
212
|
|
|
212
213
|
@media (min-width:740px) {
|
|
213
214
|
.c5 {
|
|
214
|
-
margin: -2rem 2rem
|
|
215
|
+
margin: -2rem 2rem 0rem;
|
|
215
216
|
width: calc(100% - (2 * 2rem));
|
|
216
217
|
}
|
|
217
218
|
}
|
|
@@ -394,6 +395,7 @@ exports[`renders "Half Height Media" Hero Banner correctly 1`] = `
|
|
|
394
395
|
-webkit-justify-content: center;
|
|
395
396
|
-ms-flex-pack: center;
|
|
396
397
|
justify-content: center;
|
|
398
|
+
padding: 0rem 0 2rem;
|
|
397
399
|
}
|
|
398
400
|
|
|
399
401
|
.c1 {
|
|
@@ -428,7 +430,7 @@ exports[`renders "Half Height Media" Hero Banner correctly 1`] = `
|
|
|
428
430
|
display: -ms-flexbox;
|
|
429
431
|
display: flex;
|
|
430
432
|
width: calc(100% - (2 * 1rem));
|
|
431
|
-
margin: -2rem 1rem
|
|
433
|
+
margin: -2rem 1rem 0;
|
|
432
434
|
}
|
|
433
435
|
|
|
434
436
|
.c7 {
|
|
@@ -532,7 +534,7 @@ exports[`renders "Half Height Media" Hero Banner correctly 1`] = `
|
|
|
532
534
|
|
|
533
535
|
@media (min-width:740px) {
|
|
534
536
|
.c5 {
|
|
535
|
-
margin: -2rem 2rem
|
|
537
|
+
margin: -2rem 2rem 0rem;
|
|
536
538
|
width: calc(100% - (2 * 2rem));
|
|
537
539
|
}
|
|
538
540
|
}
|
|
@@ -700,6 +702,7 @@ exports[`renders "Text Banner" Hero Banner correctly 1`] = `
|
|
|
700
702
|
-webkit-justify-content: center;
|
|
701
703
|
-ms-flex-pack: center;
|
|
702
704
|
justify-content: center;
|
|
705
|
+
padding: 0rem 0 2rem;
|
|
703
706
|
padding: 0rem 1rem 2rem;
|
|
704
707
|
}
|
|
705
708
|
|
|
@@ -26,7 +26,6 @@ const DonateBanner = _ref => {
|
|
|
26
26
|
subtitle = '',
|
|
27
27
|
monthlyTitle = '',
|
|
28
28
|
monthlySubtitle = '',
|
|
29
|
-
popUpText = 'Help us deliver long-term impact by converting your single donation into a monthly gift.',
|
|
30
29
|
chooseAmountText = null,
|
|
31
30
|
monthlyChooseAmountText = null,
|
|
32
31
|
otherAmountText = 'will help us fund amazing projects in the UK and around the world.',
|
|
@@ -41,7 +40,7 @@ const DonateBanner = _ref => {
|
|
|
41
40
|
donateLink,
|
|
42
41
|
mbshipID
|
|
43
42
|
} = _ref;
|
|
44
|
-
const
|
|
43
|
+
const isLargeBreakpoint = (0, _reactResponsive.useMediaQuery)({
|
|
45
44
|
query: `(min-width: ${_allBreakpoints.breakpointValues.L}px)`
|
|
46
45
|
});
|
|
47
46
|
const isMedium = (0, _reactResponsive.useMediaQuery)({
|
|
@@ -58,14 +57,14 @@ const DonateBanner = _ref => {
|
|
|
58
57
|
thisOtherAmountText
|
|
59
58
|
} = (0, _utils.handleOtherAmountText)(givingType, otherAmountText, monthlyOtherAmountText);
|
|
60
59
|
const shouldShowImage = donateWidgetIsTextOnly === false;
|
|
61
|
-
const shouldShowDesktopImage = shouldShowImage &&
|
|
62
|
-
const shouldShowTopImage = shouldShowImage && !
|
|
60
|
+
const shouldShowDesktopImage = shouldShowImage && isLargeBreakpoint && imageL && (imageL.images || imageL.image);
|
|
61
|
+
const shouldShowTopImage = shouldShowImage && !isLargeBreakpoint;
|
|
63
62
|
const topImage = isMedium ? imageM : imageS;
|
|
64
|
-
const shouldRenderTopImage = shouldShowTopImage && topImage && (topImage.images || topImage.image);
|
|
63
|
+
const shouldRenderTopImage = !!(shouldShowTopImage && topImage && (topImage.images || topImage.image));
|
|
65
64
|
|
|
66
65
|
// For text-only variants, we hide the title area on non-desktop widths
|
|
67
66
|
// (M and below), so only the form is shown.
|
|
68
|
-
const shouldShowTitleSection = noTitlesAtAll === false &&
|
|
67
|
+
const shouldShowTitleSection = noTitlesAtAll === false && isLargeBreakpoint && donateWidgetIsTextOnly;
|
|
69
68
|
return /*#__PURE__*/_react.default.createElement(_DonateBanner.Container, {
|
|
70
69
|
paddingAbove: paddingAbove,
|
|
71
70
|
paddingBelow: paddingBelow,
|
|
@@ -103,8 +102,7 @@ const DonateBanner = _ref => {
|
|
|
103
102
|
}, shouldShowTitleSection && /*#__PURE__*/_react.default.createElement(_DonateBanner.TitleWrapperOuter, {
|
|
104
103
|
donateOrientation: donateOrientation
|
|
105
104
|
}, /*#__PURE__*/_react.default.createElement(_DonateBanner.TitleWrapperInner, null, showCopy && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Text.default, {
|
|
106
|
-
tag: "
|
|
107
|
-
size: "big",
|
|
105
|
+
tag: "h1",
|
|
108
106
|
family: "Anton",
|
|
109
107
|
weight: "normal"
|
|
110
108
|
}, thisTitle), /*#__PURE__*/_react.default.createElement(_Text.default, {
|
|
@@ -118,7 +116,6 @@ const DonateBanner = _ref => {
|
|
|
118
116
|
mbshipID: mbshipID,
|
|
119
117
|
donateLink: donateLink,
|
|
120
118
|
hideMoneyBuys: hideMoneyBuys,
|
|
121
|
-
popUpText: popUpText,
|
|
122
119
|
chooseAmountText: chooseAmountText,
|
|
123
120
|
monthlyChooseAmountText: monthlyChooseAmountText,
|
|
124
121
|
donateWidgetIsTextOnly: donateWidgetIsTextOnly,
|
|
@@ -126,7 +123,12 @@ const DonateBanner = _ref => {
|
|
|
126
123
|
shouldShowTitleSection: shouldShowTitleSection,
|
|
127
124
|
donateOrientation: donateOrientation,
|
|
128
125
|
givingType: givingType,
|
|
129
|
-
changeGivingType: setGivingType
|
|
126
|
+
changeGivingType: setGivingType,
|
|
127
|
+
thisTitle: thisTitle,
|
|
128
|
+
thisSubtitle: thisSubtitle,
|
|
129
|
+
showCopy: showCopy,
|
|
130
|
+
isLargeBreakpoint: isLargeBreakpoint,
|
|
131
|
+
isMediumBreakpoint: isMedium
|
|
130
132
|
}))));
|
|
131
133
|
};
|
|
132
134
|
var _default = exports.default = DonateBanner;
|
|
@@ -87,7 +87,6 @@ const imageS = {
|
|
|
87
87
|
monthlySubtitle="A regular gift helps fund long-term impact."
|
|
88
88
|
chooseAmountText="Choose a one-off amount"
|
|
89
89
|
monthlyChooseAmountText="Choose a monthly amount"
|
|
90
|
-
popUpText="Switching to a single gift means less predictable funding."
|
|
91
90
|
/>;
|
|
92
91
|
```
|
|
93
92
|
|
|
@@ -137,7 +136,30 @@ import data from './dev-data/data';
|
|
|
137
136
|
/>;
|
|
138
137
|
```
|
|
139
138
|
|
|
140
|
-
##
|
|
139
|
+
## Text-only widget (no image), with giving selector (single vs monthly)
|
|
140
|
+
|
|
141
|
+
```js
|
|
142
|
+
import data from './dev-data/data';
|
|
143
|
+
|
|
144
|
+
<DonateBanner
|
|
145
|
+
donateWidgetIsTextOnly
|
|
146
|
+
pageBackgroundColour="grey_light"
|
|
147
|
+
paddingAbove="2rem"
|
|
148
|
+
paddingBelow="2rem"
|
|
149
|
+
donateOrientation="right"
|
|
150
|
+
data={data}
|
|
151
|
+
mbshipID="mbship-3c"
|
|
152
|
+
donateLink="https://donation.comicrelief.com/"
|
|
153
|
+
clientID="donate"
|
|
154
|
+
cartID="default-comicrelief"
|
|
155
|
+
title="Donate now"
|
|
156
|
+
subtitle="Choose between a one-off or monthly gift."
|
|
157
|
+
monthlyTitle="Give monthly"
|
|
158
|
+
monthlySubtitle="A regular gift helps fund long-term impact."
|
|
159
|
+
/>;
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Different "Other amount" copy for single vs monthly
|
|
141
163
|
|
|
142
164
|
```js
|
|
143
165
|
import data from './dev-data/data';
|
|
@@ -5,7 +5,7 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.Wrapper = exports.TitleWrapperOuter = exports.TitleWrapperInner = exports.SecondaryTitleText = exports.PrimaryTitleText = exports.OuterFieldset = exports.MoneyBuys = exports.Legend = exports.Label = exports.InnerContainer = exports.FormWrapper = exports.FormFieldset = exports.Form = exports.Error = exports.
|
|
8
|
+
exports.Wrapper = exports.TitleWrapperOuter = exports.TitleWrapperInner = exports.SecondaryTitleText = exports.PrimaryTitleText = exports.OuterFieldset = exports.MoneybuyCopy = exports.MoneyBuys = exports.Legend = exports.Label = exports.InnerContainer = exports.FormWrapper = exports.FormFieldset = exports.Form = exports.Error = exports.Container = exports.Button = exports.BgImage = exports.AmountField = void 0;
|
|
9
9
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
10
10
|
var _Input = _interopRequireDefault(require("../../Atoms/Input/Input"));
|
|
11
11
|
var _Text = _interopRequireDefault(require("../../Atoms/Text/Text"));
|
|
@@ -31,7 +31,7 @@ const Container = exports.Container = _styledComponents.default.div.withConfig({
|
|
|
31
31
|
const InnerContainer = exports.InnerContainer = _styledComponents.default.div.withConfig({
|
|
32
32
|
displayName: "DonateBannerstyle__InnerContainer",
|
|
33
33
|
componentId: "sc-a4o3ek-1"
|
|
34
|
-
})(["position:relative;background-color:", ";border-radius:1rem;overflow:hidden;padding:none;width:100%;box-sizing:border-box;@media ", "{padding:", ";", "}@media ", "{padding-left:", ";padding-right:", ";}max-width:1500px;"], _ref3 => {
|
|
34
|
+
})(["position:relative;background-color:", ";border-radius:1rem;overflow:hidden;padding:none;width:100%;box-sizing:border-box;box-shadow:0px 0px 16px rgba(0,0,0,0.15);@media ", "{padding:", ";", "}@media ", "{padding-left:", ";padding-right:", ";}max-width:1500px;"], _ref3 => {
|
|
35
35
|
let {
|
|
36
36
|
theme,
|
|
37
37
|
componentBackgroundColour
|
|
@@ -141,7 +141,7 @@ const Error = exports.Error = (0, _styledComponents.default)(_Text.default).with
|
|
|
141
141
|
const Form = exports.Form = _styledComponents.default.form.withConfig({
|
|
142
142
|
displayName: "DonateBannerstyle__Form",
|
|
143
143
|
componentId: "sc-a4o3ek-8"
|
|
144
|
-
})(["position:relative;width:100%;background-color:", ";box-shadow:0px 0px 16px rgba(0,0,0,0.15);margin-left:auto;margin-right:auto;", " h3{margin-top:", ";}input{max-width:100%;margin:0;}input[type='submit']{margin:", " 0;}@media ", "{width:100%;margin-right:auto;margin-left:auto;}@media ", "{margin-top:", ";border-radius:
|
|
144
|
+
})(["position:relative;width:100%;background-color:", ";box-shadow:0px 0px 16px rgba(0,0,0,0.15);margin-left:auto;margin-right:auto;", " h3{margin-top:", ";}input{max-width:100%;margin:0;}input[type='submit']{margin:", " 0;}@media ", "{width:100%;margin-right:auto;margin-left:auto;}@media ", "{margin-top:", ";border-radius:1rem;max-width:461px;min-width:400px;margin-left:0;margin-right:0;}"], _ref19 => {
|
|
145
145
|
let {
|
|
146
146
|
theme
|
|
147
147
|
} = _ref19;
|
|
@@ -166,12 +166,12 @@ const Form = exports.Form = _styledComponents.default.form.withConfig({
|
|
|
166
166
|
const OuterFieldset = exports.OuterFieldset = _styledComponents.default.fieldset.withConfig({
|
|
167
167
|
displayName: "DonateBannerstyle__OuterFieldset",
|
|
168
168
|
componentId: "sc-a4o3ek-9"
|
|
169
|
-
})(["color:", ";padding:
|
|
169
|
+
})(["color:", ";padding:", ";margin:0;border:none;@media ", "{padding:0 ", " ", ";}input[type='submit']{margin-bottom:0;}"], _ref23 => {
|
|
170
170
|
let {
|
|
171
171
|
theme
|
|
172
172
|
} = _ref23;
|
|
173
173
|
return theme.color('black');
|
|
174
|
-
}, (0, _spacing.default)('
|
|
174
|
+
}, (0, _spacing.default)('m'), _ref24 => {
|
|
175
175
|
let {
|
|
176
176
|
theme
|
|
177
177
|
} = _ref24;
|
|
@@ -184,33 +184,28 @@ const Legend = exports.Legend = _styledComponents.default.legend.withConfig({
|
|
|
184
184
|
const PrimaryTitleText = exports.PrimaryTitleText = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
185
185
|
displayName: "DonateBannerstyle__PrimaryTitleText",
|
|
186
186
|
componentId: "sc-a4o3ek-11"
|
|
187
|
-
})(["display:block;text-align:left;font-
|
|
188
|
-
let {
|
|
189
|
-
theme
|
|
190
|
-
} = _ref25;
|
|
191
|
-
return theme.fontSize('s');
|
|
192
|
-
});
|
|
187
|
+
})(["display:block;text-align:left;font-weight:700;"]);
|
|
193
188
|
const SecondaryTitleText = exports.SecondaryTitleText = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
194
189
|
displayName: "DonateBannerstyle__SecondaryTitleText",
|
|
195
190
|
componentId: "sc-a4o3ek-12"
|
|
196
|
-
})(["display:block;text-align:left;font-size:", ";line-height:1.5;margin
|
|
191
|
+
})(["display:block;text-align:left;font-size:", ";line-height:1.5;margin:", " 0 !important;"], _ref25 => {
|
|
197
192
|
let {
|
|
198
193
|
theme
|
|
199
|
-
} =
|
|
194
|
+
} = _ref25;
|
|
200
195
|
return theme.fontSize('s');
|
|
201
196
|
}, (0, _spacing.default)('sm'));
|
|
202
197
|
const MoneyBuys = exports.MoneyBuys = _styledComponents.default.div.withConfig({
|
|
203
198
|
displayName: "DonateBannerstyle__MoneyBuys",
|
|
204
199
|
componentId: "sc-a4o3ek-13"
|
|
205
|
-
})(["display:flex;justify-content:space-between;flex-direction:column;margin-bottom:", ";@media ", "{flex-direction:row;margin-top:", ";}label{flex:0 0 31%;margin-bottom:", ";@media ", "{margin-bottom:0;}input{cursor:pointer;padding:", " ", ";}}"], (0, _spacing.default)('md'),
|
|
200
|
+
})(["display:flex;justify-content:space-between;flex-direction:column;margin-bottom:", ";@media ", "{flex-direction:row;margin-top:", ";}label{flex:0 0 31%;margin-bottom:", ";@media ", "{margin-bottom:0;}input{cursor:pointer;padding:", " ", ";}}"], (0, _spacing.default)('md'), _ref26 => {
|
|
206
201
|
let {
|
|
207
202
|
theme
|
|
208
|
-
} =
|
|
203
|
+
} = _ref26;
|
|
209
204
|
return theme.allBreakpoints('M');
|
|
210
|
-
}, (0, _spacing.default)('m'), (0, _spacing.default)('sm'),
|
|
205
|
+
}, (0, _spacing.default)('m'), (0, _spacing.default)('sm'), _ref27 => {
|
|
211
206
|
let {
|
|
212
207
|
theme
|
|
213
|
-
} =
|
|
208
|
+
} = _ref27;
|
|
214
209
|
return theme.allBreakpoints('M');
|
|
215
210
|
}, (0, _spacing.default)('sm'), (0, _spacing.default)('m'));
|
|
216
211
|
const FormFieldset = exports.FormFieldset = _styledComponents.default.div.withConfig({
|
|
@@ -224,45 +219,50 @@ const Label = exports.Label = (0, _styledComponents.default)(_Text.default).with
|
|
|
224
219
|
const AmountField = exports.AmountField = (0, _styledComponents.default)(_Input.default).withConfig({
|
|
225
220
|
displayName: "DonateBannerstyle__AmountField",
|
|
226
221
|
componentId: "sc-a4o3ek-16"
|
|
227
|
-
})(["position:relative;flex-basis:50%;flex-shrink:0;flex-grow:0;font-weight:400;display:block;", " @media ", "{flex-basis:60%;}span{position:absolute;font-size:20px;top:50%;transform:translateY(-50%);left:0px;font-weight:500;padding:0px 15px;", ";}input{height:48px;border:1px solid ", ";background:", ";border-radius:0.5rem;padding:", " ", " ", " ", ";&:focus{outline:none;border:1px solid ", ";}}"],
|
|
222
|
+
})(["position:relative;flex-basis:50%;flex-shrink:0;flex-grow:0;font-weight:400;display:block;", " @media ", "{flex-basis:60%;}span{position:absolute;font-size:20px;top:50%;transform:translateY(-50%);left:0px;font-weight:500;padding:0px 15px;", ";}input{height:48px;border:1px solid ", ";background:", ";border-radius:0.5rem;padding:", " ", " ", " ", ";&:focus{outline:none;border:1px solid ", ";}}"], _ref28 => {
|
|
228
223
|
let {
|
|
229
224
|
$noMoneyBuys
|
|
230
|
-
} =
|
|
225
|
+
} = _ref28;
|
|
231
226
|
return $noMoneyBuys === true && (0, _styledComponents.css)(["margin-top:", ";"], (0, _spacing.default)('sm'));
|
|
232
|
-
},
|
|
227
|
+
}, _ref29 => {
|
|
233
228
|
let {
|
|
234
229
|
theme
|
|
235
|
-
} =
|
|
230
|
+
} = _ref29;
|
|
236
231
|
return theme.allBreakpoints('M');
|
|
237
|
-
}, (0, _zIndex.default)('high'),
|
|
232
|
+
}, (0, _zIndex.default)('high'), _ref30 => {
|
|
238
233
|
let {
|
|
239
234
|
theme
|
|
240
|
-
} =
|
|
235
|
+
} = _ref30;
|
|
241
236
|
return theme.color('grey');
|
|
242
|
-
},
|
|
237
|
+
}, _ref31 => {
|
|
243
238
|
let {
|
|
244
239
|
theme
|
|
245
|
-
} =
|
|
240
|
+
} = _ref31;
|
|
246
241
|
return theme.color('grey_light');
|
|
247
|
-
}, (0, _spacing.default)('sm'), (0, _spacing.default)('md'), (0, _spacing.default)('sm'), (0, _spacing.default)('l'),
|
|
242
|
+
}, (0, _spacing.default)('sm'), (0, _spacing.default)('md'), (0, _spacing.default)('sm'), (0, _spacing.default)('l'), _ref32 => {
|
|
248
243
|
let {
|
|
249
244
|
theme
|
|
250
|
-
} =
|
|
245
|
+
} = _ref32;
|
|
251
246
|
return theme.color('grey');
|
|
252
247
|
});
|
|
253
|
-
const
|
|
254
|
-
displayName: "
|
|
248
|
+
const MoneybuyCopy = exports.MoneybuyCopy = _styledComponents.default.p.withConfig({
|
|
249
|
+
displayName: "DonateBannerstyle__MoneybuyCopy",
|
|
255
250
|
componentId: "sc-a4o3ek-17"
|
|
256
|
-
})(["line-height:1.5;margin-top:", ";color:", ";"], (0, _spacing.default)('l'),
|
|
251
|
+
})(["line-height:1.5;margin-top:", ";color:", ";margin:", " 0 ", ";@media ", "{margin:", " 0 ", ";}"], (0, _spacing.default)('l'), _ref33 => {
|
|
257
252
|
let {
|
|
258
253
|
theme
|
|
259
|
-
} =
|
|
254
|
+
} = _ref33;
|
|
260
255
|
return theme.color('black');
|
|
261
|
-
})
|
|
256
|
+
}, (0, _spacing.default)('md'), (0, _spacing.default)('sm'), _ref34 => {
|
|
257
|
+
let {
|
|
258
|
+
theme
|
|
259
|
+
} = _ref34;
|
|
260
|
+
return theme.allBreakpoints('M');
|
|
261
|
+
}, (0, _spacing.default)('m'), (0, _spacing.default)('md'));
|
|
262
262
|
const Button = exports.Button = _styledComponents.default.button.withConfig({
|
|
263
263
|
displayName: "DonateBannerstyle__Button",
|
|
264
264
|
componentId: "sc-a4o3ek-18"
|
|
265
|
-
})(["width:100%;margin:", "
|
|
265
|
+
})(["width:100%;margin-top:", ";color:", ";font-size:", ";font-weight:bold;min-height:44px;cursor:pointer;background:", ";text-decoration:none;border-radius:0.5rem;border:none;appearance:none;:active,:focus,:hover{outline:none;background-color:", ";}"], (0, _spacing.default)('md'), _ref35 => {
|
|
266
266
|
let {
|
|
267
267
|
theme
|
|
268
268
|
} = _ref35;
|
|
@@ -283,9 +283,4 @@ const Button = exports.Button = _styledComponents.default.button.withConfig({
|
|
|
283
283
|
theme
|
|
284
284
|
} = _ref38;
|
|
285
285
|
return theme.color('coral_dark');
|
|
286
|
-
}
|
|
287
|
-
let {
|
|
288
|
-
theme
|
|
289
|
-
} = _ref39;
|
|
290
|
-
return theme.allBreakpoints('M');
|
|
291
|
-
}, (0, _spacing.default)('md'), (0, _spacing.default)('l'));
|
|
286
|
+
});
|