2017-10-12 00:01:37 +03:00
|
|
|
import * as React from 'react';
|
2018-11-27 12:18:41 +03:00
|
|
|
import styled from '../styled-components';
|
2017-10-12 00:01:37 +03:00
|
|
|
|
|
|
|
const directionMap = {
|
|
|
|
left: '90deg',
|
|
|
|
right: '-90deg',
|
|
|
|
up: '-180deg',
|
|
|
|
down: '0',
|
|
|
|
};
|
|
|
|
|
2022-07-20 19:02:25 +03:00
|
|
|
const IntShelfIcon = (props: {
|
2017-10-12 00:01:37 +03:00
|
|
|
className?: string;
|
|
|
|
float?: 'left' | 'right';
|
|
|
|
size?: string;
|
|
|
|
color?: string;
|
|
|
|
direction: 'left' | 'right' | 'up' | 'down';
|
|
|
|
style?: React.CSSProperties;
|
2022-07-20 19:02:25 +03:00
|
|
|
}): JSX.Element => {
|
|
|
|
return (
|
|
|
|
<svg
|
|
|
|
className={props.className}
|
|
|
|
style={props.style}
|
|
|
|
version="1.1"
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
x="0"
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
y="0"
|
|
|
|
aria-hidden="true"
|
|
|
|
>
|
|
|
|
<polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 " />
|
|
|
|
</svg>
|
|
|
|
);
|
|
|
|
};
|
2017-10-12 00:01:37 +03:00
|
|
|
|
2018-01-22 21:30:53 +03:00
|
|
|
export const ShelfIcon = styled(IntShelfIcon)`
|
2017-10-12 00:01:37 +03:00
|
|
|
height: ${props => props.size || '18px'};
|
|
|
|
width: ${props => props.size || '18px'};
|
2022-05-13 14:53:03 +03:00
|
|
|
min-width: ${props => props.size || '18px'};
|
2017-10-12 00:01:37 +03:00
|
|
|
vertical-align: middle;
|
|
|
|
float: ${props => props.float || ''};
|
|
|
|
transition: transform 0.2s ease-out;
|
|
|
|
transform: rotateZ(${props => directionMap[props.direction || 'down']});
|
|
|
|
|
|
|
|
polygon {
|
2020-11-05 16:22:42 +03:00
|
|
|
fill: ${({ color, theme }) =>
|
|
|
|
(color && theme.colors.responses[color] && theme.colors.responses[color].color) || color};
|
2017-10-12 00:01:37 +03:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2018-11-27 12:18:41 +03:00
|
|
|
export const Badge = styled.span<{ type: string }>`
|
2017-10-12 00:01:37 +03:00
|
|
|
display: inline-block;
|
2020-08-14 16:33:25 +03:00
|
|
|
padding: 2px 8px;
|
2017-10-12 00:01:37 +03:00
|
|
|
margin: 0;
|
2018-07-19 13:05:53 +03:00
|
|
|
background-color: ${props => props.theme.colors[props.type].main};
|
2018-07-19 14:34:53 +03:00
|
|
|
color: ${props => props.theme.colors[props.type].contrastText};
|
2018-07-19 13:05:53 +03:00
|
|
|
font-size: ${props => props.theme.typography.code.fontSize};
|
2020-08-14 16:33:25 +03:00
|
|
|
vertical-align: middle;
|
|
|
|
line-height: 1.6;
|
|
|
|
border-radius: 4px;
|
|
|
|
font-weight: ${({ theme }) => theme.typography.fontWeightBold};
|
|
|
|
font-size: 12px;
|
|
|
|
+ span[type] {
|
|
|
|
margin-left: 4px;
|
|
|
|
}
|
2017-10-12 00:01:37 +03:00
|
|
|
`;
|