@elastic/eui 93.4.0 → 93.5.1-rc.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 +3 -0
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +3 -0
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/header/header_links/header_links.js +10 -2
- package/es/components/icon/icon.js +3 -3
- package/es/components/panel/panel.js +2 -3
- package/es/components/resizable_container/resizable_button.js +2 -3
- package/es/components/resizable_container/resizable_collapse_button.js +2 -3
- package/es/components/resizable_container/resizable_container.js +1 -2
- package/es/components/resizable_container/resizable_container.styles.js +11 -14
- package/es/components/resizable_container/resizable_panel.js +6 -8
- package/es/components/resizable_container/resizable_panel.styles.js +18 -29
- package/es/components/selectable/selectable_list/selectable_list.js +29 -6
- package/es/components/tool_tip/icon_tip.js +4 -3
- package/es/global_styling/mixins/_color.js +60 -32
- package/es/global_styling/mixins/_padding.js +60 -16
- package/es/services/theme/style_memoization.js +1 -3
- package/eui.d.ts +37 -54
- package/i18ntokens.json +38 -20
- package/lib/components/header/header_links/header_links.js +10 -2
- package/lib/components/icon/icon.js +3 -3
- package/lib/components/panel/panel.js +1 -2
- package/lib/components/resizable_container/resizable_button.js +1 -2
- package/lib/components/resizable_container/resizable_collapse_button.js +1 -2
- package/lib/components/resizable_container/resizable_container.js +1 -2
- package/lib/components/resizable_container/resizable_container.styles.js +11 -14
- package/lib/components/resizable_container/resizable_panel.js +3 -5
- package/lib/components/resizable_container/resizable_panel.styles.js +17 -28
- package/lib/components/selectable/selectable_list/selectable_list.js +29 -6
- package/lib/components/tool_tip/icon_tip.js +4 -3
- package/lib/global_styling/mixins/_color.js +65 -40
- package/lib/global_styling/mixins/_padding.js +66 -25
- package/lib/services/theme/style_memoization.js +1 -3
- package/optimize/es/components/header/header_links/header_links.js +3 -2
- package/optimize/es/components/icon/icon.js +3 -3
- package/optimize/es/components/panel/panel.js +2 -3
- package/optimize/es/components/resizable_container/resizable_button.js +2 -3
- package/optimize/es/components/resizable_container/resizable_collapse_button.js +2 -3
- package/optimize/es/components/resizable_container/resizable_container.js +1 -2
- package/optimize/es/components/resizable_container/resizable_container.styles.js +11 -14
- package/optimize/es/components/resizable_container/resizable_panel.js +6 -8
- package/optimize/es/components/resizable_container/resizable_panel.styles.js +18 -26
- package/optimize/es/components/selectable/selectable_list/selectable_list.js +29 -6
- package/optimize/es/components/tool_tip/icon_tip.js +4 -3
- package/optimize/es/global_styling/mixins/_color.js +57 -32
- package/optimize/es/global_styling/mixins/_padding.js +52 -16
- package/optimize/es/services/theme/style_memoization.js +1 -3
- package/optimize/lib/components/header/header_links/header_links.js +3 -2
- package/optimize/lib/components/icon/icon.js +3 -3
- package/optimize/lib/components/panel/panel.js +1 -2
- package/optimize/lib/components/resizable_container/resizable_button.js +1 -2
- package/optimize/lib/components/resizable_container/resizable_collapse_button.js +1 -2
- package/optimize/lib/components/resizable_container/resizable_container.js +1 -2
- package/optimize/lib/components/resizable_container/resizable_container.styles.js +11 -14
- package/optimize/lib/components/resizable_container/resizable_panel.js +3 -5
- package/optimize/lib/components/resizable_container/resizable_panel.styles.js +17 -26
- package/optimize/lib/components/selectable/selectable_list/selectable_list.js +29 -6
- package/optimize/lib/components/tool_tip/icon_tip.js +4 -3
- package/optimize/lib/global_styling/mixins/_color.js +63 -40
- package/optimize/lib/global_styling/mixins/_padding.js +59 -25
- package/optimize/lib/services/theme/style_memoization.js +1 -3
- package/package.json +8 -11
- package/src/components/form/text_area/_text_area.scss +5 -0
- package/src/components/selectable/selectable_list/_selectable_list.scss +2 -0
- package/test-env/components/header/header_links/header_links.js +10 -2
- package/test-env/components/panel/panel.js +1 -2
- package/test-env/components/resizable_container/resizable_button.js +1 -2
- package/test-env/components/resizable_container/resizable_collapse_button.js +1 -2
- package/test-env/components/resizable_container/resizable_container.js +1 -2
- package/test-env/components/resizable_container/resizable_container.styles.js +11 -14
- package/test-env/components/resizable_container/resizable_panel.js +3 -5
- package/test-env/components/resizable_container/resizable_panel.styles.js +17 -26
- package/test-env/components/selectable/selectable_list/selectable_list.js +29 -6
- package/test-env/components/tool_tip/icon_tip.js +4 -3
- package/test-env/global_styling/mixins/_color.js +63 -40
- package/test-env/global_styling/mixins/_padding.js +59 -25
- package/test-env/services/theme/style_memoization.js +1 -3
|
@@ -10,14 +10,14 @@ var _excluded = ["type", "aria-label", "color", "size", "iconProps", "position",
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import React from 'react';
|
|
13
|
+
import { useEuiI18n } from '../i18n';
|
|
13
14
|
import { EuiIcon } from '../icon';
|
|
14
15
|
import { EuiToolTip } from './tool_tip';
|
|
15
16
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
16
17
|
export var EuiIconTip = function EuiIconTip(_ref) {
|
|
17
18
|
var _ref$type = _ref.type,
|
|
18
19
|
type = _ref$type === void 0 ? 'questionInCircle' : _ref$type,
|
|
19
|
-
|
|
20
|
-
ariaLabel = _ref$ariaLabel === void 0 ? 'Info' : _ref$ariaLabel,
|
|
20
|
+
ariaLabel = _ref['aria-label'],
|
|
21
21
|
color = _ref.color,
|
|
22
22
|
size = _ref.size,
|
|
23
23
|
iconProps = _ref.iconProps,
|
|
@@ -26,6 +26,7 @@ export var EuiIconTip = function EuiIconTip(_ref) {
|
|
|
26
26
|
_ref$delay = _ref.delay,
|
|
27
27
|
delay = _ref$delay === void 0 ? 'regular' : _ref$delay,
|
|
28
28
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
29
|
+
var defaultAriaLabel = useEuiI18n('euiIconTip.defaultAriaLabel', 'Info');
|
|
29
30
|
return ___EmotionJSX(EuiToolTip, _extends({
|
|
30
31
|
position: position,
|
|
31
32
|
delay: delay
|
|
@@ -34,6 +35,6 @@ export var EuiIconTip = function EuiIconTip(_ref) {
|
|
|
34
35
|
type: type,
|
|
35
36
|
color: color,
|
|
36
37
|
size: size,
|
|
37
|
-
"aria-label": ariaLabel
|
|
38
|
+
"aria-label": ariaLabel || defaultAriaLabel
|
|
38
39
|
}, iconProps)));
|
|
39
40
|
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1
4
|
/*
|
|
2
5
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
6
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -6,10 +9,12 @@
|
|
|
6
9
|
* Side Public License, v 1.
|
|
7
10
|
*/
|
|
8
11
|
|
|
9
|
-
import { useMemo } from 'react';
|
|
10
12
|
import { css } from '@emotion/react';
|
|
11
|
-
import { shade, tint, tintOrShade, transparentize,
|
|
13
|
+
import { shade, tint, tintOrShade, transparentize, useEuiMemoizedStyles } from '../../services';
|
|
12
14
|
export var BACKGROUND_COLORS = ['transparent', 'plain', 'subdued', 'accent', 'primary', 'success', 'warning', 'danger'];
|
|
15
|
+
/**
|
|
16
|
+
* @returns A single background color with optional alpha transparency
|
|
17
|
+
*/
|
|
13
18
|
export var euiBackgroundColor = function euiBackgroundColor(_ref, color) {
|
|
14
19
|
var euiTheme = _ref.euiTheme,
|
|
15
20
|
colorMode = _ref.colorMode;
|
|
@@ -38,29 +43,51 @@ export var euiBackgroundColor = function euiBackgroundColor(_ref, color) {
|
|
|
38
43
|
}
|
|
39
44
|
}
|
|
40
45
|
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @returns An object map of color keys to color values, categorized by
|
|
49
|
+
* opaque (default) vs transparency (hover/focus states) methods.
|
|
50
|
+
* e.g. {
|
|
51
|
+
* opaque: { danger: '#000', success: '#fff', ... },
|
|
52
|
+
* transparent: { danger: 'rgba(0,0,0,0.1)', success: 'rgba(255,255,255,0.1)', ... },
|
|
53
|
+
* }
|
|
54
|
+
*/
|
|
55
|
+
var _euiBackgroundColorMap = function _euiBackgroundColorMap(euiThemeContext) {
|
|
56
|
+
return {
|
|
57
|
+
opaque: BACKGROUND_COLORS.reduce(function (acc, color) {
|
|
58
|
+
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, color, euiBackgroundColor(euiThemeContext, color)));
|
|
59
|
+
}, {}),
|
|
60
|
+
transparent: BACKGROUND_COLORS.reduce(function (acc, color) {
|
|
61
|
+
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, color, euiBackgroundColor(euiThemeContext, color, {
|
|
62
|
+
method: 'transparent'
|
|
63
|
+
})));
|
|
64
|
+
}, {})
|
|
65
|
+
};
|
|
66
|
+
};
|
|
41
67
|
export var useEuiBackgroundColor = function useEuiBackgroundColor(color) {
|
|
42
68
|
var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
43
69
|
method = _ref3.method;
|
|
44
|
-
var
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
|
|
70
|
+
var backgroundColorMap = useEuiMemoizedStyles(_euiBackgroundColorMap);
|
|
71
|
+
return backgroundColorMap[method || 'opaque'][color];
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @returns An object map of color keys to CSS,
|
|
76
|
+
* e.g. { danger: css``, success: css``, ... }
|
|
77
|
+
*/
|
|
78
|
+
var _euiBackgroundColors = function _euiBackgroundColors(euiThemeContext) {
|
|
79
|
+
return BACKGROUND_COLORS.reduce(function (acc, color) {
|
|
80
|
+
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, color, /*#__PURE__*/css("background-color:", euiBackgroundColor(euiThemeContext, color), ";label:", color, ";")));
|
|
81
|
+
}, {});
|
|
48
82
|
};
|
|
49
83
|
export var useEuiBackgroundColorCSS = function useEuiBackgroundColorCSS() {
|
|
50
|
-
|
|
51
|
-
return useMemo(function () {
|
|
52
|
-
return {
|
|
53
|
-
transparent: /*#__PURE__*/css("background-color:", euiBackgroundColor(euiThemeContext, 'transparent'), ";;label:transparent;"),
|
|
54
|
-
plain: /*#__PURE__*/css("background-color:", euiBackgroundColor(euiThemeContext, 'plain'), ";;label:plain;"),
|
|
55
|
-
subdued: /*#__PURE__*/css("background-color:", euiBackgroundColor(euiThemeContext, 'subdued'), ";;label:subdued;"),
|
|
56
|
-
accent: /*#__PURE__*/css("background-color:", euiBackgroundColor(euiThemeContext, 'accent'), ";;label:accent;"),
|
|
57
|
-
primary: /*#__PURE__*/css("background-color:", euiBackgroundColor(euiThemeContext, 'primary'), ";;label:primary;"),
|
|
58
|
-
success: /*#__PURE__*/css("background-color:", euiBackgroundColor(euiThemeContext, 'success'), ";;label:success;"),
|
|
59
|
-
warning: /*#__PURE__*/css("background-color:", euiBackgroundColor(euiThemeContext, 'warning'), ";;label:warning;"),
|
|
60
|
-
danger: /*#__PURE__*/css("background-color:", euiBackgroundColor(euiThemeContext, 'danger'), ";;label:danger;")
|
|
61
|
-
};
|
|
62
|
-
}, [euiThemeContext]);
|
|
84
|
+
return useEuiMemoizedStyles(_euiBackgroundColors);
|
|
63
85
|
};
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Border colors
|
|
89
|
+
*/
|
|
90
|
+
|
|
64
91
|
export var euiBorderColor = function euiBorderColor(_ref4, color) {
|
|
65
92
|
var euiTheme = _ref4.euiTheme,
|
|
66
93
|
colorMode = _ref4.colorMode;
|
|
@@ -75,18 +102,16 @@ export var euiBorderColor = function euiBorderColor(_ref4, color) {
|
|
|
75
102
|
return tintOrShade(euiTheme.colors[color], 0.6, colorMode);
|
|
76
103
|
}
|
|
77
104
|
};
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @returns An object map of color keys to CSS,
|
|
108
|
+
* e.g. { danger: css``, success: css``, ... }
|
|
109
|
+
*/
|
|
110
|
+
var _euiBorderColors = function _euiBorderColors(euiThemeContext) {
|
|
111
|
+
return BACKGROUND_COLORS.reduce(function (acc, color) {
|
|
112
|
+
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, color, /*#__PURE__*/css("border-color:", euiBorderColor(euiThemeContext, color), ";label:", color, ";")));
|
|
113
|
+
}, {});
|
|
114
|
+
};
|
|
78
115
|
export var useEuiBorderColorCSS = function useEuiBorderColorCSS() {
|
|
79
|
-
|
|
80
|
-
return useMemo(function () {
|
|
81
|
-
return {
|
|
82
|
-
transparent: /*#__PURE__*/css("border-color:", euiBorderColor(euiThemeContext, 'transparent'), ";;label:transparent;"),
|
|
83
|
-
plain: /*#__PURE__*/css("border-color:", euiBorderColor(euiThemeContext, 'plain'), ";;label:plain;"),
|
|
84
|
-
subdued: /*#__PURE__*/css("border-color:", euiBorderColor(euiThemeContext, 'subdued'), ";;label:subdued;"),
|
|
85
|
-
accent: /*#__PURE__*/css("border-color:", euiBorderColor(euiThemeContext, 'accent'), ";;label:accent;"),
|
|
86
|
-
primary: /*#__PURE__*/css("border-color:", euiBorderColor(euiThemeContext, 'primary'), ";;label:primary;"),
|
|
87
|
-
success: /*#__PURE__*/css("border-color:", euiBorderColor(euiThemeContext, 'success'), ";;label:success;"),
|
|
88
|
-
warning: /*#__PURE__*/css("border-color:", euiBorderColor(euiThemeContext, 'warning'), ";;label:warning;"),
|
|
89
|
-
danger: /*#__PURE__*/css("border-color:", euiBorderColor(euiThemeContext, 'danger'), ";;label:danger;")
|
|
90
|
-
};
|
|
91
|
-
}, [euiThemeContext]);
|
|
116
|
+
return useEuiMemoizedStyles(_euiBorderColors);
|
|
92
117
|
};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1
5
|
/*
|
|
2
6
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
7
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -7,9 +11,12 @@
|
|
|
7
11
|
*/
|
|
8
12
|
|
|
9
13
|
import { css } from '@emotion/react';
|
|
10
|
-
import {
|
|
11
|
-
import { logicalSide } from '../functions';
|
|
14
|
+
import { useEuiMemoizedStyles } from '../../services/theme';
|
|
12
15
|
export var PADDING_SIZES = ['none', 'xs', 's', 'm', 'l', 'xl'];
|
|
16
|
+
/**
|
|
17
|
+
* Get a single padding size
|
|
18
|
+
*/
|
|
19
|
+
|
|
13
20
|
export var euiPaddingSize = function euiPaddingSize(_ref, size) {
|
|
14
21
|
var euiTheme = _ref.euiTheme;
|
|
15
22
|
switch (size) {
|
|
@@ -21,22 +28,51 @@ export var euiPaddingSize = function euiPaddingSize(_ref, size) {
|
|
|
21
28
|
return euiTheme.size[size];
|
|
22
29
|
}
|
|
23
30
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @returns An object map of padding size keys to padding values,
|
|
34
|
+
* e.g. { s: '8px', m: '16px', ... }
|
|
35
|
+
*/
|
|
36
|
+
var _getEuiPaddingSize = function _getEuiPaddingSize(euiThemeContext) {
|
|
37
|
+
return PADDING_SIZES.reduce(function (stylesAcc, size) {
|
|
38
|
+
return _objectSpread(_objectSpread({}, stylesAcc), {}, _defineProperty({}, size, size === 'none' ? null : euiPaddingSize(euiThemeContext, size)));
|
|
39
|
+
}, {});
|
|
34
40
|
};
|
|
35
41
|
export var useEuiPaddingSize = function useEuiPaddingSize(size) {
|
|
36
|
-
var
|
|
37
|
-
return
|
|
42
|
+
var sizes = useEuiMemoizedStyles(_getEuiPaddingSize);
|
|
43
|
+
return sizes[size];
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @returns An object map of all padding sizes for all padding sides properties
|
|
48
|
+
* e.g., {
|
|
49
|
+
* padding: { s: css`padding-size: 8px`, ... }
|
|
50
|
+
* left: { s: css`padding-inline-start: 8px`, ... }
|
|
51
|
+
* }
|
|
52
|
+
*/
|
|
53
|
+
var _euiPaddingSidesAndSizes = function _euiPaddingSidesAndSizes(euiThemeContext) {
|
|
54
|
+
var sizesMap = _getEuiPaddingSize(euiThemeContext);
|
|
55
|
+
// The `_` prefix stops Emotion from applying the function name as a label
|
|
56
|
+
var _generateSizeStyles = function _generateSizeStyles(cssProperty) {
|
|
57
|
+
return Object.fromEntries(Object.entries(sizesMap).map(function (_ref2) {
|
|
58
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
59
|
+
sizeKey = _ref3[0],
|
|
60
|
+
sizeValue = _ref3[1];
|
|
61
|
+
return [sizeKey, sizeValue === null ? null : /*#__PURE__*/css(cssProperty, ":", sizeValue, ";label:", sizeKey, ";")];
|
|
62
|
+
}));
|
|
63
|
+
};
|
|
64
|
+
var sidesMap = {
|
|
65
|
+
padding: _generateSizeStyles('padding'),
|
|
66
|
+
vertical: _generateSizeStyles('padding-block'),
|
|
67
|
+
top: _generateSizeStyles('padding-block-start'),
|
|
68
|
+
bottom: _generateSizeStyles('padding-block-end'),
|
|
69
|
+
horizontal: _generateSizeStyles('padding-inline'),
|
|
70
|
+
left: _generateSizeStyles('padding-inline-start'),
|
|
71
|
+
right: _generateSizeStyles('padding-inline-end')
|
|
72
|
+
};
|
|
73
|
+
return sidesMap;
|
|
38
74
|
};
|
|
39
75
|
export var useEuiPaddingCSS = function useEuiPaddingCSS(side) {
|
|
40
|
-
var
|
|
41
|
-
return
|
|
76
|
+
var memoizedSideMap = useEuiMemoizedStyles(_euiPaddingSidesAndSizes);
|
|
77
|
+
return memoizedSideMap[side || 'padding'];
|
|
42
78
|
};
|
|
@@ -12,9 +12,7 @@ import React, { createContext, useContext, useState, useMemo, useCallback, forwa
|
|
|
12
12
|
import { useUpdateEffect } from '../hooks';
|
|
13
13
|
import { useEuiTheme } from './hooks';
|
|
14
14
|
|
|
15
|
-
//
|
|
16
|
-
// unmounted components to have their styles garbage-collected by the browser
|
|
17
|
-
// @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap
|
|
15
|
+
// Typically an object of serialized css`` styles, but can have any amount of nesting, so it's not worth it to try and strictly type this
|
|
18
16
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
19
17
|
export var EuiThemeMemoizedStylesContext = /*#__PURE__*/createContext(new WeakMap());
|
|
20
18
|
export var EuiThemeMemoizedStylesProvider = function EuiThemeMemoizedStylesProvider(_ref) {
|
|
@@ -81,6 +81,7 @@ var EuiHeaderLinks = function EuiHeaderLinks(_ref) {
|
|
|
81
81
|
size: "m"
|
|
82
82
|
}));
|
|
83
83
|
});
|
|
84
|
+
var renderedChildren = typeof children === 'function' ? children(closeMenu) : children;
|
|
84
85
|
return (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
85
86
|
token: "euiHeaderLinks.appNavigation",
|
|
86
87
|
default: "App menu"
|
|
@@ -94,7 +95,7 @@ var EuiHeaderLinks = function EuiHeaderLinks(_ref) {
|
|
|
94
95
|
}, (0, _react2.jsx)("div", {
|
|
95
96
|
className: "euiHeaderLinks__list",
|
|
96
97
|
css: [styles.euiHeaderLinks__list, styles.gutterSizes[gutterSize], ";label:EuiHeaderLinks;"]
|
|
97
|
-
},
|
|
98
|
+
}, renderedChildren)), (0, _react2.jsx)(_responsive.EuiShowFor, {
|
|
98
99
|
sizes: popoverBreakpoints
|
|
99
100
|
}, (0, _react2.jsx)(_popover.EuiPopover, (0, _extends2.default)({
|
|
100
101
|
button: button,
|
|
@@ -106,7 +107,7 @@ var EuiHeaderLinks = function EuiHeaderLinks(_ref) {
|
|
|
106
107
|
}, popoverProps), (0, _react2.jsx)("div", {
|
|
107
108
|
className: "euiHeaderLinks__mobileList",
|
|
108
109
|
css: styles.euiHeaderLinks__mobileList
|
|
109
|
-
},
|
|
110
|
+
}, renderedChildren))));
|
|
110
111
|
});
|
|
111
112
|
};
|
|
112
113
|
exports.EuiHeaderLinks = EuiHeaderLinks;
|
|
@@ -238,8 +238,8 @@ var EuiIconClass = /*#__PURE__*/function (_PureComponent) {
|
|
|
238
238
|
} else {
|
|
239
239
|
var Svg = icon;
|
|
240
240
|
|
|
241
|
-
// If
|
|
242
|
-
var isAriaHidden =
|
|
241
|
+
// If there is no aria-label, aria-labelledby, or title it gets aria-hidden true
|
|
242
|
+
var isAriaHidden = !(this.props['aria-label'] || this.props['aria-labelledby'] || this.props.title);
|
|
243
243
|
|
|
244
244
|
// If no aria-label or aria-labelledby is provided but there's a title, a titleId is generated
|
|
245
245
|
// The svg aria-labelledby attribute gets this titleId
|
|
@@ -259,7 +259,7 @@ var EuiIconClass = /*#__PURE__*/function (_PureComponent) {
|
|
|
259
259
|
"data-is-loaded": isLoaded || undefined,
|
|
260
260
|
"data-is-loading": isLoading || undefined
|
|
261
261
|
}, rest, {
|
|
262
|
-
"aria-hidden": isAriaHidden ||
|
|
262
|
+
"aria-hidden": isAriaHidden || rest['aria-hidden']
|
|
263
263
|
}));
|
|
264
264
|
}
|
|
265
265
|
}
|
|
@@ -57,11 +57,10 @@ var EuiPanel = function EuiPanel(_ref) {
|
|
|
57
57
|
panelRef = _ref.panelRef,
|
|
58
58
|
element = _ref.element,
|
|
59
59
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
60
|
-
var euiTheme = (0, _services.useEuiTheme)();
|
|
61
60
|
// Shadows are only allowed when there's a white background (plain)
|
|
62
61
|
var canHaveShadow = !hasBorder && color === 'plain';
|
|
63
62
|
var canHaveBorder = color === 'plain' || color === 'transparent';
|
|
64
|
-
var styles = (0, _panel.euiPanelStyles)
|
|
63
|
+
var styles = (0, _services.useEuiMemoizedStyles)(_panel.euiPanelStyles);
|
|
65
64
|
var cssStyles = [styles.euiPanel, grow && styles.grow, styles.radius[borderRadius], (0, _global_styling.useEuiPaddingCSS)()[paddingSize], (0, _global_styling.useEuiBackgroundColorCSS)()[color], canHaveShadow && hasShadow === true && styles.hasShadow, canHaveBorder && hasBorder === true && styles.hasBorder, rest.onClick && styles.isClickable];
|
|
66
65
|
var classes = (0, _classnames.default)('euiPanel', "euiPanel--".concat(color), (0, _defineProperty2.default)({}, "euiPanel--".concat(paddingSizeToClassNameMap[paddingSize]), paddingSizeToClassNameMap[paddingSize]), className);
|
|
67
66
|
if (rest.onClick && element !== 'div') {
|
|
@@ -41,8 +41,7 @@ var EuiResizableButton = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref
|
|
|
41
41
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
42
42
|
var classes = (0, _classnames.default)('euiResizableButton', className);
|
|
43
43
|
var resizeDirection = isHorizontal ? 'horizontal' : 'vertical';
|
|
44
|
-
var
|
|
45
|
-
var styles = (0, _resizable_button.euiResizableButtonStyles)(euiTheme);
|
|
44
|
+
var styles = (0, _services.useEuiMemoizedStyles)(_resizable_button.euiResizableButtonStyles);
|
|
46
45
|
var cssStyles = [styles.euiResizableButton, styles[indicator], styles["".concat(indicator, "Direction")][resizeDirection], styles[resizeDirection], indicator === 'handle' && styles.alignIndicator[alignIndicator]];
|
|
47
46
|
return (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
48
47
|
tokens: ['euiResizableButton.horizontalResizerAriaLabel', 'euiResizableButton.verticalResizerAriaLabel'],
|
|
@@ -37,8 +37,7 @@ var EuiResizableCollapseButton = function EuiResizableCollapseButton(_ref) {
|
|
|
37
37
|
var isHorizontal = direction === 'horizontal';
|
|
38
38
|
var showOnFocus = !isCollapsed && !isVisible;
|
|
39
39
|
var screenReaderOnlyStyles = (0, _screen_reader_only.euiScreenReaderOnlyStyles)(showOnFocus).euiScreenReaderOnly;
|
|
40
|
-
var
|
|
41
|
-
var styles = (0, _resizable_collapse_button.euiResizableCollapseButtonStyles)(euiTheme);
|
|
40
|
+
var styles = (0, _services.useEuiMemoizedStyles)(_resizable_collapse_button.euiResizableCollapseButtonStyles);
|
|
42
41
|
var collapsedStyles = [styles.collapsed.collapsed, styles.collapsed[direction], styles.collapsed["".concat(direction, "Positions")][internalPosition]];
|
|
43
42
|
var collapsibleStyles = [styles.collapsible.collapsible, styles.collapsible[direction][externalPosition], styles.collapsible[direction][internalPosition]];
|
|
44
43
|
var cssStyles = [styles.euiResizableCollapseButton, showOnFocus && screenReaderOnlyStyles].concat((0, _toConsumableArray2.default)(isCollapsed ? collapsedStyles : collapsibleStyles));
|
|
@@ -58,8 +58,7 @@ var EuiResizableContainer = function EuiResizableContainer(_ref) {
|
|
|
58
58
|
var containerRef = (0, _react.useRef)(null);
|
|
59
59
|
var isHorizontal = direction === 'horizontal';
|
|
60
60
|
var classes = (0, _classnames.default)('euiResizableContainer', className);
|
|
61
|
-
var
|
|
62
|
-
var cssStyles = [styles.euiResizableContainer, styles[direction]];
|
|
61
|
+
var cssStyles = [_resizable_container.euiResizableContainerStyles.euiResizableContainer, _resizable_container.euiResizableContainerStyles[direction]];
|
|
63
62
|
var _useContainerCallback = (0, _helpers.useContainerCallbacks)({
|
|
64
63
|
initialState: _objectSpread(_objectSpread({}, initialState), {}, {
|
|
65
64
|
isHorizontal: isHorizontal
|
|
@@ -13,19 +13,16 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
13
13
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
14
14
|
* Side Public License, v 1.
|
|
15
15
|
*/
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
horizontal: /*#__PURE__*/(0, _react.css)(";label:horizontal;"),
|
|
28
|
-
vertical: _ref
|
|
29
|
-
};
|
|
16
|
+
var euiResizableContainerStyles = {
|
|
17
|
+
euiResizableContainer: /*#__PURE__*/(0, _react.css)("display:flex;", (0, _global_styling.logicalCSS)('width', '100%'), ";;label:euiResizableContainer;"),
|
|
18
|
+
horizontal: /*#__PURE__*/(0, _react.css)(";label:horizontal;"),
|
|
19
|
+
vertical: process.env.NODE_ENV === "production" ? {
|
|
20
|
+
name: "omnk2l-vertical",
|
|
21
|
+
styles: "flex-direction:column;label:vertical;"
|
|
22
|
+
} : {
|
|
23
|
+
name: "omnk2l-vertical",
|
|
24
|
+
styles: "flex-direction:column;label:vertical;",
|
|
25
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
26
|
+
}
|
|
30
27
|
};
|
|
31
28
|
exports.euiResizableContainerStyles = euiResizableContainerStyles;
|
|
@@ -145,15 +145,13 @@ var EuiResizablePanel = function EuiResizablePanel(_ref) {
|
|
|
145
145
|
return direction;
|
|
146
146
|
}, [isCollapsed, isCollapsible, position, panels, panelId]);
|
|
147
147
|
var axis = isHorizontal ? 'horizontal' : 'vertical';
|
|
148
|
-
var
|
|
149
|
-
var
|
|
150
|
-
var cssStyles = [styles.euiResizablePanel, isCollapsed && styles.collapsed, styles.paddingSizes[wrapperPadding], wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.css];
|
|
151
|
-
var contentStyles = (0, _resizable_panel.euiResizablePanelContentStyles)(euiTheme);
|
|
148
|
+
var cssStyles = [_resizable_panel.euiResizablePanelStyles.euiResizablePanel, isCollapsed && _resizable_panel.euiResizablePanelStyles.collapsed, (0, _global_styling.useEuiPaddingCSS)()[wrapperPadding], wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.css];
|
|
149
|
+
var contentStyles = (0, _services.useEuiMemoizedStyles)(_resizable_panel.euiResizablePanelContentStyles);
|
|
152
150
|
var contentCssStyles = [contentStyles.euiResizablePanel__content, scrollable && contentStyles.scrollable, isCollapsed && contentStyles.collapsedChildren, isCollapsed && !isCollapsible && contentStyles[axis].collapsed, isCollapsible && contentStyles[axis].hasCollapsibleButton];
|
|
153
151
|
var classes = (0, _classnames.default)('euiResizablePanel', wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.className);
|
|
154
152
|
var panelClasses = (0, _classnames.default)('euiResizablePanel__content', className);
|
|
155
153
|
var inlineStyles = _objectSpread(_objectSpread({}, wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.style), isHorizontal ? (0, _global_styling.logicalSizeStyle)("".concat(size || innerSize, "%"), 'auto') : (0, _global_styling.logicalSizeStyle)('100%', "".concat(size || innerSize, "%")));
|
|
156
|
-
var padding = (0, _global_styling.
|
|
154
|
+
var padding = (0, _global_styling.useEuiPaddingSize)(paddingSize) || '0px';
|
|
157
155
|
(0, _react.useEffect)(function () {
|
|
158
156
|
if (!registration) return;
|
|
159
157
|
var initSize = size !== null && size !== void 0 ? size : initialSize || 0;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.euiResizablePanelStyles = exports.euiResizablePanelContentStyles = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
7
|
var _react = require("@emotion/react");
|
|
10
8
|
var _global_styling = require("../../global_styling");
|
|
11
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
9
|
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)."; } /*
|
|
14
10
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
15
11
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -17,28 +13,23 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
17
13
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
18
14
|
* Side Public License, v 1.
|
|
19
15
|
*/
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return {
|
|
38
|
-
euiResizablePanel: _ref3,
|
|
39
|
-
collapsed: _ref2,
|
|
40
|
-
paddingSizes: _objectSpread({}, (0, _global_styling.euiPaddingSizeCSS)(euiThemeContext))
|
|
41
|
-
};
|
|
16
|
+
var euiResizablePanelStyles = {
|
|
17
|
+
euiResizablePanel: process.env.NODE_ENV === "production" ? {
|
|
18
|
+
name: "15ifdgc-euiResizablePanel",
|
|
19
|
+
styles: "position:relative;label:euiResizablePanel;"
|
|
20
|
+
} : {
|
|
21
|
+
name: "15ifdgc-euiResizablePanel",
|
|
22
|
+
styles: "position:relative;label:euiResizablePanel;",
|
|
23
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
24
|
+
},
|
|
25
|
+
collapsed: process.env.NODE_ENV === "production" ? {
|
|
26
|
+
name: "11qmbh3-collapsed",
|
|
27
|
+
styles: "overflow:hidden;label:collapsed;"
|
|
28
|
+
} : {
|
|
29
|
+
name: "11qmbh3-collapsed",
|
|
30
|
+
styles: "overflow:hidden;label:collapsed;",
|
|
31
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
32
|
+
}
|
|
42
33
|
};
|
|
43
34
|
exports.euiResizablePanelStyles = euiResizablePanelStyles;
|
|
44
35
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
@@ -421,14 +421,33 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
421
421
|
key: "componentDidUpdate",
|
|
422
422
|
value: function componentDidUpdate(prevProps) {
|
|
423
423
|
var _this$props9 = this.props,
|
|
424
|
+
isVirtualized = _this$props9.isVirtualized,
|
|
424
425
|
activeOptionIndex = _this$props9.activeOptionIndex,
|
|
425
426
|
visibleOptions = _this$props9.visibleOptions,
|
|
426
427
|
options = _this$props9.options;
|
|
427
|
-
if (
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
428
|
+
if (prevProps.activeOptionIndex !== activeOptionIndex) {
|
|
429
|
+
var makeOptionId = this.props.makeOptionId;
|
|
430
|
+
if (this.listBoxRef && this.props.searchable !== true) {
|
|
431
|
+
this.listBoxRef.setAttribute('aria-activedescendant', makeOptionId(activeOptionIndex));
|
|
432
|
+
}
|
|
433
|
+
if (typeof activeOptionIndex !== 'undefined') {
|
|
434
|
+
if (isVirtualized) {
|
|
435
|
+
var _this$listRef;
|
|
436
|
+
(_this$listRef = this.listRef) === null || _this$listRef === void 0 ? void 0 : _this$listRef.scrollToItem(activeOptionIndex, 'auto');
|
|
437
|
+
} else {
|
|
438
|
+
var _this$listBoxRef;
|
|
439
|
+
var activeOptionId = "#".concat(makeOptionId(activeOptionIndex));
|
|
440
|
+
var activeOptionEl = (_this$listBoxRef = this.listBoxRef) === null || _this$listBoxRef === void 0 ? void 0 : _this$listBoxRef.querySelector(activeOptionId);
|
|
441
|
+
if (activeOptionEl) {
|
|
442
|
+
var _activeOptionEl$scrol;
|
|
443
|
+
// TODO: we can remove scrollIntoView's conditional chaining once jsdom stubs it
|
|
444
|
+
// @see https://github.com/jsdom/jsdom/issues/1695
|
|
445
|
+
(_activeOptionEl$scrol = activeOptionEl.scrollIntoView) === null || _activeOptionEl$scrol === void 0 ? void 0 : _activeOptionEl$scrol.call(activeOptionEl, {
|
|
446
|
+
block: 'nearest'
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
432
451
|
}
|
|
433
452
|
if (prevProps.visibleOptions !== visibleOptions || prevProps.options !== options) {
|
|
434
453
|
var optionArray = visibleOptions || options;
|
|
@@ -471,14 +490,18 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
471
490
|
textWrap = _this$props10.textWrap,
|
|
472
491
|
truncationProps = _this$props10.truncationProps,
|
|
473
492
|
rest = (0, _objectWithoutProperties2.default)(_this$props10, _excluded3);
|
|
493
|
+
var heightIsFull = forcedHeight === 'full';
|
|
474
494
|
var classes = (0, _classnames.default)('euiSelectableList', {
|
|
475
|
-
'euiSelectableList-fullHeight':
|
|
495
|
+
'euiSelectableList-fullHeight': heightIsFull,
|
|
476
496
|
'euiSelectableList-bordered': bordered
|
|
477
497
|
}, className);
|
|
478
498
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
479
499
|
className: classes
|
|
480
500
|
}, rest), isVirtualized ? this.renderVirtualizedList() : (0, _react2.jsx)("div", {
|
|
481
501
|
className: "euiSelectableList__list",
|
|
502
|
+
style: !heightIsFull ? {
|
|
503
|
+
blockSize: forcedHeight
|
|
504
|
+
} : undefined,
|
|
482
505
|
ref: this.removeScrollableTabStop
|
|
483
506
|
}, (0, _react2.jsx)("ul", {
|
|
484
507
|
ref: this.setListBoxRef
|
|
@@ -8,6 +8,7 @@ exports.EuiIconTip = void 0;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _i18n = require("../i18n");
|
|
11
12
|
var _icon = require("../icon");
|
|
12
13
|
var _tool_tip = require("./tool_tip");
|
|
13
14
|
var _react2 = require("@emotion/react");
|
|
@@ -22,8 +23,7 @@ var _excluded = ["type", "aria-label", "color", "size", "iconProps", "position",
|
|
|
22
23
|
var EuiIconTip = function EuiIconTip(_ref) {
|
|
23
24
|
var _ref$type = _ref.type,
|
|
24
25
|
type = _ref$type === void 0 ? 'questionInCircle' : _ref$type,
|
|
25
|
-
|
|
26
|
-
ariaLabel = _ref$ariaLabel === void 0 ? 'Info' : _ref$ariaLabel,
|
|
26
|
+
ariaLabel = _ref['aria-label'],
|
|
27
27
|
color = _ref.color,
|
|
28
28
|
size = _ref.size,
|
|
29
29
|
iconProps = _ref.iconProps,
|
|
@@ -32,6 +32,7 @@ var EuiIconTip = function EuiIconTip(_ref) {
|
|
|
32
32
|
_ref$delay = _ref.delay,
|
|
33
33
|
delay = _ref$delay === void 0 ? 'regular' : _ref$delay,
|
|
34
34
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
35
|
+
var defaultAriaLabel = (0, _i18n.useEuiI18n)('euiIconTip.defaultAriaLabel', 'Info');
|
|
35
36
|
return (0, _react2.jsx)(_tool_tip.EuiToolTip, (0, _extends2.default)({
|
|
36
37
|
position: position,
|
|
37
38
|
delay: delay
|
|
@@ -40,7 +41,7 @@ var EuiIconTip = function EuiIconTip(_ref) {
|
|
|
40
41
|
type: type,
|
|
41
42
|
color: color,
|
|
42
43
|
size: size,
|
|
43
|
-
"aria-label": ariaLabel
|
|
44
|
+
"aria-label": ariaLabel || defaultAriaLabel
|
|
44
45
|
}, iconProps)));
|
|
45
46
|
};
|
|
46
47
|
exports.EuiIconTip = EuiIconTip;
|