1
0
mirror of https://github.com/nostalgic-css/NES.css.git synced 2025-09-08 21:30:47 +02:00

refactor(storybook): storybook enhancement and cleanup

refactored the storybook codebase for all components

re #381
This commit is contained in:
Kaylum Lally
2019-12-14 15:21:15 +00:00
parent 08cbd6e51e
commit 2e06165882
49 changed files with 643 additions and 404 deletions

View File

@@ -0,0 +1,8 @@
import { storiesOf } from '@storybook/html';
import { withKnobs } from '@storybook/addon-knobs';
import Dialogs from './dialogs.template';
storiesOf('Dialogs', module)
.addDecorator(withKnobs)
.add('Dialog', () => Dialogs());

View File

@@ -0,0 +1,23 @@
import { boolean } from '@storybook/addon-knobs';
import classNames from 'classnames';
export default () => {
const isOpen = boolean('Open', true) ? 'open' : '';
const isRounded = boolean('is-rounded', false);
const isDark = boolean('is-dark', false);
const dialogClasses = classNames(
'nes-dialog',
{
'is-rounded': isRounded,
'is-dark': isDark,
},
);
return `
<dialog class="${dialogClasses}" ${isOpen}>
<p class="title">Dialog</p>
<p>Alert: this is a dialog.</p>
</dialog>
`;
};