"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EuiTourStepIndicator = void 0; var _propTypes = _interopRequireDefault(require("prop-types")); var _react = _interopRequireDefault(require("react")); var _classnames = _interopRequireDefault(require("classnames")); var _react2 = require("@emotion/react"); var _icon = require("../icon"); var _i18n = require("../i18n"); var _excluded = ["className", "number", "status"]; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License * 2.0 and the Server Side Public License, v 1; you may not use this file except * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ var _ref = process.env.NODE_ENV === "production" ? { name: "1v4nm53-EuiTourStepIndicator", styles: "display:inline-block;label:EuiTourStepIndicator;" } : { name: "1v4nm53-EuiTourStepIndicator", styles: "display:inline-block;label:EuiTourStepIndicator;", toString: _EMOTION_STRINGIFIED_CSS_ERROR__ }; var EuiTourStepIndicator = function EuiTourStepIndicator(_ref2) { var className = _ref2.className, number = _ref2.number, status = _ref2.status, rest = _objectWithoutProperties(_ref2, _excluded); var classes = (0, _classnames.default)('euiTourStepIndicator', className); var indicatorIcon; if (status === 'active') { indicatorIcon = (0, _react2.jsx)(_i18n.EuiI18n, { token: "euiTourStepIndicator.isActive", default: "active" }, function (isActive) { return (0, _react2.jsx)(_icon.EuiIcon, { type: "dot", "aria-label": isActive, color: "success", "aria-current": "step" }); }); } else if (status === 'complete') { indicatorIcon = (0, _react2.jsx)(_i18n.EuiI18n, { token: "euiTourStepIndicator.isComplete", default: "complete" }, function (isComplete) { return (0, _react2.jsx)(_icon.EuiIcon, { type: "dot", "aria-label": isComplete, color: "subdued" }); }); } else if (status === 'incomplete') { indicatorIcon = (0, _react2.jsx)(_i18n.EuiI18n, { token: "euiTourStepIndicator.isIncomplete", default: "incomplete" }, function (isIncomplete) { return (0, _react2.jsx)(_icon.EuiIcon, { type: "dot", "aria-label": isIncomplete, color: "subdued" }); }); } return (0, _react2.jsx)(_i18n.EuiI18n, { token: "euiTourStepIndicator.ariaLabel", default: "Step {number} {status}", values: { status: status, number: number } }, function (ariaLabel) { return (0, _react2.jsx)("li", _extends({ css: _ref, className: classes, "aria-label": ariaLabel }, rest), indicatorIcon); }); }; exports.EuiTourStepIndicator = EuiTourStepIndicator; EuiTourStepIndicator.propTypes = { number: _propTypes.default.number.isRequired, status: _propTypes.default.oneOf(["complete", "incomplete", "active"]).isRequired, className: _propTypes.default.string, "aria-label": _propTypes.default.string, "data-test-subj": _propTypes.default.string, css: _propTypes.default.any };