import React, { useState, forwardRef } from 'react'; import classNames from 'classnames'; import PropTypes from 'prop-types'; import theme from '../../styles/defaultTheme'; import { hexa } from '../../styles/global'; const InputContainer = ({ children, prefix, className }) => (
{prefix && {prefix}} {children}
); InputContainer.propTypes = { children: PropTypes.node, className: PropTypes.string, prefix: PropTypes.string, }; export const TextInput = forwardRef( ({ onChange, prefix, variant, ...rest }, ref) => { const cx = classNames('input-container', variant, { prefix }); return ( ); } ); TextInput.propTypes = { onChange: PropTypes.func, prefix: PropTypes.string, variant: PropTypes.string, }; export const BooleanInput = ({ value = false, onChange = () => null, disabled = false, ...rest }) => { const [checked, setChecked] = useState(value); return ( // eslint-disable-next-line