1
0
mirror of https://github.com/nostalgic-css/NES.css.git synced 2025-08-31 17:51:46 +02:00

feat(component): add a select component

This commit is contained in:
Wojciech Olejnik
2018-12-20 19:36:05 +01:00
parent fcbed9e387
commit 6713344379
3 changed files with 70 additions and 0 deletions

26
docs/select.stories.js Normal file
View File

@@ -0,0 +1,26 @@
import { storiesOf } from '@storybook/html'; // eslint-disable-line import/no-extraneous-dependencies
import { // eslint-disable-line import/no-extraneous-dependencies
withKnobs, radios,
} from '@storybook/addon-knobs';
const stories = storiesOf('Select', module);
stories.addDecorator(withKnobs);
stories.add('select', () => {
const selectedClass = radios('class', {
default: '',
'is-success': 'is-success',
'is-warning': 'is-warning',
'is-error': 'is-error',
}, '');
return `
<div class="nes-select ${selectedClass}">
<select required>
<option value="" disabled selected hidden>Select...</option>
<option value="0">To be</option>
<option value="1">Not to be</option>
</select>
</div>
`;
});