2018-11-27 12:18:41 +03:00
|
|
|
import styled from '../styled-components';
|
2020-08-04 12:19:01 +03:00
|
|
|
import { darken } from 'polished';
|
2022-03-15 14:22:22 +03:00
|
|
|
import { deprecatedCss } from './mixins';
|
2017-10-12 00:01:37 +03:00
|
|
|
|
2020-08-04 12:19:01 +03:00
|
|
|
export const OneOfList = styled.div`
|
2018-11-27 12:35:43 +03:00
|
|
|
margin: 0 0 3px 0;
|
2017-10-12 00:01:37 +03:00
|
|
|
display: inline-block;
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const OneOfLabel = styled.span`
|
|
|
|
font-size: 0.9em;
|
|
|
|
margin-right: 10px;
|
2018-07-19 13:05:53 +03:00
|
|
|
color: ${props => props.theme.colors.primary.main};
|
2019-12-12 17:10:07 +03:00
|
|
|
font-family: ${props => props.theme.typography.headings.fontFamily};
|
2017-10-12 00:01:37 +03:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2022-03-15 14:22:22 +03:00
|
|
|
export const OneOfButton = styled.button<{ active: boolean; deprecated: boolean }>`
|
2017-10-12 00:01:37 +03:00
|
|
|
display: inline-block;
|
|
|
|
margin-right: 10px;
|
2019-10-16 17:21:32 +03:00
|
|
|
margin-bottom: 5px;
|
2017-10-12 00:01:37 +03:00
|
|
|
font-size: 0.8em;
|
|
|
|
cursor: pointer;
|
2018-07-19 13:05:53 +03:00
|
|
|
border: 1px solid ${props => props.theme.colors.primary.main};
|
2017-10-12 00:01:37 +03:00
|
|
|
padding: 2px 10px;
|
2020-08-04 12:19:01 +03:00
|
|
|
line-height: 1.5em;
|
|
|
|
outline: none;
|
|
|
|
&:focus {
|
|
|
|
box-shadow: 0 0 0 1px ${props => props.theme.colors.primary.main};
|
|
|
|
}
|
2017-10-12 00:01:37 +03:00
|
|
|
|
2022-03-15 14:22:22 +03:00
|
|
|
${({ deprecated }) => (deprecated && deprecatedCss) || ''};
|
|
|
|
|
2017-10-12 00:01:37 +03:00
|
|
|
${props => {
|
|
|
|
if (props.active) {
|
|
|
|
return `
|
|
|
|
color: white;
|
2018-07-19 13:05:53 +03:00
|
|
|
background-color: ${props.theme.colors.primary.main};
|
2020-08-04 12:19:01 +03:00
|
|
|
&:focus {
|
|
|
|
box-shadow: none;
|
|
|
|
background-color: ${darken(0.15, props.theme.colors.primary.main)};
|
|
|
|
}
|
2017-10-12 00:01:37 +03:00
|
|
|
`;
|
|
|
|
} else {
|
|
|
|
return `
|
2018-07-19 13:05:53 +03:00
|
|
|
color: ${props.theme.colors.primary.main};
|
2017-10-12 00:01:37 +03:00
|
|
|
background-color: white;
|
|
|
|
`;
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const ArrayOpenningLabel = styled.div`
|
|
|
|
font-size: 0.9em;
|
2018-07-19 13:05:53 +03:00
|
|
|
font-family: ${props => props.theme.typography.code.fontFamily};
|
2017-10-12 00:01:37 +03:00
|
|
|
&::after {
|
|
|
|
content: ' [';
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const ArrayClosingLabel = styled.div`
|
|
|
|
font-size: 0.9em;
|
2018-07-19 13:05:53 +03:00
|
|
|
font-family: ${props => props.theme.typography.code.fontFamily};
|
2017-10-12 00:01:37 +03:00
|
|
|
&::after {
|
|
|
|
content: ']';
|
|
|
|
}
|
|
|
|
`;
|