UNPKG

@bigbinary/neetoui

Version:

neetoUI drives the experience at all neeto products

37 lines (34 loc) 1.38 kB
import React__default from 'react'; import classnames from 'classnames'; var Stepper = function Stepper(_ref) { var steps = _ref.steps, activeIndex = _ref.activeIndex, setActiveIndex = _ref.setActiveIndex; return /*#__PURE__*/React__default.createElement("div", { className: "neeto-ui-stepper__wrapper" }, steps.map(function (_ref2, index) { var id = _ref2.id, label = _ref2.label; return /*#__PURE__*/React__default.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__default.createElement("button", { className: "neeto-ui-stepper-item", "data-cy": "stepper-navigation-button", onClick: function onClick() { return setActiveIndex(index); } }, /*#__PURE__*/React__default.createElement("span", { className: "neeto-ui-stepper-item__stage" }, /*#__PURE__*/React__default.createElement("span", null, id)), /*#__PURE__*/React__default.createElement("span", { className: "neeto-ui-stepper-item__label", "data-text": label }, label))); })); }; export { Stepper as default }; //# sourceMappingURL=Stepper.js.map