@comicrelief/component-library 8.1.1 → 8.2.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/.eslintrc +1 -0
- package/dist/components/Atoms/Button/Button.js +3 -7
- package/dist/components/Atoms/ButtonWithStates/ButtonWithStates.js +3 -8
- package/dist/components/Atoms/Checkbox/Checkbox.js +2 -6
- package/dist/components/Atoms/Confetti/Confetti.js +2 -5
- package/dist/components/Atoms/Icons/Arrow.js +4 -10
- package/dist/components/Atoms/Icons/AtSign.js +3 -8
- package/dist/components/Atoms/Icons/Chevron.js +4 -10
- package/dist/components/Atoms/Icons/Download.js +3 -8
- package/dist/components/Atoms/Icons/External.js +3 -8
- package/dist/components/Atoms/Icons/Favourite.js +3 -8
- package/dist/components/Atoms/Icons/Internal.js +3 -8
- package/dist/components/Atoms/Input/Input.js +9 -17
- package/dist/components/Atoms/Label/Label.js +3 -12
- package/dist/components/Atoms/Link/Link.js +9 -18
- package/dist/components/Atoms/Logo/Logo.js +4 -11
- package/dist/components/Atoms/Pagination/Pagination.js +39 -52
- package/dist/components/Atoms/Picture/Picture.js +10 -22
- package/dist/components/Atoms/RichText/RichText.js +2 -6
- package/dist/components/Atoms/Select/Select.js +6 -16
- package/dist/components/Atoms/SocialIcons/SocialIcons.js +2 -3
- package/dist/components/Atoms/Text/Text.js +12 -17
- package/dist/components/Atoms/TextArea/TextArea.js +6 -11
- package/dist/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.js +2 -9
- package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.js +8 -18
- package/dist/components/Molecules/Banner/Banner.js +1 -4
- package/dist/components/Molecules/Box/Box.js +6 -17
- package/dist/components/Molecules/Card/Card.js +11 -24
- package/dist/components/Molecules/CardDs/CardDs.js +11 -24
- package/dist/components/Molecules/Chip/Chip.js +2 -6
- package/dist/components/Molecules/Countdown/Countdown.js +3 -8
- package/dist/components/Molecules/Logos/Logos.js +1 -4
- package/dist/components/Molecules/Lookup/Lookup.js +2 -6
- package/dist/components/Molecules/Promo/Promo.js +17 -36
- package/dist/components/Molecules/SchoolLookup/SchoolLookup.js +4 -10
- package/dist/components/Molecules/SearchInput/SearchInput.js +1 -4
- package/dist/components/Molecules/SearchResult/SearchResult.js +8 -17
- package/dist/components/Molecules/ShareButton/ShareButton.js +3 -8
- package/dist/components/Molecules/SimpleSchoolLookup/SimpleSchoolLookup.js +1 -4
- package/dist/components/Molecules/SingleMessage/SingleMessage.js +15 -32
- package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.js +13 -28
- package/dist/components/Molecules/Typeahead/Typeahead.js +3 -8
- package/dist/components/Molecules/VideoBanner/VideoBanner.js +5 -12
- package/dist/components/Organisms/Donate/Donate.js +31 -65
- package/dist/components/Organisms/Donate/Donate.md +19 -19
- package/dist/components/Organisms/Donate/Form/Form.js +6 -19
- package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.js +1 -4
- package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.style.js +3 -3
- package/dist/components/Organisms/Donate/MoneyBuy/MoneyBuy.js +5 -10
- package/dist/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +10 -10
- package/dist/components/Organisms/EmailSignUp/_EmailSignUp.js +4 -9
- package/dist/components/Organisms/EmailSignUp/_TextInput.js +3 -8
- package/dist/components/Organisms/Footer/Footer.js +6 -11
- package/dist/components/Organisms/Footer/Nav/Nav.js +1 -4
- package/dist/components/Organisms/Header/Header.js +2 -6
- package/dist/components/Organisms/Header/Nav/Nav.js +1 -4
- package/dist/components/Organisms/ImpactSlider/ImpactSlider.js +3 -8
- package/dist/components/Organisms/MarketingPreferencesDS/_CheckAnswer.js +2 -6
- package/dist/components/Organisms/MarketingPreferencesDS/_MarketingPreferencesDS.js +6 -16
- package/dist/components/Organisms/MarketingPreferencesDS/_TextInput.js +3 -8
- package/dist/components/Organisms/Membership/Form/Form.js +1 -5
- package/dist/components/Organisms/Membership/Membership.js +9 -19
- package/dist/components/Organisms/Membership/MoneyBox/MoneyBox.js +3 -8
- package/package.json +1 -1
- package/src/components/Atoms/Button/Button.js +3 -8
- package/src/components/Atoms/ButtonWithStates/ButtonWithStates.js +1 -7
- package/src/components/Atoms/Checkbox/Checkbox.js +1 -6
- package/src/components/Atoms/Confetti/Confetti.js +1 -5
- package/src/components/Atoms/Icons/Arrow.js +1 -8
- package/src/components/Atoms/Icons/AtSign.js +1 -7
- package/src/components/Atoms/Icons/Chevron.js +1 -8
- package/src/components/Atoms/Icons/Download.js +1 -7
- package/src/components/Atoms/Icons/External.js +1 -7
- package/src/components/Atoms/Icons/Favourite.js +1 -7
- package/src/components/Atoms/Icons/Internal.js +1 -7
- package/src/components/Atoms/Input/Input.js +9 -18
- package/src/components/Atoms/Label/Label.js +3 -13
- package/src/components/Atoms/Link/Link.js +9 -19
- package/src/components/Atoms/Logo/Logo.js +1 -8
- package/src/components/Atoms/Pagination/Pagination.js +38 -51
- package/src/components/Atoms/Picture/Picture.js +10 -23
- package/src/components/Atoms/RichText/RichText.js +1 -6
- package/src/components/Atoms/Select/Select.js +6 -17
- package/src/components/Atoms/SocialIcons/SocialIcons.js +2 -5
- package/src/components/Atoms/Text/Text.js +4 -13
- package/src/components/Atoms/TextArea/TextArea.js +2 -9
- package/src/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.js +2 -11
- package/src/components/Molecules/ArticleTeaser/ArticleTeaser.js +8 -19
- package/src/components/Molecules/Banner/Banner.js +1 -5
- package/src/components/Molecules/Box/Box.js +6 -18
- package/src/components/Molecules/Card/Card.js +11 -25
- package/src/components/Molecules/CardDs/CardDs.js +11 -25
- package/src/components/Molecules/Chip/Chip.js +1 -6
- package/src/components/Molecules/Countdown/Countdown.js +1 -7
- package/src/components/Molecules/Logos/Logos.js +1 -5
- package/src/components/Molecules/Lookup/Lookup.js +2 -7
- package/src/components/Molecules/Promo/Promo.js +17 -37
- package/src/components/Molecules/SchoolLookup/SchoolLookup.js +4 -11
- package/src/components/Molecules/SearchInput/SearchInput.js +1 -5
- package/src/components/Molecules/SearchResult/SearchResult.js +8 -18
- package/src/components/Molecules/ShareButton/ShareButton.js +1 -7
- package/src/components/Molecules/SimpleSchoolLookup/SimpleSchoolLookup.js +4 -5
- package/src/components/Molecules/SingleMessage/SingleMessage.js +15 -33
- package/src/components/Molecules/SingleMessageDS/SingleMessageDs.js +13 -29
- package/src/components/Molecules/Typeahead/Typeahead.js +3 -9
- package/src/components/Molecules/VideoBanner/VideoBanner.js +7 -9
- package/src/components/Organisms/Donate/Donate.js +32 -67
- package/src/components/Organisms/Donate/Donate.md +19 -19
- package/src/components/Organisms/Donate/Form/Form.js +6 -22
- package/src/components/Organisms/Donate/GivingSelector/GivingSelector.js +1 -5
- package/src/components/Organisms/Donate/GivingSelector/GivingSelector.style.js +3 -3
- package/src/components/Organisms/Donate/MoneyBuy/MoneyBuy.js +5 -11
- package/src/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +10 -10
- package/src/components/Organisms/EmailSignUp/_EmailSignUp.js +3 -9
- package/src/components/Organisms/EmailSignUp/_TextInput.js +3 -9
- package/src/components/Organisms/Footer/Footer.js +2 -10
- package/src/components/Organisms/Footer/Nav/Nav.js +1 -5
- package/src/components/Organisms/Header/Header.js +1 -6
- package/src/components/Organisms/Header/Nav/Nav.js +1 -5
- package/src/components/Organisms/ImpactSlider/ImpactSlider.js +1 -7
- package/src/components/Organisms/MarketingPreferencesDS/_CheckAnswer.js +1 -6
- package/src/components/Organisms/MarketingPreferencesDS/_MarketingPreferencesDS.js +5 -17
- package/src/components/Organisms/MarketingPreferencesDS/_TextInput.js +1 -7
- package/src/components/Organisms/Membership/Form/Form.js +1 -5
- package/src/components/Organisms/Membership/Membership.js +9 -19
- package/src/components/Organisms/Membership/MoneyBox/MoneyBox.js +3 -9
|
@@ -6,30 +6,39 @@ import { getPages } from './Utils/PaginationCalculator';
|
|
|
6
6
|
|
|
7
7
|
/** Customizable Pagination component */
|
|
8
8
|
const Pagination = ({
|
|
9
|
-
PageComponent,
|
|
9
|
+
PageComponent = Item,
|
|
10
|
+
pageComponentProps = {},
|
|
11
|
+
showFirst = true,
|
|
12
|
+
showPrevious = true,
|
|
13
|
+
showNext = true,
|
|
14
|
+
showLast = true,
|
|
15
|
+
showMore = true,
|
|
16
|
+
maxPages = 5,
|
|
17
|
+
previousLabel = '‹',
|
|
18
|
+
nextLabel = '›',
|
|
19
|
+
firstLabel = '«',
|
|
20
|
+
lastLabel = '»',
|
|
21
|
+
moreLabel = '...',
|
|
22
|
+
getPageLabel = currentPage => currentPage.toString(),
|
|
23
|
+
previousAriaLabel = 'Previous page',
|
|
24
|
+
nextAriaLabel = 'Next page',
|
|
25
|
+
firstAriaLabel = 'First page',
|
|
26
|
+
lastAriaLabel = 'Last page',
|
|
27
|
+
moreAriaLabel = 'More pages',
|
|
28
|
+
getPageAriaLabel = currentPage => `Page ${currentPage}`,
|
|
29
|
+
target = 'self',
|
|
30
|
+
color = 'black',
|
|
31
|
+
backgroundColor = 'white',
|
|
32
|
+
selectedColor = 'white',
|
|
33
|
+
selectedBackgroundColor = 'red',
|
|
34
|
+
disabledColor = 'grey_medium',
|
|
35
|
+
disabledBackgroundColor = 'white',
|
|
36
|
+
colorOnHover = 'white',
|
|
37
|
+
backgroundColorOnHover = 'teal',
|
|
10
38
|
totalPages,
|
|
11
|
-
maxPages,
|
|
12
39
|
currentPage,
|
|
13
|
-
showFirst,
|
|
14
|
-
firstLabel,
|
|
15
|
-
firstAriaLabel,
|
|
16
|
-
showPrevious,
|
|
17
|
-
previousLabel,
|
|
18
|
-
previousAriaLabel,
|
|
19
|
-
showMore,
|
|
20
|
-
moreLabel,
|
|
21
|
-
moreAriaLabel,
|
|
22
|
-
showNext,
|
|
23
|
-
nextLabel,
|
|
24
|
-
nextAriaLabel,
|
|
25
|
-
showLast,
|
|
26
|
-
lastLabel,
|
|
27
|
-
lastAriaLabel,
|
|
28
|
-
getPageLabel,
|
|
29
|
-
getPageAriaLabel,
|
|
30
40
|
onSelect,
|
|
31
41
|
createURL,
|
|
32
|
-
pageComponentProps,
|
|
33
42
|
...restProps
|
|
34
43
|
}) => {
|
|
35
44
|
if (!totalPages) {
|
|
@@ -95,6 +104,15 @@ const Pagination = ({
|
|
|
95
104
|
pageComponentProps={pageComponentProps}
|
|
96
105
|
createURL={createURL}
|
|
97
106
|
onSelect={onSelect}
|
|
107
|
+
target={target}
|
|
108
|
+
color={color}
|
|
109
|
+
backgroundColor={backgroundColor}
|
|
110
|
+
selectedColor={selectedColor}
|
|
111
|
+
selectedBackgroundColor={selectedBackgroundColor}
|
|
112
|
+
disabledColor={disabledColor}
|
|
113
|
+
disabledBackgroundColor={disabledBackgroundColor}
|
|
114
|
+
colorOnHover={colorOnHover}
|
|
115
|
+
backgroundColorOnHover={backgroundColorOnHover}
|
|
98
116
|
{...restProps}
|
|
99
117
|
/>
|
|
100
118
|
);
|
|
@@ -181,35 +199,4 @@ Pagination.propTypes = {
|
|
|
181
199
|
backgroundColorOnHover: PropTypes.string
|
|
182
200
|
};
|
|
183
201
|
|
|
184
|
-
Pagination.defaultProps = {
|
|
185
|
-
PageComponent: Item,
|
|
186
|
-
pageComponentProps: {},
|
|
187
|
-
showFirst: true,
|
|
188
|
-
showPrevious: true,
|
|
189
|
-
showNext: true,
|
|
190
|
-
showLast: true,
|
|
191
|
-
showMore: true,
|
|
192
|
-
maxPages: 5,
|
|
193
|
-
previousLabel: '‹',
|
|
194
|
-
nextLabel: '›',
|
|
195
|
-
firstLabel: '«',
|
|
196
|
-
lastLabel: '»',
|
|
197
|
-
moreLabel: '...',
|
|
198
|
-
getPageLabel: currentPage => currentPage.toString(),
|
|
199
|
-
previousAriaLabel: 'Previous page',
|
|
200
|
-
nextAriaLabel: 'Next page',
|
|
201
|
-
firstAriaLabel: 'First page',
|
|
202
|
-
lastAriaLabel: 'Last page',
|
|
203
|
-
moreAriaLabel: 'More pages',
|
|
204
|
-
getPageAriaLabel: currentPage => `Page ${currentPage}`,
|
|
205
|
-
target: 'self',
|
|
206
|
-
color: 'black',
|
|
207
|
-
backgroundColor: 'white',
|
|
208
|
-
selectedColor: 'white',
|
|
209
|
-
selectedBackgroundColor: 'red',
|
|
210
|
-
disabledColor: 'grey_medium',
|
|
211
|
-
disabledBackgroundColor: 'white',
|
|
212
|
-
colorOnHover: 'white',
|
|
213
|
-
backgroundColorOnHover: 'teal'
|
|
214
|
-
};
|
|
215
202
|
export default Pagination;
|
|
@@ -65,16 +65,16 @@ const Image = styled.img`
|
|
|
65
65
|
|
|
66
66
|
/** Responsive Picture */
|
|
67
67
|
const Picture = ({
|
|
68
|
-
images,
|
|
69
|
-
image,
|
|
70
|
-
alt,
|
|
71
|
-
width,
|
|
72
|
-
height,
|
|
73
|
-
objectFit,
|
|
74
|
-
imageLow,
|
|
75
|
-
isBackgroundImage,
|
|
76
|
-
smallBreakpointRowLayout,
|
|
77
|
-
mediumBreakpointRowLayout,
|
|
68
|
+
images = null,
|
|
69
|
+
image = null,
|
|
70
|
+
alt = '',
|
|
71
|
+
width = '100%',
|
|
72
|
+
height = 'auto',
|
|
73
|
+
objectFit = 'none',
|
|
74
|
+
imageLow = null,
|
|
75
|
+
isBackgroundImage = false,
|
|
76
|
+
smallBreakpointRowLayout = null,
|
|
77
|
+
mediumBreakpointRowLayout = null,
|
|
78
78
|
...rest
|
|
79
79
|
}) => {
|
|
80
80
|
const document = typeof window !== 'undefined' ? window.document : null;
|
|
@@ -172,17 +172,4 @@ Picture.propTypes = {
|
|
|
172
172
|
mediumBreakpointRowLayout: PropTypes.bool
|
|
173
173
|
};
|
|
174
174
|
|
|
175
|
-
Picture.defaultProps = {
|
|
176
|
-
imageLow: null,
|
|
177
|
-
image: null,
|
|
178
|
-
images: null,
|
|
179
|
-
objectFit: 'none',
|
|
180
|
-
width: '100%',
|
|
181
|
-
height: 'auto',
|
|
182
|
-
alt: '',
|
|
183
|
-
isBackgroundImage: false,
|
|
184
|
-
smallBreakpointRowLayout: null,
|
|
185
|
-
mediumBreakpointRowLayout: null
|
|
186
|
-
};
|
|
187
|
-
|
|
188
175
|
export default withTheme(Picture);
|
|
@@ -6,7 +6,7 @@ export const Inner = styled.div`
|
|
|
6
6
|
text-align: ${props => props.align};
|
|
7
7
|
`;
|
|
8
8
|
|
|
9
|
-
const RichText = ({ align, markup, ...rest }) => (
|
|
9
|
+
const RichText = ({ align = 'left', markup = '', ...rest }) => (
|
|
10
10
|
<Inner
|
|
11
11
|
align={align}
|
|
12
12
|
dangerouslySetInnerHTML={{ __html: markup }}
|
|
@@ -19,9 +19,4 @@ RichText.propTypes = {
|
|
|
19
19
|
markup: PropTypes.string
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
RichText.defaultProps = {
|
|
23
|
-
align: 'left',
|
|
24
|
-
markup: ''
|
|
25
|
-
};
|
|
26
|
-
|
|
27
22
|
export default RichText;
|
|
@@ -44,12 +44,12 @@ const Select = React.forwardRef(
|
|
|
44
44
|
description,
|
|
45
45
|
label,
|
|
46
46
|
options,
|
|
47
|
-
hideLabel,
|
|
48
|
-
defaultValue,
|
|
49
|
-
onChange,
|
|
50
|
-
greyDescription,
|
|
51
|
-
className,
|
|
52
|
-
optional,
|
|
47
|
+
hideLabel = false,
|
|
48
|
+
defaultValue = '',
|
|
49
|
+
onChange = null,
|
|
50
|
+
greyDescription = false,
|
|
51
|
+
className = '',
|
|
52
|
+
optional = false,
|
|
53
53
|
...rest
|
|
54
54
|
},
|
|
55
55
|
ref
|
|
@@ -114,15 +114,4 @@ Select.propTypes = {
|
|
|
114
114
|
optional: PropTypes.bool
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
-
Select.defaultProps = {
|
|
118
|
-
hideLabel: false,
|
|
119
|
-
defaultValue: '',
|
|
120
|
-
onChange: null,
|
|
121
|
-
/** If true, the 'description' option, which is initially selected but disabled, will be grey
|
|
122
|
-
* - like a text input's placeholder */
|
|
123
|
-
greyDescription: false,
|
|
124
|
-
className: '',
|
|
125
|
-
optional: false
|
|
126
|
-
};
|
|
127
|
-
|
|
128
117
|
export default Select;
|
|
@@ -28,7 +28,7 @@ const StyledItem = styled.li`
|
|
|
28
28
|
`;
|
|
29
29
|
|
|
30
30
|
/** Social media icons with customizable style linked to campaign social media accounts */
|
|
31
|
-
const SocialIcons = ({ campaign, ...restProps }) => {
|
|
31
|
+
const SocialIcons = ({ target = 'blank', campaign, ...restProps }) => {
|
|
32
32
|
const links = getLinks(campaign);
|
|
33
33
|
|
|
34
34
|
return (
|
|
@@ -36,6 +36,7 @@ const SocialIcons = ({ campaign, ...restProps }) => {
|
|
|
36
36
|
{Object.keys(icons).map(brand => (
|
|
37
37
|
<StyledItem key={brand}>
|
|
38
38
|
<Icon
|
|
39
|
+
target={target}
|
|
39
40
|
icon={icons[brand]}
|
|
40
41
|
href={links[brand].url}
|
|
41
42
|
title={links[brand].title}
|
|
@@ -55,8 +56,4 @@ SocialIcons.propTypes = {
|
|
|
55
56
|
target: PropTypes.string
|
|
56
57
|
};
|
|
57
58
|
|
|
58
|
-
SocialIcons.defaultProps = {
|
|
59
|
-
target: 'blank'
|
|
60
|
-
};
|
|
61
|
-
|
|
62
59
|
export default SocialIcons;
|
|
@@ -51,11 +51,14 @@ export const BaseText = styled.span`
|
|
|
51
51
|
* Weight is checked for existence to prevent overriding the tag's css
|
|
52
52
|
*/
|
|
53
53
|
const Text = ({
|
|
54
|
-
tag, children, height, weight, family, mobileColor, ...rest
|
|
54
|
+
tag = 'span', size = 's', color = 'inherit', children = undefined, uppercase = false, height = undefined, weight = undefined, family = null, mobileColor = null, ...rest
|
|
55
55
|
}) => (
|
|
56
56
|
<BaseText
|
|
57
57
|
{...rest}
|
|
58
58
|
as={tag}
|
|
59
|
+
color={color}
|
|
60
|
+
size={size}
|
|
61
|
+
uppercase={uppercase}
|
|
59
62
|
height={height}
|
|
60
63
|
weight={weight}
|
|
61
64
|
family={family}
|
|
@@ -88,16 +91,4 @@ Text.propTypes = {
|
|
|
88
91
|
mobileColor: PropTypes.string
|
|
89
92
|
};
|
|
90
93
|
|
|
91
|
-
Text.defaultProps = {
|
|
92
|
-
family: null,
|
|
93
|
-
tag: 'span',
|
|
94
|
-
weight: undefined,
|
|
95
|
-
height: undefined,
|
|
96
|
-
uppercase: false,
|
|
97
|
-
size: 's',
|
|
98
|
-
color: 'inherit',
|
|
99
|
-
children: undefined,
|
|
100
|
-
mobileColor: null
|
|
101
|
-
};
|
|
102
|
-
|
|
103
94
|
export default Text;
|
|
@@ -32,7 +32,7 @@ const StyledTextArea = styled.textarea`${({ theme, error }) => css`
|
|
|
32
32
|
`}`;
|
|
33
33
|
|
|
34
34
|
const TextArea = React.forwardRef(({
|
|
35
|
-
id, label, hideLabel, errorMsg, rows, className, ...rest
|
|
35
|
+
id, label, placeholder = '', hideLabel = false, errorMsg = undefined, rows = 4, className = '', ...rest
|
|
36
36
|
}, ref) => (
|
|
37
37
|
<Label
|
|
38
38
|
htmlFor={id}
|
|
@@ -43,6 +43,7 @@ const TextArea = React.forwardRef(({
|
|
|
43
43
|
>
|
|
44
44
|
<StyledTextArea
|
|
45
45
|
{...rest}
|
|
46
|
+
placeholder={placeholder}
|
|
46
47
|
rows={rows}
|
|
47
48
|
error={!!errorMsg}
|
|
48
49
|
aria-describedby={id}
|
|
@@ -68,12 +69,4 @@ TextArea.propTypes = {
|
|
|
68
69
|
className: PropTypes.string
|
|
69
70
|
};
|
|
70
71
|
|
|
71
|
-
TextArea.defaultProps = {
|
|
72
|
-
rows: 4,
|
|
73
|
-
placeholder: '',
|
|
74
|
-
errorMsg: undefined,
|
|
75
|
-
hideLabel: false,
|
|
76
|
-
className: ''
|
|
77
|
-
};
|
|
78
|
-
|
|
79
72
|
export default TextArea;
|
|
@@ -35,8 +35,8 @@ const TextInputWithDropdown = React.forwardRef(
|
|
|
35
35
|
id,
|
|
36
36
|
name,
|
|
37
37
|
label,
|
|
38
|
-
dropdownInstruction,
|
|
39
|
-
className,
|
|
38
|
+
dropdownInstruction = null,
|
|
39
|
+
className = '',
|
|
40
40
|
...otherInputProps
|
|
41
41
|
},
|
|
42
42
|
ref
|
|
@@ -186,11 +186,6 @@ TextInputWithDropdown.propTypes = {
|
|
|
186
186
|
dropdownInstruction: PropTypes.string
|
|
187
187
|
};
|
|
188
188
|
|
|
189
|
-
TextInputWithDropdown.defaultProps = {
|
|
190
|
-
dropdownInstruction: null,
|
|
191
|
-
className: ''
|
|
192
|
-
};
|
|
193
|
-
|
|
194
189
|
Options.propTypes = {
|
|
195
190
|
options: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
196
191
|
onSelect: PropTypes.func.isRequired,
|
|
@@ -199,8 +194,4 @@ Options.propTypes = {
|
|
|
199
194
|
resetActiveOption: PropTypes.func.isRequired
|
|
200
195
|
};
|
|
201
196
|
|
|
202
|
-
Options.defaultProps = {
|
|
203
|
-
dropdownInstruction: null
|
|
204
|
-
};
|
|
205
|
-
|
|
206
197
|
export default TextInputWithDropdown;
|
|
@@ -135,14 +135,14 @@ const ArticleTeaser = ({
|
|
|
135
135
|
href,
|
|
136
136
|
date,
|
|
137
137
|
title,
|
|
138
|
-
imageLow,
|
|
139
|
-
image,
|
|
140
|
-
images,
|
|
141
|
-
alt,
|
|
142
|
-
category,
|
|
143
|
-
logoSize,
|
|
144
|
-
family,
|
|
145
|
-
time
|
|
138
|
+
imageLow = null,
|
|
139
|
+
image = null,
|
|
140
|
+
images = null,
|
|
141
|
+
alt = '',
|
|
142
|
+
category = null,
|
|
143
|
+
logoSize = null,
|
|
144
|
+
family = 'Anton',
|
|
145
|
+
time = null
|
|
146
146
|
}) => (
|
|
147
147
|
<Wrapper>
|
|
148
148
|
<Link href={href} type="standard" category={category} underline={false}>
|
|
@@ -209,15 +209,4 @@ ArticleTeaser.propTypes = {
|
|
|
209
209
|
href: PropTypes.string.isRequired
|
|
210
210
|
};
|
|
211
211
|
|
|
212
|
-
ArticleTeaser.defaultProps = {
|
|
213
|
-
imageLow: null,
|
|
214
|
-
image: null,
|
|
215
|
-
images: null,
|
|
216
|
-
category: null,
|
|
217
|
-
logoSize: null,
|
|
218
|
-
time: null,
|
|
219
|
-
alt: '',
|
|
220
|
-
family: 'Anton'
|
|
221
|
-
};
|
|
222
|
-
|
|
223
212
|
export default ArticleTeaser;
|
|
@@ -24,7 +24,7 @@ const Container = styled.div`
|
|
|
24
24
|
}
|
|
25
25
|
`;
|
|
26
26
|
|
|
27
|
-
const Banner = ({ children, backgroundColor }) => (
|
|
27
|
+
const Banner = ({ children, backgroundColor = 'grey_dark' }) => (
|
|
28
28
|
<Wrapper backgroundColor={backgroundColor}>
|
|
29
29
|
<Container>
|
|
30
30
|
{ children }
|
|
@@ -37,8 +37,4 @@ Banner.propTypes = {
|
|
|
37
37
|
backgroundColor: PropTypes.string
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
Banner.defaultProps = {
|
|
41
|
-
backgroundColor: 'grey_dark'
|
|
42
|
-
};
|
|
43
|
-
|
|
44
40
|
export default Banner;
|
|
@@ -44,14 +44,13 @@ const Copy = styled.div`
|
|
|
44
44
|
`;
|
|
45
45
|
|
|
46
46
|
const Box = ({
|
|
47
|
-
imageLow,
|
|
48
|
-
images,
|
|
49
|
-
image,
|
|
47
|
+
imageLow = null,
|
|
48
|
+
images = null,
|
|
49
|
+
image = null,
|
|
50
50
|
imageAltText,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
squaredCorners,
|
|
51
|
+
width = '100%',
|
|
52
|
+
children = null,
|
|
53
|
+
squaredCorners = false,
|
|
55
54
|
...rest
|
|
56
55
|
}) => (
|
|
57
56
|
<Container {...rest}>
|
|
@@ -83,15 +82,4 @@ Box.propTypes = {
|
|
|
83
82
|
squaredCorners: PropTypes.bool
|
|
84
83
|
};
|
|
85
84
|
|
|
86
|
-
Box.defaultProps = {
|
|
87
|
-
children: null,
|
|
88
|
-
imageLow: null,
|
|
89
|
-
images: null,
|
|
90
|
-
image: null,
|
|
91
|
-
imageAltText: '',
|
|
92
|
-
width: '100%',
|
|
93
|
-
height: '100%',
|
|
94
|
-
squaredCorners: false
|
|
95
|
-
};
|
|
96
|
-
|
|
97
85
|
export default Box;
|
|
@@ -4,17 +4,17 @@ import Picture from '../../Atoms/Picture/Picture';
|
|
|
4
4
|
import { Container, Wrapper, Copy } from './Card.style';
|
|
5
5
|
|
|
6
6
|
const Card = ({
|
|
7
|
-
backgroundColor,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
width,
|
|
14
|
-
|
|
15
|
-
squaredCorners,
|
|
16
|
-
smallBreakpointRowLayout,
|
|
17
|
-
mediumBreakpointRowLayout,
|
|
7
|
+
backgroundColor = 'white',
|
|
8
|
+
children = null,
|
|
9
|
+
imageLow = null,
|
|
10
|
+
images = null,
|
|
11
|
+
image = null,
|
|
12
|
+
imageAltText = '',
|
|
13
|
+
width = '100%',
|
|
14
|
+
height = '100%',
|
|
15
|
+
squaredCorners = false,
|
|
16
|
+
smallBreakpointRowLayout = null,
|
|
17
|
+
mediumBreakpointRowLayout = null,
|
|
18
18
|
...rest
|
|
19
19
|
}) => (
|
|
20
20
|
<Container
|
|
@@ -65,18 +65,4 @@ Card.propTypes = {
|
|
|
65
65
|
mediumBreakpointRowLayout: PropTypes.bool
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
-
Card.defaultProps = {
|
|
69
|
-
backgroundColor: 'white',
|
|
70
|
-
children: null,
|
|
71
|
-
imageLow: null,
|
|
72
|
-
images: null,
|
|
73
|
-
image: null,
|
|
74
|
-
imageAltText: '',
|
|
75
|
-
width: '100%',
|
|
76
|
-
height: '100%',
|
|
77
|
-
squaredCorners: false,
|
|
78
|
-
smallBreakpointRowLayout: null,
|
|
79
|
-
mediumBreakpointRowLayout: null
|
|
80
|
-
};
|
|
81
|
-
|
|
82
68
|
export default Card;
|
|
@@ -7,18 +7,18 @@ import {
|
|
|
7
7
|
} from './CardDs.style';
|
|
8
8
|
|
|
9
9
|
const CardDs = ({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
backgroundColor = 'white',
|
|
11
|
+
imageLow = null,
|
|
12
|
+
images = null,
|
|
13
|
+
image = null,
|
|
14
|
+
link = null,
|
|
15
|
+
linkLabel = null,
|
|
16
|
+
target = null,
|
|
17
|
+
imageAltText = '',
|
|
18
|
+
width = '100%',
|
|
19
|
+
height = '100%',
|
|
20
|
+
icon = null,
|
|
18
21
|
children,
|
|
19
|
-
link,
|
|
20
|
-
linkLabel,
|
|
21
|
-
target,
|
|
22
22
|
...rest
|
|
23
23
|
}) => {
|
|
24
24
|
const Media = (
|
|
@@ -102,18 +102,4 @@ CardDs.propTypes = {
|
|
|
102
102
|
icon: PropTypes.node
|
|
103
103
|
};
|
|
104
104
|
|
|
105
|
-
CardDs.defaultProps = {
|
|
106
|
-
backgroundColor: 'white',
|
|
107
|
-
imageLow: null,
|
|
108
|
-
images: null,
|
|
109
|
-
image: null,
|
|
110
|
-
link: null,
|
|
111
|
-
linkLabel: null,
|
|
112
|
-
target: null,
|
|
113
|
-
imageAltText: '',
|
|
114
|
-
width: '100%',
|
|
115
|
-
height: '100%',
|
|
116
|
-
icon: null
|
|
117
|
-
};
|
|
118
|
-
|
|
119
105
|
export default CardDs;
|
|
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import { CheckLabel, Overlay, CheckInput } from './Chip.style';
|
|
5
5
|
|
|
6
6
|
const Chip = ({
|
|
7
|
-
category, handleToggle, color, checked
|
|
7
|
+
category, handleToggle, color = 'purple', checked = false
|
|
8
8
|
}) => (
|
|
9
9
|
<CheckLabel>
|
|
10
10
|
<CheckInput
|
|
@@ -27,9 +27,4 @@ Chip.propTypes = {
|
|
|
27
27
|
handleToggle: PropTypes.func.isRequired
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
Chip.defaultProps = {
|
|
31
|
-
color: 'purple',
|
|
32
|
-
checked: false
|
|
33
|
-
};
|
|
34
|
-
|
|
35
30
|
export default Chip;
|
|
@@ -5,7 +5,7 @@ import Text from '../../Atoms/Text/Text';
|
|
|
5
5
|
import { Wrapper, Digits } from './Countdown.style';
|
|
6
6
|
|
|
7
7
|
const Countdown = ({
|
|
8
|
-
endDate, color, endMessage, introMessage
|
|
8
|
+
endDate, color = 'black', endMessage = null, introMessage = null
|
|
9
9
|
}) => {
|
|
10
10
|
const [countdownHasEnded, setCountdownHasEnded] = useState(false);
|
|
11
11
|
const [countdownTime, setCountdownTime] = useState({
|
|
@@ -97,10 +97,4 @@ Countdown.propTypes = {
|
|
|
97
97
|
introMessage: PropTypes.node
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
-
Countdown.defaultProps = {
|
|
101
|
-
color: 'black',
|
|
102
|
-
endMessage: null,
|
|
103
|
-
introMessage: null
|
|
104
|
-
};
|
|
105
|
-
|
|
106
100
|
export default Countdown;
|
|
@@ -10,7 +10,7 @@ const TitleLabel = styled.span`
|
|
|
10
10
|
color: transparent;
|
|
11
11
|
`;
|
|
12
12
|
|
|
13
|
-
const Logos = ({ campaign }) => {
|
|
13
|
+
const Logos = ({ campaign = 'Comic Relief' }) => {
|
|
14
14
|
if (campaign === 'Sport Relief Gameon') {
|
|
15
15
|
return (
|
|
16
16
|
<>
|
|
@@ -56,8 +56,4 @@ Logos.propTypes = {
|
|
|
56
56
|
campaign: PropTypes.string
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
Logos.defaultProps = {
|
|
60
|
-
campaign: 'Comic Relief'
|
|
61
|
-
};
|
|
62
|
-
|
|
63
59
|
export default Logos;
|
|
@@ -57,8 +57,8 @@ const Lookup = ({
|
|
|
57
57
|
lookupHandler,
|
|
58
58
|
mapOptionToString,
|
|
59
59
|
onSelect,
|
|
60
|
-
noResultsMessage,
|
|
61
|
-
dropdownInstruction,
|
|
60
|
+
noResultsMessage = 'Sorry, could not find any results for your search',
|
|
61
|
+
dropdownInstruction = '',
|
|
62
62
|
...rest
|
|
63
63
|
}) => {
|
|
64
64
|
const [query, setQuery] = useState('');
|
|
@@ -140,9 +140,4 @@ Lookup.propTypes = {
|
|
|
140
140
|
dropdownInstruction: PropTypes.string
|
|
141
141
|
};
|
|
142
142
|
|
|
143
|
-
Lookup.defaultProps = {
|
|
144
|
-
noResultsMessage: 'Sorry, could not find any results for your search',
|
|
145
|
-
dropdownInstruction: ''
|
|
146
|
-
};
|
|
147
|
-
|
|
148
143
|
export default Lookup;
|
|
@@ -10,23 +10,23 @@ import {
|
|
|
10
10
|
} from './Promo.style';
|
|
11
11
|
|
|
12
12
|
const Promo = ({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
image,
|
|
18
|
-
imageAltText,
|
|
19
|
-
children,
|
|
20
|
-
position,
|
|
21
|
-
autoPlay,
|
|
22
|
-
loop,
|
|
23
|
-
poster,
|
|
24
|
-
mobilePoster,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
behindTextGradient,
|
|
29
|
-
blackPlayButton
|
|
13
|
+
backgroundColor = 'white',
|
|
14
|
+
copyLeft = false,
|
|
15
|
+
imageSet = null,
|
|
16
|
+
imageLow = null,
|
|
17
|
+
image = null,
|
|
18
|
+
imageAltText = '',
|
|
19
|
+
children = null,
|
|
20
|
+
position = 'none',
|
|
21
|
+
autoPlay = true,
|
|
22
|
+
loop = true,
|
|
23
|
+
poster = null,
|
|
24
|
+
mobilePoster = null,
|
|
25
|
+
videoSrc = null,
|
|
26
|
+
mobileVideoSrc = null,
|
|
27
|
+
showPosterAfterPlaying = true,
|
|
28
|
+
behindTextGradient = 'none',
|
|
29
|
+
blackPlayButton = false
|
|
30
30
|
}) => {
|
|
31
31
|
// Store the appropriate prop in state, dependent on the breakpoint
|
|
32
32
|
const [thisVideoSrc, setThisVideoSrc] = useState(null);
|
|
@@ -124,24 +124,4 @@ Promo.propTypes = {
|
|
|
124
124
|
blackPlayButton: PropTypes.bool
|
|
125
125
|
};
|
|
126
126
|
|
|
127
|
-
Promo.defaultProps = {
|
|
128
|
-
backgroundColor: 'white',
|
|
129
|
-
copyLeft: false,
|
|
130
|
-
imageSet: null,
|
|
131
|
-
imageLow: null,
|
|
132
|
-
image: null,
|
|
133
|
-
imageAltText: '',
|
|
134
|
-
children: null,
|
|
135
|
-
position: 'none',
|
|
136
|
-
autoPlay: true,
|
|
137
|
-
loop: true,
|
|
138
|
-
poster: null,
|
|
139
|
-
mobilePoster: null,
|
|
140
|
-
videoSrc: null,
|
|
141
|
-
mobileVideoSrc: null,
|
|
142
|
-
showPosterAfterPlaying: true,
|
|
143
|
-
behindTextGradient: 'none',
|
|
144
|
-
blackPlayButton: false
|
|
145
|
-
};
|
|
146
|
-
|
|
147
127
|
export default Promo;
|