UNPKG

@fluentui/react-northstar

Version:
62 lines (61 loc) 3.09 kB
import { Accessibility, TextAreaBehaviorProps } from '@fluentui/accessibility'; import { ComponentEventHandler, FluentComponentStaticProps } from '../../types'; import * as React from 'react'; import * as PropTypes from 'prop-types'; import { UIComponentProps, ChildrenComponentProps } from '../../utils'; export interface TextAreaProps extends UIComponentProps, ChildrenComponentProps { /** Accessibility behavior if overridden by the user. */ accessibility?: Accessibility<TextAreaBehaviorProps>; /** The default value of the text area. */ defaultValue?: string; /** * Called on change. * * @param event - React's original SyntheticEvent. * @param data - All props. */ onChange?: ComponentEventHandler<TextAreaProps>; /** The value of the text area. */ value?: string; /** The text area becomes read-only. */ disabled?: boolean; /** An input can have inverted colors. */ inverted?: boolean; /** A textarea can be resized. */ resize?: 'none' | 'both' | 'horizontal' | 'vertical'; /** A textarea can take the width of its container. */ fluid?: boolean; /** A text area can have error state. */ error?: boolean; /** A text area can be required to be valid. */ required?: boolean; } export declare type TextAreaStylesProps = Required<Pick<TextAreaProps, 'inverted' | 'resize' | 'fluid' | 'disabled' | 'error'>>; export declare const textAreaClassName = "ui-textarea"; /** * A TextArea is a multi-line plan-text editing control. * * @accessibility * For good screen reader experience set `aria-label` or `aria-labelledby` attribute for textarea. * When using maxlength attribute, provide the information about max length in label for screen reader. * @accessibilityIssues * [NVDA - No announcement of maxlength](https://github.com/nvaccess/nvda/issues/7910) * [JAWS - textarea - no announcement of maxlength](https://github.com/FreedomScientific/VFO-standards-support/issues/300) */ export declare const TextArea: (<TExtendedElementType extends React.ElementType<any> = "textarea">(props: React.RefAttributes<HTMLTextAreaElement> & Omit<import("@fluentui/react-bindings").PropsOfElement<TExtendedElementType>, "as" | keyof TextAreaProps> & { as?: TExtendedElementType; } & TextAreaProps) => JSX.Element) & { propTypes?: React.WeakValidationMap<TextAreaProps> & { as: React.Requireable<string | ((props: any, context?: any) => any) | (new (props: any, context?: any) => any)>; }; contextTypes?: PropTypes.ValidationMap<any>; defaultProps?: Partial<TextAreaProps & { as: "textarea"; }>; displayName?: string; readonly __PRIVATE_PROPS?: React.RefAttributes<HTMLTextAreaElement> & Omit<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "key" | keyof React.TextareaHTMLAttributes<HTMLTextAreaElement>> & { ref?: React.Ref<HTMLTextAreaElement>; }, "as" | keyof TextAreaProps> & { as?: "textarea"; } & TextAreaProps; } & FluentComponentStaticProps<TextAreaProps>;