"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require$$0 = require("react/jsx-runtime");
const designSystem = require("@choiceform/design-system");
const React = require("react");
const index = require("../../../../i18n/index.cjs");
const tv = require("./tv.cjs");
const promptInputContext = require("../../context/prompt-input-context.cjs");
const PromptTextArea = React.memo(function PromptTextArea2(props) {
  const { className, children, ...rest } = props;
  const {
    contextInputRef,
    inputValue,
    placeholder,
    mentionTriggers,
    mentionPrefix,
    minHeight,
    variant,
    size,
    handleInputChange,
    handleKeyDown,
    handleCompositionStart,
    handleCompositionEnd,
    onMentionSelect,
    setIsInputFocused
  } = promptInputContext.usePromptInputContext();
  const inputPlaceholder = index.t("prompt-input", "input-placeholder");
  const tv$1 = tv.promptTextAreaTv({ size });
  return /* @__PURE__ */ require$$0.jsx(
    designSystem.ContextInput,
    {
      className: tv$1.input({ className }),
      ref: contextInputRef,
      value: inputValue,
      placeholder: placeholder ?? inputPlaceholder,
      mentionPrefix,
      triggers: mentionTriggers,
      minHeight,
      variant,
      size,
      onChange: handleInputChange,
      onKeyDown: handleKeyDown,
      onCompositionStart: handleCompositionStart,
      onCompositionEnd: handleCompositionEnd,
      onMentionSelect,
      onFocus: () => setIsInputFocused(true),
      onBlur: () => setIsInputFocused(false),
      ...rest,
      children: children && /* @__PURE__ */ require$$0.jsx(designSystem.ContextInput.Footer, { className: tv$1.footer(), children })
    }
  );
});
exports.PromptTextArea = PromptTextArea;
//# sourceMappingURL=prompt-text-area.cjs.map
