import "core-js/modules/es6.object.assign";
import "core-js/modules/web.dom.iterable";
import "core-js/modules/es6.array.iterator";
import "core-js/modules/es6.object.keys";

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); }

function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }

import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { EuiScreenReaderOnly } from '../accessibility';
import { EuiTitle } from '../title';
import { STATUS, EuiStepNumber } from './step_number';
export var EuiStep = function EuiStep(_ref) {
  var className = _ref.className,
      children = _ref.children,
      headingElement = _ref.headingElement,
      step = _ref.step,
      title = _ref.title,
      status = _ref.status,
      rest = _objectWithoutProperties(_ref, ["className", "children", "headingElement", "step", "title", "status"]);

  var classes = classNames('euiStep', className);
  var screenReaderPrefix;

  if (status === 'incomplete') {
    screenReaderPrefix = 'Incomplete';
  }

  return React.createElement("div", _extends({
    className: classes
  }, rest), React.createElement(EuiScreenReaderOnly, null, React.createElement("span", null, screenReaderPrefix, " Step ")), React.createElement(EuiStepNumber, {
    className: "euiStep__circle",
    number: step,
    status: status,
    isHollow: status === 'incomplete'
  }), React.createElement(EuiTitle, {
    size: "s",
    className: "euiStep__title"
  }, React.createElement(headingElement, null, title)), React.createElement("div", {
    className: "euiStep__content"
  }, children));
};
EuiStep.propTypes = {
  children: PropTypes.node.isRequired,

  /**
   * Will replace the number provided in props.step with alternate styling.
   * Options: `complete`, `incomplete`, `warning`, `danger`, `disabled`
   */
  status: PropTypes.oneOf(STATUS),

  /**
   * The number of the step in the list of steps
   */
  step: PropTypes.number.isRequired,
  title: PropTypes.string.isRequired,

  /**
   * The HTML tag used for the title
   */
  headingElement: PropTypes.string.isRequired
};
EuiStep.defaultProps = {
  headingElement: 'p'
};
EuiStep.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "EuiStep",
  "props": {
    "headingElement": {
      "defaultValue": {
        "value": "'p'",
        "computed": false
      },
      "type": {
        "name": "string"
      },
      "required": false,
      "description": "The HTML tag used for the title"
    },
    "children": {
      "type": {
        "name": "node"
      },
      "required": true,
      "description": ""
    },
    "status": {
      "type": {
        "name": "enum",
        "computed": true,
        "value": "STATUS"
      },
      "required": false,
      "description": "Will replace the number provided in props.step with alternate styling.\nOptions: `complete`, `incomplete`, `warning`, `danger`, `disabled`"
    },
    "step": {
      "type": {
        "name": "number"
      },
      "required": true,
      "description": "The number of the step in the list of steps"
    },
    "title": {
      "type": {
        "name": "string"
      },
      "required": true,
      "description": ""
    }
  }
};