import React from "react"; import { MarginProps } from "styled-system"; import { IconType } from "../icon"; import { ValidationProps } from "../../__internal__/validations"; import { TagProps } from "../../__internal__/utils/helpers/tags"; import { CommonInputProps } from "../../__internal__/legacy-input"; import { BorderRadiusType } from "../box/box.component"; export declare const parseValueUnit: (str: string) => number; export declare const getDefaultMinHeightBySize: (size: "small" | "medium" | "large") => number; export interface TextareaProps extends ValidationProps, MarginProps, Omit, TagProps { /** Prop to specify the aria-labelledby property of the component */ "aria-labelledby"?: string; /** id of the input */ id?: string; /** * @deprecated Breakpoint for adaptive label (inline labels change to top aligned). Enables the adaptive behaviour when set. This property is deprecated and will be removed in future versions. **/ adaptiveLabelBreakpoint?: number; /** Automatically focus the input on component mount */ autoFocus?: boolean; /** Character limit of the textarea */ characterLimit?: number; /** Type of the icon that will be rendered next to the input */ children?: React.ReactNode; /** If true, the component will be disabled */ disabled?: boolean; /** * Indicate that error has occurred. * Pass string to display icon, tooltip and red border. * Pass true boolean to only display red border. */ error?: boolean | string; /** Allows the Textareas Height to change based on user input */ expandable?: boolean; /** Specifies the number of visible text lines. When set, the textarea expands up to this maximum height. */ maxRows?: number; /** A hint string rendered before the input but after the label. Intended to describe the purpose or content of the input. */ inputHint?: string; /** @deprecated [Legacy] Help content to be displayed under an input. This property is deprecated and will be removed in future versions. */ fieldHelp?: React.ReactNode; /** @deprecated [Legacy] Aria label for rendered help component. This property is deprecated and will be removed in future versions. */ helpAriaLabel?: string; /** * @deprecated [Legacy] Indicate additional information. * Pass string to display icon, tooltip and blue border. * Pass true boolean to only display blue border. * This property is deprecated and will be removed in future versions. */ info?: boolean | string; /** * List of supported icons * * Icon to display inside of the Textarea */ inputIcon?: IconType; /** @deprecated [Legacy] Width of an input in percentage. Works only when labelInline is true. This property is deprecated and will be removed in future versions. */ inputWidth?: number; /** * Prop for specifying the max width of the input. * Leaving the `maxWidth` prop with no value will default the width to '100%' */ maxWidth?: string; /** The content of the label for the input */ label?: string; /** @deprecated Label alignment. This property is deprecated and will be removed in future versions. */ labelAlign?: "left" | "right"; /** * @deprecated [Legacy] Text applied to label help tooltip. When opted into new design validations * it will render as a hint above the input, unless an `inputHint` * prop is also passed. This property is deprecated and will be removed in future versions. */ labelHelp?: React.ReactNode; /** When true, label is placed in line an input */ labelInline?: boolean; /** @deprecated [Legacy] Spacing between label and a field for inline label, given number will be multiplied by base spacing unit (8). This property is deprecated and will be removed in future versions. */ labelSpacing?: 1 | 2; /** @deprecated [Legacy] Width of a label in percentage. Works only when labelInline is true. This property is deprecated and will be removed in future versions. */ labelWidth?: number; /** Name of the input */ name?: string; /** Callback fired when the user types in the Textarea */ onChange: (ev: React.ChangeEvent) => void; /** Placeholder text for the component */ placeholder?: string; /** Adds readOnly property */ readOnly?: boolean; /** * @deprecated [Legacy] Flag to configure component as optional. If the value of this component is not required, use the `required` prop and set it to false instead. This property is deprecated and will be removed in future versions. */ isOptional?: boolean; /** The number of visible text lines for the control. When set, this determines the height of the textarea, and the minHeight property is ignored. */ rows?: number; /** @deprecated [Legacy] Overrides the default tooltip position. This property is deprecated and will be removed in future versions. */ tooltipPosition?: "top" | "bottom" | "left" | "right"; /** @deprecated [Legacy] When true, validation icon will be placed on label instead of being placed on the input. This property is deprecated and will be removed in future versions. */ validationOnLabel?: boolean; /** The value of the Textbox */ value: string; /** * Indicate that warning has occurred. * Pass string to display icon, tooltip and orange border. * Pass true boolean to only display orange border. */ warning?: boolean | string; /** @deprecated Specify a custom border radius for the component. Any valid border-radius design token, or an array of border-radius design tokens. This property is deprecated and will be removed in future versions.*/ borderRadius?: BorderRadiusType | BorderRadiusType[]; /** @deprecated Hides the borders for the component. Please note that validation and focus styling will still be applied. This property is deprecated and will be removed in future versions. */ hideBorders?: boolean; /** Specify the minimum height. This property is only applied if rows is not set. */ minHeight?: number; /** Render the ValidationMessage above the Textarea when validationRedesignOptIn flag is set */ validationMessagePositionTop?: boolean; /** @deprecated Override the variant component. This property is deprecated and will be removed in future versions. */ as?: CommonInputProps["as"]; /** Specify the resize behavior of the textarea */ resize?: "none" | "both" | "horizontal" | "vertical"; /** Size of the textarea. */ size?: "small" | "medium" | "large"; } export declare const Textarea: React.ForwardRefExoticComponent>; export { Textarea as OriginalTextarea }; export default Textarea;