@elastic/eui 65.0.2 → 66.0.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 (158) hide show
  1. package/dist/eui_theme_dark.css +24 -196
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +24 -196
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/basic_table/basic_table.js +13 -2
  6. package/es/components/basic_table/in_memory_table.js +13 -2
  7. package/es/components/card/card.styles.js +2 -2
  8. package/es/components/combo_box/combo_box.js +2 -15
  9. package/es/components/datagrid/body/data_grid_body.js +17 -6
  10. package/es/components/datagrid/body/data_grid_cell.js +29 -12
  11. package/es/components/datagrid/body/header/data_grid_header_cell.js +17 -6
  12. package/es/components/datagrid/body/header/data_grid_header_row.js +17 -6
  13. package/es/components/datagrid/data_grid.js +17 -6
  14. package/es/components/datagrid/utils/in_memory.js +17 -6
  15. package/es/components/description_list/description_list.js +11 -3
  16. package/es/components/description_list/description_list_context.js +2 -1
  17. package/es/components/description_list/description_list_description.js +3 -1
  18. package/es/components/description_list/description_list_description.styles.js +5 -2
  19. package/es/components/description_list/description_list_title.js +3 -2
  20. package/es/components/description_list/description_list_title.styles.js +7 -3
  21. package/es/components/description_list/description_list_types.js +2 -1
  22. package/es/components/form/field_search/field_search.js +6 -16
  23. package/es/components/form/range/range_input.js +1 -1
  24. package/es/components/header/header_section/header_section_item.js +4 -3
  25. package/es/components/icon/icon.js +1 -9
  26. package/es/components/list_group/list_group.js +7 -1
  27. package/es/components/list_group/list_group_item.js +10 -3
  28. package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +13 -1
  29. package/es/components/modal/modal.js +1 -3
  30. package/es/components/observer/mutation_observer/mutation_observer.js +1 -1
  31. package/es/components/page/page_sidebar/page_sidebar.js +5 -1
  32. package/es/components/table/table_row_cell.js +4 -6
  33. package/es/components/tabs/tabbed_content/tabbed_content.js +2 -19
  34. package/es/global_styling/mixins/_typography.js +1 -1
  35. package/es/services/theme/hooks.js +11 -16
  36. package/eui.d.ts +29 -10
  37. package/i18ntokens.json +18 -18
  38. package/lib/components/basic_table/basic_table.js +13 -2
  39. package/lib/components/basic_table/in_memory_table.js +13 -2
  40. package/lib/components/card/card.styles.js +2 -2
  41. package/lib/components/combo_box/combo_box.js +2 -15
  42. package/lib/components/datagrid/body/data_grid_body.js +17 -6
  43. package/lib/components/datagrid/body/data_grid_cell.js +29 -12
  44. package/lib/components/datagrid/body/header/data_grid_header_cell.js +17 -6
  45. package/lib/components/datagrid/body/header/data_grid_header_row.js +17 -6
  46. package/lib/components/datagrid/data_grid.js +17 -6
  47. package/lib/components/datagrid/utils/in_memory.js +17 -6
  48. package/lib/components/description_list/description_list.js +11 -3
  49. package/lib/components/description_list/description_list_context.js +2 -1
  50. package/lib/components/description_list/description_list_description.js +3 -1
  51. package/lib/components/description_list/description_list_description.styles.js +5 -2
  52. package/lib/components/description_list/description_list_title.js +3 -2
  53. package/lib/components/description_list/description_list_title.styles.js +7 -3
  54. package/lib/components/description_list/description_list_types.js +4 -2
  55. package/lib/components/form/field_search/field_search.js +6 -16
  56. package/lib/components/form/range/range_input.js +1 -1
  57. package/lib/components/header/header_section/header_section_item.js +4 -3
  58. package/lib/components/icon/icon.js +1 -9
  59. package/lib/components/list_group/list_group.js +7 -1
  60. package/lib/components/list_group/list_group_item.js +10 -3
  61. package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +13 -1
  62. package/lib/components/modal/modal.js +1 -3
  63. package/lib/components/observer/mutation_observer/mutation_observer.js +1 -1
  64. package/lib/components/page/page_sidebar/page_sidebar.js +5 -1
  65. package/lib/components/table/table_row_cell.js +4 -6
  66. package/lib/components/tabs/tabbed_content/tabbed_content.js +2 -19
  67. package/lib/global_styling/mixins/_typography.js +1 -1
  68. package/lib/services/theme/hooks.js +10 -15
  69. package/optimize/es/components/card/card.styles.js +2 -2
  70. package/optimize/es/components/combo_box/combo_box.js +2 -15
  71. package/optimize/es/components/description_list/description_list.js +5 -2
  72. package/optimize/es/components/description_list/description_list_context.js +2 -1
  73. package/optimize/es/components/description_list/description_list_description.js +3 -1
  74. package/optimize/es/components/description_list/description_list_description.styles.js +5 -2
  75. package/optimize/es/components/description_list/description_list_title.js +3 -2
  76. package/optimize/es/components/description_list/description_list_title.styles.js +7 -3
  77. package/optimize/es/components/description_list/description_list_types.js +2 -1
  78. package/optimize/es/components/form/field_search/field_search.js +6 -16
  79. package/optimize/es/components/form/range/range_input.js +1 -1
  80. package/optimize/es/components/header/header_section/header_section_item.js +4 -3
  81. package/optimize/es/components/icon/icon.js +1 -9
  82. package/optimize/es/components/list_group/list_group_item.js +3 -2
  83. package/optimize/es/components/modal/modal.js +1 -3
  84. package/optimize/es/components/observer/mutation_observer/mutation_observer.js +1 -1
  85. package/optimize/es/components/page/page_sidebar/page_sidebar.js +5 -1
  86. package/optimize/es/components/tabs/tabbed_content/tabbed_content.js +2 -19
  87. package/optimize/es/global_styling/mixins/_typography.js +1 -1
  88. package/optimize/es/services/theme/hooks.js +11 -16
  89. package/optimize/lib/components/card/card.styles.js +2 -2
  90. package/optimize/lib/components/combo_box/combo_box.js +2 -15
  91. package/optimize/lib/components/description_list/description_list.js +5 -2
  92. package/optimize/lib/components/description_list/description_list_context.js +2 -1
  93. package/optimize/lib/components/description_list/description_list_description.js +3 -1
  94. package/optimize/lib/components/description_list/description_list_description.styles.js +5 -2
  95. package/optimize/lib/components/description_list/description_list_title.js +3 -2
  96. package/optimize/lib/components/description_list/description_list_title.styles.js +7 -3
  97. package/optimize/lib/components/description_list/description_list_types.js +4 -2
  98. package/optimize/lib/components/form/field_search/field_search.js +6 -16
  99. package/optimize/lib/components/form/range/range_input.js +1 -1
  100. package/optimize/lib/components/header/header_section/header_section_item.js +4 -3
  101. package/optimize/lib/components/icon/icon.js +1 -9
  102. package/optimize/lib/components/list_group/list_group_item.js +3 -2
  103. package/optimize/lib/components/modal/modal.js +1 -3
  104. package/optimize/lib/components/observer/mutation_observer/mutation_observer.js +1 -1
  105. package/optimize/lib/components/page/page_sidebar/page_sidebar.js +5 -1
  106. package/optimize/lib/components/tabs/tabbed_content/tabbed_content.js +2 -19
  107. package/optimize/lib/global_styling/mixins/_typography.js +1 -1
  108. package/optimize/lib/services/theme/hooks.js +10 -15
  109. package/package.json +1 -1
  110. package/src/components/badge/_badge.scss +0 -5
  111. package/src/components/datagrid/body/header/_data_grid_header_row.scss +1 -1
  112. package/src/components/filter_group/_filter_group.scss +3 -1
  113. package/src/components/flex/_flex_group.scss +2 -11
  114. package/src/components/flex/_flex_item.scss +0 -6
  115. package/src/components/form/field_search/_field_search.scss +0 -5
  116. package/src/components/form/form_control_layout/_form_control_layout_delimited.scss +0 -3
  117. package/src/components/form/form_row/_form_row.scss +0 -1
  118. package/src/components/header/header_section/_header_section_item.scss +1 -1
  119. package/src/components/list_group/_list_group_item.scss +3 -25
  120. package/src/components/modal/_modal.scss +5 -20
  121. package/src/components/page/page_content/_page_content.scss +0 -1
  122. package/src/components/table/_responsive.scss +0 -1
  123. package/src/components/table/_table.scss +0 -5
  124. package/src/global_styling/mixins/_form.scss +0 -4
  125. package/src/global_styling/mixins/_helpers.scss +0 -8
  126. package/src/global_styling/mixins/_typography.scss +1 -5
  127. package/src/global_styling/utility/_index.scss +0 -1
  128. package/test-env/components/basic_table/basic_table.js +13 -2
  129. package/test-env/components/basic_table/in_memory_table.js +13 -2
  130. package/test-env/components/card/card.styles.js +2 -2
  131. package/test-env/components/combo_box/combo_box.js +2 -15
  132. package/test-env/components/datagrid/body/data_grid_body.js +17 -6
  133. package/test-env/components/datagrid/body/data_grid_cell.js +29 -12
  134. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +17 -6
  135. package/test-env/components/datagrid/body/header/data_grid_header_row.js +17 -6
  136. package/test-env/components/datagrid/data_grid.js +17 -6
  137. package/test-env/components/datagrid/utils/in_memory.js +17 -6
  138. package/test-env/components/description_list/description_list.js +11 -3
  139. package/test-env/components/description_list/description_list_context.js +2 -1
  140. package/test-env/components/description_list/description_list_description.js +3 -1
  141. package/test-env/components/description_list/description_list_description.styles.js +5 -2
  142. package/test-env/components/description_list/description_list_title.js +3 -2
  143. package/test-env/components/description_list/description_list_title.styles.js +7 -3
  144. package/test-env/components/description_list/description_list_types.js +4 -2
  145. package/test-env/components/form/field_search/field_search.js +6 -16
  146. package/test-env/components/form/range/range_input.js +1 -1
  147. package/test-env/components/header/header_section/header_section_item.js +4 -3
  148. package/test-env/components/list_group/list_group.js +7 -1
  149. package/test-env/components/list_group/list_group_item.js +10 -3
  150. package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +13 -1
  151. package/test-env/components/modal/modal.js +1 -3
  152. package/test-env/components/observer/mutation_observer/mutation_observer.js +1 -1
  153. package/test-env/components/page/page_sidebar/page_sidebar.js +5 -1
  154. package/test-env/components/table/table_row_cell.js +4 -6
  155. package/test-env/components/tabs/tabbed_content/tabbed_content.js +2 -19
  156. package/test-env/global_styling/mixins/_typography.js +1 -1
  157. package/test-env/services/theme/hooks.js +10 -15
  158. package/src/global_styling/utility/_utility.scss +0 -15
@@ -23,9 +23,9 @@ var _title = require("../title/title.styles");
23
23
  var euiDescriptionListTitleStyles = function euiDescriptionListTitleStyles(euiThemeContext) {
24
24
  var euiTheme = euiThemeContext.euiTheme,
25
25
  colorMode = euiThemeContext.colorMode;
26
- var columnDisplay = "\n ".concat((0, _global_styling.logicalCSS)('width', '50%'), " // Flex-basis doesn't work in IE with padding\n ").concat((0, _global_styling.logicalCSS)('padding-right', euiTheme.size.s), "\n ");
26
+ var columnDisplay = "\n ".concat((0, _global_styling.logicalCSS)('width', '50%'), "\n ").concat((0, _global_styling.logicalCSS)('padding-right', euiTheme.size.s), "\n ");
27
27
  return {
28
- euiDescriptionList__title: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextBreakWord)(), "&:not(:first-of-type){", (0, _global_styling.logicalCSS)('margin-top', euiTheme.size.base), ";};label:euiDescriptionList__title;"),
28
+ euiDescriptionList__title: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextBreakWord)(), ";;label:euiDescriptionList__title;"),
29
29
  // Types
30
30
  row: /*#__PURE__*/(0, _react.css)(";label:row;"),
31
31
  column: /*#__PURE__*/(0, _react.css)(columnDisplay, ";;label:column;"),
@@ -43,7 +43,11 @@ var euiDescriptionListTitleStyles = function euiDescriptionListTitleStyles(euiTh
43
43
  compressed: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiFontSize)(euiThemeContext, 'xs'), ";", (0, _global_styling.logicalCSS)('padding-vertical', '0'), " ", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.xs), ";;label:compressed;")
44
44
  },
45
45
  // Alignment
46
- right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('right'), ";;label:right;")
46
+ right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('right'), ";;label:right;"),
47
+ // Gutter
48
+ // Add margin only to the non-first <dt>.
49
+ s: /*#__PURE__*/(0, _react.css)("&:not(:first-of-type){", (0, _global_styling.logicalCSS)('margin-top', euiTheme.size.s), ";};label:s;"),
50
+ m: /*#__PURE__*/(0, _react.css)("&:not(:first-of-type){", (0, _global_styling.logicalCSS)('margin-top', euiTheme.size.base), ";};label:m;")
47
51
  };
48
52
  };
49
53
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.TYPES = exports.TEXT_STYLES = exports.ALIGNMENTS = void 0;
6
+ exports.TYPES = exports.TEXT_STYLES = exports.GUTTER_SIZES = exports.ALIGNMENTS = void 0;
7
7
 
8
8
  /*
9
9
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -17,4 +17,6 @@ exports.TYPES = TYPES;
17
17
  var ALIGNMENTS = ['center', 'left'];
18
18
  exports.ALIGNMENTS = ALIGNMENTS;
19
19
  var TEXT_STYLES = ['normal', 'reverse'];
20
- exports.TEXT_STYLES = TEXT_STYLES;
20
+ exports.TEXT_STYLES = TEXT_STYLES;
21
+ var GUTTER_SIZES = ['s', 'm'];
22
+ exports.GUTTER_SIZES = GUTTER_SIZES;
@@ -102,26 +102,16 @@ var EuiFieldSearch = /*#__PURE__*/function (_Component) {
102
102
 
103
103
  if (nativeInputValueSetter) {
104
104
  nativeInputValueSetter.call(_this.inputElement, '');
105
- } // dispatch input event, with IE11 support/fallback
105
+ } // dispatch input event
106
106
 
107
107
 
108
- var event;
109
-
110
- if ('Event' in window && typeof Event === 'function') {
111
- event = new Event('input', {
112
- bubbles: true,
113
- cancelable: false
114
- });
115
- } else {
116
- // IE11
117
- event = document.createEvent('Event');
118
- event.initEvent('input', true, false);
119
- }
108
+ var event = new Event('input', {
109
+ bubbles: true,
110
+ cancelable: false
111
+ });
120
112
 
121
113
  if (_this.inputElement) {
122
- if (event) {
123
- _this.inputElement.dispatchEvent(event);
124
- } // set focus on the search field
114
+ _this.inputElement.dispatchEvent(event); // set focus on the search field
125
115
 
126
116
 
127
117
  _this.inputElement.focus();
@@ -40,7 +40,7 @@ var EuiRangeInput = function EuiRangeInput(_ref) {
40
40
  autoSize = _ref$autoSize === void 0 ? true : _ref$autoSize,
41
41
  rest = _objectWithoutProperties(_ref, _excluded);
42
42
 
43
- // Chrome will properly size the input based on the max value, but FF & IE do not.
43
+ // Chrome will properly size the input based on the max value, but FF does not.
44
44
  // Calculate the width of the input based on highest number of characters.
45
45
  // Add 2 to accommodate for input stepper
46
46
  var widthStyle = autoSize ? {
@@ -36,10 +36,11 @@ var EuiHeaderSectionItem = function EuiHeaderSectionItem(_ref) {
36
36
  className = _ref.className,
37
37
  rest = _objectWithoutProperties(_ref, _excluded);
38
38
 
39
- var classes = (0, _classnames.default)('euiHeaderSectionItem', borderToClassNameMap[border], className);
40
- return (0, _react2.jsx)("div", _extends({
39
+ var classes = (0, _classnames.default)('euiHeaderSectionItem', borderToClassNameMap[border], className); // we check if there is any children and if not, we don't render anything
40
+
41
+ return children ? (0, _react2.jsx)("div", _extends({
41
42
  className: classes
42
- }, rest), children);
43
+ }, rest), children) : null;
43
44
  };
44
45
 
45
46
  exports.EuiHeaderSectionItem = EuiHeaderSectionItem;
@@ -281,14 +281,7 @@ var EuiIconClass = /*#__PURE__*/function (_PureComponent) {
281
281
 
282
282
  var styles = (0, _icon.euiIconStyles)(theme);
283
283
  var cssStyles = [styles.euiIcon, styles[size], color && (0, _named_colors.isNamedColor)(color) && styles[color], isCustomColor && styles.customColor, isElasticLogoOutline && styles.logoElasticOutline, isAppIcon && !appIconHasColor && styles.app, isLoading && styles.isLoading, !isLoading && neededLoading && styles.isLoaded];
284
- var icon = this.state.icon || _empty.icon; // This is a fix for IE and Edge, which ignores tabindex="-1" on an SVG, but respects
285
- // focusable="false".
286
- // - If there's no tabindex specified, we'll default the icon to not be focusable,
287
- // which is how SVGs behave in Chrome, Safari, and FF.
288
- // - If tabindex is -1, then the consumer wants the icon to be focusable by JavaScript only.
289
- // - If the tabindex is 0, the consumer wants the icon to be keyboard focusable.
290
-
291
- var focusable = tabIndex == null || tabIndex === -1 ? 'false' : 'true';
284
+ var icon = this.state.icon || _empty.icon;
292
285
 
293
286
  if (typeof icon === 'string') {
294
287
  return (0, _react3.jsx)("img", _extends({
@@ -320,7 +313,6 @@ var EuiIconClass = /*#__PURE__*/function (_PureComponent) {
320
313
  style: optionalCustomStyles,
321
314
  css: cssStyles,
322
315
  tabIndex: tabIndex,
323
- focusable: focusable,
324
316
  role: "img",
325
317
  title: title,
326
318
  "data-icon-type": iconTitle,
@@ -273,7 +273,13 @@ EuiListGroup.propTypes = {
273
273
  * Pass-through ref reference specifically for targeting
274
274
  * instances where the item content is rendered as a `button`
275
275
  */
276
- buttonRef: _propTypes.default.any
276
+ buttonRef: _propTypes.default.any,
277
+
278
+ /**
279
+ * Text to be displayed in the tooltip when `showToolTip` is true.
280
+ * By default the text will be same as the label text.
281
+ */
282
+ toolTipText: _propTypes.default.string
277
283
  }).isRequired),
278
284
 
279
285
  /**
@@ -27,7 +27,7 @@ var _href_validator = require("../../services/security/href_validator");
27
27
 
28
28
  var _react2 = require("@emotion/react");
29
29
 
30
- var _excluded = ["label", "isActive", "isDisabled", "href", "target", "rel", "className", "iconType", "icon", "iconProps", "extraAction", "onClick", "size", "color", "showToolTip", "wrapText", "buttonRef"],
30
+ var _excluded = ["label", "isActive", "isDisabled", "href", "target", "rel", "className", "iconType", "icon", "iconProps", "extraAction", "onClick", "size", "color", "showToolTip", "wrapText", "buttonRef", "toolTipText"],
31
31
  _excluded2 = ["iconType", "alwaysShow", "className", "isDisabled"];
32
32
 
33
33
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -95,6 +95,7 @@ var EuiListGroupItem = function EuiListGroupItem(_ref) {
95
95
  showToolTip = _ref$showToolTip === void 0 ? false : _ref$showToolTip,
96
96
  wrapText = _ref.wrapText,
97
97
  buttonRef = _ref.buttonRef,
98
+ toolTipText = _ref.toolTipText,
98
99
  rest = _objectWithoutProperties(_ref, _excluded);
99
100
 
100
101
  var isHrefValid = !href || (0, _href_validator.validateHref)(href);
@@ -196,7 +197,7 @@ var EuiListGroupItem = function EuiListGroupItem(_ref) {
196
197
  className: classes
197
198
  }, (0, _react2.jsx)(_tool_tip.EuiToolTip, {
198
199
  anchorClassName: "euiListGroupItem__tooltip",
199
- content: label,
200
+ content: toolTipText !== null && toolTipText !== void 0 ? toolTipText : label,
200
201
  position: "right",
201
202
  delay: "long"
202
203
  }, itemContent));
@@ -341,5 +342,11 @@ EuiListGroupItem.propTypes = {
341
342
  * Pass-through ref reference specifically for targeting
342
343
  * instances where the item content is rendered as a `button`
343
344
  */
344
- buttonRef: _propTypes.default.any
345
+ buttonRef: _propTypes.default.any,
346
+
347
+ /**
348
+ * Text to be displayed in the tooltip when `showToolTip` is true.
349
+ * By default the text will be same as the label text.
350
+ */
351
+ toolTipText: _propTypes.default.string
345
352
  };
@@ -263,6 +263,12 @@ EuiPinnableListGroup.propTypes = {
263
263
  */
264
264
  buttonRef: _propTypes.default.any,
265
265
 
266
+ /**
267
+ * Text to be displayed in the tooltip when `showToolTip` is true.
268
+ * By default the text will be same as the label text.
269
+ */
270
+ toolTipText: _propTypes.default.string,
271
+
266
272
  /**
267
273
  * Saves the pinned status and changes the visibility of the pin icon
268
274
  */
@@ -373,7 +379,13 @@ EuiPinnableListGroup.propTypes = {
373
379
  * Pass-through ref reference specifically for targeting
374
380
  * instances where the item content is rendered as a `button`
375
381
  */
376
- buttonRef: _propTypes.default.any
382
+ buttonRef: _propTypes.default.any,
383
+
384
+ /**
385
+ * Text to be displayed in the tooltip when `showToolTip` is true.
386
+ * By default the text will be same as the label text.
387
+ */
388
+ toolTipText: _propTypes.default.string
377
389
  }).isRequired)]),
378
390
 
379
391
  /**
@@ -88,9 +88,7 @@ var EuiModal = function EuiModal(_ref) {
88
88
  color: "text",
89
89
  "aria-label": closeModal
90
90
  });
91
- }), (0, _react2.jsx)("div", {
92
- className: "euiModal__flex"
93
- }, children))));
91
+ }), children)));
94
92
  };
95
93
 
96
94
  exports.EuiModal = EuiModal;
@@ -69,7 +69,7 @@ var EuiMutationObserver = /*#__PURE__*/function (_EuiObserver) {
69
69
  exports.EuiMutationObserver = EuiMutationObserver;
70
70
 
71
71
  var makeMutationObserver = function makeMutationObserver(node, _observerOptions, callback) {
72
- // IE11 and the MutationObserver polyfill used in Kibana (for Jest) implement
72
+ // The MutationObserver polyfill used in Kibana (for Jest) implements
73
73
  // an older spec in which specifying `attributeOldValue` or `attributeFilter`
74
74
  // without specifying `attributes` results in a `SyntaxError`.
75
75
  // The following logic patches the newer spec in which `attributes: true` can be
@@ -76,13 +76,17 @@ var EuiPageSidebar = function EuiPageSidebar(_ref) {
76
76
  setInlineStyles = _useState2[1];
77
77
 
78
78
  (0, _react.useEffect)(function () {
79
+ var updatedStyles = _objectSpread(_objectSpread({}, style), (0, _global_styling.logicalStyle)('min-width', isResponding ? '100%' : minWidth));
80
+
79
81
  if (sticky) {
80
82
  var _document$body$datase;
81
83
 
82
84
  var euiHeaderFixedCounter = Number((_document$body$datase = document.body.dataset.fixedHeaders) !== null && _document$body$datase !== void 0 ? _document$body$datase : 0);
83
85
  var offset = _typeof(sticky) === 'object' ? sticky === null || sticky === void 0 ? void 0 : sticky.offset : themeContext.euiTheme.base * 3 * euiHeaderFixedCounter;
84
- setInlineStyles(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, style), (0, _global_styling.logicalStyle)('min-width', isResponding ? '100%' : minWidth)), (0, _global_styling.logicalStyle)('top', offset)), (0, _global_styling.logicalStyle)('max-height', "calc(100vh - ".concat(offset, "px)"))));
86
+ updatedStyles = _objectSpread(_objectSpread(_objectSpread({}, updatedStyles), (0, _global_styling.logicalStyle)('top', offset)), (0, _global_styling.logicalStyle)('max-height', "calc(100vh - ".concat(offset, "px)")));
85
87
  }
88
+
89
+ setInlineStyles(updatedStyles);
86
90
  }, [style, sticky, themeContext.euiTheme.base, isResponding, minWidth]);
87
91
  return (0, _react2.jsx)("div", _extends({
88
92
  className: className,
@@ -219,9 +219,8 @@ EuiTableRowCell.propTypes = {
219
219
  showOnHover: _propTypes.default.bool,
220
220
 
221
221
  /**
222
- * Setting `textOnly` to `false` will break words unnecessarily on FF and
223
- * IE. To combat this problem on FF, wrap contents with the css utility
224
- * `.eui-textBreakWord`.
222
+ * Creates a text wrapper around cell content that helps word break or truncate
223
+ * long text correctly.
225
224
  */
226
225
  textOnly: _propTypes.default.bool,
227
226
 
@@ -242,9 +241,8 @@ EuiTableRowCell.propTypes = {
242
241
  showOnHover: _propTypes.default.bool,
243
242
 
244
243
  /**
245
- * Setting `textOnly` to `false` will break words unnecessarily on FF and
246
- * IE. To combat this problem on FF, wrap contents with the css utility
247
- * `.eui-textBreakWord`.
244
+ * Creates a text wrapper around cell content that helps word break or truncate
245
+ * long text correctly.
248
246
  */
249
247
  textOnly: _propTypes.default.bool,
250
248
 
@@ -149,24 +149,6 @@ var EuiTabbedContent = /*#__PURE__*/function (_Component) {
149
149
  }
150
150
 
151
151
  _createClass(EuiTabbedContent, [{
152
- key: "componentDidMount",
153
- value: function componentDidMount() {
154
- // IE11 doesn't support the `relatedTarget` event property for blur events
155
- // but does add it for focusout. React doesn't support `onFocusOut` so here we are.
156
- if (this.tabsRef.current) {
157
- // Current short-term solution for event listener (see https://github.com/elastic/eui/pull/2717)
158
- this.tabsRef.current.addEventListener('focusout', this.removeFocus);
159
- }
160
- }
161
- }, {
162
- key: "componentWillUnmount",
163
- value: function componentWillUnmount() {
164
- if (this.tabsRef.current) {
165
- // Current short-term solution for event listener (see https://github.com/elastic/eui/pull/2717)
166
- this.tabsRef.current.removeEventListener('focusout', this.removeFocus);
167
- }
168
- }
169
- }, {
170
152
  key: "render",
171
153
  value: function render() {
172
154
  var _this2 = this;
@@ -195,7 +177,8 @@ var EuiTabbedContent = /*#__PURE__*/function (_Component) {
195
177
  ref: this.tabsRef,
196
178
  expand: expand,
197
179
  size: size,
198
- onFocus: this.initializeFocus
180
+ onFocus: this.initializeFocus,
181
+ onBlur: this.removeFocus
199
182
  }, tabs.map(function (tab) {
200
183
  var id = tab.id,
201
184
  name = tab.name,
@@ -45,7 +45,7 @@ var useEuiFontSize = function useEuiFontSize(scale, options) {
45
45
  exports.useEuiFontSize = useEuiFontSize;
46
46
 
47
47
  var euiTextBreakWord = function euiTextBreakWord() {
48
- return "\n overflow-wrap: break-word !important; // makes sure the long string will wrap and not bust out of the container\n word-wrap: break-word !important; // spec says, they are literally just alternate names for each other but some browsers support one and not the other\n word-break: break-word; // IE doesn't understand but that's ok\n";
48
+ return "\n overflow-wrap: break-word !important; // makes sure the long string will wrap and not bust out of the container\n word-break: break-word;\n";
49
49
  };
50
50
  /**
51
51
  * Prevent text from wrapping onto multiple lines, and truncate with an ellipsis.
@@ -23,11 +23,14 @@ var useEuiTheme = function useEuiTheme() {
23
23
  var theme = (0, _react.useContext)(_context.EuiThemeContext);
24
24
  var colorMode = (0, _react.useContext)(_context.EuiColorModeContext);
25
25
  var modifications = (0, _react.useContext)(_context.EuiModificationsContext);
26
- return {
27
- euiTheme: theme,
28
- colorMode: colorMode,
29
- modifications: modifications
30
- };
26
+ var assembledTheme = (0, _react.useMemo)(function () {
27
+ return {
28
+ euiTheme: theme,
29
+ colorMode: colorMode,
30
+ modifications: modifications
31
+ };
32
+ }, [theme, colorMode, modifications]);
33
+ return assembledTheme;
31
34
  };
32
35
 
33
36
  exports.useEuiTheme = useEuiTheme;
@@ -38,17 +41,9 @@ var withEuiTheme = function withEuiTheme(Component) {
38
41
  var componentName = Component.displayName || Component.name || 'ComponentWithTheme';
39
42
 
40
43
  var Render = function Render(props, ref) {
41
- var _useEuiTheme = useEuiTheme(),
42
- euiTheme = _useEuiTheme.euiTheme,
43
- colorMode = _useEuiTheme.colorMode,
44
- modifications = _useEuiTheme.modifications;
45
-
44
+ var theme = useEuiTheme();
46
45
  return (0, _react2.jsx)(Component, _extends({
47
- theme: {
48
- euiTheme: euiTheme,
49
- colorMode: colorMode,
50
- modifications: modifications
51
- },
46
+ theme: theme,
52
47
  ref: ref
53
48
  }, props));
54
49
  };
@@ -84,14 +84,14 @@ export var euiCardStyles = function euiCardStyles(euiThemeContext, paddingSize,
84
84
  euiCard__description: /*#__PURE__*/css(logicalCSS('margin-top', halfSpacing), ";;label:euiCard__description;"),
85
85
  euiCard__footer: /*#__PURE__*/css("flex-grow:0;", logicalCSS('width', '100%'), ";", logicalCSS('margin-top', spacing), ";;label:euiCard__footer;"),
86
86
  top: {
87
- euiCard__top: /*#__PURE__*/css("flex-grow:0;font-size:0;position:relative;", logicalCSS('min-height', '1px'), ";", logicalCSS('margin-bottom', spacing), ";;label:euiCard__top;"),
87
+ euiCard__top: /*#__PURE__*/css("flex-grow:0;font-size:0;position:relative;", logicalCSS('margin-bottom', spacing), ";;label:euiCard__top;"),
88
88
  layout: {
89
89
  vertical: /*#__PURE__*/css(logicalCSS('width', '100%'), ";;label:vertical;"),
90
90
  horizontal: /*#__PURE__*/css(logicalCSS('width', 'auto'), ";;label:horizontal;")
91
91
  },
92
92
  disabled: _ref2
93
93
  },
94
- euiCard__image: /*#__PURE__*/css("position:relative;overflow:hidden;", logicalCSS('width', "calc(100% + (".concat(paddingAmount, " * 2))")), ";", logicalCSS('left', "-".concat(paddingAmount)), ";", logicalCSS('top', "-".concat(paddingAmount)), ";", logicalCSS('margin-bottom', "-".concat(paddingAmount)), ";", logicals['border-top-left-radius'], ":calc(", euiTheme.border.radius.medium, " - 1px);", logicals['border-top-right-radius'], ":calc(", euiTheme.border.radius.medium, " - 1px);", color === 'transparent' ? "border-radius: ".concat(euiTheme.border.radius.medium, ";") : undefined, " img{", logicalCSS('width', '100%'), ";};label:euiCard__image;"),
94
+ euiCard__image: /*#__PURE__*/css("position:relative;overflow:hidden;", logicalCSS('width', "calc(100% + (".concat(paddingAmount, " * 2))")), ";", logicalCSS('left', "-".concat(paddingAmount)), ";", logicalCSS('top', "-".concat(paddingAmount)), ";", logicalCSS('margin-bottom', "-".concat(paddingAmount)), ";", logicalCSS('border-top-left-radius', "calc(".concat(euiTheme.border.radius.medium, " - ").concat(euiTheme.border.width.thin, ")")), " ", logicals['border-top-right-radius'], ":calc(", euiTheme.border.radius.medium, " - ", euiTheme.border.width.thin, ");", color === 'transparent' ? "border-radius: ".concat(euiTheme.border.radius.medium, ";") : undefined, " img{", logicalCSS('width', '100%'), ";};label:euiCard__image;"),
95
95
  icon: {
96
96
  euiCard__icon: /*#__PURE__*/css(";label:euiCard__icon;"),
97
97
  withImage: /*#__PURE__*/css("position:absolute;", logicalCSS('top', '50%'), ";", logicalCSS('left', '50%'), ";transform:translate(-50%, calc(-50% + -", paddingAmount, "))!important;;label:withImage;"),
@@ -75,17 +75,9 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
75
75
  _defineProperty(_assertThisInitialized(_this), "comboBoxRefInstance", null);
76
76
 
77
77
  _defineProperty(_assertThisInitialized(_this), "comboBoxRefCallback", function (ref) {
78
- // IE11 doesn't support the `relatedTarget` event property for blur events
79
- // but does add it for focusout. React doesn't support `onFocusOut` so here we are.
80
- if (_this.comboBoxRefInstance) {
81
- _this.comboBoxRefInstance.removeEventListener('focusout', _this.onContainerBlur);
82
- }
83
-
84
78
  _this.comboBoxRefInstance = ref;
85
79
 
86
80
  if (_this.comboBoxRefInstance) {
87
- _this.comboBoxRefInstance.addEventListener('focusout', _this.onContainerBlur);
88
-
89
81
  var comboBoxBounds = _this.comboBoxRefInstance.getBoundingClientRect();
90
82
 
91
83
  _this.setState({
@@ -394,13 +386,7 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
394
386
 
395
387
  _defineProperty(_assertThisInitialized(_this), "onContainerBlur", function (event) {
396
388
  // close the options list, unless the user clicked on an option
397
-
398
- /**
399
- * FireFox returns `relatedTarget` as `null` for security reasons, but provides a proprietary `explicitOriginalTarget`.
400
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/explicitOriginalTarget
401
- */
402
- var focusEvent = event;
403
- var relatedTarget = focusEvent.relatedTarget || focusEvent.explicitOriginalTarget;
389
+ var relatedTarget = event.relatedTarget;
404
390
 
405
391
  var focusedInOptionsList = relatedTarget && _this.listRefInstance && _this.listRefInstance.contains(relatedTarget);
406
392
 
@@ -845,6 +831,7 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
845
831
  className: classes,
846
832
  "data-test-subj": dataTestSubj,
847
833
  onKeyDown: this.onKeyDown,
834
+ onBlur: this.onContainerBlur,
848
835
  ref: this.comboBoxRefCallback
849
836
  }), ___EmotionJSX(EuiComboBoxInput, {
850
837
  autoSizeInputRef: this.autoSizeInputRefCallback,
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["align", "children", "className", "compressed", "descriptionProps", "listItems", "textStyle", "titleProps", "type"];
3
+ var _excluded = ["align", "children", "className", "compressed", "descriptionProps", "listItems", "textStyle", "titleProps", "type", "gutterSize"];
4
4
 
5
5
  /*
6
6
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -31,6 +31,8 @@ export var EuiDescriptionList = function EuiDescriptionList(_ref) {
31
31
  titleProps = _ref.titleProps,
32
32
  _ref$type = _ref.type,
33
33
  type = _ref$type === void 0 ? 'row' : _ref$type,
34
+ _ref$gutterSize = _ref.gutterSize,
35
+ gutterSize = _ref$gutterSize === void 0 ? 'm' : _ref$gutterSize,
34
36
  rest = _objectWithoutProperties(_ref, _excluded);
35
37
 
36
38
  var euiTheme = useEuiTheme();
@@ -56,7 +58,8 @@ export var EuiDescriptionList = function EuiDescriptionList(_ref) {
56
58
  type: type,
57
59
  compressed: compressed,
58
60
  textStyle: textStyle,
59
- align: align
61
+ align: align,
62
+ gutterSize: gutterSize
60
63
  }
61
64
  }, ___EmotionJSX("dl", _extends({
62
65
  className: classes,
@@ -9,6 +9,7 @@ import { createContext } from 'react';
9
9
  export var contextDefaults = {
10
10
  type: 'row',
11
11
  textStyle: 'normal',
12
- align: 'left'
12
+ align: 'left',
13
+ gutterSize: 'm'
13
14
  };
14
15
  export var EuiDescriptionListContext = /*#__PURE__*/createContext(contextDefaults);
@@ -26,7 +26,8 @@ export var EuiDescriptionListDescription = function EuiDescriptionListDescriptio
26
26
  type = _useContext.type,
27
27
  textStyle = _useContext.textStyle,
28
28
  compressed = _useContext.compressed,
29
- align = _useContext.align;
29
+ align = _useContext.align,
30
+ gutterSize = _useContext.gutterSize;
30
31
 
31
32
  var theme = useEuiTheme();
32
33
  var styles = euiDescriptionListDescriptionStyles(theme);
@@ -43,6 +44,7 @@ export var EuiDescriptionListDescription = function EuiDescriptionListDescriptio
43
44
  conditionalStyles.push(styles.left);
44
45
  }
45
46
 
47
+ conditionalStyles.push(styles[gutterSize]);
46
48
  break;
47
49
  }
48
50
 
@@ -22,7 +22,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
22
22
 
23
23
  export var euiDescriptionListDescriptionStyles = function euiDescriptionListDescriptionStyles(euiThemeContext) {
24
24
  var euiTheme = euiThemeContext.euiTheme;
25
- var columnDisplay = "\n ".concat(logicalCSS('width', '50%'), " // Flex-basis doesn't work in IE with padding\n ").concat(logicalCSS('padding-left', euiTheme.size.s), "\n &:not(:first-of-type) {\n ").concat(logicalCSS('margin-top', euiTheme.size.base), "\n }\n ");
25
+ var columnDisplay = "\n ".concat(logicalCSS('width', '50%'), "\n ").concat(logicalCSS('padding-left', euiTheme.size.s), "\n ");
26
26
  return {
27
27
  euiDescriptionList__description: /*#__PURE__*/css(";label:euiDescriptionList__description;"),
28
28
  // Types
@@ -42,6 +42,9 @@ export var euiDescriptionListDescriptionStyles = function euiDescriptionListDesc
42
42
  normal: /*#__PURE__*/css(euiFontSize(euiThemeContext, 's'), ";;label:normal;")
43
43
  },
44
44
  // Column types should align description text to the left when EuiDecriptionList is centered
45
- left: /*#__PURE__*/css(logicalTextAlignCSS('left'), ";;label:left;")
45
+ left: /*#__PURE__*/css(logicalTextAlignCSS('left'), ";;label:left;"),
46
+ // Gutter
47
+ s: /*#__PURE__*/css("&:not(:first-of-type){", logicalCSS('margin-top', euiTheme.size.s), ";};label:s;"),
48
+ m: /*#__PURE__*/css("&:not(:first-of-type){", logicalCSS('margin-top', euiTheme.size.base), ";};label:m;")
46
49
  };
47
50
  };
@@ -26,7 +26,8 @@ export var EuiDescriptionListTitle = function EuiDescriptionListTitle(_ref) {
26
26
  type = _useContext.type,
27
27
  textStyle = _useContext.textStyle,
28
28
  compressed = _useContext.compressed,
29
- align = _useContext.align;
29
+ align = _useContext.align,
30
+ gutterSize = _useContext.gutterSize;
30
31
 
31
32
  var theme = useEuiTheme();
32
33
  var styles = euiDescriptionListTitleStyles(theme);
@@ -46,7 +47,7 @@ export var EuiDescriptionListTitle = function EuiDescriptionListTitle(_ref) {
46
47
  break;
47
48
  }
48
49
 
49
- var cssStyles = [styles.euiDescriptionList__title, styles[type]].concat(_toConsumableArray(conditionalStyles));
50
+ var cssStyles = [styles.euiDescriptionList__title, styles[type], styles[gutterSize]].concat(_toConsumableArray(conditionalStyles));
50
51
  var classes = classNames('euiDescriptionList__title', className);
51
52
  return ___EmotionJSX("dt", _extends({
52
53
  className: classes,
@@ -12,9 +12,9 @@ import { euiTitle } from '../title/title.styles';
12
12
  export var euiDescriptionListTitleStyles = function euiDescriptionListTitleStyles(euiThemeContext) {
13
13
  var euiTheme = euiThemeContext.euiTheme,
14
14
  colorMode = euiThemeContext.colorMode;
15
- var columnDisplay = "\n ".concat(logicalCSS('width', '50%'), " // Flex-basis doesn't work in IE with padding\n ").concat(logicalCSS('padding-right', euiTheme.size.s), "\n ");
15
+ var columnDisplay = "\n ".concat(logicalCSS('width', '50%'), "\n ").concat(logicalCSS('padding-right', euiTheme.size.s), "\n ");
16
16
  return {
17
- euiDescriptionList__title: /*#__PURE__*/css(euiTextBreakWord(), "&:not(:first-of-type){", logicalCSS('margin-top', euiTheme.size.base), ";};label:euiDescriptionList__title;"),
17
+ euiDescriptionList__title: /*#__PURE__*/css(euiTextBreakWord(), ";;label:euiDescriptionList__title;"),
18
18
  // Types
19
19
  row: /*#__PURE__*/css(";label:row;"),
20
20
  column: /*#__PURE__*/css(columnDisplay, ";;label:column;"),
@@ -32,6 +32,10 @@ export var euiDescriptionListTitleStyles = function euiDescriptionListTitleStyle
32
32
  compressed: /*#__PURE__*/css(euiFontSize(euiThemeContext, 'xs'), ";", logicalCSS('padding-vertical', '0'), " ", logicalCSS('padding-horizontal', euiTheme.size.xs), ";;label:compressed;")
33
33
  },
34
34
  // Alignment
35
- right: /*#__PURE__*/css(logicalTextAlignCSS('right'), ";;label:right;")
35
+ right: /*#__PURE__*/css(logicalTextAlignCSS('right'), ";;label:right;"),
36
+ // Gutter
37
+ // Add margin only to the non-first <dt>.
38
+ s: /*#__PURE__*/css("&:not(:first-of-type){", logicalCSS('margin-top', euiTheme.size.s), ";};label:s;"),
39
+ m: /*#__PURE__*/css("&:not(:first-of-type){", logicalCSS('margin-top', euiTheme.size.base), ";};label:m;")
36
40
  };
37
41
  };
@@ -7,4 +7,5 @@
7
7
  */
8
8
  export var TYPES = ['row', 'inline', 'column', 'responsiveColumn'];
9
9
  export var ALIGNMENTS = ['center', 'left'];
10
- export var TEXT_STYLES = ['normal', 'reverse'];
10
+ export var TEXT_STYLES = ['normal', 'reverse'];
11
+ export var GUTTER_SIZES = ['s', 'm'];
@@ -68,26 +68,16 @@ export var EuiFieldSearch = /*#__PURE__*/function (_Component) {
68
68
 
69
69
  if (nativeInputValueSetter) {
70
70
  nativeInputValueSetter.call(_this.inputElement, '');
71
- } // dispatch input event, with IE11 support/fallback
71
+ } // dispatch input event
72
72
 
73
73
 
74
- var event;
75
-
76
- if ('Event' in window && typeof Event === 'function') {
77
- event = new Event('input', {
78
- bubbles: true,
79
- cancelable: false
80
- });
81
- } else {
82
- // IE11
83
- event = document.createEvent('Event');
84
- event.initEvent('input', true, false);
85
- }
74
+ var event = new Event('input', {
75
+ bubbles: true,
76
+ cancelable: false
77
+ });
86
78
 
87
79
  if (_this.inputElement) {
88
- if (event) {
89
- _this.inputElement.dispatchEvent(event);
90
- } // set focus on the search field
80
+ _this.inputElement.dispatchEvent(event); // set focus on the search field
91
81
 
92
82
 
93
83
  _this.inputElement.focus();
@@ -29,7 +29,7 @@ export var EuiRangeInput = function EuiRangeInput(_ref) {
29
29
  autoSize = _ref$autoSize === void 0 ? true : _ref$autoSize,
30
30
  rest = _objectWithoutProperties(_ref, _excluded);
31
31
 
32
- // Chrome will properly size the input based on the max value, but FF & IE do not.
32
+ // Chrome will properly size the input based on the max value, but FF does not.
33
33
  // Calculate the width of the input based on highest number of characters.
34
34
  // Add 2 to accommodate for input stepper
35
35
  var widthStyle = autoSize ? {
@@ -24,8 +24,9 @@ export var EuiHeaderSectionItem = function EuiHeaderSectionItem(_ref) {
24
24
  className = _ref.className,
25
25
  rest = _objectWithoutProperties(_ref, _excluded);
26
26
 
27
- var classes = classNames('euiHeaderSectionItem', borderToClassNameMap[border], className);
28
- return ___EmotionJSX("div", _extends({
27
+ var classes = classNames('euiHeaderSectionItem', borderToClassNameMap[border], className); // we check if there is any children and if not, we don't render anything
28
+
29
+ return children ? ___EmotionJSX("div", _extends({
29
30
  className: classes
30
- }, rest), children);
31
+ }, rest), children) : null;
31
32
  };