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:
29
docs/badge.stories.js
Normal file
29
docs/badge.stories.js
Normal 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>`;
|
||||
});
|
Reference in New Issue
Block a user