"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const ui = require("@contember/ui");
const reactFormFieldsUi = require("@contember/react-form-fields-ui");
const DisplayTextField = reactFormFieldsUi.SimpleRelativeSingleField(
  (fieldMetadata, {
    field: fieldName,
    // ControlStateProps:
    active,
    disabled,
    loading,
    readOnly,
    required,
    focused,
    hovered,
    // ControlDisplayProps:
    className: outerClassName,
    distinction,
    intent,
    scheme,
    size,
    // ValidationStateProps:
    validationState,
    // Rest:
    errors,
    format,
    id,
    name,
    placeholder,
    style,
    type,
    ...props
  }) => {
    const field = fieldMetadata.field;
    const value = format?.(field.value, field) ?? field.value;
    const className = ui.useInputClassName({
      active,
      disabled,
      loading,
      readOnly,
      required,
      focused,
      hovered,
      className: outerClassName,
      distinction,
      intent,
      scheme,
      size,
      validationState
    });
    return /* @__PURE__ */ jsxRuntime.jsx(
      "div",
      {
        "data-id": id,
        "data-invalid": !!errors?.length,
        "data-name": name,
        "data-placeholder": placeholder,
        "data-field": fieldName,
        "data-type": type,
        "data-value": value,
        "data-is-empty": `${!value}`,
        className: className || void 0,
        style,
        ...props,
        children: value ?? placeholder
      }
    );
  },
  "DisplayTextField",
  { suppressErrors: true }
);
exports.DisplayTextField = DisplayTextField;
//# sourceMappingURL=DisplayTextField.cjs.map
