import { _ as __assign } from '../tslib.es6-20a2a300.js';
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
import * as React from 'react';
import React__default from 'react';
import StepLabel from '../components/StepLabel.js';
import StepLabelText from '../components/StepLabelText.js';
import Stepper from '../components/Stepper.js';
import Button from '../components/Button.js';
import Typography from '../components/Typography.js';
import { d as _objectWithoutProperties, b as _extends, w as reactIs, P as PropTypes } from '../defaultTheme-49a26576.js';
import { c as clsx } from '../clsx.m-6243b874.js';
import { a as withStyles } from '../withStyles-99aeb25b.js';
import { B as Box } from '../Box-581dc061.js';
import '../styled-components.esm-a98d7870.js';
import '../hoist-non-react-statics.cjs-b718ab87.js';
import '../components/StepIcon.js';
import '../components/Icon.js';
import '../icons/ArrowRight.js';
import '../icons/ArrowRightCircle.js';
import '../icons/Check.js';
import '../icons/CheckCircle.js';
import '../icons/ChevronRight.js';
import '../icons/CrossCircle.js';
import '../icons/DollarSign.js';
import '../icons/InfoCircle.js';
import '../icons/Link.js';
import '../icons/TriangleUp.js';
import '../icons/TriangleDown.js';
import '../icons/TriangleLeft.js';
import '../icons/Copy.js';
import '../icons/SortUp.js';
import '../icons/Cross.js';
import '../icons/Search.js';
import '../icons/Range.js';
import '../theme/colors.js';
import '../makeStyles-c9a99c7a.js';
import '../_commonjsHelpers-57e89916.js';
import '../theme/fontSize.js';
import '../theme/fontWeight.js';
import '../theme/fontFamily.js';
import '../theme/lineHeight.js';
import '../Typography-649a8eff.js';
import '../capitalize-5d3e9aac.js';
import '../createSvgIcon-6fb7d1b7.js';
import '../StepConnector-396bef63.js';
import '../Paper-cfd8f963.js';
import '../createStyles-16423e9e.js';
import '../ButtonBase-11d3cdb5.js';
import 'react-dom';
import '../useForkRef-4ff8cc89.js';
import '../useEventCallback-8817ed1c.js';
import '../deprecatedPropType-0232df1e.js';
import '../useIsFocusVisible-c048447c.js';
import '../TransitionGroupContext-2ba64e99.js';
import '../refType-5cc24a92.js';
import '../elementTypeAcceptingRef-7677eeee.js';
import '../styled-339d0187.js';

var styles = {
  /* Styles applied to the root element. */
  root: {},

  /* Styles applied to the root element if `orientation="horizontal"`. */
  horizontal: {
    paddingLeft: 8,
    paddingRight: 8
  },

  /* Styles applied to the root element if `orientation="vertical"`. */
  vertical: {},

  /* Styles applied to the root element if `alternativeLabel={true}`. */
  alternativeLabel: {
    flex: 1,
    position: 'relative'
  },

  /* Pseudo-class applied to the root element if `completed={true}`. */
  completed: {}
};
var Step = /*#__PURE__*/React.forwardRef(function Step(props, ref) {
  var _props$active = props.active,
      active = _props$active === void 0 ? false : _props$active,
      alternativeLabel = props.alternativeLabel,
      children = props.children,
      classes = props.classes,
      className = props.className,
      _props$completed = props.completed,
      completed = _props$completed === void 0 ? false : _props$completed,
      connectorProp = props.connector,
      _props$disabled = props.disabled,
      disabled = _props$disabled === void 0 ? false : _props$disabled,
      _props$expanded = props.expanded,
      expanded = _props$expanded === void 0 ? false : _props$expanded,
      index = props.index,
      last = props.last,
      orientation = props.orientation,
      other = _objectWithoutProperties(props, ["active", "alternativeLabel", "children", "classes", "className", "completed", "connector", "disabled", "expanded", "index", "last", "orientation"]);

  var connector = connectorProp ? /*#__PURE__*/React.cloneElement(connectorProp, {
    orientation: orientation,
    alternativeLabel: alternativeLabel,
    index: index,
    active: active,
    completed: completed,
    disabled: disabled
  }) : null;
  var newChildren = /*#__PURE__*/React.createElement("div", _extends({
    className: clsx(classes.root, classes[orientation], className, alternativeLabel && classes.alternativeLabel, completed && classes.completed),
    ref: ref
  }, other), connector && alternativeLabel && index !== 0 ? connector : null, React.Children.map(children, function (child) {
    if (! /*#__PURE__*/React.isValidElement(child)) {
      return null;
    }

    if (process.env.NODE_ENV !== 'production') {
      if (reactIs.exports.isFragment(child)) {
        console.error(["Material-UI: The Step component doesn't accept a Fragment as a child.", 'Consider providing an array instead.'].join('\n'));
      }
    }

    return /*#__PURE__*/React.cloneElement(child, _extends({
      active: active,
      alternativeLabel: alternativeLabel,
      completed: completed,
      disabled: disabled,
      expanded: expanded,
      last: last,
      icon: index + 1,
      orientation: orientation
    }, child.props));
  }));

  if (connector && !alternativeLabel && index !== 0) {
    return /*#__PURE__*/React.createElement(React.Fragment, null, connector, newChildren);
  }

  return newChildren;
});
process.env.NODE_ENV !== "production" ? Step.propTypes = {
  // ----------------------------- Warning --------------------------------
  // | These PropTypes are generated from the TypeScript type definitions |
  // |     To update them edit the d.ts file and run "yarn proptypes"     |
  // ----------------------------------------------------------------------

  /**
   * Sets the step as active. Is passed to child components.
   */
  active: PropTypes.bool,

  /**
   * Should be `Step` sub-components such as `StepLabel`, `StepContent`.
   */
  children: PropTypes.node,

  /**
   * Override or extend the styles applied to the component.
   * See [CSS API](#css) below for more details.
   */
  classes: PropTypes.object,

  /**
   * @ignore
   */
  className: PropTypes.string,

  /**
   * Mark the step as completed. Is passed to child components.
   */
  completed: PropTypes.bool,

  /**
   * Mark the step as disabled, will also disable the button if
   * `StepButton` is a child of `Step`. Is passed to child components.
   */
  disabled: PropTypes.bool,

  /**
   * Expand the step.
   */
  expanded: PropTypes.bool
} : void 0;
var Step$1 = withStyles(styles, {
  name: 'MuiStep'
})(Step);

var argTypes = {
    disabled: { table: { disable: true } },
    component: { table: { disable: true } },
    ref: { table: { disable: true } }
};
var getSteps = function () {
    return ["Stake amount", "Review and sign", "Sign and broadcast", "Tx broadcasted"];
};
var Template = function (args) {
    var _a = React__default.useState(0), activeStep = _a[0], setActiveStep = _a[1];
    var steps = getSteps();
    var handleNext = function () {
        setActiveStep(function (prevActiveStep) { return prevActiveStep + 1; });
    };
    var handleBack = function () {
        setActiveStep(function (prevActiveStep) { return prevActiveStep - 1; });
    };
    var handleReset = function () {
        setActiveStep(0);
    };
    return (jsxs(Fragment, { children: [jsx(Stepper, __assign({ activeStep: activeStep }, { children: steps.map(function (label, index) { return (jsx(Step$1, { children: jsxs(StepLabel, { children: [jsxs(StepLabelText, __assign({ subtitle: true }, { children: ["Step ", index + 1] }), void 0), jsx(StepLabelText, { children: label }, void 0)] }, void 0) }, label)); }) }), void 0), activeStep !== steps.length && (jsxs(Box, { children: [jsx(Button, __assign({ color: "secondary", size: "small", disabled: activeStep === 0, onClick: handleBack }, { children: "Back" }), void 0), jsx(Button, __assign({ color: "primary", size: "small", variant: "contained", onClick: handleNext }, { children: activeStep === steps.length - 1 ? "Finish" : "Next" }), void 0)] }, void 0)), activeStep === steps.length && (jsxs(Box, { children: [jsx(Typography, __assign({ variant: "descriptionBold" }, { children: "All steps completed - you're finished" }), void 0), jsx(Button, __assign({ onClick: handleReset, size: "small" }, { children: "Reset" }), void 0)] }, void 0))] }, void 0));
};
var Default = Template.bind({});
var Stepper_stories = {
    title: "Components/Stepper",
    component: Stepper,
    argTypes: argTypes
};

export { Default, Stepper_stories as default };
