@comicrelief/component-library 8.55.0 → 8.55.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.
@@ -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 variant === _variants.default.TEXT_BANNER && (0, _styledComponents.css)(["padding:", " 1rem ", ";@media ", "{padding-left:2rem;padding-right:2rem;}"], paddingTop, paddingBottom, _ref3 => {
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
- } = _ref3;
55
+ } = _ref4;
50
56
  return theme.breakpoints2026('M');
51
57
  });
52
- }, _ref4 => {
58
+ }, _ref5 => {
53
59
  let {
54
60
  theme
55
- } = _ref4;
61
+ } = _ref5;
56
62
  return theme.breakpoints2026('L');
57
- }, _ref5 => {
63
+ }, _ref6 => {
58
64
  let {
59
65
  paddingTop,
60
66
  paddingBottom
61
- } = _ref5;
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;", ""], _ref6 => {
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
- } = _ref6;
76
+ } = _ref7;
71
77
  return theme.breakpoints2026('L');
72
- }, _ref7 => {
78
+ }, _ref8 => {
73
79
  let {
74
80
  variant
75
- } = _ref7;
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);}}}"], _ref8 => {
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
- } = _ref8;
90
+ } = _ref9;
85
91
  return theme.breakpoints2026('L');
86
- }, 0.4, -1.15, 2.35, _ref9 => {
92
+ }, 0.4, -1.15, 2.35, _ref10 => {
87
93
  let {
88
94
  variant
89
- } = _ref9;
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:", ";", "}"], _ref10 => {
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 theme.breakpoints2026('M');
105
+ return variant !== _variants.default.TEXT_BANNER ? 'margin: -2rem 1rem 0;' : 'margin: 0; width: 100%;';
105
106
  }, _ref12 => {
106
107
  let {
107
- variant
108
+ theme
108
109
  } = _ref12;
109
- return variant !== _variants.default.TEXT_BANNER ? 'margin: -2rem 2rem 2rem; width: calc(100% - (2 * 2rem));' : 'margin: 0; width: 100%;';
110
+ return theme.breakpoints2026('M');
110
111
  }, _ref13 => {
111
112
  let {
112
- theme
113
+ variant
113
114
  } = _ref13;
114
- return theme.breakpoints2026('L');
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
- variant
118
+ theme
118
119
  } = _ref14;
119
- return variant !== _variants.default.TEXT_BANNER && 'max-width: 1200px;';
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
- } = _ref15;
130
+ } = _ref16;
125
131
  if (variant === _variants.default.TEXT_BANNER) return 'center';
126
132
  return copyLeft ? 'flex-start' : 'flex-end';
127
- }, _ref16 => {
133
+ }, _ref17 => {
128
134
  let {
129
135
  variant
130
- } = _ref16;
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'), _ref17 => {
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
- } = _ref17;
145
+ } = _ref18;
140
146
  return variant === _variants.default.TEXT_BANNER ? '3rem 1.5rem' : '1.5rem';
141
- }, _ref18 => {
147
+ }, _ref19 => {
142
148
  let {
143
149
  theme,
144
150
  copyColour
145
- } = _ref18;
151
+ } = _ref19;
146
152
  return theme.color(copyColour);
147
- }, _ref19 => {
153
+ }, _ref20 => {
148
154
  let {
149
155
  theme,
150
156
  variant,
151
157
  textBannerCopyBackgroundColour
152
- } = _ref19;
158
+ } = _ref20;
153
159
  return variant === _variants.default.TEXT_BANNER ? theme.color(textBannerCopyBackgroundColour) : theme.color('white');
154
- }, _ref20 => {
160
+ }, _ref21 => {
155
161
  let {
156
162
  variant,
157
163
  theme
158
- } = _ref20;
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
- }, _ref21 => {
170
+ }, _ref22 => {
165
171
  let {
166
172
  variant,
167
173
  theme
168
- } = _ref21;
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
- }, _ref22 => {
181
+ }, _ref23 => {
176
182
  let {
177
183
  theme
178
- } = _ref22;
184
+ } = _ref23;
179
185
  return theme.breakpoints2026('L');
180
- }, _ref23 => {
186
+ }, _ref24 => {
181
187
  let {
182
188
  variant
183
- } = _ref23;
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:", ";}"], _ref24 => {
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
- } = _ref24;
198
+ } = _ref25;
193
199
  return theme.breakpoints2026('L');
194
- }, _ref25 => {
200
+ }, _ref26 => {
195
201
  let {
196
202
  variant
197
- } = _ref25;
203
+ } = _ref26;
198
204
  return variant === _variants.default.TEXT_BANNER ? (0, _styledComponents.css)(["width:100%;"]) : (0, _styledComponents.css)(["width:50%;"]);
199
- }, _ref26 => {
205
+ }, _ref27 => {
200
206
  let {
201
207
  variant
202
- } = _ref26;
208
+ } = _ref27;
203
209
  return variant === _variants.default.TEXT_BANNER ? (0, _styledComponents.css)(["margin:0;"]) : (0, _styledComponents.css)(["margin:2rem 0;"]);
204
- }, _ref27 => {
210
+ }, _ref28 => {
205
211
  let {
206
212
  copyLeft
207
- } = _ref27;
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;", ""], _ref28 => {
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
- } = _ref28;
217
- return variant !== _variants.default.TEXT_BANNER && (0, _styledComponents.css)(["span{font-weight:bold;color:", ";}"], _ref29 => {
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
- } = _ref29;
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;}}}"], _ref30 => {
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
- } = _ref30;
248
+ } = _ref31;
243
249
  return theme.breakpoints2026('L');
244
- }, (0, _animations.bounceUpAnimation)(true, 10, 2), _ref31 => {
250
+ }, (0, _animations.bounceUpAnimation)(true, 10, 2, true), _ref32 => {
245
251
  let {
246
252
  variant
247
- } = _ref31;
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 2rem;
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 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 2rem;
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 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
 
@@ -67,18 +67,27 @@ const formFieldInputAnimation = function () {
67
67
  * @param {boolean} animateScale - Whether to enable the scale animation
68
68
  * @param {number} pixelMovement - Amount of movement to apply on hover
69
69
  * @param {number} bounceIntensity - Intensity of the springy bounce effect (0-3, default: 1)
70
+ * @param {boolean} targetChild - Where to apply the transform
71
+
70
72
  * @returns {css} template literal for the animation
71
73
  */
72
74
  exports.formFieldInputAnimation = formFieldInputAnimation;
73
75
  const bounceUpAnimation = function (animateScale) {
74
76
  let pixelMovement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
75
77
  let bounceIntensity = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
78
+ let targetChild = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
76
79
  if (!animateScale) {
77
80
  return (0, _styledComponents.css)([""]);
78
81
  }
79
82
  const pullBack = -0.55 - bounceIntensity * 0.3;
80
83
  const overshoot = 1.55 + bounceIntensity * 0.4;
81
84
  const duration = 0.2 + bounceIntensity * 0.1;
85
+
86
+ // The Hero Banner requires us to apply the transform inside
87
+ // the anchor, in order to address the 'infinity bounce' bug
88
+ if (targetChild) {
89
+ return (0, _styledComponents.css)(["> div{transition:transform ", "s cubic-bezier(0.68,", ",0.265,", ");transform-origin:center;}&:hover,&:focus{> div{transform:translateY(-", "px);}}"], duration, pullBack, overshoot, pixelMovement);
90
+ }
82
91
  return (0, _styledComponents.css)(["transition:transform ", "s cubic-bezier(0.68,", ",0.265,", ");transform-origin:center;&:hover,&:focus{transform:translateY(-", "px);}"], duration, pullBack, overshoot, pixelMovement);
83
92
  };
84
93
  exports.bounceUpAnimation = bounceUpAnimation;
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.55.0",
4
+ "version": "8.55.1",
5
5
  "main": "dist/index.js",
6
6
  "license": "ISC",
7
7
  "jest": {
@@ -30,6 +30,7 @@ const Container = styled.div`
30
30
  flex-direction: column;
31
31
  background: ${({ theme, pageBackgroundColour }) => theme.color(pageBackgroundColour)};
32
32
  justify-content: center;
33
+ ${({ paddingTop, paddingBottom }) => css`padding: ${paddingTop} 0 ${paddingBottom};`}
33
34
 
34
35
  ${({ variant, paddingTop, paddingBottom }) => (variant === variants.TEXT_BANNER && css`
35
36
  padding: ${paddingTop} 1rem ${paddingBottom};
@@ -100,11 +101,11 @@ const CopyOuterWrapper = styled.div`
100
101
  display: flex;
101
102
  width: calc(100% - (2 * 1rem));
102
103
 
103
- ${({ variant }) => (variant !== variants.TEXT_BANNER ? 'margin: -2rem 1rem 2rem;' : 'margin: 0; width: 100%;')}
104
+ ${({ variant }) => (variant !== variants.TEXT_BANNER ? 'margin: -2rem 1rem 0;' : 'margin: 0; width: 100%;')}
104
105
 
105
106
  @media ${({ theme }) => theme.breakpoints2026('M')} {
106
107
  ${({ variant }) => (variant !== variants.TEXT_BANNER
107
- ? 'margin: -2rem 2rem 2rem; width: calc(100% - (2 * 2rem));'
108
+ ? 'margin: -2rem 2rem 0rem; width: calc(100% - (2 * 2rem));'
108
109
  : 'margin: 0; width: 100%;')}
109
110
  }
110
111
 
@@ -237,7 +238,7 @@ const HeroBannerLink = styled.a`
237
238
 
238
239
  @media ${({ theme }) => theme.breakpoints2026('L')} {
239
240
 
240
- ${bounceUpAnimation(true, 10, 2)}
241
+ ${bounceUpAnimation(true, 10, 2, true)}
241
242
 
242
243
  // As the link is now wrapping the content, it'll take over width duties from 'Copy':
243
244
  width: ${({ variant }) => (variant !== variants.TEXT_BANNER ? '92%' : '100%')};
@@ -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 2rem;
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 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 2rem;
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 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
 
@@ -123,9 +123,14 @@ const formFieldInputAnimation = (shiftPx = 4) => css`
123
123
  * @param {boolean} animateScale - Whether to enable the scale animation
124
124
  * @param {number} pixelMovement - Amount of movement to apply on hover
125
125
  * @param {number} bounceIntensity - Intensity of the springy bounce effect (0-3, default: 1)
126
+ * @param {boolean} targetChild - Where to apply the transform
127
+
126
128
  * @returns {css} template literal for the animation
127
129
  */
128
- const bounceUpAnimation = (animateScale, pixelMovement = 10, bounceIntensity = 1) => {
130
+ const bounceUpAnimation = (animateScale,
131
+ pixelMovement = 10,
132
+ bounceIntensity = 1,
133
+ targetChild = false) => {
129
134
  if (!animateScale) {
130
135
  return css``;
131
136
  }
@@ -134,6 +139,24 @@ const bounceUpAnimation = (animateScale, pixelMovement = 10, bounceIntensity = 1
134
139
  const overshoot = 1.55 + (bounceIntensity * 0.4);
135
140
  const duration = 0.2 + (bounceIntensity * 0.1);
136
141
 
142
+ // The Hero Banner requires us to apply the transform inside
143
+ // the anchor, in order to address the 'infinity bounce' bug
144
+ if (targetChild) {
145
+ return css`
146
+ > div {
147
+ transition: transform ${duration}s cubic-bezier(0.68, ${pullBack}, 0.265, ${overshoot});
148
+ transform-origin: center;
149
+ }
150
+
151
+ &:hover,
152
+ &:focus {
153
+ > div {
154
+ transform: translateY(-${pixelMovement}px);
155
+ }
156
+ }
157
+ `;
158
+ }
159
+
137
160
  return css`
138
161
  transition: transform ${duration}s cubic-bezier(0.68, ${pullBack}, 0.265, ${overshoot});
139
162
  transform-origin: center;