Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
primogenial
/
languages
/
wp-content
/
plugins
/
elementor
/
app
/
assets
/
js
/
ui
/
atoms
:
text-field.js
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
import { arrayToClassName } from '../../utils/utils'; import './text-field.scss'; export default function TextField( props ) { const classNameBase = 'eps-text-field', classes = [ classNameBase, props.className, { [ classNameBase + '--outlined' ]: 'outlined' === props.variant } ], validProps = { ...props, className: arrayToClassName( classes ) }; if ( validProps.multiline ) { delete validProps.multiline; return ( <textarea { ...validProps } /> ); } return ( <input { ...validProps } type="text" /> ); } TextField.propTypes = { className: PropTypes.string, multiline: PropTypes.bool, variant: PropTypes.oneOf( [ 'standard', 'outlined' ] ), children: PropTypes.string, }; TextField.defaultProps = { className: '', variant: 'standard', };