import * as React from 'react'; import * as PropTypes from 'prop-types'; import { InlineBlockProps as ReakitInlineBlockProps } from 'reakit/ts/InlineBlock/InlineBlock'; import { Omit } from '../types'; import Icon from '../Icon'; import _Tag, { RemoveButton, TagContent } from './styled'; export type LocalTagProps = { className?: string; children: React.ReactNode; onRemove?(): void; kind?: 'outlined'; palette?: string; size?: string; }; export type TagProps = Omit & LocalTagProps; export const Tag: React.FunctionComponent = ({ children, onRemove, size, ...props }) => ( <_Tag styledSize={size} {...props}> {children} {Boolean(onRemove) && ( )} ); export const tagPropTypes = { className: PropTypes.string, children: PropTypes.node.isRequired, kind: PropTypes.oneOf(['outlined']) as PropTypes.Validator, onRemove: PropTypes.func, palette: PropTypes.string, size: PropTypes.string }; Tag.propTypes = tagPropTypes; export const tagDefaultProps = { className: undefined, kind: undefined, onRemove: undefined, palette: 'text', size: 'default' }; Tag.defaultProps = tagDefaultProps; // @ts-ignore const C: React.FunctionComponent = Tag; export default C;