UNPKG

@bigbinary/neetoui

Version:

neetoUI drives the experience at all neeto products

39 lines (35 loc) 1.33 kB
'use strict'; var React = require('react'); var classnames = require('classnames'); var Stepper = function Stepper(_ref) { var steps = _ref.steps, activeIndex = _ref.activeIndex, setActiveIndex = _ref.setActiveIndex; return /*#__PURE__*/React.createElement("div", { className: "neeto-ui-stepper__wrapper" }, steps.map(function (_ref2, index) { var id = _ref2.id, label = _ref2.label; return /*#__PURE__*/React.createElement("div", { "data-testid": "stepper-item-".concat(id), key: id, className: classnames("neeto-ui-stepper-item__wrapper", { "neeto-ui-stepper-item__wrapper--active": index === activeIndex, "neeto-ui-stepper-item__wrapper--done": index < activeIndex }) }, /*#__PURE__*/React.createElement("button", { className: "neeto-ui-stepper-item", "data-cy": "stepper-navigation-button", onClick: function onClick() { return setActiveIndex(index); } }, /*#__PURE__*/React.createElement("span", { className: "neeto-ui-stepper-item__stage" }, /*#__PURE__*/React.createElement("span", null, id)), /*#__PURE__*/React.createElement("span", { className: "neeto-ui-stepper-item__label", "data-text": label }, label))); })); }; module.exports = Stepper; //# sourceMappingURL=Stepper.js.map