import { TextareaInput, TextInput } from "@contember/ui";
import { useFieldControl } from "./useFieldControl.js";
import { jsxDEV } from "react/jsx-dev-runtime";
import { SimpleRelativeSingleField } from "../auxiliary/SimpleRelativeSingleField/SimpleRelativeSingleField.js";
var _jsxFileName = "/__w/interface/interface/packages/admin/src/components/bindingFacade/fields/TextField.tsx";
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__ */ jsxDEV(TextareaInput, {
    ...inputProps
  }, void 0, false, {
    fileName: _jsxFileName,
    lineNumber: 45,
    columnNumber: 6
  }, void 0) : /* @__PURE__ */ jsxDEV(TextInput, {
    ...inputProps
  }, void 0, false, {
    fileName: _jsxFileName,
    lineNumber: 46,
    columnNumber: 6
  }, void 0);
}, "TextField");
export {
  TextField
};
//# sourceMappingURL=TextField.js.map
