1
0
mirror of https://github.com/nostalgic-css/NES.css.git synced 2025-08-31 09:41:47 +02:00
Files
nes.css/story/inputs/input.template.js
2021-05-11 14:21:01 +08:00

29 lines
590 B
JavaScript

import { select } from '@storybook/addon-knobs';
import classNames from 'classnames';
import sharedOptions from '../_helpers/shared';
export default () => {
const disabled = 'is-disabled';
const inputOptions = select('Input Classes', {
default: '',
...sharedOptions,
[disabled]: disabled,
}, '');
const inputClasses = classNames(
'nes-input',
inputOptions,
);
return `
<input
type="text"
id="name_field"
${inputOptions.includes(disabled) && 'disabled'}
class="${inputClasses}"
placeholder="NES.css"
/>
`;
};