"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.euiProgressValueTextStyles = exports.euiProgressStyles = exports.euiProgressLabelStyles = exports.euiProgressDataStyles = void 0;
var _react = require("@emotion/react");
var _global_styling = require("../../global_styling");
var _services = require("../../services");
var _text = require("../text/text.styles");
var _templateObject;
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
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.
*/
/**
* DRY utilities for native/determinate progress components vs non-native indeterminate
*/
var crossBrowserProgressValue = function crossBrowserProgressValue(cssProperties) {
return "\n &::-webkit-progress-value {\n ".concat(cssProperties, "\n }\n &::-moz-progress-bar {\n ").concat(cssProperties, "\n }\n");
};
var indeterminateProgressValue = function indeterminateProgressValue(cssProperties) {
return "\n &::before {\n ".concat(cssProperties, "\n }\n");
};
/**
* Color utilities
*/
var visColors = (0, _services.euiPaletteColorBlind)();
var nativeVsIndeterminateColor = function nativeVsIndeterminateColor(color, isNative) {
var selectors = isNative ? crossBrowserProgressValue : indeterminateProgressValue;
return selectors("background-color: ".concat(color, ";"));
};
/**
* DRY utils for non-static positions
*/
var nonStaticPositioning = function nonStaticPositioning(isNative) {
return "\n ".concat((0, _global_styling.logicalCSS)('top', 0), "\n ").concat((0, _global_styling.logicalCSS)('left', 0), "\n ").concat((0, _global_styling.logicalCSS)('right', 0), "\n background-color: transparent;\n ").concat(isNative ? "\n &::-webkit-progress-bar {\n background-color: transparent;\n }" : '', "\n");
};
/**
* Animations
*/
var euiIndeterminateAnimation = (0, _react.keyframes)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n transform: scaleX(1) translateX(-100%);\n }\n 100% {\n transform: scaleX(1) translateX(100%);\n }\n"])));
/**
* Emotion styles
*/
var _ref2 = process.env.NODE_ENV === "production" ? {
name: "187h6sp-static",
styles: "position:relative;label:static;"
} : {
name: "187h6sp-static",
styles: "position:relative;label:static;",
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
};
var euiProgressStyles = function euiProgressStyles(_ref3, isNative) {
var euiTheme = _ref3.euiTheme;
return {
euiProgress: /*#__PURE__*/(0, _react.css)("overflow:hidden;background-color:", euiTheme.colors.lightShade, ";;label:euiProgress;"),
// https://css-tricks.com/html5-progress-element/
// Good resource if you need to work in here. There's some gotchas with
// dealing with cross-browser progress bars.
native: /*#__PURE__*/(0, _react.css)("display:block;", (0, _global_styling.logicalCSS)('width', '100%'), " appearance:none;border:none;border-radius:", euiTheme.size.s, ";&::-webkit-progress-bar{background-color:", euiTheme.colors.lightShade, ";}", crossBrowserProgressValue('transition: width ${euiTheme.animation.normal} linear;'), ";;label:native;"),
// An indeterminate bar has an unreliable end time. Because of a Firefox animation issue,
// we apply this style to a
instead of a