import * as React from "react";
import PropTypes from "prop-types";
import { compose } from "recompose";
import disabledTooltip, {
  disabledTooltipProps
} from "@crave/farmblocks-hoc-disabled-tooltip";
import formInput, { formInputProps } from "@crave/farmblocks-hoc-input";
import withMessages, {
  withMessagesProps
} from "@crave/farmblocks-hoc-validation-messages";

import Container from "./styledComponents/TextInput";
const EnhancedInput = compose(disabledTooltip, withMessages, formInput)(
  "input"
);

const TextInput = props => (
  <Container>
    <EnhancedInput {...props} displayBlock />
  </Container>
);

TextInput.propTypes = {
  ...disabledTooltipProps,
  ...formInputProps,
  ...withMessagesProps,

  type: PropTypes.string,
  placeholder: PropTypes.string,
  required: PropTypes.bool
  // and any other properties to forward to the html input element...
};

TextInput.defaultProps = {
  type: "text",
  tooltipText: "This field is disabled."
};

export default TextInput;

@@ -419,16 +419,88 @@
 Input%22;%0A
+import protectedValue, %7B protectedValueProps %7D from %22./protectedValue%22;%0A
 const En
@@ -521,16 +521,19 @@
 compose(
+%0A  
 disabled
@@ -540,16 +540,18 @@
 Tooltip,
+%0A 
  withMes
@@ -556,16 +556,36 @@
 essages,
+%0A  protectedValue,%0A 
  formInp
@@ -590,21 +590,18 @@
 nput
+%0A
 )(
-%0A  
 %22input%22
-%0A
 );%0A%0A
@@ -755,24 +755,24 @@
 oltipProps,%0A
-
   ...formInp
@@ -776,24 +776,50 @@
 InputProps,%0A
+  ...protectedValueProps,%0A
   ...withMes

support for new properties related with protected fields