import React from 'react'; import type { TextareaHTMLAttributes } from 'react'; import type { OtherHTMLAttributes, PickPropsWithExceptions } from '@instructure/shared-types'; import type { FormMessage, FormFieldOwnProps } from '@instructure/ui-form-field/latest'; import type { ComponentStyle, Spacing, ThemeOverrideValue } from '@instructure/emotion'; import type { WithDeterministicIdProps } from '@instructure/ui-react-utils'; type TextAreaOwnProps = { label: React.ReactNode; id?: string; /** * sets the font-size for the textarea */ size?: 'small' | 'medium' | 'large'; layout?: 'stacked' | 'inline'; /** * the textarea will expand vertically to fit the height of the content, * unless its content exceeds `maxHeight` */ autoGrow?: boolean; /** * is the textarea resizable (in supported browsers) */ resize?: 'none' | 'both' | 'horizontal' | 'vertical'; /** * a fixed width for the textarea */ width?: string; /** * Initial height for the textarea (if autoGrow is true it will grow vertically) * Accepts CSS units, e.g. '55px' */ height?: string; /** * when autoGrow is true, the textarea will never grow beyond this value */ maxHeight?: number | string; /** * Array of objects with shape: `{ * text: React.ReactNode, * type: One of: ['newError', 'error', 'hint', 'success', 'screenreader-only'] * }` */ messages?: FormMessage[]; inline?: boolean; /** * Html placeholder text to display when the input has no value. This should be hint text, not a label * replacement. */ placeholder?: string; /** * Whether or not to disable the textarea */ disabled?: boolean; /** * Works just like disabled but keeps the same styles as if it were active */ readOnly?: boolean; /** * Sets the required property on the underlying native textArea */ required?: boolean; /** * a function that provides a reference to the actual textarea element */ textareaRef?: (textarea: HTMLTextAreaElement | null) => void; /** * value to set on initial render */ defaultValue?: string; /** * the selected value (must be accompanied by an `onChange` prop) */ value?: string; /** * when used with the `value` prop, the component will not control its own state */ onChange?: (event: React.ChangeEvent) => void; /** * Margin around the component. Accepts a `Spacing` token. See token values and example usage in [this guide](https://instructure.design/#layout-spacing). */ margin?: Spacing; }; type PropKeys = keyof TextAreaOwnProps; type AllowedPropKeys = Readonly>; type TextAreaProps = PickPropsWithExceptions & TextAreaOwnProps & { themeOverride?: ThemeOverrideValue; } & OtherHTMLAttributes> & WithDeterministicIdProps; type TextAreaStyle = ComponentStyle<'textArea' | 'textAreaLayout'>; declare const allowedProps: AllowedPropKeys; export type { TextAreaProps, TextAreaStyle }; export { allowedProps }; //# sourceMappingURL=props.d.ts.map