2018-11-27 12:57:02 +03:00
|
|
|
import { darken } from 'polished';
|
2018-07-17 12:15:22 +03:00
|
|
|
import { Tabs as ReactTabs } from 'react-tabs';
|
2018-11-27 12:57:02 +03:00
|
|
|
|
2018-07-16 18:28:36 +03:00
|
|
|
import styled from '../styled-components';
|
2017-10-12 00:01:37 +03:00
|
|
|
|
|
|
|
export { Tab, TabList, TabPanel } from 'react-tabs';
|
|
|
|
|
|
|
|
export const Tabs = styled(ReactTabs)`
|
|
|
|
> ul {
|
|
|
|
list-style: none;
|
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
2018-05-28 21:50:26 +03:00
|
|
|
margin: 0 -5px;
|
2017-10-12 00:01:37 +03:00
|
|
|
|
|
|
|
> li {
|
|
|
|
padding: 5px 10px;
|
|
|
|
display: inline-block;
|
2018-05-28 21:50:26 +03:00
|
|
|
|
2020-03-27 17:31:53 +03:00
|
|
|
background-color: ${({ theme }) => theme.codeBlock.backgroundColor};
|
2018-01-24 13:32:25 +03:00
|
|
|
border-bottom: 1px solid rgba(0, 0, 0, 0.5);
|
2017-10-12 00:01:37 +03:00
|
|
|
cursor: pointer;
|
|
|
|
text-align: center;
|
|
|
|
outline: none;
|
2018-11-27 12:57:02 +03:00
|
|
|
color: ${({ theme }) => darken(theme.colors.tonalOffset, theme.rightPanel.textColor)};
|
2019-05-10 18:04:06 +03:00
|
|
|
margin: 0
|
|
|
|
${({ theme }) => `${theme.spacing.unit}px ${theme.spacing.unit}px ${theme.spacing.unit}px`};
|
2020-03-27 17:31:53 +03:00
|
|
|
border: 1px solid ${({ theme }) => darken(0.05, theme.codeBlock.backgroundColor)};
|
2018-05-28 21:50:26 +03:00
|
|
|
border-radius: 5px;
|
|
|
|
min-width: 60px;
|
|
|
|
font-size: 0.9em;
|
|
|
|
font-weight: bold;
|
2017-10-12 00:01:37 +03:00
|
|
|
|
|
|
|
&.react-tabs__tab--selected {
|
2018-07-19 13:05:53 +03:00
|
|
|
color: ${props => props.theme.colors.text.primary};
|
2018-11-27 12:57:02 +03:00
|
|
|
background: ${({ theme }) => theme.rightPanel.textColor};
|
2020-06-10 15:20:18 +03:00
|
|
|
&:focus {
|
|
|
|
outline: auto;
|
|
|
|
}
|
2017-10-12 00:01:37 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
&:only-child {
|
|
|
|
flex: none;
|
|
|
|
min-width: 100px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.tab-success {
|
2018-07-19 13:05:53 +03:00
|
|
|
color: ${props => props.theme.colors.responses.success.color};
|
2017-10-12 00:01:37 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
&.tab-redirect {
|
2018-07-19 13:05:53 +03:00
|
|
|
color: ${props => props.theme.colors.responses.redirect.color};
|
2017-10-12 00:01:37 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
&.tab-info {
|
2018-07-19 13:05:53 +03:00
|
|
|
color: ${props => props.theme.colors.responses.info.color};
|
2017-10-12 00:01:37 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
&.tab-error {
|
2018-07-19 13:05:53 +03:00
|
|
|
color: ${props => props.theme.colors.responses.error.color};
|
2017-10-12 00:01:37 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
> .react-tabs__tab-panel {
|
2020-03-27 17:31:53 +03:00
|
|
|
background: ${({ theme }) => theme.codeBlock.backgroundColor};
|
2017-10-12 00:01:37 +03:00
|
|
|
& > div,
|
|
|
|
& > pre {
|
2019-01-23 15:55:14 +03:00
|
|
|
padding: ${props => props.theme.spacing.unit * 4}px;
|
2017-10-12 00:01:37 +03:00
|
|
|
margin: 0;
|
|
|
|
}
|
2019-01-23 15:55:14 +03:00
|
|
|
|
|
|
|
& > div > pre {
|
|
|
|
padding: 0;
|
|
|
|
}
|
2017-10-12 00:01:37 +03:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2018-08-24 12:12:18 +03:00
|
|
|
export const SmallTabs = styled(Tabs)`
|
2017-10-12 00:01:37 +03:00
|
|
|
> ul {
|
|
|
|
display: block;
|
|
|
|
> li {
|
2018-05-28 21:50:26 +03:00
|
|
|
padding: 2px 5px;
|
|
|
|
min-width: auto;
|
|
|
|
margin: 0 15px 0 0;
|
|
|
|
font-size: 13px;
|
|
|
|
font-weight: normal;
|
2017-10-12 00:01:37 +03:00
|
|
|
border-bottom: 1px dashed;
|
2018-11-27 12:57:02 +03:00
|
|
|
color: ${({ theme }) => darken(theme.colors.tonalOffset, theme.rightPanel.textColor)};
|
2018-05-28 21:50:26 +03:00
|
|
|
border-radius: 0;
|
|
|
|
background: none;
|
2017-10-12 00:01:37 +03:00
|
|
|
|
|
|
|
&:last-child {
|
|
|
|
margin-right: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.react-tabs__tab--selected {
|
2018-11-27 12:57:02 +03:00
|
|
|
color: ${({ theme }) => theme.rightPanel.textColor};
|
2018-05-28 21:50:26 +03:00
|
|
|
background: none;
|
2017-10-12 00:01:37 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
> .react-tabs__tab-panel {
|
|
|
|
& > div,
|
|
|
|
& > pre {
|
2019-06-18 11:39:38 +03:00
|
|
|
padding: ${props => props.theme.spacing.unit * 2}px 0;
|
2017-10-12 00:01:37 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|