2019-07-25 15:52:30 +02:00
|
|
|
import styled, { css } from 'styled-components';
|
|
|
|
|
|
|
|
|
|
const Label = styled.label`
|
|
|
|
|
cursor: pointer;
|
2019-08-28 16:12:51 +02:00
|
|
|
position: relative;
|
2019-09-24 18:42:08 +02:00
|
|
|
vertical-align: middle;
|
2019-07-25 15:52:30 +02:00
|
|
|
> input {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
&:before {
|
|
|
|
|
content: '';
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: 15px;
|
2019-09-24 18:42:08 +02:00
|
|
|
top: calc(50% - 8px);
|
2019-07-25 15:52:30 +02:00
|
|
|
width: 14px;
|
|
|
|
|
height: 14px;
|
|
|
|
|
border: 1px solid rgba(16, 22, 34, 0.15);
|
|
|
|
|
background-color: #fdfdfd;
|
|
|
|
|
border-radius: 3px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
${({ shouldDisplaySomeChecked }) => {
|
|
|
|
|
if (shouldDisplaySomeChecked) {
|
|
|
|
|
return css`
|
|
|
|
|
&:after {
|
|
|
|
|
content: '\f068';
|
|
|
|
|
position: absolute;
|
2019-09-24 18:42:08 +02:00
|
|
|
top: calc(50% - 8px);
|
2019-07-25 15:52:30 +02:00
|
|
|
left: 18px;
|
|
|
|
|
font-size: 10px;
|
|
|
|
|
font-family: 'FontAwesome';
|
|
|
|
|
font-weight: 100;
|
|
|
|
|
color: #1c5de7;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
}
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
|
|
${({ shouldDisplayAllChecked }) => {
|
|
|
|
|
if (shouldDisplayAllChecked) {
|
|
|
|
|
return css`
|
|
|
|
|
&:after {
|
|
|
|
|
content: '\f00c';
|
|
|
|
|
position: absolute;
|
2019-08-28 16:12:51 +02:00
|
|
|
top: calc(50% - 9px);
|
2019-07-25 15:52:30 +02:00
|
|
|
left: 17px;
|
|
|
|
|
font-size: 10px;
|
|
|
|
|
font-family: 'FontAwesome';
|
|
|
|
|
font-weight: 100;
|
|
|
|
|
color: #1c5de7;
|
|
|
|
|
transition: all 0.2s;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
}
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
|
|
${({ isChecked }) => {
|
|
|
|
|
if (isChecked) {
|
|
|
|
|
return css`
|
|
|
|
|
&:after {
|
|
|
|
|
content: '\f00c';
|
|
|
|
|
position: absolute;
|
2019-08-28 16:12:51 +02:00
|
|
|
top: calc(50% - 11px);
|
2019-07-25 15:52:30 +02:00
|
|
|
left: 17px;
|
|
|
|
|
font-size: 10px;
|
|
|
|
|
font-family: 'FontAwesome';
|
|
|
|
|
font-weight: 100;
|
|
|
|
|
color: #1c5de7;
|
|
|
|
|
transition: all 0.2s;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
}
|
|
|
|
|
}}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
export { Label };
|