@comicrelief/component-library 7.45.0 → 7.46.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.
- package/dist/components/Atoms/Picture/Picture.js +2 -2
- package/dist/components/Molecules/Card/Card.style.js +38 -18
- package/dist/components/Molecules/Card/__snapshots__/Card.test.js.snap +9 -0
- package/package.json +1 -1
- package/src/components/Atoms/Picture/Picture.js +2 -2
- package/src/components/Molecules/Card/Card.style.js +7 -5
- package/src/components/Molecules/Card/__snapshots__/Card.test.js.snap +9 -0
|
@@ -41,7 +41,7 @@ const Image = _styledComponents.default.img.withConfig({
|
|
|
41
41
|
let {
|
|
42
42
|
smallBreakpointRowLayout
|
|
43
43
|
} = _ref4;
|
|
44
|
-
return smallBreakpointRowLayout === true && (0, _styledComponents.css)(["@media ", "{border-radius:", ";width:80px;height:80px;}@media ", "{padding:none;border-radius:
|
|
44
|
+
return smallBreakpointRowLayout === true && (0, _styledComponents.css)(["@media ", "{border-radius:", ";width:80px;height:80px;}@media ", "{padding:none;border-radius:0;width:", ";height:", ";}"], _ref5 => {
|
|
45
45
|
let {
|
|
46
46
|
theme
|
|
47
47
|
} = _ref5;
|
|
@@ -67,7 +67,7 @@ const Image = _styledComponents.default.img.withConfig({
|
|
|
67
67
|
smallBreakpointRowLayout,
|
|
68
68
|
mediumBreakpointRowLayout
|
|
69
69
|
} = _ref9;
|
|
70
|
-
return (smallBreakpointRowLayout === true || mediumBreakpointRowLayout === true) && (0, _styledComponents.css)(["@media ", "{padding:none;border-radius:
|
|
70
|
+
return (smallBreakpointRowLayout === true || mediumBreakpointRowLayout === true) && (0, _styledComponents.css)(["@media ", "{padding:none;border-radius:0;width:", ";height:", ";}"], _ref10 => {
|
|
71
71
|
let {
|
|
72
72
|
theme
|
|
73
73
|
} = _ref10;
|
|
@@ -11,26 +11,46 @@ var _spacing = _interopRequireDefault(require("../../../theme/shared/spacing"));
|
|
|
11
11
|
const Container = exports.Container = _styledComponents.default.div.withConfig({
|
|
12
12
|
displayName: "Cardstyle__Container",
|
|
13
13
|
componentId: "sc-cxn4co-0"
|
|
14
|
-
})(["position:relative;display:flex;@media ", "{flex-direction:", ";gap:", ";}@media ", "{flex-direction:", ";gap:", ";}@media ", "{flex-direction:column;
|
|
14
|
+
})(["position:relative;display:flex;height:100%;border-radius:", ";overflow:hidden;background:", ";@media ", "{flex-direction:", ";gap:", ";background:", ";}@media ", "{flex-direction:", ";gap:", ";background:", ";}@media ", "{flex-direction:column;background:", ";}"], props => props.squaredCorners ? '0' : '0.8rem', _ref => {
|
|
15
15
|
let {
|
|
16
|
-
theme
|
|
16
|
+
theme,
|
|
17
|
+
backgroundColor
|
|
17
18
|
} = _ref;
|
|
18
|
-
return theme.
|
|
19
|
-
},
|
|
19
|
+
return theme.color(backgroundColor);
|
|
20
|
+
}, _ref2 => {
|
|
20
21
|
let {
|
|
21
22
|
theme
|
|
22
23
|
} = _ref2;
|
|
24
|
+
return theme.allBreakpoints('S');
|
|
25
|
+
}, props => props.smallBreakpointRowLayout === true ? 'row' : 'column', (0, _spacing.default)('md'), _ref3 => {
|
|
26
|
+
let {
|
|
27
|
+
theme,
|
|
28
|
+
backgroundColor,
|
|
29
|
+
smallBreakpointRowLayout
|
|
30
|
+
} = _ref3;
|
|
31
|
+
return smallBreakpointRowLayout === true ? 'transparent' : theme.color(backgroundColor);
|
|
32
|
+
}, _ref4 => {
|
|
33
|
+
let {
|
|
34
|
+
theme
|
|
35
|
+
} = _ref4;
|
|
23
36
|
return theme.allBreakpoints('M');
|
|
24
|
-
}, props => props.mediumBreakpointRowLayout === true ? 'row' : 'column', (0, _spacing.default)('md'),
|
|
37
|
+
}, props => props.mediumBreakpointRowLayout === true ? 'row' : 'column', (0, _spacing.default)('md'), _ref5 => {
|
|
38
|
+
let {
|
|
39
|
+
theme,
|
|
40
|
+
backgroundColor,
|
|
41
|
+
mediumBreakpointRowLayout
|
|
42
|
+
} = _ref5;
|
|
43
|
+
return mediumBreakpointRowLayout === true ? 'transparent' : theme.color(backgroundColor);
|
|
44
|
+
}, _ref6 => {
|
|
25
45
|
let {
|
|
26
46
|
theme
|
|
27
|
-
} =
|
|
47
|
+
} = _ref6;
|
|
28
48
|
return theme.allBreakpoints('L');
|
|
29
|
-
},
|
|
49
|
+
}, _ref7 => {
|
|
30
50
|
let {
|
|
31
51
|
theme,
|
|
32
52
|
backgroundColor
|
|
33
|
-
} =
|
|
53
|
+
} = _ref7;
|
|
34
54
|
return theme.color(backgroundColor);
|
|
35
55
|
});
|
|
36
56
|
const Wrapper = exports.Wrapper = _styledComponents.default.div.withConfig({
|
|
@@ -40,29 +60,29 @@ const Wrapper = exports.Wrapper = _styledComponents.default.div.withConfig({
|
|
|
40
60
|
const Copy = exports.Copy = _styledComponents.default.div.withConfig({
|
|
41
61
|
displayName: "Cardstyle__Copy",
|
|
42
62
|
componentId: "sc-cxn4co-2"
|
|
43
|
-
})(["display:flex;flex-direction:column;padding:", ";", " ", " @media ", "{padding:", ";h1{font-size:2rem;}}"], (0, _spacing.default)('l'),
|
|
63
|
+
})(["display:flex;flex-direction:column;padding:", ";", " ", " @media ", "{padding:", ";h1{font-size:2rem;}}"], (0, _spacing.default)('l'), _ref8 => {
|
|
44
64
|
let {
|
|
45
65
|
smallBreakpointRowLayout
|
|
46
|
-
} =
|
|
47
|
-
return smallBreakpointRowLayout === true && (0, _styledComponents.css)(["@media ", "{padding:", ";h1{margin:", ";font-size:", ";}}"],
|
|
66
|
+
} = _ref8;
|
|
67
|
+
return smallBreakpointRowLayout === true && (0, _styledComponents.css)(["@media ", "{padding:", ";h1{margin:", ";font-size:", ";}}"], _ref9 => {
|
|
48
68
|
let {
|
|
49
69
|
theme
|
|
50
|
-
} =
|
|
70
|
+
} = _ref9;
|
|
51
71
|
return theme.allBreakpoints('S');
|
|
52
72
|
}, props => props.smallBreakpointRowLayout === true ? "".concat((0, _spacing.default)('sm')) : "".concat((0, _spacing.default)('l')), props => props.smallBreakpointRowLayout === true && "0 0 ".concat((0, _spacing.default)('sm')), props => props.smallBreakpointRowLayout === true ? '1.5rem' : '2rem');
|
|
53
|
-
},
|
|
73
|
+
}, _ref10 => {
|
|
54
74
|
let {
|
|
55
75
|
mediumBreakpointRowLayout
|
|
56
|
-
} =
|
|
57
|
-
return mediumBreakpointRowLayout === true && (0, _styledComponents.css)(["@media ", "{padding:", ";h1{margin:", ";font-size:", ";}}"],
|
|
76
|
+
} = _ref10;
|
|
77
|
+
return mediumBreakpointRowLayout === true && (0, _styledComponents.css)(["@media ", "{padding:", ";h1{margin:", ";font-size:", ";}}"], _ref11 => {
|
|
58
78
|
let {
|
|
59
79
|
theme
|
|
60
|
-
} =
|
|
80
|
+
} = _ref11;
|
|
61
81
|
return theme.allBreakpoints('M');
|
|
62
82
|
}, props => props.mediumBreakpointRowLayout === true ? "".concat((0, _spacing.default)('sm')) : "".concat((0, _spacing.default)('l')), props => props.mediumBreakpointRowLayout === true && "0 0 ".concat((0, _spacing.default)('sm')), props => props.mediumBreakpointRowLayout === true ? '1.5rem' : '2rem');
|
|
63
|
-
},
|
|
83
|
+
}, _ref12 => {
|
|
64
84
|
let {
|
|
65
85
|
theme
|
|
66
|
-
} =
|
|
86
|
+
} = _ref12;
|
|
67
87
|
return theme.allBreakpoints('L');
|
|
68
88
|
}, (0, _spacing.default)('l'));
|
|
@@ -30,6 +30,7 @@ exports[`renders correctly 1`] = `
|
|
|
30
30
|
-ms-flex-direction: column;
|
|
31
31
|
flex-direction: column;
|
|
32
32
|
gap: 1rem;
|
|
33
|
+
background: #FFE400;
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
|
|
@@ -39,6 +40,7 @@ exports[`renders correctly 1`] = `
|
|
|
39
40
|
-ms-flex-direction: column;
|
|
40
41
|
flex-direction: column;
|
|
41
42
|
gap: 1rem;
|
|
43
|
+
background: #FFE400;
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
46
|
|
|
@@ -47,6 +49,7 @@ exports[`renders correctly 1`] = `
|
|
|
47
49
|
-webkit-flex-direction: column;
|
|
48
50
|
-ms-flex-direction: column;
|
|
49
51
|
flex-direction: column;
|
|
52
|
+
background: #FFE400;
|
|
50
53
|
}
|
|
51
54
|
}
|
|
52
55
|
|
|
@@ -106,6 +109,7 @@ exports[`renders correctly 2`] = `
|
|
|
106
109
|
-ms-flex-direction: column;
|
|
107
110
|
flex-direction: column;
|
|
108
111
|
gap: 1rem;
|
|
112
|
+
background: #FFE400;
|
|
109
113
|
}
|
|
110
114
|
}
|
|
111
115
|
|
|
@@ -115,6 +119,7 @@ exports[`renders correctly 2`] = `
|
|
|
115
119
|
-ms-flex-direction: column;
|
|
116
120
|
flex-direction: column;
|
|
117
121
|
gap: 1rem;
|
|
122
|
+
background: #FFE400;
|
|
118
123
|
}
|
|
119
124
|
}
|
|
120
125
|
|
|
@@ -123,6 +128,7 @@ exports[`renders correctly 2`] = `
|
|
|
123
128
|
-webkit-flex-direction: column;
|
|
124
129
|
-ms-flex-direction: column;
|
|
125
130
|
flex-direction: column;
|
|
131
|
+
background: #FFE400;
|
|
126
132
|
}
|
|
127
133
|
}
|
|
128
134
|
|
|
@@ -189,6 +195,7 @@ exports[`renders correctly with no body 1`] = `
|
|
|
189
195
|
-ms-flex-direction: column;
|
|
190
196
|
flex-direction: column;
|
|
191
197
|
gap: 1rem;
|
|
198
|
+
background: #FFE400;
|
|
192
199
|
}
|
|
193
200
|
}
|
|
194
201
|
|
|
@@ -198,6 +205,7 @@ exports[`renders correctly with no body 1`] = `
|
|
|
198
205
|
-ms-flex-direction: column;
|
|
199
206
|
flex-direction: column;
|
|
200
207
|
gap: 1rem;
|
|
208
|
+
background: #FFE400;
|
|
201
209
|
}
|
|
202
210
|
}
|
|
203
211
|
|
|
@@ -206,6 +214,7 @@ exports[`renders correctly with no body 1`] = `
|
|
|
206
214
|
-webkit-flex-direction: column;
|
|
207
215
|
-ms-flex-direction: column;
|
|
208
216
|
flex-direction: column;
|
|
217
|
+
background: #FFE400;
|
|
209
218
|
}
|
|
210
219
|
}
|
|
211
220
|
|
package/package.json
CHANGED
|
@@ -36,7 +36,7 @@ const Image = styled.img`
|
|
|
36
36
|
}
|
|
37
37
|
@media ${({ theme }) => theme.allBreakpoints('M')} {
|
|
38
38
|
padding: none;
|
|
39
|
-
border-radius:
|
|
39
|
+
border-radius: 0;
|
|
40
40
|
width: ${props => (props.width ? props.width : '100%')};
|
|
41
41
|
height: ${props => (props.height ? props.height : 'auto')};
|
|
42
42
|
}
|
|
@@ -55,7 +55,7 @@ const Image = styled.img`
|
|
|
55
55
|
${({ smallBreakpointRowLayout, mediumBreakpointRowLayout }) => ((smallBreakpointRowLayout === true) || (mediumBreakpointRowLayout === true)) && css`
|
|
56
56
|
@media ${({ theme }) => theme.allBreakpoints('L')} {
|
|
57
57
|
padding: none;
|
|
58
|
-
border-radius:
|
|
58
|
+
border-radius: 0;
|
|
59
59
|
width: ${props => (props.width ? props.width : '100%')};
|
|
60
60
|
height: ${props => (props.height ? props.height : 'auto')};
|
|
61
61
|
}
|
|
@@ -4,28 +4,30 @@ import spacing from '../../../theme/shared/spacing';
|
|
|
4
4
|
const Container = styled.div`
|
|
5
5
|
position: relative;
|
|
6
6
|
display: flex;
|
|
7
|
+
height: 100%;
|
|
8
|
+
border-radius: ${props => (props.squaredCorners ? '0' : '0.8rem')};
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
background: ${({ theme, backgroundColor }) => theme.color(backgroundColor)};
|
|
7
11
|
|
|
8
12
|
/* Check for Cards/smallBreakpointRowLayout prop coming from the CMS, if so make horizontal layout */
|
|
9
13
|
@media ${({ theme }) => theme.allBreakpoints('S')} {
|
|
10
14
|
flex-direction: ${props => ((props.smallBreakpointRowLayout === true) ? 'row' : 'column')};
|
|
11
15
|
gap: ${spacing('md')};
|
|
16
|
+
background: ${({ theme, backgroundColor, smallBreakpointRowLayout }) => ((smallBreakpointRowLayout === true) ? 'transparent' : theme.color(backgroundColor))};
|
|
12
17
|
}
|
|
13
18
|
|
|
14
19
|
/* Check for Cards/mediumBreakpointRowLayout prop coming from the CMS, if so make horizontal layout */
|
|
15
20
|
@media ${({ theme }) => theme.allBreakpoints('M')} {
|
|
16
21
|
flex-direction: ${props => ((props.mediumBreakpointRowLayout === true) ? 'row' : 'column')};
|
|
17
22
|
gap: ${spacing('md')};
|
|
23
|
+
background: ${({ theme, backgroundColor, mediumBreakpointRowLayout }) => ((mediumBreakpointRowLayout === true) ? 'transparent' : theme.color(backgroundColor))};
|
|
18
24
|
}
|
|
19
25
|
|
|
20
26
|
/* Set desktop and upwards to normal vertical layout */
|
|
21
27
|
@media ${({ theme }) => theme.allBreakpoints('L')} {
|
|
22
28
|
flex-direction: column;
|
|
29
|
+
background: ${({ theme, backgroundColor }) => theme.color(backgroundColor)};
|
|
23
30
|
}
|
|
24
|
-
|
|
25
|
-
height: 100%;
|
|
26
|
-
border-radius: ${props => (props.squaredCorners ? '0' : '0.8rem')};
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
background: ${({ theme, backgroundColor }) => theme.color(backgroundColor)};
|
|
29
31
|
`;
|
|
30
32
|
|
|
31
33
|
const Wrapper = styled.div`
|
|
@@ -30,6 +30,7 @@ exports[`renders correctly 1`] = `
|
|
|
30
30
|
-ms-flex-direction: column;
|
|
31
31
|
flex-direction: column;
|
|
32
32
|
gap: 1rem;
|
|
33
|
+
background: #FFE400;
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
|
|
@@ -39,6 +40,7 @@ exports[`renders correctly 1`] = `
|
|
|
39
40
|
-ms-flex-direction: column;
|
|
40
41
|
flex-direction: column;
|
|
41
42
|
gap: 1rem;
|
|
43
|
+
background: #FFE400;
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
46
|
|
|
@@ -47,6 +49,7 @@ exports[`renders correctly 1`] = `
|
|
|
47
49
|
-webkit-flex-direction: column;
|
|
48
50
|
-ms-flex-direction: column;
|
|
49
51
|
flex-direction: column;
|
|
52
|
+
background: #FFE400;
|
|
50
53
|
}
|
|
51
54
|
}
|
|
52
55
|
|
|
@@ -106,6 +109,7 @@ exports[`renders correctly 2`] = `
|
|
|
106
109
|
-ms-flex-direction: column;
|
|
107
110
|
flex-direction: column;
|
|
108
111
|
gap: 1rem;
|
|
112
|
+
background: #FFE400;
|
|
109
113
|
}
|
|
110
114
|
}
|
|
111
115
|
|
|
@@ -115,6 +119,7 @@ exports[`renders correctly 2`] = `
|
|
|
115
119
|
-ms-flex-direction: column;
|
|
116
120
|
flex-direction: column;
|
|
117
121
|
gap: 1rem;
|
|
122
|
+
background: #FFE400;
|
|
118
123
|
}
|
|
119
124
|
}
|
|
120
125
|
|
|
@@ -123,6 +128,7 @@ exports[`renders correctly 2`] = `
|
|
|
123
128
|
-webkit-flex-direction: column;
|
|
124
129
|
-ms-flex-direction: column;
|
|
125
130
|
flex-direction: column;
|
|
131
|
+
background: #FFE400;
|
|
126
132
|
}
|
|
127
133
|
}
|
|
128
134
|
|
|
@@ -189,6 +195,7 @@ exports[`renders correctly with no body 1`] = `
|
|
|
189
195
|
-ms-flex-direction: column;
|
|
190
196
|
flex-direction: column;
|
|
191
197
|
gap: 1rem;
|
|
198
|
+
background: #FFE400;
|
|
192
199
|
}
|
|
193
200
|
}
|
|
194
201
|
|
|
@@ -198,6 +205,7 @@ exports[`renders correctly with no body 1`] = `
|
|
|
198
205
|
-ms-flex-direction: column;
|
|
199
206
|
flex-direction: column;
|
|
200
207
|
gap: 1rem;
|
|
208
|
+
background: #FFE400;
|
|
201
209
|
}
|
|
202
210
|
}
|
|
203
211
|
|
|
@@ -206,6 +214,7 @@ exports[`renders correctly with no body 1`] = `
|
|
|
206
214
|
-webkit-flex-direction: column;
|
|
207
215
|
-ms-flex-direction: column;
|
|
208
216
|
flex-direction: column;
|
|
217
|
+
background: #FFE400;
|
|
209
218
|
}
|
|
210
219
|
}
|
|
211
220
|
|