// @flow
import type { TranslatedContent } from '../../../../types';
import type { FormFieldError } from '../forms.proptypes';
import type { FocusEvents } from '../../../../mixins/focus';
import type { FontSize } from '../../../../mixins/typography';

export type FormInputProps<ValueType> = {|
  ...FocusEvents,
  id?: string,
  name?: string,
  type?: 'date' | 'email' | 'number' | 'text' | 'password', // these types for now
  placeholder?: ValueType | TranslatedContent,
  value?: ?ValueType,
  disabled?: boolean,
  error?: FormFieldError,
  focusOnMount?: boolean,
  fontSize?: FontSize,
  large?: boolean,
  iconType?: 'lock' | 'error' | 'checkmark',
  iconPosition?: 'left' | 'right',
  buttonText?: TranslatedContent,
  onChange: (ValueType, SyntheticInputEvent<HTMLInputElement>) => void,
  onRef?: (HTMLInputElement) => void,
  buttonPress?: () => void,
  inputMode?: string,
  hideBorder?: boolean,
  label?: TranslatedContent,
  'aria-describedby'?: string,
  floatLabel?: boolean,

  /* Required for a11y if type="password" */
  hideValueButtonLabel?: TranslatedContent,
  revealValueButtonLabel?: TranslatedContent,
|};
