Skip to content

Commit

Permalink
feat(badges): updated badges storybook options
Browse files Browse the repository at this point in the history
  • Loading branch information
guastallaigor committed Dec 22, 2018
1 parent 20abd54 commit 72a5e87
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions docs/badge.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { storiesOf } from '@storybook/html'; // eslint-disable-line import/no-extraneous-dependencies
import { // eslint-disable-line import/no-extraneous-dependencies
withKnobs, radios, boolean, number,
withKnobs, radios, number,
} from '@storybook/addon-knobs';

const stories = storiesOf('Badges', module);
Expand All @@ -23,16 +23,20 @@ stories.add('badges', () => {
'is-error': 'is-error',
}, 'is-success');

const isSplitedIsIconOrDefault = radios('default/splited/icon', {
default: '',
'is-splited': 'is-splited',
'is-icon': 'is-icon',
}, '');

const fontSize = number('font-size', 1, {
range: true,
min: 0,
max: 100,
step: 0.01,
});

const isSplited = boolean('is-splited', true) ? 'is-splited' : '';

return `<a href="#" class="nes-badge ${isSplited}" style="font-size:${fontSize}em">
return `<a href="#" class="nes-badge ${isSplitedIsIconOrDefault}" style="font-size:${fontSize}em">
<span class="${optionsLeft}">npm</span>
<span class="${optionsRight}">1.0.0</span>
</a>`;
Expand Down

0 comments on commit 72a5e87

Please sign in to comment.