@comicrelief/component-library 7.24.1 → 7.25.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/.github/workflows/main.yml +22 -24
- package/dist/components/Atoms/Button/Button.js +21 -15
- package/dist/components/Atoms/Button/Button.test.js +3 -3
- package/dist/components/Atoms/ButtonWithStates/ButtonWithStates.js +19 -22
- package/dist/components/Atoms/Checkbox/Checkbox.js +42 -26
- package/dist/components/Atoms/Checkbox/Checkbox.test.js +3 -3
- package/dist/components/Atoms/Confetti/Confetti.js +20 -23
- package/dist/components/Atoms/Confetti/_TriggerConfetti.js +4 -11
- package/dist/components/Atoms/ErrorText/ErrorText.js +15 -11
- package/dist/components/Atoms/ErrorText/ErrorText.test.js +3 -3
- package/dist/components/Atoms/Icons/Arrow.js +16 -15
- package/dist/components/Atoms/Icons/AtSign.js +9 -9
- package/dist/components/Atoms/Icons/Chevron.js +16 -15
- package/dist/components/Atoms/Icons/Curve.js +16 -18
- package/dist/components/Atoms/Icons/Download.js +8 -8
- package/dist/components/Atoms/Icons/External.js +8 -8
- package/dist/components/Atoms/Icons/Favourite.js +8 -8
- package/dist/components/Atoms/Icons/Internal.js +8 -8
- package/dist/components/Atoms/Icons/index.js +8 -8
- package/dist/components/Atoms/Input/Input.js +38 -33
- package/dist/components/Atoms/Input/input.test.js +3 -3
- package/dist/components/Atoms/Label/Label.js +28 -23
- package/dist/components/Atoms/Link/Link.js +24 -29
- package/dist/components/Atoms/Link/Link.style.js +51 -40
- package/dist/components/Atoms/Link/Link.test.js +9 -9
- package/dist/components/Atoms/Logo/Logo.js +16 -18
- package/dist/components/Atoms/Logo/Logo.test.js +3 -3
- package/dist/components/Atoms/Pagination/Item/Item.js +7 -7
- package/dist/components/Atoms/Pagination/Item/Item.style.js +35 -28
- package/dist/components/Atoms/Pagination/List/List.js +21 -19
- package/dist/components/Atoms/Pagination/Pagination.js +41 -49
- package/dist/components/Atoms/Pagination/Pagination.test.js +54 -108
- package/dist/components/Atoms/Pagination/Utils/PaginationCalculator.js +15 -15
- package/dist/components/Atoms/Picture/Picture.js +34 -44
- package/dist/components/Atoms/Picture/Picture.test.js +5 -5
- package/dist/components/Atoms/RadioButton/RadioButton.js +35 -23
- package/dist/components/Atoms/RadioButton/RadioButton.test.js +3 -3
- package/dist/components/Atoms/RichText/RichText.js +9 -11
- package/dist/components/Atoms/RichText/RichText.test.js +4 -4
- package/dist/components/Atoms/Select/Select.js +56 -49
- package/dist/components/Atoms/Select/Select.test.js +3 -3
- package/dist/components/Atoms/SocialIcons/Icon/Icon.js +13 -13
- package/dist/components/Atoms/SocialIcons/SocialIcons.js +25 -23
- package/dist/components/Atoms/SocialIcons/SocialIcons.test.js +7 -7
- package/dist/components/Atoms/SocialIcons/Utils/Icons.js +1 -1
- package/dist/components/Atoms/SocialIcons/Utils/Links.js +19 -20
- package/dist/components/Atoms/Text/Text.js +62 -41
- package/dist/components/Atoms/Text/Text.test.js +11 -11
- package/dist/components/Atoms/TextArea/TextArea.js +18 -17
- package/dist/components/Atoms/TextArea/TextArea.test.js +3 -3
- package/dist/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.js +69 -86
- package/dist/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.style.js +23 -15
- package/dist/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.test.js +15 -19
- package/dist/components/Molecules/Accordion/Accordion.js +35 -32
- package/dist/components/Molecules/Accordion/Accordion.test.js +3 -3
- package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.js +81 -52
- package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.test.js +5 -5
- package/dist/components/Molecules/Banner/Banner.js +21 -13
- package/dist/components/Molecules/Banner/Banner.test.js +3 -3
- package/dist/components/Molecules/Box/Box.js +33 -27
- package/dist/components/Molecules/Box/Box.test.js +5 -5
- package/dist/components/Molecules/Card/Card.js +22 -22
- package/dist/components/Molecules/Card/Card.test.js +5 -5
- package/dist/components/Molecules/CardDs/CardDs.js +80 -55
- package/dist/components/Molecules/CardDs/CardDs.test.js +3 -3
- package/dist/components/Molecules/Chip/Chip.js +8 -6
- package/dist/components/Molecules/Chip/Chip.style.js +48 -28
- package/dist/components/Molecules/Chip/Chip.test.js +4 -6
- package/dist/components/Molecules/Countdown/Countdown.js +28 -36
- package/dist/components/Molecules/Countdown/Countdown.style.js +3 -3
- package/dist/components/Molecules/Descriptor/Descriptor.js +32 -26
- package/dist/components/Molecules/Descriptor/Descriptor.test.js +5 -5
- package/dist/components/Molecules/DoubleCopy/DoubleCopy.js +6 -4
- package/dist/components/Molecules/DoubleCopy/DoubleCopy.style.js +7 -5
- package/dist/components/Molecules/DoubleCopy/DoubleCopy.test.js +4 -4
- package/dist/components/Molecules/HeroBanner/HeroBanner.js +13 -17
- package/dist/components/Molecules/InfoBanner/InfoBanner.js +22 -18
- package/dist/components/Molecules/InfoBanner/InfoBanner.test.js +10 -10
- package/dist/components/Molecules/Logos/Logos.js +26 -14
- package/dist/components/Molecules/Logos/Logos.md +5 -0
- package/dist/components/Molecules/Lookup/Lookup.js +49 -84
- package/dist/components/Molecules/PartnerLink/PartnerLink.js +10 -11
- package/dist/components/Molecules/PartnerLink/PartnerLink.style.js +15 -9
- package/dist/components/Molecules/PartnerLink/PartnerLink.test.js +3 -3
- package/dist/components/Molecules/Promo/Promo.js +30 -36
- package/dist/components/Molecules/Promo/Promo.style.js +44 -31
- package/dist/components/Molecules/Promo/Promo.test.js +6 -6
- package/dist/components/Molecules/Promo/_ProgressRing.js +13 -19
- package/dist/components/Molecules/Promo/_PromoVideo.js +25 -34
- package/dist/components/Molecules/Promo/_PromoVideoButton.js +7 -7
- package/dist/components/Molecules/Promo/_PromoVideoButton.style.js +68 -41
- package/dist/components/Molecules/SchoolLookup/SchoolLookup.js +29 -52
- package/dist/components/Molecules/SchoolLookup/SchoolLookup.test.js +4 -4
- package/dist/components/Molecules/SearchInput/SearchInput.js +8 -8
- package/dist/components/Molecules/SearchInput/SearchInput.style.js +22 -14
- package/dist/components/Molecules/SearchInput/SearchInput.test.js +4 -4
- package/dist/components/Molecules/SearchResult/SearchResult.js +43 -29
- package/dist/components/Molecules/SearchResult/SearchResult.test.js +9 -9
- package/dist/components/Molecules/ShareButton/ShareButton.js +22 -26
- package/dist/components/Molecules/ShareButton/ShareButton.style.js +5 -5
- package/dist/components/Molecules/ShareButton/ShareButton.test.js +3 -3
- package/dist/components/Molecules/ShareButton/assets/ShareIcons.js +2 -2
- package/dist/components/Molecules/SimpleSchoolLookup/SimpleSchoolLookup.js +28 -55
- package/dist/components/Molecules/SingleMessage/SingleMessage.js +99 -123
- package/dist/components/Molecules/SingleMessage/SingleMessage.style.js +132 -81
- package/dist/components/Molecules/SingleMessage/SingleMessage.test.js +13 -13
- package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.js +31 -40
- package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.style.js +85 -49
- package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.test.js +3 -3
- package/dist/components/Molecules/Typeahead/Typeahead.js +47 -84
- package/dist/components/Molecules/Typeahead/Typeahead.test.js +12 -35
- package/dist/components/Molecules/VideoBanner/VideoBanner.js +20 -25
- package/dist/components/Molecules/VideoBanner/VideoBanner.test.js +4 -4
- package/dist/components/Organisms/CookieBanner/CookieBanner.js +7 -5
- package/dist/components/Organisms/CookieBanner/CookieBanner.style.js +21 -13
- package/dist/components/Organisms/CookieBanner/CookieBanner.test.js +5 -5
- package/dist/components/Organisms/Donate/Donate.js +42 -39
- package/dist/components/Organisms/Donate/Donate.md +85 -0
- package/dist/components/Organisms/Donate/Donate.style.js +85 -53
- package/dist/components/Organisms/Donate/Donate.test.js +10 -10
- package/dist/components/Organisms/Donate/Form/Form.js +64 -80
- package/dist/components/Organisms/Donate/Form/PopUpComponent.js +25 -30
- package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.js +11 -13
- package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.style.js +38 -22
- package/dist/components/Organisms/Donate/MoneyBuy/MoneyBuy.js +47 -30
- package/dist/components/Organisms/EmailSignUp/EmailSignUp.style.js +63 -37
- package/dist/components/Organisms/EmailSignUp/EmailSignUp.test.js +12 -12
- package/dist/components/Organisms/EmailSignUp/EmailSignUpForm.js +23 -43
- package/dist/components/Organisms/EmailSignUp/_EmailSignUp.js +25 -21
- package/dist/components/Organisms/EmailSignUp/_EmailSignUpConfig.js +10 -9
- package/dist/components/Organisms/EmailSignUp/_TextInput.js +20 -18
- package/dist/components/Organisms/Footer/Footer.js +10 -10
- package/dist/components/Organisms/Footer/Footer.style.js +27 -21
- package/dist/components/Organisms/Footer/Footer.test.js +3 -3
- package/dist/components/Organisms/Footer/Nav/Nav.js +59 -70
- package/dist/components/Organisms/Footer/Nav/Nav.style.js +77 -43
- package/dist/components/Organisms/Header/Burger/BurgerMenu.js +6 -4
- package/dist/components/Organisms/Header/Burger/BurgerMenu.style.js +37 -21
- package/dist/components/Organisms/Header/Header.js +8 -8
- package/dist/components/Organisms/Header/Header.style.js +27 -19
- package/dist/components/Organisms/Header/Nav/Nav.js +39 -50
- package/dist/components/Organisms/Header/Nav/Nav.style.js +103 -57
- package/dist/components/Organisms/Header/header.test.js +1 -1
- package/dist/components/Organisms/ImpactSlider/ImpactMoneybuys.style.js +32 -29
- package/dist/components/Organisms/ImpactSlider/ImpactSlider.js +19 -22
- package/dist/components/Organisms/ImpactSlider/ImpactSlider.style.js +38 -24
- package/dist/components/Organisms/ImpactSlider/Slider.style.js +8 -14
- package/dist/components/Organisms/ImpactSlider/_ImpactMoneybuys.js +11 -11
- package/dist/components/Organisms/ImpactSlider/_Slider.js +9 -7
- package/dist/components/Organisms/ImpactSlider/_utils.js +11 -11
- package/dist/components/Organisms/MarketingPreferencesDS/MarketingPreferencesDS.style.js +61 -38
- package/dist/components/Organisms/MarketingPreferencesDS/MarketingPreferencesDSForm.js +24 -16
- package/dist/components/Organisms/MarketingPreferencesDS/_AssociatedFields.js +1 -1
- package/dist/components/Organisms/MarketingPreferencesDS/_CheckAnswer.js +20 -16
- package/dist/components/Organisms/MarketingPreferencesDS/_DefaultCopy.js +3 -3
- package/dist/components/Organisms/MarketingPreferencesDS/_MarketingPreferencesDS.js +46 -36
- package/dist/components/Organisms/MarketingPreferencesDS/_MarketingPrefsConfig.js +21 -34
- package/dist/components/Organisms/MarketingPreferencesDS/_TextInput.js +20 -18
- package/dist/components/Organisms/Membership/Form/Form.js +48 -81
- package/dist/components/Organisms/Membership/Membership.js +17 -15
- package/dist/components/Organisms/Membership/Membership.style.js +81 -51
- package/dist/components/Organisms/Membership/Membership.test.js +4 -4
- package/dist/components/Organisms/Membership/MoneyBox/MoneyBox.js +37 -26
- package/dist/hoc/shallowWithTheme.js +1 -1
- package/dist/index.js +67 -67
- package/dist/styleguide/CRLogo.js +2 -2
- package/dist/styleguide/StyleGuideRenderer.js +9 -7
- package/dist/styleguide/ThemeWrapper.js +5 -3
- package/dist/styleguide/data/data.js +3 -3
- package/dist/theme/crTheme/buttonColors.js +6 -5
- package/dist/theme/crTheme/colors.js +4 -3
- package/dist/theme/crTheme/fontSizes.js +4 -3
- package/dist/theme/crTheme/linkStyles.js +6 -5
- package/dist/theme/crTheme/theme.js +1 -1
- package/dist/theme/shared/breakpoint.js +4 -3
- package/dist/theme/shared/fontFamilies.js +5 -4
- package/dist/theme/shared/hideVisually.js +1 -1
- package/dist/theme/shared/size.js +4 -3
- package/dist/theme/shared/spacing.js +2 -2
- package/dist/theme/shared/zIndex.js +3 -3
- package/dist/theme/srTheme/buttonColors.js +6 -5
- package/dist/theme/srTheme/colors.js +4 -3
- package/dist/theme/srTheme/fontSizes.js +4 -3
- package/dist/theme/srTheme/linkStyles.js +6 -5
- package/dist/theme/srTheme/theme.js +1 -1
- package/dist/utils/Membership.js +30 -27
- package/dist/utils/ShareButton/sharePopUpHelper.js +8 -8
- package/dist/utils/ShareButton/shareTracking.js +1 -1
- package/dist/utils/ShareButton/shareUrlHelper.js +3 -3
- package/dist/utils/allowListed.js +3 -5
- package/dist/utils/allowListed.test.js +3 -3
- package/dist/utils/internalLinkHelper.js +8 -10
- package/dist/utils/navHelper.js +2 -2
- package/package.json +12 -9
- package/playwright/components/atoms/checkbox.spec.js +64 -0
- package/playwright/components/atoms/input.spec.js +158 -0
- package/playwright/components/atoms/label.spec.js +29 -0
- package/playwright/components/atoms/link.spec.js +48 -0
- package/playwright/components/atoms/radioButton.spec.js +30 -0
- package/playwright/components/atoms/select.spec.js +36 -0
- package/playwright/components/atoms/textArea.spec.js +39 -0
- package/playwright/components/atoms/textInputWithDropdown.spec.js +23 -0
- package/playwright/components/molecules/accordian.spec.js +20 -0
- package/playwright/components/molecules/schoolLookup.spec.js +26 -0
- package/playwright/components/molecules/searchInput.spec.js +24 -0
- package/playwright/components/molecules/shareButton.spec.js +32 -0
- package/playwright/components/molecules/simpleSchoolLookUp.spec.js +35 -0
- package/playwright/components/molecules/typeahead.spec.js +27 -0
- package/playwright/components/organisms/donate.spec.js +293 -0
- package/playwright/components/organisms/emailSignUpForm.spec.js +109 -0
- package/playwright/components/organisms/footer.spec.js +67 -0
- package/playwright/components/organisms/header.spec.js +82 -0
- package/playwright/components/organisms/impactSlider.spec.js +292 -0
- package/playwright/components/organisms/marketingPreferences.spec.js +220 -0
- package/playwright/components/organisms/membership.spec.js +47 -0
- package/playwright.config.js +49 -0
- package/src/components/Molecules/Logos/Logos.js +18 -6
- package/src/components/Molecules/Logos/Logos.md +5 -0
- package/src/components/Organisms/Donate/Donate.js +11 -3
- package/src/components/Organisms/Donate/Donate.md +85 -0
- package/src/components/Organisms/Donate/Form/Form.js +20 -2
- package/src/components/Organisms/ImpactSlider/_ImpactMoneybuys.js +3 -4
- package/src/components/Organisms/Membership/Membership.test.js +1 -1
- package/cypress/e2e/components/atoms/button.cy.js +0 -102
- package/cypress/e2e/components/atoms/buttonWithStates.cy.js +0 -47
- package/cypress/e2e/components/atoms/checkbox.cy.js +0 -70
- package/cypress/e2e/components/atoms/confetti.cy.js +0 -46
- package/cypress/e2e/components/atoms/errorText.cy.js +0 -45
- package/cypress/e2e/components/atoms/input.cy.js +0 -157
- package/cypress/e2e/components/atoms/label.cy.js +0 -93
- package/cypress/e2e/components/atoms/link.cy.js +0 -190
- package/cypress/e2e/components/atoms/logo.cy.js +0 -132
- package/cypress/e2e/components/atoms/pagination.cy.js +0 -191
- package/cypress/e2e/components/atoms/picture.cy.js +0 -130
- package/cypress/e2e/components/atoms/radioButton.cy.js +0 -76
- package/cypress/e2e/components/atoms/richText.cy.js +0 -70
- package/cypress/e2e/components/atoms/select.cy.js +0 -84
- package/cypress/e2e/components/atoms/socialIcons.cy.js +0 -162
- package/cypress/e2e/components/atoms/text.cy.js +0 -169
- package/cypress/e2e/components/atoms/textArea.cy.js +0 -89
- package/cypress/e2e/components/atoms/textInputWithDrop.cy.js +0 -76
- package/cypress/e2e/components/molecules/accordion.cy.js +0 -67
- package/cypress/e2e/components/molecules/articleTeaser.cy.js +0 -105
- package/cypress/e2e/components/molecules/banner.cy.js +0 -67
- package/cypress/e2e/components/molecules/box.cy.js +0 -104
- package/cypress/e2e/components/molecules/card.cy.js +0 -105
- package/cypress/e2e/components/molecules/cardDs.cy.js +0 -198
- package/cypress/e2e/components/molecules/chip.cy.js +0 -68
- package/cypress/e2e/components/molecules/countdown.cy.js +0 -71
- package/cypress/e2e/components/molecules/descriptor.cy.js +0 -142
- package/cypress/e2e/components/molecules/doubleCopy.cy.js +0 -79
- package/cypress/e2e/components/molecules/heroBanner.cy.js +0 -69
- package/cypress/e2e/components/molecules/infoBanner.cy.js +0 -69
- package/cypress/e2e/components/molecules/partnerLink.cy.js +0 -68
- package/cypress/e2e/components/molecules/promo.cy.js +0 -74
- package/cypress/e2e/components/molecules/schoolLookup.cy.js +0 -83
- package/cypress/e2e/components/molecules/searchInput.cy.js +0 -72
- package/cypress/e2e/components/molecules/searchResult.cy.js +0 -191
- package/cypress/e2e/components/molecules/shareButton.cy.js +0 -76
- package/cypress/e2e/components/molecules/simpleSchoolLookup.cy.js +0 -83
- package/cypress/e2e/components/molecules/singleMessage.cy.js +0 -502
- package/cypress/e2e/components/molecules/singleMessageDs.cy.js +0 -234
- package/cypress/e2e/components/molecules/typeahead.cy.js +0 -97
- package/cypress/e2e/components/molecules/videoBanner.cy.js +0 -132
- package/cypress/e2e/components/organisms/cookieBanner.cy.js +0 -80
- package/cypress/e2e/components/organisms/donate.cy.js +0 -284
- package/cypress/e2e/components/organisms/emailSignUp.cy.js +0 -54
- package/cypress/e2e/components/organisms/footer.cy.js +0 -168
- package/cypress/e2e/components/organisms/header.cy.js +0 -138
- package/cypress/e2e/components/organisms/impactSlider.cy.js +0 -72
- package/cypress/e2e/components/organisms/marketingPreferencesDSForm.cy.js +0 -589
- package/cypress/e2e/components/organisms/membership.cy.js +0 -122
- package/cypress/fixtures/example.json +0 -5
- package/cypress/plugins/index.js +0 -21
- package/cypress/support/commands.js +0 -25
- package/cypress/support/e2e.js +0 -36
- package/cypress.config.js +0 -15
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
8
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
10
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _PopUpComponent = _interopRequireDefault(require("./PopUpComponent"));
|
|
12
11
|
var _Text = _interopRequireDefault(require("../../../Atoms/Text/Text"));
|
|
@@ -14,68 +13,52 @@ var _MoneyBuy = _interopRequireDefault(require("../MoneyBuy/MoneyBuy"));
|
|
|
14
13
|
var _Membership = require("../../../../utils/Membership");
|
|
15
14
|
var _Donate = require("../Donate.style");
|
|
16
15
|
var _GivingSelector = _interopRequireDefault(require("../GivingSelector/GivingSelector"));
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
setErrorMsg = _useState4[1];
|
|
43
|
-
var _useState5 = (0, _react.useState)(10),
|
|
44
|
-
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
45
|
-
amountDonate = _useState6[0],
|
|
46
|
-
setAmountDonate = _useState6[1];
|
|
47
|
-
var _useState7 = (0, _react.useState)(true),
|
|
48
|
-
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
49
|
-
moneyBuyCopy = _useState8[0],
|
|
50
|
-
setMoneyBuyCopy = _useState8[1];
|
|
51
|
-
var _useState9 = (0, _react.useState)(false),
|
|
52
|
-
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
53
|
-
popOpen = _useState10[0],
|
|
54
|
-
setPopOpen = _useState10[1];
|
|
16
|
+
const Signup = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
data: {
|
|
19
|
+
singleGiving,
|
|
20
|
+
regularGiving
|
|
21
|
+
},
|
|
22
|
+
donateLink,
|
|
23
|
+
otherAmountText,
|
|
24
|
+
clientID,
|
|
25
|
+
cartID,
|
|
26
|
+
mbshipID,
|
|
27
|
+
noMoneyBuys,
|
|
28
|
+
PopUpText,
|
|
29
|
+
chooseAmountText,
|
|
30
|
+
submitButtonColor,
|
|
31
|
+
otherAmountValue,
|
|
32
|
+
additionalSingleCopy,
|
|
33
|
+
additionalMonthlyCopy,
|
|
34
|
+
...rest
|
|
35
|
+
} = _ref;
|
|
36
|
+
const [givingType, setGivingType] = (0, _react.useState)('single');
|
|
37
|
+
const [errorMsg, setErrorMsg] = (0, _react.useState)(false);
|
|
38
|
+
const [amountDonate, setAmountDonate] = (0, _react.useState)(10);
|
|
39
|
+
const [moneyBuyCopy, setMoneyBuyCopy] = (0, _react.useState)(true);
|
|
40
|
+
const [popOpen, setPopOpen] = (0, _react.useState)(false);
|
|
55
41
|
// In order to keep track of whether the user has ever been shown the popup
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
popUpShown = _useState12[0],
|
|
59
|
-
setPopUpShown = _useState12[1];
|
|
60
|
-
(0, _react.useEffect)(function () {
|
|
42
|
+
const [popUpShown, setPopUpShown] = (0, _react.useState)(false);
|
|
43
|
+
(0, _react.useEffect)(() => {
|
|
61
44
|
// If a specific 'other amount' has been passed down, use it,
|
|
62
45
|
// otherwise assign based on the associated moneybuys:
|
|
63
46
|
if (otherAmountValue) {
|
|
64
47
|
setAmountDonate(otherAmountValue);
|
|
65
48
|
} else {
|
|
66
|
-
|
|
49
|
+
const givingData = givingType === 'single' ? singleGiving : regularGiving;
|
|
67
50
|
|
|
68
51
|
// Check the 2nd moneybuy exists before using it;
|
|
69
52
|
// 'philantrophy' carts have been set up to use a single moneybuy.
|
|
70
53
|
// See ENG-1685 for more details
|
|
71
|
-
|
|
54
|
+
const thisAmount = givingData.moneybuys[1] ? givingData.moneybuys[1].value : givingData.moneybuys[0].value;
|
|
72
55
|
setAmountDonate(thisAmount);
|
|
73
56
|
}
|
|
74
57
|
}, [givingType, singleGiving, regularGiving, otherAmountValue]);
|
|
75
|
-
(0, _react.useEffect)(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
givingData.moneybuys.map(
|
|
58
|
+
(0, _react.useEffect)(() => {
|
|
59
|
+
const givingData = givingType === 'single' ? singleGiving : regularGiving;
|
|
60
|
+
let moneyBuyNewDescription = otherAmountText;
|
|
61
|
+
givingData.moneybuys.map((moneyBuy, index) => {
|
|
79
62
|
if (moneyBuy.value === amountDonate) {
|
|
80
63
|
moneyBuyNewDescription = moneyBuy.description;
|
|
81
64
|
}
|
|
@@ -92,10 +75,10 @@ var Signup = function Signup(_ref) {
|
|
|
92
75
|
|
|
93
76
|
// Updates our flag that differentiates between the popup
|
|
94
77
|
// being *currently* open and it *ever* having been shown to user
|
|
95
|
-
(0, _react.useEffect)(
|
|
78
|
+
(0, _react.useEffect)(() => {
|
|
96
79
|
if (popOpen && !popUpShown) setPopUpShown(true);
|
|
97
80
|
}, [popOpen, popUpShown]);
|
|
98
|
-
|
|
81
|
+
const submitDonation = (event, amount, clientId, cartId, mbshipId, donateURL) => {
|
|
99
82
|
event.preventDefault();
|
|
100
83
|
if ((0, _Membership.isAmountValid)(amount) && !errorMsg) {
|
|
101
84
|
(0, _Membership.handleDonateSubmission)(amount, clientId, cartId, mbshipId, donateURL, givingType, popUpShown);
|
|
@@ -106,21 +89,21 @@ var Signup = function Signup(_ref) {
|
|
|
106
89
|
};
|
|
107
90
|
|
|
108
91
|
// Update the local state if the prop has been set and changed
|
|
109
|
-
(0, _react.useEffect)(
|
|
92
|
+
(0, _react.useEffect)(() => {
|
|
110
93
|
if (otherAmountValue) {
|
|
111
94
|
setAmountDonate(otherAmountValue);
|
|
112
95
|
}
|
|
113
96
|
}, [otherAmountValue, setAmountDonate]);
|
|
114
97
|
|
|
115
98
|
// Create money buy boxes
|
|
116
|
-
|
|
117
|
-
|
|
99
|
+
const givingData = givingType === 'single' ? singleGiving : regularGiving;
|
|
100
|
+
const showGivingSelector = singleGiving !== null && regularGiving !== null;
|
|
118
101
|
|
|
119
102
|
// Create ref for amount input
|
|
120
|
-
|
|
103
|
+
const amountRef = (0, _react.useRef)(null);
|
|
121
104
|
// Create ref for amount button
|
|
122
|
-
|
|
123
|
-
|
|
105
|
+
const buttonRef = (0, _react.useRef)(null);
|
|
106
|
+
const handleClickOutside = (0, _react.useCallback)(event => {
|
|
124
107
|
if (!errorMsg) {
|
|
125
108
|
return;
|
|
126
109
|
}
|
|
@@ -131,23 +114,23 @@ var Signup = function Signup(_ref) {
|
|
|
131
114
|
// Check the 2nd moneybuy exists before using it;
|
|
132
115
|
// 'philantrophy' carts have been set up to use a single moneybuy.
|
|
133
116
|
// See ENG-1685 for more details
|
|
134
|
-
|
|
117
|
+
const thisAmount = givingData.moneybuys[1] ? givingData.moneybuys[1].value : givingData.moneybuys[0].value;
|
|
135
118
|
setAmountDonate(thisAmount);
|
|
136
119
|
}
|
|
137
120
|
}, [errorMsg, givingData.moneybuys]);
|
|
138
121
|
|
|
139
122
|
// Listen for click outside custom amount input if there is no value entered.
|
|
140
|
-
(0, _react.useEffect)(
|
|
123
|
+
(0, _react.useEffect)(() => {
|
|
141
124
|
// Bind the event listener
|
|
142
125
|
document.addEventListener('mousedown', handleClickOutside);
|
|
143
|
-
return
|
|
126
|
+
return () => {
|
|
144
127
|
// Unbind the event listener on clean up
|
|
145
128
|
document.removeEventListener('mousedown', handleClickOutside);
|
|
146
129
|
};
|
|
147
130
|
}, [errorMsg, handleClickOutside]);
|
|
148
131
|
|
|
149
132
|
// Create function to conditionally render button text
|
|
150
|
-
|
|
133
|
+
const renderButtonText = () => {
|
|
151
134
|
if (errorMsg) {
|
|
152
135
|
return 'Donate';
|
|
153
136
|
}
|
|
@@ -156,33 +139,32 @@ var Signup = function Signup(_ref) {
|
|
|
156
139
|
}
|
|
157
140
|
return "Donate \xA3".concat(amountDonate, " monthly");
|
|
158
141
|
};
|
|
142
|
+
const showAdditionalSingleCopy = givingType === 'single' && additionalSingleCopy;
|
|
143
|
+
const showAdditionalMonthlyCopy = givingType === 'monthly' && additionalMonthlyCopy;
|
|
144
|
+
const additionalCopy = showAdditionalSingleCopy || showAdditionalMonthlyCopy;
|
|
159
145
|
return /*#__PURE__*/_react.default.createElement(_Donate.FormWrapper, null, showGivingSelector && /*#__PURE__*/_react.default.createElement(_GivingSelector.default, {
|
|
160
146
|
givingType: givingType,
|
|
161
|
-
changeGivingType:
|
|
162
|
-
return setGivingType(data);
|
|
163
|
-
},
|
|
147
|
+
changeGivingType: data => setGivingType(data),
|
|
164
148
|
setPopOpen: setPopOpen,
|
|
165
149
|
mbshipID: mbshipID
|
|
166
150
|
}), popOpen && /*#__PURE__*/_react.default.createElement(_PopUpComponent.default, {
|
|
167
151
|
PopUpText: PopUpText,
|
|
168
152
|
setPopOpen: setPopOpen
|
|
169
153
|
}), /*#__PURE__*/_react.default.createElement(_Donate.Form, {
|
|
170
|
-
onSubmit:
|
|
171
|
-
return submitDonation(e, amountDonate, clientID, cartID, mbshipID, donateLink);
|
|
172
|
-
}
|
|
154
|
+
onSubmit: e => submitDonation(e, amountDonate, clientID, cartID, mbshipID, donateLink)
|
|
173
155
|
}, /*#__PURE__*/_react.default.createElement(_Donate.OuterFieldset, null, /*#__PURE__*/_react.default.createElement(_Donate.Legend, null, /*#__PURE__*/_react.default.createElement(_Text.default, {
|
|
174
156
|
tag: "span",
|
|
175
157
|
size: "l",
|
|
176
158
|
weight: "bold"
|
|
177
|
-
}, chooseAmountText || "".concat(noMoneyBuys ? 'Enter' : 'Choose', " an amount to give"))), !noMoneyBuys && /*#__PURE__*/_react.default.createElement(_Donate.MoneyBuys, null, givingData.moneybuys.map(
|
|
178
|
-
|
|
159
|
+
}, chooseAmountText || "".concat(noMoneyBuys ? 'Enter' : 'Choose', " an amount to give"))), !noMoneyBuys && /*#__PURE__*/_react.default.createElement(_Donate.MoneyBuys, null, givingData.moneybuys.map((_ref2, index) => {
|
|
160
|
+
let {
|
|
161
|
+
value
|
|
162
|
+
} = _ref2;
|
|
179
163
|
return /*#__PURE__*/_react.default.createElement(_MoneyBuy.default, {
|
|
180
164
|
isSelected: amountDonate === value,
|
|
181
165
|
amount: value.toString(),
|
|
182
166
|
description: "\xA3".concat((0, _Membership.amountFormatter)(value)),
|
|
183
|
-
setOtherAmount:
|
|
184
|
-
return setAmountDonate(value);
|
|
185
|
-
},
|
|
167
|
+
setOtherAmount: () => setAmountDonate(value),
|
|
186
168
|
key: value,
|
|
187
169
|
name: "".concat(mbshipID, "--moneyBuy").concat(index + 1),
|
|
188
170
|
id: "".concat(mbshipID, "--moneyBuy-box").concat(index + 1)
|
|
@@ -206,9 +188,7 @@ var Signup = function Signup(_ref) {
|
|
|
206
188
|
pattern: "[^[0-9]+([,.][0-9]+)?$]" // this only applies on submit
|
|
207
189
|
,
|
|
208
190
|
placeholder: "0.00",
|
|
209
|
-
onChange:
|
|
210
|
-
return setAmountDonate(e.target.value.trim());
|
|
211
|
-
},
|
|
191
|
+
onChange: e => setAmountDonate(e.target.value.trim()),
|
|
212
192
|
"aria-label": "Input a different amount",
|
|
213
193
|
ref: amountRef
|
|
214
194
|
}))), amountDonate >= 1 && !noMoneyBuys && moneyBuyCopy && /*#__PURE__*/_react.default.createElement(_Donate.Copy, {
|
|
@@ -216,7 +196,9 @@ var Signup = function Signup(_ref) {
|
|
|
216
196
|
}, /*#__PURE__*/_react.default.createElement("strong", null, "\xA3".concat(amountDonate, " ")), moneyBuyCopy), errorMsg && /*#__PURE__*/_react.default.createElement(_Donate.Error, {
|
|
217
197
|
className: "error--amount",
|
|
218
198
|
tag: "p"
|
|
219
|
-
}, "Please enter an amount between \xA31 and \xA325000 and up to 2 decimal places"),
|
|
199
|
+
}, "Please enter an amount between \xA31 and \xA325000 and up to 2 decimal places"), additionalCopy && /*#__PURE__*/_react.default.createElement("p", {
|
|
200
|
+
className: "additional-copy"
|
|
201
|
+
}, /*#__PURE__*/_react.default.createElement("strong", null, additionalCopy)), noMoneyBuys ? /*#__PURE__*/_react.default.createElement(_Donate.Button, {
|
|
220
202
|
type: "submit",
|
|
221
203
|
color: submitButtonColor
|
|
222
204
|
}, errorMsg ? 'Donate' : "Donate \xA3".concat(amountDonate)) : /*#__PURE__*/_react.default.createElement(_Donate.Button, {
|
|
@@ -228,6 +210,8 @@ var Signup = function Signup(_ref) {
|
|
|
228
210
|
Signup.defaultProps = {
|
|
229
211
|
noMoneyBuys: false,
|
|
230
212
|
otherAmountValue: null,
|
|
231
|
-
data: {}
|
|
213
|
+
data: {},
|
|
214
|
+
additionalSingleCopy: null,
|
|
215
|
+
additionalMonthlyCopy: null
|
|
232
216
|
};
|
|
233
217
|
var _default = exports.default = Signup;
|
|
@@ -1,56 +1,53 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
8
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
11
|
var _Text = _interopRequireDefault(require("../../../Atoms/Text/Text"));
|
|
12
12
|
var _size = require("../../../../theme/shared/size");
|
|
13
13
|
var _close = _interopRequireDefault(require("../assets/close.svg"));
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var fadeOpen = (0, _styledComponents.keyframes)(["0%{opacity:0;max-height:0px;display:none;margin-top:-16px;}100%{opacity:1;max-height:350px;}"]);
|
|
19
|
-
var StyledPopUp = _styledComponents.default.div.withConfig({
|
|
14
|
+
const closeDuration = 0.6;
|
|
15
|
+
const fadeClose = (0, _styledComponents.keyframes)(["0%{opacity:1;max-height:350px;}100%{opacity:0;max-height:0px;display:none;margin-top:-16px;}"]);
|
|
16
|
+
const fadeOpen = (0, _styledComponents.keyframes)(["0%{opacity:0;max-height:0px;display:none;margin-top:-16px;}100%{opacity:1;max-height:350px;}"]);
|
|
17
|
+
const StyledPopUp = _styledComponents.default.div.withConfig({
|
|
20
18
|
displayName: "PopUpComponent__StyledPopUp",
|
|
21
19
|
componentId: "sc-1d7imlo-0"
|
|
22
|
-
})(["display:grid;overflow:hidden;max-height:350px;opacity:1;animation:0.4s ", " ease;", " background-color:", ";box-shadow:0px 0px 16px rgba(0,0,0,0.15);border-radius:10px;", "{width:450px;margin-right:auto;margin-left:auto;}"],
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}, function (_ref) {
|
|
27
|
-
var theme = _ref.theme;
|
|
20
|
+
})(["display:grid;overflow:hidden;max-height:350px;opacity:1;animation:0.4s ", " ease;", " background-color:", ";box-shadow:0px 0px 16px rgba(0,0,0,0.15);border-radius:10px;", "{width:450px;margin-right:auto;margin-left:auto;}"], props => props.fadeOpen, props => props.isClosed && (0, _styledComponents.css)(["animation:", "s ", " ease forwards;"], closeDuration, props.fadeClose), _ref => {
|
|
21
|
+
let {
|
|
22
|
+
theme
|
|
23
|
+
} = _ref;
|
|
28
24
|
return theme.color('blue_light');
|
|
29
25
|
}, (0, _size.media)('small'));
|
|
30
|
-
|
|
26
|
+
const TextWrapper = _styledComponents.default.div.withConfig({
|
|
31
27
|
displayName: "PopUpComponent__TextWrapper",
|
|
32
28
|
componentId: "sc-1d7imlo-1"
|
|
33
29
|
})(["margin:0 32px 32px;"]);
|
|
34
|
-
|
|
30
|
+
const Button = _styledComponents.default.button.withConfig({
|
|
35
31
|
displayName: "PopUpComponent__Button",
|
|
36
32
|
componentId: "sc-1d7imlo-2"
|
|
37
|
-
})(["justify-self:end;background-color:transparent;border:0;cursor:pointer;width:30px;height:30px;margin:3px;:active,:focus,:hover{outline:none;border:1px solid ", ";}img{width:15px;height:15px;vertical-align:middle;}"],
|
|
38
|
-
|
|
33
|
+
})(["justify-self:end;background-color:transparent;border:0;cursor:pointer;width:30px;height:30px;margin:3px;:active,:focus,:hover{outline:none;border:1px solid ", ";}img{width:15px;height:15px;vertical-align:middle;}"], _ref2 => {
|
|
34
|
+
let {
|
|
35
|
+
theme
|
|
36
|
+
} = _ref2;
|
|
39
37
|
return theme.color('grey');
|
|
40
38
|
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
setIsClosed = _useState2[1];
|
|
39
|
+
const PopUpComponent = _ref3 => {
|
|
40
|
+
let {
|
|
41
|
+
PopUpText,
|
|
42
|
+
setPopOpen
|
|
43
|
+
} = _ref3;
|
|
44
|
+
const [isClosed, setIsClosed] = (0, _react.useState)(false);
|
|
48
45
|
|
|
49
46
|
// Only update centralised state - which renders
|
|
50
47
|
// this component - once the closing animation is complete
|
|
51
|
-
|
|
48
|
+
const handleCloser = () => {
|
|
52
49
|
setIsClosed(true);
|
|
53
|
-
setTimeout(
|
|
50
|
+
setTimeout(() => {
|
|
54
51
|
setPopOpen(false);
|
|
55
52
|
}, closeDuration * 1000);
|
|
56
53
|
};
|
|
@@ -59,9 +56,7 @@ var PopUpComponent = function PopUpComponent(_ref3) {
|
|
|
59
56
|
fadeOpen: fadeOpen,
|
|
60
57
|
fadeClose: fadeClose
|
|
61
58
|
}, /*#__PURE__*/_react.default.createElement(Button, {
|
|
62
|
-
onClick:
|
|
63
|
-
return handleCloser();
|
|
64
|
-
},
|
|
59
|
+
onClick: () => handleCloser(),
|
|
65
60
|
"aria-label": "Close"
|
|
66
61
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
67
62
|
src: _close.default,
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _GivingSelector = require("./GivingSelector.style");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
const GivingSelector = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
givingType,
|
|
13
|
+
changeGivingType,
|
|
14
|
+
setPopOpen,
|
|
15
|
+
mbshipID
|
|
16
|
+
} = _ref;
|
|
15
17
|
// Only updates giving type and popup status when appropriate
|
|
16
|
-
|
|
18
|
+
const handleGivingTypeChange = (thisButtonType, currentGivingType) => {
|
|
17
19
|
if (currentGivingType !== thisButtonType) {
|
|
18
20
|
changeGivingType(thisButtonType);
|
|
19
21
|
setPopOpen(thisButtonType === 'single');
|
|
@@ -27,9 +29,7 @@ var GivingSelector = function GivingSelector(_ref) {
|
|
|
27
29
|
type: "radio",
|
|
28
30
|
label: "",
|
|
29
31
|
checked: givingType === 'single',
|
|
30
|
-
onClick:
|
|
31
|
-
return handleGivingTypeChange('single', givingType);
|
|
32
|
-
}
|
|
32
|
+
onClick: () => handleGivingTypeChange('single', givingType)
|
|
33
33
|
}), /*#__PURE__*/_react.default.createElement(_GivingSelector.Label, {
|
|
34
34
|
active: givingType === 'single',
|
|
35
35
|
htmlFor: "give-once--".concat(mbshipID)
|
|
@@ -41,9 +41,7 @@ var GivingSelector = function GivingSelector(_ref) {
|
|
|
41
41
|
type: "radio",
|
|
42
42
|
label: "",
|
|
43
43
|
checked: givingType === 'monthly',
|
|
44
|
-
onClick:
|
|
45
|
-
return handleGivingTypeChange('monthly', givingType);
|
|
46
|
-
}
|
|
44
|
+
onClick: () => handleGivingTypeChange('monthly', givingType)
|
|
47
45
|
}), /*#__PURE__*/_react.default.createElement(_GivingSelector.Label, {
|
|
48
46
|
active: givingType === 'monthly',
|
|
49
47
|
htmlFor: "give-monthly--".concat(mbshipID)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
@@ -10,44 +10,60 @@ var _size = require("../../../../theme/shared/size");
|
|
|
10
10
|
var _spacing = _interopRequireDefault(require("../../../../theme/shared/spacing"));
|
|
11
11
|
var _zIndex = _interopRequireDefault(require("../../../../theme/shared/zIndex"));
|
|
12
12
|
var _hideVisually = _interopRequireDefault(require("../../../../theme/shared/hideVisually"));
|
|
13
|
-
|
|
13
|
+
const Switch = exports.Switch = _styledComponents.default.span.withConfig({
|
|
14
14
|
displayName: "GivingSelectorstyle__Switch",
|
|
15
15
|
componentId: "sc-5ktn9c-0"
|
|
16
|
-
})(["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'),
|
|
17
|
-
|
|
16
|
+
})(["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'), _ref => {
|
|
17
|
+
let {
|
|
18
|
+
theme
|
|
19
|
+
} = _ref;
|
|
18
20
|
return theme.color('blue');
|
|
19
21
|
});
|
|
20
|
-
|
|
22
|
+
const Wrapper = exports.Wrapper = _styledComponents.default.div.withConfig({
|
|
21
23
|
displayName: "GivingSelectorstyle__Wrapper",
|
|
22
24
|
componentId: "sc-5ktn9c-1"
|
|
23
25
|
})(["display:flex;margin:", " 0;"], (0, _spacing.default)('md'));
|
|
24
|
-
|
|
26
|
+
const MoneyBox = exports.MoneyBox = _styledComponents.default.div.withConfig({
|
|
25
27
|
displayName: "GivingSelectorstyle__MoneyBox",
|
|
26
28
|
componentId: "sc-5ktn9c-2"
|
|
27
|
-
})(["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'),
|
|
28
|
-
|
|
29
|
+
})(["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'), _ref2 => {
|
|
30
|
+
let {
|
|
31
|
+
theme
|
|
32
|
+
} = _ref2;
|
|
29
33
|
return theme.color('blue_light');
|
|
30
|
-
}, (0, _size.media)('small'), Switch, _hideVisually.default,
|
|
31
|
-
|
|
34
|
+
}, (0, _size.media)('small'), Switch, _hideVisually.default, _ref3 => {
|
|
35
|
+
let {
|
|
36
|
+
theme
|
|
37
|
+
} = _ref3;
|
|
32
38
|
return theme.color('blue');
|
|
33
39
|
});
|
|
34
|
-
|
|
40
|
+
const Label = exports.Label = _styledComponents.default.label.withConfig({
|
|
35
41
|
displayName: "GivingSelectorstyle__Label",
|
|
36
42
|
componentId: "sc-5ktn9c-3"
|
|
37
|
-
})(["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 ", ";}"],
|
|
38
|
-
|
|
43
|
+
})(["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 ", ";}"], _ref4 => {
|
|
44
|
+
let {
|
|
45
|
+
theme
|
|
46
|
+
} = _ref4;
|
|
39
47
|
return theme.fontSize('s');
|
|
40
|
-
},
|
|
41
|
-
|
|
48
|
+
}, _ref5 => {
|
|
49
|
+
let {
|
|
50
|
+
theme
|
|
51
|
+
} = _ref5;
|
|
42
52
|
return theme.fontFamilies('Montserrat');
|
|
43
|
-
}, (0, _zIndex.default)('medium'),
|
|
44
|
-
|
|
53
|
+
}, (0, _zIndex.default)('medium'), _ref6 => {
|
|
54
|
+
let {
|
|
55
|
+
active
|
|
56
|
+
} = _ref6;
|
|
45
57
|
return active === true ? 'default' : 'pointer';
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
|
|
58
|
+
}, _ref7 => {
|
|
59
|
+
let {
|
|
60
|
+
active,
|
|
61
|
+
theme
|
|
62
|
+
} = _ref7;
|
|
49
63
|
return active === true ? theme.color('white') : theme.color('black');
|
|
50
|
-
},
|
|
51
|
-
|
|
64
|
+
}, _ref8 => {
|
|
65
|
+
let {
|
|
66
|
+
theme
|
|
67
|
+
} = _ref8;
|
|
52
68
|
return theme.color('blue');
|
|
53
69
|
});
|
|
@@ -1,56 +1,73 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
8
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
11
|
var _Input = _interopRequireDefault(require("../../../Atoms/Input/Input"));
|
|
12
12
|
var _spacing = _interopRequireDefault(require("../../../../theme/shared/spacing"));
|
|
13
13
|
var _size = require("../../../../theme/shared/size");
|
|
14
|
-
|
|
15
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; }
|
|
17
|
-
var MoneyBuyButton = (0, _styledComponents.default)(_Input.default).withConfig({
|
|
14
|
+
const MoneyBuyButton = (0, _styledComponents.default)(_Input.default).withConfig({
|
|
18
15
|
displayName: "MoneyBuy__MoneyBuyButton",
|
|
19
16
|
componentId: "sc-38g5hn-0"
|
|
20
|
-
})(["display:block;input{border:none;background-color:", ";color:", ";font-size:", ";font-family:", ";font-weight:normal;border-radius:10px;padding:", ";box-shadow:0px 0px 16px rgba(0,0,0,0.15);height:auto;", "{font-size:", ";padding:", ";}&:focus{border:none;outline:none;box-shadow:inset 0 0 0 4px ", ";}&:active:focus{box-shadow:0px 0px 16px rgba(0,0,0,0.3);}", "}"],
|
|
21
|
-
|
|
17
|
+
})(["display:block;input{border:none;background-color:", ";color:", ";font-size:", ";font-family:", ";font-weight:normal;border-radius:10px;padding:", ";box-shadow:0px 0px 16px rgba(0,0,0,0.15);height:auto;", "{font-size:", ";padding:", ";}&:focus{border:none;outline:none;box-shadow:inset 0 0 0 4px ", ";}&:active:focus{box-shadow:0px 0px 16px rgba(0,0,0,0.3);}", "}"], _ref => {
|
|
18
|
+
let {
|
|
19
|
+
theme
|
|
20
|
+
} = _ref;
|
|
22
21
|
return theme.color('blue_light');
|
|
23
|
-
},
|
|
24
|
-
|
|
22
|
+
}, _ref2 => {
|
|
23
|
+
let {
|
|
24
|
+
theme
|
|
25
|
+
} = _ref2;
|
|
25
26
|
return theme.color('black');
|
|
26
|
-
},
|
|
27
|
-
|
|
27
|
+
}, _ref3 => {
|
|
28
|
+
let {
|
|
29
|
+
theme
|
|
30
|
+
} = _ref3;
|
|
28
31
|
return theme.fontSize('l');
|
|
29
|
-
},
|
|
30
|
-
|
|
32
|
+
}, _ref4 => {
|
|
33
|
+
let {
|
|
34
|
+
theme
|
|
35
|
+
} = _ref4;
|
|
31
36
|
return theme.fontFamilies('Anton');
|
|
32
|
-
}, (0, _spacing.default)('s'), (0, _size.media)('small'),
|
|
33
|
-
|
|
37
|
+
}, (0, _spacing.default)('s'), (0, _size.media)('small'), _ref5 => {
|
|
38
|
+
let {
|
|
39
|
+
theme
|
|
40
|
+
} = _ref5;
|
|
34
41
|
return theme.fontSize('xl');
|
|
35
|
-
}, (0, _spacing.default)('m'),
|
|
36
|
-
|
|
42
|
+
}, (0, _spacing.default)('m'), _ref6 => {
|
|
43
|
+
let {
|
|
44
|
+
theme
|
|
45
|
+
} = _ref6;
|
|
37
46
|
return theme.color('blue');
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
}, _ref7 => {
|
|
48
|
+
let {
|
|
49
|
+
isSelected
|
|
50
|
+
} = _ref7;
|
|
51
|
+
return isSelected && (0, _styledComponents.css)(["background-color:", ";box-shadow:0px 0px 16px rgba(0,0,0,0.3);color:", ";&:focus{box-shadow:0px 0px 16px rgba(0,0,0,0.3);}"], _ref8 => {
|
|
52
|
+
let {
|
|
53
|
+
theme
|
|
54
|
+
} = _ref8;
|
|
42
55
|
return theme.color('blue');
|
|
43
|
-
},
|
|
44
|
-
|
|
56
|
+
}, _ref9 => {
|
|
57
|
+
let {
|
|
58
|
+
theme
|
|
59
|
+
} = _ref9;
|
|
45
60
|
return theme.color('white');
|
|
46
61
|
});
|
|
47
62
|
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
63
|
+
const MoneyBuy = _ref10 => {
|
|
64
|
+
let {
|
|
65
|
+
setOtherAmount,
|
|
66
|
+
amount,
|
|
67
|
+
currency,
|
|
68
|
+
description,
|
|
69
|
+
...rest
|
|
70
|
+
} = _ref10;
|
|
54
71
|
return /*#__PURE__*/_react.default.createElement(MoneyBuyButton, Object.assign({}, rest, {
|
|
55
72
|
"aria-label": description,
|
|
56
73
|
value: "".concat(currency, " ").concat(amount),
|