@elastic/eui 106.3.0 → 106.4.0-amsterdam.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/es/components/modal/modal.js +10 -4
- package/es/components/page/page_header/page_header_content.js +2 -1
- package/es/components/popover/input_popover.js +15 -9
- package/es/components/provider/provider.js +2 -2
- package/es/services/color/vis_color_store.js +1 -1
- package/es/services/theme/context.js +2 -2
- package/eui.d.ts +374 -368
- package/lib/components/modal/modal.js +10 -4
- package/lib/components/page/page_header/page_header_content.js +2 -1
- package/lib/components/popover/input_popover.js +15 -9
- package/lib/components/provider/provider.js +2 -2
- package/lib/services/color/vis_color_store.js +2 -2
- package/lib/services/theme/context.js +2 -2
- package/optimize/es/components/modal/modal.js +4 -3
- package/optimize/es/components/page/page_header/page_header_content.js +2 -1
- package/optimize/es/components/popover/input_popover.js +15 -9
- package/optimize/es/components/provider/provider.js +2 -2
- package/optimize/es/services/color/vis_color_store.js +1 -1
- package/optimize/es/services/theme/context.js +2 -2
- package/optimize/lib/components/modal/modal.js +4 -3
- package/optimize/lib/components/page/page_header/page_header_content.js +2 -1
- package/optimize/lib/components/popover/input_popover.js +15 -9
- package/optimize/lib/components/provider/provider.js +2 -2
- package/optimize/lib/services/color/vis_color_store.js +2 -2
- package/optimize/lib/services/theme/context.js +2 -2
- package/package.json +3 -3
- package/src/themes/amsterdam/_colors_dark.scss +2 -2
- package/src/themes/amsterdam/_colors_light.scss +3 -3
- package/test-env/components/flyout/flyout.js +8 -4
- package/test-env/components/modal/modal.js +10 -4
- package/test-env/components/page/page_header/page_header_content.js +2 -1
- package/test-env/components/popover/input_popover.js +15 -9
- package/test-env/components/provider/provider.js +2 -2
- package/test-env/services/color/vis_color_store.js +2 -2
- package/test-env/services/theme/context.js +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["className", "children", "initialFocus", "onClose", "maxWidth", "role", "style"];
|
|
2
|
+
var _excluded = ["className", "children", "initialFocus", "onClose", "maxWidth", "role", "style", "focusTrapProps"];
|
|
3
3
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -37,6 +37,7 @@ export var EuiModal = function EuiModal(_ref) {
|
|
|
37
37
|
_ref$role = _ref.role,
|
|
38
38
|
role = _ref$role === void 0 ? 'dialog' : _ref$role,
|
|
39
39
|
style = _ref.style,
|
|
40
|
+
focusTrapProps = _ref.focusTrapProps,
|
|
40
41
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
41
42
|
var onKeyDown = function onKeyDown(event) {
|
|
42
43
|
if (event.key === keys.ESCAPE) {
|
|
@@ -58,11 +59,11 @@ export var EuiModal = function EuiModal(_ref) {
|
|
|
58
59
|
var styles = euiModalStyles(euiTheme);
|
|
59
60
|
var cssStyles = [styles.euiModal, maxWidth === true && styles.defaultMaxWidth];
|
|
60
61
|
var cssCloseIconStyles = [styles.euiModal__closeIcon];
|
|
61
|
-
return ___EmotionJSX(EuiOverlayMask, null, ___EmotionJSX(EuiFocusTrap, {
|
|
62
|
+
return ___EmotionJSX(EuiOverlayMask, null, ___EmotionJSX(EuiFocusTrap, _extends({}, focusTrapProps, {
|
|
62
63
|
initialFocus: initialFocus,
|
|
63
64
|
scrollLock: true,
|
|
64
65
|
preventScrollOnFocus: true
|
|
65
|
-
}, ___EmotionJSX("div", _extends({
|
|
66
|
+
}), ___EmotionJSX("div", _extends({
|
|
66
67
|
css: cssStyles,
|
|
67
68
|
className: classes,
|
|
68
69
|
onKeyDown: onKeyDown,
|
|
@@ -108,5 +109,10 @@ EuiModal.propTypes = {
|
|
|
108
109
|
* Identifies a modal dialog to screen readers. Modal dialogs that confirm destructive actions
|
|
109
110
|
* or need a user's attention should use "alertdialog".
|
|
110
111
|
*/
|
|
111
|
-
role: PropTypes.oneOf(["dialog", "alertdialog"])
|
|
112
|
+
role: PropTypes.oneOf(["dialog", "alertdialog"]),
|
|
113
|
+
/**
|
|
114
|
+
* Object of props passed to EuiFocusTrap.
|
|
115
|
+
* `returnFocus` defines the return focus behavior and provides the possibility to check the available target element or opt out of the behavior in favor of manually returning focus
|
|
116
|
+
*/
|
|
117
|
+
focusTrapProps: PropTypes.any
|
|
112
118
|
};
|
|
@@ -98,7 +98,8 @@ export var EuiPageHeaderContent = function EuiPageHeaderContent(_ref) {
|
|
|
98
98
|
// Don't go any further if there's no other content than children
|
|
99
99
|
if (onlyChildren) {
|
|
100
100
|
return ___EmotionJSX("div", _extends({
|
|
101
|
-
css: cssStyles
|
|
101
|
+
css: cssStyles,
|
|
102
|
+
style: styles
|
|
102
103
|
}, rest), ___EmotionJSX("div", {
|
|
103
104
|
css: childrenOnlyStyles
|
|
104
105
|
}, children));
|
|
@@ -123,25 +123,31 @@ export var EuiInputPopover = function EuiInputPopover(_ref) {
|
|
|
123
123
|
*/
|
|
124
124
|
|
|
125
125
|
var panelPropsOnKeyDown = (_props$panelProps = props.panelProps) === null || _props$panelProps === void 0 ? void 0 : _props$panelProps.onKeyDown;
|
|
126
|
+
var handleTabNavigation = useCallback(function (e) {
|
|
127
|
+
var tabbableItems = tabbable(e.currentTarget).filter(function (el) {
|
|
128
|
+
return !el.hasAttribute('data-focus-guard');
|
|
129
|
+
});
|
|
130
|
+
if (!tabbableItems.length) return;
|
|
131
|
+
var tabbingFromFirstItemInPopover = document.activeElement === tabbableItems[0];
|
|
132
|
+
var tabbingFromLastItemInPopover = document.activeElement === tabbableItems[tabbableItems.length - 1];
|
|
133
|
+
if (tabbingFromFirstItemInPopover && e.shiftKey || tabbingFromLastItemInPopover && !e.shiftKey) {
|
|
134
|
+
closePopover();
|
|
135
|
+
}
|
|
136
|
+
}, [closePopover]);
|
|
126
137
|
var onKeyDown = useCallback(function (event) {
|
|
127
138
|
panelPropsOnKeyDown === null || panelPropsOnKeyDown === void 0 || panelPropsOnKeyDown(event);
|
|
128
139
|
if (event.key === keys.TAB) {
|
|
129
140
|
if (disableFocusTrap) {
|
|
130
141
|
if (!ownFocus) {
|
|
131
|
-
|
|
142
|
+
handleTabNavigation(event);
|
|
132
143
|
}
|
|
133
144
|
} else {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
});
|
|
137
|
-
if (!tabbableItems.length) return;
|
|
138
|
-
var tabbingFromLastItemInPopover = document.activeElement === tabbableItems[tabbableItems.length - 1];
|
|
139
|
-
if (tabbingFromLastItemInPopover) {
|
|
140
|
-
closePopover();
|
|
145
|
+
if (!ownFocus) {
|
|
146
|
+
handleTabNavigation(event);
|
|
141
147
|
}
|
|
142
148
|
}
|
|
143
149
|
}
|
|
144
|
-
}, [disableFocusTrap, ownFocus,
|
|
150
|
+
}, [disableFocusTrap, ownFocus, panelPropsOnKeyDown, handleTabNavigation]);
|
|
145
151
|
|
|
146
152
|
/**
|
|
147
153
|
* Optional close on scroll behavior
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import {
|
|
10
|
+
import { EuiThemeAmsterdam } from '../../themes';
|
|
11
11
|
import { EuiThemeProvider } from '../../services';
|
|
12
12
|
import { emitEuiProviderWarning } from '../../services/theme/warning';
|
|
13
13
|
import { cache as fallbackCache } from '../../services/emotion/css';
|
|
@@ -26,7 +26,7 @@ export var EuiProvider = function EuiProvider(_ref) {
|
|
|
26
26
|
var _ref$cache = _ref.cache,
|
|
27
27
|
cache = _ref$cache === void 0 ? fallbackCache : _ref$cache,
|
|
28
28
|
_ref$theme = _ref.theme,
|
|
29
|
-
theme = _ref$theme === void 0 ?
|
|
29
|
+
theme = _ref$theme === void 0 ? EuiThemeAmsterdam : _ref$theme,
|
|
30
30
|
_ref$globalStyles = _ref.globalStyles,
|
|
31
31
|
Globals = _ref$globalStyles === void 0 ? EuiGlobalStyles : _ref$globalStyles,
|
|
32
32
|
_ref$utilityClasses = _ref.utilityClasses,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { EuiVisColorStore } from '@elastic/eui-theme-common';
|
|
10
|
-
import { colorVis } from '
|
|
10
|
+
import { colorVisLight as colorVis } from '../../themes/amsterdam/global_styling/variables/_colors_vis_light';
|
|
11
11
|
|
|
12
12
|
// initialsetup of Vis color storage with default colors
|
|
13
13
|
export var EUI_VIS_COLOR_STORE = EuiVisColorStore.getInstance(colorVis, false);
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { createContext } from 'react';
|
|
10
|
-
import {
|
|
10
|
+
import { EuiThemeAmsterdam } from '../../themes/amsterdam/theme';
|
|
11
11
|
import { DEFAULT_COLOR_MODE, getComputed } from './utils';
|
|
12
12
|
export var DEFAULTS = {
|
|
13
|
-
system:
|
|
13
|
+
system: EuiThemeAmsterdam,
|
|
14
14
|
modifications: {},
|
|
15
15
|
colorMode: DEFAULT_COLOR_MODE,
|
|
16
16
|
highContrastMode: false
|