diff --git a/ui/components/component-library/label/__snapshots__/label.test.js.snap b/ui/components/component-library/label/__snapshots__/label.test.tsx.snap similarity index 100% rename from ui/components/component-library/label/__snapshots__/label.test.js.snap rename to ui/components/component-library/label/__snapshots__/label.test.tsx.snap diff --git a/ui/components/component-library/label/index.js b/ui/components/component-library/label/index.js deleted file mode 100644 index f28365d90..000000000 --- a/ui/components/component-library/label/index.js +++ /dev/null @@ -1 +0,0 @@ -export { Label } from './label'; diff --git a/ui/components/component-library/label/index.ts b/ui/components/component-library/label/index.ts new file mode 100644 index 000000000..1a984b62c --- /dev/null +++ b/ui/components/component-library/label/index.ts @@ -0,0 +1,2 @@ +export { Label } from './label'; +export type { LabelComponent, LabelProps } from './label.types'; diff --git a/ui/components/component-library/label/label.js b/ui/components/component-library/label/label.js deleted file mode 100644 index 7eca591b2..000000000 --- a/ui/components/component-library/label/label.js +++ /dev/null @@ -1,44 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import classnames from 'classnames'; -import { - FontWeight, - TextVariant, - Display, - AlignItems, -} from '../../../helpers/constants/design-system'; -import { Text } from '..'; - -export const Label = ({ htmlFor, className, children, ...props }) => ( - - {children} - -); - -Label.propTypes = { - /** - * The content of the label - */ - children: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), - /** - * The id of the input associated with the label - */ - htmlFor: PropTypes.string, - /** - * Additional classNames to be added to the label component - */ - className: PropTypes.string, -}; diff --git a/ui/components/component-library/label/label.stories.js b/ui/components/component-library/label/label.stories.tsx similarity index 70% rename from ui/components/component-library/label/label.stories.js rename to ui/components/component-library/label/label.stories.tsx index 9b6554737..d653db4a1 100644 --- a/ui/components/component-library/label/label.stories.js +++ b/ui/components/component-library/label/label.stories.tsx @@ -1,7 +1,8 @@ import React, { useState } from 'react'; +import { ComponentMeta, ComponentStory } from '@storybook/react'; import { - DISPLAY, - FLEX_DIRECTION, + Display, + FlexDirection, AlignItems, IconColor, } from '../../../helpers/constants/design-system'; @@ -37,21 +38,21 @@ export default { args: { children: 'Label', }, -}; +} as ComponentMeta; -const Template = (args) =>