1
0
mirror of https://github.com/nostalgic-css/NES.css.git synced 2025-08-31 01:39:50 +02:00

feat(badges): add badges component first draft

This commit is contained in:
Igor Guastalla de Lima
2018-12-18 21:41:44 -02:00
parent 982a412e1e
commit cc5e6d07d8
3 changed files with 118 additions and 0 deletions

29
docs/badge.stories.js Normal file
View File

@@ -0,0 +1,29 @@
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('Badges', module);
stories.addDecorator(withKnobs);
stories.add('badges', () => {
const options = radios('class', {
'is-success': 'is-success',
'is-primary': 'is-primary',
'is-warning': 'is-warning',
'is-error': 'is-error',
}, '');
const sizes = radios('size', {
'is-small': 'is-small',
'is-medium': 'is-medium',
'is-large': 'is-large',
}, '');
const selectedClasses = [options, sizes].join(' ');
return `<span class="nes-badge ${selectedClasses}">
<span>npm</span>
<span>1.0.0</span>
</span>`;
});