import { createElement } from "react";
import { TextareaInput, TextInput } from "@contember/ui";
import { useFieldControl } from "./useFieldControl.js";
import { SimpleRelativeSingleField } from "../auxiliary/SimpleRelativeSingleField/SimpleRelativeSingleField.js";
const parse = (value) => value ?? null;
const format = (value) => value ?? null;
const TextField = SimpleRelativeSingleField((fieldMetadata, {
  allowNewlines,
  label,
  wrapLines,
  ...props
}) => {
  const inputProps = useFieldControl({
    ...props,
    fieldMetadata,
    parse,
    format
  });
  if (allowNewlines || wrapLines) {
    console.warn("Props `allowNewlines` and `wrapLines` are deprecated. Use TextareaField instead.");
  }
  return allowNewlines || wrapLines ? /* @__PURE__ */ createElement(TextareaInput, {
    ...inputProps
  }) : /* @__PURE__ */ createElement(TextInput, {
    ...inputProps
  });
}, "TextField");
export { TextField };
//# sourceMappingURL=TextField.js.map
