import * as React from 'react'; import styled, { withProps } from '../styled-components'; const directionMap = { left: '90deg', right: '-90deg', up: '-180deg', down: '0', }; class _ShelfIcon extends React.PureComponent<{ className?: string; float?: 'left' | 'right'; size?: string; color?: string; direction: 'left' | 'right' | 'up' | 'down'; style?: React.CSSProperties; }> { render() { return ( ); } } export const ShelfIcon = styled(_ShelfIcon)` height: ${props => props.size || '18px'}; width: ${props => props.size || '18px'}; vertical-align: middle; float: ${props => props.float || ''}; transition: transform 0.2s ease-out; transform: rotateZ(${props => directionMap[props.direction || 'down']}); polygon { fill: ${props => (props.color && props.theme.colors[props.color]) || props.color}; } `; export const Badge = withProps<{ type: string }>(styled.span)` display: inline-block; padding: 0 5px; margin: 0; background-color: ${props => props.theme.colors[props.type]}; color: white; font-size: ${props => props.theme.code.fontSize};; vertical-align: text-top; `;