@comicrelief/component-library 6.10.0 → 7.0.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.
Files changed (56) hide show
  1. package/cypress/integration/components/Organisms/Donate.spec.js +13 -13
  2. package/cypress/integration/components/Organisms/EmailSignUp.spec.js +47 -132
  3. package/dist/components/Organisms/Donate/Donate.md +9 -9
  4. package/dist/components/Organisms/Donate/Form/Form.js +2 -1
  5. package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.js +17 -71
  6. package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.style.js +71 -0
  7. package/dist/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +11 -25
  8. package/dist/components/Organisms/EmailSignUp/EmailSignUp.md +8 -123
  9. package/dist/components/Organisms/EmailSignUp/EmailSignUp.style.js +46 -29
  10. package/dist/components/Organisms/EmailSignUp/EmailSignUp.test.js +24 -69
  11. package/dist/components/Organisms/EmailSignUp/EmailSignUpForm.js +92 -0
  12. package/dist/components/Organisms/EmailSignUp/_Confetti.js +116 -0
  13. package/dist/components/Organisms/EmailSignUp/_EmailSignUp.js +107 -0
  14. package/dist/components/Organisms/EmailSignUp/_EmailSignUpConfig.js +51 -0
  15. package/dist/components/Organisms/EmailSignUp/_TextInput.js +51 -0
  16. package/dist/components/Organisms/EmailSignUp/__snapshots__/EmailSignUp.test.js.snap +249 -406
  17. package/dist/components/Organisms/Header/Header.md +1 -13
  18. package/dist/components/Organisms/Membership/Membership.test.js +1 -1
  19. package/dist/index.js +14 -10
  20. package/package.json +2 -1
  21. package/src/components/Organisms/Donate/Donate.md +9 -9
  22. package/src/components/Organisms/Donate/Form/Form.js +1 -0
  23. package/src/components/Organisms/Donate/GivingSelector/GivingSelector.js +15 -85
  24. package/src/components/Organisms/Donate/GivingSelector/GivingSelector.style.js +78 -0
  25. package/src/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +11 -25
  26. package/src/components/Organisms/EmailSignUp/EmailSignUp.md +8 -123
  27. package/src/components/Organisms/EmailSignUp/EmailSignUp.style.js +33 -13
  28. package/src/components/Organisms/EmailSignUp/EmailSignUp.test.js +35 -69
  29. package/src/components/Organisms/EmailSignUp/EmailSignUpForm.js +60 -0
  30. package/src/components/Organisms/EmailSignUp/_Confetti.js +106 -0
  31. package/src/components/Organisms/EmailSignUp/_EmailSignUp.js +138 -0
  32. package/src/components/Organisms/EmailSignUp/_EmailSignUpConfig.js +54 -0
  33. package/src/components/Organisms/EmailSignUp/_TextInput.js +45 -0
  34. package/src/components/Organisms/EmailSignUp/__snapshots__/EmailSignUp.test.js.snap +249 -406
  35. package/src/components/Organisms/Header/Header.md +1 -13
  36. package/src/components/Organisms/Membership/Membership.test.js +33 -33
  37. package/src/index.js +10 -4
  38. package/cypress/integration/components/Molecules/HeaderEsuWithIcon.spec.js +0 -69
  39. package/dist/components/Molecules/HeaderEsuWithIcon/HeaderEsuWithIcon.js +0 -136
  40. package/dist/components/Molecules/HeaderEsuWithIcon/HeaderEsuWithIcon.md +0 -47
  41. package/dist/components/Molecules/HeaderEsuWithIcon/HeaderEsuWithIcon.style.js +0 -52
  42. package/dist/components/Molecules/HeaderEsuWithIcon/HeaderEsuWithIcon.test.js +0 -99
  43. package/dist/components/Molecules/HeaderEsuWithIcon/__snapshots__/HeaderEsuWithIcon.test.js.snap +0 -1211
  44. package/dist/components/Molecules/HeaderEsuWithIcon/assets/HeaderIcons.js +0 -25
  45. package/dist/components/Molecules/HeaderEsuWithIcon/assets/icon--close.svg +0 -5
  46. package/dist/components/Molecules/HeaderEsuWithIcon/assets/icon--email.svg +0 -5
  47. package/dist/components/Organisms/EmailSignUp/EmailSignUp.js +0 -182
  48. package/src/components/Molecules/HeaderEsuWithIcon/HeaderEsuWithIcon.js +0 -135
  49. package/src/components/Molecules/HeaderEsuWithIcon/HeaderEsuWithIcon.md +0 -47
  50. package/src/components/Molecules/HeaderEsuWithIcon/HeaderEsuWithIcon.style.js +0 -60
  51. package/src/components/Molecules/HeaderEsuWithIcon/HeaderEsuWithIcon.test.js +0 -103
  52. package/src/components/Molecules/HeaderEsuWithIcon/__snapshots__/HeaderEsuWithIcon.test.js.snap +0 -1211
  53. package/src/components/Molecules/HeaderEsuWithIcon/assets/HeaderIcons.js +0 -15
  54. package/src/components/Molecules/HeaderEsuWithIcon/assets/icon--close.svg +0 -5
  55. package/src/components/Molecules/HeaderEsuWithIcon/assets/icon--email.svg +0 -5
  56. package/src/components/Organisms/EmailSignUp/EmailSignUp.js +0 -197
@@ -49,10 +49,10 @@ describe('Donate component', () => {
49
49
  it('renders donate form align right preview', () => {
50
50
  // monthly
51
51
  cy.get('@container')
52
- .find('label[for="give-once"]')
52
+ .find('label[for="give-once--mship-1"]')
53
53
  .contains('Single');
54
54
  cy.get('@container')
55
- .find('label[for="give-monthly"]')
55
+ .find('label[for="give-monthly--mship-1"]')
56
56
  .contains('Monthly')
57
57
  .click();
58
58
  cy.get('@container')
@@ -114,17 +114,17 @@ describe('Donate component', () => {
114
114
 
115
115
  it('renders donate form align left preview', () => {
116
116
  cy.get('@container')
117
- .find('label[for="give-once"]')
117
+ .find('label[for="give-once--mship-2"]')
118
118
  .contains('Single');
119
119
  cy.get('@container')
120
- .find('label[for="give-monthly"]')
120
+ .find('label[for="give-monthly--mship-2"]')
121
121
  .contains('Monthly');
122
122
  cy.get('@container')
123
- .find('#mship-1--moneyBuy-box2')
123
+ .find('#mship-2--moneyBuy-box2')
124
124
  .should('exist')
125
125
  .click();
126
126
  cy.get('@container')
127
- .find('[id="mship-1--MoneyBuy-userInput"]')
127
+ .find('[id="mship-2--MoneyBuy-userInput"]')
128
128
  .should('have.value', '20')
129
129
  .clear()
130
130
  .type(' ');
@@ -132,7 +132,7 @@ describe('Donate component', () => {
132
132
  .find('p:nth-child(5)')
133
133
  .contains('Please enter an amount between £1 and £20000 and up to 2 decimal places');
134
134
  cy.get('@container')
135
- .find('[id="mship-1--MoneyBuy-userInput"]')
135
+ .find('[id="mship-2--MoneyBuy-userInput"]')
136
136
  .type('10.999');
137
137
  cy.get('@container')
138
138
  .find('p:nth-child(5)')
@@ -179,11 +179,11 @@ describe('Donate component', () => {
179
179
  .find('label[for="give-once"]')
180
180
  .should('not.exist');
181
181
  cy.get('@container')
182
- .find('#mship-1--moneyBuy-box3')
182
+ .find('#mship-3--moneyBuy-box3')
183
183
  .should('exist')
184
184
  .click();
185
185
  cy.get('@container')
186
- .find('[id="mship-1--MoneyBuy-userInput"]')
186
+ .find('[id="mship-3--MoneyBuy-userInput"]')
187
187
  .should('have.value', '30')
188
188
  .clear()
189
189
  .type('10.99')
@@ -193,7 +193,7 @@ describe('Donate component', () => {
193
193
  .find('p:nth-child(5)')
194
194
  .contains('Please enter an amount between £1 and £20000 and up to 2 decimal places');
195
195
  cy.get('@container')
196
- .find('[id="mship-1--MoneyBuy-userInput"]')
196
+ .find('[id="mship-3--MoneyBuy-userInput"]')
197
197
  .type('10.999');
198
198
  cy.get('@container')
199
199
  .find('p:nth-child(5)')
@@ -240,10 +240,10 @@ describe('Donate component', () => {
240
240
  .find('label[for="give-once"]')
241
241
  .should('not.exist');
242
242
  cy.get('@container')
243
- .find('#mship-1--moneyBuy-box1')
243
+ .find('#mship-4--moneyBuy-box1')
244
244
  .should('not.exist');
245
245
  cy.get('@container')
246
- .find('[id="mship-1--MoneyBuy-userInput"]')
246
+ .find('[id="mship-4--MoneyBuy-userInput"]')
247
247
  .should('exist')
248
248
  .clear()
249
249
  .type('5')
@@ -252,7 +252,7 @@ describe('Donate component', () => {
252
252
  .find('p:nth-child(4)')
253
253
  .contains('Please enter an amount between £1 and £20000 and up to 2 decimal places');
254
254
  cy.get('@container')
255
- .find('[id="mship-1--MoneyBuy-userInput"]')
255
+ .find('[id="mship-4--MoneyBuy-userInput"]')
256
256
  .type('10.999')
257
257
  .clear()
258
258
  .type('5')
@@ -1,142 +1,57 @@
1
1
  describe('Email Sign Up component', () => {
2
- before(() => {
3
- // go to Email Sign Up component
4
- cy.visit('/#emailsignup');
5
- cy.wait(2500)
2
+ before(() => {
3
+ // go to Email Sign Up component
4
+ cy.visit('/#emailsignupform');
5
+ cy.wait(2500);
6
+ });
7
+
8
+ describe('Email Sign Up section', () => {
9
+ beforeEach(() => {
10
+ cy.get('[data-testid="EmailSignUpForm-example-1"]')
11
+ .as('container')
12
+ .find('[data-preview="EmailSignUpForm"]')
13
+ .as('preview');
14
+
15
+ cy.get('@container')
16
+ .find('button')
17
+ .contains('View Code')
18
+ .as('viewCodeBtn');
6
19
  });
7
20
 
8
- describe('props and methods section', () => {
9
- beforeEach(() => {
10
- cy.get('[data-testid="EmailSignUp-container"] button[name="rsg-usage"]')
11
- .contains('Props & methods')
12
- .as('propsBtn');
13
-
14
- cy.get('@propsBtn')
15
- .closest('[class^=rsg--tabs]')
16
- .as('container');
17
- });
18
-
19
- it('is present', () => {
20
- cy.get('@propsBtn').should('exist');
21
- });
22
-
23
- it('does not show table initially', () => {
24
- cy.get('@container')
25
- .find('table')
26
- .should('not.exist');
27
- });
28
-
29
- it('shows the table on button click', () => {
30
- cy.get('@propsBtn').click();
31
- cy.get('@container')
32
- .find('table')
33
- .should('contain', 'Prop name');
34
- });
21
+ it('renders Email Sign Up preview', () => {
22
+ cy.get('@container')
23
+ .find('h2')
24
+ .should('exist')
25
+ .contains('Stay in the know!');
26
+ cy.get('@container')
27
+ .find('p')
28
+ .contains("Get regular email updates and info on what we're up to!");
29
+ cy.get('[data-test="subscribe-button"]').should('be.disabled');
30
+ cy.get('@container').find('input[id="first-name"]').type('Test');
31
+ cy.get('@container').find('input[id="last-name"]').type('User');
32
+ cy.get('@container')
33
+ .find('input[id="email"]')
34
+ .type('test@comicrelief.com')
35
+ .blur();
36
+ cy.get('[data-test="subscribe-button"]').should('not.be.disabled');
37
+ cy.get('[data-test="subscribe-button"]').click();
38
+
39
+ cy.get('@container').contains(
40
+ 'Thanks! Your first email will be with you shortly'
41
+ );
35
42
  });
36
43
 
37
- describe('Email Sign Up section', () => {
38
- beforeEach(() => {
39
- cy.get('[data-testid="EmailSignUp-example-1"]')
40
- .as('container')
41
- .find('[data-preview="EmailSignUp"]')
42
- .as('preview');
43
-
44
- cy.get('@container')
45
- .find('button')
46
- .contains('View Code')
47
- .as('viewCodeBtn');
48
- });
49
-
50
- it('renders Email Sign Up preview', () => {
51
- cy.get('@container')
52
- .find('h2')
53
- .should('exist')
54
- .contains('Stay in the know!');
55
- cy.get('@container')
56
- .find('p')
57
- .contains('Get regular email updates and info on what we\'re up to!');
58
- cy.get('[data-test="subscribe-button"]')
59
- .click();
60
- cy.get('[data-test="error-message"]')
61
- .should('contain', 'invalid email!');
62
- cy.get('@container')
63
- .find('input[id="email"]')
64
- .type('test@comicrelief.com');
65
- cy.get('[data-test="subscribe-button"]')
66
- .click();
67
- cy.get('@container')
68
- .contains('Thanks! Your first email will be with you shortly')
69
- });
70
-
71
- it('has view code button', () => {
72
- cy.get('@viewCodeBtn').should('exist');
73
- });
74
-
75
- it('shows code on click', () => {
76
- cy.get('@viewCodeBtn').click();
77
- cy.get('@container')
78
- .find('textarea')
79
- .should('exist');
80
- });
81
-
82
- it('closes code on click', () => {
83
- cy.get('@viewCodeBtn').click();
84
- });
44
+ it('has view code button', () => {
45
+ cy.get('@viewCodeBtn').should('exist');
85
46
  });
86
47
 
87
- describe('Email Sign Up Schools section', () => {
88
- beforeEach(() => {
89
- cy.get('[data-testid="EmailSignUp-example-3"]')
90
- .as('container')
91
- .find('[data-preview="EmailSignUp"]')
92
- .as('preview');
93
-
94
- cy.get('@container')
95
- .find('button')
96
- .contains('View Code')
97
- .as('viewCodeBtn');
98
- });
99
-
100
- it('renders Email Sign Up Schools preview', () => {
101
- cy.get('@container')
102
- .find('h2')
103
- .should('exist')
104
- .contains('Stay in the know!');
105
- cy.get('@container')
106
- .find('p')
107
- .contains('Get regular email updates and info on what we\'re up to!');
108
- cy.get('[data-test="subscribe-button-school"]')
109
- .click();
110
- cy.get('[data-test="error-message"]')
111
- .should('contain', 'invalid email!');
112
- cy.get('@container')
113
- .find('input[id="email"]')
114
- .type('test@comicrelief.com');
115
- cy.get('[data-test="subscribe-button-school"]')
116
- .click();
117
- cy.get('@container')
118
- .find('select')
119
- .select('The first option')
120
- .first();
121
- cy.get('[data-test="subscribe-button-school"]')
122
- .click();
123
- cy.get('@container')
124
- .contains('Thanks! Your first email will be with you shortly')
125
- });
126
-
127
- it('has view code button', () => {
128
- cy.get('@viewCodeBtn').should('exist');
129
- });
130
-
131
- it('shows code on click', () => {
132
- cy.get('@viewCodeBtn').click();
133
- cy.get('@container')
134
- .find('textarea')
135
- .should('exist');
136
- });
48
+ it('shows code on click', () => {
49
+ cy.get('@viewCodeBtn').click();
50
+ cy.get('@container').find('textarea').should('exist');
51
+ });
137
52
 
138
- it('closes code on click', () => {
139
- cy.get('@viewCodeBtn').click();
140
- });
53
+ it('closes code on click', () => {
54
+ cy.get('@viewCodeBtn').click();
141
55
  });
56
+ });
142
57
  });
@@ -41,7 +41,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
41
41
  mobileImageLow={mobilePictures.imageLow}
42
42
  mobileImages={mobilePictures.images}
43
43
  data={data}
44
- mbshipID="mship-1"
44
+ mbshipID="mship-2"
45
45
  donateLink="https://donation.comicrelief.com/"
46
46
  clientID="donate"
47
47
  cartID="default-comicrelief"
@@ -66,7 +66,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
66
66
  mobileImageLow={mobilePictures.imageLow}
67
67
  mobileImages={mobilePictures.images}
68
68
  data={data}
69
- mbshipID="mship-1"
69
+ mbshipID="mship-3"
70
70
  donateLink="https://donation.comicrelief.com/"
71
71
  clientID="donate"
72
72
  cartID="default-comicrelief"
@@ -91,7 +91,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
91
91
  mobileImageLow={mobilePictures.imageLow}
92
92
  mobileImages={mobilePictures.images}
93
93
  data={data}
94
- mbshipID="mship-1"
94
+ mbshipID="mship-4"
95
95
  donateLink="https://donation.comicrelief.com/"
96
96
  clientID="donate"
97
97
  cartID="default-comicrelief"
@@ -118,7 +118,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
118
118
  mobileImageLow={mobilePictures.imageLow}
119
119
  mobileImages={mobilePictures.images}
120
120
  data={data}
121
- mbshipID="mship-1"
121
+ mbshipID="mship-5"
122
122
  donateLink="https://donation.comicrelief.com/"
123
123
  clientID="donate"
124
124
  cartID="default-comicrelief"
@@ -143,7 +143,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
143
143
  mobileImageLow={mobilePictures.imageLow}
144
144
  mobileImages={mobilePictures.images}
145
145
  data={data}
146
- mbshipID="mship-1"
146
+ mbshipID="mship-6"
147
147
  donateLink="https://donation.comicrelief.com/"
148
148
  clientID="donate"
149
149
  cartID="default-comicrelief"
@@ -168,7 +168,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
168
168
  mobileImageLow={mobilePictures.imageLow}
169
169
  mobileImages={mobilePictures.images}
170
170
  data={data}
171
- mbshipID="mship-1"
171
+ mbshipID="mship-7"
172
172
  donateLink="https://donation.comicrelief.com/"
173
173
  clientID="donate"
174
174
  cartID="default-comicrelief"
@@ -193,7 +193,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
193
193
  mobileImageLow={mobilePictures.imageLow}
194
194
  mobileImages={mobilePictures.images}
195
195
  data={data}
196
- mbshipID="mship-1"
196
+ mbshipID="mship-8"
197
197
  donateLink="https://donation.comicrelief.com/"
198
198
  clientID="donate"
199
199
  cartID="default-comicrelief"
@@ -213,7 +213,7 @@ import data from './dev-data/data-single';
213
213
  backgroundColor="blue_dark"
214
214
  formAlignRight={false}
215
215
  data={data}
216
- mbshipID="mship-1"
216
+ mbshipID="mship-9"
217
217
  donateLink="https://donation.comicrelief.com/"
218
218
  clientID="donate"
219
219
  cartID="default-comicrelief"
@@ -241,7 +241,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
241
241
  mobileImageLow={mobilePictures.imageLow}
242
242
  mobileImages={mobilePictures.images}
243
243
  data={data}
244
- mbshipID="mship-1"
244
+ mbshipID="mship-10"
245
245
  donateLink="https://donation.comicrelief.com/"
246
246
  clientID="donate"
247
247
  cartID="default-comicrelief"
@@ -118,7 +118,8 @@ var Signup = function Signup(_ref) {
118
118
  changeGivingType: function changeGivingType(data) {
119
119
  return setGivingType(data);
120
120
  },
121
- setPopOpen: setPopOpen
121
+ setPopOpen: setPopOpen,
122
+ mbshipID: mbshipID
122
123
  }), popOpen && /*#__PURE__*/_react.default.createElement(_PopUpComponent.default, {
123
124
  PopUpText: PopUpText
124
125
  }), /*#__PURE__*/_react.default.createElement(_Donate.Form, {
@@ -9,72 +9,17 @@ exports.default = void 0;
9
9
 
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
 
12
- var _styledComponents = _interopRequireDefault(require("styled-components"));
13
-
14
- var _size = require("../../../../theme/shared/size");
15
-
16
- var _spacing = _interopRequireDefault(require("../../../../theme/shared/spacing"));
17
-
18
- var _zIndex = _interopRequireDefault(require("../../../../theme/shared/zIndex"));
19
-
20
- var _hideVisually = _interopRequireDefault(require("../../../../theme/shared/hideVisually"));
21
-
22
- var Switch = _styledComponents.default.span.withConfig({
23
- displayName: "GivingSelector__Switch",
24
- componentId: "sc-haox9c-0"
25
- })(["width:50%;height:48px;border-radius:2rem;", ";display:block;position:absolute;transition:left 0.15s ease-out;background-color:", ";left:2px;box-shadow:0px 0px 16px rgba(0,0,0,0.3);"], (0, _zIndex.default)('low'), function (_ref) {
26
- var theme = _ref.theme;
27
- return theme.color('blue');
28
- });
29
-
30
- var Wrapper = _styledComponents.default.div.withConfig({
31
- displayName: "GivingSelector__Wrapper",
32
- componentId: "sc-haox9c-1"
33
- })(["display:flex;margin:", " 0;"], (0, _spacing.default)('md'));
34
-
35
- var MoneyBox = _styledComponents.default.div.withConfig({
36
- displayName: "GivingSelector__MoneyBox",
37
- componentId: "sc-haox9c-2"
38
- })(["width:100%;padding:2px;position:relative;display:flex;flex-direction:row;margin:", " 0;border-radius:2rem;background:", ";", "{width:450px;margin:0 auto;}#give-monthly:checked ~ ", "{left:calc(50% - 2px);}input{", "}input:focus:not(:checked) + label{box-shadow:inset 0 0 0 4px ", ";}"], (0, _spacing.default)('md'), function (_ref2) {
39
- var theme = _ref2.theme;
40
- return theme.color('blue_light');
41
- }, (0, _size.media)('small'), Switch, _hideVisually.default, function (_ref3) {
42
- var theme = _ref3.theme;
43
- return theme.color('blue');
44
- });
45
-
46
- var Label = _styledComponents.default.label.withConfig({
47
- displayName: "GivingSelector__Label",
48
- componentId: "sc-haox9c-3"
49
- })(["font-size:", ";font-family:", ";font-weight:bold;min-height:48px;align-items:center;justify-content:center;display:flex;flex-basis:50%;border:none;transition:color 0.15s ease-out;", ";cursor:", ";&:active:focus{box-shadow:none;}&:focus{border:none;outline:none;box-shadow:inset 0 0 0 4px ", ";}&[for='give-once']{border-radius:2rem;color:", ";}&[for='give-monthly']{border-radius:2rem;color:", ";}"], function (_ref4) {
50
- var theme = _ref4.theme;
51
- return theme.fontSize('s');
52
- }, function (_ref5) {
53
- var theme = _ref5.theme;
54
- return theme.fontFamilies('Montserrat');
55
- }, (0, _zIndex.default)('medium'), function (_ref6) {
56
- var active = _ref6.active;
57
- return active === true ? 'default' : 'pointer';
58
- }, function (_ref7) {
59
- var theme = _ref7.theme;
60
- return theme.color('blue');
61
- }, function (_ref8) {
62
- var active = _ref8.active,
63
- theme = _ref8.theme;
64
- return active === true ? theme.color('white') : theme.color('black');
65
- }, function (_ref9) {
66
- var active = _ref9.active,
67
- theme = _ref9.theme;
68
- return active === true ? theme.color('white') : theme.color('black');
69
- });
70
-
71
- var GivingSelector = function GivingSelector(_ref10) {
72
- var givingType = _ref10.givingType,
73
- changeGivingType = _ref10.changeGivingType,
74
- setPopOpen = _ref10.setPopOpen;
75
- return /*#__PURE__*/_react.default.createElement(Wrapper, null, /*#__PURE__*/_react.default.createElement(MoneyBox, null, /*#__PURE__*/_react.default.createElement("input", {
12
+ var _GivingSelector = require("./GivingSelector.style");
13
+
14
+ var GivingSelector = function GivingSelector(_ref) {
15
+ var givingType = _ref.givingType,
16
+ changeGivingType = _ref.changeGivingType,
17
+ setPopOpen = _ref.setPopOpen,
18
+ mbshipID = _ref.mbshipID;
19
+ return /*#__PURE__*/_react.default.createElement(_GivingSelector.Wrapper, null, /*#__PURE__*/_react.default.createElement(_GivingSelector.MoneyBox, null, /*#__PURE__*/_react.default.createElement("input", {
20
+ className: "give-once",
76
21
  "aria-label": "Single",
77
- id: "give-once",
22
+ id: "give-once--".concat(mbshipID),
78
23
  value: "Single",
79
24
  type: "radio",
80
25
  label: "",
@@ -84,12 +29,13 @@ var GivingSelector = function GivingSelector(_ref10) {
84
29
  changeGivingType('single');
85
30
  setPopOpen(true);
86
31
  }
87
- }), /*#__PURE__*/_react.default.createElement(Label, {
32
+ }), /*#__PURE__*/_react.default.createElement(_GivingSelector.Label, {
88
33
  active: givingType === 'single',
89
- htmlFor: "give-once"
34
+ htmlFor: "give-once--".concat(mbshipID)
90
35
  }, "Single"), /*#__PURE__*/_react.default.createElement("input", {
36
+ className: "give-monthly",
91
37
  "aria-label": "Monthly",
92
- id: "give-monthly",
38
+ id: "give-monthly--".concat(mbshipID),
93
39
  value: "Monthly",
94
40
  type: "radio",
95
41
  label: "",
@@ -99,10 +45,10 @@ var GivingSelector = function GivingSelector(_ref10) {
99
45
  changeGivingType('monthly');
100
46
  setPopOpen(false);
101
47
  }
102
- }), /*#__PURE__*/_react.default.createElement(Label, {
48
+ }), /*#__PURE__*/_react.default.createElement(_GivingSelector.Label, {
103
49
  active: givingType === 'monthly',
104
- htmlFor: "give-monthly"
105
- }, "Monthly"), /*#__PURE__*/_react.default.createElement(Switch, null)));
50
+ htmlFor: "give-monthly--".concat(mbshipID)
51
+ }, "Monthly"), /*#__PURE__*/_react.default.createElement(_GivingSelector.Switch, null)));
106
52
  };
107
53
 
108
54
  var _default = GivingSelector;
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.Label = exports.MoneyBox = exports.Wrapper = exports.Switch = void 0;
9
+
10
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
11
+
12
+ var _size = require("../../../../theme/shared/size");
13
+
14
+ var _spacing = _interopRequireDefault(require("../../../../theme/shared/spacing"));
15
+
16
+ var _zIndex = _interopRequireDefault(require("../../../../theme/shared/zIndex"));
17
+
18
+ var _hideVisually = _interopRequireDefault(require("../../../../theme/shared/hideVisually"));
19
+
20
+ var Switch = _styledComponents.default.span.withConfig({
21
+ displayName: "GivingSelectorstyle__Switch",
22
+ componentId: "sc-5ktn9c-0"
23
+ })(["width:50%;height:48px;border-radius:2rem;", ";display:block;position:absolute;transition:left 0.15s ease-out;background-color:", ";left:2px;box-shadow:0px 0px 16px rgba(0,0,0,0.3);"], (0, _zIndex.default)('low'), function (_ref) {
24
+ var theme = _ref.theme;
25
+ return theme.color('blue');
26
+ });
27
+
28
+ exports.Switch = Switch;
29
+
30
+ var Wrapper = _styledComponents.default.div.withConfig({
31
+ displayName: "GivingSelectorstyle__Wrapper",
32
+ componentId: "sc-5ktn9c-1"
33
+ })(["display:flex;margin:", " 0;"], (0, _spacing.default)('md'));
34
+
35
+ exports.Wrapper = Wrapper;
36
+
37
+ var MoneyBox = _styledComponents.default.div.withConfig({
38
+ displayName: "GivingSelectorstyle__MoneyBox",
39
+ componentId: "sc-5ktn9c-2"
40
+ })(["width:100%;padding:2px;position:relative;display:flex;flex-direction:row;margin:", " 0;border-radius:2rem;background:", ";", "{width:450px;margin:0 auto;}.give-monthly:checked ~ ", "{left:calc(50% - 2px);}input{", "}input:focus:not(:checked) + label{box-shadow:inset 0 0 0 4px ", ";}"], (0, _spacing.default)('md'), function (_ref2) {
41
+ var theme = _ref2.theme;
42
+ return theme.color('blue_light');
43
+ }, (0, _size.media)('small'), Switch, _hideVisually.default, function (_ref3) {
44
+ var theme = _ref3.theme;
45
+ return theme.color('blue');
46
+ });
47
+
48
+ exports.MoneyBox = MoneyBox;
49
+
50
+ var Label = _styledComponents.default.label.withConfig({
51
+ displayName: "GivingSelectorstyle__Label",
52
+ componentId: "sc-5ktn9c-3"
53
+ })(["font-size:", ";font-family:", ";font-weight:bold;min-height:48px;align-items:center;justify-content:center;display:flex;flex-basis:50%;border:none;transition:color 0.15s ease-out;", ";cursor:", ";border-radius:2rem;color:", ";&:active:focus{box-shadow:none;}&:focus{border:none;outline:none;box-shadow:inset 0 0 0 4px ", ";}"], function (_ref4) {
54
+ var theme = _ref4.theme;
55
+ return theme.fontSize('s');
56
+ }, function (_ref5) {
57
+ var theme = _ref5.theme;
58
+ return theme.fontFamilies('Montserrat');
59
+ }, (0, _zIndex.default)('medium'), function (_ref6) {
60
+ var active = _ref6.active;
61
+ return active === true ? 'default' : 'pointer';
62
+ }, function (_ref7) {
63
+ var active = _ref7.active,
64
+ theme = _ref7.theme;
65
+ return active === true ? theme.color('white') : theme.color('black');
66
+ }, function (_ref8) {
67
+ var theme = _ref8.theme;
68
+ return theme.color('blue');
69
+ });
70
+
71
+ exports.Label = Label;
@@ -367,7 +367,7 @@ exports[`Monthly donation renders correctly 1`] = `
367
367
  background: #BECCF9;
368
368
  }
369
369
 
370
- .c8 #give-monthly:checked ~ .c11 {
370
+ .c8 .give-monthly:checked ~ .c11 {
371
371
  left: calc(50% - 2px);
372
372
  }
373
373
 
@@ -415,6 +415,8 @@ exports[`Monthly donation renders correctly 1`] = `
415
415
  transition: color 0.15s ease-out;
416
416
  z-index: 2;
417
417
  cursor: default;
418
+ border-radius: 2rem;
419
+ color: #FFFFFF;
418
420
  }
419
421
 
420
422
  .c9:active:focus {
@@ -427,16 +429,6 @@ exports[`Monthly donation renders correctly 1`] = `
427
429
  box-shadow: inset 0 0 0 4px #0565D1;
428
430
  }
429
431
 
430
- .c9[for='give-once'] {
431
- border-radius: 2rem;
432
- color: #FFFFFF;
433
- }
434
-
435
- .c9[for='give-monthly'] {
436
- border-radius: 2rem;
437
- color: #FFFFFF;
438
- }
439
-
440
432
  .c10 {
441
433
  font-size: 1rem;
442
434
  font-family: 'Montserrat',Helvetica,Arial,sans-serif;
@@ -462,6 +454,8 @@ exports[`Monthly donation renders correctly 1`] = `
462
454
  transition: color 0.15s ease-out;
463
455
  z-index: 2;
464
456
  cursor: pointer;
457
+ border-radius: 2rem;
458
+ color: #000000;
465
459
  }
466
460
 
467
461
  .c10:active:focus {
@@ -474,16 +468,6 @@ exports[`Monthly donation renders correctly 1`] = `
474
468
  box-shadow: inset 0 0 0 4px #0565D1;
475
469
  }
476
470
 
477
- .c10[for='give-once'] {
478
- border-radius: 2rem;
479
- color: #000000;
480
- }
481
-
482
- .c10[for='give-monthly'] {
483
- border-radius: 2rem;
484
- color: #000000;
485
- }
486
-
487
471
  @media (min-width:740px) {
488
472
  .c5 {
489
473
  font-size: 1.25rem;
@@ -644,8 +628,9 @@ exports[`Monthly donation renders correctly 1`] = `
644
628
  <input
645
629
  aria-label="Single"
646
630
  checked={true}
631
+ className="give-once"
647
632
  errormsg=""
648
- id="give-once"
633
+ id="give-once--mship-1"
649
634
  label=""
650
635
  onClick={[Function]}
651
636
  type="radio"
@@ -653,15 +638,16 @@ exports[`Monthly donation renders correctly 1`] = `
653
638
  />
654
639
  <label
655
640
  className="c9"
656
- htmlFor="give-once"
641
+ htmlFor="give-once--mship-1"
657
642
  >
658
643
  Single
659
644
  </label>
660
645
  <input
661
646
  aria-label="Monthly"
662
647
  checked={false}
648
+ className="give-monthly"
663
649
  errormsg=""
664
- id="give-monthly"
650
+ id="give-monthly--mship-1"
665
651
  label=""
666
652
  onClick={[Function]}
667
653
  type="radio"
@@ -669,7 +655,7 @@ exports[`Monthly donation renders correctly 1`] = `
669
655
  />
670
656
  <label
671
657
  className="c10"
672
- htmlFor="give-monthly"
658
+ htmlFor="give-monthly--mship-1"
673
659
  >
674
660
  Monthly
675
661
  </label>