Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_chunk = require("../chunk-BN4qSVkS.cjs");
const require_styles_fields = require("../styles/fields.cjs");
let _emotion_styled = require("@emotion/styled");
_emotion_styled = require_chunk.__toESM(_emotion_styled);
let react = require("react");
react = require_chunk.__toESM(react);
let _emotion_react_jsx_runtime = require("@emotion/react/jsx-runtime");
//#region src/components/TextArea.tsx
const defaultProps = { disabled: false };
function TextArea({ value, onChange, label, error, placeholder, id, hint, disabled = defaultProps.disabled, minHeight, readOnly = false, resize = "none" }) {
	return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)(react.Fragment, { children: [
		label && /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(require_styles_fields.Label, { children: label }),
		/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(StyledTextArea, {
			id,
			value,
			minHeight,
			resize,
			onChange: (event) => {
				onChange(event.target.value, event);
			},
			disabled,
			hasError: Boolean(error),
			placeholder,
			readOnly
		}),
		/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(require_styles_fields.InputSubtext, { text: error || hint })
	] });
}
const StyledTextArea = _emotion_styled.default.textarea`
  ${require_styles_fields.textInputStyle}
  resize: ${({ resize }) => resize || "none"};
  min-height: ${({ minHeight }) => typeof minHeight === "number" ? `${minHeight}px` : "initial"};
`;
//#endregion
exports.TextArea = TextArea;
