function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

import * as React from 'react';
import classNames from 'classnames';
import { createUseStyles } from '@fluent-ui/styles';
import { styles } from './Button.styled';
import { ButtonPropTypes } from './Button.type';
export const name = 'Button';
const useStyles = createUseStyles(styles, {
  name
});
const Button = React.forwardRef((props, ref) => {
  const {
    as: Component = 'button',
    className: classNameProp,
    onClick,
    children,
    variant = 'standard',
    disabled,
    size,
    block = false,
    ...rest
  } = props;
  const classes = useStyles(props);
  const className = classNames(classes.root, {
    [classes.variantStandard]: variant === 'standard',
    [classes.variantPrimary]: variant === 'primary',
    [classes.sizeSmall]: size === 'small',
    [classes.sizeMedium]: size === 'medium',
    [classes.sizeLarge]: size === 'large',
    [classes.block]: block
  }, classNameProp);
  return React.createElement(Component, _extends({
    className: className,
    ref: ref,
    onClick: onClick,
    disabled: disabled
  }, rest), children);
});
Button.displayName = `F${name}`;
Button.propTypes = ButtonPropTypes;
Button.defaultProps = {
  variant: 'standard'
};
export default Button;