verdaccio-ui/src/components/Package/styles.ts

122 lines
3.4 KiB
TypeScript
Raw Normal View History

import styled from '@emotion/styled';
2019-02-03 17:23:33 +07:00
import { Link } from 'react-router-dom';
2019-03-28 05:39:06 +07:00
import Ico from '../Icon';
2019-02-03 17:23:33 +07:00
import Label from '../Label';
import { default as MuiIconButton } from '../../muiComponents/IconButton';
2019-10-06 23:30:05 +07:00
import { default as Photo } from '../../muiComponents/Avatar';
2019-10-13 03:26:56 +07:00
import List from '../../muiComponents/List';
import { default as Typography } from '../../muiComponents/Heading';
import Grid from '../../muiComponents/Grid';
import ListItemText from '../../muiComponents/ListItemText';
import { Theme } from '../../design-tokens/theme';
export const OverviewItem = styled('span')<{ theme?: Theme }>(({ theme }) => ({
display: 'flex',
alignItems: 'center',
margin: '0 0 0 16px',
2020-03-31 13:44:59 +07:00
color: theme?.palette.type === 'light' ? theme?.palette.greyLight2 : theme?.palette.dodgerBlue,
fontSize: 12,
[`@media (max-width: ${theme && theme.breakPoints.medium}px)`]: {
':nth-of-type(3)': {
display: 'none',
},
},
[`@media (max-width: ${theme && theme.breakPoints.small}px)`]: {
':nth-of-type(4)': {
display: 'none',
},
},
}));
2019-02-03 17:23:33 +07:00
2020-03-31 13:44:59 +07:00
export const Icon = styled(Ico)<{ theme?: Theme }>(({ theme }) => ({
margin: '2px 10px 0 0',
2020-03-31 13:44:59 +07:00
fill: theme?.palette.type === 'light' ? theme?.palette.greyLight2 : theme?.palette.dodgerBlue,
}));
2020-03-31 13:44:59 +07:00
export const Published = styled('span')<{ theme?: Theme }>(({ theme }) => ({
color: theme?.palette.type === 'light' ? theme?.palette.greyLight2 : theme?.palette.dodgerBlue,
margin: '0 5px 0 0',
}));
2020-03-31 13:44:59 +07:00
export const Text = styled(Label)<{ theme?: Theme }>(({ theme }) => ({
fontSize: '12px',
2020-03-31 13:44:59 +07:00
fontWeight: theme?.fontWeight.semiBold,
color: theme?.palette.type === 'light' ? theme?.palette.greyLight2 : theme?.palette.dodgerBlue,
}));
2019-02-03 17:23:33 +07:00
export const Details = styled('span')({
marginLeft: '5px',
lineHeight: 1.5,
display: 'flex',
flexDirection: 'column',
});
2019-02-03 17:23:33 +07:00
export const Author = styled('div')({
display: 'flex',
alignItems: 'center',
});
2019-02-03 17:23:33 +07:00
export const Avatar = styled(Photo)({
width: '20px',
height: '20px',
});
2019-02-03 17:23:33 +07:00
export const WrapperLink = styled(Link)({
textDecoration: 'none',
});
2019-02-03 17:23:33 +07:00
export const PackageTitle = styled('span')<{ theme?: Theme }>(({ theme }) => ({
fontWeight: theme && theme.fontWeight.bold,
fontSize: 20,
display: 'block',
marginBottom: 12,
2020-03-31 13:44:59 +07:00
color: theme?.palette.type == 'dark' ? theme?.palette.white : theme?.palette.eclipse,
cursor: 'pointer',
[`@media (max-width: ${theme && theme.breakPoints.small}px)`]: {
fontSize: 14,
marginBottom: 8,
},
}));
2019-02-03 17:23:33 +07:00
export const GridRightAligned = styled(Grid)({
textAlign: 'right',
});
2019-02-03 17:23:33 +07:00
2020-03-31 13:44:59 +07:00
export const PackageList = styled(List)<{ theme?: Theme }>(({ theme }) => ({
padding: '12px 0 12px 0',
':hover': {
2020-03-31 13:44:59 +07:00
backgroundColor: theme?.palette?.type == 'dark' ? theme?.palette?.primary.main : theme?.palette?.greyLight3,
},
'> :last-child': {
paddingTop: 0,
},
2020-03-31 13:44:59 +07:00
borderRadius: 4,
}));
2019-02-03 17:23:33 +07:00
export const IconButton = styled(MuiIconButton)({
padding: 6,
svg: {
fontSize: 16,
},
});
2019-02-03 17:23:33 +07:00
export const TagContainer = styled('span')<{ theme?: Theme }>(({ theme }) => ({
marginTop: 8,
marginBottom: 12,
display: 'block',
[`@media (max-width: ${theme && theme.breakPoints.medium}px)`]: {
display: 'none',
},
}));
2019-02-03 17:23:33 +07:00
export const PackageListItemText = styled(ListItemText)({
paddingRight: 0,
});
2019-02-03 17:23:33 +07:00
export const Description = styled(Typography)<{ theme?: Theme }>(props => ({
color: props.theme && props.theme.palette.greyDark2,
fontSize: '14px',
paddingRight: 0,
}));