import { boolean, number, text, withKnobs } from '@storybook/addon-knobs'; import { withA11y } from '@storybook/addon-a11y'; import { MessageComponent } from './message.component'; export default { title: 'Common/Message', component: MessageComponent, decorators: [withKnobs, withA11y] }; export const Knobs = () => ({ component: MessageComponent, props: { type: text('type', 'error'), message: text('message', 'Something went wrong') } }); export const Error = () => ({ component: MessageComponent, props: { type: 'error', message: 'This is an error' }, }); export const Success = () => ({ component: MessageComponent, props: { type: 'success', message: 'Success! Something good happened.' }, }); export const Warning = () => ({ component: MessageComponent, props: { type: 'warning', message: 'Warning! Something potentially bad happened.' }, }); export const Closeable = () => ({ component: MessageComponent, props: { type: 'info', closeable: true, message: 'Here\'s some info you might like to know' } }); export const Info = () => ({ component: MessageComponent, props: { type: 'info', message: 'Here\'s some info you might like to know' } }); export const MultiLine = () => ({ component: MessageComponent, props: { type: 'error', message: 'Error:\nThis text should be on a new line' } });