* Added story sorting to Storybook. * Added design system guidelines. * Made Base in Storybook tree 2nd in the tree view. * Now Components are 3rd in the treeview of Storybook. * Now App Components are 4th in the treeview of Storybook. * Froze node version to 12.16.0 * Revert "Froze node version to 12.16.0" This reverts commit 093b119c7d7ca05ecb4e1c0234b24bcf8e7b10a4.
40 lines
848 B
JavaScript
40 lines
848 B
JavaScript
import { h } from 'preact';
|
|
import { action } from '@storybook/addon-actions';
|
|
import { SnackbarItem } from '../SnackbarItem';
|
|
|
|
export default {
|
|
title: '4_App Components/Snackbar/SnackbarItem',
|
|
};
|
|
|
|
export const JustAMessage = () => (
|
|
<SnackbarItem message="File uploaded successfully" />
|
|
);
|
|
|
|
JustAMessage.story = {
|
|
name: 'message only',
|
|
};
|
|
|
|
export const WithOneAction = () => (
|
|
<SnackbarItem
|
|
message="Changes saved"
|
|
actions={[{ text: 'Undo', handler: action('save file retry') }]}
|
|
/>
|
|
);
|
|
|
|
WithOneAction.story = {
|
|
name: 'with one action',
|
|
};
|
|
|
|
export const WithActions = () => (
|
|
<SnackbarItem
|
|
message="Unable to save file"
|
|
actions={[
|
|
{ text: 'Retry', handler: action('save file retry') },
|
|
{ text: 'Abort', handler: action('abort file save') },
|
|
]}
|
|
/>
|
|
);
|
|
|
|
WithActions.story = {
|
|
name: 'with actions',
|
|
};
|