@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.
- package/dist/components/Molecules/Accordion/Accordion.js +6 -3
- package/dist/components/Molecules/SingleMessage/SingleMessage.js +2 -2
- package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.md +3 -1
- package/dist/components/Molecules/VideoBanner/VideoBanner.md +1 -1
- package/dist/components/Organisms/Donate/Form/PopUpComponent.js +7 -3
- package/dist/components/Organisms/Header/Header.style.js +2 -5
- package/package.json +1 -1
- package/src/components/Molecules/Accordion/Accordion.js +3 -3
- package/src/components/Molecules/SingleMessage/SingleMessage.js +2 -2
- package/src/components/Molecules/SingleMessageDS/SingleMessageDs.md +3 -1
- package/src/components/Molecules/VideoBanner/VideoBanner.md +1 -1
- package/src/components/Organisms/Donate/Form/PopUpComponent.js +3 -3
- package/src/components/Organisms/Header/Header.style.js +1 -1
|
@@ -33,12 +33,14 @@ var Container = _styledComponents.default.div.withConfig({
|
|
|
33
33
|
return theme.color('white');
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
var
|
|
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:", " ", ";}"],
|
|
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
|
-
|
|
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
|
-
|
|
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
|
+
```
|
|
@@ -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;}"],
|
|
34
|
-
return props.
|
|
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:
|
|
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.
|
|
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
|
@@ -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
|
|
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: ${
|
|
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,
|
|
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
|
-
|
|
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
|
+
```
|
|
@@ -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>
|