@elastic/eui 72.0.0 → 72.2.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_charts_theme.js +13 -1
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +0 -151
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -151
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/accordion/accordion.js +1 -1
- package/es/components/basic_table/basic_table.js +2 -2
- package/es/components/basic_table/in_memory_table.js +3 -6
- package/es/components/basic_table/table.a11y.js +128 -0
- package/es/components/color_picker/color_picker.styles.js +16 -0
- package/es/components/color_picker/color_stops/color_stop_thumb.js +19 -7
- package/es/components/color_picker/color_stops/color_stop_thumb.styles.js +59 -0
- package/es/components/color_picker/color_stops/color_stops.js +25 -15
- package/es/components/color_picker/color_stops/color_stops.styles.js +65 -0
- package/es/components/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/es/components/date_picker/super_date_picker/super_update_button.js +8 -0
- package/es/components/form/range/range_highlight.styles.js +1 -1
- package/es/components/form/range/range_levels.styles.js +1 -1
- package/es/components/form/range/range_track.js +5 -2
- package/es/components/image/image.a11y.js +55 -0
- package/es/components/image/image.js +9 -2
- package/es/components/image/image_fullscreen_wrapper.js +3 -1
- package/es/components/image/image_wrapper.js +3 -1
- package/es/components/key_pad_menu/key_pad_menu.a11y.js +158 -0
- package/es/components/markdown_editor/markdown_format.styles.js +2 -5
- package/es/components/popover/popover.js +2 -2
- package/es/components/table/table_footer_cell.js +1 -1
- package/es/components/table/table_header_cell.js +1 -1
- package/es/components/table/table_row_cell.js +2 -2
- package/es/components/text/text.styles.js +6 -3
- package/es/components/tool_tip/icon_tip.js +8 -0
- package/es/components/tool_tip/tool_tip.js +24 -1
- package/es/components/tour/tour.styles.js +1 -1
- package/es/services/color/manipulation.js +9 -0
- package/es/services/index.js +11 -11
- package/eui.d.ts +166 -107
- package/i18ntokens.json +16 -16
- package/lib/components/accordion/accordion.js +1 -1
- package/lib/components/basic_table/basic_table.js +2 -2
- package/lib/components/basic_table/in_memory_table.js +3 -6
- package/lib/components/basic_table/table.a11y.js +139 -0
- package/lib/components/color_picker/color_picker.styles.js +26 -0
- package/lib/components/color_picker/color_stops/color_stop_thumb.js +19 -6
- package/lib/components/color_picker/color_stops/color_stop_thumb.styles.js +69 -0
- package/lib/components/color_picker/color_stops/color_stops.js +25 -14
- package/lib/components/color_picker/color_stops/color_stops.styles.js +73 -0
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/lib/components/date_picker/super_date_picker/super_update_button.js +8 -0
- package/lib/components/form/range/range_highlight.styles.js +1 -1
- package/lib/components/form/range/range_levels.styles.js +1 -1
- package/lib/components/form/range/range_track.js +6 -2
- package/lib/components/image/image.a11y.js +61 -0
- package/lib/components/image/image.js +9 -2
- package/lib/components/image/image_fullscreen_wrapper.js +3 -1
- package/lib/components/image/image_wrapper.js +3 -1
- package/lib/components/key_pad_menu/key_pad_menu.a11y.js +163 -0
- package/lib/components/markdown_editor/markdown_format.styles.js +1 -4
- package/lib/components/popover/popover.js +2 -2
- package/lib/components/table/table_footer_cell.js +1 -1
- package/lib/components/table/table_header_cell.js +1 -1
- package/lib/components/table/table_row_cell.js +2 -2
- package/lib/components/text/text.styles.js +5 -2
- package/lib/components/tool_tip/icon_tip.js +8 -0
- package/lib/components/tool_tip/tool_tip.js +24 -1
- package/lib/components/tour/tour.styles.js +1 -1
- package/lib/services/color/manipulation.js +14 -2
- package/lib/services/index.js +65 -58
- package/optimize/es/components/accordion/accordion.js +1 -1
- package/optimize/es/components/basic_table/table.a11y.js +128 -0
- package/optimize/es/components/color_picker/color_picker.styles.js +16 -0
- package/optimize/es/components/color_picker/color_stops/color_stop_thumb.js +19 -7
- package/optimize/es/components/color_picker/color_stops/color_stop_thumb.styles.js +59 -0
- package/optimize/es/components/color_picker/color_stops/color_stops.js +25 -15
- package/optimize/es/components/color_picker/color_stops/color_stops.styles.js +65 -0
- package/optimize/es/components/form/range/range_highlight.styles.js +1 -1
- package/optimize/es/components/form/range/range_levels.styles.js +1 -1
- package/optimize/es/components/form/range/range_track.js +5 -2
- package/optimize/es/components/image/image.a11y.js +55 -0
- package/optimize/es/components/image/image.js +4 -2
- package/optimize/es/components/image/image_fullscreen_wrapper.js +3 -1
- package/optimize/es/components/image/image_wrapper.js +3 -1
- package/optimize/es/components/key_pad_menu/key_pad_menu.a11y.js +148 -0
- package/optimize/es/components/markdown_editor/markdown_format.styles.js +2 -5
- package/optimize/es/components/popover/popover.js +2 -2
- package/optimize/es/components/text/text.styles.js +6 -3
- package/optimize/es/components/tool_tip/tool_tip.js +16 -1
- package/optimize/es/components/tour/tour.styles.js +1 -1
- package/optimize/es/services/color/manipulation.js +9 -0
- package/optimize/es/services/index.js +11 -11
- package/optimize/lib/components/accordion/accordion.js +1 -1
- package/optimize/lib/components/basic_table/table.a11y.js +139 -0
- package/optimize/lib/components/color_picker/color_picker.styles.js +26 -0
- package/optimize/lib/components/color_picker/color_stops/color_stop_thumb.js +19 -6
- package/optimize/lib/components/color_picker/color_stops/color_stop_thumb.styles.js +69 -0
- package/optimize/lib/components/color_picker/color_stops/color_stops.js +25 -14
- package/optimize/lib/components/color_picker/color_stops/color_stops.styles.js +73 -0
- package/optimize/lib/components/form/range/range_highlight.styles.js +1 -1
- package/optimize/lib/components/form/range/range_levels.styles.js +1 -1
- package/optimize/lib/components/form/range/range_track.js +6 -2
- package/optimize/lib/components/image/image.a11y.js +61 -0
- package/optimize/lib/components/image/image.js +4 -2
- package/optimize/lib/components/image/image_fullscreen_wrapper.js +3 -1
- package/optimize/lib/components/image/image_wrapper.js +3 -1
- package/optimize/lib/components/key_pad_menu/key_pad_menu.a11y.js +163 -0
- package/optimize/lib/components/markdown_editor/markdown_format.styles.js +1 -4
- package/optimize/lib/components/popover/popover.js +2 -2
- package/optimize/lib/components/text/text.styles.js +5 -2
- package/optimize/lib/components/tool_tip/tool_tip.js +16 -1
- package/optimize/lib/components/tour/tour.styles.js +1 -1
- package/optimize/lib/services/color/manipulation.js +14 -2
- package/optimize/lib/services/index.js +65 -58
- package/package.json +2 -2
- package/src/components/color_picker/_index.scss +0 -1
- package/src/components/markdown_editor/_markdown_format.scss +0 -4
- package/src/themes/amsterdam/overrides/_index.scss +0 -1
- package/test-env/components/accordion/accordion.js +1 -1
- package/test-env/components/basic_table/basic_table.js +2 -2
- package/test-env/components/basic_table/in_memory_table.js +3 -6
- package/test-env/components/basic_table/table.a11y.js +139 -0
- package/test-env/components/color_picker/color_picker.styles.js +26 -0
- package/test-env/components/color_picker/color_stops/color_stop_thumb.js +19 -6
- package/test-env/components/color_picker/color_stops/color_stop_thumb.styles.js +69 -0
- package/test-env/components/color_picker/color_stops/color_stops.js +25 -14
- package/test-env/components/color_picker/color_stops/color_stops.styles.js +73 -0
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/test-env/components/date_picker/super_date_picker/super_update_button.js +8 -0
- package/test-env/components/form/range/range_highlight.styles.js +1 -1
- package/test-env/components/form/range/range_levels.styles.js +1 -1
- package/test-env/components/form/range/range_track.js +6 -2
- package/test-env/components/image/image.a11y.js +61 -0
- package/test-env/components/image/image.js +9 -2
- package/test-env/components/image/image_fullscreen_wrapper.js +3 -1
- package/test-env/components/image/image_wrapper.js +3 -1
- package/test-env/components/key_pad_menu/key_pad_menu.a11y.js +163 -0
- package/test-env/components/markdown_editor/markdown_format.styles.js +1 -4
- package/test-env/components/popover/popover.js +2 -2
- package/test-env/components/table/table_footer_cell.js +1 -1
- package/test-env/components/table/table_header_cell.js +1 -1
- package/test-env/components/table/table_row_cell.js +2 -2
- package/test-env/components/text/text.styles.js +5 -2
- package/test-env/components/tool_tip/icon_tip.js +8 -0
- package/test-env/components/tool_tip/tool_tip.js +24 -1
- package/test-env/components/tour/tour.styles.js +1 -1
- package/test-env/services/color/manipulation.js +14 -2
- package/test-env/services/index.js +65 -58
- package/src/components/color_picker/color_stops/_color_stops.scss +0 -101
- package/src/components/color_picker/color_stops/_index.scss +0 -1
- package/src/themes/amsterdam/overrides/_color_stops.scss +0 -58
|
@@ -35,7 +35,7 @@ var _image_types = require("./image_types");
|
|
|
35
35
|
|
|
36
36
|
var _react2 = require("@emotion/react");
|
|
37
37
|
|
|
38
|
-
var _excluded = ["className", "alt", "url", "src", "size", "hasShadow", "style", "wrapperProps", "fullScreenIconColor", "allowFullScreen", "caption", "float", "margin"];
|
|
38
|
+
var _excluded = ["className", "alt", "url", "src", "size", "hasShadow", "style", "wrapperProps", "fullScreenIconColor", "allowFullScreen", "caption", "float", "margin", "onFullScreen"];
|
|
39
39
|
|
|
40
40
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
41
41
|
|
|
@@ -60,6 +60,7 @@ var EuiImage = function EuiImage(_ref) {
|
|
|
60
60
|
caption = _ref.caption,
|
|
61
61
|
float = _ref.float,
|
|
62
62
|
margin = _ref.margin,
|
|
63
|
+
onFullScreen = _ref.onFullScreen,
|
|
63
64
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
64
65
|
|
|
65
66
|
var _useState = (0, _react.useState)(false),
|
|
@@ -91,7 +92,8 @@ var EuiImage = function EuiImage(_ref) {
|
|
|
91
92
|
alt: alt,
|
|
92
93
|
caption: caption,
|
|
93
94
|
float: float,
|
|
94
|
-
margin: margin
|
|
95
|
+
margin: margin,
|
|
96
|
+
onFullScreen: onFullScreen
|
|
95
97
|
};
|
|
96
98
|
|
|
97
99
|
var commonImgProps = _objectSpread({
|
|
@@ -165,6 +167,11 @@ EuiImage.propTypes = {
|
|
|
165
167
|
*/
|
|
166
168
|
allowFullScreen: _propTypes.default.bool,
|
|
167
169
|
|
|
170
|
+
/**
|
|
171
|
+
* Callback when the image is clicked and `allowFullScreen` is `true`
|
|
172
|
+
*/
|
|
173
|
+
onFullScreen: _propTypes.default.func,
|
|
174
|
+
|
|
168
175
|
/**
|
|
169
176
|
* Changes the color of the icon that floats above the image when it can be clicked to fullscreen.
|
|
170
177
|
* The default value of `light` is fine unless your image has a white background, in which case you should change it to `dark`.
|
|
@@ -52,7 +52,8 @@ var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref) {
|
|
|
52
52
|
setIsFullScreen = _ref.setIsFullScreen,
|
|
53
53
|
wrapperProps = _ref.wrapperProps,
|
|
54
54
|
isFullWidth = _ref.isFullWidth,
|
|
55
|
-
fullScreenIconColor = _ref.fullScreenIconColor
|
|
55
|
+
fullScreenIconColor = _ref.fullScreenIconColor,
|
|
56
|
+
onFullScreen = _ref.onFullScreen;
|
|
56
57
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
57
58
|
var styles = (0, _image_fullscreen_wrapper.euiImageFullscreenWrapperStyles)(euiTheme);
|
|
58
59
|
var cssStyles = [styles.euiImageFullscreenWrapper];
|
|
@@ -68,6 +69,7 @@ var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref) {
|
|
|
68
69
|
|
|
69
70
|
var closeFullScreen = function closeFullScreen() {
|
|
70
71
|
setIsFullScreen(false);
|
|
72
|
+
onFullScreen === null || onFullScreen === void 0 ? void 0 : onFullScreen(false);
|
|
71
73
|
};
|
|
72
74
|
|
|
73
75
|
var _useInnerText = (0, _inner_text.useInnerText)(),
|
|
@@ -47,10 +47,12 @@ var EuiImageWrapper = function EuiImageWrapper(_ref) {
|
|
|
47
47
|
setIsFullScreen = _ref.setIsFullScreen,
|
|
48
48
|
wrapperProps = _ref.wrapperProps,
|
|
49
49
|
fullScreenIconColor = _ref.fullScreenIconColor,
|
|
50
|
-
isFullWidth = _ref.isFullWidth
|
|
50
|
+
isFullWidth = _ref.isFullWidth,
|
|
51
|
+
onFullScreen = _ref.onFullScreen;
|
|
51
52
|
|
|
52
53
|
var openFullScreen = function openFullScreen() {
|
|
53
54
|
setIsFullScreen(true);
|
|
55
|
+
onFullScreen === null || onFullScreen === void 0 ? void 0 : onFullScreen(true);
|
|
54
56
|
};
|
|
55
57
|
|
|
56
58
|
var classes = (0, _classnames.default)('euiImageWrapper', wrapperProps && wrapperProps.className);
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
8
|
+
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
|
|
11
|
+
var _key_pad_menu = require("./key_pad_menu");
|
|
12
|
+
|
|
13
|
+
var _key_pad_menu_item = require("./key_pad_menu_item");
|
|
14
|
+
|
|
15
|
+
var _icon = require("../icon");
|
|
16
|
+
|
|
17
|
+
var _services = require("../../services");
|
|
18
|
+
|
|
19
|
+
var _react2 = require("@emotion/react");
|
|
20
|
+
|
|
21
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
|
+
|
|
23
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
24
|
+
|
|
25
|
+
/*
|
|
26
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
27
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
28
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
29
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
30
|
+
* Side Public License, v 1.
|
|
31
|
+
*/
|
|
32
|
+
/// <reference types="../../../cypress/support"/>
|
|
33
|
+
var KeyPadMenu = function KeyPadMenu() {
|
|
34
|
+
var keypadButtonId__1 = (0, _services.useGeneratedHtmlId)({
|
|
35
|
+
prefix: 'keypadButton',
|
|
36
|
+
suffix: 'first'
|
|
37
|
+
});
|
|
38
|
+
var keypadButtonId__2 = (0, _services.useGeneratedHtmlId)({
|
|
39
|
+
prefix: 'keypadButton',
|
|
40
|
+
suffix: 'second'
|
|
41
|
+
});
|
|
42
|
+
var keypadButtonId__3 = (0, _services.useGeneratedHtmlId)({
|
|
43
|
+
prefix: 'keypadButton',
|
|
44
|
+
suffix: 'third'
|
|
45
|
+
});
|
|
46
|
+
var keypadButtonId__4 = (0, _services.useGeneratedHtmlId)({
|
|
47
|
+
prefix: 'keypadButton',
|
|
48
|
+
suffix: 'fourth'
|
|
49
|
+
});
|
|
50
|
+
var keypadButtonId__5 = (0, _services.useGeneratedHtmlId)({
|
|
51
|
+
prefix: 'keypadButton',
|
|
52
|
+
suffix: 'fifth'
|
|
53
|
+
});
|
|
54
|
+
var keypadButtonId__6 = (0, _services.useGeneratedHtmlId)({
|
|
55
|
+
prefix: 'keypadButton',
|
|
56
|
+
suffix: 'sixth'
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
var _useState = (0, _react.useState)(keypadButtonId__6),
|
|
60
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
61
|
+
selectedID = _useState2[0],
|
|
62
|
+
setSelectedID = _useState2[1];
|
|
63
|
+
|
|
64
|
+
return (0, _react2.jsx)("div", {
|
|
65
|
+
"aria-label": "Menu keypad"
|
|
66
|
+
}, (0, _react2.jsx)(_key_pad_menu.EuiKeyPadMenu, null, (0, _react2.jsx)(_key_pad_menu_item.EuiKeyPadMenuItem, {
|
|
67
|
+
"data-test-subj": "cy-keypad-button-1",
|
|
68
|
+
id: keypadButtonId__1,
|
|
69
|
+
label: "Button 1",
|
|
70
|
+
isSelected: selectedID === keypadButtonId__1,
|
|
71
|
+
onClick: function onClick() {
|
|
72
|
+
return setSelectedID(keypadButtonId__1);
|
|
73
|
+
}
|
|
74
|
+
}, (0, _react2.jsx)(_icon.EuiIcon, {
|
|
75
|
+
type: "grid",
|
|
76
|
+
size: "l"
|
|
77
|
+
})), (0, _react2.jsx)(_key_pad_menu_item.EuiKeyPadMenuItem, {
|
|
78
|
+
"data-test-subj": "cy-keypad-button-2",
|
|
79
|
+
id: keypadButtonId__2,
|
|
80
|
+
label: "Button 2",
|
|
81
|
+
isSelected: selectedID === keypadButtonId__2,
|
|
82
|
+
onClick: function onClick() {
|
|
83
|
+
return setSelectedID(keypadButtonId__2);
|
|
84
|
+
}
|
|
85
|
+
}, (0, _react2.jsx)(_icon.EuiIcon, {
|
|
86
|
+
type: "grid",
|
|
87
|
+
size: "l"
|
|
88
|
+
})), (0, _react2.jsx)(_key_pad_menu_item.EuiKeyPadMenuItem, {
|
|
89
|
+
"data-test-subj": "cy-keypad-button-3",
|
|
90
|
+
id: keypadButtonId__3,
|
|
91
|
+
label: "Button 3",
|
|
92
|
+
isSelected: selectedID === keypadButtonId__3,
|
|
93
|
+
onClick: function onClick() {
|
|
94
|
+
return setSelectedID(keypadButtonId__3);
|
|
95
|
+
}
|
|
96
|
+
}, (0, _react2.jsx)(_icon.EuiIcon, {
|
|
97
|
+
type: "grid",
|
|
98
|
+
size: "l"
|
|
99
|
+
})), (0, _react2.jsx)(_key_pad_menu_item.EuiKeyPadMenuItem, {
|
|
100
|
+
"data-test-subj": "cy-keypad-link-1",
|
|
101
|
+
id: keypadButtonId__4,
|
|
102
|
+
label: "Link 1",
|
|
103
|
+
href: "#/navigation/key-pad-menu",
|
|
104
|
+
isSelected: selectedID === keypadButtonId__4,
|
|
105
|
+
onClick: function onClick() {
|
|
106
|
+
return setSelectedID(keypadButtonId__4);
|
|
107
|
+
}
|
|
108
|
+
}, (0, _react2.jsx)(_icon.EuiIcon, {
|
|
109
|
+
type: "link",
|
|
110
|
+
size: "l"
|
|
111
|
+
})), (0, _react2.jsx)(_key_pad_menu_item.EuiKeyPadMenuItem, {
|
|
112
|
+
"data-test-subj": "cy-keypad-link-2",
|
|
113
|
+
id: keypadButtonId__5,
|
|
114
|
+
label: "Link 2",
|
|
115
|
+
href: "#/navigation/key-pad-menu",
|
|
116
|
+
isSelected: selectedID === keypadButtonId__5,
|
|
117
|
+
onClick: function onClick() {
|
|
118
|
+
return setSelectedID(keypadButtonId__5);
|
|
119
|
+
}
|
|
120
|
+
}, (0, _react2.jsx)(_icon.EuiIcon, {
|
|
121
|
+
type: "link",
|
|
122
|
+
size: "l"
|
|
123
|
+
})), (0, _react2.jsx)(_key_pad_menu_item.EuiKeyPadMenuItem, {
|
|
124
|
+
"data-test-subj": "cy-keypad-link-3",
|
|
125
|
+
id: keypadButtonId__6,
|
|
126
|
+
label: "Disabled Link 3",
|
|
127
|
+
isDisabled: true,
|
|
128
|
+
isSelected: selectedID === keypadButtonId__6
|
|
129
|
+
}, (0, _react2.jsx)(_icon.EuiIcon, {
|
|
130
|
+
type: "link",
|
|
131
|
+
size: "l"
|
|
132
|
+
}))));
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
beforeEach(function () {
|
|
136
|
+
cy.realMount((0, _react2.jsx)(KeyPadMenu, null));
|
|
137
|
+
cy.get('div[aria-label="Menu keypad"]').should('exist');
|
|
138
|
+
});
|
|
139
|
+
describe('EuiKeyPadMenu', function () {
|
|
140
|
+
describe('Automated accessibility check', function () {
|
|
141
|
+
it('has zero violations on first render', function () {
|
|
142
|
+
cy.checkAxe();
|
|
143
|
+
});
|
|
144
|
+
it('has zero violations on item click', function () {
|
|
145
|
+
cy.get('a[data-test-subj="cy-keypad-link-2"]').realClick();
|
|
146
|
+
cy.get('a[data-test-subj="cy-keypad-link-2"]').should('have.class', 'euiKeyPadMenuItem-isSelected');
|
|
147
|
+
cy.checkAxe();
|
|
148
|
+
});
|
|
149
|
+
it('has zero violations on item keypress', function () {
|
|
150
|
+
cy.repeatRealPress('Tab', 3);
|
|
151
|
+
cy.get('button[data-test-subj="cy-keypad-button-3"]').should('have.focus');
|
|
152
|
+
cy.realPress('Space');
|
|
153
|
+
cy.get('button[data-test-subj="cy-keypad-button-3"]').should('have.class', 'euiKeyPadMenuItem-isSelected');
|
|
154
|
+
cy.checkAxe();
|
|
155
|
+
cy.realPress(['Shift', 'Tab']);
|
|
156
|
+
cy.get('button[data-test-subj="cy-keypad-button-2"]').should('have.focus');
|
|
157
|
+
cy.realPress('Space');
|
|
158
|
+
cy.get('button[data-test-subj="cy-keypad-button-2"]').should('have.class', 'euiKeyPadMenuItem-isSelected');
|
|
159
|
+
cy.get('button[data-test-subj="cy-keypad-button-3"]').should('not.have.class', 'euiKeyPadMenuItem-isSelected');
|
|
160
|
+
cy.checkAxe();
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
});
|
|
@@ -29,16 +29,13 @@ var euiScaleMarkdownFormatText = function euiScaleMarkdownFormatText(euiTheme, o
|
|
|
29
29
|
var measurement = options.measurement;
|
|
30
30
|
var lineHeightSize = measurement === 'em' ? "".concat(lineHeight, "em") : lineHeight; // Custom scales
|
|
31
31
|
|
|
32
|
-
var blockQuoteBorderWidth = (0, _global_styling.mathWithUnits)(fontSize, function (x) {
|
|
33
|
-
return x / 4;
|
|
34
|
-
});
|
|
35
32
|
var tablePaddingVertical = (0, _global_styling.mathWithUnits)(fontSize, function (x) {
|
|
36
33
|
return x / 4;
|
|
37
34
|
});
|
|
38
35
|
var tablePaddingHorizontal = (0, _global_styling.mathWithUnits)(fontSize, function (x) {
|
|
39
36
|
return x / 2;
|
|
40
37
|
});
|
|
41
|
-
return "\n .
|
|
38
|
+
return "\n .euiCheckbox .euiCheckbox__input ~ .euiCheckbox__label { // Extra specificity necessary to override default checkbox CSS\n font-size: ".concat(fontSize, ";\n ").concat((0, _global_styling.logicalCSS)('padding-left', lineHeightSize), "\n line-height: ").concat(lineHeight, ";\n }\n\n .euiCheckbox + *:not(.euiCheckbox) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', fontSize), "\n }\n\n .euiMarkdownFormat__codeblockWrapper {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table th,\n .euiMarkdownFormat__table td {\n ").concat((0, _global_styling.logicalCSS)('padding-vertical', tablePaddingVertical), "\n ").concat((0, _global_styling.logicalCSS)('padding-horizontal', tablePaddingHorizontal), "\n }\n ");
|
|
42
39
|
};
|
|
43
40
|
/**
|
|
44
41
|
* Styles
|
|
@@ -491,13 +491,13 @@ var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
491
491
|
panel = (0, _react.jsx)(_portal.EuiPortal, {
|
|
492
492
|
insert: insert
|
|
493
493
|
}, (0, _react.jsx)(_focus_trap.EuiFocusTrap, (0, _extends2.default)({
|
|
494
|
-
clickOutsideDisables: true
|
|
494
|
+
clickOutsideDisables: true,
|
|
495
|
+
onClickOutside: this.onClickOutside
|
|
495
496
|
}, focusTrapProps, {
|
|
496
497
|
returnFocus: returnFocus // Ignore temporary state of indecisive focus
|
|
497
498
|
,
|
|
498
499
|
initialFocus: initialFocus,
|
|
499
500
|
onDeactivation: onTrapDeactivation,
|
|
500
|
-
onClickOutside: this.onClickOutside,
|
|
501
501
|
onEscapeKey: this.onEscapeKey,
|
|
502
502
|
disabled: !ownFocus || !this.state.isOpenStable || this.state.isClosing
|
|
503
503
|
}), (0, _react.jsx)(_popover_panel.EuiPopoverPanel, (0, _extends2.default)({}, panelProps, {
|
|
@@ -55,6 +55,6 @@ EuiTableFooterCell.propTypes = {
|
|
|
55
55
|
"aria-label": _propTypes.default.string,
|
|
56
56
|
"data-test-subj": _propTypes.default.string,
|
|
57
57
|
css: _propTypes.default.any,
|
|
58
|
-
align: _propTypes.default.
|
|
58
|
+
align: _propTypes.default.any,
|
|
59
59
|
width: _propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.number.isRequired])
|
|
60
60
|
};
|
|
@@ -148,7 +148,7 @@ EuiTableHeaderCell.propTypes = {
|
|
|
148
148
|
"aria-label": _propTypes.default.string,
|
|
149
149
|
"data-test-subj": _propTypes.default.string,
|
|
150
150
|
css: _propTypes.default.any,
|
|
151
|
-
align: _propTypes.default.
|
|
151
|
+
align: _propTypes.default.any,
|
|
152
152
|
isSortAscending: _propTypes.default.bool,
|
|
153
153
|
isSorted: _propTypes.default.bool,
|
|
154
154
|
|
|
@@ -208,7 +208,7 @@ EuiTableRowCell.propTypes = {
|
|
|
208
208
|
/**
|
|
209
209
|
* Horizontal alignment of the text in the cell
|
|
210
210
|
*/
|
|
211
|
-
align: _propTypes.default.
|
|
211
|
+
align: _propTypes.default.any,
|
|
212
212
|
|
|
213
213
|
/**
|
|
214
214
|
* _Should only be used for action cells_
|
|
@@ -230,7 +230,7 @@ EuiTableRowCell.propTypes = {
|
|
|
230
230
|
/**
|
|
231
231
|
* Horizontal alignment of the text in the cell
|
|
232
232
|
*/
|
|
233
|
-
align: _propTypes.default.
|
|
233
|
+
align: _propTypes.default.any,
|
|
234
234
|
|
|
235
235
|
/**
|
|
236
236
|
* _Should only be used for action cells_
|
|
@@ -66,7 +66,10 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
|
|
|
66
66
|
return x * 2;
|
|
67
67
|
});
|
|
68
68
|
var headingMarginBottom = marginSize;
|
|
69
|
-
|
|
69
|
+
var blockQuoteBorderWidth = (0, _global_styling.mathWithUnits)(fontSize, function (x) {
|
|
70
|
+
return x / 4;
|
|
71
|
+
});
|
|
72
|
+
return "\n font-size: ".concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n\n h1 {\n font-size: ").concat(headings.h1.fontSize, ";\n line-height: ").concat(headings.h1.lineHeight, ";\n }\n h1:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n\n h2 {\n font-size: ").concat(headings.h2.fontSize, ";\n line-height: ").concat(headings.h2.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h3 {\n font-size: ").concat(headings.h3.fontSize, ";\n line-height: ").concat(headings.h3.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h4 {\n font-size: ").concat(headings.h4.fontSize, ";\n line-height: ").concat(headings.h4.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h5 {\n font-size: ").concat(headings.h5.fontSize, ";\n line-height: ").concat(headings.h5.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h6 {\n font-size: ").concat(headings.h6.fontSize, ";\n line-height: ").concat(headings.h6.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n p,\n ul,\n ol,\n dl,\n blockquote,\n img,\n pre {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', lineHeightSize), "\n }\n\n ul,\n ol {\n ").concat((0, _global_styling.logicalCSS)('margin-left', lineHeightSize), "\n }\n \n blockquote {\n font-size: ").concat(fontSize, ";\n ").concat((0, _global_styling.logicalShorthandCSS)('padding', "0 ".concat(fontSize)), "\n ").concat((0, _global_styling.logicalCSS)('border-left-width', blockQuoteBorderWidth), "\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n dd + dt {\n ").concat((0, _global_styling.logicalCSS)('margin-top', fontSize), "\n }\n\n dt,\n .eui-definitionListReverse dd {\n font-size: ").concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n }\n\n .eui-definitionListReverse dt {\n font-size: ").concat((0, _global_styling.euiFontSize)(euiThemeContext, 'xs', options).fontSize, ";\n color: ").concat(euiTheme.colors.text, ";\n }\n\n small {\n font-size: ").concat((0, _global_styling.euiFontSize)(euiThemeContext, 's', options).fontSize, ";\n }\n\n pre:not(.euiCodeBlock__pre) {\n padding: ").concat(lineHeightSize, ";\n }\n\n code:not(.euiCode):not(.euiCodeBlock__code) {\n font-size: .9em; // 90% of parent font size\n }\n ").concat( // when textSize is 'm', the 'kbd' element gets a line between the text and the border-bottom
|
|
70
73
|
_customScale === 'm' ? "\n kbd {\n ".concat((0, _global_styling.logicalCSS)('padding-bottom', euiTheme.size.xs), "\n // ensures when only one character the shape looks like a square\n ").concat((0, _global_styling.logicalCSS)('min-width', euiTheme.size.l), "\n ").concat((0, _global_styling.logicalTextAlignCSS)('center'), "\n }\n \n kbd::after {\n content: '';\n ").concat((0, _global_styling.logicalCSS)('border-bottom', "".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.colors.text)), "\n position: absolute;\n ").concat((0, _global_styling.logicalCSS)('bottom', euiTheme.size.xxs), "\n ").concat((0, _global_styling.logicalCSS)('left', 0), "\n ").concat((0, _global_styling.logicalCSS)('width', '100%'), "\n }") : '', "\n ");
|
|
71
74
|
};
|
|
72
75
|
/**
|
|
@@ -77,7 +80,7 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
|
|
|
77
80
|
var euiTextStyles = function euiTextStyles(euiThemeContext) {
|
|
78
81
|
var euiTheme = euiThemeContext.euiTheme;
|
|
79
82
|
return {
|
|
80
|
-
euiText: /*#__PURE__*/(0, _react.css)(euiText(euiTheme, true), ";clear:both;a:not([class]){", (0, _link.euiLinkCSS)(euiThemeContext), ";}img{display:block;", (0, _global_styling.logicalCSS)('max-width', '100%'), ";}ul{list-style:disc;}ol{list-style:decimal;}blockquote
|
|
83
|
+
euiText: /*#__PURE__*/(0, _react.css)(euiText(euiTheme, true), ";clear:both;a:not([class]){", (0, _link.euiLinkCSS)(euiThemeContext), ";}img{display:block;", (0, _global_styling.logicalCSS)('max-width', '100%'), ";}ul{list-style:disc;}ol{list-style:decimal;}blockquote{border-inline-start-color:", euiTheme.border.color, ";border-inline-start-style:solid;}blockquote:not(.euiMarkdownFormat__blockquote){color:", euiTheme.colors.subduedText, ";}h1{", (0, _title.euiTitle)(euiThemeContext, 'l'), ";}h2{", (0, _title.euiTitle)(euiThemeContext, 'm'), ";}h3{", (0, _title.euiTitle)(euiThemeContext, 's'), ";}h4,dt{", (0, _title.euiTitle)(euiThemeContext, 'xs'), ";}h5{", (0, _title.euiTitle)(euiThemeContext, 'xxs'), ";}h6{", (0, _title.euiTitle)(euiThemeContext, 'xxxs'), " text-transform:uppercase;}h1,h2,h3,h4,h5,h6,dt{color:inherit;}pre:not(.euiCodeBlock__pre){white-space:pre-wrap;background:", (0, _global_styling.euiBackgroundColor)(euiThemeContext, 'subdued'), ";color:", euiTheme.colors.text, ";}pre:not(.euiCodeBlock__pre),pre:not(.euiCodeBlock__pre) code{display:block;}>:last-child{", (0, _global_styling.logicalCSS)('margin-bottom', '0 !important'), ";}kbd{position:relative;display:inline-block;", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.xxs), " ", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.xs), " line-height:1;border:", euiTheme.border.width.thin, " solid ", euiTheme.colors.text, ";border-radius:", (0, _global_styling.mathWithUnits)(euiTheme.border.radius.small, function (x) {
|
|
81
84
|
return x / 2;
|
|
82
85
|
}), ";};label:euiText;"),
|
|
83
86
|
constrainedWidth: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-width', euiTextConstrainedMaxWidth), ";;label:constrainedWidth;"),
|
|
@@ -90,6 +90,14 @@ EuiIconTip.propTypes = {
|
|
|
90
90
|
*/
|
|
91
91
|
id: _propTypes.default.string,
|
|
92
92
|
|
|
93
|
+
/**
|
|
94
|
+
* When `true`, the tooltip's position is re-calculated when the user
|
|
95
|
+
* scrolls. This supports having fixed-position tooltip anchors.
|
|
96
|
+
*
|
|
97
|
+
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
98
|
+
*/
|
|
99
|
+
repositionOnScroll: _propTypes.default.bool,
|
|
100
|
+
|
|
93
101
|
/**
|
|
94
102
|
* If supplied, called when mouse movement causes the tool tip to be
|
|
95
103
|
* hidden.
|
|
@@ -51,7 +51,7 @@ var _resize_observer = require("../observer/resize_observer");
|
|
|
51
51
|
|
|
52
52
|
var _react3 = require("@emotion/react");
|
|
53
53
|
|
|
54
|
-
var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display"];
|
|
54
|
+
var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display", "repositionOnScroll"];
|
|
55
55
|
|
|
56
56
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
57
57
|
|
|
@@ -244,18 +244,32 @@ var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
244
244
|
key: "componentDidMount",
|
|
245
245
|
value: function componentDidMount() {
|
|
246
246
|
this._isMounted = true;
|
|
247
|
+
|
|
248
|
+
if (this.props.repositionOnScroll) {
|
|
249
|
+
window.addEventListener('scroll', this.positionToolTip, true);
|
|
250
|
+
}
|
|
247
251
|
}
|
|
248
252
|
}, {
|
|
249
253
|
key: "componentWillUnmount",
|
|
250
254
|
value: function componentWillUnmount() {
|
|
251
255
|
this.clearAnimationTimeout();
|
|
252
256
|
this._isMounted = false;
|
|
257
|
+
window.removeEventListener('scroll', this.positionToolTip, true);
|
|
253
258
|
}
|
|
254
259
|
}, {
|
|
255
260
|
key: "componentDidUpdate",
|
|
256
261
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
257
262
|
if (prevState.visible === false && this.state.visible === true) {
|
|
258
263
|
requestAnimationFrame(this.testAnchor);
|
|
264
|
+
} // update scroll listener
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
if (prevProps.repositionOnScroll !== this.props.repositionOnScroll) {
|
|
268
|
+
if (this.props.repositionOnScroll) {
|
|
269
|
+
window.addEventListener('scroll', this.positionToolTip, true);
|
|
270
|
+
} else {
|
|
271
|
+
window.removeEventListener('scroll', this.positionToolTip, true);
|
|
272
|
+
}
|
|
259
273
|
}
|
|
260
274
|
}
|
|
261
275
|
}, {
|
|
@@ -270,6 +284,7 @@ var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
270
284
|
title = _this$props.title,
|
|
271
285
|
delay = _this$props.delay,
|
|
272
286
|
display = _this$props.display,
|
|
287
|
+
repositionOnScroll = _this$props.repositionOnScroll,
|
|
273
288
|
rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
|
|
274
289
|
var _this$state = this.state,
|
|
275
290
|
arrowStyles = _this$state.arrowStyles,
|
|
@@ -376,6 +391,14 @@ EuiToolTip.propTypes = {
|
|
|
376
391
|
*/
|
|
377
392
|
position: _propTypes.default.oneOf(["top", "right", "bottom", "left"]).isRequired,
|
|
378
393
|
|
|
394
|
+
/**
|
|
395
|
+
* When `true`, the tooltip's position is re-calculated when the user
|
|
396
|
+
* scrolls. This supports having fixed-position tooltip anchors.
|
|
397
|
+
*
|
|
398
|
+
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
399
|
+
*/
|
|
400
|
+
repositionOnScroll: _propTypes.default.bool,
|
|
401
|
+
|
|
379
402
|
/**
|
|
380
403
|
* If supplied, called when mouse movement causes the tool tip to be
|
|
381
404
|
* hidden.
|
|
@@ -67,7 +67,7 @@ var euiTourHeaderStyles = function euiTourHeaderStyles(_ref3) {
|
|
|
67
67
|
euiTourHeader: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-bottom', 'none'), ";", (0, _global_styling.logicalCSS)('margin-bottom', euiTheme.size.s), ";;label:euiTourHeader;"),
|
|
68
68
|
// Elements
|
|
69
69
|
euiTourHeader__title: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-top', 0), ";;label:euiTourHeader__title;"),
|
|
70
|
-
euiTourHeader__subtitle: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.subduedText, ";;label:euiTourHeader__subtitle;")
|
|
70
|
+
euiTourHeader__subtitle: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.subduedText, ";padding-block-end:", euiTheme.size.xs, ";;label:euiTourHeader__subtitle;")
|
|
71
71
|
};
|
|
72
72
|
};
|
|
73
73
|
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.transparentize = exports.tintOrShade = exports.tint = exports.shadeOrTint = exports.shade = exports.saturate = exports.lightness = exports.desaturate = exports.darken = void 0;
|
|
8
|
+
exports.transparentize = exports.tintOrShade = exports.tint = exports.shadeOrTint = exports.shade = exports.saturate = exports.lightness = exports.desaturate = exports.darken = exports.brighten = void 0;
|
|
9
9
|
|
|
10
10
|
var _chromaJs = _interopRequireDefault(require("chroma-js"));
|
|
11
11
|
|
|
@@ -134,5 +134,17 @@ exports.lightness = lightness;
|
|
|
134
134
|
var darken = function darken(color, amount) {
|
|
135
135
|
return (0, _chromaJs.default)(color).darken(amount).hex();
|
|
136
136
|
};
|
|
137
|
+
/**
|
|
138
|
+
* Returns the brighten value of a color. 0-100
|
|
139
|
+
* @param color - Color to manipulate
|
|
140
|
+
* @param amount - Amount to change in absolute terms. 0-1.
|
|
141
|
+
*/
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
exports.darken = darken;
|
|
145
|
+
|
|
146
|
+
var brighten = function brighten(color, amount) {
|
|
147
|
+
return (0, _chromaJs.default)(color).brighten(amount).hex();
|
|
148
|
+
};
|
|
137
149
|
|
|
138
|
-
exports.
|
|
150
|
+
exports.brighten = brighten;
|