import {
  InputSubtext,
  Label,
  textInputStyle
} from "./chunk-FTMB6R72.js";

// src/components/TextArea.tsx
import styled from "@emotion/styled";
import { Fragment } from "react";
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
var defaultProps = {
  disabled: false
};
function TextArea({
  value,
  onChange,
  label,
  error,
  placeholder,
  id,
  hint,
  disabled = defaultProps.disabled,
  minHeight,
  readOnly = false
}) {
  return /* @__PURE__ */ jsxs(Fragment, { children: [
    label && /* @__PURE__ */ jsx(Label, { children: label }),
    /* @__PURE__ */ jsx(
      StyledTextArea,
      {
        id,
        value,
        minHeight,
        onChange: (event) => {
          onChange(event.target.value, event);
        },
        disabled,
        hasError: Boolean(error),
        placeholder,
        readOnly
      }
    ),
    /* @__PURE__ */ jsx(InputSubtext, { text: error || hint })
  ] });
}
var StyledTextArea = styled.textarea`
  ${textInputStyle}
  resize: none;
  min-height: ${({ minHeight }) => typeof minHeight === "number" ? `${minHeight}px` : "initial"};
`;

export {
  TextArea
};
