@elastic/eui
Version:
Elastic UI Component Library
85 lines (82 loc) • 4.84 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.euiStepVariables = exports.euiStepTitleStyles = exports.euiStepStyles = exports.euiStepContentStyles = void 0;
var _react = require("@emotion/react");
var _global_styling = require("../../global_styling");
/*
* 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 euiStepVariables = function euiStepVariables(euiTheme) {
return {
numberSize: euiTheme.size.xl,
numberXSSize: euiTheme.size.l,
numberMargin: euiTheme.size.base
};
};
exports.euiStepVariables = euiStepVariables;
var euiStepStyles = function euiStepStyles(euiThemeContext) {
var euiTheme = euiThemeContext.euiTheme;
var euiStep = euiStepVariables(euiTheme);
// the vertical line is centered on the number, so we need to offset the line
// by half of the number size & half of the line size to center it
var lineStartPosition = (0, _global_styling.mathWithUnits)([euiStep.numberSize, euiTheme.border.width.thick], function (x, y) {
return x / 2 - y / 2;
});
var lineEndPosition = (0, _global_styling.mathWithUnits)([euiStep.numberSize, euiTheme.border.width.thick], function (x, y) {
return x / 2 + y / 2;
});
var lineGradient = "linear-gradient(to right,\n transparent 0,\n transparent ".concat(lineStartPosition, ",\n ").concat(euiTheme.border.color, " ").concat(lineStartPosition, ",\n ").concat(euiTheme.border.color, " ").concat(lineEndPosition, ",\n transparent ").concat(lineEndPosition, ",\n transparent 100%)");
return {
euiStep: /*#__PURE__*/(0, _react.css)("&:not(:last-of-type){background-image:", lineGradient, ";background-repeat:no-repeat;};label:euiStep;"),
// Sizes
m: /*#__PURE__*/(0, _react.css)("&:not(:last-of-type){background-position:left ", euiTheme.size.xl, ";};label:m;"),
s: /*#__PURE__*/(0, _react.css)("&:not(:last-of-type){background-position:left ", euiTheme.size.xl, ";};label:s;"),
xs: /*#__PURE__*/(0, _react.css)("&:not(:last-of-type){background-position:-", euiTheme.size.xs, " ", euiTheme.size.l, ";};label:xs;")
};
};
exports.euiStepStyles = euiStepStyles;
var euiStepContentStyles = function euiStepContentStyles(euiThemeContext) {
var euiTheme = euiThemeContext.euiTheme;
var euiStep = euiStepVariables(euiTheme);
var styles = {
euiStep__content: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-top', euiTheme.size.s), " ", (0, _global_styling.logicalCSS)('padding-top', euiTheme.size.base), " ", (0, _global_styling.logicalCSS)('padding-bottom', (0, _global_styling.mathWithUnits)([euiTheme.size.xl, euiTheme.size.s], function (x, y) {
return x + y;
})), " ", (0, _global_styling.logicalCSS)('padding-right', euiTheme.size.base), ";;label:euiStep__content;"),
// Sizes
m: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('padding-left', (0, _global_styling.mathWithUnits)([euiStep.numberSize, euiStep.numberMargin], function (x, y) {
return x / 2 + y;
})), (0, _global_styling.logicalCSS)('margin-left', (0, _global_styling.mathWithUnits)(euiStep.numberSize, function (x) {
return x / 2;
})), ";;label:m;"),
s: /*#__PURE__*/(0, _react.css)(";label:s;"),
// s is the same as m, so we'll programmatically duplicate it below
xs: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('padding-left', (0, _global_styling.mathWithUnits)([euiStep.numberXSSize, euiStep.numberMargin], function (x, y) {
return x / 2 + y;
})), (0, _global_styling.logicalCSS)('margin-left', (0, _global_styling.mathWithUnits)(euiStep.numberXSSize, function (x) {
return x / 2;
})), ";;label:xs;")
};
styles.s = styles.m;
return styles;
};
exports.euiStepContentStyles = euiStepContentStyles;
var euiStepTitleStyles = function euiStepTitleStyles(euiThemeContext) {
var euiTheme = euiThemeContext.euiTheme;
var euiStep = euiStepVariables(euiTheme);
return {
euiStep__titleWrapper: /*#__PURE__*/(0, _react.css)("display:flex;gap:", euiStep.numberMargin, ";;label:euiStep__titleWrapper;"),
euiStep__title: /*#__PURE__*/(0, _react.css)(";label:euiStep__title;"),
isDisabled: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.disabledText, ";;label:isDisabled;"),
// Sizes
m: /*#__PURE__*/(0, _react.css)(";label:m;"),
s: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('padding-top', euiTheme.size.xs), ";;label:s;"),
xs: /*#__PURE__*/(0, _react.css)(";label:xs;")
};
};
exports.euiStepTitleStyles = euiStepTitleStyles;