@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
|
@@ -25,7 +25,7 @@ var _image_types = require("./image_types");
|
|
|
25
25
|
|
|
26
26
|
var _react2 = require("@emotion/react");
|
|
27
27
|
|
|
28
|
-
var _excluded = ["className", "alt", "url", "src", "size", "hasShadow", "style", "wrapperProps", "fullScreenIconColor", "allowFullScreen", "caption", "float", "margin"];
|
|
28
|
+
var _excluded = ["className", "alt", "url", "src", "size", "hasShadow", "style", "wrapperProps", "fullScreenIconColor", "allowFullScreen", "caption", "float", "margin", "onFullScreen"];
|
|
29
29
|
|
|
30
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
31
|
|
|
@@ -72,6 +72,7 @@ var EuiImage = function EuiImage(_ref) {
|
|
|
72
72
|
caption = _ref.caption,
|
|
73
73
|
float = _ref.float,
|
|
74
74
|
margin = _ref.margin,
|
|
75
|
+
onFullScreen = _ref.onFullScreen,
|
|
75
76
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
76
77
|
|
|
77
78
|
var _useState = (0, _react.useState)(false),
|
|
@@ -103,7 +104,8 @@ var EuiImage = function EuiImage(_ref) {
|
|
|
103
104
|
alt: alt,
|
|
104
105
|
caption: caption,
|
|
105
106
|
float: float,
|
|
106
|
-
margin: margin
|
|
107
|
+
margin: margin,
|
|
108
|
+
onFullScreen: onFullScreen
|
|
107
109
|
};
|
|
108
110
|
|
|
109
111
|
var commonImgProps = _objectSpread({
|
|
@@ -177,6 +179,11 @@ EuiImage.propTypes = {
|
|
|
177
179
|
*/
|
|
178
180
|
allowFullScreen: _propTypes.default.bool,
|
|
179
181
|
|
|
182
|
+
/**
|
|
183
|
+
* Callback when the image is clicked and `allowFullScreen` is `true`
|
|
184
|
+
*/
|
|
185
|
+
onFullScreen: _propTypes.default.func,
|
|
186
|
+
|
|
180
187
|
/**
|
|
181
188
|
* Changes the color of the icon that floats above the image when it can be clicked to fullscreen.
|
|
182
189
|
* The default value of `light` is fine unless your image has a white background, in which case you should change it to `dark`.
|
|
@@ -55,7 +55,8 @@ var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref) {
|
|
|
55
55
|
setIsFullScreen = _ref.setIsFullScreen,
|
|
56
56
|
wrapperProps = _ref.wrapperProps,
|
|
57
57
|
isFullWidth = _ref.isFullWidth,
|
|
58
|
-
fullScreenIconColor = _ref.fullScreenIconColor
|
|
58
|
+
fullScreenIconColor = _ref.fullScreenIconColor,
|
|
59
|
+
onFullScreen = _ref.onFullScreen;
|
|
59
60
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
60
61
|
var styles = (0, _image_fullscreen_wrapper.euiImageFullscreenWrapperStyles)(euiTheme);
|
|
61
62
|
var cssStyles = [styles.euiImageFullscreenWrapper];
|
|
@@ -71,6 +72,7 @@ var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref) {
|
|
|
71
72
|
|
|
72
73
|
var closeFullScreen = function closeFullScreen() {
|
|
73
74
|
setIsFullScreen(false);
|
|
75
|
+
onFullScreen === null || onFullScreen === void 0 ? void 0 : onFullScreen(false);
|
|
74
76
|
};
|
|
75
77
|
|
|
76
78
|
var _useInnerText = (0, _inner_text.useInnerText)(),
|
|
@@ -50,10 +50,12 @@ var EuiImageWrapper = function EuiImageWrapper(_ref) {
|
|
|
50
50
|
setIsFullScreen = _ref.setIsFullScreen,
|
|
51
51
|
wrapperProps = _ref.wrapperProps,
|
|
52
52
|
fullScreenIconColor = _ref.fullScreenIconColor,
|
|
53
|
-
isFullWidth = _ref.isFullWidth
|
|
53
|
+
isFullWidth = _ref.isFullWidth,
|
|
54
|
+
onFullScreen = _ref.onFullScreen;
|
|
54
55
|
|
|
55
56
|
var openFullScreen = function openFullScreen() {
|
|
56
57
|
setIsFullScreen(true);
|
|
58
|
+
onFullScreen === null || onFullScreen === void 0 ? void 0 : onFullScreen(true);
|
|
57
59
|
};
|
|
58
60
|
|
|
59
61
|
var classes = (0, _classnames.default)('euiImageWrapper', wrapperProps && wrapperProps.className);
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
6
|
+
|
|
7
|
+
var _key_pad_menu = require("./key_pad_menu");
|
|
8
|
+
|
|
9
|
+
var _key_pad_menu_item = require("./key_pad_menu_item");
|
|
10
|
+
|
|
11
|
+
var _icon = require("../icon");
|
|
12
|
+
|
|
13
|
+
var _services = require("../../services");
|
|
14
|
+
|
|
15
|
+
var _react2 = require("@emotion/react");
|
|
16
|
+
|
|
17
|
+
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); }
|
|
18
|
+
|
|
19
|
+
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; }
|
|
20
|
+
|
|
21
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
22
|
+
|
|
23
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
24
|
+
|
|
25
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
26
|
+
|
|
27
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
28
|
+
|
|
29
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
30
|
+
|
|
31
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
32
|
+
|
|
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 = _slicedToArray(_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
|
|
@@ -535,13 +535,13 @@ var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
535
535
|
panel = (0, _react.jsx)(_portal.EuiPortal, {
|
|
536
536
|
insert: insert
|
|
537
537
|
}, (0, _react.jsx)(_focus_trap.EuiFocusTrap, _extends({
|
|
538
|
-
clickOutsideDisables: true
|
|
538
|
+
clickOutsideDisables: true,
|
|
539
|
+
onClickOutside: this.onClickOutside
|
|
539
540
|
}, focusTrapProps, {
|
|
540
541
|
returnFocus: returnFocus // Ignore temporary state of indecisive focus
|
|
541
542
|
,
|
|
542
543
|
initialFocus: initialFocus,
|
|
543
544
|
onDeactivation: onTrapDeactivation,
|
|
544
|
-
onClickOutside: this.onClickOutside,
|
|
545
545
|
onEscapeKey: this.onEscapeKey,
|
|
546
546
|
disabled: !ownFocus || !this.state.isOpenStable || this.state.isClosing
|
|
547
547
|
}), (0, _react.jsx)(_popover_panel.EuiPopoverPanel, _extends({}, panelProps, {
|
|
@@ -58,6 +58,6 @@ EuiTableFooterCell.propTypes = {
|
|
|
58
58
|
"aria-label": _propTypes.default.string,
|
|
59
59
|
"data-test-subj": _propTypes.default.string,
|
|
60
60
|
css: _propTypes.default.any,
|
|
61
|
-
align: _propTypes.default.
|
|
61
|
+
align: _propTypes.default.any,
|
|
62
62
|
width: _propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.number.isRequired])
|
|
63
63
|
};
|
|
@@ -151,7 +151,7 @@ EuiTableHeaderCell.propTypes = {
|
|
|
151
151
|
"aria-label": _propTypes.default.string,
|
|
152
152
|
"data-test-subj": _propTypes.default.string,
|
|
153
153
|
css: _propTypes.default.any,
|
|
154
|
-
align: _propTypes.default.
|
|
154
|
+
align: _propTypes.default.any,
|
|
155
155
|
isSortAscending: _propTypes.default.bool,
|
|
156
156
|
isSorted: _propTypes.default.bool,
|
|
157
157
|
|
|
@@ -211,7 +211,7 @@ EuiTableRowCell.propTypes = {
|
|
|
211
211
|
/**
|
|
212
212
|
* Horizontal alignment of the text in the cell
|
|
213
213
|
*/
|
|
214
|
-
align: _propTypes.default.
|
|
214
|
+
align: _propTypes.default.any,
|
|
215
215
|
|
|
216
216
|
/**
|
|
217
217
|
* _Should only be used for action cells_
|
|
@@ -233,7 +233,7 @@ EuiTableRowCell.propTypes = {
|
|
|
233
233
|
/**
|
|
234
234
|
* Horizontal alignment of the text in the cell
|
|
235
235
|
*/
|
|
236
|
-
align: _propTypes.default.
|
|
236
|
+
align: _propTypes.default.any,
|
|
237
237
|
|
|
238
238
|
/**
|
|
239
239
|
* _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;"),
|
|
@@ -93,6 +93,14 @@ EuiIconTip.propTypes = {
|
|
|
93
93
|
*/
|
|
94
94
|
id: _propTypes.default.string,
|
|
95
95
|
|
|
96
|
+
/**
|
|
97
|
+
* When `true`, the tooltip's position is re-calculated when the user
|
|
98
|
+
* scrolls. This supports having fixed-position tooltip anchors.
|
|
99
|
+
*
|
|
100
|
+
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
101
|
+
*/
|
|
102
|
+
repositionOnScroll: _propTypes.default.bool,
|
|
103
|
+
|
|
96
104
|
/**
|
|
97
105
|
* If supplied, called when mouse movement causes the tool tip to be
|
|
98
106
|
* hidden.
|
|
@@ -31,7 +31,7 @@ var _resize_observer = require("../observer/resize_observer");
|
|
|
31
31
|
|
|
32
32
|
var _react3 = require("@emotion/react");
|
|
33
33
|
|
|
34
|
-
var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display"];
|
|
34
|
+
var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display", "repositionOnScroll"];
|
|
35
35
|
|
|
36
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
37
|
|
|
@@ -266,18 +266,32 @@ var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
266
266
|
key: "componentDidMount",
|
|
267
267
|
value: function componentDidMount() {
|
|
268
268
|
this._isMounted = true;
|
|
269
|
+
|
|
270
|
+
if (this.props.repositionOnScroll) {
|
|
271
|
+
window.addEventListener('scroll', this.positionToolTip, true);
|
|
272
|
+
}
|
|
269
273
|
}
|
|
270
274
|
}, {
|
|
271
275
|
key: "componentWillUnmount",
|
|
272
276
|
value: function componentWillUnmount() {
|
|
273
277
|
this.clearAnimationTimeout();
|
|
274
278
|
this._isMounted = false;
|
|
279
|
+
window.removeEventListener('scroll', this.positionToolTip, true);
|
|
275
280
|
}
|
|
276
281
|
}, {
|
|
277
282
|
key: "componentDidUpdate",
|
|
278
283
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
279
284
|
if (prevState.visible === false && this.state.visible === true) {
|
|
280
285
|
requestAnimationFrame(this.testAnchor);
|
|
286
|
+
} // update scroll listener
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
if (prevProps.repositionOnScroll !== this.props.repositionOnScroll) {
|
|
290
|
+
if (this.props.repositionOnScroll) {
|
|
291
|
+
window.addEventListener('scroll', this.positionToolTip, true);
|
|
292
|
+
} else {
|
|
293
|
+
window.removeEventListener('scroll', this.positionToolTip, true);
|
|
294
|
+
}
|
|
281
295
|
}
|
|
282
296
|
}
|
|
283
297
|
}, {
|
|
@@ -292,6 +306,7 @@ var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
292
306
|
title = _this$props.title,
|
|
293
307
|
delay = _this$props.delay,
|
|
294
308
|
display = _this$props.display,
|
|
309
|
+
repositionOnScroll = _this$props.repositionOnScroll,
|
|
295
310
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
296
311
|
|
|
297
312
|
var _this$state = this.state,
|
|
@@ -402,6 +417,14 @@ EuiToolTip.propTypes = {
|
|
|
402
417
|
*/
|
|
403
418
|
position: _propTypes.default.oneOf(["top", "right", "bottom", "left"]).isRequired,
|
|
404
419
|
|
|
420
|
+
/**
|
|
421
|
+
* When `true`, the tooltip's position is re-calculated when the user
|
|
422
|
+
* scrolls. This supports having fixed-position tooltip anchors.
|
|
423
|
+
*
|
|
424
|
+
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
425
|
+
*/
|
|
426
|
+
repositionOnScroll: _propTypes.default.bool,
|
|
427
|
+
|
|
405
428
|
/**
|
|
406
429
|
* If supplied, called when mouse movement causes the tool tip to be
|
|
407
430
|
* 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
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.transparentize = exports.tintOrShade = exports.tint = exports.shadeOrTint = exports.shade = exports.saturate = exports.lightness = exports.desaturate = exports.darken = void 0;
|
|
6
|
+
exports.transparentize = exports.tintOrShade = exports.tint = exports.shadeOrTint = exports.shade = exports.saturate = exports.lightness = exports.desaturate = exports.darken = exports.brighten = void 0;
|
|
7
7
|
|
|
8
8
|
var _chromaJs = _interopRequireDefault(require("chroma-js"));
|
|
9
9
|
|
|
@@ -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;
|