@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
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
/// <reference types="../../../cypress/support"/>
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { EuiImage } from './image';
|
|
11
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
12
|
+
|
|
13
|
+
var Image = function Image() {
|
|
14
|
+
return ___EmotionJSX(EuiImage, {
|
|
15
|
+
size: "m",
|
|
16
|
+
hasShadow: true,
|
|
17
|
+
allowFullScreen: true,
|
|
18
|
+
caption: "Albert Einstein, theoretical physicist",
|
|
19
|
+
alt: "" // Because this image is sufficiently described by its caption, there is no need to repeat it via alt text
|
|
20
|
+
,
|
|
21
|
+
src: "https://upload.wikimedia.org/wikipedia/commons/d/d3/Albert_Einstein_Head.jpg"
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
beforeEach(function () {
|
|
26
|
+
cy.viewport(1024, 768); // medium breakpoint
|
|
27
|
+
|
|
28
|
+
cy.realMount(___EmotionJSX(Image, null));
|
|
29
|
+
cy.get('figure[aria-label="Albert Einstein, theoretical physicist"]').should('exist');
|
|
30
|
+
});
|
|
31
|
+
describe('EuiImage', function () {
|
|
32
|
+
describe('Automated accessibility check', function () {
|
|
33
|
+
it('has zero violations on first render', function () {
|
|
34
|
+
cy.checkAxe();
|
|
35
|
+
});
|
|
36
|
+
it('has zero violations on fullscreen render', function () {
|
|
37
|
+
cy.get('button[data-test-subj="activateFullScreenButton"]').realClick();
|
|
38
|
+
cy.get('button[data-test-subj="deactivateFullScreenButton"]').should('exist');
|
|
39
|
+
cy.checkAxe();
|
|
40
|
+
cy.get('div[data-test-subj="fullScreenOverlayMask"]').realClick();
|
|
41
|
+
cy.checkAxe();
|
|
42
|
+
});
|
|
43
|
+
it('has zero violations on keyboard interaction', function () {
|
|
44
|
+
cy.realPress('Tab');
|
|
45
|
+
cy.get('button[data-test-subj="activateFullScreenButton"]').should('have.focus');
|
|
46
|
+
cy.realPress('Enter');
|
|
47
|
+
cy.get('button[data-test-subj="deactivateFullScreenButton"]').should('exist');
|
|
48
|
+
cy.get('button[data-test-subj="deactivateFullScreenButton"]').should('have.focus');
|
|
49
|
+
cy.checkAxe();
|
|
50
|
+
cy.realPress('Escape');
|
|
51
|
+
cy.get('button[data-test-subj="activateFullScreenButton"]').should('have.focus');
|
|
52
|
+
cy.checkAxe();
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["className", "alt", "url", "src", "size", "hasShadow", "style", "wrapperProps", "fullScreenIconColor", "allowFullScreen", "caption", "float", "margin"];
|
|
1
|
+
var _excluded = ["className", "alt", "url", "src", "size", "hasShadow", "style", "wrapperProps", "fullScreenIconColor", "allowFullScreen", "caption", "float", "margin", "onFullScreen"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
@@ -55,6 +55,7 @@ export var EuiImage = function EuiImage(_ref) {
|
|
|
55
55
|
caption = _ref.caption,
|
|
56
56
|
float = _ref.float,
|
|
57
57
|
margin = _ref.margin,
|
|
58
|
+
onFullScreen = _ref.onFullScreen,
|
|
58
59
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
59
60
|
|
|
60
61
|
var _useState = useState(false),
|
|
@@ -85,7 +86,8 @@ export var EuiImage = function EuiImage(_ref) {
|
|
|
85
86
|
alt: alt,
|
|
86
87
|
caption: caption,
|
|
87
88
|
float: float,
|
|
88
|
-
margin: margin
|
|
89
|
+
margin: margin,
|
|
90
|
+
onFullScreen: onFullScreen
|
|
89
91
|
};
|
|
90
92
|
|
|
91
93
|
var commonImgProps = _objectSpread({
|
|
@@ -157,6 +159,11 @@ EuiImage.propTypes = {
|
|
|
157
159
|
*/
|
|
158
160
|
allowFullScreen: PropTypes.bool,
|
|
159
161
|
|
|
162
|
+
/**
|
|
163
|
+
* Callback when the image is clicked and `allowFullScreen` is `true`
|
|
164
|
+
*/
|
|
165
|
+
onFullScreen: PropTypes.func,
|
|
166
|
+
|
|
160
167
|
/**
|
|
161
168
|
* Changes the color of the icon that floats above the image when it can be clicked to fullscreen.
|
|
162
169
|
* The default value of `light` is fine unless your image has a white background, in which case you should change it to `dark`.
|
|
@@ -40,7 +40,8 @@ export var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref)
|
|
|
40
40
|
setIsFullScreen = _ref.setIsFullScreen,
|
|
41
41
|
wrapperProps = _ref.wrapperProps,
|
|
42
42
|
isFullWidth = _ref.isFullWidth,
|
|
43
|
-
fullScreenIconColor = _ref.fullScreenIconColor
|
|
43
|
+
fullScreenIconColor = _ref.fullScreenIconColor,
|
|
44
|
+
onFullScreen = _ref.onFullScreen;
|
|
44
45
|
var euiTheme = useEuiTheme();
|
|
45
46
|
var styles = euiImageFullscreenWrapperStyles(euiTheme);
|
|
46
47
|
var cssStyles = [styles.euiImageFullscreenWrapper];
|
|
@@ -56,6 +57,7 @@ export var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref)
|
|
|
56
57
|
|
|
57
58
|
var closeFullScreen = function closeFullScreen() {
|
|
58
59
|
setIsFullScreen(false);
|
|
60
|
+
onFullScreen === null || onFullScreen === void 0 ? void 0 : onFullScreen(false);
|
|
59
61
|
};
|
|
60
62
|
|
|
61
63
|
var _useInnerText = useInnerText(),
|
|
@@ -39,10 +39,12 @@ export var EuiImageWrapper = function EuiImageWrapper(_ref) {
|
|
|
39
39
|
setIsFullScreen = _ref.setIsFullScreen,
|
|
40
40
|
wrapperProps = _ref.wrapperProps,
|
|
41
41
|
fullScreenIconColor = _ref.fullScreenIconColor,
|
|
42
|
-
isFullWidth = _ref.isFullWidth
|
|
42
|
+
isFullWidth = _ref.isFullWidth,
|
|
43
|
+
onFullScreen = _ref.onFullScreen;
|
|
43
44
|
|
|
44
45
|
var openFullScreen = function openFullScreen() {
|
|
45
46
|
setIsFullScreen(true);
|
|
47
|
+
onFullScreen === null || onFullScreen === void 0 ? void 0 : onFullScreen(true);
|
|
46
48
|
};
|
|
47
49
|
|
|
48
50
|
var classes = classNames('euiImageWrapper', wrapperProps && wrapperProps.className);
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
3
|
+
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."); }
|
|
4
|
+
|
|
5
|
+
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); }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
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; }
|
|
10
|
+
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
15
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
16
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
17
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
18
|
+
* Side Public License, v 1.
|
|
19
|
+
*/
|
|
20
|
+
/// <reference types="../../../cypress/support"/>
|
|
21
|
+
import React, { useState } from 'react';
|
|
22
|
+
import { EuiKeyPadMenu } from './key_pad_menu';
|
|
23
|
+
import { EuiKeyPadMenuItem } from './key_pad_menu_item';
|
|
24
|
+
import { EuiIcon } from '../icon';
|
|
25
|
+
import { useGeneratedHtmlId } from '../../services';
|
|
26
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
27
|
+
|
|
28
|
+
var KeyPadMenu = function KeyPadMenu() {
|
|
29
|
+
var keypadButtonId__1 = useGeneratedHtmlId({
|
|
30
|
+
prefix: 'keypadButton',
|
|
31
|
+
suffix: 'first'
|
|
32
|
+
});
|
|
33
|
+
var keypadButtonId__2 = useGeneratedHtmlId({
|
|
34
|
+
prefix: 'keypadButton',
|
|
35
|
+
suffix: 'second'
|
|
36
|
+
});
|
|
37
|
+
var keypadButtonId__3 = useGeneratedHtmlId({
|
|
38
|
+
prefix: 'keypadButton',
|
|
39
|
+
suffix: 'third'
|
|
40
|
+
});
|
|
41
|
+
var keypadButtonId__4 = useGeneratedHtmlId({
|
|
42
|
+
prefix: 'keypadButton',
|
|
43
|
+
suffix: 'fourth'
|
|
44
|
+
});
|
|
45
|
+
var keypadButtonId__5 = useGeneratedHtmlId({
|
|
46
|
+
prefix: 'keypadButton',
|
|
47
|
+
suffix: 'fifth'
|
|
48
|
+
});
|
|
49
|
+
var keypadButtonId__6 = useGeneratedHtmlId({
|
|
50
|
+
prefix: 'keypadButton',
|
|
51
|
+
suffix: 'sixth'
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
var _useState = useState(keypadButtonId__6),
|
|
55
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
56
|
+
selectedID = _useState2[0],
|
|
57
|
+
setSelectedID = _useState2[1];
|
|
58
|
+
|
|
59
|
+
return ___EmotionJSX("div", {
|
|
60
|
+
"aria-label": "Menu keypad"
|
|
61
|
+
}, ___EmotionJSX(EuiKeyPadMenu, null, ___EmotionJSX(EuiKeyPadMenuItem, {
|
|
62
|
+
"data-test-subj": "cy-keypad-button-1",
|
|
63
|
+
id: keypadButtonId__1,
|
|
64
|
+
label: "Button 1",
|
|
65
|
+
isSelected: selectedID === keypadButtonId__1,
|
|
66
|
+
onClick: function onClick() {
|
|
67
|
+
return setSelectedID(keypadButtonId__1);
|
|
68
|
+
}
|
|
69
|
+
}, ___EmotionJSX(EuiIcon, {
|
|
70
|
+
type: "grid",
|
|
71
|
+
size: "l"
|
|
72
|
+
})), ___EmotionJSX(EuiKeyPadMenuItem, {
|
|
73
|
+
"data-test-subj": "cy-keypad-button-2",
|
|
74
|
+
id: keypadButtonId__2,
|
|
75
|
+
label: "Button 2",
|
|
76
|
+
isSelected: selectedID === keypadButtonId__2,
|
|
77
|
+
onClick: function onClick() {
|
|
78
|
+
return setSelectedID(keypadButtonId__2);
|
|
79
|
+
}
|
|
80
|
+
}, ___EmotionJSX(EuiIcon, {
|
|
81
|
+
type: "grid",
|
|
82
|
+
size: "l"
|
|
83
|
+
})), ___EmotionJSX(EuiKeyPadMenuItem, {
|
|
84
|
+
"data-test-subj": "cy-keypad-button-3",
|
|
85
|
+
id: keypadButtonId__3,
|
|
86
|
+
label: "Button 3",
|
|
87
|
+
isSelected: selectedID === keypadButtonId__3,
|
|
88
|
+
onClick: function onClick() {
|
|
89
|
+
return setSelectedID(keypadButtonId__3);
|
|
90
|
+
}
|
|
91
|
+
}, ___EmotionJSX(EuiIcon, {
|
|
92
|
+
type: "grid",
|
|
93
|
+
size: "l"
|
|
94
|
+
})), ___EmotionJSX(EuiKeyPadMenuItem, {
|
|
95
|
+
"data-test-subj": "cy-keypad-link-1",
|
|
96
|
+
id: keypadButtonId__4,
|
|
97
|
+
label: "Link 1",
|
|
98
|
+
href: "#/navigation/key-pad-menu",
|
|
99
|
+
isSelected: selectedID === keypadButtonId__4,
|
|
100
|
+
onClick: function onClick() {
|
|
101
|
+
return setSelectedID(keypadButtonId__4);
|
|
102
|
+
}
|
|
103
|
+
}, ___EmotionJSX(EuiIcon, {
|
|
104
|
+
type: "link",
|
|
105
|
+
size: "l"
|
|
106
|
+
})), ___EmotionJSX(EuiKeyPadMenuItem, {
|
|
107
|
+
"data-test-subj": "cy-keypad-link-2",
|
|
108
|
+
id: keypadButtonId__5,
|
|
109
|
+
label: "Link 2",
|
|
110
|
+
href: "#/navigation/key-pad-menu",
|
|
111
|
+
isSelected: selectedID === keypadButtonId__5,
|
|
112
|
+
onClick: function onClick() {
|
|
113
|
+
return setSelectedID(keypadButtonId__5);
|
|
114
|
+
}
|
|
115
|
+
}, ___EmotionJSX(EuiIcon, {
|
|
116
|
+
type: "link",
|
|
117
|
+
size: "l"
|
|
118
|
+
})), ___EmotionJSX(EuiKeyPadMenuItem, {
|
|
119
|
+
"data-test-subj": "cy-keypad-link-3",
|
|
120
|
+
id: keypadButtonId__6,
|
|
121
|
+
label: "Disabled Link 3",
|
|
122
|
+
isDisabled: true,
|
|
123
|
+
isSelected: selectedID === keypadButtonId__6
|
|
124
|
+
}, ___EmotionJSX(EuiIcon, {
|
|
125
|
+
type: "link",
|
|
126
|
+
size: "l"
|
|
127
|
+
}))));
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
beforeEach(function () {
|
|
131
|
+
cy.realMount(___EmotionJSX(KeyPadMenu, null));
|
|
132
|
+
cy.get('div[aria-label="Menu keypad"]').should('exist');
|
|
133
|
+
});
|
|
134
|
+
describe('EuiKeyPadMenu', function () {
|
|
135
|
+
describe('Automated accessibility check', function () {
|
|
136
|
+
it('has zero violations on first render', function () {
|
|
137
|
+
cy.checkAxe();
|
|
138
|
+
});
|
|
139
|
+
it('has zero violations on item click', function () {
|
|
140
|
+
cy.get('a[data-test-subj="cy-keypad-link-2"]').realClick();
|
|
141
|
+
cy.get('a[data-test-subj="cy-keypad-link-2"]').should('have.class', 'euiKeyPadMenuItem-isSelected');
|
|
142
|
+
cy.checkAxe();
|
|
143
|
+
});
|
|
144
|
+
it('has zero violations on item keypress', function () {
|
|
145
|
+
cy.repeatRealPress('Tab', 3);
|
|
146
|
+
cy.get('button[data-test-subj="cy-keypad-button-3"]').should('have.focus');
|
|
147
|
+
cy.realPress('Space');
|
|
148
|
+
cy.get('button[data-test-subj="cy-keypad-button-3"]').should('have.class', 'euiKeyPadMenuItem-isSelected');
|
|
149
|
+
cy.checkAxe();
|
|
150
|
+
cy.realPress(['Shift', 'Tab']);
|
|
151
|
+
cy.get('button[data-test-subj="cy-keypad-button-2"]').should('have.focus');
|
|
152
|
+
cy.realPress('Space');
|
|
153
|
+
cy.get('button[data-test-subj="cy-keypad-button-2"]').should('have.class', 'euiKeyPadMenuItem-isSelected');
|
|
154
|
+
cy.get('button[data-test-subj="cy-keypad-button-3"]').should('not.have.class', 'euiKeyPadMenuItem-isSelected');
|
|
155
|
+
cy.checkAxe();
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
});
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
|
-
import { logicalCSS,
|
|
9
|
+
import { logicalCSS, euiFontSize, mathWithUnits } from '../../global_styling';
|
|
10
10
|
/**
|
|
11
11
|
* Mixins
|
|
12
12
|
*/
|
|
@@ -20,16 +20,13 @@ var euiScaleMarkdownFormatText = function euiScaleMarkdownFormatText(euiTheme, o
|
|
|
20
20
|
var measurement = options.measurement;
|
|
21
21
|
var lineHeightSize = measurement === 'em' ? "".concat(lineHeight, "em") : lineHeight; // Custom scales
|
|
22
22
|
|
|
23
|
-
var blockQuoteBorderWidth = mathWithUnits(fontSize, function (x) {
|
|
24
|
-
return x / 4;
|
|
25
|
-
});
|
|
26
23
|
var tablePaddingVertical = mathWithUnits(fontSize, function (x) {
|
|
27
24
|
return x / 4;
|
|
28
25
|
});
|
|
29
26
|
var tablePaddingHorizontal = mathWithUnits(fontSize, function (x) {
|
|
30
27
|
return x / 2;
|
|
31
28
|
});
|
|
32
|
-
return "\n .
|
|
29
|
+
return "\n .euiCheckbox .euiCheckbox__input ~ .euiCheckbox__label { // Extra specificity necessary to override default checkbox CSS\n font-size: ".concat(fontSize, ";\n ").concat(logicalCSS('padding-left', lineHeightSize), "\n line-height: ").concat(lineHeight, ";\n }\n\n .euiCheckbox + *:not(.euiCheckbox) {\n ").concat(logicalCSS('margin-top', fontSize), "\n }\n\n .euiMarkdownFormat__codeblockWrapper {\n ").concat(logicalCSS('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table {\n ").concat(logicalCSS('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table th,\n .euiMarkdownFormat__table td {\n ").concat(logicalCSS('padding-vertical', tablePaddingVertical), "\n ").concat(logicalCSS('padding-horizontal', tablePaddingHorizontal), "\n }\n ");
|
|
33
30
|
};
|
|
34
31
|
/**
|
|
35
32
|
* Styles
|
|
@@ -508,13 +508,13 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
508
508
|
panel = ___EmotionJSX(EuiPortal, {
|
|
509
509
|
insert: insert
|
|
510
510
|
}, ___EmotionJSX(EuiFocusTrap, _extends({
|
|
511
|
-
clickOutsideDisables: true
|
|
511
|
+
clickOutsideDisables: true,
|
|
512
|
+
onClickOutside: this.onClickOutside
|
|
512
513
|
}, focusTrapProps, {
|
|
513
514
|
returnFocus: returnFocus // Ignore temporary state of indecisive focus
|
|
514
515
|
,
|
|
515
516
|
initialFocus: initialFocus,
|
|
516
517
|
onDeactivation: onTrapDeactivation,
|
|
517
|
-
onClickOutside: this.onClickOutside,
|
|
518
518
|
onEscapeKey: this.onEscapeKey,
|
|
519
519
|
disabled: !ownFocus || !this.state.isOpenStable || this.state.isClosing
|
|
520
520
|
}), ___EmotionJSX(EuiPopoverPanel, _extends({}, panelProps, {
|
|
@@ -48,6 +48,6 @@ EuiTableFooterCell.propTypes = {
|
|
|
48
48
|
"aria-label": PropTypes.string,
|
|
49
49
|
"data-test-subj": PropTypes.string,
|
|
50
50
|
css: PropTypes.any,
|
|
51
|
-
align: PropTypes.
|
|
51
|
+
align: PropTypes.any,
|
|
52
52
|
width: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.number.isRequired])
|
|
53
53
|
};
|
|
@@ -139,7 +139,7 @@ EuiTableHeaderCell.propTypes = {
|
|
|
139
139
|
"aria-label": PropTypes.string,
|
|
140
140
|
"data-test-subj": PropTypes.string,
|
|
141
141
|
css: PropTypes.any,
|
|
142
|
-
align: PropTypes.
|
|
142
|
+
align: PropTypes.any,
|
|
143
143
|
isSortAscending: PropTypes.bool,
|
|
144
144
|
isSorted: PropTypes.bool,
|
|
145
145
|
|
|
@@ -195,7 +195,7 @@ EuiTableRowCell.propTypes = {
|
|
|
195
195
|
/**
|
|
196
196
|
* Horizontal alignment of the text in the cell
|
|
197
197
|
*/
|
|
198
|
-
align: PropTypes.
|
|
198
|
+
align: PropTypes.any,
|
|
199
199
|
|
|
200
200
|
/**
|
|
201
201
|
* _Should only be used for action cells_
|
|
@@ -217,7 +217,7 @@ EuiTableRowCell.propTypes = {
|
|
|
217
217
|
/**
|
|
218
218
|
* Horizontal alignment of the text in the cell
|
|
219
219
|
*/
|
|
220
|
-
align: PropTypes.
|
|
220
|
+
align: PropTypes.any,
|
|
221
221
|
|
|
222
222
|
/**
|
|
223
223
|
* _Should only be used for action cells_
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
|
-
import { logicalCSS, logicalTextAlignCSS, euiFontSize, euiBackgroundColor, mathWithUnits } from '../../global_styling';
|
|
9
|
+
import { logicalCSS, logicalShorthandCSS, logicalTextAlignCSS, euiFontSize, euiBackgroundColor, mathWithUnits } from '../../global_styling';
|
|
10
10
|
import { euiLinkCSS } from '../link/link.styles';
|
|
11
11
|
import { euiTitle } from '../title/title.styles';
|
|
12
12
|
/**
|
|
@@ -50,7 +50,10 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
|
|
|
50
50
|
return x * 2;
|
|
51
51
|
});
|
|
52
52
|
var headingMarginBottom = marginSize;
|
|
53
|
-
|
|
53
|
+
var blockQuoteBorderWidth = mathWithUnits(fontSize, function (x) {
|
|
54
|
+
return x / 4;
|
|
55
|
+
});
|
|
56
|
+
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(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(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(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(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(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(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(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(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(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(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n p,\n ul,\n ol,\n dl,\n blockquote,\n img,\n pre {\n ").concat(logicalCSS('margin-bottom', lineHeightSize), "\n }\n\n ul,\n ol {\n ").concat(logicalCSS('margin-left', lineHeightSize), "\n }\n \n blockquote {\n font-size: ").concat(fontSize, ";\n ").concat(logicalShorthandCSS('padding', "0 ".concat(fontSize)), "\n ").concat(logicalCSS('border-left-width', blockQuoteBorderWidth), "\n ").concat(logicalCSS('margin-bottom', fontSize), "\n }\n\n dd + dt {\n ").concat(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(euiFontSize(euiThemeContext, 'xs', options).fontSize, ";\n color: ").concat(euiTheme.colors.text, ";\n }\n\n small {\n font-size: ").concat(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
|
|
54
57
|
_customScale === 'm' ? "\n kbd {\n ".concat(logicalCSS('padding-bottom', euiTheme.size.xs), "\n // ensures when only one character the shape looks like a square\n ").concat(logicalCSS('min-width', euiTheme.size.l), "\n ").concat(logicalTextAlignCSS('center'), "\n }\n \n kbd::after {\n content: '';\n ").concat(logicalCSS('border-bottom', "".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.colors.text)), "\n position: absolute;\n ").concat(logicalCSS('bottom', euiTheme.size.xxs), "\n ").concat(logicalCSS('left', 0), "\n ").concat(logicalCSS('width', '100%'), "\n }") : '', "\n ");
|
|
55
58
|
};
|
|
56
59
|
/**
|
|
@@ -61,7 +64,7 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
|
|
|
61
64
|
export var euiTextStyles = function euiTextStyles(euiThemeContext) {
|
|
62
65
|
var euiTheme = euiThemeContext.euiTheme;
|
|
63
66
|
return {
|
|
64
|
-
euiText: /*#__PURE__*/css(euiText(euiTheme, true), ";clear:both;a:not([class]){", euiLinkCSS(euiThemeContext), ";}img{display:block;", logicalCSS('max-width', '100%'), ";}ul{list-style:disc;}ol{list-style:decimal;}blockquote
|
|
67
|
+
euiText: /*#__PURE__*/css(euiText(euiTheme, true), ";clear:both;a:not([class]){", euiLinkCSS(euiThemeContext), ";}img{display:block;", 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{", euiTitle(euiThemeContext, 'l'), ";}h2{", euiTitle(euiThemeContext, 'm'), ";}h3{", euiTitle(euiThemeContext, 's'), ";}h4,dt{", euiTitle(euiThemeContext, 'xs'), ";}h5{", euiTitle(euiThemeContext, 'xxs'), ";}h6{", euiTitle(euiThemeContext, 'xxxs'), " text-transform:uppercase;}h1,h2,h3,h4,h5,h6,dt{color:inherit;}pre:not(.euiCodeBlock__pre){white-space:pre-wrap;background:", euiBackgroundColor(euiThemeContext, 'subdued'), ";color:", euiTheme.colors.text, ";}pre:not(.euiCodeBlock__pre),pre:not(.euiCodeBlock__pre) code{display:block;}>:last-child{", logicalCSS('margin-bottom', '0 !important'), ";}kbd{position:relative;display:inline-block;", logicalCSS('padding-vertical', euiTheme.size.xxs), " ", logicalCSS('padding-horizontal', euiTheme.size.xs), " line-height:1;border:", euiTheme.border.width.thin, " solid ", euiTheme.colors.text, ";border-radius:", mathWithUnits(euiTheme.border.radius.small, function (x) {
|
|
65
68
|
return x / 2;
|
|
66
69
|
}), ";};label:euiText;"),
|
|
67
70
|
constrainedWidth: /*#__PURE__*/css(logicalCSS('max-width', euiTextConstrainedMaxWidth), ";;label:constrainedWidth;"),
|
|
@@ -84,6 +84,14 @@ EuiIconTip.propTypes = {
|
|
|
84
84
|
*/
|
|
85
85
|
id: PropTypes.string,
|
|
86
86
|
|
|
87
|
+
/**
|
|
88
|
+
* When `true`, the tooltip's position is re-calculated when the user
|
|
89
|
+
* scrolls. This supports having fixed-position tooltip anchors.
|
|
90
|
+
*
|
|
91
|
+
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
92
|
+
*/
|
|
93
|
+
repositionOnScroll: PropTypes.bool,
|
|
94
|
+
|
|
87
95
|
/**
|
|
88
96
|
* If supplied, called when mouse movement causes the tool tip to be
|
|
89
97
|
* hidden.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
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); }
|
|
2
2
|
|
|
3
|
-
var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display"];
|
|
3
|
+
var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display", "repositionOnScroll"];
|
|
4
4
|
|
|
5
5
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
6
6
|
|
|
@@ -246,18 +246,32 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
246
246
|
key: "componentDidMount",
|
|
247
247
|
value: function componentDidMount() {
|
|
248
248
|
this._isMounted = true;
|
|
249
|
+
|
|
250
|
+
if (this.props.repositionOnScroll) {
|
|
251
|
+
window.addEventListener('scroll', this.positionToolTip, true);
|
|
252
|
+
}
|
|
249
253
|
}
|
|
250
254
|
}, {
|
|
251
255
|
key: "componentWillUnmount",
|
|
252
256
|
value: function componentWillUnmount() {
|
|
253
257
|
this.clearAnimationTimeout();
|
|
254
258
|
this._isMounted = false;
|
|
259
|
+
window.removeEventListener('scroll', this.positionToolTip, true);
|
|
255
260
|
}
|
|
256
261
|
}, {
|
|
257
262
|
key: "componentDidUpdate",
|
|
258
263
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
259
264
|
if (prevState.visible === false && this.state.visible === true) {
|
|
260
265
|
requestAnimationFrame(this.testAnchor);
|
|
266
|
+
} // update scroll listener
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
if (prevProps.repositionOnScroll !== this.props.repositionOnScroll) {
|
|
270
|
+
if (this.props.repositionOnScroll) {
|
|
271
|
+
window.addEventListener('scroll', this.positionToolTip, true);
|
|
272
|
+
} else {
|
|
273
|
+
window.removeEventListener('scroll', this.positionToolTip, true);
|
|
274
|
+
}
|
|
261
275
|
}
|
|
262
276
|
}
|
|
263
277
|
}, {
|
|
@@ -272,6 +286,7 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
272
286
|
title = _this$props.title,
|
|
273
287
|
delay = _this$props.delay,
|
|
274
288
|
display = _this$props.display,
|
|
289
|
+
repositionOnScroll = _this$props.repositionOnScroll,
|
|
275
290
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
276
291
|
|
|
277
292
|
var _this$state = this.state,
|
|
@@ -380,6 +395,14 @@ EuiToolTip.propTypes = {
|
|
|
380
395
|
*/
|
|
381
396
|
position: PropTypes.oneOf(["top", "right", "bottom", "left"]).isRequired,
|
|
382
397
|
|
|
398
|
+
/**
|
|
399
|
+
* When `true`, the tooltip's position is re-calculated when the user
|
|
400
|
+
* scrolls. This supports having fixed-position tooltip anchors.
|
|
401
|
+
*
|
|
402
|
+
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
403
|
+
*/
|
|
404
|
+
repositionOnScroll: PropTypes.bool,
|
|
405
|
+
|
|
383
406
|
/**
|
|
384
407
|
* If supplied, called when mouse movement causes the tool tip to be
|
|
385
408
|
* hidden.
|
|
@@ -50,7 +50,7 @@ export var euiTourHeaderStyles = function euiTourHeaderStyles(_ref3) {
|
|
|
50
50
|
euiTourHeader: /*#__PURE__*/css(logicalCSS('border-bottom', 'none'), ";", logicalCSS('margin-bottom', euiTheme.size.s), ";;label:euiTourHeader;"),
|
|
51
51
|
// Elements
|
|
52
52
|
euiTourHeader__title: /*#__PURE__*/css(logicalCSS('margin-top', 0), ";;label:euiTourHeader__title;"),
|
|
53
|
-
euiTourHeader__subtitle: /*#__PURE__*/css("color:", euiTheme.colors.subduedText, ";;label:euiTourHeader__subtitle;")
|
|
53
|
+
euiTourHeader__subtitle: /*#__PURE__*/css("color:", euiTheme.colors.subduedText, ";padding-block-end:", euiTheme.size.xs, ";;label:euiTourHeader__subtitle;")
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
56
|
export var euiTourFooterStyles = function euiTourFooterStyles(_ref4) {
|
|
@@ -97,4 +97,13 @@ export var lightness = function lightness(color) {
|
|
|
97
97
|
|
|
98
98
|
export var darken = function darken(color, amount) {
|
|
99
99
|
return chroma(color).darken(amount).hex();
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Returns the brighten value of a color. 0-100
|
|
103
|
+
* @param color - Color to manipulate
|
|
104
|
+
* @param amount - Amount to change in absolute terms. 0-1.
|
|
105
|
+
*/
|
|
106
|
+
|
|
107
|
+
export var brighten = function brighten(color, amount) {
|
|
108
|
+
return chroma(color).brighten(amount).hex();
|
|
100
109
|
};
|
package/es/services/index.js
CHANGED
|
@@ -7,25 +7,25 @@
|
|
|
7
7
|
*/
|
|
8
8
|
// Export all keys under a `keys` named variable
|
|
9
9
|
import * as keys from './keys';
|
|
10
|
-
export { keys };
|
|
11
10
|
export { accessibleClickKeys, cascadingMenuKeys, comboBoxKeys, htmlIdGenerator, useGeneratedHtmlId } from './accessibility';
|
|
12
|
-
export { LEFT_ALIGNMENT, RIGHT_ALIGNMENT
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
11
|
+
export { CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT } from './alignment';
|
|
12
|
+
export { CurrentEuiBreakpointContext, CurrentEuiBreakpointProvider, useCurrentEuiBreakpoint, useIsWithinBreakpoints, useIsWithinMaxBreakpoint, useIsWithinMinBreakpoint } from './breakpoint';
|
|
13
|
+
export { brighten, calculateContrast, calculateLuminance, colorPalette, darken, DEFAULT_VISUALIZATION_COLOR, desaturate, euiPaletteColorBlind, euiPaletteColorBlindBehindText, euiPaletteComplimentary, euiPaletteCool, euiPaletteForDarkBackground, euiPaletteForLightBackground, euiPaletteForStatus, euiPaletteForTemperature, euiPaletteGray, euiPaletteNegative, euiPalettePositive, euiPaletteWarm, getSteppedGradient, hexToHsv, hexToRgb, hsvToHex, hsvToRgb, isColorDark, isValidHex, lightness, makeDisabledContrastColor, makeHighContrastColor, rgbToHex, rgbToHsv, saturate, shade, shadeOrTint, tint, tintOrShade, transparentize, VISUALIZATION_COLORS, wcagContrastMin } from './color';
|
|
15
14
|
export { useColorPickerState, useColorStopsState } from './color_picker';
|
|
16
15
|
export * from './console';
|
|
17
16
|
export { copyToClipboard } from './copy_to_clipboard';
|
|
18
17
|
export * from './findElement';
|
|
19
|
-
export { formatAuto, formatBoolean, formatDate, formatNumber, formatText
|
|
18
|
+
export { dateFormatAliases, formatAuto, formatBoolean, formatDate, formatNumber, formatText } from './format';
|
|
19
|
+
export * from './hooks';
|
|
20
20
|
export { isEvenlyDivisibleBy, isWithinRange } from './number';
|
|
21
21
|
export { Pager } from './paging';
|
|
22
|
+
export { calculatePopoverPosition, findPopoverPosition } from './popover';
|
|
22
23
|
export { Random } from './random';
|
|
23
24
|
export { getSecureRelForTarget } from './security';
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export
|
|
25
|
+
export { Comparators, PropertySortType, SortableProperties, SortDirection, SortDirectionType } from './sort';
|
|
26
|
+
export { slugify, toInitials, toSentenceCase } from './string';
|
|
27
|
+
export * from './theme';
|
|
28
|
+
export { throttle } from './throttle';
|
|
27
29
|
export { getDurationAndPerformOnFrame, getTransitionTimings, getWaitDuration, performOnFrame } from './transition';
|
|
28
30
|
export { EuiWindowEvent } from './window_event';
|
|
29
|
-
export
|
|
30
|
-
export { throttle } from './throttle';
|
|
31
|
-
export * from './theme';
|
|
31
|
+
export { keys };
|