@elastic/eui 85.0.0 → 85.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.
Files changed (137) hide show
  1. package/dist/eui_charts_theme.js +13 -16
  2. package/dist/eui_charts_theme.js.map +1 -1
  3. package/dist/eui_theme_dark.css +47 -90
  4. package/dist/eui_theme_dark.min.css +1 -1
  5. package/dist/eui_theme_light.css +47 -90
  6. package/dist/eui_theme_light.min.css +1 -1
  7. package/es/components/collapsible_nav_beta/collapsible_nav_beta.js +26 -0
  8. package/es/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +16 -0
  9. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +202 -0
  10. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +33 -0
  11. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +296 -0
  12. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +58 -0
  13. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_link.js +93 -0
  14. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_link.styles.js +28 -0
  15. package/es/components/collapsible_nav_beta/collapsible_nav_item/index.js +9 -0
  16. package/es/components/collapsible_nav_beta/index.js +15 -0
  17. package/es/components/color_picker/saturation.js +2 -1
  18. package/es/components/combo_box/combo_box_input/combo_box_input.js +7 -1
  19. package/es/components/combo_box/combo_box_input/combo_box_pill.js +16 -4
  20. package/es/components/combo_box/combo_box_options_list/combo_box_option.js +4 -0
  21. package/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +21 -3
  22. package/es/components/error_boundary/error_boundary.js +1 -1
  23. package/es/components/filter_group/filter_group.styles.js +2 -2
  24. package/es/components/filter_group/filter_select_item.js +31 -15
  25. package/es/components/filter_group/filter_select_item.styles.js +19 -0
  26. package/es/components/form/range/range_highlight.js +1 -0
  27. package/es/components/highlight/highlight.js +4 -4
  28. package/es/components/index.js +1 -0
  29. package/es/components/inline_edit/inline_edit_form.js +2 -1
  30. package/es/components/markdown_editor/markdown_editor.js +2 -2
  31. package/es/themes/amsterdam/global_styling/variables/_states.js +13 -16
  32. package/eui.d.ts +362 -129
  33. package/i18ntokens.json +50 -50
  34. package/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +30 -0
  35. package/lib/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +23 -0
  36. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +211 -0
  37. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +40 -0
  38. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +304 -0
  39. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +63 -0
  40. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_link.js +100 -0
  41. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_link.styles.js +35 -0
  42. package/lib/components/collapsible_nav_beta/collapsible_nav_item/index.js +12 -0
  43. package/lib/components/collapsible_nav_beta/index.js +19 -0
  44. package/lib/components/color_picker/saturation.js +2 -1
  45. package/lib/components/combo_box/combo_box_input/combo_box_input.js +7 -1
  46. package/lib/components/combo_box/combo_box_input/combo_box_pill.js +16 -4
  47. package/lib/components/combo_box/combo_box_options_list/combo_box_option.js +4 -0
  48. package/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +21 -3
  49. package/lib/components/error_boundary/error_boundary.js +1 -1
  50. package/lib/components/filter_group/filter_group.styles.js +1 -1
  51. package/lib/components/filter_group/filter_select_item.js +33 -17
  52. package/lib/components/filter_group/filter_select_item.styles.js +26 -0
  53. package/lib/components/form/range/range_highlight.js +1 -0
  54. package/lib/components/highlight/highlight.js +4 -4
  55. package/lib/components/index.js +11 -0
  56. package/lib/components/inline_edit/inline_edit_form.js +2 -1
  57. package/lib/components/markdown_editor/markdown_editor.js +2 -2
  58. package/lib/themes/amsterdam/global_styling/variables/_states.js +13 -16
  59. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.js +26 -0
  60. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +16 -0
  61. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +113 -0
  62. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +33 -0
  63. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +117 -0
  64. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +55 -0
  65. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_link.js +59 -0
  66. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_link.styles.js +28 -0
  67. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/index.js +9 -0
  68. package/optimize/es/components/collapsible_nav_beta/index.js +15 -0
  69. package/optimize/es/components/color_picker/saturation.js +2 -1
  70. package/optimize/es/components/combo_box/combo_box_input/combo_box_input.js +3 -1
  71. package/optimize/es/components/combo_box/combo_box_input/combo_box_pill.js +12 -4
  72. package/optimize/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +9 -3
  73. package/optimize/es/components/error_boundary/error_boundary.js +1 -1
  74. package/optimize/es/components/filter_group/filter_group.styles.js +2 -2
  75. package/optimize/es/components/filter_group/filter_select_item.js +30 -14
  76. package/optimize/es/components/filter_group/filter_select_item.styles.js +19 -0
  77. package/optimize/es/components/form/range/range_highlight.js +1 -0
  78. package/optimize/es/components/highlight/highlight.js +4 -4
  79. package/optimize/es/components/index.js +1 -0
  80. package/optimize/es/components/inline_edit/inline_edit_form.js +2 -1
  81. package/optimize/es/components/markdown_editor/markdown_editor.js +2 -2
  82. package/optimize/es/themes/amsterdam/global_styling/variables/_states.js +13 -16
  83. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +33 -0
  84. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +23 -0
  85. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +123 -0
  86. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +40 -0
  87. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +124 -0
  88. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +61 -0
  89. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_link.js +66 -0
  90. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_link.styles.js +35 -0
  91. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/index.js +12 -0
  92. package/optimize/lib/components/collapsible_nav_beta/index.js +19 -0
  93. package/optimize/lib/components/color_picker/saturation.js +2 -1
  94. package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.js +3 -1
  95. package/optimize/lib/components/combo_box/combo_box_input/combo_box_pill.js +12 -4
  96. package/optimize/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +9 -3
  97. package/optimize/lib/components/error_boundary/error_boundary.js +1 -1
  98. package/optimize/lib/components/filter_group/filter_group.styles.js +1 -1
  99. package/optimize/lib/components/filter_group/filter_select_item.js +32 -16
  100. package/optimize/lib/components/filter_group/filter_select_item.styles.js +26 -0
  101. package/optimize/lib/components/form/range/range_highlight.js +1 -0
  102. package/optimize/lib/components/highlight/highlight.js +4 -4
  103. package/optimize/lib/components/index.js +11 -0
  104. package/optimize/lib/components/inline_edit/inline_edit_form.js +2 -1
  105. package/optimize/lib/components/markdown_editor/markdown_editor.js +2 -2
  106. package/optimize/lib/themes/amsterdam/global_styling/variables/_states.js +13 -16
  107. package/package.json +1 -1
  108. package/src/components/combo_box/combo_box_input/_combo_box_pill.scss +24 -3
  109. package/src/components/combo_box/combo_box_options_list/_combo_box_option.scss +34 -14
  110. package/src/components/index.scss +0 -1
  111. package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.js +33 -0
  112. package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +23 -0
  113. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +208 -0
  114. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +40 -0
  115. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +303 -0
  116. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +61 -0
  117. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_link.js +96 -0
  118. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_link.styles.js +35 -0
  119. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/index.js +12 -0
  120. package/test-env/components/collapsible_nav_beta/index.js +19 -0
  121. package/test-env/components/color_picker/saturation.js +2 -1
  122. package/test-env/components/combo_box/combo_box_input/combo_box_input.js +7 -1
  123. package/test-env/components/combo_box/combo_box_input/combo_box_pill.js +16 -4
  124. package/test-env/components/combo_box/combo_box_options_list/combo_box_option.js +4 -0
  125. package/test-env/components/combo_box/combo_box_options_list/combo_box_options_list.js +21 -3
  126. package/test-env/components/error_boundary/error_boundary.js +1 -1
  127. package/test-env/components/filter_group/filter_group.styles.js +1 -1
  128. package/test-env/components/filter_group/filter_select_item.js +33 -17
  129. package/test-env/components/filter_group/filter_select_item.styles.js +26 -0
  130. package/test-env/components/form/range/range_highlight.js +1 -0
  131. package/test-env/components/highlight/highlight.js +4 -4
  132. package/test-env/components/index.js +11 -0
  133. package/test-env/components/inline_edit/inline_edit_form.js +2 -1
  134. package/test-env/components/markdown_editor/markdown_editor.js +2 -2
  135. package/test-env/themes/amsterdam/global_styling/variables/_states.js +13 -16
  136. package/src/components/filter_group/_filter_select_item.scss +0 -43
  137. package/src/components/filter_group/_index.scss +0 -1
@@ -0,0 +1,33 @@
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
+
9
+ import { css } from '@emotion/react';
10
+ import { logicalCSS, mathWithUnits, euiCanAnimate } from '../../../global_styling';
11
+ import { euiCollapsibleNavItemVariables } from './collapsible_nav_item.styles';
12
+ export var euiCollapsibleNavAccordionStyles = function euiCollapsibleNavAccordionStyles(euiThemeContext) {
13
+ var euiTheme = euiThemeContext.euiTheme;
14
+ var sharedStyles = euiCollapsibleNavItemVariables(euiThemeContext);
15
+ return {
16
+ // NOTE: Specific usage of `>`s selectors are important here, because accordions can be nested
17
+ // - just because a parent accordion is open or selected does not mean its child accordion is the same
18
+ euiCollapsibleNavAccordion: /*#__PURE__*/css(".euiAccordion__button{overflow:hidden;&:hover,&:focus{cursor:default;text-decoration:none;}}.euiAccordion__triggerWrapper{border-radius:", sharedStyles.borderRadius, ";", euiCanAnimate, "{transition:background-color ", sharedStyles.animation, ";}}.euiAccordion__buttonContent{", logicalCSS('max-width', '100%'), " flex-basis:100%;display:flex;align-items:center;}.euiCollapsibleNavLink{", logicalCSS('width', '100%'), ";};label:euiCollapsibleNavAccordion;"),
19
+ isTopItem: /*#__PURE__*/css("margin:", sharedStyles.padding, ";&>.euiAccordion__triggerWrapper{&:hover{background-color:", sharedStyles.backgroundHoverColor, ";}};label:isTopItem;"),
20
+ isSelected: /*#__PURE__*/css("&>.euiAccordion__triggerWrapper{background-color:", sharedStyles.backgroundSelectedColor, ";&:hover{background-color:", sharedStyles.backgroundSelectedColor, ";}};label:isSelected;"),
21
+ isSubItem: /*#__PURE__*/css("&.euiAccordion-isOpen{", logicalCSS('margin-bottom', euiTheme.size.m), ";};label:isSubItem;"),
22
+ // Arrow element
23
+ euiCollapsibleNavAccordion__arrow: /*#__PURE__*/css(logicalCSS('margin-right', euiTheme.size.xs), euiCanAnimate, "{transition:background-color ", sharedStyles.animation, ";}&:hover,&:focus-visible{background-color:", euiTheme.colors.lightShade, ";&>.euiIcon{color:", sharedStyles.color, ";}}transform:none!important;&>.euiIcon{color:", sharedStyles.rightIconColor, ";transform:rotate(-90deg);", euiCanAnimate, "{transition:transform ", sharedStyles.animation, ",color ", sharedStyles.animation, ";}}&.euiAccordion__iconButton-isOpen>.euiIcon{color:", sharedStyles.color, ";transform:rotate(90deg);};label:euiCollapsibleNavAccordion__arrow;"),
24
+ // Children wrapper
25
+ children: {
26
+ euiCollapsibleNavAccordion__children: /*#__PURE__*/css(";label:euiCollapsibleNavAccordion__children;"),
27
+ isTopItem: /*#__PURE__*/css(logicalCSS('padding-top', euiTheme.size.xs), " ", logicalCSS('padding-left', euiTheme.size.xl), ";;label:isTopItem;"),
28
+ isSubItem: /*#__PURE__*/css(logicalCSS('border-left', euiTheme.border.thin), " ", logicalCSS('margin-left', euiTheme.size.s), " ", logicalCSS('padding-left', mathWithUnits([euiTheme.size.s, euiTheme.border.width.thin], function (x, y) {
29
+ return x - y;
30
+ })), ";;label:isSubItem;")
31
+ }
32
+ };
33
+ };
@@ -0,0 +1,117 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["isSubItem", "title", "titleElement", "icon", "iconProps", "className", "items", "children"],
4
+ _excluded2 = ["isGroupTitle", "className"];
5
+ /*
6
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
7
+ * or more contributor license agreements. Licensed under the Elastic License
8
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
9
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
10
+ * Side Public License, v 1.
11
+ */
12
+
13
+ import React from 'react';
14
+ import classNames from 'classnames';
15
+ import { useEuiTheme } from '../../../services';
16
+ import { EuiIcon } from '../../icon';
17
+ import { EuiTitle } from '../../title';
18
+ import { EuiCollapsibleNavAccordion } from './collapsible_nav_accordion';
19
+ import { EuiCollapsibleNavLink } from './collapsible_nav_link';
20
+ import { euiCollapsibleNavItemTitleStyles, euiCollapsibleNavSubItemGroupTitleStyles } from './collapsible_nav_item.styles';
21
+ import { jsx as ___EmotionJSX } from "@emotion/react";
22
+ /**
23
+ * Internal DRY subcomponent shared between top level items and sub items
24
+ * that handles title display/rendering, and can be used to recursively
25
+ * determine whether to render an accordion or a link
26
+ */
27
+ var EuiCollapsibleNavItemDisplay = function EuiCollapsibleNavItemDisplay(_ref) {
28
+ var _props$linkProps;
29
+ var isSubItem = _ref.isSubItem,
30
+ title = _ref.title,
31
+ titleElement = _ref.titleElement,
32
+ icon = _ref.icon,
33
+ iconProps = _ref.iconProps,
34
+ className = _ref.className,
35
+ items = _ref.items,
36
+ children = _ref.children,
37
+ props = _objectWithoutProperties(_ref, _excluded);
38
+ var classes = classNames('euiCollapsibleNavItem', {
39
+ euiCollapsibleNavSubItem: isSubItem
40
+ }, className);
41
+ var headerContent = ___EmotionJSX(EuiCollapsibleNavItemTitle, {
42
+ title: title,
43
+ titleElement: titleElement,
44
+ icon: icon,
45
+ iconProps: iconProps
46
+ });
47
+ var isAccordion = items && items.length > 0;
48
+ if (isAccordion) {
49
+ return ___EmotionJSX(EuiCollapsibleNavAccordion, _extends({
50
+ className: classes,
51
+ buttonContent: headerContent,
52
+ items: items
53
+ }, props, {
54
+ isSubItem: isSubItem
55
+ }));
56
+ }
57
+ return ___EmotionJSX(EuiCollapsibleNavLink, _extends({
58
+ className: classes
59
+ }, props, {
60
+ // EuiLink ExclusiveUnion type shenanigans
61
+ isSubItem: isSubItem,
62
+ isNotAccordion: true,
63
+ isInteractive: !!(props.href || props.onClick || (_props$linkProps = props.linkProps) !== null && _props$linkProps !== void 0 && _props$linkProps.onClick)
64
+ }), headerContent);
65
+ };
66
+
67
+ /**
68
+ * Internal subcomponent for title display
69
+ */
70
+ var EuiCollapsibleNavItemTitle = function EuiCollapsibleNavItemTitle(_ref2) {
71
+ var title = _ref2.title,
72
+ _ref2$titleElement = _ref2.titleElement,
73
+ titleElement = _ref2$titleElement === void 0 ? 'span' : _ref2$titleElement,
74
+ icon = _ref2.icon,
75
+ iconProps = _ref2.iconProps;
76
+ var styles = euiCollapsibleNavItemTitleStyles;
77
+ var TitleElement = titleElement;
78
+ return ___EmotionJSX(React.Fragment, null, icon && ___EmotionJSX(EuiIcon, _extends({
79
+ type: icon
80
+ }, iconProps)), ___EmotionJSX(TitleElement, {
81
+ className: "euiCollapsibleNavItem__title eui-textTruncate",
82
+ css: styles.euiCollapsibleNavItem__title
83
+ }, title));
84
+ };
85
+
86
+ /**
87
+ * Sub-items can either be a group title, to visually separate sections
88
+ * of nav links, or they can simply be more links or accordions
89
+ */
90
+ export var EuiCollapsibleNavSubItem = function EuiCollapsibleNavSubItem(_ref3) {
91
+ var isGroupTitle = _ref3.isGroupTitle,
92
+ className = _ref3.className,
93
+ props = _objectWithoutProperties(_ref3, _excluded2);
94
+ var euiTheme = useEuiTheme();
95
+ var styles = euiCollapsibleNavSubItemGroupTitleStyles(euiTheme);
96
+ if (isGroupTitle) {
97
+ var TitleElement = props.titleElement || 'div';
98
+ return ___EmotionJSX(EuiTitle, {
99
+ size: "xxxs",
100
+ css: styles.euiCollapsibleNavItem__groupTitle,
101
+ className: "euiCollapsibleNavItem__groupTitle eui-textTruncate"
102
+ }, ___EmotionJSX(TitleElement, null, props.title));
103
+ }
104
+ return ___EmotionJSX(EuiCollapsibleNavItemDisplay, _extends({}, props, {
105
+ isSubItem: true
106
+ }));
107
+ };
108
+
109
+ /**
110
+ * The actual exported component
111
+ */
112
+
113
+ export var EuiCollapsibleNavItem = function EuiCollapsibleNavItem(props) {
114
+ return ___EmotionJSX(EuiCollapsibleNavItemDisplay, _extends({}, props, {
115
+ isSubItem: false
116
+ }));
117
+ };
@@ -0,0 +1,55 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
5
+ /*
6
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
7
+ * or more contributor license agreements. Licensed under the Elastic License
8
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
9
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
10
+ * Side Public License, v 1.
11
+ */
12
+
13
+ import { css } from '@emotion/react';
14
+ import { logicalCSS, logicalShorthandCSS, euiFontSize } from '../../../global_styling';
15
+ import { euiButtonColor } from '../../../themes/amsterdam/global_styling/mixins/button';
16
+
17
+ /**
18
+ * Style variables shared between accordion, link, and sub items
19
+ */
20
+ export var euiCollapsibleNavItemVariables = function euiCollapsibleNavItemVariables(euiThemeContext) {
21
+ var euiTheme = euiThemeContext.euiTheme;
22
+ return _objectSpread(_objectSpread({
23
+ height: euiTheme.size.xl,
24
+ padding: euiTheme.size.s
25
+ }, euiFontSize(euiThemeContext, 's')), {}, {
26
+ animation: "".concat(euiTheme.animation.normal, " ease-in-out"),
27
+ // Matches EuiButton
28
+ borderRadius: euiTheme.border.radius.small,
29
+ backgroundHoverColor: euiTheme.colors.lightestShade,
30
+ backgroundSelectedColor: euiButtonColor(euiThemeContext, 'text').backgroundColor,
31
+ color: euiTheme.colors.text,
32
+ rightIconColor: euiTheme.colors.disabledText
33
+ });
34
+ };
35
+
36
+ /**
37
+ * Title styles
38
+ */
39
+
40
+ export var euiCollapsibleNavItemTitleStyles = {
41
+ euiCollapsibleNavItem__title: process.env.NODE_ENV === "production" ? {
42
+ name: "i246l1-euiCollapsibleNavItem__title",
43
+ styles: "flex-grow:1;label:euiCollapsibleNavItem__title;"
44
+ } : {
45
+ name: "i246l1-euiCollapsibleNavItem__title",
46
+ styles: "flex-grow:1;label:euiCollapsibleNavItem__title;",
47
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
48
+ }
49
+ };
50
+ export var euiCollapsibleNavSubItemGroupTitleStyles = function euiCollapsibleNavSubItemGroupTitleStyles(_ref) {
51
+ var euiTheme = _ref.euiTheme;
52
+ return {
53
+ euiCollapsibleNavItem__groupTitle: /*#__PURE__*/css(logicalCSS('margin-top', euiTheme.size.base), " ", logicalShorthandCSS('padding', "".concat(euiTheme.size.xs, " ").concat(euiTheme.size.s)), ";;label:euiCollapsibleNavItem__groupTitle;")
54
+ };
55
+ };
@@ -0,0 +1,59 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
+ var _excluded = ["href", "rel", "children", "className", "isSelected", "isInteractive", "isNotAccordion", "isSubItem", "linkProps"];
5
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
+ /*
8
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
9
+ * or more contributor license agreements. Licensed under the Elastic License
10
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
11
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
12
+ * Side Public License, v 1.
13
+ */
14
+
15
+ import React from 'react';
16
+ import classNames from 'classnames';
17
+ import { useEuiTheme } from '../../../services';
18
+ import { EuiLink } from '../../link';
19
+ import { euiCollapsibleNavLinkStyles } from './collapsible_nav_link.styles';
20
+ import { jsx as ___EmotionJSX } from "@emotion/react";
21
+ /**
22
+ * Internal nav link component.
23
+ *
24
+ * Can be rendered as a standalone nav item, or as part of an accordion header.
25
+ * Can also be rendered as top-level item (has a background hover) or as a
26
+ * sub-item (renders closer to plain text).
27
+ *
28
+ * In terms of DOM output, follows the same logic as EuiLink (renders either
29
+ * an `a` tag or a `button` if no valid link exists), and can also additionally
30
+ * rendered a plain `span` if the item is not interactive.
31
+ */
32
+ export var EuiCollapsibleNavLink = function EuiCollapsibleNavLink(_ref) {
33
+ var href = _ref.href,
34
+ rel = _ref.rel,
35
+ children = _ref.children,
36
+ className = _ref.className,
37
+ isSelected = _ref.isSelected,
38
+ _ref$isInteractive = _ref.isInteractive,
39
+ isInteractive = _ref$isInteractive === void 0 ? true : _ref$isInteractive,
40
+ isNotAccordion = _ref.isNotAccordion,
41
+ isSubItem = _ref.isSubItem,
42
+ linkProps = _ref.linkProps,
43
+ rest = _objectWithoutProperties(_ref, _excluded);
44
+ var classes = classNames('euiCollapsibleNavLink', className);
45
+ var euiTheme = useEuiTheme();
46
+ var styles = euiCollapsibleNavLinkStyles(euiTheme);
47
+ var cssStyles = [styles.euiCollapsibleNavLink, isSelected && styles.isSelected, isSubItem ? styles.isSubItem : styles.isTopItem.isTopItem, isNotAccordion && !isSubItem && styles.isTopItem.isNotAccordion, isInteractive && !isSelected && !isSubItem && styles.isTopItem.isInteractive, linkProps === null || linkProps === void 0 ? void 0 : linkProps.css];
48
+ return isInteractive ? ___EmotionJSX(EuiLink, _extends({
49
+ href: href,
50
+ rel: rel,
51
+ className: classes
52
+ }, _objectSpread(_objectSpread({}, rest), linkProps), {
53
+ // EuiLink ExclusiveUnion shenanigans
54
+ css: cssStyles
55
+ }), children) : ___EmotionJSX("span", _extends({
56
+ className: classes,
57
+ css: cssStyles
58
+ }, rest), children);
59
+ };
@@ -0,0 +1,28 @@
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
+
9
+ import { css } from '@emotion/react';
10
+ import { euiCanAnimate, logicalCSS, mathWithUnits } from '../../../global_styling';
11
+ import { euiCollapsibleNavItemVariables } from './collapsible_nav_item.styles';
12
+ export var euiCollapsibleNavLinkStyles = function euiCollapsibleNavLinkStyles(euiThemeContext) {
13
+ var euiTheme = euiThemeContext.euiTheme;
14
+ var sharedStyles = euiCollapsibleNavItemVariables(euiThemeContext);
15
+ return {
16
+ // Shared between all links
17
+ euiCollapsibleNavLink: /*#__PURE__*/css("display:flex;align-items:center;", logicalCSS('height', sharedStyles.height), " padding:", sharedStyles.padding, ";font-size:", sharedStyles.fontSize, ";line-height:", sharedStyles.lineHeight, ";color:", sharedStyles.color, ";border-radius:", sharedStyles.borderRadius, ";&:focus{outline-offset:-", euiTheme.focus.width, ";text-decoration-thickness:unset;}[class*='euiLink__externalIcon']{", logicalCSS('margin-right', euiTheme.size.xxs), " color:", sharedStyles.rightIconColor, ";};label:euiCollapsibleNavLink;"),
18
+ isSelected: /*#__PURE__*/css("background-color:", sharedStyles.backgroundSelectedColor, ";;label:isSelected;"),
19
+ isTopItem: {
20
+ isTopItem: /*#__PURE__*/css("font-weight:", euiTheme.font.weight.semiBold, ";gap:", euiTheme.size.base, ";&:is(button){inline-size:calc(\n 100% - ", mathWithUnits(sharedStyles.padding, function (x) {
21
+ return x * 2;
22
+ }), "\n );};label:isTopItem;"),
23
+ isNotAccordion: /*#__PURE__*/css("margin:", sharedStyles.padding, ";;label:isNotAccordion;"),
24
+ isInteractive: /*#__PURE__*/css(euiCanAnimate, "{transition:background-color ", sharedStyles.animation, ";}&:hover,&:focus-visible{background-color:", sharedStyles.backgroundHoverColor, ";};label:isInteractive;")
25
+ },
26
+ isSubItem: /*#__PURE__*/css("font-weight:", euiTheme.font.weight.regular, ";gap:", euiTheme.size.s, ";;label:isSubItem;")
27
+ };
28
+ };
@@ -0,0 +1,9 @@
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
+
9
+ export { EuiCollapsibleNavItem } from './collapsible_nav_item';
@@ -0,0 +1,15 @@
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
+
9
+ /**
10
+ * NOTE: This is currently still a beta component, being exported for Kibana
11
+ * development usage. It is not yet fully documented or supported.
12
+ */
13
+
14
+ export { EuiCollapsibleNavBeta } from './collapsible_nav_beta';
15
+ export { EuiCollapsibleNavItem } from './collapsible_nav_item';
@@ -20,10 +20,11 @@ import { isNil } from '../../services/predicate';
20
20
  import { useEuiI18n } from '../i18n';
21
21
  import { getEventPosition } from './utils';
22
22
  import { jsx as ___EmotionJSX } from "@emotion/react";
23
+ var colorDefaultValue = [1, 0, 0];
23
24
  export var EuiSaturation = /*#__PURE__*/forwardRef(function (_ref, ref) {
24
25
  var className = _ref.className,
25
26
  _ref$color = _ref.color,
26
- color = _ref$color === void 0 ? [1, 0, 0] : _ref$color,
27
+ color = _ref$color === void 0 ? colorDefaultValue : _ref$color,
27
28
  _ref$dataTestSubj = _ref['data-test-subj'],
28
29
  dataTestSubj = _ref$dataTestSubj === void 0 ? 'euiSaturation' : _ref$dataTestSubj,
29
30
  hex = _ref.hex,
@@ -8,7 +8,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
8
8
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
9
9
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
10
10
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
11
- var _excluded = ["key", "label", "color", "onClick"];
11
+ var _excluded = ["key", "label", "color", "onClick", "append", "prepend"];
12
12
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
13
13
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
14
14
  /*
@@ -146,6 +146,8 @@ export var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
146
146
  label = option.label,
147
147
  color = option.color,
148
148
  onClick = option.onClick,
149
+ append = option.append,
150
+ prepend = option.prepend,
149
151
  rest = _objectWithoutProperties(option, _excluded);
150
152
  var pillOnClose = isDisabled || singleSelection || onClick ? undefined : onRemoveOption;
151
153
  return ___EmotionJSX(EuiComboBoxPill, _extends({
@@ -64,6 +64,11 @@ export var EuiComboBoxPill = /*#__PURE__*/function (_Component) {
64
64
  onClick: onClick,
65
65
  onClickAriaLabel: onClickAriaLabel
66
66
  } : {};
67
+ var content = ___EmotionJSX(React.Fragment, null, option.prepend && ___EmotionJSX("span", {
68
+ className: "euiComboBoxPill__prepend"
69
+ }, option.prepend), children, option.append && ___EmotionJSX("span", {
70
+ className: "euiComboBoxPill__append"
71
+ }, option.append));
67
72
  if (onClose) {
68
73
  return ___EmotionJSX(EuiI18n, {
69
74
  token: "euiComboBoxPill.removeSelection",
@@ -75,24 +80,27 @@ export var EuiComboBoxPill = /*#__PURE__*/function (_Component) {
75
80
  return ___EmotionJSX(EuiBadge, _extends({
76
81
  className: classes,
77
82
  color: color,
83
+ "data-test-subj": "euiComboBoxPill",
78
84
  iconOnClick: _this2.onCloseButtonClick,
79
85
  iconOnClickAriaLabel: removeSelection,
80
86
  iconSide: "right",
81
87
  iconType: "cross",
82
88
  title: children
83
- }, onClickProps, rest), children);
89
+ }, onClickProps, rest), content);
84
90
  });
85
91
  }
86
92
  if (asPlainText) {
87
93
  return ___EmotionJSX("span", _extends({
88
- className: classes
89
- }, rest), children);
94
+ className: classes,
95
+ "data-test-subj": "euiComboBoxPill"
96
+ }, rest), content);
90
97
  }
91
98
  return ___EmotionJSX(EuiBadge, _extends({
92
99
  className: classes,
93
100
  color: color,
101
+ "data-test-subj": "euiComboBoxPill",
94
102
  title: children
95
- }, rest, onClickProps), children);
103
+ }, rest, onClickProps), content);
96
104
  }
97
105
  }]);
98
106
  return EuiComboBoxPill;
@@ -7,7 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
7
7
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
8
8
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
9
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
- var _excluded = ["key", "isGroupLabelOption", "label", "value"],
10
+ var _excluded = ["key", "isGroupLabelOption", "label", "value", "prepend", "append"],
11
11
  _excluded2 = ["data-test-subj", "activeOptionIndex", "areAllOptionsSelected", "customOptionText", "fullWidth", "getSelectedOptionForSearchValue", "isCaseSensitive", "isLoading", "listRef", "matchingOptions", "onCloseList", "onCreateOption", "onOptionClick", "onOptionEnterKey", "onScroll", "optionRef", "options", "position", "renderOption", "rootId", "rowHeight", "scrollToIndex", "searchValue", "selectedOptions", "singleSelection", "updatePosition", "width", "delimiter", "zIndex", "style", "listboxAriaLabel"];
12
12
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
13
13
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -93,6 +93,8 @@ export var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
93
93
  isGroupLabelOption = option.isGroupLabelOption,
94
94
  label = option.label,
95
95
  value = option.value,
96
+ prepend = option.prepend,
97
+ append = option.append,
96
98
  rest = _objectWithoutProperties(option, _excluded);
97
99
  var _this$props = _this.props,
98
100
  singleSelection = _this$props.singleSelection,
@@ -131,13 +133,17 @@ export var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
131
133
  title: label
132
134
  }, rest), ___EmotionJSX("span", {
133
135
  className: "euiComboBoxOption__contentWrapper"
134
- }, renderOption ? ___EmotionJSX("span", {
136
+ }, prepend && ___EmotionJSX("span", {
137
+ className: "euiComboBoxOption__prepend"
138
+ }, prepend), renderOption ? ___EmotionJSX("span", {
135
139
  className: OPTION_CONTENT_CLASSNAME
136
140
  }, renderOption(option, searchValue, 'euiComboBoxOption__renderOption')) : ___EmotionJSX(EuiHighlight, {
137
141
  search: searchValue,
138
142
  strict: _this.props.isCaseSensitive,
139
143
  className: OPTION_CONTENT_CLASSNAME
140
- }, label), optionIsFocused && !optionIsDisabled ? hitEnterBadge : null));
144
+ }, label), append && ___EmotionJSX("span", {
145
+ className: "euiComboBoxOption__append"
146
+ }, append), optionIsFocused && !optionIsDisabled ? hitEnterBadge : null));
141
147
  });
142
148
  return _this;
143
149
  }
@@ -49,7 +49,7 @@ export var EuiErrorBoundary = /*#__PURE__*/function (_Component) {
49
49
  var message = error.message,
50
50
  stack = error.stack;
51
51
  var idx = (stack === null || stack === void 0 ? void 0 : stack.indexOf(message)) || -1;
52
- var stackStr = idx > -1 ? stack === null || stack === void 0 ? void 0 : stack.substr(idx + message.length + 1) : stack;
52
+ var stackStr = idx > -1 ? stack === null || stack === void 0 ? void 0 : stack.substring(idx + message.length + 1) : stack;
53
53
  var errorMessage = "Error: ".concat(message, "\n").concat(stackStr);
54
54
  this.setState({
55
55
  hasError: true,
@@ -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 { logicalCSS, mathWithUnits, euiMaxBreakpoint } from '../../global_styling';
11
+ import { logicalCSS, mathWithUnits, euiBreakpoint } from '../../global_styling';
12
12
  import { euiFormVariables } from '../form/form.styles';
13
13
  import { euiFilterButtonDisplay } from './filter_button.styles';
14
14
  var _ref = process.env.NODE_ENV === "production" ? {
@@ -28,7 +28,7 @@ export var euiFilterGroupStyles = function euiFilterGroupStyles(euiThemeContext)
28
28
  controlCompressedBorderRadius = _euiFormVariables.controlCompressedBorderRadius,
29
29
  controlCompressedHeight = _euiFormVariables.controlCompressedHeight;
30
30
  return {
31
- euiFilterGroup: /*#__PURE__*/css("display:inline-flex;", logicalCSS('max-width', '100%'), " overflow:hidden;background-color:", backgroundColor, ";box-shadow:inset 0 0 0 ", euiTheme.border.width.thin, " ", borderColor, ";>*:not(.euiFilterButton){", euiFilterButtonDisplay(euiThemeContext), ";}.euiPopover__anchor{display:block;.euiFilterButton{", logicalCSS('width', '100%'), ";}}", euiMaxBreakpoint(euiThemeContext, 's'), "{flex-wrap:wrap;}", euiMaxBreakpoint(euiThemeContext, 'xs'), "{display:flex;.euiFilterButton{flex-grow:1;}};label:euiFilterGroup;"),
31
+ euiFilterGroup: /*#__PURE__*/css("display:inline-flex;", logicalCSS('max-width', '100%'), " overflow:hidden;background-color:", backgroundColor, ";box-shadow:inset 0 0 0 ", euiTheme.border.width.thin, " ", borderColor, ";>*:not(.euiFilterButton){", euiFilterButtonDisplay(euiThemeContext), ";}.euiPopover__anchor{display:block;.euiFilterButton{", logicalCSS('width', '100%'), ";}}", euiBreakpoint(euiThemeContext, ['xs', 's']), "{flex-wrap:wrap;}", euiBreakpoint(euiThemeContext, ['xs']), "{display:flex;.euiFilterButton{flex-grow:1;}};label:euiFilterGroup;"),
32
32
  fullWidth: _ref,
33
33
  uncompressed: /*#__PURE__*/css("border-radius:", controlBorderRadius, ";", buttonChildrenBorderRadii(controlBorderRadius), ";;label:uncompressed;"),
34
34
  compressed: /*#__PURE__*/css("border-radius:", controlCompressedBorderRadius, ";", buttonChildrenBorderRadii(controlCompressedBorderRadius), " .euiFilterButton{", logicalCSS('height', controlCompressedHeight), ";};label:compressed;"),
@@ -7,7 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
7
7
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
8
8
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
9
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
- var _excluded = ["children", "className", "disabled", "checked", "isFocused", "showIcons"];
10
+ var _excluded = ["theme", "children", "className", "disabled", "checked", "isFocused", "showIcons"];
11
11
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
12
12
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
13
13
  /*
@@ -20,8 +20,10 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
20
20
 
21
21
  import React, { Component } from 'react';
22
22
  import classNames from 'classnames';
23
+ import { withEuiTheme } from '../../services';
23
24
  import { EuiFlexGroup, EuiFlexItem } from '../flex';
24
25
  import { EuiIcon } from '../icon';
26
+ import { euiFilterSelectItemStyles } from './filter_select_item.styles';
25
27
  import { jsx as ___EmotionJSX } from "@emotion/react";
26
28
  var resolveIconAndColor = function resolveIconAndColor(checked) {
27
29
  if (!checked) {
@@ -37,12 +39,19 @@ var resolveIconAndColor = function resolveIconAndColor(checked) {
37
39
  color: 'text'
38
40
  };
39
41
  };
40
- export var EuiFilterSelectItem = /*#__PURE__*/function (_Component) {
41
- _inherits(EuiFilterSelectItem, _Component);
42
- var _super = _createSuper(EuiFilterSelectItem);
43
- function EuiFilterSelectItem() {
42
+
43
+ /**
44
+ * TODO: This component should removed in favor of EuiSelectable usage
45
+ * once EuiComboBox has been converted to dogfood EuiSelectable.
46
+ *
47
+ * @deprecated - Use EuiSelectable instead
48
+ */
49
+ export var EuiFilterSelectItemClass = /*#__PURE__*/function (_Component) {
50
+ _inherits(EuiFilterSelectItemClass, _Component);
51
+ var _super = _createSuper(EuiFilterSelectItemClass);
52
+ function EuiFilterSelectItemClass() {
44
53
  var _this;
45
- _classCallCheck(this, EuiFilterSelectItem);
54
+ _classCallCheck(this, EuiFilterSelectItemClass);
46
55
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
47
56
  args[_key] = arguments[_key];
48
57
  }
@@ -61,11 +70,12 @@ export var EuiFilterSelectItem = /*#__PURE__*/function (_Component) {
61
70
  });
62
71
  return _this;
63
72
  }
64
- _createClass(EuiFilterSelectItem, [{
73
+ _createClass(EuiFilterSelectItemClass, [{
65
74
  key: "render",
66
75
  value: function render() {
67
76
  var _this2 = this;
68
77
  var _this$props = this.props,
78
+ theme = _this$props.theme,
69
79
  children = _this$props.children,
70
80
  className = _this$props.className,
71
81
  disabled = _this$props.disabled,
@@ -73,9 +83,9 @@ export var EuiFilterSelectItem = /*#__PURE__*/function (_Component) {
73
83
  isFocused = _this$props.isFocused,
74
84
  showIcons = _this$props.showIcons,
75
85
  rest = _objectWithoutProperties(_this$props, _excluded);
76
- var classes = classNames('euiFilterSelectItem', {
77
- 'euiFilterSelectItem-isFocused': isFocused
78
- }, className);
86
+ var styles = euiFilterSelectItemStyles(theme);
87
+ var cssStyles = [styles.euiFilterSelectItem, isFocused && styles.isFocused];
88
+ var classes = classNames('euiFilterSelectItem', className);
79
89
  var iconNode;
80
90
  if (showIcons) {
81
91
  var _resolveIconAndColor = resolveIconAndColor(checked),
@@ -96,6 +106,7 @@ export var EuiFilterSelectItem = /*#__PURE__*/function (_Component) {
96
106
  type: "button",
97
107
  "aria-selected": isFocused,
98
108
  className: classes,
109
+ css: cssStyles,
99
110
  disabled: disabled,
100
111
  "aria-disabled": disabled
101
112
  }, rest), ___EmotionJSX(EuiFlexGroup, {
@@ -104,13 +115,18 @@ export var EuiFilterSelectItem = /*#__PURE__*/function (_Component) {
104
115
  component: "span",
105
116
  responsive: false
106
117
  }, iconNode, ___EmotionJSX(EuiFlexItem, {
107
- className: "euiFilterSelectItem__content",
118
+ className: "euiFilterSelectItem__content eui-textTruncate",
108
119
  component: "span"
109
120
  }, children)));
110
121
  }
111
122
  }]);
112
- return EuiFilterSelectItem;
123
+ return EuiFilterSelectItemClass;
113
124
  }(Component);
114
- _defineProperty(EuiFilterSelectItem, "defaultProps", {
125
+
126
+ /**
127
+ * @deprecated - Use EuiSelectable instead
128
+ */
129
+ _defineProperty(EuiFilterSelectItemClass, "defaultProps", {
115
130
  showIcons: true
116
- });
131
+ });
132
+ export var EuiFilterSelectItem = withEuiTheme(EuiFilterSelectItemClass);
@@ -0,0 +1,19 @@
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
+
9
+ import { css } from '@emotion/react';
10
+ import { transparentize } from '../../services';
11
+ import { logicalCSS, logicalShorthandCSS, logicalTextAlignCSS, euiFontSize } from '../../global_styling';
12
+ export var euiFilterSelectItemStyles = function euiFilterSelectItemStyles(euiThemeContext) {
13
+ var euiTheme = euiThemeContext.euiTheme;
14
+ var focusStyles = "\n color: ".concat(euiTheme.colors.primary, ";\n background-color: ").concat(euiTheme.focus.backgroundColor, ";\n outline-offset: -").concat(euiTheme.focus.width, ";\n text-decoration: underline;\n\n &:disabled {\n background-color: ").concat(transparentize(euiTheme.colors.disabled, 0.1), ";\n }\n ");
15
+ return {
16
+ euiFilterSelectItem: /*#__PURE__*/css("display:block;", logicalCSS('width', '100%'), " ", logicalShorthandCSS('padding', "".concat(euiTheme.size.xs, " ").concat(euiTheme.size.m)), " ", euiFontSize(euiThemeContext, 's'), " ", logicalTextAlignCSS('left'), " color:", euiTheme.colors.text, ";", logicalCSS('border-bottom', "".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.colors.lightestShade)), " &:hover{cursor:pointer;text-decoration:underline;}&:focus{", focusStyles, ";}&:disabled{cursor:not-allowed;text-decoration:none;color:", euiTheme.colors.disabledText, ";};label:euiFilterSelectItem;"),
17
+ isFocused: /*#__PURE__*/css(focusStyles, ";;label:isFocused;")
18
+ };
19
+ };
@@ -65,6 +65,7 @@ export var EuiRangeHighlight = function EuiRangeHighlight(_ref) {
65
65
  css: cssStyles,
66
66
  onClick: onClick
67
67
  }, (levels && levels.length === 0 || !levels) && ___EmotionJSX("div", {
68
+ "data-test-subj": "euiRangeHighlightProgress",
68
69
  className: "euiRangeHighlight__progress",
69
70
  css: cssProgressStyles,
70
71
  style: progressStyle
@@ -25,7 +25,7 @@ var highlight = function highlight(searchSubject, searchValue, isStrict, highlig
25
25
  var end = chunk.end,
26
26
  highlight = chunk.highlight,
27
27
  start = chunk.start;
28
- var value = searchSubject.substr(start, end - start);
28
+ var value = searchSubject.substring(start, end);
29
29
  if (highlight) {
30
30
  return ___EmotionJSX(EuiMark, {
31
31
  key: start,
@@ -41,9 +41,9 @@ var highlight = function highlight(searchSubject, searchValue, isStrict, highlig
41
41
  if (indexOfMatch === -1) {
42
42
  return searchSubject;
43
43
  }
44
- var preMatch = searchSubject.substr(0, indexOfMatch);
45
- var match = searchSubject.substr(indexOfMatch, searchValue.length);
46
- var postMatch = searchSubject.substr(indexOfMatch + searchValue.length);
44
+ var preMatch = searchSubject.substring(0, indexOfMatch);
45
+ var match = searchSubject.substring(indexOfMatch, indexOfMatch + searchValue.length);
46
+ var postMatch = searchSubject.substring(indexOfMatch + searchValue.length);
47
47
  return ___EmotionJSX(Fragment, null, preMatch, ___EmotionJSX(EuiMark, {
48
48
  hasScreenReaderHelpText: hasScreenReaderHelpText
49
49
  }, match), postMatch);