'use strict';

var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
var React = require('react');
var index = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
var textArea_module = require('./text-area.module.css.cjs');

function _interopNamespaceDefault(e) {
    var n = Object.create(null);
    if (e) {
        Object.keys(e).forEach(function (k) {
            if (k !== 'default') {
                var d = Object.getOwnPropertyDescriptor(e, k);
                Object.defineProperty(n, k, d.get ? d : {
                    enumerable: true,
                    get: function () { return e[k]; }
                });
            }
        });
    }
    n.default = e;
    return Object.freeze(n);
}

var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);

const textArea = index.cva(textArea_module.default.textarea, {
    variants: {
        error: {
            true: textArea_module.default.error
        }
    }
});
const TextArea = React__namespace.forwardRef(({ className, style, label, required, helperText, error, width = "200px", value, onChange, ...props }, ref) => {
    return (jsxRuntime.jsxRuntimeExports.jsxs("div", { className: textArea_module.default.container, style: { width }, children: [label && (jsxRuntime.jsxRuntimeExports.jsxs("div", { className: textArea_module.default.labelContainer, children: [jsxRuntime.jsxRuntimeExports.jsx("label", { className: textArea_module.default.label, children: label }), !required && jsxRuntime.jsxRuntimeExports.jsx("span", { className: textArea_module.default.optional, children: "(optional)" })] })), jsxRuntime.jsxRuntimeExports.jsx("textarea", { className: index.cx(textArea({ error }), className), ref: ref, value: value, onChange: onChange, required: required, ...props }), helperText && jsxRuntime.jsxRuntimeExports.jsx("span", { className: textArea_module.default.helperText, children: helperText })] }));
});
TextArea.displayName = "TextArea";

exports.TextArea = TextArea;
//# sourceMappingURL=text-area.cjs.map
