1
0
mirror of https://github.com/nostalgic-css/NES.css.git synced 2025-08-31 01:39:50 +02:00
Files
nes.css/story/buttons/buttons.template.js
Kaylum Lally 2e06165882 refactor(storybook): storybook enhancement and cleanup
refactored the storybook codebase for all components

re #381
2019-12-14 15:21:15 +00:00

27 lines
637 B
JavaScript

import { select } from '@storybook/addon-knobs';
import sharedOption from '../_helpers/shared';
export default () => {
const buttonType = select('Button Type', {
button: 'button',
file: 'file',
}, 'button');
const buttonClasses = select('Button Classes', {
default: '',
'is-primary': 'is-primary',
...sharedOption,
'is-disabled': 'is-disabled',
}, '');
return buttonType === 'button' ? `
<button type="button" class="nes-btn ${buttonClasses}">Normal</button>
` : `
<label class="nes-btn ${buttonClasses}">
<span>Select your file</span>
<input type="file">
</label>
`;
};