@comicrelief/component-library 7.24.0 → 7.24.2
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 +3 -3
- package/dist/components/Atoms/SocialIcons/Utils/Links.js +19 -20
- package/dist/components/Atoms/SocialIcons/assets/X-white-Subtract.svg +3 -0
- 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 +34 -37
- 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 +53 -78
- 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/Atoms/SocialIcons/Utils/Icons.js +1 -1
- package/src/components/Atoms/SocialIcons/assets/X-white-Subtract.svg +3 -0
- package/src/components/Molecules/Logos/Logos.js +18 -6
- package/src/components/Molecules/Logos/Logos.md +5 -0
- 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
- package/dist/components/Atoms/SocialIcons/assets/x-logo.svg +0 -3
- package/src/components/Atoms/SocialIcons/assets/x-logo.svg +0 -3
|
@@ -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),
|
|
@@ -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
|
});
|
|
@@ -9,76 +9,102 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
9
9
|
var _spacing = _interopRequireDefault(require("../../../theme/shared/spacing"));
|
|
10
10
|
var _TextInput = _interopRequireDefault(require("./_TextInput"));
|
|
11
11
|
var _Text = _interopRequireDefault(require("../../Atoms/Text/Text"));
|
|
12
|
-
|
|
12
|
+
const ESUWrapper = exports.ESUWrapper = _styledComponents.default.div.withConfig({
|
|
13
13
|
displayName: "EmailSignUpstyle__ESUWrapper",
|
|
14
14
|
componentId: "sc-w2b8yk-0"
|
|
15
|
-
})(["display:flex;flex-direction:column;font-size:", ";color:", ";background-color:", ";padding:", ";"],
|
|
16
|
-
|
|
15
|
+
})(["display:flex;flex-direction:column;font-size:", ";color:", ";background-color:", ";padding:", ";"], _ref => {
|
|
16
|
+
let {
|
|
17
|
+
theme
|
|
18
|
+
} = _ref;
|
|
17
19
|
return theme.fontSize('s');
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
+
}, _ref2 => {
|
|
21
|
+
let {
|
|
22
|
+
theme
|
|
23
|
+
} = _ref2;
|
|
20
24
|
return theme.color('white');
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
}, _ref3 => {
|
|
26
|
+
let {
|
|
27
|
+
theme,
|
|
28
|
+
backgroundColour
|
|
29
|
+
} = _ref3;
|
|
24
30
|
return theme.color(backgroundColour);
|
|
25
31
|
}, (0, _spacing.default)('m'));
|
|
26
|
-
|
|
32
|
+
const TopCopyWrapper = exports.TopCopyWrapper = _styledComponents.default.div.withConfig({
|
|
27
33
|
displayName: "EmailSignUpstyle__TopCopyWrapper",
|
|
28
34
|
componentId: "sc-w2b8yk-1"
|
|
29
35
|
})(["display:flex;margin-bottom:", ";"], (0, _spacing.default)('md'));
|
|
30
|
-
|
|
36
|
+
const ButtonWrapper = exports.ButtonWrapper = _styledComponents.default.div.withConfig({
|
|
31
37
|
displayName: "EmailSignUpstyle__ButtonWrapper",
|
|
32
38
|
componentId: "sc-w2b8yk-2"
|
|
33
|
-
})(["margin-top:", ";button{background-color:", ";}"], (0, _spacing.default)('md'),
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
})(["margin-top:", ";button{background-color:", ";}"], (0, _spacing.default)('md'), _ref4 => {
|
|
40
|
+
let {
|
|
41
|
+
theme,
|
|
42
|
+
buttonColour
|
|
43
|
+
} = _ref4;
|
|
36
44
|
return theme.color(buttonColour);
|
|
37
45
|
});
|
|
38
|
-
|
|
46
|
+
const PrivacyCopyWrapper = exports.PrivacyCopyWrapper = _styledComponents.default.div.withConfig({
|
|
39
47
|
displayName: "EmailSignUpstyle__PrivacyCopyWrapper",
|
|
40
48
|
componentId: "sc-w2b8yk-3"
|
|
41
|
-
})(["display:flex;flex-direction:column;margin-top:", ";p{font-size:", ";line-height:", ";a{font-size:", ";color:", ";}}"], (0, _spacing.default)('md'),
|
|
42
|
-
|
|
49
|
+
})(["display:flex;flex-direction:column;margin-top:", ";p{font-size:", ";line-height:", ";a{font-size:", ";color:", ";}}"], (0, _spacing.default)('md'), _ref5 => {
|
|
50
|
+
let {
|
|
51
|
+
theme
|
|
52
|
+
} = _ref5;
|
|
43
53
|
return theme.fontSize('s');
|
|
44
|
-
},
|
|
45
|
-
|
|
54
|
+
}, _ref6 => {
|
|
55
|
+
let {
|
|
56
|
+
theme
|
|
57
|
+
} = _ref6;
|
|
46
58
|
return theme.fontSize('xl');
|
|
47
|
-
},
|
|
48
|
-
|
|
59
|
+
}, _ref7 => {
|
|
60
|
+
let {
|
|
61
|
+
theme
|
|
62
|
+
} = _ref7;
|
|
49
63
|
return theme.fontSize('s');
|
|
50
|
-
},
|
|
51
|
-
|
|
64
|
+
}, _ref8 => {
|
|
65
|
+
let {
|
|
66
|
+
theme
|
|
67
|
+
} = _ref8;
|
|
52
68
|
return theme.color('white');
|
|
53
69
|
});
|
|
54
|
-
|
|
70
|
+
const FormInner = exports.FormInner = _styledComponents.default.div.withConfig({
|
|
55
71
|
displayName: "EmailSignUpstyle__FormInner",
|
|
56
72
|
componentId: "sc-w2b8yk-4"
|
|
57
73
|
})(["display:flex;flex-direction:column;margin:", " 0;"], (0, _spacing.default)('md'));
|
|
58
|
-
|
|
74
|
+
const NameWrapper = exports.NameWrapper = _styledComponents.default.div.withConfig({
|
|
59
75
|
displayName: "EmailSignUpstyle__NameWrapper",
|
|
60
76
|
componentId: "sc-w2b8yk-5"
|
|
61
|
-
})(["display:flex;flex-direction:column;gap:0;@media ", "{justify-content:start;flex-direction:", ";gap:", ";)};}"],
|
|
62
|
-
|
|
77
|
+
})(["display:flex;flex-direction:column;gap:0;@media ", "{justify-content:start;flex-direction:", ";gap:", ";)};}"], _ref9 => {
|
|
78
|
+
let {
|
|
79
|
+
theme
|
|
80
|
+
} = _ref9;
|
|
63
81
|
return theme.breakpoint('medium');
|
|
64
|
-
},
|
|
65
|
-
|
|
82
|
+
}, _ref10 => {
|
|
83
|
+
let {
|
|
84
|
+
columnLayout
|
|
85
|
+
} = _ref10;
|
|
66
86
|
return columnLayout ? 'column' : 'row';
|
|
67
|
-
},
|
|
68
|
-
|
|
87
|
+
}, _ref11 => {
|
|
88
|
+
let {
|
|
89
|
+
columnLayout
|
|
90
|
+
} = _ref11;
|
|
69
91
|
return columnLayout ? 0 : (0, _spacing.default)('md');
|
|
70
92
|
});
|
|
71
|
-
|
|
93
|
+
const InputField = exports.InputField = (0, _styledComponents.default)(_TextInput.default).withConfig({
|
|
72
94
|
displayName: "EmailSignUpstyle__InputField",
|
|
73
95
|
componentId: "sc-w2b8yk-6"
|
|
74
|
-
})(["width:100%;margin-bottom:", ";& > span:first-child{color:", ";}@media ", "{max-width:290px;}"], (0, _spacing.default)('md'),
|
|
75
|
-
|
|
96
|
+
})(["width:100%;margin-bottom:", ";& > span:first-child{color:", ";}@media ", "{max-width:290px;}"], (0, _spacing.default)('md'), _ref12 => {
|
|
97
|
+
let {
|
|
98
|
+
theme
|
|
99
|
+
} = _ref12;
|
|
76
100
|
return theme.color('white');
|
|
77
|
-
},
|
|
78
|
-
|
|
101
|
+
}, _ref13 => {
|
|
102
|
+
let {
|
|
103
|
+
theme
|
|
104
|
+
} = _ref13;
|
|
79
105
|
return theme.breakpoint('medium');
|
|
80
106
|
});
|
|
81
|
-
|
|
107
|
+
const Title = exports.Title = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
82
108
|
displayName: "EmailSignUpstyle__Title",
|
|
83
109
|
componentId: "sc-w2b8yk-7"
|
|
84
110
|
})(["margin-bottom:", ";"], (0, _spacing.default)('m'));
|
|
@@ -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
|
var _react = _interopRequireDefault(require("react"));
|
|
5
5
|
require("jest-styled-components");
|
|
6
6
|
var _shallowWithTheme = _interopRequireDefault(require("../../../hoc/shallowWithTheme"));
|
|
@@ -8,19 +8,19 @@ var _EmailSignUp = require("./_EmailSignUp");
|
|
|
8
8
|
var _RichText = _interopRequireDefault(require("../../Atoms/RichText/RichText"));
|
|
9
9
|
var _reactHookForm = require("react-hook-form");
|
|
10
10
|
var _yup = require("@hookform/resolvers/yup");
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const DummyForm = () => {
|
|
12
|
+
const formMethods = (0, _reactHookForm.useForm)({
|
|
13
13
|
mode: "onBlur",
|
|
14
14
|
resolver: (0, _yup.yupResolver)(_EmailSignUp.validationSchema)
|
|
15
15
|
});
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
const {
|
|
17
|
+
handleSubmit
|
|
18
|
+
} = formMethods;
|
|
19
|
+
const top = "<h1> Top Copy</h1> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>";
|
|
20
|
+
const success = "<h1> Success Copy</h1> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>";
|
|
21
|
+
const privacy = 'check <a href="https://www.comicrelief.com/privacy-notice">Privacy policy</a>';
|
|
20
22
|
return /*#__PURE__*/_react.default.createElement(_reactHookForm.FormProvider, formMethods, /*#__PURE__*/_react.default.createElement("form", {
|
|
21
|
-
onSubmit: handleSubmit(
|
|
22
|
-
return true;
|
|
23
|
-
}),
|
|
23
|
+
onSubmit: handleSubmit(() => true),
|
|
24
24
|
noValidate: true
|
|
25
25
|
}, /*#__PURE__*/_react.default.createElement(_EmailSignUp.EmailSignUp, {
|
|
26
26
|
title: "sign up letter",
|
|
@@ -36,7 +36,7 @@ var DummyForm = function DummyForm() {
|
|
|
36
36
|
formContext: formMethods
|
|
37
37
|
})));
|
|
38
38
|
};
|
|
39
|
-
it("renders correctly",
|
|
40
|
-
|
|
39
|
+
it("renders correctly", () => {
|
|
40
|
+
const tree = (0, _shallowWithTheme.default)( /*#__PURE__*/_react.default.createElement(DummyForm, null)).toJSON();
|
|
41
41
|
expect(tree).toMatchSnapshot();
|
|
42
42
|
});
|
|
@@ -1,65 +1,45 @@
|
|
|
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
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
9
|
var _reactHookForm = require("react-hook-form");
|
|
12
10
|
var _yup = require("@hookform/resolvers/yup");
|
|
13
11
|
var _RichText = _interopRequireDefault(require("../../Atoms/RichText/RichText"));
|
|
14
12
|
var _EmailSignUp = require("./_EmailSignUp");
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
const EmailSignUpForm = () => {
|
|
14
|
+
const validationSchema = (0, _EmailSignUp.buildEsuValidationSchema)({});
|
|
15
|
+
const formMethods = (0, _reactHookForm.useForm)({
|
|
18
16
|
mode: 'onBlur',
|
|
19
17
|
resolver: (0, _yup.yupResolver)(validationSchema)
|
|
20
18
|
});
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
const {
|
|
20
|
+
handleSubmit,
|
|
21
|
+
trigger,
|
|
22
|
+
setError
|
|
23
|
+
} = formMethods;
|
|
24
|
+
async function handleSubscribe(data) {
|
|
25
|
+
const valid = await trigger([_EmailSignUp.ESU_FIELDS.EMAIL, _EmailSignUp.ESU_FIELDS.FIRST_NAME, _EmailSignUp.ESU_FIELDS.LAST_NAME]);
|
|
26
|
+
if (valid) {
|
|
27
|
+
// eslint-disable-next-line no-console
|
|
28
|
+
console.log(data);
|
|
29
|
+
} else {
|
|
30
|
+
setError('formError', {
|
|
31
|
+
message: 'Error'
|
|
32
|
+
});
|
|
33
|
+
}
|
|
26
34
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var valid;
|
|
30
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
31
|
-
while (1) {
|
|
32
|
-
switch (_context.prev = _context.next) {
|
|
33
|
-
case 0:
|
|
34
|
-
_context.next = 2;
|
|
35
|
-
return trigger([_EmailSignUp.ESU_FIELDS.EMAIL, _EmailSignUp.ESU_FIELDS.FIRST_NAME, _EmailSignUp.ESU_FIELDS.LAST_NAME]);
|
|
36
|
-
case 2:
|
|
37
|
-
valid = _context.sent;
|
|
38
|
-
if (valid) {
|
|
39
|
-
// eslint-disable-next-line no-console
|
|
40
|
-
console.log(data);
|
|
41
|
-
} else {
|
|
42
|
-
setError('formError', {
|
|
43
|
-
message: 'Error'
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
case 4:
|
|
47
|
-
case "end":
|
|
48
|
-
return _context.stop();
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}, _callee);
|
|
52
|
-
}));
|
|
53
|
-
return _handleSubscribe.apply(this, arguments);
|
|
54
|
-
}
|
|
55
|
-
var title = 'Stay in the know!';
|
|
56
|
-
var topCopy = /*#__PURE__*/_react.default.createElement(_RichText.default, {
|
|
35
|
+
const title = 'Stay in the know!';
|
|
36
|
+
const topCopy = /*#__PURE__*/_react.default.createElement(_RichText.default, {
|
|
57
37
|
markup: "<p>Get regular email updates and info on what we're up to!</p>"
|
|
58
38
|
});
|
|
59
|
-
|
|
39
|
+
const privacyCopy = /*#__PURE__*/_react.default.createElement(_RichText.default, {
|
|
60
40
|
markup: '<p>Our <a class="link link--white inline" href="/privacy-notice">Privacy Policy</a> describes how we handle and protect your information.<br><br>If you are under 18, please make sure you have your parents’ permission before providing us with any personal details.</p>'
|
|
61
41
|
});
|
|
62
|
-
|
|
42
|
+
const successCopy = /*#__PURE__*/_react.default.createElement(_RichText.default, {
|
|
63
43
|
markup: "<p>Thanks! Your first email will be with you shortly</p>"
|
|
64
44
|
});
|
|
65
45
|
return /*#__PURE__*/_react.default.createElement(_reactHookForm.FormProvider, formMethods, /*#__PURE__*/_react.default.createElement("form", {
|