Skip to content

Commit

Permalink
Add storybook story for Notice component
Browse files Browse the repository at this point in the history
  • Loading branch information
brentswisher committed Apr 16, 2020
1 parent 85d8a2a commit 1280b3a
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions packages/components/src/notice/stories/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/**
* External dependencies
*/
import { boolean, select, text } from '@storybook/addon-knobs';

/**
* Internal dependencies
*/
import Notice from '../';

export default {
title: 'Components/Notice',
component: Notice,
};

export const _default = () => {
const status = select(
'Status',
{
Warning: 'warning',
Success: 'success',
Error: 'error',
Info: 'info',
},
'info'
);
const isDismissible = boolean( 'Is Dismissible', true );

return (
<Notice status={ status } isDismissible={ isDismissible }>
<p>This is a notice.</p>
</Notice>
);
};

export const withCustomSpokenMessage = () => {
const status = select(
'Status',
{
Warning: 'warning',
Success: 'success',
Error: 'error',
Info: 'info',
},
'info'
);
const isDismissible = boolean( 'Is Dismissible', true );
const politeness = select(
'Politeness',
{
Assertive: 'assertive',
Polite: 'polite',
},
'assertive'
);
const spokenMessage = text(
'Spoken Message',
'This is a notice with a custom spoken message'
);

return (
<Notice
status={ status }
isDismissible={ isDismissible }
politeness={ politeness }
spokenMessage={ spokenMessage }
>
<p>This is a notice.</p>
</Notice>
);
};

0 comments on commit 1280b3a

Please sign in to comment.