import React from 'react';
import PropTypes from 'prop-types';
import { a as withNano, b as classNames } from '../../chunk-566df01b.js';
import { a as classCallCheck, b as createClass, c as defineProperty, d as inherits, e as objectWithoutProperties, f as possibleConstructorReturn, g as slicedToArray, h as _typeof, i as _extends } from '../../chunk-aad905a2.js';
import '../../chunk-aeb80e51.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 = objectWithoutProperties(_ref, ['classes', 'className', 'currentStep', 'totalSteps']);
  return React.createElement(
    'div',
    _extends({ className: classes.container }, rest),
    React.createElement(
      'div',
      { className: classNames(classes.background, className) },
      React.createElement('div', { className: classes.progressBar })
    )
  );
};

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

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

export default ProgressBar$1;
//# sourceMappingURL=index.js.map
