import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { SoftStep } from './SoftStep';
function renderSteps(steps, firstStepNumber, headingElement) {
    return steps.map((step, index) => {
        const { className, children, title, status, ...rest } = step;
        return (React.createElement(SoftStep, Object.assign({ className: className, key: index, headingElement: headingElement, step: firstStepNumber + index, title: title, status: status }, rest), children));
    });
}
export const SoftSteps = ({ className, firstStepNumber, headingElement, steps, ...rest }) => {
    const classes = classNames('softSteps', className);
    return (React.createElement("div", Object.assign({ className: classes }, rest), renderSteps(steps, firstStepNumber, headingElement)));
};
const stepPropType = PropTypes.shape({
    title: PropTypes.string.isRequired,
    children: PropTypes.node
});
// @ts-ignore
SoftSteps.propTypes = {
    className: PropTypes.string,
    /**
     * The number the steps should begin from
     */
    firstStepNumber: PropTypes.number,
    /**
     * The HTML tag used for the title
     */
    headingElement: PropTypes.string,
    /**
     * An array of individual step objects
     */
    steps: PropTypes.arrayOf(stepPropType).isRequired,
};
// @ts-ignore
SoftSteps.defaultProps = {
    firstStepNumber: 1,
    headingElement: 'p'
};
//# sourceMappingURL=SoftSteps.js.map