function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }

import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';

/**
 * Renders the bar inside of a progress bar
 */
var ProgressBar = function ProgressBar(_ref) {
  var percent = _ref.percent,
      className = _ref.className,
      children = _ref.children,
      props = _objectWithoutProperties(_ref, ['percent', 'className', 'children']);

  return React.createElement(
    'div',
    Object.assign({
      style: { width: percent + '%' },
      className: classNames('dp-progress__bar', className)
    }, props),
    children
  );
};

ProgressBar.propTypes = {
  /**
   * The type of progress bar to render.
   */
  type: PropTypes.string,
  /**
   * The percentage complete.
   */
  percent: PropTypes.number,
  /**
   * CSS classes to apply to the element.
   */
  className: PropTypes.string,
  /**
   * Children to render.
   */
  children: PropTypes.node
};

ProgressBar.defaultProps = {
  percent: 0,
  type: 'primary',
  className: '',
  children: ''
};

export default ProgressBar;