1
0
mirror of https://github.com/nostalgic-css/NES.css.git synced 2025-04-21 22:52:42 +02:00

Merge branch 'develop' into fix-gaps

This commit is contained in:
B.C.Rikko 2019-10-18 23:50:18 +09:00 committed by GitHub
commit d393199e86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,12 +1,16 @@
import { storiesOf } from '@storybook/html'; // eslint-disable-line import/no-extraneous-dependencies
import { // eslint-disable-line import/no-extraneous-dependencies
withKnobs, radios,
withKnobs, radios, select,
} from '@storybook/addon-knobs';
const stories = storiesOf('Buttons', module);
stories.addDecorator(withKnobs);
stories.add('button', () => {
const buttonType = select('type', {
button: 'button',
file: 'file',
}, 'button');
const extraClass = radios('class', {
default: '',
'is-primary': 'is-primary',
@ -15,5 +19,10 @@ stories.add('button', () => {
'is-error': 'is-error',
'is-disabled': 'is-disabled',
}, '');
return `<button type="button" class="nes-btn ${extraClass}">Normal</button>`;
return buttonType === 'file'
? `<label class="nes-btn ${extraClass}">
<span>Select your file</span>
<input type="file">
</label>`
: `<button type="button" class="nes-btn ${extraClass}">Normal</button>`;
});