import { j as jsxRuntimeExports } from '../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js';
import { InfoCircledIcon } from '../../node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js';
import { Tooltip } from '../tooltip/tooltip.js';
import { cx, cva } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
import * as React from 'react';
import { clsx } from '../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js';
import styles from './text-area.module.css.js';

const textArea = cva(styles.textarea, {
    variants: {
        error: {
            true: styles.error
        }
    }
});
const TextArea = React.forwardRef(({ className, style, label, required, infoTooltip, helperText, error, disabled, width = "100%", value, onChange, ...props }, ref) => {
    return (jsxRuntimeExports.jsxs("div", { className: styles.container, style: { width }, children: [label && (jsxRuntimeExports.jsxs("div", { className: styles.labelContainer, children: [jsxRuntimeExports.jsxs("label", { className: clsx(styles.label, disabled && styles.labelDisabled), children: [label, !required && jsxRuntimeExports.jsx("span", { className: styles.optional, children: "(optional)" })] }), infoTooltip && (jsxRuntimeExports.jsx(Tooltip, { message: infoTooltip, side: "right", children: jsxRuntimeExports.jsx("span", { className: styles.helpIcon, children: jsxRuntimeExports.jsx(InfoCircledIcon, {}) }) }))] })), jsxRuntimeExports.jsx("textarea", { className: cx(textArea({ error }), disabled && styles.disabled, className), ref: ref, value: value, onChange: onChange, required: required, disabled: disabled, ...props }), helperText && (jsxRuntimeExports.jsx("span", { className: clsx(styles.helperText, error && styles.helperTextError, disabled && styles.helperTextDisabled), children: helperText }))] }));
});
TextArea.displayName = "TextArea";

export { TextArea };
//# sourceMappingURL=text-area.js.map
