@comicrelief/component-library 6.4.0 → 6.5.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.
@@ -25,14 +25,6 @@ exports[`Monthly donation renders correctly 1`] = `
25
25
  }
26
26
 
27
27
  .c16 {
28
- font-size: 1rem;
29
- line-height: 1rem;
30
- text-transform: inherit;
31
- line-height: normal;
32
- font-family: 'Montserrat',Helvetica,Arial,sans-serif;
33
- }
34
-
35
- .c20 {
36
28
  font-size: 1.5rem;
37
29
  line-height: 1.5rem;
38
30
  text-transform: inherit;
@@ -41,7 +33,7 @@ exports[`Monthly donation renders correctly 1`] = `
41
33
  font-family: 'Montserrat',Helvetica,Arial,sans-serif;
42
34
  }
43
35
 
44
- .c24 {
36
+ .c20 {
45
37
  font-size: 1rem;
46
38
  line-height: 1rem;
47
39
  text-transform: inherit;
@@ -50,7 +42,7 @@ exports[`Monthly donation renders correctly 1`] = `
50
42
  font-family: 'Montserrat',Helvetica,Arial,sans-serif;
51
43
  }
52
44
 
53
- .c29 {
45
+ .c25 {
54
46
  font-size: 1rem;
55
47
  line-height: 1rem;
56
48
  text-transform: inherit;
@@ -59,7 +51,7 @@ exports[`Monthly donation renders correctly 1`] = `
59
51
  font-family: 'Montserrat',Helvetica,Arial,sans-serif;
60
52
  }
61
53
 
62
- .c22 {
54
+ .c18 {
63
55
  position: relative;
64
56
  display: -webkit-box;
65
57
  display: -webkit-flex;
@@ -72,11 +64,11 @@ exports[`Monthly donation renders correctly 1`] = `
72
64
  width: 100%;
73
65
  }
74
66
 
75
- .c25 {
67
+ .c21 {
76
68
  margin-bottom: 0.5rem;
77
69
  }
78
70
 
79
- .c27 {
71
+ .c23 {
80
72
  position: relative;
81
73
  box-sizing: border-box;
82
74
  width: 100%;
@@ -96,48 +88,20 @@ exports[`Monthly donation renders correctly 1`] = `
96
88
  font-family: 'Montserrat',Helvetica,Arial,sans-serif;
97
89
  }
98
90
 
99
- .c27:focus {
91
+ .c23:focus {
100
92
  border: 1px solid #666;
101
93
  }
102
94
 
103
- .c26 {
95
+ .c22 {
104
96
  position: relative;
105
97
  font-size: 1.25rem;
106
98
  }
107
99
 
108
- .c13 {
109
- display: grid;
110
- gap: 0.5rem;
111
- background-color: #FFFFFF;
112
- box-shadow: 0px 0px 16px rgba(0,0,0,0.15);
113
- border-radius: 8px;
114
- }
115
-
116
- .c15 {
117
- margin: 0 32px 32px;
118
- }
119
-
120
- .c14 {
121
- justify-self: end;
122
- background: transparent;
123
- border: 0;
124
- cursor: pointer;
125
- margin: 17px 17px 0;
126
- width: 20px;
127
- }
128
-
129
- .c14:active,
130
- .c14:focus,
131
- .c14:hover {
132
- outline: none;
133
- border: 1px solid #969598;
134
- }
135
-
136
- .c23 {
100
+ .c19 {
137
101
  display: block;
138
102
  }
139
103
 
140
- .c23 input {
104
+ .c19 input {
141
105
  border: none;
142
106
  background-color: #BECCF9;
143
107
  color: #000000;
@@ -149,13 +113,13 @@ exports[`Monthly donation renders correctly 1`] = `
149
113
  height: auto;
150
114
  }
151
115
 
152
- .c23 input:focus {
116
+ .c19 input:focus {
153
117
  border: none;
154
118
  outline: none;
155
119
  box-shadow: inset 0 0 0 4px #0565D1;
156
120
  }
157
121
 
158
- .c23 input:active:focus {
122
+ .c19 input:active:focus {
159
123
  box-shadow: 0px 0px 16px rgba(0,0,0,0.3);
160
124
  }
161
125
 
@@ -213,7 +177,7 @@ exports[`Monthly donation renders correctly 1`] = `
213
177
  font-family: 'Montserrat',Helvetica,Arial,sans-serif;
214
178
  }
215
179
 
216
- .c17 {
180
+ .c13 {
217
181
  position: relative;
218
182
  width: 100%;
219
183
  background-color: #FFFFFF;
@@ -222,37 +186,37 @@ exports[`Monthly donation renders correctly 1`] = `
222
186
  margin-top: 1rem;
223
187
  }
224
188
 
225
- .c17 h3 {
189
+ .c13 h3 {
226
190
  margin-top: 1rem;
227
191
  }
228
192
 
229
- .c17 input {
193
+ .c13 input {
230
194
  max-width: 100%;
231
195
  margin: 0;
232
196
  }
233
197
 
234
- .c17 input[type='submit'] {
198
+ .c13 input[type='submit'] {
235
199
  margin: 2rem 0;
236
200
  }
237
201
 
238
- .c18 {
202
+ .c14 {
239
203
  padding: 0 1rem 1rem;
240
204
  margin: 0;
241
205
  border: none;
242
206
  }
243
207
 
244
- .c18 input[type='submit'] {
208
+ .c14 input[type='submit'] {
245
209
  margin-bottom: 0;
246
210
  }
247
211
 
248
- .c19 {
212
+ .c15 {
249
213
  margin: 0;
250
214
  padding: 2rem 0.5rem;
251
215
  display: block;
252
216
  width: 100%;
253
217
  }
254
218
 
255
- .c21 {
219
+ .c17 {
256
220
  display: -webkit-box;
257
221
  display: -webkit-flex;
258
222
  display: -ms-flexbox;
@@ -267,18 +231,18 @@ exports[`Monthly donation renders correctly 1`] = `
267
231
  margin-bottom: 2rem;
268
232
  }
269
233
 
270
- .c21 label {
234
+ .c17 label {
271
235
  -webkit-flex: 0 0 30%;
272
236
  -ms-flex: 0 0 30%;
273
237
  flex: 0 0 30%;
274
238
  margin-bottom: 0.5rem;
275
239
  }
276
240
 
277
- .c21 label input {
241
+ .c17 label input {
278
242
  cursor: pointer;
279
243
  }
280
244
 
281
- .c28 {
245
+ .c24 {
282
246
  display: -webkit-box;
283
247
  display: -webkit-flex;
284
248
  display: -ms-flexbox;
@@ -293,11 +257,11 @@ exports[`Monthly donation renders correctly 1`] = `
293
257
  justify-content: center;
294
258
  }
295
259
 
296
- .c30 {
260
+ .c26 {
297
261
  margin-right: 0.5rem;
298
262
  }
299
263
 
300
- .c31 {
264
+ .c27 {
301
265
  position: relative;
302
266
  -webkit-flex-basis: 50%;
303
267
  -ms-flex-preferred-size: 50%;
@@ -313,7 +277,7 @@ exports[`Monthly donation renders correctly 1`] = `
313
277
  display: block;
314
278
  }
315
279
 
316
- .c31 span {
280
+ .c27 span {
317
281
  position: absolute;
318
282
  font-size: 20px;
319
283
  top: 50%;
@@ -326,7 +290,7 @@ exports[`Monthly donation renders correctly 1`] = `
326
290
  z-index: 3;
327
291
  }
328
292
 
329
- .c31 input {
293
+ .c27 input {
330
294
  height: 48px;
331
295
  border: 2px solid #969598;
332
296
  background: #F4F3F5;
@@ -334,12 +298,12 @@ exports[`Monthly donation renders correctly 1`] = `
334
298
  padding: 0.5rem 1rem 0.5rem 2rem;
335
299
  }
336
300
 
337
- .c31 input:focus {
301
+ .c27 input:focus {
338
302
  outline: none;
339
303
  border: 2px solid #969598;
340
304
  }
341
305
 
342
- .c32 {
306
+ .c28 {
343
307
  width: 100%;
344
308
  margin: 2rem 0 2rem;
345
309
  color: #FFFFFF;
@@ -358,9 +322,9 @@ exports[`Monthly donation renders correctly 1`] = `
358
322
  appearance: none;
359
323
  }
360
324
 
361
- .c32:active,
362
- .c32:focus,
363
- .c32:hover {
325
+ .c28:active,
326
+ .c28:focus,
327
+ .c28:hover {
364
328
  outline: none;
365
329
  background-color: #961D35;
366
330
  }
@@ -527,21 +491,13 @@ exports[`Monthly donation renders correctly 1`] = `
527
491
  }
528
492
 
529
493
  @media (min-width:740px) {
530
- .c27 {
494
+ .c23 {
531
495
  max-width: 290px;
532
496
  }
533
497
  }
534
498
 
535
499
  @media (min-width:740px) {
536
- .c13 {
537
- width: 450px;
538
- margin-right: auto;
539
- margin-left: auto;
540
- }
541
- }
542
-
543
- @media (min-width:740px) {
544
- .c23 input {
500
+ .c19 input {
545
501
  font-size: 2rem;
546
502
  padding: 1.5rem;
547
503
  }
@@ -598,7 +554,7 @@ exports[`Monthly donation renders correctly 1`] = `
598
554
  }
599
555
 
600
556
  @media (min-width:740px) {
601
- .c17 {
557
+ .c13 {
602
558
  width: 450px;
603
559
  margin-right: auto;
604
560
  margin-left: auto;
@@ -606,13 +562,13 @@ exports[`Monthly donation renders correctly 1`] = `
606
562
  }
607
563
 
608
564
  @media (min-width:740px) {
609
- .c18 {
565
+ .c14 {
610
566
  padding: 0 2rem 2rem;
611
567
  }
612
568
  }
613
569
 
614
570
  @media (min-width:740px) {
615
- .c21 {
571
+ .c17 {
616
572
  -webkit-flex-direction: row;
617
573
  -ms-flex-direction: row;
618
574
  flex-direction: row;
@@ -620,13 +576,13 @@ exports[`Monthly donation renders correctly 1`] = `
620
576
  }
621
577
 
622
578
  @media (min-width:740px) {
623
- .c21 label {
579
+ .c17 label {
624
580
  margin-bottom: 0;
625
581
  }
626
582
  }
627
583
 
628
584
  @media (min-width:740px) {
629
- .c31 {
585
+ .c27 {
630
586
  -webkit-flex-basis: 60%;
631
587
  -ms-flex-preferred-size: 60%;
632
588
  flex-basis: 60%;
@@ -634,7 +590,7 @@ exports[`Monthly donation renders correctly 1`] = `
634
590
  }
635
591
 
636
592
  @media (min-width:740px) {
637
- .c32 {
593
+ .c28 {
638
594
  padding: 1rem 2rem;
639
595
  }
640
596
  }
@@ -651,6 +607,7 @@ exports[`Monthly donation renders correctly 1`] = `
651
607
  id="mship-1"
652
608
  >
653
609
  <div
610
+ aria-live="polite"
654
611
  className="c1"
655
612
  >
656
613
  <div
@@ -721,43 +678,18 @@ exports[`Monthly donation renders correctly 1`] = `
721
678
  />
722
679
  </div>
723
680
  </div>
724
- <div
725
- className="c13"
726
- >
727
- <button
728
- aria-label="Close"
729
- className="c14"
730
- onClick={[Function]}
731
- >
732
- <img
733
- alt="Close cross icon"
734
- src="mock.asset"
735
- />
736
- </button>
737
- <div
738
- className="c15"
739
- >
740
- <span
741
- className="c16"
742
- color="inherit"
743
- size="s"
744
- >
745
- Will you become one of our valued monthly supporters by converting your single donation into a smaller, monthly donation? By giving monthly, you'll help us deliver long-term impact.
746
- </span>
747
- </div>
748
- </div>
749
681
  <form
750
- className="c17"
682
+ className="c13"
751
683
  onSubmit={[Function]}
752
684
  >
753
685
  <fieldset
754
- className="c18"
686
+ className="c14"
755
687
  >
756
688
  <legend
757
- className="c19"
689
+ className="c15"
758
690
  >
759
691
  <span
760
- className="c20"
692
+ className="c16"
761
693
  color="inherit"
762
694
  size="l"
763
695
  >
@@ -765,14 +697,14 @@ exports[`Monthly donation renders correctly 1`] = `
765
697
  </span>
766
698
  </legend>
767
699
  <div
768
- className="c21"
700
+ className="c17"
769
701
  >
770
702
  <label
771
- className="c22 c23"
703
+ className="c18 c19"
772
704
  htmlFor="mship-1--moneyBuy-box1"
773
705
  >
774
706
  <span
775
- className="c24 c25"
707
+ className="c20 c21"
776
708
  color="inherit"
777
709
  dangerouslySetInnerHTML={
778
710
  Object {
@@ -782,13 +714,13 @@ exports[`Monthly donation renders correctly 1`] = `
782
714
  size="s"
783
715
  />
784
716
  <div
785
- className="c26"
717
+ className="c22"
786
718
  >
787
719
 
788
720
  <input
789
721
  aria-describedby="mship-1--moneyBuy-box1"
790
722
  aria-label="£10"
791
- className="c27"
723
+ className="c23"
792
724
  id="mship-1--moneyBuy-box1"
793
725
  name="mship-1--moneyBuy1"
794
726
  onClick={[Function]}
@@ -801,11 +733,11 @@ exports[`Monthly donation renders correctly 1`] = `
801
733
 
802
734
  </label>
803
735
  <label
804
- className="c22 c23"
736
+ className="c18 c19"
805
737
  htmlFor="mship-1--moneyBuy-box2"
806
738
  >
807
739
  <span
808
- className="c24 c25"
740
+ className="c20 c21"
809
741
  color="inherit"
810
742
  dangerouslySetInnerHTML={
811
743
  Object {
@@ -815,13 +747,13 @@ exports[`Monthly donation renders correctly 1`] = `
815
747
  size="s"
816
748
  />
817
749
  <div
818
- className="c26"
750
+ className="c22"
819
751
  >
820
752
 
821
753
  <input
822
754
  aria-describedby="mship-1--moneyBuy-box2"
823
755
  aria-label="£20"
824
- className="c27"
756
+ className="c23"
825
757
  id="mship-1--moneyBuy-box2"
826
758
  name="mship-1--moneyBuy2"
827
759
  onClick={[Function]}
@@ -834,11 +766,11 @@ exports[`Monthly donation renders correctly 1`] = `
834
766
 
835
767
  </label>
836
768
  <label
837
- className="c22 c23"
769
+ className="c18 c19"
838
770
  htmlFor="mship-1--moneyBuy-box3"
839
771
  >
840
772
  <span
841
- className="c24 c25"
773
+ className="c20 c21"
842
774
  color="inherit"
843
775
  dangerouslySetInnerHTML={
844
776
  Object {
@@ -848,13 +780,13 @@ exports[`Monthly donation renders correctly 1`] = `
848
780
  size="s"
849
781
  />
850
782
  <div
851
- className="c26"
783
+ className="c22"
852
784
  >
853
785
 
854
786
  <input
855
787
  aria-describedby="mship-1--moneyBuy-box3"
856
788
  aria-label="£30"
857
- className="c27"
789
+ className="c23"
858
790
  id="mship-1--moneyBuy-box3"
859
791
  name="mship-1--moneyBuy3"
860
792
  onClick={[Function]}
@@ -868,21 +800,21 @@ exports[`Monthly donation renders correctly 1`] = `
868
800
  </label>
869
801
  </div>
870
802
  <div
871
- className="c28"
803
+ className="c24"
872
804
  >
873
805
  <span
874
- className="c29 c30"
806
+ className="c25 c26"
875
807
  color="inherit"
876
808
  size="s"
877
809
  >
878
810
  Other amount
879
811
  </span>
880
812
  <label
881
- className="c22 c31"
813
+ className="c18 c27"
882
814
  htmlFor="mship-1--MoneyBuy-userInput"
883
815
  >
884
816
  <span
885
- className="c24 c25"
817
+ className="c20 c21"
886
818
  color="inherit"
887
819
  dangerouslySetInnerHTML={
888
820
  Object {
@@ -892,13 +824,13 @@ exports[`Monthly donation renders correctly 1`] = `
892
824
  size="s"
893
825
  />
894
826
  <div
895
- className="c26"
827
+ className="c22"
896
828
  >
897
829
 
898
830
  <input
899
831
  aria-describedby="mship-1--MoneyBuy-userInput"
900
832
  aria-label="Input a different amount"
901
- className="c27"
833
+ className="c23"
902
834
  id="mship-1--MoneyBuy-userInput"
903
835
  max="20000"
904
836
  min="1"
@@ -916,7 +848,7 @@ exports[`Monthly donation renders correctly 1`] = `
916
848
  </label>
917
849
  </div>
918
850
  <input
919
- className="c32"
851
+ className="c28"
920
852
  type="submit"
921
853
  value="Donate now"
922
854
  />
@@ -1306,10 +1238,6 @@ exports[`Single donation renders correctly 1`] = `
1306
1238
  }
1307
1239
  }
1308
1240
 
1309
- @media (min-width:740px) {
1310
-
1311
- }
1312
-
1313
1241
  @media (min-width:740px) {
1314
1242
  .c13 input {
1315
1243
  font-size: 2rem;
@@ -1425,6 +1353,7 @@ exports[`Single donation renders correctly 1`] = `
1425
1353
  id="mship-1"
1426
1354
  >
1427
1355
  <div
1356
+ aria-live="polite"
1428
1357
  className="c1"
1429
1358
  >
1430
1359
  <div
@@ -2000,6 +1929,7 @@ exports[`Single donation with no Money Buys renders correctly 1`] = `
2000
1929
  id="mship-1"
2001
1930
  >
2002
1931
  <div
1932
+ aria-live="polite"
2003
1933
  className="c1"
2004
1934
  >
2005
1935
  <div
@@ -52,7 +52,8 @@ var colors = {
52
52
  white: '#FFFFFF',
53
53
  yellow: '#FFE400',
54
54
  yellow_dark: '#665700',
55
- yellow_light: '#FEFD5A'
55
+ yellow_light: '#FEFD5A',
56
+ transparent: 'transparent'
56
57
  };
57
58
 
58
59
  var _default = function _default(colorName) {
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": "6.4.0",
4
+ "version": "6.5.0",
5
5
  "main": "dist/index.js",
6
6
  "license": "ISC",
7
7
  "jest": {
@@ -4,9 +4,9 @@ import PropTypes from 'prop-types';
4
4
 
5
5
  import { screen } from '../../../theme/shared/size';
6
6
  import Text from '../../Atoms/Text/Text';
7
+ import Picture from '../../Atoms/Picture/Picture';
7
8
  import Form from './Form/Form';
8
9
  import {
9
- MobImage,
10
10
  BgImage,
11
11
  Container,
12
12
  Header,
@@ -42,7 +42,7 @@ const Donate = ({
42
42
  return (
43
43
  <Container backgroundColor={backgroundColor} id={mbshipID}>
44
44
  {!isDesktop && mobileImages ? (
45
- <MobImage
45
+ <Picture
46
46
  backgroundColor={backgroundColor}
47
47
  image={mobileImage}
48
48
  images={mobileImages}
@@ -68,7 +68,7 @@ const Donate = ({
68
68
  />
69
69
  ) : null}
70
70
 
71
- <Wrapper formAlignRight={formAlignRight}>
71
+ <Wrapper formAlignRight={formAlignRight} aria-live="polite">
72
72
  <Header formAlignRight={formAlignRight}>
73
73
  <HeaderInner>
74
74
  {subtitle && (
@@ -148,7 +148,7 @@ Donate.defaultProps = {
148
148
  'will help us fund amazing projects in the UK and around the world.',
149
149
  subtitle: '',
150
150
  noMoneyBuys: false,
151
- PopUpText: "Will you become one of our valued monthly supporters by converting your single donation into a smaller, monthly donation? By giving monthly, you'll help us deliver long-term impact.",
151
+ PopUpText: 'Help us deliver long-term impact by converting your single donation into a monthly gift.',
152
152
  chooseAmountText: ''
153
153
  };
154
154
 
@@ -111,7 +111,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
111
111
 
112
112
  <Donate
113
113
  alt="Background image"
114
- backgroundColor="blue_dark"
114
+ backgroundColor="transparent"
115
115
  formAlignRight={true}
116
116
  imageLow={desktopPictures.imageLow}
117
117
  images={desktopPictures.images}
@@ -136,7 +136,7 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
136
136
  const desktopPictures = require('../../../styleguide/data/data').defaultData;
137
137
 
138
138
  <Donate
139
- backgroundColor="blue_dark"
139
+ backgroundColor="transparent"
140
140
  formAlignRight={false}
141
141
  imageLow={desktopPictures.imageLow}
142
142
  images={desktopPictures.images}
@@ -28,9 +28,6 @@ const PopUp = styled.div`
28
28
  height: 100px;
29
29
  `;
30
30
 
31
- const MobImage = styled(Picture)`
32
- `;
33
-
34
31
  const BgImage = styled(Picture)`
35
32
  display: block;
36
33
  position: absolute;
@@ -38,7 +35,9 @@ const BgImage = styled(Picture)`
38
35
  left: 0;
39
36
  right: 0;
40
37
  height: 100%;
41
- opacity: 0.4;
38
+ ${({ backgroundColor }) => backgroundColor !== 'transparent' && `
39
+ opacity: 0.4;
40
+ `}
42
41
  `;
43
42
 
44
43
  const Wrapper = styled.div`
@@ -236,7 +235,6 @@ const Button = styled.button`
236
235
 
237
236
  export {
238
237
  BgImage,
239
- MobImage,
240
238
  Button,
241
239
  Copy,
242
240
  Container,
@@ -116,18 +116,19 @@ const Signup = ({
116
116
  const givingData = givingType === 'single' ? singleGiving : regularGiving;
117
117
  const showGivingSelector = singleGiving !== null && regularGiving !== null;
118
118
 
119
+ const [popOpen, setPopOpen] = useState(false);
120
+
119
121
  return (
120
122
  <FormWrapper>
121
123
  {showGivingSelector && (
122
124
  <GivingSelector
123
125
  givingType={givingType}
124
126
  changeGivingType={data => setGivingType(data)}
127
+ setPopOpen={setPopOpen}
125
128
  />
126
129
  )}
127
130
 
128
- {(givingType === 'single' && showGivingSelector)
129
- && <PopUpComponent PopUpText={PopUpText} />
130
- }
131
+ { popOpen && <PopUpComponent PopUpText={PopUpText} /> }
131
132
 
132
133
  <Form
133
134
  onSubmit={e => submitDonation(