@elastic/eui 112.0.0 → 112.1.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/badge/badge.js +12 -3
- package/es/components/badge/badge.styles.js +47 -21
- package/es/components/badge/beta_badge/beta_badge.styles.js +2 -2
- package/es/components/badge/color_utils.js +20 -7
- package/es/components/badge/notification_badge/badge_notification.styles.js +1 -1
- package/es/components/button/button.js +2 -1
- package/es/components/button/button_empty/button_empty.js +2 -1
- package/es/components/context_menu/context_menu.js +20 -7
- package/es/components/date_picker/super_date_picker/super_date_picker.js +7 -0
- package/es/components/date_picker/super_date_picker/time_window_buttons.js +74 -25
- package/es/components/description_list/description_list.js +2 -1
- package/es/components/description_list/description_list_description.js +2 -1
- package/es/components/description_list/description_list_title.js +2 -1
- package/es/components/empty_prompt/empty_prompt.js +2 -1
- package/es/components/flex/flex_grid.js +2 -1
- package/es/components/flyout/flyout.component.js +31 -26
- package/es/components/icon/assets/timeline.js +3 -1
- package/es/components/icon/icon.js +2 -1
- package/es/components/image/image.js +2 -1
- package/es/components/loading/loading_logo.js +2 -1
- package/es/components/page/page_section/page_section.js +2 -1
- package/es/components/page/page_sidebar/page_sidebar.js +2 -1
- package/es/components/page_template/page_template.js +6 -0
- package/es/components/panel/panel.js +4 -3
- package/es/components/selectable/selectable_list/selectable_list.js +8 -2
- package/es/components/selectable/selectable_list/selectable_list_item.js +6 -0
- package/eui.d.ts +236 -441
- package/i18ntokens.json +803 -749
- package/lib/components/badge/badge.js +12 -3
- package/lib/components/badge/badge.styles.js +46 -20
- package/lib/components/badge/beta_badge/beta_badge.styles.js +2 -2
- package/lib/components/badge/color_utils.js +21 -8
- package/lib/components/badge/notification_badge/badge_notification.styles.js +1 -1
- package/lib/components/button/button.js +2 -1
- package/lib/components/button/button_empty/button_empty.js +2 -1
- package/lib/components/context_menu/context_menu.js +20 -7
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +7 -0
- package/lib/components/date_picker/super_date_picker/time_window_buttons.js +75 -26
- package/lib/components/description_list/description_list.js +2 -1
- package/lib/components/description_list/description_list_description.js +2 -1
- package/lib/components/description_list/description_list_title.js +2 -1
- package/lib/components/empty_prompt/empty_prompt.js +2 -1
- package/lib/components/flex/flex_grid.js +2 -1
- package/lib/components/flyout/flyout.component.js +38 -33
- package/lib/components/icon/assets/timeline.js +3 -1
- package/lib/components/icon/icon.js +2 -1
- package/lib/components/icon/svgs/timeline.svg +2 -1
- package/lib/components/image/image.js +2 -1
- package/lib/components/loading/loading_logo.js +2 -1
- package/lib/components/page/page_section/page_section.js +2 -1
- package/lib/components/page/page_sidebar/page_sidebar.js +2 -1
- package/lib/components/page_template/page_template.js +6 -0
- package/lib/components/panel/panel.js +4 -3
- package/lib/components/selectable/selectable_list/selectable_list.js +8 -2
- package/lib/components/selectable/selectable_list/selectable_list_item.js +6 -0
- package/optimize/es/components/badge/badge.js +6 -3
- package/optimize/es/components/badge/badge.styles.js +47 -21
- package/optimize/es/components/badge/beta_badge/beta_badge.styles.js +2 -2
- package/optimize/es/components/badge/color_utils.js +20 -7
- package/optimize/es/components/badge/notification_badge/badge_notification.styles.js +1 -1
- package/optimize/es/components/button/button.js +2 -1
- package/optimize/es/components/button/button_empty/button_empty.js +2 -1
- package/optimize/es/components/context_menu/context_menu.js +15 -6
- package/optimize/es/components/date_picker/super_date_picker/time_window_buttons.js +74 -25
- package/optimize/es/components/description_list/description_list.js +2 -1
- package/optimize/es/components/description_list/description_list_description.js +2 -1
- package/optimize/es/components/description_list/description_list_title.js +2 -1
- package/optimize/es/components/empty_prompt/empty_prompt.js +2 -1
- package/optimize/es/components/flex/flex_grid.js +2 -1
- package/optimize/es/components/flyout/flyout.component.js +31 -26
- package/optimize/es/components/icon/assets/timeline.js +3 -1
- package/optimize/es/components/icon/icon.js +2 -1
- package/optimize/es/components/image/image.js +2 -1
- package/optimize/es/components/loading/loading_logo.js +2 -1
- package/optimize/es/components/page/page_section/page_section.js +2 -1
- package/optimize/es/components/page/page_sidebar/page_sidebar.js +2 -1
- package/optimize/es/components/page_template/page_template.js +6 -0
- package/optimize/es/components/panel/panel.js +1 -0
- package/optimize/es/components/selectable/selectable_list/selectable_list.js +2 -2
- package/optimize/lib/components/badge/badge.js +6 -3
- package/optimize/lib/components/badge/badge.styles.js +46 -20
- package/optimize/lib/components/badge/beta_badge/beta_badge.styles.js +2 -2
- package/optimize/lib/components/badge/color_utils.js +21 -8
- package/optimize/lib/components/badge/notification_badge/badge_notification.styles.js +1 -1
- package/optimize/lib/components/button/button.js +2 -1
- package/optimize/lib/components/button/button_empty/button_empty.js +2 -1
- package/optimize/lib/components/context_menu/context_menu.js +15 -6
- package/optimize/lib/components/date_picker/super_date_picker/time_window_buttons.js +75 -26
- package/optimize/lib/components/description_list/description_list.js +2 -1
- package/optimize/lib/components/description_list/description_list_description.js +2 -1
- package/optimize/lib/components/description_list/description_list_title.js +2 -1
- package/optimize/lib/components/empty_prompt/empty_prompt.js +2 -1
- package/optimize/lib/components/flex/flex_grid.js +2 -1
- package/optimize/lib/components/flyout/flyout.component.js +38 -33
- package/optimize/lib/components/icon/assets/timeline.js +3 -1
- package/optimize/lib/components/icon/icon.js +2 -1
- package/optimize/lib/components/icon/svgs/timeline.svg +2 -1
- package/optimize/lib/components/image/image.js +2 -1
- package/optimize/lib/components/loading/loading_logo.js +2 -1
- package/optimize/lib/components/page/page_section/page_section.js +2 -1
- package/optimize/lib/components/page/page_sidebar/page_sidebar.js +2 -1
- package/optimize/lib/components/page_template/page_template.js +6 -0
- package/optimize/lib/components/panel/panel.js +1 -0
- package/optimize/lib/components/selectable/selectable_list/selectable_list.js +2 -2
- package/package.json +3 -3
- package/test-env/components/badge/badge.js +12 -3
- package/test-env/components/badge/badge.styles.js +46 -20
- package/test-env/components/badge/beta_badge/beta_badge.styles.js +2 -2
- package/test-env/components/badge/color_utils.js +21 -8
- package/test-env/components/badge/notification_badge/badge_notification.styles.js +1 -1
- package/test-env/components/button/button.js +2 -1
- package/test-env/components/button/button_empty/button_empty.js +2 -1
- package/test-env/components/context_menu/context_menu.js +20 -7
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +7 -0
- package/test-env/components/date_picker/super_date_picker/time_window_buttons.js +75 -26
- package/test-env/components/description_list/description_list.js +2 -1
- package/test-env/components/description_list/description_list_description.js +2 -1
- package/test-env/components/description_list/description_list_title.js +2 -1
- package/test-env/components/empty_prompt/empty_prompt.js +2 -1
- package/test-env/components/flex/flex_grid.js +2 -1
- package/test-env/components/flyout/flyout.component.js +38 -33
- package/test-env/components/icon/assets/timeline.js +3 -1
- package/test-env/components/image/image.js +2 -1
- package/test-env/components/loading/loading_logo.js +2 -1
- package/test-env/components/page/page_section/page_section.js +2 -1
- package/test-env/components/page/page_sidebar/page_sidebar.js +2 -1
- package/test-env/components/page_template/page_template.js +6 -0
- package/test-env/components/panel/panel.js +4 -3
- package/test-env/components/selectable/selectable_list/selectable_list.js +8 -2
- package/test-env/components/selectable/selectable_list/selectable_list_item.js +6 -0
|
@@ -9,6 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _services = require("../../services");
|
|
11
11
|
var _manager = require("./manager");
|
|
12
|
+
var _const = require("./manager/const");
|
|
12
13
|
var _focus_trap = require("../focus_trap");
|
|
13
14
|
var _i18n = require("../i18n");
|
|
14
15
|
var _resize_observer = require("../observer/resize_observer");
|
|
@@ -16,7 +17,7 @@ var _accessibility = require("../accessibility");
|
|
|
16
17
|
var _flyout_close_button = require("./_flyout_close_button");
|
|
17
18
|
var _flyout = require("./flyout.styles");
|
|
18
19
|
var _component_defaults = require("../provider/component_defaults");
|
|
19
|
-
var
|
|
20
|
+
var _const2 = require("./const");
|
|
20
21
|
var _hooks = require("./hooks");
|
|
21
22
|
var _flyout_menu = require("./flyout_menu");
|
|
22
23
|
var _flyout_overlay = require("./_flyout_overlay");
|
|
@@ -73,11 +74,11 @@ var EuiFlyoutComponent = exports.EuiFlyoutComponent = /*#__PURE__*/(0, _react.fo
|
|
|
73
74
|
_usePropsWithComponen4 = _usePropsWithComponen.ownFocus,
|
|
74
75
|
ownFocus = _usePropsWithComponen4 === void 0 ? true : _usePropsWithComponen4,
|
|
75
76
|
_usePropsWithComponen5 = _usePropsWithComponen.side,
|
|
76
|
-
side = _usePropsWithComponen5 === void 0 ?
|
|
77
|
+
side = _usePropsWithComponen5 === void 0 ? _const2.DEFAULT_SIDE : _usePropsWithComponen5,
|
|
77
78
|
_usePropsWithComponen6 = _usePropsWithComponen.size,
|
|
78
|
-
_size = _usePropsWithComponen6 === void 0 ?
|
|
79
|
+
_size = _usePropsWithComponen6 === void 0 ? _const2.DEFAULT_SIZE : _usePropsWithComponen6,
|
|
79
80
|
_usePropsWithComponen7 = _usePropsWithComponen.paddingSize,
|
|
80
|
-
paddingSize = _usePropsWithComponen7 === void 0 ?
|
|
81
|
+
paddingSize = _usePropsWithComponen7 === void 0 ? _const2.DEFAULT_PADDING_SIZE : _usePropsWithComponen7,
|
|
81
82
|
_usePropsWithComponen8 = _usePropsWithComponen.maxWidth,
|
|
82
83
|
maxWidth = _usePropsWithComponen8 === void 0 ? false : _usePropsWithComponen8,
|
|
83
84
|
style = _usePropsWithComponen.style,
|
|
@@ -85,10 +86,10 @@ var EuiFlyoutComponent = exports.EuiFlyoutComponent = /*#__PURE__*/(0, _react.fo
|
|
|
85
86
|
hasChildBackground = _usePropsWithComponen9 === void 0 ? false : _usePropsWithComponen9,
|
|
86
87
|
maskProps = _usePropsWithComponen.maskProps,
|
|
87
88
|
_usePropsWithComponen10 = _usePropsWithComponen.type,
|
|
88
|
-
type = _usePropsWithComponen10 === void 0 ?
|
|
89
|
+
type = _usePropsWithComponen10 === void 0 ? _const2.DEFAULT_TYPE : _usePropsWithComponen10,
|
|
89
90
|
outsideClickCloses = _usePropsWithComponen.outsideClickCloses,
|
|
90
91
|
_usePropsWithComponen11 = _usePropsWithComponen.pushMinBreakpoint,
|
|
91
|
-
pushMinBreakpoint = _usePropsWithComponen11 === void 0 ?
|
|
92
|
+
pushMinBreakpoint = _usePropsWithComponen11 === void 0 ? _const2.DEFAULT_PUSH_MIN_BREAKPOINT : _usePropsWithComponen11,
|
|
92
93
|
_usePropsWithComponen12 = _usePropsWithComponen.pushAnimation,
|
|
93
94
|
pushAnimation = _usePropsWithComponen12 === void 0 ? false : _usePropsWithComponen12,
|
|
94
95
|
_focusTrapProps = _usePropsWithComponen.focusTrapProps,
|
|
@@ -165,6 +166,31 @@ var EuiFlyoutComponent = exports.EuiFlyoutComponent = /*#__PURE__*/(0, _react.fo
|
|
|
165
166
|
var _useResizeObserver = (0, _resize_observer.useResizeObserver)(isPushed ? resizeRef : null, 'width'),
|
|
166
167
|
width = _useResizeObserver.width;
|
|
167
168
|
|
|
169
|
+
// Memoize flyout identification and relationships to prevent race conditions
|
|
170
|
+
var flyoutIdentity = (0, _react.useMemo)(function () {
|
|
171
|
+
if (!flyoutId || !currentSession) {
|
|
172
|
+
return {
|
|
173
|
+
isMainFlyout: false,
|
|
174
|
+
siblingFlyoutId: null,
|
|
175
|
+
hasValidSession: false,
|
|
176
|
+
sessionForWidth: null
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
var siblingFlyoutId = currentSession.mainFlyoutId === flyoutId ? currentSession.childFlyoutId : currentSession.mainFlyoutId;
|
|
180
|
+
return {
|
|
181
|
+
isMainFlyout: currentSession.mainFlyoutId === flyoutId,
|
|
182
|
+
siblingFlyoutId: siblingFlyoutId,
|
|
183
|
+
hasValidSession: true,
|
|
184
|
+
sessionForWidth: currentSession
|
|
185
|
+
};
|
|
186
|
+
}, [flyoutId, currentSession]);
|
|
187
|
+
|
|
188
|
+
// Destructure for easier use
|
|
189
|
+
var siblingFlyoutId = flyoutIdentity.siblingFlyoutId,
|
|
190
|
+
isMainFlyout = flyoutIdentity.isMainFlyout;
|
|
191
|
+
var _siblingFlyoutWidth = (0, _manager.useFlyoutWidth)(siblingFlyoutId);
|
|
192
|
+
var siblingFlyoutWidth = layoutMode === _const.LAYOUT_MODE_STACKED ? 0 : _siblingFlyoutWidth;
|
|
193
|
+
|
|
168
194
|
/**
|
|
169
195
|
* Effect for adding push padding to body. Using useLayoutEffect to ensure
|
|
170
196
|
* padding changes happen synchronously before child components render -
|
|
@@ -179,12 +205,13 @@ var EuiFlyoutComponent = exports.EuiFlyoutComponent = /*#__PURE__*/(0, _react.fo
|
|
|
179
205
|
var paddingSide = side === 'left' ? 'paddingInlineStart' : 'paddingInlineEnd';
|
|
180
206
|
var cssVarName = "--euiPushFlyoutOffset".concat(side === 'left' ? 'InlineStart' : 'InlineEnd');
|
|
181
207
|
var managerSide = side === 'left' ? 'left' : 'right';
|
|
208
|
+
var paddingWidth = layoutMode === _const.LAYOUT_MODE_STACKED && isMainFlyout && _siblingFlyoutWidth ? _siblingFlyoutWidth : width;
|
|
182
209
|
if (shouldApplyPadding) {
|
|
183
|
-
document.body.style[paddingSide] = "".concat(
|
|
184
|
-
setGlobalCSSVariables(_defineProperty({}, cssVarName, "".concat(
|
|
210
|
+
document.body.style[paddingSide] = "".concat(paddingWidth, "px");
|
|
211
|
+
setGlobalCSSVariables(_defineProperty({}, cssVarName, "".concat(paddingWidth, "px")));
|
|
185
212
|
// Update manager state if in managed context
|
|
186
213
|
if (isInManagedContext && flyoutManagerRef.current) {
|
|
187
|
-
flyoutManagerRef.current.setPushPadding(managerSide,
|
|
214
|
+
flyoutManagerRef.current.setPushPadding(managerSide, paddingWidth);
|
|
188
215
|
}
|
|
189
216
|
} else {
|
|
190
217
|
// Explicitly remove padding when this push flyout becomes inactive
|
|
@@ -205,7 +232,7 @@ var EuiFlyoutComponent = exports.EuiFlyoutComponent = /*#__PURE__*/(0, _react.fo
|
|
|
205
232
|
flyoutManagerRef.current.setPushPadding(managerSide, 0);
|
|
206
233
|
}
|
|
207
234
|
};
|
|
208
|
-
}, [isPushed, isInManagedContext, isActiveManagedFlyout, setGlobalCSSVariables, side, width]);
|
|
235
|
+
}, [isPushed, isInManagedContext, isActiveManagedFlyout, setGlobalCSSVariables, side, width, layoutMode, isMainFlyout, _siblingFlyoutWidth]);
|
|
209
236
|
|
|
210
237
|
/**
|
|
211
238
|
* This class doesn't actually do anything by EUI, but is nice to add for consumers (JIC)
|
|
@@ -217,27 +244,6 @@ var EuiFlyoutComponent = exports.EuiFlyoutComponent = /*#__PURE__*/(0, _react.fo
|
|
|
217
244
|
document.body.classList.remove('euiBody--hasFlyout');
|
|
218
245
|
};
|
|
219
246
|
}, []);
|
|
220
|
-
|
|
221
|
-
// Memoize flyout identification and relationships to prevent race conditions
|
|
222
|
-
var flyoutIdentity = (0, _react.useMemo)(function () {
|
|
223
|
-
if (!flyoutId || !currentSession) {
|
|
224
|
-
return {
|
|
225
|
-
isMainFlyout: false,
|
|
226
|
-
siblingFlyoutId: null,
|
|
227
|
-
hasValidSession: false,
|
|
228
|
-
sessionForWidth: null
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
var siblingFlyoutId = currentSession.mainFlyoutId === flyoutId ? currentSession.childFlyoutId : currentSession.mainFlyoutId;
|
|
232
|
-
return {
|
|
233
|
-
siblingFlyoutId: siblingFlyoutId,
|
|
234
|
-
hasValidSession: true,
|
|
235
|
-
sessionForWidth: currentSession
|
|
236
|
-
};
|
|
237
|
-
}, [flyoutId, currentSession]);
|
|
238
|
-
|
|
239
|
-
// Destructure for easier use
|
|
240
|
-
var siblingFlyoutId = flyoutIdentity.siblingFlyoutId;
|
|
241
247
|
var hasChildFlyout = (currentSession === null || currentSession === void 0 ? void 0 : currentSession.childFlyoutId) != null;
|
|
242
248
|
var isChildFlyout = isInManagedContext && hasChildFlyout && (currentSession === null || currentSession === void 0 ? void 0 : currentSession.childFlyoutId) === id;
|
|
243
249
|
var shouldCloseOnEscape = (0, _react.useMemo)(function () {
|
|
@@ -269,7 +275,6 @@ var EuiFlyoutComponent = exports.EuiFlyoutComponent = /*#__PURE__*/(0, _react.fo
|
|
|
269
275
|
onClose(event);
|
|
270
276
|
}
|
|
271
277
|
}, [onClose, isPushed, shouldCloseOnEscape]);
|
|
272
|
-
var siblingFlyoutWidth = (0, _manager.useFlyoutWidth)(siblingFlyoutId);
|
|
273
278
|
var managedFlyoutIndex = currentZIndexRef.current;
|
|
274
279
|
if (isInManagedContext && currentSession) {
|
|
275
280
|
managedFlyoutIndex = currentSession.zIndex;
|
|
@@ -291,7 +296,7 @@ var EuiFlyoutComponent = exports.EuiFlyoutComponent = /*#__PURE__*/(0, _react.fo
|
|
|
291
296
|
return _objectSpread(_objectSpread({}, style), composedStyles);
|
|
292
297
|
}, [style, size, layoutMode, siblingFlyoutId, siblingFlyoutWidth, maxWidth, flyoutZIndex]);
|
|
293
298
|
var styles = (0, _services.useEuiMemoizedStyles)(_flyout.euiFlyoutStyles);
|
|
294
|
-
var cssStyles = [styles.euiFlyout, styles.paddingSizes[paddingSize], (0,
|
|
299
|
+
var cssStyles = [styles.euiFlyout, styles.paddingSizes[paddingSize], (0, _const2.isEuiFlyoutSizeNamed)(size) && styles[size], maxWidth === false && styles.noMaxWidth, isPushed ? styles.push.push : styles.overlay.overlay, isPushed ? styles.push[side] : styles.overlay[side], isPushed && !pushAnimation && styles.push.noAnimation, styles[side]];
|
|
295
300
|
var classes = (0, _classnames.default)('euiFlyout', isChildFlyout && hasChildBackground && 'euiFlyout--hasChildBackground', className);
|
|
296
301
|
var flyoutToggle = (0, _react.useRef)(document.activeElement);
|
|
297
302
|
var _useState3 = (0, _react.useState)([]),
|
|
@@ -35,8 +35,10 @@ var EuiIconTimeline = function EuiIconTimeline(_ref) {
|
|
|
35
35
|
id: titleId
|
|
36
36
|
}, title) : null, (0, _react2.jsx)("path", {
|
|
37
37
|
fillRule: "evenodd",
|
|
38
|
-
d: "
|
|
38
|
+
d: "M13 6.5a1.5 1.5 0 0 1 1.413 1H16v1h-1.587a1.5 1.5 0 0 1-2.826 0H9.413a1.5 1.5 0 0 1-2.826 0H4.413a1.5 1.5 0 0 1-2.826 0H0v-1h1.587a1.5 1.5 0 0 1 2.826 0h2.174a1.5 1.5 0 0 1 2.826 0h2.174A1.5 1.5 0 0 1 13 6.5Zm-10 1a.5.5 0 1 0 0 1 .5.5 0 0 0 0-1Zm5 0a.5.5 0 1 0 0 1 .5.5 0 0 0 0-1Zm5 0a.5.5 0 1 0 0 1 .5.5 0 0 0 0-1Z",
|
|
39
39
|
clipRule: "evenodd"
|
|
40
|
+
}), (0, _react2.jsx)("path", {
|
|
41
|
+
d: "M1 13v2h4v-2H1Zm10 0v2h4v-2h-4ZM6 1v2h4V1H6Zm0 14a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1.5v-1h1v1H5a1 1 0 0 1 1 1v2Zm10 0a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1.5v-1h1v1H15a1 1 0 0 1 1 1v2ZM11 3a1 1 0 0 1-1 1H8.5v1h-1V4H6a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2Z"
|
|
40
42
|
}));
|
|
41
43
|
};
|
|
42
44
|
var icon = exports.icon = EuiIconTimeline;
|
|
@@ -319,4 +319,5 @@ EuiIconClass.propTypes = {
|
|
|
319
319
|
*/
|
|
320
320
|
onIconLoad: _propTypes.default.func
|
|
321
321
|
};
|
|
322
|
-
var EuiIcon = exports.EuiIcon = (0, _services.withEuiStylesMemoizer)(EuiIconClass);
|
|
322
|
+
var EuiIcon = exports.EuiIcon = (0, _services.withEuiStylesMemoizer)(EuiIconClass);
|
|
323
|
+
EuiIcon.displayName = 'EuiIcon';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
|
2
|
-
<path fill-rule="evenodd" d="
|
|
2
|
+
<path fill-rule="evenodd" d="M13 6.5a1.5 1.5 0 0 1 1.413 1H16v1h-1.587a1.5 1.5 0 0 1-2.826 0H9.413a1.5 1.5 0 0 1-2.826 0H4.413a1.5 1.5 0 0 1-2.826 0H0v-1h1.587a1.5 1.5 0 0 1 2.826 0h2.174a1.5 1.5 0 0 1 2.826 0h2.174A1.5 1.5 0 0 1 13 6.5Zm-10 1a.5.5 0 1 0 0 1 .5.5 0 0 0 0-1Zm5 0a.5.5 0 1 0 0 1 .5.5 0 0 0 0-1Zm5 0a.5.5 0 1 0 0 1 .5.5 0 0 0 0-1Z" clip-rule="evenodd"/>
|
|
3
|
+
<path d="M1 13v2h4v-2H1Zm10 0v2h4v-2h-4ZM6 1v2h4V1H6Zm0 14a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1.5v-1h1v1H5a1 1 0 0 1 1 1v2Zm10 0a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1.5v-1h1v1H15a1 1 0 0 1 1 1v2ZM11 3a1 1 0 0 1-1 1H8.5v1h-1V4H6a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2Z"/>
|
|
3
4
|
</svg>
|
|
@@ -59,4 +59,5 @@ EuiLoadingLogo.propTypes = {
|
|
|
59
59
|
* While this component should be restricted to using logo icons, it works with any IconType
|
|
60
60
|
*/
|
|
61
61
|
logo: _propTypes.default.oneOfType([_propTypes.default.oneOf(["accessibility", "addDataApp", "advancedSettingsApp", "agentApp", "aggregate", "alignBottom", "alignBottomLeft", "alignBottomRight", "alignCenterHorizontal", "alignCenterVertical", "alignLeft", "alignRight", "alignTop", "alignTopLeft", "alignTopRight", "alert", "analyzeEvent", "annotation", "anomalyChart", "chartAnomaly", "anomalySwimLane", "apmApp", "apmTrace", "chartWaterfall", "appSearchApp", "apps", "arrowDown", "chevronSingleDown", "arrowLeft", "chevronSingleLeft", "arrowRight", "chevronSingleRight", "arrowUp", "chevronSingleUp", "arrowStart", "chevronLimitLeft", "arrowEnd", "chevronLimitRight", "article", "asterisk", "at", "archive", "axisX", "axisYLeft", "axisYRight", "auditbeatApp", "backgroundTask", "beaker", "bell", "bellSlash", "beta", "bolt", "boxesHorizontal", "boxesVertical", "branch", "briefcase", "branchUser", "broom", "brush", "bug", "bulb", "bullseye", "calendar", "canvasApp", "casesApp", "changePointDetection", "chartChangePoint", "chartArea", "chartAreaStack", "chartBarHorizontal", "chartBarHorizontalStack", "chartBarVertical", "chartBarVerticalStack", "chartGauge", "chartHeatmap", "chartLine", "chartPie", "chartTagCloud", "chartThreshold", "check", "checkCircle", "checkInCircleFilled", "checkCircleFill", "cheer", "popper", "classificationJob", "clickLeft", "clickRight", "clock", "clockCounter", "clockControl", "cloud", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "code", "codeApp", "color", "paintBucket", "commandLine", "comment", "compare", "compute", "processor", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "contrast", "contrastHigh", "contrastFill", "controls", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "crossProjectSearch", "createAdvancedJob", "createGenericJob", "createGeoJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crossInCircle", "crossCircle", "crosshair", "crosshairs", "currency", "money", "cut", "scissors", "dashboardApp", "dashedCircle", "dataVisualizer", "database", "desktop", "display", "devToolsApp", "diff", "discoverApp", "distributeHorizontal", "distributeVertical", "download", "drag", "dragHorizontal", "dragVertical", "discuss", "document", "documentEdit", "documentation", "documents", "dot", "dotInCircle", "doubleArrowLeft", "chevronDoubleLeft", "doubleArrowRight", "chevronDoubleRight", "ellipsis", "editorAlignCenter", "textAlignCenter", "editorAlignLeft", "textAlignLeft", "editorAlignRight", "textAlignRight", "editorBold", "textBold", "editorChecklist", "listCheck", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "textHeading", "editorItalic", "textItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "listNumber", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "redo", "editorStrike", "textStrike", "editorTable", "table", "editorUnderline", "textUnderline", "editorUndo", "undo", "editorUnorderedList", "listBullet", "email", "mail", "empty", "emsApp", "endpoint", "eql", "query", "eraser", "error", "errorFilled", "errorFill", "esqlVis", "exit", "logOut", "expand", "maximize", "expandMini", "export", "exportAction", "upload", "external", "eye", "eyeClosed", "eyeSlash", "faceHappy", "faceNeutral", "faceSad", "fieldStatistics", "tableInfo", "filebeatApp", "filter", "filterExclude", "filterIgnore", "filterInclude", "filterInCircle", "flask", "flag", "fleetApp", "fold", "folder", "folderCheck", "folderClosed", "folderExclamation", "folderOpen", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "grabOmnidirectional", "gradient", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "hourglass", "if", "info", "image", "importAction", "index", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "mapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "indexTemporary", "tableTime", "infinity", "inputOutput", "inspect", "invert", "ip", "key", "keyboard", "kqlField", "queryField", "kqlFunction", "kqlOperand", "queryOperand", "kqlSelector", "querySelector", "kqlValue", "queryValue", "kubernetesNode", "kubernetesPod", "launch", "rocket", "layers", "lensApp", "lettering", "text", "lineBreak", "lineBreakSlash", "lineDash", "lineDashed", "lineDot", "lineDotted", "lineSolid", "link", "linkSlash", "list", "listAdd", "lock", "lockOpen", "logPatternAnalysis", "pattern", "logRateAnalysis", "logoAWS", "logoAWSMono", "logoAerospike", "logoApache", "logoAppSearch", "logoAzure", "logoAzureMono", "logoBeats", "logoBusinessAnalytics", "logoCeph", "logoCloud", "logoCloudEnterprise", "logoCode", "logoCodesandbox", "logoCouchbase", "logoDocker", "logoDropwizard", "logoElastic", "logoElasticStack", "logoElasticsearch", "logoEnterpriseSearch", "logoEtcd", "logoGCP", "logoGCPMono", "logoGithub", "logoGmail", "logoGolang", "logoGoogleG", "logoHAproxy", "logoIBM", "logoIBMMono", "logoKafka", "logoKibana", "logoKubernetes", "logoLogging", "logoLogstash", "logoMaps", "logoMemcached", "logoMetrics", "logoMongodb", "logoMySQL", "logoNginx", "logoObservability", "logoOsquery", "logoPhp", "logoPostgres", "logoPrometheus", "logoRabbitmq", "logoRedis", "logoSecurity", "logoSiteSearch", "logoSketch", "logoSlack", "logoUptime", "logoVulnerabilityManagement", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "queue", "machineLearningApp", "magnet", "magnify", "magnifyExclamation", "magnifyMinus", "magnifyPlus", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "map", "mapMarker", "waypoint", "megaphone", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusCircle", "minusInCircle", "minusInCircleFilled", "minusInSquare", "minusSquare", "mobile", "monitoringApp", "moon", "move", "namespace", "nested", "newChat", "node", "vectorTriangle", "notebookApp", "number", "offline", "wifiSlash", "online", "wifi", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "palette", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFill", "pinFilled", "pipeBreaks", "pipelineApp", "pipeNoBreaks", "pivot", "play", "playFilled", "plugs", "plus", "plusCircle", "plusInCircle", "plusInCircleFilled", "plusInSquare", "plusSquare", "popout", "presentation", "productRobot", "productAgent", "productCloudInfra", "productDashboard", "productDiscover", "productML", "productStreamsClassic", "productStreamsWired", "push", "send", "question", "quote", "radar", "readOnly", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "return", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "section", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "sessionViewer", "shard", "share", "singleMetricViewer", "snowflake", "sortAscending", "sortDescending", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spaces", "spacesApp", "sparkles", "sqlApp", "star", "starEmpty", "starEmptySpace", "starFill", "starFilled", "starFillSpace", "starFilledSpace", "starMinusEmpty", "starMinusFill", "starMinusFilled", "starPlusEmpty", "starPlusFill", "starPlusFilled", "stats", "stop", "stopFill", "stopFilled", "stopSlash", "storage", "streamsClassic", "streamsWired", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityHigh", "tableDensityExpanded", "tableDensityLow", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "thermometer", "thumbDown", "thumbUp", "timeline", "timelineWithArrow", "timelionApp", "timeRefresh", "refreshTime", "timeslider", "training", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "unarchive", "vector", "vectorSquare", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "chartMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "vulnerabilityManagementApp", "warning", "warningFilled", "warningFill", "watchesApp", "web", "wordWrap", "wordWrapDisabled", "workflowsApp", "workflow", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "tokenDimension", "tokenElement", "tokenEnum", "tokenEnumMember", "tokenEvent", "tokenException", "tokenField", "tokenFile", "tokenFlattened", "tokenFunction", "tokenGeo", "tokenHistogram", "tokenInterface", "tokenIP", "tokenJoin", "tokenKey", "tokenKeyword", "tokenMethod", "tokenMetricCounter", "tokenMetricGauge", "tokenModule", "tokenNamespace", "tokenNested", "tokenNull", "tokenNumber", "tokenObject", "tokenOperator", "tokenPackage", "tokenParameter", "tokenPercolator", "tokenProperty", "tokenRange", "tokenRankFeature", "tokenRankFeatures", "tokenRepo", "tokenSearchType", "tokenSemanticText", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable", "tokenVectorDense", "tokenDenseVector", "tokenVectorSparse"]).isRequired, _propTypes.default.string.isRequired, _propTypes.default.elementType.isRequired])
|
|
62
|
-
};
|
|
62
|
+
};
|
|
63
|
+
EuiLoadingLogo.displayName = 'EuiLoadingLogo';
|
|
@@ -105,4 +105,5 @@ EuiPageSection.propTypes = {
|
|
|
105
105
|
* Sets which HTML element to render.
|
|
106
106
|
*/
|
|
107
107
|
component: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.elementType.isRequired])
|
|
108
|
-
};
|
|
108
|
+
};
|
|
109
|
+
EuiPageSection.displayName = 'EuiPageSection';
|
|
@@ -224,6 +224,7 @@ _EuiPageTemplate.propTypes = {
|
|
|
224
224
|
*/
|
|
225
225
|
component: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.elementType.isRequired])
|
|
226
226
|
};
|
|
227
|
+
_EuiPageTemplate.displayName = 'EuiPageTemplate';
|
|
227
228
|
var _EuiPageSidebar = function _EuiPageSidebar(props) {
|
|
228
229
|
var _useContext = (0, _react.useContext)(TemplateContext),
|
|
229
230
|
sidebar = _useContext.sidebar;
|
|
@@ -263,6 +264,7 @@ _EuiPageSidebar.propTypes = {
|
|
|
263
264
|
"data-test-subj": _propTypes.default.string,
|
|
264
265
|
css: _propTypes.default.any
|
|
265
266
|
};
|
|
267
|
+
_EuiPageSidebar.displayName = 'EuiPageTemplate.Sidebar';
|
|
266
268
|
var _EuiPageSection = function _EuiPageSection(props) {
|
|
267
269
|
var _useContext2 = (0, _react.useContext)(TemplateContext),
|
|
268
270
|
section = _useContext2.section;
|
|
@@ -312,6 +314,7 @@ _EuiPageSection.propTypes = {
|
|
|
312
314
|
*/
|
|
313
315
|
component: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.elementType.isRequired])
|
|
314
316
|
};
|
|
317
|
+
_EuiPageSection.displayName = 'EuiPageTemplate.Section';
|
|
315
318
|
var _EuiPageHeader = function _EuiPageHeader(props) {
|
|
316
319
|
var _useContext3 = (0, _react.useContext)(TemplateContext),
|
|
317
320
|
header = _useContext3.header;
|
|
@@ -345,6 +348,7 @@ _EuiPageHeader.propTypes = {
|
|
|
345
348
|
*/
|
|
346
349
|
bottomBorder: _propTypes.default.oneOfType([_propTypes.default.bool.isRequired, _propTypes.default.oneOf(["extended"])])
|
|
347
350
|
};
|
|
351
|
+
_EuiPageHeader.displayName = 'EuiPageTemplate.Header';
|
|
348
352
|
var _EuiPageEmptyPrompt = function _EuiPageEmptyPrompt(props) {
|
|
349
353
|
var _useContext4 = (0, _react.useContext)(TemplateContext),
|
|
350
354
|
emptyPrompt = _useContext4.emptyPrompt;
|
|
@@ -369,6 +373,7 @@ _EuiPageEmptyPrompt.propTypes = {
|
|
|
369
373
|
component: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.elementType.isRequired]),
|
|
370
374
|
panelled: _propTypes.default.bool
|
|
371
375
|
};
|
|
376
|
+
_EuiPageEmptyPrompt.displayName = 'EuiPageTemplate.EmptyPrompt';
|
|
372
377
|
var _EuiPageBottomBar = function _EuiPageBottomBar(props) {
|
|
373
378
|
var _useContext5 = (0, _react.useContext)(TemplateContext),
|
|
374
379
|
bottomBar = _useContext5.bottomBar;
|
|
@@ -388,6 +393,7 @@ _EuiPageBottomBar.propTypes = {
|
|
|
388
393
|
*/
|
|
389
394
|
restrictWidth: _propTypes.default.oneOfType([_propTypes.default.bool.isRequired, _propTypes.default.number.isRequired, _propTypes.default.string.isRequired])
|
|
390
395
|
};
|
|
396
|
+
_EuiPageBottomBar.displayName = 'EuiPageTemplate.BottomBar';
|
|
391
397
|
var EuiPageTemplate = exports.EuiPageTemplate = Object.assign(_EuiPageTemplate, {
|
|
392
398
|
Sidebar: _EuiPageSidebar,
|
|
393
399
|
Header: _EuiPageHeader,
|
|
@@ -95,9 +95,6 @@ var EuiPanel = exports.EuiPanel = function EuiPanel(_ref) {
|
|
|
95
95
|
css: cssStyles
|
|
96
96
|
}, rest), children);
|
|
97
97
|
};
|
|
98
|
-
|
|
99
|
-
// Do not render a high contrast border if the panel is transparent
|
|
100
|
-
// and does not have a default contrast border
|
|
101
98
|
EuiPanel.propTypes = {
|
|
102
99
|
element: _propTypes.default.oneOfType([_propTypes.default.oneOf(["button"]), _propTypes.default.oneOf(["div"])]),
|
|
103
100
|
/**
|
|
@@ -154,6 +151,10 @@ EuiPanel.propTypes = {
|
|
|
154
151
|
"data-test-subj": _propTypes.default.string,
|
|
155
152
|
css: _propTypes.default.any
|
|
156
153
|
};
|
|
154
|
+
EuiPanel.displayName = 'EuiPanel';
|
|
155
|
+
|
|
156
|
+
// Do not render a high contrast border if the panel is transparent
|
|
157
|
+
// and does not have a default contrast border
|
|
157
158
|
var _canRenderHighContrastBorder = exports._canRenderHighContrastBorder = function _canRenderHighContrastBorder(_ref2) {
|
|
158
159
|
var color = _ref2.color,
|
|
159
160
|
hasBorder = _ref2.hasBorder;
|
|
@@ -496,8 +496,8 @@ var EuiSelectableList = exports.EuiSelectableList = /*#__PURE__*/function (_Comp
|
|
|
496
496
|
(_this$listRef = this.listRef) === null || _this$listRef === void 0 || _this$listRef.scrollToItem(activeOptionIndex, 'auto');
|
|
497
497
|
} else {
|
|
498
498
|
var _this$listBoxRef;
|
|
499
|
-
var activeOptionId =
|
|
500
|
-
var activeOptionEl = (_this$listBoxRef = this.listBoxRef) === null || _this$listBoxRef === void 0 ? void 0 : _this$listBoxRef.querySelector(activeOptionId);
|
|
499
|
+
var activeOptionId = makeOptionId(activeOptionIndex);
|
|
500
|
+
var activeOptionEl = (_this$listBoxRef = this.listBoxRef) === null || _this$listBoxRef === void 0 ? void 0 : _this$listBoxRef.querySelector("[id=\"".concat(activeOptionId, "\"]"));
|
|
501
501
|
if (activeOptionEl) {
|
|
502
502
|
var _activeOptionEl$scrol;
|
|
503
503
|
// TODO: we can remove scrollIntoView's conditional chaining once jsdom stubs it
|
|
@@ -635,6 +635,12 @@ EuiSelectableList.propTypes = {
|
|
|
635
635
|
* Accepts either our palette colors (primary, success ..etc) or a hex value `#FFFFFF`, `#000`.
|
|
636
636
|
*/
|
|
637
637
|
color: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.string.isRequired]),
|
|
638
|
+
/**
|
|
639
|
+
* Whether the badge should use filled (more intense) colors.
|
|
640
|
+
* It has no effect when a non-named color is passed to the `color` prop.
|
|
641
|
+
* @default false
|
|
642
|
+
*/
|
|
643
|
+
fill: _propTypes.default.bool,
|
|
638
644
|
/**
|
|
639
645
|
* Will override any color passed through the `color` prop.
|
|
640
646
|
*/
|
|
@@ -326,6 +326,12 @@ EuiSelectableListItem.propTypes = {
|
|
|
326
326
|
* Accepts either our palette colors (primary, success ..etc) or a hex value `#FFFFFF`, `#000`.
|
|
327
327
|
*/
|
|
328
328
|
color: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.string.isRequired]),
|
|
329
|
+
/**
|
|
330
|
+
* Whether the badge should use filled (more intense) colors.
|
|
331
|
+
* It has no effect when a non-named color is passed to the `color` prop.
|
|
332
|
+
* @default false
|
|
333
|
+
*/
|
|
334
|
+
fill: _propTypes.default.bool,
|
|
329
335
|
/**
|
|
330
336
|
* Will override any color passed through the `color` prop.
|
|
331
337
|
*/
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["children", "color", "iconType", "iconSide", "className", "isDisabled", "onClick", "iconOnClick", "onClickAriaLabel", "iconOnClickAriaLabel", "closeButtonProps", "href", "rel", "target", "style"];
|
|
5
|
+
var _excluded = ["children", "color", "fill", "iconType", "iconSide", "className", "isDisabled", "onClick", "iconOnClick", "onClickAriaLabel", "iconOnClickAriaLabel", "closeButtonProps", "href", "rel", "target", "style"];
|
|
6
6
|
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; }
|
|
7
7
|
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; }
|
|
8
8
|
/*
|
|
@@ -29,6 +29,8 @@ export var EuiBadge = function EuiBadge(_ref) {
|
|
|
29
29
|
var children = _ref.children,
|
|
30
30
|
_ref$color = _ref.color,
|
|
31
31
|
color = _ref$color === void 0 ? 'default' : _ref$color,
|
|
32
|
+
_ref$fill = _ref.fill,
|
|
33
|
+
fill = _ref$fill === void 0 ? false : _ref$fill,
|
|
32
34
|
iconType = _ref.iconType,
|
|
33
35
|
_ref$iconSide = _ref.iconSide,
|
|
34
36
|
iconSide = _ref$iconSide === void 0 ? 'left' : _ref$iconSide,
|
|
@@ -47,6 +49,7 @@ export var EuiBadge = function EuiBadge(_ref) {
|
|
|
47
49
|
var isHrefValid = !href || validateHref(href);
|
|
48
50
|
var isDisabled = _isDisabled || !isHrefValid;
|
|
49
51
|
var isNamedColor = COLORS.includes(color);
|
|
52
|
+
var isIconOnly = !children && !!iconType;
|
|
50
53
|
var euiTheme = useEuiTheme();
|
|
51
54
|
var customColorStyles = useMemo(function () {
|
|
52
55
|
// Disabled badges should not have custom colors
|
|
@@ -72,7 +75,7 @@ export var EuiBadge = function EuiBadge(_ref) {
|
|
|
72
75
|
}
|
|
73
76
|
}, [color, isNamedColor, isDisabled, style, euiTheme]);
|
|
74
77
|
var styles = useEuiMemoizedStyles(euiBadgeStyles);
|
|
75
|
-
var cssStyles = [styles.euiBadge].concat(_toConsumableArray(isDisabled ? [styles.disabled] : [isNamedColor && styles[color], !iconOnClick && (onClick || href) && styles.clickable]));
|
|
78
|
+
var cssStyles = [styles.euiBadge, isIconOnly && styles.iconOnly].concat(_toConsumableArray(isDisabled ? [styles.disabled] : [isNamedColor && fill && styles.colors.fill[color], isNamedColor && !fill && styles.colors.base[color], !iconOnClick && (onClick || href) && styles.clickable]));
|
|
76
79
|
var textCssStyles = [styles.text.euiBadge__text, (onClick || href) && !isDisabled && styles.text.clickable];
|
|
77
80
|
var iconCssStyles = [styles.icon.euiBadge__icon, styles.icon[iconSide]];
|
|
78
81
|
var iconButtonCssStyles = [styles.iconButton.euiBadge__iconButton, styles.iconButton[iconSide]];
|
|
@@ -117,7 +120,7 @@ export var EuiBadge = function EuiBadge(_ref) {
|
|
|
117
120
|
} else {
|
|
118
121
|
optionalIcon = ___EmotionJSX(EuiIcon, {
|
|
119
122
|
type: iconType,
|
|
120
|
-
size:
|
|
123
|
+
size: "s",
|
|
121
124
|
className: "euiBadge__icon",
|
|
122
125
|
css: iconCssStyles,
|
|
123
126
|
color: "inherit" // forces the icon to inherit its parent color
|
|
@@ -8,7 +8,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
|
-
import { euiFontSize, euiFocusRing, euiTextTruncate, logicalCSS, logicalShorthandCSS, logicalTextAlignCSS, mathWithUnits } from '../../global_styling';
|
|
11
|
+
import { euiFontSize, euiFocusRing, euiTextTruncate, highContrastModeStyles, logicalCSS, logicalShorthandCSS, logicalTextAlignCSS, mathWithUnits } from '../../global_styling';
|
|
12
12
|
import { euiBadgeColors } from './color_utils';
|
|
13
13
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
14
14
|
name: "1jbvl30-euiBadge__iconButton",
|
|
@@ -29,28 +29,54 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
|
29
29
|
export var euiBadgeStyles = function euiBadgeStyles(euiThemeContext) {
|
|
30
30
|
var euiTheme = euiThemeContext.euiTheme;
|
|
31
31
|
var badgeColors = euiBadgeColors(euiThemeContext);
|
|
32
|
+
var defaultBadgeColors = badgeColors.fill.default;
|
|
32
33
|
var setBadgeColorVars = function setBadgeColorVars(colors) {
|
|
33
|
-
return "\n --euiBadgeTextColor: ".concat(colors.color, ";\n --euiBadgeBackgroundColor: ").concat(colors.backgroundColor, ";\n ");
|
|
34
|
+
return "\n --euiBadgeTextColor: ".concat(colors.color, ";\n --euiBadgeBackgroundColor: ").concat(colors.backgroundColor, ";\n ").concat(colors.border ? "--euiBadgeBorder: ".concat(colors.border, ";") : '', "\n ");
|
|
34
35
|
};
|
|
36
|
+
var inlinePadding = mathWithUnits(
|
|
37
|
+
// Account for the (usually transparent) border so that the visual
|
|
38
|
+
// padding is of size s
|
|
39
|
+
[euiTheme.size.s, euiTheme.border.width.thin], function (size, borderWidth) {
|
|
40
|
+
return size - borderWidth;
|
|
41
|
+
});
|
|
35
42
|
return {
|
|
36
|
-
euiBadge: /*#__PURE__*/css("display:inline-block;vertical-align:middle;", logicalShorthandCSS('padding', "0 ".concat(
|
|
43
|
+
euiBadge: /*#__PURE__*/css("display:inline-block;vertical-align:middle;", logicalShorthandCSS('padding', "0 ".concat(inlinePadding)), " ", logicalCSS('max-width', '100%'), " font-size:", euiFontSize(euiThemeContext, 'xs').fontSize, ";line-height:", mathWithUnits(
|
|
37
44
|
// Account for the border
|
|
38
45
|
[euiTheme.size.base, euiTheme.border.width.thin], function (x, y) {
|
|
39
46
|
return x + y * 2;
|
|
40
|
-
}), ";font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:inherit;border:", euiTheme.border.width.thin, " solid transparent;border-radius:",
|
|
41
|
-
|
|
42
|
-
}), "
|
|
47
|
+
}), ";font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:inherit;border:", euiTheme.border.width.thin, " solid transparent;border-radius:", euiTheme.size.l, ";", logicalTextAlignCSS('left'), "color:var(--euiBadgeTextColor, ", defaultBadgeColors.color, ");background-color:var(\n --euiBadgeBackgroundColor,\n ", defaultBadgeColors.backgroundColor, "\n );", highContrastModeStyles(euiThemeContext, {
|
|
48
|
+
preferred: "border: var(--euiBadgeBorder, ".concat(euiTheme.border.thin, ");")
|
|
49
|
+
}), "*::selection{color:var(\n --euiBadgeBackgroundColor,\n ", defaultBadgeColors.backgroundColor, "\n );background-color:var(--euiBadgeTextColor, ", defaultBadgeColors.color, ");}&:focus-within{", euiFocusRing(euiThemeContext), ";}&+.euiBadge{", logicalCSS('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
|
|
50
|
+
iconOnly: /*#__PURE__*/css("padding-inline:", mathWithUnits(
|
|
51
|
+
// Account for the border
|
|
52
|
+
[euiTheme.size.xs, euiTheme.border.width.thin], function (size, borderWidth) {
|
|
53
|
+
return size - borderWidth;
|
|
54
|
+
}), ";;label:iconOnly;"),
|
|
43
55
|
clickable: /*#__PURE__*/css("&:not(:disabled){&:hover,&:focus{text-decoration:underline;}}&:focus{", euiFocusRing(euiThemeContext), ";}&:disabled{cursor:not-allowed;};label:clickable;"),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
colors: {
|
|
57
|
+
fill: {
|
|
58
|
+
default: /*#__PURE__*/css(setBadgeColorVars(badgeColors.fill.default), " border-color:", badgeColors.fill.default.borderColor, ";;label:default;"),
|
|
59
|
+
hollow: /*#__PURE__*/css(setBadgeColorVars(badgeColors.hollow), " border-color:", badgeColors.hollow.borderColor, ";;label:hollow;"),
|
|
60
|
+
primary: /*#__PURE__*/css(setBadgeColorVars(badgeColors.fill.primary), ";label:primary;"),
|
|
61
|
+
accent: /*#__PURE__*/css(setBadgeColorVars(badgeColors.fill.accent), ";label:accent;"),
|
|
62
|
+
neutral: /*#__PURE__*/css(setBadgeColorVars(badgeColors.fill.neutral), ";label:neutral;"),
|
|
63
|
+
success: /*#__PURE__*/css(setBadgeColorVars(badgeColors.fill.success), ";label:success;"),
|
|
64
|
+
warning: /*#__PURE__*/css(setBadgeColorVars(badgeColors.fill.warning), ";label:warning;"),
|
|
65
|
+
risk: /*#__PURE__*/css(setBadgeColorVars(badgeColors.fill.risk), ";label:risk;"),
|
|
66
|
+
danger: /*#__PURE__*/css(setBadgeColorVars(badgeColors.fill.danger), ";label:danger;")
|
|
67
|
+
},
|
|
68
|
+
base: {
|
|
69
|
+
default: /*#__PURE__*/css(setBadgeColorVars(badgeColors.base.default), " border-color:", badgeColors.base.default.borderColor, ";;label:default;"),
|
|
70
|
+
hollow: /*#__PURE__*/css(setBadgeColorVars(badgeColors.hollow), " border-color:", badgeColors.hollow.borderColor, ";;label:hollow;"),
|
|
71
|
+
primary: /*#__PURE__*/css(setBadgeColorVars(badgeColors.base.primary), ";label:primary;"),
|
|
72
|
+
accent: /*#__PURE__*/css(setBadgeColorVars(badgeColors.base.accent), ";label:accent;"),
|
|
73
|
+
neutral: /*#__PURE__*/css(setBadgeColorVars(badgeColors.base.neutral), ";label:neutral;"),
|
|
74
|
+
success: /*#__PURE__*/css(setBadgeColorVars(badgeColors.base.success), ";label:success;"),
|
|
75
|
+
warning: /*#__PURE__*/css(setBadgeColorVars(badgeColors.base.warning), ";label:warning;"),
|
|
76
|
+
risk: /*#__PURE__*/css(setBadgeColorVars(badgeColors.base.risk), ";label:risk;"),
|
|
77
|
+
danger: /*#__PURE__*/css(setBadgeColorVars(badgeColors.base.danger), ";label:danger;")
|
|
78
|
+
}
|
|
79
|
+
},
|
|
54
80
|
disabled: /*#__PURE__*/css(setBadgeColorVars(badgeColors.disabled), " border-color:", badgeColors.disabled.borderColor, ";*::selection{color:", euiTheme.colors.emptyShade, ";};label:disabled;"),
|
|
55
81
|
// Content wrapper
|
|
56
82
|
euiBadge__content: /*#__PURE__*/css(logicalCSS(
|
|
@@ -60,20 +86,20 @@ export var euiBadgeStyles = function euiBadgeStyles(euiThemeContext) {
|
|
|
60
86
|
}))), " display:flex;align-items:center;overflow:hidden;;label:euiBadge__content;"),
|
|
61
87
|
// Text
|
|
62
88
|
text: {
|
|
63
|
-
euiBadge__text: /*#__PURE__*/css(euiTextTruncate(), " cursor:inherit;;label:euiBadge__text;"),
|
|
89
|
+
euiBadge__text: /*#__PURE__*/css(euiTextTruncate(), " padding-inline:", euiTheme.size.xxs, ";cursor:inherit;;label:euiBadge__text;"),
|
|
64
90
|
clickable: _ref2
|
|
65
91
|
},
|
|
66
92
|
// Icon
|
|
67
93
|
icon: {
|
|
68
94
|
euiBadge__icon: /*#__PURE__*/css(";label:euiBadge__icon;"),
|
|
69
|
-
right: /*#__PURE__*/css("&:not(:only-child){", logicalCSS('margin-left', euiTheme.size.
|
|
70
|
-
left: /*#__PURE__*/css("&:not(:only-child){", logicalCSS('margin-right', euiTheme.size.
|
|
95
|
+
right: /*#__PURE__*/css("&:not(:only-child){", logicalCSS('margin-left', euiTheme.size.xxs), ";};label:right;"),
|
|
96
|
+
left: /*#__PURE__*/css("&:not(:only-child){", logicalCSS('margin-right', euiTheme.size.xxs), ";};label:left;")
|
|
71
97
|
},
|
|
72
98
|
// Clickable icons (iconOnClick)
|
|
73
99
|
iconButton: {
|
|
74
100
|
euiBadge__iconButton: _ref,
|
|
75
|
-
right: /*#__PURE__*/css(logicalCSS('margin-left', euiTheme.size.
|
|
76
|
-
left: /*#__PURE__*/css(logicalCSS('margin-right', euiTheme.size.
|
|
101
|
+
right: /*#__PURE__*/css(logicalCSS('margin-left', euiTheme.size.xxs), ";;label:right;"),
|
|
102
|
+
left: /*#__PURE__*/css(logicalCSS('margin-right', euiTheme.size.xxs), ";;label:left;")
|
|
77
103
|
},
|
|
78
104
|
// Used in badges with both onClick & iconOnClick
|
|
79
105
|
euiBadge__childButton: /*#__PURE__*/css(euiTextTruncate(), " text-align:inherit;font-weight:inherit;line-height:inherit;color:inherit;&:disabled{cursor:not-allowed;}&:not(:disabled){&:hover,&:focus{text-decoration:underline;}};label:euiBadge__childButton;")
|
|
@@ -49,10 +49,10 @@ export var euiBetaBadgeStyles = function euiBetaBadgeStyles(euiThemeContext) {
|
|
|
49
49
|
color: colorMode === 'DARK' ? euiTheme.colors.ghost : euiTheme.colors.ink
|
|
50
50
|
}), ";};label:euiBetaBadge;"),
|
|
51
51
|
// Colors
|
|
52
|
-
accent: /*#__PURE__*/css(badgeColors.accent, ";label:accent;"),
|
|
52
|
+
accent: /*#__PURE__*/css(badgeColors.fill.accent, ";label:accent;"),
|
|
53
53
|
subdued: /*#__PURE__*/css(badgeColors.subdued, ";label:subdued;"),
|
|
54
54
|
hollow: /*#__PURE__*/css("color:", badgeColors.hollow.color, ";background-color:", badgeColors.hollow.backgroundColor, ";border-color:", badgeColors.hollow.borderColor, ";;label:hollow;"),
|
|
55
|
-
warning: /*#__PURE__*/css(badgeColors.warning, ";label:warning;"),
|
|
55
|
+
warning: /*#__PURE__*/css(badgeColors.fill.warning, ";label:warning;"),
|
|
56
56
|
// Font sizes
|
|
57
57
|
m: /*#__PURE__*/css("font-size:", euiFontSizeFromScale('xs', euiTheme), ";line-height:", badgeSizes.m, ";;label:m;"),
|
|
58
58
|
s: /*#__PURE__*/css("font-size:0.7rem;line-height:", badgeSizes.s, ";;label:s;"),
|
|
@@ -18,7 +18,7 @@ export var euiBadgeColors = function euiBadgeColors(euiThemeContext) {
|
|
|
18
18
|
var euiTheme = euiThemeContext.euiTheme,
|
|
19
19
|
highContrastMode = euiThemeContext.highContrastMode;
|
|
20
20
|
var badgeColorsAccentText = getBadgeColors(euiThemeContext, euiTheme.colors.textAccent);
|
|
21
|
-
|
|
21
|
+
var fill = {
|
|
22
22
|
// Colors shared between buttons and badges
|
|
23
23
|
primary: euiButtonFillColor(euiThemeContext, 'primary'),
|
|
24
24
|
neutral: euiButtonFillColor(euiThemeContext, 'neutral'),
|
|
@@ -27,12 +27,28 @@ export var euiBadgeColors = function euiBadgeColors(euiThemeContext) {
|
|
|
27
27
|
risk: euiButtonFillColor(euiThemeContext, 'risk'),
|
|
28
28
|
danger: euiButtonFillColor(euiThemeContext, 'danger'),
|
|
29
29
|
accent: euiButtonFillColor(euiThemeContext, 'accent'),
|
|
30
|
-
disabled: _objectSpread(_objectSpread({}, euiButtonColor(euiThemeContext, 'disabled')), {}, {
|
|
31
|
-
borderColor: highContrastMode ? euiTheme.colors.textDisabled : ''
|
|
32
|
-
}),
|
|
33
30
|
// Colors unique to badges
|
|
34
31
|
default: _objectSpread(_objectSpread({}, getBadgeColors(euiThemeContext, euiTheme.components.badgeBackground)), {}, {
|
|
35
32
|
borderColor: highContrastMode ? euiTheme.border.color : ''
|
|
33
|
+
})
|
|
34
|
+
};
|
|
35
|
+
var base = {
|
|
36
|
+
primary: euiButtonColor(euiThemeContext, 'primary'),
|
|
37
|
+
neutral: euiButtonColor(euiThemeContext, 'neutral'),
|
|
38
|
+
success: euiButtonColor(euiThemeContext, 'success'),
|
|
39
|
+
warning: euiButtonColor(euiThemeContext, 'warning'),
|
|
40
|
+
risk: euiButtonColor(euiThemeContext, 'risk'),
|
|
41
|
+
danger: euiButtonColor(euiThemeContext, 'danger'),
|
|
42
|
+
accent: euiButtonColor(euiThemeContext, 'accent'),
|
|
43
|
+
default: _objectSpread(_objectSpread({}, getBadgeColors(euiThemeContext, euiTheme.colors.backgroundLightText)), {}, {
|
|
44
|
+
borderColor: highContrastMode ? euiTheme.border.color : ''
|
|
45
|
+
})
|
|
46
|
+
};
|
|
47
|
+
return {
|
|
48
|
+
fill: fill,
|
|
49
|
+
base: base,
|
|
50
|
+
disabled: _objectSpread(_objectSpread({}, euiButtonColor(euiThemeContext, 'disabled')), {}, {
|
|
51
|
+
borderColor: highContrastMode ? euiTheme.colors.textDisabled : ''
|
|
36
52
|
}),
|
|
37
53
|
// Hollow has a border and is used for autocompleters and beta badges
|
|
38
54
|
hollow: _objectSpread(_objectSpread({}, getBadgeColors(euiThemeContext, euiTheme.colors.emptyShade)), {}, {
|
|
@@ -59,9 +75,6 @@ export var getTextColor = function getTextColor(_ref, bgColor) {
|
|
|
59
75
|
var textColor = isColorDark.apply(void 0, _toConsumableArray(chroma(bgColor).rgb())) ? euiTheme.colors.ghost : euiTheme.colors.ink;
|
|
60
76
|
return textColor;
|
|
61
77
|
};
|
|
62
|
-
export var getColorContrast = function getColorContrast(textColor, color) {
|
|
63
|
-
return chroma.contrast(textColor, color);
|
|
64
|
-
};
|
|
65
78
|
export var getIsValidColor = function getIsValidColor(color) {
|
|
66
79
|
return chromaValid(parseColor(color || '') || '');
|
|
67
80
|
};
|
|
@@ -27,7 +27,7 @@ export var euiNotificationBadgeStyles = function euiNotificationBadgeStyles(euiT
|
|
|
27
27
|
})), " ", logicalCSS('min-width', euiTheme.size.l), ";;label:m;"),
|
|
28
28
|
// Colors
|
|
29
29
|
accent: /*#__PURE__*/css(badgeColors.accentText, ";label:accent;"),
|
|
30
|
-
success: /*#__PURE__*/css(badgeColors.success, ";label:success;"),
|
|
30
|
+
success: /*#__PURE__*/css(badgeColors.fill.success, ";label:success;"),
|
|
31
31
|
subdued: /*#__PURE__*/css(badgeColors.subdued, ";label:subdued;")
|
|
32
32
|
};
|
|
33
33
|
};
|