import * as React from 'react'; import { OverrideProps } from '@mui/types'; import { CreateSlotsAndSlotProps, SlotCommonProps, SlotProps } from '../types/slot'; export type TextareaSlot = 'root' | 'textarea' | 'startDecorator' | 'endDecorator'; export interface TextareaSlots { /** * The component that renders the root. * @default 'div' */ root?: React.ElementType; /** * The component that renders the textarea. * @default 'textarea' */ textarea?: React.ElementType; /** * The component that renders the start decorator. * @default 'div' */ startDecorator?: React.ElementType; /** * The component that renders the end decorator. * @default 'div' */ endDecorator?: React.ElementType; } export interface TextareaPropsVariantOverrides { } export interface TextareaPropsColorOverrides { } export interface TextareaPropsSizeOverrides { } export type TextareaSlotsAndSlotProps = CreateSlotsAndSlotProps; textarea: SlotProps<'textarea', object, TextareaOwnerState>; startDecorator: SlotProps<'span', object, TextareaOwnerState>; endDecorator: SlotProps<'span', object, TextareaOwnerState>; }>; export type CommonUsedTextareaKeys = 'autoComplete' | 'autoFocus' | 'onClick' | 'onChange' | 'onKeyDown' | 'onKeyUp' | 'onFocus' | 'onBlur' | 'defaultValue' | 'value' | 'placeholder' | 'readOnly' | 'required' | 'name' | 'id' | 'disabled' | 'maxLength'; export interface TextareaTypeMap

{ props: P & Pick, CommonUsedTextareaKeys> & { /** * Maximum number of rows to display. */ maxRows?: string | number; /** * Minimum number of rows to display. * @default 1 */ minRows?: string | number; /** * If `true`, the `textarea` will indicate an error. * The prop defaults to the value (`false`) inherited from the parent FormControl component. * @default false */ error?: boolean; /** * If `true`, the textarea will take up the full width of its container. * @default false */ fullWidth?: boolean; /** * Leading adornment for this textarea. */ startDecorator?: React.ReactNode; /** * Trailing adornment for this textarea. */ endDecorator?: React.ReactNode; /** * The size of the component. * @default 'medium' */ size?: 'small' | 'medium' | 'large'; } & TextareaSlotsAndSlotProps; defaultComponent: D; } export type TextareaProps = OverrideProps, D>; export default TextareaProps; export interface TextareaOwnerState extends TextareaProps { /** * If `true`, the textarea is focused. */ focused: boolean; /** * If `true`, the textarea has value. */ filled: boolean; }