@elastic/eui 73.0.0 → 74.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 (63) hide show
  1. package/dist/eui_theme_dark.css +0 -55
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +0 -55
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/basic_table/basic_table.js +56 -101
  6. package/es/components/basic_table/basic_table.styles.js +45 -0
  7. package/es/components/modal/confirm_modal.js +5 -3
  8. package/es/components/modal/modal.a11y.js +1 -1
  9. package/es/components/modal/modal_header_title.js +12 -3
  10. package/es/components/resizable_container/resizable_panel.js +5 -0
  11. package/es/services/security/get_secure_rel_for_target.js +2 -8
  12. package/es/services/theme/hooks.js +18 -0
  13. package/es/services/theme/index.js +1 -1
  14. package/eui.d.ts +46 -19
  15. package/i18ntokens.json +18 -18
  16. package/lib/components/basic_table/basic_table.js +56 -100
  17. package/lib/components/basic_table/basic_table.styles.js +54 -0
  18. package/lib/components/modal/confirm_modal.js +5 -3
  19. package/lib/components/modal/modal.a11y.js +1 -1
  20. package/lib/components/modal/modal_header_title.js +12 -3
  21. package/lib/components/resizable_container/resizable_panel.js +5 -0
  22. package/lib/services/security/get_secure_rel_for_target.js +2 -9
  23. package/lib/services/theme/hooks.js +22 -2
  24. package/lib/services/theme/index.js +6 -0
  25. package/optimize/es/components/basic_table/basic_table.js +56 -101
  26. package/optimize/es/components/basic_table/basic_table.styles.js +45 -0
  27. package/optimize/es/components/modal/confirm_modal.js +4 -3
  28. package/optimize/es/components/modal/modal.a11y.js +1 -1
  29. package/optimize/es/components/modal/modal_header_title.js +4 -2
  30. package/optimize/es/services/security/get_secure_rel_for_target.js +2 -8
  31. package/optimize/es/services/theme/hooks.js +18 -0
  32. package/optimize/es/services/theme/index.js +1 -1
  33. package/optimize/lib/components/basic_table/basic_table.js +56 -95
  34. package/optimize/lib/components/basic_table/basic_table.styles.js +56 -0
  35. package/optimize/lib/components/modal/confirm_modal.js +4 -3
  36. package/optimize/lib/components/modal/modal.a11y.js +1 -1
  37. package/optimize/lib/components/modal/modal_header_title.js +4 -2
  38. package/optimize/lib/services/security/get_secure_rel_for_target.js +2 -9
  39. package/optimize/lib/services/theme/hooks.js +22 -2
  40. package/optimize/lib/services/theme/index.js +6 -0
  41. package/package.json +1 -1
  42. package/src/components/index.scss +0 -1
  43. package/test-env/components/basic_table/basic_table.js +56 -95
  44. package/test-env/components/basic_table/basic_table.styles.js +56 -0
  45. package/test-env/components/modal/confirm_modal.js +5 -3
  46. package/test-env/components/modal/modal.a11y.js +1 -1
  47. package/test-env/components/modal/modal_header_title.js +12 -3
  48. package/test-env/components/resizable_container/resizable_panel.js +5 -0
  49. package/test-env/services/security/get_secure_rel_for_target.js +2 -9
  50. package/test-env/services/theme/hooks.js +22 -2
  51. package/test-env/services/theme/index.js +6 -0
  52. package/CHANGELOG.md +0 -6185
  53. package/es/services/url.js +0 -23
  54. package/lib/services/url.js +0 -32
  55. package/optimize/es/services/url.js +0 -23
  56. package/optimize/lib/services/url.js +0 -32
  57. package/src/components/basic_table/_basic_table.scss +0 -41
  58. package/src/components/basic_table/_index.scss +0 -1
  59. package/src/components/date_picker/react-datepicker/LICENSE +0 -21
  60. package/src/components/date_picker/react-datepicker/README.md +0 -168
  61. package/src/services/theme/README.md +0 -153
  62. package/src/test/README.md +0 -59
  63. package/test-env/services/url.js +0 -32
package/i18ntokens.json CHANGED
@@ -21,11 +21,11 @@
21
21
  "highlighting": "string",
22
22
  "loc": {
23
23
  "start": {
24
- "line": 312,
24
+ "line": 319,
25
25
  "column": 6
26
26
  },
27
27
  "end": {
28
- "line": 312,
28
+ "line": 319,
29
29
  "column": 79
30
30
  }
31
31
  },
@@ -37,11 +37,11 @@
37
37
  "highlighting": "string",
38
38
  "loc": {
39
39
  "start": {
40
- "line": 674,
40
+ "line": 621,
41
41
  "column": 10
42
42
  },
43
43
  "end": {
44
- "line": 678,
44
+ "line": 625,
45
45
  "column": 12
46
46
  }
47
47
  },
@@ -53,11 +53,11 @@
53
53
  "highlighting": "string",
54
54
  "loc": {
55
55
  "start": {
56
- "line": 687,
56
+ "line": 634,
57
57
  "column": 12
58
58
  },
59
59
  "end": {
60
- "line": 691,
60
+ "line": 638,
61
61
  "column": 14
62
62
  }
63
63
  },
@@ -69,11 +69,11 @@
69
69
  "highlighting": "string",
70
70
  "loc": {
71
71
  "start": {
72
- "line": 695,
72
+ "line": 642,
73
73
  "column": 12
74
74
  },
75
75
  "end": {
76
- "line": 699,
76
+ "line": 646,
77
77
  "column": 14
78
78
  }
79
79
  },
@@ -85,11 +85,11 @@
85
85
  "highlighting": "string",
86
86
  "loc": {
87
87
  "start": {
88
- "line": 704,
88
+ "line": 651,
89
89
  "column": 10
90
90
  },
91
91
  "end": {
92
- "line": 708,
92
+ "line": 655,
93
93
  "column": 12
94
94
  }
95
95
  },
@@ -101,11 +101,11 @@
101
101
  "highlighting": "string",
102
102
  "loc": {
103
103
  "start": {
104
- "line": 750,
104
+ "line": 697,
105
105
  "column": 6
106
106
  },
107
107
  "end": {
108
- "line": 750,
108
+ "line": 697,
109
109
  "column": 77
110
110
  }
111
111
  },
@@ -117,11 +117,11 @@
117
117
  "highlighting": "string",
118
118
  "loc": {
119
119
  "start": {
120
- "line": 1143,
120
+ "line": 1097,
121
121
  "column": 8
122
122
  },
123
123
  "end": {
124
- "line": 1143,
124
+ "line": 1097,
125
125
  "column": 79
126
126
  }
127
127
  },
@@ -133,11 +133,11 @@
133
133
  "highlighting": "string",
134
134
  "loc": {
135
135
  "start": {
136
- "line": 1363,
136
+ "line": 1318,
137
137
  "column": 8
138
138
  },
139
139
  "end": {
140
- "line": 1367,
140
+ "line": 1322,
141
141
  "column": 9
142
142
  }
143
143
  },
@@ -5189,11 +5189,11 @@
5189
5189
  "highlighting": "string",
5190
5190
  "loc": {
5191
5191
  "start": {
5192
- "line": 314,
5192
+ "line": 318,
5193
5193
  "column": 32
5194
5194
  },
5195
5195
  "end": {
5196
- "line": 317,
5196
+ "line": 321,
5197
5197
  "column": 3
5198
5198
  }
5199
5199
  },
@@ -42,6 +42,8 @@ var _delay_render = require("../delay_render");
42
42
 
43
43
  var _accessibility2 = require("../../services/accessibility");
44
44
 
45
+ var _basic_table = require("./basic_table.styles");
46
+
45
47
  var _react2 = require("@emotion/react");
46
48
 
47
49
  var _excluded = ["className", "loading", "items", "itemId", "columns", "pagination", "sorting", "selection", "onChange", "error", "noItemsMessage", "compressed", "itemIdToExpandedRowMap", "responsive", "isSelectable", "isExpandable", "hasActions", "rowProps", "cellProps", "tableCaption", "rowHeader", "tableLayout"],
@@ -202,45 +204,6 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
202
204
 
203
205
  _this = _super.call(this, props);
204
206
 
205
- _defineProperty(_assertThisInitialized(_this), "cleanups", []);
206
-
207
- _defineProperty(_assertThisInitialized(_this), "tbody", null);
208
-
209
- _defineProperty(_assertThisInitialized(_this), "setTbody", function (tbody) {
210
- // remove listeners from an existing element
211
- _this.removeLoadingListeners(); // update the ref
212
-
213
-
214
- _this.tbody = tbody; // if loading, add listeners
215
-
216
- if (_this.props.loading === true && tbody) {
217
- _this.addLoadingListeners(tbody);
218
- }
219
- });
220
-
221
- _defineProperty(_assertThisInitialized(_this), "addLoadingListeners", function (tbody) {
222
- var listener = function listener(event) {
223
- event.stopPropagation();
224
- event.preventDefault();
225
- };
226
-
227
- ['mousedown', 'mouseup', 'mouseover', 'mouseout', 'mouseenter', 'mouseleave', 'click', 'dblclick', 'keydown', 'keyup', 'keypress'].forEach(function (event) {
228
- tbody.addEventListener(event, listener, true);
229
-
230
- _this.cleanups.push(function () {
231
- tbody.removeEventListener(event, listener, true);
232
- });
233
- });
234
- });
235
-
236
- _defineProperty(_assertThisInitialized(_this), "removeLoadingListeners", function () {
237
- _this.cleanups.forEach(function (cleanup) {
238
- return cleanup();
239
- });
240
-
241
- _this.cleanups.length = 0;
242
- });
243
-
244
207
  _defineProperty(_assertThisInitialized(_this), "tableId", (0, _accessibility2.htmlIdGenerator)('__table')());
245
208
 
246
209
  _defineProperty(_assertThisInitialized(_this), "selectAllIdGenerator", (0, _accessibility2.htmlIdGenerator)('_selection_column-checkbox'));
@@ -332,27 +295,13 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
332
295
  _createClass(EuiBasicTable, [{
333
296
  key: "componentDidMount",
334
297
  value: function componentDidMount() {
335
- if (this.props.loading && this.tbody) this.addLoadingListeners(this.tbody);
336
298
  this.getInitialSelection();
337
299
  }
338
300
  }, {
339
301
  key: "componentDidUpdate",
340
- value: function componentDidUpdate(prevProps) {
341
- if (prevProps.loading !== this.props.loading) {
342
- if (this.props.loading && this.tbody) {
343
- this.addLoadingListeners(this.tbody);
344
- } else {
345
- this.removeLoadingListeners();
346
- }
347
- }
348
-
302
+ value: function componentDidUpdate() {
349
303
  this.getInitialSelection();
350
304
  }
351
- }, {
352
- key: "componentWillUnmount",
353
- value: function componentWillUnmount() {
354
- this.removeLoadingListeners();
355
- }
356
305
  }, {
357
306
  key: "getInitialSelection",
358
307
  value: function getInitialSelection() {
@@ -513,7 +462,8 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
513
462
  var _this$props3 = this.props,
514
463
  compressed = _this$props3.compressed,
515
464
  responsive = _this$props3.responsive,
516
- tableLayout = _this$props3.tableLayout;
465
+ tableLayout = _this$props3.tableLayout,
466
+ loading = _this$props3.loading;
517
467
  var mobileHeader = responsive ? (0, _react2.jsx)(_table.EuiTableHeaderMobile, null, (0, _react2.jsx)(_flex.EuiFlexGroup, {
518
468
  responsive: false,
519
469
  justifyContent: "spaceBetween",
@@ -531,7 +481,8 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
531
481
  id: this.tableId,
532
482
  tableLayout: tableLayout,
533
483
  responsive: responsive,
534
- compressed: compressed
484
+ compressed: compressed,
485
+ css: loading && _basic_table.safariLoadingWorkaround
535
486
  }, caption, head, body, footer));
536
487
  }
537
488
  }, {
@@ -794,30 +745,35 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
794
745
  value: function renderTableBody() {
795
746
  var _this4 = this;
796
747
 
797
- if (this.props.error) {
798
- return this.renderErrorBody(this.props.error);
799
- }
800
-
801
- var items = this.props.items;
802
-
803
- if (items.length === 0) {
804
- return this.renderEmptyBody();
748
+ var _this$props8 = this.props,
749
+ error = _this$props8.error,
750
+ loading = _this$props8.loading,
751
+ items = _this$props8.items;
752
+ var content;
753
+
754
+ if (error) {
755
+ content = this.renderErrorMessage(error);
756
+ } else if (items.length === 0) {
757
+ content = this.renderEmptyMessage();
758
+ } else {
759
+ content = items.map(function (item, index) {
760
+ // if there's pagination the item's index must be adjusted to the where it is in the whole dataset
761
+ var tableItemIndex = hasPagination(_this4.props) && _this4.props.pagination.pageSize > 0 ? _this4.props.pagination.pageIndex * _this4.props.pagination.pageSize + index : index;
762
+ return _this4.renderItemRow(item, tableItemIndex);
763
+ });
805
764
  }
806
765
 
807
- var rows = items.map(function (item, index) {
808
- // if there's pagination the item's index must be adjusted to the where it is in the whole dataset
809
- var tableItemIndex = hasPagination(_this4.props) && _this4.props.pagination.pageSize > 0 ? _this4.props.pagination.pageIndex * _this4.props.pagination.pageSize + index : index;
810
- return _this4.renderItemRow(item, tableItemIndex);
766
+ return (0, _react2.jsx)(_services.RenderWithEuiTheme, null, function (theme) {
767
+ return (0, _react2.jsx)(_table.EuiTableBody, {
768
+ css: loading && (0, _basic_table.euiBasicTableBodyLoading)(theme)
769
+ }, content);
811
770
  });
812
- return (0, _react2.jsx)(_table.EuiTableBody, {
813
- bodyRef: this.setTbody
814
- }, rows);
815
771
  }
816
772
  }, {
817
- key: "renderErrorBody",
818
- value: function renderErrorBody(error) {
773
+ key: "renderErrorMessage",
774
+ value: function renderErrorMessage(error) {
819
775
  var colSpan = this.props.columns.length + (this.props.selection ? 1 : 0);
820
- return (0, _react2.jsx)(_table.EuiTableBody, null, (0, _react2.jsx)(_table.EuiTableRow, null, (0, _react2.jsx)(_table.EuiTableRowCell, {
776
+ return (0, _react2.jsx)(_table.EuiTableRow, null, (0, _react2.jsx)(_table.EuiTableRowCell, {
821
777
  align: "center",
822
778
  colSpan: colSpan,
823
779
  mobileOptions: {
@@ -826,38 +782,38 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
826
782
  }, (0, _react2.jsx)(_icon.EuiIcon, {
827
783
  type: "minusInCircle",
828
784
  color: "danger"
829
- }), " ", error)));
785
+ }), " ", error));
830
786
  }
831
787
  }, {
832
- key: "renderEmptyBody",
833
- value: function renderEmptyBody() {
834
- var _this$props8 = this.props,
835
- columns = _this$props8.columns,
836
- selection = _this$props8.selection,
837
- noItemsMessage = _this$props8.noItemsMessage;
788
+ key: "renderEmptyMessage",
789
+ value: function renderEmptyMessage() {
790
+ var _this$props9 = this.props,
791
+ columns = _this$props9.columns,
792
+ selection = _this$props9.selection,
793
+ noItemsMessage = _this$props9.noItemsMessage;
838
794
  var colSpan = columns.length + (selection ? 1 : 0);
839
- return (0, _react2.jsx)(_table.EuiTableBody, null, (0, _react2.jsx)(_table.EuiTableRow, null, (0, _react2.jsx)(_table.EuiTableRowCell, {
795
+ return (0, _react2.jsx)(_table.EuiTableRow, null, (0, _react2.jsx)(_table.EuiTableRowCell, {
840
796
  align: "center",
841
797
  colSpan: colSpan,
842
798
  mobileOptions: {
843
799
  width: '100%'
844
800
  }
845
- }, noItemsMessage)));
801
+ }, noItemsMessage));
846
802
  }
847
803
  }, {
848
804
  key: "renderItemRow",
849
805
  value: function renderItemRow(item, rowIndex) {
850
806
  var _this5 = this;
851
807
 
852
- var _this$props9 = this.props,
853
- columns = _this$props9.columns,
854
- selection = _this$props9.selection,
855
- isSelectable = _this$props9.isSelectable,
856
- hasActions = _this$props9.hasActions,
857
- rowHeader = _this$props9.rowHeader,
858
- _this$props9$itemIdTo = _this$props9.itemIdToExpandedRowMap,
859
- itemIdToExpandedRowMap = _this$props9$itemIdTo === void 0 ? {} : _this$props9$itemIdTo,
860
- isExpandable = _this$props9.isExpandable;
808
+ var _this$props10 = this.props,
809
+ columns = _this$props10.columns,
810
+ selection = _this$props10.selection,
811
+ isSelectable = _this$props10.isSelectable,
812
+ hasActions = _this$props10.hasActions,
813
+ rowHeader = _this$props10.rowHeader,
814
+ _this$props10$itemIdT = _this$props10.itemIdToExpandedRowMap,
815
+ itemIdToExpandedRowMap = _this$props10$itemIdT === void 0 ? {} : _this$props10$itemIdT,
816
+ isExpandable = _this$props10.isExpandable;
861
817
  var cells = [];
862
818
  var itemIdCallback = this.props.itemId;
863
819
  var itemId = getItemId(item, itemIdCallback) != null ? getItemId(item, itemIdCallback) : rowIndex;
@@ -1009,7 +965,8 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
1009
965
  key: key,
1010
966
  align: "right",
1011
967
  textOnly: false,
1012
- hasActions: true
968
+ hasActions: true,
969
+ css: _basic_table.euiBasicTableActionsWrapper
1013
970
  }, tools);
1014
971
  }
1015
972
  }, {
@@ -1094,11 +1051,11 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
1094
1051
  value: function renderPaginationBar() {
1095
1052
  var _this8 = this;
1096
1053
 
1097
- var _this$props10 = this.props,
1098
- error = _this$props10.error,
1099
- pagination = _this$props10.pagination,
1100
- tableCaption = _this$props10.tableCaption,
1101
- onChange = _this$props10.onChange;
1054
+ var _this$props11 = this.props,
1055
+ error = _this$props11.error,
1056
+ pagination = _this$props11.pagination,
1057
+ tableCaption = _this$props11.tableCaption,
1058
+ onChange = _this$props11.onChange;
1102
1059
 
1103
1060
  if (!error && pagination && pagination.totalItemCount > 0) {
1104
1061
  if (!onChange) {
@@ -1150,8 +1107,7 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
1150
1107
  }
1151
1108
 
1152
1109
  return null;
1153
- } // used for moving in & out of `loading` state
1154
-
1110
+ }
1155
1111
  }]);
1156
1112
 
1157
1113
  return EuiBasicTable;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.safariLoadingWorkaround = exports.euiBasicTableBodyLoading = exports.euiBasicTableActionsWrapper = void 0;
7
+
8
+ var _react = require("@emotion/react");
9
+
10
+ var _global_styling = require("../../global_styling");
11
+
12
+ var _templateObject;
13
+
14
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
15
+
16
+ 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)."; }
17
+
18
+ var tableLoadingLine = (0, _react.keyframes)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n from {\n ", "\n ", "\n }\n\n 20% {\n ", "\n ", "\n }\n\n 80% {\n ", "\n ", "\n }\n\n 100% {\n ", "\n ", "\n }\n"])), (0, _global_styling.logicalCSS)('left', 0), (0, _global_styling.logicalCSS)('width', 0), (0, _global_styling.logicalCSS)('left', 0), (0, _global_styling.logicalCSS)('width', '40%'), (0, _global_styling.logicalCSS)('left', '60%'), (0, _global_styling.logicalCSS)('width', '40%'), (0, _global_styling.logicalCSS)('left', '100%'), (0, _global_styling.logicalCSS)('width', 0));
19
+
20
+ var euiBasicTableBodyLoading = function euiBasicTableBodyLoading(_ref2) {
21
+ var euiTheme = _ref2.euiTheme;
22
+ return /*#__PURE__*/(0, _react.css)("position:relative;overflow:hidden;&::before{position:absolute;content:'';", (0, _global_styling.logicalCSS)('width', '100%'), " ", (0, _global_styling.logicalCSS)('height', euiTheme.border.width.thick), " background-color:", euiTheme.colors.primary, ";animation:", tableLoadingLine, " 1s linear infinite;", _global_styling.euiCantAnimate, "{animation-duration:2s;}};label:euiBasicTableBodyLoading;");
23
+ }; // Fix to make the loading indicator position correctly in Safari
24
+ // For whatever annoying reason, Safari doesn't respect `position: relative;`
25
+ // on `tbody` without `position: relative` on the parent `table`
26
+
27
+
28
+ exports.euiBasicTableBodyLoading = euiBasicTableBodyLoading;
29
+
30
+ var _ref = process.env.NODE_ENV === "production" ? {
31
+ name: "6xbnw4-safariLoadingWorkaround",
32
+ styles: "position:relative;label:safariLoadingWorkaround;"
33
+ } : {
34
+ name: "6xbnw4-safariLoadingWorkaround",
35
+ styles: "position:relative;label:safariLoadingWorkaround;",
36
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
37
+ };
38
+
39
+ var safariLoadingWorkaround = function safariLoadingWorkaround() {
40
+ return _ref;
41
+ }; // Unsets the extra height caused by tooltip/popover wrappers around table action buttons
42
+ // Without this, the row height jumps whenever actions are disabled
43
+
44
+
45
+ exports.safariLoadingWorkaround = safariLoadingWorkaround;
46
+ var euiBasicTableActionsWrapper = process.env.NODE_ENV === "production" ? {
47
+ name: "1mshepa-euiBasicTableActionsWrapper",
48
+ styles: "line-height:1;label:euiBasicTableActionsWrapper;"
49
+ } : {
50
+ name: "1mshepa-euiBasicTableActionsWrapper",
51
+ styles: "line-height:1;label:euiBasicTableActionsWrapper;",
52
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
53
+ };
54
+ exports.euiBasicTableActionsWrapper = euiBasicTableActionsWrapper;
@@ -33,7 +33,7 @@ var _text = require("../text");
33
33
 
34
34
  var _react2 = require("@emotion/react");
35
35
 
36
- var _excluded = ["children", "title", "onCancel", "onConfirm", "cancelButtonText", "confirmButtonText", "confirmButtonDisabled", "className", "buttonColor", "defaultFocusedButton", "isLoading"];
36
+ var _excluded = ["children", "title", "titleProps", "onCancel", "onConfirm", "cancelButtonText", "confirmButtonText", "confirmButtonDisabled", "className", "buttonColor", "defaultFocusedButton", "isLoading"];
37
37
 
38
38
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
39
39
 
@@ -67,6 +67,7 @@ exports.CANCEL_BUTTON = CANCEL_BUTTON;
67
67
  var EuiConfirmModal = function EuiConfirmModal(_ref) {
68
68
  var children = _ref.children,
69
69
  title = _ref.title,
70
+ titleProps = _ref.titleProps,
70
71
  onCancel = _ref.onCancel,
71
72
  onConfirm = _ref.onConfirm,
72
73
  cancelButtonText = _ref.cancelButtonText,
@@ -118,9 +119,9 @@ var EuiConfirmModal = function EuiConfirmModal(_ref) {
118
119
  var modalTitle;
119
120
 
120
121
  if (title) {
121
- modalTitle = (0, _react2.jsx)(_modal_header.EuiModalHeader, null, (0, _react2.jsx)(_modal_header_title.EuiModalHeaderTitle, {
122
+ modalTitle = (0, _react2.jsx)(_modal_header.EuiModalHeader, null, (0, _react2.jsx)(_modal_header_title.EuiModalHeaderTitle, _extends({
122
123
  "data-test-subj": "confirmModalTitleText"
123
- }, title));
124
+ }, titleProps), title));
124
125
  }
125
126
 
126
127
  var message;
@@ -159,6 +160,7 @@ EuiConfirmModal.propTypes = {
159
160
  */
160
161
  children: _propTypes.default.node,
161
162
  title: _propTypes.default.node,
163
+ titleProps: _propTypes.default.any,
162
164
  cancelButtonText: _propTypes.default.node,
163
165
  confirmButtonText: _propTypes.default.node,
164
166
  onCancel: _propTypes.default.func.isRequired,
@@ -47,7 +47,7 @@ var Modal = function Modal() {
47
47
  };
48
48
  return (0, _react2.jsx)("div", null, (0, _react2.jsx)(_button.EuiButton, {
49
49
  onClick: showModal
50
- }, "Show confirm modal"), isModalVisible && (0, _react2.jsx)(_index.EuiModal, modalProps, (0, _react2.jsx)(_index.EuiModalHeader, null, (0, _react2.jsx)(_index.EuiModalHeaderTitle, null, (0, _react2.jsx)("h1", null, "Title of modal"))), (0, _react2.jsx)(_index.EuiModalBody, null, (0, _react2.jsx)("p", null, "This is a simple modal body")), (0, _react2.jsx)(_index.EuiModalFooter, null, (0, _react2.jsx)(_button.EuiButton, {
50
+ }, "Show confirm modal"), isModalVisible && (0, _react2.jsx)(_index.EuiModal, modalProps, (0, _react2.jsx)(_index.EuiModalHeader, null, (0, _react2.jsx)(_index.EuiModalHeaderTitle, null, "Title of modal")), (0, _react2.jsx)(_index.EuiModalBody, null, (0, _react2.jsx)("p", null, "This is a simple modal body")), (0, _react2.jsx)(_index.EuiModalFooter, null, (0, _react2.jsx)(_button.EuiButton, {
51
51
  onClick: closeModal,
52
52
  fill: true
53
53
  }, "Close"))));
@@ -15,7 +15,7 @@ var _title = require("../title");
15
15
 
16
16
  var _react2 = require("@emotion/react");
17
17
 
18
- var _excluded = ["className", "children"];
18
+ var _excluded = ["className", "children", "component"];
19
19
 
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
 
@@ -28,13 +28,15 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
28
28
  var EuiModalHeaderTitle = function EuiModalHeaderTitle(_ref) {
29
29
  var className = _ref.className,
30
30
  children = _ref.children,
31
+ _ref$component = _ref.component,
32
+ Component = _ref$component === void 0 ? 'h1' : _ref$component,
31
33
  rest = _objectWithoutProperties(_ref, _excluded);
32
34
 
33
35
  var classes = (0, _classnames.default)('euiModalHeader__title', className);
34
36
  return (0, _react2.jsx)(_title.EuiTitle, _extends({
35
37
  size: "m",
36
38
  className: classes
37
- }, rest), /*#__PURE__*/_react.default.isValidElement(children) ? children : (0, _react2.jsx)("h1", null, children));
39
+ }, rest), (0, _react2.jsx)(Component, null, children));
38
40
  };
39
41
 
40
42
  exports.EuiModalHeaderTitle = EuiModalHeaderTitle;
@@ -42,5 +44,12 @@ EuiModalHeaderTitle.propTypes = {
42
44
  className: _propTypes.default.string,
43
45
  "aria-label": _propTypes.default.string,
44
46
  "data-test-subj": _propTypes.default.string,
45
- css: _propTypes.default.any
47
+ css: _propTypes.default.any,
48
+
49
+ /**
50
+ * The tag to render. Can be changed to a lower heading
51
+ * level like `h2` or a container `div`.
52
+ * @default h1
53
+ */
54
+ component: _propTypes.default.any
46
55
  };
@@ -329,6 +329,11 @@ EuiResizablePanel.propTypes = {
329
329
  */
330
330
  style: _propTypes.default.any,
331
331
 
332
+ /**
333
+ * tabIndex={0} provides full keyboard access when content overflows `<EuiResizablePanel />`
334
+ */
335
+ tabIndex: _propTypes.default.number,
336
+
332
337
  /**
333
338
  * Props to add to the wrapping `.euiResizablePanel` div
334
339
  */
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getSecureRelForTarget = void 0;
7
7
 
8
- var _url = require("../url");
9
-
10
8
  /*
11
9
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
12
10
  * or more contributor license agreements. Licensed under the Elastic License
@@ -20,18 +18,13 @@ var _url = require("../url");
20
18
  * https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/
21
19
  */
22
20
  var getSecureRelForTarget = function getSecureRelForTarget(_ref) {
23
- var href = _ref.href,
24
- _ref$target = _ref.target,
21
+ var _ref$target = _ref.target,
25
22
  target = _ref$target === void 0 ? '' : _ref$target,
26
23
  rel = _ref.rel;
27
- var isElasticHref = !!href && (0, _url.isDomainSecure)(href);
28
24
  var relParts = !!rel ? rel.split(' ').filter(function (part) {
29
25
  return !!part.length && part !== 'noreferrer';
30
26
  }) : [];
31
-
32
- if (!isElasticHref) {
33
- relParts.push('noreferrer');
34
- }
27
+ relParts.push('noreferrer');
35
28
 
36
29
  if (target.includes('_blank') && relParts.indexOf('noopener') === -1) {
37
30
  relParts.push('noopener');
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.withEuiTheme = exports.useEuiTheme = void 0;
8
+ exports.withEuiTheme = exports.useEuiTheme = exports.RenderWithEuiTheme = void 0;
9
9
 
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
 
@@ -22,6 +22,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
22
22
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23
23
 
24
24
  var providerMessage = "`EuiProvider` is missing which can result in negative effects.\nWrap your component in `EuiProvider`: https://ela.st/euiprovider.";
25
+ /**
26
+ * Hook for function components
27
+ */
25
28
 
26
29
  var useEuiTheme = function useEuiTheme() {
27
30
  var theme = (0, _react.useContext)(_context.EuiThemeContext);
@@ -57,6 +60,10 @@ var useEuiTheme = function useEuiTheme() {
57
60
  }, [theme, colorMode, modifications]);
58
61
  return assembledTheme;
59
62
  };
63
+ /**
64
+ * HOC for class components
65
+ */
66
+
60
67
 
61
68
  exports.useEuiTheme = useEuiTheme;
62
69
 
@@ -77,5 +84,18 @@ var withEuiTheme = function withEuiTheme(Component) {
77
84
  WithEuiTheme.displayName = componentName;
78
85
  return WithEuiTheme;
79
86
  };
87
+ /**
88
+ * Render prop alternative for complex class components
89
+ * Most useful for scenarios where a HOC may interfere with typing
90
+ */
91
+
92
+
93
+ exports.withEuiTheme = withEuiTheme;
94
+
95
+ var RenderWithEuiTheme = function RenderWithEuiTheme(_ref) {
96
+ var children = _ref.children;
97
+ var theme = useEuiTheme();
98
+ return children(theme);
99
+ };
80
100
 
81
- exports.withEuiTheme = withEuiTheme;
101
+ exports.RenderWithEuiTheme = RenderWithEuiTheme;
@@ -45,6 +45,12 @@ Object.defineProperty(exports, "EuiThemeProvider", {
45
45
  return _provider.EuiThemeProvider;
46
46
  }
47
47
  });
48
+ Object.defineProperty(exports, "RenderWithEuiTheme", {
49
+ enumerable: true,
50
+ get: function get() {
51
+ return _hooks.RenderWithEuiTheme;
52
+ }
53
+ });
48
54
  Object.defineProperty(exports, "buildTheme", {
49
55
  enumerable: true,
50
56
  get: function get() {