@comicrelief/component-library 7.23.0 → 7.23.1

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.
@@ -19,7 +19,7 @@ var MoneybuyWrapper = exports.MoneybuyWrapper = _styledComponents.default.div.wi
19
19
  var Moneybuy = exports.Moneybuy = _styledComponents.default.div.withConfig({
20
20
  displayName: "ImpactMoneybuysstyle__Moneybuy",
21
21
  componentId: "sc-1lsmpzi-1"
22
- })(["display:inherit;width:100%;padding:8px 20px;height:auto;background-color:white;border-radius:10px;border:1px solid ", ";;position:relative;flex-direction:row;align-items:center;justify-content:flex-start;opacity:1;", " @media ", "{width:70%;padding:8px 40px;}@media ", "{padding:20px 14px;flex-direction:column;width:18%;max-height:none;}"], function (props) {
22
+ })(["display:inherit;width:100%;padding:8px 20px;height:auto;background-color:white;border-radius:10px;border:1px solid ", ";position:relative;flex-direction:row;align-items:center;justify-content:flex-start;opacity:1;", " @media ", "{width:70%;padding:8px 40px;}@media ", "{padding:20px 14px;flex-direction:column;width:18%;max-height:none;}"], function (props) {
23
23
  return props.theme.color('black');
24
24
  }, function (props) {
25
25
  return props.isInactive && (0, _styledComponents.css)(["opacity:0.5;"]);
@@ -22,6 +22,7 @@ var ImpactSlider = function ImpactSlider(_ref) {
22
22
  items = _ref.items,
23
23
  step = _ref.step,
24
24
  max = _ref.max,
25
+ backgroundColour = _ref.backgroundColour,
25
26
  opacityAnimation = _ref.opacityAnimation,
26
27
  children = _ref.children,
27
28
  defaultSliderValue = _ref.defaultSliderValue;
@@ -39,7 +40,9 @@ var ImpactSlider = function ImpactSlider(_ref) {
39
40
  var handleSubmit = function handleSubmit() {
40
41
  (0, _utils.default)(currentAmount, donateLink, cartID, rowID);
41
42
  };
42
- return /*#__PURE__*/_react.default.createElement(_ImpactSlider.OuterWrapper, null, /*#__PURE__*/_react.default.createElement(_ImpactSlider.InnerWrapper, null, /*#__PURE__*/_react.default.createElement(_Text.default, {
43
+ return /*#__PURE__*/_react.default.createElement(_ImpactSlider.OuterWrapper, {
44
+ backgroundColour: backgroundColour
45
+ }, /*#__PURE__*/_react.default.createElement(_ImpactSlider.InnerWrapper, null, /*#__PURE__*/_react.default.createElement(_Text.default, {
43
46
  tag: "h1",
44
47
  family: "Anton",
45
48
  uppercase: true,
@@ -66,6 +69,7 @@ var ImpactSlider = function ImpactSlider(_ref) {
66
69
  };
67
70
  ImpactSlider.defaultProps = {
68
71
  opacityAnimation: false,
69
- defaultSliderValue: null
72
+ defaultSliderValue: null,
73
+ backgroundColour: 'grey_extra_light'
70
74
  };
71
75
  var _default = exports.default = ImpactSlider;
@@ -34,6 +34,7 @@ import Text from '../../Atoms/Text/Text';
34
34
  step={5}
35
35
  max={100}
36
36
  defaultSliderValue={45}
37
+ backgroundColour="white"
37
38
  >
38
39
  <Text tag="p" color="black">
39
40
  Use this slider to see how your donation can make a difference to lives in the UK and around the globe this winter.
@@ -12,7 +12,7 @@ var OuterWrapper = exports.OuterWrapper = _styledComponents.default.div.withConf
12
12
  displayName: "ImpactSliderstyle__OuterWrapper",
13
13
  componentId: "sc-1fpimol-0"
14
14
  })(["position:relative;margin:0 auto;max-width:100%;background-color:", ";padding:32px 16px;@media ", "{padding:50px;}@media ", "{padding:64px 0;}"], function (props) {
15
- return props.theme.color('grey_extra_light');
15
+ return props.theme.color("".concat(props.backgroundColour));
16
16
  }, function (_ref) {
17
17
  var theme = _ref.theme;
18
18
  return theme.breakpoint('small');
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": "7.23.0",
4
+ "version": "7.23.1",
5
5
  "main": "dist/index.js",
6
6
  "license": "ISC",
7
7
  "jest": {
@@ -23,7 +23,7 @@ const Moneybuy = styled.div`
23
23
  height: auto;
24
24
  background-color: white;
25
25
  border-radius: 10px;
26
- border: 1px solid ${props => props.theme.color('black')};;
26
+ border: 1px solid ${props => props.theme.color('black')};
27
27
  position: relative;
28
28
  flex-direction: row;
29
29
  align-items: center;
@@ -10,8 +10,8 @@ import {
10
10
  } from './ImpactSlider.style';
11
11
 
12
12
  const ImpactSlider = ({
13
- heading, cartID, donateLink, rowID, items, step,
14
- max, opacityAnimation, children, defaultSliderValue
13
+ heading, cartID, donateLink, rowID, items, step, max,
14
+ backgroundColour, opacityAnimation, children, defaultSliderValue
15
15
  }) => {
16
16
  // Use the lowest possible amount as our default:
17
17
  const [currentAmount, setCurrentAmount] = useState(defaultSliderValue || step);
@@ -28,7 +28,7 @@ const ImpactSlider = ({
28
28
  };
29
29
 
30
30
  return (
31
- <OuterWrapper>
31
+ <OuterWrapper backgroundColour={backgroundColour}>
32
32
  <InnerWrapper>
33
33
  <Text tag="h1" family="Anton" uppercase weight="normal" size="xl">{heading}</Text>
34
34
  <Copy>
@@ -67,7 +67,8 @@ const ImpactSlider = ({
67
67
 
68
68
  ImpactSlider.defaultProps = {
69
69
  opacityAnimation: false,
70
- defaultSliderValue: null
70
+ defaultSliderValue: null,
71
+ backgroundColour: 'grey_extra_light'
71
72
  };
72
73
 
73
74
  ImpactSlider.propTypes = {
@@ -80,6 +81,7 @@ ImpactSlider.propTypes = {
80
81
  max: PropTypes.number.isRequired,
81
82
  defaultSliderValue: PropTypes.number,
82
83
  opacityAnimation: PropTypes.bool,
84
+ backgroundColour: PropTypes.string,
83
85
  items: PropTypes.arrayOf(
84
86
  PropTypes.shape({
85
87
  poundsPerItem: PropTypes.number.isRequired,
@@ -34,6 +34,7 @@ import Text from '../../Atoms/Text/Text';
34
34
  step={5}
35
35
  max={100}
36
36
  defaultSliderValue={45}
37
+ backgroundColour="white"
37
38
  >
38
39
  <Text tag="p" color="black">
39
40
  Use this slider to see how your donation can make a difference to lives in the UK and around the globe this winter.
@@ -6,7 +6,7 @@ const OuterWrapper = styled.div`
6
6
  position: relative;
7
7
  margin: 0 auto;
8
8
  max-width: 100%;
9
- background-color: ${props => props.theme.color('grey_extra_light')};
9
+ background-color: ${props => props.theme.color(`${props.backgroundColour}`)};
10
10
  padding: 32px 16px;
11
11
 
12
12
  @media ${({ theme }) => theme.breakpoint('small')} {