"use client";
import { jsxs, jsx } from 'react/jsx-runtime';
import { InfoCircledIcon } from '../../node_modules/.pnpm/@radix-ui_react-icons@1.3.2_react@19.1.1/node_modules/@radix-ui/react-icons/dist/react-icons.esm.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 { Tooltip } from '../tooltip/tooltip.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, placeholder, ...props }, ref) => {
    return (jsxs("div", { className: styles.container, style: { width }, children: [label && (jsxs("div", { className: styles.labelContainer, children: [jsxs("label", { className: cx(styles.label, disabled && styles.labelDisabled), children: [label, !required && jsx("span", { className: styles.optional, children: "(optional)" })] }), infoTooltip && (jsx(Tooltip, { message: infoTooltip, side: 'right', children: jsx("span", { className: styles.helpIcon, children: jsx(InfoCircledIcon, {}) }) }))] })), jsx("textarea", { className: cx(textArea({ error }), disabled && styles.disabled, className), ref: ref, value: value, onChange: onChange, required: required, disabled: disabled, placeholder: placeholder, style: style, ...props }), helperText && (jsx("span", { className: cx(styles.helperText, error && styles.helperTextError, disabled && styles.helperTextDisabled), children: helperText }))] }));
});
TextArea.displayName = 'TextArea';

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