import PropTypes from "prop-types";
import textBoxAriaProps from "./TextBox.ariaPropTypes";
import tagAttributeProps,{tagAttributePropsName} from "../../propTypes/htmlAttributes.propTypes"
import customClassProps,  {customClassPropName} from "../../propTypes/customClassName.propTypes";
import automationProps, {automationPropsName} from "../../propTypes/automation.propTypes";
import defaultCustomIds from "./TextBox.customIds";
import textBoxConstants from  "./TextBox.constantProps";

export default {

  placeholder : PropTypes.string,
  name : PropTypes.string,
  value : PropTypes.string,
  id : PropTypes.string,

  maxlength : PropTypes.number,
  minlength : PropTypes.number,
  min : PropTypes.number,
  max : PropTypes.number,
  step : PropTypes.number,
  pattern : PropTypes.string,
  required : PropTypes.bool,
  autofocus : PropTypes.bool,
  autocomplete : PropTypes.oneOf(
    [
      'on', 'off'
    ]
  ),

  variant : PropTypes.oneOf(
    [
      textBoxConstants.variant.primary,
      textBoxConstants.variant.secondary,
      textBoxConstants.variant.danger
    ]
  ),
  border : PropTypes.oneOf(
    [
      textBoxConstants.border.bottom,
      textBoxConstants.border.none
    ]
  ),
  type : PropTypes.oneOf(
    [
      textBoxConstants.type.text,
      textBoxConstants.type.number,
      textBoxConstants.type.email,
      textBoxConstants.type.password,
      textBoxConstants.type.url,
      textBoxConstants.type.search
    ]
  ),
  size : PropTypes.oneOf(
    [
      textBoxConstants.size.small,
      textBoxConstants.size.medium,
      textBoxConstants.size.large,
      textBoxConstants.size.stretch
    ]
  ),
  shape : PropTypes.oneOf(
    [
      textBoxConstants.shape.square,
      textBoxConstants.shape.oval
    ]
  ),

  active : PropTypes.bool,
  hovered : PropTypes.bool,
  disabled : PropTypes.bool,
  readonly : PropTypes.bool,

  startIcon : PropTypes.any,
  endIcon : PropTypes.any,

  onClick : PropTypes.func,
  onFocus : PropTypes.func,
  onBlur : PropTypes.func,
  onChange : PropTypes.func,
  onKeyPress : PropTypes.func,
  onKeyUp : PropTypes.func,
  onKeyDown : PropTypes.func,
  onMouseUp : PropTypes.func,
  onMouseDown : PropTypes.func,
  inputRef : PropTypes.func,

  ...textBoxAriaProps,
  ...customClassProps,
  ...automationProps,
  ...tagAttributeProps
  //color
}

export const defaultProps = {

  size : textBoxConstants.size.medium,
  shape : textBoxConstants.shape.square,

  [automationPropsName] : defaultCustomIds,
  [customClassPropName] : {},
  [tagAttributePropsName] : {}
}