import { j as jsxRuntimeExports } from '../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js';
import * as React from 'react';
import { cx, cva } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.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, helperText, error, width = "200px", value, onChange, ...props }, ref) => {
    return (jsxRuntimeExports.jsxs("div", { className: styles.container, style: { width }, children: [label && (jsxRuntimeExports.jsxs("div", { className: styles.labelContainer, children: [jsxRuntimeExports.jsx("label", { className: styles.label, children: label }), !required && jsxRuntimeExports.jsx("span", { className: styles.optional, children: "(optional)" })] })), jsxRuntimeExports.jsx("textarea", { className: cx(textArea({ error }), className), ref: ref, value: value, onChange: onChange, required: required, ...props }), helperText && jsxRuntimeExports.jsx("span", { className: styles.helperText, children: helperText })] }));
});
TextArea.displayName = "TextArea";

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