UNPKG

@gechiui/components

Version:
45 lines (41 loc) 1.13 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import { createElement } from "@gechiui/element"; /** * GeChiUI dependencies */ import { useInstanceId } from '@gechiui/compose'; /** * Internal dependencies */ import BaseControl from '../base-control'; import { StyledTextarea } from './styles/textarea-control-styles'; export default function TextareaControl(_ref) { let { label, hideLabelFromVision, value, help, onChange, rows = 4, className, ...props } = _ref; const instanceId = useInstanceId(TextareaControl); const id = `inspector-textarea-control-${instanceId}`; const onChangeValue = event => onChange(event.target.value); return createElement(BaseControl, { label: label, hideLabelFromVision: hideLabelFromVision, id: id, help: help, className: className }, createElement(StyledTextarea, _extends({ className: "components-textarea-control__input", id: id, rows: rows, onChange: onChangeValue, "aria-describedby": !!help ? id + '__help' : undefined, value: value }, props))); } //# sourceMappingURL=index.js.map