@comicrelief/component-library 7.37.0 → 7.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Atoms/Button/Button.js +10 -6
- package/dist/components/Atoms/Button/Button.test.js +2 -2
- package/dist/components/Atoms/Icons/Arrow.js +1 -1
- package/dist/components/Atoms/Icons/AtSign.js +1 -1
- package/dist/components/Atoms/Icons/Chevron.js +1 -1
- package/dist/components/Atoms/Icons/Download.js +1 -1
- package/dist/components/Atoms/Icons/External.js +1 -1
- package/dist/components/Atoms/Icons/Favourite.js +1 -1
- package/dist/components/Atoms/Icons/Internal.js +1 -1
- package/dist/components/Atoms/Input/Input.js +1 -1
- package/dist/components/Atoms/Link/Link.style.js +3 -3
- package/dist/components/Atoms/Logo/Logo.js +1 -1
- package/dist/components/Atoms/Select/Select.js +1 -1
- package/dist/components/Atoms/SocialIcons/SocialIcons.js +2 -2
- package/dist/components/Atoms/Text/Text.js +2 -2
- package/dist/components/Molecules/Accordion/Accordion.js +3 -3
- package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.js +6 -6
- package/dist/components/Molecules/Banner/Banner.js +2 -2
- package/dist/components/Molecules/Box/Box.js +4 -4
- package/dist/components/Molecules/CardDs/CardDs.style.js +9 -9
- package/dist/components/Molecules/Chip/Chip.style.js +26 -22
- package/dist/components/Molecules/Chip/Chip.test.js +2 -2
- package/dist/components/Molecules/DoubleCopy/DoubleCopy.style.js +1 -1
- package/dist/components/Molecules/InfoBanner/InfoBanner.js +2 -2
- package/dist/components/Molecules/PartnerLink/PartnerLink.style.js +1 -1
- package/dist/components/Molecules/Promo/Promo.style.js +65 -20
- package/dist/components/Molecules/Promo/_PromoVideoButton.style.js +1 -1
- package/dist/components/Molecules/SearchInput/SearchInput.style.js +7 -3
- package/dist/components/Molecules/SearchResult/SearchResult.js +3 -3
- package/dist/components/Molecules/SingleMessage/SingleMessage.style.js +93 -63
- package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.md +3 -3
- package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.style.js +6 -6
- package/dist/components/Organisms/CookieBanner/CookieBanner.style.js +2 -2
- package/dist/components/Organisms/Donate/Donate.style.js +96 -42
- package/dist/components/Organisms/Donate/Form/PopUpComponent.js +11 -7
- package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.style.js +17 -13
- package/dist/components/Organisms/Donate/MoneyBuy/MoneyBuy.js +17 -13
- package/dist/components/Organisms/EmailSignUp/EmailSignUp.style.js +2 -2
- package/dist/components/Organisms/EmailSignUp/__snapshots__/EmailSignUp.test.js.snap +8 -6
- package/dist/components/Organisms/Footer/Footer.style.js +4 -4
- package/dist/components/Organisms/Footer/Nav/Nav.style.js +8 -8
- package/dist/components/Organisms/Header/Burger/BurgerMenu.style.js +1 -1
- package/dist/components/Organisms/Header/Header.style.js +5 -5
- package/dist/components/Organisms/Header/Nav/Nav.style.js +6 -6
- package/dist/components/Organisms/ImpactSlider/ImpactMoneybuys.style.js +6 -6
- package/dist/components/Organisms/ImpactSlider/ImpactSlider.style.js +7 -7
- package/dist/components/Organisms/MarketingPreferencesDS/MarketingPreferencesDS.style.js +38 -29
- package/dist/components/Organisms/Membership/Membership.style.js +45 -26
- package/dist/components/Organisms/WYMDCarousel/WYMDCarousel.style.js +10 -10
- package/dist/index.js +7 -0
- package/dist/theme/crTheme/theme.js +2 -0
- package/dist/theme/shared/allBreakpoints.js +20 -0
- package/dist/theme/shared/allContainers.js +12 -0
- package/package.json +1 -1
- package/src/components/Atoms/Button/Button.js +2 -3
- package/src/components/Atoms/Button/Button.test.js +12 -10
- package/src/components/Atoms/Icons/Arrow.js +1 -1
- package/src/components/Atoms/Icons/AtSign.js +1 -1
- package/src/components/Atoms/Icons/Chevron.js +1 -1
- package/src/components/Atoms/Icons/Download.js +1 -1
- package/src/components/Atoms/Icons/External.js +1 -1
- package/src/components/Atoms/Icons/Favourite.js +1 -1
- package/src/components/Atoms/Icons/Internal.js +1 -1
- package/src/components/Atoms/Input/Input.js +1 -1
- package/src/components/Atoms/Link/Link.style.js +3 -3
- package/src/components/Atoms/Logo/Logo.js +1 -1
- package/src/components/Atoms/Select/Select.js +1 -1
- package/src/components/Atoms/SocialIcons/SocialIcons.js +2 -2
- package/src/components/Atoms/Text/Text.js +3 -3
- package/src/components/Molecules/Accordion/Accordion.js +6 -6
- package/src/components/Molecules/ArticleTeaser/ArticleTeaser.js +6 -6
- package/src/components/Molecules/Banner/Banner.js +2 -2
- package/src/components/Molecules/Box/Box.js +4 -4
- package/src/components/Molecules/CardDs/CardDs.style.js +9 -9
- package/src/components/Molecules/Chip/Chip.style.js +1 -2
- package/src/components/Molecules/Chip/Chip.test.js +12 -10
- package/src/components/Molecules/DoubleCopy/DoubleCopy.style.js +1 -1
- package/src/components/Molecules/InfoBanner/InfoBanner.js +2 -2
- package/src/components/Molecules/PartnerLink/PartnerLink.style.js +1 -1
- package/src/components/Molecules/Promo/Promo.style.js +10 -10
- package/src/components/Molecules/Promo/_PromoVideoButton.style.js +1 -1
- package/src/components/Molecules/SearchInput/SearchInput.style.js +1 -2
- package/src/components/Molecules/SearchResult/SearchResult.js +3 -3
- package/src/components/Molecules/SingleMessage/SingleMessage.style.js +13 -13
- package/src/components/Molecules/SingleMessageDS/SingleMessageDs.md +3 -3
- package/src/components/Molecules/SingleMessageDS/SingleMessageDs.style.js +6 -6
- package/src/components/Organisms/CookieBanner/CookieBanner.style.js +2 -2
- package/src/components/Organisms/Donate/Donate.style.js +11 -12
- package/src/components/Organisms/Donate/Form/PopUpComponent.js +1 -2
- package/src/components/Organisms/Donate/GivingSelector/GivingSelector.style.js +1 -2
- package/src/components/Organisms/Donate/MoneyBuy/MoneyBuy.js +1 -2
- package/src/components/Organisms/EmailSignUp/EmailSignUp.style.js +3 -3
- package/src/components/Organisms/EmailSignUp/__snapshots__/EmailSignUp.test.js.snap +8 -6
- package/src/components/Organisms/Footer/Footer.style.js +4 -4
- package/src/components/Organisms/Footer/Nav/Nav.style.js +8 -8
- package/src/components/Organisms/Header/Burger/BurgerMenu.style.js +1 -1
- package/src/components/Organisms/Header/Header.style.js +4 -4
- package/src/components/Organisms/Header/Nav/Nav.style.js +6 -6
- package/src/components/Organisms/ImpactSlider/ImpactMoneybuys.style.js +7 -7
- package/src/components/Organisms/ImpactSlider/ImpactSlider.style.js +8 -8
- package/src/components/Organisms/MarketingPreferencesDS/MarketingPreferencesDS.style.js +6 -7
- package/src/components/Organisms/Membership/Membership.style.js +6 -7
- package/src/components/Organisms/WYMDCarousel/WYMDCarousel.style.js +21 -21
- package/src/index.js +1 -0
- package/src/theme/crTheme/theme.js +2 -0
- package/src/theme/shared/allBreakpoints.js +14 -0
- package/src/theme/shared/allContainers.js +7 -0
|
@@ -9,11 +9,10 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
11
|
var _spacing = _interopRequireDefault(require("../../../theme/shared/spacing"));
|
|
12
|
-
var _breakpoint = _interopRequireDefault(require("../../../theme/shared/breakpoint"));
|
|
13
12
|
const StyledButton = _styledComponents.default.button.withConfig({
|
|
14
13
|
displayName: "Button__StyledButton",
|
|
15
14
|
componentId: "sc-1gm5vj0-0"
|
|
16
|
-
})(["display:inline-flex;position:relative;padding:0.5rem 1.25rem;text-decoration:none;font-weight:700;font-size:", ";border-radius:2rem;transition:all 0.3s;height:3.125rem;width:100%;justify-content:center;align-items:center;border:none;cursor:pointer;> a{text-decoration:none;}", ";@media ", "{width:auto;}", "{width:auto;padding:", " ", ";margin:0 auto ", ";}"], _ref => {
|
|
15
|
+
})(["display:inline-flex;position:relative;padding:0.5rem 1.25rem;text-decoration:none;font-weight:700;font-size:", ";border-radius:2rem;transition:all 0.3s;height:3.125rem;width:100%;justify-content:center;align-items:center;border:none;cursor:pointer;> a{text-decoration:none;}", ";@media ", "{width:auto;}@media ", "{width:auto;padding:", " ", ";margin:0 auto ", ";}"], _ref => {
|
|
17
16
|
let {
|
|
18
17
|
theme
|
|
19
18
|
} = _ref;
|
|
@@ -28,14 +27,19 @@ const StyledButton = _styledComponents.default.button.withConfig({
|
|
|
28
27
|
let {
|
|
29
28
|
theme
|
|
30
29
|
} = _ref3;
|
|
31
|
-
return theme.
|
|
32
|
-
},
|
|
33
|
-
|
|
30
|
+
return theme.allBreakpoints('M');
|
|
31
|
+
}, _ref4 => {
|
|
32
|
+
let {
|
|
33
|
+
theme
|
|
34
|
+
} = _ref4;
|
|
35
|
+
return theme.allBreakpoints('L');
|
|
36
|
+
}, (0, _spacing.default)('md'), (0, _spacing.default)('l'), (0, _spacing.default)('l'));
|
|
37
|
+
const Button = /*#__PURE__*/_react.default.forwardRef((_ref5, ref) => {
|
|
34
38
|
let {
|
|
35
39
|
children,
|
|
36
40
|
wrapper,
|
|
37
41
|
...rest
|
|
38
|
-
} =
|
|
42
|
+
} = _ref5;
|
|
39
43
|
return /*#__PURE__*/_react.default.createElement(StyledButton, Object.assign({}, rest, {
|
|
40
44
|
as: wrapper ? 'span' : 'button',
|
|
41
45
|
ref: ref
|
|
@@ -5,9 +5,9 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
5
5
|
require("jest-styled-components");
|
|
6
6
|
var _shallowWithTheme = _interopRequireDefault(require("../../../hoc/shallowWithTheme"));
|
|
7
7
|
var _Button = _interopRequireDefault(require("./Button"));
|
|
8
|
-
it(
|
|
8
|
+
it("renders a standard styled link correctly", () => {
|
|
9
9
|
const tree = (0, _shallowWithTheme.default)( /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
10
10
|
type: "submit"
|
|
11
11
|
}, "A standard link")).toJSON();
|
|
12
|
-
expect(tree).toMatchInlineSnapshot("\n .c0 {\n display: -webkit-inline-box;\n display: -webkit-inline-flex;\n display: -ms-inline-flexbox;\n display: inline-flex;\n position: relative;\n padding: 0.5rem 1.25rem;\n -webkit-text-decoration: none;\n text-decoration: none;\n font-weight: 700;\n font-size: 1rem;\n border-radius: 2rem;\n -webkit-transition: all 0.3s;\n transition: all 0.3s;\n height: 3.125rem;\n width: 100%;\n -webkit-box-pack: center;\n -webkit-justify-content: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-align-items: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n border: none;\n cursor: pointer;\n background-color: #E52630;\n color: #FFFFFF;\n }\n\n .c0 > a {\n -webkit-text-decoration: none;\n text-decoration: none;\n }\n\n .c0:hover {\n background-color: #890B11;\n color: #FFFFFF;\n }\n\n
|
|
12
|
+
expect(tree).toMatchInlineSnapshot("\n .c0 {\n display: -webkit-inline-box;\n display: -webkit-inline-flex;\n display: -ms-inline-flexbox;\n display: inline-flex;\n position: relative;\n padding: 0.5rem 1.25rem;\n -webkit-text-decoration: none;\n text-decoration: none;\n font-weight: 700;\n font-size: 1rem;\n border-radius: 2rem;\n -webkit-transition: all 0.3s;\n transition: all 0.3s;\n height: 3.125rem;\n width: 100%;\n -webkit-box-pack: center;\n -webkit-justify-content: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-align-items: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n border: none;\n cursor: pointer;\n background-color: #E52630;\n color: #FFFFFF;\n }\n\n .c0 > a {\n -webkit-text-decoration: none;\n text-decoration: none;\n }\n\n .c0:hover {\n background-color: #890B11;\n color: #FFFFFF;\n }\n\n @media (min-width:740px) {\n .c0 {\n width: auto;\n }\n }\n\n @media (min-width:1024px) {\n .c0 {\n width: auto;\n padding: 1rem 2rem;\n margin: 0 auto 2rem;\n }\n }\n\n <button\n className=\"c0\"\n type=\"submit\"\n >\n A standard link\n </button>\n ");
|
|
13
13
|
});
|
|
@@ -25,7 +25,7 @@ const InputField = _styledComponents.default.input.withConfig({
|
|
|
25
25
|
error,
|
|
26
26
|
prefixLength
|
|
27
27
|
} = _ref;
|
|
28
|
-
return (0, _styledComponents.css)(["position:relative;box-sizing:border-box;width:100%;height:48px;padding:", " ", ";", " background-color:", ";border:1px solid;border-color:", ";box-shadow:none;appearance:none;color:", ";border-radius:", ";font-size:inherit;z-index:2;font-family:", ";:focus{border:1px solid ", ";}@media ", "{max-width:290px;}"], (0, _spacing.default)('md'), (0, _spacing.default)('m'), prefixLength > 0 ? "padding-left: ".concat(getPrefixWidth(prefixLength), ";") : '', theme.color('grey_light'), error ? theme.color('red') : theme.color('grey_medium'), theme.color('black'), (0, _spacing.default)('sm'), theme.fontFamilies(theme.font.regular), theme.color('grey_for_forms'), theme.
|
|
28
|
+
return (0, _styledComponents.css)(["position:relative;box-sizing:border-box;width:100%;height:48px;padding:", " ", ";", " background-color:", ";border:1px solid;border-color:", ";box-shadow:none;appearance:none;color:", ";border-radius:", ";font-size:inherit;z-index:2;font-family:", ";:focus{border:1px solid ", ";}@media ", "{max-width:290px;}"], (0, _spacing.default)('md'), (0, _spacing.default)('m'), prefixLength > 0 ? "padding-left: ".concat(getPrefixWidth(prefixLength), ";") : '', theme.color('grey_light'), error ? theme.color('red') : theme.color('grey_medium'), theme.color('black'), (0, _spacing.default)('sm'), theme.fontFamilies(theme.font.regular), theme.color('grey_for_forms'), theme.allBreakpoints('M'));
|
|
29
29
|
});
|
|
30
30
|
const InputWrapper = _styledComponents.default.div.withConfig({
|
|
31
31
|
displayName: "Input__InputWrapper",
|
|
@@ -30,12 +30,12 @@ const buttonStyle = () => (0, _styledComponents.css)(["display:inline-flex;posit
|
|
|
30
30
|
let {
|
|
31
31
|
theme
|
|
32
32
|
} = _ref4;
|
|
33
|
-
return theme.
|
|
33
|
+
return theme.allBreakpoints('M');
|
|
34
34
|
}, _ref5 => {
|
|
35
35
|
let {
|
|
36
36
|
theme
|
|
37
37
|
} = _ref5;
|
|
38
|
-
return theme.
|
|
38
|
+
return theme.allBreakpoints('L');
|
|
39
39
|
}, _ref6 => {
|
|
40
40
|
let {
|
|
41
41
|
color,
|
|
@@ -68,7 +68,7 @@ const IconWrapper = exports.IconWrapper = _styledComponents.default.span.withCon
|
|
|
68
68
|
let {
|
|
69
69
|
theme
|
|
70
70
|
} = _ref10;
|
|
71
|
-
return theme.
|
|
71
|
+
return theme.allBreakpoints('M');
|
|
72
72
|
}, _ref11 => {
|
|
73
73
|
let {
|
|
74
74
|
type
|
|
@@ -52,7 +52,7 @@ const StyledSelect = _styledComponents.default.select.withConfig({
|
|
|
52
52
|
let {
|
|
53
53
|
theme
|
|
54
54
|
} = _ref7;
|
|
55
|
-
return theme.
|
|
55
|
+
return theme.allBreakpoints('M');
|
|
56
56
|
});
|
|
57
57
|
const Select = /*#__PURE__*/_react.default.forwardRef((_ref8, ref) => {
|
|
58
58
|
let {
|
|
@@ -18,7 +18,7 @@ const StyledList = _styledComponents.default.ul.withConfig({
|
|
|
18
18
|
let {
|
|
19
19
|
theme
|
|
20
20
|
} = _ref;
|
|
21
|
-
return theme.
|
|
21
|
+
return theme.allBreakpoints('M');
|
|
22
22
|
});
|
|
23
23
|
const StyledItem = _styledComponents.default.li.withConfig({
|
|
24
24
|
displayName: "SocialIcons__StyledItem",
|
|
@@ -27,7 +27,7 @@ const StyledItem = _styledComponents.default.li.withConfig({
|
|
|
27
27
|
let {
|
|
28
28
|
theme
|
|
29
29
|
} = _ref2;
|
|
30
|
-
return theme.
|
|
30
|
+
return theme.allBreakpoints('M');
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
/** Social media icons with customizable style linked to campaign social media accounts */
|
|
@@ -67,7 +67,7 @@ const BaseText = exports.BaseText = _styledComponents.default.span.withConfig({
|
|
|
67
67
|
size,
|
|
68
68
|
theme
|
|
69
69
|
} = _ref10;
|
|
70
|
-
return size === 'super' ? (0, _styledComponents.css)(["font-size:", ";line-height:3rem;@media ", "{font-size:", ";line-height:", ";margin-bottom:2rem;}@media ", "{font-size:", ";line-height:", ";margin-bottom:2rem;}"], theme.fontSize('xxl'), theme.
|
|
70
|
+
return size === 'super' ? (0, _styledComponents.css)(["font-size:", ";line-height:3rem;@media ", "{font-size:", ";line-height:", ";margin-bottom:2rem;}@media ", "{font-size:", ";line-height:", ";margin-bottom:2rem;}"], theme.fontSize('xxl'), theme.allBreakpoints('M'), theme.fontSize('big'), theme.fontSize('big'), theme.allBreakpoints('L'), theme.fontSize('super'), theme.fontSize('super')) : null;
|
|
71
71
|
}, _ref11 => {
|
|
72
72
|
let {
|
|
73
73
|
mobileColor,
|
|
@@ -79,7 +79,7 @@ const BaseText = exports.BaseText = _styledComponents.default.span.withConfig({
|
|
|
79
79
|
size,
|
|
80
80
|
theme
|
|
81
81
|
} = _ref12;
|
|
82
|
-
return size === 'm' ? (0, _styledComponents.css)(["font-size:", ";@media ", "{font-size:", ";}"], theme.fontSize('s'), theme.
|
|
82
|
+
return size === 'm' ? (0, _styledComponents.css)(["font-size:", ";@media ", "{font-size:", ";}"], theme.fontSize('s'), theme.allBreakpoints('M'), theme.fontSize('m')) : null;
|
|
83
83
|
});
|
|
84
84
|
|
|
85
85
|
/** Text renders different elements based on the `tag` prop
|
|
@@ -27,7 +27,7 @@ const Button = _styledComponents.default.button.withConfig({
|
|
|
27
27
|
let {
|
|
28
28
|
theme
|
|
29
29
|
} = _ref2;
|
|
30
|
-
return theme.
|
|
30
|
+
return theme.allBreakpoints('M');
|
|
31
31
|
}, (0, _spacing.default)('l'), (0, _spacing.default)('lg'));
|
|
32
32
|
const Icon = _styledComponents.default.div.withConfig({
|
|
33
33
|
displayName: "Accordion__Icon",
|
|
@@ -40,7 +40,7 @@ const Copy = _styledComponents.default.div.withConfig({
|
|
|
40
40
|
let {
|
|
41
41
|
theme
|
|
42
42
|
} = _ref3;
|
|
43
|
-
return theme.
|
|
43
|
+
return theme.allBreakpoints('M');
|
|
44
44
|
}, (0, _spacing.default)('lg'), _ref4 => {
|
|
45
45
|
let {
|
|
46
46
|
isOpen
|
|
@@ -49,7 +49,7 @@ const Copy = _styledComponents.default.div.withConfig({
|
|
|
49
49
|
let {
|
|
50
50
|
theme
|
|
51
51
|
} = _ref5;
|
|
52
|
-
return theme.
|
|
52
|
+
return theme.allBreakpoints('M');
|
|
53
53
|
}, (0, _spacing.default)('lg'), (0, _spacing.default)('l'));
|
|
54
54
|
});
|
|
55
55
|
const Accordion = _ref6 => {
|
|
@@ -44,12 +44,12 @@ const Link = (0, _styledComponents.default)(_Link.default).withConfig({
|
|
|
44
44
|
let {
|
|
45
45
|
theme
|
|
46
46
|
} = _ref4;
|
|
47
|
-
return theme.
|
|
47
|
+
return theme.allBreakpoints('M');
|
|
48
48
|
}, _ref5 => {
|
|
49
49
|
let {
|
|
50
50
|
theme
|
|
51
51
|
} = _ref5;
|
|
52
|
-
return theme.
|
|
52
|
+
return theme.allBreakpoints('L');
|
|
53
53
|
}, _ref6 => {
|
|
54
54
|
let {
|
|
55
55
|
category
|
|
@@ -72,12 +72,12 @@ const ImageWrapper = _styledComponents.default.div.withConfig({
|
|
|
72
72
|
let {
|
|
73
73
|
theme
|
|
74
74
|
} = _ref9;
|
|
75
|
-
return theme.
|
|
75
|
+
return theme.allBreakpoints('M');
|
|
76
76
|
}, _ref10 => {
|
|
77
77
|
let {
|
|
78
78
|
theme
|
|
79
79
|
} = _ref10;
|
|
80
|
-
return theme.
|
|
80
|
+
return theme.allBreakpoints('L');
|
|
81
81
|
});
|
|
82
82
|
});
|
|
83
83
|
const CopyWrapper = _styledComponents.default.div.withConfig({
|
|
@@ -91,13 +91,13 @@ const CopyWrapper = _styledComponents.default.div.withConfig({
|
|
|
91
91
|
let {
|
|
92
92
|
theme
|
|
93
93
|
} = _ref12;
|
|
94
|
-
return theme.
|
|
94
|
+
return theme.allBreakpoints('M');
|
|
95
95
|
});
|
|
96
96
|
}, _ref13 => {
|
|
97
97
|
let {
|
|
98
98
|
theme
|
|
99
99
|
} = _ref13;
|
|
100
|
-
return theme.
|
|
100
|
+
return theme.allBreakpoints('L');
|
|
101
101
|
});
|
|
102
102
|
const Title = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
103
103
|
displayName: "ArticleTeaser__Title",
|
|
@@ -26,12 +26,12 @@ const Container = _styledComponents.default.div.withConfig({
|
|
|
26
26
|
let {
|
|
27
27
|
theme
|
|
28
28
|
} = _ref2;
|
|
29
|
-
return theme.
|
|
29
|
+
return theme.allBreakpoints('M');
|
|
30
30
|
}, (0, _spacing.default)('xl'), (0, _spacing.default)('l'), _ref3 => {
|
|
31
31
|
let {
|
|
32
32
|
theme
|
|
33
33
|
} = _ref3;
|
|
34
|
-
return theme.
|
|
34
|
+
return theme.allBreakpoints('XL');
|
|
35
35
|
}, (0, _spacing.default)('xl'), (0, _spacing.default)('xl'));
|
|
36
36
|
const Banner = _ref4 => {
|
|
37
37
|
let {
|
|
@@ -16,12 +16,12 @@ const Container = _styledComponents.default.div.withConfig({
|
|
|
16
16
|
let {
|
|
17
17
|
theme
|
|
18
18
|
} = _ref;
|
|
19
|
-
return theme.
|
|
19
|
+
return theme.allBreakpoints('M');
|
|
20
20
|
}, _ref2 => {
|
|
21
21
|
let {
|
|
22
22
|
theme
|
|
23
23
|
} = _ref2;
|
|
24
|
-
return theme.
|
|
24
|
+
return theme.allBreakpoints('XL');
|
|
25
25
|
});
|
|
26
26
|
const Image = _styledComponents.default.div.withConfig({
|
|
27
27
|
displayName: "Box__Image",
|
|
@@ -34,12 +34,12 @@ const Copy = _styledComponents.default.div.withConfig({
|
|
|
34
34
|
let {
|
|
35
35
|
theme
|
|
36
36
|
} = _ref3;
|
|
37
|
-
return theme.
|
|
37
|
+
return theme.allBreakpoints('M');
|
|
38
38
|
}, _ref4 => {
|
|
39
39
|
let {
|
|
40
40
|
theme
|
|
41
41
|
} = _ref4;
|
|
42
|
-
return theme.
|
|
42
|
+
return theme.allBreakpoints('XL');
|
|
43
43
|
});
|
|
44
44
|
const Box = _ref5 => {
|
|
45
45
|
let {
|
|
@@ -22,12 +22,12 @@ const Container = exports.Container = _styledComponents.default.div.withConfig({
|
|
|
22
22
|
let {
|
|
23
23
|
theme
|
|
24
24
|
} = _ref2;
|
|
25
|
-
return theme.
|
|
25
|
+
return theme.allBreakpoints('M');
|
|
26
26
|
}, _ref3 => {
|
|
27
27
|
let {
|
|
28
28
|
theme
|
|
29
29
|
} = _ref3;
|
|
30
|
-
return theme.
|
|
30
|
+
return theme.allBreakpoints('XL');
|
|
31
31
|
});
|
|
32
32
|
const Image = exports.Image = _styledComponents.default.div.withConfig({
|
|
33
33
|
displayName: "CardDsstyle__Image",
|
|
@@ -36,7 +36,7 @@ const Image = exports.Image = _styledComponents.default.div.withConfig({
|
|
|
36
36
|
let {
|
|
37
37
|
theme
|
|
38
38
|
} = _ref4;
|
|
39
|
-
return theme.
|
|
39
|
+
return theme.allBreakpoints('M');
|
|
40
40
|
}, (0, _spacing.default)('m'), (0, _spacing.default)('m'), (0, _spacing.default)('md'), (0, _spacing.default)('md'));
|
|
41
41
|
const MediaLink = exports.MediaLink = _styledComponents.default.a.withConfig({
|
|
42
42
|
displayName: "CardDsstyle__MediaLink",
|
|
@@ -45,12 +45,12 @@ const MediaLink = exports.MediaLink = _styledComponents.default.a.withConfig({
|
|
|
45
45
|
let {
|
|
46
46
|
theme
|
|
47
47
|
} = _ref5;
|
|
48
|
-
return theme.
|
|
48
|
+
return theme.allBreakpoints('M');
|
|
49
49
|
}, _ref6 => {
|
|
50
50
|
let {
|
|
51
51
|
theme
|
|
52
52
|
} = _ref6;
|
|
53
|
-
return theme.
|
|
53
|
+
return theme.allBreakpoints('XL');
|
|
54
54
|
});
|
|
55
55
|
const Copy = exports.Copy = _styledComponents.default.div.withConfig({
|
|
56
56
|
displayName: "CardDsstyle__Copy",
|
|
@@ -70,7 +70,7 @@ const Copy = exports.Copy = _styledComponents.default.div.withConfig({
|
|
|
70
70
|
let {
|
|
71
71
|
theme
|
|
72
72
|
} = _ref9;
|
|
73
|
-
return theme.
|
|
73
|
+
return theme.allBreakpoints('XL');
|
|
74
74
|
}, (0, _zIndex.default)('low'), _ref10 => {
|
|
75
75
|
let {
|
|
76
76
|
hasImage
|
|
@@ -79,12 +79,12 @@ const Copy = exports.Copy = _styledComponents.default.div.withConfig({
|
|
|
79
79
|
let {
|
|
80
80
|
theme
|
|
81
81
|
} = _ref11;
|
|
82
|
-
return theme.
|
|
82
|
+
return theme.allBreakpoints('M');
|
|
83
83
|
}, (0, _spacing.default)('m'), (0, _spacing.default)('m'), (0, _spacing.default)('m'), _ref12 => {
|
|
84
84
|
let {
|
|
85
85
|
theme
|
|
86
86
|
} = _ref12;
|
|
87
|
-
return theme.
|
|
87
|
+
return theme.allBreakpoints('XL');
|
|
88
88
|
}, (0, _spacing.default)('m'), (0, _spacing.default)('m'));
|
|
89
89
|
});
|
|
90
90
|
const CTA = exports.CTA = _styledComponents.default.div.withConfig({
|
|
@@ -94,7 +94,7 @@ const CTA = exports.CTA = _styledComponents.default.div.withConfig({
|
|
|
94
94
|
let {
|
|
95
95
|
theme
|
|
96
96
|
} = _ref13;
|
|
97
|
-
return theme.
|
|
97
|
+
return theme.allBreakpoints('M');
|
|
98
98
|
}, (0, _spacing.default)('l'), (0, _spacing.default)('md'), _ref14 => {
|
|
99
99
|
let {
|
|
100
100
|
hasImage
|
|
@@ -8,7 +8,6 @@ exports.Overlay = exports.LabelGroup = exports.ClearButton = exports.CheckLabel
|
|
|
8
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
9
|
var _spacing = _interopRequireDefault(require("../../../theme/shared/spacing"));
|
|
10
10
|
var _zIndex = _interopRequireDefault(require("../../../theme/shared/zIndex"));
|
|
11
|
-
var _breakpoint = _interopRequireDefault(require("../../../theme/shared/breakpoint"));
|
|
12
11
|
var _CR_RedShed = _interopRequireDefault(require("./assets/CR_RedShed.svg"));
|
|
13
12
|
var _CR_Funding = _interopRequireDefault(require("./assets/CR_Funding.svg"));
|
|
14
13
|
var _CR_MentalHealth = _interopRequireDefault(require("./assets/CR_MentalHealth.svg"));
|
|
@@ -50,67 +49,72 @@ const LabelGroup = exports.LabelGroup = _styledComponents.default.div.withConfig
|
|
|
50
49
|
const CheckLabel = exports.CheckLabel = _styledComponents.default.label.withConfig({
|
|
51
50
|
displayName: "Chipstyle__CheckLabel",
|
|
52
51
|
componentId: "sc-6s9oo3-1"
|
|
53
|
-
})(["display:flex;align-items:center;width:auto;height:48px;border-radius:2rem;background-color:#d5d5d5;margin:", " ", " 0 0;padding:4px;padding-right:1rem;flex:0 0 auto;position:relative
|
|
52
|
+
})(["display:flex;align-items:center;width:auto;height:48px;border-radius:2rem;background-color:#d5d5d5;margin:", " ", " 0 0;padding:4px;padding-right:1rem;flex:0 0 auto;position:relative;@media ", "{margin:", " ", " 0 0;}"], (0, _spacing.default)('sm'), (0, _spacing.default)('sm'), _ref => {
|
|
53
|
+
let {
|
|
54
|
+
theme
|
|
55
|
+
} = _ref;
|
|
56
|
+
return theme.allBreakpoints('M');
|
|
57
|
+
}, (0, _spacing.default)('md'), (0, _spacing.default)('md'));
|
|
54
58
|
const Overlay = exports.Overlay = _styledComponents.default.span.withConfig({
|
|
55
59
|
displayName: "Chipstyle__Overlay",
|
|
56
60
|
componentId: "sc-6s9oo3-2"
|
|
57
|
-
})(["display:block;position:absolute;width:100%;height:100%;opacity:0.2;border-radius:2rem;left:0;top:0;right:0;bottom:0;", ";:hover{background:", ";}"], (0, _zIndex.default)('low'),
|
|
61
|
+
})(["display:block;position:absolute;width:100%;height:100%;opacity:0.2;border-radius:2rem;left:0;top:0;right:0;bottom:0;", ";:hover{background:", ";}"], (0, _zIndex.default)('low'), _ref2 => {
|
|
58
62
|
let {
|
|
59
63
|
theme
|
|
60
|
-
} =
|
|
64
|
+
} = _ref2;
|
|
61
65
|
return theme.color('grey_medium');
|
|
62
66
|
});
|
|
63
67
|
const CheckInput = exports.CheckInput = _styledComponents.default.input.withConfig({
|
|
64
68
|
displayName: "Chipstyle__CheckInput",
|
|
65
69
|
componentId: "sc-6s9oo3-3"
|
|
66
|
-
})(["font-size:", ";display:block;box-sizing:border-box;opacity:0;position:absolute;left:0px;width:40px;height:40px;margin:0;border:1px solid ", ";+ span{background:url(", ") no-repeat center;background-size:24px;margin-right:", ";width:40px;height:40px;border-radius:50%;background-color:", ";float:left;", ";}:checked ~ span{background-size:24px;background-color:", ";}:focus + span{border-color:", ";border-width:3px;}:focus + span{border-color:", ";border-width:3px;}"],
|
|
70
|
+
})(["font-size:", ";display:block;box-sizing:border-box;opacity:0;position:absolute;left:0px;width:40px;height:40px;margin:0;border:1px solid ", ";+ span{background:url(", ") no-repeat center;background-size:24px;margin-right:", ";width:40px;height:40px;border-radius:50%;background-color:", ";float:left;", ";}:checked ~ span{background-size:24px;background-color:", ";}:focus + span{border-color:", ";border-width:3px;}:focus + span{border-color:", ";border-width:3px;}"], _ref3 => {
|
|
67
71
|
let {
|
|
68
72
|
theme
|
|
69
|
-
} =
|
|
73
|
+
} = _ref3;
|
|
70
74
|
return theme.fontSize('sm');
|
|
71
|
-
},
|
|
75
|
+
}, _ref4 => {
|
|
72
76
|
let {
|
|
73
77
|
theme
|
|
74
|
-
} =
|
|
78
|
+
} = _ref4;
|
|
75
79
|
return theme.color('grey_for_forms');
|
|
76
|
-
},
|
|
80
|
+
}, _ref5 => {
|
|
77
81
|
let {
|
|
78
82
|
value
|
|
79
|
-
} =
|
|
83
|
+
} = _ref5;
|
|
80
84
|
return selectIcon(value);
|
|
81
|
-
}, (0, _spacing.default)('md'),
|
|
85
|
+
}, (0, _spacing.default)('md'), _ref6 => {
|
|
82
86
|
let {
|
|
83
87
|
theme
|
|
84
|
-
} =
|
|
88
|
+
} = _ref6;
|
|
85
89
|
return theme.color('grey');
|
|
86
|
-
}, (0, _zIndex.default)('medium'),
|
|
90
|
+
}, (0, _zIndex.default)('medium'), _ref7 => {
|
|
87
91
|
let {
|
|
88
92
|
theme,
|
|
89
93
|
color
|
|
90
|
-
} =
|
|
94
|
+
} = _ref7;
|
|
91
95
|
return theme.color(color);
|
|
92
|
-
},
|
|
96
|
+
}, _ref8 => {
|
|
93
97
|
let {
|
|
94
98
|
theme
|
|
95
|
-
} =
|
|
99
|
+
} = _ref8;
|
|
96
100
|
return theme.color('grey_for_forms');
|
|
97
|
-
},
|
|
101
|
+
}, _ref9 => {
|
|
98
102
|
let {
|
|
99
103
|
theme
|
|
100
|
-
} =
|
|
104
|
+
} = _ref9;
|
|
101
105
|
return theme.color('grey_for_forms');
|
|
102
106
|
});
|
|
103
107
|
const ClearButton = exports.ClearButton = _styledComponents.default.button.withConfig({
|
|
104
108
|
displayName: "Chipstyle__ClearButton",
|
|
105
109
|
componentId: "sc-6s9oo3-4"
|
|
106
|
-
})(["border-radius:2rem;background:none;padding:", " ", ";margin:", " 0 0 0;border:1px solid ", ";outline:none;padding-left:3rem;position:relative;height:48px;:focus{border-color:", ";}:before{content:'';background:url(", ") no-repeat center;width:20px;height:20px;display:block;position:absolute;left:1rem;}"], (0, _spacing.default)('sm'), (0, _spacing.default)('md'), (0, _spacing.default)('md'),
|
|
110
|
+
})(["border-radius:2rem;background:none;padding:", " ", ";margin:", " 0 0 0;border:1px solid ", ";outline:none;padding-left:3rem;position:relative;height:48px;:focus{border-color:", ";}:before{content:'';background:url(", ") no-repeat center;width:20px;height:20px;display:block;position:absolute;left:1rem;}"], (0, _spacing.default)('sm'), (0, _spacing.default)('md'), (0, _spacing.default)('md'), _ref10 => {
|
|
107
111
|
let {
|
|
108
112
|
theme
|
|
109
|
-
} =
|
|
113
|
+
} = _ref10;
|
|
110
114
|
return theme.color('grey_medium');
|
|
111
|
-
},
|
|
115
|
+
}, _ref11 => {
|
|
112
116
|
let {
|
|
113
117
|
theme
|
|
114
|
-
} =
|
|
118
|
+
} = _ref11;
|
|
115
119
|
return theme.color('grey_for_forms');
|
|
116
120
|
}, _clear.default);
|
|
@@ -5,11 +5,11 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
5
5
|
require("jest-styled-components");
|
|
6
6
|
var _shallowWithTheme = _interopRequireDefault(require("../../../hoc/shallowWithTheme"));
|
|
7
7
|
var _Chip = _interopRequireDefault(require("./Chip"));
|
|
8
|
-
it(
|
|
8
|
+
it("renders article teaser correctly", () => {
|
|
9
9
|
const handleToggle = e => e.target.value;
|
|
10
10
|
const tree = (0, _shallowWithTheme.default)( /*#__PURE__*/_react.default.createElement(_Chip.default, {
|
|
11
11
|
category: "Gender Justice",
|
|
12
12
|
handleToggle: handleToggle
|
|
13
13
|
})).toJSON();
|
|
14
|
-
expect(tree).toMatchInlineSnapshot("\n .c0 {\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-align-items: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n width: auto;\n height: 48px;\n border-radius: 2rem;\n background-color: #d5d5d5;\n margin: 0.5rem 0.5rem 0 0;\n padding: 4px;\n padding-right: 1rem;\n -webkit-flex: 0 0 auto;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n position: relative;\n }\n\n .
|
|
14
|
+
expect(tree).toMatchInlineSnapshot("\n .c0 {\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-align-items: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n width: auto;\n height: 48px;\n border-radius: 2rem;\n background-color: #d5d5d5;\n margin: 0.5rem 0.5rem 0 0;\n padding: 4px;\n padding-right: 1rem;\n -webkit-flex: 0 0 auto;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n position: relative;\n }\n\n .c2 {\n display: block;\n position: absolute;\n width: 100%;\n height: 100%;\n opacity: 0.2;\n border-radius: 2rem;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n z-index: 1;\n }\n\n .c2:hover {\n background: #E1E2E3;\n }\n\n .c1 {\n display: block;\n box-sizing: border-box;\n opacity: 0;\n position: absolute;\n left: 0px;\n width: 40px;\n height: 40px;\n margin: 0;\n border: 1px solid #666;\n }\n\n .c1 + span {\n background: url(mock.asset) no-repeat center;\n background-size: 24px;\n margin-right: 1rem;\n width: 40px;\n height: 40px;\n border-radius: 50%;\n background-color: #969598;\n float: left;\n z-index: 2;\n }\n\n .c1:checked ~ span {\n background-size: 24px;\n background-color: #6F3AAB;\n }\n\n .c1:focus + span {\n border-color: #666;\n border-width: 3px;\n }\n\n .c1:focus + span {\n border-color: #666;\n border-width: 3px;\n }\n\n @media (min-width:740px) {\n .c0 {\n margin: 1rem 1rem 0 0;\n }\n }\n\n <label\n className=\"c0\"\n >\n <input\n checked={false}\n className=\"c1\"\n color=\"purple\"\n onChange={[Function]}\n type=\"checkbox\"\n value=\"Gender Justice\"\n />\n <span />\n <span\n className=\"c2\"\n />\n Gender Justice\n </label>\n ");
|
|
15
15
|
});
|
|
@@ -14,7 +14,7 @@ const Section = exports.Section = _styledComponents.default.section.withConfig({
|
|
|
14
14
|
let {
|
|
15
15
|
theme
|
|
16
16
|
} = _ref;
|
|
17
|
-
return theme.
|
|
17
|
+
return theme.allBreakpoints('M');
|
|
18
18
|
});
|
|
19
19
|
const CopyWrapper = exports.CopyWrapper = _styledComponents.default.div.withConfig({
|
|
20
20
|
displayName: "DoubleCopystyle__CopyWrapper",
|
|
@@ -18,7 +18,7 @@ const Container = _styledComponents.default.section.withConfig({
|
|
|
18
18
|
let {
|
|
19
19
|
theme
|
|
20
20
|
} = _ref;
|
|
21
|
-
return theme.
|
|
21
|
+
return theme.allBreakpoints('M');
|
|
22
22
|
});
|
|
23
23
|
const Info = _styledComponents.default.div.withConfig({
|
|
24
24
|
displayName: "InfoBanner__Info",
|
|
@@ -27,7 +27,7 @@ const Info = _styledComponents.default.div.withConfig({
|
|
|
27
27
|
let {
|
|
28
28
|
theme
|
|
29
29
|
} = _ref2;
|
|
30
|
-
return theme.
|
|
30
|
+
return theme.allBreakpoints('M');
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
/**
|