'use strict';

var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
var reactIcons_esm = require('../../node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.cjs');
var tooltip = require('../tooltip/tooltip.cjs');
var index = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
var React = require('react');
var clsx = require('../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.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, infoTooltip, helperText, error, disabled, width = "100%", 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.jsxs("label", { className: clsx.clsx(textArea_module.default.label, disabled && textArea_module.default.labelDisabled), children: [label, !required && jsxRuntime.jsxRuntimeExports.jsx("span", { className: textArea_module.default.optional, children: "(optional)" })] }), infoTooltip && (jsxRuntime.jsxRuntimeExports.jsx(tooltip.Tooltip, { message: infoTooltip, side: "right", children: jsxRuntime.jsxRuntimeExports.jsx("span", { className: textArea_module.default.helpIcon, children: jsxRuntime.jsxRuntimeExports.jsx(reactIcons_esm.InfoCircledIcon, {}) }) }))] })), jsxRuntime.jsxRuntimeExports.jsx("textarea", { className: index.cx(textArea({ error }), disabled && textArea_module.default.disabled, className), ref: ref, value: value, onChange: onChange, required: required, disabled: disabled, ...props }), helperText && (jsxRuntime.jsxRuntimeExports.jsx("span", { className: clsx.clsx(textArea_module.default.helperText, error && textArea_module.default.helperTextError, disabled && textArea_module.default.helperTextDisabled), children: helperText }))] }));
});
TextArea.displayName = "TextArea";

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