@comicrelief/component-library 8.1.2 → 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/Form/Form.js +6 -19
- package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.js +1 -4
- package/dist/components/Organisms/Donate/MoneyBuy/MoneyBuy.js +3 -8
- 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/Form/Form.js +6 -22
- package/src/components/Organisms/Donate/GivingSelector/GivingSelector.js +1 -5
- package/src/components/Organisms/Donate/MoneyBuy/MoneyBuy.js +3 -9
- 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
|
@@ -22,7 +22,7 @@ const Icon = styled.svg`
|
|
|
22
22
|
`;
|
|
23
23
|
|
|
24
24
|
const Arrow = ({
|
|
25
|
-
colour, mobileColour, theme, size, direction, ...rest
|
|
25
|
+
colour = 'white', mobileColour = null, theme, size = 24, direction = 'up', ...rest
|
|
26
26
|
}) => (
|
|
27
27
|
<Icon
|
|
28
28
|
direction={direction}
|
|
@@ -46,11 +46,4 @@ Arrow.propTypes = {
|
|
|
46
46
|
theme: PropTypes.objectOf(PropTypes.shape).isRequired
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
Arrow.defaultProps = {
|
|
50
|
-
colour: 'white',
|
|
51
|
-
mobileColour: null,
|
|
52
|
-
size: 24,
|
|
53
|
-
direction: 'up'
|
|
54
|
-
};
|
|
55
|
-
|
|
56
49
|
export default withTheme(Arrow);
|
|
@@ -15,7 +15,7 @@ const StyledSVG = styled.svg`
|
|
|
15
15
|
`;
|
|
16
16
|
|
|
17
17
|
const AtSign = ({
|
|
18
|
-
theme, size, colour, mobileColour, ...rest
|
|
18
|
+
theme, size = 24, colour = 'white', mobileColour = null, ...rest
|
|
19
19
|
}) => (
|
|
20
20
|
<StyledSVG
|
|
21
21
|
width={size}
|
|
@@ -36,10 +36,4 @@ AtSign.propTypes = {
|
|
|
36
36
|
mobileColour: PropTypes.string
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
AtSign.defaultProps = {
|
|
40
|
-
size: 24,
|
|
41
|
-
colour: 'white',
|
|
42
|
-
mobileColour: null
|
|
43
|
-
};
|
|
44
|
-
|
|
45
39
|
export default withTheme(AtSign);
|
|
@@ -22,7 +22,7 @@ const Icon = styled.svg`
|
|
|
22
22
|
`;
|
|
23
23
|
|
|
24
24
|
const Chevron = ({
|
|
25
|
-
colour, mobileColour, theme, size, direction, ...rest
|
|
25
|
+
colour = 'white', mobileColour = null, theme, size = 24, direction = 'up', ...rest
|
|
26
26
|
}) => (
|
|
27
27
|
<Icon
|
|
28
28
|
direction={direction}
|
|
@@ -47,11 +47,4 @@ Chevron.propTypes = {
|
|
|
47
47
|
theme: PropTypes.objectOf(PropTypes.shape).isRequired
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
Chevron.defaultProps = {
|
|
51
|
-
colour: 'white',
|
|
52
|
-
mobileColour: null,
|
|
53
|
-
size: 24,
|
|
54
|
-
direction: 'up'
|
|
55
|
-
};
|
|
56
|
-
|
|
57
50
|
export default withTheme(Chevron);
|
|
@@ -13,7 +13,7 @@ const StyledSVG = styled.svg`
|
|
|
13
13
|
`;
|
|
14
14
|
|
|
15
15
|
const Download = ({
|
|
16
|
-
colour, mobileColour, theme, size, ...rest
|
|
16
|
+
colour = 'white', mobileColour = null, theme, size = 24, ...rest
|
|
17
17
|
}) => (
|
|
18
18
|
<StyledSVG
|
|
19
19
|
{...rest}
|
|
@@ -36,10 +36,4 @@ Download.propTypes = {
|
|
|
36
36
|
theme: PropTypes.objectOf(PropTypes.shape).isRequired
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
Download.defaultProps = {
|
|
40
|
-
colour: 'white',
|
|
41
|
-
mobileColour: null,
|
|
42
|
-
size: 24
|
|
43
|
-
};
|
|
44
|
-
|
|
45
39
|
export default withTheme(Download);
|
|
@@ -13,7 +13,7 @@ const StyledSVG = styled.svg`
|
|
|
13
13
|
`;
|
|
14
14
|
|
|
15
15
|
const External = ({
|
|
16
|
-
colour, mobileColour, theme, size, ...rest
|
|
16
|
+
colour = 'white', mobileColour = null, theme, size = 24, ...rest
|
|
17
17
|
}) => (
|
|
18
18
|
<StyledSVG
|
|
19
19
|
{...rest}
|
|
@@ -36,10 +36,4 @@ External.propTypes = {
|
|
|
36
36
|
theme: PropTypes.objectOf(PropTypes.shape).isRequired
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
External.defaultProps = {
|
|
40
|
-
colour: 'white',
|
|
41
|
-
mobileColour: null,
|
|
42
|
-
size: 24
|
|
43
|
-
};
|
|
44
|
-
|
|
45
39
|
export default withTheme(External);
|
|
@@ -13,7 +13,7 @@ const StyledSVG = styled.svg`
|
|
|
13
13
|
`;
|
|
14
14
|
|
|
15
15
|
const Favourite = ({
|
|
16
|
-
colour, mobileColour, theme, size, ...rest
|
|
16
|
+
colour = 'white', mobileColour = null, theme, size = 24, ...rest
|
|
17
17
|
}) => (
|
|
18
18
|
<StyledSVG
|
|
19
19
|
{...rest}
|
|
@@ -36,10 +36,4 @@ Favourite.propTypes = {
|
|
|
36
36
|
theme: PropTypes.objectOf(PropTypes.shape).isRequired
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
Favourite.defaultProps = {
|
|
40
|
-
colour: 'white',
|
|
41
|
-
mobileColour: null,
|
|
42
|
-
size: 24
|
|
43
|
-
};
|
|
44
|
-
|
|
45
39
|
export default withTheme(Favourite);
|
|
@@ -13,7 +13,7 @@ const StyledSVG = styled.svg`
|
|
|
13
13
|
`;
|
|
14
14
|
|
|
15
15
|
const Internal = ({
|
|
16
|
-
colour, mobileColour, theme, size, ...rest
|
|
16
|
+
colour = 'white', mobileColour = null, theme, size = 24, ...rest
|
|
17
17
|
}) => (
|
|
18
18
|
<StyledSVG
|
|
19
19
|
{...rest}
|
|
@@ -36,10 +36,4 @@ Internal.propTypes = {
|
|
|
36
36
|
theme: PropTypes.objectOf(PropTypes.shape).isRequired
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
Internal.defaultProps = {
|
|
40
|
-
colour: 'white',
|
|
41
|
-
mobileColour: null,
|
|
42
|
-
size: 24
|
|
43
|
-
};
|
|
44
|
-
|
|
45
39
|
export default withTheme(Internal);
|
|
@@ -62,16 +62,17 @@ const Prefix = styled.div`
|
|
|
62
62
|
const Input = React.forwardRef(
|
|
63
63
|
(
|
|
64
64
|
{
|
|
65
|
-
errorMsg,
|
|
65
|
+
errorMsg = '',
|
|
66
66
|
id,
|
|
67
67
|
label,
|
|
68
|
-
showLabel,
|
|
68
|
+
showLabel = true,
|
|
69
69
|
type,
|
|
70
|
-
hasAria,
|
|
71
|
-
className,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
hasAria = true,
|
|
71
|
+
className = '',
|
|
72
|
+
placeholder = '',
|
|
73
|
+
labelProps = {},
|
|
74
|
+
prefix = '',
|
|
75
|
+
optional = null,
|
|
75
76
|
...rest
|
|
76
77
|
},
|
|
77
78
|
ref
|
|
@@ -90,6 +91,7 @@ const Input = React.forwardRef(
|
|
|
90
91
|
<InputField
|
|
91
92
|
id={id}
|
|
92
93
|
type={type}
|
|
94
|
+
placeholder={placeholder}
|
|
93
95
|
error={!!errorMsg}
|
|
94
96
|
aria-describedby={hasAria ? id : undefined}
|
|
95
97
|
ref={ref}
|
|
@@ -127,15 +129,4 @@ Input.propTypes = {
|
|
|
127
129
|
optional: PropTypes.bool
|
|
128
130
|
};
|
|
129
131
|
|
|
130
|
-
Input.defaultProps = {
|
|
131
|
-
showLabel: true,
|
|
132
|
-
hasAria: true,
|
|
133
|
-
placeholder: '',
|
|
134
|
-
errorMsg: '',
|
|
135
|
-
labelProps: {},
|
|
136
|
-
className: '',
|
|
137
|
-
prefix: '',
|
|
138
|
-
optional: null
|
|
139
|
-
};
|
|
140
|
-
|
|
141
132
|
export default Input;
|
|
@@ -47,10 +47,10 @@ const LabelText = ({
|
|
|
47
47
|
* @constructor
|
|
48
48
|
*/
|
|
49
49
|
const Label = ({
|
|
50
|
-
children,
|
|
50
|
+
children = null,
|
|
51
51
|
label,
|
|
52
|
-
hideLabel,
|
|
53
|
-
optional,
|
|
52
|
+
hideLabel = false,
|
|
53
|
+
optional = null,
|
|
54
54
|
...rest
|
|
55
55
|
}) => (
|
|
56
56
|
<LabelElement {...rest} optional={optional}>
|
|
@@ -70,12 +70,6 @@ Label.propTypes = {
|
|
|
70
70
|
optional: PropTypes.bool
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
Label.defaultProps = {
|
|
74
|
-
hideLabel: false,
|
|
75
|
-
children: null,
|
|
76
|
-
optional: null
|
|
77
|
-
};
|
|
78
|
-
|
|
79
73
|
LabelText.propTypes = {
|
|
80
74
|
label: PropTypes.oneOfType([
|
|
81
75
|
PropTypes.string,
|
|
@@ -85,8 +79,4 @@ LabelText.propTypes = {
|
|
|
85
79
|
children: PropTypes.node
|
|
86
80
|
};
|
|
87
81
|
|
|
88
|
-
LabelText.defaultProps = {
|
|
89
|
-
hideLabel: false,
|
|
90
|
-
children: null
|
|
91
|
-
};
|
|
92
82
|
export default Label;
|
|
@@ -9,15 +9,15 @@ let window = '';
|
|
|
9
9
|
|
|
10
10
|
const Link = ({
|
|
11
11
|
children,
|
|
12
|
-
color,
|
|
13
|
-
mobileColour,
|
|
12
|
+
color = 'red',
|
|
13
|
+
mobileColour = null,
|
|
14
14
|
href,
|
|
15
|
-
target,
|
|
16
|
-
type,
|
|
17
|
-
home,
|
|
18
|
-
underline,
|
|
19
|
-
icon,
|
|
20
|
-
iconFirst,
|
|
15
|
+
target = null,
|
|
16
|
+
type = 'standard',
|
|
17
|
+
home = false,
|
|
18
|
+
underline = true,
|
|
19
|
+
icon = null,
|
|
20
|
+
iconFirst = false,
|
|
21
21
|
...rest
|
|
22
22
|
}) => {
|
|
23
23
|
const [documentHost, setDocumentHost] = useState('');
|
|
@@ -59,6 +59,7 @@ const Link = ({
|
|
|
59
59
|
href={href}
|
|
60
60
|
target={window}
|
|
61
61
|
type={type}
|
|
62
|
+
home={home}
|
|
62
63
|
iconFirst={iconFirst}
|
|
63
64
|
underline={underline}
|
|
64
65
|
>
|
|
@@ -89,15 +90,4 @@ Link.propTypes = {
|
|
|
89
90
|
icon: PropTypes.node
|
|
90
91
|
};
|
|
91
92
|
|
|
92
|
-
Link.defaultProps = {
|
|
93
|
-
type: 'standard',
|
|
94
|
-
color: 'red',
|
|
95
|
-
mobileColour: null,
|
|
96
|
-
target: null,
|
|
97
|
-
home: false,
|
|
98
|
-
underline: true,
|
|
99
|
-
iconFirst: false,
|
|
100
|
-
icon: null
|
|
101
|
-
};
|
|
102
|
-
|
|
103
93
|
export default Link;
|
|
@@ -46,7 +46,7 @@ const themeSwitcher = theme => {
|
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
const Logo = ({
|
|
49
|
-
rotate, sizeSm, sizeMd, campaign
|
|
49
|
+
rotate = false, sizeSm = '51px', sizeMd = '70px', campaign = 'Comic Relief'
|
|
50
50
|
}) => (
|
|
51
51
|
<LogoWrapper rotate={rotate ? 1 : 0} sizeSm={sizeSm} sizeMd={sizeMd}>
|
|
52
52
|
<Image
|
|
@@ -68,11 +68,4 @@ Logo.propTypes = {
|
|
|
68
68
|
campaign: PropTypes.string
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
Logo.defaultProps = {
|
|
72
|
-
rotate: false,
|
|
73
|
-
sizeSm: '51px', // - to work with the header 75px height and 12px padding
|
|
74
|
-
sizeMd: '70px',
|
|
75
|
-
campaign: 'Comic Relief'
|
|
76
|
-
};
|
|
77
|
-
|
|
78
71
|
export default Logo;
|
|
@@ -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;
|