import * as React from 'react'; import classNames from 'classnames'; type Props = React.InputHTMLAttributes & { label: string; description?: string; value?: string; }; export default React.forwardRef(({ className, description, onChange, label, value, ...props }, ref) => { const [ stateValue, setStateValue ] = React.useState(value); if (value !== stateValue) { setStateValue(value); } const classes = classNames('input open-label', { 'has-content': stateValue && stateValue.length > 0, }); return (
{ setStateValue(e.target.value); if (onChange) { onChange(e); } }} value={typeof value !== 'undefined' ? (stateValue || '') : undefined} {...props} /> {description &&

{description}

}
); });