@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
|
@@ -21,10 +21,10 @@ const ImpactSlider = _ref => {
|
|
|
21
21
|
items,
|
|
22
22
|
step,
|
|
23
23
|
max,
|
|
24
|
-
backgroundColour,
|
|
25
|
-
opacityAnimation,
|
|
24
|
+
backgroundColour = 'grey_extra_light',
|
|
25
|
+
opacityAnimation = false,
|
|
26
26
|
children,
|
|
27
|
-
defaultSliderValue
|
|
27
|
+
defaultSliderValue = null
|
|
28
28
|
} = _ref;
|
|
29
29
|
// Use the lowest possible amount as our default:
|
|
30
30
|
const [currentAmount, setCurrentAmount] = (0, _react.useState)(defaultSliderValue || step);
|
|
@@ -65,9 +65,4 @@ const ImpactSlider = _ref => {
|
|
|
65
65
|
disabled: currentAmount === 0
|
|
66
66
|
}, "Donate \xA3", currentAmount, ' ', "now")));
|
|
67
67
|
};
|
|
68
|
-
ImpactSlider.defaultProps = {
|
|
69
|
-
opacityAnimation: false,
|
|
70
|
-
defaultSliderValue: null,
|
|
71
|
-
backgroundColour: 'grey_extra_light'
|
|
72
|
-
};
|
|
73
68
|
var _default = exports.default = ImpactSlider;
|
|
@@ -12,8 +12,8 @@ const CheckAnswer = _ref => {
|
|
|
12
12
|
let {
|
|
13
13
|
name,
|
|
14
14
|
mpValidationOptions,
|
|
15
|
-
userSelection,
|
|
16
|
-
formContext
|
|
15
|
+
userSelection = null,
|
|
16
|
+
formContext = null
|
|
17
17
|
} = _ref;
|
|
18
18
|
const {
|
|
19
19
|
setValue,
|
|
@@ -62,8 +62,4 @@ const CheckAnswer = _ref => {
|
|
|
62
62
|
onChange: onChange
|
|
63
63
|
})), /*#__PURE__*/_react.default.createElement("span", null), _AssociatedFields.default[name].label));
|
|
64
64
|
};
|
|
65
|
-
CheckAnswer.defaultProps = {
|
|
66
|
-
userSelection: null,
|
|
67
|
-
formContext: null
|
|
68
|
-
};
|
|
69
65
|
var _default = exports.default = CheckAnswer;
|
|
@@ -27,11 +27,11 @@ var _MarketingPreferencesDS = require("./MarketingPreferencesDS.style");
|
|
|
27
27
|
var _MarketingPrefsConfig = require("./_MarketingPrefsConfig");
|
|
28
28
|
const MarketingPreferencesDS = _ref => {
|
|
29
29
|
let {
|
|
30
|
-
copyTop,
|
|
31
|
-
copyBottom,
|
|
30
|
+
copyTop = _DefaultCopy.defaultCopyTop,
|
|
31
|
+
copyBottom = _DefaultCopy.defaultCopyBottom,
|
|
32
32
|
mpValidationOptions,
|
|
33
|
-
id,
|
|
34
|
-
formContext
|
|
33
|
+
id = null,
|
|
34
|
+
formContext = null
|
|
35
35
|
} = _ref;
|
|
36
36
|
const {
|
|
37
37
|
formState: {
|
|
@@ -212,23 +212,13 @@ const MarketingPreferencesDS = _ref => {
|
|
|
212
212
|
exports.MarketingPreferencesDS = MarketingPreferencesDS;
|
|
213
213
|
const MaybeDisabled = _ref2 => {
|
|
214
214
|
let {
|
|
215
|
-
children,
|
|
216
|
-
disabled
|
|
215
|
+
children = null,
|
|
216
|
+
disabled = false
|
|
217
217
|
} = _ref2;
|
|
218
218
|
if (disabled) return null;
|
|
219
219
|
return children;
|
|
220
220
|
};
|
|
221
|
-
MarketingPreferencesDS.defaultProps = {
|
|
222
|
-
copyTop: _DefaultCopy.defaultCopyTop,
|
|
223
|
-
copyBottom: _DefaultCopy.defaultCopyBottom,
|
|
224
|
-
id: null,
|
|
225
|
-
formContext: null
|
|
226
|
-
};
|
|
227
221
|
MaybeDisabled.propTypes = {
|
|
228
222
|
children: _propTypes.default.node,
|
|
229
223
|
disabled: _propTypes.default.bool
|
|
230
|
-
};
|
|
231
|
-
MaybeDisabled.defaultProps = {
|
|
232
|
-
children: null,
|
|
233
|
-
disabled: false
|
|
234
224
|
};
|
|
@@ -11,9 +11,9 @@ const TextInput = _ref => {
|
|
|
11
11
|
let {
|
|
12
12
|
fieldName,
|
|
13
13
|
label,
|
|
14
|
-
optional,
|
|
15
|
-
fieldType,
|
|
16
|
-
formContext,
|
|
14
|
+
optional = null,
|
|
15
|
+
fieldType = 'text',
|
|
16
|
+
formContext = null,
|
|
17
17
|
...rest
|
|
18
18
|
} = _ref;
|
|
19
19
|
const {
|
|
@@ -34,9 +34,4 @@ const TextInput = _ref => {
|
|
|
34
34
|
};
|
|
35
35
|
return /*#__PURE__*/_react.default.createElement(_Input.default, Object.assign({}, props, register(fieldName)));
|
|
36
36
|
};
|
|
37
|
-
TextInput.defaultProps = {
|
|
38
|
-
optional: null,
|
|
39
|
-
fieldType: 'text',
|
|
40
|
-
formContext: null
|
|
41
|
-
};
|
|
42
37
|
var _default = exports.default = TextInput;
|
|
@@ -18,7 +18,7 @@ const Signup = _ref => {
|
|
|
18
18
|
},
|
|
19
19
|
donateLink,
|
|
20
20
|
otherDescription,
|
|
21
|
-
clientID,
|
|
21
|
+
clientID = 'the_fix',
|
|
22
22
|
cartID,
|
|
23
23
|
mbshipID,
|
|
24
24
|
...rest
|
|
@@ -157,8 +157,4 @@ const Signup = _ref => {
|
|
|
157
157
|
as: "p"
|
|
158
158
|
}, moneyBuyCopy))));
|
|
159
159
|
};
|
|
160
|
-
Signup.defaultProps = {
|
|
161
|
-
clientID: 'the_fix',
|
|
162
|
-
data: {}
|
|
163
|
-
};
|
|
164
160
|
var _default = exports.default = Signup;
|
|
@@ -11,19 +11,19 @@ var _Form = _interopRequireDefault(require("./Form/Form"));
|
|
|
11
11
|
var _Membership = require("./Membership.style");
|
|
12
12
|
const Membership = _ref => {
|
|
13
13
|
let {
|
|
14
|
-
alt,
|
|
14
|
+
alt = '',
|
|
15
|
+
data = {},
|
|
16
|
+
formAligntRight = true,
|
|
17
|
+
imageLow = null,
|
|
18
|
+
image = null,
|
|
19
|
+
images = null,
|
|
20
|
+
backgroundColor = null,
|
|
21
|
+
mbshipID = null,
|
|
15
22
|
cartID,
|
|
16
|
-
backgroundColor,
|
|
17
23
|
donateLink,
|
|
18
|
-
data,
|
|
19
24
|
title,
|
|
20
25
|
subtitle,
|
|
21
|
-
otherDescription
|
|
22
|
-
formAligntRight,
|
|
23
|
-
images,
|
|
24
|
-
image,
|
|
25
|
-
imageLow,
|
|
26
|
-
mbshipID
|
|
26
|
+
otherDescription
|
|
27
27
|
} = _ref;
|
|
28
28
|
return /*#__PURE__*/_react.default.createElement(_Membership.Container, {
|
|
29
29
|
formAligntRight: formAligntRight,
|
|
@@ -52,14 +52,4 @@ const Membership = _ref => {
|
|
|
52
52
|
donateLink: donateLink
|
|
53
53
|
})));
|
|
54
54
|
};
|
|
55
|
-
Membership.defaultProps = {
|
|
56
|
-
alt: '',
|
|
57
|
-
data: {},
|
|
58
|
-
formAligntRight: true,
|
|
59
|
-
imageLow: null,
|
|
60
|
-
image: null,
|
|
61
|
-
images: null,
|
|
62
|
-
backgroundColor: null,
|
|
63
|
-
mbshipID: null
|
|
64
|
-
};
|
|
65
55
|
var _default = exports.default = Membership;
|
|
@@ -48,9 +48,9 @@ const MoneyBox = (0, _styledComponents.default)(_Input.default).withConfig({
|
|
|
48
48
|
const MoneyBuy = _ref7 => {
|
|
49
49
|
let {
|
|
50
50
|
setOtherAmount,
|
|
51
|
-
amount,
|
|
52
|
-
currency,
|
|
53
|
-
description,
|
|
51
|
+
amount = '10',
|
|
52
|
+
currency = '£',
|
|
53
|
+
description = 'description',
|
|
54
54
|
...rest
|
|
55
55
|
} = _ref7;
|
|
56
56
|
return /*#__PURE__*/_react.default.createElement(MoneyBox, Object.assign({}, rest, {
|
|
@@ -62,9 +62,4 @@ const MoneyBuy = _ref7 => {
|
|
|
62
62
|
onClick: setOtherAmount
|
|
63
63
|
}));
|
|
64
64
|
};
|
|
65
|
-
MoneyBuy.defaultProps = {
|
|
66
|
-
amount: '10',
|
|
67
|
-
currency: '£',
|
|
68
|
-
description: 'description'
|
|
69
|
-
};
|
|
70
65
|
var _default = exports.default = MoneyBuy;
|
package/package.json
CHANGED
|
@@ -33,20 +33,15 @@ const StyledButton = styled.button`
|
|
|
33
33
|
}
|
|
34
34
|
`;
|
|
35
35
|
|
|
36
|
-
const Button = React.forwardRef(({ children, wrapper, ...rest }, ref) => (
|
|
36
|
+
const Button = React.forwardRef(({ children, wrapper = false, ...rest }, ref) => (
|
|
37
37
|
<StyledButton {...rest} as={wrapper ? 'span' : 'button'} ref={ref}>
|
|
38
38
|
{children}
|
|
39
39
|
</StyledButton>
|
|
40
40
|
));
|
|
41
41
|
|
|
42
42
|
Button.propTypes = {
|
|
43
|
-
|
|
44
|
-
wrapper: PropTypes.bool
|
|
45
|
-
children: PropTypes.node.isRequired
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
Button.defaultProps = {
|
|
49
|
-
wrapper: false
|
|
43
|
+
children: PropTypes.node.isRequired,
|
|
44
|
+
wrapper: PropTypes.bool // Buttons as span
|
|
50
45
|
};
|
|
51
46
|
|
|
52
47
|
export default Button;
|
|
@@ -19,7 +19,7 @@ const LoaderContainer = styled.div`${({ withMargin }) => (withMargin ? `
|
|
|
19
19
|
|
|
20
20
|
// A button with loading and disabled states.
|
|
21
21
|
const ButtonWithStates = React.forwardRef(({
|
|
22
|
-
children, loadingText, loading, disabled, ...rest
|
|
22
|
+
children, loadingText = 'Loading', loading = false, disabled = false, ...rest
|
|
23
23
|
}, ref) => {
|
|
24
24
|
const [loaderColour, setLoaderColour] = useState(null);
|
|
25
25
|
|
|
@@ -55,10 +55,4 @@ ButtonWithStates.propTypes = {
|
|
|
55
55
|
disabled: PropTypes.bool
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
ButtonWithStates.defaultProps = {
|
|
59
|
-
loading: false,
|
|
60
|
-
disabled: false,
|
|
61
|
-
loadingText: 'Loading'
|
|
62
|
-
};
|
|
63
|
-
|
|
64
58
|
export default ButtonWithStates;
|
|
@@ -45,7 +45,7 @@ const Label = styled.label`
|
|
|
45
45
|
`;
|
|
46
46
|
|
|
47
47
|
const Checkbox = React.forwardRef(({
|
|
48
|
-
label, value, children, ...rest
|
|
48
|
+
label = undefined, value, children = undefined, ...rest
|
|
49
49
|
}, ref) => (
|
|
50
50
|
<Label hasLabelAsString={!!label}>
|
|
51
51
|
<StyledCheckboxInput {...rest} value={value} ref={ref} />
|
|
@@ -61,9 +61,4 @@ Checkbox.propTypes = {
|
|
|
61
61
|
children: PropTypes.node
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
Checkbox.defaultProps = {
|
|
65
|
-
label: undefined,
|
|
66
|
-
children: undefined
|
|
67
|
-
};
|
|
68
|
-
|
|
69
64
|
export default Checkbox;
|
|
@@ -31,7 +31,7 @@ function getAnimationSettings(originXA, originXB) {
|
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export default function Confetti({ trigger, duration }) {
|
|
34
|
+
export default function Confetti({ trigger, duration = 3000 }) {
|
|
35
35
|
const refAnimationInstance = useRef(null);
|
|
36
36
|
const [intervalId, setIntervalId] = useState();
|
|
37
37
|
|
|
@@ -96,10 +96,6 @@ export default function Confetti({ trigger, duration }) {
|
|
|
96
96
|
);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
Confetti.defaultProps = {
|
|
100
|
-
duration: 3000
|
|
101
|
-
};
|
|
102
|
-
|
|
103
99
|
Confetti.propTypes = {
|
|
104
100
|
trigger: PropTypes.bool.isRequired,
|
|
105
101
|
duration: PropTypes.number
|
|
@@ -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;
|