UNPKG

@pantheon-systems/design-toolkit-react

Version:
36 lines (33 loc) 1.15 kB
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray'; import PropTypes from 'prop-types'; import { jsx } from 'react/jsx-runtime'; var LINE_STYLES = 'relative grow h-0.5 m-0 leading-none'; var LineBar = function LineBar(_ref) { var isActive = _ref.isActive, isComplete = _ref.isComplete, steps = _ref.steps; if (!isActive) return /*#__PURE__*/jsx("div", { "aria-hidden": "true", className: "".concat(LINE_STYLES, " ").concat(isComplete ? 'bg-green-3' : 'bg-gray-3') }); var stepLines = _toConsumableArray(steps.values()).map(function (step, i) { return /*#__PURE__*/jsx("div", { "aria-hidden": "true", className: "".concat(LINE_STYLES, " ").concat(step.isComplete ? 'bg-green-3' : 'bg-gray-3') // eslint-disable-next-line react/no-array-index-key }, i); }); return stepLines; }; LineBar.propTypes = { isActive: PropTypes.bool, isComplete: PropTypes.bool, steps: PropTypes.instanceOf(Map).isRequired }; LineBar.defaultProps = { isActive: false, isComplete: false }; var LineBar$1 = LineBar; export { LineBar$1 as default }; //# sourceMappingURL=LineBar.js.map