import { space, typography, layout } from 'styled-system';
import { styled } from 'styled-components';
import { InputCSS } from '../input/index.js';
import { cssClass } from '../../utils/css-class.js';

/**
 * Prop Types of a TextArea component.
 * It extends all {@link SpaceProps}, {@link TypographyProps} and {@link LayoutProps}
 * @memberof TextArea
 * @alias TextAreaProps
 * @property {string} [...] All props default to _textarea_ html component like `onChange`,
 *                          `value` etc.
 * @property {string} [...] Props from {@link SpaceProps}, {@link TypographyProps}
 *                          and {@link LayoutProps} + they extend {@link InputProps}
 */

/**
 * @classdesc
 *
 * <img src="components/textarea.png" />
 *
 * Wrapped `textarea` html element.
 *
 * ### Usage
 *
 * ```javascript
 * import { TextArea, TextAreaProps } from '@adminjs/design-system'
 * ```
 *
 * @component
 * @subcategory Atoms
 * @see {@link https://storybook.adminjs.co/?path=/story/designsystem-atoms-textarea--default Storybook}
 * @see TextAreaProps
 * @hideconstructor
 * @example
 * return (
 *   <Box p="xl">
 *      <Label htmlFor="textarea1">Some example label</Label>
 *      <TextArea id="textarea1" width={1/2} />
 *   </Box>
 * )
 * @section design-system
 */
const TextArea = styled.textarea.withConfig({
  displayName: "text-area__TextArea",
  componentId: "sc-vfz91m-0"
})(["", " ", ";", ";", ";"], InputCSS, space, layout, typography);
TextArea.defaultProps = {
  px: 'default',
  py: 'default',
  fontSize: 'default',
  className: cssClass('TextArea')
};
export { TextArea };
export default TextArea;