2022-03-25 09:21:09 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import classnames from 'classnames';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import './style.scss';
|
|
|
|
|
2023-11-13 11:52:46 +00:00
|
|
|
export interface TextareaProps {
|
2022-03-28 13:44:25 +00:00
|
|
|
className?: string;
|
2022-03-25 09:21:09 +00:00
|
|
|
disabled: boolean;
|
|
|
|
onTextChange: ( newText: string ) => void;
|
|
|
|
placeholder: string;
|
|
|
|
value: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export const Textarea = ( {
|
|
|
|
className = '',
|
|
|
|
disabled = false,
|
|
|
|
onTextChange,
|
|
|
|
placeholder,
|
|
|
|
value = '',
|
|
|
|
}: TextareaProps ): JSX.Element => (
|
|
|
|
<textarea
|
|
|
|
className={ classnames( 'wc-block-components-textarea', className ) }
|
|
|
|
disabled={ disabled }
|
|
|
|
onChange={ ( event ) => {
|
|
|
|
onTextChange( event.target.value );
|
|
|
|
} }
|
|
|
|
placeholder={ placeholder }
|
|
|
|
rows={ 2 }
|
|
|
|
value={ value }
|
|
|
|
/>
|
|
|
|
);
|
2023-10-25 08:53:24 +00:00
|
|
|
|
|
|
|
export default Textarea;
|