@comicrelief/component-library 6.2.0 → 6.4.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/Picture/Picture.md +6 -9
- package/dist/components/Atoms/Picture/Picture.test.js +5 -5
- package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.md +6 -8
- package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.test.js +3 -3
- package/dist/components/Molecules/Box/Box.md +5 -7
- package/dist/components/Molecules/Box/Box.test.js +3 -3
- package/dist/components/Molecules/Card/Card.md +5 -7
- package/dist/components/Molecules/Card/Card.test.js +5 -5
- package/dist/components/Molecules/CardDs/CardDs.md +8 -12
- package/dist/components/Molecules/CardDs/CardDs.test.js +3 -3
- package/dist/components/Molecules/PartnerLink/PartnerLink.md +2 -3
- package/dist/components/Molecules/PartnerLink/PartnerLink.test.js +3 -3
- package/dist/components/Molecules/Promo/Promo.md +13 -14
- package/dist/components/Molecules/Promo/Promo.test.js +5 -5
- package/dist/components/Molecules/SearchResult/SearchResult.md +12 -16
- package/dist/components/Molecules/SearchResult/SearchResult.test.js +5 -5
- package/dist/components/Molecules/SingleMessage/SingleMessage.md +37 -48
- package/dist/components/Molecules/SingleMessage/SingleMessage.test.js +15 -15
- package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.md +15 -20
- package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.test.js +3 -3
- package/dist/components/Organisms/Donate/Donate.js +38 -7
- package/dist/components/Organisms/Donate/Donate.md +149 -14
- package/dist/components/Organisms/Donate/Donate.style.js +61 -45
- package/dist/components/Organisms/Donate/Donate.test.js +9 -8
- package/dist/components/Organisms/Donate/Form/Form.js +8 -2
- package/dist/components/Organisms/Donate/Form/PopUpComponent.js +74 -0
- package/dist/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +345 -389
- package/dist/components/Organisms/Donate/assets/close.svg +3 -0
- package/dist/components/Organisms/Membership/Membership.md +6 -6
- package/dist/components/Organisms/Membership/Membership.test.js +5 -5
- package/dist/styleguide/data/data.js +9 -3
- package/package.json +2 -1
- package/src/components/Atoms/Picture/Picture.md +6 -9
- package/src/components/Atoms/Picture/Picture.test.js +4 -5
- package/src/components/Molecules/ArticleTeaser/ArticleTeaser.md +6 -8
- package/src/components/Molecules/ArticleTeaser/ArticleTeaser.test.js +3 -4
- package/src/components/Molecules/Box/Box.md +5 -7
- package/src/components/Molecules/Box/Box.test.js +2 -3
- package/src/components/Molecules/Card/Card.md +5 -7
- package/src/components/Molecules/Card/Card.test.js +3 -4
- package/src/components/Molecules/CardDs/CardDs.md +8 -12
- package/src/components/Molecules/CardDs/CardDs.test.js +3 -4
- package/src/components/Molecules/PartnerLink/PartnerLink.md +2 -3
- package/src/components/Molecules/PartnerLink/PartnerLink.test.js +2 -3
- package/src/components/Molecules/Promo/Promo.md +13 -14
- package/src/components/Molecules/Promo/Promo.test.js +5 -6
- package/src/components/Molecules/SearchResult/SearchResult.md +12 -16
- package/src/components/Molecules/SearchResult/SearchResult.test.js +5 -5
- package/src/components/Molecules/SingleMessage/SingleMessage.md +37 -48
- package/src/components/Molecules/SingleMessage/SingleMessage.test.js +15 -16
- package/src/components/Molecules/SingleMessageDS/SingleMessageDs.md +15 -20
- package/src/components/Molecules/SingleMessageDS/SingleMessageDs.test.js +3 -4
- package/src/components/Organisms/Donate/Donate.js +95 -50
- package/src/components/Organisms/Donate/Donate.md +149 -14
- package/src/components/Organisms/Donate/Donate.style.js +16 -1
- package/src/components/Organisms/Donate/Donate.test.js +8 -7
- package/src/components/Organisms/Donate/Form/Form.js +12 -2
- package/src/components/Organisms/Donate/Form/PopUpComponent.js +63 -0
- package/src/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +345 -389
- package/src/components/Organisms/Donate/assets/close.svg +3 -0
- package/src/components/Organisms/Membership/Membership.md +6 -6
- package/src/components/Organisms/Membership/Membership.test.js +9 -14
- package/src/styleguide/data/data.js +12 -1
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
# Donate
|
|
2
2
|
|
|
3
|
-
## Form align right
|
|
3
|
+
## Form align right, with red backgound on desktop view
|
|
4
4
|
|
|
5
5
|
```js
|
|
6
6
|
import data from './dev-data/data';
|
|
7
|
-
const
|
|
7
|
+
const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
8
|
+
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
8
9
|
|
|
9
10
|
<Donate
|
|
10
11
|
alt="Background image"
|
|
11
|
-
backgroundColor="
|
|
12
|
+
backgroundColor="red"
|
|
12
13
|
formAlignRight={true}
|
|
13
|
-
imageLow={
|
|
14
|
-
images={
|
|
14
|
+
imageLow={desktopPictures.imageLow}
|
|
15
|
+
images={desktopPictures.images}
|
|
16
|
+
mobileImageLow={mobilePictures.imageLow}
|
|
17
|
+
mobileImages={mobilePictures.images}
|
|
15
18
|
data={data}
|
|
16
19
|
mbshipID="mship-1"
|
|
17
20
|
donateLink="https://donation.comicrelief.com/"
|
|
@@ -27,13 +30,16 @@ const pictures = require('../../../styleguide/data/data').default;
|
|
|
27
30
|
|
|
28
31
|
```js
|
|
29
32
|
import data from './dev-data/data';
|
|
30
|
-
const
|
|
33
|
+
const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
34
|
+
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
31
35
|
|
|
32
36
|
<Donate
|
|
33
37
|
backgroundColor="blue_dark"
|
|
34
38
|
formAlignRight={false}
|
|
35
|
-
imageLow={
|
|
36
|
-
images={
|
|
39
|
+
imageLow={desktopPictures.imageLow}
|
|
40
|
+
images={desktopPictures.images}
|
|
41
|
+
mobileImageLow={mobilePictures.imageLow}
|
|
42
|
+
mobileImages={mobilePictures.images}
|
|
37
43
|
data={data}
|
|
38
44
|
mbshipID="mship-1"
|
|
39
45
|
donateLink="https://donation.comicrelief.com/"
|
|
@@ -49,13 +55,16 @@ const pictures = require('../../../styleguide/data/data').default;
|
|
|
49
55
|
|
|
50
56
|
```js
|
|
51
57
|
import data from './dev-data/data-single';
|
|
52
|
-
const
|
|
58
|
+
const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
59
|
+
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
53
60
|
|
|
54
61
|
<Donate
|
|
55
62
|
backgroundColor="blue_dark"
|
|
56
63
|
formAlignRight={false}
|
|
57
|
-
imageLow={
|
|
58
|
-
images={
|
|
64
|
+
imageLow={desktopPictures.imageLow}
|
|
65
|
+
images={desktopPictures.images}
|
|
66
|
+
mobileImageLow={mobilePictures.imageLow}
|
|
67
|
+
mobileImages={mobilePictures.images}
|
|
59
68
|
data={data}
|
|
60
69
|
mbshipID="mship-1"
|
|
61
70
|
donateLink="https://donation.comicrelief.com/"
|
|
@@ -71,13 +80,16 @@ const pictures = require('../../../styleguide/data/data').default;
|
|
|
71
80
|
|
|
72
81
|
```js
|
|
73
82
|
import data from './dev-data/data-single';
|
|
74
|
-
const
|
|
83
|
+
const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
84
|
+
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
75
85
|
|
|
76
86
|
<Donate
|
|
77
87
|
backgroundColor="blue_dark"
|
|
78
88
|
formAlignRight={false}
|
|
79
|
-
imageLow={
|
|
80
|
-
images={
|
|
89
|
+
imageLow={desktopPictures.imageLow}
|
|
90
|
+
images={desktopPictures.images}
|
|
91
|
+
mobileImageLow={mobilePictures.imageLow}
|
|
92
|
+
mobileImages={mobilePictures.images}
|
|
81
93
|
data={data}
|
|
82
94
|
mbshipID="mship-1"
|
|
83
95
|
donateLink="https://donation.comicrelief.com/"
|
|
@@ -89,3 +101,126 @@ const pictures = require('../../../styleguide/data/data').default;
|
|
|
89
101
|
otherDescription="will help us fund amazing projects in the UK and around the world."
|
|
90
102
|
/>;
|
|
91
103
|
```
|
|
104
|
+
|
|
105
|
+
## Form align right - no subtitle
|
|
106
|
+
|
|
107
|
+
```js
|
|
108
|
+
import data from './dev-data/data';
|
|
109
|
+
const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
110
|
+
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
111
|
+
|
|
112
|
+
<Donate
|
|
113
|
+
alt="Background image"
|
|
114
|
+
backgroundColor="blue_dark"
|
|
115
|
+
formAlignRight={true}
|
|
116
|
+
imageLow={desktopPictures.imageLow}
|
|
117
|
+
images={desktopPictures.images}
|
|
118
|
+
mobileImageLow={mobilePictures.imageLow}
|
|
119
|
+
mobileImages={mobilePictures.images}
|
|
120
|
+
data={data}
|
|
121
|
+
mbshipID="mship-1"
|
|
122
|
+
donateLink="https://donation.comicrelief.com/"
|
|
123
|
+
clientID="donate"
|
|
124
|
+
cartID="default-comicrelief"
|
|
125
|
+
title="Donate Now"
|
|
126
|
+
subtitle=""
|
|
127
|
+
otherDescription="will help us fund amazing projects in the UK and around the world."
|
|
128
|
+
/>;
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Form align left - no subtitle
|
|
132
|
+
|
|
133
|
+
```js
|
|
134
|
+
import data from './dev-data/data';
|
|
135
|
+
const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
136
|
+
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
137
|
+
|
|
138
|
+
<Donate
|
|
139
|
+
backgroundColor="blue_dark"
|
|
140
|
+
formAlignRight={false}
|
|
141
|
+
imageLow={desktopPictures.imageLow}
|
|
142
|
+
images={desktopPictures.images}
|
|
143
|
+
mobileImageLow={mobilePictures.imageLow}
|
|
144
|
+
mobileImages={mobilePictures.images}
|
|
145
|
+
data={data}
|
|
146
|
+
mbshipID="mship-1"
|
|
147
|
+
donateLink="https://donation.comicrelief.com/"
|
|
148
|
+
clientID="donate"
|
|
149
|
+
cartID="default-comicrelief"
|
|
150
|
+
title="Donate Now"
|
|
151
|
+
subtitle=""
|
|
152
|
+
otherDescription="will help us fund amazing projects in the UK and around the world."
|
|
153
|
+
/>;
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Single Giving - no subtitle
|
|
157
|
+
|
|
158
|
+
```js
|
|
159
|
+
import data from './dev-data/data-single';
|
|
160
|
+
const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
161
|
+
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
162
|
+
|
|
163
|
+
<Donate
|
|
164
|
+
backgroundColor="blue_dark"
|
|
165
|
+
formAlignRight={false}
|
|
166
|
+
imageLow={desktopPictures.imageLow}
|
|
167
|
+
images={desktopPictures.images}
|
|
168
|
+
mobileImageLow={mobilePictures.imageLow}
|
|
169
|
+
mobileImages={mobilePictures.images}
|
|
170
|
+
data={data}
|
|
171
|
+
mbshipID="mship-1"
|
|
172
|
+
donateLink="https://donation.comicrelief.com/"
|
|
173
|
+
clientID="donate"
|
|
174
|
+
cartID="default-comicrelief"
|
|
175
|
+
title="Donate Now"
|
|
176
|
+
subtitle=""
|
|
177
|
+
otherDescription="will help us fund amazing projects in the UK and around the world."
|
|
178
|
+
/>;
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Single Giving "No Money Buys"
|
|
182
|
+
|
|
183
|
+
```js
|
|
184
|
+
import data from './dev-data/data-single';
|
|
185
|
+
const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
186
|
+
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
187
|
+
|
|
188
|
+
<Donate
|
|
189
|
+
backgroundColor="blue_dark"
|
|
190
|
+
formAlignRight={false}
|
|
191
|
+
imageLow={desktopPictures.imageLow}
|
|
192
|
+
images={desktopPictures.images}
|
|
193
|
+
mobileImageLow={mobilePictures.imageLow}
|
|
194
|
+
mobileImages={mobilePictures.images}
|
|
195
|
+
data={data}
|
|
196
|
+
mbshipID="mship-1"
|
|
197
|
+
donateLink="https://donation.comicrelief.com/"
|
|
198
|
+
clientID="donate"
|
|
199
|
+
cartID="default-comicrelief"
|
|
200
|
+
title="Donate Now"
|
|
201
|
+
noMoneyBuys
|
|
202
|
+
subtitle=""
|
|
203
|
+
otherDescription="will help us fund amazing projects in the UK and around the world."
|
|
204
|
+
/>;
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Single Giving "No Money Buys", no background image, overriding 'choose amount' text
|
|
208
|
+
|
|
209
|
+
```js
|
|
210
|
+
import data from './dev-data/data-single';
|
|
211
|
+
|
|
212
|
+
<Donate
|
|
213
|
+
backgroundColor="blue_dark"
|
|
214
|
+
formAlignRight={false}
|
|
215
|
+
data={data}
|
|
216
|
+
mbshipID="mship-1"
|
|
217
|
+
donateLink="https://donation.comicrelief.com/"
|
|
218
|
+
clientID="donate"
|
|
219
|
+
cartID="default-comicrelief"
|
|
220
|
+
title="Donate Now"
|
|
221
|
+
noMoneyBuys
|
|
222
|
+
subtitle=""
|
|
223
|
+
otherDescription="will help us fund amazing projects in the UK and around the world."
|
|
224
|
+
chooseAmountText="Overridden via the 'choose amount text' props"
|
|
225
|
+
/>;
|
|
226
|
+
```
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.Legend = exports.OuterFieldset = exports.AmountField = exports.MoneyBuys = exports.Form = exports.Wrapper = exports.Label = exports.HeaderInner = exports.Header = exports.FormWrapper = exports.FormFieldset = exports.Error = exports.Container = exports.Copy = exports.Button = exports.BgImage = void 0;
|
|
8
|
+
exports.Legend = exports.OuterFieldset = exports.AmountField = exports.MoneyBuys = exports.Form = exports.Wrapper = exports.Label = exports.HeaderInner = exports.Header = exports.FormWrapper = exports.FormFieldset = exports.Error = exports.PopUp = exports.Container = exports.Copy = exports.Button = exports.MobImage = exports.BgImage = void 0;
|
|
9
9
|
|
|
10
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
11
|
|
|
@@ -21,27 +21,43 @@ var _Picture = _interopRequireDefault(require("../../Atoms/Picture/Picture"));
|
|
|
21
21
|
|
|
22
22
|
var _zIndex = _interopRequireDefault(require("../../../theme/shared/zIndex"));
|
|
23
23
|
|
|
24
|
+
// import styled, { css } from 'styled-components';
|
|
24
25
|
var Container = _styledComponents.default.div.withConfig({
|
|
25
26
|
displayName: "Donatestyle__Container",
|
|
26
27
|
componentId: "sc-8rjm3t-0"
|
|
27
|
-
})(["
|
|
28
|
-
var theme = _ref.theme
|
|
29
|
-
|
|
28
|
+
})(["position:relative;display:flex;flex-direction:column;justify-content:center;height:auto;background-color:", ";", "{flex-direction:row;align-items:center;justify-content:inherit;background-color:", ";}"], function (_ref) {
|
|
29
|
+
var theme = _ref.theme;
|
|
30
|
+
return theme.color('blue_dark');
|
|
31
|
+
}, (0, _size.media)('medium'), function (_ref2) {
|
|
32
|
+
var theme = _ref2.theme,
|
|
33
|
+
backgroundColor = _ref2.backgroundColor;
|
|
30
34
|
return theme.color(backgroundColor);
|
|
31
|
-
}
|
|
35
|
+
});
|
|
32
36
|
|
|
33
37
|
exports.Container = Container;
|
|
38
|
+
|
|
39
|
+
var PopUp = _styledComponents.default.div.withConfig({
|
|
40
|
+
displayName: "Donatestyle__PopUp",
|
|
41
|
+
componentId: "sc-8rjm3t-1"
|
|
42
|
+
})(["background:green;height:100px;"]);
|
|
43
|
+
|
|
44
|
+
exports.PopUp = PopUp;
|
|
45
|
+
var MobImage = (0, _styledComponents.default)(_Picture.default).withConfig({
|
|
46
|
+
displayName: "Donatestyle__MobImage",
|
|
47
|
+
componentId: "sc-8rjm3t-2"
|
|
48
|
+
})([""]);
|
|
49
|
+
exports.MobImage = MobImage;
|
|
34
50
|
var BgImage = (0, _styledComponents.default)(_Picture.default).withConfig({
|
|
35
51
|
displayName: "Donatestyle__BgImage",
|
|
36
|
-
componentId: "sc-8rjm3t-
|
|
37
|
-
})(["position:absolute;bottom:0;left:0;right:0;height:100%;opacity:0.4;"]);
|
|
52
|
+
componentId: "sc-8rjm3t-3"
|
|
53
|
+
})(["display:block;position:absolute;bottom:0;left:0;right:0;height:100%;opacity:0.4;"]);
|
|
38
54
|
exports.BgImage = BgImage;
|
|
39
55
|
|
|
40
56
|
var Wrapper = _styledComponents.default.div.withConfig({
|
|
41
57
|
displayName: "Donatestyle__Wrapper",
|
|
42
|
-
componentId: "sc-8rjm3t-
|
|
43
|
-
})(["position:relative;text-align:center;padding:", " ", ";flex-direction:row;align-items:center;display:block;width:100%;flex-direction:", ";", "{padding:", " ", ";}", "{display:flex;padding:", " 0;}"], (0, _spacing.default)('l'), (0, _spacing.default)('md'), function (
|
|
44
|
-
var formAlignRight =
|
|
58
|
+
componentId: "sc-8rjm3t-4"
|
|
59
|
+
})(["position:relative;text-align:center;padding:", " ", ";flex-direction:row;align-items:center;display:block;width:100%;flex-direction:", ";", "{padding:", " ", ";}", "{display:flex;padding:", " 0;}"], (0, _spacing.default)('l'), (0, _spacing.default)('md'), function (_ref3) {
|
|
60
|
+
var formAlignRight = _ref3.formAlignRight;
|
|
45
61
|
return formAlignRight === true ? 'row-reverse' : 'row';
|
|
46
62
|
}, (0, _size.media)('small'), (0, _spacing.default)('xl'), (0, _spacing.default)('md'), (0, _size.media)('medium'), (0, _spacing.default)('xl'));
|
|
47
63
|
|
|
@@ -49,9 +65,9 @@ exports.Wrapper = Wrapper;
|
|
|
49
65
|
|
|
50
66
|
var Header = _styledComponents.default.div.withConfig({
|
|
51
67
|
displayName: "Donatestyle__Header",
|
|
52
|
-
componentId: "sc-8rjm3t-
|
|
53
|
-
})(["width:100%;display:flex;font-family:", ";", "{width:50%;padding:", ";align-items:center;}"], function (
|
|
54
|
-
var theme =
|
|
68
|
+
componentId: "sc-8rjm3t-5"
|
|
69
|
+
})(["width:100%;display:flex;font-family:", ";", "{width:50%;padding:", ";align-items:center;}"], function (_ref4) {
|
|
70
|
+
var theme = _ref4.theme;
|
|
55
71
|
return theme.fontFamilies(theme.font.regular);
|
|
56
72
|
}, (0, _size.media)('medium'), (0, _spacing.default)('xl'));
|
|
57
73
|
|
|
@@ -59,37 +75,37 @@ exports.Header = Header;
|
|
|
59
75
|
|
|
60
76
|
var HeaderInner = _styledComponents.default.div.withConfig({
|
|
61
77
|
displayName: "Donatestyle__HeaderInner",
|
|
62
|
-
componentId: "sc-8rjm3t-
|
|
78
|
+
componentId: "sc-8rjm3t-6"
|
|
63
79
|
})(["position:relative;text-align:left;"]);
|
|
64
80
|
|
|
65
81
|
exports.HeaderInner = HeaderInner;
|
|
66
82
|
|
|
67
83
|
var FormWrapper = _styledComponents.default.div.withConfig({
|
|
68
84
|
displayName: "Donatestyle__FormWrapper",
|
|
69
|
-
componentId: "sc-8rjm3t-
|
|
70
|
-
})(["position:relative;font-family:", ";", "{width:50%;}"], function (
|
|
71
|
-
var theme =
|
|
85
|
+
componentId: "sc-8rjm3t-7"
|
|
86
|
+
})(["position:relative;font-family:", ";", "{width:50%;}"], function (_ref5) {
|
|
87
|
+
var theme = _ref5.theme;
|
|
72
88
|
return theme.fontFamilies(theme.font.regular);
|
|
73
89
|
}, (0, _size.media)('medium'));
|
|
74
90
|
|
|
75
91
|
exports.FormWrapper = FormWrapper;
|
|
76
92
|
var Error = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
77
93
|
displayName: "Donatestyle__Error",
|
|
78
|
-
componentId: "sc-8rjm3t-
|
|
79
|
-
})(["color:", ";font-size:", ";font-weight:500;margin-top:", ";"], function (
|
|
80
|
-
var theme = _ref5.theme;
|
|
81
|
-
return theme.color('red');
|
|
82
|
-
}, function (_ref6) {
|
|
94
|
+
componentId: "sc-8rjm3t-8"
|
|
95
|
+
})(["color:", ";font-size:", ";font-weight:500;margin-top:", ";"], function (_ref6) {
|
|
83
96
|
var theme = _ref6.theme;
|
|
97
|
+
return theme.color('red');
|
|
98
|
+
}, function (_ref7) {
|
|
99
|
+
var theme = _ref7.theme;
|
|
84
100
|
return theme.fontSize('s');
|
|
85
101
|
}, (0, _spacing.default)('l'));
|
|
86
102
|
exports.Error = Error;
|
|
87
103
|
|
|
88
104
|
var Form = _styledComponents.default.form.withConfig({
|
|
89
105
|
displayName: "Donatestyle__Form",
|
|
90
|
-
componentId: "sc-8rjm3t-
|
|
91
|
-
})(["position:relative;width:100%;background-color:", ";box-shadow:0px 0px 16px rgba(0,0,0,0.15);border-radius:10px;margin-top:", ";h3{margin-top:", ";}input{max-width:100%;margin:0;}input[type='submit']{margin:", " 0;}", "{width:450px;margin-right:auto;margin-left:auto;}"], function (
|
|
92
|
-
var theme =
|
|
106
|
+
componentId: "sc-8rjm3t-9"
|
|
107
|
+
})(["position:relative;width:100%;background-color:", ";box-shadow:0px 0px 16px rgba(0,0,0,0.15);border-radius:10px;margin-top:", ";h3{margin-top:", ";}input{max-width:100%;margin:0;}input[type='submit']{margin:", " 0;}", "{width:450px;margin-right:auto;margin-left:auto;}"], function (_ref8) {
|
|
108
|
+
var theme = _ref8.theme;
|
|
93
109
|
return theme.color('white');
|
|
94
110
|
}, (0, _spacing.default)('md'), (0, _spacing.default)('md'), (0, _spacing.default)('l'), (0, _size.media)('small'));
|
|
95
111
|
|
|
@@ -97,70 +113,70 @@ exports.Form = Form;
|
|
|
97
113
|
|
|
98
114
|
var OuterFieldset = _styledComponents.default.fieldset.withConfig({
|
|
99
115
|
displayName: "Donatestyle__OuterFieldset",
|
|
100
|
-
componentId: "sc-8rjm3t-
|
|
116
|
+
componentId: "sc-8rjm3t-10"
|
|
101
117
|
})(["padding:0 ", " ", ";margin:0;border:none;", "{padding:0 ", " ", ";}input[type='submit']{margin-bottom:0;}"], (0, _spacing.default)('md'), (0, _spacing.default)('md'), (0, _size.media)('small'), (0, _spacing.default)('l'), (0, _spacing.default)('l'));
|
|
102
118
|
|
|
103
119
|
exports.OuterFieldset = OuterFieldset;
|
|
104
120
|
|
|
105
121
|
var Legend = _styledComponents.default.legend.withConfig({
|
|
106
122
|
displayName: "Donatestyle__Legend",
|
|
107
|
-
componentId: "sc-8rjm3t-
|
|
123
|
+
componentId: "sc-8rjm3t-11"
|
|
108
124
|
})(["margin:0;padding:", " ", ";display:block;width:100%;"], (0, _spacing.default)('l'), (0, _spacing.default)('sm'));
|
|
109
125
|
|
|
110
126
|
exports.Legend = Legend;
|
|
111
127
|
|
|
112
128
|
var MoneyBuys = _styledComponents.default.div.withConfig({
|
|
113
129
|
displayName: "Donatestyle__MoneyBuys",
|
|
114
|
-
componentId: "sc-8rjm3t-
|
|
130
|
+
componentId: "sc-8rjm3t-12"
|
|
115
131
|
})(["display:flex;justify-content:space-between;flex-direction:column;margin-bottom:", ";", "{flex-direction:row;}label{flex:0 0 30%;margin-bottom:", ";", "{margin-bottom:0;}input{cursor:pointer;}}"], (0, _spacing.default)('l'), (0, _size.media)('small'), (0, _spacing.default)('sm'), (0, _size.media)('small'));
|
|
116
132
|
|
|
117
133
|
exports.MoneyBuys = MoneyBuys;
|
|
118
134
|
|
|
119
135
|
var FormFieldset = _styledComponents.default.div.withConfig({
|
|
120
136
|
displayName: "Donatestyle__FormFieldset",
|
|
121
|
-
componentId: "sc-8rjm3t-
|
|
137
|
+
componentId: "sc-8rjm3t-13"
|
|
122
138
|
})(["display:flex;align-items:center;justify-content:center;"]);
|
|
123
139
|
|
|
124
140
|
exports.FormFieldset = FormFieldset;
|
|
125
141
|
var Label = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
126
142
|
displayName: "Donatestyle__Label",
|
|
127
|
-
componentId: "sc-8rjm3t-
|
|
143
|
+
componentId: "sc-8rjm3t-14"
|
|
128
144
|
})(["margin-right:", ";"], (0, _spacing.default)('sm'));
|
|
129
145
|
exports.Label = Label;
|
|
130
146
|
var AmountField = (0, _styledComponents.default)(_Input.default).withConfig({
|
|
131
147
|
displayName: "Donatestyle__AmountField",
|
|
132
|
-
componentId: "sc-8rjm3t-
|
|
133
|
-
})(["position:relative;flex-basis:50%;flex-shrink:0;flex-grow:0;font-weight:400;display:block;", "{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:2px solid ", ";background:", ";border-radius:10px;padding:", " ", " ", " ", ";&:focus{outline:none;border:2px solid ", ";}}"], (0, _size.media)('small'), (0, _zIndex.default)('high'), function (
|
|
134
|
-
var theme = _ref8.theme;
|
|
135
|
-
return theme.color('grey');
|
|
136
|
-
}, function (_ref9) {
|
|
148
|
+
componentId: "sc-8rjm3t-15"
|
|
149
|
+
})(["position:relative;flex-basis:50%;flex-shrink:0;flex-grow:0;font-weight:400;display:block;", "{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:2px solid ", ";background:", ";border-radius:10px;padding:", " ", " ", " ", ";&:focus{outline:none;border:2px solid ", ";}}"], (0, _size.media)('small'), (0, _zIndex.default)('high'), function (_ref9) {
|
|
137
150
|
var theme = _ref9.theme;
|
|
138
|
-
return theme.color('
|
|
139
|
-
},
|
|
151
|
+
return theme.color('grey');
|
|
152
|
+
}, function (_ref10) {
|
|
140
153
|
var theme = _ref10.theme;
|
|
154
|
+
return theme.color('grey_light');
|
|
155
|
+
}, (0, _spacing.default)('sm'), (0, _spacing.default)('md'), (0, _spacing.default)('sm'), (0, _spacing.default)('l'), function (_ref11) {
|
|
156
|
+
var theme = _ref11.theme;
|
|
141
157
|
return theme.color('grey');
|
|
142
158
|
});
|
|
143
159
|
exports.AmountField = AmountField;
|
|
144
160
|
var Copy = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
145
161
|
displayName: "Donatestyle__Copy",
|
|
146
|
-
componentId: "sc-8rjm3t-
|
|
162
|
+
componentId: "sc-8rjm3t-16"
|
|
147
163
|
})(["line-height:1.5;margin-top:", ";"], (0, _spacing.default)('l'));
|
|
148
164
|
exports.Copy = Copy;
|
|
149
165
|
|
|
150
166
|
var Button = _styledComponents.default.button.withConfig({
|
|
151
167
|
displayName: "Donatestyle__Button",
|
|
152
|
-
componentId: "sc-8rjm3t-
|
|
153
|
-
})(["width:100%;margin:", " 0 ", ";color:", ";font-size:", ";font-weight:bold;cursor:pointer;min-height:48px;background:", ";text-decoration:none;border-radius:2rem;border:none;box-shadow:0px 0px 16px rgba(0,0,0,0.15);appearance:none;:active,:focus,:hover{outline:none;background-color:", ";}", "{padding:", " ", ";}"], (0, _spacing.default)('l'), (0, _spacing.default)('l'), function (
|
|
154
|
-
var theme = _ref11.theme;
|
|
155
|
-
return theme.color('white');
|
|
156
|
-
}, function (_ref12) {
|
|
168
|
+
componentId: "sc-8rjm3t-17"
|
|
169
|
+
})(["width:100%;margin:", " 0 ", ";color:", ";font-size:", ";font-weight:bold;cursor:pointer;min-height:48px;background:", ";text-decoration:none;border-radius:2rem;border:none;box-shadow:0px 0px 16px rgba(0,0,0,0.15);appearance:none;:active,:focus,:hover{outline:none;background-color:", ";}", "{padding:", " ", ";}"], (0, _spacing.default)('l'), (0, _spacing.default)('l'), function (_ref12) {
|
|
157
170
|
var theme = _ref12.theme;
|
|
158
|
-
return theme.
|
|
171
|
+
return theme.color('white');
|
|
159
172
|
}, function (_ref13) {
|
|
160
173
|
var theme = _ref13.theme;
|
|
161
|
-
return theme.
|
|
174
|
+
return theme.fontSize('s');
|
|
162
175
|
}, function (_ref14) {
|
|
163
176
|
var theme = _ref14.theme;
|
|
177
|
+
return theme.color('red');
|
|
178
|
+
}, function (_ref15) {
|
|
179
|
+
var theme = _ref15.theme;
|
|
164
180
|
return theme.color('coral_dark');
|
|
165
181
|
}, (0, _size.media)('small'), (0, _spacing.default)('md'), (0, _spacing.default)('l'));
|
|
166
182
|
|
|
@@ -14,15 +14,15 @@ var _data = _interopRequireDefault(require("./dev-data/data"));
|
|
|
14
14
|
|
|
15
15
|
var _dataSingle = _interopRequireDefault(require("./dev-data/data-single"));
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var defaultData = require('../../../styleguide/data/data').defaultData;
|
|
18
18
|
|
|
19
19
|
it('Monthly donation renders correctly', function () {
|
|
20
20
|
var tree = (0, _shallowWithTheme.default)( /*#__PURE__*/_react.default.createElement(_Donate.default, {
|
|
21
21
|
alt: "Background image",
|
|
22
22
|
backgroundColor: "blue_dark",
|
|
23
23
|
formAlignRight: true,
|
|
24
|
-
imageLow: pictures.imageLow,
|
|
25
|
-
images: pictures.images,
|
|
24
|
+
imageLow: defaultData.pictures.imageLow,
|
|
25
|
+
images: defaultData.pictures.images,
|
|
26
26
|
data: _data.default,
|
|
27
27
|
mbshipID: "mship-1",
|
|
28
28
|
donateLink: "https://donation.comicrelief.com/",
|
|
@@ -38,8 +38,8 @@ it('Single donation renders correctly', function () {
|
|
|
38
38
|
var tree = (0, _shallowWithTheme.default)( /*#__PURE__*/_react.default.createElement(_Donate.default, {
|
|
39
39
|
backgroundColor: "blue_dark",
|
|
40
40
|
formAlignRight: false,
|
|
41
|
-
imageLow: pictures.imageLow,
|
|
42
|
-
images: pictures.images,
|
|
41
|
+
imageLow: defaultData.pictures.imageLow,
|
|
42
|
+
images: defaultData.pictures.images,
|
|
43
43
|
data: _dataSingle.default,
|
|
44
44
|
mbshipID: "mship-1",
|
|
45
45
|
donateLink: "https://donation.comicrelief.com/",
|
|
@@ -55,8 +55,8 @@ it('Single donation with no Money Buys renders correctly', function () {
|
|
|
55
55
|
var tree = (0, _shallowWithTheme.default)( /*#__PURE__*/_react.default.createElement(_Donate.default, {
|
|
56
56
|
backgroundColor: "blue_dark",
|
|
57
57
|
formAlignRight: false,
|
|
58
|
-
imageLow: pictures.imageLow,
|
|
59
|
-
images: pictures.images,
|
|
58
|
+
imageLow: defaultData.pictures.imageLow,
|
|
59
|
+
images: defaultData.pictures.images,
|
|
60
60
|
data: _dataSingle.default,
|
|
61
61
|
mbshipID: "mship-1",
|
|
62
62
|
donateLink: "https://donation.comicrelief.com/",
|
|
@@ -65,7 +65,8 @@ it('Single donation with no Money Buys renders correctly', function () {
|
|
|
65
65
|
title: "Donate Now",
|
|
66
66
|
noMoneyBuys: true,
|
|
67
67
|
subtitle: "Please help us fund life-changing projects in the UK and around the world.",
|
|
68
|
-
otherDescription: "will help us fund amazing projects in the UK and around the world."
|
|
68
|
+
otherDescription: "will help us fund amazing projects in the UK and around the world.",
|
|
69
|
+
chooseAmountText: "Overridden via the 'choose amount text' props"
|
|
69
70
|
})).toJSON();
|
|
70
71
|
expect(tree).toMatchSnapshot();
|
|
71
72
|
});
|
|
@@ -13,6 +13,8 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
13
13
|
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
15
|
|
|
16
|
+
var _PopUpComponent = _interopRequireDefault(require("./PopUpComponent"));
|
|
17
|
+
|
|
16
18
|
var _Text = _interopRequireDefault(require("../../../Atoms/Text/Text"));
|
|
17
19
|
|
|
18
20
|
var _MoneyBox = _interopRequireDefault(require("../MoneyBox/MoneyBox"));
|
|
@@ -23,7 +25,7 @@ var _Donate = require("../Donate.style");
|
|
|
23
25
|
|
|
24
26
|
var _GivingSelector = _interopRequireDefault(require("../GivingSelector/GivingSelector"));
|
|
25
27
|
|
|
26
|
-
var _excluded = ["data", "donateLink", "otherDescription", "clientID", "cartID", "mbshipID", "noMoneyBuys"];
|
|
28
|
+
var _excluded = ["data", "donateLink", "otherDescription", "clientID", "cartID", "mbshipID", "noMoneyBuys", "PopUpText", "chooseAmountText"];
|
|
27
29
|
|
|
28
30
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
31
|
|
|
@@ -39,6 +41,8 @@ var Signup = function Signup(_ref) {
|
|
|
39
41
|
cartID = _ref.cartID,
|
|
40
42
|
mbshipID = _ref.mbshipID,
|
|
41
43
|
noMoneyBuys = _ref.noMoneyBuys,
|
|
44
|
+
PopUpText = _ref.PopUpText,
|
|
45
|
+
chooseAmountText = _ref.chooseAmountText,
|
|
42
46
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
43
47
|
|
|
44
48
|
var _useState = (0, _react.useState)('single'),
|
|
@@ -108,6 +112,8 @@ var Signup = function Signup(_ref) {
|
|
|
108
112
|
changeGivingType: function changeGivingType(data) {
|
|
109
113
|
return setGivingType(data);
|
|
110
114
|
}
|
|
115
|
+
}), givingType === 'single' && showGivingSelector && /*#__PURE__*/_react.default.createElement(_PopUpComponent.default, {
|
|
116
|
+
PopUpText: PopUpText
|
|
111
117
|
}), /*#__PURE__*/_react.default.createElement(_Donate.Form, {
|
|
112
118
|
onSubmit: function onSubmit(e) {
|
|
113
119
|
return submitDonation(e, amountDonate, clientID, cartID, mbshipID, donateLink);
|
|
@@ -116,7 +122,7 @@ var Signup = function Signup(_ref) {
|
|
|
116
122
|
tag: "span",
|
|
117
123
|
size: "l",
|
|
118
124
|
weight: "bold"
|
|
119
|
-
}, "".concat(noMoneyBuys ? 'Enter' : 'Choose', " an amount to give"))), !noMoneyBuys && /*#__PURE__*/_react.default.createElement(_Donate.MoneyBuys, null, givingData.moneybuys.map(function (_ref2, index) {
|
|
125
|
+
}, chooseAmountText || "".concat(noMoneyBuys ? 'Enter' : 'Choose', " an amount to give"))), !noMoneyBuys && /*#__PURE__*/_react.default.createElement(_Donate.MoneyBuys, null, givingData.moneybuys.map(function (_ref2, index) {
|
|
120
126
|
var value = _ref2.value;
|
|
121
127
|
return /*#__PURE__*/_react.default.createElement(_MoneyBox.default, {
|
|
122
128
|
isSelected: amountDonate === value,
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
|
|
14
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
+
|
|
16
|
+
var _Text = _interopRequireDefault(require("../../../Atoms/Text/Text"));
|
|
17
|
+
|
|
18
|
+
var _spacing = _interopRequireDefault(require("../../../../theme/shared/spacing"));
|
|
19
|
+
|
|
20
|
+
var _size = require("../../../../theme/shared/size");
|
|
21
|
+
|
|
22
|
+
var _close = _interopRequireDefault(require("../assets/close.svg"));
|
|
23
|
+
|
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
+
|
|
26
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
|
|
28
|
+
/* eslint-disable */
|
|
29
|
+
var StyledPopUp = _styledComponents.default.div.withConfig({
|
|
30
|
+
displayName: "PopUpComponent__StyledPopUp",
|
|
31
|
+
componentId: "sc-1d7imlo-0"
|
|
32
|
+
})(["display:", ";gap:", ";background-color:", ";box-shadow:0px 0px 16px rgba(0,0,0,0.15);border-radius:8px;", "{width:450px;margin-right:auto;margin-left:auto;}"], function (props) {
|
|
33
|
+
return props.isPop ? "grid" : "none";
|
|
34
|
+
}, (0, _spacing.default)('sm'), function (_ref) {
|
|
35
|
+
var theme = _ref.theme;
|
|
36
|
+
return theme.color('white');
|
|
37
|
+
}, (0, _size.media)('small'));
|
|
38
|
+
|
|
39
|
+
var TextWrapper = _styledComponents.default.div.withConfig({
|
|
40
|
+
displayName: "PopUpComponent__TextWrapper",
|
|
41
|
+
componentId: "sc-1d7imlo-1"
|
|
42
|
+
})(["margin:0 32px 32px;"]);
|
|
43
|
+
|
|
44
|
+
var Button = _styledComponents.default.button.withConfig({
|
|
45
|
+
displayName: "PopUpComponent__Button",
|
|
46
|
+
componentId: "sc-1d7imlo-2"
|
|
47
|
+
})(["justify-self:end;background:transparent;border:0;cursor:pointer;:active,:focus,:hover{outline:none;border:1px solid ", ";}margin:17px 17px 0;width:20px;"], function (_ref2) {
|
|
48
|
+
var theme = _ref2.theme;
|
|
49
|
+
return theme.color('grey');
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
var PopUpComponent = function PopUpComponent(_ref3) {
|
|
53
|
+
var PopUpText = _ref3.PopUpText;
|
|
54
|
+
|
|
55
|
+
var _useState = (0, _react.useState)(true),
|
|
56
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
57
|
+
isPop = _useState2[0],
|
|
58
|
+
setIsPop = _useState2[1];
|
|
59
|
+
|
|
60
|
+
return /*#__PURE__*/_react.default.createElement(StyledPopUp, {
|
|
61
|
+
isPop: isPop
|
|
62
|
+
}, /*#__PURE__*/_react.default.createElement(Button, {
|
|
63
|
+
onClick: function onClick() {
|
|
64
|
+
return setIsPop(false);
|
|
65
|
+
},
|
|
66
|
+
"aria-label": "Close"
|
|
67
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
68
|
+
src: _close.default,
|
|
69
|
+
alt: "Close cross icon"
|
|
70
|
+
})), /*#__PURE__*/_react.default.createElement(TextWrapper, null, /*#__PURE__*/_react.default.createElement(_Text.default, null, PopUpText)));
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
var _default = PopUpComponent;
|
|
74
|
+
exports.default = _default;
|