@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.
Files changed (120) hide show
  1. package/.eslintrc +1 -0
  2. package/dist/components/Atoms/Button/Button.js +3 -7
  3. package/dist/components/Atoms/ButtonWithStates/ButtonWithStates.js +3 -8
  4. package/dist/components/Atoms/Checkbox/Checkbox.js +2 -6
  5. package/dist/components/Atoms/Confetti/Confetti.js +2 -5
  6. package/dist/components/Atoms/Icons/Arrow.js +4 -10
  7. package/dist/components/Atoms/Icons/AtSign.js +3 -8
  8. package/dist/components/Atoms/Icons/Chevron.js +4 -10
  9. package/dist/components/Atoms/Icons/Download.js +3 -8
  10. package/dist/components/Atoms/Icons/External.js +3 -8
  11. package/dist/components/Atoms/Icons/Favourite.js +3 -8
  12. package/dist/components/Atoms/Icons/Internal.js +3 -8
  13. package/dist/components/Atoms/Input/Input.js +9 -17
  14. package/dist/components/Atoms/Label/Label.js +3 -12
  15. package/dist/components/Atoms/Link/Link.js +9 -18
  16. package/dist/components/Atoms/Logo/Logo.js +4 -11
  17. package/dist/components/Atoms/Pagination/Pagination.js +39 -52
  18. package/dist/components/Atoms/Picture/Picture.js +10 -22
  19. package/dist/components/Atoms/RichText/RichText.js +2 -6
  20. package/dist/components/Atoms/Select/Select.js +6 -16
  21. package/dist/components/Atoms/SocialIcons/SocialIcons.js +2 -3
  22. package/dist/components/Atoms/Text/Text.js +12 -17
  23. package/dist/components/Atoms/TextArea/TextArea.js +6 -11
  24. package/dist/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.js +2 -9
  25. package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.js +8 -18
  26. package/dist/components/Molecules/Banner/Banner.js +1 -4
  27. package/dist/components/Molecules/Box/Box.js +6 -17
  28. package/dist/components/Molecules/Card/Card.js +11 -24
  29. package/dist/components/Molecules/CardDs/CardDs.js +11 -24
  30. package/dist/components/Molecules/Chip/Chip.js +2 -6
  31. package/dist/components/Molecules/Countdown/Countdown.js +3 -8
  32. package/dist/components/Molecules/Logos/Logos.js +1 -4
  33. package/dist/components/Molecules/Lookup/Lookup.js +2 -6
  34. package/dist/components/Molecules/Promo/Promo.js +17 -36
  35. package/dist/components/Molecules/SchoolLookup/SchoolLookup.js +4 -10
  36. package/dist/components/Molecules/SearchInput/SearchInput.js +1 -4
  37. package/dist/components/Molecules/SearchResult/SearchResult.js +8 -17
  38. package/dist/components/Molecules/ShareButton/ShareButton.js +3 -8
  39. package/dist/components/Molecules/SimpleSchoolLookup/SimpleSchoolLookup.js +1 -4
  40. package/dist/components/Molecules/SingleMessage/SingleMessage.js +15 -32
  41. package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.js +13 -28
  42. package/dist/components/Molecules/Typeahead/Typeahead.js +3 -8
  43. package/dist/components/Molecules/VideoBanner/VideoBanner.js +5 -12
  44. package/dist/components/Organisms/Donate/Donate.js +31 -65
  45. package/dist/components/Organisms/Donate/Form/Form.js +6 -19
  46. package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.js +1 -4
  47. package/dist/components/Organisms/Donate/MoneyBuy/MoneyBuy.js +3 -8
  48. package/dist/components/Organisms/EmailSignUp/_EmailSignUp.js +4 -9
  49. package/dist/components/Organisms/EmailSignUp/_TextInput.js +3 -8
  50. package/dist/components/Organisms/Footer/Footer.js +6 -11
  51. package/dist/components/Organisms/Footer/Nav/Nav.js +1 -4
  52. package/dist/components/Organisms/Header/Header.js +2 -6
  53. package/dist/components/Organisms/Header/Nav/Nav.js +1 -4
  54. package/dist/components/Organisms/ImpactSlider/ImpactSlider.js +3 -8
  55. package/dist/components/Organisms/MarketingPreferencesDS/_CheckAnswer.js +2 -6
  56. package/dist/components/Organisms/MarketingPreferencesDS/_MarketingPreferencesDS.js +6 -16
  57. package/dist/components/Organisms/MarketingPreferencesDS/_TextInput.js +3 -8
  58. package/dist/components/Organisms/Membership/Form/Form.js +1 -5
  59. package/dist/components/Organisms/Membership/Membership.js +9 -19
  60. package/dist/components/Organisms/Membership/MoneyBox/MoneyBox.js +3 -8
  61. package/package.json +1 -1
  62. package/src/components/Atoms/Button/Button.js +3 -8
  63. package/src/components/Atoms/ButtonWithStates/ButtonWithStates.js +1 -7
  64. package/src/components/Atoms/Checkbox/Checkbox.js +1 -6
  65. package/src/components/Atoms/Confetti/Confetti.js +1 -5
  66. package/src/components/Atoms/Icons/Arrow.js +1 -8
  67. package/src/components/Atoms/Icons/AtSign.js +1 -7
  68. package/src/components/Atoms/Icons/Chevron.js +1 -8
  69. package/src/components/Atoms/Icons/Download.js +1 -7
  70. package/src/components/Atoms/Icons/External.js +1 -7
  71. package/src/components/Atoms/Icons/Favourite.js +1 -7
  72. package/src/components/Atoms/Icons/Internal.js +1 -7
  73. package/src/components/Atoms/Input/Input.js +9 -18
  74. package/src/components/Atoms/Label/Label.js +3 -13
  75. package/src/components/Atoms/Link/Link.js +9 -19
  76. package/src/components/Atoms/Logo/Logo.js +1 -8
  77. package/src/components/Atoms/Pagination/Pagination.js +38 -51
  78. package/src/components/Atoms/Picture/Picture.js +10 -23
  79. package/src/components/Atoms/RichText/RichText.js +1 -6
  80. package/src/components/Atoms/Select/Select.js +6 -17
  81. package/src/components/Atoms/SocialIcons/SocialIcons.js +2 -5
  82. package/src/components/Atoms/Text/Text.js +4 -13
  83. package/src/components/Atoms/TextArea/TextArea.js +2 -9
  84. package/src/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.js +2 -11
  85. package/src/components/Molecules/ArticleTeaser/ArticleTeaser.js +8 -19
  86. package/src/components/Molecules/Banner/Banner.js +1 -5
  87. package/src/components/Molecules/Box/Box.js +6 -18
  88. package/src/components/Molecules/Card/Card.js +11 -25
  89. package/src/components/Molecules/CardDs/CardDs.js +11 -25
  90. package/src/components/Molecules/Chip/Chip.js +1 -6
  91. package/src/components/Molecules/Countdown/Countdown.js +1 -7
  92. package/src/components/Molecules/Logos/Logos.js +1 -5
  93. package/src/components/Molecules/Lookup/Lookup.js +2 -7
  94. package/src/components/Molecules/Promo/Promo.js +17 -37
  95. package/src/components/Molecules/SchoolLookup/SchoolLookup.js +4 -11
  96. package/src/components/Molecules/SearchInput/SearchInput.js +1 -5
  97. package/src/components/Molecules/SearchResult/SearchResult.js +8 -18
  98. package/src/components/Molecules/ShareButton/ShareButton.js +1 -7
  99. package/src/components/Molecules/SimpleSchoolLookup/SimpleSchoolLookup.js +4 -5
  100. package/src/components/Molecules/SingleMessage/SingleMessage.js +15 -33
  101. package/src/components/Molecules/SingleMessageDS/SingleMessageDs.js +13 -29
  102. package/src/components/Molecules/Typeahead/Typeahead.js +3 -9
  103. package/src/components/Molecules/VideoBanner/VideoBanner.js +7 -9
  104. package/src/components/Organisms/Donate/Donate.js +32 -67
  105. package/src/components/Organisms/Donate/Form/Form.js +6 -22
  106. package/src/components/Organisms/Donate/GivingSelector/GivingSelector.js +1 -5
  107. package/src/components/Organisms/Donate/MoneyBuy/MoneyBuy.js +3 -9
  108. package/src/components/Organisms/EmailSignUp/_EmailSignUp.js +3 -9
  109. package/src/components/Organisms/EmailSignUp/_TextInput.js +3 -9
  110. package/src/components/Organisms/Footer/Footer.js +2 -10
  111. package/src/components/Organisms/Footer/Nav/Nav.js +1 -5
  112. package/src/components/Organisms/Header/Header.js +1 -6
  113. package/src/components/Organisms/Header/Nav/Nav.js +1 -5
  114. package/src/components/Organisms/ImpactSlider/ImpactSlider.js +1 -7
  115. package/src/components/Organisms/MarketingPreferencesDS/_CheckAnswer.js +1 -6
  116. package/src/components/Organisms/MarketingPreferencesDS/_MarketingPreferencesDS.js +5 -17
  117. package/src/components/Organisms/MarketingPreferencesDS/_TextInput.js +1 -7
  118. package/src/components/Organisms/Membership/Form/Form.js +1 -5
  119. package/src/components/Organisms/Membership/Membership.js +9 -19
  120. package/src/components/Organisms/Membership/MoneyBox/MoneyBox.js +3 -9
@@ -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
- height,
52
- width,
53
- children,
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
- imageLow,
9
- images,
10
- image,
11
- imageAltText,
12
- height,
13
- width,
14
- children,
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
- icon,
11
- backgroundColor,
12
- imageLow,
13
- images,
14
- image,
15
- imageAltText,
16
- height,
17
- width,
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
- copyLeft,
14
- backgroundColor,
15
- imageLow,
16
- imageSet,
17
- image,
18
- imageAltText,
19
- children,
20
- position,
21
- autoPlay,
22
- loop,
23
- poster,
24
- mobilePoster,
25
- showPosterAfterPlaying,
26
- videoSrc,
27
- mobileVideoSrc,
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;
@@ -20,10 +20,10 @@ const optionParser = school => `${school.name}, ${school.post_code}`;
20
20
  const SchoolLookup = React.forwardRef(
21
21
  (
22
22
  {
23
- label,
24
- placeholder,
25
- notFoundMessage,
26
- dropdownInstruction,
23
+ label = 'Enter the name or postcode of your school or nursery',
24
+ placeholder = 'Type to start search',
25
+ dropdownInstruction = 'Please select a school from the list below',
26
+ notFoundMessage = "Sorry, we can't find this school",
27
27
  onSelect,
28
28
  ...rest
29
29
  },
@@ -55,11 +55,4 @@ SchoolLookup.propTypes = {
55
55
  notFoundMessage: PropTypes.string
56
56
  };
57
57
 
58
- SchoolLookup.defaultProps = {
59
- label: 'Enter the name or postcode of your school or nursery',
60
- placeholder: 'Type to start search',
61
- dropdownInstruction: 'Please select a school from the list below',
62
- notFoundMessage: "Sorry, we can't find this school"
63
- };
64
-
65
58
  export default SchoolLookup;
@@ -10,7 +10,7 @@ import {
10
10
  } from './SearchInput.style';
11
11
 
12
12
  const SearchInput = ({
13
- onChange, placeholder, value, ...rest
13
+ onChange, placeholder = '', value, ...rest
14
14
  }) => (
15
15
  <Wrapper>
16
16
  <InnerWrapper>
@@ -41,8 +41,4 @@ SearchInput.propTypes = {
41
41
  value: PropTypes.string.isRequired
42
42
  };
43
43
 
44
- SearchInput.defaultProps = {
45
- placeholder: ''
46
- };
47
-
48
44
  export default SearchInput;
@@ -59,16 +59,16 @@ const Title = styled(Text)`
59
59
  * Search Result component
60
60
  */
61
61
  const SearchResult = ({
62
+ imageLow = null,
63
+ images = null,
64
+ type = '',
65
+ date = '',
66
+ copy = '',
67
+ smallImageWidth = '45%',
68
+ largeImageWidth = '100%',
62
69
  href,
63
- date,
64
70
  title,
65
- copy,
66
- type,
67
- imageLow,
68
- images,
69
- alt,
70
- smallImageWidth,
71
- largeImageWidth
71
+ alt
72
72
  }) => (
73
73
  <Wrapper>
74
74
  <Item href={href} type="standard">
@@ -122,14 +122,4 @@ SearchResult.propTypes = {
122
122
  imageLow: PropTypes.string
123
123
  };
124
124
 
125
- SearchResult.defaultProps = {
126
- imageLow: null,
127
- images: null,
128
- type: '',
129
- date: '',
130
- copy: '',
131
- smallImageWidth: '45%',
132
- largeImageWidth: '100%'
133
- };
134
-
135
125
  export default SearchResult;
@@ -27,7 +27,7 @@ const handleShare = (e, typeOfShare, urlToShare) => {
27
27
 
28
28
  /* Share Button component to handle FB and Twitter sharing */
29
29
  const ShareButton = ({
30
- campaign, copy, urlToShare, ...restProps
30
+ campaign = 'comicrelief', copy = 'Share with:', urlToShare = null, ...restProps
31
31
  }) => {
32
32
  let checkedUrl = '';
33
33
 
@@ -70,10 +70,4 @@ ShareButton.propTypes = {
70
70
  urlToShare: PropTypes.string
71
71
  };
72
72
 
73
- ShareButton.defaultProps = {
74
- campaign: 'comicrelief',
75
- copy: 'Share with:',
76
- urlToShare: null
77
- };
78
-
79
73
  export default ShareButton;
@@ -41,7 +41,10 @@ const schoolToString = school => `${school.name}, ${school.post_code}`;
41
41
  * @returns {JSX.Element}
42
42
  * @constructor
43
43
  */
44
- const SimpleSchoolLookup = ({ onSelect, noResultsMessage, ...rest }) => (
44
+ const SimpleSchoolLookup = ({
45
+ onSelect, noResultsMessage = 'Sorry, we could not find anything matching your search; please use the manual entry option.',
46
+ ...rest
47
+ }) => (
45
48
  <Lookup
46
49
  name="school_lookup"
47
50
  label="Enter the name or postcode of your organisation"
@@ -56,10 +59,6 @@ const SimpleSchoolLookup = ({ onSelect, noResultsMessage, ...rest }) => (
56
59
  />
57
60
  );
58
61
 
59
- SimpleSchoolLookup.defaultProps = {
60
- noResultsMessage: 'Sorry, we could not find anything matching your search; please use the manual entry option.'
61
- };
62
-
63
62
  SimpleSchoolLookup.propTypes = {
64
63
  onSelect: PropTypes.func.isRequired,
65
64
  noResultsMessage: PropTypes.string
@@ -17,21 +17,21 @@ const allPlayers = {};
17
17
 
18
18
  /* Single Message is our main component usually to build landing pages */
19
19
  const SingleMessage = ({
20
- backgroundColor,
21
- copyFirst,
22
- imageLow,
23
- imageSet,
24
- image,
25
- imageSet2,
26
- image2,
27
- imageAltText,
28
- imageAltText2,
29
- children,
30
- fullImage,
31
- vhFull,
32
- videoID,
33
- landscapeVideo,
34
- paddingOption
20
+ backgroundColor = 'white',
21
+ copyFirst = false,
22
+ fullImage = false,
23
+ imageSet = null,
24
+ imageLow = null,
25
+ image = null,
26
+ imageSet2 = null,
27
+ image2 = null,
28
+ imageAltText = '',
29
+ imageAltText2 = '',
30
+ children = null,
31
+ vhFull = false,
32
+ videoID = null,
33
+ landscapeVideo = false,
34
+ paddingOption = null
35
35
  }) => {
36
36
  const hasImage = imageSet || false;
37
37
  const doubleImage = (imageSet || image) && (imageSet2 || image2);
@@ -240,22 +240,4 @@ SingleMessage.propTypes = {
240
240
  paddingOption: PropTypes.string
241
241
  };
242
242
 
243
- SingleMessage.defaultProps = {
244
- backgroundColor: 'white',
245
- copyFirst: false,
246
- fullImage: false,
247
- imageSet: null,
248
- imageLow: null,
249
- image: null,
250
- imageSet2: null,
251
- image2: null,
252
- imageAltText: '',
253
- imageAltText2: '',
254
- children: null,
255
- vhFull: false,
256
- videoID: null,
257
- landscapeVideo: false,
258
- paddingOption: null
259
- };
260
-
261
243
  export default SingleMessage;
@@ -11,22 +11,22 @@ import {
11
11
  import playImage from './assets/play.png';
12
12
 
13
13
  const SingleMessageDs = ({
14
- backgroundColor,
14
+ backgroundColor = 'white',
15
+ imageLow = null,
16
+ images = null,
17
+ image = null,
18
+ link = null,
19
+ ctaBgColor = 'red',
20
+ linkLabel = null,
21
+ target = null,
22
+ imageAltText = '',
23
+ width = '100%',
24
+ height = '100%',
25
+ linkIcon = null,
26
+ youTubeId = null,
15
27
  imageLeft,
16
- imageLow,
17
- images,
18
- image,
19
- imageAltText,
20
- height,
21
- width,
22
28
  subtitle,
23
29
  children,
24
- link,
25
- linkLabel,
26
- ctaBgColor,
27
- target,
28
- linkIcon,
29
- youTubeId,
30
30
  ...rest
31
31
  }) => {
32
32
  const [isOpen, setIsOpen] = useState(false);
@@ -192,20 +192,4 @@ SingleMessageDs.propTypes = {
192
192
  youTubeId: PropTypes.string
193
193
  };
194
194
 
195
- SingleMessageDs.defaultProps = {
196
- backgroundColor: 'white',
197
- imageLow: null,
198
- images: null,
199
- image: null,
200
- link: null,
201
- ctaBgColor: 'red',
202
- linkLabel: null,
203
- target: null,
204
- imageAltText: '',
205
- width: '100%',
206
- height: '100%',
207
- linkIcon: null,
208
- youTubeId: null
209
- };
210
-
211
195
  export default SingleMessageDs;
@@ -12,14 +12,14 @@ const Typeahead = React.forwardRef(
12
12
  (
13
13
  {
14
14
  optionFetcher,
15
- optionParser,
15
+ optionParser = null,
16
16
  onSelect,
17
17
  id,
18
18
  label,
19
19
  name,
20
- dropdownInstruction,
20
+ dropdownInstruction = null,
21
21
  notFoundMessage,
22
- fetchErrorHandler,
22
+ fetchErrorHandler = () => 'Sorry, there was an unexpected error. Please try again',
23
23
  ...rest
24
24
  },
25
25
  ref
@@ -113,10 +113,4 @@ Typeahead.propTypes = {
113
113
  dropdownInstruction: PropTypes.string
114
114
  };
115
115
 
116
- Typeahead.defaultProps = {
117
- dropdownInstruction: null,
118
- optionParser: null,
119
- fetchErrorHandler: () => 'Sorry, there was an unexpected error. Please try again'
120
- };
121
-
122
116
  export default Typeahead;
@@ -10,7 +10,13 @@ const Video = styled.video.attrs(() => ({
10
10
  `;
11
11
 
12
12
  const VideoBanner = ({
13
- video, poster, controls, autoPlay, loop, muted, showPosterAfterPlaying
13
+ video,
14
+ poster,
15
+ controls = false,
16
+ autoPlay = true,
17
+ loop = false,
18
+ muted = true,
19
+ showPosterAfterPlaying = true
14
20
  }) => {
15
21
  // Use the prop as our default
16
22
  const [isMuted, setIsMuted] = useState(muted);
@@ -53,14 +59,6 @@ const VideoBanner = ({
53
59
  );
54
60
  };
55
61
 
56
- VideoBanner.defaultProps = {
57
- showPosterAfterPlaying: true,
58
- controls: false,
59
- autoPlay: true,
60
- loop: false,
61
- muted: true
62
- };
63
-
64
62
  VideoBanner.propTypes = {
65
63
  showPosterAfterPlaying: PropTypes.bool,
66
64
  video: PropTypes.string.isRequired,