'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

var React = require('react');
var React__default = _interopDefault(React);
var PropTypes = _interopDefault(require('prop-types'));
var __chunk_1 = require('../../chunk-f817ce38.js');
var __chunk_3 = require('../../chunk-6d243953.js');
require('../../chunk-2b268ae7.js');

var styles = (function (theme) {
  var palette = theme.palette;


  return {
    background: {
      borderRadius: '3px',
      backgroundColor: palette.grey60
    },

    progressBar: {
      height: '4px',
      borderRadius: '3px',
      transition: '0.4s linear',
      transitionProperty: 'width',
      width: function width(_ref) {
        var currentStep = _ref.currentStep,
            totalSteps = _ref.totalSteps;

        var percentage = Math.min(1, Math.max(0, (currentStep - 1) / (totalSteps - 1))) * 100;
        return percentage + '%';
      },
      backgroundColor: palette.grey90
    },

    '@keyframes progressAnimation': {
      '0%': {
        width: '5%'
      },
      '100%': {
        width: '85%'
      }
    }
  };
});

var ProgressBar = function ProgressBar(_ref) {
  var classes = _ref.classes,
      className = _ref.className,
      currentStep = _ref.currentStep,
      totalSteps = _ref.totalSteps,
      rest = __chunk_3.objectWithoutProperties(_ref, ['classes', 'className', 'currentStep', 'totalSteps']);
  return React__default.createElement(
    'div',
    __chunk_3._extends({ className: classes.container }, rest),
    React__default.createElement(
      'div',
      { className: __chunk_1.classNames(classes.background, className) },
      React__default.createElement('div', { className: classes.progressBar })
    )
  );
};

ProgressBar.propTypes = {
  classes: PropTypes.object,
  className: PropTypes.string,
  currentStep: PropTypes.number,
  totalSteps: PropTypes.number
};

var ProgressBar$1 = __chunk_1.withNano(styles)(ProgressBar);

module.exports = ProgressBar$1;
//# sourceMappingURL=index.js.map
