@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
@@ -15,14 +15,14 @@ const MIN_CHARS_FOR_FETCH = 2;
15
15
  const Typeahead = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
16
16
  let {
17
17
  optionFetcher,
18
- optionParser,
18
+ optionParser = null,
19
19
  onSelect,
20
20
  id,
21
21
  label,
22
22
  name,
23
- dropdownInstruction,
23
+ dropdownInstruction = null,
24
24
  notFoundMessage,
25
- fetchErrorHandler,
25
+ fetchErrorHandler = () => 'Sorry, there was an unexpected error. Please try again',
26
26
  ...rest
27
27
  } = _ref;
28
28
  const [options, setOptions] = (0, _react.useState)([]);
@@ -80,9 +80,4 @@ const Typeahead = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
80
80
  ref: ref
81
81
  }));
82
82
  });
83
- Typeahead.defaultProps = {
84
- dropdownInstruction: null,
85
- optionParser: null,
86
- fetchErrorHandler: () => 'Sorry, there was an unexpected error. Please try again'
87
- };
88
83
  var _default = exports.default = Typeahead;
@@ -18,11 +18,11 @@ const VideoBanner = _ref => {
18
18
  let {
19
19
  video,
20
20
  poster,
21
- controls,
22
- autoPlay,
23
- loop,
24
- muted,
25
- showPosterAfterPlaying
21
+ controls = false,
22
+ autoPlay = true,
23
+ loop = false,
24
+ muted = true,
25
+ showPosterAfterPlaying = true
26
26
  } = _ref;
27
27
  // Use the prop as our default
28
28
  const [isMuted, setIsMuted] = (0, _react.useState)(muted);
@@ -56,11 +56,4 @@ const VideoBanner = _ref => {
56
56
  muted: isMuted
57
57
  }, "Your browser does not support video.");
58
58
  };
59
- VideoBanner.defaultProps = {
60
- showPosterAfterPlaying: true,
61
- controls: false,
62
- autoPlay: true,
63
- loop: false,
64
- muted: true
65
- };
66
59
  var _default = exports.default = VideoBanner;
@@ -16,41 +16,40 @@ var _utils = require("./_utils");
16
16
  var _Donate = require("./Donate.style");
17
17
  const Donate = _ref => {
18
18
  let {
19
- alt,
19
+ alt = '',
20
+ data = {},
21
+ formAlignRight = true,
22
+ imageLow = null,
23
+ image = null,
24
+ images = null,
25
+ mobileImageLow = null,
26
+ mobileImage = null,
27
+ mobileImages = null,
28
+ mobileAlt = '',
29
+ desktopOverlayColor = 'transparent',
30
+ mobileBackgroundColor = 'blue_dark',
31
+ submitButtonColor = 'red',
32
+ textColor = 'white',
33
+ mbshipID = null,
34
+ otherAmountText = 'will help us fund amazing projects in the UK and around the world.',
35
+ subtitle = '',
36
+ noMoneyBuys = false,
37
+ PopUpText = 'Help us deliver long-term impact by converting your single donation into a monthly gift.',
38
+ chooseAmountText = '',
39
+ isDesktopOverride = null,
40
+ otherAmountValue = null,
41
+ title = null,
42
+ additionalSingleCopy = null,
43
+ additionalMonthlyCopy = null,
44
+ defaultGivingType = null,
45
+ monthlyTitle = '',
46
+ monthlySubtitle = '',
20
47
  cartID,
21
48
  clientID,
22
- desktopOverlayColor,
23
- mobileBackgroundColor,
24
- submitButtonColor,
25
- textColor,
49
+ paddingOption = null,
26
50
  donateLink,
27
- data,
28
- title,
29
- subtitle,
30
- otherAmountText,
31
- formAlignRight,
32
- images,
33
- image,
34
- imageLow,
35
- mobileImages,
36
- mobileImage,
37
- mobileImageLow,
38
- mobileAlt,
39
- mbshipID,
40
- noMoneyBuys,
41
- PopUpText,
42
- chooseAmountText,
43
- isDesktopOverride,
44
- otherAmountValue,
45
- additionalSingleCopy,
46
- additionalMonthlyCopy,
47
- defaultGivingType,
48
- monthlyTitle,
49
- monthlySubtitle,
50
- paddingOption,
51
- // Just to keep the function call character length under control
52
- monthlyChooseAmountText: monthlyChoose,
53
- monthlyOtherAmountText: monthlyOther
51
+ monthlyChooseAmountText: monthlyChoose = '',
52
+ monthlyOtherAmountText: monthlyOther = ''
54
53
  } = _ref;
55
54
  let isDesktop = (0, _reactResponsive.useMediaQuery)({
56
55
  query: "(min-width: ".concat(_allBreakpoints.breakpointValues.L, "px)")
@@ -141,37 +140,4 @@ const Donate = _ref => {
141
140
  changeGivingType: setGivingType
142
141
  })));
143
142
  };
144
- Donate.defaultProps = {
145
- alt: '',
146
- data: {},
147
- formAlignRight: true,
148
- imageLow: null,
149
- image: null,
150
- images: null,
151
- mobileImageLow: null,
152
- mobileImage: null,
153
- mobileImages: null,
154
- mobileAlt: '',
155
- desktopOverlayColor: 'transparent',
156
- mobileBackgroundColor: 'blue_dark',
157
- submitButtonColor: 'red',
158
- textColor: 'white',
159
- mbshipID: null,
160
- otherAmountText: 'will help us fund amazing projects in the UK and around the world.',
161
- subtitle: '',
162
- noMoneyBuys: false,
163
- PopUpText: 'Help us deliver long-term impact by converting your single donation into a monthly gift.',
164
- chooseAmountText: '',
165
- isDesktopOverride: null,
166
- otherAmountValue: null,
167
- title: null,
168
- additionalSingleCopy: null,
169
- additionalMonthlyCopy: null,
170
- defaultGivingType: null,
171
- monthlyTitle: '',
172
- monthlySubtitle: '',
173
- monthlyChooseAmountText: '',
174
- monthlyOtherAmountText: '',
175
- paddingOption: null
176
- };
177
143
  var _default = exports.default = Donate;
@@ -24,18 +24,16 @@ const Signup = _ref => {
24
24
  clientID,
25
25
  cartID,
26
26
  mbshipID,
27
- noMoneyBuys,
27
+ noMoneyBuys = false,
28
28
  PopUpText,
29
29
  chooseAmountText,
30
30
  submitButtonColor,
31
- otherAmountValue,
32
- additionalSingleCopy,
33
- additionalMonthlyCopy,
34
- defaultGivingType,
35
- monthlyChooseAmountCopy,
36
- monthlyOtherAmountCopy,
31
+ otherAmountValue = null,
32
+ additionalSingleCopy = null,
33
+ additionalMonthlyCopy = null,
34
+ defaultGivingType = null,
37
35
  changeGivingType,
38
- givingType,
36
+ givingType = null,
39
37
  ...rest
40
38
  } = _ref;
41
39
  // const [givingType, setGivingType] = useState();
@@ -228,15 +226,4 @@ const Signup = _ref => {
228
226
  ref: buttonRef
229
227
  }, renderButtonText()))));
230
228
  };
231
- Signup.defaultProps = {
232
- noMoneyBuys: false,
233
- otherAmountValue: null,
234
- data: {},
235
- additionalSingleCopy: null,
236
- additionalMonthlyCopy: null,
237
- defaultGivingType: null,
238
- monthlyChooseAmountCopy: null,
239
- monthlyOtherAmountCopy: null,
240
- givingType: null
241
- };
242
229
  var _default = exports.default = Signup;
@@ -9,7 +9,7 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _GivingSelector = require("./GivingSelector.style");
10
10
  const GivingSelector = _ref => {
11
11
  let {
12
- givingType,
12
+ givingType = null,
13
13
  changeGivingType,
14
14
  setPopOpen,
15
15
  mbshipID
@@ -47,7 +47,4 @@ const GivingSelector = _ref => {
47
47
  htmlFor: "give-monthly--".concat(mbshipID)
48
48
  }, "Monthly"), /*#__PURE__*/_react.default.createElement(_GivingSelector.Switch, null)));
49
49
  };
50
- GivingSelector.defaultProps = {
51
- givingType: null
52
- };
53
50
  var _default = exports.default = GivingSelector;
@@ -67,9 +67,9 @@ const MoneyBuyButton = (0, _styledComponents.default)(_Input.default).withConfig
67
67
  const MoneyBuy = _ref11 => {
68
68
  let {
69
69
  setOtherAmount,
70
- amount,
71
- currency,
72
- description,
70
+ amount = '10',
71
+ currency = '£',
72
+ description = 'description',
73
73
  ...rest
74
74
  } = _ref11;
75
75
  return /*#__PURE__*/_react.default.createElement(MoneyBuyButton, Object.assign({}, rest, {
@@ -81,9 +81,4 @@ const MoneyBuy = _ref11 => {
81
81
  onClick: setOtherAmount
82
82
  }));
83
83
  };
84
- MoneyBuy.defaultProps = {
85
- amount: '10',
86
- currency: '£',
87
- description: 'description'
88
- };
89
84
  var _default = exports.default = MoneyBuy;
@@ -30,10 +30,10 @@ const EmailSignUp = _ref => {
30
30
  topCopy,
31
31
  successCopy,
32
32
  privacyCopy,
33
- backgroundColour,
34
- buttonColour,
33
+ backgroundColour = 'deep_violet_dark',
34
+ buttonColour = 'red',
35
35
  formContext,
36
- columnLayout,
36
+ columnLayout = false,
37
37
  ...rest
38
38
  } = _ref;
39
39
  const {
@@ -88,9 +88,4 @@ const EmailSignUp = _ref => {
88
88
  "data-test": "subscribe-button"
89
89
  }, /*#__PURE__*/_react.default.createElement(_Text.default, null, "Subscribe")))), isSubmitted && !isSubmitSuccessful && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, errors.formError !== undefined && /*#__PURE__*/_react.default.createElement(_ErrorText.default, null, errors.formError.message)), /*#__PURE__*/_react.default.createElement(_EmailSignUp.PrivacyCopyWrapper, null, /*#__PURE__*/_react.default.createElement(_Text.default, null, privacyCopy)));
90
90
  };
91
- exports.EmailSignUp = EmailSignUp;
92
- EmailSignUp.defaultProps = {
93
- backgroundColour: 'deep_violet_dark',
94
- buttonColour: 'red',
95
- columnLayout: false
96
- };
91
+ exports.EmailSignUp = EmailSignUp;
@@ -13,9 +13,9 @@ const TextInput = _ref => {
13
13
  let {
14
14
  fieldName,
15
15
  label,
16
- optional,
17
- fieldType,
18
- formContext,
16
+ optional = null,
17
+ fieldType = 'text',
18
+ formContext = null,
19
19
  ...rest
20
20
  } = _ref;
21
21
  const {
@@ -36,9 +36,4 @@ const TextInput = _ref => {
36
36
  };
37
37
  return /*#__PURE__*/_react.default.createElement(_Input.default, Object.assign({}, props, register(fieldName)));
38
38
  };
39
- TextInput.defaultProps = {
40
- optional: null,
41
- fieldType: 'text',
42
- formContext: null
43
- };
44
39
  var _default = exports.default = TextInput;
@@ -13,15 +13,17 @@ var _SocialIcons = _interopRequireDefault(require("../../Atoms/SocialIcons/Socia
13
13
  var _Footer = require("./Footer.style");
14
14
  const Footer = _ref => {
15
15
  let {
16
- navItems,
17
- footerCopy,
18
- campaign,
19
- additionalLegalLine,
16
+ navItems = {},
17
+ footerCopy = '',
18
+ campaign = 'Comic Relief',
19
+ additionalLegalLine = '',
20
+ overrideallowList = false,
20
21
  ...rest
21
22
  } = _ref;
22
23
  // Remove white space between words
23
24
  const campaignName = campaign.replace(/\s/g, '').toLowerCase();
24
25
  return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Footer.FooterWrapper, Object.assign({
26
+ overrideallowList: overrideallowList,
25
27
  navItems: true
26
28
  }, rest), /*#__PURE__*/_react.default.createElement(_Footer.InnerWrapper, null, additionalLegalLine && /*#__PURE__*/_react.default.createElement(_Footer.FooterLegalLine, {
27
29
  tag: "p",
@@ -43,11 +45,4 @@ const Footer = _ref => {
43
45
  color: "grey"
44
46
  }, footerCopy)))));
45
47
  };
46
- Footer.defaultProps = {
47
- navItems: {},
48
- footerCopy: '',
49
- campaign: 'Comic Relief',
50
- overrideallowList: false,
51
- additionalLegalLine: ''
52
- };
53
48
  var _default = exports.default = Footer;
@@ -14,7 +14,7 @@ var _internalLinkHelper = require("../../../../utils/internalLinkHelper");
14
14
  var _Nav = require("./Nav.style");
15
15
  const FooterNav = _ref => {
16
16
  let {
17
- navItems,
17
+ navItems = {},
18
18
  ...rest
19
19
  } = _ref;
20
20
  const {
@@ -99,7 +99,4 @@ const FooterNav = _ref => {
99
99
  }, child.title)));
100
100
  }))))));
101
101
  };
102
- FooterNav.defaultProps = {
103
- navItems: {}
104
- };
105
102
  var _default = exports.default = FooterNav;
@@ -11,9 +11,9 @@ var _Nav = _interopRequireDefault(require("./Nav/Nav"));
11
11
  var _Header = require("./Header.style");
12
12
  const Header = _ref => {
13
13
  let {
14
- navItems,
14
+ navItems = {},
15
15
  metaIcons,
16
- campaign,
16
+ campaign = 'Comic Relief',
17
17
  ...rest
18
18
  } = _ref;
19
19
  return /*#__PURE__*/_react.default.createElement(_Header.HeaderWrapper, Object.assign({
@@ -24,8 +24,4 @@ const Header = _ref => {
24
24
  navItems: navItems
25
25
  }), /*#__PURE__*/_react.default.createElement(_Header.MetaIcons, null, metaIcons)));
26
26
  };
27
- Header.defaultProps = {
28
- navItems: {},
29
- campaign: 'Comic Relief'
30
- };
31
27
  var _default = exports.default = Header;
@@ -17,7 +17,7 @@ var _chevronDown = _interopRequireDefault(require("./chevron-down.svg"));
17
17
  var _Nav = require("./Nav.style");
18
18
  const MainNav = _ref => {
19
19
  let {
20
- navItems
20
+ navItems = {}
21
21
  } = _ref;
22
22
  const {
23
23
  menuGroups
@@ -134,7 +134,4 @@ const MainNav = _ref => {
134
134
  isExpandable: isExpandable
135
135
  }, "Open"));
136
136
  };
137
- MainNav.defaultProps = {
138
- navItems: {}
139
- };
140
137
  var _default = exports.default = MainNav;
@@ -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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@comicrelief/component-library",
3
3
  "author": "Comic Relief Engineering Team",
4
- "version": "8.1.2",
4
+ "version": "8.2.0",
5
5
  "main": "dist/index.js",
6
6
  "license": "ISC",
7
7
  "jest": {
@@ -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
- /** Buttons as span */
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