@elastic/eui 69.0.0 → 70.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_theme_dark.css +0 -375
- package/dist/eui_theme_dark.json +0 -27
- package/dist/eui_theme_dark.json.d.ts +0 -27
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -375
- package/dist/eui_theme_light.json +0 -27
- package/dist/eui_theme_light.json.d.ts +0 -27
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/basic_table/in_memory_table.js +8 -2
- package/es/components/code/code.js +7 -3
- package/es/components/code/code.styles.js +32 -0
- package/es/components/code/code_block.js +72 -315
- package/es/components/code/code_block.styles.js +153 -0
- package/es/components/code/code_block_controls.js +29 -0
- package/es/components/code/code_block_controls.styles.js +43 -0
- package/es/components/code/code_block_copy.js +65 -0
- package/es/components/code/code_block_full_screen.js +90 -0
- package/es/components/code/code_block_line.styles.js +49 -0
- package/es/components/code/code_block_overflow.js +78 -0
- package/es/components/code/code_block_virtualized.js +59 -0
- package/es/components/code/code_syntax.styles.js +43 -0
- package/es/components/code/utils.js +43 -37
- package/es/components/collapsible_nav/collapsible_nav.js +0 -5
- package/es/components/overlay_mask/overlay_mask.js +8 -14
- package/es/components/overlay_mask/overlay_mask.styles.js +4 -14
- package/es/components/overlay_mask/overlay_mask_body.styles.js +18 -0
- package/es/components/provider/provider.js +1 -5
- package/es/components/resizable_container/helpers.js +2 -2
- package/es/components/resizable_container/resizable_container.js +6 -9
- package/es/components/resizable_container/resizable_container.styles.js +28 -0
- package/es/components/resizable_container/resizable_panel.js +25 -48
- package/es/components/resizable_container/resizable_panel.styles.js +69 -0
- package/es/components/search_bar/query/ast.js +14 -3
- package/es/components/tool_tip/tool_tip.js +3 -2
- package/es/components/tool_tip/tool_tip.styles.js +17 -22
- package/es/components/tool_tip/tool_tip_arrow.js +17 -3
- package/es/components/tool_tip/tool_tip_popover.js +7 -7
- package/es/components/tour/tour.styles.js +4 -3
- package/es/components/tour/tour_step.js +7 -5
- package/es/global_styling/functions/logicals.js +5 -3
- package/es/global_styling/functions/math.js +37 -19
- package/es/global_styling/mixins/_padding.js +13 -9
- package/eui.d.ts +291 -37
- package/i18ntokens.json +22 -22
- package/lib/components/basic_table/in_memory_table.js +8 -2
- package/lib/components/code/code.js +9 -3
- package/lib/components/code/code.styles.js +35 -0
- package/lib/components/code/code_block.js +72 -320
- package/lib/components/code/code_block.styles.js +154 -0
- package/lib/components/code/code_block_controls.js +48 -0
- package/lib/components/code/code_block_controls.styles.js +39 -0
- package/lib/components/code/code_block_copy.js +78 -0
- package/lib/components/code/code_block_full_screen.js +108 -0
- package/lib/components/code/code_block_line.styles.js +45 -0
- package/lib/components/code/code_block_overflow.js +82 -0
- package/lib/components/code/code_block_virtualized.js +72 -0
- package/lib/components/code/code_syntax.styles.js +57 -0
- package/lib/components/code/utils.js +40 -39
- package/lib/components/collapsible_nav/collapsible_nav.js +0 -5
- package/lib/components/overlay_mask/overlay_mask.js +9 -14
- package/lib/components/overlay_mask/overlay_mask.styles.js +13 -17
- package/lib/components/overlay_mask/overlay_mask_body.styles.js +20 -0
- package/lib/components/provider/provider.js +7 -12
- package/lib/components/resizable_container/helpers.js +2 -2
- package/lib/components/resizable_container/resizable_container.js +7 -9
- package/lib/components/resizable_container/resizable_container.styles.js +31 -0
- package/lib/components/resizable_container/resizable_panel.js +28 -49
- package/lib/components/resizable_container/resizable_panel.styles.js +74 -0
- package/lib/components/search_bar/query/ast.js +14 -3
- package/lib/components/tool_tip/tool_tip.js +3 -2
- package/lib/components/tool_tip/tool_tip.styles.js +18 -26
- package/lib/components/tool_tip/tool_tip_arrow.js +19 -4
- package/lib/components/tool_tip/tool_tip_popover.js +6 -6
- package/lib/components/tour/tour.styles.js +3 -2
- package/lib/components/tour/tour_step.js +7 -5
- package/lib/global_styling/functions/logicals.js +5 -3
- package/lib/global_styling/functions/math.js +37 -19
- package/lib/global_styling/mixins/_padding.js +17 -10
- package/optimize/es/components/basic_table/in_memory_table.js +1 -1
- package/optimize/es/components/code/code.js +7 -3
- package/optimize/es/components/code/code.styles.js +32 -0
- package/optimize/es/components/code/code_block.js +70 -299
- package/optimize/es/components/code/code_block.styles.js +153 -0
- package/optimize/es/components/code/code_block_controls.js +29 -0
- package/optimize/es/components/code/code_block_controls.styles.js +43 -0
- package/optimize/es/components/code/code_block_copy.js +55 -0
- package/optimize/es/components/code/code_block_full_screen.js +80 -0
- package/optimize/es/components/code/code_block_line.styles.js +49 -0
- package/optimize/es/components/code/code_block_overflow.js +67 -0
- package/optimize/es/components/code/code_block_virtualized.js +59 -0
- package/optimize/es/components/code/code_syntax.styles.js +43 -0
- package/optimize/es/components/code/utils.js +43 -37
- package/optimize/es/components/overlay_mask/overlay_mask.js +8 -9
- package/optimize/es/components/overlay_mask/overlay_mask.styles.js +4 -14
- package/optimize/es/components/overlay_mask/overlay_mask_body.styles.js +18 -0
- package/optimize/es/components/provider/provider.js +1 -5
- package/optimize/es/components/resizable_container/helpers.js +2 -2
- package/optimize/es/components/resizable_container/resizable_container.js +6 -9
- package/optimize/es/components/resizable_container/resizable_container.styles.js +28 -0
- package/optimize/es/components/resizable_container/resizable_panel.js +25 -48
- package/optimize/es/components/resizable_container/resizable_panel.styles.js +69 -0
- package/optimize/es/components/search_bar/query/ast.js +14 -3
- package/optimize/es/components/tool_tip/tool_tip.js +3 -2
- package/optimize/es/components/tool_tip/tool_tip.styles.js +17 -22
- package/optimize/es/components/tool_tip/tool_tip_arrow.js +9 -3
- package/optimize/es/components/tool_tip/tool_tip_popover.js +7 -7
- package/optimize/es/components/tour/tour.styles.js +4 -3
- package/optimize/es/components/tour/tour_step.js +7 -5
- package/optimize/es/global_styling/functions/logicals.js +5 -3
- package/optimize/es/global_styling/functions/math.js +35 -17
- package/optimize/es/global_styling/mixins/_padding.js +13 -9
- package/optimize/lib/components/basic_table/in_memory_table.js +1 -1
- package/optimize/lib/components/code/code.js +9 -3
- package/optimize/lib/components/code/code.styles.js +35 -0
- package/optimize/lib/components/code/code_block.js +71 -306
- package/optimize/lib/components/code/code_block.styles.js +156 -0
- package/optimize/lib/components/code/code_block_controls.js +48 -0
- package/optimize/lib/components/code/code_block_controls.styles.js +39 -0
- package/optimize/lib/components/code/code_block_copy.js +78 -0
- package/optimize/lib/components/code/code_block_full_screen.js +108 -0
- package/optimize/lib/components/code/code_block_line.styles.js +45 -0
- package/optimize/lib/components/code/code_block_overflow.js +82 -0
- package/optimize/lib/components/code/code_block_virtualized.js +81 -0
- package/optimize/lib/components/code/code_syntax.styles.js +57 -0
- package/optimize/lib/components/code/utils.js +40 -37
- package/optimize/lib/components/overlay_mask/overlay_mask.js +9 -9
- package/optimize/lib/components/overlay_mask/overlay_mask.styles.js +13 -17
- package/optimize/lib/components/overlay_mask/overlay_mask_body.styles.js +20 -0
- package/optimize/lib/components/provider/provider.js +7 -12
- package/optimize/lib/components/resizable_container/helpers.js +2 -2
- package/optimize/lib/components/resizable_container/resizable_container.js +7 -9
- package/optimize/lib/components/resizable_container/resizable_container.styles.js +31 -0
- package/optimize/lib/components/resizable_container/resizable_panel.js +28 -49
- package/optimize/lib/components/resizable_container/resizable_panel.styles.js +76 -0
- package/optimize/lib/components/search_bar/query/ast.js +14 -3
- package/optimize/lib/components/tool_tip/tool_tip.js +3 -2
- package/optimize/lib/components/tool_tip/tool_tip.styles.js +18 -26
- package/optimize/lib/components/tool_tip/tool_tip_arrow.js +10 -10
- package/optimize/lib/components/tool_tip/tool_tip_popover.js +6 -6
- package/optimize/lib/components/tour/tour.styles.js +3 -2
- package/optimize/lib/components/tour/tour_step.js +7 -5
- package/optimize/lib/global_styling/functions/logicals.js +4 -10
- package/optimize/lib/global_styling/functions/math.js +37 -19
- package/optimize/lib/global_styling/mixins/_padding.js +17 -10
- package/package.json +8 -7
- package/src/components/index.scss +0 -1
- package/src/components/resizable_container/_index.scss +0 -2
- package/src/global_styling/mixins/_header.scss +1 -1
- package/src/global_styling/variables/_index.scss +0 -1
- package/src/themes/amsterdam/overrides/_index.scss +0 -1
- package/test-env/components/basic_table/in_memory_table.js +8 -2
- package/test-env/components/code/code.styles.js +35 -0
- package/test-env/components/code/code_block.styles.js +156 -0
- package/test-env/components/code/code_block_controls.js +48 -0
- package/test-env/components/code/code_block_controls.styles.js +39 -0
- package/test-env/components/code/code_block_copy.js +78 -0
- package/test-env/components/code/code_block_full_screen.js +108 -0
- package/test-env/components/code/code_block_line.styles.js +45 -0
- package/test-env/components/code/code_block_overflow.js +82 -0
- package/test-env/components/code/code_block_virtualized.js +81 -0
- package/test-env/components/code/code_syntax.styles.js +57 -0
- package/test-env/components/code/utils.js +40 -37
- package/test-env/components/collapsible_nav/collapsible_nav.js +0 -5
- package/test-env/components/overlay_mask/overlay_mask.js +9 -14
- package/test-env/components/overlay_mask/overlay_mask.styles.js +13 -17
- package/test-env/components/overlay_mask/overlay_mask_body.styles.js +20 -0
- package/test-env/components/provider/provider.js +7 -12
- package/test-env/components/resizable_container/helpers.js +2 -2
- package/test-env/components/resizable_container/resizable_container.js +7 -9
- package/test-env/components/resizable_container/resizable_container.styles.js +31 -0
- package/test-env/components/resizable_container/resizable_panel.js +28 -49
- package/test-env/components/resizable_container/resizable_panel.styles.js +76 -0
- package/test-env/components/search_bar/query/ast.js +14 -3
- package/test-env/components/tool_tip/tool_tip.js +3 -2
- package/test-env/components/tool_tip/tool_tip.styles.js +18 -26
- package/test-env/components/tool_tip/tool_tip_arrow.js +16 -11
- package/test-env/components/tool_tip/tool_tip_popover.js +6 -6
- package/test-env/components/tour/tour.styles.js +3 -2
- package/test-env/components/tour/tour_step.js +7 -5
- package/test-env/global_styling/functions/logicals.js +4 -10
- package/test-env/global_styling/functions/math.js +37 -19
- package/test-env/global_styling/mixins/_padding.js +17 -10
- package/src/components/code/_code.scss +0 -15
- package/src/components/code/_code_block.scss +0 -177
- package/src/components/code/_index.scss +0 -4
- package/src/components/code/_mixins.scss +0 -127
- package/src/components/code/_variables.scss +0 -5
- package/src/components/resizable_container/_resizable_container.scss +0 -8
- package/src/components/resizable_container/_resizable_panel.scss +0 -51
- package/src/global_styling/variables/_colors_code.scss +0 -23
- package/src/themes/amsterdam/overrides/_code.scss +0 -9
|
@@ -12,7 +12,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
12
12
|
* Side Public License, v 1.
|
|
13
13
|
*/
|
|
14
14
|
import { css, keyframes } from '@emotion/react';
|
|
15
|
-
import { logicalCSS, logicalSizeCSS, euiFontSize, mathWithUnits } from '../../global_styling';
|
|
15
|
+
import { logicalCSS, logicalSizeCSS, euiFontSize, euiCanAnimate, mathWithUnits } from '../../global_styling';
|
|
16
16
|
import { COLOR_MODES_STANDARD, tint, shade } from '../../services';
|
|
17
17
|
import { euiShadow } from '../../themes/amsterdam';
|
|
18
18
|
export var euiToolTipBackgroundColor = function euiToolTipBackgroundColor(euiTheme, colorMode) {
|
|
@@ -33,39 +33,34 @@ var euiToolTipAnimationHorizontal = function euiToolTipAnimationHorizontal(size)
|
|
|
33
33
|
export var euiToolTipStyles = function euiToolTipStyles(euiThemeContext) {
|
|
34
34
|
var euiTheme = euiThemeContext.euiTheme,
|
|
35
35
|
colorMode = euiThemeContext.colorMode;
|
|
36
|
-
var animationTiming = "".concat(euiTheme.animation.slow, " ease-out 0s forwards");
|
|
37
|
-
/*
|
|
38
|
-
* 1. Shift arrow 1px more than half its size to account for border radius
|
|
39
|
-
*/
|
|
36
|
+
var animationTiming = "".concat(euiTheme.animation.slow, " ease-out 0s forwards"); // Shift arrow 1px more than half its size to account for border radius
|
|
40
37
|
|
|
41
38
|
var arrowSize = euiTheme.size.m;
|
|
42
39
|
var arrowPlusSize = mathWithUnits(arrowSize, function (x) {
|
|
43
40
|
return (x / 2 + 1) * -1;
|
|
44
|
-
});
|
|
45
|
-
|
|
41
|
+
});
|
|
46
42
|
var arrowMinusSize = mathWithUnits(arrowSize, function (x) {
|
|
47
43
|
return (x / 2 - 1) * -1;
|
|
48
|
-
});
|
|
49
|
-
|
|
44
|
+
});
|
|
50
45
|
return {
|
|
51
46
|
// Base
|
|
52
47
|
euiToolTip: /*#__PURE__*/css(euiShadow(euiThemeContext), ";border-radius:", euiTheme.border.radius.medium, ";background-color:", euiToolTipBackgroundColor(euiTheme, colorMode), ";color:", euiTheme.colors.ghost, ";z-index:", euiTheme.levels.toast, ";", logicalCSS('max-width', '256px'), " overflow-wrap:break-word;padding:", euiTheme.size.s, ";", euiFontSize(euiThemeContext, 's'), ";position:absolute;[class*='euiHorizontalRule']{background-color:", euiToolTipBorderColor(euiTheme, colorMode), ";};label:euiToolTip;"),
|
|
53
48
|
// Sizes
|
|
54
49
|
s: /*#__PURE__*/css(euiFontSize(euiThemeContext, 'xs'), ";;label:s;"),
|
|
55
50
|
// Positions
|
|
56
|
-
top: /*#__PURE__*/css("animation:", euiToolTipAnimationVertical("-".concat(euiTheme.size.base)), " ", animationTiming, "
|
|
57
|
-
bottom: /*#__PURE__*/css("animation:", euiToolTipAnimationVertical(euiTheme.size.base), " ", animationTiming, ";
|
|
58
|
-
left: /*#__PURE__*/css("animation:", euiToolTipAnimationHorizontal("-".concat(euiTheme.size.base)), " ", animationTiming, ";
|
|
59
|
-
right: /*#__PURE__*/css("animation:", euiToolTipAnimationHorizontal(euiTheme.size.base), " ", animationTiming, ";
|
|
60
|
-
//
|
|
61
|
-
euiToolTip__arrow: /*#__PURE__*/css("content:'';position:absolute;transform-origin:center;border-radius:2px;background-color:", euiToolTipBackgroundColor(euiTheme, colorMode), ";", logicalSizeCSS(arrowSize, arrowSize), "
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
//
|
|
51
|
+
top: /*#__PURE__*/css(euiCanAnimate, "{animation:", euiToolTipAnimationVertical("-".concat(euiTheme.size.base)), " ", animationTiming, ";};label:top;"),
|
|
52
|
+
bottom: /*#__PURE__*/css(euiCanAnimate, "{animation:", euiToolTipAnimationVertical(euiTheme.size.base), " ", animationTiming, ";};label:bottom;"),
|
|
53
|
+
left: /*#__PURE__*/css(euiCanAnimate, "{animation:", euiToolTipAnimationHorizontal("-".concat(euiTheme.size.base)), " ", animationTiming, ";};label:left;"),
|
|
54
|
+
right: /*#__PURE__*/css(euiCanAnimate, "{animation:", euiToolTipAnimationHorizontal(euiTheme.size.base), " ", animationTiming, ";};label:right;"),
|
|
55
|
+
// Arrow
|
|
56
|
+
euiToolTip__arrow: /*#__PURE__*/css("content:'';position:absolute;transform-origin:center;border-radius:2px;background-color:", euiToolTipBackgroundColor(euiTheme, colorMode), ";", logicalSizeCSS(arrowSize, arrowSize), ";;label:euiToolTip__arrow;"),
|
|
57
|
+
arrowPositions: {
|
|
58
|
+
top: /*#__PURE__*/css("transform:translateY(", arrowPlusSize, ") rotateZ(45deg);;label:top;"),
|
|
59
|
+
bottom: /*#__PURE__*/css("transform:translateY(", arrowMinusSize, ") rotateZ(45deg);;label:bottom;"),
|
|
60
|
+
left: /*#__PURE__*/css("transform:translateX(", arrowPlusSize, ") rotateZ(45deg);;label:left;"),
|
|
61
|
+
right: /*#__PURE__*/css("transform:translateX(", arrowMinusSize, ") rotateZ(45deg);;label:right;")
|
|
62
|
+
},
|
|
63
|
+
// Title
|
|
69
64
|
euiToolTip__title: /*#__PURE__*/css("font-weight:", euiTheme.font.weight.bold, ";", logicalCSS('border-bottom', "solid ".concat(euiTheme.border.width.thin, " ").concat(euiToolTipBorderColor(euiTheme, colorMode))), ";", logicalCSS('padding-bottom', euiTheme.size.xs), ";", logicalCSS('margin-bottom', euiTheme.size.xs), ";;label:euiToolTip__title;")
|
|
70
65
|
};
|
|
71
66
|
};
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
var _excluded = ["position"];
|
|
2
|
+
|
|
1
3
|
function _extends() { _extends = Object.assign || 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); }
|
|
2
4
|
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
3
9
|
/*
|
|
4
10
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
5
11
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -8,13 +14,21 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
8
14
|
* Side Public License, v 1.
|
|
9
15
|
*/
|
|
10
16
|
import React from 'react';
|
|
17
|
+
import PropTypes from "prop-types";
|
|
11
18
|
import { useEuiTheme } from '../../services';
|
|
12
19
|
import { euiToolTipStyles } from './tool_tip.styles';
|
|
13
20
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
14
|
-
export var EuiToolTipArrow = function EuiToolTipArrow(
|
|
21
|
+
export var EuiToolTipArrow = function EuiToolTipArrow(_ref) {
|
|
22
|
+
var position = _ref.position,
|
|
23
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
24
|
+
|
|
15
25
|
var euiTheme = useEuiTheme();
|
|
16
|
-
var
|
|
26
|
+
var styles = euiToolTipStyles(euiTheme);
|
|
27
|
+
var cssStyles = [styles.euiToolTip__arrow, styles.arrowPositions[position]];
|
|
17
28
|
return ___EmotionJSX("div", _extends({
|
|
18
|
-
css:
|
|
29
|
+
css: cssStyles
|
|
19
30
|
}, props));
|
|
31
|
+
};
|
|
32
|
+
EuiToolTipArrow.propTypes = {
|
|
33
|
+
position: PropTypes.oneOf(["top", "right", "bottom", "left"]).isRequired
|
|
20
34
|
};
|
|
@@ -17,7 +17,7 @@ import React, { useEffect, useRef, useCallback } from 'react';
|
|
|
17
17
|
import PropTypes from "prop-types";
|
|
18
18
|
import classNames from 'classnames';
|
|
19
19
|
import { useEuiTheme } from '../../services';
|
|
20
|
-
import { euiToolTipStyles
|
|
20
|
+
import { euiToolTipStyles } from './tool_tip.styles';
|
|
21
21
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
22
22
|
export var EuiToolTipPopover = function EuiToolTipPopover(_ref) {
|
|
23
23
|
var children = _ref.children,
|
|
@@ -30,9 +30,8 @@ export var EuiToolTipPopover = function EuiToolTipPopover(_ref) {
|
|
|
30
30
|
|
|
31
31
|
var popover = useRef();
|
|
32
32
|
var euiTheme = useEuiTheme();
|
|
33
|
-
var
|
|
34
|
-
var
|
|
35
|
-
var titleCss = [popoverStyles.euiToolTip__title];
|
|
33
|
+
var styles = euiToolTipStyles(euiTheme);
|
|
34
|
+
var cssStyles = [styles.euiToolTip, calculatedPosition && styles[calculatedPosition]];
|
|
36
35
|
var updateDimensions = useCallback(function () {
|
|
37
36
|
requestAnimationFrame(function () {
|
|
38
37
|
// Because of this delay, sometimes `positionToolTip` becomes unavailable.
|
|
@@ -58,11 +57,12 @@ export var EuiToolTipPopover = function EuiToolTipPopover(_ref) {
|
|
|
58
57
|
}, [updateDimensions]);
|
|
59
58
|
var classes = classNames('euiToolTipPopover', className);
|
|
60
59
|
return ___EmotionJSX("div", _extends({
|
|
61
|
-
css:
|
|
60
|
+
css: cssStyles,
|
|
62
61
|
className: classes,
|
|
63
|
-
ref: setPopoverRef
|
|
62
|
+
ref: setPopoverRef,
|
|
63
|
+
"data-position": calculatedPosition
|
|
64
64
|
}, rest), title && ___EmotionJSX("div", {
|
|
65
|
-
css:
|
|
65
|
+
css: styles.euiToolTip__title,
|
|
66
66
|
className: "euiToolTip__title"
|
|
67
67
|
}, title), children);
|
|
68
68
|
};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
9
|
import { shade, tint, COLOR_MODES_STANDARD } from '../../services';
|
|
10
|
-
import { logicalCSS, mathWithUnits } from '../../global_styling';
|
|
10
|
+
import { logicalCSS, mathWithUnits, euiCanAnimate } from '../../global_styling';
|
|
11
11
|
import { openAnimationTiming } from '../popover/popover_panel/_popover_panel.styles';
|
|
12
12
|
import { popoverArrowSize } from '../popover/popover_arrow/_popover_arrow.styles';
|
|
13
13
|
|
|
@@ -20,7 +20,7 @@ export var euiTourStyles = function euiTourStyles(_ref) {
|
|
|
20
20
|
colorMode = _ref.colorMode;
|
|
21
21
|
return {
|
|
22
22
|
// Targets EuiPopoverPanel
|
|
23
|
-
euiTour: /*#__PURE__*/css("
|
|
23
|
+
euiTour: /*#__PURE__*/css("[data-popover-arrow='top']::before{", logicalCSS('border-top-color', backgroundColor(euiTheme.colors.lightestShade, colorMode)), ";};label:euiTour;")
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
export var euiTourBeaconStyles = function euiTourBeaconStyles(_ref2) {
|
|
@@ -34,7 +34,8 @@ export var euiTourBeaconStyles = function euiTourBeaconStyles(_ref2) {
|
|
|
34
34
|
});
|
|
35
35
|
return {
|
|
36
36
|
// Base
|
|
37
|
-
euiTourBeacon: /*#__PURE__*/css("pointer-events:none;position:absolute;opacity:0;transition:opacity 0s ", euiTheme.animation[openAnimationTiming], "
|
|
37
|
+
euiTourBeacon: /*#__PURE__*/css("pointer-events:none;position:absolute;", euiCanAnimate, "{opacity:0;transition:opacity 0s ", euiTheme.animation[openAnimationTiming], ";};label:euiTourBeacon;"),
|
|
38
|
+
isOpen: /*#__PURE__*/css(euiCanAnimate, "{opacity:1;};label:isOpen;"),
|
|
38
39
|
// Positions
|
|
39
40
|
right: /*#__PURE__*/css(logicalCSS('top', arrowHalfSize), ";", logicalCSS('left', arrowOffset), ";;label:right;"),
|
|
40
41
|
left: /*#__PURE__*/css(logicalCSS('top', arrowHalfSize), ";", logicalCSS('left', arrowSize), ";;label:left;"),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["anchorPosition", "anchor", "children", "className", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "style", "subtitle", "title", "decoration", "footerAction"];
|
|
1
|
+
var _excluded = ["anchorPosition", "anchor", "children", "className", "css", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "style", "subtitle", "title", "decoration", "footerAction", "panelProps"];
|
|
2
2
|
|
|
3
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
4
4
|
|
|
@@ -58,6 +58,7 @@ export var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
58
58
|
anchor = _ref.anchor,
|
|
59
59
|
children = _ref.children,
|
|
60
60
|
className = _ref.className,
|
|
61
|
+
css = _ref.css,
|
|
61
62
|
_ref$closePopover = _ref.closePopover,
|
|
62
63
|
closePopover = _ref$closePopover === void 0 ? function () {} : _ref$closePopover,
|
|
63
64
|
content = _ref.content,
|
|
@@ -77,6 +78,7 @@ export var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
77
78
|
_ref$decoration = _ref.decoration,
|
|
78
79
|
decoration = _ref$decoration === void 0 ? 'beacon' : _ref$decoration,
|
|
79
80
|
footerAction = _ref.footerAction,
|
|
81
|
+
panelProps = _ref.panelProps,
|
|
80
82
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
81
83
|
|
|
82
84
|
var titleId = useGeneratedHtmlId();
|
|
@@ -120,7 +122,7 @@ export var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
120
122
|
var headerStyles = euiTourHeaderStyles(euiTheme);
|
|
121
123
|
var footerStyles = euiTourFooterStyles(euiTheme);
|
|
122
124
|
var beaconStyles = euiTourBeaconStyles(euiTheme);
|
|
123
|
-
var beaconCss = [beaconStyles.euiTourBeacon, popoverPosition && beaconStyles[popoverPosition]];
|
|
125
|
+
var beaconCss = [beaconStyles.euiTourBeacon, isStepOpen && beaconStyles.isOpen, popoverPosition && beaconStyles[popoverPosition]];
|
|
124
126
|
var finishButtonProps = {
|
|
125
127
|
color: 'text',
|
|
126
128
|
flush: 'right',
|
|
@@ -181,9 +183,9 @@ export var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
181
183
|
ownFocus: false,
|
|
182
184
|
panelClassName: classes,
|
|
183
185
|
panelStyle: style,
|
|
184
|
-
panelProps: {
|
|
185
|
-
css: tourStyles.euiTour
|
|
186
|
-
},
|
|
186
|
+
panelProps: _objectSpread(_objectSpread({}, panelProps), {}, {
|
|
187
|
+
css: [tourStyles.euiTour, css, panelProps === null || panelProps === void 0 ? void 0 : panelProps.css]
|
|
188
|
+
}),
|
|
187
189
|
offset: hasBeacon ? 10 : 0,
|
|
188
190
|
'aria-labelledby': titleId,
|
|
189
191
|
arrowChildren: hasBeacon && ___EmotionJSX(EuiBeacon, {
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
+
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
4
|
+
|
|
1
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
6
|
|
|
3
7
|
/*
|
|
@@ -83,9 +87,7 @@ export var logicalSizeCSS = function logicalSizeCSS(width, height) {
|
|
|
83
87
|
*/
|
|
84
88
|
|
|
85
89
|
export var logicalSizeStyle = function logicalSizeStyle(width, height) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return _ref2 = {}, _defineProperty(_ref2, logicals.width, width), _defineProperty(_ref2, logicals.height, height), _ref2;
|
|
90
|
+
return _objectSpread(_objectSpread({}, logicalStyle('width', width)), logicalStyle('height', height));
|
|
89
91
|
}; // Text alignment is separate because its the value that changes not the property
|
|
90
92
|
|
|
91
93
|
export var logicalText = {
|
|
@@ -21,26 +21,44 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
|
21
21
|
* Example usage:
|
|
22
22
|
* mathWithUnits('4px', (x) => x / 2) = '2px';
|
|
23
23
|
* mathWithUnits(euiTheme.size.xs, (x) => x + 2) = '6px';
|
|
24
|
+
* mathWithUnits([euiTheme.size.l, euiTheme.size.s], (x, y) => x - y) = '16px';
|
|
24
25
|
*/
|
|
25
|
-
|
|
26
|
+
// Unfortunately, this is the CSSProperties[] type used for several euiTheme vars
|
|
27
|
+
export var mathWithUnits = function mathWithUnits(values, callback) {
|
|
26
28
|
var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
29
|
+
if (!Array.isArray(values)) values = [values];
|
|
30
|
+
var foundNumericValues = [];
|
|
31
|
+
var foundUnit = '';
|
|
32
|
+
values.forEach(function (value) {
|
|
33
|
+
if (typeof value === 'string') {
|
|
34
|
+
var _matches$groups, _matches$groups2;
|
|
27
35
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
36
|
+
var regex = /*#__PURE__*/_wrapRegExp(/(\x2D?[\.0-9]+)(%|[A-Za-z]*)/, {
|
|
37
|
+
value: 1,
|
|
38
|
+
unit: 2
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
var matches = regex.exec(value);
|
|
42
|
+
var numericValue = Number(matches === null || matches === void 0 ? void 0 : (_matches$groups = matches.groups) === null || _matches$groups === void 0 ? void 0 : _matches$groups.value);
|
|
43
|
+
|
|
44
|
+
if (!isNaN(numericValue)) {
|
|
45
|
+
foundNumericValues.push(numericValue);
|
|
46
|
+
} else {
|
|
47
|
+
throw new Error('No valid numeric value found');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (!unit && matches !== null && matches !== void 0 && (_matches$groups2 = matches.groups) !== null && _matches$groups2 !== void 0 && _matches$groups2.unit) {
|
|
51
|
+
if (!foundUnit) {
|
|
52
|
+
foundUnit = matches.groups.unit;
|
|
53
|
+
} else if (foundUnit !== matches.groups.unit) {
|
|
54
|
+
throw new Error('Multiple units found. Use `calc()` to mix and math multiple unit types (e.g. `%` & `px`) instead');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
} else if (typeof value === 'number') {
|
|
58
|
+
foundNumericValues.push(value);
|
|
59
|
+
} else {
|
|
60
|
+
throw new Error('Invalid value type - pass a string or number');
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
return "".concat(callback.apply(void 0, foundNumericValues)).concat(unit || foundUnit);
|
|
46
64
|
};
|
|
@@ -23,18 +23,22 @@ export var euiPaddingSize = function euiPaddingSize(_ref, size) {
|
|
|
23
23
|
return euiTheme.size[size];
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
+
export var euiPaddingSizeCSS = function euiPaddingSizeCSS(euiThemeContext, side) {
|
|
27
|
+
var property = side ? "padding-".concat(logicalSide[side]) : 'padding';
|
|
28
|
+
return {
|
|
29
|
+
none: null,
|
|
30
|
+
xs: /*#__PURE__*/css(property, ":", euiPaddingSize(euiThemeContext, 'xs'), ";;label:xs;"),
|
|
31
|
+
s: /*#__PURE__*/css(property, ":", euiPaddingSize(euiThemeContext, 's'), ";;label:s;"),
|
|
32
|
+
m: /*#__PURE__*/css(property, ":", euiPaddingSize(euiThemeContext, 'm'), ";;label:m;"),
|
|
33
|
+
l: /*#__PURE__*/css(property, ":", euiPaddingSize(euiThemeContext, 'l'), ";;label:l;"),
|
|
34
|
+
xl: /*#__PURE__*/css(property, ":", euiPaddingSize(euiThemeContext, 'xl'), ";;label:xl;")
|
|
35
|
+
};
|
|
36
|
+
};
|
|
26
37
|
export var useEuiPaddingSize = function useEuiPaddingSize(size) {
|
|
27
38
|
var euiTheme = useEuiTheme();
|
|
28
39
|
return euiPaddingSize(euiTheme, size);
|
|
29
40
|
};
|
|
30
41
|
export var useEuiPaddingCSS = function useEuiPaddingCSS(side) {
|
|
31
|
-
var
|
|
32
|
-
return
|
|
33
|
-
none: null,
|
|
34
|
-
xs: /*#__PURE__*/css(property, ":", useEuiPaddingSize('xs'), ";;label:xs;"),
|
|
35
|
-
s: /*#__PURE__*/css(property, ":", useEuiPaddingSize('s'), ";;label:s;"),
|
|
36
|
-
m: /*#__PURE__*/css(property, ":", useEuiPaddingSize('m'), ";;label:m;"),
|
|
37
|
-
l: /*#__PURE__*/css(property, ":", useEuiPaddingSize('l'), ";;label:l;"),
|
|
38
|
-
xl: /*#__PURE__*/css(property, ":", useEuiPaddingSize('xl'), ";;label:xl;")
|
|
39
|
-
};
|
|
42
|
+
var euiTheme = useEuiTheme();
|
|
43
|
+
return euiPaddingSizeCSS(euiTheme, side);
|
|
40
44
|
};
|