// @flow
import PropTypes from 'prop-types';
import type { SpaceProps } from '../../../mixins/spacing';
import { spacePropTypes } from '../../../mixins/spacing';
import type { ContainerProps } from '../../../mixins/container';
import { containerPropTypes } from '../../../mixins/container';

export type ButtonProps = SpaceProps &
  ContainerProps & {
    disabled?: boolean,
    size?: 'sm' | 'md',
    type?: 'submit' | 'button',
    onClick?: (event: SyntheticEvent<HTMLButtonElement>) => void,
    href?: string,
    target?: string,
  };

export const buttonPropTypes = {
  ...spacePropTypes,
  ...containerPropTypes,
  type: PropTypes.oneOf(['submit', 'button']),
  onClick: PropTypes.func,
  href: PropTypes.string,
  target: PropTypes.string,
  disabled: PropTypes.bool,
  size: PropTypes.oneOf(['sm', 'md']),
};
