mirror of
https://github.com/nostalgic-css/NES.css.git
synced 2025-08-14 02:13:57 +02:00
Merge branch 'develop' into fix-gaps
This commit is contained in:
@@ -1,12 +1,16 @@
|
|||||||
import { storiesOf } from '@storybook/html'; // eslint-disable-line import/no-extraneous-dependencies
|
import { storiesOf } from '@storybook/html'; // eslint-disable-line import/no-extraneous-dependencies
|
||||||
import { // eslint-disable-line import/no-extraneous-dependencies
|
import { // eslint-disable-line import/no-extraneous-dependencies
|
||||||
withKnobs, radios,
|
withKnobs, radios, select,
|
||||||
} from '@storybook/addon-knobs';
|
} from '@storybook/addon-knobs';
|
||||||
|
|
||||||
const stories = storiesOf('Buttons', module);
|
const stories = storiesOf('Buttons', module);
|
||||||
stories.addDecorator(withKnobs);
|
stories.addDecorator(withKnobs);
|
||||||
|
|
||||||
stories.add('button', () => {
|
stories.add('button', () => {
|
||||||
|
const buttonType = select('type', {
|
||||||
|
button: 'button',
|
||||||
|
file: 'file',
|
||||||
|
}, 'button');
|
||||||
const extraClass = radios('class', {
|
const extraClass = radios('class', {
|
||||||
default: '',
|
default: '',
|
||||||
'is-primary': 'is-primary',
|
'is-primary': 'is-primary',
|
||||||
@@ -15,5 +19,10 @@ stories.add('button', () => {
|
|||||||
'is-error': 'is-error',
|
'is-error': 'is-error',
|
||||||
'is-disabled': 'is-disabled',
|
'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>`;
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user