@comicrelief/component-library 6.9.1 → 6.10.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.
|
@@ -17,7 +17,7 @@ var _Picture = _interopRequireDefault(require("../../Atoms/Picture/Picture"));
|
|
|
17
17
|
|
|
18
18
|
var _spacing = _interopRequireDefault(require("../../../theme/shared/spacing"));
|
|
19
19
|
|
|
20
|
-
var _excluded = ["imageLow", "images", "image", "imageAltText", "height", "width", "children", "
|
|
20
|
+
var _excluded = ["imageLow", "images", "image", "imageAltText", "height", "width", "children", "squaredCorners"];
|
|
21
21
|
|
|
22
22
|
var Container = _styledComponents.default.div.withConfig({
|
|
23
23
|
displayName: "Box__Container",
|
|
@@ -34,7 +34,7 @@ var Image = _styledComponents.default.div.withConfig({
|
|
|
34
34
|
displayName: "Box__Image",
|
|
35
35
|
componentId: "sc-1oa7u3c-1"
|
|
36
36
|
})(["height:auto;flex-basis:calc(100% / 3);img{border-radius:", ";overflow:hidden;}"], function (props) {
|
|
37
|
-
return props.
|
|
37
|
+
return props.squaredCorners ? '0' : '1rem';
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
var Copy = _styledComponents.default.div.withConfig({
|
|
@@ -56,10 +56,10 @@ var Box = function Box(_ref5) {
|
|
|
56
56
|
height = _ref5.height,
|
|
57
57
|
width = _ref5.width,
|
|
58
58
|
children = _ref5.children,
|
|
59
|
-
|
|
59
|
+
squaredCorners = _ref5.squaredCorners,
|
|
60
60
|
rest = (0, _objectWithoutProperties2.default)(_ref5, _excluded);
|
|
61
61
|
return /*#__PURE__*/_react.default.createElement(Container, rest, imageLow ? /*#__PURE__*/_react.default.createElement(Image, {
|
|
62
|
-
|
|
62
|
+
squaredCorners: squaredCorners
|
|
63
63
|
}, /*#__PURE__*/_react.default.createElement(_Picture.default, {
|
|
64
64
|
alt: imageAltText,
|
|
65
65
|
imageLow: imageLow,
|
|
@@ -67,7 +67,7 @@ var Box = function Box(_ref5) {
|
|
|
67
67
|
image: image,
|
|
68
68
|
width: width,
|
|
69
69
|
height: "auto",
|
|
70
|
-
|
|
70
|
+
squaredCorners: squaredCorners
|
|
71
71
|
})) : null, children ? /*#__PURE__*/_react.default.createElement(Copy, null, children) : null);
|
|
72
72
|
};
|
|
73
73
|
|
|
@@ -79,7 +79,7 @@ Box.defaultProps = {
|
|
|
79
79
|
imageAltText: '',
|
|
80
80
|
width: '100%',
|
|
81
81
|
height: '100%',
|
|
82
|
-
|
|
82
|
+
squaredCorners: false
|
|
83
83
|
};
|
|
84
84
|
var _default = Box;
|
|
85
85
|
exports.default = _default;
|
|
@@ -17,13 +17,13 @@ var _Picture = _interopRequireDefault(require("../../Atoms/Picture/Picture"));
|
|
|
17
17
|
|
|
18
18
|
var _spacing = _interopRequireDefault(require("../../../theme/shared/spacing"));
|
|
19
19
|
|
|
20
|
-
var _excluded = ["backgroundColor", "imageLow", "images", "image", "imageAltText", "height", "width", "children", "
|
|
20
|
+
var _excluded = ["backgroundColor", "imageLow", "images", "image", "imageAltText", "height", "width", "children", "squaredCorners"];
|
|
21
21
|
|
|
22
22
|
var Container = _styledComponents.default.div.withConfig({
|
|
23
23
|
displayName: "Card__Container",
|
|
24
24
|
componentId: "sc-15nltsw-0"
|
|
25
25
|
})(["display:flex;position:relative;flex-direction:column;height:100%;border-radius:", ";overflow:hidden;background:", ";"], function (props) {
|
|
26
|
-
return props.
|
|
26
|
+
return props.squaredCorners ? '0' : '1rem';
|
|
27
27
|
}, function (_ref) {
|
|
28
28
|
var theme = _ref.theme,
|
|
29
29
|
backgroundColor = _ref.backgroundColor;
|
|
@@ -49,11 +49,11 @@ var Card = function Card(_ref2) {
|
|
|
49
49
|
height = _ref2.height,
|
|
50
50
|
width = _ref2.width,
|
|
51
51
|
children = _ref2.children,
|
|
52
|
-
|
|
52
|
+
squaredCorners = _ref2.squaredCorners,
|
|
53
53
|
rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
|
|
54
54
|
return /*#__PURE__*/_react.default.createElement(Container, Object.assign({
|
|
55
55
|
backgroundColor: backgroundColor,
|
|
56
|
-
|
|
56
|
+
squaredCorners: squaredCorners
|
|
57
57
|
}, rest), imageLow ? /*#__PURE__*/_react.default.createElement(Image, null, /*#__PURE__*/_react.default.createElement(_Picture.default, {
|
|
58
58
|
alt: imageAltText,
|
|
59
59
|
imageLow: imageLow,
|
|
@@ -74,7 +74,7 @@ Card.defaultProps = {
|
|
|
74
74
|
imageAltText: '',
|
|
75
75
|
width: '100%',
|
|
76
76
|
height: '100%',
|
|
77
|
-
|
|
77
|
+
squaredCorners: false
|
|
78
78
|
};
|
|
79
79
|
var _default = Card;
|
|
80
80
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -22,7 +22,7 @@ const Image = styled.div`
|
|
|
22
22
|
height: auto;
|
|
23
23
|
flex-basis: calc(100% / 3);
|
|
24
24
|
img {
|
|
25
|
-
border-radius: ${props => (props.
|
|
25
|
+
border-radius: ${props => (props.squaredCorners ? '0' : '1rem')};
|
|
26
26
|
overflow: hidden;
|
|
27
27
|
}
|
|
28
28
|
`;
|
|
@@ -51,12 +51,12 @@ const Box = ({
|
|
|
51
51
|
height,
|
|
52
52
|
width,
|
|
53
53
|
children,
|
|
54
|
-
|
|
54
|
+
squaredCorners,
|
|
55
55
|
...rest
|
|
56
56
|
}) => (
|
|
57
57
|
<Container {...rest}>
|
|
58
58
|
{imageLow ? (
|
|
59
|
-
<Image
|
|
59
|
+
<Image squaredCorners={squaredCorners}>
|
|
60
60
|
<Picture
|
|
61
61
|
alt={imageAltText}
|
|
62
62
|
imageLow={imageLow}
|
|
@@ -64,7 +64,7 @@ const Box = ({
|
|
|
64
64
|
image={image}
|
|
65
65
|
width={width}
|
|
66
66
|
height="auto"
|
|
67
|
-
|
|
67
|
+
squaredCorners={squaredCorners}
|
|
68
68
|
/>
|
|
69
69
|
</Image>
|
|
70
70
|
) : null}
|
|
@@ -80,7 +80,7 @@ Box.propTypes = {
|
|
|
80
80
|
height: PropTypes.string,
|
|
81
81
|
imageAltText: PropTypes.string,
|
|
82
82
|
children: PropTypes.node,
|
|
83
|
-
|
|
83
|
+
squaredCorners: PropTypes.bool
|
|
84
84
|
};
|
|
85
85
|
|
|
86
86
|
Box.defaultProps = {
|
|
@@ -91,7 +91,7 @@ Box.defaultProps = {
|
|
|
91
91
|
imageAltText: '',
|
|
92
92
|
width: '100%',
|
|
93
93
|
height: '100%',
|
|
94
|
-
|
|
94
|
+
squaredCorners: false
|
|
95
95
|
};
|
|
96
96
|
|
|
97
97
|
export default Box;
|
|
@@ -9,7 +9,7 @@ const Container = styled.div`
|
|
|
9
9
|
position: relative;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
height: 100%;
|
|
12
|
-
border-radius: ${props => (props.
|
|
12
|
+
border-radius: ${props => (props.squaredCorners ? '0' : '1rem')};
|
|
13
13
|
overflow: hidden;
|
|
14
14
|
background: ${({ theme, backgroundColor }) => theme.color(backgroundColor)};
|
|
15
15
|
`;
|
|
@@ -33,10 +33,10 @@ const Card = ({
|
|
|
33
33
|
height,
|
|
34
34
|
width,
|
|
35
35
|
children,
|
|
36
|
-
|
|
36
|
+
squaredCorners,
|
|
37
37
|
...rest
|
|
38
38
|
}) => (
|
|
39
|
-
<Container backgroundColor={backgroundColor}
|
|
39
|
+
<Container backgroundColor={backgroundColor} squaredCorners={squaredCorners} {...rest}>
|
|
40
40
|
{imageLow ? (
|
|
41
41
|
<Image>
|
|
42
42
|
<Picture
|
|
@@ -63,7 +63,7 @@ Card.propTypes = {
|
|
|
63
63
|
height: PropTypes.string,
|
|
64
64
|
imageAltText: PropTypes.string,
|
|
65
65
|
children: PropTypes.node,
|
|
66
|
-
|
|
66
|
+
squaredCorners: PropTypes.bool
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
Card.defaultProps = {
|
|
@@ -75,7 +75,7 @@ Card.defaultProps = {
|
|
|
75
75
|
imageAltText: '',
|
|
76
76
|
width: '100%',
|
|
77
77
|
height: '100%',
|
|
78
|
-
|
|
78
|
+
squaredCorners: false
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
export default Card;
|