* Update naming of guidelines section and improve Introduction page * Add Docs * Add docs * Install Docs add-on - Rename top-level folders and sort manually - Add MDX static pages * Updated all Storybook addons to 6.1.3 except for notes as it's currently 5.3.21 * Fixed naming of section for the select component. * Updated yarn.lock file. * Added missing dependency @storybook/addon-docs Co-authored-by: Nick Taylor <nick@dev.to>
50 lines
1.1 KiB
JavaScript
50 lines
1.1 KiB
JavaScript
import { h } from 'preact';
|
|
import { action } from '@storybook/addon-actions';
|
|
import faker from 'faker';
|
|
import { number } from '@storybook/addon-knobs';
|
|
import { Snackbar, addSnackbarItem } from '..';
|
|
|
|
export default {
|
|
title: 'App Components/Snackbar/Snackbar',
|
|
};
|
|
|
|
export const SimulateAddingSnackbarItems = () => {
|
|
addSnackbarItem({
|
|
message: faker.hacker.phrase(),
|
|
actions: [
|
|
{ text: faker.lorem.word(), handler: action('action 1 clicked') },
|
|
],
|
|
});
|
|
|
|
addSnackbarItem({
|
|
message: faker.hacker.phrase(),
|
|
actions: [
|
|
{ text: faker.lorem.word(), handler: action('action 2 clicked') },
|
|
],
|
|
});
|
|
|
|
addSnackbarItem({
|
|
message: faker.hacker.phrase(),
|
|
actions: [
|
|
{ text: faker.lorem.word(), handler: action('action 3 clicked') },
|
|
],
|
|
});
|
|
|
|
addSnackbarItem({
|
|
message: faker.hacker.phrase(),
|
|
actions: [
|
|
{ text: faker.lorem.word(), handler: action('action 3 clicked') },
|
|
],
|
|
});
|
|
|
|
return (
|
|
<Snackbar
|
|
lifespan={number('lifespan', 5)}
|
|
pollingTime={number('pollingTime', 300)}
|
|
/>
|
|
);
|
|
};
|
|
|
|
SimulateAddingSnackbarItems.story = {
|
|
name: 'simulating adding multiple snackbar items',
|
|
};
|