diff --git a/packages/react/src/components/tag/Tag.stories.tsx b/packages/react/src/components/tag/Tag.stories.tsx index a5663a50db..b28561ebd5 100644 --- a/packages/react/src/components/tag/Tag.stories.tsx +++ b/packages/react/src/components/tag/Tag.stories.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import { IconShare, IconTrash } from '../../icons'; -import { Tag, TagSize, TagTheme } from './Tag'; +import { Tag, TagProps, TagSize, TagTheme } from './Tag'; export default { component: Tag, @@ -19,7 +19,7 @@ const TagWrapper = (args) => (
{args.children}
); -export const InformativeTagsSmall = (args) => ( +export const InformativeTagsSmall = (args: TagProps) => ( } /> @@ -28,10 +28,10 @@ export const InformativeTagsSmall = (args) => ( ); -export const InformativeTagsLarge = (args) => ; +export const InformativeTagsLarge = (args: TagProps) => ; InformativeTagsLarge.args = { size: TagSize.Large }; -export const LinkTags = (args) => ( +export const LinkTags = (args: TagProps) => ( } aria-label="Open link to self" /> ( ); -export const ActionTags = (args) => ( +export const ActionTags = (args: TagProps) => ( action(`Click: ${args.children}`)()} aria-label="run action 1"> {args.children} @@ -81,7 +81,7 @@ export const ActionTags = (args) => ( ); -export const DeletableTags = (args) => { +export const DeletableTags = (args: TagProps) => { return ( { ); }; -export const CustomThemeTags = (args) => { +export const CustomThemeTags = (args: TagProps) => { const customA: TagTheme = { '--background-color': 'var(--color-brick)', '--color': 'var(--color-white)', @@ -173,7 +173,7 @@ export const CustomThemeTags = (args) => { const longText = 'Label - This is a tag with a very long text which is not advisable and might span into multiple lines'; -const LongTextTags = (args) => ( +const LongTextTags = (args: TagProps) => (
{longText} @@ -199,8 +199,8 @@ const LongTextTags = (args) => (
); -export const LongTextTagsSmall = (args) => ; +export const LongTextTagsSmall = (args: TagProps) => ; LongTextTagsSmall.args = { multiline: true }; -export const LongTextTagsLarge = (args) => ; +export const LongTextTagsLarge = (args: TagProps) => ; LongTextTagsLarge.args = { size: TagSize.Large, multiline: true }; diff --git a/packages/react/src/components/tag/Tag.tsx b/packages/react/src/components/tag/Tag.tsx index 80467d804f..e688afc372 100644 --- a/packages/react/src/components/tag/Tag.tsx +++ b/packages/react/src/components/tag/Tag.tsx @@ -77,7 +77,7 @@ export type TagProps = { /** * Ref is set to the main element */ - ref?: React.Ref | React.LegacyRef; + ref?: React.Ref | React.Ref; }; export const Tag = forwardRef & TagProps>(