@comicrelief/component-library 7.12.0 → 7.12.2

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.
@@ -33,12 +33,14 @@ var Container = _styledComponents.default.div.withConfig({
33
33
  return theme.color('white');
34
34
  });
35
35
 
36
- var ChevAnima = (0, _styledComponents.keyframes)(["0%{margin-top:0rem;}50%{margin-top:0.5rem;}100%{margin-top:0rem;}"]);
36
+ var ChevronKeyframes = (0, _styledComponents.keyframes)(["0%{margin-top:0rem;}50%{margin-top:0.5rem;}100%{margin-top:0rem;}"]);
37
37
 
38
38
  var Button = _styledComponents.default.button.withConfig({
39
39
  displayName: "Accordion__Button",
40
40
  componentId: "sc-19u0s0h-1"
41
- })(["display:flex;justify-content:space-between;align-items:center;width:100%;background:none;border:none;transition:bottom 0.1s linear;cursor:pointer;&:focus,&:hover{color:inherit;outline:none;> div{animation-name:", ";animation-duration:0.4s;}}padding:", ";@media ", "{padding:", " ", ";}"], ChevAnima, (0, _spacing.default)('l'), function (_ref2) {
41
+ })(["display:flex;justify-content:space-between;align-items:center;width:100%;background:none;border:none;transition:bottom 0.1s linear;cursor:pointer;&:focus,&:hover{color:inherit;outline:none;> div{animation-name:", ";animation-duration:0.4s;}}padding:", ";@media ", "{padding:", " ", ";}"], function (props) {
42
+ return props.ChevronKeyframes;
43
+ }, (0, _spacing.default)('l'), function (_ref2) {
42
44
  var theme = _ref2.theme;
43
45
  return theme.breakpoint('small');
44
46
  }, (0, _spacing.default)('l'), (0, _spacing.default)('lg'));
@@ -78,7 +80,8 @@ var Accordion = function Accordion(_ref6) {
78
80
 
79
81
  return /*#__PURE__*/_react.default.createElement(Container, rest, /*#__PURE__*/_react.default.createElement(Button, {
80
82
  onClick: handleOpen,
81
- "aria-expanded": isOpen ? 'true' : 'false'
83
+ "aria-expanded": isOpen ? 'true' : 'false',
84
+ ChevronKeyframes: ChevronKeyframes
82
85
  }, title, /*#__PURE__*/_react.default.createElement(Icon, null, /*#__PURE__*/_react.default.createElement(_index.Chevron, {
83
86
  colour: "black",
84
87
  direction: isOpen ? 'up' : 'down'
@@ -58,7 +58,7 @@ var SingleMessage = function SingleMessage(_ref) {
58
58
  var _useState5 = (0, _react.useState)(false),
59
59
  _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
60
60
  onPlay = _useState6[0],
61
- setonPlay = _useState6[1];
61
+ setOnPlay = _useState6[1];
62
62
 
63
63
  var _useState7 = (0, _react.useState)(false),
64
64
  _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
@@ -118,7 +118,7 @@ var SingleMessage = function SingleMessage(_ref) {
118
118
  }, [hasVideo, isInitialised, uniqueID, videoID, onPlay]);
119
119
 
120
120
  var handlePlay = function handlePlay(thisUniqueID) {
121
- setonPlay(true); // Trigger play and update video state
121
+ setOnPlay(true); // Trigger play and update video state
122
122
 
123
123
  var thisVideoID = "".concat(thisUniqueID, "__video");
124
124
  setTimeout(function () {
@@ -154,6 +154,7 @@ import Download from '../../Atoms/Icons/Download';
154
154
  imageLow={defaultData.image}
155
155
  imageLeft={true}
156
156
  images={defaultData.images}
157
+ subtitle="subTitle"
157
158
  >
158
159
  <Text tag='p'>
159
160
  Whatever you’ve got planned, the Sport Relief shop has everything you need
@@ -179,10 +180,11 @@ import Download from '../../Atoms/Icons/Download';
179
180
  images={defaultData.images}
180
181
  youTubeId="faz0JeBB41M"
181
182
  imageLeft={true}
183
+ subtitle="subTitle"
182
184
  >
183
185
  <Text tag='p'>
184
186
  Some text and stuff.
185
187
  </Text>
186
188
  </SingleMessageDs>
187
189
  </div>;
188
- ```
190
+ ```
@@ -1,5 +1,5 @@
1
1
  ```js
2
- const poster = require('../../../styleguide/assets/poster.png');
2
+ import poster from '../../../styleguide/assets/poster.png';
3
3
  const src =
4
4
  'https://www.comicrelief.com/sites/default/files/downloads/Creativists_Logo_Web_small_V2_0.mp4';
5
5
 
@@ -30,8 +30,10 @@ var fadeOpen = (0, _styledComponents.keyframes)(["0%{opacity:0;max-height:0px;di
30
30
  var StyledPopUp = _styledComponents.default.div.withConfig({
31
31
  displayName: "PopUpComponent__StyledPopUp",
32
32
  componentId: "sc-1d7imlo-0"
33
- })(["display:grid;overflow:hidden;max-height:350px;opacity:1;animation:0.4s ", " ease;", " background-color:", ";box-shadow:0px 0px 16px rgba(0,0,0,0.15);border-radius:10px;", "{width:450px;margin-right:auto;margin-left:auto;}"], fadeOpen, function (props) {
34
- return props.isClosed && (0, _styledComponents.css)(["animation:", "s ", " ease forwards;"], closeDuration, fadeClose);
33
+ })(["display:grid;overflow:hidden;max-height:350px;opacity:1;animation:0.4s ", " ease;", " background-color:", ";box-shadow:0px 0px 16px rgba(0,0,0,0.15);border-radius:10px;", "{width:450px;margin-right:auto;margin-left:auto;}"], function (props) {
34
+ return props.fadeOpen;
35
+ }, function (props) {
36
+ return props.isClosed && (0, _styledComponents.css)(["animation:", "s ", " ease forwards;"], closeDuration, props.fadeClose);
35
37
  }, function (_ref) {
36
38
  var theme = _ref.theme;
37
39
  return theme.color('blue_light');
@@ -69,7 +71,9 @@ var PopUpComponent = function PopUpComponent(_ref3) {
69
71
  };
70
72
 
71
73
  return /*#__PURE__*/_react.default.createElement(StyledPopUp, {
72
- isClosed: isClosed
74
+ isClosed: isClosed,
75
+ fadeOpen: fadeOpen,
76
+ fadeClose: fadeClose
73
77
  }, /*#__PURE__*/_react.default.createElement(Button, {
74
78
  onClick: function onClick() {
75
79
  return handleCloser();
@@ -52,14 +52,11 @@ exports.Brand = Brand;
52
52
  var MetaIcons = _styledComponents.default.div.withConfig({
53
53
  displayName: "Headerstyle__MetaIcons",
54
54
  componentId: "sc-11ghppe-3"
55
- })(["width:auto;display:flex;align-items:center;> div{height:35px;width:auto;display:inline-block;> a{height:inherit;width:inherit;margin-left:", ";img{padding:5px;height:inherit;width:inherit;}}}@media ", "{position:relative;display:flex;align-items:center;background-color:", ";margin-right:0px;right:0px;}"], function (_ref4) {
55
+ })(["width:auto;display:flex;align-items:center;> div{height:35px;width:auto;display:inline-block;> a{height:inherit;width:inherit;margin-left:0.5rem;img{padding:5px;height:inherit;width:inherit;}}}@media ", "{position:relative;display:flex;align-items:center;background-color:", ";margin-right:0px;right:0px;}"], function (_ref4) {
56
56
  var theme = _ref4.theme;
57
- return theme.fontSize('xxs');
57
+ return theme.breakpoint('nav');
58
58
  }, function (_ref5) {
59
59
  var theme = _ref5.theme;
60
- return theme.breakpoint('nav');
61
- }, function (_ref6) {
62
- var theme = _ref6.theme;
63
60
  return theme.color('white');
64
61
  });
65
62
 
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.12.0",
4
+ "version": "7.12.2",
5
5
  "main": "dist/index.js",
6
6
  "license": "ISC",
7
7
  "jest": {
@@ -11,7 +11,7 @@ const Container = styled.div`
11
11
  box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.15);
12
12
  `;
13
13
 
14
- const ChevAnima = keyframes`
14
+ const ChevronKeyframes = keyframes`
15
15
  0% { margin-top: 0rem; }
16
16
  50% { margin-top: 0.5rem; }
17
17
  100% { margin-top: 0rem; }
@@ -32,7 +32,7 @@ const Button = styled.button`
32
32
  color: inherit; // text was flashing white on focus on safari without this.
33
33
  outline: none;
34
34
  > div {
35
- animation-name: ${ChevAnima};
35
+ animation-name: ${props => props.ChevronKeyframes};
36
36
  animation-duration: 0.4s;
37
37
  }
38
38
  }
@@ -82,7 +82,7 @@ const Accordion = ({
82
82
 
83
83
  return (
84
84
  <Container {...rest}>
85
- <Button onClick={handleOpen} aria-expanded={isOpen ? 'true' : 'false'}>
85
+ <Button onClick={handleOpen} aria-expanded={isOpen ? 'true' : 'false'} ChevronKeyframes={ChevronKeyframes}>
86
86
  {title}
87
87
  <Icon>
88
88
  <Chevron colour="black" direction={isOpen ? 'up' : 'down'} />
@@ -39,7 +39,7 @@ const SingleMessage = ({
39
39
  // States to track video status
40
40
  const [isInitialised, setIsInitialised] = useState(false);
41
41
  const [isPlaying, setIsPlaying] = useState(false);
42
- const [onPlay, setonPlay] = useState(false);
42
+ const [onPlay, setOnPlay] = useState(false);
43
43
  const [isBuffering, setIsBuffering] = useState(false);
44
44
  const [uniqueID, setUniqueID] = useState(null);
45
45
  const [hasParentID, setHasParentID] = useState(false);
@@ -97,7 +97,7 @@ const SingleMessage = ({
97
97
  }, [hasVideo, isInitialised, uniqueID, videoID, onPlay]);
98
98
 
99
99
  const handlePlay = thisUniqueID => {
100
- setonPlay(true);
100
+ setOnPlay(true);
101
101
  // Trigger play and update video state
102
102
  const thisVideoID = `${thisUniqueID}__video`;
103
103
 
@@ -154,6 +154,7 @@ import Download from '../../Atoms/Icons/Download';
154
154
  imageLow={defaultData.image}
155
155
  imageLeft={true}
156
156
  images={defaultData.images}
157
+ subtitle="subTitle"
157
158
  >
158
159
  <Text tag='p'>
159
160
  Whatever you’ve got planned, the Sport Relief shop has everything you need
@@ -179,10 +180,11 @@ import Download from '../../Atoms/Icons/Download';
179
180
  images={defaultData.images}
180
181
  youTubeId="faz0JeBB41M"
181
182
  imageLeft={true}
183
+ subtitle="subTitle"
182
184
  >
183
185
  <Text tag='p'>
184
186
  Some text and stuff.
185
187
  </Text>
186
188
  </SingleMessageDs>
187
189
  </div>;
188
- ```
190
+ ```
@@ -1,5 +1,5 @@
1
1
  ```js
2
- const poster = require('../../../styleguide/assets/poster.png');
2
+ import poster from '../../../styleguide/assets/poster.png';
3
3
  const src =
4
4
  'https://www.comicrelief.com/sites/default/files/downloads/Creativists_Logo_Web_small_V2_0.mp4';
5
5
 
@@ -38,9 +38,9 @@ const StyledPopUp = styled.div`
38
38
  overflow: hidden;
39
39
  max-height: 350px;
40
40
  opacity: 1;
41
- animation: 0.4s ${fadeOpen} ease;
41
+ animation: 0.4s ${props => props.fadeOpen} ease;
42
42
  ${props => props.isClosed && css`
43
- animation: ${closeDuration}s ${fadeClose} ease forwards;
43
+ animation: ${closeDuration}s ${props.fadeClose} ease forwards;
44
44
  `}
45
45
  background-color: ${({ theme }) => theme.color('blue_light')};
46
46
  box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.15);
@@ -92,7 +92,7 @@ const PopUpComponent = ({ PopUpText, setPopOpen }) => {
92
92
  };
93
93
 
94
94
  return (
95
- <StyledPopUp isClosed={isClosed}>
95
+ <StyledPopUp isClosed={isClosed} fadeOpen={fadeOpen} fadeClose={fadeClose}>
96
96
  <Button onClick={() => handleCloser()} aria-label="Close">
97
97
  <img src={CloseCross} alt="Close cross icon" />
98
98
  </Button>
@@ -62,7 +62,7 @@ const MetaIcons = styled.div`
62
62
  > a {
63
63
  height: inherit;
64
64
  width: inherit;
65
- margin-left: ${({ theme }) => theme.fontSize('xxs')};
65
+ margin-left: 0.5rem;
66
66
 
67
67
  img {
68
68
  padding: 5px;