UNPKG

@neo4j-ndl/react

Version:

React implementation of Neo4j Design System

75 lines (74 loc) 2.97 kB
/** * * Copyright (c) "Neo4j" * Neo4j Sweden AB [http://neo4j.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ import type React from 'react'; import { type ReactNode } from 'react'; import { type CommonProps, type HtmlAttributes, type TooltipObjectProps } from '../_common/types'; /** * * * Types * * */ type TextAreaProps = { /** The label displayed above the textarea */ label?: ReactNode; /** Whether the textarea should take the full available width */ isFluid?: boolean; /** Assistive text displayed below the textarea */ helpText?: string | ReactNode; /** Error message displayed below the textarea. When provided, it overrides `helpText` and shows an error icon */ errorText?: string | ReactNode; /** Size of the textarea */ size?: 'small' | 'medium' | 'large'; /** Whether to display the Optional label next to the field label */ isOptional?: boolean; /** Text displayed in the information tooltip shown next to the label */ moreInformationText?: React.ReactNode; /** Props for the Tooltip component used by the information icon */ tooltipProps?: TooltipObjectProps; /** Whether the textarea is disabled */ isDisabled?: boolean; /** Additional HTML attributes passed to the textarea element */ htmlAttributes?: HtmlAttributes<'textarea'>; /** Aria label for accessibility when no visible label is provided */ ariaLabel?: string; /** Additional class names */ className?: string; /** Additional styles applied to the root element */ style?: React.CSSProperties; /** Whether the textarea is read-only */ isReadOnly?: boolean; /** The current value of the textarea */ value?: React.ComponentPropsWithoutRef<'textarea'>['value']; /** Placeholder text displayed when the textarea is empty */ placeholder?: React.ComponentPropsWithoutRef<'textarea'>['placeholder']; }; /** * * * TextArea Component * * */ export declare const TextArea: ({ label, isFluid, errorText, helpText, isOptional, moreInformationText, size, ariaLabel, tooltipProps, isDisabled, className, isReadOnly, style, value, placeholder, htmlAttributes, ref, ...restProps }: CommonProps<"textarea", TextAreaProps>) => import("react/jsx-runtime").JSX.Element; export {}; //# sourceMappingURL=TextArea.d.ts.map