diff --git a/packages/grafana-ui/src/components/Alert/Alert.story.tsx b/packages/grafana-ui/src/components/Alert/Alert.story.tsx index d9517371f99..b459290ced4 100644 --- a/packages/grafana-ui/src/components/Alert/Alert.story.tsx +++ b/packages/grafana-ui/src/components/Alert/Alert.story.tsx @@ -1,10 +1,14 @@ import React from 'react'; +import { Story } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { Alert, AlertVariant, VerticalGroup } from '@grafana/ui'; +import { Props } from './Alert'; import { withCenteredStory, withHorizontallyCenteredStory } from '../../utils/storybook/withCenteredStory'; import mdx from '../Alert/Alert.mdx'; import { StoryExample } from '../../utils/storybook/StoryExample'; +const severities: AlertVariant[] = ['error', 'warning', 'info', 'success']; + export default { title: 'Overlays/Alert', component: Alert, @@ -13,26 +17,30 @@ export default { docs: { page: mdx, }, + knobs: { + disabled: true, + }, + }, + argTypes: { + severity: { control: { type: 'select', options: severities } }, }, }; -const severities: AlertVariant[] = ['error', 'warning', 'info', 'success']; - -export const Examples = () => { +export const Examples: Story = ({ severity, title, buttonContent }) => { return ( Close} + title={title} + severity={severity} + buttonContent={{buttonContent}} onRemove={action('Remove button clicked')} > Child content that includes some alert details, like maybe what actually happened. - + @@ -49,3 +57,9 @@ export const Examples = () => { ); }; + +Examples.args = { + severity: 'error', + title: 'Some very important message', + buttonContent: 'Close', +};