@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
@@ -249,6 +249,12 @@ EuiPinnableListGroup.propTypes = {
249
249
  */
250
250
  buttonRef: _propTypes.default.any,
251
251
 
252
+ /**
253
+ * Text to be displayed in the tooltip when `showToolTip` is true.
254
+ * By default the text will be same as the label text.
255
+ */
256
+ toolTipText: _propTypes.default.string,
257
+
252
258
  /**
253
259
  * Saves the pinned status and changes the visibility of the pin icon
254
260
  */
@@ -359,7 +365,13 @@ EuiPinnableListGroup.propTypes = {
359
365
  * Pass-through ref reference specifically for targeting
360
366
  * instances where the item content is rendered as a `button`
361
367
  */
362
- buttonRef: _propTypes.default.any
368
+ buttonRef: _propTypes.default.any,
369
+
370
+ /**
371
+ * Text to be displayed in the tooltip when `showToolTip` is true.
372
+ * By default the text will be same as the label text.
373
+ */
374
+ toolTipText: _propTypes.default.string
363
375
  }).isRequired)]),
364
376
 
365
377
  /**
@@ -86,9 +86,7 @@ var EuiModal = function EuiModal(_ref) {
86
86
  color: "text",
87
87
  "aria-label": closeModal
88
88
  });
89
- }), (0, _react2.jsx)("div", {
90
- className: "euiModal__flex"
91
- }, children))));
89
+ }), children)));
92
90
  };
93
91
 
94
92
  exports.EuiModal = EuiModal;
@@ -63,7 +63,7 @@ var EuiMutationObserver = /*#__PURE__*/function (_EuiObserver) {
63
63
  exports.EuiMutationObserver = EuiMutationObserver;
64
64
 
65
65
  var makeMutationObserver = function makeMutationObserver(node, _observerOptions, callback) {
66
- // IE11 and the MutationObserver polyfill used in Kibana (for Jest) implement
66
+ // The MutationObserver polyfill used in Kibana (for Jest) implements
67
67
  // an older spec in which specifying `attributeOldValue` or `attributeFilter`
68
68
  // without specifying `attributes` results in a `SyntaxError`.
69
69
  // The following logic patches the newer spec in which `attributes: true` can be
@@ -65,13 +65,17 @@ var EuiPageSidebar = function EuiPageSidebar(_ref) {
65
65
  setInlineStyles = _useState2[1];
66
66
 
67
67
  (0, _react.useEffect)(function () {
68
+ var updatedStyles = _objectSpread(_objectSpread({}, style), (0, _global_styling.logicalStyle)('min-width', isResponding ? '100%' : minWidth));
69
+
68
70
  if (sticky) {
69
71
  var _document$body$datase;
70
72
 
71
73
  var euiHeaderFixedCounter = Number((_document$body$datase = document.body.dataset.fixedHeaders) !== null && _document$body$datase !== void 0 ? _document$body$datase : 0);
72
74
  var offset = (0, _typeof2.default)(sticky) === 'object' ? sticky === null || sticky === void 0 ? void 0 : sticky.offset : themeContext.euiTheme.base * 3 * euiHeaderFixedCounter;
73
- 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)"))));
75
+ updatedStyles = _objectSpread(_objectSpread(_objectSpread({}, updatedStyles), (0, _global_styling.logicalStyle)('top', offset)), (0, _global_styling.logicalStyle)('max-height', "calc(100vh - ".concat(offset, "px)")));
74
76
  }
77
+
78
+ setInlineStyles(updatedStyles);
75
79
  }, [style, sticky, themeContext.euiTheme.base, isResponding, minWidth]);
76
80
  return (0, _react2.jsx)("div", (0, _extends2.default)({
77
81
  className: className,
@@ -216,9 +216,8 @@ EuiTableRowCell.propTypes = {
216
216
  showOnHover: _propTypes.default.bool,
217
217
 
218
218
  /**
219
- * Setting `textOnly` to `false` will break words unnecessarily on FF and
220
- * IE. To combat this problem on FF, wrap contents with the css utility
221
- * `.eui-textBreakWord`.
219
+ * Creates a text wrapper around cell content that helps word break or truncate
220
+ * long text correctly.
222
221
  */
223
222
  textOnly: _propTypes.default.bool,
224
223
 
@@ -239,9 +238,8 @@ EuiTableRowCell.propTypes = {
239
238
  showOnHover: _propTypes.default.bool,
240
239
 
241
240
  /**
242
- * Setting `textOnly` to `false` will break words unnecessarily on FF and
243
- * IE. To combat this problem on FF, wrap contents with the css utility
244
- * `.eui-textBreakWord`.
241
+ * Creates a text wrapper around cell content that helps word break or truncate
242
+ * long text correctly.
245
243
  */
246
244
  textOnly: _propTypes.default.bool,
247
245
 
@@ -135,24 +135,6 @@ var EuiTabbedContent = /*#__PURE__*/function (_Component) {
135
135
  }
136
136
 
137
137
  (0, _createClass2.default)(EuiTabbedContent, [{
138
- key: "componentDidMount",
139
- value: function componentDidMount() {
140
- // IE11 doesn't support the `relatedTarget` event property for blur events
141
- // but does add it for focusout. React doesn't support `onFocusOut` so here we are.
142
- if (this.tabsRef.current) {
143
- // Current short-term solution for event listener (see https://github.com/elastic/eui/pull/2717)
144
- this.tabsRef.current.addEventListener('focusout', this.removeFocus);
145
- }
146
- }
147
- }, {
148
- key: "componentWillUnmount",
149
- value: function componentWillUnmount() {
150
- if (this.tabsRef.current) {
151
- // Current short-term solution for event listener (see https://github.com/elastic/eui/pull/2717)
152
- this.tabsRef.current.removeEventListener('focusout', this.removeFocus);
153
- }
154
- }
155
- }, {
156
138
  key: "render",
157
139
  value: function render() {
158
140
  var _this2 = this;
@@ -180,7 +162,8 @@ var EuiTabbedContent = /*#__PURE__*/function (_Component) {
180
162
  ref: this.tabsRef,
181
163
  expand: expand,
182
164
  size: size,
183
- onFocus: this.initializeFocus
165
+ onFocus: this.initializeFocus,
166
+ onBlur: this.removeFocus
184
167
  }, tabs.map(function (tab) {
185
168
  var id = tab.id,
186
169
  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.
@@ -32,11 +32,14 @@ var useEuiTheme = function useEuiTheme() {
32
32
  var theme = (0, _react.useContext)(_context.EuiThemeContext);
33
33
  var colorMode = (0, _react.useContext)(_context.EuiColorModeContext);
34
34
  var modifications = (0, _react.useContext)(_context.EuiModificationsContext);
35
- return {
36
- euiTheme: theme,
37
- colorMode: colorMode,
38
- modifications: modifications
39
- };
35
+ var assembledTheme = (0, _react.useMemo)(function () {
36
+ return {
37
+ euiTheme: theme,
38
+ colorMode: colorMode,
39
+ modifications: modifications
40
+ };
41
+ }, [theme, colorMode, modifications]);
42
+ return assembledTheme;
40
43
  };
41
44
 
42
45
  exports.useEuiTheme = useEuiTheme;
@@ -47,17 +50,9 @@ var withEuiTheme = function withEuiTheme(Component) {
47
50
  var componentName = Component.displayName || Component.name || 'ComponentWithTheme';
48
51
 
49
52
  var Render = function Render(props, ref) {
50
- var _useEuiTheme = useEuiTheme(),
51
- euiTheme = _useEuiTheme.euiTheme,
52
- colorMode = _useEuiTheme.colorMode,
53
- modifications = _useEuiTheme.modifications;
54
-
53
+ var theme = useEuiTheme();
55
54
  return (0, _react2.jsx)(Component, (0, _extends2.default)({
56
- theme: {
57
- euiTheme: euiTheme,
58
- colorMode: colorMode,
59
- modifications: modifications
60
- },
55
+ theme: theme,
61
56
  ref: ref
62
57
  }, props));
63
58
  };
@@ -1,15 +0,0 @@
1
- // This file utilizes !importants on purpose
2
- // sass-lint:disable no-important
3
-
4
- /**
5
- * IE doesn't properly wrap groups if it is within a flex-item of a flex-group.
6
- * Adding the following styles to the flex-item that contains the wrapping group, will fix IE.
7
- * https://github.com/philipwalton/flexbugs/issues/104
8
- */
9
- .euiIEFlexWrapFix {
10
- @include internetExplorerOnly {
11
- flex-grow: 1;
12
- flex-shrink: 1;
13
- flex-basis: 0%;
14
- }
15
- }