|
|
|
@ -1,10 +1,10 @@ |
|
|
|
|
import { action } from '@storybook/addon-actions'; |
|
|
|
|
import { Story } from '@storybook/react'; |
|
|
|
|
import React from 'react'; |
|
|
|
|
|
|
|
|
|
import { Tag } from '@grafana/ui'; |
|
|
|
|
|
|
|
|
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; |
|
|
|
|
|
|
|
|
|
import { Props as TagProps, Tag } from './Tag'; |
|
|
|
|
import mdx from './Tag.mdx'; |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
@ -15,9 +15,28 @@ export default { |
|
|
|
|
docs: { |
|
|
|
|
page: mdx, |
|
|
|
|
}, |
|
|
|
|
controls: { |
|
|
|
|
exclude: ['onClick'], |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
args: { |
|
|
|
|
name: 'Tag', |
|
|
|
|
colorIndex: 0, |
|
|
|
|
showIcon: false, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
export const single = () => { |
|
|
|
|
return <Tag name="Tag" onClick={action('Tag clicked')} />; |
|
|
|
|
interface StoryProps extends TagProps { |
|
|
|
|
showIcon?: boolean; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const Single: Story<StoryProps> = (args) => { |
|
|
|
|
return ( |
|
|
|
|
<Tag |
|
|
|
|
name={args.name} |
|
|
|
|
colorIndex={args.colorIndex} |
|
|
|
|
onClick={action('Tag clicked')} |
|
|
|
|
icon={args.showIcon ? args.icon : undefined} |
|
|
|
|
/> |
|
|
|
|
); |
|
|
|
|
}; |
|
|
|
|