diff --git a/frontend/src/Components/Label.js b/frontend/src/Components/Label.js deleted file mode 100644 index 844da8165..000000000 --- a/frontend/src/Components/Label.js +++ /dev/null @@ -1,48 +0,0 @@ -import classNames from 'classnames'; -import PropTypes from 'prop-types'; -import React from 'react'; -import { kinds, sizes } from 'Helpers/Props'; -import styles from './Label.css'; - -function Label(props) { - const { - className, - kind, - size, - outline, - children, - ...otherProps - } = props; - - return ( - - {children} - - ); -} - -Label.propTypes = { - className: PropTypes.string.isRequired, - title: PropTypes.string, - kind: PropTypes.oneOf(kinds.all).isRequired, - size: PropTypes.oneOf(sizes.all).isRequired, - outline: PropTypes.bool.isRequired, - children: PropTypes.node.isRequired -}; - -Label.defaultProps = { - className: styles.label, - kind: kinds.DEFAULT, - size: sizes.SMALL, - outline: false -}; - -export default Label; diff --git a/frontend/src/Components/Label.tsx b/frontend/src/Components/Label.tsx new file mode 100644 index 000000000..9ab360f42 --- /dev/null +++ b/frontend/src/Components/Label.tsx @@ -0,0 +1,33 @@ +import classNames from 'classnames'; +import React, { ComponentProps, ReactNode } from 'react'; +import { kinds, sizes } from 'Helpers/Props'; +import { Kind } from 'Helpers/Props/kinds'; +import { Size } from 'Helpers/Props/sizes'; +import styles from './Label.css'; + +export interface LabelProps extends ComponentProps<'span'> { + kind?: Extract; + size?: Extract; + outline?: boolean; + children: ReactNode; +} + +export default function Label({ + className = styles.label, + kind = kinds.DEFAULT, + size = sizes.SMALL, + outline = false, + ...otherProps +}: LabelProps) { + return ( + + ); +}